Merge pull request #193 from PikalaxALT/leafgreen

Match Pokemon LeafGreen 1.0
This commit is contained in:
PikalaxALT
2019-12-20 15:43:10 -05:00
committed by GitHub
62 changed files with 19211 additions and 3018 deletions
+2
View File
@@ -27,6 +27,8 @@ matrix:
script:
- make tools CXX=g++-7
- make -j2 compare
- make -j2 compare_leafgreen
- make -j2 compare_firered_rev1
- make -j2 compare_leafgreen_rev1
after_success:
- .travis/calcrom/webhook.sh pokefirered
+14 -1
View File
@@ -1,6 +1,6 @@
## Prerequisites
| Linux | macOS | Windows 10 (build 18917+) | Windows 10 (1709+) | Windows Vista, 7, 8, 8.1, and 10 (1507, 1511, 1607, 1703)
| Linux | macOS | Windows 10 (build 18917+) | Windows 10 (1709+) | Windows 8, 8.1, and 10 (1507, 1511, 1607, 1703)
| ----- | ----- | ------------------------- | ------------------ | ---------------------------------------------------------
| none | [Xcode Command Line Tools package][xcode] | [Windows Subsystem for Linux 2][wsl2] | [Windows Subsystem for Linux][wsl] | [Cygwin][cygwin]
@@ -42,4 +42,17 @@ If only `.c` or `.s` files were changed, turn off the dependency scanning tempor
make -j$(nproc) NODEP=1
Convenient targets have been defined to build Pokémon LeafGreen and the 1.1 revisions of both games:
# LeafGreen 1.0
make -j$(nproc) leafgreen
# FireRed 1.1
make -j$(nproc) firered_rev1
# LeafGreen 1.1
make -j$(nproc) leafgreen_rev1
To confirm these match the respective official ROM images, prefix `compare_` to each target name. For example:
make -j$(nproc) compare_leafgreen
**Note:** If the build command is not recognized on Linux, including the Linux environment used within Windows, run `nproc` and replace `$(nproc)` with the returned value (e.g.: `make -j4`). Because `nproc` is not available on macOS, the alternative is `sysctl -n hw.ncpu`.
+3
View File
@@ -10,6 +10,9 @@ This is a disassembly of Pokémon FireRed and LeafGreen.
It builds the following ROM:
* [**pokefirered.gba**](https://datomatic.no-intro.org/?page=show_record&s=23&n=1616) `sha1: 41cb23d8dccc8ebd7c649cd8fbb58eeace6e2fdc`
* [**pokeleafgreen.gba**](https://datomatic.no-intro.org/?page=show_record&s=23&n=1617) `sha1: 574fa542ffebb14be69902d1d36f1ec0a4afd71e`
* [**pokefirered_rev1.gba**](https://datomatic.no-intro.org/?page=show_record&s=23&n=1672) `sha1: dd5945db9b930750cb39d00c84da8571feebf417`
* [**pokeleafgreen_rev1.gba**](https://datomatic.no-intro.org/index.php?page=show_record&s=23&n=1668) `sha1: 7862c67bdecbe21d1d69ce082ce34327e1c6ed5e`
To set up the repository, see [INSTALL.md](INSTALL.md).
+7 -1
View File
@@ -9166,7 +9166,13 @@ _080FCB88:
movs r0, 0x3D
negs r0, r0
ands r0, r2
movs r2, 0x10
.ifdef FIRERED
movs r2, 0x10 @ VERSION_FIRE_RED << 2
.else
.ifdef LEAFGREEN
movs r2, 0x14 @ VERSION_LEAF_GREEN << 2
.endif
.endif
orrs r0, r2
strb r0, [r7, 0x1]
movs r0, 0x11
+57 -7
View File
@@ -11885,7 +11885,13 @@ gMonFootprint_Jirachi:: @ 8E3956C
.align 2
gMonFrontPic_Deoxys:: @ 8E3958C
.ifdef FIRERED
.incbin "graphics/pokemon/deoxys/front.4bpp.lz"
.else
.ifdef LEAFGREEN
.incbin "graphics/pokemon/deoxys/front_def.4bpp.lz"
.endif
.endif
.align 2
gMonPalette_Deoxys:: @ 8E39D48
@@ -11893,7 +11899,13 @@ gMonPalette_Deoxys:: @ 8E39D48
.align 2
gMonBackPic_Deoxys:: @ 8E39D70
.ifdef FIRERED
.incbin "graphics/pokemon/deoxys/back.4bpp.lz"
.else
.ifdef LEAFGREEN
.incbin "graphics/pokemon/deoxys/back_def.4bpp.lz"
.endif
.endif
.align 2
gMonShinyPalette_Deoxys:: @ 8E3A360
@@ -11903,7 +11915,13 @@ gMonShinyPalette_Deoxys:: @ 8E3A360
gMonIcon_Deoxys:: @ 8E3A388
.incbin "graphics/pokemon/deoxys/icon.4bpp"
@ Referenced as part of the same array as normal deoxys
.ifdef FIRERED
.incbin "graphics/pokemon/deoxys/icon_attack.4bpp"
.else
.ifdef LEAFGREEN
.incbin "graphics/pokemon/deoxys/icon_defense.4bpp"
.endif
.endif
.align 2
gMonFootprint_Deoxys:: @ 8E3AB88
@@ -16512,26 +16530,51 @@ gCreditsPokeballBgGfxMap:: @ 8EAB30C
.incbin "graphics/credits/unk_8EAB30C.bin.lz"
@ title_screen
gGraphics_TitleScreen_PokemonFireRedLogoPals:: @ 8EAB6C4
.ifdef FIRERED
gGraphics_TitleScreen_GameTitleLogoPals:: @ 8EAB6C4
.incbin "graphics/title_screen/unk_8eab6c4.gbapal"
gGraphics_TitleScreen_PokemonFireRedLogoTiles:: @ 8EAB8C4
gGraphics_TitleScreen_GameTitleLogoTiles:: @ 8EAB8C4
.incbin "graphics/title_screen/unk_8eab8c4.8bpp.lz"
gGraphics_TitleScreen_PokemonFireRedLogoMap:: @ 8EAD390
gGraphics_TitleScreen_GameTitleLogoMap:: @ 8EAD390
.incbin "graphics/title_screen/unk_8ead390.bin.lz"
gGraphics_TitleScreen_CharizardPals:: @ 8EAD5E8
gGraphics_TitleScreen_BoxArtMonPals:: @ 8EAD5E8
.incbin "graphics/title_screen/unk_8ead5e8.gbapal"
gGraphics_TitleScreen_CharizardTiles:: @ 8EAD608
gGraphics_TitleScreen_BoxArtMonTiles:: @ 8EAD608
.incbin "graphics/title_screen/unk_8ead608.4bpp.lz"
gGraphics_TitleScreen_CharizardMap:: @ 8EADEE4
gGraphics_TitleScreen_BoxArtMonMap:: @ 8EADEE4
.incbin "graphics/title_screen/unk_8eadee4.bin.lz"
gGraphics_TitleScreen_BackgroundPals:: @ 8EAE094
.incbin "graphics/title_screen/unk_8eae094.gbapal"
.else
.ifdef LEAFGREEN
gGraphics_TitleScreen_GameTitleLogoPals:: @ 8EAB6C4
.incbin "graphics/title_screen/unk_lg_8eab744.gbapal"
gGraphics_TitleScreen_GameTitleLogoTiles:: @ 8EAB8C4
.incbin "graphics/title_screen/unk_lg_8eab944.8bpp.lz"
gGraphics_TitleScreen_GameTitleLogoMap:: @ 8EAD390
.incbin "graphics/title_screen/unk_lg_8ead508.bin.lz"
gGraphics_TitleScreen_BoxArtMonPals:: @ 8EAD5E8
.incbin "graphics/title_screen/unk_lg_8ead768.gbapal"
gGraphics_TitleScreen_BoxArtMonTiles:: @ 8EAD608
.incbin "graphics/title_screen/unk_lg_8ead788.4bpp.lz"
gGraphics_TitleScreen_BoxArtMonMap:: @ 8EADEE4
.incbin "graphics/title_screen/unk_lg_8eae1ec.bin.lz"
gGraphics_TitleScreen_BackgroundPals:: @ 8EAE094
.incbin "graphics/title_screen/unk_lg_8eae388.gbapal"
.endif
.endif
gGraphics_TitleScreen_CopyrightPressStartTiles:: @ 8EAE0B4
.incbin "graphics/title_screen/unk_8eae0b4.4bpp.lz"
@@ -16539,8 +16582,15 @@ gGraphics_TitleScreen_CopyrightPressStartTiles:: @ 8EAE0B4
gGraphics_TitleScreen_CopyrightPressStartMap:: @ 8EAE374
.incbin "graphics/title_screen/unk_8eae374.bin.lz"
gGraphics_TitleScreen_FirePals:: @ 8EAE488
.ifdef FIRERED
gGraphics_TitleScreen_FireOrLeafPals:: @ 8EAE488
.incbin "graphics/title_screen/unk_8eae488.gbapal"
.else
.ifdef LEAFGREEN
gGraphics_TitleScreen_FireOrLeafPals:: @ 8EAE488
.incbin "graphics/title_screen/unk_lg_8eae77c.gbapal"
.endif
.endif
gGraphics_TitleScreen_BlankObjTiles:: @ 8EAE4A8
.incbin "graphics/title_screen/unk_8eae4a8.4bpp.lz"
@@ -0,0 +1 @@
àààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààððððàððàààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààààà
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
230 123 90
16 164 74
148 255 57
98 222 57
57 189 65
230 255 230
148 255 205
82 246 131
180 180 115
255 205 148
246 172 123
238 148 106
0 0 0
0 0 0
0 0 0
230 123 90
Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

@@ -42,32 +42,67 @@ EventScript_16CC10:: @ 816CC10
end
EventScript_16CC15:: @ 816CC15
.ifdef FIRERED
setvar VAR_0x4001, SPECIES_ABRA
setvar VAR_0x4002, 180
.else
.ifdef LEAFGREEN
setvar VAR_0x4001, SPECIES_ABRA
setvar VAR_0x4002, 120
.endif
.endif
goto EventScript_16CC65
end
EventScript_16CC25:: @ 816CC25
.ifdef FIRERED
setvar VAR_0x4001, SPECIES_CLEFAIRY
setvar VAR_0x4002, 500
.else
.ifdef LEAFGREEN
setvar VAR_0x4001, SPECIES_CLEFAIRY
setvar VAR_0x4002, 750
.endif
.endif
goto EventScript_16CC65
end
EventScript_16CC35:: @ 816CC35
.ifdef FIRERED
setvar VAR_0x4001, SPECIES_DRATINI
setvar VAR_0x4002, 2800
.else
.ifdef LEAFGREEN
setvar VAR_0x4001, SPECIES_PINSIR
setvar VAR_0x4002, 2500
.endif
.endif
goto EventScript_16CC65
end
EventScript_16CC45:: @ 816CC45
.ifdef FIRERED
setvar VAR_0x4001, SPECIES_SCYTHER
setvar VAR_0x4002, 5500
.else
.ifdef LEAFGREEN
setvar VAR_0x4001, SPECIES_DRATINI
setvar VAR_0x4002, 4600
.endif
.endif
goto EventScript_16CC65
end
EventScript_16CC55:: @ 816CC55
.ifdef FIRERED
setvar VAR_0x4001, SPECIES_PORYGON
setvar VAR_0x4002, 9999
.else
.ifdef LEAFGREEN
setvar VAR_0x4001, SPECIES_PORYGON
setvar VAR_0x4002, 6500
.endif
.endif
goto EventScript_16CC65
end
@@ -90,17 +125,35 @@ EventScript_16CC65:: @ 816CC65
end
EventScript_16CCD4:: @ 816CCD4
.ifdef FIRERED
givemon VAR_0x4001, 9, ITEM_NONE, 0, 0, 0
.else
.ifdef LEAFGREEN
givemon VAR_0x4001, 7, ITEM_NONE, 0, 0, 0
.endif
.endif
goto EventScript_16CD52
end
EventScript_16CCE9:: @ 816CCE9
.ifdef FIRERED
givemon VAR_0x4001, 8, ITEM_NONE, 0, 0, 0
.else
.ifdef LEAFGREEN
givemon VAR_0x4001, 12, ITEM_NONE, 0, 0, 0
.endif
.endif
goto EventScript_16CD52
end
EventScript_16CCFE:: @ 816CCFE
.ifdef FIRERED
givemon VAR_0x4001, 18, ITEM_NONE, 0, 0, 0
.else
.ifdef LEAFGREEN
givemon VAR_0x4001, 24, ITEM_NONE, 0, 0, 0
.endif
.endif
goto EventScript_16CD52
end
@@ -110,7 +163,13 @@ EventScript_16CD13:: @ 816CD13
end
EventScript_16CD28:: @ 816CD28
.ifdef FIRERED
givemon VAR_0x4001, 26, ITEM_NONE, 0, 0, 0
.else
.ifdef LEAFGREEN
givemon VAR_0x4001, 18, ITEM_NONE, 0, 0, 0
.endif
.endif
goto EventScript_16CD52
end
+1 -1
View File
@@ -12,7 +12,7 @@ gExpandedPlaceholder_Kun:: @ 8415A21
gExpandedPlaceholder_Chan:: @ 8415A22
.string "$"
gUnknown_8415A23:: @ 0x8415A23
gExpandedPlaceholder_Sapphire:: @ 0x8415A23
.string "SAPPHIRE$"
gExpandedPlaceholder_Ruby:: @ 8415A2C
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

-19
View File
@@ -1,19 +0,0 @@
JASC-PAL
0100
16
0 0 0
238 172 0
156 115 115
246 205 205
123 90 90
222 164 164
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
222 123 32
255 205 32
205 90 0
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 845 B

+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
57 57 49
230 230 230
255 255 255
139 222 82
65 156 41
90 164 57
197 246 139
115 180 82
255 164 41
238 148 0
255 205 65
172 82 0
24 98 24
98 98 90
0 0 0
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
222 222 222
255 255 255
139 222 82
255 90 0
222 41 0
255 90 0
222 41 0
255 90 0
222 41 0
255 90 0
222 41 0
255 90 0
222 41 0
197 246 139
156 0 0
0 0 0
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
255 255 255
65 156 41
139 222 82
115 164 74
156 238 74
230 65 24
255 164 41
255 238 32
139 222 82
189 189 189
156 156 156
123 123 123
90 90 90
65 65 65
0 0 0
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 0
139 222 82
139 106 106
189 156 156
115 82 82
164 131 131
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
131 197 98
115 180 82
197 246 139
90 164 57
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
222 222 222
65 156 41
90 164 57
255 255 255
139 222 82
0 0 197
180 65 0
180 65 0
0 106 0
0 106 0
82 123 255
246 156 0
246 156 0
41 180 82
41 180 82
0 0 0
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
222 222 222
65 156 41
90 164 57
255 255 255
139 222 82
0 180 255
255 148 0
255 148 0
0 238 0
0 238 0
139 255 255
255 238 106
255 238 106
148 255 148
148 255 148
0 0 0
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
222 222 222
255 255 255
139 222 82
255 255 131
255 180 65
255 255 255
255 255 131
255 255 131
255 180 65
255 180 65
255 90 0
255 90 0
222 41 0
197 246 139
156 0 0
0 0 0
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
222 222 222
255 255 255
139 222 82
255 180 65
255 90 0
255 255 131
255 180 65
255 255 255
255 255 131
255 255 131
255 180 65
255 180 65
255 90 0
197 246 139
156 0 0
0 0 0
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
222 222 222
255 255 255
139 222 82
255 90 0
222 41 0
255 180 65
255 90 0
255 255 131
255 180 65
255 255 255
255 255 131
255 255 131
255 180 65
197 246 139
156 0 0
0 0 0
Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

Binary file not shown.
+259
View File
@@ -0,0 +1,259 @@
JASC-PAL
0100
256
0 255 41
0 0 0
255 238 16
246 222 41
246 238 246
255 246 24
246 246 41
246 246 246
246 255 255
255 246 255
32 0 255
106 65 156
32 0 238
246 222 24
246 222 32
255 238 41
255 238 49
255 255 16
255 255 24
255 255 246
255 255 255
123 106 156
24 41 32
32 32 74
32 0 230
115 82 164
16 0 246
106 82 172
246 238 32
255 230 24
246 230 41
246 238 41
246 230 49
246 238 49
255 246 32
255 246 41
255 255 32
255 255 41
32 24 32
32 32 41
197 156 41
197 164 41
156 156 156
164 164 156
172 172 172
180 189 180
41 0 230
189 189 189
197 189 189
197 197 197
205 205 213
8 8 197
246 230 24
246 230 32
255 238 24
255 238 32
32 32 32
32 41 32
41 32 32
41 41 32
49 32 32
49 41 32
41 32 41
49 32 41
24 41 41
32 32 90
16 24 106
24 32 98
41 32 82
41 32 98
41 41 82
41 41 98
0 0 115
8 8 131
32 24 115
32 24 131
32 41 115
41 41 115
32 41 131
41 41 131
57 41 41
57 41 49
57 49 41
57 57 57
65 41 41
74 41 41
65 57 57
74 57 57
57 74 74
65 65 74
82 74 82
82 57 131
82 90 82
90 90 90
90 98 98
98 98 106
115 106 106
131 98 115
139 98 106
139 115 98
180 139 57
172 131 65
156 115 90
156 131 82
115 82 139
123 82 131
115 98 131
131 98 123
115 123 123
123 123 131
139 131 139
148 123 131
205 172 24
213 172 16
205 164 32
213 172 32
222 189 24
230 189 16
213 189 32
222 189 32
230 205 24
230 205 32
230 213 32
238 222 32
180 148 57
189 156 49
180 148 74
180 172 90
156 148 123
139 148 139
164 148 115
172 156 106
197 156 49
205 180 49
197 172 90
205 189 82
222 205 49
230 222 49
205 205 74
222 213 65
49 0 230
213 213 213
222 230 230
222 230 230
255 0 246
255 0 255
16 8 197
16 16 189
32 16 164
41 16 164
32 16 180
41 16 189
8 8 205
8 16 205
24 8 213
24 16 205
41 8 213
41 16 213
49 8 213
57 16 213
16 8 230
24 8 230
24 16 230
24 24 230
8 8 246
8 16 246
16 8 246
16 16 246
32 8 230
32 16 230
32 8 238
32 8 246
41 8 230
41 16 230
49 16 230
49 8 238
32 32 156
24 32 172
41 41 156
41 32 164
74 49 180
82 49 172
82 65 164
90 74 164
24 32 189
57 41 189
41 32 213
57 32 213
74 41 189
90 57 189
74 49 197
74 41 205
205 205 205
41 41 41
189 189 189
172 172 172
246 246 246
123 123 123
156 156 156
139 139 139
238 238 238
16 16 16
98 98 98
82 82 82
222 222 222
57 57 57
0 0 0
255 255 255
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 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 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
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 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
246 148 98
0 0 0
246 148 98
255 0 255
255 0 255
255 0 255
0 32 32
0 49 41
0 65 49
0 82 57
16 98 74
24 115 90
41 148 115
74 180 139
98 205 156
131 230 172
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
255 255 90
0 0 0
123 123 123
197 197 197
222 222 222
255 255 255
0 0 0
123 123 123
197 197 197
222 222 222
255 255 255
230 123 90
0 123 0
16 148 32
41 180 65
65 213 98
+19
View File
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
0 0 213
172 180 197
49 57 65
115 123 131
246 246 246
57 82 82
90 115 115
123 131 123
49 74 57
16 32 24
0 82 0
32 82 24
16 98 0
57 164 16
90 222 24
189 255 8
+3
View File
@@ -506,6 +506,9 @@ $(ITEMPCGFXDIR)/unk_8E85090.4bpp: %.4bpp: %.png
$(TITLESCREENGFXDIR)/unk_8ead608.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 135
$(TITLESCREENGFXDIR)/unk_lg_8ead788.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 123
$(CREDITSGFXDIR)/unk_8EAE548.4bpp: %.4bpp: %.png
$(GFX) $< $@ -num_tiles 77
+10
View File
@@ -13,6 +13,16 @@
// Fire Red likely forgot to define NDEBUG/NOAGBPRN before release, leading
// to the inclusion of asserts in the retail ROM.
// Define the game version for use elsewhere
#if defined(FIRERED)
#define GAME_VERSION VERSION_FIRE_RED
#elif defined(LEAFGREEN)
#define GAME_VERSION VERSION_LEAF_GREEN
#else
#error unknown version
#endif
// rev1 renamed the source folder for reasons
#if REVISION == 0
#define CODE_ROOT "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/"
#else
+1 -2
View File
@@ -708,9 +708,8 @@ extern const u8 gFameCheckerFlavorTextOriginObjectName_Giovanni5[];
extern const u8 gOtherText_NewName[];
extern const u8 gNameChoice_Green[];
extern const u8 gNameChoice_Red[];
extern const u8 gNameChoice_Red[];
extern const u8 gNameChoice_Fire[];
extern const u8 gNameChoice_Fire[];
extern const u8 gNameChoice_Leaf[];
extern const u8 gNameChoice_Gary[];
extern const u8 gNameChoice_Kaz[];
extern const u8 gNameChoice_Toru[];
+8 -8
View File
@@ -4297,17 +4297,17 @@ extern const u32 gFile_graphics_battle_anims_backgrounds_sandstorm_brew_sheet[];
extern const u32 gBattleAnimSpritePal_FlyingDirt[];
// title_screen
extern const u16 gGraphics_TitleScreen_PokemonFireRedLogoPals[];
extern const u8 gGraphics_TitleScreen_PokemonFireRedLogoTiles[];
extern const u8 gGraphics_TitleScreen_PokemonFireRedLogoMap[];
extern const u16 gGraphics_TitleScreen_CharizardPals[];
extern const u8 gGraphics_TitleScreen_CharizardTiles[];
extern const u8 gGraphics_TitleScreen_CharizardMap[];
extern const u16 gGraphics_TitleScreen_GameTitleLogoPals[];
extern const u8 gGraphics_TitleScreen_GameTitleLogoTiles[];
extern const u8 gGraphics_TitleScreen_GameTitleLogoMap[];
extern const u16 gGraphics_TitleScreen_BoxArtMonPals[];
extern const u8 gGraphics_TitleScreen_BoxArtMonTiles[];
extern const u8 gGraphics_TitleScreen_BoxArtMonMap[];
extern u16 gGraphics_TitleScreen_BackgroundPals[]; // If this is const, title_screen.c does not match
extern const u8 gGraphics_TitleScreen_CopyrightPressStartTiles[];
extern const u8 gGraphics_TitleScreen_CopyrightPressStartMap[];
extern const u16 gGraphics_TitleScreen_FirePals[];
extern const u8 gGraphics_TitleScreen_BlankObjTiles[];
extern const u16 gGraphics_TitleScreen_FireOrLeafPals[];
extern const u32 gGraphics_TitleScreen_BlankObjTiles[];
// battle_gfx_sfx_util
extern const u32 gHealthboxSinglesPlayerGfx[];
+5
View File
@@ -777,6 +777,11 @@ extern const u8 gText_Clefairy_500Coins[];
extern const u8 gText_Dratini_2800Coins[];
extern const u8 gText_Scyther_5500Coins[];
extern const u8 gText_Porygon_9999Coins[];
extern const u8 gText_Abra_120Coins[];
extern const u8 gText_Clefairy_750Coins[];
extern const u8 gText_Pinsir_2500Coins[];
extern const u8 gText_Dratini_4600Coins[];
extern const u8 gText_Porygon_6500Coins[];
extern const u8 gText_NoThanks_2[];
extern const u8 gText_HelixFossil[];
extern const u8 gText_DomeFossil[];
+36
View File
@@ -28,6 +28,7 @@ static const struct InGameTrade sInGameTrades[] = {
.sheen = 10,
.requestedSpecies = SPECIES_POLIWHIRL
}, {
#if defined(FIRERED)
.nickname = _("MS. NIDO"),
.species = SPECIES_NIDORAN_F,
.ivs = {22, 18, 25, 19, 15, 22},
@@ -41,6 +42,21 @@ static const struct InGameTrade sInGameTrades[] = {
.otGender = FEMALE,
.sheen = 10,
.requestedSpecies = SPECIES_NIDORAN_M
#elif defined(LEAFGREEN)
.nickname = _("MR. NIDO"),
.species = SPECIES_NIDORAN_M,
.ivs = {19, 25, 18, 22, 22, 15},
.abilityNum = 0,
.otId = 63184,
.conditions = {30, 5, 5, 5, 5},
.personality = 0x4c970b9e,
.heldItem = ITEM_TINY_MUSHROOM,
.mailNum = 255,
.otName = _("SAIGE"),
.otGender = FEMALE,
.sheen = 10,
.requestedSpecies = SPECIES_NIDORAN_F
#endif
}, {
.nickname = _("CH'DING"),
.species = SPECIES_FARFETCHD,
@@ -56,6 +72,7 @@ static const struct InGameTrade sInGameTrades[] = {
.sheen = 10,
.requestedSpecies = SPECIES_SPEAROW
}, {
#if defined(FIRERED)
.nickname = _("NINA"),
.species = SPECIES_NIDORINA,
.ivs = {22, 25, 18, 19, 22, 15},
@@ -69,6 +86,21 @@ static const struct InGameTrade sInGameTrades[] = {
.otGender = MALE,
.sheen = 10,
.requestedSpecies = SPECIES_NIDORINO
#elif defined(LEAFGREEN)
.nickname = _("NINO"),
.species = SPECIES_NIDORINO,
.ivs = {19, 18, 25, 22, 15, 22},
.abilityNum = 0,
.otId = 13637,
.conditions = {5, 5, 5, 5, 30},
.personality = 0x00eeca19,
.heldItem = ITEM_NONE,
.mailNum = 255,
.otName = _("TURNER"),
.otGender = MALE,
.sheen = 10,
.requestedSpecies = SPECIES_NIDORINA
#endif
}, {
.nickname = _("MARC"),
.species = SPECIES_LICKITUNG,
@@ -82,7 +114,11 @@ static const struct InGameTrade sInGameTrades[] = {
.otName = _("HADEN"),
.otGender = MALE,
.sheen = 10,
#if defined(FIRERED)
.requestedSpecies = SPECIES_GOLDUCK
#elif defined(LEAFGREEN)
.requestedSpecies = SPECIES_SLOWBRO
#endif
}, {
.nickname = _("ESPHERE"),
.species = SPECIES_ELECTRODE,
+25
View File
@@ -670,8 +670,13 @@ static const u16 sDiglettLevelUpLearnset[] = {
static const u16 sDugtrioLevelUpLearnset[] = {
LEVEL_UP_MOVE(1, MOVE_TRI_ATTACK),
#if defined(FIRERED)
LEVEL_UP_MOVE(1, MOVE_SCRATCH),
LEVEL_UP_MOVE(1, MOVE_SAND_ATTACK),
#elif defined(LEAFGREEN)
LEVEL_UP_MOVE(1, MOVE_SAND_ATTACK),
LEVEL_UP_MOVE(1, MOVE_SCRATCH),
#endif
LEVEL_UP_MOVE(1, MOVE_GROWL),
LEVEL_UP_MOVE(5, MOVE_GROWL),
LEVEL_UP_MOVE(9, MOVE_MAGNITUDE),
@@ -5649,6 +5654,7 @@ static const u16 sJirachiLevelUpLearnset[] = {
LEVEL_UP_END
};
#if defined(FIRERED)
static const u16 sDeoxysLevelUpLearnset[] = {
LEVEL_UP_MOVE(1, MOVE_LEER),
LEVEL_UP_MOVE(1, MOVE_WRAP),
@@ -5664,6 +5670,25 @@ static const u16 sDeoxysLevelUpLearnset[] = {
LEVEL_UP_MOVE(50, MOVE_HYPER_BEAM),
LEVEL_UP_END
};
#elif defined(LEAFGREEN)
static const u16 sDeoxysLevelUpLearnset[] = {
LEVEL_UP_MOVE(1, MOVE_LEER),
LEVEL_UP_MOVE(1, MOVE_WRAP),
LEVEL_UP_MOVE(5, MOVE_NIGHT_SHADE),
LEVEL_UP_MOVE(10, MOVE_TELEPORT),
LEVEL_UP_MOVE(15, MOVE_KNOCK_OFF),
LEVEL_UP_MOVE(20, MOVE_SPIKES),
LEVEL_UP_MOVE(25, MOVE_PSYCHIC),
LEVEL_UP_MOVE(30, MOVE_SNATCH),
LEVEL_UP_MOVE(35, MOVE_IRON_DEFENSE),
LEVEL_UP_MOVE(35, MOVE_AMNESIA),
LEVEL_UP_MOVE(40, MOVE_RECOVER),
LEVEL_UP_MOVE(45, MOVE_PSYCHO_BOOST),
LEVEL_UP_MOVE(50, MOVE_COUNTER),
LEVEL_UP_MOVE(50, MOVE_MIRROR_COAT),
LEVEL_UP_END
};
#endif
static const u16 sChimechoLevelUpLearnset[] = {
LEVEL_UP_MOVE(1, MOVE_WRAP),
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+12675 -132
View File
File diff suppressed because it is too large Load Diff
+7
View File
@@ -24,6 +24,8 @@
## for encounter in wild_encounter_group.encounters
{% if contains(encounter.base_label, "LeafGreen") %}#ifdef LEAFGREEN
{% else if contains(encounter.base_label, "FireRed") %}#ifdef FIRERED{% endif %}
{% if existsIn(encounter, "land_mons") %}
const struct WildPokemon {{ encounter.base_label }}_LandMons[] =
{
@@ -64,11 +66,15 @@ const struct WildPokemon {{ encounter.base_label }}_FishingMons[] =
const struct WildPokemonInfo {{ encounter.base_label }}_FishingMonsInfo = { {{encounter.fishing_mons.encounter_rate}}, {{ encounter.base_label }}_FishingMons };
{% endif %}
#endif
## endfor
const struct WildPokemonHeader {{ wild_encounter_group.label }}[] =
{
## for encounter in wild_encounter_group.encounters
{% if contains(encounter.base_label, "LeafGreen") %}#ifdef LEAFGREEN
{% else if contains(encounter.base_label, "FireRed") %}#ifdef FIRERED{% endif %}
{
.mapGroup = {% if wild_encounter_group.for_maps %}MAP_GROUP({{ removePrefix(encounter.map, "MAP_") }}){% else %}0{% endif %},
.mapNum = {% if wild_encounter_group.for_maps %}MAP_NUM({{ removePrefix(encounter.map, "MAP_") }}){% else %}{{ loop.index1 }}{% endif %},
@@ -77,6 +83,7 @@ const struct WildPokemonHeader {{ wild_encounter_group.label }}[] =
.rockSmashMonsInfo = {% if existsIn(encounter, "rock_smash_mons") %}&{{ encounter.base_label }}_RockSmashMonsInfo{% else %}NULL{% endif %},
.fishingMonsInfo = {% if existsIn(encounter, "fishing_mons") %}&{{ encounter.base_label }}_FishingMonsInfo{% else %}NULL{% endif %},
},
#endif
## endfor
{
.mapGroup = MAP_GROUP(UNDEFINED),
-7
View File
@@ -55,13 +55,6 @@ static void VCountIntr(void);
static void SerialIntr(void);
static void IntrDummy(void);
#if defined(FIRERED)
#define GAME_VERSION VERSION_FIRE_RED
#elif defined(LEAFGREEN)
#define GAME_VERSION VERSION_LEAF_GREEN
#else
#error unknown version
#endif
const u8 gGameVersion = GAME_VERSION;
const u8 gGameLanguage = GAME_LANGUAGE;
+4
View File
@@ -419,7 +419,11 @@ static const u8 gUnknown_845FD54[][5] = {
[SPECIES_LATIAS - 1] = {0x1e, 0x0c, 0x10, 0x23, 0x19},
[SPECIES_LATIOS - 1] = {0x05, 0x0e, 0x10, 0x05, 0x1d},
[SPECIES_JIRACHI - 1] = {0x1c, 0x15, 0x08, 0x1e, 0x22},
#if defined(FIRERED)
[SPECIES_DEOXYS - 1] = {0x1b, 0x08, 0x28, 0x1c, 0x16},
#elif defined(LEAFGREEN)
[SPECIES_DEOXYS - 1] = {0x1a, 0x09, 0x28, 0x1a, 0x17},
#endif
[SPECIES_CHIMECHO - 1] = {0x1d, 0x0c, 0x08, 0x1c, 0x1a},
[SPECIES_OLD_UNOWN_EMARK - 1] = {0x20, 0x21, 0x08, 0x20, 0x2b},
[SPECIES_OLD_UNOWN_QMARK - 1] = {0x20, 0x23, 0x08, 0x20, 0x2d}
+7 -1
View File
@@ -750,6 +750,12 @@ bool32 sub_8144254(const u16 * data)
return FALSE;
}
#if defined(FIRERED)
#define MEVENT_HEADER_VERSION_CODE 1
#elif defined(LEAFGREEN)
#define MEVENT_HEADER_VERSION_CODE 2
#endif
void BuildMEventClientHeader(struct MEventClientHeaderStruct * data)
{
s32 i;
@@ -759,7 +765,7 @@ void BuildMEventClientHeader(struct MEventClientHeaderStruct * data)
data->unk_04 = 1;
data->unk_08 = 1;
data->unk_0C = 1;
data->unk_10 = 1;
data->unk_10 = MEVENT_HEADER_VERSION_CODE;
// Check whether a card already exists
if (ValidateReceivedWonderCard())
+4
View File
@@ -22,7 +22,11 @@ extern ScrCmdFunc gMysteryEventScriptCmdTable[];
extern ScrCmdFunc gMysteryEventScriptCmdTableEnd[];
#define LANGUAGE_MASK 0x1
#if defined(FIRERED)
#define VERSION_MASK 0x1
#elif defined(LEAFGREEN)
#define VERSION_MASK 0x2
#endif
EWRAM_DATA static struct ScriptContext sMysteryEventScriptContext = {0};
+22 -2
View File
@@ -271,11 +271,11 @@ static const struct WindowTemplate sNewGameAdventureIntroWindowTemplates[] = {
}, DUMMY_WIN_TEMPLATE
};
const u8 sTextColor_HelpSystem[4] = {
static const u8 sTextColor_HelpSystem[4] = {
0x00, 0x01, 0x02
};
const u8 sTextColor_OakSpeech[4] = {
static const u8 sTextColor_OakSpeech[4] = {
0x00, 0x02, 0x03
};
@@ -405,11 +405,19 @@ static const u8 *const sHelpDocsPtrs[] = {
};
static const u8 *const sMaleNameChoices[] = {
#if defined(FIRERED)
gNameChoice_Red,
gNameChoice_Fire,
gNameChoice_Ash,
gNameChoice_Kene,
gNameChoice_Geki,
#elif defined(LEAFGREEN)
gNameChoice_Green,
gNameChoice_Leaf,
gNameChoice_Gary,
gNameChoice_Kaz,
gNameChoice_Toru,
#endif
gNameChoice_Jak,
gNameChoice_Janne,
gNameChoice_Jonn,
@@ -427,8 +435,13 @@ static const u8 *const sMaleNameChoices[] = {
};
static const u8 *const sFemaleNameChoices[] = {
#if defined(FIRERED)
gNameChoice_Red,
gNameChoice_Fire,
#elif defined(LEAFGREEN)
gNameChoice_Green,
gNameChoice_Leaf,
#endif
gNameChoice_Omi,
gNameChoice_Jodi,
gNameChoice_Amanda,
@@ -449,10 +462,17 @@ static const u8 *const sFemaleNameChoices[] = {
};
static const u8 *const sRivalNameChoices[] = {
#if defined(FIRERED)
gNameChoice_Green,
gNameChoice_Gary,
gNameChoice_Kaz,
gNameChoice_Toru
#elif defined(LEAFGREEN)
gNameChoice_Red,
gNameChoice_Ash,
gNameChoice_Kene,
gNameChoice_Geki
#endif
};
static void VBlankCB_NewGameOaksSpeech(void)
+12
View File
@@ -1603,6 +1603,7 @@ static const u16 sHMMoves[] =
MOVE_ROCK_SMASH, MOVE_WATERFALL, MOVE_DIVE, 0xFFFF
};
#if defined(FIRERED)
static const u16 sDeoxysBaseStats[] =
{
50, // Hp
@@ -1612,6 +1613,17 @@ static const u16 sDeoxysBaseStats[] =
180, // Sp.Attack
20, // Sp.Defense
};
#elif defined LEAFGREEN
static const u16 sDeoxysBaseStats[] =
{
50, // Hp
70, // Attack
160, // Defense
90, // Speed
70, // Sp.Attack
160, // Sp.Defense
};
#endif
const u16 gLinkPlayerFacilityClasses[] =
{
+8
View File
@@ -316,11 +316,19 @@ static const struct MenuAction sScriptMultiChoiceMenu_BikeShop[] = {
};
static const struct MenuAction sScriptMultiChoiceMenu_GameCornerPokemonPrizes[] = {
#if defined(FIRERED)
{ gText_Abra_180Coins },
{ gText_Clefairy_500Coins },
{ gText_Dratini_2800Coins },
{ gText_Scyther_5500Coins },
{ gText_Porygon_9999Coins },
#elif defined(LEAFGREEN)
{ gText_Abra_120Coins },
{ gText_Clefairy_750Coins },
{ gText_Pinsir_2500Coins },
{ gText_Dratini_4600Coins },
{ gText_Porygon_6500Coins },
#endif
{ gText_NoThanks_2 }
};
+36 -1
View File
@@ -213,9 +213,15 @@ static const u16 gUnknown_8464994[] = INCBIN_U16("graphics/slot_machine/unk_8464
static const u16 gUnknown_84649B4[] = INCBIN_U16("graphics/slot_machine/unk_84649b4.gbapal");
static const u16 gUnknown_84649D4[] = INCBIN_U16("graphics/slot_machine/unk_84649d4.gbapal");
static const u16 gUnknown_84649F4[] = INCBIN_U16("graphics/slot_machine/unk_84649f4.gbapal");
#if defined(FIRERED)
static const u32 gUnknown_8464A14[] = INCBIN_U32("graphics/slot_machine/unk_8464a14.4bpp.lz");
static const u16 gUnknown_846504C[] = INCBIN_U16("graphics/slot_machine/unk_846504c.gbapal");
static const u16 gUnknown_846504C[] = INCBIN_U16("graphics/slot_machine/unk_846506c.gbapal");
static const u32 gUnknown_846506C[] = INCBIN_U32("graphics/slot_machine/unk_846506c.4bpp.lz");
#elif defined(LEAFGREEN)
static const u32 gUnknown_8464A14[] = INCBIN_U32("graphics/slot_machine/unk_lg_8464434.4bpp.lz");
static const u16 gUnknown_846504C[] = INCBIN_U16("graphics/slot_machine/unk_lg_8464a3c.gbapal");
static const u32 gUnknown_846506C[] = INCBIN_U32("graphics/slot_machine/unk_lg_8464a3c.4bpp.lz");
#endif
static const u16 gUnknown_8465524[] = INCBIN_U16("graphics/slot_machine/unk_8465524.gbapal");
static const u32 gUnknown_8465544[] = INCBIN_U32("graphics/slot_machine/unk_8465544.4bpp.lz");
@@ -236,6 +242,7 @@ static const struct SpritePalette gUnknown_84655C8[] = {
{NULL}
};
#if defined(FIRERED)
static const u16 gUnknown_8465608[] = {
2,
2,
@@ -245,6 +252,17 @@ static const u16 gUnknown_8465608[] = {
4,
3
};
#elif defined(LEAFGREEN)
static const u16 gUnknown_8465608[] = {
2,
2,
0,
3,
2,
1,
1
};
#endif
static const u16 gUnknown_8465616[] = {
0x0120, 0x011f, 0x011e, 0x011d, 0x011c, 0x011b, 0x011a, 0x0119, 0x0118, 0x0117, 0x0116, 0x0115, 0x0114, 0x0113, 0x0112, 0x0111,
@@ -517,6 +535,7 @@ bool8 (*const gUnknown_84658F0[])(u8 *, struct SlotMachineSetupTaskData *) = {
sub_8141764
};
#if defined(FIRERED)
static const u16 gUnknown_8465930[] = INCBIN_U16("graphics/slot_machine/unk_8465930.gbapal");
static const u16 gUnknown_8465950[] = INCBIN_U16("graphics/slot_machine/unk_8465950.gbapal");
static const u16 gUnknown_8465970[] = INCBIN_U16("graphics/slot_machine/unk_8465970.gbapal");
@@ -526,12 +545,28 @@ static const u32 gUnknown_84659D0[] = INCBIN_U32("graphics/slot_machine/unk_8465
static const u32 gUnknown_84661D4[] = INCBIN_U32("graphics/slot_machine/unk_84661d4.bin.lz");
static const u16 gUnknown_84664BC[] = INCBIN_U16("graphics/slot_machine/unk_84664bc.gbapal");
static const u16 gUnknown_84664DC[] = INCBIN_U16("graphics/slot_machine/unk_84664dc.gbapal","graphics/slot_machine/unk_84664fc.gbapal", "graphics/slot_machine/unk_846651c.gbapal");
#elif defined(LEAFGREEN)
static const u16 gUnknown_8465930[] = INCBIN_U16("graphics/slot_machine/unk_lg_84652bc.gbapal");
static const u16 gUnknown_8465950[] = INCBIN_U16("graphics/slot_machine/unk_lg_84652dc.gbapal");
static const u16 gUnknown_8465970[] = INCBIN_U16("graphics/slot_machine/unk_lg_84652fc.gbapal");
static const u16 gUnknown_8465990[] = INCBIN_U16("graphics/slot_machine/unk_lg_846531c.gbapal");
static const u16 gUnknown_84659B0[] = INCBIN_U16("graphics/slot_machine/unk_lg_846533c.gbapal");
static const u32 gUnknown_84659D0[] = INCBIN_U32("graphics/slot_machine/unk_lg_846535c.4bpp.lz");
static const u32 gUnknown_84661D4[] = INCBIN_U32("graphics/slot_machine/unk_lg_8465ab8.bin.lz");
static const u16 gUnknown_84664BC[] = INCBIN_U16("graphics/slot_machine/unk_lg_8465d9c.gbapal");
static const u16 gUnknown_84664DC[] = INCBIN_U16("graphics/slot_machine/unk_lg_8465dbc.gbapal","graphics/slot_machine/unk_lg_8465ddc.gbapal", "graphics/slot_machine/unk_lg_8465dfc.gbapal");
#endif
static const u32 gUnknown_846653C[] = INCBIN_U32("graphics/slot_machine/unk_846653c.4bpp.lz");
static const u16 gUnknown_84665C0[] = INCBIN_U16("graphics/slot_machine/unk_84665c0.gbapal");
static const u16 gUnknown_84665E0[] = INCBIN_U16("graphics/slot_machine/unk_84665e0.gbapal");
static const u16 gUnknown_8466600[] = INCBIN_U16("graphics/slot_machine/unk_8466600.gbapal");
#if defined(FIRERED)
static const u32 gUnknown_8466620[] = INCBIN_U32("graphics/slot_machine/unk_8466620.4bpp.lz");
static const u32 gUnknown_8466998[] = INCBIN_U32("graphics/slot_machine/unk_8466998.bin.lz");
#elif defined(LEAFGREEN)
static const u32 gUnknown_8466620[] = INCBIN_U32("graphics/slot_machine/unk_lg_8465f00.4bpp.lz");
static const u32 gUnknown_8466998[] = INCBIN_U32("graphics/slot_machine/unk_lg_8466278.bin.lz");
#endif
static const struct BgTemplate gUnknown_8466B10[] = {
{
+28
View File
@@ -405,37 +405,65 @@ static u8 *ExpandPlaceholder_RivalName(void)
static u8 *ExpandPlaceholder_Version(void)
{
#if defined(FIRERED)
return gExpandedPlaceholder_Ruby;
#elif defined(LEAFGREEN)
return gExpandedPlaceholder_Sapphire;
#endif
}
static u8 *ExpandPlaceholder_Magma(void)
{
#if defined(FIRERED)
return gExpandedPlaceholder_Magma;
#elif defined(LEAFGREEN)
return gExpandedPlaceholder_Aqua;
#endif
}
static u8 *ExpandPlaceholder_Aqua(void)
{
#if defined(FIRERED)
return gExpandedPlaceholder_Aqua;
#elif defined(LEAFGREEN)
return gExpandedPlaceholder_Magma;
#endif
}
static u8 *ExpandPlaceholder_Maxie(void)
{
#if defined(FIRERED)
return gExpandedPlaceholder_Maxie;
#elif defined(LEAFGREEN)
return gExpandedPlaceholder_Archie;
#endif
}
static u8 *ExpandPlaceholder_Archie(void)
{
#if defined(FIRERED)
return gExpandedPlaceholder_Archie;
#elif defined(LEAFGREEN)
return gExpandedPlaceholder_Maxie;
#endif
}
static u8 *ExpandPlaceholder_Groudon(void)
{
#if defined(FIRERED)
return gExpandedPlaceholder_Groudon;
#elif defined(LEAFGREEN)
return gExpandedPlaceholder_Kyogre;
#endif
}
static u8 *ExpandPlaceholder_Kyogre(void)
{
#if defined(FIRERED)
return gExpandedPlaceholder_Kyogre;
#elif defined(LEAFGREEN)
return gExpandedPlaceholder_Groudon;
#endif
}
u8 *GetExpandedPlaceholder(u32 id)
+164 -51
View File
@@ -75,13 +75,23 @@ static void SpriteCallback_Slash(struct Sprite * sprite);
// bg3
static const u8 sBorderBgTiles[] = INCBIN_U8("data/graphics/title_screen/unk_83BF58C.4bpp.lz");
#if defined(FIRERED)
static const u8 sBorderBgMap[] = INCBIN_U8("data/graphics/title_screen/unk_83BF5A8.bin.lz");
#elif defined(LEAFGREEN)
static const u8 sBorderBgMap[] = INCBIN_U8("data/graphics/title_screen/lg_border_bg.bin.lz");
#endif
//sprites
static const u8 sSlashSpriteTiles[] = INCBIN_U8("data/graphics/title_screen/unk_83bf64c.4bpp.lz");
static const u32 sSlashSpriteTiles[] = INCBIN_U32("data/graphics/title_screen/unk_83bf64c.4bpp.lz");
#if defined(FIRERED)
static const u16 sSlashSpritePals[] = INCBIN_U16("data/graphics/title_screen/unk_83bf77c.gbapal");
static const u8 sFireSpriteTiles[] = INCBIN_U8("data/graphics/title_screen/unk_83bf79c.4bpp.lz");
static const u8 sBlankFireSpriteTiles[] = INCBIN_U8("data/graphics/title_screen/unk_83bfa14.4bpp.lz");
static const u32 sFireSpriteTiles[] = INCBIN_U32("data/graphics/title_screen/unk_83bf79c.4bpp.lz");
static const u32 sBlankFireSpriteTiles[] = INCBIN_U32("data/graphics/title_screen/unk_83bfa14.4bpp.lz");
#elif defined(LEAFGREEN)
static const u16 sSlashSpritePals[] = INCBIN_U16("data/graphics/title_screen/unk_lg_83bf764.gbapal");
static const u32 sLeafSpriteTiles[] = INCBIN_U32("data/graphics/title_screen/unk_lg_83bf784.4bpp.lz");
static const u32 sBlankLeafSpriteTiles[] = INCBIN_U32("data/graphics/title_screen/unk_lg_83bf89c.4bpp.lz");
#endif
static const struct OamData sOamData_FlameOrLeaf = {
.objMode = ST_OAM_OBJ_NORMAL,
@@ -92,6 +102,7 @@ static const struct OamData sOamData_FlameOrLeaf = {
.paletteNum = 0
};
#if defined(FIRERED)
static const union AnimCmd sSpriteAnims_FlameOrLeaf_0[] = {
ANIMCMD_FRAME(0x00, 3),
ANIMCMD_FRAME(0x04, 6),
@@ -119,6 +130,27 @@ static const union AnimCmd *const sSpriteAnimTable_FlameOrLeaf[] = {
sSpriteAnims_FlameOrLeaf_1
};
#elif defined(LEAFGREEN)
static const union AnimCmd sSpriteAnims_FlameOrLeaf_0[] = {
ANIMCMD_FRAME(0x00, 8),
ANIMCMD_FRAME(0x04, 8),
ANIMCMD_FRAME(0x08, 8),
ANIMCMD_FRAME(0x0c, 8),
ANIMCMD_FRAME(0x10, 8),
ANIMCMD_FRAME(0x14, 8),
ANIMCMD_FRAME(0x18, 8),
ANIMCMD_FRAME(0x1c, 8),
ANIMCMD_FRAME(0x20, 8),
ANIMCMD_FRAME(0x24, 8),
ANIMCMD_FRAME(0x28, 8),
ANIMCMD_JUMP(0)
};
static const union AnimCmd *const sSpriteAnimTable_FlameOrLeaf[] = {
sSpriteAnims_FlameOrLeaf_0
};
#endif
static const struct SpriteTemplate sSpriteTemplate_FlameOrLeaf_State1 = {
.tileTag = 0,
.paletteTag = 0,
@@ -129,6 +161,7 @@ static const struct SpriteTemplate sSpriteTemplate_FlameOrLeaf_State1 = {
.callback = SpriteCallbackDummy
};
#if defined(FIRERED)
static const struct SpriteTemplate sSpriteTemplate_FlameOrLeaf_State0 = {
.tileTag = 1,
.paletteTag = 0,
@@ -138,8 +171,25 @@ static const struct SpriteTemplate sSpriteTemplate_FlameOrLeaf_State0 = {
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
#elif defined(LEAFGREEN)
static const struct OamData sOamData_LG_83BF950 = {
.shape = SPRITE_SHAPE(32x16),
.size = SPRITE_SIZE(32x16),
.priority = 3
};
static const struct OamData sOamData_UnknownTemptySprite = {
static const struct SpriteTemplate sSpriteTemplate_FlameOrLeaf_State0 = {
.tileTag = 1,
.paletteTag = 0,
.oam = &sOamData_LG_83BF950,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = SpriteCallbackDummy
};
#endif
static const struct OamData sOamData_UnknownEmptySprite = {
.objMode = ST_OAM_OBJ_NORMAL,
.shape = ST_OAM_V_RECTANGLE,
.size = ST_OAM_SIZE_3,
@@ -151,7 +201,7 @@ static const struct OamData sOamData_UnknownTemptySprite = {
static const struct SpriteTemplate sUnknownEmptySprite = {
.tileTag = 2,
.paletteTag = 2,
.oam = &sOamData_UnknownTemptySprite,
.oam = &sOamData_UnknownEmptySprite,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
@@ -222,26 +272,36 @@ static void (*const sSceneFuncs[])(s16 * data) = {
SetTitleScreenScene_Cry
};
#if defined(FIRERED)
static const struct CompressedSpriteSheet sSpriteSheets[] = {
{(const void *)sFireSpriteTiles, 0x500, 0},
{(const void *)sBlankFireSpriteTiles, 0x500, 1},
{(const void *)gGraphics_TitleScreen_BlankObjTiles, 0x400, 2},
{(const void *)sSlashSpriteTiles, 0x800, 3}
{sFireSpriteTiles, 0x500, 0},
{sBlankFireSpriteTiles, 0x500, 1},
{gGraphics_TitleScreen_BlankObjTiles, 0x400, 2},
{sSlashSpriteTiles, 0x800, 3}
};
#elif defined(LEAFGREEN)
static const struct CompressedSpriteSheet sSpriteSheets[] = {
{sLeafSpriteTiles, 0x580, 0},
{sBlankLeafSpriteTiles, 0x100, 1},
{gGraphics_TitleScreen_BlankObjTiles, 0x400, 2},
{sSlashSpriteTiles, 0x800, 3}
};
#endif
static const struct SpritePalette sSpritePals[] = {
{sSlashSpritePals, 0},
{gGraphics_TitleScreen_FirePals, 2},
{gGraphics_TitleScreen_FireOrLeafPals, 2},
{}
};
#if defined(FIRERED)
static const u8 gUnknown_83BFBD4[] = {
0x04, 0x10, 0x1a, 0x20, 0x30, 0xc8, 0xd8, 0xe0, 0xe8, 0x3c, 0x4c, 0x5c, 0x6c, 0x80, 0x90
};
#if defined(LEAFGREEN)
#elif defined(LEAFGREEN)
static const u16 gUnknown_LG_83BFA10[] = {
50, 80, 110, 60, 90, 70, 100, 50
40, 80, 110, 60, 90, 70, 100, 50
};
#endif
@@ -270,12 +330,12 @@ void CB2_InitTitleScreen(void)
sTitleScreenTimerTaskId = 0xFF;
break;
case 1:
LoadPalette(gGraphics_TitleScreen_PokemonFireRedLogoPals, 0, 0x1A0);
DecompressAndCopyTileDataToVram(0, gGraphics_TitleScreen_PokemonFireRedLogoTiles, 0, 0, 0);
DecompressAndCopyTileDataToVram(0, gGraphics_TitleScreen_PokemonFireRedLogoMap, 0, 0, 1);
LoadPalette(gGraphics_TitleScreen_CharizardPals, 0xD0, 0x20);
DecompressAndCopyTileDataToVram(1, gGraphics_TitleScreen_CharizardTiles, 0, 0, 0);
DecompressAndCopyTileDataToVram(1, gGraphics_TitleScreen_CharizardMap, 0, 0, 1);
LoadPalette(gGraphics_TitleScreen_GameTitleLogoPals, 0, 0x1A0);
DecompressAndCopyTileDataToVram(0, gGraphics_TitleScreen_GameTitleLogoTiles, 0, 0, 0);
DecompressAndCopyTileDataToVram(0, gGraphics_TitleScreen_GameTitleLogoMap, 0, 0, 1);
LoadPalette(gGraphics_TitleScreen_BoxArtMonPals, 0xD0, 0x20);
DecompressAndCopyTileDataToVram(1, gGraphics_TitleScreen_BoxArtMonTiles, 0, 0, 0);
DecompressAndCopyTileDataToVram(1, gGraphics_TitleScreen_BoxArtMonMap, 0, 0, 1);
LoadPalette(gGraphics_TitleScreen_BackgroundPals, 0xF0, 0x20);
DecompressAndCopyTileDataToVram(2, gGraphics_TitleScreen_CopyrightPressStartTiles, 0, 0, 0);
DecompressAndCopyTileDataToVram(2, gGraphics_TitleScreen_CopyrightPressStartMap, 0, 0, 1);
@@ -493,7 +553,7 @@ static void SetTitleScreenScene_FadeIn(s16 * data)
BlendPalettes(r4, 0x10, RGB(30, 30, 31));
BeginNormalPaletteFade(r4, 1, 0x10, 0x00, RGB(30, 30, 31));
ShowBg(0);
CpuCopy16(gGraphics_TitleScreen_CharizardPals, gPlttBufferUnfaded + 0xD0, 0x20);
CpuCopy16(gGraphics_TitleScreen_BoxArtMonPals, gPlttBufferUnfaded + 0xD0, 0x20);
sub_80717A8(0x2000, 1, 0x0F, 0x00, RGB(30, 30, 31), 0, 0);
data[1]++;
}
@@ -803,8 +863,8 @@ static void LoadMainTitleScreenPalsAndResetBgs(void)
sub_8071898();
ResetPaletteFadeControl();
LoadPalette(gGraphics_TitleScreen_PokemonFireRedLogoPals, 0x00, 0x1A0);
LoadPalette(gGraphics_TitleScreen_CharizardPals, 0xD0, 0x20);
LoadPalette(gGraphics_TitleScreen_GameTitleLogoPals, 0x00, 0x1A0);
LoadPalette(gGraphics_TitleScreen_BoxArtMonPals, 0xD0, 0x20);
LoadPalette(gGraphics_TitleScreen_BackgroundPals, 0xF0, 0x20);
LoadPalette(gGraphics_TitleScreen_BackgroundPals, 0xE0, 0x20);
ResetBgPositions();
@@ -909,35 +969,6 @@ static bool32 CreateFlameOrLeafSprite(s32 x, s32 y, s32 xspeed, s32 yspeed, bool
}
return FALSE;
}
#elif defined(LEAFGREEN)
void _CreateFlameOrLeafSprite(s32 y0, s32 x1, s32 y1)
{
u8 spriteId = CreateSprite(&sSpriteTemplate_FlameOrLeaf_State0, 0xF0, y0, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].data[0] = 0xF00;
gSprites[spriteId].data[1] = x1;
gSprites[spriteId].data[2] = y0 << 4;
gSprites[spriteId].data[3] = y1;
gSprites[spriteId].callback = SpriteCallback_TitleScreenFlameOrLeaf;
}
}
void SpriteCallback_LG_8079800(struct Sprite * sprite)
{
sprite->pos1.x -= 7;
if (sprite->pos1.x < -16)
{
sprite->pos1.x = 0x100;
sprite->data[7]++;
if (sprite->data[7] >= NELEMS(gUnknown_LG_83BFA10))
sprite->data[7] = 0;
sprite->pos1.y = gUnknown_LG_83BFA10[sprite->data[7]];
}
}
#define CreateFlameOrLeafSprite ((bool32 (*)())_CreateFlameOrLeafSprite)
#endif //FRLG
static void Task_FlameOrLeafSpawner(u8 taskId)
{
@@ -988,6 +1019,88 @@ static void Task_FlameOrLeafSpawner(u8 taskId)
}
}
#elif defined(LEAFGREEN)
static void CreateFlameOrLeafSprite(s32 y0, s32 x1, s32 y1)
{
u8 spriteId = CreateSprite(&sSpriteTemplate_FlameOrLeaf_State1, 0xF0, y0, 0);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].data[0] = 0xF00;
gSprites[spriteId].data[1] = x1;
gSprites[spriteId].data[2] = y0 << 4;
gSprites[spriteId].data[3] = y1;
gSprites[spriteId].callback = SpriteCallback_TitleScreenFlameOrLeaf;
}
}
static void SpriteCallback_LG_8079800(struct Sprite * sprite)
{
sprite->pos1.x -= 7;
if (sprite->pos1.x < -16)
{
sprite->pos1.x = 0x100;
sprite->data[7]++;
if (sprite->data[7] >= NELEMS(gUnknown_LG_83BFA10))
sprite->data[7] = 0;
sprite->pos1.y = gUnknown_LG_83BFA10[sprite->data[7]];
}
}
static void sub_LG_8079844(void)
{
int i;
u8 spriteId;
for (i = 0; i < 4; i++)
{
spriteId = CreateSprite(&sSpriteTemplate_FlameOrLeaf_State0, 0x100 + 0x28 * i, gUnknown_LG_83BFA10[i], 0xFF);
if (spriteId != MAX_SPRITES)
{
gSprites[spriteId].data[7] = i;
gSprites[spriteId].callback = SpriteCallback_LG_8079800;
}
}
}
static void Task_FlameOrLeafSpawner(u8 taskId)
{
s16 * data = gTasks[taskId].data;
s32 rval;
s32 r6;
s32 r4;
s32 r0;
switch (data[0])
{
case 0:
sub_LG_8079844();
TitleScreen_srand(taskId, 3, 30840);
data[0]++;
break;
case 1:
data[1]++;
if (data[1] >= data[2])
{
data[1] = 0;
data[2] = (TitleScreen_rand(taskId, 3) % 6) + 6;
rval = TitleScreen_rand(taskId, 3) % 30;
r6 = 16;
if (rval >= 6)
{
r6 = 48;
if (rval < 12)
r6 = 24;
}
r4 = (TitleScreen_rand(taskId, 3) % 4) - 2;
r0 = (TitleScreen_rand(taskId, 3) % 88) + 32;
CreateFlameOrLeafSprite(r0, r6, r4);
}
break;
}
}
#endif //FRLG
static void TitleScreen_srand(u8 taskId, u8 field, u16 seed)
{
SetWordTaskArg(taskId, field, seed);
@@ -1016,7 +1129,7 @@ static void SetPalOnOrCreateBlankSprite(bool32 mode)
if (mode)
{
palIdx = IndexOfSpritePaletteTag(2);
LoadPalette(gGraphics_TitleScreen_FirePals, palIdx * 16 + 0x100, 0x20);
LoadPalette(gGraphics_TitleScreen_FireOrLeafPals, palIdx * 16 + 0x100, 0x20);
}
else
CreateBlankSprite();
+64 -66
View File
@@ -528,7 +528,7 @@ static void Task_TrainerCard(u8 taskId)
PutTrainerCardWindow(1);
sTrainerCardDataPtr->var_7BCE = FALSE;
}
if (JOY_NEW(A_BUTTON))
{
HelpSystem_SetSomeVariable2(11);
@@ -748,13 +748,13 @@ static u8 GetTrainerStarCount(struct TrainerCard *trainerCard)
if (trainerCard->hofDebutHours != 0 || trainerCard->hofDebutMinutes != 0 || trainerCard->hofDebutSeconds != 0)
stars++;
if (trainerCard->caughtAllHoenn)
stars++;
if (trainerCard->battleTowerStraightWins > 49)
stars++;
if (trainerCard->hasAllPaintings)
stars++;
@@ -765,7 +765,7 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType)
{
u32 playTime;
u8 i;
trainerCard->gender = gSaveBlock2Ptr->playerGender;
trainerCard->playTimeHours = gSaveBlock2Ptr->playTimeHours;
trainerCard->playTimeMinutes = gSaveBlock2Ptr->playTimeMinutes;
@@ -793,12 +793,12 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType)
trainerCard->linkBattleWins = GetCappedGameStat(GAME_STAT_LINK_BATTLE_WINS, 9999);
trainerCard->linkBattleLosses = GetCappedGameStat(GAME_STAT_LINK_BATTLE_LOSSES, 9999);
trainerCard->pokemonTrades = GetCappedGameStat(GAME_STAT_POKEMON_TRADES, 0xFFFF);
trainerCard->battleTowerWins = 0;
trainerCard->battleTowerStraightWins = 0;
trainerCard->contestsWithFriends = 0;
trainerCard->pokeblocksWithFriends = 0;
trainerCard->hasAllPaintings = FALSE;
trainerCard->money = GetMoney(&gSaveBlock1Ptr->money);
@@ -817,10 +817,10 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType)
trainerCard->stars = 0;
if (trainerCard->hofDebutHours != 0 || (trainerCard->hofDebutMinutes != 0 || trainerCard->hofDebutSeconds != 0))
trainerCard->stars = cardType;
if (HasAllKantoMons())
trainerCard->stars++;
if (HasAllMons())
trainerCard->stars++;
}
@@ -829,46 +829,46 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType)
void TrainerCard_GenerateCardForLinkPlayer(struct TrainerCard *trainerCard)
{
u8 id = 0;
trainerCard->version = VERSION_FIRE_RED;
trainerCard->version = GAME_VERSION;
SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD);
if (GetCardType() != CARD_TYPE_FRLG)
return;
trainerCard->stars = id;
if (trainerCard->hofDebutHours != 0 || trainerCard->hofDebutMinutes != 0 || trainerCard->hofDebutSeconds != 0)
trainerCard->stars = 1;
trainerCard->caughtAllHoenn = HasAllKantoMons();
trainerCard->hasAllMons = HasAllMons();
trainerCard->berriesPicked = gSaveBlock2Ptr->berryPick.berriesPicked;
trainerCard->jumpsInRow = gSaveBlock2Ptr->pokeJump.jumpsInRow;
trainerCard->berryCrushPoints = GetCappedGameStat(GAME_STAT_BERRY_CRUSH_POINTS, 0xFFFF);
trainerCard->unionRoomNum = GetCappedGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES, 0xFFFF);
trainerCard->var_4C = TRUE;
if (trainerCard->caughtAllHoenn)
trainerCard->stars++;
if (trainerCard->hasAllMons)
trainerCard->stars++;
if (trainerCard->berriesPicked >= 200 && trainerCard->jumpsInRow >= 200)
trainerCard->stars++;
id = ((u16)trainerCard->trainerId) % 8;
if (trainerCard->gender == FEMALE)
trainerCard->var_4F = sLinkTrainerCardFacilityClasses[1][id];
else
trainerCard->var_4F = sLinkTrainerCardFacilityClasses[0][id];
trainerCard->var_50[0] = VarGet(VAR_HOF_BRAG_STATE);
trainerCard->var_50[1] = VarGet(VAR_EGG_BRAG_STATE);
trainerCard->var_50[2] = VarGet(VAR_LINK_WIN_BRAG_STATE);
trainerCard->var_4E = VarGet(VAR_TRAINER_CARD_MON_ICON_TINT_IDX);
trainerCard->monSpecies[0] = MailSpeciesToIconSpecies(VarGet(VAR_TRAINER_CARD_MON_ICON_1));
trainerCard->monSpecies[1] = MailSpeciesToIconSpecies(VarGet(VAR_TRAINER_CARD_MON_ICON_2));
trainerCard->monSpecies[2] = MailSpeciesToIconSpecies(VarGet(VAR_TRAINER_CARD_MON_ICON_3));
@@ -881,7 +881,7 @@ static void SetDataFromTrainerCard(void)
{
u32 badgeFlag;
u8 i;
sTrainerCardDataPtr->hasPokedex = FALSE;
sTrainerCardDataPtr->hasHofResult = FALSE;
sTrainerCardDataPtr->hasLinkResults = FALSE;
@@ -889,19 +889,19 @@ static void SetDataFromTrainerCard(void)
sTrainerCardDataPtr->var_E = FALSE;
sTrainerCardDataPtr->var_F = FALSE;
sTrainerCardDataPtr->hasTrades = FALSE;
memset(&sTrainerCardDataPtr->hasBadge, FALSE, BADGE_COUNT);
if (sTrainerCardDataPtr->trainerCard.hasPokedex)
sTrainerCardDataPtr->hasPokedex++;
if (sTrainerCardDataPtr->trainerCard.hofDebutHours != 0
|| sTrainerCardDataPtr->trainerCard.hofDebutMinutes != 0
|| sTrainerCardDataPtr->trainerCard.hofDebutSeconds != 0)
sTrainerCardDataPtr->hasHofResult++;
if (sTrainerCardDataPtr->trainerCard.linkBattleWins != 0 || sTrainerCardDataPtr->trainerCard.linkBattleLosses != 0)
sTrainerCardDataPtr->hasLinkResults++;
if (sTrainerCardDataPtr->trainerCard.pokemonTrades != 0)
sTrainerCardDataPtr->hasTrades++;
@@ -937,7 +937,7 @@ static void sub_8089BD8(u16 arg0)
if (quotient <= 4)
quotient = 0;
sTrainerCardDataPtr->var_456 = quotient;
SetGpuReg(REG_OFFSET_BLDY, sTrainerCardDataPtr->var_456);
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(sTrainerCardDataPtr->var_7BCC, 160 - sTrainerCardDataPtr->var_7BCC));
@@ -1042,7 +1042,7 @@ static bool8 PrintAllOnCardPage1(void)
sTrainerCardDataPtr->printState++;
return FALSE;
}
static bool8 PrintStringsOnCardPage2(void)
{
switch (sTrainerCardDataPtr->printState)
@@ -1093,7 +1093,7 @@ static void PrintNameOnCard(void)
{
u8 buffer[2][32];
u8* txtPtr;
txtPtr = StringCopy(buffer[0], gText_TrainerCardName);
txtPtr = buffer[1];
StringCopy(txtPtr, sTrainerCardDataPtr->trainerCard.playerName);
@@ -1101,12 +1101,12 @@ static void PrintNameOnCard(void)
StringAppend(buffer[0], txtPtr);
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], sTrainerCardPlayerNameXPositions[sTrainerCardDataPtr->cardType], sTrainerCardPlayerNameYPositions[sTrainerCardDataPtr->cardType], sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, buffer[0]);
}
static void PrintIdOnCard(void)
{
u8 buffer[32];
u8* txtPtr;
txtPtr = StringCopy(buffer, gText_TrainerCardIDNo);
ConvertIntToDecimalStringN(txtPtr, sTrainerCardDataPtr->trainerCard.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5);
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], sTrainerCardIdXPositions[sTrainerCardDataPtr->cardType], sTrainerCardIdYPositions[sTrainerCardDataPtr->cardType], sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, buffer);
@@ -1146,7 +1146,7 @@ static void PrintPokedexOnCard(void)
{
u8 buffer[10];
u8 x;
if (FlagGet(FLAG_SYS_POKEDEX_GET))
{
ConvertIntToDecimalStringN(buffer, sTrainerCardDataPtr->trainerCard.caughtMonsCount, 0, 3);
@@ -1183,22 +1183,22 @@ static void PrintTimeOnCard(void)
if (hours > 999)
hours = 999;
if (minutes > 59)
minutes = 59;
FillWindowPixelRect(1, PIXEL_FILL(0), sTrainerCardTimeHoursXPositions[sTrainerCardDataPtr->cardType], sTrainerCardTimeMinutesYPositions[sTrainerCardDataPtr->cardType], 50, 12);
if (sTrainerCardDataPtr->cardType != CARD_TYPE_EMERALD)
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], 20, 88, sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, gText_TrainerCardTime);
else
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], 16, 89, sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, gText_TrainerCardTime);
ConvertIntToDecimalStringN(buffer, hours, STR_CONV_MODE_RIGHT_ALIGN, 3);
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], sTrainerCardTimeHoursXPositions[sTrainerCardDataPtr->cardType],
sTrainerCardTimeMinutesYPositions[sTrainerCardDataPtr->cardType], sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, buffer);
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], sTrainerCardTimeHoursYPositions[sTrainerCardDataPtr->cardType],
sTrainerCardTimeMinutesYPositions[sTrainerCardDataPtr->cardType], sTrainerCardTextColors[sTrainerCardDataPtr->var_7], TEXT_SPEED_FF, gText_Colon2);
ConvertIntToDecimalStringN(buffer, minutes, STR_CONV_MODE_LEADING_ZEROS, 2);
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], sTrainerCardTimeMinutesXPositions[sTrainerCardDataPtr->cardType], sTrainerCardTimeMinutesYPositions[sTrainerCardDataPtr->cardType], sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, buffer);
}
@@ -1209,13 +1209,13 @@ static void PrintProfilePhraseOnCard(void)
{
AddTextPrinterParameterized3(1, 2, 10, sTrainerCardProfilePhraseXPositions[sTrainerCardDataPtr->cardType],
sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, sTrainerCardDataPtr->var_19[0]);
AddTextPrinterParameterized3(1, 2, GetStringWidth(2, sTrainerCardDataPtr->var_19[0], 0) + 16, sTrainerCardProfilePhraseXPositions[sTrainerCardDataPtr->cardType],
sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, sTrainerCardDataPtr->var_19[1]);
AddTextPrinterParameterized3(1, 2, 10, sTrainerCardProfilePhraseYPositions[sTrainerCardDataPtr->cardType],
sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, sTrainerCardDataPtr->var_19[2]);
AddTextPrinterParameterized3(1, 2, GetStringWidth(2, sTrainerCardDataPtr->var_19[2], 0) + 16, sTrainerCardProfilePhraseYPositions[sTrainerCardDataPtr->cardType],
sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, sTrainerCardDataPtr->var_19[3]);
}
@@ -1234,7 +1234,7 @@ static void PrintNameOnCard2(void)
static void sub_808A4FC(void)
{
u8 x;
if (sTrainerCardDataPtr->cardType == CARD_TYPE_FRLG)
{
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], sUnknown_83CD93C[sTrainerCardDataPtr->cardType],
@@ -1243,7 +1243,7 @@ static void sub_808A4FC(void)
else
{
x = sUnknown_83CD93C[sTrainerCardDataPtr->cardType] - GetStringWidth(sTrainerCardFontIds[1], sTrainerCardDataPtr->strings[TRAINER_CARD_STRING_NAME], GetFontAttribute(sTrainerCardFontIds[1], FONTATTR_LETTER_SPACING));
AddTextPrinterParameterized3(1, sTrainerCardFontIds[1], x, sUnknown_83CD93E[sTrainerCardDataPtr->cardType],
sFireRedTrainerCardPage1TextColors, TEXT_SPEED_FF, sTrainerCardDataPtr->strings[TRAINER_CARD_STRING_NAME]);
}
@@ -1253,7 +1253,7 @@ static void PrintHofTimeOnCard(void)
{
u8 buffer[10];
u8* txtPtr;
if (sTrainerCardDataPtr->hasHofResult)
{
ConvertIntToDecimalStringN(buffer, sTrainerCardDataPtr->trainerCard.hofDebutHours, STR_CONV_MODE_RIGHT_ALIGN, 3);
@@ -1279,7 +1279,7 @@ static void PrintHofDebutStringOnCard(void)
static void PrintLinkResultsNumsOnCard(void)
{
u8 buffer[30];
if (sTrainerCardDataPtr->hasLinkResults)
{
StringCopy(sTrainerCardDataPtr->strings[TRAINER_CARD_STRING_LINK_RECORD], sLinkTrainerCardRecordStrings[sTrainerCardDataPtr->cardType]);
@@ -1378,7 +1378,6 @@ static void TrainerCard_PrintPokemonIconsOnCard(void)
}
}
static void sub_808AB10(void)
{
u8 i;
@@ -1398,7 +1397,7 @@ static void sub_808AB10(void)
TintPalette_SepiaTone(sTrainerCardDataPtr->monIconPals, 96);
break;
}
LoadPalette(sTrainerCardDataPtr->monIconPals, 80, 192);
for (i = 0; i < 6; i++)
{
@@ -1410,7 +1409,7 @@ static void sub_808ABE0(void)
{
u8 i;
u8 buffer[4];
memcpy(buffer, sUnknown_83CD958, sizeof(sUnknown_83CD958));
if (sTrainerCardDataPtr->cardType == CARD_TYPE_FRLG && sTrainerCardDataPtr->trainerCard.var_4C == 1)
{
@@ -1479,7 +1478,7 @@ static bool8 SetTrainerCardBgsAndPals(void)
FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 32, 32);
return TRUE;
}
sTrainerCardDataPtr->bgPalLoadState++;
return FALSE;
}
@@ -1499,7 +1498,7 @@ static void LoadTrainerCardTilemap2(const u16* ptr)
dst[32 * i + j] = ptr[0];
}
}
CopyBgTilemapBufferToVram(2);
}
@@ -1518,7 +1517,7 @@ static void LoadTrainerCardTilemap0(const u16* ptr)
dst[32 * i + j] = ptr[0];
}
}
CopyBgTilemapBufferToVram(0);
}
@@ -1543,7 +1542,7 @@ static void TrainerCard_PrintStarsAndBadgesOnCard(void)
}
}
}
CopyBgTilemapBufferToVram(3);
}
@@ -1556,13 +1555,13 @@ static void sub_808B090(void)
FillBgTilemapBufferRect(3, 141, 26, 9, 1, 1, 1);
FillBgTilemapBufferRect(3, 157, 26, 10, 1, 1, 1);
}
if (sTrainerCardDataPtr->trainerCard.berryCrushPoints)
{
FillBgTilemapBufferRect(3, 141, 21, 13, 1, 1, 1);
FillBgTilemapBufferRect(3, 157, 21, 14, 1, 1, 1);
}
if (sTrainerCardDataPtr->trainerCard.unionRoomNum)
{
FillBgTilemapBufferRect(3, 141, 27, 11, 1, 1, 1);
@@ -1577,7 +1576,7 @@ static void sub_808B090(void)
FillBgTilemapBufferRect(3, 157, 26, 10, 1, 1, 0);
}
}
CopyBgTilemapBufferToVram(3);
}
@@ -1629,7 +1628,7 @@ static bool8 sub_808B254(struct Task* task)
{
gScanlineEffectRegBuffers[1][i] = 0;
}
task->data[0]++;
return FALSE;
}
@@ -1647,7 +1646,7 @@ static bool8 sub_808B294(struct Task* task)
sTrainerCardDataPtr->var_7BCC = task->data[1];
sub_8089BD8(task->data[1]);
r7 = task->data[1];
r9 = 160 - r7;
r4 = r9 - r7;
@@ -1663,7 +1662,7 @@ static bool8 sub_808B294(struct Task* task)
{
gScanlineEffectRegBuffers[0][i] = -i;
}
for (; i < (s16)r9; i++)
{
var = r6 >> 16;
@@ -1671,13 +1670,13 @@ static bool8 sub_808B294(struct Task* task)
r5 -= r10;
gScanlineEffectRegBuffers[0][i] = var;
}
var = var_24 >> 16;
for (; i < 160; i++)
{
gScanlineEffectRegBuffers[0][i] = var;
}
sTrainerCardDataPtr->allowDMACopy = TRUE;
if (task->data[1] >= 77)
task->data[0]++;
@@ -1749,7 +1748,7 @@ static bool8 sub_808B4D8(struct Task* task)
LoadTrainerCardTilemap0(&sTrainerCardDataPtr->var_4BC);
TrainerCard_PrintStarsAndBadgesOnCard();
}
PutTrainerCardWindow(1);
sTrainerCardDataPtr->var_8 ^= 1;
task->data[0]++;
@@ -1771,7 +1770,7 @@ static bool8 sub_808B540(struct Task* task)
sTrainerCardDataPtr->var_7BCC = task->data[1];
sub_8089BD8(task->data[1]);
r7 = task->data[1];
r9 = 160 - r7;
r4 = r9 - r7;
@@ -1795,13 +1794,13 @@ static bool8 sub_808B540(struct Task* task)
r5 += r10;
gScanlineEffectRegBuffers[0][i] = var;
}
var = var_24 >> 16;
for (; i < 160; i++)
{
gScanlineEffectRegBuffers[0][i] = var;
}
sTrainerCardDataPtr->allowDMACopy = TRUE;
if (task->data[1] <= 0)
task->data[0]++;
@@ -1826,7 +1825,7 @@ void ShowPlayerTrainerCard(void (*callback)(void))
sTrainerCardDataPtr->isLink = TRUE;
else
sTrainerCardDataPtr->isLink = FALSE;
sTrainerCardDataPtr->language = GAME_LANGUAGE;
TrainerCard_GenerateCardForLinkPlayer(&sTrainerCardDataPtr->trainerCard);
SetMainCallback2(CB2_InitTrainerCard);
@@ -1855,7 +1854,7 @@ static void sub_808B774(void)
sTrainerCardDataPtr->cardType = CARD_TYPE_EMERALD;
else
sTrainerCardDataPtr->cardType = CARD_TYPE_FRLG;
for (i = 0; i < 4; i++)
{
CopyEasyChatWord(sTrainerCardDataPtr->var_19[i], sTrainerCardDataPtr->trainerCard.var_28[i]);
@@ -1883,7 +1882,7 @@ static u8 GetCardType(void)
static void sub_808B838(void)
{
u8 val = sLinkTrainerCardFrontPics[sTrainerCardDataPtr->cardType][sTrainerCardDataPtr->trainerCard.gender];
if (InUnionRoom() == TRUE && gReceivedRemoteLinkPlayers == 1)
{
val = sTrainerCardDataPtr->trainerCard.var_4F;
@@ -1929,4 +1928,3 @@ static void Unref_InitTrainerCardLink2(void (*callback)(void))
ShowTrainerCardInLink(CARD_TYPE_FRLG, callback);
SetMainCallback2(CB2_InitTrainerCard);
}
+7
View File
@@ -39,6 +39,13 @@ int main(int argc, char *argv[])
return "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from " + jsonfilepath +" and Inja template " + templateFilepath + "\n//\n";
});
env.add_callback("contains", 2, [](Arguments& args) {
string word = args.at(0)->get<string>();
string check = args.at(1)->get<string>();
return word.find(check) != std::string::npos;
});
env.add_callback("subtract", 2, [](Arguments& args) {
int minuend = args.at(0)->get<int>();
int subtrahend = args.at(1)->get<int>();