-BSD/COFF format file detected...
-3 sections specified
-Symbol Table offset = 230160 ($00038310)
-Symbol Table contains 1339 symbol entries ($0000053B)
-The additional header size is 28 bytes ($001C)
-Magic Number for RUN_HDR = 0x00000107
-Text Segment Size = 7632 ($00001DD0)
-Data Segment Size = 222360 ($00036498)
-BSS Segment Size = 428928 ($00068B80)
-Starting Address for executable = 0x00802000
-Start of Text Segment = 0x00802000
-Start of Data Segment = 0x00803dd0
-*/
- if (jaguarMainROM[0] == 0x60 && jaguarMainROM[1] == 0x1B)
- {
- uint32 loadAddress = GET32(jaguarMainROM, 0x16), //runAddress = GET32(jaguar_mainRom, 0x2A),
- codeSize = GET32(jaguarMainROM, 0x02) + GET32(jaguarMainROM, 0x06);
- WriteLog("GUI: Setting up homebrew (ABS-1)... Run address: %08X, length: %08X\n", loadAddress, codeSize);
-
- if (loadAddress < 0x800000)
- memcpy(jaguarMainRAM + loadAddress, jaguarMainROM + 0x24, codeSize);
- else
- {
- for(int i=codeSize-1; i>=0; i--)
- jaguarMainROM[(loadAddress - 0x800000) + i] = jaguarMainROM[i + 0x24];
-/* memcpy(jaguar_mainRam, jaguar_mainRom + 0x24, codeSize);
- memset(jaguar_mainRom, 0xFF, 0x600000);
- memcpy(jaguar_mainRom + (loadAddress - 0x800000), jaguar_mainRam, codeSize);
- memset(jaguar_mainRam, 0x00, 0x400000);*/
- }
-
- jaguarRunAddress = loadAddress;
- }
- else if (jaguarMainROM[0] == 0x01 && jaguarMainROM[1] == 0x50)
- {
- uint32 loadAddress = GET32(jaguarMainROM, 0x28), runAddress = GET32(jaguarMainROM, 0x24),
- codeSize = GET32(jaguarMainROM, 0x18) + GET32(jaguarMainROM, 0x1C);
- WriteLog("GUI: Setting up homebrew (ABS-2)... Run address: %08X, length: %08X\n", runAddress, codeSize);
-
- if (loadAddress < 0x800000)
- memcpy(jaguarMainRAM + loadAddress, jaguarMainROM + 0xA8, codeSize);
- else
- {
- for(int i=codeSize-1; i>=0; i--)
- jaguarMainROM[(loadAddress - 0x800000) + i] = jaguarMainROM[i + 0xA8];
-/* memcpy(jaguar_mainRam, jaguar_mainRom + 0xA8, codeSize);
- memset(jaguar_mainRom, 0xFF, 0x600000);
- memcpy(jaguar_mainRom + (loadAddress - 0x800000), jaguar_mainRam, codeSize);
- memset(jaguar_mainRam, 0x00, 0x400000);*/
- }
-
- jaguarRunAddress = runAddress;
- }
- else
- {
- WriteLog("GUI: Couldn't find correct ABS/COF format: %02X %02X\n", jaguarMainROM[0], jaguarMainROM[1]);
- return false;
- }
- }
- else if (strcasecmp(ext, ".jag") == 0)
- {
- // File extension ".JAG": Atari server file with header
-//NOTE: The bytes 'JAGR' should also be at position $1C...
-// Also, there's *always* a $601A header at position $00...
- if (jaguarMainROM[0] == 0x60 && jaguarMainROM[1] == 0x1A)
- {
- uint32 loadAddress = GET32(jaguarMainROM, 0x22), runAddress = GET32(jaguarMainROM, 0x2A);
-//This is not always right! Especially when converted via bin2jag1!!!
-//We should have access to the length of the furshlumiger file that was loaded anyway!
-//Now, we do! ;-)
-// uint32 progLength = GET32(jaguar_mainRom, 0x02);
-//jaguarRomSize
-//jaguarRunAddress
-// WriteLog("Jaguar: Setting up PD ROM... Run address: %08X, length: %08X\n", runAddress, progLength);
-// memcpy(jaguar_mainRam + loadAddress, jaguar_mainRom + 0x2E, progLength);
- WriteLog("GUI: Setting up homebrew (JAG)... Run address: %08X, length: %08X\n", runAddress, jaguarROMSize - 0x2E);
- memcpy(jaguarMainRAM + loadAddress, jaguarMainROM + 0x2E, jaguarROMSize - 0x2E);
-// SET32(jaguar_mainRam, 4, runAddress);
- jaguarRunAddress = runAddress;
- }
- else
- return false;
- }
- // .J64 (Jaguar cartridge ROM image) is implied by the FileList object...