mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Threw in a little macro documentation and a missing macro.
This commit is contained in:
parent
790614b544
commit
232c591655
@ -162,14 +162,22 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
|
|
||||||
#define XX {MicroOp::None, 0}
|
#define XX {MicroOp::None, 0}
|
||||||
|
|
||||||
|
/// Fetches into x from address y, and then increments y.
|
||||||
#define FETCH(x, y) {MicroOp::BusOperation, nullptr, nullptr, {Read, 3, &y.full, &x}}, {MicroOp::Increment16, &y.full}
|
#define FETCH(x, y) {MicroOp::BusOperation, nullptr, nullptr, {Read, 3, &y.full, &x}}, {MicroOp::Increment16, &y.full}
|
||||||
|
/// Fetches into x from address y.
|
||||||
#define FETCHL(x, y) {MicroOp::BusOperation, nullptr, nullptr, {Read, 3, &y.full, &x}}
|
#define FETCHL(x, y) {MicroOp::BusOperation, nullptr, nullptr, {Read, 3, &y.full, &x}}
|
||||||
|
|
||||||
|
/// Stores x to address y, and then increments y.
|
||||||
|
#define STORE(x, y) {MicroOp::BusOperation, nullptr, nullptr, {Write, 3, &y.full, &x}}, {MicroOp::Increment16, &y.full}
|
||||||
|
/// Stores x to address y.
|
||||||
#define STOREL(x, y) {MicroOp::BusOperation, nullptr, nullptr, {Write, 3, &y.full, &x}}
|
#define STOREL(x, y) {MicroOp::BusOperation, nullptr, nullptr, {Write, 3, &y.full, &x}}
|
||||||
|
|
||||||
|
/// Fetches the 16-bit quantity x from address y, incrementing y twice.
|
||||||
#define FETCH16(x, y) FETCH(x.bytes.low, y), FETCH(x.bytes.high, y)
|
#define FETCH16(x, y) FETCH(x.bytes.low, y), FETCH(x.bytes.high, y)
|
||||||
|
/// Fetches the 16-bit quantity x from address y, incrementing y once.
|
||||||
#define FETCH16L(x, y) FETCH(x.bytes.low, y), FETCHL(x.bytes.high, y)
|
#define FETCH16L(x, y) FETCH(x.bytes.low, y), FETCHL(x.bytes.high, y)
|
||||||
|
|
||||||
|
/// Stores the 16-bit quantity x to address y, incrementing y once.
|
||||||
#define STORE16L(x, y) STORE(x.bytes.low, y), STOREL(x.bytes.high, y)
|
#define STORE16L(x, y) STORE(x.bytes.low, y), STOREL(x.bytes.high, y)
|
||||||
|
|
||||||
#define PUSH(x) {MicroOp::Decrement16, &sp_.full}, STOREL(x.bytes.high, sp_), {MicroOp::Decrement16, &sp_.full}, STOREL(x.bytes.low, sp_)
|
#define PUSH(x) {MicroOp::Decrement16, &sp_.full}, STOREL(x.bytes.high, sp_), {MicroOp::Decrement16, &sp_.full}, STOREL(x.bytes.low, sp_)
|
||||||
@ -403,7 +411,10 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
|
|
||||||
void decode_operation(uint8_t operation) {
|
void decode_operation(uint8_t operation) {
|
||||||
if(current_instruction_page_[operation]->type == MicroOp::None) {
|
if(current_instruction_page_[operation]->type == MicroOp::None) {
|
||||||
printf("Unknown Z80 operation %02x!!!\n", operation);
|
uint8_t page = 0x00;
|
||||||
|
if(current_instruction_page_ == ed_page_) page = 0xed;
|
||||||
|
if(current_instruction_page_ == fd_page_) page = 0xfd;
|
||||||
|
printf("Unknown Z80 operation %02x %02x!!!\n", page, operation);
|
||||||
}
|
}
|
||||||
schedule_program(current_instruction_page_[operation]);
|
schedule_program(current_instruction_page_[operation]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user