and another one

This commit is contained in:
Peter Ferrie 2018-01-09 09:05:48 -08:00
parent ccf11333ed
commit 654464fbb6
1 changed files with 13 additions and 10 deletions

View File

@ -38,11 +38,13 @@ MACHID = $BF98
inputfilebuffer
!fill $40
Start
ldy #(CodeEnd-CodeStart); copy code to lower memory so we can load graphic at $2000
- ldx CodeStart-1,y
ldy #(CodeEnd-CodeStart) ; copy code to lower memory so we can load graphic at $2000
- ldx CodeStart-1,y ; the last byte fetched is the '3' for kMLIOpenCount
; it will be converted later to a '4' for become kMLIReadOrQuitCount
; also used for switching from aux to main memory access
stx $4f,y
dey
bne -
bne - ; Y is 0 on exit, required later
;CheckFor128K
lda MACHID
and #$30
@ -52,15 +54,15 @@ Start
+ jsr MLI ; open file
!byte kMLIOpen
!word mliParamForOpen
inx
stx <mliparam ; set parameter count for MLI call, one more than Open
inx ; convert to kMLIReadOrQuitCount
stx <mliparam ; set parameter count for MLI call
; both Read and Quit accept four parameters
jmp ReadFile
CodeStart
!pseudopc $50 {
mliParamForOpen
!byte kMLIOpenCount
!byte 3 ; kMLIOpenCount when used here
!word inputfilebuffer
!byte <aFileBuffer
mliparam
@ -87,18 +89,19 @@ ReadFile
inc <(CopyToAuxHigh)
bit <(CopyToAuxHigh) ; copy until $4000
bvc -
sta $C004 ; read from mainmem, write to mainmem
SoftswitchBase=*+1
sta $C000,x ; read from mainmem, write to mainmem
; X is 4 from above
jsr Read ; read second half of graphic (stays in main memory)
; does not return if error
;DHGRShow
ldx #(softswitches_e-softswitches)-1
- ldy <softswitches,x
- ldy <softswitches,x ; the last byte fetched is the '0', required later
sta (SoftswitchBase),y ; enable DHGR graphics display
dex
bpl -
;WaitForKey
SoftswitchBase=*+1
- lda $C000
- lda (SoftswitchBase),y ; $C000 because Y is 0 from above
bpl -
Close
jsr MLI ; close all files