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
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
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
98f640f0d1
Use the proper sector header length (20 bytes)
2018-02-20 14:35:07 -06:00
Peter Evans
508be6458a
Pass in sector table for logical-physical orders
...
We were not encoding data properly, because in DOS 3.3 and ProDOS,
sectors must be interleaved on disk media (whereas in the original image
form, data is laid out in a linear fashion).
This solves a bug where we erroneously encountered a "bad" opcode (a7)
in the program code.
2018-02-19 18:49:37 -06:00
Peter Evans
96e4b5d9d8
Remove JSR WAIT
to speed up disk II controller
2018-02-19 00:48:11 -06:00
Peter Evans
c89e855559
Update to use correct encoded sector length
2018-02-18 23:46:18 -06:00
Peter Evans
3223fe6110
Enable disassembly toggle (ALT+D)
2018-02-07 15:24:02 -06:00
Peter Evans
308a1070ae
Add paused field, pause execution
2018-02-07 14:44:04 -06:00
Peter Evans
433d9a436f
Add pause function, flesh out machine_info
2018-02-07 14:43:20 -06:00
Peter Evans
a84b4c12e9
Treat pause and disasm as toggle functions
...
This allows us to remove the resume and disasm_off functions. (The
disasm_on function is simply renamed to disasm.)
2018-02-07 14:41:44 -06:00
Peter Evans
360e9243f8
Use the DI container to get machine/cpu/etc
2018-02-07 00:02:20 -06:00
Peter Evans
c35a6cb827
Add VM_OUTPUT DI entry
2018-02-07 00:01:57 -06:00
Peter Evans
09017aa171
Use DI to obtain the reflect struct
2018-02-07 00:01:27 -06:00
Peter Evans
4e0892dc86
Add dependency injection container for vm
2018-02-06 23:24:48 -06:00
Peter Evans
608b2259e5
Break keyboard event logic out into normal/special
2018-02-06 16:29:15 -06:00
Peter Evans
a388cf0158
Add missing param name for reflect struct
2018-02-06 14:26:57 -06:00
Peter Evans
fbee851daf
Add apple2 reflect code
2018-02-06 00:30:46 -06:00
Peter Evans
b7f2cabb3e
Add new REFLECT macro to allow other code to define funcs
2018-02-05 21:55:13 -06:00
Peter Evans
c1c42834ed
Add reflect system to virtual machine
2018-02-05 20:31:05 -06:00
Peter Evans
92ee67c8d8
Allow us to signal that we should exit
2018-02-05 00:35:04 -06:00
Peter Evans
72c4111458
Add event system; move event code into vm_event.c
2018-02-05 00:28:22 -06:00
Peter Evans
7212a1041a
Encoded tracks should be longer
2018-02-04 15:41:48 -06:00
Peter Evans
4777886d2d
Add missing decl for phaser
2018-02-04 00:26:01 -06:00
Peter Evans
8009a33bd4
Use int return for error code
2018-02-04 00:06:22 -06:00
Peter Evans
dd2b956b49
Add ERR_INVALID error code
2018-02-04 00:06:04 -06:00
Peter Evans
a970759bec
Add missing extern for the save function
2018-02-03 21:17:54 -06:00
Peter Evans
a6c1564747
Add fwrite function, support for streams and types
2018-02-03 20:50:08 -06:00
Peter Evans
2dd21f1487
Add image type, image segment
2018-02-03 18:10:29 -06:00
Peter Evans
5fc0206ff6
Add defines for track/sector sizes
2018-02-03 00:24:22 -06:00
Peter Evans
5ac2fbdbee
Add new decode functions, flesh out sector code
2018-02-03 00:23:57 -06:00
Peter Evans
fadf5a9782
Add decode...code
2018-02-01 18:41:01 -06:00
Peter Evans
f87f77b806
Add ENC_VOLUME definition
2018-01-31 15:58:57 -06:00
Peter Evans
7ffe2cb527
Add _140K_NIB_ define
2018-01-31 14:28:00 -06:00
Peter Evans
8a53e02f00
Rename to enc.c, add header file
2018-01-31 00:09:07 -06:00
Peter Evans
58e2373a4d
Add locked field to apple2dd struct
2018-01-28 18:06:41 -06:00
Peter Evans
9402eccc04
Add, and use, Apple //e enhanced rom
2018-01-27 19:54:19 -06:00
Peter Evans
9c0e01ecd2
Add drive phases, switches for control and i/o
2018-01-26 19:49:19 -06:00
Peter Evans
f36bba2e83
Add extern for the prepare function
2018-01-24 20:05:19 -06:00
Peter Evans
d581194bbc
Add apple text functions and refactor draw logic for text
2018-01-24 16:11:08 -06:00
Peter Evans
8bbe337643
Move open apple to index 0
2018-01-24 15:05:29 -06:00
Peter Evans
6069ab4d1b
Add inverse font
2018-01-24 14:26:28 -06:00
Peter Evans
775a145480
Rework screen display logic for more efficiency
2018-01-23 14:52:16 -06:00
Peter Evans
945bf23f22
Use correct default status and memory mode
2018-01-21 21:33:12 -06:00
Peter Evans
ecd8a7974a
Add "BAD" instruction to crash when we hit an invalid opcode
2018-01-21 12:48:34 -06:00
Peter Evans
0581ed6b44
Fix stack in several ways
...
1. The stack should descend, not ascend;
2. The stack should be pushed byte for byte; meaning, when pushing P or
A, those should consume one byte, not two;
3. The MSB should be pushed first when doing JSR and BRK, which makes
some sense if you were reading the stack from $0100 - $01FF.
2018-01-21 01:09:42 -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
6b160c6ca2
Show the dereferenced value for a given address
2018-01-19 12:18:24 -06:00
Peter Evans
2c319399d2
Change disassembly to add more info
2018-01-19 00:34:57 -06:00
Peter Evans
d4bf5da480
Draw text in 40 column mode
2018-01-18 16:21:25 -06:00
Peter Evans
53f40ff960
Add tests for apple2.kb.c
2018-01-17 14:58:42 -06:00
Peter Evans
bf529d6c9b
Finish map, mapper handling for keyboard events
...
We still need to revise the test code we currently have for handling
keyboard functions; I imagine some code will need to be removed.
2018-01-17 01:07:31 -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
2b688c7815
Add last key, strobe fields
2018-01-16 23:49:34 -06:00
Peter Evans
9d6869bfc4
Add missing decls for switch read/write
2018-01-16 23:49:14 -06:00
Peter Evans
9811bbe450
Add switch read/write for display buffer switches
2018-01-16 23:48:49 -06:00
Peter Evans
b1177784a0
Allow access to the last key pressed and key_pressed status
2018-01-16 23:42:10 -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
a0a5132099
Add pc file for peripheral card ROM
2018-01-15 23:50:33 -06:00
Peter Evans
2db5c791ba
Remove peripheral rom init
2018-01-15 17:42:27 -06:00
Peter Evans
ac39349344
Reorganize ROM storage
2018-01-15 17:10:27 -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
ceccacfbc8
Rework bank switch and memory mode into their own fields.
...
This is to better define and respect the various modes that you can have
in Apple II memory access. This is a work in progress at the moment.
2018-01-12 16:21:49 -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
9564f86a57
Remove flash_memory function
2018-01-11 21:57:52 -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
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
04854d903c
Add aux memory field
2018-01-10 20:36:44 -06:00
Peter Evans
8898c3e59d
Use macros to define segment read/write map functions
2018-01-10 20:12:48 -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
538b5ddaa0
Add address for reset vector, applesoft, powerup
2018-01-10 16:47:45 -06:00
Peter Evans
fcba14f91b
Add set16 function
2018-01-10 16:43:14 -06:00
Peter Evans
a785eb5665
Remove next_byte, read_byte; remove opcode from execute
...
The execute function should just work from the PC register. It might
seem to be easier to test by passing an arbitrary opcode into the
function, but because so much of the chip's execution is
context-sensitive (that is, it expects PC to be pointing at the opcode,
to have its operand in front of it, etc.), passing an arbitrary opcode
is not really reflective of what needs to be in place for the function
to work correctly.
2018-01-09 20:56:11 -06:00
Peter Evans
0e0244162f
Change objstore structure to contain all peripheral ROM
2018-01-09 15:56:21 -06:00
Peter Evans
01174b63dd
The data in objstore_data was not in the correct order.
...
See also the change in tools/store-data; the system rom was first, when
the disk2 rom should have been first.
2018-01-08 16:19:41 -06:00
Peter Evans
b2add9c3de
Move vm_area logic into its own file
2018-01-07 20:05:02 -06:00
Peter Evans
95e57a8e19
Add get_map_machine function.
...
Mostly useless except for testing.
2018-01-07 20:00:09 -06:00
Peter Evans
ba47de0e4b
Add objstore_clear(), tests for objstore
2018-01-07 16:30:33 -06:00
Peter Evans
888eb25797
Refactor a bit for easier testing; add log_stream()
2018-01-07 15:05:20 -06:00
Peter Evans
665f7de37c
Rename apple2dd_ to apple2_dd_
...
Except for the struct object (apple2dd).
2018-01-07 13:44:07 -06:00
Peter Evans
8ad1311536
Add set_memory function
2018-01-06 21:37:15 -06:00
Peter Evans
610068cb8b
Add missing decl for apple2_reset()
2018-01-05 16:20:13 -06:00
Peter Evans
70516a7f91
Add function to return 16-bit value from a segment address
2018-01-05 16:14:51 -06:00
Peter Evans
1de1e7788a
Rename status flags to MOS_
2018-01-05 14:18:39 -06:00
Peter Evans
171ff62551
Change create to use objstore vm_8bit data
2018-01-03 21:50:30 -06:00
Peter Evans
06d37d24d7
Allow us to call objstore_init more than once.
...
This also separates some code into objstore_ready().
2018-01-03 21:49:26 -06:00
Peter Evans
90d6c637c5
Add function to copy a buffer into a segment
2018-01-03 21:10:25 -06:00
Peter Evans
4d07bd7640
Add objstore code, tests
2018-01-03 20:51:20 -06:00
Peter Evans
fd4b135d5a
Add compiled object store data
2018-01-03 20:49:52 -06:00
Peter Evans
6963883a60
Define the size of the bitmap font for apple2
2018-01-03 20:48:16 -06:00