Mini vMac Snapshot: August 4, 2010

About Mini vMac and all other 68k emulators, including SoftMac, Executor, and MESS.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Mini vMac Snapshot: August 4, 2010

Post by ClockWise »

There is a new Mini vMac, dated August 4, 2010.

http://minivmac.sourceforge.net/

Here's the scoop:

"Today's Development source snapshot contains an experiment in CPU emulation. The CPU emulation method introduced in 3.0.1, and made the default in 3.1.0 involves a table that classifies each of the 65536 primary opcodes, saving the work of decoding opcodes bit by bit. It has occurred to me that the reason that it is not much faster than the previous approach is because it is a poor fit for the caching scheme of modern processors. On each instruction it loads a random byte from this table, which can cause the CPU to load an entire cache line, perhaps 32 bytes or more, depending on the CPU, the rest of which likely won't be used. One alternative would be to go back to the previous bit by bit decoding, making the program a bit smaller and use a bit less memory, making it more "mini". But instead I've experimented with going in the opposite direction - as long as an entire cache line is being read in anyway, make each element of the table larger, saving additional information that can help with emulation. That's the basic idea, but the pros and cons are complex, and to see what really would happen I needed to try it. Each element is now 8 bytes, and depending on the opcode, saves information about the instruction arguments. The main advantage is that there are now fewer paths for decoding arguments, so those that remain can be better optimized, at the expense of making them larger. Parts of the routines they call are inlined into them, and then rearranged for better parallelism. Another advantage is that since there are no longer separate classes of, for example, the ADD instruction for each style of arguments, instead there can be separate classes for each of the argument sizes (byte, word, and long), avoiding nasty conditional branches that modern processors will likely mispredict. Another benefit is that more of the logic of the emulator is moved into the code that sets up the table (in M68KITAB), simplifying the multiple versions of MINEM68K (c code, and assembly language for each processor). The new approach so far averages around 5 percent faster for x86 and PowerPC assembly language, and I feel more improvement is possible. The c version can be slower than before. The new approach makes careful assembly language optimization more possible, but that generally doesn't help a c compiler. "
yksoft1
Master Emulator
Posts: 394
Joined: Tue Aug 14, 2007 4:32 pm
Location: People's Republic of China

Post by yksoft1 »

VC6 build:
http://www.mediafire.com/file/gr77c861s ... 04-wx86.7z
MinGW GCC 4.3.3 build:
http://www.mediafire.com/file/0hekhc73z ... -gcc433.7z

To gryphel: Most of us do not need a faster 68000 Mini vMac, we need a more complete Mini vMac II!
User avatar
gryphel
Nice Guy
Posts: 106
Joined: Sat Nov 17, 2007 6:46 pm

Post by gryphel »

yksoft1 wrote:Most of us do not need a faster 68000 Mini vMac, we need a more complete Mini vMac II!
Mini vMac is open source, so feel free to work on what interests you.

I have attempted other models for getting development done, but they just don't seem viable.

Anyway, if anyone implements improvements in the Macintosh II emulation, I'd be quite likely to merge them into my version of Mini vMac and maintain it. An example is Ross Martin's nice work on FPU emulation.
nathanpc
Tinkerer
Posts: 48
Joined: Mon Sep 21, 2009 5:35 pm
Location: Brazil
Contact:

Post by nathanpc »

A wonderful piece of work! It's working fine on my Ubuntu Hardy Herron, on my Windows XP Professional SP3 and on my Windows Vista SP1. :wink:
McIntosh
Tinkerer
Posts: 97
Joined: Thu Jan 06, 2011 10:41 pm

REPLY!

Post by McIntosh »

Oh, Ok, on my pc, mini vmac runs a bit too fast! When I play Space Station Pheta, the guy falls way too fast before he dies!
Post Reply