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 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: Compiling:
==========
This is a bit tricky This is a bit tricky
First you'll need to install the cc65 package First you'll need to install the cc65 package
https://github.com/cc65/cc65 https://github.com/cc65/cc65
@ -14,6 +17,9 @@ Compiling:
Then run "make" and hope for the best Then run "make" and hope for the best
Notes on Filesize
=================
Load times of ~8k DENTIST: MIST ~40k Load times of ~8k DENTIST: MIST ~40k
DOS33: 7s TOO-BIG DOS33: 7s TOO-BIG
PRODOS: PRODOS:

View File

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

View File

@ -8,6 +8,11 @@ handle_keypress:
lda JOYSTICK_ENABLED lda JOYSTICK_ENABLED
beq actually_handle_keypress beq actually_handle_keypress
; only check joystick every-other frame
lda FRAMEL
and #$1
beq actually_handle_keypress
check_button: check_button:
lda PADDLE_BUTTON0 lda PADDLE_BUTTON0
bpl button_clear bpl button_clear
@ -111,7 +116,14 @@ check_left:
cmp #8 ; left key cmp #8 ; left key
bne check_right bne check_right
left_pressed: 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 dec CURSOR_X
done_left_pressed:
jmp done_keypress jmp done_keypress
check_right: check_right:
@ -120,7 +132,14 @@ check_right:
cmp #$15 ; right key cmp #$15 ; right key
bne check_up bne check_up
right_pressed: 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 inc CURSOR_X
done_right_pressed:
jmp done_keypress jmp done_keypress
check_up: check_up:
@ -129,8 +148,15 @@ check_up:
cmp #$0B ; up key cmp #$0B ; up key
bne check_down bne check_down
up_pressed: 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
dec CURSOR_Y dec CURSOR_Y
done_up_pressed:
jmp done_keypress jmp done_keypress
check_down: check_down:
@ -139,8 +165,15 @@ check_down:
cmp #$0A cmp #$0A
bne check_return bne check_return
down_pressed: 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
inc CURSOR_Y inc CURSOR_Y
done_down_pressed:
jmp done_keypress jmp done_keypress
check_return: check_return:

View File

@ -35,12 +35,12 @@ text_loop:
rts rts
; 0123456789012345678901234567890123456789
boot_message: boot_message:
.byte 0,0, "LOADING MIST V1.0",0 .byte 0,0, "LOADING MIST V1.01",0
.byte 0,3, "CONTROLS:",0 .byte 0,3, "CONTROLS:",0
.byte 5,4, "MOVE CURSOR : ARROWS OR WASD",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,7, "ENABLE JOYSTICK: J",0
.byte 5,8, "LOAD GAME : CONTROL-L",0 .byte 5,8, "LOAD GAME : CONTROL-L",0
.byte 5,9, "SAVE : CONTROL-S",0 .byte 5,9, "SAVE : CONTROL-S",0