• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: Animating the FireRed titlescreen.

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Ahhhm... sorry for being noob in my question, but I dont really get it.....


How can I make the titlescreen moves?

If you scroll up in this page (page 2) you should find karatekid's post which has the ASM needed to do it. From there you just adjust the ASM accordingly, compile, and insert.
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017
For anyone who is interested in this hack, I've corrected Karatekid's source code and I've decided to publish it here.
The branch:
Code:
0x78BFC - 07 49 08 47 08 BC
0x78C1C - XX XX XX 08 //Pointer to the following code, (+1)
The routine itself:
Code:
.thumb
Start:
        push {r0-r3}
        ldr r3, .RAM_Address
        ldr r1, .Ani_Table
        ldrb r2, [r3, #0x1]
        lsl r2, #0x3
        add r1, r2
        ldrb r0, [r1, #0x4]
        ldrb r2, [r3]
        cmp r2, r0
        bge LoadFrame
        add r2, #0x1
        strb r2, [r3]
        b Finish
LoadFrame:
        mov r2, #0x0
        strb r2, [r3]
        ldrb r2, [r1, #0x5]
        strb r2, [r3, #0x1]
        ldr r0, [r1]
        ldr r1, .VRAM_Animated_Image
        swi #0x12

Finish:
        pop {r0-r3}
ExitRightNow:
        ldr r1, [r0]
        ldr r0, .Frame_Count
        push {r3}
        ldr r3, .Old_Routine
        bx r3

.align 2
.Ani_Table:
        .word 0x08YYYYYY @animation table offset
.RAM_Address:
        .word 0x020370c0
.VRAM_Animated_Image:
        .word 0x06004000
.Frame_Count:
        .word 0x0000FFFF
.Old_Routine:
        .word 0x08078C01
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
For anyone who is interested in this hack, I've corrected Karatekid's source code and I've decided to publish it here.
The branch:
Code:
0x78BFC - 07 49 08 47 08 BC
0x78C1C - XX XX XX 08 //Pointer to the following code, (+1)
The routine itself:
Code:
.thumb
Start:
        push {r0-r3}
        ldr r3, .RAM_Address
        ldr r1, .Ani_Table
        ldrb r2, [r3, #0x1]
        lsl r2, #0x3
        add r1, r2
        ldrb r0, [r1, #0x4]
        ldrb r2, [r3]
        cmp r2, r0
        bge LoadFrame
        add r2, #0x1
        strb r2, [r3]
        b Finish
LoadFrame:
        mov r2, #0x0
        strb r2, [r3]
        ldrb r2, [r1, #0x5]
        strb r2, [r3, #0x1]
        ldr r0, [r1]
        ldr r1, .VRAM_Animated_Image
        swi #0x12

Finish:
        pop {r0-r3}
ExitRightNow:
        ldr r1, [r0]
        ldr r0, .Frame_Count
        push {r3}
        ldr r3, .Old_Routine
        bx r3

.align 2
.Ani_Table:
        .word 0x08YYYYYY @animation table offset
.RAM_Address:
        .word 0x020370c0
.VRAM_Animated_Image:
        .word 0x06004000
.Frame_Count:
        .word 0x0000FFFF
.Old_Routine:
        .word 0x08078C01
Questioooon~! ^U^ If I use this, would I still use any of the stuff from karatekid552's post?
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017
Questioooon~! ^U^ If I use this, would I still use any of the stuff from karatekid552's post?

Yes, basically you should build a table for tileset and replace pointers and palette as mentioned in Karatekid's post.
I've tested it, and everything run perfectly.
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
Yes, basically you should build a table for tileset and replace pointers and palette as mentioned in Karatekid's post.
I've tested it, and everything run perfectly.

Ooops. Sorry, I meant these. If I would need any of them.

Code:
.text
.align 2
.thumb

/*This goes at 78BF8*/
Branch:
        ldr r1, .New_Routine
        bx r1
        pop {r3}

.align 2
.New_Routine:
        .word 0x08XXXXXX + 1
XXXXXX is the location you put this at:

Code:
.text
.align 2
.thumb

Start:
        push {r0-r3}
        ldr r3, .RAM_Address
        ldr r1, .Ani_Table
        ldrb r2, [r3, #0x1]
        lsl r2, #0x3
        add r1, r2
        ldrb r0, [r1, #0x4]
        ldrb r2, [r3]
        cmp r2, r0
        bge LoadFrame
        add r2, #0x1
        strb r2, [r3]

        b PressStart
LoadFrame:
        mov r2, #0x0
        strb r2, [r3]
        ldrb r2, [r1, #0x5]
        strb r2, [r3, #0x1]
        ldr r0, [r1]
        ldr r1, .VRAM_Animated_Image
        swi #0x12

PressStart:
        ldrb r2, [r3, #0x2]
        add r2, #1
        strb r2, [r3, #0x2]
        cmp r2, #0x10
        ble Finish
        mov r2, #0
        strb r2, [r3, #0x2]
FlashOn:
        ldrb r2, [r3, #0x3]
        cmp r2, #0
        bne FlashOff
        ldr r0, .Start_Image
        ldr r1, .VRAM_Start
        swi #0x12
        mov r2, #1
        strb r2, [r3, #0x3]
        b Finish
FlashOff:
        ldr r0, .Blank
        ldr r1, .VRAM_Start
        ldr r2, .CPUSET
        swi #0xB
        mov r2, #0
        strb r2, [r3, #0x3]

Finish:
        pop {r0-r3}
ExitRightNow:
        ldr r1, [r0]
        ldr r0, .Frame_Count
        push {r3}
        ldr r3, .Old_Routine
        bx r3

.align 2
.Ani_Table:
        .word 0x08YYYYYY
.RAM_Address:
        .word 0x020370c0
.VRAM_Animated_Image:
        .word 0x06004000
.VRAM_Start:
        .word 0x06001D40
.Frame_Count:
        .word 0x0000FFFF
.Start_Image: /*An image of the press start, 256 color*/
        .word 0x08BAA550
.Blank: /*An blank (completely transparent) image the same size as the press start, 256 color*/
        .word 0x08BAA688
.Old_Routine:
        .word 0x08078C01
.CPUSET:
        .word 0x05000300
Code:
.text
.align 2
.thumb

Start:
        push {r0-r3}
        ldr r3, .RAM_Address
        ldr r1, .Ani_Table
        ldrb r2, [r3, #0x1]
        lsl r2, #0x3
        add r1, r2
        ldrb r0, [r1, #0x4]
        ldrb r2, [r3]
        cmp r2, r0
        bge LoadFrame
        add r2, #0x1
        strb r2, [r3]

        b PressStart
LoadFrame:
        mov r2, #0x0
        strb r2, [r3]
        ldrb r2, [r1, #0x5]
        strb r2, [r3, #0x1]
        ldr r0, [r1]
        ldr r1, .VRAM_Animated_Image
        swi #0x12

Finish:
        pop {r0-r3}
ExitRightNow:
        ldr r1, [r0]
        ldr r0, .Frame_Count
        push {r3}
        ldr r3, .Old_Routine
        bx r3

.align 2
.Ani_Table:
        .word 0x08YYYYYY
.RAM_Address:
        .word 0x020370c0
.VRAM_Animated_Image:
        .word 0x06004000
.Frame_Count:
        .word 0x0000FFFF
.Old_Routine:
        .word 0x08078C01
.CPUSET:
        .word 0x05000300
 
94
Posts
10
Years
  • Seen Sep 18, 2023
I really want to do this on my hack, but really would need a tutorial!

I don't get what I have to do.
I know, I have to compile + insert the ASM Routines, but how/where do I have to inject the single pictures for the animation?
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017
I really want to do this on my hack, but really would need a tutorial!

I don't get what I have to do.
I know, I have to compile + insert the ASM Routines, but how/where do I have to inject the single pictures for the animation?

Follow my post and you will find that it requires a table, which is partially composed of image pointers. (You can follow Karatekid552's reply to get the accurate structure of the table)
 
94
Posts
10
Years
  • Seen Sep 18, 2023
So if I insert picture one at 0x800000 und picture two at 0x800020
The Table has to look like 00 00 80 08 (first image) 0 (the pause leng) 20 00 80 08 (second image) and repeat this? Or is this wrong?
 
Last edited:

Deokishisu

Mr. Magius
989
Posts
18
Years
So if I insert picture one at 0x800000 und picture two at 0x800020
The Table has to look like 00 00 80 08 (first image) 0 (the pause leng) 20 00 80 08 (second image) and repeat this? Or is this wrong?

I hope that these are just really bad example offsets, because there's no way your pictures are only 20 bytes long. You should search for freespace, insert your first picture, and then search for freespace again, insert the second image, etc.

Word [Pointer to Image]; Byte [Pause Length]; Byte [Next Frame]

This is the format the table should be in. I haven't done this myself, but I would assume that the third on is the pointer to the next image in the sequence. Other than your example offsets, it seems like everything should be working. Are all of your images using the same .RAW? Are you (not) compressing the images when you should(n't) be? You're being so vague that no one can really help you.

EDIT: Wait, after rereading the format (had a bit of a reading comprehension fail) the third field is a byte and not a word. In this case, I think your table would be 00 00 80 08 (first image) 00 (the pause length) 01 (the next frame), 20 00 80 08 (second image) 00 (pause length) 02 (the next frame), etc. It seems you can populate the table and skip frames if you want, which is a weird way to structure it, imo. Why not just chop off the third field and have the table in order?
 
Last edited:
94
Posts
10
Years
  • Seen Sep 18, 2023
Yes, it just where examples. I haven't inserted anything yet, I just said some random offsets to see how they have to be.
And thanks for the answer. It's a loz clearer for me now! I will try it later!
 

Blah

Free supporter
1,924
Posts
11
Years
I hope that these are just really bad example offsets, because there's no way your pictures are only 20 bytes long. You should search for freespace, insert your first picture, and then search for freespace again, insert the second image, etc.



This is the format the table should be in. I haven't done this myself, but I would assume that the third on is the pointer to the next image in the sequence. Other than your example offsets, it seems like everything should be working. Are all of your images using the same .RAW? Are you (not) compressing the images when you should(n't) be? You're being so vague that no one can really help you.

EDIT: Wait, after rereading the format (had a bit of a reading comprehension fail) the third field is a byte and not a word. In this case, I think your table would be 00 00 80 08 (first image) 00 (the pause length) 01 (the next frame), 20 00 80 08 (second image) 00 (pause length) 02 (the next frame), etc. It seems you can populate the table and skip frames if you want, which is a weird way to structure it, imo. Why not just chop off the third field and have the table in order?

Well, to clarify, this is animating an OAM, so there is no .raw file. As for the merit for the third field, it is so the last field (or other fields) can jump to a frame which isn't in the original frames for the first iteration, later moving on the the original frames. While you can make a linear table, you'd make it much larger than it has to be by not having the third field.
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017
Well, to clarify, this is animating an OAM, so there is no .raw file. As for the merit for the third field, it is so the last field (or other fields) can jump to a frame which isn't in the original frames for the first iteration, later moving on the the original frames. While you can make a linear table, you'd make it much larger than it has to be by not having the third field.

No, he uses BG to do the animation:)
 
94
Posts
10
Years
  • Seen Sep 18, 2023
Follow my post and you will find that it requires a table, which is partially composed of image pointers. (You can follow Karatekid552's reply to get the accurate structure of the table)

I tried to compile the routine, but the compiler says :
animation.asm:23 : Error: Bad expression
animation.asm:23 : Error: Garbage following instruction

and no output file is created!
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017
I tried to compile the routine, but the compiler says :
animation.asm:23 : Error: Bad expression
animation.asm:23 : Error: Garbage following instruction

and no output file is created!

idk what you meant. Could you post the routine you tried to compile?
 
94
Posts
10
Years
  • Seen Sep 18, 2023
idk what you meant. Could you post the routine you tried to compile?
.thumb
Start:
push {r0-r3}
ldr r3, .RAM_Address
ldr r1, .Ani_Table
ldrb r2, [r3, #0x1]
lsl r2, #0x3
add r1, r2
ldrb r0, [r1, #0x4]
ldrb r2, [r3]
cmp r2, r0
bge LoadFrame
add r2, #0x1
strb r2, [r3]
b Finish
LoadFrame:
mov r2, #0x0
strb r2, [r3]
ldrb r2, [r1, #0x5]
strb r2, [r3, #0x1]
ldr r0, [r1]
ldr r1, .VRAM_Animated_Image
swi #0x12

Finish:
pop {r0-r3}
ExitRightNow:
ldr r1, [r0]
ldr r0, .Frame_Count
push {r3}
ldr r3, .Old_Routine
bx r3

.align 2
.Ani_Table:
.word 0x08YYYYYY @animation table offset
.RAM_Address:
.word 0x020370c0
.VRAM_Animated_Image:
.word 0x06004000
.Frame_Count:
.word 0x0000FFFF
.Old_Routine:
.word 0x08078C01
 
58
Posts
8
Years
  • Age 31
  • Seen Jan 7, 2017
.thumb
Start:
push {r0-r3}
ldr r3, .RAM_Address
ldr r1, .Ani_Table
ldrb r2, [r3, #0x1]
lsl r2, #0x3
add r1, r2
ldrb r0, [r1, #0x4]
ldrb r2, [r3]
cmp r2, r0
bge LoadFrame
add r2, #0x1
strb r2, [r3]
b Finish
LoadFrame:
mov r2, #0x0
strb r2, [r3]
ldrb r2, [r1, #0x5]
strb r2, [r3, #0x1]
ldr r0, [r1]
ldr r1, .VRAM_Animated_Image
swi #0x12

Finish:
pop {r0-r3}
ExitRightNow:
ldr r1, [r0]
ldr r0, .Frame_Count
push {r3}
ldr r3, .Old_Routine
bx r3

.align 2
.Ani_Table:
.word 0x08YYYYYY @animation table offset
.RAM_Address:
.word 0x020370c0
.VRAM_Animated_Image:
.word 0x06004000
.Frame_Count:
.word 0x0000FFFF
.Old_Routine:
.word 0x08078C01
Have you changed YYYYYY to your table location?
 
Back
Top