BBC Bomberman

developing/porting a new game or gaming framework? post in here!
User avatar
fwibbler
Posts: 763
Joined: Thu Jan 13, 2005 10:37 pm
Location: Essex
Contact:

Re: BBC Bomberman

Post by fwibbler »

Don't know if you're aware of it, but Sarah Walker started something similar to this with Bomber Blaster some years ago over on the Retro Software site.
http://www.retrosoftware.co.uk/wiki/ind ... er_Blaster
http://www.retrosoftware.co.uk/forum/viewforum.php?f=9
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

fwibbler wrote: Wed Mar 31, 2021 10:16 pm Don't know if you're aware of it, but Sarah Walker started something similar to this with Bomber Blaster some years ago over on the Retro Software site.
http://www.retrosoftware.co.uk/wiki/ind ... er_Blaster
http://www.retrosoftware.co.uk/forum/viewforum.php?f=9
Yes Dave told me about it, I’ve not played it yet, but would like to.

Bomber Blaster is based on https://en.m.wikipedia.org/wiki/Bomberman_II whereas mine is based on the first NES version which was never released in Europe.
jamespi
Posts: 11
Joined: Fri Feb 16, 2018 6:56 pm
Contact:

Re: BBC Bomberman

Post by jamespi »

I've been working on a bomberman clone in my spare time too. I don't think it's as ambitious as yours though, i'm not replicating the NES version, just trying to make a basic single screen 2-player thing along the lines of Moonquake on the Arc. I've been making it for the Master 128 so that I don't have to worry about memory constraints so much.

It's a tight fit on a BBC B isn't it? It's taken me ages (like two years?) of tinkering on and off in my spare time to get to the point where i have grid of pillars that one player can run around in. It's a learning exercise for 6502 assembly for me as I haven't done it before.

Still, it's quite a fascinating puzzle working out how to make things work fast enough in a tiny amount of RAM.
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

jamespi wrote: Tue Apr 27, 2021 10:30 pm I've been working on a bomberman clone in my spare time too. I don't think it's as ambitious as yours though, i'm not replicating the NES version, just trying to make a basic single screen 2-player thing along the lines of Moonquake on the Arc. I've been making it for the Master 128 so that I don't have to worry about memory constraints so much.
I started last year, I don’t have much time to work on it. Luckily I’ve dabbled a bit in 6502 assembly before, but this is my first big project.

I’m trying to stick to a vanilla BBC B, as that’s what I have kept hold of since the 80s. I’d always liked the idea of writing a game for it worthy of commercial release.

I’ve spent time previously trying to write a 6502 emulator. I’ve also looked into some commercial games which I’ve disassembled to find out how things were done. It’s fascinating.

I’d love to see your version, please do post some screenshots.
jamespi
Posts: 11
Joined: Fri Feb 16, 2018 6:56 pm
Contact:

Re: BBC Bomberman

Post by jamespi »

Yup of course. Initially I made a tile editor in BASIC and roughly cribbed the SNES tileset into MODE 2.

There's a screenshot of that too. I gave the tiles a mask colour and a "shared" colour so that different coloured bombermen could be generated from the same tileset

The last thing i did to the sprite routine was make the masking work down to the individual pixel level. I was very chuffed to make that work!

I haven't made it generate different coloured bombermen yet.
bombman.png
tile_editor.png
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

jamespi wrote: Tue Apr 27, 2021 11:43 pm Yup of course. Initially I made a tile editor in BASIC and roughly cribbed the SNES tileset into MODE 2.

There's a screenshot of that too. I gave the tiles a mask colour and a "shared" colour so that different coloured bombermen could be generated from the same tileset

The last thing i did to the sprite routine was make the masking work down to the individual pixel level. I was very chuffed to make that work!

I haven't made it generate different coloured bombermen yet.
Looks great, thanks for sharing.

Are you developing on a PC with emulators or on real hardware?
jamespi
Posts: 11
Joined: Fri Feb 16, 2018 6:56 pm
Contact:

Re: BBC Bomberman

Post by jamespi »

Just on BeebEm so far out of convenience. I've been meaning to dig my Master out to test if it runs smoothly on real hardware. The emulator itself seems to run at an inconsistent rate judging by the reported FPS in the titlebar.

I have a kind of bodgy workflow.

I edit the code as a BASIC prog with inline assembly in Notepad++ on windows then just paste it into Beebem. It has a *KEY definition and AUTO at the top so i just paste it in and the emulator thinks i'm typing in tons of BASIC really fast. Then I press ESC then f1 to run the program, which assembles the code and saves it to disk in the emulator.

I expect there's a more efficient way to do it using BeebAsm to build it on windows and produce a disk image but I just never got round to learning how. It is a bit limiting the way i do it as I have to fit the source code and machine code in RAM at the same time. Especially as BASIC can't use sideways RAM. I had to break the program up into chunks to have enough space to build it.

What tools do you use?
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

the nes conversion is looking great

and the mode 2 version looks great also


i was reading the post about memory and relocation, in the ladybug im working on im not using any os functions so I have all memory available and after loading my program actually relocates to 0000 as the first chunk of the file initializes the zero page variables, program starts at 0100 but skips over about 30 bytes at end of page 1 for stack then continues

0204,0205 is reserved for interrupt vector
0287,0288,0289 is reserved to break jmp

apart from that all memory is available up to the start of screen

my screen doesnt scroll so I was able to use 14K in mode 2 leaving the remaining 18K available for use

i dont know if this information helps ?
Last edited by lovebug on Wed Apr 28, 2021 5:08 am, edited 1 time in total.
Image Image Image Image
jamespi
Posts: 11
Joined: Fri Feb 16, 2018 6:56 pm
Contact:

Re: BBC Bomberman

Post by jamespi »

Wow, that's pretty amazing that you can use all that space without problems. It never would have occurred to me to use the bottom end of the stack page. Aren't there any OS interrupts that write stuff in some of those lower pages? I seem to remember only being able to use page 08 from 0840-08FF, due to the first bytes getting corrupted by something when i tried to use them. ( i think its used for sound. I wasnt calling any sound functions though)
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

if youre using os calls or have os interrupts enabled then you have to be careful with memory, in ladybug im not using any os calls or os interrupts at all as everything is coded into the game

0204/0205 is the high priority interrupt vector, when the os receives an irq interrupt it saves the accumilator to 00fc and then does a jmp (0204) so by taking control of this vector you disable all os interrupt code and have complete control

so without os interrupts and my game not calling any os functions ive basically disabled the os making all ram available for use

this did mean writing my own custom code to directly write data to the sound chip and keyboard as os functions for sound, envelope and inkey are no longer available
Image Image Image Image
jamespi
Posts: 11
Joined: Fri Feb 16, 2018 6:56 pm
Contact:

Re: BBC Bomberman

Post by jamespi »

Ah i will have to revisit that then - It never occured to me that disabling all the OS activity was that simple. I have been using EVENTV to listen for VSYNC. Presumably if i completely disable all OS IRQ routines EVENTV will stop working too so I'd need to look up how to detect VSYNCs manually.

Wow, it's going to be a breath of fresh air having all of Zero Page and all that other spare space!
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

yeah you'll have to code your own vsync interrupt and any others you need
I use 2 interrupts in ladybug, vsync the main interrupt and timer 1 set to interrupt at screen raster line 156 to signal the upper or lower screen area for my sprite routine

this is my interrupt code, its very basic and just checks the 6522 interrupt flag register for which interrupt is happening (vsync or timer 1) then runs the required path setting the upper/lower flag, bumping the vsync counter and clearing the interrupt flag

Code: Select all

;-----------------------------------------------------------------------------------------------------------------------------------------------------
; irq interrupt					; handle vsync and timer1 interrupts, setting vsyncHalf upper/lower flag
;-----------------------------------------------------------------------------------------------------------------------------------------------------

rasterTimer		= 156 * 64		; vsync interupt sets timer interrupt to line 156 (312/2 screen center)

;-----------------------------------------------------------------------------------------------------------------------------------------------------

.irqInterrupt

	lda viaIfr				; if interrupt flag = vsync
	and #2
	bne irqVsync				; then go do the upper vsync interrupt
	
.irqTimer					; else its a timer interrupt so do the lower interrupt

	lda #&40				; clear timer interrupt flag
	sta viaIfr

	lda #&ff				; vsyncHalf = lower
	sta vsyncHalf

	lda irqAcc				; restore A and return
	rti

.irqVsync					; upper interrupt

	sta viaIfr				; clear vsync interrupt flag

	lda #lo(rasterTimer)			; set timer 1 for lower interrupt
	sta viaT1CounterLo
	lda #hi(rasterTimer)
	sta viaT1CounterHi

	lda #&00				; vSyncHalf = upper
	sta vsyncHalf

	inc vsyncCounter			; bump vsync counter

	lda irqAcc				; restore A and return
	rti



Image Image Image Image
jamespi
Posts: 11
Joined: Fri Feb 16, 2018 6:56 pm
Contact:

Re: BBC Bomberman

Post by jamespi »

great, thanks for the tip, I'd better read the docs for the 6522 and the memory map for it just so I understand what i'm up to. The other thing I'm doing is using OSBYTE &79 to check each relevant key for presses once per vsync. Will that OSBYTE call be broken if the OS interrupts are off?
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

lovebug wrote: Wed Apr 28, 2021 1:11 am i was reading the post about memory and relocation, in the ladybug im working on im not using any os functions so I have all memory available and after loading my program actually relocates to 0000 as the first chunk of the file initializes the zero page variables, program starts at 0100 but skips over about 30 bytes at end of page 1 for stack then continues
I've heard of a few people using that technique.

I think I rely too heavily on the OS at the moment particularly in regards to music to be able to do that.

I do use a lot of other RAM locations below my code relocation point for various variables.
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

jamespi wrote: Wed Apr 28, 2021 3:16 pm great, thanks for the tip, I'd better read the docs for the 6522 and the memory map for it just so I understand what i'm up to. The other thing I'm doing is using OSBYTE &79 to check each relevant key for presses once per vsync. Will that OSBYTE call be broken if the OS interrupts are off?
I use both INKEY (for reading passwords) and direct access using SYSVIA during gameplay, take a look at the input handlers in my repo

https://github.com/picosonic/bbm/blob/master/input.asm
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

im not 100% sure but I think its most likely the osbyte &79 will be broken

im not at my laptop at the moment but when I get back i'll post my keyboard code that directly places the key matrix code onto the portA bits 0-6 and reads back the key status from portA bit 7

port B is used to enable / disable the keyboard output bit to be read, also need to set port A bit 7 as an input while testing for keys

i'll post the code here later
Image Image Image Image
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

Code: Select all

;-----------------------------------------------------------------------------------------------------------------------------------------------------
; keyboardScan					check up down left right start keys
;-----------------------------------------------------------------------------------------------------------------------------------------------------
; entry			none
;-----------------------------------------------------------------------------------------------------------------------------------------------------
; exit			playerInput		bit 0=up 1=down 2=left 3=right 4=start
;			A			destroyed
;-----------------------------------------------------------------------------------------------------------------------------------------------------

keyUp			= &48			; up = :*
keyDown			= &68			; down = /?
keyLeft			= &61			; left = z
keyRight		= &42			; right = x
keyStart		= &49			; return

;-----------------------------------------------------------------------------------------------------------------------------------------------------

.keyboardScan

	lda #&7f				; set port A bit 7 as input ( from keyboard output )
	sta viaPortDdrA
	
	lda #3 + 0				; keyboard -enable low
	sta viaPortB
	
	lda #0					; clear player input flags
	sta playerInput

	lda #keyStart				; check start key
	jsr keyboardScanCheck

	lda #keyRight				; check right key
	jsr keyboardScanCheck

	lda #keyLeft				; check left key
	jsr keyboardScanCheck

	lda #keyDown				; check down key
	jsr keyboardScanCheck
	
	lda #keyUp				; check up key
	jsr keyboardScanCheck
	
	lda #3 + 8				; keyboard -enable high
	sta viaPortB
	
	lda #&ff				; set port A all bits output
	sta viaPortDdrA

	rts					; done.

;-----------------------------------------------------------------------------------------------------------------------------------------------------

.keyboardScanCheck

	sta viaPortA				; select key

	lda viaPortA				; read key status

	asl a					; shift key status into player input bits
	rol playerInput
	
	rts					; done.



the value written to portA selects the key from the matrix
bits 6,5,4 are the row
bits 3,2,1,0 are the column

reading bit 7 gets the status of the key (pressed / not pressed)

this is the bbc keyboard schematic, ive numbered the rows in red and columns in blue to make it easy to get the scan code for the key
so if you wanted the code for the 'Z' key on row 6 column 1 the scancode would be #&61
 
bbc-keyboard.png
Last edited by lovebug on Thu Apr 29, 2021 2:23 pm, edited 2 times in total.
Image Image Image Image
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

Thanks for posting this. I’ll give it a go later.

Is there a way to scan for “the next keypress”, or do you need to scan every possible code?
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

picosonic wrote: Wed Apr 28, 2021 6:51 pm Thanks for posting this. I’ll give it a go later.

Is there a way to scan for “the next keypress”, or do you need to scan every possible code?
the hardware supports automatic scanning

when disabling the keyboard output line by setting -kb_en high it puts the keyboard column decoder into self scanning mode which is clocked at 1MHz, this scans through all 10 columns in 16 microseconds (as the counter is 4 bit binary)

if any key on the current column is pressed then ic4 (the 8 input nand gate) sends a positive pulse to the 6522 CA2 line and can be polled in software by checking the 6522 flags or can be setup to trigger an interrupt if required by enabling CA2 positive edge interrupts in the 6522

doing this allows you to know that a key press has happened but after that you will still have to manually poll the keys to find out which one caused the CA2 pulse
Image Image Image Image
jamespi
Posts: 11
Joined: Fri Feb 16, 2018 6:56 pm
Contact:

Re: BBC Bomberman

Post by jamespi »

Ok, so thanks to the various helpful advice, i've replaced the OS interrupt handling and am successfully waiting for vsync via interrupt now.

I can confirm that OSBYTE &79 still works even with OS interrupts disabled. It makes sense really, as it's an immediate interrogation of the state of a particular key, rather than anything that relies on buffering.
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

Sorry for the lack of updates for a while on this. I’ve been concentrating my efforts on disassembling the original NES version to find out all its quirks, which has absorbed what little spare time I have.

I did take an SSD to the Centre for Computing History in Cambridge last week to try out on real hardware (as my Beeb is still unwell). However despite saying they were happy for me to try it out they use internal SD card solutions which are a faff to update. So suggested I emailed over an SSD prior to my next visit.

I’m particularly interested in how fast it plays and how the music sounds on real hardware.

So if anyone can help me out in the meantime by trying it on a real Beeb I’d be very grateful.
User avatar
lurkio
Posts: 4351
Joined: Wed Apr 10, 2013 12:30 am
Location: Doomawangara
Contact:

Re: BBC Bomberman

Post by lurkio »

picosonic wrote: Mon Aug 09, 2021 5:20 pm So if anyone can help me out in the meantime by trying it on a real Beeb I’d be very grateful.
Can you please upload or link to a .SSD containing the latest build?

:?:
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

lurkio wrote: Mon Aug 09, 2021 5:45 pm
Can you please upload or link to a .SSD containing the latest build?

:?:
Here’s a link to the latest build

https://picosonic.github.io/bbm/bbm.ssd
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

Got to try my Beeb bomberman port on a real Beeb thanks to Tom Williamson of WiFiSheep at the 1982 event at the Cambridge Centre for Computing history
Bomberman loader screen
Bomberman loader screen
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

love the loading screen 8) 8) 8) 8) 8)
Image Image Image Image
User avatar
lovebug
Posts: 1739
Joined: Sun Jan 31, 2021 5:07 pm
Location: Magrathea
Contact:

Re: BBC Bomberman

Post by lovebug »

btw if the sprites only use colors 0-7 then bits 6 and 7 of the sprite data are always 0 so you can get away with a 64 byte flip table
Image Image Image Image
Beebson
Posts: 149
Joined: Tue Jan 18, 2022 2:24 pm
Contact:

Re: BBC Bomberman

Post by Beebson »

Is that loading screen taken from the box of some Bomberman type game? Or from some other 80´s / early 90´s game box? It looks familiar. :)

Nice loading screen. :)
Beebson
Posts: 149
Joined: Tue Jan 18, 2022 2:24 pm
Contact:

Re: BBC Bomberman

Post by Beebson »

Image
What does that "horizontal red bars colour" mean? Colour 0, I mean? It can´t be some Master extra colour?
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

Beebson wrote: Thu Jun 23, 2022 9:11 am Is that loading screen taken from the box of some Bomberman type game? Or from some other 80´s / early 90´s game box? It looks familiar. :)

Nice loading screen. :)
The loader screen I'm using is one I converted from the original instruction manual.
Bomberman instructions
Bomberman instructions
instructions.jpg (18.64 KiB) Viewed 2981 times
User avatar
picosonic
Posts: 211
Joined: Mon Feb 17, 2020 12:20 pm
Contact:

Re: BBC Bomberman

Post by picosonic »

lovebug wrote: Wed Jun 22, 2022 11:51 pm btw if the sprites only use colors 0-7 then bits 6 and 7 of the sprite data are always 0 so you can get away with a 64 byte flip table
The sprites in my port only use 4 colours as it's running in mode 1, so I do need to use a full 256 byte flip table.
Post Reply

Return to “new projects in development: games”