1;Copyright (c) 1990-2012 by Neil Dodwell
2;Released with permission from Neil Dodwell under GPLv2
3;See LICENSE file for full license text
4;---------------------------------------------------Equates and definitions----
5
6Inputport	equ	63h
7Mapwidth	equ	66 ;132/2
8Maplength	equ	60 ;6/2
9Tablesize	equ	32		;size of each entry in spritetable
10Itempicsize	equ	44		;size of inventory slots
11Opsy	equ	52
12Opsx	equ	60
13Inventx	equ	80
14Inventy 	equ	58
15Zoomx	equ	8
16Zoomy	equ	132
17Keypadx	equ	36+112
18Keypady	equ	72
19Diaryx	equ	68+24
20Diaryy	equ	48+12
21Symbolx	equ	64
22Symboly	equ	56
23Menux	equ	80+40
24Menuy	equ	60
25
26	if	foreign
27Undertextsizex	equ	228
28Undertextsizey	equ	13
29Undertimedysize	equ	30
30	else
31Undertextsizex	equ	180
32Undertextsizey	equ	10
33Undertimedysize	equ	24
34	endif
35
36Numchanges	equ	250
37
38Textunder	equ	0		;offsets for items in buffer segment
39Openinvlist	equ	textunder+(undertextsizex*undertextsizey)
40Ryaninvlist	equ	openinvlist+32
41Pointerback	equ	ryaninvlist+60
42Mapflags	equ	pointerback+(32*32)
43Startpal	equ	mapflags+(11*10*3)
44Endpal	equ	startpal+768
45Maingamepal	equ	endpal+768
46Spritetable	equ	maingamepal+768
47Setlist 	equ	spritetable+(32*tablesize)
48Freelist	equ	setlist+(128*5)
49Exlist	equ	freelist+(80*5)
50Peoplelist	equ	exlist+(100*5)
51Zoomspace	equ	peoplelist+(12*5)
52Printedlist	equ	zoomspace+(46*40)
53Listofchanges	equ	printedlist+(5*80)
54Undertimedtext	equ	listofchanges+(numchanges*4)
55Rainlist	equ	undertimedtext+(256*undertimedysize)
56Initialreelrouts	equ	rainlist+(6*64)
57Initialvars	equ	initialreelrouts+lenofreelrouts
58Lengthofbuffer	equ	initialvars+lengthofvars
59
60Flags	equ	0		;offsets of items in backdrop segment
61Blocks	equ	flags+192
62Map	equ	0
63Lengthofmap	equ	map+(mapwidth*maplength)
64
65Intextdat	equ	0
66Intext	equ	intextdat+(38*2)
67Blocktextdat	equ	0
68Blocktext	equ	blocktextdat+(98*2)
69Settextdat	equ	0
70Settext 	equ	settextdat+(130*2)
71Freetextdat	equ	0
72Freetext	equ	freetextdat+(82*2)
73
74Numexobjects	equ	114
75Exframeslen	equ	30000
76Extextlen	equ	18000
77
78Exframedata	equ	0
79Exframes	equ	exframedata+2080
80Exdata	equ	exframes+exframeslen
81Extextdat	equ	exdata+(16*numexobjects)
82Extext	equ	extextdat+((numexobjects+2)*2)
83Lengthofextra	equ	extext+extextlen
84
85Framedata	equ	0
86Frames	equ	framedata+2080
87
88Frframedata	equ	0
89Frframes	equ	frframedata+2080
90
91Personframes	equ	0
92Persontxtdat	equ	personframes+24
93Persontext	equ	persontxtdat+(1026*2)
94
95Pathdata	equ	0
96Reellist	equ	pathdata+(36*144)
97
98Lenofmapstore	equ	22*8*20*8
99Maplen	equ	mapwidth*maplength
100Freedatlen	equ	16*80
101Setdatlen	equ	64*128
102Textstart	equ	66*2
103
104;-----------------------------------------------------------------Variables----
105
106
107startvars	db	0
108progresspoints	db	0
109watchon	db	0
110shadeson	db	0
111secondcount	db	0
112minutecount	db	30
113hourcount	db	19
114zoomon	db	1
115location	db	0
116expos	db	0
117exframepos	dw	0
118extextpos	dw	0
119card1money	dw	0
120listpos	dw	0
121ryanpage	db	0
122
123
124watchingtime	dw	0
125reeltowatch	dw	-1		;reel plays from here in mode 0
126endwatchreel	dw	0		;and stops here. Mode set to 1
127speedcount	db	0
128watchspeed	db	0
129reeltohold	dw	-1		;if mode is 1 hold on this reel
130endofholdreel	dw	-1		;if mode is 2 then play to end of
131watchmode	db	-1		;hold reel. Set mode back to -1
132destafterhold	db	0		;set walking destination.
133
134newsitem	db	0
135
136liftflag	db	0
137liftpath	db	0
138lockstatus	db	1
139doorpath	db	0
140counttoopen	db	0
141counttoclose	db	0
142rockstardead	db	0
143generaldead	db	0
144sartaindead	db	0
145aidedead	db	0
146beenmugged	db	0
147
148gunpassflag	db	0
149canmovealtar	db	0
150talkedtoattendant	db	0
151talkedtosparky	db	0
152talkedtoboss	db	0
153talkedtorecep	db	0
154cardpassflag	db	0
155madmanflag	db	0
156keeperflag	db	0
157lasttrigger	db	0
158mandead	db	0
159seed	db	1,2,3
160needtotravel	db	0
161throughdoor	db	0
162newobs	db	0
163ryanon	db	255
164combatcount	db	0
165lastweapon	db	-1
166
167dreamnumber	db	0
168roomafterdream	db	0
169
170shakecounter	db	48
171
172lengthofvars	equ	$-startvars
173
174
175speechcount	db	0
176
177charshift	dw	0
178kerning	db	0
179
180brightness	db	0
181
182roomloaded	db	0
183
184didzoom	db	0
185
186linespacing	dw	10
187textaddressx	dw	13
188textaddressy	dw	182		;address on screen for text
189textlen	db	0
190lastxpos	dw	0
191
192icontop	dw	0
193iconleft	dw	0
194itemframe	db	0
195itemtotran	db	0
196roomad	dw	0
197oldsubject	dw	0
198
199withobject	db	0
200withtype	db	0
201
202lookcounter	dw	0
203
204command	db	0
205commandtype	db	0
206oldcommandtype	db	0
207objecttype	db	0
208getback	db	0
209invopen	db	0
210mainmode	db	0
211pickup	db	0
212lastinvpos	db	0
213examagain	db	0
214newtextline	db	0
215
216openedob	db	0
217openedtype	db	0
218
219oldmapadx	dw	0
220oldmapady	dw	0
221mapadx	dw	0
222mapady	dw	0
223mapoffsetx	dw	104
224mapoffsety	dw	38
225
226mapxstart	dw	0
227mapystart	dw	0
228mapxsize	db	0
229mapysize	db	0
230
231havedoneobs	db	0
232manisoffscreen	db	0
233rainspace	db	0
234
235facing	db	0
236leavedirection	db	0
237turntoface	db	0
238turndirection	db	0
239
240maintimer	dw	0
241introcount	db	0
242arrowad	dw	0
243currentkey	db	0
244oldkey	db	0
245useddirection	db	0
246currentkey2	db	0
247
248timercount	db	0
249oldtimercount	db	0
250
251mapx	db	0
252mapy	db	0
253newscreen	db	0
254ryanx	db	0
255ryany	db	0
256lastflag	db	0
257lastflagex	db	0
258flagx	db	0
259flagy	db	0
260
261currentex	db	0
262currentfree	db	0
263currentframe	dw	0
264framesad	dw	0
265dataad	dw	0
266frsegment	dw	0
267objectx	dw	0
268objecty	dw	0
269offsetx	dw	0
270offsety	dw	0
271savesize	dw	0
272savesource	dw	0
273savex	db	0
274savey	db	0
275currentob	db	0
276priorityDep	db	0	; dep for deprecated, I leave a byte here to minimize changes to the generated code
277
278destpos	db	0
279
280reallocation	db	0	 ;----------;some rooms have more than one
281roomnum	db	0		;place in the Roomdata list, to
282				;account for different start points
283nowinnewroom	db	0		;this variable holds the rooms
284resetmanxy	db	0		;real value - ie:which file it's in
285newlocation	db	-1		;if set then room is loaded at end of watch mode, or straight away if not in watch mode
286autolocation	db	-1
287mustload	db	0
288answered	db	0
289saidno	db	0
290
291doorcheck1	db	0
292doorcheck2	db	0
293doorcheck3	db	0
294doorcheck4	db	0
295
296mousex	dw	0
297mousey	dw	0
298mousebutton	dw	0
299mousebutton1	dw	0
300mousebutton2	dw	0
301mousebutton3	dw	0
302mousebutton4	dw	0
303oldbutton	dw	0
304oldx	dw	0
305oldy	dw	0
306lastbutton	dw	0
307oldpointerx	dw	0
308oldpointery	dw	0
309delherex	dw	0
310delherey	dw	0
311pointerxs	db	32
312pointerys	db	32
313delxs	db	0
314delys	db	0
315pointerframe	db	0
316pointerpower	db	0
317auxpointerframe	db	0
318pointermode	db	0
319pointerspeed	db	0
320pointercount	db	0
321inmaparea	db	0
322
323reelpointer	dw	0
324slotdata	db	0
325thisslot	db	0
326slotflags	db	0
327takeoff	dw	0
328
329talkmode	db	0
330talkpos	db	0
331character	db	0
332persondata	dw	0
333talknum	db	0
334numberinroom	db	0
335
336currentcel	db	0
337oldselection	db	0
338
339stopwalking	db	0
340
341mouseon	db	0
342played	dw	0
343timer1	db	0
344timer2	db	0
345timer3	db	0
346wholetimer	dw	0
347timer1to	db	0
348timer2to	db	0
349timer3to	db	0
350
351watchdump	db	0
352
353currentset	dw	0
354
355logonum	db	0
356oldlogonum	db	0
357newlogonum	db	0
358netseg	dw	0
359netpoint	dw	0
360keynum	db	0
361cursorstate	db	0
362
363pressed	db	0
364presspointer	dw	0
365graphicpress	db	0
366presscount	db	0
367keypadax	dw	0
368keypadcx	dw	0
369lightcount	db	0
370folderpage	db	0
371diarypage	db	0
372menucount	db	0
373symboltopx	db	0
374symboltopnum	db	0
375symboltopdir	db	0
376symbolbotx	db	0
377symbolbotnum	db	0
378symbolbotdir	db	0
379
380symboltolight	db	0
381symbol1	db	0
382symbol2	db	0
383symbol3	db	0
384symbolnum	db	0
385dumpx	dw	0
386dumpy	dw	0
387
388walkandexam	db	0
389walkexamtype	db	0
390walkexamnum	db	0
391
392cursloc	dw	0
393curslocx	dw	0
394curslocy	dw	0
395curpos	dw	0
396monadx	dw	0
397monady	dw	0
398gotfrom	dw	0
399
400monsource	dw	0
401numtodo	dw	0
402
403timecount	dw	0
404counttotimed	dw	0
405timedseg	dw	0
406timedoffset	dw	0
407timedy	db	0
408timedx	db	0
409needtodumptimed	db	0
410
411;recordpos	dw	0
412;rechandle	dw	0
413handle	dw	0
414
415loadingorsave	db	0		;1 if load 2 if save
416currentslot	db	0
417cursorpos	db	0
418
419colourpos	db	0
420fadedirection	db	0
421numtofade	db	0
422fadecount	db	0
423addtogreen	db	0
424addtored	db	0
425addtoblue	db	0
426
427
428lastsoundreel	dw	0
429
430soundbuffer	dw	0
431soundbufferad	dw	0
432soundbufferpage	db	0
433soundtimes	db	0
434needsoundbuff	db	0
435
436oldint9seg	dw	-1
437oldint9add	dw	-1
438oldint8seg	dw	-1
439oldint8add	dw	-1
440oldsoundintseg	dw	0
441oldsoundintadd	dw	0
442soundbaseadd	dw	0
443dsp_status	dw	0
444dsp_write	dw	0
445dmaaddress	db	0
446soundint	db	5
447sounddmachannel	db	1
448sampleplaying	db	255
449testresult	db	0
450currentirq	db	0
451speechloaded	db	0
452speechlength	dw	0
453volume	db	0
454volumeto	db	0
455volumedirection	db	0
456volumecount	db	0
457
458playblock	db	0
459
460wongame	db	0
461
462lasthardkey	db	0
463bufferin	dw	0
464bufferout	dw	0
465
466extras	dw	0	;for allocated memory
467workspace	dw	0	;allocated mem for screen buffer
468mapstore	dw	0	;allocated mem for copy of room
469charset1	dw	0	;allocated mem for normal charset
470tempcharset	dw	0	;monitor char set
471icons1	dw	0	;allocated mem for on screen stuff
472icons2	dw	0
473buffers	dw	0	;allocated mem for buffers
474mainsprites	dw	0	;allocated mem for Ryan sprites
475backdrop	dw	0
476mapdata	dw	0
477
478sounddata	dw	0
479sounddata2	dw	0
480
481recordspace	dw	0
482
483freedat	dw	0
484setdat	dw	0
485
486reel1	dw	-1
487reel2	dw	-1
488reel3	dw	-1
489roomdesc	dw	-1
490freedesc	dw	-1
491setdesc	dw	-1
492blockdesc	dw	-1
493setframes	dw	-1
494freeframes	dw	-1
495people	dw	-1
496reels	dw	-1
497commandtext	dw	-1
498puzzletext	dw	-1
499traveltext	dw	-1
500tempgraphics	dw	-1
501tempgraphics2	dw	-1
502tempgraphics3	dw	-1
503tempsprites	dw	-1
504
505textfile1	dw	-1
506textfile2	dw	-1
507textfile3	dw	-1
508
509blinkframe	db	23
510blinkcount	db	0
511
512
513reasseschanges	db	0	; if it's a 1 then obname will assume that
514pointerspath	db	0	;the command has changed.
515manspath	db	0	;ie. from "walk to" to "Examine"
516pointerfirstpath	db	0
517finaldest	db	0
518destination	db	0
519linestartx	dw	0
520linestarty	dw	0
521lineendx	dw	0
522lineendy	dw	0
523increment1	dw	0
524increment2	dw	0
525lineroutine	db	0
526linepointer	db	0
527linedirection	db	0
528linelength	db	0
529
530liftsoundcount	db	0
531
532emmhandle	dw	0
533emmpageframe	dw	0
534emmhardwarepage	db	0
535
536ch0emmpage	dw	0
537ch0offset	dw	0
538ch0blockstocopy	dw	0
539
540ch0playing	db	0
541ch0repeat	db	0
542ch0oldemmpage	dw	0
543ch0oldoffset	dw	0
544ch0oldblockstocopy	dw	0
545
546ch1playing	db	255
547ch1emmpage	dw	0
548ch1offset	dw	0
549ch1blockstocopy	dw	0
550ch1blocksplayed	dw	0
551
552soundbufferwrite	dw	0
553
554soundemmpage	dw	0
555speechemmpage	dw	0
556
557currentsample	db	-1
558roomssample	db	0
559
560gameerror	db	0
561
562howmuchalloc	dw	0
563