• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Routine of the "thinking event"

97
Posts
15
Years
  • Seen Oct 3, 2016
hello to everybody, most people use writebytetooffset to do a simple thing that it is:
[align=center]
GUDpjAs.png
[/align]

There are more wbto, specially to change the palette ¿no?
Well i made a routine that do it, that is the next:

FOR RUBY:

Code:
.align 2
.thumb

main:
    push {r0-r2,lr}
    ldr r0,.dispcnt
    ldrh r1, .dispcntv
    strh r1,[r0]
    ldr r0, .textbox_pos
    mov r1, #0x5f
    strb r1,[r0]
    ldr r0, .textbox_data
    ldrh r1, .ff
    strh r1, [r0]
    mov r2, #0x0
    b bucle

bucle:
    add r2, #0x2
    mov r1, #0x00
    strh r1, [r0, r2]
    cmp r2, #0x1C
    beq end
    b bucle

end:
    pop {r0-r2,pc}

.align 2
.textbox_data: .word 0x0202f0aa    
.ff: .word 0x0000ffff    
.dispcnt: .word 0x04000000    
.dispcntv: .word 0x00006161    
.textbox_pos: .word 0x04000012
And after that, how to push it normal.

Code:
.align 2
.thumb

main:
    push {r0-r3,lr}
    ldr r0, .dispcnt
    ldr r1, .dispcntv
    strh r1,[r0]
    ldr r0, .textbox_pos
    mov r1, #0x0
    strb r1,[r0]
    mov r2, #0x0
    ldr r0, .textbox
    ldr r1, .textboxv
    b change
    
change:
    ldr r3,[r1] @valor xxxx xxxx r1
    str r3,[r0,r2]
    add r2,#0x2
    add r1,#0x2
    cmp r2, #0x1c
    beq fin
    b change
    
fin:
    pop {r0-r3,pc}
    

.align 2
.textbox: .word 0x0202f0aa    
.dispcnt: .word 0x04000000
.dispcntv: .word 0x00001F70    
.textboxv: .word 0x0202ECA8    
.textbox_pos: .word 0x04000012

FOR FR:

First of all, you need to paste this routine in some free space in your rom.
Code:
.align 2
.thumb

main:
    push {r0,r3}
    ldr r0, .var
    ldrh r0, [r0,#0x0]
    cmp r0, #0x0
    beq normal
    ldr r0,.dispcnt
    ldrh r3, .dispcntv
    strh r3,[r0]
    ldr r0, .textbox_pos
    mov r3, #0x5f
    strb r3,[r0]    
    pop {r0,r3}
    ldr r1, .black_box
    add r0,r0,r1
    pop {r1}
    bx r1
    
normal:
    ldr r0,.dispcnt
    ldrh r3, .dispcntvn
    strh r3,[r0]
    ldr r0, .textbox_pos
    mov r3, #0x0
    strb r3,[r0]
    pop {r0,r3}
    ldr r1, .normal_msgbox
    add r0,r0,r1
    pop {r1}
    bx r1
    

.align 2
.var: .word 0x020370c0 @var 0x8004
.dispcnt: .word 0x04000000    
.dispcntv: .word 0x00006161 
.dispcntvn: .word 0x00007f60   
.textbox_pos: .word 0x04000012
.normal_msgbox: .word 0x08471dec
.black_box: .word 0x089F3A10
Here compilated:
Code:
09 B4 0D 48 00 88 00 28 0A D0 0C 48 0C 4B 03 80 0D 48 5F 23 03 70 09 BC 0D 49 40 18 02 BC 08 47 06 48 08 4B 03 80 08 48 00 23 03 70 09 BC 07 49 40 18 02 BC 08 47 C0 46 C0 70 03 02 00 00 00 04 61 61 00 00 60 7F 00 00 12 00 00 04 EC 1D 47 08 XX XX XX 08
Then, you need to search for 32 bytes of free space, to copy this new colours of the textbox, and paste the offset in the above XX XX XX

Code:
2E 53 00 00 FF 7F 00 00 FF 7F FF 7F FF 7F FF 7F FF 7F FF 00 00 00 00 00 00 00 00 00 00 00 00 00
when you finish it, you need to edit the load_palettes_textbox routine, that is in the next offset: 08150448

When you are here, you need to paste this:
Code:
00 4F 38 47 XX XX XX 08
Where XX XX XX is the offset+1 where you paste the routine.

Finally, you need a simple script like that:
Code:
#org 0xoffset
setvar 0x8004 0x1 
msgbox 0x8offset
callstd 0x6
setvar 0x8004 0x0
callasm 0xyour_routine
end
As you can see, to determine what type of textbox you will load, we will use a setvar 0x8004. (0x1 for "thinkin events", and 0x0 to back normal..)
Also, if you know asm or are learing, this routine allow to you, edit and add new properties to the default textbox, for example semitransparents textboxes.

To end, i only need that if you have some bug, notific me.

Credits to eing if you use that.
 
Last edited:
Back
Top