jiangzhengwenjz 发表于 2016-4-18 13:31:06

80x80大头像

鉴于我是条懒虫,这次也懒得翻译了。。直接拿发在老外那里的东西好了。需要注意的是图片和色板都请用unlz压缩。仅限火红
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:
http://i869.photobucket.com/albums/ab256/jiangzhengwenjz/1636%20-%20Pokemon%20-%20Fire%20Red%20Version_zpsryxoq5ye.png

The most xxxxing 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!

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:
http://i.imgur.com/8Z0ppvU.pnghttp://i.imgur.com/5bRm9Vg.png
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 ...................
It can load up to 65536 images in algorithm, which means that it's enough.
6. Test time! use
setvar 0x8004
setvar 0x8005 // 0 = left, 1 = right
callasm 0x8
to launch the mugshot and
callasm 0x8 to delete it.

An example:
I insert the 2 images at 0xFA0000, 0xFA09CC and the 2 palettes at 0xFA09A4, 0xFA1484. Then the table should be:00 00 FA 08 A4 09 FA 08 CC 09 FA 08 84 14 FA 08The script://---------------
#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:
mugshot_make.asm/*
Note: both image and palette should be LZ77 compressed!
Table format: ..........
*/
.equiv table_location, 0x8900000
.thumb
push {r4-r5, lr}
sub sp, sp, #0x18
ldr r0, =0x20370C0
ldrh r0,
mov r1, #0
mov r2, #0x14
mul r2, r0
mov r3, #4
mov r0, #10
str r0,
str r0,
mov r0, #0xD
str r0,
mov r0, #0x40
str r0,
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,
ldr r4, =0x8003FA1
bl bx_r4
ldr r0, =0x20370C0
ldrh r0,
ldr r1, =table_location
lsl r0, r0, #3
add r0, r0, r1
ldr r5,
ldr 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 r4mugshot_del.asm.thumb
push {r4, lr}
ldr r4, =0x2039990
ldrb 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

海のLUGIA 发表于 2016-4-18 17:57:01

{:5_doge04:}80×80果然看起来够大…2333

jiangzhengwenjz 发表于 2016-4-18 18:15:42

海のLUGIA 发表于 2016-4-18 17:57
80×80果然看起来够大…2333

其实这也就是个例子233
我纠结了好久这个应该弄成什么尺寸的,或许扁平的或是竖直条状的会更好

关月 发表于 2016-4-20 17:31:12

很高端的样子 表示完全看不懂

星空之伤 发表于 2016-5-2 17:55:50

好大的说,个人觉得64*64够了的说,不过能做成扁平的话也许能表现更多动作?

sfsefsdfsd 发表于 2017-5-8 20:04:40

能不能弄成更大的
页: [1]
查看完整版本: 80x80大头像