JOric

Comments, problems, suggestions about Oric emulators (Euphoric, Mess, Amoric, etc...) it's the right place to ask. And don't hesitate to give your tips and tricks that help using these emulations in the best possible way on your favorite operating system.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

JOric

Post by dreamseal »

As I mentioned in my introductory post, I was working on a VIC 20 emulator about 20 years ago. The initial version was written in Pascal, about 1996, then I rewrote it in a mixture of C and 8086 assembler, then in 2003 I rewrote the whole thing again in Java. About two years ago I used that Java version as the basis of a project using a library called libGDX so that it would run on Android phones.

Now that I've added the Oric to my collection of 8-bit home computers, I thought that I would start working on an Oric emulator. The libGDX VIC 20 emulator for Android already has 6502 and 6522 emulation, so I figured that I could start out with that and the HSC10017 and AY-3-8912 would be the bits to add. That was where I was at last weekend, and I'm happy to say that I think I now have the video side of things working. The keyboard and AY-3-8912 will be the task for this weekend.

The name is a little unoriginal. Simply Oric with a J in front to indicate it is written in Java. This aligns with the VIC 20 emulator that I called simply JVic.

Here is a very early days screen shot of the start up screen:

joric_first_screenshot.png
joric_first_screenshot.png (9.31 KiB) Viewed 15216 times
I need to fix the pixel scaling. This size is currently based on the JVIc emulator, which has a different text window size.
Last edited by dreamseal on Sat Mar 24, 2018 12:11 pm, edited 1 time in total.
ThomH
Flying Officer
Posts: 238
Joined: Thu Oct 13, 2016 9:55 pm

Re: JOric

Post by ThomH »

Cool! I followed the exact same route: from Vic-20 to Oric emulation. Probably being the person to have written what was until just now the most recent new Oric emulator, definitely don't hesitate to shoot over any questions if I can be any help.

Top tips:

Use the test ROM to be able quickly to test. You won't need to support any sort of file format, and it gives a pretty good stretch of your ULA.

After you've implemented hardware tape support, or as a shortcut before you do, you can add quick-loading support by trapping the PC at 0xe6c9 for BASIC 1.1 and 0xe630 for BASIC 1.0. When it gets there, just fetch the next byte from the tape (you can consult 0x024d to determine whether you should be reading the fast data format or the slow — 0 means fast), put it into the A register, set the zero flag appropriately and RTS. That's how my emulator optionally supports near-instantaneous loading of tapes, and I'm going to assume I was told that by somebody because I'm terrible at disassembling, so it's almost certainly how other emulators do too.
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: JOric

Post by Symoon »

Actually, Euphoric traps bytes, but also bits ! (can't recall the addresses right now)
This allows some custom-made loading routines to load as TAP format. Priceless for some programs ;)
ThomH
Flying Officer
Posts: 238
Joined: Thu Oct 13, 2016 9:55 pm

Re: JOric

Post by ThomH »

I'm not catching bits so those titles would load more slowly. But anything that loads bytes will load quickly irrespective of whether it's TAP, CSW or whatever else. TAP isn't a special case.

But emulators that aren't JOric aside: just byte catching will do for Stormlord, Impossible Mission and most other modern things that are really going to help you to test a new AY and Oric video implementation. So the advice stands as to potential options for speedy immediate development.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

ThomH wrote: Sat Mar 24, 2018 12:07 amCool! I followed the exact same route: from Vic-20 to Oric emulation. Probably being the person to have written what was until just now the most recent new Oric emulator, definitely don't hesitate to shoot over any questions if I can be any help.
Hey thanks, I certainly will.
ThomH wrote: Sat Mar 24, 2018 12:07 amTop tips:

Use the test ROM to be able quickly to test. You won't need to support any sort of file format, and it gives a pretty good stretch of your ULA.
Thanks for the tip. I'll take a look at that test ROM this evening.
ThomH wrote: Sat Mar 24, 2018 12:07 amAfter you've implemented hardware tape support, or as a shortcut before you do, you can add quick-loading support by trapping the PC at 0xe6c9 for BASIC 1.1 and 0xe630 for BASIC 1.0. When it gets there, just fetch the next byte from the tape (you can consult 0x024d to determine whether you should be reading the fast data format or the slow — 0 means fast), put it into the A register, set the zero flag appropriately and RTS. That's how my emulator optionally supports near-instantaneous loading of tapes, and I'm going to assume I was told that by somebody because I'm terrible at disassembling, so it's almost certainly how other emulators do too.
Interesting. I'll certainly give that a go. I do intend to implement the proper tape loading hardware at some point, but a quick load feature will be very useful. A quick load is all I had in my JVic emulator.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

I now have an implementation of the keyboard logic working, so I can start to interact with the emulator. See example below:
joric_screenshot_2.png
joric_screenshot_2.png (7.97 KiB) Viewed 15156 times
No flashing cursor at the moment. Obviously missing something there. Any ideas?

Also I was wondering if people have a preference as to how the keys are mapped by default from a desktop PC keyboard to the emulator? For example, if you press SHIFT ' (i.e. shift single quote), would you prefer to get what the Oric would show for that combination, or what the desktop PC keyboard would give you? I'm leaning towards the latter. Are there certain Oric key combinations that this might be problematic for though?

I will have a popup keyboard on the screen as well.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: JOric

Post by Dbug »

For the flashing cursor, have you implemented the video inverse bit (bit 7) ?
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

I had attempted to implement it, but got the logic wrong, so it wasn't working.

I now have a flashing cursor, and working inverse bit. Thanks for the tip.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: JOric

Post by Dbug »

I assume you are writing a generic video mode emulator that handles correctly any combination of HIRES and TEXT?
Some of the earlier emulators had hard coded TEXT and HIRES modes, and miserably failed handling this type of thing:
http://osdk.org/index.php?page=articles ... T9#title15

If you want to easily test your ULA emulation, the easiest demo to try is my 2000 small demo, it works on tape, does not have any sound, but it uses (and abuses transitions between TEXT and HIRES as well as using the inverse video at the same time):
http://www.defence-force.org/index.php? ... tniccc2000
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Dbug wrote: Sat Mar 24, 2018 9:58 pm I assume you are writing a generic video mode emulator that handles correctly any combination of HIRES and TEXT?
Some of the earlier emulators had hard coded TEXT and HIRES modes, and miserably failed handling this type of thing:
http://osdk.org/index.php?page=articles ... T9#title15
I gave that a go and it appears visually to have worked straight off:
joric_screenshot_3.png
joric_screenshot_3.png (5.09 KiB) Viewed 15142 times
Dbug wrote: Sat Mar 24, 2018 9:58 pm If you want to easily test your ULA emulation, the easiest demo to try is my 2000 small demo, it works on tape, does not have any sound, but it uses (and abuses transitions between TEXT and HIRES as well as using the inverse video at the same time):
http://www.defence-force.org/index.php? ... tniccc2000
Thanks for the suggestion. I think I'll make that the first tape that I try when I get this quick load feature working. I'm about to start coding the tape quick load now.
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

dreamseal wrote: Sat Mar 24, 2018 4:24 pm
ThomH wrote: Sat Mar 24, 2018 12:07 am Use the test ROM to be able quickly to test. You won't need to support any sort of file format, and it gives a pretty good stretch of your ULA.
Thanks for the tip. I'll take a look at that test ROM this evening.
So I did give the diagnostic ROM a run on JOric this evening. Everything appears to be fine up until it starts relying on the loopback connectors, which obviously its going to fail at (unless I implement the loopback, but not sure if that would be worth it at this point).

Here's a screen shot from one of the ULA tests:
joric_screenshot_4.png
joric_screenshot_4.png (10.66 KiB) Viewed 15127 times
I'm partway through implementing the quick load tape logic. Hopefully will have that done within the next day.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: JOric

Post by Chema »

I am really impressed with the all these new development of games and emulators for the Oric platform.

Congratulations!
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

The quick tape loading is implemented now and the STNICCC 2000 demo appears to be working. It is the first .tap file I tried, in fact I have yet to try another one.

I had the demo running side by side with the Youtube video. Everything was exactly in sync as far as the timing goes, but I did notice some of the background wavy patterns at the start (e.g. as in the first image below) were not moving in the same direction at the same time as the video. However, I then compared it side by side with Oricutron and the backgrounds were perfectly in sync using the same .tap file.
joric_screenshot_5.png
joric_screenshot_6.png
joric_screenshot_7.png
Any other suggestions for tape based demos that I could try at this point?

Any suggestions for good games that I could try? I'm about to take a look at the TOSEC collection on archive.org. This is all new to me, so any tips for demos, games, or apps that I could try would be great. Are there any modern games that come as a .tap file?
User avatar
Symoon
Archivist
Posts: 2301
Joined: Sat Jan 14, 2006 12:44 am
Location: Paris, France

Re: JOric

Post by Symoon »

Congratulations!
Amazing work.
dreamseal wrote: Sun Mar 25, 2018 10:44 pm Any suggestions for good games that I could try? I'm about to take a look at the TOSEC collection on archive.org. This is all new to me, so any tips for demos, games, or apps that I could try would be great. Are there any modern games that come as a .tap file?
I'd suggest you to avoid Tosec, especially for testing purpose. Though I think Didier and others tried to work at it, it holds TAP files downloaded from anywhere, not fully checked, and more than often, bugged.
Modern game as TAP files: Oricium from Chema, Impossible Mission and Stormlord from Twilighte, all are available on Defence-Force: http://www.defence-force.org/index.php?page=games
Oric.org is another reliable source for classic games, though it appears from time to time it holds a bugged TAP file (don't hesitate reporting it then ;) )
User avatar
dreamseal
Officer Cadet
Posts: 62
Joined: Sat Mar 17, 2018 6:14 pm

Re: JOric

Post by dreamseal »

Thanks for the suggestions. StormLord is an amazing looking game. I love it. Impossible Mission and Oricium look great as well. I'm going to be busy playing these games now rather than working on the emulator. :D
joric_screenshot_8.png
Makes me want to write some games.
Post Reply