more work towards preloading RAM disk image

This commit is contained in:
FeralChild64 committed 2021-05-17 20:04:05 +02:00
1 parent 215adaf47a
commit ad66c0972a
3 files changed
+58 -7

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@ unit_rd_init_test_ram: ; non-destructive ATTIC/CELLAR RAM test
stx RD_STARTSEG ; by default $FF, to mark no RAM disk
inx
stx RD_MAXTRACK ; maximum allowed track number, for now set 0
stx RD_VALIDIMG ; mark no valid image loaded
stx RAM_ATTIC ; set ATTIC/CELLAR RAM as not present
stx RAM_CELLAR
+52 -3
View File
@@ -4,17 +4,22 @@
;
!addr __stoptrack = RD_DIR_PHASE ; helper value for detecting too large image
unit_rd_preload:
; Check if RAM disk is enabled
; Check if RAM disk is enabled (should be disabled if no Hyper RAM is present)
lda UNIT_RAMDISK
beq @error_no_ramdisk
; XXX make sure attic RAM is present
rts ; XXX remove when code is fully implemented
; Set file name
ldy #>ramdisk_filename
@@ -31,6 +36,30 @@ unit_rd_preload:
+nop
bcc @error_not_found ; branch if file not found
; Calculate maximum amount of tracks possible to load
lda #$FF
sta RD_MAXTRACK ; maximum track number of loaded image, for now set $FF
sta __stoptrack
lda RAM_ATTIC
beq @added_attic
jsr unit_rd_preload_addram
@added_attic:
lda RAM_CELLAR
beq @added_cellar
jsr unit_rd_preload_addram
@added_cellar:
; Load the file
; XXX load the file
; XXX while loading set RD_MAXTRACK
@@ -47,6 +76,12 @@ unit_rd_preload:
; End of initialization
lda #$FF
sta RD_VALIDIMG ; mark image as valid
lda #$00 ; temporary storage needs to be restored to 0
sta __stoptrack
rts
@@ -61,3 +96,17 @@ unit_rd_preload:
; XXX set error information
rts
unit_rd_preload_addram:
; Add allowed number of tracks due to attic/cellar block presence
clc
lda #$80
adc __stoptrack
sta __stoptrack
rts