2021-07-01 17:41:26 +00:00
|
|
|
; Print-shop Style THINKING
|
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
; without pageflip
|
|
|
|
|
2021-07-01 17:41:26 +00:00
|
|
|
; by Vince `deater` Weaver <vince@deater.net>
|
|
|
|
|
|
|
|
.include "zp.inc"
|
|
|
|
.include "hardware.inc"
|
|
|
|
|
2021-07-02 05:20:34 +00:00
|
|
|
|
2021-07-01 17:41:26 +00:00
|
|
|
COL = $F0
|
|
|
|
XSTART = $F1
|
|
|
|
XSTOP = $F2
|
|
|
|
YSTART = $F3
|
|
|
|
YSTOP = $F4
|
2021-07-01 21:21:19 +00:00
|
|
|
OFFSET = $F5
|
2021-07-03 17:24:35 +00:00
|
|
|
CURRENT_BITMAP = $F6
|
2021-07-03 16:07:54 +00:00
|
|
|
BITMAP_PTR = $F7
|
2021-07-02 05:20:34 +00:00
|
|
|
BASE = $F8
|
2021-07-03 16:07:54 +00:00
|
|
|
XSAVE = $F9
|
2021-07-03 16:55:44 +00:00
|
|
|
SAVED_YY= $F9
|
2021-07-03 16:07:54 +00:00
|
|
|
YSAVE = $FA
|
2021-07-03 16:55:44 +00:00
|
|
|
SAVED_XX= $FA
|
2021-07-03 17:24:35 +00:00
|
|
|
|
|
|
|
|
2021-07-01 17:41:26 +00:00
|
|
|
thinking:
|
|
|
|
|
|
|
|
jsr SETGR ; set lo-res 40x40 mode
|
|
|
|
; A=$D0 afterward
|
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
lda #0
|
|
|
|
sta COL ; consistent starting color
|
|
|
|
; not technically needed
|
2021-07-01 17:41:26 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
print_thinking_loop:
|
2021-07-01 17:41:26 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
jsr print_thinking_frame
|
2021-07-01 17:57:10 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
;===================
|
|
|
|
; WAIT
|
2021-07-01 17:41:26 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
lda #255
|
|
|
|
jsr WAIT ; A = 0 at end
|
2021-07-01 17:41:26 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
beq print_thinking_loop
|
2021-07-01 17:41:26 +00:00
|
|
|
|
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
;=============================
|
|
|
|
; print thinking
|
|
|
|
;=============================
|
|
|
|
|
|
|
|
print_thinking_frame:
|
|
|
|
|
|
|
|
ldx #0 ; reset YY to 0
|
|
|
|
stx BITMAP_PTR ; also reset bitmap pointer to 0
|
|
|
|
|
|
|
|
yloop:
|
|
|
|
txa ; load YY
|
|
|
|
jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H
|
|
|
|
|
|
|
|
;=======================
|
|
|
|
|
|
|
|
ldy #0 ; reset XX to 0
|
|
|
|
xloop:
|
2021-07-03 16:07:54 +00:00
|
|
|
|
|
|
|
; this is only jumped to every 8th XX
|
2021-07-02 05:20:34 +00:00
|
|
|
inc_pointer:
|
2021-07-03 16:07:54 +00:00
|
|
|
inc BITMAP_PTR
|
2021-07-01 17:41:26 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
; load current bitmap ptr into CURRENT_BITMAP
|
|
|
|
; is a don't care if not between 7 and 14
|
|
|
|
|
2021-07-03 16:55:44 +00:00
|
|
|
stx XSAVE
|
2021-07-03 16:07:54 +00:00
|
|
|
ldx BITMAP_PTR
|
2021-07-02 05:20:34 +00:00
|
|
|
lda thinking_data-1-35,X
|
2021-07-03 17:24:35 +00:00
|
|
|
sta CURRENT_BITMAP
|
2021-07-03 16:55:44 +00:00
|
|
|
ldx XSAVE
|
|
|
|
|
2021-07-01 21:21:19 +00:00
|
|
|
thinking_xloop:
|
2021-07-03 16:07:54 +00:00
|
|
|
; this is called every XX
|
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
stx XSAVE ; save X (YY)
|
2021-07-03 16:55:44 +00:00
|
|
|
sty YSAVE ; save Y (XX)
|
2021-07-03 16:07:54 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
; if YY <7 or YY > 14 then don't draw bitmap
|
2021-07-03 16:55:44 +00:00
|
|
|
cpx #7
|
2021-07-03 17:24:35 +00:00
|
|
|
bcc do_plot
|
2021-07-03 16:55:44 +00:00
|
|
|
cpx #14
|
2021-07-03 17:24:35 +00:00
|
|
|
bcs do_plot
|
2021-07-03 16:07:54 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
handle_bitmap:
|
|
|
|
ror CURRENT_BITMAP ; rotate next bit from bitmap in
|
|
|
|
bcs skip_plot ; skip plotting (assume BG is black)
|
|
|
|
|
|
|
|
do_plot:
|
2021-07-02 05:20:34 +00:00
|
|
|
|
2021-07-03 16:07:54 +00:00
|
|
|
lda COL ; set starting color
|
|
|
|
and #$7
|
|
|
|
tay
|
2021-07-03 17:24:35 +00:00
|
|
|
lda color_lookup,Y ; lookup color in table
|
|
|
|
|
2021-07-03 16:55:44 +00:00
|
|
|
ldy YSAVE ; restore Y (XX)
|
2021-07-01 21:21:19 +00:00
|
|
|
sta (GBASL),Y
|
2021-07-03 17:24:35 +00:00
|
|
|
|
|
|
|
skip_plot:
|
|
|
|
|
2021-07-03 16:55:44 +00:00
|
|
|
|
|
|
|
;==================================
|
|
|
|
; adjust colors to make boxes
|
|
|
|
|
|
|
|
; 0000000000000000
|
|
|
|
; 0111111111111110
|
|
|
|
; 0122222222222210
|
|
|
|
|
|
|
|
; XX is in Y (currently also in YSAVE)
|
|
|
|
; YY is in X (currently also in XSAVE)
|
|
|
|
|
|
|
|
|
|
|
|
ldx SAVED_YY ; YY
|
|
|
|
ldy SAVED_XX ; XX
|
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
cpx #10
|
|
|
|
bcc counting_up
|
|
|
|
|
|
|
|
counting_down:
|
|
|
|
|
|
|
|
; cpy #30 ; is XX < 10
|
|
|
|
; bcc color_adjust_up ; then potentially adjust UP
|
|
|
|
; cpy #10 ; is XX > 30
|
|
|
|
; bcs color_adjust_down ; then potentially adjust down
|
|
|
|
; bcc color_adjust_none ; else, do nothing
|
|
|
|
|
|
|
|
|
|
|
|
counting_up:
|
|
|
|
; if YY is < 10 do following, otherwise reverse
|
|
|
|
|
|
|
|
; if XX is < 10, check for inc
|
|
|
|
; if XX is > 30 check for dex
|
|
|
|
; else, no adjust
|
|
|
|
|
2021-07-03 16:55:44 +00:00
|
|
|
cpy #10 ; is XX < 10
|
|
|
|
bcc color_adjust_up ; then potentially adjust UP
|
|
|
|
cpy #30 ; is XX > 30
|
|
|
|
bcs color_adjust_down ; then potentially adjust down
|
|
|
|
bcc color_adjust_none ; else, do nothing
|
|
|
|
|
|
|
|
|
|
|
|
color_adjust_up:
|
|
|
|
|
|
|
|
; if XX < YY then inc color
|
|
|
|
; if XX >= YY then do nothing
|
|
|
|
|
|
|
|
cpy SAVED_YY ; compare XX to YY
|
|
|
|
bcs col_same ; bge do nothing
|
|
|
|
|
|
|
|
col_inc:
|
|
|
|
inc COL
|
|
|
|
col_same:
|
|
|
|
|
|
|
|
jmp color_adjust_none
|
|
|
|
|
|
|
|
color_adjust_down:
|
|
|
|
|
|
|
|
lda #39
|
|
|
|
sec
|
|
|
|
sbc XSAVE
|
|
|
|
sta XSAVE
|
|
|
|
|
|
|
|
cpy XSAVE ; compare XX to YY
|
|
|
|
|
|
|
|
; if XX > 39-YY then inc color
|
|
|
|
bcc col_down_same
|
|
|
|
|
|
|
|
col_dec:
|
|
|
|
dec COL
|
|
|
|
col_down_same:
|
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
; ldy YSAVE
|
2021-07-03 16:55:44 +00:00
|
|
|
|
|
|
|
; fallthrough
|
|
|
|
|
|
|
|
color_adjust_none:
|
|
|
|
|
|
|
|
;============================
|
|
|
|
; inc XX for next pixel
|
2021-07-02 05:20:34 +00:00
|
|
|
|
2021-07-01 21:21:19 +00:00
|
|
|
iny
|
2021-07-02 05:20:34 +00:00
|
|
|
|
|
|
|
cpy #40
|
|
|
|
beq done_done
|
|
|
|
|
2021-07-01 21:21:19 +00:00
|
|
|
tya
|
|
|
|
and #$7
|
|
|
|
beq inc_pointer
|
|
|
|
bne thinking_xloop
|
2021-07-02 05:20:34 +00:00
|
|
|
done_done:
|
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
;=============================================
|
|
|
|
; reverse the colors on bottom half of screen
|
2021-07-02 05:20:34 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
cpx #9
|
|
|
|
beq blarch
|
|
|
|
bcc blurgh
|
|
|
|
dec COL
|
|
|
|
jmp blarch
|
|
|
|
blurgh:
|
|
|
|
inc COL
|
|
|
|
blarch:
|
2021-07-03 16:55:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
;=======================
|
|
|
|
; move to next line
|
|
|
|
|
2021-07-02 05:20:34 +00:00
|
|
|
inx
|
|
|
|
cpx #20
|
2021-07-03 17:24:35 +00:00
|
|
|
beq done_yloop
|
2021-07-02 05:20:34 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
jmp yloop
|
|
|
|
done_yloop:
|
2021-07-01 21:21:19 +00:00
|
|
|
|
|
|
|
;==========================
|
2021-07-02 05:20:34 +00:00
|
|
|
; done drawing rainbow box
|
2021-07-01 21:21:19 +00:00
|
|
|
;==========================
|
2021-07-01 17:57:10 +00:00
|
|
|
|
2021-07-02 05:20:34 +00:00
|
|
|
;==========================
|
|
|
|
; flip pages
|
|
|
|
;==========================
|
2021-07-01 17:57:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
;===================
|
|
|
|
; 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
|
2021-07-01 17:57:10 +00:00
|
|
|
dec COL
|
2021-07-02 04:15:50 +00:00
|
|
|
|
2021-07-01 17:41:26 +00:00
|
|
|
|
2021-07-01 21:21:19 +00:00
|
|
|
|
2021-07-03 17:24:35 +00:00
|
|
|
rts
|
2021-07-01 17:41:26 +00:00
|
|
|
|
2021-07-01 21:21:19 +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
|
|
|
|
|
2021-07-01 21:21:19 +00:00
|
|
|
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
|