mist: update some things to improve joystick support

works Ok on emulator, need to test on actual hardware again
This commit is contained in:
Vince Weaver 2020-09-09 21:13:46 -04:00
parent 943493941a
commit 5cf9566991
4 changed files with 52 additions and 13 deletions

View File

@ -1,8 +1,11 @@
MIST -- a reimplementation of MYST from scratch for Apple II computers
======================================================================
+ works best on II+/IIe
+ should run on IIc/IIgs though not as well tested
Compiling:
==========
This is a bit tricky
First you'll need to install the cc65 package
https://github.com/cc65/cc65
@ -14,6 +17,9 @@ Compiling:
Then run "make" and hope for the best
Notes on Filesize
=================
Load times of ~8k DENTIST: MIST ~40k
DOS33: 7s TOO-BIG
PRODOS:

View File

@ -35,17 +35,17 @@ psc_smc2 =$199c
; keyboard.s
handle_keypress =$199c
change_direction =$1aa7
change_location =$1ada
change_direction =$1ad5
change_location =$1b08
; text_print.s
move_and_print =$1b72
ps_smc1 =$1b9f
move_and_print =$1ba0
ps_smc1 =$1bcd
; page_sprites.inc
blue_page_sprite =$1cee
red_page_sprite =$1d04
white_page_sprite =$1d1a
blue_page_small_sprite =$1d30
red_page_small_sprite =$1d38
blue_page_sprite =$1d1c
red_page_sprite =$1d32
white_page_sprite =$1d48
blue_page_small_sprite =$1d5e
red_page_small_sprite =$1d66

View File

@ -8,6 +8,11 @@ handle_keypress:
lda JOYSTICK_ENABLED
beq actually_handle_keypress
; only check joystick every-other frame
lda FRAMEL
and #$1
beq actually_handle_keypress
check_button:
lda PADDLE_BUTTON0
bpl button_clear
@ -111,7 +116,14 @@ check_left:
cmp #8 ; left key
bne check_right
left_pressed:
lda CURSOR_X ; if 41<x<$FB don't decrement
cmp #41
bcc do_dec_cursor_x
cmp #$FB
bcc done_left_pressed
do_dec_cursor_x:
dec CURSOR_X
done_left_pressed:
jmp done_keypress
check_right:
@ -120,7 +132,14 @@ check_right:
cmp #$15 ; right key
bne check_up
right_pressed:
lda CURSOR_X ; if 40<x<$FA don't increment
cmp #40
bcc do_inc_cursor_x
cmp #$FA
bcc done_right_pressed
do_inc_cursor_x:
inc CURSOR_X
done_right_pressed:
jmp done_keypress
check_up:
@ -129,8 +148,15 @@ check_up:
cmp #$0B ; up key
bne check_down
up_pressed:
lda CURSOR_Y ; if 49<y<$F0 don't decrement
cmp #49
bcc do_dec_cursor_y
cmp #$F0
bcc done_up_pressed
do_dec_cursor_y:
dec CURSOR_Y
dec CURSOR_Y
done_up_pressed:
jmp done_keypress
check_down:
@ -139,8 +165,15 @@ check_down:
cmp #$0A
bne check_return
down_pressed:
lda CURSOR_Y ; if 48<y<$EE don't decrement
cmp #48
bcc do_inc_cursor_y
cmp #$EE
bcc done_down_pressed
do_inc_cursor_y:
inc CURSOR_Y
inc CURSOR_Y
done_down_pressed:
jmp done_keypress
check_return:

View File

@ -35,12 +35,12 @@ text_loop:
rts
; 0123456789012345678901234567890123456789
boot_message:
.byte 0,0, "LOADING MIST V1.0",0
.byte 0,0, "LOADING MIST V1.01",0
.byte 0,3, "CONTROLS:",0
.byte 5,4, "MOVE CURSOR : ARROWS OR WASD",0
.byte 5,5, "FORWARD/ACTION : ENTER",0
.byte 5,5, "FORWARD/ACTION : RETURN OR SPACE",0
.byte 5,7, "ENABLE JOYSTICK: J",0
.byte 5,8, "LOAD GAME : CONTROL-L",0
.byte 5,9, "SAVE : CONTROL-S",0