Commit Graph

219 Commits

Author SHA1 Message Date
Radoslaw Kujawa 6ccb94ac46 Update copyright year. 2021-01-25 01:09:01 +01:00
Radoslaw Kujawa 23730825fb Avoid null pointer dereference. 2021-01-25 01:00:18 +01:00
Radoslaw Kujawa 8e89ed067a CPU emulator should not try to emulate peripherals.
Especially in a lame/incomplete way. These should be later
re-added in examples.
2021-01-25 00:38:58 +01:00
Radosław Kujawa b3e49fdb24 Add preambles with license information. 2019-09-23 15:28:05 +02:00
Radosław Kujawa a03189fd7e More sanity checks. 2018-08-13 21:18:29 +02:00
Radosław Kujawa 2cc9d86c64 Simplify error handling if malloc fails.
There's no way to reliable handle out of memory situation in an
emulator. So just bail out by raising assertion.
2018-08-05 23:45:44 +02:00
Radosław Kujawa 0896956337
Include argument names in prototype.
For doxygen purposes.
2018-07-24 19:20:29 +02:00
Radosław Kujawa b1d001113f
Make function declerations proper prototypes. 2018-07-24 19:20:06 +02:00
Radosław Kujawa 61cc5d2c68
Call finish funcs for devices when closing bus. 2018-07-24 11:02:22 +02:00
Radosław Kujawa ef69c47c25
No reason to inline BCD conversion.
There's no noticable performance gain.
2018-07-06 10:26:44 +02:00
Radosław Kujawa dc1e2bf829
Refactoring to support (future) string asm. 2018-06-25 14:05:47 +02:00
Radosław Kujawa dfb3bd1fca
Try to make this build on Linux, NetBSD and OS X.
Without actually using autoconf etc.
2018-06-25 13:19:35 +02:00
Radosław Kujawa 6c3e66a9f1
Merge branch 'master' of github.com:rkujawa/rk65c02 2018-06-13 10:30:13 +02:00
Radosław Kujawa 060f84e07d
Fail if mapping exceeding the bus size 2018-06-13 10:29:26 +02:00
Radosław Kujawa 1ec075518c Split assembler-related things into separate file. 2018-04-27 14:07:42 +02:00
Radosław Kujawa b7986df553 Split address calculation into separate function.
This removes some code duplication for instruction_data_read/write
functions. Also this way implementing watchpoints will be far easier.
2018-04-27 10:34:48 +02:00
Radosław Kujawa 216450da52 Enable debug-safe optimizations.
Also ggdb for tests.
2018-04-26 14:16:32 +02:00
Radosław Kujawa e2bf924fa9 Make sure doff is initialized. 2018-04-26 14:16:04 +02:00
Radosław Kujawa 4ff3f390db Fix assembling opcode 0xFF (BBS7). 2018-04-16 12:26:52 +02:00
Radosław Kujawa a2fdb78d2b BBR and BBS instructions have 2 operands. 2018-04-16 12:14:31 +02:00
Radosław Kujawa 6d7f0abef0 Comment WAI/interrupt behaviour. 2018-04-13 11:25:30 +02:00
Radosław Kujawa 0ac5932e75 Doxify more. 2018-04-12 12:45:05 +02:00
Radosław Kujawa d0728c8ade Emulate invalid instructions.
Treat them as NOPs of different length just as real 65C02.
2018-04-10 13:56:37 +02:00
Radosław Kujawa f0471947fc Doxify more. 2018-04-10 12:49:11 +02:00
Radosław Kujawa 901e9626d5 Add initial Doxyfile. 2018-04-10 12:18:19 +02:00
Radosław Kujawa faec05b87e Start doxifying the documentation. 2018-04-10 12:17:59 +02:00
Radosław Kujawa 95368a186a Remove leftover attempt at CLI. 2018-04-10 10:23:32 +02:00
Radosław Kujawa ed4b2786b6 Simplify ROM loading by providing utility function. 2018-04-10 10:12:27 +02:00
Radosław Kujawa eeb564d69f Make log less verbose. 2018-04-06 14:27:05 +02:00
Radosław Kujawa 7cf3f263e3 Simplify handling ciritcal emulation errors. 2018-04-01 21:40:49 +02:00
Radosław Kujawa 68fa918d97 Document the way invalid opcodes are handled. 2018-04-01 21:16:58 +02:00
Radosław Kujawa 3c684fbf2c Fix zero page wrap for indexed indirect mode. 2018-03-31 15:03:22 +02:00
Radosław Kujawa 7c4d6cea3f Fix indirect indexed with Y addressing.
Also fix test case for this. Problem wasn't detected, because test case
was broken too.
2018-03-31 12:38:45 +02:00
Radosław Kujawa 4f299a6f36 Also fix zero page wrap for bus reads. 2018-03-28 14:18:50 +02:00
Radosław Kujawa 260ac09c01 Emulate zero page wrap for zp,x addressing. 2018-03-28 13:46:06 +02:00
Radosław Kujawa 9ff0cb26fc Explicitely cast time to long long ints.
Avoid portability bullshit problems.
2018-03-27 13:30:33 +02:00
Radosław Kujawa 25e62f4be4 Avoid compiler warning (variable uninitialized). 2018-03-27 13:18:29 +02:00
Radosław Kujawa e72871a5b6 Use clock_gettime instead of gettimeofday. 2018-03-27 12:53:08 +02:00
Radosław Kujawa 9c16656198 Disable tracing by default. 2018-03-26 16:11:26 +02:00
Radosław Kujawa afbd412879 Remove usused variable. 2018-03-26 14:31:07 +02:00
Radosław Kujawa f4aa7c4508 Don't build the useless CLI for now... 2018-03-26 12:38:25 +02:00
Radosław Kujawa ae3e782b74 Use boehm gc to manage memory.
I'm less likely to fuck this up now.
2018-03-26 12:36:47 +02:00
Radosław Kujawa a98c8f1018 Print debug message before loading ROM. 2018-03-26 09:59:55 +02:00
Radosław Kujawa 85a53f89c8 Start implementation of display emulation.
Something like a character RAM for a start. When 65C02 writes into
this space, a callback will be executed that would allow redrawing
the emulated screen. Multiple backends can be supported this way.
2018-03-25 18:01:15 +02:00
Radosław Kujawa fc1503c3f0 Add readable name for log level "none". 2018-03-24 23:05:42 +01:00
Radosław Kujawa 363bb56fc6 Make RAM size configurable. 2018-03-24 23:05:28 +01:00
Radosław Kujawa eeb337a0d6 Don't forget newline when printing regs. 2018-03-24 00:14:41 +01:00
Radosław Kujawa 5fddf2c5dc More refactoring and improvements to logging! 2018-03-23 13:37:07 +01:00
Radosław Kujawa 0c77eeb505 Remove leftover debug code. 2018-03-23 11:23:16 +01:00
Radosław Kujawa 5cb6f3488e Further improvements and refactoring to logging. 2018-03-22 15:08:51 +01:00