Petuuuhhh

Male
Georgia
Seen 14 Minutes Ago
Posted 1 Day Ago
626 posts
2.6 Years
I'm trying to implement this https://www.pokecommunity.com/showthread.php?t=318999
Here's my routines:
loading.asm
.align 2
.thumb

@/* VAR 0x4500 = SPRITE NUMBER IN TABLE */@
@/* VAR 0x4501 = LEFT OR RIGHT SIDE? */@
@/* VAR 0x4502 = SPRITE SLOT IN SCRIPT */@
@/* TABLE: [IMAGE][PALETTE][PAL#][00 00 00] */@

.equ IMAGE, 0x090E88E8 // the silver image from the crfu's location in the rom
.equ TABLE, 0x08B85500
.equ DEST, 0x06014000
.equ PALETTE, 0x090E8D04 // the silver image's palette
.equ BUFFER, 0x020377F8
.equ CREATEOAM, 0x08006F0D
.equ OAMNUM, 0x0203C000
.equ VAR, 0x4500
.equ VARDEC, 0x0806E3B9
.equ OAMBUFFER, 0x0202063C


READING:
push {r0-r7, lr}
ldrh r0, =VAR
ldr r4, =VARDEC
bl EXECUTE
ldrb r5, [r0]
mov r2, #0xC
mul r5, r2
ldr r1, =TABLE
add r5, r5, r1
ldr r6, [r5] @/*R5=TABLE
ldrh r0, =VAR @/*IMAGE
add r0, r0, #0x2
bl EXECUTE
ldrb r0, [r0]
mov r7, r0 @/*SLOT#
mov r2, #0x80
lsl r2, r2, #0x4
mul r0, r0, r2
ldr r3, =DEST
add r3, r3, r0
mov r0, r6
mov r1, r3
swi 0x12
add r5, r5, #0x4 @/*PALETTE
ldr r0, [r5]
add r5, r5, #0x4
ldrb r1, [r5]
ldr r5, =OAMNUM @/*PAL# IN R7
add r5, r5, #0x4F
strb r1, [r5]
mov r2, #0x20
mul r1, r2
ldr r3, =BUFFER
add r1, r1, r3
lsr r2, r2, #0x2
swi 0xC

LOADOBJ:
ldrh r0, =VAR
add r0, r0, #0x1
bl EXECUTE
ldrb r5, [r0] @*/LEFTORRIGHT
mov r3, #0x88
mul r5, r5, r3
mov r6, #0x30
add r1, r5, r6
cmp r7, #0x0
bne OTHER
ldr r0, DATA
b FURTHER

OTHER:
ldr r0, DATA2

FURTHER:
mov r2, #0x53
mov r3, #0x0
ldr r4, =CREATEOAM
bl EXECUTE
ldr r1, =OAMNUM
add r1, r1, r7
strb r0, [r1]
ldr r2, =OAMBUFFER
mov r1, #0x44
mul r0, r0, r1
add r0, r0, r2
add r0, r0, #0x5
ldr r3, =OAMNUM
add r3, r3, #0x4F
ldrb r1, [r3]
lsl r1, r1, #0x4
strb r1, [r0]
pop {r0-r7}
pop {pc}

EXECUTE:
bx r4

.align 2
DATA: .word BUFFERDATA + 0x08985960
BUFFERDATA:
.hword 0x2
.hword 0x1
.word OAMDATA + 0x08985960
.word ANIMATION + 0x08985960
.word 0x0
.word 0x08231BCC
.word 0x080EE44D
.byte 0xFF

.align 2
ANIMATION: .word OAMANIM + 0x08985960
OAMANIM:
.hword 0x201
.hword 0xA
.hword 0xFFFE
.hword 0x0

.align 2
OAMDATA:
.byte 0x0
.byte 0x0
.byte 0x0
.byte 0xC0
.hword 0x1
.hword 0x0

.align 2
DATA2: .word BUFFERDATA2 + 0x08985960
BUFFERDATA2:
.hword 0x2
.hword 0x1
.word OAMDATA2 + 0x08985960
.word ANIMATION2 + 0x08985960
.word 0x0
.word 0x08231BCC
.word 0x080EE46D
.byte 0xFF

.align 2
ANIMATION2: .word OAMANIM2 + 0x08985960
OAMANIM2:
.hword 0x241
.hword 0xA
.hword 0xFFFE
.hword 0x0

.align 2
OAMDATA2:
.byte 0x0
.byte 0x0
.byte 0x0
.byte 0xC0
.hword 0x1
.hword 0x0
removing.asm
.align 2
.thumb

.equ OAMNUM, 0x0203C000
.equ OAMBUFFER, 0x0202063C
.equ DELOAM, 0x08007201

push {r0-r5, lr}
ldr r1, =OAMNUM
ldrb r0, [r1]
cmp r0, #0x0
beq END
mov r2, #0x44
mul r0, r2
ldr r5, =OAMBUFFER
add r0, r0, r5
ldr r4, =DELOAM
bl EXECUTE
ldr r1, =OAMNUM
add r1, r1, #0x1
ldrb r0, [r1]
cmp r0, #0x0
beq END
mov r2, #0x44
mul r0, r2
ldr r5, =OAMBUFFER
add r0, r0, r5
bl EXECUTE

END:
pop {r0-r5}
pop {pc}

EXECUTE:
bx r4
and here's my script:
#dynamic 0xc00000

'---------------
#org @start
lock
special 0x102
compare lastresult 0x0
if 0x1 goto @cantuse
setvar 0x4500 0x0
setvar 0x4501 0x0
setvar 0x4502 0x0
callasm 0x08985961
msgbox @text 0x6
callasm 0x08985a7d
setflag 0x1ff
doanimation 0x9
checkanimation 0x9
release
end

#org @text
= Lapras Paddle!

#org @cantuse
release
end
can anyone help me? special 0x102 is "Is Player Facing Surfable Water" in the Complete FireRed Upgrade. setflag 0x1ff is the Lapras Paddle flag I'm using in combination with ghoulslash's "Surfing Sprites" loading routine. right now, it's just freezing my game when I call the script.