-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGAMEtimer.GEN
More file actions
146 lines (129 loc) · 2.68 KB
/
GAMEtimer.GEN
File metadata and controls
146 lines (129 loc) · 2.68 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
;-----------------
; rutina timer
;-----------------
;/// Configura el timer per que apunti a la nostre rutina NO BIOS VERSION ///
TIMER_S:
xor A
ld (TIMER_T),A
ret
TIMER_R:
push AF
push BC
push DE
push HL
push IX
push IY
in A,(99h) ; acknowledge?
; Al no tener BIOS este "in" fa RESET de EI.
; perque no torni a entrar.
; Lectura de SPRITE COLISION
and 00100000b
srl A
srl A
srl A
srl A
srl A
ld (TIM_SPC),A
;***** Activar Control Temps Timer ***
IFDEF TEST_BORDES
ld A,2
call COLORBR
ENDIF
;*************************************
;******** Aqui va la rutina ********
ld HL,TIMER_T
inc (HL) ;incrementa contador
call TIMERUPDATE
call MOTOR_TIMER_SPECIAL
;***** Activar Control Temps Timer ***
IFDEF TEST_BORDES
ld A,13
call COLORBR
ENDIF
;*************************************
ld HL,SPRRAM
call IPBVRSALTER ;volca buffer Sprite a VRAM amb ALTERNANCIA
;***** Activar Control Temps Timer ***
IFDEF TEST_BORDES
ld A,11
call COLORBR
ENDIF
;*************************************
ld A,(VBUFF_UPDATE)
or A
jr z,.NEXT ; Solo se actualiza si VBUFF_UPDATE != 0
xor A
ld (VBUFF_UPDATE),A
ld HL,VBUFF
ld DE,VRM_MAP
ld B,96
call IWBVRM ;volca buffer a VRAM
.NEXT:
;***** Activar Control Temps Timer ***
IFDEF TEST_BORDES
ld A,7
call COLORBR
ENDIF
;*************************************
call TECLA ;refresca array de teclat
ld HL,JOY1
xor A
call GETJOY ;refresca Joystick 1
ld HL,CURSORS
xor A
call GETCURSORS ;refresca Cursors
ld A,(JOY1)
ld HL,CURSORS
or (HL) ;fusio de cursors+joystick 1
ld (PLY1CONTROL),A
;call GETMOUSE
;***** Activar Control Temps Timer ***
;IFDEF TEST_BORDES
; ld A,9
; call COLORBR
;ENDIF
;*************************************
;Toca musica o FX
ld A,TIMER_MINIPSG
call TIMERCHECK
jr z,.PLAYER_FULL
ld A,(PT3_ON)
or A
jr Z,.END_PLAYER_TIMER_CONTROL
call PT3_PLAY ; Calcula como ande estar los valores del PSG en el Frame
jr .END_PLAYER_TIMER_CONTROL
.PLAYER_FULL:
ld A,(PT3_ON)
or A
jr Z,.END_PLAYER_TIMER_CONTROL
call PT3_PLAY ; Calcula como ande estar los valores del PSG en el Frame
call PT3_ROUT ; pasa los valores que han de sonarl al PSG
.END_PLAYER_TIMER_CONTROL:
; Suma de frames y segundos
ld A,(PT3_FRAME)
inc A
ld (PT3_FRAME),A
cp FPS_MUSIC
jr c,.END_FRAME_SECOND_CONTROL
xor A
ld (PT3_FRAME),A
ld A,(PT3_SECOND)
inc A
ld (PT3_SECOND),A
.END_FRAME_SECOND_CONTROL:
;***********************************
;***** Desctivar Control Temps Timer ***
IFDEF TEST_BORDES
ld A,1
call COLORBR
ENDIF
;********************************
pop IY
pop IX
pop HL
pop DE
pop BC
pop AF
ei
;ret ; [32ks o Megarom] Torna amb RET perque hi ha BIOS i s'enganxa a 0FD9Fh
reti ; [>48ks] No hi ha bios cal fer reti.