lemm: add simple click sound effects

also enable keyboard shortcut for jobs for some reason
This commit is contained in:
Vince Weaver
2022-03-20 22:24:24 -04:00
parent 1815e74976
commit 56c0d10635
5 changed files with 96 additions and 13 deletions

View File

@@ -1,12 +1,11 @@
+ more than 1 lemming
+ move common code for lemming release to separate function,
update all 5 levels
+ click sound effect? select job, click on lemming,
lemming explode, lemming exit
+ wait a second after last lemming gone to exit
+ update the "in" %
+ dig off the map, end level
+ fill in some of the ground so we don't get stuck when digging
+ Update credits?
+ "Out" counter is only printed to page1 so gets erased by cursor
+ Falling too far and you go splat
+ See if the jerky animation is due to starting at an odd x vs

View File

@@ -349,7 +349,7 @@ draw_explosion:
ldy #3
lda lemming_y
clc
adc #10
adc #11
jsr hgr_hlin
; line from (x,a) to (x+y,a)
@@ -357,11 +357,13 @@ draw_explosion:
ldy #1
lda lemming_y
clc
adc #11
adc #12
jsr hgr_hlin
jsr hgr_hlin_page_toggle ; toggle to page1
jsr hgr_hlin_page_toggle ; toggle back to page1
jsr click_speaker
ldy #0
lda #<explosion_sprite

View File

@@ -72,16 +72,28 @@ actually_handle_keypress:
keypress:
and #$7f ; clear high bit
cmp #' '
beq handle_input ; make sure not to lose space
cmp #$40
bcc handle_input ; make sure not to lose space
; and numbers
and #$df ; convert uppercase to lower case
handle_input:
; pha
; jsr restore_bg_14x14 ; restore old background
; pla
; first check if 1...8 pressed
cmp #'1'
bcc check_sound
cmp #'9'
bcs check_sound
sec ; map 1->3, 2->4, 4->5, etc
sbc #'1'
clc
adc #3
jsr handle_menu_which_in_a
jmp done_keypress
check_sound:
cmp #$14 ; control-T
@@ -94,7 +106,6 @@ check_sound:
; can't be ^J as that's the same as down
check_joystick:
; cmp #$10 ; control-P
cmp #'J'
bne check_left
@@ -212,7 +223,10 @@ return_check_lemming:
cmp #8
bne done_keypress
; for now assume we've got diggingselected
; for now assume we've got digging selected
jsr click_speaker
lda #LEMMING_DIGGING
sta lemming_status
@@ -248,6 +262,8 @@ handle_menu:
lsr
lsr ; each box is 16 wide
handle_menu_which_in_a:
cmp #3
bcc plus_minus_buttons
cmp #11
@@ -260,6 +276,12 @@ handle_menu:
job_button:
pha
jsr click_speaker
pla
pha
; erase old
jsr erase_menu

View File

@@ -324,6 +324,7 @@ level_lost:
.include "particle_hgr.s"
.include "load_music.s"
.include "simple_sounds.s"
; moved to qload.s

View File

@@ -0,0 +1,59 @@
;============================
; click the speaker
;============================
; FIXME: make it last longer?
click_speaker:
lda SOUND_STATUS
bmi done_click
bit $c030
done_click:
rts
long_beep:
ldy #235
bne do_beep
short_beep:
ldy #40
bne do_beep
;===========================
; BEEP (inlined)
;===========================
do_beep:
lda SOUND_STATUS
bmi done_beep
sty tone_smc+1
; BEEP
; repeat 30 times
lda #30 ; 2
tone1_loop:
tone_smc:
ldy #24 ; 2
loopC: ldx #6 ; 2
loopD: dex ; 1
bne loopD ; 2
dey ; 1
bne loopC ; 2
bit SPEAKER ; 3 ; click speaker
sec ; 1
sbc #1 ; 2
bne tone1_loop ; 2
; Try X=6 Y=21 cycles=757
; Try X=6 Y=24 cycles=865
; Try X=7 Y=235 cycles=9636
done_beep:
rts