summaryrefslogtreecommitdiffstats
path: root/hacks/images/m6502/starfield2d.asm
blob: 4c26efe4a91ceb7c5dfac4ad1146b96b8e95d823 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
; 2d starfield
; Submitted by Anonymous

i:ldx #$7
g:lda $fe
  and #3
  adc #1
  sta $0,x
  lda $fe
  and #$1f
  sta $20,x
  dex
  bpl g
f:
  lda #$ff
  sta $10
  delay:
  nop
  dec $10
  bne delay

  lda #$00
  sta $80
  lda #$02
  sta $81
  ldx #$7
l:lda $20,x
  pha
  clc
  sbc $00,x
  and #$1f
  sta $20,x
  lda $20,x
  tay
  lda #1
  sta ($80),y
  pla
  tay
  lda #0
  sta ($80),y
  lda $80
  clc
  adc #$80
  bne n
  inc $81
n:sta $80
  dex
  bpl l
  jmp f