Skip to content

Commit 874759f

Browse files
committed
Newbox Integration
1 parent 8c68cdd commit 874759f

File tree

110 files changed

+7783
-5973
lines changed

Some content is hidden

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

110 files changed

+7783
-5973
lines changed

charmap.asm constants/charmap.asm

File renamed without changes.

constants/hardware_constants.asm

+11
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,17 @@ DEF rLCDC_WINDOW_TILEMAP EQU 6 ; 0=9800-9BFF, 1=9C00-9FFF
125125
DEF rLCDC_ENABLE EQU 7 ; 0=Off, 1=On
126126
DEF LCDC_DEFAULT EQU (1 << rLCDC_ENABLE) | (1 << rLCDC_WINDOW_TILEMAP) | (1 << rLCDC_WINDOW_ENABLE) | (1 << rLCDC_SPRITES_ENABLE) | (1 << rLCDC_BG_PRIORITY)
127127
DEF rSTAT EQU $ff41 ; LCDC Status (R/W)
128+
DEF rSTAT_INT_LYC EQU 6 ; LYC=LY interrupt
129+
DEF rSTAT_INT_MODE_2 EQU 5 ; Mode 2 interrupt (OAM search)
130+
DEF rSTAT_INT_MODE_1 EQU 4 ; Mode 1 interrupt (VBlank)
131+
DEF rSTAT_INT_MODE_0 EQU 3 ; Mode 0 interrupt (HBlank)
132+
DEF rSTAT_LYC_CMP EQU 2 ; LYC=LY flag
133+
DEF rSTAT_MODE_0 EQU %00 ; HBlank
134+
DEF rSTAT_MODE_1 EQU %01 ; VBlank
135+
DEF rSTAT_MODE_2 EQU %10 ; Searching OAM
136+
DEF rSTAT_MODE_3 EQU %11 ; Transferring data to LCD
137+
DEF rSTAT_MODE_MASK EQU %11
138+
DEF rSTAT_INT_DEFAULT EQU rSTAT_INT_MODE_0
128139
DEF rSCY EQU $ff42 ; Scroll Y (R/W)
129140
DEF rSCX EQU $ff43 ; Scroll X (R/W)
130141
DEF rLY EQU $ff44 ; LCDC Y-Coordinate (R)

constants/pc_constants.asm

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
; pc themes (see data/pc/theme_names.asm)
2+
const_def
3+
const THEME_POKEDEX
4+
const THEME_POKEGEAR_M
5+
const THEME_POKEGEAR_F
6+
const THEME_PACK_M
7+
const THEME_PACK_F
8+
const THEME_TRAINER_CARD_M
9+
const THEME_TRAINER_CARD_F
10+
const THEME_NORMAL
11+
const THEME_FIGHTING
12+
const THEME_FLYING
13+
const THEME_POISON
14+
const THEME_GROUND
15+
const THEME_ROCK
16+
const THEME_BUG
17+
const THEME_GHOST
18+
const THEME_STEEL
19+
const THEME_FIRE
20+
const THEME_WATER
21+
const THEME_GRASS
22+
const THEME_ELECTRIC
23+
const THEME_PSYCHIC
24+
const THEME_ICE
25+
const THEME_DRAGON
26+
const THEME_DARK
27+
DEF NUM_BILLS_PC_THEMES EQU const_value
28+
29+
; sprite animation parameters
30+
DEF PCANIM_STATIC EQU 0 ; used when holding stuff, we don't want to bop then
31+
DEF PCANIM_ANIMATE EQU 90 ; baseline
32+
DEF PCANIM_PICKUP EQU 91 ; we're picking up/placing down something
33+
DEF PCANIM_PICKUP_NEXT EQU 98 ; cursor is at the bottom, ready for pickup
34+
DEF PCANIM_QUICKFRAMES EQU 9

constants/pokemon_data_constants.asm

+38-3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,40 @@ DEF MON_SAT rw
112112
DEF MON_SDF rw
113113
DEF PARTYMON_STRUCT_LENGTH EQU _RS
114114

115+
; savemon_struct members (see macros/wram.asm)
116+
rsreset
117+
DEF SAVEMON_SPECIES rb
118+
DEF SAVEMON_ITEM rb
119+
DEF SAVEMON_MOVES rb NUM_MOVES
120+
DEF SAVEMON_ID rw
121+
DEF SAVEMON_EXP rb 3
122+
DEF SAVEMON_STAT_EXP rw NUM_EXP_STATS
123+
rsset SAVEMON_STAT_EXP
124+
DEF SAVEMON_HP_EXP rw
125+
DEF SAVEMON_ATK_EXP rw
126+
DEF SAVEMON_DEF_EXP rw
127+
DEF SAVEMON_SPD_EXP rw
128+
DEF SAVEMON_SPC_EXP rw
129+
DEF SAVEMON_DVS rw
130+
; savemon_struct is identical to party_struct before this point
131+
DEF SAVEMON_PP_UPS rb
132+
; savemon_struct is shifted from party_struct beyond this point
133+
DEF SAVEMON_HAPPINESS rb
134+
DEF SAVEMON_PKRUS rb
135+
DEF SAVEMON_CAUGHTDATA rw
136+
rsset SAVEMON_CAUGHTDATA
137+
DEF SAVEMON_CAUGHTTIME rb
138+
DEF SAVEMON_CAUGHTGENDER rb
139+
rsset SAVEMON_CAUGHTDATA
140+
DEF SAVEMON_CAUGHTLEVEL rb
141+
DEF SAVEMON_CAUGHTLOCATION rb
142+
DEF SAVEMON_LEVEL rb
143+
; savemon_struct is different from party_struct beyond this point
144+
DEF SAVEMON_ALTSPECIES rb
145+
DEF SAVEMON_NICKNAME rb MON_NAME_LENGTH - 1
146+
DEF SAVEMON_OT rb PLAYER_NAME_LENGTH - 1
147+
DEF SAVEMON_STRUCT_LENGTH EQU _RS
148+
115149
DEF NICKNAMED_MON_STRUCT_LENGTH EQU PARTYMON_STRUCT_LENGTH + MON_NAME_LENGTH
116150
DEF REDMON_STRUCT_LENGTH EQU 44
117151

@@ -136,9 +170,10 @@ DEF PARTY_LENGTH EQU 6
136170

137171
; boxes
138172
DEF MONS_PER_BOX EQU 20
139-
; box: count, species, mons, OTs, nicknames, padding
140-
DEF BOX_LENGTH EQU 1 + MONS_PER_BOX + 1 + (BOXMON_STRUCT_LENGTH + NAME_LENGTH + MON_NAME_LENGTH) * MONS_PER_BOX + 2 ; $450
141-
DEF NUM_BOXES EQU 14
173+
174+
DEF MONDB_ENTRIES EQU 174
175+
DEF MIN_MONDB_SLACK EQU 10
176+
DEF NUM_BOXES EQU (MONDB_ENTRIES * 2 - MIN_MONDB_SLACK) / MONS_PER_BOX ; 16
142177

143178
; hall of fame
144179
; hof_mon: species, id, dvs, level, nicknames

constants/sprite_anim_constants.asm

+21
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ DEF NUM_SPRITEANIMDICT_ENTRIES EQU 10
8080
const SPRITE_ANIM_INDEX_INTRO_UNOWN_F ; 2a
8181
const SPRITE_ANIM_INDEX_INTRO_SUICUNE_AWAY ; 2b
8282
const SPRITE_ANIM_INDEX_CELEBI ; 2c
83+
const SPRITE_ANIM_INDEX_PC_CURSOR ; 2d
84+
const SPRITE_ANIM_INDEX_PC_QUICK ; 2e
85+
const SPRITE_ANIM_INDEX_PC_MODE ; 2f
86+
const SPRITE_ANIM_INDEX_PC_MODE2 ; 30
87+
const SPRITE_ANIM_INDEX_PC_PACK ; 31
8388
DEF NUM_SPRITE_ANIM_INDEXES EQU const_value
8489

8590
; DoAnimFrame.Jumptable indexes (see engine/gfx/sprite_anims.asm)
@@ -119,6 +124,10 @@ DEF NUM_SPRITE_ANIM_INDEXES EQU const_value
119124
const SPRITE_ANIM_SEQ_INTRO_UNOWN ; 20
120125
const SPRITE_ANIM_SEQ_INTRO_UNOWN_F ; 21
121126
const SPRITE_ANIM_SEQ_INTRO_SUICUNE_AWAY ; 22
127+
const SPRITE_ANIM_SEQ_PC_CURSOR ; 23
128+
const SPRITE_ANIM_SEQ_PC_QUICK ; 24
129+
const SPRITE_ANIM_SEQ_PC_MODE ; 25
130+
const SPRITE_ANIM_SEQ_PC_PACK ; 26
122131
DEF NUM_SPRITE_ANIM_SEQS EQU const_value
123132

124133
; SpriteAnimFrameData indexes (see data/sprite_anims/framesets.asm)
@@ -189,6 +198,12 @@ DEF NUM_SPRITE_ANIM_SEQS EQU const_value
189198
const SPRITE_ANIM_FRAMESET_INTRO_UNOWN_F ; 3f
190199
const SPRITE_ANIM_FRAMESET_CELEBI_LEFT ; 40
191200
const SPRITE_ANIM_FRAMESET_CELEBI_RIGHT ; 41
201+
const SPRITE_ANIM_FRAMESET_PC_CURSOR ; 42
202+
const SPRITE_ANIM_FRAMESET_PC_CURSOR_ITEM ; 43
203+
const SPRITE_ANIM_FRAMESET_PC_QUICK ; 44
204+
const SPRITE_ANIM_FRAMESET_PC_MODE ; 45
205+
const SPRITE_ANIM_FRAMESET_PC_MODE2 ; 46
206+
const SPRITE_ANIM_FRAMESET_PC_PACK ; 47
192207
DEF NUM_SPRITE_ANIM_FRAMESETS EQU const_value
193208

194209
; SpriteAnimOAMData indexes (see data/sprite_anims/oam.asm)
@@ -335,4 +350,10 @@ DEF NUM_SPRITE_ANIM_FRAMESETS EQU const_value
335350
const SPRITE_ANIM_OAMSET_GAMEFREAK_LOGO_11 ; 8b
336351
const SPRITE_ANIM_OAMSET_PARTY_MON_1 ; 8c
337352
const SPRITE_ANIM_OAMSET_PARTY_MON_2 ; 8d
353+
const SPRITE_ANIM_OAMSET_PC_CURSOR ; 8e
354+
const SPRITE_ANIM_OAMSET_PC_CURSOR_ITEM ; 8f
355+
const SPRITE_ANIM_OAMSET_PC_QUICK ; 90
356+
const SPRITE_ANIM_OAMSET_PC_MODE ; 91
357+
const SPRITE_ANIM_OAMSET_PC_MODE2 ; 92
358+
const SPRITE_ANIM_OAMSET_PC_PACK ; 93
338359
DEF NUM_SPRITE_ANIM_OAMSETS EQU const_value

constants/text_constants.asm

+5
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ DEF FIRST_HIRAGANA_DAKUTEN_CHAR EQU $20
5050

5151
; gfx/font/unown_font.png
5252
DEF FIRST_UNOWN_CHAR EQU $40
53+
54+
; gfx/font/vwf.png
55+
DEF FIRST_VWF_CHAR EQU " " ; first printable character
56+
DEF LAST_VWF_CHAR EQU "9" ; last printable character
57+
DEF FAILSAFE_VWF_CHAR EQU "."

constants/wram_constants.asm

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DEF AUTO_INPUT EQU $ff
2020
const BOXMON ; 2
2121
const TEMPMON ; 3
2222
const WILDMON ; 4
23+
const BUFFERMON ; 5
2324

2425
; wGameTimerPaused::
2526
DEF GAME_TIMER_PAUSED_F EQU 0

data/items/names.asm

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ItemNames::
44
li "ULTRA BALL"
55
li "BRIGHTPOWDER"
66
li "GREAT BALL"
7-
li "# BALL"
7+
li "POKé BALL"
88
li "TOWN MAP"
99
li "BICYCLE"
1010
li "MOON STONE"
@@ -36,7 +36,7 @@ ItemNames::
3636
li "LEAF STONE"
3737
li "METAL POWDER"
3838
li "NUGGET"
39-
li "# DOLL"
39+
li "POKé DOLL"
4040
li "FULL HEAL"
4141
li "REVIVE"
4242
li "MAX REVIVE"

data/pc/bad_egg.asm

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
BadEgg:
2+
; Failsafe if there is a checksum error
3+
db BULBASAUR
4+
db NO_ITEM
5+
db POUND, NO_MOVE, NO_MOVE, NO_MOVE
6+
dw 0 ; OT ID
7+
db 0, 0, 0 ; Exp
8+
; Stat exp
9+
bigdw 0
10+
bigdw 0
11+
bigdw 0
12+
bigdw 0
13+
bigdw 0
14+
dn 0, 0, 0, 0 ; DVs
15+
db 0, 0, 0, 0 ; PP
16+
db 255 ; Step cycles to hatch
17+
db 0, 0, 0 ; Pokérus, Caught data
18+
db EGG_LEVEL ; Level
19+
db 0 ; Status
20+
db 0 ; unused
21+
bigdw 0 ; HP
22+
bigdw 11 ; Max HP
23+
bigdw 5 ; Atk
24+
bigdw 5 ; Def
25+
bigdw 5 ; Spd
26+
bigdw 5 ; SAtk
27+
bigdw 5 ; SDef
28+
db EGG ; Alt species
29+
db "BAD EGG@@@@" ; Nickname
30+
db "?@@@@@@@@@@" ; OT name
31+
BadEggEnd:

data/pc/default_box_themes.asm

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
BillsPC_DefaultBoxThemes:
2+
table_width 1, BillsPC_DefaultBoxThemes
3+
db THEME_GRASS
4+
db THEME_FIRE
5+
db THEME_WATER
6+
db THEME_ELECTRIC
7+
db THEME_FIGHTING
8+
db THEME_PSYCHIC
9+
db THEME_NORMAL
10+
db THEME_FLYING
11+
db THEME_BUG
12+
db THEME_POISON
13+
db THEME_GROUND
14+
db THEME_ROCK
15+
db THEME_ICE
16+
db THEME_GHOST
17+
db THEME_DRAGON
18+
db THEME_DARK
19+
assert_table_length NUM_BOXES
20+
db -1 ; end

data/pc/theme_names.asm

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
BillsPC_ThemeNames:
2+
table_width 2, BillsPC_ThemeNames
3+
dw .Pokedex
4+
dw .PokegearM
5+
dw .PokegearF
6+
dw .PackM
7+
dw .PackF
8+
dw .TrainerM
9+
dw .TrainerF
10+
dw .Normal
11+
dw .Fighting
12+
dw .Flying
13+
dw .Poison
14+
dw .Ground
15+
dw .Rock
16+
dw .Bug
17+
dw .Ghost
18+
dw .Steel
19+
dw .Fire
20+
dw .Water
21+
dw .Grass
22+
dw .Electric
23+
dw .Psychic
24+
dw .Ice
25+
dw .Dragon
26+
dw .Dark
27+
assert_table_length NUM_BILLS_PC_THEMES
28+
29+
.Pokedex: db "#DEX@"
30+
.PokegearM: db "#GEAR♂@"
31+
.PokegearF: db "#GEAR♀@"
32+
.PackM: db "PACK♂@"
33+
.PackF: db "PACK♀@"
34+
.TrainerM: db "TRAINER♂@"
35+
.TrainerF: db "TRAINER♀@"
36+
.Normal: db "NORMAL@"
37+
.Fighting: db "FIGHTING@"
38+
.Flying: db "FLYING@"
39+
.Poison: db "POISON@"
40+
.Ground: db "GROUND@"
41+
.Rock: db "ROCK@"
42+
.Bug: db "BUG@"
43+
.Ghost: db "GHOST@"
44+
.Steel: db "STEEL@"
45+
.Fire: db "FIRE@"
46+
.Water: db "WATER@"
47+
.Grass: db "GRASS@"
48+
.Electric: db "ELECTRIC@"
49+
.Psychic: db "PSYCHIC@"
50+
.Ice: db "ICE@"
51+
.Dragon: db "DRAGON@"
52+
.Dark: db "DARK@"

data/pokemon/evos_attacks.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ INCLUDE "data/pokemon/evos_attacks_pointers.asm"
1717
EkansEvosAttacks:
1818
db EVOLVE_LEVEL, 26, ARBOK
1919
db 0 ; no more evolutions
20-
db 1, GUNK_SHOT
20+
db 1, POISON_STING
2121
db 1, LEER
2222
db 6, WRAP
2323
db 9, BITE

data/predef_pointers.asm

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ PredefPointers::
1515
add_predef FillPP
1616
add_predef TryAddMonToParty
1717
add_predef AddTempmonToParty
18-
add_predef SendGetMonIntoFromBox
1918
add_predef SendMonIntoBox
2019
add_predef GiveEgg
2120
add_predef AnimateHPBar

data/sprite_anims/framesets.asm

+31
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ SpriteAnimFrameData:
6767
dw .Frameset_IntroUnownF
6868
dw .Frameset_CelebiLeft
6969
dw .Frameset_CelebiRight
70+
dw .Frameset_PCCursor
71+
dw .Frameset_PCCursorItem
72+
dw .Frameset_PCQuick
73+
dw .Frameset_PCMode
74+
dw .Frameset_PCMode2
75+
dw .Frameset_PCPack
7076
assert_table_length NUM_SPRITE_ANIM_FRAMESETS
7177

7278
.Frameset_00:
@@ -497,3 +503,28 @@ SpriteAnimFrameData:
497503
oamframe SPRITE_ANIM_OAMSET_CELEBI_1, 8, OAM_X_FLIP
498504
oamframe SPRITE_ANIM_OAMSET_CELEBI_2, 8, OAM_X_FLIP
499505
oamend
506+
507+
.Frameset_PCCursor:
508+
oamframe SPRITE_ANIM_OAMSET_PC_CURSOR, 32
509+
oamrestart
510+
511+
.Frameset_PCCursorItem:
512+
; Conditionally switched to when dealing with items
513+
oamframe SPRITE_ANIM_OAMSET_PC_CURSOR_ITEM, 32
514+
oamrestart
515+
516+
.Frameset_PCQuick:
517+
oamframe SPRITE_ANIM_OAMSET_PC_QUICK, 8
518+
oamdelete
519+
520+
.Frameset_PCMode:
521+
oamframe SPRITE_ANIM_OAMSET_PC_MODE, 32
522+
oamrestart
523+
524+
.Frameset_PCMode2:
525+
oamframe SPRITE_ANIM_OAMSET_PC_MODE2, 32
526+
oamrestart
527+
528+
.Frameset_PCPack:
529+
oamframe SPRITE_ANIM_OAMSET_PC_PACK, 32
530+
oamrestart

0 commit comments

Comments
 (0)