Skip to content

Commit

Permalink
Supporting undocumented ECS bits in SPRxCTL (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed May 19, 2022
1 parent 70a4348 commit 926152b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 0 additions & 3 deletions Emulator/Agnus/Agnus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,6 @@ Agnus::executeUntilBusIsFreeForCIA()

// Sync with the E clock driving the CIA
syncWithEClock();

// Assign bus to the CPU
// busOwner[pos.h] = BUS_CPU;
}

void
Expand Down
10 changes: 10 additions & 0 deletions Emulator/Agnus/AgnusRegs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,16 @@ Agnus::pokeSPRxCTL(u16 value)
sprVStrt[x] = (i16)((value & 0b100) << 6 | (sprVStrt[x] & 0x00FF));
sprVStop[x] = (i16)((value & 0b010) << 7 | (value >> 8));

// ECS Agnus supports an additional position bit (encoded in 'unused' area)
if (GET_BIT(value, 6)) {
trace(XFILES, "XFILES: pokeSPRxCTL: Extended VSTRT bit set\n");
if (isECS()) sprVStrt[x] |= 0x0200;
}
if (GET_BIT(value, 7)) {
trace(XFILES, "XFILES: pokeSPRxCTL: Extended VSTOP bit set\n");
if (isECS()) sprVStop[x] |= 0x0200;
}

// Update sprite DMA status
if (sprVStrt[x] == v) sprDmaState[x] = SPR_DMA_ACTIVE;
if (sprVStop[x] == v) sprDmaState[x] = SPR_DMA_IDLE;
Expand Down
3 changes: 0 additions & 3 deletions Emulator/Denise/DeniseRegs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,6 @@ Denise::pokeSPRxCTL(u16 value)

// 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
// L7 L6 L5 L4 L3 L2 L1 L0 AT - - - - E8 L8 H0 (Lx = VSTOP)

// Disarm the sprite
// CLR_BIT(armed, x);

// Record the register change
i64 pos = 4 * (agnus.pos.h + 1);
Expand Down

0 comments on commit 926152b

Please sign in to comment.