Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor SPEC512 bug fix, fixes Alpha Waves 2-players mode with freq scaling #2

Closed
wants to merge 11 commits into from
Prev Previous commit
Use frequency-shift adjusted end of scan-line for spec512
For SPEC512 emulation, cycles are always counted in "real" ST cycles,
and are shifted at other places, e.g. Spec512_EndScanLine.

This fixes Alpha-Waves two-players mode with frequency scaling.
  • Loading branch information
c3d committed Feb 28, 2019
commit c7711fbae26295ddd288e962c37d9852c907359e
4 changes: 3 additions & 1 deletion src/spec512.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ void Spec512_StoreCyclePalette(Uint16 col, Uint32 addr)
/* Do we have a previous entry at the same cycles? If so, 68000 have used a 'move.l' instruction so stagger writes */
if (nCyclePalettes[ScanLine] > 0)
{
int CycleEnd = nCyclesPerLine >> nCpuFreqShift;

/* In case the ST uses a move.l or a movem.l to update colors, we need
* to add at least 4 cycles between each color: */
if ((pTmpCyclePalette-1)->LineCycles >= nHorPos)
nHorPos = (pTmpCyclePalette-1)->LineCycles + 4;

if ( nHorPos >= nCyclesPerLine ) /* end of line reached, continue on the next line */
if ( nHorPos >= CycleEnd ) /* end of line reached, continue on the next line */
{
ScanLine++;
pTmpCyclePalette = &CyclePalettes[ (ScanLine*MAX_CYCLEPALETTES_PERLINE) + nCyclePalettes[ScanLine] ];
Expand Down