-
Color resolution beyond 160x200?
12/20/2023 at 17:39 • 0 commentsIt was bothering me from the beginning that effective color resolution of composite NTSC colors is only 160x200 - such a downgrade from original monochrome 640x200, but then I started thinking that may be if image is having black-and-white/grayscale parts then resolution may look better? A year ago I wrote this program to show pixlel-level transitions between colors and blacks/whites/grays:
https://gitlab.com/shaos/xorlib/-/blob/master/examples/colodiag.c
It produces this pattern on NTSC TV:
Then I thought why I should flash every experiment into PIC32 if I can write "composite simulator" that imitate NTSC decoding and I did it in January 2023:
https://gitlab.com/shaos/xorlib/-/blob/master/tools/compositesim.c
By default this program produce color bars:
And we can shift phase too (90 degrees to imitate palette #1, 180 degrees - palette #2 and 270 degrees - pallette #3). Also it is possible to produce image from arbitrary XBM file like this one:
Then I put diagonal color pattern in it:
That looks very similar to what TV showed above. Then I looked at borders between colors:
As you can see smoothness is not always 160 pixels per line - sometimes it may look like 320 (yellow highlights) or even 640 (green highlights - it's only on borders between white and black). Actually it's easy to summarize this way:
- black (0000) and white (1111) may connect with 640-pixel precision;
- grays (0101 and 1010) are connecting with white or black with 320-pixel precision;
- colors with codes 0111, 1011, 1101 and 1110 (3 ones and 1 zero) may connect with black with 320-pixel precision;
- colors with codes 0001, 0010, 0100 and 1000 (3 zeros and 1 one) may connect with white with 320-pixel precision;
- all other connections are having 160-pixel precision.Having this knowledge allows me to create color images for Xorya that look better than 160x200 because of more precise grayscale parts in it :)
Time to code some games? ;)
-
640x400 black-and-white
12/10/2023 at 05:08 • 0 commentsXorya is capable of showing 640x400 black-and-white images by constantly switching half-frames 640x200 every frame to make "fake" interlaced video and some NTSC TVs will "stitch" those half-frames to full frame thinking it's truly interlaced video - some examples:
The only problem with fake interlaced screen - sometimes TVs may be confused and switch odd and even lines:
To resolve it just re-connect the cable once or twice and it will stay in sync until reset.
And some TVs will just constantly blink (usually cheap ones).
Source code of the program:
https://gitlab.com/shaos/xorlib/-/blob/master/examples/xbmdraw.c
Use GIGA define to show 400-line XBM images ( it's a reference to ZX-Spectrum world where this technique was called "gigascreen" ; )
By default this example shows schematics of color Xorya in 640x200 without GIGA :)
-
Xorya on RISC-V?
01/20/2019 at 16:54 • 1 commentRecently I made a lot of activities around RISC-V open architecture and even created my own RV32I implementation that passed majority of compliance tests (except 1 about unaligned jumps) - see nedoPC-5 project . So then I've got an idea - what if I put Xorya framebuffer (with control logic) to the same FPGA with RISC-V core? Then I'll be able to load Xorya programs from external storage (as SD-card for example), add serial, ethernet etc. Porting XORLib to this new system should be relatively easy task because it's written in C (only some Microchip specific things as SPI+DMA handling should be re-written). What do you think? Please leave a comment below...
-
Possible extension of Xorya to true CGA
11/09/2018 at 06:10 • 0 commentsIn October 2016 I tested (but didn't share here) a simple circuit that used not only SPI data output as orignial Xorya, but also SPI sync, and consisted of one 74F00 and two 74F74s that (with help of NTSC color generator chip AD725) may allow us to get "true" CGA 4-color 320x200 mode with the same PIC32 and slightly extended XORLib (so it might be the next generation PIC32 video console Xorya-II capable of running some classic CGA games from PC):
Problem is I didn't capture actual schematics at that time and now I don't remember how exactly it worked...
-
Screenshots
01/25/2017 at 05:49 • 0 commentsJust a few screenshots as an example of what Xorya can do on NTSC TV with 15 colors (original images were taken from Internet under "fair use"):
and some images taken from old PC games:
-
Prototype Xorya-I
11/12/2016 at 01:35 • 1 commentThis is a prototype of the actual Xorya game console as it will look (codenamed "Xorya-I"):
As you can see it is "Direct-to-TV" kind of gamepad with 2 buttons on the right (green and red) and analog joystick on the left (currently it's 2-axis joystick from Parallax that costs more than $5). With composite video cable you can see cables for stereo sound (generated by 2 PWM). Later I'll add 2xAAA case on the back and power switch (it's not needed yet while I use PICKit3 to play with it).
Interesting thing is the fact that PIC32 chip is actually a cartridge with the game ;) In order to simplify process of inserting and removing of such game I put there a ZIF-socket (cost about $10). So the big idea is to present Xorya as an open source indie game platform with dedicated online store that will sell actual physical retro looking games for it (in form of preprogrammed PIC32 chips) both open source and proprietary with prices $5 and up.
Calculating everything (including future PCB of that size) I got possible retail price for the product (if I finally make it) - $29.95 (1 console plus 1 chip with "free" game). Thoughts?...
-
Xorya Superdemo
11/08/2016 at 17:00 • 9 commentsFor people who didn't notice my little demo on Hackaday Superconference during last weekend - this is 5-minute video:
Source code of the demo: https://gitlab.com/shaos/xorlib/blob/master/examples/demo2016.c
This is a collection of some XORLib examples that I created since April 2015 plus couple new pieces of code combined into a single C-file (also 2 additional data files are required and of course XORLib - everything is there on GitLab). Enjoy ;)
UPDATE: Prebuilt binary in HEX form is available on GitLab:https://gitlab.com/shaos/xorlib/tree/master/builds/demo2016-PIC32MX170F256B-O1
-
PCB as a gift
10/13/2016 at 02:42 • 7 commentsI forgot to mention that some time ago I received a few PCBs of Xorya prototype with composite connectors as a gift from @arnaud.durand
Thank you, Arnaud! :)
P.S. I can give away few pre-built Xoryas with hotglued batteries and pre-installed "fast" Mandelbrot Set demo on Superconference in Pasadena, if anybody is interested :)
-
Latest update
03/08/2016 at 23:15 • 0 commentsHi All, I'm still here :)
Recently I'm successfully tried to connect Xorya prototype to cheapest available color NTSC TV (from ebay) and it was working pretty well:
Last year I put this project into pause mode mostly because I stuck a little because I was not able to decide where to develop this project further - I have 3 choices:
- put it into NES gamepad and program support for NES and SNES serial gamepad protocols;
- design board around DIP version of PIC32 in form of gamepad with buttons - 4 buttons on the left for direction moves and 4 buttons on the right for actions;
- design board around DIP version of PIC32 in form of gamepad with analog joystick on the left and action buttons on the right...
-
Color Combinations
05/15/2015 at 23:36 • 2 commentsExperiment with color combination with chess board mixing:
This is simulation in DOSBox on PC:PIC32 on NTSC TV - palette 0:
PIC32 on NTSC TV - palette 1:
PIC32 on NTSC TV - palette 2:
PIC32 on NTSC TV - palette 3:
Source code: https://gitlab.com/shaos/xorlib/blob/master/examples/color120.c