mirror of
https://github.com/a2-4am/a2fc.system.git
synced 2024-09-27 20:55:13 +00:00
and another one
This commit is contained in:
parent
ccf11333ed
commit
654464fbb6
@ -39,10 +39,12 @@ inputfilebuffer
|
|||||||
!fill $40
|
!fill $40
|
||||||
Start
|
Start
|
||||||
ldy #(CodeEnd-CodeStart) ; copy code to lower memory so we can load graphic at $2000
|
ldy #(CodeEnd-CodeStart) ; copy code to lower memory so we can load graphic at $2000
|
||||||
- ldx CodeStart-1,y
|
- 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
|
stx $4f,y
|
||||||
dey
|
dey
|
||||||
bne -
|
bne - ; Y is 0 on exit, required later
|
||||||
;CheckFor128K
|
;CheckFor128K
|
||||||
lda MACHID
|
lda MACHID
|
||||||
and #$30
|
and #$30
|
||||||
@ -52,15 +54,15 @@ Start
|
|||||||
+ jsr MLI ; open file
|
+ jsr MLI ; open file
|
||||||
!byte kMLIOpen
|
!byte kMLIOpen
|
||||||
!word mliParamForOpen
|
!word mliParamForOpen
|
||||||
inx
|
inx ; convert to kMLIReadOrQuitCount
|
||||||
stx <mliparam ; set parameter count for MLI call, one more than Open
|
stx <mliparam ; set parameter count for MLI call
|
||||||
; both Read and Quit accept four parameters
|
; both Read and Quit accept four parameters
|
||||||
jmp ReadFile
|
jmp ReadFile
|
||||||
|
|
||||||
CodeStart
|
CodeStart
|
||||||
!pseudopc $50 {
|
!pseudopc $50 {
|
||||||
mliParamForOpen
|
mliParamForOpen
|
||||||
!byte kMLIOpenCount
|
!byte 3 ; kMLIOpenCount when used here
|
||||||
!word inputfilebuffer
|
!word inputfilebuffer
|
||||||
!byte <aFileBuffer
|
!byte <aFileBuffer
|
||||||
mliparam
|
mliparam
|
||||||
@ -87,18 +89,19 @@ ReadFile
|
|||||||
inc <(CopyToAuxHigh)
|
inc <(CopyToAuxHigh)
|
||||||
bit <(CopyToAuxHigh) ; copy until $4000
|
bit <(CopyToAuxHigh) ; copy until $4000
|
||||||
bvc -
|
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)
|
jsr Read ; read second half of graphic (stays in main memory)
|
||||||
; does not return if error
|
; does not return if error
|
||||||
;DHGRShow
|
;DHGRShow
|
||||||
ldx #(softswitches_e-softswitches)-1
|
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
|
sta (SoftswitchBase),y ; enable DHGR graphics display
|
||||||
dex
|
dex
|
||||||
bpl -
|
bpl -
|
||||||
;WaitForKey
|
;WaitForKey
|
||||||
SoftswitchBase=*+1
|
- lda (SoftswitchBase),y ; $C000 because Y is 0 from above
|
||||||
- lda $C000
|
|
||||||
bpl -
|
bpl -
|
||||||
Close
|
Close
|
||||||
jsr MLI ; close all files
|
jsr MLI ; close all files
|
||||||
|
Loading…
Reference in New Issue
Block a user