mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-26 15:29:55 +00:00
entropy_tiny: got it to 64 byes
This commit is contained in:
parent
99425eb87e
commit
d5add924ff
12
basic/two-liners/apple2_70_zp.inc
Normal file
12
basic/two-liners/apple2_70_zp.inc
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
MEMORY {
|
||||||
|
ZP: start = $70, size = $90, type = rw;
|
||||||
|
RAM: start = $70, size = $8E00, file = %O;
|
||||||
|
}
|
||||||
|
|
||||||
|
SEGMENTS {
|
||||||
|
#CODE: load = RAM, type = ro;
|
||||||
|
#RODATA: load = RAM, type = ro;
|
||||||
|
#DATA: load = RAM, type = rw;
|
||||||
|
#BSS: load = RAM, type = bss, define = yes;
|
||||||
|
ZEROPAGE: load = ZP, type = ro;
|
||||||
|
}
|
|
@ -29,11 +29,16 @@
|
||||||
; 88 bytes -- hack up the entropy code
|
; 88 bytes -- hack up the entropy code
|
||||||
; 83 bytes -- count down YPOS instead of up
|
; 83 bytes -- count down YPOS instead of up
|
||||||
; 73 bytes -- XPOS only up to 256
|
; 73 bytes -- XPOS only up to 256
|
||||||
|
; 73 bytes -- move to zero page
|
||||||
|
; 65 bytes -- move XPOS/YPOS into X/Y, use RESTORE
|
||||||
|
|
||||||
;BLT=BCC, BGE=BCS
|
;BLT=BCC, BGE=BCS
|
||||||
|
|
||||||
; zero page locations
|
; zero page locations
|
||||||
HGR_SHAPE = $1A
|
HGR_SHAPE = $1A
|
||||||
|
A5H = $45
|
||||||
|
XREG = $46
|
||||||
|
YREG = $47
|
||||||
HGR_SCALE = $E7
|
HGR_SCALE = $E7
|
||||||
HGR_ROTATION = $F9
|
HGR_ROTATION = $F9
|
||||||
FRAME = $FC
|
FRAME = $FC
|
||||||
|
@ -44,7 +49,9 @@ YPOS = $FF
|
||||||
HGR2 = $F3D8
|
HGR2 = $F3D8
|
||||||
HPOSN = $F411
|
HPOSN = $F411
|
||||||
XDRAW0 = $F65D
|
XDRAW0 = $F65D
|
||||||
|
RESTORE = $FF3F
|
||||||
|
|
||||||
|
.zeropage
|
||||||
|
|
||||||
entropy:
|
entropy:
|
||||||
|
|
||||||
|
@ -52,51 +59,62 @@ entropy:
|
||||||
; Y=0, A=0 after this call
|
; Y=0, A=0 after this call
|
||||||
|
|
||||||
eloop:
|
eloop:
|
||||||
lda #180 ; FOR Y=4 to 189 STEP 6
|
ldy #180 ; Y=180 down to 0 STEP 6
|
||||||
sta YPOS
|
|
||||||
yloop:
|
yloop:
|
||||||
|
|
||||||
lda #4 ; FOR X=4 to 278 STEP 6
|
ldx #4 ; FOR X=4 to 278 STEP 6
|
||||||
sta XPOS
|
|
||||||
xloop:
|
xloop:
|
||||||
|
|
||||||
ldx #1
|
frame_smc:
|
||||||
ldy FRAME
|
lda $D000 ; 3 ; also FRAME
|
||||||
lda $D000,y
|
and #1 ; 2
|
||||||
bmi no_add
|
sta HGR_SCALE ; 2
|
||||||
inx
|
inc HGR_SCALE ; 2 = 9
|
||||||
no_add:
|
|
||||||
stx HGR_SCALE ; set scale value
|
|
||||||
|
|
||||||
ldy #0 ; setup X and Y co-ords
|
; ldx #1 ; 2
|
||||||
ldx XPOS
|
; ldy FRAME ; 2
|
||||||
lda YPOS
|
; lda $D000,y ; 3
|
||||||
|
; bmi no_add ; 2
|
||||||
|
; inx ; 1
|
||||||
|
;no_add: ;
|
||||||
|
; stx HGR_SCALE ; 2 = 12
|
||||||
|
|
||||||
|
stx XREG ; save X
|
||||||
|
sty YREG ; save Y
|
||||||
|
|
||||||
|
; setup X and Y co-ords
|
||||||
|
tya ; YPOS into A
|
||||||
|
ldy #0 ; Y always 0
|
||||||
|
; XPOS already in X
|
||||||
jsr HPOSN ; X= (y,x) Y=(a)
|
jsr HPOSN ; X= (y,x) Y=(a)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ldx #<shape_table ; point to our shape
|
ldx #<shape_table ; point to our shape
|
||||||
ldy #>shape_table
|
|
||||||
lda #0 ; ROT=0
|
lda #0 ; ROT=0
|
||||||
|
tay ; ldy #>shape_table
|
||||||
|
|
||||||
|
|
||||||
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
||||||
; Both A and X are 0 at exit
|
; Both A and X are 0 at exit
|
||||||
|
|
||||||
nextx: ; NEXT X
|
jsr RESTORE ; restore FLAGS/X/Y/A
|
||||||
inc FRAME
|
|
||||||
|
|
||||||
lda XPOS ; 2
|
nextx: ; NEXT X
|
||||||
|
inc frame_smc+1
|
||||||
|
|
||||||
|
txa
|
||||||
clc ; 1
|
clc ; 1
|
||||||
adc #6 ; x+=6 ; 2
|
adc #6 ; x+=6 ; 2
|
||||||
sta XPOS ; 2
|
tax
|
||||||
|
|
||||||
bne xloop ; if so, loop ; 2
|
bne xloop ; if so, loop ; 2
|
||||||
|
|
||||||
nexty:
|
nexty:
|
||||||
sec
|
; carry always set if we get here
|
||||||
lda YPOS
|
; sec
|
||||||
sbc #6 ; y+=6
|
tya
|
||||||
sta YPOS
|
sbc #6 ; y-=6
|
||||||
|
tay
|
||||||
bne yloop ; if so, loop
|
bne yloop ; if so, loop
|
||||||
beq eloop
|
beq eloop
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user