Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-11-19 21:31:31

Shararamosh
Member
Registered: 2016-08-25
Post 8/12

Editing Super Game Boy Border

I found a file called sgb_border.asm, and I need to make SGB border show the words "Pocket Monsters" like in the japanese version. But I don't understand where I can write the number of tiles I want to show. Can you help me?

Offline

#2 2016-11-19 22:08:07

value chain
Member
Registered: 2016-09-25
Post 20/29

Re: Editing Super Game Boy Border

Hey!

I think what you want to do is in image format, rather than text format.

There's a PNG file in gfx/red and gfx/blue which shows the images (and text) of the SGB borders (sgbborder.png). You just edit it, change it to 2bpp format using Cygwin, and you're good to go :)

Offline

#3 2016-11-20 01:07:32

comet
Member
Registered: 2012-04-09
Post 670/672

Re: Editing Super Game Boy Border

value chain wrote:

change it to 2bpp format using Cygwin

This is a redundant step. Building will do this automatically.

Offline

#4 2016-11-20 12:20:22

Shararamosh
Member
Registered: 2016-08-25
Post 9/12

Re: Editing Super Game Boy Border

value chain wrote:

Hey!

I think what you want to do is in image format, rather than text format.

There's a PNG file in gfx/red and gfx/blue which shows the images (and text) of the SGB borders (sgbborder.png). You just edit it, change it to 2bpp format using Cygwin, and you're good to go :)

So I have this sgbborder.png file and I see the text.
bb30c285ba77.png
MechanicalPen has told me how to edit the tiles displayed on the title screen, but can I do it with tiles of SGB border? Maybe there is some kind of .asm file where I can write list of tiles?

Offline

#5 2016-11-20 14:56:32

Danny-E 33
Administrator
Registered: 2012-06-09
Post 994/1,021

Re: Editing Super Game Boy Border

That information is in gfx/red/sgbborder.map and gfx/blue/sgbborder.map
Try opening those files in a hex editor and setting the width to 64 ($40)

SxGkz2e.png

Each tile gets two bytes. The first byte is the tile id, from gfx/red/sgbborder.png and gfx/blue/sgbborder.png. The second byte is the attribute byte for that tile.

The format for the attribute byte appears to work like this:
bit 0: always 0
bit 1: always 0
bit 2 & 3: palette id
bit 4: use sgb border palettes if set
bit 5: always 0
bit 6: mirror tile if set
bit 7: always 0

Bit 4 means that if it is unset, then bits 2 & 3 refer to palettes 0-3 of the currently loaded in-game palettes.
If bit 4 is set, then bits 2 & 3 refer to palettes 0-3 from the sgb border palettes defined in data/sgb_border.asm

It's possible that bits 0, 1, 5, and 7 have some actual purpose regarding the sgb in general, but it seems like Red only uses bits 2 and 3 for the palette id and bit 6 to mirror the tile.

This results in the following bytes used for the attribute byte:
$10 - palette id 0 (pink/red)
$50 - palette id 0 (pink/red) mirrored
$14 - palette id 1 (green/brown)
$54 - palette id 1 (green/brown) mirrored
$18 - palette id 2 (yellow/blue)
$58 - palette id 2 (yellow/blue) mirrored

Also, I moved this thread to Help/Question where it belongs.


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#6 2016-11-22 03:57:49

Fotomac
Member
Registered: 2015-10-25
Post 250/286

Re: Editing Super Game Boy Border

...Can you show a picture which illustrates the correlation between the hex code and the SGB border? Because I think I might be able to understand the border's language better that way.

Thanks!

EDIT REASON: Accidentally replied too soon

Last edited by Fotomac (2016-11-22 03:58:42)

Offline

#7 2016-11-22 17:16:41

Danny-E 33
Administrator
Registered: 2012-06-09
Post 997/1,021

Re: Editing Super Game Boy Border

I explained the whole format already. Which part needs more clarification?

Since you didn't ask a specific question, hopefully this illustration will help.

xcxNTRW.png


Red Hack: Pokémon Prototype

Total number of registered users: 7000+
Total number of active users: ~12

Offline

#8 2016-11-22 21:38:19

Fotomac
Member
Registered: 2015-10-25
Post 251/286

Re: Editing Super Game Boy Border

I think I got it now. Thanks for the illustration!

Offline

#9 2016-11-27 14:59:37

Shararamosh
Member
Registered: 2016-08-25
Post 10/12

Re: Editing Super Game Boy Border

Danny-E 33 wrote:

I explained the whole format already. Which part needs more clarification?

Since you didn't ask a specific question, hopefully this illustration will help.

http://i.imgur.com/xcxNTRW.png

Thank you for help!

Offline

Board footer

Powered by FluxBB