Compare commits

..

1 commit

Author SHA1 Message Date
Andrea Odetti
e7795ab0d0 Embed resources in executable.
First draft using cmake.
2020-12-30 13:49:29 +00:00
425 changed files with 15973 additions and 30882 deletions

View file

@ -1,180 +0,0 @@
name: Release
on:
push:
branches:
- master
schedule:
- cron: '0 0 * * *'
jobs:
build_rpm:
env:
REPO_URL: ${{ github.server_url }}/audetto/AppleWin
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- os_name: fedora
os_codename: '34'
build_type: 'QT'
- os_name: fedora
os_codename: '35'
build_type: 'QT'
container: ${{ matrix.os_name }}:${{ matrix.os_codename }}
steps:
- run: dnf -y update && dnf -y install git ca-certificates curl gpg rsync file && dnf clean all
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.PACKAGE_SIGNING_KEY }}
passphrase: ''
- run: git config --global --add safe.directory /__w/AppleWin/AppleWin && git init && git remote add origin "$REPO_URL" && git fetch origin ${{ github.ref }} && git checkout ${{ github.ref_name }} && git submodule init && git submodule update
- run: CPACK_TYPE=RPM INSTALL_DEPS=${{ matrix.build_type }} bash ./source/linux/build.sh
- run: cd build/packages && rm -rf ./_CPack_Packages
- run: cd build/packages && dpkg-scanpackages --multiversion . > Packages
- run: cd build/packages && gzip -k -f Packages
- run: cd build/packages && apt-ftparchive release . > Release
- run: cd build/packages && gpg --default-key "${{ secrets.PACKAGE_SIGNING_EMAIL }}" -abs -o - Release > Release.gpg
- run: cd build/packages && gpg --default-key "${{ secrets.PACKAGE_SIGNING_EMAIL }}" --clearsign -o - Release > InRelease
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os_name }}-${{ matrix.os_codename }}
path: ./build/packages/**/*
build_deb:
env:
DEBIAN_FRONTEND: noninteractive
REPO_URL: ${{ github.server_url }}/audetto/AppleWin
runs-on: ubuntu-18.04
strategy:
matrix:
include:
- os_name: debian
os_codename: bullseye
build_type: 'QT'
has_backports: backports
- os_name: debian
os_codename: bookworm
build_type: 'QT'
- os_name: ubuntu
os_codename: bionic
is_lts: lts
build_type: 'WITHOUT_QT'
- os_name: ubuntu
os_codename: focal
is_lts: lts
build_type: 'QT'
- os_name: ubuntu
os_codename: hirsute
build_type: 'QT'
- os_name: ubuntu
os_codename: impish
build_type: 'QT'
container: ${{ matrix.os_name }}:${{ matrix.os_codename }}
steps:
- run: apt-get update && apt-get install -y --no-install-recommends git ca-certificates apt-transport-https curl gpg gpg-agent lsb-release dpkg-dev apt-utils rsync file
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.PACKAGE_SIGNING_KEY }}
passphrase: ''
- if: matrix.has_backports == 'backports'
run: echo 'deb http://deb.debian.org/debian ${{ matrix.os_codename }}-backports main' >> /etc/apt/sources.list
- if: matrix.is_lts == 'lts'
run: curl -L https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
- if: matrix.is_lts == 'lts'
run: echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/${{ matrix.os_name }}/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null
- run: git config --global --add safe.directory /__w/AppleWin/AppleWin && git init && git remote add origin "$REPO_URL" && git fetch origin ${{ github.ref }} && git checkout ${{ github.ref_name }} && git submodule init && git submodule update
- run: INSTALL_DEPS=${{ matrix.build_type }} bash ./source/linux/build.sh
- run: cd build/packages && rm -rf ./_CPack_Packages
- run: cd build/packages && dpkg-scanpackages --multiversion . > Packages
- run: cd build/packages && gzip -k -f Packages
- run: cd build/packages && apt-ftparchive release . > Release
- run: cd build/packages && gpg --default-key "${{ secrets.PACKAGE_SIGNING_EMAIL }}" -abs -o - Release > Release.gpg
- run: cd build/packages && gpg --default-key "${{ secrets.PACKAGE_SIGNING_EMAIL }}" --clearsign -o - Release > InRelease
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os_name }}-${{ matrix.os_codename }}
path: ./build/packages/**/*
deploy:
needs:
- build_deb
- build_rpm
runs-on: ubuntu-18.04
strategy:
max-parallel: 1
matrix:
include:
- os_name: fedora
os_codename: '34'
- os_name: fedora
os_codename: '35'
- os_name: debian
os_codename: bullseye
- os_name: debian
os_codename: bookworm
- os_name: ubuntu
os_codename: bionic
- os_name: ubuntu
os_codename: focal
- os_name: ubuntu
os_codename: hirsute
- os_name: ubuntu
os_codename: impish
steps:
- uses: actions/checkout@v3
with:
repository: audetto/AppleWin
fetch-depth: 1
ref: ${{ github.event.inputs.tag }}
- uses: actions/download-artifact@v2
with:
name: ${{ matrix.os_name }}-${{ matrix.os_codename }}
path: packages
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.3.0
with:
branch: gh-pages
folder: packages
target-folder: packages/${{ matrix.os_name }}/dists/${{ matrix.os_codename }}

7
.gitignore vendored
View file

@ -10,9 +10,9 @@
# Build results
[Dd]ebug/
[Dd]ebug v141_xp/
[Dd]ebugPublic/
[Rr]elease/
[Rr]elease v141_xp/
[Rr]eleases/
x64/
x86/
build/
@ -245,6 +245,3 @@ target_wrapper.*
# QtCtreator CMake
CMakeLists.txt.user*
# VSCode
.vscode

10
.gitmodules vendored
View file

@ -1,9 +1,3 @@
[submodule "source/frontends/qt/QHexView"]
[submodule "source/frontends/qapple/QHexView"]
path = source/frontends/qt/QHexView
url = ../../Dax89/QHexView.git
[submodule "source/frontends/sdl/imgui/imgui"]
path = source/frontends/sdl/imgui/imgui
url = ../../ocornut/imgui
[submodule "source/frontends/sdl/imgui/imgui_club"]
path = source/frontends/sdl/imgui/imgui_club
url = ../../ocornut/imgui_club
url = ../QHexView.git

View file

@ -1,38 +1,23 @@
dist: focal
arch:
- arm64
addons:
apt:
packages:
- cmake
- libyaml-dev
- libminizip-dev
- qtbase5-dev
- qtmultimedia5-dev
- libqt5gamepad5-dev
- libboost-program-options-dev
- libncurses-dev
- libevdev-dev
- libsdl2-dev
- libsdl2-image-dev
language: cpp
branches:
only:
- master
matrix:
include:
# disabled as too expensive
# - name: "AppleWin on Windows"
# os: windows
# script: ./CIBuild.bat
- name: "AppleWin on Linux"
os: linux
dist: focal
arch: amd64
script: source/linux/build.sh
addons:
apt:
packages:
- cmake
- libyaml-dev
- libminizip-dev
- qtbase5-dev
- qtmultimedia5-dev
- libqt5gamepad5-dev
- libboost-program-options-dev
- libncurses-dev
- libevdev-dev
- libsdl2-dev
- libsdl2-image-dev
- libgles-dev
- libpcap-dev
- libslirp-dev
script: source/linux/build.sh

View file

@ -6,6 +6,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Applewin", "AppleWinExpress
{5CE8051A-3F0C-4C39-B1C0-3338E48BA60F} = {5CE8051A-3F0C-4C39-B1C0-3338E48BA60F}
{7935B998-C713-42AE-8F6D-9FF9080A1B1B} = {7935B998-C713-42AE-8F6D-9FF9080A1B1B}
{2CC8CA9F-E37E-41A4-BFAD-77E54EB783A2} = {2CC8CA9F-E37E-41A4-BFAD-77E54EB783A2}
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A} = {AA5854AD-2BC7-4EFD-9790-349ADB35E35A}
{709278B8-C583-4BD8-90DE-4E4F35A3BD8B} = {709278B8-C583-4BD8-90DE-4E4F35A3BD8B}
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB} = {0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}
EndProjectSection
@ -20,6 +21,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml", "libyaml\win32\yaml2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestDebugger", "test\TestDebugger\TestDebugger.vcproj", "{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookFilter", "HookFilter\HookFilter.vcproj", "{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
@ -50,6 +53,10 @@ Global
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Debug|Win32.Build.0 = Debug|Win32
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Release|Win32.ActiveCfg = Release|Win32
{0AE28CF0-15B0-4DDF-B6D2-4562D8E456BB}.Release|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -242,14 +242,6 @@
RelativePath=".\source\Core.h"
>
</File>
<File
RelativePath=".\source\FourPlay.cpp"
>
</File>
<File
RelativePath=".\source\FourPlay.h"
>
</File>
<File
RelativePath=".\source\FrameBase.cpp"
>
@ -262,14 +254,6 @@
RelativePath=".\source\Interface.h"
>
</File>
<File
RelativePath=".\source\SNESMAX.cpp"
>
</File>
<File
RelativePath=".\source\SNESMAX.h"
>
</File>
<File
RelativePath=".\source\StdAfx.cpp"
>
@ -294,30 +278,6 @@
RelativePath=".\source\StdAfx.h"
>
</File>
<File
RelativePath=".\source\StrFormat.cpp"
>
</File>
<File
RelativePath=".\source\StrFormat.h"
>
</File>
<File
RelativePath=".\source\Uthernet1.cpp"
>
</File>
<File
RelativePath=".\source\Uthernet1.h"
>
</File>
<File
RelativePath=".\source\Uthernet2.cpp"
>
</File>
<File
RelativePath=".\source\Uthernet2.h"
>
</File>
<File
RelativePath=".\source\Utilities.cpp"
>
@ -369,14 +329,6 @@
RelativePath=".\source\Debugger\Debugger_Console.h"
>
</File>
<File
RelativePath=".\source\Debugger\Debugger_Disassembler.cpp"
>
</File>
<File
RelativePath=".\source\Debugger\Debugger_Disassembler.h"
>
</File>
<File
RelativePath=".\source\Debugger\Debugger_DisassemblerData.cpp"
>
@ -429,14 +381,6 @@
RelativePath=".\source\Debugger\Debugger_Types.h"
>
</File>
<File
RelativePath=".\source\Debugger\Debugger_Win32.cpp"
>
</File>
<File
RelativePath=".\source\Debugger\Debugger_Win32.h"
>
</File>
<File
RelativePath=".\source\Debugger\Util_MemoryTextFile.cpp"
>
@ -454,11 +398,7 @@
Name="Uthernet"
>
<File
RelativePath=".\source\Tfe\NetworkBackend.h"
>
</File>
<File
RelativePath=".\source\Tfe\NetworkBackend.cpp"
RelativePath=".\source\Tfe\Bittypes.h"
>
</File>
<File
@ -469,20 +409,16 @@
RelativePath=".\source\Tfe\Ip6_misc.h"
>
</File>
<File
RelativePath=".\source\Tfe\Pcap-stdinc.h"
>
</File>
<File
RelativePath=".\source\Tfe\Pcap.h"
>
</File>
<File
RelativePath=".\source\Tfe\PCapBackend.h"
>
</File>
<File
RelativePath=".\source\Tfe\PCapBackend.cpp"
>
</File>
<File
RelativePath=".\source\Tfe\tfearch.cpp"
RelativePath=".\source\Tfe\Tfe.cpp"
>
<FileConfiguration
Name="Release|Win32"
@ -502,11 +438,11 @@
</FileConfiguration>
</File>
<File
RelativePath=".\source\Tfe\tfearch.h"
RelativePath=".\source\Tfe\Tfe.h"
>
</File>
<File
RelativePath=".\source\Tfe\tfesupp.cpp"
RelativePath=".\source\Tfe\Tfearch.cpp"
>
<FileConfiguration
Name="Release|Win32"
@ -526,7 +462,31 @@
</FileConfiguration>
</File>
<File
RelativePath=".\source\Tfe\tfesupp.h"
RelativePath=".\source\Tfe\Tfearch.h"
>
</File>
<File
RelativePath=".\source\Tfe\Tfesupp.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\source\Tfe\Tfesupp.h"
>
</File>
<File
@ -657,14 +617,6 @@
<Filter
Name="Emulator"
>
<File
RelativePath=".\source\6522.cpp"
>
</File>
<File
RelativePath=".\source\6522.h"
>
</File>
<File
RelativePath=".\source\6821.cpp"
>
@ -681,10 +633,6 @@
RelativePath=".\source\AY8910.h"
>
</File>
<File
RelativePath=".\source\Card.cpp"
>
</File>
<File
RelativePath=".\source\Card.h"
>
@ -833,14 +781,6 @@
RelativePath=".\source\Speech.h"
>
</File>
<File
RelativePath=".\source\SSI263.cpp"
>
</File>
<File
RelativePath=".\source\SSI263.h"
>
</File>
<File
RelativePath=".\source\SynchronousEventManager.cpp"
>
@ -1025,18 +965,6 @@
RelativePath=".\source\Video.h"
>
</File>
<File
RelativePath=".\source\VidHD.cpp"
>
</File>
<File
RelativePath=".\source\VidHD.h"
>
</File>
<File
RelativePath=".\source\W5100.h"
>
</File>
</Filter>
<Filter
Name="Windows"
@ -1057,14 +985,6 @@
RelativePath=".\source\Windows\DirectInput.h"
>
</File>
<File
RelativePath=".\source\Windows\HookFilter.cpp"
>
</File>
<File
RelativePath=".\source\Windows\HookFilter.h"
>
</File>
<File
RelativePath=".\source\Windows\Win32Frame.cpp"
>
@ -1077,6 +997,18 @@
RelativePath=".\source\Windows\WinFrame.cpp"
>
</File>
<File
RelativePath=".\source\Windows\WinFrame.h"
>
</File>
<File
RelativePath=".\source\Windows\WinVideo.cpp"
>
</File>
<File
RelativePath=".\source\Windows\WinVideo.h"
>
</File>
</Filter>
<Filter
Name="Configuration"

View file

@ -5,6 +5,7 @@ VisualStudioVersion = 16.0.29201.188
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AppleWin", "AppleWinExpress2019.vcxproj", "{0A960136-A00A-4D4B-805F-664D9950D2CA}"
ProjectSection(ProjectDependencies) = postProject
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A} = {AA5854AD-2BC7-4EFD-9790-349ADB35E35A}
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45} = {CF5A49BF-62A5-41BB-B10C-F34D556A7A45}
{0212E0DF-06DA-4080-BD1D-F3B01599F70F} = {0212E0DF-06DA-4080-BD1D-F3B01599F70F}
{509739E7-0AF3-4C09-A1A9-F0B1BC31B39D} = {509739E7-0AF3-4C09-A1A9-F0B1BC31B39D}
@ -19,6 +20,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yaml", "libyaml\win32\yaml2
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCPU6502", "test\TestCPU6502\TestCPU6502-vs2019.vcxproj", "{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HookFilter", "HookFilter\HookFilter-vs2019.vcxproj", "{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug NoDX|Win32 = Debug NoDX|Win32
@ -89,6 +92,18 @@ Global
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release v141_xp|Win32.Build.0 = Release v141_xp|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.ActiveCfg = Release|Win32
{CF5A49BF-62A5-41BB-B10C-F34D556A7A45}.Release|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug NoDX|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug v141_xp|Win32.ActiveCfg = Debug v141_xp|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug v141_xp|Win32.Build.0 = Debug v141_xp|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.ActiveCfg = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Debug|Win32.Build.0 = Debug|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release NoDX|Win32.Build.0 = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release v141_xp|Win32.ActiveCfg = Release v141_xp|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release v141_xp|Win32.Build.0 = Release v141_xp|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.ActiveCfg = Release|Win32
{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -29,7 +29,6 @@
<ItemGroup>
<ClInclude Include="resource\resource.h" />
<ClInclude Include="resource\winres.h" />
<ClInclude Include="source\6522.h" />
<ClInclude Include="source\6821.h" />
<ClInclude Include="source\AY8910.h" />
<ClInclude Include="source\Card.h" />
@ -62,7 +61,6 @@
<ClInclude Include="source\Debugger\Debugger_Assembler.h" />
<ClInclude Include="source\Debugger\Debugger_Color.h" />
<ClInclude Include="source\Debugger\Debugger_Console.h" />
<ClInclude Include="source\Debugger\Debugger_Disassembler.h" />
<ClInclude Include="source\Debugger\Debugger_DisassemblerData.h" />
<ClInclude Include="source\Debugger\Debugger_Display.h" />
<ClInclude Include="source\Debugger\Debugger_Help.h" />
@ -70,7 +68,6 @@
<ClInclude Include="source\Debugger\Debugger_Range.h" />
<ClInclude Include="source\Debugger\Debugger_Symbols.h" />
<ClInclude Include="source\Debugger\Debugger_Types.h" />
<ClInclude Include="source\Debugger\Debugger_Win32.h" />
<ClInclude Include="source\Debugger\Util_MemoryTextFile.h" />
<ClInclude Include="source\Debugger\Util_Text.h" />
<ClInclude Include="source\Disk.h" />
@ -80,7 +77,6 @@
<ClInclude Include="source\DiskImage.h" />
<ClInclude Include="source\DiskImageHelper.h" />
<ClInclude Include="source\DiskLog.h" />
<ClInclude Include="source\FourPlay.h" />
<ClInclude Include="source\FrameBase.h" />
<ClInclude Include="source\Harddisk.h" />
<ClInclude Include="source\Interface.h" />
@ -104,35 +100,29 @@
<ClInclude Include="source\SaveState_Structs_common.h" />
<ClInclude Include="source\SaveState_Structs_v1.h" />
<ClInclude Include="source\SerialComms.h" />
<ClInclude Include="source\SNESMAX.h" />
<ClInclude Include="source\SoundCore.h" />
<ClInclude Include="source\Speaker.h" />
<ClInclude Include="source\Speech.h" />
<ClInclude Include="source\SSI263.h" />
<ClInclude Include="source\SSI263Phonemes.h" />
<ClInclude Include="source\StdAfx.h" />
<ClInclude Include="source\StrFormat.h" />
<ClInclude Include="source\SynchronousEventManager.h" />
<ClInclude Include="source\Tape.h" />
<ClInclude Include="source\Tfe\IPRaw.h" />
<ClInclude Include="source\Tfe\NetworkBackend.h" />
<ClInclude Include="source\Tfe\Bittypes.h" />
<ClInclude Include="source\Tfe\Bpf.h" />
<ClInclude Include="source\Tfe\Ip6_misc.h" />
<ClInclude Include="source\Tfe\Pcap-stdinc.h" />
<ClInclude Include="source\Tfe\Pcap.h" />
<ClInclude Include="source\Tfe\PCapBackend.h" />
<ClInclude Include="source\Tfe\tfearch.h" />
<ClInclude Include="source\Tfe\tfesupp.h" />
<ClInclude Include="source\Tfe\Tfe.h" />
<ClInclude Include="source\Tfe\Tfearch.h" />
<ClInclude Include="source\Tfe\Tfesupp.h" />
<ClInclude Include="source\Tfe\Uilib.h" />
<ClInclude Include="source\Uthernet1.h" />
<ClInclude Include="source\Uthernet2.h" />
<ClInclude Include="source\Utilities.h" />
<ClInclude Include="source\Video.h" />
<ClInclude Include="Source\VidHD.h" />
<ClInclude Include="source\W5100.h" />
<ClInclude Include="source\Windows\AppleWin.h" />
<ClInclude Include="source\Windows\DirectInput.h" />
<ClInclude Include="source\Windows\HookFilter.h" />
<ClInclude Include="source\Windows\Win32Frame.h" />
<ClInclude Include="source\Windows\WinFrame.h" />
<ClInclude Include="source\Windows\WinVideo.h" />
<ClInclude Include="source\YamlHelper.h" />
<ClInclude Include="source\z80emu.h" />
<ClInclude Include="source\Z80VICE\daa.h" />
@ -150,10 +140,8 @@
<Text Include="docs\Wishlist.txt" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="source\6522.cpp" />
<ClCompile Include="source\6821.cpp" />
<ClCompile Include="source\AY8910.cpp" />
<ClCompile Include="source\Card.cpp" />
<ClCompile Include="source\CardManager.cpp" />
<ClCompile Include="source\CmdLine.cpp" />
<ClCompile Include="source\Configuration\About.cpp" />
@ -167,10 +155,7 @@
<ClCompile Include="source\Configuration\PropertySheetHelper.cpp" />
<ClCompile Include="source\Core.cpp" />
<ClCompile Include="source\CPU.cpp" />
<ClCompile Include="source\Debugger\Debugger_Disassembler.cpp" />
<ClCompile Include="source\Debugger\Debugger_Win32.cpp" />
<ClCompile Include="source\Disk2CardManager.cpp" />
<ClCompile Include="source\FourPlay.cpp" />
<ClCompile Include="source\FrameBase.cpp" />
<ClCompile Include="source\RGBMonitor.cpp" />
<ClCompile Include="source\SAM.cpp" />
@ -207,11 +192,9 @@
<ClCompile Include="source\Riff.cpp" />
<ClCompile Include="source\SaveState.cpp" />
<ClCompile Include="source\SerialComms.cpp" />
<ClCompile Include="source\SNESMAX.cpp" />
<ClCompile Include="source\SoundCore.cpp" />
<ClCompile Include="source\Speaker.cpp" />
<ClCompile Include="source\Speech.cpp" />
<ClCompile Include="source\SSI263.cpp" />
<ClCompile Include="source\StdAfx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'">Create</PrecompiledHeader>
@ -220,13 +203,9 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release NoDX|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="source\StrFormat.cpp" />
<ClCompile Include="source\SynchronousEventManager.cpp" />
<ClCompile Include="source\Tape.cpp" />
<ClCompile Include="source\Tfe\IPRaw.cpp" />
<ClCompile Include="source\Tfe\NetworkBackend.cpp" />
<ClCompile Include="source\Tfe\PCapBackend.cpp" />
<ClCompile Include="source\Tfe\tfearch.cpp">
<ClCompile Include="source\Tfe\Tfe.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug NoDX|Win32'">NotUsing</PrecompiledHeader>
@ -234,7 +213,15 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release NoDX|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="source\Tfe\tfesupp.cpp">
<ClCompile Include="source\Tfe\Tfearch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug NoDX|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release NoDX|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="source\Tfe\Tfesupp.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug NoDX|Win32'">NotUsing</PrecompiledHeader>
@ -250,16 +237,13 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release NoDX|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="source\Uthernet1.cpp" />
<ClCompile Include="source\Uthernet2.cpp" />
<ClCompile Include="source\Utilities.cpp" />
<ClCompile Include="source\Video.cpp" />
<ClCompile Include="Source\VidHD.cpp" />
<ClCompile Include="source\Windows\AppleWin.cpp" />
<ClCompile Include="source\Windows\DirectInput.cpp" />
<ClCompile Include="source\Windows\HookFilter.cpp" />
<ClCompile Include="source\Windows\Win32Frame.cpp" />
<ClCompile Include="source\Windows\WinFrame.cpp" />
<ClCompile Include="source\Windows\WinVideo.cpp" />
<ClCompile Include="source\YamlHelper.cpp" />
<ClCompile Include="source\z80emu.cpp" />
<ClCompile Include="source\Z80VICE\daa.cpp">
@ -291,12 +275,9 @@
<None Include="resource\Apple2.rom" />
<None Include="resource\Apple2e.rom" />
<None Include="resource\Apple2e_Enhanced.rom" />
<None Include="resource\Apple2_JPlus.rom" />
<None Include="resource\Apple2_JPlus_Video.rom" />
<None Include="resource\Apple2_Plus.rom" />
<None Include="resource\Base64A.rom" />
<None Include="resource\Base64A_German_Video.rom" />
<None Include="resource\Disk2-13sector.rom" />
<None Include="resource\DISK2.rom" />
<None Include="resource\Freezes_Non-autostart_F8_Rom.rom" />
<None Include="resource\Hddrvr.bin" />
@ -327,7 +308,6 @@
<ItemGroup>
<Image Include="resource\Applewin.bmp" />
<Image Include="resource\APPLEWIN.ICO" />
<Image Include="resource\ApplewinLogo.bmp" />
<Image Include="resource\CAPSOFF.BMP" />
<Image Include="resource\CAPSOFF_P8.BMP" />
<Image Include="resource\CAPSON.BMP" />
@ -464,17 +444,17 @@
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>iphlpapi.lib;htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<PreBuildEvent>
<Command>.\Debug\TestCPU6502.exe</Command>
<Command>echo Performing unit-test: TestCPU6502
.\Debug\TestCPU6502.exe</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Performing unit-test: TestCPU6502</Message>
@ -492,12 +472,11 @@
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
<DisableSpecificWarnings>4995</DisableSpecificWarnings>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>iphlpapi.lib;htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;ddraw_lib\x86\dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw_lib\x86\ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;ddraw_lib\x86\dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw_lib\x86\ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
@ -519,17 +498,17 @@
<AdditionalIncludeDirectories>source;source\cpu;source\debugger;zlib;zip_lib;libyaml\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>iphlpapi.lib;htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalManifestDependencies>"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<PreBuildEvent>
<Command>.\Debug\TestCPU6502.exe</Command>
<Command>echo Performing unit-test: TestCPU6502
.\Debug\TestCPU6502.exe</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Performing unit-test: TestCPU6502</Message>
@ -548,20 +527,20 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>iphlpapi.lib;htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<AdditionalManifestDependencies>"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<PreBuildEvent>
<Command>.\Release\TestCPU6502.exe</Command>
<Command>echo Performing unit-test: TestCPU6502
.\Release\TestCPU6502.exe</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Performing unit-test: TestCPU6502</Message>
@ -581,14 +560,13 @@
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<DisableSpecificWarnings>4995</DisableSpecificWarnings>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>iphlpapi.lib;htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;ddraw_lib\x86\dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw_lib\x86\ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;ddraw_lib\x86\dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;ddraw_lib\x86\ddraw.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<AdditionalManifestDependencies>"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
@ -614,20 +592,20 @@
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>iphlpapi.lib;htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>htmlhelp.lib;comctl32.lib;winmm.lib;dsound.lib;dxguid.lib;version.lib;strmiids.lib;dinput8.lib;user32.lib;gdi32.lib;advapi32.lib;shell32.lib;comdlg32.lib;ole32.lib;wsock32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<AdditionalManifestDependencies>"type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"</AdditionalManifestDependencies>
<MinimumRequiredVersion>5.01</MinimumRequiredVersion>
</Link>
<PreBuildEvent>
<Command>.\Release\TestCPU6502.exe</Command>
<Command>echo Performing unit-test: TestCPU6502
.\Release\TestCPU6502.exe</Command>
</PreBuildEvent>
<PreBuildEvent>
<Message>Performing unit-test: TestCPU6502</Message>

View file

@ -142,10 +142,13 @@
<ClCompile Include="source\Tape.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\Tfe\tfearch.cpp">
<ClCompile Include="source\Tfe\Tfe.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
<ClCompile Include="source\Tfe\tfesupp.cpp">
<ClCompile Include="source\Tfe\Tfearch.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
<ClCompile Include="source\Tfe\Tfesupp.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
<ClCompile Include="source\Tfe\Uilib.cpp">
@ -196,6 +199,9 @@
<ClCompile Include="source\Windows\DirectInput.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
<ClCompile Include="source\Windows\WinVideo.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
<ClCompile Include="source\Windows\WinFrame.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
@ -217,51 +223,6 @@
<ClCompile Include="source\Windows\Win32Frame.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
<ClCompile Include="source\SSI263.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\Debugger\Debugger_Disassembler.cpp">
<Filter>Source Files\Debugger</Filter>
</ClCompile>
<ClCompile Include="source\Debugger\Debugger_Win32.cpp">
<Filter>Source Files\Debugger</Filter>
</ClCompile>
<ClCompile Include="source\Windows\HookFilter.cpp">
<Filter>Source Files\Windows</Filter>
</ClCompile>
<ClCompile Include="source\FourPlay.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\SNESMAX.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\Card.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="Source\VidHD.cpp">
<Filter>Source Files\Video</Filter>
</ClCompile>
<ClCompile Include="source\6522.cpp">
<Filter>Source Files\Emulator</Filter>
</ClCompile>
<ClCompile Include="source\StrFormat.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="source\Uthernet1.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
<ClCompile Include="source\Tfe\NetworkBackend.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
<ClCompile Include="source\Tfe\PCapBackend.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
<ClCompile Include="source\Uthernet2.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
<ClCompile Include="source\Tfe\IPRaw.cpp">
<Filter>Source Files\Uthernet</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="source\CommonVICE\6510core.h">
@ -276,6 +237,9 @@
<ClInclude Include="source\AY8910.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\Bittypes.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\Bpf.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
@ -414,6 +378,9 @@
<ClInclude Include="source\Tfe\Pcap.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\Pcap-stdinc.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Configuration\PropertySheet.h">
<Filter>Source Files\Configuration</Filter>
</ClInclude>
@ -456,10 +423,13 @@
<ClInclude Include="source\Tape.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\tfearch.h">
<ClInclude Include="source\Tfe\Tfe.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\tfesupp.h">
<ClInclude Include="source\Tfe\Tfearch.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\Tfesupp.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\Uilib.h">
@ -534,6 +504,12 @@
<ClInclude Include="source\Windows\DirectInput.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
<ClInclude Include="source\Windows\WinVideo.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
<ClInclude Include="source\Windows\WinFrame.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
<ClInclude Include="source\Core.h">
<Filter>Source Files</Filter>
</ClInclude>
@ -555,51 +531,6 @@
<ClInclude Include="source\Windows\Win32Frame.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
<ClInclude Include="source\SSI263.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\Debugger\Debugger_Disassembler.h">
<Filter>Source Files\Debugger</Filter>
</ClInclude>
<ClInclude Include="source\Debugger\Debugger_Win32.h">
<Filter>Source Files\Debugger</Filter>
</ClInclude>
<ClInclude Include="source\Windows\HookFilter.h">
<Filter>Source Files\Windows</Filter>
</ClInclude>
<ClInclude Include="source\FourPlay.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\SNESMAX.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="Source\VidHD.h">
<Filter>Source Files\Video</Filter>
</ClInclude>
<ClInclude Include="source\6522.h">
<Filter>Source Files\Emulator</Filter>
</ClInclude>
<ClInclude Include="source\StrFormat.h">
<Filter>Source Files</Filter>
</ClInclude>
<ClInclude Include="source\Uthernet1.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\NetworkBackend.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\PCapBackend.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\W5100.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Uthernet2.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
<ClInclude Include="source\Tfe\IPRaw.h">
<Filter>Source Files\Uthernet</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="resource\Applewin.bmp">
@ -710,9 +641,6 @@
<Image Include="resource\RUNBASE64A.BMP">
<Filter>Resource Files</Filter>
</Image>
<Image Include="resource\ApplewinLogo.bmp">
<Filter>Resource Files</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<None Include="resource\Apple2.rom">
@ -778,15 +706,6 @@
<None Include="resource\Base64A_German_Video.rom">
<Filter>Resource Files</Filter>
</None>
<None Include="resource\Apple2_JPlus.rom">
<Filter>Resource Files</Filter>
</None>
<None Include="resource\Apple2_JPlus_Video.rom">
<Filter>Resource Files</Filter>
</None>
<None Include="resource\Disk2-13sector.rom">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="docs\CodingConventions.txt">

View file

@ -1,10 +0,0 @@
rem Commands to build AppleWin on travis
setlocal
choco install visualstudio2019community
choco install visualstudio2019-workload-nativedesktop
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsMSBuildCmd.bat"
MSBuild.exe /p:Configuration=Release AppleWinExpress2019.sln

View file

@ -1,28 +1,10 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.9)
project(applewin HOMEPAGE_URL "https://github.com/audetto/AppleWin")
include(CPack)
option(BUILD_APPLEN "build ncurses frontend")
option(BUILD_QAPPLE "build Qt5 frontend")
option(BUILD_SA2 "build SDL2 frontend")
option(BUILD_LIBRETRO "build libretro core")
project(applewin)
if (NOT (BUILD_APPLEN OR BUILD_QAPPLE OR BUILD_SA2 OR BUILD_LIBRETRO))
message(NOTICE "Building everything by default")
set(BUILD_APPLEN ON)
set(BUILD_QAPPLE ON)
set(BUILD_SA2 ON)
set(BUILD_LIBRETRO ON)
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(-Werror=return-type)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_compile_options(-Werror=format -Wno-error=format-overflow -Wno-error=format-truncation -Wno-psabi)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-multichar -Werror=return-type")
MESSAGE("CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
MESSAGE("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
@ -42,7 +24,7 @@ execute_process(COMMAND uname -n
if(${UNAME} STREQUAL raspberrypi)
# it is too slow and might cause out of memory issues
# more forensic is required
MESSAGE(NOTICE "Raspberry Pi detected: IPO disabled")
MESSAGE("Raspberry Pi detected: IPO disabled")
else()
include(CheckIPOSupported)
check_ipo_supported()
@ -52,43 +34,10 @@ endif()
include_directories(source)
add_subdirectory(source)
add_subdirectory(source/linux/libwindows)
add_subdirectory(resource)
add_subdirectory(source/frontends/common2)
add_subdirectory(source/frontends/ncurses)
add_subdirectory(source/frontends/qt)
add_subdirectory(source/frontends/sdl)
add_subdirectory(source/frontends/libretro)
add_subdirectory(test/TestCPU6502)
if (BUILD_LIBRETRO OR BUILD_APPLEN OR BUILD_SA2)
add_subdirectory(source/frontends/common2)
endif()
if (BUILD_APPLEN)
add_subdirectory(source/frontends/ncurses)
endif()
if (BUILD_QAPPLE)
add_subdirectory(source/frontends/qt)
endif()
if (BUILD_SA2)
add_subdirectory(source/frontends/sdl)
endif()
if (BUILD_LIBRETRO)
add_subdirectory(source/frontends/libretro)
endif()
file(STRINGS resource/version.h VERSION_FILE LIMIT_COUNT 1)
string(REGEX MATCH "#define APPLEWIN_VERSION (.*)" _ ${VERSION_FILE})
string(REPLACE "," "." VERSION ${CMAKE_MATCH_1})
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apple ][ emulator for Linux")
set(CPACK_PACKAGE_CONTACT "audetto <mariofutire@gmail.com>")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS "ON")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON")
set(CPACK_RPM_PACKAGE_LICENSE "GPLv2")
set(CPACK_RPM_PACKAGE_GROUP "Applications/Emulators")
# RPM dependencies are automatic
include(CPack)

View file

@ -28,8 +28,6 @@ The process described here has several goals:
- Maintain AppleWin's quality
- Enforce a workable solution for AppleWin maintainers to review contributions
Please review the simple [Coding Conventions](https://github.com/AppleWin/AppleWin/blob/master/docs/CodingConventions.txt).
Smaller PRs are highly desirable, as they should be simpler to review and approve. Large changes are likely to be rejected or not get looked at (resulting in them going stale, and ultimately diverging further from the mainline repo).
For large changes being submitted for review, then it's HIGHLY recommended to split the large PR into smaller PRs, and submit them piece by piece. This means that no dependencies can exist between each smaller PR.

BIN
Disks/CPM_Apple_CPM.dsk Normal file

Binary file not shown.

BIN
Disks/NoSlotClockTest.dsk Normal file

Binary file not shown.

BIN
Disks/SAM Slot 5.dsk Normal file

Binary file not shown.

View file

@ -0,0 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug v141_xp|Win32">
<Configuration>Debug v141_xp</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release v141_xp|Win32">
<Configuration>Release v141_xp</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectName>HookFilter</ProjectName>
<ProjectGuid>{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}</ProjectGuid>
<RootNamespace>HookFilter</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v141_xp</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>15.0.26419.1</_ProjectFileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'">
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers />
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug v141_xp|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>
</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader />
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release v141_xp|Win32'">
<ClCompile>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>
</DisableSpecificWarnings>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="HookFilter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

79
HookFilter/HookFilter.cpp Normal file
View file

@ -0,0 +1,79 @@
#include <windows.h>
static HWND g_hFrameWindow = (HWND)0;
static bool g_bHookAltTab = false;
static bool g_bHookAltGrControl = false;
// NB. __stdcall (or WINAPI) and extern "C":
// . symbol is decorated as _<symbol>@bytes
// . so use the #pragma to create an undecorated alias for our symbol
extern "C" __declspec(dllexport) LRESULT CALLBACK LowLevelKeyboardProc(
_In_ int nCode,
_In_ WPARAM wParam,
_In_ LPARAM lParam)
{
#pragma comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)
if (nCode == HC_ACTION)
{
bool suppress = false;
PKBDLLHOOKSTRUCT pKbdLlHookStruct = (PKBDLLHOOKSTRUCT) lParam;
UINT newMsg = pKbdLlHookStruct->flags & LLKHF_UP ? WM_KEYUP : WM_KEYDOWN;
LPARAM newlParam = newMsg == WM_KEYUP ? 3<<30 : 0; // b31:transition state, b30:previous key state
//
// NB. Alt Gr (Right-Alt): this normally send 2 WM_KEYDOWN messages for: VK_LCONTROL, then VK_RMENU
// Keyboard scanCodes: LCONTROL=0x1D, LCONTROL_from_RMENU=0x21D
// . For: Microsoft PS/2/Win7-64, VAIO laptop/Win7-64, Microsoft USB/Win10-64
// NB. WM_KEYDOWN also includes a 9/10-bit? scanCode: LCONTROL=0x1D, RCONTROL=0x11D, RMENU=0x1D(not 0x21D)
// . Can't suppress in app, since scanCode is not >= 0x200
if (g_bHookAltGrControl && pKbdLlHookStruct->vkCode == VK_LCONTROL && pKbdLlHookStruct->scanCode >= 0x200) // GH#558
{
suppress = true;
}
// Suppress alt-tab
if (g_bHookAltTab && pKbdLlHookStruct->vkCode == VK_TAB && (pKbdLlHookStruct->flags & LLKHF_ALTDOWN))
{
PostMessage(g_hFrameWindow, newMsg, VK_TAB, newlParam);
suppress = true;
}
// Suppress alt-escape
if (pKbdLlHookStruct->vkCode == VK_ESCAPE && (pKbdLlHookStruct->flags & LLKHF_ALTDOWN))
{
PostMessage(g_hFrameWindow, newMsg, VK_ESCAPE, newlParam);
suppress = true;
}
// Suppress alt-space
if (pKbdLlHookStruct->vkCode == VK_SPACE && (pKbdLlHookStruct->flags & LLKHF_ALTDOWN))
{
PostMessage(g_hFrameWindow, newMsg, VK_SPACE, newlParam);
suppress = true;
}
// Suppress ctrl-escape
if (pKbdLlHookStruct->vkCode == VK_ESCAPE)
{
// But don't suppress CTRL+SHIFT+ESC
if (GetKeyState(VK_CONTROL) < 0 && GetKeyState(VK_SHIFT) >= 0)
suppress = true;
}
// Suppress keys by returning 1
if (suppress)
return 1;
}
return CallNextHookEx(0/*parameter is ignored*/, nCode, wParam, lParam);
}
extern "C" __declspec(dllexport) void __cdecl RegisterHWND(HWND hWnd, bool bHookAltTab, bool bHookAltGrControl)
{
g_hFrameWindow = hWnd;
g_bHookAltTab = bHookAltTab;
g_bHookAltGrControl = bHookAltGrControl;
}

View file

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9.00"
Name="HookFilter"
ProjectGUID="{AA5854AD-2BC7-4EFD-9790-349ADB35E35A}"
RootNamespace="HookFilter"
Keyword="Win32Proj"
TargetFrameworkVersion="196613"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
CharacterSet="1"
WholeProgramOptimization="1"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;HOOKFILTER_EXPORTS"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
WarningLevel="3"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkIncremental="1"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=".\HookFilter.cpp"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

2
Make_Distribution.bat Normal file
View file

@ -0,0 +1,2 @@
attrib -r "bin\AppleWin.exe"
copy "Release\AppleWin.exe" bin\

View file

@ -1,30 +1,12 @@
AppleWin
========
#### Apple II emulator for Windows
AppleWin is a fully-featured emulator supporting different Apple II models and clones. A variety of peripheral cards and video display modes are supported (eg. NTSC, RGB); and there's an extensive built-in symbolic debugger.
Peripheral cards and add-on hardware supported:
- Mockingboard, Phasor and SAM sound cards
- Disk II interface for floppy disk drives
- Hard disk controller
- Super Serial Card (SSC)
- Parallel printer card
- Mouse interface
- Apple IIe Extended 80-Column Text Card and RamWorks III (8MB)
- RGB cards: Apple's Extended 80-Column Text/AppleColor Adaptor Card, 'Le Chat Mauve' Féline and Eve.
- CP/M SoftCard
- Uthernet I and II (ethernet cards)
- Language Card and Saturn 64/128K for Apple II/II+
- 4Play and SNES MAX joystick cards
- VidHD card (functionality limited to IIgs' Super Hi-Res video modes)
- No Slot Clock (NSC)
Apple II emulator for Windows
Download latest (stable) release: [AppleWin v1.29.16.0](https://github.com/AppleWin/AppleWin/releases/download/v1.29.16.0/AppleWin1.29.16.0.zip)
Download latest (stable) release: [AppleWin v1.29.13.0](https://github.com/AppleWin/AppleWin/releases/download/v1.29.13.0/AppleWin1.29.13.0.zip)
Release Notes: [v1.29.16.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.29.16.0)
Release Notes: [v1.29.13.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.29.13.0)
Building
@ -44,10 +26,8 @@ Please report [new issues](https://github.com/AppleWin/AppleWin/issues/new)
Previous Versions
=================
Last version supporting Windows 2000:
* [AppleWin v1.28.8.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.28.8.0)
* [AppleWin v1.29.16.0](https://github.com/AppleWin/AppleWin/releases/tag/v1.29.16.0)
Last version supporting Windows 98/ME:
Last pre-NTSC change:
* [AppleWin v1.25.0.4](https://github.com/AppleWin/AppleWin/releases/tag/v1.25.0.4)

View file

@ -8,157 +8,8 @@ https://github.com/AppleWin/AppleWin/issues/new
Tom Charlesworth
1.30.9.0 - 23 Mar 2022
----------------------
. [Change #518] Support Uthernet II card in slot 3. [audetto]
- EG. Use with Contiki, A2osX, ii-vision, a2stream etc.
- Support for W5100 modes: TCP, UDP, IPRAW and MACRAW (no support for PPPoE mode, interrupts and SPI).
. [Bug #1066] Fix for save-states where (eg) disk image name contains '#' character.
. [Bug #1017] Fix for printer interface where character got output twice.
. [PR #1031 + others] Internal: refactor string output handling. [kiyolee]
. Change: default install of AppleWin now sets slot 3 as empty (was Uthernet I card)
. Fix 6522 bug: IFR.T2 was always set when counter.b15=1
1.30.8.0 - 8 Feb 2022
---------------------
. [Bug #1023] WOZ support: Tweak to track sync support.
. [Bug #1020] WOZ support: Significant bit-cells after a gap between latch access upped from 50 to 100.
- Fixes: What's My Logic, Forbidden Quest, The Isle of Mem.
. [Bug #1018] Support AN3 for //e models.
. [Bug #1015] Registry: fix support for legacy 'Harddisk Enable' key.
. [PR #1028] Internal: Split 6522 out of MB code and into own class (bumps MB version in save-state).
. [PR #1025] Load save-state for Cards: improve error messages. [audetto]
. [PR #1014] Correct BMP creation. [audetto]
. SSC: Fix for command line -dcd not being honoured. (Regression)
. VidHD: Fix load save-state for II/II+ when VidHD's SHR is being updated.
. Debugger: see Debugger_Changelog.txt, but including:
- Added: CD now detects ".." to change to the previous directory and chops the trailing sub-directory from the current path.
- Changed: Disassembly window now lists symbol labels and symbol target address from User2 in orange.
- Added: Branch instructions now show target address.
- Added: Disassembly window now shows signed decimal values for immediate values.
1.30.7.0 - 19 Dec 2021
----------------------
. [Bug #997] Support VidHD card for IIgs Super Hi-Res (SHR) video modes, eg. for Total Replay box art.
- Support VidHD in slot 3 (via Config GUI or '-s3 vidhd').
- Only partial VidHD support - ie. just for SHR video modes, but SHR is supported for all Apple II models.
- NB. AppleWin's window is slightly enlarged when VidHD card is inserted.
- Command line: Allow user to specify width & height (for full-screen); and allow separate x,y scaling in full-screen mode.
- eg. for 4:3 aspect ratio on monitors that support it: -no-full-screen -fs-width=1600 -fs-height=1200
- Debugger: add 'shr' command to view video.
. [Change #1007] HDD: Fail if r/w access touches $Cnnn I/O space
- Debugger: On a HDD r/w failure, execution will break, and the debugger will show a stop reason message.
- Also fix HDD write wrapping at 64KiB boundary.
. [Change #996] Adapt HDD firmware to be slot-independent.
- Internal only, since currently no support to specify HDD Controller card in another slot.
. Debugger: Add 'brk all <on|off>' command to break on any BRK or invalid opcode.
1.30.6.0 - 30 Oct 2021
----------------------
. [Bug #993] Fix Mousecard not persisting after a machine's hardware changes. (Regression at 1.30.5.0)
. [Bug #985] Fix one-shot paddle timers. [xotmatrix]
. [Bug #989] Debugger: Fix disassembly for NMOS 6502's JMP (Indirect) not showing correct target address.
. [Change #987] Debugger: Add 'lbr' command to show Last Branch Record for a change to the control-flow from an instruction or interrupt.
- NB. Bcc opcodes that aren't taken don't affect lbr.
. Debugger: Add 'brkint <on|off>' command to break at the instruction after an interrupt is taken.
1.30.5.0 - 2 Oct 2021
---------------------
. [Change #972] Add SNES MAX card (in slots 3, 4 or 5) to support up to 2 SNES (or 12-button) controllers.
. [Change #946] Add 4Play card (in slots 3, 4 or 5) to support up to 4 Atari controllers.
. [Change #420] Uthernet card's state persisted to save-state.
- NB. it's best to get your DHCP server to assign a static IP for the card's MAC address.
. Change: SAM card's state persisted to save-state.
. [Bug #980] Fix 'Authentic Disk Speed' regression (at 1.30.4.0).
. [Bug #981] Fix command line -d2 (and -h2) which weren't reporting an error if image couldn't be opened.
. [Bug #981] Support command line if there are multiple spaces between args.
. [PR #983] Improve save-state card management
- Use Registry "Configuration\Slot n' locations to save each card's type & config.
- eg. "Last Harddisk Image 1" has moved from "Preferences" to "Configuration\Slot 7".
. AppleWin's Debugger help: document how to allow CTRL+SHIFT+0 to work (to set bookmark-0).
1.30.4.0 - 29 Aug 2021
----------------------
. [Change #975] Extend Configuration's Disk GUI to support a Disk II controller in slot 5.
. [Change #977] Add per-slot configuration to the Registry (and conf.ini).
- eg. "Last Disk Image 1" has moved from "Preferences" to "Configuration\Slot 6".
. [Change #976] AppleWin's help now documents Control-PrintScreen to copy the debugger's disassembly window to the clipboard.
. [Change #960] Floppy image names are now stored in Registry (or conf.ini) with their full path.
- NB. Hard disk images were already stored with full path.
- NB. save-states still only store the filename (and use "[HDV] Starting Directory" or prompt user to find the file).
1.30.3.0 - 19 Jun 2021
----------------------
. [Change #962] Remove the HookFilter.dll, and statically link instead.
- this removes the runtime dependency on VCRUNTIME140.dll (ie. vc_redist.x86.exe).
. [Bug #965] Fix display flicker on exit.
1.30.2.0 - 31 May 2021
----------------------
. [Change #947] Uthernet: fix so that a h/w change doesn't require the app to be close & reopened. [audetto]
. [Change #876] Command line: change -fs-height so only applied during full-screen (Windows mode unaffected).
. [Bug #958] Debugger: Mockingboard speech interrupt not working in debugger 'gg' mode.
. [Bug #952] Fix Mockingboard SC-01 speech for Ape Escape.
. Fix Phasor regression (at 1.30.0.0) as it does support reading AY-3-8913 registers in Mockingboard mode & Phasor native mode (just not Echo+ mode).
. Debugger: when displaying 6522 registers, if T1 and/or T2 is active, then display in white.
1.30.1.0 - 3 May 2021
---------------------
. Improve Mockingboard's 6522 support for cycle-accurate reading of IFR at Timer1/2 underflow.
. Improve logging of Speaker code.
1.30.0.0 - 18 Apr 2021
----------------------
Note: This version only works under Windows XP and later.
. [Change #693] AppleWin built with VS2019 using v141_xp platform toolset
. [Change #939] Improved support for SSI263 speech chip.
- Fix for 'Classic Adventure' (#929) not detecting speech chip.
- Support the 2-bit Duration b7:6 of phoneme register for SSI263 (not SC01).
- Support 2nd SSI263 at $Cn20 connected to 6522-A (at $Cn00).
- SC01: only support it mapped to 6522 at $Cn00.
. [Change #936] Swap Joystick Buttons not working
- Command line (-swap-buttons) or GUI "Swap 0/1" now swaps buttons 0/1 for all devices.
. [Change #930] WOZ support: add some random jitter in the bit stream
- A better alternative fix for WOZ images: 'Wasteland' and 'Legacy of the Ancients'.
- Fix for WOZ images: 'Gruds in Space' (bug #921) and 'Buzzard Bait' (bug #930).
. [Change #912] For 'Base 64A' add support for its F2 key via the Windows DEL key.
. [Change #876] Starting up windowed mode & full-screen mode
- New command line switch -no-full-screen to start in windowed mode.
- Added command line switch -full-screen as an alias for -f.
. [Change #864] Anti-M 1.8 doesn't work
- Improved Disk II card's data latch value when: (a) drive disconnected or (b) connected, but empty.
- New command line switches -d1-disconnected and -d2-disconnected to disconnect drives from slot-6 card.
. [Bug #934] Characters doubled in BASIC.SYSTEM when using -speech switch.
- Trap calls to COUT1 and BASICOUT (instead of COUT).
. [Bug #827] Fix bug where NSC is recognised on Apple II/II+ when slot-3 is empty.
- Support NSC on 6502-based Apple II's via F8-ROM for ProDOS 2.5 compatibility.
. [Bug #770] Fix so that no AY changes get dropped.
- Support reading the AY-3-8913 registers (not Phasor though).
. [Bug #652, #833] Fixes for Mockingboard's 6522 VIA.
- Cycle-accurate TIMER1/2 r/w for all addressing modes.
- Support TIMER1 latch in one-shot mode.
- Improve 6522 reset support - only ACR,IFR,IER affected.
. [PR #891] Fix for "Unable to capture PrintScreen key" warning on startup.
- Adds a "Don't show this message again" checkbox to the message.
. Debugger: add red 'IRQ' after the v/h-pos when IRQ is being asserted to the 6502.
. Debugger: improve mini-memory views for 6522 & AY8913 chip registers.
. Much refactoring to the code by Andrea Odetti / @audetto.
1.29.16.0 - 1 Nov 2020
----------------------
Note: This is the last planned version to support Windows 2000.
. [Bug #851] RGB support: AppleColor card (-rgb-card-type apple) is now an alias for Video7's RGB-SL7 card (-rgb-card-type sl7).
. [Bug #850] RGB support: removed the preconditions for AN3 setting the RGB video mode flags.
- IOUDIS soft-switch is for //c only, so removed support for //e.

View file

@ -12,9 +12,11 @@
@COPY /Y "%APPLEWIN_ROOT%\docs\Debugger_Changelog.txt" "%~1"
@COPY /Y "%APPLEWIN_ROOT%\help\AppleWin.chm" "%~1"
@COPY /Y "%APPLEWIN_ROOT%\Release v141_xp\AppleWin.exe" "%~1"
@COPY /Y "%APPLEWIN_ROOT%\Release v141_xp\HookFilter.dll" "%~1"
CD "%~1"
"C:\Program Files (x86)\7-Zip\7z.exe" a ..\AppleWin"%~1".zip *
"C:\Program Files (x86)\7-Zip\7z.exe" a ..\AppleWin"%~1"-PDB.zip "%APPLEWIN_ROOT%\Release v141_xp\AppleWin.pdb"
@REM Even though LINK has /PDB: outputting to HookFilter.pdb, it ends up being called vc141.pdb! (and remaining in the HookFilter folder)
"C:\Program Files (x86)\7-Zip\7z.exe" a ..\AppleWin"%~1"-PDB.zip "%APPLEWIN_ROOT%\Release v141_xp\AppleWin.pdb" "%APPLEWIN_ROOT%\HookFilter\Release v141_xp\vc141.pdb"
CD ..
@GOTO end

View file

@ -2,10 +2,6 @@ Coding Conventions for AppleWin
===============================
History:
v4 - 05-Mar-2022 (TC)
. #1050: Added info about Platform Toolset v141_xp
. Use of C++11/14/17
. Use StrFormat() instead of sprintf() etc.
v3 - 14-Nov-2020 (TC)
. #868: Reduced Hungarian notation
v2 - 16-Feb-2006 (TC)
@ -42,7 +38,7 @@ Obviously not for global funcs or vars.
the header file for that module.
EG. For Debug.cpp:
#include "stdafx.h"
#include "Debug.h"
#include "Debug."
This ensures that this header file can be included in any order in another module,
and therefore by extension all header files can be included in any order.
@ -51,14 +47,11 @@ and therefore by extension all header files can be included in any order.
2) Coding Style:
As a general rule and for consistency, adopt the coding convention/style of any module (or function) you are modifying.
2.1: Naming
For functions use upper camel case.
For variables use lower camel case.
And only if applicable, the following simplified prefix (Hungarian) style can be used:
And if applicable, the following simplied prefix (Hungarian) style must be used:
Prefixes:
g_ : global
@ -69,7 +62,21 @@ Tags:
_e : named enum definitions
_t : struct/typedef
Also see: "Appendix: Legacy Hungarian notation"
Legacy:
dw : DWORD
sz : string (null-terminated)
a : array
b : bool
e : enum variable
h : handle
i : iterator (eg. UINT, STL-iterator)
m : STL map
n : int
r : reference
s : string
sg_p : singleton
u : unsigned int
v : STL vector
EG:
enum MODE_e {MODE1, MODE2, MODE2};
@ -120,42 +127,4 @@ It is recommended (but not mandatory):
Eg:
. Prefer: z = ((a + b) + 1) instead of: z=((a+b)+1)
-------------------------------------------------------------------------------
3) Use of sprintf() etc.
Do not use sprintf(), StringCbPrintf(), wsprintf(), etc. - instead use StrFormat().
-------------------------------------------------------------------------------
4) Use of C++
VS2019's Platform Toolset "Visual Studio 2017 - Windows XP(v141_xp)" is used for building releases.
This is VS2017 v15.0, which includes support for C++11, C++14 and some C++17 core language support[1].
[1] https://docs.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance?view=msvc-170
4.1: Type deduction (including auto)
Use type deduction only if it makes the code clearer to readers who aren't familiar with the project,
or if it makes the code safer. Do not use it merely to avoid the inconvenience of writing an explicit type.
(Ref: https://google.github.io/styleguide/cppguide.html#Type_deduction)
-------------------------------------------------------------------------------
Appendix: Legacy Hungarian notation
dw : DWORD
sz : string (null-terminated)
a : array
b : bool
e : enum variable
h : handle
i : iterator (eg. UINT, STL-iterator)
m : STL map
n : int
r : reference
s : string
sg_p : singleton
u : unsigned int
v : STL vector
2.8: For consistency, adopt the coding convention of any module (or function) you are modifying.

View file

@ -1,41 +1,7 @@
/*
2.9.1.13 Added: CD now detects ".." to change to the previous directory and chops the trailing sub-directory from the current path.
It worked before but would clutter up the current directory with a trailing "..\".
2.9.1.12 Added: New commands HGR0, HGR3, HGR4, HGR5 to see pseudo pages $00, $60, $80, $A0 respectively.
2.9.1.11 Fixed: Right justify signed decimal values.
Example:
U 300
300:A9 80 A9 81 A9 FF A9 00 A9 01 A9 7E A9 7F
Will display as:
LDA #$80 #-128
LDA #$81 #-127
LDA #$FF #-1
LDA #$00
LDA #$01 #+1
LDA #$7E #+126
LDA #$7F #+127
2.9.1.10 Fixed: Immedate #80 was not showing -128 for the signed decimal value.
2.9.1.9 Fixed: Immediate #0 was showing '#' prefix but not showing zero for the signed decimal value. Changed to show the signed decimal value only if non zero.
2.9.1.8 Changed: Disassembly window now lists symbol labels and symbol target address from User2 in orange.
Example:
U 300
SYM @ = 303
300: 20 03 03
2.9.1.7 Added: Extended SYM command to auto-generate symbol names when reverse engineering. NOTE: These symbols will be placed in User2.
Example:
SYM @ = 800 // Alias for: SYM _0800 = 0800
2.9.1.6 Added: Branch instructions now show target address.
2.9.1.5 Added: Disassembly window now shows signed decimal values for immediate values.
2.9.1.4 Changed: Show symbol warnings in Orange, and length of symbols in light blue.
2.9.1.3 Added: DB commanoptionally supports =
DB HGR = 2000:3FFF
2.9.1.2 Fixed: Off by one end address when deleting DisasmData_t
2.9.1.1 Added: X command now supports a range and will chop off the appropiate data sections.
DB 2000:2005
X 2002:2003
Released post 1.30.7.0
2.9.1.0 Added: Bookmarks now have their own indicator (a number with a box around it) and replace the ":" separator. Updated Debug_Font.bmp
2.9.1.0 Added: Bookmarks now have their own indicator (a number with a box around it) and replace the ":" seperator. Updated Debug_Font.bmp
.18 Fixed: Resetting bookmarks wasn't setting the total bookmarks back to zero.
.17 Fixed: If all bookmarks were used then setting a new one wouldn't update an existing one to the new address.

View file

@ -1,37 +1,6 @@
Requests (Wishlist):
====================
* HOME/CLS Clear Screen
* DT Define Target
Default disassembly:
D7AF:A9 13 LDA #$13
D7B1:A0 E9 LDY #$E9
Correct disassembly:
DT D7AF:B7B2
D7AF:A9 13 LDA #<CON.ONE
D7B1:A0 E9 LDY #>CON.ONE
* DF Define FAC
* Cleanup Applesoft listing
* DB
* DA
* DF
* Read/Write Track/Sector
DISK 2 READ 11 F 800
DISK 2 WRITE 11 F 800
* Save/Load memory to mounted DOS3.3 disk
DSAVE "LOGO.HGR",2000:3FFF,6,1
DLOAD "LOGO.HGR"
* Save/load memory to mounted ProDOS disk/hard drive
PREFIX
PSAVE "LOGO.HGR",2000:3FFF
PLOAD "LOGO.HGR"
* [ ] HELP BPM on read/write
Nail down syntax:
BPM A7 = R

View file

@ -1,43 +0,0 @@
=== Updating CHM ===
cd help
"C:\Program Files (x86)\HTML Help Workshop\hhc" AppleWin.hhp
To view:
start AppleWin.chm
The batch file "update.bat" will both compile and view the CHM.
=== Installing Microsoft Help Workshop ===
The official site is here...
* https://docs.microsoft.com/en-us/previous-versions/windows/desktop/htmlhelp/microsoft-html-help-downloads
... but in typical MS fashion it is outdated -- it has two broken links since the Help Workshop is not on "Microsoft Download Center."
i.e.
* https://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe
* https://download.microsoft.com/download/0/a/9/0a939ef6-e31c-430f-a3df-dfae7960d564/htmlhelpj.exe
This community question ...
* https://docs.microsoft.com/en-us/answers/questions/265752/htmlhelp-workshop-download-for-chm-compiler-instal.html
... says to use Wayback Machine.
* http://web.archive.org/web/20160201063255/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe
* http://web.archive.org/web/20160314043751/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/helpdocs.zip
Installing it is straight-forward but you'll get a misleading pop-up dialog near the end:
"This computer has a newer version of HTML Help."
This refers to the help VIEWER (which is already installed) and NOT the help COMPILER which was just installed.
A step-by-step installation guide can be found here:
* https://www.helpndoc.com/step-by-step-guides/how-to-download-and-install-microsofts-html-help-workshop-compiler/

Binary file not shown.

View file

@ -26,7 +26,7 @@
;
; Modified by Tom Charlesworth:
; . Updated so it can be assembled by ACME 0.97
; . Updated so it can be assembled by ACME 0.96.4
; . Fixed so that ProDOS entrypoint is $c70a (26 Dev 2007) (Bug #12723)
; . Modified to support Apple Oasis' entrypoint: $c761 (8 Sept 2012) (Feature #5557)
; . Added support for SmartPort entrypoint (20 Oct 2012)
@ -34,11 +34,10 @@
; . GH#370 (Robert Hoem, 27 Oct 2016):
; . Added a check against open-apple during boot to route boot to slot 6
; . This happens after the first two blocks are loaded from the HD.
; . GH#319: SmartPort return address wrong when crossing page
; . GH#996: Make code slot-independent (so HDD controller card can go into any slot)
; . Moved the 512-byte block read into AppleWin's HDD emulation (to mirror the block write command)
; . GH#319: smartport return address wrong when crossing page
; TODO:
; . Remove support for Entrypoint_Cs46 (old AppleWin) & Entrypoint_Cs61 (Apple Oasis)
; . Make code relocatable (so HDD controller card can go into any slot)
; . Remove support for Entrypoint_C746 (old AppleWin) & Entrypoint_C761 (Apple Oasis)
; - provide a utility to convert these to use Entrypoint_ProDOS
; . Check SmartPort: Is it OK to trash Y and $42,..,$47 ?
;
@ -48,38 +47,31 @@
!sl "hddrvr.labels"
; constants
hd_execute = $c080
hd_status = $c081 ; b7=busy, b0=error
hd_command = $c082
hd_unitnum = $c083
hd_memblock = $c084
hd_diskblock = $c086
;hd_nextbyte = $c088 ; legacy read-only port (still supported by AppleWin)
; Notes on accesses to I/O registers:
; . ROR ABS16,X and ROL ABS16,X - only used for $C081+s*$10 STATUS register:
; 6502: double read (old data), write (old data), write (new data). The writes are harmless as writes to STATUS are ignored.
; 65C02: double read (old data), write (new data). The write is harmless as writes to STATUS are ignored.
; . STA ABS16,X does a false-read. This is harmless for writable I/O registers, since the false-read has no side effect.
hd_execute = $c0f0
hd_error = $c0f1
hd_command = $c0f2
hd_unitnum = $c0f3
hd_memblock = $c0f4
hd_diskblock = $c0f6
hd_nextbyte = $c0f8
command = $42
unitnum = $43
memblock = $44
diskblock = $46
slot6 = $C600
slot6 = $c600
OS = $0801
BUTTON0 = $C061
;======================================
!zone code
*= $0000 ; org $0000 - position-independent code, so doesn't matter (but the other fixed org positions need to be on the same page)
; The Autoboot rom will call this.
; This is also the entry point for such things as IN#7 and PR#7
;; code
*= $c700 ; org $c700
!zone code
start
; Autoboot and ProDOS look at the following few opcodes to detect block devices
@ -91,23 +83,44 @@ start
lda #$3C
bne Bootstrap
Entrypoint_ProDOS ; $Cn0A - ProDOS entrypoint
Entrypoint_ProDOS ; $c70a - ProDOS entrypoint
sec
bcs Entrypoint
Entrypoint_SmartPort ; $Cn0D - SmartPort entrypoint
Entrypoint_SmartPort ; $c70d - SmartPort entrypoint
clc
Entrypoint ; $c70e - entrypoint?
bcs cmdproc
bcc SmartPort
Entrypoint ; $Cn0E - entrypoint?
bcs GetSlotInX ; C=1: GetSlotInX -> cmdproc
;;
; C=0: fall through to SmartPort...
Bootstrap
; Lets check to see if there's an image ready
lda #$00
sta hd_command
; Slot 7, disk 1
lda #$70 ; Slot# << 4
sta hd_unitnum
lda hd_execute
; error capturing code. Applewin is picky
; about code assigning data to registers and
; memory. The safest method is via I/O port
ror hd_error ; Post: C=0 or 1
bcc hdboot
; no image ready, boot diskette image instead
BootSlot6
jmp slot6
;======================================
; TODO: Is it OK to trash Y and $42,..,$47 ?
; Pre: C=0, X = Slot# << 4
SmartPort ; SmartPort -> GetSlotInX -> cmdproc
; Pre: C=0
SmartPort
pla
sta $46
adc #3 ; Pre: C=0, Post: C=0 or 1
@ -123,7 +136,24 @@ SmartPort ; SmartPort -> GetSlotInX -> cmdproc
lda ($46),y ; cmd
sta $42
iny
bne SmartPort2
;======================================
; 8 unused bytes
*= $c746 ; org $c746
Entrypoint_C746 ; Old f/w 'cmdproc' entrypoint
; Keep this for any DOSMaster HDD images created with old AppleWin HDD f/w.
; DOSMaster hardcodes the entrypoint addr into its bootstrapping code:
; - So DOSMaster images are tied to the HDD's controller's f/w
sec
bcs Entrypoint
;======================================
; Pre: Y=2
SmartPort2
lda ($46),y ; param_l
sta $45
iny
@ -134,76 +164,31 @@ SmartPort ; SmartPort -> GetSlotInX -> cmdproc
lda ($45),y ; unit
sta $43
iny
lda ($45),y ; memblock_l
sta $44
iny
lda ($45),y ; memblock_h
pha
iny
lda ($45),y ; diskblock_l
pha
iny
bne SmartPort2
bne SmartPort3
;======================================
; 2 unused bytes
@checkCs46
*= $0046 ; org $0046
!warn "Cs46 padding = ", * - @checkCs46
Entrypoint_Cs46 ; Old f/w 'cmdproc' entrypoint
; Keep this for any DOSMaster HDD images created with old AppleWin HDD f/w.
; DOSMaster hardcodes the entrypoint addr into its bootstrapping code:
; - So DOSMaster images are tied to the HDD's controller's f/w
sec
bcs Entrypoint ; or directly to GetSlotInX
;======================================
Bootstrap
; Lets check to see if there's an image ready
; Slot n, disk 1
clc
bcc GetSlotInX ; Post: X = Slot# << 4
Bootstrap2
lda #$00
sta hd_unitnum,x ; b7=0 => disk 1
sta hd_command,x
lda hd_execute,x
ror hd_status,x ; Post: C=0 or 1
bcc hdboot
; no image ready, boot diskette image instead
BootSlot6
jmp slot6
;======================================
; 2 unused bytes
; 1 unused byte
@checkCs61
*= $0061 ; org $0061
!warn "Cs61 padding = ", * - @checkCs61
*= $c761 ; org $c761
Entrypoint_Cs61 ; Apple Oasis HDD controller entrypoint
Entrypoint_C761 ; Apple Oasis HDD controller entrypoint
; Keep this for any DOSMaster HDD images created with Apple Oasis HDD f/w.
; DOSMaster hardcodes the entrypoint addr into its bootstrapping code:
; - So DOSMaster images are tied to the HDD's controller's f/w
sec
bcs Entrypoint ; or directly to GetSlotInX
bcs Entrypoint
;======================================
; image ready. Lets boot from it.
; we want to load block 1 from disk 1 to $800 then jump there
; Pre: X = Slot# << 4
; C = 0
; we want to load block 1 from s7,d1 to $800 then jump there
hdboot
lda #$70 ; Slot# << 4
sta unitnum
lda #$0
sta unitnum ; b7=0 => disk 1
sta memblock
sta diskblock
sta diskblock+1
@ -211,109 +196,101 @@ hdboot
sta memblock+1
lda #$1
sta command
bne cmdproc
hdboot2
jsr cmdproc
bcs BootSlot6
bit BUTTON0 ; button 0 pressed?
goload
bit BUTTON0 ; button 0 pressed?
bmi BootSlot6
; Pre: X = Slot# << 4
; X=device
ldx #$70 ; Slot# << 4
jmp OS
;======================================
SmartPort2
lda ($45),y ; diskblock_h
sta $47
pla
sta $46
pla
sta $45
sec
; fall through...
;======================================
; Pre:
; C=0 => via Bootstrap
; C=1 => via Entrypoint / SmartPort2
; Post:
; X = Slot# << 4
GetSlotInX
php
sei ; disable ints, in case an int handler races our $0000/RTS and stack accesses!
; NB. need RAM that's guaranteed to be both read & writeable:
; . can't use $0200-$BFFF, due to eg. RAMRD=0/RAMWRT=1 combination
; . can't use LC as ROM might be enabled.
; So use ZP (specifically $0000) as whatever the state of ALTZP, both read & write will be to the same physical memory location.
lda $00 ; save $00
ldx #$60 ; opcode RTS
stx $00
jsr $0000 ; RTS immediately (NB. can't use $FF58, since LC RAM may be switched in)
sta $00 ; restore $00
tsx
lda $0100,x ; $Cn
asl
asl
asl
asl
tax ; X=$n0
plp ; + restore int status
bcc Bootstrap2
; otherwise fall through for Entrypoint / SmartPort...
;--------------------------------------
; entry point for ProDOS' block driver
; simple really. Copy the command from $42..$47
; to our I/O ports then execute command
; Pre:
; C=0 => via Bootstrap (hdboot)
; C=1 => via GetSlotInX (eg. Entrypoint / SmartPort2)
; X = Slot# << 4
; Post:
; C = hd_status.b0
; A = result of hd_execute
; X = Slot# << 4
cmdproc
php
clc
lda $42
sta hd_command
lda $43
sta hd_unitnum
lda $44
sta hd_memblock
lda $45
sta hd_memblock+1
lda $46
sta hd_diskblock
lda $47
sta hd_diskblock+1
lda hd_execute
; check for error
pha
lda command
sta hd_command,x
lda unitnum
sta hd_unitnum,x
lda memblock
sta hd_memblock,x
lda memblock+1
sta hd_memblock+1,x
lda diskblock
sta hd_diskblock,x
lda diskblock+1
sta hd_diskblock+1,x
lda hd_execute,x ; A = result of hd_execute (NB. instantaneous 512 byte r/w!)
cmp #1
bne skipSread
jsr sread
skipSread
ror hd_error ; Post: C=0 or 1
pla
rts
- rol hd_status,x ; b7=busy doing DMA?
bcs -
plp ; restore C from start of cmdproc
bcs done
ror hd_status,x ; Post: C=0 or 1
lda #0
beq hdboot2
; if there's no error, then lets read the block into memory
; because Applewin is picky about memory management, here's what I did:
; on read, hd_nextbyte = buffer[0], therefore we'll read that byte 256 times (in which
; the emulated code increments the buffer by 1 on each read) to (memblock),y
; increment memblock+1 and read the second 256 bytes via hd_nextbyte.
;
; if I could figure out how to consistently get applewin to update it's memory regions all
; this code can be moved into the emulation code (although, this is how I'd build the hardware
; anyway...)
done
ror hd_status,x ; Post: C=0 or 1
sread
tya
pha
ldy #0
loop1
lda hd_nextbyte
sta (memblock),y
iny
bne loop1
inc memblock+1
ldy #0
loop2
lda hd_nextbyte
sta (memblock),y
iny
bne loop2
dec memblock+1 ; restore memblock+1 ($45) to original value (for Epyx's California Games)
pla
tay
rts
;======================================
; 33 unused bytes
SmartPort3
lda ($45),y ; memblock_h
pha
iny
lda ($45),y ; diskblock_l
pha
iny
lda ($45),y ; diskblock_h
sta $47
pla
sta $46
pla
sta $45
iny
bne cmdproc
;======================================
; 18 unused bytes
!zone data
@ -332,10 +309,7 @@ done
; datablock. This starts near the end of the firmware (at offset $FC)
;; data
@checkCsFC
*= $00FC ; org $00FC
!warn "CsFC padding = ", * - @checkCsFC
*= $c7fc ; org $c7fc
!word $7fff ; how many blocks are on the device.
!byte $D7 ; specifics about the device (number of drives, read/write/format capability, etc)
!byte <Entrypoint_ProDOS ; entry point offset for ProDOS (must be $0a)

View file

@ -43,15 +43,11 @@
Insert an Apple 16K Language Card into slot 0 in the original Apple II and use the F8 auto-start ROM.<br>
NB. The Apple II+ already defaults to having a Language Card, so this switch is not required.<br><br>
-s1 empty<br>
Remove the parallel printer card from slot 1.<br><br>
-s1 parallel<br>
Insert a parallel printer card into slot 1.<br><br>
Remove the printer card from slot 1.<br><br>
-s2 empty<br>
Remove the SSC card from slot 2.<br><br>
-s3 empty<br>
Remove the Uthernet card from slot 3.<br><br>
-s3 vidhd<br>
Insert a VidHD card into slot 3.<br><br>
-s5 diskii<br>
Insert a 2nd Disk II controller card into slot 5.<br><br>
-s6 empty<br>
@ -61,8 +57,6 @@
Useful to allow a floppy disk to boot from slot 6, drive 1. Use in combination with -d1.<br><br>
-s7-empty-on-exit<br>
Remove the hard disk controller card from slot 7 on AppleWin exit.<br><br>
-d1-disconnected, -d2-disconnected<br>
Disconnect drive-1 and/or drive-2 from the Disk II controller card in slot 6.<br><br>
-no-nsc<br>
Remove the No-Slot clock (NSC).<br><br>
-r &lt;number of pages&gt;<br>
@ -75,13 +69,13 @@
-no-full-screen<br>
Start in Windowed mode (default).<br><br>
-fs-height=&lt;best|nnnn&gt;<br>
Use to select a better resolution for full-screen mode.<br>
Use to select a better resolution for full-screen or Windowed mode.<br>
<ul>
<li>best: picks the highest resolution where the height is an integer multiple of (192*2)</li>
<li>nnnn: select a specific resolution with height=nnnn pixels</li>
</ul>
NB. Combine with <em>-no-full-screen</em> to start in Windowed mode. Without this it'll just default to full-screen.<br>
NB. When switching to Windowed mode the default desktop resolution will be restored, and when switching back to full-screen mode this better resolution will again be used.<br><br>
NB. This changes the display resolution (and restores on exit).<br>
NB. Specify -no-full-screen after this switch for Windowed mode. Without this it'll just default to full-screen.<br><br>
-rom &lt;file&gt;<br>
Use custom 12K ROM (at $D000) for Apple II machine, or 16K ROM (at $C000) for Apple //e machine.<br><br>
-f8rom &lt;file&gt;<br>
@ -115,8 +109,7 @@
Use Right Alt (AltGr) & Right Control for Open Apple & Solid Apple keys respectively.<br>
Caveat: Right Control + F2 will do the //e self test (as Right Control is now both Ctrl and Solid Apple!). A workaround is just to use the Left Control key.<br><br>
-swap-buttons<br>
Swap buttons 0 and 1 for all input devices.<br>
EG. the Windows keys used for Open Apple & Solid Apple keys, and the current device being used to emulate a joystick (keyboard, real joystick or mouse)<br><br>
Swap the Windows keys used for Open Apple & Solid Apple keys.<br><br>
-use-real-printer<br>
Enables Advanced configuration control to allow dumping to a real printer<br><br>
@ -175,9 +168,7 @@
Support 60Hz(NTSC) video refresh rate and NTSC 1.020MHz base CPU clock (default).<br><br>
-power-on<br>
Force a power-on.<br>
Use to auto power-on when not using -d1, -h1 or -load-state.<br><br>
-snes-max-alt-joy1 or -snes-max-alt-joy2<br>
Use alternate button mappings for the SNES MAX card. See <a href="cfg-input.html">Input Settings</a>.<br>
Use to auto power-on when not using -d1, -h1 or -load-state.<br>
<br>
<P style="FONT-WEIGHT: bold">Debug arguments:
@ -187,9 +178,7 @@
-m<br>
Disable DirectSound support.<br><br>
-no-printscreen-dlg<br>
Suppress the warning message-box if AppleWin fails to capture the PrintScreen key.<br>
NB. There's now a "Don't show this message again" option on this message-box.
<br><br>
Suppress the warning message-box if AppleWin fails to capture the PrintScreen key.<br><br>
-screenshot-and-exit<br>
For testing. Use in combination with -load-state.<br><br>
</body>

View file

@ -58,26 +58,5 @@
<li>Renegade: switches to 160x192 mode at the title screen and then B&W (at the title screen) after game play.</li>
<li>Apple's AppleColor card or Video7's RGB-SL7 card: corruption for titles/demos that accidentally switch to foreground/background hi-res mode, eg. French Touch DIGIDREAM demo.</li>
</ul>
Can't switch to 2x windowed mode:
<ul>
<li>If the resolution isn't high enough to support 2x windowed mode, then AppleWin will refuse to switch.</li>
<li>For different versions of Windows this is slightly different:</li>
<ul>
<li>Windows 7 requires: 1181 x 808</li>
<li>Windows 10 (1909) requires: 1181 x 818</li>
</ul>
</ul>
Can't set bookmark 0 in the debugger / CTRL+SHIFT+0 not working:
<img style="FLOAT: right;" src="img/Change Key Sequence.png" alt="Configuration settings" hspace="5" vspace="5">
<ul>
<li>From Control Panel...".</li>
<ul>
<li>Windows 7: Change keyboards or other input methods -> 'Keyboards and Languages' tab -> Change Keyboards -> 'Advanced Key Settings' -> Change Key Sequence...</li>
<li>Windows 10: Typing -> Advanced Keyboard Settings -> Input language hot keys -> Change Key Sequence...</li>
</ul>
<li>Finally set "Switch Keyboard Layout" to "Not Assigned".</li>
</ul>
</body>
</html>

View file

@ -21,10 +21,9 @@
<p style="MARGIN-LEFT: 40px">Bob Sander-Cederlof: Applesoft Symbols (<a href="http://www.txbobsc.com/scsc/scdocumentor/index.html">http://www.txbobsc.com/scsc/scdocumentor/</a> S-C DocuMentor: Applesoft)</p>
<p style="MARGIN-LEFT: 40px">David Schmidt: Updates to this help file</p>
<p style="MARGIN-LEFT: 40px">Mike Harvey, Founder &amp; Editor of Nibble Magazine: For providing us Apple fans the pleasure of eagerly awaiting each next month's issue to learn about the Apple! (<a href="http://www.nibblemagazine.com/">http://www.nibblemagazine.com/</a>)</p>
<p style="MARGIN-LEFT: 40px">Andrea Odetti: working on making the source code more portable & Uthernet II card support</p>
<p style="MARGIN-LEFT: 40px">Andrea Odetti: numerous pull-requests</p>
<p style="MARGIN-LEFT: 40px">Iván Izaguirre: Taiwanese Copam Base64A Apple II clone</p>
<p style="MARGIN-LEFT: 40px">Arnaud C: debugger suggestions and help with 6502/6522/video timing issues</p>
<p style="MARGIN-LEFT: 40px">Cyril Lambin: RGB card/monitor rendering, debugger improvements</p>
<p style="MARGIN-LEFT: 40px">Alex Lukacz: 4Play & SNES MAX card support</p>
</body>
</html>

View file

@ -3,7 +3,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Advanced Settings</title></head>
<body style="background-color: rgb(255, 255, 255); font-family: verdana;" alink="#008000" link="#008000" vlink="#008000">
<h2 style="color: rgb(0, 128, 0);">Advanced Settings</h2>
<hr size="4"><img style="width: 354px; height: 460px; float: right;" src="img/advanced.png" alt="Advanced settings" hspace="5" vspace="5">
<hr size="4"><img style="width: 344px; height: 460px; float: right;" src="img/advanced.png" alt="Advanced settings" hspace="5" vspace="5">
<p><strong>Save State File Name:</strong><br>
This is the file name to use for save-state files. The default
directory is the same as where your AppleWin.exe program is stored.</p>
@ -25,11 +25,6 @@ page, then this drop-down menu can be used to specify the clone type.<br>
NB. Pravets 82, 8M and 8A are Bulgarian Apple II clones;
TK3000 is a Brazilian //e clone;
Base 64A is a Taiwanese Apple II clone.<br>
<ul>
<li>Pravets 8A: Use F10 for the Pravets Caps Lock (and the PC's Caps Lock key controls Cyrillic/Latin lock).
<li>TK3000: Use Scroll Lock for the 'mode' key. Use to switch between standard Apple II and accented characters.
<li>Base 64A: Use Delete for the 'F2' key (eg. press F2, release F2 then press a key to auto-type a BASIC keyword).
</ul>
</p>
<p><strong>Printer settings </strong>(Printer is emulated in slot 1)
</p>

View file

@ -8,7 +8,7 @@
link="#008000" vlink="#008000">
<h2 style="COLOR: rgb(0,128,0)">Configuration Settings</h2>
<hr size="4">
<img style="FLOAT: right; WIDTH: 354px; HEIGHT: 497px" src="img/config.png" alt="Configuration settings"
<img style="FLOAT: right; WIDTH: 344px; HEIGHT: 460px" src="img/config.png" alt="Configuration settings"
hspace="5" vspace="5">
<strong>Model:</strong><br>
@ -64,13 +64,6 @@
When in full-screen mode, show floppy (activity and track) and harddisk status (activity); keyboard caps-lock status and if emulation is paused.<br>
<br>
<strong>VidHD in slot 3</strong><br>
Insert a VidHD card into slot 3 (which can co-exist with an 80-column card in the Apple //e's AUX slot).<br>
Allows all Apple II models to support the IIgs' Super Hi-Res (SHR) video modes and is supported by eg. <a href="https://archive.org/details/TotalReplay">Total Replay</a>.<br>
<br>
<hr>
<strong>Serial Port:</strong><br>
This option will remap the emulated Apple's serial port to your PC's serial port (or TCP port 1977).<br>
See <a href="card-ssc.html">Super Serial Card</a> for more details.<br>
@ -78,7 +71,7 @@
<strong>Ethernet Settings...:</strong><br>
This allows to choose which network interface card (NIC) you want to
use with the Uthernet or Uthernet II card.<br>
use with the Uthernet card.<br>
<br>
<strong>Emulation Speed Control:</strong><br>

View file

@ -6,38 +6,29 @@
</head>
<body style="background-color: rgb(255, 255, 255); font-family: verdana;" alink="#008000" link="#008000" vlink="#008000">
<h2 style="color: rgb(0, 128, 0);">Disk Settings</h2>
<hr size="4"><img style="width: 354px; height: 460px; float: right;" src="img/disk.png" alt="Disk settings" hspace="5" vspace="5">
<hr size="4"><img style="width: 344px; height: 460px; float: right;" src="img/disk.png" alt="Disk settings" hspace="5" vspace="5">
<h3>Floppy Controller Settings:</h3>
<p><strong>Enhanced disk access speed:</strong><br>
<p><strong>Disk Access Speed:</strong><br>
Here you can choose the speed at which the system can access
an emulated floppy disk drive.
By default, you would want "Enhanced Speed" so that data can
be accessed as fast as possible. However, it is also possible that
certain programs might depend on the "Authentic Speed" to function
properly. This is the speed at which the real hardware
would access data from your drives.
would&nbsp;access data from your drives.
</p>
<p><strong>Disk 1/2 drop-down menus (slot 6):</strong><br>
These menus allow you to select floppy disk images to 'insert' into the
<p><strong>Disk 1/2 drop-down menus:</strong><br>
These menus allow you to select floppy disk images (.dsk files) to
'insert' into the
emulated floppy drives 1 and 2. This can also be done during emulation by <a href="toolbar.html">using the toolbar</a> or using the F3/F4 keys. Diskettes can be swapped by pressing F5 during emulation. You can also eject images from this menu.
</p>
<p><strong>Enable Disk II controller in slot 5:</strong><br>
A floppy controller card can be plugged into slot 5 by checking this box.
</p>
<p><strong>Disk 1/2 drop-down menus (slot 5):</strong><br>
You can select floppy disk images to 'insert' into the
emulated floppy drives 1 and 2.
</p>
<br>
<h3>Hard disk Controller Settings:</h3>
<p><strong>Enable hard disk controller in slot 7:</strong><br>
A hard disk controller (or interface) card can be plugged into slot 7 by checking this box.
A hard disk controller (or interface) card can be plugged in to slot 7 by checking this box.
See <a href="ddi-harddisk.html">Hard disk Images</a> for more details.
</p>
@ -50,10 +41,8 @@ WARNING! If done during image access this could result in undefined behavior (eg
These menus allow you to select hard disk images (eg. .hdv files) to
connect to the emulated hard disk controller card. You can also unplug images from this menu.
</p>
<br>
<p><strong>CiderPress path:</strong><br>
<p><strong>Path to CiderPress:</strong><br>
Use this to specify where CiderPress is installed.<br>
The right mouse button context menu on either of the drive icons allows you to open CiderPress with the image in the drive.
</p>

View file

@ -13,7 +13,7 @@
<h2 style="color: rgb(0, 128, 0);">Input Settings</h2>
<hr size="4"><img style="width: 354px; height: 497px; float: right;" src="img/input.png" alt="Input settings" hspace="5" vspace="5">
<hr size="4"><img style="width: 344px; height: 460px; float: right;" src="img/input.png" alt="Input settings" hspace="5" vspace="5">
<strong>Joystick Control:</strong><br>
These options allow you to configure up to two joysticks attached to
@ -33,29 +33,11 @@ then you should leave these values at 0.</li>
<li>When cursor keys are used for joystick emulation <strong>and</strong> are allowed to be read from the keyboard, then some games won't work correctly (eg. Lode Runner).</li>
<li>When cursor keys are blocked from being read from the keyboard, then simple command-line cursor editing in AppleSoft won't work.</li>
</ul>
<li>Swap 0/1: Swap buttons 0 and 1 for all input devices.</li>
<li>Swap 0/1: Swap buttons 0 and 1.</li>
<li>Auto-fire (all 3 buttons): For each button pressed, the button's state will be toggled when read.</li>
<li>Keyboard auto-centering: When keys used for joystick emulation are released then the joystick will return to the central position.</li>
</ul>
<strong>4Play Joystick card:</strong><br>
On real hardware this card allows up to 4 Atari 9-pin joysticks to be connected.<br>
Under emulation, the first 2 Windows-detected controllers will be used, and then for joysticks 3 and 4, use keys: ESDF+ZX and IJKL+NM. Note these keys will also be readable from the keyboard.<br>
<li>The card can be configured in slots 3, 4 or 5.
<li>Since it only uses the slot's DEVICE SELECT space ($C0Bx for slot 3) then it can co-exist with an 80-column card in the Apple //e's AUX slot. NB. For a real PAL Apple //e, then a slot riser card is required for it to fit.<br>
See Lukazi's <a href="https://lukazi.blogspot.com/2016/04/apple-ii-4play-joystick-card.html">4Play card</a> and <a href="https://lukazi.blogspot.com/2017/08/apple-ii-4play-joystick-card-software.html">4Play card software</a> blogs for more information.<br>
<br>
<strong>SNES MAX card:</strong><br>
On real hardware this card allows up to 2 SNES controllers to be connected and all 12 buttons can be read.<br>
Under emulation, the first 2 Windows-detected controllers will be used, ideally with 12 (or more) buttons eg. Logitech F310, PlayStation Dualshock 4, DualSense. Note that for some controllers (eg. 8BitDo NES30 Pro) the buttons need remapping, so use the command line switches -snes-max-alt-joy1 or -snes-max-alt-joy2 to remap.<br>
<li>The card can be configured in slots 3, 4 or 5.
<li>Since it only uses the slot's DEVICE SELECT space ($C0Bx for slot 3) then it can co-exist with an 80-column card in the Apple //e's AUX slot. NB. This card is small, so no slot riser card is required.<br>
See Lukazi's <a href="https://lukazi.blogspot.com/2021/06/game-controller-snes-max-snes.html">SNES MAX</a> blog for more information.<br>
<br>
<br>
<hr>
<strong>Scroll Lock acts as toggle for full-speed CPU:</strong><br>
<ul>
@ -68,13 +50,13 @@ See Lukazi's <a href="https://lukazi.blogspot.com/2021/06/game-controller-snes-m
<ul>
<li>Disables joystick emulation with mouse.</li>
<li>Disables Mockingboard/Phasor in slot 4.</li>
<li>Show cross-hairs in window's frame:</li>
<li>Show crosshairs in window's frame:</li>
<ul>
<li>Configure whether you want cross-hairs or not</li>
<li>Configure whether you want crosshairs or not</li>
</ul>
<li>Restrict mouse to Apple window:</li>
<ul>
<li>Restricting is useful for paint applications</li>
<li>Resticting is useful for paint applications</li>
<li>When unrestricted, the emulated mouse is fully integrated with the Window desktop:
moving in and out of the AppleWin window will switch between Windows' and the Apple's mouse cursor.</li>
<li>NB. Even when unrestricted, you won't be able to move the mouse outside the Apple window for GEOS. This is not a bug.</li>

View file

@ -13,7 +13,7 @@
<h2 style="color: rgb(0, 128, 0);">Sound Settings</h2>
<hr size="4"><img style="width: 354px; height: 460px; float: right;" src="img/sound.png" alt="Sound settings" hspace="5" vspace="5"><strong>Sound:</strong><br>
<hr size="4"><img style="width: 344px; height: 460px; float: right;" src="img/sound.png" alt="Sound settings" hspace="5" vspace="5"><strong>Sound:</strong><br>
This option allows you to choose how sound is output for the
system.&nbsp;Your choices are:<br>

View file

@ -11,18 +11,16 @@
<hr size="4">
<h3>Clock:</h3>
<p>AppleWin emulates a No-Slot clock (aka NSC).</p>
<p>This is a chip (a Dallas SmartWatch DS1216) that sits under one of the 28-pin (or 24-pin) ROM chips in the Apple II.<br>
No hardware configuration is required: this chip is always present (unless -no-nsc is used), but won't interfere with system operation when not in use.
<p>This is a chip (a Dallas SmartWatch DS1216) that sits under one of the 28-pin ROM chips in the Apple II.<br>
No hardware configuration is required: this chip is always present (unless -no-nsc is used), but won't interfere with emulation when not in use.
</p>
<p>It requires a software driver to be installed (for DOS and ProDOS). This driver then emulates the Thunderclock card.</p>
<br>
<p>For the <strong>Apple //e</strong>, here's a summary of NSC/ROM chip locations and which drivers work:</p>
<p>Here's a summary of NSC/ROM chip locations and which drivers work:</p>
<ul>
<li>"CD" ROM socket: $C000-DFFF (internal) ROM space - all drivers work</li>
<li>"EF" ROM socket: $E000-FFFF ROM space - never seen any drivers use this space</li>
<li>"CF" ROM socket: $C000-FFFF (internal) ROM space - all drivers work</li>
<li>Slot ROM socket: $Cs00-CsFF (slot) ROM space - NS.CLOCK.SYSTEM works</li>
<li>"CD" ROM socket: C000-DFFF (internal) ROM space - all drivers work</li>
<li>"EF" ROM socket: E000-FFFF ROM space - never seen any drivers use this space</li>
<li>"CF" ROM socket: C000-FFFF (internal) ROM space - all drivers work</li>
<li>Slot ROM socket: Cs00-CsFF (slot) ROM space - NS.CLOCK.SYSTEM works</li>
</ul>
<p>Here are the drivers and ROM pages they check:</p>
@ -30,21 +28,8 @@
<li>ProDOS "SWU.SYSTEM" - internal C3</li>
<li>ProDOS "NS.CLOCK.SYSTEM" - internal C3 C8 / external C1-C7</li>
<li>GEOS "NoSlot Clock" - internal C8</li>
<li>ProDOS-8 v2.5.0 "NoSlotClk.IIe" - internal C3 (currently 65C02 only)</li>
</ul>
<br>
<p>For the <strong>Apple II/II+</strong>, here's a summary of NSC/ROM chip locations and driver information:</p>
<ul>
<li>"F8" ROM socket: $F800-FFFF (internal) ROM space - ProDOS-8 v2.5.0a8 (not currently working)</li>
</ul>
<p>Here are the drivers and ROM pages they check:</p>
<ul>
<li>ProDOS-8 v2.5.0 "NOSLOTCLK.II" - internal F8</li>
</ul>
<br>
<p><strong>NOTE: </strong>For ProDOS, the load order of drivers is important:</p>
<p>Some .SYSTEM drivers will <strong>not</strong> chain-load the next driver.<br>
NS.CLOCK.SYSTEM does, so ensure this is the first one ProDOS finds,

View file

@ -1,20 +1,35 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>AppleWin Configuration</title>
</head>
<body style="background-color: rgb(255, 255, 255); font-family: verdana;" alink="#008000" link="#008000" vlink="#008000">
<h2 style="color: rgb(0, 128, 0);">AppleWin Configuration</h2>
<hr size="4">
<p>Select one of the following topics: </p>
<ul>
<li><a href="cfg-config.html">Configuration Settings</a></li>
<li><a href="cfg-config.html">Configuration
Settings</a></li>
<li><a href="cfg-input.html">Input Settings</a></li>
<li><a href="cfg-sound.html">Sound Settings</a></li>
<li><a href="cfg-disk.html">Disk Settings</a></li>
<li><a href="cfg-advanced.html">Advanced Settings</a></li>
<li><a href="cfg-savestate.html">Save-State Settings</a></li>
<li><a href="cfg-disk.html">Disk/Drive Settings</a></li>
</ul>
</body>
</html>

View file

@ -17,7 +17,7 @@
<ul>
<li>Set a bookmark at the current disassembly cursor, use Ctrl-Shift-#, ie:
<ul>
<li>Ctrl-Shift-0 set bookmark 0 (by default Windows blocks this key sequence - see <a href="Troubleshooting.html">Troubleshooting</a> to resolve this)
<li>NB. Ctrl-Shift-0 can't be used, as it's not recognised by Windows
<li>Ctrl-Shift-1 set bookmark 1
<li>Ctrl-Shift-2 set bookmark 2
<li>...

View file

@ -51,9 +51,13 @@ BPX address[,len]<br>
BPX [op] symbol</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add Breakpoint trigger to stop executing when the PC is within the range of the Address, Symbol, or Expression. i.e. Range is: [addr,addr+len)<br>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add
Breakpoint trigger to stop executing when the PC is within the range of
the Address, Symbol, or Expression. i.e. Range is: [addr,addr+len)<br>
Default length is 1.<br>
Default comparison operator is equal =</span></i></p>
Default comparision operator is equal =</span></i></p>
</td>
</tr>
<tr bgcolor="#cccccc">
@ -61,40 +65,52 @@ Default comparison operator is equal
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BP</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Currently an Alias for BPX.<br>
(In a future version, will also support Loading and Saving of breakpoints.)</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Currently
an Alias for BPX.<br>
(In a future version, will also support Loading and Saving of
breakpoints.)</span></i></p>
</td>
</tr>
<tr bgcolor="#999999">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPM address[,len]</span></b></font></font></p>
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPM
address[,len]</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add Breakpoint trigger when memory is accessed by 6502.</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add
Breakpoint trigger when memory is accessed by 6502.</span></i></p>
</td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPMR address[,len]</span></b></font></font></p>
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPMR
address[,len]</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add Breakpoint trigger when memory is read by 6502.</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add
Breakpoint trigger when memory is read by 6502.</span></i></p>
</td>
</tr>
<tr bgcolor="#999999">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPMW address[,len]</span></b></font></font></p>
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPMW
address[,len]</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add Breakpoint trigger when memory is written by 6502.</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add
Breakpoint trigger when memory is written by 6502.</span></i></p>
</td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR reg [op] value</span></b></font></font></p>
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR
reg [op] value</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add Breakpoint trigger when Registers reg value is compared to the Value.</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Add
Breakpoint trigger when Registers reg
value is compared to the Value.</span></i></p>
</td>
</tr>
<tr bgcolor="#999999">
@ -102,7 +118,8 @@ Default comparison operator is equal
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPD</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Disable Breakpoint (grayed out).</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Disable
Breakpoint (grayed out).</span></i></p>
</td>
</tr>
<tr bgcolor="#cccccc">
@ -110,16 +127,21 @@ Default comparison operator is equal
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPE</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Enable Breakpoint (colored red).</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Enable
Breakpoint (colored red).</span></i></p>
</td>
</tr>
<tr bgcolor="#999999">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPC #</span></b></font></font></p>
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPC
#</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Clear specified Breakpoint.<br>
Note: The asterisk * may be used to clear all breakpoints.</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Clear
specified Breakpoint.<br>
Note: The asterisk * may be used to clear all
breakpoints.</span></i></p>
</td>
</tr>
<tr bgcolor="#cccccc">
@ -127,7 +149,8 @@ Note: The asterisk
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPL</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">List Breakpoints.</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">List
Breakpoints.</span></i></p>
</td>
</tr>
<tr bgcolor="#999999">
@ -135,7 +158,8 @@ Note: The asterisk
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPIO</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">(In a future version, will add Breakpoint trigger on memory read or write.)</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">(In
a future version, will add Breakpoint trigger on memory read or write.)</span></i></p>
</td>
</tr>
<tr bgcolor="#cccccc">
@ -143,31 +167,9 @@ Note: The asterisk
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPP</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">(In a future version, will add Breakpoint trigger on specific flag cleared or set.)</span></i></p>
</td>
</tr>
<tr bgcolor="#999999">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRK [0|1|2|3|all] [on|off]</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Break on BRK or Invalid 1-3 byte opcodes</span></i></p>
</td>
</tr>
<tr bgcolor="#cccccc">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRKOP [opcode]</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Break on Opcode</span></i></p>
</td>
</tr>
<tr bgcolor="#999999">
<td width="25%">
<p><font color="#000000"><font face="Courier"><b><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRKINT [on|off]</span></b></font></font></p>
</td>
<td width="75%">
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">Break on Interrupt</span></i></p>
<p><i><span style="BACKGROUND: 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">(In
a future version, will add Breakpoint trigger on specific flag cleared
or set.)</span></i></p>
</td>
</tr>
</tbody>
@ -377,66 +379,29 @@ Note: The asterisk
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR A 0</span></b></font></font></p>
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR
A 0</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Add Breakpoint when Accumulator is zero.</i></font></p>
<p><font color="#ffffff"><i>Adds Breakpoint when Accumulator is zero.</i></font></p>
</td>
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR A ! 0</span></b></font></font></p>
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR
A ! 0</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Add Breakpoint when Accumulator is <b>not</b> zero.</i></font></p>
<p><font color="#ffffff"><i>Adds Breakpoint when Accumulator is <b>not</b> zero.</i></font></p>
</td>
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR S &lt; 1FF</span></b></font></font></p>
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BPR
S &lt; 1FF</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Add Breakpoint when Stack has had something pushed onto it.</i></font></p>
</td>
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRK ON</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Break execution when the opcode to be executed is $00 (ie. BRK).</i></font></p>
</td>
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRK ALL ON</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Break execution when the opcode to be executed is $00 (ie. BRK) or any Invalid opcode.</i></font></p>
</td>
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRK 0 OFF</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Disable breaking execution when the opcode to be executed is $00 (ie. BRK).</i></font></p>
</td>
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRKOP 6C</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Break execution when the opcode to be executed is $6C (ie. JMP (ABS)).</i></font></p>
</td>
</tr>
<tr bgcolor="#000000">
<td bgcolor="#000000" width="25%">
<p><font color="#00b8ff"><font face="Courier"><b><span style="BACKGROUND: rgb(0,0,0) 0% 50%; moz-background-clip: initial; moz-background-origin: initial; moz-background-inline-policy: initial">BRKINT ON</span></b></font></font></p>
</td>
<td bgcolor="#000000" width="75%">
<p><font color="#ffffff"><i>Break execution just after an interrupt occurs.</i></font></p>
<p><font color="#ffffff"><i>Adds Breakpoint when Stack has had something pushed onto it.</i></font></p>
</td>
</tr>
</tbody>

View file

@ -79,7 +79,7 @@ to the Data window to view memory. Most scrolling keys work.</span></i></p>
</tr>
</tbody>
</table>
<p>Key operations related to the debugger window:</p>
<p>You can cycle between windows, using these keys:</p>
<table border="1" cellpadding="2" cellspacing="0" width="75%">
<COLGROUP>
<col width="26">
@ -119,17 +119,6 @@ to the Data window to view memory. Most scrolling keys work.</span></i></p>
<p><i>Cycle to prev. Window</i></p>
</td>
</tr>
<tr>
<td width="10%">
<p>^PrtScr</p>
</td>
<td width="25%">
<p>Ctrl-PrintScreen</p>
</td>
<td width="65%">
<p><i>Copy debugger disassembly window (CODE or DATA) to the clipboard.</i></p><p><b>Note:</b> It does NOT copy the console window.</p>
</td>
</tr>
</tbody>
</table>
<p style="MARGIN-BOTTOM: 0in">

View file

@ -83,7 +83,7 @@ Apple II would not last six months.</p>
late and
suffered from poor backwards compatibility and a nearly 100%
hardware failure rate. Although Apple eventually addressed these
issues, they were not able to overcome the Apple III's bad
issues, they were not able overcome the Apple III's bad
reputation. Apple III sales remained poor, while sales of the
older Apple II continued to climb. </p>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View file

@ -25,19 +25,18 @@
<li>Apple //e's auxiliary card: 80 Column, Extended 80 Column or RamWorks III</li>
<li>Disk][ (even during r/w operation)</li>
<li>Hard disk (even during r/w operation)</li>
<li>Mockingboard & Phasor cards</li>
<li>SAM card</li>
<li>Mockingboard</li>
<li>Phasor</li>
<li>Mouse card</li>
<li>CP/M SoftCard</li>
<li>Parallel Printer card</li>
<li>Super Serial card</li>
<li>No-Slot clock</li>
<li>Uthernet & Uthernet II cards</li>
<li>4Play & SNES MAX joystick cards</li>
<li>VidHD card</li>
</ul>
The following are not yet persisted to the file:
<ul>
<li>Uthernet card</li>
<li>SAM card</li>
<li>Using The Freeze's F8 ROM</li>
<li>Alternate F8 ROM</li>
<li>Alternate ROM</li>

View file

@ -18,10 +18,10 @@
<h4>Mockingboard:</h4>
<p>When the Mockingboards are enabled, the cards are physically plugged into slots
4 and 5 of the Apple II.</p>
<p>Each Mockingboard is a type 'C': 2x AY-3-8913 (3-channel sound generator) &amp; 2x
<p>Each Mockingboard is a type 'C': 2x AY8910 (3-channel sound generator) &amp; 1x
SSI263 (speech chip)<font face="Tahoma"><br>
</font>Each AY-3-8913 is fully emulated (tone, noise &amp; envelope).<font face="Tahoma"><br>
</font>Each SY6522 (that controls an AY-3-8913) can generate precise timer
</font>Each AY8910 is fully emulated (tone, noise &amp; envelope).<font face="Tahoma"><br>
</font>Each SY6522 (that controls an AY8910) can generate precise timer
interrupts or phoneme-complete interrupts.<font face="Tahoma"><br>
</font>Emulation of the SSI263 is basic at the moment and only plays back
phonemes at a fixed rate without any support for inflection or filters.<font face="Tahoma"><br>
@ -29,16 +29,13 @@
remapping Votrax phonemes to the SSI263's.</p>
<H4>Phasor:</H4>
<P>When Phasor is enabled, the card is physically plugged into slot 4 of the Apple II.</P>
<P>Phasor is equivalent to 2 Mockingboards: so has 4x AY-3-8913 &amp; 2x SSI263.</P>
<P>Phasor is equivalent to 2 Mockingboards: so has 4x AY8910 &amp; 1x SSI263.</P>
<br>
<P>There are a number of games and demos that support Mockingboard (or Phasor), eg:</P>
<ul>
<li>Adventure Construction Set</li>
<li>Ape Escape (Votrax speech)</li>
<li>Apple Cider Spider</li>
<li>Bejeweled (SSI263 speech)</li>
<li>Berzap! (with Votrax or SSI263 speech)</li>
<li>Bouncing Kamungas (Votrax speech)</li>
<li>Bejeweled (with SSI263 speech)</li>
<li>Berzap! (with SSI263 speech)</li>
<li>Broadsides</li>
<li>Crimewave (Votrax speech)</li>
<li>Crypt of Medea (Votrax speech)</li>
@ -46,7 +43,6 @@
<li>French Touch demos, eg. (NOT SO) Cheap Tunes, Plasmagoria, Raster Bars + many others</li>
<li>Lady Tut (Mockingboard version)</li>
<li>Mockingboard software (Sweet Micro Systems)</li>
<li>Mockingboard Classic Adventure (Sweet Micro Systems) (SSI263 speech only)</li>
<li>Music Construction Set</li>
<li>Night Flight</li>
<li>One on one (Mockingboard version)</li>
@ -55,14 +51,12 @@
<li>Rescue Raiders v1.3 (SSI263 speech only)</li>
<li>Silent Service</li>
<li>Skyfox</li>
<li>The Spy Strikes Back (Votrax speech)</li>
<li>Thunder Bombs (Votrax speech)</li>
<li>Spy Strikes Back (Votrax speech)</li>
<li>Ultima III (Mockingboard version)</li>
<li>Ultima IV</li>
<li>Ultima V</li>
<li>Willy Byte in the Digital Dimension</li>
<li>Zaxxon (Mockingboard version)</li>
<li>Zoo Master (Votrax speech)</li>
</ul>
<br>
<h3>SAM:</h3>

View file

@ -11,8 +11,9 @@
<br>
Copyright © 1994-1996, Michael O'Brien<br>
Copyright © 2001, Oliver Schmidt<br>
Copyright © 2002-2005, Tom Charlesworth<br>
Copyright © 2006-2022, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis<br>
Copyright © 2002-2005, Tom Charlesworth<BR>
Copyright © 2006-2020, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis
<br>
<br>
<a href="applewin-team.html">AppleWin team</a>
<br>
@ -31,7 +32,7 @@
<li><a href="sound.html">Sound</a>
<li><a href="clock.html">Clock</a>
<li><a href="card-ssc.html">Super Serial card</a>
<li><a href="uthernet.html">Uthernet network cards</a>
<li><a href="uthernet.html">Uthernet network card</a>
<li><a href="configuration.html">AppleWin Configuration</a>
<li><a href="dbg-toc-intro.html">Using the Debugger</a>
<li><a href="resources.html">Resources</a></li>

View file

@ -1,2 +0,0 @@
"C:\Program Files (x86)\HTML Help Workshop\hhc" AppleWin.hhp
start AppleWin.chm

View file

@ -1,23 +1,22 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Uthernet network cards</title>
<title>Uthernet network card</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>
<body style="FONT-FAMILY: verdana; BACKGROUND-COLOR: rgb(255,255,255)" alink="#008000"
link="#008000" vlink="#008000">
<h2 style="COLOR: rgb(0,128,0)">Uthernet network cards</h2>
<h2 style="COLOR: rgb(0,128,0)">Uthernet network card</h2>
<hr size="4">
<p style="FONT-WEIGHT: bold">Overview:
</p>
<P>The Uthernet network cards coupled with the Contiki OS allow you to browse the
<P>The Uthernet network card coupled with the Contiki OS allows you to browse the
internet on your Apple.</P>
<P style="FONT-WEIGHT: bold">Acknowledgment:
</P>
<P>Uthernet (TFE) support in AppleWin was made possible by implementing the GPL
<P>Uthernet (TFE) support in Applewin was made possible by implementing the GPL
source written by Spiro Trikaliotis for the Vice emulator - <A href="http://vice-emu.sourceforge.net/index.html#developers">
http://vice-emu.sourceforge.net/index.html#developers</A></P>
<P><A href="https://a2retrosystems.com/">Uthernet II</A> support in AppleWin has been contributed by Andrea (audetto) Odetti.</P>
<P style="FONT-WEIGHT: bold">Details:
</P>
<P>To enable ethernet support in AppleWin you must first download and install
@ -36,19 +35,22 @@
<P>After AppleWin starts, select the settings icon and then select the ethernet
settings button.
</P>
<P>Uthernet will be disabled. Select Uthernet or Uthernet II from the list of available ethernet
emulations.
<P>Uthernet will be disabled. Select Uthernet from the list of available ethernet
emulations (currently the only one).
</P>
<P>Select the ethernet interface you want to work with. This must be a physical
ethernet interface.
</P>
<P>If you have more than one interface you may need to select them in turn in order
to get the text description for each interface vs what Npcap likes to use for
a reference.
a reference. Select Ok. and then close AppleWin.
</P>
<P><span style="font-weight: bold;">Note:</span> Wireless does not work
with WinPcap (but see <A href="uthernet-wifi-workaround.html">WiFi Workaround</A>).
</P>
<P><span style="font-weight: bold;">Note:</span> Due to a current limitation you must exit AppleWin and
re-run AppleWin for an ethernet interface change to take effect.
</P>
<P>In order to test the ethernet emulation out you should grab a copy of Contiki
for the Apple II here - <A href="http://www.a2retrosystems.com/downloads.htm">http://www.a2retrosystems.com/downloads.htm</A>
</P>
@ -57,7 +59,7 @@
also grab a copy of the Uthernet/Contiki getting started guide <A href="http://www.a2retrosystems.com/a2UtherManual.pdf">
http://www.a2retrosystems.com/a2UtherManual.pdf</A>
</P>
<P>Select the contiki80pri.dsk image. Boot AppleWin.
<P>When you run AppleWin again, select the contiki80pri.dsk image. Boot AppleWin.
</P>
<P>Once Contiki is loaded then press Enter to clear the welcome screen and press
ESC for a menu.
@ -88,14 +90,5 @@
if you are still having difficulty then you should refer to the VICE network
support page for additional information - <A href="http://vicekb.trikaliotis.net/13-005.shtml">
http://vicekb.trikaliotis.net/13-005.shtml</A></P>
<P style="FONT-WEIGHT: bold">Uthernet II:
</P>
<P>Most features of the Uthernet II are emulated, with the following caveats:
<ul>
<li>PPPoE, interrupts and SPI are not implemented</li>
<li>server side is not well tested</li>
<li>after loading a save-state file, TCP and UDP sockets are closed</li>
</ul>
</P>
</body>
</body>
</html>

105
linux.md
View file

@ -1,5 +1,20 @@
# Linux
* [Structure](#structure)
* [What works](#what-works)
* [Executables](#executables)
* [applen](#applen)
* [qapple](#qapple)
* [sa2](#sa2)
* [libretro](#ra2)
* [Build](#build)
* [Checkout](#checkout)
* [Fedora](#fedora)
* [Raspbian](#raspbian)
* [Speed](#build)
* [Fedora](#fedora-1)
* [Raspbian](#raspbian-1)
## Structure
There are 4 projects
@ -10,42 +25,35 @@ There are 4 projects
* sa2: SDL2 frontend
* libra2: a libretro core
The libapple interface is a *link time* interface: some functions are not defined and must be provided in order to properly link
the application. These functions are listed in [interface.h](source/linux/interface.h).
The main goal is to reuse the AppleWin source files without changes: only where really necessary the AppleWin source files have
been modified.
been modified, mostly for
* header files issues
* const char *
* exclude some Windows heavy blocks (source/MouseInterface.cpp)
## What works
Almost everything works, except the serial port, SNES-MAX and FourPlay.
Some key files have been completely reimplemented or discarded:
The UI has been rewritten in Qt or ImGui.
* AppleWin.cpp
* WinFrame.cpp
* WinVideo.cpp
The rest works very well.
Uthernet I is supported via `libpcap`, but it requires elevated capabilities:
Some features totally ignored:
`sudo setcap cap_net_raw=ep ./sa2`
* ethernet
* serial port
* debugger
* speech (currently it hangs the emulator)
Unfortunately, this must be reapplied after every build.
Most of the debugger now works (in the ImGui version).
## New features
Uthernet II is supported too and by default uses `libslirp` which does *not* require elevated capabilities. Use the ImGui settings to enable it.
`libslirp` is not packaged on Raspberry Pi OS. `libpcap` will be used instead, unless the user manually compiles and installs [libslirp](https://gitlab.freedesktop.org/slirp/libslirp).
Audio files can be read via the cassette interface (SDL Version). Just drop a `wav` file into the emulator. Tested with all the formats from [asciiexpress](https://asciiexpress.net/).
The rest is in a very usable state.
## Executables
### sa2
This is your best choice, in particular the ImGui version.
TL;DR: just run ``sa2``
See [sa2](source/frontends/sdl/README.md) for more details.
### applen
Frontend based on ncurses, with a ASCII art graphic mode.
@ -58,26 +66,31 @@ Keyboard shortcuts
* ``ALT-RIGHT``: wider hi res graphis
* ``ALT-LEFT``: narrower hi res graphics
* ``ALT-UP``: vertical hi res (smaller)
* ``ALT-DOWN``: vertical hi res (bigger)
* ``ALT-DOWN``: vertical hires (bigger)
In order to properly appreciate the wider hi res graphics, open a big terminal window and choose a small font size.
Try ``CTRL-`` as well if ``ALT-`` does not work: terminals do not report a consistent keycode for these combinations.
The joystick uses evdev (``--device-name /dev/input/by-id/id_of_device``).
The joystick uses evdev (currently the device name is hardcoded).
### qapple
This is based on Qt.
This is based on Qt, currently tested with 5.10
* keyboard shortcuts are listed in the menu entries
* graphics: runs the native NTSC code
* joystick: it uses QtGamepad
* emulator runs in the main UI thread
* Qt timers are very coarse: the emulator needs to dynamically adapt the cycles to execute
* the app runs at 60FPS with correction for uneven timer deltas.
* full speed when disk spins execute up to 5 ms real wall clock of emulator code (then returns to Qt)
* audio is supported and there are a few configuration options to tune the latency (default very conservative 200ms)
* (standard) audio is supported and there are a few configuration options to tune the latency (default very conservative 200ms)
* plain mockingboard is supported as well (not speech, which hangs the emulator)
* Open Apple and Solid Apple can be emulated using AltGr and Menu (unfortunately, Alt does not work well)
* ``yaml`` files can be dropped to restore a saved state
### sa2
See [sa2](source/frontends/sa2/README.md).
### ra2
@ -97,8 +110,11 @@ Video works, but the vertical flip is done in software.
Audio (speaker) works.
Must be manually configured:
``cmake -DLIBRETRO_PATH=/path/to/libretro-common``
Easiest way to run from the ``build`` folder:
``retroarch -L source/frontends/libretro/applewin_libretro.so ../bin/MASTER.DSK``
``retroarch -L source/frontends/libretro/libra2.so ../Disks/NoSlotClockTest.dsk``
## Build
@ -113,38 +129,21 @@ git clone https://github.com/audetto/AppleWin.git --recursive
cd AppleWin
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE ..
cmake ..
make
```
### Frontend selection
There are 4 `cmake` variables to selectively enable frontends: `BUILD_APPLEN`, `BUILD_QAPPLE`, `BUILD_SA2` and `BUILD_LIBRETRO`.
Usage:
```
cmake -DBUILD_SA2=ON -DBUILD_LIBRETRO=ON ..
```
or use `cmake-gui` (if none is selected, they are all built).
Use `cmake -DCMAKE_BUILD_TYPE=RELEASE` to get a *release* build.
### Fedora
On Fedora 35, from a fresh installation, install all packages from [fedora.list.txt](source/linux/fedora.list.txt).
On Fedora 31, from a fresh installation, install all packages from [fedora.list.txt](source/linux/fedora.list.txt).
### Raspberry Pi OS, Ubuntu and other Debian distributions
### Raspbian
Install all packages from [raspbian.list.txt](source/linux/raspbian.list.txt).
You can use `sudo apt-get -y install $(cat raspbian.list.txt)` for an automated installation.
On Raspbian 10, from a fresh installation, install all packages from [raspbian.list.txt](source/linux/raspbian.list.txt).
See [Travis](.travis.yml) CI too.
### Packaging
It is possible to create `.deb` and `.rpm` packages using `cpack`. Use `cpack -G DEB` or `cpack -G RPM` from the build folder. It is best to build packages for the running system.
## Speed
### Fedora

10
raspbian.txt Normal file
View file

@ -0,0 +1,10 @@
cmake
libncurses-dev
libevdev-dev
qtbase5-dev
libqt5gamepad5-dev
libminizip-dev
libyaml-dev
libboost-dev
libboost-program-options-dev

View file

@ -84,7 +84,7 @@ IDB_DEBUG_FONT_7X8 BITMAP "Debug_Font.bmp"
// Dialog
//
IDD_PROPPAGE_CONFIG DIALOGEX 0, 0, 210, 240
IDD_PROPPAGE_CONFIG DIALOGEX 0, 0, 210, 209
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CAPTION | WS_SYSMENU
CAPTION "Configuration"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
@ -92,37 +92,35 @@ BEGIN
LTEXT "&Model:",IDC_STATIC,5,7,40,8
COMBOBOX IDC_COMPUTER,45,5,91,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Confirm reboot",IDC_CHECK_CONFIRM_REBOOT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,8,62,10
GROUPBOX "Video",IDC_STATIC,5,22,200,74
GROUPBOX "Video",IDC_STATIC,5,22,200,56
LTEXT "Mo&de:",IDC_STATIC,12,33,33,8
COMBOBOX IDC_VIDEOTYPE,33,30,103,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Monochrome &Color...",IDC_MONOCOLOR,12,46,80,14
CONTROL "50% Scan lines",IDC_CHECK_HALF_SCAN_LINES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,33,62,10
CONTROL "Vertical blend",IDC_CHECK_VERTICAL_BLEND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,48,62,10
CONTROL "Full-Screen: Show drive/keyboard status",IDC_CHECK_FS_SHOW_SUBUNIT_STATUS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,64,140,10
CONTROL "VidHD in slot 3",IDC_CHECK_VIDHD_IN_SLOT3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,78,140,10
LTEXT "&Serial Port:",IDC_STATIC,5,108,40,8
COMBOBOX IDC_SERIALPORT,45,106,90,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Ethernet Settings...",IDC_ETHERNET,4,124,80,14
GROUPBOX "Emulation Speed Control",IDC_STATIC,5,149,200,85
CONTROL "Full-Screen: Show drive/keyboard status",IDC_CHECK_FS_SHOW_SUBUNIT_STATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,64,140,10
LTEXT "&Serial Port:",IDC_STATIC,5,89,40,8
COMBOBOX IDC_SERIALPORT,45,87,90,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Ethernet Settings...",IDC_ETHERNET,4,105,80,14
GROUPBOX "Emulation Speed Control",IDC_STATIC,5,130,200,85
CONTROL "Use &Authentic Machine Speed",IDC_AUTHENTIC_SPEED,
"Button",BS_AUTORADIOBUTTON,15,160,115,10
CONTROL "Select C&ustom Speed (in MHz)",IDC_CUSTOM_SPEED,"Button",BS_AUTORADIOBUTTON,15,172,115,10
CONTROL "Generic2",IDC_SLIDER_CPU_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,25,183,160,15
CTEXT "0.5",IDC_0_5_MHz,23,199,20,10
CTEXT "1.0",IDC_1_0_MHz,59,199,20,10
CTEXT "2.0",IDC_2_0_MHz,96,199,20,10
RTEXT "Fastest",IDC_MAX_MHz,150,199,29,10
PUSHBUTTON "&Benchmark Emulator",IDC_BENCHMARK,15,213,85,15
CONTROL "50Hz video",IDC_CHECK_50HZ_VIDEO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,160,51,10
"Button",BS_AUTORADIOBUTTON,15,141,115,10
CONTROL "Select C&ustom Speed (in MHz)",IDC_CUSTOM_SPEED,"Button",BS_AUTORADIOBUTTON,15,153,115,10
CONTROL "Generic2",IDC_SLIDER_CPU_SPEED,"msctls_trackbar32",TBS_AUTOTICKS | WS_TABSTOP,25,164,160,15
CTEXT "0.5",IDC_0_5_MHz,23,180,20,10
CTEXT "1.0",IDC_1_0_MHz,59,180,20,10
CTEXT "2.0",IDC_2_0_MHz,96,180,20,10
RTEXT "Fastest",IDC_MAX_MHz,150,180,29,10
PUSHBUTTON "&Benchmark Emulator",IDC_BENCHMARK,15,194,85,15
CONTROL "50Hz video",IDC_CHECK_50HZ_VIDEO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,141,51,10
END
IDD_PROPPAGE_INPUT DIALOGEX 0, 0, 210, 240
IDD_PROPPAGE_INPUT DIALOGEX 0, 0, 210, 215
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CAPTION | WS_SYSMENU
CAPTION "Input"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "Joystick Control",IDC_STATIC,5,7,200,135
GROUPBOX "Joystick Control",IDC_STATIC,5,7,200,101
LTEXT "Joystick &1:",IDC_STATIC,12,20,40,8
COMBOBOX IDC_JOYSTICK0,52,18,110,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Joystick &2:",IDC_STATIC,12,35,40,8
@ -138,21 +136,17 @@ BEGIN
CONTROL "Swap 0/1",IDC_SWAPBUTTONS0AND1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,75,41,10
CONTROL "Auto-fire (all 3 buttons)",IDC_AUTOFIRE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,90,89,10
CONTROL "Keyboard auto-centering",IDC_CENTERINGCONTROL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,102,90,96,10
LTEXT "4Play Joystick card:",IDC_STATIC,8,108,84,10
COMBOBOX IDC_FOURPLAY_CONFIG,93,106,55,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "SNES MAX card:",IDC_STATIC,8,123,82,10
COMBOBOX IDC_SNESMAX_CONFIG,93,122,55,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "&Scroll Lock acts as toggle for full-speed CPU",IDC_SCROLLLOCK_TOGGLE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,147,166,10
CONTROL "&Mouse interface in slot 4",IDC_MOUSE_IN_SLOT4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,161,106,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,113,166,10
CONTROL "&Mouse interface in slot 4",IDC_MOUSE_IN_SLOT4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,8,127,106,10
CONTROL "Show &crosshairs in window's frame",IDC_MOUSE_CROSSHAIR,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,175,159,10
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,141,159,10
CONTROL "&Restrict mouse to Apple window",IDC_MOUSE_RESTRICT_TO_WINDOW,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,189,121,10
LTEXT "Microsoft CP/M SoftCard:",IDC_STATIC,8,204,83,10
COMBOBOX IDC_CPM_CONFIG,93,202,55,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Paste &From Clipboard",IDC_PASTE_FROM_CLIPBOARD,8,219,81,14
LTEXT "(Shift+Insert during emulation)",IDC_STATIC,93,222,111,8
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,155,121,10
LTEXT "Microsoft CP/M SoftCard:",IDC_STATIC,8,170,122,10
COMBOBOX IDC_CPM_CONFIG,93,168,55,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Paste &From Clipboard",IDC_PASTE_FROM_CLIPBOARD,8,192,81,14
LTEXT "(Shift+Insert during emulation)",IDC_STATIC,93,195,111,8
END
IDD_PROPPAGE_SOUND DIALOGEX 0, 0, 210, 191
@ -174,36 +168,28 @@ BEGIN
CONTROL "No sound cards",IDC_SOUNDCARD_DISABLE,"Button",BS_AUTORADIOBUTTON,10,175,78,10
END
IDD_PROPPAGE_DISK DIALOGEX 0, 0, 210, 240
IDD_PROPPAGE_DISK DIALOGEX 0, 0, 211, 188
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_CAPTION | WS_SYSMENU
CAPTION "Disk"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
GROUPBOX "Floppy Disk Drives",IDC_STATIC,5,7,200,125
CONTROL "&Enhanced disk access speed (all drives)",IDC_ENHANCE_DISK_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,19,150,10
LTEXT "Disk 1:",IDC_STATIC,10,36,23,8
LTEXT "Disk 2:",IDC_STATIC,10,53,23,8
COMBOBOX IDC_COMBO_DISK1,40,35,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO_DISK2,40,52,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "Enable &Disk II controller in slot 5",IDC_DISKII_SLOT5_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,76,122,10
LTEXT "Disk 1:",IDC_STATIC,11,93,23,8
LTEXT "Disk 2:",IDC_STATIC,11,110,23,8
COMBOBOX IDC_COMBO_DISK1_SLOT5,40,92,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO_DISK2_SLOT5,40,108,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Hard Disk Drives",IDC_STATIC,5,133,200,64
CONTROL "Enable &hard disk controller in slot 7",IDC_HDD_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,146,122,10
PUSHBUTTON "Swap",IDC_HDD_SWAP,156,146,40,14
LTEXT "HDD 1:",IDC_STATIC,11,163,23,8
LTEXT "HDD 2:",IDC_STATIC,11,180,23,8
COMBOBOX IDC_COMBO_HDD1,46,162,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO_HDD2,46,178,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "&CiderPress path:",IDC_STATIC,7,205,60,8
EDITTEXT IDC_CIDERPRESS_FILENAME,62,203,95,12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&Browse...",IDC_CIDERPRESS_BROWSE,161,202,50,14
GROUPBOX "Floppy Disk Drives",IDC_STATIC,5,7,200,72
LTEXT "&Disk access speed:",IDC_STATIC,12,21,64,8
COMBOBOX IDC_DISKTYPE,80,18,100,100,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Disk 1:",IDC_STATIC,10,41,23,8
LTEXT "Disk 2:",IDC_STATIC,10,58,23,8
COMBOBOX IDC_COMBO_DISK1,40,40,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO_DISK2,40,57,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
GROUPBOX "Hard Disk Drives",IDC_STATIC,5,83,200,64
CONTROL "&Enable hard disk controller in slot 7",IDC_HDD_ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,96,122,10
PUSHBUTTON "Swap",IDC_HDD_SWAP,156,92,40,14
LTEXT "HDD 1:",IDC_STATIC,11,113,23,8
LTEXT "HDD 2:",IDC_STATIC,11,130,23,8
COMBOBOX IDC_COMBO_HDD1,46,112,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_COMBO_HDD2,46,128,150,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "&Path to CiderPress:",IDC_STATIC,7,155,74,8
EDITTEXT IDC_CIDERPRESS_FILENAME,7,165,143,12,ES_AUTOHSCROLL | ES_READONLY
PUSHBUTTON "&Browse...",IDC_CIDERPRESS_BROWSE,156,164,50,14
END
IDD_TFE_SETTINGS_DIALOG DIALOGEX 0, 0, 270, 100
@ -212,7 +198,7 @@ CAPTION "Ethernet Settings"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
LTEXT "Ethernet",IDC_TFE_SETTINGS_ENABLE_T,9,7,30,8
COMBOBOX IDC_TFE_SETTINGS_ENABLE,45,5,60,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
COMBOBOX IDC_TFE_SETTINGS_ENABLE,45,5,50,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "Interface",IDC_TFE_SETTINGS_INTERFACE_T,9,24,30,8
COMBOBOX IDC_TFE_SETTINGS_INTERFACE,45,22,210,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT "",IDC_TFE_SETTINGS_INTERFACE_NAME,9,44,250,8
@ -292,7 +278,7 @@ BEGIN
VALUE "FileDescription", "Apple //e Emulator for Windows"
VALUE "FileVersion", APPLEWIN_VERSION_STR
VALUE "InternalName", "APPLEWIN"
VALUE "LegalCopyright", " 1994-2021 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis"
VALUE "LegalCopyright", " 1994-2020 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis"
VALUE "OriginalFilename", "APPLEWIN.EXE"
VALUE "ProductName", "Apple //e Emulator"
VALUE "ProductVersion", APPLEWIN_VERSION_STR
@ -397,7 +383,7 @@ GUIDELINES DESIGNINFO
BEGIN
IDD_PROPPAGE_INPUT, DIALOG
BEGIN
BOTTOMMARGIN, 231
BOTTOMMARGIN, 182
END
IDD_PROPPAGE_DISK, DIALOG

10
resource/CMakeLists.txt Normal file
View file

@ -0,0 +1,10 @@
include(CMakeResources.cmake)
add_resources(rom_sources roms
Apple2e_Enhanced.rom
Apple2e.rom
)
add_library(apple2roms STATIC
${rom_sources}
)

View file

@ -0,0 +1,75 @@
function(add_resources out_var id)
set(result)
string(CONCAT content_h
"#include <map>\n"
"#include <string>\n"
"\n"
"namespace ${id}\n"
"{\n"
" extern const std::map<std::string, std::pair<const char *, const char *>> resources\;\n"
"}\n")
string(CONCAT content_cpp_top
"#include \"${id}_resources.h\"\n")
string(CONCAT content_cpp_private
"extern \"C\"\n"
"{\n"
"\n")
string(CONCAT content_cpp_public
"namespace ${id}\n"
"{\n"
"\n"
" const std::map<std::string, std::pair<const char *, const char *>> resources = {\n")
foreach(in_f ${ARGN})
set(out_f "${CMAKE_CURRENT_BINARY_DIR}/${in_f}.o")
add_custom_command(OUTPUT ${out_f}
COMMAND ld -r -b binary -o ${out_f} ${in_f}
DEPENDS ${in_f}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Adding resource: ${in_f} -> ${out_f}"
VERBATIM
)
string(REGEX REPLACE "[ ./]" "_" safe_in_f ${in_f})
set(symbol "_binary_${safe_in_f}")
string(APPEND content_cpp_private
" // ${in_f}\n"
" extern const char ${symbol}_start\;\n"
" extern const char ${symbol}_end\;\n"
"\n")
string(APPEND content_cpp_public
" {\"${in_f}\", {&${symbol}_start, &${symbol}_end}},\n")
list(APPEND result ${out_f})
endforeach()
string(APPEND content_cpp_private
"}\n")
string(APPEND content_cpp_public
" }\;\n"
"\n"
"}\n")
set(out_h "${CMAKE_CURRENT_BINARY_DIR}/${id}_resources.h")
file(WRITE ${out_h} ${content_h})
message("Generating header for '${id}': ${out_h}")
list(APPEND result ${out_h})
set(out_cpp "${CMAKE_CURRENT_BINARY_DIR}/${id}_resources.cpp")
file(WRITE ${out_cpp}
${content_cpp_top}
"\n"
${content_cpp_private}
"\n"
${content_cpp_public})
message("Generating cpp for '${id}': ${out_cpp}")
list(APPEND result ${out_cpp})
set(${out_var} "${result}" PARENT_SCOPE)
endfunction()

Binary file not shown.

View file

@ -14,7 +14,7 @@
#define IDC_CUSTOM_SPEED 110
#define IDC_SLIDER_CPU_SPEED 111
#define IDD_PROPPAGE_SOUND 112
#define IDC_ENHANCE_DISK_ENABLE 113
#define IDC_DISKTYPE 113
#define IDC_JOYSTICK1 115
#define IDD_PROPPAGE_DISK 116
#define IDC_BENCHMARK 117
@ -61,15 +61,23 @@
#define IDC_MB_VOLUME 1010
#define IDC_SAVESTATE_BROWSE 1011
#define IDC_MONOCOLOR 1012
#define IDC_DISKII_SLOT5_ENABLE 1020
#define IDC_HDD1 1013
#define IDC_HDD2 1014
#define IDC_DISK1 1015
#define IDC_DISK2 1016
#define IDC_EDIT_DISK1 1017
#define IDC_EDIT_DISK2 1018
#define IDC_PASTE_FROM_CLIPBOARD 1018
#define IDC_EDIT_HDD1 1019
#define IDC_EDIT_HDD2 1020
#define IDC_HDD_ENABLE 1021
#define IDC_HDD_SWAP 1022
#define IDC_PASTE_FROM_CLIPBOARD 1023
#define IDC_SPIN_XTRIM 1026
#define IDC_SPIN_YTRIM 1027
#define IDC_PHASOR_ENABLE 1029
#define IDC_SAM_ENABLE 1030
#define IDC_SOUNDCARD_DISABLE 1031
#define IDC_TFE_SETTINGS_ENABLE_T 1032
#define IDC_TFE_SETTINGS_ENABLE 1033
#define IDC_TFE_SETTINGS_INTERFACE_T 1034
@ -98,6 +106,7 @@
#define IDC_PRINTER_FILTER_UNPRINTABLE 1057
#define IDC_PRINTER_APPEND 1058
#define IDC_SPIN_PRINTER_IDLE 1059
#define IDC_CHECK_HALF_SCAN_LINES 1060
#define IDC_GPL_TEXT 1061
#define IDC_GPL_BORDER 1063
@ -114,11 +123,6 @@
#define IDC_CHECK_FS_SHOW_SUBUNIT_STATUS 1082
#define IDC_CHECK_VERTICAL_BLEND 1083
#define IDC_CHECK_50HZ_VIDEO 1084
#define IDC_COMBO_DISK1_SLOT5 1085
#define IDC_COMBO_DISK2_SLOT5 1086
#define IDC_FOURPLAY_CONFIG 1087
#define IDC_SNESMAX_CONFIG 1088
#define IDC_CHECK_VIDHD_IN_SLOT3 1089
#define IDM_EXIT 40001
#define IDM_HELP 40002
#define IDM_ABOUT 40003

View file

@ -1,4 +1,4 @@
#define APPLEWIN_VERSION 1,30,9,0
#define APPLEWIN_VERSION 1,29,16,0
#define xstr(a) str(a)
#define str(a) #a

View file

@ -1,679 +0,0 @@
/*
AppleWin : An Apple //e emulator for Windows
Copyright (C) 1994-1996, Michael O'Brien
Copyright (C) 1999-2001, Oliver Schmidt
Copyright (C) 2002-2005, Tom Charlesworth
Copyright (C) 2006-2021, Tom Charlesworth, Michael Pohoreski, Nick Westgate
AppleWin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
AppleWin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/* Description: Rockwell 6522 VIA emulation
*
* Author: Various
*/
#include "StdAfx.h"
#include "6522.h"
#include "Core.h"
#include "CPU.h"
#include "Memory.h"
#include "SynchronousEventManager.h"
#include "YamlHelper.h"
void SY6522::Reset(const bool powerCycle)
{
if (powerCycle)
{
memset(&m_regs, 0, sizeof(Regs));
m_regs.TIMER1_LATCH.w = 0xffff; // Some random value (but pick $ffff so it's deterministic)
// . NB. if it's too small (< ~$0007) then MB detection routines will fail!
}
CpuCreateCriticalSection(); // Reset() called by SY6522 global ctor, so explicitly create CPU's CriticalSection
Write(rACR, 0x00); // ACR = 0x00: T1 one-shot mode
Write(rIFR, 0x7f); // IFR = 0x7F: de-assert any IRQs
Write(rIER, 0x7f); // IER = 0x7F: disable all IRQs
StopTimer1();
StopTimer2();
m_timer1IrqDelay = m_timer2IrqDelay = 0;
}
//---------------------------------------------------------------------------
void SY6522::StartTimer1(void)
{
m_timer1Active = true;
}
// The assumption was that timer1 was only active if IER.TIMER1=1
// . Not true, since IFR can be polled (with IER.TIMER1=0)
void SY6522::StartTimer1_LoadStateV1(void)
{
if ((m_regs.IER & IxR_TIMER1) == 0x00)
return;
m_timer1Active = true;
}
void SY6522::StopTimer1(void)
{
m_timer1Active = false;
}
//-----------------------------------------------------------------------------
void SY6522::StartTimer2(void)
{
m_timer2Active = true;
}
void SY6522::StopTimer2(void)
{
m_timer2Active = false;
}
//-----------------------------------------------------------------------------
// Insert a new synchronous event whenever the 6522 timer's counter is written.
// . NB. it doesn't matter if the timer's interrupt enable (IER) is set or not
// - the state of IER is only important when the counter underflows - see: MB_SyncEventCallback()
USHORT SY6522::SetTimerSyncEvent(BYTE reg, USHORT timerLatch)
{
_ASSERT(reg == rT1CH || reg == rT2CH);
SyncEvent* syncEvent = reg == rT1CH ? m_syncEvent[0] : m_syncEvent[1];
// NB. This TIMER adjustment value gets subtracted when this current opcode completes, so no need to persist to save-state
const UINT opcodeCycleAdjust = GetOpcodeCyclesForWrite(reg);
if (syncEvent->m_active)
g_SynchronousEventMgr.Remove(syncEvent->m_id);
syncEvent->SetCycles(timerLatch + kExtraTimerCycles + opcodeCycleAdjust);
g_SynchronousEventMgr.Insert(syncEvent);
// It doesn't matter if this overflows (ie. >0xFFFF), since on completion of current opcode it'll be corrected
return (USHORT)(timerLatch + opcodeCycleAdjust);
}
//-----------------------------------------------------------------------------
extern void MB_UpdateIRQ(void);
void SY6522::UpdateIFR(BYTE clr_ifr, BYTE set_ifr /*= 0*/)
{
m_regs.IFR &= ~clr_ifr;
m_regs.IFR |= set_ifr;
if (m_regs.IFR & m_regs.IER & 0x7F)
m_regs.IFR |= IFR_IRQ;
else
m_regs.IFR &= ~IFR_IRQ;
MB_UpdateIRQ();
}
//-----------------------------------------------------------------------------
void SY6522::Write(BYTE nReg, BYTE nValue)
{
switch (nReg)
{
case 0x00: // ORB
m_regs.ORB = nValue & m_regs.DDRB;
break;
case 0x01: // ORA
m_regs.ORA = nValue & m_regs.DDRA;
break;
case 0x02: // DDRB
m_regs.DDRB = nValue;
break;
case 0x03: // DDRA
m_regs.DDRA = nValue;
break;
case 0x04: // TIMER1L_COUNTER
case 0x06: // TIMER1L_LATCH
m_regs.TIMER1_LATCH.l = nValue;
break;
case 0x05: // TIMER1H_COUNTER
{
UpdateIFR(IxR_TIMER1); // Clear Timer1 Interrupt Flag
m_regs.TIMER1_LATCH.h = nValue;
m_regs.TIMER1_COUNTER.w = SetTimerSyncEvent(nReg, m_regs.TIMER1_LATCH.w);
StartTimer1();
}
break;
case 0x07: // TIMER1H_LATCH
UpdateIFR(IxR_TIMER1); // Clear Timer1 Interrupt Flag
m_regs.TIMER1_LATCH.h = nValue;
break;
case 0x08: // TIMER2L
m_regs.TIMER2_LATCH.l = nValue;
break;
case 0x09: // TIMER2H
{
UpdateIFR(IxR_TIMER2); // Clear Timer2 Interrupt Flag
m_regs.TIMER2_LATCH.h = nValue; // NB. Real 6522 doesn't have TIMER2_LATCH.h
m_regs.TIMER2_COUNTER.w = SetTimerSyncEvent(nReg, m_regs.TIMER2_LATCH.w);
StartTimer2();
}
break;
case 0x0a: // SERIAL_SHIFT
break;
case 0x0b: // ACR
m_regs.ACR = nValue;
break;
case 0x0c: // PCR - Used for Speech chip only
m_regs.PCR = nValue;
break;
case 0x0d: // IFR
// - Clear those bits which are set in the lower 7 bits.
// - Can't clear bit 7 directly.
UpdateIFR(nValue);
break;
case 0x0e: // IER
if (!(nValue & 0x80))
{
// Clear those bits which are set in the lower 7 bits.
nValue ^= 0x7F;
m_regs.IER &= nValue;
}
else
{
// Set those bits which are set in the lower 7 bits.
nValue &= 0x7F;
m_regs.IER |= nValue;
}
UpdateIFR(0);
break;
case 0x0f: // ORA_NO_HS
break;
}
}
//-----------------------------------------------------------------------------
void SY6522::UpdateTimer1(USHORT clocks)
{
if (CheckTimerUnderflow(m_regs.TIMER1_COUNTER.w, m_timer1IrqDelay, clocks))
m_timer1IrqDelay = OnTimer1Underflow(m_regs.TIMER1_COUNTER.w);
}
void SY6522::UpdateTimer2(USHORT clocks)
{
// No TIMER2 latch so "after timing out, the counter will continue to decrement"
CheckTimerUnderflow(m_regs.TIMER2_COUNTER.w, m_timer2IrqDelay, clocks);
}
//-----------------------------------------------------------------------------
bool SY6522::CheckTimerUnderflow(USHORT& counter, int& timerIrqDelay, const USHORT clocks)
{
if (clocks == 0)
return false;
int oldTimer = counter;
int timer = counter;
timer -= clocks;
counter = (USHORT)timer;
bool timerIrq = false;
if (timerIrqDelay) // Deal with any previous counter underflow which didn't yet result in an IRQ
{
_ASSERT(timerIrqDelay == 1);
timerIrqDelay = 0;
timerIrq = true;
// if LATCH is very small then could underflow for every opcode...
}
if (oldTimer >= 0 && timer < 0) // Underflow occurs for 0x0000 -> 0xFFFF
{
if (timer <= -2) // TIMER = 0xFFFE (or less)
timerIrq = true;
else // TIMER = 0xFFFF
timerIrqDelay = 1; // ...so 1 cycle until IRQ
}
return timerIrq;
}
int SY6522::OnTimer1Underflow(USHORT& counter)
{
int timer = (int)(short)(counter);
while (timer < -1)
timer += (m_regs.TIMER1_LATCH.w + kExtraTimerCycles); // GH#651: account for underflowed cycles / GH#652: account for extra 2 cycles
counter = (USHORT)timer;
return (timer == -1) ? 1 : 0; // timer1IrqDelay
}
//-----------------------------------------------------------------------------
USHORT SY6522::GetTimer1Counter(BYTE reg)
{
USHORT counter = m_regs.TIMER1_COUNTER.w; // NB. don't update the real T1C
int timerIrqDelay = m_timer1IrqDelay; // NB. don't update the real timer1IrqDelay
const UINT opcodeCycleAdjust = GetOpcodeCyclesForRead(reg) - 1; // to compensate for the 4/5/6 cycle read opcode
if (CheckTimerUnderflow(counter, timerIrqDelay, opcodeCycleAdjust))
OnTimer1Underflow(counter);
return counter;
}
USHORT SY6522::GetTimer2Counter(BYTE reg)
{
const UINT opcodeCycleAdjust = GetOpcodeCyclesForRead(reg) - 1; // to compensate for the 4/5/6 cycle read opcode
return m_regs.TIMER2_COUNTER.w - opcodeCycleAdjust;
}
bool SY6522::IsTimer1Underflowed(BYTE reg)
{
USHORT counter = m_regs.TIMER1_COUNTER.w; // NB. don't update the real T1C
int timerIrqDelay = m_timer1IrqDelay; // NB. don't update the real timer1IrqDelay
const UINT opcodeCycleAdjust = GetOpcodeCyclesForRead(reg); // to compensate for the 4/5/6 cycle read opcode
return CheckTimerUnderflow(counter, timerIrqDelay, opcodeCycleAdjust);
}
bool SY6522::IsTimer2Underflowed(BYTE reg)
{
USHORT counter = m_regs.TIMER2_COUNTER.w; // NB. don't update the real T2C
int timerIrqDelay = m_timer2IrqDelay; // NB. don't update the real timer2IrqDelay
const UINT opcodeCycleAdjust = GetOpcodeCyclesForRead(reg); // to compensate for the 4/5/6 cycle read opcode
return CheckTimerUnderflow(counter, timerIrqDelay, opcodeCycleAdjust);
}
//-----------------------------------------------------------------------------
BYTE SY6522::Read(BYTE nReg)
{
BYTE nValue = 0x00;
switch (nReg)
{
case 0x00: // ORB
nValue = m_regs.ORB;
break;
case 0x01: // ORA
nValue = m_regs.ORA;
break;
case 0x02: // DDRB
nValue = m_regs.DDRB;
break;
case 0x03: // DDRA
nValue = m_regs.DDRA;
break;
case 0x04: // TIMER1L_COUNTER
// NB. GH#701 (T1C:=0xFFFF, LDA T1C_L[4cy], A==0xFC)
nValue = GetTimer1Counter(nReg) & 0xff;
UpdateIFR(IxR_TIMER1);
break;
case 0x05: // TIMER1H_COUNTER
nValue = GetTimer1Counter(nReg) >> 8;
break;
case 0x06: // TIMER1L_LATCH
nValue = m_regs.TIMER1_LATCH.l;
break;
case 0x07: // TIMER1H_LATCH
nValue = m_regs.TIMER1_LATCH.h;
break;
case 0x08: // TIMER2L
nValue = GetTimer2Counter(nReg) & 0xff;
UpdateIFR(IxR_TIMER2);
break;
case 0x09: // TIMER2H
nValue = GetTimer2Counter(nReg) >> 8;
break;
case 0x0a: // SERIAL_SHIFT
break;
case 0x0b: // ACR
nValue = m_regs.ACR;
break;
case 0x0c: // PCR
nValue = m_regs.PCR;
break;
case 0x0d: // IFR
nValue = m_regs.IFR;
if (m_timer1Active && IsTimer1Underflowed(nReg))
nValue |= IxR_TIMER1;
if (m_timer2Active && IsTimer2Underflowed(nReg))
nValue |= IxR_TIMER2;
break;
case 0x0e: // IER
nValue = 0x80 | m_regs.IER; // GH#567
break;
case 0x0f: // ORA_NO_HS
nValue = m_regs.ORA;
break;
}
return nValue;
}
//-----------------------------------------------------------------------------
// TODO: RMW opcodes: dec,inc,asl,lsr,rol,ror (abs16 & abs16,x) + 65C02 trb,tsb (abs16)
UINT SY6522::GetOpcodeCyclesForRead(BYTE reg)
{
UINT opcodeCycles = 0;
BYTE opcode = 0;
bool abs16 = false;
bool abs16x = false;
bool abs16y = false;
bool indx = false;
bool indy = false;
const BYTE opcodeMinus3 = mem[(::regs.pc - 3) & 0xffff];
const BYTE opcodeMinus2 = mem[(::regs.pc - 2) & 0xffff];
if (((opcodeMinus2 & 0x0f) == 0x01) && ((opcodeMinus2 & 0x10) == 0x00)) // ora (zp,x), and (zp,x), ..., sbc (zp,x)
{
// NB. this is for read, so don't need to exclude 0x81 / sta (zp,x)
opcodeCycles = 6;
opcode = opcodeMinus2;
indx = true;
}
else if (((opcodeMinus2 & 0x0f) == 0x01) && ((opcodeMinus2 & 0x10) == 0x10)) // ora (zp),y, and (zp),y, ..., sbc (zp),y
{
// NB. this is for read, so don't need to exclude 0x91 / sta (zp),y
opcodeCycles = 5;
opcode = opcodeMinus2;
indy = true;
}
else if (((opcodeMinus2 & 0x0f) == 0x02) && ((opcodeMinus2 & 0x10) == 0x10) && GetMainCpu() == CPU_65C02) // ora (zp), and (zp), ..., sbc (zp) : 65C02-only
{
// NB. this is for read, so don't need to exclude 0x92 / sta (zp)
opcodeCycles = 5;
opcode = opcodeMinus2;
}
else
{
if ((((opcodeMinus3 & 0x0f) == 0x0D) && ((opcodeMinus3 & 0x10) == 0x00)) || // ora abs16, and abs16, ..., sbc abs16
(opcodeMinus3 == 0x2C) || // bit abs16
(opcodeMinus3 == 0xAC) || // ldy abs16
(opcodeMinus3 == 0xAE) || // ldx abs16
(opcodeMinus3 == 0xCC) || // cpy abs16
(opcodeMinus3 == 0xEC)) // cpx abs16
{
}
else if ((opcodeMinus3 == 0xBC) || // ldy abs16,x
((opcodeMinus3 == 0x3C) && GetMainCpu() == CPU_65C02)) // bit abs16,x : 65C02-only
{
abs16x = true;
}
else if ((opcodeMinus3 == 0xBE)) // ldx abs16,y
{
abs16y = true;
}
else if ((opcodeMinus3 & 0x10) == 0x10)
{
if ((opcodeMinus3 & 0x0f) == 0x0D) // ora abs16,x, and abs16,x, ..., sbc abs16,x
abs16x = true;
else if ((opcodeMinus3 & 0x0f) == 0x09) // ora abs16,y, and abs16,y, ..., sbc abs16,y
abs16y = true;
}
else
{
_ASSERT(0);
opcodeCycles = 0;
return 0;
}
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16 = true;
}
//
WORD addr16 = 0;
if (!abs16)
{
BYTE zp = mem[(::regs.pc - 1) & 0xffff];
if (indx) zp += ::regs.x;
addr16 = (mem[zp] | (mem[(zp + 1) & 0xff] << 8));
if (indy) addr16 += ::regs.y;
}
else
{
addr16 = mem[(::regs.pc - 2) & 0xffff] | (mem[(::regs.pc - 1) & 0xffff] << 8);
if (abs16y) addr16 += ::regs.y;
if (abs16x) addr16 += ::regs.x;
}
// Check we've reverse looked-up the 6502 opcode correctly
if ((addr16 & 0xF80F) != (0xC000 + reg))
{
_ASSERT(0);
return 0;
}
return opcodeCycles;
}
// TODO: RMW opcodes: dec,inc,asl,lsr,rol,ror (abs16 & abs16,x) + 65C02 trb,tsb (abs16)
UINT SY6522::GetOpcodeCyclesForWrite(BYTE reg)
{
UINT opcodeCycles = 0;
BYTE opcode = 0;
bool abs16 = false;
const BYTE opcodeMinus3 = mem[(::regs.pc - 3) & 0xffff];
const BYTE opcodeMinus2 = mem[(::regs.pc - 2) & 0xffff];
if ((opcodeMinus3 == 0x8C) || // sty abs16
(opcodeMinus3 == 0x8D) || // sta abs16
(opcodeMinus3 == 0x8E)) // stx abs16
{ // Eg. FT demos: CHIP, MADEF, MAD2
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16 = true;
}
else if ((opcodeMinus3 == 0x99) || // sta abs16,y
(opcodeMinus3 == 0x9D)) // sta abs16,x
{ // Eg. Paleotronic microTracker demo
opcodeCycles = 5;
opcode = opcodeMinus3;
abs16 = true;
}
else if (opcodeMinus2 == 0x81) // sta (zp,x)
{
opcodeCycles = 6;
opcode = opcodeMinus2;
}
else if (opcodeMinus2 == 0x91) // sta (zp),y
{ // Eg. FT demos: OMT, PLS
opcodeCycles = 6;
opcode = opcodeMinus2;
}
else if (opcodeMinus2 == 0x92 && GetMainCpu() == CPU_65C02) // sta (zp) : 65C02-only
{
opcodeCycles = 5;
opcode = opcodeMinus2;
}
else if (opcodeMinus3 == 0x9C && GetMainCpu() == CPU_65C02) // stz abs16 : 65C02-only
{
opcodeCycles = 4;
opcode = opcodeMinus3;
abs16 = true;
}
else if (opcodeMinus3 == 0x9E && GetMainCpu() == CPU_65C02) // stz abs16,x : 65C02-only
{
opcodeCycles = 5;
opcode = opcodeMinus3;
abs16 = true;
}
else
{
_ASSERT(0);
opcodeCycles = 0;
return 0;
}
//
WORD addr16 = 0;
if (!abs16)
{
BYTE zp = mem[(::regs.pc - 1) & 0xffff];
if (opcode == 0x81) zp += ::regs.x;
addr16 = (mem[zp] | (mem[(zp + 1) & 0xff] << 8));
if (opcode == 0x91) addr16 += ::regs.y;
}
else
{
addr16 = mem[(::regs.pc - 2) & 0xffff] | (mem[(::regs.pc - 1) & 0xffff] << 8);
if (opcode == 0x99) addr16 += ::regs.y;
if (opcode == 0x9D || opcode == 0x9E) addr16 += ::regs.x;
}
// Check we've reverse looked-up the 6502 opcode correctly
if ((addr16 & 0xF80F) != (0xC000 + reg))
{
_ASSERT(0);
return 0;
}
return opcodeCycles;
}
//=============================================================================
#define SS_YAML_KEY_SY6522 "SY6522"
// NB. No version - this is determined by the parent "Mockingboard C" or "Phasor" unit
#define SS_YAML_KEY_SY6522_REG_ORB "ORB"
#define SS_YAML_KEY_SY6522_REG_ORA "ORA"
#define SS_YAML_KEY_SY6522_REG_DDRB "DDRB"
#define SS_YAML_KEY_SY6522_REG_DDRA "DDRA"
#define SS_YAML_KEY_SY6522_REG_T1_COUNTER "Timer1 Counter"
#define SS_YAML_KEY_SY6522_REG_T1_LATCH "Timer1 Latch"
#define SS_YAML_KEY_SY6522_REG_T2_COUNTER "Timer2 Counter"
#define SS_YAML_KEY_SY6522_REG_T2_LATCH "Timer2 Latch"
#define SS_YAML_KEY_SY6522_REG_SERIAL_SHIFT "Serial Shift"
#define SS_YAML_KEY_SY6522_REG_ACR "ACR"
#define SS_YAML_KEY_SY6522_REG_PCR "PCR"
#define SS_YAML_KEY_SY6522_REG_IFR "IFR"
#define SS_YAML_KEY_SY6522_REG_IER "IER"
#define SS_YAML_KEY_SY6522_TIMER1_IRQ_DELAY "Timer1 IRQ Delay"
#define SS_YAML_KEY_SY6522_TIMER2_IRQ_DELAY "Timer2 IRQ Delay"
#define SS_YAML_KEY_SY6522_TIMER1_ACTIVE "Timer1 Active"
#define SS_YAML_KEY_SY6522_TIMER2_ACTIVE "Timer2 Active"
void SY6522::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
{
YamlSaveHelper::Label label(yamlSaveHelper, "%s:\n", SS_YAML_KEY_SY6522);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_ORB, m_regs.ORB);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_ORA, m_regs.ORA);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_DDRB, m_regs.DDRB);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_DDRA, m_regs.DDRA);
yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T1_COUNTER, m_regs.TIMER1_COUNTER.w);
yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T1_LATCH, m_regs.TIMER1_LATCH.w);
yamlSaveHelper.SaveUint(SS_YAML_KEY_SY6522_TIMER1_IRQ_DELAY, m_timer1IrqDelay); // v4
yamlSaveHelper.SaveBool(SS_YAML_KEY_SY6522_TIMER1_ACTIVE, m_timer1Active); // v8
yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T2_COUNTER, m_regs.TIMER2_COUNTER.w);
yamlSaveHelper.SaveHexUint16(SS_YAML_KEY_SY6522_REG_T2_LATCH, m_regs.TIMER2_LATCH.w);
yamlSaveHelper.SaveUint(SS_YAML_KEY_SY6522_TIMER2_IRQ_DELAY, m_timer2IrqDelay); // v4
yamlSaveHelper.SaveBool(SS_YAML_KEY_SY6522_TIMER2_ACTIVE, m_timer2Active); // v8
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_SERIAL_SHIFT, m_regs.SERIAL_SHIFT);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_ACR, m_regs.ACR);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_PCR, m_regs.PCR);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_IFR, m_regs.IFR);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_SY6522_REG_IER, m_regs.IER);
// NB. No need to write ORA_NO_HS, since same data as ORA, just without handshake
}
void SY6522::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
{
if (!yamlLoadHelper.GetSubMap(SS_YAML_KEY_SY6522))
throw std::runtime_error("Card: Expected key: " SS_YAML_KEY_SY6522);
m_regs.ORB = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_ORB);
m_regs.ORA = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_ORA);
m_regs.DDRB = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_DDRB);
m_regs.DDRA = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_DDRA);
m_regs.TIMER1_COUNTER.w = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_T1_COUNTER);
m_regs.TIMER1_LATCH.w = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_T1_LATCH);
m_regs.TIMER2_COUNTER.w = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_T2_COUNTER);
m_regs.TIMER2_LATCH.w = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_T2_LATCH);
m_regs.SERIAL_SHIFT = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_SERIAL_SHIFT);
m_regs.ACR = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_ACR);
m_regs.PCR = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_PCR);
m_regs.IFR = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_IFR);
m_regs.IER = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_REG_IER);
m_regs.ORA_NO_HS = 0; // Not saved
m_timer1IrqDelay = m_timer2IrqDelay = 0;
if (version >= 4)
{
m_timer1IrqDelay = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_TIMER1_IRQ_DELAY);
m_timer2IrqDelay = yamlLoadHelper.LoadUint(SS_YAML_KEY_SY6522_TIMER2_IRQ_DELAY);
}
if (version < 7)
{
// Assume t1_latch was never written to (so had the old default of 0x0000) - this now results in failure of Mockingboard detection!
if (m_regs.TIMER1_LATCH.w == 0x0000)
m_regs.TIMER1_LATCH.w = 0xFFFF; // Allow Mockingboard detection to succeed
}
if (version >= 8)
{
bool timer1Active = yamlLoadHelper.LoadBool(SS_YAML_KEY_SY6522_TIMER1_ACTIVE);
bool timer2Active = yamlLoadHelper.LoadBool(SS_YAML_KEY_SY6522_TIMER2_ACTIVE);
SetTimersActiveFromSnapshot(timer1Active, timer2Active, version);
}
yamlLoadHelper.PopMap();
}
void SY6522::SetTimersActiveFromSnapshot(bool timer1Active, bool timer2Active, UINT version)
{
m_timer1Active = timer1Active;
m_timer2Active = timer2Active;
//
if (version == 1)
{
StartTimer1_LoadStateV1(); // Attempt to start timer
}
else // version >= 2
{
if (IsTimer1Active())
StartTimer1(); // Attempt to start timer
}
if (IsTimer1Active())
{
SyncEvent* syncEvent = m_syncEvent[0];
syncEvent->SetCycles(GetRegT1C() + kExtraTimerCycles); // NB. use COUNTER, not LATCH
g_SynchronousEventMgr.Insert(syncEvent);
}
if (IsTimer2Active())
{
SyncEvent* syncEvent = m_syncEvent[1];
syncEvent->SetCycles(GetRegT2C() + kExtraTimerCycles); // NB. use COUNTER, not LATCH
g_SynchronousEventMgr.Insert(syncEvent);
}
}

View file

@ -1,143 +0,0 @@
#pragma once
class SY6522
{
public:
SY6522(void)
{
for (UINT i = 0; i < kNumTimersPer6522; i++)
m_syncEvent[i] = NULL;
Reset(true);
}
~SY6522(void)
{
}
void InitSyncEvents(class SyncEvent* event0, class SyncEvent* event1)
{
m_syncEvent[0] = event0;
m_syncEvent[1] = event1;
}
void Reset(const bool powerCycle);
void StartTimer1(void);
void StopTimer1(void);
bool IsTimer1Active(void) { return m_timer1Active; }
void StopTimer2(void);
bool IsTimer2Active(void) { return m_timer2Active; }
void UpdateIFR(BYTE clr_ifr, BYTE set_ifr = 0);
void UpdateTimer1(USHORT clocks);
void UpdateTimer2(USHORT clocks);
enum { rORB = 0, rORA, rDDRB, rDDRA, rT1CL, rT1CH, rT1LL, rT1LH, rT2CL, rT2CH, rSR, rACR, rPCR, rIFR, rIER, rORA_NO_HS, SIZE_6522_REGS };
BYTE GetReg(BYTE reg)
{
switch (reg)
{
case rDDRA: return m_regs.DDRA;
case rORA: return m_regs.ORA;
case rACR: return m_regs.ACR;
case rPCR: return m_regs.PCR;
case rIFR: return m_regs.IFR;
}
_ASSERT(0);
return 0;
}
USHORT GetRegT1C(void) { return m_regs.TIMER1_COUNTER.w; }
USHORT GetRegT2C(void) { return m_regs.TIMER2_COUNTER.w; }
void GetRegs(BYTE regs[SIZE_6522_REGS]) { memcpy(&regs[0], (BYTE*)&m_regs, SIZE_6522_REGS); } // For debugger
void SetRegORA(BYTE reg) { m_regs.ORA = reg; }
BYTE Read(BYTE nReg);
void Write(BYTE nReg, BYTE nValue);
void SaveSnapshot(class YamlSaveHelper& yamlSaveHelper);
void LoadSnapshot(class YamlLoadHelper& yamlLoadHelper, UINT version);
void SetTimersActiveFromSnapshot(bool timer1Active, bool timer2Active, UINT version);
// ACR
static const BYTE ACR_RUNMODE = 1 << 6;
static const BYTE ACR_RM_ONESHOT = 0 << 6;
static const BYTE ACR_RM_FREERUNNING = 1 << 6;
// IFR & IER:
static const BYTE IxR_SSI263 = 1 << 1;
static const BYTE IxR_VOTRAX = 1 << 4;
static const BYTE IxR_TIMER2 = 1 << 5;
static const BYTE IxR_TIMER1 = 1 << 6;
static const BYTE IFR_IRQ = 1 << 7;
static const UINT kExtraTimerCycles = 2; // Rockwell, Fig.16: period = N+2 cycles
static const UINT kNumTimersPer6522 = 2;
private:
USHORT SetTimerSyncEvent(BYTE reg, USHORT timerLatch);
USHORT GetTimer1Counter(BYTE reg);
USHORT GetTimer2Counter(BYTE reg);
bool IsTimer1Underflowed(BYTE reg);
bool IsTimer2Underflowed(BYTE reg);
bool CheckTimerUnderflow(USHORT& counter, int& timerIrqDelay, const USHORT clocks);
int OnTimer1Underflow(USHORT& counter);
UINT GetOpcodeCyclesForRead(BYTE reg);
UINT GetOpcodeCyclesForWrite(BYTE reg);
void StartTimer2(void);
void StartTimer1_LoadStateV1(void);
#pragma pack(push)
#pragma pack(1) // Ensure 'struct Regs' is packed so that GetRegs() can just do a memcpy()
struct IWORD
{
union
{
struct
{
BYTE l;
BYTE h;
};
USHORT w;
};
};
struct Regs
{
BYTE ORB; // $00 - Port B
BYTE ORA; // $01 - Port A (with handshaking)
BYTE DDRB; // $02 - Data Direction Register B
BYTE DDRA; // $03 - Data Direction Register A
IWORD TIMER1_COUNTER; // $04 - Read counter (L) / Write latch (L)
// $05 - Read / Write & initiate count (H)
IWORD TIMER1_LATCH; // $06 - Read / Write & latch (L)
// $07 - Read / Write & latch (H)
IWORD TIMER2_COUNTER; // $08 - Read counter (L) / Write latch (L)
// $09 - Read counter (H) / Write latch (H)
BYTE SERIAL_SHIFT; // $0A
BYTE ACR; // $0B - Auxiliary Control Register
BYTE PCR; // $0C - Peripheral Control Register
BYTE IFR; // $0D - Interrupt Flag Register
BYTE IER; // $0E - Interrupt Enable Register
BYTE ORA_NO_HS; // $0F - Port A (without handshaking)
//
IWORD TIMER2_LATCH; // Doesn't exist in 6522
};
#pragma pack(pop)
Regs m_regs;
int m_timer1IrqDelay;
int m_timer2IrqDelay;
bool m_timer1Active;
bool m_timer2Active;
class SyncEvent* m_syncEvent[kNumTimersPer6522];
};

View file

@ -468,7 +468,6 @@ sound_write_buf_pstereo( libspectrum_signed_word * out, int c )
#define AY_ENV_HOLD 1
#define HZ_COMMON_DENOMINATOR 50
#include "Log.h"
void CAY8910::sound_ay_overlay( void )
{
@ -493,24 +492,9 @@ void CAY8910::sound_ay_overlay( void )
sfreq = sound_generator_freq / HZ_COMMON_DENOMINATOR;
// cpufreq = machine_current->timings.processor_speed / HZ_COMMON_DENOMINATOR;
cpufreq = (libspectrum_dword) (m_fCurrentCLK_AY8910 / HZ_COMMON_DENOMINATOR); // [TC]
int dbgCount=0;
for( f = 0; f < ay_change_count; f++ )
{
ay_change[f].ofs = (USHORT) (( ay_change[f].tstates * sfreq ) / cpufreq); // [TC] Added cast
if (ay_change[f].ofs >= sound_generator_framesiz) // [TC] Ensure that all ay_change's get processed
{
ay_change[f].ofs = sound_generator_framesiz-1; // [TC] - as parent, sound_frame(), just dumps outstanding changes (ay_change_count=0)
dbgCount++;
}
}
#if defined(_DEBUG) && 0
if (dbgCount)
{
LogOutput("ay_change: saved %d\n", dbgCount); // [TC] previously would've been dumped!
}
#endif
libspectrum_signed_word* pBuf1 = g_ppSoundBuffers[0];
libspectrum_signed_word* pBuf2 = g_ppSoundBuffers[1];
libspectrum_signed_word* pBuf3 = g_ppSoundBuffers[2];
@ -725,48 +709,6 @@ void CAY8910::sound_ay_overlay( void )
}
}
BYTE CAY8910::sound_ay_read( int reg )
{
reg &= 15;
BYTE val = 0;
bool got = false;
if (ay_change_count)
{
for (int i=ay_change_count-1; i>=0; i--)
{
if (ay_change[i].reg == reg)
{
val = ay_change[i].val; // return the most recently written reg's value
got = true;
break;
}
}
}
if (!got)
val = sound_ay_registers[reg];
switch (reg & 15)
{
case 1:
case 3:
case 5:
case 13:
val &= 15;
break;
case 6:
case 8:
case 9:
case 10:
val &= 31;
break;
}
return val;
}
// AppleWin:TC Holding down ScrollLock will result in lots of AY changes /ay_change_count/
// - since sound_ay_overlay() is called to consume them.
@ -1105,7 +1047,7 @@ bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, const std::string& su
{
std::string unit = std::string(SS_YAML_KEY_AY8910) + suffix;
if (!yamlLoadHelper.GetSubMap(unit))
throw std::runtime_error("Card: Expected key: " + unit);
throw std::string("Card: Expected key: ") + unit;
ay_tone_tick[0] = yamlLoadHelper.LoadUint(SS_YAML_KEY_TONE0_TICK);
ay_tone_tick[1] = yamlLoadHelper.LoadUint(SS_YAML_KEY_TONE1_TICK);
@ -1130,7 +1072,7 @@ bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, const std::string& su
env_counter = yamlLoadHelper.LoadUint(SS_YAML_KEY_ENV_COUNTER);
if (!yamlLoadHelper.GetSubMap(SS_YAML_KEY_REGISTERS))
throw std::runtime_error("Card: Expected key: " SS_YAML_KEY_REGISTERS);
throw std::string("Card: Expected key: ") + SS_YAML_KEY_REGISTERS;
USHORT period = (USHORT) yamlLoadHelper.LoadUint(SS_YAML_KEY_REG_TONE0_PERIOD);
sound_ay_registers[0] = period & 0xff;
@ -1160,10 +1102,11 @@ bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, const std::string& su
{
while(1)
{
std::string strIndex = StrFormat("0x%04X", ay_change_count);
char szIndex[7];
sprintf_s(szIndex, sizeof(szIndex), "0x%04X", ay_change_count);
bool bFound;
std::string value = yamlLoadHelper.LoadString_NoThrow(strIndex, bFound);
std::string value = yamlLoadHelper.LoadString_NoThrow(szIndex, bFound);
if (!bFound)
break; // done
@ -1173,7 +1116,7 @@ bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, const std::string& su
unsigned int _val = 0;
if(4 != sscanf_s(value.c_str(), SS_YAML_VALUE_CHANGE_FORMAT,
&_tstates, &_ofs, &_reg, &_val))
throw std::runtime_error("Card: AY8910: Failed to scanf change list");
throw std::string("Card: AY8910: Failed to scanf change list");
ay_change[ay_change_count].tstates = _tstates;
ay_change[ay_change_count].ofs = _ofs;
@ -1182,7 +1125,7 @@ bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, const std::string& su
ay_change_count++;
if (ay_change_count > AY_CHANGE_MAX)
throw std::runtime_error("Card: AY8910: Too many changes");
throw std::string("Card: AY8910: Too many changes");
}
yamlLoadHelper.PopMap();
@ -1202,10 +1145,6 @@ bool CAY8910::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, const std::string& su
static CAY8910 g_AY8910[MAX_8910];
static unsigned __int64 g_uLastCumulativeCycles = 0;
BYTE AYReadReg(int chip, int r)
{
return g_AY8910[chip].sound_ay_read(r);
}
void _AYWriteReg(int chip, int r, int v)
{

View file

@ -2,8 +2,6 @@
#define MAX_8910 4
BYTE AYReadReg(int chip, int r); // TC
//-------------------------------------
// MAME interface
@ -42,7 +40,6 @@ public:
void sound_ay_init( void );
void sound_init( const char *device );
BYTE sound_ay_read( int reg ); // TC
void sound_ay_write( int reg, int val, libspectrum_dword now );
void sound_ay_reset( void );
void sound_frame( void );

View file

@ -1,66 +1,12 @@
include(FindPkgConfig)
include(FindZLIB)
find_package(ZLIB REQUIRED)
pkg_search_module(YAML REQUIRED yaml-0.1)
pkg_search_module(MINIZIP REQUIRED minizip)
pkg_search_module(SLIRP slirp)
if ("${SLIRP_FOUND}" STREQUAL "")
message(WARNING "'libslirp' not found. Will use 'libpcap' instead")
endif()
pkg_search_module(PCAP libpcap)
if ("${PCAP_FOUND}" STREQUAL "")
# old versions of pcap do not work with pkg-config
# this is necessary on Rapsberri Pi OS
execute_process(COMMAND pcap-config --cflags
OUTPUT_VARIABLE PCAP_INCLUDE_DIRS
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE STATUS)
if ("${STATUS}" STREQUAL "0")
message("Found 'libpcap' via pcap-config")
else()
message(FATAL_ERROR "Cannot locate 'libpcap-dev'")
endif()
execute_process(COMMAND pcap-config --libs
OUTPUT_VARIABLE PCAP_LIBRARIES
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
find_package(Boost REQUIRED)
set(SOURCE_FILES
Tfe/tfearch.cpp
Tfe/tfesupp.cpp
Tfe/NetworkBackend.cpp
Tfe/PCapBackend.cpp
Tfe/IPRaw.cpp
Debugger/Debug.cpp
Debugger/Debugger_Help.cpp
Debugger/Debugger_Color.cpp
Debugger/Debugger_Disassembler.cpp
Debugger/Debugger_Symbols.cpp
Debugger/Debugger_DisassemblerData.cpp
Debugger/Debugger_Console.cpp
Debugger/Debugger_Assembler.cpp
Debugger/Debugger_Parser.cpp
Debugger/Debugger_Range.cpp
Debugger/Debugger_Commands.cpp
Debugger/Util_MemoryTextFile.cpp
Uthernet1.cpp
Uthernet2.cpp
StrFormat.cpp
6522.cpp
VidHD.cpp
SSI263.cpp
add_library(appleii SHARED
Speaker.cpp
SoundCore.cpp
AY8910.cpp
Mockingboard.cpp
Pravets.cpp
Tape.cpp
YamlHelper.cpp
Log.cpp
Disk.cpp
@ -80,7 +26,6 @@ set(SOURCE_FILES
RGBMonitor.cpp
NTSC.cpp
NTSC_CharSet.cpp
Card.cpp
CardManager.cpp
Disk2CardManager.cpp
Riff.cpp
@ -90,142 +35,52 @@ set(SOURCE_FILES
Core.cpp
Utilities.cpp
FrameBase.cpp
CmdLine.cpp
Configuration/PropertySheetHelper.cpp
linux/resources.cpp
linux/windows/handles.cpp
linux/windows/files.cpp
linux/windows/resources.cpp
linux/windows/bitmap.cpp
linux/windows/time.cpp
linux/windows/stringcb.cpp
linux/windows/strings.cpp
linux/windows/misc.cpp
linux/windows/winbase.cpp
linux/windows/winuser.cpp
linux/windows/dsound.cpp
linux/windows/guiddef.cpp
linux/windows/dmusicc.cpp
linux/windows/winnls.cpp
linux/data.cpp
linux/benchmark.cpp
linux/paddle.cpp
linux/version.cpp
linux/registry.cpp
linux/keyboard.cpp
linux/linuxvideo.cpp
linux/linuxframe.cpp
linux/context.cpp
linux/tape.cpp
linux/network/slirp2.cpp
linux/duplicates/Debugger_Display.cpp
linux/duplicates/Debugger_Win32.cpp
linux/duplicates/Debug.cpp
linux/duplicates/Joystick.cpp
linux/duplicates/SerialComms.cpp
linux/duplicates/PropertySheet.cpp
linux/duplicates/Registry.cpp
linux/duplicates/FourPlay.cpp
linux/duplicates/SNESMAX.cpp
linux/duplicates/Keyboard.cpp
linux/duplicates/Tfe.cpp
linux/duplicates/AppleWin.cpp
Z80VICE/z80.cpp
Z80VICE/z80mem.cpp
Z80VICE/daa.cpp
)
set(HEADER_FILES
Tfe/tfearch.h
Tfe/tfesupp.h
Tfe/NetworkBackend.h
Tfe/PCapBackend.h
Tfe/IPRaw.h
Uthernet1.h
Uthernet2.h
W5100.h
6522.h
VidHD.h
SSI263.h
SSI263Phonemes.h
Speaker.h
SoundCore.h
AY8910.h
Mockingboard.h
Pravets.h
Tape.h
YamlHelper.h
Log.h
Disk.h
DiskFormatTrack.h
DiskImage.h
DiskImageHelper.h
Harddisk.h
Memory.h
CPU.h
6821.h
NoSlotClock.h
SAM.h
z80emu.h
ParallelPrinter.h
MouseInterface.h
LanguageCard.h
RGBMonitor.h
NTSC.h
NTSC_CharSet.h
Card.h
CardManager.h
Disk2CardManager.h
Riff.h
SaveState.h
SynchronousEventManager.h
Video.h
Core.h
Utilities.h
FrameBase.h
FourPlay.h
SNESMAX.h
Common.h
DiskDefs.h
DiskLog.h
Interface.h
SaveState_Structs_common.h
SaveState_Structs_v1.h
Debugger/Debug.h
Debugger/DebugDefs.h
Debugger/Debugger_Color.h
Debugger/Debugger_Console.h
Debugger/Debugger_Disassembler.h
Debugger/Debugger_DisassemblerData.h
Debugger/Debugger_Display.h
Debugger/Debugger_Help.h
Debugger/Debugger_Parser.h
Debugger/Debugger_Range.h
Debugger/Debugger_Symbols.h
Debugger/Debugger_Types.h
Debugger/Debugger_Win32.h
Debugger/Util_MemoryTextFile.h
Debugger/Util_Text.h
Configuration/PropertySheetHelper.h
linux/resources.h
linux/linuxinterface.h
linux/benchmark.h
linux/paddle.h
linux/version.h
linux/registry.h
linux/keyboard.h
linux/linuxframe.h
linux/tape.h
linux/network/slirp2.h
Z80VICE/z80.h
Z80VICE/z80mem.h
Z80VICE/z80regs.h
Z80VICE/daa.h
)
# we used to generate a shared object, but it turns out there are more cons than pros
add_library(appleii STATIC
${SOURCE_FILES}
${HEADER_FILES}
)
pkg_check_modules(YAML REQUIRED yaml-0.1)
pkg_check_modules(MINIZIP REQUIRED minizip)
find_package(Boost REQUIRED)
target_include_directories(appleii PRIVATE
${CMAKE_CURRENT_BINARY_DIR} # for config.h
${YAML_INCLUDE_DIRS}
${PCAP_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${SLIRP_INCLUDE_DIRS}
Debugger
)
@ -237,29 +92,7 @@ target_include_directories(appleii PUBLIC
target_link_libraries(appleii PRIVATE
${YAML_LIBRARIES}
${MINIZIP_LIBRARIES}
${PCAP_LIBRARIES}
${SLIRP_LIBRARIES}
ZLIB::ZLIB
)
target_link_libraries(appleii PUBLIC
windows
)
target_link_directories(appleii PRIVATE
${YAML_LIBRARY_DIRS}
${MINIZIP_LIBRARY_DIRS}
${PCAP_LIBRARY_DIRS}
${SLIRP_LIBRARY_DIRS}
)
target_compile_options(appleii PUBLIC
-Wno-multichar
)
add_custom_command(
TARGET appleii POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/bin/*.SYM ${CMAKE_BINARY_DIR}
)
configure_file(linux/config.h.in linux/config.h)
install(TARGETS appleii
DESTINATION lib)

View file

@ -107,6 +107,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#define LOG_IRQ_TAKEN_AND_RTI 0
// 6502 Accumulator Bit Flags
#define AF_SIGN 0x80
#define AF_OVERFLOW 0x40
#define AF_RESERVED 0x20
#define AF_BREAK 0x10
#define AF_DECIMAL 0x08
#define AF_INTERRUPT 0x04
#define AF_ZERO 0x02
#define AF_CARRY 0x01
#define SHORTOPCODES 22
#define BENCHOPCODES 33
@ -137,7 +147,6 @@ static volatile UINT32 g_bmNMI = 0;
static volatile BOOL g_bNmiFlank = FALSE; // Positive going flank on NMI line
static bool g_irqDefer1Opcode = false;
static bool g_interruptInLastExecutionBatch = false; // Last batch of executed cycles included an interrupt (IRQ/NMI)
//
@ -184,11 +193,6 @@ void SetActiveCpu(eCpuType cpu)
g_ActiveCPU = cpu;
}
bool IsIrqAsserted(void)
{
return g_bmIRQ ? true : false;
}
bool Is6502InterruptEnabled(void)
{
return !(regs.ps & AF_INTERRUPT);
@ -199,11 +203,6 @@ void ResetCyclesExecutedForDebugger(void)
g_nCyclesExecuted = 0;
}
bool IsInterruptInLastExecution(void)
{
return g_interruptInLastExecutionBatch;
}
//
#include "CPU/cpu_general.inl"
@ -265,8 +264,7 @@ static __forceinline void DoIrqProfiling(DWORD uCycles)
#ifdef USE_SPEECH_API
const USHORT COUT1 = 0xFDF0; // GH#934 - ProDOS: COUT1 better than using COUT/$FDED
const USHORT BASICOUT = 0xC307; // GH#934 - 80COL: use BASICOUT
const USHORT COUT = 0xFDED;
const UINT OUTPUT_BUFFER_SIZE = 256;
char g_OutputBuffer[OUTPUT_BUFFER_SIZE+1+1]; // +1 for EOL, +1 for NULL
@ -339,7 +337,9 @@ static void DebugHddEntrypoint(const USHORT PC)
if (!bOldPCAtC7xx /*&& PC != 0xc70a*/)
{
Count++;
LogOutput("HDD Entrypoint: $%04X\n", PC);
char szDebug[100];
sprintf(szDebug, "HDD Entrypoint: $%04X\n", PC);
OutputDebugString(szDebug);
}
bOldPCAtC7xx = true;
@ -365,7 +365,7 @@ static __forceinline void Fetch(BYTE& iOpcode, ULONG uExecutedCycles)
: *(mem+PC);
#ifdef USE_SPEECH_API
if ((PC == COUT1 || PC == BASICOUT) && g_Speech.IsEnabled() && !g_bFullSpeed)
if (PC == COUT && g_Speech.IsEnabled() && !g_bFullSpeed)
CaptureCOUT();
#endif
@ -373,29 +373,25 @@ static __forceinline void Fetch(BYTE& iOpcode, ULONG uExecutedCycles)
}
//#define ENABLE_NMI_SUPPORT // Not used - so don't enable
static __forceinline bool NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
static __forceinline void NMI(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
{
#ifdef ENABLE_NMI_SUPPORT
if (!g_bNmiFlank)
return false;
// NMI signals are only serviced once
g_bNmiFlank = FALSE;
if(g_bNmiFlank)
{
// NMI signals are only serviced once
g_bNmiFlank = FALSE;
#ifdef _DEBUG
g_nCycleIrqStart = g_nCumulativeCycles + uExecutedCycles;
g_nCycleIrqStart = g_nCumulativeCycles + uExecutedCycles;
#endif
PUSH(regs.pc >> 8)
PUSH(regs.pc & 0xFF)
EF_TO_AF
PUSH(regs.ps & ~AF_BREAK)
regs.ps = regs.ps | AF_INTERRUPT & ~AF_DECIMAL;
regs.pc = * (WORD*) (mem+0xFFFA);
UINT uExtraCycles = 0; // Needed for CYC(a) macro
CYC(7);
g_interruptInLastExecutionBatch = true;
return true;
#else
return false;
PUSH(regs.pc >> 8)
PUSH(regs.pc & 0xFF)
EF_TO_AF
PUSH(regs.ps & ~AF_BREAK)
regs.ps = regs.ps | AF_INTERRUPT & ~AF_DECIMAL;
regs.pc = * (WORD*) (mem+0xFFFA);
UINT uExtraCycles = 0; // Needed for CYC(a) macro
CYC(7)
}
#endif
}
@ -407,18 +403,16 @@ static __forceinline void CheckSynchronousInterruptSources(UINT cycles, ULONG uE
// NB. No need to save to save-state, as IRQ() follows CheckSynchronousInterruptSources(), and IRQ() always sets it to false.
bool g_irqOnLastOpcodeCycle = false;
static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
static __forceinline void IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn, BOOL& flagv, BOOL& flagz)
{
bool irqTaken = false;
if (g_bmIRQ && !(regs.ps & AF_INTERRUPT))
if(g_bmIRQ && !(regs.ps & AF_INTERRUPT))
{
// if interrupt (eg. from 6522) occurs on opcode's last cycle, then defer IRQ by 1 opcode
// if 6522 interrupt occurs on opcode's last cycle, then defer IRQ by 1 opcode
if (g_irqOnLastOpcodeCycle && !g_irqDefer1Opcode)
{
g_irqOnLastOpcodeCycle = false;
g_irqDefer1Opcode = true; // if INT occurs again on next opcode, then do NOT defer
return false;
return;
}
g_irqDefer1Opcode = false;
@ -434,22 +428,14 @@ static __forceinline bool IRQ(ULONG& uExecutedCycles, BOOL& flagc, BOOL& flagn,
regs.ps = (regs.ps | AF_INTERRUPT) & (~AF_DECIMAL);
regs.pc = * (WORD*) (mem+0xFFFE);
UINT uExtraCycles = 0; // Needed for CYC(a) macro
CYC(7);
CYC(7)
#if defined(_DEBUG) && LOG_IRQ_TAKEN_AND_RTI
std::string irq6522;
MB_Get6522IrqDescription(irq6522);
const char* pSrc = (g_bmIRQ & 1) ? irq6522.c_str() :
(g_bmIRQ & 2) ? "SPEECH" :
(g_bmIRQ & 4) ? "SSC" :
(g_bmIRQ & 8) ? "MOUSE" : "UNKNOWN";
LogOutput("IRQ (%08X) (%s)\n", (UINT)g_nCycleIrqStart, pSrc);
LogOutput("IRQ\n");
#endif
g_interruptInLastExecutionBatch = true;
irqTaken = true;
CheckSynchronousInterruptSources(7, uExecutedCycles);
}
g_irqOnLastOpcodeCycle = false;
return irqTaken;
}
//===========================================================================
@ -555,6 +541,17 @@ void CpuWrite(USHORT addr, BYTE value, ULONG uExecutedCycles)
//===========================================================================
void CpuDestroy ()
{
if (g_bCritSectionValid)
{
DeleteCriticalSection(&g_CriticalSection);
g_bCritSectionValid = false;
}
}
//===========================================================================
// Description:
// Call this when an IO-reg is accessed & accurate cycle info is needed
// NB. Safe to call multiple times from the same IO function handler (as 'nExecutedCycles - g_nCyclesExecuted' will be zero the 2nd time)
@ -607,7 +604,6 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
#endif
g_nCyclesExecuted = 0;
g_interruptInLastExecutionBatch = false;
#ifdef _DEBUG
MB_CheckCumulativeCycles();
@ -618,10 +614,9 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
// >0 : Do multi-opcode emulation
const DWORD uExecutedCycles = InternalCpuExecute(uCycles, bVideoUpdate);
// Update 6522s (NB. Do this before updating g_nCumulativeCycles below)
// . Ensures that 6522 regs are up-to-date for any potential save-state
// . SyncEvent will trigger the 6522 TIMER1/2 underflow on the correct cycle
MB_UpdateCycles(uExecutedCycles);
// NB. Required for normal-speed (even though 6522 is updated after every opcode), as may've finished on IRQ()
MB_UpdateCycles(uExecutedCycles); // Update 6522s (NB. Do this before updating g_nCumulativeCycles below)
// NB. Ensures that 6522 regs are up-to-date for any potential save-state
const UINT nRemainingCycles = uExecutedCycles - g_nCyclesExecuted;
g_nCumulativeCycles += nRemainingCycles;
@ -631,31 +626,15 @@ DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate)
//===========================================================================
// Called by:
// . CpuInitialize()
// . SY6522.Reset()
void CpuCreateCriticalSection(void)
void CpuInitialize ()
{
if (!g_bCritSectionValid)
{
InitializeCriticalSection(&g_CriticalSection);
g_bCritSectionValid = true;
}
}
//===========================================================================
// Called from RepeatInitialization():
// . MemInitialize() -> MemReset()
void CpuInitialize(void)
{
regs.a = regs.x = regs.y = 0xFF;
CpuDestroy();
regs.a = regs.x = regs.y = regs.ps = 0xFF;
regs.sp = 0x01FF;
CpuReset(); // Init's ps & pc. Updates sp
CpuReset();
CpuCreateCriticalSection();
InitializeCriticalSection(&g_CriticalSection);
g_bCritSectionValid = true;
CpuIrqReset();
CpuNmiReset();
@ -665,36 +644,6 @@ void CpuInitialize(void)
//===========================================================================
void CpuDestroy()
{
if (g_bCritSectionValid)
{
DeleteCriticalSection(&g_CriticalSection);
g_bCritSectionValid = false;
}
}
//===========================================================================
void CpuReset()
{
_ASSERT(mem != NULL);
// 7 cycles
regs.ps = (regs.ps | AF_INTERRUPT) & ~AF_DECIMAL;
regs.pc = *(WORD*)(mem + 0xFFFC);
regs.sp = 0x0100 | ((regs.sp - 3) & 0xFF);
regs.bJammed = 0;
g_irqDefer1Opcode = false;
SetActiveCpu(GetMainCpu());
z80_reset();
}
//===========================================================================
void CpuSetupBenchmark ()
{
regs.a = 0;
@ -784,6 +733,23 @@ void CpuNmiDeassert(eIRQSRC Device)
//===========================================================================
void CpuReset()
{
// 7 cycles
regs.ps = (regs.ps | AF_INTERRUPT) & ~AF_DECIMAL;
regs.pc = * (WORD*) (mem+0xFFFC);
regs.sp = 0x0100 | ((regs.sp - 3) & 0xFF);
regs.bJammed = 0;
g_irqDefer1Opcode = false;
SetActiveCpu( GetMainCpu() );
z80_reset();
}
//===========================================================================
#define SS_YAML_KEY_CPU_TYPE "Type"
#define SS_YAML_KEY_REGA "A"
#define SS_YAML_KEY_REGX "X"
@ -797,7 +763,7 @@ void CpuNmiDeassert(eIRQSRC Device)
#define SS_YAML_VALUE_6502 "6502"
#define SS_YAML_VALUE_65C02 "65C02"
static const std::string& CpuGetSnapshotStructName(void)
static std::string CpuGetSnapshotStructName(void)
{
static const std::string name("CPU");
return name;
@ -828,7 +794,7 @@ void CpuLoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
eCpuType cpu;
if (cpuType == SS_YAML_VALUE_6502) cpu = CPU_6502;
else if (cpuType == SS_YAML_VALUE_65C02) cpu = CPU_65C02;
else throw std::runtime_error("Load: Unknown main CPU type");
else throw std::string("Load: Unknown main CPU type");
SetMainCpu(cpu);
regs.a = (BYTE) yamlLoadHelper.LoadUint(SS_YAML_KEY_REGA);

View file

@ -13,18 +13,6 @@ struct regsrec
BYTE bJammed; // CPU has crashed (NMOS 6502 only)
};
// 6502 Processor Status flags
enum {
AF_SIGN = 0x80,
AF_OVERFLOW = 0x40,
AF_RESERVED = 0x20,
AF_BREAK = 0x10,
AF_DECIMAL = 0x08,
AF_INTERRUPT = 0x04,
AF_ZERO = 0x02,
AF_CARRY = 0x01
};
extern regsrec regs;
extern unsigned __int64 g_nCumulativeCycles;
@ -32,8 +20,7 @@ void CpuDestroy ();
void CpuCalcCycles(ULONG nExecutedCycles);
DWORD CpuExecute(const DWORD uCycles, const bool bVideoUpdate);
ULONG CpuGetCyclesThisVideoFrame(ULONG nExecutedCycles);
void CpuCreateCriticalSection(void);
void CpuInitialize(void);
void CpuInitialize ();
void CpuSetupBenchmark ();
void CpuIrqReset();
void CpuIrqAssert(eIRQSRC Device);
@ -57,7 +44,5 @@ void SetMainCpuDefault(eApple2Type apple2Type);
eCpuType GetActiveCpu(void);
void SetActiveCpu(eCpuType cpu);
bool IsIrqAsserted(void);
bool Is6502InterruptEnabled(void);
void ResetCyclesExecutedForDebugger(void);
bool IsInterruptInLastExecution(void);

View file

@ -50,10 +50,6 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
{
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
}
else if (NMI(uExecutedCycles, flagc, flagn, flagv, flagz) || IRQ(uExecutedCycles, flagc, flagn, flagv, flagz))
{
// Allow AppleWin debugger's single-stepping to just step the pending IRQ
}
else
{
HEATMAP_X( regs.pc );
@ -322,6 +318,8 @@ static DWORD Cpu6502(DWORD uTotalCycles, const bool bVideoUpdate)
}
CheckSynchronousInterruptSources(uExecutedCycles - uPreviousCycles, uExecutedCycles);
NMI(uExecutedCycles, flagc, flagn, flagv, flagz);
IRQ(uExecutedCycles, flagc, flagn, flagv, flagz);
// NTSC_BEGIN
if (bVideoUpdate)

View file

@ -50,10 +50,6 @@ static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate)
{
const UINT uZ80Cycles = z80_mainloop(uTotalCycles, uExecutedCycles); CYC(uZ80Cycles)
}
else if (NMI(uExecutedCycles, flagc, flagn, flagv, flagz) || IRQ(uExecutedCycles, flagc, flagn, flagv, flagz))
{
// Allow AppleWin debugger's single-stepping to just step the pending IRQ
}
else
{
HEATMAP_X( regs.pc );
@ -322,6 +318,8 @@ static DWORD Cpu65C02(DWORD uTotalCycles, const bool bVideoUpdate)
}
CheckSynchronousInterruptSources(uExecutedCycles - uPreviousCycles, uExecutedCycles);
NMI(uExecutedCycles, flagc, flagn, flagv, flagz);
IRQ(uExecutedCycles, flagc, flagn, flagv, flagz);
// NTSC_BEGIN
if ( bVideoUpdate )

View file

@ -87,11 +87,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
else { \
memdirty[addr >> 8] = 0xFF; \
LPBYTE page = memwrite[addr >> 8]; \
if (page) { \
if (page) \
*(page+(addr & 0xFF)) = (BYTE)(a); \
if (memVidHD) /* GH#997 */\
*(memVidHD + addr) = (BYTE)(a); \
} \
else if ((addr & 0xF000) == 0xC000) \
IOWrite[(addr>>4) & 0xFF](regs.pc,addr,1,(BYTE)(a),uExecutedCycles);\
} \

View file

@ -1,255 +0,0 @@
/*
AppleWin : An Apple //e emulator for Windows
Copyright (C) 2021, Tom Charlesworth, Michael Pohoreski
AppleWin is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
AppleWin is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with AppleWin; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "StdAfx.h"
#include "Card.h"
#include "Uthernet1.h"
#include "Uthernet2.h"
#include "Mockingboard.h"
#include "ParallelPrinter.h"
#include "z80emu.h"
#include "FourPlay.h"
#include "Joystick.h"
#include "LanguageCard.h"
#include "MouseInterface.h"
#include "SAM.h"
#include "SerialComms.h"
#include "SNESMAX.h"
#include "VidHD.h"
#include <sstream>
void Card::ThrowErrorInvalidSlot()
{
ThrowErrorInvalidSlot(m_type, m_slot);
}
void Card::ThrowErrorInvalidSlot(SS_CARDTYPE type, UINT slot)
{
std::ostringstream msg;
msg << "The card '" << GetCardName(type);
msg << "' is not allowed in Slot " << slot << ".";
throw std::runtime_error(msg.str());
}
void Card::ThrowErrorInvalidVersion(UINT version)
{
ThrowErrorInvalidVersion(m_type, version);
}
void Card::ThrowErrorInvalidVersion(SS_CARDTYPE type, UINT version)
{
std::ostringstream msg;
msg << "Version " << version;
msg << " is not supported for card '" << GetCardName(type) << "'.";
throw std::runtime_error(msg.str());
}
void DummyCard::InitializeIO(LPBYTE pCxRomPeripheral)
{
switch (QueryType())
{
case CT_GenericClock:
break; // nothing to do
case CT_MockingboardC:
case CT_Phasor:
// only in slot 4
if (m_slot == SLOT4)
{
MB_InitializeIO(pCxRomPeripheral, SLOT4, SLOT5);
}
break;
case CT_Z80:
Z80_InitializeIO(pCxRomPeripheral, m_slot);
break;
}
}
void DummyCard::Update(const ULONG nExecutedCycles)
{
switch (QueryType())
{
case CT_MockingboardC:
case CT_Phasor:
// only in slot 4
if (m_slot == SLOT4)
{
MB_PeriodicUpdate(nExecutedCycles);
}
break;
}
}
void DummyCard::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
{
switch (QueryType())
{
case CT_MockingboardC:
MB_SaveSnapshot(yamlSaveHelper, m_slot);
break;
case CT_Phasor:
Phasor_SaveSnapshot(yamlSaveHelper, m_slot);
break;
case CT_Z80:
Z80_SaveSnapshot(yamlSaveHelper, m_slot);
break;
}
}
bool DummyCard::LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version)
{
switch (QueryType())
{
case CT_MockingboardC:
return MB_LoadSnapshot(yamlLoadHelper, m_slot, version);
case CT_Phasor:
return Phasor_LoadSnapshot(yamlLoadHelper, m_slot, version);
case CT_Z80:
return Z80_LoadSnapshot(yamlLoadHelper, m_slot, version);
}
return false;
}
std::string Card::GetCardName(void)
{
return GetCardName(m_type);
}
std::string Card::GetCardName(const SS_CARDTYPE cardType)
{
switch (cardType)
{
case CT_Empty:
return "Empty";
case CT_LanguageCard:
return LanguageCardSlot0::GetSnapshotCardName();
case CT_Saturn128K:
return Saturn128K::GetSnapshotCardName();
case CT_Disk2:
return Disk2InterfaceCard::GetSnapshotCardName();
case CT_SSC:
return CSuperSerialCard::GetSnapshotCardName();
case CT_MockingboardC:
return MB_GetSnapshotCardName();
case CT_GenericPrinter:
return ParallelPrinterCard::GetSnapshotCardName();
case CT_GenericHDD:
return HarddiskInterfaceCard::GetSnapshotCardName();
case CT_GenericClock:
return "Clock";
case CT_MouseInterface:
return CMouseInterface::GetSnapshotCardName();
case CT_Z80:
return Z80_GetSnapshotCardName();
case CT_Phasor:
return Phasor_GetSnapshotCardName();
case CT_Echo:
return "Echo";
case CT_SAM:
return SAMCard::GetSnapshotCardName();
case CT_Uthernet:
return Uthernet1::GetSnapshotCardName();
case CT_FourPlay:
return FourPlayCard::GetSnapshotCardName();
case CT_SNESMAX:
return SNESMAXCard::GetSnapshotCardName();
case CT_VidHD:
return VidHDCard::GetSnapshotCardName();
case CT_Uthernet2:
return Uthernet2::GetSnapshotCardName();
default:
return "Unknown";
}
}
SS_CARDTYPE Card::GetCardType(const std::string & card)
{
if (card == ParallelPrinterCard::GetSnapshotCardName())
{
return CT_GenericPrinter;
}
else if (card == CSuperSerialCard::GetSnapshotCardName())
{
return CT_SSC;
}
else if (card == CMouseInterface::GetSnapshotCardName())
{
return CT_MouseInterface;
}
else if (card == Z80_GetSnapshotCardName())
{
return CT_Z80;
}
else if (card == MB_GetSnapshotCardName())
{
return CT_MockingboardC;
}
else if (card == Phasor_GetSnapshotCardName())
{
return CT_Phasor;
}
else if (card == SAMCard::GetSnapshotCardName())
{
return CT_SAM;
}
else if (card == Disk2InterfaceCard::GetSnapshotCardName())
{
return CT_Disk2;
}
else if (card == HarddiskInterfaceCard::GetSnapshotCardName())
{
return CT_GenericHDD;
}
else if (card == Uthernet1::GetSnapshotCardName())
{
return CT_Uthernet;
}
else if (card == LanguageCardSlot0::GetSnapshotCardName())
{
return CT_LanguageCard;
}
else if (card == Saturn128K::GetSnapshotCardName())
{
return CT_Saturn128K;
}
else if (card == FourPlayCard::GetSnapshotCardName())
{
return CT_FourPlay;
}
else if (card == SNESMAXCard::GetSnapshotCardName())
{
return CT_SNESMAX;
}
else if (card == VidHDCard::GetSnapshotCardName())
{
return CT_VidHD;
}
else if (card == Uthernet2::GetSnapshotCardName())
{
return CT_Uthernet2;
}
else
{
throw std::runtime_error("Slots: Unknown card: " + card); // todo: don't throw - just ignore & continue
}
}

View file

@ -21,46 +21,21 @@ enum SS_CARDTYPE
CT_LanguageCard, // Apple][ or ][+ in slot-0
CT_LanguageCardIIe, // Apple//e LC instance (not a card)
CT_Saturn128K, // Saturn 128K (but may be populated with less RAM, in multiples of 16K)
CT_FourPlay, // 4 port Atari 2600 style digital joystick card
CT_SNESMAX, // 2 port Nintendo NES/SNES controller serial interface card
CT_VidHD,
CT_Uthernet2,
};
enum SLOTS { SLOT0=0, SLOT1, SLOT2, SLOT3, SLOT4, SLOT5, SLOT6, SLOT7, NUM_SLOTS, SLOT_AUX };
class YamlSaveHelper;
class YamlLoadHelper;
enum SLOTS { SLOT0=0, SLOT1, SLOT2, SLOT3, SLOT4, SLOT5, SLOT6, SLOT7 };
class Card
{
public:
Card(SS_CARDTYPE type, UINT slot) : m_type(type), m_slot(slot) {}
Card(void) : m_type(CT_Empty) {}
Card(SS_CARDTYPE type) : m_type(type) {}
virtual ~Card(void) {}
virtual void InitializeIO(LPBYTE pCxRomPeripheral) = 0;
virtual void Destroy() = 0;
virtual void Init(void) = 0;
virtual void Reset(const bool powerCycle) = 0;
virtual void Update(const ULONG nExecutedCycles) = 0;
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) = 0;
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) = 0;
SS_CARDTYPE QueryType(void) { return m_type; }
std::string GetCardName(void);
static std::string GetCardName(const SS_CARDTYPE cardType);
static SS_CARDTYPE GetCardType(const std::string & card);
// static versions for non-Card cards
static void ThrowErrorInvalidSlot(SS_CARDTYPE type, UINT slot);
static void ThrowErrorInvalidVersion(SS_CARDTYPE type, UINT version);
protected:
UINT m_slot;
void ThrowErrorInvalidSlot();
void ThrowErrorInvalidVersion(UINT version);
private:
SS_CARDTYPE m_type;
};
@ -70,15 +45,11 @@ private:
class EmptyCard : public Card
{
public:
EmptyCard(UINT slot) : Card(CT_Empty, slot) {}
EmptyCard(void) {}
virtual ~EmptyCard(void) {}
virtual void InitializeIO(LPBYTE pCxRomPeripheral) {}
virtual void Destroy() {}
virtual void Reset(const bool powerCycle) {}
virtual void Update(const ULONG nExecutedCycles) {}
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper) {}
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version) { _ASSERT(0); return false; }
virtual void Init(void) {};
virtual void Reset(const bool powerCycle) {};
};
//
@ -86,13 +57,9 @@ public:
class DummyCard : public Card // For cards that currently can't be instantiated (ie. don't exist as a class)
{
public:
DummyCard(SS_CARDTYPE type, UINT slot) : Card(type, slot) {}
DummyCard(SS_CARDTYPE type) : Card(type) {}
virtual ~DummyCard(void) {}
virtual void InitializeIO(LPBYTE pCxRomPeripheral);
virtual void Destroy() {}
virtual void Reset(const bool powerCycle) {}
virtual void Update(const ULONG nExecutedCycles);
virtual void SaveSnapshot(YamlSaveHelper& yamlSaveHelper);
virtual bool LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT version);
virtual void Init(void) {};
virtual void Reset(const bool powerCycle) {};
};

View file

@ -31,31 +31,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "CardManager.h"
#include "Core.h"
#include "Registry.h"
#include "Disk.h"
#include "FourPlay.h"
#include "Harddisk.h"
#include "MouseInterface.h"
#include "ParallelPrinter.h"
#include "SAM.h"
#include "SerialComms.h"
#include "SNESMAX.h"
#include "Uthernet1.h"
#include "Uthernet2.h"
#include "VidHD.h"
#include "LanguageCard.h"
#include "Memory.h"
void CardManager::InsertInternal(UINT slot, SS_CARDTYPE type)
void CardManager::Insert(UINT slot, SS_CARDTYPE type)
{
if (type == CT_Empty)
return Remove(slot);
RemoveInternal(slot);
switch (type)
{
case CT_Empty:
m_slot[slot] = new EmptyCard(slot);
break;
case CT_Disk2:
m_slot[slot] = new Disk2InterfaceCard(slot);
break;
@ -65,18 +54,16 @@ void CardManager::InsertInternal(UINT slot, SS_CARDTYPE type)
m_slot[slot] = m_pSSC = new CSuperSerialCard(slot);
break;
case CT_MockingboardC:
m_slot[slot] = new DummyCard(type, slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_GenericPrinter:
_ASSERT(m_pParallelPrinterCard == NULL);
if (m_pParallelPrinterCard) break; // Only support one Printer card
m_slot[slot] = m_pParallelPrinterCard = new ParallelPrinterCard(slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_GenericHDD:
m_slot[slot] = new HarddiskInterfaceCard(slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_GenericClock:
m_slot[slot] = new DummyCard(type, slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_MouseInterface:
_ASSERT(m_pMouseCard == NULL);
@ -84,116 +71,78 @@ void CardManager::InsertInternal(UINT slot, SS_CARDTYPE type)
m_slot[slot] = m_pMouseCard = new CMouseInterface(slot);
break;
case CT_Z80:
m_slot[slot] = new DummyCard(type, slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_Phasor:
m_slot[slot] = new DummyCard(type, slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_Echo:
m_slot[slot] = new DummyCard(type, slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_SAM:
m_slot[slot] = new SAMCard(slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_Uthernet:
m_slot[slot] = new Uthernet1(slot);
break;
case CT_FourPlay:
m_slot[slot] = new FourPlayCard(slot);
break;
case CT_SNESMAX:
m_slot[slot] = new SNESMAXCard(slot);
break;
case CT_VidHD:
m_slot[slot] = new VidHDCard(slot);
break;
case CT_Uthernet2:
m_slot[slot] = new Uthernet2(slot);
m_slot[slot] = new DummyCard(type);
break;
case CT_LanguageCard:
_ASSERT(m_pLanguageCard == NULL);
if (m_pLanguageCard) break; // Only support one language card
m_slot[slot] = m_pLanguageCard = LanguageCardSlot0::create(slot);
break;
case CT_Saturn128K:
_ASSERT(m_pLanguageCard == NULL);
if (m_pLanguageCard) break; // Only support one language card
m_slot[slot] = m_pLanguageCard = new Saturn128K(slot, Saturn128K::GetSaturnMemorySize());
break;
case CT_LanguageCardIIe:
_ASSERT(m_pLanguageCard == NULL);
if (m_pLanguageCard) break; // Only support one language card
m_slot[slot] = m_pLanguageCard = LanguageCardUnit::create(slot);
{
if (slot != 0)
{
_ASSERT(0);
break;
}
}
m_slot[slot] = new DummyCard(type);
break;
case CT_LanguageCardIIe: // not a card
default:
_ASSERT(0);
break;
}
if (m_slot[slot] == NULL)
Remove(slot); // creates a new EmptyCard
}
void CardManager::Insert(UINT slot, SS_CARDTYPE type, bool updateRegistry/*=true*/)
{
InsertInternal(slot, type);
if (updateRegistry)
RegSetConfigSlotNewCardType(slot, type);
m_slot[slot] = new EmptyCard;
}
void CardManager::RemoveInternal(UINT slot)
{
if (m_slot[slot])
{
// NB. object deleted below: delete m_slot[slot]
switch (m_slot[slot]->QueryType())
{
case CT_MouseInterface:
m_pMouseCard = NULL;
break;
case CT_SSC:
m_pSSC = NULL;
break;
case CT_GenericPrinter:
m_pParallelPrinterCard = NULL;
break;
case CT_LanguageCard:
case CT_Saturn128K:
case CT_LanguageCardIIe:
m_pLanguageCard = NULL;
break;
}
if (m_slot[slot] && m_slot[slot]->QueryType() == CT_MouseInterface)
m_pMouseCard = NULL;
UnregisterIoHandler(slot);
delete m_slot[slot];
m_slot[slot] = NULL;
}
if (m_slot[slot] && m_slot[slot]->QueryType() == CT_SSC)
m_pSSC = NULL;
delete m_slot[slot];
m_slot[slot] = NULL;
}
void CardManager::Remove(UINT slot, bool updateRegistry/*=true*/)
void CardManager::Remove(UINT slot)
{
Insert(slot, CT_Empty, updateRegistry);
RemoveInternal(slot);
m_slot[slot] = new EmptyCard;
}
void CardManager::InsertAuxInternal(SS_CARDTYPE type)
void CardManager::InsertAux(SS_CARDTYPE type)
{
if (type == CT_Empty)
return RemoveAux();
RemoveAuxInternal();
switch (type)
{
case CT_Empty:
m_aux = new EmptyCard(SLOT_AUX);
break;
case CT_80Col:
m_aux = new DummyCard(type, SLOT_AUX);
m_aux = new DummyCard(type);
break;
case CT_Extended80Col:
m_aux = new DummyCard(type, SLOT_AUX);
m_aux = new DummyCard(type);
break;
case CT_RamWorksIII:
m_aux = new DummyCard(type, SLOT_AUX);
m_aux = new DummyCard(type);
break;
default:
_ASSERT(0);
@ -202,14 +151,6 @@ void CardManager::InsertAuxInternal(SS_CARDTYPE type)
// for consistency m_aux must never be NULL
_ASSERT(m_aux != NULL);
if (m_aux == NULL)
RemoveAux(); // creates a new EmptyCard
}
void CardManager::InsertAux(SS_CARDTYPE type)
{
InsertAuxInternal(type);
RegSetConfigSlotNewCardType(SLOT_AUX, type);
}
void CardManager::RemoveAuxInternal()
@ -220,63 +161,6 @@ void CardManager::RemoveAuxInternal()
void CardManager::RemoveAux(void)
{
InsertAux(CT_Empty);
}
void CardManager::InitializeIO(LPBYTE pCxRomPeripheral)
{
// if it is a //e then SLOT0 must be CT_LanguageCardIIe (and the other way round)
_ASSERT(IsApple2PlusOrClone(GetApple2Type()) != (m_slot[SLOT0]->QueryType() == CT_LanguageCardIIe));
for (UINT i = SLOT0; i < NUM_SLOTS; ++i)
{
if (m_slot[i])
{
m_slot[i]->InitializeIO(pCxRomPeripheral);
}
}
}
void CardManager::Update(const ULONG nExecutedCycles)
{
for (UINT i = SLOT0; i < NUM_SLOTS; ++i)
{
if (m_slot[i])
{
m_slot[i]->Update(nExecutedCycles);
}
}
}
void CardManager::SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
{
for (UINT i = SLOT0; i < NUM_SLOTS; ++i)
{
if (m_slot[i])
{
m_slot[i]->SaveSnapshot(yamlSaveHelper);
}
}
}
void CardManager::Reset(const bool powerCycle)
{
for (UINT i = SLOT0; i < NUM_SLOTS; ++i)
{
if (m_slot[i])
{
m_slot[i]->Reset(powerCycle);
}
}
}
void CardManager::Destroy()
{
for (UINT i = SLOT0; i < NUM_SLOTS; ++i)
{
if (m_slot[i])
{
m_slot[i]->Destroy();
}
}
RemoveAuxInternal();
m_aux = new EmptyCard;
}

View file

@ -9,19 +9,17 @@ class CardManager
public:
CardManager(void) :
m_pMouseCard(NULL),
m_pSSC(NULL),
m_pLanguageCard(NULL),
m_pParallelPrinterCard(NULL)
m_pSSC(NULL)
{
InsertInternal(SLOT0, CT_Empty);
InsertInternal(SLOT1, CT_GenericPrinter);
InsertInternal(SLOT2, CT_SSC);
InsertInternal(SLOT3, CT_Empty);
InsertInternal(SLOT4, CT_Empty);
InsertInternal(SLOT5, CT_Empty);
InsertInternal(SLOT6, CT_Disk2);
InsertInternal(SLOT7, CT_Empty);
InsertAuxInternal(CT_Extended80Col); // For Apple //e and above
Insert(0, CT_Empty);
Insert(1, CT_GenericPrinter);
Insert(2, CT_SSC);
Insert(3, CT_Uthernet);
Insert(4, CT_Empty);
Insert(5, CT_Empty);
Insert(6, CT_Disk2);
Insert(7, CT_Empty);
InsertAux(CT_Extended80Col); // For Apple //e and above
}
~CardManager(void)
{
@ -30,18 +28,15 @@ public:
RemoveAuxInternal();
}
void Insert(UINT slot, SS_CARDTYPE type, bool updateRegistry = true);
void Remove(UINT slot, bool updateRegistry = true);
void Insert(UINT slot, SS_CARDTYPE type);
void Remove(UINT slot);
SS_CARDTYPE QuerySlot(UINT slot) { _ASSERT(slot<NUM_SLOTS); return m_slot[slot]->QueryType(); }
Card& GetRef(UINT slot)
{
_ASSERT(m_slot[slot]);
SS_CARDTYPE t=QuerySlot(slot); _ASSERT((t==CT_SSC || t==CT_MouseInterface || t==CT_Disk2) && m_slot[slot]);
return *m_slot[slot];
}
Card* GetObj(UINT slot)
{
return m_slot[slot];
}
Card* GetObj(UINT slot) { SS_CARDTYPE t=QuerySlot(slot); _ASSERT(t==CT_SSC || t==CT_MouseInterface || t==CT_Disk2); return m_slot[slot]; }
void InsertAux(SS_CARDTYPE type);
void RemoveAux(void);
@ -55,20 +50,8 @@ public:
bool IsMouseCardInstalled(void) { return m_pMouseCard != NULL; }
class CSuperSerialCard* GetSSC(void) { return m_pSSC; }
bool IsSSCInstalled(void) { return m_pSSC != NULL; }
class ParallelPrinterCard* GetParallelPrinterCard(void) { return m_pParallelPrinterCard; }
bool IsParallelPrinterCardInstalled(void) { return m_pParallelPrinterCard != NULL; }
class LanguageCardUnit* GetLanguageCard(void) { return m_pLanguageCard; }
void InitializeIO(LPBYTE pCxRomPeripheral);
void Reset(const bool powerCycle);
void Destroy();
void Update(const ULONG nExecutedCycles);
void SaveSnapshot(YamlSaveHelper& yamlSaveHelper);
private:
void InsertInternal(UINT slot, SS_CARDTYPE type);
void InsertAuxInternal(SS_CARDTYPE type);
void RemoveInternal(UINT slot);
void RemoveAuxInternal(void);
@ -77,6 +60,4 @@ private:
Disk2CardManager m_disk2CardMgr;
class CMouseInterface* m_pMouseCard;
class CSuperSerialCard* m_pSSC;
class LanguageCardUnit* m_pLanguageCard;
class ParallelPrinterCard* m_pParallelPrinterCard;
};

View file

@ -37,6 +37,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Joystick.h"
#include "SoundCore.h"
#include "ParallelPrinter.h"
#include "CardManager.h"
#include "SerialComms.h"
#include "Interface.h"
CmdLine g_cmdLine;
@ -50,7 +52,7 @@ bool g_bHookAltGrControl = false;
static LPSTR GetCurrArg(LPSTR lpCmdLine)
{
if (*lpCmdLine == '\"')
if(*lpCmdLine == '\"')
lpCmdLine++;
return lpCmdLine;
@ -60,9 +62,9 @@ static LPSTR GetNextArg(LPSTR lpCmdLine)
{
int bInQuotes = 0;
while (*lpCmdLine)
while(*lpCmdLine)
{
if (*lpCmdLine == '\"')
if(*lpCmdLine == '\"')
{
bInQuotes ^= 1;
if(!bInQuotes)
@ -72,12 +74,9 @@ static LPSTR GetNextArg(LPSTR lpCmdLine)
}
}
if ((*lpCmdLine == ' ') && !bInQuotes)
if((*lpCmdLine == ' ') && !bInQuotes)
{
*lpCmdLine++ = 0x00;
while (*lpCmdLine == ' ') // Skip multiple spaces between args
lpCmdLine++;
break;
}
@ -167,20 +166,6 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
g_cmdLine.bSlotEmpty[slot] = true;
if (strcmp(lpCmdLine, "diskii") == 0)
g_cmdLine.slotInsert[slot] = CT_Disk2;
if (strcmp(lpCmdLine, "parallel") == 0)
{
if (slot == SLOT1)
g_cmdLine.slotInsert[slot] = CT_GenericPrinter;
else
LogFileOutput("Parallel Printer card currently only supported in slot 1\n");
}
if (strcmp(lpCmdLine, "vidhd") == 0)
{
if (slot == SLOT3)
g_cmdLine.slotInsert[slot] = CT_VidHD;
else
LogFileOutput("VidHD currently only supported in slot 3\n");
}
}
else if (lpCmdLine[3] == 'd' && (lpCmdLine[4] == '1' || lpCmdLine[4] == '2')) // -s[1..7]d[1|2] <dsk-image>
{
@ -214,42 +199,35 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
}
else if (strcmp(lpCmdLine, "-f") == 0 || strcmp(lpCmdLine, "-full-screen") == 0)
{
g_cmdLine.setFullScreen = 1;
g_cmdLine.bSetFullScreen = true;
}
else if (strcmp(lpCmdLine, "-no-full-screen") == 0)
{
g_cmdLine.setFullScreen = 0;
}
#define CMD_FS_WIDTH "-fs-width="
else if (strncmp(lpCmdLine, CMD_FS_WIDTH, sizeof(CMD_FS_WIDTH)-1) == 0)
{
if (g_cmdLine.setFullScreen < 0) // Not yet been specified on cmd line?
g_cmdLine.setFullScreen = 1; // Implicity set full-screen. NB. Can be overridden by "-no-full-screen"
LPSTR lpTmp = lpCmdLine + sizeof(CMD_FS_WIDTH)-1;
{
g_cmdLine.userSpecifiedWidth = atoi(lpTmp);
if (!g_cmdLine.userSpecifiedWidth)
LogFileOutput("Invalid cmd-line parameter for -fs-width=x switch\n");
}
g_cmdLine.bSetFullScreen = false;
}
#define CMD_FS_HEIGHT "-fs-height="
else if (strncmp(lpCmdLine, CMD_FS_HEIGHT, sizeof(CMD_FS_HEIGHT)-1) == 0)
{
if (g_cmdLine.setFullScreen < 0) // Not yet been specified on cmd line?
g_cmdLine.setFullScreen = 1; // Implicity set full-screen. NB. Can be overridden by "-no-full-screen"
g_cmdLine.bSetFullScreen = true; // Implied. Can be overridden by "-no-full-screen"
LPSTR lpTmp = lpCmdLine + sizeof(CMD_FS_HEIGHT)-1;
bool bRes = false;
if (strcmp(lpTmp, "best") == 0)
{
g_cmdLine.bestFullScreenResolution = true;
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(g_cmdLine.bestWidth, g_cmdLine.bestHeight);
}
else
{
g_cmdLine.userSpecifiedHeight = atoi(lpTmp);
if (!g_cmdLine.userSpecifiedHeight)
UINT userSpecifiedHeight = atoi(lpTmp);
if (userSpecifiedHeight)
bRes = GetFrame().GetBestDisplayResolutionForFullScreen(g_cmdLine.bestWidth, g_cmdLine.bestHeight, userSpecifiedHeight);
else
LogFileOutput("Invalid cmd-line parameter for -fs-height=x switch\n");
}
if (bRes)
LogFileOutput("Best resolution for -fs-height=x switch: Width=%d, Height=%d\n", g_cmdLine.bestWidth, g_cmdLine.bestHeight);
else
LogFileOutput("Failed to set parameter for -fs-height=x switch\n");
}
else if (strcmp(lpCmdLine, "-no-di") == 0)
{
@ -332,7 +310,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
{
std::string msg = "Failed to load video rom (not found or not exactly 2/4/8/16KiB)\n";
LogFileOutput("%s", msg.c_str());
GetFrame().FrameMessageBox(msg.c_str(), TEXT("AppleWin Error"), MB_OK);
MessageBox(GetFrame().g_hFrameWindow, msg.c_str(), TEXT("AppleWin Error"), MB_OK);
}
else
{
@ -341,7 +319,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
}
else if (strcmp(lpCmdLine, "-printscreen") == 0) // Turn on display of the last filename print screen was saved to
{
GetFrame().SetDisplayPrintScreenFileName(true);
GetVideo().SetDisplayPrintScreenFileName(true);
}
else if (strcmp(lpCmdLine, "-no-printscreen-key") == 0) // Don't try to capture PrintScreen key GH#469
{
@ -349,7 +327,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
}
else if (strcmp(lpCmdLine, "-no-printscreen-dlg") == 0) // Turn off the PrintScreen warning message dialog (if PrintScreen key can't be grabbed)
{
GetFrame().SetShowPrintScreenWarningDialog(false);
GetVideo().SetShowPrintScreenWarningDialog(false);
}
else if (strcmp(lpCmdLine, "-no-hook-system-key") == 0) // Don't hook the System keys (eg. Left-ALT+ESC/SPACE/TAB) GH#556
{
@ -401,7 +379,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
}
else if (strcmp(lpCmdLine, "-use-real-printer") == 0) // Enable control in Advanced config to allow dumping to a real printer
{
g_cmdLine.enableDumpToRealPrinter = true;
g_bEnableDumpToRealPrinter = true;
}
else if (strcmp(lpCmdLine, "-speech") == 0)
{
@ -413,7 +391,8 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
}
else if ((strcmp(lpCmdLine, "-dcd") == 0) || (strcmp(lpCmdLine, "-modem") == 0)) // GH#386
{
g_cmdLine.supportDCD = true;
if (GetCardMgr().IsSSCInstalled())
GetCardMgr().GetSSC()->SupportDCD(true);
}
else if (strcmp(lpCmdLine, "-alt-enter=toggle-full-screen") == 0) // GH#556
{
@ -529,14 +508,6 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
{
g_cmdLine.bRemoveNoSlotClock = true;
}
else if (strcmp(lpCmdLine, "-snes-max-alt-joy1") == 0)
{
g_cmdLine.snesMaxAltControllerType[0] = true;
}
else if (strcmp(lpCmdLine, "-snes-max-alt-joy2") == 0)
{
g_cmdLine.snesMaxAltControllerType[1] = true;
}
else // unsupported
{
LogFileOutput("Unsupported arg: %s\n", lpCmdLine);
@ -557,7 +528,7 @@ bool ProcessCmdLine(LPSTR lpCmdLine)
msg += strUnsupported;
msg += "\n";
msg += "Continue running AppleWin?";
int res = GetFrame().FrameMessageBox(
int res = MessageBox(GetDesktopWindow(), // NB. g_hFrameWindow is not yet valid
msg.c_str(),
"AppleWin Command Line",
MB_ICONSTOP | MB_SETFOREGROUND | MB_YESNO);

View file

@ -1,6 +1,6 @@
#pragma once
#include "RGBMonitor.h"
#include "RgbMonitor.h"
#include "Harddisk.h"
#include "Disk.h"
#include "Common.h"
@ -12,16 +12,15 @@ struct CmdLine
CmdLine()
{
bShutdown = false;
setFullScreen = -1;
bSetFullScreen = false;
bBoot = false;
bChangedDisplayResolution = false;
bSlot0LanguageCard = false;
bSlot7EmptyOnExit = false;
bSwapButtons0and1 = false;
bRemoveNoSlotClock = false;
snesMaxAltControllerType[0] = false;
snesMaxAltControllerType[1] = false;
supportDCD = false;
enableDumpToRealPrinter = false;
bestWidth = 0;
bestHeight = 0;
szImageName_harddisk[HARDDISK_1] = NULL;
szImageName_harddisk[HARDDISK_2] = NULL;
szSnapshotName = NULL;
@ -37,9 +36,6 @@ struct CmdLine
rgbCard = RGB_Videocard_e::Apple;
rgbCardForegroundColor = 15;
rgbCardBackgroundColor = 0;
bestFullScreenResolution = false;
userSpecifiedWidth = 0;
userSpecifiedHeight = 0;
for (UINT i = 0; i < NUM_SLOTS; i++)
{
@ -53,20 +49,20 @@ struct CmdLine
}
bool bShutdown;
int setFullScreen; // tristate: -1 (no cmd line specified), 0="-no-full-screen", 1="-full-screen"
bool bSetFullScreen;
bool bBoot;
bool bChangedDisplayResolution;
bool bSlot0LanguageCard;
bool bSlotEmpty[NUM_SLOTS];
bool bSlot7EmptyOnExit;
bool bSwapButtons0and1;
bool bRemoveNoSlotClock;
bool snesMaxAltControllerType[2];
bool supportDCD;
bool enableDumpToRealPrinter;
SS_CARDTYPE slotInsert[NUM_SLOTS];
LPCSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES];
UINT bestWidth;
UINT bestHeight;
LPSTR szImageName_drive[NUM_SLOTS][NUM_DRIVES];
bool driveConnected[NUM_SLOTS][NUM_DRIVES];
LPCSTR szImageName_harddisk[NUM_HARDDISKS];
LPSTR szImageName_harddisk[NUM_HARDDISKS];
LPSTR szSnapshotName;
LPSTR szScreenshotFilename;
UINT uRamWorksExPages;
@ -81,9 +77,6 @@ struct CmdLine
int rgbCardForegroundColor;
int rgbCardBackgroundColor;
std::string strCurrentDir;
bool bestFullScreenResolution;
UINT userSpecifiedWidth;
UINT userSpecifiedHeight;
};
bool ProcessCmdLine(LPSTR lpCmdLine);

View file

@ -6,6 +6,8 @@ const double CLK_6502_NTSC = (_14M_NTSC * 65.0) / (65.0*14.0+2.0); // 65 cycles
const double CLK_6502_PAL = (_14M_PAL * 65.0) / (65.0*14.0+2.0);
//const double CLK_6502 = 23 * 44100; // 1014300
#define NUM_SLOTS 8
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
@ -72,7 +74,7 @@ enum AppMode_e
#define REGVALUE_MB_VOLUME "Mockingboard Volume"
#define REGVALUE_SAVESTATE_FILENAME "Save State Filename"
#define REGVALUE_SAVE_STATE_ON_EXIT "Save State On Exit"
#define REGVALUE_HDD_ENABLED "Harddisk Enable" // Deprecated from 1.30.5
#define REGVALUE_HDD_ENABLED "Harddisk Enable"
#define REGVALUE_JOYSTICK0_EMU_TYPE "Joystick0 Emu Type v3" // GH#434: Added at 1.26.3.0 (previously was "Joystick0 Emu Type")
#define REGVALUE_JOYSTICK1_EMU_TYPE "Joystick1 Emu Type v3" // GH#434: Added at 1.26.3.0 (previously was "Joystick1 Emu Type")
#define REGVALUE_OLD_JOYSTICK0_EMU_TYPE2 "Joystick0 Emu Type" // GH#434: Deprecated from 1.26.3.0 (previously was "Joystick 0 Emulation")
@ -90,6 +92,7 @@ enum AppMode_e
#define REGVALUE_MOUSE_RESTRICT_TO_WINDOW "Mouse restrict to window"
#define REGVALUE_THE_FREEZES_F8_ROM "The Freeze's F8 Rom"
#define REGVALUE_CIDERPRESSLOC "CiderPress Location"
#define REGVALUE_CPM_CONFIG "CPM Config"
#define REGVALUE_DUMP_TO_PRINTER "Dump to printer"
#define REGVALUE_CONVERT_ENCODING "Convert printer encoding for clones"
#define REGVALUE_FILTER_UNPRINTABLE "Filter unprintable characters"
@ -106,41 +109,40 @@ enum AppMode_e
#define REGVALUE_CUSTOM_SPEED "Custom Speed"
#define REGVALUE_EMULATION_SPEED "Emulation Speed"
#define REGVALUE_WINDOW_SCALE "Window Scale"
#define REGVALUE_UTHERNET_ACTIVE "Uthernet Active" // GH#977: Deprecated from 1.30.5
#define REGVALUE_UTHERNET_ACTIVE "Uthernet Active"
#define REGVALUE_UTHERNET_INTERFACE "Uthernet Interface"
#define REGVALUE_SLOT4 "Slot 4" // GH#977: Deprecated from 1.30.4
#define REGVALUE_SLOT5 "Slot 5" // GH#977: Deprecated from 1.30.4
#define REGVALUE_SLOT0 "Slot 0"
#define REGVALUE_SLOT1 "Slot 1"
#define REGVALUE_SLOT2 "Slot 2"
#define REGVALUE_SLOT3 "Slot 3"
#define REGVALUE_SLOT4 "Slot 4"
#define REGVALUE_SLOT5 "Slot 5"
#define REGVALUE_SLOT6 "Slot 6"
#define REGVALUE_SLOT7 "Slot 7"
#define REGVALUE_SLOTAUX "Slot Auxilary"
#define REGVALUE_VERSION "Version"
#define REG_CONFIG_SLOT_AUX "Slot Auxiliary"
#define REG_CONFIG_SLOT "Slot "
#define REGVALUE_CARD_TYPE "Card type"
#define REGVALUE_LAST_DISK_1 "Last Disk Image 1"
#define REGVALUE_LAST_DISK_2 "Last Disk Image 2"
#define REGVALUE_LAST_HARDDISK_1 "Last Harddisk Image 1"
#define REGVALUE_LAST_HARDDISK_2 "Last Harddisk Image 2"
// Preferences
#define REG_PREFS "Preferences"
#define REGVALUE_PREF_START_DIR "Starting Directory"
#define REGVALUE_PREF_LAST_DISK_1 "Last Disk Image 1"
#define REGVALUE_PREF_LAST_DISK_2 "Last Disk Image 2"
#define REGVALUE_PREF_WINDOW_X_POS "Window X-Position"
#define REGVALUE_PREF_WINDOW_Y_POS "Window Y-Position"
#define REGVALUE_PREF_HDV_START_DIR "HDV Starting Directory"
#define REGVALUE_PREF_LAST_HARDDISK_1 "Last Harddisk Image 1"
#define REGVALUE_PREF_LAST_HARDDISK_2 "Last Harddisk Image 2"
#define WM_USER_BENCHMARK WM_USER+1
#define WM_USER_SAVESTATE WM_USER+2
#define WM_USER_LOADSTATE WM_USER+3
#define VK_SNAPSHOT_560 WM_USER+4 // PrintScreen
#define VK_SNAPSHOT_280 WM_USER+5 // PrintScreen+Shift
#define WM_USER_TCP_SERIAL WM_USER+6
#define WM_USER_BOOT WM_USER+7
#define WM_USER_FULLSCREEN WM_USER+8
#define VK_SNAPSHOT_TEXT WM_USER+9 // PrintScreen+Ctrl
#ifdef _MSC_VER
#define PATH_SEPARATOR '\\'
#else
#define PATH_SEPARATOR '/'
#endif
#define WM_USER_RESTART WM_USER+2
#define WM_USER_SAVESTATE WM_USER+3
#define WM_USER_LOADSTATE WM_USER+4
#define VK_SNAPSHOT_560 WM_USER+5 // PrintScreen
#define VK_SNAPSHOT_280 WM_USER+6 // PrintScreen+Shift
#define WM_USER_TCP_SERIAL WM_USER+7
#define WM_USER_BOOT WM_USER+8
#define WM_USER_FULLSCREEN WM_USER+9
#define VK_SNAPSHOT_TEXT WM_USER+10 // PrintScreen+Ctrl
enum eIRQSRC {IS_6522=0, IS_SPEECH, IS_SSC, IS_MOUSE};
@ -220,11 +222,6 @@ inline bool IsAppleIIeOrAbove(eApple2Type type) // Apple //e,Enhanced//e,//c or
return !IsApple2PlusOrClone(type);
}
inline bool IsAppleIIc(eApple2Type type) // Apple //c
{
return (type & A2TYPE_APPLE2C) != 0;
}
extern eApple2Type g_Apple2Type;
inline bool IsEnhancedIIE(void)
{
@ -241,11 +238,6 @@ inline bool IsCopamBase64A(eApple2Type type) // Copam Base64A
return type == A2TYPE_BASE64A;
}
inline bool IsPravets(eApple2Type type)
{
return type == A2TYPE_PRAVETS8M || type == A2TYPE_PRAVETS82 || type == A2TYPE_PRAVETS8A;
}
enum eBUTTON {BUTTON0=0, BUTTON1};
enum eBUTTONSTATE {BUTTON_UP=0, BUTTON_DOWN};

View file

@ -37,7 +37,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.";
static INT_PTR CALLBACK DlgProcAbout(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
static BOOL CALLBACK DlgProcAbout(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch (message)
{
@ -65,12 +65,13 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hWnd, UINT message, WPARAM wparam, LPA
case WM_INITDIALOG:
{
HICON hIcon = LoadIcon(GetFrame().g_hInstance, TEXT("APPLEWIN_ICON"));
SendDlgItemMessage(hWnd, IDC_APPLEWIN_ICON, STM_SETIMAGE, IMAGE_ICON, reinterpret_cast<LPARAM>(hIcon));
SendDlgItemMessage(hWnd, IDC_APPLEWIN_ICON, STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
std::string strAppleWinVersion = "AppleWin v" + g_VERSIONSTRING;
SendDlgItemMessage(hWnd, IDC_APPLEWIN_VERSION, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(strAppleWinVersion.c_str()));
TCHAR szAppleWinVersion[50];
StringCbPrintf(szAppleWinVersion, 50, "AppleWin v%s", VERSIONSTRING);
SendDlgItemMessage(hWnd, IDC_APPLEWIN_VERSION, WM_SETTEXT, 0, (LPARAM)szAppleWinVersion);
SendDlgItemMessage(hWnd, IDC_GPL_TEXT, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(g_szGPL));
SendDlgItemMessage(hWnd, IDC_GPL_TEXT, WM_SETTEXT, 0, (LPARAM)g_szGPL);
}
break;
}

View file

@ -4,46 +4,25 @@
#include "../CardManager.h"
#include "../CPU.h"
#include "../DiskImage.h" // Disk_Status_e
#include "../Harddisk.h"
#include "../Harddisk.h" // HD_CardIsEnabled()
#include "../Interface.h" // VideoRefreshRate_e, GetVideoRefreshRate()
#include "../Tfe/PCapBackend.h"
class CConfigNeedingRestart
{
public:
// zero initialise
CConfigNeedingRestart()
CConfigNeedingRestart(UINT bEnableTheFreezesF8Rom = false) :
m_Apple2Type( GetApple2Type() ),
m_CpuType( GetMainCpu() ),
m_uSaveLoadStateMsg(0),
m_videoRefreshRate( GetVideo().GetVideoRefreshRate() )
{
m_Apple2Type = A2TYPE_APPLE2;
m_CpuType = CPU_UNKNOWN;
memset(m_Slot, 0, sizeof(m_Slot));
m_bEnableHDD = HD_CardIsEnabled();
m_bEnableTheFreezesF8Rom = bEnableTheFreezesF8Rom;
memset(&m_Slot, 0, sizeof(m_Slot));
m_SlotAux = CT_Empty;
m_bEnableTheFreezesF8Rom = 0;
m_uSaveLoadStateMsg = 0;
m_videoRefreshRate = VR_NONE;
}
// create from current global configuration
static CConfigNeedingRestart Create()
{
CConfigNeedingRestart config;
config.Reload();
return config;
}
// update from current global configuration
void Reload()
{
m_Apple2Type = GetApple2Type();
m_CpuType = GetMainCpu();
CardManager& cardManager = GetCardMgr();
for (UINT slot = SLOT0; slot < NUM_SLOTS; slot++)
m_Slot[slot] = cardManager.QuerySlot(slot);
m_SlotAux = cardManager.QueryAux();
m_tfeInterface = PCapBackend::tfe_interface;
m_bEnableTheFreezesF8Rom = GetPropertySheet().GetTheFreezesF8Rom();
m_uSaveLoadStateMsg = 0;
m_videoRefreshRate = GetVideo().GetVideoRefreshRate();
m_Slot[SLOT4] = GetCardMgr().QuerySlot(SLOT4);
m_Slot[SLOT5] = GetCardMgr().QuerySlot(SLOT5);
m_Slot[SLOT7] = GetCardMgr().QuerySlot(SLOT7);
}
const CConfigNeedingRestart& operator= (const CConfigNeedingRestart& other)
@ -51,8 +30,7 @@ public:
m_Apple2Type = other.m_Apple2Type;
m_CpuType = other.m_CpuType;
memcpy(m_Slot, other.m_Slot, sizeof(m_Slot));
m_SlotAux = other.m_SlotAux;
m_tfeInterface = other.m_tfeInterface;
m_bEnableHDD = other.m_bEnableHDD;
m_bEnableTheFreezesF8Rom = other.m_bEnableTheFreezesF8Rom;
m_uSaveLoadStateMsg = other.m_uSaveLoadStateMsg;
m_videoRefreshRate = other.m_videoRefreshRate;
@ -64,8 +42,7 @@ public:
return m_Apple2Type == other.m_Apple2Type &&
m_CpuType == other.m_CpuType &&
memcmp(m_Slot, other.m_Slot, sizeof(m_Slot)) == 0 &&
m_SlotAux == other.m_SlotAux &&
m_tfeInterface == other.m_tfeInterface &&
m_bEnableHDD == other.m_bEnableHDD &&
m_bEnableTheFreezesF8Rom == other.m_bEnableTheFreezesF8Rom &&
m_uSaveLoadStateMsg == other.m_uSaveLoadStateMsg &&
m_videoRefreshRate == other.m_videoRefreshRate;
@ -78,9 +55,9 @@ public:
eApple2Type m_Apple2Type;
eCpuType m_CpuType;
SS_CARDTYPE m_Slot[NUM_SLOTS];
SS_CARDTYPE m_Slot[NUM_SLOTS]; // 0..7
SS_CARDTYPE m_SlotAux;
std::string m_tfeInterface;
bool m_bEnableHDD;
UINT m_bEnableTheFreezesF8Rom;
UINT m_uSaveLoadStateMsg;
VideoRefreshRate_e m_videoRefreshRate;

View file

@ -11,7 +11,6 @@ public:
virtual DWORD GetVolumeMax(void) = 0; // TODO:TC: Move out of here
virtual bool SaveStateSelectImage(HWND hWindow, bool bSave) = 0; // TODO:TC: Move out of here
virtual void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld) = 0;
virtual void ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew) = 0;
virtual void ConfigSaveApple2Type(eApple2Type apple2Type) = 0;
virtual UINT GetScrollLockToggle(void) = 0;

View file

@ -3,7 +3,7 @@
class IPropertySheetPage
{
protected:
virtual INT_PTR DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) = 0;
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam) = 0;
virtual void DlgOK(HWND window) = 0;
virtual void DlgCANCEL(HWND window) = 0;
};

View file

@ -43,13 +43,13 @@ const TCHAR CPageAdvanced::m_CloneChoices[] =
TEXT("Base 64A\0"); // Taiwanese
INT_PTR CALLBACK CPageAdvanced::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CALLBACK CPageAdvanced::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
// Switch from static func to our instance
return CPageAdvanced::ms_this->DlgProcInternal(hWnd, message, wparam, lparam);
}
INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch (message)
{
@ -65,11 +65,11 @@ INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, L
InitOptions(hWnd);
break;
case PSN_KILLACTIVE:
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid
break;
case PSN_APPLY:
DlgOK(hWnd);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break;
case PSN_QUERYCANCEL:
// Can use this to ask user to confirm cancel
@ -131,34 +131,19 @@ INT_PTR CPageAdvanced::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, L
SendDlgItemMessage(hWnd,IDC_SAVESTATE_FILENAME,WM_SETTEXT,0,(LPARAM)Snapshot_GetFilename().c_str());
CheckDlgButton(hWnd, IDC_SAVESTATE_ON_EXIT, g_bSaveStateOnExit ? BST_CHECKED : BST_UNCHECKED);
if (GetCardMgr().IsParallelPrinterCardInstalled())
{
ParallelPrinterCard* card = GetCardMgr().GetParallelPrinterCard();
CheckDlgButton(hWnd, IDC_DUMPTOPRINTER, card->GetDumpToPrinter() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_PRINTER_CONVERT_ENCODING, card->GetConvertEncoding() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_PRINTER_FILTER_UNPRINTABLE, card->GetFilterUnprintable() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_PRINTER_APPEND, card->GetPrinterAppend() ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hWnd, IDC_SPIN_PRINTER_IDLE, UDM_SETRANGE, 0, MAKELONG(999, 0));
SendDlgItemMessage(hWnd, IDC_SPIN_PRINTER_IDLE, UDM_SETPOS, 0, MAKELONG(card->GetIdleLimit(), 0));
SendDlgItemMessage(hWnd, IDC_PRINTER_DUMP_FILENAME, WM_SETTEXT, 0, (LPARAM)card->GetFilename().c_str());
// Need to specify cmd-line switch: -printer-real to enable this control
EnableWindow(GetDlgItem(hWnd, IDC_DUMPTOPRINTER), card->GetEnableDumpToRealPrinter() ? TRUE : FALSE);
}
else
{
EnableWindow(GetDlgItem(hWnd, IDC_DUMPTOPRINTER), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_PRINTER_CONVERT_ENCODING), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_PRINTER_FILTER_UNPRINTABLE), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_PRINTER_APPEND), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_SPIN_PRINTER_IDLE), FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_PRINTER_DUMP_FILENAME), FALSE);
}
CheckDlgButton(hWnd, IDC_DUMPTOPRINTER, g_bDumpToPrinter ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_PRINTER_CONVERT_ENCODING, g_bConvertEncoding ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_PRINTER_FILTER_UNPRINTABLE, g_bFilterUnprintable ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_PRINTER_APPEND, g_bPrinterAppend ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hWnd, IDC_SPIN_PRINTER_IDLE, UDM_SETRANGE, 0, MAKELONG(999,0));
SendDlgItemMessage(hWnd, IDC_SPIN_PRINTER_IDLE, UDM_SETPOS, 0, MAKELONG(Printer_GetIdleLimit (),0));
SendDlgItemMessage(hWnd, IDC_PRINTER_DUMP_FILENAME, WM_SETTEXT, 0, (LPARAM)Printer_GetFilename().c_str());
InitOptions(hWnd);
// Need to specify cmd-line switch: -printer-real to enable this control
EnableWindow(GetDlgItem(hWnd, IDC_DUMPTOPRINTER), g_bEnableDumpToRealPrinter ? TRUE : FALSE);
break;
}
}
@ -175,39 +160,42 @@ void CPageAdvanced::DlgOK(HWND hWnd)
m_PropertySheetHelper.SaveStateUpdate();
}
// Update printer dump filename
{
char szFilename[MAX_PATH];
memset(szFilename, 0, sizeof(szFilename));
* (USHORT*) szFilename = sizeof(szFilename);
UINT nLineLength = SendDlgItemMessage(hWnd, IDC_PRINTER_DUMP_FILENAME, EM_LINELENGTH, 0, 0);
SendDlgItemMessage(hWnd, IDC_PRINTER_DUMP_FILENAME, EM_GETLINE, 0, (LPARAM)szFilename);
nLineLength = nLineLength > sizeof(szFilename)-1 ? sizeof(szFilename)-1 : nLineLength;
szFilename[nLineLength] = 0x00;
Printer_SetFilename(szFilename);
RegSaveString(TEXT(REG_CONFIG), REGVALUE_PRINTER_FILENAME, 1, Printer_GetFilename());
}
g_bSaveStateOnExit = IsDlgButtonChecked(hWnd, IDC_SAVESTATE_ON_EXIT) ? true : false;
REGSAVE(TEXT(REGVALUE_SAVE_STATE_ON_EXIT), g_bSaveStateOnExit ? 1 : 0);
if (GetCardMgr().IsParallelPrinterCardInstalled())
{
ParallelPrinterCard* card = GetCardMgr().GetParallelPrinterCard();
g_bDumpToPrinter = IsDlgButtonChecked(hWnd, IDC_DUMPTOPRINTER ) ? true : false;
REGSAVE(TEXT(REGVALUE_DUMP_TO_PRINTER), g_bDumpToPrinter ? 1 : 0);
// Update printer dump filename
{
char szFilename[MAX_PATH];
memset(szFilename, 0, sizeof(szFilename));
*(USHORT*)szFilename = sizeof(szFilename);
g_bConvertEncoding = IsDlgButtonChecked(hWnd, IDC_PRINTER_CONVERT_ENCODING ) ? true : false;
REGSAVE(TEXT(REGVALUE_CONVERT_ENCODING), g_bConvertEncoding ? 1 : 0);
UINT nLineLength = SendDlgItemMessage(hWnd, IDC_PRINTER_DUMP_FILENAME, EM_LINELENGTH, 0, 0);
g_bFilterUnprintable = IsDlgButtonChecked(hWnd, IDC_PRINTER_FILTER_UNPRINTABLE ) ? true : false;
REGSAVE(TEXT(REGVALUE_FILTER_UNPRINTABLE), g_bFilterUnprintable ? 1 : 0);
SendDlgItemMessage(hWnd, IDC_PRINTER_DUMP_FILENAME, EM_GETLINE, 0, (LPARAM)szFilename);
g_bPrinterAppend = IsDlgButtonChecked(hWnd, IDC_PRINTER_APPEND) ? true : false;
REGSAVE(TEXT(REGVALUE_PRINTER_APPEND), g_bPrinterAppend ? 1 : 0);
nLineLength = nLineLength > sizeof(szFilename) - 1 ? sizeof(szFilename) - 1 : nLineLength;
szFilename[nLineLength] = 0x00;
//
card->SetFilename(szFilename);
}
card->SetDumpToPrinter(IsDlgButtonChecked(hWnd, IDC_DUMPTOPRINTER) ? true : false);
card->SetConvertEncoding(IsDlgButtonChecked(hWnd, IDC_PRINTER_CONVERT_ENCODING) ? true : false);
card->SetFilterUnprintable(IsDlgButtonChecked(hWnd, IDC_PRINTER_FILTER_UNPRINTABLE) ? true : false);
card->SetPrinterAppend(IsDlgButtonChecked(hWnd, IDC_PRINTER_APPEND) ? true : false);
card->SetIdleLimit((short)SendDlgItemMessage(hWnd, IDC_SPIN_PRINTER_IDLE, UDM_GETPOS, 0, 0));
// Now save all the above to Registry
card->SetRegistryConfig();
}
Printer_SetIdleLimit((short)SendDlgItemMessage(hWnd, IDC_SPIN_PRINTER_IDLE , UDM_GETPOS, 0, 0));
REGSAVE(TEXT(REGVALUE_PRINTER_IDLE_LIMIT),Printer_GetIdleLimit());
m_PropertySheetHelper.PostMsgAfterClose(hWnd, m_Page);
}

View file

@ -18,14 +18,14 @@ public:
}
virtual ~CPageAdvanced(){}
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
UINT GetTheFreezesF8Rom(void){ return m_uTheFreezesF8Rom; }
void SetTheFreezesF8Rom(UINT uValue){ m_uTheFreezesF8Rom = uValue; }
protected:
// IPropertySheetPage
virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND hWnd);
virtual void DlgCANCEL(HWND hWnd){}

View file

@ -27,9 +27,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "PropertySheet.h"
#include "../Windows/AppleWin.h"
#include "../Windows/Win32Frame.h"
#include "../Windows/WinFrame.h"
#include "../Registry.h"
#include "../SerialComms.h"
#include "../Windows/WinVideo.h"
#include "../resource/resource.h"
CPageConfig* CPageConfig::ms_this = 0; // reinit'd in ctor
@ -43,13 +44,13 @@ const TCHAR CPageConfig::m_ComputerChoices[] =
TEXT("Enhanced Apple //e\0")
TEXT("Clone\0");
INT_PTR CALLBACK CPageConfig::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CALLBACK CPageConfig::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
// Switch from static func to our instance
return CPageConfig::ms_this->DlgProcInternal(hWnd, message, wparam, lparam);
}
INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch (message)
{
@ -68,12 +69,12 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
// About to stop being active page
{
DWORD NewComputerMenuItem = (DWORD) SendDlgItemMessage(hWnd, IDC_COMPUTER, CB_GETCURSEL, 0, 0);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid
}
break;
case PSN_APPLY:
DlgOK(hWnd);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break;
case PSN_QUERYCANCEL:
// Can use this to ask user to confirm cancel
@ -89,18 +90,18 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
switch (LOWORD(wparam))
{
case IDC_AUTHENTIC_SPEED: // Authentic Machine Speed
SendDlgItemMessage(hWnd, IDC_SLIDER_CPU_SPEED, TBM_SETPOS, 1, SPEED_NORMAL);
EnableTrackbar(hWnd, 0);
SendDlgItemMessage(hWnd,IDC_SLIDER_CPU_SPEED,TBM_SETPOS,1,SPEED_NORMAL);
EnableTrackbar(hWnd,0);
break;
case IDC_CUSTOM_SPEED: // Select Custom Speed
SetFocus(GetDlgItem(hWnd, IDC_SLIDER_CPU_SPEED));
EnableTrackbar(hWnd, 1);
SetFocus(GetDlgItem(hWnd,IDC_SLIDER_CPU_SPEED));
EnableTrackbar(hWnd,1);
break;
case IDC_SLIDER_CPU_SPEED: // CPU speed slider
CheckRadioButton(hWnd, IDC_AUTHENTIC_SPEED, IDC_CUSTOM_SPEED, IDC_CUSTOM_SPEED);
EnableTrackbar(hWnd, 1);
CheckRadioButton(hWnd,IDC_AUTHENTIC_SPEED,IDC_CUSTOM_SPEED,IDC_CUSTOM_SPEED);
EnableTrackbar(hWnd,1);
break;
case IDC_BENCHMARK:
@ -112,13 +113,10 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
case IDC_ETHERNET:
ui_tfe_settings_dialog(hWnd);
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3] = m_PageConfigTfe.m_tfe_selected;
m_PropertySheetHelper.GetConfigNew().m_tfeInterface = m_PageConfigTfe.m_tfe_interface_name;
InitOptions(hWnd);
break;
case IDC_MONOCOLOR:
Win32Frame::GetWin32Frame().ChooseMonochromeColor();
GetVideo().ChooseMonochromeColor();
break;
case IDC_CHECK_CONFIRM_REBOOT:
@ -129,14 +127,6 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
// Checked in DlgOK()
break;
case IDC_CHECK_VIDHD_IN_SLOT3:
{
const UINT newState = IsDlgButtonChecked(hWnd, IDC_CHECK_VIDHD_IN_SLOT3) ? 1 : 0;
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3] = newState ? CT_VidHD : CT_Empty;
InitOptions(hWnd);
}
break;
case IDC_COMPUTER:
if(HIWORD(wparam) == CBN_SELCHANGE)
{
@ -212,8 +202,7 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
m_PropertySheetHelper.FillComboBox(hWnd,IDC_VIDEOTYPE, GetVideo().GetVideoChoices(), GetVideo().GetVideoType());
CheckDlgButton(hWnd, IDC_CHECK_HALF_SCAN_LINES, GetVideo().IsVideoStyle(VS_HALF_SCANLINES) ? BST_CHECKED : BST_UNCHECKED);
Win32Frame& win32Frame = Win32Frame::GetWin32Frame();
CheckDlgButton(hWnd, IDC_CHECK_FS_SHOW_SUBUNIT_STATUS, win32Frame.GetFullScreenShowSubunitStatus() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_CHECK_FS_SHOW_SUBUNIT_STATUS, GetFullScreenShowSubunitStatus() ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_CHECK_VERTICAL_BLEND, GetVideo().IsVideoStyle(VS_COLOR_VERTICAL_BLEND) ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hWnd, IDC_CHECK_VERTICAL_BLEND), (GetVideo().GetVideoType() == VT_COLOR_IDEALIZED) ? TRUE : FALSE);
@ -221,7 +210,7 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
if (GetCardMgr().IsSSCInstalled())
{
CSuperSerialCard* pSSC = GetCardMgr().GetSSC();
m_PropertySheetHelper.FillComboBox(hWnd, IDC_SERIALPORT, pSSC->GetSerialPortChoices().c_str(), pSSC->GetSerialPort());
m_PropertySheetHelper.FillComboBox(hWnd, IDC_SERIALPORT, pSSC->GetSerialPortChoices(), pSSC->GetSerialPort());
EnableWindow(GetDlgItem(hWnd, IDC_SERIALPORT), !pSSC->IsActive() ? TRUE : FALSE);
}
else
@ -249,21 +238,6 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
EnableTrackbar(hWnd, bCustom);
}
{
SS_CARDTYPE cardInSlot3 = GetCardMgr().QuerySlot(SLOT3);
switch (cardInSlot3) {
case CT_Uthernet:
case CT_Uthernet2:
m_PageConfigTfe.m_tfe_selected = cardInSlot3;
break;
default:
m_PageConfigTfe.m_tfe_selected = CT_Empty;
break;
}
m_PageConfigTfe.m_tfe_interface_name = PCapBackend::tfe_interface;
}
InitOptions(hWnd);
break;
@ -298,7 +272,6 @@ INT_PTR CPageConfig::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPA
void CPageConfig::DlgOK(HWND hWnd)
{
bool bVideoReinit = false;
Win32Frame& win32Frame = Win32Frame::GetWin32Frame();
const VideoType_e newVideoType = (VideoType_e) SendDlgItemMessage(hWnd, IDC_VIDEOTYPE, CB_GETCURSEL, 0, 0);
if (GetVideo().GetVideoType() != newVideoType)
@ -338,38 +311,49 @@ void CPageConfig::DlgOK(HWND hWnd)
if (bVideoReinit)
{
win32Frame.FrameRefreshStatus(DRAW_TITLE);
win32Frame.ApplyVideoModeChange();
GetVideo().Config_Save_Video();
GetFrame().FrameRefreshStatus(DRAW_TITLE, false);
GetVideo().VideoReinitialize();
if ((g_nAppMode != MODE_LOGO) && (g_nAppMode != MODE_DEBUG))
{
GetFrame().VideoRedrawScreen();
}
}
//
const bool bNewFSSubunitStatus = IsDlgButtonChecked(hWnd, IDC_CHECK_FS_SHOW_SUBUNIT_STATUS) ? true : false;
if (win32Frame.GetFullScreenShowSubunitStatus() != bNewFSSubunitStatus)
if (GetFullScreenShowSubunitStatus() != bNewFSSubunitStatus)
{
REGSAVE(TEXT(REGVALUE_FS_SHOW_SUBUNIT_STATUS), bNewFSSubunitStatus ? 1 : 0);
win32Frame.SetFullScreenShowSubunitStatus(bNewFSSubunitStatus);
GetFrame().SetFullScreenShowSubunitStatus(bNewFSSubunitStatus);
if (win32Frame.IsFullScreen())
win32Frame.FrameRefreshStatus(DRAW_BACKGROUND | DRAW_LEDS | DRAW_DISK_STATUS);
if (IsFullScreen())
GetFrame().FrameRefreshStatus(DRAW_BACKGROUND | DRAW_LEDS | DRAW_DISK_STATUS);
}
//
const BOOL bNewConfirmReboot = IsDlgButtonChecked(hWnd, IDC_CHECK_CONFIRM_REBOOT) ? 1 : 0;
if (win32Frame.g_bConfirmReboot != bNewConfirmReboot)
if (GetFrame().g_bConfirmReboot != bNewConfirmReboot)
{
REGSAVE(TEXT(REGVALUE_CONFIRM_REBOOT), bNewConfirmReboot);
win32Frame.g_bConfirmReboot = bNewConfirmReboot;
GetFrame().g_bConfirmReboot = bNewConfirmReboot;
}
//
if (GetCardMgr().IsSSCInstalled())
{
CSuperSerialCard* pSSC = GetCardMgr().GetSSC();
const DWORD uNewSerialPort = (DWORD) SendDlgItemMessage(hWnd, IDC_SERIALPORT, CB_GETCURSEL, 0, 0);
GetCardMgr().GetSSC()->CommSetSerialPort(uNewSerialPort);
pSSC->CommSetSerialPort(hWnd, uNewSerialPort);
RegSaveString( TEXT(REG_CONFIG),
TEXT(REGVALUE_SERIAL_PORT_NAME),
TRUE,
pSSC->GetSerialPortName() );
}
//
@ -389,14 +373,8 @@ void CPageConfig::DlgOK(HWND hWnd)
void CPageConfig::InitOptions(HWND hWnd)
{
const SS_CARDTYPE slot3 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3];
const BOOL enableUthernetDialog = slot3 == CT_Empty || slot3 == CT_Uthernet || slot3 == CT_Uthernet2;
EnableWindow(GetDlgItem(hWnd, IDC_ETHERNET), enableUthernetDialog);
const bool bIsSlot3VidHD = slot3 == CT_VidHD;
CheckDlgButton(hWnd, IDC_CHECK_VIDHD_IN_SLOT3, bIsSlot3VidHD ? BST_CHECKED : BST_UNCHECKED);
const BOOL enableVidHD = slot3 == CT_Empty || bIsSlot3VidHD;
EnableWindow(GetDlgItem(hWnd, IDC_CHECK_VIDHD_IN_SLOT3), enableVidHD);
// Nothing to do:
// - no changes made on any other pages affect this page
}
// Config->Computer: Menu item to eApple2Type

View file

@ -18,11 +18,11 @@ public:
}
virtual ~CPageConfig(){}
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
protected:
// IPropertySheetPage
virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND hWnd);
virtual void DlgCANCEL(HWND hWnd){}

View file

@ -28,7 +28,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Common.h"
#include "../Registry.h"
#include "../resource/resource.h"
#include "../Tfe/PCapBackend.h"
#include "../Tfe/Tfe.h"
#include "../Tfe/Tfesupp.h"
CPageConfigTfe* CPageConfigTfe::ms_this = 0; // reinit'd in ctor
@ -56,13 +57,13 @@ uilib_dialog_group CPageConfigTfe::ms_rightgroup[] =
{0, 0}
};
INT_PTR CALLBACK CPageConfigTfe::DlgProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
BOOL CALLBACK CPageConfigTfe::DlgProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
// Switch from static func to our instance
return CPageConfigTfe::ms_this->DlgProcInternal(hwnd, msg, wparam, lparam);
}
INT_PTR CPageConfigTfe::DlgProcInternal(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
BOOL CPageConfigTfe::DlgProcInternal(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
switch (msg)
{
@ -108,28 +109,31 @@ void CPageConfigTfe::DlgCANCEL(HWND window)
EndDialog(window, 0);
}
BOOL CPageConfigTfe::get_tfename(int number, std::string & name, std::string & description)
BOOL CPageConfigTfe::get_tfename(int number, char **ppname, char **ppdescription)
{
if (PCapBackend::tfe_enumadapter_open())
if (tfe_enumadapter_open())
{
std::string adapterName;
std::string adapterDescription;
char *pname = NULL;
char *pdescription = NULL;
while (number--)
{
if (!PCapBackend::tfe_enumadapter(adapterName, adapterDescription))
if (!tfe_enumadapter(&pname, &pdescription))
break;
lib_free(pname);
lib_free(pdescription);
}
if (PCapBackend::tfe_enumadapter(adapterName, adapterDescription))
if (tfe_enumadapter(&pname, &pdescription))
{
name = adapterName;
description = adapterDescription;
PCapBackend::tfe_enumadapter_close();
*ppname = pname;
*ppdescription = pdescription;
tfe_enumadapter_close();
return TRUE;
}
PCapBackend::tfe_enumadapter_close();
tfe_enumadapter_close();
}
return FALSE;
@ -140,8 +144,11 @@ int CPageConfigTfe::gray_ungray_items(HWND hwnd)
int enable;
int number;
int disabled = 0;
PCapBackend::get_disabled_state(&disabled);
//resources_get_value("ETHERNET_DISABLED", (void *)&disabled);
DWORD dwDisabled;
REGLOAD_DEFAULT(TEXT("Uthernet Disabled"), &dwDisabled, 0);
int disabled = dwDisabled ? 1 : 0;
get_disabled_state(&disabled);
if (disabled)
{
@ -162,15 +169,17 @@ int CPageConfigTfe::gray_ungray_items(HWND hwnd)
if (enable)
{
std::string name;
std::string description;
char *pname = NULL;
char *pdescription = NULL;
number = SendMessage(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE), CB_GETCURSEL, 0, 0);
if (get_tfename(number, name, description))
if (get_tfename(number, &pname, &pdescription))
{
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_NAME), name.c_str());
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_DESC), description.c_str());
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_NAME), pname);
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_DESC), pdescription);
lib_free(pname);
lib_free(pdescription);
}
}
else
@ -187,52 +196,52 @@ void CPageConfigTfe::init_tfe_dialog(HWND hwnd)
HWND temp_hwnd;
int active_value;
int tfe_enable;
int xsize, ysize;
char *interface_name = NULL;
uilib_get_group_extent(hwnd, ms_leftgroup, &xsize, &ysize);
uilib_adjust_group_width(hwnd, ms_leftgroup);
uilib_move_group(hwnd, ms_rightgroup, xsize + 30);
switch (m_tfe_selected)
{
case CT_Uthernet:
active_value = 1;
break;
case CT_Uthernet2:
active_value = 2;
break;
default:
active_value = 0;
break;
}
//resources_get_value("ETHERNET_ACTIVE", (void *)&tfe_enabled);
get_tfe_enabled(&tfe_enable);
//resources_get_value("ETHERNET_AS_RR", (void *)&tfe_as_rr_net);
active_value = (tfe_enable ? 1 : 0);
temp_hwnd=GetDlgItem(hwnd,IDC_TFE_SETTINGS_ENABLE);
SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Disabled");
SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Uthernet");
SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)"Uthernet II");
SendMessage(temp_hwnd, CB_SETCURSEL, (WPARAM)active_value, 0);
if (PCapBackend::tfe_enumadapter_open())
//resources_get_value("ETHERNET_INTERFACE", (void *)&interface_name);
interface_name = (char *) get_tfe_interface();
if (tfe_enumadapter_open())
{
int cnt = 0;
std::string name;
std::string description;
char *pname;
char *pdescription;
temp_hwnd=GetDlgItem(hwnd,IDC_TFE_SETTINGS_INTERFACE);
for (cnt = 0; PCapBackend::tfe_enumadapter(name, description); cnt++)
for (cnt = 0; tfe_enumadapter(&pname, &pdescription); cnt++)
{
BOOL this_entry = FALSE;
if (name == m_tfe_interface_name)
if (strcmp(pname, interface_name) == 0)
{
this_entry = TRUE;
}
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_NAME), name.c_str());
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_DESC), description.c_str());
SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)name.c_str());
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_NAME), pname);
SetWindowText(GetDlgItem(hwnd, IDC_TFE_SETTINGS_INTERFACE_DESC), pdescription);
SendMessage(temp_hwnd, CB_ADDSTRING, 0, (LPARAM)pname);
lib_free(pname);
lib_free(pdescription);
if (this_entry)
{
@ -241,7 +250,7 @@ void CPageConfigTfe::init_tfe_dialog(HWND hwnd)
}
}
PCapBackend::tfe_enumadapter_close();
tfe_enumadapter_close();
}
if (gray_ungray_items(hwnd))
@ -250,12 +259,12 @@ void CPageConfigTfe::init_tfe_dialog(HWND hwnd)
// TC (18 Dec 2017) this vicekb URL is a broken link now, so I copied it to the AppleWin repo, here:
// . https://github.com/AppleWin/AppleWin/blob/master/docs/VICE%20Knowledge%20Base%20-%20Article%2013-005.htm
MessageBox( hwnd,
"Uthernet support is not available on your system,\n"
"WPCAP.DLL cannot be loaded.\n\n"
"Install Npcap from\n\n"
" https://npcap.com\n\n"
"to activate networking with AppleWin.",
"Uthernet support", MB_ICONINFORMATION|MB_OK);
"TFE support is not available on your system,\n"
"there is some important part missing. Please have a\n"
"look at the VICE knowledge base support page\n"
"\n http://vicekb.trikaliotis.net/13-005\n\n"
"for possible reasons and to activate networking with VICE.",
"TFE support", MB_ICONINFORMATION|MB_OK);
/* just quit the dialog before it is open */
SendMessage( hwnd, WM_COMMAND, IDCANCEL, 0);
@ -265,6 +274,7 @@ void CPageConfigTfe::init_tfe_dialog(HWND hwnd)
void CPageConfigTfe::save_tfe_dialog(HWND hwnd)
{
int active_value;
int tfe_enabled;
char buffer[256];
buffer[255] = 0;
@ -273,24 +283,16 @@ void CPageConfigTfe::save_tfe_dialog(HWND hwnd)
// RGJ - Added check for NULL interface so we don't set it active without a valid interface selected
if (strlen(buffer) > 0)
{
m_tfe_interface_name = buffer;
RegSaveString(TEXT(REG_CONFIG), TEXT(REGVALUE_UTHERNET_INTERFACE), 1, buffer);
active_value = SendMessage(GetDlgItem(hwnd, IDC_TFE_SETTINGS_ENABLE), CB_GETCURSEL, 0, 0);
switch (active_value)
{
case 1:
m_tfe_selected = CT_Uthernet;
break;
case 2:
m_tfe_selected = CT_Uthernet2;
break;
default:
m_tfe_selected = CT_Empty;
break;
}
tfe_enabled = active_value >= 1 ? 1 : 0;
REGSAVE(TEXT(REGVALUE_UTHERNET_ACTIVE) ,tfe_enabled);
}
else
{
m_tfe_selected = CT_Empty;
m_tfe_interface_name.clear();
REGSAVE(TEXT(REGVALUE_UTHERNET_ACTIVE) ,0);
}
}

View file

@ -2,9 +2,6 @@
#include "IPropertySheetPage.h"
#include "../Tfe/Uilib.h"
#include "../Card.h"
#include <string>
class CPageConfigTfe : private IPropertySheetPage
{
@ -12,23 +9,19 @@ public:
CPageConfigTfe()
{
CPageConfigTfe::ms_this = this;
m_tfe_selected = CT_Empty;
}
virtual ~CPageConfigTfe(){}
static INT_PTR CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
SS_CARDTYPE m_tfe_selected;
std::string m_tfe_interface_name;
static BOOL CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
protected:
// IPropertySheetPage
virtual INT_PTR DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual BOOL DlgProcInternal(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND window);
virtual void DlgCANCEL(HWND window);
private:
BOOL get_tfename(int number, std::string & name, std::string & description);
BOOL get_tfename(int number, char **ppname, char **ppdescription);
int gray_ungray_items(HWND hwnd);
void init_tfe_dialog(HWND hwnd);
void save_tfe_dialog(HWND hwnd);

View file

@ -34,6 +34,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
CPageDisk* CPageDisk::ms_this = 0; // reinit'd in ctor
const TCHAR CPageDisk::m_discchoices[] =
TEXT("Authentic Speed\0")
TEXT("Enhanced Speed\0");
const TCHAR CPageDisk::m_defaultDiskOptions[] =
TEXT("Select Disk...\0")
TEXT("Eject Disk\0");
@ -42,13 +46,13 @@ const TCHAR CPageDisk::m_defaultHDDOptions[] =
TEXT("Select Hard Disk Image...\0")
TEXT("Unplug Hard Disk Image\0");
INT_PTR CALLBACK CPageDisk::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CALLBACK CPageDisk::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
// Switch from static func to our instance
return CPageDisk::ms_this->DlgProcInternal(hWnd, message, wparam, lparam);
}
INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch (message)
{
@ -64,28 +68,16 @@ INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARA
InitOptions(hWnd);
break;
case PSN_KILLACTIVE:
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid
break;
case PSN_APPLY:
DlgOK(hWnd);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break;
case PSN_QUERYCANCEL:
// Can use this to ask user to confirm cancel
break;
case PSN_RESET:
// Support 'Cancel' case for Slot-5 DiskII enabled/disabled - needed as the Disk2InterfaceCard object is created on toggling the checkbox. See [*1]
if (m_PropertySheetHelper.GetConfigOld().m_Slot[SLOT5] != m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5])
{
if (m_PropertySheetHelper.GetConfigOld().m_Slot[SLOT5] == CT_Disk2 || m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] == CT_Disk2)
m_PropertySheetHelper.SetSlot(SLOT5, m_PropertySheetHelper.GetConfigOld().m_Slot[SLOT5]);
}
// Support 'Cancel' case for Slot-7 HDD enabled/disabled - needed as the HarddiskInterfaceCard object is created on toggling the checkbox. See [*2]
if (m_PropertySheetHelper.GetConfigOld().m_Slot[SLOT7] != m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT7])
{
if (m_PropertySheetHelper.GetConfigOld().m_Slot[SLOT7] == CT_GenericHDD || m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT7] == CT_GenericHDD)
m_PropertySheetHelper.SetSlot(SLOT7, m_PropertySheetHelper.GetConfigOld().m_Slot[SLOT7]);
}
DlgCANCEL(hWnd);
break;
}
@ -95,43 +87,18 @@ INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARA
case WM_COMMAND:
switch (LOWORD(wparam))
{
case IDC_DISKII_SLOT5_ENABLE:
{
const BOOL checked = IsDlgButtonChecked(hWnd, IDC_DISKII_SLOT5_ENABLE) ? TRUE : FALSE;
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] = checked ? CT_Disk2 : CT_Empty;
// NB. Unusual as it creates slot object when checkbox is toggled (instead of after OK)
// Needed as we need a Disk2InterfaceCard object so that images can be inserted/ejected [*1]
m_PropertySheetHelper.SetSlot(SLOT5, m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5]);
InitOptions(hWnd);
EnableFloppyDrive(hWnd, checked, SLOT5);
}
break;
case IDC_COMBO_DISK1:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
HandleFloppyDriveCombo(hWnd, DRIVE_1, LOWORD(wparam), IDC_COMBO_DISK2, SLOT6);
GetFrame().FrameRefreshStatus(DRAW_BUTTON_DRIVES | DRAW_DISK_STATUS);
HandleFloppyDriveCombo(hWnd, DRIVE_1, LOWORD(wparam));
GetFrame().FrameRefreshStatus(DRAW_BUTTON_DRIVES);
}
break;
case IDC_COMBO_DISK2:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
HandleFloppyDriveCombo(hWnd, DRIVE_2, LOWORD(wparam), IDC_COMBO_DISK1, SLOT6);
GetFrame().FrameRefreshStatus(DRAW_BUTTON_DRIVES | DRAW_DISK_STATUS);
}
break;
case IDC_COMBO_DISK1_SLOT5:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
HandleFloppyDriveCombo(hWnd, DRIVE_1, LOWORD(wparam), IDC_COMBO_DISK2_SLOT5, SLOT5);
GetFrame().FrameRefreshStatus(DRAW_BUTTON_DRIVES | DRAW_DISK_STATUS);
}
break;
case IDC_COMBO_DISK2_SLOT5:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
HandleFloppyDriveCombo(hWnd, DRIVE_2, LOWORD(wparam), IDC_COMBO_DISK1_SLOT5, SLOT5);
GetFrame().FrameRefreshStatus(DRAW_BUTTON_DRIVES | DRAW_DISK_STATUS);
HandleFloppyDriveCombo(hWnd, DRIVE_2, LOWORD(wparam));
GetFrame().FrameRefreshStatus(DRAW_BUTTON_DRIVES);
}
break;
case IDC_COMBO_HDD1:
@ -147,23 +114,7 @@ INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARA
}
break;
case IDC_HDD_ENABLE:
{
const BOOL checked = IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE) ? TRUE : FALSE;
// Add some user-protection, as (currently) removing the HDD images can't be undone!
if (checked || !checked && GetFrame().FrameMessageBox("This will unplug the HDD image(s)! Proceed?", "Eject/Unplug Warning", MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND) != IDNO)
{
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT7] = checked ? CT_GenericHDD : CT_Empty;
// NB. Unusual as it creates slot object when checkbox is toggled (instead of after OK)
// Needed as we need a HarddiskInterfaceCard object so that images can be inserted/ejected [*2]
m_PropertySheetHelper.SetSlot(SLOT7, m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT7]);
InitComboHDD(hWnd, SLOT7); // disabling will remove the HDD images - so update drop-down to reflect this
EnableHDD(hWnd, checked);
}
else
{
CheckDlgButton(hWnd, IDC_HDD_ENABLE, BST_CHECKED);
}
}
EnableHDD(hWnd, IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE));
break;
case IDC_HDD_SWAP:
HandleHDDSwap(hWnd);
@ -179,13 +130,12 @@ INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARA
case WM_INITDIALOG:
{
CheckDlgButton(hWnd, IDC_ENHANCE_DISK_ENABLE, GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk() ? BST_CHECKED : BST_UNCHECKED);
m_PropertySheetHelper.FillComboBox(hWnd, IDC_DISKTYPE, m_discchoices, GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk() ? 1 : 0);
const UINT slot = SLOT6;
if (GetCardMgr().QuerySlot(slot) == CT_Disk2) // NB. SLOT6 not setup in m_PropertySheetHelper.GetConfigNew().m_Slot[]
InitComboFloppyDrive(hWnd, slot);
if (GetCardMgr().QuerySlot(SLOT6) == CT_Disk2)
InitComboFloppyDrive(hWnd, SLOT6);
else
EnableFloppyDrive(hWnd, FALSE, slot); // disable if slot6 is empty (or has some other card in it)
EnableFloppyDrive(hWnd, FALSE);
InitComboHDD(hWnd, SLOT7);
@ -193,11 +143,11 @@ INT_PTR CPageDisk::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARA
RegLoadString(TEXT(REG_CONFIG), REGVALUE_CIDERPRESSLOC, 1, PathToCiderPress, MAX_PATH, TEXT(""));
SendDlgItemMessage(hWnd, IDC_CIDERPRESS_FILENAME ,WM_SETTEXT, 0, (LPARAM)PathToCiderPress);
CheckDlgButton(hWnd, IDC_HDD_ENABLE, (GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_HDD_ENABLE, HD_CardIsEnabled() ? BST_CHECKED : BST_UNCHECKED);
EnableHDD(hWnd, IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE));
InitOptions(hWnd); // init for slot-5
InitOptions(hWnd);
break;
}
@ -211,22 +161,19 @@ void CPageDisk::InitComboFloppyDrive(HWND hWnd, UINT slot)
{
Disk2InterfaceCard& disk2Card = dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(slot));
const UINT idcComboDisk1 = (slot == SLOT6) ? IDC_COMBO_DISK1 : IDC_COMBO_DISK1_SLOT5;
const UINT idcComboDisk2 = (slot == SLOT6) ? IDC_COMBO_DISK2 : IDC_COMBO_DISK2_SLOT5;
m_PropertySheetHelper.FillComboBox(hWnd, idcComboDisk1, m_defaultDiskOptions, -1);
m_PropertySheetHelper.FillComboBox(hWnd, idcComboDisk2, m_defaultDiskOptions, -1);
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_DISK1, m_defaultDiskOptions, -1);
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_DISK2, m_defaultDiskOptions, -1);
if (!disk2Card.GetFullName(DRIVE_1).empty())
{
SendDlgItemMessage(hWnd, idcComboDisk1, CB_INSERTSTRING, 0, (LPARAM)disk2Card.GetFullName(DRIVE_1).c_str());
SendDlgItemMessage(hWnd, idcComboDisk1, CB_SETCURSEL, 0, 0);
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_INSERTSTRING, 0, (LPARAM)disk2Card.GetFullName(DRIVE_1).c_str());
SendDlgItemMessage(hWnd, IDC_COMBO_DISK1, CB_SETCURSEL, 0, 0);
}
if (!disk2Card.GetFullName(DRIVE_2).empty())
{
SendDlgItemMessage(hWnd, idcComboDisk2, CB_INSERTSTRING, 0, (LPARAM)disk2Card.GetFullName(DRIVE_2).c_str());
SendDlgItemMessage(hWnd, idcComboDisk2, CB_SETCURSEL, 0, 0);
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_INSERTSTRING, 0, (LPARAM)disk2Card.GetFullName(DRIVE_2).c_str());
SendDlgItemMessage(hWnd, IDC_COMBO_DISK2, CB_SETCURSEL, 0, 0);
}
}
@ -235,19 +182,15 @@ void CPageDisk::InitComboHDD(HWND hWnd, UINT /*slot*/)
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_HDD1, m_defaultHDDOptions, -1);
m_PropertySheetHelper.FillComboBox(hWnd, IDC_COMBO_HDD2, m_defaultHDDOptions, -1);
if (GetCardMgr().QuerySlot(SLOT7) != CT_GenericHDD)
return;
HarddiskInterfaceCard& card = dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7));
if (!card.GetFullName(HARDDISK_1).empty())
if (!HD_GetFullName(HARDDISK_1).empty())
{
SendDlgItemMessage(hWnd, IDC_COMBO_HDD1, CB_INSERTSTRING, 0, (LPARAM)card.GetFullName(HARDDISK_1).c_str());
SendDlgItemMessage(hWnd, IDC_COMBO_HDD1, CB_INSERTSTRING, 0, (LPARAM)HD_GetFullName(HARDDISK_1).c_str());
SendDlgItemMessage(hWnd, IDC_COMBO_HDD1, CB_SETCURSEL, 0, 0);
}
if (!card.GetFullName(HARDDISK_2).empty())
if (!HD_GetFullName(HARDDISK_2).empty())
{
SendDlgItemMessage(hWnd, IDC_COMBO_HDD2, CB_INSERTSTRING, 0, (LPARAM)card.GetFullName(HARDDISK_2).c_str());
SendDlgItemMessage(hWnd, IDC_COMBO_HDD2, CB_INSERTSTRING, 0, (LPARAM)HD_GetFullName(HARDDISK_2).c_str());
SendDlgItemMessage(hWnd, IDC_COMBO_HDD2, CB_SETCURSEL, 0, 0);
}
}
@ -270,34 +213,29 @@ void CPageDisk::DlgOK(HWND hWnd)
RegSaveString(TEXT(REG_CONFIG), REGVALUE_CIDERPRESSLOC, 1, szFilename);
}
const bool bNewEnhanceDisk = IsDlgButtonChecked(hWnd, IDC_ENHANCE_DISK_ENABLE) ? true : false;
const bool bNewEnhanceDisk = SendDlgItemMessage(hWnd, IDC_DISKTYPE,CB_GETCURSEL, 0, 0) ? true : false;
if (bNewEnhanceDisk != GetCardMgr().GetDisk2CardMgr().GetEnhanceDisk())
{
GetCardMgr().GetDisk2CardMgr().SetEnhanceDisk(bNewEnhanceDisk);
REGSAVE(TEXT(REGVALUE_ENHANCE_DISK_SPEED), (DWORD)bNewEnhanceDisk);
}
const bool bNewHDDIsEnabled = IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE) ? true : false;
if (bNewHDDIsEnabled != HD_CardIsEnabled())
{
m_PropertySheetHelper.GetConfigNew().m_bEnableHDD = bNewHDDIsEnabled;
}
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_1), 1, HD_GetFullPathName(HARDDISK_1));
RegSaveString(TEXT(REG_PREFS), TEXT(REGVALUE_PREF_LAST_HARDDISK_2), 1, HD_GetFullPathName(HARDDISK_2));
m_PropertySheetHelper.PostMsgAfterClose(hWnd, m_Page);
}
void CPageDisk::InitOptions(HWND hWnd)
{
// Changes made on other pages that affect this page:
// . slot-5: MB add/removed
// . slot-5: DiskII enabled/disabled
const UINT slot = SLOT5;
const SS_CARDTYPE cardInSlot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[slot];
CheckDlgButton(hWnd, IDC_DISKII_SLOT5_ENABLE, (cardInSlot5 == CT_Disk2) ? BST_CHECKED : BST_UNCHECKED);
const BOOL enable = (cardInSlot5 == CT_Disk2 || cardInSlot5 == CT_Empty) ? TRUE : FALSE;
EnableWindow(GetDlgItem(hWnd, IDC_DISKII_SLOT5_ENABLE), enable);
if (cardInSlot5 == CT_Disk2)
InitComboFloppyDrive(hWnd, slot);
else
EnableFloppyDrive(hWnd, FALSE, slot); // disable if slot5 is empty (or has some other card in it)
// Nothing to do:
// - no changes made on any other pages affect this page
}
void CPageDisk::EnableHDD(HWND hWnd, BOOL bEnable)
@ -307,20 +245,10 @@ void CPageDisk::EnableHDD(HWND hWnd, BOOL bEnable)
EnableWindow(GetDlgItem(hWnd, IDC_HDD_SWAP), bEnable);
}
void CPageDisk::EnableFloppyDrive(HWND hWnd, BOOL bEnable, UINT slot)
void CPageDisk::EnableFloppyDrive(HWND hWnd, BOOL bEnable)
{
_ASSERT(slot == SLOT6 || slot == SLOT5);
if (slot == SLOT6)
{
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_DISK1), bEnable);
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_DISK2), bEnable);
}
else if (slot == SLOT5)
{
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_DISK1_SLOT5), bEnable);
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_DISK2_SLOT5), bEnable);
}
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_DISK1), bEnable);
EnableWindow(GetDlgItem(hWnd, IDC_COMBO_DISK2), bEnable);
}
void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected)
@ -328,11 +256,6 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
if (!IsDlgButtonChecked(hWnd, IDC_HDD_ENABLE))
return;
_ASSERT(GetCardMgr().QuerySlot(SLOT7) == CT_GenericHDD);
if (GetCardMgr().QuerySlot(SLOT7) != CT_GenericHDD)
return;
HarddiskInterfaceCard& card = dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7));
// Search from "select hard drive"
DWORD dwOpenDialogIndex = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultHDDOptions[0]);
DWORD dwComboSelection = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_GETCURSEL, 0, 0);
@ -342,7 +265,7 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
if (dwComboSelection == dwOpenDialogIndex)
{
EnableHDD(hWnd, FALSE); // Prevent multiple Selection dialogs to be triggered
bool bRes = card.Select(driveSelected);
bool bRes = HD_Select(driveSelected);
EnableHDD(hWnd, TRUE);
if (!bRes)
@ -359,13 +282,13 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
SendDlgItemMessage(hWnd, comboSelected, CB_DELETESTRING, 0, 0);
}
SendDlgItemMessage(hWnd, comboSelected, CB_INSERTSTRING, 0, (LPARAM)card.GetFullName(driveSelected).c_str());
SendDlgItemMessage(hWnd, comboSelected, CB_INSERTSTRING, 0, (LPARAM)HD_GetFullName(driveSelected).c_str());
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0);
// If the HD was in the other combo, remove now
DWORD comboOther = (comboSelected == IDC_COMBO_HDD1) ? IDC_COMBO_HDD2 : IDC_COMBO_HDD1;
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)card.GetFullName(driveSelected).c_str());
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)HD_GetFullName(driveSelected).c_str());
if (duplicated != CB_ERR)
{
SendDlgItemMessage(hWnd, comboOther, CB_DELETESTRING, duplicated, 0);
@ -376,10 +299,11 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
{
if (dwComboSelection > 1)
{
if (RemovalConfirmation(comboSelected))
UINT uCommand = (driveSelected == 0) ? IDC_COMBO_HDD1 : IDC_COMBO_HDD2;
if (RemovalConfirmation(uCommand))
{
// Unplug selected disk
card.Unplug(driveSelected);
HD_Unplug(driveSelected);
// Remove drive from list
SendDlgItemMessage(hWnd, comboSelected, CB_DELETESTRING, 0, 0);
}
@ -391,17 +315,15 @@ void CPageDisk::HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected
}
}
void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT comboSelected, UINT comboOther, UINT slot)
void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT comboSelected)
{
_ASSERT(slot == SLOT6 || slot == SLOT5);
if (m_PropertySheetHelper.GetConfigNew().m_Slot[slot] != CT_Disk2)
if (GetCardMgr().QuerySlot(SLOT6) != CT_Disk2)
{
_ASSERT(0); // Shouldn't come here, as the combo is disabled
return;
}
Disk2InterfaceCard& disk2Card = dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(slot));
Disk2InterfaceCard& disk2Card = dynamic_cast<Disk2InterfaceCard&>(GetCardMgr().GetRef(SLOT6));
// Search from "select floppy drive"
DWORD dwOpenDialogIndex = (DWORD)SendDlgItemMessage(hWnd, comboSelected, CB_FINDSTRINGEXACT, -1, (LPARAM)&m_defaultDiskOptions[0]);
@ -411,9 +333,9 @@ void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT combo
if (dwComboSelection == dwOpenDialogIndex)
{
EnableFloppyDrive(hWnd, FALSE, slot); // Prevent multiple Selection dialogs to be triggered
EnableFloppyDrive(hWnd, FALSE); // Prevent multiple Selection dialogs to be triggered
bool bRes = disk2Card.UserSelectNewDiskImage(driveSelected);
EnableFloppyDrive(hWnd, TRUE, slot);
EnableFloppyDrive(hWnd, TRUE);
if (!bRes)
{
@ -434,6 +356,8 @@ void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT combo
SendDlgItemMessage(hWnd, comboSelected, CB_SETCURSEL, 0, 0);
// If the FD was in the other combo, remove now
DWORD comboOther = (comboSelected == IDC_COMBO_DISK1) ? IDC_COMBO_DISK2 : IDC_COMBO_DISK1;
DWORD duplicated = (DWORD)SendDlgItemMessage(hWnd, comboOther, CB_FINDSTRINGEXACT, -1, (LPARAM)fullname.c_str());
if (duplicated != CB_ERR)
{
@ -445,7 +369,8 @@ void CPageDisk::HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT combo
{
if (dwComboSelection > 1)
{
if (RemovalConfirmation(comboSelected))
UINT uCommand = (driveSelected == 0) ? IDC_COMBO_DISK1 : IDC_COMBO_DISK2;
if (RemovalConfirmation(uCommand))
{
// Eject selected disk
disk2Card.EjectDisk(driveSelected);
@ -465,10 +390,7 @@ void CPageDisk::HandleHDDSwap(HWND hWnd)
if (!RemovalConfirmation(IDC_HDD_SWAP))
return;
if (GetCardMgr().QuerySlot(SLOT7) != CT_GenericHDD)
return;
if (!dynamic_cast<HarddiskInterfaceCard&>(GetCardMgr().GetRef(SLOT7)).ImageSwap())
if (!HD_ImageSwap())
return;
InitComboHDD(hWnd, SLOT7);
@ -476,34 +398,21 @@ void CPageDisk::HandleHDDSwap(HWND hWnd)
UINT CPageDisk::RemovalConfirmation(UINT uCommand)
{
TCHAR szText[100];
bool bMsgBox = true;
bool isDisk = false;
UINT drive = 0;
if (uCommand == IDC_COMBO_DISK1 || uCommand == IDC_COMBO_DISK2)
{
isDisk = true;
drive = uCommand - IDC_COMBO_DISK1;
}
else if (uCommand == IDC_COMBO_DISK1_SLOT5 || uCommand == IDC_COMBO_DISK2_SLOT5)
{
isDisk = true;
drive = uCommand - IDC_COMBO_DISK1_SLOT5;
}
std::string strText;
if (isDisk)
strText = StrFormat("Do you really want to eject the disk in drive-%c ?", '1' + drive);
StringCbPrintf(szText, sizeof(szText), "Do you really want to eject the disk in drive-%c ?", '1' + uCommand - IDC_COMBO_DISK1);
else if (uCommand == IDC_COMBO_HDD1 || uCommand == IDC_COMBO_HDD2)
strText = StrFormat("Do you really want to unplug harddisk-%c ?", '1' + uCommand - IDC_COMBO_HDD1);
StringCbPrintf(szText, sizeof(szText), "Do you really want to unplug harddisk-%c ?", '1' + uCommand - IDC_COMBO_HDD1);
else if (uCommand == IDC_HDD_SWAP)
strText = "Do you really want to swap the harddisk images?";
StringCbPrintf(szText, sizeof(szText), "Do you really want to swap the harddisk images?");
else
bMsgBox = false;
if (bMsgBox)
{
int nRes = GetFrame().FrameMessageBox(strText.c_str(), "Eject/Unplug Warning", MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
int nRes = MessageBox(GetFrame().g_hFrameWindow, szText, TEXT("Eject/Unplug Warning"), MB_ICONWARNING | MB_YESNO | MB_SETFOREGROUND);
if (nRes == IDNO)
uCommand = 0;
}

View file

@ -15,11 +15,11 @@ public:
}
virtual ~CPageDisk(){}
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
protected:
// IPropertySheetPage
virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND hWnd);
virtual void DlgCANCEL(HWND hWnd){}
@ -28,13 +28,14 @@ private:
void InitComboFloppyDrive(HWND hWnd, UINT slot);
void InitComboHDD(HWND hWnd, UINT slot);
void EnableHDD(HWND hWnd, BOOL bEnable);
void EnableFloppyDrive(HWND hWnd, BOOL bEnable, UINT slot);
void EnableFloppyDrive(HWND hWnd, BOOL bEnable);
void HandleHDDCombo(HWND hWnd, UINT driveSelected, UINT comboSelected);
void HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT comboSelected, UINT comboOther, UINT slot);
void HandleFloppyDriveCombo(HWND hWnd, UINT driveSelected, UINT comboSelected);
void HandleHDDSwap(HWND hWnd);
UINT RemovalConfirmation(UINT uCommand);
static CPageDisk* ms_this;
static const TCHAR m_discchoices[];
static const TCHAR m_defaultDiskOptions[];
static const TCHAR m_defaultHDDOptions[];

View file

@ -63,25 +63,14 @@ const TCHAR CPageInput::m_szCPMSlotChoice_Slot5[] = TEXT("Slot 5\0");
const TCHAR CPageInput::m_szCPMSlotChoice_Unplugged[] = TEXT("Unplugged\0");
const TCHAR CPageInput::m_szCPMSlotChoice_Unavailable[] = TEXT("Unavailable\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Slot3[] = TEXT("Slot 3\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Slot4[] = TEXT("Slot 4\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Slot5[] = TEXT("Slot 5\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Unplugged[] = TEXT("Unplugged\0");
const TCHAR CPageInput::m_szFourPlaySlotChoice_Unavailable[] = TEXT("Unavailable\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Slot3[] = TEXT("Slot 3\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Slot4[] = TEXT("Slot 4\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Slot5[] = TEXT("Slot 5\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Unplugged[] = TEXT("Unplugged\0");
const TCHAR CPageInput::m_szSNESMAXSlotChoice_Unavailable[] = TEXT("Unavailable\0");
INT_PTR CALLBACK CPageInput::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CALLBACK CPageInput::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
// Switch from static func to our instance
return CPageInput::ms_this->DlgProcInternal(hWnd, message, wparam, lparam);
}
INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch (message)
{
@ -97,11 +86,11 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
InitOptions(hWnd);
break;
case PSN_KILLACTIVE:
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid
break;
case PSN_APPLY:
DlgOK(hWnd);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break;
case PSN_QUERYCANCEL:
// Can use this to ask user to confirm cancel
@ -135,20 +124,20 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
switch (LOWORD(wparam))
{
case IDC_JOYSTICK0:
if (HIWORD(wparam) == CBN_SELCHANGE)
if(HIWORD(wparam) == CBN_SELCHANGE)
{
DWORD dwNewJoyType = (DWORD)SendDlgItemMessage(hWnd, IDC_JOYSTICK0, CB_GETCURSEL, 0, 0);
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[dwNewJoyType], JN_JOYSTICK0, bIsSlot4Mouse);
InitOptions(hWnd);
}
break;
case IDC_JOYSTICK1:
if (HIWORD(wparam) == CBN_SELCHANGE)
if(HIWORD(wparam) == CBN_SELCHANGE)
{
DWORD dwNewJoyType = (DWORD)SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0);
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
JoySetEmulationType(hWnd, m_nJoy1ChoiceTranlationTbl[dwNewJoyType], JN_JOYSTICK1, bIsSlot4Mouse);
InitOptions(hWnd);
}
@ -161,14 +150,14 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
case IDC_MOUSE_IN_SLOT4:
{
const UINT uNewState = IsDlgButtonChecked(hWnd, IDC_MOUSE_IN_SLOT4) ? 1 : 0;
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] = uNewState ? CT_MouseInterface : CT_Empty;
m_PropertySheetHelper.GetConfigNew().m_Slot[4] = uNewState ? CT_MouseInterface : CT_Empty;
InitOptions(hWnd); // re-init
}
break;
case IDC_CPM_CONFIG:
if (HIWORD(wparam) == CBN_SELCHANGE)
if(HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewCPMChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_CPM_CONFIG, CB_GETCURSEL, 0, 0);
const CPMCHOICE NewCPMChoice = m_CPMComboItemToChoice[NewCPMChoiceItem];
@ -176,80 +165,18 @@ INT_PTR CPageInput::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
break;
// Whatever has changed, the old slot will now be empty
const SS_CARDTYPE slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4];
const SS_CARDTYPE slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5];
if (slot4 == CT_Z80)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] = CT_Empty;
else if (slot5 == CT_Z80)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] = CT_Empty;
const SS_CARDTYPE Slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[4];
const SS_CARDTYPE Slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[5];
if (Slot4 == CT_Z80)
m_PropertySheetHelper.GetConfigNew().m_Slot[4] = CT_Empty;
else if (Slot5 == CT_Z80)
m_PropertySheetHelper.GetConfigNew().m_Slot[5] = CT_Empty;
// Insert CP/M card into new slot (or leave slot empty)
if (NewCPMChoice == CPM_SLOT4)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] = CT_Z80;
m_PropertySheetHelper.GetConfigNew().m_Slot[4] = CT_Z80;
else if (NewCPMChoice == CPM_SLOT5)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] = CT_Z80;
InitOptions(hWnd); // re-init
}
break;
case IDC_FOURPLAY_CONFIG:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewFourPlayChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_FOURPLAY_CONFIG, CB_GETCURSEL, 0, 0);
const FOURPLAYCHOICE NewFourPlayChoice = m_FourPlayComboItemToChoice[NewFourPlayChoiceItem];
if (NewFourPlayChoice == m_FourPlayChoice)
break;
// Whatever has changed, the old slot will now be empty
const SS_CARDTYPE slot3 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3];
const SS_CARDTYPE slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4];
const SS_CARDTYPE slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5];
if (slot3 == CT_FourPlay)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3] = CT_Empty;
else if (slot4 == CT_FourPlay)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] = CT_Empty;
else if (slot5 == CT_FourPlay)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] = CT_Empty;
// Insert 4Play card into new slot (or leave slot empty)
if (NewFourPlayChoice == FOURPLAY_SLOT3)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3] = CT_FourPlay;
else if (NewFourPlayChoice == FOURPLAY_SLOT4)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] = CT_FourPlay;
else if (NewFourPlayChoice == FOURPLAY_SLOT5)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] = CT_FourPlay;
InitOptions(hWnd); // re-init
}
break;
case IDC_SNESMAX_CONFIG:
if (HIWORD(wparam) == CBN_SELCHANGE)
{
const DWORD NewSNESMAXChoiceItem = (DWORD) SendDlgItemMessage(hWnd, IDC_SNESMAX_CONFIG, CB_GETCURSEL, 0, 0);
const SNESMAXCHOICE NewSNESMAXChoice = m_SNESMAXComboItemToChoice[NewSNESMAXChoiceItem];
if (NewSNESMAXChoice == m_SNESMAXChoice)
break;
// Whatever has changed, the old slot will now be empty
const SS_CARDTYPE slot3 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3];
const SS_CARDTYPE slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4];
const SS_CARDTYPE slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5];
if (slot3 == CT_SNESMAX)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3] = CT_Empty;
else if (slot4 == CT_SNESMAX)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] = CT_Empty;
else if (slot5 == CT_SNESMAX)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] = CT_Empty;
// Insert SNES MAX card into new slot (or leave slot empty)
if (NewSNESMAXChoice == SNESMAX_SLOT3)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3] = CT_SNESMAX;
else if (NewSNESMAXChoice == SNESMAX_SLOT4)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] = CT_SNESMAX;
else if (NewSNESMAXChoice == SNESMAX_SLOT5)
m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5] = CT_SNESMAX;
m_PropertySheetHelper.GetConfigNew().m_Slot[5] = CT_Z80;
InitOptions(hWnd); // re-init
}
@ -292,7 +219,7 @@ void CPageInput::DlgOK(HWND hWnd)
UINT uNewJoyType1 = SendDlgItemMessage(hWnd, IDC_JOYSTICK1, CB_GETCURSEL, 0, 0);
if (uNewJoyType1 >= J1C_MAX) uNewJoyType1 = 0; // GH#434
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
if (JoySetEmulationType(hWnd, m_nJoy0ChoiceTranlationTbl[uNewJoyType0], JN_JOYSTICK0, bIsSlot4Mouse))
{
@ -341,7 +268,7 @@ void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
TCHAR** ppszJoyChoices;
int nOtherJoyNum = nJoyNum == JN_JOYSTICK0 ? JN_JOYSTICK1 : JN_JOYSTICK0;
if (nJoyNum == JN_JOYSTICK0)
if(nJoyNum == JN_JOYSTICK0)
{
pnzJoystickChoices = m_joystick0choices;
pnJoyTranslationTbl = m_nJoy0ChoiceTranlationTbl;
@ -381,7 +308,7 @@ void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
pszMem += strlen(ppszJoyChoices[nJC_JOYSTICK])+1;
pnJoyTranslationTbl[nIdx++] = nJC_JOYSTICK;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4] == CT_MouseInterface;
const bool bIsSlot4Mouse = m_PropertySheetHelper.GetConfigNew().m_Slot[4] == CT_MouseInterface;
// Now exclude:
// . the other Joystick type (if it exists) from this new list
@ -420,21 +347,19 @@ void CPageInput::InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue)
void CPageInput::InitSlotOptions(HWND hWnd)
{
const SS_CARDTYPE slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4];
const SS_CARDTYPE Slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[4];
const bool bIsSlot4Mouse = slot4 == CT_MouseInterface;
const bool bIsSlot4Mouse = Slot4 == CT_MouseInterface;
CheckDlgButton(hWnd, IDC_MOUSE_IN_SLOT4, bIsSlot4Mouse ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_MOUSE_CROSSHAIR, m_uMouseShowCrosshair ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hWnd, IDC_MOUSE_RESTRICT_TO_WINDOW, m_uMouseRestrictToWindow ? BST_CHECKED : BST_UNCHECKED);
const bool bIsSlot4Empty = slot4 == CT_Empty;
const bool bIsSlot4Empty = Slot4 == CT_Empty;
EnableWindow(GetDlgItem(hWnd, IDC_MOUSE_IN_SLOT4), ((bIsSlot4Mouse || bIsSlot4Empty) && !JoyUsingMouse()) ? TRUE : FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_MOUSE_CROSSHAIR), bIsSlot4Mouse ? TRUE : FALSE);
EnableWindow(GetDlgItem(hWnd, IDC_MOUSE_RESTRICT_TO_WINDOW), bIsSlot4Mouse ? TRUE : FALSE);
InitCPMChoices(hWnd);
InitFourPlayChoices(hWnd);
InitSNESMAXChoices(hWnd);
InitJoystickChoices(hWnd, JN_JOYSTICK0, IDC_JOYSTICK0);
InitJoystickChoices(hWnd, JN_JOYSTICK1, IDC_JOYSTICK1);
@ -445,11 +370,11 @@ void CPageInput::InitSlotOptions(HWND hWnd)
void CPageInput::InitCPMChoices(HWND hWnd)
{
const SS_CARDTYPE slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4];
const SS_CARDTYPE slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5];
const SS_CARDTYPE Slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[4];
const SS_CARDTYPE Slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[5];
if (slot4 == CT_Z80) m_CPMChoice = CPM_SLOT4;
else if (slot5 == CT_Z80) m_CPMChoice = CPM_SLOT5;
if (Slot4 == CT_Z80) m_CPMChoice = CPM_SLOT4;
else if (Slot5 == CT_Z80) m_CPMChoice = CPM_SLOT5;
else m_CPMChoice = CPM_UNPLUGGED;
for (UINT i=0; i<_CPM_MAX_CHOICES; i++)
@ -458,10 +383,10 @@ void CPageInput::InitCPMChoices(HWND hWnd)
UINT uStringOffset = 0;
UINT uComboItemIdx = 0;
const bool bIsSlot4Empty = slot4 == CT_Empty;
const bool bIsSlot4CPM = slot4 == CT_Z80;
const bool bIsSlot5Empty = slot5 == CT_Empty;
const bool bIsSlot5CPM = slot5 == CT_Z80;
const bool bIsSlot4Empty = Slot4 == CT_Empty;
const bool bIsSlot4CPM = Slot4 == CT_Z80;
const bool bIsSlot5Empty = Slot5 == CT_Empty;
const bool bIsSlot5CPM = Slot5 == CT_Z80;
if (bIsSlot4Empty || bIsSlot4CPM)
{
@ -515,175 +440,3 @@ void CPageInput::InitCPMChoices(HWND hWnd)
m_PropertySheetHelper.FillComboBox(hWnd, IDC_CPM_CONFIG, m_szCPMSlotChoices, uCurrentChoice);
}
void CPageInput::InitFourPlayChoices(HWND hWnd)
{
const SS_CARDTYPE slot3 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3];
const SS_CARDTYPE slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4];
const SS_CARDTYPE slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5];
if (slot3 == CT_FourPlay) m_FourPlayChoice = FOURPLAY_SLOT3;
else if (slot4 == CT_FourPlay) m_FourPlayChoice = FOURPLAY_SLOT4;
else if (slot5 == CT_FourPlay) m_FourPlayChoice = FOURPLAY_SLOT5;
else m_FourPlayChoice = FOURPLAY_UNPLUGGED;
for (UINT i=0; i<_FOURPLAY_MAX_CHOICES; i++)
m_FourPlayComboItemToChoice[i] = FOURPLAY_UNAVAILABLE;
UINT uStringOffset = 0;
UINT uComboItemIdx = 0;
const bool bIsSlot3Empty = slot3 == CT_Empty;
const bool bIsSlot3FourPlay = slot3 == CT_FourPlay;
const bool bIsSlot4Empty = slot4 == CT_Empty;
const bool bIsSlot4FourPlay = slot4 == CT_FourPlay;
const bool bIsSlot5Empty = slot5 == CT_Empty;
const bool bIsSlot5FourPlay = slot5 == CT_FourPlay;
if (bIsSlot3Empty || bIsSlot3FourPlay)
{
const UINT uStrLen = strlen(m_szFourPlaySlotChoice_Slot3) + 1;
memcpy(&m_szFourPlaySlotChoices[uStringOffset], m_szFourPlaySlotChoice_Slot3, uStrLen);
uStringOffset += uStrLen;
m_FourPlayComboItemToChoice[uComboItemIdx++] = FOURPLAY_SLOT3;
}
if (bIsSlot4Empty || bIsSlot4FourPlay)
{
const UINT uStrLen = strlen(m_szFourPlaySlotChoice_Slot4)+1;
memcpy(&m_szFourPlaySlotChoices[uStringOffset], m_szFourPlaySlotChoice_Slot4, uStrLen);
uStringOffset += uStrLen;
m_FourPlayComboItemToChoice[uComboItemIdx++] = FOURPLAY_SLOT4;
}
if (bIsSlot5Empty || bIsSlot5FourPlay)
{
const UINT uStrLen = strlen(m_szFourPlaySlotChoice_Slot5)+1;
memcpy(&m_szFourPlaySlotChoices[uStringOffset], m_szFourPlaySlotChoice_Slot5, uStrLen);
uStringOffset += uStrLen;
m_FourPlayComboItemToChoice[uComboItemIdx++] = FOURPLAY_SLOT5;
}
if (uStringOffset)
{
const UINT uStrLen = strlen(m_szFourPlaySlotChoice_Unplugged)+1;
memcpy(&m_szFourPlaySlotChoices[uStringOffset], m_szFourPlaySlotChoice_Unplugged, uStrLen);
uStringOffset += uStrLen;
m_FourPlayComboItemToChoice[uComboItemIdx] = FOURPLAY_UNPLUGGED;
}
else
{
const UINT uStrLen = strlen(m_szFourPlaySlotChoice_Unavailable)+1;
memcpy(&m_szFourPlaySlotChoices[uStringOffset], m_szFourPlaySlotChoice_Unavailable, uStrLen);
uStringOffset += uStrLen;
m_FourPlayChoice = FOURPLAY_UNAVAILABLE; // Force this
m_FourPlayComboItemToChoice[uComboItemIdx] = FOURPLAY_UNAVAILABLE;
}
m_szFourPlaySlotChoices[uStringOffset] = 0; // Doubly null terminated
//
UINT uCurrentChoice = uComboItemIdx; // Default to last item (either UNPLUGGED or UNAVAILABLE)
for (UINT i=0; i<=uComboItemIdx; i++)
{
if (m_FourPlayComboItemToChoice[i] == m_FourPlayChoice)
{
uCurrentChoice = i;
break;
}
}
m_PropertySheetHelper.FillComboBox(hWnd, IDC_FOURPLAY_CONFIG, m_szFourPlaySlotChoices, uCurrentChoice);
}
void CPageInput::InitSNESMAXChoices(HWND hWnd)
{
const SS_CARDTYPE slot3 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT3];
const SS_CARDTYPE slot4 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT4];
const SS_CARDTYPE slot5 = m_PropertySheetHelper.GetConfigNew().m_Slot[SLOT5];
if (slot3 == CT_SNESMAX) m_SNESMAXChoice = SNESMAX_SLOT3;
else if (slot4 == CT_SNESMAX) m_SNESMAXChoice = SNESMAX_SLOT4;
else if (slot5 == CT_SNESMAX) m_SNESMAXChoice = SNESMAX_SLOT5;
else m_SNESMAXChoice = SNESMAX_UNPLUGGED;
for (UINT i=0; i<_SNESMAX_MAX_CHOICES; i++)
m_SNESMAXComboItemToChoice[i] = SNESMAX_UNAVAILABLE;
UINT uStringOffset = 0;
UINT uComboItemIdx = 0;
const bool bIsSlot3Empty = slot3 == CT_Empty;
const bool bIsSlot3SNESMAX = slot3 == CT_SNESMAX;
const bool bIsSlot4Empty = slot4 == CT_Empty;
const bool bIsSlot4SNESMAX = slot4 == CT_SNESMAX;
const bool bIsSlot5Empty = slot5 == CT_Empty;
const bool bIsSlot5SNESMAX = slot5 == CT_SNESMAX;
if (bIsSlot3Empty || bIsSlot3SNESMAX)
{
const UINT uStrLen = strlen(m_szSNESMAXSlotChoice_Slot3) + 1;
memcpy(&m_szSNESMAXSlotChoices[uStringOffset], m_szSNESMAXSlotChoice_Slot3, uStrLen);
uStringOffset += uStrLen;
m_SNESMAXComboItemToChoice[uComboItemIdx++] = SNESMAX_SLOT3;
}
if (bIsSlot4Empty || bIsSlot4SNESMAX)
{
const UINT uStrLen = strlen(m_szSNESMAXSlotChoice_Slot4)+1;
memcpy(&m_szSNESMAXSlotChoices[uStringOffset], m_szSNESMAXSlotChoice_Slot4, uStrLen);
uStringOffset += uStrLen;
m_SNESMAXComboItemToChoice[uComboItemIdx++] = SNESMAX_SLOT4;
}
if (bIsSlot5Empty || bIsSlot5SNESMAX)
{
const UINT uStrLen = strlen(m_szSNESMAXSlotChoice_Slot5)+1;
memcpy(&m_szSNESMAXSlotChoices[uStringOffset], m_szSNESMAXSlotChoice_Slot5, uStrLen);
uStringOffset += uStrLen;
m_SNESMAXComboItemToChoice[uComboItemIdx++] = SNESMAX_SLOT5;
}
if (uStringOffset)
{
const UINT uStrLen = strlen(m_szSNESMAXSlotChoice_Unplugged)+1;
memcpy(&m_szSNESMAXSlotChoices[uStringOffset], m_szSNESMAXSlotChoice_Unplugged, uStrLen);
uStringOffset += uStrLen;
m_SNESMAXComboItemToChoice[uComboItemIdx] = SNESMAX_UNPLUGGED;
}
else
{
const UINT uStrLen = strlen(m_szSNESMAXSlotChoice_Unavailable)+1;
memcpy(&m_szSNESMAXSlotChoices[uStringOffset], m_szSNESMAXSlotChoice_Unavailable, uStrLen);
uStringOffset += uStrLen;
m_SNESMAXChoice = SNESMAX_UNAVAILABLE; // Force this
m_SNESMAXComboItemToChoice[uComboItemIdx] = SNESMAX_UNAVAILABLE;
}
m_szSNESMAXSlotChoices[uStringOffset] = 0; // Doubly null terminated
//
UINT uCurrentChoice = uComboItemIdx; // Default to last item (either UNPLUGGED or UNAVAILABLE)
for (UINT i=0; i<=uComboItemIdx; i++)
{
if (m_SNESMAXComboItemToChoice[i] == m_SNESMAXChoice)
{
uCurrentChoice = i;
break;
}
}
m_PropertySheetHelper.FillComboBox(hWnd, IDC_SNESMAX_CONFIG, m_szSNESMAXSlotChoices, uCurrentChoice);
}

View file

@ -19,15 +19,13 @@ public:
m_bSwapButtons0and1(false),
m_uMouseShowCrosshair(0),
m_uMouseRestrictToWindow(0),
m_CPMChoice(CPM_UNPLUGGED),
m_FourPlayChoice(FOURPLAY_UNPLUGGED),
m_SNESMAXChoice(SNESMAX_UNPLUGGED)
m_CPMChoice(CPM_UNPLUGGED)
{
CPageInput::ms_this = this;
}
virtual ~CPageInput(){}
static INT_PTR CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
static BOOL CALLBACK DlgProc(HWND window, UINT message, WPARAM wparam, LPARAM lparam);
UINT GetScrollLockToggle(void){ return m_uScrollLockToggle; }
void SetScrollLockToggle(UINT uValue){ m_uScrollLockToggle = uValue; }
@ -46,7 +44,7 @@ public:
protected:
// IPropertySheetPage
virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND hWnd);
virtual void DlgCANCEL(HWND hWnd){}
@ -55,8 +53,6 @@ private:
void InitJoystickChoices(HWND hWnd, int nJoyNum, int nIdcValue);
void InitSlotOptions(HWND hWnd);
void InitCPMChoices(HWND hWnd);
void InitFourPlayChoices(HWND hWnd);
void InitSNESMAXChoices(HWND hWnd);
static CPageInput* ms_this;
static const UINT MaxMenuChoiceLen = 40;
@ -76,18 +72,6 @@ private:
static const TCHAR m_szCPMSlotChoice_Unplugged[];
static const TCHAR m_szCPMSlotChoice_Unavailable[];
static const TCHAR m_szFourPlaySlotChoice_Slot3[];
static const TCHAR m_szFourPlaySlotChoice_Slot4[];
static const TCHAR m_szFourPlaySlotChoice_Slot5[];
static const TCHAR m_szFourPlaySlotChoice_Unplugged[];
static const TCHAR m_szFourPlaySlotChoice_Unavailable[];
static const TCHAR m_szSNESMAXSlotChoice_Slot3[];
static const TCHAR m_szSNESMAXSlotChoice_Slot4[];
static const TCHAR m_szSNESMAXSlotChoice_Slot5[];
static const TCHAR m_szSNESMAXSlotChoice_Unplugged[];
static const TCHAR m_szSNESMAXSlotChoice_Unavailable[];
int m_nJoy0ChoiceTranlationTbl[J0C_MAX];
TCHAR m_joystick0choices[J0C_MAX * MaxMenuChoiceLen];
int m_nJoy1ChoiceTranlationTbl[J1C_MAX];
@ -108,14 +92,4 @@ private:
TCHAR m_szCPMSlotChoices[_CPM_MAX_CHOICES * MaxMenuChoiceLen];
CPMCHOICE m_CPMChoice;
CPMCHOICE m_CPMComboItemToChoice[_CPM_MAX_CHOICES];
enum FOURPLAYCHOICE {FOURPLAY_SLOT3=0, FOURPLAY_SLOT4, FOURPLAY_SLOT5, FOURPLAY_UNPLUGGED, FOURPLAY_UNAVAILABLE, _FOURPLAY_MAX_CHOICES};
TCHAR m_szFourPlaySlotChoices[_FOURPLAY_MAX_CHOICES * MaxMenuChoiceLen];
FOURPLAYCHOICE m_FourPlayChoice;
FOURPLAYCHOICE m_FourPlayComboItemToChoice[_FOURPLAY_MAX_CHOICES];
enum SNESMAXCHOICE {SNESMAX_SLOT3=0, SNESMAX_SLOT4, SNESMAX_SLOT5, SNESMAX_UNPLUGGED, SNESMAX_UNAVAILABLE, _SNESMAX_MAX_CHOICES};
TCHAR m_szSNESMAXSlotChoices[_SNESMAX_MAX_CHOICES * MaxMenuChoiceLen];
SNESMAXCHOICE m_SNESMAXChoice;
SNESMAXCHOICE m_SNESMAXComboItemToChoice[_SNESMAX_MAX_CHOICES];
};

View file

@ -40,13 +40,13 @@ const TCHAR CPageSound::m_soundchoices[] = TEXT("Disabled\0")
TEXT("Sound Card\0");
INT_PTR CALLBACK CPageSound::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CALLBACK CPageSound::DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
// Switch from static func to our instance
return CPageSound::ms_this->DlgProcInternal(hWnd, message, wparam, lparam);
}
INT_PTR CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
BOOL CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam)
{
switch (message)
{
@ -62,11 +62,11 @@ INT_PTR CPageSound::DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPAR
InitOptions(hWnd);
break;
case PSN_KILLACTIVE:
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, FALSE); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, FALSE); // Changes are valid
break;
case PSN_APPLY:
DlgOK(hWnd);
SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); // Changes are valid
SetWindowLong(hWnd, DWL_MSGRESULT, PSNRET_NOERROR); // Changes are valid
break;
case PSN_QUERYCANCEL:
// Can use this to ask user to confirm cancel
@ -139,9 +139,11 @@ void CPageSound::DlgOK(HWND hWnd)
const DWORD dwSpkrVolume = SendDlgItemMessage(hWnd, IDC_SPKR_VOLUME, TBM_GETPOS, 0, 0);
const DWORD dwMBVolume = SendDlgItemMessage(hWnd, IDC_MB_VOLUME, TBM_GETPOS, 0, 0);
SpkrSetEmulationType(newSoundType);
DWORD dwSoundType = (soundtype == SOUND_NONE) ? REG_SOUNDTYPE_NONE : REG_SOUNDTYPE_WAVE;
REGSAVE(TEXT(REGVALUE_SOUND_EMULATION), dwSoundType);
if (SpkrSetEmulationType(hWnd, newSoundType))
{
DWORD dwSoundType = (soundtype == SOUND_NONE) ? REG_SOUNDTYPE_NONE : REG_SOUNDTYPE_WAVE;
REGSAVE(TEXT(REGVALUE_SOUND_EMULATION), dwSoundType);
}
// NB. Volume: 0=Loudest, VOLUME_MAX=Silence
SpkrSetVolume(dwSpkrVolume, VOLUME_MAX);

View file

@ -19,13 +19,13 @@ public:
}
virtual ~CPageSound(){}
static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
static BOOL CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
DWORD GetVolumeMax(void){ return VOLUME_MAX; }
protected:
// IPropertySheetPage
virtual INT_PTR DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual BOOL DlgProcInternal(HWND hWnd, UINT message, WPARAM wparam, LPARAM lparam);
virtual void DlgOK(HWND hWnd);
virtual void DlgCANCEL(HWND hWnd){}

View file

@ -43,31 +43,31 @@ void CPropertySheet::Init(void)
PropSheetPages[PG_CONFIG].dwFlags = PSP_DEFAULT;
PropSheetPages[PG_CONFIG].hInstance = GetFrame().g_hInstance;
PropSheetPages[PG_CONFIG].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_CONFIG);
PropSheetPages[PG_CONFIG].pfnDlgProc = CPageConfig::DlgProc;
PropSheetPages[PG_CONFIG].pfnDlgProc = (DLGPROC)CPageConfig::DlgProc;
PropSheetPages[PG_INPUT].dwSize = sizeof(PROPSHEETPAGE);
PropSheetPages[PG_INPUT].dwFlags = PSP_DEFAULT;
PropSheetPages[PG_INPUT].hInstance = GetFrame().g_hInstance;
PropSheetPages[PG_INPUT].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_INPUT);
PropSheetPages[PG_INPUT].pfnDlgProc = CPageInput::DlgProc;
PropSheetPages[PG_INPUT].pfnDlgProc = (DLGPROC)CPageInput::DlgProc;
PropSheetPages[PG_SOUND].dwSize = sizeof(PROPSHEETPAGE);
PropSheetPages[PG_SOUND].dwFlags = PSP_DEFAULT;
PropSheetPages[PG_SOUND].hInstance = GetFrame().g_hInstance;
PropSheetPages[PG_SOUND].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_SOUND);
PropSheetPages[PG_SOUND].pfnDlgProc = CPageSound::DlgProc;
PropSheetPages[PG_SOUND].pfnDlgProc = (DLGPROC)CPageSound::DlgProc;
PropSheetPages[PG_DISK].dwSize = sizeof(PROPSHEETPAGE);
PropSheetPages[PG_DISK].dwFlags = PSP_DEFAULT;
PropSheetPages[PG_DISK].hInstance = GetFrame().g_hInstance;
PropSheetPages[PG_DISK].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_DISK);
PropSheetPages[PG_DISK].pfnDlgProc = CPageDisk::DlgProc;
PropSheetPages[PG_DISK].pfnDlgProc = (DLGPROC)CPageDisk::DlgProc;
PropSheetPages[PG_ADVANCED].dwSize = sizeof(PROPSHEETPAGE);
PropSheetPages[PG_ADVANCED].dwFlags = PSP_DEFAULT;
PropSheetPages[PG_ADVANCED].hInstance = GetFrame().g_hInstance;
PropSheetPages[PG_ADVANCED].pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE_ADVANCED);
PropSheetPages[PG_ADVANCED].pfnDlgProc = CPageAdvanced::DlgProc;
PropSheetPages[PG_ADVANCED].pfnDlgProc = (DLGPROC)CPageAdvanced::DlgProc;
PROPSHEETHEADER PropSheetHeader;

View file

@ -28,10 +28,6 @@ public:
{
m_PropertySheetHelper.ApplyNewConfig(ConfigNew, ConfigOld);
}
void ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew)
{
m_PropertySheetHelper.ApplyNewConfigFromSnapshot(ConfigNew);
}
void ConfigSaveApple2Type(eApple2Type apple2Type)
{
m_PropertySheetHelper.ConfigSaveApple2Type(apple2Type);

View file

@ -28,12 +28,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../Windows/AppleWin.h" // g_nAppMode, g_uScrollLockToggle, sg_PropertySheet
#include "../CardManager.h"
#include "../Memory.h"
#include "../Disk.h"
#include "../Windows/WinFrame.h"
#include "../Log.h"
#include "../Registry.h"
#include "../SaveState.h"
#include "../Tfe/PCapBackend.h"
/*
Config causing AfterClose msgs:
@ -127,17 +126,32 @@ void CPropertySheetHelper::SetSlot(UINT slot, SS_CARDTYPE newCardType)
if (slot >= NUM_SLOTS)
return;
if (GetCardMgr().QuerySlot(slot) == newCardType)
return;
// Two paths:
// 1) Via Config dialog: card not inserted yet
// 2) Snapshot_LoadState_v2(): card already inserted
if (GetCardMgr().QuerySlot(slot) != newCardType)
GetCardMgr().Insert(slot, newCardType);
GetCardMgr().Insert(slot, newCardType);
GetCardMgr().GetRef(slot).InitializeIO(GetCxRomPeripheral());
std::string slotText;
switch (slot)
{
case 0: slotText = REGVALUE_SLOT0; break;
case 1: slotText = REGVALUE_SLOT1; break;
case 2: slotText = REGVALUE_SLOT2; break;
case 3: slotText = REGVALUE_SLOT3; break;
case 4: slotText = REGVALUE_SLOT4; break;
case 5: slotText = REGVALUE_SLOT5; break;
case 6: slotText = REGVALUE_SLOT6; break;
case 7: slotText = REGVALUE_SLOT7; break;
}
REGSAVE(slotText.c_str(), (DWORD)newCardType);
}
// Used by:
// . CPageDisk: IDC_CIDERPRESS_BROWSE
// . CPageAdvanced: IDC_PRINTER_DUMP_FILENAME_BROWSE
std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, const TCHAR* pszTitle, const TCHAR* REGVALUE, const TCHAR* FILEMASKS)
std::string CPropertySheetHelper::BrowseToFile(HWND hWindow, TCHAR* pszTitle, TCHAR* REGVALUE, TCHAR* FILEMASKS)
{
TCHAR szFilename[MAX_PATH];
RegLoadString(REG_CONFIG, REGVALUE, 1, szFilename, MAX_PATH, TEXT(""));
@ -176,7 +190,7 @@ void CPropertySheetHelper::SaveStateUpdate()
}
// NB. OK'ing this property sheet will call SaveStateUpdate()->Snapshot_SetFilename() with this new path & filename
int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, const TCHAR* pszTitle, bool bSave)
int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave)
{
// Whenever harddisks/disks are inserted (or removed) and *if path has changed* then:
// . Snapshot's path & Snapshot's filename will be updated to reflect the new defaults.
@ -196,7 +210,7 @@ int CPropertySheetHelper::SaveStateSelectImage(HWND hWindow, const TCHAR* pszTit
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hWindow;
ofn.hInstance = GetFrame().g_hInstance;
ofn.lpstrFilter = TEXT("Save State files (*.aws.yaml)\0*.aws.yaml\0")
ofn.lpstrFilter = TEXT("Save State files (*.aws.yaml)\0*.aws.yaml\0");
TEXT("All Files\0*.*\0");
ofn.lpstrFile = szFilename; // Dialog strips the last .EXT from this string (eg. file.aws.yaml is displayed as: file.aws
ofn.nMaxFile = sizeof(szFilename);
@ -272,7 +286,7 @@ void CPropertySheetHelper::PostMsgAfterClose(HWND hWnd, PAGETYPE page)
return;
}
bool restart = false;
UINT uAfterClose = 0;
if (m_ConfigNew.m_Apple2Type == A2TYPE_CLONE)
{
@ -297,11 +311,11 @@ void CPropertySheetHelper::PostMsgAfterClose(HWND hWnd, PAGETYPE page)
ApplyNewConfig();
restart = true;
uAfterClose = WM_USER_RESTART;
}
if (restart)
GetFrame().Restart();
if (uAfterClose)
PostMessage(GetFrame().g_hFrameWindow, uAfterClose, 0, 0);
}
bool CPropertySheetHelper::CheckChangesForRestart(HWND hWnd)
@ -331,24 +345,22 @@ void CPropertySheetHelper::ApplyNewConfig(const CConfigNeedingRestart& ConfigNew
SaveCpuType(ConfigNew.m_CpuType);
}
UINT slot = SLOT3;
UINT slot = 4;
if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
SetSlot(slot, ConfigNew.m_Slot[slot]);
// unconditionally save it, as the previous SetSlot might have removed the setting
PCapBackend::tfe_SetRegistryInterface(slot, ConfigNew.m_tfeInterface);
slot = SLOT4;
slot = 5;
if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
SetSlot(slot, ConfigNew.m_Slot[slot]);
slot = SLOT5;
if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
SetSlot(slot, ConfigNew.m_Slot[slot]);
// slot = 7;
// if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
// SetSlot(slot, ConfigNew.m_Slot[slot]);
slot = SLOT7;
if (CONFIG_CHANGED_LOCAL(m_Slot[slot]))
SetSlot(slot, ConfigNew.m_Slot[slot]);
if (CONFIG_CHANGED_LOCAL(m_bEnableHDD))
{
REGSAVE(TEXT(REGVALUE_HDD_ENABLED), ConfigNew.m_bEnableHDD ? 1 : 0); // TODO: Change to REGVALUE_SLOT7
}
if (CONFIG_CHANGED_LOCAL(m_bEnableTheFreezesF8Rom))
{
@ -361,14 +373,6 @@ void CPropertySheetHelper::ApplyNewConfig(const CConfigNeedingRestart& ConfigNew
}
}
void CPropertySheetHelper::ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew)
{
SaveComputerType(ConfigNew.m_Apple2Type);
SaveCpuType(ConfigNew.m_CpuType);
REGSAVE(TEXT(REGVALUE_THE_FREEZES_F8_ROM), ConfigNew.m_bEnableTheFreezesF8Rom);
REGSAVE(TEXT(REGVALUE_VIDEO_REFRESH_RATE), ConfigNew.m_videoRefreshRate);
}
void CPropertySheetHelper::ApplyNewConfig(void)
{
ApplyNewConfig(m_ConfigNew, m_ConfigOld);
@ -377,9 +381,16 @@ void CPropertySheetHelper::ApplyNewConfig(void)
void CPropertySheetHelper::SaveCurrentConfig(void)
{
// NB. clone-type is encoded in g_Apple2Type
m_ConfigOld.Reload();
m_ConfigOld.m_Apple2Type = GetApple2Type();
m_ConfigOld.m_CpuType = GetMainCpu();
m_ConfigOld.m_Slot[SLOT4] = GetCardMgr().QuerySlot(SLOT4);
m_ConfigOld.m_Slot[SLOT5] = GetCardMgr().QuerySlot(SLOT5);
m_ConfigOld.m_bEnableHDD = HD_CardIsEnabled();
m_ConfigOld.m_bEnableTheFreezesF8Rom = GetPropertySheet().GetTheFreezesF8Rom();
m_ConfigOld.m_videoRefreshRate = GetVideo().GetVideoRefreshRate();
// Reset flags each time:
m_ConfigOld.m_uSaveLoadStateMsg = 0;
m_bDoBenchmark = false;
// Setup ConfigNew
@ -391,11 +402,11 @@ void CPropertySheetHelper::RestoreCurrentConfig(void)
// NB. clone-type is encoded in g_Apple2Type
SetApple2Type(m_ConfigOld.m_Apple2Type);
SetMainCpu(m_ConfigOld.m_CpuType);
SetSlot(SLOT3, m_ConfigOld.m_Slot[SLOT3]);
SetSlot(SLOT4, m_ConfigOld.m_Slot[SLOT4]);
SetSlot(SLOT5, m_ConfigOld.m_Slot[SLOT5]);
SetSlot(SLOT7, m_ConfigOld.m_Slot[SLOT7]);
GetCardMgr().Insert(SLOT4, m_ConfigOld.m_Slot[SLOT4]);
GetCardMgr().Insert(SLOT5, m_ConfigOld.m_Slot[SLOT5]);
HD_SetEnabled(m_ConfigOld.m_bEnableHDD);
GetPropertySheet().SetTheFreezesF8Rom(m_ConfigOld.m_bEnableTheFreezesF8Rom);
m_ConfigNew.m_videoRefreshRate = m_ConfigOld.m_videoRefreshRate; // Not SetVideoRefreshRate(), as this re-inits much Video/NTSC state!
}
bool CPropertySheetHelper::IsOkToSaveLoadState(HWND hWnd, const bool bConfigChanged)
@ -449,19 +460,13 @@ bool CPropertySheetHelper::HardwareConfigChanged(HWND hWnd)
if (CONFIG_CHANGED(m_videoRefreshRate))
strMsgMain += ". Video refresh rate has changed\n";
if (CONFIG_CHANGED(m_Slot[SLOT3]))
strMsgMain += GetSlot(SLOT3);
if (CONFIG_CHANGED(m_Slot[4]))
strMsgMain += GetSlot(4);
if (CONFIG_CHANGED(m_tfeInterface))
strMsgMain += ". Uthernet interface has changed\n";
if (CONFIG_CHANGED(m_Slot[5]))
strMsgMain += GetSlot(5);
if (CONFIG_CHANGED(m_Slot[SLOT4]))
strMsgMain += GetSlot(SLOT4);
if (CONFIG_CHANGED(m_Slot[SLOT5]))
strMsgMain += GetSlot(SLOT5);
if (CONFIG_CHANGED(m_Slot[SLOT7]))
if (CONFIG_CHANGED(m_bEnableHDD))
strMsgMain += ". Harddisk(s) have been plugged/unplugged\n";
if (CONFIG_CHANGED(m_bEnableTheFreezesF8Rom))
@ -498,22 +503,55 @@ std::string CPropertySheetHelper::GetSlot(const UINT uSlot)
{
if (NewCardType == CT_Empty)
{
strMsg += Card::GetCardName(OldCardType);
strMsg += GetCardName(OldCardType);
strMsg += " card removed\n";
}
else
{
strMsg += Card::GetCardName(NewCardType);
strMsg += GetCardName(NewCardType);
strMsg += " card added\n";
}
}
else
{
strMsg += Card::GetCardName(OldCardType);
strMsg += GetCardName(OldCardType);
strMsg += " card removed & ";
strMsg += Card::GetCardName(NewCardType);
strMsg += GetCardName(NewCardType);
strMsg += " card added\n";
}
return strMsg;
}
std::string CPropertySheetHelper::GetCardName(const SS_CARDTYPE CardType)
{
switch (CardType)
{
case CT_Empty:
return "Empty";
case CT_Disk2: // Apple Disk][
return "Disk][";
case CT_SSC: // Apple Super Serial Card
return "Super Serial";
case CT_MockingboardC: // Soundcard
return "Mockingboard";
case CT_GenericPrinter:
return "Printer";
case CT_GenericHDD: // Hard disk
return "Hard Disk";
case CT_GenericClock:
return "Clock";
case CT_MouseInterface:
return "Mouse";
case CT_Z80:
return "CP/M";
case CT_Phasor: // Soundcard
return "Phasor";
case CT_Echo: // Soundcard
return "Echo";
case CT_SAM: // Soundcard: Software Automated Mouth
return "SAM";
default:
return "Unknown";
}
}

View file

@ -14,9 +14,10 @@ public:
virtual ~CPropertySheetHelper(){}
void FillComboBox(HWND window, int controlid, LPCTSTR choices, int currentchoice);
std::string BrowseToFile(HWND hWindow, const TCHAR* pszTitle, const TCHAR* REGVALUE, const TCHAR* FILEMASKS);
void SetSlot(UINT slot, SS_CARDTYPE newCardType);
std::string BrowseToFile(HWND hWindow, TCHAR* pszTitle, TCHAR* REGVALUE,TCHAR* FILEMASKS);
void SaveStateUpdate();
int SaveStateSelectImage(HWND hWindow, const TCHAR* pszTitle, bool bSave);
int SaveStateSelectImage(HWND hWindow, TCHAR* pszTitle, bool bSave);
void PostMsgAfterClose(HWND hWnd, PAGETYPE page);
void ResetPageMask(void) { m_bmPages = 0; } // Req'd because cancelling doesn't clear the page-mask
@ -29,14 +30,12 @@ public:
void SaveCurrentConfig(void);
const std::string & GetSSNewFilename(void) { return m_szSSNewFilename; }
const CConfigNeedingRestart& GetConfigOld(void) { return m_ConfigOld; }
// const CConfigNeedingRestart& GetConfigOld(void) { return m_ConfigOld; }
CConfigNeedingRestart& GetConfigNew(void) { return m_ConfigNew; }
bool IsConfigChanged(void) { return m_ConfigNew != m_ConfigOld; }
void SetDoBenchmark(void) { m_bDoBenchmark = true; }
void ApplyNewConfig(const CConfigNeedingRestart& ConfigNew, const CConfigNeedingRestart& ConfigOld);
void ApplyNewConfigFromSnapshot(const CConfigNeedingRestart& ConfigNew);
void ConfigSaveApple2Type(eApple2Type apple2Type);
void SetSlot(UINT slot, SS_CARDTYPE newCardType);
private:
bool IsOkToSaveLoadState(HWND hWnd, const bool bConfigChanged);
@ -48,6 +47,7 @@ private:
void ApplyNewConfig(void);
void RestoreCurrentConfig(void);
std::string GetSlot(const UINT uSlot);
std::string GetCardName(const SS_CARDTYPE CardType);
PAGETYPE m_LastPage;
UINT32 m_bmPages;

View file

@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Log.h"
#include "Memory.h"
#include "Mockingboard.h"
#include "Pravets.h"
#include "Speaker.h"
#include "Registry.h"
#include "SynchronousEventManager.h"
@ -44,10 +43,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Speech.h"
#endif
static UINT16 g_OldAppleWinVersion[4] = { 0 };
static const UINT VERSIONSTRING_SIZE = 16;
static UINT16 g_OldAppleWinVersion[4] = {0};
UINT16 g_AppleWinVersion[4] = { 0 };
std::string g_VERSIONSTRING = "xx.yy.zz.ww";
TCHAR VERSIONSTRING[VERSIONSTRING_SIZE] = "xx.yy.zz.ww";
std::string g_pAppTitle;
@ -257,15 +256,14 @@ void SetAppleWinVersion(UINT16 major, UINT16 minor, UINT16 fix, UINT16 fix_minor
g_AppleWinVersion[1] = minor;
g_AppleWinVersion[2] = fix;
g_AppleWinVersion[3] = fix_minor;
g_VERSIONSTRING = StrFormat("%d.%d.%d.%d", major, minor, fix, fix_minor);
StringCbPrintf(VERSIONSTRING, VERSIONSTRING_SIZE, "%d.%d.%d.%d", major, minor, fix, fix_minor);
}
bool CheckOldAppleWinVersion(void)
{
const int VERSIONSTRING_SIZE = 16;
char szOldAppleWinVersion[VERSIONSTRING_SIZE + 1];
RegLoadString(REG_CONFIG, REGVALUE_VERSION, TRUE, szOldAppleWinVersion, VERSIONSTRING_SIZE, "");
const bool bShowAboutDlg = (g_VERSIONSTRING != szOldAppleWinVersion);
TCHAR szOldAppleWinVersion[VERSIONSTRING_SIZE + 1];
RegLoadString(TEXT(REG_CONFIG), TEXT(REGVALUE_VERSION), 1, szOldAppleWinVersion, VERSIONSTRING_SIZE, TEXT(""));
const bool bShowAboutDlg = strcmp(szOldAppleWinVersion, VERSIONSTRING) != 0;
// version: xx.yy.zz.ww
char* p0 = szOldAppleWinVersion;
@ -289,17 +287,11 @@ bool SetCurrentImageDir(const std::string& pszImageDir)
{
g_sCurrentDir = pszImageDir;
if (!g_sCurrentDir.empty() && *g_sCurrentDir.rbegin() != PATH_SEPARATOR)
g_sCurrentDir += PATH_SEPARATOR;
if (!g_sCurrentDir.empty() && *g_sCurrentDir.rbegin() != '\\')
g_sCurrentDir += '\\';
if (SetCurrentDirectory(g_sCurrentDir.c_str()))
return true;
return false;
}
Pravets& GetPravets(void)
{
static Pravets pravets;
return pravets;
}

View file

@ -2,14 +2,12 @@
#include "Card.h"
#include "Common.h"
#include "StrFormat.h"
#include "Log.h"
void LogFileTimeUntilFirstKeyReadReset(void);
void LogFileTimeUntilFirstKeyRead(void);
extern const UINT16* GetOldAppleWinVersion(void);
extern std::string g_VERSIONSTRING; // Constructed in WinMain()
extern TCHAR VERSIONSTRING[]; // Constructed in WinMain()
void SetAppleWinVersion(UINT16 major, UINT16 minor, UINT16 fix, UINT16 fix_minor);
bool CheckOldAppleWinVersion(void);
@ -69,8 +67,6 @@ extern bool g_bDisableDirectInput; // Cmd line switch: don't init DI (s
extern bool g_bDisableDirectSound; // Cmd line switch: don't init DS (so no MB/Speaker support)
extern bool g_bDisableDirectSoundMockingboard; // Cmd line switch: don't init MB support
class Pravets& GetPravets(void);
//#define LOG_PERF_TIMINGS
#ifdef LOG_PERF_TIMINGS
class PerfMarker

File diff suppressed because it is too large Load diff

Some files were not shown because too many files have changed in this diff Show more