izapple2/README.md

313 lines
11 KiB
Markdown
Raw Permalink Normal View History

2020-10-03 21:38:26 +00:00
# izapple2 - Apple ][+, //e emulator
2019-06-02 21:00:31 +00:00
2019-11-11 22:28:07 +00:00
Portable emulator of an Apple II+ or //e. Written in Go.
2019-06-02 21:00:31 +00:00
## Features
2019-11-08 22:56:54 +00:00
- Models:
2020-08-08 11:40:48 +00:00
- Apple ][+ with 48Kb of base RAM
- Apple //e with 128Kb of RAM
- Apple //e enhanced with 128Kb of RAM
2020-11-03 17:41:10 +00:00
- Base64A clone with 48Kb of base RAM and paged ROM
2019-11-09 16:44:04 +00:00
- Storage
2020-11-03 17:41:10 +00:00
- 16 Sector 5 1/4 diskettes. Uncompressed or compressed witth gzip or zip. Supported formats:
- NIB (read only)
- DSK
- PO
2021-07-01 17:59:15 +00:00
- [WOZ 1.0 or 2.0](storage/WozSupportStatus.md) (read only)
- 3.5 disks in PO or 2MG format
- Hard disk in HDV or 2MG format with ProDOS and SmartPort support
2019-06-02 21:00:31 +00:00
- Emulated extension cards:
- DiskII controller (state machine based for WOZ files)
2020-08-08 11:40:48 +00:00
- 16Kb Language Card
- 256Kb Saturn RAM
- Parallel Printer Interface card
- 1Mb Memory Expansion Card (slinky)
- RAMWorks style expansion Card (up to 16MB additional) (Apple //e only)
2020-08-08 11:40:48 +00:00
- ThunderClock Plus real time clock
- Apple //e 80 columns card with 64Kb extra RAM and optional RGB modes
- No Slot Clock based on the DS1216
- Videx Videoterm 80 column card with the Videx Soft Video Switch (Apple ][+ only)
2022-04-18 11:02:28 +00:00
- SwyftCard (Apple //e only)
2024-01-29 23:33:53 +00:00
- Brain Board
2023-12-18 22:16:41 +00:00
- Brain Board II
2024-01-29 23:33:53 +00:00
- MultiROM card
- Dan ][ Controller card
2024-03-04 19:50:27 +00:00
- ProDOS ROM card
- Useful cards not emulating a real card
- Bootable SmartPort / ProDOS card with the following smartport devices:
- Block device (hard disks)
- Fujinet network device (supports only http(s) with GET and JSON)
- Fujinet clock (not in Fujinet upstream)
2020-08-08 11:40:48 +00:00
- VidHd, limited to the ROM signature and SHR as used by Total Replay, only for //e models with 128Kb
- FASTChip, limited to what Total Replay needs to set and clear fast mode
2021-01-25 18:01:53 +00:00
- Mouse Card, emulates the entry points, not the softswitches.
- Host console card. Maps the host STDIN and STDOUT to PR# and IN#
2021-10-12 10:26:40 +00:00
- ROMXe, limited to font switching
2019-06-02 21:00:31 +00:00
- Graphic modes:
2020-08-08 11:40:48 +00:00
- Text 40 columns
- Text 80 columns (Apple //e and Videx VideoTerm)
2020-08-08 11:40:48 +00:00
- Low-Resolution graphics
- Double-Width Low-Resolution graphics (Apple //e only)
- High-Resolution graphics
- Double-Width High-Resolution graphics (Apple //e only)
- Super High Resolution (VidHD only)
- Mixed mode
- RGB card text 40 columns with 16 colors for foreground and background (mixable)
2020-08-08 11:40:48 +00:00
- RGB card mode 11, mono 560x192
- RGB card mode 12, ntsc 160*192
2020-08-08 11:40:48 +00:00
- RGB card mode 13, ntsc 140*192 (regular DHGR)
- RGB card mode 14, mix of modes 11 and 13 on the fly
2019-06-02 21:00:31 +00:00
- Displays:
2020-08-08 11:40:48 +00:00
- Green monochrome monitor with half width pixel support
- NTSC Color TV (extracting the phase from the mono signal)
- RGB for Super High Resolution and RGB card
- ANSI Console, avoiding the SDL2 dependency
- Debug mode: shows four panels with actual screen, page1, page2 and extra info dependant of the video mode
2021-04-02 18:39:37 +00:00
- Tracing capabilities:
- CPU execution disassembled
- Softswitch reads and writes
- ProDOS MLI calls
- Apple Pascal BIOS calls
2022-10-24 21:09:06 +00:00
- SmartPort commands
- BBC MOS calls when using [Applecorn](https://github.com/bobbimanners/)
2019-11-11 22:28:07 +00:00
- Other features:
2020-08-08 11:40:48 +00:00
- Sound
- Joystick support. Up to two joysticks or four paddles
2021-01-24 22:25:52 +00:00
- Mouse support. No mouse capture needed
2020-08-08 11:40:48 +00:00
- Adjustable speed
- Fast disk mode to set max speed while using the disks
- Single file executable with embedded ROMs and DOS 3.3
- Pause (thanks a2geek)
2020-09-23 16:31:43 +00:00
- Passes the [A2AUDIT 1.06](https://github.com/zellyn/a2audit) tests as II+, //e, and //e Enhanced.
2021-09-26 16:25:11 +00:00
- Partial pass ot the [ProcessorTests](https://github.com/TomHarte/ProcessorTests) for 6502 and 65c02. Failing test 6502/v1/20_55_13; flags N anv V issues with ADC; and missing some undocumented 6502 opcodes.
2019-06-02 21:00:31 +00:00
2020-08-12 20:50:40 +00:00
By default the following configuration is launched:
- Enhanced Apple //e with 65c02 processor
2020-11-03 17:41:10 +00:00
- RAMWorks card with 80 column, RGB (with Video7 modes) and 8Gb RAM in aux slot
- Parallel print inteface in slot 1
2020-08-12 20:50:40 +00:00
- VidHD card (SHR support) in slot 2
- FASTChip Accelerator card in slot 3
2021-01-24 22:25:52 +00:00
- Mouse card in slot 4
2020-08-12 20:50:40 +00:00
- SmartPort card with 1 device in slot 5 (if an image is provided with -disk35)
- DiskII controller card in slot 6
- SmartPort card with 1 device in slot 7 (if an image is provided with -hd)
2019-06-02 21:00:31 +00:00
## Running the emulator
2020-10-03 21:38:26 +00:00
No installation required. [Download](https://github.com/ivanizag/izapple2/releases) the single file executable `izapple2xxx_xxx` for linux or Mac, SDL2 graphics or console. Build from source to get the latest features.
2019-06-02 21:00:31 +00:00
### Default mode
2020-03-08 22:42:39 +00:00
Execute without parameters to have an emulated Apple //e Enhanced with 128kb booting DOS 3.3 ready to run Applesoft:
2020-08-08 11:40:48 +00:00
``` terminal
2020-10-03 21:38:26 +00:00
casa@servidor:~$ ./izapple2sdl
2019-06-02 21:00:31 +00:00
```
![DOS 3.3 started](doc/dos33.png)
### Play games
2020-08-08 11:40:48 +00:00
2020-10-04 17:41:07 +00:00
Download a DSK or WOZ file or use an URL ([Asimov](https://www.apple.asimov.net/images/) is an excellent source):
2020-08-08 11:40:48 +00:00
``` terminal
2020-10-04 17:41:07 +00:00
casa@servidor:~$ ./izapple2sdl "https://www.apple.asimov.net/images/games/action/karateka/karateka (includes intro).dsk"
2019-06-02 21:00:31 +00:00
```
2020-08-08 11:40:48 +00:00
2019-06-02 21:00:31 +00:00
![Karateka](doc/karateka.png)
2019-10-02 21:39:39 +00:00
### Play the Total Replay collection
2020-08-08 11:40:48 +00:00
2019-10-02 21:39:39 +00:00
Download the excellent [Total Replay](https://archive.org/details/TotalReplay) compilation by
2020-10-04 17:41:07 +00:00
[a2-4am](https://github.com/a2-4am/4cade):
2020-08-08 11:40:48 +00:00
``` terminal
2021-02-13 15:15:05 +00:00
casa@servidor:~$ ./izapple2sdl Total\ Replay\ v4.0.hdv
2019-10-02 21:39:39 +00:00
```
2020-08-08 11:40:48 +00:00
2019-11-11 22:28:07 +00:00
Displays super hi-res box art as seen with the VidHD card.
2019-10-02 21:39:39 +00:00
![Total Replay](doc/totalreplay.png)
2019-06-02 21:00:31 +00:00
### Terminal mode
2020-08-08 11:40:48 +00:00
2020-10-03 21:38:26 +00:00
To run text mode right on the terminal without the SDL2 dependency, use `izapple2console`. It runs on the console using ANSI escape codes. Input is sent to the emulated Apple II one line at a time:
2020-08-08 11:40:48 +00:00
``` terminal
2020-10-03 21:38:26 +00:00
casa@servidor:~$ ./izapple2console -model 2plus
2019-06-02 21:00:31 +00:00
############################################
# #
# APPLE II #
# #
# DOS VERSION 3.3 SYSTEM MASTER #
# #
# #
# JANUARY 1, 1983 #
# #
# #
# COPYRIGHT APPLE COMPUTER,INC. 1980,1982 #
# #
# #
# ]10 PRINT "HELLO WORLD" #
# #
# ]LIST #
# #
# 10 PRINT "HELLO WORLD" #
# #
# ]RUN #
# HELLO WORLD #
# #
# ]_ #
# #
# #
############################################
2020-08-08 11:40:48 +00:00
Line:
2019-06-02 21:00:31 +00:00
```
### Command line options
<!-- doc/usage.txt start -->
```terminal
Usage: izapple2 [file]
2024-01-06 20:48:23 +00:00
file
path to image to use on the boot device
-charrom string
rom file for the character generator (default "<internal>/Apple IIe Video Enhanced.bin")
-cpu string
cpu type, can be '6502' or '65c02' (default "65c02")
2020-11-03 17:41:10 +00:00
-forceCaps
2024-01-06 20:48:23 +00:00
force all letters to be uppercased (no need for caps lock!)
2019-10-20 22:06:28 +00:00
-model string
2024-01-06 20:48:23 +00:00
set base model (default "2enh")
-mods string
comma separated list of mods applied to the board, available mods are 'shift', 'four-colors
2024-01-06 20:48:23 +00:00
-nsc string
add a DS1216 No-Slot-Clock on the main ROM (use 'main') or a slot ROM (default "main")
2019-10-19 18:31:18 +00:00
-profile
2024-01-06 20:48:23 +00:00
generate profile trace to analyse with pprof
-ramworks string
memory to use with RAMWorks card, max is 16384 (default "8192")
-rgb
2024-01-06 20:48:23 +00:00
emulate the RGB modes of the 80col RGB card for DHGR
2019-06-02 21:00:31 +00:00
-rom string
2024-01-06 20:48:23 +00:00
main rom file (default "<internal>/Apple2e_Enhanced.rom")
2021-10-12 10:26:40 +00:00
-romx
2024-01-06 20:48:23 +00:00
emulate a RomX
-s0 string
slot 0 configuration. (default "language")
-s1 string
slot 1 configuration. (default "empty")
2024-01-06 20:48:23 +00:00
-s2 string
slot 2 configuration. (default "vidhd")
-s3 string
slot 3 configuration. (default "fastchip")
-s4 string
slot 4 configuration. (default "empty")
2024-01-06 20:48:23 +00:00
-s5 string
slot 5 configuration. (default "empty")
-s6 string
slot 6 configuration. (default "diskii,disk1=<internal>/dos33.dsk")
-s7 string
slot 7 configuration. (default "empty")
-speed string
cpu speed in Mhz, can be 'ntsc', 'pal', 'full' or a decimal nunmber (default "ntsc")
-trace string
trace CPU execution with one or more comma separated tracers (default "none")
The available pre-configured models are:
2: Apple ][
2e: Apple IIe
2enh: Apple //e
2plus: Apple ][+
base64a: Base 64A
swyft: swyft
The available cards are:
brainboard: Firmware card. It has two ROM banks
brainboard2: Firmware card. It has up to four ROM banks
dan2sd: Apple II Peripheral Card that Interfaces to a ATMEGA328P for SD card storage
diskii: Disk II interface card
diskiiseq: Disk II interface card emulating the Woz state machine
fastchip: Accelerator card for Apple IIe (limited support)
fujinet: SmartPort interface card hosting the Fujinet
inout: Card to test I/O
language: Language card with 16 extra KB for the Apple ][ and ][+
memexp: Memory expansion card
mouse: Mouse card implementation, does not emulate a real card, only the firmware behaviour
multirom: Multiple Image ROM card
parallel: Card to dump to a file what would be printed to a parallel printer
2024-03-08 20:36:27 +00:00
prodosromcard3: A bootable 4 MB ROM card by Ralle Palaveev
prodosromdrive: A bootable 1 MB solid state disk by Terence Boldt
saturn: RAM card with 128Kb, it's like 8 language cards
smartport: SmartPort interface card
softswitchlogger: Card to log softswitch accesses
swyftcard: Card with the ROM needed to run the Swyftcard word processing system
thunderclock: Clock card
videx: Videx compatible 80 columns card
vidhd: Firmware signature of the VidHD card to trick Total Replay to use the SHR mode
The available tracers are:
cpm65: Trace CPM65 BDOS calls
cpu: Trace CPU execution
mli: Trace ProDOS MLI calls
mos: Trace MOS calls with Applecorn skipping terminal IO
mosfull: Trace MOS calls with Applecorn
panicss: Panic on unimplemented softswitches
ss: Trace sotfswiches calls
ssreg: Trace sotfswiches registrations
ucsd: Trace UCSD system calls
2019-06-02 21:00:31 +00:00
```
<!-- doc/usage.txt end -->
2019-06-02 21:00:31 +00:00
## Building from source
2021-03-30 19:27:47 +00:00
### Linux
Besides having a working Go installation, install the SDL2 developer files. Run:
``` terminal
git clone github.com/ivanizag/izapple2
cd izapple2/frontend/a2sdl
go build .
```
2023-03-10 15:13:55 +00:00
### MacOS
With a working Go installation, run:
``` terminal
brew install SDL2
git clone github.com/ivanizag/izapple2
cd izapple2/frontend/a2sdl
go build .
```
2021-03-30 19:27:47 +00:00
### Windows
On Windows, CGO needs a gcc compiler. Install [mingw-w64](http://mingw-w64.org/doku.php/download/mingw-builds) and the [SDL2 developer files](https://www.libsdl.org/release/) for mingw-64.
2019-06-02 21:00:31 +00:00
Run:
2020-08-08 11:40:48 +00:00
``` terminal
2021-03-30 19:27:47 +00:00
git clone github.com/ivanizag/izapple2
cd izapple2\frontend\a2sdl
go build .
2019-06-15 12:01:10 +00:00
```
2021-03-30 19:27:47 +00:00
To run in Windows, copy the file `SDL2.dll` on the same folder as `a2sdl.exe`. The latest `SDL2.dll` can be found in the [Runtime binary for Windows 64-bit](https://www.libsdl.org/download-2.0.php).
2019-12-26 22:11:32 +00:00
### Use docker to cross compile for Linux and Windows
2019-06-15 12:01:10 +00:00
2019-12-26 22:11:32 +00:00
To create executables for Linux and Windows without installing Go, SDL2 or the Windows cross compilation toosl, run:
2020-08-08 11:40:48 +00:00
``` terminal
2020-08-08 11:40:48 +00:00
cd docker
./build.sh
2019-06-15 12:01:10 +00:00
```