Page 2 of 3
Re: Java Emulator
Posted: Wed Jul 13, 2011 9:06 am
by RWAP
Best to keep the project on here, but maybe direct people to this topic!
Re: Java Emulator
Posted: Thu Jul 14, 2011 1:15 pm
by zeccie
Hi all,
Yesterday I have been looking at the source of some QL emulators, including JZX (Java) for the Spectrum. Screen and keyboard handling is relatively straightforward to do in Java (based on what I saw in JZX and qlay sources), but I have some questions about some io registers (mdv handling, the comm protocol between 68008 and 8049, ser). I couldn't find good references on the internet, so I am looking for somebody to explain these topics. When I look at the code of Qlay for example the io handling is sometimes difficult to follow as it is written in C by Jan Venema ten years ago. My aim is to write a clean new implementation in Java, also inspired by the extreme clean and nice object oriented implementation of JZX. I certainly do not want to belittle the job Jan did, it's a great achievement, but a direct translation of C code into Java code will not result in a clean object oriented implementation in general. Who can help me out?
Re: Java Emulator
Posted: Thu Jul 14, 2011 7:21 pm
by dilwyn
Probably the most expert people on the operating will be the emulator and ROM authors - people like Marcel Kilgus (QPC2), Daniele Terdina (QemuLator), Jimmy Montesinos (QL2K), Mark Swift (QDOS for Amiga) and Laurence Reeves (Minerva).
In case they are not on this Forum I'll put a message on the ql-users email mailing list asking people to meet you on this Forum to see if they can help you.
Dilwyn
Re: Java Emulator
Posted: Mon Jul 25, 2011 10:55 am
by zeccie
Hi all,
In the last week I have been working on the emulator, or to be more precise, working on resolving a particular bug/feature

in the M68008 emulation code of m68k. It turns out that the exception/trap handling did not work as it should as is mentioned in the source code. I tried to repair it (and that part works now), but now I have some weird bug somewhat after the stopping of the microdrives in the boot sequence which I just cannot solve. When looking at the different source codes, everybody seems to solve it a bit differently. Anyway, I have been looking for alternatives like the 68008 code in Genesis/Jemu2 but that also did not solve it. A couple of days ago I found a TI89 emulator for Android (also a 68000 system), but after some reverse engineering I found out that they used some clever native calls to a shared (so) file, so it is not a platform independent solution either. That, however, triggered another possibility of making a Java Web start solution with a native emulator embedded. The trouble with this is that it is almost the same as downloading some existing emulator for a particular platform. The final thing I tried was a conversion tool that translates C in Java, but this is not satisfactory as well.
The big challenge is that the M68000 is a very complex and errorprone processor to emulate, especially considering the fact that Java does not provide unsigned ints and pointers, so it is a quite mundane job to circumvent these problems. And debugging is a real tough job in this case

It just seems that there isn't a good 68000 emulator for Java. And to be honest, my primary interest is not building a M68000 emulator.
I am not saying I give up, but if there are people out there willing to participate in this project, please join in making this project happen.
Re: Java Emulator
Posted: Wed Jul 27, 2011 7:17 pm
by dilwyn
zeccie wrote:Hi all,
In the last week I have been working on the emulator, or to be more precise, working on resolving a particular bug/feature

in the M68008 emulation code of m68k. It turns out that the exception/trap handling did not work as it should as is mentioned in the source code. I tried to repair it (and that part works now), but now I have some weird bug somewhat after the stopping of the microdrives in the boot sequence which I just cannot solve. When looking at the different source codes, everybody seems to solve it a bit differently. Anyway, I have been looking for alternatives like the 68008 code in Genesis/Jemu2 but that also did not solve it. A couple of days ago I found a TI89 emulator for Android (also a 68000 system), but after some reverse engineering I found out that they used some clever native calls to a shared (so) file, so it is not a platform independent solution either. That, however, triggered another possibility of making a Java Web start solution with a native emulator embedded. The trouble with this is that it is almost the same as downloading some existing emulator for a particular platform. The final thing I tried was a conversion tool that translates C in Java, but this is not satisfactory as well.
The big challenge is that the M68000 is a very complex and errorprone processor to emulate, especially considering the fact that Java does not provide unsigned ints and pointers, so it is a quite mundane job to circumvent these problems. And debugging is a real tough job in this case

It just seems that there isn't a good 68000 emulator for Java. And to be honest, my primary interest is not building a M68000 emulator.
I am not saying I give up, but if there are people out there willing to participate in this project, please join in making this project happen.
This is a great pity. If I had knowledge of Java and enough knowledge of the OS I would volunteer. We have put out requests for help but got no direct reply unless they contacted you direct.
Dilwyn
Re: Java Emulator
Posted: Thu Jul 28, 2011 11:02 am
by zeccie
I discussed some bugs/omissions in the emulatorcode of m68k with the author. He was happy that actually somebody was digging into his code and suggesting improvements

He is writing an Amiga emulator, and will do the bugfixing, albeit not on short notice. In the meantime, I'll look for more errors. So, I'll be back...
Re: Java Emulator
Posted: Fri Jul 29, 2011 11:57 am
by RWAP
Keep up the excellent work - I can offer my assistance in any way I can
Re: Java Emulator
Posted: Sun Jul 31, 2011 12:21 pm
by tofro
I have extensive Java experience and /some/ QL emulation experience - If you need help for a specific problem, please go ahead and contact me - However, I'm lacking another important factor, which is time - So I can't promise immediate help in each and every case.
Cheers
tofro
Re: Java Emulator
Posted: Sun Jul 31, 2011 3:07 pm
by dilwyn
zeccie wrote:I discussed some bugs/omissions in the emulatorcode of m68k with the author. He was happy that actually somebody was digging into his code and suggesting improvements

He is writing an Amiga emulator, and will do the bugfixing, albeit not on short notice. In the meantime, I'll look for more errors. So, I'll be back...
I have no experience of Java, but if I can help in any other way such as trying to find help on a particular topic or QL documentation, I am very happy to try to help.
Please keep in touch and let us know how you are getting on. Several people have expressed an interest in this project!
Dilwyn
Re: Java Emulator
Posted: Mon Aug 01, 2011 2:04 pm
by zeccie
Thanks for the support! I will be away on holiday in August, so I won't be back before September. By then, I think it would be worthwhile to make a kind of work breakdown structure with the focus first on the M68000 and then on the specific QL stuff