From d5a480cafe96dd2fbde01a99842619834d09470b Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Mon, 15 Apr 2019 20:50:02 -0500 Subject: [PATCH] Burger Becky and Kelvin save the day! VBLs working properly! --- installer.sh | 62 ++++++++++++++++++++++++++++++++++++------- joeylib/src/jIIgs.asm | 17 ++++++------ 2 files changed, 60 insertions(+), 19 deletions(-) diff --git a/installer.sh b/installer.sh index a9cd5d5..867e561 100755 --- a/installer.sh +++ b/installer.sh @@ -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 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 libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libfreetype6-dev libpcap0.8-dev + sudo apt-get -y install php-cli } # --- INSTALL GOLDENGATE -installGG() { +installGoldenGate() { #git clone git@gitlab.com:GoldenGate/GoldenGate.git if [ ! -d GoldenGate ]; then echo "Unable to clone the GoldenGate repository!" @@ -87,7 +89,7 @@ installGG() { git submodule init git submodule update PREFIX=`pwd`/installed - mkdir build + mkdir -p build cd build #cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} .. | tee make.out #make | tee -a make.out @@ -110,22 +112,61 @@ updateOrca() { | tr -d \" \ | head -n 1` FILE=${URL##*/} - wget ${URL} + #wget ${URL} ${IIGS}/opus-extractor -v -s / ${FILE} ${IIGS}/ORCA } 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" mkfs.hfs -v IIgs "${IIGS}/hfsDrive.img" - IIGSDISK=$(sudo losetup --partscan --find --show "${IIGS}/hfsDrive.img") mkdir -p "${IIGS}/ORCA" - sudo mount ${IIGSDISK} "${IIGS}/ORCA" + ${IIGS}/mountORCA.sh sudo chown -R `id -ru`:`id -rg` "${IIGS}/ORCA" - isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORK.S - ${IIGS}/opus-extractor -v BYTEWORK.S ${IIGS}/ORCA + isoinfo -i "${ORCA}" -x /FOR_EMUL/BYTEWORK.S\;1 > BYTEWORKS + ${IIGS}/opus-extractor -v BYTEWORKS ${IIGS}/ORCA updateOrca ORCA-C - sudo umount "${IIGS}/ORCA" - sudo losetup -d ${IIGSDISK} + ${IIGS}/unmountORCA.sh +} + + +# --- 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}" #getPackages -installGG +installGoldenGate installOrca +installGsPlus popd diff --git a/joeylib/src/jIIgs.asm b/joeylib/src/jIIgs.asm index 09bd329..b5cc43b 100644 --- a/joeylib/src/jIIgs.asm +++ b/joeylib/src/jIIgs.asm @@ -884,7 +884,6 @@ StackPtr ds 2 ; Space for SP asmStart start jsubroutine (2:id,2:h) using ScanTable - using VblHdr using VblRate 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 lda h ; Store refresh rate / 10 in VblCount and VblRate - sta >VblCount sta >VblRate - lda #42 ; Reset timer + lda #0 ; Reset timer sta >VblTime ph4 #VblHdr ; Start VBL interrupt task ldx #$1203 ;_SetHeartBeat jsl $E10000 + ph2 #$0002 ; Turn on heart beat IRQs + ldx #$2303 ;_IntSource + jsl $E10000 + jreturn - jsl VblTask ; This is a dummy call to be sure there's a reference to VblTask when linking as a library. end ;---------------------------------------- @@ -928,20 +929,18 @@ asmStop start ;---------------------------------------- ; Increment time counter using VBLs every 1/10 second ;---------------------------------------- -VblHdr data +VblHdr start dc i4'0' ; Space for task pointer VblCount dc i2'1' ; How many VBLs between calls (1 only on initial call) dc i2'$A55A' ; Task signature - end - -VblTask start - using VblHdr using VblRate + long m,i lda >VblRate ; Reset hearbeat counter sta >VblCount lda >VblTime ; Increment timer inc a sta >VblTime + short m,i rtl end