PDA

View Full Version : Development: Animating the FireRed titlescreen.


Darthatron
March 20th, 2011, 05:39 PM
While browsing this section I found a post by colcolstyles (see below) about the amount of frames that the titlescreen in FireRed is displayed for. I then thought to myself "That'd be a good way to add an animation to the titlescreen!" and then I posted this thread.

For anyone who's interested, at '0x078c1c' there is a 32-bit number (the default value is '0x00000a8b') which dictates the number of frames for which the titlescreen is displayed before resetting. The GBA operates at roughly 60 frames per second and '0xa8b' divided by 60 is 45 so the unedited titlescreen is displayed for 45 seconds. You can change that number (remember to reverse it) to lengthen or shorten the amount of time it takes for the titlescreen to reset.

This is for Fire Red, by the way.

Anyway, my idea is to inject a routine just before that check to change the tileset/tilemap of the Charizard on the titlescreen, based on the amount of frames passed, allowing for animations to be used.

This would be a much better way of having an animated titlescreen than anything done before now(I think), since more than 2 frames will be able to be used.

I'll let you all know how it goes!!

EDIT:
http://www.youtube.com/watch?v=SA95KzAgb48
Success has been had.

EDIT2:
It now works by using a data array that works as such:
word: Pointer to image
byte: Pause Length
byte: Next Frame
hword: Buffer

...so a simple endless-loop animation (like in the video) would be possible, or you could play the first few frames once, then loop to a frame somewhere in the middle. Or you can stop the animation at the end by pointing to its own frame. The animation can be up to 255 frames. ^_^

So yeah, it just changes the tiles, not the tilemap, as that seems to suffice.

Any other ideas?

EDIT:
Zapdos in the animation: http://www.youtube.com/watch?v=rnm4SkwE22I

diegoisawesome
March 21st, 2011, 04:37 PM
Nice work! Now we only need to be able to 'pull' tilemaps across the screen...
And make this work in Emerald too, as it just resets on the end of the song.

Darthatron
March 21st, 2011, 11:31 PM
For Emerald, I think it would be better to use an OAM. Of course, this would make moving of the animation a lot easier as well. But it would limit the size of the animation to 64x64. :\

Full Metal
March 22nd, 2011, 05:17 AM
Awesome, thanks for this, I can't wait to quit programming and try it out at somepoint.

knizz
March 22nd, 2011, 11:32 AM
Cool idea. Once I have finished all my school work I'll contribute.

diegoisawesome
March 22nd, 2011, 02:20 PM
I wouldn't know, exactly, how to get the game to load a new OAM to the title screen, or how to have it animate... well, that would probably just use the frame system we've already found. But I wouldn't know how to make it, say, go across the screen. Then again, I don't know how to do that with tilemaps either...

Team Fail
March 22nd, 2011, 03:49 PM
I like this. I'd like to see this as a complete working animated title screen someday. Congrats on your effort. Do you think it'd be possible to use the animated sprites of the Pokemon in Black and White, after resized, in the title screens?

Darthatron
March 22nd, 2011, 05:45 PM
Yeah, but not with the way they are stored in the B/W ROM, since they are stored as "parts" rather than full frames. But if you make/find full frames, and give me the order, I can make a video showing it.

EDIT: I got bored an put in Zapdos' animation. Well... kind of. Just the frames. Not the FULL animation, though that is very possible.

http://www.youtube.com/watch?v=rnm4SkwE22I

There is a downside to this hack, though. It takes quite a bit of space. The entire Zapdos animation (frames, tilemap and routine) take up 11.55kb (11,828 bytes) in the ROM. Which only works out to about 0.0007% of the entire (un-expanded) ROM, but it's still quite a bit.

war rock exe
March 23rd, 2011, 09:59 AM
Yeah, but not with the way they are stored in the B/W ROM, since they are stored as "parts" rather than full frames. But if you make/find full frames, and give me the order, I can make a video showing it.

EDIT: I got bored an put in Zapdos' animation. Well... kind of. Just the frames. Not the FULL animation, though that is very possible.

http://www.youtube.com/watch?v=rnm4SkwE22I

There is a downside to this hack, though. It takes quite a bit of space. The entire Zapdos animation (frames, tilemap and routine) take up 11.55kb (11,828 bytes) in the ROM. Which only works out to about 0.0007% of the entire (un-expanded) ROM, but it's still quite a bit.



nice vid man

i'm guessing that you should probably complete the hack before you input the titlescreen...

Team Fail
March 23rd, 2011, 01:55 PM
Yeah, but not with the way they are stored in the B/W ROM, since they are stored as "parts" rather than full frames. But if you make/find full frames, and give me the order, I can make a video showing it.

EDIT: I got bored an put in Zapdos' animation. Well... kind of. Just the frames. Not the FULL animation, though that is very possible.

http://www.youtube.com/watch?v=rnm4SkwE22I

There is a downside to this hack, though. It takes quite a bit of space. The entire Zapdos animation (frames, tilemap and routine) take up 11.55kb (11,828 bytes) in the ROM. Which only works out to about 0.0007% of the entire (un-expanded) ROM, but it's still quite a bit.

That's pretty damn cool. Not kidding. If I was able to do this for my hack, I would do so by all means. But, the one thing that bugs me the most is the flames in the background. Is it possible to use them elsewhere on the screen. I do know they can be edited using UnLzGBA, but yeah.

Full Metal
March 23rd, 2011, 03:45 PM
^ He's not actually making a hack. He's hacking. you know, learning, experimenting in areas others haven't really abused much. It's pretty cool and fun. ;)
ANYWAYS, what I *really* came here with.
I tried bpr 08078C1C 2
and nothing ever came up. :(
But it's okay, I followed that post link, and read down on that thread a bit further where Knizz ( Reference (http://www.pokecommunity.com/showpost.php?p=6284862&postcount=86) ) posted the offset of the comparison. I looked up the point where r0 is loaded with the value.

08078bf8 4907 ldr r1, [$08078c18] (=$03005098)
08078bfa 1840 add r0, r0, r1
08078bfc 2300 mov r3, #0x0
08078bfe 5ec1 ldsh r1, [r0, r3]
08078c00 4806 ldr r0, [$08078c1c] (=$00000a8b)
08078c02 4281 cmp r1, r0
08078c04 dd05 ble $08078c12

And I was wondering, is the bpr not triggering because it's not ldr-ing a constant value? :\

Darthatron
March 23rd, 2011, 10:02 PM
^ He's not actually making a hack. He's hacking. you know, learning, experimenting in areas others haven't really abused much. It's pretty cool and fun. ;)
ANYWAYS, what I *really* came here with.
I tried bpr 08078C1C 2
and nothing ever came up. :(
But it's okay, I followed that post link, and read down on that thread a bit further where Knizz ( Reference (http://www.pokecommunity.com/showpost.php?p=6284862&postcount=86) ) posted the offset of the comparison. I looked up the point where r0 is loaded with the value.

08078bf8 4907 ldr r1, [$08078c18] (=$03005098)
08078bfa 1840 add r0, r0, r1
08078bfc 2300 mov r3, #0x0
08078bfe 5ec1 ldsh r1, [r0, r3]
08078c00 4806 ldr r0, [$08078c1c] (=$00000a8b)
08078c02 4281 cmp r1, r0
08078c04 dd05 ble $08078c12

And I was wondering, is the bpr not triggering because it's not ldr-ing a constant value? :\

I had the same problem, I think. I had to manually go to the offset and look for the part that loaded it. :\ I have no idea why, though. Sorry.

I use No$GBA to debug, though. Not VBA.



Anyway, if anyone wants the routine as is, PM me for it. I'm sure it can be optimized, but I don't have much free time to do so.

Darthatron
March 25th, 2011, 06:14 AM
Nice work! Now we only need to be able to 'pull' tilemaps across the screen...
And make this work in Emerald too, as it just resets on the end of the song.

In regards to this, I looked in to it, and it's a LOT easier to move the tilemap than I thought it would be. ^_^ Infact, I implemented it and it seems to work fine. Except when moving it from the X-axis, from off the screen, since the GBA hardware "wraps" the tilemap, which makes it come from left if moved off the right, and visa versa. :\ I can't see an easy way around this... Y-axis has no problem at all, though.

EDIT: Source off all knowledge: http://nocash.emubase.de/gbatek.htm#lcdiobgscrolling

EDIT2: http://www.youtube.com/watch?v=NuetDQEUqKQ

Lost Heart
March 25th, 2011, 11:01 AM
Wow, that really is quite amazing. Great work! I only wish I knew more so that I could contribute to this. :(

diegoisawesome
March 25th, 2011, 02:17 PM
There's an I/O flag for the BG layer that checks for wrapping.
Disable it and you're good to go.

Darthatron
March 25th, 2011, 07:02 PM
There's an I/O flag for the BG layer that checks for wrapping.
Disable it and you're good to go.

Yeah, I tried that, but I couldn't get it working. I'll have another go later. ^_^

RHIOne
March 26th, 2011, 02:49 PM
Wow... Amazing job on this, I was having a two-framed titlescreen before, and I look into this for more frames :D

colcolstyles
March 27th, 2011, 09:09 AM
Mm, cool idea. I'll be keeping my eye on this. :)

Full Metal
March 27th, 2011, 01:12 PM
Hey, I tried that routine.
I think I did a nice job at understanding it. :)
You load a pointer to an array of those structures
Then, you load a pointer to the image and copy it.
Then you wait until the frame count for that image passes
Then you load the next and continue. { you store the fc and the current frame in that RAM_ADDRESS location thing. }
But one question, how do you know when to reset back to the first image?
{ I still haven't actually gotten this thing to work btw. I probably just need to start with a fresh ROM and go from there. }
Also, some other questions.
For that routine, does it use a tilemap? What about the graphics, should they be compressed, or decompressed?
*edit*
NVM on the knowing when to restart. You just set the `next frame` value to 0. :P
I FEEL SILLY now. But the questions of tilemaps uncompressed/compressed still remains.
Although I have a feeling it's uncompressed with a tilemap...(GbaTek doesn't say swi 0xC uncompresses any data )

Darthatron
March 27th, 2011, 10:46 PM
Hey, I tried that routine.
I think I did a nice job at understanding it. :)
You load a pointer to an array of those structures
Then, you load a pointer to the image and copy it.
Then you wait until the frame count for that image passes
Then you load the next and continue. { you store the fc and the current frame in that RAM_ADDRESS location thing. }
But one question, how do you know when to reset back to the first image?
{ I still haven't actually gotten this thing to work btw. I probably just need to start with a fresh ROM and go from there. }
Also, some other questions.
For that routine, does it use a tilemap? What about the graphics, should they be compressed, or decompressed?
*edit*
NVM on the knowing when to restart. You just set the `next frame` value to 0. :P
I FEEL SILLY now. But the questions of tilemaps uncompressed/compressed still remains.
Although I have a feeling it's uncompressed with a tilemap...(GbaTek doesn't say swi 0xC uncompresses any data )

The routine I gave you doesn't load any tilemap, it just uses the one in the original titlescreen, so you can replace that one. All graphics are compressed. ^_^

EDIT: Also, I don't know where you got SWI 0xC from? The only SWI used is 0x12 (LZ77UnCompVram.)

Full Metal
March 28th, 2011, 05:08 AM
OH! I thought that was a decimal twelve, which I thought was odd. Awesome, thanks.

Okay...I must be doing something wrong.
I inserted my routine, and adjusted the original as you recommended ( I remembered to add 1 to the offset ) and I can view the titlescreen, and continue to the continue/new game screen. However...the swi function I think is causing some issues. It's copying *way* too much data, and it looks corrupt in the tile-viewer. ( I did insert two frames using unlz.GBA )


[css-div="background: #222 url('http://img153.imageshack.us/img153/6049/screenae.png') no-repeat top center;position:relative;margin-left:1em;padding:1em;box-shadow: inset #000 0 0 10px;min-height:180px;"]
[css-div="position:absolute;bottom:0;left:-1em;width:100%;padding:1em;background:#333;color:#DDD;text-shadow:#FFF 0 0 3px;"]The Title Screen as it appears now.[/css-div][/css-div]
[css-div="background: #222 url('http://img13.imageshack.us/img13/6844/45690004.png') no-repeat top center;position:relative;margin-left:1em;padding:1em;box-shadow: inset #000 0 0 10px;min-height:530px;"]
[css-div="position:absolute;bottom:0;left:-1em;width:100%;padding:1em;background:#333;color:#DDD;text-shadow:#FFF 0 0 3px;"]Tile Viewer.[/css-div][/css-div]

xephos
January 22nd, 2012, 08:50 AM
Nice. Is it possible to get objects moving left to fight ie: fireballs going left and right rather than up and down?

Lost Heart
January 24th, 2012, 03:54 PM
Nice. Is it possible to get objects moving left to fight ie: fireballs going left and right rather than up and down?

I would think so, you would just have to find where their animation is controlled.

Also, will you ever release your ASM on this?

Darthatron
January 24th, 2012, 05:46 PM
I already give it out to people who ask for it. But it's still messy, and uncommented.

Robert Conley
July 27th, 2012, 03:07 PM
Are you still developing this? I don't know much about ASM but implementing this would kind of make it worth learning it in my opinion.

Darthatron
July 27th, 2012, 04:21 PM
It's finished. But there is still no commented version. Since I am lazy. This is complex for something to start with, though. I suggest following some tutorials first.

cooley
August 3rd, 2012, 09:22 AM
This is actually pretty amazing. Good work!

Herpahermaderp
August 14th, 2012, 09:56 PM
I think its awesome...but I think I'm blonde, I don't get ANY of the stuff you guys were talking about previously lol I must has this on my hacked rom...

Darthatron
August 14th, 2012, 11:05 PM
I think its awesome...but I think I'm blonde, I don't get ANY of the stuff you guys were talking about previously lol I must has this on my hacked rom...

Better start learning ASM, then :)

Herpahermaderp
August 14th, 2012, 11:51 PM
Better start learning ASM, then :)

*cough cough* whats ASM? *cough cough* If I know what that means I can be on my way

Darthatron
August 15th, 2012, 01:48 AM
*cough cough* whats ASM? *cough cough* If I know what that means I can be on my way

ASM is ASseMbly. It's the language the ROM is stored in. Knowing how it works allows you to make hacks like this.

Herpahermaderp
August 15th, 2012, 07:55 AM
Ah, thank you! Now I will try to add this into my ROM lol

VERGUNDAI
October 6th, 2012, 04:31 PM
Hi there, this is really great.

Are you thinking of making a tool that can change this without hexing?

Darthatron
October 6th, 2012, 08:30 PM
Hi there, this is really great.

Are you thinking of making a tool that can change this without hexing?

Nope. Never. :) Once I release the highly commented code, it will be easy enough to implement.

Full Metal
October 7th, 2012, 08:09 AM
Nope. Never. :) Once I release the highly commented code, it will be easy enough to implement.

Soon, by any chance? c:
;_; I lost the non-commented code you sent me, and the notes I took on it.

karatekid552
July 22nd, 2013, 05:16 PM
-I just talked to Darthatron about 2 minutes ago and got permission to release this-

Source 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:


.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


YYYYYY = a table somewhere with this structure: Word [Pointer to Image]; Byte [Pause Length]; Byte [Next Frame];

For an example of how this works as is (I modified it in DC) see Liquid Crystal's titlescreen.

The images basically replace the layer that the charizard is on in FR, so you will need to change the palette for that image to be the palette of your new animated frames. You don't need to change the original image, but you do need to change the .raw and make sure that all of your images use the same .raw. The way to do this is to insert you images all the same size and don't make tilesets. Just create your frames, all with the same dimensions, and insert them. Then create a .raw with one of them and replace the .raw for the charizard with it.

All credits go to Dathatron.

I will write a more thorough tutorial when I get around to it....

Edit:
Here is a quick mod of the routine so you don't have to worry about the flashing press start.
.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

MrDollSteak
July 24th, 2013, 01:28 AM
All credits go to Dathatron.

I will write a more thorough tutorial when I get around to it....

That's fantastic! I've been interested in this for awhile :P

supersoursky
August 6th, 2013, 07:33 PM
i need somthing that will work for emerald

musti205
May 23rd, 2014, 11:42 AM
Can anyone tell me what i have to do that i can create a animated titlescreen in Fire red ?
Or can you give me a tutorial please i dont unsterstand this thread!

Shiny Quagsire
May 23rd, 2014, 01:30 PM
Can anyone tell me what i have to do that i can create a animated titlescreen in Fire red ?
Or can you give me a tutorial please i dont unsterstand this thread!

9 times out of 10 if you ask for a tutorial or a patch in Research and Development you aren't going to get one. Just so ya know. ;)

On a slightly different note if you want to be able to learn how to do things like this I'd suggest first learning how to use a hex editor. Find tutorials that require you to use one and follow along. Keep trying to do the hack until you finally get it right. If you can't then find something on how to script, and learn that, and then go back and try to learn how to hex edit. Then move on to just compiling ASM. You can use the routine in Hackmew's Knowledge (http://www.pokecommunity.com/showthread.php?t=117917) and try inserting and using it. Find ASM hacks to apply. Not everyone can understand routines like this or even insert them, but there really isn't any easy way to do this.

mrtienduc1999
July 3rd, 2014, 08:39 PM
You can write a tut for all. i saw it in Pokemon Liquid Crystal and i like it!

Lance32497
November 26th, 2014, 03:56 AM
Ahhhm... sorry for being noob in my question, but I dont really get it.....

For anyone who's interested, at '0x078c1c'
there is a 32-bit number (the default value is
'0x00000a8b') which dictates the number of
frames for which the titlescreen is displayed
before resetting. The GBA operates at roughly
60 frames per second and '0xa8b' divided by
60 is 45 so the unedited titlescreen is
displayed for 45 seconds. You can change that
number (remember to reverse it) to lengthen
or shorten the amount of time it takes for the
titlescreen to reset.
This is for Fire Red, by the way.


How can I make the titlescreen moves?

Shiny Quagsire
November 26th, 2014, 02:28 PM
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.

Lance32497
November 26th, 2014, 02:51 PM
wow-o-wow!
Thanks for it!