| Data

5FE0: Event table

Initialised by the routine at 7541, and processed on every pass through the main loop by the routine at 7500. Each of the 14 entries in this table corresponds to a significant event in the game that requires changes to be made (such as making a key available, or Daisy having a new message for Sam). The bits in the first byte of each entry have the following meanings:
Bit(s) | Meaning if set
--- | ---
7 | Entry should be inactive initially
6 | Entry should never be deactivated
1-5 | Unused
0 | Entry is inactive
The first entry makes Sam's oil man disguise work with the gangsters at no. 19, and makes the policemen roam the entire city (instead of just the sidewalk near Sam's office) while on the beat. It is triggered at the start of a new game.
5FE0 | DEFB $00 |
5FE1 | DEFB $0D | 13 bytes until the next entry
5FE2 | DEFB $01 | 1 condition follows
5FE3 | DEFW $7FEE | 7FEE holds the game mode indicator
5FE5 | DEFB $28 | JR Z (for the instruction at 7522)
5FE6 | DEFB $01 | Game mode
5FE7 | DEFB $02 | 2 POKEs follow (to do if the game mode is 1)
5FE8 | DEFW $FD4C | FD4C holds the disguise ID in the region definition table at FD44
5FEA | DEFB $07 | Disguise ID (oil man)
5FEB | DEFW $7364 | Set the operand of the 'OR' instruction at 7363 to 0 (to make the policemen roam the entire city)
5FED | DEFB $00
The next entry makes Sam's oil man disguise known to the gangsters at no. 19. It is triggered when Sam passes the point on the rope above the roof of no. 19 where someone below says 'CRUISE WAS DRESSED AS THE OIL MAN. DONT LET ANYONE PAST'.
5FEE | DEFB $00 |
5FEF | DEFB $0A | 10 bytes until the next entry
5FF0 | DEFB $01 | 1 condition follows
5FF1 | DEFW $7D40 | The object table entry at 7D40 is for where someone below says 'CRUISE WAS DRESSED AS THE OIL MAN...'
5FF3 | DEFB $20 | JR NZ (for the instruction at 7522)
5FF4 | DEFB $20 |
5FF5 | DEFB $01 | 1 POKE follows
5FF6 | DEFW $FD4C | FD4C holds the disguise ID in the region definition table at FD44
5FF8 | DEFB $FF | Disguise ID (matches none of Sam's)
The next entry lines up phone messages 0x3A, 0x3B and 0x3C for Sam. It is triggered as soon as Sam's score hits 50 (about 4m10s after the game has started).
5FF9 | DEFB $00 |
5FFA | DEFB $10 | 16 bytes until the next entry
5FFB | DEFB $01 | 1 condition follows
5FFC | DEFW $7F9C | 7F9C holds the LSB of the score
5FFE | DEFB $30 | JR NC (for the instruction at 7522)
5FFF | DEFB $32 | Score LSB for comparison
6000 | DEFB $03 | 3 POKEs follow (to do when the score LSB is >= 50)
6001 | DEFW $6B75 | Initialise phone message 0x3A: 'DAISY SAID 'LANA RANG - HER NEW NUMBERS 7162. THE POLICE WERE HERE''
6003 | DEFB $5C
6004 | DEFW $6B78 | Initialise phone message 0x3B: 'LANA ANSWERED 'OOH SAM! THEY KILLED MY FIANCE AND STOLE THE BUDGIE''
6006 | DEFB $24
6007 | DEFW $6B7B | Initialise phone message 0x3C: 'LANA ANSWERED 'OOH SAM! THAT CROOK THE FAT MAN'S JUST MOVED INTO NO 15''
6009 | DEFB $24
The next entry makes the required changes when Sam enters no. 15 using the key in game mode 1.
600A | DEFB $00 |
600B | DEFB $27 | 39 bytes until the next entry
600C | DEFB $03 | 3 conditions follow
600D | DEFW $E601 | This address holds Sam's x-coordinate
600F | DEFB $28 | JR Z (for the instruction at 7522)
6010 | DEFB $F9 |
6011 | DEFW $E602 | This address holds Sam's y-coordinate
6013 | DEFB $28 | JR Z (for the instruction at 7522)
6014 | DEFB $1D |
6015 | DEFW $7FEA | 7FEA holds the key inventory
6017 | DEFB $30 | JR NC (for the instruction at 7522)
6018 | DEFB $40 | Bit 6 set: Sam has the key to no. 15
6019 | DEFB $08 | 8 POKEs follow
601A | DEFW $6B51 | Initialise phone message 0x3F: 'DAISY SAID 'SAM - A GANGSTER'S WATCHING FOR YOU OUTSIDE THE POLICE STATION''
601C | DEFB $5E
601D | DEFW $6B54 | Initialise phone message 0x40: 'A VOICE SAID 'OK FATS THE HOOK'S AT NO 74 AND ALS GUARDING IT''
601F | DEFB $5E
6020 | DEFW $6B7E | Initialise phone message 0x4C: 'DAISY SAID 'LANA RANG - THAT FAT MAN HAS TWO KEYS NOT JUST ONE ''
6022 | DEFB $5C
6023 | DEFW $6B81 | Initialise phone message 0x41: 'LANA ANSWERED 'OOH SAM! BUD SAID HE'D MEET ME ALONE IN THE HOTELS RIGHT HAND GREEN ROOM. I'M SCARED - WILL YOU GO INSTEAD?''
6025 | DEFB $24
6026 | DEFW $7D38 | Disable the object table entry at 7D38 (for where someone growls 'NO KEY EH!' in no. 15)
6028 | DEFB $21
6029 | DEFW $750C | Change the operand of the JP instruction at 750B to 6152 (to display the cutscene before entering game mode 2)
602B | DEFB $52
602C | DEFW $750D
602E | DEFB $61
602F | DEFW $605A | Activate the entry at 605A (below)
6031 | DEFB $80
The next entry changes the operand of the JP instruction at 750B to 7A04 to send the police after Sam when he finds the dead body on the top floor of the hotel.
6032 | DEFB $00 |
6033 | DEFB $11 | 17 bytes until the next entry
6034 | DEFB $02 | 2 conditions follow
6035 | DEFW $E601 | This address holds Sam's x-coordinate
6037 | DEFB $28 | JR Z (for the instruction at 7522)
6038 | DEFB $40 | x-coordinate for comparison
6039 | DEFW $E602 | This address holds Sam's y-coordinate
603B | DEFB $28 | JR Z (for the instruction at 7522)
603C | DEFB $07 | y-coordinate for comparison
603D | DEFB $02 | 2 POKEs follow
603E | DEFW $750C | Change the operand of the JP instruction at 750B to 7A04
6040 | DEFB $04
6041 | DEFW $750D
6043 | DEFB $7A
The next entry restarts Al's command list when Sam calls 6124, thus giving Sam a chance to get past him and collect the hook.
6044 | DEFB $40 | Bit 6 set: always active
6045 | DEFB $15 | 21 bytes until the next entry
6046 | DEFB $03 | 3 conditions follow
6047 | DEFW $7F9A | 7F9A holds the ID of the telephone Sam is calling
6049 | DEFB $28 | JR Z (for the instruction at 7522)
604A | DEFB $66 | Telephone ID: 6124 (no. 74, second floor)
604B | DEFW $7FFE | 7FFE holds X, the x-coordinate of the leftmost column of the play area on screen
604D | DEFB $38 | JR C (for the instruction at 7522)
604E | DEFB $38 | x-coordinate for comparison
604F | DEFW $DD16 | This is byte 0x16 of character 0xDD's buffer (used by Al at no. 74 when X<56)
6051 | DEFB $28 | JR Z (for the instruction at 7522)
6052 | DEFB $0C | Command list offset for comparison (points at the fourth command in the command list at FD30)
6053 | DEFB $02 | 2 POKEs follow
6054 | DEFW $DD16 | This is byte 0x16 of character 0xDD's buffer (used by Al at no. 74)
6056 | DEFB $00 | Set this to 0 to restart Al's command list
6057 | DEFW $DD09 | This is byte 0x09 of character 0xDD's buffer (used by Al at no. 74)
6059 | DEFB $00 | Remove the primary command routine address (7A6A) from bytes 0x08 and 0x09 of Al's buffer (so that the first command in the command list takes over immediately)
The next entry (activated by the one above at 600A) lines up phone message 0x42 ('A VOICE SAID 'OK LANA THE KEY TO 74'S IN THE ROOM PAST THE CATWALK BUT THERE'S A GUARD'') and makes the key to no. 74 available when Sam enters the hotel's right-hand green room while disguised as a woman.
605A | DEFB $81 |
605B | DEFB $1C | 28 bytes until the next entry
605C | DEFB $04 | 4 conditions follow
605D | DEFW $7FC9 | 7FC9 holds the ID of Sam's current disguise
605F | DEFB $28 | JR Z (for the instruction at 7522)
6060 | DEFB $04 | Disguise ID (woman)
6061 | DEFW $E602 | This address holds Sam's y-coordinate
6063 | DEFB $28 | JR Z (for the instruction at 7522)
6064 | DEFB $0D | y-coordinate for comparison
6065 | DEFW $E601 | This address holds Sam's x-coordinate
6067 | DEFB $30 | JR NC (for the instruction at 7522)
6068 | DEFB $5E | x-coordinate for comparison
6069 | DEFW $E601 | This address holds Sam's x-coordinate
606B | DEFB $38 | JR C (for the instruction at 7522)
606C | DEFB $65 | x-coordinate for comparison
606D | DEFB $03 | 3 POKEs follow
606E | DEFW $6B57 | Line up phone message 0x42: 'A VOICE SAID 'OK LANA THE KEY TO 74'S IN THE ROOM PAST THE CATWALK BUT THERE'S A GUARD''
6070 | DEFB $2C
6071 | DEFW $7D24 | Make the key to no. 74 available
6073 | DEFB $90
6074 | DEFW $6077 | Activate the next entry at 6077 (below)
6076 | DEFB $80
The next entry (activated by the one above at 605A) lines up phone message 0x44 ('DAISY SAID 'ALS NUMBER'S 6124''), and displays the cutscene before entering game mode 3. It is triggered when Sam reaches the location with coordinates (10,8) (on the stairs leading up to the roof of the apartment building next to no. 74).
6077 | DEFB $81 |
6078 | DEFB $14 | 20 bytes until the next entry
6079 | DEFB $02 | 2 conditions follow
607A | DEFW $E602 | This address holds Sam's y-coordinate
607C | DEFB $28 | JR Z (for the instruction at 7522)
607D | DEFB $08 | y-coordinate for comparison
607E | DEFW $E601 | This address holds Sam's x-coordinate
6080 | DEFB $28 | JR Z (for the instruction at 7522)
6081 | DEFB $0A | x-coordinate for comparison
6082 | DEFB $03 | 3 POKEs follow
6083 | DEFW $6B84 | Line up phone message 0x44: 'DAISY SAID 'ALS NUMBER'S 6124''
6085 | DEFB $5C
6086 | DEFW $750C | Change the operand of the JP instruction at 750B to 6152 (to display the cutscene before entering game mode 3)
6088 | DEFB $52
6089 | DEFW $750D
608B | DEFB $61
The next entry makes the key to no. 27 available when Sam knocks the Fat Man over.
608C | DEFB $00 |
608D | DEFB $0A | 10 bytes until the next entry
608E | DEFB $01 | 1 condition follows
608F | DEFW $E102 | This address holds character 0xE1's y-coordinate (character 0xE1 is the Fat Man in game mode 2)
6091 | DEFB $28 | JR Z (for the instruction at 7522)
6092 | DEFB $25 | y-coordinate for comparison (lying on the road)
6093 | DEFB $01 | 1 POKE follows
6094 | DEFW $7D2C | Make the key to no. 27 available
6096 | DEFB $90
The next entry makes the required changes when Sam enters the room above his office while in possession of all four keys.
6097 | DEFB $00 |
6098 | DEFB $18 | 24 bytes until the next entry
6099 | DEFB $03 | 3 conditions follow
609A | DEFW $E602 | This address holds Sam's y-coordinate
609C | DEFB $28 | JR Z (for the instruction at 7522)
609D | DEFB $0D | y-coordinate for comparison
609E | DEFW $E601 | This address holds Sam's x-coordinate
60A0 | DEFB $28 | JR Z (for the instruction at 7522)
60A1 | DEFB $E8 | x-coordinate for comparison
60A2 | DEFW $7FEA | 7FEA holds the key inventory
60A4 | DEFB $28 | JR Z (for the instruction at 7522)
60A5 | DEFB $78 | Bits 3-6 set: Sam has all four keys
60A6 | DEFB $03 | 3 POKEs follow
60A7 | DEFW $7D20 | Make the budgie available
60A9 | DEFB $C0
60AA | DEFW $7FEB | Clear all flags at 7FEB so that Sam won't be chased by the police
60AC | DEFB $00
60AD | DEFW $7364 | Set the operand of the 'OR' instruction at 7363 to 192 (to make the policemen stay close to Sam's office while on the beat)
60AF | DEFB $C0
The next entry lines up phone message 0x48 ('LANA ANSWERED 'OOH SAM! YOUVE GOT THE BIRD. SEE YOU IN YOUR OFFICE'') when Sam gets the budgie.
60B0 | DEFB $00 |
60B1 | DEFB $0A | 10 bytes until the next entry
60B2 | DEFB $01 | 1 condition follows
60B3 | DEFW $7FE9 | 7FE9 holds the object inventory
60B5 | DEFB $28 | JR Z (for the instruction at 7522)
60B6 | DEFB $80 | Bit 7 set: Sam has the budgie
60B7 | DEFB $01 | 1 POKE follows
60B8 | DEFW $6B87 | Line up phone message 0x48: 'LANA ANSWERED 'OOH SAM! YOUVE GOT THE BIRD. SEE YOU IN YOUR OFFICE''
60BA | DEFB $24
The next entry disables phone message 0x48 ('LANA ANSWERED 'OOH SAM! YOUVE GOT THE BIRD. SEE YOU IN YOUR OFFICE'') if Sam doesn't have the budgie (either because he hasn't found it yet, or it's been taken from him).
60BB | DEFB $40 | Bit 6 set: always active
60BC | DEFB $0A | 10 bytes until the next entry
60BD | DEFB $01 | 1 condition follows
60BE | DEFW $7FE9 | 7FE9 holds the object inventory
60C0 | DEFB $20 | JR NZ (for the instruction at 7522)
60C1 | DEFB $80 | Bit 7 set: Sam has the budgie (and only the budgie; this is a bug)
60C2 | DEFB $01 | 1 POKE follows
60C3 | DEFW $6B87 | Disable phone message 0x48: 'LANA ANSWERED 'OOH SAM! YOUVE GOT THE BIRD. SEE YOU IN YOUR OFFICE''
60C5 | DEFB $00
The next entry sends Lana on her way to Sam's office when Sam phones her while in possession of the budgie.
60C6 | DEFB $00 |
60C7 | DEFB $11 | 17 bytes until the next entry
60C8 | DEFB $02 | 2 conditions follow
60C9 | DEFW $7FE9 | 7FE9 holds the object inventory
60CB | DEFB $28 | JR Z (for the instruction at 7522)
60CC | DEFB $80 | Bit 7 set: Sam has the budgie (and only the budgie; this is a bug)
60CD | DEFW $6B87 | This is the entry for phone message 0x48 for Sam
60CF | DEFB $28 | JR Z (for the instruction at 7522)
60D0 | DEFB $00 | 0 means the phone message has been received by Sam
60D1 | DEFB $02 | 2 POKES follow
60D2 | DEFW $60D8 | Activate the entry at 60D8 (below)
60D4 | DEFB $80
60D5 | DEFW $E109 | Set byte 0x09 of character 0xE1's buffer to 0 (character 0xE1 is Lana in game mode 3), triggering a move to the next instruction: go to Sam's office (see FDAC)
60D7 | DEFB $00
The next entry (activated by the one above at 60C6) immobilises Sam until the end of the game when Lana meets him in his office.
60D8 | DEFB $81 |
60D9 | DEFB $19 | 25 bytes until the next entry
60DA | DEFB $04 | 4 conditions follow
60DB | DEFW $E116 | This is byte 0x16 of character 0xE1's buffer (character 0xE1 is Lana in game mode 3)
60DD | DEFB $28 | JR Z (for the instruction at 7522)
60DE | DEFB $08 | This command list offset points past the end of the command list
60DF | DEFW $E602 | This address holds Sam's y-coordinate
60E1 | DEFB $28 | JR Z (for the instruction at 7522)
60E2 | DEFB $13 | y-coordinate for comparison
60E3 | DEFW $E601 | This address holds Sam's x-coordinate
60E5 | DEFB $30 | JR NC (for the instruction at 7522)
60E6 | DEFB $DE | x-coordinate for comparison
60E7 | DEFW $E601 | This address holds Sam's x-coordinate
60E9 | DEFB $38 | JR C (for the instruction at 7522)
60EA | DEFB $E7 | x-coordinate for comparison
60EB | DEFB $02 | 2 POKEs follow
60EC | DEFW $7FFC | Set bit 1 of Sam's status flags at 7FFC
60EE | DEFB $02
60EF | DEFW $E60D | Set byte 0x0D of Sam's buffer to 0 (to indicate that Sam has just met Lana; see 6100)
60F1 | DEFB $00
And finally the end marker.
60F2 | DEFB $FF |