| Marsport | Routines |
| Prev: A606 | Up: Map | Next: A6FA |
|
Used by the routine at String_DrawToSign.
|
||||||||||
|
A special string is made up of word indices and values.
Bit 7 determines if the item is a word index or a single character.
A '0' means look up a word and write it to the buffer.
A '1' means apply character to buffer.
Words include a space afterwards (represented by the '{')
|
||||||||||
| String_WriteSpecial | A6C4 | LD DE,_5b00_buffer | ||||||||
| A6C7 | LD IX,_5b00_buffer | |||||||||
| A6CB | XOR A | |||||||||
| String_WriteSpecial_0 | A6CC | LD (DE),A | Add extra character. (First time this is the length, after that it is padding after a word). | |||||||
| String_WriteSpecial_1 | A6CD | INC DE | Get next item in 'string' | |||||||
| A6CE | LD A,(HL) | |||||||||
| A6CF | BIT 7,A | Is it a word. | ||||||||
| A6D1 | JR Z,String_WriteSpecial_2 | |||||||||
| A6D3 | AND $7F | |||||||||
| A6D5 | LD (DE),A | Place item directly into buffer. | ||||||||
| A6D6 | INC HL | |||||||||
| A6D7 | INC (IX+$00) | |||||||||
| A6DA | DEC B | count down to end. | ||||||||
| A6DB | RET Z | |||||||||
| A6DC | JR String_WriteSpecial_1 | |||||||||
| String_WriteSpecial_2 | A6DE | PUSH BC | Get word based on A | |||||||
| A6DF | PUSH HL | |||||||||
| A6E0 | PUSH DE | |||||||||
| A6E1 | CALL Dictionary_GetWord | |||||||||
| A6E4 | LD A,(_5b00_buffer) | Add length of word to total length | ||||||||
| A6E7 | ADD A,C | |||||||||
| A6E8 | LD (_5b00_buffer),A | |||||||||
| A6EB | POP DE | Copy word into string buffer. | ||||||||
| A6EC | LDIR | |||||||||
| A6EE | POP HL | |||||||||
| A6EF | INC HL | |||||||||
| A6F0 | POP BC | |||||||||
| A6F1 | DEC B | |||||||||
| A6F2 | RET Z | |||||||||
| A6F3 | INC (IX+$00) | |||||||||
| A6F6 | LD A,$7B | Next character to get placed is a special space. | ||||||||
| A6F8 | JR String_WriteSpecial_0 | |||||||||
| Prev: A606 | Up: Map | Next: A6FA |