Registrarse

[ASM] boy/girl elección de género fuera de la introducción de oak [ruby , fire red]

Shiny_Miner

Rocker Coder
original post
Hi good day
Many of you will have already read another post where I proposed this research. Well with the help of @eMMe97 ,@Bonnox we were able to complete the feat.
This guide will be valid for both FireRed and Ruby, using two different routines since the structure is completely different (I did the Ruby one because it was easier xD).

Let's put this routine into a script (any type of script will do, even a traversable or level script).

ATTENTION: it is necessary to use a warp to change the protagonist!
Red fire
.text
.align 2
.thumb
.thumb_func

.principal:
push {r0-r2, lr}
ldr r0, .PUNTERO
ldr r0, [r0]
suma r0, r0, # 0x8
ldr r1, .UNO
string r1, [r0, #0x0]
burst {r0-r2, pc}


.align 2
.POINTER:
.word 0x0300500C
.A:
.word 0x00000001 @if you want a male, replace it with zero
code for girl
Código:
07 B5 03 48 00 68 08 30 02 49 01 70 07 BD C0 46 0C 50 00 03 01 00 00 00
code for boy
Código:
07 B5 03 48 00 68 08 30 02 49 01 70 07 BD C0 46 0C 50 00 03 00 00 00 00

Ruby
.THUMB
.ALIGN2

EMPUJAR {R0-R1, LR}
LDR R0, .PLAYER_DATA
MOV R1, # 0x1 @if you wanted to boy, replace it with @0x0
STRB R1, [R0]
burst {R0-R1, PC}

. ALIGN 2
.PLAYER DATA: .word 0x02024EAC

code for girl
Código:
03 B5 02 48 01 21 01 70 03 BD C0 46 AC 4E 02 02
code for boy
Código:
03 B5 02 48 00 21 01 70 03 BD C0 46 AC 4E 02 02
To apply these routines, simply use the "callasm" command within the script itself, remembering to add 1 to the called offset (for example, if I insert the routine at offset 0x800000, the command will be callasm 0x800001).

Script to test
#define ASM_BOY 0x[ the offset compiled +1]
#define ASM_GIRL 0x[ the offset compiled +1]
#define WARP_NO [the gate]

#dynamic 0x800000
#org @start
lock
faceplayer
msgbox @choose 0x5
compare 0x800D 0x1
if 0x1 goto @boy
goto @girl


#org @boy
callasm ASM_BOY
warp 0x3 0x0 WARP_NO 0x0 0x0
release
end

#org @girl
callasm ASM_GIRL
warp 0x3 0x0 WARP_NO 0x0 0x0
release
end

#org @choose
= Choose 'Yes' for Boy and 'No' for girl.
Edit the #define at the start with the things said there

Frequently asked questions
D) What is this routine for?
A) It is used to choose the boy/girl out of the intro. In practice, if we apply the routine with the value 1, the character will be a woman, in the case of the routine with the value 0, the character will be a boy (in the already compiled routine I indicated the difference between the sexes).

P) Pero si ya he hecho la elección inicial y he elegido al macho, ¿a través de esta rutina puedo hacer que se convierta en hembra (o viceversa)?
R) Sí, aplicando estas rutinas es posible en cualquier momento, lugar y cuantas veces quieras intercambiar los protagonistas. Obviamente, será un intercambio completo, por lo que también se modificarán las tarjetas, etc.

P) ¿Cancelo todos los datos relacionados con el protagonista anterior al intercambiar el protagonista durante el juego?
R) ¡Absolutamente no! Las rutinas actúan ÚNICAMENTE sobre el género del personaje y todo lo que se deriva de él (por ejemplo, el comando checkgender se verá afectado por este cambio), no actúa de ninguna otra manera sobre la memoria (por ejemplo, pokémon en el equipo, entrenadores ya desafiado y otros progresos logrados en el juego no se verán afectados en lo más mínimo, a menos que haya una marca de verificación de género en algún script).

P) ¿Por qué las rutinas son tan diferentes entre sí?
A) En el caso de FireRed los datos relativos al protagonista son "dinámicos", es decir, en cada warp se cambian de posición. Bonnox tuvo que recurrir a una rutina que analizaba los datos del puntero dinámico de los datos del protagonista.
En el caso de Ruby, en cambio, el offset es "estático", así que bastó con cambiar solo el byte relativo al género (por eso muy bien pude hacer la rutina también xD).

P) Pero si utilizo un wbto, ¿podría obtener el mismo resultado?
R) En el caso de FireRed absolutamente no, el desplazamiento es dinámico, por lo que no se puede usar en absoluto.
En el caso de Ruby, en cambio, sí se puede utilizar en lugar de la rutina (aunque en mi opinión el método de la rutina es más rápido y seguro).


R) Hasta que explote el juego xD No hay número máximo, tienes total libertad Wink

D) ¿Qué aplicaciones tiene esta rutina?
A) Las aplicaciones son de las más variadas, ¡da rienda suelta a tu imaginación! Próximamente les presentaré una guía para el cambio completo de la intro, la usaré para tal fin.

P) Tengo una rutina más corta que funciona, ¿puedo publicarla?
A) No need to ask... DO IT! cap man

Thank you all for your attention!
In case you have used the routine, I recommend that you give credit to Bonnox.

credits to eMMe97, bonnox, mi for script

Screenshots and video
a secret hack for pirates removing Oak's introduction as
use callasm 0x9fc91 to call the player name screen.[/SPOILER]
 
Última edición:
Arriba