Commit Graph

94 Commits

Author SHA1 Message Date
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
transistor
c161fe5eb9 Fixed command line arguments after upgrading to clap 3.2.20 2022-09-12 22:43:55 -07:00
transistor
8cf8c07082 Added frequency setting to ym2612 2022-01-16 21:42:07 -08:00
transistor
a60e72fc04 Fixed controllers in Earthworm Jim (but not Mortal Kombat 1) 2022-01-16 10:39:57 -08:00
transistor
ec461a61c0 Added support for window in Genesis 2021-12-31 11:40:13 -08:00
transistor
8c58903f73 Rewrote the Genesis/YM7101 draw loop to work pixel-by-pixel
In order to more accurately emulate the VDP, the main draw loop is
now going through each pixel on the screen and calculates the various
cells that should be displayed, gets the exact pixel data, and then
draws lines them all up in priority-order, and whichever is the first
non-mask pixel colour gets put into the frame buffer.  It's rather
verbose and duplicative, but I'll fix it up now that I have something
working
2021-12-30 22:46:57 -08:00
transistor
aee956f2fa Refactored ym7101 (Genesis VDP) code
The memory handling and DMA transfer code is separate from the
drawing code, but it's still a bit clumsy so I'll probably change
it more eventually
2021-12-30 11:27:50 -08:00
transistor
5d6af61531 Incomplete addition of shadow/highlight mode for Genesis 2021-12-29 10:54:43 -08:00
transistor
1534644409 Added command line arg to adjust the speed of simulation 2021-12-28 22:36:52 -08:00
transistor
188717e228 Added option to ignore reads/writes to unmapped bus areas 2021-12-25 16:30:07 -08:00
transistor
5c415da3c3 Minor fixes 2021-12-21 21:02:55 -08:00