’Cause all games were better on the GBC

You are not logged in.

#1 2013-03-12 01:58:24

From: Somewhere in Johto
Registered: 2011-08-10
Post 314/410

Additional Overworld Palettes G/S/C

In jwibagi's post about Repeating the Palette Byte in Primary Header, I saw the following information:

Time of Day

This value is split into its two nibbles:

    0xX0: According to time, either morning, day, or night.
    0xX1: Day
    0xX2: Night
    0xX3: Morning
    0xX4: Cave. FLASH can be used once to activate night palettes.
    0xX5: According to time, either morning, day, or night.
    0xX6: According to time, either morning, day, or night.
    0xX7: According to time, either morning, day, or night.
    0xNX: N = 0: telephone reception; N<>0: no telephone reception


I know that each palette does not have its own pointer.  Rather, the palettes are just loaded starting where the 2-byte pointer at B676 (Gold)/B21A (Crystal) points to in the order of Morning-Day-Night-FlashCave-Indoors. 

I'd like to know how I could use bytes X5, X6, and X7 to refer to actual palettes instead of just displaying the palette appropriate for the current time.

Last edited by Munchulax (2013-03-12 02:04:06)

“To live is the rarest thing in the world. Most people exist, that is all.” ― Oscar Wilde


#2 2013-03-12 06:02:50

Registered: 2010-10-16
Post 1,562/2,305

Re: Additional Overworld Palettes G/S/C

Well, you've got the asm routine straigth where that "pointer" is (ld de, $775E).
It's kind long one but after looking at it for a few minutes, I'd say the part you're interested in starts at 02:764C.
Close to it, ld hl, $76CE looks for a table of 8 rom addresses (in 2-byte form) of which values are brought to hl with instruction set:

ldi a, (hl)
ld h, (hl)
ld l, a

*Before this, I think there was two add hl,de instructions.
Also, ram address D568 seems to maintain the palette byte loaded from the map's primary header.

Last edited by Miksy91 (2013-03-12 06:05:50)


Board footer

Powered by FluxBB