Merge branch 'master' into audio-macros

This commit is contained in:
dannye 2020-01-06 22:07:33 -06:00
commit e7be25948d
451 changed files with 10496 additions and 10448 deletions

2
.gitignore vendored
View File

@ -36,6 +36,8 @@ pokecrystal.txt
.*.swp
# swap files for gedit
*~
# osx files
.DS_STORE
*.dimensions
*.gbcpal

4
FAQ.md
View File

@ -38,11 +38,11 @@ You need to install `gcc`. If you're using Cygwin, re-run its setup, and at "Sel
### "ERROR: `UNION` already defined"
Download [**rgbds 0.3.8**][rgbds]. Older versions will not work.
Download [**rgbds 0.3.9**][rgbds] or newer. Older versions will not work.
### "Expression must be 8-bit"
Download [**rgbds 0.3.8**][rgbds]. Older versions will not work.
Download [**rgbds 0.3.9**][rgbds] or newer. Older versions will not work.
### "Segmentation fault" from `rgbgfx`

View File

@ -38,7 +38,7 @@ Double click on the text that says "**Skip**" next to each package to select the
Then download [**rgbds**](https://github.com/rednex/rgbds/releases/): the latest **win64.zip** or **win32.zip** release. Extract it and put all the `exe` and `dll` files individually in **C:\cygwin64\usr\local\bin**.
**Note: If you already have an older rgbds, you will need to update to 0.3.8.** Ignore this if you have never installed rgbds before. If a version newer than 0.3.8 does not work, try downloading 0.3.8.
**Note: If you already have an older rgbds, you will need to update to 0.3.9.** Ignore this if you have never installed rgbds before. If a version newer than 0.3.9 does not work, try downloading 0.3.9.
Now open the **Cygwin terminal** and enter the following commands.

View File

@ -14,6 +14,7 @@ engine/movie/credits.o \
engine/overworld/events.o \
gfx/pics.o \
gfx/sprites.o \
gfx/tilesets.o \
lib/mobile/main.o
crystal11_obj := $(crystal_obj:.o=11.o)
@ -166,6 +167,7 @@ gfx/mail/flower_mail_border.1bpp: tools/gfx += --remove-whitespace
gfx/mail/litebluemail_border.1bpp: tools/gfx += --remove-whitespace
gfx/pokedex/pokedex.2bpp: tools/gfx += --trim-whitespace
gfx/pokedex/question_mark.2bpp: rgbgfx += -h
gfx/pokedex/sgb.2bpp: tools/gfx += --trim-whitespace
gfx/pokedex/slowpoke.2bpp: tools/gfx += --trim-whitespace

View File

@ -40,7 +40,7 @@ Other disassembly projects:
[docs]: https://pret.github.io/pokecrystal/
[wiki]: https://github.com/pret/pokecrystal/wiki
[tutorials]: https://github.com/pret/pokecrystal/wiki/Tutorials
[discord]: https://discord.gg/6EuWgX9
[discord]: https://discord.gg/d5dubZ3
[irc]: https://kiwiirc.com/client/irc.freenode.net/?#pret
[travis]: https://travis-ci.org/pret/pokecrystal
[travis-badge]: https://travis-ci.org/pret/pokecrystal.svg?branch=master

View File

@ -6,7 +6,7 @@
; FadeMusic
; PlayStereoSFX
_MapSetup_Sound_Off::
_InitSound::
; restart sound operation
; clear all relevant hardware registers & wram
push hl
@ -62,7 +62,7 @@ MusicFadeRestart:
push af
ld a, [wMusicFadeID]
push af
call _MapSetup_Sound_Off
call _InitSound
pop af
ld [wMusicFadeID], a
pop af
@ -1364,7 +1364,7 @@ ParseMusicCommand:
jp hl
MusicCommands:
; entries correspond to macros/sound.asm enumeration
; entries correspond to macros/scripts/audio.asm enumeration
dw Music_Octave8 ; octave 8
dw Music_Octave7 ; octave 7
dw Music_Octave6 ; octave 6
@ -2798,7 +2798,7 @@ ChannelPointers:
ClearChannels::
; runs ClearChannel for all 4 channels
; doesn't seem to be used, but functionally identical to MapSetup_Sound_Off
; doesn't seem to be used, but functionally identical to InitSound
ld hl, rNR50
xor a
ld [hli], a

View File

@ -1174,16 +1174,14 @@ Sfx_3rdPlace_Ch7:
toggle_sfx
Sfx_GetEggFromDayCareMan:
Sfx_GetEggFromDayCareLady:
Sfx_GetEgg:
channel_count 4
channel 5, Sfx_GetEggFromDayCareLady_Ch5
channel 6, Sfx_GetEggFromDayCareLady_Ch6
channel 7, Sfx_GetEggFromDayCareLady_Ch7
channel 8, Sfx_GetEggFromDayCareLady_Ch8
channel 5, Sfx_GetEgg_Ch5
channel 6, Sfx_GetEgg_Ch6
channel 7, Sfx_GetEgg_Ch7
channel 8, Sfx_GetEgg_Ch8
Sfx_GetEggFromDayCareMan_Ch5:
Sfx_GetEggFromDayCareLady_Ch5:
Sfx_GetEgg_Ch5:
toggle_sfx
tempo 120
volume 7, 7
@ -1215,8 +1213,7 @@ Sfx_GetEggFromDayCareLady_Ch5:
toggle_sfx
Sfx_GetEggFromDayCareMan_Ch6:
Sfx_GetEggFromDayCareLady_Ch6:
Sfx_GetEgg_Ch6:
toggle_sfx
vibrato 18, 3, 4
duty_cycle 3
@ -1245,8 +1242,7 @@ Sfx_GetEggFromDayCareLady_Ch6:
toggle_sfx
Sfx_GetEggFromDayCareMan_Ch7:
Sfx_GetEggFromDayCareLady_Ch7:
Sfx_GetEgg_Ch7:
toggle_sfx
note_type 8, 2, 5
rest 2
@ -1265,8 +1261,7 @@ Sfx_GetEggFromDayCareLady_Ch7:
toggle_sfx
Sfx_GetEggFromDayCareMan_Ch8:
Sfx_GetEggFromDayCareLady_Ch8:
Sfx_GetEgg_Ch8:
toggle_sfx
sfx_toggle_noise 4
drum_speed 8

View File

@ -149,8 +149,8 @@ SFX:
dba Sfx_Fanfare2
dba Sfx_RegisterPhoneNumber
dba Sfx_3rdPlace
dba Sfx_GetEggFromDayCareMan
dba Sfx_GetEggFromDayCareLady
dba Sfx_GetEgg
dba Sfx_GetEgg
dba Sfx_MoveDeleted
dba Sfx_2ndPlace
dba Sfx_1stPlace

View File

@ -416,3 +416,8 @@
charmap "", $fd
charmap "", $fe
charmap "", $ff
; ASCII charmap, for mobile functions
pushc
newcharmap ascii
popc

View File

@ -1,4 +1,4 @@
; EngineFlags indexes (see engine/engine_flags.asm)
; EngineFlags indexes (see data/engine_flags.asm)
const_def
; wPokegearFlags
const ENGINE_RADIO_CARD
@ -64,7 +64,7 @@
const ENGINE_UNLOCKED_UNOWNS_UNUSED_7
; wVisitedSpawns
const ENGINE_FLYPOINT_PLAYERS_HOUSE
const ENGINE_FLYPOINT_VIRIDIAN_POKECENTER
const ENGINE_FLYPOINT_DEBUG
const ENGINE_FLYPOINT_PALLET
const ENGINE_FLYPOINT_VIRIDIAN
const ENGINE_FLYPOINT_PEWTER

View File

@ -34,7 +34,7 @@
const OBJECT_1F ; 1f
const OBJECT_RANGE ; 20
; 21-27 are not used
OBJECT_STRUCT_LENGTH EQU 40
OBJECT_LENGTH EQU 40
NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs
; object_struct OBJECT_FACING values
@ -114,7 +114,7 @@ ABSOLUTE_TILE_ID EQU 1 << ABSOLUTE_TILE_ID_F
const MAPOBJECT_FLAG_HI ; d
const MAPOBJECT_E ; unused
const MAPOBJECT_F ; unused
OBJECT_LENGTH EQU const_value
MAPOBJECT_LENGTH EQU const_value
; SpriteMovementData struct members (see data/sprites/map_objects.asm)
const_def

View File

@ -15,55 +15,53 @@
const MAPSETUP_FLY ; fc
; MapSetupCommands indexes (see engine/overworld/map_setup.asm)
; Names taken from Condensation water's scripting compendium
; https://hax.iimarck.us/files/scriptingcodes_eng.htm
const_def
const map_lcd_on ; 00
const map_lcd_off ; 01
const map_sound_off ; 02
const map_music ; 03
const map_start_music ; 04
const map_fade_music ; 05
const map_fade ; 06
const map_bike_music ; 07
const map_music_force ; 08
const map_max_volume ; 09
const map_load_blocks ; 0a
const map_connection_blocks ; 0b
const map_enable_lcd ; 00
const map_disable_lcd ; 01
const map_init_sound ; 02
const map_play_music ; 03
const map_restart_music ; 04
const map_fade_to_music ; 05
const map_fade_music_and_palettes ; 06
const map_play_music_bike ; 07
const map_force_music ; 08
const map_fade_in_music ; 09
const map_load_block_data ; 0a
const map_load_connection_block_data ; 0b
const map_save_screen ; 0c
const map_buffer_screen ; 0d
const map_load_graphics ; 0e
const map_load_tileset ; 0f
const map_time_of_day ; 10
const map_palettes ; 11
const map_wildmons ; 12
const map_sprites ; 13
const map_change_callback ; 14
const map_start_callback ; 15
const map_load_time_of_day ; 10
const map_load_palettes ; 11
const map_load_wild_mon_data ; 12
const map_refresh_sprites ; 13
const map_handle_new ; 14
const map_handle_continue ; 15
const map_load_objects ; 16
const map_load_spawn ; 17
const map_load_connection ; 18
const map_load_warp ; 19
const map_enter_spawn_point ; 17
const map_enter_connection ; 18
const map_enter_warp ; 19
const map_load_attributes ; 1a
const map_load_attributes_2 ; 1b
const map_load_attributes_no_objects ; 1b
const map_clear_bg_palettes ; 1c
const map_fade_out_palettes ; 1d
const map_fade_in_palettes ; 1e
const map_anchor_screen ; 1f
const map_warp_face ; 20
const map_face_down ; 21
const map_spawn_coord ; 22
const map_player_coord ; 23
const map_prolong_sprites ; 24
const map_delay_sprites ; 25
const map_update_roam ; 26
const map_keep_roam ; 27
const map_get_screen_coords ; 1f
const map_get_warp_dest_coords ; 20
const map_spawn_in_facing_down ; 21
const map_spawn_player ; 22
const map_refresh_player_coords ; 23
const map_reset_player_object_action ; 24
const map_skip_update_sprites ; 25
const map_update_roam_mons ; 26
const map_jump_roam_mons ; 27
const map_fade_out_music ; 28
const map_animations_on ; 29
const map_animations_off ; 2a
const map_keep_palettes ; 2b
const map_text_scroll_off ; 2c
const map_stop_script ; 2d
const map_activate_anims ; 29
const map_suspend_anims ; 2a
const map_apply_palettes ; 2b
const map_enable_text_acceleration ; 2c
const map_init_name_sign ; 2d
map_end EQU -1
; callback types

View File

@ -19,3 +19,8 @@
NUM_KANA EQU 45 ; length of SortedPokemon table (see mobile/fixed_words.asm)
MOBILE_LOGIN_PASSWORD_LENGTH EQU 17
MOBILE_PHONE_NUMBER_LENGTH EQU 20
; Maximum amount of time allowed for mobile battles each day
MOBILE_BATTLE_ALLOWED_SECONDS EQU 0
MOBILE_BATTLE_ALLOWED_MINUTES EQU 10

View File

@ -92,6 +92,17 @@ RETVAR_EXECUTE EQU (2 << 6)
const PLAYEREVENT_JOYCHANGEFACING
NUM_PLAYER_EVENTS EQU const_value
; PlayerMovement.pointers indexes (see engine/overworld/events.asm)
const_def
const PLAYERMOVEMENT_NORMAL
const PLAYERMOVEMENT_WARP
const PLAYERMOVEMENT_TURN
const PLAYERMOVEMENT_FORCE_TURN
const PLAYERMOVEMENT_FINISH
const PLAYERMOVEMENT_CONTINUE
const PLAYERMOVEMENT_EXIT_WATER
const PLAYERMOVEMENT_JUMP
; script data sizes (see macros/scripts/maps.asm)
SCENE_SCRIPT_SIZE EQU 4 ; scene_script
CALLBACK_SIZE EQU 3 ; callback

View File

@ -1,4 +1,4 @@
; link types
; wLinkMode
const_def
const LINK_NULL ; 0
const LINK_TIMECAPSULE ; 1

View File

@ -150,8 +150,8 @@
const SFX_FANFARE_2 ; 92
const SFX_REGISTER_PHONE_NUMBER ; 93
const SFX_3RD_PLACE ; 94
const SFX_GET_EGG_FROM_DAY_CARE_MAN ; 95
const SFX_GET_EGG_FROM_DAY_CARE_LADY ; 96
const SFX_GET_EGG_UNUSED ; 95
const SFX_GET_EGG ; 96
const SFX_MOVE_DELETED ; 97
const SFX_2ND_PLACE ; 98
const SFX_1ST_PLACE ; 99

View File

@ -33,12 +33,12 @@ TEXTBOX_INNERY EQU TEXTBOX_Y + 2
; PrintNum bit flags
const_def 5
const PRINTNUM_MONEY_F ; 5
const PRINTNUM_RIGHTALIGN_F ; 6
const PRINTNUM_LEFTALIGN_F ; 6
const PRINTNUM_LEADINGZEROS_F ; 7
; PrintNum arguments (see engine/math/print_num.asm)
PRINTNUM_MONEY EQU 1 << PRINTNUM_MONEY_F
PRINTNUM_RIGHTALIGN EQU 1 << PRINTNUM_RIGHTALIGN_F
PRINTNUM_LEFTALIGN EQU 1 << PRINTNUM_LEFTALIGN_F
PRINTNUM_LEADINGZEROS EQU 1 << PRINTNUM_LEADINGZEROS_F
; character sets (see charmap.asm)

View File

@ -21,7 +21,7 @@
const TILESET_LIGHTHOUSE ; 13
const TILESET_PLAYERS_ROOM ; 14
const TILESET_POKECOM_CENTER ; 15
const TILESET_BATTLE_TOWER ; 16
const TILESET_BATTLE_TOWER_INSIDE ; 16
const TILESET_TOWER ; 17
const TILESET_CAVE ; 18
const TILESET_PARK ; 19

File diff suppressed because it is too large Load Diff

View File

@ -6,6 +6,8 @@ SECTION "Maps", ROMX
INCLUDE "data/maps/maps.asm"
INCLUDE "data/maps/attributes.asm"
INCLUDE "data/maps/blocks.asm"
INCLUDE "data/maps/scripts.asm"

Some files were not shown because too many files have changed in this diff Show More