1
0
mirror of https://github.com/sethm/symon.git synced 2024-06-01 08:41:32 +00:00
Commit Graph

192 Commits

Author SHA1 Message Date
Seth Morabito
45f596e0d4 Rename VIA to PIA
Preparing to create a PIA interface and one or more parallel
IO device implementations.
2014-08-12 14:19:55 -07:00
Maik Merten
693d1959ac finer grained synchronization in TraceLog. Profiling indicates that this speeds up adding log entries quite considerably. 2014-08-12 21:58:52 +02:00
Maik Merten
792366fddb some cleanup in the SD card controller 2014-08-12 21:34:00 +02:00
Maik Merten
b2670aedf1 email address update 2014-08-12 19:25:37 +02:00
Maik Merten
5d488bbcd2 Merge remote-tracking branch 'upstream/master' 2014-08-12 11:48:47 +02:00
Seth Morabito
e2a1144c7c Update copyright, prep for 1.1.0 2014-08-11 14:16:41 -07:00
Seth Morabito
fce0dad2a9 Removed unused constant 2014-08-11 13:40:21 -07:00
Seth Morabito
0c40cd325c Alert dialogs for ROM/Program loading 2014-08-11 13:36:31 -07:00
Seth Morabito
22a9207dca Fix for GitHub Issue #9 2014-08-11 13:36:08 -07:00
Maik Merten
010c42753f Merge remote-tracking branch 'upstream/master' 2014-08-11 09:34:44 +02:00
Seth Morabito
7c2a007928 Add Hard/Soft reset buttons 2014-08-10 20:42:39 -07:00
Seth Morabito
194a13d1ac Make register fields editable 2014-08-10 20:33:54 -07:00
Seth Morabito
59c6d8e23b Added Klaus Dormann's tests 2014-08-10 16:52:20 -07:00
Seth Morabito
36615fc70b Move images to resources 2014-08-10 15:19:59 -07:00
Seth Morabito
1a1d503abe Make PC editable 2014-08-10 14:24:43 -07:00
Seth Morabito
eac387e472 Make StatusPanel aware of the Machine 2014-08-10 14:08:15 -07:00
Seth Morabito
f675a6e462 Merge branch 'master' of github.com:sethm/symon 2014-08-10 13:54:50 -07:00
Seth Morabito
ccae8905b3 Implement SimpleMachine 2014-08-10 13:53:04 -07:00
Maik Merten
7a215736fe rework SD controller emulation to work with Input- and OutputStreams (no longer load the image into a byte array) 2014-08-09 17:55:18 +02:00
Maik Merten
c61a63d5bb more accurate emulation of the SD controller 2014-08-09 16:47:49 +02:00
Maik Merten
7cb4e1c945 NPE fix and reset position on every command 2014-08-09 15:13:59 +02:00
Maik Merten
3a40d35fdf use SD interface in MulticompMachine and lift the speed limit on the ACIA device to better match the experience on the real machine 2014-08-09 14:58:29 +02:00
Maik Merten
d658cd0ae5 completely untested and incomplete implementation of the SD card interface of the MULTICOMP 2014-08-09 14:57:18 +02:00
Maik Merten
004087a742 invoke setBus() on devices added to the bus 2014-07-28 18:19:52 +02:00
Seth Morabito
4bfc196b49 Clear memory on Control+Reset 2014-07-27 13:41:44 -07:00
Seth Morabito
b1e1e75555 Reset WIP 2014-07-27 11:33:08 -07:00
Maik Merten
f90516e53c fix a possible NPE 2014-07-26 18:55:51 +02:00
Maik Merten
fdaeb661d3 add menu entry to allow to switch the emulated machine type 2014-07-26 18:52:57 +02:00
Maik Merten
827e9991d5 move main method into Main class in anticipation of changes that allow restarting the complete UI from within the Simulator menu system 2014-07-26 18:07:29 +02:00
Maik Merten
dc7dfc4b4d code simplification 2014-07-25 21:44:43 +02:00
Maik Merten
2217f3831d slight JavaDoc fix regarding what Exception can be thrown 2014-07-25 21:27:40 +02:00
Maik Merten
52f4e9a00f enforce that the address range of devices falls within the address range of the bus. Turned out that the CPU tests instantiate memory with the last parameter as memory size, not end address (fixed now). Also make sure that the address lookup array takes the offset caused by non-zero starting addresses into account. 2014-07-25 21:24:16 +02:00
Maik Merten
d7f8045b61 rework bus. Don't throw an Exception any more with overlapping device addresses - this is normal for some machines. Introduce the concept of priorities to ensure that device overlap in the correct order. 2014-07-25 19:32:00 +02:00
Maik Merten
222772648d simple dialog for choosing machine model when no command-line option was given 2014-07-22 17:50:06 +02:00
Maik Merten
bd2337ae65 allow for selecting the emulated machien type with the "-machine" parameter. The default is the Symon machine model, the Multicomp machine can be selected with "-machine multicomp". 2014-07-21 17:39:20 +02:00
Maik Merten
a49c0d40d8 revert back to busy waiting for CPU speed emulation to have a less bursty CPU behavior 2014-07-20 21:55:01 +02:00
Maik Merten
44bfbc17ab replace busy waiting to emulate "proper" CPU speed with some time book keeping and thread sleeping 2014-07-19 20:19:26 +02:00
Maik Merten
b266a02372 have full 56K of RAM for the Multicomp machine 2014-07-19 17:51:51 +02:00
Maik Merten
72074b9715 Silence a compiler warning regarding generics 2014-07-19 17:40:19 +02:00
Maik Merten
252ebe0569 implement overrun status flag for the 6551 ACIA 2014-07-19 17:30:23 +02:00
Maik Merten
4a37dd7463 move overrun detection and reset into the abstract superclass for ACIAs 2014-07-19 17:10:57 +02:00
Maik Merten
cf36f731da make use of the MulticompMachine in the simulator. This should be an option, not hardcoded. 2014-07-17 21:59:03 +02:00
Maik Merten
e01f68a19a make use of overlapping memory regions in MulticompMachine 2014-07-17 21:45:37 +02:00
Maik Merten
44151f3a9c have the Bus support devices with overlapping memory regions 2014-07-17 21:43:46 +02:00
Maik Merten
f5a25b7303 initial definition of the MULTICOMP machine. Will not yet run, as the bus will currently not allow overlapping memory ranges for devices. 2014-07-17 20:41:26 +02:00
Maik Merten
14e8ea596c define an interface for supported machines and have the SymonMachine as first implementation. Remove machine-specific definitions out of the Simulator class. 2014-07-17 19:42:51 +02:00
Maik Merten
8f52e1da1e implement overrun flag for 6850 ACIA 2014-07-16 22:26:06 +02:00
Maik Merten
0d0fddc365 tests for the 6850 ACIA and fixes in ACIA behavior 2014-07-16 21:51:34 +02:00
Maik Merten
31fdd87b41 turn Acia into an abstract class so that the 6551 and 6850 ACIAs can reuse code and an unified interface. 2014-07-15 21:35:19 +02:00
Maik Merten
9726907317 initial (and untested) implementation of a Motorola 6850 ACIA 2014-07-15 18:45:13 +02:00
Seth Morabito
40c5397ed8 Faster refresh of memory window 2014-07-06 12:17:39 -07:00
Seth Morabito
1bc8eda38d ACIA interrupt handling 2014-01-26 01:25:12 -08:00
Seth Morabito
76dcbd712a IRQ and NMI handling at CPU level. 2014-01-25 20:45:39 -08:00
Seth Morabito
b6cc480919 Add NMI flag to CPU 2014-01-25 20:02:17 -08:00
Seth Morabito
0c5035fc56 Add interrupt flag to CPU 2014-01-25 19:53:53 -08:00
Seth Morabito
4a510b635e README updates, CRTC tests.
- Added more CRTC information to the README file.
- Added unit tests for the CRTC.
- Implemented register read for cursor position in the CRTC.
- Bundling a new version of jterminal that has correct backspace
  behavior.
2013-12-29 18:18:48 -08:00
Seth Morabito
070e9db813 Merge branch 'master' into crtc
Conflicts:
	src/main/java/com/loomcom/symon/Simulator.java
	src/main/java/com/loomcom/symon/devices/Device.java
	src/main/java/com/loomcom/symon/devices/Memory.java
2013-12-28 23:35:22 -08:00
Seth Morabito
3c68c63995 Additional refactoring 2013-12-28 23:14:21 -08:00
Seth Morabito
6dde766f5a Refactor of CRTC 2013-12-28 19:55:26 -08:00
Seth Morabito
e7e3c77e3f First pass at Video window 2013-12-27 21:40:28 -08:00
Max840
bc6b93e3fe Optimization of Bus.isComplete() 2013-12-26 17:25:52 -05:00
Max840
d8deca227f Create Device.size() 2013-12-24 15:35:56 -05:00
Max840
1c9c742477 Unit test updated with devices' start/end address 2013-12-23 23:38:38 -05:00
Max840
d1a05aeb2b Devices use start/end address 2013-12-23 23:31:51 -05:00
Seth Morabito
a5af522c5c Force no grid on memory window 2013-03-30 22:27:33 -07:00
Seth Morabito
6a50476bfe Step Count and Memory Window enhancements
Introduces several changes requested by Mario Keller. The simulator now has a variable step count that can be selected by a drop-down box on the main window. This change also displays ASCII characters in the Memory window.
2013-03-30 21:28:52 -07:00
Jay Sissom
429fec97b2 Fix disassembled opcode display on trace log for zero page,X and zero page,Y addressing modes. 2013-03-04 22:10:25 -05:00
Seth Morabito
4ccb7bec97 Tooltip Text and Minor Enhancements
- Added tooltip text to status panel.
- Memory is no longer cleared on reset.
- Console can now receive key-strokes even while the simulator is
  stopped (for single-stepping programs that require interaction)
- Updated screenshots with bug-fixed version.
2013-01-12 11:41:32 -08:00
Seth Morabito
34fb8940ae Fix swapped labels on status pane
The labels for the X and Y registers were swapped on the status pane.
How embarrassing!
2013-01-05 14:26:16 -08:00
Seth Morabito
da8250778e Bug Fixes and Copyright Date Change
The simulator now passes Klaus Dormann's 6502 Functional Test suite for
the first time.

Bug Fixes:

- PHP was not correctly setting the Break bit on the stack copy of the
  processor status, so subsequent PLA's would not set the Break status
  flag.

- The CPU had swapped NMI and IRQ reset vectors, so RTI was failing.

- BRK was pushing PC + 2 onto the stack, instead of PC + 1

- (Zero Page,X) addressing mode did not correctly wrap on zero page
  boundaries.

- The instruction table used for disassembly had addressing modes
  of LDA $B9 and $BD reversed. This did not affect behavior, only
  disassembly of these instructions.

Other:

- Updated copyright date for 2013.

- Started migrating old JUnit 3 style tests to JUnit 4 annotations.
2013-01-01 17:03:16 -08:00
Seth Morabito
61b342ff01 Readme Update and Memory Window Look-and-Feel 2012-12-30 23:01:33 -08:00
Seth Morabito
3636e78435 Cleanup and Bug Fixes
- Fixed a bug that left View menu items checked after the associated
  windows closed.

- Cleaned up UI init code for several components.
2012-12-30 12:14:30 -08:00
Seth Morabito
933b09827a Cleanup and Javadoc 2012-12-30 11:27:10 -08:00
Seth Morabito
3d620711a9 Fixing imports. 2012-12-29 22:53:01 -08:00
Seth Morabito
f7c5c3b763 Memory Window, Minor Bugfixes
Adds a new view that displays a single page of memory (user selectable)
and allows direct editing of memory contents.

Also fixes several minor bugs, including one that prevented the status
pane from updating after each manual step.
2012-12-29 22:47:23 -08:00
Seth Morabito
0215e2e3d8 Cleaner simulator startup and run-loop exiting
- If a default ROM image ("rom.bin") isn't available at startup, the
  simulator will now create and load a 16KB R/W memory at the ROM
  location, so resets will work even without a ROM loaded.

- Cleaned up the way simulator UI state is updated when the run loop
  exits.
2012-12-10 21:53:01 -08:00
Seth Morabito
f70ce22259 Trace Log View menu item
Makes the "Trace Log" menu item in the "View Menu" a radio button menu
item, so it is checked / unchecked appropriately.
2012-12-09 21:15:19 -08:00
Seth Morabito
807a43ce6f Faster byte and word to hex string
I was alarmed to discover just how slow `String.format()` is for doing
integer to hex conversions. Now that a trace window has been added to
Symon, it became especially clear that I needed a more efficient way to
handle it.

I looked into using `Integer.toHexString()`, but I would have had to
wrap it to do zero-padding, so I decided to just bite the bullet and do
my own with a lookup table. The implementation in `HexUtil` is just as
fast as `Integer.toHexString()`, but also zero-pads appropriately.
Combined with Java's `+` String concatenation, it seems perfectly
adequate.

For yet better performance with the trace window, it would make a lot of
sense to special-case stepping so that it just pops the top line off the
log, and appends to the bottom, rather than re-stringifying the entire
trace log each time. This will be a future enhancement.
2012-12-09 21:02:11 -08:00
Seth Morabito
bc3de80892 Execution Trace Log
Introduces an execution trace window that will keep track of the most
recent 10000 execution steps. I'm not entirely happy with the
implementation, yet.
2012-12-09 17:04:31 -08:00
Seth Morabito
38a4458aff New UI layout, ROM loading, Font selection
- The UI layout has changed, and will likely change again in the future.

- Symon can now re-load ROM images from the File menu, under "Load ROM..."

- Font size can be changed under the "View" menu
2012-12-05 23:19:34 -08:00
Seth Morabito
a7d9239ef1 Keep a reference to the ROM memory image after load 2012-11-25 23:08:09 -08:00
Seth Morabito
2ebdd254b3 Work In Progress: CPU behavior, UI changes
This is something of a "Work in Progress" checkpoint of several features
that are all half baked:

1. Allow loading of 16KB ROM files at address $C000 at run-time, not
   just at startup. See the "Load ROM..." File menu item.

2. Introduces the notion of "CPU Behaviors", so the core 6502 CPU
   implementation can match the behavior of either an early NMOS 6502, late
   NMOS 6502, or CMOS 65C02. Very little of this is actually implemented so
   far.

3. Adds a completely bogus implementation of the 6522 VIA (it
   does absolutely nothing right now).

4. Changes the address of the ACIA in the simulated system to match a
   real hardware implementation I put together.
2012-11-25 22:49:21 -08:00
Seth Morabito
795ccfde5d CPU bug fixes and Simulator enhancements.
Bug Fixes:

- Fixed several bugs in the CPU that caused processor status flags to
  be set incorrectly.  Instructions affected were: STA, STX, STY, CMP,
  CPX, CPY, BIT.

- Made some internal-use-only methods on the CPU class private.

- Fixed incorrect disassembly of (Indirect,X) and (Indirect),Y
  instructions. Although this didn't affect behavior, it certainly
  caused me some confusion in debugging.

- Added missing "BCS" instruction to instruction table.

Enhancements:

- Now includes a full version of Lee Davison's Enhanced 6502 BASIC
  bundled as source code and a ROM image. Get that REAL COMPUTER
  EXPERIENCE!(tm)

- If a file named "rom.bin" exists in the same directory where the
  simulator is executed, it will be loaded at addresses $d000-$ffff.

- Gave the CPU an idle loop to make simulated timing a little more
  realistic (but this is still an area needing major improvement)

- Changed the CPU's toString() method to give better debugging output.

- Added a small typeahead buffer to the Console.

- Better exception messaging.

Misc:

- Bumped version to 0.5, updated README.
2012-10-21 20:05:05 -07:00
Seth Morabito
c1caf8c6b4 Timing and UI enhancements.
This change introduces simulated baud rates in the ACIA. Baud rate is controlled just as in the real 6551, by writing to the ACIA's control register. Baud rates between 50 and 19,200 baud are selectable. A baud rate of 0 has special meaning, and turns off all simulated baud rate delays (on a real 6551, this means to use an external clock instead of the internal baud rate generator)

A busy-wait loop between steps in the simulator control program has also been added. This uses the high-resolution 'System.nanoTime()' call to wait a specific number of nanoseconds before continuing. Symon now waits at least 1uS between clock cycles, trying to approach a real 1MHz 6502 in performance. It is far from perfect, but it's better than it was.

 Also refactored the status panel to use a BoxLayout, and DRY-up some of the code.
2012-10-14 17:56:19 -07:00
Seth Morabito
c214cc9b43 Fixes and enhancements.
- Added ability to change inner border width of console window.
- Fixed a nasty bug that prevented key press handling.
- Reset now clears the accumulator and index registers.
2012-10-14 00:25:03 -07:00
Seth Morabito
e012d97bb3 Added clarifying curly braces. 2012-10-12 14:34:18 -07:00
Seth Morabito
365809459c Finally handling key presses in the console! (Took long enough, huh?) Added a dead simple console echo example program in 6502 assembly, as well. 2012-10-11 16:08:04 -07:00
Seth Morabito
ed36690e9e Checkpoint of my Swing UI refactoring. Usable for output-only programs, but only barely. 2012-05-28 22:18:35 -07:00
Seth Morabito
a1d07bf223 First work toward moving to a Swing UI for the simulator. 2012-04-22 20:49:18 -07:00
Seth J. Morabito
00ab8cd9ff Simulator is just about ready for real-world testing now. Added a simulated
MOS6551 ACIA at address $C000 which does buffered input and output via the
console. Updated the README with a bit more documentation, and bumped the
version number to 0.1 because I'm impatient.
2010-01-20 18:19:39 -08:00
Seth Morabito
596d05e398 Clearer help output (I hope). Fixed an off-by-one bug in doLoad. 2010-01-17 21:12:24 -08:00
Seth J. Morabito
3d4500cbff Removed Profiler. It may return in a future release. 2010-01-16 22:22:24 -08:00
Seth Morabito
e157f4a972 More cleanup of the monitor. Added binary file load command. 2010-01-16 21:17:37 -08:00
sethm
a3e57274a2 - Major overhaul of the Simulator control class (where 'main' lives).
- Removed the CommandParser class entirely, as the weird dependency between
  Simulator and CommandParser never made me comfortable.
- Added a Command inner class to Simulator that handles some of the
  command line tokenizing.
2010-01-16 19:22:22 -08:00
Seth Morabito
5c7a98df86 Playing around with the command parser and the Simulator class. Safe to ignore. 2010-01-16 08:56:34 +00:00
Seth Morabito
f174f0312f * Correct implementation of Indirect Indexed and Indexed Indirect addressing modes.
* Unit tests for Indirect Indexed and Indexed Indirect.
* Updated copyright dates.
* Started moving to JUnit 4.
2010-01-15 08:20:03 +00:00
Seth Morabito
d858a50f1b - Updated Cobertura Maven plugin to version 2.3 (threadsafe)
- Finished refactor of instruction argument address decoding.
  Much DRYer now (but could still be DRYer yet).
2010-01-10 02:28:55 -08:00
sethm
4104d6212e Added Indirect X Mode Tests 2010-01-10 01:18:45 -08:00
Seth J. Morabito
ac88786df7 - Continued refactoring of address decoding.
- Device read and write may now throw MemoryAccessException, and appropriate
  throws clauses have been added throughout the code.
2010-01-09 16:53:04 -08:00
Seth Morabito
a01090a16e Part-way through the Great Refactoring of Instruction Decoding(tm) 2010-01-09 19:51:56 +00:00