-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclock4_screen.s
More file actions
127 lines (106 loc) · 3.03 KB
/
clock4_screen.s
File metadata and controls
127 lines (106 loc) · 3.03 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#-------------------------------------------------------------------------------
# MUSIC RELEASE 'timeCS' ('CLOCK SCREEN 4') 6-channel (2AY) music only!
# BY VLADIMIR 'KUVO' KUTYAKOV/CSI
#
# CONVERSION FOR Elektronika MS0511 (UKNC)
# BY ABERRANTHACKER
#
# SOUND DEVICE: Aberrant Sound Module
# PLATFORM: Elektronika MS0511
# COMPILER: GNU Assembler
#-------------------------------------------------------------------------------
.nolist
.include "hwdefs.s"
.include "macros.s"
.include "defs.s"
.include "clock_defs.s"
.global start
.org ClockScreenStart
start:
START_CLOCK:
.equiv first_run_flag, .+2
TST $0
BNZ CLOCK_OPER
INC first_run_flag
.ppudo_ensure $PPU.SetPalette, $clock4_palette
MOV $FB0, R0
MOV $CLOCK_GFX, R1
MOV $CLOCK_SCR_HEIGHT, R2
3$:
MOV $CLOCK_SCR_WIDTH_WORDS, R3
4$:
MOV (R1)+, (R0)+
SOB R3, 4$
ADD $LINE_WIDTHB - CLOCK_SCR_WIDTH_BYTES, R0
SOB R2, 3$
CLOCK_OPER:
CALL NEXT_CLOCK_OPER
RETURN
NEXT_CLOCK_OPER:
WAIT
ADD $040000, $0
BCC 3$
MOV $DIGITS_SET, R5
MOV R5, R4
INC (R5)
CMP (R5), $10
BLO 10$
CLR (R5)+
INC (R5)
CMP (R5), $6
BLO 10$
CLR (R5)+
INC (R5)
CMP (R5), $4
BLO 10$
CMP 2(R5), $2
BEQ 100$
CMP (R5), $10
BLO 10$
100$:CLR (R5)+
INC (R5)
CMP (R5), $3
BLO 10$
CLR (R5)
10$:MOV $DIGITS_LOCATION, R5
MOV $4, R3
1$:
MOV (R4)+, R2
SWAB R2
ASR R2
ASR R2
MOV R2, R1
ASR R2
ADD R2, R1
ADD $DIGITS_GFX, R1
MOV (R5)+, R0
MOV $24, R2
2$:
MOV (R1)+, (R0)+
MOV (R1)+, (R0)+
ADD $LINE_WIDTHB - 4, R0
SOB R2, 2$
SOB R3, 1$
3$: RETURN
DIGITS_SET:
.word 0
.word 5
.word 2
.word 1
DIGITS_LOCATION:
.word FB0 + (128 >> 2) + (81*LINE_WIDTHB)
.word FB0 + (104 >> 2) + (81*LINE_WIDTHB)
.word FB0 + ( 72 >> 2) + (81*LINE_WIDTHB)
.word FB0 + ( 48 >> 2) + (81*LINE_WIDTHB)
clock4_palette: #---------------------------------------------------------------
.word 0, setCursorScalePalette, cursorGraphic, scale320 | RGb
.word 1, setColors; .byte Black, brRed, brGreen, brCyan
.word 184, setColors; .byte Black, brRed, brGreen, White
.word 185, setCursorScalePalette, cursorGraphic, scale320 | RGB
.word 198, setCursorScalePalette, cursorGraphic, scale320 | rGb
.word untilEndOfScreen
#-------------------------------------------------------------------------------
DIGITS_GFX:
.incbin "build/clock4/digits.raw"
CLOCK_GFX:
.incbin "build/clock4/clock4.raw"