diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge/cge_main.cpp | 2 | ||||
-rw-r--r-- | engines/cge/ems.cpp | 190 | ||||
-rw-r--r-- | engines/cge/general.cpp | 2 | ||||
-rw-r--r-- | engines/cge/general.h | 34 | ||||
-rw-r--r-- | engines/cge/module.mk | 1 | ||||
-rw-r--r-- | engines/cge/sound.cpp | 9 | ||||
-rw-r--r-- | engines/cge/sound.h | 1 | ||||
-rw-r--r-- | engines/cge/startup.h | 2 | ||||
-rw-r--r-- | engines/cge/wav.h | 11 |
9 files changed, 8 insertions, 244 deletions
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp index 352d2954dc..60500b2b0e 100644 --- a/engines/cge/cge_main.cpp +++ b/engines/cge/cge_main.cpp @@ -540,7 +540,7 @@ void CGEEngine::miniStep(int stp) { else { *_miniShp[0] = *_miniShpList[stp]; if (_fx._current) - &*(_fx._current->eAddr()); + &*(_fx._current->addr()); _miniCave->_flags._hide = false; } diff --git a/engines/cge/ems.cpp b/engines/cge/ems.cpp index 0364758a12..f545822a6b 100644 --- a/engines/cge/ems.cpp +++ b/engines/cge/ems.cpp @@ -28,194 +28,4 @@ #include "cge/general.h" namespace CGE { - - -enum EMM_FUN { - GET_STATUS = 0x40, GET_FRAME, GET_SIZE, OPEN_HANDLE, MAP_PAGE, - CLOSE_HANDLE, GET_VER, SAVE_CONTEXT, REST_CONTEXT, GET_PAGES = 0x4B, - GET_HANDLES, GET_INFO, CONTROL -}; - - -void *Emm::_frame = NULL; - - -Emm::Emm(long size): _han(-1), _top(0), _lim(0), _list(NULL) { - /* - if (Test()) - { - asm mov ah,GET_FRAME // get EMS frame segment - asm int EMS_INT // do it! - asm or ah,ah // see status - asm jnz xit // abort on error - Frame = (void _seg *) _BX; // save frame segment - - if (size == 0) - { - asm mov ah,GET_SIZE // get EMS memory size - asm int EMS_INT // do it! - asm or ah,ah // see status - asm jnz xit // abort on error - asm or bx,bx // test page count - asm jz xit // abort if no free pages - // number of available pages in BX is ready to use by OPEN - } - else _BX = (uint16) ((size + PAGE_MASK) >> 14); - asm mov ah,OPEN_HANDLE // open EMM handle - asm int EMS_INT // do it! - asm or ah,ah // see status - asm jnz xit // abort on error - Han = _DX; - Lim = _BX; - Lim <<= 14; - _DX = Han; - asm mov ah,SAVE_CONTEXT // save mapping context - asm int EMS_INT // do it! - } - xit: - */ - warning("STUB: EMM:EMM"); -} - - -Emm::~Emm() { - /* FIXME - Release(); - if (Han >= 0) - { - _DX = Han; - asm mov ah,REST_CONTEXT - asm int EMS_INT - asm mov ah,CLOSE_HANDLE - asm int EMS_INT - } - */ -} - - -bool Emm::test() { - /* - static char e[] = "EMMXXXX0"; - - asm mov ax,0x3D40 - asm mov dx,offset e - asm int 0x21 - asm jc fail - - asm push ax - asm mov bx,ax - asm mov ax,0x4407 - asm int 0x21 - - asm pop bx - asm push ax - asm mov ax,0x3E00 - asm int 0x21 - asm pop ax - - asm cmp al,0x00 - asm je fail - - success: - return TRUE; - fail: - return FALSE; - */ - warning("EMM::Test"); - return false; -} - - -Ems *Emm::alloc(uint16 siz) { - /* - long size = SIZ(siz), - top = Top; - - uint16 pgn = (uint16) (top >> 14), - cnt = (uint16) ((top + size + PAGE_MASK) >> 14) - pgn; - - if (cnt > 4) - { - top = (top + PAGE_MASK) & 0xFFFFC000L; - pgn++; - cnt--; - } - - if (size <= Lim - top) - { - EMS * e = new EMS, * f; - - if (e) - { - Top = (e->Ptr = top) + (e->Siz = siz); - e->Emm = this; - - if (List) - { - for (f = List; f->Nxt; f = f->Nxt); - return (f->Nxt = e); // existing list: link to the end - } - else - { - return (List = e); // empty list: link to the head - } - } - } - fail: return NULL; - */ - warning("STUB: Emm::alloc"); - return NULL; -} - - -void Emm::release() { - while (_list) { - Ems *e = _list; - _list = e->_next; - delete e; - } - _top = 0; -} - - -Ems::Ems() : _ptr(0), _size(0), _next(NULL) { -} - - -void *Ems::operator & () const { - /* - uint16 pgn = (uint16) (Ptr >> 14), - off = (uint16) Ptr & PAGE_MASK, - cnt = (uint16) ((Ptr + SIZ(Siz) + PAGE_MASK) >> 14) - pgn, - cmd = MAP_PAGE << 8; - - _DX = Emm->_han; // take EMM handle - asm dec cnt // prapare for deferred checking - asm or dx,dx // see if valid - asm jns more // negative handle = unavailable - - fail: return NULL; - - more: - asm mov ax,cmd // command + page frame index - asm mov bx,pgn // logical page number - asm int EMS_INT // do it! - asm or ah,ah // check error code - asm jnz fail // exit on error - asm inc cmd // advance page frame index - asm inc pgn // advance logical page number - asm cmp al,byte ptr cnt // all pages? - asm jb more - - return (void *) (EMM::Frame + (void *) off); - */ - warning("STUB: Ems::operator &"); - return NULL; -} - - -uint16 Ems::size() { - return _size; -} - } // End of namespace CGE diff --git a/engines/cge/general.cpp b/engines/cge/general.cpp index 46df263b93..101c6cdd17 100644 --- a/engines/cge/general.cpp +++ b/engines/cge/general.cpp @@ -298,7 +298,7 @@ void sndMidiStop() { // FIXME: STUB: sndMIDIStop } -DataCk *loadWave(XFile *file, Emm *emm) { +DataCk *loadWave(XFile *file) { warning("STUB: LoadWave"); return NULL; } diff --git a/engines/cge/general.h b/engines/cge/general.h index 63d43c4403..e340c962bd 100644 --- a/engines/cge/general.h +++ b/engines/cge/general.h @@ -58,40 +58,6 @@ public: ~Engine_(); }; - -class Ems; - - -class Emm { - friend class Ems; - bool test(); - - long _top; - long _lim; - Ems *_list; - int _han; - static void *_frame; -public: - Emm(long size); - ~Emm(); - Ems *alloc(uint16 siz); - void release(); -}; - - -class Ems { - friend class Emm; - Emm *_emm; - long _ptr; - uint16 _size; - Ems *_next; -public: - Ems(); - void *operator & () const; - uint16 size(); -}; - - template <class T> void swap(T &A, T &B) { T a = A; diff --git a/engines/cge/module.mk b/engines/cge/module.mk index 584ab5a1b6..c1112c7ec2 100644 --- a/engines/cge/module.mk +++ b/engines/cge/module.mk @@ -9,7 +9,6 @@ MODULE_OBJS := \ config.o \ console.o \ detection.o \ - ems.o \ events.o \ game.o \ general.o \ diff --git a/engines/cge/sound.cpp b/engines/cge/sound.cpp index a163949ddd..9bf0d59be0 100644 --- a/engines/cge/sound.cpp +++ b/engines/cge/sound.cpp @@ -65,7 +65,7 @@ void Sound::open() { void Sound::play(DataCk *wav, int pan, int cnt) { if (wav) { stop(); - _smpinf._saddr = (uint8 *) &*(wav->eAddr()); + _smpinf._saddr = (uint8 *) &*(wav->addr()); _smpinf._slen = (uint16)wav->size(); _smpinf._span = pan; _smpinf._sflag = cnt; @@ -79,7 +79,7 @@ void Sound::stop() { } -Fx::Fx(int size) : _emm(0L), _current(NULL) { +Fx::Fx(int size) : _current(NULL) { _cache = new Han[size]; for (_size = 0; _size < size; _size++) { _cache[_size]._ref = 0; @@ -103,7 +103,6 @@ void Fx::clear() { p->_wav = NULL; } } - _emm.release(); _current = NULL; } @@ -129,7 +128,7 @@ void Fx::preload(int ref0) { static char fname[] = "FX00000.WAV"; wtom(ref, fname + 2, 10, 5); INI_FILE file = INI_FILE(fname); - DataCk *wav = loadWave(&file, &_emm); + DataCk *wav = loadWave(&file); if (wav) { Han *p = &_cache[find(0)]; if (p >= cacheLim) @@ -146,7 +145,7 @@ DataCk *Fx::load(int idx, int ref) { wtom(ref, fname + 2, 10, 5); INI_FILE file = INI_FILE(fname); - DataCk *wav = loadWave(&file, &_emm); + DataCk *wav = loadWave(&file); if (wav) { Han *p = &_cache[idx]; p->_wav = wav; diff --git a/engines/cge/sound.h b/engines/cge/sound.h index 5e1af71307..3ca4deaecc 100644 --- a/engines/cge/sound.h +++ b/engines/cge/sound.h @@ -46,7 +46,6 @@ public: class Fx { - Emm _emm; struct Han { int _ref; DataCk *_wav; diff --git a/engines/cge/startup.h b/engines/cge/startup.h index 5479945104..4b1f8662f3 100644 --- a/engines/cge/startup.h +++ b/engines/cge/startup.h @@ -69,8 +69,6 @@ public: }; -extern Emm _miniEmm; - const char *usrPath(const char *nam); } // End of namespace CGE diff --git a/engines/cge/wav.h b/engines/cge/wav.h index c3e67f5f95..739e102959 100644 --- a/engines/cge/wav.h +++ b/engines/cge/wav.h @@ -117,21 +117,14 @@ public: class DataCk : public CkHea { bool _e; - union { - uint8 *_buf; - Ems *_eBuf; - }; + uint8 *_buf; public: DataCk(CkHea &hea); - DataCk(CkHea &hea, Emm *emm); DataCk(int first, int last); ~DataCk(); inline uint8 *addr() { return _buf; } - inline Ems *eAddr() { - return _eBuf; - } }; @@ -141,7 +134,7 @@ extern ChunkId _fmt; extern ChunkId _data; -DataCk *loadWave(XFile *file, Emm *emm = NULL); +DataCk *loadWave(XFile *file); } // End of namespace CGE |