Hi All,
So approx 40 years ago I had a Master and could program fairly well in Basic, and it was always my intention to learn Assembly… but never managed it.
40 years later after buying a Master and getting it working again I set out to actually learn Assembly and write a game. (I’m a hobbyist coder).
I started with a Citadel type game, got most of the game working, the room builder, player movement, collisions, energy, object system, doors etc… but then I watched the ‘Introduction to CRTC registers’ video and then fell down the rabbit hole of trying to write some code to scroll the screen which then morphed into this. (Really must go back to finish the previous game at some point)
So just to be clear, there is no game here, and I’m just working on bits that interest me, and hopefully I’ll add them together and have some sort of playable game, though slightly unsure if its possible (for me that is).
The only thing that works at the moment is the screen scrolling and plotting – which has taken me a significant amount of time to learn about and write.
Basically, the ‘game’ is some sort of cave, I’ve added some foreground sprites that I’ve stolen from other games just as a test for the plotting routines – you can find them to by going upwards and to the right.
The details:
- I’m using a Master emulator (Beebem), though the code is 6502 so it should work on a B with SW Ram. (I’ve not been that conservative with RAM).
- The ‘background’ sprites are plotted based on a 500 bit array, where 0 = space, 1 = solid, the routine then picks the correct background tile based on the bits around the current bit.
- The ‘foreground is plotted over the top, there's a massive lookup table SW bank 4 with sprites in SW5 bank 5… these sprites are compressed with RLE compression.
- I’ve had to write a load of c# code to help, a sprite builder and a foreground sprite builder – the foreground sprite builder lets you draw over the top of the entire background exported the Beeb screen (1536x2048 pixels), it then spits out the sprite code, and works out if there are any duplicates (I intend to use lots of duplicates due to memory space issues).
- Originally I had the scrolling working at 1 byte left/right/up/down, but this was way too jerky, it now scrolls at 2 pixels left/right/up/down, the left/right scrolling is straight forward with registers 12 and 13, but the up/down scrolling cheats by using register 5 as well as 12 and 13… this means that there are some artifacts on the top of the screen – I’ll probably overdraw them in black to hide this. (I know that messing with R5 might cause issues on some CRTC screens)
Next I intend to work player collisions and gravity next… to do so I need to recode the foreground sprite builder… I’m going to use the flashing bits to indicate solid, deadly, climbable sprites.
Not sure where this is going to end up, I’d appreciate some comments and ideas on what to do next or where to take this.
Arrow keys to move, Escape to die.
Thanks!
So approx 40 years ago I had a Master and could program fairly well in Basic, and it was always my intention to learn Assembly… but never managed it.
40 years later after buying a Master and getting it working again I set out to actually learn Assembly and write a game. (I’m a hobbyist coder).
I started with a Citadel type game, got most of the game working, the room builder, player movement, collisions, energy, object system, doors etc… but then I watched the ‘Introduction to CRTC registers’ video and then fell down the rabbit hole of trying to write some code to scroll the screen which then morphed into this. (Really must go back to finish the previous game at some point)
So just to be clear, there is no game here, and I’m just working on bits that interest me, and hopefully I’ll add them together and have some sort of playable game, though slightly unsure if its possible (for me that is).
The only thing that works at the moment is the screen scrolling and plotting – which has taken me a significant amount of time to learn about and write.
Basically, the ‘game’ is some sort of cave, I’ve added some foreground sprites that I’ve stolen from other games just as a test for the plotting routines – you can find them to by going upwards and to the right.
The details:
- I’m using a Master emulator (Beebem), though the code is 6502 so it should work on a B with SW Ram. (I’ve not been that conservative with RAM).
- The ‘background’ sprites are plotted based on a 500 bit array, where 0 = space, 1 = solid, the routine then picks the correct background tile based on the bits around the current bit.
- The ‘foreground is plotted over the top, there's a massive lookup table SW bank 4 with sprites in SW5 bank 5… these sprites are compressed with RLE compression.
- I’ve had to write a load of c# code to help, a sprite builder and a foreground sprite builder – the foreground sprite builder lets you draw over the top of the entire background exported the Beeb screen (1536x2048 pixels), it then spits out the sprite code, and works out if there are any duplicates (I intend to use lots of duplicates due to memory space issues).
- Originally I had the scrolling working at 1 byte left/right/up/down, but this was way too jerky, it now scrolls at 2 pixels left/right/up/down, the left/right scrolling is straight forward with registers 12 and 13, but the up/down scrolling cheats by using register 5 as well as 12 and 13… this means that there are some artifacts on the top of the screen – I’ll probably overdraw them in black to hide this. (I know that messing with R5 might cause issues on some CRTC screens)
Next I intend to work player collisions and gravity next… to do so I need to recode the foreground sprite builder… I’m going to use the flashing bits to indicate solid, deadly, climbable sprites.
Not sure where this is going to end up, I’d appreciate some comments and ideas on what to do next or where to take this.
Arrow keys to move, Escape to die.
Thanks!
Statistics: Posted by archie456 — Sat Jun 28, 2025 10:26 am