-
-
Notifications
You must be signed in to change notification settings - Fork 1
Internals
This page has a few notes about the internals. I'm aware the code falls short of being good and easily understandable and easily readable. So here are some notes about how it works inside. I will (hopefully) be editing this page as and when I work the codebase.
One thing about emulation (and of course, any software which has emulation as a part) is that there is so much fiddly detail to keep track of. Strop is a bit different from a true emulator such as emulates an actual hardware, because
a) needs to be able to emulate any number of different platforms
b) doesn't need to be precise about timing
c) no need for stateful hardware such as DMA engines or UARTs.
but even so, we need to test for the corner cases and subtle things like a CPU's status flags and suchlike. This we can do by comparing what strop does to an off-the-shelf emulator.
So the basic strategy for testing this thing is a combination of fuzz testing and regression testing. So can see that the machine::mos6502
module pulls in the mos6502 crate and fuzz tests against that. The fuzz test either passes (it hasn't yet) or outputs a failing unit test. These failing tests are added to a regression test in machine::mos6502::tests
, which causes the failure to be tested for with every push to github. For reasons of reproducibility and with a mind to reduce spent time & energy, the fuzz tests are not automatically run in this way. The intention is that the fuzz test is only run on a developer's local machine.
To run the fuzz test, use cargo test machine::fuzz::mos6502
or so. To run the regression tests, use cargo test machine::mos6502
or so.