13 December 2015, 03:08 | #1 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Help with Dual Playfield
I am using the code above to test a dual playfield. I've made the dual playfield example on the blitz basic manual many months ago, even messed with it and everything worked. Now I am trying to do this... but the foreground graphics are *always* messed up. No matter what size or file I use, the graphics come really very messed, with stuff cut, or repeating at the wronge places, pixels missing, and sometimes just a big mess. I tried using different sizes of bitmaps, and the foreground never shows properly (The palette is correct though). I am probably missing something really obvious here, but I have no idea what. EDIT: Ok, I was wrong... the problem was with the file (and I also obviously starting the bitmap with the wrong number of bitplanes). But even then, I guess the foreground background has to be exactly double the size of the background for the code to work. Also, both bitmaps need to have the same height (taking the whole slice height) or else it will show garbage, right? Last edited by Shatterhand; 13 December 2015 at 04:14. |
13 December 2015, 04:47 | #2 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I am doing something wrong with the scroll function on the foreground.
when I don't do it works, but the foreground wraps at the wrong point... |
13 December 2015, 04:56 | #3 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,335
|
Don't use Slices. They're deprecated since 1993.
|
13 December 2015, 04:59 | #4 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I thought the display library were more geared towards AGA stuff.
I'll try to do it some other way then... |
13 December 2015, 06:22 | #5 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Trying to use the display library, getting either a blank screen (I know color 0 is being draw because I am changing it with copper list) or just a guru reboot... :/
Edit: Problem is I don't know how to load a Palette with the Display Library, it seems like neither Use Palette or ShowPalette works here. NewPaletteMode off and problem solved. Thank you, it's obvious the Display Library is a lot more stable than Slices, it's just a little bit harder to understand Last edited by Shatterhand; 13 December 2015 at 07:23. |
13 December 2015, 17:17 | #6 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,335
|
Display library is AGA compatible, but not AGA exclusive in any way.
The worst thing about Display library is the setup, what with making a CopList and so on. But there are examples in the manual that you can modify until you've got something. Last edited by idrougge; 13 December 2015 at 17:24. |
13 December 2015, 17:59 | #7 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Yeah, I've managed to setup what I wanted, with the top of the screen clear for a 2 bitplanes panel with score/lives info etc, and the bottom a dual playfield with parallax scroll. I even managed to use a copper list to change the colors of the background to a blue gradient.
But now I am trying to get the sprites colors to appear properly.. for some reason, the DisplayPalette function isn't loading the last 16 colors from the palette file I am loading. The only way I managed to change a color from the palette so far is using DisplayRGB .. but I am not being able to get the same colors as from my .iff file ( for some reason, a RGB of 15,15,15 gives me a YELLOW instead of WHITE? what the hell?) I am starting my display without AGA colors, so I guess my values of R, G and B should go from 0 to 15, right? |
13 December 2015, 20:42 | #8 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,335
|
Could it be the copoffset field?
|
13 December 2015, 21:48 | #9 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,344
|
I'm not an expert on coplists, but I wonder if the fact that you're using a blue gradient in the copper is having an effect, since yellow is the complement of blue.
You're sort of correct regarding the colours - displays initialised without the AGA flags will only have the 12-bit colour range available, so 0-15 in each channel. But you can still load AGA palettes, it just means you don't get the definition since the lower 4 bits are lost from each channel when it's displayed. Which values you use will depend on whether you use the AGAPalRGB or just PalRGB values when you modify it. Using the AGA versions won't give you any benefit if you're not using an AGA screen (and probably won't work on a non-AGA machine) so best to keep to the ECS commands and values. |
13 December 2015, 22:56 | #10 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I actually didn't use DisplayRainbow to make the blue gradient, I just used DisplayRGB to change color 0 to different shades of blue at different heights on the Display.
I turned that off, still get yellow when I use DisplayRGB 15,15,15 on color register 19, but gives me a blue when I use it on color register 17 ! That's really weird. And it's also werid it doesn't get the colors 16-31 from the palette.iff file I am loading (but it does work for both playfields) Sprites colors are completely independent of how many bitplanes the display has, right? Sprite 0 should *always* uses colors 17, 18 and 19, no matter how many bitplanes I am using, right? Also, the bottom Display is ok, but the display on the top is showing garbage when I try to display a bitmap on it (the bitmap is shown, but with lots of garbage on it) I dunno if I should show you guys the code I am using, if any of you could be willing to help, I'll be grateful |
13 December 2015, 23:22 | #11 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,335
|
You could try to InitPalette to hold the required number of colours.
|
14 December 2015, 01:32 | #12 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
I actually tried that, it didn't work, all colors become black, and it still ignores the sprites colors. What's weird is that if I do that, even if I do a displaypalette command later, it doesn't load up my palette and all colors are black.
EDIT: Doh, it's obvious this happens, because InitPalette will overwrite the previous palette. Anyway now I initiate the palette with 32 colors, then load the iff file for the palette, still nothing. Last edited by Shatterhand; 14 December 2015 at 01:54. |
14 December 2015, 04:42 | #13 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
This is get really frustrating
When I load a palette, it doesn't use colors 16 to 31. If I try to change the color using the DisplayRGB function, it seems to work at random.. sometimes it works, sometimes it doesn't. Right now I can change, for example, Color Register 19, but can't change 18 or 17 (the command seems to be ignored) At other moments I was being able to change all of them. I have no idea of what I do different. For example, right now I have 3 lines on my code before getting into the main loop Code:
DisplayRGB 0,17,0,15,0,0 DisplayRGB 0,18,0,0,15,0 DisplayRGB 0,19,0,0,0,15 I have this at an earlier point of the code: Code:
for f=0 to 15 DisplayRGB 0,0,F*9,9,7,15-F next Is there any other way to change a pallete register using the Display Library? It doesn't seem to be too smart to use the copper for a register that won't change while the screen is drawn. Is there anything important I must know that I am missing? EDIT : FRIGGIN HELL I got it. It seems I can't change more than 1 color per scanline. When I changed to Code:
DisplayRGB 0,17,1,15,0,0 DisplayRGB 0,18,2,0,15,0 DisplayRGB 0,19,3,0,0,15 One more reason to say that using the copper like this to change a register from the palette seems to be really dumb. There must be some other way to do this. Or figure out why I am not loading colors 16-31 from the palette file. Last edited by Shatterhand; 14 December 2015 at 04:50. |
14 December 2015, 05:15 | #14 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
|
2 questions: Are you using AGA? If so, are you setting up the bank select register for the sprite and playfield palette?
If you are assuming that the sprites are always colors 16-31 on AGA, you are wrong. They can be any multiple of 16 as a base, as can each playfield. |
14 December 2015, 10:51 | #15 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,344
|
DisplayRGB changes the colour registers directly, which will take time and has to fit in with the other display stuff going on, and is why it interacts with the Coplist like that. Modifying the display's colours directly like that also will not update the palette object.
It might be simpler to set the palette up yourself and then use DisplayPalette to load that palette into the display. So: use InitPalette with enough depth, then use PalRGB to set the colours, then use DisplayPalette to load the current palette's colours into the display. See also what Samurai Crow is saying about the bank swapping. In theory, using non-AGA display modes and palette objects, the sprites should indeed use colour registers 16-31, but if the display has any sort of a funky setup or anything AGA-related (including fetch mode changes), they can be moved around anywhere up to and including registers 240-255. See the DisplayControl command for details on the different registers involved. When you're loading your palette, there's an optional offset parameter that lets you specify where the loaded palette starts. So, you can have a 16-colour palette file for your sprites, and use an offset of 240 to get it to load those colours into registers 240-255 instead of 0-15. |
14 December 2015, 13:05 | #16 |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Code:
InitCopList 0,110,240,$36,8,16,-1 I tried using PalRGB and then DisplayPalette before and it didn't work, but maybe I was doing something wrong. I'll try all those suggestions and then see what works. Thank you guys |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
flimbo's quest dual playfield? | Raislin77it | Coders. General | 14 | 01 August 2015 16:53 |
Translating sprite coordinates to playfield coordinates | nandius_c | Coders. Asm / Hardware | 15 | 31 July 2014 23:17 |
Dual playfield colors and AGA | losso | Coders. Asm / Hardware | 1 | 03 December 2013 02:48 |
Dual Playfield | BippyM | project.Maptapper | 6 | 03 July 2013 00:43 |
A600 dual kickstart, dual boot drive | TreacleWench | Hardware mods | 41 | 18 May 2012 12:02 |
|
|