mirror of
https://github.com/TomHarte/CLK.git
synced 2025-08-15 14:27:29 +00:00
Adds enough raster position to return something.
This commit is contained in:
@@ -74,6 +74,8 @@ class ConcreteMachine:
|
|||||||
cia_a_.run_for(cycle.length);
|
cia_a_.run_for(cycle.length);
|
||||||
cia_b_.run_for(cycle.length);
|
cia_b_.run_for(cycle.length);
|
||||||
|
|
||||||
|
chipset_.run_for(cycle.length);
|
||||||
|
|
||||||
// Check for assertion of reset.
|
// Check for assertion of reset.
|
||||||
if(cycle.operation & Microcycle::Reset) {
|
if(cycle.operation & Microcycle::Reset) {
|
||||||
memory_.reset();
|
memory_.reset();
|
||||||
|
@@ -20,11 +20,20 @@ Chipset::Chipset(uint16_t *ram, size_t size) :
|
|||||||
blitter_(ram, size) {
|
blitter_(ram, size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Chipset::run_for(HalfCycles length) {
|
||||||
|
// Update raster position.
|
||||||
|
// TODO: actual graphics, why not?
|
||||||
|
|
||||||
|
x_ += length.as<int>();
|
||||||
|
y_ = (y_ + x_ / (227 + (y_&1))) % 262;
|
||||||
|
x_ %= 227;
|
||||||
|
}
|
||||||
|
|
||||||
void Chipset::perform(const CPU::MC68000::Microcycle &cycle) {
|
void Chipset::perform(const CPU::MC68000::Microcycle &cycle) {
|
||||||
using Microcycle = CPU::MC68000::Microcycle;
|
using Microcycle = CPU::MC68000::Microcycle;
|
||||||
|
|
||||||
#define RW(address) (address & 0xffe) | ((cycle.operation & Microcycle::Read) << 7)
|
#define RW(address) (address & 0xffe) | ((cycle.operation & Microcycle::Read) << 12)
|
||||||
#define Read(address) address | 0x1000
|
#define Read(address) address | (Microcycle::Read << 12)
|
||||||
#define Write(address) address
|
#define Write(address) address
|
||||||
|
|
||||||
#define ApplySetClear(target) { \
|
#define ApplySetClear(target) { \
|
||||||
@@ -42,6 +51,18 @@ void Chipset::perform(const CPU::MC68000::Microcycle &cycle) {
|
|||||||
assert(false);
|
assert(false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Position polling.
|
||||||
|
case Read(0x004): {
|
||||||
|
const uint16_t position = uint16_t(y_ >> 8);
|
||||||
|
LOG("Read vertical position high " << PADHEX(4) << position);
|
||||||
|
cycle.set_value16(position);
|
||||||
|
} break;
|
||||||
|
case Read(0x006): {
|
||||||
|
const uint16_t position = uint16_t((x_ << 8) | (y_ & 0xff));
|
||||||
|
LOG("Read vertical position low " << PADHEX(4) << position);
|
||||||
|
cycle.set_value16(position);
|
||||||
|
} break;
|
||||||
|
|
||||||
// Disk DMA.
|
// Disk DMA.
|
||||||
case Write(0x020): case Write(0x022): case Write(0x024):
|
case Write(0x020): case Write(0x022): case Write(0x024):
|
||||||
case Write(0x026):
|
case Write(0x026):
|
||||||
|
@@ -55,6 +55,11 @@ class Chipset {
|
|||||||
void set_stop_and_control(uint16_t value);
|
void set_stop_and_control(uint16_t value);
|
||||||
void set_image_data(int slot, uint16_t value);
|
void set_image_data(int slot, uint16_t value);
|
||||||
} sprites_[8];
|
} sprites_[8];
|
||||||
|
|
||||||
|
// MARK: - Raster.
|
||||||
|
|
||||||
|
int x_ = 0, y_ = 0;
|
||||||
|
int line_length_ = 227;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user