It is currently Mon Dec 10, 2018 3:10 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: 6 bitplane chunky2planar engine
PostPosted: Thu Jun 25, 2015 1:45 am 
Offline
Enthusiast
Enthusiast

Joined: Tue Oct 05, 2004 9:05 pm
Posts: 103
Location: germany
hi,

i put a very small c2p engine from sp^contraz into a pb userlib
it running fine with normal pb-screens and hardwarelib copperlist screens

sample prog:
Code:
;  Chunky example new c2p 6bpl screen
; ***********************************

#Width  = 320
#Height = 200

initmemorybank(1)
InitPalette(1)
InitBitMap(1)
initScreen(0)


WbStartup()
programpriority(20)

bm0.l=AllocateLinearBitMap(0,#Width,#Height,6)
*cb0.l=AllocateMemoryBank(0,#Width*#Height,#memf_clear)

If OpenScreen(0,320,200,6,0)

;we create the palette from our data
 CreatePalette(0,64)

For i=0 To 31
  palettergb(i,i*8,i*8,255)
  PaletteRgb(i+32,255-(i*8),0,255-(i*8))
Next

DisplayPalette(0,ScreenID())
 showbitmap(0,ScreenID(),0,0)
UseBitMap(0) ;chunky bitmap
*bmappointer=BitMapID()
*planepointer=PeekL(*bmappointer+8)
db=1   
Repeat
;
;VWait()
    db=1-db
   w.l=w+1 :If w>359:w=0:EndIf
   sini.l = PeekL(?sintable+(w*4))
   cosi.l = PeekL(?costable+(w*4))

   For x = 20 To 240 Step 2
     For y = 20 To 180 Step 2
       dx=x-110
       dy=y-90
       z=800+(y<<3)
       
     u.w=(dx*cosi-dy*sini)/z
     v.w=(dx*sini+dy*cosi)/z
     u&127: v&127
     colo.w=Xor(u,v);Peekb(?color+((u*128)+v))
     ypos=y+db
     *addy=*cb0+(x+(ypos*320))
     C2Pset2plot(*addy,colo)   
     Next
   Next
 
   c2p6bpl(*cb0,*planepointer)
     
 Until Joy1Button()

 CloseScreen(0)
endif

End

 
sintable:
IncludeBinary "Work:codes/pbchunkylib/dat/sintable"
costable:
IncludeBinary "Work:codes/pbchunkylib/dat/costable"




screeny
Image


download userlib, datas and example

at the moment just 2 comands plot and render
maybe more will come later


HAVE FUN =)

_________________
Kultstudio


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye