Registrarse

[Gráficos] [ASM] Poner más signos de exclamación.

Invert

why so serious?


Bien, esto es algo que siempre quice hacer en mi hack, ahora lo comparto con ustedes.

Primero lo primero, he aquí la rutina.

Código:
00 B5 06 48 00 78 06 49 04 22 50 43 09 18 08 68 00 21 00 22 00 F0 00 F8 02 4A 10 47 BA 70 03 02 xx xx xx 08 4D 25 08 08
Donde en xx xx xx va la tabla de los datos que veremos acontinuación.

Ahora, deberémos poner en 82544 los siguientes bytes:

Código:
00 4A 10 47 xx xx xx 08
Los xx xx xx es donde pones tu rutina +1

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

Ahora, pasaré a explicar los datos que lee la rom, ya que tal vez haya alguna confusion llamemos a estos datos "los datos principales, en donde están los offsets que preparan las imagenes.
Nosotros deberémos poner el offset de donde pones los datos principales en la tabla. Así por supuesto deben poner primero los datos del juego porque si nó se perderán las imagenes originales.
Dichos datos se encuentran en 3C7388.
Código:
FF FF FF FF A4 72 3C 08 74 73 3C 08 AC 72 3C 08 FC 1C 23 08 A9 26 08 08
Cada offset hace algo en especifico, a nosotros solo nos interesa el AC 72 3C 08.
Es el lugar donde se guardan los datos de la imagen.

Entonces, para ser mas claro.
Cambias el AC 72 3C 08 por los datos de tu tabla de imagenes.
Entonces, digamos que mi tabla de imagenes está en 800000,nos quedaría así:

Código:
FF FF FF FF A4 72 3C 08 74 73 3C 08 00 00 80 08 FC 1C 23 08 A9 26 08 08
Así quedarían los datos principales.

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

Ya con esto finalizado, venímos a insertar las imagenes.

Para ello, descarga esta imagen:


Basicamente lo que estamos haciendo es editando la imagen original, eso significa que la forma o el orden en como cargas las imagenes no cambiará.
Cuando termines de editar tu imagen ve a insertarla con la condicion de que NO DEBE SER COMPRIMIDA.
Así ya tenemos nuestra imagen insertada.

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

Y el último paso:

Código:
C8 6A 3C 08 80 00 00 00 48 6B 3C 08 80 00 00 00 C8 6B 3C 08 80 00 00 00 C8 6D 3C 08 80 00 00 00 48 6E 3C 08 80 00 00 00 C8 6E 3C 08 80 00 00 00 48 6C 3C 08 80 00 00 00 C8 6C 3C 08 80 00 00 00 48 6D 3C 08 80 00 00 00 48 6F 3C 08 80 00 00 00 C8 6F 3C 08 80 00 00 00 48 70 3C 08 80 00 00 00 C8 70 3C 08 80 00 00 00 48 71 3C 08 80 00 00 00 C8 71 3C 08 80 00 00 00 00 00
¿Qué es eso?
Bien, habíamos hablado de AC 72 3C 08 que era donde se guardaban los datos de las imagenes.
Pues por cada plancha que insertes tendrás que insertar estos datos.

Ahora, cada exclamacion muestra 3 imagenes para su animacion correspondiente.
Por lo que, la primera exclamación tendrá los offsets C8 6A 3C 08, 48 6B 3C 08, C8 6B 3C 08.
Nosotros lo único que debemos hacer es cambiar esos 3 offsets que están ahí, ¿pero cómo?
Fácil, supongamos que inserté mi plancha en el offset 900000
Ya que es la primera exclamación, ese sería el primer offset que cambiaré, 900000 por C8 6A 3C 08.
Cada imagen tiene un tamaño de 80 bytes, por lo que pasarémos a sumar 900000 + 80 en Hex, eso nos da 900080.
Así tendríamos que cambiar ese 900080 por 48 6B 3C 08, y así lo haces con la siguiente.
Así nos quedarían los datos de la tabla de imagenes con la primera exclamación cambiada:

Código:
00 00 90 08 80 00 00 00 80 00 90 08 80 00 00 00 00 01 90 08 80 00 00 00 C8 6D 3C 08 80 00 00 00 48 6E 3C 08 80 00 00 00 C8 6E 3C 08 80 00 00 00 48 6C 3C 08 80 00 00 00 C8 6C 3C 08 80 00 00 00 48 6D 3C 08 80 00 00 00 48 6F 3C 08 80 00 00 00 C8 6F 3C 08 80 00 00 00 48 70 3C 08 80 00 00 00 C8 70 3C 08 80 00 00 00 48 71 3C 08 80 00 00 00 C8 71 3C 08 80 00 00 00 00 00
¡Y listo!

Una cosa, para que se mantengan los datos originales como ya lo dije, es recomendable que pongas la tabla de los datos principales al principio en tu tabla para que se mantengan las imagenes originales.

¿Cómo funciona la rutina?

Código:
setvar 0x8001 0x#numero de plancha
applymovement 0x
Ya que la primer plancha será la del juego, al final puedes poner setvar 0x8001 0x0 para que vuelva a leerla.



 

Kaktus

Miembro insignia
Miembro insignia
¡Coño! Llevaba ya cierto tiempo pensando en tratar de hacer una investigación yo mismo sobre esto, solo que el tiempo no me lo permitía. Así que... Te he de dar las gracias mi querido compañero @Invert por hacer este tutorial, ya mismo voy a aplicarlo *^*
 

Gold

Porrero a tiempo parcial
Miembro insignia
Nunca me puse a pensar en dichas exclamaciones, creí que eran como en GBC que solo era cuestión de repuntear la imagen y ya ponías cuantas se te pegaran la gana, Siempre gracias por el aporte.

PD: Sigo sin creer que alguien como tu que hace años consideré noob hiciera aportes más importantes a la comunidad que yo c:
 

RedMort

Aprendiendo Decomp
Esto es otra de las cosas que siempre se busca, pero por falta de informacion acaba por dejarse.
Gran trabajo, y gran aporte, mi yo del futuro te lo agradecerá seguro ^^
 

jiangzhengwenjz

Usuario mítico
Poner más signos de exclamación.
Well, your way is simple and straight. However it's a bit troublesome to define many templates for different pictures and use setvar. Therefore, why not add new movement bytes for this? (Actually I've tried before long, so I just post it)
We should handle some tables:
1) 81D96AC_oe_table: this is a table containing pointers to oe_scripts, so that we just repoint it and add new entries to it. To create something like exclaimation marks, we will only use 2 commands: 03(callasm) & 04(end). Therefore, the new entry pointer
Código:
JJ JJ JJ 08
should point to something like this:
Código:
8JJJJJJ - 03 [XX+1 XX XX 08] 04
At 0xXXXXXX we just place a function:
Código:
.thumb
push {r4, lr} @we will use r4 for we use it to generate OBJ
ldr r0, =0x83C7388 @as you know, the template lol
mov r1, #0
mov r2, #0
mov r3, #0x53
ldr r4, =0x8006FE1 @this function is for reverse search xD
bl bx_r4
lsl r0, r0, #0x18
lsr r1, r0, #0x18
cmp r1, #0x40
beq back
lsl r0, r1, #4
add r0, r0, r1
lsl r0, r0, #2
ldr r1, =0x202063C
add r0, r0, r1
mov r1, #0x46 @not confirmed, but i think we can just use 0x46, 0x47, .... and on to keep it the same as the table entry index number
mov r2, #5 @the image number (0-indexed), so we can use 5, 6, 7, ... and on to fit your graphic
ldr r4, =0x808265D @to trigger the animation
bl bx_r4
back:
mov r0, #0
pop {r4, pc}
bx_r4: bx r4
2)Another table is located at 0x83A65BC (an_table). The index to read the table is the same as the byte used in movements (for exclamations, 62, 63, 64, 65, 66 in hex) So we should repoint this table and add new entry to it. As I don't have much time to research it, I just follow the original ones to hit the target.
Código:
new entry - ZZ ZZ ZZ 08
(The new index should be 0xAA, 0xAB, .....)
At ZZZZZZ:
Código:
[YY+1 YY YY 08] 31 79 06 08
At YYYYYY:
Código:
.thumb
push {r4, r5, lr}
add r4, r1, #0
ldr r1, =0x20386E0
add r2, r1, #4
mov r3, r1
add r3, #8
ldr r5, =0x805F365
bl bx_r5
mov r0, #0x46 @the same as the unconfirmed number (we use index) in the above part
ldr r5, =0x8083445
bl bx_r5
mov r0, #1
strh r0, [r4, #0x32]
pop {r4, r5, pc}
bx_r5: bx r5
3)repoint & expand the gfx_table at 0x83C72AC. format: [graphic pointer][80 00 00 00(size)]
4)repoint & expand the animation_table at 0x83C7374. format: [a series of pointers] [FF FF FF FF(end)] points to: [frame(hword)][duration(hword)]......[FF FF 00 00(end), some guys may change it to FE FF 00 00 for fun xD]
5)finally a script to see the result:
Código:
#org @script
lock
applymovement 0xFF @move
waitmovement 0
release
end

#org @move
#raw byte 0xAA 0xFE //here 0xAA is your new movement byte
Final notes:
1) I've tried it and it worked fine lol
Here is a patch for FR in case you need it CLICK
To test it yourself just talk to the fat guy outside oak's lab in pallet town. (I change FF FF 00 00 to FE FF 00 00 so that the animation will loop)
2) Although I've not tried it, I think you can define other kind of functions to exceed some more movements by imitating the original functions xD
3) Warning: things above are just some notes from long ago, so idk if it will cause any bugs 'cuz I don't have much time to make more research on it.
 
Última edición:

Invert

why so serious?
Respuesta: Re: [ASM] Poner más signos de exclamación.

lol @jiangzhengwenjz

Very nice, so you'll need a sheet exclamations most long.

here:
mov r1, #0x46
46 in dec is 70, 70 is the raw number that you use in the applymovement.
I think xD
¿How do you control the raw number?
 

jiangzhengwenjz

Usuario mítico
Re: Respuesta: Re: [ASM] Poner más signos de exclamación.

here:
mov r1, #0x46
46 in dec is 70, 70 is the raw number that you use in the applymovement.
I think xD
In the table at 0x1D96AC there exist 0x46 oe_scripts(0x0~0x45), so the index of new one should be 0x46. IIRR, it is copied to some place in data structure <npc_state> and I really don't know what it's for.

¿How do you control the raw number?
Well, the reason why I use 0xAA is that the table at 0x3A65BC contains 0xAA(0x0~0xA9) pointers, so the index number of the new entry should be 0xAA. I think this table is for the movement "#raw"s.
 

Nachoius

Caminante del cielo
alguien ha probado esta rutina? porque la verdad no me está funcionando, tengo mis dudas, cuando dice

"Ahora, deberémos poner en 82544 los siguientes bytes: " ¿no será 8254D ? Lo digo porque en la rutina sale esa dirección pero no la otra. En cualquier caso tampoco me termina de funcionar.
 

Versekr Dark

Usuario mítico
alguien ha probado esta rutina? porque la verdad no me está funcionando, tengo mis dudas, cuando dice

"Ahora, deberémos poner en 82544 los siguientes bytes: " ¿no será 8254D ? Lo digo porque en la rutina sale esa dirección pero no la otra. En cualquier caso tampoco me termina de funcionar.

Por que no usas el post de la web italiana, creo que hasta las imagenes te da.
 
Arriba