This commit introduces preliminary Atari 2600 emulation.
In the current state, many games are working but with the following caveats
1. Only a small subset of mappers are supported
2. The TIA isn't cycle accurate yet; many games have rendering and/or collision issues.
There is currently little-to-no reason to use this over other Atari 2600 emulators at this time,
but the goal is to eventually have cycle-accurate atari emulation.
The exact behavior of the freeze bit hasn't been investigate yet, but
at the very least it stops the RDP command engine. This PR does a
basic approximation of it, pending more in-depth tests.
Fixes Banjo-Tooie.
It looks like address exceptions and TLB exceptions always set the
same registers (though some are marked as undefined in the manual), so
we unify the two implementations.
Fix several tests in n64-systemtest.
There's a big confusion in the CPU core between virtual and physical
addresses, and we have been fixing many bugs around this. Now that the
situation seems stable, do a big sweep and rename all "address" variables
to "vaddr" when they refer to a virtual address, to simplify reading
the code.
"address" is kept for physical addresses, which is consistent to the
rest of the code outside the CPU that only talks about physical
addresses anyway.
No functional changes.
This commit do further fixes 64-bit addressing. In 64-bit mode, the bus
addressable range is 2Gb (instead of 512Mb), so we need to mask
appropriately all physical addresses.
Fix several tests in n64-systemtest.
This begins improving the RDP status bits to more accurately reflect
what it can be seen on real hardware. It also undoes a hack for RDP
freeze that was allowing Banjo-Tooie to boot. Being a game-specific
hack, I think it is better to simply disable and wait until we find
out how to properly fix the game.
Fix a few new tests in n64-systemtest.
This one is the weirdest. The current implementation is unrolled, but
I can't find a pattern that works. Surely there must be one as the
hardware doesn't surely have a lookup table. Anyway for now this
implementation is completely accurate, albeit verbose.
Fix one test in n64-systemtest
On real hardware, LWL/LWR execute a SysAD 32-bit masked read. Ares
was emulating them with one or multiple shorter accesses, which is
not the correct behavior wrt RCP hardware registers and PI bus area,
where the RCP incorrectly ignores the access size causing several bugs.
After this commit, LWL/LWR always do a 32-bit access on the bus, which
makes sure that we replicate the exact behavior.
SWL/SWR have a similar problem but harder to fix, because the SysAD
bus can do 24-bit writes, which is not something that Ares memory
functions support. So that's for another day.
This fixes a bug in mame RDP with respect to scissoring: the upper X
bound is inclusive in copy and fill modes (and exclusives in the others).
This seems another bug in Mame's refactorings that doesn't appear
in upstream angrylion, given the fact that both cen64 and parallel-RDP
emulates this correctly.
Also adding in protection against another bad shift case. Can't use the same code here though... could avoid the branching if it can be safely assumed _addressBits is always at least 3
329a8c9 had a bug: it moved the queue.insert line *after* dmaWrite;
but dmaWrite updates the io.writeLength to its post-transfer status,
so the calculated timing was incorrect.
Fix the regression in Cruisin' Exotica and possibly others.
Luckily enough, n64-systemtest triggered an interesting bug in our
RSP recompiler: a hash collision of the IMEM contents. The used hash
is objectively very poor so a collision is well possible.
Switch to CRC32 that should be enough to our scope.
The idea of doing a full IMEM hash is probably a bit weak to begin with,
but that's for another time.
Fix a new test in n64-systemtest (that only failed because of this).
This change implements RSP DMA double buffering in a more faithful
way, so that reads from the registers always return the current values
(ongoing transfer or finished transfer) rather than the pending ones.
Moreover, this also makes Ares transfer bytes in background a row at
a time, rather than all of them at the end. It is a bit more accurate,
and it was also easier to implement in the new architecture.
This also fixes several tests in n64-systemtest.
Ares used to have full 64-bit TLB support but it was removed at some
point because of some wrong testing that apparently made us believe
that the CPU didn't support that mode. It will have to be restored from
the git history in the future, though it's not very urgent because
nobody is using 64-bit pointers on N64 (there is no toolchain with
64-bit pointers, nor it seems useful).
Luckily, at least the segment parsing was left in and just commented out.
This allows to pass the last two remaining tests in n64-systemtest.
761d48d2b Improve constant generation
1f32a9f23 Implement fpu operations for RISC-V
ad99f17a9 Improve x86 float compare
fb55788d0 Initial implementation of RISC-V port
7f08de6ff Improve jump code generator on MIPS
469c61db9 Improve mips code generator
a4e8e34ef Support unsaved registers on s390x
f404f3608 Support unsaved registers
88d4778b9 Add license file
160b6f99d windows: fix building in arm64 with clang (#126)
022482eeb wxexec: officially drop support for EOL NetBSD < 8 versions (#124)
beda74f07 Support reworked floating point compare on s390x
050215b22 Remove unnecessary checks
6b950049d Improve floating point compare.
6ace72c90 windows: allow building with MinGW64 gcc/clang (#125)
186b07064 mips: avoid sign conversion warnings with clang (#122)
e0b17f5a6 macos: fix recent regression breaking build in macos/arm64e (#121)
68d9b4bac misc: mostly to avoid warnings (#120)
76330309a Update s390x.
6807c7a8f Remove SLJIT_NEG.
ca530a4a7 Readd carry flag support.
5f60134b5 s390x: be explicit about cache coherence needs (#119)
75a555604 power: avoid bogus clear_cache builtin in gcc >= 10 (#118)
1448ef97c sparc: avoid NOP implementation for clear_cache with gcc (#117)
ad69ad87b sparc: build fixes (#116)
47646b943 Support incoming arguments in scratch registers for s390x.
4fbdd6953 Support incoming arguments in scratch registers.
86ebfbd50 Rework x86-32 function prologue/epilogue.
2f8cf7a08 Increase the number of floating point registers on ppc, mips, and sparc.
2737606ee Increase the number floating point registers on s390x.
03469c8e1 Rename tail call to call return and minor ARM improvements.
7cb8a5c24 Increase the number floating point registers on x86 and ARM.
b35ab5e7e Implement fpu support on s390x.
dcc8fc149 misc: fix -Wextra related errors (#114)
92fcb0fe5 Fix fallthrough errors.
d345a64b3 misc: build/documentation fixes from recent changes (#113)
ff6ec4f74 Implement tail call on MIPS.
eed28632f Implement tail call on ARM.
d7793570f Reduce signed comparison warnings.
30b2dcd83 Reduce value conversion warnings on s390x.
c783c1119 Reduce value conversion warnings on MIPS, PPC, SPARC.
335ee51f5 Reduce value conversion warnings on ARM.
8d0f668fa Improve value conversion warnings.
373163144 Implementing tail calls for x86.
9c8b6961b Improve argument sanity checks.
24c547b7e Swap f32 and f64 argument types.
7f0afb25e Rework function argument list descriptor macros.
585ac42bf Implement four argument support for emit enter.
b5e0b1234 Improve mov32 operation.
433294658 Fix incorrect function call (#112)
cf594d74d Change SLJIT_I32_OP and SLJIT_F32_OP to SLJIT_32.
ae5fff841 Improve arm code generator.
43538b877 Replace SLJIT_UNUSED with appropriate function calls.
git-subtree-dir: thirdparty/sljit
git-subtree-split: 761d48d2b89a048badbd9c5cf45da75336891cfe
When an exception happen in a delay slot, it behaves the same whether
the branch was taken or not. In Ares, instead, the state "delay slot"
only applied to taken branches.
Fix several tests in n64-systemtest
These timings actually depend on the PI registers, even though they
are almost always set to fixed default values. We will get there
eventually and provide a more accurate figure, but for now this
allows to pass timing tests in n64-systemtest so that it can't be
more wrong than before.
A last minute change in 741320e0be introduced a regression in controller
input.
Similar to what we did with PI DMA, SI DMA does not go through the main
bus (SysAD bus) but directly communicate with pif and rdram. This is not
just for the sake of correctness, but SysAD bus half-word writes are
now emulated with the same brokeness they have on real hardware, and
obviously DMA works instead. Moreover, since SI only reads/writes
32-bit words, also switch to word access.
Currently, Ares does not model the PIF chip on its own: it looks like
there was an original mistake that conflated the PI (peripheral
interface, one of the components of RCP) with the PIF-NUS (a separate
chip, connected to SI component of RCP via a serial bus).
This refactor introduces a PIF class and moves all the related code
into it. Since the class implements the Memory::IO protocol for memory
accesses, it also fixes memory accesses with non standard sizes, as
tested by n64-systemtest.
There is a bit confusion of virtual vs physical addresses in Ares,
so dcache/icache were sometimes using a virtual address, sometimes
a physical one. This is wrong: cache is based on physical addresses
only.
Moreover, the CACHE opcode was not even going through TLBs, while it
should. So a CACHE opcode on a TLB-mapped address wasn't working before.
This bug has always been there, but was hidden by the incorrect TLB
matching logic. After fixing the logic in 0bf24b3, this bug was
uncovered.
Fixes Goldeneye.
All writes through the PI bus are actually performed asynchronous by
the hardware, and the status is reflected in the PI IO busy bit.
This commit emulates this properly, and also emulates what happens while
the busy bit is set: further writes are ignored, and reads at any
address return the word being written.
This fixes A Bug's Life and Toy Story 2.
This is a revert of 56458d5b, while keeping b7f96b7109 which is the
real fix that should have been done all along. The former just papered
over the issue and actually introduced a regression (Goldeneye wouldn't
boot).
Co-Authored-By: remutro <[email protected]>
Also take the chance to remove the "hopefully accurate but then not
really" implementation which runs after every instruction in favor
of a real random.
Fix one test in n64-systemtest ROM.
PC register in VR4300 is 64-bit but there were many places where
the register was incorrectly treated as a 32-bit one, effectively
discarding the higher half.
Fix several tests in n64-systemtest ROM.
To get clean makefile targets working robustly under a Windows command
prompt, allow the entire contents of obj/out directories to be deleted.
They are now recreated by the build as needed.
Replace uses of Bourne shell commands (cp, mkdir) with shell-agnostic
versions that work from a Windows command prompt. Some Bourne shell
commands still remain in macOS and Linux specific makefile lines.
using `type` results in compiler warnings: `warning: result of comparison against a string literal is unspecified (use an explicit string comparison function instead)`
Was informed by merryhime that `typeStr` was probably intended.
The N64 core was forcing -msse4.2 for compilation of the whole Ares.
On host PCs without SSE 4.2, Ares would crash at startup with SIGILL
because GCC used SSE 4.2 instructions even in hiro, while building up
the UI.
RSP SIMD emulation requires SSE 4.1, but the solution here is to
fallback to SISD if SSE 4.1 is not supported. This can be checked
with a predefined macro, that will be set by GCC. We do compile with
-march=native, so this will reflect the host PC of the build process.
For non-local builds (eg: official CI builds), default to nehalem
(Core 2) which is the first architecture with SSE 4.1.
Since this is yet another compile-time flag that affects the N64 core
performance, add a status message warning if SIMD is disabled.
Fixes#193
This is because C-BIOS has significant compatibility issues, including
the ability to boot any software that uses BASIC.
The MSX2 emulation is still too preliminary to be able to boot the
official bios, so msx2 will continue to use C-BIOS for the time being.
Replace the large, inner circular dead-zone of the N64 control stick with a small, inner square dead-zone; separate the inner and outer dead-zones; attach the scaling equation to the outer dead-zone; fixes https://github.com/ares-emulator/ares/issues/86 .
Nintendo 64 homebrew community is standardizing on a convention to
declare the save memory type as a header flag. This convention has been
first introduced by EverDrive 64 as a way to handle games not present
in their DB, but it's been since adopted by libdragon as well.
With this commit, Ares will automatically configure the correct savetype
for homebrew ROMs using the special header flag.
This is implemented via a 'keyboard capture' hotkey; this ensures that
users can switch between keyboard & gamepad emulation, even if they have
no physical gamepad.
When keyboard capture is enabled:
- All non-hotkey key-presses are translated and dispatched to the guest
- Virtual GamePad Inputs that are mapped to Keyboard no longer trigger
- Virtual GamePad inputs that are mapped to Mouse or physical GamePads work normally.
Nearly all state is initialized to a fixed or random value during
power-on, though a few things are deliberately left alone on soft reset.
A handful of fields weren't being initialized at all, save for the zero
initialization that occurs during process creation. This state would be
persisted from one ROM load to the next.
This fix is intended to address 32x PWM audio eventually going silent
after switching between multiple roms.
- vtick() shifted; can't be any later w/o breaking due to render alignment
- vblank flag update moved to vtick(); also updated on v28/v30 switch (per ekeeke's note re: Kabuto's findings)
- corrected apu irq timing
- readded extra refresh slot when display is disabled (confirmed after latest timing fixes)
ares v127 brings significant improvements to Mega Drive and Nintendo 64
emulation, as well as improvements to NES / Famicom and SNES / Super Famicom.
Other than the usual emulation improvements, there have been the following notable
changes:
**Apple Silicon Support**
ares v127 fixes the recompiler for aarch64 architecture, meaning that it is now
possible to create Apple Silicon/M1 native builds, without relying on Rosetta
and without losing support for the high performance JIT recompilers.
In order to be Apple Silicon Native, it is currently required to compile ares
from source code as automated builds have not yet been configured, but users
who wish to do so will no longer lose functionality or suffer poor performance
as a result.
**MAME RDP**
ares's Nintendo 64 core uses paraLLEl-RDP by default; this brings fast and
accurate RDP emulation as long as Vulkan is present on the users machine; this
meant that Nintendo 64 emulation was completely broken for all configurations
without Vulkan support, including macOS.
ares v127 adds support for MAME's RDP implementation as a fallback, allowing
Nintendo 64 emulation to be used when Vulkan is not present. This is handled
automatically, however, a new option has been added to video settings to allow
Vulkan support to be toggled, giving all users the ability to test the MAME
RDP, if they wish to do so.
Although MAME RDP is now an option, paraLLEl-RDP is still the recommended
choice, for both performance and accuracy.
**Pixel Accuracy Mode**
ares has contains two implementations of some of our emulated hardware; one
optimised for performance, and another optimised for accuracy.
Historically, the choice of which path to use has never been exposed to the
user; higan *always* used the 'accurate' profiles, with ares always opting for
the 'performance' profiles; any user wishing to change this would be required
to compile ares themselves from source.
As of ares v127, we now provide a new option in the emulator settings: "Pixel
Accuracy"; when this is enabled, any emulator core that supports a pixel
accurate mode will use it.
For 99% of games, the default fast profiles will be sufficient, but enabling
"Pixel Accuracy" allows games that require mid-scanline effects, such as the
infamous "Air Strike Patrol" to function properly.
The following systems are currently support the Pixel Accuracy setting:
* NEC - PC-Engine / TurboGrafx
* Nintendo - Super Famicom / SNES
**Changelog:**
* desktop-ui: hook up pc-engine 6-button pads to virtual pads [Luke Usher]
* desktop-ui: implement frame advance [Luke Usher]
* fc: add bus conflicts to cnrom [encoded-byte]
* fc: check for ram on mmc1 [encoded-byte]
* fc: check if ram exists on mmc3 [encoded-byte]
* fc: clear oam address on each scanline [encoded-byte]
* fc: improve mmc3 irq behavior [encoded-byte]
* fc: improve ppu skipped clock timing [encoded-byte]
* fc: use hkrom for mmc6 [encoded-byte]
* m68000: allow recovery from zero divide [TascoDLX]
* m68000: reimplement DBcc instruction with correct timing[TascoDLX]
* md: A few fixes to SRAM save game [rasky]
* md: correct overscan / output when display is off [TascoDLX]
* md: correct reads of CRAM and VSRAM [rasky]
* md: detect region 'K' as NTSC-J [invertego]
* md: fix APU port in [rasky]
* md: fix debug register sprite masking [rasky]
* md: fix high bits in control port read [rasky]
* md: fix misaligned reads from VRAM [rasky]
* md: fix register masked write in mode5 [rasky]
* md: fix vblank bit toggling horizontal timing [rasky]
* md: fix VSRAM out of bound accesses [rasky]
* md: ignore erroneous device string used by Codemasters [invertego]
* md: implement undocumented VDP VRAM 8-bit reading mode [rasky]
* md: persist VDP state on reset [invertego]
* md: restore vdp free slot lost to refresh [TascoDLX]
* mia: Correct save type for Premier Manager 64 (N64) [sp1187]
* mia: Correct save type for Transformers: Beast Wars Transmetals (N64) [sp1187]
* mia: correct type for pak attribute [encoded-byte]
* mia: fix 32x sram [Luke Usher]
* mia: properly pass MD eeprom details to ares [Luke Usher]
* mia: updated famicom database [encoded-byte]
* mos6502: add illegal nops [encoded-byte]
* ms: correct overscan inc. dynamic screen resizing [TascoDLX]
* n64: add MAME RDP as a fallback for parallel-RDP [invertego]
* n64: allow vulkan to be disabled [Luke Usher]
* n64: change PI DMA to use 16 bit fetches [CasualPokePlayer]
* n64: fix mult/div opcode timings [rasky]
* n64: fix RSP halt condition to be more accurate [rasky]
* n64: fix several RDP regressions [invertego]
* n64: fix small bug in VMACQ [rasky]
* n64: fix SRA/SRAV opcodes [rasky]
* n64: fix vulkan detection [Luke Usher]
* n64: improve rsp recompiler pool allocation [invertego]
* n64: swap RSP/RDP order [CasualPokePlayer]
* n64: templatize rsp vpu [invertego]
* n64: vulkan tweaks [Luke Usher]
* nall: fix many compilation warnings on macOS [Luke Usher]
* nall: fix page protection on Apple silicon [invertego]
* nall: rewrite recompiler for machine-independence using sljit [invertego]
* pce: runtime pixel accurate VDP setting [invertego]
* sfc: fix horizontal off-screen test for sprites [jbo-85]
* sfc: fix missing sprite tile on Super Conflict title screen [jbo-85]
* sfc: fix missing sprites in Jurassic Park that are partly offscreen [jbo-85]
* sfc: runtime pixel accurate PPU setting [invertego]
* sh2: move registers into POD struct [invertego]
Some systems in ares contained two implementations of video hardware;
these systems were Mega Drive / Genesis, Super Famicom / SNES, and
PC-Engine / TurboGrafx 16.
For the Mega Drive, we switched to the accuracy core quite some time ago,
SNES and PC-Engine we were still using the performance core.
Going forward, we wish to only maintain the accuracy focused renderers.
VDP always writes transparent pixels to the internal sprite buffers,
overwriting previous transparent pixels; then the first non-transparent
pixel sticks and wins. This implementation detail only reveals itself
when sprite plane masking is activated using the VDP debug register:
in that case, the palette number of transparent pixels concurs in the
AND of the visible pixels, and thus the correct palette number should
be found in the buffer.
Fixes the logo effect of Overdrive 2 (ref #255)
After more analysis, it looks like the correct thing to do is to
check for vblank status on most of the raster line. Kabuto's doc says
that it is possibly to switch from V30 to V28 during line 224 and
still see the vblank triggered, which suggests that the hardware does
actually check it on most of the time.
This seems to fix#402 and does not seem to cause any immediate
regression in timing-sensitive ROMs.
Currently, the vblank bit is turned on/off at the same time vcounter
is incremented, which is a reasonable assumption, missing any real
data on this.
But it turns out this is responsible for most of the breakage of
Overdrive 1. I did some tests and it looks like anything in the
range >= 0xF0 (same line), or <= 0x80 (on next line) fixes those bugs.
I decided to bind it to vedge(), which means that vblank bit now is
triggered the same instant that VINT is raised, which also makes sense
when you think of it.
Updates #212
VRAM misaligned addresses were implemented with partial slot reads.
This seems to be wrong, as proven by vdpfifotesting: once the slot is
read, the whole word is invalidated.
VSRAM is actually made of 40 11-bit words, though the chip only accesses
the first 10 bits. The top bit on each word is still readable and writable
though, so they should be emulated.
Also, reading at addresses >= 40 returns a copy of the first word,
rather than 0.
Mode5 (SMS compatibility mode) is unsupported and mostly undocumented,
but the vdpfifotesting ROM at least checks one know behavior: non-SMS
registers can't be written.
Bits 10-15 in control port read (aka status register) are not fixed
as found in some online docs, but they are actually an open bus
that returns the instruction prefetched by m68k at that cycle.
* Allow MIA to declare address for mapping (typically from ROM header)
rather than hardcoding 0x200000.
* Autoenable SRAM if the ROM size is smaller. Also make the ramEnable
I/O conditional to the same layout.
* Add MIA entries for NBA Live 98, NHL 96 and NHL 98, which have a 8-bit
SRAM not declared in the header.
Using the read<Byte> currently in use breaks DMAs from Flash (breaking Paper Mario, probably others), which always return 0. I assume 8 bit reads are just not allowed for Flash, although I can't verify this myself.
Checking https://github.com/n64dev/cen64/commit/8367698e20cca7eb262779f19c8c7847ae31bb29, it seems that fetches should always be 16 bits anyways, so I presume this is the correct behavior, and fixes DMAs from Flash.
No regressions with the original testrom have occured.
- introduce a status api, so cores can report status messages to the UI
- avoid calling vulkan-related functions when vulkan is disabled
- show status messages so the user is aware of what RDP implementation is active
- Disabled 'loaded' status message, it prevented the Vulkan messages being shown
Update the stack base and limit in the thread information block. This is
required to support kernel stack unwinding, which is used for both C++
exception dispatch and setjmp/longjmp on Windows x64 and ARM64.
Add a cothread entry routine that consistently aborts when the user
supplied routine returns. Debugger stack backtraces now stop
consistently at this entry routine.
The Korean release of Tiny Toon Adventures specifies its region with a
'K' and, like several other Korean releases, is region locked to
Japanese consoles. It may be the only one with a 'K' specifier, though.
Taken from NEC VR4300 manual. These are easier than expected to
implement accurately as the CPU doesn't execute them in parallel but
stalls the entire pipeline while they are running.
Real hardware testing showed that VMACQ does not modify the accumulator
if it is exactly zero. Fix it.
Also remove two "unconfirmed" comments which I have personally verified.
* Fix usage of break opcode in a delay slot. After unhalt, the
RSP continues execution, taking the jump if needed. So the
branch state should not be affected by the break opcode.
* Reading from SP_PC produces garbage (open bus?) when the RSP is
running. This fix is unlikely to fix game but may help homebrew
developers.
* Writing to SP_PC resets the RSP MIPS pipeline, so any pending branch
is canceled.
The existing implementation was allocating pools in the code cache only
to copy them to the heap. This was wasteful on multiple counts: the
space in the cache would go unused until the next allocator flush and
the data copied to the heap consisted almost entirely of zeroes. Best of
all, writing the hash code to the code cache was triggering a page
protection fault on Apple M1.
A small data structure refactor avoids the heap allocations, the copies,
the wasted space in the code cache, and the page protection issue.
For systems that do not meet parallel-RDP's Vulkan requirements, use the
pure software RDP implementation from MAME as a fallback.
All of the source files taken from MAME are either BSD-3-Clause licensed
or public domain. Edits were kept to a minimum and guarded by ifdefs to
ease future integrations.
- when dynamically allocating executable memory, use VirtualAlloc/mmap()
for finer control over allocation flags (like MAP_JIT on macOS/arm64)
- toggle JIT memory protection around writes on macOS/arm64
- reduce recompiler code cache sizes to improve likelihood of dynamic
allocations being close to ares image (affects branch perf)
- remove arch x86_64 override on macOS non-local builds; native arm64
builds should now be at feature parity with x86_64
- sh2: prevent pollution of code cache with empty pools by invalidate()
Games tested so far. Two new not working games discovered:
- Aladdin (Europe): Hangs after starting game
- Wizards & Warriors (Europe): Graphicals glitches on HUD, severe slowdowns. PAL timing related?
For some users, this gives a dramatic performance boost, and finally
brings the Windows builds in-line with Linux/Mac builds in terms of
performance.
This technically goes against the Win64 ABI, which demands that SSE
registers are saved, however, in-practice, our testing has shown that
this has not caused any issues so far.
On Windows, track WM_SETFOCUS and WM_KILLFOCUS messages to determine
focused status rather than polling with GetForegroundWindow(). The
latter involves a syscall and causes noticeable slowdown when called
repeatedly, such as when GameBoy games poll joypad status in a loop.
Fix unloading systems with light gun peripherals active. The code
responsible for removing crosshair sprites was dereferencing a null
pointer. This cleanup now occurs in Screen::quit() when unloading.
Instead of just reading the first file from a zip archive, prefer files
that match known rom extensions. Extra files such as readmes should not
interfere with the loading of the game.
Fix several correctness bugs in SH2 instructions in both the interpreter and
recompiler and switch the default implementation from the cached interpreter to
the recompiler. This brings the 32x games BC Racers and Zaxxon's
Motherbase 2000 to playable status. Fixed instructions:
Interpreter
- ADDC Rm,Rn
- ADDV Rm,Rn
Recompiler
- MAC.W @Rm+,@Rn+
Both
- CMP/STR Rm,Rn
- MOV.B Rm,@-Rn
- MOV.W Rm,@-Rn
- MOV.L Rm,@-Rn
- NEGC Rm,Rn
Improves thread-switching performance using the following techniques:
- Interleave stores/loads
- Restore the stack pointer and link register as early as possible
The calling convention specifies that d8-d15 (the lower 64 bits of
vector registers q8-q15) are callee-saved. However, libco was
erroneously saving and restoring general-purpose registers x8-x15
instead.
Ares JIT recently started to require the data segment to be executable
(see https://github.com/ares-emulator/ares/pull/200 for details on why
this was done instead of allocating a new segment via mmap).
To do this, it uses mprotect() (bump_allocator::resize), but it also
needs to tell the linker that the data segment can be upgraded to
executable with -Wl,-segprot,__DATA,rwx,rw (nall/GNUmakefile).
Unfortunately, for quite some time, the clang LD had a bug and didn't
accept that option for the data segment.
The official CI has a newer linker without the bug, but for developers
compiling ares with an old toolchain, this small tool will patch the
binary to mark the data segment as potentially executable.
This change upgrades GCC from the version preinstalled by GitHub Actions
(8.1.0) to the latest MSYS2 version (10.3.0). It also adds a
Windows/Clang build configuration, though the release job still
grabs the GCC build.
ares v124 brings the compatibility rating for the Famicom and Nintendo 64 cores
up to three stars. This means that at least 80% of the game library is working.
There have been notable improvements to Game Boy, Mega Drive, Sega Mega CD,
Sega 32X and Nintendo 64 emulation, and the PC-Engine multi-tap is now supported.
Finally, the dynamic recompiler now generates slightly more efficient code. You
may notice a slight performance boost in Nintendo 64, Sega 32X and Sony
PlayStation.
**Changelog:**
* Famicom: Add support for Jaleco JF11/JF14 mapper [Shideravan]
* Game Boy: Bring fast-boot closer to normal boot; Fixes Dr. Fraken [invertego]
* Game Boy: Use stable sort for sprites; fixes speech bubbles in Crayon Shin-chan 3 [invertego]
* Game Boy: Remove limit on window width; fixes pause screen in Heiankyo Alien [invertego]
* Game Boy: Emulate serial transfers with no link; fixes input in Alleyway [invertego]
* Game Boy: Improve handling of LCD/BG enable for DMG; fixes Hyper Lode Runner [invertego]
* Game Boy: Resume from halt whenever (IE & IF) != 0; fies Amazing Penguin [invertego]
* Mega Drive: Fix DMA transfer rate and H-Int signalling; fixes Another World, 3 Ninja's Kick Back, Virtua Racing, Burning Force [TascoDLX]
* Mega Drive: Fix sprite masking and overflow; Fixes Mickey Mania [TascoDLX]
* Mega Drive: Fix DMA fill; Fixes Demons of Asteborg [TascoDLX]
* Mega Drive: Fix VRAM byte addressing; Fixes Contra Hard Corps, Musha [TascoDLX]
* Mega Drive: Fix VDP control port writes [TascoDLX]
* Mega Drive: Implement HV Counter Patching [TascoDLX]
* Mega Drive: Implement STOP instruction; fixes Thunder Force IV [TascoDLX]
* Mega Drive: Default to 3-button gamepad; fixes games that don't support 6-button pads [Shideravan]
* Mega Drive/Mega CD: Fix detection of device rom header; allows Mode-1 to work [Luke Usher]
* Mega CD: Fix word-ram 1M access pattern; Fixes Lethal Enforcers II [TascoDLX]
* Mega CD: Fix H-Int vectoring; Fixes Microcosm, Silpheed, Wing Commander, and others [TascoDLX]
* Mega CD: Implement full graphics/1M wordram translations; fixes Rebel Assault [TascoDLX]
* Mega 32X: Tighten M68k sync; Fixes Kolibri and Fifa 96 [TascoDLX]
* Neo Geo Pocket: Fix off-by-one error in LDAR instruction; fixes a crash in SNK Gals' Fighters [invertego]
* Nintendo 64: Support controller ports 3 & 4 [LukeUsher]
* Nintendo 64: Better Flash Ram support; Fixes Majora's Mask, Paper Mario, Derby Stallion 64 [jeltaqq]
* Nintendo 64: Add mempack/rumble status to database; eliminates controller pak/rumble pak warnings [remutro]
* Nintendo 64: Consume cycles to compensate for skipped RDRAM initialization; fixes Wave Race 64 Shindou Pak [invertego]
* Nintendo 64: Fix PIF RAM init on cold boot, preserve RDRAM on warm reset; fixes Perfect Dark boot [invertego]
* Nintendo 64: Default to 3 controllers for Jeopardy!, this game doesn't work with 4 controllers, even on hardware [invertego]
* Nintendo 64: Fix FPU compare and divide exceptions; Turok is now able to play the entire Acclaim logo animation [invertego]
* Nintendo 64: Decrease SI DMA delay; improves Turok, Donkey Kong 64, Forsaken 64, Hercules, Triple Play 2000 [invertego]
* Nintendo 64: Implement perfect PI DMA write [rasky]
* PC Engine: Support Multi-Tap [LukeUsher]
* TMS9918: Widen vcounter to 9-bits; improves ColecoVision, SG-1000, MSX [invertego]
* desktop-ui: Support up-to 5 virtual controllers (For PC-Engine) [LukeUsher]
* desktop-ui: Fix window background with GTK3 [ghisvail]
* desktop-ui: Install icons in freedesktop compliant locations [ghisvail]
* desktop-ui/hiro: Improved macOS user experience [LIJI32]
* ruby: Fix conflated keys on Windows; fixes some keyboard input issues [invertego]
* nall: Use XDG base directories on *nix systems [ghisvail]
* shaders: Include a selection of public-domain shaders [LukeUsher]
* ares: Fix address masking in instruction tracer [invertego]
* ares: Fix warnings reported by clang [invertego]
* ares: Fix static init in node subclasses [invertego]
* ares: Use 64-bit integers instead of 128-bit integers in the scheduler [invertego]
* ares: Use IP relative direct branches in the recompiler, where possible [invertego]
* ares: Emit only one epilog per block in the recompiler [invertego]
* ares: add label API to recompiler to simplify branches [invertego]
* ares: Use fixed BSS allocation for code cache; improves recompiler performance [invertego]
* ares: Fix instructionEpilogue test [invertego]
* ares: Directly emit code for target ABI; generates more efficient code in the recompiler [invertego]
* ares: Avoid encoding absolute data addresses in the recompiler [invertego]
* nall: allow mingw headers to define _MSVCRT_VERSION_ [invertego]
* nall: generate PDB when building with clang on windows [invertego]
* nall: allow generation of debug symbols with symbols=true [invertego]
* nall: link with lld wen building with clang on Windows [invertego]
* nall: Make thread movable but not copyable; fixes random UI hangs on Windows [invertego]
* mia: Fix MSU-1 rom loading [Luke Usher]
Reference data members via offsets from nonvolatile registers instead of
directly encoded absolute memory addresses. This is the last change
required for generated code to be fully position independent.
The reduction in code size is generally 5-7%, with the exception of the
N64 RSP, which sees a reduction of nearly 40%. This is mostly a result
of moving the clock increment to instructionEpilogue().
Previously, the recompilers in ares would assume the System V calling
convention, then emit extra moves on Windows to handle the differences
in register usage. Now, they directly populate the registers used by the
target system for passing parameters to functions. This is achieved
with register aliases set for the appropriate ABI at compile time.
Furthermore, registers that are nonvolatile only on Windows - rsi and
rdi - are no longer used as temporaries, removing the need to save and
restore them in recompiled code blocks.
This accounts for roughly a 10% reduction in recompiled code size on
Windows while making functionally no difference to other systems.
The thread class owns a resource and should have semantics akin to
std::unique_ptr. By allowing copying, the Windows implementation was
calling CloseHandle() when the original copy was destructed, meaning the
new copy would have no actual ownership of the handle. Once the thread
itself exited (dropping the last reference on the handle), later uses of
this handle in join() and ~thread() could end up operating on anything
or nothing depending on whether the handle value had been recycled.
This change modifies the POSIX implementation just enough to keep the
semantics the same as the Windows implementation for users of the class.
Otherwise, there is no functional change.
This fixes random UI hangs and other bad behavior on reset or unload.
instructionEpilogue() returns a bool, but all recompilers were
performing a 64-bit test on the return value. If sizeof(bool) == 1, only
the bottom 8 bits are guaranteed to be valid.
Place code caches in the bss section to guarantee proximity to the text
section in order to improve branch prediction and eventually so we can
reliably utilize IP-relative branch instructions.
There is now a fixed 1 GB buffer that is shared by all system cores with
recompilers (m32x, n64, ps1). Because the linker will place it in bss,
it will consume no space in the executable on disk, and operating
systems should be clever enough to avoid comitting physical pages until
it is actually in use. The buffer is defined in a separate translation
unit and only referenced from under compile-time recompiler checks, so
it should be left out by the linker when recompilers are disabled.
And defaulting it, as some older games depend on it to this kind of input to work properly.
eg.: Forgotten Worlds
https://youtu.be/ngHDIFQHFyQ
This also solves https://github.com/higan-emu/ares/issues/177
Fighting pad is still supported just need to be selected in Mega Drive->Controller Port
Currently ares is using 128-bit counters when the built-in __int128 type
is available. Near's notes on this topic conceded that it wasn't really
necessary, but defended it by stating there was no speed penalty on
64-bit architectures.
Unfortunately, LLVM's 128-bit integer support is buggy when compiling
for Windows targets. I've filed a bug report and am optimistic this will
eventually be fixed, but to prevent people from being burned when
compiling ares themselves, it would be safer to avoid the built-in
__int128 type entirely.
This change imposes 64-bit counters on all architectures for
consistency. It redefines the nall (u)intmax types to match the standard
(u)intmax_t types, though there is no longer anything in ares using them
at the moment.
This commit implement perfect PI DMA write. The PI DMA is normally used
for 8-byte aligned transfers, which is where it constantly works. The
hardware does contain a half-baked, buggy support for 2-byte aligned
transfers and odd-size lengths. I have extensively investigated the
behavior of every single quirk, and produced a test ROM that Ares
passes after this commit (timing is still off, but that's for another
day):
https://github.com/rasky/n64_pi_dma_test
The implementation is the same that I've previously submitted to cen64,
adapted for the ares codebase.
Whatever defining this manually was intended to fix, today it is only
breaking things. The mingw headers define this as 0x700 if you are
linking against MSVCRT and 0xE00 if you are linking against UCRT. This
is a mingw-internal macro, and there is currently no comparison in the
headers that evaluates differently for 0x601 than for 0x700. However,
always forcing it to 0x601 as nall does breaks linking against UCRT.
We should let mingw define this appropriately.
When building with clang, two static inline members of Node subclasses -
identifier and register - were not consistently initialized in that
order during application startup. Because the constructor of register
depends on identifier, this poses a problem.
I'm not sure if clang is on the wrong or if the initialization order is
actually unspecified by the language standard, but this situation can be
easily avoided, so I opted to do just that.
These warnings can often catch genuine bugs. The only tautological
compare warning I observed was reporting a real bug in the SFC core. The
shift count overflow warnings appeared to be for cases that were benign,
though only because I already fixed a significant one in the instruction
tracer. In general, such shifts are undefined behavior and require
surrendering to the whims of the compiler and the processor
architecture, so they are worth avoiding.
The large diff in ares/component/processor/tlcs900h/instruction.cpp is
mostly uninteresting. I had to make the control flow more explicit for
undefined instructions to stop the compiler from complaining about bad
template specializations. While I was at it, I enabled unused-value
warnings for that file, which only required adding a few void casts.
Most of the warnings are from Windows specific code, as the rest of the
codebase is already fairly clean. This change fixes a couple of (benign)
bugs discovered by these warnings.
In hiro/windows/action/menu.cpp, menu-item.cpp:
A function pointer was being passed in place of a bool argument to
nall::image::scale(). At one point the name Interpolation::Linear
referred to an enum. In any case, the argument in question defaults to
true - specifying linear interpolation - so it is unneeded.
In hiro/windows/widget/widget.hpp:
The function minimumSize() was being overloaded instead of overridden
due to a missing const qualifier. It doesn't appear to have had any
negative side effects in ares.
This change corrects masking for 32 bit addresses.
Per the C++ standard on shift operators: "The behavior is undefined if
the right operand is negative, or greater than or equal to the width of
the promoted left operand."
Reduce the (minimum) number of cycles between an SI DMA request and the
completion of said request from 131072 to 2304 cycles. This is the
duration used in other emulators, and it is in agreement with the
observed behavior of Turok, which can only tolerate a delay between 215
and 3888 cycles (subject to current timings in ares).
In addition to fixing input in Turok - Dinosaur Hunter, this change gets
the following games past the intro:
- Donkey Kong 64 (w/ major graphical issues)
- Forsaken 64
- Hercules - The Legendary Journeys
- Triple Play 2000
On compare to NaN:
- do not raise an exception if exceptions are disabled
- do not update the csr condition bit if exceptions are enabled
On divide by zero:
- do update the destination fpr if exceptions are disabled
For both of the above:
- do set the csr cause bit
- do set the csr flag bit if exceptions are disabled
Turok is now able to play out the entire Acclaim logo animation. It was
previously resetting due to erroneously raised invalid operation
exceptions.
Jeopardy! only supports up to 3 players, and if four controllers are
plugged in when the game starts, it performs an out of bounds array
access that breaks further input logic. The only workaround is to unplug
a controller and reset the system. To make this game work well in ares
out of the box, we should connect no more than 3 controllers by default.
I opted to put a check specifically in desktop-ui because this is
fundamentally a mismatch between a specific game and a design choice (to
default to 4 controllers) in the desktop-ui frontend. It didn't feel
right to add a dedicated attribute to mia that did not describe a
feature of the cartridge itself and would not be generally applicable
other games (unlike rumble and memory pak support).
This change also brings the rumble and memory pak attributes in line
with the implementation of boolean attributes for other systems. There
is no functional change, though it will affect generated manifests if
they are/were persisted to disk.
A recent workaround for BattleTanx caused a regression in Perfect Dark.
Essentially, it was always telling games that they had been started by a
warm reset rather than a cold boot. Perfect Dark expects data to be
preserved in RDRAM across resets and fails to get as far as drawing
something on the screen if it isn't there.
This change reverts the workaround so that Perfect Dark will perform the
full initialization required after a cold boot. Luckily, this will not
regress the BattleTanx games, as they were fixed by my last change
(making sure IPL3 consumes a sufficient number of cycles). This change
also skips clearing RDRAM on resets, which is again required by Perfect
Dark and possibly other games.
The RI_SELECT register is read by IPL3 to check if RDRAM initialization
should be skipped. If we are forcing it to be skipped, we should also
consume enough cycles to not inadvertently speed up the boot process.
Wave Race 64 Shindou Pak Taiou Version will freeze on the N64 logo if
the SCC count register, which increments at half the CPU clock rate, has
too small a value.
The idea of using RI_SELECT reads as a cue to consume extra cycles was
borrowed from MAME.
Thanks to Rasky for measuring the timing on real hardware.
The flags returned by the Raw Input API have distinct meanings. The
lowest bit reflects the state of the key and the next two bits indicate
scan code prefixes. An oversimplified interpretation of these flags was
causing ruby to conflate events for keys that differ only by prefix.
Reference:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-rawkeyboard
The full set of conflated key pairs:
Return Enter
Keypad0 Insert
Keypad1 End
Keypad2 Down
Keypad3 PageDown
Keypad4 Left
Keypad6 Right
Keypad7 Home
Keypad8 Up
Keypad9 PageUp
LeftAlt RightAlt
LeftControl RightControl
Multiply PrintScreen
Point Delete
Slash Divide
The TLCS-900 manual states the loaded address is relative to the start
of the instruction plus four bytes - in other words, one byte before the
end of the instruction.
This fixes crashes in SNK Gals' Fighters.
By using an 8 bit counter, the last 6 lines of every frame were being
skipped and the VDP was firing vblank interrupts ~2.3% faster than
intended in the ColecoVision, SG-1000, and MSX.
This also fixes the corrupted turtle graphics in Frogger for
ColecoVision, though this is mostly by chance. The game is buggy and
susceptible to graphics corruption if a vblank is raised between these
instructions:
1d09 out ($bf),a ; write low VRAM address byte
1d0b ld a,h
1d0c out ($bf),a ; write high VRAM address byte
It could easily be regressed by any future change that impacts timing.
Normally, breaking out of the halt state is handled by CPU::raise(), but
there is an edge case:
; preconditions: IME = 0, IE = 1, IF.0 = 1, LCDC.7 = 0
ei
halt
In other words, a vblank interrupt was requested with IME disabled, then
the display was disabled (so no more vblank interrupts will follow),
then interrupts were enabled while entering the halt state. Once halted,
there is no logic in ares to service the requested vblank interrupt.
A better long term approach would be to refactor the SM83 implementation
of halt to be more like the Z80 core - eliminating the loop within the
halt instruction itself - but in the meantime this change offers an
incremental improvement.
This fix prevents Amazing Penguin from freezing immediately on load.
On DMG, when the LCD is toggled from off to on, the screen remains blank
until one frame after the PPU becomes operational.
Furthermore, when the BG is disabled, the window is also no longer
drawn, though the other window logic (like the incrementing window line
counter) seems to remain operational.
This cleans up the visuals of Hyper Lode Runner on level start, but many
more games will be affected by blanking the first frame after the LCD is
toggled on.
This allows for all four n64 controllers to be used, while providing
capatbility to expand to five controllers for PC-Engine, once we
implement the multi/tubo-tap
When a serial transfer is started using the internal clock and no second
device is connected via link cable, 1 bits are shifted into the SB
register. This behavior must be emulated for the game Alleyway;
otherwise, it does not accept player input.
I couldn't find any research to support this limit, nor does it match
the behavior of other emulators. Everything I could find indicates that
the window should be drawn to the end of the line.
This fixes the right edge of the pause screen in Heiankyo Alien.
On DMG, sprites are sorted by x value then by OAM address. As the sprite
array begins in OAM order, a stable sort on x can achieve the desired
result. Conveniently, nall already contains a stable sort implementation
that is optimized for small arrays.
This fixes ordering issues with speech bubbles in Crayon Shin-chan 3.
The previous fast boot patch skipped the entire Nintendo logo animation
and sound. Unfortunately, this left a number of registers with different
values than they would otherwise have. The European release of the game
Dr. Franken does not initialize SCY, and fast boot was leaving it set to
100 instead of zero, causing the first logo to be shifted offscreen.
It would be easy enough to amend the patch to initialize SCY to 0, but
for most games this will cause the Nintendo logo to appear for a single
frame, which doesn't look so great.
This new patch skips the first ~4 seconds of the boot animation and
disables scrolling but otherwise leaves things alone. The result is a
a stationary Nintendo logo that appears centered on the screen,
accompanied by the usual sound, for ~1.5 seconds.
ares v123 includes significant improvements to the emulation of the ColecoVision,
SG-1000 and the Game Boy/Game Boy Color.
This release brings the compatibility rating for ColecoVision and SG-1000 to
four stars.
This means that we have 100% compatiiblity with both of those libraries, with
the only exception being the few games that require additional peripherals
(driving controllers; touchpads, etc).
The Game Boy improvements are significant, but not quite enough to increase
the compatibility rating at the present time, even so, Many more games are
playable than before.
Finally, a few tweaks to MegaDrive emulation have improved compatibility,
reduced the occurance of video corruption, and improved performance of
the Sega 32X emulation.
**Changelog:**
* ColecoVision: Initialize ram to 0; fixes a crash in The Heist [Luke Usher]
* ColecoVision: Disable cartridge rom mirroring; fixes Sammy Lightfoot [invertego]
* ColecoVision/MSX/SG-1000: Initialize VRAM to 0; fixes various games [invertego]
* Game Boy: Check window x-coord instead of only y-coord; improves the Acid2 test rom [Luke Usher]
* Game Boy: Only raise STAT interrupt when display is enabled; fixes Cool Hand [invertego]
* Game Boy: Implement HALT hardware bug [Meepster99]
* Game Boy: Fix relationship between LY and STAT interrupt; fixes Elite Soccer, Mouse Trap Hotel, Shantae [invertego]
* Game Boy: Only trigger STAT interrupts at the start of OAM search; fixes Mortal Kombat 3 [invertego]
* Game Boy Color: Fix HDMA5 bit.7 reads; improves a significant number of GBC games [invertego]
* Game Boy Advance: Simulate standard GBA instead of Game Boy Player; fixes GBA Video titles [Luke Usher]
* Mega Drive: Implement support for Sonic & Knuckles merged roms; fixes Sonic 2K, Sonic 3K [Luke Usher]
* Mega Drive: Implement support for SRAM/EEPROM when using the SEGA Mapper; fixes Demons of Asteborg [Luke Usher]
* Mega Drive: Default to 'accuracy' VDP; improves compatibility at the expense of performance [Luke Usher]
* Mega Drive: Optimize how often the emulator synchronises between components; offsets the cost of the previous change [Luke Usher]
* Nintendo 64: Maintain Parallel-RDP as a subtree; simplifies compilation [Luke Usher]
* SG-1000: Implement support for roms greater than 32KB [Luke Usher]
* SG-1000: Implement support for Taiwan Type-A/Type-B mappers; fixes unlicensed Taiwan releases [Luke Usher]
* SM83: Fix DAA instruction [Meepster99]
* TMS9918: Implement multicolor mode; fixes various SG-1000/ColecoVision games [invertego]
* TMS9918/Master System/MSX: Allow sprites to bleed off top/left screen edges [invertego]
* ares: Rename lucia to desktop-ui to better represent it's function [Luke Usher]
* mia: Improve N64 save-type database [jeltaqq]
* mia: Add support for UNF extension, alongside UNIF and NES [Shideravan]
* nall: Add macOS deployment target flags; fixes ares on macOS 10.14 [MerryMage]
* ruby: Give PulseAudio higher priority than ALSA on Linux Systems; ALSA was causing frame-rate issues [Luke Usher]
A refactor in v116r07 replaced the variable dmaCompleted with dmaActive
but failed to update its usage on HDMA5 register reads. Bit 7 should
read 0 if HDMA is active and 1 if completed.
This change will affect many (most?) GBC games.
STAT interrupts triggered by mode 2 (OAM search) should only occur at the
start of the line. Crucially, writes to STAT in the midst of mode 2 that
enable OAM interrupts should not trigger a STAT interrupt. This is
especially important on DMG because of the hardware bug that causes STAT
writes to briefly enable all STAT interrupts. Spurious STAT interrupts
that would not have occurred on real hardware can violate the
assumptions of games that aren't expecting them. Mortal Kombat 3 is one
such game, and it is now playable.
Previously, ares was emulating the coincidence flag in the the STAT
register with M-cycle accuracy but was much less accurate with the
timing of coincidence triggered STAT interrupts or with resetting the LY
register to 0 during vblank. This was breaking a pattern common to a
number of games that goes like this:
1) Write 0 to LYC and set the coincidence interrupt enable bit in STAT
2) In the STAT interrupt handler, read LY and increment by one
3) Loop until LY equals the incremented value
ares would trigger a STAT interrupt during line 153 but LY would
continue to read back as 153 instead of 0. A game incrementing this
value and waiting for it to appear in LY would become stuck in an
infinite loop, as there is no line 154.
This change brings M-cycle accuracy to the LY register and STAT
interrupts using "The Cycle-Accurate Game Boy Docs" by AntonioND as a
reference. It also stops resetting LY on write, as this erroneously
described behavior is not hardware accurate.
The following games should now be playable:
- Elite Soccer
- Mouse Trap Hotel
- Shantae
This significantly improves performance for md, cd, 32x and cd32x, with
minimal impact on accuracy.
Assuming 3420 cpu cycles per scanline, with a max horizontal resolution
of 320/342:
For MegaDrive/Mega-CD, we can sync every 10 cycles (approx 1 pixel),
since we're using a dot renderer, there is little point in synching more
often than that.
For 32X/CD32X, we sync once every 40 cycles (4 pixels), this provides
enough of a performance boost to make 32X emulation viable for modest
machines, but does not significantly impact compatibiltiy or accuracy;
it's still significantly better than with the scanline renderer we used
previously.
This improves compatibility with both MegaDrive and 32X titles at the
expense of performance.
On modest hardware, this still retains full-speed for MegaDrive titles, but 32X and MegaCD may struggle; this will be addressed in a later
commit.
This emulation bug, combined with the intentional emulation of the
hardware bug that causes spurious stat interrupts, was causing stat
interrupts to be raised when the display was disabled.
This stops the GB game Cool Hand from freezing after selecting cribbage.
This removes the special casing for Sonic & Knuckles, treating it as a standard rom.
While not strictly correct from an accuracy/real world point of view, all existing
emulators and rom dumps assume the emulator will treat it as a single cart.
The TMS9918 allows for sprites to, in the words of TI's VDP Programmer's
Guide, "bleed" off the top or left edge of the screen. Depending on the
edge, this is accomplished by different means.
Proper implementation of this behavior is known to affect the following
ColecoVision games:
- Frogger: some sprites should be hidden off the left edge of the screen
- The Heist: the player sprite crosses the left edge of the screen
- Bump 'N' Jump: car sprites cross the top edge of the screen
It looks as though the V9938 and SMS VDP will require similar fixes.
Initialize VRAM to zero on load for systems that use the TMS9918/V9938.
On real hardware this memory will be in a partially indeterminate state,
but as far as approximations go, 0x00 is much less problematic than
0xff. A sprite attribute table filled with 0xff is interpreted to have
valid entries for sprites in the top right corner of the screen. If the
pattern data is also filled with 0xff, a white square will be drawn in
the corner. On the other hand, a sprite entry of all 0x00 bytes will be
fully transparent (due to the color byte being zero) and therefore
invisible.
This is most noticeable in games that never get around to fully
initializing VRAM, such as the ColecoVision game Boulder Dash, which has
a permanent square in the corner.
SG-1000 games only seem to exhibit this problem briefly after booting,
and only for certain games, as they eventually get around to
initializing VRAM. Some homebrew is more seriously affected.
MSX compatibility is in too poor a state to test comprehensively, but a
survey of other emulators shows initializing VRAM to zero is the norm.
This change also allows VRAM to carry over across soft resets. This
should be closer to hardware behavior, though in reality it is possible
for some bits to be perturbed.
ColecoVision carts contain up to 4 separate 8 KiB banks, and there is no
mirroring when some banks are absent. The existing mirroring behavior
was causing Sammy Lightfoot to freeze on load.
This release primarily provides improved Neo Geo Pocket/Neo Geo Pocket Color and Sega 32X emulation.
The entire Neo Geo Pocket/Color library is now thought to be playable, with minor graphical issues in four titles.
A small number of SEGA 32X games are now playable, although most still experience graphical and/or audio issues.
Changelog:
ColecoVision: Clear top bit of controller port reads; fixes Defender [invertego]
Neo Geo Pocket: Allow BIOS to handle the boot process [invertego]
Neo Geo Pocket: Copy SNK logo from BIOS during fast boot; fixes Metal Slug: 2nd Mission [invertego]
Neo Geo Pocket: Fix address used to test ram initialization [invertego]
Neo Geo Pocket: Initialize Neo Geo Pocket port 1 to zero; fixes Dynamite Slugger [invertego]
Neo Geo Pocket: Many improvements to 'fast boot' [invertego]
Neo Geo Pocket: Re-enable savint ram to disk on unload [invertego]
Sega 32X: Implement FM/Framebuffer access bit; fixes Spiderman [Luke Usher]
Sega 32X: Implement RV bit [Luke Usher]
Sega 32X: Optimise SH7604 recompiler min-cycles for 32X; fixes Knuckles Choatix & Virtua Fighter [remutro]
Sega 32X: PWM DREQ and timer are different things; fixes PWM audio in many games [Luke Usher]
Sega 32X: Used cached interpreter instead of recompiler [Luke Usher]
TMS9918: Fix sprite size emulation; fixes many graphical issues in ColecoVision/MSX/SG-1000 [invertego]
TMS9918: fix interrupt behavior [invertego]
hiro: Fix browser dialog filters on macOS [Luke Usher]
hiro: Force GTK3 to use X11 backend; fixes a crash under Wayland [thrimbor]
lucia: Disable fast boot by default [Luke Usher]
lucia: Support digital presses from analog inputs [invertego]
mia: Add workaround for underdumped Delta Warp rom [Luke Usher]
mia: Improve Nintendo 64 save chip database; fixes saving in some titles [sp1187]
nall: Enable LTO by default on non-debug builds [Luke Usher]
nall: Speed up recompiler codegen [Luke Usher]
sh2: Allow cores to determine an ideal minimum recompiler block size [Luke Usher]
sh2: Optimised code-gen for the interpreter [Luke Usher]
sh2: Recompiler should invalidate single blocks, not entire pools [Luke Usher]
tlc2900h: Fix immediate mask in BIT #,r; fixes Pocket Tennis [invertego]
z80: Correct the effect of IE on the next instruction; fixes audio drop-out in Neo Geo Pocket games [invertego]
The existing implementation was very incorrect. Fortunately, this chip
is well documented and the correct behavior is quite easy to implement.
This fixes most of the remaining ColecoVision bugs that aren't related
to missing peripheral support.
The TMS9918 is also used by the SG-1000 and MSX cores. I don't have a
list of bugs for those platforms, so I couldn't do any targeted testing,
but I booted up a few games and did not see any new issues.
Commit 532aafe074 made some improvements
to sprite zoom (magnification) emulation. It also corrected sprite size
emulation in the SMS VDP in what is referred to as Mode 4 by most
sources ("graphics3" in ares). Unfortunately, it erroneously applied the
same changes to the TMS9918 and V9938 as well as the SMS VDP in TMS9918
compatible modes. This caused widespread regressions in ColecoVision,
SG-1000, MSX, and MSX2 emulation.
This commit reverts the changes made outside of SMS VDP Mode 4,
restoring the dimensions of double sized sprites from 8x16 to 16x16.
I couldn't find any references describing the expected value of the top
bit of controller port reads, but some games require it to be cleared.
Here is an example from Defender when it is waiting a 1/2 button press:
in a,($FC) ; read controller 1
cp $7D ; compare 1 button
jr z,$876D
cp $77 ; compare 2 button
jr z,$8773
Clearing it fixes input in games that depend on all the undefined bits.
The implementation of IE in the Z80 processor was incorrectly causing
nonmaskable interrupts raised before the next instruction to be dropped.
A correct implementation should do two things:
- set IFF1 and IFF2 to 1
- disable maskable interrupts until after the following instruction
This fixes the issue of audio dropping out of Neo Geo Pocket games
seemingly at random.
References:
Z80 CPU User Manual (http://www.zilog.com/docs/z80/UM0080.pdf)
Page 6: "NMI is always recognized at the end of the current instruction,
independent of the status of the interrupt enable flip-flop..."
Page 183: "During the execution of this instruction [EI] and the
following instruction, maskable interrupts are disabled."
Use three first letters of game ID for mapping.
Add more entries (mostly Japanese games) and fix a few incorrect ones.
Handle some special cases involving different save chips for different
revisions and regions of the same game.
Change manifest generation to use whole four-letter ID and also output
the revision.
modified: ares/md/m32x/sh7604.cpp
Change the cached interpreter's recompiler min_cycles value from 23 to 22.
It's just ever so slightly too agressive.
This addresses problems with the bonus levels in Knuckles Chaotix,
as well as the hang in Virtua Fighter after selecting your character.
This appears to be the optimal value through lots of additional testing.
There were no other problems observed in the 32X library by lowering this
value to 22. Additionally, there were no further gains to be made by going
any lower (all the way to zero) such as correcting the hang at the end of
the match in Brutal: Above the Claw or NBA Jam failing to go in-game. Both
of these currently require using the full interpreter, and not the cached
interpreter enabled by default to correct timing issues.
This fixes 5% of games in the 32X library. :-)
lucia maps the N64 C-buttons to the right thumbstick of the virtual pad.
These are analog inputs on the virtual pad, so sampled analog values are
not converted to digital. This means any nonzero value is treated as
button press, which is not ideal when mapped to an analog input device.
This change introduces a helper to convert raw input values to a binary
"pressed" state at time of use, currently only defined for digital and
analog input mappings - for relative and absolute inputs this concept
would not make much sense.
My last change indexed into the ram array by an absolute memory address,
but the array only covers a portion of the address space beginning at
0x4000. This was in fact indexing past the end of the array, but it
appeared to work as long as 1) something was mapped there and 2) that
something was nonzero. It's possible that booting from the shutdown
vector every time doesn't have any negative side effects, but booting
from the hardware reset vector the first time is still the more correct
thing to do from an accuracy perspective.
Neo Geo Pocket is an "always on" system. On first boot, it quickly
enters a low power state via a halt instruction. From there, the user
must press the power button to wake the sytem. At this point, the BIOS
setup is shown, requiring the user to pick a preferred language among
other choices. When power is pressed again, the system returns to a low
power state. This state is maintained by an internal battery should the
external batteries discharge or be removed. The hardware reset entry
point will not execute again until the internal battery fails.
The current design of ares appears to be motivated by a few goals:
- Avoid requiring the user to press the emulated power button
- Avoid showing the BIOS setup more times than necessary
- Enable "fast boot" mode to skip the boot animation
The required power button press is avoided by skipping the first boot
code entirely in CPU::power(). Emulation never begins at the hardware
reset vector, but rather at 0xFF1800, following MAME's lead. This entry
point appears to have been for development purposes only and is not
referenced by the BIOS itself. Crucially, it does not run some
bookkeeping logic that only occurs when entering a low power state
either after a cold boot, in response to a power button press, or after
a software requested shutdown. Skipping this logic can cause the BIOS
setup to be shown on next boot.
The BIOS setup is avoided by simulating the bookkeping done by the BIOS
in the emulator itself. This logic is located in CPU::load(), meaning
that it does not run between system resets. Therefore, resetting a game
can still cause the BIOS setup to be shown. The BIOS setup is also
skipped by fast boot mode.
Fast boot mode bypasses the BIOS entirely on boot, jumping straight to
the cartridge entry point. This means all of the many important side
effects of the boot process must be replicated by CPU::fastBoot().
Currently, it also gives the user no way to select Japanese as a
preferred language.
The existing solutions to these problems fall short of providing a
consistent user experience, tightly couple ares to the internals of the
BIOS rom, and (particularly with fast boot) have been a source of many
bugs. This change removes the existing solutions in favor of ones that
let the BIOS handle the entirety of the boot process.
The new code in this change does the following:
- Begin execution at the hardware reset vector on first boot
- Begin execution at the VECT_SHUTDOWN syscall on subsequent boots
- Simulate a power button press when entering a low power state
- Patch the BIOS to skip the boot animation in fast boot mode
Starting at the hardware reset vector ensures the BIOS setup will be
shown on first boot, affording the user the opportunity to pick a
preferred language. Subsequent boots will begin at the VECT_SHUTDOWN
system call. It may seem counterintuitive, but this allows the BIOS to
perform cleanup that would normally only occur when the user shuts off
the device before switching cartridges. In both of these cases, we can
avoid requiring the user to press the emulated power button by
simulating a button press on their behalf. It's a low tech solution to
be sure, but a reliable one.
Finally, the implementation of fast boot mode is replaced with a single
byte patch to the BIOS to immediately return from the routine that plays
the boot animation.
When this bit is set to 0, any framebuffer or VDP access from the sh2 has to be ignored and when this bit is set to 1, any framebuffer or VDP access from the m68k should be ignored.
This fixes the rendering issues in Spiderman, likely others too.
The fastboot option is a nice to have, but it has potential to introduce serious bugs/glitches into emulation, as seen with Neo Geo Pocket, so it is safer to default this option to disabled.
The game Metal Slug - 2nd Mission compares a region of character memory
to a copy of the SNK logo in the game rom. Normally this memory is
initialized for the boot animation played by the BIOS. If the logo isn't
an exact match, the game starts but you are unable to fire any weapons.
Conceptually, this is the reverse of what the Game Boy does on boot.
There, the boot rom validates a Nintendo logo on the cartridge.
Since we already have the BIOS loaded, we can copy the logo from there
during a fast boot, though some unpacking is required.
This code was commented out in commit
4e82321182 which otherwise only affected
TLCS900/H timing. I believe this was left in by mistake. Uncommenting
this code restores the ability to persist BIOS settings across play
sessions.
In the game Dynamite Slugger, when your batter strikes out it loads a
16-bit word from 0x0000 and resets the game if anything but zero comes
back. The second byte, at address 0x0001, is mapped to internal port 1,
and currently almost all port values are initialized to 1 at power on.
In a 2019 nesdev post [1], Near stated that port emulation was incomplete
and likely incorrect. Without hardware tests, I'd rather not touch this
code more than necessary, but at the very least it seems more correct to
initialize the latched value in port 1 to zero.
There is a chance that the null dereference in Dynamite Slugger is
itself the result of an emulation bug, but all I have to compare against
is MAME, and the game behaves the same there. I believe this is decent
evidence that we are seeing a real game bug and that reading back zero
is what would have occurred on actual hardware.
[1] http://forums.nesdev.com/viewtopic.php?f=23&t=18579#p236069
"I added ports 1, 2, A, and B. Although ports 1 (d8-d15) and 2 (a16-a23)
are ... strange. They're likely emulated very wrong. I don't even
understand how one can change the direction of the data bus. I'm ...
suspecting that ports have their own latch values, but the manual isn't
very clear on this."
Perform more initialization to match the side effects of booting from
the BIOS.
1) Initialize XIX register. Puyo Pop World relies on this (likely a game
bug).
2) Initialize interrupt vector table. SNK Gals' Fighters and the Pocket
Casino Series games rely on this.
3) Initialize interrupt request levels used by the VECT_INTLVSET system
call. The Pocket Casino Series games rely on this.
The BIT (imm, reg) instruction uses the low 4 bits of its immediate operand even
when the register operand is only 8 bits wide. When the register is 8 bits and
the immediate value is between 8 and 15, ZF will be always be set. ares was
erroneously using only the bottom 3 immediate bits in this case (so 15 would
behave the same as 7).
With this fix, sprites now render correctly in the Neo Geo Pocket game Pocket
Tennis.
This bug was discovered by comparing against an instruction trace from MAME.
This change is the functional equivalent of commit
57e42cda31430c75566403c5f27ec290dc123da3 in the MAME git repo.
Although mia doesn't use threads itself, it includes `ares/ares.hpp` and ares
*does* use threads, so we need to build with `-pthread` in order to link
successfully.
I've released ares v121. Because it is not fully complete or stable, it is
released as source code only.
The license is now once again ISC instead of CC-BY-NC-ND.
Master System, WonderSwan, and WonderSwan Color compatibility have increased to
100%, with no remaining known bugs.
The Neo Geo Pocket is very close to 100% now with one issue remaining, where
sound effects sometimes mute in games.
Nintendo 64 compatibility has increased to above 80% thanks to corrections to
controller pak handling.
Several NES and Mega CD fixes have been added. EEPROM support has been added for
the Mega Drive.
Memory cards and paks now pre-format themselves, so you don't have to do so in-
game or in BIOS settings.
The new Neo Geo emulation is slowly improving, but it's still very preliminary
with only seven games fully playable so far.
The Nintendo 64 SM5K and PlayStation HC05 processor cores have been emulated,
but not connected yet due to a lack of information.
Added mouse input support and connected peripheral selection to the GUI, so mice
and light gun games can now be used.
There is now per-system input mapping overlays, so you can map controllers based
on the original system button names.
And lastly as promised, the SNES core has gained optional widescreen support.
Changelog (since v120):
- Nintendo 64: added Windows ABI support to dynamic recompilers
- PlayStation: added Windows ABI support to dynamic recompiler
- Nintendo 64: temporarily disabled 64-bit addressing mode due to issues
- Nintendo 64: corrected analog stick ranges and emulated octagonal
boundaries
- Nintendo 64: code cleanups around memory access functions
- Nintendo 64: started to implement RDRAM broadcasting (very incomplete
still)
- Mega Drive: improved VDP scanline renderer timing
- M68K: corrected clipping bug in ADD,CMP,SUB instructions
- Nintendo 64: improved SI scanning of PIF RAM and emulated more flags
- Nintendo 64: added very accurate controller pak initialization code
- Nintendo 64: improved controller analog stick approximations [MerryMage]
- Nintendo 64: added priority queue to delay SI and PI DMA transfers
- Master System: added bit-perfect YM2413 instrument patch sets
- Mega Drive: fixed a bug with LINEA and LINEF instructions (should not
decrement PC)
- Mega Drive: added EEPROM emulation
- mia: added Mega Drive and Mega 32X EEPROM database entries
- nall: added priority_queue::remove(T) support
- Nintendo 64: reverted 64-bit TLB (not actually present)
- Neo Geo: initial implementation
- Neo Geo: many emulation improvements
- nall: add workaround for compilers that lack __has_builtin
- Nintendo 64: ignore A15 on controller pak reads and writes
- Master System: implemented Codemasters, Korea, MSX, Janggun mappers
- Master System: improved Sega mapper emulation
- Master System: added initial emulation of port $3e
- Master System: added support to load BIOSes
- Master System: initialize stack pointer to 0xfffd when no BIOS loaded
[Luke Usher]
- Game Boy Advance: emulated BIOS swap register [MerryMage]
- Mega Drive: cancel pending IRQs when they are disabled [Jonas Quinn]
- Mega Drive: fixed handling of VDP field flag [Jonas Quinn]
- Mega Drive: mask upper bit of VDP sprite Y value when in progressive
display mode [Jonas Quinn]
- X24C01, M24Cxx: improve emulation of EEPROM command sequences
- Famicom: added database entries for Jajamaru Gekimaden and Mazase Top
Pro PRG-RAM
- M24Cx: rewrote emulation to be more complete; though still not working
for Cxx/Cxxx sizes
- Nintendo 64: try stopping SI polling on recv=0xfe
- Mega Drive: improved EEPROM emulation
- Nintendo 64: fixed CPU SCC counter rate [simer]
- Nintendo 64: added initial emulation of the SM5K processor (not connected
yet)
- lucia: update frame rate from the main thread to prevent a race condition
with GTK
- Master System: emulated sprite zoom and fifth-sprite status flag
- Master System: corrected VDP background emulation for mode 4 [fixes
Codemasters games]
- Master System: latch VDP background nametable address and scroll registers
[fixes Desert Speedtrap]
- Master System: mask CRAM reads to 6-bit in Master System mode [fixes Mercs]
- Master System: refactored VDP code
- Z80: swapped IND/INI to post-decrement B, and OUTD/OUTI to pre-decrement B
- lucia: fixed a crash when loading Game Gear games due to stubbing out
the BIOS
- Nintendo 64: fixed cartridge flash memory support
- Master System: VDP line coincidence should be initialized to $ff [fixes
Shadow Dancer]
- Master System: VDP sprite overflow index defaults to $1f, not $00 [fixes
PGA Tour Golf]
- SN76489: corrected port latching behavior and noise volume writes [fixes
Micro Machines]
- TMS9918: greatly refactored code
- V9938: greatly refactored code
- Z80: disassembler fixes
- lucia: corrected mapping of Master System pause button [fixes Baku
Baku Panic]
- nall: disable -Wstringop-overflow for GCC due to compiler heuristics error
- M68HC05: initial core implementation added
- M68000: renamed core from M68K
- Super Famicom: clearing $4200.d0 stops active joypad polling for the rest
of the frame [Jonas Quinn]
- Master System: don't evaluate sprites past active display area [fixes
Rescue Mission]
- Mega Drive: don't acknowledge VDP IRQs until the CPU triggers them [fixes
Mega Lo Mania]
- lucia: begin refactoring input mapping to allow per-system mappings and
multiple controller types
- Game Gear: set CPU::in() unmapped return value to MDR; fixes RoboCop 3
[Jonas Quinn]
- WonderSwan Color: do not mask screen tilemap base address; fixes Sorobang
[FPGAzumSpass]
- Mega Drive: set supervisor mode and clear trace mode for all exceptions;
fixes Gouketsuji Ichizoku [Jonas Quinn]
- Mega CD: format BRAM instead of leaving it uninitialized; fixes Popful Mail
(US)
- WonderSwan: add patch for Meitantei Conan: Nishi no Meitantei Saidai
no Kiki!
- Game Boy: add MBC1#M mapper database entries; fixes Bomber Man Collection,
Genjin Collection, Momotarou Collection, and Mortal Kombat I & II
- Neo Geo Pocket: $8118 background register exists even in the K1GE GPU;
fixes Samurai Shodown
- Neo Geo Pocket Color: return 0xFF acknowledge byte after flash erase
command; fixes Puzzle Link 2 and Memories off: Pure
- Neo Geo Pocket: clear watchdog timer counter on trigger to prevent
infinite triggering; fixes Neo Baccarat, Neo Cherry Master Color, and
Neo Mystery Bonus
- TLCS900H: do not allow interrupts to run between CPDR, LDIR, LDDR
instructions; fixes Fantastic Night Dreams Cotton
- Neo Geo Pocket: add all remaining missing I/O registers (not emulated,
but registers are readable and writable now)
- Neo Geo Pocket Color: above changes also fixed in-game audio in Crush
Roller and Dynamite Slugger
- Mega CD: added 1M mode WRAM swap request flag; fxies AX-101, Earnest Evans,
and Might & Magic III [TascoDLX]
- lucia: added input mapping overlays for all remaining systems
- lucia: added two-player support to all remaining systems
- TLCS900H: refactored instruction decoder and disassembler using range-case
- TLCS900H: improved emulation of (PC+d16) addressing mode (LDAR)
- TMS9918, V9938, SMS VDP: corrected sprite zoom emulation [Jonas Quinn]
- Neo Geo Pocket: added new debugging modules (flash ROM, I/O accesses,
system calls)
- Neo Geo Pocket: improved CPU interrupt logger (prints name of interrupt
now)
- Neo Geo Pocket: fixed a critical issue with interrupt priority levels;
fixes many games
- Neo Geo Pocket: added stubs for all remaining TMP95C061F I/O registers
(not emulated yet)
- Neo Geo Pocket: set CPU I/O port $b1.d2 reads to return 1 (fixes SNK
Gals' Fighter)
- Neo Geo Pocket: added stubs for undocumented CPU I/O ports $b6 and $b7
- Super Famicom: PPU code restructuring
- Super Famicom: added widescreen (16:9 and 21:9) support to the scanline
renderer
- WonderSwan: refactored I/O handlers to use switch/case instead of if tests
- WonderSwan: rewrote PPU renderer to modularize each component (screen1,
screen2, sprite, dac, etc)
- WonderSwan: corrected timers to count down instead of up; fixes timing
in many games [FPGAzumSpass]
- WonderSwan: improved screen two window emulation [FPGAzumSpass]
- hiro: TableView::onContext() is now TableView::onContext(TableViewCell)
(not supported for Cocoa or Qt yet)
- lucia: merged code to handle input assignment overlays and controller
polling for each emulation core
- lucia: added virtual mouse emulation and added mouse capture support
- lucia: added support to change devices connected to controller ports
- Neo Geo Pocket: added database workaround for underdumped Prize Game:
PP-AA01 Pusher Program (Japan)
- Neo Geo Pocket: fixed fast boot mode for Neo Cherry Pocket
- nall/range: added new within() templates
- V30MZ: emulated instruction prefetch
- V30MZ: greatly improved instruction timings (thanks to FPGAzumSpass'
test ROM)
- WonderSwan: disabling an interrupt source does clear its pending status
(fixes Digimon Tamers)
- TLCS900H: improved prefetch handling and instruction timing (still
imperfect)
- TLCS900H: improved timing further (still imperfect)
- WonderSwan: disabling an interrupt source does clear its pending status
(fixes Digimon Tamers)
- TLCS900H: improved prefetch handling and instruction timing (still
imperfect)
This gets a 100% pass on FPGAzumSpass' WonderSwan instruction timing tests, and
emulates CPU prefetch as well, but it seems to make games less stable rather
than more =(
- TLCS900H: refactored instruction decoder and disassembler using range-case
- TLCS900H: improved emulation of (PC+d16) addressing mode (LDAR)
- TMS9918, V9938, SMS VDP: corrected sprite zoom emulation [Jonas Quinn]
- Neo Geo Pocket: added new debugging modules (flash ROM, I/O accesses,
system calls)
- Neo Geo Pocket: improved CPU interrupt logger (prints name of interrupt
now)
- Neo Geo Pocket: fixed a critical issue with interrupt priority levels;
fixes many games
- Neo Geo Pocket: added stubs for all remaining TMP95C061F I/O registers
(not emulated yet)
- Neo Geo Pocket: set CPU I/O port $b1.d2 reads to return 1 (fixes SNK
Gals' Fighter)
- Neo Geo Pocket: added stubs for undocumented CPU I/O ports $b6 and $b7
- Super Famicom: PPU code restructuring
- Super Famicom: added widescreen (16:9 and 21:9) support to the scanline
renderer
- WonderSwan: refactored I/O handlers to use switch/case instead of if tests
- WonderSwan: rewrote PPU renderer to modularize each component (screen1,
screen2, sprite, dac, etc)
- WonderSwan: corrected timers to count down instead of up; fixes timing
in many games [FPGAzumSpass]
- WonderSwan: improved screen two window emulation [FPGAzumSpass]
- hiro: TableView::onContext() is now TableView::onContext(TableViewCell)
(not supported for Cocoa or Qt yet)
- lucia: merged code to handle input assignment overlays and controller
polling for each emulation core
- lucia: added virtual mouse emulation and added mouse capture support
- lucia: added support to change devices connected to controller ports
- Neo Geo Pocket: added database workaround for underdumped Prize Game:
PP-AA01 Pusher Program (Japan)
- Neo Geo Pocket: fixed fast boot mode for Neo Cherry Pocket
- nall/range: added new within() templates
- Game Gear: set CPU::in() unmapped return value to MDR; fixes RoboCop 3
[Jonas Quinn]
- WonderSwan Color: do not mask screen tilemap base address; fixes Sorobang
[FPGAzumSpass]
- Mega Drive: set supervisor mode and clear trace mode for all exceptions;
fixes Gouketsuji Ichizoku [Jonas Quinn]
- Mega CD: format BRAM instead of leaving it uninitialized; fixes Popful Mail
(US)
- WonderSwan: add patch for Meitantei Conan: Nishi no Meitantei Saidai
no Kiki!
- Game Boy: add MBC1#M mapper database entries; fixes Bomber Man Collection,
Genjin Collection, Momotarou Collection, and Mortal Kombat I & II
- Neo Geo Pocket: $8118 background register exists even in the K1GE GPU;
fixes Samurai Shodown
- Neo Geo Pocket Color: return 0xFF acknowledge byte after flash erase
command; fixes Puzzle Link 2 and Memories off: Pure
- Neo Geo Pocket: clear watchdog timer counter on trigger to prevent
infinite triggering; fixes Neo Baccarat, Neo Cherry Master Color, and
Neo Mystery Bonus
- TLCS900H: do not allow interrupts to run between CPDR, LDIR, LDDR
instructions; fixes Fantastic Night Dreams Cotton
- Neo Geo Pocket: add all remaining missing I/O registers (not emulated,
but registers are readable and writable now)
- Neo Geo Pocket Color: above changes also fixed in-game audio in Crush
Roller and Dynamite Slugger
- Mega CD: added 1M mode WRAM swap request flag; fxies AX-101, Earnest Evans,
and Might & Magic III [TascoDLX]
- Nintendo 64: added ISViewer support
- lucia: added input mapping overlays for all remaining systems
- lucia: added two-player support to all remaining systems
- Game Gear: fix inputs
- Master System: don't evaluate sprites past active display area [fixes
Rescue Mission]
- Mega Drive: don't acknowledge VDP IRQs until the CPU triggers them [fixes
Mega Lo Mania]
- lucia: begin refactoring input mapping to allow per-system mappings and
multiple controller types
- M68HC05: initial core implementation added
- M68000: renamed core from M68K
- Super Famicom: clearing $4200.d0 stops active joypad polling for the rest
of the frame [Jonas Quinn]
- Nintendo 64: fixed cartridge flash memory support
- Master System: VDP line coincidence should be initialized to $ff [fixes
Shadow Dancer]
- Master System: VDP sprite overflow index defaults to $1f, not $00 [fixes
PGA Tour Golf]
- SN76489: corrected port latching behavior and noise volume writes [fixes
Micro Machines]
- TMS9918: greatly refactored code
- V9938: greatly refactored code
- Z80: disassembler fixes
- lucia: corrected mapping of Master System pause button [fixes Baku
Baku Panic]
- nall: disable -Wstringop-overflow for GCC due to compiler heuristics error
- Master System: emulated sprite zoom and fifth-sprite status flag
- Master System: corrected VDP background emulation for mode 4 [fixes
Codemasters games]
- Master System: latch VDP background nametable address and scroll registers
[fixes Desert Speedtrap]
- Master System: mask CRAM reads to 6-bit in Master System mode [fixes Mercs]
- Master System: refactored VDP code
- Z80: swapped IND/INI to post-decrement B, and OUTD/OUTI to pre-decrement B
- lucia: fixed a crash when loading Game Gear games due to stubbing out
the BIOS
- Mega Drive: improved EEPROM emulation
- Nintendo 64: fixed CPU SCC counter rate [simer]
- Nintendo 64: added initial emulation of the SM5K processor (not connected
yet)
- lucia: update frame rate from the main thread to prevent a race condition
with GTK
- Famicom: added database entries for Jajamaru Gekimaden and Mazase Top
Pro PRG-RAM
- M24Cx: rewrote emulation to be more complete; though still not working
for Cxx/Cxxx sizes
- Nintendo 64: try stopping SI polling on recv=0xfe
- Nintendo 64: ignore A15 on controller pak reads and writes
- Master System: implemented Codemasters, Korea, MSX, Janggun mappers
- Master System: improved Sega mapper emulation
- Master System: added initial emulation of port $3e
- Master System: added support to load BIOSes
- Master System: initialize stack pointer to 0xfffd when no BIOS loaded
[Luke Usher]
- Game Boy Advance: emulated BIOS swap register [MerryMage]
- Mega Drive: cancel pending IRQs when they are disabled [Jonas Quinn]
- Mega Drive: fixed handling of VDP field flag [Jonas Quinn]
- Mega Drive: mask upper bit of VDP sprite Y value when in progressive
display mode [Jonas Quinn]
- X24C01, M24Cxx: improve emulation of EEPROM command sequences
This one is an experiment to ignore A15 on memory pak reads+writes. If possible,
I'd like to know if any games with controller pak issues start working with this
change that didn't before ^-^;
- Mega Drive: fixed a bug with LINEA and LINEF instructions (should not
decrement PC)
- Mega Drive: added EEPROM emulation
- mia: added Mega Drive and Mega 32X EEPROM database entries
- nall: added priority_queue::remove(T) support
This doesn't justify a new WIP release yet, but it changes the PI DMA delay
timing which seems to make Aidyn Chronicles work again, so let's see how it
does.
- Nintendo 64: improved SI scanning of PIF RAM and emulated more flags
- Nintendo 64: added very accurate controller pak initialization code
- Nintendo 64: improved controller analog stick approximations [MerryMage]
- Nintendo 64: added priority queue to delay SI and PI DMA transfers
- Master System: added bit-perfect YM2413 instrument patch sets
This fixes a major issue with the 68K ADD,CMP,SUB instructions not clipping, and
improves the VDP scanline renderer timing somewhat.
This fixes Alien Solder, and I also moved the DMA run below the FIFO/prefetch to
fix Comix Zone's graphics. It regresses several Titan Overdrive 2 screens, but
oh well.
I'm trying to track down a bug in Popful Mail (US) where the CPU crashes right
after the title screen. It seems like the CPU is getting stuck in a loop that
keeps calling the same function, so the stack keeps decrementing until it ends
up overwriting the currently executing code with a bad instruction.
Without an I/O tracer it's really difficult to try and understand what the CPU
is stuck waiting on and looping on. I'll have to add an I/O tracer to the Mega
CD registers.
The CPU fixes sadly didn't improve anything in the 32X space. Metal Head gets in
a loop until it overwrites the stack frame return address with 0x1fff1fff that
causes a return to an unaligned address that crashes the SH2 master.
After Burner Complete doesn't boot at all. Amazing Spider-Man still has screwed
up graphics priority ordering for the 32X VDP.
Space Harrier still shows a bunch of junk lines at the top and bottom of the
screen.
The scanline VDP can now run Lemmings 1&2, Alien Soldier, etc. But it still does
horrifically bad with Titan Overdrive, especially 2.
This release provides improved Nintendo 64 and Mega Drive emulation, plus some
emulation speedups and new features like keyboard-mapping for all Nintendo 64
controls.
The infamous Titan Overdrive demos now run with the exception of one glitched
screen each, but you will need to compile with profile=accuracy to enable the
required cycle-based VDP renderer for this to work. I'll try in the future to
support as much of it as I can with the default scanline renderer as well.
Changelog (since v119):
- SH2: added support for Windows ABI to the recompiler
- SH2: MAC must increment R[n] before reading from R[m]; fixes Virtua
Fighter and Toughman Contest
- SH2: fixed dynarec MOV @Rm+,Rn to not increment when Rm==Rn
- SH2: fixed dynarec TST instruction
- SH2: improved dynarec accuracy by breaking blocks on delay slot branches
- SH2: improved dynarec accuracy by decreasing the underclocking amount
- Mega Drive: implemented undocumented VSRAM and CRAM DMA fill
- Mega Drive: simplified scanline VDP renderer; fixes TMNT: Tournament
Fighters graphics
- Mega Drive: improved region detection; correctly identifies Alien Soldier
region now
- Mega CD: fixed crash on game load
- Super Famicom: fixed direct color mode; fixes Secret of Mana world map
- WonderSwan Color: fixed initial state for new EEPROMs plus EEPROM size;
fixes missing sound
- lucia: fixed saving RAM files when a manual save path was specified
- ruby: fixed library dependency detection for Arch Linux and other
distributions
- SH2: additional correction for dynarec MOV @Rm+,Rn instructions
- hiro/GTK3: added CSS stylesheet overrides to improve appearance [Screwtape]
- N64: VMRG was not clearing VCO in C++ version [Rasky]
- N64: fixed "ctc2" in the disassembler
- Mega Drive: VDP address/command bits are set even for non-register writes
[Eke]
- Mega Drive: implemented VDP FIFO with approximated timings
- Mega Drive: implemented CPU bus arbitrator
- N64: fixed RSP vector unit register values in the disassembler
- Mega Drive: implemented proper VDP FIFO timings for both reads and writes
(hopefully)
- Mega Drive: enabled external and RAM refresh timing
- Mega Drive: added (Mega Drive | Mega 32X) + Mega CD mode 1 emulation
- Mega Drive: refactored dot-based VDP renderer
- ares: added Thread::restart() function to reset a thread without resetting
its clock
- Mega Drive: improved DRAM refresh timings
- Mega Drive: added VDP I/O logger
- Mega Drive: fixed VDP counter emulation (still inaccurate)
- Mega Drive: improved VDP DMA and FIFO emulation
- Nintendo 64: report 64DD as missing for now; fixes F-Zero X
- Nintendo 64: improved TLB emulation; fixes Conker's Bad Fur Day
- Nintendo 64: PI DMA from flash always reads data, never the status;
fixes Paper Mario
- Mega Drive: improved VDP FIFO emulation
- Mega Drive: improved VDP dot-renderer
- nall/bit-range: fixed bug with bit indexes >= 32
- Mega Drive: fixed VDP read buffer indexing for VSRAM and CRAM
- Mega Drive: fixed 68K to VDP DMA so that it instantly freezes the CPU
- Mega Drive: emulated VDP left window hardware glitch where hscroll&15!=0
- Mega Drive: improved CPU interrupt handling
- Mega Drive: added APU bus mirrorings
- Mega Drive: emulated the VDP debug register
- Mega Drive: fixed VDP VRAM DMA copy
- Mega Drive: improved 128KB VRAM mode support
- Mega Drive: mask sprite attribute table address in H40 mode [Sik]
- Mega Drive: VDP timing improvements
- Nintendo 64: improved EEPROM support; fixes Perfect Dark
- Nintendo 64: improved VI interrupt support; fixes Star Wars: Rogue Squadron
title screen [nodev]
- Nintendo 64: emulated CIC-NUS-6105 copy protection; fixes Banjo-Tooie
[XScale]
- Nintendo 64: added serrate (interlace) support and fixed bug when
supersampling in serrate mode
- Nintendo 64: emulated CPU instruction cache
- Nintendo 64: emulated CPU data cache
- Nintendo 64: emulated CPU CACHE instruction
- Nintendo 64: fixed CPU TLB bug; fixes GoldenEye
- Nintendo 64: began adapting CPU cached interpreter into a dynamic
recompiler
- Nintendo 64: began adapting RSP cached interpreter into a dynamic
recompiler
- Nintendo 64: added 64-bit addressing and TLB supporting
- Nintendo 64: added endian support to [LS][WD][LR] instructions
- Nintendo 64: improved dynamic recompiler
- PlayStation: began adapting CPU cached interpreter into a dynamic
recompiler
- lucia: allow mapping analog axes separately (allows mapping sticks to
the keyboard)
- Nintendo 64: corrected analog stick ranges
- Nintendo 64: emulate the analog stick as an octagon rather than a circle
[YetAnotherEmuDev]
[This is actually the second release of v120; the change since the first release
is the N64 analog stick ranges and the octagon gate. -Ed.]
- Mega Drive: VDP scanline renderer compiles once more
- Nintendo 64: improved dynamic recompiler
- PlayStation: began adapting CPU cached interpreter into a dynamic
recompiler
- lucia: allow mapping analog axes separately (allows mapping sticks to
the keyboard)
All that's left now is fixing the call() function in the N64/PS1 to support >3
(4) arguments on Windows and we can release v120
- Nintendo 64: began adapting CPU cached interpreter into a dynamic
recompiler
- Nintendo 64: began adapting RSP cached interpreter into a dynamic
recompiler
- Nintendo 64: added 64-bit addressing and TLB supporting
- Nintendo 64: added endian support to [LS][WD][LR] instructions
I could really use a hand with my CPU dynarec, n64/cpu/recompiler.cpp line 1335.
When calling an FPU instruction without SCC coprocessor 1 enabled, it throws an
exception.
If I call the exception function, the emulator crashes hard and I don't
understand why at all.
The stack is aligned, but it seems if I modify rbx/rbp/r13 as I do with the
RSP+SH2 just fine, it seems to die. Yet even if I make that code restore
rbx/rbp/r13 before calling the coprocessor exception function, it still dies.
Really at a loss >_>
Also, this will only work on Linux/BSD at the moment. The RSP vector functions
pass four parameters, and my Windows call wrapper can only handle 3 arguments
because after that the argument has to go on the stack. I'll fix that later.
Working Nintendo 64 data cache emulation (still don't know the memory access
timings for it) and improved Mega Drive VDP emulation (still can't run TO1&2)
GoldenEye 007 and Jet Force Gemini run now. Right now, known N64 bugs are:
Donkey Kong 64 hangs when the EEPROM support is enabled, Indiana Jones doesn't
boot (probably anti-emulator code?), Blast Corps blinks a lot (though less than
it did before.)
This WIP has CPU instruction and data cache emulation, though I had to disable
the data cache as it's not working yet.
Three N64 game fixes. Refactored Mega Drive profile=accuracy vdp more, still
can't pass Titan Overdrive 1 or 2 ._. Really getting demotivated on that one.
[Previously, Near said "Now to fix sprite fetching on Y=-1"]
Should be substantially better now.
Titan Overdrive 2 shows distorted graphics on the "Overdrive 2" logo screen
(after the ship crash and maze run), and the only way to get that working is to
double the VDP FIFO speed. It already runs twice as fast in 128K VRAM mode. The
same FIFO speed doubling is required to not crash after the Titancade screen.
Unless I'm really fundamentally misunderstanding something, I'm not sure what's
going on here.
This gets us a lot further with the Mega Drive, but still some major issues.
Lemmings 2 will sometimes crash when you load it (not threading related), and
Titan Overdrive 2 crashes after the arcade scene. Ran out of steam to work on
this more today though, 12 hours in already.
This has VDP debug register emulation, well one of the 16 debug registers anyway
I fixed sound in TO2, was mirroring like crazy in the APU space, also fixed
sprites not rendering all the way in the rain scene.
So what you'll see I'm doing is setting an irq.(vh)blank.pending=1 flag, and
then whenever you have hvirq enabled AND a pending flag, it sends an IRQ to the
CPU and clears the pending flag, and when the CPU triggers it, the CPU marks it
as acknowledged.
Apparently BlastEm links bit 7 of the control status register to the
vblank.pending flag, so I'm copying that.
[Near then posted a screenshot of Titan Overdrive 2 running inside ares. In
white text on a blue background, it says:
0D2 B50D
D0 00000001
D1 00FF2700
D2 93979301
D3 40000002
D4 0D12001C
D5 00000000
D6 00000001
D7 0000FFFF
A0 00C00004
A1 00C00000
A2 00000CBC
A3 00000DEC
A4 00FF1464
A5 00FF0C1A
A6 00FF0C1A
A7 00FFFFFE
-Ed.]
Crashes here if I don't lower the CPU H/VIRQ lines on Vblank/Hblank=0
Also I am faking the Vcounter incrementing early when reading the Vcounter,
easier that way.
Really substantial Mega Drive profile=accuracy timing improvements, but still
Titan Overdrive 2 performs much worse than the default performance profile, and
that fucking audio driver still won't play any sound.
- Nintendo 64: report 64DD as missing for now; fixes F-Zero X
- Nintendo 64: improved TLB emulation; fixes Conker's Bad Fur Day
- Mega Drive: improved VDP FIFO emulation
- ares: added Thread::restart() function to reset a thread without resetting
its clock
- Mega Drive: improved DRAM refresh timings
- Mega Drive: added VDP I/O logger
- Mega Drive: fixed VDP counter emulation (still inaccurate)
- Mega Drive: improved VDP DMA and FIFO emulation
- N64: fixed RSP vector unit register values in the disassembler
- Mega Drive: implemented proper VDP FIFO timings for both reads and writes
(hopefully)
- Mega Drive: enabled external and RAM refresh timing
- Mega Drive: added (Mega Drive | Mega 32X) + Mega CD mode 1 emulation
- Mega Drive: refactored dot-based VDP renderer
A working VDP FIFO implementation (write slots only), but probably wildly
inaccurate. Rough timing approximations for the slots.
This build fixes some issues in MD Sonic the Hedgehog (forgot to undo the
background color register bit twiddling when reverting some overly aggressive
VDP-performance optimizations) and also fixes MD Golden Axe II.
I spent a few hours trying to fix Lemmings 2 from locking up immediately. What
happens is I get a fourth Hblank IRQ before it clears a RAM value, whereas
Mednafen only gets three. And that desyncs something and it never gets out of a
loop.
Unfortunately a few critical issues crept in between v118 and v119, so here is a
bugfix release for all reported issues.
It also fixes some game bugs while I'm at it, and boosts 32X compatibility from
50% to a little over 60%.
Please do upgrade if you have v119, this one's important.
- SH2: MAC must increment R[n] before reading from R[m]; fixes Virtua
Fighter and Toughman Contest
- SH2: fixed dynarec MOV @Rm+,Rn to not increment when Rm==Rn
- SH2: fixed dynarec TST instruction
- SH2: improved dynarec accuracy by breaking blocks on delay slot branches
- SH2: improved dynarec accuracy by decreasing the underclocking amount
- Mega Drive: implemented undocumented VSRAM and CRAM DMA fill
- Mega Drive: simplified scanline VDP renderer; fixes TMNT: Tournament
Fighters graphics
- Mega Drive: improved region detection; correctly identifies Alien Soldier
region now
- Mega CD: fixed crash on game load
- Super Famicom: fixed direct color mode; fixes Secret of Mana world map
- WonderSwan Color: fixed initial state for new EEPROMs plus EEPROM size;
fixes missing sound
- lucia: fixed saving RAM files when a manual save path was specified
- ruby: fixed library dependency detection for Arch Linux and other
distributions
- hiro/GTK3: added CSS stylesheet overrides to improve appearance [Screwtape]
I'm releasing ares v119 today, which includes very preliminary Sega 32X
emulation support. Compatibility is currently at around 50% with the dynamic
recompiler, probably closer to 75% with the cached interpreter, and since the
system requirements were a bit too steep (on account of my Mega Drive core being
cycle/dot-accurate), I downclocked the SH2s a bit until I can speed up the
emulator more. You'll currently need about a Ryzen 5 2600 to hit 60fps reliably.
With the underclock, my Ryzen 7 5800X hits 120fps, and without it, 85fps.
Although the compatibility for the new 32X core is a bit low, this is mostly due
to pesky CPU bugs. The accuracy is quite high and I've emulated as much of the
32X and SH7604 peripheral functions as possible. I pass all 161 tests from the
Mars Check Program. It should not take much more work to reach 98% compatibility
in the future. Sega CD 32X emulation support is present, but is likely not
functional, as I haven't tested it yet.
Other major features in this release include Sega SVP support for Virtua Racing,
plus improved Nintendo 64, Mega Drive, and Mega CD emulation compatibility.
I'm going to start working on Sega Saturn emulation now, while Luke Usher works
on Neo Geo emulation. No promises as to when or if these cores will become
playable, I'm just giving you all a heads up since you'll see the skeletons for
these systems in the source code now.
Changelog:
- Nintendo 64: improved Expansion Pak detection
- Nintendo 64: fixed swapped L and R buttons [simer]
- Nintendo 64: emulated the RST bit for gamepads
- ruby: added library detection support for the Linux and BSD targets
- lucia: gained support for game paks (custom file dialog only)
- Super Famicom: added support for Super Game Boy, Sufami Turbo, and BS
Memory packs
- hiro: made SourceEdit optional for gtk2 and gtk3 targets (disabled
for ares)
- Nintendo 64: emulated 2048-byte EEPROM identifier and transfer protocol
- Super Famicom: corrected ppu-performance widths table indexing to consider
overscan
- Mega CD: fixed a bug in register $ff8003; allows Popful Mail to boot
[TascoDLX]
- Mega Drive: fixed a bug with 256-width video modes
- Mega Drive: improved VDP DMA emulation which should fix many games
- Mega Drive: added SVP emulation
- Mega Drive: added 32X emulation
- Mega CD: fixed a bit-masking bug in register $ff8004; fixes Radical Rex
[TascoDLX]
- Nintendo 64: fixed C implementation of RSP VMACU instruction
- Nintendo 64: use correct NTSC and PAL PIF ROM images based on the region
- Mega Drive: fixed reset logic, Z80 interrupt timing + prefix timing +
bus control [TascoDLX]
- Mega CD: fixed word RAM access and CDC DMA word RAM transfers [TascoDLX]
- Nintendo 64: improved RSP VMOV emulation [Rasky]
- Nintendo 64: fixed RSP DMEM DMA alignment (&~7, not &~3) [Rasky]
- Nintendo 64: upgraded to the latest version of ParaLLEl-RDP
- nall: greatly expanded recompiler/amd64's supported intrinsics
- mia: substantial refactoring around a new virtual filesystem implementation
from nall
[This release was posted to the ares Discord after r16. That version introduced
128KB VRAM mode for the Super Famicom core, and somebody requested the previous
version so they could see the changes involved in implementing that feature.
-Ed.]
That's as far as I can go with 32X support for now. I fully emulated the Sh2
cache but I still hang at Mars test 123. The Hblank (2) test fails because it
looks like I'm running a bit too fast. The DMA test fails because it expects
DREQ to become inactive when the DREQ length hits zero. If I do that, the test
hangs. If I don't do that, the test fails.
Virtua Fighter shows no graphics in-game, Virtua Racing shows no graphics
period.
Knuckles Chaotix is now fully playable at glorious 20fps, heh.
Still a whole ton of issues but I really went to town with this WIP. I
implemented read/write functionality for all the SH7804 internal
registers/functional units, and added basic simulation of the free-range timer,
DMA controller (very basic) and interrupt controller.
On the 32X side, it should be functionally complete save for bugs now. VDP and
PWM are fully implemented.
I am getting my ass kicked by SH-2 delay slots >_>
The basic idea of them is simple, but the PR register and when to do the +4 or
+2 or not is not intuitive.
SH-2 core finished, started connecting the 32X to it. It executes some
instructions and does some I/O register stuff before hanging. Still gotta
implement the 32X interrupts, PWM, and VDP stuff.
Here's the current build with working SVP support. Build with profile=accuracy
if you try it because my fast scanline renderer breaks soooo many games
including Virtua Racing ._.
This WIP has the new mia system. It's a pretty massive change ... I hope it will
go okay for you. Feel free to ping me and I'll walk you through it.
Essentially, we want to edit mia/system/neo-geo-(aes|mvs).cpp to load in the
necessary files from MAME's neogeo.zip that is given to it (I have a helper
Pak::read(zipfile, pattern) function to grab files out of the archive for you
into a vector<u8>), do endian conversion, add to the pak, then the Neo Geo core
can see it.
The Neo Geo cartridge support should be enough for Magician Lord and super early
games with no mappers or crypto, so we'll start there and work our way up.
My tracer was crashing in v118 for the Mega CD due to the trace address not
being masked and the value underflowing, so here's a pre-v118.4 WIP with that
fixed.
So, spoiler since you'll all see it: Luke and I are gonna be working on a
Neo*Geo core. Please keep that a secret for now until we can get some
screenshots to share with people.
Would appreciate feedack on the vfs redesign, still a work in progress. Right
now, the potential is there to have ares cores that don't use manifests at all.
So far, only the ColecoVision core actually does it. However, all cores are
ported to use the new Platform::pak() function instead of Platform::open() [now
removed.]
Lots of stuff is broken right now: N64/PS1 memory cards, PC Engine CD / Mega CD
internal save memory, Mega CD can't play any games, FDS and NGP don't save, etc.
I'm excited to launch ares v118 today, the first release featuring playable,
full-speed Nintendo 64 emulation!
The new Nintendo 64 emulation is made possible thanks to [Themaister] very
graciously porting his Vulkan-based ParaLLEl-RDP graphics renderer to ares. With
its default settings, it is nearly pixel-perfect to real hardware, and it
optionally supports upscaling to 2x or 4x the original Nintendo 64 resolution,
plus optional supersampling back down to the original resolution (for enhanced
anti-aliasing) if desired. The Vulkan support requires an appropriate graphics
card, and either Windows or Linux. At this time, Vulkan is not available for
macOS nor the BSDs.
Also new for the Nintendo 64 core in this release is Rumble Pak, Cartridge Pak,
SRAM, EEPROM, and Flash save support. Note that for right now, the Rumble Pak
will only be enabled for games which use internal saves (SRAM, EEPROM, and
Flash.) That does not cover all Rumble Pak-capable games. The option to choose
between Rumble Paks and Cartridge Paks will be added to a future release.
For the PlayStation core, [Luke Usher] provided two rendering fixes that allow
Final Fantasy VII and Tony Hawk's Pro Skater to be fully playable!
Right now, approximately 33% of the Nintendo 64 library is fully playable, and
about 67% of the PlayStation library is fully playable. Each core has only been
under active development for about one month each, so they both have a long way
to go. Please treat these early releases as tech samples, rather than finished
emulation cores.
Further, note that the Nintendo 64 and PlayStation cores employ cached
interpreters. This is a middle-ground between the accuracy of interpreters and
the performance of dynamic recompilers. As such, ares' system requirements will
be a bit higher than traditional emulators for these systems. Presuming no
background task interference or CPU throttling, generally speaking, a Ryzen 5
2600 or better CPU should get you to around ~120fps in the average case, and
~60fps in the worst case.
The source code has also been released under the terms of the Creative Commons
BY-NC-ND 4.0 license.
[Themaister]: http://github.com/Themaister/
[Luke Usher]: https://twitter.com/LukeUsher1
Ridge Racer now boots and gets in-game, but likely GTE errors prevent it
from being very playable yet.
- PlayStation: added DMA IRQ support
- PlayStation: added more GTE instructions
- ares: started on a new Debug class for notifications (unimplemented
features, etc.)
- PlayStation: improved timer support
- PlayStation: added more GPU GP0 rendering commands
- lucia: split the emulator list and emulator options into separate
settings panels
- lucia: added fast boot option for PlayStation and Neo Geo Pocket
cores
- PlayStation: fixed masking bug in LWL and LWR instructions
- PlayStation: improved timer support
- PlayStation: added EXE side-loading support
- PlayStation: added fast boot support
- PlayStation: added libc putchar logging support
- PlayStation: started implementing controller support
- PlayStation: improved texture semi-transparency support
- PlayStation: fixed a bug in render clipping
- Super Famicom: mosaic fix wasn't exactly right before; now it should
be
- PlayStation: started implementing CD interface
- PlayStation: started implementing GTE coprocessor
- Super Famicom: fixed bugs in hires + interlaced mosaic rendering
- PlayStation: started implementing the SPU (no DMA, CD-DA, reverb, or
sweep support yet)
I've started on a Sony PlayStation emulation core with this WIP. The
goal is to work on the MIPS CPU core while I am still well-versed with
the MIPS ISA. The Nintendo 64 core will remain my primary focus,
however.
- PlayStation: implemented initial driver skeleton (no emulation code
yet)
- lucia: added option to group the load menu options into submenus by
manufacturer
- lucia: connected Cocoa-specific application menu options to their
appropriate callbacks
- hiro/Cocoa: fixed compilation issues for HexEdit (the widget is not
implemented, however)
- hiro/Cocoa: fixed a subpixel precision rendering issue causing
blurry fonts [LIJI]
This WIP adds non-SIMD implementations of all RSP vector unit
functionality. This allows compiling without SSE, but was mainly added
for debugging SSE issues. It's also useful for documenting in code what
the SSE instructions are doing in C++ code.
- Nintendo 64: added non-SSE implementation of RSP vector unit
The new recompilers increase the framerate in Namco Museum from 60fps to
160fps, and in Zelda: Ocarina of Time from 55fps to 135fps (presuming no
RDP renderer.)
- Nintendo 64: completed basic CPU dynamic recompiler
- Nintendo 64: completed basic RSP dynamic recompiler
- N64: redesigned the bus handler
- N64: execute eight CPU instructions per synchronization event
- N64: range test the CPU Compare register
- N64: decode more RDP display list commands
Many N64 games are now playable.
- N64: VSUB should clear VCO
- N64: corrected VRCP(L) and VRSQ(L) instructions
- N64: many other smaller various fixes
- N64: added missing BLTZAL, BGEZAL instructions
- N64: added missing SLT, SLTI instructions (they were erroneously
aliased to SLTU, SLTIU)
- N64: mask low two bits of PC when writing to SP_PC_REG
- N64: refactored RSP DMA; only mask the low two bits SP_PBUS_ADDRESS
- N64: RSP DMA seemingly updates SP_PBUS_ADDRESS and SP_DRAM_ADDRESS
- N64: added PIF boot ROM emulation
- N64: detected NUS-CIC revision based on ROM bootcode checksum
- N64: added skeleton I/O reading and writing for all VI and PI
registers
This WIP separates the RSP SCC registers so that RDP rendering commands
are not processed inside of the RSP. The register interface is shared
between the SCC and the CPU bus, so there is no technically correct
location for these handlers.
- N64: moved RSP SCC registers to outer RSP and RDP I/O handlers
- N64: improved audio playback (AI_LENGTH &=~ 7, not (AI_LENGTH | 7) +
1)
- N64: improved exception handling (ERL bit isn't set on standard
exceptions)
- N64: added very incomplete, inital TLB emulation
- N64: various improvements to the disasssembler (including FPU
instruction support)
- N64: improved SI emulation (Namco Museum input now works)
This WIP boots the first official Nintendo 64 title, Namco Museum. It
remains to be playable, however.
- N64: improved interrupt handling
- N64: implemented basic state machine handling for PI serial data
transfers
- N64: resume previously executed instruction after ERET for non-
interrupt exceptions
- N64: various other improvements
- N64: removed libco completely, using direct cycle counters now
instead
- N64: emulated RSP DMA between IRAM/DRAM and RDRAM
- N64: emulated RSP core R4000 instructions
- N64: started working on RSP COP2 vector instructions
Emulation is now far enough along to complete the boot loading code and
begin executing game code. The "hello world" CPU rendering demo now runs
correctly in both 15bpp and 24bpp output modes.
- N64: implemented skeleton interfaces (MI, VI, AI, PI, RI, SI)
- N64: implemented PI DMA
- N64: added basic frame buffer rendering (320x240 only)
- VR4300: implemented register-immediate instructions
- VR4300: implemented half of the general instructions
- ares: added Port::supported() -> vector<string> API
- nall: improve checks in directory::exists() and directory::create()
**ares** is a multi-system emulator that began development on October 14th, 2004.
It is a descendent of [higan](https://github.com/higan-emu/higan) and [bsnes](https://github.com/bsnes-emu/bsnes/), and focuses on accuracy and preservation.
Official Releases
-----------------
Official releases are available from
[the ares website](https://ares-emu.net).
Nightly Builds
--------------
Automated, untested builds of ares are available for Windows and macOS as a [pre-release](https://github.com/higan-emu/ares/releases/tag/nightly).
Loaded 100 of 3018 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.