Jump to content
IGNORED

Mode 15 PAL Blending?


Recommended Posts

Hello, guys!

Inspired by FlashJazzcat's message I've been working on something over last couple of days.

 

First line 160 pixels in one of 4 hues (black, red, green, blue).<br />

Second line 160 pixels in one of 4 lumas (0, 6, 10,14).<br />

<br />

As Rybags said it's much better (brighter) if color-line has luma 2 instead of 0.<br />

<br />

Should be tested with different hues and lumas but overall for an quick'n'dirty weekend job it doesn't look that bad <img src='http://www.atariage.com/forums/public/style_emoticons/atariage/icon_smile.gif' class='bbc_emoticon' alt=':)' /><br />

<br />

Ps. If anyone has a nice 160x96 colorfull image and would like to see it on A8 just send it to me!<br />

<br />

 

 

 

 

I was thinking in this some time ago when I found an image of Amiga version of Menace in Google images that was all messed up and seemed exactly like this A8 using PAL artifacting.

I had the idea of 160 in all scanlines but never get really good results using G2F with DLIs on the colours/luminances scanlines.

Now I know why, instead of thinking in lots of possibilities I should go for the bas colours: Red, Blue and Green.

 

 

 

Popmilo how much cpu intensive is that (like a 160scanlines high screen, how much % of cpu it takes?)?

 

Edited by José Pereira
Link to comment
Share on other sites

Popmilo how's the original colours assigned to the 4hues?

You set destinity 4colours like here Black, Red, Blue and Green and then:

Black -> Black

Reds, Pinks, Oranges, Yellows, Purples -> Red

Lilacs, Blues -> Blue

Grees -> Green

And, for example, Brown you get what?

 

 

Of, course if a screen use Lilacs, Blues and Browns you could use Lilac and Brown insted of Red and Green, right?

Sort of GIMP?

Link to comment
Share on other sites

Just tested this on real hardware (LCD and CRT) and I have to say it looks great. Effectively a funky-looking 16 colour GR7 mode. Great work on judging the best luma / chroma values. I'd be very interested to see a game using this mode, as well as some photo conversions.

Ideal, as the pictures show for a nice SUPER 'Superb' Turrican!...

Think that pictures with all screen using this Technic and our guy man as hardware sprite 4PMGs (only gun as soft sprite):

- 2+2Players Multicolour 16 pixels wide, probably colour9.

- 4Missiles PF3/5th Player enabled Red for the Redish part of the clothes.

 

Same idea and just PMGs for our ship and, again, a SUPER 'Superb' R-Type on a8!...

Edited by José Pereira
Link to comment
Share on other sites

Popmilo how much cpu intensive is that (like a 160scanlines high screen, how much % of cpu it takes?)?

Currently it is simple wsync based changing of three colors each line so you loose a lot... full 192 lines...

 

If you only count color changing it's around 192x18=3456 cycles...

But you have to sync it all somehow... And it all adds up at the end...

 

Should try it with interrupts and than we'll know...

Link to comment
Share on other sites

Popmilo how's the original colours assigned to the 4hues?

...

For each pixel of original image I look for 'closest' color in A8 Palette (all examples so far used 'laoo' palette).

Than I extract hue and luma from palette for that color.

And than just look for closest of hues out of chosen 4.

And same for 4 chosen lumas.

 

That way I convert any RGB color to combination of those 4 hues and 4 lumas...

 

Each pixel of original image is than 'plotted' on A8 screen as 1 colored pixel and 1 'shade' pixel underneath him...

 

Of, course if a screen use Lilacs, Blues and Browns you could use Lilac and Brown insted of Red and Green, right?

Sort of GIMP?

Well, yes...

We could look at whole level graphics (if it is scrolling game) and choose best 'base' colors based on whole level...

Or choose colors for each screen (Last Ninja like games or adventures...).

Link to comment
Share on other sites

It's a tradeoff, they get the pal blending, we get the faster refresh rate :)

 

Yes... So you get faster refresh rate (60 Hz against 50 Hz) having less time to execute VBLANK procedure, we get :

- PAL blending

- Faster CPU (2MHz against 1.76)

 

Hmmm .... :)

Link to comment
Share on other sites

It doesn't have to be C64.

Try this one from ST, just directly PAINT 'squueze' to 160x resolution and 4colours as Black, Brown, Blue and Green.

I like 1:1 version...

"Squeezed" version looks ... well, squeezed.

 

Don't know if ninja game with such a large sprites is possible, but I would love to see those two guys fighting :)

post-14652-0-80969700-1349103848_thumb.png

ninja3.xex

post-14652-0-63092600-1349103854_thumb.png

ninja4.xex

  • Like 1
Link to comment
Share on other sites

Excellent examples ... a shame these don't work as well on NTSC machines ...

Yeah... Pal quirks are really something...

 

Shame is that I still haven't fixed my SIO cable... Arghhh.... I better stop converting pictures and fix cable instead ! :)

I just have to see this on real fuzzy TV instead of emulator...

 

Out of curiosity, I wonder what the results would be if this were used with Graphics 10 or 11 every other scanline instead of mode 15. Probably something like a CIN mode except 96 resolution.

We would get more colors but thing I like the most about this mode 15 mix is horizontal resolution...

Details really look better than in gtia modes.

 

And working with square pixels is a breeze...

  • Like 1
Link to comment
Share on other sites

Extra colour can be conjured out at the same res, but much more work and more memory wasteful.

 

Using character mode and VScrol tricks to force badlines, 2 pixel high characters means the PF3 attribute can add an extra colour, of course it becomes exclusive per 4 pixels with the PF2 colour.

 

On luma line the PF3 can be set the same as for PF2. Alternatively the PF3 attribute could be used to give more luma options instead. Then there's the PMs, they can be used as underlays to add more options.

 

By changing to upside-down characters, some memory is recovered - I used similar techniques to these for CIN+ mode which allows 160x96 ish type graphics with 96 colours but colour resolution still 80 (16 colours x 6 lumas with restrictions)

 

What would be cool is a RastaConvertor modification that generates Mode E pics for the PAL mixing mode similar to this - overcoming the non-optimised limitation of 4 colours, 4 lumas would make for some much more colourful pics.

 

 

Seperate to all that, extra luma options could be had by "flicker" - alternating selected pixels between 2 values. Not a fan of the method but if done the right way can add extra colour without making the display look too bad.

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

Extra colour can be conjured out at the same res, but much more work and more memory wasteful.

Yes... That's the 'beauty' of this method - simplicity :)

Simple to code, simple to convert, simple to change any pixel to any of possible colors...

 

Static graphics wasn't my goal... Something more dynamic should be possible in more than 'usual' 4 colors...

 

By changing to upside-down characters, some memory is recovered - I used similar techniques to these for CIN+ mode which allows 160x96 ish type graphics with 96 colours but colour resolution still 80 (16 colours x 6 lumas with restrictions)

Is there an explanation of CIN+ mode ? I can not seem to find one.... :(

 

What would be cool is a RastaConvertor modification that generates Mode E pics for the PAL mixing mode similar to this - overcoming the non-optimised limitation of 4 colours, 4 lumas would make for some much more colourful pics.

Fixing color optimization is my next step...

Currently I find 'similar' colors by simple RGB difference...

Should use YUV color space instead...

And, those 4 Atari hues should be chosen depending on entire original picture, not just predefined red, green, blue as now...

 

@Flickering: Mayhem in monsterland on C64 did it and did it well... It is practically indistinguishable from normal colors...

Link to comment
Share on other sites

CIN - colour lines by Antic F with GTIA colour mode set, 80 pixels with 16 available colours. Luma lines by Antic E with 4 shades of grey.

 

CIN+ colour lines as CIN. Luma line by Antic 4, VScrol trick used to produce single scanline. PMs used on Antic 4 lines as underlay, giving 6 possible luma values instead of 4. Upside-down character mode also utilized to save memory.

Since only 2 scanlines of the characer set per character are used (top/bottom only), 3/4 of the character set memory is unused, and not very useful for other purposes since the layout sees 1 byte used, 6 empty, 1 used, repeat.

1 K character set required for every 6 scanlines of luma data represented, so 96/6 = 16K for character set data, plus 1280 bytes PMG, plus 3840 bytes bitmap for colour lines, plus DList requirement.

Also character memory needed, since each character needs it's own attribute bit reuse isn't possible so 96*40 = 3,840 bytes additional there.

 

So, pretty memory hungry. PMs could be done in double-line mode to save Ram there but then GRAFn registers have to be zeroed on the colour lines.

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

...So, pretty memory hungry. PMs could be done in double-line mode to save Ram there but then GRAFn registers have to be zeroed on the colour lines.

Thanks!

I'll stick to simple color mixing for now ;)

 

I like vscroll tricks and PM usage in CIN+ though... Good combination...

Link to comment
Share on other sites

Another idea ... possible to use this method using Antic 4? You'd get access to PF3, which increases the number of colors in the mode to 23.

 

For single font usage, this would make for a tile-based game.

 

Or, you can create a pseudo-bitmap mode ... use a character set change DLI every three lines, then put screen codes 0-119 sequentially on your screen, 8 times over ... each character becomes a 4x8 section of a bitmap ... it's essentially like Graphics 15 except you POKE into the character set memory instead of the screen memory. This would require 8k of memory for all 8 fonts needed for this, but you could then use PF3 in your graphics. This is actually a method I used when displaying pictures using my ICE flicker modes.

 

Using this method, I would recommend the following luma settings:

 

PF0-10

PF1- 6

PF2 - 2

PF3 - 14

 

This reduces the likelihood of PF3-PF2 conflicts in your character, by making PF3 your brightest luma and PF2 your darkest. These mix with the chroma settings on the next line to make 23 colors (not 5x5=25, because you can't mix PF2 and PF3 in same char).

Edited by Synthpopalooza
Link to comment
Share on other sites

The main reason of using character mode is to get the fifth colour, but it's not useful if done as a full sized cell.

 

1 or 2 pixel high chrs means you only suffer the same attribute for that amount of time. For 2 pixel high, the easy solution would be to provide 5 lumas and on the colour lines have PF2 and PF3 the same.

 

1 pixel high chrs - probably won't work in normal width. There's not enough time to do all the required changes to colour registers, Chbase, VScrol.

 

In the context of a game, such a mode has limited use due to huge memory and CPU requirement. It's ideal for standalone pics or initial load screen though, although due to CPU use it can't be active during disk activity.

Link to comment
Share on other sites

Just for fun, here is an animation of popmilo's graphics mode on Altirra:

 

http://youtu.be/vLFhfoBLsOg

 

The Youtube video is somewhat distorted. Emulator executable here. Github repo here.

Amazing!

Now we all also want to see and dream about Turrican, don't we?

Thanks.

 

 

 

How do you get this?

Frame by frame original and Popmilo convert each and then it's something like those A8 movies on YouTube like the APAC Mode or the GTIA9 Matrix?

Edited by José Pereira
Link to comment
Share on other sites

Was wondering about how many cycles it would 'waste' a scrolling of this... Taking the example of the following Turrican picture:

-> PLAYING AREA:

192scanlines x (48_ANTIC with HorizScroll + 9_refresh + 18_3 LDA/STA colour change) = 14.400

-> Status Area in ANTIC4 40bytes wide:

4scanlines_BadLines x (40_screen width + 40_charset + 2_refresh) = 328

28scanlines_more x (40_screen width + 9_refresh) =1.372

-------------------------------------------------------------------------------------= 1.700

________________

TOTAL 16.100

 

 

O.K., there's some mores cycles per scanline needed but around this as a minimum.

In PAL we have 312scanlines x 144cycles_per each scanline = 35.568

So, it is:

35.568

-

16.100

=

19.468 Free to use

 

 

 

Now, if each 'LDA/AND/ORA/STA' normally takes us 21cycles per byte then, in 50f.p.s. and just thinking in soft sprites (no music,...):

19.468 / 21 = (+/-) 927bytes

 

Now, on this picture of Turrican we have:

Our guy more the two Enemys (shoots and explosions apart) 872bytes (including horizontal 1byte more for the shifting).

This is enough, probably shootings and explosions can be done in bytes boundaries/moving.

And if we say that we were talking in 50f.p.s. then doing in 25f.p.s give us 19.468 free that would be enough for Musics and fxs, game's logic, more soft sprites, other stuff,...

Can we think this way?

 

 

 

 

If we can think this way then something maybe possible!...

 

 

 

 

 

 

 

 

 

 

 

 

P.s.- Popmilo how are you doing the PFs changing 'LDA/STA' each scanline?

(Rolling ou un-Rolling code? Like each scanline 3x(LDA/STA) 'un' or a looping (like our in-Basic 'FOR/NEXT'...)

From my study around the Web the Unrolling takes more Memory but less cycles wasting, isn't it?)

post-6517-0-31264300-1349270360_thumb.png

Link to comment
Share on other sites

Amazing!

Now we all also want to see and dream about Turrican, don't we?

Thanks.

 

 

It would be interesting to see how much you could do with this mode on an unexpanded Atari. My animation shortcuts any actual computation by just instantly loading a whole new wired frame every 40ms. Not at all realistic in terms of what the Atari could actually do on its own I'm afraid. But mode 4 tiles should be fast enough to manipulate to get something interesting.

 

How do you get this?

Frame by frame original and Popmilo convert each and then it's something like those A8 movies on YouTube like the APAC Mode or the GTIA9 Matrix?

 

Yep.

 

- VirtualDub to create image sequence and WAV.

- ImageMagick (Cygwin) and Perl to convert images to Antic bitmap data.

- sox (Cygwin) and Perl to convert audio to Pokey volume data.

- xasm to assemble.

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...