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

Comparing BasiliskII/src/rsrc_patches.cpp (file contents):
Revision 1.5 by cebix, 2000-07-22T16:07:18Z vs.
Revision 1.6 by gbeauche, 2000-09-22T17:17:56Z

# Line 69 | Line 69 | void CheckLoad(uint32 type, int16 id, ui
69          uint16 *p16;
70          uint32 base;
71          D(bug("vCheckLoad %c%c%c%c (%08x) ID %d, data %08x, size %d\n", (char)(type >> 24), (char)((type >> 16) & 0xff), (char )((type >> 8) & 0xff), (char )(type & 0xff), type, id, p, size));
72 <
72 >        
73          if (type == FOURCC('b','o','o','t') && id == 3) {
74                  D(bug(" boot 3 found\n"));
75  
# Line 90 | Line 90 | void CheckLoad(uint32 type, int16 id, ui
90                  if (base) {
91                          p16 = (uint16 *)(p + base);
92  
93 < #if defined(AMIGA) || defined(__NetBSD__)
93 > #if defined(AMIGA) || defined(__NetBSD__) || defined(USE_SCRATCHMEM_SUBTERFUGE)
94                          // Set 0x0000 to scratch memory area
95 <                        extern uint32 ScratchMem;
95 >                        extern uint8 *ScratchMem;
96 >                        const uint32 ScratchMemBase = Host2MacAddr(ScratchMem);
97                          *p16++ = htons(0x207c);                 // move.l       #ScratchMem,a0
98 <                        *p16++ = htons(ScratchMem >> 16);
99 <                        *p16++ = htons(ScratchMem);
98 >                        *p16++ = htons(ScratchMemBase >> 16);
99 >                        *p16++ = htons(ScratchMemBase);
100                          *p16++ = htons(M68K_NOP);
101                          *p16 = htons(M68K_NOP);
102   #else
# Line 114 | Line 115 | void CheckLoad(uint32 type, int16 id, ui
115                  if (base) {
116                          p16 = (uint16 *)(p + base);
117  
118 < #if defined(AMIGA) || defined(__NetBSD__)
118 > #if defined(AMIGA) || defined(__NetBSD__) || defined(USE_SCRATCHMEM_SUBTERFUGE)
119                          // Set 0x0000 to scratch memory area
120 <                        extern uint32 ScratchMem;
120 >                        extern uint8 *ScratchMem;
121 >                        const uint32 ScratchMemBase = Host2MacAddr(ScratchMem);
122                          *p16++ = htons(0x207c);                 // move.l       #ScratchMem,a0
123 <                        *p16++ = htons(ScratchMem >> 16);
124 <                        *p16++ = htons(ScratchMem);
123 >                        *p16++ = htons(ScratchMemBase >> 16);
124 >                        *p16++ = htons(ScratchMemBase);
125                          *p16++ = htons(M68K_NOP);
126                          *p16 = htons(M68K_NOP);
127   #else
# Line 600 | Line 602 | void CheckLoad(uint32 type, int16 id, ui
602                  FlushCodeCache(p, 6);
603                  D(bug("  patch 1 applied\n"));
604          }
605 + #if REAL_ADDRESSING && !defined(AMIGA)
606 +        else if (type == FOURCC('D','R','V','R') && id == 41) {
607 +                D(bug(" DRVR 41 found\n"));
608 +                
609 +                // gb-- [0x28E (ROM85)] contains 0x3fff that will be placed into a0
610 +                // Seems to be caused by the AppleShare extension from MacOS 8.1 (3.7.4)
611 +                // .AFPTranslator (DRVR addr 0x2372)
612 +                static const uint8 dat[] = {0x3a, 0x2e, 0x00, 0x0a, 0x55, 0x4f, 0x3e, 0xb8, 0x02, 0x8e, 0x30, 0x1f, 0x48, 0xc0, 0x24, 0x40, 0x20, 0x40};
613 +                base = find_rsrc_data(p, size, dat, sizeof(dat));
614 +                if (base) {
615 +                        p16 = (uint16 *)(p + base + 4);
616 +                        *p16++ = htons(0x3078);         // movea.w      ROM85,%a0
617 +                        *p16++ = htons(0x028e);
618 +                        *p16++ = htons(0xd1fc);         // adda.l       #RAMBaseMac,%a0
619 +                        *p16++ = htons((RAMBaseMac >> 16) & 0xffff);
620 +                        *p16++ = htons(RAMBaseMac & 0xffff);
621 +                        *p16++ = htons(0x2448);         // movea.l      %a0,%a2
622 +                        *p16++ = htons(M68K_NOP);
623 +                        FlushCodeCache(p + base + 4, 14);
624 +                        D(bug("  patch 1 applied\n"));
625 +                }
626 +        }
627 + #endif
628   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines