diff options
| author | Simon Rettberg | 2024-09-06 14:42:37 +0200 |
|---|---|---|
| committer | Simon Rettberg | 2024-09-06 14:42:37 +0200 |
| commit | badef32037f52f79abc1f1440b786cd71afdf270 (patch) | |
| tree | 412b792d4cab4a7a110db82fcf74fe8a1ac55ec1 /hacks/images/m6502/random-walk.asm | |
| parent | Delete pre-6.00 files (diff) | |
| download | xscreensaver-master.tar.gz xscreensaver-master.tar.xz xscreensaver-master.zip | |
Diffstat (limited to 'hacks/images/m6502/random-walk.asm')
| -rw-r--r-- | hacks/images/m6502/random-walk.asm | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/hacks/images/m6502/random-walk.asm b/hacks/images/m6502/random-walk.asm deleted file mode 100644 index 4c3bd15..0000000 --- a/hacks/images/m6502/random-walk.asm +++ /dev/null @@ -1,82 +0,0 @@ - ;; Jeremy English Dec 11 2007 - ;; Random walk - lda #16 - sta $0 ; The current x pos - sta $1 ; The current y pos - lda $fe ; Get random color - sta $5 ; Store the color - lda $fe ; Amount of time to use this color - sta $6 - -loop: - ldx $0 - ldy $1 - lda $5 - jsr paint - jsr walk - dec $6 - bne loop - ;; get a new color - lda $fe - sta $5 - ;; get a new duration - lda $fe - sta $6 - jmp loop - -walk: - lda $fe - and #3 - cmp #0 - beq right - cmp #1 - beq left - cmp #2 - beq up - jmp down - -right: - inc $0 - jmp done -left: - dec $0 - jmp done -up: - dec $1 - jmp done -down: - inc $1 - jmp done -done: - lda $0 - and #31 - sta $0 - lda $1 - and #31 - sta $1 - rts - -paint: - pha - lda yl,y - sta $2 - lda yh,y - sta $3 - txa - tay - pla - sta ($2),y - rts - - ;; Y cord MSB -yh: - dcb $02, $02, $02, $02, $02, $02, $02, $02 - dcb $03, $03, $03, $03, $03, $03, $03, $03 - dcb $04, $04, $04, $04, $04, $04, $04, $04 - dcb $05, $05, $05, $05, $05, $05, $05, $05 - ;; Y cord LSB -yl: - dcb $00, $20, $40, $60, $80, $a0, $c0, $e0 - dcb $00, $20, $40, $60, $80, $a0, $c0, $e0 - dcb $00, $20, $40, $60, $80, $a0, $c0, $e0 - dcb $00, $20, $40, $60, $80, $a0, $c0, $e0 |
