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

  Рет қаралды 2,081

Scrap Computing

Scrap Computing

7 күн бұрын

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/scrapcomputing/MCE...
MCE Blaster part 1: • MCE Blaster: Pi Pico b...
@The8BitGuy How CRTs Work: • How Cathode Ray Tubes ...
en.wikipedia.org/wiki/Enhance...
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 spacequesthistorian.bandcamp.com
Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) creativecommons.org/licenses/...

Пікірлер: 49
@pelculator
@pelculator 5 күн бұрын
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 5 күн бұрын
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.
@GadgetUK164
@GadgetUK164 5 күн бұрын
Just brillliant! Keep doing what you do =D
@llamallarry
@llamallarry 5 күн бұрын
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 5 күн бұрын
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 5 күн бұрын
Please make a video only about the sw!
@scrap_computing
@scrap_computing 5 күн бұрын
@@alexloktionoff6833 I will try to add details in the README, because things will change as the firmware matures.
@llamallarry
@llamallarry 5 күн бұрын
Impressive! Love it ❤❤❤
@ghosthuntergr
@ghosthuntergr 5 күн бұрын
Yes a through hole would be nice for us that we dont see so well any more
@darthtripedacus1
@darthtripedacus1 5 күн бұрын
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
@ajdothack
@ajdothack 5 күн бұрын
Great project, Imagine this on a AMIGA or ARCADE BOARDS!
@lindoran
@lindoran 5 күн бұрын
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?
@nednettapp
@nednettapp 5 күн бұрын
Nice job!
@chironpictures
@chironpictures 5 күн бұрын
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 5 күн бұрын
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 5 күн бұрын
@@scrap_computingRP pico inputs are 5v tolerant in practice, just you need to guarantee you will never setup them as outputs even temporary
@alisontelford9339
@alisontelford9339 5 күн бұрын
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
@SanguineBrah
@SanguineBrah 5 күн бұрын
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 5 күн бұрын
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 5 күн бұрын
@@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 5 күн бұрын
@@SanguineBrah It should fit fine. The only component that is close is the IC, but I think there is enough clearance.
@koztech
@koztech 5 күн бұрын
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 5 күн бұрын
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.
@detalite
@detalite 5 күн бұрын
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.
@kokodin5895
@kokodin5895 5 күн бұрын
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 5 күн бұрын
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 5 күн бұрын
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 5 күн бұрын
(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 5 күн бұрын
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 5 күн бұрын
​@@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.
@Chriva
@Chriva 5 күн бұрын
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 5 күн бұрын
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!
@Lilithe
@Lilithe 5 күн бұрын
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 5 күн бұрын
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 5 күн бұрын
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.
@llamallarry
@llamallarry 5 күн бұрын
(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 5 күн бұрын
(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 5 күн бұрын
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 5 күн бұрын
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 5 күн бұрын
@@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 5 күн бұрын
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.
@manitoba-op4jx
@manitoba-op4jx 4 күн бұрын
i wish there was a way to go the other way, i want to connect my modern PC to my tandy 1000 cga monitor
@scrap_computing
@scrap_computing 4 күн бұрын
That's quite interesting, though it's a bit more tricky for a couple of reasons: (i) The ADCs on the Pico are not fast enough for VGA, so you would need an external ADC chip, like the TVP7002. (ii) Then you would have to reduce the color bits a bit because you would run out of GPIOs on the Pico. But other than that it shouldn't need too many changes on the firmware side.
@alexloktionoff6833
@alexloktionoff6833 5 күн бұрын
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 5 күн бұрын
Just in case BreakOut game from Poland can use native HGC resolution
@scrap_computing
@scrap_computing 5 күн бұрын
I was not aware of this, thanks for sharing. I will try out some genuine HGC games.
@scrap_computing
@scrap_computing 5 күн бұрын
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 5 күн бұрын
@@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 5 күн бұрын
@@alexloktionoff6833 Ah, makes sense, thanks for clarifying. So there is no point in trying to fix how these games look with firmware tricks.
The Real Winamp Player - This Week In Retro 175
1:11:13
This Week in Retro
Рет қаралды 9 М.
DIY 16MB 30-Pin FPM SIMMs: Supercharge Your Vintage Hardware!
21:54
Bits und Bolts
Рет қаралды 29 М.
Always be more smart #shorts
00:32
Jin and Hattie
Рет қаралды 43 МЛН
Василиса наняла личного массажиста 😂 #shorts
00:22
Денис Кукояка
Рет қаралды 10 МЛН
MCE Blaster: Pi Pico based MDA/CGA/EGA to VGA adapter (Part 1)
12:46
Scrap Computing
Рет қаралды 3,5 М.
Installing OS/2 on a PS/2 Model 80: 5000 Subscriber Special
34:30
Repairing and Testing the #Sega TeraDrive | Trash to Treasure PT2
29:31
RISC-V NAS: BPI-F3 & OpenMediaVault
19:35
ExplainingComputers
Рет қаралды 42 М.
The CARD that CRUSHED Nvidia - ATI's Radeon 9700 Pro
24:24
Budget-Builds Official
Рет қаралды 38 М.
I 3D Printed a $1,224 Chair
23:56
Morley Kert
Рет қаралды 20 М.
I Bought the HEAVIEST Computer on eBay: The PDP-11/34!
27:52
Dave's Garage
Рет қаралды 143 М.
В России ускорили интернет в 1000 раз
0:18
Короче, новости
Рет қаралды 1,3 МЛН
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 4,9 МЛН
Main filter..
0:15
CikoYt
Рет қаралды 14 МЛН