-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lisa to VGA #3
Comments
OK it sounds like there are quite a few things going on. When you say you have several smashed rows at the top of the display, is that an issue with reading the Lisa video or generating VGA signal? During development I decoupled the VGA output and had the Pico grab single frames then output the captured data over USB so that I could figure out exactly what was being read. I did indeed have a lot of smashed lines, things particularly often looked like a vertically squished picture that was at a weird angle. If dumping over USB to work on the capture's not feasible I'd recommend going straight for generating an 800x600@60 Hz SVGA resolution, modifying the VGA timings for vga_timing_800x600_60_default according to http://tinyvga.com/vga-timing/800x600@60Hz which gives timings for a 40 MHz pixel clock. The Lisa's 20 MHz pixel clock and 40 MHz for SVGA are really convenient, and I think I'd aim for a 200 MHz system clock, with PIO dividers of 2 and 5 respectively. Faster is better here as it gives a lot more flexibility for things like centering the video signal. It sounds like this is more or less what you've done. You can then check VGA is working correctly by generating some dummy data in
For getting pixel capture working, I think The alignment of the pixel clock and nop instructions was a bit of trial and error. Part of the magic occurs during the I think the waiting for sync issues and the videoinput PIO clock divider are probably what's messing things up the most right now. |
Dang - I'm really curious how you managed to snag Mac image data over USB! That sounds incredibly useful! As for the squashed image, here's what it looks like. Here's what I've got for the VGA settings when drawing from TinyVGA:
I'll reset the clock to 200e6 and SE_CLOCK_DIV to 2, but I'm a bit confused as to where the VGA divider is. I'm assuming it's implicitly stated by virtue of the .clock_freq declaration in the timing const in vga.h, given your comment in mac.c:
When I'm home again this evening I'll give the dummy data generator a go to test out whether signal generation on my end is good (prediction: it's not, lol). MAX_LINES I had set to 364, but I've bumped the LINEBUFFER_LEN_32 up from 23 to 25 as per your recommendation; LINE_OFFEST has also beet adjusted to 14. I've gone ahead and commented 70-80 in the PIO program and flipped the HSYNC values. Let me know if anything looks amiss:
I'm glad to know that the amount of trial and error here is somewhat generous - this is all fairly new territory for me and a lot of what I've been doing to test beyond the obvious is very much just that. Your logic about the clock divider and catching data mid-pulse makes sense to me. I'll recompile and try again this evening and let you know my findings. PS - Before I started making changes, I compiled your original code and flashed it to my Pico. With my Lisa hooked up to it, it DID display an image, though an understandably horribly shrunk and garbled one due to timing misconfigurations. You could, however, make out shapes on the Lisa's boot menu; not terribly helpful overall, but I was surprised I could get anything out of it with the stock 1024x768 settings! |
USB output was pretty bare bones. I disabled the interrupt so that only one frame of data was captured, then using the default basic Pico USB serial output stuff looped through Your squashed picture is pretty encouraging, especially if there wasn't too much flicker! I saw a lot of similar output during development and it was always down to the input PIO timing. The VGA timing struct looks correct. The VGA clock divider is set by the VGA library in scanvideo.c, calculating it from the system clock and the VGA I think the pio program might needs a couple more tweaks, which are mostly my fault due to not remember how it worked correctly this morning... Ahead of the After the The pio program is told how many pixels across to read in
but I would recommend testing everything without this last change first as it will I think be really fiddly debugging this in combination with the rest of the timings stuff. I'm not 100% certain the Again, really great that you could see something resembling reality. Those glimpses of output really gave me hope while putting this together - I think at one point I even would up with a giant mouse cursor, which gave me a good laugh! |
Hello! Minor update - I have not had a chance to sit back down and take a look at this in several days, but I had a sudden and horrible realization earlier today as to why I was achieving absolutely zero forward progress on this. So, I actually have two Lisas, a Lisa 2/5 and a 2/5 that was upgraded to a MacXL. I've been working on this by way of my XL which (in case you were not aware of the difference between a 2/5 and XL) has a special width coil attached to the CRT yoke and a different video state machine than a standard Lisa; this was done to provide a more "Mac-shaped" display for users running MacWorks (the Lisa's Macintosh compatibility layer) that would look less distorted on the Lisa's CRT. The original Lisa uses the display timings and resolution we've talked about previously (720x364); the XL with it's screen mod, however, outputs 608x432 using timings I can't appear to find documented anywhere. I cannot believe none of this occurred to me until now, lol. All that having been said, I plan on switching to my 2/5 later this week when I have a moment and restarting my efforts from there. I'll probably hook my scope up to the XL and see what the timings look like afterwards. Either way, my optimism has been slightly restored in light of all this! |
Hello!
I've been playing around for a bit with your code to interface with a Lisa and have run into some issues. Full disclosure - video timing is not my strong suit; I have some experience working with 240p analogue RGB as it pertains to arcade displays, but this is much faster than I'm used to dealing with (and even then, it's been years since I've worked with standard res RGB video).
The Lisa outputs a 720x364 image with the following properties (see attached image):
I've been working on trying to get this to display on an 800x600x60 display to no avail; the end goal would be to have this centered both vertically (not the hardest thing to do) and horizontally (much harder - still trying to think this one through). Presently, all I've managed to get on-screen is a flickering, smashed several rows at the top of the display. I've set the system clock to 160MHz (nice and even divisibility down to the 40MHz the VGA clock runs at and 20MHz the Lisa one runs at) and am dividing by eight for the Lisa's clock. I've also updated the MAX_LINES directive to the Lisa's 364, updated the LINEBUFFER_LEN_32 directive from 16 to 23 (to just go over the Lisa's 720 dots per line - 22.5 was the exact divisor), and updated the VGA timings in vga.h using the referenced timings in the Pico SDK, but I'm a bit stuck on how to proceed at the moment. Might you be able to offer some advice on where to start in next?
Edit: Ah, I see something else that's going to need modifying. Your assembly in videoinput.pio - it appears you're skipping lines for the horizontal retrace period in the pixelskiploop loop; maybe it's just because it's late, but I'm a bit confused as to how the timing on this works. It looks like the H-retrace on a compact Mac is ~164 pixels, which appears to be the number of pixels this skips (nop[29]*31 = 155, that plus the nine additional pixels comes out to 164), but how does the timing of the pixel clock line up with the nop instruction time? That just seems like... really awesome coincidence?
The text was updated successfully, but these errors were encountered: