-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbob.asm
101 lines (75 loc) · 1.58 KB
/
bob.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
96
97
98
99
100
101
processor 6502
include "vcs.h"
include "macro.h"
ORG $F000
Reset
ldx #0
lda #0
Clear
sta 0,x
inx
bne Clear
StartOfFrame
; Start of vertical blank processing
lda #2
sta VSYNC ; start vsync
; 3 scanlines of VSYNCH signal...
sta WSYNC
sta WSYNC
sta WSYNC
lda #0
sta VSYNC ; stop vsync
ldy $1e ; // yellow - should not be visible
sty COLUBK
lda #1
sta VBLANK ; start vertical blank
ldx #37
Blank32
sta WSYNC
dex
bne Blank32
lda #1
sta VBLANK ; stop vertical blank
ldy #$00 ;
sty COLUBK
cld ; BASTARD!!!!!! random behaviour without this!!!!
lda #$67 ; number of blocks
Loop
ldx #$02 ; number of lines
Block1
sta WSYNC
dex
bne Block1
iny
iny
sty COLUBK
sec
sbc #1
bne Loop
ldy #$0E ; white
sty COLUBK ; draw white while VSYNC generating
sta WSYNC ; end on line end
ldx #30
Overscan
sta WSYNC
dex
bne Overscan
jmp StartOfFrame
ldx #40
WaitForFrame
sta WSYNC
dex
bne WaitForFrame
ldx 45
stx COLUBK
ldx 192
WaitForBlock
sta WSYNC
dex
bne WaitForBlock
jmp StartOfFrame
ORG $FFFA
.word Reset ; NMI
.word Reset ; RESET
.word Reset ; IRQ
END