Commit Graph

104 Commits

Author SHA1 Message Date
transistor fet
342bb8aa3d
Converted Z80 to use emulator-hal traits (#7)
* Converted Z80 to use emulator-hal traits

* Updated emulator-hal

* Added a hacky Signalable trait to replace the Z80 signals

* Minor fixes

* Fixed timing tests and added no io tests option

* Fixed genesis Z80 bus issue

* Fixed addressing for BusAccess impl of Z80

* Fixed tests and clippy lints
2024-06-23 19:42:36 -07:00
transistor fet
97aef5d357
Implemented Inspect and Debug traits from emulator-hal (#5)
* Implemented Inspect and Debug traits from emulator-hal

* Updated emulator-hal submodule

* Updated Cargo.lock

* Fixed missing feature flag and clippy

* Fixed tests
2024-03-20 21:00:33 -07:00
transistor
0361e37e1d Fixed just version 2024-03-17 13:44:06 -07:00
transistor fet
7dac32d844
Added github actions for PRs (#3)
* Added github actions for PRs

* Added some rustfmt::skip attributes

* Applied formatting

* Added rustfmt component in action

* Configured to use rustfmt version 2 which fixes some comment formatting

* Removed ready_for_review condition for github actions

Since it has the synchronize condition, it will update after each
commit, whether in draft or not, so I think this should be alright
2024-03-17 11:03:52 -07:00
transistor
d0037c8125 Fixed tests and clippy warnings 2024-03-16 13:15:34 -07:00
transistor
c20d7afe6e Fixed some tests 2024-03-15 23:01:41 -07:00
transistor
545f339fe2 Separated moa-core dependency into an optional feature flag 2024-03-13 21:49:04 -07:00
transistor
8b274f72cc Modified to use emulator-hal traits 2024-03-08 19:41:36 -08:00
transistor
b4a35641e4 Refactored to separate out the BusPort, to eventually replace it 2024-03-03 22:57:27 -08:00
transistor
cff6a48cc7 Refactoring m68k to use a temporary cycle struct
I'm trying to extract the memory/bus interface, and pass it in at
the start of each cycle instead of having the BusPort permanently
embedded, which will allow migrating to emulator-hal.

The functional way would be argument drilling; passing an extra argument
to each function in the entire execution core.  The problem is that it's
messy, so a solution that is still functional is to implement all of the
execution logic on a newtype that contains a reference to the mutable
state and the owned cycle data, and at the end of the cycle, decompose
the M68kCycleGuard that holds the reference, and keep the cycle data for
debugging purposes.
2024-03-02 23:48:19 -08:00
transistor
ba1d9f0bc1 Updated 2023-08-06 21:31:14 -07:00
transistor
2d3463867d Added AddressTranslator 2023-06-10 23:19:10 -07:00
transistor
f9d613b3b9 Fixed some Z80 instruction timings 2023-06-10 21:55:25 -07:00
transistor
cbcfb26f49 Updated todo list 2023-06-10 20:32:34 -07:00
transistor
be91118bac Added function to create the CPU BusPorts based on the CPU type 2023-06-10 20:28:40 -07:00
transistor
83307d5b33 Changed Error type into an enum 2023-06-10 19:29:54 -07:00
transistor
3bd4c24ea8 Modified debugger so the input is in the frontend
The debug loop that reads a command and does something is part of the
frontend's main loop, so that it can potentially update, even though
it doesn't actually work for minifb because the command input is a
blocking call.  It's also not implemented in the pixels frontend.
At some point I'll make a web frontend.
2023-06-10 15:28:21 -07:00
transistor
8c1a89a1fe Refactored memory access a bit to try to isolate it 2023-05-21 23:14:26 -07:00
transistor
d87319b605 Refactored shift intsructions to not use direction 2023-05-20 15:01:10 -07:00
transistor
f205e231b6 Fixed tests failing due to wrapping into past the end of memory 2023-05-14 21:12:38 -07:00
transistor
f3d1fd0ae2 Added IM, IFF1, and IFF2 checking to Z80 tests, and fixed issues with Z80 impl 2023-05-13 19:41:20 -07:00
transistor
f0cbf5f2ca Fixed some IY instructions, and a few minor fixes 2023-05-13 16:17:14 -07:00
transistor
57f9f93cc9 Fixed the basic IN/OUT instructions on Z80, and basic RETI/RETN 2023-05-13 14:47:27 -07:00
transistor
f8083db181 Added raddad772/jsmoo's Z80 test runner
Special thanks to raddad772 https://github.com/raddad772

Also added some fixes to the Z80 for panicking math operations, but
it still won't complete due to an unimplemented instruction
2023-05-09 21:50:42 -07:00
transistor
5e228c377e Fixed tests after ClockTime and Frequency changes
And also removed HostData
2023-05-07 20:42:55 -07:00
transistor
112bd8219b Replaced controller/key/mouse updaters with event queues 2023-05-06 10:04:44 -07:00
transistor
3471eb4e8c Removed WindowUpdater and BlitableSurface 2023-05-03 22:42:24 -07:00
transistor
71cd47466b Getting closer on the ym2612 implementation
It now sort of sounds like the main instrument, but the drums and bass
aren't there, and I'm not sure why.  I'm pretty sure the envelope and
phase generators are working, and there is feedback although it might
not be correct.  There's no LFO but that isn't used by Sonic 1 from
the register writes at least.
2023-04-29 22:10:34 -07:00
transistor
a6e236a762 Added detune to ym2612, and channel enable, even though it's still only mono 2023-04-29 12:24:21 -07:00
transistor
b243aa9910 Added a not-yet-properly-working version of the phase generator 2023-04-28 20:22:33 -07:00
transistor
03561f1427 Fixed a bug in the frequency setting code for ym2612
It was previously only updating the frequency if the A0 registers
were written last, but now it works the way the rate code does, using
the cached register values to set the frequency whenever a register
is written to.  It also stores the fnumber and block in the operator
which I guess would be needed eventually if I want to save and restore
state.
2023-04-24 23:04:11 -07:00
transistor
31faf70d97 Fixed many bugs in ym2612, and switched to square wave
- The envelope generator wasn't working as it should have, minor issues
  with the limits and whether to use 10-bit or 12-bit values (more to come)
- fixed issues with sustain level where it was always set to 0
- fixed release rate and levels to make them 5-bit and 10-bit numbers
  respectively, so they match the others
- switched from SineWave to SquareWave and this alone made it go from
  terrible and muddy to not that far off.  I probably need to completely
  change the output

- also included an attempt at removing HostData, still needed for an
  interrupt that is triggered by user input
2023-04-24 20:47:52 -07:00
transistor
86eb73f78a Added clock argument to addressable operations 2023-04-23 18:49:40 -07:00
transistor
07a675fab5 Added new clock types similar to Duration 2023-04-23 15:46:47 -07:00
transistor
5740550c95 Non-working implementation of the ym2612 envelope
It does something, but doesn't work as it should.  It could be a few
things including the on/off signal being too slow due to how time
works in the sample generation, but I wanted to at least commit what
I have.  It seems to work roughly right according to the forum post
that describes the chip's operation in detail, but there could still
be some glaring bugs
2023-04-23 10:38:33 -07:00
transistor
10ef61784a Added ym2612 total level and start of envelope implementation 2023-04-09 13:11:45 -07:00
transistor
941c793523 Added pixel encoding, requested by frontend
The hope was that this would reduce the amount of copying and bit
shifting required by the frontend to get the data on screen, but
it doesn't seem to offer much advantage, surprisingly.  I'll leave
it in though.  There are a few other minor tweaks included here to
try to improve the performance a bit
2023-03-25 10:51:46 -07:00
transistor
0ac3f48b64 Minor changes 2023-03-05 13:32:45 -08:00
transistor
ea2fc95905 Cleanup 2022-10-13 20:22:29 -07:00
transistor
cd89a4c57d Minor tweaks to the update loop to keep it more realtime 2022-10-11 22:36:49 -07:00
transistor
0b27ac04e7 Minor fixes to audio 2022-10-11 10:28:59 -07:00
transistor
925a4e0750 Added log crate 2022-10-09 09:40:20 -07:00
transistor
721162684b Updated todo 2022-10-08 13:25:28 -07:00
transistor
a9b8633531 Added mouse support, but it's not used yet 2022-10-02 20:39:02 -07:00
transistor
a9d51fb919 Added DAC to ym2612 and changed mixing method 2022-10-02 10:29:34 -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
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
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
96e79329e7 Added ability to exclude only extended exceptions 2022-09-13 18:42:49 -07:00