Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAM data documentation; move more content into data/; move palettes into gfx/; more code+script constants; consistent map naming #456

Merged
merged 242 commits into from
Jan 22, 2018
Merged
Show file tree
Hide file tree
Changes from 179 commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
9859467
Consistent map naming ("Town" and "City" are left out in houses and g…
roukaour Jan 1, 2018
eb8e55a
Route 17-18 Gate and Route 29-46 Gate
roukaour Jan 1, 2018
0722de7
Remove trailing whitespace
roukaour Jan 1, 2018
3c953ef
Consistent *_palette_map.asm
roukaour Jan 1, 2018
fbfda45
Bold
roukaour Jan 1, 2018
802cf61
Unused tileset animations stands out amid useful data
roukaour Jan 1, 2018
f185cc9
sort the symfile by symbol type
yenatch Jan 2, 2018
9a3088e
Clean up XXX comments for unused content
xCrystal Jan 2, 2018
7a24703
Clean up Predef function names
xCrystal Jan 2, 2018
6f0b815
More unreferenced labels cleanup
xCrystal Jan 2, 2018
7c0e903
Clean up leftover code from main.asm
xCrystal Jan 2, 2018
f1ea15b
Consolidate Special function names
xCrystal Jan 2, 2018
b4a4935
Finish consistent Special function names
xCrystal Jan 2, 2018
d435bd8
Reword Magikarp length comments
roukaour Jan 2, 2018
be2aeed
More clarification
roukaour Jan 2, 2018
d7970f7
Consistent predef function names
xCrystal Jan 2, 2018
b4e0871
More unreferenced labels and unused text
xCrystal Jan 2, 2018
aa9a0a9
No more mobile EQUS ret (replace with Stubbed_ + ret)
xCrystal Jan 2, 2018
7ad8ea1
Document more sprite anim data
roukaour Jan 2, 2018
2dd9ac0
More sprite anim documentation
roukaour Jan 2, 2018
776b8c7
Egg hatch shell framgent data is not exactly dsprite
roukaour Jan 2, 2018
648e718
Comment correction
roukaour Jan 2, 2018
6a3045d
1-based EZ Chat cursor data indexes
roukaour Jan 2, 2018
64b27d8
More G/S intro OAM documentation
roukaour Jan 2, 2018
6cc4b53
Align comments
roukaour Jan 2, 2018
d5c8cb7
Align comments
roukaour Jan 2, 2018
ae78ee6
One more G/S intro OAM identified
roukaour Jan 2, 2018
e6778f9
town_map.png matches pokegear.png
roukaour Jan 2, 2018
0caea0f
Use BANK for all hardcoded banks with BANK in comments.
CuriouserThing Jan 2, 2018
41de67e
Identify more G/S intro OAM data
roukaour Jan 2, 2018
4f01dff
Use OAM flags in dsprite data
roukaour Jan 2, 2018
a7fb9e1
Use dsprite for Pokédex cursor OAM data
roukaour Jan 2, 2018
01d994b
dsprite always has 6 arguments
roukaour Jan 2, 2018
eb110ed
Arrange pichu.png like the rest
roukaour Jan 3, 2018
e3e885a
pngcrush -noreduce
roukaour Jan 3, 2018
41feb29
Make some graphics easier to edit
roukaour Jan 3, 2018
3fc06b0
Use constants
roukaour Jan 3, 2018
fb825a8
Label MobileCrashCheckPointer and consolidate relevant functions.
CuriouserThing Jan 3, 2018
b0d2409
Move EZChat Pokémon order to data/
roukaour Jan 3, 2018
51106cc
Scrub WRAM addresses from comments & use WRAM1_Begin where appropriate.
CuriouserThing Jan 3, 2018
76ee2f5
WRAM1_Begin -> wd000
CuriouserThing Jan 3, 2018
8d095cd
Better names
roukaour Jan 3, 2018
cd8a22c
Replace magic reference to PackMenuGFX.
CuriouserThing Jan 3, 2018
d75a66c
wd000 -> w3_d000
roukaour Jan 3, 2018
bc83768
Tileset images are 128px wide
roukaour Jan 3, 2018
0b6857b
lava in gym_1 > fountain in unused safari zone
roukaour Jan 3, 2018
a298cb9
Replace hardcoded bank with BANK function.
CuriouserThing Jan 3, 2018
10bd011
More relevant data file locations
roukaour Jan 3, 2018
91f97f0
Special_MapCallbackSprites_LoadUsedSpritesGFX -> Special_LoadUsedSpri…
xCrystal Jan 3, 2018
501ec9b
Fix macro formatting.
CuriouserThing Jan 3, 2018
e7941ce
Explain HRAM
roukaour Jan 3, 2018
88d32fe
python3 sort_map.py pokecrystal.map sorted.sym
roukaour Jan 3, 2018
927d392
Size in hex
roukaour Jan 3, 2018
c07ffc7
Handle unused banks (notably OAM and HRAM)
roukaour Jan 3, 2018
0d1f2d6
Add example .map lines
roukaour Jan 3, 2018
59e6bae
Support Python 2 or 3
roukaour Jan 3, 2018
418d81b
Docstring and no print()
roukaour Jan 3, 2018
6d2dc86
Serve2bppRequest@VBlank → Serve2bppRequest_VBlank
roukaour Jan 3, 2018
c85e4f3
rgblink → sort_map.py
roukaour Jan 3, 2018
78c818e
for/write → writelines
roukaour Jan 3, 2018
83f7400
More example lines
roukaour Jan 3, 2018
f9f1046
sort_map.py → map2sym.py (like dos2unix, pdf2ps, etc)
roukaour Jan 3, 2018
095dcec
No explicit bank "$00" for ROM0, WRAM0, OAM, or HRAM
roukaour Jan 3, 2018
9069a39
Measure total free space
roukaour Jan 3, 2018
9d0ba6b
Use BANK for hardcoded WRAM banks (except where bankswitches appear u…
CuriouserThing Jan 4, 2018
5fd3bfa
Clarify the purpose of writing 0 to rSVBK.
CuriouserThing Jan 4, 2018
d68f961
Delete FETCH_HEAD
xCrystal Jan 4, 2018
fb422e8
Use BANK for hardcoded WRAM banks preceding FarCopyWRAM/GetFarWRAMByt…
CuriouserThing Jan 4, 2018
36e91c9
Fix stray hardcoded WRAM bank.
CuriouserThing Jan 4, 2018
ce985a0
Document switches to BANK(sScratch) via xor a
CuriouserThing Jan 4, 2018
e9e8bf6
Predef_Flag -> Predef_FlagAction
xCrystal Jan 5, 2018
bdd3a55
Organize mobile/battle_tower_*.asm data and code
roukaour Jan 6, 2018
2c789b6
Predef_FlagAction -> Predef_SmallFarFlagAction
xCrystal Jan 7, 2018
6c20ff9
Reorganize some macros
roukaour Jan 7, 2018
2847e1d
constants.asm and includes.asm are redundant
roukaour Jan 7, 2018
187196f
Macro clarifies how TimeFishGroups works
roukaour Jan 8, 2018
d6f20ae
Use BANK for hardcoded SRAM banks (except for vestigial refs to JP's …
CuriouserThing Jan 8, 2018
94f32db
Document hardcoded SRAM addresses.
CuriouserThing Jan 9, 2018
6c5cd7a
Simplify comments per Rangi's rec.
CuriouserThing Jan 9, 2018
31edd7f
Move text/ into data/
roukaour Jan 9, 2018
76ed8b1
Revert "python3 sort_map.py pokecrystal.map sorted.sym"
roukaour Jan 9, 2018
d0a8e8e
includes.asm → constants.asm
roukaour Jan 9, 2018
459d5d3
default_names.asm → player_names.asm
roukaour Jan 9, 2018
05e5eaf
Eliminate version.asm (resolves #464)
roukaour Jan 9, 2018
2f741df
Remove old Python class names from script command param doc comments
roukaour Jan 9, 2018
5a73a62
Move battle engine data into data/
roukaour Jan 9, 2018
cb92b7b
Indent with tabs
roukaour Jan 9, 2018
a3242b4
Simpler comments
roukaour Jan 9, 2018
a849c35
More comments
roukaour Jan 9, 2018
1155619
Consistent sine wave code formatting
roukaour Jan 9, 2018
ce50d1b
Clearer Battle Tower code
roukaour Jan 9, 2018
a8cf897
Do a little cleanup towards issue #465
roukaour Jan 9, 2018
cc0fd6e
CRYSTAL11 → _CRYSTAL11
roukaour Jan 9, 2018
fbc353f
Replace some hex constants
roukaour Jan 9, 2018
2f0973f
Clean up some hex values in map scripts
roukaour Jan 9, 2018
feb34b4
data/phone_text → data/phone/text
roukaour Jan 10, 2018
f22485b
Binary tilemaps
roukaour Jan 10, 2018
db763bd
Heading
roukaour Jan 10, 2018
efd91fe
Avoid catch-all Makefile rules
roukaour Jan 10, 2018
5c5f8b3
Move data/palettes/ .pal files into gfx/
roukaour Jan 10, 2018
e943ac3
Clarify doc comment
roukaour Jan 10, 2018
9af6d8d
Split tilesets/ into gfx/tilesets and data/tilesets/
roukaour Jan 10, 2018
8aa58dc
Specialized macros go with their data/code
roukaour Jan 10, 2018
8334c3c
Newline
roukaour Jan 10, 2018
ee4ec65
map_objects.pal is easier to find in gfx/overworld/ than gfx/sprites/
roukaour Jan 10, 2018
7de7441
gfx/*.asm files have INCBINs
roukaour Jan 10, 2018
16eb97a
Constant swap explains this Battle Tower bug
roukaour Jan 10, 2018
22b607b
Move radio channel data into data/
roukaour Jan 10, 2018
cc95d12
Use maskbits more, and clarify its usage
roukaour Jan 10, 2018
417937c
Resolve #461
roukaour Jan 10, 2018
bc79f17
More maskbits
roukaour Jan 10, 2018
28d5169
maskbits <count> +- 1
roukaour Jan 10, 2018
c857582
Battle data goes in data/battle/
roukaour Jan 10, 2018
e0088ad
Other files belong in data/battle/
roukaour Jan 10, 2018
d91e42c
Group some mutually edited files in data/sprites/
roukaour Jan 10, 2018
546f1f7
Correct spacing
roukaour Jan 11, 2018
0a3b251
Arrays end with -1, not $ff
roukaour Jan 11, 2018
532724e
Comment on the original function of move grammar
roukaour Jan 11, 2018
3b7c495
No romaji
roukaour Jan 11, 2018
cc8dac5
Use constants and data for Unown chamber events
roukaour Jan 11, 2018
b45f89f
More constants and data tables
roukaour Jan 11, 2018
2d0506e
Group item and deco data more
roukaour Jan 11, 2018
68e5a70
Resize SGB graphics
roukaour Jan 11, 2018
1a2bc57
Event script–related constants go in constants/script_constants.asm
roukaour Jan 11, 2018
16a39f6
Full sentences
roukaour Jan 11, 2018
a436bbc
Move party menu qualities to data/
roukaour Jan 11, 2018
94d6a32
Use maskbits some more
roukaour Jan 11, 2018
fd0a78d
Trainer card has state constants and WRAM labels
roukaour Jan 11, 2018
17f34cb
Disambiguate some uses of wcf64/5/6
roukaour Jan 11, 2018
1773414
Use charmap frame characters
roukaour Jan 12, 2018
163f3e0
Local UI tiles don't belong in charmap
roukaour Jan 12, 2018
2085ebc
maskbits for NUM_FRAMES
roukaour Jan 12, 2018
af40011
Break up engine/events_3.asm
roukaour Jan 12, 2018
b23085f
Missed graphics
roukaour Jan 12, 2018
d83aefb
Use more constants in scripts
roukaour Jan 12, 2018
2b4a4cc
SaffronMagnetTrainStation
roukaour Jan 12, 2018
1f5cc28
Comment on VAR_* constants
roukaour Jan 12, 2018
c6a4d35
npc_sprites.pal matches PAL_NPC constants
roukaour Jan 12, 2018
bdc9559
Easier to find palette data
roukaour Jan 12, 2018
0e1148f
Move code out of data/
roukaour Jan 12, 2018
5b7773b
Label frameset 09
mid-kid Jan 12, 2018
960783c
Label more ANIM_OBJ_* constants
roukaour Jan 12, 2018
31caeeb
Separate more palettes into gfx/**/*.pal files
roukaour Jan 12, 2018
f1e1b26
More gfx/**/*.pal files
roukaour Jan 12, 2018
bc22bf2
Egg palette works like other Pokémon
roukaour Jan 12, 2018
9b19817
Comments explain colors
roukaour Jan 12, 2018
be45106
Mystery Gift graphics match
roukaour Jan 12, 2018
5a8700c
Add missing file
roukaour Jan 12, 2018
59c95ab
Trim whitespace
roukaour Jan 12, 2018
d054116
Merge branch 'patch' of https://github.com/mid-kid/pokecrystal
roukaour Jan 12, 2018
5a3822f
Introduce callback, hiddenitem, conditional_event, and cmdqueue macro…
roukaour Jan 13, 2018
b28e712
Consistent stonetable cmdqueues
roukaour Jan 13, 2018
3db107b
Label Dragon Shrine
roukaour Jan 13, 2018
0197e6f
Don't split stats gfx in three
roukaour Jan 13, 2018
2ab60fa
menu_coords macro for (x1, y1, x2, y2) order (see issue #440)
roukaour Jan 13, 2018
066cc91
Fix some MenuData2 labels
mid-kid Dec 30, 2017
11d6756
Use constants for menu flags
mid-kid Jan 14, 2018
d38ed29
Added menu documentation
mid-kid Jan 14, 2018
eb31022
More Battle Tower map script constants, fewer raw hex values
roukaour Jan 15, 2018
7a09fc9
GFX tile sizes in decimal
roukaour Jan 15, 2018
8e1e583
Close #470 (JOHTO_POKEMON)
roukaour Jan 15, 2018
5c28d05
Merge branch 'master' of https://github.com/xCrystal/pokecrystal (res…
roukaour Jan 15, 2018
dfcca93
Merge branch 'dev' of https://github.com/TheMostCuriousThing/pokecrys…
roukaour Jan 15, 2018
14c8cf5
Merge branch 'master' of https://github.com/mid-kid/pokecrystal (reso…
roukaour Jan 15, 2018
4d61173
Merge branch 'sort-symfile' of https://github.com/yenatch/pokecrystal
roukaour Jan 15, 2018
346a93c
Shebang
roukaour Jan 15, 2018
f2dde1f
Markdown formatting
roukaour Jan 15, 2018
07b8fe2
G/S does use this OAM data: https://i.imgur.com/KdIhKKk.png
roukaour Jan 15, 2018
fe3ef73
Group unused data
roukaour Jan 15, 2018
911c132
Document PredefPals still used by CGB layouts
roukaour Jan 15, 2018
9bb5847
_Special_BugContestJudging → _BugContestJudging; HOF_Predef_AnimateFr…
roukaour Jan 15, 2018
9180362
Move code out of gfx/ (close #474)
roukaour Jan 15, 2018
6c7e885
Long lists of db/dw series with struct-defining macros belong in data/
roukaour Jan 15, 2018
9fb7416
Comments
roukaour Jan 15, 2018
2b82338
Phone data 0/7 are time masks
roukaour Jan 16, 2018
8048082
Remove Predef_ prefix from routines listed in PredefPointers
roukaour Jan 16, 2018
7b3de85
Avoid "+- 1" at every maskbits
roukaour Jan 16, 2018
50ce0a2
Fewer hard-coded values
roukaour Jan 16, 2018
5407d8d
Cleaner Pokédex code
roukaour Jan 16, 2018
01ba6be
Move code out of data/
roukaour Jan 16, 2018
94bbfe2
Move map-related "metadata" files into data/maps/
roukaour Jan 17, 2018
3d0e181
0/1 → FALSE/TRUE, with correct comment
roukaour Jan 17, 2018
bf074f3
map_header → map_def; map_header_2 → map_data
roukaour Jan 17, 2018
6d20cf3
"CryHeader" → "Cry"; "Cry" → "MonCry"
roukaour Jan 17, 2018
3dcc006
Comments help find map_data.asm
roukaour Jan 17, 2018
e2ac753
No redundant filename prefixes
roukaour Jan 17, 2018
8f092ad
mapgroup → mapconst
roukaour Jan 17, 2018
f64443a
Wild data entries are 2 bytes wide
roukaour Jan 17, 2018
faa41e7
hex->dec
roukaour Jan 17, 2018
c70e8ee
Comment on changeblock ids
roukaour Jan 17, 2018
d2725c3
Allow italics/bold within inline code
roukaour Jan 17, 2018
b1c808f
Rename some tilesets (close #467)
roukaour Jan 17, 2018
40125a7
</code>
roukaour Jan 17, 2018
4161ec9
Partially document SGB data from pokered
roukaour Jan 18, 2018
c5d9eca
More SGB documentation
roukaour Jan 18, 2018
0306e94
More SGB documentation
roukaour Jan 18, 2018
ac50728
Compact predef.pal
roukaour Jan 18, 2018
a4f3870
BlkPacket comments
roukaour Jan 18, 2018
23f2c05
Heal machine jumptable index constants
roukaour Jan 18, 2018
95c0c31
Eliminate wd000
roukaour Jan 18, 2018
99f26a6
Compute wc7e8 size
roukaour Jan 18, 2018
226d181
Only graphics data goes in gfx/
roukaour Jan 18, 2018
22fd122
More .pal files
roukaour Jan 18, 2018
f556ab9
Comment on RIVAL1 item
roukaour Jan 18, 2018
69ace7f
Identify leftover SGB palettes from R/B
roukaour Jan 18, 2018
3bf8325
More accurate constant/label names
roukaour Jan 18, 2018
72c4f9e
More constants, related to map objects
roukaour Jan 18, 2018
d82127b
SGB MON_NITE colors
roukaour Jan 18, 2018
676b585
Correct comment
roukaour Jan 18, 2018
2acaa96
More charmap and home/text.asm documentation for JP chars
roukaour Jan 18, 2018
a3beba1
Use Japanese charmap definitions in strings
roukaour Jan 19, 2018
747c905
Two comments
roukaour Jan 19, 2018
1733622
newline before para
roukaour Jan 19, 2018
a9f8aeb
Remove trailing whitespace
roukaour Jan 19, 2018
105ef87
Better TX_SOUND_* names
roukaour Jan 19, 2018
2c7ca13
Disambiguate "%" and "<NO>"
roukaour Jan 19, 2018
0082dcd
Missing comment
roukaour Jan 19, 2018
80dd085
unused_up_arrow.png
roukaour Jan 19, 2018
fdb81d0
One leader per line
roukaour Jan 19, 2018
55d8de6
why "5A"?
roukaour Jan 19, 2018
25048bd
wiggle → wobble
roukaour Jan 19, 2018
9576740
clean up GetName/NamesPointers
roukaour Jan 19, 2018
c861ff5
This table entry has the address of MoveDescriptions in GSC ($4000 in…
roukaour Jan 19, 2018
d7afa76
wrong bank
roukaour Jan 19, 2018
e69544b
More Unicode
roukaour Jan 19, 2018
52993d2
Keep hex address until surrounding code is cleaned up
roukaour Jan 19, 2018
0c63388
Resolve #471 (although link code still needs more cleanup, like its W…
roukaour Jan 19, 2018
b199f6c
Use hSerialConnectionStatus constants elsewhere
roukaour Jan 20, 2018
ddec0ee
More Japanese characters
roukaour Jan 20, 2018
b071dd3
Japanese characters in Japanese text (e.g. "ォ" not "," for $f4)
roukaour Jan 20, 2018
8127d1f
Rename BATTLETOWER_NROF constants
roukaour Jan 20, 2018
05382d3
PARTY_LENGTH; MON_NAME; sgb_border.bin
roukaour Jan 20, 2018
732bb36
Scale addresses with PARTY_LENGTH
roukaour Jan 20, 2018
a8eb44b
Separate new_game graphics
roukaour Jan 21, 2018
81ba6c8
cgb layouts
roukaour Jan 21, 2018
5db31fe
POKEDEX_SCX
roukaour Jan 21, 2018
5e4fa42
Unrelated routine gets its own file
roukaour Jan 21, 2018
7f54df5
Group engine/pokedex files
roukaour Jan 21, 2018
f091bb8
6 → PARTY_LENGTH
roukaour Jan 21, 2018
5ddea59
wGBCOnlyDecompressBuffer
roukaour Jan 22, 2018
5bd84e7
Comment on wGBCOnlyDecompressBuffer size
roukaour Jan 22, 2018
7fba864
Add back catch-all graphics rules.
yenatch Jan 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

## What is pokecrystal11.gbc?

Version 1.1 of Pokémon Crystal, which fixed some issues with the initial international release. `make crystal11` defines `CRYSTAL11` so the assembly builds the changed version.
Version 1.1 of Pokémon Crystal, which fixed some issues with the initial international release. `make crystal11` defines `_CRYSTAL11` so the assembly builds the changed version.


## Can't build ROM; "ERROR: `UNION` already defined"
Expand Down
42 changes: 21 additions & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ home.o \
main.o \
maps.o \
wram.o \
data/common_text/common_text.o \
data/pokemon/dex_entries.o \
data/pokemon/egg_moves.o \
data/pokemon/evos_attacks.o \
engine/credits.o \
engine/events.o \
gfx/pics.o \
gfx/sprites.o \
lib/mobile/main.o \
text/common_text.o
lib/mobile/main.o

crystal11_obj := $(crystal_obj:.o=11.o)

Expand All @@ -52,7 +52,8 @@ tools:
$(MAKE) -C tools/


$(crystal11_obj): RGBASMFLAGS = -D CRYSTAL11
$(crystal_obj): RGBASMFLAGS = -D _CRYSTAL
$(crystal11_obj): RGBASMFLAGS = -D _CRYSTAL -D _CRYSTAL11

# The dep rules have to be explicit or else missing files won't be reported.
# As a side effect, they're evaluated immediately instead of when the rule is invoked.
Expand All @@ -77,12 +78,12 @@ endif
pokecrystal11.gbc: $(crystal11_obj) pokecrystal.link
$(RGBLINK) -n pokecrystal11.sym -m pokecrystal11.map -l pokecrystal.link -o $@ $(crystal11_obj)
$(RGBFIX) -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -n 1 -p 0 -r 3 -t PM_CRYSTAL $@
sort pokecrystal11.sym -o pokecrystal11.sym
tools/sort_symfile.sh pokecrystal11.sym

pokecrystal.gbc: $(crystal_obj) pokecrystal.link
$(RGBLINK) -n pokecrystal.sym -m pokecrystal.map -l pokecrystal.link -o $@ $(crystal_obj)
$(RGBFIX) -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
sort pokecrystal.sym -o pokecrystal.sym
tools/sort_symfile.sh pokecrystal.sym


# For files that the compressor can't match, there will be a .lz file suffixed with the md5 hash of the correct uncompressed file.
Expand Down Expand Up @@ -119,10 +120,12 @@ gfx/pokemon/girafarig/front.animated.tilemap: gfx/pokemon/girafarig/front.2bpp g

### Pokemon pic graphics rules

gfx/pokemon/%/normal.gbcpal: gfx/pokemon/%/front.png
$(RGBGFX) -p $@ $<
gfx/pokemon/%/front.dimensions: gfx/pokemon/%/front.png
tools/png_dimensions $< $@
gfx/pokemon/%/normal.pal: gfx/pokemon/%/normal.gbcpal
tools/palette -p $< > $@
gfx/pokemon/%/normal.gbcpal: gfx/pokemon/%/front.png
$(RGBGFX) -p $@ $<
gfx/pokemon/%/back.2bpp: gfx/pokemon/%/back.png
$(RGBGFX) -h -o $@ $<
gfx/pokemon/%/bitmask.asm: gfx/pokemon/%/front.animated.tilemap gfx/pokemon/%/front.dimensions
Expand All @@ -133,9 +136,6 @@ gfx/pokemon/%/front.animated.2bpp: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.
tools/pokemon_animation_graphics -o $@ $^
gfx/pokemon/%/front.animated.tilemap: gfx/pokemon/%/front.2bpp gfx/pokemon/%/front.dimensions
tools/pokemon_animation_graphics -t $@ $^
# Don't use -h, pokemon_animation_graphics takes care of it
#gfx/pokemon/%/front.2bpp: gfx/pokemon/%/front.png
# $(RGBGFX) -o $@ $<


### Misc file-specific graphics rules
Expand All @@ -146,6 +146,8 @@ gfx/shrink/shrink2.2bpp: rgbgfx += -h
gfx/trainers/%.2bpp: rgbgfx += -h
gfx/trainers/%.pal: gfx/trainers/%.gbcpal
tools/palette -p $< > $@
gfx/trainers/%.gbcpal: gfx/trainers/%.png
$(RGBGFX) -p $@ $<

gfx/mail/dragonite.1bpp: tools/gfx += --remove-whitespace
gfx/mail/large_note.1bpp: tools/gfx += --remove-whitespace
Expand All @@ -157,6 +159,11 @@ gfx/pokedex/pokedex.2bpp: tools/gfx += --trim-whitespace
gfx/pokedex/sgb.2bpp: tools/gfx += --trim-whitespace
gfx/pokedex/slowpoke.2bpp: tools/gfx += --trim-whitespace

gfx/pokegear/pokegear.2bpp: rgbgfx += -x2
gfx/pokegear/pokegear_sprites.2bpp: tools/gfx += --trim-whitespace

gfx/mystery_gift/mystery_gift.2bpp: tools/gfx += --trim-whitespace

gfx/title/crystal.2bpp: tools/gfx += --interleave --png=$<
gfx/title/old_fg.2bpp: tools/gfx += --interleave --png=$<
gfx/title/logo.2bpp: rgbgfx += -x 4
Expand Down Expand Up @@ -195,12 +202,14 @@ gfx/player/kris_back.2bpp: rgbgfx += -h
gfx/trainer_card/chris_card.2bpp: rgbgfx += -h
gfx/trainer_card/kris_card.2bpp: rgbgfx += -h

gfx/overworld/chris_fish.2bpp: tools/gfx += --trim-whitespace
gfx/overworld/kris_fish.2bpp: tools/gfx += --trim-whitespace

gfx/battle/dude.2bpp: rgbgfx += -h

gfx/font/unused_bold_font.1bpp: tools/gfx += --trim-whitespace

gfx/pokegear/pokegear.2bpp: rgbgfx += -x2
gfx/pokegear/pokegear_sprites.2bpp: tools/gfx += --trim-whitespace
gfx/sgb/sgb_border.2bpp: tools/gfx += --trim-whitespace

gfx/mobile/ascii_font.2bpp: tools/gfx += --trim-whitespace
gfx/mobile/electro_ball.2bpp: tools/gfx += --trim-whitespace
Expand All @@ -223,12 +232,3 @@ gfx/unknown/unknown_egg.2bpp: rgbgfx += -h
$(RGBGFX) $(rgbgfx) -d1 -o $@ $<
$(if $(tools/gfx),\
tools/gfx $(tools/gfx) -d1 -o $@ $@)

%.tilemap: %.png
$(RGBGFX) -t $@ $<
%.gbcpal: %.png
$(RGBGFX) -p $@ $<
%.pal: %.gbcpal
tools/palette $< > $@
%.dimensions: %.png
tools/png_dimensions $< $@
2 changes: 2 additions & 0 deletions STYLE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Style Guide

Some of the code will disagree with this guide. Older code is less likely to be correct. Use your best judgement.

When you come across an edge case that isn't referenced in this guide, please add it.
Expand Down
2 changes: 1 addition & 1 deletion audio.asm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
INCLUDE "includes.asm"
INCLUDE "constants.asm"


SECTION "Audio", ROMX
Expand Down
40 changes: 20 additions & 20 deletions audio/engine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ _MapSetup_Sound_Off:: ; e8000

ld hl, Channels ; start of channel data
ld de, ChannelsEnd - Channels ; length of area to clear (entire sound wram area)
.clearchannels ; clear Channel1-$c2bf
.clearchannels
xor a
ld [hli], a
dec de
Expand Down Expand Up @@ -408,7 +408,7 @@ UpdateChannels: ; e8125
ret

.asm_e824d
ld a, $3f
ld a, $3f ; sound length
ld [rNR31], a
xor a
ld [rNR30], a
Expand Down Expand Up @@ -1304,8 +1304,8 @@ ParseSFXOrRest: ; e8698
ld [hl], a
; are we on the last channel? (noise sampling)
ld a, [CurChannel]
and $3
cp $3
maskbits NUM_MUSIC_CHANS
cp CHAN4
ret z
; update hi frequency from next param
call GetMusicByte
Expand All @@ -1320,8 +1320,8 @@ GetNoiseSample: ; e86c5
; load ptr to sample header in NoiseSampleAddress
; are we on the last channel?
ld a, [CurChannel]
and $3
cp $3
and NUM_MUSIC_CHANS +- 1
cp CHAN4
; ret if not
ret nz
; update note duration
Expand Down Expand Up @@ -1668,7 +1668,7 @@ MusicEE; e883e
; if ????, jump
; get channel
ld a, [CurChannel]
and $3 ; ch0-3
maskbits NUM_MUSIC_CHANS
ld e, a
ld d, 0
; hl = Channel1JumpCondition + channel id
Expand Down Expand Up @@ -1966,8 +1966,8 @@ Music_NoteType: ; e8963
add hl, bc
ld [hl], a
ld a, [CurChannel]
and $3
cp CHAN8 & $3
maskbits NUM_MUSIC_CHANS
cp CHAN4
ret z
; intensity
call Music_Intensity
Expand Down Expand Up @@ -2414,7 +2414,7 @@ SetLRTracks: ; e8b1b
push de
; store current channel in de
ld a, [CurChannel]
and $3
maskbits NUM_MUSIC_CHANS
ld e, a
ld d, 0
; get this channel's lr tracks
Expand Down Expand Up @@ -2449,7 +2449,7 @@ _PlayMusic:: ; e8b30
call LoadMusicByte ; store first byte of music header in a
rlca
rlca
and $3 ; get number of channels
maskbits NUM_MUSIC_CHANS
inc a
.loop
; start playing channels
Expand Down Expand Up @@ -2505,7 +2505,7 @@ _PlayCryHeader:: ; e8b79
; Top 2 bits contain the number of channels
rlca
rlca
and 3
maskbits NUM_MUSIC_CHANS

; For each channel:
inc a
Expand All @@ -2530,8 +2530,8 @@ _PlayCryHeader:: ; e8b79

; No tempo for channel 4
ld a, [CurChannel]
and 3
cp 3
maskbits NUM_MUSIC_CHANS
cp CHAN4
jr nc, .start

; Tempo is effectively length
Expand Down Expand Up @@ -2669,7 +2669,7 @@ _PlaySFX:: ; e8c04
call LoadMusicByte
rlca ; top 2
rlca ; bits
and $3
maskbits NUM_MUSIC_CHANS
inc a ; # channels -> # loops
.startchannels
push af
Expand Down Expand Up @@ -2722,7 +2722,7 @@ PlayStereoSFX:: ; e8ca6
call LoadMusicByte
rlca
rlca
and 3 ; ch1-4
maskbits NUM_MUSIC_CHANS
inc a

.loop
Expand All @@ -2736,7 +2736,7 @@ PlayStereoSFX:: ; e8ca6
push de
; get tracks for this channel
ld a, [CurChannel]
and 3 ; ch1-4
maskbits NUM_MUSIC_CHANS
ld e, a
ld d, 0
call GetLRTracks
Expand All @@ -2749,7 +2749,7 @@ PlayStereoSFX:: ; e8ca6
add hl, bc
ld [hl], a

ld hl, Channel1Field30 - Channel1 ; $c131 - Channel1
ld hl, Channel1Field30 - Channel1
add hl, bc
ld [hl], a

Expand All @@ -2760,11 +2760,11 @@ PlayStereoSFX:: ; e8ca6
; ch3-4
ld a, [wSFXDuration]

ld hl, Channel1Field2e - Channel1 ; $c12f - Channel1
ld hl, Channel1Field2e - Channel1
add hl, bc
ld [hl], a

ld hl, Channel1Field2f - Channel1 ; $c130 - Channel1
ld hl, Channel1Field2f - Channel1
add hl, bc
ld [hl], a

Expand Down
14 changes: 7 additions & 7 deletions macros/charmap.asm → charmap.asm
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,18 @@

; Actual characters (from other graphics files)

charmap "|", $31 ; from gfx/stats/stats_tiles

charmap "<SHINY>", $3f ; gfx/stats/shiny

charmap "<BLACK>", $60 ; from gfx/mobile/phone_tiles.2bpp
; needed for _LoadFontsExtra1 (see engine/load_font.asm)
charmap "<BLACK>", $60 ; gfx/font/black_arrow.2bpp
charmap "▲", $61 ; gfx/font/up_arrow.png
charmap "<PHONE>", $62 ; gfx/font/overworld_phone_icon.2bpp
charmap "_", $62 ; from gfx/battle/hp_exp_bar_border.1bpp
charmap "<PHONE>", $62 ; gfx/font/phone_icon.2bpp

; needed for Special_MagikarpHouseSign (see engine/events/magikarp.asm)
charmap "′", $6e ; gfx/font/feet_inches.png
charmap "″", $6f ; gfx/font/feet_inches.png

; needed for StatsScreen_PlaceShinyIcon and PrintPartyMonPage1
charmap "<SHINY>", $3f ; gfx/stats/stats_tiles.png, tile 14

; Actual characters (from gfx/font/font.png)

charmap "A", $80
Expand Down
3 changes: 3 additions & 0 deletions constants.asm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
INCLUDE "charmap.asm"

INCLUDE "macros.asm"

INCLUDE "hram.asm"
Expand Down Expand Up @@ -47,3 +49,4 @@ INCLUDE "constants/battle_tower_constants.asm"
INCLUDE "constants/cry_constants.asm"
INCLUDE "constants/audio_constants.asm"
INCLUDE "constants/printer_constants.asm"
INCLUDE "constants/menu_constants.asm"
Loading