Routines |
Prev: 21D6 | Up: Map | Next: 2294 |
CO_TEMP_1 | 21E1 | RST $20 | Consider the next character in the BASIC statement. | |
This entry point is used by the routine at CLASS_09.
|
||||
CO_TEMP_2 | 21E2 | CALL CO_TEMP_3 | Jump forward to see if the present code represents an embedded 'temporary' colour item. Return carry set if not a colour item. | |
21E5 | RET C | |||
21E6 | RST $18 | Fetch the present character. | ||
21E7 | CP "," | Jump back if it is either a ',' or a ';'; otherwise there has been an error. | ||
21E9 | JR Z,CO_TEMP_1 | |||
21EB | CP ";" | |||
21ED | JR Z,CO_TEMP_1 | |||
21EF | JP REPORT_C | Exit via 'report C'. | ||
This entry point is used by the routine at PR_ITEM_1.
|
||||
CO_TEMP_3 | 21F2 | CP $D9 | Return with the carry flag set if the code is not in the range +D9 to +DE (INK to OVER). | |
21F4 | RET C | |||
21F5 | CP $DF | |||
21F7 | CCF | |||
21F8 | RET C | |||
21F9 | PUSH AF | The colour item code is preserved whilst CH-ADD is advanced to address the parameter that follows it. | ||
21FA | RST $20 | |||
21FB | POP AF | |||
CO_TEMP_4 | 21FC | SUB $C9 | The token range (+D9 to +DE) is reduced to the control character range (+10 to +15). | |
21FE | PUSH AF | The control character code is preserved whilst the parameter is moved to the calculator stack. | ||
21FF | CALL CLASS_06 | |||
2202 | POP AF | |||
2203 | AND A | A return is made at this point if syntax is being checked. | ||
2204 | CALL UNSTACK_Z | |||
2207 | PUSH AF | The control character code is preserved whilst the parameter is moved to the D register. | ||
2208 | CALL FIND_INT1 | |||
220B | LD D,A | |||
220C | POP AF | |||
220D | RST $10 | The control character is sent out. | ||
220E | LD A,D | Then the parameter is fetched and sent out before returning. | ||
220F | RST $10 | |||
2210 | RET | |||
CO_TEMP_5 | 2211 | SUB $11 | Reduce the range and jump forward with INK and PAPER. | |
2213 | ADC A,$00 | |||
2215 | JR Z,CO_TEMP_7 | |||
2217 | SUB $02 | Reduce the range once again and jump forward with FLASH and BRIGHT. | ||
2219 | ADC A,$00 | |||
221B | JR Z,CO_TEMP_C | |||
The colour control code will now be +01 for INVERSE and +02 for OVER and the system variable P-FLAG is altered accordingly.
|
||||
221D | CP $01 | Prepare to jump with OVER. | ||
221F | LD A,D | Fetch the parameter. | ||
2220 | LD B,$01 | Prepare the mask for OVER. | ||
2222 | JR NZ,CO_TEMP_6 | Now jump. | ||
2224 | RLCA | Bit 2 of the A register is to be reset for INVERSE 0 and set for INVERSE 1; the mask is to have bit 2 set. | ||
2225 | RLCA | |||
2226 | LD B,$04 | |||
CO_TEMP_6 | 2228 | LD C,A | Save the A register whilst the range is tested. | |
2229 | LD A,D | The correct range for INVERSE and OVER is only '0-1'. | ||
222A | CP $02 | |||
222C | JR NC,REPORT_K | |||
222E | LD A,C | Restore the A register. | ||
222F | LD HL,$5C91 | It is P-FLAG that is to be changed. | ||
2232 | JR CO_CHANGE | Exit via CO_CHANGE and alter P-FLAG using B as a mask, i.e. bit 0 for OVER and bit 2 for INVERSE. | ||
PAPER and INK are dealt with by the following routine. On entry the carry flag is set for INK.
|
||||
CO_TEMP_7 | 2234 | LD A,D | Fetch the parameter. | |
2235 | LD B,$07 | Prepare the mask for INK. | ||
2237 | JR C,CO_TEMP_8 | Jump forward with INK. | ||
2239 | RLCA | Multiply the parameter for PAPER by eight. | ||
223A | RLCA | |||
223B | RLCA | |||
223C | LD B,$38 | Prepare the mask for PAPER. | ||
CO_TEMP_8 | 223E | LD C,A | Save the parameter in the C register whilst the range of the parameter is tested. | |
223F | LD A,D | Fetch the original value. | ||
2240 | CP $0A | Only allow PAPER/INK a range of '0' to '9'. | ||
2242 | JR C,CO_TEMP_9 | |||
This entry point is used by the routine at BORDER.
Report K - Invalid colour.
|
||||
REPORT_K | 2244 | RST $08 | Call the error handling routine. | |
2245 | DEFB $13 | |||
Continue to handle PAPER and INK.
|
||||
CO_TEMP_9 | 2246 | LD HL,$5C8F | Prepare to alter ATTR-T, MASK-T and P-FLAG. | |
2249 | CP $08 | Jump forward with PAPER/INK '0' to '7'. | ||
224B | JR C,CO_TEMP_B | |||
224D | LD A,(HL) | Fetch the current value of ATTR-T and use it unchanged, by jumping forward, with PAPER/INK '8'. | ||
224E | JR Z,CO_TEMP_A | |||
2250 | OR B | But for PAPER/INK '9' the PAPER and INK colours have to be black and white. | ||
2251 | CPL | |||
2252 | AND $24 | |||
2254 | JR Z,CO_TEMP_A | Jump for black INK/PAPER, but continue for white INK/PAPER. | ||
2256 | LD A,B | |||
CO_TEMP_A | 2257 | LD C,A | Move the value to the C register. | |
|
||||
CO_TEMP_B | 2258 | LD A,C | Move the value. | |
2259 | CALL CO_CHANGE | Now change ATTR-T as needed. | ||
Next MASK-T is considered.
|
||||
225C | LD A,$07 | The bits of MASK-T are set only when using PAPER/INK '8' or '9'. | ||
225E | CP D | |||
225F | SBC A,A | |||
2260 | CALL CO_CHANGE | Now change MASK-T as needed. | ||
Next P-FLAG is considered.
|
||||
2263 | RLCA | The appropriate mask is built up in the B register in order to change bits 4 and 6 as necessary. | ||
2264 | RLCA | |||
2265 | AND $50 | |||
2267 | LD B,A | |||
2268 | LD A,$08 | The bits of P-FLAG are set only when using PAPER/INK '9'. Continue into CO_CHANGE to manipulate P-FLAG. | ||
226A | CP D | |||
226B | SBC A,A | |||
The following subroutine is used to 'impress' upon a system variable the 'nature' of the bits in the A register. The B register holds a mask that shows which bits are to be 'copied over' from A to (HL).
|
||||
CO_CHANGE | 226C | XOR (HL) | The bits, specified by the mask in the B register, are changed in the value and the result goes to form the system variable. | |
226D | AND B | |||
226E | XOR (HL) | |||
226F | LD (HL),A | |||
2270 | INC HL | Move on to address the next system variable. | ||
2271 | LD A,B | Return with the mask in the A register. | ||
2272 | RET | |||
FLASH and BRIGHT are handled by the following routine.
|
||||
CO_TEMP_C | 2273 | SBC A,A | The zero flag will be set for BRIGHT. | |
2274 | LD A,D | The parameter is fetched and rotated. | ||
2275 | RRCA | |||
2276 | LD B,$80 | Prepare the mask for FLASH. | ||
2278 | JR NZ,CO_TEMP_D | Jump forward with FLASH. | ||
227A | RRCA | Rotate an extra time and prepare the mask for BRIGHT. | ||
227B | LD B,$40 | |||
CO_TEMP_D | 227D | LD C,A | Save the value in the C register. | |
227E | LD A,D | Fetch the parameter and test its range; only '0', '1' and '8' are allowable. | ||
227F | CP $08 | |||
2281 | JR Z,CO_TEMP_E | |||
2283 | CP $02 | |||
2285 | JR NC,REPORT_K | |||
The system variable ATTR-T can now be altered.
|
||||
CO_TEMP_E | 2287 | LD A,C | Fetch the value. | |
2288 | LD HL,$5C8F | This is ATTR-T. | ||
228B | CALL CO_CHANGE | Now change the system variable. | ||
The value in MASK-T is now considered.
|
||||
228E | LD A,C | The value is fetched anew. | ||
228F | RRCA | The set bit of FLASH/BRIGHT '8' (bit 3) is moved to bit 7 (for FLASH) or bit 6 (for BRIGHT). | ||
2290 | RRCA | |||
2291 | RRCA | |||
2292 | JR CO_CHANGE | Exit via CO_CHANGE. |
Prev: 21D6 | Up: Map | Next: 2294 |