.text
.thumb
.align 2
/*
usage:
writebytetooffset 0x[table_num] RAM_SETTER
createsprite 0x[sprite_num] etc etc...
*/
@ customize this
.equ RAM_SETTER, 0x02xxxxxx
.equ offset, 0xYYYYYY @ where the function will go
.equ rom, 0x08000000
@ remove byte limit
@ prevent lnpc_new from removing upper byte from sprite num
.org 0x5ea0a, 0xff
.word 0x0
@ script cmd location
.org 0x15fc5c, 0xff
.word offset+rom+1
@ function
.org offset, 0xff
main:
push {r4-r6,lr}
mov r6, r8
push {r6}
sub sp, #0x8
mov r5, r0
ldr r0, [r5, #0x8]
ldrb r1, [r0] @sprite number
ldr r6, =RAM_SETTER
ldrb r6, [r6]
cmp r6, #0x0
beq createSprite
getTable:
lsl r6, r6, #0x18
lsr r6, r6, #0x10
orr r1, r6
createSprite:
mov r8, r1
ldr r6, =(0x0806b660 +1)
bx r6