-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.asm
95 lines (79 loc) · 1.36 KB
/
example.asm
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
; atari 2600 mapped registers
.define vsync $00
.define vblank $01
.define wsync $02
.define rsync $03
.define nusiz0 $04
.define nusiz1 $05
.define colup0 $06
.define colup1 $07
.define colupf $08
.define colubk $09
.define ctrlpf $0a
.define refp0 $0b
.define refp1 $0c
.define pf0 $0d
.define pf1 $0e
.define pf2 $0f
.define resp0 $10
.define resp1 $11
.define grp0 $1b
.define grp1 $1c
.define enam0 $1d
.define enam1 $1e
.define enabl $1f
reset:
ldx #0
txa
clear:
dex
txs
pha
bne clear
ldy #0
startframe:
lda #0
sta vblank
lda #2
sta vsync
sta wsync
sta wsync
sta wsync
lda #0
sta vsync
ldx #37
verticalblank:
sta wsync
dex
bne verticalblank
lda #$30
sta colupf
ldx #0
lda #0
scanlines:
stx pf1
stx pf2
stx pf0
inx
sta wsync
cpx #192
bne scanlines
lda #%01000010
sta vblank
ldx #37
overscan:
sta wsync
dex
bne overscan
jmp startframe
data:
.byte $0, $88, $c8, $a8, $98, $88, $88, $0 ; N
.byte $0, $f8, $20, $20, $20, $20, $f8, $0 ; I
.byte $0, $f8, $80, $80, $80, $80, $f8, $0 ; C
.byte $0, $f8, $80, $f8, $80, $80, $f8, $0 ; E
cock:
.byte $EA, $60
.org $ffa
.word reset
.word reset
.word reset