English Amiga Board Blitz Basic Questions
 Register Amiga FAQ Rules & Help Members List  /  Moderators List Today's Posts Mark Forums Read

20 June 2018, 19:02   #141
E-Penguin
Banana

Join Date: Jul 2016
Posts: 661
Quote:
 Originally Posted by E-Penguin 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
; 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

 23 June 2018, 10:20 #142 Master484 Registered User   Join Date: Nov 2015 Location: Vaasa, Finland Posts: 328 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.
 28 June 2018, 12:39 #143 Cobe Registered User   Join Date: Jan 2014 Location: Belgrade / Serbia Age: 35 Posts: 594 Is there a way to check disk activity?
 28 June 2018, 22:41 #144 Daedalus Registered User   Join Date: Jun 2009 Location: Dublin, then Glasgow Posts: 3,254 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...
 28 June 2018, 23:43 #145 Cobe Registered User   Join Date: Jan 2014 Location: Belgrade / Serbia Age: 35 Posts: 594 Thanks.. I feared its like that...
 03 August 2018, 23:07 #146 E-Penguin Banana   Join Date: Jul 2016 Location: Darmstadt Posts: 661 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!
 04 August 2018, 12:35 #147 idrougge Registered User   Join Date: Sep 2007 Location: Stockholm Posts: 3,637 Not found on the UBB CD? Anything in particular?
 04 August 2018, 12:42 #148 E-Penguin Banana   Join Date: Jul 2016 Location: Darmstadt Posts: 661 Just lots of examples. I've not done an exhaustive comparison
 07 August 2018, 11:11 #149 Cobe Registered User   Join Date: Jan 2014 Location: Belgrade / Serbia Age: 35 Posts: 594 How can I generate error returncode?
07 August 2018, 12:27   #150
Daedalus
Registered User

Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 3,254
Quote:
 Originally Posted by Cobe 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.

 07 August 2018, 14:48 #151 idrougge Registered User   Join Date: Sep 2007 Location: Stockholm Posts: 3,637 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.
 07 August 2018, 19:40 #152 Cobe Registered User   Join Date: Jan 2014 Location: Belgrade / Serbia Age: 35 Posts: 594 Ah.. ok. Thanks guys. And as I recall amiblitz needs fpu. Do all the executables compailed with it also require fpu?
 08 August 2018, 00:18 #153 Daedalus Registered User   Join Date: Jun 2009 Location: Dublin, then Glasgow Posts: 3,254 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().
 13 September 2018, 14:34 #154 Cobe Registered User   Join Date: Jan 2014 Location: Belgrade / Serbia Age: 35 Posts: 594 Did it happen to anyone that debugger stops working seemingly all of a sudden? It just pops back to editor without any notice.

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Havie Coders. Blitz Basic 30 08 September 2013 09:15 petza request.Apps 11 08 April 2007 01:49 jobro request.Apps 12 28 November 2005 18:15 Tony Landais Coders. General 2 08 May 2003 22:51 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 Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home News Main     Amiga scene     Retrogaming General Discussion     Nostalgia & memories Support     New to Emulation or Amiga scene         Member Introductions     support.WinUAE     support.WinFellow     support.OtherUAE     support.FS-UAE         project.AmigaLive     support.Hardware         Hardware mods         Hardware pics     support.Games     support.Demos     support.Apps     support.Amiga Forever     support.Amix     support.Other Requests     request.UAE Wishlist     request.Old Rare Games     request.Demos     request.Apps     request.Modules     request.Music     request.Other     Looking for a game name ?     Games images which need to be WHDified abime.net - Hall Of Light     HOL news     HOL suggestions and feedback     HOL data problems     HOL contributions abime.net - Amiga Magazine Rack     AMR news     AMR suggestions and feedback     AMR data problems     AMR contributions abime.net - Home Projects     project.Amiga Lore     project.EAB     project.IRC     project.Mods Jukebox     project.Wiki abime.net - Hosted Projects     project.aGTW     project.APoV     project.ClassicWB     project.Jambo!     project.Green Amiga Alien GUIDES     project.Maptapper     project.Sprites     project.WinUAE - Kaillera Other Projects     project.Amiga Demo DVD     project.Amiga Game Factory     project.CARE     project.EAB File Server     project.CD32 Conversion     project.Game Cover Art         GCA.Feedback and Suggestions         GCA.Work in Progress         GCA.Cover Requests         GCA.Usefull Programs         GCA.Helpdesk     project.KGLoad     project.MAGE     project.Missing Full Shareware Games     project.SPS (was CAPS)     project.TOSEC (amiga only)     project.WHDLoad         project.Killergorilla's WHD packs Misc     Amiga websites reviews     MarketPlace         Swapshop     Collections     EAB's competition Coders     Coders. General         Coders. Releases         Coders. Tutorials     Coders. Asm / Hardware     Coders. System         Coders. Scripting         Coders. Nextgen     Coders. Language         Coders. C/C++         Coders. AMOS         Coders. Blitz Basic     Coders. Contest         Coders. Entries Off Topic     OT - General     OT - Technical     OT - Entertainment     OT - Sports     OT - Gaming

All times are GMT +2. The time now is 19:21.

 -- EAB3 skin ---- EAB2 skin ---- Mobile skin Archive - Top