dos33fsprogs/graphics/gr/thinking/thinking.s

174 lines
2.4 KiB
ArmAsm
Raw Normal View History

2021-07-01 17:41:26 +00:00
; Print-shop Style THINKING
; by Vince `deater` Weaver <vince@deater.net>
.include "zp.inc"
.include "hardware.inc"
2021-07-02 05:20:34 +00:00
; 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++
2021-07-01 17:41:26 +00:00
COL = $F0
XSTART = $F1
XSTOP = $F2
YSTART = $F3
YSTOP = $F4
OFFSET = $F5
CURRENT = $F6
YY = $F7
2021-07-02 05:20:34 +00:00
BASE = $F8
XS = $F9
2021-07-01 17:41:26 +00:00
thinking:
jsr SETGR ; set lo-res 40x40 mode
; A=$D0 afterward
big_loop:
2021-07-01 17:41:26 +00:00
lda #0
2021-07-02 05:20:34 +00:00
sta YY
2021-07-01 17:41:26 +00:00
2021-07-02 05:20:34 +00:00
ldx #0
2021-07-01 17:41:26 +00:00
yloop:
txa
2021-07-02 05:20:34 +00:00
jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear)
2021-07-01 17:41:26 +00:00
lda COL
and #$7
tay
lda color_lookup,Y
2021-07-02 04:15:50 +00:00
sta COLOR
2021-07-01 17:41:26 +00:00
2021-07-02 05:20:34 +00:00
;=======================
2021-07-01 17:41:26 +00:00
2021-07-02 05:20:34 +00:00
ldy #0
xloop:
2021-07-01 17:41:26 +00:00
2021-07-02 05:20:34 +00:00
inc_pointer:
inc YY
stx XS
2021-07-01 17:41:26 +00:00
2021-07-02 05:20:34 +00:00
; skip if out of range
cpx #7
bcc draw_color
cpx #14
bcs draw_color
2021-07-01 17:41:26 +00:00
2021-07-02 05:20:34 +00:00
ldx YY
lda thinking_data-1-35,X
sta CURRENT
thinking_xloop:
ror CURRENT
2021-07-02 05:20:34 +00:00
bcs skip_color
2021-07-02 05:20:34 +00:00
draw_color:
lda COLOR
sta (GBASL),Y
2021-07-02 05:20:34 +00:00
skip_color:
no_draw:
2021-07-02 05:20:34 +00:00
ldx XS
iny
2021-07-02 05:20:34 +00:00
cpy #40
beq done_done
tya
and #$7
beq inc_pointer
bne thinking_xloop
2021-07-02 05:20:34 +00:00
done_done:
;=======================
cpx #9
beq blarch
bcc blurgh
inc COL
jmp blarch
blurgh:
dec COL
blarch:
inx
cpx #20
bne yloop
;==========================
2021-07-02 05:20:34 +00:00
; done drawing rainbow box
;==========================
2021-07-02 05:20:34 +00:00
;==========================
; flip pages
;==========================
;===================
; increment color
; after loop we are +10
; so -1 actually means increment 1 (because we mod 8 it)
2021-07-02 05:20:34 +00:00
; inc COL
; inc COL
dec COL
dec COL
2021-07-02 04:15:50 +00:00
;===================
2021-07-02 05:20:34 +00:00
; WAIT
2021-07-01 17:41:26 +00:00
lda #255
2021-07-02 05:20:34 +00:00
jsr WAIT ; A = 0 at end
beq big_loop
2021-07-01 17:41:26 +00:00
;0 1 2 3 3
;01234567|89012345|67890123|45678901|23456789
; ***** *| * * * | * * |* * * |* ***
; * *| * * **| * * *| * ** |* * *
; * *| * * **| * * * | * ** |* *
; * *|*** * * |* * ** | * * * |* *
; * *| * * * | ** * * | * * *|* * **
; * *| * * * | ** * *| * * *|* * *
; * *| * * * | * * |* * * |* ****
2021-07-01 17:41:26 +00:00
;
; 7*5 bytes = 35 bytes
2021-07-02 05:20:34 +00:00
color_lookup:
; magenta, pink, orange, yellow, lgreen, aqua, mblue, lblue
.byte $33,$BB,$99,$DD,$CC,$EE,$66,$77
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
2021-07-01 17:41:26 +00:00
2021-07-02 05:20:34 +00:00
; for apple II bot entry at $3F5
2021-07-02 05:20:34 +00:00
; at +8A, so 36B
jmp thinking