izapple2/README.md

223 lines
7.9 KiB
Markdown
Raw Normal View History

2019-11-11 22:28:07 +00:00
# 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
2019-06-10 22:13:56 +00:00
[![CircleCI](https://circleci.com/gh/ivanizag/apple2/tree/master.svg?style=svg)](https://circleci.com/gh/ivanizag/apple2/tree/master)
2019-06-02 21:00:31 +00:00
## Features
2019-11-08 22:56:54 +00:00
- Models:
- Apple ][+ with 48Kb of base RAM
- Apple //e with 128Kb of RAM
- Apple //e enhanced with 128Kb of RAM
- Base64A clone with 48Kb of base RAM and paginated ROM
2019-11-09 16:44:04 +00:00
- Storage
2020-06-06 12:10:27 +00:00
- 16 Sector diskettes in NIB, DSK or PO format
2019-12-22 13:32:54 +00:00
- 16 Sector diskettes in WOZ 1.0 or 2.0 format (read only)
2020-01-12 16:14:20 +00:00
- Hard disk with ProDOS and SmartPort support
2019-06-02 21:00:31 +00:00
- Emulated extension cards:
- DiskII controller
- 16Kb Language Card
- 256Kb Saturn RAM
- 1Mb Memory Expansion Card
- ThunderClock Plus real time clock
2019-11-11 22:28:07 +00:00
- Bootable hard disk card
- Apple //e 80 columns with 64Kb extra RAM
2019-11-22 22:27:25 +00:00
- VidHd, limited to the ROM signature and SHR as used by Total Replay, only for //e models with 128Kb
2019-11-12 22:47:48 +00:00
- FASTChip, limited to what Total Replay needs to set and clear fast mode
2019-06-02 21:00:31 +00:00
- Graphic modes:
2019-11-08 22:56:54 +00:00
- Text 40 columns
- Text 80 columns (Apple //e only)
2019-11-08 22:56:54 +00:00
- Low-Resolution graphics
2019-11-08 23:44:13 +00:00
- Double-Width Low-Resolution graphics (Apple //e only)
2019-11-08 22:56:54 +00:00
- High-Resolution graphics
2019-11-09 16:44:04 +00:00
- Double-Width High-Resolution graphics (Apple //e only)
2019-11-11 22:28:07 +00:00
- Super High Resolution (VidHD only)
2019-11-08 22:56:54 +00:00
- Mixed mode
2019-06-02 21:00:31 +00:00
- Displays:
- Green monochrome monitor with half width pixel support
- NTSC Color TV (extracting the phase from the mono signal)
2019-11-11 22:28:07 +00:00
- RGB for Super High Resolution
2019-06-02 21:00:31 +00:00
- ANSI Console, avoiding the SDL2 dependency
2019-11-11 22:28:07 +00:00
- Other features:
- Sound
- Joystick support. Up to two joysticks or four paddles.
- Adjustable speed.
- Fast disk mode to set max speed while using the disks.
- Single file executable with embedded ROMs and DOS 3.3
2020-06-06 12:10:27 +00:00
- Pause (thanks a2geek)
2020-06-07 16:23:39 +00:00
- ProDOS MLI calls tracing
2019-06-02 21:00:31 +00:00
## Running the emulator
2019-11-11 22:28:07 +00:00
No installation required. [Download](https://github.com/ivanizag/apple2/releases) the single file executable `apple2xxx_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:
2019-06-02 21:00:31 +00:00
```
casa@servidor:~$ ./apple2sdl
```
![DOS 3.3 started](doc/dos33.png)
### Play games
2019-12-22 13:32:54 +00:00
Download a DSK or WOZ file or use an URL ([Asimov](https://www.apple.asimov.net/images/) is an excellent source) with the `-disk` parameter:
2019-06-02 21:00:31 +00:00
```
casa@servidor:~$ ./apple2sdl -disk "https://www.apple.asimov.net/images/games/action/karateka/karateka (includes intro).dsk"
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
Download the excellent [Total Replay](https://archive.org/details/TotalReplay) compilation by
[a2-4am](https://github.com/a2-4am/4cade). Run it with the `-hd` parameter:
```
2020-01-21 22:42:44 +00:00
casa@servidor:~$ ./apple2sdl -hd "Total Replay v3.0.2mg"
2019-10-02 21:39:39 +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
2019-06-02 21:18:35 +00:00
To run text mode right on the terminal without the SDL2 dependency, use `apple2console`. It runs on the console using ANSI escape codes. Input is sent to the emulated Apple II one line at a time:
2019-06-02 21:00:31 +00:00
```
2019-12-26 22:11:32 +00:00
casa@servidor:~$ ./apple2console -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 #
# #
# ]_ #
# #
# #
############################################
Line:
```
### Keys
2019-11-20 23:13:53 +00:00
- Ctrl-F1: Reset button
2019-06-02 21:00:31 +00:00
- F5: Toggle speed between real and fastest
2019-11-20 23:13:53 +00:00
- Ctrl-F5: Show current speed in Mhz
2019-06-02 21:00:31 +00:00
- F6: Toggle between NTSC color TV and green phosphor monochrome monitor
- Ctrl-F6: Show a split screen with the views for NTSC color TV, monochrome monitor, HGR page 1 and HGR page 2.
- F7: Save current state to disk (incomplete)
- F8: Restore state from disk (incomplete)
- F10: Cycle character generator codepages. Only if the character generator ROM has more than one 2Kb page.
- F11: Toggle on and off the trace to console of the CPU execution
2019-06-02 21:00:31 +00:00
- F12: Save a screen snapshot to a file `snapshot.png`
2020-04-02 21:05:21 +00:00
- Pause: Pause the emulation
2019-06-02 21:00:31 +00:00
Only valid on SDL mode
### Command line options
```
-charRom string
2020-03-08 22:46:16 +00:00
rom file for the character generator (default "<default>")
2019-06-02 21:00:31 +00:00
-disk string
file to load on the first disk drive (default "<internal>/dos33.dsk")
2019-06-02 21:00:31 +00:00
-disk2Slot int
slot for the disk driver. -1 for none. (default 6)
2019-06-02 21:00:31 +00:00
-diskRom string
rom file for the disk drive controller (default "<internal>/DISK2.rom")
2020-04-12 23:31:04 +00:00
-diskb string
file to load on the second disk drive
2019-06-02 21:00:31 +00:00
-dumpChars
shows the character map
-fastChipSlot int
slot for the FASTChip accelerator card, -1 for none (default 3)
2019-06-02 21:00:31 +00:00
-fastDisk
set fast mode when the disks are spinning (default true)
2019-10-02 21:39:39 +00:00
-hd string
file to load on the hard disk
-hdSlot int
slot for the hard drive if present. -1 for none. (default -1)
2019-06-02 21:00:31 +00:00
-languageCardSlot int
slot for the 16kb language card. -1 for none
-memoryExpSlot int
slot for the Memory Expansion card with 1GB. -1 for none (default 4)
2019-06-02 21:00:31 +00:00
-mhz float
cpu speed in Mhz, use 0 for full speed. Use F5 to toggle. (default 1.0227142857142857)
2019-10-20 22:06:28 +00:00
-model string
2019-11-08 22:56:54 +00:00
set base model. Models available 2plus, 2e, 2enh, base64a (default "2enh")
2019-06-02 21:00:31 +00:00
-mono
emulate a green phosphor monitor instead of a NTSC color TV. Use F6 to toggle.
2019-11-01 17:48:39 +00:00
-panicSS
panic if a not implemented softswitch is used
2019-10-19 18:31:18 +00:00
-profile
generate profile trace to analyse with pprof
2019-06-02 21:00:31 +00:00
-rom string
2020-03-08 22:46:16 +00:00
main rom file (default "<default>")
2019-06-02 21:00:31 +00:00
-saturnCardSlot int
slot for the 256kb Saturn card. -1 for none (default -1)
-thunderClockCardSlot int
slot for the ThunderClock Plus card. -1 for none (default 5)
-traceCpu
2019-10-02 21:39:39 +00:00
dump to the console the CPU execution. Use F11 to toggle.
2019-11-01 17:48:39 +00:00
-traceHD
dump to the console the hd commands
2020-06-07 16:23:39 +00:00
-traceMLI
dump to the console the calls to ProDOS machine langunage interface calls to $BF00
-traceSS
dump to the console the sofswitches calls
2019-11-11 22:28:07 +00:00
-vidHDSlot int
2019-11-22 22:27:25 +00:00
slot for the VidHD card, only for //e models. -1 for none (default 2)
2019-12-22 13:32:54 +00:00
-woz string
show WOZ file information
2019-11-11 22:28:07 +00:00
2019-06-02 21:00:31 +00:00
```
## Building from source
### apple2console
2019-06-15 12:01:10 +00:00
The only dependency is having a working Go installation on any platform.
2019-06-02 21:00:31 +00:00
Run:
```
$ go get github.com/ivanizag/apple2/apple2console
$ go build github.com/ivanizag/apple2/apple2console
```
### apple2sdl
2019-06-15 12:01:10 +00:00
Besides having a working Go installation, install the SDL2 developer files. Valid for any platform
2019-06-02 21:00:31 +00:00
Run:
```
$ go get github.com/ivanizag/apple2/apple2sdl
$ go build github.com/ivanizag/apple2/apple2sdl
2019-06-15 12:01:10 +00:00
```
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:
2019-06-15 12:01:10 +00:00
```
2019-12-26 22:11:32 +00:00
$ cd docker
$ ./build.sh
2019-06-15 12:01:10 +00:00
```
2019-12-26 22:11:32 +00:00
To run in Windows, copy the file `SDL2.dll` on the same folder as `apple2sdl.exe`. The latest `SDL2.dll` can be found in the [Runtime binary for Windows 64-bit](https://www.libsdl.org/download-2.0.php).