Skip to content

Commit

Permalink
Build script and don't auto load manic
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Greening committed Dec 9, 2024
1 parent 3a74789 commit 391fb70
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
30 changes: 30 additions & 0 deletions desktop/build_emscripten.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Exit on error
set -e

echo "Setting up Emscripten..."

# Clone emsdk if it doesn't exist
if [ ! -d "emsdk" ]; then
git clone https://github.com/emscripten-core/emsdk.git
fi

# Navigate to emsdk directory
cd emsdk

# Update emsdk to latest version
git pull

# Install latest SDK tools
./emsdk install latest

# Activate the latest SDK
./emsdk activate latest

# Add environment variables to current shell
source ./emsdk_env.sh

cd ..

make -f Makefile.ems
6 changes: 2 additions & 4 deletions desktop/src/main.mm
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ int main()
return -1;
}

#ifndef __EMSCRIPTEN__
// run the spectrum for 4 second so that it boots up
int start = SDL_GetTicks();

Expand All @@ -304,14 +305,11 @@ int main()
int end = SDL_GetTicks();
std::cout << "Time to boot spectrum: " << end - start << "ms" << std::endl;
// load a tap file
#if __EMSCRIPTEN__
std::string filename = "filesystem/manic.z80";
#else
std::string filename = OpenFileDialog();
#endif
isLoading = true;
loadGame(filename, machine);
isLoading = false;
#endif
audioOutput = new SDLAudioOutput(machine);
audioOutput->start(15600);
isRunning = true;
Expand Down

0 comments on commit 391fb70

Please sign in to comment.