ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/rom_patches.cpp
(Generate patch)

Comparing BasiliskII/src/rom_patches.cpp (file contents):
Revision 1.5 by cebix, 1999-10-19T17:41:18Z vs.
Revision 1.8 by cebix, 1999-10-25T08:07:46Z

# Line 34 | Line 34
34   #include "prefs.h"
35   #include "rom_patches.h"
36  
37 < #define DEBUG 0
37 > #define DEBUG 1
38   #include "debug.h"
39  
40  
# Line 648 | Line 648 | void PatchAfterStartup(void)
648          r.d[0] = 0xa05c;
649          Execute68kTrap(0xa247, &r);             // SetOSTrapAddress()
650  
651 + #if SUPPORTS_EXTFS
652          // Install external file system
653          InstallExtFS();
654 + #endif
655   }
656  
657  
# Line 666 | Line 668 | bool CheckROM(void)
668          // Real addressing mode requires a 32-bit clean ROM
669          return ROMVersion == ROM_VERSION_32;
670   #else
671 <        // Virtual addressing mode works with 32-bit clean Mac II ROMs and Classic ROMs (experimental)
671 >        // Virtual addressing mode works with 32-bit clean Mac II ROMs and Classic ROMs
672          return (ROMVersion == ROM_VERSION_CLASSIC) || (ROMVersion == ROM_VERSION_32);
673   #endif
674   }
# Line 1155 | Line 1157 | static bool patch_rom_32(void)
1157          *wp++ = htons(M68K_NOP);
1158          *wp = htons(M68K_NOP);
1159  
1160 <        // Fix logical/physical RAM size (CompBootStack) (must be done after InitMemMgr!)
1161 <        static const uint8 fix_memsize_dat[] = {0x4e, 0x75};
1162 <        if ((base = find_rom_data(0x490, 0x4b0, fix_memsize_dat, sizeof(fix_memsize_dat))) == 0) return false;
1163 <        D(bug("fix_memsize %08lx\n", base));
1164 <        wp = (uint16 *)(ROMBaseHost + base);
1160 >        // Compute boot stack pointer and fix logical/physical RAM size (CompBootStack) (must be done after InitMemMgr!)
1161 >        wp = (uint16 *)(ROMBaseHost + 0x490);
1162 >        *wp++ = htons(0x2038);  // move.l       $10c,d0
1163 >        *wp++ = htons(0x010c);
1164 >        *wp++ = htons(0xd0b8);  // add.l        $2a6,d0
1165 >        *wp++ = htons(0x02a6);
1166 >        *wp++ = htons(0xe288);  // lsr.l        #1,d0
1167 >        *wp++ = htons(0x0880);  // bclr         #0,d0
1168 >        *wp++ = htons(0x0000);
1169 >        *wp++ = htons(0x0440);  // subi.w       #$400,d0
1170 >        *wp++ = htons(0x0400);
1171 >        *wp++ = htons(0x2040);  // move.l       d0,a0
1172          *wp++ = htons(M68K_EMUL_OP_FIX_MEMSIZE);
1173 <        *wp = htons(M68K_RTS);
1173 >        *wp++ = htons(M68K_RTS);
1174  
1175          static const uint8 fix_memsize2_dat[] = {0x22, 0x30, 0x81, 0xe2, 0x0d, 0xdc, 0xff, 0xba, 0xd2, 0xb0, 0x81, 0xe2, 0x0d, 0xdc, 0xff, 0xec, 0x21, 0xc1, 0x1e, 0xf8};
1176          base = find_rom_data(0x4c000, 0x4c080, fix_memsize2_dat, sizeof(fix_memsize2_dat));
# Line 1401 | Line 1410 | static bool patch_rom_32(void)
1410          *wp++ = htons(M68K_EMUL_OP_MEMORY_DISPATCH);
1411          *wp = htons(M68K_RTS);
1412  
1413 + #if EMULATED_68K
1414 +        // Replace BlockMove()
1415 +        wp = (uint16 *)(ROMBaseHost + find_rom_trap(0xa02e));   // BlockMove()
1416 +        *wp++ = htons(M68K_EMUL_OP_BLOCK_MOVE);
1417 +        *wp++ = htons(0x7000);
1418 +        *wp = htons(M68K_RTS);
1419 + #endif
1420 +
1421          // Patch VIA interrupt handler
1422          wp = (uint16 *)(ROMBaseHost + 0x9bc4);  // Level 1 handler
1423          *wp++ = htons(0x7002);          // moveq        #2,d0 (always 60Hz interrupt)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines