hardware emulation with software on msx

By Leo

Paragon (1236)

Leo さんの画像

13-11-2010, 22:45

Hi all,

I was wondering if it was possible to redirect some hardware access to some software routine .
The idea behind is to emulate hardware with software routines , of course it would be slower but it could be fine
for some apps :

- redirecting v9958 transaction on port98/99/9A/9B to gfx9000 : so gfx9000 could replace totally vdp.
- adding virtual ram on disk , by redirecting the mapper ports to software routines.
- enhancing psg games using better sound card.
- more generally making new hardware compatible with legacy software.

So it is not emulation with PC or FPGA but the MSX itself that would spy its own request and redirect them
to pure Z80 routines.

I try to think to a solution that does not require soldering or opening the computer , a cartridge at worst.
In a cartridge there could be logic that detects for instance an InOutRequest (IORQ) to some ports and raise
an interrupt if the condition is true. then the interrupt routine could deal with the request, but there are a lot
of problems or faster ways of doing things.

it is a bit like this emulation of a msx with a msx .
Maybe the thing is to have two Z80 , only one sees the real hardware and support the other that executes
legacy software.

I see two ways to do it , one purely software but it may be slow , an emulator on PC does like this, one is hardware
but it may be complicated or an overkill ( like putting a 100$ fpga )

I think the following projects are close :
- msx emulator in a TurboR of nyrryky, but i wonder if r800 is fast enough to insert an adaptation layer in sw.
- Z380 board , it is a second fast cpu that could execute legacy software , but it cant redirect hardware request, afaik
- aleste russian computer with vdp emulation with software.

I know Z280 can trap io request to some address routine but then it means Z80 cpu would have to be replaced.

And what about memory mapped peripherals ?

Well all this is just some thinking on how to make new hardware without disrupting compatibilitywith legacy sw.
if only all legacy sw were using bios routines !

ログイン/登録して投稿

By Edwin

Paragon (1182)

Edwin さんの画像

14-11-2010, 10:59

The closest thing in Software is probably GEM. With dynamic recompilation of code, you can insert your own stuff on hardware access. GEM is even slightly more complex since the Gameboy z80 is not entirely the same as a normal one. With only simple translation of hardware calls, performance could be reasonable. Still a very complex piece of code though.

Of course, with partial or full implementations in hardware you can make anything happen. Tongue

By Leo

Paragon (1236)

Leo さんの画像

14-11-2010, 16:00

thanks for the tip, dynamic recompilation , you mean on the fly , during execution ?

By st1mpy

Paladin (900)

st1mpy さんの画像

14-11-2010, 19:42

Leo, I think you might be interested in this,

www.youtube.com/watch?v=WgXefMKkzTw
en.wikipedia.org/wiki/XMOS

It's kind of an alternative to FPGA. Sounds like just another microcontroller, but it is multitasking at hardware level. So, it is good for making hardware logic emulation in software like you want to do. And its not expensive. May be it is possible to have a whole MSX system emulated on this chip (would be a cheaper alternative to one chip MSX FPGA implementation.)

By Leo

Paragon (1236)

Leo さんの画像

14-11-2010, 22:09

yes i like this links and the expression "software defined silicon".
I now have a better understanding of what could be interesting :
describing silicon with Z80 machine language.

so an msx could be defined only with a Z80 program , or many z80's executing many z80 programs.

By flyguille

Prophet (3031)

flyguille さんの画像

15-11-2010, 03:51

mounting a dedicated FPGA for ... say hardware delivered on demand in a real msx, is a good idea.....

but..... how long time will take to flash a FPGA on demand, using the real MSX????????

other issue that I can to thinks, it is not just a FPGA, you need a dedicated board with regulators to lower the voltaje or an external PSU, is to say, a big module..... it isn't just a stick or pen-drive like

and that is, what at the end will be the difference in price to buy this extension, or buy a one chip msx?

because the basics is the same, a fpga, extra RAM to run code, bus controllers buffers (5v ttl to ....), the psu or regulator, i thinks a switching psu becuase original MSX psu already can´t meet the requeriments.

and that is just few issues... lets dreams!

By RetroTechie

Paragon (1563)

RetroTechie さんの画像

15-11-2010, 07:56

Funny how history goes... the whole idea of a general purpose computer was to run software on them. Because software is so much easier to change than hardware. Someone builds new hardware, and you just adapt the software so that it runs on the new hardware. Easy, right?

But in reality: hardware stays compatible for a long time, people write 1000+ programs for it (many of those closed source so binaries are all you have), and when it's time for a hardware update, making the new hardware compatible (at the cost of performance / efficiency / complexity) turns out soooo much easier than porting those 1000+ programs to the new hardware. So changing something 'cast in stone' (hardware) is easier than changing something as flexible as software. oO I'd guess early computer pioneers didn't see that one coming... Smile2

And its not expensive. May be it is possible to have a whole MSX system emulated on this chip (would be a cheaper alternative to one chip MSX FPGA implementation.)
That's comparing chip vs. complete system. But a cheapo controller doesn't include case, cartridge slots, power supply, SD card reader etc. Better comparison is FPGA vs. alternative chip. Then you find out that big enough FPGA isn't very expensive, and if you need to build a board anyway, it doesn't make sense to save a few dollar on the core chip. More important is its architecture, capabilities, and how easy/hard it is to use / program for. When it's a new architecture anyway, what's the difference between learning XCore, ARM assembly or VHDL, really? Just pick whatever works, or what you like. Btw: when defining hardware, Z80 assembly would NOT be easier to use than say, Verilog or VHDL, as long as you look through the red tape & focus on underlying concepts. FWIW: you can also use schematics.

By Leo

Paragon (1236)

Leo さんの画像

15-11-2010, 08:25

I remind back in the 80'sq , PC had 2 alternative for graphic card : CGA or Hercules , before vga came to be cheap with pc games.
hercules was hi res monochrome and cga was only 4 colors at lower res.
Then a small program was available to 'emulate' a cga card for those having hercules, the colors were made up with patterns.
it worked really !
So the thing is not having a new computer or hardware cpu but just to improve usage of already existing hw , and i believe if
for example we can emulate v9958 with V9990 , then in the future we can think of a msx with just a gfx9k.
the same goes for psg/FM/moonsound.

Making a new concept/msx computer is a too big step and already tried in many ways.
The idea is more like the opposite of reinventing the wheel.