-
Notifications
You must be signed in to change notification settings - Fork 0
/
nostalgia.js
311 lines (263 loc) · 4.52 KB
/
nostalgia.js
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
303
304
305
306
307
308
309
310
311
;; -*-asm-*-
LYXASS EQU 1
gpu
include <js/symbols/jagregeq.js>
include <js/symbols/blit_eq.js>
include <js/macro/help.mac>
include <js/macro/joypad1.mac>
include <js/macro/module.mac>
include "globalreg.h"
include "video.h"
MOD EQU 1
TIMING EQU 0
* rez
max_y equ max_y_gr
BLIT_WIDTH equ BLIT_WID256
IRQ_STACK equ $f03020
LastJoy equ $80
x_save equ $f03fe0-(max_y+1)*4
stacktop equ x_save
RSSET $f03000
include <js/var/txtscr.var>
MACRO WAITBLITTER
.\waitblit load (blitter+$38),tmp0
btst #0,tmp0
jr z,.\waitblit
nop
ENDM
run $4000
********************
* init
init:
movei #$f02100,r1
moveta r1,IRQ_FLAGADDR.a
movei #1<<14|%11111<<9,r0 ; clear all ints, REGPAGE = 1
store r0,(r1)
nop
nop
INITMODULE irq
INITMODULE poly
movei #x_save,tmp0
moveta tmp0,x_save.a
movei #$f00400,clut
movei #IRQ_STACK,r0
moveta r0,IRQ_SP.a
movei #stacktop,SP
;;-> moveta SP,SP.a
;;; ------------------------------
nop
include <js/inc/videoinit.inc>
movei #$f00028,r0
movei #ScreenMode,r1
storew r1,(r0)
moveq #0,r0
store r0,(clut)
;;; ------------------------------
IF MOD = 1
movei #DSP_start,r0
movei #DSP_RAM,r1
movei #(DSP_end-DSP_start),r2
nop
cpy_dsp:
load (r0),r3
addq #4,r0
subq #4,r2
store r3,(r1)
jr pl,cpy_dsp
addq #4,r1
movei #$20-8,r14
movei #LSP_module_music_data,r0
store r0,(r14)
movei #LSP_module_sound_bank,r0
store r0,(r14+4)
moveq #0,r0
bset #14,r0
movei #$f1a100,r14
store r0,(r14)
movei #$f1b000,r0
store r0,(r14+$10) ; PC
moveq #1,r0
store r0,(r14+$14) ; GO
ENDIF
;; Setup min/max X table
movefa x_save.a,tmp0
movei #max_y,tmp1
movei #max_x<<16|0,tmp2 ; minX:maxX
.loop0
subq #1,tmp1
store tmp2,(tmp0)
jr nn,.loop0 ; +1 as pivot
addqt #4,tmp0
movei #$f00400,tmp0
movei #16,tmp1
movei #palette,r2
.iclut
loadw (r2),r3
addq #2,r2
subq #1,tmp1
storew r3,(tmp0)
jr ne,.iclut
addqt #2,tmp0
movei #VID_PIT0,tmp1
movei #26590<<16|$ffff,tmp0
store tmp0,(tmp1)
addq #2,tmp1
moveta tmp1,VID_PIT.a
nop
movei #254,r0
movei #$0040f740,r1
movei #txt_screen,r2
movei #ASCII,r3
movei #InitTxtScreen,r4
BL (r4)
movei #PrintString_YX,r5
movei #Hallo,r0
moveq #0,r1
BL (r5)
movei #ms,r0
moveq #2,r1
shlq #16,r1
BL (r5)
movei #scene,r0
movei #frame_table,r1
movei #$ff,r2
move r2,r3
subq #1,r3
nop
.buildft
store r0,(r1)
addq #4,r1
.frame
loadb (r0),r4
cmp r2,r4
jr z,.done_bft
cmp r3,r4
jr z,.done_frame
shlq #28,r4
shrq #27,r4
addq #1,r0
jr .frame
add r4,r0
.done_frame
moveq #0,r4
storeb r4,(r0)
jr .buildft
addq #1,r0
.done_bft:
subq #4,r1
moveq #0,r0
store r0,(r1)
movei #screen0,r1
moveta r1,screen1.a
movei #screen1,r1
moveta r1,screen0.a
movei #$f14003,r0
loadb (r0),r0
nop
movei #obl0,r10
btst #4,r0
movei #obl1,r11
jr eq,pal
nop
movei #obl0_60hz,r10
movei #obl1_60hz,r11
pal:
move r10,r1
addq #32,r1
addq #32,r1
moveta r1,obl0.a
addq #32,r11
addq #32,r11
moveta r11,obl1.a
moveq #$10,r1
shlq #8,r1
moveq #31,r2
shlq #1,r2
nop
.cpyobl:
load (r10),r3
addqt #4,r10
subq #1,r2
store r3,(r1)
jr pl,.cpyobl
addqt #4,r1
movei #$f00020,r0
moveq #$10,r1
shlq #16+8,r1
store r1,(r0)
movefa IRQ_FLAGADDR.a,r0
movei #1<<14|%11111<<9|%01000<<<4,r1
store r1,(r0)
nop
nop
moveq #0,r0
moveta r0,info_counter.a
moveta r0,info_index.a
movei #info_table,INFO_TABLE
nop
;;-> movei #poly,r0
;;-> jump (r0)
;;-> nop
MBL poly
UNREG tmp0,tmp1,tmp2,tmp3
joypad::
JOYPAD1
movei #LastJoy,r0
nop
jump (LR)
load (r0),r0
tmp3 reg 3
tmp2 reg 2
tmp1 reg 1
tmp0 reg 0
include "poly.js"
align 4
obl0:
.ibytes "obl0_50.img"
obl1:
.ibytes "obl1_50.img"
obl0_60hz:
.ibytes "obl0_60.img"
obl1_60hz:
.ibytes "obl1_60.img"
IF MOD = 1
align 8
DSP_start:
ibytes "lsp_v15.lib"
DSP_end:
.long
LSP_module_music_data:
.ibytes "mod/desert2.lsmusic"
.long
LSP_module_sound_bank:
.ibytes "mod/desert2.lsbank"
ENDIF
align 4
ASCII::
.ibytes <font/light8x8.fnt>
palette:
dc.w $0000,$0842,$0904,$2082,$1906,$2106,$21c8,$4108
dc.w $4908,$228b,$1b8f,$610d,$528f,$6311,$90d3,$ffff
align 4
info_table:
dc.l Optimize,info,LSPInfo,Leonard
;; 0123456789012345678901234567890123456789
Hallo: dc.b " Nostalgic-O-Demo remix for Jaguar ",0
info: dc.b " Written 2023 / 42Bastian ",0
ms: dc.b " 00ms 012345ms 012345ms 012345 frame ",0
LSPInfo:
dc.b "LSP by Ericde45 / MOD by laxity/kefrens",0
Leonard:
dc.b " Dataset by Leonard^Oxygene ",0
Optimize:
dc.b " GPU and DSP only / no 68K ",0
.long
scene:
ibytes "SCENE_v1.dat"
.long
scene_end:
.align 4
dc.l 0
frame_table:
dc.l 0
echo "FT:%Hframe_table"