alex

Oric Atmos on Pipistrello

14 posts in this topic

Following in the trails of ZX Spectrum on Pipistrello I present you with... Oric Atmos on Pipistrello.

The Atmos is dear to my heart as it is my first personal computer I used when I was young. While all my friends were playing games on their Spectrums and Commodores I was bucking the trend spending countless hours with my Oric, my soldering iron and my Oric bible, the "Oric Advanced User Guide" writing 6502 machine code (back in those days we didn't have assemblers and compilers :) )

The only reason this is "for the Pipistrello" is because the Papilio Pro is one RAMB block short of being able to fit the design. The Oric Atmos 48K as the name implies has 48KB RAM and 16KB ROM. Technically the Oric has 64KB RAM but the top 16KB are hidden underneath the ROM and not normally accessible. As such this design does not implement that RAM to save resources, but could be easily added. So total RAM+ROM is 64KB equals 32 RAMB resources plus one more for the scan doubler. Drat! foiled again, it is that one extra RAMB that won't fit in the Papilio

I have uploaded the source code for you to play with it. It is based on the sources I got from here OricInFPGA_V091 Initially I had hopes that I could just synthesize and go but alas, to my surprise these sources are non functional. Initially I got no signs of life at all, and well over 400 warnings when compiling. At first I attempted to elliminate the gated clocks in the design, of which there were plenty. After doing that it sprung into life, kind of. I could make sounds by typing the familiar ZAP and EXPLODE commands but the picture was majorly corrupted. The characters appeared to be the alternate character set (a sort of Teletext character set) instead of the normal ASCII, the cursor seemed to blink the entire left hand column instead of just the square it occupied, the color attributes did not line up with the character spaces, etc.

After a large number of hours simulating and fixing issues I got it down to 38 warnings and only one gated clock. I ended up doing a major rewrite of the ULA (the main controller chip in the Oric) to the point it is now working as expected from the quick tests I did in LORES and HIRES. More testing remains to be done but this is a good start, have at it.

Share this post


Link to post
Share on other sites

Hi, after getting the Spectrum implementation running on my new Pipistrello (arrived today), I tried the Oric one too, but so far didn't seem to work, or at least my monitor thinks no signal whereas it sees one with the Spectrum and the various bouncing ball etc bitfiles..  Is there any other step to do, like maybe build ROMs or set configuration constants or similar?  Are the timings any different to the Spectrum one such that my monitor might be happy with that one and not this one?

Share this post


Link to post
Share on other sites

I pushed an update to it a few days ago to implement HDMI. give that a try. the ROM is already prebuilt into one of the VHD files. if it still doesn't work make sure that during synthesis you only get about 35 warnings and check removed logic. it definitely works for me on a Pipistrello with both VGA (arcade mega wing) and HDMI. the HDMI version expects a PS2 PMOD but you should be able to tweak the UCF file accordingly to use the arcade mega wing for its PS2 connectors while leaving the video on the HDMI

Share this post


Link to post
Share on other sites

OK so I just rebuilt - the only change I'd made previously was pre-emptively editing the UCF to disable PMOD PS/2 and enable it on Arcade wing instead (as I'd also done on the Spectrum one), so I reverted that 'just in case'.  Was indeed 35 warnings.  Flashed it to the Pipistrello, still no joy from the 'small' monitor I was testing with that works OK with the Spectrum one, took it through to main TV, didn't work on that one either although the TV did at least acknowledge it was trying by saying 'Mode not supported' - it wasn't quite helpful enough to tell me what mode it was trying, but I'm guessing whatever it is differs from whatever the Spectrum implementation was trying.

 

Oh, also I had to drop '/trunk' from the SVN checkout command listed in Github to get the source as otherwise it said it couldn't be found - but I doubt that's any connection to the HDMI modes.

Share this post


Link to post
Share on other sites

Some monitors are very picky about the DVI/HDMI timing format and wants true VGA timing.  Another problem is that the low pixel clock limit for DVI/HDMI is 25 MHz and some games use lower pixel clock (like Pacman which uses 24 MHz based on some multiple of the processor clock) and this could be another reason for the "Mode not suported" message on the monitor.

Share this post


Link to post
Share on other sites

Magnus might be onto something. The Spectrum uses a 7MHz native pixel clock and the DVI uses x4 times that or 28MHz clock.

 

The Oric uses a 6MHz which ends up as a 24MHz DVI pixel clock. This may just be what's causing your TV/monitor to barf though when you think about it 24 is closer to the 25MHz VGA pixel clock than 28 is. When I get home I will try this with another monitor to see what happens. Just out of interest can you give us the brands and models of the screens you use.

Share this post


Link to post
Share on other sites

Must be more to it than just the pixel clock frequency though, since PacMan displays over HDMI and that's 24MHz too.  Resolutions?  Another experiment - BombJack doesn't display on the small display I use for development but does on the main TV.  Small display is 10.1" Lilliput FA1011-np, main TV is Samsung PS50C7000.  So that's Spectrum, bouncing ball, VTC_Demo and Pacman working on either display, Oric not working on either and Bombjack working on the big TV but not the 10" display, all over HDMI.

Share this post


Link to post
Share on other sites

OK I tweaked the scan converter timings to better match VGA timings and this is as close as it will get horizontally, times below in microsecs.

              front horz back  active              porch sync porch videostandard VGA  0.6   3.8  1.9   25.4new timings   0.8   3.8  2.0   25.4old timings   4.5   2.5  5.0   20.0

As a side effect I had to add a 32 pixel border around the video. The problem is that the Oric will never match VGA vertical times because the Oric default refresh rate is 50Hz and there is no standard 640x480 50Hz resolution.

 

I do my development on a Dell P190S, it's an older monitor with a VGA input and a DVI input, for which I use a passive DVI to HDMI cable (passive meaning the cable has no electronics in it, it simply maps the HDMI pins to the DVI pins). I didn't think my monitor was exceptionally clever in coping with out of spec signals :)

 

I'm starting to see a pattern here:

  • Both Oric and Bombjack are based on 6Mhz video pixel clock, meaning the DVI pixel clock will be a multiple of that running at 24MHz.
  • The VTC_Demo is using proper timings all around, slowest one is 25MHz.
  • Spectrum runs the DVI pixel clock at 28MHz
  • Not sure which Pacman code you're using that has HDMI output, also not familiar with bouncing ball either, I'd be willing to bet both of these have 25MHz or more pixel clock to the DVI, can you confirm?

Since the DVI module produces a TMDS clock that is x5 the DVI pixel clock, then it would seem your devices, especially the 10.1" monitor, requires a TMDS clock of 125MHz or more and is not happy with the TMDS clock produced by Oric and Bombjack which is only 120MHz.

 

As a test you could feed a 25Mhz pixel clock (and of course a 25x5=125Mhz differential clock) to the DVI module of the Oric and see if you get the 10.1" monitor to light up. These new clocks will no longer be even multiples of the base video clock of the Oric but I have a feeling that is not strictly a requirement as the video and sync signals output by the Oric video are "sampled" by the DVI pixel clock, and as long as that clock is fast enough, it need not be an even multiple of the source video pixel clock, if you see what I mean.

Share this post


Link to post
Share on other sites

Hi, recompiled (resynthesized?) with the new tweaks from Github, still didn't display but *almost* did on the big TV, when I caught a glimpse of what looked like alternating black and white block stripes on bootup but then vanished to 'mode not supported' blackness.  Does B&W block stripes sound like what an Oric does on power-up?

 

The Pacman and bouncing ball bitfiles came from the Pipistrello front page at Saanlima.com, no source given for either though so I can't say - presumably Magnus compiled these.

 

To end on a success story though - have had the 48K Spectrum bitfile successfully loading games from WAV files generated from TZX files!

Share this post


Link to post
Share on other sites

Yeah, when I did Pacman on DVI I had to push the processor clock up from 6 MHz to.6.25 MHz in order to generate a 25 MHz VGA signal.  Most monitors will reject a 24 MHz DVI signal...

Share this post


Link to post
Share on other sites

Another option is to scan-tripple instead of scan-double like what Pacman does, i.e. instead of going from the native 320x240 -> 640x480 you could go to 960x720 instead.  Just a thought.

Share this post


Link to post
Share on other sites

I decided to use Magnus' idea and run the Oric a bit faster in order to bring the DVI clock to spec. The Oric now runs at 1.04166 MHz instead of 1MHz but the DVI clock is now at 25MHz. Hopefully all monitors/TVs will now lock onto this signal.

 

I've also replaced the two DCM_SP with a single PLL_BASE which should make it easier for people to experiment with the divisors if they want to generate different frequencies. Clock outputs 0, 1, 2 feed the DVI section, output 3 is exclusively for the Oric and outputs 4 and 5 are for the scan converter. If you do play with the frequencies, make sure the design meets timing, it's not hard at all to go overboard :)

Share this post


Link to post
Share on other sites

Great stuff - this version displays correctly on my screens, and a quick check with PAPER 1 etc shows the red and green channels are hooked up the right way round too.  I don't have any Oric tapes or tape-to-audio converters yet, will the clock change affect loading programs?

Share this post


Link to post
Share on other sites

It's possible that a 4% error is big enough to affect tape loading. There is a tools directory with tape to wav converters that I found somewhere. You must compile them though as I haven't uploaded the executables.

I did a quick test (with the correct speed Oric) and it did not even detect that a tape signal was present. Didn't spend too much time troubleshooting though.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now