c64: sillyness

This commit is contained in:
Vince Weaver 2021-01-25 19:18:54 -05:00
parent de9eb1d2fa
commit 666d2a6379
6 changed files with 247 additions and 0 deletions

11
graphics/hgr/c64/c64.bas Normal file
View File

@ -0,0 +1,11 @@
10 HGR2:HCOLOR=6:HPLOT 0,0:CALL-3082
20 POKE 232,0:POKE 233,3
30 FOR L=0 TO 34: READ B:POKE 768+L,B:NEXT L
35 ROT=0:SCALE=2:HCOLOR=7
40 FOR I=0 TO 8: READ Q:DRAW Q AT 1+I*8,8:NEXT I
90 END
100 DATA 5,0,12,0,14,0,19,0,24,0
101 DATA 30,0,2,0,63,36,45,5,0,63
102 DATA 36,45,54,0,36,55,60,54,6,0
103 DATA 59,36,173,6,0
500 DATA 1,1,2,3,4,4,3,5,3

158
graphics/hgr/c64/c64.s Normal file
View File

@ -0,0 +1,158 @@
; silly c64
; needs to be 146 bytes or less
; zero page locations
WHICH = $00
HGR_SHAPE = $1A
SEEDL = $4E
FRAME = $A4
OUR_ROT = $A5
RND_EXP = $C9
HGR_COLOR = $E4
HGR_PAGE = $E6
HGR_SCALE = $E7
HGR_ROTATION = $F9
SCALE = $FC
XPOS = $FD
YPOS = $FF
; Soft Switches
KEYPRESS = $C000
KEYRESET = $C010
SPEAKER = $C030
PAGE0 = $C054
PAGE1 = $C055
; ROM calls
RND = $EFAE
HGR2 = $F3D8
HCLR = $F3F2
HCLR_COLOR = $F3F4
HPOSN = $F411
DRAW0 = $F601
XDRAW0 = $F65D
TEXT = $FB36 ; Set text mode
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
dsr_demo:
;=========================================
; SETUP
;=========================================
jsr HGR2 ; set/clear HGR page1 to black
; Hi-res graphics, no text at bottom
; Y=0, A=$60 after this call
lda #$D5 ; color blue
jsr HCLR_COLOR
lda #2
sta HGR_SCALE
lda #0
sta WHICH
;=========================
; draw letters
;=========================
; LDA COLORTBL,X GET COLOR PATTERN
lda #$ff
sta HGR_COLOR
lda #8
sta YPOS
lda #23
sta XPOS
first_loop:
lda WHICH
tay
lda string,Y
clc
adc #<shape_table
sta shape_smc+1
lda #>shape_table
sta shape2_smc+1
jsr draw
inc WHICH
lda XPOS
clc
adc #8
sta XPOS
cmp #(28*8)+23
bne first_loop
end:
jmp end
draw:
; to call draw
; need to have co-ords set up with HPOSN
; rotate should be in A
; setup X and Y co-ords
ldy #0 ; XPOSH always 0 for us
ldx XPOS
lda YPOS
jsr HPOSN ; X= (y,x) Y=(a)
shape_smc:
ldx #<shape_table ; point to our shape
shape2_smc:
ldy #>shape_table ; code fits in one page so this doesn't change
rot_smc:
lda #0 ; set rotation
jmp DRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
shape_table:
.byte $3f,$24,$2d,$05,$00 ; C 0
.byte $3f,$24,$2d,$36,$00 ; O 1
.byte $24,$37,$3c,$36,$00 ; M 2
.byte $3b,$24,$ad,$06,$00 ; D 3
.byte $1f,$24,$35,$07,$00 ; R 4
.byte $3f,$2c,$27,$2d,$00 ; E 5
.byte $23,$24,$00,$00,$00 ; I 6
.byte $02,$00 ; space 7
;.byte $3b,$24,$ad,$06,$00 ; 4 8
;.byte $3f,$24,$2d,$05,$00 ; B 9
;.byte $3f,$24,$2d,$36,$00 ; A 10
;.byte $24,$37,$3c,$36,$00 ; S 11
;.byte $3b,$24,$ad,$06,$00 ; I 12
;.byte $3f,$24,$2d,$05,$00 ; Y 13
;.byte $3f,$24,$2d,$36,$00 ; * 14
;.byte $24,$37,$3c,$36,$00 ; * 15
string:
; * * * * C O M M O D O R E
.byte 10,10,10,10,35,0, 5,10,10, 5,15, 5,20,25,35
; 6 4 B A S I C * * * *
.byte 15,10,35,15,10,15,30,0, 35,10,10,10,10
;$3c,$2c,$3c,$3f,$36,$06,$00
;$3f,$27,$2c,$27,$2d,$05,$00

View File

@ -0,0 +1,65 @@
# Number of shapes
8
START
NDN
STOP
# C
START
LT LT
UP UP
RT RT RT
STOP
# O
START
LT LT
UP UP
RT RT
DN DN
STOP
# M
START
UP
UP
LT
DN
UP
LT
DN
DN
DN
STOP
# D
START
NLT
LT
UP
UP
RT
RT
NDN
DN
STOP
# R
START
LT
NLT
UP UP
RT
DN
LT
STOP
# E
START
LT LT
UP
RT LT
UP
RT RT
STOP
# I
START
NLT
UP
UP
UP
STOP

View File

@ -0,0 +1,11 @@
0POKE232,20:POKE233,8
1REM
2HGR2:HCOLOR=6:HPLOT0,0:CALL-3082:
3FORL=0TO 34:READB:POKE768+L,B:NEXT
4ROT=0:SCALE=2:HCOLOR=7
5FORI=0TO8:READQ:DRAWQAT1+I*8,8:NEXT
100 DATA 5,0,12,0,14,0,19,0,24,0
101 DATA 30,0,2,0,63,36,45,5,0,63
102 DATA 36,45,54,0,36,55,60,54,6,0
103 DATA 59,36,173,6,0
500 DATA 1,1,2,3,4,4,3,5,3

BIN
graphics/hgr/c64/empty.dsk Normal file

Binary file not shown.

View File

@ -0,0 +1,2 @@
5 HOME
10 PRINT CHR$(4);"CATALOG"