From d15480ef40a2ec4f38e370616019cbd04402ac33 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 4 Jan 2001 17:10:13 +0000 Subject: [PATCH] --- source/frontend/credits.cpp | 75 ++++++++++++++++++++++++++++++++++++- source/sound/sound.cpp | 2 +- source/sound/xmplay.cpp | 2 +- 3 files changed, 76 insertions(+), 3 deletions(-) diff --git a/source/frontend/credits.cpp b/source/frontend/credits.cpp index 094f8c836..73e15acc1 100644 --- a/source/frontend/credits.cpp +++ b/source/frontend/credits.cpp @@ -1,3 +1,9 @@ +// PKG +// Temporay home of memcard stuff +// Controls: +// UP Save file ( this writes the save file to the memcard, must be done first time ) +// DOWN Overwrite saved file +// LEFT Load saved file /*========================================================================= credits.cpp @@ -76,6 +82,11 @@ Params: Returns: ---------------------------------------------------------------------- */ +#include "memcard\memcard.h" +#include "memcard\saveload.h" +SaveLoadDatabase *sl; +enum{mode_none,mode_save,mode_load}; +int mode=mode_none; void CFrontEndCredits::init() { } @@ -99,6 +110,9 @@ void CFrontEndCredits::shutdown() static u8 *s_image; void CFrontEndCredits::select() { +MemCard::Start(); +sl=new ("sldb") SaveLoadDatabase(); +mode=mode_none; m_shuttingDown=false; s_image=CFileIO::loadFile(BACKDROP_CREDITS_GFX); ASSERT(s_image); @@ -114,6 +128,8 @@ void CFrontEndCredits::select() ---------------------------------------------------------------------- */ void CFrontEndCredits::unselect() { +MemCard::Stop(); +delete sl; ClearScreenImage(); MemFree(s_image); s_image=NULL; } @@ -136,7 +152,64 @@ void CFrontEndCredits::render() ---------------------------------------------------------------------- */ void CFrontEndCredits::think(int _frames) { - if(!m_shuttingDown) +sl->think(); +if(mode==mode_none) +{ + int pad=PadGetDown(0); + if(pad&PAD_UP) + { + PAUL_DBGMSG("startSave(\"blah\")"); + sl->startSave("blah"); + mode=mode_save; + } + else if(pad&PAD_DOWN) + { + PAUL_DBGMSG("startSave(\"blah\",0)"); + sl->startSave("blah",0); + mode=mode_save; + } + else if(pad&PAD_LEFT) + { + PAUL_DBGMSG("startLoad(0)"); + sl->startLoad(0); + mode=mode_load; + } +} +else if(mode==mode_save) +{ + int status=sl->getSaveStatus(); + if(status!=SaveLoadDatabase::IN_PROGRESS) + { + if(status==SaveLoadDatabase::FINISHED_OK) + { + MEMCARD_DBGMSG("saved ok"); + } + else + { + MEMCARD_DBGMSG("not saved ok"); + } + mode=mode_none; + } +} +else if(mode==mode_load) +{ + int status=sl->getLoadStatus(); + if(status!=SaveLoadDatabase::IN_PROGRESS) + { + if(status==SaveLoadDatabase::FINISHED_OK) + { + MEMCARD_DBGMSG("loaded ok"); + } + else + { + MEMCARD_DBGMSG("not loaded ok"); + } + mode=mode_none; + } +} + +if(mode==mode_none) + if(!m_shuttingDown&&!CFader::isFading()) { if(PadGetDown(0)&(PAD_CROSS|PAD_START)) { diff --git a/source/sound/sound.cpp b/source/sound/sound.cpp index aafb1643f..3a10b3d95 100644 --- a/source/sound/sound.cpp +++ b/source/sound/sound.cpp @@ -220,13 +220,13 @@ if(_frames==0)_frames=1; CXAStream::ControlXA(); s_xmplaySound->think(); - // Push through any changes in volume if(s_volumeDirty[VOL_FADE]) { s_volumeDirty[VOL_SONG]=true; s_volumeDirty[VOL_SFX]=true; s_volumeDirty[VOL_SPEECH]=true; + s_volumeDirty[VOL_FADE]=false; } if(s_volumeDirty[VOL_SONG]) { diff --git a/source/sound/xmplay.cpp b/source/sound/xmplay.cpp index 519ceddd2..63616add1 100644 --- a/source/sound/xmplay.cpp +++ b/source/sound/xmplay.cpp @@ -361,7 +361,7 @@ xmModId CXMPlaySound::loadModData(FileEquate _modFe) if(mod->m_refCount==0) { mod->m_xmData=(u8*)CFileIO::loadFile(_modFe); - InitXMData(mod->m_xmData,modId,0);//XM_UseS3MPanning); + InitXMData(mod->m_xmData,modId,XM_UseXMPanning); mod->m_file=_modFe; mod->m_refCount=1; break;