-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path3-enter_rm.asm
127 lines (113 loc) · 2.25 KB
/
3-enter_rm.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
; vi: syntax=asm68k
;{ 1/proc106 }
;:2a4a 3/proc170()
;Enter a room -> SEG/<setup>()
NOWHERE equ (-1)
enter_rm:
movem.l d3-d7/a2-a4/a6, -(sp)
move.w #$ffff, (SysEvtMask).w
;D0/next room, (NOWHERE)?
enter2 move.w next_rm(a5), d0
bmi .entered
cmpi.w #2, winmode(a5)
bne.s .enter3
;window mode #2
scroll move.w demo_end(a5), d7
cmp.w demopos(a5), d7
ble .entered
;same room?
enter3 cmp.w curr_rm(a5), d0
sne glob172(a5)
;curr = next, next = NOWHERE
move.w #NOWHERE, next_rm(a5)
move.w d0, curr_rm(a5)
;index into jump table
enterjt move.w curr_rm(a5), d0
asl.w #3, d0
jsr initrmjt(d0.w)
;A0/room init routine
move.l a0, -(sp)
jsr (a0)
;have exited this room ..
;void (void (*Proc)(void));
exited _UnLoadSeg
tst.b practise(a5)
beq.s .exit2
;practise mode, can't progress
tst.w next_rm(a5)
bmi .exit2
; -> respawn in same room
move.w curr_rm(a5), next_rm(a5)
clr.w entrance(a5)
exit2 bra .enter2
;:2aac 3/data134[6]
dc.w 0, 0, 0
;:2ab2 3/data135[120]
initrmjt:
;[:+0] #0/<ANTE>:0a44
anterm lea 19/proc385(a5), a0
rts
dc.w 0
;[:+8] #1/<CATC>:0914
catacom lea 25/proc394(a5), a0
rts
dc.w 0
;[:+16] #2/<BASE>:0ac8
basemnt lea 13/proc355(a5), a0
rts
dc.w 0
;[:+24] #3/<DUNJ>:10c0
dungeon lea 6/proc308(a5), a0
rts
dc.w 0
;[:+32] #4/<WALL>:094e
wtwall lea 22/proc389(a5), a0
rts
dc.w 0
;[:+40] #5/<WLAB>:0000
wlabyr lea 21/proc387(a5), a0
rts
dc.w 0
;[:+48] #6/<WTOP>:0f48
wttop lea 10/proc334(a5), a0
rts
dc.w 0
;[:+56] #7/<BREW>:07c2
brewery lea 17/proc372(a5), a0
rts
dc.w 0
;[:+64] #8/<ELAB>:0000
elabyr lea 20/proc386(a5), a0
rts
dc.w 0
;[:+72] #9/<ETOP>:0f22
ettop lea 9/proc325(a5), a0
rts
dc.w 0
;[:+80] #10/<CLKT>:0c5a
clocktw lea 14/proc359(a5), a0
rts
dc.w 0
;[:+88] #11/<BKCH>:0fd4
bkchamb lea 11/proc340(a5), a0
rts
dc.w 0
;[:+96] #12/<FORE>:0000
forest lea 23/proc390(a5), a0
rts
dc.w 0
;[:+104] #13/<SWAM>:0000
swamp lea 24/proc391(a5), a0
rts
dc.w 0
;[:+112] #14/<COMP>:097a
comprm lea 12/proc345(a5), a0
rts
dc.w 0
;:2b28 3/proc171()
move.w #15, d1
bra.s .retentr
;:2b2e 3/com_38()
entered move.w #$fffe, (SysEvtMask).w
movem.l (sp)+, d3-d7/a2-a4/a6
retentr rts