Prev: 33291 Up: Map Next: 33393
33361: Command: Match A Special Key
Matches a special key such as save, load or inventory. Reached through the jump table at JumpTable, dispatched from 30160.
Command_MatchASpecialKey 33361 LD HL,33393 Point at the special-key table.
33364 PUSH DE Thirteen entries.
33365 LD D,13
Command_MatchASpecialKey_Loop 33367 LD A,(HL) Jump to Command_MatchASpecialKey_Next if this entry's first byte is not the key.
33368 INC HL
33369 CP C
33370 JR NZ,Command_MatchASpecialKey_Next
33372 LD A,(HL) Jump to Command_MatchASpecialKey_JumpToTheHandler if the second byte matches as well.
33373 CP B
33374 JR Z,Command_MatchASpecialKey_JumpToTheHandler
Command_MatchASpecialKey_Next 33376 INC HL Step to the next pair, and loop back to Command_MatchASpecialKey_Loop until all 13 entries have been tried.
33377 DEC D
33378 JR NZ,Command_MatchASpecialKey_Loop
33380 JP InglishPrepareTheClause_2 Jump to InglishPrepareTheClause_2 when no special key matched.
Command_MatchASpecialKey_JumpToTheHandler 33383 LD DE,25 The handler word sits 25 bytes after the matched pair.
33386 ADD HL,DE
33387 LD E,(HL) Read the low byte of that handler.
33388 INC HL Step on to its high byte.
33389 LD D,(HL) Read the high byte of the handler.
33390 EX DE,HL Take the handler address.
33391 POP DE Jump to the handler this key selected.
33392 JP (HL)
View the equivalent code in;
Prev: 33291 Up: Map Next: 33393