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
2e334e2ee1
Update tests with correct expected text from disassembler
2018-01-23 21:19:26 -06:00
Peter Evans
80136e9360
Most status flags are now set when the CPU is created
2018-01-23 20:41:48 -06:00
Peter Evans
0b03fd24f5
Carry must also be factored in
2018-01-23 20:26:01 -06:00
Peter Evans
5656b271ee
Account for carry being set by default
2018-01-23 16:30:52 -06:00
Peter Evans
746e2246b3
Set negative and unset zero since the operand >= A
2018-01-23 16:29:53 -06:00
Peter Evans
3c7002c6c7
Carry is only unset if the operand >= A
2018-01-23 16:29:08 -06:00
Peter Evans
dc97a6996e
Account for carry being set by default
2018-01-23 16:28:39 -06:00
Peter Evans
b02679f6a0
Carry must be unset
2018-01-23 16:26:05 -06:00
Peter Evans
522905b39c
Carry must be unset in this test
2018-01-23 16:24:46 -06:00
Peter Evans
60ff0e5781
Carry is set by default now
2018-01-23 16:24:16 -06:00
Peter Evans
a3598ecd16
The stack pushes from the end of the page now
2018-01-23 16:21:43 -06:00
Peter Evans
8edf83f7ad
Carry is set only if the result is > 0xFF
2018-01-23 16:20:33 -06:00
Peter Evans
8133781fd3
Use the address mode enum itself
2018-01-23 16:18:22 -06:00
Peter Evans
7a0ea50aa3
The stack now only works with 8bit values; disable carry
2018-01-23 16:16:59 -06:00
Peter Evans
ef13fe4ef1
Require STATUS_DEFAULT, stack pointer at ff
2018-01-23 16:07:21 -06:00
Peter Evans
2f777ce881
Several core changes to status, soft switches
...
Regarding soft switches, we had several we should have been listening
for on both reads and writes, but were only doing so on writes; this is
now fixed.
Regarding statuses, we were incorrectly calculating both carry and
overflow. This should now be fixed, although some quick examinations of
disassembly output suggest there is something else amiss. Debugging will
continue shortly.
2018-01-20 21:01:26 -06:00
Peter Evans
2c319399d2
Change disassembly to add more info
2018-01-19 00:34:57 -06:00
Peter Evans
96b8b77f37
Use apple2.tests.h for setup/teardown
2018-01-17 15:31:12 -06:00
Peter Evans
c8dbf1c84c
Add missing tests for new vm_screen functions
2018-01-17 15:16:12 -06:00
Peter Evans
53f40ff960
Add tests for apple2.kb.c
2018-01-17 14:58:42 -06:00
Peter Evans
6670df930b
Remove unnecessary functions and tests
2018-01-17 14:02:37 -06:00
Peter Evans
8d4283b1dc
Add first work on keyboard support
...
Mainly the switch_read function, which had necessitated some work done
in the vm_screen area
2018-01-16 23:50:02 -06:00
Peter Evans
2c39120098
Rename video_mode -> display_mode
...
This also changes the _kind_ of field from an incrementally enumerated
one to a collection of bit flags.
2018-01-16 16:13:50 -06:00
Peter Evans
bcf6b213a6
Account for changes to rom segment structure
2018-01-16 15:46:35 -06:00
Peter Evans
caea83f9c6
Add missing unit tests for pc mapper functions
2018-01-16 14:22:08 -06:00
Peter Evans
a0a5132099
Add pc file for peripheral card ROM
2018-01-15 23:50:33 -06:00
Peter Evans
be23bb7166
Remove unneeded test stub
2018-01-13 15:57:02 -06:00
Peter Evans
cadc19b3e5
Add display buffer read/write mappers
2018-01-13 15:40:40 -06:00
Peter Evans
45eb7b5e58
Add zero page memory mapper functions
...
This also adds tests for those functions. We have, furthermore, removed
some redundant (and non-externed!) functions from apple2.mem.c which was
the old bank switching code that got moved to apple2.bank.c.
2018-01-13 00:38:29 -06:00
Peter Evans
3738d70a43
Switch bank code into its own file
2018-01-12 22:06:49 -06:00
Peter Evans
c953616a71
Finish refactor to separate bank_switch and memory_mode
...
There is one failing test, which I expect to fail at this point; that's
because we need to write a read/write map function for the stack and
zero page so that they use aux memory when BANK_ALTZP is on, and main
memory when not.
2018-01-12 21:04:21 -06:00
Peter Evans
647139924b
Small comment
2018-01-12 14:51:00 -06:00
Peter Evans
f69454c965
Some soft switches now require consecutive reads
...
To allow this to work, we had to allow the CPU struct to record what the
last opcode/operand/address were, although in truth we only needed the
last address.
2018-01-12 14:49:27 -06:00
Peter Evans
7d6886a3a8
Change last_addr field to eff_addr
2018-01-12 13:57:48 -06:00
Peter Evans
1b2e9d952b
Add missing test code for the aux bank switch
2018-01-11 22:35:23 -06:00
Peter Evans
c4c0312402
Add missing tests for read/write bank switches
2018-01-11 22:24:19 -06:00
Peter Evans
6d21774e78
Add missing tests
2018-01-11 21:58:17 -06:00
Peter Evans
578e0b291c
Allow us to switch main/aux; write bank switch mappers
2018-01-11 19:52:13 -06:00
Peter Evans
9d2f9b6f60
Refactor to remove ram2
...
Both main and auxiliary memory need to keep an extra 4k of memory that
is bank-switchable, so we have changed to store that memory literally
within the main and aux segments.
2018-01-11 13:19:17 -06:00
Peter Evans
288b4a9e8d
The boot procedure no longer defaults bank_switch to 0
2018-01-10 21:50:43 -06:00
Peter Evans
8d9b48912e
Add memory injection to 6502; main memory in apple2
...
Note that memory _is_ now managed in apple2, and _not_ in mos6502.
2018-01-10 21:28:05 -06:00
Peter Evans
3db536a83d
Change memory_mode -> bank_switch
...
This also changes the concept of the field; bank_switch is a collection
of bit flags now.
2018-01-10 19:59:33 -06:00
Peter Evans
fcba14f91b
Add set16 function
2018-01-10 16:43:14 -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
04aab568df
Oh, little-endian issues; you are my bane
2018-01-09 16:28: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
b492b44e0c
We have a raft of changes here...
...
1. In some cases we corrected little-endian issues.
2. In others, we need to correct expected output to account for PC,
cycles and hex dumps.
2018-01-09 16:24:51 -06:00
Peter Evans
7e51339b88
Account for incremented PC byte in rel tests
2018-01-09 16:06:41 -06:00
Peter Evans
4beff0bff8
Remember that we must obey little-endian order
2018-01-09 16:00:15 -06:00