mirror of
https://github.com/notwa/mm
synced 2024-11-05 06:49:03 -08:00
disable onscreen printing, add lock to prevent corruption
This commit is contained in:
parent
8b38afbb7f
commit
3bdd305fb6
1 changed files with 16 additions and 5 deletions
|
@ -2,6 +2,9 @@
|
||||||
// to copy strings to memory instead
|
// to copy strings to memory instead
|
||||||
// for Lua to later pick up on
|
// for Lua to later pick up on
|
||||||
|
|
||||||
|
jr
|
||||||
|
nop
|
||||||
|
/*
|
||||||
[global_context]: 0x80212020
|
[global_context]: 0x80212020
|
||||||
|
|
||||||
// offset from first pointer in global context
|
// offset from first pointer in global context
|
||||||
|
@ -14,10 +17,6 @@
|
||||||
[InitTxtStruct]: 0x800FBB8C // unused here; we set it up inline
|
[InitTxtStruct]: 0x800FBB8C // unused here; we set it up inline
|
||||||
[DoTxtStruct]: 0x800FBC1C
|
[DoTxtStruct]: 0x800FBC1C
|
||||||
[UpdateTxtStruct]: 0x800FBC64
|
[UpdateTxtStruct]: 0x800FBC64
|
||||||
|
|
||||||
[ObjectSpawn]: 0x80097C00
|
|
||||||
[ObjectIndex]: 0x8009812C
|
|
||||||
|
|
||||||
push 4, 1, ra
|
push 4, 1, ra
|
||||||
// draw the debug text
|
// draw the debug text
|
||||||
li a0, 0x00010001 // xy
|
li a0, 0x00010001 // xy
|
||||||
|
@ -38,20 +37,31 @@ fmt:
|
||||||
.align
|
.align
|
||||||
|
|
||||||
.include "simple text.asm"
|
.include "simple text.asm"
|
||||||
|
*/
|
||||||
|
|
||||||
// keep track of where we are in the buffer
|
// keep track of where we are in the buffer
|
||||||
|
.org 0x807006F8
|
||||||
buffer_pos:
|
buffer_pos:
|
||||||
|
.word buffer
|
||||||
|
|
||||||
|
buffer_lock:
|
||||||
.word 0
|
.word 0
|
||||||
|
|
||||||
.align 4
|
//.align 4
|
||||||
buffer:
|
buffer:
|
||||||
.skip 0x3000
|
.skip 0x3000
|
||||||
|
|
||||||
|
// force a crash-like thing that dumps a ton of (RDP?) info:
|
||||||
|
//.org 0x800C5E78
|
||||||
|
// li t8, 0x29a
|
||||||
|
|
||||||
// overwrite (not hook) the debug printing function
|
// overwrite (not hook) the debug printing function
|
||||||
.org 0x800021B0
|
.org 0x800021B0
|
||||||
// a0: unknown
|
// a0: unknown
|
||||||
// a1: char *msg
|
// a1: char *msg
|
||||||
// a2: size_t len
|
// a2: size_t len
|
||||||
|
li t0, 1
|
||||||
|
sw t0, buffer_lock
|
||||||
lw t0, buffer_pos
|
lw t0, buffer_pos
|
||||||
copy_loop:
|
copy_loop:
|
||||||
lb t1, 0(a1)
|
lb t1, 0(a1)
|
||||||
|
@ -62,5 +72,6 @@ copy_loop:
|
||||||
bne a2, r0, copy_loop
|
bne a2, r0, copy_loop
|
||||||
sb r0, 0(t0) // null terminate
|
sb r0, 0(t0) // null terminate
|
||||||
sw t0, buffer_pos
|
sw t0, buffer_pos
|
||||||
|
sw r0, buffer_lock
|
||||||
jr
|
jr
|
||||||
nop
|
nop
|
||||||
|
|
Loading…
Reference in a new issue