Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MK64 Kart Texture Replacement
- by orbitaldecay 2015
- Note: This document is a work in progress. PLEASE DO NOT DISTRIBUTE IT!
- We don't want a million half finished versions floating around. Thx!
- All kart textures and palettes are stored in the kart bank located at
- 145470 in the ROM. All references to kart graphics data are stored as
- offsets from the start of the kart bank or'ed with 0F000000. For
- example, at DEF20 in the ROM we find the offset from the start of the
- kart bank to the first Mario texture. This happens to be 0F0D3048.
- Thus the address of the first Mario texture in the ROM is D3048 +
- 145470 = 2194B8.
- If you're planning on replacing things in the kart bank, it will
- probably be necessary to relocate the kart bank. This will require
- changing all of the hardcoded references to it. The address of the
- start of the kart bank is hardcoded at several places within the ROM.
- Here is a list of all the locations I've found:
- # ROM RAM Notes
- -----------------------------------------------------------------
- 00 001F38 80001338 Calculates size of previous bank
- (shouldn't be changed)
- 01 005B38 80004F38 Loads offset located at 80162DC4? Not
- sure what this is used for.
- 02 027DBC 800271BC Loads kart textures II
- 03 027EC8 800272C8 Loads kart textures I
- 04 027FE0 800273E0 Loads tumbling kart textures
- 05 028104 80027504 Loads kart textures I
- 06 0282DC 800276DC Loads kart textures II
- 07 0283D0 800277D0 Loads kart textures I
- 08 0284D0 800278D0 Loads tumbling kart textures
- 09 0285DC 800279DC Loads kart textures I
- 10 0286D8 80027AD8 Loads standard kart palettes
- 11 028780 80027B80 Loads standard kart palettes
- 12 028820 80027C20 Loads wheel palettes I & II
- 13 0288B8 80027CB8 Loads kart textures II
- The hardcoded offsets typically look something like
- LUI T1, $0014
- ADDIU T1, T1, $5470
- in MIPS assembly. If you wanted to move the kart bank to the end of the
- ROM data (address BE9160), you'd have to change each of these to
- something like
- LUI T1, $00BE
- ADDIU T1, T1, $9160
- which is probably obvious. Along with this, you'd also need to fix the
- offsets to textures and palettes within the kart bank. There are many
- tables which contain this data. Here is a brief list of them:
- Kart Texture Offset Tables
- ROM Description Size (DWORDS)
- ---------------------------------------------
- 0DEA34 ??? 35
- 0DEAC0 Mario Textures 1.9 35
- 0DEB4C Mario Textures 1.8 35
- 0DEBD8 Mario Textures 1.7 35
- 0DEC64 Mario Textures 1.6 35
- 0DECF0 Mario Textures 1.5 35
- 0DED7C Mario Textures 1.4 35
- 0DEE08 Mario Textures 1.3 35
- 0DEE94 Mario Textures 1.2 35
- 0DEF20 Mario Textures 1.1 35
- 0DEFAC Mario Textures 2.9 20
- 0DEFFC Mario Textures 2.8 20
- 0DF04C Mario Textures 2.7 20
- 0DF09C Mario Textures 2.6 20
- 0DF0EC Mario Textures 2.5 20
- 0DF13C Mario Textures 2.4 20
- 0DF18C Mario Textures 2.3 20
- 0DF1DC Mario Textures 2.2 20
- 0DF22C Mario Textures 2.1 20
- 0DF27C Toad Textures 1.9 35
- 0DF308 Toad Textures 1.8 35
- 0DF394 Toad Textures 1.7 35
- 0DF420 Toad Textures 1.6 35
- 0DF4AC Toad Textures 1.5 35
- 0DF538 Toad Textures 1.4 35
- 0DF5C4 Toad Textures 1.3 35
- 0DF650 Toad Textures 1.2 35
- 0DF6DC Toad Textures 1.1 35
- 0DF768 Toad Textures 2.9 20
- 0DF7B8 Toad Textures 2.8 20
- 0DF808 Toad Textures 2.7 20
- 0DF858 Toad Textures 2.6 20
- 0DF8A8 Toad Textures 2.5 20
- 0DF8F8 Toad Textures 2.4 20
- 0DF948 Toad Textures 2.3 20
- 0DF998 Toad Textures 2.2 20
- 0DF9E8 Toad Textures 2.1 20
- 0DFA38 Luigi Textures 1.9 35
- 0DFAC4 Luigi Textures 1.8 35
- 0DFB50 Luigi Textures 1.7 35
- 0DFBDC Luigi Textures 1.6 35
- 0DFC68 Luigi Textures 1.5 35
- 0DFCF4 Luigi Textures 1.4 35
- 0DFD80 Luigi Textures 1.3 35
- 0DFE0C Luigi Textures 1.2 35
- 0DFE98 Luigi Textures 1.1 35
- 0DFF24 Luigi Textures 2.9 20
- 0DFF74 Luigi Textures 2.8 20
- 0DFFC4 Luigi Textures 2.7 20
- 0E0014 Luigi Textures 2.6 20
- 0E0064 Luigi Textures 2.5 20
- 0E00B4 Luigi Textures 2.4 20
- 0E0104 Luigi Textures 2.3 20
- 0E0154 Luigi Textures 2.2 20
- 0E01A4 Luigi Textures 2.1 20
- 0E01F4 Yoshi Textures 1.9 35
- 0E0280 Yoshi Textures 1.8 35
- 0E030C Yoshi Textures 1.7 35
- 0E0398 Yoshi Textures 1.6 35
- 0E0424 Yoshi Textures 1.5 35
- 0E04B0 Yoshi Textures 1.4 35
- 0E053C Yoshi Textures 1.3 35
- 0E05C8 Yoshi Textures 1.2 35
- 0E0654 Yoshi Textures 1.1 35
- 0E06E0 Yoshi Textures 2.9 20
- 0E0730 Yoshi Textures 2.8 20
- 0E0780 Yoshi Textures 2.7 20
- 0E07D0 Yoshi Textures 2.6 20
- 0E0820 Yoshi Textures 2.5 20
- 0E0870 Yoshi Textures 2.4 20
- 0E08C0 Yoshi Textures 2.3 20
- 0E0910 Yoshi Textures 2.2 20
- 0E0960 Yoshi Textures 2.1 20
- 0E09B0 DK Textures 1.9 35
- 0E0A3C DK Textures 1.8 35
- 0E0AC8 DK Textures 1.7 35
- 0E0B54 DK Textures 1.6 35
- 0E0BE0 DK Textures 1.5 35
- 0E0C6C DK Textures 1.4 35
- 0E0CF8 DK Textures 1.3 35
- 0E0D84 DK Textures 1.2 35
- 0E0E10 DK Textures 1.1 35
- 0E0E9C DK Textures 2.9 20
- 0E0EEC DK Textures 2.8 20
- 0E0F3C DK Textures 2.7 20
- 0E0F8C DK Textures 2.6 20
- 0E0FDC DK Textures 2.5 20
- 0E102C DK Textures 2.4 20
- 0E107C DK Textures 2.3 20
- 0E10CC DK Textures 2.2 20
- 0E111C DK Textures 2.1 20
- 0E116C Bowser Textures 1.9 35
- 0E11F8 Bowser Textures 1.8 35
- 0E1284 Bowser Textures 1.7 35
- 0E1310 Bowser Textures 1.6 35
- 0E139C Bowser Textures 1.5 35
- 0E1428 Bowser Textures 1.4 35
- 0E14B4 Bowser Textures 1.3 35
- 0E1540 Bowser Textures 1.2 35
- 0E15CC Bowser Textures 1.1 35
- 0E1658 Bowser Textures 2.9 20
- 0E16A8 Bowser Textures 2.8 20
- 0E16F8 Bowser Textures 2.7 20
- 0E1748 Bowser Textures 2.6 20
- 0E1798 Bowser Textures 2.5 20
- 0E17E8 Bowser Textures 2.4 20
- 0E1838 Bowser Textures 2.3 20
- 0E1888 Bowser Textures 2.2 20
- 0E18D8 Bowser Textures 2.1 20
- 0E1928 Peach Textures 1.9 35
- 0E19B4 Peach Textures 1.8 35
- 0E1A40 Peach Textures 1.7 35
- 0E1ACC Peach Textures 1.6 35
- 0E1B58 Peach Textures 1.5 35
- 0E1BE4 Peach Textures 1.4 35
- 0E1C70 Peach Textures 1.3 35
- 0E1CFC Peach Textures 1.2 35
- 0E1D88 Peach Textures 1.1 35
- 0E1E14 Peach Textures 2.9 20
- 0E1E64 Peach Textures 2.8 20
- 0E1EB4 Peach Textures 2.7 20
- 0E1F04 Peach Textures 2.6 20
- 0E1F54 Peach Textures 2.5 20
- 0E1FA4 Peach Textures 2.4 20
- 0E1FF4 Peach Textures 2.3 20
- 0E2044 Peach Textures 2.2 20
- 0E2094 Peach Textures 2.1 20
- 0E20E4 Wario Textures 1.9 35
- 0E2170 Wario Textures 1.8 35
- 0E21FC Wario Textures 1.7 35
- 0E2288 Wario Textures 1.6 35
- 0E2314 Wario Textures 1.5 35
- 0E23A0 Wario Textures 1.4 35
- 0E242C Wario Textures 1.3 35
- 0E24B8 Wario Textures 1.2 35
- 0E2544 Wario Textures 1.1 35
- 0E25D0 Wario Textures 2.9 20
- 0E2620 Wario Textures 2.8 20
- 0E2670 Wario Textures 2.7 20
- 0E26C0 Wario Textures 2.6 20
- 0E2710 Wario Textures 2.5 20
- 0E2760 Wario Textures 2.4 20
- 0E27B0 Wario Textures 2.3 20
- 0E2800 Wario Textures 2.2 20
- 0E2850 Wario Textures 2.1 20
- 0E28A0 ??? 160
- 0E2B20 Mario Textures 3 32
- 0E2BA0 Luigi Textures 3 32
- 0E2C20 Bowser Textures 3 32
- 0E2CA0 Toad Textures 3 32
- 0E2D20 Yoshi Textures 3 32
- 0E2DA0 DK Textures 3 32
- 0E2E20 Peach Textures 3 32
- 0E2EA0 Wario Textures 3 32
- Kart Palette Offset Tables
- ROM Description Size (DWORDS)
- --------------------------------------------
- 0DE7F4 Mario Palettes 1 9
- 0DE818 Mario Palettes 2 9
- 0DE83C Luigi Palettes 1 9
- 0DE860 Luigi Palettes 2 9
- 0DE884 Bowser Palettes 1 9
- 0DE8A8 Bowser Palettes 2 9
- 0DE8CC Toad Palettes 1 9
- 0DE8F0 Toad Palettes 2 9
- 0DE914 Yoshi Palettes 1 9
- 0DE938 Yoshi Palettes 2 9
- 0DE95C DK Palettes 1 9
- 0DE980 DK Palettes 2 9
- 0DE9A4 Peach Palettes 1 9
- 0DE9C8 Peach Palettes 2 9
- 0DE9EC Wario Palettes 1 9
- 0DEA10 Wario Palettes 2 9
- --------- Textures are here -------
- 0E2F20 ??? 8
- 0E2F40 Kart Palettes 8
- See below for more detailed information.
- ############################################
- Textures
- ############################################
- Notice that all textures are compressed using the MIO0 format.
- 800DDEB0 (0DEAB0): Kart Texture DMA Size Array (2 bytes each)
- Kart Texture Offset Tables I
- Description: Regular kart textures
- Address: 800E1EE0
- Entries per Table: 35?
- Size of Element: Variable (see 0DEAB0)
- Kart Bank Access #: 03, 05, 07, 09
- ===========================================
- # Kart RAM ROM
- ------------------------------
- 1.0 Mario 800E1CA0
- ------------------------------
- 1.1 800DE320 0DEF20
- 1.2 800DE294 0DEE94
- 1.3 800DE208 0DEE08
- 1.4 800DE17C 0DED7C
- 1.5 800DE0F0 0DECF0
- 1.6 800DE064 0DEC64
- 1.7 800DDFD8 0DEBD8
- 1.8 800DDF4C 0DEB4C
- 1.9 800DDEC0 0DEAC0
- ------------------------------
- 1.0 Luigi 800E1CC4
- ------------------------------
- 1.1 800DF298 0DFE98
- 1.2 800DF20C 0DFE0C
- 1.3 800DF180 0DFD80
- 1.4 800DF0F4 0DFCF4
- 1.5 800DF068 0DFC68
- 1.6 800DEFDC 0DFBDC
- 1.7 800DEF50 0DFB50
- 1.8 800DEEC4 0DFAC4
- 1.9 800DEE38 0DFA38
- ------------------------------
- 1.0 Yoshi 800E1CE8
- ------------------------------
- 1.1 800DFA54 0E0654
- 1.2 800DF9C8 0E05C8
- 1.3 800DF93C 0E053C
- 1.4 800DF8B0 0E04B0
- 1.5 800DF824 0E0424
- 1.6 800DF798 0E0398
- 1.7 800DF70C 0E030C
- 1.8 800DF680 0E0280
- 1.9 800DF5F4 0E01F4
- ------------------------------
- 1.0 Toad 800E1D0C
- ------------------------------
- 1.1 800DEADC 0DF6DC
- 1.2 800DEA50 0DF650
- 1.3 800DE9C4 0DF5C4
- 1.4 800DE938 0DF538
- 1.5 800DE8AC 0DF4AC
- 1.6 800DE820 0DF420
- 1.7 800DE794 0DF394
- 1.8 800DE708 0DF308
- 1.9 800DE67C 0DF27C
- ------------------------------
- 1.0 DK 800E1D30
- ------------------------------
- 1.1 800E0210 0E0E10
- 1.2 800E0184 0E0D84
- 1.3 800E00F8 0E0CF8
- 1.4 800E006C 0E0C6C
- 1.5 800DFFE0 0E0BE0
- 1.6 800DFF54 0E0B54
- 1.7 800DFEC8 0E0AC8
- 1.8 800DFE3C 0E0A3C
- 1.9 800DFDB0 0E09B0
- ------------------------------
- 1.0 Wario 800E1D54
- ------------------------------
- 1.1 800E1944 0E2544
- 1.2 800E18B8 0E24B8
- 1.3 800E182C 0E242C
- 1.4 800E17A0 0E23A0
- 1.5 800E1714 0E2314
- 1.6 800E1688 0E2288
- 1.7 800E15FC 0E21FC
- 1.8 800E1570 0E2170
- 1.9 800E14E4 0E20E4
- ------------------------------
- 1.0 Peach 800E1D78
- ------------------------------
- 1.1 800E1188 0E1D88
- 1.2 800E10FC 0E1CFC
- 1.3 800E1070 0E1C70
- 1.4 800E0FE4 0E1BE4
- 1.5 800E0F58 0E1B58
- 1.6 800E0ECC 0E1ACC
- 1.7 800E0E40 0E1A40
- 1.8 800E0DB4 0E19B4
- 1.9 800E0D28 0E1928
- ------------------------------
- 1.0 Bowser 800E1D9C
- ------------------------------
- 1.1 800E09CC 0E15CC
- 1.2 800E0940 0E1540
- 1.3 800E08B4 0E14B4
- 1.4 800E0828 0E1428
- 1.5 800E079C 0E139C
- 1.6 800E0710 0E1310
- 1.7 800E0684 0E1284
- 1.8 800E05F8 0E11F8
- 1.9 800E056C 0E116C
- Kart Texture Offset Tables II
- Description: Used when karts spinout, etc.
- Address: 800E1F00
- Entries per Table: 20?
- Size of Element: Variable (see 0DEAB0)
- Kart Bank Access #: 02, 06, 13
- ============================================
- # Kart RAM ROM
- ------------------------------
- 2.0 Mario 800E1DC0
- ------------------------------
- 2.1 800DE62C 0DF22C
- 2.2 800DE5DC 0DF1DC
- 2.3 800DE58C 0DF18C
- 2.4 800DE53C 0DF13C
- 2.5 800DE4EC 0DF0EC
- 2.6 800DE49C 0DF09C
- 2.7 800DE44C 0DF04C
- 2.8 800DE3FC 0DEFFC
- 2.9 800DE3AC 0DEFAC
- ------------------------------
- 2.0 Luigi 800E1DE4
- ------------------------------
- 2.1 800DF5A4 0E01A4
- 2.2 800DF554 0E0154
- 2.3 800DF504 0E0104
- 2.4 800DF4B4 0E00B4
- 2.5 800DF464 0E0064
- 2.6 800DF414 0E0014
- 2.7 800DF3C4 0DFFC4
- 2.8 800DF374 0DFF74
- 2.9 800DF324 0DFF24
- ------------------------------
- 2.0 Yoshi 800E1E08
- ------------------------------
- 2.1 800DFD60 0E0960
- 2.2 800DFD10 0E0910
- 2.3 800DFCC0 0E08C0
- 2.4 800DFC70 0E0870
- 2.5 800DFC20 0E0820
- 2.6 800DFBD0 0E07D0
- 2.7 800DFB80 0E0780
- 2.8 800DFB30 0E0730
- 2.9 800DFAE0 0E06E0
- ------------------------------
- 2.0 Toad 800E1E2C
- ------------------------------
- 2.1 800DEDE8 0DF9E8
- 2.2 800DED98 0DF998
- 2.3 800DED48 0DF948
- 2.4 800DECF8 0DF8F8
- 2.5 800DECA8 0DF8A8
- 2.6 800DEC58 0DF858
- 2.7 800DEC08 0DF808
- 2.8 800DEBB8 0DF7B8
- 2.9 800DEB68 0DF768
- ------------------------------
- 2.0 DK 800E1E50
- ------------------------------
- 2.1 800E051C 0E111C
- 2.2 800E04CC 0E10CC
- 2.3 800E047C 0E107C
- 2.4 800E042C 0E102C
- 2.5 800E03DC 0E0FDC
- 2.6 800E038C 0E0F8C
- 2.7 800E033C 0E0F3C
- 2.8 800E02EC 0E0EEC
- 2.9 800E029C 0E0E9C
- ------------------------------
- 2.0 Wario 800E1E74
- ------------------------------
- 2.1 800E1C50 0E2850
- 2.2 800E1C00 0E2800
- 2.3 800E1BB0 0E27B0
- 2.4 800E1B60 0E2760
- 2.5 800E1B10 0E2710
- 2.6 800E1AC0 0E26C0
- 2.7 800E1A70 0E2670
- 2.8 800E1A20 0E2620
- 2.9 800E19D0 0E25D0
- ------------------------------
- 2.0 Peach 800E1E98
- ------------------------------
- 2.1 800E1494 0E2094
- 2.2 800E1444 0E2044
- 2.3 800E13F4 0E1FF4
- 2.4 800E13A4 0E1FA4
- 2.5 800E1354 0E1F54
- 2.6 800E1304 0E1F04
- 2.7 800E12B4 0E1EB4
- 2.8 800E1264 0E1E64
- 2.9 800E1214 0E1E14
- ------------------------------
- 2.0 Bowser 800E1EBC
- ------------------------------
- 2.1 800E0CD8 0E18D8
- 2.2 800E0C88 0E1888
- 2.3 800E0C38 0E1838
- 2.4 800E0BE8 0E17E8
- 2.5 800E0B98 0E1798
- 2.6 800E0B48 0E1748
- 2.7 800E0AF8 0E16F8
- 2.8 800E0AA8 0E16A8
- 2.9 800E0A58 0E1658
- Kart Texture Offset Tables III
- Description: Tumbling kart textures
- Address: 800E2320
- Entries per Table: 32
- Size of Element: 0x900 (2304 bytes)
- Kart Bank Access #: 04, 08
- ============================================
- # Kart RAM ROM
- ------------------------------
- 3.0 Mario 800E1F20 0E2B20
- 3.0 Luigi 800E1FA0 0E2BA0
- 3.0 Yoshi 800E2120 0E2D20
- 3.0 Toad 800E20A0 0E2CA0
- 3.0 DK 800E21A0 0E2DA0
- 3.0 Wario 800E22A0 0E2EA0
- 3.0 Peach 800E2220 0E2E20
- 3.0 Bowser 800E2020 0E2C20
- ############################################
- Palettes
- ############################################
- Kart Palettes
- Address: 800E2340 (0E2F40)
- Elements per Table: 8
- Size of Element: 0x200 (512 bytes)
- Kart Bank Access #: 10, 11
- ============================================
- Palette Tables I
- Description: Wheel palettes?
- Address: 800DDE34
- Elements per Table: 9
- Size of Element: 0x80 (128 bytes)
- Kart Bank Access #: 13
- ============================================
- # Kart RAM ROM
- ------------------------------
- 1.0 Mario 800DDBF4 0DE7F4
- 1.0 Luigi 800DDC3C 0DE83C
- 1.0 Yoshi 800DDD14 0DE914
- 1.0 Toad 800DDCCC 0DE8CC
- 1.0 DK 800DDD5C 0DE95C
- 1.0 Wario 800DDDEC 0DE9EC
- 1.0 Peach 800DDDA4 0DE9A4
- 1.0 Bowser 800DDC84 0DE884
- Palette Tables II
- Description: Wheel palettes?
- Address: 800DE54
- Elements per Table: 9
- Size Of Element: 0x80 (128 bytes)
- Kart Bank Access #: 13
- ============================================
- # Kart RAM ROM
- ------------------------------
- 2.0 Mario 800DDC18 0DE818
- 2.0 Luigi 800DDC60 0DE860
- 2.0 Yoshi 800DDD38 0DE938
- 2.0 Toad 800DDCF0 0DE8F0
- 2.0 DK 800DDD80 0DE980
- 2.0 Wario 800DDE10 0DEA10
- 2.0 Peach 800DDDC8 0DE9C8
- 2.0 Bowser 800DDCA8 0DE8A8
- ############################################
- Hard-coded offsets into kart bank
- ############################################
- These kart bank offsets are written to 80162DE4 at run-time and loaded
- from the kart bank at access #1. These offsets are actually outside
- of what is believed to be the kart bank??? I've never seen a breakpoint
- at access #1 actually get hit, so who knows what it's for.
- RAM of write ROM of write Value written
- 800050C4 05CC4 0F508E10
- 80005128 05D28 0F50AD04
- 80005190 05D90 0F509CAC
- P.S. Thanks a million to Zoinkity and shygoo for their help with this!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement