/
BASE.AST
189 lines (141 loc) · 4.84 KB
/
BASE.AST
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
***********************************************************************
*********** ***********
*********** Routines de base pour d‚mos... ***********
*********** ***********
*********** Avec Soundtrack DSP par Simplet ***********
*********** avec option clavier ***********
*********** ***********
*********** Par Simplet / ABSTRACT ***********
*********** ***********
***********************************************************************
KeyBD EQU 1 ; Si = 0, routine simple
; Si = 1, routine evolu‚e
OPT O+,OW-
Incdir 'E:\CODE\ASM\INITS\'
Include 'MACROS.AST'
***********************************************************************
*********** Inits G‚n‚rales ***********
***********************************************************************
Section TEXT
clr.l -(sp) ; Passage en Mode Supervisor
move.w #$20,-(sp) ; SUPER
trap #1 ; Gemdos
addq.l #6,sp
bsr Init_Music ; Initialise soundtrack
bmi.s Error
move.w #$2700,sr
bsr Save_System
bsr Init_System
* Mouse_On
* Joysticks_On
lea.l Videl_320_200_256,a0
moveq.l #2-1,d0
bsr Init_Video
bsr Init_Falcon_Palette
bsr Init_IT
move.l #New_VBL,$70.w
IfNe KeyBD
move.l #KeyBoard_Mouse_and_JoySticks,$118.w
Else
move.l #KeyBoard,$118.w
EndC
or.b #$40,$fffffa09.w ; Autorise nouvelle
or.b #$40,$fffffa15.w ; routine clavier
***********************************************************************
*********** Inits Sp‚cifiques ***********
***********************************************************************
* bsr Installe_Palette
***********************************************************************
*********** Boucle principale d'attente ***********
***********************************************************************
Main_Loop clr.w VBL_Cmpt
VBL_Wait tst.w VBL_Cmpt ; Attend
beq.s VBL_Wait ; prochaine VBL
bsr.s VBL_Rout ; ex‚cute routine
cmp.b #$39,LastKey ; Touche Espace Press‚e ???
bne.s Main_Loop
***********************************************************************
*********** C'est fini, on remet tout en place ***********
***********************************************************************
bsr Stop_Music ; Arrete soundtrack
bsr Restore_System
Error clr.w -(sp) ; PTerm
trap #1 ; Gemdos
***********************************************************************
*********** Routine tournant … chaque VBL ***********
***********************************************************************
VBL_Rout SaveColor
move.l Adr_Screen1,d0 ; Flipping
move.l Adr_Screen2,Adr_Screen1 ; Ecrans
move.l d0,Adr_Screen2 ; Physique
lsr.w #8,d0 ; /
move.l d0,$ffff8200.w ; Logique
move.w #5000,d0
dbra d0,*
CPUTimeColor #$5f6f00ff
move.w #1000,d0
dbra d0,*
move.b LastKey(pc),d0
beq.s VBL_Ret
cmp.b #$4e,d0
bne.s No_Plus
clr.b Simplet_Pattern_Position
st Simplet_Position_Jump_Flag
clr.w LastKey
bsr Init_Voices
bra.s No_Moins
No_Plus cmp.b #$4a,d0
bne.s No_Moins
subq.w #2,Simplet_Song_Position
clr.b Simplet_Pattern_Position
st Simplet_Position_Jump_Flag
clr.w LastKey
bsr Init_Voices
No_Moins
VBL_Ret RestoreColor
rts
***********************************************************************
*********** Interruption VBL : compteur ***********
***********************************************************************
New_VBL addq.w #1,VBL_Cmpt
move.w #10000,d0
dbra d0,*
SaveColor
CPUTimeColor #$dd550088
bsr.s SndTrack_IT
RestoreColor
rte
VBL_Cmpt ds.w 1
***********************************************************************
*********** Sous-Programmes ***********
***********************************************************************
Installe_Palette
move.w #256-1,d7
lea.l Palette_Videl,a0
lea.l $ffff9800.w,a1
InstallePalette
move.l (a0)+,(a1)+
dbra d7,InstallePalette
rts
Include 'HOST.AST'
Include 'INITSFAL.AST'
***********************************************************************
*********** Section DATA ***********
***********************************************************************
Section DATA
IncDir 'E:\SNDTRACK\DEPACK\'
IncDir 'E:\SNDTRACK\8_VOIES\'
Module IncBin 'HUMANTAR.MOD' ; Dernier de la section DATA
***********************************************************************
*********** Section BSS ***********
***********************************************************************
Section BSS
; Variables diverses
; Adresses Ecrans
Adr_Screen1 ds.l 1
Adr_Screen2 ds.l 1
; Palettes en tout genre
Palette_Videl ds.l 256
; Buffers
; Place pour Ecrans
Screens ds.b 2*((320*200)+256)