From 7aa5f52b5dce9689b99d620be7dccbe9e6aa9f47 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Mon, 8 Jan 2018 10:21:52 -0800 Subject: [PATCH] a bit smaller again --- src/a2fc.system.a | 56 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/a2fc.system.a b/src/a2fc.system.a index ea4d3da..57d11b7 100644 --- a/src/a2fc.system.a +++ b/src/a2fc.system.a @@ -40,7 +40,7 @@ inputfilebuffer Start ldx #(CodeEnd-CodeStart)-1; copy code to lower memory so we can load graphic at $2000 - lda CodeStart,x - sta $00fe,x + sta $00f8,x dex bpl - txs @@ -53,59 +53,59 @@ Start + jmp MLI ; exit via MLI (stack is arranged to execute Open MLI call) CodeStart -!pseudopc $fe { - !word $2000 ; used by main->aux copy loop +!pseudopc $f8 { +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 Open !byte kMLIOpen ; stack-based params for Open MLI call !word mliParamForOpen - jsr Read1 ; read first half of graphic (belongs in auxmem) - bcs Close ; error during open or read? close & quit + ldx #kMLIReadOrQuitCount ; they just happen to be the same number + stx mliparam + jsr Read ; read first half of graphic (belongs in auxmem) + ; does not return if error ;DHGRCopy sta $C00A sta $C000 sta $C005 ; read from mainmem, write to auxmem -- lda ($ff,x) ; ($fe) because X is #$FF - sta ($ff,x) +- lda ($fe-kMLIReadOrQuitCount,x) + sta ($fe-kMLIReadOrQuitCount,x) inc $fe bne - inc $ff bit $ff ; copy until $4000 bvc - sta $C004 ; read/write from mainmem - jsr Read2 ; read second half of graphic (stays in main memory) -Close - php ; save MLI result - jsr MLI ; close all files - !byte kMLIClose - !word mliParamForClose - plp ; restore MLI result - bcs Quit ; any error? quit without displaying + jsr Read ; read second half of graphic (stays in main memory) + ; does not return if error ;DHGRShow lda $C05E ; DHGR mode - sta $C00D - bit $C050 - bit $C054 - bit $C052 - bit $C057 +- ldy softswitches,x + sta $c000,y ; enable graphics display + dex + bpl - ;WaitForKey - lda $C000 bpl - +Close + jsr MLI ; close all files + !byte kMLIClose + !word mliParamForClose Quit lsr mlicmd ; MLI_QUIT ($65) is half of MLI_READ ($CA) so that's great -Read1 - ldy #kMLIReadOrQuitCount - sty mliparam -Read2 +Read jsr MLI mlicmd !byte kMLIRead !word mliparam + bcs Close ; error during open or read? close & quit rts -mliParamForClose - !byte kMLICloseCount - !byte 0 ; close all files - mliParamForOpen !byte kMLIOpenCount !word inputfilebuffer