mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-24 12:29:29 +00:00
duke: add help screen
This commit is contained in:
parent
19e128a4a6
commit
fd99d63dbf
|
@ -26,6 +26,7 @@ DUKE: duke.o
|
||||||
ld65 -o DUKE duke.o -C ../linker_scripts/apple2_2000.inc
|
ld65 -o DUKE duke.o -C ../linker_scripts/apple2_2000.inc
|
||||||
|
|
||||||
duke.o: duke.s zp.inc hardware.inc duke.s \
|
duke.o: duke.s zp.inc hardware.inc duke.s \
|
||||||
|
print_help.s \
|
||||||
graphics/duke_graphics.inc \
|
graphics/duke_graphics.inc \
|
||||||
maps/level1_map.lzsa \
|
maps/level1_map.lzsa \
|
||||||
status_bar.s draw_duke.s gr_putsprite_crop.s \
|
status_bar.s draw_duke.s gr_putsprite_crop.s \
|
||||||
|
|
|
@ -6,6 +6,8 @@ move_duke:
|
||||||
|
|
||||||
jsr check_falling
|
jsr check_falling
|
||||||
|
|
||||||
|
jsr handle_jumping
|
||||||
|
|
||||||
lda DUKE_WALKING
|
lda DUKE_WALKING
|
||||||
beq done_move_duke
|
beq done_move_duke
|
||||||
|
|
||||||
|
@ -63,11 +65,30 @@ duke_collide:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
;=========================
|
||||||
|
; check_jumping
|
||||||
|
;=========================
|
||||||
|
handle_jumping:
|
||||||
|
|
||||||
|
lda DUKE_JUMPING
|
||||||
|
beq done_handle_jumping
|
||||||
|
|
||||||
|
dec DUKE_Y
|
||||||
|
dec DUKE_Y
|
||||||
|
dec DUKE_JUMPING
|
||||||
|
|
||||||
|
done_handle_jumping:
|
||||||
|
rts
|
||||||
|
|
||||||
;=========================
|
;=========================
|
||||||
; check_falling
|
; check_falling
|
||||||
;=========================
|
;=========================
|
||||||
check_falling:
|
check_falling:
|
||||||
|
|
||||||
|
lda DUKE_JUMPING
|
||||||
|
bne done_check_falling
|
||||||
|
|
||||||
; check below feet
|
; check below feet
|
||||||
|
|
||||||
; block index below feet is (y+10)*16/4 + (x/2) + 1
|
; block index below feet is (y+10)*16/4 + (x/2) + 1
|
||||||
|
@ -100,7 +121,7 @@ check_falling:
|
||||||
jsr copy_tilemap_subset
|
jsr copy_tilemap_subset
|
||||||
|
|
||||||
done_check_below:
|
done_check_below:
|
||||||
|
done_check_falling:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -159,6 +159,7 @@ done_with_duke:
|
||||||
.include "status_bar.s"
|
.include "status_bar.s"
|
||||||
.include "keyboard.s"
|
.include "keyboard.s"
|
||||||
.include "joystick.s"
|
.include "joystick.s"
|
||||||
|
.include "print_help.s"
|
||||||
|
|
||||||
.include "draw_duke.s"
|
.include "draw_duke.s"
|
||||||
.include "handle_laser.s"
|
.include "handle_laser.s"
|
||||||
|
|
|
@ -78,13 +78,20 @@ keypress:
|
||||||
|
|
||||||
check_sound:
|
check_sound:
|
||||||
cmp #$14 ; control-T
|
cmp #$14 ; control-T
|
||||||
bne check_joystick
|
bne check_help
|
||||||
|
|
||||||
lda SOUND_STATUS
|
lda SOUND_STATUS
|
||||||
eor #SOUND_DISABLED
|
eor #SOUND_DISABLED
|
||||||
sta SOUND_STATUS
|
sta SOUND_STATUS
|
||||||
jmp done_keypress
|
jmp done_keypress
|
||||||
|
|
||||||
|
check_help:
|
||||||
|
cmp #'H' ; H (^H is same as left)
|
||||||
|
bne check_joystick
|
||||||
|
|
||||||
|
jsr print_help
|
||||||
|
jmp done_keypress
|
||||||
|
|
||||||
; can't be ^J as that's the same as down
|
; can't be ^J as that's the same as down
|
||||||
check_joystick:
|
check_joystick:
|
||||||
cmp #'J' ; J
|
cmp #'J' ; J
|
||||||
|
@ -163,7 +170,7 @@ check_down:
|
||||||
cmp #'S'
|
cmp #'S'
|
||||||
beq down_pressed
|
beq down_pressed
|
||||||
cmp #$0A
|
cmp #$0A
|
||||||
bne check_return
|
bne check_space
|
||||||
down_pressed:
|
down_pressed:
|
||||||
lda CURSOR_Y ; if 48<y<$EE don't decrement
|
lda CURSOR_Y ; if 48<y<$EE don't decrement
|
||||||
cmp #48
|
cmp #48
|
||||||
|
@ -182,6 +189,11 @@ check_space:
|
||||||
space_pressed:
|
space_pressed:
|
||||||
|
|
||||||
; jump
|
; jump
|
||||||
|
lda DUKE_JUMPING
|
||||||
|
bne done_keypress ; don't jump if already jumping
|
||||||
|
|
||||||
|
lda #5
|
||||||
|
sta DUKE_JUMPING
|
||||||
|
|
||||||
jmp done_keypress
|
jmp done_keypress
|
||||||
|
|
||||||
|
|
32
duke/print_help.s
Normal file
32
duke/print_help.s
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
; For Help press ^H
|
||||||
|
|
||||||
|
print_help:
|
||||||
|
bit KEYRESET ; clear keyboard
|
||||||
|
bit SET_TEXT
|
||||||
|
jsr HOME
|
||||||
|
|
||||||
|
lda #<help_text
|
||||||
|
sta OUTL
|
||||||
|
lda #>help_text
|
||||||
|
sta OUTH
|
||||||
|
jsr move_and_print_list
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
wait_for_keypress:
|
||||||
|
lda KEYPRESS
|
||||||
|
bpl wait_for_keypress
|
||||||
|
bit KEYRESET
|
||||||
|
|
||||||
|
|
||||||
|
bit SET_GR
|
||||||
|
rts
|
||||||
|
|
||||||
|
help_text:
|
||||||
|
.byte 0, 5,"CONTROLS:",0
|
||||||
|
.byte 3, 6, "A OR <- : MOVE LEFT",0
|
||||||
|
.byte 3, 7, "D OR -> : MOVE RIGHT",0
|
||||||
|
.byte 3, 8, "SPACEBAR : JUMP",0
|
||||||
|
.byte 3,11, "RETURN : SHOOT LASER",0
|
||||||
|
.byte 3,12, "ESC : QUITS",0
|
||||||
|
.byte 255
|
|
@ -22,7 +22,7 @@ draw_status_bar:
|
||||||
|
|
||||||
|
|
||||||
help_string:
|
help_string:
|
||||||
.byte 3,20," PRESS ^H FOR HELP ",0
|
.byte 3,20," PRESS 'H' FOR HELP ",0
|
||||||
|
|
||||||
score_string:
|
score_string:
|
||||||
; 012456789012345678901234567890123456789
|
; 012456789012345678901234567890123456789
|
||||||
|
|
|
@ -90,7 +90,7 @@ done_print_string:
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
.if 0
|
|
||||||
;================================
|
;================================
|
||||||
; move and print a list of lines
|
; move and print a list of lines
|
||||||
;================================
|
;================================
|
||||||
|
@ -103,7 +103,7 @@ move_and_print_list:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.if 0
|
||||||
;================================
|
;================================
|
||||||
; move and print a list of lines
|
; move and print a list of lines
|
||||||
;================================
|
;================================
|
||||||
|
|
Loading…
Reference in New Issue
Block a user