mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-13 22:30:49 +00:00
keen: have sound working
This commit is contained in:
parent
c766a3bdff
commit
c36dfba91b
@ -89,8 +89,9 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
|
||||
i=14;
|
||||
printf("Dump of %s\n",sound_info[i].name);
|
||||
for(i=0;i<num_sounds;i++) {
|
||||
|
||||
printf("%s:\n",sound_info[i].name);
|
||||
lseek(fd,sound_info[i].offset,SEEK_SET);
|
||||
|
||||
last=0xffff;
|
||||
@ -130,6 +131,9 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (sample==0xffff) break;
|
||||
}
|
||||
printf(".byte 255,255\n");
|
||||
}
|
||||
|
||||
/* close */
|
||||
close(fd);
|
||||
|
||||
|
@ -22,7 +22,7 @@ HELLO: hello.bas
|
||||
TEST_KEEN: test_keen.o
|
||||
ld65 -o TEST_KEEN test_keen.o -C $(LINKER_SCRIPTS)apple2_c00.inc
|
||||
|
||||
test_keen.o: test_keen.s lvldone.inc redbook_sound.s
|
||||
test_keen.o: test_keen.s longer_sound.s ck1_sounds.inc
|
||||
ca65 -o test_keen.o test_keen.s -l test_keen.lst
|
||||
|
||||
|
||||
|
48
music/redbook_sound/longer_sound.s
Normal file
48
music/redbook_sound/longer_sound.s
Normal file
@ -0,0 +1,48 @@
|
||||
; Based on redbook_sound.s
|
||||
|
||||
; it's originally by Paul Lutus, from the Apple II Red Book p45
|
||||
; which can only do roughly 194Hz to 2000Hz+
|
||||
|
||||
; this makes things twice as long, which allows lower notes, but
|
||||
; loses some precision on high notes
|
||||
|
||||
; also modified so "0" means no sound
|
||||
|
||||
|
||||
;=====================================================
|
||||
; speaker tone
|
||||
;=====================================================
|
||||
; A,X,Y trashed
|
||||
; duration also trashed
|
||||
|
||||
; more exactly, it is (4+10F)+(13+10F) = 20F+17
|
||||
|
||||
speaker_tone:
|
||||
ldy #0 ; 3
|
||||
speaker_tone_loop:
|
||||
lda $C030 ; click speaker ; 4
|
||||
speaker_loop:
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
|
||||
dey ; ; 2
|
||||
bne freq_loop ; ; 2/3
|
||||
dec speaker_duration ; (Duration) ; 6
|
||||
beq done_tone ; 2/3
|
||||
freq_loop:
|
||||
dex ; 2
|
||||
bne speaker_loop ; 2/3
|
||||
ldx speaker_frequency ; (Frequency) ; 4
|
||||
beq speaker_loop ; play nothing if 0 ; 2/3
|
||||
jmp speaker_tone_loop ; 3
|
||||
done_tone:
|
||||
rts
|
||||
|
||||
speaker_duration:
|
||||
.byte $00
|
||||
speaker_frequency:
|
||||
.byte $00
|
||||
|
@ -27,14 +27,15 @@ play_loop:
|
||||
ldy SOUND_OFFSET
|
||||
lda (INL),Y
|
||||
sta speaker_frequency
|
||||
|
||||
iny
|
||||
lda (INL),Y
|
||||
cmp #$FF
|
||||
beq play_done
|
||||
|
||||
asl
|
||||
clc
|
||||
adc LVLDONESND,Y
|
||||
; clc
|
||||
; adc (INL),Y
|
||||
|
||||
sta speaker_duration
|
||||
iny
|
||||
@ -61,32 +62,32 @@ play_done:
|
||||
|
||||
|
||||
|
||||
.include "redbook_sound.s"
|
||||
.include "longer_sound.s"
|
||||
.include "ck1_sounds.inc"
|
||||
|
||||
|
||||
sounds_low:
|
||||
.byte <WLDWALKSND,<WLDBLOCKSND<WLDENTERSND,<KEENWALKSND
|
||||
.byte <WLDWALKSND, <WLDBLOCKSND,<WLDENTERSND,<KEENWALKSND
|
||||
.byte <KEENBLOKSND,<KEENJUMPSND,<KEENLANDSND,<KEENDIESND
|
||||
.byte <GOTBONUSSND,<GOTITEMSND,<GOTPARTSND,<KEENFIRESND
|
||||
.byte <KEENPOGOSND,<POGOJUMPSND,<LVLDONESND,<GAMEOVERSND
|
||||
.byte <HISCORESND,<TELEPORTSND,<CHUNKSMASH,<GOINDOORSND
|
||||
.byte <BUMPHEADSND,<USEKEYSND,<CANNONFIRE,<SLAMSND
|
||||
.byte <CLICKSND,<CRYSTALSND,<PLUMMETSND,<EXTRAMANSND
|
||||
.byte <YORPBUMPSND,<KEENWLK2SND,<YORPBOPSND,<GETCARDSND
|
||||
.byte <DOOROPENSND,<YORPSCREAM,<GARGSCREAM,<GUNCLICK
|
||||
.byte <SHOTHIT,<TANKFIRE,<vortscream,<keencicle
|
||||
.byte <keensleft,<EARTHPOW,$FF
|
||||
.byte <GOTBONUSSND,<GOTITEMSND, <GOTPARTSND, <KEENFIRESND
|
||||
.byte <KEENPOGOSND,<POGOJUMPSND,<LVLDONESND, <GAMEOVERSND
|
||||
.byte <HISCORESND, <TELEPORTSND,<CHUNKSMASH, <GOINDOORSND
|
||||
.byte <BUMPHEADSND,<USEKEYSND, <CANNONFIRE, <SLAMSND
|
||||
.byte <CLICKSND, <CRYSTALSND, <PLUMMETSND, <EXTRAMANSND
|
||||
.byte <YORPBUMPSND,<KEENWLK2SND,<YORPBOPSND, <GETCARDSND
|
||||
.byte <DOOROPENSND,<YORPSCREAM, <GARGSCREAM, <GUNCLICK
|
||||
.byte <SHOTHIT, <TANKFIRE, <vortscream, <keencicle
|
||||
.byte <keensleft, <EARTHPOW, $FF
|
||||
|
||||
sounds_high:
|
||||
.byte >WLDWALKSND,>WLDBLOCKSND>WLDENTERSND,>KEENWALKSND
|
||||
.byte >WLDWALKSND, >WLDBLOCKSND,>WLDENTERSND,>KEENWALKSND
|
||||
.byte >KEENBLOKSND,>KEENJUMPSND,>KEENLANDSND,>KEENDIESND
|
||||
.byte >GOTBONUSSND,>GOTITEMSND,>GOTPARTSND,>KEENFIRESND
|
||||
.byte >KEENPOGOSND,>POGOJUMPSND,>LVLDONESND,>GAMEOVERSND
|
||||
.byte >HISCORESND,>TELEPORTSND,>CHUNKSMASH,>GOINDOORSND
|
||||
.byte >BUMPHEADSND,>USEKEYSND,>CANNONFIRE,>SLAMSND
|
||||
.byte >CLICKSND,>CRYSTALSND,>PLUMMETSND,>EXTRAMANSND
|
||||
.byte >YORPBUMPSND,>KEENWLK2SND,>YORPBOPSND,>GETCARDSND
|
||||
.byte >DOOROPENSND,>YORPSCREAM,>GARGSCREAM,>GUNCLICK
|
||||
.byte >SHOTHIT,>TANKFIRE,>vortscream,>keencicle
|
||||
.byte >keensleft,>EARTHPOW,$FF
|
||||
.byte >GOTBONUSSND,>GOTITEMSND, >GOTPARTSND, >KEENFIRESND
|
||||
.byte >KEENPOGOSND,>POGOJUMPSND,>LVLDONESND, >GAMEOVERSND
|
||||
.byte >HISCORESND, >TELEPORTSND,>CHUNKSMASH, >GOINDOORSND
|
||||
.byte >BUMPHEADSND,>USEKEYSND, >CANNONFIRE, >SLAMSND
|
||||
.byte >CLICKSND, >CRYSTALSND, >PLUMMETSND, >EXTRAMANSND
|
||||
.byte >YORPBUMPSND,>KEENWLK2SND,>YORPBOPSND, >GETCARDSND
|
||||
.byte >DOOROPENSND,>YORPSCREAM, >GARGSCREAM, >GUNCLICK
|
||||
.byte >SHOTHIT, >TANKFIRE, >vortscream, >keencicle
|
||||
.byte >keensleft, >EARTHPOW, $FF
|
||||
|
Loading…
x
Reference in New Issue
Block a user