diff --git a/Changes.txt b/Changes.txt index c49bd6ebc..6154b45ab 100644 --- a/Changes.txt +++ b/Changes.txt @@ -12,6 +12,15 @@ Release History =========================================================================== +3.8 to 3.9: (XXXXX xx, 2013) + + * Added support for TIA RSYNC writes, thanks to Omegamatrix of AtariAge. + This allows the recently released "Extra Terrestrials" ROM to run, as + well as improving emulation of "Fatal Run" and several other test ROMs. + +-Have fun! + + 3.7.5 to 3.8: (February 21, 2013) * Huge changes to the sound system: @@ -78,8 +87,6 @@ * Updated included PNG and ZLIB libraries to latest stable version. --Have fun! - 3.7.4 to 3.7.5: (December 22, 2012) diff --git a/docs/index.html b/docs/index.html index 9bef5bc99..c66623b1e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -389,52 +389,21 @@

Linux/UNIX

  • Binary RPM (stella-release-1.arch.rpm) -
      +
    +
  • -
  • Compressed tarball : building from source code (stella-release-src.tar.gz) +
  • Building and installing from source code
  • @@ -443,30 +412,17 @@

    Macintosh

    -
  • Compressed tarball : building from source code (stella-release-src.tar.gz) -
      -
    1. Extract files from the distribution using an archiving program that supports - gzipped tar files
    2. -
    3. Open the stella-release/src/macosx/stella.xcodeproj - file using Xcode 3.2
    4. -
    5. Make sure you have the SDL runtime library/framework installed in src/macosx (located at - libsdl.org)
    6. -
    7. Build the 'Stella' project (making sure to select 'Deployment' mode)
    8. -
    9. For installation: -
        -
      • Run the script Create_build.sh, located in the src/macosx directory. - This will create a DMG installation archive on your desktop.
      • -    OR -
      • Copy the Stella.app package to your 'Applications' folder.
      • -
      -
    10. For compiling the Intel/Snow Leopard version, open the stella-release/src/macosx/stella_intel.xcodeproj file instead, and continue from - step 2 above.
    11. -
    +
    +
  • Building and installing from source code +
  • @@ -478,37 +434,19 @@
  • Double-click on the installer and follow the onscreen instructions
  • +
  • Binary ZIP file (stella-release-windows.zip)
    1. Unzip the binary ZIP file using Winzip or Total Commander
    2. Copy the contents of either 32-bit or 64-bit directory somewhere on your system
  • -
  • Compressed tarball : building from source code (stella-release-src.tar.gz) -
      -
    1. Make sure you have library and header files installed for SDL for - the correct architecture (32-bit, 64-bit or both), and that Visual Studio - is properly configured to find them
    2. -
    3. Extract files from the distribution using Winzip, - Total Commander, or some other archiving program that supports - gzipped tar files
    4. -
    5. Open the stella-release/src/win32/Stella.sln - file using Visual C++ 2010
    6. -
    7. Build the 'Stella' solution, making sure to correctly select either 'Win32' - or 'x64' mode (depending on the version of Windows you have installed)
    8. -
    9. For installation: -
        -
      • Double-click on Create_builds.bat to generate ZIP and EXE files; - you must have the 'flip' and 'zip' applications installed on your system, - as well as the InnoSetup application. This will generate the EXE and ZIP - files, which can be installed as explained above
      • -    OR -
      • Manually copy the Stella.exe and SDL.dll files somewhere - on your system (they may be located in the 'Release' or 'x64\Release' - directories)
      • -
      -
    10. -
    +
    +
  • Building and installing from source code +
  • diff --git a/src/emucore/TIA.cxx b/src/emucore/TIA.cxx index 9c06005be..7d6925b9b 100644 --- a/src/emucore/TIA.cxx +++ b/src/emucore/TIA.cxx @@ -1170,6 +1170,69 @@ inline void TIA::waitHorizontalSync() mySystem->incrementCycles(cyclesToEndOfLine); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +inline void TIA::waitHorizontalRSync() +{ + // 02-23-2013: RSYNC has now been updated to work correctly with + // Extra-Terrestrials. Fatal Run also uses RSYNC (in its VSYNC routine), + // and the NTSC prototype now displays 262 scanlines instead of 261. + // What is not emulated correctly is the "real time" effects. For example + // the VSYNC signal may not be 3 complete scanlines, although Stella will + // now count it as such. + // + // There are two extreme cases to demonstrate this "real time" variance + // effect over a proper three line VSYNC. 3*76 = 228 cycles properly needed: + // + // ====== SHORT TIME CASE ====== + // + // lda #3 ;2 @67 + // sta VSYNC ;3 @70 vsync starts + // sta RSYNC ;3 @73 +3 + // sta WSYNC ;3 @76 +6 + // ------------------------------ + // sta WSYNC ;3 @76 +82 + // ------------------------------ + // lda #0 ;2 @2 +84 + // sta VSYNC vsync ends + // + // ====== LONG TIME CASE ====== + // + // lda #3 ;2 @70 + // sta VSYNC ;3 @73 vsync starts + // sta RSYNC ;3 @74 +3 + // sta WSYNC ;3 @.. +81 2 cycles are added to previous line, and then + // WSYNC halts the new line delaying 78 cycles total! + //------------------------------ + // sta WSYNC ;3 @76 +157 + //------------------------------ + // lda #0 ;2 @2 +159 + // sta VSYNC vsync ends + + // The significance of the 'magic numbers' below is as follows (thanks to + // Eckhard Stolberg and Omegamatrix for explanation and implementation) + // + // Objects always get positioned three pixels further to the right after a + // WSYNC than they do after a RSYNC, but this is to be expected. Triggering + // WSYNC will halt the CPU until the horizontal sync counter wraps around to zero. + // Triggering RSYNC will reset the horizontal sync counter to zero immediately. + // But the warp-around will actually happen after one more cycle of this counter. + // Since the horizontal sync counter counts once every 4 pixels, one more CPU + // cycle occurs before the counter warps around to zero. Therefore the positioning + // code will hit RESPx one cycle sooner after a RSYNC than after a WSYNC. + // + // Essentially, HBLANK is completed after HBLANK/3 cycles have elapsed, after + // which point objects moved with RSYNC trail those moved with WSYNC by + // 3 pixels (or 1 cycle) + + uInt32 cyclesToEndOfLine = 76 - ((mySystem->cycles() - + (myClockWhenFrameStarted / 3)) % 76); + + if((cyclesToEndOfLine > HBLANK/3) && (cyclesToEndOfLine < 76)) + mySystem->incrementCycles(cyclesToEndOfLine - 1); + else + mySystem->incrementCycles(cyclesToEndOfLine); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void TIA::clearBuffers() { @@ -1399,7 +1462,7 @@ bool TIA::poke(uInt16 addr, uInt8 value) case RSYNC: // Reset horizontal sync counter { -// cerr << "TIA Poke: " << hex << addr << endl; + waitHorizontalRSync(); break; } diff --git a/src/emucore/TIA.hxx b/src/emucore/TIA.hxx index 6c40f2df4..4219ceca1 100644 --- a/src/emucore/TIA.hxx +++ b/src/emucore/TIA.hxx @@ -357,6 +357,9 @@ class TIA : public Device // Waste cycles until the current scanline is finished void waitHorizontalSync(); + // Reset horizontal sync counter + void waitHorizontalRSync(); + // Clear both internal TIA buffers to black (palette color 0) void clearBuffers();