Try this SUB procedure for Screen 13 that creates a bitmap screenshot:
Code: Select all
SUB EightBIT (x1%, y1%, x2%, y2%, Filename$) 'SCREEN 13 bitmap maker
'takes 1 second fullscreen
DIM FileCOLORS%(1 TO 768)
DIM Colors8%(255)
IF INSTR(Filename$, ".BMP") = 0 THEN
Filename$ = RTRIM$(LEFT$(Filename$, 8)) + ".BMP"
END IF
FileTYPE$ = "BM"
Reserved1% = 0
Reserved2% = 0
OffsetBITS& = 1078
InfoHEADER& = 40
PictureWIDTH& = (x2% - x1%) + 1
PictureDEPTH& = (y2% - y1%) + 1
NumPLANES% = 1
BPP% = 8
Compression& = 0
WidthPELS& = 3780
DepthPELS& = 3780
NumCOLORS& = 256
IF PictureWIDTH& MOD 4 <> 0 THEN
ZeroPAD$ = SPACE$(4 - PictureWIDTH& MOD 4)
END IF
ImageSIZE& = (PictureWIDTH& + LEN(ZeroPAD$)) * PictureDEPTH&
FileSize& = ImageSIZE& + OffsetBITS&
OUT &H3C7, 0
FOR n = 1 TO 768 STEP 3
FileCOLORS%(n) = INP(&H3C9)
FileCOLORS%(n + 1) = INP(&H3C9)
FileCOLORS%(n + 2) = INP(&H3C9)
NEXT n
OPEN Filename$ FOR BINARY AS #1
PUT #1, , FileTYPE$
PUT #1, , FileSize&
PUT #1, , Reserved1% 'should be zero
PUT #1, , Reserved2% 'should be zero
PUT #1, , OffsetBITS&
PUT #1, , InfoHEADER&
PUT #1, , PictureWIDTH&
PUT #1, , PictureDEPTH&
PUT #1, , NumPLANES%
PUT #1, , BPP%
PUT #1, , Compression&
PUT #1, , ImageSIZE&
PUT #1, , WidthPELS&
PUT #1, , DepthPELS&
PUT #1, , NumCOLORS&
PUT #1, , SigCOLORS& '51 to 54
u$ = " "
FOR n% = 1 TO 768 STEP 3 'PUT as BGR order colors
Colr$ = CHR$(FileCOLORS%(n% + 2) * 4)
PUT #1, , Colr$
Colr$ = CHR$(FileCOLORS%(n% + 1) * 4)
PUT #1, , Colr$
Colr$ = CHR$(FileCOLORS%(n%) * 4)
PUT #1, , Colr$
PUT #1, , u$ 'Unused byte
NEXT n%
FOR y = y2% TO y1% STEP -1 'place bottom up
FOR x = x1% TO x2%
a$ = CHR$(POINT(x, y))
Colors8%(ASC(a$)) = 1
PUT #1, , a$
NEXT x
PUT #1, , ZeroPAD$
NEXT y
FOR n = 0 TO 255
IF Colors8%(n) = 1 THEN SigCOLORS& = SigCOLORS& + 1
NEXT n
PUT #1, 51, SigCOLORS&
CLOSE #1
END SUB
Code adapted from a routine by Bob Seguin.
In your MAIN module SUB call:
You can use a certain keypress to trigger a snapshot of the screen.
The filename can just be the first name as SUB will add ".BMP" if needed. You could also add a snapshot number to the name for more bitmaps. Screen 13 does it pretty fast.
x1 and x2 can be from 0 to 319, y1 and y2 from 0 to 199 respectively.
I also have a SUB for SCREEN 12 that may take up to 8 seconds to create a fullscreen snapshot.