├── SDL ├── SDL2.framework │ ├── Versions │ │ ├── Current │ │ └── A │ │ │ ├── Frameworks │ │ │ └── hidapi.framework │ │ │ │ ├── Versions │ │ │ │ ├── Current │ │ │ │ └── A │ │ │ │ │ ├── hidapi │ │ │ │ │ └── Resources │ │ │ │ │ ├── LICENSE-orig.txt │ │ │ │ │ ├── AUTHORS.txt │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ ├── Info.plist │ │ │ │ │ └── LICENSE-bsd.txt │ │ │ │ ├── hidapi │ │ │ │ └── Resources │ │ │ ├── SDL2 │ │ │ ├── Headers │ │ │ ├── SDL_revision.h │ │ │ ├── SDL_copying.h │ │ │ ├── SDL_opengles2_gl2platform.h │ │ │ ├── SDL_types.h │ │ │ ├── SDL_name.h │ │ │ ├── SDL_opengles.h │ │ │ ├── close_code.h │ │ │ ├── SDL_opengles2.h │ │ │ ├── SDL_config.h │ │ │ ├── SDL_clipboard.h │ │ │ ├── SDL_quit.h │ │ │ ├── SDL_gesture.h │ │ │ ├── SDL_error.h │ │ │ ├── SDL_power.h │ │ │ ├── SDL_metal.h │ │ │ ├── SDL_loadso.h │ │ │ ├── SDL_touch.h │ │ │ └── SDL_bits.h │ │ │ └── Resources │ │ │ ├── default.metallib │ │ │ ├── License.txt │ │ │ ├── ReadMe.txt │ │ │ └── Info.plist │ ├── SDL2 │ ├── Headers │ └── Resources ├── SDL2_ttf.framework │ ├── Versions │ │ ├── Current │ │ └── A │ │ │ ├── SDL2_ttf │ │ │ ├── Resources │ │ │ └── Info.plist │ │ │ └── _CodeSignature │ │ │ └── CodeResources │ ├── Headers │ ├── Resources │ ├── SDL2_ttf │ └── Frameworks ├── Windows │ ├── SDL │ │ ├── include │ │ │ ├── SDL_revision.h │ │ │ ├── SDL_copying.h │ │ │ ├── SDL_opengles2_gl2platform.h │ │ │ ├── SDL_types.h │ │ │ ├── SDL_name.h │ │ │ ├── SDL_opengles.h │ │ │ ├── close_code.h │ │ │ ├── SDL_opengles2.h │ │ │ ├── SDL_test_memory.h │ │ │ ├── SDL_test_log.h │ │ │ ├── SDL_clipboard.h │ │ │ ├── SDL_test.h │ │ │ ├── SDL_quit.h │ │ │ ├── SDL_test_compare.h │ │ │ ├── SDL_gesture.h │ │ │ ├── SDL_test_images.h │ │ │ ├── SDL_power.h │ │ │ ├── SDL_test_font.h │ │ │ ├── SDL_misc.h │ │ │ ├── SDL_config_minimal.h │ │ │ ├── SDL_loadso.h │ │ │ ├── SDL_touch.h │ │ │ └── SDL_bits.h │ │ ├── docs │ │ │ ├── README-platforms.md │ │ │ ├── README-wince.md │ │ │ ├── README-psp.md │ │ │ ├── README-pandora.md │ │ │ ├── README-hg.md │ │ │ ├── README-emscripten.md │ │ │ ├── README-os2.md │ │ │ ├── README-porting.md │ │ │ ├── README.md │ │ │ ├── README-windows.md │ │ │ ├── README-directfb.md │ │ │ └── README-cmake.md │ │ ├── README-SDL.txt │ │ ├── BUGS.txt │ │ ├── README.txt │ │ └── COPYING.txt │ └── SDL_ttf │ │ ├── COPYING.txt │ │ ├── README.txt │ │ └── CHANGES.txt ├── License.txt ├── ReadMe.txt └── ReadMeTTF.txt ├── CPUTests ├── 80186_tests │ ├── res_rep.bin │ ├── res_jump1.bin │ ├── res_strings.bin │ ├── add.bin │ ├── div.bin │ ├── mul.bin │ ├── rep.bin │ ├── sub.bin │ ├── bcdcnv.bin │ ├── cmpneg.bin │ ├── jmpmov.bin │ ├── jump1.bin │ ├── jump2.bin │ ├── rotate.bin │ ├── segpr.bin │ ├── shifts.bin │ ├── bitwise.bin │ ├── control.bin │ ├── datatrnf.bin │ ├── interrupt.bin │ ├── res_add.bin │ ├── res_div.bin │ ├── res_jump2.bin │ ├── res_mul.bin │ ├── res_segpr.bin │ ├── res_sub.bin │ ├── strings.bin │ ├── res_bcdcnv.bin │ ├── res_bitwise.bin │ ├── res_cmpneg.bin │ ├── res_control.bin │ ├── res_rotate.bin │ ├── res_shifts.bin │ ├── res_datatrnf.bin │ ├── res_interrupt.bin │ ├── control.asm │ ├── 80186_testsLICENSE.txt │ ├── interrupt.asm │ ├── jump2.asm │ ├── segpr.asm │ ├── strings.asm │ ├── jmpmov.asm │ ├── cmpneg.asm │ ├── datatrnf.asm │ ├── jump1.asm │ ├── sub.asm │ ├── shifts.asm │ └── mul.asm ├── DummyPortInterface.hpp ├── Makefile ├── CPUTestsMain.cpp └── CPUTests.cpp ├── DOS └── DOS1.img ├── CasetteBASIC.png ├── Fonts ├── README.NFO ├── Bm437_IBM_BIOS.FON ├── Bm437_IBM_CGA.FON ├── Px437_IBM_BIOS.ttf ├── Px437_IBM_CGA.ttf ├── Bm437_IBM_CGA-2y.FON ├── Px437_IBM_CGA-2y.ttf ├── Bm437_IBM_BIOS-2x.FON ├── Bm437_IBM_BIOS-2y.FON ├── Bm437_IBM_CGAthin.FON ├── Px437_IBM_BIOS-2x.ttf ├── Px437_IBM_BIOS-2y.ttf ├── Px437_IBM_CGAthin.ttf ├── Bm437_IBM_CGAthin-2y.FON └── Px437_IBM_CGAthin-2y.ttf ├── BIOS ├── pcxtbios.bin ├── 5150_2764_DIAG.BIN └── Original5150 │ └── BIOS_5150_24APR81_U33.BIN ├── KeyboardScanCodes.xlsx ├── CasetteBASIC ├── 5150cb10_1.bin ├── 5150cb10_2.bin ├── 5150cb10_3.bin └── 5150cb10_4.bin ├── notes.txt ├── DK86PC.xcodeproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── xcuserdata │ └── dave.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist └── xcshareddata │ └── xcschemes │ ├── CPUTests.xcscheme │ └── DK86PC.xcscheme ├── .github └── workflows │ └── cputests.yml ├── PortInterface.hpp ├── DebugTable └── generate_table.py ├── Types.h ├── PPI.hpp ├── VisualStudio └── DK86PC.sln ├── main.cpp ├── PIC.hpp ├── PIT.hpp ├── README.md ├── Memory.hpp ├── DMA.hpp ├── DMA.cpp ├── PC.hpp ├── FDC.hpp └── CGA.hpp /SDL/SDL2.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_rep.bin: -------------------------------------------------------------------------------- 1 | 4 -------------------------------------------------------------------------------- /SDL/SDL2.framework/SDL2: -------------------------------------------------------------------------------- 1 | Versions/Current/SDL2 -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_jump1.bin: -------------------------------------------------------------------------------- 1 | 4 -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_strings.bin: -------------------------------------------------------------------------------- 1 | 4 -------------------------------------------------------------------------------- /SDL/SDL2.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /SDL/SDL2.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/SDL2_ttf: -------------------------------------------------------------------------------- 1 | Versions/Current/SDL2_ttf -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/Frameworks: -------------------------------------------------------------------------------- 1 | Versions/Current/Frameworks -------------------------------------------------------------------------------- /DOS/DOS1.img: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/DOS/DOS1.img -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /CasetteBASIC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CasetteBASIC.png -------------------------------------------------------------------------------- /Fonts/README.NFO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/README.NFO -------------------------------------------------------------------------------- /BIOS/pcxtbios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/BIOS/pcxtbios.bin -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/hidapi: -------------------------------------------------------------------------------- 1 | Versions/Current/hidapi -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /BIOS/5150_2764_DIAG.BIN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/BIOS/5150_2764_DIAG.BIN -------------------------------------------------------------------------------- /Fonts/Bm437_IBM_BIOS.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Bm437_IBM_BIOS.FON -------------------------------------------------------------------------------- /Fonts/Bm437_IBM_CGA.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Bm437_IBM_CGA.FON -------------------------------------------------------------------------------- /Fonts/Px437_IBM_BIOS.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Px437_IBM_BIOS.ttf -------------------------------------------------------------------------------- /Fonts/Px437_IBM_CGA.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Px437_IBM_CGA.ttf -------------------------------------------------------------------------------- /KeyboardScanCodes.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/KeyboardScanCodes.xlsx -------------------------------------------------------------------------------- /Fonts/Bm437_IBM_CGA-2y.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Bm437_IBM_CGA-2y.FON -------------------------------------------------------------------------------- /Fonts/Px437_IBM_CGA-2y.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Px437_IBM_CGA-2y.ttf -------------------------------------------------------------------------------- /CPUTests/80186_tests/add.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/add.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/div.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/div.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/mul.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/mul.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/rep.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/rep.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/sub.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/sub.bin -------------------------------------------------------------------------------- /CasetteBASIC/5150cb10_1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CasetteBASIC/5150cb10_1.bin -------------------------------------------------------------------------------- /CasetteBASIC/5150cb10_2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CasetteBASIC/5150cb10_2.bin -------------------------------------------------------------------------------- /CasetteBASIC/5150cb10_3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CasetteBASIC/5150cb10_3.bin -------------------------------------------------------------------------------- /CasetteBASIC/5150cb10_4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CasetteBASIC/5150cb10_4.bin -------------------------------------------------------------------------------- /Fonts/Bm437_IBM_BIOS-2x.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Bm437_IBM_BIOS-2x.FON -------------------------------------------------------------------------------- /Fonts/Bm437_IBM_BIOS-2y.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Bm437_IBM_BIOS-2y.FON -------------------------------------------------------------------------------- /Fonts/Bm437_IBM_CGAthin.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Bm437_IBM_CGAthin.FON -------------------------------------------------------------------------------- /Fonts/Px437_IBM_BIOS-2x.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Px437_IBM_BIOS-2x.ttf -------------------------------------------------------------------------------- /Fonts/Px437_IBM_BIOS-2y.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Px437_IBM_BIOS-2y.ttf -------------------------------------------------------------------------------- /Fonts/Px437_IBM_CGAthin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Px437_IBM_CGAthin.ttf -------------------------------------------------------------------------------- /CPUTests/80186_tests/bcdcnv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/bcdcnv.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/cmpneg.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/cmpneg.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/jmpmov.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/jmpmov.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/jump1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/jump1.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/jump2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/jump2.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/rotate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/rotate.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/segpr.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/segpr.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/shifts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/shifts.bin -------------------------------------------------------------------------------- /Fonts/Bm437_IBM_CGAthin-2y.FON: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Bm437_IBM_CGAthin-2y.FON -------------------------------------------------------------------------------- /Fonts/Px437_IBM_CGAthin-2y.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/Fonts/Px437_IBM_CGAthin-2y.ttf -------------------------------------------------------------------------------- /CPUTests/80186_tests/bitwise.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/bitwise.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/control.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/control.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/datatrnf.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/datatrnf.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/interrupt.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/interrupt.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_add.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_add.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_div.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_div.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_jump2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_jump2.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_mul.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_mul.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_segpr.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_segpr.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_sub.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_sub.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/strings.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/strings.bin -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/SDL2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/SDL/SDL2.framework/Versions/A/SDL2 -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_bcdcnv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_bcdcnv.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_bitwise.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_bitwise.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_cmpneg.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_cmpneg.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_control.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_control.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_rotate.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_rotate.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_shifts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_shifts.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_datatrnf.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_datatrnf.bin -------------------------------------------------------------------------------- /CPUTests/80186_tests/res_interrupt.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/CPUTests/80186_tests/res_interrupt.bin -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-14525:e52d96ea04fc" 2 | #define SDL_REVISION_NUMBER 14525 3 | -------------------------------------------------------------------------------- /BIOS/Original5150/BIOS_5150_24APR81_U33.BIN: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/BIOS/Original5150/BIOS_5150_24APR81_U33.BIN -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/Versions/A/SDL2_ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/SDL/SDL2_ttf.framework/Versions/A/SDL2_ttf -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-13609:34cc7d3b69d3" 2 | #define SDL_REVISION_NUMBER 13609 3 | -------------------------------------------------------------------------------- /notes.txt: -------------------------------------------------------------------------------- 1 | 2 | LLDB Read Reset vector 3 | memory read -t byte -fX -c8 'memory.ram + 0xFFFF0' 4 | 5 | Support Chips 8237, 8253, 8259, cga, soundblaster 6 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Resources/default.metallib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/SDL/SDL2.framework/Versions/A/Resources/default.metallib -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/hidapi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/davecom/DK86PC/HEAD/SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/hidapi -------------------------------------------------------------------------------- /DK86PC.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-platforms.md: -------------------------------------------------------------------------------- 1 | Platforms 2 | ========= 3 | 4 | We maintain the list of supported platforms on our wiki now, and how to 5 | build and install SDL for those platforms: 6 | 7 | https://wiki.libsdl.org/Installation 8 | 9 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-wince.md: -------------------------------------------------------------------------------- 1 | WinCE 2 | ===== 3 | 4 | Windows CE is no longer supported by SDL. 5 | 6 | We have left the CE support in SDL 1.2 for those that must have it, and we 7 | have support for Windows Phone 8 and WinRT in SDL2, as of SDL 2.0.3. 8 | 9 | --ryan. 10 | 11 | -------------------------------------------------------------------------------- /DK86PC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-orig.txt: -------------------------------------------------------------------------------- 1 | HIDAPI - Multi-Platform library for 2 | communication with HID devices. 3 | 4 | Copyright 2009, Alan Ott, Signal 11 Software. 5 | All Rights Reserved. 6 | 7 | This software may be used by anyone for any reason so 8 | long as the copyright notice in the source files 9 | remains intact. 10 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-psp.md: -------------------------------------------------------------------------------- 1 | PSP 2 | ====== 3 | SDL port for the Sony PSP contributed by 4 | Captian Lex 5 | 6 | Credit to 7 | Marcus R.Brown,Jim Paris,Matthew H for the original SDL 1.2 for PSP 8 | Geecko for his PSP GU lib "Glib2d" 9 | 10 | Building 11 | -------- 12 | To build for the PSP, make sure psp-config is in the path and run: 13 | make -f Makefile.psp 14 | 15 | 16 | 17 | To Do 18 | ------ 19 | PSP Screen Keyboard 20 | -------------------------------------------------------------------------------- /.github/workflows/cputests.yml: -------------------------------------------------------------------------------- 1 | name: CPUTests 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | defaults: 15 | run: 16 | working-directory: ./CPUTests 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: make 21 | run: make 22 | - name: cputest 23 | run: ./cputest 24 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/README-SDL.txt: -------------------------------------------------------------------------------- 1 | 2 | Please distribute this file with the SDL runtime environment: 3 | 4 | The Simple DirectMedia Layer (SDL for short) is a cross-platform library 5 | designed to make it easy to write multi-media software, such as games 6 | and emulators. 7 | 8 | The Simple DirectMedia Layer library source code is available from: 9 | https://www.libsdl.org/ 10 | 11 | This library is distributed under the terms of the zlib license: 12 | http://www.zlib.net/zlib_license.html 13 | 14 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/AUTHORS.txt: -------------------------------------------------------------------------------- 1 | 2 | HIDAPI Authors: 3 | 4 | Alan Ott : 5 | Original Author and Maintainer 6 | Linux, Windows, and Mac implementations 7 | 8 | Ludovic Rousseau : 9 | Formatting for Doxygen documentation 10 | Bug fixes 11 | Correctness fixes 12 | 13 | 14 | For a comprehensive list of contributions, see the commit list at github: 15 | https://github.com/libusb/hidapi/commits/master 16 | 17 | -------------------------------------------------------------------------------- /PortInterface.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // PortInterface.hpp 3 | // DK86PC 4 | // 5 | // Created by David Kopec on 8/29/20. 6 | // Copyright © 2020 David Kopec. All rights reserved. 7 | // 8 | 9 | #ifndef PortInterface_h 10 | #define PortInterface_h 11 | 12 | #include "Types.h" 13 | 14 | namespace DK86PC { 15 | 16 | class PortInterface { 17 | public: 18 | virtual void writePort(word port, word value) = 0; 19 | virtual word readPort(word port) = 0; 20 | }; 21 | 22 | } 23 | 24 | #endif /* PortInterface_h */ 25 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/BUGS.txt: -------------------------------------------------------------------------------- 1 | 2 | Bugs are now managed in the SDL bug tracker, here: 3 | 4 | https://bugzilla.libsdl.org/ 5 | 6 | You may report bugs there, and search to see if a given issue has already 7 | been reported, discussed, and maybe even fixed. 8 | 9 | 10 | You may also find help at the SDL forums/mailing list: 11 | 12 | https://discourse.libsdl.org/ 13 | 14 | Bug reports are welcome here, but we really appreciate if you use Bugzilla, as 15 | bugs discussed on the mailing list may be forgotten or missed. 16 | 17 | -------------------------------------------------------------------------------- /DebugTable/generate_table.py: -------------------------------------------------------------------------------- 1 | import csv 2 | 3 | with open("8086_table.txt") as table_file: 4 | groups = {} 5 | for line in csv.reader(table_file, dialect="excel-tab"): 6 | if (len(line) > 1): 7 | if line[0].startswith("GRP"): 8 | group: str = line[0][:-2] 9 | if group not in groups: 10 | groups[group] = [('\"' + line[1] + '\"')] 11 | else: 12 | groups[group].append('\"' + line[1] + '\"') 13 | else: 14 | print(f'{{ 0x{line[0]}, "{line[1]}" }},') 15 | for group in groups: 16 | print("string[8]", group, "= {", ', '.join(groups[group]), "};") 17 | print(groups) -------------------------------------------------------------------------------- /CPUTests/DummyPortInterface.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // DummyPortInterface.hpp 3 | // CPUTests 4 | // 5 | // Created by David Kopec on 8/29/20. 6 | // Copyright © 2020 David Kopec. All rights reserved. 7 | // 8 | 9 | #ifndef DummyPortInterface_h 10 | #define DummyPortInterface_h 11 | 12 | #include "PortInterface.hpp" 13 | 14 | using namespace DK86PC; 15 | 16 | class DummyPortInterface: public PortInterface { 17 | void writePort(word port, word value) override { 18 | return; 19 | }; 20 | word readPort(word port) override { 21 | return 0; 22 | }; 23 | }; 24 | 25 | 26 | #endif /* DummyPortInterface_h */ 27 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE.txt: -------------------------------------------------------------------------------- 1 | HIDAPI can be used under one of three licenses. 2 | 3 | 1. The GNU General Public License, version 3.0, in LICENSE-gpl3.txt 4 | 2. A BSD-Style License, in LICENSE-bsd.txt. 5 | 3. The more liberal original HIDAPI license. LICENSE-orig.txt 6 | 7 | The license chosen is at the discretion of the user of HIDAPI. For example: 8 | 1. An author of GPL software would likely use HIDAPI under the terms of the 9 | GPL. 10 | 11 | 2. An author of commercial closed-source software would likely use HIDAPI 12 | under the terms of the BSD-style license or the original HIDAPI license. 13 | 14 | -------------------------------------------------------------------------------- /CPUTests/Makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | FLAGS = -std=c++17 -DDEBUG -DCPU_TESTS -Werror 3 | VPATH = ../ 4 | OBJECTS = CPUTests.o CPUTestsMain.o Memory.o CPU.o 5 | 6 | cputest: $(OBJECTS) 7 | $(CC) $(OBJECTS) -o cputest 8 | 9 | CPUTestsMain.o: CPUTestsMain.cpp catch.hpp 10 | $(CC) $(FLAGS) -c CPUTestsMain.cpp 11 | 12 | CPUTests.o: CPUTests.cpp Types.h DummyPortInterface.hpp catch.hpp Memory.hpp CPU.hpp 13 | $(CC) $(FLAGS) -I.. -c CPUTests.cpp 14 | 15 | Memory.o: Memory.cpp Memory.hpp Types.h 16 | $(CC) $(FLAGS) -I.. -c ../Memory.cpp 17 | 18 | CPU.o: CPU.cpp Memory.hpp Types.h Instructions.h CPU.hpp PortInterface.hpp 19 | $(CC) $(FLAGS) -I.. -c ../CPU.cpp 20 | 21 | clean: 22 | rm cputest *.o 23 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | 4 | (SDL) 5 | 6 | Version 2.0 7 | 8 | --- 9 | https://www.libsdl.org/ 10 | 11 | Simple DirectMedia Layer is a cross-platform development library designed 12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics 13 | hardware via OpenGL and Direct3D. It is used by video playback software, 14 | emulators, and popular games including Valve's award winning catalog 15 | and many Humble Bundle games. 16 | 17 | More extensive documentation is available in the docs directory, starting 18 | with README.md 19 | 20 | Enjoy! 21 | Sam Lantinga (slouken@libsdl.org) 22 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-pandora.md: -------------------------------------------------------------------------------- 1 | Pandora 2 | ===================================================================== 3 | 4 | ( http://openpandora.org/ ) 5 | - A pandora specific video driver was written to allow SDL 2.0 with OpenGL ES 6 | support to work on the pandora under the framebuffer. This driver do not have 7 | input support for now, so if you use it you will have to add your own control code. 8 | The video driver name is "pandora" so if you have problem running it from 9 | the framebuffer, try to set the following variable before starting your application : 10 | "export SDL_VIDEODRIVER=pandora" 11 | 12 | - OpenGL ES support was added to the x11 driver, so it's working like the normal 13 | x11 driver one with OpenGLX support, with SDL input event's etc.. 14 | 15 | 16 | David Carré (Cpasjuste) 17 | cpasjuste@gmail.com 18 | -------------------------------------------------------------------------------- /DK86PC.xcodeproj/xcuserdata/dave.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CPUTests.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 1 11 | 12 | DK86PC.xcscheme_^#shared#^_ 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 557530D522E7E69A009C1B28 21 | 22 | primary 23 | 24 | 25 | 5594A57324FAED260089E59F 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-hg.md: -------------------------------------------------------------------------------- 1 | Mercurial 2 | ========= 3 | 4 | The latest development version of SDL is available via Mercurial. 5 | Mercurial allows you to get up-to-the-minute fixes and enhancements; 6 | as a developer works on a source tree, you can use "hg" to mirror that 7 | source tree instead of waiting for an official release. Please look 8 | at the Mercurial website ( https://www.mercurial-scm.org/ ) for more 9 | information on using hg, where you can also download software for 10 | Mac OS X, Windows, and Unix systems. 11 | 12 | hg clone http://hg.libsdl.org/SDL 13 | 14 | If you are building SDL via configure, you will need to run autogen.sh 15 | before running configure. 16 | 17 | There is a web interface to the subversion repository at: 18 | http://hg.libsdl.org/SDL/ 19 | 20 | There is an RSS feed available at that URL, for those that want to 21 | track commits in real time. 22 | 23 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/control.asm: -------------------------------------------------------------------------------- 1 | ;1. clc 2 | ;2. cld 3 | ;3. cli 4 | ;4. cmc 5 | ;5. hlt 6 | ;6. nop 7 | ;7. stc 8 | ;8. std 9 | ;9. sti 10 | ;Memory contents at the end should be: 11 | ;00000h: d6 08 03 06 12 | 13 | 14 | use16 15 | org 0 16 | start: 17 | mov ax,1000h 18 | mov ss,ax 19 | mov sp,1000h 20 | 21 | mov cx,0feffh 22 | push cx 23 | popf 24 | 25 | clc ; (1) 26 | cld ; (2) 27 | cli ; (3) 28 | 29 | nop ; (6) 30 | 31 | pushf 32 | pop ax ; ax = 08d6h 33 | 34 | mov dx,1 35 | push dx 36 | popf 37 | 38 | cmc ; (4) 39 | stc ; (7) 40 | std ; (8) 41 | sti ; (9) 42 | 43 | pushf 44 | pop bx ; bx = 0603h 45 | 46 | mov cx,0 47 | mov ds,cx 48 | mov word [0],ax 49 | mov word [2],bx 50 | 51 | hlt ;(5) 52 | 53 | rb 65520-$ 54 | jmp start 55 | 56 | rb 65535-$ 57 | db 0ffh 58 | -------------------------------------------------------------------------------- /SDL/License.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | -------------------------------------------------------------------------------- /Types.h: -------------------------------------------------------------------------------- 1 | // 2 | // Types.h 3 | // DK86PC 4 | // 5 | // Created by David Kopec on 7/23/19. 6 | // Copyright © 2019 David Kopec. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | 12 | #ifndef Types_h 13 | #define Types_h 14 | 15 | using namespace std; 16 | 17 | namespace DK86PC { 18 | 19 | #define lowNibble(b) ((b) & 0x0F) 20 | #define highNibble(b) (((b) & 0xF0) >> 4) 21 | 22 | #define highBitByte(b) (((b) >> 7) & 1) 23 | #define highBitWord(w) (((w) >> 15) & 1) 24 | #define lowBit(b) ((b) & 1) 25 | 26 | #define lowByte(w) ((byte) ((w) & 0x00FF)) 27 | #define highByte(w) ((byte) (((w) & 0xFF00) >> 8)) 28 | 29 | typedef uint8_t byte; 30 | typedef uint16_t word; 31 | typedef uint32_t address; 32 | 33 | inline word signExtend(byte original) { 34 | if (original & 0x80) { 35 | return ((word) original | 0xFF00); 36 | } 37 | return (word) original; 38 | } 39 | 40 | 41 | } 42 | 43 | #endif /* Types_h */ 44 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Resources/License.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /CPUTests/CPUTestsMain.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CPUTestsMain.cpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | #define CATCH_CONFIG_RUNNER 21 | #include "catch.hpp" 22 | 23 | 24 | 25 | int main(int argc, const char * argv[]) { 26 | int result = Catch::Session().run( argc, argv ); 27 | 28 | return result; 29 | } 30 | -------------------------------------------------------------------------------- /SDL/Windows/SDL_ttf/COPYING.txt: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts 3 | Copyright (C) 1997-2019 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/80186_testsLICENSE.txt: -------------------------------------------------------------------------------- 1 | The files in this directory were originally produced by Artem Litvinovich. 2 | 3 | They were based on earlier sources from the Zet project. 4 | 5 | As derivative works, Artem confirms they should be released under the GPL 3: 6 | https://twitter.com/theartlav/status/1299816147165081606 7 | 8 | // Copyright (C) Artem Litvinovich, Zet project 9 | // 10 | // This program is free software: you can redistribute it and/or modify 11 | // it under the terms of the GNU General Public License as published by 12 | // the Free Software Foundation, either version 3 of the License, or 13 | // (at your option) any later version. 14 | // 15 | // This program is distributed in the hope that it will be useful, 16 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | // GNU General Public License for more details. 19 | // 20 | // You should have received a copy of the GNU General Public License 21 | // along with this program. If not, see . 22 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-emscripten.md: -------------------------------------------------------------------------------- 1 | Emscripten 2 | ================================================================================ 3 | 4 | Build: 5 | 6 | $ mkdir build 7 | $ cd build 8 | $ emconfigure ../configure --host=asmjs-unknown-emscripten --disable-assembly --disable-threads --disable-cpuinfo CFLAGS="-O2" 9 | $ emmake make 10 | 11 | Or with cmake: 12 | 13 | $ mkdir build 14 | $ cd build 15 | $ emcmake cmake .. 16 | $ emmake make 17 | 18 | To build one of the tests: 19 | 20 | $ cd test/ 21 | $ emcc -O2 --js-opts 0 -g4 testdraw2.c -I../include ../build/.libs/libSDL2.a ../build/libSDL2_test.a -o a.html 22 | 23 | Uses GLES2 renderer or software 24 | 25 | Some other SDL2 libraries can be easily built (assuming SDL2 is installed somewhere): 26 | 27 | SDL_mixer (http://www.libsdl.org/projects/SDL_mixer/): 28 | 29 | $ EMCONFIGURE_JS=1 emconfigure ../configure 30 | build as usual... 31 | 32 | SDL_gfx (http://cms.ferzkopp.net/index.php/software/13-sdl-gfx): 33 | 34 | $ EMCONFIGURE_JS=1 emconfigure ../configure --disable-mmx 35 | build as usual... 36 | -------------------------------------------------------------------------------- /SDL/Windows/SDL_ttf/README.txt: -------------------------------------------------------------------------------- 1 | 2 | This library is a wrapper around the excellent FreeType 2.0 library, 3 | available at: 4 | http://www.freetype.org/ 5 | 6 | This library allows you to use TrueType fonts to render text in SDL 7 | applications. 8 | 9 | To make the library, first install the FreeType library, then type 10 | './configure' then 'make' to build the SDL truetype library and the 11 | showfont and glfont example applications. 12 | 13 | Be careful when including fonts with your application, as many of them 14 | are copyrighted. The Microsoft fonts, for example, are not freely 15 | redistributable and even the free "web" fonts they provide are only 16 | redistributable in their special executable installer form (May 1998). 17 | There are plenty of freeware and shareware fonts available on the Internet 18 | though, and may suit your purposes. 19 | 20 | This library is under the zlib license, see the file "COPYING.txt" for details. 21 | 22 | Portions of this software are copyright © 2013 The FreeType Project (www.freetype.org). All rights reserved. 23 | 24 | Enjoy! 25 | -Sam Lantinga (6/20/2001) 26 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/interrupt.asm: -------------------------------------------------------------------------------- 1 | ;00h: 00 01 02 03 04 05 06 XX D7 0c d7 0E 02 40 FF 04 2 | ;10h: 00 00 00 f0 3 | 4 | use16 5 | start: 6 | mov dx,0 7 | mov ds,dx 8 | mov sp,1000h 9 | mov sp,ss 10 | mov word[52],0ebe0h 11 | mov word[54],0e342h 12 | 13 | mov ax,0effh 14 | push ax 15 | popf 16 | mov byte [0],0 17 | int 13 ; (1) 18 | mov byte [2],2 19 | jmp ax 20 | 21 | rb 0cd7h-$ 22 | mov byte[3],3 23 | pushf 24 | pop bx 25 | mov word[12],0ebe0h 26 | mov word[14],0e342h 27 | 28 | int 3 ; (2) 29 | mov byte[4],4 30 | mov word[16],03001h 31 | mov word[18],0f000h 32 | 33 | into ; (3) branch taken 34 | hlt 35 | 36 | rb 02000h-$ 37 | mov byte[1],1 38 | pushf 39 | pop ax 40 | clc 41 | iret ; (4) 42 | 43 | rb 03001h-$ 44 | mov byte[5],5 45 | pop cx 46 | mov cx,4002h 47 | push cx 48 | iret 49 | 50 | rb 04002h-$ 51 | mov byte[6],6 52 | mov dx,4ffh 53 | push dx 54 | popf 55 | mov word[16],5000h 56 | 57 | into ; (3) branch not taken 58 | mov word[8],ax 59 | mov word[10],bx 60 | mov word[12],cx 61 | mov word[14],dx 62 | mov word[16],sp 63 | hlt 64 | 65 | rb 05000h-$ 66 | hlt 67 | 68 | rb 65520-$ 69 | jmp start 70 | rb 65535-$ 71 | db 0ffh 72 | -------------------------------------------------------------------------------- /SDL/ReadMe.txt: -------------------------------------------------------------------------------- 1 | The Simple DirectMedia Layer (SDL for short) is a cross-platform 2 | library designed to make it easy to write multi-media software, 3 | such as games and emulators. 4 | 5 | The Simple DirectMedia Layer library source code is available from: 6 | http://www.libsdl.org/ 7 | 8 | This library is distributed under the terms of the zlib license: 9 | http://zlib.net/zlib_license.html 10 | 11 | 12 | This packages contains the SDL framework for OS X. 13 | Conforming with Apple guidelines, this framework 14 | contains both the SDL runtime component and development header files. 15 | 16 | 17 | To Install: 18 | Copy the SDL2.framework to /Library/Frameworks 19 | 20 | You may alternatively install it in /Library/Frameworks 21 | if your access privileges are not high enough. 22 | 23 | 24 | Additional References: 25 | 26 | - Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are 27 | available at: 28 | http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips 29 | Though these are OpenSceneGraph centric, the same exact concepts apply to 30 | SDL, thus the videos are recommended for everybody getting started with 31 | developing on Mac OS X. (You can skim over the PlugIns stuff since SDL 32 | doesn't have any PlugIns to worry about.) 33 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/jump2.asm: -------------------------------------------------------------------------------- 1 | ;00: f0 2f 2 | 3 | use16 4 | start: 5 | mov bx,0f000h 6 | mov ds,bx 7 | mov ax,01290h 8 | 9 | mov cx,5 10 | again: 11 | push cx 12 | loop again ; (6) 13 | 14 | call ax ; (2) 15 | ret ; (9) 16 | 17 | rb 01290h-$ 18 | ag2: 19 | mov cx,0ffffh 20 | loope ag2 ; (7) branch not taken 21 | mov dx,64 22 | push dx 23 | popf 24 | loope cont ; (7) branch taken 25 | hlt 26 | cont: 27 | call 0e342h:0ebe0h ; (4) 28 | jcxz cont ; (13) branch not taken 29 | mov cx,0 30 | jcxz exit ; (13) branch taken 31 | hlt 32 | exit: 33 | ret 10 ; (10) 34 | 35 | rb 2000h-$ 36 | call word [03000h] ; (3) 37 | mov dx,0 38 | push dx 39 | popf 40 | hang: 41 | mov cx,1 42 | loopnz hang ; (8) branch not taken 43 | loopne cont1 ; (8) branch taken 44 | hlt 45 | cont1: 46 | retf ; (11) 47 | 48 | rb 03000h-$ 49 | dw 0fde0h 50 | dw 04000h 51 | dw 0f000h 52 | 53 | rb 03200h-$ 54 | mov bx,02ff0h 55 | mov si,10h 56 | push dx 57 | call far [bx+si+2] ; (5) 58 | ret 59 | 60 | rb 04000h-$ 61 | retf 2 ; (12) 62 | 63 | rb 65520-$ 64 | mov sp,1000h 65 | mov ss,sp 66 | call start ; (1) 67 | mov ds,cx 68 | mov word[0],bx 69 | hlt 70 | 71 | rb 65535-$ 72 | db 0ffh 73 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Resources/ReadMe.txt: -------------------------------------------------------------------------------- 1 | The Simple DirectMedia Layer (SDL for short) is a cross-platform 2 | library designed to make it easy to write multi-media software, 3 | such as games and emulators. 4 | 5 | The Simple DirectMedia Layer library source code is available from: 6 | http://www.libsdl.org/ 7 | 8 | This library is distributed under the terms of the zlib license: 9 | http://zlib.net/zlib_license.html 10 | 11 | 12 | This packages contains the SDL framework for OS X. 13 | Conforming with Apple guidelines, this framework 14 | contains both the SDL runtime component and development header files. 15 | 16 | 17 | To Install: 18 | Copy the SDL2.framework to /Library/Frameworks 19 | 20 | You may alternatively install it in /Library/Frameworks 21 | if your access privileges are not high enough. 22 | 23 | 24 | Additional References: 25 | 26 | - Screencast tutorials for getting started with OpenSceneGraph/Mac OS X are 27 | available at: 28 | http://www.openscenegraph.org/projects/osg/wiki/Support/Tutorials/MacOSXTips 29 | Though these are OpenSceneGraph centric, the same exact concepts apply to 30 | SDL, thus the videos are recommended for everybody getting started with 31 | developing on Mac OS X. (You can skim over the PlugIns stuff since SDL 32 | doesn't have any PlugIns to worry about.) 33 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 20C69 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | SDL2_ttf 11 | CFBundleIdentifier 12 | org.libsdl.SDL2-ttf 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SDL2_ttf 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 2.0.15 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 2.0.15 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 12C33 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 11.1 35 | DTSDKBuild 36 | 20C63 37 | DTSDKName 38 | macosx11.1 39 | DTXcode 40 | 1230 41 | DTXcodeBuild 42 | 12C33 43 | LSMinimumSystemVersion 44 | 10.6 45 | 46 | 47 | -------------------------------------------------------------------------------- /PPI.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // PPI.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | // implement the intel 8255 21 | 22 | #ifndef PPI_hpp 23 | #define PPI_hpp 24 | 25 | #include 26 | #include "Types.h" 27 | #include "PIC.hpp" 28 | #include 29 | 30 | namespace DK86PC { 31 | class PPI { 32 | public: 33 | PPI(PIC &pic) : pic(pic), a(16), b(16), c(0), control(0) {}; 34 | void setB(byte value); 35 | void setControl(byte value); 36 | byte readA(); 37 | byte readB(); 38 | byte readC(); 39 | void keyboardDown(SDL_Keysym s); 40 | void keyboardUp(SDL_Keysym s); 41 | private: 42 | byte a, b, c, control; // registers 43 | PIC &pic; 44 | }; 45 | } 46 | 47 | #endif /* PPI_hpp */ 48 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 20B29 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | hidapi 11 | CFBundleIdentifier 12 | org.libsdl.hidapi 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | hidapi 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 1.0 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 12B45b 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 11.0 35 | DTSDKBuild 36 | 20A2408 37 | DTSDKName 38 | macosx11.0 39 | DTXcode 40 | 1220 41 | DTXcodeBuild 42 | 12B45b 43 | LSMinimumSystemVersion 44 | 10.6 45 | 46 | 47 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /VisualStudio/DK86PC.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31025.194 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DK86PC", "DK86PC.vcxproj", "{6106EE90-0923-44D7-8EDB-F23E48E06415}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E290B7A0-271B-4942-9D87-E09A80EBB085}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Debug|x64.ActiveCfg = Debug|x64 19 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Debug|x64.Build.0 = Debug|x64 20 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Debug|x86.ActiveCfg = Debug|Win32 21 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Debug|x86.Build.0 = Debug|Win32 22 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Release|x64.ActiveCfg = Release|x64 23 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Release|x64.Build.0 = Release|x64 24 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Release|x86.ActiveCfg = Release|x64 25 | {6106EE90-0923-44D7-8EDB-F23E48E06415}.Release|x86.Build.0 = Release|x64 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(ExtensibilityGlobals) = postSolution 31 | SolutionGuid = {820B0CC7-F2ED-4A43-9012-FDD1EC102AD1} 32 | EndGlobalSection 33 | EndGlobal 34 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 20B29 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | SDL2 11 | CFBundleGetInfoString 12 | http://www.libsdl.org 13 | CFBundleIdentifier 14 | org.libsdl.SDL2 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | Simple DirectMedia Layer 19 | CFBundlePackageType 20 | FMWK 21 | CFBundleShortVersionString 22 | 2.0.12 23 | CFBundleSignature 24 | SDLX 25 | CFBundleSupportedPlatforms 26 | 27 | MacOSX 28 | 29 | CFBundleVersion 30 | 2.0.12 31 | DTCompiler 32 | com.apple.compilers.llvm.clang.1_0 33 | DTPlatformBuild 34 | 12B45b 35 | DTPlatformName 36 | macosx 37 | DTPlatformVersion 38 | 11.0 39 | DTSDKBuild 40 | 20A2408 41 | DTSDKName 42 | macosx11.0 43 | DTXcode 44 | 1220 45 | DTXcodeBuild 46 | 12B45b 47 | LSMinimumSystemVersion 48 | 10.6 49 | 50 | 51 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Frameworks/hidapi.framework/Versions/A/Resources/LICENSE-bsd.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Alan Ott, Signal 11 Software 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Signal 11 Software nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /SDL/Windows/SDL_ttf/CHANGES.txt: -------------------------------------------------------------------------------- 1 | 2.0.15: 2 | Sam Lantinga - Fri Oct 26 13:26:54 PDT 2018 3 | * Updated to FreeType version 2.9.1 4 | Sam Lantinga - Sun Sep 10 00:18:45 PDT 2017 5 | * Text rendering functions now use the alpha component of the text colors 6 | Sam Lantinga - Sat Sep 9 22:21:55 PDT 2017 7 | * Added support for characters greater than 0xFFFF (e.g. emoji) in the UTF-8 APIs 8 | 9 | 2.0.14: 10 | Ryan Gordon - Fri Jan 29 12:53:29 PST 2016 11 | * Deprecated TTF_GetFontKerningSize() which takes font glyph indices and added TTF_GetFontKerningSizeGlyphs() which takes characters 12 | 13 | 2.0.13: 14 | Sylvain - Sat Jun 28 11:42:42 2014 15 | * Fixed bug rendering text starting with a glyph with negative starting offset 16 | beuc - Sun Jun 15 18:27:28 2014 17 | * Fixed regression loading non-scalable fonts 18 | Sam Lantinga - Sun Jun 15 18:21:04 PDT 2014 19 | * TTF_GetFontKerningSize() gets kerning between two characters, not two glyph indices 20 | David Ludwig - Sun Apr 13 22:28:26 2014 21 | * Added support for building for Windows RT and Windows Phone 22 | 23 | 2.0.12: 24 | Sam Lantinga - Sat Jun 1 19:11:26 PDT 2013 25 | * Updated for SDL 2.0 release 26 | 27 | 2.0.11: 28 | Sam Lantinga - Sat Dec 31 10:49:42 EST 2011 29 | * SDL_ttf is now under the zlib license 30 | Peter Kosyh - Mon Feb 28 14:57:03 PST 2011 31 | * Improved font glyph caching for non-latin languages 32 | Erik Snoek - Wed Jan 12 09:10:15 PST 2011 33 | * Added API to get kerning info: TTF_GetFontKerningSize() 34 | Sam Lantinga - Mon Jan 10 10:58:34 2011 -0800 35 | * Added Android.mk to build on the Android platform 36 | 37 | 2.0.10: 38 | Adam Strzelecki - Wed Oct 21 21:02:37 PDT 2009 39 | * Find the Unicode or symbol character map if it's available in the font 40 | -------------------------------------------------------------------------------- /SDL/ReadMeTTF.txt: -------------------------------------------------------------------------------- 1 | SDL_ttf is an example portable font rendering library for use with SDL. 2 | 3 | The source code is available from: http://www.libsdl.org/projects/SDL_ttf 4 | 5 | This library is distributed under the terms of the zlib license: http://www.zlib.net/zlib_license.html 6 | 7 | Portions of this software are copyright © 2013 The FreeType Project (www.freetype.org). All rights reserved. 8 | 9 | This packages contains the SDL2_ttf.framework for OS X. Conforming with Apple guidelines, this framework contains both the SDL runtime component and development header files. 10 | 11 | Requirements: 12 | You must have the SDL2.framework installed. 13 | 14 | To Install: 15 | Copy the SDL2_ttf.framework to /Library/Frameworks 16 | 17 | You may alternatively install it in /Library/Frameworks if your access privileges are not high enough. (Be aware that the Xcode templates we provide in the SDL Developer Extras package may require some adjustment for your system if you do this.) 18 | 19 | 20 | (Partial) History of PB/Xcode projects: 21 | 2009-09-21 - Updated for 64-bit (Snow Leopard) Universal Binaries. 22 | Switched to 10.4 minimum requirement. 23 | Now dynamic linking Mac OS X bundled freetype directly in /usr/X11R6. (We used to just copy this one into our package since older versions of Mac OS X didn't ship with the library.) 24 | Reason: We no longer statically link libfreetype.a into the binary because Apple stopped supplying a libfreetype.a in the 10.5 and 10.6 SDKs. 25 | For static library target, you will need to link against libfreetype.dylib for your final app. 26 | 27 | 2006-01-31 - First entry in history. Updated for Universal Binaries. Static library of libfreetype has been updated by copying the version Apple provides from the 10.4u SDK. 28 | 29 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/segpr.asm: -------------------------------------------------------------------------------- 1 | ;00: 00 11 00 f0 00 11 00 f0 1c 00 45 23 78 00 5f 00 2 | ;10: 07 00 00 00 00 12 01 ff ff 80 02 00 XX XX XX XX 3 | ;20: XX XX XX XX XX XX 97 00 79 00 65 00 00 f0 02 00 4 | 5 | use16 6 | start: 7 | mov bx,0f100h 8 | mov es,bx 9 | 10 | mov bx,word[es:0] 11 | mov ax,word[es:2] 12 | mov word[2],ax 13 | mov sp,2 14 | db 26h 15 | push bx 16 | 17 | les dx, [es:0] 18 | mov word[4],dx 19 | mov dx,es 20 | mov word[6],dx 21 | 22 | mov di,5 23 | lea si,word[cs:bp+di+23] 24 | mov word[8],si 25 | 26 | mov bx,5 27 | mov ax,5 28 | mov word[10],2345h 29 | mov dx,0f100h 30 | mov es,dx 31 | db 26h 32 | xlatb 33 | mov word[12],ax 34 | 35 | ; inc with segment 36 | mov ax,1 37 | mov ss,ax 38 | mov word[16],6 39 | inc word[ss:0] 40 | 41 | ; div with interrupt 42 | mov sp,32 43 | mov word[18],0 44 | db 036h 45 | db 0f3h 46 | div word[2] 47 | sub sp,6 48 | 49 | mov word[20],1200h 50 | mov bx,5 51 | mov si,3 52 | ; repz prefix (do not affect) 53 | db 0f3h 54 | call word [ss:bx+si-4] 55 | 56 | hlt 57 | 58 | rb 1000h-$ 59 | dw 1100h 60 | dw 0f000h 61 | 62 | rb 100ah-$ 63 | dw 5678h 64 | 65 | rb 1100h-$ 66 | mov si,sp 67 | mov si,word[ss:si] 68 | mov word[14],si 69 | add si,6 70 | mov di,sp 71 | mov word[ss:di],si 72 | iret 73 | 74 | rb 1200h-$ 75 | mov cx,0f120h 76 | mov es,cx 77 | mov si,0200h 78 | mov di,0e01h 79 | 80 | db 26h 81 | cmpsb 82 | pushf 83 | 84 | mov ax,1 85 | mov es,ax 86 | mov di,6 87 | mov si,1400h 88 | mov cx,6 89 | ; Two prefixes 90 | db 0f3h 91 | db 2Eh 92 | movsb 93 | hlt 94 | 95 | rb 1400h-$ 96 | db 001h,0ffh,0ffh,080h 97 | dw 00002h 98 | db 0c2h 99 | 100 | rb 2001h-$ 101 | db 002h,0ffh,001h,001h 102 | dw 08001h 103 | 104 | rb 65520-$ 105 | jmp start 106 | rb 65535-$ 107 | db 0ffh 108 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // main.cpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2019 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | #define SDL_MAIN_HANDLED 20 | 21 | #include 22 | #include "PC.hpp" 23 | 24 | #ifdef _WIN32 25 | #include 26 | #include 27 | #endif 28 | 29 | using namespace std; 30 | using namespace DK86PC; 31 | 32 | int main(int argc, const char * argv[]) { 33 | // insert code here... 34 | cout << "Hello, World!" << endl; 35 | 36 | // change to current directory for working path 37 | #ifdef _WIN32 38 | filesystem::current_path(SDL_GetBasePath()); //setting pat 39 | auto path = filesystem::current_path(); //getting path 40 | cout << path << endl; 41 | #endif 42 | PC pc = PC(); 43 | //pc.loadBIOS("BIOS/Original5150/BIOS_5150_24APR81_U33.BIN"); 44 | //pc.loadBIOS("BIOS/5150_2764_DIAG.bin"); 45 | pc.loadBIOS("BIOS/pcxtbios.bin"); 46 | pc.loadCasetteBASIC("CasetteBASIC/5150cb10_1.bin", "CasetteBASIC/5150cb10_2.bin", "CasetteBASIC/5150cb10_3.bin", "CasetteBASIC/5150cb10_4.bin"); 47 | pc.run(); 48 | 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/strings.asm: -------------------------------------------------------------------------------- 1 | ;00: XX XX 34 12 2 | 3 | use16 4 | start: 5 | mov cx,0f000h 6 | mov ds,cx 7 | mov es,cx 8 | mov si,01000h 9 | mov di,02001h 10 | 11 | cmpsb ; (1) flags=0x97 (SAPC) 12 | pushf 13 | ret 14 | 15 | rb 46h-$ 16 | cmpsb ; (1) flags=0x82 (S) 17 | pushf 18 | ret 19 | 20 | rb 082h-$ 21 | cmpsb ; (1) flags=0x812 (OA) 22 | pushf 23 | ret 24 | 25 | rb 097h-$ 26 | cmpsb ; (1) flags=0x46 (ZP) 27 | pushf 28 | ret 29 | 30 | rb 0812h-$ 31 | cmpsw ; (2) 32 | pushf 33 | ret ; jump to f000:0883 34 | 35 | rb 0883h-$ 36 | mov ah,10h 37 | std 38 | lodsb ; (3) 39 | jmp ax ; jump to f000:10c2 40 | 41 | rb 01000h-$ 42 | db 001h,0ffh,0ffh,080h 43 | dw 00002h 44 | db 0c2h 45 | 46 | rb 010c2h-$ 47 | lodsw ; (4) 48 | jmp ax 49 | 50 | rb 01300h-$ 51 | mov word[di],ax 52 | mov es,dx 53 | scasw ; (8) 54 | jz stor 55 | 56 | rb 01350h-$ 57 | stor: 58 | mov al,80h 59 | std 60 | stosb ; (9) 61 | jmp word [di] 62 | 63 | rb 02001h-$ 64 | db 002h,0ffh,001h,001h 65 | dw 08001h 66 | 67 | rb 08013h-$ 68 | mov ax,0d000h 69 | stosw ; (10) 70 | jmp word [di+2] 71 | 72 | rb 080c2h-$ 73 | mov ds,cx 74 | movsw ; (6) 75 | mov ds,dx 76 | jmp word [di+2] 77 | 78 | rb 080ffh-$ 79 | mov di,2002h 80 | mov es,cx 81 | cld 82 | scasb ; (7) 83 | lahf 84 | jmp ax 85 | 86 | rb 0c200h-$ 87 | mov dx,01000h 88 | mov es,dx 89 | mov di,0ffffh 90 | movsb ; (5) 91 | mov ds,dx 92 | mov byte[di],0c2h 93 | jmp word[di] 94 | 95 | rb 0d000h-$ 96 | mov dx,0 97 | mov ds,dx 98 | mov word[2],01234h 99 | 100 | hlt 101 | 102 | rb 65520-$ 103 | jmp start 104 | 105 | rb 65535-$ 106 | db 0ffh 107 | -------------------------------------------------------------------------------- /PIC.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // PIC.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | // implement the intel 8259 21 | 22 | #ifndef PIC_hpp 23 | #define PIC_hpp 24 | 25 | #include 26 | #include "Types.h" 27 | 28 | #define NO_INTERRUPT 255 29 | 30 | namespace DK86PC { 31 | class PIC { 32 | public: 33 | PIC() : interruptRequestRegister(0), inServiceRegister(0), interruptMaskRegister(0), initializationWordNumber(1), 34 | needICW4(false), readInService(false), baseVectorAddress(0) 35 | {}; 36 | void writeCommand(byte command); 37 | byte readStatus(); 38 | void writeData(byte mask); 39 | byte readData(); 40 | void requestInterrupt(byte irq); 41 | byte getInterrupt(); 42 | 43 | private: 44 | byte baseVectorAddress; 45 | int initializationWordNumber; 46 | bool needICW4; 47 | bool readInService; 48 | byte interruptRequestRegister; 49 | byte inServiceRegister; 50 | byte interruptMaskRegister; 51 | }; 52 | } 53 | 54 | #endif /* PIC_hpp */ 55 | -------------------------------------------------------------------------------- /PIT.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // PIT.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | // implement the intel 8253 21 | #ifndef PIT_hpp 22 | #define PIT_hpp 23 | 24 | #include 25 | #include "Types.h" 26 | #include "PIC.hpp" 27 | 28 | #define NUM_COUNTERS 3 29 | 30 | namespace DK86PC { 31 | class PIT { 32 | public: 33 | PIT(PIC &pic) : pic(pic) { 34 | for (int i = 0; i < NUM_COUNTERS; i++) { 35 | counters[i] = 0; 36 | count[i] = 0; 37 | modes[i] = 0; 38 | latchStatus[i] = true; 39 | latches[i] = 0; 40 | bcd[i] = false; 41 | } 42 | } 43 | byte readCounter(int counterIndex); 44 | void writeCounter(int counterIndex, byte value); 45 | void writeControl(byte value); 46 | void update(); 47 | private: 48 | word counters[NUM_COUNTERS]; 49 | word count[NUM_COUNTERS]; 50 | byte latches[NUM_COUNTERS]; 51 | bool latchStatus[NUM_COUNTERS]; 52 | byte modes[NUM_COUNTERS]; 53 | bool bcd[NUM_COUNTERS]; 54 | PIC &pic; 55 | }; 56 | } 57 | 58 | #endif /* PIT_hpp */ 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DK86PC 2 | This is a work-in-progress Intel 8086 and IBM PC 5150 emulator. Currently, it successfully boots through the BIOS and launches Cassette BASIC. It can run commands in Cassette BASIC successfully: 3 | 4 | ![Casette BASIC Booting](CasetteBASIC.png) 5 | 6 | The 8086 implementation passes automated CPU Tests (Thanks @artlav!). Many of the support chips have partial implementations. The next step is to finish enough of the floppy disk controller to be able to boot into DOS. Then I'd like to implement a CGA graphics mode (currently only text mode is implemented) to be able to run some '80s games. I'm happy to take pull requests towards those goals or fixing bugs, but I'm not really interested in turning this into a sophisticated (say 80386) emulator for more advanced hardware. It's a learning project. I could particularly use help with the support chips. 7 | 8 | The only dependencies are SDL and SDL-ttf. 9 | 10 | There is an Xcode project file in the main directory, and a Visual Studio solution in the `Visual Studio` directory. I've left the SDL libraries in the repository, since I had to custom build the ones for Apple Silicon (and I just find it more convenient). 11 | 12 | Currently I am testing on Big Sur on Apple Silicon (ARM64), and on Windows 10 on x64. I'm using the clang and MSVC compilers. 13 | 14 | I wrote it all by hand using Intel/IBM/online documentation, looking at other emulators for hints/quick solutions when I got really stuck on a particular item. 15 | 16 | The emulators I've found most helpful as a reference are [this Java one](https://github.com/NeatMonster/Intel8086) by @NeatMonster, [this C one](https://github.com/mikechambers84/XTulator) by @mikechambers84, [this C one](https://github.com/andreas-jonsson/virtualxt) by @andreas-jonsson, and [this Rust one](https://github.com/dbalsom/marty) by @dbalsom. 17 | 18 | For the CPU opcode implementations, I largely used the official Intel 8086 manual as well as this [great site by Felix Cloutier](https://www.felixcloutier.com/x86/index.html). -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-os2.md: -------------------------------------------------------------------------------- 1 | Simple DirectMedia Layer 2 for OS/2 & eComStation 2 | ================================================================================ 3 | SDL port for OS/2, authored by Andrey Vasilkin , 2016 4 | 5 | 6 | OpenGL, joystick and audio capture not supported by this port. 7 | 8 | Additional environment variables (optional) for OS/2 version: 9 | 10 | SDL_AUDIO_SHARE 11 | Values: 0 or 1, default is 0 12 | Initializes the device as shareable or exclusively acquired. 13 | 14 | SDL_VIDEODRIVER 15 | Values: DIVE or VMAN, default is DIVE 16 | Use video subsystem: Direct interface video extensions (DIVE) or 17 | Video Manager (VMAN). 18 | 19 | You may significantly increase video output speed with OS4 kernel and patched 20 | files vman.dll and dive.dll or with latest versions of ACPI support and video 21 | driver Panorama. 22 | 23 | Latest versions of OS/4 kernel: 24 | http://gus.biysk.ru/os4/ 25 | (Info: https://www.os2world.com/wiki/index.php/Phoenix_OS/4) 26 | 27 | Patched files vman.dll and dive.dll: 28 | http://gus.biysk.ru/os4/test/pached_dll/PATCHED_DLL.RAR 29 | 30 | 31 | Compiling: 32 | ---------- 33 | 34 | Open Watcom 1.9 or newer is tested. For the new Open Watcom V2 fork, see: 35 | https://github.com/open-watcom/ and https://open-watcom.github.io 36 | WATCOM ervironment variable must to be set to the Open Watcom install 37 | directory. To compile, run: wmake -f Makefile.os2 38 | 39 | 40 | Installing: 41 | ----------- 42 | 43 | - eComStation: 44 | 45 | If you have previously installed SDL2, make a Backup copy of SDL2.dll 46 | located in D:\ecs\dll (where D: is disk on which installed eComStation). 47 | Stop all programs running with SDL2. Copy SDL2.dll to D:\ecs\dll 48 | 49 | - OS/2: 50 | 51 | Copy SDL2.dll to any directory on your LIBPATH. If you have a previous 52 | version installed, close all SDL2 applications before replacing the old 53 | copy. Also make sure that any other older versions of DLLs are removed 54 | from your system. 55 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_h_ 23 | #define SDL_config_h_ 24 | 25 | #include "SDL_platform.h" 26 | 27 | /** 28 | * \file SDL_config.h 29 | */ 30 | 31 | /* Add any platform that doesn't build using the configure system. */ 32 | #if defined(__WIN32__) 33 | #include "SDL_config_windows.h" 34 | #elif defined(__WINRT__) 35 | #include "SDL_config_winrt.h" 36 | #elif defined(__MACOSX__) 37 | #include "SDL_config_macosx.h" 38 | #elif defined(__IPHONEOS__) 39 | #include "SDL_config_iphoneos.h" 40 | #elif defined(__ANDROID__) 41 | #include "SDL_config_android.h" 42 | #elif defined(__PSP__) 43 | #include "SDL_config_psp.h" 44 | #elif defined(__OS2__) 45 | #include "SDL_config_os2.h" 46 | #else 47 | /* This is a minimal configuration just to get SDL running on new platforms. */ 48 | #include "SDL_config_minimal.h" 49 | #endif /* platform config */ 50 | 51 | #ifdef USING_GENERATED_CONFIG_H 52 | #error Wrong SDL_config.h, check your include path? 53 | #endif 54 | 55 | #endif /* SDL_config_h_ */ 56 | -------------------------------------------------------------------------------- /Memory.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // Memory.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2019 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | #ifndef Memory_hpp 21 | #define Memory_hpp 22 | 23 | #include 24 | #include "Types.h" 25 | #ifdef DEBUG 26 | #include 27 | #endif 28 | 29 | using namespace std; 30 | 31 | namespace DK86PC { 32 | 33 | class Memory { 34 | public: 35 | Memory(unsigned int ramSize = 1048576) { 36 | ram = new byte[ramSize](); 37 | 38 | } 39 | ~Memory() { 40 | delete[] ram; 41 | } 42 | void loadData(vector &data, address location); 43 | byte readByte(address location); 44 | word readWord(address location); 45 | void setByte(address location, byte data); 46 | void setWord(address location, word data); 47 | byte& readByteRef(address location); 48 | 49 | void loadBIOS(string filename); 50 | void loadCasetteBASIC(string filename1, string filename2, string filename3, string filename4); 51 | #ifdef DEBUG 52 | void setWatch(address location) { 53 | watchLocations.insert(location); 54 | } 55 | #endif 56 | private: 57 | byte *ram; 58 | #ifdef DEBUG 59 | set
watchLocations; 60 | #endif 61 | }; 62 | } 63 | 64 | #endif /* Memory_hpp */ 65 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/jmpmov.asm: -------------------------------------------------------------------------------- 1 | ;This code tests all kind of different jumps and movs that exist on the 8086. 2 | ;The program ends at address 0xf400C and the result is the number 0x4001 written in address 0. 3 | ; mov: 1 (word), 2 (word), 3 (off, base+index+off), 4, 5 (off), 4 | ; 7 (byte,word), 8 (byte off), 9 (word base), 10 (byte,word), 5 | ; 11 (word off, byte base+index), 12 (imm,special) 6 | ; jmp: 1, 2, 3 (reg), 3 (mem base+index+off), 4, 5 (mem base+index+off) 7 | 8 | use16 9 | start: 10 | jmp b ; (2) jmp 11 | hlt 12 | 13 | rb 14-$ 14 | b: 15 | mov bx,0f000h ; (10) mov word 16 | mov ds,bx ; (4) mov 17 | mov ax,word[0fff2h] ; (2) mov word 18 | jmp ax ; (3) jmp reg 19 | hlt 20 | 21 | rb 1290h-$ 22 | jmp 0e342h:0ebe0h ; (4) jmp 23 | hlt 24 | 25 | rb 2000h-$ 26 | mov bx,1000h ; (10) mov word 27 | mov ds,bx ; (4) mov 28 | 29 | mov ah,0fbh ; (10) mov byte 30 | mov al,0e1h ; (10) mov byte 31 | mov word [2501h],ax ; (1) mov word 32 | 33 | mov word [2600h],1001h ; (11) mov word 34 | mov ss,word [2600h] ; (3) mov 35 | 36 | mov [2601h],ss ; (5) mov 37 | mov dl,byte [2601h] ; (8) mov byte 38 | mov dh,0 ; (10) mov byte 39 | mov di,dx ; (7) mov word 40 | 41 | mov bp,2506h ; (10) mov word 42 | 43 | jmp near[bp+di-22] ; (3) jmp mem 44 | hlt ; m[0x12501] = 0xffe1 45 | 46 | rb 3001h-$ 47 | mov dx,0f100h 48 | mov ax,2536h 49 | out dx,ax 50 | db 0c7h,0c0h ; (12) movw $0x4001, %ax 51 | dw 4001h ; [not in a default codification] 52 | mov bx,2501h 53 | mov [bx],ax ; (9) mov word 54 | mov di,2 55 | mov byte [bx+di],0 ; (11) mov byte 56 | mov ch,4 57 | mov cl,ch ; (7) mov byte 58 | mov ch,0 59 | mov si,cx 60 | mov byte [bx+si-1],0f0h 61 | mov si,3 62 | jmp far[bp+si-24] ; (5) jmp mem 63 | hlt 64 | 65 | rb 4001h-$ 66 | mov ax,word [bx+si-3] 67 | mov dx,0 68 | mov ds,dx 69 | mov word [0],ax 70 | hlt 71 | 72 | rb 65520-$ 73 | jmp start ; (1) jmp 74 | dw 1290h 75 | 76 | rb 65534-$ 77 | dw 0ffffh 78 | 79 | -------------------------------------------------------------------------------- /DMA.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // DMA.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | // implement the intel 8237 21 | 22 | #ifndef DMA_hpp 23 | #define DMA_hpp 24 | 25 | #include 26 | #include "Memory.hpp" 27 | 28 | namespace DK86PC { 29 | class DMA { 30 | public: 31 | DMA() { 32 | for (int i = 0; i < 4; i++) { 33 | addressRegisters[i] = 0; 34 | counterRegisters[i] = 0; 35 | pageRegisters[i] = 0; 36 | } 37 | } 38 | ~DMA() { 39 | } 40 | void setAddress(byte channel, word address); 41 | void setCounter(byte channel, word count); 42 | word readAddress(byte channel); 43 | word readCounter(byte channel); 44 | void setPage(byte channel, byte page); 45 | void setMode(byte m); 46 | void singleChannelMask(byte m); 47 | void multiChannelMask(byte m); 48 | 49 | void writeCommand(byte command); 50 | void masterReset(); 51 | void clearBytePointerFlipFlop(); 52 | private: 53 | word addressRegisters[4]; 54 | word counterRegisters[4]; 55 | byte pageRegisters[4]; 56 | byte status = 0; 57 | bool enabled = true; 58 | bool flipflop = false; // false send low byte, true high 59 | byte masks = 0; 60 | byte mode = 0; 61 | }; 62 | } 63 | 64 | #endif /* DMA_hpp */ 65 | -------------------------------------------------------------------------------- /DMA.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // DMA.cpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | // implement the intel 8237 21 | 22 | #include "DMA.hpp" 23 | 24 | using namespace std; 25 | 26 | namespace DK86PC { 27 | 28 | void DMA::setAddress(byte channel, word address) { 29 | addressRegisters[channel] = address; 30 | } 31 | 32 | void DMA::setCounter(byte channel, word count) { 33 | counterRegisters[channel] = count; 34 | } 35 | 36 | word DMA::readAddress(byte channel) { 37 | return addressRegisters[channel]; 38 | } 39 | 40 | word DMA::readCounter(byte channel) { 41 | return counterRegisters[channel]; 42 | } 43 | 44 | void DMA::setPage(byte channel, byte page) { 45 | pageRegisters[channel] = page; 46 | } 47 | 48 | void DMA::setMode(byte m) { 49 | mode = m; 50 | } 51 | 52 | void DMA::singleChannelMask(byte m) { 53 | byte channel = m & 3; 54 | // clear channel 55 | masks &= ~(1 << channel); 56 | // set channel 57 | masks |= (((m >> 2) & 1) << channel); 58 | } 59 | 60 | void DMA::multiChannelMask(byte m) { 61 | masks = ((m & 0xF) | (masks & 0xF0)); 62 | } 63 | 64 | void DMA::writeCommand(byte command) { 65 | if (command & 4) { // bit 2 disables DMA 66 | enabled = false; 67 | } 68 | } 69 | 70 | void DMA::masterReset() { 71 | flipflop = false; 72 | status = 0; 73 | masks = 0x0F; 74 | } 75 | 76 | void DMA::clearBytePointerFlipFlop() { 77 | flipflop = false; 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-porting.md: -------------------------------------------------------------------------------- 1 | Porting 2 | ======= 3 | 4 | * Porting To A New Platform 5 | 6 | The first thing you have to do when porting to a new platform, is look at 7 | include/SDL_platform.h and create an entry there for your operating system. 8 | The standard format is "__PLATFORM__", where PLATFORM is the name of the OS. 9 | Ideally SDL_platform.h will be able to auto-detect the system it's building 10 | on based on C preprocessor symbols. 11 | 12 | There are two basic ways of building SDL at the moment: 13 | 14 | 1. The "UNIX" way: ./configure; make; make install 15 | 16 | If you have a GNUish system, then you might try this. Edit configure.ac, 17 | take a look at the large section labelled: 18 | 19 | "Set up the configuration based on the host platform!" 20 | 21 | Add a section for your platform, and then re-run autogen.sh and build! 22 | 23 | 2. Using an IDE: 24 | 25 | If you're using an IDE or other non-configure build system, you'll probably 26 | want to create a custom SDL_config.h for your platform. Edit SDL_config.h, 27 | add a section for your platform, and create a custom SDL_config_{platform}.h, 28 | based on SDL_config_minimal.h and SDL_config.h.in 29 | 30 | Add the top level include directory to the header search path, and then add 31 | the following sources to the project: 32 | 33 | src/*.c 34 | src/atomic/*.c 35 | src/audio/*.c 36 | src/cpuinfo/*.c 37 | src/events/*.c 38 | src/file/*.c 39 | src/haptic/*.c 40 | src/joystick/*.c 41 | src/power/*.c 42 | src/render/*.c 43 | src/render/software/*.c 44 | src/stdlib/*.c 45 | src/thread/*.c 46 | src/timer/*.c 47 | src/video/*.c 48 | src/audio/disk/*.c 49 | src/audio/dummy/*.c 50 | src/filesystem/dummy/*.c 51 | src/video/dummy/*.c 52 | src/haptic/dummy/*.c 53 | src/joystick/dummy/*.c 54 | src/main/dummy/*.c 55 | src/thread/generic/*.c 56 | src/timer/dummy/*.c 57 | src/loadso/dummy/*.c 58 | 59 | 60 | Once you have a working library without any drivers, you can go back to each 61 | of the major subsystems and start implementing drivers for your platform. 62 | 63 | If you have any questions, don't hesitate to ask on the SDL mailing list: 64 | http://www.libsdl.org/mailing-list.php 65 | 66 | Enjoy! 67 | Sam Lantinga (slouken@libsdl.org) 68 | 69 | -------------------------------------------------------------------------------- /PC.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // PC.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2019 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | #ifndef PC_hpp 21 | #define PC_hpp 22 | 23 | #include 24 | #include "CPU.hpp" 25 | #include "Memory.hpp" 26 | #include "DMA.hpp" 27 | #include "PIC.hpp" 28 | #include "PPI.hpp" 29 | #include "PIT.hpp" 30 | #include "CGA.hpp" 31 | #include "FDC.hpp" 32 | #include "PortInterface.hpp" 33 | 34 | using namespace std; 35 | 36 | namespace DK86PC { 37 | class CPU; 38 | 39 | class PC: PortInterface { 40 | public: 41 | PC() : memory(), cpu(*this, memory), dma(), pic(), ppi(pic), pit(pic), cga(memory, ppi), fdc(pic) { 42 | #ifdef DEBUG 43 | //memory.setWatch(90094); 44 | //memory.setWatch(00000); 45 | //memory.setWatch(0x3E4); 46 | //memory.setWatch(0x415); 47 | #endif 48 | 49 | }; 50 | void loadBIOS(string filename); 51 | void loadCasetteBASIC(string filename1, string filename2, string filename3, string filename4); 52 | void runLoop(); 53 | void run(); 54 | void writePort(word port, word value) override; 55 | word readPort(word port) override; 56 | private: 57 | bool shouldQuit = false; 58 | Memory memory; 59 | CPU cpu; 60 | DMA dma; 61 | PIC pic; // 0x20, 0x21 ports 62 | //PIC pic2; // 0xA0, 0xA1 ports // 5150 has only 1 63 | PPI ppi; 64 | PIT pit; 65 | CGA cga; 66 | FDC fdc; 67 | }; 68 | 69 | } 70 | 71 | #endif /* PC_hpp */ 72 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* SDL_clipboard_h_ */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/cmpneg.asm: -------------------------------------------------------------------------------- 1 | ;00: 01 00 02 00 ff ff ff ff 01 00 ff ff 00 80 00 80 2 | ;10: 81 7f c3 ef 33 e9 01 ff ff ff 80 80 ff 01 7f 80 3 | ;20: 00 bc 00 00 01 80 00 80 17 53 bc 00 81 37 00 80 4 | ;30: XX XX XX XX 83 08 13 00 97 00 46 00 17 00 87 08 5 | ;40: 93 00 46 00 87 00 87 08 87 08 82 00 46 00 97 00 6 | ;50: 96 00 16 00 93 08 93 00 16 08 13 00 46 00 97 00 7 | 8 | use16 9 | start: 10 | 11 | mov sp,96 12 | 13 | ; cmp word tests 14 | mov ax,1 15 | mov bx,2 16 | cmp ax,bx 17 | mov word[0],ax 18 | mov word[2],bx 19 | pushf 20 | 21 | mov dx,0ffffh 22 | mov word[4],0ffffh 23 | cmp word[4],dx 24 | mov word[6],dx 25 | pushf 26 | 27 | mov cx,0ffffh 28 | mov word[8],1 29 | cmp word[8],cx 30 | mov word[10],cx 31 | pushf 32 | 33 | mov ax,08000h 34 | cmp ax,00001h 35 | mov word[12],ax 36 | pushf 37 | 38 | mov bp,8000h 39 | db 083h,0fdh,0ffh 40 | mov word[14],bp 41 | pushf 42 | 43 | mov si,07f81h 44 | cmp si,0903ch 45 | mov word[16],si 46 | pushf 47 | 48 | mov word[18],0efc3h 49 | cmp word[18],0c664h 50 | pushf 51 | 52 | mov word[20],0e933h 53 | dw 03e83h,00014h 54 | db 064h 55 | pushf 56 | 57 | ; cmp byte tests 58 | mov byte[22],1 59 | cmp byte[22],2 60 | pushf 61 | 62 | mov dh,0ffh 63 | cmp dh,0ffh 64 | mov word[23],dx 65 | pushf 66 | 67 | mov al,0ffh 68 | cmp al,1 69 | mov word[25],ax 70 | pushf 71 | 72 | mov byte[27],80h 73 | mov ch,1 74 | cmp ch,byte[27] 75 | mov word[28],cx 76 | pushf 77 | 78 | mov bl,80h 79 | mov byte[30],7Fh 80 | cmp byte[30],bl 81 | mov word[31],bx 82 | pushf 83 | 84 | mov al,0bch 85 | mov ah,08eh 86 | cmp ah,al 87 | mov word[33],ax 88 | pushf 89 | 90 | ; neg word tests 91 | mov cx,0 92 | neg cx 93 | mov word[34],cx 94 | pushf 95 | 96 | mov word[36],7fffh 97 | neg word[36] 98 | pushf 99 | 100 | mov bp,8000h 101 | neg bp 102 | mov word[38],bp 103 | pushf 104 | 105 | mov word[40],0ace9h 106 | neg word[40] 107 | pushf 108 | 109 | ; neg byte tests 110 | mov ah,0 111 | neg ah 112 | mov word[42],ax 113 | pushf 114 | 115 | mov byte[44],7fh 116 | neg byte[44] 117 | pushf 118 | 119 | mov cl,0c9h 120 | neg cl 121 | mov word[45],cx 122 | pushf 123 | 124 | mov byte[47],80h 125 | neg byte[47] 126 | pushf 127 | hlt 128 | 129 | rb 65520-$ 130 | jmp start 131 | rb 65535-$ 132 | db 0ffh 133 | 134 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* SDL_clipboard_h_ */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README.md: -------------------------------------------------------------------------------- 1 | Simple DirectMedia Layer {#mainpage} 2 | ======================== 3 | 4 | (SDL) 5 | 6 | Version 2.0 7 | 8 | --- 9 | http://www.libsdl.org/ 10 | 11 | Simple DirectMedia Layer is a cross-platform development library designed 12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics 13 | hardware via OpenGL and Direct3D. It is used by video playback software, 14 | emulators, and popular games including Valve's award winning catalog 15 | and many Humble Bundle games. 16 | 17 | SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. 18 | Support for other platforms may be found in the source code. 19 | 20 | SDL is written in C, works natively with C++, and there are bindings 21 | available for several other languages, including C# and Python. 22 | 23 | This library is distributed under the zlib license, which can be found 24 | in the file "COPYING.txt". 25 | 26 | The best way to learn how to use SDL is to check out the header files in 27 | the "include" subdirectory and the programs in the "test" subdirectory. 28 | The header files and test programs are well commented and always up to date. 29 | 30 | More documentation and FAQs are available online at [the wiki](http://wiki.libsdl.org/) 31 | 32 | - [Android](README-android.md) 33 | - [CMake](README-cmake.md) 34 | - [DirectFB](README-directfb.md) 35 | - [DynAPI](README-dynapi.md) 36 | - [Emscripten](README-emscripten.md) 37 | - [Gesture](README-gesture.md) 38 | - [Mercurial](README-hg.md) 39 | - [iOS](README-ios.md) 40 | - [Linux](README-linux.md) 41 | - [OS X](README-macosx.md) 42 | - [Native Client](README-nacl.md) 43 | - [Pandora](README-pandora.md) 44 | - [Supported Platforms](README-platforms.md) 45 | - [Porting information](README-porting.md) 46 | - [PSP](README-psp.md) 47 | - [Raspberry Pi](README-raspberrypi.md) 48 | - [Touch](README-touch.md) 49 | - [WinCE](README-wince.md) 50 | - [Windows](README-windows.md) 51 | - [WinRT](README-winrt.md) 52 | 53 | If you need help with the library, or just want to discuss SDL related 54 | issues, you can join the [developers mailing list](http://www.libsdl.org/mailing-list.php) 55 | 56 | If you want to report bugs or contribute patches, please submit them to 57 | [bugzilla](https://bugzilla.libsdl.org/) 58 | 59 | Enjoy! 60 | 61 | 62 | Sam Lantinga 63 | 64 | -------------------------------------------------------------------------------- /FDC.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // FDC.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | // implement the intel 8272a 21 | 22 | #ifndef FDC_hpp 23 | #define FDC_hpp 24 | 25 | #include 26 | #include 27 | #include 28 | #include "Types.h" 29 | #include "PIC.hpp" 30 | 31 | using namespace std; 32 | 33 | namespace DK86PC { 34 | class FDC { 35 | public: 36 | FDC(PIC &pic) : pic(pic), dmaEnabled(false), selectedDevice(0), 37 | fdcBusy(false), DIO(false), RQM(false) 38 | { 39 | for (int i = 0; i < 4; i++) { 40 | motorActive[i] = false; 41 | } 42 | // for now always load DOS into A Drive 43 | loadDisk("DOS/DOS1.img"); 44 | }; 45 | ~FDC() { 46 | //delete diskAData; 47 | } 48 | void writeControl(byte command); // Digital Output Register or Digital Control Port 49 | byte readStatus(); 50 | 51 | byte readCommand(); 52 | void writeCommand(byte command); 53 | 54 | private: 55 | vector diskAData; 56 | bool motorActive[4]; 57 | bool dmaEnabled; 58 | bool fdcBusy; 59 | bool DIO; // false expecting data from cpu, true has data for CPU 60 | bool RQM; // data register ready? 61 | byte selectedDevice; 62 | byte commandBuffer[8]; 63 | byte commandBufferIndex = 0; 64 | byte commandLength = 0; 65 | byte currentCylinder = 0; 66 | PIC &pic; 67 | bool normalMode = true; 68 | bool resetRequested = false; 69 | void loadDisk(string filename); 70 | }; 71 | } 72 | 73 | #endif /* FDC_hpp */ 74 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_compare_h_ 37 | #define SDL_test_compare_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_compare_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-windows.md: -------------------------------------------------------------------------------- 1 | Windows 2 | ================================================================================ 3 | 4 | ================================================================================ 5 | OpenGL ES 2.x support 6 | ================================================================================ 7 | 8 | SDL has support for OpenGL ES 2.x under Windows via two alternative 9 | implementations. 10 | The most straightforward method consists in running your app in a system with 11 | a graphic card paired with a relatively recent (as of November of 2013) driver 12 | which supports the WGL_EXT_create_context_es2_profile extension. Vendors known 13 | to ship said extension on Windows currently include nVidia and Intel. 14 | 15 | The other method involves using the ANGLE library (https://code.google.com/p/angleproject/) 16 | If an OpenGL ES 2.x context is requested and no WGL_EXT_create_context_es2_profile 17 | extension is found, SDL will try to load the libEGL.dll library provided by 18 | ANGLE. 19 | To obtain the ANGLE binaries, you can either compile from source from 20 | https://chromium.googlesource.com/angle/angle or copy the relevant binaries from 21 | a recent Chrome/Chromium install for Windows. The files you need are: 22 | 23 | * libEGL.dll 24 | * libGLESv2.dll 25 | * d3dcompiler_46.dll (supports Windows Vista or later, better shader compiler) 26 | or... 27 | * d3dcompiler_43.dll (supports Windows XP or later) 28 | 29 | If you compile ANGLE from source, you can configure it so it does not need the 30 | d3dcompiler_* DLL at all (for details on this, see their documentation). 31 | However, by default SDL will try to preload the d3dcompiler_46.dll to 32 | comply with ANGLE's requirements. If you wish SDL to preload d3dcompiler_43.dll (to 33 | support Windows XP) or to skip this step at all, you can use the 34 | SDL_HINT_VIDEO_WIN_D3DCOMPILER hint (see SDL_hints.h for more details). 35 | 36 | Known Bugs: 37 | 38 | * SDL_GL_SetSwapInterval is currently a no op when using ANGLE. It appears 39 | that there's a bug in the library which prevents the window contents from 40 | refreshing if this is set to anything other than the default value. 41 | 42 | Vulkan Surface Support 43 | ============== 44 | 45 | Support for creating Vulkan surfaces is configured on by default. To disable it change the value of `SDL_VIDEO_VULKAN` to 0 in `SDL_config_windows.h`. You must install the [Vulkan SDK](https://www.lunarg.com/vulkan-sdk/) in order to use Vulkan graphics in your application. 46 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1) 50 | * 51 | * 52 | */ 53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 54 | 55 | 56 | /** 57 | * \brief Save all currently loaded Dollar Gesture templates 58 | * 59 | * 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 62 | 63 | /** 64 | * \brief Save a currently loaded Dollar Gesture template 65 | * 66 | * 67 | */ 68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 69 | 70 | 71 | /** 72 | * \brief Load Dollar Gesture templates from a file 73 | * 74 | * 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 77 | 78 | 79 | /* Ends C function definitions when using C++ */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #include "close_code.h" 84 | 85 | #endif /* SDL_gesture_h_ */ 86 | 87 | /* vi: set ts=4 sw=4 expandtab: */ 88 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1) 50 | * 51 | * 52 | */ 53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 54 | 55 | 56 | /** 57 | * \brief Save all currently loaded Dollar Gesture templates 58 | * 59 | * 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 62 | 63 | /** 64 | * \brief Save a currently loaded Dollar Gesture template 65 | * 66 | * 67 | */ 68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 69 | 70 | 71 | /** 72 | * \brief Load Dollar Gesture templates from a file 73 | * 74 | * 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 77 | 78 | 79 | /* Ends C function definitions when using C++ */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #include "close_code.h" 84 | 85 | #endif /* SDL_gesture_h_ */ 86 | 87 | /* vi: set ts=4 sw=4 expandtab: */ 88 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_test_images.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_images.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines some images for tests. 33 | 34 | */ 35 | 36 | #ifndef SDL_test_images_h_ 37 | #define SDL_test_images_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "begin_code.h" 42 | /* Set up for C function definitions, even when using C++ */ 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** 48 | *Type for test images. 49 | */ 50 | typedef struct SDLTest_SurfaceImage_s { 51 | int width; 52 | int height; 53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 54 | const char *pixel_data; 55 | } SDLTest_SurfaceImage_t; 56 | 57 | /* Test images */ 58 | SDL_Surface *SDLTest_ImageBlit(void); 59 | SDL_Surface *SDLTest_ImageBlitColor(void); 60 | SDL_Surface *SDLTest_ImageBlitAlpha(void); 61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void); 62 | SDL_Surface *SDLTest_ImageBlitBlend(void); 63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void); 64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void); 65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void); 66 | SDL_Surface *SDLTest_ImageFace(void); 67 | SDL_Surface *SDLTest_ImagePrimitives(void); 68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include "close_code.h" 75 | 76 | #endif /* SDL_test_images_h_ */ 77 | 78 | /* vi: set ts=4 sw=4 expandtab: */ 79 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/datatrnf.asm: -------------------------------------------------------------------------------- 1 | ;00h: c7 XX c7 a5 78 56 34 12 f1 8c cd ab 2d 8b d3 0c 2 | ;10h: f1 8c cd ab ff ff f1 8c f1 8c XX XX XX XX XX XX 3 | ;20h: c7 87 4 | 5 | 6 | use16 7 | 8 | start: 9 | mov ah,0edh 10 | sahf ; (1) 11 | lahf ; (2) Now %ah must have 0xc7 12 | mov byte[0],ah 13 | mov al,ah 14 | ;out 0b7h,al ; (19) 15 | mov ax,0b7h 16 | mov dx,ax 17 | mov ah,0a5h 18 | ;in al,dx ; (24) 19 | mov al,0c7h 20 | mov word[2],ax 21 | sahf 22 | lahf ; Now %ax must have 0x87c7 23 | mov word[32],ax 24 | 25 | ;out dx,ax ; (22) 26 | mov ax,0f752h 27 | mov bx,ax 28 | ;in ax,dx ; (26) 29 | mov ax,087c7h 30 | xchg ax,bx ; (16) 31 | mov ds,ax 32 | lds si,[bx+781] ; (3) %ds=0x5678 and %si=0x1234 33 | mov ax,0 34 | mov bx,ds 35 | mov ds,ax 36 | mov word[4],bx 37 | mov word[6],si 38 | mov ds,bx 39 | 40 | mov bx,-1 41 | 42 | mov ax,1000h 43 | ;out 0b7h,ax ; (21) 44 | 45 | mov ax,5798h 46 | mov ss,ax 47 | mov sp,9 48 | mov cx,0abcdh 49 | push cx ; (10) 50 | mov cx,08cf1h 51 | mov es,cx 52 | push es ; (11) 53 | popf ; (9) 54 | les di,[bx+si-46] ; (5) %di=0x8cf1, %es=%0xabcd 55 | lea si,[bp+di-452] ; (4) %si=0x8b2d 56 | pushf ; (13) 57 | mov ax,0 58 | mov ds,ax 59 | mov word[8],di 60 | mov ax,es 61 | mov word[10],ax 62 | mov word[12],si 63 | ;in ax,0b7h ; (25) 64 | mov ax,1000h 65 | mov ds,ax 66 | pop word [si+1] ; (8) 67 | xchg di,[bx+si+2] ; (15) %di=0x0cd3 68 | push word [bx+si+2] ; (12) 69 | pop es ; (7) %es=0x8cf1 70 | mov dx,es 71 | 72 | 73 | mov ax,ds 74 | mov cx,0 75 | mov ds,cx 76 | mov word[14],di 77 | mov word[16],dx 78 | mov ds,ax 79 | pop dx ; (6) 80 | push dx 81 | db 08fh,0c1h ; (6) pop %cx (non-standard) 82 | xchg cx,bx ; (14) %bx=0xabcd, %cx=0xffff 83 | 84 | mov ax,ds 85 | mov dx,0 86 | mov ds,dx 87 | mov word[18],bx 88 | mov word[20],cx 89 | mov ds,ax 90 | mov [bx+di],es 91 | mov bx,0b800h 92 | mov ax,0a0a1h 93 | xlatb ; (18) %al=0x8c 94 | xchg ah,al ; (17) 95 | xlatb ; %ax=0x8cf1 96 | mov dx,0 97 | mov ds,dx 98 | mov word[22],ax 99 | mov dx,0b7h 100 | ;out dx,al ; (20) 101 | mov al,0ffh 102 | ;in al,0b7h ; (23) %ax=0x8cf1 103 | mov al,0f1h 104 | mov word[24],ax 105 | hlt 106 | 107 | rb 65520-$ 108 | jmp start 109 | 110 | rb 65524-$ 111 | dw 01234h 112 | dw 05678h 113 | 114 | rb 65535-$ 115 | db 0ffh 116 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_error.h 24 | * 25 | * Simple error message routines for SDL. 26 | */ 27 | 28 | #ifndef SDL_error_h_ 29 | #define SDL_error_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Public functions */ 40 | /* SDL_SetError() unconditionally returns -1. */ 41 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 42 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); 43 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 44 | 45 | /** 46 | * \name Internal error functions 47 | * 48 | * \internal 49 | * Private error reporting function - used internally. 50 | */ 51 | /* @{ */ 52 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 53 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 54 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) 55 | typedef enum 56 | { 57 | SDL_ENOMEM, 58 | SDL_EFREAD, 59 | SDL_EFWRITE, 60 | SDL_EFSEEK, 61 | SDL_UNSUPPORTED, 62 | SDL_LASTERROR 63 | } SDL_errorcode; 64 | /* SDL_Error() unconditionally returns -1. */ 65 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); 66 | /* @} *//* Internal error functions */ 67 | 68 | /* Ends C function definitions when using C++ */ 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | #include "close_code.h" 73 | 74 | #endif /* SDL_error_h_ */ 75 | 76 | /* vi: set ts=4 sw=4 expandtab: */ 77 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/jump1.asm: -------------------------------------------------------------------------------- 1 | ;00: 34 12 2 | use16 3 | 4 | start: 5 | mov cx,0 6 | mov bx,64 7 | mov sp,01000h 8 | mov ss,sp 9 | push bx 10 | jmp j00 11 | 12 | ; ja/jnbe 13 | j00err: 14 | jmp jerr 15 | j00: 16 | stc 17 | ja j00err ; (1) 18 | clc 19 | ja j01 20 | 21 | ; jae/jnb/jnc 22 | j01err: 23 | jmp jerr 24 | j01: 25 | stc 26 | jae j01err ; (2) 27 | clc 28 | jae j02 29 | 30 | ; jb/jnae/jc 31 | j02err: 32 | jmp jerr 33 | j02: 34 | jb j02err ; (3) 35 | stc 36 | jb j03 37 | 38 | ; jbe/jna 39 | j03err: 40 | jmp jerr 41 | j03: 42 | clc 43 | jbe j03err ; (4) 44 | popf 45 | jbe j04 46 | 47 | ; je/jz 48 | j04err: 49 | jmp jerr 50 | j04: 51 | push cx 52 | popf 53 | je j04err ; (5) 54 | push bx 55 | popf 56 | je j05 57 | 58 | ; jg/jnle 59 | j05err: 60 | jmp jerr 61 | j05: 62 | mov dx,008c0h 63 | push dx 64 | popf 65 | jg j05err ; (6) 66 | mov dx,0880h 67 | push dx 68 | popf 69 | jg j06 70 | 71 | ; jge/jnl 72 | j06err: 73 | jmp jerr 74 | j06: 75 | mov dx,80h 76 | push dx 77 | popf 78 | jge j06err ; (7) 79 | push cx 80 | popf 81 | jge j07 82 | 83 | ; jl/jnge 84 | j07err: 85 | jmp jerr 86 | j07: 87 | jl j07err ; (8) 88 | mov dx,800h 89 | push dx 90 | popf 91 | jl j08 92 | 93 | ; jle/jng 94 | j08err: 95 | jmp jerr 96 | j08: 97 | push cx 98 | popf 99 | jle j08err ; (9) 100 | push bx 101 | popf 102 | jle j09 103 | 104 | ; jne/jnz 105 | j09err: 106 | jmp jerr 107 | j09: 108 | jne j09err ; (10) 109 | mov dx,0cbfh 110 | push dx 111 | popf 112 | jne j10 113 | 114 | ; jno 115 | j10err: 116 | jmp jerr 117 | j10: 118 | mov dx,0800h 119 | push dx 120 | popf 121 | jno j10err ; (11) 122 | mov dx,06ffh 123 | push dx 124 | popf 125 | jno j11 126 | 127 | ; jnp/jpo 128 | j11err: 129 | jmp jerr 130 | j11: 131 | mov dx,4 132 | push dx 133 | popf 134 | jnp j11err ; (12) 135 | push cx 136 | popf 137 | jnp j12 138 | 139 | ; jns 140 | j12err: 141 | jmp jerr 142 | j12: 143 | mov dx,0effh 144 | push dx 145 | popf 146 | jns j12err ; (13) 147 | push cx 148 | popf 149 | jns j13 150 | 151 | ; jo 152 | j13err: 153 | jmp jerr 154 | j13: 155 | jo j13err ; (14) 156 | mov dx,0800h 157 | push dx 158 | popf 159 | jo j14 160 | 161 | ; jp/jpe 162 | j14err: 163 | jmp jerr 164 | j14: 165 | jp j14err ; (15) 166 | mov dx,0804h 167 | push dx 168 | popf 169 | jp j15 170 | 171 | ; js 172 | j15err: 173 | jmp jerr 174 | j15: 175 | js j15err ; (16) 176 | mov dx,884h 177 | push dx 178 | popf 179 | js j16 180 | jmp jerr 181 | 182 | ; All correct 183 | j16: 184 | mov word[0],01234h 185 | hlt 186 | 187 | rb 65520-$ 188 | jmp start 189 | 190 | jerr: 191 | hlt 192 | 193 | rb 65535-$ 194 | db 0ffh 195 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * \brief Get the current power supply details. 54 | * 55 | * \param secs Seconds of battery life left. You can pass a NULL here if 56 | * you don't care. Will return -1 if we can't determine a 57 | * value, or we're not running on a battery. 58 | * 59 | * \param pct Percentage of battery life left, between 0 and 100. You can 60 | * pass a NULL here if you don't care. Will return -1 if we 61 | * can't determine a value, or we're not running on a battery. 62 | * 63 | * \return The state of the battery (if any). 64 | */ 65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 66 | 67 | /* Ends C function definitions when using C++ */ 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #include "close_code.h" 72 | 73 | #endif /* SDL_power_h_ */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * \brief Get the current power supply details. 54 | * 55 | * \param secs Seconds of battery life left. You can pass a NULL here if 56 | * you don't care. Will return -1 if we can't determine a 57 | * value, or we're not running on a battery. 58 | * 59 | * \param pct Percentage of battery life left, between 0 and 100. You can 60 | * pass a NULL here if you don't care. Will return -1 if we 61 | * can't determine a value, or we're not running on a battery. 62 | * 63 | * \return The state of the battery (if any). 64 | */ 65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 66 | 67 | /* Ends C function definitions when using C++ */ 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #include "close_code.h" 72 | 73 | #endif /* SDL_power_h_ */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_test_font.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_font.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_font_h_ 31 | #define SDL_test_font_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | #define FONT_CHARACTER_SIZE 8 42 | 43 | /** 44 | * \brief Draw a string in the currently set font. 45 | * 46 | * \param renderer The renderer to draw on. 47 | * \param x The X coordinate of the upper left corner of the character. 48 | * \param y The Y coordinate of the upper left corner of the character. 49 | * \param c The character to draw. 50 | * 51 | * \returns Returns 0 on success, -1 on failure. 52 | */ 53 | int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c); 54 | 55 | /** 56 | * \brief Draw a string in the currently set font. 57 | * 58 | * \param renderer The renderer to draw on. 59 | * \param x The X coordinate of the upper left corner of the string. 60 | * \param y The Y coordinate of the upper left corner of the string. 61 | * \param s The string to draw. 62 | * 63 | * \returns Returns 0 on success, -1 on failure. 64 | */ 65 | int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s); 66 | 67 | 68 | /** 69 | * \brief Cleanup textures used by font drawing functions. 70 | */ 71 | void SDLTest_CleanupTextDrawing(void); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_test_font_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_misc.h 24 | * 25 | * \brief Include file for SDL API functions that don't fit elsewhere. 26 | */ 27 | 28 | #ifndef SDL_misc_h_ 29 | #define SDL_misc_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * \brief Open an URL / URI in the browser or other 42 | * 43 | * Open a URL in a separate, system-provided application. How this works will 44 | * vary wildly depending on the platform. This will likely launch what 45 | * makes sense to handle a specific URL's protocol (a web browser for http://, 46 | * etc), but it might also be able to launch file managers for directories 47 | * and other things. 48 | * 49 | * What happens when you open a URL varies wildly as well: your game window 50 | * may lose focus (and may or may not lose focus if your game was fullscreen 51 | * or grabbing input at the time). On mobile devices, your app will likely 52 | * move to the background or your process might be paused. Any given platform 53 | * may or may not handle a given URL. 54 | * 55 | * If this is unimplemented (or simply unavailable) for a platform, this will 56 | * fail with an error. A successful result does not mean the URL loaded, just 57 | * that we launched something to handle it (or at least believe we did). 58 | * 59 | * All this to say: this function can be useful, but you should definitely 60 | * test it on every platform you target. 61 | * 62 | * \param url A valid URL to open. 63 | * \return 0 on success, or -1 on error. 64 | */ 65 | extern DECLSPEC int SDLCALL SDL_OpenURL(const char *url); 66 | 67 | /* Ends C function definitions when using C++ */ 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #include "close_code.h" 72 | 73 | #endif /* SDL_misc_h_ */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_config_minimal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_minimal_h_ 23 | #define SDL_config_minimal_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_minimal.h 30 | * 31 | * This is the minimal configuration that can be used to build SDL. 32 | */ 33 | 34 | #define HAVE_STDARG_H 1 35 | #define HAVE_STDDEF_H 1 36 | 37 | /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ 38 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 39 | /* Here are some reasonable defaults */ 40 | typedef unsigned int size_t; 41 | typedef signed char int8_t; 42 | typedef unsigned char uint8_t; 43 | typedef signed short int16_t; 44 | typedef unsigned short uint16_t; 45 | typedef signed int int32_t; 46 | typedef unsigned int uint32_t; 47 | typedef signed long long int64_t; 48 | typedef unsigned long long uint64_t; 49 | typedef unsigned long uintptr_t; 50 | #else 51 | #define HAVE_STDINT_H 1 52 | #endif /* Visual Studio 2008 */ 53 | 54 | #ifdef __GNUC__ 55 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 56 | #endif 57 | 58 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 59 | #define SDL_AUDIO_DRIVER_DUMMY 1 60 | 61 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 62 | #define SDL_JOYSTICK_DISABLED 1 63 | 64 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 65 | #define SDL_HAPTIC_DISABLED 1 66 | 67 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 68 | #define SDL_LOADSO_DISABLED 1 69 | 70 | /* Enable the stub thread support (src/thread/generic/\*.c) */ 71 | #define SDL_THREADS_DISABLED 1 72 | 73 | /* Enable the stub timer support (src/timer/dummy/\*.c) */ 74 | #define SDL_TIMERS_DISABLED 1 75 | 76 | /* Enable the dummy video driver (src/video/dummy/\*.c) */ 77 | #define SDL_VIDEO_DRIVER_DUMMY 1 78 | 79 | /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ 80 | #define SDL_FILESYSTEM_DUMMY 1 81 | 82 | #endif /* SDL_config_minimal_h_ */ 83 | -------------------------------------------------------------------------------- /CGA.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // CGA.hpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | // implement the Color Graphics Adapter 21 | 22 | #ifndef CGA_hpp 23 | #define CGA_hpp 24 | 25 | #include 26 | #include "Memory.hpp" 27 | #include 28 | #include 29 | #include "SDL_ttf.h" 30 | #include "PPI.hpp" 31 | 32 | namespace DK86PC { 33 | 34 | #define NUM_CHARACTERS 256 35 | #define NUM_COLORS 16 36 | #define NUM_6845_REGISTERS 18 37 | 38 | class CGA { 39 | public: 40 | CGA(Memory &mem, PPI &ppi) : memory(mem), ppi(ppi) { 41 | initScreen(); 42 | }; 43 | ~CGA() { 44 | freeFontCache(); 45 | TTF_CloseFont(font); 46 | SDL_DestroyRenderer(renderer); 47 | SDL_DestroyWindow(window); 48 | SDL_DestroyTexture(texture); 49 | SDL_Quit(); 50 | }; 51 | 52 | void initScreen(); 53 | void renderLoop(); 54 | void renderScreen(uint32_t timing); 55 | byte getStatus(); 56 | void setMode(byte value); 57 | void setColor(byte value); 58 | void verticalRetraceStart(); 59 | void verticalRetraceEnd(); 60 | void horizontalRetraceStart(); 61 | void horizontalRetraceEnd(); 62 | void exitRender(); 63 | void set6845RegisterIndex(byte index); 64 | void set6845RegisterValue(byte value); 65 | private: 66 | inline void drawCharacter(byte row, byte column, byte character, byte attribute); 67 | void createFontCache(); 68 | void freeFontCache(); 69 | Memory &memory; 70 | PPI &ppi; 71 | byte status; 72 | SDL_Window *window; 73 | SDL_Renderer *renderer; 74 | SDL_Texture *texture; 75 | TTF_Font* font; 76 | byte numColumns = 40; 77 | bool graphicsMode = false; 78 | bool greyscaleMode = false; 79 | bool highResolutionMode = false; 80 | byte backgroundColor = 0; 81 | bool intensePalette = false; 82 | bool alternatePalette = false; 83 | int cellWidth = 8; // text cell width 84 | int cellHeight = 8; // text cell height 85 | int pcWidth; 86 | int pcHeight; 87 | bool modeChanged = false; 88 | bool shouldExit = false; 89 | SDL_Texture *fontCache[NUM_COLORS][NUM_CHARACTERS]; 90 | byte registers6845[NUM_6845_REGISTERS]; 91 | byte registerIndex6845; 92 | }; 93 | 94 | } 95 | 96 | #endif /* CGA_hpp */ 97 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_metal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_metal.h 24 | * 25 | * Header file for functions to creating Metal layers and views on SDL windows. 26 | */ 27 | 28 | #ifndef SDL_metal_h_ 29 | #define SDL_metal_h_ 30 | 31 | #include "SDL_video.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). 41 | * 42 | * \note This can be cast directly to an NSView or UIView. 43 | */ 44 | typedef void *SDL_MetalView; 45 | 46 | /** 47 | * \name Metal support functions 48 | */ 49 | /* @{ */ 50 | 51 | /** 52 | * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the 53 | * specified window. 54 | * 55 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its 56 | * own. It is up to user code to do that. 57 | * 58 | * The returned handle can be casted directly to a NSView or UIView, and the 59 | * CAMetalLayer can be accessed from the view's 'layer' property. 60 | * 61 | * \code 62 | * SDL_MetalView metalview = SDL_Metal_CreateView(window); 63 | * UIView *uiview = (__bridge UIView *)metalview; 64 | * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; 65 | * // [...] 66 | * SDL_Metal_DestroyView(metalview); 67 | * \endcode 68 | * 69 | * \sa SDL_Metal_DestroyView 70 | */ 71 | extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); 72 | 73 | /** 74 | * \brief Destroy an existing SDL_MetalView object. 75 | * 76 | * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was 77 | * called after SDL_CreateWindow. 78 | * 79 | * \sa SDL_Metal_CreateView 80 | */ 81 | extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); 82 | 83 | /* @} *//* Metal support functions */ 84 | 85 | /* Ends C function definitions when using C++ */ 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #include "close_code.h" 90 | 91 | #endif /* SDL_metal_h_ */ 92 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-directfb.md: -------------------------------------------------------------------------------- 1 | DirectFB 2 | ======== 3 | 4 | Supports: 5 | 6 | - Hardware YUV overlays 7 | - OpenGL - software only 8 | - 2D/3D accelerations (depends on directfb driver) 9 | - multiple displays 10 | - windows 11 | 12 | What you need: 13 | 14 | * DirectFB 1.0.1, 1.2.x, 1.3.0 15 | * Kernel-Framebuffer support: required: vesafb, radeonfb .... 16 | * Mesa 7.0.x - optional for OpenGL 17 | 18 | /etc/directfbrc 19 | 20 | This file should contain the following lines to make 21 | your joystick work and avoid crashes: 22 | ------------------------ 23 | disable-module=joystick 24 | disable-module=cle266 25 | disable-module=cyber5k 26 | no-linux-input-grab 27 | ------------------------ 28 | 29 | To disable to use x11 backend when DISPLAY variable is found use 30 | 31 | export SDL_DIRECTFB_X11_CHECK=0 32 | 33 | To disable the use of linux input devices, i.e. multimice/multikeyboard support, 34 | use 35 | 36 | export SDL_DIRECTFB_LINUX_INPUT=0 37 | 38 | To use hardware accelerated YUV-overlays for YUV-textures, use: 39 | 40 | export SDL_DIRECTFB_YUV_DIRECT=1 41 | 42 | This is disabled by default. It will only support one 43 | YUV texture, namely the first. Every other YUV texture will be 44 | rendered in software. 45 | 46 | In addition, you may use (directfb-1.2.x) 47 | 48 | export SDL_DIRECTFB_YUV_UNDERLAY=1 49 | 50 | to make the YUV texture an underlay. This will make the cursor to 51 | be shown. 52 | 53 | Simple Window Manager 54 | ===================== 55 | 56 | The driver has support for a very, very basic window manager you may 57 | want to use when running with "wm=default". Use 58 | 59 | export SDL_DIRECTFB_WM=1 60 | 61 | to enable basic window borders. In order to have the window title rendered, 62 | you need to have the following font installed: 63 | 64 | /usr/share/fonts/truetype/freefont/FreeSans.ttf 65 | 66 | OpenGL Support 67 | ============== 68 | 69 | The following instructions will give you *software* OpenGL. However this 70 | works at least on all directfb supported platforms. 71 | 72 | As of this writing 20100802 you need to pull Mesa from git and do the following: 73 | 74 | ------------------------ 75 | git clone git://anongit.freedesktop.org/git/mesa/mesa 76 | cd mesa 77 | git checkout 2c9fdaf7292423c157fc79b5ce43f0f199dd753a 78 | ------------------------ 79 | 80 | Edit configs/linux-directfb so that the Directories-section looks like 81 | ------------------------ 82 | # Directories 83 | SRC_DIRS = mesa glu 84 | GLU_DIRS = sgi 85 | DRIVER_DIRS = directfb 86 | PROGRAM_DIRS = 87 | ------------------------ 88 | 89 | make linux-directfb 90 | make 91 | 92 | echo Installing - please enter sudo pw. 93 | 94 | sudo make install INSTALL_DIR=/usr/local/dfb_GL 95 | cd src/mesa/drivers/directfb 96 | make 97 | sudo make install INSTALL_DIR=/usr/local/dfb_GL 98 | ------------------------ 99 | 100 | To run the SDL - testprograms: 101 | 102 | export SDL_VIDEODRIVER=directfb 103 | export LD_LIBRARY_PATH=/usr/local/dfb_GL/lib 104 | export LD_PRELOAD=/usr/local/dfb_GL/libGL.so.7 105 | 106 | ./testgl 107 | 108 | -------------------------------------------------------------------------------- /DK86PC.xcodeproj/xcshareddata/xcschemes/CPUTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /DK86PC.xcodeproj/xcshareddata/xcschemes/DK86PC.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 44 | 46 | 52 | 53 | 54 | 55 | 61 | 63 | 69 | 70 | 71 | 72 | 74 | 75 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_loadso.h 24 | * 25 | * System dependent library loading routines 26 | * 27 | * Some things to keep in mind: 28 | * \li These functions only work on C function names. Other languages may 29 | * have name mangling and intrinsic language support that varies from 30 | * compiler to compiler. 31 | * \li Make sure you declare your function pointers with the same calling 32 | * convention as the actual library function. Your code will crash 33 | * mysteriously if you do not do this. 34 | * \li Avoid namespace collisions. If you load a symbol from the library, 35 | * it is not defined whether or not it goes into the global symbol 36 | * namespace for the application. If it does and it conflicts with 37 | * symbols in your code or other shared libraries, you will not get 38 | * the results you expect. :) 39 | */ 40 | 41 | #ifndef SDL_loadso_h_ 42 | #define SDL_loadso_h_ 43 | 44 | #include "SDL_stdinc.h" 45 | #include "SDL_error.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * This function dynamically loads a shared object and returns a pointer 55 | * to the object handle (or NULL if there was an error). 56 | * The 'sofile' parameter is a system dependent name of the object file. 57 | */ 58 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); 59 | 60 | /** 61 | * Given an object handle, this function looks up the address of the 62 | * named function in the shared object and returns it. This address 63 | * is no longer valid after calling SDL_UnloadObject(). 64 | */ 65 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, 66 | const char *name); 67 | 68 | /** 69 | * Unload a shared object from memory. 70 | */ 71 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_loadso_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_loadso.h 24 | * 25 | * System dependent library loading routines 26 | * 27 | * Some things to keep in mind: 28 | * \li These functions only work on C function names. Other languages may 29 | * have name mangling and intrinsic language support that varies from 30 | * compiler to compiler. 31 | * \li Make sure you declare your function pointers with the same calling 32 | * convention as the actual library function. Your code will crash 33 | * mysteriously if you do not do this. 34 | * \li Avoid namespace collisions. If you load a symbol from the library, 35 | * it is not defined whether or not it goes into the global symbol 36 | * namespace for the application. If it does and it conflicts with 37 | * symbols in your code or other shared libraries, you will not get 38 | * the results you expect. :) 39 | */ 40 | 41 | #ifndef SDL_loadso_h_ 42 | #define SDL_loadso_h_ 43 | 44 | #include "SDL_stdinc.h" 45 | #include "SDL_error.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * This function dynamically loads a shared object and returns a pointer 55 | * to the object handle (or NULL if there was an error). 56 | * The 'sofile' parameter is a system dependent name of the object file. 57 | */ 58 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); 59 | 60 | /** 61 | * Given an object handle, this function looks up the address of the 62 | * named function in the shared object and returns it. This address 63 | * is no longer valid after calling SDL_UnloadObject(). 64 | */ 65 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, 66 | const char *name); 67 | 68 | /** 69 | * Unload a shared object from memory. 70 | */ 71 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_loadso_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /CPUTests/CPUTests.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // CPUTests.cpp 3 | // 4 | // DK86PC - An Intel 8086 and IBM PC 5150 emulator. 5 | // Copyright (C) 2020 David Kopec 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | #include "catch.hpp" 21 | #include "Memory.hpp" 22 | #include "CPU.hpp" 23 | #include "DummyPortInterface.hpp" 24 | #include "Types.h" 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | using namespace std; 32 | using namespace DK86PC; 33 | 34 | vector loadBin(string filename) { 35 | // open input stream 36 | ifstream input(filename, ios::in | ios::binary); 37 | // check if the file opened successfully 38 | if (!input.is_open() || input.fail()) { 39 | cout << filename << " can't be opened!"; 40 | } 41 | 42 | vector buffer; 43 | copy(istreambuf_iterator(input), 44 | istreambuf_iterator(), 45 | back_inserter(buffer)); 46 | 47 | return buffer; 48 | } 49 | 50 | 51 | TEST_CASE( "artlav CPU Tests" ) { 52 | auto name = GENERATE(as{}, "rotate", "add", "sub", "jump1", "jump2", "bitwise", "control", "cmpneg", "rep", "shifts", "strings", "interrupt", "jmpmov", "datatrnf", "segpr", "bcdcnv", "mul", "div"); 53 | 54 | DYNAMIC_SECTION( "Instructions: " << name ) { 55 | Memory memory = Memory(); 56 | memory.loadBIOS("80186_tests/" + name + ".bin"); 57 | DummyPortInterface dpi = DummyPortInterface(); 58 | CPU cpu = CPU(dpi, memory); 59 | // default flags for later x86 CPUs expected by tests 60 | cpu.setTestingFlags(0b0000000000000010); 61 | // tests otherwise go off the end of the 1 MB of memory with first reset vector jmp 62 | cpu.setCSIP(0xF000, 0xFFF0); 63 | while (!cpu.isHalted()) { 64 | cpu.step(); 65 | } 66 | // special test case without result 67 | if (name == "jmpmov") { 68 | INFO("Testing byte 0 of Memory for jmpmov test"); 69 | CHECK((uint8_t)memory.readByte(0) == (uint8_t)0x4001); 70 | return; 71 | } 72 | // normal test cases 73 | vector expectedResult = loadBin("80186_tests/res_" + name + ".bin"); 74 | for (int i = 0; i < expectedResult.size(); i++) { 75 | INFO("Testing byte #" << i); 76 | uint8_t expected = (uint8_t)expectedResult[i]; 77 | uint8_t actual = (uint8_t)memory.readByte(i); 78 | CHECK(int(expected) == int(actual)); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/sub.asm: -------------------------------------------------------------------------------- 1 | use16 2 | start: 3 | 4 | mov sp,160 5 | 6 | ; sub word tests 7 | mov ax,00001h 8 | mov bx,00002h 9 | sub ax,bx 10 | mov word[0],ax 11 | mov word[2],bx 12 | pushf 13 | 14 | mov dx,0ffffh 15 | mov word[4],0ffffh 16 | sub word[4],dx 17 | mov word[6],dx 18 | pushf 19 | 20 | mov cx,0ffffh 21 | mov word[8],00001h 22 | sub cx,word[8] 23 | mov word[10],cx 24 | pushf 25 | 26 | mov ax,08000h 27 | sub ax,00001h 28 | mov word[12],ax 29 | pushf 30 | 31 | mov bp,08000h 32 | db 083h,0edh,0ffh 33 | mov word[14],bp 34 | pushf 35 | 36 | mov si,07f81h 37 | sub si,0903ch 38 | mov word[16],si 39 | pushf 40 | 41 | mov word[18],0efc3h 42 | sub word[18],0c664h 43 | pushf 44 | 45 | mov word[20],0e933h 46 | dw 02e83h, 00014h 47 | db 064h 48 | pushf 49 | 50 | ; sub byte tests 51 | mov byte[22],001h 52 | sub byte[22],002h 53 | pushf 54 | 55 | mov dh,0ffh 56 | sub dh,0ffh 57 | mov word[23],dx 58 | pushf 59 | 60 | mov al,0ffh 61 | sub al,001h 62 | mov word[25],ax 63 | pushf 64 | 65 | mov byte[27],080h 66 | mov ch,001h 67 | sub ch,byte[27] 68 | mov word[28],cx 69 | pushf 70 | 71 | mov bl,080h 72 | mov byte[30],07fh 73 | sub byte[30],bl 74 | mov word[31],bx 75 | pushf 76 | 77 | mov al,0bch 78 | mov ah,08eh 79 | sub ah,al 80 | mov word[33],ax 81 | pushf 82 | 83 | ; sbb word tests 84 | mov ax,00001h 85 | mov bx,00002h 86 | sbb bx,ax 87 | mov word[35],ax 88 | mov word[37],bx 89 | pushf 90 | 91 | mov dx,0ffffh 92 | mov word[39],0ffffh 93 | sbb word[39],dx 94 | mov word[41],dx 95 | pushf 96 | 97 | mov cx,0ffffh 98 | mov word[43],00001h 99 | sbb cx,word[43] 100 | mov word[45],cx 101 | pushf 102 | 103 | mov ax,08000h 104 | sbb ax,00001h 105 | mov word[47],ax 106 | pushf 107 | 108 | mov bp,08000h 109 | db 083h,0ddh,0ffh 110 | mov word[49],bp 111 | pushf 112 | 113 | mov si,052c3h 114 | sbb si,0e248h 115 | mov word[51],si 116 | pushf 117 | 118 | mov word[53],0e74ch 119 | sbb word[53],022c0h 120 | pushf 121 | 122 | mov word[55],0fd85h 123 | dw 01e83h, 00037h 124 | db 0f5h 125 | pushf 126 | 127 | ; sbb byte tests 128 | mov byte[57],001h 129 | sbb byte[57],002h 130 | pushf 131 | 132 | mov dh,0ffh 133 | sbb dh,0ffh 134 | mov word[58],dx 135 | pushf 136 | 137 | mov al,0ffh 138 | sbb al,001h 139 | mov word[60],ax 140 | pushf 141 | 142 | mov byte[62],080h 143 | mov ch,001h 144 | sbb ch,byte[62] 145 | mov word[63],cx 146 | pushf 147 | 148 | mov bl,080h 149 | mov byte[65],0ffh 150 | sbb byte[65],bl 151 | mov word[66],bx 152 | pushf 153 | 154 | mov al,0b9h 155 | mov ah,0d3h 156 | sbb ah,al 157 | mov word[68],ax 158 | pushf 159 | 160 | ; dec word tests 161 | mov di,00000h 162 | dec di 163 | mov word[70],di 164 | pushf 165 | 166 | mov bp,08000h 167 | db 0ffh, 0cdh 168 | mov word[72],bp 169 | pushf 170 | 171 | mov word[74],07412h 172 | dec word[74] 173 | pushf 174 | 175 | ; dec byte tests 176 | mov dl,000h 177 | dec dl 178 | mov word[76],dx 179 | pushf 180 | 181 | mov byte[77],080h 182 | dec byte[77] 183 | pushf 184 | 185 | mov byte[78],0b5h 186 | dec byte[78] 187 | pushf 188 | hlt 189 | 190 | rb 65520-$ 191 | jmp start 192 | rb 65535-$ 193 | db 0ffh 194 | 195 | -------------------------------------------------------------------------------- /SDL/SDL2_ttf.framework/Versions/A/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Resources/Info.plist 8 | 9 | k7Av9aS5Xq5V94y0oXhg1dJQKis= 10 | 11 | 12 | files2 13 | 14 | Headers/SDL_ttf.h 15 | 16 | hash2 17 | 18 | nSF57Fh6OtJdIL7HmMPMYZm07ewBZn00X0uk0mXaKzM= 19 | 20 | 21 | Resources/Info.plist 22 | 23 | hash2 24 | 25 | Xk1zZ6iF+O+FU096EIOJJrrzKhHeYO/T41XXITvszBw= 26 | 27 | 28 | 29 | rules 30 | 31 | ^Resources/ 32 | 33 | ^Resources/.*\.lproj/ 34 | 35 | optional 36 | 37 | weight 38 | 1000 39 | 40 | ^Resources/.*\.lproj/locversion.plist$ 41 | 42 | omit 43 | 44 | weight 45 | 1100 46 | 47 | ^Resources/Base\.lproj/ 48 | 49 | weight 50 | 1010 51 | 52 | ^version.plist$ 53 | 54 | 55 | rules2 56 | 57 | .*\.dSYM($|/) 58 | 59 | weight 60 | 11 61 | 62 | ^(.*/)?\.DS_Store$ 63 | 64 | omit 65 | 66 | weight 67 | 2000 68 | 69 | ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ 70 | 71 | nested 72 | 73 | weight 74 | 10 75 | 76 | ^.* 77 | 78 | ^Info\.plist$ 79 | 80 | omit 81 | 82 | weight 83 | 20 84 | 85 | ^PkgInfo$ 86 | 87 | omit 88 | 89 | weight 90 | 20 91 | 92 | ^Resources/ 93 | 94 | weight 95 | 20 96 | 97 | ^Resources/.*\.lproj/ 98 | 99 | optional 100 | 101 | weight 102 | 1000 103 | 104 | ^Resources/.*\.lproj/locversion.plist$ 105 | 106 | omit 107 | 108 | weight 109 | 1100 110 | 111 | ^Resources/Base\.lproj/ 112 | 113 | weight 114 | 1010 115 | 116 | ^[^/]+$ 117 | 118 | nested 119 | 120 | weight 121 | 10 122 | 123 | ^embedded\.provisionprofile$ 124 | 125 | weight 126 | 20 127 | 128 | ^version\.plist$ 129 | 130 | weight 131 | 20 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/shifts.asm: -------------------------------------------------------------------------------- 1 | ;00: 70 a6 e0 31 c0 66 80 64 5d 0f 02 74 d4 e5 ff 6e 2 | ;10: 55 5d 03 34 26 1d 00 8d XX XX XX XX XX XX XX XX 3 | ;20: 8a dd a8 b1 00 00 00 a8 93 84 80 95 b9 fd b9 df 4 | ;30: ff ff fd fe 88 33 ff 93 d0 3d e8 54 00 00 4e 05 5 | ;40: 28 0b 00 04 46 00 46 00 07 00 02 00 06 00 07 00 6 | ;50: 46 00 06 08 06 08 03 00 87 00 86 00 82 00 06 00 7 | ;60: 03 00 83 00 87 00 03 00 03 00 82 00 83 00 83 00 8 | ;70: 06 00 86 08 83 00 87 00 46 00 82 08 82 08 82 08 9 | 10 | 11 | use16 12 | start: 13 | 14 | ; sal/shl word operations 15 | mov ax,06ec5h 16 | mov bx,0b1a8h 17 | mov word[0],05338h 18 | mov word[2],031feh 19 | 20 | mov sp,128 21 | 22 | sal ax,1 ; (1) 23 | pushf 24 | mov word[32],ax 25 | 26 | shl word[0],1 ; (2) 27 | pushf 28 | 29 | mov cx,0100h 30 | shl bx,cl 31 | pushf 32 | mov word[34],bx 33 | 34 | mov cx,0ffffh 35 | mov dx,bx 36 | sal dx,cl 37 | pushf 38 | mov word[36],dx 39 | 40 | mov cl,08h 41 | sal bx,cl 42 | pushf 43 | mov word[38],bx 44 | 45 | mov cl,04h 46 | sal byte[2],cl 47 | pushf 48 | 49 | ; sal/shl byte operations 50 | mov dx,0956fh 51 | mov ax,04293h 52 | mov word[4],033c0h 53 | mov word[6],064ffh 54 | 55 | shl ah,1 ; (5) 56 | pushf 57 | mov word[40],ax 58 | 59 | sal byte[5],1 ; (6) 60 | pushf 61 | 62 | mov cl,07h 63 | shl dl,cl 64 | pushf 65 | mov word[42],dx 66 | 67 | sal byte[6],cl 68 | pushf 69 | 70 | ; sar word operations 71 | mov ax,0fb72h 72 | mov bx,0dfb9h 73 | mov word[8],01ebbh 74 | mov word[10],0742fh 75 | 76 | sar ax,1 ; (9) 77 | pushf 78 | mov word[44],ax 79 | 80 | sar word[8],1 ; (10) 81 | pushf 82 | 83 | mov cx,0100h 84 | sar bx,cl 85 | pushf 86 | mov word[46],bx 87 | 88 | mov cx,0ffffh 89 | mov dx,bx 90 | sar dx,cl 91 | pushf 92 | mov word[48],dx 93 | 94 | mov cl,05h 95 | sar bx,cl 96 | pushf 97 | mov word[50],bx 98 | 99 | mov cl,04h 100 | sar byte[10],cl 101 | pushf 102 | 103 | ; sar byte operations 104 | mov dx,093b8h 105 | mov ax,06688h 106 | mov word[12],0cad4h 107 | mov word[14],06ec9h 108 | 109 | sar ah,1 ; (13) 110 | pushf 111 | mov word[52],ax 112 | 113 | sar byte[13],1 ; (14) 114 | pushf 115 | 116 | mov cl,07h 117 | sar dl,cl 118 | pushf 119 | mov word[54],dx 120 | 121 | sar byte[14],cl 122 | pushf 123 | 124 | ; shr word operations 125 | mov ax,07ba1h 126 | mov bx,054e8h 127 | mov word[16],0baaah 128 | mov word[18],03431h 129 | 130 | shr ax,1 ; (17) 131 | pushf 132 | mov word[56],ax 133 | 134 | shr word[16],1 ; (18) 135 | pushf 136 | 137 | mov cx,0100h 138 | shr bx,cl 139 | pushf 140 | mov word[58],bx 141 | 142 | mov cx,0ffffh 143 | mov dx,bx 144 | shr dx,cl 145 | pushf 146 | mov word[60],dx 147 | 148 | mov cl,04h 149 | shr bx,cl 150 | pushf 151 | mov word[62],bx 152 | 153 | mov cl,04h 154 | shr byte[18],cl 155 | pushf 156 | 157 | ; shr byte operations 158 | mov dx,00410h 159 | mov ax,01628h 160 | mov word[20],03b26h 161 | mov word[22],08d0dh 162 | 163 | shr ah,1 ; (21) 164 | pushf 165 | mov word[64],ax 166 | 167 | shr byte[21],1 ; (22) 168 | pushf 169 | 170 | mov cl,07h 171 | shr dl,cl 172 | pushf 173 | mov word[66],dx 174 | 175 | shr byte[22],cl 176 | pushf 177 | 178 | hlt 179 | 180 | rb 65520-$ 181 | jmp start 182 | rb 65535-$ 183 | db 0ffh 184 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_touch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_touch.h 24 | * 25 | * Include file for SDL touch event handling. 26 | */ 27 | 28 | #ifndef SDL_touch_h_ 29 | #define SDL_touch_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "begin_code.h" 36 | /* Set up for C function definitions, even when using C++ */ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef Sint64 SDL_TouchID; 42 | typedef Sint64 SDL_FingerID; 43 | 44 | typedef enum 45 | { 46 | SDL_TOUCH_DEVICE_INVALID = -1, 47 | SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ 48 | SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ 49 | SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ 50 | } SDL_TouchDeviceType; 51 | 52 | typedef struct SDL_Finger 53 | { 54 | SDL_FingerID id; 55 | float x; 56 | float y; 57 | float pressure; 58 | } SDL_Finger; 59 | 60 | /* Used as the device ID for mouse events simulated with touch input */ 61 | #define SDL_TOUCH_MOUSEID ((Uint32)-1) 62 | 63 | /* Used as the SDL_TouchID for touch events simulated with mouse input */ 64 | #define SDL_MOUSE_TOUCHID ((Sint64)-1) 65 | 66 | 67 | /* Function prototypes */ 68 | 69 | /** 70 | * \brief Get the number of registered touch devices. 71 | */ 72 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); 73 | 74 | /** 75 | * \brief Get the touch ID with the given index, or 0 if the index is invalid. 76 | */ 77 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); 78 | 79 | /** 80 | * \brief Get the type of the given touch device. 81 | */ 82 | extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); 83 | 84 | /** 85 | * \brief Get the number of active fingers for a given touch device. 86 | */ 87 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); 88 | 89 | /** 90 | * \brief Get the finger object of the given touch, with the given index. 91 | */ 92 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); 93 | 94 | /* Ends C function definitions when using C++ */ 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | #include "close_code.h" 99 | 100 | #endif /* SDL_touch_h_ */ 101 | 102 | /* vi: set ts=4 sw=4 expandtab: */ 103 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_touch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_touch.h 24 | * 25 | * Include file for SDL touch event handling. 26 | */ 27 | 28 | #ifndef SDL_touch_h_ 29 | #define SDL_touch_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "begin_code.h" 36 | /* Set up for C function definitions, even when using C++ */ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef Sint64 SDL_TouchID; 42 | typedef Sint64 SDL_FingerID; 43 | 44 | typedef enum 45 | { 46 | SDL_TOUCH_DEVICE_INVALID = -1, 47 | SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ 48 | SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ 49 | SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ 50 | } SDL_TouchDeviceType; 51 | 52 | typedef struct SDL_Finger 53 | { 54 | SDL_FingerID id; 55 | float x; 56 | float y; 57 | float pressure; 58 | } SDL_Finger; 59 | 60 | /* Used as the device ID for mouse events simulated with touch input */ 61 | #define SDL_TOUCH_MOUSEID ((Uint32)-1) 62 | 63 | /* Used as the SDL_TouchID for touch events simulated with mouse input */ 64 | #define SDL_MOUSE_TOUCHID ((Sint64)-1) 65 | 66 | 67 | /* Function prototypes */ 68 | 69 | /** 70 | * \brief Get the number of registered touch devices. 71 | */ 72 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); 73 | 74 | /** 75 | * \brief Get the touch ID with the given index, or 0 if the index is invalid. 76 | */ 77 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); 78 | 79 | /** 80 | * \brief Get the type of the given touch device. 81 | */ 82 | extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); 83 | 84 | /** 85 | * \brief Get the number of active fingers for a given touch device. 86 | */ 87 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); 88 | 89 | /** 90 | * \brief Get the finger object of the given touch, with the given index. 91 | */ 92 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); 93 | 94 | /* Ends C function definitions when using C++ */ 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | #include "close_code.h" 99 | 100 | #endif /* SDL_touch_h_ */ 101 | 102 | /* vi: set ts=4 sw=4 expandtab: */ 103 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/docs/README-cmake.md: -------------------------------------------------------------------------------- 1 | CMake 2 | ================================================================================ 3 | (www.cmake.org) 4 | 5 | SDL's build system was traditionally based on autotools. Over time, this 6 | approach has suffered from several issues across the different supported 7 | platforms. 8 | To solve these problems, a new build system based on CMake is under development. 9 | It works in parallel to the legacy system, so users can experiment with it 10 | without complication. 11 | While still experimental, the build system should be usable on the following 12 | platforms: 13 | 14 | * FreeBSD 15 | * Linux 16 | * VS.NET 2010 17 | * MinGW and Msys 18 | * macOS, iOS, and tvOS, with support for XCode 19 | 20 | 21 | ================================================================================ 22 | Usage 23 | ================================================================================ 24 | 25 | Assuming the source for SDL is located at ~/sdl 26 | 27 | cd ~ 28 | mkdir build 29 | cd build 30 | cmake ../sdl 31 | 32 | This will build the static and dynamic versions of SDL in the ~/build directory. 33 | 34 | 35 | ================================================================================ 36 | Usage, iOS/tvOS 37 | ================================================================================ 38 | 39 | CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built 40 | using Xcode or Make, possibly among other build-systems. 41 | 42 | When using a recent version of CMake (3.14+), it should be possible to: 43 | 44 | - build SDL for iOS, both static and dynamic 45 | - build SDL test apps (as iOS/tvOS .app bundles) 46 | - generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis) 47 | 48 | To use, set the following CMake variables when running CMake's configuration stage: 49 | 50 | - `CMAKE_SYSTEM_NAME=` (either `iOS` or `tvOS`) 51 | - `CMAKE_OSX_SYSROOT=` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`, 52 | `appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.) 53 | - `CMAKE_OSX_ARCHITECTURES=` (example: "arm64;armv7s;x86_64") 54 | 55 | 56 | ### Examples (for iOS/tvOS): 57 | 58 | - for iOS-Simulator, using the latest, installed SDK: 59 | 60 | `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64` 61 | 62 | - for iOS-Device, using the latest, installed SDK, 64-bit only 63 | 64 | `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64` 65 | 66 | - for iOS-Device, using the latest, installed SDK, mixed 32/64 bit 67 | 68 | `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"` 69 | 70 | - for iOS-Device, using a specific SDK revision (iOS 12.4, in this example): 71 | 72 | `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64` 73 | 74 | - for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles): 75 | 76 | `cmake ~/sdl -DSDL_TEST=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64` 77 | 78 | - for tvOS-Simulator, using the latest, installed SDK: 79 | 80 | `cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64` 81 | 82 | - for tvOS-Device, using the latest, installed SDK: 83 | 84 | `cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64` 85 | -------------------------------------------------------------------------------- /SDL/Windows/SDL/include/SDL_bits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_bits.h 24 | * 25 | * Functions for fiddling with bits and bitmasks. 26 | */ 27 | 28 | #ifndef SDL_bits_h_ 29 | #define SDL_bits_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \file SDL_bits.h 41 | */ 42 | 43 | /** 44 | * Get the index of the most significant bit. Result is undefined when called 45 | * with 0. This operation can also be stated as "count leading zeroes" and 46 | * "log base 2". 47 | * 48 | * \return Index of the most significant bit, or -1 if the value is 0. 49 | */ 50 | #if defined(__WATCOMC__) && defined(__386__) 51 | extern _inline int _SDL_clz_watcom (Uint32); 52 | #pragma aux _SDL_clz_watcom = \ 53 | "bsr eax, eax" \ 54 | "xor eax, 31" \ 55 | parm [eax] nomemory \ 56 | value [eax] \ 57 | modify exact [eax] nomemory; 58 | #endif 59 | 60 | SDL_FORCE_INLINE int 61 | SDL_MostSignificantBitIndex32(Uint32 x) 62 | { 63 | #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 64 | /* Count Leading Zeroes builtin in GCC. 65 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html 66 | */ 67 | if (x == 0) { 68 | return -1; 69 | } 70 | return 31 - __builtin_clz(x); 71 | #elif defined(__WATCOMC__) && defined(__386__) 72 | if (x == 0) { 73 | return -1; 74 | } 75 | return 31 - _SDL_clz_watcom(x); 76 | #else 77 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson 78 | * , released in the public domain. 79 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 80 | */ 81 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 82 | const int S[] = {1, 2, 4, 8, 16}; 83 | 84 | int msbIndex = 0; 85 | int i; 86 | 87 | if (x == 0) { 88 | return -1; 89 | } 90 | 91 | for (i = 4; i >= 0; i--) 92 | { 93 | if (x & b[i]) 94 | { 95 | x >>= S[i]; 96 | msbIndex |= S[i]; 97 | } 98 | } 99 | 100 | return msbIndex; 101 | #endif 102 | } 103 | 104 | SDL_FORCE_INLINE SDL_bool 105 | SDL_HasExactlyOneBitSet32(Uint32 x) 106 | { 107 | if (x && !(x & (x - 1))) { 108 | return SDL_TRUE; 109 | } 110 | return SDL_FALSE; 111 | } 112 | 113 | /* Ends C function definitions when using C++ */ 114 | #ifdef __cplusplus 115 | } 116 | #endif 117 | #include "close_code.h" 118 | 119 | #endif /* SDL_bits_h_ */ 120 | 121 | /* vi: set ts=4 sw=4 expandtab: */ 122 | -------------------------------------------------------------------------------- /SDL/SDL2.framework/Versions/A/Headers/SDL_bits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_bits.h 24 | * 25 | * Functions for fiddling with bits and bitmasks. 26 | */ 27 | 28 | #ifndef SDL_bits_h_ 29 | #define SDL_bits_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \file SDL_bits.h 41 | */ 42 | 43 | /** 44 | * Get the index of the most significant bit. Result is undefined when called 45 | * with 0. This operation can also be stated as "count leading zeroes" and 46 | * "log base 2". 47 | * 48 | * \return Index of the most significant bit, or -1 if the value is 0. 49 | */ 50 | #if defined(__WATCOMC__) && defined(__386__) 51 | extern _inline int _SDL_clz_watcom (Uint32); 52 | #pragma aux _SDL_clz_watcom = \ 53 | "bsr eax, eax" \ 54 | "xor eax, 31" \ 55 | parm [eax] nomemory \ 56 | value [eax] \ 57 | modify exact [eax] nomemory; 58 | #endif 59 | 60 | SDL_FORCE_INLINE int 61 | SDL_MostSignificantBitIndex32(Uint32 x) 62 | { 63 | #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 64 | /* Count Leading Zeroes builtin in GCC. 65 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html 66 | */ 67 | if (x == 0) { 68 | return -1; 69 | } 70 | return 31 - __builtin_clz(x); 71 | #elif defined(__WATCOMC__) && defined(__386__) 72 | if (x == 0) { 73 | return -1; 74 | } 75 | return 31 - _SDL_clz_watcom(x); 76 | #else 77 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson 78 | * , released in the public domain. 79 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 80 | */ 81 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 82 | const int S[] = {1, 2, 4, 8, 16}; 83 | 84 | int msbIndex = 0; 85 | int i; 86 | 87 | if (x == 0) { 88 | return -1; 89 | } 90 | 91 | for (i = 4; i >= 0; i--) 92 | { 93 | if (x & b[i]) 94 | { 95 | x >>= S[i]; 96 | msbIndex |= S[i]; 97 | } 98 | } 99 | 100 | return msbIndex; 101 | #endif 102 | } 103 | 104 | SDL_FORCE_INLINE SDL_bool 105 | SDL_HasExactlyOneBitSet32(Uint32 x) 106 | { 107 | if (x && !(x & (x - 1))) { 108 | return SDL_TRUE; 109 | } 110 | return SDL_FALSE; 111 | } 112 | 113 | /* Ends C function definitions when using C++ */ 114 | #ifdef __cplusplus 115 | } 116 | #endif 117 | #include "close_code.h" 118 | 119 | #endif /* SDL_bits_h_ */ 120 | 121 | /* vi: set ts=4 sw=4 expandtab: */ 122 | -------------------------------------------------------------------------------- /CPUTests/80186_tests/mul.asm: -------------------------------------------------------------------------------- 1 | use16 2 | start: 3 | 4 | mov sp,192 5 | 6 | ; mul word 7 | mov bx,00003h 8 | mov ax,00007h 9 | mov dx,0ffffh 10 | mul bx 11 | 12 | mov word[0],ax 13 | mov word[2],dx 14 | pushf 15 | 16 | mov dx,0a320h 17 | mov ax,0ffffh 18 | mul dx 19 | mov word[4],ax 20 | mov word[6],dx 21 | pushf 22 | 23 | mov ax,0ffffh 24 | mov word[8],01h 25 | mul word[8] 26 | mov word[10],ax 27 | mov word[12],dx 28 | pushf 29 | 30 | mov ax,0ffffh 31 | mov word[14],0ffffh 32 | mul word[14] 33 | mov word[16],ax 34 | mov word[18],dx 35 | pushf 36 | 37 | mov ax,046dbh 38 | mov bp,00000h 39 | mul bp 40 | mov word[20],bp 41 | mov word[22],ax 42 | mov word[24],dx 43 | pushf 44 | 45 | mov ax,046dbh 46 | mov si,0eeebh 47 | mul si 48 | mov word[26],si 49 | mov word[28],ax 50 | mov word[30],dx 51 | pushf 52 | 53 | ; mul byte 54 | mov bl,014h 55 | mov ax,0ff07h 56 | mov dx,0ffffh 57 | mul bl 58 | 59 | mov word[32],ax 60 | mov word[34],dx 61 | pushf 62 | 63 | mov ch,024h 64 | mov ax,000ffh 65 | mul ch 66 | mov word[36],ax 67 | mov word[38],dx 68 | pushf 69 | 70 | mov ax,0ffh 71 | mov byte[40],01h 72 | mul byte[40] 73 | mov word[41],ax 74 | mov word[43],dx 75 | pushf 76 | 77 | mov ax,0ffffh 78 | mov byte[45],0ffh 79 | mul byte[45] 80 | mov word[46],ax 81 | mov word[46],dx 82 | pushf 83 | 84 | mov ax,0c5h 85 | mov dx,000h 86 | mul dl 87 | mov word[48],dx 88 | mov word[50],ax 89 | pushf 90 | 91 | mov al,0b5h 92 | mov dh,0f9h 93 | mul dh 94 | mov word[52],si 95 | mov word[54],ax 96 | mov word[56],dx 97 | pushf 98 | 99 | ; imul word 100 | mov bx,00003h 101 | mov ax,00007h 102 | mov dx,0ffffh 103 | imul bx 104 | 105 | mov word[60],ax 106 | mov word[62],dx 107 | pushf 108 | 109 | mov dx,0a320h 110 | mov ax,0ffffh 111 | imul dx 112 | mov word[64],ax 113 | mov word[66],dx 114 | pushf 115 | 116 | mov ax,0ffffh 117 | mov word[68],01h 118 | imul word[68] 119 | mov word[70],ax 120 | mov word[72],dx 121 | pushf 122 | 123 | mov ax,0ffffh 124 | mov word[74],0ffffh 125 | imul word[74] 126 | mov word[76],ax 127 | mov word[78],dx 128 | pushf 129 | 130 | mov ax,046dbh 131 | mov bp,00000h 132 | imul bp 133 | mov word[80],bp 134 | mov word[82],ax 135 | mov word[84],dx 136 | pushf 137 | 138 | mov ax,046dbh 139 | mov si,0eeebh 140 | imul si 141 | mov word[86],si 142 | mov word[88],ax 143 | mov word[90],dx 144 | pushf 145 | 146 | ; imul byte 147 | mov bl,014h 148 | mov ax,0ff07h 149 | mov dx,0ffffh 150 | imul bl 151 | 152 | mov word[92],ax 153 | mov word[94],dx 154 | pushf 155 | 156 | mov ch,024h 157 | mov ax,000ffh 158 | imul ch 159 | mov word[96],ax 160 | mov word[98],dx 161 | pushf 162 | 163 | mov ax,0ffh 164 | mov byte[100],01h 165 | imul byte[100] 166 | mov word[101],ax 167 | mov word[103],dx 168 | pushf 169 | 170 | mov ax,0ffffh 171 | mov byte[105],0ffh 172 | imul byte[105] 173 | mov word[106],ax 174 | mov word[106],dx 175 | pushf 176 | 177 | mov ax,0c5h 178 | mov dx,000h 179 | imul dl 180 | mov word[108],dx 181 | mov word[110],ax 182 | pushf 183 | 184 | mov al,0b5h 185 | mov dh,0f9h 186 | imul dh 187 | mov word[112],si 188 | mov word[114],ax 189 | mov word[116],dx 190 | pushf 191 | 192 | ; aad tests 193 | mov ax,0ff00h 194 | aad 195 | mov word[118],ax 196 | pushf 197 | 198 | mov ax,0ffffh 199 | aad 012h 200 | mov word[120],ax 201 | pushf 202 | 203 | mov ax,000ffh 204 | aad 0ffh 205 | mov word[122],ax 206 | pushf 207 | 208 | mov ax,0532dh 209 | aad 039h 210 | mov word[124],ax 211 | pushf 212 | 213 | hlt 214 | 215 | rb 65520-$ 216 | jmp start 217 | 218 | rb 65535-$ 219 | db 0ffh 220 | --------------------------------------------------------------------------------