Тёмный

MCE Blaster MDA,CGA,EGA to VGA Adapter Released! (Part 2) 

Scrap Computing
Подписаться 2,8 тыс.
Просмотров 2,5 тыс.
50% 1

This video dives into some of the technical challenges of building an MCE adapter using the Pi Pico.
It goes over sampling of the input pixels, and how it relates to the card's pixel clock.
Finally it shows the MCE Blaster working with several games (Prehistorik, Prince of Persia and Quest for Glory) on a couple of ISA video cards.
Project Page: github.com/scr...
MCE Blaster part 1: • MCE Blaster: Pi Pico b...
@The8BitGuy How CRTs Work: • How Cathode Ray Tubes ...
en.wikipedia.o...
Music:
- Simulation Terminated from Quest V Reorchestrated and Remixed
- Academy Hallways from Quest V Reorchestrated and Remixed
- Battle Cruiser from Quest V Reorchestrated and Remixed
- Stalker from Duke Duke Dance Party
by the Space Quest Historian, Troels Pleimert spacequesthist...
Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) creativecommon...

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 67   
@pelculator
@pelculator 3 месяца назад
I love this project! I wish my eyesight would allow me to solder SMD. A through hole version would be very welcome.
@scrap_computing
@scrap_computing 3 месяца назад
Yeah I will give it a try. My only concern is the IC, not sure there is an equivalent through-hole part, but there should be some compatible alternatives.
@chironbramberger
@chironbramberger 3 месяца назад
This is amazing! Thank you so much for making and sharing this! I will be making one for sure! One question: are you sure the 74LS245 is the right part? It looks like you're powering it with 3.3v but then you have 5v inputs and I don't know if that's how it's supposed to work. I know there is a part that designed to go from 3.3v to 5v the way you want to... yeah I think the SN74LVC245AN is what you're looking for. It should be a drop-in replacement but it's designed to be powered with 3.3v and takes TTL/CMOS as input and outputs LVTTL. I think it comes in a version that has the same SMD footprint. But I'll hopefully get a chance to make one soon either way! Thanks again!
@scrap_computing
@scrap_computing 3 месяца назад
Oops good catch! I am indeed using the 74LVC245, but I couldn't find the right entry for it on kicad, so I used the LS part instead. I will update the BOM.
@alexloktionoff6833
@alexloktionoff6833 3 месяца назад
@@scrap_computingRP pico inputs are 5v tolerant in practice, just you need to guarantee you will never setup them as outputs even temporary
@GadgetUK164
@GadgetUK164 3 месяца назад
Just brillliant! Keep doing what you do =D
@ghosthuntergr
@ghosthuntergr 3 месяца назад
Yes a through hole would be nice for us that we dont see so well any more
@SanguineBrah
@SanguineBrah 3 месяца назад
It is possible to use a female DE9 connector on the reverse side of the board with the current design and use a cable instead of plugging in directly? I currently have my Necroware MCE adaptor mounted to a serial port bracket inside my machine with a tiny IDC ribbon passthrough from my CGA card on the outside. It is quite an elegant solution.
@scrap_computing
@scrap_computing 3 месяца назад
I think they have the same pinout so you could use a female connector too. But I think the cable has to be quite short otherwise the signal does not get picked up properly.
@SanguineBrah
@SanguineBrah 3 месяца назад
@@scrap_computing Usually the pins are reversed left-to-right between the male and female connectors, which is why I mention maybe soldering it on the other side of the PCB, if there is clearance and the pins line up.
@scrap_computing
@scrap_computing 3 месяца назад
@@SanguineBrah It should fit fine. The only component that is close is the IC, but I think there is enough clearance.
@llamallarry
@llamallarry 3 месяца назад
Impressive! Love it ❤❤❤
@llamallarry
@llamallarry 3 месяца назад
The code is really clean and clear! It shows how much work and thought have gone into this, supporting all the different modes. Bravo! Thanks for sharing :)
@scrap_computing
@scrap_computing 3 месяца назад
Thanks! It could have been a lot nicer if the Pico had slightly faster main cores. For example the brown color fix is currently handled in the VGA PIo because the main core isn't fast enough to handle an additional if (Color == Dark Yellow) { Color = Brown: }.
@alexloktionoff6833
@alexloktionoff6833 3 месяца назад
Please make a video only about the sw!
@scrap_computing
@scrap_computing 3 месяца назад
@@alexloktionoff6833 I will try to add details in the README, because things will change as the firmware matures.
@cassielam2868
@cassielam2868 Месяц назад
​@@scrap_computing would Pi Pico 2 get it closer ?
@darthtripedacus1
@darthtripedacus1 3 месяца назад
This is a little outside what I would ever do but I am still impressed at the work you did on it. Good job sir
@nednettapp
@nednettapp 3 месяца назад
Nice job!
@AlphaCharlieFour
@AlphaCharlieFour 9 дней назад
I have an old ifr fm/am 1600s communication service monitor. It has a 9 pin ega video port. Do you think this would work for that?
@scrap_computing
@scrap_computing 8 дней назад
It supports EGA, so yeah it should work.
@koztech
@koztech 3 месяца назад
Love it! This got me thinking. Since MDA/CGA/EGA and other TTL signals are digital, what would it take to get them to directly output to "modern" digital displays using "modern" inputs (DVI-D, HDMI, DP)? Right now you would need to convert TTL to analog (using this or similar adapters), then connect that to something like an OSSC, GBS Control, etc., which converts the analog signal back to digital (plus upscaling). Basically, you're going from digital, to analog, back to digital again. So the adapter I am referring to would cut out the "middle man" and just have digital to digital. Mind you, not an engineer by any stretch of the imagination and I might not be explaining it correctly.
@scrap_computing
@scrap_computing 3 месяца назад
It should be possible to output a more modern digital video signal straight from the Pico. DVI or DP should be possible, I have not looked into them in detail. The biggest challenge is the TTL sampling part, but once this is taken care of I think making a variant that can output a digital signal is the next step.
@Lilithe
@Lilithe 3 месяца назад
Maybe Hercules should be line-doubled, even if it was not line doubled initially. It would probably fix the aspect ratio problem somewhat...
@scrap_computing
@scrap_computing 3 месяца назад
Yes, line-doubling should do it. CGA is already doing the line-doubling so it should work fine on Hercules too.
@scrap_computing
@scrap_computing 3 месяца назад
Actually, it is these specific games that look stretched in Hercules mode, because they don't actually support proper Hercules mode. Instead they will produce this stretched image, and they expect the user to fix the aspect ratio on the CRT monitor (see @alexloktionoff6833 's comments). Hercules mode text actually looks fine.
@ajdothack
@ajdothack 3 месяца назад
Great project, Imagine this on a AMIGA or ARCADE BOARDS!
@detalite
@detalite 3 месяца назад
Those vertical stripes. I had the same issue in my old UXGA LCD with VGA signal. I tried to change pixel clock in menu but it didn't worked as i hoped.
@alisontelford9339
@alisontelford9339 3 месяца назад
This is such good work, congratulations! Looks like a a great low-cost option for using these cards. I guess another pcb order is in my near future :) Kudos
@lindoran
@lindoran 3 месяца назад
Prince of Persia - we had a CGA card which had the two modes swapped. I remember it that way always 😅 and I eventually found out it was not but it was definitely in the late 90s as we didn't have Internet in the house till then. I wonder if anyone else has memories like that?
@alexloktionoff6833
@alexloktionoff6833 3 месяца назад
Prehistoric and PrinceOfPersia do not use original HGC modes, but tweak card to more like EGA timings. Can you show original HGC text and 720x348 graphics mode?
@alexloktionoff6833
@alexloktionoff6833 3 месяца назад
Just in case BreakOut game from Poland can use native HGC resolution
@scrap_computing
@scrap_computing 3 месяца назад
I was not aware of this, thanks for sharing. I will try out some genuine HGC games.
@scrap_computing
@scrap_computing 3 месяца назад
Could this be why the image in these games looks so stretched? Monochrome text looks fine, but the games themselves look like they need line-doubling.
@alexloktionoff6833
@alexloktionoff6833 3 месяца назад
@@scrap_computing exactly, this is tweaking HGC to ease and kinda share graphics routines and bitmaps. They make hgc output 80 bytes per row and 200 lines, users had to use hor/vert knobs of monitor to stretch video full screen.
@scrap_computing
@scrap_computing 3 месяца назад
@@alexloktionoff6833 Ah, makes sense, thanks for clarifying. So there is no point in trying to fix how these games look with firmware tricks.
@VidaDigital
@VidaDigital Месяц назад
Great project! Is there any way to purchase this already made?
@scrap_computing
@scrap_computing Месяц назад
Sorry, I am not planning on selling them. But they are not particularly hard to put together, especially the through-hole version.
@VidaDigital
@VidaDigital Месяц назад
@@scrap_computing agreed! So what would the optimal parameters to get the boards made (or even assembled) by pcbway be?
@scrap_computing
@scrap_computing Месяц назад
@@VidaDigital the boards don't require any special parameters, they are very standard 2-layer boards. Just upload the gerber files and should be good to go.
@VidaDigital
@VidaDigital 17 дней назад
@@scrap_computingso I’ve sourced 5 pcbs from PCBWAY but I’m still missing the 74LVC245. Is the 74LS245 or 74HC245 acceptable?
@scrap_computing
@scrap_computing 17 дней назад
@@VidaDigital I don't think they will work but if they are pin-compatible you could try, they might work with your card. You do need a 74LVC245 which by the way is widely available and rather affordable.
@Chriva
@Chriva 3 месяца назад
Think it would be possible to autodetect Hfreq through a counter in another state machine? Could see it require manual intervention on the cpu side due to varying pio frequency tho.
@scrap_computing
@scrap_computing 3 месяца назад
There may be a way, but I think it won't be very easy because the pixel clock frequency is quite comparable to the state machine frequency. So you may need multiple state machines running at different frequencies etc. But yeah, that would be really cool!
@cassielam2868
@cassielam2868 Месяц назад
Great work, will Pi Pico 2 work ?
@scrap_computing
@scrap_computing Месяц назад
The Pico 2 will make it even better!
@cassielam2868
@cassielam2868 Месяц назад
@@scrap_computing Thank you for response. Will the code need to be changed ?
@scrap_computing
@scrap_computing Месяц назад
@@cassielam2868 Probably not, but I would have to get one to check.
@QuangNguyen-r9i
@QuangNguyen-r9i Месяц назад
Which software you use to program this project?
@scrap_computing
@scrap_computing 24 дня назад
I am using the Pico's c/c++ sdk
@QuangNguyen-r9i
@QuangNguyen-r9i 9 дней назад
Can you add 640x435 @50Hz 23.9khz R,G,B,H,V TTL signal input?
@scrap_computing
@scrap_computing 8 дней назад
@@QuangNguyen-r9i It might be possible. What mode is this, is it EGA extension?
@QuangNguyen-r9i
@QuangNguyen-r9i 8 дней назад
@@scrap_computing This signal output from CNC controller, pixel clock 20.445Mhz
@scrap_computing
@scrap_computing 6 дней назад
@@QuangNguyen-r9i Ah I just realized that the resolution is too high, it won't fit in the Pico's memory. Also the pixel clock is probably too fast for the Pico. I am planning to create a new version of this project using the new Pico 2, which has more memory and is a bit faster. Once I get it working I may experiment with more exotic EGA modes if I find a card that can generate them.
@llamallarry
@llamallarry 3 месяца назад
(edited) Sharing an idea - to increase the amount of cards that can have "perfect image" displayed, could the set_sys_clock_khz() in the pico C sdk be used to set a clock that allows the target pixel clocks numbers to be reached more accurately? In particular the case where some sampling artifacts remain. One way of reaching additional values for pixel clock is to vary the PI pico clock speed, I believe. A crude way is to add two buttons for "fine adjustment", that increase/decrease the pico clock by 1 Mhz. Another way is to overclock the pico so that one NOP is a finer grained unit, I believe, e.g. from 270 to 290.4 MHz. A third option is setting the PICO_FREQ (referencing its name in the code) to a value that numerically allows, in combination with the clock divider feature used, to reach certain desired values in pixel clock with minimal error. I'm thinking of minimizing the sum of squared error over some common target pixel clock values. This would likely allow you to sample more accurately.
@scrap_computing
@scrap_computing 3 месяца назад
Yes, adjusting the Pico's clock should remove the artifacts if you can't get rid of them any other way. I could add a button combination that allows you to tune that too.
@llamallarry
@llamallarry 3 месяца назад
​@@scrap_computing The pico supports some frequencies that are close to integer multiples of the EGA pixel clock. In particular 260.0 is 0.112 off and 178.8 is just 0.027. Perhaps the 260.0 one is fast enough for this software and will allow improving the sampling. In other word using DPICO_FREQ=260000 in the cmake command.
@kokodin5895
@kokodin5895 3 месяца назад
the only thing i would add would be buffering for hercules and redrawing the image either in interlaced or progressive mode each line twice if you have spare cpu cycles to recognize hercules that could also remove artigacting completly because you could draw the screen at intiger dividable clocks but if the microcontroller board can't handle buffering the signal and drawing it back in real time then i guess we stuck at widescreen mode :]
@scrap_computing
@scrap_computing 3 месяца назад
Yeah I think line-doubling should fix the issue. It's already doing this in CGA mode, so it should work fine.
@scrap_computing
@scrap_computing 3 месяца назад
Actually, it is these specific games that look strange in Hercules mode, because they don't actually support proper Hercules mode. Instead they will produce this stretched image, and they expect the user to fix the aspect ratio on the CRT monitor (see @alexloktionoff6833 's comments). Hercules mode text actually looks all right.
@llamallarry
@llamallarry 3 месяца назад
(edited) Autotuning - Perhaps a search in software for the card's physical pixel clock is possible by searching a range and measuring the statistical variance of the pixels in the output image. The frequency with the lowest pixel variance is then the optimal one. The underlying assumption is that the lowest variance corresponds to the least noise in the image. This requires a still image to be displayed during themeasurement. In this method each pixel's numeric value is read. The different RGB channels can have their variance calculated separately, and then added up. This final sum is the value to minimize across the different clock values.
@llamallarry
@llamallarry 3 месяца назад
(edited) Although I believe the above works in theory, it does require pixel values to be available, which they don't appear to be due to the nature of VGA? It's not clear to me if something similar would be possible with the VGA line logic. Perhaps a Running Variance can be computed across all lines for a couple of frames (8 perhaps), and that value is then minimized over the different pixel clock values. More specifically, could the value of X in pio_sm_put_blocking(VGAPio, VGASM, X) be used to compute the Running Variance? A rough pseudo code can be: display an image, set a candidate pixel clock, for some short time (say 250ms), compute the Running Variance in the line writing logic and store it. After the variance is stored for all candidates, choose the candidate with lowest numerical value for the Running Variance as the optimal candidate. A potential speedup is to use a binary search. An additional speedup is to first use large steps and after some iterations with the binary search use small steps.
@scrap_computing
@scrap_computing 3 месяца назад
The issue is that the fastest detection loop in a PIO takes 2 instructions, one `jmp pin` and one `jmp x--`, this is already 7.2ns. So if we try to measure the time a pixel is found "ON" our measurement will be a multiple of 7.2ns. But what we need is a resolution of about 0.001ns.
@scrap_computing
@scrap_computing 3 месяца назад
I am not sure I fully understand what you are describing. The pixel clock detection is for the TTL side, not the VGA side. On the VGA side we just generate the expected VGA pixel clock and we are done.
@llamallarry
@llamallarry 3 месяца назад
@@scrap_computing Oh, I didn't take that into account. In those terms it would be like we set a candidate clock for the TTL side then measure on the VGA side how good it is, and not necessarily output any VGA signal while measuring. The TTL side then runs at normal speed and the VGA side is not doing significantly more than before, just aggregating some numbers. It would sort of be replacing the VGA side with a "instrumentation side"while determining the best candidate clock. Possibly a "please wait" banner or so could be displayed while this logic runs.
@scrap_computing
@scrap_computing 3 месяца назад
Ah OK I think I got it now. But how would you reliably measure how good the pixels "look"? The adapter can't tell if the noise is coming from bad sampling or from the actual input. Anyway, adjusting the pixel clock is not such a big deal. As long as you don't constantly swap cards you would only need to adjust it once per mode.
Далее
Converting MDA/CGA/EGA Graphics Output to VGA!
8:52
Просмотров 192 тыс.
Лучше одной, чем с такими
00:54
Просмотров 438 тыс.
GDvi: Simplified HDMI for the Pico
15:00
Просмотров 2,2 тыс.
Amiga to VGA | GBS-8220 Review (CGA/EGA/YUV to VGA)
12:02
Acorn Archimedes A3010: Was It Better Than The Amiga?
21:57
Meet the Amstrad 6128 | Trash to Treasure Pt1
16:07
Просмотров 54 тыс.
Repairing a butchered ASUS P5A Part 2.
12:37
Просмотров 1,4 тыс.