English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 22 February 2016, 19:18   #1
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
equivalent of block but with x not power of 2

there is a blit shape mode equivalent of block , but with position not of power of 2 ?


because i want the shape completely replace the underlying bitmap like the block command

the manual say : blitmode

CookieMode
Using CookieMode as a blitting mode will cause a shape to be blitted cleanly, 'as is',onto a bitmap.

EraseMode
Using EraseMode as a blitting mode will cause a blitted shape to erase a
section of a bitmap corresponding to the outline of the shape.

InvMode
Using InvMode as a blitting mode will cause a shape to 'invert' a section
of a bitmap corresponding to the outline of the blitted shape.

SolidMode
Using SolidMode as a blitting mode will cause a shape to overwrite a section of a bitmap corresponding to the outline of the blitted shape.

unfortunately none of this modes replace the underlying gfx

i've tried also to create the shape without the cookie, but without cookie i cannot use any of the blit command.

what can i do?

btw i'm using a 1 bitplane shape, and the color 0 seems always trasparent and can't delete the old shape
Raislin77it is offline  
Old 22 February 2016, 19:45   #2
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
is your routine time critical? If not, you could use an equal sized full rectangle shape and eraseblit it before or draw (maybe with cpu:16x1 move.w) a rectangle (Box) to kill the underlying gfx.
If your source shape could be on a bmap (even ShapesBitmap would do) you could use the Scroll command to transfer blit this shape.
Or you find a way to align the destination coords to meet Block requirements.

It really depends on your needs, what is it for?

I hope, you did actually tried cookiemode blit?

Last edited by Cylon; 22 February 2016 at 19:53.
Cylon is offline  
Old 22 February 2016, 20:14   #3
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
I should add that all "Cookiemode" etc parameters are (in this case - Blit) just values, so if you find out the correct blitter parameters (minterms) you could use those instead.

I've just tried a few with no results, there is a minterm+channels description for blitter dma somewhere in the blitz appendix.
Code:
;

XINCLUDE "BlitzINC:macros/stdblitz.mac.bb"

!stdblitz {320,256,2}

For a=0To9
  Locate a,a
  Print"thisisjustsometexthere"
Next a

GetaShape 0,0,0,16,16

Boxf 20,90,150,120,2


BlitMode CookieMode

Blit 0,20,100
Blit 0,20,140

BlitMode EraseMode

Blit 0,40,100
Blit 0,40,140

BlitMode SolidMode

Blit 0,60,100
Blit 0,60,140

BlitMode InvMode

Blit 0,80,100
Blit 0,80,140

;BlitMode %111100010111 ;EraseMode|CookieMode|InvMode|SolidMode

;Blit 0,100,100
;Blit 0,100,140

ShapesBitMap 0,2
Use BitMap0
Scroll 0,0,16,16,120,100,2
Scroll 0,0,16,16,120,140,2

MouseWait
End
Attached Thumbnails
Click image for larger version

Name:	blittest.png
Views:	191
Size:	43.4 KB
ID:	47636   Click image for larger version

Name:	blittest_.png
Views:	196
Size:	43.0 KB
ID:	47637  

Last edited by Cylon; 22 February 2016 at 21:03.
Cylon is offline  
Old 22 February 2016, 21:35   #4
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
i will study this example, thanks for now

ah! the idea is with only one bitmap of 3 bitplanes create a static background (redrawing it every frame) and a 2 bitplane playfield, like in agony

the idea of something like block is to save time not erasing the old bitplane but overwriting it


maybe i've solved it, the correct blitmode for something like block is : BlitMode % 111111110000

BlitMode % 110111110000 works too

Last edited by Raislin77it; 22 February 2016 at 22:14. Reason: maybe the solution :)
Raislin77it is offline  
Old 22 February 2016, 22:48   #5
LuMan
Amigan - an' lovin' it!!
 
LuMan's Avatar
 
Join Date: Nov 2010
Location: Nottingham, UK
Age: 55
Posts: 557
I may be missing the point here, but are you looking at some sort of dual playfield approach? Blitz does this as a standard feature, by using the Dual Playfield Slice, or Display File. You can have up to 8 colours per playfield on an OCS machine.

If you really want to Blit non-rectangular tiles, overwriting the whole rectangular shape of the previous tile, then create the tile in DPaint (or your favourite paint program ) and use a different tile background colour than 0 as black.

Or, do a CLS 0 before each tile Blit routine - but this will be slower.

Whatever it is that you're doing, remember to post pics, code, vids or playable demos, as this inspires the rest of us to work on our projects too
LuMan is offline  
Old 22 February 2016, 23:14   #6
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by LuMan View Post
I may be missing the point here, but are you looking at some sort of dual playfield approach? Blitz does this as a standard feature, by using the Dual Playfield Slice, or Display File. You can have up to 8 colours per playfield on an OCS machine.
yes but i want to do 2 playfields form a single 3 bitplanes bitmap

Quote:
Originally Posted by LuMan View Post
If you really want to Blit non-rectangular tiles, overwriting the whole rectangular shape of the previous tile, then create the tile in DPaint (or your favourite paint program ) and use a different tile background colour than 0 as black.

Or, do a CLS 0 before each tile Blit routine - but this will be slower.
i'm thinking to bilt an entire shape of 320*256*1 bitplane every frame
or maybe every 2 frames

the cls unfortunately is slower also on one bitplane only
and with the block approach i can erase+update the background
in one single pass.
Quote:
Originally Posted by LuMan View Post
Whatever it is that you're doing, remember to post pics, code, vids or playable demos, as this inspires the rest of us to work on our projects too
yes, maybe with the avi function of winuae i can make some video

Last edited by Raislin77it; 22 February 2016 at 23:35.
Raislin77it is offline  
Old 22 February 2016, 23:37   #7
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Raislin77it View Post
yes, maybe with the avi function of winuae i can make some video
here the video
unfortunately i haven't tested on real a500 , i've used winuae + chipset cycle exact


[ Show youtube player ]
Raislin77it is offline  
Old 23 February 2016, 11:48   #8
LuMan
Amigan - an' lovin' it!!
 
LuMan's Avatar
 
Join Date: Nov 2010
Location: Nottingham, UK
Age: 55
Posts: 557
Ah, I see. So, you have 1 bitmap, which is 3 bitplanes deep, and you're using 1 of the biplanes for the static background, and then offsetting the bitmap before showing the other 2 bitplanes? Is that right.

If so, it's an interesting way of doing things, but does look to work
LuMan is offline  
Old 23 February 2016, 16:02   #9
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by LuMan View Post
Ah, I see. So, you have 1 bitmap, which is 3 bitplanes deep, and you're using 1 of the biplanes for the static background, and then offsetting the bitmap before showing the other 2 bitplanes? Is that right.
not entirely, i offset the whole bitmap, but i redraw the backround layer so from the user pov it stay still

maybe playing with the copper and the offsets of the bitplanes there are better solution, but i suspect it would involve too much assembler.
and i don't know much assembler (and not too much of the internal working of an a500) , and blitz is much more easy to program


Quote:
Originally Posted by LuMan View Post
If so, it's an interesting way of doing things, but does look to work
yep

offcourse you lost half the colors from the bitmap, but with the copper and some trick, you can even animate the background
and loss (depending of the picture displayed ) none of the colors

like this animation for a "unofficial conversion" i'm trying to create

[ Show youtube player ]


and with this solution i have another 8 color playfiled to use

Last edited by Raislin77it; 23 February 2016 at 16:11. Reason: fixed some spaghetti english :)
Raislin77it is offline  
Old 23 February 2016, 22:11   #10
Retro1234
Phone Homer
 
Retro1234's Avatar
 
Join Date: Jun 2006
Location: 5150
Posts: 5,773
Good demo
Retro1234 is offline  
Old 23 February 2016, 23:33   #11
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
thanks
Raislin77it is offline  
Old 25 February 2016, 22:12   #12
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
I've done some tests for myself now.

This is the result:

It is a bit slow due to the giant boing blit, but it works. The parallax <tries> to scroll once per frame.

I did not use your CustomCop hack, as it is to complicated, instead i have used the old cmds not suited for displaylib. Way easier.

Please note the transparency on the text above: I'm actually printing onto a fake bmap, the blitting is done the same way, so there is no need to restore the far-behind-back - a simple CLS would do the trick.
The Boingball could be transparent, too.

Please try, 020+ recommended.
Attached Thumbnails
Click image for larger version

Name:	agonybeastscrolltest.jpg
Views:	214
Size:	85.9 KB
ID:	47673  

Last edited by Cylon; 27 February 2016 at 02:57.
Cylon is offline  
Old 26 February 2016, 00:36   #13
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Cylon View Post
I've done some tests for myself now.

This is the result:

It is a bit slow due to the giant boing blit, but it works. The parallax <tries> to scroll once per frame.

I did not use your CustomCop hack, as it is to complicated, instead i have used the old cmds not suited for displaylib. Way easier.

Pleasy note the transparency on the text above: I'm actually printing onto a fake bmap, the blitting is done the same way, so there is no need to restore the far-behind-back - a simple CLS would do the trick.
The Boingball could be transparent, too.

Please try, 020+ recommended.
great! not bad at all


yes the boing ball is very large, but with ony 4 sprites ,
you can plot and animate the ball for free (and have some "blitter time" to update the tilemap )

in my case , i was forced to use the CustomCop and the blitmode hack, because i want to use this "trick" on a vanilla 500

i want to "prove myself" (just for the fun of it) the a500 is capable of pulling some trick to stay in par with some recent "retro" production ^_^


but your demo is very effektfull very well done
Raislin77it is offline  
Old 26 February 2016, 19:09   #14
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
@Raislin77it
Thanks.
It's still possible to make my demo faster: i could just wave the bmap around without blitting at all. Also i currently BBlit, which is unnessessary because there is nothing to restore on this empty bmap.
Cylon is offline  
Old 27 February 2016, 00:35   #15
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Cylon View Post
@Raislin77it
Thanks.
It's still possible to make my demo faster: i could just wave the bmap around without blitting at all. Also i currently BBlit, which is unnessessary because there is nothing to restore on this empty bmap.
umm i don't know, if you'r using an 8 color bitplane, with the displayscrollyou can scroll or the odd or the even bitplanes or both , and if you use 1 bitplane for the background,you must blit/block the "waving" odd bitplane so from the user pov it remain still, or it will scroll too.

i don't know yours source code, but from the iff images it loads, it seems so

from what i've come of your demo, the bitplane 1 is still, but the 2 and 3rd in the bottom bitplane scroll with the displayscroll command.

you bblit the background and the ball image

you can optimize the background blitting using the block command, but you can't wave it or the bottom dispaly doesn't scroll like the example.
it waves too.

(this is some speculation in relation of the use of the various display command, maybe the slices ones are different)

Last edited by Raislin77it; 27 February 2016 at 00:42.
Raislin77it is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Equivalent Atari ST site like EAB? kamelito Retrogaming General Discussion 31 30 January 2010 22:32
SnoopDos equivalent tool for Windows? Shoonay request.Apps 36 20 March 2009 18:46
Skate Or Die - Amiga Equivalent? Fingerlickin_B Retrogaming General Discussion 18 01 July 2007 14:47
An RZX Equivalent? frankyboy request.UAE Wishlist 1 25 November 2006 17:28
PIC interesting a1200 m/b power hack: takes power from normal HDD power cable plug! keropi Hardware pics 40 16 July 2006 21:16

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:55.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.24397 seconds with 14 queries