Prev: 47955 Up: Map Next: 48096
47966: Table of addresses of script handling routines
Script data is stored in the form of encoded instructions, usually of length two bytes. If the second byte is zero then we are dealing with a script instruction. In this case, the script corresponding to the value of the first byte (an opcode) is executed via a call/jump to one of the routines at addresses stored in this table. In the event that the second byte is not zero, then the two bytes are read as a graphic layout data address, and this address is written to the graphic layout data address field of the entity whose data address is held in IX.
Some of the script routines take parameters.
Opcode No. of parameters Meaning
0 N/A Unused
1 1 Load HL (script data pointer) with new address
2 0 Move entity at IX (and any carried entities) left one character
3 0 Move entity at IX (and any carried entities) right one character
4 1 If current character and target entity are in the same room then set pending sound
5 N/A Unused
6 0 Set Berk's facing-into-screen flag, and reset his facing-left and facing-right flags
7 0 Reset Berk's facing-into-screen, facing-left and facing-right flags
8 0 Set must-process-current-script-data flag for entity at IX
9 0 Reset must-process-current-script-data flag for entity at IX
10 0 Reset entity's walking-left and walking-right flags
11 0 Set walking-left flag and reset walking-right flag
12 0 Set walking-right flag and reset walking-left flag
13 0 Set Berk's facing-left flag, and reset his facing-into-screen and facing-right flags
14 0 Set Berk's facing-right flag, and reset his facing-into-screen and facing-left flags
15 1 Jump to new address if Berk is carrying something
16 0 Have Berk hold an entity, and position it appropriately between his hands
17 0 Have Berk put down an entity in front of him, if appropriate
18 0 Have Berk put down an entity behind him, if appropriate
19 0 Move carried entity to Berk's left as he faces left
20 0 Move carried entity to Berk's right as he faces right
21 0 Move carried entity in front of Berk as he faces out of screen
22 0 Move carried entity behind Berk as he faces into screen
23 1 Start loop (1 / 3)
24 0 End loop (1 / 3)
25 1 Start loop (2 / 3)
26 0 End loop (2 / 3)
27 1 Start loop (3 / 3)
28 0 End loop (3 / 3)
29 0 Make Berk start falling, and drop his carried entity if appropriate
30 0 Check Berk's fall velocity, and react to landing
31 0 React to Berk's landing (unused)
32 0 Update Berk's position and state (flying) depending upon control input
33 0 Advance Berk's jump and select next phase if current phase complete
34 0 Move entity at IX (and any carried entities) up one character
35 0 Move entity at IX (and any carried entities) down one character
36 0 Set Boni's room (level 1) to zero
37 0 Remove flying skeleton creature from level 1, and terminate script processing
38 0 Close the Trap Door
39 0 Open the Trap Door
40 0 Move spider down one character, and if at bottom, advance it to bounce / climb up mode
41 0 Move spider up one character and, if home, reset its timer and make it wait
42 0 Decrease remaining time until spider next descends and if zero, start descent
43 0 Select next action for Drutt depending upon control input
44 0 Move entity up one character
45 0 Move entity down one character
46 0 Move Drutt, or entity he is pushing left one character and start pushed entity falling if appropriate
47 0 Move Drutt, or entity he is pushing right one character and start pushed entity falling if appropriate
48 0 Return (unused)
49 0 Return (unused)
50 0 Advance Drutt's jump and select next phase if current phase complete
51 0 Swap Drutt's current depth level if possible
52 0 Increase worm's age and decrease time until direction change, or react to Drutt's presence
53 0 Move worm left if possible, otherwise choose new direction
54 0 Move worm right if possible, otherwise choose new direction
55 0 Choose new direction and start crawling (worm)
56 0 Give Berk power corresponding to entity eaten
57 0 Cycle attributes (full-screen), clear display buffers and paint red areas outside current room
58 0 Have Berk interact appropriately with a door in front of him
59 0 Have Berk interact appropriately with a door behind him
60 0 Check position of ape-beast and turn if appropriate
61 0 Fire Bubo's projectile
62 0 Move entity at IX into room to the left, if appropriate
63 0 Have skeleton advance or retreat based upon positions of Berk and yellow skull
64 0 Set random (1 to 10) number of iterations in following loop script instruction
47966 DEFW 0 (00)
47968 DEFW 48285 (01)
47970 DEFW 48660 (02)
47972 DEFW 48615 (03)
47974 DEFW 48133 (04)
47976 DEFW 0 (05)
47978 DEFW 48238 (06)
47980 DEFW 48234 (07)
47982 DEFW 48267 (08)
47984 DEFW 48260 (09)
47986 DEFW 48212 (10)
47988 DEFW 48220 (11)
47990 DEFW 48216 (12)
47992 DEFW 48242 (13)
47994 DEFW 48246 (14)
47996 DEFW 48274 (15)
47998 DEFW 48148 (16)
48000 DEFW 48154 (17)
48002 DEFW 48158 (18)
48004 DEFW 48698 (19)
48006 DEFW 48704 (20)
48008 DEFW 48692 (21)
48010 DEFW 48686 (22)
48012 DEFW 48295 (23)
48014 DEFW 48307 (24)
48016 DEFW 48324 (25)
48018 DEFW 48336 (26)
48020 DEFW 48353 (27)
48022 DEFW 48365 (28)
48024 DEFW 48920 (29)
48026 DEFW 48934 (30)
48028 DEFW 48976 (31)
48030 DEFW 48487 (32)
48032 DEFW 49010 (33)
48034 DEFW 48541 (34)
48036 DEFW 48567 (35)
48038 DEFW 36950 (36)
48040 DEFW 36957 (37)
48042 DEFW 36984 (38)
48044 DEFW 36990 (39)
48046 DEFW 37778 (40)
48048 DEFW 37718 (41)
48050 DEFW 37753 (42)
48052 DEFW 51779 (43)
48054 DEFW 52029 (44)
48056 DEFW 52038 (45)
48058 DEFW 52047 (46)
48060 DEFW 52142 (47)
48062 DEFW 34901 (48)
48064 DEFW 34901 (49)
48066 DEFW 52243 (50)
48068 DEFW 52309 (51)
48070 DEFW 52967 (52)
48072 DEFW 52870 (53)
48074 DEFW 52889 (54)
48076 DEFW 52914 (55)
48078 DEFW 36471 (56)
48080 DEFW 36610 (57)
48082 DEFW 36390 (58)
48084 DEFW 36385 (59)
48086 DEFW 38554 (60)
48088 DEFW 38165 (61)
48090 DEFW 48142 (62)
48092 DEFW 41550 (63)
48094 DEFW 41617 (64)
Prev: 47955 Up: Map Next: 48096