Skip to content

fourks/sc68-2.2.1

 
 

Repository files navigation

webAudio 68 (Web version of sc68 - see live demo: http://www.wothke.ch/webaudio68/)
===========

	Copyright (C) 2014 Juergen Wothke

	This program (i.e web extensions of sc68) 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 3 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, see <http://www.gnu.org/licenses/>.


	Original C code of "sc68" (see http://sc68.atari.org/).

	Copyright (C) Benjamin Gerard (original licensing applies)


This project is based on sc68 version 2.2.1: Everything that's not needed for the command line tool 
"sc68" has been thrown out. All resource/file-access has been disabled/replaced. The sources 
have then been amended to allow JavaScript translation using emscripten (a new file adapter.c
contains the APIs used to interface with the JavaScript player).

The kind support of Benjamin Gerard enabled me to also include two features from the most recent 
sc68 development branch:

1) added "replays" originally not available in version 2.2.1
2) new file loading/detection logic for improved SNDH file handling

The structure of the original sc68 project has been preserved. (This might ease the task to eventually 
migrate the project to some future sc68 version. All changes have been done using #ifdefs, i.e you can
also search for "EMSCRIPTEN" to find the changes.) 


How to build:

You'll need emscripten to build the web version (I used the win installer: emsdk-1.13.0-full-32bit.exe 
which (at the time) could be found here: http://kripken.github.io/emscripten-site/docs/getting_started/downloads.html)
I did not need to perform ANY manual changes on the installation. The below instructions assume that the 
sc68-2.2.1 project folder has been moved into the main emscripten folder (maybe not necessary) and 
that a command prompt has been opened within the "sc68-2.2.1/emscripten" folder and that the Emscripten 
environment vars have been set (i.e. emsdk_env.bat has been called).


The project can be built in 2 flavours:

1) Running the makeEmscriptenInline.bat in this folder will generate a standalone JavaScript version of the 
Emscripten generated part of 'webaudio 68': sc68-web.js (i.e. the "replay" binaries are all inlined - which makes 
the file somewhat large). Ìn addition to the larger size this version has the disadvantage that it contains 
only the fixed set of "replays" available in the original sc68-2.2.1 distribution. I'd therefore recommend 
to always use the below flavour instead:

2) Running the makeEmscripten.bat in the project folder will generate a somewhat leaner library - which will 
load "replay" binary files on demand. At runtime this version depends on a "replay" folder containing the respective 
binaries (see "htdocs" sub-folder for example). This allows to add new "replays" without recompiling the library 
(you must make sure though that the "replays" have been compiled for an absolute load-address of $8000 - different
versions of sc68 are using different defaults here..)

Both build scripts will create a sc68-web.js library directly within the htdos/ example folder. (The content 
of the respective folder can be deployed in some arbitrary folder under the document root of your web server 
for testing.)