Jump to content



Recommended Posts

Yes, I'm at it again!!


But damn it, this time I think I've got it.




I started this just before New Year's, and I'm nearly done with it now. I finally came up with a way to have my image converter create decent-looking screens that flicker between multicolor mode and bitmap mode to increase the apparent number of colors, and tonight I loaded it on hardware to see it work. And it does.


Even nicer, there is room left for sprites. I should have done some as a demonstration. ;) It uses most of VRAM though. Very little CPU though. All you do is set up a vertical interrupt callback (or poll for it), and during the blank you change VDP Registers 0 and 1 to switch between bitmap and multicolor modes.


I don't have a CRT here to test it on, but in theory it should look best there (I have one at my office, though, I may try that just to see...) My two TVs actually responded differently. My big high-def TV didn't flicker at all - it tried to deinterlace the image! The results were not bad, except in some places it decided to draw separate lines rather than blend the colors. My little monitor had noticable flicker, so I used that in the video.


The mechanism turned out to be much simpler than I expected. All I had to do was map the multicolor first to half the image's brightness, and then run my normal dither code on top of that (but taking into account the multicolor contribution). It looks pretty good on most images, not just cartoons, but it's late and this was the image I was testing with tonight. ;)


Because we already know that some flicker values may be unacceptable, I added a slider that lets you control how much flicker is acceptable in the result. The slider may need tuning, and I am not sure the best values. Right now it defaults to 95% and that's mostly there to prevent black+white flicker. ;) As you tune the slider lower, the difference in colors should be less but the image will have fewer options and end up blockier.


There's a new setting for error control. Previously I just added up the error on every pixel, but I noticed that up to three pixels can contribute an error value to a single new pixel. The actual correction for that pixel should be the average of all three of them, not the sum of all three of them. I think. That's the default mode now, but an option lets you go back to the old mode. I'm not certain the new mode is more correct but it IS less noisy.


While I was at it, I completely rewrote the entire dithering engine, throwing out all the experimental code and hacks. As a result, the dithering (for both normal mode and half-multicolor mode) is now much better, with fewer artifacts around the borders and far less bleeding. In addition, all color work is now done internally in floating point to reduce rounding errors. I also fixed a couple of true bugs I found during all this which affected the dithering.


Finally, just for demonstration purposes I've added an MSX image output, and I will probably add a ColecoVision one too. They can already use the files I output, but this just makes it easier for them. For TI we already have the XB example code, after all.


I am not /quite/ ready to publish the converter - almost! But I didn't post entirely to tease. Here's the sample application from the video - I'd love to hear if it works on other people's machines. (DSK and raw OBJ file included. Editor/Assembler #3 file in both cases, plus source code for the viewer and my notes on the VDP layout).




(edit: there is a typo in readme.txt -- the file on WORK.DSK is "DSK1.TIPLAYER", there's no ".OBJ" part on the disk image.)

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

Are you letting the viewer + image data source code out Tursi? I'll try it on my TM990 VDP card connected to a PC TV tuner card, but I'll need to alter the 9918 read/write/status hardware addresses ...


I didn't bother to include the image data in the zip since I didn't expect anyone would want to rebuild this project in particular, but I can add them when i get home from work if you like. The viewer itself IS in the zip though.


I imagine a TV Tuner card would provide interesting results, depending on how it handles the alternate frames. I need to take a picture of what my big TV does, I was pretty surprised at how it deinterlaced it.


Either way, I expect to release the new version of Convert9918 tonight.

Link to comment
Share on other sites

Nice conversion!


I put up the new version, but I'm way too sleepy to get any new demos up. So I'll just let you have a play with it directly. Here's the actual changelist:


-Rewrote dither engine - many previous issues solved

-Updated to new compiler

-Added half-multicolor mode that works this time!

-Added configuration of error accumulation

-Added configuration of perceptual ratios

-Supports MSX output


I need to get some more samples up. Sleepy though. :)




One thing I did note is that after fixing some of the rounding errors, blue gets selected in dark areas a lot more. I think the default perceptual ratio of 11% for blue may be too low now, but that's why it's adjustable, so we can look for better defaults. Also, with all the configuration options I mean to get saving the config in there, but it's not yet.

Edited by Tursi
Link to comment
Share on other sites

  • 3 weeks later...

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.

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.

  • Recently Browsing   0 members

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