mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-10-24 23:25:28 +00:00
entropy: sorta under the 128 byte level
This commit is contained in:
parent
3b64e895c3
commit
09c3e7d70b
@ -20,6 +20,8 @@
|
|||||||
; 139 bytes: change jmp to bcs
|
; 139 bytes: change jmp to bcs
|
||||||
; 138 bytes: jmp at end now fits into a bcs
|
; 138 bytes: jmp at end now fits into a bcs
|
||||||
; 136 bytes: store YPOS on stack
|
; 136 bytes: store YPOS on stack
|
||||||
|
; 135 bytes: store X to HGR_SCALE rather than TXA+STA
|
||||||
|
; 131 bytes: some fancy branch elimination by noticing X=1
|
||||||
|
|
||||||
;BLT=BCC, BGE=BCS
|
;BLT=BCC, BGE=BCS
|
||||||
|
|
||||||
@ -112,24 +114,20 @@ xloop:
|
|||||||
|
|
||||||
; Compare to E
|
; Compare to E
|
||||||
|
|
||||||
|
jsr MUL10 ; EPOS is *100, so multiply*100 first
|
||||||
jsr MUL10
|
jsr MUL10
|
||||||
jsr MUL10
|
jsr CONINT ; convert to int
|
||||||
|
|
||||||
jsr CONINT
|
|
||||||
|
|
||||||
; X is now RND(1)*100
|
; X is now RND(1)*100
|
||||||
|
|
||||||
cpx EPOS
|
cpx EPOS
|
||||||
bcc less ; branch if less than EPOS
|
ldx #1 ; the boring case
|
||||||
more:
|
bcs done ; branch if less than EPOS
|
||||||
lda #1 ; the boring case
|
|
||||||
bne done ; branch always
|
|
||||||
less:
|
|
||||||
; SCALE=RND(1)*E*20+1
|
; SCALE=RND(1)*E*20+1
|
||||||
; EPOS is E*100, so RND(1)*(EPOS/10)*2+1
|
; EPOS is E*100, so RND(1)*(EPOS/10)*2+1
|
||||||
; is EPOS/4 close enough?
|
; is EPOS/4 close enough?
|
||||||
; put random value in FAC
|
; put random value in FAC
|
||||||
ldx #1 ; RND(1), Force 1
|
; ldx #1 ; RND(1), Force 1
|
||||||
jsr RND+6 ; we skip passing the argument
|
jsr RND+6 ; we skip passing the argument
|
||||||
; in FAC as that would be a pain
|
; in FAC as that would be a pain
|
||||||
|
|
||||||
@ -147,10 +145,9 @@ less:
|
|||||||
jsr CONINT ; convert to int (in X)
|
jsr CONINT ; convert to int (in X)
|
||||||
|
|
||||||
inx ; add 1
|
inx ; add 1
|
||||||
txa ; move to A
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
sta HGR_SCALE ; set scale value
|
stx HGR_SCALE ; set scale value
|
||||||
|
|
||||||
ldy XPOSH ; setup X and Y co-ords
|
ldy XPOSH ; setup X and Y co-ords
|
||||||
ldx XPOS
|
ldx XPOS
|
||||||
|
Loading…
Reference in New Issue
Block a user