a bit smaller again

This commit is contained in:
Peter Ferrie 2018-01-08 10:21:52 -08:00
parent aba91066db
commit 7aa5f52b5d

View File

@ -40,7 +40,7 @@ inputfilebuffer
Start Start
ldx #(CodeEnd-CodeStart)-1; copy code to lower memory so we can load graphic at $2000 ldx #(CodeEnd-CodeStart)-1; copy code to lower memory so we can load graphic at $2000
- lda CodeStart,x - lda CodeStart,x
sta $00fe,x sta $00f8,x
dex dex
bpl - bpl -
txs txs
@ -53,59 +53,59 @@ Start
+ jmp MLI ; exit via MLI (stack is arranged to execute Open MLI call) + jmp MLI ; exit via MLI (stack is arranged to execute Open MLI call)
CodeStart CodeStart
!pseudopc $fe { !pseudopc $f8 {
!word $2000 ; used by main->aux copy loop softswitches
!byte $50,$52,$54,$57,$0d
mliParamForClose
!byte kMLICloseCount
!byte 0 ; close all files, also low part of pointer
!byte $20 ; used by main->aux copy loop
!word Open-1 ; on stack for first MLI call !word Open-1 ; on stack for first MLI call
Open Open
!byte kMLIOpen ; stack-based params for Open MLI call !byte kMLIOpen ; stack-based params for Open MLI call
!word mliParamForOpen !word mliParamForOpen
jsr Read1 ; read first half of graphic (belongs in auxmem) ldx #kMLIReadOrQuitCount ; they just happen to be the same number
bcs Close ; error during open or read? close & quit stx mliparam
jsr Read ; read first half of graphic (belongs in auxmem)
; does not return if error
;DHGRCopy ;DHGRCopy
sta $C00A sta $C00A
sta $C000 sta $C000
sta $C005 ; read from mainmem, write to auxmem sta $C005 ; read from mainmem, write to auxmem
- lda ($ff,x) ; ($fe) because X is #$FF - lda ($fe-kMLIReadOrQuitCount,x)
sta ($ff,x) sta ($fe-kMLIReadOrQuitCount,x)
inc $fe inc $fe
bne - bne -
inc $ff inc $ff
bit $ff ; copy until $4000 bit $ff ; copy until $4000
bvc - bvc -
sta $C004 ; read/write from mainmem sta $C004 ; read/write from mainmem
jsr Read2 ; read second half of graphic (stays in main memory) jsr Read ; read second half of graphic (stays in main memory)
Close ; does not return if error
php ; save MLI result
jsr MLI ; close all files
!byte kMLIClose
!word mliParamForClose
plp ; restore MLI result
bcs Quit ; any error? quit without displaying
;DHGRShow ;DHGRShow
lda $C05E ; DHGR mode lda $C05E ; DHGR mode
sta $C00D - ldy softswitches,x
bit $C050 sta $c000,y ; enable graphics display
bit $C054 dex
bit $C052 bpl -
bit $C057
;WaitForKey ;WaitForKey
- lda $C000 - lda $C000
bpl - bpl -
Close
jsr MLI ; close all files
!byte kMLIClose
!word mliParamForClose
Quit Quit
lsr mlicmd ; MLI_QUIT ($65) is half of MLI_READ ($CA) so that's great lsr mlicmd ; MLI_QUIT ($65) is half of MLI_READ ($CA) so that's great
Read1 Read
ldy #kMLIReadOrQuitCount
sty mliparam
Read2
jsr MLI jsr MLI
mlicmd !byte kMLIRead mlicmd !byte kMLIRead
!word mliparam !word mliparam
bcs Close ; error during open or read? close & quit
rts rts
mliParamForClose
!byte kMLICloseCount
!byte 0 ; close all files
mliParamForOpen mliParamForOpen
!byte kMLIOpenCount !byte kMLIOpenCount
!word inputfilebuffer !word inputfilebuffer