Advertisement
Ham62

FontGen.bas

Jun 11th, 2016
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QBasic 1.84 KB | None | 0 0
  1. DIM FontBmp(16390) AS INTEGER
  2. DIM Font(14280) AS INTEGER
  3. DEFINT A-Z
  4. SCREEN 13
  5.  
  6. DEF SEG = VARSEG(FontBmp(0))
  7. BLOAD "Font14~1.BSV", VARPTR(FontBmp(0))
  8.  
  9. PUT (0, 0), FontBmp(0), PSET
  10.  
  11. DEF SEG = VARSEG(BitmapPtr(0))
  12. BitmapPtr = VARPTR(FontBmp(0))
  13. FontPos = 0
  14.  
  15. FOR ChrY = 0 TO 16
  16.    FOR ChrX = 0 TO 15
  17. '      PRINT ChrX + (ChrY * 15);
  18.       X = ChrX + (ChrY * 15)
  19.       FOR LoopNum = 0 TO 8
  20.          'First Byte
  21.          IF PEEK(BitmapPtr + X + 0) THEN Font(FontPos) = Font(FontPos) OR 1
  22.          IF PEEK(BitmapPtr + X + 1) THEN Font(FontPos) = Font(FontPos) OR 2
  23.          IF PEEK(BitmapPtr + X + 2) THEN Font(FontPos) = Font(FontPos) OR 4
  24.          IF PEEK(BitmapPtr + X + 3) THEN Font(FontPos) = Font(FontPos) OR 8
  25.          IF PEEK(BitmapPtr + X + 4) THEN Font(FontPos) = Font(FontPos) OR 16
  26.          IF PEEK(BitmapPtr + X + 5) THEN Font(FontPos) = Font(FontPos) OR 32
  27.          IF PEEK(BitmapPtr + X + 6) THEN Font(FontPos) = Font(FontPos) OR 64
  28.          IF PEEK(BitmapPtr + X + 7) THEN Font(FontPos) = Font(FontPos) OR 128
  29.  
  30.          X = X + 1
  31.          'Second Byte
  32.          IF PEEK(BitmapPtr + X + 0) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 1
  33.          IF PEEK(BitmapPtr + X + 1) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 2
  34.          IF PEEK(BitmapPtr + X + 2) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 4
  35.          IF PEEK(BitmapPtr + X + 3) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 8
  36.          IF PEEK(BitmapPtr + X + 4) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 16
  37.          IF PEEK(BitmapPtr + X + 5) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 32
  38.          IF PEEK(BitmapPtr + X + 6) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 64
  39.          IF PEEK(BitmapPtr + X + 7) THEN Font(FontPos + 1) = Font(FontPos + 1) OR 128
  40.          FontPos = FontPos + 2
  41.          X = X + 254
  42.       NEXT LoopNum
  43.    NEXT ChrX
  44. NEXT ChrY
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement