mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-29 08:55:10 +00:00
peasant: more work trying to track down disk issue
This commit is contained in:
parent
2226c02233
commit
923b6f35f7
@ -116,6 +116,7 @@ qboot.inc: generate_common QBOOT
|
||||
./generate_common -a 0x000 -s curtrk_smc qboot_sector.lst >> qboot.inc
|
||||
./generate_common -a 0x000 -s phase_smc qboot_sector.lst >> qboot.inc
|
||||
./generate_common -a 0x000 -s driveon qboot_sector.lst >> qboot.inc
|
||||
./generate_common -a 0x000 -s wait_1s qboot_sector.lst >> qboot.inc
|
||||
./generate_common -a 0x000 -s driveoff qboot_sector.lst >> qboot.inc
|
||||
./generate_common -a 0x000 -s switch_drive1 qboot_sector.lst >> qboot.inc
|
||||
./generate_common -a 0x000 -s switch_drive2 qboot_sector.lst >> qboot.inc
|
||||
@ -167,8 +168,8 @@ qload.inc: generate_common QLOAD
|
||||
./generate_common -a 0xb00 -s speaker_frequency qload.lst >> qload.inc
|
||||
echo "hposn_high = \$$BA00" >> qload.inc
|
||||
echo "hposn_low = \$$BB00" >> qload.inc
|
||||
echo "driveoff = \$$A22" >> qload.inc
|
||||
echo "driveon = \$$A9D" >> qload.inc
|
||||
# echo "driveoff = \$$A22" >> qload.inc
|
||||
# echo "driveon = \$$A9D" >> qload.inc
|
||||
|
||||
####
|
||||
|
||||
|
@ -8,29 +8,17 @@
|
||||
; so the best way to detect if disk is there is to try seeking/reading
|
||||
; and seeing if you get valid data
|
||||
|
||||
.if 0
|
||||
switch_drive1:
|
||||
lda curtrk_smc+1
|
||||
sta DRIVE2_TRACK ; save track location
|
||||
slotpatch10:
|
||||
lda $C0d1 ; drive 1 select
|
||||
lda #1
|
||||
sta CURRENT_DRIVE
|
||||
lda DRIVE1_TRACK ; restore saved track location
|
||||
sta curtrk_smc+1
|
||||
rts
|
||||
; Note: should attempt to not have drive1/drive on at same time
|
||||
; even when you turn off drive a 555 timer keeps it running
|
||||
; for 1s or so
|
||||
|
||||
|
||||
; assume slot 6
|
||||
; C0E8 = motor off
|
||||
; C0E9 = motor on
|
||||
; C0EA = select drive1
|
||||
; C0EB = select drive2
|
||||
|
||||
switch_drive2:
|
||||
lda curtrk_smc+1
|
||||
sta DRIVE1_TRACK ; save track location
|
||||
slotpatch11:
|
||||
lda $C0d1 ; drive 2 select
|
||||
lda #2
|
||||
sta CURRENT_DRIVE
|
||||
lda DRIVE2_TRACK ; restore saved track location
|
||||
sta curtrk_smc+1
|
||||
rts
|
||||
.endif
|
||||
|
||||
;=================================
|
||||
; check floppy in drive2
|
||||
@ -46,13 +34,24 @@ slotpatch11:
|
||||
|
||||
check_floppy_in_drive2:
|
||||
|
||||
; anti-m does E9,EB, spinup (motor on, then select d2?)
|
||||
; then delays, then seeks
|
||||
; at end, driveoff E8
|
||||
|
||||
jsr switch_drive2
|
||||
|
||||
jsr driveon ; turn drive on
|
||||
; seems counter-intuitive but you're
|
||||
; supposed to do this before
|
||||
; switching to drive2?
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; seek to track 0
|
||||
|
||||
lda #(35*2) ; worst case scenario(?)
|
||||
lda #(40*2) ; worst case scenario(?)
|
||||
sta curtrk_smc+1
|
||||
lda #0 ; seek to track0
|
||||
sta phase_smc+1
|
||||
@ -77,13 +76,12 @@ check_drive2_loop:
|
||||
|
||||
clc ; clear Carry for failure
|
||||
dex
|
||||
bmi done_check ; actually done after 3*256
|
||||
bmi done_check_failed ; actually done after 3*256
|
||||
|
||||
keep_trying:
|
||||
|
||||
get_valid_byte:
|
||||
; lda $C0EC ; read byte
|
||||
jsr readnib
|
||||
jsr readnib ; read byte
|
||||
bpl get_valid_byte ; keep trying if high bit not set
|
||||
|
||||
check_if_d5:
|
||||
@ -91,15 +89,13 @@ check_if_d5:
|
||||
bne check_drive2_loop ; if not, try again
|
||||
|
||||
check_if_aa:
|
||||
; lda $C0EC ; read byte
|
||||
jsr readnib
|
||||
jsr readnib ; read byte
|
||||
bpl check_if_aa ; keep trying until valid
|
||||
cmp #$AA ; see if aa
|
||||
bne get_valid_byte ; if not try again
|
||||
|
||||
check_if_96:
|
||||
; lda $C0EC ; read byte
|
||||
jsr readnib
|
||||
jsr readnib ; read byte
|
||||
bpl check_if_96 ; keep trying until valid
|
||||
cmp #$96 ; see if 96
|
||||
bne check_if_d5 ; if not try again
|
||||
@ -110,5 +106,23 @@ check_if_96:
|
||||
done_check:
|
||||
jsr driveoff
|
||||
|
||||
jmp switch_drive1 ; tail call
|
||||
jsr wait_1s
|
||||
|
||||
jsr switch_drive1
|
||||
|
||||
sec
|
||||
|
||||
rts
|
||||
|
||||
done_check_failed:
|
||||
jsr driveoff
|
||||
|
||||
jsr wait_1s
|
||||
|
||||
jsr switch_drive1
|
||||
|
||||
clc
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
@ -2,11 +2,12 @@ seek =$0a26
|
||||
curtrk_smc =$0a2b
|
||||
phase_smc =$0a31
|
||||
driveon =$0a9d
|
||||
wait_1s =$0aaf
|
||||
driveoff =$0a22
|
||||
switch_drive1 =$08af
|
||||
switch_drive2 =$08c1
|
||||
load_new =$0aab
|
||||
load_address =$0ac4
|
||||
switch_drive2 =$08be
|
||||
load_new =$0aba
|
||||
load_address =$0ad3
|
||||
load_track=load_address+1
|
||||
load_sector=load_address+2
|
||||
load_length=load_address+3
|
||||
|
@ -243,8 +243,8 @@ preread:
|
||||
switch_drive1:
|
||||
lda curtrk_smc+1
|
||||
sta DRIVE2_TRACK ; save track location
|
||||
slotpatch10:
|
||||
lda $C0d1 ; drive 1 select
|
||||
;slotpatch10:
|
||||
; lda $C0d1 ; drive 1 select
|
||||
lda #1
|
||||
sta CURRENT_DRIVE
|
||||
lda DRIVE1_TRACK ; restore saved track location
|
||||
@ -254,8 +254,8 @@ slotpatch10:
|
||||
switch_drive2:
|
||||
lda curtrk_smc+1
|
||||
sta DRIVE1_TRACK ; save track location
|
||||
slotpatch11:
|
||||
lda $C0d1 ; drive 2 select
|
||||
;slotpatch11:
|
||||
; lda $C0d1 ; drive 2 select
|
||||
lda #2
|
||||
sta CURRENT_DRIVE
|
||||
lda DRIVE2_TRACK ; restore saved track location
|
||||
|
@ -319,16 +319,38 @@ code_end:
|
||||
driveon:
|
||||
|
||||
slotpatch9:
|
||||
lda $c0d1
|
||||
lda $c0d1 ; turn drive on first
|
||||
|
||||
; then you select drive
|
||||
|
||||
; this could be more compact
|
||||
|
||||
lda CURRENT_DRIVE
|
||||
cmp #2
|
||||
beq driveon_disk2
|
||||
|
||||
driveon_disk1:
|
||||
|
||||
slotpatch10:
|
||||
lda $C0d1 ; drive 1 select
|
||||
jmp done_drive_select
|
||||
|
||||
driveon_disk2:
|
||||
|
||||
slotpatch11:
|
||||
lda $C0d1 ; drive 2 select
|
||||
|
||||
done_drive_select:
|
||||
|
||||
|
||||
; wait 1s
|
||||
|
||||
ldx #6
|
||||
wait_1s:
|
||||
ldx #6
|
||||
wait_1s_loop:
|
||||
lda #255
|
||||
jsr wait
|
||||
dex
|
||||
bne wait_1s
|
||||
bne wait_1s_loop
|
||||
|
||||
rts
|
||||
|
||||
|
@ -1,41 +1,39 @@
|
||||
load_file =$0b24
|
||||
sector_write =$0c7f
|
||||
load_file =$0b2a
|
||||
sector_write =$0c85
|
||||
check_floppy_in_drive2 =$0de6
|
||||
requested_sector =$0d17
|
||||
decompress_lzsa2_fast =$0e25
|
||||
getsrc_smc =$0f1b
|
||||
hgr2 =$1821
|
||||
hgr_make_tables =$1595
|
||||
hgr_put_string =$0f28
|
||||
restore_bg_1x28 =$1460
|
||||
hgr_draw_sprite_1x28 =$13f9
|
||||
input_buffer =$156d
|
||||
hgr_text_box =$160b
|
||||
hgr_text_box_nosave =$16a2
|
||||
hgr_partial_restore =$14e3
|
||||
clear_bottom =$17f6
|
||||
hgr_input =$1513
|
||||
draw_box =$12aa
|
||||
disp_put_string =$1646
|
||||
disp_one_line =$165a
|
||||
invert_smc1 =$0fa0
|
||||
disp_put_string_cursor =$1656
|
||||
hgr_put_char_cursor =$0f54
|
||||
vgi_simple_rectangle =$132b
|
||||
peasant_text =$1f55
|
||||
save_menu =$18d4
|
||||
load_menu =$18c9
|
||||
location_names_l =$1c01
|
||||
location_names_h =$1c20
|
||||
wait_until_keypress =$1e40
|
||||
random16 =$1e49
|
||||
score_points =$1ece
|
||||
print_score =$1e7e
|
||||
update_score =$1e89
|
||||
speaker_beep =$1f3c
|
||||
speaker_duration =$1f53
|
||||
speaker_frequency =$1f54
|
||||
decompress_lzsa2_fast =$0e35
|
||||
getsrc_smc =$0f2b
|
||||
hgr2 =$1831
|
||||
hgr_make_tables =$15a5
|
||||
hgr_put_string =$0f38
|
||||
restore_bg_1x28 =$1470
|
||||
hgr_draw_sprite_1x28 =$1409
|
||||
input_buffer =$157d
|
||||
hgr_text_box =$161b
|
||||
hgr_text_box_nosave =$16b2
|
||||
hgr_partial_restore =$14f3
|
||||
clear_bottom =$1806
|
||||
hgr_input =$1523
|
||||
draw_box =$12ba
|
||||
disp_put_string =$1656
|
||||
disp_one_line =$166a
|
||||
invert_smc1 =$0fb0
|
||||
disp_put_string_cursor =$1666
|
||||
hgr_put_char_cursor =$0f64
|
||||
vgi_simple_rectangle =$133b
|
||||
peasant_text =$1f65
|
||||
save_menu =$18e4
|
||||
load_menu =$18d9
|
||||
location_names_l =$1c11
|
||||
location_names_h =$1c30
|
||||
wait_until_keypress =$1e50
|
||||
random16 =$1e59
|
||||
score_points =$1ede
|
||||
print_score =$1e8e
|
||||
update_score =$1e99
|
||||
speaker_beep =$1f4c
|
||||
speaker_duration =$1f63
|
||||
speaker_frequency =$1f64
|
||||
hposn_high = $BA00
|
||||
hposn_low = $BB00
|
||||
driveoff = $A22
|
||||
driveon = $A9D
|
||||
|
@ -19,6 +19,37 @@ tmpsec = $3C
|
||||
|
||||
qload_start:
|
||||
|
||||
|
||||
|
||||
; 0..$10?
|
||||
; 0 1 2 3 4 5 6 7 8 9 a b c d e f 10
|
||||
; AA AA AA AA AA 07 05 40 20 01 01 01 00 0A 00 AA AA
|
||||
; 00 C6 00 00 ff 07 05 40 20 00 01 01 00 0a 00 00 AA
|
||||
|
||||
|
||||
; $300
|
||||
; 80+OK, 40 bad, 60 bad, 70 good, 68=bad
|
||||
|
||||
; 0 1 2 3 4 5 6 7 8 9 A B C D
|
||||
; $360 = DC E0 00 E4 E8 EC F0 F4 00 00 00 00 = bad
|
||||
; $360 = dc e0 00 e4 e8 ec f0 f4 f8 fc 00 00 00 01 00 00 02 03 = good
|
||||
; boot = ff ff 00 00 ff ff 00 00 ff ff 00 00 00 01 00 00 02 03
|
||||
|
||||
; preshift table is $300 - $369
|
||||
|
||||
; $36C to $3D5 is used as decode table by disk II drive
|
||||
|
||||
.if 0
|
||||
ldy WHICH_SLOT ; temporarily save
|
||||
lda #$AA
|
||||
ldx #$2
|
||||
zp_clear_loop:
|
||||
sta $00,X
|
||||
inx
|
||||
bne zp_clear_loop
|
||||
sty WHICH_SLOT
|
||||
.endif
|
||||
|
||||
; init the write code
|
||||
lda WHICH_SLOT
|
||||
jsr popwr_init
|
||||
@ -34,6 +65,10 @@ qload_start:
|
||||
sta DRIVE1_DISK ; it's in drive1
|
||||
sta CURRENT_DRIVE ; and currently using drive 1
|
||||
|
||||
lda #$ff
|
||||
sta DRIVE1_TRACK
|
||||
sta DRIVE2_TRACK
|
||||
|
||||
jsr load_file ; actually load intro
|
||||
|
||||
jsr $6000 ; run intro
|
||||
@ -41,6 +76,10 @@ qload_start:
|
||||
lda #LOAD_TITLE ; next load title
|
||||
sta WHICH_LOAD
|
||||
|
||||
; bit $C054
|
||||
; bit $C051
|
||||
; brk
|
||||
|
||||
main_game_loop:
|
||||
jsr load_file
|
||||
|
||||
@ -163,12 +202,12 @@ verify_disk:
|
||||
|
||||
; first sector now in $BC00
|
||||
; offset 5B
|
||||
; disk1 = $d0
|
||||
; disk1 = $12
|
||||
; disk2 = $32 ('2')
|
||||
; disk3 = $33 ('3')
|
||||
|
||||
lda $BC5B
|
||||
cmp #$d0
|
||||
cmp #$12
|
||||
beq is_disk1
|
||||
cmp #$32
|
||||
beq is_disk2
|
||||
|
@ -1,4 +1,4 @@
|
||||
version_message:
|
||||
.byte 0,43,24, 0,253,82
|
||||
.byte 8,41,"APPLE ][ PEASANT'S QUEST",13
|
||||
.byte "version 0.83",0
|
||||
.byte "version 0.84",0
|
||||
|
@ -262,7 +262,7 @@ skip_all_checks:
|
||||
|
||||
;===================================
|
||||
;===================================
|
||||
; do the animated vidalectrix intro
|
||||
; do the animated videlectrix intro
|
||||
;===================================
|
||||
;===================================
|
||||
|
||||
@ -509,7 +509,7 @@ delays:
|
||||
|
||||
; 0123456789012345678901234567890123456789
|
||||
boot_message:
|
||||
.byte 0,0, "LOADING PEASANT'S QUEST V0.83",0
|
||||
.byte 0,0, "LOADING PEASANT'S QUEST V0.84a",0
|
||||
.byte 0,3,"ORIGINAL BY VIDELECTRIX",0
|
||||
.byte 0,5,"APPLE II PORT: VINCE WEAVER",0
|
||||
.byte 0,6,"DISK CODE : QKUMBA",0
|
||||
|
Loading…
Reference in New Issue
Block a user