![]() |
Routines |
Prev: 28807 | Up: Map |
|
||||||||||
28882 | LD L,110 | Bytes 109 and 110 of the character's buffer hold the address of the next character in the submessage | ||||||||
28884 | LD A,(HL) | |||||||||
28885 | AND A | Are we in a submessage at the moment? | ||||||||
28886 | JR Z,28904 | Jump if not | ||||||||
28888 | LD D,A | DE=address of the next character in the submessage | ||||||||
28889 | DEC L | |||||||||
28890 | LD E,(HL) | |||||||||
28891 | LD A,(DE) | Pick up this character in A | ||||||||
28892 | AND A | Has the submessage finished? | ||||||||
28893 | JR Z,28901 | Jump if so | ||||||||
28895 | NOP | |||||||||
28896 | INC DE | Move to the next character in the submessage, and store its address in bytes 109 and 110 of the character's buffer | ||||||||
28897 | LD (HL),E | |||||||||
28898 | INC L | |||||||||
28899 | LD (HL),D | |||||||||
28900 | RET | |||||||||
The submessage has finished.
|
||||||||||
28901 | LD (HL),A | Zero out bytes 109 and 110 of the character's buffer to indicate that the submessage is finished | ||||||||
28902 | INC L | |||||||||
28903 | LD (HL),A | |||||||||
We are dealing with the main message.
|
||||||||||
28904 | LD L,108 | DE=address of the next character in the main message (collected from bytes 107 and 108 of the character's buffer) | ||||||||
28906 | LD D,(HL) | |||||||||
28907 | DEC L | |||||||||
28908 | LD E,(HL) | |||||||||
28909 | LD A,(DE) | Pick up the next character of the message | ||||||||
28910 | INC DE | Move to the next character in the main message, and store its address in bytes 107 and 108 of the character's buffer | ||||||||
28911 | LD (HL),E | |||||||||
28912 | INC L | |||||||||
28913 | LD (HL),D | |||||||||
28914 | INC L | L=109 | ||||||||
28915 | BIT 7,A | Is the ASCII code of the next character < 128? | ||||||||
28917 | JR Z,28938 | Jump if so | ||||||||
The ASCII code of the next character is >= 128, which refers to an entry in one of the symbol/element, capital city/country and date/battle question-and-answer pairs.
|
||||||||||
28919 | AND 127 | Set DE to 57088+12*(A-128) | ||||||||
28921 | LD E,A | |||||||||
28922 | EX DE,HL | |||||||||
28923 | ADD A,A | |||||||||
28924 | ADD A,L | |||||||||
28925 | LD L,A | |||||||||
28926 | LD H,56 | |||||||||
28928 | JR NC,28931 | |||||||||
28930 | INC H | |||||||||
28931 | ADD HL,HL | |||||||||
28932 | ADD HL,HL | |||||||||
28933 | DEC H | |||||||||
28934 | EX DE,HL | |||||||||
28935 | LD A,(DE) | Pick up the first character of this submessage in A and store the next address in bytes 109 and 110 of the character's buffer | ||||||||
28936 | JR 28896 | |||||||||
The ASCII code of the next character in the message is < 128.
|
||||||||||
28938 | CP 32 | Return if the next character is a normal, printable character (ASCII code >= 32) | ||||||||
28940 | RET NC | |||||||||
28941 | CP 16 | Return if the ASCII code of the next character in the message is < 16 | ||||||||
28943 | RET C | |||||||||
The ASCII code of the next character in the message is 16-24. We have a submessage to deal with, which will be one of the following:
|
||||||||||
28944 | SUB 16 | Point DE at the appropriate submessage from the table above | ||||||||
28946 | LD E,A | |||||||||
28947 | ADD A,A | |||||||||
28948 | ADD A,A | |||||||||
28949 | ADD A,A | |||||||||
28950 | SUB E | |||||||||
28951 | ADD A,A | |||||||||
28952 | ADD A,128 | |||||||||
28954 | LD E,A | |||||||||
28955 | LD D,217 | |||||||||
28957 | LD A,(DE) | Pick up the first character of the submessage in A | ||||||||
28958 | JR 28896 | Store the address of the next character in the submessage |
Prev: 28807 | Up: Map |