Rev 665 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 665 | Rev 678 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | 1 | ||
2 | ;www.fruitcake.plus.com |
2 | ;www.fruitcake.plus.com |
3 | 3 | ||
4 | ;LAST UPDATE: 08.07.2014 savelij |
4 | ;LAST UPDATE: 17.11.2014 savelij |
5 | 5 | ||
- | 6 | include ../../macros.a80 |
|
- | 7 | include ../../global_vars.a80 |
|
6 | include ../../define.a80 |
8 | include ../../define.a80 |
7 | 9 | ||
- | 10 | ;BAS48_ONLY EQU 0 |
|
8 | TAP_EMU_BORDER EQU 0 |
11 | TAP_EMU_BORDER EQU 0 |
9 | 12 | ||
10 | ; ************************************** |
13 | ; ************************************** |
11 | ; *** SPECTRUM 128 ROM 1 DISASSEMBLY *** |
14 | ; *** SPECTRUM 128 ROM 1 DISASSEMBLY *** |
12 | ; ************************************** |
15 | ; ************************************** |
Line 74... | Line 77... | ||
74 | ; through here. |
77 | ; through here. |
75 | 78 | ||
76 | ;; ERROR-1 |
79 | ;; ERROR-1 |
77 | L0008 NOP |
80 | L0008 NOP |
78 | JP RST8_CMP |
81 | JP RST8_CMP |
79 | - | ||
80 | ; LD HL,($5C5D) ; fetch the character address from CH_ADD. |
- | |
81 | ; LD ($5C5F),HL ; copy it to the error pointer X_PTR. |
- | |
82 | ; JR L0053 ; forward to continue at ERROR-2. |
82 | DUPL 0X0010-$,0XFF |
83 | 83 | ||
84 | ; ----------------------------- |
84 | ; ----------------------------- |
85 | ; THE 'PRINT CHARACTER' RESTART |
85 | ; THE 'PRINT CHARACTER' RESTART |
86 | ; ----------------------------- |
86 | ; ----------------------------- |
87 | ; The A register holds the code of the character that is to be sent to |
87 | ; The A register holds the code of the character that is to be sent to |
88 | ; the output stream of the current channel. |
88 | ; the output stream of the current channel. |
89 | ; The alternate register set is used to output a character in the A register |
89 | ; The alternate register set is used to output a character in the A register |
90 | ; so there is no need to preserve any of the current registers (HL,DE,BC). |
90 | ; so there is no need to preserve any of the current registers (HL,DE,BC). |
91 | ; This restart is used 21 times. |
91 | ; This restart is used 21 times. |
92 | 92 | ||
93 | DUPL 0X0010-$,0XFF |
- | |
94 | ;; PRINT-A |
93 | ;; PRINT-A |
95 | L0010: JP L15F2 ; jump forward to continue at PRINT-A-2. |
94 | L0010: JP L15F2 ; jump forward to continue at PRINT-A-2. |
96 | 95 | ||
97 | ; --- |
96 | ; --- |
98 | 97 | ||
99 | DUPL ADR_SEL_ROM-$,0XFF |
98 | DUPL ADR_SEL_ROM-$,0XFF |
100 | L0014 OUT (C),A |
99 | L0014 OUT (C),A |
101 | NOP |
100 | NOP |
102 | RET |
101 | RET |
103 | 102 | ||
104 | DUPL 0X0018-$,0XFF |
- | |
105 | - | ||
106 | ; DB $FF ; this byte is used by the SPECTRUM command in |
- | |
107 | ; ROM 0 to generate an error report "0 OK". |
- | |
108 | ; DB $FF, $FF ; four unused locations. |
- | |
109 | ; DB $FF, $FF ; |
- | |
110 | - | ||
111 | ; ------------------------------- |
103 | ; ------------------------------- |
112 | ; THE 'COLLECT CHARACTER' RESTART |
104 | ; THE 'COLLECT CHARACTER' RESTART |
113 | ; ------------------------------- |
105 | ; ------------------------------- |
114 | ; The contents of the location currently addressed by CH_ADD are fetched. |
106 | ; The contents of the location currently addressed by CH_ADD are fetched. |
115 | ; A return is made if the value represents a character that has |
107 | ; A return is made if the value represents a character that has |
Line 198... | Line 190... | ||
198 | 190 | ||
199 | ;; KEY-INT |
191 | ;; KEY-INT |
200 | L0048: PUSH BC ; save the other |
192 | L0048: PUSH BC ; save the other |
201 | PUSH DE ; main registers. |
193 | PUSH DE ; main registers. |
202 | 194 | ||
203 | IF BAS48_ONLY=1 |
- | |
204 | CALL L02BF |
- | |
205 | ELSE |
- | |
206 | CALL L386E ; Spectrum 128 patch: read the keypad and keyboard |
195 | CALL L386E ; Spectrum 128 patch: read the keypad and keyboard |
207 | ; in the process of reading a key-press. |
196 | ; in the process of reading a key-press. |
208 | ENDIF |
- | |
209 | 197 | ||
210 | L004D: POP DE ; |
198 | L004D: POP DE ; |
211 | POP BC ; restore registers. |
199 | POP BC ; restore registers. |
212 | 200 | ||
213 | POP HL ; |
201 | POP HL ; |
Line 266... | Line 254... | ||
266 | ; The location NMIADD was later used by Interface 1 for other purposes. |
254 | ; The location NMIADD was later used by Interface 1 for other purposes. |
267 | ; On later Spectrums, and the Brazilian Spectrum, the logic of this |
255 | ; On later Spectrums, and the Brazilian Spectrum, the logic of this |
268 | ; routine was reversed. |
256 | ; routine was reversed. |
269 | 257 | ||
270 | ;; RESET |
258 | ;; RESET |
271 | DUPL 0X0066-$,0XFF |
- | |
272 | L0066 NOP |
259 | L0066 PUSH AF |
273 | ; PUSH AF ; save the |
- | |
274 | PUSH HL ; registers. |
260 | PUSH HL ; registers. |
275 | LD HL,($5CB0) ; fetch the system variable NMIADD. |
261 | LD HL,($5CB0) ; fetch the system variable NMIADD. |
276 | LD A,H ; test address |
262 | LD A,H ; test address |
277 | OR L ; for zero. |
263 | OR L ; for zero. |
278 | ; JR NZ,L0070 ; skip to NO-RESET if NOT ZERO |
264 | JR NZ,L0070 ; skip to NO-RESET if NOT ZERO |
279 | JR Z,L0070 |
- | |
280 | JP (HL) ; jump to routine ( i.e. L0000 ) |
265 | JP (HL) ; jump to routine ( i.e. L0000 ) |
281 | 266 | ||
282 | ;; NO-RESET |
267 | ;; NO-RESET |
283 | L0070 POP HL ; restore the |
268 | L0070 POP HL ; restore the |
284 | POP AF ; registers. |
269 | POP AF ; registers. |
Line 1780... | Line 1765... | ||
1780 | OR $02 ; combine with red border colour. |
1765 | OR $02 ; combine with red border colour. |
1781 | 1766 | ||
1782 | ;=============================== |
1767 | ;=============================== |
1783 | RST 8 |
1768 | RST 8 |
1784 | DB _TAPE_EMUL |
1769 | DB _TAPE_EMUL |
1785 | ; LD C,A ; and store initial state long-term in C. |
- | |
1786 | ; CP A ; set the zero flag. |
- | |
1787 | ;=============================== |
1770 | ;=============================== |
1788 | 1771 | ||
1789 | ;; LD-BREAK |
1772 | ;; LD-BREAK |
1790 | L056B: RET NZ ; return if at any time space is pressed. |
1773 | L056B: RET NZ ; return if at any time space is pressed. |
1791 | 1774 | ||
Line 3436... | Line 3419... | ||
3436 | ; --- |
3419 | ; --- |
3437 | 3420 | ||
3438 | ; Tokens and User defined graphics are now separated. |
3421 | ; Tokens and User defined graphics are now separated. |
3439 | 3422 | ||
3440 | ;; PO-T&UDG |
3423 | ;; PO-T&UDG |
3441 | L0B52 IF BAS48_ONLY=1 |
- | |
3442 | SUB 0XA5 |
- | |
3443 | JR NC,L0B5F |
- | |
3444 | ELSE |
- | |
3445 | JP L3B9F ;Spectrum 128 patch |
3424 | L0B52 JP L3B9F ;Spectrum 128 patch |
3446 | NOP |
3425 | NOP |
3447 | ENDIF |
- | |
3448 | 3426 | ||
3449 | L0B56: ADD A,$15 ; add 21d to restore to 0 - 20 |
3427 | L0B56: ADD A,$15 ; add 21d to restore to 0 - 20 |
3450 | PUSH BC ; save current print position |
3428 | PUSH BC ; save current print position |
3451 | LD BC,($5C7B) ; fetch UDG to address bit patterns |
3429 | LD BC,($5C7B) ; fetch UDG to address bit patterns |
3452 | JR L0B6A ; to PO-CHAR-2 - common code to lay down |
3430 | JR L0B6A ; to PO-CHAR-2 - common code to lay down |
Line 4332... | Line 4310... | ||
4332 | 4310 | ||
4333 | L0EAC: DI ; disable interrupts as this is time-critical. |
4311 | L0EAC: DI ; disable interrupts as this is time-critical. |
4334 | ;=============================== |
4312 | ;=============================== |
4335 | RST 8 |
4313 | RST 8 |
4336 | DB _AY_PRN_SCR |
4314 | DB _AY_PRN_SCR |
4337 | ; LD B,$B0 ; top 176 lines. |
- | |
4338 | ;=============================== |
4315 | ;=============================== |
4339 | 4316 | ||
4340 | L0EAF LD HL,$4000 ; address start of the display file. |
4317 | L0EAF LD HL,$4000 ; address start of the display file. |
4341 | 4318 | ||
4342 | ; now enter a loop to handle each pixel line. |
4319 | ; now enter a loop to handle each pixel line. |
Line 4442... | Line 4419... | ||
4442 | ; bit 1 set - slows printer. |
4419 | ; bit 1 set - slows printer. |
4443 | ; bit 1 reset - normal speed. |
4420 | ; bit 1 reset - normal speed. |
4444 | 4421 | ||
4445 | ;; COPY-LINE |
4422 | ;; COPY-LINE |
4446 | ;=============================== |
4423 | ;=============================== |
4447 | L0EF4 |
- | |
4448 | LD A,(HL) |
4424 | L0EF4 LD A,(HL) |
4449 | RST 8 |
4425 | RST 8 |
4450 | DB _AY_PRN_A_ |
4426 | DB _AY_PRN_A_ |
4451 | RET |
4427 | RET |
4452 | ; LD A,B ; fetch the counter 1-8 or 1-176 |
- | |
4453 | ; CP $03 ; is it 01 or 02 ?. |
- | |
4454 | ; SBC A,A ; result is $FF if so else $00. |
- | |
4455 | ;=============================== |
4428 | ;=============================== |
4456 | AND $02 ; result is 02 now else 00. |
4429 | AND $02 ; result is 02 now else 00. |
4457 | ; bit 1 set slows the printer. |
4430 | ; bit 1 set slows the printer. |
4458 | OUT ($FB),A ; slow the printer for the |
4431 | OUT ($FB),A ; slow the printer for the |
4459 | ; last two lines. |
4432 | ; last two lines. |
Line 5356... | Line 5329... | ||
5356 | ; appears on the screen. |
5329 | ; appears on the screen. |
5357 | NOP ; these seem unnecessary. |
5330 | NOP ; these seem unnecessary. |
5358 | NOP ; |
5331 | NOP ; |
5359 | NOP ; |
5332 | NOP ; |
5360 | NOP ; |
5333 | NOP ; |
5361 | ; NOP ; |
- | |
5362 | ; NOP ; |
- | |
5363 | RST 8 |
5334 | RST 8 |
5364 | DB _TAPE_INIT |
5335 | DB _TAPE_INIT |
5365 | 5336 | ||
5366 | ; ------------ |
5337 | ; ------------ |
5367 | ; Check RAM |
5338 | ; Check RAM |
Line 5509... | Line 5480... | ||
5509 | 5480 | ||
5510 | SET 1,(IY+$01) ; update FLAGS - signal printer in use. |
5481 | SET 1,(IY+$01) ; update FLAGS - signal printer in use. |
5511 | 5482 | ||
5512 | ;=============================== |
5483 | ;=============================== |
5513 | CALL PRINTER_INITER |
5484 | CALL PRINTER_INITER |
5514 | ; CALL L0EDF ; call routine CLEAR-PRB to initialize system |
- | |
5515 | ; variables associated with printer. |
- | |
5516 | ;=============================== |
5485 | ;=============================== |
5517 | 5486 | ||
5518 | LD (IY+$31),$02 ; set DF_SZ the lower screen display size to |
5487 | LD (IY+$31),$02 ; set DF_SZ the lower screen display size to |
5519 | ; two lines |
5488 | ; two lines |
5520 | CALL L0D6B ; call routine CLS to set up system |
5489 | CALL L0D6B ; call routine CLS to set up system |
Line 5669... | Line 5638... | ||
5669 | 5638 | ||
5670 | LD A,B ; fetch stored report code. |
5639 | LD A,B ; fetch stored report code. |
5671 | LD DE,L1391 ; address: rpt-mesgs. |
5640 | LD DE,L1391 ; address: rpt-mesgs. |
5672 | CALL L0C0A ; call routine PO-MSG to print. |
5641 | CALL L0C0A ; call routine PO-MSG to print. |
5673 | 5642 | ||
5674 | X1349 |
- | |
5675 | IF BAS48_ONLY=1 |
- | |
5676 | XOR A |
- | |
5677 | LD DE,L1536 |
- | |
5678 | ELSE |
- | |
5679 | CALL L3B3B ; Spectrum 128 patch |
5643 | X1349 CALL L3B3B ; Spectrum 128 patch |
5680 | NOP |
5644 | NOP |
5681 | ENDIF |
- | |
5682 | 5645 | ||
5683 | L134D: CALL L0C0A ; routine PO-MSG prints them although it would |
5646 | L134D: CALL L0C0A ; routine PO-MSG prints them although it would |
5684 | ; be more succinct to use RST $10. |
5647 | ; be more succinct to use RST $10. |
5685 | 5648 | ||
5686 | LD BC,($5C45) ; fetch PPC the current line number. |
5649 | LD BC,($5C45) ; fetch PPC the current line number. |
Line 5928... | Line 5891... | ||
5928 | DW L0F81 ; ADD-CHAR |
5891 | DW L0F81 ; ADD-CHAR |
5929 | DW L15C4 ; REPORT-J |
5892 | DW L15C4 ; REPORT-J |
5930 | DB "R" |
5893 | DB "R" |
5931 | ;======================================= |
5894 | ;======================================= |
5932 | DW PRN_TOKEN |
5895 | DW PRN_TOKEN |
5933 | ; DW L09F4 ; PRINT-OUT |
- | |
5934 | ;======================================= |
5896 | ;======================================= |
5935 | DW L15C4 ; REPORT-J |
5897 | DW L15C4 ; REPORT-J |
5936 | DB "P" |
5898 | DB "P" |
5937 | 5899 | ||
5938 | DB $80 ; End Marker |
5900 | DB $80 ; End Marker |
Line 8162... | Line 8124... | ||
8162 | ;; REPORT-L |
8124 | ;; REPORT-L |
8163 | L1B7B: RST 08H ; ERROR-1 |
8125 | L1B7B: RST 08H ; ERROR-1 |
8164 | DB $14 ; Error Report: BREAK into program |
8126 | DB $14 ; Error Report: BREAK into program |
8165 | 8127 | ||
8166 | ;; STMT-R-1 |
8128 | ;; STMT-R-1 |
8167 | L1B7D IF BAS48_ONLY=1 |
- | |
8168 | BIT 7,(IY+0X0A) |
- | |
8169 | ELSE |
- | |
8170 | CALL L3B4D ; Spectrum 128 patch |
8129 | L1B7D CALL L3B4D ; Spectrum 128 patch |
8171 | NOP |
8130 | NOP |
8172 | ENDIF |
- | |
8173 | 8131 | ||
8174 | L1B81: JR NZ,L1BF4 ; forward to STMT-NEXT if a program line. |
8132 | L1B81: JR NZ,L1BF4 ; forward to STMT-NEXT if a program line. |
8175 | 8133 | ||
8176 | LD HL,($5C42) ; fetch line number from NEWPPC |
8134 | LD HL,($5C42) ; fetch line number from NEWPPC |
8177 | BIT 7,H ; will be set if minus two - direct command(s) |
8135 | BIT 7,H ; will be set if minus two - direct command(s) |
Line 8337... | Line 8295... | ||
8337 | ; -------------------- |
8295 | ; -------------------- |
8338 | ; Acceptable characters at this point are carriage return and ':'. |
8296 | ; Acceptable characters at this point are carriage return and ':'. |
8339 | ; If so go to next statement which in the first case will be on next line. |
8297 | ; If so go to next statement which in the first case will be on next line. |
8340 | 8298 | ||
8341 | ;; STMT-NEXT |
8299 | ;; STMT-NEXT |
8342 | L1BF4 IF BAS48_ONLY=1 |
- | |
8343 | RST 0X18 |
- | |
8344 | CP 0X0D |
- | |
8345 | ELSE |
- | |
8346 | CALL L3B5D ; Spectrum 128 patch |
8300 | L1BF4 CALL L3B5D ; Spectrum 128 patch |
8347 | ENDIF |
- | |
8348 | - | ||
8349 | L1BF7: JR Z,L1BB3 ; back to LINE-END if so. |
8301 | L1BF7: JR Z,L1BB3 ; back to LINE-END if so. |
8350 | 8302 | ||
8351 | CP $3A ; is it ':' ? |
8303 | CP $3A ; is it ':' ? |
8352 | JP Z,L1B28 ; jump back to STMT-LOOP to consider |
8304 | JP Z,L1B28 ; jump back to STMT-LOOP to consider |
8353 | ; further statements |
8305 | ; further statements |
Line 11727... | Line 11679... | ||
11727 | RES 6,(HL) ; signal string result. |
11679 | RES 6,(HL) ; signal string result. |
11728 | BIT 7,(HL) ; checking syntax ? |
11680 | BIT 7,(HL) ; checking syntax ? |
11729 | JR Z,L2665 ; forward to S-INK$-EN if so |
11681 | JR Z,L2665 ; forward to S-INK$-EN if so |
11730 | 11682 | ||
11731 | ;=============================== |
11683 | ;=============================== |
11732 | IF BAS48_ONLY=1 |
- | |
11733 | CALL L028E |
- | |
11734 | ELSE |
- | |
11735 | JP L3B6C ; Spectrum 128 patch |
11684 | JP L3B6C ; Spectrum 128 patch |
11736 | ENDIF |
- | |
11737 | ;=============================== |
11685 | ;=============================== |
11738 | 11686 | ||
11739 | L2649: LD C,$00 ; the length of an empty string |
11687 | L2649: LD C,$00 ; the length of an empty string |
11740 | JR NZ,L2660 ; to S-IK$-STK to store empty string if |
11688 | JR NZ,L2660 ; to S-IK$-STK to store empty string if |
11741 | ; no key returned. |
11689 | ; no key returned. |
Line 19429... | Line 19377... | ||
19429 | L3C8F: DB $13, $00 ; Bright, off |
19377 | L3C8F: DB $13, $00 ; Bright, off |
19430 | DB $31, $39 ; '1', '9' |
19378 | DB $31, $39 ; '1', '9' |
19431 | DB $13, $01 ; Bright, on |
19379 | DB $13, $01 ; Bright, on |
19432 | DB $38, $36 ; '8', '6' |
19380 | DB $38, $36 ; '8', '6' |
19433 | 19381 | ||
19434 | RST8_CMP EX (SP),HL ;HL |
- | |
19435 | PUSH AF ;AF |
- | |
19436 | LD A,(HL) |
- | |
19437 | CP _AY_PRN_INIT |
- | |
19438 | JR NC,RST8_YES |
- | |
19439 | RST8_NO POP AF |
- | |
19440 | EX (SP),HL |
- | |
19441 | LD HL,($5C5D) |
- | |
19442 | LD ($5C5F),HL |
- | |
19443 | JP L0053 |
- | |
19444 | - | ||
19445 | RST8_YES CP _AY_PRN_INIT+0X40 |
- | |
19446 | JR NC,RST8_NO |
- | |
19447 | CP 0X73 |
- | |
19448 | JR NC,RST8_NO |
- | |
19449 | PUSH BC ;BC |
- | |
19450 | LD A,R |
- | |
19451 | JP PE,RST8YES1 |
- | |
19452 | LD A,R |
- | |
19453 | RST8YES1 DI |
- | |
19454 | PUSH AF ;RF |
- | |
19455 | PUSH HL ;ADR_RET |
- | |
19456 | PUSH DE ;RAMNROM+DOS7FFD |
- | |
19457 | LD BC,RD_1WINA0 |
19382 | include rst8.a80 |
19458 | IN H,(C) |
- | |
19459 | IN A,(PEVO_CONF) |
- | |
19460 | LD L,A |
- | |
19461 | OR 1 |
- | |
19462 | OUT (PEVO_CONF),A |
- | |
19463 | LD B,HIGH (RD_DOS7FFD) |
- | |
19464 | IN E,(C) |
- | |
19465 | DEC B |
- | |
19466 | IN D,(C) |
- | |
19467 | LD BC,WIN_A0 |
- | |
19468 | LD A,3 |
- | |
19469 | OUT (C),A |
- | |
19470 | LD B,HIGH (WIN_P0) |
- | |
19471 | XOR A |
- | |
19472 | JP ADR_SEL_ROM |
- | |
19473 | - | ||
19474 | DUPL ADR_RST8END-$,0 |
- | |
19475 | RST8_END LD A,L |
- | |
19476 | OUT (PEVO_CONF),A |
- | |
19477 | POP DE |
- | |
19478 | POP HL |
- | |
19479 | POP AF |
- | |
19480 | JP PO,RST8END1 |
- | |
19481 | EI |
- | |
19482 | RST8END1 POP BC |
- | |
19483 | POP AF |
- | |
19484 | EX (SP),HL |
- | |
19485 | RET |
- | |
19486 | 19383 | ||
19487 | ; ------ |
19384 | ; ------ |
19488 | ; UNUSED |
19385 | ; UNUSED |
19489 | ; ------ |
19386 | ; ------ |
19490 | 19387 | ||
19491 | DUPL 0X3D00-$,0 |
19388 | DUPL 0X3D00-$,0XFF |
19492 | 19389 | ||
19493 | ; ------------------------------- |
19390 | ; ------------------------------- |
19494 | ; THE 'ZX SPECTRUM CHARACTER SET' |
19391 | ; THE 'ZX SPECTRUM CHARACTER SET' |
19495 | ; ------------------------------- |
19392 | ; ------------------------------- |
19496 | 19393 |