Hi emulator developers / Z80 gurus! Would you please take a look at this?

Página 3/4
1 | 2 | | 4

Por Sky_hawk

Champion (267)

Imagen del Sky_hawk

06-09-2014, 14:29

Konamiman, I like your project and might be interested in helping to develop it. I'm c++ developer by profession but I use C# also on a regular basis. I'm currently developing a MSX emulator in C++, it is still in the early stages, but we might be able to help eachother. The basic design in terms of classes could roughly be the same, we could design the architecture together and use it for both projects?

Por konamiman

Paragon (1155)

Imagen del konamiman

08-09-2014, 09:46

@Sky_hawk: fine, the more brains and eyes the better :-)

The thing is, I have the big picture for most of the architecture dancing in my head. Let me dump it in code and in the project's README, then we can discuss about it.

Por konamiman

Paragon (1155)

Imagen del konamiman

08-09-2014, 17:12

I just did a big update in the README to explain the main execution flow. @Sky_hawk, if you (and/or someone else) want to take a look and point out all the nonsenses... :-)

Por Sky_hawk

Champion (267)

Imagen del Sky_hawk

08-09-2014, 22:10

konamiman, now that I read more carefully I see you focus on the Z80 alone, not an entire MSX, which is ofcourse a good place to start Smile
My designs focus on the MSX system as a whole, since the z80 emulation was already finished a few years ago.
However, I'm still interested in exchanging ideas and thinking along.
I my experience zexdoc and zexall are a good place to start!

Zexdoc is a z80 instruction exerciser that tests the correct working of all documented z80 instruction, including flags.
Zexall does the same but includes the undocumented behaviour.

Zexall is not exhaustive, there are thinks like the internal MEMPTR register that it does not test, it also does not test that NOP instructions (there are quite a few of them, for example is the ED-group) actually do nothing.

Also, since they require _very_ limited BIOS calls to run, you can just take the zexdoc.com load it at 0x100, patch BDOS call 0x005 (stdout) and reroute it to the console to make it print out its first few characters.

It does ofcourse need the first basic instructions to work at all, like INC, XOR, LD A,(HL) and stuff.

As for the memory-access I wouldn't worry to much about it yet, just create a readmem/writemem/readIO/writeIO method and get the core working first.

You will soon find out the instruction fetching method you describe will need more details working out, such as fetching prefix instructions like DD

Por Manuel

Ascended (18238)

Imagen del Manuel

08-09-2014, 22:39

Sky_hawk: can you tell us a bit more of your emulator project?

Por Sky_hawk

Champion (267)

Imagen del Sky_hawk

08-09-2014, 23:26

Manuel, sure, it is actually the reason why we designed the nowind interface in the first place.

We (aaldert and I) created an MSX2 emulator (called the nowind emulator) It was never released, because it has no UI was-so-ever. If I want to insert a disk, I modify the source code, compile and start it in visual studio.

Back then we wanted to create a way to really prove that the emulator was 100% correctly emulation a Z80.
Zexall was not enough. For this was had the idea to execute random instructions for long periods of time and see
if the results were the same on real hardware as well as on the emulator.

To do this, using disks would be troublesome at least, to we devised a way to run programs on the MSX and report the results directly to the PC. A spin-off of this prototype device that was created from experimentation board, _lots_ of wires and a FT245 was the nowind-interface. It was not much later that we wrote a diskrom driver to use the FT245 as a source to read sector-data.

The emulator was our pet-project for a few years back in 2005, now recently with the introduction of C++11 I felt the need to pick up the emulator source code again and see if it could be improved both performance-wise and functionally.

Soon I discovered my programming style had changed _a lot_ in these years and I was very unhappy with the source code, and also and maybe more importantly, the design of the emulator (the architectural design in terms of classes).

Back then we started with the Z80 emulation, and worked our way through all MSX peripherals, but the 'main' class that everything was connected to was still the z80 class. The code is portable, works on linux, Mac and win32, which is also why the UI is such a problem for me. I lack the skills for using QT or WX and intergrate either with openGL is such a way that it still performs optimally. So I used SDL with a nice and portable, but lousy for building GUIs.

Now I'm redesigning the whole thing from scratch, this time, keeping in mind some of the fundamental flaws we had in V1, such as:
* 'long long unsigned int' for emulated T-state counting), which was slow (well slow is a relative term here, but considering that you have to modify this counter +1million times per second, every bit of speed helps. Now with 64-bit cpu's the 'long long int' is nolonger any slower then a 32-bit long, but also if running in 64-bit mode of course.
* lack of a UI
* no bus emulation
* bad v9938 emulation (no line interrupts, no sprite flicker, etc.)

I started with the basics:
- an event scheduler for interrupts, video updates and sound updates.
- Bus emulation, basically a administrator of address-bus, data-bus and IO-connections.
- borrowed the z80 core from V1
- got zexall running and passing most tests (or all, I don't remember)

So now we had this, I wanted to fix UI problem first, to make sure it does not end up forgotten like the first time.
Sadly, this is were it is, and has been for a few months now Smile

Por Manuel

Ascended (18238)

Imagen del Manuel

09-09-2014, 11:08

So, it's purely a fun project for yourselves? Or are you trying to achieve something that other MSX emulators have not achieved?

Por duefectu.corp

Supporter (2)

Imagen del duefectu.corp

10-09-2014, 14:31

Hello, I'm not MSX user, but I have work in a similar Project, and I want to add somthing to this post.

About C#
The MONO Project was evolved to Xamarin (www.xamarin.com), that allows to develop in C# for iOS, Android, Mac and Windows. It Works very well, I make a video monitor for Android and running as fast as the Windows versión without changing any line od code for the Logic, only the UI must be rewrited. This means that you can reuse 80% of code, and 100% of Logic.

About z80 emulation
A few years ago, I worked in a Silverlight ZX Spectrum Emulator, that is on stand by at this moment. I send the code to Konaminan.

If the Project goes on, I can make the Spectrum implementation :evil:

Thanks to all!

Por Sky_hawk

Champion (267)

Imagen del Sky_hawk

12-09-2014, 00:22

In what way in Xamarin like mono? is Xamarin looks not open source and actually, not free for any other then personal use.
What would be the point to create an application that no one can legally use? remember this is all hobby, I will not pay 25/month just to be allowed to work on my hobby.

No thanks.

Por duefectu.corp

Supporter (2)

Imagen del duefectu.corp

12-09-2014, 00:43

Sky_hawk wrote:

In what way in Xamarin like mono? is Xamarin looks not open source and actually, not free for any other then personal use.
What would be the point to create an application that no one can legally use? remember this is all hobby, I will not pay 25/month just to be allowed to work on my hobby.

No thanks.

Sorry, but Xamarin starter is free. I used this version for my Project. Has some limitations, but enought for a Project like this: https://store.xamarin.com/

Open source <> Free
House mortage <> Free
Open source = House mortage??? :) :) :)

Página 3/4
1 | 2 | | 4