It is currently Mon Oct 20, 2014 4:04 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ] 
Author Message
PostPosted: Thu Apr 26, 2012 9:28 am 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Hello

I come from the c64 scene although I like to program for any 6502 based machine, and so I have tried my hands at other computers such like the atari xl, atari 7800 and oric.

The BBC micro is an interesting beast and I have been wanting to code a game for it.

I have been looking for information about the hardware etc and there are lots of stuff in the internet, now the problem is to sift through it and there are it seems a number of different BBC models...

In the game I have in mind, I am hoping to have a screen of 144x256 pixels(mode 2) and the sprites would be 12x24 pixels, four of them. Double buffered. Would this be possible, what BBC model would be the best, at least a 128k one no? Is the cpu able to manage these sprites?

Which books would you recommend to start coding for this machine, I already have experience with 6502 assembly, so perhaps more about the video chip, memory handling, disk operation....

For example I was looking how to change the video mode using machine code but couldn't find how to do it.

BTW I am using Swift(great stuff) along with Ophis... Any suggestions on other tools essential in your opinion to my aim?

I think is is all for now...

Thanks


Top
 
PostPosted: Thu Apr 26, 2012 12:56 pm 
Offline
 Profile

Joined: Wed Feb 10, 2010 11:18 pm
Posts: 45
Welcome :)

Wood wrote:
In the game I have in mind, I am hoping to have a screen of 144x256 pixels(mode 2) [...] Double buffered. [...] what BBC model would be the best, at least a 128k one no?

That's 36k just for the screens, so not going to work on a 32k Model B :) - a Master 128 might be possible (no idea how you'd go about it, though!). Might be easier to do without the double buffering...


Quote:
and the sprites would be 12x24 pixels, four of them. Would this be possible, [...] Is the cpu able to manage these sprites?

My game, Mixed Grill March, has two 16 x 24 sprites plotted every frame (at the full 50Hz), plus a load of other animation going on, and still has a bit of spare time left, so that should be do-able.

The CPU can't help you with anything graphics-wise. You've got to manually plot everything to screen memory :)


Quote:
Which books would you recommend to start coding for this machine, I already have experience with 6502 assembly, so perhaps more about the video chip, memory handling, disk operation....

If you're familiar with 6502, that's half the battle. I'd look into how the screen memory works next and experiment with plotting something. The BBC advanced user guide is pretty good.

Quote:
For example I was looking how to change the video mode using machine code but couldn't find how to do it.

This is really simple, just a few lines - copying from the sample code on the site (the BBC manual will tell you what address OSWRCH is):
Code:
 ; Switch to mode 2
 lda #$16
 jsr oswrch
 lda #2
 jsr oswrch
 ; now in mode 2 


Good luck! It's quite hard work, but worthwhile when you get something up and running...


Top
 
PostPosted: Thu Apr 26, 2012 1:27 pm 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Thank you so much for this.

I will now be playing with this stuff and see what I come up with and then check the options. My project might be a bit ambitious for a first try but who knows...


Top
 
PostPosted: Thu Apr 26, 2012 4:23 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 7:02 pm
Posts: 273
You will be able to double-buffer that mode on a Master 128. The Master gives two memory banks at $3000-$7fff, the usual screen addresses on the Beeb. You can select the banks for CPU and video accesses separately.

The B+ also gives you two banks, but CPU and video access are tied together, so you can't access the alternate buffer without also displaying it. It's an uncommon machine though, so I wouldn't bother with it.

If you want to run on a standard 32k machine then you'll need to drop the double buffer. As Jools said, your sprite requirements should be doable, though you might have to play with the timing a bit.

Screen memory layout is essentially the same as the C64's bitmap mode.


Top
 
PostPosted: Fri Apr 27, 2012 3:40 pm 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Think you for your input Tomw.

I am checking the options, and it seems to me that the 32k machine would be too tight for this. As I would have only ~14K free for code, gfx and music...


Top
 
PostPosted: Sun Apr 29, 2012 10:50 pm 
Offline
 Profile

Joined: Sat Sep 04, 2010 5:28 pm
Posts: 92
If you can get away with only 4 colours in the game, you can drop screen usage down to 10K at 160 x 256 (8K if you're prepared to loose some sideways resolution).

There are some tricks to perform palette switching so it looks like they're more than 4 colours.


Top
 
PostPosted: Mon Apr 30, 2012 8:21 am 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Isn't there a way to configure the display to have a width of 144 pixels? saving some ram thus?


Top
 
PostPosted: Mon Apr 30, 2012 8:49 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 7:02 pm
Posts: 273
In mode 2 (16 colours) :

Code:
lda #1
sta $fe00
lda #72
sta $fe01


In mode 5 (4 colours) :

Code:
lda #1
sta $fe00
lda #36
sta $fe01


This only saves 512 bytes in mode 2, and 256 bytes in mode 5.


Top
 
PostPosted: Mon Apr 30, 2012 9:29 am 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
TomW wrote:
In mode 2 (16 colours) :

Code:
lda #1
sta $fe00
lda #72
sta $fe01


In mode 5 (4 colours) :

Code:
lda #1
sta $fe00
lda #36
sta $fe01


This only saves 512 bytes in mode 2, and 256 bytes in mode 5.


Thank you TomW, this is nice, although I must confess I thought I would save a bit more mem. I Presume that in the same way we can have a wider display than the normal 160 pixels too?


Top
 
PostPosted: Sat Sep 01, 2012 10:03 am 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Can we have a display wither than the 160 pixels on mode 2? On the Ams CPC is possible so I am asking, I would need 42 chars across if possible.


Top
 
PostPosted: Sat Sep 01, 2012 4:34 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 7:02 pm
Posts: 273
Yeah, use the above but adjust the values (and also move the video start address).

In mode 2 (start at $2c00) :

Quote:
lda #1
sta $fe00
lda #84
sta $fe01

lda #13
sta $fe00
lda #$80
sta $fe01
lda #12
sta $fe00
lda #$5
sta $fe01


In mode 5 (start at $5600) :

Quote:
lda #1
sta $fe00
lda #42
sta $fe01

lda #13
sta $fe00
lda #$c0
sta $fe01
lda #12
sta $fe00
lda #$a
sta $fe01


Top
 
PostPosted: Sat Sep 01, 2012 6:23 pm 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Thank you so much Tom :)


Top
 
PostPosted: Mon Sep 10, 2012 12:12 pm 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
On the Electron changing the screen size is not possible I presume? I have been checking the advanced guide(where I could only find that we can change the screen address in 64 byte steps or something but no other info but I browsed it quite quickly so I might have missed something important about this) and on the net, I read somewhere that it doesn't have the 6845 CRTC. Is this correct? Ta.

The BBC game is coming along(Swift if awesome), nothing to show yet but soon perhaps, and I have started to think about Electron and Atom versions of the game too. If I could reduce the Electron screen to 32x24 chars it would be great, if not well, I would have to work with what there is available.

The Atom, I have found very little info, I only have the Atomic Theory book. It is a quite interesting little machine.


Top
 
PostPosted: Mon Sep 10, 2012 5:27 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 7:02 pm
Posts: 273
The Electron indeed does not have a 6845 CRTC. The ULA has a fixed screen size and hardware scrolling is in useless 64 byte steps. Plus it's only 1 MHz in modes 4-6 and ~600 kHz in modes 0-3.


Top
 
PostPosted: Mon Sep 10, 2012 6:43 pm 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Thanks Tom, I am somewhat shocked in knowing that the Electron runs at 600khz on modes 0-3..... This makes things more difficult and I didn't want to use expansions. So the Electron version of the game would go more on par with the Atom's one than the bbc's. :shock:


Top
 
PostPosted: Thu Oct 31, 2013 4:52 pm 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Uff real life got in the way but I haven't forgotten about my BBC/Acorn projects.

Can someone tell me how many cycles are there per frame on the BBC micro?

Can over scan screens be double buffered(24kb)?


Top
 
PostPosted: Sun Nov 03, 2013 11:04 am 
Offline
 Profile

Joined: Mon Jul 21, 2008 9:29 pm
Posts: 25
Wood wrote:
Can someone tell me how many cycles are there per frame on the BBC micro?

Usually the display runs at 50Hz so each frame is 20mS. For a normal mode 2, each scanline is 64uS and I think there are 312 lines. See page 360 of the Advanced User Guide for more details.

Wood wrote:
Can over scan screens be double buffered(24kb)?

I assume you're using a Master 128, in which case the machine will only page in 20KB (between 0x3000 and 0x7fff) when you switch between the normal and shadow screen banks.

The way the screen-wrap around works prevents using memory above 0x8000.

You could use the vertical rupture technique (described in the sample code section) to page in two different 4KB blocks from below 0x3000. However, you may end up having to waste some memory if the join between the 4KB and 20KB doesn't happen at the end of a line.

If this is the case, you could try using more than one rupture - depending on your screen dimensions, this could recover some of the wasted memory at the expense of a more complicated screen memory layout.


Top
 
PostPosted: Sun Nov 03, 2013 11:24 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 7:02 pm
Posts: 273
You can set the screen start address to 0x2000 easily, but for the shadow bank the first 4k will be in one of the OS private areas; I think 0xd000-0xdfff.


Top
 
PostPosted: Tue Nov 05, 2013 10:24 am 
Offline
 Profile

Joined: Thu Apr 26, 2012 9:01 am
Posts: 21
Thank you Robc and TomW.

That's the idea I had about the shadow bank: 20k.


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron