English Amiga Board


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

 
 
Thread Tools
Old 20 June 2018, 19:02   #141
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
Quote:
Originally Posted by E-Penguin View Post
Code:
PaletteRange Palette#,StartCol,EndCol,r0,g0,b0,r1,g1,b1 

PaletteRange creates a spread of colors within a palette. Similar to DPaint's spread
function PaletteRange takes a start and end colour and creates the color tweens
between them.
Does this work for anyone? I just get black in all the colour registers. I've gone as far as writing my own RGB interpolation function (which, sadly, I just lost because I didn't press save) but surely there must be a way of getting this to work.
As promised, here's my fixed version, for interpolating through the RGB colourspace. I'm still working on an HSV version. Example interpolation attached.
Code:
; By Daniel Lakey, 2018
; Distributed under attribution (CC-BY) licence. 
; Use as you will, a credit would be nice :)
; 
Function.w round{v.q}
	If Frac(v) >= 0.5
		Function Return (Int(v) + 1)
	Else
		Function Return int(v)
	EndIf
End Function

NewType .ntRGB
	r.b
	g.b
	b.b
End NewType

Statement PaletteRangeFixed_RGB{palette_num.w, color_start_num.b, color_end_num.b, *start_rgb.ntRGB, *end_rgb.ntRGB}
	steps.b = (color_end_num - color_start_num)
	t.f = 1/steps
	
	For i=0 to steps
		r_step.b = round{*start_rgb\r + (*end_rgb\r - *start_rgb\r)*(t*i)}
		g_step.b = round{*start_rgb\g + (*end_rgb\g - *start_rgb\g)*(t*i)}
		b_step.b = round{*start_rgb\b + (*end_rgb\b - *start_rgb\b)*(t*i)}
		
		PalRGB palette_num, color_start_num + i, r_step, g_step, b_step
	Next i
End Statement

; .....


  ; Use Palette Range to set the rest of the colours
  a.ntRGB\r=$F,0,0
  b.ntRGB\r=0,$F,0
  PaletteRangeFixed_RGB{#P_1, 2, 6, a, b}
  
  a.ntRGB\r=0,$F,0
  b.ntRGB\r=0,0,$F
  PaletteRangeFixed_RGB{#P_1, 6, 10, a, b}
  
  a.ntRGB\r=0,0,$F
  b.ntRGB\r=$F,0,0
  PaletteRangeFixed_RGB{#P_1, 10, 15, a, b}
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	118
Size:	7.4 KB
ID:	58606  
E-Penguin is offline  
Old 23 June 2018, 10:20   #142
Master484
Registered User
 
Master484's Avatar
 
Join Date: Nov 2015
Location: Vaasa, Finland
Posts: 524
I tested the PaletteRange command and it seems to work on classic Blitz 2.1 at least, but the color values given have to be between 0-255, even if it's an OCS screen with OCS palette.

Also you have to give the "Use Palette" or "DisplayPalette" command after PaletteRange, or else the changes won't take effect. So it works in the same way as PalRGB and other palette commands; the changes can't be seen until an Use Palette/DisplayPalette is executed.
Master484 is offline  
Old 28 June 2018, 12:39   #143
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Is there a way to check disk activity?
Cobe is offline  
Old 28 June 2018, 22:41   #144
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Not really, no. It might be possible to do it for floppies by checking the motor bit on the CIAs, but no equivalent exists for hard drives, and anyway, there's no guarantee that some other task doesn't start disk access between you checking and doing something else...
Daedalus is offline  
Old 28 June 2018, 23:43   #145
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Thanks.. I feared its like that...
Cobe is offline  
Old 03 August 2018, 23:07   #146
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
Probably everyone already knows about this and I'm late to the party as usual, but the source code for blitz2, and various examples and BUMs not on the ubb dvd can be found here:
https://github.com/nitrologic/blitz2

Very interesting!
E-Penguin is offline  
Old 04 August 2018, 12:35   #147
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Not found on the UBB CD? Anything in particular?
idrougge is offline  
Old 04 August 2018, 12:42   #148
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,213
Just lots of examples. I've not done an exhaustive comparison
E-Penguin is offline  
Old 07 August 2018, 11:11   #149
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
How can I generate error returncode?
Cobe is offline  
Old 07 August 2018, 12:27   #150
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Quote:
Originally Posted by Cobe View Post
How can I generate error returncode?
As in, return a value to AmigaDOS? I don't think it's possible (or at least, easy to do) with Blitz 2, but in AmiBlitz 3 you load the value you want to return into register d0, then use End d0 instead of End to quit the program.
Daedalus is offline  
Old 07 August 2018, 14:48   #151
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
I think someone managed to hack that on the old Blitz mailing list. But you will have to search through many megabytes of Amigaguide files.
idrougge is offline  
Old 07 August 2018, 19:40   #152
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Ah.. ok. Thanks guys.
And as I recall amiblitz needs fpu. Do all the executables compailed with it also require fpu?
Cobe is offline  
Old 08 August 2018, 00:18   #153
Daedalus
Registered User
 
Daedalus's Avatar
 
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,334
Sometimes, even when using the integer optimisation mode. Certain commands will require an FPU (e.g. Val() ), but there isn't a comprehensive list that I know of, so there's always a risk. If the program is simple enough, you can probably try it on an FPU-less machine or WinUAE setup to confirm it works. It will most likely require a 68020 anyway, even if it works without an FPU. I've written a few programs like that and used work-arounds for commands I found that crashed the test system, e.g. using Vallong() instead of Val().
Daedalus is offline  
Old 13 September 2018, 14:34   #154
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Did it happen to anyone that debugger stops working seemingly all of a sudden? It just pops back to editor without any notice.
Cobe is offline  
Old 19 December 2018, 13:25   #155
attle
Registered User
 
Join Date: Aug 2012
Location: RAM:
Posts: 83
Is this kind of simple nesting really not possible?


Code:
While some_condition
  If foo then
    Print "Error"
  EndIf
Wend
This generates the error message "Illegaly nested Condition"

Edit: EndIf, still the same thing

Last edited by attle; 19 December 2018 at 14:13.
attle is online now  
Old 19 December 2018, 14:12   #156
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
Code:
While some_condition
  If foo
    Print "Error"
  EndIf
Wend
idrougge is offline  
Old 19 December 2018, 14:14   #157
attle
Registered User
 
Join Date: Aug 2012
Location: RAM:
Posts: 83
Aha, so Then was the issue
attle is online now  
Old 19 December 2018, 20:47   #158
saimon69
J.M.D - Bedroom Musician
 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,516
Quote:
Originally Posted by Cobe View Post
Did it happen to anyone that debugger stops working seemingly all of a sudden? It just pops back to editor without any notice.
You are lucky, in my WinUAE Blitz 2 debugger sent me in an instant trip to india every time i tried to use it :/
saimon69 is offline  
Old 19 December 2018, 23:10   #159
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Quote:
Originally Posted by saimon69 View Post
You are lucky, in my WinUAE Blitz 2 debugger sent me in an instant trip to india every time i tried to use it :/
I was lucky too that few months before it happened I copied my Blitz folder to other lap top where debugger still worked. So I copied it back and everything's fine...
mmm except the fact that some libraries break the .xtra data so if I use them on every load I have to manually correct numbers...
Cobe is offline  
Old 08 February 2019, 13:06   #160
AlgoRythmic
Registered User
 
Join Date: Jun 2016
Location: MiggyLand
Age: 43
Posts: 13
Hi, I have a question:
Can Mildred do 2x1 or 2x2 pixel ratio c2p internally? I mean other than 1x1 ofc.

Great thread btw
AlgoRythmic 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:09.

Top

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