最终墨盒 III 冷冻机如何工作 – pagetable.com

  • Contribution: Daniël Mantione contributed the commented disassembly of the FC3 freezer functionality to the reverse engineering effort at github.com/mist64/final_cartridge, and thanked Eric Schlaepfer for his input on 6502 timing.
  • Freezer Cartridge Theory: The Commodore 64's success in the 80s was due to its ability to do things it wasn't designed for. Freezer cartridges, which allowed stopping/running programs, applying cheat codes, and saving/loading states, were one of these innovations. They exploited quirks in the hardware, such as the Ultimax mode. The Ultimax mode is activated when the cartridge pulls the GAME pin low and maps the cartridge ROM into memory. A freezer cartridge uses an NMI interrupt to take control of the C64 and execute code from the cartridge ROM.
  • Doing the Freeze Correctly: There is a challenge in successfully freezing the Commodore 64. Once the 6510 CPU receives an NMI interrupt signal, it completes the current instruction before handling the interrupt. On the Final Cartridge III, the freeze button controls both the NMI and GAME lines. There is a 5-cycle flexibility period in Ultimax mode, but 7-cycle instructions can cause issues. Button bounces can also lead to multiple NMI interrupts or Ultimax mode flipping. The Final Cartridge III 101% hardware addresses these flaws by using a flip flop and waiting for 3 consecutive writes before pulling down GAME.
  • Initializing the Freezer: After taking control of the C64, the Final Cartridge III cannot touch any memory. It uses two slices of memory: one for register backups and temporary variables, and the other for the unfreeze routine. It scans the C64's memory for RLE compressible memory and uses the zero page for backups. The VIC-II registers are stored in freed-up memory, and the SID volume is set to 0. The freezer uses the "invalid bitmap mode" of the VIC-II to display the menu.
  • Accessing C64 Memory: In Ultimax mode, most of the C64's memory is disabled. The freezer code can pull down EXROM to access all of C64 memory in 16 KB cartridge mode.
  • Backups: The freezer menu offers the choice between slow and fast backups, but disk backups are always slow and tape backups are always in turbotape format. Backups consist of two files: "FC" and "-FC". The loading process restores memory in stages.
  • Game Trainer: The game trainer works by scanning C64 memory for reads of certain registers and replacing the machine code instructions with a JSR to the IO1 window. This can cause issues with disk access.
  • Screenshots: The screenshot code of the FC3 is advanced and can convert all C64 graphics modes into raster graphics. It uses the same printer interface as BASIC and supports multiple printer languages. The preview feature works similarly to the freezer menu.
  • Final Words: The freezer shows a deep understanding of the Commodore 64 and its hardware. Debugging the code must have been a difficult task without modern tools. The creators of the Final Cartridge III were amazing gurus who succeeded in making the C64 do more than it was originally designed to do.
阅读 14
0 条评论