Skip to content

Commit

Permalink
Rectified some constants related to NTSC overscan (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Dec 29, 2024
1 parent 008a068 commit dae01fb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Emulator/Base/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ static const isize VBLANK_MAX_PAL = 0x19; // Last VBLANK line
static const isize VBLANK_CNT_PAL = 0x1A; // VBLANK_MAX - VBLANK_MIN + 1

static const isize VBLANK_MIN_NTSC = 0x00; // First VBLANK line
static const isize VBLANK_MAX_NTSC = 0x14; // Last VBLANK line
static const isize VBLANK_CNT_NTSC = 0x15; // VBLANK_MAX - VBLANK_MIN + 1
static const isize VBLANK_MAX_NTSC = 0x13; // Last VBLANK line
static const isize VBLANK_CNT_NTSC = 0x14; // VBLANK_MAX - VBLANK_MIN + 1


//
Expand Down
2 changes: 1 addition & 1 deletion Emulator/Components/Agnus/Agnus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ Agnus::updateSpriteDMA()
isize v = pos.v + 1;

// Reset the vertical trigger coordinates in line 25 (PAL) or 20 (NTSC)
isize resetLine = isPAL() ? 25 : 20;
isize resetLine = isPAL() ? 25 : 19;
if (v == resetLine && sprdma()) {
for (isize i = 0; i < 8; i++) sprVStop[i] = resetLine;
return;
Expand Down
2 changes: 1 addition & 1 deletion Emulator/Components/Agnus/Agnus.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class Agnus : public SubComponent, public Inspectable<AgnusInfo, AgnusStats> {
public:

// Indicates if the electron beam is inside the VBLANK area
bool inVBlankArea(isize posv) const { return posv < (isPAL() ? 26 : 21); }
bool inVBlankArea(isize posv) const { return posv < (isPAL() ? 26 : 20); }
bool inVBlankArea() const { return inVBlankArea(pos.v); }

// Indicates if the current rasterline is the last line in this frame
Expand Down
7 changes: 4 additions & 3 deletions Emulator/Components/Agnus/Sequencer/Sequencer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ Sequencer::eolHandler()
}

// Check the vertical DIW flipflop
if (agnus.pos.v == vstop || agnus.inLastRasterline()) {

// if (agnus.pos.v == vstop || agnus.inLastRasterline()) {
if (agnus.pos.v == vstop || agnus.pos.v == (agnus.isPAL() ? 312 : 262)) {

trace(SEQ_DEBUG, "eolHandler: Vertical flipflop off\n");
ddfInitial.bpv = ddf.bpv = false;
hsyncActions |= UPDATE_SIG_RECORDER;
Expand All @@ -71,7 +72,7 @@ Sequencer::eolHandler()
newDmaDAS = agnus.dmacon & 0b111111;

// Disable sprites outside the sprite DMA area
if (agnus.pos.v < (agnus.isPAL() ? 25 : 20) || agnus.pos.v >= agnus.pos.vMax()) {
if (agnus.pos.v < (agnus.isPAL() ? 25 : 19) || agnus.pos.v >= agnus.pos.vMax()) {
newDmaDAS &= 0b011111;
}
}
Expand Down

0 comments on commit dae01fb

Please sign in to comment.