1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-18 22:06:01 +00:00
Commit Graph

12 Commits

Author SHA1 Message Date
Peter Evans
978ad1faaf Formerly "BAD" instructions are now forms of NOPs
But weird forms. In most cases they basically are NOPs, except with
different opcodes. In other cases, we call them NP2 and NP3s, and do so
because they consume 2 or 3 bytes respectively (vs. just 1 with NOP).

We had to teach some arcane magic to the emulator for this to work. We
may want to refactor to decouple the number of bytes consumed from the
address mode.
2018-02-22 14:07:05 -06:00
Peter Evans
e35ff91fa7 Clear the decimal bit in BRK; also improve test logic for BRK 2018-02-22 13:44:13 -06:00
Peter Evans
c946eb3f69 Fix incorrect stack info
(The previous behavior of RTS/JSR was not right.)
2018-01-23 21:35:59 -06:00
Peter Evans
7d6886a3a8 Change last_addr field to eff_addr 2018-01-12 13:57:48 -06:00
Peter Evans
7f6b8d3587 We can no longer assume PC increments during address handling
This change required a number of consequent changes to assumptions we'd
made, and I'm not 100% confident we have things right at this point in
time.
2018-01-09 20:59:14 -06:00
Peter Evans
68b1b79549 Added a "fix" to JSR test.
It's really wrong, because we _should_ be storing PC + 2 in the stack.
And software's definitely gonna bork when we try emulating them, because
they will invariably inspect the stack and assume that's what we have in
there.

But the proper fix is to not actually do next_byte(), and to never
advance PC outside of the execute function. But that's a bigger change
than I want to do at this specific moment.

So, in the meantime, you have me prattling on in a commit message. Lucky
you!
2018-01-09 16:26:21 -06:00
Peter Evans
1de1e7788a Rename status flags to MOS_ 2018-01-05 14:18:39 -06:00
Peter Evans
c4a6f77bcd We should be using the rts handler function
Oops!
2017-12-09 14:53:18 -06:00
Peter Evans
a720246e26 We need to account for the P register on the stack 2017-12-09 14:52:55 -06:00
Peter Evans
f44b029083 We need to check P's value as well
This test broke once we began to (properly) push P onto the stack.
However, I'm not _clear_ on whether we should push P before or after we
set the INTERRUPT bit... We'll go with things as-is for now.
2017-12-09 14:50:33 -06:00
Peter Evans
00ff9f069d Vastly simplify unit tests for mos6502
Criterion's init and fini config options allow us to register setup and
teardown functions. We now use this to register the common cpu variable
for the mos6502 tests, albeit through the use of a global variable.

Doing so necessitated that each of the different test files have their
own suites, due to some implementation details in Criterion, but this is
No Big Deal.
2017-12-06 15:57:15 -06:00
Peter Evans
87de0a877a Add all our tests, plus other fixes 2017-12-03 20:19:17 -06:00