Commit Graph

198 Commits

Author SHA1 Message Date
transistor
586a16509f Added an assembler for the m68k
It can encode some basic instructions but not the more complicated
addressing modes or special instructions.  It can keep track of
labels and patch the displacement addresses after assembling the
output data, but it doesn't check for duplicates or that a label
has been declared before it appears.  It also doesn't take into
account the origin yet.  To run it, there is an m68kas command
that will take a file and print the data:
```
cargo run -p moa --bin m68kas <filename>
```

It's not yet tied into the rest of the system, but could be used in
the debugger to allow insertion of new code into a running system.
2022-05-12 21:53:34 -07:00
transistor
061c13fdc7 Updated sn76489 2022-01-26 19:15:46 -08:00
transistor
54bf7a3085 Renamed moa-ym2612 to moa-synth, and put CircularBuffer into its own file 2022-01-26 11:14:52 -08:00
transistor
f464bfa1e0 Fixed audio glitch (but haven't cleaned up code) 2022-01-26 11:12:09 -08:00
transistor
749a9d2250 Added binary to test simple synth sounds for ym2612 2022-01-18 20:24:18 -08:00
transistor
8cf8c07082 Added frequency setting to ym2612 2022-01-16 21:42:07 -08:00
transistor
1413225463 Minor fix 2022-01-16 10:56:32 -08:00
transistor
a60e72fc04 Fixed controllers in Earthworm Jim (but not Mortal Kombat 1) 2022-01-16 10:39:57 -08:00
transistor
d21e2c4d6a Updated dev.to link in part3 post 2022-01-14 10:17:16 -08:00
transistor
a8b59fd668 Updated part3 of Emulating the Genesis 2022-01-13 15:53:40 -08:00
transistor
867f41b77f Added dev.to link to part 2 post 2022-01-12 10:55:43 -08:00
transistor
878bad0b26 Updated part 2 of the Emulating the Genesis series 2022-01-12 10:37:50 -08:00
transistor
22aca270c0 Added dev.to links to posts 2022-01-10 10:00:26 -08:00
transistor
2b51dd3fdd Added part 3 of the Emulating the Genesis series 2022-01-09 21:19:13 -08:00
transistor
2e9a9aa8d9 Minor fixes 2022-01-09 21:18:11 -08:00
transistor
3fc1f6270b Added part 2 of the Emulating the Genesis series 2022-01-09 15:43:41 -08:00
transistor
90d4f0f526 Updated readme 2022-01-09 15:38:21 -08:00
transistor
dac7ff259e Minor fixes 2022-01-09 15:35:15 -08:00
transistor
7a185846ed Added part 1 of the Emulating The Genesis series 2022-01-09 12:38:40 -08:00
transistor
ba298fad64 Minor refactoring 2022-01-08 19:48:04 -08:00
transistor
b8906fdbb1 Minor fixes 2022-01-06 23:40:22 -08:00
transistor
c6eeed03ff Added hackish H/V counter for YM7101 2022-01-02 15:44:41 -08:00
transistor
ba1dc78ff1 Added video demo to README 2021-12-31 14:49:26 -08:00
transistor
dd0495e611 Updated readme 2021-12-31 14:29:28 -08:00
transistor
cdbc93bb8a Minor reorganization 2021-12-31 14:00:55 -08:00
transistor
a67c7bf56e Removed old draw code from YM7101 2021-12-31 11:41:34 -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
bf938855e1 Fixed final major bug with hscroll, where I needed to multiply by 32 instead of 16 2021-12-26 21:29:01 -08:00
transistor
ac9ec8840c Fixed hscroll issue (vscroll and hscroll were backwards) 2021-12-26 19:45:45 -08:00
transistor
10ca0c7995 Added watch command to debugger
It's a bit weirdly implemented because the Addressable trait doesn't
have access to System, so it has to set a flag on the Bus which is
then checked during the step function in System to activate the
breakpoint if a watched memory location was written to
2021-12-26 16:32:15 -08:00
transistor
588c0b56a2 Fixed bug in DIVS for m68k (was using unsigned operation) 2021-12-26 16:28:34 -08:00
transistor
b848e6261f Added ability to set breakpoints on named devices 2021-12-25 16:30:56 -08:00
transistor
188717e228 Added option to ignore reads/writes to unmapped bus areas 2021-12-25 16:30:07 -08:00
transistor
4c99cbf240 Added dev logs 2021-12-23 19:32:48 -08:00
transistor
825331df39 Fixed occasional error with debug, and modified frame swapper 2021-12-23 19:32:15 -08:00
transistor
f08c4fc4a9 Fixed minor bug 2021-12-22 19:27:20 -08:00
transistor
d0b5d9047e Added Cargo.lock to fix issue with clap 2021-12-22 19:24:59 -08:00
transistor
5c415da3c3 Minor fixes 2021-12-21 21:02:55 -08:00
transistor
ed030082cd Finally fixed the animation speed in sonic 2
It turned out to be an issue with the interrupts and when the
vertical interrupt was triggered vs when the vertical blanking
bit was set.  The interrupt code in sonic 2 tries to read the
status bit after the vint occurs, and if the vblank bit is set,
it runs the Vint_Level function, but the hacky code I wrote
turned the vblanking bit on after 14ms and off when it triggered
the vint, instead of turning it on at 15ms, and off at 1.2ms, with
the int occuring at the *start* of the time the blanking bit is
set.  So the code had been waiting for 14ms after the vint until
it actually started processing thing, which didn't complete before
the next vint, so it only ran the main game loop every 33.2ms which
is why doubling the speed of the simulated execution time made it
seem about the right speed
2021-12-20 20:41:25 -08:00
transistor
18e54f4a44 Added line-based hscroll and fixed an hscroll bug
The hscroll table was multiplying by 2 (because scroll a and b values
are next to each other) but it should have multiplied by 4 because
each value is also 2 bytes and the array is of u8.

I added hscroll by-line support by using a different function for the
line scroll vs the cell or whole screen scrolling.  There are still
a bunch of glitches in scroll b's scroll values that I need to fix
2021-12-20 20:11:43 -08:00
transistor
4ca0c9b625 Fixed bug in genesis controllers with incorrect counter
The TH counter in the genesis controller code was increasing each
time the TH bit changed state instead of only in one direction.
Surprisingly it worked before, and fixing it made it not work in
Sonic 2, but after adding the 1.5ms timer to reset the TH counter,
it worked again.  I guess Sonic2 only reads the 3 buttons instead
of all 6.  It should now work with both 3 and 6 button games
2021-12-20 20:08:11 -08:00
transistor
cbf91309d9 Fixed debugger to easier debug one cpu at a time
Previously it would show a dump of whatever device was next scheduled
to step, if it was Debuggable, but now each debuggable device has a
flag for whether that device is being debugging, and a system flag
to disable it entirely.  When the system flag is set, it will try
to enable debugging on the device labelled "cpu".  I need to also add
a way of setting a breakpoint on a named device, which will enable
debugging of that device
2021-12-20 19:53:12 -08:00
transistor
5095aee531 Fixed warnings 2021-12-14 21:23:08 -08:00
transistor
e3819fe549 Added timing to m68k implementation 2021-12-14 21:13:01 -08:00
transistor
1b6cbfa831 Fixed some decoder bugs in m68k 2021-12-14 16:06:34 -08:00
transistor
148b4dcf2c Cleaned up warnings 2021-12-13 12:00:24 -08:00