mirror of
https://gitlab.com/ryandwyer/perfect-dark
synced 2026-08-15 12:38:56 -04:00
Introduce preamble segment and disassemble preamble
This commit is contained in:
@@ -39,62 +39,6 @@ u32 var8008d264;
|
||||
u32 var8008d268;
|
||||
u32 var8008d26c;
|
||||
|
||||
/**
|
||||
* This function is generated automatically by makerom. It clears the BSS
|
||||
* segment, sets the stack pointer to 0x80000f10 and then calls boot.
|
||||
*/
|
||||
#if VERSION >= VERSION_PAL_FINAL
|
||||
GLOBAL_ASM(
|
||||
glabel preamble
|
||||
/* 1000: 3c088009 */ lui $t0,%hi(_bssSegmentStart)
|
||||
/* 1004: 3c090002 */ lui $t1,0x2
|
||||
/* 1008: 2508ae20 */ addiu $t0,$t0,%lo(_bssSegmentStart)
|
||||
/* 100c: 352923a0 */ ori $t1,$t1,0x23f0
|
||||
.L00001010:
|
||||
/* 1010: 2129fff8 */ addi $t1,$t1,-8
|
||||
/* 1014: ad000000 */ sw $zero,0x0($t0)
|
||||
/* 1018: ad000004 */ sw $zero,0x4($t0)
|
||||
/* 101c: 1520fffc */ bnez $t1,.L00001010
|
||||
/* 1020: 21080008 */ addi $t0,$t0,0x8
|
||||
/* 1024: 3c0a8000 */ lui $t2,0x8000
|
||||
/* 1028: 3c1d8000 */ lui $sp,0x8000
|
||||
/* 102c: 254a1050 */ addiu $t2,$t2,0x1050
|
||||
/* 1030: 01400008 */ jr $t2
|
||||
/* 1034: 27bd0f10 */ addiu $sp,$sp,0xf10
|
||||
/* 1038: 00000000 */ nop
|
||||
/* 103c: 00000000 */ nop
|
||||
/* 1040: 00000000 */ nop
|
||||
/* 1044: 00000000 */ nop
|
||||
/* 1048: 00000000 */ nop
|
||||
/* 104c: 00000000 */ nop
|
||||
);
|
||||
#else
|
||||
GLOBAL_ASM(
|
||||
glabel preamble
|
||||
/* 1000: 3c088009 */ lui $t0,%hi(_bssSegmentStart)
|
||||
/* 1004: 3c090002 */ lui $t1,0x2
|
||||
/* 1008: 2508ae20 */ addiu $t0,$t0,%lo(_bssSegmentStart)
|
||||
/* 100c: 352923a0 */ ori $t1,$t1,0x23a0
|
||||
.L00001010:
|
||||
/* 1010: 2129fff8 */ addi $t1,$t1,-8
|
||||
/* 1014: ad000000 */ sw $zero,0x0($t0)
|
||||
/* 1018: ad000004 */ sw $zero,0x4($t0)
|
||||
/* 101c: 1520fffc */ bnez $t1,.L00001010
|
||||
/* 1020: 21080008 */ addi $t0,$t0,0x8
|
||||
/* 1024: 3c0a8000 */ lui $t2,0x8000
|
||||
/* 1028: 3c1d8000 */ lui $sp,0x8000
|
||||
/* 102c: 254a1050 */ addiu $t2,$t2,0x1050
|
||||
/* 1030: 01400008 */ jr $t2
|
||||
/* 1034: 27bd0f10 */ addiu $sp,$sp,0xf10
|
||||
/* 1038: 00000000 */ nop
|
||||
/* 103c: 00000000 */ nop
|
||||
/* 1040: 00000000 */ nop
|
||||
/* 1044: 00000000 */ nop
|
||||
/* 1048: 00000000 */ nop
|
||||
/* 104c: 00000000 */ nop
|
||||
);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Sets up TLB index 0 (0x70000000), then calls init.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "macros.inc"
|
||||
.set noat
|
||||
.set noreorder
|
||||
|
||||
.text
|
||||
|
||||
/**
|
||||
* This function is generated automatically by makerom. It clears the BSS
|
||||
* segment, sets the stack pointer to 0x80000f10 and then calls boot.
|
||||
*/
|
||||
glabel preamble
|
||||
lui $t0, %hi(_bssSegmentStart)
|
||||
lui $t1, %hi(_bssSegmentLen)
|
||||
addiu $t0, $t0, %lo(_bssSegmentStart)
|
||||
ori $t1, $t1, %lo(_bssSegmentLen)
|
||||
.L00001010:
|
||||
addi $t1, $t1, -8
|
||||
sw $zero, 0($t0)
|
||||
sw $zero, 4($t0)
|
||||
bnez $t1, .L00001010
|
||||
addi $t0, $t0, 8
|
||||
lui $t2, %hi(bootFromPreamble)
|
||||
lui $sp, 0x8000
|
||||
addiu $t2, $t2, %lo(bootFromPreamble)
|
||||
jr $t2
|
||||
addiu $sp, $sp, 0xf10
|
||||
Reference in New Issue
Block a user