Merge branch 'config_cleanup' into 'experimental'

Config cleanup and Win32 parity

See merge request dbrock/gsplus!13
This commit is contained in:
Dagen Brock 2018-07-25 14:46:32 -05:00
commit 864b01a93c
103 changed files with 1303 additions and 2414 deletions

View File

@ -2,6 +2,8 @@ stages:
- build
- package
build-ubuntu-x:
tags:
- ubuntu
@ -23,14 +25,14 @@ package-ubuntu-x:
script:
- cp src/config.txt .
- 'echo "# CI_BUILD_ID: $CI_BUILD_ID" >> config.txt'
- cp COPYING.txt doc/
- cp LICENSE.txt doc/
artifacts:
paths:
- gsplusx
- config.txt
- doc/gsplusmanual.txt
- doc/gsplusmanual.pdf
- doc/COPYING.txt
- doc/LICENSE.txt
@ -45,6 +47,9 @@ build-ubuntu-sdl:
- make clean ; make
build-ubuntu-sdl2:
tags:
- ubuntu
@ -67,16 +72,17 @@ package-ubuntu-sdl2:
script:
- cp src/config.txt .
- 'echo "# CI_BUILD_ID: $CI_BUILD_ID" >> config.txt'
- cp COPYING.txt doc/
- cp LICENSE.txt doc/
- mv gsplus-ubuntu-sdl gsplus
artifacts:
paths:
- gsplus
- config.txt
- doc/README.txt
- doc/gsplusmanual.txt
- doc/gsplusmanual.pdf
- doc/COPYING.txt
- doc/LICENSE.txt
build-osx:
@ -130,7 +136,7 @@ package-win32:
script:
- cp src/config.txt .
- 'echo "# CI_BUILD_ID: $CI_BUILD_ID" >> config.txt'
- cp COPYING.txt doc/
- cp LICENSE.txt doc/
- cp /bin/cyggcc_s-1.dll .
- cp /bin/cygstdc++-6.dll .
- cp /bin/cygwin1.dll .
@ -140,73 +146,87 @@ package-win32:
paths:
- gsplus32.exe
- config.txt
- doc/gsplusmanual.txt
- doc/gsplusmanual.pdf
- doc/README.txt
- doc/COPYING.txt
- doc/LICENSE.txt
- cyggcc_s-1.dll
- cygstdc++-6.dll
- cygwin1.dll
- cygfreetype-6.dll
build-win-sdl:
build-win-sdl2:
tags:
- windows
stage: build
script:
- cd src
- ln -s vars_win32_sdl vars
- ln -s vars_win32_sdl2 vars
- make clean
- make
- cp parallel.rom ..
- cp /cygdrive/c/cygwin/bin/cygbz2-1.dll ..
- cp /cygdrive/c/cygwin/bin/cygfreetype-6.dll ..
- cp /cygdrive/c/cygwin/bin/cyggcc_s-1.dll ..
- cp /cygdrive/c/cygwin/bin/cygjpeg-8.dll ..
- cp /cygdrive/c/cygwin/bin/cygpng16-16.dll ..
- cp /cygdrive/c/cygwin/bin/cygjpeg-8.dll ..
- cp /cygdrive/c/cygwin/bin/cygstdc++-6.dll ..
- cp /cygdrive/c/cygwin/bin/cygwin1.dll ..
- cp /cygdrive/c/cygwin/bin/cygz.dll ..
- cp /cygdrive/c/mingw/i686-w64-mingw32/bin/SDL2.dll ..
- cp /cygdrive/c/mingw/i686-w64-mingw32/bin/SDL2_image.dll ..
artifacts:
paths:
- gsplus.exe
- parallel.rom
- cygbz2-1.dll
- cygfreetype-6.dll
- cyggcc_s-1.dll
- cygjpeg-8.dll
- cygpng16-16.dll
- cygjpeg-8.dll
- cygstdc++-6.dll
- cygwin1.dll
- cygz.dll
- SDL2.dll
- SDL2_image.dll
expire_in: 5 minutes
package-win-sdl:
package-win-sdl2:
tags:
- windows
stage: package
script:
- pwd
- ls -al
- cp src/config.txt .
- 'echo "# CI_BUILD_ID: $CI_BUILD_ID" >> config.txt'
- cp COPYING.txt doc/
- cp /bin/cyggcc_s-1.dll .
- cp /bin/cygstdc++-6.dll .
- cp /bin/cygwin1.dll .
- cp /bin/cygfreetype-6.dll .
- cp /bin/cygbz2-1.dll .
- cp /bin/cygpng16-16.dll .
- cp /bin/cygz.dll .
- cp /bin/cygSDL2-2-0-0.dll .
- cp /bin/cygSDL2_image-2-0-0.dll .
- cp /bin/cygjpeg-8.dll .
- cp /bin/cygtiff-6.dll .
- cp /bin/cygjbig-2.dll .
- cp /bin/cyglzma-5.dll .
- cp /bin/cygwebp-5.dll .
- cp LICENSE.txt doc/
artifacts:
paths:
- gsplus.exe
- config.txt
- doc/gsplusmanual.txt
- doc/gsplusmanual.pdf
- doc/COPYING.txt
- doc/LICENSE.txt
- doc/README.txt
- parallel.rom
- cygbz2-1.dll
- cygfreetype-6.dll
- cyggcc_s-1.dll
- cygjpeg-8.dll
- cygpng16-16.dll
- cygjpeg-8.dll
- cygstdc++-6.dll
- cygwin1.dll
- cygfreetype-6.dll
- cygbz2-1.dll
- cygpng16-16.dll
- cygz.dll
- cygSDL2-2-0-0.dll
- cygSDL2_image-2-0-0.dll
- cygjpeg-8.dll
- cygtiff-6.dll
- cygjbig-2.dll
- cyglzma-5.dll
- cygwebp-5.dll
- SDL2.dll
- SDL2_image.dll

19
COPYRIGHT.txt Normal file
View File

@ -0,0 +1,19 @@
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
Copyright (C) 2016 - 2018 Dagen Brock
Copyright (C) 2010 - 2014 GSport contributors
Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>gsplus</string>
<key>CFBundleGetInfoString</key>
<string>0.12s, Copyright 2016 Dagen Brock</string>
<string>0.14, Copyright 2018 Dagen Brock</string>
<key>CFBundleIconFile</key>
<string>gsp-icons.icns</string>
<key>CFBundleIdentifier</key>
@ -20,13 +20,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.12s</string>
<string>0.14</string>
<key>CFBundleSignature</key>
<string>gsplus</string>
<key>CFBundleVersion</key>
<string>0.12s</string>
<string>0.14</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2016 Dagen Brock</string>
<string>Copyright 2018 Dagen Brock</string>
<key>LSMinimumSystemVersion</key>
<string>10.3</string>
</dict>

BIN
assets/gsback.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

BIN
assets/gsback.psd Normal file

Binary file not shown.

View File

@ -1,30 +1,25 @@
# Mac OSX - SDL2 version
#
# might need to install cli tools if you haven't already.
# This should build a `gsplus` executable and copy it to the project root dir.
# You can run it, though as always you need to supply an Apple IIgs ROM file.
# Have fun, and please note any errors on the issues page of the project.
# Prerequisite: You must install Xcode on your system from the App Store
# Also, install Xcode cli tools.
xcode-select --install
# Install 'brew' if you don't already have it installed.
# Install 'brew'.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# then install dependencies
# Use brew to install dependencies.
brew install sdl2
brew install sdl2_image
brew install freetype
# build
# Build.
git clone git@github.com:digarok/gsplus.git
cd gsplus/src
ln -s vars_osx_sdl2 vars
make clean ; make
#Note that installing freetype via brew will install the library, but I think
# maybe you have to install the source and build it to link it in properly.
# You could use /usr/local/src instead of /tmp
cd /tmp
curl --remote-name --location http://sourceforge.net/projects/freetype/files/freetype2/2.6.2/freetype-2.6.2.tar.gz
tar -xzvf freetype-2.6.2.tar.gz
cd freetype-2.6.2
./configure --prefix=/usr/local/freetype-2.6.2
make
make install
ln -s freetype-2.6.2 /usr/local/freetype

View File

@ -0,0 +1,28 @@
# Win32 - SDL2 version
#
# This should build a `gsplus.exe` executable and copy it to the project root dir.
# You can run it, though as always you need to supply an Apple IIgs ROM file.
# Have fun, and please note any errors on the issues page of the project.
# Prerequisites: You must install Cygwin on your system.
# I install Cygwin with all "Devel" and "Perl" packages.
# I also search for and add any FreeType libs.
# You will not use the Cygwin SDL2/image libraries as they are deprecated.
# Instead you must download the mingw64-w64 libraries and link against those.
wget https://www.libsdl.org/release/SDL2-devel-2.0.8-mingw.tar.gz
tar -xvzf SDL2-devel-2.0.8-mingw.tar.gz
cd SDL2-2.0.8
mkdir /cygdrive/c/mingw
mv i686-w64-mingw32/ /cygdrive/c/mingw/
cd ..
wget https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.3-mingw.tar.gz
tar -xvzf SDL2_image-devel-2.0.3-mingw.tar.gz
rsync -a SDL2_image-2.0.3/i686-w64-mingw32/ /cygdrive/c/mingw/i686-w64-mingw32/
# Build.
git clone git@github.com:digarok/gsplus.git
cd gsplus/src
ln -s vars_win32_sdl2 vars
make clean ; make

View File

@ -1,6 +1,4 @@
## SOME NOTES ON SETTING UP GITLAB RUNNER TO BUILD ON LINUX/UBUNTU
# Based on: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/linux-repository.md
## STEP 1 - Install Gitlab Runner
sudo apt-get install -y curl

View File

@ -1,5 +1,4 @@
## SOME NOTES ON SETTING UP GITLAB RUNNER TO BUILD ON LINUX/UBUNTU
# Based on: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/osx.md
## STEP 1 - Install Gitlab Runner
sudo curl --output /usr/local/bin/gitlab-ci-multi-runner https://gitlab-ci-multi-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-ci-multi-runner-darwin-amd64
@ -25,12 +24,9 @@ gitlab-ci-multi-runner register -n \
--description "MBP" \
--tag-list "osx"
# maybe also needs
gitlab-ci-multi-runner install
# maybe also needs
gitlab-ci-multi-runner install
# to run correctly
# you can always check with
gitlab-ci-multi-runner status

View File

@ -1,31 +1,21 @@
## SOME NOTES ON SETTING UP GITLAB RUNNER TO BUILD ON WIN32 FOR SDL2 BUILDS
## PREREQUISITE AKA SETTING UP A FRESH VM OR DEV COMPUTER
#
# Install your Win7/Win10 VM
# Install VirtualBox additions in your VM
#
# (optional) add build user
# (optional, but seems to help) add build user
# Make user an admin, give it service privs
# ... Local Security Policy -> Local Policies -> User Rights Assignment -> Log on as a service
#
# install Cygwin
# install Cygwin & SDL2 Libraries according to the steps in the Quickstart doc
# add cygwin bin dir to env path
#
# install git for windows w/ git bash http://git-scm.com/download/win
git config --global user.name "Dagen Brock"
git config --global user.email "dagenbrock@gmail.com"
# (set up your key(s))
# Add your ~/.ssh/id_rsa using git bash (or cygwin) so that
# gitlab runner can check out your project
#
# The project is currently being build in Cygwin.
# I install Cygwin with all "Devel" and "Perl" packages.
# I also search for and add any SDL2 or FreeType libs just in case.
## SOME NOTES ON SETTING UP GITLAB RUNNER TO BUILD ON WINDOWS
# Based on: https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/blob/master/docs/install/windows.md
## STEP 1 - Install Gitlab Runner
# https://docs.gitlab.com/runner/install/windows.html
# Download from page above, run CMD prompt as Administrator and then run the runner exe in there
## STEP 2 - Register it with your server
@ -36,22 +26,19 @@ gitlab-ci-multi-runner-windows-386.exe register
# enter gitlab url
# enter gitlab runner token
# enter tag of "windows"
gitlab-runner.exe register -n \
--url http://centralserv.gotgeeks.com/ci \
--registration-token UqGC2qvJmvU1QBK3mx4b \
gitlab-runner-windows-386.exe register -n \
--url http://yourgitlab.com/ci \
--registration-token UqGC2qvJmU1QBK3mx4b \
--executor shell \
--description "WinBuild"
--tag-list "windows"
gitlab-ci-multi-runner-windows-386.exe -n --url http://centralserv.gotgeeks.com/ci --registration-token 5a1f60647cf7fe3eb5c7fa87e59bf7 --executor shell --description "WinDork10" --tag-list "windows,win32"
## STEP 3 - Install Service
# Note the use of ".\IEUser" to indicate local account!
gitlab-ci-multi-runner-windows-386.exe install --user .\IEUser --password Passw0rd!
gitlab-ci-multi-runner-windows-386.exe install --user .\Builder --password Bu1ld3r!
# Note the use of ".\builder" to indicate local account!
gitlab-runner-windows-386.exe install --user .\builder --password builder
## STEP 4 - Start service
gitlab-ci-multi-runner-windows-386.exe start
gitlab-runner-windows-386.exe start
## STEP 4.5 - if you get a "failed due to logon" message above, you may need to grant "logon as a service" privs
#To add the "Log on as a service" right to an account on your local computer

Binary file not shown.

View File

@ -1,199 +0,0 @@
GSplus gsp_icon_512.png
Modern cross-platform Apple IIgs emulator and tools,
based on KEGS & GSPort
________________
Screenshot.png Manual Revisions:
Beta Release: 2017-01-22
Alpha Release: 2016-11-02
Alpha Draft: 2016-10-27
Initial Draft: 2016-05-01
Downloads:
Latest downloads always available at https://apple2.gs/plus
________________
Overview & Purpose
This project is an attempt to build a better Apple IIgs emulator by modernizing the KEGS/GSport emulator family and extending it into a platform for gamers, enthusiasts and developers.
The first steps were a release of a new SDL2 driver. SDL or "Simple DirectMedia Layer" enables the writing of one cross-platform driver to handle input and output (video, mouse, keyboard, audio, joystick). This helps the goal of providing first-class support for all of the major platforms supported by SDL, including Mac OSX, Windows and Linux.
Part of this effort has also led to the development of an automated build and packaging pipeline using Gitlab CI. This helps our team of one continue to develop on primarily a single platform, while still ensuring that it works across many operating systems
Currently, the main supported platforms are Linux, OSX and Windows.
Getting started
1. Download the emulator package from https://apple2.gs/plus and put it in a folder.
2. Download the Apple IIgs Firmware ROMs, for either a ROM01 or ROM03 machine.
(If you have a real IIgs, there are ways to save it from your machine too.)
Try: ftp://ftp.apple.asimov.net/pub/apple_II/emulators/rom_images/
1. Put the ROM image in the same folder where you run the emulator from.
It will search for: "ROM", "ROM.01", "ROM.03"
If your ROM file has some other name, launch gsplus and hit F4 to go to the config menu to choose your ROM under "ROM File Selection"
... or ...
1. Edit your config:
You can manually edit the config.txt file (or use the F4 menu.)
1. You can set disks using a slot/number syntax like:
s5d1 = images/ArkanoidII.po
s6d1 = images/ProDOS_2_4_1.dsk
s7d1 = images/gsos.2mg
2. You can also manually set your ROM path like:
g_cfg_rom_path = ../roms/gsrom03
1. Download some Apple IIgs software.
I recommend the excellent Apple IIgs dedicated site:
http://www.whatisthe2gs.apple2.org.za/
If you have a real IIgs, you can transfer your disks using ADTPro
http://adtpro.sourceforge.net/
2. Boot the Apple IIgs by running the emulator
Windows: gsplus32.exe
Mac*/Ubuntu: ./gsplus
* Yes, you can drag it into your Applications folder on a Mac, but be aware that it is still meant to be launched from a command line. If you put it in Applications, you should be able to run it with the terminal command:
/Applications/GSplus.app/Contents/MacOS/gsplus
If the config file cant be found, it will try to create a config.txt file for you, with all of the defaults.
1. Note: You can also specify a config file. This is very useful as you can have specific disks/setting pre-set in a config file and launch directly into your favorite game with that config. They can be named anything you want, though the officially recognized extensions are .txt and .gsp.
Examples:
Windows: gsplus32.exe -config arkanoid.gsp
Mac/Ubuntu: ./gsplus -config choplifter_config.txt
________________
Emulator Hot-Keys
There are several keys used to interact with the emulator while it is running. Heres a quick list of the main hot-keys and what they do.
F4 - configuration menu - set lots of options here!
F5 - paste from host OS into emulator
F6 - toggle system speed (1, 2.8, 8, ∞ MHz )
F7 - toggle fast disk emulation
F9 - invert paddles
F10 - toggle a2vid_palette (?)
F11 - toggle fullscreen mode *
F12 - hit RESET (e.g. - to do “Ctrl-Reset” on an Apple II, you hit “Ctrl-F12”)
Shift-F5 - take a screenshot *
Shift-F10 - toggle status line *
Shift-F11 - toggle simulated scanlines *
* not available on all platforms
Other Input/Output
1. Mouse and keyboard should automatically work
2. Joystick with SDL2 driver is known to be working. It simply uses the “first” joystick and the first analog pad on that stick plus the first two buttons. The axes and buttons are not yet configurable. Better info forthcoming.
3. There are drivers for serial controller, ImageWriter (II?) printer, and networking. I may have broken some of this functionality to get builds working. Im not currently familiar with the state of these drivers or their usage. More info will be added as I take time to research more of the modules.
4. You can also drag-and-drop disk images onto the emulator window and it will try to automount the disk! (SDL versions)
Configuration Menu
Configuration options are loaded from, and saved to, a configuration text file. The default configuration file is config.txt. If you are just starting out, its recommended to use the configuration menu versus editing the file yourself.
Enter the configuration menu at any time while running GSplus by hitting <F4>.
Screen Shot 2016-05-01 at 9.10.00 AM.png
Most important options are:
Disk Configuration menu - options to “mount” and “eject” disks images
ROM File Selection menu - if you dont have it correctly pointing to a valid ROM 1 or ROM 3 image, it will not boot
________________
Command-line Options
This is from source, some are experimental and not all may be built on your system.
-badrd Halt on bad reads
-noignbadacc Dont ignore bad memory accesses
-noignhalt Dont ignore code red halts
-test Allow testing
-hpdev Use /dev/audio (HP/UX?)
-alib Use Aserver audio server
-24 Use 24-bit display depth
-16 Use 16-bit display depth
-15 Use 15-bit display depth
-bw Force B/W modes
-joystick Ignore joystick option
-noshm Dont use X shared memory
-dhr140 Use simple double-hires color map
-mem value Set memory size to value
-skip value Set skip_amt to value
-audio value Set audio enable to value
-arate value Set preferred audio rate to value
-v value Set verbose flags to value
-display value Set X-Windows DISPLAY=value
-enet value Set ethernet to value
-config value Set config file to value
-debugport value Set debugport to value
-ssdir value Set screenshot save directory to value
-scanline Enable scanline simulator
-noscanline Disable scanline simulator (default)
Note: The final argument, if not a flag, will be tried as a mountable device.
Debugger Commands - BROKEN!!!
Sorry, the debugger is currently broken due to a change in debugging frameworks.
The documentation below is accurate, but does not currently work.
Enter from the debugger prompt (Shift-F6)
GSplus CLI Debugger help (courtesy Fredric Devernay)
General command syntax: [bank]/[address][command]
e.g. 'e1/0010B' to set a breakpoint at the interrupt jump pt
Enter all addresses using lower-case. As with the IIgs monitor, you can omit the bank number after having set it: 'e1/0010B' followed by '14B' will set breakpoints at e1/0010 and e1/0014
g Go
[bank]/[addr]g Go from [bank]/[address]
s Step one instruction
[bank]/[addr]s Step one instr at [bank]/[address]
[bank]/[addr]B Set breakpoint at [bank]/[address]
B Show all breakpoints
[bank]/[addr]D Delete breakpoint at [bank]/[address]
[bank]/[addr1].[addr2] View memory
[bank]/[addr]L Disassemble memory
P Dump the trace to 'pc_log_out'
Z Dump SCC state
I Dump IWM state
[drive].[track]I Dump IWM state
E Dump Ensoniq state
[osc]E Dump oscillator [osc] state
R Dump dtime array and events
T Show toolbox log
[bank]/[addr]T Dump tools using ptr [bank]/[addr] as 'tool_set_info'
[mode]V XOR verbose with 1=DISK, 2=IRQ,4=CLK,8=SHADOW,10=IWM,20=DOC,
40=ABD,80=SCC, 100=TEST, 200=VIDEO
[mode]H XOR halt_on with 1=SCAN_INT,2=IRQ, 4=SHADOW_REG, 8=C70D_WRITES
r Reset
[0/1]=m Changes m bit for l listings
[0/1]=x Changes x bit for l listings
[t]=z Stops at absolute time t (obsolete)
S show_bankptr_bank0 & smartport errs
P show_pmhz
A show_a2_line_stuff show_adb_log
Ctrl-e Dump registers
[bank]/[addr1].[addr2]us[file] Save mem area to [file]
[bank]/[addr1].[addr2]ul[file] Load mem area from [file]
v Show video information
q Exit Debugger (and GSplus)
________________
Project Info
Homepage and Downloads
This project has a homepage at http://apple2.gs/plus/
The homepage hosts the latest build for a variety of OSes.
Development Repository
Main page and full source code repository: https://github.com/digarok/gsplus
Release Changelog
Version 0.13 - Jan. 22 2017
Scanline simulator
Drag-and-drop disk images and it will try to automount
Fixes and improvements to logging
Win32 icon parity with other versions
Experimental host FST support
Various bug fixes
Version 0.12s - Nov. 12, 2016
First official alpha release with packages
“S” in version is because it introduces new Socket Debugger, large effort
Version 0.11 - 2015 - 2016
Not publicly released
Features first major contribution - SDL2 driver supporting displays, sound and joysticks
________________
Credits & Thanks
Thanks to Kent Dickey who originally wrote the open source KEGS, “Kents Emulated GS”
Thanks to the GSPort developers which is the fork used to create GSplus.
Thanks to the other GSplus contributors, especially Kelvin Sherlock who has added quite a few of the latest features.

View File

@ -1,6 +1,7 @@
DEXTRAS=gsplus-osx/
DDIR=gsplus-osx/GSplus.app
DDIR=$DEXTRAS/GSplus.app
ADIR=assets
mkdir -p $DEXTRAS/license
mkdir -p $DDIR/Contents/MacOS
mkdir -p $DDIR/Contents/Resources
@ -12,8 +13,8 @@ dylibbundler -od -b -x $DDIR/Contents/MacOS/gsplus -d $DDIR/Contents/libs/
# files to include in dmg
cp doc/gsplusmanual.pdf $DEXTRAS
cp doc/gsplusmanual.txt $DEXTRAS
cp doc/README.txt $DEXTRAS
cp COPYING.txt $DEXTRAS
cp LICENSE.txt $DEXTRAS/license
cp COPYRIGHT.txt $DEXTRAS/license
# packaging now in DMG script

View File

@ -6,17 +6,16 @@ test -f GSplus-Install.dmg && rm GSplus-Install.dmg
./create-dmg \
--volname "GSplus" \
--volicon "../assets/gsp-dmg-icons.icns" \
--background "../assets/gsp_dmg_bg_600x500.png" \
--background "../assets/gsback.png" \
--window-pos 200 120 \
--window-size 600 500 \
--icon-size 100 \
--icon GSplus.app 180 130 \
--window-size 710 600 \
--icon-size 64 \
--icon GSplus.app 250 210 \
--hide-extension GSplus.app \
--app-drop-link 410 130 \
--icon README.txt 105 330 \
--icon gsplusmanual.pdf 225 330 \
--icon gsplusmanual.txt 365 330 \
--icon COPYING.txt 495 330 \
--app-drop-link 440 210 \
--icon README.txt 225 350 \
--icon gsplusmanual.pdf 350 350 \
--icon license 470 350 \
GSplus-Install.dmg \
../gsplus-osx/
cp GSplus-Install.dmg ..

View File

@ -4,7 +4,7 @@
OBJECTS1 = adb.o clock.o config.o debug.o dis.o engine_c.o scc.o iwm.o \
joystick_driver.o moremem.o paddles.o parallel.o printer.o sim65816.o \
smartport.o sound.o sound_driver.o video.o scc_socket_driver.o glog.o \
imagewriter.o scc_imagewriter.o scc_llap.o
imagewriter.o scc_imagewriter.o scc_llap.o options.o
ATOBJ = atbridge/aarp.o atbridge/atbridge.o atbridge/elap.o atbridge/llap.o atbridge/port.o
PCAPOBJ = atbridge/pcap_delay.o
TFEOBJ = tfe/tfe.o tfe/tfearch.o tfe/tfesupp.o
@ -69,16 +69,8 @@ gsplus32.exe: $(OBJECTS) compile_time.o
# Mingw32 / Cygwin builds: The SDL version (builds, but non-functioning)
gsplus.exe: $(OBJECTS) compile_time.o
#g++ $(CCOPTS) $(LDOPTS) $(OBJECTS) compile_time.o $(LDFLAGS) -o $(NAME)$(SUFFIX) $(EXTRA_LIBS) -lwinmm -lgdi32 -ldsound -lcomctl32 -lws2_32 -lshell32
g++ $(CCOPTS) $(LDOPTS) $(OBJECTS) compile_time.o $(LDFLAGS) -o $(NAME)$(SUFFIX) $(EXTRA_LIBS) -lSDLmain -mwindows
#mkdir -p ../GSplus.app/lib
#cp -f gsplus.exe ../GSplus.app/GSplus.exe
#cp -f ../config.template ../GSplus.app/config.txt
#cp -f ../lib/*.ttf ../GSplus.app/lib
#cp -f ../lib/arch/win32/*.dll ../GSplus.app
#cp -f ../lib/NoBoot.po ../GSplus.app
#cp -f GSplus.bat ../GSplus.app/GSplus.bat
#cp -f parallel.rom ../GSplus.app
#cp -f ../COPYING.txt ../GSplus.app
#g++ $(CCOPTS) $(LDOPTS) $(OBJECTS) compile_time.o $(LDFLAGS) -o $(NAME)$(SUFFIX) $(EXTRA_LIBS) -mwindows
g++ $(CCOPTS) $(LDOPTS) $(OBJECTS) compile_time.o $(LDFLAGS) -o $(NAME)$(SUFFIX) $(EXTRA_LIBS) -lwinmm -lgdi32 -ldsound -lcomctl32 -lws2_32 -lshell32
cp gsplus.exe ..
# NOT CURRENTLY SUPPORTED

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2013 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* adb_mode bit 3 and bit 2 (faster repeats for arrows and space/del) not done*/
@ -1468,7 +1452,7 @@ adb_key_event(int a2code, int is_up)
/* ESC pressed, see if ctrl & cmd key down */
if(CTRL_DOWN && CMD_DOWN) {
/* Desk mgr int */
printf("Desk mgr int!\n");
glog("Desk mgr int!");
g_adb_interrupt_byte |= 0x20;
adb_add_data_int();
@ -1507,7 +1491,7 @@ adb_key_event(int a2code, int is_up)
special = (ascii >> 8) & 0xff;
if(ascii < 0) {
printf("ascii1: %d, a2code: %02x, pos: %d\n", ascii,a2code,pos);
glogf("ascii1: %d, a2code: %02x, pos: %d", ascii,a2code,pos);
ascii = 0;
special = 0;
}
@ -1707,10 +1691,6 @@ adb_physical_key_update(int a2code, int is_up)
a2code = 0x3a;
special = 0;
break;
case 0x03: /* F3 - remap to escape for OS/2 */
a2code = 0x35;
special = 0;
break;
case 0x0c: /* F12 - remap to reset */
a2code = 0x7f;
special = 0;
@ -1735,6 +1715,9 @@ adb_physical_key_update(int a2code, int is_up)
if(special && !is_up) {
switch(special) {
case 0x03: /* F3 - screenshot */
g_screenshot_requested = 1;
break;
case 0x04: /* F4 - emulator config panel */
if (CMD_DOWN) {
glog("Quit!");
@ -1748,7 +1731,7 @@ adb_physical_key_update(int a2code, int is_up)
break;
case 0x05: /* F5 - emulator clipboard paste */
if (SHIFT_DOWN) {
g_screenshot_requested = 1;
// reserved
} else {
clipboard_paste();
}

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/*

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include <os2.h>

View File

@ -1,23 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2010 by GSport contributors
Copyright (C) 2016 - Dagen Brock
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "../../defc.h"

View File

@ -1,23 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2010 by GSport contributors
Copyright (C) 2016 - Dagen Brock
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
int g_preferred_rate = 48000;

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/** This module implements AARP, a necessary protocol for ELAP communication. **/

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
struct at_addr_t;

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
typedef byte at_node_t;

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/** This module is the "heart" of the bridge and provides the connection between the ELAP and LLAP ports. **/

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/**
@ -46,4 +32,3 @@ const at_node_t atbridge_get_node();
void atbridge_set_net(at_network_t net);
void atbridge_set_node(at_node_t node);
bool atbridge_address_used(const struct at_addr_t* addr);

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/** This module implements the ELAP port of the bridge. **/

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/** ELAP port of the AppleTalk Bridge **/

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* Ethernet addresses are 6 bytes */

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/** This module implements the LLAP port of the bridge. **/

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
struct packet_t;

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include <stdbool.h>

View File

@ -1,23 +1,10 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/*
This interface provides a thin, delay-loaded wrapper around the PCAP library so that
you may start GSport without intalling PCAP. Of course, some features that require

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/** This module implements queues for storing and transferring packets within the bridge. **/

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013-2014 by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
struct packet_t

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"
@ -448,4 +432,3 @@ do_clock_data()
break;
}
}

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
char g_compile_time[] = "Compiled: " __DATE__ " " __TIME__ ;

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2014 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"
@ -26,9 +10,7 @@
#include "config.h"
#include "glog.h"
#include "imagewriter.h"
#if defined(__OS2__)
#include "arch\os2\src\dirport.h"
#elif defined(_MSC_VER)
#if defined(_MSC_VER)
#include "arch\win32\dirent-win32.h"
#else
#include <dirent.h>
@ -45,6 +27,9 @@
typedef unsigned int mode_t;
#endif
static const char parse_log_prefix_file[] = "Option set [file]:";
extern int Verbose;
extern word32 g_vbl_count;
extern Iwm iwm;
@ -63,6 +48,33 @@ extern int g_fatal_log;
extern word32 g_adb_repeat_vbl;
extern int g_audio_enable;
extern int g_preferred_rate;
extern int g_fullscreen;
extern int g_highdpi;
extern int g_borderless;
extern int g_resizeable;
extern int g_screen_redraw_skip_amt;
extern int g_use_dhr140;
extern int g_use_bw_hires;
extern int g_scanline_simulator;
extern int g_startx;
extern int g_starty;
extern int g_joystick_number;
extern int g_joystick_x_axis;
extern int g_joystick_y_axis;
extern int g_joystick_x2_axis;
extern int g_joystick_y2_axis;
extern int g_joystick_button_0;
extern int g_joystick_button_1;
extern int g_joystick_button_2;
extern int g_joystick_button_3;
extern int g_ethernet;
extern int g_halt_on_bad_read;
extern int g_ignore_bad_acc;
extern int g_ignore_halts;
extern int g_dbg_enable_port;
extern int halt_sim;
extern int g_limit_speed;
extern int g_force_depth;
@ -160,6 +172,7 @@ int g_cfg_curs_inv = 0;
int g_cfg_curs_mousetext = 0;
int g_cfg_triggeriwreset = 0;
#define CFG_PG_SCROLL_AMT 15
#define CFG_MAX_OPTS 16
#define CFG_OPT_MAXSTR 100
@ -182,6 +195,38 @@ extern Cfg_menu g_cfg_main_menu[];
#define KNMP(a) &a, #a, 0
// This first menu is not a menu, but a list of config options that are
// represented here so they will be parsed correctly out of the config files.
Cfg_menu g_cfg_uiless_menu[] = {
{ "", KNMP(g_audio_enable), CFGTYPE_INT },
{ "", KNMP(g_preferred_rate), CFGTYPE_INT },
{ "", KNMP(g_fullscreen), CFGTYPE_INT },
{ "", KNMP(g_highdpi), CFGTYPE_INT },
{ "", KNMP(g_borderless), CFGTYPE_INT },
{ "", KNMP(g_resizeable), CFGTYPE_INT },
{ "", KNMP(g_screen_redraw_skip_amt), CFGTYPE_INT },
{ "", KNMP(g_use_dhr140), CFGTYPE_INT },
{ "", KNMP(g_use_bw_hires), CFGTYPE_INT },
{ "", KNMP(g_scanline_simulator), CFGTYPE_INT },
{ "", KNMP(g_startx), CFGTYPE_INT },
{ "", KNMP(g_starty), CFGTYPE_INT },
{ "", KNMP(g_joystick_number), CFGTYPE_INT },
{ "", KNMP(g_joystick_x_axis), CFGTYPE_INT },
{ "", KNMP(g_joystick_y_axis), CFGTYPE_INT },
{ "", KNMP(g_joystick_x2_axis), CFGTYPE_INT },
{ "", KNMP(g_joystick_y2_axis), CFGTYPE_INT },
{ "", KNMP(g_joystick_button_0), CFGTYPE_INT },
{ "", KNMP(g_joystick_button_1), CFGTYPE_INT },
{ "", KNMP(g_joystick_button_2), CFGTYPE_INT },
{ "", KNMP(g_joystick_button_3), CFGTYPE_INT },
{ "", KNMP(g_ethernet), CFGTYPE_INT },
{ "", KNMP(g_halt_on_bad_read), CFGTYPE_INT },
{ "", KNMP(g_ignore_bad_acc), CFGTYPE_INT },
{ "", KNMP(g_ignore_halts), CFGTYPE_INT },
{ 0, 0, 0, 0, 0 },
};
Cfg_menu g_cfg_disk_menu[] = {
{ "Disk Configuration", g_cfg_disk_menu, 0, 0, CFGTYPE_MENU },
{ "s5d1 = ", 0, 0, 0, CFGTYPE_DISK + 0x5000 },
@ -403,10 +448,8 @@ Cfg_menu g_cfg_main_menu[] = {
{ "Virtual ImageWriter Configuration", g_cfg_imagewriter_menu, 0, 0, CFGTYPE_MENU },
#endif
{ "Developer Options", g_cfg_devel_menu, 0, 0, CFGTYPE_MENU },
{ "Auto-update configuration file,0,Manual,1,Immediately",
KNMP(g_config_gsplus_auto_update), CFGTYPE_INT },
{ "Speed,0,Unlimited,1,1.0MHz,2,2.8MHz,3,8.0MHz (Zip)",
KNMP(g_limit_speed), CFGTYPE_INT },
{ "Auto-update configuration file,0,Manual,1,Immediately", KNMP(g_config_gsplus_auto_update), CFGTYPE_INT },
{ "Speed,0,Unlimited,1,1.0MHz,2,2.8MHz,3,8.0MHz (Zip)", KNMP(g_limit_speed), CFGTYPE_INT },
{ "Expansion Mem Size,0,0MB,0x100000,1MB,0x200000,2MB,0x300000,3MB,"
"0x400000,4MB,0x600000,6MB,0x800000,8MB,0xa00000,10MB,0xc00000,12MB,"
"0xe00000,14MB", KNMP(g_mem_size_exp), CFGTYPE_INT },
@ -442,7 +485,7 @@ Cfg_listhdr g_cfg_partitionlist = { 0 };
int g_cfg_file_pathfield = 0;
const char *g_gsplus_rom_names[] = { "ROM", "ROM", "ROM.01", "ROM.03", 0 };
const char *g_gsplus_rom_names[] = { "ROM", "ROM", "ROM01", "ROM03", "ROM.01", "ROM.03", 0 };
/* First entry is special--it will be overwritten by g_cfg_rom_path */
const char *g_gsplus_c1rom_names[] = { "parallel.rom", 0 };
@ -450,8 +493,7 @@ const char *g_gsplus_c2rom_names[] = { 0 };
const char *g_gsplus_c3rom_names[] = { 0 };
const char *g_gsplus_c4rom_names[] = { 0 };
const char *g_gsplus_c5rom_names[] = { 0 };
const char *g_gsplus_c6rom_names[] = { "c600.rom", "controller.rom", "disk.rom",
"DISK.ROM", "diskII.prom", 0 };
const char *g_gsplus_c6rom_names[] = { "c600.rom", "controller.rom", "disk.rom", "DISK.ROM", "diskII.prom", 0 };
const char *g_gsplus_c7rom_names[] = { 0 };
const char **g_gsplus_rom_card_list[8] = {
@ -566,6 +608,7 @@ config_init()
int can_create;
config_init_menus(g_cfg_main_menu);
config_init_menus(g_cfg_uiless_menu);
// Find the configuration file
g_config_gsplus_name[0] = 0;
@ -578,7 +621,6 @@ config_init()
void
cfg_exit()
{
/* printf("In cfg exit\n"); */
if(g_rom_version >= 1) {
g_config_control_panel = 0;
}
@ -605,11 +647,10 @@ cfg_text_screen_dump()
int i, j;
filename = "gsplus.screen.dump";
printf("Writing text screen to the file %s\n", filename);
glogf("Writing text screen to the file %s", filename);
ofile = fopen(filename, "w");
if(ofile == 0) {
fatal_printf("Could not write to file %s, (%d)\n", filename,
errno);
fatal_printf("Could not write to file %s, (%d)\n", filename, errno);
return;
}
@ -720,9 +761,7 @@ config_parse_option(char *buf, int pos, int len, int line)
}
// find "name" as first contiguous string
glogf("...parse_option: line %d, len:%d \"%s\"", line, len, &buf[pos]);
// printf("...parse_option: line %d, %p,%p = %s (%s) len:%d\n", line, &buf[pos], buf, &buf[pos], buf, len);
glogf("%s line %d, len:%d \"%s\"", parse_log_prefix_file, line, len, &buf[pos]);
nameptr = &buf[pos];
while(pos < len) {
@ -779,8 +818,7 @@ config_parse_option(char *buf, int pos, int len, int line)
*strptr = gsplus_malloc_str(&buf[pos]);
break;
default:
printf("Config file variable %s is unknown type: %d\n",
nameptr, type);
glogf("Config file variable %s is unknown type: %d", nameptr, type);
}
}
@ -929,7 +967,7 @@ config_load_roms()
"read %d bytes\n", &g_cfg_tmp_path[0], errno, len, ret);
continue;
}
printf("Read: %d bytes of ROM in slot %d from file %s.\n", ret, i, &g_cfg_tmp_path[0]);
glogf("Read: %d bytes of ROM in slot %d from file %s.", ret, i, &g_cfg_tmp_path[0]);
fclose(file);
}
}
@ -1053,23 +1091,10 @@ config_parse_config_gsplus_file()
// not really a fan of that either and think it should be take out.
// Especially now that you can pass a filename.
// #ifndef __OS2__
// if(g_cfg_cwd_str[0] != 0) {
// ret = chdir(&g_cfg_cwd_str[0]);
// if(ret != 0) {
// printf("chdir to %s, errno:%d\n", g_cfg_cwd_str, errno);
// }
// }
// /* In any case, copy the directory path to g_cfg_cwd_str */
// (void)getcwd(&g_cfg_cwd_str[0], CFG_PATH_MAX);
// #endif
fconf = fopen(g_config_gsplus_name, "r");
if(fconf == 0) {
perror("ERROR");
fatal_printf("Cannot open configuration file at %s! Stopping!\n",
g_config_gsplus_name);
fatal_printf("Cannot open configuration file at %s! Stopping!\n",g_config_gsplus_name);
my_exit(3);
}
@ -1355,7 +1380,7 @@ insert_disk(int slot, int drive, const char *name, int ejected, int force_size,
int cmp_o, cmp_p, cmp_dot;
int cmp_b, cmp_i, cmp_n;
int can_write;
int len;
int len = 0;
int nibs;
int unix_pos;
int name_len;
@ -1639,7 +1664,7 @@ insert_disk(int slot, int drive, const char *name, int ejected, int force_size,
nibs = len;
}
if(size != 35*len) {
glogf("Disk 5.25 error: size is %d, not 140K. Will try to mount anyway", size, 35*len);
glogf("Warning - Disk 5.25 error: size is %d, not 140K. Will try to mount anyway", size, 35*len);
}
for(i = 0; i < 35; i++) {
iwm_move_to_track(dsk, 4*i);
@ -1651,8 +1676,7 @@ insert_disk(int slot, int drive, const char *name, int ejected, int force_size,
unix_pos = dsk->image_start;
size = dsk->image_size;
if(size != 800*1024) {
fatal_printf("Disk 3.5 error: size is %d, not 800K. "
"Will try to mount anyway\n", size);
glogf("Warning - Disk 3.5 error: size is %d, not 800K. Will try to mount anyway", size, 35*len);
}
disk_set_num_tracks(dsk, 2*80);
for(i = 0; i < 2*80; i++) {
@ -2668,7 +2692,7 @@ cfg_str_match(const char *str1, const char *str2, int len)
void
cfg_file_readdir(const char *pathptr)
{
#ifndef __OS2__
struct dirent *direntptr;
struct stat stat_buf;
DIR *dirptr;
@ -2795,7 +2819,6 @@ cfg_file_readdir(const char *pathptr)
g_cfg_dirlist.curent = i;
}
}
#endif
}
void
@ -2820,14 +2843,14 @@ Optionally boot from that slot.
if (slot > 0)
{
insert_disk(slot,0,filename,0,0,0,-1);
printf("Inserted disk in slot %d, drive 1. Filename: %s\n", slot, filename);
glogf("Inserted disk in slot %d, drive 1. Filename: %s", slot, filename);
if (should_boot) {
g_temp_boot_slot = slot;
printf("That slot has been set to boot.\n");
glog("That slot has been set to boot.");
}
}
else
printf("Unable to determine appropriate place to insert file %s.\n",filename);
glogf("Unable to determine appropriate place to insert file %s.",filename);
}
int
@ -2847,28 +2870,25 @@ Guess the image size. Return values:
rc = stat(filename, &stat_buf);
if(rc < 0)
{
printf("Can't get statistics on file %s; errno: %d\n",
filename, errno);
glogf("Can't get statistics on file %s; errno: %d", filename, errno);
rc = -1;
} else {
len = stat_buf.st_size;
printf("Found file %s, size %d; guessing ",
filename, len);
if (len < 140 * 1024) {
/* Not enough for a 140k image */
printf("small ProDOS image.\n");
glogf("Found file %s, size %d; guessing small ProDOS image.", filename, len);
rc = 0;
} else if (len < 140 * 1024 + 256 + 1) {
/* Reasonable size for 140k image, maybe in 2mg format */
printf("a 5-1/4\" image.\n");
glogf("Found file %s, size %d; guessing a 5-1/4\" image.", filename, len);
rc = 1;
} else if (len < 800 * 1024 + 256 + 1) {
/* Reasonable size for 800k image, maybe in 2mg format */
printf("a 3-1/2\" image.\n");
glogf("Found file %s, size %d; guessing a 3-1/2\" image.", filename, len);
rc = 2;
} else {
/* Let's pretend it's an HDV image */
printf("a hard drive image.\n");
glogf("Found file %s, size %d; guessing a hard drive image.", filename, len);
rc = 3;
}
}
@ -3080,7 +3100,7 @@ cfg_file_update_ptr(char *str)
}
*g_cfg_file_strptr = newstr;
if(g_cfg_file_strptr == &(g_cfg_rom_path)) {
printf("Updated ROM file\n");
glog("Updated ROM file");
load_roms_init_memory();
}
g_config_gsplus_update_needed = 1;
@ -3088,7 +3108,6 @@ cfg_file_update_ptr(char *str)
void
cfg_file_selected(int select_dir)
{
#ifndef __OS2__
struct stat stat_buf;
char *str;
int fmt;
@ -3120,8 +3139,7 @@ cfg_file_selected(int select_dir)
(int)stat_buf.st_mode);
#endif
if(ret != 0) {
printf("stat %s returned %d, errno: %d\n", &g_cfg_file_path[0],
ret, errno);
glogf("stat %s returned %d, errno: %d", &g_cfg_file_path[0], ret, errno);
} else {
if(fmt == S_IFDIR && !select_dir) {
/* it's a directory */
@ -3142,7 +3160,6 @@ cfg_file_selected(int select_dir)
}
}
}
#endif
}
void
@ -3193,8 +3210,19 @@ cfg_file_handle_key(int key)
cfg_fix_topent(listhdrptr);
}
break;
case 0x33: /* pg dn */
if(g_cfg_file_pathfield == 0) {
listhdrptr->curent += CFG_PG_SCROLL_AMT;
cfg_fix_topent(listhdrptr);
}
break;
case 0x39: /* pg up */
if(g_cfg_file_pathfield == 0) {
listhdrptr->curent -= CFG_PG_SCROLL_AMT;
cfg_fix_topent(listhdrptr);
}
break;
case 0x0d: /* return */
//glog("Selected disk image file");
cfg_file_selected(0);
break;
case 0x09: /* tab */
@ -3203,7 +3231,6 @@ cfg_file_handle_key(int key)
case 0x08: /* left arrow */
case 0x7f: /* delete key */
if(g_cfg_file_pathfield) {
// printf("left arrow/delete\n");
len = strlen(&g_cfg_file_curpath[0]) - 1;
if(len >= 0) {
g_cfg_file_curpath[len] = 0;
@ -3214,13 +3241,10 @@ cfg_file_handle_key(int key)
cfg_file_selected(g_cfg_file_dir_only);
break;
default:
printf("key: %02x\n", key);
glogf("Unhandled config key: 0x%02x", key);
}
#if 0
printf("curent: %d, topent: %d, last: %d\n",
g_cfg_dirlist.curent, g_cfg_dirlist.topent, g_cfg_dirlist.last);
#endif
}
void
config_control_panel()
{
@ -3247,7 +3271,6 @@ config_control_panel()
(0xf << BIT_ALL_STAT_TEXT_COLOR) | ALL_STAT_ALTCHARSET;
g_a2_new_all_stat[0] = g_cur_a2_stat;
g_new_a2_stat_cur_line = 0;
//cfg_printf("In config_control_panel\n");
for(i = 0; i < 20; i++) {
// Toss any queued-up keypresses
if(adb_read_c000() & 0x80) {
@ -3383,6 +3406,17 @@ config_control_panel()
menu_line = 1;
}
break;
case 0x33: /* pg dn */
menu_line += CFG_PG_SCROLL_AMT;
menu_inc = 1;
break;
case 0x39: /* pg up */
menu_line -= CFG_PG_SCROLL_AMT;
menu_inc = 0;
if(menu_line < 1) {
menu_line = 1;
}
break;
case 0x15: /* right arrow */
cfg_parse_menu(menuptr, menu_line,menu_line,1);
break;
@ -3437,7 +3471,7 @@ config_control_panel()
}
break;
default:
printf("key: %02x\n", key);
glogf("Unhandled config key: 0x%02x", key);
}
} else if(key >= 0) {
cfg_file_handle_key(key);

View File

@ -1,36 +1,18 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#define CONF_BUF_LEN 1024
#define COPY_BUF_SIZE 4096
#define CONF_BUF_LEN 1024
#define COPY_BUF_SIZE 4096
#define CFG_PRINTF_BUFSIZE 2048
#define CFG_PATH_MAX 1024
#define CFG_NUM_SHOWENTS 16
#define CFG_PATH_MAX 1024
#define CFG_NUM_SHOWENTS 16
#define CFGTYPE_MENU 1
#define CFGTYPE_INT 2
#define CFGTYPE_INT 2
#define CFGTYPE_DISK 3
#define CFGTYPE_FUNC 4
#define CFGTYPE_FILE 5

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defcomm.h"
@ -79,7 +63,7 @@ void U_STACK_TRACE();
# include <libc.h>
#endif
#if !defined(_WIN32) && !defined (__OS2__) && !defined(UNDER_CE) // OG
#if !defined(_WIN32) && !defined(UNDER_CE) // OG
# include <unistd.h>
# include <sys/ioctl.h>
# include <sys/wait.h>
@ -371,3 +355,6 @@ STRUCT(Emustate_word32list) {
#define JOYSTICK_TYPE_NATIVE_2 3
#define JOYSTICK_TYPE_NONE 4 // OG Added Joystick None
#define NB_JOYSTICK_TYPE 5
// starting window x/y position if Undefined
#define WINDOWPOS_UNDEFINED 0xFFFFFFFF

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#define SHIFT_PER_CHANGE 3

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defcomm.h"
@ -65,4 +49,3 @@ ftmp2 .reg %fr5
fscr1 .reg %fr6
#define LDC(val,reg) ldil L%val,reg ! ldo R%val(reg),reg

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#ifdef ASM

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include <stdio.h>
@ -40,7 +24,6 @@ extern word32 stop_run_at;
extern int Verbose;
extern int Halt_on;
extern int g_testing_enabled;
extern int g_fullscreen;
extern int g_config_control_panel;
@ -358,11 +341,7 @@ do_debug_intfc()
if(got_num) {
engine.kpc = (a2bank<<16) + (a2&0xffff);
}
if(ret_val == 'G' && g_testing_enabled) {
do_gen_test(got_num, a2);
} else {
do_go();
}
do_go();
list_kpc = engine.kpc;
break;
case 'q':
@ -482,15 +461,6 @@ show_toolset_tables(word32 a2bank, word32 addr)
fclose(toolfile);
}
#ifndef TEST65
void
do_gen_test(int got_num, int base_seed)
{
/* dummy */
}
#endif
void
set_bp(word32 addr)
{
@ -684,7 +654,7 @@ read_line(char *buf, int len)
{
int space_left;
int ret;
#if !defined(_WIN32) && !defined (__OS2__)
#if !defined(_WIN32)
int flags, flags_save;
/* Unix */
@ -705,7 +675,6 @@ read_line(char *buf, int len)
while(space_left > 0) {
#ifdef _WIN32
ret = win_nonblock_read_stdin(0, buf, 1);
#elif defined(__OS2__)
#else
/* Unix */
ret = read(0, buf, 1);
@ -731,7 +700,7 @@ read_line(char *buf, int len)
}
buf = &buf[ret];
}
#if !defined(_WIN32) && !defined (__OS2__)
#if !defined(_WIN32)
(void)fcntl(0, F_SETFL, flags_save);
#endif
@ -810,7 +779,6 @@ dis_do_compare()
void
do_debug_unix()
{
#ifndef __OS2__
char localbuf[LINE_SIZE];
word32 offset, len;
int fd, ret;
@ -885,7 +853,6 @@ do_debug_unix()
printf("errno: %d\n", errno);
}
a1 = a1 + ret;
#endif
}
void

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
enum {

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
.code

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/*

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* char 0x00 (raw 0x40) */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
inst00_SYM /* brk */
@ -2706,4 +2690,3 @@ instfe_SYM /* INC Abs,X */
instff_SYM /* SBC Long,X */
GET_LONG_X_RD();
SBC_INST();

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
// Various ASCII codepage to unicode maps

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"
@ -279,7 +263,7 @@ iwm_flush_disk_to_unix(Disk *dsk)
return;
}
printf("Writing disk %s to Unix\n", dsk->name_ptr);
glogf("Writing disk %s to Unix", dsk->name_ptr);
dsk->disk_dirty = 0;
num_dirty = 0;
@ -289,8 +273,7 @@ iwm_flush_disk_to_unix(Disk *dsk)
ret = disk_track_to_unix(dsk, j, &(buffer[0]));
if(ret != 1 && ret != 0) {
printf("iwm_flush_disk_to_unix ret: %d, cannot write "
"image to unix\n", ret);
glogf("iwm_flush_disk_to_unix ret: %d, cannot write image to unix", ret);
halt_printf("Adjusting image not to write through!\n");
dsk->write_through_to_unix = 0;
break;
@ -323,14 +306,12 @@ iwm_flush_disk_to_unix(Disk *dsk)
ret = fwrite(&(buffer[0]), 1, unix_len, dsk->file);
if(ret != unix_len) {
printf("fwrite: %08x, errno:%d, qtrk: %02x, disk: %s\n",
ret, errno, j, dsk->name_ptr);
glogf("fwrite: %08x, errno:%d, qtrk: %02x, disk: %s", ret, errno, j, dsk->name_ptr);
}
}
if(num_dirty == 0) {
halt_printf("Drive %s was dirty, but no track was dirty!\n",
dsk->name_ptr);
halt_printf("Drive %s was dirty, but no track was dirty!", dsk->name_ptr);
}
}
@ -351,7 +332,7 @@ iwm_vbl_update(int doit_3_persec)
if(iwm.motor_on && iwm.motor_off) {
if((word32)iwm.motor_off_vbl_count <= g_vbl_count) {
glogf("Disk timer expired, drive off: %08x\n", g_vbl_count);
glogf("Disk timer expired, drive off: %08x", g_vbl_count);
iwm.motor_on = 0;
iwm.motor_off = 0;
if (g_temp_boot_slot != 254) {
@ -399,17 +380,16 @@ iwm_vbl_update(int doit_3_persec)
void
iwm_show_stats()
{
printf("IWM stats: q7,q6: %d, %d, reset,enable2: %d,%d, mode: %02x\n",
glogf("IWM stats: q7,q6: %d, %d, reset,enable2: %d,%d, mode: %02x",
iwm.q7, iwm.q6, iwm.reset, iwm.enable2, iwm.iwm_mode);
printf("motor: %d,%d, motor35:%d drive: %d, c031:%02x "
"phs: %d %d %d %d\n",
glogf("motor: %d,%d, motor35:%d drive: %d, c031:%02x phs: %d %d %d %d",
iwm.motor_on, iwm.motor_off, g_iwm_motor_on,
iwm.drive_select, g_c031_disk35,
iwm.iwm_phase[0], iwm.iwm_phase[1], iwm.iwm_phase[2],
iwm.iwm_phase[3]);
printf("iwm.drive525[0].file: %p, [1].file: %p\n",
glogf("iwm.drive525[0].file: %p, [1].file: %p",
iwm.drive525[0].file, iwm.drive525[1].file);
printf("iwm.drive525[0].last_phase: %d, [1].last_phase: %d\n",
glogf("iwm.drive525[0].last_phase: %d, [1].last_phase: %d",
iwm.drive525[0].last_phase, iwm.drive525[1].last_phase);
}
@ -590,11 +570,15 @@ iwm525_phase_change(int drive, int phase)
qtr_track += delta;
if(qtr_track < 0) {
printf("GRIND...");
#if 1
printf("💾 ");
#else
printf("GRIND...");
#endif
qtr_track = 0;
}
if(qtr_track > 4*34) {
printf("Disk arm moved past track 34, moving it back\n");
glogf("Disk arm moved past track 34, moving it back");
qtr_track = 4*34;
}

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#define MAX_TRACKS (2*80)

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
int

View File

@ -1,28 +1,13 @@
/*
GSplus - an Apple //gs Emulator
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2013 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"
#include "glog.h"
#ifdef __linux__
# include <linux/joystick.h>
# include <sys/time.h>
@ -41,6 +26,8 @@
SDL_Joystick *gGameController = NULL;
#endif
extern int g_joystick_native_type1; /* in paddles.c */
extern int g_joystick_native_type2; /* in paddles.c */
extern int g_joystick_native_type; /* in paddles.c */
@ -55,6 +42,99 @@ const char *g_joystick_dev = "/dev/input/js0"; /* default joystick dev file */
int g_joystick_native_fd = -1;
int g_joystick_num_axes = 0;
int g_joystick_num_buttons = 0;
int g_joystick_number = 0; // SDL2
int g_joystick_x_axis = 0; // SDL2
int g_joystick_y_axis = 1; // SDL2
int g_joystick_button_0 = 0; // SDL2
int g_joystick_button_1 = 1; // SDL2
int g_joystick_x2_axis = 2; // SDL2
int g_joystick_y2_axis = 3; // SDL2
int g_joystick_button_2 = 2; // SDL2
int g_joystick_button_3 = 3; // SDL2
#define JOY2SUPPORT
#if defined(HAVE_SDL) && !defined(JOYSTICK_DEFINED)
# define JOYSTICK_DEFINED
void
joystick_init()
{
int i;
if( SDL_Init( SDL_INIT_JOYSTICK ) < 0 ) {
glogf( "SDL could not initialize joystick! SDL Error: %s", SDL_GetError() );
} else {
glog("SDL2 joystick initialized");
}
if (SDL_NumJoysticks()<1) {
glog("No joysticks detected");
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
} else {
// @todo: make controller configurable
// @todo: add multiple controller support
gGameController = SDL_JoystickOpen( g_joystick_number );
if( gGameController == NULL ) {
glogf( "Warning: Unable to open game controller! SDL Error: %s", SDL_GetError() );
}
}
g_joystick_native_type = 2;
g_joystick_native_type1 = 2;
g_joystick_native_type2 = -1;
for(i = 0; i < 4; i++) {
g_paddle_val[i] = 180;
}
g_joystick_type = JOYSTICK_TYPE_NATIVE_1;
SDL_JoystickUpdate();
joystick_update(0.0);
}
void
joystick_update(double dcycs)
{
if (gGameController) {
SDL_JoystickUpdate();
g_paddle_val[0] = (int)SDL_JoystickGetAxis(gGameController, g_joystick_x_axis); // default is 0
g_paddle_val[1] = (int)SDL_JoystickGetAxis(gGameController, g_joystick_y_axis); // default is 1
g_paddle_val[2] = (int)SDL_JoystickGetAxis(gGameController, g_joystick_x2_axis); // default is 2
g_paddle_val[3] = (int)SDL_JoystickGetAxis(gGameController, g_joystick_y2_axis); // default is 3
if (SDL_JoystickGetButton(gGameController, g_joystick_button_0)) {
g_paddle_buttons = g_paddle_buttons | 1;
} else {
g_paddle_buttons = g_paddle_buttons & (~1);
}
if (SDL_JoystickGetButton(gGameController, g_joystick_button_1)) {
g_paddle_buttons = g_paddle_buttons | 2;
} else {
g_paddle_buttons = g_paddle_buttons & (~2);
}
if (SDL_JoystickGetButton(gGameController, g_joystick_button_2)) {
g_paddle_buttons = g_paddle_buttons | 4;
} else {
g_paddle_buttons = g_paddle_buttons & (~4);
}
if (SDL_JoystickGetButton(gGameController, g_joystick_button_3)) {
g_paddle_buttons = g_paddle_buttons | 8;
} else {
g_paddle_buttons = g_paddle_buttons & (~8);
}
paddle_update_trigger_dcycs(dcycs);
}
}
void
joystick_update_buttons()
{
}
void joystick_shut() {
SDL_JoystickClose( gGameController );
gGameController = NULL;
}
#endif
#if defined(__linux__) && !defined(JOYSTICK_DEFINED)
@ -162,7 +242,7 @@ joystick_init()
// Check that there is a joystick device
if(joyGetNumDevs() <= 0) {
printf("No joystick hardware detected\n");
glog("No joystick hardware detected");
g_joystick_native_type1 = -1;
g_joystick_native_type2 = -1;
return;
@ -190,7 +270,7 @@ joystick_init()
}
if (g_joystick_native_type1<0 && g_joystick_native_type2 <0) {
printf ("No joystick is attached\n");
glog("No joystick is attached");
return;
}
@ -259,72 +339,6 @@ joystick_update_buttons()
#endif
#if defined(HAVE_SDL) && !defined(JOYSTICK_DEFINED)
# define JOYSTICK_DEFINED
void
joystick_init()
{
int i;
if( SDL_Init( SDL_INIT_JOYSTICK ) < 0 ) {
glogf( "SDL could not initialize joystick! SDL Error: %s", SDL_GetError() );
} else {
glog("SDL2 joystick initialized");
}
if (SDL_NumJoysticks()<1) {
glog("No joysticks detected");
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
} else {
// @todo: make controller configurable
// @todo: add multiple controller support
gGameController = SDL_JoystickOpen( 0 );
if( gGameController == NULL ) {
glogf( "Warning: Unable to open game controller! SDL Error: %s", SDL_GetError() );
}
}
g_joystick_native_type = 2;
g_joystick_native_type1 = 2;
g_joystick_native_type2 = -1;
for(i = 0; i < 4; i++) {
g_paddle_val[i] = 180;
}
g_joystick_type = JOYSTICK_TYPE_NATIVE_1;
SDL_JoystickUpdate();
joystick_update(0.0);
}
void
joystick_update(double dcycs)
{
if (gGameController) {
SDL_JoystickUpdate();
g_paddle_val[0] = (int)SDL_JoystickGetAxis(gGameController, 0);
g_paddle_val[1] = (int)SDL_JoystickGetAxis(gGameController, 1);
if (SDL_JoystickGetButton(gGameController, 0)) {
g_paddle_buttons = g_paddle_buttons | 1;
} else {
g_paddle_buttons = g_paddle_buttons & (~1);
}
if (SDL_JoystickGetButton(gGameController, 1)) {
g_paddle_buttons = g_paddle_buttons | 2;
} else {
g_paddle_buttons = g_paddle_buttons & (~2);
}
paddle_update_trigger_dcycs(dcycs);
}
}
void
joystick_update_buttons()
{
}
void joystick_shut() {
SDL_JoystickClose( gGameController );
gGameController = NULL;
}
#endif
@ -354,7 +368,6 @@ joystick_update_buttons()
{
}
// OG
void joystick_shut()
{
}

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#ifdef ACTIVEIPHONE

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#ifdef ACTIVEIPHONE

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,30 +1,14 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2014 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"
#ifdef HAVE_TFE
#include "tfe/protos_tfe.h"
#include "tfe/protos_tfe.h"
#endif
extern char const g_gsplus_version_str[];
@ -150,21 +134,21 @@ Emustate_word32list g_emustate_word32list[] = {
//#ifdef _WINDOWS
// OG Added Transwarp ROM
// OG Added Transwarp ROM
#define TRANSWARP
int transwarp_low_val = 0;
#ifdef _WIN32
#ifdef _WIN32
__declspec(align(256))
#endif
unsigned char transwarpcode[][32]
#if !defined(_WIN32) && !defined(__OS2__)
#if !defined(_WIN32)
__attribute__ ((aligned(256)))
#endif
={
{
/*0xBCFF00*/ 'T','W','G','S',0,0,0,0,0,0,0,0,0,0,0,0,
/*0xBCFF10*/ 0x5C,0x40,0xFF,0xBC, // JMP GetMaxSpeed
/*0xBCFF14*/ 0x5C,0x60,0xFF,0xBC, // JMP GetNumISpeed
/*0xBCFF10*/ 0x5C,0x40,0xFF,0xBC, // JMP GetMaxSpeed
/*0xBCFF14*/ 0x5C,0x60,0xFF,0xBC, // JMP GetNumISpeed
/*0xBCFF18*/ 0x6B,0x00,0x00,0x00, // ???
/*0xBCFF1C*/ 0x6B,0x00,0x00,0x00 // ???
},
@ -176,7 +160,7 @@ __attribute__ ((aligned(256)))
/*0xBCFF30*/ 0x6B,0x00,0x00,0x00, // ???
/*0xBCFF34*/ 0x6B,0x00,0x00,0x00, // ???
/*0xBCFF38*/ 0x6B,0x00,0x00,0x00, // ???
/*0xBCFF3C*/ 0x6B,0x00,0x00,0x00 // GetTWConfig
/*0xBCFF3C*/ 0x6B,0x00,0x00,0x00 // GetTWConfig
},
{
/* 0xBCFF40*/ // GetMaxSpeed
@ -307,7 +291,7 @@ fixup_bank0_2000_4000()
} else if((g_c035_shadow_reg & 0x02) == 0) {
mem0wr += BANK_SHADOW;
}
} else {
if(RAMRD) {
mem0rd += 0x10000;
@ -422,13 +406,13 @@ fixup_intcx()
}
}
for(j = 0xc8; j < 0xd0; j++) {
/*c800 - cfff */
if(((g_c02d_int_crom & (1 << 3)) == 0) || INTCX)
{
if(((g_c02d_int_crom & (1 << 3)) == 0) || INTCX)
{
rom_inc = rom10000 + (j << 8);
}
else
else
{
rom_inc = rom10000 + (j << 8);
@ -452,7 +436,7 @@ fixup_wrdefram(int new_wrdefram)
byte *mem0wr;
byte *wrptr;
int j;
g_c08x_wrdefram = new_wrdefram;
if(g_c035_shadow_reg & 0x40) {
@ -1086,7 +1070,7 @@ setup_pageinfo()
word32 mem_size_pages;
/* first, set all of memory to point to itself */
mem_size_pages = g_mem_size_total >> 8;
mem0rd = &(g_memory_ptr[0]);
fixup_any_bank_any_page(0, mem_size_pages, mem0rd, mem0rd);
@ -1247,9 +1231,6 @@ io_read(word32 loc, double *cyc_ptr)
{
double dcycs;
word64 word64_tmp;
#if 0
double fcyc, new_fcyc;
#endif
word32 mask;
int new_lcbank2;
int new_wrdefram;
@ -1762,9 +1743,6 @@ void
io_write(word32 loc, int val, double *cyc_ptr)
{
double dcycs;
#if 0
double fcyc, new_fcyc;
#endif
int new_tmp;
int new_lcbank2;
int new_wrdefram;
@ -2076,7 +2054,7 @@ io_write(word32 loc, int val, double *cyc_ptr)
if((val & 0xe6) != 0) {
halt_printf("write c041: %02x\n", val);
}
if (val & C041_EN_MOUSE)
{
// Enable Mega II mouse
@ -2492,7 +2470,7 @@ get_slow_mem(word32 loc, int duff_cycles)
int val;
loc = loc & 0x1ffff;
if((loc &0xf000) == 0xc000) {
return(io_read(loc &0xfff, duff_cycles));
}

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#ifdef ASM
@ -469,4 +453,3 @@ get_dloc_ind_y_rd_16
#endif /* ASM */

389
src/options.c Normal file
View File

@ -0,0 +1,389 @@
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "options.h"
#include "glog.h"
#include "defc.h"
// config is parsed in config.c :: config_parse_config_gsplus_file()
// cli is parsed here. would be nice to reuse some code
// Halts on bad reads. Sets flags via engine_s.s:set_halt_act() function
extern int g_halt_on_bad_read; // defined in sim65816.c
// Ignore bad memory accesses.
extern int g_ignore_bad_acc; // defined in sim65816.c
// Ignore red alert halts.
extern int g_ignore_halts; // defined in sim65816.c
// Size of RAM memory expansion card in bytes (default = 8*1024*1024 = 8MB)
extern int g_mem_size_exp; // defined in sim65816.c
// Implemented in display drivers (not SDL2 though) ?
extern int g_screen_redraw_skip_amt; // defined in video.c, implemented in various driver files
// Using simple dhires color map
extern int g_use_dhr140; // defined in video.c
// Force B/W hires modes
extern int g_use_bw_hires; // defined in video.c
// Set starting X/Y positions
extern int g_startx; // defined in video.c
extern int g_starty; // defined in video.c
// Use High DPI (Retina) display - SDL2
extern int g_highdpi; // defined in video.c
// Create borderless window - SDL2
extern int g_borderless; // defined in video.c
// Allow window resizing, dragging to scale - SDL2
extern int g_resizeable; // defined in video.c
// Enable Dagen's scanline simulator (SDL2)
extern int g_scanline_simulator; // defined in sim65816.c
// Ethernet (interface?)
extern int g_ethernet; // defined in sim65816.c
// Enable and set port for Dagen's debugger
extern int g_dbg_enable_port; // defined in debug.c
// Set preferred audio frequency
extern int g_preferred_rate; // defined in sound_driver.c, implemented in various driver files
// Enable/disable audio
extern int g_audio_enable; // defined in sound.c
// Start in fullscreen mode
extern int g_fullscreen; // defined in adb.c, because weird driver writing for x
// Specify the joystick - SDL2
extern int g_joystick_number; // defined in joystick_driver.c
extern int g_joystick_x_axis; // defined in joystick_driver.c
extern int g_joystick_y_axis; // defined in joystick_driver.c
extern int g_joystick_x2_axis; // defined in joystick_driver.c
extern int g_joystick_y2_axis; // defined in joystick_driver.c
extern int g_joystick_button_0; // defined in joystick_driver.c
extern int g_joystick_button_1; // defined in joystick_driver.c
extern int g_joystick_button_2; // defined in joystick_driver.c
extern int g_joystick_button_3; // defined in joystick_driver.c
// DEPRECATED: force bit depth (15/16/24) for X-Windows, might still work.
extern int g_force_depth; // defined in sim65816.c
// DEPRECATED: Use X shared memory (MIT-SHM)
extern int g_use_shmem; // defined in all the various drivers
// DEPRECATED: Set DISPLAY environment variable for X-Windows
extern char g_display_env[512]; // defined in sim65816.c
// DEPRECATED: Set VERBOSE flags for one or more subsystems as defined below
extern int Verbose; // defined in sim65816.c
// #define VERBOSE_DISK 0x001
// #define VERBOSE_IRQ 0x002
// #define VERBOSE_CLK 0x004
// #define VERBOSE_SHADOW 0x008
// #define VERBOSE_IWM 0x010
// #define VERBOSE_DOC 0x020
// #define VERBOSE_ADB 0x040
// #define VERBOSE_SCC 0x080
// #define VERBOSE_TEST 0x100
// #define VERBOSE_VIDEO 0x200
// #define VERBOSE_MAC
// This is deprecated because it is not well-defined or supported
// It should still work and some sort of system should be put in place
// to extend and fix this, or take it out.
extern const char *g_config_gsplus_name_list[];
extern char g_config_gsplus_screenshot_dir[];
extern char *final_arg;
static const char parse_log_prefix[] = "Option set [CLI]:";
// this is here because we need to flip a bit to force B/W modes
extern int g_cur_a2_stat;
void help_exit(); // displays the cli help text and exits with 1
int parse_int(const char *str1, int min, int max)
{
int tmp;
tmp = strtol(str1, 0, 0);
if (tmp > max) { tmp = max; }
if (tmp < min) { tmp = min; }
printf ( "TMP %d\n", tmp);
return tmp;
}
int parse_cli_options(int argc, char **argv) {
int i;
int tmp1;
int skip_amt;
char *final_arg = 0;
for(i = 1; i < argc; i++) {
if( (!strcmp("-?", argv[i])) || (!strcmp("-h", argv[i])) || (!strcmp("-help", argv[i]))) {
help_exit();
} else if(!strcmp("-badrd", argv[i])) {
glogf("%s Halting on bad reads", parse_log_prefix);
g_halt_on_bad_read = 2;
} else if(!strcmp("-fullscreen", argv[i])) {
glogf("%s Starting emulator in fullscreen", parse_log_prefix);
g_fullscreen = 1;
} else if(!strcmp("-highdpi", argv[i])) {
glogf("%s Creating window in High DPI mode", parse_log_prefix);
g_highdpi = 1;
} else if(!strcmp("-borderless", argv[i])) {
glogf("%s Creating borderless window", parse_log_prefix);
g_borderless = 1;
} else if(!strcmp("-resizeable", argv[i])) {
glogf("%s Window will be resizeable", parse_log_prefix);
g_resizeable = 1;
} else if(!strcmp("-noignbadacc", argv[i])) {
glogf("%s Not ignoring bad memory accesses", parse_log_prefix);
g_ignore_bad_acc = 0;
} else if(!strcmp("-noignhalt", argv[i])) {
glogf("%s Not ignoring code red halts", parse_log_prefix);
g_ignore_halts = 0;
} else if(!strcmp("-mem", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-mem' missing argument", parse_log_prefix);
exit(1);
}
g_mem_size_exp = strtol(argv[i+1], 0, 0) & 0x00ff0000;
glogf("%s Using %d as memory size", parse_log_prefix, g_mem_size_exp);
i++;
} else if(!strcmp("-skip", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-skip' missing argument", parse_log_prefix);
exit(1);
}
skip_amt = strtol(argv[i+1], 0, 0);
glogf("%s Using %d as skip_amt", parse_log_prefix, skip_amt);
g_screen_redraw_skip_amt = skip_amt;
i++;
} else if(!strcmp("-audio", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-audio' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
glogf("%s Using %d as audio enable val", parse_log_prefix, tmp1);
g_audio_enable = tmp1;
i++;
} else if(!strcmp("-arate", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-arate' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
glogf("%s Using %d as preferred audio rate", parse_log_prefix, tmp1);
g_preferred_rate = tmp1;
i++;
} else if(!strcmp("-v", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-v' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
glogf("%s Setting Verbose = 0x%03x", parse_log_prefix, tmp1);
Verbose = tmp1;
i++;
} else if(!strcmp("-display", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-display' missing argument", parse_log_prefix);
exit(1);
}
glogf("%s Using %s as display", parse_log_prefix, argv[i+1]);
sprintf(g_display_env, "DISPLAY=%s", argv[i+1]);
putenv(&g_display_env[0]);
i++;
} else if(!strcmp("-noshm", argv[i])) {
glogf("%s Not using X shared memory", parse_log_prefix);
g_use_shmem = 0;
} else if(!strcmp("-joystick", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick number %d", parse_log_prefix, tmp1);
g_joystick_number = tmp1;
i++;
} else if(!strcmp("-joy_x", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_x' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick X axis %d", parse_log_prefix, tmp1);
g_joystick_x_axis = tmp1;
i++;
} else if(!strcmp("-joy_y", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_y' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick Y axis %d", parse_log_prefix, tmp1);
g_joystick_y_axis = tmp1;
i++;
} else if(!strcmp("-joy_x2", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_x2' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick X2 axis %d", parse_log_prefix, tmp1);
g_joystick_x2_axis = tmp1;
i++;
} else if(!strcmp("-joy_y2", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_y2' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick Y2 axis %d", parse_log_prefix, tmp1);
g_joystick_y2_axis = tmp1;
i++;
} else if(!strcmp("-joy_b0", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_b0' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick Button 0 to Gamepad %d", parse_log_prefix, tmp1);
g_joystick_button_0 = tmp1;
i++;
} else if(!strcmp("-joy_b1", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_b1' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick Button 1 to Gamepad %d", parse_log_prefix, tmp1);
g_joystick_button_1 = tmp1;
i++;
} else if(!strcmp("-joy_b2", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_b2' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick Button 2 to Gamepad %d", parse_log_prefix, tmp1);
g_joystick_button_2 = tmp1;
i++;
} else if(!strcmp("-joy_b3", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-joy_b3' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0); // no bounds check, not sure what ids we get
glogf("%s Setting joystick Button 3 to Gamepad %d", parse_log_prefix, tmp1);
g_joystick_button_3 = tmp1;
i++;
} else if(!strcmp("-dhr140", argv[i])) {
glogf("%s Using simple dhires color map", parse_log_prefix);
g_use_dhr140 = 1;
} else if(!strcmp("-bw", argv[i])) {
glogf("%s Forcing black-and-white hires modes", parse_log_prefix);
g_cur_a2_stat |= ALL_STAT_COLOR_C021;
g_use_bw_hires = 1;
} else if(!strcmp("-scanline", argv[i])) {
glogf("%s Enable scanline simulation", parse_log_prefix);
if((i+1) >= argc) {
glogf("%s Error, option '-scanline' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = parse_int(argv[i+1], 0, 100);
glogf("%s Setting scanline simulator darkness to %d%%", parse_log_prefix, tmp1);
g_scanline_simulator = tmp1;
i++;
} else if(!strcmp("-enet", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-enet' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
glogf("%s Using %d as ethernet enable val", parse_log_prefix, tmp1);
g_ethernet = tmp1;
i++;
} else if(!strcmp("-x", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-x' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
glogf("%s Using %d as x val", parse_log_prefix, tmp1);
g_startx = tmp1;
i++;
} else if(!strcmp("-y", argv[i])) {
if((i+1) >= argc) {
glogf("%s Error, option '-y' missing argument", parse_log_prefix);
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
glogf("%s Using %d as y val", parse_log_prefix, tmp1);
g_starty = tmp1;
i++;
} else if(!strcmp("-config", argv[i])) { // Config file passed
if((i+1) >= argc) {
glogf("%s Error, option '-config' missing argument", parse_log_prefix);
exit(1);
}
glogf("%s Using %s as configuration file", parse_log_prefix, argv[i+1]);
g_config_gsplus_name_list[0] = argv[i+1]; // overwrite default list with passed item as sole option
g_config_gsplus_name_list[1] = 0; // terminate string array
i++;
} else if (!strcmp("-ssdir", argv[i])) { // screenshot directory passed
strcpy(g_config_gsplus_screenshot_dir, argv[i+1]);
struct stat path_stat;
stat(g_config_gsplus_screenshot_dir, &path_stat); // (weakly) validate path
if (!S_ISDIR(path_stat.st_mode)) {
strcpy(g_config_gsplus_screenshot_dir, "./");
}
glogf("%s Using %s for screenshot path", parse_log_prefix, g_config_gsplus_screenshot_dir);
i++;
} else if(!strcmp("-debugport", argv[i])) { // Debug port passed
if((i+1) >= argc) {
glogf("%s Error, option '-debugport' missing argument", parse_log_prefix);
exit(1);
}
g_dbg_enable_port = strtol(argv[i+1], 0, 0);
glogf("%s Using %d for debug port", parse_log_prefix, g_dbg_enable_port);
i++;
} else {
if ((i == (argc - 1)) && (strncmp("-", argv[i], 1) != 0)) {
final_arg = argv[i];
} else {
glogf("%s Error, bad option: %s for debug port", parse_log_prefix, argv[i]);
exit(3);
}
}
}
}
void help_exit() {
printf(" USAGE: \n\n");
printf(" ./gsplus # simple - uses default config.txt\n");
printf(" ./gsplus -config games_hds.gsp # set custom config file\n\n");
printf(" You need to supply your own Apple IIgs Firmware ROM image.\n");
printf(" Press F4 when running gsplus to enter config menu and select ROM image location.\n");
printf(" Or copy the ROM image to the gsplus directory.\n");
printf(" It will search for: \"ROM\", \"ROM.01\", \"ROM.03\" \n\n\n");
printf(" Other command line options: \n\n");
printf(" -badrd Halt on bad reads\n");
printf(" -noignbadacc Dont ignore bad memory accesses\n");
printf(" -noignhalt Dont ignore code red halts\n");
printf(" -test Allow testing\n");
printf(" -joystick Ignore joystick option\n");
printf(" -bw Force B/W modes\n");
printf(" -dhr140 Use simple double-hires color map\n");
printf(" -fullscreen Attempt to start emulator in fullscreen\n");
printf(" -highdpi Attempt to open window in high DPI\n");
printf(" -borderless Attempt to create borderless window\n");
printf(" -resizeable Allow you to resize window (non-integral scaling to pixel)\n");
printf(" -mem value Set memory size to value\n");
printf(" -skip value Set skip_amt to value\n");
printf(" -audio value Set audio enable to value\n");
printf(" -arate value Set preferred audio rate to value\n");
printf(" -enet value Set ethernet to value\n");
printf(" -config value Set config file to value\n");
printf(" -debugport value Set debugport to value\n");
printf(" -ssdir value Set screenshot save directory to value\n");
printf(" -scanline value Enable scanline simulator at value %%\n");
printf(" -x value Open emulator window at x value\n");
printf(" -y value Open emulator window at y value\n");
printf(" -v value Set verbose flags to value\n\n");
printf(" Note: The final argument, if not a flag, will be tried as a mountable device.\n\n");
exit(1);
}

7
src/options.h Normal file
View File

@ -0,0 +1,7 @@
#ifdef __cplusplus
extern "C" {
#endif
int parse_cli_options(int argc, char **argv);
#ifdef __cplusplus
}
#endif

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/*

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
// Various ASCII codepage to unicode maps

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
typedef struct l2byte_st L2byte;

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* to_pro.c */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* xdriver.c and macdriver.c and windriver.c */
@ -47,9 +31,6 @@ void x_full_screen(int do_full);
void clipboard_paste(void);
int clipboard_get_char(void);
/* test65.c */
void do_gen_test(int got_num, int base_seed);
/* engine.s and engine_c.c */
void fixed_memory_ptrs_init();

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* END_HDR */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
void show_simple_alert(char *str1, char *str2, char *str3, int num);
@ -44,4 +28,3 @@ void x_auto_repeat_off(int must);
void x_hide_pointer(int do_hide);
void x_full_screen(int do_full);
void update_main_window_size(void);

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* END_HDR */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
// $KmKId: protos_windriver.h,v 1.4 2004-03-23 17:27:26-05 kentd Exp $
@ -47,4 +31,3 @@ void x_push_done(void);
void x_auto_repeat_on(int must);
void x_auto_repeat_off(int must);
void x_hide_pointer(int do_hide);

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* END_HDR */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2014 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include <ctype.h>

View File

@ -1,23 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013 - 2014 by GSport contributors
Originally authored by Christopher Mason
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* This is an interface between the SCC emulation and the Virtual Imagewriter. */

View File

@ -1,23 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013 - 2014 by GSport contributors
Originally authored by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* This is an interface between the SCC emulation and the LAP bridge. */

View File

@ -1,23 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2013 by GSport contributors
Originally authored by Peter Neubauer
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
void scc_llap_init();

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* This file contains the Mac serial calls */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* This file contains the socket calls */
@ -86,7 +70,7 @@ scc_socket_close_handle(SOCKET sockfd)
{
if (sockfd != -1)
{
#if defined(_WIN32) || defined (__OS2__)
#if defined(_WIN32)
return closesocket(sockfd); // NW: a Windows socket handle is not a file descriptor
#else
return close(sockfd);
@ -241,12 +225,10 @@ scc_socket_open_outgoing(int port, double dcycs)
sa_in.sin_port = htons(port_number);
hostentptr = gethostbyname((const char*)&scc_ptr->modem_cmd_str[0]); // OG Added Cast
if(hostentptr == 0) {
#if defined(_WIN32) || defined (__OS2__)
fatal_printf("Lookup host %s failed\n",
&scc_ptr->modem_cmd_str[0]);
#if defined(_WIN32)
fatal_printf("Lookup host %s failed\n", &scc_ptr->modem_cmd_str[0]);
#else
fatal_printf("Lookup host %s failed, herrno: %d\n",
&scc_ptr->modem_cmd_str[0], h_errno);
fatal_printf("Lookup host %s failed, herrno: %d\n", &scc_ptr->modem_cmd_str[0], h_errno);
#endif
scc_socket_close_handle(sockfd);
scc_socket_close(port, 1, dcycs);
@ -286,7 +268,7 @@ scc_socket_make_nonblock(int port, double dcycs)
Scc *scc_ptr;
SOCKET sockfd;
int ret;
#if defined(_WIN32) || defined (__OS2__)
#if defined(_WIN32)
u_long flags;
#else
int flags;
@ -295,7 +277,7 @@ scc_socket_make_nonblock(int port, double dcycs)
scc_ptr = &(scc_stat[port]);
sockfd = scc_ptr->sockfd;
#if defined(_WIN32) || defined (__OS2__)
#if defined(_WIN32)
flags = 1;
ret = ioctlsocket(sockfd, FIONBIO, &flags);
if(ret != 0) {
@ -404,7 +386,7 @@ scc_accept_socket(int port, double dcycs)
flags = 0;
ret = 0;
#if !defined(_WIN32) && !defined(__OS2__)
#if !defined(_WIN32)
/* For Linux, we need to set O_NONBLOCK on the rdwrfd */
flags = fcntl(rdwrfd, F_GETFL, 0);
if(flags == -1) {
@ -697,7 +679,7 @@ void
scc_socket_empty_writebuf(int port, double dcycs)
{
#ifdef SCC_SOCKETS
# if !defined(_WIN32) && !defined(__OS2__)
# if !defined(_WIN32)
struct sigaction newact, oldact;
# endif
Scc *scc_ptr;
@ -783,7 +765,7 @@ scc_socket_empty_writebuf(int port, double dcycs)
scc_ptr->out_char_dcycs = dcycs;
}
#if defined(_WIN32) || defined (__OS2__)
#if defined(_WIN32)
ret = send(rdwrfd, (const char*)&(scc_ptr->out_buf[rdptr]), len, 0); // OG Added Cast
# else
/* ignore SIGPIPE around writes to the socket, so we */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* This file contains the Win32 COM1/COM2 calls */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
// @todo: mouse clip bugs.. great western shootout. Paint 8/16. still in win32
@ -59,7 +43,13 @@ extern char g_config_gsplus_screenshot_dir[];
int screenshot_index = 0; // allows us to save time by not scanning from 0 each time
char screenshot_filename[256];
extern int g_fullscreen; // only checked at start if set via CLI, otherwise it's set via function call x_full_screen()
extern int g_highdpi;
extern int g_borderless;
extern int g_resizeable;
extern int g_scanline_simulator;
extern int g_startx;
extern int g_starty;
extern int g_screen_depth;
extern int g_quit_sim_now;
extern int g_border_sides_refresh_needed;
@ -295,16 +285,39 @@ void dev_video_init_sdl() {
// Create an application window with the following settings:
char window_title[32];
sprintf(window_title, "GSplus v%-6s", g_gsplus_version_str),
sprintf(window_title, "GSplus v%-6s", g_gsplus_version_str);
int startx = SDL_WINDOWPOS_UNDEFINED;
int starty = SDL_WINDOWPOS_UNDEFINED;
if (g_startx != WINDOWPOS_UNDEFINED) { startx = g_startx; }
if (g_starty != WINDOWPOS_UNDEFINED) { starty = g_starty; }
int more_flags = 0;
// check for CLI fullscreen
if (g_fullscreen) {
more_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
}
if (g_highdpi) {
more_flags |= SDL_WINDOW_ALLOW_HIGHDPI;
}
if (g_borderless) {
more_flags |= SDL_WINDOW_BORDERLESS;
}
if (g_resizeable) {
more_flags |= SDL_WINDOW_RESIZABLE;
}
window = SDL_CreateWindow(
window_title, // window title (GSport vX.X)
SDL_WINDOWPOS_UNDEFINED, // initial x position
SDL_WINDOWPOS_UNDEFINED, // initial y position
// SDL_WINDOWPOS_UNDEFINED, // initial x position
// SDL_WINDOWPOS_UNDEFINED, // initial y position
startx, starty,
BASE_WINDOW_WIDTH, // width, in pixels
X_A2_WINDOW_HEIGHT, // height, in pixels
SDL_WINDOW_OPENGL // flags - see below
| more_flags
);
// Check that the window was successfully created
if (window == NULL) {
// In the case that the window could not be made...
@ -337,13 +350,16 @@ void dev_video_init_sdl() {
SDL_SetTextureBlendMode(overlay_texture, SDL_BLENDMODE_BLEND);
overlay_pixels = malloc(BASE_WINDOW_WIDTH*X_A2_WINDOW_HEIGHT*sizeof(Uint32));
Uint32 pixelARGB = 0x33000000; // default "low grey"
if (overlay_pixels) {
if (g_scanline_simulator > 0) {
pixelARGB = (int)(g_scanline_simulator*2.56) << 24;
}
for (int y=0; y<X_A2_WINDOW_HEIGHT; y++) {
for (int x=0; x<BASE_WINDOW_WIDTH; x++) {
if (y%2 == 1) {
overlay_pixels[(y*BASE_WINDOW_WIDTH)+x] = 0x30000000;
overlay_pixels[(y*BASE_WINDOW_WIDTH)+x] = pixelARGB;
}
}
}
@ -355,6 +371,7 @@ void dev_video_init_sdl() {
dstrect.h = X_A2_WINDOW_HEIGHT;
int pitch = BASE_WINDOW_WIDTH;
// UPDATE A RECT OF THE APPLE II SCREEN TEXTURE
SDL_UpdateTexture(overlay_texture, &dstrect, overlay_pixels, pitch*sizeof(Uint32) );

View File

@ -1,20 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "SDL.h"
@ -36,6 +24,10 @@ static /* volatile */ int snd_read = 0;
static int g_sound_paused;
static int g_zeroes_buffered;
static int g_zeroes_seen;
// newer SDL allows you to specify devices. for now, we use what it gives us,
// but this can be made configurable in the future
SDL_AudioDeviceID dev = 0;
void sdlsnd_init(word32 *shmaddr)
{
@ -60,7 +52,7 @@ sound_write_sdl(int real_samps, int size)
if (real_samps) {
shm_read = (g_sound_shm_pos - size + SOUND_SHM_SAMP_SIZE)%SOUND_SHM_SAMP_SIZE;
SDL_LockAudio();
SDL_LockAudioDevice(dev);
while(size > 0) {
if(g_playbuf_buffered >= snd_buf) {
printf("sound_write_sdl failed @%d, %d buffered, %d samples skipped\n",snd_write,g_playbuf_buffered, size);
@ -82,17 +74,17 @@ sound_write_sdl(int real_samps, int size)
assert((snd_buf+snd_write - snd_read)%snd_buf == g_playbuf_buffered%snd_buf);
assert(g_sound_shm_pos == shm_read);
SDL_UnlockAudio();
SDL_UnlockAudioDevice(dev);
}
if(g_sound_paused && (g_playbuf_buffered > 0)) {
glogf("Unpausing sound, %d buffered",g_playbuf_buffered);
g_sound_paused = 0;
SDL_PauseAudio(0);
SDL_PauseAudioDevice(dev, 0);
}
if(!g_sound_paused && (g_playbuf_buffered <= 0)) {
glog("Pausing sound");
g_sound_paused = 1;
SDL_PauseAudio(1);
SDL_PauseAudioDevice(dev, 1);
}
#endif
}
@ -136,9 +128,8 @@ sound_init_device_sdl()
long rate;
SDL_AudioSpec wanted;
//if(SDL_InitSubSystem(SDL_INIT_AUDIO)) {
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
fprintf(stderr, "sdl: Couldn't init SDL_Audio: %s!\n", SDL_GetError());
if (SDL_Init(SDL_INIT_AUDIO) < 0) {
glogf("SDL2 Couldn't init SDL_INIT_AUDIO: %s!", SDL_GetError());
return 0;
}
@ -151,23 +142,28 @@ sound_init_device_sdl()
wanted.userdata = NULL;
/* Open audio, and get the real spec */
if(SDL_OpenAudio(&wanted, &spec) < 0) {
fprintf(stderr, "sdl: Couldn't open audio: %s!\n", SDL_GetError());
SDL_QuitSubSystem(SDL_INIT_AUDIO);
return 0;
dev = SDL_OpenAudioDevice(NULL, 0, &wanted, &spec, 0);
if (dev == 0) {
glogf("SDL2 Couldn't open audio: %s!", SDL_GetError());
SDL_QuitSubSystem(SDL_INIT_AUDIO);
return 0;
} else {
glogf("SDL2 opened audio device: %d", dev);
}
/* Check everything */
if(spec.channels != wanted.channels) {
fprintf(stderr, "sdl: Couldn't get stereo audio format!\n");
goto snd_error;
glogf("SDL2 Warning, couldn't get stereo audio format!");
//goto snd_error;
}
if(spec.format != wanted.format) {
fprintf(stderr, "sdl: Couldn't get a supported audio format!\n");
fprintf(stderr, "sdl: wanted %X, got %X\n",wanted.format,spec.format);
goto snd_error;
glog("SDL2 Warning, couldn't get a supported audio format!");
glogf("SDL2 wanted %X, got %X",wanted.format,spec.format);
//goto snd_error;
}
if(spec.freq != wanted.freq) {
fprintf(stderr, "sdl: wanted rate = %d, got rate = %d\n", wanted.freq, spec.freq);
glogf("SDL2 wanted rate = %d, got rate = %d", wanted.freq, spec.freq);
}
/* Set things as they really are */
rate = spec.freq;
@ -178,7 +174,7 @@ sound_init_device_sdl()
goto snd_error;
g_playbuf_buffered = 0;
glogf("Sound shared memory size=%d", SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);
glogf("SDL2 sound shared memory size=%d", SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);
g_sound_shm_addr = malloc(SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);
memset(g_sound_shm_addr,0,SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE);
@ -188,14 +184,14 @@ sound_init_device_sdl()
g_zeroes_seen = 0;
/* Let's start playing sound */
g_sound_paused = 0;
SDL_PauseAudio(0);
SDL_PauseAudioDevice(dev, 0);
set_audio_rate(rate);
return rate;
snd_error:
/* Oops! Something bad happened, cleanup. */
SDL_CloseAudio();
SDL_CloseAudioDevice(dev);
SDL_QuitSubSystem(SDL_INIT_AUDIO);
if(playbuf)
free((void*)playbuf);
@ -211,20 +207,9 @@ void
sound_shutdown_sdl()
{
#ifdef HAVE_SDL
SDL_CloseAudio();
SDL_CloseAudioDevice(dev);
if(playbuf)
free((void*)playbuf);
playbuf = 0;
#endif
}
void
sound_shutdown2()
{
sound_shutdown_sdl();
if (g_sound_shm_addr)
{
free(g_sound_shm_addr);
g_sound_shm_addr=NULL;
}
}

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include <assert.h>

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2014 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include <math.h>
@ -27,6 +11,7 @@
#include "imagewriter.h"
#include "debug.h"
#include "glog.h"
#include "options.h"
extern const char *g_config_gsplus_name_list[];
extern char g_config_gsplus_screenshot_dir[];
@ -54,17 +39,17 @@ int g_accept_events = 0; // OG To know if the emulator is ready to accept extern
char g_argv0_path[256] = "./";
const char *g_gsplus_default_paths[] = { // probably overkill on the paths
"",
"./",
"",
"./",
"${HOME}/",
"${PWD}/",
"${HOME}/Library/GSplus/",
"/usr/local/lib/",
"/usr/lib/gsplus/",
"/usr/local/gsplus/",
"/usr/local/lib/gsplus/",
"/usr/lib/gsplus/",
"/usr/local/gsplus/",
"/usr/local/lib/gsplus/",
"/usr/share/gsplus/",
"/var/lib/",
"/var/lib/",
"${0}/",
0 };
@ -132,7 +117,6 @@ int g_screen_depth = 8;
int g_scanline_simulator = 0;
extern int g_screen_redraw_skip_amt;
extern int g_use_shmem;
extern int g_use_dhr140;
extern int g_use_bw_hires;
@ -142,13 +126,14 @@ double g_fcycles_stop = 0.0;
int halt_sim = 0;
int enter_debug = 0;
int g_rom_version = -1;
int g_user_halt_bad = 0;
int g_halt_on_bad_read = 0;
int g_ignore_bad_acc = 1;
int g_ignore_halts = 1;
int g_code_red = 0;
int g_code_yellow = 0;
int g_use_alib = 0;
int g_serial_type[2];
int g_iw2_emul = 0;
int g_serial_out_masking = 0;
@ -180,7 +165,7 @@ int g_imagewriter_paper = 0;
int g_imagewriter_banner = 0;
int g_config_iwm_vbl_count = 0;
const char g_gsplus_version_str[] = "0.13"; // the "KS" special version
const char g_gsplus_version_str[] = "0.14rc";
int g_pause=0; // OG Added pause
#define START_DCYCS (0.0)
@ -207,7 +192,6 @@ int g_engine_scan_int = 0;
int g_engine_doc_int = 0;
int g_testing = 0;
int g_testing_enabled = 0;
#define MAX_FATAL_LOGS 20
@ -272,7 +256,6 @@ void sim65816_initglobals() {
g_ignore_halts = 1;
g_code_red = 0;
g_code_yellow = 0;
g_use_alib = 0;
g_iw2_emul = 0;
g_serial_out_masking = 0;
//g_serial_modem[2] = { 0, 1 };
@ -302,7 +285,6 @@ void sim65816_initglobals() {
g_engine_doc_int = 0;
g_testing = 0;
g_testing_enabled = 0;
g_debug_file_fd = -1;
g_fatal_log = -1;
@ -909,37 +891,6 @@ void banner() {
printf("\x1b[37m GSplus v%s \x1b[0m \n\n", g_gsplus_version_str);
}
void help_exit() {
printf(" USAGE: \n\n");
printf(" ./gsplus # simple - uses default config.txt\n");
printf(" ./gsplus -config games_hds.gsp # set custom config file\n\n");
printf(" You need to supply your own Apple IIgs Firmware ROM image.\n");
printf(" Press F4 when running gsplus to enter config menu and select ROM image location.\n");
printf(" Or copy the ROM image to the gsplus directory.\n");
printf(" It will search for: \"ROM\", \"ROM.01\", \"ROM.03\" \n\n\n");
printf(" Other command line options: \n\n");
printf(" -badrd Halt on bad reads\n");
printf(" -noignbadacc Dont ignore bad memory accesses\n");
printf(" -noignhalt Dont ignore code red halts\n");
printf(" -test Allow testing\n");
printf(" -joystick Ignore joystick option\n");
printf(" -bw Force B/W modes\n");
printf(" -dhr140 Use simple double-hires color map\n");
printf(" -mem value Set memory size to value\n");
printf(" -skip value Set skip_amt to value\n");
printf(" -audio value Set audio enable to value\n");
printf(" -arate value Set preferred audio rate to value\n");
printf(" -enet value Set ethernet to value\n");
printf(" -config value Set config file to value\n");
printf(" -debugport value Set debugport to value\n");
printf(" -ssdir value Set screenshot save directory to value\n");
printf(" -scanline Enable scanline simulator\n");
printf(" -noscanline Disable scanline simulator (default)\n");
printf(" -v value Set verbose flags to value\n\n");
printf(" Note: The final argument, if not a flag, will be tried as a mountable device.\n\n");
exit(1);
}
int gsplusmain(int argc, char **argv) {
int diff;
int skip_amt;
@ -947,160 +898,22 @@ int gsplusmain(int argc, char **argv) {
int i;
char *final_arg = 0;
// just for fun
banner();
// OG Restoring globals
sim65816_initglobals();
moremem_init();
tmp1 = parse_cli_options(argc, argv);
// initialize ss dir to default value (current path)
strcpy(g_config_gsplus_screenshot_dir, "./");
/* parse args */
for(i = 1; i < argc; i++) {
if( (!strcmp("-?", argv[i])) || (!strcmp("-h", argv[i])) || (!strcmp("-help", argv[i]))) {
help_exit();
} else if(!strcmp("-badrd", argv[i])) {
printf("Halting on bad reads\n");
g_halt_on_bad_read = 2;
} else if(!strcmp("-noignbadacc", argv[i])) {
printf("Not ignoring bad memory accesses\n");
g_ignore_bad_acc = 0;
} else if(!strcmp("-noignhalt", argv[i])) {
printf("Not ignoring code red halts\n");
g_ignore_halts = 0;
} else if(!strcmp("-test", argv[i])) {
printf("Allowing testing\n");
g_testing_enabled = 1;
} else if(!strcmp("-hpdev", argv[i])) {
printf("Using /dev/audio\n");
g_use_alib = 0;
} else if(!strcmp("-alib", argv[i])) {
printf("Using Aserver audio server\n");
g_use_alib = 1;
} else if(!strcmp("-24", argv[i])) {
printf("Using 24-bit visual\n");
g_force_depth = 24;
} else if(!strcmp("-16", argv[i])) {
printf("Using 16-bit visual\n");
g_force_depth = 16;
} else if(!strcmp("-15", argv[i])) {
printf("Using 15-bit visual\n");
g_force_depth = 15;
} else if(!strcmp("-mem", argv[i])) {
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
g_mem_size_exp = strtol(argv[i+1], 0, 0) & 0x00ff0000;
printf("Using %d as memory size\n", g_mem_size_exp);
i++;
} else if(!strcmp("-skip", argv[i])) {
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
skip_amt = strtol(argv[i+1], 0, 0);
printf("Using %d as skip_amt\n", skip_amt);
g_screen_redraw_skip_amt = skip_amt;
i++;
} else if(!strcmp("-audio", argv[i])) {
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
printf("Using %d as audio enable val\n", tmp1);
g_audio_enable = tmp1;
i++;
} else if(!strcmp("-arate", argv[i])) {
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
printf("Using %d as preferred audio rate\n", tmp1);
g_preferred_rate = tmp1;
i++;
} else if(!strcmp("-v", argv[i])) {
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
printf("Setting Verbose = 0x%03x\n", tmp1);
Verbose = tmp1;
i++;
} else if(!strcmp("-display", argv[i])) {
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
printf("Using %s as display\n", argv[i+1]);
sprintf(g_display_env, "DISPLAY=%s", argv[i+1]);
putenv(&g_display_env[0]);
i++;
} else if(!strcmp("-noshm", argv[i])) {
printf("Not using X shared memory\n");
g_use_shmem = 0;
} else if(!strcmp("-joystick", argv[i])) {
printf("Ignoring -joystick option\n");
} else if(!strcmp("-dhr140", argv[i])) {
printf("Using simple dhires color map\n");
g_use_dhr140 = 1;
} else if(!strcmp("-bw", argv[i])) {
printf("Forcing black-and-white hires modes\n");
g_cur_a2_stat |= ALL_STAT_COLOR_C021;
g_use_bw_hires = 1;
} else if(!strcmp("-scanline", argv[i])) {
g_scanline_simulator = 1;
} else if(!strcmp("-noscanline", argv[i])) {
g_scanline_simulator = 0;
} else if(!strcmp("-enet", argv[i])) {
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
tmp1 = strtol(argv[i+1], 0, 0);
printf("Using %d as ethernet enable val\n", tmp1);
g_ethernet = tmp1;
i++;
} else if(!strcmp("-config", argv[i])) { // Config file passed
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
printf("Using %s as configuration file\n", argv[i+1]);
g_config_gsplus_name_list[0] = argv[i+1]; // overwrite default list with passed item as sole option
g_config_gsplus_name_list[1] = 0; // terminate string array
i++;
} else if (!strcmp("-ssdir", argv[i])) { // screenshot directory passed
strcpy(g_config_gsplus_screenshot_dir, argv[i+1]);
struct stat path_stat;
stat(g_config_gsplus_screenshot_dir, &path_stat); // (weakly) validate path
if (!S_ISDIR(path_stat.st_mode)) {
strcpy(g_config_gsplus_screenshot_dir, "./");
}
printf("USING SCREEN PATH: %s\n", g_config_gsplus_screenshot_dir);
i++;
} else if(!strcmp("-debugport", argv[i])) { // Debug port passed
if((i+1) >= argc) {
printf("Missing argument\n");
exit(1);
}
g_dbg_enable_port = strtol(argv[i+1], 0, 0);
printf("Debug port: %d\n", g_dbg_enable_port);
i++;
} else {
if ((i == (argc - 1)) && (strncmp("-", argv[i], 1) != 0)) {
final_arg = argv[i];
} else {
printf("Bad option: %s\n", argv[i]);
exit(3);
}
}
}
// just for fun
banner();
check_engine_asm_defines();
fixed_memory_ptrs_init();
@ -1383,11 +1196,11 @@ void setup_gsplus_file(char *outname, int maxlen, int ok_if_missing, int can_cre
// However, GSplus is promoting a notion of Config-as-a-VM
// where we want to encourage many configs. (See DGB video
// on YT regarding the GSVision UI experiment.)
glogf("Trying to create config (%s)", "${HOME}/.config.gsp");
gsport_expand_path(&(local_path[0]), "${HOME}/.config.gsp", 250);
strcpy(outname, &(local_path[0]));
// Ask user if it's OK to create the file (or just create it)
x_dialog_create_gsport_conf(*name_ptr);
@ -2792,7 +2605,6 @@ void
must_write(int fd, char *bufptr, int len)
{
int ret;
#ifndef __OS2__
while(len > 0) {
ret = write(fd, bufptr, len);
if(ret >= 0) {
@ -2802,9 +2614,6 @@ must_write(int fd, char *bufptr, int len)
return; // just get out
}
}
#else
printf("%s\n",bufptr);
#endif
}
void

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
.word inst00_SYM+1 /* brk */

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"
@ -268,7 +252,7 @@ sound_init_general()
{
/* Workaround - gcc in cygwin wasn't defining _WIN32 */
#if !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__OS2__) && !defined(HAVE_SDL)
#if !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(MAC) && !defined(HAVE_SDL)
int pid;
int shmid;
int tmp;
@ -280,7 +264,7 @@ sound_init_general()
int ret;
/* Workaround - gcc in cygwin wasn't defining _WIN32 */
#if !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__OS2__) && !defined(HAVE_SDL)
#if !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(MAC) && !defined(HAVE_SDL)
if(!g_use_shmem) {
if(g_audio_enable < 0) {
printf("Defaulting audio off for slow X display\n");
@ -298,7 +282,7 @@ sound_init_general()
size = SOUND_SHM_SAMP_SIZE * SAMPLE_CHAN_SIZE;
/* Workaround - gcc in cygwin wasn't defining _WIN32 */
#if !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(MAC) && !defined(__OS2__) && !defined(HAVE_SDL)
#if !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(MAC) && !defined(HAVE_SDL)
shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0777);
if(shmid < 0) {
printf("sound_init: shmget ret: %d, errno: %d\n", shmid, errno);
@ -328,7 +312,7 @@ sound_init_general()
fflush(stdout);
/* Workaround - gcc in cygwin wasn't defining _WIN32 */
#if !defined(MAC) && !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(__OS2__) && !defined(HAVE_SDL)
#if !defined(MAC) && !defined(WIN_SOUND) && !defined(__CYGWIN__) && !defined(HAVE_SDL)
/* prepare pipe so parent can signal child each other */
/* pipe[0] = read side, pipe[1] = write end */
ret = pipe(&g_pipe_fd[0]);
@ -384,7 +368,6 @@ sound_init_general()
win32snd_init(shmaddr);
# elif defined (MAC) && !defined(HAVE_SDL)
macsnd_init(shmaddr);
# elif defined (__OS2__)
# endif
#endif
@ -393,7 +376,6 @@ sound_init_general()
void
parent_sound_get_sample_rate(int read_fd)
{
#ifndef __OS2__
word32 tmp;
int ret;
@ -406,7 +388,6 @@ parent_sound_get_sample_rate(int read_fd)
close(read_fd);
set_audio_rate(tmp);
#endif
}
void
@ -456,7 +437,6 @@ sound_shutdown()
#ifdef WIN_SOUND /* Workaround - gcc in cygwin wasn't defining _WIN32 */
win32snd_shutdown();
#elif defined(__OS2__)
#elif defined(HAVE_SDL)
if((g_audio_enable != 0)) {
//sdlsnd_shutdown();
@ -660,8 +640,6 @@ send_sound(int real_samps, int size)
child_sound_playit(tmp);
#elif defined(HAVE_SDL)
sound_write_sdl( real_samps, size);
#elif defined(__OS2__)
#else
/* Although this looks like a big/little-endian issue, since the */
/* child is also reading an int, it just works with no byte swap */

View File

@ -1,27 +1,11 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#if !defined(_WIN32) && !defined(__CYGWIN__) && !defined (__OS2__)
#if !defined(_WIN32) && !defined(__CYGWIN__)
# include <sys/ipc.h>
# include <sys/shm.h>
#endif

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/* This file is included by video.c */

View File

@ -1,22 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
/*tfe.c*/
@ -101,4 +87,4 @@ int tfe_arch_enumadapter_open(void);
int tfe_arch_enumadapter(char **ppname, char **ppdescription);
int tfe_arch_enumadapter_close(void);
#endif
#endif

View File

@ -39,7 +39,7 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#ifdef WIN32
#ifdef WIN32
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
@ -82,10 +82,8 @@ void *lib_malloc(size_t size)
void *ptr = malloc(size);
#endif
#ifndef __OS2__
if (ptr == NULL && size > 0)
exit(-1);
#endif
#ifdef LIB_DEBUG
lib_debug_alloc(ptr, size, 3);
#endif
@ -123,10 +121,8 @@ void *lib_realloc(void *ptr, size_t size)
void *new_ptr = realloc(ptr, size);
#endif
#ifndef __OS2__
if (new_ptr == NULL)
exit(-1);
#endif
#ifdef LIB_DEBUG
lib_debug_free(ptr, 1, 0);
lib_debug_alloc(new_ptr, size, 1);
@ -182,7 +178,6 @@ unsigned long crc32_buf(const char *buffer, unsigned int len)
crc = 0xffffffff;
for (p = buffer; len > 0; ++p, --len)
crc = (crc >> 8) ^ crc32_table[(crc ^ *p) & 0xff];
return ~crc;
}

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

View File

@ -5,12 +5,13 @@ FSTOBJ = win32_host_fst.o
OBJECTS = sdl2_driver.o $(OBJECTS1) $(FSTOBJ) sdl2snd_driver.o
CCOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I/usr/include/SDL2
CPPOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I /usr/include/freetype2 -I/usr/include/SDL2
CCOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I/usr/include/SDL2 -L/cygdrive/c/mingw/lib -I/cygdrive/c/mingw/include/SDL2/
CPPOPTS = -O2 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I/usr/include/freetype2 -L/cygdrive/c/mingw/lib -I/cygdrive/c/mingw/include/SDL2/
SUFFIX = ".exe"
EXTRA_LIBS = -Larch/win32 -lSDL2main -lSDL2 -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -lcygwin
EXTRA_LIBS = -L/usr/local/lib -lcygwin -lSDL2main -lSDL2 -mwindows -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -L/usr/lib -lpthread -lSDL2_image
EXTRA_LIBS = -L/usr/local/lib -lcygwin -lSDL2main -lSDL2 -mwindows -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -L/usr/lib -lpthread -lSDL2_image -L/cygdrive/c/mingw/lib -I/cygdrive/c/mingw/include/SDL2/
XOPTS = -Wall -fomit-frame-pointer -march=i686

21
src/vars_win32_sdl2 Normal file
View File

@ -0,0 +1,21 @@
TARGET = gsplus.exe
NAME = gsplus
MINGW_HOME = /cygdrive/c/mingw/i686-w64-mingw32
FSTOBJ = win32_host_fst.o
OBJECTS = sdl2_driver.o $(OBJECTS1) $(FSTOBJ) sdl2snd_driver.o
CCOPTS = -O3 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I$(MINGW_HOME)/include/SDL2 -DWINSDL_BORDERHACK
CPPOPTS = -O3 -DGSPLUS_LITTLE_ENDIAN -DHAVE_SDL -DWIN_SDL -DTOGGLE_STATUS -I/usr/include/freetype2 -I$(MINGW_HOME)/include/SDL2
SUFFIX = ".exe"
# working in cygwin
EXTRA_LIBS = -lcygwin -lSDL2main -lSDL2 -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -lpthread -lSDL2_image -L$(MINGW_HOME)/lib/
EXTRA_LIBS = -lcygwin -lSDL2main -lSDL2 -lfreetype -lcomdlg32 -lShlwapi -lIPHlpApi -lpthread -lSDL2_image -L$(MINGW_HOME)/lib/ -Larch/win32 -lshell32
#XOPTS = -Wall -fomit-frame-pointer -march=i686
XLIBS =

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 - 2012 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include <time.h>
@ -105,6 +89,11 @@ int g_border_last_vbl_changes = 0;
int g_use_dhr140 = 0;
int g_use_bw_hires = 0;
int g_startx = WINDOWPOS_UNDEFINED;
int g_starty = WINDOWPOS_UNDEFINED;
int g_highdpi = 0;
int g_borderless = 0;
int g_resizeable = 0;
int g_a2_new_all_stat[200];
int g_a2_cur_all_stat[200];
@ -587,7 +576,7 @@ video_reset()
stat |= ALL_STAT_COLOR_C021;
}
if(g_config_control_panel) {
/* Don't update cur_a2_stat when in configuration panel */
/* Don't update cur_a2_stat when in configuration panel */
g_save_cur_a2_stat = stat;
} else {
g_cur_a2_stat = stat;
@ -607,7 +596,7 @@ int g_screen_redraw_skip_amt = -1;
word32 g_cycs_in_check_input = 0;
int g_needfullrefreshfornextframe = 1 ;
int g_needfullrefreshfornextframe = 1 ;
void video_update()
{
@ -655,8 +644,8 @@ void video_update()
g_vid_update_last_line = 0;
video_update_through_line(0);
}
// OG Notify host that video has been uodated
#if defined(ACTIVEGSPLUGIN) && defined(MAC)
{
@ -1653,7 +1642,7 @@ redraw_changed_gr(int start_offset, int start_line, int num_lines, int reparse,
(eff_line > end_line)) {
continue;
}
img_ptr[0] = val0_wd + palette_add;
img_ptr[1] = val0_wd + palette_add;
img_ptr[2] = val0_wd + palette_add;
@ -3213,7 +3202,7 @@ video_push_lines(Kimage *kimage_ptr, int start_line, int end_line, int left_pix,
int center = 0; // OG added variable to center screen
//OG add null pointer check when emulator is restarted
if (!kimage_ptr)
if (!kimage_ptr)
{
printf("warning : video_push_lines(kimage_ptr=null)\n");
return ;
@ -3246,7 +3235,7 @@ video_push_lines(Kimage *kimage_ptr, int start_line, int end_line, int left_pix,
center=EFF_BORDER_WIDTH - BORDER_WIDTH;
// OG shifting image to the center
x_push_kimage(kimage_ptr, g_video_act_margin_left + left_pix + center,
x_push_kimage(kimage_ptr, g_video_act_margin_left + left_pix + center,
g_video_act_margin_top + srcy, left_pix, srcy,
(right_pix - left_pix), 2*(end_line - start_line));
}
@ -3311,7 +3300,7 @@ video_push_border_sides()
/* redraw left sides */
// OG Left side can alos be "jagged" as a2 screen is now being centered
//video_push_border_sides_lines(0, 0, BORDER_WIDTH, 0, 200);
prev_line = -1;
@ -3376,10 +3365,20 @@ video_push_border_special()
dest_x = 0;
src_x = BASE_MARGIN_LEFT - g_video_act_margin_left;
/*
glogf("width: %d", kimage_ptr->width_act);
for (int i = 600; i< 700; i++) {
kimage_ptr->data_ptr[i*4] = 0xFF;
kimage_ptr->data_ptr[i*4+1] = 0xFF;
kimage_ptr->data_ptr[i*4+2] = 0x00;
}
*/
if(width > 0 && height > 0) {
x_push_kimage(kimage_ptr, dest_x, dest_y, src_x, src_y,
width, height);
#ifdef WINSDL_BORDERHACK
x_push_kimage(kimage_ptr, dest_x+72, dest_y, src_x, src_y, width, height);
#endif
x_push_kimage(kimage_ptr, dest_x, dest_y, src_x, src_y, width, height);
// glogf("X:%d Y: %d SX:%d SY:%D W:%d H:%d\n",dest_x, dest_y, src_x, src_y, width, height);
}
// Then fix top border: dest_x from 0 to 640+LEFT+RIGHT and
@ -3390,8 +3389,10 @@ video_push_border_special()
dest_y = 0;
src_y = BASE_MARGIN_BOTTOM;
if(width > 0 && height > 0) {
x_push_kimage(kimage_ptr, dest_x, dest_y, src_x, src_y,
width, height);
#ifdef WINSDL_BORDERHACK
x_push_kimage(kimage_ptr, dest_x+72, dest_y, src_x, src_y, width, height);
#endif
x_push_kimage(kimage_ptr, dest_x, dest_y, src_x, src_y, width, height);
}
}
@ -3429,21 +3430,21 @@ video_push_kimages()
if (x_calc_ratio(ratiox,ratioy))
{
line = 0;
line = 0;
while (1)
{
start = line;
cur_kim = g_a2_line_kimage[line];
while(line < 200 && g_a2_line_kimage[line] == cur_kim) line++;
cur_kim = g_a2_line_kimage[line];
while(line < 200 && g_a2_line_kimage[line] == cur_kim) line++;
if (cur_kim == &g_kimage_superhires)
right = 640;
else
right = 560;
video_push_lines(cur_kim, start, line,0,right);
if (line==200) break;
}
}
else
{

View File

@ -1,24 +1,8 @@
/*
GSPLUS - Advanced Apple IIGS Emulator Environment
Copyright (C) 2016 - Dagen Brock
Copyright (C) 2010 by GSport contributors
Based on the KEGS emulator written by and Copyright (C) 2003 Kent Dickey
This program 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.
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
GSPLUS - Advanced Apple IIGS Emulator Environment
Based on the KEGS emulator written by Kent Dickey
See COPYRIGHT.txt for Copyright information
See LICENSE.txt for license (GPL v2)
*/
#include "defc.h"

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