Extract LF tilesets and some game data, more docs (#54)

Co-authored-by: Oliver Bell <freshollie@gmail.com>
This commit is contained in:
JaceCearandOliver Bell authored and GitHub committed 2023-02-17 12:22:50 +00:00
1 parent f0ca856f3a
commit 3c9893e8b3
42 files changed
+1189 -136

No files matched your search

+7 -7
View File
@@ -3743,7 +3743,7 @@ _0800982A:
add r0, sp, #0xc
bl sub_80044D8
ldr r0, [r5]
ldr r1, _08009850 @ =gObjTiles_8bpp
ldr r1, _08009850 @ =Palette_Stage_LeafForest_Act1
movs r2, #0
str r2, [sp]
add r3, sp, #0xc
@@ -3758,7 +3758,7 @@ _08009848:
pop {r0}
bx r0
.align 2, 0
_08009850: .4byte gObjTiles_8bpp
_08009850: .4byte Palette_Stage_LeafForest_Act1
thumb_func_start sub_8009854
sub_8009854: @ 0x08009854
@@ -3780,7 +3780,7 @@ sub_8009854: @ 0x08009854
orrs r0, r1
str r0, [r2]
ldr r0, [r4]
ldr r1, _080098B4 @ =gObjTiles_8bpp
ldr r1, _080098B4 @ =Palette_Stage_LeafForest_Act1
str r3, [sp]
ldr r2, _080098B8 @ =gUnknown_080D5128
str r2, [sp, #4]
@@ -3804,7 +3804,7 @@ _080098A4: .4byte gCurTask
_080098A8: .4byte gBgPalette
_080098AC: .4byte 0x00007FFF
_080098B0: .4byte gFlags
_080098B4: .4byte gObjTiles_8bpp
_080098B4: .4byte Palette_Stage_LeafForest_Act1
_080098B8: .4byte gUnknown_080D5128
_080098BC: .4byte sub_8009780
@@ -5302,7 +5302,7 @@ sub_800A4CC: @ 0x0800A4CC
push {lr}
sub sp, #0xc
ldr r0, _0800A500 @ =0x06000020
ldr r1, _0800A504 @ =gObjTiles_8bpp
ldr r1, _0800A504 @ =Palette_Stage_LeafForest_Act1
movs r2, #2
str r2, [sp]
ldr r2, _0800A508 @ =gUnknown_080D5130
@@ -5325,7 +5325,7 @@ _0800A4F8:
bx r0
.align 2, 0
_0800A500: .4byte 0x06000020
_0800A504: .4byte gObjTiles_8bpp
_0800A504: .4byte Palette_Stage_LeafForest_Act1
_0800A508: .4byte gUnknown_080D5130
_0800A50C: .4byte gPressedKeys
@@ -6478,7 +6478,7 @@ sub_800AE58: @ 0x0800AE58
bx lr
.align 2, 0
_0800AE80: .4byte 0x040000D4
_0800AE84: .4byte gUnknown_086EA408
_0800AE84: .4byte (Tileset_Stage_LeafForest_Act1+(32 * TILE_SIZE_4BPP))
_0800AE88: .4byte 0x06017EC0
_0800AE8C: .4byte 0x800000A0
_0800AE90: .4byte gObjPalette
+11 -101
View File
@@ -3,100 +3,6 @@
.section .rodata
.global gUnknown_080D57DC
gUnknown_080D57DC:
.incbin "baserom.gba", 0x000D57DC, 0x88
.global gUnknown_080D5864
gUnknown_080D5864:
.incbin "baserom.gba", 0x000D5864, 0x100
.global gUnknown_080D5964
gUnknown_080D5964:
.incbin "baserom.gba", 0x000D5964, 0x24
.global gUnknown_080D5988
gUnknown_080D5988:
.incbin "baserom.gba", 0x000D5988, 0x88
.global gUnknown_080D5A10
gUnknown_080D5A10:
.incbin "baserom.gba", 0x000D5A10, 0x88
.global gUnknown_080D5A98
gUnknown_080D5A98:
.incbin "baserom.gba", 0x000D5A98, 0x88
.global gUnknown_080D5B20
gUnknown_080D5B20:
.byte 14
.global gUnknown_080D5B21
gUnknown_080D5B21:
.byte 0
.global gUnknown_080D5B22
gUnknown_080D5B22:
.incbin "baserom.gba", 0x000D5B22, 0x2E
.global gUnknown_080D5B50
gUnknown_080D5B50:
.incbin "baserom.gba", 0x000D5B50, 0xA0
.global gUnknown_080D5BF0
gUnknown_080D5BF0:
.incbin "baserom.gba", 0x000D5BF0, 0x12
.global gUnknown_080D5C02
gUnknown_080D5C02:
.incbin "baserom.gba", 0x000D5C02, 0x2
.global gUnknown_080D5C04
gUnknown_080D5C04:
.incbin "baserom.gba", 0x000D5C04, 0x5E
.global gUnknown_080D5C62
gUnknown_080D5C62:
.incbin "baserom.gba", 0x000D5C62, 0x20
.global gUnknown_080D5C82
gUnknown_080D5C82:
.incbin "baserom.gba", 0x000D5C82, 0x20
.global gUnknown_080D5CA2
gUnknown_080D5CA2:
.incbin "baserom.gba", 0x000D5CA2, 0x20
.global gUnknown_080D5CC2
gUnknown_080D5CC2:
.incbin "baserom.gba", 0x000D5CC2, 0x22
@; Not sure whether the size is correct, here.
@; It should be (2 MapHeader pointers + 1 Background-Map pointer) * number_of_maps (which is 31)
.global gMapHeaders
gMapHeaders:
.incbin "baserom.gba", 0x000D5CE4, 0x5F4
.global gUnknown_080D62D8
gUnknown_080D62D8:
.incbin "baserom.gba", 0x000D62D8, 0x7C
.global gUnknown_080D6354
gUnknown_080D6354:
.incbin "baserom.gba", 0x000D6354, 0x20
@; Spawn positions are (count from the top-left of the map):
@; .2byte xPixels
@; .2byte yPixels
.global gSpawnPositions
gSpawnPositions:
.incbin "baserom.gba", 0x000D6374, 0x88
@ Referenced by Interactable "Checkpoint"
.global gUnknown_080D63FC
gUnknown_080D63FC:
.incbin "baserom.gba", 0x000D63FC, 0x110
.global gUnknown_080D650C
gUnknown_080D650C:
.incbin "baserom.gba", 0x000D650C, 0x110
@@ -105,9 +11,10 @@ gUnknown_080D650C:
gUnknown_080D661C:
.incbin "baserom.gba", 0x000D661C, 0x110
@; These very likely represent an idle animation index for each character
.global gUnknown_080D672C
gUnknown_080D672C:
.2byte 0, 0x5B, 0xB6, 0x111, 0x16C
.2byte 0, 91, 182, 273, 364
.global gUnknown_080D6736
gUnknown_080D6736:
@@ -2053,11 +1960,14 @@ sub_801E118: @ 0x0801E118
bx lr
.align 2, 0
_0801E128: .4byte gBgScrollRegs
_0801E12C:
.byte 0x70, 0x47, 0x00, 0x00
thumb_func_start nullsub_8002A34_1
nullsub_8002A34_1: @ 0x0801E130
thumb_func_start sub_801E12C
sub_801E12C:
bx lr
.align 2, 0
thumb_func_start sub_801E130
sub_801E130: @ 0x0801E130
bx lr
.align 2, 0
@@ -4658,7 +4568,7 @@ _0801F43A:
_0801F43C:
mov r6, r8
adds r6, #0x1c
ldr r5, _0801F484 @ =gUnknown_080D6354
ldr r5, _0801F484 @ =sAnimData_StageGoalScoreBonus
lsls r4, r7, #1
adds r4, r4, r7
lsls r4, r4, #1
@@ -4692,7 +4602,7 @@ _0801F474:
pop {r1}
bx r1
.align 2, 0
_0801F484: .4byte gUnknown_080D6354
_0801F484: .4byte sAnimData_StageGoalScoreBonus
thumb_func_start sub_801F488
sub_801F488: @ 0x0801F488
+7 -1
View File
@@ -1 +1,7 @@
.include "asm/macros/function.inc"
.include "asm/macros/misc.inc"
.include "asm/macros/animations.inc"
.include "asm/macros/function.inc"
.include "asm/macros/m4a.inc"
.include "asm/macros/maps.inc"
.include "asm/macros/music_voice.inc"
+17
View File
@@ -0,0 +1,17 @@
@ TODO: Replace MapHeaders in ASM format with C structs
.macro MapHeader_BG xTiles:req, yTiles:req, animTileSize:req, animFrameCount:req, animDelay:req, tileset:req, num_colors:req, palette:req, palOffset:req, palLength:req, metatiles:req, map:req
.2byte \xTiles, \yTiles
.2byte \animTileSize
.byte \animFrameCount, \animDelay
.4byte \tileset, \num_colors
.4byte \palette
.2byte \palOffset, \palLength
.4byte \metatiles
.4byte \map
.endm
.macro MapHeader xTiles:req, yTiles:req, animTileSize:req, animFrameCount:req, animDelay:req, tileset:req, num_colors:req, palette:req, palOffset:req, palLength:req, metatiles:req, map:req, width:req, height:req
MapHeader_BG \xTiles, \yTiles, \animTileSize, \animFrameCount, \animDelay, \tileset, \num_colors, \palette, \palOffset, \palLength, \metatiles, \map
.2byte \width, \height
.endm
+3
View File
@@ -0,0 +1,3 @@
.macro mDataSize label:req
.size \label, .-\label
.endm
+6
View File
@@ -17,3 +17,9 @@
.set SPRITE_SIZE_8x32, (OAM_SIZE_1 >> 28) | (OAM_V_RECTANGLE >> 14)
.set SPRITE_SIZE_16x32, (OAM_SIZE_2 >> 28) | (OAM_V_RECTANGLE >> 14)
.set SPRITE_SIZE_32x64, (OAM_SIZE_3 >> 28) | (OAM_V_RECTANGLE >> 14)
.set TILE_SIZE_4BPP, (8*8 / 2) @ <= 32 (0x20)
.set TILE_SIZE_8BPP, (8*8) @ <= 64 (0x40)
.set METATILE_WIDTH, 12
.set METATILE_HEIGHT, 12
+354 -4
View File
@@ -1,5 +1,355 @@
.include "constants/constants.inc"
.include "asm/macros.inc"
.section .rodata
.global gUnknown_086EA408
gUnknown_086EA408:
.incbin "baserom.gba", 0x006EA408, 0x3E3870
@ TODO: Include as much data in C files as possible
@ NOTE: Sometimes in the codebase, there is pointers to inside the tileset data.
@ Set these pointers to:
@ (<Beginning_of_Tileset> + (tile_count * TILE_SIZE_4BPP))
@ NOTE: For some reason each level (except for the dummies) has a different tileset, even those that are visually identical.
@ Palettes are also stored as copies of each level.
@ We will just include the same file in those instances, unless there is actually a difference of course.
@ It is something to keep in mind in case one wants to port the game to other platforms down the line.
@
@ --- Leaf Forest ---
@
@
@ --- Leaf Forest - Act 1 ---
@
.global Palette_Stage_LeafForest_Act1
Palette_Stage_LeafForest_Act1: @ 0x086E9E08
.incbin "graphics/tilesets/zones/1_leaf_forest/tileset.gbapal"
mDataSize Palette_Stage_LeafForest_Act1
.global Tileset_Stage_LeafForest_Act1
Tileset_Stage_LeafForest_Act1: @ 0x086EA008
.incbin "graphics/tilesets/zones/1_leaf_forest/tileset_act1.4bpp"
mDataSize Tileset_Stage_LeafForest_Act1
.global gUnknown_086F12A8
gUnknown_086F12A8: @ 0x086F12A8
.incbin "data/maps/zone1/act1/gUnknown_086F12A8.bin"
mDataSize gUnknown_086F12A8
.global gUnknown_086F2F50
gUnknown_086F2F50:
.incbin "data/maps/zone1/act1/gUnknown_086F2F50.bin"
mDataSize gUnknown_086F2F50
.global gUnknown_086F32E8
gUnknown_086F32E8:
.incbin "data/maps/zone1/act1/gUnknown_086F32E8.bin"
mDataSize gUnknown_086F32E8
.global Metatiles_Stage_LeafForest_Act1
Metatiles_Stage_LeafForest_Act1: @ 0x086F33D0
.incbin "data/maps/zone1/act1/metatiles.bin"
mDataSize Metatiles_Stage_LeafForest_Act1
.global Map_Stage_LeafForest_Act1_FrontLayer
Map_Stage_LeafForest_Act1_FrontLayer: @ 0x0870DE30
.incbin "data/maps/zone1/act1/map_front.bin"
mDataSize Map_Stage_LeafForest_Act1_FrontLayer
.global Map_Stage_LeafForest_Act1_BackLayer
Map_Stage_LeafForest_Act1_BackLayer:
.incbin "data/maps/zone1/act1/map_back.bin"
mDataSize Map_Stage_LeafForest_Act1_BackLayer
.global MapHeader_LeafForest_Act1_FrontLayer
MapHeader_LeafForest_Act1_FrontLayer: @ 0x08714530
MapHeader METATILE_WIDTH, METATILE_HEIGHT, 0, 0, 0, Tileset_Stage_LeafForest_Act1, 0x72A0, Palette_Stage_LeafForest_Act1, 0, 0x100, Metatiles_Stage_LeafForest_Act1, Map_Stage_LeafForest_Act1_FrontLayer, 206, 32
mDataSize MapHeader_LeafForest_Act1_FrontLayer
.global MapHeader_LeafForest_Act1_BackLayer
MapHeader_LeafForest_Act1_BackLayer: @ 0x08714554
MapHeader METATILE_WIDTH, METATILE_HEIGHT, 0, 0, 0, Tileset_Stage_LeafForest_Act1, 0x72A0, Palette_Stage_LeafForest_Act1, 0, 0x100, Metatiles_Stage_LeafForest_Act1, Map_Stage_LeafForest_Act1_BackLayer, 206, 32
mDataSize MapHeader_LeafForest_Act1_BackLayer
.global gUnknown_08714578
gUnknown_08714578:
.4byte gUnknown_086F12A8, gUnknown_086F2F50
.4byte Metatiles_Stage_LeafForest_Act1, Map_Stage_LeafForest_Act1_FrontLayer
.4byte Map_Stage_LeafForest_Act1_BackLayer, gUnknown_086F32E8
.2byte 206, 32 @ Level Dimensions
.byte 64, 77, 0, 0 @ TODO: not sure about this being .byte
.2byte 0x0C00, 0x0000
mDataSize gUnknown_08714578
@
@ --- Leaf Forest - Act 2 ---
@
.global Palette_Stage_LeafForest_Act2
Palette_Stage_LeafForest_Act2: @ 0x0871459C
.incbin "graphics/tilesets/zones/1_leaf_forest/tileset.gbapal"
mDataSize Palette_Stage_LeafForest_Act2
.global Tileset_Stage_LeafForest_Act2
Tileset_Stage_LeafForest_Act2: @ 0x0871479C
.incbin "graphics/tilesets/zones/1_leaf_forest/tileset_act2.4bpp"
mDataSize Tileset_Stage_LeafForest_Act2
.global gUnknown_0871B4DC
gUnknown_0871B4DC: @ 0x0871B4DC
.incbin "data/maps/zone1/act2/gUnknown_0871B4DC.bin"
mDataSize gUnknown_0871B4DC
.global gUnknown_0871D02C
gUnknown_0871D02C: @ 0x0871D02C
.incbin "data/maps/zone1/act2/gUnknown_0871D02C.bin"
mDataSize gUnknown_0871D02C
.global gUnknown_0871D398
gUnknown_0871D398: @ 0x0871D398
.incbin "data/maps/zone1/act2/gUnknown_0871D398.bin"
mDataSize gUnknown_0871D398
.global Metatiles_Stage_LeafForest_Act2
Metatiles_Stage_LeafForest_Act2: @ 0x0871D474
.incbin "data/maps/zone1/act2/metatiles.bin"
mDataSize Metatiles_Stage_LeafForest_Act2
.global Map_Stage_LeafForest_Act2_FrontLayer
Map_Stage_LeafForest_Act2_FrontLayer: @ 0x087352F4
.incbin "data/maps/zone1/act2/map_front.bin"
.global Map_Stage_LeafForest_Act2_BackLayer
Map_Stage_LeafForest_Act2_BackLayer: @ 0x08737B60
.incbin "data/maps/zone1/act2/map_back.bin"
.global MapHeader_LeafForest_Act2_FrontLayer
MapHeader_LeafForest_Act2_FrontLayer: @ 0x0873A3CC
MapHeader METATILE_WIDTH, METATILE_HEIGHT, 0, 0, 0, Tileset_Stage_LeafForest_Act2, 0x6D40, Palette_Stage_LeafForest_Act2, 0, 0x100, Metatiles_Stage_LeafForest_Act2, Map_Stage_LeafForest_Act2_FrontLayer, 199, 26
mDataSize MapHeader_LeafForest_Act2_FrontLayer
.global MapHeader_LeafForest_Act2_BackLayer
MapHeader_LeafForest_Act2_BackLayer: @ 0x0873A3F0
MapHeader METATILE_WIDTH, METATILE_HEIGHT, 0, 0, 0, Tileset_Stage_LeafForest_Act2, 0x6D40, Palette_Stage_LeafForest_Act2, 0, 0x100, Metatiles_Stage_LeafForest_Act2, Map_Stage_LeafForest_Act2_BackLayer, 199, 26
mDataSize MapHeader_LeafForest_Act2_BackLayer
.global gUnknown_0873A414
gUnknown_0873A414: @ 0x0873A414
.4byte gUnknown_0871B4DC, gUnknown_0871D02C
.4byte Metatiles_Stage_LeafForest_Act2, Map_Stage_LeafForest_Act2_FrontLayer
.4byte Map_Stage_LeafForest_Act2_BackLayer, gUnknown_0871D398
.2byte 199, 26 @ Level Dimensions
.byte 160, 74, 0, 0 @ TODO: not sure about this being .byte
.2byte 0x09C0, 0x0000
mDataSize gUnknown_0873A414
@
@ --- Leaf Forest - Boss ---
@
.global Palette_Stage_LeafForest_Boss
Palette_Stage_LeafForest_Boss: @ 0x0873A438
.incbin "graphics/tilesets/zones/1_leaf_forest/tileset.gbapal"
mDataSize Palette_Stage_LeafForest_Boss
.global Tileset_Stage_LeafForest_Boss
Tileset_Stage_LeafForest_Boss: @ 0x0873A638
.incbin "graphics/tilesets/zones/1_leaf_forest/tileset_boss.4bpp"
mDataSize Tileset_Stage_LeafForest_Boss
.global gUnknown_0873B438
gUnknown_0873B438: @ 0x0873B438
.incbin "data/maps/zone1/boss/gUnknown_0873B438.bin"
mDataSize gUnknown_0873B438
.global gUnknown_0873B7B8
gUnknown_0873B7B8: @ 0x0873B7B8
.incbin "data/maps/zone1/boss/gUnknown_0873B7B8.bin"
mDataSize gUnknown_0873B7B8
.global gUnknown_0873B828
gUnknown_0873B828: @ 0x0873B828
.incbin "data/maps/zone1/boss/gUnknown_0873B828.bin"
mDataSize gUnknown_0873B828
.global Metatiles_Stage_LeafForest_Boss
Metatiles_Stage_LeafForest_Boss: @ 0x0873B844
.incbin "data/maps/zone1/boss/metatiles.bin"
mDataSize Metatiles_Stage_LeafForest_Boss
.global Map_Stage_LeafForest_Boss_FrontLayer
Map_Stage_LeafForest_Boss_FrontLayer: @ 0x0873BDE4
.incbin "data/maps/zone1/boss/map_front.bin"
mDataSize Map_Stage_LeafForest_Boss_FrontLayer
.global Map_Stage_LeafForest_Boss_BackLayer
Map_Stage_LeafForest_Boss_BackLayer: @ 0x0873BF4C
.incbin "data/maps/zone1/boss/map_back.bin"
mDataSize Map_Stage_LeafForest_Boss_BackLayer
.global MapHeader_LeafForest_Boss_FrontLayer
MapHeader_LeafForest_Boss_FrontLayer: @ 0x0873C0B4
MapHeader METATILE_WIDTH, METATILE_HEIGHT, 0, 0, 0, Tileset_Stage_LeafForest_Boss, 0x0E00, Palette_Stage_LeafForest_Boss, 0, 0x100, Metatiles_Stage_LeafForest_Boss, Map_Stage_LeafForest_Boss_FrontLayer, 60, 3
mDataSize MapHeader_LeafForest_Boss_FrontLayer
.global MapHeader_LeafForest_Boss_BackLayer
MapHeader_LeafForest_Boss_BackLayer: @ 0x0873C0D8
MapHeader METATILE_WIDTH, METATILE_HEIGHT, 0, 0, 0, Tileset_Stage_LeafForest_Boss, 0x0E00, Palette_Stage_LeafForest_Boss, 0, 0x100, Metatiles_Stage_LeafForest_Boss, Map_Stage_LeafForest_Boss_BackLayer, 60, 3
mDataSize MapHeader_LeafForest_Boss_BackLayer
.global gUnknown_087C0FC
gUnknown_087C0FC: @ 0x087C0FC
.4byte gUnknown_0873B438, gUnknown_0873B7B8
.4byte Metatiles_Stage_LeafForest_Boss, Map_Stage_LeafForest_Boss_FrontLayer
.4byte Map_Stage_LeafForest_Boss_BackLayer, gUnknown_0873B828
.2byte 60, 3 @ Level Dimensions
.byte 128, 22, 0, 0 @ TODO: not sure about this being .byte
.2byte 0x0120, 0x0000
mDataSize gUnknown_087C0FC
@
@ --- Dummy Map ---
@
@ MapHeaders, not part of the file itself (starting @ 0x080D5CE4)
@ 0x08714530 0x08714554 0x08935224 @ Leaf Forest Act 1
@ 0x0873A3CC 0x0873A3F0 0x08935224 @ Leaf Forest Act 2
@ 0x0873C0B4 0x0873C0D8 0x08935224 @ Leaf Forest Boss
@ 0x0873CC44 0x0873CC68 0x0894E04C @ Dummy
@ 0x08763A34 0x08763A58 0x0894158C @ Hot Crater Act 1
@ 0x0878FE50 0x0878FE74 0x0894158C @ Hot Crater Act 2
@ 0x08792730 0x08792754 0x0894158C @ Hot Crater Boss
@ 0x0873CC44 0x0873CC68 0x08935224 @ Dummy
@ 0x087B8E14 0x087B8E38 0x0893805C @ Music Plant Act 1
@ 0x087DB730 0x087DB754 0x0893805C @ Music Plant Act 2
@ 0x087DCB1C 0x087DCB40 0x0893805C @ Music Plant Boss
@ 0x0873CC44 0x0873CC68 0x0893805C @ Dummy
@ 0x0880C528 0x0880C54C 0x0893BBF4 @ Ice Paradise Act 1
@ 0x088343E4 0x08834408 0x0893BBF4 @ Ice Paradise Act 2
@ 0x08835D70 0x08835D94 0x0893BBF4 @ Ice Paradise Boss
@ 0x0873CC44 0x0873CC68 0x0893BBF4 @ Dummy
@ 0x0885DB08 0x0885DB2C 0x08944B84 @ Sky Canyon Act 1
@ 0x08885A48 0x08885A6C 0x08944B84 @ Sky Canyon Act 2
@ 0x0888768C 0x088876B0 0x08944B84 @ Sky Canyon Boss
@ 0x0873CC44 0x0873CC68 0x08944B84 @ Dummy
@ 0x088A9128 0x088A914C 0x08949418 @ Techno Base Act 1
@ 0x088C2630 0x088C2654 0x08949418 @ Techno Base Act 2
@ 0x088C56B8 0x088C56DC 0x08949418 @ Techno Base Boss
@ 0x0873CC44 0x0873CC68 0x08949418 @ Dummy
@ 0x088F7D64 0x088F7D88 0x08947EFC @ Egg Utopia Act 1
@ 0x08924E14 0x08924E38 0x08947EFC @ Egg Utopia Act 2
@ 0x08925C84 0x08925CA8 0x08947EFC @ Egg Utopia Boss
@ 0x0873CC44 0x0873CC68 0x08947EFC @ Dummy
@ 0x0892ECE0 0x0892ED04 0x0894E04C @ Final Zone - XX
@ 0x0892F4D4 0x0892F4F8 0x08950508 @ True Area 53
@ 0x08933538 0x0893355C 0x089520C4 @ Leftover - w/out tileset
@ Unknown Graphics Data Pointers
@ Also NOT part of this file - just for keeping an overview on the pointers
@ >> Start: @ 0x80D5E58
@ 00000000 080E8DF4 080F1800
@ 080F2EAC 080F40B8 08954330
@ 0895501C 08957440 08957CCC
@ 08958558 08958DE4 08959670
@ 0895E4AC 08982628 0895EF08
@ 0895F5F4 08962A54 08963490
@ 08963ECC 089DCCBC 089362C0
@ 0897DBE0 0897E5AC 08967DA8
@ 0896BD04 0896FBC0 08973B9C
@ 08977B58 0897B9D4 0897F1A8
@ 0897F894 0897FE48 08980348
@ 089810E4 089D47E4 089D5F70
@ 089D779C 089D9168 089DAA34
@ 089DC280 08995ADC 08997FAC
@ 08995250 08994724 0898F338
@ 08996E54 0899E530 089983B8
@ 08999324 08999730 0899A53C
@ 0899A948 0899B934 0899BD40
@ 0899CC0C 0899D018 0899DE44
@ 089DD218 089DD924 089977A0
@ 089A434C 089A5868 089AAE44
@ 089AD6E0 089B2D3C 089B4DF8
@ 089BA514 089BBA30 089C124C
@ 089C3AC8 089C9D24 089CBDE0
@ 089D107C 089D30D8 0894A274
@ 0894AE50 089DE480 08ACDC5C
@ 08A41A3C 08A48D44 08A4C6AC
@ 08A528C0 08A59804 08A5D8B0
@ 08A6107C 08A64768 08A685D4
@ 08A6A144 08A7ECBC 08A6BFB0
@ 08A70CE8 08A75CC0 08A7A298
@ 08A83674 08A9A5CC 08A8816C
@ 08A8AEC4 08A906DC 08A95994
@ 08A9F124 08AB75FC 08AA455C
@ 08AA8F34 08AAE04C 08AB2D64
@ 08ABBC38 08A427DC 08AC1090
@ 08AC5EE8 08AC93B4 08A3D474
@ 08A49D84 08A63018 08A66C24
@ 08A5BFA0 08A5F3CC 089454E0
@ 08A6E57C 08A73434 08A7834C
@ 08A7C984 08A81408 08A85D80
@ 08A8D990 08A93188 08A9D078
@ 08AA1BB0 08AA6CA8 08AAB6C0
@ 08AB0878 08AB5750 08ABA0E8
@ 08ABE724 08A98480 08AC343C
@ 08AC8074 08ACB660 08A3F460
@ 08A449C8 08A4FBF8 08A55E4C
@ 08A4AC10 08A50564 08A56AD8
@ 08A5CE0C 08A602F8 08A63D64
@ 08A67930 08A69480 08A6AE30
@ 08A6FB08 08A748E0 08A792F8
@ 08A7D990 08A82414 08A8704C
@ 08A89E64 08A8F3BC 08A948F4
@ 08A9948C 08A9DCC4 08AA355C
@ 08AA7BF4 08AACE0C 08AB1884
@ 08AB627C 08ABAAD8 08AC03D0
@ 089E3B9C 089E4978 089E5214
@ 089E80F4 089EB454 089ED8E0
@ 089F2EFC 089F9AB8 08A00D74
@ 089F0468 089F6D04 089FD9A0
@ 08A03ABC 08A0732C 089EE328
@ 089F3D24 089FA7C0 08A0195C
@ 08A04B8C 089EED70 089F478C
@ 089FB148 08A021A4 08A052B4
@ 089EF558 089F5994 089FBFD0
@ 08A02AEC 08A059DC 089EFBE0
@ 089F623C 089FCEF8 08A032D4
@ 08A06484 089F0B30 089F764C
@ 089FE9A8 08A04464 08A07C74
@ 08A0A140 08A0F8FC 08A162D8
@ 08A1BAF4 08A0CF48 08A136C4
@ 08A18D00 08A1EE3C 08A2284C
@ 08A0AD88 08A10604 08A16DA0
@ 08A1C6DC 08A1FEAC 08A0B6B0
@ 08A10F4C 08A175A8 08A1D024
@ 08A20614 08A0BFD8 08A11EB4
@ 08A17C90 08A1DCCC 08A20D3C
@ 08A0C820 08A12D3C 08A183F8
@ 08A1E594 08A218A4 08A0D810
@ 08A13FCC 08A19808 08A1F744
@ 08A23274 08A25760 08A29BBC
@ 08A30D38 08A36754 08A27368
@ 08A2DD84 08A337C0 08A3863C
@ 08A3BA0C 08A25E08 08A2AC44
@ 08A317A0 08A36EBC 08A3934C
@ 08A26330 08A2B64C 08A31FE8
@ 08A37464 08A39A74 08A26818
@ 08A2C0B4 08A32790 08A37A4C
@ 08A3A15C 08A26D40 08A2D17C
@ 08A32F38 08A37FB4 08A3AB04
@ 08A278F0 08A2ED6C 08A34368
@ 08A38C64 08A3C334 08983E94
@ 089393F8 08942648 0893C890
@ 08950508 08955AB8 08956BB4
@ 089851CC 089879C8 0898A244
@ 0898CAC0 0898EC2C 08947EFC
@ >> End: @ 0x080D62D8
.incbin "baserom.gba", 0x0073C120, (0x00ACDC78-0x0073C120)
@ >> 0x08ACDC78
+12
View File
@@ -0,0 +1,12 @@
#include "global.h"
#define METATILE_WIDTH 12
#define METATILE_HEIGHT 12
// 08 A0 6E 08 A0 72 00 00 08 9E 6E 08 00 00 00 01 D0 33 6F 08 30 DE 70 08 CE 00 20 00
extern u8 Tileset_Stage_LeafForest[];
//{{METATILE_WIDTH, METATILE_HEIGHT, 0, 0, 0, 0, Tileset_Stage_LeafForest,
// sizeof(Tileset_Stage_LeafForest), Palette_Tileset_Stage_LeafForest,
// palOffset, sizeof(Palette_Tileset_Stage_LeafForest), metatiles, map}, 206, 32};
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
��������������
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5 -2
View File
@@ -7,7 +7,7 @@ gSpriteTables: @ 0x080F40D4
.4byte gSpriteOamData
.4byte gSpritePalettes
.4byte gObjTiles_4bpp
.4byte gObjTiles_8bpp
.4byte gObjTiles_8bpp @ 8bpp UNUSED - Read comment below at gObjTiles_8bpp
.include "data/animations/animations.inc"
.include "data/animations/animations_table.inc"
@@ -36,6 +36,9 @@ gSpritePalettes:
gObjTiles_4bpp:
.include "graphics/obj_tiles_4bpp.inc"
@ Unlike the first game, Sonic Advance 2 does not use 8-bits-per-pixel object tiles,
@ but the engine does need a dummy-pointer to 8bpp data.
@ Here it would just turn out to be "garbage" data.
.global gObjTiles_8bpp
gObjTiles_8bpp: @ 0x086E9E08
.incbin "baserom.gba", 0x006E9E08, 0x600
@ DUMMY - NO DATA HERE!
@@ -0,0 +1,259 @@
JASC-PAL
0100
256
172 139 180
222 255 0
164 238 57
90 197 0
57 164 0
57 123 0
16 90 0
41 74 0
32 57 0
197 255 0
164 238 16
131 213 32
98 189 49
65 164 74
32 139 90
0 115 106
0 139 255
255 222 148
255 213 115
246 205 65
238 197 115
255 189 0
238 180 41
205 148 16
180 131 24
189 139 74
131 123 0
123 106 8
139 98 49
90 90 0
41 74 0
32 57 0
172 139 180
255 49 0
222 32 0
156 16 0
98 0 0
255 255 255
205 205 189
115 115 115
8 8 8
49 172 255
65 115 222
65 82 172
49 65 139
255 238 0
255 189 0
255 139 0
49 98 205
131 131 131
172 172 172
213 213 213
255 255 255
180 8 0
255 41 0
255 123 0
255 238 0
49 98 205
57 148 230
74 197 255
131 246 246
57 123 0
41 74 0
32 57 0
0 0 0
255 238 0
255 189 0
238 123 0
180 57 0
164 238 57
90 197 0
57 123 0
16 90 0
49 98 205
57 148 230
74 197 255
131 246 246
255 106 180
255 164 222
255 222 255
0 0 0
246 197 74
180 164 74
123 123 65
57 82 57
0 49 57
0 0 0
0 0 0
222 255 0
164 238 57
90 197 0
57 164 0
57 123 0
16 90 0
41 74 0
32 57 0
255 255 255
115 8 0
164 41 0
213 65 0
255 98 0
255 123 0
255 238 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
222 255 0
164 238 57
90 197 0
57 164 0
57 123 0
16 90 0
41 74 0
32 57 0
238 180 41
255 213 115
180 131 24
123 106 8
90 90 0
205 148 16
139 98 49
0 0 0
255 255 255
255 246 82
255 205 0
255 189 0
255 172 0
57 57 57
115 115 115
172 172 172
213 213 213
255 255 255
131 246 246
74 197 255
57 148 230
49 98 205
49 65 139
0 0 0
255 255 255
131 246 246
74 197 255
57 148 230
49 98 205
57 57 57
0 0 0
0 0 0
0 0 0
0 0 0
131 246 246
74 197 255
57 148 230
49 98 205
0 0 0
172 139 180
222 255 0
255 213 115
230 172 0
164 131 16
115 106 0
74 74 0
41 74 0
32 57 0
197 255 0
164 238 16
131 213 32
98 189 49
65 164 74
32 139 90
0 115 106
172 139 180
164 238 16
98 189 49
65 164 74
32 139 90
0 115 106
115 115 115
8 8 8
49 172 255
65 115 222
65 82 172
49 65 139
172 139 180
172 139 180
172 139 180
255 0 180
255 0 0
131 164 255
246 255 0
230 238 32
205 222 65
172 205 106
131 189 131
65 164 164
0 148 180
0 0 0
0 0 0
246 255 156
238 238 131
189 205 172
139 189 197
82 164 222
0 0 0
255 255 255
213 255 255
164 255 255
106 246 246
57 230 246
49 205 238
41 189 238
0 172 230
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
123 139 255
131 164 255
115 189 255
131 205 255
123 213 255
131 222 255
139 230 255
148 230 255
189 238 255
213 238 255
230 246 255
238 246 255
246 246 255
255 255 255
255 255 255
0 0 0
255 255 255
255 115 82
246 24 0
189 16 0
172 16 0
57 57 57
65 115 222
0 205 255
246 24 0
255 189 0
131 246 246
74 197 255
57 148 230
49 98 205
49 65 139
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

+3
View File
@@ -0,0 +1,3 @@
Tilesets' layouts are stored as 4bpp data, but metatiles contain an index per tile, signifying which palette this tile is using.
So the Tileset data (<stage>.png) is only stored with one palette, while <stage>.pal contains 16 palettes.
+2
View File
@@ -262,6 +262,8 @@
#define SA2_ANIM_SOME_JAPANESE_TXT 868
#define SA2_ANIM_VARIANT_SOME_JAPANESE_TXT_7 7
#define SA2_ANIM_STAGE_GOAL_SCORE_BONUS 871
#define SA2_ANIM_BOOST_EFFECT 873
#define SA2_ANIM_MAIN_MENU 874
#define SA2_ANIM_VARIANT_MAIN_MENU_OPTIONS 3
+2
View File
@@ -11,6 +11,8 @@
#define SIO_MULTI_CNT ((volatile struct SioMultiCnt *)REG_ADDR_SIOCNT)
typedef void (*VoidFn)(void);
// helper macros
#if NON_MATCHING
+1 -1
View File
@@ -97,7 +97,7 @@ struct MapHeader {
}; /* size = 0x20 */
struct MapHeader_Full {
struct MapHeader unk0;
struct MapHeader h;
u16 mapWidth; // in Metatiles
u16 mapHeight; // in Metatiles
};
+9
View File
@@ -0,0 +1,9 @@
#ifndef GUARD_STAGE_H
#define GUARD_STAGE_H
#include "zones.h"
extern const s16 gSpawnPositions[NUM_LEVEL_IDS][2];
extern const u32 gUnknown_080D63FC[NUM_LEVEL_IDS][2];
#endif // GUARD_STAGE_H
+2
View File
@@ -23,6 +23,8 @@
#define LEVEL_INDEX(zone, act) ((zone) * (ACTS_PER_ZONE + 1)) + (act)
#define NUM_LEVEL_IDS 34
#define LEVEL_TO_ZONE(level) ((level) >> 2)
// ((((level) / (ACTS_PER_ZONE + 1)) * 2) | ((level) & 1))
#define LEVEL_TO_COURSE_INDEX(level) \
+2
View File
@@ -201,6 +201,8 @@ SECTIONS
build/sa2/asm/interactable_081.o(.rodata);
build/sa2/asm/interactable_platform_thin.o(.rodata);
build/sa2/asm/entities_1.o(.rodata);
build/sa2/src/game.o(.rodata);
build/sa2/src/stage.o(.rodata);
build/sa2/asm/game.o(.rodata);
build/sa2/data/time_data.o(.rodata);
build/sa2/src/time.o(.rodata);
+147
View File
@@ -0,0 +1,147 @@
from io import BufferedReader
import struct
import sys
address = int(sys.argv[1], 16)
length = int(sys.argv[2], 16)
graphics_data_reference = """
struct GraphicsData {
void *src;
void *dest;
u16 size;
u16 anim;
};
"""
background_reference = """
typedef struct {
struct GraphicsData graphics;
// 'tilesVram' points to tile-index array in VRAM, telling the GBA which tiles to
// draw on this BG
//
// (!!! Data likely different depending on type of Background (Affine vs. Text). !!!)
//
// Data-Structure (16 bits): MSB > PPPPYXTTTTTTTTTT < LSB
// P = Palette Index
// Y = Y-Flip
// X = X-Flip
// T = Tile-Index
//
// NOTE: It does NOT point to the tileset!
// NOTE/TODO (Jace): Should this also be const?
// It's in VRAM, so it doesn't make much sense?
u16 *tilesVram;
u16 *unk10;
u16 unk14;
u16 unk16;
u16 unk18;
u16 unk1A;
// assetId
u16 unk1C;
u16 unk1E;
u16 unk20;
u16 unk22;
u16 unk24;
u16 unk26;
u16 unk28;
u8 unk2A;
u8 animFrameCounter;
u8 animDelayCounter;
u8 unk2D;
// Flags
// 0x200 = something about updating animations (sub_8003638)
u16 unk2E;
// apparently NOT signed?
u16 scrollX;
u16 scrollY;
u16 prevScrollX;
u16 prevScrollY;
u16 *unk38;
u16 unk3C;
u16 unk3E;
} Background;
"""
graphics_schema = []
def read_u8(rom: BufferedReader):
return struct.unpack('B', rom.read(1))[0]
def read_s8(rom: BufferedReader):
return struct.unpack('b', rom.read(1))[0]
def read_u16(rom: BufferedReader):
return struct.unpack('H', rom.read(2))[0]
def read_s16(rom: BufferedReader):
return struct.unpack('h', rom.read(2))[0]
def read_u32(rom: BufferedReader):
return struct.unpack('I', rom.read(4))[0]
def read_s32(rom: BufferedReader):
return struct.unpack('i', rom.read(4))[0]
def format_hex(val):
return f"0x{hex(val)[2:].upper()}"
def read_graphics_data(rom: BufferedReader):
result = ""
result += "{"
for field, key in graphics_schema:
align, reader = references[key]
while rom.tell() % align != 0:
rom.read(1)
value = reader(rom)
result += f" .{field} = {value},"
result += "}"
return result
references = {
"*": (4, lambda rom: f"(void*){format_hex(read_u32(rom))}"),
"u8": (1, read_u8),
"u16": (2, read_u16),
"u32": (4, read_u32),
"s8": (1, read_s8),
"s16": (2, read_s16),
"s32": (4, read_s32),
"struct GraphicsData": (4, read_graphics_data),
}
for line in graphics_data_reference.split("\n")[2:]:
for key in references:
if key in line:
field = line.split(key)[1].replace(";", "").strip()
graphics_schema.append((field, key))
background_schema = []
for line in background_reference.split("\n")[2:]:
for key in references:
if key in line:
field = line.split(key)[1].replace(";", "").strip()
background_schema.append((field, key))
break
with open('baserom.gba', 'rb') as rom:
end = address + length
rom.seek(address)
while rom.tell() < end:
print("{")
for field, key in background_schema:
align, reader = references[key]
while rom.tell() % align != 0:
rom.read(1)
value = reader(rom)
print(f".{field} = {value},")
print("},")
+275 -8
View File
@@ -43,9 +43,278 @@ void sub_80191A4(void);
extern const u16 gLevelSongs[];
extern const u16 gUnknown_080D5964[][2];
// TODO not TaskMain use an inline type
extern const TaskMain gUnknown_080D57DC[];
void sub_801AF14(void);
void sub_801AFA4(void);
void sub_801B03C(void);
void sub_801B0D4(void);
void sub_801B180(void);
void sub_801B22C(void);
void sub_801B324(void);
void sub_801B41C(void);
void sub_801B4EC(void);
void sub_801B5BC(void);
void sub_801B7BC(void);
void sub_801B83C(void);
void sub_801B8A8(void);
void sub_801B914(void);
void sub_801B980(void);
void sub_801B9EC(void);
void sub_801BA58(void);
void sub_801BAC4(void);
void sub_801BB30(void);
void sub_801BB9C(void);
void sub_801BC88(void);
void sub_801BC1C(void);
void sub_801BD08(void);
void sub_801BD74(void);
void sub_801BDE0(void);
void sub_801BE4C(void);
void sub_801BEB8(void);
void sub_801BF24(void);
const VoidFn gUnknown_080D57DC[]
= { sub_801AF14, sub_801B7BC, sub_801B83C, sub_801BF24, // Anti-Formatting
sub_801B8A8, sub_801B914, sub_801B980, sub_801BF24, //
sub_801AFA4, sub_801B03C, sub_801B9EC, sub_801BF24, //
sub_801B0D4, sub_801B180, sub_801BA58, sub_801BF24, //
sub_801BAC4, sub_801BB30, sub_801BB9C, sub_801BF24, //
sub_801B22C, sub_801B324, sub_801BC1C, sub_801BF24, //
sub_801B41C, sub_801B4EC, sub_801B5BC, sub_801BF24, //
sub_801BC88, sub_801BD08, sub_801BD74, sub_801BDE0, //
sub_801BE4C, sub_801BEB8 };
const Background gUnknown_080D5864[] = {
{
.graphics = {
.src = NULL,
.dest = (void*)BG_VRAM,
.size = 0,
.anim = 0,
},
.tilesVram = (void*)0x600F000,
.unk10 = NULL,
.unk14 = 0,
.unk16 = 0,
.unk18 = 0,
.unk1A = 0,
.unk1C = 0,
.unk1E = 0,
.unk20 = 0,
.unk22 = 0,
.unk24 = 0,
.unk26 = 31,
.unk28 = 21,
.unk2A = 0,
.animFrameCounter = 0,
.animDelayCounter = 0,
.unk2D = 0,
.unk2E = 121,
.scrollX = 0,
.scrollY = 0,
.prevScrollX = 32767,
.prevScrollY = 32767,
.unk38 = NULL,
.unk3C = 0,
.unk3E = 0,
},
{
.graphics = {
.src = NULL,
.dest = (void*)BG_VRAM,
.size = 0,
.anim = 0,
},
.tilesVram = (void*)0x600F800,
.unk10 = NULL,
.unk14 = 0,
.unk16 = 0,
.unk18 = 0,
.unk1A = 0,
.unk1C = 0,
.unk1E = 0,
.unk20 = 0,
.unk22 = 0,
.unk24 = 0,
.unk26 = 31,
.unk28 = 21,
.unk2A = 0,
.animFrameCounter = 0,
.animDelayCounter = 0,
.unk2D = 0,
.unk2E = 98,
.scrollX = 0,
.scrollY = 0,
.prevScrollX = 32767,
.prevScrollY = 32767,
.unk38 = NULL,
.unk3C = 0,
.unk3E = 0,
},
{
.graphics = {
.src = NULL,
.dest = (void*)0x6008000,
.size = 0,
.anim = 0,
},
.tilesVram = (void*)0x600E800,
.unk10 = NULL,
.unk14 = 0,
.unk16 = 0,
.unk18 = 0,
.unk1A = 0,
.unk1C = 0,
.unk1E = 0,
.unk20 = 0,
.unk22 = 0,
.unk24 = 0,
.unk26 = 32,
.unk28 = 32,
.unk2A = 0,
.animFrameCounter = 0,
.animDelayCounter = 0,
.unk2D = 0,
.unk2E = 19,
.scrollX = 0,
.scrollY = 0,
.prevScrollX = 32767,
.prevScrollY = 32767,
.unk38 = NULL,
.unk3C = 0,
.unk3E = 0,
},
{
.graphics = {
.src = NULL,
.dest = (void*)0x600C000,
.size = 0,
.anim = 0,
},
.tilesVram = (void*)0x600E000,
.unk10 = NULL,
.unk14 = 0,
.unk16 = 0,
.unk18 = 0,
.unk1A = 0,
.unk1C = 0,
.unk1E = 0,
.unk20 = 0,
.unk22 = 0,
.unk24 = 0,
.unk26 = 32,
.unk28 = 32,
.unk2A = 0,
.animFrameCounter = 0,
.animDelayCounter = 0,
.unk2D = 0,
.unk2E = 16,
.scrollX = 0,
.scrollY = 0,
.prevScrollX = 32767,
.prevScrollY = 32767,
.unk38 = NULL,
.unk3C = 0,
.unk3E = 0,
},
};
const u16 gUnknown_080D5964[][2] = {
{ 32, 216 }, { 32, 204 }, { 32, 216 }, { 32, 208 }, { 32, 208 },
{ 32, 232 }, { 32, 264 }, { 32, 264 }, { 32, 264 },
};
void sub_801C774(void);
void sub_801CB74(void);
void sub_801CD7C(void);
void sub_801CEE4(void);
void sub_801D104(void);
void sub_801D1A8(void);
void sub_801D95C(void);
void sub_801DF08(void);
void sub_801E118(void);
void sub_801E12C(void);
const VoidFn gUnknown_080D5988[] = {
sub_801C774, sub_801C774, sub_801C774, NULL, // Anti-Formatting
sub_801E118, sub_801E118, sub_801E118, NULL, //
sub_801CB74, sub_801CB74, sub_801CB74, NULL, //
sub_801CD7C, sub_801CD7C, sub_801E12C, NULL, //
sub_801CEE4, sub_801CEE4, NULL, NULL, //
sub_801D104, sub_801D104, sub_801D1A8, NULL, //
sub_801D95C, sub_801D95C, sub_801D95C, NULL, //
NULL, sub_801DF08, sub_801C774, NULL, //
NULL, NULL,
};
void sub_801C818(s32, s32);
void sub_801C94C(s32, s32);
void sub_801CBE8(s32, s32);
void sub_801CDF0(s32, s32);
void sub_801CF60(s32, s32);
void sub_801D534(s32, s32);
void sub_801E130(s32, s32);
void sub_801E134(s32, s32);
void sub_801E1A4(s32, s32);
void sub_801E1D0(s32, s32);
void sub_801E1E4(s32, s32);
void sub_801E234(s32, s32);
void sub_801E26C(s32, s32);
void sub_801E2E0(s32, s32);
void sub_801E310(s32, s32);
void sub_801E360(s32, s32);
const CameraMain gUnknown_080D5A10[] = {
sub_801C818, sub_801C818, sub_801E134, sub_801E130, // Anti-Formatting
sub_801C94C, sub_801C94C, sub_801E1A4, sub_801E130, //
sub_801CBE8, sub_801CBE8, sub_801E1D0, sub_801E130, //
sub_801CDF0, sub_801CDF0, sub_801E130, sub_801E130, //
sub_801CF60, sub_801CF60, sub_801E1E4, sub_801E130, //
sub_801D534, sub_801D534, sub_801E234, sub_801E130, //
sub_801E26C, sub_801E26C, sub_801E2E0, sub_801E130, //
sub_801E310, sub_801E360, sub_801C818, sub_801C94C, //
sub_801C818, sub_801D534,
};
asm(".global gUnknown_080D5A98\n"
"gUnknown_080D5A98:\n"
" .incbin \"baserom.gba\", 0x000D5A98, 0x88");
const u8 gUnknown_080D5B20 = 14;
const u8 gUnknown_080D5B21 = 0;
asm(" .global gUnknown_080D5B22\n"
"gUnknown_080D5B22:\n"
" .incbin \"baserom.gba\", 0x000D5B22, 0x2E");
asm(" .global gUnknown_080D5B50\n"
"gUnknown_080D5B50:\n"
" .incbin \"baserom.gba\", 0x000D5B50, 0xA0\n");
asm(" .global gUnknown_080D5BF0\n"
"gUnknown_080D5BF0:\n"
" .incbin \"baserom.gba\", 0x000D5BF0, 0x12");
asm(" .global gUnknown_080D5C02\n"
"gUnknown_080D5C02:\n"
" .incbin \"baserom.gba\", 0x000D5C02, 0x2");
asm(" .global gUnknown_080D5C04\n"
"gUnknown_080D5C04:\n"
" .incbin \"baserom.gba\", 0x000D5C04, 0x5E");
asm(" .global gUnknown_080D5C62\n"
"gUnknown_080D5C62:\n"
" .incbin \"baserom.gba\", 0x000D5C62, 0x20");
asm(" .global gUnknown_080D5C82\n"
"gUnknown_080D5C82:\n"
" .incbin \"baserom.gba\", 0x000D5C82, 0x20");
asm(" .global gUnknown_080D5CA2\n"
"gUnknown_080D5CA2:\n"
" .incbin \"baserom.gba\", 0x000D5CA2, 0x20");
// Some palette
asm(" .global gUnknown_080D5CC2\n"
"gUnknown_080D5CC2:\n"
" .incbin \"baserom.gba\", 0x000D5CC2, 0x22");
void ApplyGameStageSettings(void)
{
@@ -1055,8 +1324,6 @@ extern const u32 *gUnknown_080D62D8[];
extern const Background gUnknown_080D5864[4];
extern const TaskMain gUnknown_080D5988[];
extern const CameraMain gUnknown_080D5A10[];
struct Backgrounds {
@@ -1439,7 +1706,7 @@ void sub_801C774(void)
gBgScrollRegs[0][1] = 0;
}
void sub_801C818(void)
void sub_801C818(s32 UNUSED a, s32 UNUSED b)
{
s32 i;
@@ -1601,7 +1868,7 @@ void sub_801CB74(void)
gBgScrollRegs[3][1] = 0;
}
NONMATCH("asm/non_matching/sub_801CBE8.inc", void sub_801CBE8())
NONMATCH("asm/non_matching/sub_801CBE8.inc", void sub_801CBE8(s32 a, s32 b))
{
// TODO: similar to sub_801C94C
}
@@ -1699,7 +1966,7 @@ void sub_801CEE4(void)
gBgScrollRegs[3][1] = 0;
}
void sub_801CF60(void)
void sub_801CF60(s32 UNUSED a, s32 UNUSED b)
{
s32 num;
u16 *cursor, i, val;
+12 -12
View File
@@ -27,15 +27,15 @@ const AnimationCommandFunc animCmdTable_2[12] = {
void sub_8002A3C(Background *background)
{
struct MapHeader_Full *r6 = gUnknown_03002260[background->unk1C].y;
struct MapHeader_Full *mapHeader = gUnknown_03002260[background->unk1C].y;
u16 *pal;
u32 palSize;
u16 gfxSize;
background->unk14 = r6->unk0.xTiles;
background->unk16 = r6->unk0.yTiles;
background->graphics.src = r6->unk0.tileset;
gfxSize = r6->unk0.tilesetSize;
background->unk14 = mapHeader->h.xTiles;
background->unk16 = mapHeader->h.yTiles;
background->graphics.src = mapHeader->h.tileset;
gfxSize = mapHeader->h.tilesetSize;
background->graphics.size = gfxSize;
if (!(background->unk2E & 8)) {
@@ -44,9 +44,9 @@ void sub_8002A3C(Background *background)
background->unk2E ^= 8;
}
pal = r6->unk0.palette;
palSize = r6->unk0.palLength;
background->unk2A = r6->unk0.palOffset;
pal = mapHeader->h.palette;
palSize = mapHeader->h.palLength;
background->unk2A = mapHeader->h.palOffset;
if (!(background->unk2E & 0x10)) {
DmaCopy16(3, pal, gBgPalette + background->unk2A, palSize * sizeof(*pal));
@@ -54,12 +54,12 @@ void sub_8002A3C(Background *background)
background->unk2E ^= 0x10;
}
background->unk10 = r6->unk0.metatiles;
background->unk10 = mapHeader->h.metatiles;
if (background->unk2E & 0x40) { // Can we actually trigger this condition?
background->unk38 = r6->unk0.map;
background->unk3C = r6->mapWidth;
background->unk3E = r6->mapHeight;
background->unk38 = mapHeader->h.map;
background->unk3C = mapHeader->mapWidth;
background->unk3E = mapHeader->mapHeight;
}
gUnknown_03001800[gUnknown_0300287C] = background;
+52
View File
@@ -0,0 +1,52 @@
#include "global.h"
#include "sprite.h"
#include "constants/animations.h"
asm(".section .rodata");
// Not sure whether the size is correct, here.
// It should be (2 MapHeader pointers + 1 Background-Map pointer) * number_of_maps (which
// is 31)
asm(" .global gMapHeaders\n"
"gMapHeaders:\n"
" .incbin \"baserom.gba\", 0x000D5CE4, 0x5F4\n");
asm(" .global gUnknown_080D62D8\n"
"gUnknown_080D62D8:\n"
" .incbin \"baserom.gba\", 0x000D62D8, 0x7C\n");
// Like AnimInfo
const unsigned short sAnimData_StageGoalScoreBonus[5][3] = {
{ 36, SA2_ANIM_STAGE_GOAL_SCORE_BONUS, 1 },
{ 36, SA2_ANIM_STAGE_GOAL_SCORE_BONUS, 2 },
{ 36, SA2_ANIM_STAGE_GOAL_SCORE_BONUS, 3 },
{ 36, SA2_ANIM_STAGE_GOAL_SCORE_BONUS, 4 },
{ 36, SA2_ANIM_STAGE_GOAL_SCORE_BONUS, 5 },
};
ALIGNED(4)
const s16 gSpawnPositions[34][2] = {
{ 96, 655 }, { 96, 750 }, { 576, 175 }, { 32, 150 }, // Zone 1
{ 96, 321 }, { 96, 321 }, { 96, 177 }, { 0, 0 }, // Zone 2
{ 96, 465 }, { 96, 369 }, { 356, 177 }, { 0, 0 }, // Zone 3
{ 96, 273 }, { 96, 1041 }, { 356, 177 }, { 0, 0 }, // Zone 4
{ 96, 3921 }, { 96, 3441 }, { 96, 180 }, { 0, 0 }, // Zone 5
{ 96, 1425 }, { 96, 2097 }, { 480, 177 }, { 0, 0 }, // Zone 6
{ 96, 561 }, { 96, 273 }, { 96, 177 }, { 0, 0 }, // Zone 7
{ 576, 177 }, { 96, 96 }, { 0, 0 }, { 0, 0 }, // Extra Zone
{ 0, 0 }, { 0, 0 },
};
const u32 gUnknown_080D63FC[34][2] = {
{ 8882, 1809 }, { 8206, 1233 }, { 0, 0 }, { 0, 0 }, { 14618, 2577 },
{ 11065, 2769 }, { 0, 0 }, { 0, 0 }, { 13645, 3105 }, { 13450, 1953 },
{ 0, 0 }, { 0, 0 }, { 11952, 2289 }, { 10320, 1474 }, { 0, 0 },
{ 0, 0 }, { 5784, 2673 }, { 10296, 1713 }, { 0, 0 }, { 0, 0 },
{ 14064, 1809 }, { 11280, 1041 }, { 0, 0 }, { 0, 0 }, { 20667, 3489 },
{ 18456, 3441 }, { 0, 0 }, { 0, 0 }, { 96, 849 }, { 96, 96 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
};
asm(".section .text");