A.D.A. Amiga Demoscene Archive

        Welcome guest!

  

  

  

log in with SceneID

  

Demos Amiga Demoscene Archive Forum / Coding / LoadRGB32 / palette

 

Author Message
kasie
Member
#1 - Posted: 2 Oct 2007 08:32
Reply Quote
It is possible, to change palette of 256cols picture not for full screen, but for some area of screen ? I want to do somethink like this: draw 640x480x256 picture on screen, then fadeup some other sprite on this picture which is by 256 cols of palette too, but not for full screen, but just for some area of screen.
michael phipps
Member
#2 - Posted: 2 Oct 2007 14:05
Reply Quote
@kasie

My answer is YES it is possible to change the RGB colors for part of the screen display! You do this by setting a copper wait instruction in your copperlist!

I'll give ya my own example as follows:-


copperwait MARCO
dc.b \1,$09
dc.w $fffe
ENDM


Place this instruction in your own copperlist by calling it like this


1st set of RGB colors where $0180=color00 register
$01be=color31 register
$0RGB=color value!!!

CopperListScreenDisplay:
fadecols1 dc.w <from $0180,$0RGB to $01BE,$0RGB>

wait 128 ;wait in the middle of screen!!

fadecols2 dc.w <from $0180,$0RGB to $01BE,$0RGB>

dc.w $ffff,$fffe ;dont forget to add this at the end of
your code to terminate the screen display okey!


Then you use the fadecols memory addresses to call your plane fader routine which you'll have to do yourself but if you don't know how to do it, tell me!!! Let me know how you get on anyway... ;)
kasie
Member
#3 - Posted: 2 Oct 2007 15:32
Reply Quote
Well, there is only one problem with it .. i want to do it system friendly. In mind that it will works without AGA , but will works on it too (i have plane for easy port it to AROS or on any other aos compatiblity os after all). In other words it must works on AGA machines, but also on any other amiga like machine which not have AGA (by using AOS API only).

So, i can use: LoadRGB32 (on this one i already base fadein/out routines for full screen), WritePixelArray8() - a bit slow for classic machines, but it's ok do palette by black color, draw image on screen, and fadeup it by changing palette, so, user even on very slow amiga will not see first 'drawing' and all will looks good.

After i draw image on screen by this way, i need fadeup other image on this,first, image , but coperlist i think it's AGA only way ..
michael phipps
Member
#4 - Posted: 2 Oct 2007 20:50
Reply Quote
Hmm.. the example I have given is in pure Assembler code to program the Amiga's Hardware Display Registers & will work on all Amiga's even slow ones hehe..

I'm not sure how you are compiling your code so please fill me in of course! ;)
winden
Member
#5 - Posted: 2 Oct 2007 22:53
Reply Quote
kasie, you can attach your copperlist 100% system-friendly-way to an existing screen, i can remember having some touchstone examples about using intuition and graphics functions to merge your own copperlist into the system one
kasie
Member
#6 - Posted: 3 Oct 2007 16:27
Reply Quote
winden, as i understand, coper list it's always mean real amiga with real AGA native modes. So, this kind of 'system friendly way', will not do 'crash' on others machines (like os4/mos or kind of where is no any chipsets), but, copper effect will be just missed. So, it's not deal .. Need somethink different.

michael phipps, i done my code on plain C with some asm parts. and your code mean hardware banging. I am talking about 'fully system friendly way'.
Without using of AGA directly, but, with works on it.
kasie
Member
#7 - Posted: 5 Oct 2007 09:09
Reply Quote
Anyone ?:) Still not have solution for it .. I try to explain it a bit more deeply what i want to do:

Here is situation: i have 256colors screen 640x480 or 640x512 by size (aga or cgx screen does not matter). I can use LoadRGB32 for load palette for all screen (screen->ViewPort). Then, over changing the palette+ WaitTOF() i can do FadeIn/Out effects of whole screen, which works fast even on 030.

Now is question: i need to change palette not for full screen, but for only some area of screen. In other words, some part of screen need to be still visibly, but other part of screen must have fadedown/fadein effect. As some of you said, that it possible to do it by Copper List, but it's AGA directly coding and i want to avoid it. (but, do it still works on AGA fast).

So, any idea, even very tricky, will be good. I think for example about this way: done on screen 2 window, and change palette for only one of it, but , loadrgb32 works with ViewPort, then, it's will not works with windows (i think). Maybe it possible do create 2 screens on one screen, and change palette for one of them ?

I watch today Excess09 polish mag (2003), and on option window mag have these options: Normal resolution or AGA direct. If i choice AGA direct, then, nothink surprise for me, that pages flips by fadein/out, without changing navigation panel pixels (coper list is here). but the it works also on Normal resolution with 640x480 by size over CGX (so, i think no AGA direct coding is here). Then i think it possible, but, how ?:)

Any idea (even very tricky and madness) will be very good.
kasie
Member
#8 - Posted: 6 Oct 2007 08:34
Reply Quote
if someone in interest, solution looks like this:

Split 256 cols palette on 2 different parts. First part for one part of screen, second part for second part of screen. For example i use for first one - 160cols palette, for second one 96 cols palette. Then , i load it by one single push by LoadRGB32 (it mean place 2 palette (160+96) to the one (256) ). After it i can do fade effects with this part of palette , which i want to fade. I can fade only one pict, or botchs at the same time. And, it will works fast even on 020 cpu with aga, or on any other cgx card, or any other cgx subsystem like P96 or CGX.

 

  Please log in to comment

  

  

  

 

A.D.A. Amiga Demoscene Archive, Version 3.0