From b82c0b10ffbfda1aa2f980a66e8e432e7114beea Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Thu, 6 Aug 2020 14:59:38 -0500 Subject: [PATCH] Upgraded Tool221 to Tool222. --- joeylib/build.sh | 12 ++++------ joeylib/src/jIIgs.c | 46 +++++++++++++++++++----------------- joeylib/src/test.c | 21 +++++++++++++--- scripts/build-IIgs.helper.sh | 6 ++++- scripts/installer.sh | 27 +++++++++++---------- 5 files changed, 66 insertions(+), 46 deletions(-) diff --git a/joeylib/build.sh b/joeylib/build.sh index f8b87ab..fd8ba59 100755 --- a/joeylib/build.sh +++ b/joeylib/build.sh @@ -86,11 +86,11 @@ function doIIgsBuild() { iix dumpobj +D 31:/out/joey/test &> test.dis || true - php "${JOEY}/sdks/IIgs/ntconverter/ntconverter.php" *.mod + php "${JOEY}/sdks/IIgs/ntpconverter/ntpconverter.php" *.mod popd cp -f "${OUT}/joeylib" "${DIST}/joeylib#b20000" - cp -f "${JOEY}/sdks/IIgs/Tool221#ba0000" "${JOEY}/dist/IIgs/." + cp -f "${JOEY}/sdks/IIgs/Tool222#ba0000" "${JOEY}/dist/IIgs/." cp -f "${JOEY}/joeylib/scripts/build-IIgs.helper.sh" "${JOEY}/dist/." if [[ ! -z ${RUNTEST} ]]; then @@ -102,18 +102,16 @@ function doIIgsBuild() { cp "${JOEY}/joeylib/joeylib/src/kanga.img" "${OUT}/kanga.img#060000" cp "${JOEY}/joeylib/joeylib/src/font.img" "${OUT}/font.img#060000" cp "${JOEY}/joeylib/joeylib/src/font.stn" "${OUT}/font.stn#060000" - cp "${JOEY}/joeylib/joeylib/src/music" "${OUT}/music#D50000" - cp "${JOEY}/joeylib/joeylib/src/music.w" "${OUT}/music.w#060000" + cp "${JOEY}/joeylib/joeylib/src/music.ntp" "${OUT}/music.ntp#D50008" "${CADIUS}" createvolume "${IMPORT}" ${VOL} 32MB > /dev/null "${CADIUS}" createfolder "${IMPORT}" ${VOL}/data > /dev/null - "${CADIUS}" addfile "${IMPORT}" ${VOL} "${JOEY}/dist/IIgs/Tool221#ba0000" > /dev/null + "${CADIUS}" addfile "${IMPORT}" ${VOL} "${JOEY}/dist/IIgs/Tool222#ba0000" > /dev/null "${CADIUS}" addfile "${IMPORT}" ${VOL} "${OUT}/Test#b3db03" > /dev/null "${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/kanga.img#060000" > /dev/null "${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/font.img#060000" > /dev/null "${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/font.stn#060000" > /dev/null - "${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/music#D50000" > /dev/null - "${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/music.w#060000" > /dev/null + "${CADIUS}" addfile "${IMPORT}" ${VOL}/data "${OUT}/music.ntp#D50008" > /dev/null pushd "${JOEY}/sdks/IIgs/gsplus" ./GSplus -resizeable -config IIgsTest.cfg || true diff --git a/joeylib/src/jIIgs.c b/joeylib/src/jIIgs.c index 660b950..c840d8c 100644 --- a/joeylib/src/jIIgs.c +++ b/joeylib/src/jIIgs.c @@ -58,13 +58,13 @@ extern void asmStart(jint16 myID, jint16 hertzBy10); extern void asmStop(void); -extern pascal void NTStartUp(Word) inline(0x02DD, dispatcher); -extern pascal void NTShutDown(void) inline(0x03DD, dispatcher); -extern pascal void NTLoadOneMusic(Pointer) inline(0x09DD, dispatcher); -extern pascal void NTPlayMusic(Word) inline(0x0ADD, dispatcher); -extern pascal Word NTGetPlayingMusic(void) inline(0x10DD, dispatcher); -extern pascal void NTPauseMusic(void) inline(0x13DD, dispatcher); -extern pascal void NTContinueMusic(void) inline(0x14DD, dispatcher); +extern pascal void NTPStartUp(Word) inline(0x02DE, dispatcher); +extern pascal void NTPShutDown(void) inline(0x03DE, dispatcher); +extern pascal void NTPLoadOneMusic(Pointer) inline(0x09DE, dispatcher); +extern pascal void NTPPlayMusic(Word) inline(0x0ADE, dispatcher); +extern pascal Word NTPGetPlayingMusic(void) inline(0x10DE, dispatcher); +extern pascal void NTPPauseMusic(void) inline(0x13DE, dispatcher); +extern pascal void NTPContinueMusic(void) inline(0x14DE, dispatcher); char _jlKeyCheck(char key); @@ -261,37 +261,37 @@ bool _jlSoundLoad(jlSoundT **sound, char *filename) { void jlSoundMusicContinue(void) { - NTContinueMusic(); + NTPContinueMusic(); } bool jlSoundMusicIsPlaying(void) { - return (NTGetPlayingMusic() != 0xFFFF); + return (NTPGetPlayingMusic() != 0xFFFF); } void jlSoundMusicPause(void) { - NTPauseMusic(); + NTPPauseMusic(); } void jlSoundMusicPlay(char *name) { - char *temp = jlUtilMakePathname(name, NULL); + char *temp = jlUtilMakePathname(name, "ntp"); _jlPascalStringT file; strcpy(file.text, temp); file.length = strlen(temp); - NTStartUp(_jlMusicMemID); - JOEY_CHECK_TOOL_ERROR("NTStartup") - NTLoadOneMusic((Pointer)&file); - JOEY_CHECK_TOOL_ERROR("NTLoadOneMusic") - NTPlayMusic(false); - JOEY_CHECK_TOOL_ERROR("NTPlayMusic") + NTPStartUp(_jlMusicMemID); + JOEY_CHECK_TOOL_ERROR("NTPStartup") + NTPLoadOneMusic((Pointer)&file); + JOEY_CHECK_TOOL_ERROR("NTPLoadOneMusic") + NTPPlayMusic(false); + JOEY_CHECK_TOOL_ERROR("NTPPlayMusic") } void jlSoundMusicStop(void) { - NTShutDown(); - JOEY_CHECK_TOOL_ERROR("NTShutDown") + NTPShutDown(); + JOEY_CHECK_TOOL_ERROR("NTPShutDown") } @@ -349,13 +349,15 @@ void jlUtilStartup(char *appTitle) { _jlMyID = MMStartUp(); // Memory Manager _jlMemID = _jlMyID | 0x0100; // Set aux ID to 1. _jlMusicMemID = _jlMyID | 0x0200; // Set music ID. + MTStartUp(); // Misc Tools + /* ZeroPageHandle = NewHandle((Long)DPTotal, (Word)_jlMyID, (Word)attrBank | attrPage | attrFixed | attrLocked, (Long)0); ZeroPagePtr = *ZeroPageHandle; - MTStartUp(); // Misc Tools SoundStartUp((word)ZeroPagePtr + DPForSound); // Sound Tool Set MSStartUp(); // MIDI Synth - //LoadOneTool(0xDD, 0); // NinjaTracker - //JOEY_CHECK_TOOL_ERROR("LoadOneTool") + */ + LoadOneTool(0xDE, 0); // NinjaTrackerPlus + JOEY_CHECK_TOOL_ERROR("LoadOneTool") // Reserve shadow area for SHR _jlSHRShadowHandle = NewHandle((LongWord)0x8000, (Word)_jlMemID, (Word)(attrLocked + attrFixed + attrBank + attrAddr), (Pointer)0x012000); diff --git a/joeylib/src/test.c b/joeylib/src/test.c index 0f0eb40..d9b2e3a 100644 --- a/joeylib/src/test.c +++ b/joeylib/src/test.c @@ -275,13 +275,27 @@ void lineTest(void) { } jlKeyRead(); - jlSoundMusicStop(); - jlImgFree(font); jlImgFree(kanga); } +void musicTest(void) { + jlImgT *kanga = NULL; + + if (!jlImgLoad(kanga, "kanga")) jlUtilDie("Unable to load kanga.img!"); + + jlImgDisplay(kanga); + jlDisplayPresent(); + + jlSoundMusicPlay("music"); + + jlKeyWaitForAny(); + + jlSoundMusicStop(); +} + + void showStencil(void) { jlStnT *stencil = NULL; jint16 y; @@ -340,10 +354,11 @@ void showStencil(void) { int main(void) { jlUtilStartup("JoeyLib Test"); - blitTest(); + //blitTest(); //exerciseAPI(); //grid(); //lineTest(); + musicTest(); //showStencil(); jlUtilShutdown(); diff --git a/scripts/build-IIgs.helper.sh b/scripts/build-IIgs.helper.sh index df9fb4f..d54a880 100644 --- a/scripts/build-IIgs.helper.sh +++ b/scripts/build-IIgs.helper.sh @@ -19,6 +19,10 @@ function buildIIgs() { fi mkdir -p ${WORK} + #***TODO*** Add image and music conversion. + # Automatically copy converted images, stencils, and audio so they + # no longer need to be specified in the build script. + # We temporarily need a local copy of the joey header cp -f ${JOEY}/dist/joey.h . @@ -58,7 +62,7 @@ function buildIIgs() { ${CADIUS} createvolume ${IMPORT} ${VOL} 32MB > /dev/null ${CADIUS} createfolder ${IMPORT} ${VOL}/data > /dev/null ${CADIUS} addfile ${IMPORT} ${VOL} ${TARGET}/${PROJECT}#b3db03 > /dev/null - ${CADIUS} addfile ${IMPORT} ${VOL} ${JOEY}/dist/IIgs/Tool221#ba0000 > /dev/null + ${CADIUS} addfile ${IMPORT} ${VOL} ${JOEY}/dist/IIgs/Tool222#ba0000 > /dev/null for F in "${DATA[@]}"; do N=${WORK}/data/`basename ${F}`#060000 cp -f ${F} ${N} diff --git a/scripts/installer.sh b/scripts/installer.sh index dbb6716..1e7295f 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -606,23 +606,24 @@ function installIIgs() { popd &> /dev/null fi - if [[ ! -e "${IIGS}/ntconverter/ntconverter.php" ]]; then - purple "Installing NinjaTracker Converter" - download https://www.ninjaforce.com/downloads/ntconverter.zip - unzip ntconverter.zip - mkdir -p "${IIGS}/ntconverter" - cp -f ntconverter.php "${IIGS}/ntconverter/." + if [[ ! -e "${IIGS}/ntpconverter/ntpconverter.php" ]]; then + purple "Installing NinjaTrackerPlus Converter" + download http://www.ninjaforce.com/downloads/ntpsources.zip + unzip ntpsources.zip + mkdir -p "${IIGS}/ntpconverter" + cp -f ntpconverter.php "${IIGS}/ntpconverter/." + cp -f ntpconverter_lib.php "${IIGS}/ntpconverter/." + fi + + if [[ ! -e "${IIGS}/Tool222#ba0000" ]]; then + purple "Installing NinjaTrackerPlus Tool222" + download http://www.ninjaforce.com/downloads/ninjatrackerplus_tool222_v1.1.2mg + "${IIGS}/cadius/cadius" extractfile ninjatrackerplus_tool222_v1.1.2mg NTP.TOOL222V1.1/SYSTEM/TOOLS/TOOL222 . + cp -f Tool222#BA0000 "${IIGS}/Tool222#ba0000" fi mkdir -p "${JOEY}/dist/IIgs" - if [[ ! -e "${IIGS}/Tool221#ba0000" ]]; then - purple "Installing Tool221" - download https://www.brutaldeluxe.fr/products/apple2gs/tool221/ninjatracker_tool221_v2.1.2mg - "${IIGS}/cadius/cadius" extractfile ninjatracker_tool221_v2.1.2mg NT.TOOL221.V2.1/SYSTEM/TOOLS/TOOL221 . - cp -f TOOL221#BA0000 "${IIGS}/Tool221#ba0000" - fi - purple "Building JoeyLib" "${G_PARENT}/joeylib/joeylib/build.sh" iigs &> /dev/null