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

Comparing SheepShaver/src/rom_patches.cpp (file contents):
Revision 1.8 by gbeauche, 2003-09-28T21:27:33Z vs.
Revision 1.9 by gbeauche, 2003-09-29T20:30:19Z

# Line 679 | Line 679 | static const uint8 adbop_patch[] = {   //
679  
680  
681   /*
682 + *  Copy PowerPC code to ROM image and reverse bytes if necessary
683 + */
684 +
685 + static inline void memcpy_powerpc_code(void *dst, const void *src, size_t len)
686 + {
687 + #ifdef WORDS_BIGENDIAN
688 +        (void)memcpy(dst, src, len);
689 + #else
690 +        uint32 *d = (uint32 *)dst;
691 +        uint32 *s = (uint32 *)src;
692 +        for (int i = 0; i < len/4; i++)
693 +                d[i] = htonl(s[i]);
694 + #endif
695 + }
696 +
697 +
698 + /*
699   *  Install ROM patches (RAMBase and KernelDataAddr must be set)
700   */
701  
# Line 1966 | Line 1983 | static bool patch_68k(void)
1983          memcpy((void *)(ROM_BASE + sony_offset + 0x200), cdrom_driver, sizeof(cdrom_driver));
1984  
1985          // Install serial drivers
1986 <        memcpy((void *)(ROM_BASE + sony_offset + 0x300), ain_driver, sizeof(ain_driver));
1987 <        memcpy((void *)(ROM_BASE + sony_offset + 0x400), aout_driver, sizeof(aout_driver));
1988 <        memcpy((void *)(ROM_BASE + sony_offset + 0x500), bin_driver, sizeof(bin_driver));
1989 <        memcpy((void *)(ROM_BASE + sony_offset + 0x600), bout_driver, sizeof(bout_driver));
1986 >        memcpy_powerpc_code((void *)(ROM_BASE + sony_offset + 0x300), ain_driver, sizeof(ain_driver));
1987 >        memcpy_powerpc_code((void *)(ROM_BASE + sony_offset + 0x400), aout_driver, sizeof(aout_driver));
1988 >        memcpy_powerpc_code((void *)(ROM_BASE + sony_offset + 0x500), bin_driver, sizeof(bin_driver));
1989 >        memcpy_powerpc_code((void *)(ROM_BASE + sony_offset + 0x600), bout_driver, sizeof(bout_driver));
1990  
1991          // Copy icons to ROM
1992          SonyDiskIconAddr = ROM_BASE + sony_offset + 0x800;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines