Jump to content
IGNORED

320 mode colours question


karri

Recommended Posts

I have been playing a little with 320c and 320a modes. They seem to work nicely together. But I have difficulties to use more than 8 colours on the screen. For some silly reason every 4 bits are either on or transparent. And only the PXC2 colours seem to be used (P0C2 to P7C2). Am I missing something obvious here? Is there a 320 mode that would give me more colours?

 

I could make every zone interrupt and change the palette values. But that would be overkill for me.

Link to comment
Share on other sites

Transparency doesn't interact well with the 320 modes as like with positioning it's still based around the 160 modes. What happens is that MARIA still interprets things in pairs of bits so only '00' is actually transparent, but '01' or '10' are not and instead are drawn in the background colour. Disabling transparency entirely via "kangaroo mode" allows the '01' and '10' combinations to draw as expected, but of course then you can't overlap graphics.

I'm not sure if 7800basic has a way of toggling kangaroo mode, but it's set with bit 2 of the CTRL register.

Edited by SmittyB
Link to comment
Share on other sites

54 minutes ago, SmittyB said:

Transparency doesn't interact well with the 320 modes as like with positioning it's still based around the 160 modes. What happens is that MARIA still interprets things in pairs of bits so only '00' is actually transparent, but '01' or '10' are not and instead are drawn in the background colour. Disabling transparency entirely via "kangaroo mode" allows the '01' and '10' combinations to draw as expected, but of course then you can't overlap graphics.

I'm not sure if 7800basic has a way of toggling kangaroo mode, but it's set with bit 2 of the CTRL register.

I understand this in part, but not entirely. I get that only a "00" bit pair would get interpreted as transparent, but wouldn't "01" and "10" get interpreted as one pixel in the current palette color, and one as background color regardless of whether kangaroo mode is enabled?

  • Like 2
Link to comment
Share on other sites

8 hours ago, karri said:

I have been playing a little with 320c and 320a modes. They seem to work nicely together. But I have difficulties to use more than 8 colours

That's right, a maximum of 8 colors + background color, per scanline/zone.

 

 

6 hours ago, Karl G said:

I understand this in part, but not entirely. I get that only a "00" bit pair would get interpreted as transparent, but wouldn't "01" and "10" get interpreted as one pixel in the current palette color, and one as background color regardless of whether kangaroo mode is enabled?

Your understanding is correct, Karl.

 

 

7 hours ago, SmittyB said:

What happens is that MARIA still interprets things in pairs of bits so only '00' is actually transparent, but '01' or '10' are not and instead are drawn in the background colour.

6 hours ago, SmittyB said:

The difference is that both halves are drawn as background if transparency is enabled so you lose out on a bunch of colour combinations.

 

This circumstance occurs exclusively with C1 and exclusively in 320B and 320D mode.

 

 

Edited by Defender_2600
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

6 hours ago, Eagle said:

Long story short, avoid 320 modes :)

You can use them for text but if you try to overlap 320A mode then you will be surprised

 

I do not agree. Here for you again the list of 7800 games made in 320 modes. :)

 

 

Asteroids Deluxe

AstroBlaster

Astro Fighter

Baby Pac-Man (maze)

CrazyBrix

Death Merchant

Defender (WIP)

Dungeon Stalker

Frenzy/Berzerk

Froggie

Galaxian

Graze Suit Alpha

Jacks or Better

Kiloparsec

Moon Cresta

Ms. Pac-Man 320

One on One Basketball

Pac-Man 320

Pac-Man Collection - 40th Anniversary Edition

Pac-Man Plus 320

Plink

Plumb Luck DX

Rikki & Vikki

Rip-Off

Scramble

Space Invaders

Tower Toppler

UniWarS

 

Edited by Defender_2600
  • Like 3
Link to comment
Share on other sites

Thanks! In that case I have it right.

 

Currently I am working on a small game entirely in 320a and 320c mode. It works fine, but I realized that I have to design the graphics in 160 wide and then scale it to 320 to get the pixel colours managable.

 

Obviously I could also use the background colour to create a striped structure effect by allowing some pixel pairs to be 10 or 01. Just now I only use 00 or 11.

 

If I really want to mix modes then I assume I need to change the CTRL register on the fly between zones. Perhaps I need to do it at some point.

  • Like 1
Link to comment
Share on other sites

9 hours ago, SmittyB said:

I'm not sure if 7800basic has a way of toggling kangaroo mode, but it's set with bit 2 of the CTRL register.

I was thinking about using kangaroo mode. But in my case I have no overlapping graphics so the result is identical if I use kangaroo mode or not.

 

Perhaps the best way is to mix 160B graphics if I want more colours. Of course I then need to manipulate CTRL during the draw of a scanline. If you really count cycles I assume that it is possible to toggle CTRL on the fly. But on the other hand you may have to keep CTRL steady during the display of the entire scanline. The graphics in the zone may have hpos that appear in the wrong order. Perhaps the hardware sorts the entire list before the draw starts?

 

Link to comment
Share on other sites

CTRL can be changed on the fly, and there's at least one demo floating around that shows splitting the screen vertically, but I don't think that's practical for more than static displays. The most reliable way to change it is to wait for an interrupt of some sort, then count lines by writing to WSYNC as one would on the 2600, and then write to CTRL (and sCTRL in 7800basic) immediately after the last WSYNC to make it consistent.

MARIA will never sort things. I believe it keeps 2 lines of graphics in its internal memory at a time, the one it's currently drawing and the one it's building for the next line. As it steps through the DL entries it stamps the graphics in their spot in the buffer so it's down to the programmer to make sure that all happens in the right order.

Link to comment
Share on other sites

53 minutes ago, SmittyB said:

As it steps through the DL entries it stamps the graphics in their spot in the buffer so it's down to the programmer to make sure that all happens in the right order.

Thanks for the explanation. So in theory I could change the CTRL in the middle of the zone processing. Obviously the order of the hpos elements make no difference as the pixels are stamped in Marias memory for the whole line before the real data goes on screen.

 

What bothers me a bit is that creating a 320c frame around graphics windows is not easy.

GuiProto.thumb.png.02f0fbba58938a5f492532da862c6060.png

 

This works, but only as long as I use 320c graphics only.

Link to comment
Share on other sites

11 hours ago, Defender_2600 said:

I do not agree.

I know. 320 modes are not a problem for a coder but for gfx guys :D 

We don't have good topic about 320 modes on forum so we can continue here and put everything in one place.

Even some information/spreadsheet on the forum are misleading.

I just did small program for testing 320A modes so anyone can test before decide to use 320 modes.

Fire changing between sprites, every sprite use different pallet.

Joy left, right moving sprite (it's done by hires pixel!!!)

Difficult switch Kangaroo mode ON/OFF

 

Next time I will do for other 320 modes.

 

320 mode test - JS7800 link

 

image.thumb.png.3a060b7099dfefb87376267a102ba1d5.png

test320.a78

Edited by Eagle
  • Like 8
  • Thanks 1
Link to comment
Share on other sites

6 minutes ago, Eagle said:

Difficult switch Kangaroo mode ON/OFF

This is a real cool option if you want to use the background colour in your sprites. But the drawing order becomes important. This is a great way of visualizing kangaroo mode.

  • Like 1
Link to comment
Share on other sites

18 hours ago, karri said:

Thanks for the explanation. So in theory I could change the CTRL in the middle of the zone processing. Obviously the order of the hpos elements make no difference as the pixels are stamped in Marias memory for the whole line before the real data goes on screen.

 

What bothers me a bit is that creating a 320c frame around graphics windows is not easy.

GuiProto.thumb.png.02f0fbba58938a5f492532da862c6060.png

 

This works, but only as long as I use 320c graphics only.

The only way I got the 320a text to work with the 320c frames was to first declare the 320c parts and last the 320a. Like this:

.macro TextZone row
        ; Flip to 320c mode
        .byte   $00	;addrlo
        .byte   $c0	; 320C direct
        .byte   >(_Gui_tiles)	;addrhi
        .byte   $1f	;pal 0, palwidth 0
        .byte   160	;hpos
        ; Gui frame
        .byte   (4-1) * 2
        .byte   32-2	; palette 0 , 2 bytes wide
        .byte   >(_Gui_tiles)
        .byte   0
        ; Gui frame
        .byte   (22-1) * 2
        .byte   32-2	; palette 0 , 2 bytes wide
        .byte   >(_Gui_tiles)
        .byte   34*4
        ; Gui frame
        .byte   (17-1) * 2
        .byte   32-8 + $80	; palette 0 , 8 bytes wide
        .byte   >(_Gui_tiles)
        .byte   35*4
        ; Gui frame
        .byte   (23-1) * 2
        .byte   32-2	; palette 0 , 2 bytes wide
        .byte   >(_Gui_tiles)
        .byte   4*39
        ; Text
        .byte   <(_adv_screen + row * mono_charsperline)
        .byte   $60	; 320A indirect
        .byte   >(_adv_screen + row * mono_charsperline)
        .byte   32-20 ; palette 0,
        .byte   4
        .byte   <(_adv_screen + row * mono_charsperline + 20)
        .byte   $60
        .byte   >(_adv_screen + row * mono_charsperline + 20)
        .byte   32-13
        .byte   84
        ; Cursor
        .byte   95
        .byte   0
        .byte   >_mono_font
        .byte   0
        ; Null header
        .byte   0
        .byte   0
.endmacro

 

Link to comment
Share on other sites

2 hours ago, Eagle said:

I know. 320 modes are not a problem for a coder but for gfx guys :D 

 

Thanks to EricBall's tables, it seems easy for me to understand how to design graphics with 320 modes, his tables include all available combinations for each pair of pixels.

 

In 320B and 320D mode, C1 + background and C1+ C1 will be transparent when Kangaroo mode is disabled, this is the exception to remember.

 

https://sites.google.com/site/atari7800wiki/graphics-modes/320b-d-and-kangaroo-mode

 

 

Getting the best result possible, within the restrictions of pixel placement and the number of colors available, is certainly a pixel artist's job.
Rikki & Vikki is a spectacular example of this.

 

Edited by Defender_2600
  • Like 4
Link to comment
Share on other sites

On 3/21/2023 at 5:06 PM, Eagle said:

I know. 320 modes are not a problem for a coder but for gfx guys :D 

We don't have good topic about 320 modes on forum so we can continue here and put everything in one place.

Even some information/spreadsheet on the forum are misleading.

 

I guess a good graphics tool which understands 320 color modes would be useful. Something like G2F for the Atari 800XL.

Link to comment
Share on other sites

  • 2 weeks later...

Has anything useful ever come out of 320D?  I tried an interlace experiment with it once, where you swap fonts while simultaneously swapping the color registers on the alternate columns, to get a vertically interlaced display.  The idea was to get 320B color resolution but at the lower DMA cost that 320D provides (same as 320A).  It didn't work out like I wanted exactly, though.  :(

Link to comment
Share on other sites

I actually ended up using 320B for Scramble, both with and without Kangaroo mode depending on the area of the screen.

 

(I *still* don't see the usefulness of 320C or 320D mode...  Do any homebrew games use them?  I don't think any retail games do...)

Edited by PacManPlus
Link to comment
Share on other sites

1 hour ago, PacManPlus said:

I actually ended up using 320B for Scramble, both with and without Kangaroo mode depending on the area of the screen.

 

(I *still* don't see the usefulness of 320C or 320D mode...  Do any homebrew games use them?  I don't think any retail games do...)

Did the title screen perhaps leverage 320D at all?

 

According to the reference notes, on some of the test ran several years ago utilizing the info build, these results came back:

image.thumb.png.1fd15cd6716149848e17ee27b67c427d.png

  • Like 1
Link to comment
Share on other sites

No - neither Scramble nor Astro Blaster use 320C or 320D... at least intentionally.  Truth be told, I still don't fully understand how to utilize C&D modes...  Which is why I left them out of my 'Graphic Converter' program.

Edited by PacManPlus
Apparently I can't spell simple words :-/
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...