1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-08 15:29:37 +00:00
Commit Graph

24 Commits

Author SHA1 Message Date
Carlo Bramini
b04d79b1da [SIM65] Support undocumented opcodes for 6502
This PR is mostly a complete rewrite of the emulator for 6502/65c02 opcodes.
It provides an easier to maintain implementation of the instructions, by using few macros rather than having hand-written code for each function.
All undocumented, previously missing opcodes for 6502 are also implemented.
The patch also includes a detailed documentation of those opcodes, for reference to developers.
This PR should fix one of the milestones listed here for the next version of CC65:

https://github.com/cc65/wiki/wiki/Before-the-next-release
2024-02-08 12:13:17 +01:00
bbbradsmith
0081fe548c sim64 universal 64-bit cycle count support:
MaxCycleCount is accounted by countdown, eliminating the 1-instruction-overhead issue, and removing the need to compare against a growing TotalCycles.
Makes main.c responsible for counting total cycles, instead of 6502.c, so the size of MaxCycleCount etc. is fully determined in one location.
Makes error.c responsible for PrintCycles instead of paravirt.c, so that it can be treated globally instead of
Return value of main() should be SIM65_ERROR because it is unreachable by design.
2023-05-07 16:26:42 -04:00
mrdudz
3c1bb85b8e remove dangling spaces 2022-04-17 16:07:09 +02:00
Stefan
08ec9fc392 Fixed 65C02 timing again. 2019-02-12 11:15:47 -05:00
Stefan
50fd96bbab
Fixed 65C02 timing. 2019-02-07 12:19:49 +01:00
Patrick Pelletier
5cdaa96e4c sim65: Fix "$2C: BIT abs" to access the correct address.
Bug is documented here:
http://forum.6502.org/viewtopic.php?f=2&t=5242
2018-08-10 12:58:48 -07:00
prandeamus
1a95be9c3a 65C02 JMP (ind,x) opcode 7C 2018-01-14 19:42:29 +00:00
prandeamus
009f56afb6 65C02 version too. 2018-01-13 22:42:39 +00:00
prandeamus
c23f264fe4 Call ParaVirtHooks on JMP (indirect) 2018-01-13 18:30:53 +00:00
Greg King
dce5783dc9 Fixed the simulations of the stack pointer and the "break" and decimal-mode flags.
* The pointer wraps around the stack page.
* The break flag exists on only the stack, and only after an interrupt.
* 65C02 interrupts clear the decimal-mode flag.
2017-04-04 13:23:44 -04:00
Oliver Schmidt
cbb2833c01 Merge pull request #414 from IrgendwerA8/SED_Fix
Fixed sim65 SED
2017-03-30 12:26:37 +02:00
IrgendwerA8
170d96898f Fixed SED 2017-03-30 12:17:29 +02:00
IrgendwerA8
cc82cd9992 Fixed addressing error for TSB/TSR and enabled tests again. 2017-03-20 21:53:07 +01:00
IrgendwerA8
e14e13abf4 fixed curly brackets for single line scopes 2017-03-18 22:52:13 +01:00
IrgendwerA8
ad003e5991 style changes 2017-03-18 20:27:41 +01:00
IrgendwerA8
0985655ac7 Fixed bug in original sim65 implementation (reason for C&P error in last commit) 2017-03-18 17:02:22 +01:00
IrgendwerA8
c50e4d25e2 additional fix for scrambled code (sorry) 2017-03-18 16:56:36 +01:00
IrgendwerA8
4ba34f2a69 fixed scrambled semicolon 2017-03-18 16:54:00 +01:00
IrgendwerA8
360372420b Added 65SC02 support for simulator. 2017-03-18 16:37:15 +01:00
Christian Groessler
97b517a892 sim65: add command line parameter to print number of CPU cycles at exit 2016-07-05 17:07:39 +02:00
Greg King
0390c34e88 Changed multi-line C comments into another style.
The left side doesn't look unbalanced.
2014-06-30 16:51:07 -04:00
Oliver Schmidt
5bd0a53ea2 Added support for cc65 program arguments. 2013-05-24 18:36:30 +02:00
Oliver Schmidt
129fcff7e5 Fixed Carry handling in SBC opcode. 2013-05-21 23:47:19 +02:00
Oliver Schmidt
3a028fb621 Turned sim65 into a lightweight cc65 execution environment.
The sim65 source code has been a construction site for over a decade.
I was looking for a simple cc65 program execution environment for
regression tests. So I decided to re-purpose sim65 for that task by
removing about everything but the 6502 emulation.

There's no memory mapped i/o emulation whatsoever. Rather exit(),
open(), close(), read() and write() calls are supported by mapping
them through a thin paravirtualization layer to the corresponding
host os functions.

Note: The sim65 6502 emulation provides means to switch between
6502 and 65C02 emulation but currently there are no actual 65C02
opcodes implemented.
2013-05-20 20:20:14 +02:00