Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Generation II
  • → Moving Tileset Pallet Data to Another Bank in Gold (Originally by RED)

#1 2013-02-15 03:46:11

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,329/3,578

Moving Tileset Pallet Data to Another Bank in Gold (Originally by RED)

Note from Mateo: Okay, this was originally posted by RED and he sent it to me via Facebook, and told me I could repost it. So I figured I would post it here to help people out.

--------------------------------------------------------

Tools that will be needed.
Hex editor
Pokemon gold/silver
pointer calculator
Tileset Editor

First open your rom in your hex editor..Find 2 blank areas of space, long run of zero will be good enough (As much as possible are both at the same bank)

Now in this TuT I will use the address 0xA0000 but you can use your own address

Now write this to the blank that you have found:
1st address:
21 A0 C3 11 D9 CC 06 12 0E 14 7E E5 CB 3F 38 10 21 CF D0 86 6F FA D0 D0 CE 00 67 7E E6 0F 18 10 21 CF D0 86 6F FA D0 D0 CE 00 67 7E CB 37 E6 0F E1 12 CB BE 23 13 0D 20 D1 05 20 CC C9
2nd address:
21 20 CC 11 48 CC 7E E5 CB 3F 38 10 21 CF D0 86 6F FA D0 D0 CE 00 67 7E E6 0F 18 10 21 CF D0 86 6F FA D0 D0 CE 00 67 7E CB 37 E6 0F E1 12 CB BE 23 13 0D 20 D1 C9

Now we will now repoint the data...Just Go this following address and replace it by the bytes of the pointer you've found..
1st address
0xD5C = zz -bank
0xD5F = xx yy -2byte pointer
2nd address
0xD68 = zz -bank
0xD6B = xx yy -2byte pointer

---------------------------------------------------------

Now you can go into Melash's Tileset Editor and store pallet data in your new bank.

Offline

#2 2013-02-15 04:38:34

comet
Member
Registered: 2012-04-09
Post 145/679

Re: Moving Tileset Pallet Data to Another Bank in Gold (Originally by RED)

I can't comment it right now, but I felt that this was a little more comprehensible than the bytecodes. From what I can tell this is a copied version of the old routine at the start of bank 2, which maps palettes to tile ids. The palette maps are condensed to nybbles, with the least-significant nybble first.

So if your first 4 tiles had palettes [1 4 8 6] in that order, the first 2 bytes of your palette map would look like [41 68].

At a glance, $c3a0 is the tilemap and $ccd9 is the attribute map. For our purposes we're just taking the nybble we got earlier and putting each one in its own byte so it maps to a specific tile. The screen is 20x18 tiles ($14 x $12).

RO28:4000 21 A0 C3         ld   hl,C3A0
RO28:4003 11 D9 CC         ld   de,CCD9
RO28:4006 06 12            ld   b,12
RO28:4008 0E 14            ld   c,14
RO28:400A 7E               ld   a,(hl)
RO28:400B E5               push hl
RO28:400C CB 3F            srl  a
RO28:400E 38 10            jr   c,4020
RO28:4010 21 CF D0         ld   hl,D0CF
RO28:4013 86               add  (hl)
RO28:4014 6F               ld   l,a
RO28:4015 FA D0 D0         ld   a,(D0D0)
RO28:4018 CE 00            adc  a,00
RO28:401A 67               ld   h,a
RO28:401B 7E               ld   a,(hl)
RO28:401C E6 0F            and  a,0F
RO28:401E 18 10            jr   4030
RO28:4020 21 CF D0         ld   hl,D0CF
RO28:4023 86               add  (hl)
RO28:4024 6F               ld   l,a
RO28:4025 FA D0 D0         ld   a,(D0D0)
RO28:4028 CE 00            adc  a,00
RO28:402A 67               ld   h,a
RO28:402B 7E               ld   a,(hl)
RO28:402C CB 37            swap a
RO28:402E E6 0F            and  a,0F
RO28:4030 E1               pop  hl
RO28:4031 12               ld   (de),a
RO28:4032 CB BE            res  7,(hl)
RO28:4034 23               inc  hl
RO28:4035 13               inc  de
RO28:4036 0D               dec  c
RO28:4037 20 D1            jr   nz,400A
RO28:4039 05               dec  b
RO28:403A 20 CC            jr   nz,4008
RO28:403C C9               ret

Similarly, $cc20 is the bg map, and $cc48 is the bg map palettes. It works the same way, except the bg map is 32x32.

RO28:403D 21 20 CC         ld   hl,CC20
RO28:4040 11 48 CC         ld   de,CC48
RO28:4043 7E               ld   a,(hl)
RO28:4044 E5               push hl
RO28:4045 CB 3F            srl  a
RO28:4047 38 10            jr   c,4059
RO28:4049 21 CF D0         ld   hl,D0CF
RO28:404C 86               add  (hl)
RO28:404D 6F               ld   l,a
RO28:404E FA D0 D0         ld   a,(D0D0)
RO28:4051 CE 00            adc  a,00
RO28:4053 67               ld   h,a
RO28:4054 7E               ld   a,(hl)
RO28:4055 E6 0F            and  a,0F
RO28:4057 18 10            jr   4069
RO28:4059 21 CF D0         ld   hl,D0CF
RO28:405C 86               add  (hl)
RO28:405D 6F               ld   l,a
RO28:405E FA D0 D0         ld   a,(D0D0)
RO28:4061 CE 00            adc  a,00
RO28:4063 67               ld   h,a
RO28:4064 7E               ld   a,(hl)
RO28:4065 CB 37            swap a
RO28:4067 E6 0F            and  a,0F
RO28:4069 E1               pop  hl
RO28:406A 12               ld   (de),a
RO28:406B CB BE            res  7,(hl)
RO28:406D 23               inc  hl
RO28:406E 13               inc  de
RO28:406F 0D               dec  c
RO28:4070 20 D1            jr   nz,4043
RO28:4072 C9               ret

Last edited by comet (2013-03-08 08:02:38)

Offline

#3 2013-02-15 04:48:45

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 2,330/3,578

Re: Moving Tileset Pallet Data to Another Bank in Gold (Originally by RED)

Thanks for expanding on that.

Offline

  • Index
  • → Generation II
  • → Moving Tileset Pallet Data to Another Bank in Gold (Originally by RED)

Board footer

Powered by FluxBB