rename BLAH to MAIN
This commit is contained in:
parent
94dfed2dc8
commit
caf6307ca7
2 changed files with 25 additions and 26 deletions
16
inc/main.inc
16
inc/main.inc
|
@ -1,13 +1,13 @@
|
||||||
// settings:
|
// settings:
|
||||||
constant K_DEBUG(0) // slows down interrupt handling to enable debug routines
|
constant K_DEBUG(0) // slows down interrupt handling to enable debug routines
|
||||||
|
|
||||||
constant BLAH_BASE(0x800E)
|
constant MAIN_BASE(0x800E)
|
||||||
constant BLAH_COUNTS(0x0010)
|
constant MAIN_COUNTS(0x0010)
|
||||||
constant BLAH_SP_TASK(0x0040)
|
constant MAIN_SP_TASK(0x0040)
|
||||||
constant BLAH_XXD(0x0080)
|
constant MAIN_XXD(0x0080)
|
||||||
constant BLAH_DLIST(0x1000)
|
constant MAIN_DLIST(0x1000)
|
||||||
constant BLAH_DLIST_SIZE(0xF000)
|
constant MAIN_DLIST_SIZE(0xF000)
|
||||||
constant BLAH_DLIST_JUMPER(BLAH_DLIST - 0xA8)
|
constant MAIN_DLIST_JUMPER(MAIN_DLIST - 0xA8)
|
||||||
|
|
||||||
// video settings
|
// video settings
|
||||||
constant WIDTH(640)
|
constant WIDTH(640)
|
||||||
|
@ -29,6 +29,6 @@ constant VIDEO_STACK(VIDEO_SOMETHING - VIDEO_STACK_SIZE)
|
||||||
constant VIDEO_YIELD(VIDEO_STACK - VIDEO_YIELD_SIZE)
|
constant VIDEO_YIELD(VIDEO_STACK - VIDEO_YIELD_SIZE)
|
||||||
constant VIDEO_START(VIDEO_YIELD)
|
constant VIDEO_START(VIDEO_YIELD)
|
||||||
|
|
||||||
if VIDEO_START < (BLAH_BASE << 16) + 0x10000 {
|
if VIDEO_START < (MAIN_BASE << 16) + 0x10000 {
|
||||||
error "ran out of memory for video"
|
error "ran out of memory for video"
|
||||||
}
|
}
|
||||||
|
|
35
main.asm
35
main.asm
|
@ -23,10 +23,10 @@ if origin() != 0x1000 {
|
||||||
include "kernel.asm"
|
include "kernel.asm"
|
||||||
|
|
||||||
Main:
|
Main:
|
||||||
lui s0, BLAH_BASE
|
lui s0, MAIN_BASE
|
||||||
nop; nop; nop; nop
|
nop; nop; nop; nop
|
||||||
mfc0 t0, CP0_Count
|
mfc0 t0, CP0_Count
|
||||||
sw t0, BLAH_COUNTS+0(s0)
|
sw t0, MAIN_COUNTS+0(s0)
|
||||||
|
|
||||||
// decompress our picture
|
// decompress our picture
|
||||||
la a0, LZ_BAKU + 4
|
la a0, LZ_BAKU + 4
|
||||||
|
@ -39,28 +39,28 @@ Main:
|
||||||
mfc0 t0, CP0_Count
|
mfc0 t0, CP0_Count
|
||||||
nop; nop; nop; nop
|
nop; nop; nop; nop
|
||||||
|
|
||||||
lw t1, BLAH_COUNTS+0x0(s0)
|
lw t1, MAIN_COUNTS+0x0(s0)
|
||||||
sw t0, BLAH_COUNTS+0x4(s0)
|
sw t0, MAIN_COUNTS+0x4(s0)
|
||||||
subu t1, t0, t1
|
subu t1, t0, t1
|
||||||
sw t1, BLAH_COUNTS+0xC(s0)
|
sw t1, MAIN_COUNTS+0xC(s0)
|
||||||
|
|
||||||
jal PokeDataCache
|
jal PokeDataCache
|
||||||
nop
|
nop
|
||||||
|
|
||||||
lui a0, BLAH_BASE
|
lui a0, MAIN_BASE
|
||||||
lli a1, 0x20
|
lli a1, 0x20
|
||||||
ori a2, a0, BLAH_XXD
|
ori a2, a0, MAIN_XXD
|
||||||
jal DumpAndWrite
|
jal DumpAndWrite
|
||||||
lli a3, 0x20 * 4
|
lli a3, 0x20 * 4
|
||||||
WriteString(KS_Newline)
|
WriteString(KS_Newline)
|
||||||
|
|
||||||
Test3D:
|
Test3D:
|
||||||
// write the jump to our actual instructions
|
// write the jump to our actual instructions
|
||||||
lui a0, BLAH_BASE
|
lui a0, MAIN_BASE
|
||||||
lui t0, 0xDE01 // jump (no push)
|
lui t0, 0xDE01 // jump (no push)
|
||||||
ori t1, a0, BLAH_DLIST
|
ori t1, a0, MAIN_DLIST
|
||||||
sw t0, BLAH_DLIST_JUMPER+0(a0)
|
sw t0, MAIN_DLIST_JUMPER+0(a0)
|
||||||
sw t1, BLAH_DLIST_JUMPER+4(a0)
|
sw t1, MAIN_DLIST_JUMPER+4(a0)
|
||||||
|
|
||||||
jal SetupScreen
|
jal SetupScreen
|
||||||
nop
|
nop
|
||||||
|
@ -68,8 +68,8 @@ Test3D:
|
||||||
lli s1, 1 // s1: which color buffer we're writing to (1: alt)
|
lli s1, 1 // s1: which color buffer we're writing to (1: alt)
|
||||||
|
|
||||||
Start3D:
|
Start3D:
|
||||||
lui a0, BLAH_BASE
|
lui a0, MAIN_BASE
|
||||||
ori a0, BLAH_DLIST
|
ori a0, MAIN_DLIST
|
||||||
jal WriteDList
|
jal WriteDList
|
||||||
or a1, s1, r0
|
or a1, s1, r0
|
||||||
jal PokeDataCache
|
jal PokeDataCache
|
||||||
|
@ -95,9 +95,9 @@ Start3D:
|
||||||
// only the lowest 12 bits are used, so 00000000 is equivalent to 04001000.
|
// only the lowest 12 bits are used, so 00000000 is equivalent to 04001000.
|
||||||
sw r0, SP_PC(a0)
|
sw r0, SP_PC(a0)
|
||||||
|
|
||||||
lui a0, BLAH_BASE
|
lui a0, MAIN_BASE
|
||||||
jal PushVideoTask
|
jal PushVideoTask
|
||||||
ori a0, a0, BLAH_SP_TASK
|
ori a0, a0, MAIN_SP_TASK
|
||||||
|
|
||||||
SP_BUSY_WAIT()
|
SP_BUSY_WAIT()
|
||||||
|
|
||||||
|
@ -149,7 +149,6 @@ SwitchToAlt:
|
||||||
j Start3D
|
j Start3D
|
||||||
lli s1, 1
|
lli s1, 1
|
||||||
|
|
||||||
KSL(SWaiting, "Waiting on RSP...")
|
|
||||||
KSL(SNewFrame, "next frame")
|
KSL(SNewFrame, "next frame")
|
||||||
|
|
||||||
SetupScreen:
|
SetupScreen:
|
||||||
|
@ -186,7 +185,7 @@ PushVideoTask:
|
||||||
li t1, VIDEO_STACK_SIZE
|
li t1, VIDEO_STACK_SIZE
|
||||||
li t2, VIDEO_SOMETHING & ADDR_MASK
|
li t2, VIDEO_SOMETHING & ADDR_MASK
|
||||||
li t3, (VIDEO_SOMETHING & ADDR_MASK) + VIDEO_SOMETHING_SIZE // end pointer (not size!)
|
li t3, (VIDEO_SOMETHING & ADDR_MASK) + VIDEO_SOMETHING_SIZE // end pointer (not size!)
|
||||||
li t4, ((BLAH_BASE << 16) | BLAH_DLIST_JUMPER) & ADDR_MASK // initial DList
|
li t4, ((MAIN_BASE << 16) | MAIN_DLIST_JUMPER) & ADDR_MASK // initial DList
|
||||||
lli t5, 8 // size of one jump command. this is ignored and 0xA8 is used instead
|
lli t5, 8 // size of one jump command. this is ignored and 0xA8 is used instead
|
||||||
li t6, VIDEO_YIELD & ADDR_MASK
|
li t6, VIDEO_YIELD & ADDR_MASK
|
||||||
li t7, VIDEO_YIELD_SIZE
|
li t7, VIDEO_YIELD_SIZE
|
||||||
|
@ -244,6 +243,6 @@ align(16); insert F3DZEX_IMEM, "bin/F3DZEX2.bin"
|
||||||
align(16); insert FONT, "res/dwarf.1bpp"
|
align(16); insert FONT, "res/dwarf.1bpp"
|
||||||
align(16); insert LZ_BAKU, "res/Image.baku.lzss"
|
align(16); insert LZ_BAKU, "res/Image.baku.lzss"
|
||||||
|
|
||||||
if pc() > (BLAH_BASE << 16) {
|
if pc() > (MAIN_BASE << 16) {
|
||||||
error "ran out of memory for code and data"
|
error "ran out of memory for code and data"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue