English Amiga Board


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

 
 
Thread Tools
Old 22 January 2018, 20:28   #81
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
In 15.16 binary....
Code:
 
2.9 is
10.1110011001100110

2.89999 is
10.1110011001100110


2.900001 is also 
10.1110011001100110
It's not possible to express 0.9 exactly as a binary fraction.
E-Penguin is offline  
Old 23 January 2018, 09:24   #82
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
It means I just have to throw away my brilliant idea and find another solution.
I wanted to use only one number to keep ID of a cell + direction (direction was supposed to be after a comma - a number from numeric keyboard layout).

Now I'm going to multiple direction number by 1000 and add to cell's ID (which is always less then 1000).

Thanks
peceha is offline  
Old 23 January 2018, 09:42   #83
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Quote:
Originally Posted by E-Penguin View Post
Am I relying too much on the processor? My Plan B is to draw to a bitmap, cut out shapes and then QBlit those, but, surely, the 2d drawing functions should be able to handle more than 6 polygons? Any 3d game must be doing more than that, and I'm not dealing with a z-axis at all.
Check the original examples directory, it has some polygon examples.
idrougge is offline  
Old 23 January 2018, 10:57   #84
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
Quote:
Originally Posted by peceha View Post
Now I'm going to multiple direction number by 1000 and add to cell's ID (which is always less then 1000).
The 68000 has no hardware multiplier (afaik), and no hardware divider. If you really wanted to pack data in, you'd be better off doing something with bit shifts and bit masks.

Eg, if your ID is always <1000, you can use the first 10 bits of a 16-bit word (up to 1024), and the remaining 6 bits (64) as other stuff.

Then:
combo_word = (direction LSL 10) | id
id = combo_word & $03FF
direction = combo_word LSR 10

Although, frankly, you're probably better off creating a NewType with two members.
E-Penguin is offline  
Old 23 January 2018, 13:19   #85
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
I think you are right - I'll use a NewType then.
peceha is offline  
Old 23 January 2018, 20:05   #86
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Hi
is there a way to make a variable global?
I would like to avoid "SHARED" statements inside all the procedures.

Thanks
peceha is offline  
Old 23 January 2018, 23:43   #87
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Quote:
Originally Posted by E-Penguin View Post
The 68000 has no hardware multiplier (afaik), and no hardware divider. If you really wanted to pack data in, you'd be better off doing something with bit shifts and bit masks.

combo_word = (direction LSL 10) | id
id = combo_word & $03FF
direction = combo_word LSR 10
Note that long shifts on the plain 68000 also cost quite a bit. The max size for an immediate shift is 8, so if you do it with 10, it will cost either two shifts or one register. The number of steps also add up to the final cycle count, so that LSL 3 costs half as much as LSL 6.

Quote:
Originally Posted by E-Penguin
Although, frankly, you're probably better off creating a NewType with two members.
Indeed.
idrougge is offline  
Old 23 January 2018, 23:47   #88
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Quote:
Originally Posted by peceha View Post
Hi
is there a way to make a variable global?
I would like to avoid "SHARED" statements inside all the procedures.
No.
idrougge is offline  
Old 24 January 2018, 00:35   #89
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
AmiBlitz 3 allows you to declare global variables by using the SHARED keyword outside the procedures:

Code:
SHARED test.b
test = 10

Statement printtest{}
  NPrint test
End Statement

printtest{}
End
But of course comes with its own restrictions (FPU dependency, IDE requirements etc.).
Daedalus is offline  
Old 24 January 2018, 22:08   #90
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
This time I have a question about SuperTed

I opened the PREFS - changed the colors number to 16 (I think I also unchecked TOKENISE - btw. I do not know what it is for) and saved the configuration.

Now whenever I open SuperTed and load something I cannot see any text - I know it is there (scrollbar's size changes and I can even compile it ) - I just cannot see it.

How to fix it?


EDIT
ehh... forget it - the colors got changed when I played with screen modes.

Last edited by peceha; 24 January 2018 at 22:56.
peceha is offline  
Old 25 January 2018, 12:13   #91
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Yep, it sounds like the foreground and background colours ended up being the same.

Tokenizing is when Blitz recognises a keyword and changes its colour to show you that it has understood. If you turn it off, SuperTED is essentially just a text editor. This option is to allow you to edit normal text files without having it capitalise certain words.
Daedalus is offline  
Old 25 January 2018, 21:03   #92
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Thanks again Daedalus
If there is still someone willing to answer I have another one:

I'd like to load some shapes from IFF picture (16x16 tiles).
Can I have all of them in one picture or I need to have one tile per picture?
peceha is offline  
Old 25 January 2018, 22:03   #93
TurboCrash
Registered User
 
Join Date: Dec 2015
Location: Lisbon/Portugal
Posts: 51
One picture is enough, remember that the first color in the palette is the alpha/transparent color. So if using more than one palette it should be easier to divide graphics at least by palette.
LoadBitmap 1,"images.iff"
GetaShape 1,0,0,16,16
GetaShape 2,0,16,16,16

That's
GetaShape Shapenumber, start at X, start at Y, get Xpixels, get Ypixels
TurboCrash is offline  
Old 25 January 2018, 22:11   #94
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Thanks !!!
peceha is offline  
Old 25 January 2018, 22:59   #95
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
If you draw them in one picture and surround each shape with a box, you can auto-grab them using RedShapeZ. It's part of the Blitz Support Suite and is installed automatically with the Ultimate Blitz CD. Just make sure you save them in the "Acid shapes" format.
idrougge is offline  
Old 26 January 2018, 16:37   #96
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Hi,
please take a look at the picture.
[/url]

On the left you can see my tileset (yes, I know ) and on the right you can see how it looks when the program runs.

Why do I have that gray color at all????
Gray color is not used in my tileset - I mean it is part of the palette but it is not used in drawing.
Funny thing is some tiles are half gray - half black or even white
I run it on WB in default 4 colors.
My tileset is an IFF image with 4 colors palette (same as WB and in the same order).

What am I doing wrong?
peceha is offline  
Old 27 January 2018, 00:14   #97
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
I don't see any gray colour.
idrougge is offline  
Old 27 January 2018, 00:26   #98
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
You need to zoom in a little. Then just look on the walls (should be black) but they are gray in some places. Same happens to "dots" -mostly are white but on some tiles they are grey. Also small "squares" in the middle of the tiles: should be white and black (as on the left picture) but they have some gray color in it.
peceha is offline  
Old 27 January 2018, 20:52   #99
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
Just one more
This one has nothing to do with my previous question.

I found an example of doing a commodity.
When I type it into AmiBlitz - all works fine.
When I type it into Blitz2, the following line gives me an error:
Code:
AddWaitEvent PortSigBit(CommodityMsgPort),$800000
saying that "array not yet Dim'd"
I know it is talking about PORTSIGBIT - how to fix it?

Thanks
peceha is offline  
Old 28 January 2018, 00:01   #100
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Funny, that compiles for me in Blitz 2.
idrougge 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
Blitz basic 2 Help Havie Coders. Blitz Basic 30 08 September 2013 09:15
blitz basic petza request.Apps 11 08 April 2007 01:49
Blitz Basic 2 anyone? jobro request.Apps 12 28 November 2005 18:15
Blitz Basic StopCD32 Tony Landais Coders. General 2 08 May 2003 22:51
Blitz Basic 2 LaundroMat Retrogaming General Discussion 5 24 July 2001 08:10

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:01.

Top

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