1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-07-05 01:28:58 +00:00
Commit Graph

216 Commits

Author SHA1 Message Date
Peter Evans
0333e308e7 Test decimal mode with ADC 2018-02-26 20:02:58 -06:00
Peter Evans
30c07df9cb When carry is set, subtract one fewer, not one more
A subtle misunderstanding... which led to bizarre and unexpected
behavior elsewhere.
2018-02-26 18:59:25 -06:00
Peter Evans
d1a6441c5a Add missing tests for vm_debug.c 2018-02-26 14:25:02 -06:00
Peter Evans
f376f00688 Fix scan test not to rely on buggy operand output 2018-02-25 16:16:14 -06:00
Peter Evans
7b3b30a0f2 Use addr2 for ws tests
I take it back from the previous commit--the test was written with an
assumption that was not how execute() works
2018-02-25 16:14:05 -06:00
Peter Evans
e50fda62be Add step command 2018-02-25 15:41:37 -06:00
Peter Evans
01f230dc85 Add unbreak command, unbreak_all() function for testing 2018-02-25 14:38:24 -06:00
Peter Evans
588362abee Add prompt; quit command; breakpoints 2018-02-25 14:25:02 -06:00
Peter Evans
09f7152e07 Add writeaddr command 2018-02-24 19:38:04 -06:00
Peter Evans
06bf63ecb2 Add jump debug command 2018-02-24 19:36:02 -06:00
Peter Evans
1be1abc0af Add printaddr, printstate 2018-02-24 18:57:00 -06:00
Peter Evans
ec253905ad Add resume command, finder function, arg parser, execute 2018-02-24 16:30:46 -06:00
Peter Evans
a614c1e5df Add new file, vm_debug.c, and help command for it 2018-02-23 21:58:30 -06:00
Peter Evans
ac5d532a7f Fix length bug with s_bytes (one too short)
This also fixes tests for disassembly so that they account for changed
output. Finally this also exits if we have to perror in the setup
function.
2018-02-23 21:35:53 -06:00
Peter Evans
395ac4a841 Disassembler now outputs more idiomatic code
It also no longer prints out register and address state
2018-02-23 20:46:24 -06:00
Peter Evans
0d1e22a348 Add support for decimal mode ADC/SBC.
This also corrects a bug where SBC set carry incorrectly in binary mode.
2018-02-23 00:46:07 -06:00
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
90892c32e4 Add TSB (Test and Set Bits) instruction
This commit also moves the TRB code from loadstor to bits, which is
where it should have been all along.
2018-02-22 13:39:48 -06:00
Peter Evans
a4c3d1c4ef Implement the TRB (Test and Reset Bits) instruction 2018-02-22 00:39:33 -06:00
Peter Evans
807362e871 Add STZ instruction (to store zero) 2018-02-22 00:02:57 -06:00
Peter Evans
8e1ab0e950 Add support for PHX, PHY, PLX, PLY
These instructions allow you to push and pull (pop) the X and Y
registers via the stack.
2018-02-21 23:32:57 -06:00
Peter Evans
f9a277e7bc Add new Branch Always instruction 2018-02-21 21:57:21 -06:00
Peter Evans
8623945bbf Add the ability to INC or DEC the accumulator
This is an oversight from the 6502 processor that was rectified in the
65c02 model.
2018-02-21 21:20:05 -06:00
Peter Evans
7b65dc1657 Add new BIM instruction (BIt imMediate mode)
This is not a real instruction in the 65c02 processor; I invented it for
the sole purpose of handling the specialized logic that is performed by
BIT in IMM mode. To be fair--I can imagine this really _was_ implemented
as a "separate" instruction on the chip! But I don't know that for sure.
2018-02-21 21:01:46 -06:00
Peter Evans
61eb880f49 Refactor code to pass image type in 2018-02-21 00:23:12 -06:00
Peter Evans
8706a81d1f Remove spurious printf 2018-02-20 15:55:40 -06:00
Peter Evans
1091ec6e2a Pass image type into enc_dos; use sector_num instead of a table pointer 2018-02-20 15:36:23 -06:00
Peter Evans
c2e90651ac Again, latch data must be > 128 (0x80) 2018-02-20 14:44:17 -06:00
Peter Evans
e826fc05d9 We can only write latch data that is > 128 2018-02-20 14:43:33 -06:00
Peter Evans
08f3899de4 Tracks don't move from shifting; sector work
The sector work being:

- We only wrap around if we go beyond the length of an encoded track, so
use ENC_ETRACK.
- If we DO wrap around, we don't use modulus; we simply reset to zero.
2018-02-20 14:33:36 -06:00
Peter Evans
c7fbb4aa50 Backward steps require adjacent phases 2018-02-20 14:30:20 -06:00
Peter Evans
28061c1d11 Adjust length/data for sectors; cleanup some magic numbers 2018-02-20 01:00:46 -06:00
Peter Evans
2318b1917a This form needs two RORs to work
That's because the first ROR pushes the 1 in bit0 into the carry bit;
the second moves the carry bit into the bit7 position, which will match
128.
2018-02-19 22:01:30 -06:00
Peter Evans
d590a809d8 Tests should reflect how carry is handled in ROL/R now 2018-02-19 21:59:55 -06:00
Peter Evans
65f13bb1e4 Add missing output and fix buffer size issue
We use BUFSIZ everywhere, except in setvbuf(), which kinda needs to know
the proper buffer size. Because we were passing 256, which is (much!)
lower than BUFSIZ, we were wrapping output around in an odd, unexpected
way.
2018-02-19 21:49:58 -06:00
Peter Evans
9f0d7f5413 Fix some compile failures due to changed params 2018-02-19 20:03:25 -06:00
Peter Evans
9e26e215cd In which we discover that image doesn't matter 2018-02-11 20:38:51 -06:00
Peter Evans
350a06890a Split up logic for keyboard test
In accordance with the split in logic we had made for the source
function
2018-02-10 18:31:38 -06:00
Peter Evans
69d425db2d Add tests for vm_di 2018-02-10 18:25:29 -06:00
Peter Evans
919869289e Add missing test for reflect functions, init 2018-02-10 18:20:50 -06:00
Peter Evans
aee0521b0a Change key to ALT+Q 2018-02-07 16:08:43 -06:00
Peter Evans
fa938470d3 Account for changes to vm_reflect functions 2018-02-07 14:44:37 -06:00
Peter Evans
8450ccd3c5 Unit-testing builds now define TESTING 2018-02-06 23:38:15 -06:00
Peter Evans
1f50ceb4c5 Add test file for apple2.reflect.c 2018-02-06 14:27:44 -06:00
Peter Evans
5cfdd28302 Add vm_event tests 2018-02-05 21:40:36 -06:00
Peter Evans
c1c42834ed Add reflect system to virtual machine 2018-02-05 20:31:05 -06:00
Peter Evans
e691d33d42 Add dec_nib test 2018-02-04 16:09:02 -06:00
Peter Evans
70b0532a26 Add test for dec_dos 2018-02-04 16:06:54 -06:00
Peter Evans
599b7c9212 Add test for dec_track 2018-02-04 15:44:59 -06:00