Week 97


So that's the beeper sound effects sorted.  Not completely, but enough for me to be sure that the system works and sounds good, and that there shouldn't be any problems with adding those that remain.  Ultimate wrote a very small system that can handle a variety of effects - it's quite impressive.

Now that the leading PC version is nearing completion i've got a better idea of what is required of the humble Spectrum version.  Aside from the 3 coloured door keys, and the 3 main door keys (the 'A' 'C' 'G' keys of the original), I had space for five other objects set aside, for whatever they might be used for.  Unfortunately the PC version currently have over 20 such objects, and I don't have the memory for them.  Okay, that's not exactly true - I've got the spare memory, but not where the objects are currently stored, so I've got to do some housekeeping and move things around in order to allow the game to handle them all.

There's a big misunderstanding about the 128K Spectrum when it comes to arcade games - in that you don't really have 128K to play with.  The Speccy is an 8-bit machine, which means it can only access 64K at any one time, and 16K of that is the ROM, so it's actually only 48K - hence the name of the original machine (okay, so the +3 can page out the ROM and allow complete access to the 64K, but that's another story, and I'm aiming for the original 128K machine).  That 128K is split into 16K blocks, so you have 3 of those available to you at any one time.  To further complicate things half of those 8 blocks are slower to access than the other half, and if you're writing a game you want to be using the faster memory in the main game loop, and only the top 32K can ever be fast.  So at any moment you really have only 32K you can access, and have to keep juggling which blocks are in memory in order to access everything you need to (hope that all makes sense?!)

So in this game the audio is in one block of 16K, the main loop in another block of 16K, and the graphics and other game logic are in the remaining 2 blocks of fast 16K memory, and I have to keep swapping between them in order to make everything work.  The slower memory is used for the frontend, compressed graphics, that sort of thing - and there's a lot of graphics in this game.  So when I move around where things are in memory usually when I get the game working again something breaks somewhere - in this case I've got all those objects working, but the cavern levels are a big corrupted mess.


I think I'm going to have to fully document what bits of memory are where, and then I'll hopefully know exactly what the issue is, and get everything back working again soon.

Leave a comment

Log in with itch.io to leave a comment.