Loading 1st file without 1st load address but with FLD_KRNL.BIN in IP.BIN

I was able to not have a 1st load address, 0xF0, on the IP.BIN file and was subsequently able to load the first file from CD.

The linker had the correct address 0x06010000.
The linker also had the KEEP for sl_bin section that I have like normal.
The linker does not load the file the Saturn does, but the linker keeps the files in the correct layout.

The IP.BIN file is allowed to be 0x8000 or 32KB.
The SEC1.BIN file is 1/26/1995 stamp and 4KB --> from psy-q
The SEC2.BIN file is 1/26/1995 stamp and 1KB --> from psy-q
The FLD_KRNL_BIN file is 2/7/1996 stamp and 5KB --> This is the earliest file without files in the header, and 202001a4 at 0x00.


How it works is the assembly file for IP.BIN <-- IP.S starts off like normal.
IP.S is made into IP.o with gcc.
Then IP.o is made into IP.BIN with objcopy

(Not the full attached IP.S file, just the important parts)
Differences are 0xCC has 0x01010000 this is used for demo demo (no impact in this case).
The important part is 0xF0 has no 1st read address.

Code:
.ascii    "SEGA SEGASATURN "    !0x00

.ascii    "SEGASYSTEMV1.000"    !0x20

.long     0x01010000            !0xCC

.long     0x8000                !0xE0     u32 ip_size

.long     0x0                   !0xF0     u32 read_addr


At org 0x100 the SEC1.BIN and SEC2.BIN files are .incbin and they end like expected at 0xf00

Rich (BB code):
    .org 0x100
    .incbin "SEC1.bin"
    .incbin "SEC2.bin"            !0xf00 end

Next is SR interrupt and jump to 0x260042b0.
0x260042b0 is the address after the FLD_KRNL_BIN file.

The Saturn Bios copies your IP.BIN file directly into 0x06002000.
So your first 0x00 - 0x100 needs to be the necessary information
The next 0x100 - 0xf00 is the security files

0xf00 in Yabause and pseudosaturn is where you are allowed to run code or AIP.
The SR interrupt and jump ends at 0xf28
At 0xf28 I add another .incbin to load the FLD_KRNL_BIN file.

Rich (BB code):
    .org 0xf28
    .incbin "FLD_KNL_v0.BIN"    !0xf28 + 0x1388 = 22b0 + 0x06002000 = 0x060042b0

    !0x1388 = 5kb the size of FLD_KRNL.BIN

After that then I turn off the Scu_interrupts.
Set LWRAM_size to 0x1378 (true size of FLD_KRNL.BIN)
Point to LWRAM_destination 0x20200000
Point to LWRAM_src 0x26002f28

At this point I copy FLD_KRNL.BIN from IP.BIN to LWRAM.

I then change the starting address to 0x26010000.
This is changed at:
0x2600026c
0x260002b0
0x26000cf0
0x260020f0

At this point I jsr (jump and return) to 0x202001a4.
This is going to LWRAM 0x1a4 into FLD_KRNL_BIN.
This loads the first file in your CD folder into your starting address
After this I return back to 0x260023e0.

Finally I jump to start of the file or 0x26010000

Related Topic:
 

Attachments

Back
Top