mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-24 12:29:29 +00:00
peasant: add hgr input support
This commit is contained in:
parent
c0ae45645e
commit
4246c3d5cc
|
@ -67,7 +67,7 @@ PEASANT: peasant.o
|
||||||
ld65 -o PEASANT peasant.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
|
ld65 -o PEASANT peasant.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
|
||||||
|
|
||||||
peasant.o: peasant.s graphics/graphics.inc \
|
peasant.o: peasant.s graphics/graphics.inc \
|
||||||
draw_box.s hgr_rectangle.s hgr_font.s \
|
draw_box.s hgr_rectangle.s hgr_font.s hgr_input.s \
|
||||||
title.s directions.s \
|
title.s directions.s \
|
||||||
cottage.s lake_w.s lake_e.s river.s knight.s \
|
cottage.s lake_w.s lake_e.s river.s knight.s \
|
||||||
ending.s
|
ending.s
|
||||||
|
@ -79,6 +79,7 @@ ENDING: ending.o
|
||||||
ld65 -o ENDING ending.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
|
ld65 -o ENDING ending.o -C $(LINKER_SCRIPTS)/apple2_6000.inc
|
||||||
|
|
||||||
ending.o: ending.s graphics_end/end_graphics.inc \
|
ending.o: ending.s graphics_end/end_graphics.inc \
|
||||||
|
hgr_input.s \
|
||||||
draw_box.s hgr_rectangle.s hgr_font.s \
|
draw_box.s hgr_rectangle.s hgr_font.s \
|
||||||
ending.s
|
ending.s
|
||||||
ca65 -o ending.o ending.s -l ending.lst
|
ca65 -o ending.o ending.s -l ending.lst
|
||||||
|
|
|
@ -28,7 +28,20 @@ trogdor_question:
|
||||||
|
|
||||||
jsr decompress_lzsa2_fast
|
jsr decompress_lzsa2_fast
|
||||||
|
|
||||||
jsr wait_until_keypress
|
lda #<copy_protection_text
|
||||||
|
sta OUTL
|
||||||
|
lda #>copy_protection_text
|
||||||
|
sta OUTH
|
||||||
|
|
||||||
|
jsr hgr_put_string
|
||||||
|
jsr hgr_put_string
|
||||||
|
jsr hgr_put_string
|
||||||
|
|
||||||
|
jsr hgr_input
|
||||||
|
|
||||||
|
;=============================
|
||||||
|
; game over man
|
||||||
|
;=============================
|
||||||
|
|
||||||
game_over:
|
game_over:
|
||||||
|
|
||||||
|
@ -64,6 +77,7 @@ forever:
|
||||||
.include "hgr_font.s"
|
.include "hgr_font.s"
|
||||||
.include "draw_box.s"
|
.include "draw_box.s"
|
||||||
.include "hgr_rectangle.s"
|
.include "hgr_rectangle.s"
|
||||||
|
.include "hgr_input.s"
|
||||||
|
|
||||||
.include "graphics_end/end_graphics.inc"
|
.include "graphics_end/end_graphics.inc"
|
||||||
|
|
||||||
|
@ -72,3 +86,11 @@ peasant_text:
|
||||||
|
|
||||||
score_text:
|
score_text:
|
||||||
.byte 0,2,"Score: 0 of 150",0
|
.byte 0,2,"Score: 0 of 150",0
|
||||||
|
|
||||||
|
|
||||||
|
; 0123456789012345678901234567890123456789
|
||||||
|
copy_protection_text:
|
||||||
|
.byte 0,160,"Before proceeding, don thy red glasses",0
|
||||||
|
.byte 0,168,"spin the wheel on p27 and answer this:",0
|
||||||
|
.byte 0,176,"+ Who is Trogdor's cousin's brother?",0
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ outl_no_oflo:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
;==================
|
;==================
|
||||||
; in X
|
; X in X
|
||||||
; Y in Y
|
; Y in Y
|
||||||
; Char in A
|
; Char in A
|
||||||
hgr_put_char:
|
hgr_put_char:
|
||||||
|
|
55
games/peasant/hgr_input.s
Normal file
55
games/peasant/hgr_input.s
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
;====================
|
||||||
|
; hgr input
|
||||||
|
;====================
|
||||||
|
; TODO: save to string
|
||||||
|
; TODO: arbitrary Y location
|
||||||
|
; TODO: when backspacing, erase old char not XOR
|
||||||
|
|
||||||
|
hgr_input:
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
ldy #184
|
||||||
|
lda #'>'
|
||||||
|
jsr hgr_put_char
|
||||||
|
|
||||||
|
ldx #1
|
||||||
|
stx INPUT_X
|
||||||
|
|
||||||
|
hgr_input_loop:
|
||||||
|
lda KEYPRESS
|
||||||
|
bpl hgr_input_loop
|
||||||
|
|
||||||
|
bit KEYRESET
|
||||||
|
|
||||||
|
and #$7f ; trim off top?
|
||||||
|
|
||||||
|
cmp #13
|
||||||
|
beq done_hgr_input
|
||||||
|
|
||||||
|
cmp #$7f
|
||||||
|
beq hgr_input_backspace
|
||||||
|
cmp #8
|
||||||
|
beq hgr_input_backspace
|
||||||
|
|
||||||
|
ldy #184
|
||||||
|
ldx INPUT_X
|
||||||
|
jsr hgr_put_char
|
||||||
|
|
||||||
|
inc INPUT_X
|
||||||
|
|
||||||
|
jmp hgr_input_loop
|
||||||
|
|
||||||
|
hgr_input_backspace:
|
||||||
|
ldx INPUT_X
|
||||||
|
cpx #1 ; don't backspace too far
|
||||||
|
beq hgr_input_loop
|
||||||
|
|
||||||
|
lda #' '
|
||||||
|
ldy #184
|
||||||
|
jsr hgr_put_char
|
||||||
|
|
||||||
|
dec INPUT_X
|
||||||
|
jmp hgr_input_loop
|
||||||
|
|
||||||
|
done_hgr_input:
|
||||||
|
rts
|
|
@ -17,9 +17,12 @@ CURSOR_Y = $63
|
||||||
|
|
||||||
WHICH_LOAD=$80
|
WHICH_LOAD=$80
|
||||||
|
|
||||||
|
INPUT_X = $D0
|
||||||
WHICH_SLOT = $DA
|
WHICH_SLOT = $DA
|
||||||
CURRENT_DISK = $DC
|
CURRENT_DISK = $DC
|
||||||
HGR_COLOR = $E4
|
HGR_COLOR = $E4
|
||||||
|
HGR_PAGE = $E6
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
P0 = $F1
|
P0 = $F1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user