Commit Graph

54 Commits

Author SHA1 Message Date
transistor
1c5ad3999a Minor fixes 2024-04-07 19:52:10 -07:00
transistor
59199533eb Added a hacky Signalable trait to replace the Z80 signals 2024-04-07 10:38:41 -07:00
transistor fet
6e7e315808
Modified for Instant as associated type in emulator-hal (#6)
* Modified for Instant as associated type in emulator-hal

* Updated emulator-hal to latest
2024-03-22 18:51:17 -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
59306bceff Fixed alloc in harte_tests that was taking all the time 2024-03-14 22:35:02 -07:00
transistor
545f339fe2 Separated moa-core dependency into an optional feature flag 2024-03-13 21:49:04 -07:00
transistor
e0330d41a5 Added some fixes 2024-03-09 23:58:07 -08:00
transistor
8b274f72cc Modified to use emulator-hal traits 2024-03-08 19:41:36 -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
55efc4f406 Split some parts of moa-core into libraries/ 2024-03-01 21:17:09 -08:00
transistor
9ff431ebc6 Split clocks into femtos crate 2024-02-24 13:02:09 -08:00
transistor
2552645a60 Modified genesis coprocessor banking to use a Cell instead of Signal 2023-06-10 23:28:40 -07:00
transistor
2d3463867d Added AddressTranslator 2023-06-10 23:19:10 -07:00
transistor
83307d5b33 Changed Error type into an enum 2023-06-10 19:29:54 -07:00
transistor
e3861f33b5 Fixed tests and clippy warnings 2023-06-10 17:39:20 -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
18d1912f9a Added debuggables list to system 2023-06-07 21:08:28 -07:00
transistor
fdca8970f2 Added new Device type to replace TransmutableBox
It's mostly just sugar, but it now includes a unique ID
2023-06-07 20:44:14 -07:00
transistor
3db52cbef6 Changed the Addressable trait's len() to size()
This is to avoid the need for the clippy override
2023-06-07 19:56:00 -07:00
transistor
708e7706f3 Fixed many of the undocumented tests
Now it's up to 99% tests passing, 15362 are still failing, but many
of those are the unimplemented IN/OUT instructions, which the Genesis
doesn't seem to use
2023-05-22 21:12:05 -07:00
transistor
8c1a89a1fe Refactored memory access a bit to try to isolate it 2023-05-21 23:14:26 -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
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
6389fa0482 Connected the web ui controller inputs to sim 2023-05-07 14:57:45 -07:00
transistor
527f65c69b Refactored audio to use ClockedQueue
It now actually checks the clock and tries to mix the audio in sync
relative to the clock, but the cpal output doesn't yet try to sync
to the StreamInstant time.  Sound seems a lot better on chrome in
wasm, but and kind of better on firefox despite frame skipping not
being supported yet, but it's way slower for some reason (12fps)
2023-05-07 10:03:25 -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
dcc3c97dd6 Additional ym2612 improvements 2023-04-24 21:29:42 -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
69c94fa3af Removed cpu timer and moved audio wave generators to libraries 2023-04-23 19:52:19 -07:00
transistor
86eb73f78a Added clock argument to addressable operations 2023-04-23 18:49:40 -07:00
transistor
cd5336bc23 Minor fixes to clock code 2023-04-23 16:17:07 -07:00
transistor
07a675fab5 Added new clock types similar to Duration 2023-04-23 15:46:47 -07:00
transistor
f298d1b341 Moved parser to its own library 2023-04-23 12:40:34 -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
9be996d2a1 More clippy fixes after updating rustc 2023-03-05 20:34:30 -08:00
transistor
7bdd63bc76 Fixed all clippy warnings 2023-03-05 20:19:49 -08:00
transistor
0ac3f48b64 Minor changes 2023-03-05 13:32:45 -08:00
transistor
925a4e0750 Added log crate 2022-10-09 09:40:20 -07:00
transistor
e4cd3dcd63 Sort of working audio using queues 2022-10-08 13:26:17 -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