183

Let's take a look at the code! A few seconds of Googling led me to a high-quality annotated disassembly by Kent Hansen and Nick Mikstas: https://www.metroid-database.com/source-code/ Whenever the user is on the password screen, the following routine runs every frame: EnterPassword: L9147: JSR EraseAllSprites ;($C1A3)Remove sprites from screen. L914A:...


37

As others have mentioned, PCem is still perfectly usable, even if it’s no longer maintained by its original author (who is, or at least was, open to handing over maintenance to someone else, should someone step up). Since you’re on Windows, which has an excellent track record for maintaining backwards compatibility, it’s likely that the existing Windows ...


33

Fundamentally these 'passwords' aren't really passwords as such, but map back to a string of bits that control the state of the game - so it's more of a string representation of the current state of the game than a password. There is an amazingly good description of how this works available here that covers the full process of mapping the provided 'password' ...


29

If you're looking for a standard to adhere to, I'd consider implementing the GDB remote protocol. (Link is to Embecosm's guide on writing a GDB Remote Serial Protocol server.) It needs GDB to support the ISA you're targeting (I've heard it's the same sort of "build a special cross-targeting version" song and dance as with GCC), but, people have ...


28

Throwing some things out there that might fit the bill: 6502: AllSuiteA which assembles into a single binary and exits, leaving a failure or success code in memory; 6502 and 65C02: Klaus Dormann's test suite also compiles into a single binary per target CPU, but loops in place if it finds an error rather than exiting; 6502: Wolfgang Lorenz's tests cover the ...


20

Quote from VICE manual: Load the specified file into memory. If no address is given, the file is loaded to the address specified by the first two bytes read from the file. If address is given, the file is loaded to the specified address and the first two bytes read from the file are skipped.


17

The Game Boy Color does not 'simulate' anything (*1), nor does it execute an emulation. It is simply an upward compatible and enhanced Game Boy design. The Game Boy Color is a Game Boy in all details, plus a colour screen added. Much like adding a 3dfx Voodoo card to a VGA equipped PC will add 3D capabilities, but not make any of the existing hardware ...


14

I understand the question (now), as asking about self test programs to check a CPU (or its emulation) for correct operation by trying out certain instructions and verifying the results. Does this fit? Such were plenty. In The Early Days (tm) magazines like Byte, Kilobaud or Micro published such for many new CPUs. It was a very common finger exercise for ...


14

The popular VICE emulator for Commodore computers supports connecting to its in-built monitor using TCP port 6510. You can test this easily by loading the emulator, then Settings → Machine → Monitor → "Enable remote monitor". Once this is done, the familiar monitor interface is accessible using telnet localhost 6510. While not representative of a &...


13

I have once read a blog post by the developer of mGBA, which simply uses ‘cycle-count accuracy’ for this property, and seems to imply this is an established term. Looking up this phrase in a search engine seems to weakly corroborate this, as I found a number of other resources where the same term appears: Paper: Mao-Lin Li, Chen-Kang Lo, Li-Chun Chen, Ren-...


12

Toni Wilen (of WinUAE fame) has written a CPU tester especially for MC68000: https://eab.abime.net/showthread.php?t=98747


12

About 0.6 to 1 ms after the last one is read. The 8042 keyboard controller does not queue scancodes; it just stops receiving bits from the keyboard until a byte is read from port 0x60. When a scancode byte is read out, the controller gets ready to receive another byte from the keyboard. But since serial communication is not instantaneous, actually receiving ...


9

[Caveat, this is from memory, and about a real PC-AT, with real, 16 bit BIOS and code] TL;DR: When does an IBM-compatible PC keyboard controller dequeue scancodes? (I assume this is about a PC-AT, not a PC or PC-XT) Never, as there is no queue. At least none in hardware. The 8042 has simply 4 registers Data In/Out, Status and Command. All synchronisation ...


9

The short answer is that the contents of the CRTC control registers are indeterminate after power-up, and that the CRTC will nevertheless operate according to their contents immediately after /RES is released. Only the counters are zeroed by /RES. Initialising the control registers to zero is reasonable for an emulator to do. The important thing to ...


8

In place and without changing other code: No Simply because there is no shorter encoding of that sequence - that is unless we rely on additional information how (and when) the tested byte changes and/or how and when values set here gets reused or not and/or certain register setup prior to this routine. The basic issue here is that a HLT instruction ...


8

The Modcomp minicomputers were shipped with extensive self-test programs (on nine-track magnetic tape, no less). These were stand-alone programs (no operating system needed) that tested everything from peripherals to memory to CPU. The CPU tests were in a series, starting with "is it working at all" tests. Each test confirmed a more complex part ...


7

Some game systems are designed so that when running games for older systems, they will behave in a way which would be indistinguishable from the earlier systems even by code which was trying to identify the new machine. Such machines behave consistently not only with respect to documented features of the original, but also with regard to undocumented ...


6

I have described such systems as “cycle-approximate”. Some research papers, I found in a short search session agree with this terminology. It is slightly broader than you use it here, and would indicate to me that some portion of the simulator was incomplete, for example cache modeling, prefetchers, or other complex micro-architectural or system/bus level ...


6

My ZX81-emulator for the ZX Spectrum got an updated version in 2020 which is much quicker, has partly chromacharacters and can play games that use special technics on the screen. Available on sinclairzxworld.com The ZX Spectrum also has a Videopac/Odessey2 emulator coded in 2000. At this moment I am also recoding that emulator.


6

I played around a bit with it, and it seems the solution is to basically emulate the full UART behaviour, in particular in regards to detecting start bits. Instead of framing statically by 10 bits, we need to walk the bits until we find a high -> low transition (the start bit), and then we take the next 9 bits as the 8 data bits (lsb first) and a high ...


6

This is only a partial answer, at the OP’s request, addressing the following: But how it was done in MS-DOS (there are no DLL involved in there)? I don’t know whether this emulator used this technique or not, I haven’t been able to download it to even check whether it works under DOS or Windows. However, under MS-DOS, there were multiple implementations of ...


6

There's quite a few browser-based ones on PCjs. PCx86 emulates the Intel 8088, 80186, 80286 and 80386 CPUs, and it faithfully renders characters and graphics produced by the IBM Monochrome Display Adapter (MDA), Color Graphics Adapter (CGA), Enhanced Graphics Adapter (EGA), and Video Graphics Array (VGA) video cards. Support for assorted motherboard and ...


6

Is BOCHS any good for this sort of thing? Bochs can be compiled to emulate many different x86 CPUs, from early 386 to the most recent x86-64 Intel and AMD processors which may even not reached the market yet. It has a good built-in debugger (so you can single-step machine instructions even with interrupts disabled) that's widely recommended for "OS ...


5

In my ~/.basilisk_ii_prefs file I have this line: extfs /home/user/BasiliskShared Which shares the BasiliskShared directory to Basilisk/Classic Mac OS. You'll see a Unix icon on the Mac desktop. Tested with System Software 7.5.5 and Mac OS 8.1. Host system, Debian Linux, Buster. After OP's comment, it seems that System 7 or 7.0.1 on Basilisk cannot provide ...


5

If you want to compile amiga programs so they run on Linux (because you have the source code), you can use a native compiler and AROS (amiga research OS) development files (includes and libraries) You'll get a Linux executable but with AROS OS simulation layer. You may stumble into endianness issues but since your question was "can I emulate AmigaOS ...


4

In 1978 Dann McCreary created an 8080 Simulator for the 6502 which ran on the Kim-1. Roßmöller used his code in their CP/M Emulator for the C64.


4

The Commodore 64 hosted a number of pure software emulators back in the day: Commodore itself published a Commodore PET Emulator, written by Bob Fairbairn and bearing a copyright date of 1982. The program reconfigures the C64 to act like a 40-column PET 2001, including the memory configuration and sound. According to the manual, "machine language ...


4

Since you mentioned PCem, consider 86Box. It's what I've been using; unfortunately it doesn't have Linux version so I need either a dual-boot or a VM. 86Box is a low level x86 emulator that runs older operating systems and software designed for IBM PC systems and compatibles from 1981 through fairly recent system designs based on the PCI bus.


4

I know you said 286+, though I think the list would be incomplete without mentioning PCE. It performs full emulation of IBM PC/XT (8088) hardware that implements the chipset/ISA using the actual BIOS images of the PC, video cards and hard drive controllers. I believe it does aim to do cycle-accurate hardware emulation too. It is an actively maintained ...


3

There's a number of (pure software) ZX Spectrum Emulators on the Sinclair QL if you count that as an 8-bit machine (quite obvious, as many QL owners were upgrading from a Spectrum), and there is a combined hard-/software emulator of the same ZX Spectrum for the Enterprise 64/128 computer.


Only top voted, non community-wiki answers of a minimum length are eligible