minor cleanup

This commit is contained in:
Connor Olding 2018-09-28 10:40:22 +02:00
parent 551d4f153f
commit a2212d6ca6
3 changed files with 28 additions and 12 deletions

View file

@ -40,7 +40,7 @@ Start:
// enable CPU interrupts.
mfc0 t1, CP0_Status
ori t1, t1, CP0_STATUS_IM_ALL | CP0_STATUS_IE
ori t1, CP0_STATUS_IM_ALL | CP0_STATUS_IE
mtc0 t1, CP0_Status
// enable even more interrupts.
@ -74,7 +74,7 @@ Start:
// SP defaults to RSP instruction memory: 0xA4001FF0
// we can do better than that.
li sp, K_STACK_INIT
la sp, K_STACK_INIT
// SP should always be 8-byte aligned
// so that SD and LD instructions don't fail on it.
// we also need 4 empty words for storing

View file

@ -23,9 +23,11 @@ if origin() != 0x1000 {
include "kernel.asm"
Main:
lui s0, MAIN_BASE
if 0 {
DecompImage:
lui s0, MAIN_BASE
nop; nop; nop; nop
mfc0 t0, CP0_Count
sw t0, MAIN_COUNTS+0(s0)
@ -48,14 +50,11 @@ if 0 {
jal PokeDataCache
nop
}
lui a0, MAIN_BASE
jal MainDumpWrite
lli a1, 0x20
ori a2, a0, MAIN_XXD
jal DumpAndWrite
lli a3, 0x20 * 4
WriteString(KS_Newline)
}
Test3D:
// write the jump to our actual commands
@ -107,7 +106,6 @@ Start3D:
lui a0, SP_BASE
lli t0, SP_INT_ON_BREAK_SET | SP_SINGLE_STEP_CLR | SP_BREAK_CLR | SP_HALT_CLR
sw t0, SP_STATUS(a0)
nop
SetIntMask()
@ -154,6 +152,24 @@ if HICOLOR {
jr ra
nop
MainDumpWrite:
subiu sp, 0x18
sw ra, 0x10(sp)
lui a2, MAIN_BASE
ori a2, MAIN_XXD
jal DumpAndWrite // a0,a1 passthru
lli a3, 0x200
WriteString(KS_Newline)
lw ra, 0x10(sp)
jr ra
addiu sp, 0x18
Die:
j Die
nop
include "lzss.baku.unsafe.asm"
include "dlist.asm"
include "task.asm"

View file

@ -1,6 +1,6 @@
PushVideoTask:
// a0: Task RDRAM Pointer (size: 0x40) (should probably be row-aligned)
subiu sp, sp, 0x18
subiu sp, 0x18
sw ra, 0x10(sp)
lli t0, 1 // mode: video
@ -46,11 +46,11 @@ PushVideoTask:
li t9, ADDR_MASK
jal PushRSPTask
and a0, a0, t9
and a0, t9
lw ra, 0x10(sp)
jr ra
addiu sp, sp, 0x18
addiu sp, 0x18
PushRSPTask:
lli t3, 0x40 - 1 // DMA quirk