Update README.md

This commit is contained in:
ArthurFerreira2 2021-06-25 00:04:03 +02:00 committed by GitHub
parent e91cbebc12
commit a5c58da8d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,37 +1,30 @@
# puce6502 # puce6502
This is a simple and readable emulation of the MOS 6502 CPU\ This is a simple and readable emulation of the MOS 6502 CPU\
It implements all original instructions, passes the [Klaus Test Suite](https://github.com/Klaus2m5/6502_65C02_functional_tests) and is cycle accurate excepted for : It implements all original instructions and is cycle accurate
It also passes the [Klaus Test Suite](https://github.com/Klaus2m5/6502_65C02_functional_tests) - set \_FUNCTIONNAL_TESTS to 1 and compile it as a standalone program.
*Absolute-X, absolute-Y, and Zero page-Y addressing modes which need an extra cycle if indexing crosses a page boundary, or if the instruction writes to memory.* API is as simple as :
```C
You can easely interface it with your code using : uint16_t puce6502Exec(unsigned long long int cycleCount);
void puce6502RST();
``` void puce6502IRQ();
void puce6502Reset(); void puce6502NMI();
void puce6502Exec(long long int cycleCount);
``` ```
The first emulates a reset signal, the second will execute as many instruction as needed to reach cycleCount the first function will execute as many instructions as needed to reach cycleCount clock cycles - it will return the updated value of the Program Counter
the 3 others will simulate a RESET, INTERUPT and NON-MASKABLE INTERUPT.
RAM and ROM are implemented using 8 bits integer arrays. And are directly accessible to your code to load ROM binary images and, for example, generate video output\ You are expected to provide the functions to handle read and writes to memory (ROM, RAM, Soft Switches, extension cards ROMs, PIA, VIA, ACIA etc...)
RAM starts at adress 0x000\ They have to comply with these prototypes :
Update the three #define to adapt the ranges to your needs :
``` ```C
#define ROMSTART 0xD000 extern uint8_t readMem(uint16_t address);
#define ROMSIZE 0x3000 extern void writeMem(uint16_t address, uint8_t value);
#define RAMSIZE 0xC000
``` ```
You are expected to provide a function to handle read and writes to locations not in ROM or in RAM (for Soft Switches, extension cards ROMs, PIA, VIA, ACIA etc...) finnaly, you can import the variable `ticks` (extern ticks) into your code - it holds the accumulated clock cycles since start.
```
extern uint8_t softSwitches(uint16_t address, uint8_t value);
```
Finally, the variable `ticks` is a long long int holding the number of cycles since last reset.
For an example of use, you can refer to [reinette II plus](https://github.com/ArthurFerreira2/reinette-II-plus) a french Apple II plus emulator. For an example of use, you can refer to [reinette II plus](https://github.com/ArthurFerreira2/reinette-II-plus) a french Apple II plus emulator.