DanBoris Posted November 28, 2020 Share Posted November 28, 2020 John Hardie posted this on the Atari 8-Bit Computer Facebook group, so I thought it would be interested to see why this happens. I downloaded the ROM from Atarimania and was able to reproduce this bug. If you pause the game and wait for it to go into attract mode, when you press the space bar it will un-pause the game, but you will no longer have any control of the your player, and there will be no collision detection. As it says you have to restart the game to fix this. I disassembled the ROM and the cause was pretty each to find. Memory location $CC is used to keep track of the color cycling during the title page. The title page and gameplay use the same game loop, but if $CC is non-zero the game loop assumes you are on the title screen and skips the player handling code. When you start the game $CC is cleared and the game loop handles the player. The problem comes in when the game goes into attract mode. $CC is once again used for the color cycling, but when you un-pause it never clears this byte, so the game loop now think you are back on the title page and the player handling is skipped. 2 Quote Link to comment Share on other sites More sharing options...
DanBoris Posted November 28, 2020 Author Share Posted November 28, 2020 While looking for this bug I also ran across this interesting piece of code in the display list interrupt handler: B830: AD 0A D2 LDA RANDOM ;Get a random number B833: A8 TAY ; B834: 99 0F B8 STA $B80F,Y ;Try to write to the cart rom area. This code gets random number and tries to write it to a random location in the cartridge memory space. I can only assume they were doing this to intentionally crash the game if it is running in RAM instead of on a cartridge. 2 Quote Link to comment Share on other sites More sharing options...
Mclaneinc Posted November 28, 2020 Share Posted November 28, 2020 (edited) 4 minutes ago, DanBoris said: While looking for this bug I also ran across this interesting piece of code in the display list interrupt handler: B830: AD 0A D2 LDA RANDOM ;Get a random number B833: A8 TAY ; B834: 99 0F B8 STA $B80F,Y ;Try to write to the cart rom area. This code gets random number and tries to write it to a random location in the cartridge memory space. I can only assume they were doing this to intentionally crash the game if it is running in RAM instead of on a cartridge. Sure looks that way, I remember one disc game that found OmnimonXL and started overwriting itself, I suspect any program at $C000 would have caused this. I seem to remember many carts tried to overwrite themselves as protection. Edited November 28, 2020 by Mclaneinc 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted November 28, 2020 Share Posted November 28, 2020 Was a standard way to do protection on Cartridge software and was always easy to find and "fix" 1 Quote Link to comment Share on other sites More sharing options...
cx2k Posted November 28, 2020 Share Posted November 28, 2020 2 hours ago, DanBoris said: While looking for this bug I also ran across this interesting piece of code in the display list interrupt handler: B830: AD 0A D2 LDA RANDOM ;Get a random number B833: A8 TAY ; B834: 99 0F B8 STA $B80F,Y ;Try to write to the cart rom area. This code gets random number and tries to write it to a random location in the cartridge memory space. I can only assume they were doing this to intentionally crash the game if it is running in RAM instead of on a cartridge. Nice work Dan. So the file on Atarimania is an original, unmodified cart dump? Wouldn't it have crashed on you then? Quote Link to comment Share on other sites More sharing options...
DanBoris Posted November 28, 2020 Author Share Posted November 28, 2020 1 hour ago, cx2k said: Nice work Dan. So the file on Atarimania is an original, unmodified cart dump? Wouldn't it have crashed on you then? No, since I was running it as a cartridge image on an emulator it wouldn't be able to write to the cartridge ROM. 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted November 29, 2020 Share Posted November 29, 2020 Likely Atari did their usual trick and ordered 10,000 mask Roms while it was still in Beta, then someone found the bug before (?) the instructions were printed (though that looks like an inserted card and I'm fairly sure Asteroids had a nice A4 sized printed colour manual). Early cartridges had either no or very simple copy protection, I'm fairly sure Star Raiders has something similar. Most were fairly easy to defeat. But some later carts, especially 3rd party were much trickier. I don't think I ever got a Thorn-EMI game to crack and work. 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.