jumpwise optimalisations
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2155
This commit is contained in:
parent
22cb26c298
commit
5a3f4fb38d
2 changed files with 20 additions and 15 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: callback.cpp,v 1.25 2005-03-25 08:40:42 qbix79 Exp $ */
|
||||
/* $Id: callback.cpp,v 1.26 2005-03-25 10:12:04 qbix79 Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -220,18 +220,20 @@ CALLBACK_HandlerObject::~CALLBACK_HandlerObject(){
|
|||
}
|
||||
|
||||
void CALLBACK_HandlerObject::Install(CallBack_Handler handler,Bitu type,const char* description){
|
||||
if(installed) E_Exit("Allready installed");
|
||||
m_type=SETUP;
|
||||
m_callback=CALLBACK_Allocate();
|
||||
CALLBACK_Setup(m_callback,handler,type,description);
|
||||
installed=true;
|
||||
if(!installed) {
|
||||
installed=true;
|
||||
m_type=SETUP;
|
||||
m_callback=CALLBACK_Allocate();
|
||||
CALLBACK_Setup(m_callback,handler,type,description);
|
||||
} else E_Exit("Allready installed");
|
||||
}
|
||||
|
||||
void CALLBACK_HandlerObject::Set_RealVec(Bit8u vec){
|
||||
if(vectorhandler.installed) E_Exit ("double usage of vector handler");
|
||||
vectorhandler.installed=true;
|
||||
vectorhandler.interrupt=vec;
|
||||
RealSetVec(vec,Get_RealPointer(),vectorhandler.old_vector);
|
||||
if(!vectorhandler.installed) {
|
||||
vectorhandler.installed=true;
|
||||
vectorhandler.interrupt=vec;
|
||||
RealSetVec(vec,Get_RealPointer(),vectorhandler.old_vector);
|
||||
} else E_Exit ("double usage of vector handler");
|
||||
}
|
||||
|
||||
void CALLBACK_Init(Section* sec) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: mixer.cpp,v 1.30 2005-03-25 09:38:42 qbix79 Exp $ */
|
||||
/* $Id: mixer.cpp,v 1.31 2005-03-25 10:12:05 qbix79 Exp $ */
|
||||
|
||||
/*
|
||||
Remove the sdl code from here and have it handeld in the sdlmain.
|
||||
|
@ -487,11 +487,14 @@ static void MIXER_ProgramStart(Program * * make) {
|
|||
}
|
||||
|
||||
MixerChannel* MixerObject::Install(MIXER_Handler handler,Bitu freq,char * name){
|
||||
if(strlen(name)>31) E_Exit("Too long mixer channel name");
|
||||
strncpy(m_name,name,31);
|
||||
installed=true;
|
||||
return MIXER_AddChannel(handler,freq,name);
|
||||
if(!installed) {
|
||||
if(strlen(name)>31) E_Exit("Too long mixer channel name");
|
||||
strncpy(m_name,name,31);
|
||||
installed=true;
|
||||
return MIXER_AddChannel(handler,freq,name);
|
||||
} else E_Exit("allready added mixer channel.");
|
||||
}
|
||||
|
||||
MixerObject::~MixerObject(){
|
||||
if(!installed) return;
|
||||
MIXER_DelChannel(MIXER_FindChannel(m_name));
|
||||
|
|
Loading…
Add table
Reference in a new issue