The trick with tinyptc is to remember that it soesn't matter how the colours get into the screen array. Actually I was a bit confused about the way you'd coded it, it seemed to run slowly, I remember the loading bars being a little bit faster so I took the liberty of optimising the code a little, though your cool technique stays intact

'
' C64 DEPACK SCREEN BY DREWPEE, SOME OPTIMISATIONS BY SHOCKWAVE.
'
option explicit
#define PTC_WIN
#Include Once "tinyptc.bi"
Const XRES=640
Const YRES=480
Dim Shared ScreenBuffer(XRES*YRES)
If(ptc_open("C64 unpacking by DrewPee",xres,yres)=0) Then
End -1
End If
dim as uinteger y,blk,rgbb,XW
dim as ubyte ranr,rang,ranb
DIM SHARED PP AS INTEGER PTR
do
ranr=(INT(RND(1)*255)+1)
rang=(INT(RND(1)*255)+1)
ranb=(INT(RND(1)*255)+1)
rgbb=rgb(ranr,rang,ranb)
XW=xres
for y=0 to yres-1
blk=rnd*(100)
if blk>90 then
ranr=(INT(RND(1)*255)+1)
rang=(INT(RND(1)*255)+1)
ranb=(INT(RND(1)*255)+1)
rgbb=rgb(ranr,rang,ranb)
end if
if y<yres then
PP = @ScreenBuffer(Y*XRES)
asm
mov eax,dword ptr[rgbb]
mov ecx, [XW]
mov edi, [PP]
cld
rep stosd
end asm
end if
next y
ptc_update @screenbuffer(0)
LOOP UNTIL INKEY$<>""
ptc_close
end
Please note that it is not the asm that has made a huge difference here, it's the way your code was structured. I've broken it down for you;
GENERATE BLOCK SIZE AND COLOURNOTE THAT THIS IS WHERE YOUR OUTER LOOP STARTS!do
blk=(INT(RND(1)*20)+1)
ranr=(INT(RND(1)*255)+1)
rang=(INT(RND(1)*255)+1)
ranb=(INT(RND(1)*255)+1)
DRAW **ONLY** THE BLOCK YOU CALCULATED ABOVE for y=top to top+blk
for x=0 to xres-1
feedpixels(x,y,rgb(ranr,rang,ranb))
next x
next y
MOVE THE BLOCK OFFSET AND BOUNDS CHECK; top=top+blk
if top-blk>=564 then top=0
UPDATE THE SCREEN AFTER ONLY DRAWING ONE BLOCK!!!!!!! ptc_update @screenbuffer(0)
LOOP UNTIL INKEY$<>""
In fact if you'd put the command Erase ScreenBuffer after the ptc update your problem would become clearer as you'd see that you only drew one raster block per update.
If that was the effect that you intended to do though I sincerely apologise for my meddling and I'll stfu
