From 47f30f9de9fee6b2f8852d05118e360c2328fea6 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 19 Aug 2022 01:36:14 -0400 Subject: [PATCH] hgr: solaris --- graphics/hgr/solaris/Makefile | 33 +++++++ graphics/hgr/solaris/hello.bas | 2 + graphics/hgr/solaris/solaris.s | 159 +++++++++++++++++++++++++++++++++ 3 files changed, 194 insertions(+) create mode 100644 graphics/hgr/solaris/Makefile create mode 100644 graphics/hgr/solaris/hello.bas create mode 100644 graphics/hgr/solaris/solaris.s diff --git a/graphics/hgr/solaris/Makefile b/graphics/hgr/solaris/Makefile new file mode 100644 index 00000000..079144b6 --- /dev/null +++ b/graphics/hgr/solaris/Makefile @@ -0,0 +1,33 @@ +include ../../../Makefile.inc + +DOS33 = ../../../utils/dos33fs-utils/dos33 +TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft +LINKERSCRIPTS = ../../../linker_scripts +EMPTYDISK = ../../../empty_disk/empty.dsk + +all: solaris.dsk + +solaris.dsk: HELLO SOLARIS + cp $(EMPTYDISK) solaris.dsk + $(DOS33) -y solaris.dsk SAVE A HELLO + $(DOS33) -y solaris.dsk BSAVE -a 0xc00 SOLARIS + +### + +HELLO: hello.bas + $(TOKENIZE) < hello.bas > HELLO + +### + + +SOLARIS: solaris.o + ld65 -o SOLARIS solaris.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +solaris.o: solaris.s + ca65 -o solaris.o solaris.s -l solaris.lst + +### + +clean: + rm -f *~ *.o *.lst HELLO SOLARIS + diff --git a/graphics/hgr/solaris/hello.bas b/graphics/hgr/solaris/hello.bas new file mode 100644 index 00000000..133a44bb --- /dev/null +++ b/graphics/hgr/solaris/hello.bas @@ -0,0 +1,2 @@ +5 HOME +10 PRINT CHR$(4);"CATALOG" diff --git a/graphics/hgr/solaris/solaris.s b/graphics/hgr/solaris/solaris.s new file mode 100644 index 00000000..0cd43f68 --- /dev/null +++ b/graphics/hgr/solaris/solaris.s @@ -0,0 +1,159 @@ +; Solaris scrolling code + + +; 256 bytes = original +; 240 bytes = don't initialize things unnecessarily +; 239 bytes = optimize branches +; 235 bytes = no lookup table for log2 + +; zero page +GBASL = $26 +GBASH = $27 + +HGR_X = $E0 +HGR_XH = $E1 +HGR_Y = $E2 +HGR_COLOR = $E4 +HGR_PAGE = $E6 + +; soft-switches +FULLGR = $C052 +PAGE1 = $C054 + +; ROM routines + +HGR2 = $F3D8 +HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y) + ; put in GBASL/GBASH + +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us + +INL = $FB +INH = $FC +YY = $FD +MASK = $FE +FRAME = $FF + +surtb3 = $1000 +surtb4 = $1083 + +; 0 1 2 3 4 5 6 7 +; 01 02 04 08 10 20 40 80 +; 5 2 7 4 1 7 4 1 6 +; 20(13) 04(13) 80(66) 10(66) 02(66) 80(13) 10(13) 02(13) 40(66) + +solaris: + + jsr HGR2 + +outer_loop: + dec FRAME + lda FRAME + + and #$8 + beq set_sur3 +set_sur4: + lda #