Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Hello everyone,
I'm try to get my head into GB-Dev with C (+GBDK) and try some own little projects.
On of them should be very text-heavy and I was wondering if there is some best practice for this?
Maybe you could share some expericene with me?
I looked into Zelda: Links Awaking for reference and found something interessing in the VRAM:
It looks to me that always only the nesserary text is loaded into sprites and then displayed.
Is this also possible with GBDK? Or is this one of the many many ASM Hacks they build into this game?
Sorry for the many question and thank you for the time sharing your knowledge,
Matt
Offline
set_bkg_data() + set_bkg_tiles()
Offline
I guess this more of a Sprite on top of the BKG layer.
But I think I get it. Simple switching the tiles.
I'll come back when I have more Code to show...
Last edited by rune-dev-matt (2020-12-18 15:57:13)
Offline
That text is likely to be drawn either on window or directly on the background.
Offline
This is done by replacing some tiles in VRAM and simply drawing them on the background layer. If you slow the emulator down to a few frames per second you can clearly see that the game replaces only two tiles per frame and then draws them on the background map ($9800). And yes, you could do that in GBDK.
It is not possible to achieve the same result using sprites. As you have more than 10 letters in each line, you would exceed the maximum number of sprites per scanline which would cause the rightmost letters to disappear.
The window could be used to display a text box like this, but in Link's Awakening it is used for the HUD on the bottom of the screen (probably to have an easy solution to scroll the HUD area upwards when you enter the pause menu).
Offline
So i gave it a try. I put it on the window layer in my example.
Maybe someone wants to check it out and give me some feedback.
https://github.com/Smartis2812/gbdk-text-system
// I also want to point out, I'm a noob. I started reading the GBDK Wiki as bedtime lecture and have no previous C experiences.
// So I'm open for constructive critic or when someone pointing out where I programed some nonsense.
Last edited by rune-dev-matt (2020-12-22 11:24:46)
Offline
@Jonas Thanks for the input.
Offline