ZX Review #5-6
04 ноября 1997 |
|
Studies - processing program @ BASIC files.
ETUDES (C) Ivan Roshchin, Moscow, 1997 Bring to your attention a little program in BASIC, which is useful for fans to rip the picture by pressing the 'MAGIC'. The program provides automatic extraction images obtained from the @-files (Which can be several) and save them in a standard format (6912 bytes). In the process program starting @ files are deleted and are sealing drive. 1 REM NNN ... (Reserved 32 bytes to machine code) 5 CLEAR 32767 7 LET i = 1: LET j = 1: GO SUB 1000 10 BORDER 1: PAPER 1: INK 7: CLS 20 PRINT "M-WIZARD v 1.0" 30 PRINT "(c) 1997 by Ivan Roshin" 40 PRINT: PRINT "Insert disk with @-file (S) " 50 PRINT "and press enter ..." 60 PAUSE 0 70 CLS: PRINT "Loading screen ..." 90 RANDOMIZE USR 15619: REM: LOAD "@" CODE 32768,6912 1995 LET e = PEEK (23823) 99 IF e = 0 THEN GO TO 120 100 IF (i = 1 AND j = 1) THEN PRINT AT 0,0; "@-File (s) not found!": BEEP .25,0: GO TO 500 101 CLS: PRINT "Deleting @-file (s )...": PRINT: PRINT "---------" 102 FOR k = 0 TO 8: LET a $ = "@" + STR $ k 103 RANDOMIZE USR 15619: REM: ERASE a $ CODE 104 PRINT AT 2, k; "+": NEXT k 110 CLEAR 65535: PRINT "Moving files ..." 115 RANDOMIZE USR 15619: REM: MOVE 117 PRINT: PRINT "O.K.": BEEP .1,16: GO TO 500 120 RANDOMIZE USR 23872 121 FOR k = 1 TO 4: PRINT AT k, 1; "": NEXT k 125 PRINT AT 2,2; "Saving this screen": PRINT AT 3,2; "to file '"; n $;"'..." 130 RANDOMIZE USR 15619: REM: SAVE n $ CODE 32768,6912 131 LET e = PEEK (23823) 140 IF e = 0 THEN GO TO 200 150 IF e <> 2 THEN GO TO 170 155 LET j = j +1: GO SUB 1000: GO TO 121 170 PRINT "No space!": BEEP .25,0: GO TO 500 200 LET i = i +1: GO SUB 1000 210 RANDOMIZE USR 15619: REM: NEW "bak", "@" CODE 220 RANDOMIZE USR 15619: REM: ERASE "Bak" CODE 230 GO TO 70 500 PRINT: PRINT "Press any key to call TR-DOS ... " 510 PAUSE 0: CLS: PRINT "Press 'RETURN' to continue ...": RANDOMIZE USR 15616 520 GO TO 5 1000 LET n $ = "scr_" + STR $ j + "_" + STR $ i: RETURN Line 1 is routine, native, who displays the picture, located at # 8000. Her call is made in line 120. Of course, this subroutine could do much shorter, but the reduced version has the advantage - the picture appears on the screen instantly. Text in assembler: 140. HALT; waiting for interrupt LD HL, # 5800 LD (HL), # 00; or LD (HL), L LD DE, # 5801 LD BC, # 02FF LDIR; resets attributes LD HL, # 8000; portable con LD DE, # 4000; zhimoe display LD BC, # 1800; file (in this case LDIR; black screen) HALT; waiting for interrupt LD BC, # 0300; and drag LDIR; attributes Pictures RET; output in BASIC 3 more bytes can be saved replacing the command LD HL, # 8000, LD BC, # 1800 and LD BC, # 0300 at the LD H, # 80, LD B, # 18 and LD B, # 03, respectively. If you prefer, you can make a change. Memory Dump: # 76, # 21, # 00, # 58, # 36, # 00, # 11, # 01 # 58, # 01, # FF, # 02, # ED, # B0, # 21, # 00 # 80, # 11, # 00, # 40, # 01, # 00, # 18, # ED # B0, # 76, # 01, # 00, # 03, # ED, # B0, # C9 2 User Guide After starting the program you want to insert a disc with the files dropped the button 'MAGIC', and press 'ENTER'. If required files are not found, the program will "@-file (s) not found! "and will be released in TR-DOS. In Then you can restart the program by clicking 'RETURN'. If the disk has at least an @-file, the program reads contained therein, the picture shows it on screen and saves the file. The name of this file also displayed. It determined automatically has the form "scr_i_j", where i, j - some numbers, whose meaning will become clear after viewing the section "Example." After processing, one picture is the program continues to search, reading and writing the next, and so as long as all the @-files will not be processed. Then @ files are deleted, is sealing drive in and out TR-DOS. Not every program can be to flush with the button 'MAGIC'. Sometimes after pressing the computer freezes or reset, and normal writing is not happening. You may be corrupted directory of the drive. In this case, you can try press the 'MAGIC' twice in a row or press 'RESET' and immediately after This 'MAGIC'. While on the performance of the program after this can not be expected, of the recorded files to disk all can also be retrieved image. By the way, some programs output images produced on the second screen, the image is in the first 27 sectors File "@ 7". Example of use 1. Take a blank disc. Title: NO NAME 0 File (s) 0 Del. File 2544 Free 2. Use the 'MAGIC' write a few @-files required us pictures. Title: NO NAME 26 File (s) 0 Del. File A: @192: @ 7 64 A: @ 4 64: @ 3 64 A: @ 1 64: @ 8 1 A: @ 192: @ 4 64 A: @ 3 64: @ 1 64 A: @ 0 64: @ 8 1 A: @ 192: @ 6 64 A: @ 4 64: @ 3 64 A: @ 1 64: @ 0 64 A: @ 8 1: @ 192 A: @ 7 64: @ 6 64 A: @ 4 64: @ 3 64 A: @ 1 64: @ 8 1 620 Free 3. Process the disc with program. Title: NO NAME 4 File (s) 0 Del. File A: scr_1_1 27: scr_1_2 27 A: scr_1_3 27: scr_1_4 27 2436 Free 4. We write some more @-Files on the same disc. Title: NO NAME 22 File (s) 0 Del. File A: scr_1_1 27: scr_1_2 27 A: scr_1_3 27: scr_1_4 27 A: @ 192: @ 7 64 A: @ 6 64: @ 3 64 A: @ 0 64: @ 8 1 A: @ 192: @ 7 64 A: @ 6 64: @ 3 64 A: @ 1 64: @ 8 1 A: @ 192: @ 4 64 A: @ 3 64: @ 1 64 A: @ 0 64: @ 8 1 1089 Free 5. Again, use the program. Title: NO NAME 7 File (s) 0 Del. File A: scr_1_1 27: scr_1_2 27 A: scr_1_3 27: scr_1_4 27 A: scr_2_1 27: scr_2_2 27 A: scr_2_3 27 2355 Free *
Other articles:
Similar articles:
В этот день... 21 November