From fc09032b2636c352712a4cc4cb7e235835b74804 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 2 Jul 2021 00:15:50 -0400 Subject: [PATCH] gr: thinking: too hard --- graphics/gr/thinking/Makefile | 93 +++++++++- graphics/gr/thinking/t2.s | 81 +++++++++ graphics/gr/thinking/t3.s | 196 +++++++++++++++++++++ graphics/gr/thinking/thinking.s | 56 +++--- graphics/gr/thinking/thinking_attempt5.s | 199 ++++++++++++++++++++++ graphics/gr/thinking/thinking_attempt6.s | 206 +++++++++++++++++++++++ graphics/gr/thinking/thinking_boxes.s | 128 ++++++++++++++ graphics/gr/thinking/thinking_slow.s | 185 ++++++++++++++++++++ 8 files changed, 1112 insertions(+), 32 deletions(-) create mode 100644 graphics/gr/thinking/t2.s create mode 100644 graphics/gr/thinking/t3.s create mode 100644 graphics/gr/thinking/thinking_attempt5.s create mode 100644 graphics/gr/thinking/thinking_attempt6.s create mode 100644 graphics/gr/thinking/thinking_boxes.s create mode 100644 graphics/gr/thinking/thinking_slow.s diff --git a/graphics/gr/thinking/Makefile b/graphics/gr/thinking/Makefile index 36c15572..dcfe68ef 100644 --- a/graphics/gr/thinking/Makefile +++ b/graphics/gr/thinking/Makefile @@ -7,11 +7,22 @@ EMPTYDISK = ../../../empty_disk/empty.dsk all: thinking.dsk -thinking.dsk: HELLO THINKING RAINBOW_BOX +thinking.dsk: HELLO THINKING RAINBOW_BOX T2 THINKING_FLIP T3 THINKING_SLOW \ + THINKING_ATTEMPT2 THINKING_ATTEMPT3 THINKING_ATTEMPT4 THINKING_ATTEMPT5 \ + THINKING_ATTEMPT6 cp $(EMPTYDISK) thinking.dsk $(DOS33) -y thinking.dsk SAVE A HELLO $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING_FLIP + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING_SLOW + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING_ATTEMPT2 + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING_ATTEMPT3 + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING_ATTEMPT4 + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING_ATTEMPT5 + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 THINKING_ATTEMPT6 $(DOS33) -y thinking.dsk BSAVE -a 0xC00 RAINBOW_BOX + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 T2 + $(DOS33) -y thinking.dsk BSAVE -a 0xC00 T3 ### @@ -26,6 +37,67 @@ THINKING: thinking.o thinking.o: thinking.s ca65 -o thinking.o thinking.s -l thinking.lst + +### + +THINKING_FLIP: thinking_flip.o + ld65 -o THINKING_FLIP thinking_flip.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +thinking_flip.o: thinking_flip.s + ca65 -o thinking_flip.o thinking_flip.s -l thinking_flip.lst + +### + +THINKING_SLOW: thinking_slow.o + ld65 -o THINKING_SLOW thinking_slow.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +thinking_slow.o: thinking_slow.s + ca65 -o thinking_slow.o thinking_slow.s -l thinking_slow.lst + + +### + +THINKING_ATTEMPT2: thinking_attempt2.o + ld65 -o THINKING_ATTEMPT2 thinking_attempt2.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +thinking_attempt2.o: thinking_attempt2.s + ca65 -o thinking_attempt2.o thinking_attempt2.s -l thinking_attempt2.lst + +### + +THINKING_ATTEMPT3: thinking_attempt3.o + ld65 -o THINKING_ATTEMPT3 thinking_attempt3.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +thinking_attempt3.o: thinking_attempt3.s + ca65 -o thinking_attempt3.o thinking_attempt3.s -l thinking_attempt3.lst + +### + +THINKING_ATTEMPT4: thinking_attempt4.o + ld65 -o THINKING_ATTEMPT4 thinking_attempt4.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +thinking_attempt4.o: thinking_attempt4.s + ca65 -o thinking_attempt4.o thinking_attempt4.s -l thinking_attempt4.lst + + +### + +THINKING_ATTEMPT5: thinking_attempt5.o + ld65 -o THINKING_ATTEMPT5 thinking_attempt5.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +thinking_attempt5.o: thinking_attempt5.s + ca65 -o thinking_attempt5.o thinking_attempt5.s -l thinking_attempt5.lst + +### + +THINKING_ATTEMPT6: thinking_attempt6.o + ld65 -o THINKING_ATTEMPT6 thinking_attempt6.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +thinking_attempt6.o: thinking_attempt6.s + ca65 -o thinking_attempt6.o thinking_attempt6.s -l thinking_attempt6.lst + + + ### RAINBOW_BOX: rainbow_box.o @@ -36,5 +108,22 @@ rainbow_box.o: rainbow_box.s ### +T2: t2.o + ld65 -o T2 t2.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +t2.o: t2.s + ca65 -o t2.o t2.s -l t2.lst + +### + +T3: t3.o + ld65 -o T3 t3.o -C $(LINKERSCRIPTS)/apple2_c00.inc + +t3.o: t3.s + ca65 -o t3.o t3.s -l t3.lst + +### + clean: - rm -f *~ *.o *.lst HELLO THINKING RAINBOW_BOX + rm -f *~ *.o *.lst HELLO THINKING RAINBOW_BOX T2 THINKING_FLIP T3 THINKING_SLOW \ + THINKING_ATTEMPT2 THINKING_ATTEMPT3 THINKING_ATTEMPT4 THINKING_ATTEMPT5 THINKING_ATTEMPT6 diff --git a/graphics/gr/thinking/t2.s b/graphics/gr/thinking/t2.s new file mode 100644 index 00000000..d8938971 --- /dev/null +++ b/graphics/gr/thinking/t2.s @@ -0,0 +1,81 @@ +; nyan + +; by Vince `deater` Weaver / dSr + +; zero page + +H2 = $2C +COLOR = $30 +X0 = $F0 +XX = $F1 +FRAME = $F2 +Y1 = $F3 +Y0 = $F4 +X1 = $F5 + +; soft-switches +FULLGR = $C052 + +; ROM 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 +SETCOL = $F864 ;; COLOR=A +SETGR = $FB40 ;; init lores and clear screen +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us + + + + ;================================ + ; Clear screen and setup graphics + ;================================ +boxes: + + jsr SETGR ; set lo-res 40x40 mode + + lda #0 + sta COLOR + sta X0 ; X0 + tax + + lda #39 + sta H2 ; X1 + sta Y1 + +draw_box_loop: + + stx Y0 +inner_loop: + + ;; HLINE Y,H2 at A + ;; X left alone, carry set on exit + ;; H2 left alone + ;; Y and A trashed + + ldy X0 + txa + jsr HLINE ; y, H2 at A + + cpx Y1 + inx + bcc inner_loop + + + inc COLOR + + ldx Y0 + inx ; Y0 + inx + dec Y1 + dec Y1 + + inc X0 + dec H2 + + cpx #20 + bne draw_box_loop + + +end: + jmp end diff --git a/graphics/gr/thinking/t3.s b/graphics/gr/thinking/t3.s new file mode 100644 index 00000000..6ad57885 --- /dev/null +++ b/graphics/gr/thinking/t3.s @@ -0,0 +1,196 @@ +; Print-shop Style THINKING + +; by Vince `deater` Weaver + +.include "zp.inc" +.include "hardware.inc" + + +COL = $F0 +XSTART = $F1 +XSTOP = $F2 +YSTART = $F3 +YSTOP = $F4 +OFFSET = $F5 +CURRENT = $F6 +YY = $F7 +BASE = $F8 + +X0 = $F9 +Y1 = $FA +Y0 = $FB +X1 = $FC + + +thinking: + + jsr SETGR ; set lo-res 40x40 mode + ; A=$D0 afterward + +big_loop: + lda #1 + sta COLOR + + lda #0 + sta X0 ; X0 + tax + + lda #39 + sta H2 ; X1 + sta Y1 + +draw_box_loop: + + stx Y0 + + +inner_loop: + ;; HLINE Y,H2 at A + ;; X left alone, carry set on exit + ;; H2 left alone + ;; Y and A trashed + + ldy X0 + txa + jsr HLINE ; y, H2 at A + + cpx Y1 + inx + bcc inner_loop + + inc COLOR + + ldx Y0 + inx ; Y0 + inx + dec Y1 + dec Y1 + + inc X0 + dec H2 + + cpx #20 + bne draw_box_loop + + ;========================== + ; done drawing rainbow box + ;========================== + + ;========================== + ; write THINKING + ;========================== + +thinking_loop: + lda #7 ; YY + ldx #0 + +thinking_yloop: + sta YY ; YY in A here + +; lda YY + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + ldy #0 +inc_pointer: + inx + lda thinking_data-1,X + sta CURRENT +thinking_xloop: + ror CURRENT + bcc no_draw + + lda #$00 + sta (GBASL),Y +no_draw: + iny + tya + and #$7 + beq inc_pointer + + cpy #39 + bne thinking_xloop + + inc YY + lda YY + cmp #14 + bne thinking_yloop + + ;========================== + ; flip pages + ;========================== + bit PAGE2 +forever_loop: + + ldy #0 +copy_loop: + +c_smc1: + lda $400,Y + beq blah + clc + adc COL + and #$7 + tax + lda color_lookup,X +blah: +c_smc2: + sta $800,Y + iny + bne copy_loop + + inc c_smc1+2 + inc c_smc2+2 + lda c_smc1+2 + cmp #$08 + bne copy_loop + + sta c_smc2+2 + lsr + sta c_smc1+2 + + ;=================== + ; increment color + ; after loop we are +10 + ; so -1 actually means increment 1 (because we mod 8 it) + inc COL + + ;=================== + ; WAIT + + lda #255 + jsr WAIT ; A = 0 at end + + beq forever_loop + + +;0 1 2 3 3 +;01234567|89012345|67890123|45678901|23456789 +; ***** *| * * * | * * |* * * |* *** +; * *| * * **| * * *| * ** |* * * +; * *| * * **| * * * | * ** |* * +; * *|*** * * |* * ** | * * * |* * +; * *| * * * | ** * * | * * *|* * ** +; * *| * * * | ** * *| * * *|* * * +; * *| * * * | * * |* * * |* **** +; +; 7*5 bytes = 35 bytes + +thinking_data: +.byte $BE,$54,$14,$15,$39 +.byte $88,$D4,$94,$34,$45 +.byte $88,$D4,$54,$34,$05 +.byte $88,$57,$35,$54,$05 +.byte $88,$54,$56,$94,$65 +.byte $88,$54,$96,$94,$45 +.byte $88,$54,$14,$15,$79 + + + +color_lookup: + ; magenta, pink, orange, yellow, lgreen, aqua, mblue, lblue +.byte $33,$BB,$99,$DD,$CC,$EE,$66,$77 + + + ; for apple II bot entry at $3F5 + + jmp thinking diff --git a/graphics/gr/thinking/thinking.s b/graphics/gr/thinking/thinking.s index 55a62cc2..d290858f 100644 --- a/graphics/gr/thinking/thinking.s +++ b/graphics/gr/thinking/thinking.s @@ -2,13 +2,11 @@ ; by Vince `deater` Weaver +; 158 bytes -- blargh + .include "zp.inc" .include "hardware.inc" -; 161 -- original with page flip removed -; 159 -- remove extraneous store to YY -; 158 -- cond jump for jmp - COL = $F0 XSTART = $F1 XSTOP = $F2 @@ -17,6 +15,8 @@ YSTOP = $F4 OFFSET = $F5 CURRENT = $F6 YY = $F7 +BLARGH = $F8 +BLARGHH = $F9 thinking: @@ -27,6 +27,10 @@ big_loop: ; COL value doesn't matter? + ; 0,0 to 39,39 + ; 1,2 to 38,37 + + lda #0 sta YSTART sta XSTART @@ -41,22 +45,26 @@ box_loop: ldx YSTART yloop: txa - jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) - -.if 0 + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H +; ; ( a trashed, C clear) + lda GBASL + sta BLARGH lda GBASH -draw_page_smc: - adc #0 - sta GBASH -.endif + clc + adc #4 + sta BLARGHH + lda COL and #$7 tay lda color_lookup,Y + sta COLOR ldy XSTART xloop: + lda COLOR + and (BLARGH),Y sta (GBASL),Y iny cpy XSTOP @@ -84,14 +92,13 @@ xloop: ;========================== ; write THINKING ;========================== - +.if 0 thinking_loop: - lda #7 ; YY + lda #7 ldx #0 thinking_yloop: - sta YY ; YY in A here - + sta YY ; lda YY jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) @@ -119,23 +126,11 @@ no_draw: lda YY cmp #14 bne thinking_yloop - +.endif ;========================== ; flip pages ;========================== -.if 0 -flip_pages: - ldy #1 - lda draw_page_smc+1 ; DRAW_PAGE - bne done_page - dey -done_page: - ldx PAGE1,Y ; set display page to PAGE1 or PAGE2 - - eor #$4 ; flip draw page between $400/$800 - sta draw_page_smc+1 ; DRAW_PAGE -.endif @@ -145,11 +140,12 @@ done_page: ; so -1 actually means increment 1 (because we mod 8 it) dec COL + ;=================== - ; WAIT + ; wait lda #255 - jsr WAIT ; A = 0 at end + jsr WAIT beq big_loop diff --git a/graphics/gr/thinking/thinking_attempt5.s b/graphics/gr/thinking/thinking_attempt5.s new file mode 100644 index 00000000..6b74725f --- /dev/null +++ b/graphics/gr/thinking/thinking_attempt5.s @@ -0,0 +1,199 @@ +; Print-shop Style THINKING + +; by Vince `deater` Weaver + +.include "zp.inc" +.include "hardware.inc" + +; 161 -- original with page flip removed +; 159 -- remove extraneous store to YY +; 158 -- cond jump for jmp + +; 0------------------------- +; 0 1111111111111111111111 0 +; 0 1 22222222222222222221 0 + +; if XX < YY COL++ + + +COL = $F0 +XSTART = $F1 +XSTOP = $F2 +YSTART = $F3 +YSTOP = $F4 +OFFSET = $F5 +CURRENT = $F6 +YY = $F7 +BASE = $F8 + +thinking: + + jsr SETGR ; set lo-res 40x40 mode + ; A=$D0 afterward + +big_loop: + + ldx #19 +yloop: + txa + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + lda COL + and #$7 + tay + lda color_lookup,Y + + + ldy #39 +xloop: + sta (GBASL),Y + dey + bpl xloop + + inc COL + + dex + bne yloop + + + +.if 0 + ; COL value doesn't matter? + + lda #0 + sta YSTART + sta XSTART + + lda #20 + sta YSTOP + asl + sta XSTOP + +box_loop: + + ldx YSTART +yloop: + txa + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + lda COL + and #$7 + tay + lda color_lookup,Y + + ldy XSTART +xloop: + sta (GBASL),Y + iny + cpy XSTOP + bne xloop + + inx + cpx YSTOP + bne yloop + + inc COL + + inc XSTART + dec XSTOP + + inc YSTART + dec YSTOP + lda YSTOP + cmp #10 + bne box_loop +.endif + ;========================== + ; done drawing rainbow box + ;========================== + + ;========================== + ; write THINKING + ;========================== + +thinking_loop: + lda #7 ; YY + ldx #0 + +thinking_yloop: + sta YY ; YY in A here + +; lda YY + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + ldy #0 +inc_pointer: + inx + lda thinking_data-1,X + sta CURRENT +thinking_xloop: + ror CURRENT + bcc no_draw + + lda #$00 + sta (GBASL),Y +no_draw: + iny + tya + and #$7 + beq inc_pointer + + cpy #39 + bne thinking_xloop + + inc YY + lda YY + cmp #14 + bne thinking_yloop + + ;========================== + ; flip pages + ;========================== + + + ;=================== + ; increment color + ; after loop we are +10 + ; so -1 actually means increment 1 (because we mod 8 it) + dec COL + + ;=================== + ; WAIT + + lda #255 + jsr WAIT ; A = 0 at end + + beq big_loop + + +;0 1 2 3 3 +;01234567|89012345|67890123|45678901|23456789 +; ***** *| * * * | * * |* * * |* *** +; * *| * * **| * * *| * ** |* * * +; * *| * * **| * * * | * ** |* * +; * *|*** * * |* * ** | * * * |* * +; * *| * * * | ** * * | * * *|* * ** +; * *| * * * | ** * *| * * *|* * * +; * *| * * * | * * |* * * |* **** +; +; 7*5 bytes = 35 bytes + +thinking_data: +.byte $BE,$54,$14,$15,$39 +.byte $88,$D4,$94,$34,$45 +.byte $88,$D4,$54,$34,$05 +.byte $88,$57,$35,$54,$05 +.byte $88,$54,$56,$94,$65 +.byte $88,$54,$96,$94,$45 +.byte $88,$54,$14,$15,$79 + + + +color_lookup: + ; magenta, pink, orange, yellow, lgreen, aqua, mblue, lblue +.byte $33,$BB,$99,$DD,$CC,$EE,$66,$77 + + + ; for apple II bot entry at $3F5 + + jmp thinking diff --git a/graphics/gr/thinking/thinking_attempt6.s b/graphics/gr/thinking/thinking_attempt6.s new file mode 100644 index 00000000..27cf4258 --- /dev/null +++ b/graphics/gr/thinking/thinking_attempt6.s @@ -0,0 +1,206 @@ +; Print-shop Style THINKING + +; by Vince `deater` Weaver + +.include "zp.inc" +.include "hardware.inc" + +; 161 -- original with page flip removed +; 159 -- remove extraneous store to YY +; 158 -- cond jump for jmp + +; 0------------------------- +; 0 1111111111111111111111 0 +; 0 1 22222222222222222221 0 + +; if XX < YY COL++ + + +COL = $F0 +XSTART = $F1 +XSTOP = $F2 +YSTART = $F3 +YSTOP = $F4 +OFFSET = $F5 +CURRENT = $F6 +YY = $F7 +BASE = $F8 + +thinking: + + jsr SETGR ; set lo-res 40x40 mode + ; A=$D0 afterward + +big_loop: + + ldx #19 +yloop: + txa + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + lda COL + and #$7 + tay + lda color_lookup,Y + + + ldy #39 +xloop: + sta (GBASL),Y + dey + bpl xloop + + cpx #10 + beq blarch + bcc blurgh + inc COL + jmp blarch +blurgh: + dec COL +blarch: + dex + bpl yloop + + + +.if 0 + ; COL value doesn't matter? + + lda #0 + sta YSTART + sta XSTART + + lda #20 + sta YSTOP + asl + sta XSTOP + +box_loop: + + ldx YSTART +yloop: + txa + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + lda COL + and #$7 + tay + lda color_lookup,Y + + ldy XSTART +xloop: + sta (GBASL),Y + iny + cpy XSTOP + bne xloop + + inx + cpx YSTOP + bne yloop + + inc COL + + inc XSTART + dec XSTOP + + inc YSTART + dec YSTOP + lda YSTOP + cmp #10 + bne box_loop +.endif + ;========================== + ; done drawing rainbow box + ;========================== + + ;========================== + ; write THINKING + ;========================== + +thinking_loop: + lda #7 ; YY + ldx #0 + +thinking_yloop: + sta YY ; YY in A here + +; lda YY + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + ldy #0 +inc_pointer: + inx + lda thinking_data-1,X + sta CURRENT +thinking_xloop: + ror CURRENT + bcc no_draw + + lda #$00 + sta (GBASL),Y +no_draw: + iny + tya + and #$7 + beq inc_pointer + + cpy #39 + bne thinking_xloop + + inc YY + lda YY + cmp #14 + bne thinking_yloop + + ;========================== + ; flip pages + ;========================== + + + ;=================== + ; increment color + ; after loop we are +10 + ; so -1 actually means increment 1 (because we mod 8 it) + inc COL + inc COL + + ;=================== + ; WAIT + + lda #255 + jsr WAIT ; A = 0 at end + + beq big_loop + + +;0 1 2 3 3 +;01234567|89012345|67890123|45678901|23456789 +; ***** *| * * * | * * |* * * |* *** +; * *| * * **| * * *| * ** |* * * +; * *| * * **| * * * | * ** |* * +; * *|*** * * |* * ** | * * * |* * +; * *| * * * | ** * * | * * *|* * ** +; * *| * * * | ** * *| * * *|* * * +; * *| * * * | * * |* * * |* **** +; +; 7*5 bytes = 35 bytes + +thinking_data: +.byte $BE,$54,$14,$15,$39 +.byte $88,$D4,$94,$34,$45 +.byte $88,$D4,$54,$34,$05 +.byte $88,$57,$35,$54,$05 +.byte $88,$54,$56,$94,$65 +.byte $88,$54,$96,$94,$45 +.byte $88,$54,$14,$15,$79 + + + +color_lookup: + ; magenta, pink, orange, yellow, lgreen, aqua, mblue, lblue +.byte $33,$BB,$99,$DD,$CC,$EE,$66,$77 + + + ; for apple II bot entry at $3F5 + + jmp thinking diff --git a/graphics/gr/thinking/thinking_boxes.s b/graphics/gr/thinking/thinking_boxes.s new file mode 100644 index 00000000..f5864ac7 --- /dev/null +++ b/graphics/gr/thinking/thinking_boxes.s @@ -0,0 +1,128 @@ +; nyan + +; by Vince `deater` Weaver / dSr + +; zero page + +H2 = $2C +COLOR = $30 +X0 = $F0 +XX = $F1 +FRAME = $F2 +Y1 = $F3 + +; soft-switches +FULLGR = $C052 + +; ROM 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 +SETCOL = $F864 ;; COLOR=A +SETGR = $FB40 ;; init lores and clear screen +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us + + + +;1DEFFNP(X)=PEEK(2054+I*5+X)-32: +;GR:POKE49234,0: +;FORI=0TO29:COLOR=FNP(0):FORY=FNP(3)TOFNP(4) +;:HLINFNP(1),FNP(2)ATY:NEXTY,I:GETA + + + ;================================ + ; Clear screen and setup graphics + ;================================ +boxes: + + jsr SETGR ; set lo-res 40x40 mode + +draw_box_loop: + + ; get color/Y0 + jsr load_byte + tax ; Y0 is in X + + tya ; check for end + + bmi end + + + jsr load_byte ; Y1 + sta Y1 + + jsr load_byte ; X0 + sta X0 + + tya + lsr + lsr + sta COLOR + + + jsr load_byte ; X1 + sta H2 + + tya + and #$C0 + ora COLOR + + lsr + lsr + lsr + lsr + + jsr SETCOL + + +inner_loop: + + ;; HLINE Y,H2 at A + ;; X left alone, carry set on exit + ;; H2 left alone + ;; Y and A trashed + + ldy X0 + txa + jsr HLINE + + cpx Y1 + inx + bcc inner_loop + bcs draw_box_loop + + +end: + jmp end + + + ;========================= + ; load byte routine + ;========================= + +load_byte: + inc load_byte_smc+1 ; assume we are always < 256 bytes + ; so no need to wrap +load_byte_smc: + lda box_data-1 + tay + and #$3f + rts + + + ; 4 6 6 6 6 +box_data: +.byte $00,$27,$40,$27 + .byte $02,$25,$81,$26 + .byte $04,$23,$C2,$25 + .byte $06,$21,$03,$64 + .byte $08,$1F,$44,$63 + .byte $0A,$1D,$85,$62 + .byte $0C,$1B,$C6,$61 + .byte $0E,$19,$07,$A0 + .byte $10,$17,$48,$1F + .byte $12,$15,$89,$1E + .byte $12,$15,$89,$1E + .byte $12,$15,$89,$1E + .byte $FF diff --git a/graphics/gr/thinking/thinking_slow.s b/graphics/gr/thinking/thinking_slow.s new file mode 100644 index 00000000..b135bbfc --- /dev/null +++ b/graphics/gr/thinking/thinking_slow.s @@ -0,0 +1,185 @@ +; Print-shop Style THINKING + +; by Vince `deater` Weaver + +.include "zp.inc" +.include "hardware.inc" + +; 161 -- original with page flip removed +; 159 -- remove extraneous store to YY +; 158 -- cond jump for jmp + +; 0------------------------- +; 0 1111111111111111111111 0 +; 0 1 22222222222222222221 0 + +; if XX < YY COL++ + + +COL = $F0 +XSTART = $F1 +XSTOP = $F2 +YSTART = $F3 +YSTOP = $F4 +OFFSET = $F5 +CURRENT = $F6 +YY = $F7 +BASE = $F8 + +X0 = $F9 +Y1 = $FA +Y0 = $FB +X1 = $FC + + +thinking: + + jsr SETGR ; set lo-res 40x40 mode + ; A=$D0 afterward + +big_loop: + + lda #0 +; sta COLOR + sta X0 ; X0 + tax + + lda #39 + sta H2 ; X1 + sta Y1 + +draw_box_loop: + + stx Y0 + + lda COL + and #$7 + tay + lda color_lookup,Y + + sta COLOR + +inner_loop: + ;; HLINE Y,H2 at A + ;; X left alone, carry set on exit + ;; H2 left alone + ;; Y and A trashed + + ldy X0 + txa + jsr HLINE ; y, H2 at A + + cpx Y1 + inx + bcc inner_loop + + inc COL + + ldx Y0 + inx ; Y0 + inx + dec Y1 + dec Y1 + + inc X0 + dec H2 + + cpx #20 + bne draw_box_loop + + + + ;========================== + ; done drawing rainbow box + ;========================== + + ;========================== + ; write THINKING + ;========================== + +thinking_loop: + lda #7 ; YY + ldx #0 + +thinking_yloop: + sta YY ; YY in A here + +; lda YY + jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear) + + ldy #0 +inc_pointer: + inx + lda thinking_data-1,X + sta CURRENT +thinking_xloop: + ror CURRENT + bcc no_draw + + lda #$00 + sta (GBASL),Y +no_draw: + iny + tya + and #$7 + beq inc_pointer + + cpy #39 + bne thinking_xloop + + inc YY + lda YY + cmp #14 + bne thinking_yloop + + ;========================== + ; flip pages + ;========================== + + + ;=================== + ; increment color + ; after loop we are +10 + ; so -1 actually means increment 1 (because we mod 8 it) + dec COL + + ;=================== + ; WAIT + + lda #255 + jsr WAIT ; A = 0 at end + + beq big_loop + + +;0 1 2 3 3 +;01234567|89012345|67890123|45678901|23456789 +; ***** *| * * * | * * |* * * |* *** +; * *| * * **| * * *| * ** |* * * +; * *| * * **| * * * | * ** |* * +; * *|*** * * |* * ** | * * * |* * +; * *| * * * | ** * * | * * *|* * ** +; * *| * * * | ** * *| * * *|* * * +; * *| * * * | * * |* * * |* **** +; +; 7*5 bytes = 35 bytes + +thinking_data: +.byte $BE,$54,$14,$15,$39 +.byte $88,$D4,$94,$34,$45 +.byte $88,$D4,$54,$34,$05 +.byte $88,$57,$35,$54,$05 +.byte $88,$54,$56,$94,$65 +.byte $88,$54,$96,$94,$45 +.byte $88,$54,$14,$15,$79 + + + +color_lookup: + ; magenta, pink, orange, yellow, lgreen, aqua, mblue, lblue +.byte $33,$BB,$99,$DD,$CC,$EE,$66,$77 + + + ; for apple II bot entry at $3F5 + + jmp thinking