Skip to content
Atari ST Emulator
Branch: master
Clone or download
Latest commit 8481b90 Apr 22, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cpu TEMPORARY fix to TRAP to appease Phalanx Demo. Apr 20, 2016
cpuinstr Clocked SUB instruction. Apr 20, 2016
debug CPU loglevel TRACE replaces cprint_all. Apr 11, 2016
doc Add Yacht tables. Apr 19, 2016
tests MOVEM is the first real instruction using the clocked CPU method. Apr 2, 2016
.cvsignore Added .cvsignore file Jun 1, 2004
.dir-locals.el Add .dir-locals file to instruct Emacs to conform to the ostis style … Mar 12, 2016
.gitignore Add small configure script. Mar 29, 2016
.travis.yml Continuous integration build in Travis CI. Mar 31, 2016
COPYING ostis is now considered LGPL Jun 3, 2004
Makefile Move clock callbacks to a separate file. Apr 12, 2016
README.md Make it possible to change update speed on the fly using weird combin… Mar 22, 2016
acia.c Print diagnostics for bus accesses and wait states. Apr 19, 2016
acia.h Split off ACIA device into separate file. Mar 16, 2016
cartridge.c Merge pull request #74 from lokedhs/check-malloc Mar 18, 2016
cartridge.h Add getopt_long and make cartridge files loadable Feb 27, 2016
clock.c Add an API to delay a function call by a number of clock cycles. Apr 12, 2016
clock.h Add an API to delay a function call by a number of clock cycles. Apr 12, 2016
common.h Make debugger work with clocked cpu Mar 24, 2016
configure Only enable ASSERT, TRACE, and CLOCK if DBG is defined. Apr 3, 2016
cprint.c Merge pull request #74 from lokedhs/check-malloc Mar 18, 2016
cprint.h Moving cprint stuff into its own file, according to Issue #30 Mar 3, 2016
cpu.c Clocked SUB instruction. Apr 20, 2016
cpu.h Fix prefetch in all clocked instructions and EA calculation. Apr 20, 2016
diag.c Symbolic names for diagnostic levels. Apr 11, 2016
diag.h Symbolic names for diagnostic levels. Apr 11, 2016
dma.c Remove read_long and write_long from struct mmu. Mar 18, 2016
dma.h DMA has no interrupt capability. Mar 16, 2016
event.c CPU loglevel TRACE replaces cprint_all. Apr 11, 2016
event.h Got multiple windows to work. It is a bit messy, and should be cleane… Feb 16, 2016
expr.h Initial revision Apr 25, 2004
expr.l Remove pointless limit of debugger addresses, and allow for byte expr… Feb 14, 2016
expr.y Rename mmu_read/write_byte/word/long to bus_read/write_byte/word/long. Mar 18, 2016
fdc.c First bits of read track support. Not sure if it actually works though Mar 12, 2016
fdc.h Fix some bugs I apparently caused when implementing the hdc bits Mar 10, 2016
floppy.c Merge pull request #74 from lokedhs/check-malloc Mar 18, 2016
floppy.h The filename field is common to all floppy formats. Mar 14, 2016
floppy_msa.c Merge pull request #74 from lokedhs/check-malloc Mar 18, 2016
floppy_msa.h The filename field is common to all floppy formats. Mar 14, 2016
floppy_st.c Merge pull request #74 from lokedhs/check-malloc Mar 18, 2016
floppy_st.h The filename field is common to all floppy formats. Mar 14, 2016
floppy_stx.c Only enable ASSERT, TRACE, and CLOCK if DBG is defined. Apr 3, 2016
floppy_stx.h The filename field is common to all floppy formats. Mar 14, 2016
glue.c Update GLUE state machine as per Troed's latest info. Apr 12, 2016
glue.h Send a clock signal to the GLUE. Mar 20, 2016
hdc.c Rename mmu_read/write_byte/word/long to bus_read/write_byte/word/long. Mar 18, 2016
hdc.h Very preliminary hard drive support, working in read only so far Mar 10, 2016
ikbd.c Use malloc in cases where error returns are handled Mar 17, 2016
ikbd.h Remove some unnecessary functions. Mar 16, 2016
instr.h A couple of comments about missing instructions Feb 17, 2016
instr_clocked.h Add a mode where the CPU runs off a clock, one cycle at a time, inste… Mar 24, 2016
logo-main.png Added icons for both windows Mar 20, 2016
logo-monst.png Added icons for both windows Mar 20, 2016
main.c CPU loglevel TRACE replaces cprint_all. Apr 11, 2016
mfp.c More diagnostics in MFP. Mar 29, 2016
mfp.h Remove some unnecessary functions. Mar 16, 2016
midi.c Remove read_long and write_long from struct mmu. Mar 18, 2016
midi.h Initial revision Apr 25, 2004
mmu.c Print diagnostics for bus accesses and wait states. Apr 19, 2016
mmu.h Do MMU wait states the same way in both clocked and old CPU. Apr 19, 2016
mmu_fallback.c Remove read_long and write_long from struct mmu. Mar 18, 2016
mmu_fallback.h Fix so that some memory areas are available without bus errors even t… Feb 27, 2016
prefs.c Reintroducing strdup of const string, because the way prefs works, it… Mar 18, 2016
prefs.h Very preliminary hard drive support, working in read only so far Mar 10, 2016
psg.c Print diagnostics for bus accesses and wait states. Apr 19, 2016
psg.h Move interrupt functions to the MMU device framework. Mar 16, 2016
ram.c The shifter should read from RAM without the usual wait states. Apr 11, 2016
ram.h The shifter should read from RAM without the usual wait states. Apr 11, 2016
rom.c Merge pull request #74 from lokedhs/check-malloc Mar 18, 2016
rom.h Initial revision Apr 25, 2004
rtc.c Remove read_long and write_long from struct mmu. Mar 18, 2016
rtc.h Initial revision Apr 25, 2004
scancode.h Add keyboard support for punctuation characters: Mar 10, 2016
screen.c Fix for running the FNIL demo. Apr 1, 2016
screen.h
shifter.c The shifter "loads" variable should never go beyond 4. Apr 14, 2016
shifter.h
state.c Remove unnecessary casts of the return value from xmalloc Mar 17, 2016
state.h Make cycle into a 64bit value instead to limit overflow slightly Feb 22, 2016

README.md

Cycle-Accurate Atari ST Emulator

Building

To build, the SDL2 library and the SDL2 image library must be installed. Also, you need tools compatible with Lex and Yacc. E.g. apt-get install libsdl2-dev libsdl2-image-dev flex bison.

There are a few different build options (always do make clean first):

Normal optimised binary: make

Normal binary with GDB flags: make gdb

Binary setup for running tests (se below): make test

Usage

Command line options:
ostis [-a disk image] [-b disk image] [-t TOS image] [-s state image] [-h] [-d] [disk image] [-p] [-y] [-V]

-a - Load disk image (.ST, .MSA or .STX)
-b - Load disk image into B: (.ST, .MSA or .STX)
-c - Mount ACSI hard drive
-t - TOS image (default: tos.img)
-s - Save state file
-h - Show help
-d - Activate MonST clone
-p - Dump all video into PPM file (ostis.ppm)
-y - Dump all audio into raw PCM file (psg.raw)
-V - Try to wait for 50Hz delay between frames
-M - Monochrome mode.
-v - Increase diagnostics verbosity.
-q - Decrease diagnostics verbosity.

Long options: --cart CARTRIDGE - Load cartridge --loglevels LEVEL_LIST - Set loglevels for individual modules (se below)

Special keys:
F11 - save emulator state to file
F12 - print diagnosics
F13 - temporarily save state
F14 - restore temporary state
PrintScr - toggle insane amount of debug output (live disassemble)
Pause - toggle window grab (also hides native mouse cursor)
Ctrl-Pause - toggle fullscreen
Ctrl-Shift-Gui-Fxx - Set update speed (Se below).

Update speed:

F1    No delay
F2    10ms per frame
F3    20ms
F4    30ms
F5    40ms
F6    50ms
F7    75ms
F8   100ms
F9   150ms
F10  200ms
F11  500ms
F12 1000ms

MonST keys:
Esc - set window address to pc
TAB - cycle window
Up, Down, Left, Right - move window
D - toggle debug mode
Alt-T - change window type
Alt-F - change window font
Alt-S - split window
Ctrl-S - skip instuction
Alt-Y - toggle full screen
Ctrl-Z - step
Ctrl-A - run until next instruction
Ctrl-R - run
Ctrl-M - set window address
Ctrl-V - toggle display
L - set label
Shift-L - Save/Load labels to/from file
Alt-B - set breakpoint
Ctrl-B - set breakpoint at window
Alt-W - Set watchpoint

Logging

Levels available are (set level and everything lower): 0 - Set to 0 to log nothing 1 - FATAL: Fatal errors 2 - ERROR: Normal errors 3 - WARN: Warnings (default) 4 - INFO: Information 5 - DEBUG: Debug messages 6 - TRACE: Trace output

LEVEL_LIST can be set in the following two ways: -IKBD to remove all output from IKBD IKBD:2 to set IKBD to only log ERROR and FATAL messages

Multiple modules can be set in a comma separated string: -IKBD,MFP0:2,PSG0:5 means no IKBD, some MFP0 and up to debugging level on PSG0

Testing

At the moment of writing this, only one test exists. It is run as follows:

Build the test binary with make test. Run ./ostis-test --test-case moveq

This will load the cartridge image tests/data/test_moveq.cart before starting the system.
The cartridge image contains the following code:

$FA0000 DC.L $FA52235F  ; Cartridge boot signature
$FA0004 BKPT #0         ; $4848 (68010 BKPT instruction)
$FA0006 MOVEQ #98,D0
$FA0008 BKPT #7         ; $484F (68010 BKPT instruction)

The BKPT #0 will run the hook for test initialization (test_moveq_hook_init()) that can be used to prepare things before the test

BKPT #7 will run the exit hook (test_moveq_hook_exit()) which will then compare the current state to the expected one and exit with 0 (SUCCESS) or -1 (FAIL).

The source for the cartridge images are provided alongside the .cart files. These files can be assembled into the cartridge image using the asmx tool (or probably pretty much any other 68k assembler as well).

ASMX: http://xi6.com/projects/asmx/

To assemble: asmx -C 68k -b -o test_moveq.cart test_moveq.s

You can’t perform that action at this time.