Skip to content

Commit

Permalink
Local labels starting with capital letters are now decorated with a t…
Browse files Browse the repository at this point in the history
…railing colon; remove trailing whitespace; globally correct line endings to UNIX style
  • Loading branch information
PikalaxALT committed Apr 10, 2016
1 parent 46ead9b commit bf73772
Show file tree
Hide file tree
Showing 537 changed files with 4,556 additions and 4,556 deletions.
96 changes: 48 additions & 48 deletions audio/engine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ UpdateChannels: ; e8125
jp [hl]


.ChannelFnPtrs
.ChannelFnPtrs:
dw .Channel1
dw .Channel2
dw .Channel3
Expand All @@ -245,11 +245,11 @@ UpdateChannels: ; e8125
dw .Channel7
dw .Channel8

.Channel1
.Channel1:
ld a, [Danger]
bit 7, a
ret nz
.Channel5
.Channel5:
ld hl, Channel1NoteFlags - Channel1
add hl, bc
bit NOTE_UNKN_3, [hl]
Expand Down Expand Up @@ -317,8 +317,8 @@ UpdateChannels: ; e8125
ld [rNR14], a
ret

.Channel2
.Channel6
.Channel2:
.Channel6:
ld hl, Channel1NoteFlags - Channel1
add hl, bc
bit NOTE_REST, [hl] ; rest
Expand Down Expand Up @@ -377,8 +377,8 @@ UpdateChannels: ; e8125
ld [rNR24], a
ret

.Channel3
.Channel7
.Channel3:
.Channel7:
ld hl, Channel1NoteFlags - Channel1
add hl, bc
bit NOTE_REST, [hl] ; rest
Expand Down Expand Up @@ -478,8 +478,8 @@ endr
ld [rNR32], a
ret

.Channel4
.Channel8
.Channel4:
.Channel8:
ld hl, Channel1NoteFlags - Channel1
add hl, bc
bit NOTE_REST, [hl] ; rest
Expand Down Expand Up @@ -2483,62 +2483,62 @@ _PlayCryHeader:: ; e8b79
; Play cry de using parameters:
; CryPitch
; CryLength

call MusicOff

; Overload the music id with the cry id
ld hl, MusicID
ld [hl], e
inc hl
ld [hl], d

; 3-byte pointers (bank, address)
ld hl, Cries
rept 3
add hl, de
endr

ld a, [hli]
ld [MusicBank], a

ld e, [hl]
inc hl
ld d, [hl]

; Read the cry's sound header
call LoadMusicByte
; Top 2 bits contain the number of channels
rlca
rlca
and 3

; For each channel:
inc a
.loop
push af
call LoadChannel

ld hl, Channel1Flags - Channel1
add hl, bc
set SOUND_REST, [hl]

ld hl, Channel1Flags2 - Channel1
add hl, bc
set SOUND_CRY_PITCH, [hl]

ld hl, Channel1CryPitch - Channel1
add hl, bc
ld a, [CryPitch]
ld [hli], a
ld a, [CryPitch + 1]
ld [hl], a

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

; Tempo is effectively length
ld hl, Channel1Tempo - Channel1
add hl, bc
Expand All @@ -2551,14 +2551,14 @@ endr
ld a, [wStereoPanningMask]
and a
jr z, .next

; Stereo only: Play cry from the monster's side.
; This only applies in-battle.

ld a, [Options]
bit 5, a ; stereo
jr z, .next

; [Tracks] &= [CryTracks]
ld hl, Channel1Tracks - Channel1
add hl, bc
Expand All @@ -2568,23 +2568,23 @@ endr
ld hl, Channel1Tracks - Channel1
add hl, bc
ld [hl], a

.next
pop af
dec a
jr nz, .loop


; Cries play at max volume, so we save the current volume for later.
ld a, [LastVolume]
and a
jr nz, .end

ld a, [Volume]
ld [LastVolume], a
ld a, $77
ld [Volume], a

.end
ld a, 1 ; stop playing music
ld [SFXPriority], a
Expand Down Expand Up @@ -2699,47 +2699,47 @@ PlayStereoSFX:: ; e8ca6
; play sfx de

call MusicOff

; standard procedure if stereo's off
ld a, [Options]
bit 5, a
jp z, _PlaySFX

; else, let's go ahead with this
ld hl, MusicID
ld [hl], e
inc hl
ld [hl], d

; get sfx ptr
ld hl, SFX
rept 3
add hl, de
endr

; bank
ld a, [hli]
ld [MusicBank], a
; address
ld e, [hl]
inc hl
ld d, [hl]

; bit 2-3
call LoadMusicByte
rlca
rlca
and 3 ; ch1-4
inc a

.loop
push af
call LoadChannel

ld hl, Channel1Flags - Channel1
add hl, bc
set SOUND_SFX, [hl]

push de
; get tracks for this channel
ld a, [CurChannel]
Expand All @@ -2751,47 +2751,47 @@ endr
ld a, [hl]
ld hl, wStereoPanningMask
and [hl]

ld hl, Channel1Tracks - Channel1
add hl, bc
ld [hl], a

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

ld a, [CryTracks]
cp 2 ; ch 1-2
jr c, .skip

; ch3-4
ld a, [wSFXDuration]

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

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

ld hl, Channel1Flags2 - Channel1
add hl, bc
set SOUND_UNKN_0F, [hl]

.skip
pop de

; turn channel on
ld hl, Channel1Flags - Channel1
add hl, bc
set SOUND_CHANNEL_ON, [hl] ; on

; done?
pop af
dec a
jr nz, .loop

; we're done
call MusicOn
ret
Expand Down
4 changes: 2 additions & 2 deletions audio/music_pointers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
dba Music_LakeOfRageRocketRadio ; 0xef5b1
dba Music_Printer ; 0xf07fd
dba Music_PostCredits ; 0xcfd9e

; Crystal adds the following songs:

dba Music_Clair ; 0x1fa8d
dba Music_MobileAdapterMenu ; 0x17801f
dba Music_MobileAdapter ; 0x1fc87
Expand Down
8 changes: 4 additions & 4 deletions battle/ai/items.asm
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ AI_Items: ; 39196
jp c, .Use
jp .DontUse

.StatusCheckContext
.StatusCheckContext:
ld a, [EnemySubStatus5]
bit SUBSTATUS_TOXIC, a
jr z, .FailToxicCheck
Expand All @@ -328,7 +328,7 @@ AI_Items: ; 39196
call Random
cp 1 + 50 percent
jp c, .Use
.FailToxicCheck
.FailToxicCheck:
ld a, [EnemyMonStatus]
and 1 << FRZ | SLP
jp z, .DontUse
Expand All @@ -344,7 +344,7 @@ AI_Items: ; 39196
call .Status
jp c, .DontUse

.UseFullRestore
.UseFullRestore:
call EnemyUsedFullRestore
jp .Use
; 38220
Expand Down Expand Up @@ -676,7 +676,7 @@ AI_TrySwitch: ; 3844b
ld c, a
ld hl, OTPartyMon1HP
ld d, 0
.SwitchLoop
.SwitchLoop:
ld a, [hli]
ld b, a
ld a, [hld]
Expand Down
Loading

0 comments on commit bf73772

Please sign in to comment.