Yesterday, CD-i member cdifan explained why a high level emulation approach has benefits in the case of CD-i. He answered on the difficulties as described by TheMogMiner about the current state of CD-i emulation in Mame. Would it be possible/easier in Mame too to do high level emulation of CD-i? Implement the 68000 cpu and intercept the os/9 system calls without emulating a specific underlying hardware? That wouldn't be a valid approach in mame. CD-i member TheMogMiner explains: "It absolutely would! I'm not sure that's something anyone has tried before. Given enough knowledge of the CD-i related system calls, though, I can't imagine that it'd be that huge of a thing to get going. High Level Emulation was pioneered in the late 90's with the N64 emulator, UltraHLE.
Nintendo went that route for Virtual Console primarily for speed reasons, not due to a lack of hardware documentation on their part. It's not quite as simple as just dropping in a new library, and away you go. The N64 had a vector coprocessor (the RSP) which handled the calculation side of both the graphics and audio stack. HLE-ing the N64 still required reverse-engineering the routines uploaded to the RSP. Overall, there were roughly 20-40 unique sets of microcode routines. Some were used by only one or two games, some were used by a fairly large chunk. So it's not entirely the same situation with the CD-i. So yes, It should theoretically be more straightforward to 'High Level Emulate' the CD-i than do it bare-metal - but also accurately gauged that that method is a no-go for MAME."
A next clarification comes via CD-i member MrCheeze: "I thought everything going through a system library with a well defined spec but flexible implementation made things much EASIER to emulate, just by substituting your own library implementation?" TheMogMiner continues: "That's not how emulation works. Emulation doesn't work by "substituting [a] library implementation". Quite the opposite, it's 100% agnostic to the software itself. A well-made emulator reproduces the functionality of the underlying *hardware* as accurately as possible, with no consideration of the software. As I explained in [this article], when software bangs on the hardware directly, it makes it somewhat easier to tease out the nuances of the hardware's functions, as each developer tended to be subtly different in terms of their code."
So in the end, High Level Emulation will not be the solution for Mame, and both CD-i Emulator and MAME CD-i Emulator will have a different approach on emulating the CD-i. "MAME doesn't go the HLE route when emulating the N64, either, as the stated goal of the project is to at least attempt to emulate things as accurately as possible. HLE is generally only invoked as a last resort, and we're not even near last-resort territory with the CD-i."
[Thanks, The MogMiner]