diff options
| author | Daniel Harding <33dannye@gmail.com> | 2018-02-27 11:09:09 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-27 11:09:09 -0600 |
| commit | 96b32412d82bdee2756b1a300b05d2647da9ad1f (patch) | |
| tree | 677858a17041e829c8a442be2b16b43e20d2a341 /src/audio | |
| parent | 24f40989d472407dc51653f2a671348126c6e816 (diff) | |
| parent | 43d4b8644de2ffb3b1fc13638081cd228c4b2c74 (diff) | |
Merge pull request #35 from xCrystal/master
Lots of bank0 and some bank1 disasm, labeling and corrections ; Many constants related to duels, cards, and WRAM structs ; Replace hardcoded WRAM addresses with generic labels ; Style clean up ; Format SGB packets ; Reorganize some gfx files
Diffstat (limited to 'src/audio')
| -rw-r--r--[-rwxr-xr-x] | src/audio/music1.asm | 90 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/music1_headers.asm | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/music2.asm | 84 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/music2_headers.asm | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/noise_instruments.asm | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/sfx.asm | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/sfx_headers.asm | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/vibrato_types.asm | 46 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/audio/wave_instruments.asm | 0 |
9 files changed, 110 insertions, 110 deletions
diff --git a/src/audio/music1.asm b/src/audio/music1.asm index 2db31c7..86d76f4 100755..100644 --- a/src/audio/music1.asm +++ b/src/audio/music1.asm @@ -25,10 +25,10 @@ Func_f4015:: ; f4015 (3d:4015) Func_f4018:: ; f4018 (3d:4018) jp Func_f406f -Func_f401b:: ; f401b (3d:401b) +_PauseSong:: ; f401b (3d:401b) jp Music1_PauseSong -Func_f401e:: ; f401e (3d:401e) +_ResumeSong:: ; f401e (3d:401e) jp Music1_ResumeSong Music1_PlaySong: ; f4021 (3d:4021) @@ -131,7 +131,7 @@ Music1_Init: ; f407d (3d:407d) ld [wMusicDC], a ld de, $0001 ld bc, $0000 -.zeroLoop1 +.zero_loop1 ld hl, wMusicIsPlaying add hl, bc ld [hl], d @@ -150,16 +150,16 @@ Music1_Init: ; f407d (3d:407d) inc c ld a, c cp $4 - jr nz, .zeroLoop1 + jr nz, .zero_loop1 ld hl, Music1_ChannelLoopStacks ld bc, wMusicChannelStackPointers ld d, $8 -.zeroLoop2 +.zero_loop2 ld a, [hli] ld [bc], a inc bc dec d - jr nz, .zeroLoop2 + jr nz, .zero_loop2 ret Music1_Update: ; f40e9 (3d:40e9) @@ -172,15 +172,15 @@ Music1_Update: ; f40e9 (3d:40e9) ld [MBC3RomBank], a ld a, [wddf2] cp $0 - jr z, .updateChannels + jr z, .update_channels call Func_f4980 - jr .skipChannelUpdates -.updateChannels + jr .skip_channel_Updates +.update_channels call Music1_UpdateChannel1 call Music1_UpdateChannel2 call Music1_UpdateChannel3 call Music1_UpdateChannel4 -.skipChannelUpdates +.skip_channel_Updates call Func_f4866 call Music1_CheckForEndOfSong ret @@ -188,24 +188,24 @@ Music1_Update: ; f40e9 (3d:40e9) Music1_CheckForNewSound: ; f411c (3d:411c) ld a, [wCurSongID] rla - jr c, .checkForNewSfx + jr c, .check_for_new_sfx call Music1_StopAllChannels ld a, [wCurSongID] call Music1_BeginSong ld a, [wCurSongID] or $80 ld [wCurSongID], a -.checkForNewSfx +.check_for_new_sfx ld a, [wCurSfxID] rla - jr c, .noNewSound + jr c, .no_new_sound ld a, [wCurSfxID] ld hl, SFX_PlaySFX call Bankswitch3dTo3f ld a, [wCurSfxID] or $80 ld [wCurSfxID], a -.noNewSound +.no_new_sound ret Music1_StopAllChannels: ; f414b (3d:414b) @@ -214,30 +214,30 @@ Music1_StopAllChannels: ; f414b (3d:414b) xor a ld [wMusicIsPlaying], a bit 0, d - jr nz, .stopChannel2 + jr nz, .stop_channel_2 ld a, $8 ld [rNR12], a swap a ld [rNR14], a -.stopChannel2 +.stop_channel_2 xor a ld [wMusicIsPlaying + 1], a bit 1, d - jr nz, .stopChannel4 + jr nz, .stop_channel_4 ld a, $8 ld [rNR22], a swap a ld [rNR24], a -.stopChannel4 +.stop_channel_4 xor a ld [wMusicIsPlaying + 3], a bit 3, d - jr nz, .stopChannel3 + jr nz, .stop_channel_3 ld a, $8 ld [rNR42], a swap a ld [rNR44], a -.stopChannel3 +.stop_channel_3 xor a ld [wMusicIsPlaying + 2], a bit 2, d @@ -273,7 +273,7 @@ Music1_BeginSong: ; f418c (3d:418c) ld b, h ld c, l rr e - jr nc, .noChannel1 + jr nc, .no_channel_1 ld a, [bc] inc bc ld [wMusicChannelPointers], a @@ -297,9 +297,9 @@ Music1_BeginSong: ; f418c (3d:418c) ld [wMusicChannelStackPointers + 1], a ld a, $8 ld [wMusicE9], a -.noChannel1 +.no_channel_1 rr e - jr nc, .noChannel2 + jr nc, .no_channel_2 ld a, [bc] inc bc ld [wMusicChannelPointers + 2], a @@ -323,9 +323,9 @@ Music1_BeginSong: ; f418c (3d:418c) ld [wMusicChannelStackPointers + 3], a ld a, $8 ld [wMusicE9 + 1], a -.noChannel2 +.no_channel_2 rr e - jr nc, .noChannel3 + jr nc, .no_channel_3 ld a, [bc] inc bc ld [wMusicChannelPointers + 4], a @@ -349,9 +349,9 @@ Music1_BeginSong: ; f418c (3d:418c) ld [wMusicChannelStackPointers + 5], a ld a, $40 ld [wMusicE9 + 2], a -.noChannel3 +.no_channel_3 rr e - jr nc, .noChannel4 + jr nc, .no_channel_4 ld a, [bc] inc bc ld [wMusicChannelPointers + 6], a @@ -374,7 +374,7 @@ Music1_BeginSong: ; f418c (3d:418c) ld [wMusicChannelStackPointers + 7], a ld a, $40 ld [wMusicE9 + 3], a -.noChannel4 +.no_channel_4 xor a ld [wddf2], a ret @@ -690,7 +690,7 @@ Music1_note: ; f448c (3d:448c) add e jr .asm_f44c1 .asm_f44c7 - ld hl, $ddbb + ld hl, wddbb add hl, bc ld [hl], a pop de @@ -935,9 +935,9 @@ Music1_Loop: ; f4609 (3d:4609) inc de push af call Music1_GetChannelStackPointer - ld [hl], e ; + ld [hl], e ; inc hl ; store address of command at beginning of loop - ld [hl], d ; + ld [hl], d ; inc hl pop af ld [hl], a ; store loop count @@ -951,16 +951,16 @@ Music1_EndLoop: ; f461e (3d:461e) dec hl ld a, [hl] ; get remaining loop count dec a - jr z, .loopDone + jr z, .loop_done ld [hld], a ld d, [hl] dec hl ld e, [hl] pop hl - ld h, d ; + ld h, d ; ld l, e ; go to address of beginning of loop jp Music1_PlayNextNote -.loopDone +.loop_done dec hl dec hl call Music1_SetChannelStackPointer @@ -977,9 +977,9 @@ Music1_call: ; f463f (3d:463f) call Music1_GetChannelStackPointer pop de ld a, e - ld [hli], a ; + ld [hli], a ; ld a, d ; store address of command after call - ld [hli], a ; + ld [hli], a ; ld a, [de] ld b, a inc de @@ -995,7 +995,7 @@ Music1_ret: ; f4656 (3d:4656) pop de call Music1_GetChannelStackPointer dec hl - ld a, [hld] ; + ld a, [hld] ; ld e, [hl] ; retrieve address of caller of this sub branch ld d, a inc de @@ -1237,12 +1237,12 @@ Func_f479c: ; f479c (3d:479c) ld d, $0 ld a, [wMusicWaveChange] or a - jr z, .noWaveChange + jr z, .no_wave_change xor a ld [rNR30], a call Music1_LoadWaveInstrument ld d, $80 -.noWaveChange +.no_wave_change ld a, [wddb9] cp $0 jr z, .asm_f47e1 @@ -1287,14 +1287,14 @@ Music1_LoadWaveInstrument: ; f479c (3d:47ea) ld l, a ld b, d ld de, $ff30 -.copyWaveLoop +.copy_wave_loop ld a, [hli] ld [de], a inc de inc b ld a, b cp $10 - jr nz, .copyWaveLoop + jr nz, .copy_wave_loop xor a ld [wMusicWaveChange], a ret @@ -1487,7 +1487,7 @@ Music1_UpdateVibrato: ; f4898 (3d:4898) Func_f490b: ; f490b (3d:490b) cp $0 - jr nz, .notChannel1 + jr nz, .not_channel_1 ld a, [wMusicVibratoDelay] cp $0 jr z, .done @@ -1503,9 +1503,9 @@ Func_f490b: ; f490b (3d:490b) and $3f ld [rNR14], a ret -.notChannel1 +.not_channel_1 cp $1 - jr nz, .notChannel2 + jr nz, .not_channel_2 ld a, [wMusicVibratoDelay + 1] cp $0 jr z, .done @@ -1520,7 +1520,7 @@ Func_f490b: ; f490b (3d:490b) ld a, d ld [rNR24], a ret -.notChannel2 +.not_channel_2 cp $2 jr nz, .done ld a, [wMusicVibratoDelay + 2] diff --git a/src/audio/music1_headers.asm b/src/audio/music1_headers.asm index f5008fe..f5008fe 100755..100644 --- a/src/audio/music1_headers.asm +++ b/src/audio/music1_headers.asm diff --git a/src/audio/music2.asm b/src/audio/music2.asm index ddae2bb..41d58f8 100755..100644 --- a/src/audio/music2.asm +++ b/src/audio/music2.asm @@ -131,7 +131,7 @@ Music2_Init: ; f807d (3e:407d) ld [wMusicDC], a ld de, $0001 ld bc, $0000 -.zeroLoop1 +.zero_loop1 ld hl, wMusicIsPlaying add hl, bc ld [hl], d @@ -150,16 +150,16 @@ Music2_Init: ; f807d (3e:407d) inc c ld a, c cp $4 - jr nz, .zeroLoop1 + jr nz, .zero_loop1 ld hl, Music2_ChannelLoopStacks ld bc, wMusicChannelStackPointers ld d, $8 -.zeroLoop2 +.zero_loop2 ld a, [hli] ld [bc], a inc bc dec d - jr nz, .zeroLoop2 + jr nz, .zero_loop2 ret Music2_Update: ; f80e9 (3e:40e9) @@ -172,15 +172,15 @@ Music2_Update: ; f80e9 (3e:40e9) ld [MBC3RomBank], a ld a, [wddf2] cp $0 - jr z, .updateChannels + jr z, .update_channels call Func_f8980 - jr .skipChannelUpdates -.updateChannels + jr .skip_channel_Updates +.update_channels call Music2_UpdateChannel1 call Music2_UpdateChannel2 call Music2_UpdateChannel3 call Music2_UpdateChannel4 -.skipChannelUpdates +.skip_channel_Updates call Func_f8866 call Music2_CheckForEndOfSong ret @@ -188,24 +188,24 @@ Music2_Update: ; f80e9 (3e:40e9) Music2_CheckForNewSound: ; f811c (3e:411c) ld a, [wCurSongID] rla - jr c, .checkForNewSfx + jr c, .check_for_new_sfx call Music2_StopAllChannels ld a, [wCurSongID] call Music2_BeginSong ld a, [wCurSongID] or $80 ld [wCurSongID], a -.checkForNewSfx +.check_for_new_sfx ld a, [wCurSfxID] rla - jr c, .noNewSound + jr c, .no_new_sound ld a, [wCurSfxID] ld hl, SFX_PlaySFX call Bankswitch3dTo3f ld a, [wCurSfxID] or $80 ld [wCurSfxID], a -.noNewSound +.no_new_sound ret Music2_StopAllChannels: ; f814b (3e:414b) @@ -214,30 +214,30 @@ Music2_StopAllChannels: ; f814b (3e:414b) xor a ld [wMusicIsPlaying], a bit 0, d - jr nz, .stopChannel2 + jr nz, .stop_channel_2 ld a, $8 ld [rNR12], a swap a ld [rNR14], a -.stopChannel2 +.stop_channel_2 xor a ld [wMusicIsPlaying + 1], a bit 1, d - jr nz, .stopChannel4 + jr nz, .stop_channel_4 ld a, $8 ld [rNR22], a swap a ld [rNR24], a -.stopChannel4 +.stop_channel_4 xor a ld [wMusicIsPlaying + 3], a bit 3, d - jr nz, .stopChannel3 + jr nz, .stop_channel_3 ld a, $8 ld [rNR42], a swap a ld [rNR44], a -.stopChannel3 +.stop_channel_3 xor a ld [wMusicIsPlaying + 2], a bit 2, d @@ -273,7 +273,7 @@ Music2_BeginSong: ; f818c (3e:418c) ld b, h ld c, l rr e - jr nc, .noChannel1 + jr nc, .no_channel_1 ld a, [bc] inc bc ld [wMusicChannelPointers], a @@ -297,9 +297,9 @@ Music2_BeginSong: ; f818c (3e:418c) ld [wMusicChannelStackPointers + 1], a ld a, $8 ld [wMusicE9], a -.noChannel1 +.no_channel_1 rr e - jr nc, .noChannel2 + jr nc, .no_channel_2 ld a, [bc] inc bc ld [wMusicChannelPointers + 2], a @@ -323,9 +323,9 @@ Music2_BeginSong: ; f818c (3e:418c) ld [wMusicChannelStackPointers + 3], a ld a, $8 ld [wMusicE9 + 1], a -.noChannel2 +.no_channel_2 rr e - jr nc, .noChannel3 + jr nc, .no_channel_3 ld a, [bc] inc bc ld [wMusicChannelPointers + 4], a @@ -349,9 +349,9 @@ Music2_BeginSong: ; f818c (3e:418c) ld [wMusicChannelStackPointers + 5], a ld a, $40 ld [wMusicE9 + 2], a -.noChannel3 +.no_channel_3 rr e - jr nc, .noChannel4 + jr nc, .no_channel_4 ld a, [bc] inc bc ld [wMusicChannelPointers + 6], a @@ -374,7 +374,7 @@ Music2_BeginSong: ; f818c (3e:418c) ld [wMusicChannelStackPointers + 7], a ld a, $40 ld [wMusicE9 + 3], a -.noChannel4 +.no_channel_4 xor a ld [wddf2], a ret @@ -690,7 +690,7 @@ Music2_note: ; f448c (3d:448c) add e jr .asm_f84c1 .asm_f84c7 - ld hl, $ddbb + ld hl, wddbb add hl, bc ld [hl], a pop de @@ -935,7 +935,7 @@ Music2_Loop: ; f8609 (3e:4609) inc de push af call Music2_GetChannelStackPointer - ld [hl], e ; + ld [hl], e ; inc hl ; store address of command at beginning of loop ld [hl], d ; inc hl @@ -951,16 +951,16 @@ Music2_EndLoop: ; f861e (3e:461e) dec hl ld a, [hl] ; get remaining loop count dec a - jr z, .loopDone + jr z, .loop_done ld [hld], a ld d, [hl] dec hl ld e, [hl] pop hl - ld h, d ; + ld h, d ; ld l, e ; go to address of beginning of loop jp Music2_PlayNextNote -.loopDone +.loop_done dec hl dec hl call Music2_SetChannelStackPointer @@ -977,9 +977,9 @@ Music2_call: ; f863f (3e:463f) call Music2_GetChannelStackPointer pop de ld a, e - ld [hli], a ; + ld [hli], a ; ld a, d ; store address of command after call - ld [hli], a ; + ld [hli], a ; ld a, [de] ld b, a inc de @@ -995,7 +995,7 @@ Music2_ret: ; f8656 (3e:4656) pop de call Music2_GetChannelStackPointer dec hl - ld a, [hld] ; + ld a, [hld] ; ld e, [hl] ; retrieve address of caller of this sub branch ld d, a inc de @@ -1237,12 +1237,12 @@ Func_f879c: ; f879c (3e:479c) ld d, $0 ld a, [wMusicWaveChange] or a - jr z, .noWaveChange + jr z, .no_wave_change xor a ld [rNR30], a call Music2_LoadWaveInstrument ld d, $80 -.noWaveChange +.no_wave_change ld a, [wddb9] cp $0 jr z, .asm_f87e1 @@ -1287,14 +1287,14 @@ Music2_LoadWaveInstrument: ; f879c (3e:47ea) ld l, a ld b, d ld de, $ff30 -.copyWaveLoop +.copy_wave_loop ld a, [hli] ld [de], a inc de inc b ld a, b cp $10 - jr nz, .copyWaveLoop + jr nz, .copy_wave_loop xor a ld [wMusicWaveChange], a ret @@ -1487,7 +1487,7 @@ Func_f8898: ; f8898 (3e:4898) Func_f890b: ; f890b (3e:490b) cp $0 - jr nz, .notChannel1 + jr nz, .not_channel_1 ld a, [wMusicVibratoDelay] cp $0 jr z, .done @@ -1503,9 +1503,9 @@ Func_f890b: ; f890b (3e:490b) and $3f ld [rNR14], a ret -.notChannel1 +.not_channel_1 cp $1 - jr nz, .notChannel2 + jr nz, .not_channel_2 ld a, [wMusicVibratoDelay + 1] cp $0 jr z, .done @@ -1520,7 +1520,7 @@ Func_f890b: ; f890b (3e:490b) ld a, d ld [rNR24], a ret -.notChannel2 +.not_channel_2 cp $2 jr nz, .done ld a, [wMusicVibratoDelay + 2] diff --git a/src/audio/music2_headers.asm b/src/audio/music2_headers.asm index cafaa4f..cafaa4f 100755..100644 --- a/src/audio/music2_headers.asm +++ b/src/audio/music2_headers.asm diff --git a/src/audio/noise_instruments.asm b/src/audio/noise_instruments.asm index 96433ab..96433ab 100755..100644 --- a/src/audio/noise_instruments.asm +++ b/src/audio/noise_instruments.asm diff --git a/src/audio/sfx.asm b/src/audio/sfx.asm index 6b3e2bc..6b3e2bc 100755..100644 --- a/src/audio/sfx.asm +++ b/src/audio/sfx.asm diff --git a/src/audio/sfx_headers.asm b/src/audio/sfx_headers.asm index 6485425..6485425 100755..100644 --- a/src/audio/sfx_headers.asm +++ b/src/audio/sfx_headers.asm diff --git a/src/audio/vibrato_types.asm b/src/audio/vibrato_types.asm index d51546e..6d6b7e1 100755..100644 --- a/src/audio/vibrato_types.asm +++ b/src/audio/vibrato_types.asm @@ -1,44 +1,44 @@ - dw .vibratoType0 - dw .vibratoType1 - dw .vibratoType2 - dw .vibratoType3 - dw .vibratoType4 - dw .vibratoType5 - dw .vibratoType6 - dw .vibratoType7 - dw .vibratoType8 - dw .vibratoType9 - dw .vibratoTypeA - -.vibratoType0 + dw .vibrato_type_0 + dw .vibrato_type_1 + dw .vibrato_type_2 + dw .vibrato_type_3 + dw .vibrato_type_4 + dw .vibrato_type_5 + dw .vibrato_type_6 + dw .vibrato_type_7 + dw .vibrato_type_8 + dw .vibrato_type_9 + dw .vibrato_type_A + +.vibrato_type_0 db $00,$80,$80 -.vibratoType1 +.vibrato_type_1 db $01,$02,$01,$00,$ff,$fe,$ff,$00,$80,$80 -.vibratoType2 +.vibrato_type_2 db $03,$fd,$03,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$01 -.vibratoType3 +.vibrato_type_3 db $01,$01,$00,$00,$ff,$ff,$00,$00,$80,$80 -.vibratoType4 +.vibrato_type_4 db $01,$01,$01,$00,$00,$00,$ff,$ff,$ff,$00,$00,$00,$80,$80 -.vibratoType5 +.vibrato_type_5 db $02,$04,$06,$04,$02,$00,$fe,$fc,$fa,$fc,$fe,$00,$80,$80 -.vibratoType6 +.vibrato_type_6 db $04,$04,$08,$08,$04,$04,$00,$00,$fc,$fc,$f8,$f8,$fc,$fc,$00,$00,$80,$80 -.vibratoType7 +.vibrato_type_7 db $f8,$f8,$f9,$f9,$fa,$fa,$fb,$fb,$fc,$fc,$fd,$fd,$fe,$fe,$ff,$ff,$00,$00,$80,$05 -.vibratoType8 +.vibrato_type_8 db $02,$04,$02,$00,$fe,$fc,$fe,$00,$80,$80 -.vibratoType9 +.vibrato_type_9 db $01,$02,$04,$02,$01,$00,$ff,$fe,$fc,$fe,$ff,$00,$80,$08 -.vibratoTypeA +.vibrato_type_A db $01,$01,$01,$01,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$00,$00,$00,$00,$80,$80 diff --git a/src/audio/wave_instruments.asm b/src/audio/wave_instruments.asm index 98197dc..98197dc 100755..100644 --- a/src/audio/wave_instruments.asm +++ b/src/audio/wave_instruments.asm |
