BBC Bomberman
Re: BBC Bomberman
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
http://www.retrosoftware.co.uk/wiki/ind ... er_Blaster
http://www.retrosoftware.co.uk/forum/viewforum.php?f=9
Re: BBC Bomberman
Yes Dave told me about it, I’ve not played it yet, but would like to.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
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.
Re: BBC Bomberman
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.
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.
Re: BBC Bomberman
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.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’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.
Re: BBC Bomberman
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.
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.
Re: BBC Bomberman
Looks great, thanks for sharing.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.
Are you developing on a PC with emulators or on real hardware?
Re: BBC Bomberman
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?
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?
Re: BBC Bomberman
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 ?
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.
Re: BBC Bomberman
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)
Re: BBC Bomberman
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
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
Re: BBC Bomberman
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!
Wow, it's going to be a breath of fresh air having all of Zero Page and all that other spare space!
Re: BBC Bomberman
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
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
Re: BBC Bomberman
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?
Re: BBC Bomberman
I've heard of a few people using that technique.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 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.
Re: BBC Bomberman
I use both INKEY (for reading passwords) and direct access using SYSVIA during gameplay, take a look at the input handlers in my repojamespi 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?
https://github.com/picosonic/bbm/blob/master/input.asm
Re: BBC Bomberman
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
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
Re: BBC Bomberman
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.
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
Last edited by lovebug on Thu Apr 29, 2021 2:23 pm, edited 2 times in total.
Re: BBC Bomberman
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?
Is there a way to scan for “the next keypress”, or do you need to scan every possible code?
Re: BBC Bomberman
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
Re: BBC Bomberman
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.
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.
Re: BBC Bomberman
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.
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.
Re: BBC Bomberman
Can you please upload or link to a .SSD containing the latest build?
Re: BBC Bomberman
Re: BBC Bomberman
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
Re: BBC Bomberman
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
Re: BBC Bomberman
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.
Nice loading screen.
Re: BBC Bomberman
What does that "horizontal red bars colour" mean? Colour 0, I mean? It can´t be some Master extra colour?