- Index
  - Goals
  - Requirements
  - Features
  - Limits
  - Usage
  - API
  - Safety
  - Privacy
  - Your game or demo
  - References
  - Author
  - Thanks
  - Stats
  - History

- Goals
  - Make 'Amiga Classic' Emulation available for browsers.
  - Browser-plugins or 3rd-party scripts must not be required, just HTML5 and javascript.
  - Abstraction and API for easy integration to
    - play demos, intros or mods.
    - play games.
    - or maybe benchmark the browser.

- Requirements
  - A fast computer in general and a super-computer for (most) AGA-stuff in real-time.
  - A modern browser capable of HTML5 with:
    - WegGL/Canvas2D- and WebAudio-extensions.
    - Typed-arrays and FileReader-extension.
    - fullscreen-extension. (optional)
    - pointerLock-extension. (optional)
    - gamepad-extension. (optional)
    - The browser should support compilation of javascript-code to native-code. (JIT)
    - The browser should be able to use multiple cpu-cores on a single thread/tab.
    - Memory-requirements are between 200MB to 1.5GB depending on configuration and browser.
  - A ROM:
    - Amiga Kickstart 1.0-3.1 (not included for copyright reasons)
    - AROS Kickstart (included)
  - A bunch of floppy- or hardfile-images for the advanced-mode.

- Features (new = new in latest version 0.9.10)
  - Models
    - A1000/A1000-Velvet
    - A500/A2000
    - A500+
    - A600
    - A1200
    - A3000
    - A4000/030
  - CPUs
    - 68000
    - 68010
    - 68020/68030
      - 32-bit support.
      - Cache support.
      - Prefetch support.
    - Variable speeds.
  - Chipset
    - Original-Chip-Set (OCS)
      - A1000-Damisoft (8361 PAL, 8367 NTSC) emulation.
    - Enhanced-Chip-Set (ECS)
      - Partial (Agnus/Denise only) or full emulation.
    - Advanced Graphics Architecture. (AGA)
    - PAL/NTSC-regions.
    - Sprites-only or full collision-detection.
    - Full blitter support.
    - Full copper support.
    - Full gayle support (A600/A1200)
      - IDE
      - PCMCIA
    - Real-Time-Clock (RTC) types
      - MSM6242B
      - RF5C01A
    - Complex-Interlace-Adapter (CIA):
      - Different Time-Of-Day (TOD) sources. (Vertical Sync/Power Supply)
      - ROM overlay emulation. (maps ROM from e.g. 0xf80000 to 0x000000 at reset)
      - A1000 Velvet prototype CIA (6526) emulation.
  - RAM
    - 256-2048K Chip-ram. (0x000000)
    - Up to 1536K Slow-/Bogo-ram. (0xC00000)
    - Up to 64M onboard Fast-ram for A3000/A4000.
    - Up to 8M Zorro2 expansion Fast-ram. (0x200000)
    - Up to 8M Zorro3 Chip-ram.
    - Up to 1024M (1G) Zorro3 expansion Fast-ram.
    - 512K Chip-/512K Bogo-ram to 1024K Chip-ram aliasing.
    - 24-/32-bit support. (32-bit memory is required for original A3000/4000-roms and emulation)
  - ROM
    - All kinds of standard and extended kickstart roms.
    - Support for encrypted Cloanto-roms. (Amiga Forever)
    - Special A1000 kickstart handling.
    - ROM-patcher, which does remove unneeded resident libraries.
    - ROM-mirroring. (mirrors ROM to 0xA80000 or 0xE00000)
    - ShapeShifter-support.
    - AMAX-support. (Mac emulator)
    - ROM-info from internal database.
  - Floppy
    - Supported diskimage-types
      - Standard ADF, read/write (*.adf)
      - Extended ADF (EXT1/EXT2), read/write (*.adf)
      - PCDOS, read/write (*.img)
      - DMS (DiskMasher), read only (*.dms)
      - SCP (SuperCardPro), read-only (*.scp)
      - EXE, read-only (*.exe)
    - Up to 4 Double-/High-density drives. (DF0-DF3)
    - Variable drive-speeds. (Original-Turbo).
    - Drives are write-protectable.
    - Diskimage creation feature.
  - Mount
    - Supported hardfile-types
      - Standard, read/write (*.hdf)
      - Virtual, read/write (*.vhd)
    - Up to 4 Onboard-IDE units (IDE0-IDE3) with supported ATA-modes
      - ATA 1
      - ATA 2
      - ATA 2 Strict
    - PCMCIA-slots, configurable as
      - SRAM
      - HDD
    - Units are write-protectable.
  - Video
    - HTML5 WegGL- or Canvas2D-rendering.
    - 2/4 bits-per-pixel modes.
    - Lores-/Hires-/Superhires-types.
    - Doublescan-types.
    - Frameskip. (renders every 2nd frame only)
    - Centering.
    - Fullscreen-extensions support. (new)
  - Audio
    - HTML5 WegAudio-processing.
    - Samplerates from 11025-48000 Hz.
    - Mono or Stereo.
    - Lowpass filter for A500/A1200.
    - Variable Stereo-channel separation.
    - Different interpolation modes (Anti, RH, Crux)
  - Ports
    - HTML5 mouse-position and buttons import.
    - HTML5 keyboard import.
    - Joystick emulation via keyboard.
    - Mapping of some special keys for pinball-games.
    - Serial- and parallel-port. (new)
    - Gamepad-extensions support. (new)

- Limits
  - CPUs
    - 68000/68010
      - Prefetch is fake.
      - BKPT is not implemented.
    - 68020
      - CALLM/RTM is not implemented.
      - Execution-time of some instructions and interrupts are not fully correct.
    - 68030
      - MMU is fake.
      - Execution-time of some instructions and interrupts are not fully correct.
    - Exceptions 2 and 3 are not fully implemented.
    - Traps are not fully implemented.
  - Autoconf
    - Zorro2-autoconfig is limited to RAM-devices only.
  - Floppy
    - No support for compressed floppy-images like ADZ.
    - No FDI-/IPF-image support.
  - Mount
    - No onboard-SCSI for the A3000/4000.
    - No support for compressed hardfile-images like HDZ.

- Usage/Hints
  - If something does crash or freeze
    - Try another Amiga-model. A500+ for OCS/ECS and A1200 for AGA does work best.
    - Use the right rom. Selecting a wrong rom may freeze the emulation. If possible, use original kickstart-roms.
    - If you are using original A3000/4000 kickstart-roms, make sure to enable "32bit address-space" in the CPU-page.
    - If you are using the AROS kickstart-replacement, you should also give some fast-ram.
    - Try to enable "Compatible" in the CPU-page.
    - Try another memory setting or give more memory.
    - Try to set the floppy-speed back to 1x. Some stuff does not load if "Turbo" is selected.
  - If hardfiles did not get recognized
    - Select an A600/A1200 at the "Defaults"-page.
    - Or, go to "Chipset/Features/Manual" and select "Onboard-IDE" or "PCMCIA-slot" manually.
  - If gamepads/joysticks did not get recognized
    - Try to press buttons on the controller.
    - Open a new tab and return to the SAE-tab. (Chrome)

- API
  - There's no written documentation about the API yet, blame me. At least there's a commented example:
  - example 1
  - example 2

- Safety
  - Whatever you do, you can't harm your computer or change local-files.
  - Everything is running enclosed in the memory of the browser.
  - Changes to floppy-/hardfile-images are not stored physically, but to memory only.
    Reloading the window/tab (e.g. press F5) does reset all altered floppy-/hardfile-images and configurations.
  - No Amiga-virus (on floppy-/hardfile-images) can infect your real computer or device.
    If you close the window/tab of SAE, all possible viruses will die peacefully.

- Privacy
  - This site is completely free of 3rd-party stuff. (analytics, tracking, aids, ...)
  - No files (that you are selecting from your computer or informations about them) are transferred to the Internet.
    Note that this may not be the case for other sites, which are using this project.

- Your game or demo
  - If you want to have your game or demo on this site, please contact me.
  - Your contribution would be published under a free license, with a link to your homepage and would be free to play for everyone.

- Some sites using this project
  - archive.org
  - maclab.org

- Author
  - Written and ported by: Rupert Hausberger <rupert_hausberger@gmx.net>
  - Source-code: github.com/naTmeg/ScriptedAmigaEmulator
  - License: GPL

- Thanks
  - WinUAE team, especially Toni Wilen.
  - Bernd Schmidt, the father of amiga-emulation.
  - AROS team
  - All people who contributed their software or helped via github. Thanks for your support!

- Stats
  - First public version (0.5)
    - 5 months development time.
    - About the half was written from scratch, the rest was ported from various UAE-sources.
    - ~13.000 lines of code.
  - Versions (0.6 - 0.8.3)
    - Most code was ported from WinUAE 2.5.0
    - ~33.000 lines of code.
  - Current version (0.9.0)
    - 3 months development time.
    - ~15% was re-written.
    - ~70% was re-ported from WinUAE 3.2.x
    - ~60.000 lines of code.
  - Current version (0.9.12)
    - ~62.000 lines of code.

- History
  - 0.9.12 (23.06.2019):
    - Memory
      - Fixed an invalid function call at reset-state when emulating an A1000. (Thanks 'dirkwhoffmann' for info)
  - 0.9.11 (11.05.2019):
    - Disk
      - Fixed wrong bitmap-usage calculation at floppy_get_rootblock() in combination with HD-floppies. (Thanks 'dirkwhoffmann' for commit)
  - 0.9.10 (22.02.2019):
    - Memory/Roms
      - Fixed wrong $A80000-memory-access in combination with extended-roms > 1mb. (Thanks 'Vesuri' for commit)
      - Updated AROS-ROMs to actual version SVN55696.
    - Disk
      - Fixed bug in DMS decompression with DEEP Compression (Thanks 'steffest' for commit)
    - Video
      - Added support for the 'fullscreen-API'. There is a new api-function called sae.screen() and the new hook-function
        config.hooks.event.screened(). All browsers should support that. See the examples.
      - The mouse-pointer can now be hidden or locked via the 'pointerLock-API'.
        The feature is enabled by default. All browsers should support that. See 'Config/Video/Cursor'.
      - A canvas-element can now used directly as output. See example2.htm
    - Audio
      - Fixed wrong/multiple audio-channel selection at the ADKCON-register. (Thanks 'Vesuri' for commit)
      - Added mute-support over sae.mute()
    - Ports
      - Added experimental support for the 'Gamepad API'. It is disabled by default.
        Go to 'Config/Ports' to enable it. (Thanks to 'SpliFF' for the basic implementation)
      - Better handling of buttons and movement. No input-events get lost and also the 3rd mouse-button is now dectected.
      - Added emualtion of various protection-dongles.
      - Finished support for direct-serial communication and added hooks. See the examples.
      - Added support for direct-parallel communication and hooks. Also see the examples.
      - Removed the 'Enable Serial'-checkbox from 'Config/Ports'. Does not made much sense without hooks.
    - Config
      - Added hooks that get called after the emulator has been started, stopped, reseted, paused or fullscreened.
      - Fixed invalid access of the config-object. (Thanks 'db48x' for commit)
    - Common
      - Removed Google-Analytics. Sorry for the molestation.
      - Added an error if a ZIP-file get detected. Compressed files are not yet supported.
      - Fixed Object.prototype.clone() to a custom function to be compatible with 'jQuery'. (Thanks 'Vesuri' for commit)
      - The patch-version-number has now a 2nd digit and starting at 10.
  - 0.9.0 (15.07.2016)
    - CPU
      - Completely rewrote the core.
      - Added support for the 68010. (5 instructions, 3 registers)
      - Added support for the 68020. (27 instructions, 2 registers)
      - Added support for the 68030. (4 instructions)
      - Exploded each instruction to it's own size-form and sometimes additionally to it's type form.
      - For faster access, each instruction does now have it's customized parameter-object.
      - Effective-address access and decoding are now done via 6+1 highspeed function-tables, each 64 entries long.
        This does save up to 12 (3*2*2) switch statements per instruction.
      - Condition-code checking is now done via a 16 entries long function-table instead of a switch-function with 16 entries.
      - Optimized condition-code calculations.
      - Fixed/removed DIVU-remainder calculation, also new and faster DIVS.
      - New and faster versions of ABCD, NBCD, SBCD, ASL, ASR, LSL, LSR, ROL, ROXL, ROR, ROXR.
      - Fixed MOVEP instruction.
      - Fixed all 68000/68010 execution-time calculations.
      - Program-counter calculations are not hardcoded any more.
      - Ported high-level functions from actual WinUAE.
    - General
      - Re-ported and optimized the following parts from actual WinUAE:
        Audio, Blitter, CIA, Config, Copper, CPU-highlevel, Custom, Disk, Drawing, Events,
        Expansion, Filesys, Gayle, Hardfile, IDE, Memory, Roms, Playfield, RTC and Serial
    - Chipset
      - Custom-chip registers are now accessed via a 256 entries long function-table instead of a switch-function with 256 entries.
      - Added support for the A1000-Agnus.
    - CIA
      - Added support for different TOD sources.
      - Added support for ROM overlay.
      - Added support for A1000 Velvet prototype.
    - Blitter
      - Minterms are now calculated via a 256 entries long function-table instead of a switch-function with 256 entries.
    - RAM
      - Added Zorro3 and 32bit support.
      - Added support for chip-/bogo-ram aliasing.
      - Access is now done via function-tables (banks) instead of area-selecting switch-functions.
    - ROM
      - Added support for encrypted Cloanto-roms. (Amiga Forever)
      - Added special A1000 kickstart handling.
      - Added ROM-patcher, which does remove unneeded resident libraries.
      - Added support for ROM-mirroring.
      - Added ShapeShifter-support.
      - Added a ROM-info page.
      - Updated AROS-ROMs to actual version SVN52764.
    - Floppy
      - Added 3.5" DD ESCOM and 3.5" DD/HD PC only drive-types.
      - Added support for the diskspare-format.
      - Added support for PCDOS-images.
      - Added support for DMS-images. (DiskMasher)
      - Added support for SCP-images. (SuperCardPro)
      - Added support for EXE-images.
      - Disk can now be inserted from the database.
      - Drives are now write-protectable.
      - Added a disk-info page.
    - Mount
      - Added support for hardfiles. (*.hdf/*.vhd)
      - Added support for Onboard-IDE (A600/A1200)
      - Added support for PCMCIA-slots (A600/A1200)
      - Units are write-protectable.
    - Playfield
      - Added AGA-support.
      - Added support for 16 bits-per-pixel (R5G6B5) rendering.
      - Got rid of an internal temp-buffer. So in WebGL-mode, we render to the texture directly now.
      - Added options for video-centering.
    - Video
      - The output-driver is now selectable.
      - Added support and options for brightness, contrast and gamma.
      - Added alpha-channel support.
      - Added line-change indicator. (debug)
    - Audio
      - Added "Anti"-samplehandler.
      - Added A1200 lowpass-filter.
      - Added support for stereo-channel separation.
      - Rewrote handling of WebAudio-stuff.
    - Events
      - If supported by the browser, timing-functions does use performance.now() instead of Date.now(),
        which increases the precision by the factor of 1000.
      - Optimized switching between pause/run. Thanks 'majcherek2048'.
    - Input
      - Added distinction between left/right shift/alt keys. The config-entry "Map L/R-Shift to L/R-Arrows" is gone.
    - Config
      - Completely reworked the advanced config page.
      - Changed all SAEV_Config_* to SAEC_Config_* to match the new namespace. Sorry for that :/
      - Many new options. Not listed here, see sae/config.js for details.
    - API
      - Deprecated and removed the old API function "SAE()". We're on javascript, so let's use: (new API)
        "var sae = new ScriptedAmigaEmulator(); [...] var error = sae.start(); [...]" See index.js for details.
      - Reworked error-handling for API-calls. Now an error-code (SAEE_*) is returned on any API-call.
    - Common
      - Introduced global functions, references, variables and constants for more speed. See sae/amiga.js for details.
      - Moved all entries from constants.js to their specific place and renamed them to match the new global name-space.
      - Updated asynchronous file-transfers to latest standards.
      - Added proper GPL-header to the source-files.
      - Moved the "Your game and demo..."-section from the main-site to the readme.
      - Fixed linkage to contributors websites.
      - Added SAE-specific-links to the info-box in the main-page.
      - Added an disassembler tool.
        "var sda = new ScriptedDisAssembler(); [...] var result = sda.disassemble();" See disass.js for details.
  - 0.8.3 (22.03.2015)
    - Audio
      - Fixed a heavy bug i added myself around v0.6-0.7 on the seek for other bugs. Big thanks to 'Ralf Sommer'.
      - Dropped usage of the ring-buffer and wrote a new and faster queue-buffer.
      - The audio-data is now first sampled at 15.65KHz and then resampled to
        the rate of the soundcard. This does reduce internal CPU-usage.
      - Removed 'Audio/Samplerate' in the GUI, because it's no longer used.
    - Events
      - Fixed a bug in combination with frameskip.
      - Frameskip is now disabled by default.
    - Common
      - Updated AROS-ROMs to actual version SVN50213.
  - 0.8.2 (10.01.2015)
    - Audio
      - Fixed 'WebAudio'-output. All other dropped. Thanks 'dmcoles'.
      - Some speed optimizations.
    - CPU
      - Fixed a bug in the DIVS-function in combination with negative numbers. Thanks 'dmcoles'.
    - Common
      - Removed old copyright statements in the source files. Thanks 'swinkamor12'.
  - 0.8.1 (19.01.2013):
    - Common
      - The license of the project is now GPL.
      - Changed and updated front-end.
      - Removed the drivers-info box. I did'nt like it that way.
  - 0.8.0 (16.01.2013):
    - Display
      - Ported and optimized playfield-code from WinUAE.
        This adds ECS and AGA support and fixes graphics-errors.
        The AGA part is commented out, because there is no 68020 yet.
      - Added support for drawing via 'Canvas 2D' if 'WebGL' is not avail.
      - Added support for auto-driver detection.
    - Audio
      - While disk access, audio performance is much better now.
      - Added support for the A500 lowpass-filter. Not enabled by default.
      - Added support for auto-driver detection.
    - Memory
      - To gain speed, all memory is now accessed directly and not via functions.
        So, don't care for a possible illegal memory access.
      - Fixed bug, where kickstart 1.2 failed to load.
      - Fixed incorrect extended-address bug.
    - CPU
      - Splitted address-types of ADDQ/SUBQ into separate functions for more speed.
      - Added bus-read/write cycles tables. For internal use only.
    - CIA
      - I decided to port the latest cia-code from WinUAE while i was trying to find a bug.
        Well, the bug is still there. Let's keep the code nevertheless.
    - GUI
      - Added info box of supported drivers.
      - Added a 'Chipset'-section and various options.
      - Packed the main GUI.
    - Common
      - Added support for easy URL sharing. E.g. to show the Multica-demo to a friend,
        one may send the link "http://scriptedamigaemulator.net/#Multica"
        and the demo will start immediately. (thanks mrdoob)
      - Many small optimizations.
  - 0.7.0 (24.12.2012):
    - Common
      - Chaned the project-name from 'Janus' to 'SAE' (Scripted Amiga Emulator).
        This step is necessary because i did'nt enough research before the initial release.
        There is already a project with that name in it. (janus-uae) I'm sorry for that, that was kinda stupid :)
      - Separated the GUI form the core and rewrote most of it.
      - Simplified the whole code. This means, that functions are called faster.
      - Ported new Copper-, Blitter-, Audio-, Disk- and event-handling code from WinUAE 2.5.0
      - Moved all "beam-functions" to events.js, for faster access.
      - Added "CPU-usage" to the GUI.
      - Added "Hall of Fame".
    - CPU
      - Added support for exact cycling. The CPU have now 7.09 MHz on PAL and 7.16 MHz on NTSC resp.
      - Added option for "Original"- and "Maximum"-speed.
    - Audio
      - Added a ring-buffer before output. No more "bagpipe"-like audio.
      - Added a option to just emulate the hardware, but not to play any sound,
        e.g. "Agony" was not starting, if audio was disabled.
    - Display
      - Switched from the RGB to the 565 texture-format-encoding in WebGL, which gives a little more speed.
      - Added support and a option for 4x scaling.
      - Fixed screen-draging in lo-/hires-modes.
      - Added a option to disable the output. Can be used to better play music-demos.
    - Disk
      - Added support for different speed-modes.
      - Added support for extended ADF-files.
      - Enabled write support. (to memory)
    - Input
      - The F-keys does work normaly now, i.e F5 does'nt reload the emulator, backspace does'nt go to the last page, etc...
      - Fixed bug in the joystick-emulation.
  - 0.6.1 (05.11.2012):
    - CPU
      - Added missing TAS command. ('Wings of Death' game does use it)
    - ROM
      - Added a crc32-checksum test after download. (AROS)
      - Changed transfer-mode from syncronous to asyncronous. (AROS)
    - Display
      - Optimized the line-drawing code of the blitter.
      - Fixed decision whether the resulting image is scaled or not. ('Agony' game)
      - Disabled 'Framedrop' in interlace-mode.
    - Misc
      - Fixed HTML5 doctype.
      - Added ver/rev to the title.
      - Changed revision to 3 digits.
  - 0.6 (25.10.2012):
    - ROM
      - Added support for extended-roms.
      - AROS kickstart replacement is now the default-rom, and will be downloaded and used on the fly.
    - RAM
      - Changed internal memory alignment from 8 to 16 bit.
      - Added fast-ram support, through a emulated Commodore A2058 in Zorro2-mode.
      - Removed the D8DC-memory-option from the GUI. This memory space is now always allocated.
      - Sorted access of the memory-routines by priority.
    - CPU
      - Fixed sign-extension for memory to address-register transfers in MOVEM.
      - Fixed sign-extension for absolute-word addresses in exEA.
      - Fixed wrong address when writing a byte to the stack in ldEA.
      - Fixed 32bit calculations for address-regsiters in ADDQ/SUBQ.
      - Fixed remainder calculation in DIVU.
      - Optimized integer-arithmetic functions. Size depending calcalations are now used.
      - Improved exception 2/3 handling.
      - More small cleanups not listed here.
    - Disk
      - Ported latest disk-code from WinUAE. Disk-based problems should be gone now, e.g. floppy shown as BAD or read errors.
      - Diskchange does now work.
      - Drives can be disabled now.
      - DD/HD types are now supported.
    - Display
      - Added missing support for HAM6.
      - Fixed horizontal and vertical screen-centering.
      - Fixed screen-draging, almost, read the "Known bugs" section.
      - Added better screen-scrolling.
    - Input
      - Fixed key-mapping to the amiga key-layout, at least in Chrome. Firefox does not like "öäü", it seems.
      - Added support for individual configurations of joystick-movement and fire-buttons.
      - Fixed bug, that made the fire 1 button on joystick 0 not working.
      - Fixed bug in the mouse-movement function, that calculates the wrong coordinates in some cases.
    - GUI
      - Added eject-button in the disk-change requester.
      - Removed the CPU and OCS/ECS options. They are useless so far.
      - The "Pause" and "Resume" buttons are once now.
      - Made some options to only apear when selected.
      - Did some cosmetics.
    - Misc
      - Added support for Zorro2-expansion cards.
      - Added a more precise event-handling. This makes the audio-output a little smoother.
      - Changed the ratio of CPU-/Chipset-time from 1:8 to 1:4
      - Fixed a bug in the RTC. "Year" is now calculated correctly.
      - Fixed incorrect response of serial.device. Now crashed programms does reset (and show the guru), instead of idle.
      - Any output on the serial.device is now redirected to the debug-log. (dev only)
      - Kickstart/Workbench 2.04 and AROS does now work.
      - Overall about 10-30% more speed, as long as the blitter is not used too much.
  - 0.5 (01.09.2012):
    - Initial.

1999-2019 Damisoft Groupe | Damisoft Scripts | Amiga Games | Kickstart Roms