BuGS Weekly Update

This one is less impressive in that I have now exceeded the 60th of a second at 2.8 MHz on an emulator so probably substantially blown the window on real HW.  The cause is I did add a call to ReadMouse through the GS toolbox in the game loop.  You can see that when the centipede is at the top of the screen, it is often drawn too late and isn’t visible on the frame.  So that makes the game that much harder with invisible centipede segments.  Now, some of this is my fault.  I don’t have good code yet for drawing the player.  I am restricting the player to the bottom row of tiles.  That way, I just have the address of the scan line of that row and add an offset to that based on the X coord of the mouse.  But I don’t really know which tile(s) the player has made dirty so I am marking them all as dirty.  Maybe if I optimize this and do it properly, I may recover enough to make it work with the ToolBox call but I am doubtful.  What I need to do is generate a bunch of data tables so I can quickly figure out the address of the player to draw at and the 1, 2 or 4 tiles that are dirty because of that draw.  If I do that, it will be slightly faster and I will be able to move in X and Y directions.  But I still have more code to put in the game loop to block the player from passing through mushrooms, handle shooting and collisions etc.  So, I am on the edge of this all falling apart at 2.8MHz.  I probably need to go around the toolbox.

Other work this week – I finished all of the bug game logic.  The flea is added based on thresholds which change as the score goes up.  As the number of mushrooms disappear in the infield, the flea will start to drop.  I also implemented the code to restrict the spider to lower and lower rows as the score goes up.  And I added code to handle shooting mushrooms.  I hooked up ‘m’ to randomly shoot a mushroom.  I realize I didn’t demo any of that in this video.

The other obvious thing is the change to the LHS of the screen.  I added BuGS branding, moved the number of lives from the RHS to the LHS and put player 1 and player 2 info in there.  There is really not any support for player 2 yet but I have centralized all of the information that needs to be tracked per player so I have a way to add that reasonably easily in the future.

Feedback about the new display is greatly appreciated.  I am not sure I like the multi-coloured BuGS branding at the top.  Also, the lower case u was my own attempt at creating a tile for that so it stands out a bit more like an oddball than I would have liked.  Next week, I will need to look at the mouse code.  I have already perused the Firmware manual which I am guessing is the right place to go for details.

Source Code


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.