La rutina es de como insertar mugshot via ASM, creo que muchos han visto esta rutina, esta rondando por pokeco.
El problema es que a la hora de crear la tabla y cambiar todos los campos de la rutina, al momento de compilarla en el Thum me da error y no aparece el archivo .bin de la rutina.
Alguien me podría decir que hago mal :(
Aquí esta la rutina sin compilar y sin cambiar los campos:
.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 TABLE, 0x08[TABLE]
.equ DEST, 0x06014000
.equ BUFFER, 0x020377F8
.equ CREATEOAM, 0x08006F8D
.equ OAMNUM, 0x0203C000
.equ VAR, 0x4500
.equ VARDEC, 0x0806E455
.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 + 0x08[OFFSET_OF_THIS_CODE]
BUFFERDATA:
.hword 0x2
.hword 0x1
.word OAMDATA + 0x08[OFFSET_OF_THIS_CODE]
.word ANIMATION + 0x08[OFFSET_OF_THIS_CODE]
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION: .word OAMANIM + 0x08[OFFSET_OF_THIS_CODE]
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 + 0x08[OFFSET_OF_THIS_CODE]
BUFFERDATA2:
.hword 0x2
.hword 0x1
.word OAMDATA2 + 0x08[OFFSET_OF_THIS_CODE]
.word ANIMATION2 + 0x08[OFFSET_OF_THIS_CODE]
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION2: .word OAMANIM2 + 0x08[OFFSET_OF_THIS_CODE]
OAMANIM2:
.hword 0x241
.hword 0xA
.hword 0xFFFE
.hword 0x0
.align 2
OAMDATA2:
.byte 0x0
.byte 0x0
.byte 0x0
.byte 0xC0
.hword 0x1
.hword 0x0
.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 TABLE, 0x08[TABLE]
.equ DEST, 0x06014000
.equ BUFFER, 0x020377F8
.equ CREATEOAM, 0x08006F8D
.equ OAMNUM, 0x0203C000
.equ VAR, 0x4500
.equ VARDEC, 0x0806E455
.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 + 0x08[OFFSET_OF_THIS_CODE]
BUFFERDATA:
.hword 0x2
.hword 0x1
.word OAMDATA + 0x08[OFFSET_OF_THIS_CODE]
.word ANIMATION + 0x08[OFFSET_OF_THIS_CODE]
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION: .word OAMANIM + 0x08[OFFSET_OF_THIS_CODE]
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 + 0x08[OFFSET_OF_THIS_CODE]
BUFFERDATA2:
.hword 0x2
.hword 0x1
.word OAMDATA2 + 0x08[OFFSET_OF_THIS_CODE]
.word ANIMATION2 + 0x08[OFFSET_OF_THIS_CODE]
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION2: .word OAMANIM2 + 0x08[OFFSET_OF_THIS_CODE]
OAMANIM2:
.hword 0x241
.hword 0xA
.hword 0xFFFE
.hword 0x0
.align 2
OAMDATA2:
.byte 0x0
.byte 0x0
.byte 0x0
.byte 0xC0
.hword 0x1
.hword 0x0
Y aquí esta la rutina con todos los campos cambiados, o sea donde dice [tabla] y donde dice [offset_of_this_code]
.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 TABLE, 0x08B0E88008C0EC83080E000000
.equ DEST, 0x06014000
.equ BUFFER, 0x020377F8
.equ CREATEOAM, 0x08006F8D
.equ OAMNUM, 0x0203C000
.equ VAR, 0x4500
.equ VARDEC, 0x0806E455
.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 + 0x08831900
BUFFERDATA:
.hword 0x2
.hword 0x1
.word OAMDATA + 0x08831900
.word ANIMATION + 0x08831900
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION: .word OAMANIM + 0x08831900
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 + 0x08831900
BUFFERDATA2:
.hword 0x2
.hword 0x1
.word OAMDATA2 + 0x08831900
.word ANIMATION2 + 0x08831900
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION2: .word OAMANIM2 + 0x08831900
OAMANIM2:
.hword 0x241
.hword 0xA
.hword 0xFFFE
.hword 0x0
.align 2
OAMDATA2:
.byte 0x0
.byte 0x0
.byte 0x0
.byte 0xC0
.hword 0x1
.hword 0x0
.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 TABLE, 0x08B0E88008C0EC83080E000000
.equ DEST, 0x06014000
.equ BUFFER, 0x020377F8
.equ CREATEOAM, 0x08006F8D
.equ OAMNUM, 0x0203C000
.equ VAR, 0x4500
.equ VARDEC, 0x0806E455
.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 + 0x08831900
BUFFERDATA:
.hword 0x2
.hword 0x1
.word OAMDATA + 0x08831900
.word ANIMATION + 0x08831900
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION: .word OAMANIM + 0x08831900
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 + 0x08831900
BUFFERDATA2:
.hword 0x2
.hword 0x1
.word OAMDATA2 + 0x08831900
.word ANIMATION2 + 0x08831900
.word 0x0
.word 0x08231CFC
.word 0x080EE4DD
.byte 0xFF
.align 2
ANIMATION2: .word OAMANIM2 + 0x08831900
OAMANIM2:
.hword 0x241
.hword 0xA
.hword 0xFFFE
.hword 0x0
.align 2
OAMDATA2:
.byte 0x0
.byte 0x0
.byte 0x0
.byte 0xC0
.hword 0x1
.hword 0x0
Saludos:D