REM .RAW to PIC DRTV Real-time video engine format converter REM Input: a RAW file format from Paintshop Pro REM 256*256, 256 colour - one used (white on black bkgnd) REM File size is 64K (65536 bytes, one byte per pixel) 5 DIM a AS INTEGER 7 DIM VideoArray(4096) '4K Words (* 16 = Words) 10 OPEN "msclogo.raw" FOR BINARY AS #1 15 SEEK #1, 1 'First record in file 17 i = 1 20 ByteIn = 1 '32K words (64K Bytes) 21 VideoSample = 0 25 FOR WordLoop = 1 TO 8 'Get eight words (16 samples) 27 VideoSample = VideoSample * 4 'SHL*2 bits 30 GET #1, ByteIn, a 'Retrieves a 16-bit value (two bytes) 31 GET #1, ByteIn + 1, Dummy 'Dummy Read (16-bit values) 35 PRINT ByteIn; ">"; a 45 IF a > 255 THEN VideoSample = VideoSample + 1: a = a - 256 46 IF a = 1 THEN VideoSample = VideoSample + 2: a = a - 1 50 ByteIn = ByteIn + 2 60 NEXT WordLoop 70 PRINT i; "> 0x"; HEX$(VideoSample) 71 'INPUT w$ 80 VideoArray(i) = VideoSample 90 i = i + 1 100 IF ByteIn < 65535 THEN 21 105 CLOSE #1 110 OPEN "code.txt" FOR OUTPUT AS #2 115 FOR x = 1 TO 4095 STEP 8 120 PRINT #2, " .hword 0x"; HEX$(VideoArray(x)); 125 FOR z = 1 TO 7 126 PRINT #2, ", 0x"; HEX$(VideoArray(x + z)); 128 NEXT z 129 PRINT #2, 130 NEXT x 140 CLOSE #2