Skip to content

Commit

Permalink
Fix some indentation and trailing whitespace
Browse files Browse the repository at this point in the history
Co-Authored-By: Rangi <35663410+Rangi42@users.noreply.github.com>
  • Loading branch information
vulcandth and Rangi42 committed Apr 19, 2022
1 parent ce646ab commit 93d64b4
Show file tree
Hide file tree
Showing 21 changed files with 285 additions and 284 deletions.
28 changes: 14 additions & 14 deletions audio/engine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1382,29 +1382,29 @@ MusicCommands:
dw Music_Octave2
dw Music_Octave1
dw Music_NoteType ; note length + volume envelope
dw Music_Transpose
dw Music_Transpose
dw Music_Tempo
dw Music_DutyCycle
dw Music_VolumeEnvelope
dw Music_VolumeEnvelope
dw Music_PitchSweep
dw Music_DutyCyclePattern
dw Music_ToggleSFX
dw Music_PitchSlide
dw Music_Vibrato
dw Music_ToggleSFX
dw Music_PitchSlide
dw Music_Vibrato
dw MusicE2 ; unused
dw Music_ToggleNoise
dw Music_ForceStereoPanning
dw Music_Volume
dw Music_PitchOffset
dw Music_ToggleNoise
dw Music_ForceStereoPanning
dw Music_Volume
dw Music_PitchOffset
dw MusicE7 ; unused
dw MusicE8 ; unused
dw Music_TempoRelative
dw Music_RestartChannel
dw Music_NewSong
dw Music_SFXPriorityOn
dw Music_SFXPriorityOff
dw Music_NewSong
dw Music_SFXPriorityOn
dw Music_SFXPriorityOff
dw MusicEE ; unused
dw Music_StereoPanning
dw Music_StereoPanning
dw Music_SFXToggleNoise
dw MusicF1 ; nothing
dw MusicF2 ; nothing
Expand All @@ -1415,7 +1415,7 @@ MusicCommands:
dw MusicF7 ; nothing
dw MusicF8 ; nothing
dw MusicF9 ; unused
dw Music_SetCondition
dw Music_SetCondition
dw Music_JumpIf
dw Music_Jump
dw Music_Loop
Expand Down
8 changes: 4 additions & 4 deletions constants/audio_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DEF CHANNEL_FLAGS2 rb
DEF CHANNEL_FLAGS3 rb
DEF CHANNEL_MUSIC_ADDRESS rw
DEF CHANNEL_LAST_MUSIC_ADDRESS rw
rb_skip 2
rb_skip 2
DEF CHANNEL_NOTE_FLAGS rb
DEF CHANNEL_CONDITION rb
DEF CHANNEL_DUTY_CYCLE rb
Expand All @@ -50,7 +50,7 @@ DEF CHANNEL_OCTAVE rb
DEF CHANNEL_TRANSPOSITION rb
DEF CHANNEL_NOTE_DURATION rb
DEF CHANNEL_FIELD16 rb
rb_skip
rb_skip
DEF CHANNEL_LOOP_COUNT rb
DEF CHANNEL_TEMPO rw
DEF CHANNEL_TRACKS rb
Expand All @@ -63,7 +63,7 @@ DEF CHANNEL_PITCH_SLIDE_TARGET rw
DEF CHANNEL_PITCH_SLIDE_AMOUNT rb
DEF CHANNEL_PITCH_SLIDE_AMOUNT_FRACTION rb
DEF CHANNEL_FIELD25 rb
rb_skip
rb_skip
DEF CHANNEL_PITCH_OFFSET rw
DEF CHANNEL_FIELD29 rb
DEF CHANNEL_FIELD2A rw
Expand All @@ -72,7 +72,7 @@ DEF CHANNEL_NOTE_LENGTH rb
DEF CHANNEL_FIELD2E rb
DEF CHANNEL_FIELD2F rb
DEF CHANNEL_FIELD30 rb
rb_skip
rb_skip
DEF CHANNEL_STRUCT_LENGTH EQU _RS

DEF NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7
Expand Down
2 changes: 1 addition & 1 deletion constants/battle_anim_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ DEF BATTLEANIMSTRUCT_FRAME rb
DEF BATTLEANIMSTRUCT_JUMPTABLE_INDEX rb
DEF BATTLEANIMSTRUCT_VAR1 rb
DEF BATTLEANIMSTRUCT_VAR2 rb
rb_skip 7
rb_skip 7
DEF BATTLEANIMSTRUCT_LENGTH EQU _RS
DEF NUM_ANIM_OBJECTS EQU 10 ; see wActiveAnimObjects

Expand Down
6 changes: 3 additions & 3 deletions constants/hardware_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ DEF RTC_M EQU $09 ; Minutes 0-59 (0-3Bh)
DEF RTC_H EQU $0a ; Hours 0-23 (0-17h)
DEF RTC_DL EQU $0b ; Lower 8 bits of Day Counter (0-FFh)
DEF RTC_DH EQU $0c ; Upper 1 bit of Day Counter, Carry Bit, Halt Flag
; Bit 0 Most significant bit of Day Counter (Bit 8)
; Bit 6 Halt (0=Active, 1=Stop Timer)
; Bit 7 Day Counter Carry Bit (1=Counter Overflow)
; Bit 0 Most significant bit of Day Counter (Bit 8)
; Bit 6 Halt (0=Active, 1=Stop Timer)
; Bit 7 Day Counter Carry Bit (1=Counter Overflow)

; interrupt flags
DEF VBLANK EQU 0
Expand Down
4 changes: 2 additions & 2 deletions constants/map_object_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DEF OBJECT_1D rb ; 1d
DEF OBJECT_1E rb ; 1e
DEF OBJECT_1F rb ; 1f
DEF OBJECT_RANGE rb ; 20
rb_skip 7
rb_skip 7
DEF OBJECT_LENGTH EQU _RS
DEF NUM_OBJECT_STRUCTS EQU 13 ; see wObjectStructs

Expand Down Expand Up @@ -110,7 +110,7 @@ DEF MAPOBJECT_COLOR rb ; 8
DEF MAPOBJECT_RANGE rb ; 9
DEF MAPOBJECT_SCRIPT_POINTER rw ; a
DEF MAPOBJECT_EVENT_FLAG rw ; c
rb_skip 2
rb_skip 2
DEF MAPOBJECT_LENGTH EQU _RS
DEF NUM_OBJECTS EQU 16
DEF PLAYER_OBJECT EQU 0
Expand Down
2 changes: 1 addition & 1 deletion constants/npc_trade_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DEF NPCTRADE_ITEM rb
DEF NPCTRADE_OT_ID rw
DEF NPCTRADE_OT_NAME rb NAME_LENGTH
DEF NPCTRADE_GENDER rb
rb_skip
rb_skip
DEF NPCTRADE_STRUCT_LENGTH EQU _RS

; NPCTrades indexes (see data/events/npc_trades.asm)
Expand Down
8 changes: 4 additions & 4 deletions constants/pokemon_data_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ rsset BASE_ITEMS
DEF BASE_ITEM_1 rb
DEF BASE_ITEM_2 rb
DEF BASE_GENDER rb
rb_skip
rb_skip
DEF BASE_EGG_STEPS rb
rb_skip
rb_skip
DEF BASE_PIC_SIZE rb
DEF BASE_FRONTPIC rw
DEF BASE_BACKPIC rw
Expand Down Expand Up @@ -90,11 +90,11 @@ DEF MON_DVS rw
DEF MON_PP rb NUM_MOVES
DEF MON_HAPPINESS rb
DEF MON_POKERUS rb
rb_skip 2
rb_skip 2
DEF MON_LEVEL rb
DEF BOXMON_STRUCT_LENGTH EQU _RS
DEF MON_STATUS rb
rb_skip
rb_skip
DEF MON_HP rw
DEF MON_MAXHP rw
DEF MON_STATS rw NUM_BATTLE_STATS
Expand Down
117 changes: 59 additions & 58 deletions data/maps/attributes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -24,66 +24,66 @@ MACRO connection
;\4: offset of the target map relative to the current map
; (x offset for east/west, y offset for north/south)

; LEGACY: Support for old connection macro
if _NARG == 6
connection \1, \2, \3, (\4) - (\5)
else
; LEGACY: Support for old connection macro
if _NARG == 6
connection \1, \2, \3, (\4) - (\5)
else

; Calculate tile offsets for source (current) and target maps
; Calculate tile offsets for source (current) and target maps
DEF _src = 0
DEF _tgt = (\4) + 3
if _tgt < 0
DEF _src = -_tgt
DEF _tgt = 0
endc

if !STRCMP("\1", "north")
DEF _blk = \3_WIDTH * (\3_HEIGHT - 3) + _src
DEF _map = _tgt
DEF _win = (\3_WIDTH + 6) * \3_HEIGHT + 1
DEF _y = \3_HEIGHT * 2 - 1
DEF _x = (\4) * -2
DEF _len = CURRENT_MAP_WIDTH + 3 - (\4)
if _len > \3_WIDTH
DEF _len = \3_WIDTH
endc

elif !STRCMP("\1", "south")
DEF _blk = _src
DEF _map = (CURRENT_MAP_WIDTH + 6) * (CURRENT_MAP_HEIGHT + 3) + _tgt
DEF _win = \3_WIDTH + 7
DEF _y = 0
DEF _x = (\4) * -2
DEF _len = CURRENT_MAP_WIDTH + 3 - (\4)
if _len > \3_WIDTH
DEF _len = \3_WIDTH
endc

elif !STRCMP("\1", "west")
DEF _blk = (\3_WIDTH * _src) + \3_WIDTH - 3
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt
DEF _win = (\3_WIDTH + 6) * 2 - 6
DEF _y = (\4) * -2
DEF _x = \3_WIDTH * 2 - 1
DEF _len = CURRENT_MAP_HEIGHT + 3 - (\4)
if _len > \3_HEIGHT
DEF _len = \3_HEIGHT
endc

elif !STRCMP("\1", "east")
DEF _blk = (\3_WIDTH * _src)
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt + CURRENT_MAP_WIDTH + 3
DEF _win = \3_WIDTH + 7
DEF _y = (\4) * -2
DEF _x = 0
DEF _len = CURRENT_MAP_HEIGHT + 3 - (\4)
if _len > \3_HEIGHT
DEF _len = \3_HEIGHT
endc

else
fail "Invalid direction for 'connection'."
endc
if _tgt < 0
DEF _src = -_tgt
DEF _tgt = 0
endc

if !STRCMP("\1", "north")
DEF _blk = \3_WIDTH * (\3_HEIGHT - 3) + _src
DEF _map = _tgt
DEF _win = (\3_WIDTH + 6) * \3_HEIGHT + 1
DEF _y = \3_HEIGHT * 2 - 1
DEF _x = (\4) * -2
DEF _len = CURRENT_MAP_WIDTH + 3 - (\4)
if _len > \3_WIDTH
DEF _len = \3_WIDTH
endc

elif !STRCMP("\1", "south")
DEF _blk = _src
DEF _map = (CURRENT_MAP_WIDTH + 6) * (CURRENT_MAP_HEIGHT + 3) + _tgt
DEF _win = \3_WIDTH + 7
DEF _y = 0
DEF _x = (\4) * -2
DEF _len = CURRENT_MAP_WIDTH + 3 - (\4)
if _len > \3_WIDTH
DEF _len = \3_WIDTH
endc

elif !STRCMP("\1", "west")
DEF _blk = (\3_WIDTH * _src) + \3_WIDTH - 3
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt
DEF _win = (\3_WIDTH + 6) * 2 - 6
DEF _y = (\4) * -2
DEF _x = \3_WIDTH * 2 - 1
DEF _len = CURRENT_MAP_HEIGHT + 3 - (\4)
if _len > \3_HEIGHT
DEF _len = \3_HEIGHT
endc

elif !STRCMP("\1", "east")
DEF _blk = (\3_WIDTH * _src)
DEF _map = (CURRENT_MAP_WIDTH + 6) * _tgt + CURRENT_MAP_WIDTH + 3
DEF _win = \3_WIDTH + 7
DEF _y = (\4) * -2
DEF _x = 0
DEF _len = CURRENT_MAP_HEIGHT + 3 - (\4)
if _len > \3_HEIGHT
DEF _len = \3_HEIGHT
endc

else
fail "Invalid direction for 'connection'."
endc

map_id \3
dw \2_Blocks + _blk
Expand All @@ -92,7 +92,8 @@ endc
db \3_WIDTH
db _y, _x
dw wOverworldMapBlocks + _win
endc

endc
ENDM


Expand Down
20 changes: 10 additions & 10 deletions macros/asserts.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

MACRO table_width
DEF CURRENT_TABLE_WIDTH = \1
if _NARG == 2
REDEF CURRENT_TABLE_START EQUS "\2"
if _NARG == 2
REDEF CURRENT_TABLE_START EQUS "\2"
else
REDEF CURRENT_TABLE_START EQUS "._table_width\@"
{CURRENT_TABLE_START}:
endc
{CURRENT_TABLE_START}:
endc
ENDM

MACRO assert_table_length
Expand All @@ -18,12 +18,12 @@ ENDM

MACRO list_start
DEF list_index = 0
if _NARG == 1
REDEF CURRENT_LIST_START EQUS "\1"
else
REDEF CURRENT_LIST_START EQUS "._list_start\@"
{CURRENT_LIST_START}:
endc
if _NARG == 1
REDEF CURRENT_LIST_START EQUS "\1"
else
REDEF CURRENT_LIST_START EQUS "._list_start\@"
{CURRENT_LIST_START}:
endc
ENDM

MACRO li
Expand Down
20 changes: 10 additions & 10 deletions macros/code.asm
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ MACRO maskbits
; jr nc, .loop
assert 0 < (\1) && (\1) <= $100, "bitmask must be 8-bit"
DEF x = 1
rept 8
if x + 1 < (\1)
DEF x = (x << 1) | 1
endc
endr
if _NARG == 2
and x << (\2)
else
and x
endc
rept 8
if x + 1 < (\1)
DEF x = (x << 1) | 1
endc
endr
if _NARG == 2
and x << (\2)
else
and x
endc
ENDM

MACRO calc_sine_wave
Expand Down
Loading

0 comments on commit 93d64b4

Please sign in to comment.