03 April 2017, 18:21 | #21 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Don't worry, this routine can not be fast
Knowing the intended use case would also help - mere palette fades don't need fast code and 68000 is too slow for alpha blending (which would be faster in 24-bit anyway) so i don't see any use. But perhaps it's just for the sake of the coding compo ? |
03 April 2017, 18:55 | #22 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
I remember when I was fourteen (1984..) I wrote an interpolation routine in 6502 for the C64 that just made me realize what was linear interpolation. My editor was a sheet of paper. So to answer You: I do not know if it will never be anything, I do it for fun and competition. I'm so enthusiastic to returning to write code to 68000 after more than 20 years. An architecture so beautiful! I hope I never get tired soon, burdened by my work and life. Bye, PS: another thing I like is that this forum is full of old farts, I feel at ease |
|
03 April 2017, 20:53 | #23 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
|
03 April 2017, 20:56 | #24 | |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
Quote:
|
|
05 April 2017, 02:22 | #25 | |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
Quote:
I agree the fast version doesn't have an immediately obvious use case (but I guess there might be a good use). For me, after I call the equivalent of this for each color, I wait for up to 100 scan lines to control the speed of the color fade. Looking forward to seeing the results. |
|
05 April 2017, 06:49 | #26 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
|
05 April 2017, 09:13 | #27 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Unless someone has made something really unexpected, it will be accurate enough for a game. At least my version is. Fade in/out is very common in games and is always more or less the same thing.
Quote:
It is also more OS friendly. Quote:
There is such a routine in my last game port. It uses range 0-128 instead. |
||
05 April 2017, 11:33 | #28 |
Registered User
Join Date: Mar 2016
Location: Australia
Posts: 881
|
Yes, as soon as I posted that I wondered why I wasn't waiting for the vblank, and I think it was just because my first fade routine had too many steps so I just sped it up and never went back and fixed it.
|
05 April 2017, 21:43 | #29 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
|
06 April 2017, 02:33 | #30 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,376
|
Deleted. Sorry for being OT ! No more questions.
Last edited by PeterK; 06 April 2017 at 17:18. |
06 April 2017, 04:14 | #31 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,764
|
No, I mean 256 kilobytes (68020, untested):
Code:
; ; in: ; ; d0.w = 0rgb ; d1.w = 0rgb ; d2.w = alpha (0 - 15) ; ; out: ; ; d0.w = 0rgb ; lsl.w #4,d0 or.w d2,d0 lsl.w #4,d1 or.b #15,d1 sub.b d2,d1 move.l (a0,d0.w*4),d0 add.l (a0,d1.w*4),d0 lsr.l #4,d0 lsl.b #4,d0 lsl.w #4,d0 lsr.l #8,d0 |
06 April 2017, 09:41 | #32 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
|
06 April 2017, 10:04 | #33 | ||
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Why? The reward is so good!
Quote:
Quote:
Bye! ross Last edited by ross; 06 April 2017 at 11:21. Reason: no reference :) |
||
06 April 2017, 11:22 | #34 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
Please refrain from turning this thread into a rambling discussion and potentially going off topic....
Last edited by DanScott; 06 April 2017 at 12:20. |
09 April 2017, 22:01 | #35 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
Entries will close tomorrow morning (UK time) at around 9am... still time for that kick-ass fast or small routine.
Results will be posted during the week, after I've had time to check through them all. |
17 April 2017, 18:21 | #36 |
Lemon. / Core Design
Join Date: Mar 2016
Location: Tier 5
Posts: 1,212
|
Still tied up with things post "Revision" (got 2nd Place in the Amiga demo comp with an OCS demo btw!!) 6 points behind the winner (a rather nice AGA production)
Will try and get the results of THIS competition tied up and posted here this week |
18 April 2017, 15:27 | #37 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,771
|
Correctly fading shall be done in linearized RGB color space (and all computer hardware also Amiga use non linear - gamma corrected RGB color space - first RGB need to have applied inverted gamma function fade then apply gamma correction).
https://en.wikipedia.org/wiki/Gamma_correction |
18 April 2017, 17:45 | #38 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
You are right, but in this competition we are subjected to severe constraints (small code, integer math, pure 68k, 12 bit RGB, calculated table..). And in any case I think nobody would notices the difference by using a linear interpolation compared to a real RGB space fading on Amiga OCS. Bye ross |
|
19 April 2017, 12:20 | #39 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,771
|
Quote:
|
|
19 April 2017, 12:54 | #40 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Anyone up for an ASM coding competition? | DanScott | Coders. Asm / Hardware | 526 | 22 September 2018 21:38 |
What gives you coding inspiration? | pmc | Coders. General | 55 | 16 November 2009 21:45 |
Need help with audio coding. | Thorham | Coders. General | 6 | 05 March 2008 08:38 |
Help coding | alexh | Coders. General | 14 | 15 August 2006 09:24 |
Coding a Trainer | redblade | Coders. General | 10 | 25 January 2005 21:52 |
|
|