Registrarse

FR | [Finalized] 80x80 mugshots [Source Code Available]

jiangzhengwenjz

Profesional de WaH
Intro:

In Ruby, many hackers uses the BG0 to make mugshots. However, the same way that simply writing tileset, tilemap and palette to the RAM won't work for FR & EM as it will be cleared by the MSGBOX.

However, there's still a way to do it, which requires the knowledge of "rboxes". I've figured out some simple usage of the related functions, so I will show you my work:


The most fucking thing should be that only 1 BG palette for FR can be used, which is the palette for the money box (the box with thinner border). Therefore, it will only be able to launch 1 mugshot at a time and you can't use it with the money box!

[caja=]How to use:
The routines are provided at the bottom.
1. Change 0x8900000 in mugshot_make.asm to free space, which is ended in 0,4,8,c. It will be the location of our custom table.
2. Compile the 2 routines and insert them to some free space (Not the table location in step 1)
3. Get/draw some 80x80 mugshots, here's 2 examples:

They should be indexed to 16 colors.
4. Open your UNLZ-GBA and insert your images and palettes.
Note: the image and the palette should all be LZ77 compressed, which means that you should insert them by using "export image" and "export palette" in UNLZ-GBA. Aparrently they should all be inserted at some free space.
5. Build the table at the offset in step 1, whose format should be [image0 pointer][image0 pal pointer][image1 pointer][image1 pal pointer][image2 pointer][image2 pal pointer]...................
It can load up to 65536 images in algorithm, which means that it's enough.
6. Test time! use
setvar 0x8004 [image index in the table]
setvar 0x8005 [0 or 1] // 0 = left, 1 = right
callasm 0x8[mugshot_make.asm+1]
to launch the mugshot and
callasm 0x8[mugshot_del.asm+1] to delete it.
[/caja]

An example:
I insert the 2 images at 0xFA0000, 0xFA09CC and the 2 palettes at 0xFA09A4, 0xFA1484. Then the table should be:
Código:
00 00 FA 08 A4 09 FA 08 CC 09 FA 08 84 14 FA 08
The script:
Código:
//---------------
#org 0xF00000
lock
setvar 0x8004 0x0 //image0
setvar 0x8005 0x1 //right side
callasm 0x8800001 //mugshot_make.asm+1
msgbox 0x8F00030 0x6
callasm 0x8800089 //mugshot_del.asm+1
release
end

#org 0xF00030
= ABCD.
The routines:
Código:
/*
Note: both image and palette should be LZ77 compressed!
Table format: [image pointer][pal pointer]..........
*/
.equiv table_location, 0x8900000
.thumb
push {r4-r5, lr}
sub sp, sp, #0x18
ldr r0, =0x20370C0
ldrh r0, [r0, #2]
mov r1, #0
mov r2, #0x14
mul r2, r0
mov r3, #4
mov r0, #10
str r0, [sp]
str r0, [sp, #4]
mov r0, #0xD
str r0, [sp, #8]
mov r0, #0x40
str r0, [sp, #0xC]
add r0, sp, #0x10
ldr r4, =0x810FE51
bl bx_r4
add r0, sp, #0x10
ldr r4, =0x8003CE5
bl bx_r4
ldr r4, =0x2039990
strb r0, [r4]
ldr r4, =0x8003FA1
bl bx_r4
ldr r0, =0x20370C0
ldrh r0, [r0]
ldr r1, =table_location
lsl r0, r0, #3
add r0, r0, r1
ldr r5, [r0, #4]
ldr r0, [r0]
ldr r1, =0x6008800
swi 0x12
mov r0, r5
mov r1, #0xd0
mov r2, #0x20
ldr r4, =0x80703A9
bl bx_r4
mov r0, #0
ldr r4, =0x80020BD
bl bx_r4
add sp, sp, #0x18
pop {r4-r5, pc}

bx_r4: bx r4

Código:
.thumb
push {r4, lr}
ldr r4, =0x2039990
ldrb r4, [r4]
mov r1, #0
mov r0, r4
ldr r3, =0x810F4D9
bl bx_r3
mov r0, r4
mov r1, #2
ldr r3, =0x8003F21
bl bx_r3
mov r0, r4
ldr r3, =0x8003E3D
bl bx_r3
pop {r4, pc}

bx_r3: bx r3
 
Última edición:

Naren Jr.

Puto amo
Usuario de Platino
Esta genial!! aunque realmente ojala sea posible cargar en ambas posiciones los mugshot, quizás realmente lo use para cargar algunas cosillas e.e

Saludos!
 

Dr._Seuss

Average RomHacker
Es impresionante que se puedan poner mugshots asì de grandes, aunque para mi persona 64x64 es màs que suficiente, gracias por compartirlo, quizàs lo use.
(Sorry, my english is bad and is more easy to me write in espanish)
 

Dani_SR_17

¡Pokémon LionHeart!
Un gran aporte sin duda para al que le guste poner mugs en su hacks, personalmente no es algo que vaya a usar en principio, pero sin duda un gran aporte.

Con un poco de ingenio seguro que se puede usar para muchas cosas.
 

jiangzhengwenjz

Profesional de WaH
Re: Respuesta: FR | [Finalized] 80x80 mugshots [Source Code Available]

Esta genial!! aunque realmente ojala sea posible cargar en ambas posiciones los mugshot, quizás realmente lo use para cargar algunas cosillas e.e

Saludos!
That's limited by the system in FR, as in EM and RUBY it's not the case. In those 2 versions 2 palettes are available.
Un gran aporte sin duda para al que le guste poner mugs en su hacks, personalmente no es algo que vaya a usar en principio, pero sin duda un gran aporte.

Con un poco de ingenio seguro que se puede usar para muchas cosas.
Basically it can be used to show some pictures, I myself won't use this mugshot system lol
Es impresionante que se puedan poner mugshots asì de grandes, aunque para mi persona 64x64 es màs que suficiente, gracias por compartirlo, quizàs lo use.
(Sorry, my english is bad and is more easy to me write in espanish)
Yes, actually 64x64 is too big as well. This one is meant to show you how to display a picture by using rboxes.
 

BluRose

chiste, chiste
I seem to remember a few people at PokéCommunity saying that this couldn't be done in any sort of dimension larger than 64x64.
I see they were wrong? Congrats!
 

jiangzhengwenjz

Profesional de WaH
Re: Respuesta: FR | [Finalized] 80x80 mugshots [Source Code Available]

I seem to remember a few people at PokéCommunity saying that this couldn't be done in any sort of dimension larger than 64x64.
I see they were wrong? Congrats!
Haha, most people use the OBJs to launch mugshots. They don't know how to use the "rboxes".
 

Derlo

Héroe de WaH
There would be the possibility to put the sprites of the Pokemon in 80x80?
In the battle for example?
 

jiangzhengwenjz

Profesional de WaH
Re: Respuesta: Re: Respuesta: FR | [Finalized] 80x80 mugshots [Source Code Available]

it is a pity!
Thanks for the reply ... and another question .. hehehe
Is there any way to animate these sprites with at least 3 frames?
For OBJs, it uses a set of 'animation tables' in its template. You can define frames there.
For BG pictures, you can just launch a task (the IRAM function queue) and keeps rendering it via built-in functions or directly writing new frames into VRAM.
 

CompuMax

Discord: CompuMax#0425
Respuesta: Re: Respuesta: FR | [Finalized] 80x80 mugshots [Source Code Available]

You can even make it bigger as long as it's a rectangle, like 112x80 haha, but that really looks bad.
Can I upload images of 112x80 without changing the routine? Really I it need of 112x64. And how do I modify the X and Y coordinates? I need them more to the center and higher.

:D
 
Última edición:

jiangzhengwenjz

Profesional de WaH
Re: Respuesta: Re: Respuesta: FR | [Finalized] 80x80 mugshots [Source Code Available]

Can I upload images of 112x80 without changing the routine? Really I it need of 112x64. And how do I modify the X and Y coordinates? I need them more to the center and higher.

:D
Change mugshot_make.asm to this routine:
(Change x_coordinate, y_coordinate, width, height to your custom value)
(Still get the image pointer and palette pointer from your table)
Código:
.thumb
push {r4-r5, lr}
sub sp, sp, #0x18
mov r1, #0
mov r2, #[x_coordinate/8]
mov r3, #[y_coordinate/8]
mov r0, #[width/8]
str r0, [sp]
mov r0, #[height/8]
str r0, [sp, #4]
mov r0, #0xD
str r0, [sp, #8]
mov r0, #0x40
str r0, [sp, #0xC]
add r0, sp, #0x10
ldr r4, =0x810FE51
bl bx_r4
add r0, sp, #0x10
ldr r4, =0x8003CE5
bl bx_r4
ldr r4, =0x2039990
strb r0, [r4]
ldr r4, =0x8003FA1
bl bx_r4
ldr r0, =0x20370C0
ldrh r0, [r0]
ldr r1, =table_location
lsl r0, r0, #3
add r0, r0, r1
ldr r5, [r0, #4]
ldr r0, [r0]
ldr r1, =0x6008800
swi 0x12
mov r0, r5
mov r1, #0xd0
mov r2, #0x20
ldr r4, =0x80703A9
bl bx_r4
mov r0, #0
ldr r4, =0x80020BD
bl bx_r4
add sp, sp, #0x18
pop {r4-r5, pc}

bx_r4: bx r4
 

CompuMax

Discord: CompuMax#0425
Change mugshot_make.asm to this routine:
(Change x_coordinate, y_coordinate, width, height to your custom value)
(Still get the image pointer and palette pointer from your table)
Wow! It works perfectly @jiangzhengwenjz. Too bad that when is loaded the Vs. Bar, it covers the Mughshot.


But hey, I sure use it for something else.

:D
 
Última edición:
Arriba