Merge pull request #41 from yenatch/master

bank 3a and /music
This commit is contained in:
Bryan Bishop 2012-11-03 00:59:08 -07:00
commit 0cce53bea3
19 changed files with 3397 additions and 150 deletions

View File

@ -9,6 +9,10 @@ dn: MACRO
db \1 << 4 + \2
ENDM
bigdw: MACRO
dw ((\1)/$100) + (((\1)&$ff)*$100)
ENDM
callab: MACRO
ld hl, \1
ld a, BANK(\1)
@ -3115,3 +3119,230 @@ MUSIC_BATTLE_TOWER_THEME EQU 99
MUSIC_SUICUNE_BATTLE EQU 100
MUSIC_BATTLE_TOWER_LOBBY EQU 101
MUSIC_MOBILE_CENTER EQU 102
; sound
_4CH1 EQU $c0
_3CH1 EQU $80
_2CH1 EQU $40
_1CH1 EQU $00
_3CH2 EQU $81
_2CH2 EQU $41
_1CH2 EQU $01
_2CH3 EQU $42
_1CH3 EQU $02
_1CH4 EQU $03
_4CH5 EQU $c4
_3CH5 EQU $84
_2CH5 EQU $44
_1CH5 EQU $04
_3CH6 EQU $85
_2CH6 EQU $45
_1CH6 EQU $05
_2CH7 EQU $46
_1CH7 EQU $06
_1CH8 EQU $07
_CH2 EQU $01
_CH3 EQU $02
_CH4 EQU $03
_CH5 EQU $04
_CH6 EQU $05
_CH7 EQU $06
_CH8 EQU $07
note: MACRO
db \1
ENDM
; eventually replace with this:
; note: MACRO
; db NOTE_\1 + NOTE_\2
; ENDM
NOTE_RST EQU $00
NOTE_C EQU $10
NOTE_C# EQU $20
NOTE_D EQU $30
NOTE_D# EQU $40
NOTE_E EQU $50
NOTE_F EQU $60
NOTE_F# EQU $70
NOTE_G EQU $80
NOTE_G# EQU $90
NOTE_A EQU $a0
NOTE_A# EQU $b0
NOTE_B EQU $c0
; 16ths
NOTE_1 EQU $00
NOTE_2 EQU $01
NOTE_3 EQU $02
NOTE_4 EQU $03
NOTE_5 EQU $04
NOTE_6 EQU $05
NOTE_7 EQU $06
NOTE_8 EQU $07
NOTE_9 EQU $08
NOTE_10 EQU $09
NOTE_11 EQU $0a
NOTE_12 EQU $0b
NOTE_13 EQU $0c
NOTE_14 EQU $0d
NOTE_15 EQU $0e
NOTE_16 EQU $0f
octave: MACRO
; $d0-$d7
db $d8 - \1
ENDM
notetype: MACRO
db $d8
db \1
ENDM
forceoctave: MACRO
db $d9
db \1
ENDM
tempo: MACRO
db $da
bigdw \1
ENDM
dutycycle: MACRO
db $db
db \1
ENDM
intensity: MACRO
db $dc
db \1
ENDM
soundinput: MACRO
db $dd
db \1
ENDM
unknownmusic0xde: MACRO
db $de
db \1
ENDM
unknownmusic0xdf: MACRO
db $df
ENDM
unknownmusic0xe0: MACRO
db $e0
db \1
db \2
db \3
ENDM
vibrato: MACRO
db $e1
db \1
db \2
ENDM
unknownmusic0xe2: MACRO
db $e2
db \1
ENDM
togglenoise: MACRO
db $e3
ENDM
panning: MACRO
db $e4
db \1
ENDM
volume: MACRO
db $e5
db \1
ENDM
tone: MACRO
db $e6
bigdw \1
ENDM
unknownmusic0xe7: MACRO
db $e7
db \1
ENDM
unknownmusic0xe8: MACRO
db $e8
db \1
ENDM
globaltempo : MACRO
db $e9
bigdw \1
ENDM
restartchannel: MACRO
db $ea
bigdw \1
ENDM
newsong: MACRO
db $eb
dw \1
ENDM
sfxpriorityon: MACRO
db $ec
ENDM
sfxpriorityoff: MACRO
db $ed
ENDM
unknownmusic0xee: MACRO
db $ee
dw \1
ENDM
stereopanning: MACRO
db $ef
db \1
ENDM
sfxtogglenoise: MACRO
db $f0
db \1
ENDM
music0xf1: MACRO
db $f1
ENDM
music0xf2: MACRO
db $f2
ENDM
music0xf3: MACRO
db $f3
ENDM
music0xf4: MACRO
db $f4
ENDM
music0xf5: MACRO
db $f5
ENDM
music0xf6: MACRO
db $f6
ENDM
music0xf7: MACRO
db $f7
ENDM
music0xf8: MACRO
db $f8
ENDM
unknownmusic0xf9: MACRO
db $f9
ENDM
setcondition: MACRO
db $fa
db \1
ENDM
jumpif: MACRO
db $fb
db \1
dw \2
ENDM
jumpchannel: MACRO
db $fc
dw \1
ENDM
loopchannel: MACRO
db $fd
db \1
dw \2
ENDM
callchannel: MACRO
db $fe
dw \1
ENDM
endchannel: MACRO
db $ff
ENDM

3026
main.asm

File diff suppressed because it is too large Load Diff

1
music/championbattle.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ea9c1,$ead99 - $ea9c1

1
music/darkcave.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ea2be,$ea50d - $ea2be

1
music/elmslab.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ea040,$ea2be - $ea040

1
music/goldenrodcity.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$eb453,$eb676 - $eb453

View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ea50d,$ea9c1 - $ea50d

1
music/lookpokemaniac.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ebde1,$ebeab - $ebde1

1
music/newbarktown.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$eb2d3,$eb453 - $eb2d3

17
music/nothing.asm Normal file
View File

@ -0,0 +1,17 @@
; 0xe91a3
db $c0
dw Music_Nothing_Ch1
db $01
dw Music_Nothing_Ch2
db $02
dw Music_Nothing_Ch3
db $03
dw Music_Nothing_Ch4
; 0xe91af
Music_Nothing_Ch1: ; 0xe91af
Music_Nothing_Ch2: ; 0xe91af
Music_Nothing_Ch3: ; 0xe91af
Music_Nothing_Ch4: ; 0xe91af
endchannel ; end
; 0xe91b0

1
music/rivalbattle.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$e974f,$e9b6f - $e974f

1
music/rocketbattle.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$e9b6f,$ea040 - $e9b6f

1
music/route36.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$e94e9,$e974f - $e94e9

View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ebd9e,$ebde1 - $ebd9e

1
music/ssaqua.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ead99,$eb2d3 - $ead99

1
music/titlescreen.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$eb808,$ebd9e - $eb808

1
music/trainervictory.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$ebeab,$ebfc3 - $ebeab

1
music/vermilioncity.asm Normal file
View File

@ -0,0 +1 @@
INCBIN "baserom.gbc",$eb676,$eb808 - $eb676

258
wram.asm
View File

@ -1,17 +1,7 @@
SECTION "audio",BSS[$c101]
; channel structure:
; $00: music id lo
; $01: music id hi
;
; $03: channel flags? bit 0 = on/off
;
; $06: address of music data
;
; $19: note length lo
; $1a: note length hi
; $1b: lr tracks (bit corresponds to track #)
;
; $2d: tempo
SECTION "audio",BSS[$c100]
MusicPlaying: ; c100
; nonzero if playing
ds 1
Channels:
Channel1:
@ -19,21 +9,157 @@ Channel1MusicID: ; c101
ds 2
Channel1MusicBank: ; c103
ds 1
; $03 = channel flags?
Channel1Flags: ; c104
; 0: on/off
; 1: subroutine
; 2:
; 3:
; 4: noise sampling on/off
; 5:
; 6:
; 7:
ds 1
Channel1Flags2: ; c105
; 0: vibrato on/off
; 1:
; 2: duty cycle on/off
; 3:
; 4:
; 5:
; 6:
; 7:
ds 1
Channel1Flags3: ; c106
; 0: vibrato up/down
; 1:
; 2:
; 3:
; 4:
; 5:
; 6:
; 7:
ds 1
; note/octave????
ds 2
Channel1MusicAddress: ; c107
ds 2
ds 17
Channel1NoteLength: ; c11a
Channel1LastMusicAddress: ; c109
ds 2
Channel1LR: ; c11c
; could have been meant as a third-level address
; unused? ; c10b
ds 1
ds 17
Channel1Tempo: ; c12e
; unused? ; c10c
ds 1
ds 4
Channel1NoteFlags: ; c10d
; 0:
; 1:
; 2:
; 3:
; 4:
; 5: rest
; 6:
; 7:
ds 1
Channel1Condition: ; c10e
; used for conditional jumps
ds 1
Channel1DutyCycle: ; c10f
; uses top 2 bits only
; 0: 12.5%
; 1: 25%
; 2: 50%
; 3: 75%
ds 1
Channel1Intensity: ; c110
; hi: pressure
; lo: velocity
ds 1
Channel1Frequency:
; 11 bits
Channel1FrequencyLo: ; c111
ds 1
Channel1FrequencyHi: ; c112
ds 1
Channel1Pitch: ; c113
; 0: rest
; 1: C
; 2: C#
; 3: D
; 4: D#
; 5: E
; 6: F
; 7: F#
; 8: G
; 9: G#
; a: A
; b: A#
; c: B
ds 1
Channel1Octave: ; c114
; 0: highest
; 7: lowest
ds 1
Channel1StartingOctave ; c115
; raises existing octaves by this value
; used for repeating phrases in a higher octave to save space
ds 1
Channel1NoteDuration: ; c116
; number of frames remaining in the current note
ds 1
; c117
ds 1
; c118
ds 1
Channel1LoopCount ; c119
ds 1
Channel1Tempo: ; c11a
ds 2
Channel1Tracks: ; c11c
; hi: l
; lo: r
ds 1
; c11d
ds 1
Channel1VibratoDelayCount: ; c11e
; initialized at the value in VibratoDelay
; decrements each frame
; at 0, vibrato starts
ds 1
Channel1VibratoDelay: ; c11f
; number of frames a note plays until vibrato starts
ds 1
Channel1VibratoExtent: ; c120
; difference in
ds 1
Channel1VibratoRate: ; c121
; counts down from a max of 15 frames
; over which the pitch is alternated
; hi: init frames
; lo: frame count
ds 1
; c122
ds 1
; c123
ds 1
; c124
ds 1
; c125
ds 1
; c126
ds 1
ds 7
Channel1NoteLength: ; c12e
; # frames per 16th note
ds 1
; c12f
ds 1
; c130
ds 1
; c131
ds 1
; c132
ds 1
; end
Channel2: ; c133
ds 50
@ -52,13 +178,25 @@ Channel7: ; c22d
Channel8: ; c25f
ds 50
ds 7
MusicHeaderBuffer: ; c298
; c291
ds 1
CurMusicChannel: ; c299
; c292
ds 1
; c293
ds 1
; c294
ds 1
; c295
ds 1
; c296
ds 1
; c297
ds 1
CurMusicByte: ; c298
ds 1
CurChannel: ; c299
ds 1
Volume: ; c29a
; corresponds to $ff24
; Channel control / ON-OFF / Volume (R/W)
@ -67,27 +205,69 @@ Volume: ; c29a
; bit 3 - Vin->SO1 ON/OFF
; bit 2-0 - SO1 output level (volume) (# 0-7)
ds 1
SoundOutput: ; c29b
; corresponds to $ff25
; bit 4-7: ch1-4 so2 on/off
; bit 0-3: ch1-4 so1 on/off
ds 1
SoundInput: ; c29c
; corresponds to $ff26
; bit 7: global on/off
; bit 0: ch1 on/off
; bit 1: ch2 on/off
; bit 2: ch3 on/off
; bit 3: ch4 on/off
ds 1
ds 2
MusicID:
MusicIDLo: ; c29d
ds 1
MusicIDHi: ; c29e
ds 1
MusicBank: ; c29f
ds 1
ds 7
MusicLength: ; c2a7
; fades out when counter hits this value
; $00 = infinite
NoiseSampleAddress:
NoiseSampleAddressLo: ; c2a0
ds 1
NoiseSampleAddressHi: ; c2a1
ds 1
; noise delay? ; c2a2
ds 1
; c2a3
ds 1
MusicNoiseSampleSet: ; c2a4
ds 1
SFXNoiseSampleSet: ; c2a5
ds 1
; c2a6
ds 1
MusicFade: ; c2a7
; fades volume over x frames
; bit 7: fade in/out
; bit 0-5: number of frames for each volume level
; $00 = none (default)
ds 1
MusicFadeCount: ; c2a8
ds 1
MusicFadeID:
MusicFadeIDLo: ; c2a9
ds 1
MusicFadeIDHi: ; c2aa
ds 1
ds 9
LastVolume: ; c2b4
; preserves volume of a song playing so cries can have their own volume
ds 1
ds 1
SFXPriority: ; c2b6
; if nonzero, turn off music when playing sfx
ds 1
ds 6
CryTracks ; c2bd
; plays only in left or right track depending on what side the monster is on
; both tracks active outside of battle
ds 1
ds 1
ds 23
CurSFX: ; c2bf
; id of sfx currently playing
ds 1