Skip to content

Commit 377749c

Browse files
committed
2 parents d18d708 + b496791 commit 377749c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+532
-462
lines changed

Makefile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ $(foreach obj, $(pokeyellow_vc_obj), $(eval $(call DEP,$(obj),$(obj:_vc.o=.asm))
119119
endif
120120

121121

122-
%.asm: ;
123-
124-
125122
pokeyellow_pad = 0x00
126123
pokeyellow_debug_pad = 0xff
127124
pokeyellow_vc_pad = 0x00
@@ -157,8 +154,6 @@ gfx/surfing_pikachu/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace
157154

158155
### Catch-all graphics rules
159156

160-
%.png: ;
161-
162157
%.2bpp: %.png
163158
$(RGBGFX) --colors dmg=e4 $(rgbgfx) -o $@ $<
164159
$(if $(tools/gfx),\
@@ -175,7 +170,18 @@ gfx/surfing_pikachu/surfing_pikachu_3.2bpp: tools/gfx += --trim-whitespace
175170

176171
### Catch-all audio rules
177172

178-
%.wav: ;
179-
180173
%.pcm: %.wav
181174
tools/pcm $< $@
175+
176+
177+
### File extensions that are never generated and should be manually created
178+
179+
%.asm: ;
180+
%.inc: ;
181+
%.png: ;
182+
%.pal: ;
183+
%.bin: ;
184+
%.blk: ;
185+
%.bst: ;
186+
%.rle: ;
187+
%.wav: ;

constants/hardware.inc

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endc
2222
; Define the include guard and the current hardware.inc version
2323
; (do this after the RGBDS version check since the `def` syntax depends on it)
2424
def HARDWARE_INC equ 1
25-
def HARDWARE_INC_VERSION equs "5.2.0"
25+
def HARDWARE_INC_VERSION equs "5.3.0"
2626

2727
; Usage: rev_Check_hardware_inc <min_ver>
2828
; Examples:
@@ -76,6 +76,14 @@ def B_JOYP_RIGHT equ 0 ; 0 = Right is pressed (if reading Control Pad) [ro]
7676
def JOYP_LEFT equ 1 << B_JOYP_LEFT
7777
def JOYP_RIGHT equ 1 << B_JOYP_RIGHT
7878

79+
; SGB command packet transfer uses for JOYP bits
80+
def B_JOYP_SGB_ONE equ 5 ; 0 = sending 1 bit
81+
def B_JOYP_SGB_ZERO equ 4 ; 0 = sending 0 bit
82+
def JOYP_SGB_START equ %00_00_0000 ; start SGB packet transfer
83+
def JOYP_SGB_ONE equ %00_01_0000 ; send 1 bit
84+
def JOYP_SGB_ZERO equ %00_10_0000 ; send 0 bit
85+
def JOYP_SGB_FINISH equ %00_11_0000 ; finish SGB packet transfer
86+
7987
; Combined input byte, with Control Pad in high nybble (conventional order)
8088
def B_PAD_DOWN equ 7
8189
def B_PAD_UP equ 6
@@ -96,7 +104,6 @@ def B_PAD_A equ 0
96104
def PAD_B equ 1 << B_PAD_B
97105
def PAD_A equ 1 << B_PAD_A
98106

99-
100107
; Combined input byte, with Control Pad in low nybble (swapped order)
101108
def B_PAD_SWAP_START equ 7
102109
def B_PAD_SWAP_SELECT equ 6
@@ -222,7 +229,7 @@ def AUD1ENV_PACE equ %00000_111 ; how long between envelope iterations
222229
; (in 64 Hz ticks, ~15.6 ms apart) [r/w]
223230

224231
; -- AUD1LOW / NR13 ($FF13) ---------------------------------------------------
225-
; Audio channel 1 period (low 8 bits) [r/w]
232+
; Audio channel 1 period (low 8 bits) [wo]
226233
def rAUD1LOW equ $FF13
227234

228235
; -- AUD1HIGH / NR14 ($FF14) --------------------------------------------------
@@ -266,7 +273,7 @@ def AUD2ENV_PACE equ %00000_111 ; how long between envelope iterations
266273
; (in 64 Hz ticks, ~15.6 ms apart) [r/w]
267274

268275
; -- AUD2LOW / NR23 ($FF18) ---------------------------------------------------
269-
; Audio channel 2 period (low 8 bits) [r/w]
276+
; Audio channel 2 period (low 8 bits) [wo]
270277
def rAUD2LOW equ $FF18
271278

272279
; -- AUD2HIGH / NR24 ($FF19) --------------------------------------------------
@@ -304,7 +311,7 @@ def AUD3LEVEL_VOLUME equ %0_11_00000 ; volume level [r/w]
304311
def AUD3LEVEL_25 equ %0_11_00000 ; 25%
305312

306313
; -- AUD3LOW / NR33 ($FF1D) ---------------------------------------------------
307-
; Audio channel 3 period (low 8 bits) [r/w]
314+
; Audio channel 3 period (low 8 bits) [wo]
308315
def rAUD3LOW equ $FF1D
309316

310317
; -- AUD3HIGH / NR34 ($FF1E) --------------------------------------------------
@@ -927,15 +934,18 @@ def TILE_HEIGHT equ 8 ; height of tile in pixels
927934
def TILE_SIZE equ 16 ; size of tile in bytes (2 bits/pixel)
928935

929936
def COLOR_SIZE equ 2 ; size of color in bytes (little-endian BGR555)
930-
def B_COLOR_RED equ 0 ; bits 4-0
931-
def B_COLOR_GREEN equ 5 ; bits 9-5
932-
def B_COLOR_BLUE equ 10 ; bits 14-10
937+
def PAL_COLORS equ 4 ; colors per palette
938+
def PAL_SIZE equ COLOR_SIZE * PAL_COLORS ; size of palette in bytes
939+
940+
def COLOR_CH_WIDTH equ 5 ; bits per RGB color channel
941+
def COLOR_CH_MAX equ (1 << COLOR_CH_WIDTH) - 1
942+
def B_COLOR_RED equ COLOR_CH_WIDTH * 0 ; bits 4-0
943+
def B_COLOR_GREEN equ COLOR_CH_WIDTH * 1 ; bits 9-5
944+
def B_COLOR_BLUE equ COLOR_CH_WIDTH * 2 ; bits 14-10
933945
def COLOR_RED equ %000_11111 ; for the low byte
934946
def COLOR_GREEN_LOW equ %111_00000 ; for the low byte
935947
def COLOR_GREEN_HIGH equ %0_00000_11 ; for the high byte
936948
def COLOR_BLUE equ %0_11111_00 ; for the high byte
937-
def PAL_COLORS equ 4 ; colors per palette
938-
def PAL_SIZE equ COLOR_SIZE * PAL_COLORS ; size of palette in bytes
939949

940950
; (DMG only) grayscale shade indexes for BGP, OBP0, and OBP1
941951
def SHADE_WHITE equ %00
@@ -1032,6 +1042,22 @@ def B_BOOTUP_B_AGB equ 0
10321042
def BOOTUP_B_CGB equ 0 << B_BOOTUP_B_AGB
10331043
def BOOTUP_B_AGB equ 1 << B_BOOTUP_B_AGB
10341044

1045+
; Register C = CPU qualifier
1046+
def BOOTUP_C_DMG equ $13
1047+
def BOOTUP_C_SGB equ $14
1048+
def BOOTUP_C_CGB equ $00 ; CGB or AGB
1049+
1050+
; Register D = color qualifier
1051+
def BOOTUP_D_MONO equ $00 ; DMG, MGB, SGB, or CGB or AGB in DMG mode
1052+
def BOOTUP_D_COLOR equ $FF ; CGB or AGB
1053+
1054+
; Register E = CPU qualifier (distinguishes DMG variants)
1055+
def BOOTUP_E_DMG0 equ $C1
1056+
def BOOTUP_E_DMG equ $C8
1057+
def BOOTUP_E_SGB equ $00
1058+
def BOOTUP_E_CGB_DMGMODE equ $08 ; CGB or AGB in DMG mode
1059+
def BOOTUP_E_CGB equ $56 ; CGB or AGB
1060+
10351061

10361062
;******************************************************************************
10371063
; Aliases

constants/item_constants.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
const HYPER_POTION ; $12
2828
const SUPER_POTION ; $13
2929
const POTION ; $14
30+
; badges use item IDs (see scripts/CeruleanBadgeHouse.asm)
3031
const BOULDERBADGE ; $15
3132
DEF SAFARI_BAIT EQU BOULDERBADGE ; overload
3233
const CASCADEBADGE ; $16
@@ -94,7 +95,7 @@ DEF SAFARI_ROCK EQU CASCADEBADGE ; overload
9495
const MAX_ELIXER ; $53
9596
DEF NUM_ITEMS EQU const_value - 1
9697

97-
; elevator floors use item IDs
98+
; elevator floors use item IDs (see scripts/CeladonMartElevator.asm and scripts/SilphCoElevator.asm)
9899
const FLOOR_B2F ; $54
99100
const FLOOR_B1F ; $55
100101
const FLOOR_1F ; $56

constants/misc_constants.asm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ DEF TRUE EQU 1
1010

1111
; input
1212
DEF NO_INPUT EQU 0
13+
14+
; SGB command MLT_REQ can be used to detect SGB hardware
15+
DEF JOYP_SGB_MLT_REQ EQU %00000011

constants/ram_constants.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ DEF BIT_NO_PREVIOUS_MAP EQU 7
5757

5858
; wCurrentBoxNum
5959
DEF BIT_HAS_CHANGED_BOXES EQU 7
60+
DEF BOX_NUM_MASK EQU %01111111
6061

6162
; wObtainedBadges, wBeatGymFlags
6263
const_def
@@ -161,3 +162,6 @@ DEF NUM_BADGES EQU const_value
161162
const_def
162163
const BIT_PLAYER_LOWER_Y ; 0
163164
const BIT_PLAYER_LOWER_X ; 1
165+
166+
; rLCDC
167+
DEF LCDC_DEFAULT EQU LCDC_ON | LCDC_WIN_9C00 | LCDC_WIN_ON | LCDC_BLOCK21 | LCDC_BG_9800 | LCDC_OBJ_8 | LCDC_OBJ_ON | LCDC_BG_ON

data/events/trades.asm

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
1+
MACRO npctrade
2+
; give mon, get mon, dialog id, nickname
3+
db \1, \2, \3
4+
dname \4, NAME_LENGTH
5+
ENDM
6+
17
TradeMons:
28
; entries correspond to TRADE_FOR_* constants
39
table_width 3 + NAME_LENGTH
4-
; give mon, get mon, dialog id, nickname
510
; The two instances of TRADE_DIALOGSET_EVOLUTION are a leftover
611
; from the Japanese Blue trades, which used species that evolve.
712
; TRADE_DIALOGSET_EVOLUTION did not refer to evolution in Japanese
813
; Red/Green. Japanese Blue changed _AfterTrade2Text to say your Pokémon
914
; "went and evolved" and also changed the trades to match. English
1015
; Red/Blue uses the original JP Red/Green trades but with the JP Blue
1116
; post-trade text.
12-
db LICKITUNG, DUGTRIO, TRADE_DIALOGSET_CASUAL, "GURIO@@@@@@"
13-
db CLEFAIRY, MR_MIME, TRADE_DIALOGSET_CASUAL, "MILES@@@@@@"
14-
db BUTTERFREE, BEEDRILL, TRADE_DIALOGSET_HAPPY, "STINGER@@@@" ; unused
15-
db KANGASKHAN, MUK, TRADE_DIALOGSET_CASUAL, "STICKY@@@@@"
16-
db MEW, MEW, TRADE_DIALOGSET_HAPPY, "BART@@@@@@@" ; unused
17-
db TANGELA, PARASECT, TRADE_DIALOGSET_CASUAL, "SPIKE@@@@@@"
18-
db PIDGEOT, PIDGEOT, TRADE_DIALOGSET_EVOLUTION, "MARTY@@@@@@" ; unused
19-
db GOLDUCK, RHYDON, TRADE_DIALOGSET_EVOLUTION, "BUFFY@@@@@@"
20-
db GROWLITHE, DEWGONG, TRADE_DIALOGSET_HAPPY, "CEZANNE@@@@"
21-
db CUBONE, MACHOKE, TRADE_DIALOGSET_HAPPY, "RICKY@@@@@@"
17+
npctrade LICKITUNG, DUGTRIO, TRADE_DIALOGSET_CASUAL, "GURIO"
18+
npctrade CLEFAIRY, MR_MIME, TRADE_DIALOGSET_CASUAL, "MILES"
19+
npctrade BUTTERFREE, BEEDRILL, TRADE_DIALOGSET_HAPPY, "STINGER" ; unused
20+
npctrade KANGASKHAN, MUK, TRADE_DIALOGSET_CASUAL, "STICKY"
21+
npctrade MEW, MEW, TRADE_DIALOGSET_HAPPY, "BART" ; unused
22+
npctrade TANGELA, PARASECT, TRADE_DIALOGSET_CASUAL, "SPIKE"
23+
npctrade PIDGEOT, PIDGEOT, TRADE_DIALOGSET_EVOLUTION, "MARTY" ; unused
24+
npctrade GOLDUCK, RHYDON, TRADE_DIALOGSET_EVOLUTION, "BUFFY"
25+
npctrade GROWLITHE, DEWGONG, TRADE_DIALOGSET_HAPPY, "CEZANNE"
26+
npctrade CUBONE, MACHOKE, TRADE_DIALOGSET_HAPPY, "RICKY"
2227
assert_table_length NUM_NPC_TRADES

data/maps/hide_show_data.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ MapHSPointers:
256256
dw -1 ; end
257257

258258
NoHS:
259-
db $FF, $FF, $FF
259+
db -1, -1, -1 ; end
260260

261261
MissableObjects:
262262
; entries correspond to HS_* constants (see constants/hide_show_constants)
@@ -578,5 +578,5 @@ BluesHouseHSCopy: ; unreferenced
578578
db BLUES_HOUSE, BLUESHOUSE_DAISY1, SHOW
579579
db BLUES_HOUSE, BLUESHOUSE_DAISY2, HIDE
580580
db BLUES_HOUSE, BLUESHOUSE_TOWN_MAP, SHOW
581-
db $FF, $01, SHOW ; end
582-
assert_table_length NUM_HS_OBJECTS + 1
581+
assert_table_length NUM_HS_OBJECTS
582+
db -1, 1, SHOW ; end

data/maps/objects/Route2Gate.asm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
object_const_def
2-
const_export ROUTE2_OAKS_AIDE
3-
const_export ROUTE2_YOUNGSTER
2+
const_export ROUTE2GATE_OAKS_AIDE
3+
const_export ROUTE2GATE_YOUNGSTER
44

55
Route2Gate_Object:
66
db $a ; border block

0 commit comments

Comments
 (0)