scripts_n_asm
Thread Id: 29482
Thread Name: [ASM] Change Trainer Sprite of Trainer Card
#0
Andrea 25004
Hello guys, in this guide I will explain the change of the sprite in the trainer card in the rom of RUBY USA.
As we all know we can have 2 sprites:
Male & Female Player. Using the offset WBTO 02024EAC (overwriting 0 or 1) you can change the sex of the pg and the resulting sprite, unfortunately, are only two sprites mentioned before.
First, go to offset 080937E6 this byte to hijack the routine:
C0 46 00 48 00 47 XX+1 XX XX 08
XX XX XX 08 mean pointer of your routine +1 (THUMB MODE).
This is ASM ROUTINE i use:
.THUMB
.ALIGN 2
BL sub_8093DAC
PUSH {R0-R2}
LDR R2, = 0x0202E8C4@var 8000
LDRH R2, [R2]
LSL R2, #3
MOV R1, #0x31
LSL R1, #7
MOV R0, #3
LSL R0, #0x19
ADD R1, R0
LDR R0, = 0x081EC53C@table rom sprite trainer
ADD R0, R2
LDR R0, [R0]
SWI 0x12
LDR R0, = 0x081EC7D4@table rom sprite pal
ADD R0, R2
LDR R0, [R0]
LDR R1, = 0x0202EF68
SWI 0x12
LDR R1, = 0x0202EB68
SWI 0x12
POP {R0-R2}@pop registri
POP {R0}@torno alla routine principale
BX R0

sub_8093DAC:
LDR R0, = 0x08093DAD
BX R0

binary routine:
00 F0 17 F8 07 B4 0C 4A 12 88 D2 00 31 21 C9 01 03 20 40 06 09 18 09 48 80 18 00 68 12 DF 08 48 80 18 00 68 07 49 12 DF 07 49 12 DF 07 BC 01 BC 00 47 06 48 00 47 00 00 C4 E8 02 02 3C C5 1E 08 D4 C7 1E 08 68 EF 02 02 68 EB 02 02 AD 3D 09 08

Let me explain how work:
the routine save var 8000 value and mul it *8 because the table of trainer sprite and pal sprite are made with:
XX XX XX 08 YY YY YY YY
where the first four byte mean the pointer of image/pal and other 4 byte.
after i add offset of table to the previous result, i load 0x06001880 in R1 (start offset of trainer sprite)and i use SWI to decompress image.
when you load palette it's necessary to load pal in the direct pal in the ram and the pal of fadescreen to don't have flash of pal when you close TC menu (0x0202EF68, 0x0202EB68)
this is the script for change your sprite:
#dynamic 0x800000
#org @inizio
setvar 0x8000 0xNumber_Sprite
callasm 0xOffset routine +1
end

The total sprite in the rom are 52 (HEX). if you set var 8000 with value (greater than 52) and call routine you might have an error when you open the menu of trainer card ;)
This is the finale result :D

if you have problem write in the comment, hope you like it :D
#1
Soloo.EXE 27794
Buen aporte! Esto podria ser util si queremos insertar un retrato estilo foto carnet sin que el sprite de trainer del prota se vea afectado
#2
PabloGTD 18509
Thank you. It's really very interesting.
#3
xXMegaSrT!hera77/4315♪ Kuchiki~Xx 29048
Hum, es... un aporte xD

En fin, si, alguien puede sacarle utilidad pero... de verdad es necesario? Lo más dificil del rom hacking para muchos es el ASM... y usarlo para algo tan simple como esto, algo casi invalorable me parece un poco de exceso.

En fin, buen aporte! (pero pásalo por la traducción de monos de google translate la próxima vez ;))
#4
Javi4315♪ 13374
Iniciado por Tijeras77
Hum, es... un aporte xD

En fin, si, alguien puede sacarle utilidad pero... de verdad es necesario? Lo más dificil del rom hacking para muchos es el ASM... y usarlo para algo tan simple como esto, algo casi invalorable me parece un poco de exceso.

En fin, buen aporte! (pero pásalo por la traducción de monos de google translate la próxima vez ;))


Claro que es fácil hacerlo. Con la rutina. Porque si la rutina no existe, automáticamente se convierte en difícil de hacer. Pero ya que es tan fácil, te invito a que nos expliques cómo hacerlo. Sería un buen aporte para la comunidad.
-------------------------
Sobre el aporte, pues no es algo que dé demasiado juego, la verdad, pero siempre es útil tener estas cosas a mano por cualquier idea que se te pueda ocurrir ;D
#5
xXMegaSrT!hera77/4315♪ Kuchiki~Xx 29048
He dicho que es difícil hacerlo y que no lleva a ninguna parte, en ningún momento dije que fuese extremadamente fácil '¬¬
#6
Dani_SR_17 28493
Un aporte magnífico, será muy, muy útil en diversas ocasiones para los hacks. Además es muy sencilla usar la rutina.
#7
Injuxa 28226
Thank You ;)
This is a very good tutorial but is in english xD
It's very intresting, and i don't now before this hoe to do it, Thank you!
:D
#8
Andrea 25004
Iniciado por Soloo.EXE
Buen aporte! Esto podria ser util si queremos insertar un retrato estilo foto carnet sin que el sprite de trainer del prota se vea afectado

Yes, for example i you want change mini with routine of eing you change the TC sprite to have a new trainer (or costum if you want for example change clothes or dress rookie team rocket costume ^^)
Iniciado por PabloGTD
Thank you. It's really very interesting.

Thanks a lot :)
Iniciado por Dani_SR_17
Un aporte magnífico, será muy, muy útil en diversas ocasiones para los hacks. Además es muy sencilla usar la rutina.

Thanks :')
Iniciado por Tijeras77
He dicho que es difícil hacerlo y que no lleva a ninguna parte, en ningún momento dije que fuese extremadamente fácil

It is not necessary that uses my guide ^^ contribute, albeit with something as small as a guide, it is always (in my opinion) a benefit for users ^^
Iniciado por ThePokeManiaco
Thank You
This is a very good tutorial but is in english xD
It's very intresting, and i don't now before this hoe to do it, Thank you! :D

Google translate it's the way, thanks :)
#9
eing 12479
Hey bro!
Nice routine and if it's used with my/us routine of the change player will be greater haha.
Ok, we need to speak together about optimizate the routine of change pj,you know what i mean..
Turning to the thread, it only miss change the backsprite ^^

----
Hey tio, me alegro que hayas hecho esta rutina! Es muy buena si la juntas con la del cambio de minisprite que tengo/tenemos hechA! (Espero que sepas de lo que hablo..)
Aunque bueno, la hemos de mejorar, a ver si un dia nos ponemos hehe.
Volviendo al tema, la rutina como dije muy buena, ya solo falta cambiar el backsprite haha
#10
Tito Dafting301_4315♪ Kuchiki 24341
Hey, this is very interesting, i think i can apply this with some other ASM routines to customize the "avatar" (like redhair, blonde, brunette, black cap, white cap, etc.)

Thanks for the contribution!

----------------------------------------------------------------------------------

Hey, esto es muy interesante, creo que podría utilizar esto junto con otras rutinas ASM para personalizar el "avatar" (pelirrojo, rubio, castaño, gorra negra, gorra blanca, etc.)

Gracias por el aporte!
#11
Megascep_9 Kuchiki 28187
¡Andrea!, hace tiempo que no te veo por el foro.
Aún no he visto bien el tutorial, porque estoy desde
el celular, pero ya a simple vista es entendible.

Una duda, ¿funciona en FR?
#12
Tito Dafting301_4315♪ Kuchiki 24341
Iniciado por Megasceptile9
¡Andrea!, hace tiempo que no te veo por el foro.
Aún no he visto bien el tutorial, porque estoy desde
el celular, pero ya a simple vista es entendible.

Una duda, ¿funciona en FR?


Ha sido confeccionado en Ruby, pero sería cuestión de adaptar los punteros y tal.