tschak909 Posted February 16, 2013 Share Posted February 16, 2013 Why does this need to happen, in games like Surround? I've seen this pattern over and over again in games that want to simulate a discrete x,y bitmap, and am not sure why this needs to happen. -Thom Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted February 16, 2013 Share Posted February 16, 2013 Search AA for "HMOVE blanks" Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted February 16, 2013 Share Posted February 16, 2013 Actually, HMOVE happens "offscreen" in Surround. This game uses the blank scanline between PF rows for checking and storing the two sprites and checking the scanline count for the lower border. Simply displaying the PF pattern on the other lines eats up 50 cycles of the available 76. 4 cycles x 6 to load, 3 cycles x 6 to store, + 8 more cycles to shift PF0 data nybble. It shouldn't be too difficult (relatively speaking) to rewrite the kernel so they aren't needed. Using missile sprites instead of the 8-bit player sprites gets you part of the way there. More-careful timing could have eliminated reloading PF0. Worst-case, unroll the display loop and make the game 4k. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted February 17, 2013 Share Posted February 17, 2013 Quick 'n' Dirty hack unrolls the loop for each band of PF data. The cycle time saved is used to enable/disable missile sprites (instead of players) by pushing the status to the stack. The kernel is a subroutine, so I forced the stack to point at the last return address at the end (keep this in mind if it is hacked further). Positioning and collision registers adjusted to point at missiles instead, and PF0 nybble data is swapped so there was no need to reload ram prior to shifting data via ASL's. Unrolling the display loops cost an additional 2 pages, so this is a 4k ROM. Could probably get this back down to 2k if further optimizations were done. Surround(NoBlanks).asm Surround(NoBlanks).bin 1 Quote Link to comment Share on other sites More sharing options...
iesposta Posted February 17, 2013 Share Posted February 17, 2013 Quick 'n' Dirty hack unrolls the loop for each band of PF data. The cycle time saved is used to enable/disable missile sprites (instead of players) by pushing the status to the stack. The kernel is a subroutine, so I forced the stack to point at the last return address at the end (keep this in mind if it is hacked further). Positioning and collision registers adjusted to point at missiles instead, and PF0 nybble data is swapped so there was no need to reload ram prior to shifting data via ASL's. Unrolling the display loops cost an additional 2 pages, so this is a 4k ROM. Could probably get this back down to 2k if further optimizations were done. Thank you for this! When showing my nephew (age 12) the 2600 and a great game like Toyshop Trouble, he finds Surround and we played again and again. Now I have a new version to show! Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted February 17, 2013 Share Posted February 17, 2013 2k version posted in the hack forum. Ownage Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted February 17, 2013 Share Posted February 17, 2013 Actually, HMOVE happens "offscreen" in Surround. Of course you are right. I had misread the question. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.