diff --git a/basic/appleiibot/Makefile b/basic/appleiibot/Makefile index 04315031..63ba91b9 100644 --- a/basic/appleiibot/Makefile +++ b/basic/appleiibot/Makefile @@ -16,7 +16,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ C64.BAS SIERPINSKI.BAS FAKES.BAS SIER.BAS DROPS.BAS RR.BAS RR_HGR.BAS \ COMBO.BAS WIRES.BAS PATTERN.BAS BALL.BAS LINES.BAS MOD9.BAS \ XOR_ZOOM.BAS MOD9_HGR.BAS SIER_HGR.BAS MOVE.BAS SINE.BAS XDRAW128.BAS \ - GATOR.BAS + GATOR.BAS CURSOR.BAS # cp $(EMPTY_DISK)/empty.dsk appleiibot.dsk cp empty.dsk appleiibot.dsk @@ -82,6 +82,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \ $(DOS33) -y appleiibot.dsk SAVE A SINE.BAS $(DOS33) -y appleiibot.dsk SAVE A XDRAW128.BAS $(DOS33) -y appleiibot.dsk SAVE A GATOR.BAS + $(DOS33) -y appleiibot.dsk SAVE A CURSOR.BAS #### @@ -250,6 +251,11 @@ BIN.BAS: bin.bas GATOR.BAS: gator.bas $(TOKENIZE) < gator.bas > GATOR.BAS +#### + +CURSOR.BAS: cursor.bas + $(TOKENIZE) < cursor.bas > CURSOR.BAS + #### diff --git a/basic/appleiibot/convert_tgreene.c b/basic/appleiibot/convert_tgreene.c index f8bf84b1..3f8be60a 100644 --- a/basic/appleiibot/convert_tgreene.c +++ b/basic/appleiibot/convert_tgreene.c @@ -14,8 +14,8 @@ int main(int argc, char **argv) { -// int mode=END_AT_3F5; - int mode=BEGIN_AT_3F5; + int mode=END_AT_3F5; +// int mode=BEGIN_AT_3F5; int i = 0; int e = 0,filesize; int val,pv,final; diff --git a/basic/appleiibot/cursor.bas b/basic/appleiibot/cursor.bas new file mode 100644 index 00000000..02de5f43 --- /dev/null +++ b/basic/appleiibot/cursor.bas @@ -0,0 +1,2 @@ +1FORI=0TO139:POKE876+I,4*PEEK(2125+I)-192+(PEEK(2265+I/3)-35)/4^(I-INT(I/3)*3):NEXT +2&"8FoV7Q;Z2M:Z$U076nV1Q.W3U082mZ.P;X0X28:eX3X0X18:lX0_01W02^am^U0_V0OV0b4deY1P;X.X;80nbb`0SmM[0=/SS.i5h;T:b/ch;E`Q/Zb8Zmbdj:ERU0Zb8RmbdnCc0CH0#4'4V'4W/49,#G,&+$$SYUT$9(7##4\8Q<86#A#+3[$C#// diff --git a/linker_scripts/apple2_36a.inc b/linker_scripts/apple2_36a.inc new file mode 100644 index 00000000..84dd01e8 --- /dev/null +++ b/linker_scripts/apple2_36a.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $00, size = $1A, type = rw; + RAM: start = $36a, size = $8E00, file = %O; +} + +SEGMENTS { +CODE: load = RAM, type = ro; +RODATA: load = RAM, type = ro; +DATA: load = RAM, type = rw; +BSS: load = RAM, type = bss, define = yes; +ZEROPAGE: load = ZP, type = zp; +} diff --git a/linker_scripts/apple2_36c.inc b/linker_scripts/apple2_36c.inc new file mode 100644 index 00000000..c9ca7fbe --- /dev/null +++ b/linker_scripts/apple2_36c.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $00, size = $1A, type = rw; + RAM: start = $36c, size = $8E00, file = %O; +} + +SEGMENTS { +CODE: load = RAM, type = ro; +RODATA: load = RAM, type = ro; +DATA: load = RAM, type = rw; +BSS: load = RAM, type = bss, define = yes; +ZEROPAGE: load = ZP, type = zp; +} diff --git a/textmode/cursor/Makefile b/textmode/cursor/Makefile index 6f72b5dd..e475d20f 100644 --- a/textmode/cursor/Makefile +++ b/textmode/cursor/Makefile @@ -5,16 +5,18 @@ PNG2GR = ../../utils/gr-utils/png2gr PNG2RLE = ../../utils/gr-utils/png2rle TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft LINKERSCRIPTS = ../../linker_scripts +EMPTYDISK = ../../empty_disk -all: textflip.dsk +all: cursor.dsk $(DOS33): cd ../../utils/dos33fs-utils && make -textflip.dsk: $(DOS33) HELLO TEXT_DEMO - cp empty.dsk textflip.dsk - $(DOS33) -y textflip.dsk SAVE A HELLO - $(DOS33) -y textflip.dsk BSAVE -a 0x1000 TEXT_DEMO +cursor.dsk: $(DOS33) HELLO CURSOR.BAS CURSOR + cp $(EMPTYDISK)/empty.dsk cursor.dsk + $(DOS33) -y cursor.dsk SAVE A HELLO + $(DOS33) -y cursor.dsk SAVE A CURSOR.BAS + $(DOS33) -y cursor.dsk BSAVE -a 0x36C CURSOR ### @@ -24,16 +26,20 @@ HELLO: hello.bas ### -TEXT_DEMO: text_demo.o - ld65 -o TEXT_DEMO text_demo.o -C $(LINKERSCRIPTS)/apple2_1000.inc - -text_demo.o: text_demo.s \ - pageflip.s \ - gr_fast_clear.s - ca65 -o text_demo.o text_demo.s -l text_demo.lst +CURSOR.BAS: cursor.bas + $(TOKENIZE) < cursor.bas > CURSOR.BAS ### -clean: - rm -f *~ *.o TEXT_DEMO *.lst +CURSOR: cursor.o + ld65 -o CURSOR cursor.o -C $(LINKERSCRIPTS)/apple2_36c.inc + +cursor.o: cursor.s + ca65 -o cursor.o cursor.s -l cursor.lst + +### + + +clean: + rm -f *~ *.o HELLO CURSOR *.lst diff --git a/textmode/cursor/cursor.bas b/textmode/cursor/cursor.bas index 1a445b75..ae3eb2fb 100644 --- a/textmode/cursor/cursor.bas +++ b/textmode/cursor/cursor.bas @@ -1,2 +1,7 @@ -10 GR +10 HOME +20 REM FOR I=2048 TO 3072:POKE I,160:NEXT +30 INVERSE +40 ?SPC(5):?:FORX=1TO5:NORMAL:?SPC(4):?:INVERSE:?SPC(1):NEXT:?SPC(5) +100 GOTO 100 +130 POKE 49236+P,0:P=NOT P:FOR I=1 TO 1000:NEXT:GOTO 30 diff --git a/textmode/cursor/cursor.s b/textmode/cursor/cursor.s new file mode 100644 index 00000000..23cc74d1 --- /dev/null +++ b/textmode/cursor/cursor.s @@ -0,0 +1,121 @@ +;10 HOME +;20 REM FOR I=2048 TO 3072:POKE I,160:NEXT +;30 INVERSE +;40 ?SPC(5):?:FORX=1TO5:NORMAL:?SPC(4):?:INVERSE:?SPC(1):NEXT:?SPC(5) +;100 GOTO 100 +;130 POKE 49236+P,0:P=NOT P:FOR I=1 TO 1000:NEXT:GOTO 30 + +.include "hardware.inc" + +H2 = $2C +V2 = $2D +COLOR = $30 + +cursor: + jsr HOME + + lda #$20 + sta COLOR + + lda #8 + sta H2 + lda #3 + ldy #3 + + jsr HLINE ; HLINE Y,$2C at A + + lda #8 + sta H2 + lda #15 + ldy #3 + + jsr HLINE ; HLINE Y,$2C at A + + + lda #14 + sta V2 + lda #2 + ldy #8 + jsr VLINE + + lda #14 +; sta V2 + lda #2 + ldy #7 + jsr VLINE ; VLINE A,$2D at Y + +copy2page2: + ldx #0 +c2p2_loop: +smc1: + lda $400,X +smc2: + sta $800,X + inx + bne c2p2_loop + + inc smc1+2 + inc smc2+2 + lda smc2+2 + cmp #$10 + bne c2p2_loop + + lda #$5 + sta V2 + +yloop1: + ldy #12 +xloop1: + lda V2 + jsr PLOT ; plot at Y,A + iny + iny + cpy #17 + bcc xloop1 + + lda yloop1+1 + eor #$1 + sta yloop1+1 + + inc V2 + inc V2 + lda V2 + cmp #15 + bne yloop1 + + +; ldy #12 +;xloop2: +; lda #7 +; jsr PLOT ; plot at Y,A +; iny +; iny +; cpy #16 +; bcc xloop2 + + + +forever: + bit PAGE0 + + ldx #3 +lw1: + lda #200 + jsr WAIT + dex + bne lw1 + + bit PAGE1 + + ldx #3 +lw2: + lda #200 + jsr WAIT + dex + bne lw2 + + jmp forever + + ; want this at 3F5, $389 to start, so -6C, 36C + + jmp cursor diff --git a/textmode/cursor/hardware.inc b/textmode/cursor/hardware.inc new file mode 100644 index 00000000..084a56c5 --- /dev/null +++ b/textmode/cursor/hardware.inc @@ -0,0 +1,109 @@ +;; HARDWARE LOCATIONS + +KEYPRESS = $C000 +KEYRESET = $C010 + +;; SOFT SWITCHES +CLR80COL = $C000 ; PAGE0/PAGE1 normal +SET80COL = $C001 ; PAGE0/PAGE1 switches PAGE0 in Aux instead +EIGHTYCOLOFF = $C00C +EIGHTYCOLON = $C00D +TBCOLOR = $C022 ; IIgs text foreground / background colors +NEWVIDEO = $C029 ; IIgs graphics modes +SPEAKER = $C030 +CLOCKCTL = $C034 ; bits 0-3 are IIgs border color +SET_GR = $C050 +SET_TEXT = $C051 +FULLGR = $C052 +TEXTGR = $C053 +PAGE0 = $C054 +PAGE1 = $C055 +LORES = $C056 ; Enable LORES graphics +HIRES = $C057 ; Enable HIRES graphics +AN3 = $C05E ; Annunciator 3 + + + + + + + +PADDLE_BUTTON0 = $C061 +PADDLE_BUTTON1 = $C062 +PADDL0 = $C064 +PTRIG = $C070 + +;; BASIC ROUTINES + +NORMAL = $F273 +HGR = $F3E2 +HGR2 = $F3D8 +HCLR = $F3F2 +HPOSN = $F411 + +;; MONITOR ROUTINES + +PLOT = $F800 ;; PLOT AT Y,A +PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0) +HLINE = $F819 ;; HLINE Y,$2C at A +VLINE = $F828 ;; VLINE A,$2D at Y +CLRSCR = $F832 ;; Clear low-res screen +CLRTOP = $F836 ;; clear only top of low-res screen +GBASCALC= $F847 ;; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) +SETCOL = $F864 ;; COLOR=A +ROM_TEXT2COPY = $F962 ;; iigs +SETTXT = $FB36 +SETGR = $FB40 +TABV = $FB5B ;; VTAB to A +ROM_MACHINEID = $FBB3 ;; iigs +BELL = $FBDD ;; ring the bell +BASCALC = $FBC1 ;; +VTAB = $FC22 ;; VTAB to CV +HOME = $FC58 ;; Clear the text screen +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us +CROUT1 = $FD8B +SETINV = $FE80 ;; INVERSE +SETNORM = $FE84 ;; NORMAL +COUT = $FDED ;; output A to screen +COUT1 = $FDF0 ;; output A to screen + + + + + + + + + +COLOR_BLACK = 0 +COLOR_RED = 1 +COLOR_DARKBLUE = 2 +COLOR_PURPLE = 3 +COLOR_DARKGREEN = 4 +COLOR_GREY = 5 +COLOR_MEDIUMBLUE = 6 +COLOR_LIGHTBLUE = 7 +COLOR_BROWN = 8 +COLOR_ORANGE = 9 +COLOR_GREY2 = 10 +COLOR_PINK = 11 +COLOR_LIGHTGREEN = 12 +COLOR_YELLOW = 13 +COLOR_AQUA = 14 +COLOR_WHITE = 15 + +COLOR_BOTH_BLACK = $00 +COLOR_BOTH_RED = $11 +COLOR_BOTH_DARKBLUE = $22 +COLOR_BOTH_DARKGREEN = $44 +COLOR_BOTH_GREY = $55 +COLOR_BOTH_MEDIUMBLUE = $66 +COLOR_BOTH_LIGHTBLUE = $77 +COLOR_BOTH_BROWN = $88 +COLOR_BOTH_ORANGE = $99 +COLOR_BOTH_PINK = $BB +COLOR_BOTH_LIGHTGREEN = $CC +COLOR_BOTH_YELLOW = $DD +COLOR_BOTH_AQUA = $EE +COLOR_BOTH_WHITE = $FF +