Apple 2 Emulator in Go
Go to file
Will Angenent 5899396fb6 Added scale to the command line 2019-11-25 23:47:11 +00:00
audio Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
cmd Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
cpu Added flag to disable DOS delay code 2019-11-10 12:32:16 +00:00
disk Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
keyboard Made golint happy 2018-05-28 18:12:08 +01:00
mmu Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
system Made golint happy 2018-05-28 18:12:08 +01:00
utils Added flag to disable DOS delay code 2019-11-10 12:32:16 +00:00
video Added colored hires mode and monochrome keyboard toggle 2019-11-25 21:15:14 +00:00
.gitignore Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
LICENSE Added license 2018-05-27 16:12:10 +01:00
README.md Added colored hires mode and monochrome keyboard toggle 2019-11-25 21:15:14 +00:00
apple2.go Added scale to the command line 2019-11-25 23:47:11 +00:00
bank_switch_test.go Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
bell_test.go Added flag to disable DOS delay code 2019-11-10 12:32:16 +00:00
dos33_boot_test.go Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
dos33_rwts_write_test.go Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
go.mod Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
go.sum Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
io_test.go Migrated to GO11 modules 2019-11-02 15:50:17 +00:00
prodos_boot_test.go Migrated to GO11 modules 2019-11-02 15:50:17 +00:00

README.md

Apple // emulator in go

An Apple //e emulator written in Go using ebiten.

Features

  • MOS 6502 CPU
  • Keyboard
  • 40 column text mode
  • Low resolution monochrome and color graphics
  • High resolution monochrome and color graphics
  • Upper memory bank switching: $d000 page and ROM/RAM
  • Main memory page1/page2 switching in text, lores and hires
  • Disk image reading & writing
  • Speaker audio

Installation

The installation requires go modules go be installed

Build the executable

go build

Download apple2e.rom from a2go.applearchives.com and put it in the root directory.

Running it

./apple2-go
./apple2-go my_disk_image.dsk
./apple2-go -drive-head-click my_disk_image.dsk

Keyboard shortcuts

  • ctrl-alt-R reset
  • ctrl-alt-M toggle monochrome/color display
  • ctrl-alt-C caps lock
  • ctrl-alt-F show FPS

Running the tests

Setup

The tests use DOS and Prodos disk images. Download them from

Running the tests

go test -v

The CPU tests make use of Klaus2m5's excellent 6502 functional tests.

Creating the CPU test ROMs

The source files are 6502_functional_test.a65 and 6502_interrupt_test.a65. They are assembled using as65 into a binary file which contains a memory image of the test code. They are compressed into gzip files which are loaded into the apple memory by the unit tests.

Download as65 and unzip it to get the as65 assembler binary.

Assemble the tests

cd cpu
as65 -l -m -w -h0 6502_functional_test.a65
gzip 6502_functional_test.bin

as65 -l -m -w -h0 6502_interrupt_test.a65
gzip 6502_interrupt_test.bin

Known working disk images

  • DOS 3.3
  • Prodos 1.9
  • Lemonade stand
  • Montezuma's Revenge

Remaining work

  • 80 column card
  • 48k aux memory
  • double hires
  • joystick

Coding standards

Use gofmt to ensure standard go style consistency

 go fmt $(go list ./... | grep -v /vendor/)

Use golint to ensure Google's style consistency

golint $(go list ./...)