1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-22 12:33:29 +00:00

Attempt [H/L]MMM.

This commit is contained in:
Thomas Harte 2023-02-04 21:29:44 -05:00
parent c6372295c5
commit 67755c3811
2 changed files with 41 additions and 11 deletions

View File

@ -871,17 +871,17 @@ void Base<personality>::commit_register(int reg, uint8_t value) {
default: break;
case 0b0100: break; // TODO: point. [read a pixel colour]
case 0b0101: Begin(PointSet); break; // PSET
case 0b0101: Begin(PointSet); break; // PSET.
case 0b0110: break; // TODO: srch. [search horizontally for a colour]
case 0b0111: Begin(Line); break; // LINE
case 0b0111: Begin(Line); break; // LINE.
case 0b1000: Begin(LogicalFill); break; // LMMV [logical move, VDP to VRAM, i.e. solid-colour fill]
case 0b1001: break; // TODO: lmmm. [logical move, VRAM to VRAM]
case 0b1000: Begin(LogicalFill); break; // LMMV [logical move, VDP to VRAM, i.e. solid-colour fill].
case 0b1001: Begin(LogicalMove); break; // LMMM [logical move, VRAM to VRAM].
case 0b1010: break; // TODO: lmcm. [logical move, VRAM to CPU]
case 0b1011: Begin(LogicalMoveFromCPU); break; // LMMC [logical move, CPU to VRAM]
case 0b1100: Begin(HighSpeedFill); break; // HMMV [high-speed move, VDP to VRAM, i.e. single-byte fill]
case 0b1101: break; // TODO: hmmm. [high-speed move, VRAM to VRAM]
case 0b1100: Begin(HighSpeedFill); break; // HMMV [high-speed move, VDP to VRAM, i.e. single-byte fill].
case 0b1101: Begin(HighSpeedMove); break; // HMMM [high-speed move, VRAM to VRAM].
case 0b1110: break; // TODO: ymmm. [high-speed move, y only, VRAM to VRAM]
case 0b1111: break; // TODO: hmmc. [high-speed move, CPU to VRAM]
}

View File

@ -280,7 +280,7 @@ template <bool logical, bool include_source> struct Rectangle: public Command {
int start_x_ = 0, width_ = 0;
};
// MARK: - Rectangular manipulations; logical.
// MARK: - Rectangular moves to/from CPU.
struct LogicalMoveFromCPU: public Rectangle<true, false> {
LogicalMoveFromCPU(CommandContext &context) : Rectangle(context) {
@ -312,7 +312,37 @@ struct LogicalMoveFromCPU: public Rectangle<true, false> {
}
};
// MARK: - Rectangular manipulations; fast.
// MARK: - Rectangular moves within VRAM.
struct HighSpeedMove: public Rectangle<false, true> {
HighSpeedMove(CommandContext &context) : Rectangle(context) {
access = AccessType::CopyByte;
cycles = 64;
}
void advance(int pixels_per_byte) final {
cycles = 64;
if(advance_pixel(pixels_per_byte)) {
cycles += 64;
}
}
};
struct LogicalMove: public Rectangle<true, true> {
LogicalMove(CommandContext &context) : Rectangle(context) {
access = AccessType::CopyPoint;
cycles = 64;
}
void advance(int pixels_per_byte) final {
cycles = 64;
if(advance_pixel(pixels_per_byte)) {
cycles += 64;
}
}
};
// MARK: - Rectangular fills.
struct HighSpeedFill: public Rectangle<false, false> {
HighSpeedFill(CommandContext &context) : Rectangle(context) {
@ -322,7 +352,7 @@ struct HighSpeedFill: public Rectangle<false, false> {
void advance(int pixels_per_byte) final {
cycles = 48;
if(!advance_pixel(pixels_per_byte)) {
if(advance_pixel(pixels_per_byte)) {
cycles += 56;
}
}
@ -334,9 +364,9 @@ struct LogicalFill: public Rectangle<false, false> {
access = AccessType::PlotPoint;
}
void advance(int pixels_per_byte) final {
void advance(int) final {
cycles = 72;
if(!advance_pixel(pixels_per_byte)) {
if(advance_pixel()) {
cycles += 64;
}
}