-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathttrackerSMS.asm
302 lines (231 loc) · 7.16 KB
/
ttrackerSMS.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
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
; Trilo-Tracker v0.2
;define VERSION "v0.11.4b SMS"
;define YEAR "2021"
define CHIPSET_CODE $30
DEFINE TTSMS
enaslt: equ #0024
defpage 0,0x0100, 0x3f00 ; page 0 contains main code + far call routines
defpage 1,0x4000, 0x8000 ; page 1 contains code (last 5kb should be empty)
; defpage 2,0x8000, 0x4000 ; NPC/titlescreen/gameinit code/swap code blocks
; --- PAGE 0
;
; Global code (will never be swapped)
;
;
; --------------------------------------------------
page 0
org 0x0100
MAIN:
; initialisation
call reset_hook
call get_drives
call init_workdir
;--- load the voicenames into VRAM
; from a seperate TTFM.DAT file
call load_voicenames
call start_init ; this calls function that is overwritten after call
; the space can be used by the songs
;-- Find and enable if any MMM is inserted.
ld b,16
ld h,0x40
call mmm_srch ; This routine will find and activate SN if found
call MSXMusic_Detect
;--- init correct period tabel from config
ld a,(_CONFIG_PERIOD)
ld (replay_period),a
call set_period_table
; new that we have the memory reserved. Switch to slot of song data
ld a,(mapper_slot) ; get mapper slot
ld h,0x80
call enaslt
call set_songpage
;-- now copy the voices data to songpage:
ld hl,_VOICES_data
ld de,_VOICES
ld bc,MAX_WAVEFORM*8
ldir
xor a
call swap_loadblock
call init_hook
xor a
call new_song
call set_songpage
call cursorstack_init
; call MSXMusic_Detect
; jr. c,99f
; ld a,WIN_NOSCC
; call window
;99:
; cp $ff
; jr. nz,99f
; ld a,WIN_NOSCC
; call window
;99:
; ld a,WIN_CFGSAV
; call window
;--- should we load default instruments?
ld a,(_CONFIG_INS)
and a
call nz,load_instruments
ld a,10
ld (editmode),a
call init_patterneditor
; --- main loop
;call set_hook
include ".\code\main.asm"
include ".\code\configurationRAM.asm"
END:
; jr. _TERM0
include ".\code\elements\patternbox.asm"
;_LABEL_PATTERNHEADER:
; ;db 32,129,171,172,175,129 ; envelope column
; db 32,32,32
; db 136,160,161,165,185,188,189,186,187 ; psg2
; db 136,160,161,166,185,188,189,186,187 ; psg3
; db 137,170,171,164,185,188,189,186,187 ; scc1
; db 136,170,171,165,185,188,189,186,187 ; scc2
; db 136,170,171,166,185,188,189,186,187 ; scc3
; db 136,170,171,167,185,188,189,186,187 ; scc4
; db 136,170,171,168,185,188,189,186,187 ; scc5
; db 136,170,171,169,185,188,189,186,187 ; scc6
; db 136,151,152,153,154,0
_LABEL_PATTERNHEADER2:
;db 32,129,171,172,175,129 ; envelope column
; db 32,32,32
db 136,160,161,164,185,188,189,186,187 ; psg1
_LABEL_PATTERNHEADER:
db 136,160,161,165,185,188,189,186,187 ; psg2
db 136,160,161,166,185,188,189,186,187 ; psg3
db 137,170,171,164,185,188,189,186,187 ; scc1
db 137,170,171,165,185,188,189,186,187 ; scc1
db 136,170,171,166,185,188,189,186,187 ; scc2
db 136,170,171,167,185,188,189,186,187 ; scc3
db 136,170,171,168,185,188,189,186,187 ; scc4
db 136,170,171,169,185,188,189,186,187 ; scc5
_LABEL_PATTERNHEADER_END:
db 136,151,152,153,154
include ".\code\elements\trackboxRAM.asm"
; include ".\code\elements\trackbox.asm"
include ".\code\elements\sequencebox.asm"
include ".\code\elements\songbox.asm"
include ".\code\elements\patterneditor.asm"
include ".\code\elements\filedialogRAM.asm"
; include ".\code\elements\macroeditor.asm"
; include ".\code\elements\macroboxFM.asm"
include ".\code\elements\voicemanager.asm"
include ".\code\elements\FMvoicebox.asm"
include ".\code\elements\voicemanagerRAM.asm"
include ".\code\elements\keyjazz.asm"
include ".\code\elements\instrumentbox.asm"
include ".\code\elements\vuFM.asm"
include ".\code\loadinstruments.asm"
include ".\code\cursor.asm"
include ".\code\elements\filedialog.asm"
include ".\code\clipboard.asm"
SWAP_ELEMENTSTART:
; temporary start up code and data!!! Will be over written after init
include ".\code\sound\mmmdetect.asm"
include ".\code\sound\fmdetect.asm"
font_data:
incbin ".\data\fontpat.bin"
include ".\code\startup.asm"
include ".\code\loadvoicenamesFM.asm"
include ".\code\elements\keynotetable.asm"
; --- PAGE 1
;
; Main code (can be swapped)
;
;
; --------------------------------------------------
page 1
include ".\code\bios.asm"
include ".\code\vdp.asm"
include ".\code\screen.asm"
include ".\code\register_debug.asm"
include ".\code\song.asm"
include ".\code\volumetable.asm"
include ".\code\keyboard.asm"
include ".\code\musickeyboard.asm"
include ".\code\isr.asm" ; This cannot be before this address!!!!
include ".\code\mapper.asm"
include ".\code\disk.asm"
include ".\code\editlog.asm"
include ".\code\vram_swapper.asm"
include ".\code\window.asm"
include ".\code\replayerFMRAM.asm"
; --- PAGE 2
;
; Data page (music data)
;
;
; --------------------------------------------------
; page 2
_VOICES_data:
include ".\code\Voices_Light_OLD.asm"
; include ".\code\startup.asm"
; include ".\code\loadvoicenamesFM.asm"
; include ".\code\elements\keynotetable.asm"
SWAP_INIT_START:
org SWAP_RAMSTART
; Replayer swappable code block
; --------------------------------------------------
SWAP_REPLAY:
include ".\code\replayerFM.asm" ;replayer.asm"
SWAP_REPLAY_END:
; MBM import swappable code block
; --------------------------------------------------
org SWAP_RAMSTART
SWAP_SAMPLE:
; include ".\code\import\importMBM.asm"
SWAP_SAMPLE_END:
; XM importer swappable code block
; --------------------------------------------------
org SWAP_RAMSTART
SWAP_SAMFILE:
SWAP_SAMFILE_END:
; XM importer swappable code block
; --------------------------------------------------
org SWAP_RAMSTART
SWAP_CONFIG:
include ".\code\elements\configeditor.asm"
include ".\code\elements\configbox.asm"
SWAP_CONFIG_END:
; Macro editor swappable code block
; --------------------------------------------------
org SWAP_ELEMENTSTART
SWAP_MACRO:
include ".\code\elements\macroeditor.asm"
include ".\code\elements\macroboxFM.asm"
SWAP_MACRO_END:
; Instrument file dialog swappable code block
; --------------------------------------------------
org SWAP_RAMSTART
SWAP_INSFILE:
include ".\code\elements\fileinsdialog.asm"
SWAP_INSFILE_END:
; Song file dialog swappable code block
; --------------------------------------------------
org SWAP_ELEMENTSTART
SWAP_TRACK:
SWAP_FILE:
db "trackbox swap"
include ".\code\disk_tmu.asm"
include ".\code\compression2.asm"
include ".\code\elements\trackbox.asm"
SWAP_TRACK_END:
SWAP_FILE_END:
; Voice manager swappable code block
; --------------------------------------------------
org SWAP_ELEMENTSTART
SWAP_VOICEMAN:
SWAP_VOICEMAN_END:
; Voice manager swappable code block
; --------------------------------------------------
org SWAP_ELEMENTSTART
SWAP_DRUM:
include ".\code\elements\drumeditor.asm"
include ".\code\elements\drumeditbox.asm"
SWAP_DRUM_END:
db "End of swap data"
SWAP_INIT_END:
include ".\code\variablesFM.asm"