How to edit the splash screen - pret/pokecrystal GitHub Wiki

If you're hacking pokecrystal you'll most likely want to add your own name to the title and splash screens. Doing so on the title screen is easy enough, as it's embedded into logo.png, however with the splash screen, you'll have to use more trickery.

IN PROGRESS: APPLY THIS TO CREDITS SEQUENCE + ADD CREDITS SEQUENCE PART

Edit the tiles

The tiles are laid out in gfx/splash/copyright.png. You're going to want to expand the width of the file, as by default it will not have enough space in the PNG file to create the tiles. Remember to keep the width a multiple of 8.

Use the new tiles in the game

If you build the game now, you will experience some corruption. The new tiles will overwrite $7f (the space character), and subsequent tiles will reach into screen tilemap memory. We'll have to do some adjustments to this screen.

Push the tiles up from $60 to $80

By default, the tiles occupy the area from $60 to $7c. We would have been able to ignore this and just have a blank tile between the old and new tiles, however the truth is that there are two areas in Gameboy VRAM meant for $00-$7f tiles: vTiles0 and vTiles2, which, in the splash screen, vTiles2 is used by the background, so we can't do that. We will want to push the tiles up to vTiles1.

Open engine/menus/intro_menu.asm and find Copyright as so:

Copyright:
	call ClearTilemap
	call LoadFontsExtra
	ld de, CopyrightGFX
	ld hl, vTiles2 tile $60
	lb bc, BANK(CopyrightGFX), 29
	call Request2bpp
	hlcoord 2, 7
	ld de, CopyrightString
	jp PlaceString

To push the tiles up from $60 to $80, we want to change ld hl, vTiles2 tile $60 to ld hl, vTiles1.

Copyright:
	call ClearTilemap
	call LoadFontsExtra
	ld de, CopyrightGFX
+       ld hl, vTiles1
-	ld hl, vTiles2 tile $60
	lb bc, BANK(CopyrightGFX), 29
	call Request2bpp
	hlcoord 2, 7
	ld de, CopyrightString
	jp PlaceString

Since the GBC only screen starts after the splash screen, this means the splash screen is visible in GB mode. This means that, to keep the credits readable on a DMG, we cannot use the second VRAM bank to store the tiles (not that that would change anything).

It's preferable to have these start at $80, since pushing them back to $50 is problematic (the $50-$5f row is full of control characters) and there are more control characters along $00-$4f. However, if you make now, you won't see any splash screen. This is because we still have not adjusted the text string yet. Don't worry about having the tiles be overwritten—unless you add something that expects these tiles to be in place, vanilla pokecrystal doesn't.

Adjusting the copyright string

The ©1995-2001 Creatures Inc., Nintendo, GAME FREAK inc. screen is stored as a string.

CopyrightString:
	; ©1995-2001 Nintendo
	db   $60, $61, $62, $63, $64, $65, $66
	db   $67, $68, $69, $6a, $6b, $6c

	; ©1995-2001 Creatures inc.
	next $60, $61, $62, $63, $64, $65, $66
	db   $6d, $6e, $6f, $70, $71, $72, $7a, $7b, $7c

	; ©1995-2001 GAME FREAK inc.
	next $60, $61, $62, $63, $64, $65, $66
	db   $73, $74, $75, $76, $77, $78, $79, $7a, $7b, $7c

	db "@"

You'll want to change these values so that $60-$6f is $80-$8f, and $70-$7c is $90-$9c. You can do this by hand, but here is the ready-to-go string:

CopyrightString:
	; ©1995-2001 Nintendo
	db   $80, $81, $82, $83, $84, $85, $86
	db   $87, $88, $89, $8a, $8b, $8c

	; ©1995-2001 Creatures inc.
	next $80, $81, $82, $83, $84, $85, $86
	db   $8d, $8e, $8f, $90, $91, $92, $9a, $9b, $9c

	; ©1995-2001 GAME FREAK inc.
	next $80, $81, $82, $83, $84, $85, $86
	db   $93, $94, $95, $96, $97, $98, $99, $9a, $9b, $9c

	db "@"

(If you want to add even more credits, you won't have to do this or the previous step again.)

Now if you make, it will display the string once more. However you can't yet add your credits. First we need to sort something else out.

Making the game load more tiles

The offender is this line:

lb bc, BANK(CopyrightGFX), 29

This line tells the game to load 29 tiles, which works for the vanilla string. But for our case it's too little. Change the 29 to the width of your gfx/splash/copyright.png in pixels divided by 8 (or in other words, the width of the image in tiles). In my case the width was 352, and 352 / 8 is 44, so the correct line in my case is lb bc, BANK(CopyrightGFX), 44.

Utilising the tiles

Now we can finally add our tiles. Edit CopyrightString to your desire. For example:

CopyrightString:
	; ©1995-2001 Nintendo
	db   $80, $81, $82, $83, $84, $85, $86
	db   $87, $88, $89, $8a, $8b, $8c

	; ©1995-2001 Creatures inc.
	next $80, $81, $82, $83, $84, $85, $86
	db   $8d, $8e, $8f, $90, $91, $92, $9a, $9b, $9c

	; ©1995-2001 GAME FREAK inc.
	next $80, $81, $82, $83, $84, $85, $86
	db   $93, $94, $95, $96, $97, $98, $99, $9a, $9b, $9c
	
+	; ©2023-2024 CRYSTALMOON
+	next $80, $9d, $9e, $9f, $a0, $a1, $a2
+	db   $a3, $a4, $a5, $a6, $a7, $a8, $a9, $aa, $ab

	db "@"

Remember to have it start with a next and use a db on the second line. Also remember to put this before the db "@".

If we run make now we'll see the screen is all complete, ..almost. It's off-centre. Adding a new line but we didn't update the position of where it draws the text, so we'll now do that.

Making the screen centred (optional)

It's not necessary to do this, unless you're an aesthetics nut. This time, the culprit is the line hlcoord 2, 7 in Copyright. You'll need to decrement this for every credit that you add. In my case I wanted to add just one new credit, so for me the line is hlcoord 2, 6 instead.

The final result

In GBC mode:

obraz

In DMG mode:

obraz

This is what we want to happen. Now you should have a brand new credit at the start of the game!

Remember to follow these steps exactly (just skip pushing the tiles up to $80) every time you want to add a new credit.