jiangzhengwenjz
Usuario mítico
I've found @Andrea's script codes to make the textbox transparent in Pokemon Ruby, so I decided to make it automatic.
I will explain what I did: (1,2 are done correctly, 3 is the problem)
1. I found the script pointer table in Ruby, so I found the ASM code of "preparemsg" "waitmsg" "yesnobox" "end". I decide to activate the I/O and WRAM modification through it.
2. I decided to modify "waitmsg" to activate and "end" to deactivate.
Here's the code: (These are right so I only provide the compiled code)
@0x080670A4
@0x08065806
@0x08800000
@0x08810000
3. After that all things go right except "yesnobox", whose asm routine is also called in "msgbox @msgpointer 0x5" in XSE's scripting style. But I have no idea now about it, though I know that I must deactive in this routine. if I do it at the beginning, the text won't be shown as transparent.
Here's the code:
Branch:
@0x08067100
Newcode:
@0x08820000
Of course, there's another instruction in 0x08067108
I think the code is without any problem. The problem maybe that I branch too early in this function but I have no idea when to get out of the code.
It will be very appreciated if anyone can help.
If someone can tell me how to make the yesnobox transparent, that will be better!
P.S. I know that my code is not efficient but it's just for test.
I will explain what I did: (1,2 are done correctly, 3 is the problem)
1. I found the script pointer table in Ruby, so I found the ASM code of "preparemsg" "waitmsg" "yesnobox" "end". I decide to activate the I/O and WRAM modification through it.
2. I decided to modify "waitmsg" to activate and "end" to deactivate.
Here's the code: (These are right so I only provide the compiled code)
@0x080670A4
Código:
00 49 08 47 01 00 80 08
Código:
00 00 00 49 08 47 01 00 81 08
Código:
11 49 09 68 03 B4 3F 20 10 49 08 70 48 72 1F 20 48 70 41 20 08 72 0F 20 88 72 0A 20 C8 72 0C 49 FF 20 08 70 48 70 00 20 48 80 0A 49 08 80 C8 80 88 60 C8 60 08 82 03 BC 00 F0 03 F8 01 20 02 BC 08 47 05 4A 10 47 C0 46 B0 70 06 08 48 00 00 04 AA F0 02 02 B8 F0 02 02 DD 53 06 08
Código:
01 B4 1F 20 1B 49 08 70 48 70 40 20 08 72 1E 20 48 72 10 20 88 72 00 20 C8 72 17 49 C8 70 29 20 08 70 25 20 48 70 1F 20 88 70 5A 20 13 49 08 70 67 20 48 70 9C 20 88 71 77 20 C8 71 FF 20 08 72 88 73 7F 20 48 72 C8 72 C8 73 33 20 88 72 3F 20 08 73 72 20 48 73 0E 20 08 74 53 20 48 74 01 BC 00 F0 03 F8 00 20 02 BC 08 47 01 49 08 47 C0 46 E5 53 06 08 48 00 00 04 AA F0 02 02 B8 F0 02 02
Here's the code:
Branch:
@0x08067100
Código:
.thumb
ldr r3, newcode
bx r3
.align 2
newcode: .word 0x08820001
@0x08820000
Código:
.thumb
ldrb r3, [r2]
add r2, #0x1
str r2, [r0, #0x8]
ldrb r1, [r2]
add r2, #0x1
main:
push {r0, r1}
mov r0, #0x1F
ldr r1, offset1
strb r0, [r1, #0x0]
strb r0, [r1, #0x1]
mov r0, #0x40
strb r0, [r1, #0x8]
mov r0, #0x1E
strb r0, [r1, #0x9]
mov r0, #0x10
strb r0, [r1, #0xA]
mov r0, #0x0
strb r0, [r1, #0xB]
ldr r1, offset2
strb r0, [r1, #0x3]
mov r0, #0x29
strb r0, [r1, #0x0]
mov r0, #0x25
strb r0, [r1, #0x1]
mov r0, #0x1F
strb r0, [r1, #0x2]
mov r0, #0x5A
ldr r1, offset3
strb r0, [r1, #0x0]
mov r0, #0x67
strb r0, [r1, #0x1]
mov r0, #0x9C
strb r0, [r1, #0x6]
mov r0, #0x77
strb r0, [r1, #0x7]
mov r0, #0xFF
strb r0, [r1, #0x8]
strb r0, [r1, #0xE]
mov r0, #0x7F
strb r0, [r1, #0x9]
strb r0, [r1, #0xB]
strb r0, [r1, #0xF]
mov r0, #0x33
strb r0, [r1, #0xA]
mov r0, #0x3F
strb r0, [r1, #0xC]
mov r0, #0x72
strb r0, [r1, #0xD]
mov r0, #0xE
strb r0, [r1, #0x10]
mov r0, #0x53
strb r0, [r1, #0x11]
ldr r0, backaddr
bx r0
.align 2
offset1: .word 0x04000048
offset2: .word 0x0202F0AA
offset3: .word 0x0202F0B8
backaddr: .word 0x08067109
Código:
.thumb
pop {r0, r1}
It will be very appreciated if anyone can help.
If someone can tell me how to make the yesnobox transparent, that will be better!
P.S. I know that my code is not efficient but it's just for test.
Última edición: