mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-16 18:30:50 +12:00

Changing the following macro names: unknownsfx0x20 to SquareSound - This command, when used in an .asm file that defines an audio piece, generates a square tone modulated by 4 values. unknownnoise0x20 to NoiseSound - This command is similar to SquareSound, but it uses 3 values instead of 4 and generates noise instead of a square tone. unknownsfx0x10 to eSquarePitchEnvelope - This command is not an unknown sound effect, but a modifier for the above two commands which it precedes; it takes one decimal value which is translated into a hexadecimal value when used by the system, and depending on the second digit of this hex value the sounds generated by SquareSound and NoiseSound will have their frequency slide either up (1-7) or down (9-F) or not at all (0,8). E.g. typing 23 will have the system read $17, which will modulate the frequency to slide up because the second digit is 7.
278 lines
2.7 KiB
NASM
Executable file
278 lines
2.7 KiB
NASM
Executable file
|
|
StopAllMusic: MACRO
|
|
ld a, $ff
|
|
call PlaySound
|
|
ENDM
|
|
|
|
Ch0 EQU 0
|
|
Ch1 EQU 1
|
|
Ch2 EQU 2
|
|
Ch3 EQU 3
|
|
Ch4 EQU 4
|
|
Ch5 EQU 5
|
|
Ch6 EQU 6
|
|
Ch7 EQU 7
|
|
|
|
audio: MACRO
|
|
db (_NARG - 2) << 6 | \2
|
|
dw \1_\2
|
|
IF _NARG > 2
|
|
db \3
|
|
dw \1_\3
|
|
ENDC
|
|
IF _NARG > 3
|
|
db \4
|
|
dw \1_\4
|
|
ENDC
|
|
IF _NARG > 4
|
|
db \5
|
|
dw \1_\5
|
|
ENDC
|
|
ENDM
|
|
|
|
eSquarePitchEnvelope: MACRO
|
|
db $10
|
|
db \1
|
|
ENDM
|
|
|
|
SquareSound: MACRO
|
|
db $20 | \1
|
|
db \2
|
|
db \3
|
|
db \4
|
|
ENDM
|
|
|
|
NoiseSound: MACRO
|
|
db $20 | \1
|
|
db \2
|
|
db \3
|
|
ENDM
|
|
|
|
;format: pitch length (in 16ths)
|
|
C_: MACRO
|
|
db $00 | (\1 - 1)
|
|
ENDM
|
|
|
|
C#: MACRO
|
|
db $10 | (\1 - 1)
|
|
ENDM
|
|
|
|
D_: MACRO
|
|
db $20 | (\1 - 1)
|
|
ENDM
|
|
|
|
D#: MACRO
|
|
db $30 | (\1 - 1)
|
|
ENDM
|
|
|
|
E_: MACRO
|
|
db $40 | (\1 - 1)
|
|
ENDM
|
|
|
|
F_: MACRO
|
|
db $50 | (\1 - 1)
|
|
ENDM
|
|
|
|
F#: MACRO
|
|
db $60 | (\1 - 1)
|
|
ENDM
|
|
|
|
G_: MACRO
|
|
db $70 | (\1 - 1)
|
|
ENDM
|
|
|
|
G#: MACRO
|
|
db $80 | (\1 - 1)
|
|
ENDM
|
|
|
|
A_: MACRO
|
|
db $90 | (\1 - 1)
|
|
ENDM
|
|
|
|
A#: MACRO
|
|
db $A0 | (\1 - 1)
|
|
ENDM
|
|
|
|
B_: MACRO
|
|
db $B0 | (\1 - 1)
|
|
ENDM
|
|
|
|
;format: instrument length (in 16ths)
|
|
snare1: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $01
|
|
ENDM
|
|
|
|
snare2: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $02
|
|
ENDM
|
|
|
|
snare3: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $03
|
|
ENDM
|
|
|
|
snare4: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $04
|
|
ENDM
|
|
|
|
snare5: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $05
|
|
ENDM
|
|
|
|
triangle1: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $06
|
|
ENDM
|
|
|
|
triangle2: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $07
|
|
ENDM
|
|
|
|
snare6: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $08
|
|
ENDM
|
|
|
|
snare7: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $09
|
|
ENDM
|
|
|
|
snare8: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $0A
|
|
ENDM
|
|
|
|
snare9: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $0B
|
|
ENDM
|
|
|
|
cymbal1: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $0C
|
|
ENDM
|
|
|
|
cymbal2: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $0D
|
|
ENDM
|
|
|
|
cymbal3: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $0E
|
|
ENDM
|
|
|
|
mutedsnare1: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $0F
|
|
ENDM
|
|
|
|
triangle3: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $10
|
|
ENDM
|
|
|
|
mutedsnare2: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $11
|
|
ENDM
|
|
|
|
mutedsnare3: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $12
|
|
ENDM
|
|
|
|
mutedsnare4: MACRO
|
|
db $B0 | (\1 - 1)
|
|
db $13
|
|
ENDM
|
|
|
|
;format: rest length (in 16ths)
|
|
rest: MACRO
|
|
db $C0 | (\1 - 1)
|
|
ENDM
|
|
|
|
; format: notetype speed, volume, fade
|
|
notetype: MACRO
|
|
db $D0 | \1
|
|
db (\2 << 4) | \3
|
|
ENDM
|
|
|
|
dspeed: MACRO
|
|
db $D0 | \1
|
|
ENDM
|
|
|
|
octave: MACRO
|
|
db $E8 - \1
|
|
ENDM
|
|
|
|
toggleperfectpitch: MACRO
|
|
db $E8
|
|
ENDM
|
|
|
|
;format: vibrato delay, rate, depth
|
|
vibrato: MACRO
|
|
db $EA
|
|
db \1
|
|
db (\2 << 4) | \3
|
|
ENDM
|
|
|
|
pitchbend: MACRO
|
|
db $EB
|
|
db \1
|
|
db \2
|
|
ENDM
|
|
|
|
duty: MACRO
|
|
db $EC
|
|
db \1
|
|
ENDM
|
|
|
|
tempo: MACRO
|
|
db $ED
|
|
db \1 / $100
|
|
db \1 % $100
|
|
ENDM
|
|
|
|
stereopanning: MACRO
|
|
db $EE
|
|
db \1
|
|
ENDM
|
|
|
|
volume: MACRO
|
|
db $F0
|
|
db (\1 << 4) | \2
|
|
ENDM
|
|
|
|
executemusic: MACRO
|
|
db $F8
|
|
ENDM
|
|
|
|
dutycycle: MACRO
|
|
db $FC
|
|
db \1
|
|
ENDM
|
|
|
|
;format: callchannel address
|
|
callchannel: MACRO
|
|
db $FD
|
|
dw \1
|
|
ENDM
|
|
|
|
;format: loopchannel count, address
|
|
loopchannel: MACRO
|
|
db $FE
|
|
db \1
|
|
dw \2
|
|
ENDM
|
|
|
|
endchannel: MACRO
|
|
db $FF
|
|
ENDM
|