-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMUSICSERVER.X68
117 lines (91 loc) · 2 KB
/
MUSICSERVER.X68
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
*-----------------------------------------------------------
* Title :
* Written by :
* Date :
* Description:
*-----------------------------------------------------------
INCLUDE "XPMODE.X68"
INCLUDE "MACROS.X68"
INCLUDE "CONST.X68"
ORG $1000
START: ; first instruction of program
MOVE.B #2, (GETHBEAT)
; -- PARTE SISTEMA --- ;
;CONFIGURAR INTERRUPCIONS
;INT OFF
ORI.W #%0000011100000000, SR
;INSTALL
MOVE.L #IRQILLEGAL, $10
MOVE.L #CHECKHBEAT, (INTBASE+(4*7))
;CONFIGURE
;CHECKRATE
MOVE.B #32, D0
MOVE.B #6, D1
MOVE.B #$87, D2
MOVE.L #CHECKRATE, D3
TRAP #15
;SET SR
ANDI.W #%1111100011111111, SR
;ENABLE
MOVE.B #32, D0
MOVE.B #5, D1
TRAP #15
; -- SERVIROR COMO TAL ---;
;CARGAR CANCIONES
BSR START_SERVER
MOVE.B #13, D0
LEA TXTOK, A1
TRAP #15
.CMDLOOP:
SUBQ.L #2, SP
BSR READ_DATA
MOVE.W (SP)+, D0
MOVE.W D0, D1
MOVE.W D0, -(SP)
MOVE.B #17, D0
LEA TXTCMD, A1
TRAP #15
MOVE.W (SP)+, D0
CMP.W #CMDPBGM, D0
BNE .NOPLAY
MOVE.B #1, (GETHBEAT)
SUBQ.L #2, SP
BSR READ_DATA
BSR PLAY_BGM
ADDQ.L #2, SP
BRA .CMDLOOP
.NOPLAY:
CMP.W #CMDSTOP, D0
BNE .NOSTOP
MOVE.B #1, (GETHBEAT)
BSR STOP_SFX
.NOSTOP:
CMP.W #CDMHBEAT, D0
BNE .CMDLOOP
MOVE.B #1, (GETHBEAT)
BRA .CMDLOOP
EXIT:
BSR STOP_SFX
SIMHALT ; halt simulator
GETHBEAT DC.B 0
DS.W 0
CHECKHBEAT:
CMP.B #2, (GETHBEAT)
BEQ .WAITC
TST.B (GETHBEAT)
BNE .REV
BRA EXIT
.REV:
CLR.B (GETHBEAT)
.WAITC:
RTE
IRQILLEGAL:
BRA EXIT
INCLUDE "TCPCLIENT.X68"
INCLUDE "MUSIC.X68"
INCLUDE "DATA/SOUNDS.X68"
END START ; last line of source
*~Font name~Courier New~
*~Font size~10~
*~Tab type~1~
*~Tab size~4~