Advertisement
Mysoft

Untitled

Mar 20th, 2016
625
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #define fbc -s gui
  2.  
  3. #include "fbgfx.bi"
  4.  
  5. screenres 32*8,32*8
  6.  
  7. open "mygroup__win311.grp" for binary access read as #1
  8. 'open "mygroup__win2k.grp" for binary access read as #1
  9. var iSz = lof(1)
  10. dim as ubyte ptr pg = allocate(iSz)
  11. get #1,,*pg,iSz
  12. close #1
  13.  
  14. var pICO = ImageCreate(32,32)
  15.  
  16. static as ulong tPal(15) = { _
  17. &h00000000, &h00800000, &h00008000, &h00808000, _
  18. &h00000080, &h00800080, &h00008080, &h00808080, _
  19. &h00c0c0c0, &h00ff0000, &h0000ff00, &h00ffff00, _
  20. &h000000ff, &h00ff00ff, &h0000ffff, &h00ffffff }
  21.  
  22. for CNT as integer = 0 to 15
  23.   var p = cast(ubyte ptr,@tPal(CNT))
  24.   palette CNT, p[2], p[1], p[0]
  25. next CNT
  26.  
  27. ' palette?
  28. var iOff = &h128
  29. #if 0
  30. for C as integer = 0 to 15
  31.   palette C,pg[iOff+C*4+2],pg[iOff+C*4+1],pg[iOff+C*4+0]
  32. next C
  33. #endif
  34.  
  35. 'planar per line 4bpp
  36. iOff = &hF7
  37. for Y as integer = 0 to 31
  38.   for P as integer = 0 to 3
  39.     for X as integer = 0 to 31 step 8
  40.       var Pix = pg[iOff]: iOff += 1
  41.       for C as integer = 0 to 7
  42.         if (Pix and (1 shl C)) then
  43.           pset pICO,(X+7-C,Y),point(X+7-C,Y,pICO) or (1 shl P)
  44.         end if
  45.       next C
  46.     next X
  47.   next P
  48. next Y
  49.  
  50. ' mask
  51. iOff = &h77
  52. for Y as integer = 0 to 31
  53.   for X as integer = 0 to 31 step 8
  54.     var Pix = pg[iOff]: iOff += 1
  55.     for C as integer = 0 to 7
  56.       if (Pix and (1 shl C)) then
  57.         pset pICO,(X+7-C,Y),13
  58.       end if
  59.     next C
  60.   next X
  61. next Y
  62.  
  63.  
  64. for Y as integer = 0 to 31
  65.   for X as integer = 0 to 31
  66.     line(X*8,Y*8)-(X*8+7,Y*8+7),point(X,Y,pICO),bf
  67.   next X
  68. next Y
  69.  
  70. sleep
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement