From a6004882ddb35fadb22726b2203e5b4d43d15f4e Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Sun, 9 Aug 2020 20:19:07 -0500 Subject: [PATCH] Minor fixes. Also toying with dmalloc. --- joeylib/joeylib.pro | 9 +++++++++ joeylib/src/jIIgs.c | 6 ++++++ joeylib/src/jSDL2.c | 10 +++++++++- joeylib/src/joey.c | 6 ++++++ joeylib/src/test.c | 6 ++++++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/joeylib/joeylib.pro b/joeylib/joeylib.pro index a79274a..b486098 100644 --- a/joeylib/joeylib.pro +++ b/joeylib/joeylib.pro @@ -1,6 +1,7 @@ JOEY = /home/scott/joey #CONFIG += SDL12 CONFIG += SDL2 +#CONFIG += dmalloc TEMPLATE = app @@ -62,3 +63,11 @@ OTHER_FILES += \ src/jIIgs.asm \ src/jIIgs.macro \ joey.pri + +dmalloc { + DEFINES += DMALLOC + INCLUDEPATH += /opt/dmalloc/include + LIBS += \ + -L/opt/dmalloc/lib \ + -ldmallocth +} diff --git a/joeylib/src/jIIgs.c b/joeylib/src/jIIgs.c index d33ce78..87e9638 100644 --- a/joeylib/src/jIIgs.c +++ b/joeylib/src/jIIgs.c @@ -254,11 +254,13 @@ void jlSoundFree(jlSoundT *sound) { bool jlSoundIsPlaying(jlSoundT *sound) { //***TODO*** + return false; } bool _jlSoundLoad(jlSoundT **sound, char *filename) { //***TODO*** + return false; } @@ -356,9 +358,11 @@ void jlUtilShutdown(void) { // Shutdown tools NTPShutDown(); // NinjaTracker UnloadOneTool(222); + /* MSShutDown(); // MIDI Synth UnloadOneTool(35); SoundShutDown(); // Sound Tool Set + */ MTShutDown(); // Misc Tools DisposeAll(userid()); MMShutDown(userid()); // Memory Manager @@ -389,6 +393,7 @@ void jlUtilStartup(char *appTitle) { tempHandle = NewHandle((LongWord)0x8000, userid(), (Word)(attrLocked | attrFixed | attrAddr | attrBank), (Pointer)0x012000); JOEY_CHECK_TOOL_ERROR("NewHandle SHR") + /* // Sound Tool Set tempHandle = NewHandle((Long)DPTotal, userid(), (Word)(attrLocked | attrFixed | attrPage | attrBank), (Long)0); JOEY_CHECK_TOOL_ERROR("NewHandle Sound") @@ -409,6 +414,7 @@ void jlUtilStartup(char *appTitle) { } MSStartUp(); // MIDI Synth JOEY_CHECK_TOOL_ERROR("MSStartUp") + */ // Try to load NinjaTrackerPlus from SYSTEM:TOOLS LoadOneTool(222, 0); diff --git a/joeylib/src/jSDL2.c b/joeylib/src/jSDL2.c index aa8d74d..1d27551 100644 --- a/joeylib/src/jSDL2.c +++ b/joeylib/src/jSDL2.c @@ -29,6 +29,12 @@ #include "joey.h" +#ifdef DMALLOC +#define DMALLOC_FUNC_CHECK +#include "dmalloc.h" +#endif + + static SDL_Window *_jlWindow = NULL; static SDL_Renderer *_jlRenderer = NULL; static jlImgT *_jlBackingStore = NULL; // 4 bit representation @@ -686,7 +692,9 @@ void jlUtilShutdown(void) { _jlControllerCount = 0; jlFree(_jlControllers); jlImgFree(_jlBackingStore); - jlSoundMusicStop(); + //***TODO*** Sound effects stop? + jlSoundModStop(); + jlSoundMidiStop(); Mix_CloseAudio(); Mix_Quit(); SDL_FreeFormat(_jlPixelFormat); diff --git a/joeylib/src/joey.c b/joeylib/src/joey.c index d669f00..8a3e01d 100644 --- a/joeylib/src/joey.c +++ b/joeylib/src/joey.c @@ -37,6 +37,12 @@ segment "joeylib"; #endif +#ifdef DMALLOC +#define DMALLOC_FUNC_CHECK +#include "dmalloc.h" +#endif + + // Vector image file command bytes #define COMMAND_COLOR 1 // C #define COMMAND_CLEAR 2 // E diff --git a/joeylib/src/test.c b/joeylib/src/test.c index ece70c6..641505b 100644 --- a/joeylib/src/test.c +++ b/joeylib/src/test.c @@ -33,6 +33,12 @@ segment "testapp"; #endif +#ifdef DMALLOC +#define DMALLOC_FUNC_CHECK +#include "dmalloc.h" +#endif + + void help(jlSurfaceT source, jlStnT *stencil, jint16 sx, jint16 sy, jint16 tx, jint16 ty) { int mo; // Mask offset