-
Notifications
You must be signed in to change notification settings - Fork 0
/
BlueScale.asm
79 lines (66 loc) · 1.32 KB
/
BlueScale.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
BlueScale SUBROUTINE
;---------------------------------------------------
; Vetical sync
JSR FrameStart
;---------------------------------------------------
; Vertical Blank
; NTSC 37 Scan lines
; PAL SECAM 45 Scan lines
LDA #$01
STA VBLANK ; Start VBLANK
LDA #T64VBlank
STA TIM64T
.waitvb
LDA INTIM
BNE .waitvb
LDA #$00
STA VBLANK ; Stop VBLANK
;---------------------------------------------------
; Kernal
; NTSC 192 Scan lines
; PAL SECAM 228 Scan lines
IF SYSTEM == NTSC
; 192 Linee
LDY #$C1
ELSE
; 228 Linee
LDY #$E4
ENDIF
.colorindex
LDA _frameCounter
AND #$0F
BNE .fillscreen
INC _colorIndex
LDA _colorIndex
CMP #$08
BNE .fillscreen
LDA #$00
STA _colorIndex
.fillscreen
.printline
STA WSYNC ; line 1
NOP ; [2]
NOP ; [2]
NOP ; [2]
NOP ; [2]
NOP ; [2]
LDX _colorIndex ; [2]
LDA BlueScaleCols,X ; [4]
STA COLUBK ; [2]
DEY
CPY #$00
BNE .printline
.exit
STA WSYNC
LDA #$00
STA COLUBK
;---------------------------------------------------
; Overscan
; NTSC 30 Scan lines
; PAL SECAM 36 Scan lines
LDA #T64OverS
STA TIM64T
.waitovs
LDA INTIM
BNE .waitovs
RTS