mirror of
https://github.com/a2-4am/a2fc.system.git
synced 2024-09-27 05:55:03 +00:00
initial import
This commit is contained in:
parent
4b41af3573
commit
a63a1cb5da
32
Makefile
Normal file
32
Makefile
Normal file
@ -0,0 +1,32 @@
|
||||
#
|
||||
# A2FC.SYSTEM Makefile
|
||||
# assembles source code, optionally builds a disk image and mounts it
|
||||
#
|
||||
# original by Quinn Dunki on 2014-08-15
|
||||
# One Girl, One Laptop Productions
|
||||
# http://www.quinndunki.com/blondihacks
|
||||
#
|
||||
# adapted by 4am on 2018-01-07
|
||||
#
|
||||
|
||||
# third-party tools required to build
|
||||
# https://sourceforge.net/projects/acme-crossass/
|
||||
ACME=acme
|
||||
# https://sourceforge.net/projects/applecommander/
|
||||
AC=bin/AppleCommander.jar
|
||||
|
||||
BUILDDISK=build/a2fc.po
|
||||
|
||||
asm:
|
||||
mkdir -p build
|
||||
cd src && $(ACME) a2fc.system.a
|
||||
cp res/work.po $(BUILDDISK)
|
||||
java -jar $(AC) -p $(BUILDDISK) "BASIS.SYSTEM" sys 0x2000 < "build/A2FC.SYSTEM#FF2000"
|
||||
|
||||
clean:
|
||||
rm -rf build/
|
||||
|
||||
mount:
|
||||
osascript bin/V2Make.scpt "`pwd`" $(BUILDDISK)
|
||||
|
||||
all: clean asm mount
|
BIN
bin/AppleCommander.jar
Normal file
BIN
bin/AppleCommander.jar
Normal file
Binary file not shown.
BIN
bin/V2Make.scpt
Normal file
BIN
bin/V2Make.scpt
Normal file
Binary file not shown.
BIN
res/work.po
Normal file
BIN
res/work.po
Normal file
Binary file not shown.
115
src/a2fc.system.a
Normal file
115
src/a2fc.system.a
Normal file
@ -0,0 +1,115 @@
|
||||
!cpu 6502
|
||||
!to "../build/A2FC.SYSTEM#FF2000",plain
|
||||
*=$2000
|
||||
;
|
||||
; A2FC.SYSTEM
|
||||
; (c) 2018 by 4am
|
||||
; a very small DHGR graphics viewer
|
||||
; takes pathname of .a2fc file (in $2006),
|
||||
; loads it,
|
||||
; displays it,
|
||||
; waits for key,
|
||||
; quits via MLI
|
||||
;
|
||||
|
||||
;
|
||||
; MLI commands
|
||||
;
|
||||
kMLIOpen = $C8
|
||||
kMLIRead = $CA
|
||||
kMLIClose = $CC
|
||||
kMLIQuit = $65
|
||||
;
|
||||
; MLI parameter counts
|
||||
;
|
||||
kMLIOpenCount = $03
|
||||
kMLIReadCount = $04
|
||||
kMLICloseCount = $01
|
||||
kMLIQuitCount = $04
|
||||
;
|
||||
; other stuff
|
||||
;
|
||||
aFileBuffer = $9200
|
||||
|
||||
jmp Start ; magic jump
|
||||
!byte $EE,$EE ; magic bytes
|
||||
inputfile
|
||||
!byte $40 ; length of inputfile buffer
|
||||
inputfilebuffer
|
||||
!fill $40
|
||||
Start
|
||||
ldx #$00
|
||||
FM lda CodeStart,x
|
||||
sta Open,x
|
||||
inx
|
||||
bne FM
|
||||
jmp Open
|
||||
CodeStart
|
||||
|
||||
!pseudopc $200 {
|
||||
Open
|
||||
jsr CallMLIImmediate
|
||||
bcs Quit
|
||||
; A is 0 after successful MLI call
|
||||
sta mliparam+2 ; lo data address
|
||||
sta mliparam+4 ; lo data length
|
||||
lda mliparam+5
|
||||
sta mliparam+1 ; ProDOS file refnum
|
||||
ldx #$20
|
||||
stx mliparam+3 ; hi data address
|
||||
stx mliparam+5 ; hi data length
|
||||
lda #kMLIRead
|
||||
ldy #kMLIReadCount
|
||||
jsr CallMLI
|
||||
bcs Close
|
||||
;DHGRCopy
|
||||
sta $C00A
|
||||
sta $C000
|
||||
tay ; A is 0 after successful MLI call
|
||||
; X is still #$20
|
||||
.writeToAux
|
||||
sta $C005 ; read from mainmem, write to auxmem
|
||||
.copya lda $2000,y
|
||||
.copyb sta $2000,y
|
||||
iny
|
||||
bne .copya
|
||||
sta $C004 ; read/write from mainmem
|
||||
inc .copya+2
|
||||
inc .copyb+2
|
||||
dex
|
||||
bne .writeToAux
|
||||
;Read
|
||||
lda #kMLIRead
|
||||
ldy #kMLIReadCount
|
||||
jsr CallMLI
|
||||
Close
|
||||
lda #kMLIClose
|
||||
ldy #kMLICloseCount
|
||||
jsr CallMLI
|
||||
;DHGRShow
|
||||
lda $C05E
|
||||
sta $C00D
|
||||
bit $C050
|
||||
bit $C054
|
||||
bit $C052
|
||||
bit $C057
|
||||
;WaitForKey
|
||||
- lda $C000
|
||||
bpl -
|
||||
Quit
|
||||
lda #kMLIQuit
|
||||
ldy #kMLIQuitCount
|
||||
CallMLI
|
||||
sta mlicmd
|
||||
sty mliparam
|
||||
CallMLIImmediate
|
||||
jsr $BF00
|
||||
mlicmd !byte kMLIOpen
|
||||
!word mliparam
|
||||
rts
|
||||
mliparam !byte kMLIOpenCount
|
||||
!word inputfilebuffer
|
||||
!word aFileBuffer
|
||||
; !byte $00,$00,$00,$00
|
||||
End
|
||||
}
|
Loading…
Reference in New Issue
Block a user