├── TODO ├── .github └── readme.png ├── res ├── roms │ ├── R&D │ │ ├── F02V10.bin │ │ ├── CFFA1V1.0.bin │ │ ├── FC02V12D4.bin │ │ ├── CFFA20EE02.bin │ │ └── CFFA20EEC02.bin │ ├── Apple │ │ ├── 341-0009.bin │ │ ├── 341-0027.bin │ │ ├── 341-0031.bin │ │ ├── 341-0036.bin │ │ ├── 341-0001-00.bin │ │ ├── 341-0002-00.bin │ │ ├── 341-0003-00.bin │ │ ├── 341-0004-00.bin │ │ ├── 341-0011-D0.bin │ │ ├── 341-0012-D8.bin │ │ ├── 341-0013-E0.bin │ │ ├── 341-0014-E8.bin │ │ ├── 341-0015-F0.bin │ │ ├── 341-0016-00.bin │ │ ├── 341-0020-F8.bin │ │ ├── 341-0026-00.bin │ │ ├── 341-0039-00.bin │ │ ├── 341-0047-00.bin │ │ ├── 342-0133-A.bin │ │ ├── 342-0134-A.bin │ │ ├── 342-0135-A.bin │ │ ├── 342-0265-A.bin │ │ ├── 342-0303-A.bin │ │ ├── 342-0304-A.bin │ │ ├── Apple-1 ACI ROM.bin │ │ ├── Apple-1 BASIC ROM.bin │ │ ├── Pigfont Video ROM.bin │ │ ├── Apple-1 Monitor ROM.bin │ │ └── Apple II j-plus Video ROM.bin │ ├── Achatz │ │ ├── A-ONE ROM.bin │ │ └── A-ONE Video ROM.bin │ ├── AE │ │ ├── ramfactor_rom_10.bin │ │ ├── ramfactor_rom_11.bin │ │ ├── ramfactor_rom_13.bin │ │ └── ramfactor_rom_14.bin │ ├── Briel │ │ ├── Replica-1 6502 ROM.bin │ │ ├── Replica-1 65C02 ROM.bin │ │ └── applesoft-lite-0.4.bin │ ├── Videx │ │ ├── Videx UltraTerm ROM.bin │ │ ├── Videx Videoterm ROM 2.4.bin │ │ ├── Videx Lower Case Chip ROM.bin │ │ ├── Videx Videoterm Character ROM APL.bin │ │ ├── Videx Videoterm Character ROM Epson.bin │ │ ├── Videx Videoterm Character ROM French.bin │ │ ├── Videx Videoterm Character ROM German.bin │ │ ├── Videx Videoterm Character ROM Inverse.bin │ │ ├── Videx Videoterm Character ROM Normal.bin │ │ ├── Videx Videoterm Character ROM Spanish.bin │ │ ├── Videx Videoterm Character ROM Symbol.bin │ │ ├── Videx Videoterm Character ROM Katakana.bin │ │ ├── Videx Videoterm Character ROM Normal Uppercase.bin │ │ └── Videx Videoterm Character ROM Super and Subscript.bin │ └── Signetics │ │ └── Signetics 2513 Video ROM.bin ├── images │ ├── Achatz │ │ └── A-ONE.png │ ├── Apple │ │ ├── Apple-1.png │ │ ├── Apple II.png │ │ ├── Apple III.png │ │ ├── Apple IIe.png │ │ ├── Apple Disk II.png │ │ ├── Apple Disk III.png │ │ ├── Apple Silentype.png │ │ ├── Apple Monitor II.png │ │ ├── Apple Monitor III.png │ │ ├── Apple Monitor IIc.png │ │ ├── Apple Disk II In Use.png │ │ ├── Apple Language Card.png │ │ ├── Apple Disk III In Use.png │ │ ├── Apple Graphics Tablet.png │ │ ├── Apple Hand Controllers.png │ │ ├── Apple Graphics Tablet View.png │ │ ├── Apple Disk II Interface Card.png │ │ ├── Apple-1 Cassette Interface Card.png │ │ ├── AppleColor Composite Monitor IIe.png │ │ ├── Apple Synch Printer Interface Card.png │ │ └── Apple Graphics Tablet Interface Card.png │ ├── R&D │ │ ├── R&D CFFA.png │ │ └── R&D CFFA1.png │ ├── Briel │ │ └── Replica-1.png │ ├── Connectors │ │ ├── DIP16.png │ │ ├── DIP28.png │ │ ├── DIP40.png │ │ ├── Edge44.png │ │ ├── Edge50.png │ │ ├── Edge60.png │ │ ├── DB25 Male.png │ │ ├── DE9 Female.png │ │ ├── DE9 Male.png │ │ ├── DIN45322.png │ │ ├── Header1x6.png │ │ ├── Header2x10.png │ │ ├── RCA Female.png │ │ ├── DA15 Female.png │ │ ├── DB19 Female.png │ │ ├── DB25 Female.png │ │ └── Rectangular2x13 Male.png │ ├── Generic │ │ ├── Terminal.png │ │ ├── LCD Monitor.png │ │ ├── Monochrome Monitor.png │ │ └── Composite Color Monitor.png │ ├── Host │ │ ├── Bezel Pause.png │ │ ├── Bezel Power.png │ │ ├── Bezel Capture.png │ │ ├── Shadow Mask LCD.png │ │ ├── Shadow Mask Bayer.png │ │ ├── Shadow Mask Inline.png │ │ ├── Shadow Mask Triad.png │ │ └── Shadow Mask Aperture.png │ ├── AE │ │ └── AE RamFactor Rev A.jpg │ ├── Videx │ │ ├── Videx UltraTerm.png │ │ └── Videx Videoterm.png │ ├── Don't Ask │ │ └── S.A.M. Front.png │ └── Titan │ │ └── Titan III plus II.png ├── sounds │ ├── Alps │ │ ├── Alps 2124A Drive.ogg │ │ ├── Alps 2124A Head.ogg │ │ └── Alps 2124A Stop.ogg │ └── Shugart │ │ ├── Shugart SA400 Head.ogg │ │ ├── Shugart SA400 Open.ogg │ │ ├── Shugart SA400 Stop.ogg │ │ ├── Shugart SA400 Align.ogg │ │ ├── Shugart SA400 Close.ogg │ │ └── Shugart SA400 Drive.ogg └── library │ └── Apple II │ ├── Apple Silentype.xml │ ├── Apple Graphics Tablet.xml │ └── Don't Ask S.A.M..xml ├── doc ├── Formats │ ├── D64 Format.txt │ ├── D71 Format.txt │ ├── D81 Format.txt │ ├── G64 Format.txt │ ├── X64 Format.txt │ ├── D80-D82 Format.txt │ ├── FDI Format Specification 2.0.pdf │ ├── VMDK Virtual Machine Disk Format 5.0.pdf │ └── V2D Format.txt └── OpenEmulator Icons.rtf ├── src ├── libutil.cmake ├── libemulation │ ├── Implementation │ │ ├── WDC │ │ │ ├── W65C816S.h │ │ │ ├── W65C816S.cpp │ │ │ └── W65C02S.h │ │ ├── Zilog │ │ │ ├── Z80.cpp │ │ │ └── Z80.h │ │ ├── Apple │ │ │ ├── AppleIISystemControl.cpp │ │ │ ├── AppleIISystemControl.h │ │ │ ├── AppleIIAudioIn.h │ │ │ ├── AppleIIFloatingBus.h │ │ │ ├── Apple1ACI.h │ │ │ ├── AppleIIEAddressDecoder.h │ │ │ ├── AppleIIDisableC800.h │ │ │ ├── AppleIIIGamePort.h │ │ │ ├── AppleGraphicsTablet.h │ │ │ ├── AppleIIAddressDecoder.h │ │ │ ├── AppleIIIKeyboard.h │ │ │ ├── AppleIIIRTC.h │ │ │ ├── AppleIIAudioOut.h │ │ │ ├── AppleIIIMOS6502.h │ │ │ ├── AppleIIFloatingBus.cpp │ │ │ ├── AppleIIIBeeper.h │ │ │ ├── AppleIIAudioIn.cpp │ │ │ ├── AppleSilentypeInterfaceCard.h │ │ │ ├── Apple1IO.h │ │ │ ├── Apple1ACI.cpp │ │ │ ├── AppleIIIMOS6502Opcodes.h │ │ │ ├── AppleGraphicsTabletInterfaceCard.h │ │ │ ├── AppleIISlotController.h │ │ │ ├── AppleIIIDiskIO.h │ │ │ ├── AppleSilentype.h │ │ │ ├── AppleIIDisableC800.cpp │ │ │ ├── AppleLanguageCard.h │ │ │ ├── AppleIIGamePort.h │ │ │ ├── AppleIIAddressDecoder.cpp │ │ │ ├── AppleIIIRTC.cpp │ │ │ ├── AppleIIEKeyboard.h │ │ │ ├── AppleIIEMMU.h │ │ │ ├── AppleIIIAddressDecoder.h │ │ │ ├── AppleIIISystemControl.h │ │ │ ├── Apple1Terminal.h │ │ │ ├── AppleDiskIIInterfaceCard.h │ │ │ ├── AppleIIIBeeper.cpp │ │ │ ├── AppleIIKeyboard.h │ │ │ ├── AppleIIEAddressDecoder.cpp │ │ │ └── AppleDiskDrive525.h │ │ ├── Generic │ │ │ ├── FloatingBus.h │ │ │ ├── ROM.h │ │ │ ├── VRAM.h │ │ │ ├── Proxy.h │ │ │ ├── AddressMasker.h │ │ │ ├── ATADevice.h │ │ │ ├── FloatingBus.cpp │ │ │ ├── AddressMapper.h │ │ │ ├── Audio1Bit.h │ │ │ ├── Monitor.h │ │ │ ├── AddressOffset.h │ │ │ ├── ROM.cpp │ │ │ ├── AddressMux.h │ │ │ ├── AudioPlayer.h │ │ │ ├── ATAController.h │ │ │ ├── Proxy.cpp │ │ │ ├── RAM.h │ │ │ ├── AudioCodec.h │ │ │ ├── AddressMasker.cpp │ │ │ └── AddressDecoder.h │ │ ├── MOS │ │ │ ├── MOSKIM1PLL.h │ │ │ ├── MOSKIM1IO.h │ │ │ ├── MOS6530.h │ │ │ ├── MOS6509.h │ │ │ ├── MOSKIM1PLL.cpp │ │ │ ├── MOS6551.h │ │ │ ├── MOS6502.h │ │ │ ├── MOS6522.h │ │ │ └── MOSKIM1IO.cpp │ │ ├── RD │ │ │ └── RDCFFA.h │ │ ├── Ricoh │ │ │ ├── RP2A03.h │ │ │ └── RP2A03Operations.h │ │ ├── National │ │ │ └── MM58167.h │ │ ├── Don't Ask │ │ │ ├── SAMDACCard.h │ │ │ └── SAMDACCard.cpp │ │ ├── AE │ │ │ └── AERamFactor.h │ │ └── Videx │ │ │ └── VidexVideoterm.h │ ├── Interface │ │ ├── Host │ │ │ ├── AudioInterface.cpp │ │ │ ├── MIDIInterface.h │ │ │ ├── USBInterface.h │ │ │ ├── EthernetInterface.h │ │ │ ├── VideoCaptureInterface.h │ │ │ ├── AudioInterface.h │ │ │ ├── DeviceInterface.h │ │ │ ├── StorageInterface.h │ │ │ ├── JoystickInterface.h │ │ │ └── EmulationInterface.h │ │ ├── IEEE │ │ │ ├── IEEE488Interface.h │ │ │ ├── IEEE1394Interface.h │ │ │ └── IEEE1284Interface.h │ │ ├── Generic │ │ │ ├── AudioPlayerInterface.h │ │ │ ├── CPUInterface.h │ │ │ ├── PIAInterface.h │ │ │ ├── MemoryInterface.h │ │ │ └── ControlBusInterface.h │ │ └── EIA │ │ │ └── RS232Interface.h │ ├── Core │ │ ├── OEComponentFactory.h │ │ ├── OESound.h │ │ ├── OEPackage.h │ │ ├── OEDevice.h │ │ └── OEComponent.h │ ├── ddl-1.0.dtd │ └── edl-1.0.dtd ├── libdiskimage │ ├── DIApple35DiskStorage.cpp │ ├── DIApple35DiskStorage.h │ ├── diskimage.h │ ├── DIBackingStore.h │ ├── DIBackingStore.cpp │ ├── DIV2DDiskStorage.h │ ├── DIRAMBackingStore.h │ ├── DIBlockStorage.h │ ├── DIRAWBlockStorage.h │ ├── DIDiskStorage.cpp │ ├── DIFileBackingStore.h │ ├── DIBlockStorage.cpp │ ├── DIWozDiskStorage.h │ ├── DI2IMGBackingStore.h │ ├── DIDDLDiskStorage.h │ ├── DIDC42BackingStore.h │ ├── DIDiskStorage.h │ ├── DILogicalDiskStorage.h │ ├── DICommon.h │ ├── DIVDIBlockStorage.h │ ├── DIRAMBackingStore.cpp │ ├── DIRAWBlockStorage.cpp │ ├── DIVMDKBlockStorage.h │ └── DIATABlockStorage.h ├── libemulation-hal.cmake ├── libemulation-hal │ ├── HIDJoystick.h │ ├── OEMatrix3.h │ ├── OEVector.h │ └── OEMatrix3.cpp ├── libdiskimage.cmake └── libutil │ └── util.h ├── .travis.yml ├── AUTHORS ├── INSTALL.md ├── cmake ├── FindLibSampleRate.cmake └── FindLibZip.cmake ├── .gitignore ├── README.md └── CMakeLists.txt /TODO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/TODO -------------------------------------------------------------------------------- /.github/readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/.github/readme.png -------------------------------------------------------------------------------- /res/roms/R&D/F02V10.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/R&D/F02V10.bin -------------------------------------------------------------------------------- /doc/Formats/D64 Format.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/D64 Format.txt -------------------------------------------------------------------------------- /doc/Formats/D71 Format.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/D71 Format.txt -------------------------------------------------------------------------------- /doc/Formats/D81 Format.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/D81 Format.txt -------------------------------------------------------------------------------- /doc/Formats/G64 Format.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/G64 Format.txt -------------------------------------------------------------------------------- /doc/Formats/X64 Format.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/X64 Format.txt -------------------------------------------------------------------------------- /res/roms/R&D/CFFA1V1.0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/R&D/CFFA1V1.0.bin -------------------------------------------------------------------------------- /res/roms/R&D/FC02V12D4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/R&D/FC02V12D4.bin -------------------------------------------------------------------------------- /res/images/Achatz/A-ONE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Achatz/A-ONE.png -------------------------------------------------------------------------------- /res/images/Apple/Apple-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple-1.png -------------------------------------------------------------------------------- /res/images/R&D/R&D CFFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/R&D/R&D CFFA.png -------------------------------------------------------------------------------- /res/images/R&D/R&D CFFA1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/R&D/R&D CFFA1.png -------------------------------------------------------------------------------- /res/roms/Apple/341-0009.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0009.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0027.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0027.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0031.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0031.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0036.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0036.bin -------------------------------------------------------------------------------- /res/roms/R&D/CFFA20EE02.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/R&D/CFFA20EE02.bin -------------------------------------------------------------------------------- /res/roms/R&D/CFFA20EEC02.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/R&D/CFFA20EEC02.bin -------------------------------------------------------------------------------- /doc/Formats/D80-D82 Format.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/D80-D82 Format.txt -------------------------------------------------------------------------------- /res/images/Apple/Apple II.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple II.png -------------------------------------------------------------------------------- /res/images/Apple/Apple III.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple III.png -------------------------------------------------------------------------------- /res/images/Apple/Apple IIe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple IIe.png -------------------------------------------------------------------------------- /res/images/Briel/Replica-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Briel/Replica-1.png -------------------------------------------------------------------------------- /res/images/Connectors/DIP16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DIP16.png -------------------------------------------------------------------------------- /res/images/Connectors/DIP28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DIP28.png -------------------------------------------------------------------------------- /res/images/Connectors/DIP40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DIP40.png -------------------------------------------------------------------------------- /res/images/Generic/Terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Generic/Terminal.png -------------------------------------------------------------------------------- /res/images/Host/Bezel Pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Bezel Pause.png -------------------------------------------------------------------------------- /res/images/Host/Bezel Power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Bezel Power.png -------------------------------------------------------------------------------- /res/roms/Achatz/A-ONE ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Achatz/A-ONE ROM.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0001-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0001-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0002-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0002-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0003-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0003-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0004-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0004-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0011-D0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0011-D0.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0012-D8.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0012-D8.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0013-E0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0013-E0.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0014-E8.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0014-E8.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0015-F0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0015-F0.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0016-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0016-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0020-F8.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0020-F8.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0026-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0026-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0039-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0039-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/341-0047-00.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/341-0047-00.bin -------------------------------------------------------------------------------- /res/roms/Apple/342-0133-A.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/342-0133-A.bin -------------------------------------------------------------------------------- /res/roms/Apple/342-0134-A.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/342-0134-A.bin -------------------------------------------------------------------------------- /res/roms/Apple/342-0135-A.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/342-0135-A.bin -------------------------------------------------------------------------------- /res/roms/Apple/342-0265-A.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/342-0265-A.bin -------------------------------------------------------------------------------- /res/roms/Apple/342-0303-A.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/342-0303-A.bin -------------------------------------------------------------------------------- /res/roms/Apple/342-0304-A.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/342-0304-A.bin -------------------------------------------------------------------------------- /res/images/Connectors/Edge44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/Edge44.png -------------------------------------------------------------------------------- /res/images/Connectors/Edge50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/Edge50.png -------------------------------------------------------------------------------- /res/images/Connectors/Edge60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/Edge60.png -------------------------------------------------------------------------------- /res/images/Host/Bezel Capture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Bezel Capture.png -------------------------------------------------------------------------------- /res/roms/AE/ramfactor_rom_10.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/AE/ramfactor_rom_10.bin -------------------------------------------------------------------------------- /res/roms/AE/ramfactor_rom_11.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/AE/ramfactor_rom_11.bin -------------------------------------------------------------------------------- /res/roms/AE/ramfactor_rom_13.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/AE/ramfactor_rom_13.bin -------------------------------------------------------------------------------- /res/roms/AE/ramfactor_rom_14.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/AE/ramfactor_rom_14.bin -------------------------------------------------------------------------------- /res/images/AE/AE RamFactor Rev A.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/AE/AE RamFactor Rev A.jpg -------------------------------------------------------------------------------- /res/images/Apple/Apple Disk II.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Disk II.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Disk III.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Disk III.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Silentype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Silentype.png -------------------------------------------------------------------------------- /res/images/Connectors/DB25 Male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DB25 Male.png -------------------------------------------------------------------------------- /res/images/Connectors/DE9 Female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DE9 Female.png -------------------------------------------------------------------------------- /res/images/Connectors/DE9 Male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DE9 Male.png -------------------------------------------------------------------------------- /res/images/Connectors/DIN45322.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DIN45322.png -------------------------------------------------------------------------------- /res/images/Connectors/Header1x6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/Header1x6.png -------------------------------------------------------------------------------- /res/images/Connectors/Header2x10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/Header2x10.png -------------------------------------------------------------------------------- /res/images/Connectors/RCA Female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/RCA Female.png -------------------------------------------------------------------------------- /res/images/Generic/LCD Monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Generic/LCD Monitor.png -------------------------------------------------------------------------------- /res/images/Host/Shadow Mask LCD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Shadow Mask LCD.png -------------------------------------------------------------------------------- /res/images/Videx/Videx UltraTerm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Videx/Videx UltraTerm.png -------------------------------------------------------------------------------- /res/images/Videx/Videx Videoterm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Videx/Videx Videoterm.png -------------------------------------------------------------------------------- /res/roms/Apple/Apple-1 ACI ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/Apple-1 ACI ROM.bin -------------------------------------------------------------------------------- /res/roms/Apple/Apple-1 BASIC ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/Apple-1 BASIC ROM.bin -------------------------------------------------------------------------------- /res/roms/Apple/Pigfont Video ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/Pigfont Video ROM.bin -------------------------------------------------------------------------------- /res/sounds/Alps/Alps 2124A Drive.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Alps/Alps 2124A Drive.ogg -------------------------------------------------------------------------------- /res/sounds/Alps/Alps 2124A Head.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Alps/Alps 2124A Head.ogg -------------------------------------------------------------------------------- /res/sounds/Alps/Alps 2124A Stop.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Alps/Alps 2124A Stop.ogg -------------------------------------------------------------------------------- /res/images/Apple/Apple Monitor II.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Monitor II.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Monitor III.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Monitor III.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Monitor IIc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Monitor IIc.png -------------------------------------------------------------------------------- /res/images/Connectors/DA15 Female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DA15 Female.png -------------------------------------------------------------------------------- /res/images/Connectors/DB19 Female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DB19 Female.png -------------------------------------------------------------------------------- /res/images/Connectors/DB25 Female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/DB25 Female.png -------------------------------------------------------------------------------- /res/images/Don't Ask/S.A.M. Front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Don't Ask/S.A.M. Front.png -------------------------------------------------------------------------------- /res/images/Host/Shadow Mask Bayer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Shadow Mask Bayer.png -------------------------------------------------------------------------------- /res/images/Host/Shadow Mask Inline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Shadow Mask Inline.png -------------------------------------------------------------------------------- /res/images/Host/Shadow Mask Triad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Shadow Mask Triad.png -------------------------------------------------------------------------------- /res/images/Titan/Titan III plus II.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Titan/Titan III plus II.png -------------------------------------------------------------------------------- /res/roms/Apple/Apple-1 Monitor ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/Apple-1 Monitor ROM.bin -------------------------------------------------------------------------------- /res/roms/Briel/Replica-1 6502 ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Briel/Replica-1 6502 ROM.bin -------------------------------------------------------------------------------- /res/roms/Briel/Replica-1 65C02 ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Briel/Replica-1 65C02 ROM.bin -------------------------------------------------------------------------------- /res/roms/Briel/applesoft-lite-0.4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Briel/applesoft-lite-0.4.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx UltraTerm ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx UltraTerm ROM.bin -------------------------------------------------------------------------------- /res/images/Apple/Apple Disk II In Use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Disk II In Use.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Language Card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Language Card.png -------------------------------------------------------------------------------- /res/images/Generic/Monochrome Monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Generic/Monochrome Monitor.png -------------------------------------------------------------------------------- /res/images/Host/Shadow Mask Aperture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Host/Shadow Mask Aperture.png -------------------------------------------------------------------------------- /res/sounds/Shugart/Shugart SA400 Head.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Shugart/Shugart SA400 Head.ogg -------------------------------------------------------------------------------- /res/sounds/Shugart/Shugart SA400 Open.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Shugart/Shugart SA400 Open.ogg -------------------------------------------------------------------------------- /res/sounds/Shugart/Shugart SA400 Stop.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Shugart/Shugart SA400 Stop.ogg -------------------------------------------------------------------------------- /res/images/Apple/Apple Disk III In Use.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Disk III In Use.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Graphics Tablet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Graphics Tablet.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Hand Controllers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Hand Controllers.png -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm ROM 2.4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm ROM 2.4.bin -------------------------------------------------------------------------------- /res/sounds/Shugart/Shugart SA400 Align.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Shugart/Shugart SA400 Align.ogg -------------------------------------------------------------------------------- /res/sounds/Shugart/Shugart SA400 Close.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Shugart/Shugart SA400 Close.ogg -------------------------------------------------------------------------------- /res/sounds/Shugart/Shugart SA400 Drive.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/sounds/Shugart/Shugart SA400 Drive.ogg -------------------------------------------------------------------------------- /doc/Formats/FDI Format Specification 2.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/FDI Format Specification 2.0.pdf -------------------------------------------------------------------------------- /res/images/Connectors/Rectangular2x13 Male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Connectors/Rectangular2x13 Male.png -------------------------------------------------------------------------------- /res/images/Generic/Composite Color Monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Generic/Composite Color Monitor.png -------------------------------------------------------------------------------- /res/roms/Apple/Apple II j-plus Video ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Apple/Apple II j-plus Video ROM.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Lower Case Chip ROM.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Lower Case Chip ROM.bin -------------------------------------------------------------------------------- /res/images/Apple/Apple Graphics Tablet View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Graphics Tablet View.png -------------------------------------------------------------------------------- /res/images/Apple/Apple Disk II Interface Card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Disk II Interface Card.png -------------------------------------------------------------------------------- /doc/Formats/VMDK Virtual Machine Disk Format 5.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/doc/Formats/VMDK Virtual Machine Disk Format 5.0.pdf -------------------------------------------------------------------------------- /res/images/Apple/Apple-1 Cassette Interface Card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple-1 Cassette Interface Card.png -------------------------------------------------------------------------------- /res/images/Apple/AppleColor Composite Monitor IIe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/AppleColor Composite Monitor IIe.png -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM APL.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM APL.bin -------------------------------------------------------------------------------- /res/images/Apple/Apple Synch Printer Interface Card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Synch Printer Interface Card.png -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Epson.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Epson.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM French.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM French.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM German.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM German.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Inverse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Inverse.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Normal.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Normal.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Spanish.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Spanish.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Symbol.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Symbol.bin -------------------------------------------------------------------------------- /res/images/Apple/Apple Graphics Tablet Interface Card.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/images/Apple/Apple Graphics Tablet Interface Card.png -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Katakana.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Katakana.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Normal Uppercase.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Normal Uppercase.bin -------------------------------------------------------------------------------- /res/roms/Videx/Videx Videoterm Character ROM Super and Subscript.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openemulator/libemulation/HEAD/res/roms/Videx/Videx Videoterm Character ROM Super and Subscript.bin -------------------------------------------------------------------------------- /src/libutil.cmake: -------------------------------------------------------------------------------- 1 | # libutil - emulation utilities 2 | 3 | # Sources 4 | set(libutil ${source_directory}/libutil/util.cpp) 5 | 6 | # Headers 7 | set(libutil_include ${source_directory}/libutil) 8 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/WDC/W65C816S.h: -------------------------------------------------------------------------------- 1 | /* 2 | * W65C816S.h 3 | * OpenEmulator 4 | * 5 | * Created by Marc S. Reßl on 25/02/10. 6 | * Copyright 2010 ITBA. All rights reserved. 7 | * 8 | */ 9 | 10 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/WDC/W65C816S.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * W65C816S.cpp 3 | * OpenEmulator 4 | * 5 | * Created by Marc S. Reßl on 25/02/10. 6 | * Copyright 2010 ITBA. All rights reserved. 7 | * 8 | */ 9 | 10 | #include "W65C816S.h" 11 | 12 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Zilog/Z80.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Z80 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates a Z80 microprocessor. 9 | */ 10 | 11 | #include "Z80.h" 12 | -------------------------------------------------------------------------------- /src/libdiskimage/DIApple35DiskStorage.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Apple 3.5" Disk Image 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses an Apple 3.5" disk image 9 | */ 10 | 11 | #include "DIApple35DiskStorage.h" 12 | 13 | -------------------------------------------------------------------------------- /src/libdiskimage/DIApple35DiskStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Apple 3.5" Disk Image 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses an Apple 3.5" disk image 9 | */ 10 | 11 | #include "DICommon.h" 12 | 13 | class DIApple35 14 | { 15 | public: 16 | DIApple35(); 17 | }; 18 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIISystemControl.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II System Control 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls Apple II soft switches (IIe and IIc) 9 | */ 10 | 11 | #include "AppleIISystemControl.h" 12 | 13 | AppleIISystemControl::AppleIISystemControl() 14 | { 15 | } 16 | -------------------------------------------------------------------------------- /src/libdiskimage/diskimage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Disk Image library 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulation disk image library 9 | */ 10 | 11 | #ifndef _DISKIMAGE_H 12 | #define _DISKIMAGE_H 13 | 14 | #include "DIATABlockStorage.h" 15 | 16 | #include "DIApple525DiskStorage.h" 17 | #include "DIApple35DiskStorage.h" 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIISystemControl.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II System Control 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls Apple II soft switches (IIe and IIc) 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class AppleIISystemControl : public OEComponent 14 | { 15 | public: 16 | AppleIISystemControl(); 17 | }; 18 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/WDC/W65C02S.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * W65C02S 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates a W65C02S microprocessor 9 | */ 10 | 11 | #ifndef _W65C02S_H 12 | #define _W65C02S_H 13 | 14 | #include "MOS6502.h" 15 | 16 | class W65C02S : public MOS6502 17 | { 18 | private: 19 | void execute(); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/AudioInterface.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Audio interface 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the audio interface 9 | */ 10 | 11 | #include 12 | 13 | float getLevelFromVolume(float value) 14 | { 15 | if (value != 0) 16 | return powf(10, (value - 1) * 40 / 20); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/MIDIInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MIDI interface 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the MIDI interface 9 | */ 10 | 11 | #ifndef _MIDIINTERFACE_H 12 | #define _MIDIINTERFACE_H 13 | 14 | typedef enum 15 | { 16 | MIDI_SEND, 17 | } MIDIMessage; 18 | 19 | typedef enum 20 | { 21 | MIDI_DATA_WAS_RECEIVED, 22 | } MIDINotification; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/libemulation-hal.cmake: -------------------------------------------------------------------------------- 1 | # libemulation-hal - hardware abstraction layer 2 | 3 | set(_libemulation_hal_dir ${source_directory}/libemulation-hal) 4 | 5 | # Sources 6 | set(emulation_hal 7 | ${_libemulation_hal_dir}/HIDJoystick.cpp 8 | ${_libemulation_hal_dir}/OEMatrix3.cpp 9 | ${_libemulation_hal_dir}/OEVector.cpp 10 | ${_libemulation_hal_dir}/OpenGLCanvas.cpp 11 | ${_libemulation_hal_dir}/PAAudio.cpp 12 | ) 13 | 14 | set(emulation_hal_include ${_libemulation_hal_dir}) -------------------------------------------------------------------------------- /src/libemulation/Core/OEComponentFactory.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Component Factory 5 | * (C) 2009-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Builds components 9 | */ 10 | 11 | #ifndef _OECOMPONENTFACTORY_H 12 | #define _OECOMPONENTFACTORY_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class OEComponentFactory 17 | { 18 | public: 19 | static OEComponent *construct(const string& className); 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/libemulation/Interface/IEEE/IEEE488Interface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * IEEE 488 (GPIB) Interface 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the IEEE 488 (GPIB) interface 9 | */ 10 | 11 | #ifndef _IEEE488INTERFACE 12 | #define _IEEE488INTERFACE 13 | 14 | // To-Do: Define interface 15 | 16 | typedef enum 17 | { 18 | } IEEE488Message; 19 | 20 | typedef enum 21 | { 22 | } IEEE488Notification; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/USBInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * USB interface 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the USB interface 9 | */ 10 | 11 | #ifndef _USBINTERFACE_H 12 | #define _USBINTERFACE_H 13 | 14 | typedef enum 15 | { 16 | USB_GET_DEVICELIST, 17 | USB_OPEN_DEVICE, 18 | USB_CLOSE_DEVICE, 19 | USB_SUBMIT_TRANSFER, 20 | USB_CANCEL_TRANSFER, 21 | } USBMessage; 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/EthernetInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Ethernet interface 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the Ethernet interface 9 | */ 10 | 11 | #ifndef _ETHERNETINTERFACE_H 12 | #define _ETHERNETINTERFACE_H 13 | 14 | typedef enum 15 | { 16 | ETHERNET_SEND, 17 | } EthernetMessage; 18 | 19 | typedef enum 20 | { 21 | ETHERNET_DATA_WAS_RECEIVED, 22 | } EthernetNotification; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/VideoCaptureInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Video capture interface 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the video capture interface 9 | */ 10 | 11 | // Notes: 12 | // * getFrame returns an OEImage. 13 | 14 | #ifndef _VIDEOCAPTUREINTERFACE_H 15 | #define _VIDEOCAPTUREINTERFACE_H 16 | 17 | typedef enum 18 | { 19 | VIDEOCAPTURE_GET_FRAME, 20 | } VideoMessage; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/libemulation/Interface/IEEE/IEEE1394Interface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * IEEE 1394 (Firewire) Interface 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the IEEE 1394 (Firewire) interface 9 | */ 10 | 11 | #ifndef _IEEE1394INTERFACE 12 | #define _IEEE1394INTERFACE 13 | 14 | // To-Do: Define interface 15 | 16 | typedef enum 17 | { 18 | } IEEE1394Message; 19 | 20 | typedef enum 21 | { 22 | } IEEE1394Notification; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /res/roms/Signetics/Signetics 2513 Video ROM.bin: -------------------------------------------------------------------------------- 1 | "*., "">""<""<""<" "<"""""<> < >> <  &"""">"""""$(0($" >"6**"""""2*&"""""""<""< """*$<""<($"" ">""""""""""""""**6"""""""> >>00000> >>">>>( 2 | <02&((*$ **>> "&*2""  >> " $>> <" <"">""""""8 >>" -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: trusty 2 | sudo: required 3 | language: cpp 4 | 5 | matrix: 6 | include: 7 | - os: osx 8 | compiler: clang 9 | env: Build, Test & Deploy 10 | osx_image: xcode10 11 | addons: 12 | homebrew: 13 | packages: 14 | - libzip 15 | - portaudio 16 | - libsndfile 17 | - libsamplerate 18 | update: true 19 | script: 20 | - | 21 | cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release 22 | cmake --build build --config Release 23 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIAudioIn.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Audio Input 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls Apple II audio input 9 | */ 10 | 11 | #include "Audio1Bit.h" 12 | 13 | class AppleIIAudioIn : public Audio1Bit 14 | { 15 | public: 16 | AppleIIAudioIn(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | OEChar read(OEAddress address); 22 | 23 | private: 24 | OEComponent *floatingBus; 25 | }; 26 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/FloatingBus.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Floating bus 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls a generic floating bus 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class FloatingBus : public OEComponent 14 | { 15 | public: 16 | FloatingBus(); 17 | 18 | bool setValue(string name, string value); 19 | 20 | OEChar read(OEAddress address); 21 | 22 | private: 23 | bool randomMode; 24 | 25 | OEChar busValue; 26 | }; 27 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOSKIM1PLL.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOSKIM-1 PLL 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements the MOSKIM-1 audio phase locked loop 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class MOSKIM1PLL : public OEComponent 14 | { 15 | public: 16 | MOSKIM1PLL(); 17 | 18 | bool setValue(string name, string value); 19 | bool setRef(string name, OEComponent *ref); 20 | 21 | private: 22 | OEComponent *audio; 23 | 24 | float decisionFrequency; 25 | }; 26 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIFloatingBus.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Floating Bus 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements the Apple II floating bus 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class AppleIIFloatingBus : public OEComponent 14 | { 15 | public: 16 | AppleIIFloatingBus(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | OEChar read(OEAddress address); 22 | 23 | private: 24 | OEComponent *video; 25 | }; 26 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | OpenEmulator 2 | http://www.openemulator.org/ 3 | 4 | Lead Developers 5 | 6 | Project Contributors 7 | Tobias Eriksson (cmake build scripts) 8 | David Finnigan (testing of default memory patterns on the Apple II) 9 | Vladimir Ivanoff (ideas on accurate CPU and video emulation) 10 | David Schmidt (extensive testing of Apple III) 11 | Dirk Thierbach (ideas for the component framework) 12 | Nick Westgate (ideas for the Disk II emulation) 13 | 14 | Previous Developers 15 | Marc S. Ressl (lead developer, libemulation, libemulation-hal, libdiskimage, Mac OS X GUI) -------------------------------------------------------------------------------- /doc/OpenEmulator Icons.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw11900\paperh16840\margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 6 | 7 | \f0\fs24 \cf0 OpenEmulator icons should be done as follows:\ 8 | \ 9 | * Draw your icon.\ 10 | * Resize to 120 max width or height, whichever is smaller.\ 11 | * Add a shadow, offset by 3px at a 90\'ba angle, 3px blur, at 20% opacity.\ 12 | * Resize canvas to 128x128.\ 13 | } -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/Apple1ACI.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple-1 ACI 5 | * (C) 2011-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an Apple-1 ACI (Apple Cassette Interface) 9 | */ 10 | 11 | #include "Audio1Bit.h" 12 | 13 | class Apple1ACI : public Audio1Bit 14 | { 15 | public: 16 | Apple1ACI(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | OEChar read(OEAddress address); 22 | void write(OEAddress address, OEChar value); 23 | 24 | private: 25 | OEComponent *rom; 26 | }; 27 | -------------------------------------------------------------------------------- /doc/Formats/V2D Format.txt: -------------------------------------------------------------------------------- 1 | ==V2D Format Specification== 2 | 3 | The V2D disk image format stores nibble streams in a manner similar to the NIB format, but with these improvements: 4 | 5 | * Supports quarter tracks 6 | * Allows for a variable number of nibbles per track 7 | * Stores only used tracks 8 | 9 | 16 and 32 bit integers are stored in big-endian byte order: 10 | 11 | struct v2dHeader { 12 | unsigned int containerByteNum; // filesize - 8 13 | char id[4]; // "D5NI" 14 | unsigned short trackNum; 15 | } 16 | 17 | For every track: 18 | 19 | struct v2dTrack { 20 | unsigned short quarterTrackIndex; 21 | unsigned short trackByteNum; 22 | } 23 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/ROM.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * ROM 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls read only memory. 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | // Notes: 14 | // * image is the ROM image. 15 | 16 | class ROM : public OEComponent 17 | { 18 | public: 19 | bool setData(string name, OEData *data); 20 | bool getData(string name, OEData **data); 21 | bool init(); 22 | 23 | OEChar read(OEAddress address); 24 | 25 | private: 26 | OEData data; 27 | 28 | OEChar *datap; 29 | OEAddress mask; 30 | }; 31 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Generic/AudioPlayerInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * AudioPlayer Interface 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the audio player interface 9 | */ 10 | 11 | #ifndef _AUDIOPLAYERINTERFACE_H 12 | #define _AUDIOPLAYERINTERFACE_H 13 | 14 | #include "AudioPlayerInterface.h" 15 | 16 | typedef enum 17 | { 18 | AUDIOPLAYER_PLAY, 19 | AUDIOPLAYER_PAUSE, 20 | AUDIOPLAYER_STOP, 21 | AUDIOPLAYER_SET_SOUND, 22 | AUDIOPLAYER_SET_VOLUME, 23 | AUDIOPLAYER_SET_LOOP, 24 | AUDIOPLAYER_IS_PLAYING, 25 | } AudioPlayerMessage; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIEAddressDecoder.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple II Address Decoder 5 | * (C) 2017 by Zellyn Hunter (zellyn@gmail.com) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple II Address Decoder 9 | */ 10 | 11 | #include "AppleIIAddressDecoder.h" 12 | 13 | class AppleIIEAddressDecoder : public AppleIIAddressDecoder 14 | { 15 | public: 16 | AppleIIEAddressDecoder(); 17 | 18 | bool postMessage(OEComponent *sender, int message, void *data); 19 | 20 | private: 21 | MemoryMaps cxxxMemoryMaps; 22 | 23 | void updateReadWriteMap(OEAddress startAddress, OEAddress endAddress); 24 | }; 25 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/RD/RDCFFA.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * R&D CFFA ATA Interface 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an R&D CFFA ATA Interface 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class RDCFFA : public OEComponent 14 | { 15 | public: 16 | RDCFFA(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | private: 22 | OEComponent *ataController; 23 | 24 | bool csMask; 25 | OEShort ataData; 26 | 27 | OEChar read(OEAddress address); 28 | void write(OEAddress address, OEChar value); 29 | }; 30 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Generic/CPUInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * CPU Interface 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the CPU interface 9 | */ 10 | 11 | // Notes: 12 | // * setPendingCycles sets the number of cycles to be executed (OESLong) 13 | // * getPendingCycles returns the number of remaining cycles (OESLong) 14 | // * run executes a number of CPU cycles 15 | 16 | #ifndef _CPUINTERFACE_H 17 | #define _CPUINTERFACE_H 18 | 19 | typedef enum 20 | { 21 | CPU_SET_PENDINGCYCLES, 22 | CPU_GET_PENDINGCYCLES, 23 | CPU_RUN, 24 | CPU_END, 25 | } CPUMessage; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIDisableC800.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Disable C800 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Disables Apple II slot expansion memory ($C800-$CFFF) 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class AppleIIDisableC800 : public OEComponent 14 | { 15 | public: 16 | AppleIIDisableC800(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | OEChar read(OEAddress address); 22 | void write(OEAddress address, OEChar value); 23 | 24 | private: 25 | OEComponent *memory; 26 | OEComponent *memoryBus; 27 | }; 28 | -------------------------------------------------------------------------------- /src/libdiskimage/DIBackingStore.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Backing Store 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the backing store interface 9 | */ 10 | 11 | #ifndef _DIBACKINGSTORE_H 12 | #define _DIBACKINGSTORE_H 13 | 14 | #include "DICommon.h" 15 | 16 | class DIBackingStore 17 | { 18 | public: 19 | DIBackingStore(); 20 | 21 | virtual bool isWriteEnabled(); 22 | virtual DILong getSize(); 23 | virtual string getFormatLabel(); 24 | 25 | virtual bool read(DILong pos, DIChar *buf, DIInt num); 26 | virtual bool write(DILong pos, const DIChar *buf, DIInt num); 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIGamePort.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III Game Port 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an Apple III game port 9 | */ 10 | 11 | #ifndef _APPLEIIIGAMEPORT_H 12 | #define _APPLEIIIGAMEPORT_H 13 | 14 | #include "AppleIIGamePort.h" 15 | 16 | class AppleIIIGamePort : public AppleIIGamePort 17 | { 18 | public: 19 | AppleIIIGamePort(); 20 | 21 | OEChar read(OEAddress address); 22 | void write(OEAddress address, OEChar value); 23 | 24 | private: 25 | OEInt channelSelect; 26 | 27 | void setChannelSelect(OEInt index, bool value); 28 | bool isTimerPending(); 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleGraphicsTablet.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple Graphics Tablet 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple Graphics Tablet 9 | */ 10 | 11 | #include "OEComponent.h" 12 | #include "OEImage.h" 13 | 14 | class AppleGraphicsTablet : public OEComponent 15 | { 16 | public: 17 | AppleGraphicsTablet(); 18 | 19 | bool setValue(string name, string value); 20 | bool setRef(string name, OEComponent *ref); 21 | bool init(); 22 | 23 | void notify(OEComponent *sender, int notification, void *data); 24 | 25 | private: 26 | OEComponent *device; 27 | OEComponent *canvas; 28 | 29 | string imagePath; 30 | }; 31 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIAddressDecoder.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple II Address Decoder 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple II Address Decoder 9 | */ 10 | 11 | #ifndef _APPLEIIADDRESSDECODER_H 12 | #define _APPLEIIADDRESSDECODER_H 13 | 14 | #include "AddressDecoder.h" 15 | 16 | class AppleIIAddressDecoder : public AddressDecoder 17 | { 18 | public: 19 | AppleIIAddressDecoder(); 20 | 21 | bool postMessage(OEComponent *sender, int message, void *data); 22 | 23 | protected: 24 | MemoryMaps ioMemoryMaps; 25 | 26 | private: 27 | void updateReadWriteMap(OEAddress startAddress, OEAddress endAddress); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIKeyboard.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III Keyboard 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple III keyboard 9 | */ 10 | 11 | #ifndef _APPLEIIIKEYBOARD_H 12 | #define _APPLEIIIKEYBOARD_H 13 | 14 | #include "AppleIIKeyboard.h" 15 | 16 | class AppleIIIKeyboard : public AppleIIKeyboard 17 | { 18 | public: 19 | AppleIIIKeyboard(); 20 | 21 | OEChar read(OEAddress address); 22 | 23 | private: 24 | OEChar appleIIIKeyFlags; 25 | 26 | void updateKeyFlags(); 27 | void sendKey(CanvasUnicodeChar key); 28 | 29 | void setReset(bool value); 30 | void setAltReset(bool value); 31 | }; 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/libemulation-hal/HIDJoystick.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * HID Joystick 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a joystick component 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class HIDJoystick : public OEComponent 14 | { 15 | public: 16 | HIDJoystick(); 17 | 18 | bool postMessage(OEComponent *sender, int message, void *data); 19 | 20 | void addDevice(); 21 | void removeDevice(); 22 | 23 | void setAxis(OEInt deviceIndex, OEInt index, float value); 24 | void setHat(OEInt deviceIndex, OEInt index, OEInt value); 25 | void setButton(OEInt deviceIndex, OEInt index, bool value); 26 | 27 | private: 28 | OEInt joystickNum; 29 | }; 30 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Ricoh/RP2A03.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * RP2A03 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates a Ricoh 2A03 microprocessor. 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class RP2A03 : public OEComponent 14 | { 15 | public: 16 | RP2A03(); 17 | 18 | int ioctl(int message, void *data); 19 | 20 | private: 21 | OEComponent *memory; 22 | 23 | OEPair ppc; 24 | OEPair pc; 25 | OEPair sp; 26 | OEPair zp; 27 | OEPair ea; 28 | 29 | UINT8 a; 30 | UINT8 x; 31 | UINT8 y; 32 | UINT8 p; 33 | 34 | int irqCount; 35 | 36 | UINT8 pendingIRQ; 37 | UINT8 afterCLI; 38 | UINT8 overflow; 39 | 40 | int icount; 41 | 42 | void execute(); 43 | }; 44 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/VRAM.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Video RAM 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls video random access memory 9 | */ 10 | 11 | #include "RAM.h" 12 | 13 | class VRAM : public RAM 14 | { 15 | public: 16 | VRAM(); 17 | 18 | bool setValue(string name, string value); 19 | bool setRef(string name, OEComponent *ref); 20 | bool init(); 21 | 22 | void write(OEAddress address, OEChar value); 23 | 24 | private: 25 | OEAddress videoBlockSize; 26 | string videoMap; 27 | OEComponent *videoObserver; 28 | 29 | OEInt videoBlockBits; 30 | 31 | vector notifyMap; 32 | 33 | OEChar *notifyMapp; 34 | }; 35 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/Proxy.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Proxy 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls a message proxy 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class Proxy : public OEComponent 14 | { 15 | public: 16 | Proxy(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | bool postMessage(OEComponent *sender, int message, void *data); 22 | 23 | bool addObserver(OEComponent *observer, int notification); 24 | bool removeObserver(OEComponent *observer, int notification); 25 | void notify(OEComponent *sender, int notification, void *data); 26 | 27 | private: 28 | OEComponent *component; 29 | }; 30 | -------------------------------------------------------------------------------- /src/libdiskimage/DIBackingStore.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Backing Store 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the backing store interface 9 | */ 10 | 11 | #include "DIBackingStore.h" 12 | 13 | DIBackingStore::DIBackingStore() 14 | { 15 | } 16 | 17 | bool DIBackingStore::isWriteEnabled() 18 | { 19 | return false; 20 | } 21 | 22 | DILong DIBackingStore::getSize() 23 | { 24 | return 0; 25 | } 26 | 27 | string DIBackingStore::getFormatLabel() 28 | { 29 | return ""; 30 | } 31 | 32 | bool DIBackingStore::read(DILong pos, DIChar *buf, DIInt num) 33 | { 34 | return false; 35 | } 36 | 37 | bool DIBackingStore::write(DILong pos, const DIChar *buf, DIInt num) 38 | { 39 | return false; 40 | } 41 | -------------------------------------------------------------------------------- /src/libemulation/Core/OESound.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * OESound 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a sound type 9 | */ 10 | 11 | #ifndef _OESOUND_H 12 | #define _OESOUND_H 13 | 14 | #include "OECommon.h" 15 | 16 | class OESound 17 | { 18 | public: 19 | OESound(); 20 | OESound(string path); 21 | OESound(OEData& data); 22 | 23 | float getSampleRate(); 24 | OEInt getChannelNum(); 25 | OEInt getFrameNum(); 26 | float *getSamples(); 27 | 28 | bool load(string path); 29 | bool load(OEData& data); 30 | 31 | private: 32 | float sampleRate; 33 | OEInt channelNum; 34 | 35 | vector samples; 36 | 37 | void init(); 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AddressMasker.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Address masker 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an address masker 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class AddressMasker : public OEComponent 14 | { 15 | public: 16 | AddressMasker(); 17 | 18 | bool setValue(string name, string value); 19 | bool setRef(string name, OEComponent *ref); 20 | bool init(); 21 | 22 | bool postMessage(OEComponent *sender, int message, void *data); 23 | 24 | OEChar read(OEAddress address); 25 | void write(OEAddress address, OEChar value); 26 | 27 | private: 28 | OEComponent *memory; 29 | 30 | OEAddress andMask; 31 | OEAddress orMask; 32 | }; 33 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/AudioInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Audio interface 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the audio interface 9 | */ 10 | 11 | // Notes: 12 | // * Buffer notifications send AudioBuffer 13 | 14 | #ifndef _AUDIOINTERFACE_H 15 | #define _AUDIOINTERFACE_H 16 | 17 | #include "OECommon.h" 18 | 19 | typedef enum 20 | { 21 | AUDIO_BUFFER_WILL_RENDER, 22 | AUDIO_BUFFER_IS_RENDERING, 23 | AUDIO_BUFFER_DID_RENDER, 24 | } AudioNotification; 25 | 26 | typedef struct 27 | { 28 | float sampleRate; 29 | OEInt channelNum; 30 | OEInt frameNum; 31 | const float *input; 32 | float *output; 33 | } AudioBuffer; 34 | 35 | float getLevelFromVolume(float value); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOSKIM1IO.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOS KIM-1 I/O 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements MOS KIM-1 input/output 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class MOSKIM1IO : public OEComponent 14 | { 15 | public: 16 | MOSKIM1IO(); 17 | 18 | bool setValue(string name, string value); 19 | bool setRef(string name, OEComponent *ref); 20 | bool init(); 21 | 22 | void notify(OEComponent *sender, int notification, void *data); 23 | 24 | private: 25 | OEComponent *device; 26 | OEComponent *serialPort; 27 | OEComponent *audioOut; 28 | OEComponent *audioIn; 29 | 30 | string viewPath; 31 | 32 | OEComponent *canvas; 33 | string windowFrame; 34 | string defaultWindowSize; 35 | }; 36 | -------------------------------------------------------------------------------- /src/libdiskimage/DIV2DDiskStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Disk Image V2D 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses D5MI storage 9 | */ 10 | 11 | #include "DIBackingStore.h" 12 | #include "DIDiskStorage.h" 13 | 14 | class DIV2DDiskStorage : public DIDiskStorage 15 | { 16 | public: 17 | DIV2DDiskStorage(); 18 | 19 | bool open(DIBackingStore *file); 20 | void close(); 21 | 22 | bool isWriteEnabled(); 23 | DIDiskType getDiskType(); 24 | DIInt getTracksPerInch(); 25 | string getFormatLabel(); 26 | 27 | bool readTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 28 | 29 | private: 30 | DIBackingStore *backingStore; 31 | 32 | vector trackOffset; 33 | vector trackSize; 34 | }; 35 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIRTC.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III RTC 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple III RTC 9 | */ 10 | 11 | #ifndef _APPLEIIIRTC_H 12 | #define _APPLEIIIRTC_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class AppleIIIRTC : public OEComponent 17 | { 18 | public: 19 | AppleIIIRTC(); 20 | 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | void notify(OEComponent *sender, int notification, void *data); 25 | 26 | OEChar read(OEAddress address); 27 | void write(OEAddress address, OEChar value); 28 | 29 | private: 30 | OEComponent *systemControl; 31 | OEComponent *mm58167; 32 | 33 | OEChar zeroPage; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/libemulation-hal/OEMatrix3.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation-hal 4 | * 3x3 matrix 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a 3x3 matrix 9 | */ 10 | 11 | #ifndef _OEMATRIX3_H 12 | #define _OEMATRIX3_H 13 | 14 | #include "OECommon.h" 15 | 16 | class OEMatrix3 17 | { 18 | public: 19 | OEMatrix3(); 20 | OEMatrix3(float c00, float c01, float c02, 21 | float c10, float c11, float c12, 22 | float c20, float c21, float c22); 23 | 24 | float getValue(OEInt i, OEInt j); 25 | float *getValues(); 26 | 27 | OEMatrix3 operator*(float value); 28 | OEMatrix3 operator*(const OEMatrix3& m); 29 | OEMatrix3& operator*=(const float value); 30 | OEMatrix3& operator*=(const OEMatrix3& m); 31 | 32 | private: 33 | vector data; 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/libdiskimage/DIRAMBackingStore.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * RAM Backing Store 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a RAM backing store 9 | */ 10 | 11 | #ifndef _DIRAMBACKINGSTORE_H 12 | #define _DIRAMBACKINGSTORE_H 13 | 14 | #include "DICommon.h" 15 | #include "DIBackingStore.h" 16 | 17 | class DIRAMBackingStore : public DIBackingStore 18 | { 19 | public: 20 | DIRAMBackingStore(); 21 | 22 | bool open(DIData& data); 23 | void create(); 24 | void close(); 25 | 26 | bool isWriteEnabled(); 27 | DILong getSize(); 28 | string getFormatLabel(); 29 | 30 | bool read(DILong pos, DIChar *buf, DIInt num); 31 | bool write(DILong pos, const DIChar *buf, DIInt num); 32 | 33 | private: 34 | DIData data; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIAudioOut.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Audio Output 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls Apple II audio output 9 | */ 10 | 11 | #include "Audio1Bit.h" 12 | 13 | class AppleIIAudioOut : public Audio1Bit 14 | { 15 | public: 16 | AppleIIAudioOut(); 17 | 18 | bool setValue(string name, string value); 19 | bool getValue(string name, string &value); 20 | bool setRef(string name, OEComponent *ref); 21 | bool init(); 22 | 23 | OEChar read(OEAddress address); 24 | void write(OEAddress address, OEChar value); 25 | 26 | private: 27 | OEComponent *controlBus; 28 | OEComponent *floatingBus; 29 | 30 | bool cassetteOut; 31 | 32 | OELong lastCycles; 33 | bool relaxationState; 34 | }; 35 | -------------------------------------------------------------------------------- /src/libdiskimage/DIBlockStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Block Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the block storage interface 9 | */ 10 | 11 | #ifndef _DIBLOCKSTORAGE_H 12 | #define _DIBLOCKSTORAGE_H 13 | 14 | #include "DICommon.h" 15 | 16 | #define DI_BLOCKSIZE 512 17 | 18 | class DIBlockStorage 19 | { 20 | public: 21 | DIBlockStorage(); 22 | 23 | virtual bool isWriteEnabled(); 24 | virtual DIInt getBlockNum(); 25 | virtual string getFormatLabel(); 26 | 27 | virtual DIInt getCylinders(); 28 | virtual DIInt getHeads(); 29 | virtual DIInt getSectors(); 30 | 31 | virtual bool readBlocks(DIInt index, DIChar *buf, DIInt num); 32 | virtual bool writeBlocks(DIInt index, const DIChar *buf, DIInt num); 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/libemulation/Core/OEPackage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * OEPackage 5 | * (C) 2009-2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a file package (zip and directory type) 9 | */ 10 | 11 | #ifndef _OEPACKAGE_H 12 | #define _OEPACKAGE_H 13 | 14 | #include 15 | 16 | #include "OECommon.h" 17 | 18 | using namespace std; 19 | 20 | class OEPackage 21 | { 22 | public: 23 | OEPackage(); 24 | ~OEPackage(); 25 | 26 | bool open(const string& path); 27 | bool isOpen(); 28 | void close(); 29 | 30 | bool read(const string& packagePath, OEData *data); 31 | bool write(const string& packagePath, OEData *data); 32 | 33 | bool remove(); 34 | 35 | private: 36 | bool is_open; 37 | 38 | string path; 39 | struct zip *zip; 40 | }; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/libemulation/Core/OEDevice.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * OEDevice 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls a device 9 | */ 10 | 11 | #ifndef _OEDEVICE_H 12 | #define _OEDEVICE_H 13 | 14 | #include "OEComponent.h" 15 | 16 | #include "OEEmulation.h" 17 | 18 | #include "DeviceInterface.h" 19 | 20 | class OEDevice : public OEComponent 21 | { 22 | public: 23 | OEDevice(OEEmulation *emulation); 24 | 25 | bool postMessage(OEComponent *sender, int message, void *data); 26 | 27 | private: 28 | OEEmulation *emulation; 29 | 30 | string label; 31 | string imagePath; 32 | string locationLabel; 33 | string stateLabel; 34 | 35 | DeviceSettings settings; 36 | 37 | OEComponents canvases; 38 | OEComponents storages; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/ATADevice.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * ATA device 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an ATA device 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "DIATABlockStorage.h" 14 | 15 | class ATADevice : public OEComponent 16 | { 17 | public: 18 | ATADevice(); 19 | ~ATADevice(); 20 | 21 | bool setValue(string name, string value); 22 | bool getValue(string name, string& value); 23 | bool setRef(string name, OEComponent *ref); 24 | bool init(); 25 | 26 | bool postMessage(OEComponent *sender, int message, void *data); 27 | 28 | private: 29 | OEComponent *device; 30 | 31 | DIATABlockStorage blockStorage; 32 | 33 | bool openDiskImage(string path); 34 | void closeDiskImage(); 35 | }; 36 | -------------------------------------------------------------------------------- /src/libemulation-hal/OEVector.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation-hal 4 | * Signal processing vector 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a signal processing vector 9 | */ 10 | 11 | #ifndef _OEVECTOR_H 12 | #define _OEVECTOR_H 13 | 14 | #include "OECommon.h" 15 | 16 | class OEVector 17 | { 18 | public: 19 | OEVector(); 20 | OEVector(OEInt size); 21 | OEVector(vector data); 22 | 23 | float getValue(OEInt i); 24 | 25 | OEVector operator *(const float value); 26 | OEVector operator *(const OEVector& v); 27 | OEVector normalize(); 28 | OEVector realIDFT(); 29 | 30 | static OEVector lanczosWindow(OEInt n, float fc); 31 | static OEVector chebyshevWindow(OEInt n, float sidelobeDb); 32 | 33 | private: 34 | vector data; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOS6530.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOS6530 5 | * (C) 2009-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a MOS 6530 (ROM, RAM, I/O, Timer) 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class MOS6530 : public OEComponent 14 | { 15 | public: 16 | MOS6530(); 17 | 18 | bool setValue(string name, string value); 19 | bool getValue(string name, string& value); 20 | bool setRef(string name, OEComponent *ref); 21 | 22 | OEChar read(OEAddress address); 23 | void write(OEAddress address, OEChar value); 24 | 25 | private: 26 | OEComponent *controlBus; 27 | OEComponent *portA; 28 | OEComponent *portB; 29 | OEComponent *controlBusB; 30 | 31 | OEChar ddrA; 32 | OEChar dataA; 33 | OEChar ddrB; 34 | OEChar dataB; 35 | }; 36 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOS6509.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * MOS6509 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates a MOS6509 microprocessor. 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class MOS6509 : public OEComponent 14 | { 15 | public: 16 | MOS6509(); 17 | 18 | int ioctl(int message, void *data); 19 | 20 | private: 21 | OEComponent *memory; 22 | 23 | OEPair ppc; 24 | OEPair pc; 25 | OEPair sp; 26 | OEPair zp; 27 | OEPair ea; 28 | 29 | OEUInt8 a; 30 | OEUInt8 x; 31 | OEUInt8 y; 32 | OEUInt8 p; 33 | 34 | // 4 bits, addressed over address 0 35 | OEPair pcBank; 36 | // 4 bits, addressed over address 1 37 | OEPair indBank; 38 | 39 | int irqCount; 40 | 41 | UINT8 pendingIRQ; 42 | UINT8 afterCLI; 43 | UINT8 soState; 44 | 45 | int icount; 46 | 47 | void execute(); 48 | }; 49 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOSKIM1PLL.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOSKIM-1 PLL 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements the MOSKIM-1 audio phase locked loop 9 | */ 10 | 11 | #include "MOSKIM1PLL.h" 12 | #include "AudioInterface.h" 13 | 14 | MOSKIM1PLL::MOSKIM1PLL() 15 | { 16 | audio = NULL; 17 | } 18 | 19 | bool MOSKIM1PLL::setValue(string name, string value) 20 | { 21 | if (name == "decisionFrequency") 22 | decisionFrequency = getFloat(value); 23 | else 24 | return false; 25 | 26 | return true; 27 | } 28 | 29 | bool MOSKIM1PLL::setRef(string name, OEComponent *ref) 30 | { 31 | if (name == "audio") 32 | { 33 | removeObserver(audio, AUDIO_BUFFER_WILL_RENDER); 34 | audio = ref; 35 | addObserver(audio, AUDIO_BUFFER_WILL_RENDER); 36 | } 37 | else 38 | return false; 39 | 40 | return true; 41 | } 42 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIMOS6502.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III MOS6502 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates an Apple III MOS6502 microprocessor 9 | */ 10 | 11 | #ifndef _APPLEIIIMOS6502_H 12 | #define _APPLEIIIMOS6502_H 13 | 14 | #include "MOS6502.h" 15 | 16 | class AppleIIIMOS6502 : public MOS6502 17 | { 18 | public: 19 | AppleIIIMOS6502(); 20 | 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | void notify(OEComponent *sender, int notification, void *data); 25 | 26 | private: 27 | OEComponent *extendedMemoryBus; 28 | OEComponent *systemControl; 29 | 30 | bool extendedMemoryEnabled; 31 | OEAddress extendedPageAddress; 32 | OEInt extendedMemoryBank; 33 | 34 | void execute(); 35 | void setZeroPage(OEChar value); 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIFloatingBus.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Floating Bus 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements the Apple II floating bus 9 | */ 10 | 11 | #include "AppleIIFloatingBus.h" 12 | 13 | #include "AppleIIInterface.h" 14 | 15 | AppleIIFloatingBus::AppleIIFloatingBus() 16 | { 17 | video = NULL; 18 | } 19 | 20 | bool AppleIIFloatingBus::setRef(string name, OEComponent *ref) 21 | { 22 | if (name == "video") 23 | video = ref; 24 | else 25 | return false; 26 | 27 | return true; 28 | } 29 | 30 | bool AppleIIFloatingBus::init() 31 | { 32 | OECheckComponent(video); 33 | 34 | return true; 35 | } 36 | 37 | OEChar AppleIIFloatingBus::read(OEAddress address) 38 | { 39 | OEChar value; 40 | 41 | video->postMessage(this, APPLEII_READ_FLOATINGBUS, &value); 42 | 43 | return value; 44 | } 45 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIBeeper.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III Beeper 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple III Beeper 9 | */ 10 | 11 | #ifndef _APPLEIIIBEEPER_H 12 | #define _APPLEIIIBEEPER_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class AppleIIIBeeper : public OEComponent 17 | { 18 | public: 19 | AppleIIIBeeper(); 20 | 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | void notify(OEComponent *sender, int notification, void *data); 25 | 26 | OEChar read(OEAddress address); 27 | void write(OEAddress address, OEChar value); 28 | 29 | private: 30 | OEComponent *controlBus; 31 | OEComponent *floatingBus; 32 | OEComponent *audioOut; 33 | 34 | OEInt count; 35 | 36 | void scheduleNextTimer(OESLong cycles); 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/libemulation/Interface/EIA/RS232Interface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * RS-232 Interface 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the RS-232 interface 9 | */ 10 | 11 | // Notes: 12 | // * Data is sent and received as OEData. 13 | 14 | #ifndef _RS232INTERFACE 15 | #define _RS232INTERFACE 16 | 17 | typedef enum 18 | { 19 | RS232_RECEIVE_DATA, 20 | 21 | RS232_IS_RTS, 22 | RS232_SET_CTS, 23 | 24 | RS232_IS_DTR, 25 | RS232_SET_DSR, 26 | 27 | RS232_SET_DCD, 28 | RS232_SET_RI, 29 | 30 | RS232_SEND_RECEIVEBREAK, 31 | } RS232DTEMessage; 32 | 33 | typedef enum 34 | { 35 | RS232_TRANSMIT_DATA, 36 | 37 | RS232_SET_RTS, 38 | RS232_IS_CTS, 39 | 40 | RS232_SET_DTR, 41 | RS232_IS_DSR, 42 | 43 | RS232_IS_DCD, 44 | RS232_IS_RI, 45 | 46 | RS232_SEND_TRANSMITBREAK, 47 | } RS232DCEMessage; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/libdiskimage/DIRAWBlockStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * RAW Block Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a RAW block storage 9 | */ 10 | 11 | #ifndef _DIRAWBLOCKSTORAGE_H 12 | #define _DIRAWBLOCKSTORAGE_H 13 | 14 | #include "DICommon.h" 15 | #include "DIBackingStore.h" 16 | #include "DIBlockStorage.h" 17 | 18 | class DIRAWBlockStorage : public DIBlockStorage 19 | { 20 | public: 21 | DIRAWBlockStorage(); 22 | 23 | bool open(DIBackingStore *backingStore); 24 | void close(); 25 | 26 | bool isWriteEnabled(); 27 | DIInt getBlockNum(); 28 | string getFormatLabel(); 29 | 30 | bool readBlocks(DIInt index, DIChar *buf, DIInt num); 31 | bool writeBlocks(DIInt index, const DIChar *buf, DIInt num); 32 | 33 | private: 34 | DIBackingStore *backingStore; 35 | 36 | DIInt blockNum; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIAudioIn.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Audio Input 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls Apple II audio input 9 | */ 10 | 11 | #include "AppleIIAudioIn.h" 12 | 13 | AppleIIAudioIn::AppleIIAudioIn() : Audio1Bit() 14 | { 15 | floatingBus = NULL; 16 | } 17 | 18 | bool AppleIIAudioIn::setRef(string name, OEComponent *ref) 19 | { 20 | if (name == "floatingBus") 21 | floatingBus = ref; 22 | else 23 | return Audio1Bit::setRef(name, ref); 24 | 25 | return true; 26 | } 27 | 28 | bool AppleIIAudioIn::init() 29 | { 30 | OECheckComponent(floatingBus); 31 | 32 | if (!Audio1Bit::init()) 33 | return false; 34 | 35 | return true; 36 | } 37 | 38 | OEChar AppleIIAudioIn::read(OEAddress address) 39 | { 40 | return (readAudioInput() << 7) | (floatingBus->read(0) & 0x7f); 41 | } 42 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleSilentypeInterfaceCard.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple Silentype Interface Card 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple Silentype Interface Card 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class AppleSilentypeInterfaceCard : public OEComponent 14 | { 15 | public: 16 | AppleSilentypeInterfaceCard(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | void notify(OEComponent *sender, int notification, void *data); 22 | 23 | OEChar read(OEAddress address); 24 | void write(OEAddress address, OEChar value); 25 | 26 | private: 27 | OEComponent *controlBus; 28 | OEComponent *floatingBus; 29 | OEComponent *slotController; 30 | OEComponent *memoryMapper; 31 | OEComponent *printer; 32 | 33 | void setROMEnabled(bool value); 34 | }; 35 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/FloatingBus.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Floating bus 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls a generic floating bus 9 | */ 10 | 11 | #include 12 | 13 | #include "FloatingBus.h" 14 | 15 | FloatingBus::FloatingBus() 16 | { 17 | randomMode = false; 18 | 19 | busValue = 0; 20 | } 21 | 22 | bool FloatingBus::setValue(string name, string value) 23 | { 24 | if (name == "type") 25 | { 26 | if (value == "vcc") 27 | busValue = 0xff; 28 | else 29 | busValue = 0x00; 30 | 31 | randomMode = (value == "random"); 32 | } 33 | else 34 | return false; 35 | 36 | return true; 37 | } 38 | 39 | OEChar FloatingBus::read(OEAddress address) 40 | { 41 | if (randomMode) 42 | return random() & 0xff; 43 | else 44 | return busValue; 45 | } 46 | -------------------------------------------------------------------------------- /src/libemulation/Interface/IEEE/IEEE1284Interface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * IEEE 1284 (parallel port) Interface 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the IEEE 1284 (parallel port) interface 9 | */ 10 | 11 | #ifndef _IEEE1284INTERFACE_H 12 | #define _IEEE1284INTERFACE_H 13 | 14 | typedef enum 15 | { 16 | IEEE1284_TRANSMIT_DATA, 17 | IEEE1284_ASSERT_STROBE, 18 | IEEE1284_CLEAR_STROBE, 19 | IEEE1284_ASSERT_LF, 20 | IEEE1284_CLEAR_LF, 21 | IEEE1284_ASSERT_INIT, 22 | IEEE1284_CLEAR_INIT, 23 | IEEE1284_ASSERT_SELECTIN, 24 | IEEE1284_CLEAR_SELECTIN, 25 | } IEEE1284ComputerMessage; 26 | 27 | typedef enum 28 | { 29 | IEEE1284_DID_RECEIVE_DATA, 30 | IEEE1284_ACK_DID_CHANGE, 31 | IEEE1284_BUSY_DID_CHANGE, 32 | IEEE1284_PE_DID_CHANGE, 33 | IEEE1284_SELECT_DID_CHANGE, 34 | IEEE1284_FAULT_DID_CHANGE, 35 | } IEEE1284PrinterMessage; 36 | 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/National/MM58167.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MM58167 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates a MM58167 real time clock 9 | */ 10 | 11 | #ifndef MM58167_H 12 | #define MM58167_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class MM58167 : public OEComponent 17 | { 18 | public: 19 | MM58167(); 20 | 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | void notify(OEComponent *sender, int notification, void *data); 25 | 26 | OEChar read(OEAddress address); 27 | void write(OEAddress address, OEChar value); 28 | 29 | private: 30 | OEComponent *audio; 31 | 32 | OEChar getBCD(OEChar value); 33 | 34 | OEInt deltaSec; 35 | OEInt deltaUSec; 36 | 37 | OEChar interruptFlags; 38 | OEChar interruptControl; 39 | 40 | OEData ram; 41 | OEChar *ramp; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AddressMapper.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Address mapper 5 | * (C) 2011-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Maps components in an address decoder. 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | class AddressMapper : public OEComponent 16 | { 17 | public: 18 | AddressMapper(); 19 | 20 | bool setValue(string name, string value); 21 | bool getValue(string name, string& value); 22 | bool setRef(string name, OEComponent *ref); 23 | bool init(); 24 | void update(); 25 | void dispose(); 26 | 27 | bool postMessage(OEComponent *sender, int message, void *data); 28 | 29 | private: 30 | OEComponent *addressDecoder; 31 | 32 | MemoryMapsConf conf; 33 | MemoryMapsRef ref; 34 | 35 | string lastSel; 36 | string sel; 37 | 38 | MemoryMaps buildMemoryMaps(string value); 39 | }; 40 | -------------------------------------------------------------------------------- /src/libdiskimage/DIDiskStorage.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Disk Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the disk storage interface 9 | */ 10 | 11 | #include "DIDiskStorage.h" 12 | 13 | DIDiskStorage::DIDiskStorage() 14 | { 15 | } 16 | 17 | bool DIDiskStorage::isWriteEnabled() 18 | { 19 | return false; 20 | } 21 | 22 | DIDiskType DIDiskStorage::getDiskType() 23 | { 24 | return DI_8_INCH; 25 | } 26 | 27 | DIInt DIDiskStorage::getTracksPerInch() 28 | { 29 | return 0; 30 | } 31 | 32 | string DIDiskStorage::getFormatLabel() 33 | { 34 | return ""; 35 | } 36 | 37 | DILong DIDiskStorage::getOptimalBitTiming() 38 | { 39 | return 32; 40 | } 41 | 42 | bool DIDiskStorage::readTrack(DIInt headIndex, DIInt trackIndex, DITrack& track) 43 | { 44 | return false; 45 | } 46 | 47 | bool DIDiskStorage::writeTrack(DIInt headIndex, DIInt trackIndex, DITrack& track) 48 | { 49 | return false; 50 | } 51 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/Audio1Bit.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Audio 1-bit 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a 1-bit audio device 9 | */ 10 | 11 | #ifndef _AUDIO1BIT_H 12 | #define _AUDIO1BIT_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class Audio1Bit : public OEComponent 17 | { 18 | public: 19 | Audio1Bit(); 20 | 21 | bool setValue(string name, string value); 22 | bool getValue(string name, string& value); 23 | bool setRef(string name, OEComponent *ref); 24 | bool init(); 25 | void update(); 26 | 27 | protected: 28 | bool readAudioInput(); 29 | void toggleAudioOutput(); 30 | 31 | private: 32 | OEComponent *audioCodec; 33 | 34 | float noiseRejection; 35 | float volume; 36 | 37 | float inputThreshold; 38 | OESShort inputLevel; 39 | 40 | bool outputState; 41 | OESShort outputLevel; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /res/library/Apple II/Apple Silentype.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/libdiskimage/DIFileBackingStore.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * File Backing Store 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a file backing store 9 | */ 10 | 11 | #ifndef _DIFILEBACKINGSTORE_H 12 | #define _DIFILEBACKINGSTORE_H 13 | 14 | #include "stdio.h" 15 | 16 | #include "DICommon.h" 17 | #include "DIBackingStore.h" 18 | 19 | class DIFileBackingStore : public DIBackingStore 20 | { 21 | public: 22 | DIFileBackingStore(); 23 | ~DIFileBackingStore(); 24 | 25 | bool open(string path); 26 | bool create(string path); 27 | void close(); 28 | 29 | string getPath(); 30 | bool isWriteEnabled(); 31 | DILong getSize(); 32 | string getFormatLabel(); 33 | 34 | bool read(DILong pos, DIChar *buf, DIInt num); 35 | bool write(DILong pos, const DIChar *buf, DIInt num); 36 | 37 | private: 38 | FILE *fp; 39 | bool writeEnabled; 40 | 41 | string path; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /res/library/Apple II/Apple Graphics Tablet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /res/roms/Achatz/A-ONE Video ROM.bin: -------------------------------------------------------------------------------- 1 | >>( 2 | <02&((*$ **>> "&*2""  >> " $>> <" <"">""""""8 >>">>( 3 | <02&((*$ **>> "&*2""  >> " $>> <" <"">""""""8 >>""*., "">""<""<""<" "<"""""<> < >> <  &"""">"""""$(0($" >"6**"""""2*&"""""""<""< """*$<""<($"" ">""""""""""""""**6"""""""> >>00000> >>">" <""< """<  8"" <"""$ $(0($4****,2""""""<"< ",0  <8 """""""""**"""">>   (>>>>>>> -------------------------------------------------------------------------------- /src/libdiskimage/DIBlockStorage.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Block Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the block storage interface 9 | */ 10 | 11 | #include "DIBlockStorage.h" 12 | 13 | DIBlockStorage::DIBlockStorage() 14 | { 15 | } 16 | 17 | bool DIBlockStorage::isWriteEnabled() 18 | { 19 | return false; 20 | } 21 | 22 | DIInt DIBlockStorage::getBlockNum() 23 | { 24 | return 0; 25 | } 26 | 27 | string DIBlockStorage::getFormatLabel() 28 | { 29 | return ""; 30 | } 31 | 32 | DIInt DIBlockStorage::getCylinders() 33 | { 34 | return 0; 35 | } 36 | 37 | DIInt DIBlockStorage::getHeads() 38 | { 39 | return 0; 40 | } 41 | 42 | DIInt DIBlockStorage::getSectors() 43 | { 44 | return 0; 45 | } 46 | 47 | bool DIBlockStorage::readBlocks(DIInt index, DIChar *buf, DIInt num) 48 | { 49 | return false; 50 | } 51 | 52 | bool DIBlockStorage::writeBlocks(DIInt index, const DIChar *buf, DIInt num) 53 | { 54 | return false; 55 | } 56 | -------------------------------------------------------------------------------- /src/libemulation/ddl-1.0.dtd: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Don't Ask/SAMDACCard.h: -------------------------------------------------------------------------------- 1 | /** 2 | * libemulation 3 | * Don't Ask Software S.A.M. DAC Card 4 | * (C) 2016 by Zellyn Hunter (zellyn@gmail.com) 5 | * Released under the GPL 6 | * 7 | * Controls a Don't Ask Software Digital Analog Converter Card 8 | */ 9 | 10 | #include "OEComponent.h" 11 | 12 | #include "MemoryInterface.h" 13 | 14 | class SAMDACCard : public OEComponent 15 | { 16 | public: 17 | SAMDACCard(); 18 | 19 | void notify(OEComponent *sender, int notification, void *data); 20 | 21 | bool setValue(string name, string value); 22 | bool getValue(string name, string& value); 23 | bool setRef(string name, OEComponent *ref); 24 | bool init(); 25 | void update(); 26 | void dispose(); 27 | 28 | OEChar read(OEAddress address); 29 | void write(OEAddress address, OEChar value); 30 | 31 | private: 32 | OEComponent *floatingBus; 33 | OEComponent *audioCodec; 34 | 35 | float volume; 36 | OESShort outputLevel; 37 | 38 | OELong lastCycles; 39 | bool relaxationState; 40 | }; 41 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/Monitor.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Monitor 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls a generic monitor 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "ControlBusInterface.h" 14 | #include "CanvasInterface.h" 15 | 16 | class Monitor : public OEComponent 17 | { 18 | public: 19 | Monitor(); 20 | 21 | bool setValue(string name, string value); 22 | bool getValue(string name, string& value); 23 | bool setRef(string name, OEComponent *ref); 24 | bool init(); 25 | void update(); 26 | 27 | bool postMessage(OEComponent *sender, int message, void *data); 28 | 29 | void notify(OEComponent *sender, int notification, void *data); 30 | 31 | private: 32 | CanvasDisplayConfiguration configuration; 33 | 34 | OEComponent *device; 35 | OEComponent *controlBus; 36 | 37 | OEComponent *canvas; 38 | ControlBusPowerState powerState; 39 | 40 | void updateBezel(); 41 | }; 42 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AddressOffset.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Address offset 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an address offseter 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | class AddressOffset : public OEComponent 16 | { 17 | public: 18 | AddressOffset(); 19 | 20 | bool setValue(string name, string value); 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | bool postMessage(OEComponent *sender, int message, void *data); 25 | 26 | OEChar read(OEAddress address); 27 | void write(OEAddress address, OEChar value); 28 | 29 | private: 30 | OEComponent *memory; 31 | 32 | OEAddress size; 33 | OEAddress blockSize; 34 | 35 | OEInt blockBits; 36 | 37 | vector offset; 38 | OESLong *offsetp; 39 | 40 | OEAddress mask; 41 | 42 | AddressOffsetMaps offsetMaps; 43 | 44 | bool mapOffset(AddressOffsetMap& value); 45 | }; 46 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Zilog/Z80.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Z80 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates a Z80 microprocessor. 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | 14 | class Z80 : public OEComponent 15 | { 16 | public: 17 | Z80(); 18 | 19 | int ioctl(int message, void *data); 20 | 21 | private: 22 | OEComponent *memory; 23 | OEComponent *port; 24 | 25 | // 8080 26 | OEPair ppc; 27 | OEPair pc; 28 | OEPair sp; 29 | OEPair ea; 30 | 31 | OEPair af; 32 | OEPair bc; 33 | OEPair de; 34 | OEPair hl; 35 | 36 | // Z80 37 | OEPair af2; 38 | OEPair bc2; 39 | OEPair de2; 40 | OEPair hl2; 41 | OEPair ix; 42 | OEPair iy; 43 | OEPair wz; 44 | UINT8 i; 45 | UINT8 r; 46 | 47 | UINT8 rr; 48 | 49 | UINT8 iff1; 50 | UINT8 iff2; 51 | UINT8 halt; 52 | UINT8 im; 53 | 54 | UINT8 nmi_state; /* nmi line state */ 55 | UINT8 nmi_pending; /* nmi pending */ 56 | UINT8 irq_state; /* irq line state */ 57 | UINT8 after_ei; /* are we in the EI shadow? */ 58 | 59 | void execute(); 60 | }; 61 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/Apple1IO.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple-1 input/output 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Interfaces an Apple-1 terminal with a PIA 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class Apple1IO : public OEComponent 14 | { 15 | public: 16 | Apple1IO(); 17 | 18 | bool setValue(string name, string value); 19 | bool getValue(string name, string& value); 20 | bool setRef(string name, OEComponent *ref); 21 | bool init(); 22 | void update(); 23 | 24 | bool postMessage(OEComponent *sender, int message, void *data); 25 | 26 | void notify(OEComponent *sender, int notification, void *data); 27 | 28 | OEChar read(OEAddress address); 29 | void write(OEAddress address, OEChar value); 30 | 31 | private: 32 | bool enhancedTerminalSpeed; 33 | bool fullASCIIKeyboard; 34 | 35 | OEComponent *pia; 36 | OEComponent *dce; 37 | 38 | OEChar terminalKey; 39 | OEChar terminalChar; 40 | 41 | void sendChar(); 42 | }; 43 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/ROM.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * ROM 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls read only memory. 9 | */ 10 | 11 | #include "ROM.h" 12 | 13 | bool ROM::setData(string name, OEData *data) 14 | { 15 | if (name == "memoryImage") 16 | data->swap(this->data); 17 | else 18 | return false; 19 | 20 | return true; 21 | } 22 | 23 | bool ROM::getData(string name, OEData **data) 24 | { 25 | if (name == "memoryImage") 26 | *data = &this->data; 27 | else 28 | return false; 29 | 30 | return true; 31 | } 32 | 33 | bool ROM::init() 34 | { 35 | if (!data.size()) 36 | { 37 | logMessage("missing ROM"); 38 | 39 | return false; 40 | } 41 | 42 | OEAddress size = getNextPowerOf2((int) data.size()); 43 | data.resize((size_t) size); 44 | datap = &data.front(); 45 | mask = size - 1; 46 | 47 | return true; 48 | } 49 | 50 | OEChar ROM::read(OEAddress address) 51 | { 52 | return datap[address & mask]; 53 | } 54 | -------------------------------------------------------------------------------- /src/libdiskimage.cmake: -------------------------------------------------------------------------------- 1 | # libdiskimage - disk image emulation 2 | set(_libdiskimage_dir ${source_directory}/libdiskimage) 3 | 4 | # Sources 5 | set(libdiskimage 6 | ${_libdiskimage_dir}/DI2IMGBackingStore.cpp 7 | # TODO ${_libdiskimage_dir}/DIApple35DiskStorage.cpp 8 | ${_libdiskimage_dir}/DIApple525DiskStorage.cpp 9 | ${_libdiskimage_dir}/DIATABlockStorage.cpp 10 | ${_libdiskimage_dir}/DIBackingStore.cpp 11 | ${_libdiskimage_dir}/DIBlockStorage.cpp 12 | ${_libdiskimage_dir}/DICommon.cpp 13 | ${_libdiskimage_dir}/DIDC42BackingStore.cpp 14 | ${_libdiskimage_dir}/DIDDLDiskStorage.cpp 15 | ${_libdiskimage_dir}/DIDiskStorage.cpp 16 | ${_libdiskimage_dir}/DIFDIDiskStorage.cpp 17 | ${_libdiskimage_dir}/DIFileBackingStore.cpp 18 | ${_libdiskimage_dir}/DILogicalDiskStorage.cpp 19 | ${_libdiskimage_dir}/DIRAMBackingStore.cpp 20 | ${_libdiskimage_dir}/DIRAWBlockStorage.cpp 21 | ${_libdiskimage_dir}/DIV2DDiskStorage.cpp 22 | ${_libdiskimage_dir}/DIVDIBlockStorage.cpp 23 | ${_libdiskimage_dir}/DIVMDKBlockStorage.cpp 24 | ${_libdiskimage_dir}/DIWozDiskStorage.cpp 25 | ) 26 | 27 | # Headers 28 | set(libdiskimage_include ${_libdiskimage_dir}) 29 | -------------------------------------------------------------------------------- /src/libdiskimage/DIWozDiskStorage.h: -------------------------------------------------------------------------------- 1 | /** 2 | * libdiskimage 3 | * Disk Image WOZ 4 | * (C) 2018 by John K. Morris (jmorris@evolutioninteractive.com) 5 | * Released under the GPL 6 | * 7 | * Accesses WOZ disk images 8 | */ 9 | 10 | #include "DIBackingStore.h" 11 | #include "DIDiskStorage.h" 12 | 13 | class DIWozDiskStorage : public DIDiskStorage 14 | { 15 | public: 16 | DIWozDiskStorage(); 17 | ~DIWozDiskStorage(); 18 | 19 | bool open(DIBackingStore *file); 20 | void close(); 21 | 22 | bool isWriteEnabled(); 23 | DIDiskType getDiskType(); 24 | DIInt getTracksPerInch(); 25 | string getFormatLabel(); 26 | DILong getOptimalBitTiming(); 27 | 28 | bool readTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 29 | bool writeTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 30 | 31 | private: 32 | 33 | DIChar wozVersion; 34 | bool writeProtected; 35 | DIChar optimalBitTiming; 36 | DIInt largestTrack; 37 | bool updateCRC32; 38 | 39 | DIBackingStore *backingStore; 40 | 41 | DIData trackMap; 42 | 43 | DIInt crc32(DIInt crc, const DIChar *buf, DILong size); 44 | }; 45 | -------------------------------------------------------------------------------- /INSTALL.md: -------------------------------------------------------------------------------- 1 | # libemulation building instructions 2 | 3 | These are the building instructions for libemulation, a cross-platform emulation framework of many legacy computer systems. 4 | 5 | ## macOS 6 | We aim to be portable, but currently the only officially supported and tested platform is macOS. 7 | 8 | To compile libemulation for macOS you need Xcode and several external libraries not available by default. The simplest way to install them is using Homebrew. 9 | 10 | ### Setup 11 | Install Homebrew from the official site: 12 | 13 | The official tool for building libemulation is CMake. 14 | 15 | brew update 16 | brew install cmake 17 | 18 | The required version of CMake is at least 3.11. 19 | 20 | ### Dependencies 21 | Use Homebrew to install the required dependencies: 22 | 23 | brew install libpng libzip portaudio libsndfile libsamplerate 24 | 25 | ### Build 26 | With the dependencies installed, we're now ready to build libemulation. Run from the cloned repository: 27 | 28 | cmake -H. -Bbuild -DCMAKE_BUILD_TYPE=Release 29 | cmake --build build --config Release 30 | 31 | This will create a static library file `libemulation.a` in the build directory. 32 | -------------------------------------------------------------------------------- /res/library/Apple II/Don't Ask S.A.M..xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/Apple1ACI.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple-1 ACI 5 | * (C) 2011-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an Apple-1 ACI (Apple Cassette Interface) 9 | */ 10 | 11 | #include "Apple1ACI.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | Apple1ACI::Apple1ACI() : Audio1Bit() 16 | { 17 | rom = NULL; 18 | } 19 | 20 | bool Apple1ACI::setRef(string name, OEComponent *ref) 21 | { 22 | if (name == "rom") 23 | rom = ref; 24 | else 25 | return Audio1Bit::setRef(name, ref); 26 | 27 | return true; 28 | } 29 | 30 | bool Apple1ACI::init() 31 | { 32 | if (!Audio1Bit::init()) 33 | return false; 34 | 35 | OECheckComponent(rom); 36 | 37 | return true; 38 | } 39 | 40 | OEChar Apple1ACI::read(OEAddress address) 41 | { 42 | if (address & 0x80) 43 | { 44 | if (readAudioInput()) 45 | address &= ~0x1; 46 | } 47 | 48 | toggleAudioOutput(); 49 | 50 | return rom->read(address); 51 | } 52 | 53 | void Apple1ACI::write(OEAddress address, OEChar value) 54 | { 55 | toggleAudioOutput(); 56 | } 57 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIMOS6502Opcodes.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III MOS6502 Opcodes 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements Apple III MOS6502 opcodes 9 | */ 10 | 11 | #include "MOS6502Opcodes.h" 12 | #include "AppleIIIMOS6502Operations.h" 13 | 14 | #define APPLEIIIMOS6502_OP(nn) case 0x##nn: APPLEIIIMOS6502_OP##nn; break 15 | 16 | #define APPLEIIIMOS6502_OP11 { int tmp; APPLEIIIRD_IDY_P; ORA; } /* 5 ORA IDY page penalty */ 17 | #define APPLEIIIMOS6502_OP31 { int tmp; APPLEIIIRD_IDY_P; AND; } /* 5 AND IDY page penalty */ 18 | #define APPLEIIIMOS6502_OP51 { int tmp; APPLEIIIRD_IDY_P; EOR; } /* 5 EOR IDY page penalty */ 19 | #define APPLEIIIMOS6502_OP71 { int tmp; APPLEIIIRD_IDY_P; ADC; } /* 5 ADC IDY page penalty */ 20 | #define APPLEIIIMOS6502_OP91 { int tmp; STA; APPLEIIIWR_IDY_NP; } /* 6 STA IDY */ 21 | #define APPLEIIIMOS6502_OPb1 { int tmp; APPLEIIIRD_IDY_P; LDA; } /* 5 LDA IDY page penalty */ 22 | #define APPLEIIIMOS6502_OPd1 { int tmp; APPLEIIIRD_IDY_P; CMP; } /* 5 CMP IDY page penalty */ 23 | #define APPLEIIIMOS6502_OPf1 { int tmp; APPLEIIIRD_IDY_P; SBC; } /* 5 SBC IDY page penalty */ 24 | -------------------------------------------------------------------------------- /src/libdiskimage/DI2IMGBackingStore.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * 2IMG backing store 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a 2IMG backing store 9 | */ 10 | 11 | #ifndef _DI2IMGBACKINGSTORE_H 12 | #define _DI2IMGBACKINGSTORE_H 13 | 14 | #include "DICommon.h" 15 | #include "DIBackingStore.h" 16 | 17 | typedef enum 18 | { 19 | DI_2IMG_DOS, 20 | DI_2IMG_PRODOS, 21 | DI_2IMG_NIB, 22 | } DI2IMGFormat; 23 | 24 | class DI2IMGBackingStore : public DIBackingStore 25 | { 26 | public: 27 | DI2IMGBackingStore(); 28 | 29 | bool open(DIBackingStore *backingStore); 30 | void close(); 31 | 32 | bool isWriteEnabled(); 33 | DILong getSize(); 34 | string getFormatLabel(); 35 | 36 | DI2IMGFormat getFormat(); 37 | DIInt getGCRVolume(); 38 | 39 | bool read(DILong pos, DIChar *buf, DIInt num); 40 | bool write(DILong pos, const DIChar *buf, DIInt num); 41 | 42 | private: 43 | DIBackingStore *backingStore; 44 | 45 | bool writeEnabled; 46 | DI2IMGFormat format; 47 | DIInt gcrVolume; 48 | DILong imageOffset; 49 | DILong imageSize; 50 | }; 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleGraphicsTabletInterfaceCard.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple Graphics Tablet Interface Card 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple Graphics Tablet Interface Card 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | class AppleGraphicsTabletInterfaceCard : public OEComponent 14 | { 15 | public: 16 | AppleGraphicsTabletInterfaceCard(); 17 | 18 | bool setRef(string name, OEComponent *ref); 19 | bool init(); 20 | 21 | void notify(OEComponent *sender, int notification, void *data); 22 | 23 | OEChar read(OEAddress address); 24 | void write(OEAddress address, OEChar value); 25 | 26 | private: 27 | OEComponent *graphicsTablet; 28 | OEComponent *controlBus; 29 | OEComponent *floatingBus; 30 | OEComponent *memory; 31 | OEComponent *audioCodec; 32 | 33 | bool proximity; 34 | float x; 35 | float y; 36 | bool button; 37 | 38 | OEInt count; 39 | 40 | bool timerEnabled; 41 | OEInt timerCount; 42 | OELong timerCycles; 43 | 44 | void setTimer(OEInt value); 45 | void updateCount(); 46 | }; 47 | -------------------------------------------------------------------------------- /src/libdiskimage/DIDDLDiskStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Disk Image DDL 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses Disk Description Language storage 9 | */ 10 | 11 | #include "DIBackingStore.h" 12 | #include "DIDiskStorage.h" 13 | 14 | typedef vector DIDDLTrack; 15 | 16 | class DIDDLDiskStorage : public DIDiskStorage 17 | { 18 | public: 19 | DIDDLDiskStorage(); 20 | ~DIDDLDiskStorage(); 21 | 22 | bool open(DIBackingStore *file); 23 | bool create(DIBackingStore *backingStore, DIDiskType diskType, DIInt tracksPerInch); 24 | void close(); 25 | 26 | bool isWriteEnabled(); 27 | DIDiskType getDiskType(); 28 | DIInt getTracksPerInch(); 29 | string getFormatLabel(); 30 | 31 | bool readTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 32 | bool writeTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 33 | 34 | private: 35 | DIBackingStore *backingStore; 36 | 37 | bool writing; 38 | 39 | DIDiskType diskType; 40 | DIInt tracksPerInch; 41 | 42 | vector trackData; 43 | 44 | bool writeString(string& s); 45 | }; 46 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIISlotController.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Slot Controller 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls Apple II slot memory ($C100-$C7FF) 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | class AppleIISlotController : public OEComponent 16 | { 17 | public: 18 | AppleIISlotController(); 19 | 20 | bool setValue(string name, string value); 21 | bool getValue(string name, string& value); 22 | bool setRef(string name, OEComponent *ref); 23 | bool init(); 24 | void dispose(); 25 | 26 | bool postMessage(OEComponent *sender, int message, void *data); 27 | 28 | void notify(OEComponent *sender, int notification, void *data); 29 | 30 | OEChar read(OEAddress address); 31 | void write(OEAddress address, OEChar value); 32 | 33 | private: 34 | OEComponent *memory; 35 | OEComponent *memoryBus; 36 | 37 | bool en; 38 | 39 | MemoryMapsConf conf; 40 | MemoryMapsRef ref; 41 | 42 | MemoryMaps memoryMaps; 43 | 44 | void enableSlotExpansion(bool value); 45 | void updateSlotExpansion(bool value); 46 | }; 47 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AddressMux.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Mux 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Multiplexes several components. 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | class AddressMux : public OEComponent 16 | { 17 | public: 18 | AddressMux(); 19 | 20 | bool setValue(string name, string value); 21 | bool getValue(string name, string& value); 22 | bool setRef(string name, OEComponent *ref); 23 | bool init(); 24 | void update(); 25 | 26 | bool postMessage(OEComponent *sender, int message, void *data); 27 | 28 | OEChar read(OEAddress address); 29 | void write(OEAddress address, OEChar value); 30 | OEShort read16(OEAddress address); 31 | void write16(OEAddress address, OEShort value); 32 | OEInt read32(OEAddress address); 33 | void write32(OEAddress address, OEInt value); 34 | OELong read64(OEAddress address); 35 | void write64(OEAddress address, OELong value); 36 | 37 | private: 38 | MemoryMapsRef ref; 39 | 40 | string sel; 41 | 42 | OEComponent *component; 43 | 44 | OEComponent dummyComponent; 45 | }; 46 | -------------------------------------------------------------------------------- /src/libdiskimage/DIDC42BackingStore.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Disk Copy 4.2 Backing Store 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a Disk Copy 4.2 backing store 9 | */ 10 | 11 | #ifndef _DIDC42BACKINGSTORE_H 12 | #define _DIDC42BACKINGSTORE_H 13 | 14 | #include "DICommon.h" 15 | #include "DIBackingStore.h" 16 | 17 | #define DI_DC42_TAGSIZE 12 18 | 19 | class DIDC42BackingStore : public DIBackingStore 20 | { 21 | public: 22 | DIDC42BackingStore(); 23 | 24 | bool open(DIBackingStore *backingStore); 25 | void close(); 26 | 27 | bool isWriteEnabled(); 28 | DILong getSize(); 29 | string getFormatLabel(); 30 | 31 | DIInt getGCRFormat(); 32 | 33 | bool read(DILong pos, DIChar *buf, DIInt num); 34 | bool write(DILong pos, const DIChar *buf, DIInt num); 35 | 36 | bool readTag(DILong pos, DIChar *buf, DIInt num); 37 | bool writeTag(DILong pos, const DIChar *buf, DIInt num); 38 | 39 | private: 40 | DIBackingStore *backingStore; 41 | 42 | DIInt gcrFormat; 43 | 44 | DILong imageOffset; 45 | DILong imageSize; 46 | 47 | DILong tagOffset; 48 | DILong tagSize; 49 | }; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIDiskIO.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III Disk I/O 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements Apple III Disk I/O 9 | */ 10 | 11 | #ifndef _APPLEIIIDISKIO_H 12 | #define _APPLEIIIDISKIO_H 13 | 14 | #include "AppleDiskIIInterfaceCard.h" 15 | 16 | class AppleIIIDiskIO : public AppleDiskIIInterfaceCard 17 | { 18 | public: 19 | AppleIIIDiskIO(); 20 | 21 | bool setRef(string name, OEComponent *ref); 22 | 23 | bool init(); 24 | 25 | void notify(OEComponent *sender, int notification, void *data); 26 | 27 | OEChar read(OEAddress address); 28 | void write(OEAddress address, OEChar value); 29 | 30 | private: 31 | OEComponent *systemControl; 32 | OEComponent *video; 33 | 34 | bool appleIIMode; 35 | 36 | OEInt driveSelect; 37 | 38 | void updateSwitches(OEAddress address); 39 | 40 | void setDriveSelect(OEInt index, bool value); 41 | void updateDriveSelect(); 42 | void setDriveSide2(bool value); 43 | 44 | void setENSIO(bool value); 45 | void setENSEL(bool value); 46 | void setVideoCharacterWrite(bool value); 47 | void setVideoScroll(bool value); 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleSilentype.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple Silentype 5 | * (C) 2011-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple Silentype printer 9 | */ 10 | 11 | #include "OEComponent.h" 12 | #include "OEImage.h" 13 | 14 | class AppleSilentype : public OEComponent 15 | { 16 | public: 17 | AppleSilentype(); 18 | 19 | bool setValue(string name, string value); 20 | bool getValue(string name, string &value); 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | void notify(OEComponent *sender, int notification, void *data); 25 | 26 | OEChar read(OEAddress address); 27 | void write(OEAddress address, OEChar value); 28 | 29 | private: 30 | OEComponent *device; 31 | OEComponent *canvas; 32 | 33 | bool data; 34 | bool shiftClock; 35 | bool storeClock; 36 | 37 | OEShort shiftRegister; 38 | OEShort parallelRegister; 39 | 40 | OEInt headDrivePhaseControl; 41 | OEInt paperDrivePhaseControl; 42 | OEInt headDotControl; 43 | 44 | OEPoint printPosition; 45 | 46 | void updateData(); 47 | void updateParallel(); 48 | 49 | void updateStepper(float& position, OEInt phaseControl); 50 | }; 51 | -------------------------------------------------------------------------------- /src/libdiskimage/DIDiskStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Disk Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the disk storage interface 9 | */ 10 | 11 | #ifndef _DIDISKSTORAGE_H 12 | #define _DIDISKSTORAGE_H 13 | 14 | #include "DICommon.h" 15 | 16 | typedef enum 17 | { 18 | DI_8_INCH, 19 | DI_525_INCH, 20 | DI_35_INCH, 21 | DI_3_INCH, 22 | } DIDiskType; 23 | 24 | typedef enum 25 | { 26 | DI_BLANK, 27 | DI_BITSTREAM_250000BPS, 28 | DI_BITSTREAM_500000BPS, 29 | DI_LOGICAL, 30 | DI_APPLE_DOS32, 31 | DI_APPLE_DOS33, 32 | DI_APPLE_CPM, 33 | DI_APPLE_PRODOS, 34 | DI_APPLE_NIB, 35 | } DITrackFormat; 36 | 37 | typedef struct 38 | { 39 | DITrackFormat format; 40 | DIData data; 41 | } DITrack; 42 | 43 | class DIDiskStorage 44 | { 45 | public: 46 | DIDiskStorage(); 47 | 48 | virtual bool isWriteEnabled(); 49 | virtual DIDiskType getDiskType(); 50 | virtual DIInt getTracksPerInch(); 51 | virtual string getFormatLabel(); 52 | virtual DILong getOptimalBitTiming(); 53 | 54 | virtual bool readTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 55 | virtual bool writeTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 56 | }; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/libdiskimage/DILogicalDiskStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * RAW Disk Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a RAW disk image 9 | */ 10 | 11 | #ifndef _DILOGICALDISKSTORAGE_H 12 | #define _DILOGICALDISKSTORAGE_H 13 | 14 | #include "DICommon.h" 15 | #include "DIBackingStore.h" 16 | #include "DIDiskStorage.h" 17 | 18 | class DILogicalDiskStorage : public DIDiskStorage 19 | { 20 | public: 21 | DILogicalDiskStorage(); 22 | 23 | bool open(DIBackingStore *backingStore, 24 | DIDiskType diskType, DIInt headNum, 25 | DIInt tracksPerInch, DITrackFormat trackFormat, DIInt trackSize); 26 | void close(); 27 | 28 | bool isWriteEnabled(); 29 | DIDiskType getDiskType(); 30 | DIInt getTracksPerInch(); 31 | string getFormatLabel(); 32 | 33 | DITrackFormat getTrackFormat(); 34 | 35 | bool readTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 36 | bool writeTrack(DIInt headIndex, DIInt trackIndex, DITrack& track); 37 | 38 | private: 39 | DIBackingStore *backingStore; 40 | 41 | DIDiskType diskType; 42 | DIInt headNum; 43 | DIInt tracksPerInch; 44 | 45 | DITrackFormat trackFormat; 46 | DIInt trackSize; 47 | }; 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AudioPlayer.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Audio player 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an audio player 9 | */ 10 | 11 | #include "OEComponent.h" 12 | #include "OESound.h" 13 | 14 | #include "AudioInterface.h" 15 | 16 | #include "samplerate.h" 17 | 18 | class AudioPlayer : public OEComponent 19 | { 20 | public: 21 | AudioPlayer(); 22 | 23 | bool setValue(string name, string value); 24 | bool getValue(string name, string value); 25 | bool setRef(string name, OEComponent *ref); 26 | bool setData(string name, OEData *data); 27 | bool init(); 28 | 29 | bool postMessage(OEComponent *sender, int message, void *data); 30 | 31 | void notify(OEComponent *sender, int notification, void *data); 32 | 33 | private: 34 | OEComponent *audio; 35 | OEComponent *controlBus; 36 | 37 | bool playing; 38 | bool loop; 39 | float volume; 40 | OEInt frameIndex; 41 | 42 | OESound *sound; 43 | OESound loadedSound; 44 | 45 | int srcChannelNum; 46 | SRC_STATE *srcState; 47 | bool srcEndOfInput; 48 | 49 | AudioBuffer *audioBuffer; 50 | OEInt audioBufferFrame; 51 | 52 | void updateAudio(bool bufferDidRender); 53 | }; 54 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/ATAController.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * ATA Controller 5 | * (C) 2011-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a generic ATA Controller 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "diskimage.h" 14 | 15 | #define ATA_BUFFER_SIZE 0x200 16 | 17 | class ATAController : public OEComponent 18 | { 19 | public: 20 | ATAController(); 21 | 22 | bool setRef(string name, OEComponent *ref); 23 | bool init(); 24 | void update(); 25 | 26 | OEChar read(OEAddress address); 27 | void write(OEAddress address, OEChar value); 28 | OEShort read16(OEAddress address); 29 | void write16(OEAddress address, OEShort value); 30 | 31 | private: 32 | OEComponent *drive[2]; 33 | 34 | DIATABlockStorage *blockStorage; 35 | DIATABlockStorage dummyBlockStorage; 36 | 37 | OEChar feature; 38 | OEChar status; 39 | OEChar command; 40 | 41 | OEUnion lba; 42 | OEChar sectorCount; 43 | 44 | OEChar buffer[ATA_BUFFER_SIZE]; 45 | OEInt bufferIndex; 46 | 47 | bool driveSel; 48 | OEInt addressMode; 49 | bool pioByteMode; 50 | 51 | void selectDrive(OEInt value); 52 | void setATAString(char *dest, const char *src, OEInt size); 53 | }; 54 | -------------------------------------------------------------------------------- /cmake/FindLibSampleRate.cmake: -------------------------------------------------------------------------------- 1 | # This file is copyrighted under the BSD-license for buildsystem files of KDE 2 | # copyright 2010, Patrick von Reth 3 | # 4 | # 5 | # - Try to find the libsamplerate library 6 | # Once done this will define 7 | # 8 | # LIBSAMPLERATE_FOUND Set to TRUE if libsamplerate librarys and include directory is found 9 | # LIBSAMPLERATE_LIBRARY The libsamplerate librarys 10 | # LIBSAMPLERATE_INCLUDE_DIR The libsamplerate include directory 11 | 12 | find_package(PkgConfig) 13 | pkg_check_modules(PC_LIBSAMPLERATE QUIET libsamplerate) 14 | set(LIBSAMPLERATE_DEFINITIONS ${PC_LIBSAMPLERATE_CFLAGS_OTHER}) 15 | 16 | find_library(LIBSAMPLERATE_LIBRARY NAMES samplerate libsamplerate-0 samplerate-0 17 | HINTS ${PC_LIBSAMPLERATE_LIBDIR} ${PC_LIBSAMPLERATE_LIBRARY_DIRS}) 18 | 19 | find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h 20 | HINTS ${PC_LIBSAMPLERATE_INCLUDEDIR} ${PC_LIBSAMPLERATE_INCLUDE_DIRS}) 21 | 22 | if(LIBSAMPLERATE_LIBRARY AND LIBSAMPLERATE_INCLUDE_DIR) 23 | set(LIBSAMPLERATE_FOUND TRUE) 24 | message(STATUS "Found libsamplerate ${LIBSAMPLERATE_LIBRARY}") 25 | else(LIBSAMPLERATE_LIBRARY AND LIBSAMPLERATE_PLUGIN_PATH) 26 | message(STATUS "Could not find libsamplerate, get it http://www.mega-nerd.com/SRC/") 27 | endif(LIBSAMPLERATE_LIBRARY AND LIBSAMPLERATE_INCLUDE_DIR) -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/DeviceInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Device interface 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the device interface 9 | */ 10 | 11 | #ifndef _DEVICEINTERFACE_H 12 | #define _DEVICEINTERFACE_H 13 | 14 | #include 15 | #include 16 | 17 | #include "OEComponent.h" 18 | 19 | using namespace std; 20 | 21 | typedef enum 22 | { 23 | DEVICE_SET_LABEL, 24 | DEVICE_GET_LABEL, 25 | DEVICE_SET_IMAGEPATH, 26 | DEVICE_GET_IMAGEPATH, 27 | DEVICE_SET_LOCATIONLABEL, 28 | DEVICE_GET_LOCATIONLABEL, 29 | DEVICE_SET_STATELABEL, 30 | DEVICE_GET_STATELABEL, 31 | 32 | DEVICE_SET_SETTINGS, 33 | DEVICE_GET_SETTINGS, 34 | 35 | DEVICE_CONSTRUCT_DISPLAYCANVAS, 36 | DEVICE_CONSTRUCT_PAPERCANVAS, 37 | DEVICE_CONSTRUCT_OPENGLCANVAS, 38 | DEVICE_DESTROY_CANVAS, 39 | DEVICE_GET_CANVASES, 40 | 41 | DEVICE_ADD_STORAGE, 42 | DEVICE_REMOVE_STORAGE, 43 | DEVICE_GET_STORAGES, 44 | 45 | DEVICE_UPDATE, 46 | } DeviceMessage; 47 | 48 | typedef struct 49 | { 50 | OEComponent *component; 51 | string name; 52 | string label; 53 | string type; 54 | string options; 55 | } DeviceSetting; 56 | 57 | typedef vector DeviceSettings; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOS6551.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOS6551 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a MOS 6551 ACIA 9 | */ 10 | 11 | #ifndef _MOS6551_H 12 | #define _MOS6551_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class MOS6551 : public OEComponent 17 | { 18 | public: 19 | MOS6551(); 20 | 21 | bool setValue(string name, string value); 22 | bool getValue(string name, string& value); 23 | bool setRef(string name, OEComponent *ref); 24 | bool init(); 25 | 26 | bool postMessage(OEComponent *sender, int message, void *data); 27 | 28 | void notify(OEComponent *sender, int notification, void *data); 29 | 30 | OEChar read(OEAddress address); 31 | void write(OEAddress address, OEChar value); 32 | 33 | private: 34 | OEComponent *controlBus; 35 | OEComponent *dce; 36 | 37 | OEChar transmitData; 38 | OEChar receiveData; 39 | 40 | OEChar control; 41 | OEChar command; 42 | OEChar status; 43 | 44 | bool cts; 45 | 46 | void hardReset(); 47 | void softReset(); 48 | 49 | void sendData(); 50 | void setCommand(OEChar value); 51 | void setIRQ(bool value); 52 | 53 | bool isTransmitInt(); 54 | bool isRTS(); 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/AE/AERamFactor.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Applied Engineering RamFactor Card 5 | * (C) 2017 by Zellyn Hunter (zellyn@gmail.com) 6 | * Released under the GPL 7 | * 8 | * Controls an Applied Engineering RamFactor Card 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | class AERamFactor : public OEComponent 16 | { 17 | public: 18 | AERamFactor(); 19 | 20 | bool setValue(string name, string value); 21 | bool getValue(string name, string& value); 22 | bool setRef(string name, OEComponent *ref); 23 | bool init(); 24 | void dispose(); 25 | 26 | void notify(OEComponent *sender, int notification, void *data); 27 | 28 | OEChar read(OEAddress address); 29 | void write(OEAddress address, OEChar value); 30 | 31 | void enableRamFactor(bool value); 32 | void updateRamFactor(bool value); 33 | 34 | void setFirmwareBank(OEChar value); 35 | void updateBankOffset(); 36 | OEAddress incAddr(); 37 | void setAddressByte(int n, OEChar value); 38 | OEChar getAddressByte(int n); 39 | 40 | private: 41 | OEComponent *controlBus; 42 | OEComponent *floatingBus; 43 | OEComponent *bankSwitcher; 44 | OEComponent *ram; 45 | 46 | OEAddress address; 47 | OEChar bank; 48 | size_t size; 49 | OEAddress hiOr; 50 | }; 51 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIDisableC800.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Disable C800 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Disables Apple II slot expansion memory ($C800-$CFFF) 9 | */ 10 | 11 | #include "AppleIIDisableC800.h" 12 | 13 | #include "AppleIIInterface.h" 14 | 15 | AppleIIDisableC800::AppleIIDisableC800() 16 | { 17 | memory = NULL; 18 | memoryBus = NULL; 19 | } 20 | 21 | bool AppleIIDisableC800::setRef(string name, OEComponent *ref) 22 | { 23 | if (name == "memory") 24 | memory = ref; 25 | else if (name == "memoryBus") 26 | memoryBus = ref; 27 | else 28 | return false; 29 | 30 | return true; 31 | } 32 | 33 | bool AppleIIDisableC800::init() 34 | { 35 | OECheckComponent(memory); 36 | OECheckComponent(memoryBus); 37 | 38 | return true; 39 | } 40 | 41 | OEChar AppleIIDisableC800::read(OEAddress address) 42 | { 43 | memory->postMessage(this, APPLEII_DISABLE_C800, NULL); 44 | 45 | // Re-read to disable other cards if necessary 46 | return memoryBus->read(address); 47 | } 48 | 49 | void AppleIIDisableC800::write(OEAddress address, OEChar value) 50 | { 51 | memory->postMessage(this, APPLEII_DISABLE_C800, NULL); 52 | 53 | // Re-write to disable other cards if necessary 54 | return memoryBus->write(address, value); 55 | } 56 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleLanguageCard.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple Language Card 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple Language Card 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | class AppleLanguageCard : public OEComponent 16 | { 17 | public: 18 | AppleLanguageCard(); 19 | 20 | bool setValue(string name, string value); 21 | bool getValue(string name, string& value); 22 | bool setRef(string name, OEComponent *ref); 23 | bool init(); 24 | void dispose(); 25 | 26 | void notify(OEComponent *sender, int notification, void *data); 27 | 28 | OEChar read(OEAddress address); 29 | void write(OEAddress address, OEChar value); 30 | 31 | void enableLanguageCard(bool value); 32 | void updateLanguageCard(bool value); 33 | 34 | private: 35 | OEComponent *controlBus; 36 | OEComponent *memoryBus; 37 | OEComponent *floatingBus; 38 | OEComponent *bankSwitcher; 39 | OEComponent *io; 40 | 41 | bool bank1; 42 | bool ramRead; 43 | bool preWrite; 44 | bool ramWrite; 45 | MemoryMap ramMap; 46 | 47 | bool titanIII; 48 | MemoryMap slot0Map; 49 | 50 | void setBank1(bool value); 51 | void updateBankOffset(); 52 | void updateBankSwitcher(); 53 | }; 54 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOS6502.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOS6502 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Emulates a MOS6502 microprocessor 9 | */ 10 | 11 | #ifndef _MOS6502_H 12 | #define _MOS6502_H 13 | 14 | #include "OEComponent.h" 15 | #include "ControlBusInterface.h" 16 | 17 | class MOS6502 : public OEComponent 18 | { 19 | public: 20 | MOS6502(); 21 | 22 | bool setValue(string name, string value); 23 | bool getValue(string name, string& value); 24 | bool setRef(string name, OEComponent *ref); 25 | bool init(); 26 | 27 | bool postMessage(OEComponent *sender, int message, void *data); 28 | 29 | void notify(OEComponent *sender, int notification, void *data); 30 | 31 | protected: 32 | OEChar a; 33 | OEChar x; 34 | OEChar y; 35 | OEChar p; 36 | OEUnion pc; 37 | OEUnion sp; 38 | 39 | OEComponent *controlBus; 40 | OEComponent *memoryBus; 41 | 42 | OESLong icount; 43 | 44 | ControlBusPowerState powerState; 45 | 46 | bool isReset; 47 | bool isResetTransition; 48 | bool isIRQ; 49 | bool isIRQEnabled; 50 | bool isNMITransition; 51 | 52 | bool isSpecialCondition; 53 | 54 | void initCPU(); 55 | void updateSpecialCondition(); 56 | virtual void execute(); 57 | }; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/Proxy.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Proxy 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls a message proxy 9 | */ 10 | 11 | #include "Proxy.h" 12 | 13 | Proxy::Proxy() 14 | { 15 | } 16 | 17 | bool Proxy::setRef(string name, OEComponent *ref) 18 | { 19 | if (name == "component") 20 | component = ref; 21 | else 22 | return false; 23 | 24 | return true; 25 | } 26 | 27 | bool Proxy::init() 28 | { 29 | OECheckComponent(component); 30 | 31 | return true; 32 | } 33 | 34 | bool Proxy::postMessage(OEComponent *sender, int message, void *data) 35 | { 36 | return component->postMessage(sender, message, data); 37 | } 38 | 39 | bool Proxy::addObserver(OEComponent *observer, int notification) 40 | { 41 | if (!component->addObserver(observer, notification)) 42 | return false; 43 | 44 | return OEComponent::addObserver(observer, notification); 45 | } 46 | 47 | bool Proxy::removeObserver(OEComponent *observer, int notification) 48 | { 49 | if (!component->removeObserver(observer, notification)) 50 | return false; 51 | 52 | return OEComponent::addObserver(observer, notification); 53 | } 54 | 55 | void Proxy::notify(OEComponent *sender, int notification, void *data) 56 | { 57 | postNotification(this, notification, data); 58 | } 59 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIGamePort.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Game Port 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an Apple II Game Port 9 | */ 10 | 11 | #ifndef _APPLEIIGAMEPORT_H 12 | #define _APPLEIIGAMEPORT_H 13 | 14 | #include "OEComponent.h" 15 | 16 | #define APPLEIIGAMEPORT_MINVALUE (0 * 11 + 8) 17 | #define APPLEIIGAMEPORT_MAXVALUE (255 * 11 + 8) 18 | 19 | class AppleIIGamePort : public OEComponent 20 | { 21 | public: 22 | AppleIIGamePort(); 23 | 24 | bool setValue(string name, string value); 25 | bool getValue(string name, string& value); 26 | bool setRef(string name, OEComponent *ref); 27 | bool init(); 28 | 29 | bool postMessage(OEComponent *sender, int message, void *data); 30 | void notify(OEComponent *sender, int notification, void *data); 31 | 32 | OEChar read(OEAddress address); 33 | void write(OEAddress address, OEChar value); 34 | 35 | protected: 36 | OEComponent *controlBus; 37 | OEComponent *floatingBus; 38 | OEComponent *gamePort; 39 | 40 | float pdl[4]; 41 | bool pb[4]; 42 | bool an[4]; 43 | 44 | OELong timerStart; 45 | 46 | void setAN(OELong index, bool value); 47 | void setPDL(OELong index, float value); 48 | void setPB(OELong index, bool value); 49 | bool isTimerPending(OELong index); 50 | void resetTimer(); 51 | }; 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/libdiskimage/DICommon.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * Common types and functions 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Common types and functions 9 | */ 10 | 11 | #ifndef _DICOMMON_H 12 | #define _DICOMMON_H 13 | 14 | #define DI_VERSION "1.0" 15 | 16 | #include 17 | #include 18 | 19 | #include "util.h" 20 | 21 | using namespace std; 22 | 23 | typedef unsigned char DIChar; 24 | typedef unsigned short DIShort; 25 | typedef unsigned int DIInt; 26 | typedef unsigned long long DILong; 27 | 28 | typedef signed char DISChar; 29 | typedef signed short DISShort; 30 | typedef signed int DISInt; 31 | typedef signed long long DISLong; 32 | 33 | typedef vector DIData; 34 | 35 | DIInt getDIInt(const string& value); 36 | DILong getDILong(const string& value); 37 | string getDIString(DIInt value); 38 | string getDIString(DILong value); 39 | string getDIString(float value); 40 | 41 | DIShort getDIShortLE(DIChar *p); 42 | DIShort getDIShortBE(DIChar *p); 43 | DIInt getDIIntLE(DIChar *p); 44 | DIInt getDIIntBE(DIChar *p); 45 | DILong getDILongLE(DIChar *p); 46 | DILong getDILongBE(DIChar *p); 47 | 48 | void setDIShortLE(DIChar *p, DIShort value); 49 | void setDIShortBE(DIChar *p, DIShort value); 50 | void setDIIntLE(DIChar *p, DIInt value); 51 | void setDIIntBE(DIChar *p, DIInt value); 52 | void setDILongLE(DIChar *p, DILong value); 53 | void setDILongBE(DIChar *p, DILong value); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIAddressDecoder.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple II Address Decoder 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple II Address Decoder 9 | */ 10 | 11 | #include "AppleIIAddressDecoder.h" 12 | 13 | #include "AppleIIInterface.h" 14 | 15 | AppleIIAddressDecoder::AppleIIAddressDecoder() : AddressDecoder() 16 | { 17 | } 18 | 19 | bool AppleIIAddressDecoder::postMessage(OEComponent *sender, int message, void *data) 20 | { 21 | switch (message) 22 | { 23 | case ADDRESSDECODER_MAP: 24 | return addMemoryMap(externalMemoryMaps, (MemoryMap *) data); 25 | 26 | case ADDRESSDECODER_UNMAP: 27 | return removeMemoryMap(externalMemoryMaps, (MemoryMap *) data); 28 | 29 | case APPLEII_MAP_SLOT: 30 | return addMemoryMap(ioMemoryMaps, (MemoryMap *) data); 31 | 32 | case APPLEII_UNMAP_SLOT: 33 | return removeMemoryMap(ioMemoryMaps, (MemoryMap *) data); 34 | } 35 | 36 | return false; 37 | } 38 | 39 | void AppleIIAddressDecoder::updateReadWriteMap(OEAddress startAddress, OEAddress endAddress) 40 | { 41 | AddressDecoder::updateReadWriteMap(internalMemoryMaps, startAddress, endAddress); 42 | AddressDecoder::updateReadWriteMap(ioMemoryMaps, startAddress, endAddress); 43 | AddressDecoder::updateReadWriteMap(externalMemoryMaps, startAddress, endAddress); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/libdiskimage/DIVDIBlockStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * VDI Block Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a VDI block storage 9 | */ 10 | 11 | #ifndef DIVDIBLOCKSTORAGE_H 12 | #define DIVDIBLOCKSTORAGE_H 13 | 14 | #include "DICommon.h" 15 | #include "DIBackingStore.h" 16 | #include "DIBlockStorage.h" 17 | 18 | typedef enum 19 | { 20 | DI_VDI_DYNAMIC = 1, 21 | DI_VDI_STATIC, 22 | } DIVDIFormat; 23 | 24 | class DIVDIBlockStorage : public DIBlockStorage 25 | { 26 | public: 27 | DIVDIBlockStorage(); 28 | 29 | bool open(DIBackingStore *backingStore); 30 | void close(); 31 | 32 | bool isWriteEnabled(); 33 | DIInt getBlockNum(); 34 | string getFormatLabel(); 35 | 36 | DIInt getCylinders(); 37 | DIInt getHeads(); 38 | DIInt getSectors(); 39 | 40 | bool readBlocks(DIInt index, DIChar *buf, DIInt num); 41 | bool writeBlocks(DIInt index, const DIChar *buf, DIInt num); 42 | 43 | private: 44 | DIBackingStore *backingStore; 45 | 46 | DIInt blockNum; 47 | 48 | DIInt cylinders; 49 | DIInt heads; 50 | DIInt sectors; 51 | 52 | DIInt vdiDataOffset; 53 | DIInt vdiBlockMapOffset; 54 | DIInt vdiBlockSize; 55 | DIInt vdiAllocatedBlockNum; 56 | 57 | vector vdiBlockMap; 58 | 59 | bool isBlockEmpty(const DIChar *buf); 60 | DIInt allocateVDIBlock(DIInt vdiBlockMapIndex); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/c++,cmake,macos 3 | # Edit at https://www.gitignore.io/?templates=c++,cmake,macos 4 | 5 | ### C++ ### 6 | # Prerequisites 7 | *.d 8 | 9 | # Compiled Object files 10 | *.slo 11 | *.lo 12 | *.o 13 | *.obj 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Compiled Dynamic libraries 20 | *.so 21 | *.dylib 22 | *.dll 23 | 24 | # Fortran module files 25 | *.mod 26 | *.smod 27 | 28 | # Compiled Static libraries 29 | *.lai 30 | *.la 31 | *.a 32 | *.lib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | 39 | ### CMake ### 40 | CMakeLists.txt.user 41 | CMakeCache.txt 42 | CMakeFiles 43 | CMakeScripts 44 | Testing 45 | Makefile 46 | cmake_install.cmake 47 | install_manifest.txt 48 | compile_commands.json 49 | CTestTestfile.cmake 50 | _deps 51 | 52 | ### CMake Patch ### 53 | # External projects 54 | *-prefix/ 55 | 56 | ### macOS ### 57 | # General 58 | .DS_Store 59 | .AppleDouble 60 | .LSOverride 61 | 62 | # Icon must end with two \r 63 | Icon 64 | 65 | # Thumbnails 66 | ._* 67 | 68 | # Files that might appear in the root of a volume 69 | .DocumentRevisions-V100 70 | .fseventsd 71 | .Spotlight-V100 72 | .TemporaryItems 73 | .Trashes 74 | .VolumeIcon.icns 75 | .com.apple.timemachine.donotpresent 76 | 77 | # Directories potentially created on remote AFP share 78 | .AppleDB 79 | .AppleDesktop 80 | Network Trash Folder 81 | Temporary Items 82 | .apdisk 83 | 84 | # End of https://www.gitignore.io/api/c++,cmake,macos 85 | 86 | # Project-specific 87 | build/ 88 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Generic/PIAInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * PIA interface 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the PIA interface 9 | */ 10 | 11 | typedef enum 12 | { 13 | MC6821_SET_CA1, 14 | MC6821_SET_CA2, 15 | MC6821_GET_CA2, 16 | MC6821_GET_PA, 17 | 18 | MC6821_SET_CB1, 19 | MC6821_SET_CB2, 20 | MC6821_GET_CB2, 21 | MC6821_GET_PB, 22 | } PIAMessage; 23 | 24 | // Notifications 25 | typedef enum 26 | { 27 | MC6821_CA2_DID_CHANGE, 28 | MC6821_CB2_DID_CHANGE, 29 | } MC6821Notification; 30 | 31 | #define MC6821_PORTA 0x00 32 | #define MC6821_PORTB 0x01 33 | 34 | #define MC6821_RS_DATAREGISTERA 0x00 35 | #define MC6821_RS_CONTROLREGISTERA 0x01 36 | #define MC6821_RS_DATAREGISTERB 0x02 37 | #define MC6821_RS_CONTROLREGISTERB 0x03 38 | 39 | #define MC6821_CR_C1ENABLEIRQ 0x01 40 | #define MC6821_CR_C1LOWTOHIGH 0x02 41 | #define MC6821_CR_DATAREGISTER 0x04 42 | #define MC6821_CR_C2ENABLEIRQ 0x08 // If C2OUTPUT is clear 43 | #define MC6821_CR_C2LOWTOHIGH 0x10 // If C2OUTPUT is clear 44 | #define MC6821_CR_C2ERESTORE 0x08 // If C2OUTPUT is set and C2DIRECT is clear 45 | #define MC6821_CR_C2SET 0x08 // If C2OUTPUT is set and C2DIRECT is set 46 | #define MC6821_CR_C2DIRECT 0x10 // If C2OUTPUT is set 47 | #define MC6821_CR_C2OUTPUT 0x20 48 | #define MC6821_CR_IRQ2FLAG 0x40 49 | #define MC6821_CR_IRQ1FLAG 0x80 50 | 51 | #define MC6821_CR_IRQFLAGS (MC6821_CR_IRQ2FLAG | MC6821_CR_IRQ1FLAG) 52 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIRTC.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III RTC 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple III RTC 9 | */ 10 | 11 | #include "AppleIIIRTC.h" 12 | 13 | #include "AppleIIIInterface.h" 14 | 15 | AppleIIIRTC::AppleIIIRTC() 16 | { 17 | systemControl = NULL; 18 | mm58167 = NULL; 19 | } 20 | 21 | bool AppleIIIRTC::setRef(string name, OEComponent *ref) 22 | { 23 | if (name == "systemControl") 24 | { 25 | if (systemControl) 26 | systemControl->removeObserver(this, APPLEIII_ZEROPAGE_DID_CHANGE); 27 | systemControl = ref; 28 | if (systemControl) 29 | systemControl->addObserver(this, APPLEIII_ZEROPAGE_DID_CHANGE); 30 | } 31 | else if (name == "mm58167") 32 | mm58167 = ref; 33 | else 34 | return false; 35 | 36 | return true; 37 | } 38 | 39 | bool AppleIIIRTC::init() 40 | { 41 | OECheckComponent(systemControl); 42 | OECheckComponent(mm58167); 43 | 44 | systemControl->postMessage(this, APPLEIII_GET_ZEROPAGE, &zeroPage); 45 | 46 | return true; 47 | } 48 | 49 | void AppleIIIRTC::notify(OEComponent *sender, int notification, void *data) 50 | { 51 | zeroPage = *((OEChar *)data); 52 | } 53 | 54 | OEChar AppleIIIRTC::read(OEAddress address) 55 | { 56 | return mm58167->read(zeroPage); 57 | } 58 | 59 | void AppleIIIRTC::write(OEAddress address, OEChar value) 60 | { 61 | mm58167->write(zeroPage, value); 62 | } 63 | -------------------------------------------------------------------------------- /src/libdiskimage/DIRAMBackingStore.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * RAM Backing Store 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a RAM backing store 9 | */ 10 | 11 | #include "DIRAMBackingStore.h" 12 | 13 | DIRAMBackingStore::DIRAMBackingStore() 14 | { 15 | close(); 16 | } 17 | 18 | bool DIRAMBackingStore::open(DIData& data) 19 | { 20 | close(); 21 | 22 | this->data.swap(data); 23 | 24 | return true; 25 | } 26 | 27 | void DIRAMBackingStore::create() 28 | { 29 | data.clear(); 30 | } 31 | 32 | void DIRAMBackingStore::close() 33 | { 34 | } 35 | 36 | bool DIRAMBackingStore::isWriteEnabled() 37 | { 38 | return true; 39 | } 40 | 41 | DILong DIRAMBackingStore::getSize() 42 | { 43 | return data.size(); 44 | } 45 | 46 | string DIRAMBackingStore::getFormatLabel() 47 | { 48 | string formatLabel = "Raw Disk Image"; 49 | 50 | if (!isWriteEnabled()) 51 | formatLabel += " (read-only)"; 52 | 53 | return formatLabel; 54 | } 55 | 56 | bool DIRAMBackingStore::read(DILong pos, DIChar *buf, DIInt num) 57 | { 58 | if ((pos + num) > data.size()) 59 | return false; 60 | 61 | memcpy((char *) buf, &data.front() + pos, (size_t) num); 62 | 63 | return true; 64 | } 65 | 66 | bool DIRAMBackingStore::write(DILong pos, const DIChar *buf, DIInt num) 67 | { 68 | if ((pos + num) >= data.size()) 69 | data.resize((size_t) pos + num); 70 | 71 | memcpy(&data.front() + pos, buf, (size_t) num); 72 | 73 | return true; 74 | } 75 | -------------------------------------------------------------------------------- /src/libdiskimage/DIRAWBlockStorage.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * RAW Block Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a RAW block storage 9 | */ 10 | 11 | #include "DIRAWBlockStorage.h" 12 | 13 | DIRAWBlockStorage::DIRAWBlockStorage() 14 | { 15 | close(); 16 | } 17 | 18 | bool DIRAWBlockStorage::open(DIBackingStore *backingStore) 19 | { 20 | close(); 21 | 22 | // Check size for multiple of DI_BLOCKSIZE 23 | if (backingStore->getSize() % DI_BLOCKSIZE) 24 | return false; 25 | 26 | this->backingStore = backingStore; 27 | 28 | blockNum = (DIInt) (backingStore->getSize() / DI_BLOCKSIZE); 29 | 30 | return true; 31 | } 32 | 33 | void DIRAWBlockStorage::close() 34 | { 35 | backingStore = NULL; 36 | } 37 | 38 | bool DIRAWBlockStorage::isWriteEnabled() 39 | { 40 | return backingStore->isWriteEnabled(); 41 | } 42 | 43 | DIInt DIRAWBlockStorage::getBlockNum() 44 | { 45 | return blockNum; 46 | } 47 | 48 | string DIRAWBlockStorage::getFormatLabel() 49 | { 50 | return backingStore->getFormatLabel(); 51 | } 52 | 53 | bool DIRAWBlockStorage::readBlocks(DIInt index, DIChar *buf, DIInt num) 54 | { 55 | return backingStore->read(index * DI_BLOCKSIZE, buf, num * DI_BLOCKSIZE); 56 | } 57 | 58 | bool DIRAWBlockStorage::writeBlocks(DIInt index, const DIChar *buf, DIInt num) 59 | { 60 | if ((index + num) > blockNum) 61 | return false; 62 | 63 | return backingStore->write(index * DI_BLOCKSIZE, buf, num * DI_BLOCKSIZE); 64 | } 65 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/RAM.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * RAM 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls random access memory. 9 | */ 10 | 11 | #ifndef _RAM_H 12 | #define _RAM_H 13 | 14 | #include "OEComponent.h" 15 | 16 | #include "ControlBusInterface.h" 17 | 18 | // Notes: 19 | // * size is the RAM size. It must be a power of two. 20 | // * To determine the power state, set the controlBus. 21 | // * powerOnPattern is the byte pattern used when power is first applied. 22 | // * image is the RAM image. 23 | 24 | class RAM : public OEComponent 25 | { 26 | public: 27 | RAM(); 28 | 29 | bool setValue(string name, string value); 30 | bool getValue(string name, string &value); 31 | bool setRef(string name, OEComponent *ref); 32 | bool setData(string name, OEData *data); 33 | bool getData(string name, OEData **data); 34 | bool init(); 35 | void update(); 36 | 37 | bool postMessage(OEComponent *sender, int message, void *data); 38 | 39 | void notify(OEComponent *sender, int notification, void *data); 40 | 41 | OEChar read(OEAddress address); 42 | void write(OEAddress address, OEChar value); 43 | 44 | protected: 45 | OEAddress size; 46 | 47 | OEChar *datap; 48 | OEAddress mask; 49 | 50 | private: 51 | OEData powerOnPattern; 52 | 53 | OEComponent *controlBus; 54 | 55 | OEData data; 56 | 57 | ControlBusPowerState powerState; 58 | 59 | void initMemory(); 60 | }; 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOS6522.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOS6522 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a MOS 6522 VIA (Versatile Interface Adaptor) 9 | */ 10 | 11 | #ifndef _MOS6522_H 12 | #define _MOS6522_H 13 | 14 | #include "OEComponent.h" 15 | 16 | // Messages 17 | typedef enum 18 | { 19 | MOS6522_GET_PA, 20 | MOS6522_SET_CA1, 21 | MOS6522_SET_CA2, 22 | 23 | MOS6522_GET_PB, 24 | MOS6522_SET_CB1, 25 | MOS6522_SET_CB2, 26 | } MOS6522Message; 27 | 28 | class MOS6522 : public OEComponent 29 | { 30 | public: 31 | MOS6522(); 32 | 33 | bool setValue(string name, string value); 34 | bool getValue(string name, string& value); 35 | bool setRef(string name, OEComponent *ref); 36 | 37 | bool postMessage(OEComponent *sender, int message, void *data); 38 | 39 | void notify(OEComponent *sender, int notification, void *data); 40 | 41 | OEChar read(OEAddress address); 42 | void write(OEAddress address, OEChar value); 43 | 44 | private: 45 | OEComponent *controlBus; 46 | OEComponent *portA; 47 | OEComponent *portB; 48 | 49 | OEAddress addressA; 50 | OEChar ddrA; 51 | OEChar dataA; 52 | bool ca1; 53 | bool ca2; 54 | 55 | OEAddress addressB; 56 | OEChar ddrB; 57 | OEChar dataB; 58 | bool cb1; 59 | bool cb2; 60 | 61 | OEChar shift; 62 | 63 | OEChar auxControl; 64 | OEChar peripheralControl; 65 | 66 | OEChar interruptFlags; 67 | OEChar interruptEnable; 68 | 69 | void updateIRQ(); 70 | }; 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/StorageInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Storage Interface 5 | * (C) 2011-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the storage interface. 9 | */ 10 | 11 | // Notes: 12 | // * isAvailable() determines if the device is available (now) for mounting images. 13 | // This is used when an emulation searches for an available device to mount an image. 14 | // * canMount() tests if an image can be mounted (at some time) in this device. 15 | // * mount() force-mounts. It should attempt to mount the image by all means. 16 | // If an error occurs, a previously mounted image should remain mounted. 17 | // * unmount() force-unmounts. It should attempt to unmount the image by all means. 18 | // * getMountPath() returns the path of the mounted image. 19 | // * isLocked() indicates if the disk is physically locked in the emulated device. 20 | // * getFormatLabel() returns a format label describing the mount. 21 | // E.g.: "16 sectors, 35 track, read-only". 22 | // * getObject() returns an object related to the storage device. 23 | // (usually the object containing the data) 24 | 25 | #ifndef _STORAGEINTERFACE_H 26 | #define _STORAGEINTERFACE_H 27 | 28 | typedef enum 29 | { 30 | STORAGE_IS_AVAILABLE, 31 | STORAGE_CAN_MOUNT, 32 | STORAGE_MOUNT, 33 | STORAGE_UNMOUNT, 34 | STORAGE_GET_MOUNTPATH, 35 | STORAGE_IS_LOCKED, 36 | 37 | STORAGE_GET_FORMATLABEL, 38 | 39 | STORAGE_GET_OPTIMALBITTIMING, 40 | 41 | STORAGE_GET_SETTINGS, 42 | 43 | STORAGE_GET_OBJECT, 44 | 45 | STORAGE_END, 46 | } StorageMessage; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AudioCodec.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Audio codec 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an 8/16 bit audio codec (ADC/DAC) 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "AudioInterface.h" 14 | 15 | class AudioCodec : public OEComponent 16 | { 17 | public: 18 | AudioCodec(); 19 | 20 | bool setValue(string name, string value); 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | void update(); 24 | 25 | void notify(OEComponent *sender, int notification, void *data); 26 | 27 | OEChar read(OEAddress address); 28 | void write(OEAddress address, OEChar value); 29 | OEShort read16(OEAddress address); 30 | void write16(OEAddress address, OEShort value); 31 | 32 | private: 33 | float timeAccuracy; 34 | float lowFrequency; 35 | float highFrequency; 36 | OEInt filterSize; 37 | 38 | OEComponent *audio; 39 | OEComponent *controlBus; 40 | 41 | AudioBuffer *audioBuffer; 42 | 43 | float sampleRate; 44 | OEInt channelNum; 45 | OEInt frameNum; 46 | OEInt sampleNum; 47 | 48 | OEInt impulseFilterSize; 49 | OEInt impulseFilterHalfSize; 50 | OEInt impulseTableEntryNum; 51 | OEInt impulseTableEntrySize; 52 | vector impulseTable; 53 | 54 | vector lastInput; 55 | vector buffer; 56 | float integrationAlpha; 57 | vector lastOutput; 58 | 59 | void updateSynth(); 60 | void setSynth(float index, OEInt channel, float level); 61 | void synthBuffer(); 62 | }; 63 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIEKeyboard.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple IIe Keyboard 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple IIe keyboard 9 | */ 10 | 11 | #ifndef _APPLEIIEKEYBOARD_H 12 | #define _APPLEIIEKEYBOARD_H 13 | 14 | #include "OEComponent.h" 15 | #include "AppleIIKeyboard.h" 16 | 17 | #include "CanvasInterface.h" 18 | 19 | #include 20 | 21 | class AppleIIEKeyboard : public OEComponent 22 | { 23 | public: 24 | AppleIIEKeyboard(); 25 | 26 | bool setValue(string name, string value); 27 | bool getValue(string name, string& value); 28 | bool setRef(string name, OEComponent *ref); 29 | bool init(); 30 | void update(); 31 | 32 | void notify(OEComponent *sender, int notification, void *data); 33 | 34 | OEChar read(OEAddress address); 35 | void write(OEAddress address, OEChar value); 36 | 37 | protected: 38 | OEComponent *controlBus; 39 | OEComponent *floatingBus; 40 | OEComponent *monitor; 41 | 42 | OEInt pressedKeypadKeyCount; 43 | 44 | OEChar keyLatch; 45 | bool keyStrobe; 46 | bool anyKeyDown; 47 | 48 | virtual void updateKeyFlags(); 49 | virtual void sendKey(CanvasUnicodeChar key); 50 | void setKeyStrobe(bool value); 51 | virtual void setReset(bool value); 52 | virtual void setAltReset(bool value); 53 | 54 | void emptyPasteBuffer(); 55 | 56 | private: 57 | OEComponent *gamePort; 58 | 59 | AppleIIKeyboardState state; 60 | OEInt stateUsageId; 61 | 62 | queue pasteBuffer; 63 | 64 | void paste(wstring *s); 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AddressMasker.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Address masker 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an address masker 9 | */ 10 | 11 | #include "AddressMasker.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | AddressMasker::AddressMasker() 16 | { 17 | memory = NULL; 18 | 19 | andMask = ~0; 20 | orMask = 0; 21 | } 22 | 23 | bool AddressMasker::setValue(string name, string value) 24 | { 25 | if (name == "andMask") 26 | andMask = getOELong(value); 27 | else if (name == "orMask") 28 | orMask = getOELong(value); 29 | else 30 | return false; 31 | 32 | return true; 33 | } 34 | 35 | bool AddressMasker::setRef(string name, OEComponent *ref) 36 | { 37 | if (name == "memory") 38 | memory = ref; 39 | else 40 | return false; 41 | 42 | return true; 43 | } 44 | 45 | bool AddressMasker::init() 46 | { 47 | OECheckComponent(memory); 48 | 49 | return true; 50 | } 51 | 52 | bool AddressMasker::postMessage(OEComponent *sender, int message, void *data) 53 | { 54 | if (message == ADDRESSMASKER_SET_ANDMASK) 55 | andMask = *((OEAddress *)data); 56 | else if (message == ADDRESSMASKER_SET_ORMASK) 57 | orMask = *((OEAddress *)data); 58 | else 59 | return false; 60 | 61 | return true; 62 | } 63 | 64 | OEChar AddressMasker::read(OEAddress address) 65 | { 66 | return memory->read((address & andMask) | orMask); 67 | } 68 | 69 | void AddressMasker::write(OEAddress address, OEChar value) 70 | { 71 | memory->write((address & andMask) | orMask, value); 72 | } 73 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Ricoh/RP2A03Operations.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * RP2A03Operations 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements RP2A03 operations. 9 | */ 10 | 11 | /*************************************************************** 12 | *************************************************************** 13 | * Macros to emulate the N2A03 opcodes 14 | *************************************************************** 15 | ***************************************************************/ 16 | 17 | /*************************************************************** 18 | * ADC Add with carry - no decimal mode 19 | ***************************************************************/ 20 | #define ADC_2A03 \ 21 | { \ 22 | int c = (P & F_C); \ 23 | int sum = A + tmp + c; \ 24 | P &= ~(F_V | F_C); \ 25 | if( ~(A^tmp) & (A^sum) & F_N ) \ 26 | P |= F_V; \ 27 | if( sum & 0xff00 ) \ 28 | P |= F_C; \ 29 | A = (UINT8) sum; \ 30 | } \ 31 | SET_NZ(A) 32 | 33 | /*************************************************************** 34 | * SBC Subtract with carry - no decimal mode 35 | ***************************************************************/ 36 | #define SBC_2A03 \ 37 | { \ 38 | int c = (P & F_C) ^ F_C; \ 39 | int sum = A - tmp - c; \ 40 | P &= ~(F_V | F_C); \ 41 | if( (A^tmp) & (A^sum) & F_N ) \ 42 | P |= F_V; \ 43 | if( (sum & 0xff00) == 0 ) \ 44 | P |= F_C; \ 45 | A = (UINT8) sum; \ 46 | } \ 47 | SET_NZ(A) 48 | -------------------------------------------------------------------------------- /src/libdiskimage/DIVMDKBlockStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * VMDK Block Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses a VMDK block storage 9 | */ 10 | 11 | #ifndef DIVMDKBLOCKSTORAGE_H 12 | #define DIVMDKBLOCKSTORAGE_H 13 | 14 | #include "DICommon.h" 15 | #include "DIBackingStore.h" 16 | #include "DIBlockStorage.h" 17 | 18 | class DIVMDKBlockStorage : public DIBlockStorage 19 | { 20 | public: 21 | DIVMDKBlockStorage(); 22 | ~DIVMDKBlockStorage(); 23 | 24 | bool open(DIBackingStore *backingStore); 25 | void close(); 26 | 27 | bool isWriteEnabled(); 28 | DIInt getBlockNum(); 29 | string getFormatLabel(); 30 | 31 | DIInt getCylinders(); 32 | DIInt getHeads(); 33 | DIInt getSectors(); 34 | 35 | bool readBlocks(DIInt index, DIChar *buf, DIInt num); 36 | bool writeBlocks(DIInt index, const DIChar *buf, DIInt num); 37 | 38 | private: 39 | DIBackingStore *backingStore; 40 | 41 | DIInt blockNum; 42 | 43 | DIInt cylinders; 44 | DIInt heads; 45 | DIInt sectors; 46 | 47 | DIInt grainSize; 48 | DIInt grainTableSize; 49 | DIInt directory1Block; 50 | DIInt directory2Block; 51 | bool redundantDirectory; 52 | DIInt allocatedBlockNum; 53 | 54 | vector metadata; 55 | 56 | DIInt directoryEntrySize; 57 | 58 | bool parseDescriptor(DIBackingStore *backingStore, 59 | DILong offset, DIInt size); 60 | bool setInUse(bool value); 61 | bool isBlockEmpty(const DIChar *buf); 62 | DIInt allocateGrain(DIInt directoryIndex, DIInt grainTableIndex); 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /cmake/FindLibZip.cmake: -------------------------------------------------------------------------------- 1 | # CMake module to search for libzip 2 | # 3 | # Once done this will define 4 | # 5 | # LIBZIP_FOUND - system has the zip library 6 | # LIBZIP_INCLUDE_DIRS - the zip include directories 7 | # LIBZIP_LIBRARY - Link this to use the zip library 8 | # 9 | # Copyright (c) 2017, Paul Blottiere, 10 | # Copyright (c) 2017, Larry Shaffer, 11 | # Add support for finding zipconf.h in separate location, e.g. on macOS 12 | # 13 | # Redistribution and use is allowed according to the terms of the BSD license. 14 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 15 | 16 | FIND_PATH(LIBZIP_INCLUDE_DIR 17 | zip.h 18 | PATHS 19 | /usr/local/include 20 | /usr/include 21 | "$ENV{LIB_DIR}/include" 22 | "$ENV{INCLUDE}" 23 | ) 24 | 25 | FIND_PATH(LIBZIP_CONF_INCLUDE_DIR 26 | zipconf.h 27 | PATHS 28 | /usr/local/lib/libzip/include 29 | /usr/lib/libzip/include 30 | "$ENV{LIB_DIR}/lib/libzip/include" 31 | "$ENV{LIB}/lib/libzip/include" 32 | /usr/local/include 33 | /usr/include 34 | "$ENV{LIB_DIR}/include" 35 | "$ENV{INCLUDE}" 36 | ) 37 | 38 | FIND_LIBRARY(LIBZIP_LIBRARY 39 | NAMES zip 40 | PATHS 41 | /usr/local/lib 42 | /usr/lib 43 | "$ENV{LIB_DIR}/lib" 44 | "$ENV{LIB}" 45 | ) 46 | 47 | IF (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR AND LIBZIP_CONF_INCLUDE_DIR) 48 | SET(LIBZIP_FOUND TRUE) 49 | SET(LIBZIP_INCLUDE_DIRS ${LIBZIP_INCLUDE_DIR} ${LIBZIP_CONF_INCLUDE_DIR}) 50 | ENDIF (LIBZIP_LIBRARY AND LIBZIP_INCLUDE_DIR AND LIBZIP_CONF_INCLUDE_DIR) 51 | 52 | IF (LIBZIP_FOUND) 53 | MESSAGE(STATUS "Found libzip: ${LIBZIP_LIBRARY}") 54 | ELSE (LIPZIP_FOUND) 55 | MESSAGE(FATAL_ERROR "Could not find libzip") 56 | ENDIF (LIBZIP_FOUND) -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIEMMU.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple IIe MMU softswitch handler. 5 | * (C) 2017 by Zellyn Hunter (zellyn@gmail.com) 6 | * Released under the GPL 7 | * 8 | * Controls MMU (and IOU) softswitch setting/resetting/reading. 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "MemoryInterface.h" 14 | 15 | class AppleIIEMMU : public OEComponent 16 | { 17 | public: 18 | AppleIIEMMU(); 19 | 20 | bool setValue(string name, string value); 21 | bool getValue(string name, string& value); 22 | bool setRef(string name, OEComponent *ref); 23 | bool init(); 24 | 25 | void notify(OEComponent *sender, int notification, void *data); 26 | 27 | OEChar read(OEAddress address); 28 | void write(OEAddress address, OEChar value); 29 | 30 | private: 31 | OEComponent *bankSwitcher; 32 | OEComponent *controlBus; 33 | OEComponent *floatingBus; 34 | OEComponent *keyboard; 35 | OEComponent *memoryBus; 36 | OEComponent *ramMapper; 37 | OEComponent *romC0DF; 38 | OEComponent *video; 39 | 40 | bool bank1; 41 | bool hramRead; 42 | bool preWrite; 43 | bool hramWrite; 44 | MemoryMap hramMap; 45 | 46 | bool ramrd; 47 | bool ramwrt; 48 | bool _80store; 49 | bool intcxrom; 50 | bool altzp; 51 | bool slotc3rom; 52 | bool intc8rom; 53 | 54 | // Copies of the video's values 55 | bool hires; 56 | bool page2; 57 | 58 | void setBank1(bool value); 59 | void updateBankOffset(); 60 | void updateBankSwitcher(); 61 | 62 | bool getVideoBool(string property); 63 | void updateAuxmem(); 64 | 65 | MemoryMap cxxxMaps[4]; 66 | void updateCxxxRom(); 67 | }; 68 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Generic/AddressDecoder.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Address decoder 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an address decoder 9 | */ 10 | 11 | #ifndef _ADDRESSDECODER_H 12 | #define _ADDRESSDECODER_H 13 | 14 | #include "OEComponent.h" 15 | 16 | #include "MemoryInterface.h" 17 | 18 | class AddressDecoder : public OEComponent 19 | { 20 | public: 21 | AddressDecoder(); 22 | 23 | bool setValue(string name, string value); 24 | bool setRef(string name, OEComponent *ref); 25 | bool init(); 26 | void update(); 27 | 28 | bool postMessage(OEComponent *sender, int event, void *data); 29 | 30 | OEChar read(OEAddress address); 31 | void write(OEAddress address, OEChar value); 32 | 33 | protected: 34 | OEAddress size; 35 | OEAddress blockSize; 36 | 37 | MemoryMaps internalMemoryMaps; 38 | MemoryMaps externalMemoryMaps; 39 | 40 | OEComponent **readMapp; 41 | OEComponent **writeMapp; 42 | 43 | OEAddress mask; 44 | OEInt blockBits; 45 | 46 | void updateReadWriteMap(MemoryMaps& value, OEAddress startAddress, OEAddress endAddress); 47 | virtual void updateReadWriteMap(OEAddress startAddress, OEAddress endAddress); 48 | 49 | bool addMemoryMap(MemoryMaps& maps, MemoryMap *value); 50 | bool removeMemoryMap(MemoryMaps& maps, MemoryMap *value); 51 | 52 | private: 53 | OEComponent *floatingBus; 54 | 55 | MemoryMapsRef ref; 56 | MemoryMapsConf conf; 57 | 58 | OEComponents readMap; 59 | OEComponents writeMap; 60 | 61 | void mapMemory(MemoryMap& value); 62 | bool updateInternalMemoryMaps(); 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/libutil/util.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libutil 4 | * Common functions 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Common functions 9 | */ 10 | 11 | #ifndef _UTIL_H 12 | #define _UTIL_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | using namespace std; 22 | 23 | #ifdef __WIN32__ 24 | #define PATH_SEPARATOR "\\" 25 | #else 26 | #define PATH_SEPARATOR "/" 27 | #endif 28 | 29 | string getString(float value); 30 | string getHexString(long long value); 31 | string getBinString(long long value, int bitnum); 32 | 33 | string rtrim(string value); 34 | wstring rtrim(wstring value); 35 | string ltrim(string value); 36 | string trim(string value); 37 | vector strsplit(string value, char c); 38 | string strjoin(vector& value, char c); 39 | string strclean(string value, string filter); 40 | string strsanitize(string value, string filter); 41 | string strtolower(string value); 42 | string strtoupper(string value); 43 | 44 | long long getNextPowerOf2(long long value); 45 | int getBitNum(long long value); 46 | 47 | string getLastPathComponent(string path); 48 | string getPathExtension(string path); 49 | string getPathByDeletingPathExtension(string path); 50 | string getPathByDeletingLastPathComponent(string path); 51 | string getRandomFilename(); 52 | 53 | bool readFile(string path, vector *data); 54 | bool writeFile(string path, vector *data); 55 | 56 | bool isPathValid(const string path); 57 | bool isPathADirectory(const string path); 58 | bool createDirectory(const string path); 59 | bool removePath(const string path); 60 | bool moveFile(string from, string to); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIAddressDecoder.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III Address Decoder 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple III Address Decoder 9 | */ 10 | 11 | #ifndef _APPLEIIIADDRESSDECODER_H 12 | #define _APPLEIIIADDRESSDECODER_H 13 | 14 | #include "AddressDecoder.h" 15 | 16 | class AppleIIIAddressDecoder : public AddressDecoder 17 | { 18 | public: 19 | AppleIIIAddressDecoder(); 20 | 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | bool postMessage(OEComponent *sender, int message, void *data); 25 | 26 | void notify(OEComponent *sender, int notification, void *data); 27 | 28 | private: 29 | OEComponent *bankSwitcher; 30 | OEComponent *io; 31 | OEComponent *rom; 32 | OEComponent *memoryFF00; 33 | OEComponent *systemControl; 34 | 35 | OEComponent *slot[8]; 36 | 37 | MemoryMaps appleIIIMemoryMaps; 38 | MemoryMaps ioMemoryMaps; 39 | MemoryMaps ramMemoryMaps; 40 | MemoryMap *ioC500Map; 41 | MemoryMap *ramC000Map; 42 | MemoryMap *ramD000Map; 43 | MemoryMap *ramF000RMap; 44 | MemoryMap *ramF000WMap; 45 | MemoryMap *ramFF00Map; 46 | 47 | MemoryMap ff00RMemoryMap; 48 | MemoryMap ff00WMemoryMap; 49 | MemoryMap ffc0MemoryMap; 50 | MemoryMap fff0MemoryMap; 51 | MemoryMap fff0RMemoryMap; 52 | MemoryMap fff0WMemoryMap; 53 | 54 | OEChar environment; 55 | bool appleIIMode; 56 | 57 | void updateReadWriteMap(OEAddress startAddress, OEAddress endAddress); 58 | 59 | void setSlot(OEInt index, OEComponent *ref); 60 | 61 | void updateAppleIIIMemoryMaps(); 62 | 63 | bool setEnvironment(OEChar value); 64 | bool setAppleIIMode(bool value); 65 | }; 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /src/libemulation-hal/OEMatrix3.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation-hal 4 | * 3x3 matrix 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements a 3x3 matrix 9 | */ 10 | 11 | #include 12 | 13 | #include "OEMatrix3.h" 14 | 15 | OEMatrix3::OEMatrix3() 16 | { 17 | data.resize(9); 18 | } 19 | 20 | OEMatrix3::OEMatrix3(float c00, float c01, float c02, 21 | float c10, float c11, float c12, 22 | float c20, float c21, float c22) 23 | { 24 | data.resize(9); 25 | 26 | data[0] = c00; 27 | data[1] = c01; 28 | data[2] = c02; 29 | data[3] = c10; 30 | data[4] = c11; 31 | data[5] = c12; 32 | data[6] = c20; 33 | data[7] = c21; 34 | data[8] = c22; 35 | } 36 | 37 | float OEMatrix3::getValue(OEInt i, OEInt j) 38 | { 39 | return data[3 * i + j]; 40 | } 41 | 42 | float *OEMatrix3::getValues() 43 | { 44 | return &data.front(); 45 | } 46 | 47 | OEMatrix3 OEMatrix3::operator*(const float value) 48 | { 49 | OEMatrix3 m; 50 | 51 | for (OEInt i = 0; i < 9; i++) 52 | m.data[i] = data[i] * value; 53 | 54 | return m; 55 | } 56 | 57 | OEMatrix3 OEMatrix3::operator*(const OEMatrix3& m) 58 | { 59 | OEMatrix3 n; 60 | 61 | for (OEInt i = 0; i < 3; i++) 62 | for (OEInt j = 0; j < 3; j++) 63 | for (OEInt k = 0; k < 3; k++) 64 | n.data[i * 3 + j] += m.data[i * 3 + k] * data[k * 3 + j]; 65 | 66 | return n; 67 | } 68 | 69 | OEMatrix3& OEMatrix3::operator*=(const float value) 70 | { 71 | OEMatrix3 m = *this * value; 72 | 73 | data = m.data; 74 | 75 | return *this; 76 | } 77 | 78 | OEMatrix3& OEMatrix3::operator*=(const OEMatrix3& m) 79 | { 80 | OEMatrix3 n = *this * m; 81 | 82 | data = n.data; 83 | 84 | return *this; 85 | } 86 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](.github/readme.png) 2 | 3 |

4 | GitHub Travis (.org) Gitter 5 |

6 | 7 | --- 8 | 9 | **libemulation** is an emulation framework of legacy computer systems powering emulators such as [OpenEmulator](https://github.com/openemulator/openemulator). 10 | 11 | * Implemented in C++ 12 | * Portable, accurate emulation framework 13 | * Large, diverse component library 14 | * Emulates famous legacy computers, such as the Apple II and more 15 | * Easy to create emulations using [EDL](doc/The%20libemulation%20Book.txt), or Emulation Description Language 16 | 17 | ## Usage 18 | libemulation is implemented in C++ and can be linked with your emulator application as a static library. We aim to be portable, but currently the only officially supported and tested platform is macOS. Refer to [INSTALL.md](INSTALL.md) for instructions on how to build libemulation. 19 | 20 | ## Feedback and contributing 21 | If you find a bug, or would like a specific feature, please report it at: 22 | 23 | [https://github.com/openemulator/libemulation/issues](https://github.com/openemulator/libemulation/issues) 24 | 25 | If you would like to contribute to the project, fork the repository on GitHub and send us your pull requests! 26 | 27 | ## License 28 | libemulation is released under the [GNU General Public License v3](COPYING). 29 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/JoystickInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Joystick interface 5 | * (C) 2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the joystick interface 9 | */ 10 | 11 | #ifndef _JOYSTICKINTERFACE_H 12 | #define _JOYSTICKINTERFACE_H 13 | 14 | typedef enum 15 | { 16 | JOYSTICK_GET_JOYSTICKNUM, 17 | } JoystickMessage; 18 | 19 | typedef enum 20 | { 21 | JOYSTICK_DID_CHANGE, 22 | JOYSTICK_WAS_CONNECTED, 23 | JOYSTICK_WAS_DISCONNECTED, 24 | } JoystickNotification; 25 | 26 | #define JOYSTICK_AXIS_NUM 16 27 | #define JOYSTICK_BUTTON_NUM 16 28 | #define JOYSTICK_HAT_NUM 4 29 | #define JOYSTICK_BALL_NUM 4 30 | 31 | typedef struct 32 | { 33 | OEInt deviceId; 34 | OEInt usageId; 35 | float value; 36 | } JoystickHIDEvent; 37 | 38 | typedef enum 39 | { 40 | JOYSTICK_AXIS1, 41 | JOYSTICK_AXIS2, 42 | JOYSTICK_AXIS3, 43 | JOYSTICK_AXIS4, 44 | JOYSTICK_AXIS5, 45 | JOYSTICK_AXIS6, 46 | JOYSTICK_AXIS7, 47 | JOYSTICK_AXIS8, 48 | JOYSTICK_AXIS9, 49 | JOYSTICK_AXIS10, 50 | JOYSTICK_AXIS11, 51 | JOYSTICK_AXIS12, 52 | JOYSTICK_AXIS13, 53 | JOYSTICK_AXIS14, 54 | JOYSTICK_AXIS15, 55 | JOYSTICK_AXIS16, 56 | JOYSTICK_BUTTON1, 57 | JOYSTICK_BUTTON2, 58 | JOYSTICK_BUTTON3, 59 | JOYSTICK_BUTTON4, 60 | JOYSTICK_BUTTON5, 61 | JOYSTICK_BUTTON6, 62 | JOYSTICK_BUTTON7, 63 | JOYSTICK_BUTTON8, 64 | JOYSTICK_BUTTON9, 65 | JOYSTICK_BUTTON10, 66 | JOYSTICK_BUTTON11, 67 | JOYSTICK_BUTTON12, 68 | JOYSTICK_BUTTON13, 69 | JOYSTICK_BUTTON14, 70 | JOYSTICK_BUTTON15, 71 | JOYSTICK_BUTTON16, 72 | JOYSTICK_HAT1, 73 | JOYSTICK_HAT2, 74 | JOYSTICK_HAT3, 75 | JOYSTICK_HAT4, 76 | JOYSTICK_BALL1, 77 | JOYSTICK_BALL2, 78 | JOYSTICK_BALL3, 79 | JOYSTICK_BALL4, 80 | } JoystickUsageId; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.11) 2 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) 3 | 4 | # Set up as a C++ project 5 | project(emulation CXX) 6 | 7 | # Set up convenient directory variables 8 | set(source_directory ${CMAKE_CURRENT_SOURCE_DIR}/src) 9 | 10 | # Dependencies 11 | find_package(PNG REQUIRED) 12 | find_package(LibXml2 REQUIRED) 13 | find_package(LibZip REQUIRED) 14 | find_package(PortAudio REQUIRED) 15 | find_package(LibSndFile REQUIRED) 16 | find_package(LibSampleRate REQUIRED) 17 | find_package(GLUT REQUIRED) 18 | find_package(OpenGL REQUIRED) 19 | 20 | # Compile-time definitions 21 | add_definitions(-DGL_GLEXT_PROTOTYPES) 22 | 23 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 24 | add_definitions(-D_LINUX) 25 | ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 26 | 27 | # Get sources and headers for the OE libraries 28 | include(${source_directory}/libdiskimage.cmake) 29 | include(${source_directory}/libemulation.cmake) 30 | include(${source_directory}/libemulation-hal.cmake) 31 | include(${source_directory}/libutil.cmake) 32 | 33 | # Setup include directories 34 | include_directories( 35 | ${libdiskimage_include} 36 | ${emulation_hal_include} 37 | ${emulation_include} 38 | ${libutil_include} 39 | ${PNG_INCLUDE_DIR} 40 | ${LIBXML2_INCLUDE_DIR} 41 | ${LIBZIP_INCLUDE_DIR} 42 | ${PORTAUDIO_INCLUDE_DIRS} 43 | ${LIBSNDFILE_INCLUDE_DIR} 44 | ${LIBSAMPLERATE_INCLUDE_DIR} 45 | ${GLUT_INCLUDE_DIR} 46 | ${OPENGL_INCLUDE_DIR} 47 | ) 48 | 49 | # libemulation as a static library 50 | add_library(emulation STATIC 51 | ${libdiskimage} 52 | ${emulation_hal} 53 | ${emulation} 54 | ${libutil} 55 | ) 56 | 57 | target_link_libraries(emulation 58 | ${PNG_LIBRARIES} 59 | ${LIBXML2_LIBRARIES} 60 | ${LIBZIP_LIBRARY} 61 | ${PORTAUDIO_LIBRARIES} 62 | ${LIBSNDFILE_LIBRARIES} 63 | ${LIBSAMPLERATE_LIBRARIES} 64 | ${GLUT_LIBRARIES} 65 | ${OPENGL_LIBRARIES} 66 | ) 67 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Generic/MemoryInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Memory interface 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the address interfaces 9 | */ 10 | 11 | #ifndef _ADDRESSINTERFACE_H 12 | #define _ADDRESSINTERFACE_H 13 | 14 | #include 15 | 16 | #include "OEComponent.h" 17 | 18 | typedef struct 19 | { 20 | OEComponent *component; 21 | 22 | OEAddress startAddress; 23 | OEAddress endAddress; 24 | 25 | bool read; 26 | bool write; 27 | } MemoryMap; 28 | 29 | typedef list MemoryMaps; 30 | 31 | typedef map MemoryMapsConf; 32 | typedef map MemoryMapsRef; 33 | 34 | bool appendMemoryMaps(MemoryMaps& theMaps, 35 | OEComponent *component, 36 | string value); 37 | bool validateMemoryMaps(MemoryMaps& theMaps, 38 | OEAddress blockSize, 39 | OEAddress addressMask); 40 | 41 | typedef struct 42 | { 43 | OEAddress startAddress; 44 | OEAddress endAddress; 45 | 46 | OESLong offset; 47 | } AddressOffsetMap; 48 | 49 | typedef list AddressOffsetMaps; 50 | 51 | typedef enum 52 | { 53 | ADDRESSDECODER_MAP, 54 | ADDRESSDECODER_UNMAP, 55 | ADDRESSDECODER_END, 56 | } AddressDecoderMessage; 57 | 58 | typedef enum 59 | { 60 | ADDRESSMAPPER_SELECT, 61 | } AddressMapperMessage; 62 | 63 | typedef enum 64 | { 65 | ADDRESSMASKER_SET_ANDMASK, 66 | ADDRESSMASKER_SET_ORMASK, 67 | } AddressMaskerMessage; 68 | 69 | typedef enum 70 | { 71 | ADDRESSOFFSET_MAP, 72 | } AddressOffsetMessage; 73 | 74 | typedef enum 75 | { 76 | RAM_GET_DATA, 77 | } RAMMessage; 78 | 79 | typedef enum 80 | { 81 | RAM_SIZE_DID_CHANGE, 82 | } RAMNotification; 83 | 84 | typedef enum 85 | { 86 | VRAM_WILL_CHANGE, 87 | } VRAMNotification; 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIISystemControl.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III System Control 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements Apple III system control 9 | */ 10 | 11 | #ifndef _APPLEIIISYSTEMCONTROL_H 12 | #define _APPLEIIISYSTEMCONTROL_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class AppleIIISystemControl : public OEComponent 17 | { 18 | public: 19 | AppleIIISystemControl(); 20 | 21 | bool setRef(string name, OEComponent *ref); 22 | bool init(); 23 | 24 | bool postMessage(OEComponent *sender, int message, void *data); 25 | 26 | void notify(OEComponent *sender, int notification, void *data); 27 | 28 | OEChar read(OEAddress address); 29 | void write(OEAddress address, OEChar value); 30 | 31 | private: 32 | OEComponent *cpu; 33 | OEComponent *controlBus; 34 | OEComponent *zeroPageSwitcher; 35 | OEComponent *bankSwitcher; 36 | OEComponent *extendedZeroPageSwitcher; 37 | OEComponent *extendedBankSwitcher; 38 | OEComponent *ram; 39 | OEComponent *keyboard; 40 | OEComponent *video; 41 | OEComponent *rtc; 42 | OEComponent *silentype; 43 | OEComponent *dVIA; 44 | OEComponent *eVIA; 45 | OEComponent *dac; 46 | 47 | OEChar ramMask; 48 | 49 | OEChar environment; 50 | OEChar zeroPage; 51 | OEChar ramBank; 52 | OEChar sound; 53 | 54 | OEChar extendedRAMBank; 55 | 56 | bool monitorRequested; 57 | 58 | void setEnvironment(OEChar value); 59 | void setZeroPage(OEChar value); 60 | void setRAMBank(OEChar value); 61 | void setExtendedRAMBank(OEChar value); 62 | void setSound(OEChar value); 63 | 64 | void updateEnvironment(); 65 | void updateZeroPage(); 66 | void updateAltStack(); 67 | void updateRAMBank(); 68 | void updateExtendedRAMBank(); 69 | }; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Videx/VidexVideoterm.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Videx Videoterm 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls a Videx Videoterm 9 | */ 10 | 11 | #include "MC6845.h" 12 | 13 | class VidexVideoterm : public MC6845 14 | { 15 | public: 16 | VidexVideoterm(); 17 | 18 | bool setValue(string name, string value); 19 | bool getValue(string name, string& value); 20 | bool setRef(string name, OEComponent *ref); 21 | bool setData(string name, OEData *data); 22 | bool init(); 23 | void update(); 24 | void dispose(); 25 | 26 | void notify(OEComponent *sender, int notification, void *data); 27 | 28 | OEChar read(OEAddress address); 29 | void write(OEAddress address, OEChar value); 30 | 31 | private: 32 | OEComponent *ram; 33 | OEComponent *bankSwitcher; 34 | OEComponent *video; 35 | OEComponent *gamePort; 36 | 37 | OEInt ramBank; 38 | string characterSet1; 39 | string characterSet2; 40 | 41 | bool an0; 42 | bool colorKiller; 43 | 44 | bool videoInhibited; 45 | bool monitorConnected; 46 | bool monitorCaptured; 47 | OESInt cellWidth; 48 | 49 | map font; 50 | OEData currentFont; 51 | 52 | OEChar *drawFont; 53 | 54 | OEData *vram; 55 | 56 | OEImage image; 57 | OEChar *imagep; 58 | OEInt imageWidth; 59 | 60 | OEChar *drawMemory; 61 | 62 | OEInt videoOutput; 63 | 64 | bool loadFont(string name, OEData *data); 65 | 66 | void setRAMBank(OEInt value); 67 | void updateRAMBank(); 68 | 69 | void setCellWidth(OEInt value); 70 | 71 | void updateVideoEnabled(); 72 | 73 | void updateTiming(); 74 | 75 | void drawLine(OESInt y, OESInt x0, OESInt x1); 76 | 77 | void postImage(); 78 | void copy(wstring *s); 79 | }; 80 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/Apple1Terminal.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple-1 Terminal 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an Apple-1 terminal 9 | */ 10 | 11 | #include 12 | 13 | #include "OEComponent.h" 14 | 15 | #include "OEImage.h" 16 | #include "CanvasInterface.h" 17 | #include "ControlBusInterface.h" 18 | 19 | class Apple1Terminal : public OEComponent 20 | { 21 | public: 22 | Apple1Terminal(); 23 | 24 | bool setValue(string name, string value); 25 | bool getValue(string name, string& value); 26 | bool setRef(string name, OEComponent *ref); 27 | bool setData(string name, OEData *data); 28 | bool init(); 29 | void update(); 30 | void dispose(); 31 | 32 | bool postMessage(OEComponent *sender, int message, void *data); 33 | 34 | void notify(OEComponent *sender, int notification, void *data); 35 | 36 | private: 37 | OEComponent *dte; 38 | OEComponent *emulation; 39 | OEComponent *controlBus; 40 | OEComponent *vram; 41 | OEComponent *monitor; 42 | 43 | // Settings 44 | OEInt cursorX, cursorY; 45 | bool clearScreenOnCtrlL; 46 | bool splashScreen; 47 | bool splashScreenActive; 48 | 49 | // State 50 | OEChar *vramp; 51 | OEData font; 52 | bool updateCanvas; 53 | 54 | OEImage image; 55 | 56 | bool cursorActive; 57 | OEInt cursorCount; 58 | 59 | ControlBusPowerState powerState; 60 | 61 | bool isRTS; 62 | queue pasteBuffer; 63 | 64 | void loadFont(OEData *data); 65 | 66 | void scheduleNextTimer(OESLong cycles); 67 | void drawFrame(); 68 | 69 | void clearScreen(); 70 | void putChar(OEChar c); 71 | void sendKey(CanvasUnicodeChar key); 72 | 73 | void copy(wstring *s); 74 | void paste(wstring *s); 75 | void emptyPasteBuffer(); 76 | }; 77 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleDiskIIInterfaceCard.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple Disk II Interface Card 5 | * (C) 2011-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements an Apple Disk II interface card 9 | */ 10 | 11 | #ifndef _APPLEDISKIIINTERFACECARD_H 12 | #define _APPLEDISKIIINTERFACECARD_H 13 | 14 | #include "OEComponent.h" 15 | 16 | class AppleDiskIIInterfaceCard : public OEComponent 17 | { 18 | public: 19 | AppleDiskIIInterfaceCard(); 20 | 21 | bool setValue(string name, string value); 22 | bool getValue(string name, string& value); 23 | bool setRef(string name, OEComponent *ref); 24 | bool init(); 25 | void update(); 26 | 27 | void notify(OEComponent *sender, int notification, void *data); 28 | 29 | OEChar read(OEAddress address); 30 | void write(OEAddress address, OEChar value); 31 | 32 | protected: 33 | OEComponent *floatingBus; 34 | 35 | OEChar dataRegister; 36 | 37 | bool driveEnableControl; 38 | 39 | void setPhaseControl(OEInt index, bool value); 40 | void setDriveOn(bool value); 41 | void selectDrive(OEInt value); 42 | void setSequencerWrite(bool value); 43 | void setSequencerLoad(bool value); 44 | void updateSequencer(); 45 | 46 | private: 47 | OEComponent *controlBus; 48 | OEComponent *drive[5]; 49 | 50 | OEInt phaseControl; 51 | bool driveOn; 52 | OEInt driveSel; 53 | OEInt sequencerMode; 54 | 55 | bool sequencerState; 56 | 57 | OEComponent dummyDrive; 58 | OEComponent *currentDrive; 59 | bool timerOn; 60 | bool reset; 61 | 62 | OELong lastCycles; 63 | 64 | OELong driveBitClock; 65 | 66 | void updateSwitches(OEAddress address); 67 | void updatePhaseControl(); 68 | void updateDriveEnableControl(); 69 | void updateDriveEnabled(); 70 | void updateDriveSelection(OEInt value); 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIIBeeper.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple III Beeper 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple III Beeper 9 | */ 10 | 11 | #include "AppleIIIBeeper.h" 12 | 13 | #include "ControlBusInterface.h" 14 | 15 | #include "AppleIIInterface.h" 16 | 17 | #define DURATION 0.11F 18 | #define FREQUENCY 953 19 | 20 | AppleIIIBeeper::AppleIIIBeeper() 21 | { 22 | controlBus = NULL; 23 | floatingBus = NULL; 24 | audioOut = NULL; 25 | 26 | count = 0; 27 | } 28 | 29 | bool AppleIIIBeeper::setRef(string name, OEComponent *ref) 30 | { 31 | if (name == "controlBus") 32 | controlBus = ref; 33 | else if (name == "floatingBus") 34 | floatingBus = ref; 35 | else if (name == "audioOut") 36 | audioOut = ref; 37 | else 38 | return false; 39 | 40 | return true; 41 | } 42 | 43 | bool AppleIIIBeeper::init() 44 | { 45 | OECheckComponent(controlBus); 46 | OECheckComponent(floatingBus); 47 | OECheckComponent(audioOut); 48 | 49 | return true; 50 | } 51 | 52 | void AppleIIIBeeper::notify(OEComponent *sender, int notification, void *data) 53 | { 54 | audioOut->write(0xc030, 0); 55 | 56 | count--; 57 | 58 | if (count) 59 | scheduleNextTimer(*((OESLong *)data)); 60 | } 61 | 62 | OEChar AppleIIIBeeper::read(OEAddress address) 63 | { 64 | write(address, 0); 65 | 66 | return floatingBus->read(address); 67 | } 68 | 69 | void AppleIIIBeeper::write(OEAddress address, OEChar value) 70 | { 71 | if (!count) 72 | scheduleNextTimer(0); 73 | 74 | count = 2.0F * DURATION * FREQUENCY; 75 | } 76 | 77 | void AppleIIIBeeper::scheduleNextTimer(OESLong cycles) 78 | { 79 | ControlBusTimer timer = { cycles + 0.5F * APPLEII_CLOCKFREQUENCY / FREQUENCY, 0}; 80 | 81 | controlBus->postMessage(this, CONTROLBUS_SCHEDULE_TIMER, &timer); 82 | } 83 | -------------------------------------------------------------------------------- /src/libdiskimage/DIATABlockStorage.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libdiskimage 4 | * ATA Block Storage 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Accesses an ATA block storage 9 | */ 10 | 11 | #ifndef _DIATABLOCKSTORAGE_H 12 | #define _DIATABLOCKSTORAGE_H 13 | 14 | #include "DIFileBackingStore.h" 15 | #include "DIRAMBackingStore.h" 16 | #include "DI2IMGBackingStore.h" 17 | #include "DIDC42BackingStore.h" 18 | 19 | #include "DIBlockStorage.h" 20 | #include "DIRAWBlockStorage.h" 21 | #include "DIVDIBlockStorage.h" 22 | #include "DIVMDKBlockStorage.h" 23 | 24 | class DIATABlockStorage 25 | { 26 | public: 27 | DIATABlockStorage(); 28 | ~DIATABlockStorage(); 29 | 30 | bool open(string path); 31 | bool open(DIData& data); 32 | bool isOpen(); 33 | void close(); 34 | 35 | string getPath(); 36 | bool isWriteEnabled(); 37 | DIInt getBlockNum(); 38 | string getFormatLabel(); 39 | 40 | void setForceWriteProtected(bool value); 41 | bool getForceWriteProtected(); 42 | 43 | DIInt getCylinders(); 44 | DIInt getHeads(); 45 | DIInt getSectors(); 46 | 47 | string getSerial(); 48 | string getFirmware(); 49 | string getModel(); 50 | 51 | void setMaxSize(DIInt value); 52 | 53 | bool readBlocks(DIInt index, DIChar *buf, DIInt num); 54 | bool writeBlocks(DIInt index, const DIChar *buf, DIInt num); 55 | 56 | private: 57 | DIFileBackingStore fileBackingStore; 58 | DIRAMBackingStore ramBackingStore; 59 | DI2IMGBackingStore twoImgBackingStore; 60 | DIDC42BackingStore dc42BackingStore; 61 | 62 | DIBlockStorage dummyBlockStorage; 63 | DIRAWBlockStorage rawBlockStorage; 64 | DIVDIBlockStorage vdiBlockStorage; 65 | DIVMDKBlockStorage vmdkBlockStorage; 66 | 67 | DIBlockStorage *blockStorage; 68 | 69 | bool forceWriteProtected; 70 | string model; 71 | 72 | DIInt maxSize; 73 | 74 | bool open(DIBackingStore *backingStore); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIKeyboard.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulator 4 | * Apple II Keyboard 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple II keyboard 9 | */ 10 | 11 | #ifndef _APPLEIIKEYBOARD_H 12 | #define _APPLEIIKEYBOARD_H 13 | 14 | #include "OEComponent.h" 15 | 16 | #include "CanvasInterface.h" 17 | 18 | #include 19 | 20 | typedef enum 21 | { 22 | APPLEIIKEYBOARD_TYPE_STANDARD, 23 | APPLEIIKEYBOARD_TYPE_SHIFTKEYMOD, 24 | APPLEIIKEYBOARD_TYPE_FULLASCII, 25 | } AppleIIKeyboardType; 26 | 27 | typedef enum 28 | { 29 | APPLEIIKEYBOARD_STATE_NORMAL, 30 | APPLEIIKEYBOARD_STATE_RESET, 31 | APPLEIIKEYBOARD_STATE_ALTRESET, 32 | APPLEIIKEYBOARD_STATE_RESTART, 33 | } AppleIIKeyboardState; 34 | 35 | class AppleIIKeyboard : public OEComponent 36 | { 37 | public: 38 | AppleIIKeyboard(); 39 | 40 | bool setValue(string name, string value); 41 | bool getValue(string name, string& value); 42 | bool setRef(string name, OEComponent *ref); 43 | bool init(); 44 | void update(); 45 | 46 | void notify(OEComponent *sender, int notification, void *data); 47 | 48 | OEChar read(OEAddress address); 49 | void write(OEAddress address, OEChar value); 50 | 51 | protected: 52 | OEComponent *controlBus; 53 | OEComponent *floatingBus; 54 | OEComponent *monitor; 55 | 56 | AppleIIKeyboardType type; 57 | 58 | OEInt pressedKeypadKeyCount; 59 | 60 | OEChar keyLatch; 61 | bool keyStrobe; 62 | 63 | virtual void updateKeyFlags(); 64 | virtual void sendKey(CanvasUnicodeChar key); 65 | void setKeyStrobe(bool value); 66 | virtual void setReset(bool value); 67 | virtual void setAltReset(bool value); 68 | 69 | void emptyPasteBuffer(); 70 | 71 | private: 72 | OEComponent *gamePort; 73 | 74 | AppleIIKeyboardState state; 75 | OEInt stateUsageId; 76 | 77 | queue pasteBuffer; 78 | 79 | void paste(wstring *s); 80 | }; 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleIIEAddressDecoder.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple II Address Decoder 5 | * (C) 2017 by Zellyn Hunter (zellyn@gmail.com) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple II Address Decoder 9 | */ 10 | 11 | #include "AppleIIEAddressDecoder.h" 12 | 13 | #include "AppleIIInterface.h" 14 | 15 | AppleIIEAddressDecoder::AppleIIEAddressDecoder() : AppleIIAddressDecoder() 16 | { 17 | } 18 | 19 | bool AppleIIEAddressDecoder::postMessage(OEComponent *sender, int message, void *data) 20 | { 21 | switch (message) 22 | { 23 | case ADDRESSDECODER_MAP: 24 | return addMemoryMap(externalMemoryMaps, (MemoryMap *) data); 25 | 26 | case ADDRESSDECODER_UNMAP: 27 | return removeMemoryMap(externalMemoryMaps, (MemoryMap *) data); 28 | 29 | case APPLEII_MAP_SLOT: 30 | return addMemoryMap(ioMemoryMaps, (MemoryMap *) data); 31 | 32 | case APPLEII_UNMAP_SLOT: 33 | return removeMemoryMap(ioMemoryMaps, (MemoryMap *) data); 34 | 35 | case APPLEII_MAP_CXXX: 36 | return addMemoryMap(cxxxMemoryMaps, (MemoryMap *) data); 37 | 38 | case APPLEII_UNMAP_CXXX: 39 | return removeMemoryMap(cxxxMemoryMaps, (MemoryMap *) data); 40 | 41 | case APPLEII_MAP_INTERNAL: 42 | return addMemoryMap(internalMemoryMaps, (MemoryMap *) data); 43 | 44 | case APPLEII_UNMAP_INTERNAL: 45 | return removeMemoryMap(internalMemoryMaps, (MemoryMap *) data); 46 | } 47 | 48 | return false; 49 | } 50 | 51 | void AppleIIEAddressDecoder::updateReadWriteMap(OEAddress startAddress, OEAddress endAddress) 52 | { 53 | AddressDecoder::updateReadWriteMap(internalMemoryMaps, startAddress, endAddress); 54 | AddressDecoder::updateReadWriteMap(ioMemoryMaps, startAddress, endAddress); 55 | AddressDecoder::updateReadWriteMap(cxxxMemoryMaps, startAddress, endAddress); 56 | AddressDecoder::updateReadWriteMap(externalMemoryMaps, startAddress, endAddress); 57 | } 58 | 59 | -------------------------------------------------------------------------------- /src/libemulation/Core/OEComponent.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * OEComponent 5 | * (C) 2009-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the base emulation component 9 | */ 10 | 11 | #ifndef _OECOMPONENT_H 12 | #define _OECOMPONENT_H 13 | 14 | #include "OECommon.h" 15 | 16 | #define OECheckComponent(c) if (!c) { logMessage(#c " not defined"); return false; } 17 | 18 | class OEComponent; 19 | 20 | typedef vector OEComponents; 21 | typedef map OEObservers; 22 | 23 | class OEComponent 24 | { 25 | public: 26 | virtual ~OEComponent(); 27 | 28 | // Configuration 29 | virtual bool setValue(string name, string value); 30 | virtual bool getValue(string name, string& value); 31 | virtual bool setRef(string name, OEComponent *ref); 32 | virtual bool setData(string name, OEData *data); 33 | virtual bool getData(string name, OEData **data); 34 | virtual bool init(); 35 | virtual void update(); 36 | virtual void dispose(); 37 | 38 | // Messaging 39 | virtual bool postMessage(OEComponent *sender, int message, void *data); 40 | 41 | // Notification 42 | virtual bool addObserver(OEComponent *observer, int notification); 43 | virtual bool removeObserver(OEComponent *observer, int notification); 44 | virtual void postNotification(OEComponent *sender, int notification, void *data); 45 | virtual void notify(OEComponent *sender, int notification, void *data); 46 | 47 | // Memory access 48 | virtual OEChar read(OEAddress address); 49 | virtual void write(OEAddress address, OEChar value); 50 | virtual OEShort read16(OEAddress address); 51 | virtual void write16(OEAddress address, OEShort value); 52 | virtual OEInt read32(OEAddress address); 53 | virtual void write32(OEAddress address, OEInt value); 54 | virtual OELong read64(OEAddress address); 55 | virtual void write64(OEAddress address, OELong value); 56 | 57 | protected: 58 | OEObservers observers; 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Host/EmulationInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Emulation interface 5 | * (C) 2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the emulation interface 9 | */ 10 | 11 | #ifndef _EMULATIONINTERFACE_H 12 | #define _EMULATIONINTERFACE_H 13 | 14 | #include 15 | #include 16 | 17 | #include "OEComponent.h" 18 | 19 | using namespace std; 20 | 21 | typedef enum 22 | { 23 | EMULATION_CONSTRUCT_DISPLAYCANVAS, 24 | EMULATION_CONSTRUCT_PAPERCANVAS, 25 | EMULATION_CONSTRUCT_OPENGLCANVAS, 26 | EMULATION_DESTROY_CANVAS, 27 | 28 | EMULATION_UPDATE, 29 | 30 | EMULATION_ASSERT_ACTIVITY, 31 | EMULATION_CLEAR_ACTIVITY, 32 | } EmulationMessage; 33 | 34 | typedef enum 35 | { 36 | EMULATION_WAS_SIGNALED, 37 | } EmulationNotification; 38 | 39 | typedef enum 40 | { 41 | EMULATION_POWERDOWN = 0x81, 42 | EMULATION_SLEEP, 43 | EMULATION_WAKEUP, 44 | EMULATION_CONTEXT, 45 | EMULATION_MAINMENU, 46 | EMULATION_APPMENU, 47 | EMULATION_MENUHELP, 48 | EMULATION_MENUEXIT, 49 | EMULATION_MENUSELECT, 50 | EMULATION_MENURIGHT, 51 | EMULATION_MENULEFT, 52 | EMULATION_MENUUP, 53 | EMULATION_MENUDOWN, 54 | EMULATION_COLDRESTART, 55 | EMULATION_WARMRESTART, 56 | EMULATION_DPADUP, 57 | EMULATION_DPADDOWN, 58 | EMULATION_DPADRIGHT, 59 | EMULATION_DPADLEFT, 60 | 61 | EMULATION_DOCK = 0xa0, 62 | EMULATION_UNDOCK, 63 | EMULATION_SETUP, 64 | EMULATION_BREAK, 65 | EMULATION_DEBUGGERBREAK, 66 | EMULATION_APPLICATIONBREAK, 67 | EMULATION_APPLICATIONDEBUGGERBREAK, 68 | EMULATION_SPEAKERMUTE, 69 | EMULATION_HIBERNATE, 70 | 71 | EMULATION_DISPLAYINVERT = 0xb0, 72 | EMULATION_DISPLAYINTERNAL, 73 | EMULATION_DISPLAYEXTERNAL, 74 | EMULATION_DISPLAYBOTH, 75 | EMULATION_DISPLAYDUAL, 76 | EMULATION_DISPLAYTOGGLEINTEXT, 77 | EMULATION_DISPLAYSWAPPRIMARYSECONDARY, 78 | EMULATION_DISPLAYLCDAUTOSCALE, 79 | 80 | EMULATION_END, 81 | } EmulationEvent; 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Apple/AppleDiskDrive525.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Apple 5.25" Disk Drive 5 | * (C) 2010-2012 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Controls an Apple 5.25" Disk Drive 9 | */ 10 | 11 | #include "OEComponent.h" 12 | 13 | #include "OESound.h" 14 | 15 | #include "diskimage.h" 16 | 17 | class AppleDiskDrive525 : public OEComponent 18 | { 19 | public: 20 | AppleDiskDrive525(); 21 | 22 | bool setValue(string name, string value); 23 | bool getValue(string name, string& value); 24 | bool setRef(string name, OEComponent *ref); 25 | bool init(); 26 | void update(); 27 | void dispose(); 28 | 29 | bool postMessage(OEComponent *sender, int message, void *data); 30 | 31 | void notify(OEComponent *sender, int notification, void *data); 32 | 33 | OEChar read(OEAddress address); 34 | void write(OEAddress address, OEChar value); 35 | 36 | private: 37 | OEComponent *device; 38 | OEComponent *controlBus; 39 | OEComponent *doorPlayer; 40 | OEComponent *drivePlayer; 41 | OEComponent *headPlayer; 42 | 43 | string imageDriveOff; 44 | string imageDriveInUse; 45 | 46 | string mechanism; 47 | float volume; 48 | mapsound; 49 | 50 | OEInt phaseControl; 51 | OELong phaseCycles; 52 | OESInt phaseDirection; 53 | bool phaseLastBump; 54 | bool phaseStop; 55 | bool phaseAlign; 56 | 57 | OESInt trackIndex; 58 | OEInt trackPhase; 59 | 60 | DIApple525DiskStorage diskStorage; 61 | 62 | DIData track; 63 | OEChar *trackData; 64 | OEInt trackDataSize; 65 | OEInt trackDataIndex; 66 | 67 | OEInt zeroCount; 68 | 69 | bool isModified; 70 | 71 | bool isOpenSound; 72 | 73 | OESInt getStepperDelta(OESInt position, OEInt phaseControl); 74 | void updateTrack(OEInt value); 75 | 76 | void updatePlayerSounds(); 77 | void updatePlayerSound(OEComponent *component, string value); 78 | 79 | bool openDiskImage(string path); 80 | bool closeDiskImage(); 81 | }; 82 | -------------------------------------------------------------------------------- /src/libemulation/Implementation/Don't Ask/SAMDACCard.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * libemulation 3 | * Don't Ask Software S.A.M. DAC Card 4 | * (C) 2016 by Zellyn Hunter (zellyn@gmail.com) 5 | * Released under the GPL 6 | * 7 | * Controls a Don't Ask Software Digital Analog Converter Card 8 | */ 9 | 10 | #include 11 | 12 | #include "SAMDACCard.h" 13 | 14 | #include "AppleIIInterface.h" 15 | #include "MemoryInterface.h" 16 | #include "AudioInterface.h" 17 | 18 | SAMDACCard::SAMDACCard() 19 | { 20 | floatingBus = NULL; 21 | } 22 | 23 | bool SAMDACCard::setValue(string name, string value) 24 | { 25 | if (name == "volume") 26 | volume = getFloat(value); 27 | else 28 | return false; 29 | 30 | return true; 31 | } 32 | 33 | bool SAMDACCard::getValue(string name, string& value) 34 | { 35 | if (name == "volume") 36 | value = getString(volume); 37 | else 38 | return false; 39 | 40 | return true; 41 | } 42 | 43 | bool SAMDACCard::setRef(string name, OEComponent *ref) 44 | { 45 | if (name == "floatingBus") 46 | floatingBus = ref; 47 | else if (name == "audioCodec") 48 | audioCodec = ref; 49 | else 50 | return false; 51 | 52 | return true; 53 | } 54 | 55 | bool SAMDACCard::init() 56 | { 57 | OECheckComponent(floatingBus); 58 | 59 | update(); 60 | 61 | return true; 62 | } 63 | 64 | void SAMDACCard::update() 65 | { 66 | outputLevel = 16384 * getLevelFromVolume(volume); 67 | } 68 | 69 | void SAMDACCard::dispose() 70 | { 71 | } 72 | 73 | OEChar SAMDACCard::read(OEAddress address) 74 | { 75 | return floatingBus->read(address); 76 | } 77 | 78 | void SAMDACCard::write(OEAddress address, OEChar value) 79 | { 80 | // Real board probably allows writes to any address... ? 81 | // if ((address & 0xf) != 0) return; 82 | 83 | float scaledValue = value / 255.0; 84 | OEShort outValue = outputLevel * scaledValue; 85 | 86 | audioCodec->write16(0, outValue); 87 | audioCodec->write16(1, outValue); 88 | } 89 | 90 | void SAMDACCard::notify(OEComponent *sender, int notification, void *data) 91 | { 92 | } -------------------------------------------------------------------------------- /src/libemulation/Implementation/MOS/MOSKIM1IO.cpp: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * MOS KIM-1 I/O 5 | * (C) 2010 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Implements MOS KIM-1 input/output 9 | */ 10 | 11 | #include "MOSKIM1IO.h" 12 | 13 | #include "DeviceInterface.h" 14 | #include "CanvasInterface.h" 15 | #include "RS232Interface.h" 16 | 17 | MOSKIM1IO::MOSKIM1IO() 18 | { 19 | device = NULL; 20 | serialPort = NULL; 21 | audioOut = NULL; 22 | audioIn = NULL; 23 | 24 | canvas = NULL; 25 | } 26 | 27 | bool MOSKIM1IO::setValue(string name, string value) 28 | { 29 | if (name == "viewPath") 30 | viewPath = value; 31 | else 32 | return false; 33 | 34 | return true; 35 | } 36 | 37 | bool MOSKIM1IO::setRef(string name, OEComponent *ref) 38 | { 39 | if (name == "device") 40 | { 41 | if (device) 42 | device->postMessage(this, 43 | DEVICE_DESTROY_CANVAS, 44 | &canvas); 45 | device = ref; 46 | if (device) 47 | device->postMessage(this, 48 | DEVICE_CONSTRUCT_DISPLAYCANVAS, 49 | &canvas); 50 | } 51 | else if (name == "serialPort") 52 | serialPort = ref; 53 | else if (name == "audioOut") 54 | audioOut = ref; 55 | else if (name == "audioIn") 56 | audioIn = ref; 57 | else 58 | return false; 59 | 60 | return true; 61 | } 62 | 63 | bool MOSKIM1IO::init() 64 | { 65 | if (!device) 66 | { 67 | logMessage("property 'device' undefined"); 68 | return false; 69 | } 70 | 71 | if (!canvas) 72 | { 73 | logMessage("canvas could not be created"); 74 | return false; 75 | } 76 | 77 | // CanvasBezel bezel = CANVAS_BEZEL_POWER; 78 | CanvasDisplayConfiguration configuration; 79 | OEImage image; 80 | image.load(viewPath); 81 | configuration.displayResolution = image.getSize(); 82 | configuration.displayPixelDensity = 108; 83 | 84 | // canvas->postMessage(this, CANVAS_SET_BEZEL, &bezel); 85 | canvas->postMessage(this, CANVAS_CONFIGURE_DISPLAY, &configuration); 86 | canvas->postMessage(this, CANVAS_POST_IMAGE, &image); 87 | 88 | return true; 89 | } 90 | 91 | void MOSKIM1IO::notify(OEComponent *sender, int notification, void *data) 92 | { 93 | } 94 | -------------------------------------------------------------------------------- /src/libemulation/Interface/Generic/ControlBusInterface.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * libemulation 4 | * Control Bus Interface 5 | * (C) 2010-2011 by Marc S. Ressl (mressl@umich.edu) 6 | * Released under the GPL 7 | * 8 | * Defines the control bus interface 9 | */ 10 | 11 | // Notes: 12 | // * scheduleTimer schedules a timer using the ControlBusTimer structure 13 | // * invalidateTimers receives the id of the timers to be removed 14 | // * timerDidFire passes the timer using ControlBusTimer 15 | // (cycles is the number of remaining cycles for this timer) 16 | 17 | #ifndef _CONTROLBUSINTERFACE_H 18 | #define _CONTROLBUSINTERFACE_H 19 | 20 | typedef struct 21 | { 22 | OESLong cycles; 23 | OEInt id; 24 | } ControlBusTimer; 25 | 26 | typedef enum 27 | { 28 | CONTROLBUS_SET_POWERSTATE, 29 | CONTROLBUS_GET_POWERSTATE, 30 | 31 | CONTROLBUS_SET_CLOCKFREQUENCY, 32 | CONTROLBUS_GET_CLOCKFREQUENCY, 33 | 34 | CONTROLBUS_GET_CYCLES, 35 | CONTROLBUS_GET_AUDIOBUFFERFRAME, 36 | 37 | CONTROLBUS_SCHEDULE_TIMER, 38 | CONTROLBUS_INVALIDATE_TIMERS, 39 | 40 | CONTROLBUS_SET_CPUCLOCKMULTIPLIER, 41 | 42 | CONTROLBUS_ASSERT_RESET, 43 | CONTROLBUS_CLEAR_RESET, 44 | CONTROLBUS_IS_RESET_ASSERTED, 45 | CONTROLBUS_ASSERT_IRQ, 46 | CONTROLBUS_CLEAR_IRQ, 47 | CONTROLBUS_IS_IRQ_ASSERTED, 48 | CONTROLBUS_ASSERT_NMI, 49 | CONTROLBUS_CLEAR_NMI, 50 | CONTROLBUS_IS_NMI_ASSERTED, 51 | 52 | CONTROLBUS_END, 53 | } ControlBusMessage; 54 | 55 | typedef enum 56 | { 57 | CONTROLBUS_POWERSTATE_DID_CHANGE, 58 | CONTROLBUS_CLOCKFREQUENCY_DID_CHANGE, 59 | CONTROLBUS_TIMER_DID_FIRE, 60 | CONTROLBUS_RESET_DID_ASSERT, 61 | CONTROLBUS_RESET_DID_CLEAR, 62 | CONTROLBUS_IRQ_DID_CHANGE, 63 | CONTROLBUS_NMI_DID_ASSERT, 64 | CONTROLBUS_NMI_DID_CLEAR, 65 | } ControlBusNotification; 66 | 67 | typedef enum 68 | { 69 | CONTROLBUS_POWERSTATE_ON, 70 | CONTROLBUS_POWERSTATE_PAUSE, 71 | CONTROLBUS_POWERSTATE_STANDBY, 72 | CONTROLBUS_POWERSTATE_SLEEP, 73 | CONTROLBUS_POWERSTATE_HIBERNATE, 74 | CONTROLBUS_POWERSTATE_OFF, 75 | } ControlBusPowerState; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/libemulation/edl-1.0.dtd: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | --------------------------------------------------------------------------------