Burger Becky and Kelvin save the day! VBLs working properly!

This commit is contained in:
Scott Duensing 2019-04-15 20:50:02 -05:00
parent 51ebd46b1f
commit d5a480cafe
2 changed files with 60 additions and 19 deletions

View file

@ -70,12 +70,14 @@ getPackages() {
sudo apt-get -y install gcc-multilib g++-multilib mingw-w64 gdb-mingw-w64 clang llvm-dev libxml2-dev sudo apt-get -y install gcc-multilib g++-multilib mingw-w64 gdb-mingw-w64 clang llvm-dev libxml2-dev
sudo apt-get -y install uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio sudo apt-get -y install uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio
sudo apt-get -y install libpulse-dev{,:i386} libasound-dev{,:i386} sudo apt-get -y install libpulse-dev{,:i386} libasound-dev{,:i386}
sudo apt-get -y install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev
sudo apt-get -y install php-cli
} }
# --- INSTALL GOLDENGATE # --- INSTALL GOLDENGATE
installGG() { installGoldenGate() {
#git clone git@gitlab.com:GoldenGate/GoldenGate.git #git clone git@gitlab.com:GoldenGate/GoldenGate.git
if [ ! -d GoldenGate ]; then if [ ! -d GoldenGate ]; then
echo "Unable to clone the GoldenGate repository!" echo "Unable to clone the GoldenGate repository!"
@ -87,7 +89,7 @@ installGG() {
git submodule init git submodule init
git submodule update git submodule update
PREFIX=`pwd`/installed PREFIX=`pwd`/installed
mkdir build mkdir -p build
cd build cd build
#cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} .. | tee make.out #cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} .. | tee make.out
#make | tee -a make.out #make | tee -a make.out
@ -110,22 +112,61 @@ updateOrca() {
| tr -d \" \ | tr -d \" \
| head -n 1` | head -n 1`
FILE=${URL##*/} FILE=${URL##*/}
wget ${URL} #wget ${URL}
${IIGS}/opus-extractor -v -s / ${FILE} ${IIGS}/ORCA ${IIGS}/opus-extractor -v -s / ${FILE} ${IIGS}/ORCA
} }
installOrca() { installOrca() {
O=${IIGS}/mountORCA.sh
echo "#!/bin/bash" > "${O}"
echo "IIX=${IIGS}" >> "${O}"
echo "fsck.hfsplus \${IIX}/hfsDrive.img" >> "${O}"
echo "IIGSDISK=\$(sudo losetup --partscan --find --show \${IIX}/hfsDrive.img)" >> "${O}"
echo "sudo mount \${IIGSDISK} \${IIX}/ORCA" >> "${O}"
echo "echo LOOP=\${IIGSDISK} > \${IIX}/lastMount.cfg" >> "${O}"
echo "echo MOUNT=\${IIX}/ORCA >> \${IIX}/lastMount.cfg" >> "${O}"
chmod +x ${O}
O=${IIGS}/unmountORCA.sh
echo "#!/bin/bash" > "${O}"
echo "IIX=${IIGS}" >> "${O}"
echo "source \${IIX}/lastMount.cfg" >> "${O}"
echo "sudo umount \${MOUNT}" >> "${O}"
echo "sudo losetup -d \${LOOP}" >> "${O}"
echo "sudo rm \${IIX}/lastMount.cfg" >> "${O}"
chmod +x ${O}
fallocate -l 32M "${IIGS}/hfsDrive.img" fallocate -l 32M "${IIGS}/hfsDrive.img"
mkfs.hfs -v IIgs "${IIGS}/hfsDrive.img" mkfs.hfs -v IIgs "${IIGS}/hfsDrive.img"
IIGSDISK=$(sudo losetup --partscan --find --show "${IIGS}/hfsDrive.img")
mkdir -p "${IIGS}/ORCA" mkdir -p "${IIGS}/ORCA"
sudo mount ${IIGSDISK} "${IIGS}/ORCA" ${IIGS}/mountORCA.sh
sudo chown -R `id -ru`:`id -rg` "${IIGS}/ORCA" sudo chown -R `id -ru`:`id -rg` "${IIGS}/ORCA"
isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORK.S isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORKS
${IIGS}/opus-extractor -v BYTEWORK.S ${IIGS}/ORCA ${IIGS}/opus-extractor -v BYTEWORKS ${IIGS}/ORCA
updateOrca ORCA-C updateOrca ORCA-C
sudo umount "${IIGS}/ORCA" ${IIGS}/unmountORCA.sh
sudo losetup -d ${IIGSDISK} }
# --- INSTALL GSPLUS
installGsPlus() {
#git clone https://github.com/digarok/gsplus.git
pushd gsplus/src
ln -sf vars_x86linux_sdl2 vars
#make
if [ ! -e gsplus ]; then
echo "Failed to build GSplus."
exit 1
fi
mkdir -p "${IIGS}/gsplus"
cp -f gsplus "${IIGS}/gsplus/."
popd
#wget http://www.whatisthe2gs.apple2.org.za/files/rom3.zip
unzip rom3.zip
mv -f APPLE2GS.ROM2 "${IIGS}/gsplus/ROM.03"
#wget http://www.whatisthe2gs.apple2.org.za/files/harddrive_image.zip
unzip harddrive_image.zip
mv -f "System 6 and Free Games.hdv" "${IIGS}/gsplus/System601.po"
echo "s7d1 = System601.po\n\ng_limit_speed = 0\n" > "${IIGS}/gsplus/config.txt"
} }
@ -139,7 +180,8 @@ IIGS=${INSTALL}/sdks/IIgs
mkdir -p "${IIGS}" mkdir -p "${IIGS}"
#getPackages #getPackages
installGG installGoldenGate
installOrca installOrca
installGsPlus
popd popd

View file

@ -884,7 +884,6 @@ StackPtr ds 2 ; Space for SP
asmStart start asmStart start
jsubroutine (2:id,2:h) jsubroutine (2:id,2:h)
using ScanTable using ScanTable
using VblHdr
using VblRate using VblRate
ldx #0 ; Load 0 into x register ldx #0 ; Load 0 into x register
@ -898,18 +897,20 @@ STL sta >ScanTable,x ; Store accumulator in ScanTable+x
bcc STL ; Repeat Scan Table Loop until we do all 200 lines bcc STL ; Repeat Scan Table Loop until we do all 200 lines
lda h ; Store refresh rate / 10 in VblCount and VblRate lda h ; Store refresh rate / 10 in VblCount and VblRate
sta >VblCount
sta >VblRate sta >VblRate
lda #42 ; Reset timer lda #0 ; Reset timer
sta >VblTime sta >VblTime
ph4 #VblHdr ; Start VBL interrupt task ph4 #VblHdr ; Start VBL interrupt task
ldx #$1203 ;_SetHeartBeat ldx #$1203 ;_SetHeartBeat
jsl $E10000 jsl $E10000
ph2 #$0002 ; Turn on heart beat IRQs
ldx #$2303 ;_IntSource
jsl $E10000
jreturn jreturn
jsl VblTask ; This is a dummy call to be sure there's a reference to VblTask when linking as a library.
end end
;---------------------------------------- ;----------------------------------------
@ -928,20 +929,18 @@ asmStop start
;---------------------------------------- ;----------------------------------------
; Increment time counter using VBLs every 1/10 second ; Increment time counter using VBLs every 1/10 second
;---------------------------------------- ;----------------------------------------
VblHdr data VblHdr start
dc i4'0' ; Space for task pointer dc i4'0' ; Space for task pointer
VblCount dc i2'1' ; How many VBLs between calls (1 only on initial call) VblCount dc i2'1' ; How many VBLs between calls (1 only on initial call)
dc i2'$A55A' ; Task signature dc i2'$A55A' ; Task signature
end
VblTask start
using VblHdr
using VblRate using VblRate
long m,i
lda >VblRate ; Reset hearbeat counter lda >VblRate ; Reset hearbeat counter
sta >VblCount sta >VblCount
lda >VblTime ; Increment timer lda >VblTime ; Increment timer
inc a inc a
sta >VblTime sta >VblTime
short m,i
rtl rtl
end end