Commit Graph

354 Commits

Author SHA1 Message Date
transistor
9ee9d00ca6 Added work-in-progress on pixels frontend 2022-10-02 21:20:44 -07:00
transistor
a9b8633531 Added mouse support, but it's not used yet 2022-10-02 20:39:02 -07:00
transistor
4cb423d85a Fixed minifb frame updater to allow slower framerates
If the sim is running slower than 60Hz, it was using the frame limiter
to not apply because no frame was drawn, and so it would end up running
at full speed.  Minifb can save the last frame without cloning it, and
redraw the same frame if no new frame is ready, which allows the limiter
to still delay the next frame, so slower speeds work.  This was also
preventing things that didn't update the screen from allowing inputs
including escape to have any effect
2022-10-02 13:07:15 -07:00
transistor
a9d51fb919 Added DAC to ym2612 and changed mixing method 2022-10-02 10:29:34 -07:00
transistor
7c279613cc Moved AddressRepeater to core, and renamed AddressAdapter
AddressRepeater now takes the range it should repeat over, which only
really affects its reported size.

AddressAdapter is now AddressRightShifter, which is literally the operation
it performs, where the input is still the bits to shift the address right by
2022-10-01 21:01:56 -07:00
transistor
2d6044084d Modified how frames are updated
It turns out to not be too much of a performance issue to allocate
a new frame each time one is produced, so to reduce lock contention
I added a queue where frames are added to and taken from without
locking the frame for the whole update.  I'm hoping this will give
more flexibility to frontend implementations, which can simply
skip or repeat frames if needed.
2022-10-01 12:12:25 -07:00
transistor
5278c301ef Added .smd file decoding 2022-09-30 11:24:11 -07:00
transistor
da980b8ae8 Fixed regression when fixing interrupt handling in 68k
Mortal Kombat 2 was working but somewhere while getting the harte
tests to work, I fixed interrupts to change the flags before they're
pushed to the stack, in order to match the expected behaviour from
the tests when an address error occurs (sr is changed and the stack
push causes the error).  I correctly saved the state of sr in the
function for group0 interrupts, to push to the stack later, but the
normal interrupts was saving sr *after* the flags were changed...
Now it saves sr beforehand

I also included some changes to the gfx interface to allow taking
frames, to fix a compile error introduced by the last commit.
2022-09-29 20:21:00 -07:00
transistor
82644db3fc Added dummy audio device to disable audio while still simulating the devices 2022-09-29 19:55:12 -07:00
transistor
9e3b75f9fd Updated readme 2022-09-24 23:17:04 -07:00
transistor
083f3607ba Major reorganization into crates
I wanted to make this a bit more modular, so it's easier in theory to
write external crates that can reuse bits, and selectively compile in
bits, such as adding new systems or new cpu implementations
2022-09-24 23:14:03 -07:00
transistor
c395199977 Minor fixes to some tests 2022-09-24 19:46:34 -07:00
transistor
ce682565a9 Removed ProcessorTests as submodule because it's rather large 2022-09-24 19:24:52 -07:00
transistor
48bf76f430 Fixed some ASR cases, and updated test results 2022-09-18 22:09:56 -07:00
transistor
94d3e1d389 Renamed value and existing to src_val and dest_val in m68k impl 2022-09-18 20:44:45 -07:00
transistor
eea8840483 Fixed the ABCD/SBCD/NBCD instructions (almost)
There are still some failures on the SBCD, but the logic is identical
to other emulator's calculations, but the test case doesn't seem to be
the way it should behave, so I'll leave it for now
2022-09-18 20:34:04 -07:00
transistor
267ef488ab Added PC hack to the various branch/jump instructions 2022-09-18 17:24:37 -07:00
transistor
f5a548ac90 Added test results 2022-09-18 17:10:23 -07:00
transistor
c55e3db87a Added test results with excluded address errors 2022-09-18 17:09:55 -07:00
transistor
1a65f50ba0 Added hack to return instructions to correctly adjust PC 2022-09-18 16:28:14 -07:00
transistor
fa3e484288 Fixed DIVS overflow flag, and issue with exception processing
The signed division overflow was incorrect, and I tried a few bit-wise
approaches, but using the signed 32-bit number to determine 16-bit
overflow using greater than/less than work perfectly

There was also a bug in exception handling where it would push values
to the stack before setting the supervisor flag, but the push funcs
use the supervisor flag to determine which stack pointer to use, so
when an exception happened in user mode, it was pushing to USP when
it should have pushed to SSP
2022-09-18 16:09:50 -07:00
transistor
bbd15abb76 Updated readme 2022-09-17 21:43:09 -07:00
transistor
481dd0d7f7 Fixed part of the problem in RTE test failures with Address Error
The I/N bit in the special status word on the stack should be set
when returning from RTE results in a PC that isn't word aligned.
Every other case pretty much, it should be clear
2022-09-17 21:29:04 -07:00
transistor
914ddb17dd Fixed moa-genisis not compiling 2022-09-17 11:16:16 -07:00
transistor
e3c4ad88ee Fixed most DIVU tests, and some more DIVS ones 2022-09-16 22:54:59 -07:00
transistor
71c10ff0f0 Slightly improved the handling of the I/N bit in Address Error 2022-09-16 20:49:44 -07:00
transistor
ef6fde2a4f Minor fix to RTE 2022-09-15 20:56:52 -07:00
transistor
5304df2a9f Minor fixes to the shift flags, but still haven't fixed the issue 2022-09-15 20:29:47 -07:00
transistor
84d2b5e15b Added test results 2022-09-14 22:51:48 -07:00
transistor
a3fbcc7c16 Fixed some DIV tests 2022-09-14 21:52:24 -07:00
transistor
2a9ca9beae Fixed LINK instruction 2022-09-14 20:09:07 -07:00
transistor
d074b7fc5e Test after fixing MULS 2022-09-13 22:18:22 -07:00
transistor
099b2fcb55 Copied over test results 2022-09-13 22:01:54 -07:00
transistor
42ca95ef5a Minor changes 2022-09-13 22:00:34 -07:00
transistor
575501599a Fixed MULS tests
DIVS tests are no better
2022-09-13 20:56:19 -07:00
transistor
96e79329e7 Added ability to exclude only extended exceptions 2022-09-13 18:42:49 -07:00
transistor
a39557e233 Minor fixes 2022-09-13 16:57:56 -07:00
transistor
c161fe5eb9 Fixed command line arguments after upgrading to clap 3.2.20 2022-09-12 22:43:55 -07:00
transistor
873741846c Implemented the CHK and NEGX instructions 2022-09-12 22:19:01 -07:00
transistor
9ff528c463 Fixed some AddressError tests
Adjusted the PC value stored when an Address Error fault occurs to
use the size of the access operation.

I also flipped the IN bit in the word that's written to the top of
the stack on an AddressError, even though that's opposite of what
the docs say.  It seems to pass the tests.  I probably have something
else going wrong, but it shouldn't be an important bit either way.
2022-09-12 21:47:36 -07:00
transistor
42bfabb743 Added test results 2022-09-11 21:52:29 -07:00
transistor
1a098bde6f Fixed various m68k bugs
Added support for RTR and RESET.
Fixed flags behavior for ASd
Added function to set PC, and fixed some instruction's handling of
an address fault a bit better
2022-09-11 21:27:29 -07:00
transistor
d9a1295dda Fixed ADDX/SUBX instructions 2022-09-11 20:08:29 -07:00
transistor
c4a99245e3 Added option to exclude or only run tests that involve an exception 2022-09-11 18:52:19 -07:00
transistor
03f4e11e3b Added proper AddressError handling to m68k
Also a few fixes, such as correcting a decode error in ADDX
2022-09-11 17:42:54 -07:00
transistor
34bdd86772 Added address mask to memory accesses from the tests 2022-09-11 14:51:58 -07:00
transistor
aa39b4b11f Modified to use SR mask so that certain bits in SR are always 0 2022-09-11 14:50:37 -07:00
transistor
0582625b5e Fixed some issue with m68k
Some debug code was enabled that prevented illegal instructions
from being handled normally with a processor exception

The brief instruction word decoding could cause an illegal instruction
if it didn't match the docs, but the actual implementation would not
complain in those cases, so I modified it to not perform validation
for <=MC68010

Increment and Decrement addressing modes, when using the stack pointer,
will always inc/dec by at least 2 bytes, even if it's a byte operation,
to keep the stack aligned to the nearest word boundary
2022-09-10 21:09:35 -07:00
transistor
27f71b0f33 Added test results 2022-09-10 20:49:26 -07:00
transistor
1a3d8cc0c5 Fixed issue with Inc/Dec addressing modes
For instructions that use an operand twice, where it called
get_target_value and set_target_value, if the addressing mode was
one where it would increment or decrement a pointer, it was
causing a double inc/dec because of the two calls to get/set target.
I added an argument to let the functions know if they will be called
twice, in which case it assumes that get will be the first and set
will be the second, and inc/decs only once in the appropriate function
for whether it pre-incs or post-decs
2022-09-10 14:27:19 -07:00