Merge pull request #1 from peterferrie/master

a bit smaller
This commit is contained in:
4am 2018-01-08 10:29:22 -05:00 committed by GitHub
commit 019293d8ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 28 deletions

View File

@ -38,44 +38,42 @@ MLI = $BF00
inputfilebuffer
!fill $40
Start
ldx #(CodeEnd-CodeStart)
txs
- lda CodeStart-1,x
pha
ldx #(CodeEnd-CodeStart)-1
- lda CodeStart,x
sta $00fe,x
dex
bne -
bpl -
txs
jmp MLI
CodeStart
!pseudopc $101 {
!pseudopc $fe {
!word $2000
!word Open-1
Open
!byte kMLIOpen
!word mliParamForOpen
bcs Quit
jsr Read
jsr Read1
bcs Close
;DHGRCopy
sta $C00A
sta $C000
sta $C005 ; read from mainmem, write to auxmem
ldx #$20
stx $45 ; $44 is always 0 after MLI read
tay
- lda ($44),y
sta ($44),y
iny
bne -
inc $45
dex
- lda ($ff,x)
sta ($ff,x)
inc $fe
bne -
inc $ff
bit $ff
bvc -
sta $C004 ; read/write from mainmem
jsr Read
jsr Read2
Close
php
lda #kMLIClose
ldy #kMLICloseCount
jsr CallMLI
jsr MLI
!byte kMLIClose
!word mliParamForClose
plp
bcs Quit
;DHGRShow
@ -89,20 +87,20 @@ Close
- lda $C000
bpl -
Quit
lda #kMLIQuit
ldy #kMLIQuitCount
bne CallMLI ; always branches
Read
lda #kMLIRead
ldy #kMLIReadCount
CallMLI
sta mlicmd
lsr mlicmd
Read1
ldy #kMLIReadCount ; also #kMLIQuitCount
sty mliparam
Read2
jsr MLI
mlicmd !byte kMLIRead
!word mliparam
rts
mliParamForClose
!byte kMLICloseCount
!byte 0 ; all handles
mliParamForOpen
!byte kMLIOpenCount
!word inputfilebuffer