mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-13 22:30:49 +00:00
sier: messing with sierpinski
This commit is contained in:
parent
0d21630641
commit
de91828502
30
graphics/gr/sier/Makefile
Normal file
30
graphics/gr/sier/Makefile
Normal file
@ -0,0 +1,30 @@
|
||||
include ../../../Makefile.inc
|
||||
|
||||
DOS33 = ../../../utils/dos33fs-utils/dos33
|
||||
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
|
||||
LINKERSCRIPTS = ../../../linker_scripts
|
||||
|
||||
all: sier.dsk
|
||||
|
||||
sier.dsk: HELLO SIER
|
||||
cp empty.dsk sier.dsk
|
||||
$(DOS33) -y sier.dsk SAVE A HELLO
|
||||
$(DOS33) -y sier.dsk BSAVE -a 0x300 SIER
|
||||
|
||||
###
|
||||
|
||||
HELLO: hello.bas
|
||||
$(TOKENIZE) < hello.bas > HELLO
|
||||
|
||||
###
|
||||
|
||||
SIER: sier.o
|
||||
ld65 -o SIER sier.o -C $(LINKERSCRIPTS)/apple2_300.inc
|
||||
|
||||
sier.o: sier.s
|
||||
ca65 -o sier.o sier.s -l sier.lst
|
||||
|
||||
###
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.lst HELLO SIER
|
BIN
graphics/gr/sier/empty.dsk
Normal file
BIN
graphics/gr/sier/empty.dsk
Normal file
Binary file not shown.
103
graphics/gr/sier/hardware.inc
Normal file
103
graphics/gr/sier/hardware.inc
Normal file
@ -0,0 +1,103 @@
|
||||
;; 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
|
||||
|
||||
;; 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
|
||||
|
2
graphics/gr/sier/hello.bas
Normal file
2
graphics/gr/sier/hello.bas
Normal file
@ -0,0 +1,2 @@
|
||||
5 HOME
|
||||
10 PRINT CHR$(4);"CATALOG"
|
56
graphics/gr/sier/sier.s
Normal file
56
graphics/gr/sier/sier.s
Normal file
@ -0,0 +1,56 @@
|
||||
; fake sierpinski
|
||||
|
||||
; just plot X AND Y
|
||||
|
||||
.include "zp.inc"
|
||||
.include "hardware.inc"
|
||||
|
||||
;================================
|
||||
; Clear screen and setup graphics
|
||||
;================================
|
||||
sier:
|
||||
|
||||
jsr SETGR ; set lo-res 40x40 mode
|
||||
bit FULLGR ; make it 40x48
|
||||
|
||||
|
||||
lda #39*2
|
||||
sta XX
|
||||
|
||||
sier_xloop:
|
||||
|
||||
lda #47*2
|
||||
sta YY
|
||||
sier_yloop:
|
||||
|
||||
lda YY
|
||||
and XX
|
||||
and #$FE
|
||||
beq red
|
||||
|
||||
black:
|
||||
lda #00
|
||||
beq do_color
|
||||
|
||||
red:
|
||||
lda #$11
|
||||
do_color:
|
||||
sta COLOR
|
||||
|
||||
lda XX
|
||||
lsr
|
||||
tay
|
||||
|
||||
lda YY
|
||||
lsr
|
||||
|
||||
jsr PLOT ; PLOT AT Y,A
|
||||
|
||||
dec YY
|
||||
bne sier_yloop
|
||||
|
||||
dec XX
|
||||
bne sier_xloop
|
||||
|
||||
done:
|
||||
jmp done
|
53
graphics/gr/sier/sier_tiny.s
Normal file
53
graphics/gr/sier/sier_tiny.s
Normal file
@ -0,0 +1,53 @@
|
||||
; fake sierpinski
|
||||
|
||||
; just plot X AND Y
|
||||
|
||||
|
||||
; 51 initial
|
||||
; 46, put YY in X
|
||||
; 39, optimized to death?
|
||||
|
||||
.include "zp.inc"
|
||||
.include "hardware.inc"
|
||||
|
||||
;================================
|
||||
; Clear screen and setup graphics
|
||||
;================================
|
||||
sier:
|
||||
|
||||
jsr SETGR ; set lo-res 40x40 mode
|
||||
bit FULLGR ; make it 40x48
|
||||
|
||||
lda #39
|
||||
sta XX
|
||||
|
||||
sier_xloop:
|
||||
|
||||
ldx #47
|
||||
|
||||
sier_yloop:
|
||||
|
||||
txa
|
||||
and XX
|
||||
|
||||
bne black
|
||||
lda #$11 ; red
|
||||
|
||||
.byte $2C ; bit trick
|
||||
black:
|
||||
lda #$00
|
||||
sta COLOR
|
||||
|
||||
ldy XX
|
||||
txa
|
||||
jsr PLOT ; PLOT AT Y,A
|
||||
|
||||
|
||||
dex
|
||||
bpl sier_yloop
|
||||
|
||||
dec XX
|
||||
bpl sier_xloop
|
||||
|
||||
done:
|
||||
bmi done
|
158
graphics/gr/sier/zp.inc
Normal file
158
graphics/gr/sier/zp.inc
Normal file
@ -0,0 +1,158 @@
|
||||
;; Zero page monitor routines addresses
|
||||
|
||||
;; LZSA addresses
|
||||
NIBCOUNT = $00
|
||||
|
||||
WNDLFT = $20
|
||||
WNDWDTH = $21
|
||||
WNDTOP = $22
|
||||
WNDBTM = $23
|
||||
CH = $24
|
||||
CV = $25
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
BASL = $28
|
||||
BASH = $29
|
||||
H2 = $2C
|
||||
V2 = $2D
|
||||
MASK = $2E
|
||||
COLOR = $30
|
||||
INVFLG = $32
|
||||
|
||||
; More zero-page addresses
|
||||
; we try not to conflict with anything DOS, MONITOR or BASIC related
|
||||
|
||||
;; Flying Routine Only
|
||||
|
||||
TURNING = $60
|
||||
;SCREEN_X = $61 ; not used?
|
||||
SCREEN_Y = $62
|
||||
ANGLE = $63
|
||||
HORIZ_SCALE_I = $64
|
||||
HORIZ_SCALE_F = $65
|
||||
|
||||
SCALE_I = $64
|
||||
SCALE_F = $65
|
||||
|
||||
FACTOR_I = $66
|
||||
FACTOR_F = $67
|
||||
DX_I = $68
|
||||
DX_F = $69
|
||||
SPACEX_I = $6A
|
||||
SPACEX_F = $6B
|
||||
CX_I = $6C
|
||||
CX_F = $6D
|
||||
DY_I = $6E
|
||||
DY_F = $6F
|
||||
SPACEY_I = $70
|
||||
SPACEY_F = $71
|
||||
CY_I = $72
|
||||
CY_F = $73
|
||||
TEMP_I = $74
|
||||
TEMP_F = $75
|
||||
DISTANCE_I = $76
|
||||
DISTANCE_F = $77
|
||||
SPACEZ_I = $78
|
||||
SPACEZ_F = $79
|
||||
DRAW_SPLASH = $7A
|
||||
SPEED = $7B
|
||||
SPLASH_COUNT = $7C
|
||||
OVER_LAND = $7D
|
||||
NUM1L = $7E
|
||||
NUM1H = $7F
|
||||
NUM2L = $80
|
||||
NUM2H = $81
|
||||
RESULT = $82 ; 83,84,85
|
||||
NEGATE = $86 ; UNUSED?
|
||||
LAST_SPACEX_I = $87
|
||||
LAST_SPACEY_I = $88
|
||||
LAST_MAP_COLOR = $89
|
||||
COLOR_MASK = $8A
|
||||
|
||||
;; World Map Only
|
||||
|
||||
ODD = $7B
|
||||
DIRECTION = $7C
|
||||
REFRESH = $7D
|
||||
ON_BIRD = $7E
|
||||
MOVED = $7F
|
||||
STEPS = $80
|
||||
TFV_X = $81
|
||||
TFV_Y = $82
|
||||
NEWX = $83
|
||||
NEWY = $84
|
||||
MAP_X = $85
|
||||
GROUND_COLOR = $86
|
||||
|
||||
|
||||
LEVEL_OVER = $A0
|
||||
JOYSTICK_ENABLED= $A1
|
||||
FRAMEL = $A2
|
||||
FRAMEH = $A3
|
||||
WHICH_LOAD = $A4
|
||||
MENU_RESULT = $A5
|
||||
SOUND_STATUS = $A6
|
||||
SOUND_DISABLED = $80
|
||||
SOUND_IN_LC = $01 ; $01 sound effects in language card
|
||||
SOUND_MOCKINGBOARD = $02 ; mockingboard detected
|
||||
JS_BUTTON_STATE = $A7
|
||||
|
||||
COLOR1 = $E0
|
||||
COLOR2 = $E1
|
||||
MATCH = $E2
|
||||
XX = $E3
|
||||
YY = $E4
|
||||
SHIPY = $E4
|
||||
YADD = $E5
|
||||
LOOP = $E6
|
||||
;MEMPTRL = $E7
|
||||
;MEMPTRH = $E8
|
||||
NAMEL = $E9
|
||||
NAMEH = $EA
|
||||
NAMEX = $EB
|
||||
CHAR = $EC
|
||||
DISP_PAGE = $ED
|
||||
DRAW_PAGE = $EE
|
||||
|
||||
FIRST = $F0
|
||||
LASTKEY = $F1
|
||||
PADDLE_STATUS = $F2
|
||||
XPOS = $F3
|
||||
YPOS = $F4
|
||||
TEMP = $FA
|
||||
RUN = $FA
|
||||
TEMP2 = $FB
|
||||
TEMPY = $FB
|
||||
INL = $FC
|
||||
INH = $FD
|
||||
OUTL = $FE
|
||||
OUTH = $FF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; read any file slot 6 version
|
||||
; based on FASTLD6 and RTS copyright (c) Peter Ferrie 2011-2013,2018
|
||||
|
||||
; modified to assemble with ca65 -- vmw
|
||||
; added code to patch it to run from current disk slot -- vmw
|
||||
|
||||
|
||||
adrlo = $26 ; constant from boot prom
|
||||
adrhi = $27 ; constant from boot prom
|
||||
tmpsec = $3c ; constant from boot prom
|
||||
reqsec = $3d ; constant from boot prom
|
||||
sizelo = $44
|
||||
sizehi = $45
|
||||
secsize = $46
|
||||
|
||||
ldsizel = $70
|
||||
ldsizeh = $71
|
||||
namlo = $7b
|
||||
namhi = $7c
|
||||
step = $7d ; state for stepper motor
|
||||
tmptrk = $7e ; temporary copy of current track
|
||||
phase = $7f ; current phase for /seek
|
||||
|
Loading…
x
Reference in New Issue
Block a user