Skip to content

Commit

Permalink
Do More Version Exclusive Stuff
Browse files Browse the repository at this point in the history
Player and Rival default names, Game Corner prizes, and slot machines now switch depending on the version key.

Additionally, removed redundant ifdefs for Firered vs. Leafgreen. The only one left is in the credits, which needs to wait until it's fully decompiled to fix for the version key.
  • Loading branch information
Deokishisu committed Jan 1, 2021
1 parent 90bfed2 commit 941424a
Show file tree
Hide file tree
Showing 13 changed files with 316 additions and 201 deletions.
11 changes: 2 additions & 9 deletions asm/crt0.s
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.include "constants/gba_constants.inc"
.include "constants/misc_constants.inc"
.include "constants/version.inc"

.syntax unified

Expand Down Expand Up @@ -50,16 +49,10 @@ GPIOPortReadEnable: @ 80000C8
@ 8000100
.global CartIdent
CartIdent:
.4byte GAME_VERSION
.4byte GAME_LANGUAGE
.4byte 4
.4byte 2
.game_name:
.ifdef FIRERED
.ascii "pokemon red version"
.else
.ifdef LEAFGREEN
.ascii "pokemon green version"
.endif
.endif
.space .game_name+0x20-.
.4byte gMonFrontPicTable
.4byte gMonBackPicTable
Expand Down
1 change: 0 additions & 1 deletion constants/constants.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
.include "constants/battle_move_constants.inc"
@ .include "constants/trainer_constants.inc"
.include "constants/berry_constants.inc"
.include "constants/version.inc"
.include "constants/battle.inc"
.include "constants/battle_text.inc"
.include "constants/contest_move_effects.inc"
8 changes: 0 additions & 8 deletions constants/misc_constants.inc
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@
.set OBJ_IMAGE_ANIM_H_FLIP, 1 << 6
.set OBJ_IMAGE_ANIM_V_FLIP, 1 << 7

.ifdef ENGLISH
.equiv GAME_LANGUAGE, 2
.else
.ifdef GERMAN
.equiv GAME_LANGUAGE, 5
.endif
.endif

.equiv ENEMY_TYPE1, 0
.equiv ENEMY_TYPE2, 1
.equiv PLAYER_TYPE1, 2
Expand Down
5 changes: 0 additions & 5 deletions constants/version.inc

This file was deleted.

188 changes: 112 additions & 76 deletions data/maps/CeladonCity_GameCorner_PrizeRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,36 @@ CeladonCity_GameCorner_PrizeRoom_EventScript_PrizeClerkMons:: @ 816CB88
goto_if_questlog EventScript_ReleaseEnd
showcoinsbox 0, 0
msgbox CeladonCity_GameCorner_PrizeRoom_Text_WeExchangeCoinsForPrizes
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ChoosePrizeMon
callnative IsVersionFireRedToVarResult
compare VAR_RESULT, 0
goto_if_ne CeladonCity_GameCorner_PrizeRoom_EventScript_ChoosePrizeMon_LG
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ChoosePrizeMon_FR
end

CeladonCity_GameCorner_PrizeRoom_EventScript_ChoosePrizeMon:: @ 816CBB2
CeladonCity_GameCorner_PrizeRoom_EventScript_ChoosePrizeMon_FR:: @ 816CBB2
message CeladonCity_GameCorner_PrizeRoom_Text_WhichPrize
waitmessage
multichoice 11, 0, MULTICHOICE_GAME_CORNER_POKEMON_PRIZES, FALSE
multichoice 11, 0, MULTICHOICE_GAME_CORNER_POKEMON_PRIZES_FR, FALSE
switch VAR_RESULT
case 0, CeladonCity_GameCorner_PrizeRoom_EventScript_Abra
case 1, CeladonCity_GameCorner_PrizeRoom_EventScript_Clefairy
case 2, CeladonCity_GameCorner_PrizeRoom_EventScript_DratiniPinsir
case 3, CeladonCity_GameCorner_PrizeRoom_EventScript_ScytherDratini
case 4, CeladonCity_GameCorner_PrizeRoom_EventScript_Porygon
case 0, CeladonCity_GameCorner_PrizeRoom_EventScript_Abra_FR
case 1, CeladonCity_GameCorner_PrizeRoom_EventScript_Clefairy_FR
case 2, CeladonCity_GameCorner_PrizeRoom_EventScript_DratiniPinsir_FR
case 3, CeladonCity_GameCorner_PrizeRoom_EventScript_ScytherDratini_FR
case 4, CeladonCity_GameCorner_PrizeRoom_EventScript_Porygon_FR
case 5, CeladonCity_GameCorner_PrizeRoom_EventScript_EndPrizeExchange
case 127, CeladonCity_GameCorner_PrizeRoom_EventScript_EndPrizeExchange
end

CeladonCity_GameCorner_PrizeRoom_EventScript_ChoosePrizeMon_LG:: @ 816CBB2
message CeladonCity_GameCorner_PrizeRoom_Text_WhichPrize
waitmessage
multichoice 11, 0, MULTICHOICE_GAME_CORNER_POKEMON_PRIZES_LG, FALSE
switch VAR_RESULT
case 0, CeladonCity_GameCorner_PrizeRoom_EventScript_Abra_LG
case 1, CeladonCity_GameCorner_PrizeRoom_EventScript_Clefairy_LG
case 2, CeladonCity_GameCorner_PrizeRoom_EventScript_DratiniPinsir_LG
case 3, CeladonCity_GameCorner_PrizeRoom_EventScript_ScytherDratini_LG
case 4, CeladonCity_GameCorner_PrizeRoom_EventScript_Porygon_LG
case 5, CeladonCity_GameCorner_PrizeRoom_EventScript_EndPrizeExchange
case 127, CeladonCity_GameCorner_PrizeRoom_EventScript_EndPrizeExchange
end
Expand All @@ -38,72 +55,67 @@ CeladonCity_GameCorner_PrizeRoom_EventScript_EndPrizeExchange:: @ 816CC10
release
end

CeladonCity_GameCorner_PrizeRoom_EventScript_Abra:: @ 816CC15
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_Abra_FR:: @ 816CC15
setvar VAR_TEMP_1, SPECIES_ABRA
setvar VAR_TEMP_2, 180
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_FR
end

CeladonCity_GameCorner_PrizeRoom_EventScript_Abra_LG:: @ 816CC15
setvar VAR_TEMP_1, SPECIES_ABRA
setvar VAR_TEMP_2, 120
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_LG
end

CeladonCity_GameCorner_PrizeRoom_EventScript_Clefairy:: @ 816CC25
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_Clefairy_FR:: @ 816CC25
setvar VAR_TEMP_1, SPECIES_CLEFAIRY
setvar VAR_TEMP_2, 500
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_FR
end

CeladonCity_GameCorner_PrizeRoom_EventScript_Clefairy_LG:: @ 816CC25
setvar VAR_TEMP_1, SPECIES_CLEFAIRY
setvar VAR_TEMP_2, 750
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_LG
end

CeladonCity_GameCorner_PrizeRoom_EventScript_DratiniPinsir:: @ 816CC35
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_DratiniPinsir_FR:: @ 816CC35
setvar VAR_TEMP_1, SPECIES_DRATINI
setvar VAR_TEMP_2, 2800
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_FR
end

CeladonCity_GameCorner_PrizeRoom_EventScript_DratiniPinsir_LG:: @ 816CC35
setvar VAR_TEMP_1, SPECIES_PINSIR
setvar VAR_TEMP_2, 2500
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_LG
end

CeladonCity_GameCorner_PrizeRoom_EventScript_ScytherDratini:: @ 816CC45
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_ScytherDratini_FR:: @ 816CC45
setvar VAR_TEMP_1, SPECIES_SCYTHER
setvar VAR_TEMP_2, 5500
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_FR
end

CeladonCity_GameCorner_PrizeRoom_EventScript_ScytherDratini_LG:: @ 816CC45
setvar VAR_TEMP_1, SPECIES_DRATINI
setvar VAR_TEMP_2, 4600
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_LG
end

CeladonCity_GameCorner_PrizeRoom_EventScript_Porygon:: @ 816CC55
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_Porygon_FR:: @ 816CC55
setvar VAR_TEMP_1, SPECIES_PORYGON
setvar VAR_TEMP_2, 9999
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_FR
end

CeladonCity_GameCorner_PrizeRoom_EventScript_Porygon_LG:: @ 816CC55
setvar VAR_TEMP_1, SPECIES_PORYGON
setvar VAR_TEMP_2, 6500
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon
goto CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_LG
end

CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon:: @ 816CC65
CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_FR:: @ 816CC65
getspeciesname 0, VAR_TEMP_1
msgbox CeladonCity_GameCorner_PrizeRoom_Text_YouWantPrize, MSGBOX_YESNO
compare VAR_RESULT, NO
Expand All @@ -113,64 +125,88 @@ CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon:: @ 816CC65
goto_if_lt CeladonCity_GameCorner_PrizeRoom_EventScript_NotEnoughCoins
textcolor 3
switch VAR_TEMP_1
case SPECIES_ABRA, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveAbra
case SPECIES_CLEFAIRY, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveClefairy
case SPECIES_DRATINI, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveDratini
case SPECIES_SCYTHER, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveScyther
case SPECIES_PORYGON, CeladonCity_GameCorner_PrizeRoom_EventScript_GivePorygon
case SPECIES_PINSIR, CeladonCity_GameCorner_PrizeRoom_EventScript_GivePinsir
case SPECIES_ABRA, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveAbra_FR
case SPECIES_CLEFAIRY, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveClefairy_FR
case SPECIES_DRATINI, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveDratini_FR
case SPECIES_SCYTHER, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveScyther_FR
case SPECIES_PORYGON, CeladonCity_GameCorner_PrizeRoom_EventScript_GivePorygon_FR
case SPECIES_PINSIR, CeladonCity_GameCorner_PrizeRoom_EventScript_GivePinsir_FR
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveAbra:: @ 816CCD4
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_ConfirmPrizeMon_LG:: @ 816CC65
getspeciesname 0, VAR_TEMP_1
msgbox CeladonCity_GameCorner_PrizeRoom_Text_YouWantPrize, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq CeladonCity_GameCorner_PrizeRoom_EventScript_EndPrizeExchange
checkcoins VAR_RESULT
compare VAR_RESULT, VAR_TEMP_2
goto_if_lt CeladonCity_GameCorner_PrizeRoom_EventScript_NotEnoughCoins
textcolor 3
switch VAR_TEMP_1
case SPECIES_ABRA, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveAbra_LG
case SPECIES_CLEFAIRY, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveClefairy_LG
case SPECIES_DRATINI, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveDratini_LG
case SPECIES_SCYTHER, CeladonCity_GameCorner_PrizeRoom_EventScript_GiveScyther_LG
case SPECIES_PORYGON, CeladonCity_GameCorner_PrizeRoom_EventScript_GivePorygon_LG
case SPECIES_PINSIR, CeladonCity_GameCorner_PrizeRoom_EventScript_GivePinsir_LG
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveAbra_FR:: @ 816CCD4
givemon VAR_TEMP_1, 9, ITEM_NONE
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveAbra_LG:: @ 816CCD4
givemon VAR_TEMP_1, 7, ITEM_NONE
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveClefairy:: @ 816CCE9
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_GiveClefairy_FR:: @ 816CCE9
givemon VAR_TEMP_1, 8, ITEM_NONE
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveClefairy_LG:: @ 816CCE9
givemon VAR_TEMP_1, 12, ITEM_NONE
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveDratini:: @ 816CCFE
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_GiveDratini_FR:: @ 816CCFE
givemon VAR_TEMP_1, 18, ITEM_NONE
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveDratini_LG:: @ 816CCFE
givemon VAR_TEMP_1, 24, ITEM_NONE
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveScyther:: @ 816CD13
CeladonCity_GameCorner_PrizeRoom_EventScript_GiveScyther_FR:: @ 816CD13
givemon VAR_TEMP_1, 25, ITEM_NONE
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GiveScyther_LG:: @ 816CD13
givemon VAR_TEMP_1, 25, ITEM_NONE
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GivePorygon:: @ 816CD28
.ifdef FIRERED
CeladonCity_GameCorner_PrizeRoom_EventScript_GivePorygon_FR:: @ 816CD28
givemon VAR_TEMP_1, 26, ITEM_NONE
.else
.ifdef LEAFGREEN
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GivePorygon_LG:: @ 816CD28
givemon VAR_TEMP_1, 18, ITEM_NONE
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GivePinsir_FR:: @ 816CD3D
givemon VAR_TEMP_1, 18, ITEM_NONE
.endif
.endif
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end

CeladonCity_GameCorner_PrizeRoom_EventScript_GivePinsir:: @ 816CD3D
CeladonCity_GameCorner_PrizeRoom_EventScript_GivePinsir_LG:: @ 816CD3D
givemon VAR_TEMP_1, 18, ITEM_NONE
goto CeladonCity_GameCorner_PrizeRoom_EventScript_CheckReceivedMon
end
Expand Down
2 changes: 0 additions & 2 deletions include/constants/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
// 6 goes unused but the theory is it was meant to be Korean
#define LANGUAGE_SPANISH 7

#ifdef ENGLISH
#define GAME_LANGUAGE (LANGUAGE_ENGLISH)
#endif

#define PC_ITEMS_COUNT 30
#define BAG_ITEMS_COUNT 47
Expand Down
4 changes: 2 additions & 2 deletions include/constants/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#define MULTICHOICE_EXIT_2 11
#define MULTICHOICE_EXIT_3 12
#define MULTICHOICE_BIKE_SHOP 13
#define MULTICHOICE_GAME_CORNER_POKEMON_PRIZES 14
#define MULTICHOICE_GAME_CORNER_POKEMON_PRIZES_FR 14
#define MULTICHOICE_TRAINER_SCHOOL_WHITEBOARD 15
#define MULTICHOICE_YES_NO_INFO 16
#define MULTICHOICE_SINGLE_DOUBLE_MULTI_INFO_EXIT 17
Expand Down Expand Up @@ -66,7 +66,7 @@
#define MULTICHOICE_SEAGALLOP_V13 59
#define MULTICHOICE_SEAGALLOP_V12 60
#define MULTICHOICE_SEAGALLOP_VERMILION 61
#define MULTICHOICE_62 62
#define MULTICHOICE_GAME_CORNER_POKEMON_PRIZES_LG 62
#define MULTICHOICE_JOIN_OR_LEAD 63
#define MULTICHOICE_TRAINER_TOWER_MODE 64
#define MULTICHOICE_SEVII_FARAWAY 65
Expand Down
2 changes: 0 additions & 2 deletions include/strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -805,8 +805,6 @@ extern const u8 gText_Charcoal_1000Coins[];
extern const u8 gText_MysticWater_1000Coins[];
extern const u8 gText_YellowFlute_1600Coins[];
extern const u8 gText_SmokeBall_800Coins[];
extern const u8 gText_Dummy_8417F67[];
extern const u8 gText_Dummy_8417F68[];
extern const u8 gText_BecomeLeader[];
extern const u8 gText_JoinGroup[];
extern const u8 gText_Cool_2[];
Expand Down
4 changes: 0 additions & 4 deletions src/menu2.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,7 @@ static const u8 sMonSpriteAnchorCoords[][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}
Expand Down
Loading

0 comments on commit 941424a

Please sign in to comment.