2021-12-10 17:36:30 +01:00
|
|
|
#define STR(x) #x
|
|
|
|
#define XSTR(s) STR(s)
|
|
|
|
#define VERSION XSTR(__SC64_VERSION)
|
|
|
|
|
|
|
|
|
|
|
|
.section .text.rom_header
|
|
|
|
header_pi_config:
|
|
|
|
.word 0x80371240
|
|
|
|
|
|
|
|
header_clock_rate:
|
|
|
|
.word 0x0000000F
|
|
|
|
|
|
|
|
header_load_addr:
|
|
|
|
.word entry_handler
|
|
|
|
|
|
|
|
header_sdk_version:
|
|
|
|
.word 0x00000000
|
|
|
|
|
|
|
|
header_crc:
|
|
|
|
.fill 2, 4, 0
|
|
|
|
|
|
|
|
.org 0x20, 0x00
|
|
|
|
header_text_info:
|
|
|
|
.global header_text_info
|
|
|
|
.ascii "SummerLoader64 "
|
|
|
|
.ascii VERSION
|
|
|
|
.org 0x40, 0x00
|
|
|
|
|
|
|
|
|
|
|
|
.section .text.ipl3
|
|
|
|
ipl3:
|
|
|
|
.incbin "header", 0x40
|
|
|
|
|
|
|
|
|
|
|
|
.section .text.entry_handler
|
|
|
|
entry_handler:
|
|
|
|
.global entry_handler
|
|
|
|
|
|
|
|
la $gp, _gp
|
|
|
|
la $sp, _sp
|
|
|
|
|
2022-01-07 15:01:43 +01:00
|
|
|
la $t0, exception_install
|
|
|
|
jalr $t0
|
|
|
|
|
2021-12-10 17:36:30 +01:00
|
|
|
la $t0, init
|
|
|
|
jalr $t0
|
|
|
|
|
|
|
|
la $t0, main
|
|
|
|
jalr $t0
|
|
|
|
|
|
|
|
loop:
|
|
|
|
j loop
|
|
|
|
|
|
|
|
|
|
|
|
.section .text.ipl2
|
|
|
|
ipl2:
|
|
|
|
.global ipl2
|
|
|
|
.set noat
|
|
|
|
.set noreorder
|
|
|
|
lui $t5, 0xBFC0
|
|
|
|
1:
|
|
|
|
lw $t0, 0x7FC($t5)
|
|
|
|
addiu $t5, $t5, 0x7C0
|
|
|
|
andi $t0, $t0, 0x80
|
|
|
|
bnel $t0, $zero, 1b
|
|
|
|
lui $t5, 0xBFC0
|
|
|
|
lw $t0, 0x24($t5)
|
|
|
|
lui $t3, 0xB000
|