diff options
author | Eugene Sandulenko | 2014-12-28 00:09:24 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-15 00:05:02 +0100 |
commit | fdb4f3edf8882f8c9907aae990c3d376e68cea18 (patch) | |
tree | 0190178caeb215079cd4fdfbdf961380d573cace | |
parent | c62479949805780d4545876a0785d68ea4c747ba (diff) | |
download | scummvm-rg350-fdb4f3edf8882f8c9907aae990c3d376e68cea18.tar.gz scummvm-rg350-fdb4f3edf8882f8c9907aae990c3d376e68cea18.tar.bz2 scummvm-rg350-fdb4f3edf8882f8c9907aae990c3d376e68cea18.zip |
LAB: Cleanup
-rw-r--r-- | engines/lab/interface.h | 5 | ||||
-rw-r--r-- | engines/lab/labmusic.cpp | 16 | ||||
-rw-r--r-- | engines/lab/labsets.cpp | 4 | ||||
-rw-r--r-- | engines/lab/map.cpp | 25 | ||||
-rw-r--r-- | engines/lab/parsetypes.h | 2 | ||||
-rw-r--r-- | engines/lab/readparse.cpp | 21 | ||||
-rw-r--r-- | engines/lab/stddefines.h | 7 | ||||
-rw-r--r-- | engines/lab/text.cpp | 12 | ||||
-rw-r--r-- | engines/lab/vga.cpp | 466 | ||||
-rw-r--r-- | engines/lab/vga.h | 2 |
10 files changed, 15 insertions, 545 deletions
diff --git a/engines/lab/interface.h b/engines/lab/interface.h index b077f3b59e..9b8c3fb8bf 100644 --- a/engines/lab/interface.h +++ b/engines/lab/interface.h @@ -45,9 +45,7 @@ struct IntuiMessage { struct Gadget { uint16 x, y, GadgetID; -#if !defined(DOSCODE) uint16 KeyEquiv; // if not zero, a key that activates gadget -#endif uint32 GadgetFlags; Image *Im, *ImAlt; Gadget *NextGadget; @@ -103,13 +101,10 @@ extern Common::KeyState _keyPressed; #define IEQUALIFIER_RBUTTON 0x2000 #define IEQUALIFIER_LEFTBUTTON 0x4000 -#if !defined(DOSCODE) -// these values come from the SDL virtual key table #define VKEY_UPARROW 273 #define VKEY_DNARROW 274 #define VKEY_RTARROW 275 #define VKEY_LTARROW 276 -#endif /*---------------------------------------------------------------------------*/ diff --git a/engines/lab/labmusic.cpp b/engines/lab/labmusic.cpp index ac7ba70d13..7e91521fd4 100644 --- a/engines/lab/labmusic.cpp +++ b/engines/lab/labmusic.cpp @@ -32,6 +32,7 @@ #include "lab/labfun.h" #include "lab/timing.h" #include "lab/mouse.h" +#include "lab/vga.h" namespace Lab { @@ -73,9 +74,8 @@ Music::Music() { void Music::updateMusic(void) { uint16 i; -#if !defined(DOSCODE) - //SDL_ProcessInput(0); -#endif + WSDL_ProcessInput(0); + updateMouse(); if (EffectPlaying) @@ -106,9 +106,6 @@ void Music::fillbuffer(uint16 unit) { warning("STUB: Music::fillbuffer"); uint32 Size = MUSICBUFSIZE; void *ptr = _musicBuffer[unit]; -#if defined(DOSCODE) - char *endptr; -#endif if (Size < _leftinfile) { _file->read(ptr, Size); @@ -116,14 +113,7 @@ void Music::fillbuffer(uint16 unit) { } else { _file->read(ptr, _leftinfile); -#if defined(DOSCODE) - endptr = ptr; - endptr += _leftinfile - 2; - - memset((void *)(((uint32) ptr) + _leftinfile), *endptr, Size - _leftinfile); -#else memset((char *)ptr + _leftinfile, 0, Size - _leftinfile); -#endif _file->seek(0); _leftinfile = _filelength; diff --git a/engines/lab/labsets.cpp b/engines/lab/labsets.cpp index eefbc79cb4..d68370bf88 100644 --- a/engines/lab/labsets.cpp +++ b/engines/lab/labsets.cpp @@ -69,15 +69,11 @@ bool LargeSet::readInitialConditions(const char *fileName) { return false; readBlock(&many, 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&many, 1); -#endif for (int counter = 0; counter < many; counter++) { readBlock(&set, 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&set, 1); -#endif inclElement(set); } } else diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index 5f2274651b..95c12bd5d7 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -50,10 +50,8 @@ extern uint16 Direction; extern bool IsHiRes; extern uint32 VGAScreenWidth, VGAScreenHeight; -#if !defined(DOSCODE) extern CloseDataPtr CPtr; extern uint16 RoomNum; -#endif /*****************************************************************************/ /* Converts an Amiga palette (up to 16 colors) to a VGA palette, then sets */ @@ -172,16 +170,12 @@ extern TextFont *MsgFont; uint16 *FadePalette; static uint16 MapGadX[3] = {101, 55, 8}, MapGadY[3] = {105, 105, 105}; -#if !defined(DOSCODE) + static Gadget downgadget = { 101, 105, 2, VKEY_DNARROW, 0L, NULL, NULL, NULL }, upgadget = { 55, 105, 1, VKEY_UPARROW, 0L, NULL, NULL, &downgadget }, - backgadget = { 8, 105, 0, 0, 0L, NULL, NULL, &upgadget }, -#else -static Gadget downgadget = { 101, 105, 2, 0L, NULL, NULL, NULL }, - upgadget = { 55, 105, 1, 0L, NULL, NULL, &downgadget }, - backgadget = { 8, 105, 0, 0L, NULL, NULL, &upgadget }, -#endif -*MapGadgetList = &backgadget; + backgadget = { 8, 105, 0, 0, 0L, NULL, NULL, &upgadget }; + +static Gadget *MapGadgetList = &backgadget; static uint16 AmigaMapPalette[] = { 0x0BA8, 0x0C11, 0x0A74, 0x0076, @@ -292,18 +286,13 @@ static bool loadMapData(void) { if (strcmp((char *)Temp, "MAP0") == 0) { readBlock(&MaxRooms, 2L, buffer); -#if !defined(DOSCODE) swapUShortPtr(&MaxRooms, 1); -#endif Maps = (MapData *)(*buffer); -#if !defined(DOSCODE) for (counter = 1; counter <= MaxRooms; counter++) { swapUShortPtr(&Maps[counter].x, 4); swapULongPtr(&Maps[counter].MapFlags, 1); } - -#endif } else return false; @@ -893,9 +882,7 @@ void processMap(uint16 CurRoom) { } } -#if !defined(DOSCODE) WSDL_UpdateScreen(); -#endif } } } @@ -934,9 +921,7 @@ void doMap(uint16 CurRoom) { drawMap(CurRoom, CurRoom, Maps[CurRoom].PageNumber, false, true); mouseShow(); attachGadgetList(MapGadgetList); -#if !defined(DOSCODE) WSDL_UpdateScreen(); -#endif processMap(CurRoom); attachGadgetList(NULL); fade(false, 0); @@ -947,9 +932,7 @@ void doMap(uint16 CurRoom) { mapCleanUp(); blackAllScreen(); mouseShow(); -#if !defined(DOSCODE) WSDL_UpdateScreen(); -#endif } } // End of namespace Lab diff --git a/engines/lab/parsetypes.h b/engines/lab/parsetypes.h index 5120c413f8..c40975007a 100644 --- a/engines/lab/parsetypes.h +++ b/engines/lab/parsetypes.h @@ -201,14 +201,12 @@ struct MapData { #pragma pack(pop) #endif -#if !defined(DOSCODE) typedef struct { uint16 RoomNum; uint16 Direction; } CrumbData; #define MAX_CRUMBS 128 -#endif } // End of namespace Lab diff --git a/engines/lab/readparse.cpp b/engines/lab/readparse.cpp index 075c1fdb99..5e4bf6208e 100644 --- a/engines/lab/readparse.cpp +++ b/engines/lab/readparse.cpp @@ -77,13 +77,9 @@ bool readRoomData(const char *fileName) { return false; readBlock(&ManyRooms, 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&ManyRooms, 1); -#endif readBlock(&HighestCondition, 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&HighestCondition, 1); -#endif if ((Rooms = (RoomData *)calloc(ManyRooms + 1, sizeof(RoomData)))) { for (Counter = 1; Counter <= ManyRooms; Counter++) { @@ -91,12 +87,11 @@ bool readRoomData(const char *fileName) { readBlock(&(Rooms[Counter].SouthDoor), 2L, file); readBlock(&(Rooms[Counter].EastDoor), 2L, file); readBlock(&(Rooms[Counter].WestDoor), 2L, file); -#if !defined(DOSCODE) + swapUShortPtr(&(Rooms[Counter].NorthDoor), 1); swapUShortPtr(&(Rooms[Counter].SouthDoor), 1); swapUShortPtr(&(Rooms[Counter].EastDoor), 1); swapUShortPtr(&(Rooms[Counter].WestDoor), 1); -#endif readBlock(&(Rooms[Counter].WipeType), 1L, file); } @@ -156,17 +151,14 @@ bool readInventory(const char *fileName) { return false; readBlock(&NumInv, 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&NumInv, 1); -#endif + UseMemory = true; if (rallocate((void **) &Inventory, (NumInv + 1) * sizeof(InventoryData))) { for (Counter = 1; Counter <= NumInv; Counter++) { readBlock(&(Inventory[Counter].Many), 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&(Inventory[Counter].Many), 1); -#endif if (!readString(&(Inventory[Counter].name), file)) { UseMemory = false; @@ -249,9 +241,7 @@ static int16 *readConditions(byte **file) { do { readBlock(&last, 2L, file); -#if !defined(DOSCODE) swapUShortPtr((uint16 *)&last, 1); -#endif if (Counter < 25) { list[Counter] = last; @@ -289,9 +279,7 @@ static bool readCloseUps(CloseDataPtr *CPtr, uint16 depth, byte **file) { (*CPtr)->depth = depth; readBlock(*CPtr, 10L, file); -#if !defined(DOSCODE) swapUShortPtr((uint16 *)*CPtr, 5); -#endif if (!readString(&((*CPtr)->GraphicName), file)) return false; @@ -366,9 +354,7 @@ static bool readAction(ActionPtr *APtr, byte **file) { if (c == 1) { if (rallocate((void **) APtr, sizeof(Action))) { readBlock(*APtr, 8L, file); -#if !defined(DOSCODE) swapShortPtr((int16 *)*APtr, 4); -#endif if ((*APtr)->ActionType == SHOWMESSAGES) { if (!rallocate((void **) &ptrarray, 4L * (*APtr)->Param1)) @@ -406,9 +392,8 @@ static bool readRule(RulePtr *RPtr, byte **file) { if (c == 1) { if (rallocate((void **) RPtr, sizeof(Rule))) { readBlock(*RPtr, 6L, file); -#if !defined(DOSCODE) swapShortPtr((int16 *)*RPtr, 3); -#endif + (*RPtr)->Condition = readConditions(file); if (!(*RPtr)->Condition) diff --git a/engines/lab/stddefines.h b/engines/lab/stddefines.h index a9d685bbdb..3729084618 100644 --- a/engines/lab/stddefines.h +++ b/engines/lab/stddefines.h @@ -45,7 +45,6 @@ namespace Lab { #define delay Lab_Delay #endif -#if !defined(DOSCODE) #if defined(USE_NOSWAP) #define swapUShort(value) (value) #define swapUShortPtr(ptr,count) (ptr) @@ -59,7 +58,7 @@ namespace Lab { #define swapULongPtr(ptr,count) (ptr) #define swapLong(value) (value) #define swapLongPtr(ptr,count) (ptr) -#elif defined(USE_SWAP) +#else uint16 swapUShort(uint16 value); uint16 *swapUShortPtr(uint16 *ptr, int count); int16 swapShort(int16 value); @@ -72,10 +71,6 @@ uint32 swapULong(uint32 value); uint32 *swapULongPtr(uint32 *ptr, int count); int32 swapLong(int32 value); int32 *swapLongPtr(int32 *ptr, int count); -#else -#error Please tell me about swapping bytes! -#endif - #endif } // End of namespace Lab diff --git a/engines/lab/text.cpp b/engines/lab/text.cpp index 92711acf5d..5c456c4523 100644 --- a/engines/lab/text.cpp +++ b/engines/lab/text.cpp @@ -53,14 +53,12 @@ bool openFontMem(const char *TextFontPath, struct TextFont *tf, byte *fontbuffer if (strcmp(header, "VGAF") == 0) { tf->DataLength = filesize - headersize; readBlock(&(tf->Height), 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&(tf->Height), 1); -#endif + readBlock(tf->Widths, 256L, file); readBlock(tf->Offsets, 256L * 2L, file); -#if !defined(DOSCODE) swapUShortPtr(tf->Offsets, 256); -#endif + skip(file, 4L); tf->data = fontbuffer; readBlock(tf->data, tf->DataLength, file); @@ -91,14 +89,12 @@ bool openFont(const char *TextFontPath, struct TextFont **tf) { if (strcmp(header, "VGAF") == 0) { (*tf)->DataLength = filesize - headersize; readBlock(&((*tf)->Height), 2L, file); -#if !defined(DOSCODE) swapUShortPtr(&((*tf)->Height), 1); -#endif + readBlock((*tf)->Widths, 256L, file); readBlock((*tf)->Offsets, 256L * 2L, file); -#if !defined(DOSCODE) swapUShortPtr((*tf)->Offsets, 256); -#endif + skip(file, 4L); if (((*tf)->data = (byte *)calloc((*tf)->DataLength, 1))) { diff --git a/engines/lab/vga.cpp b/engines/lab/vga.cpp index c850f5268d..d2fa002e16 100644 --- a/engines/lab/vga.cpp +++ b/engines/lab/vga.cpp @@ -92,8 +92,6 @@ bool createScreen(bool HiRes) { return true; } - - /*****************************************************************************/ /* Sets the current page on the VGA card. */ /*****************************************************************************/ @@ -102,8 +100,6 @@ void setPage(uint16 PageNum) { assert(PageNum == 0); } - - void VGAStorePage(void) { // does nothing in SDL } @@ -228,7 +224,6 @@ void WSDL_GetMousePos(int *x, int *y) { *y = g_MouseY; } - void waitTOF() { int untilOutOfRefresh = 1; @@ -349,7 +344,6 @@ void getMode(uint16 *Mode) { /* Draws an image to the screen. */ /*****************************************************************************/ void drawImage(Image *Im, uint16 x, uint16 y) { -#if !defined(DOSCODE) int sx, sy, dx, dy, w, h; sx = 0; @@ -389,83 +383,12 @@ void drawImage(Image *Im, uint16 x, uint16 y) { ungetVGABaseAddr(); } - -#else - uint32 RealOffset, - SegmentOffset, - LeftInSegment; - char *video, - *curline, - *imdata = Im->ImageData; - uint16 counterx, - countery = 0, - numwholelines, - numpartiallines, - curpage; - - while (countery < Im->Height) { - RealOffset = (VGAScreenWidth * (y + countery)) + x; - curpage = RealOffset / VGABytesPerPage; - SegmentOffset = RealOffset - (curpage * VGABytesPerPage); - LeftInSegment = VGABytesPerPage - SegmentOffset; - setPage(curpage); - video = (char *)(((int32)(VGABASEADDRESS)) + SegmentOffset); - - numwholelines = LeftInSegment / VGAScreenWidth; - numpartiallines = 0; - counterx = LeftInSegment - (numwholelines * VGAScreenWidth); - - if (counterx >= Im->Width) - numwholelines++; - else - numpartiallines = 1; - - while (numwholelines && (countery < Im->Height)) { - curline = video; - - for (counterx = 0; counterx < Im->Width; counterx++) { - *video = *imdata; - video++; - imdata++; - } - - video = curline; - video += VGAScreenWidth; - countery ++; - numwholelines --; - LeftInSegment -= VGAScreenWidth; - } - - if (numpartiallines && (countery < Im->Height)) { - countery ++; - curline = video; - - for (counterx = 0; counterx < Im->Width; counterx++) { - if (LeftInSegment == 0L) { - setPage(curpage + 1); - LeftInSegment = VGABytesPerPage; - video = (char *)(VGABASEADDRESS); - } - - *video = *imdata; - video++; - imdata++; - LeftInSegment--; - } - } - } - -#endif } - - - /*****************************************************************************/ /* Draws an image to the screen. */ /*****************************************************************************/ void drawMaskImage(Image *Im, uint16 x, uint16 y) { -#if !defined(DOSCODE) int sx, sy, dx, dy, w, h; sx = 0; @@ -515,87 +438,12 @@ void drawMaskImage(Image *Im, uint16 x, uint16 y) { ungetVGABaseAddr(); } - -#else - uint32 RealOffset, - SegmentOffset, - LeftInSegment; - char *video, - *curline, - *imdata = Im->ImageData; - uint16 counterx, - countery = 0, - numwholelines, - numpartiallines, - curpage; - - while (countery < Im->Height) { - RealOffset = (VGAScreenWidth * (y + countery)) + x; - curpage = RealOffset / VGABytesPerPage; - SegmentOffset = RealOffset - (curpage * VGABytesPerPage); - LeftInSegment = VGABytesPerPage - SegmentOffset; - setPage(curpage); - video = (char *)(((int32)(VGABASEADDRESS)) + SegmentOffset); - - numwholelines = LeftInSegment / VGAScreenWidth; - numpartiallines = 0; - counterx = LeftInSegment - (numwholelines * VGAScreenWidth); - - if (counterx >= Im->Width) - numwholelines++; - else - numpartiallines = 1; - - while (numwholelines && (countery < Im->Height)) { - curline = video; - - for (counterx = 0; counterx < Im->Width; counterx++) { - if (*imdata) - *video = *imdata - 1; - - video++; - imdata++; - } - - video = curline; - video += VGAScreenWidth; - countery ++; - numwholelines --; - LeftInSegment -= VGAScreenWidth; - } - - if (numpartiallines && (countery < Im->Height)) { - countery ++; - curline = video; - - for (counterx = 0; counterx < Im->Width; counterx++) { - if (LeftInSegment == 0L) { - setPage(curpage + 1); - LeftInSegment = VGABytesPerPage; - video = (char *)(VGABASEADDRESS); - } - - if (*imdata) - *video = *imdata - 1; - - video++; - imdata++; - LeftInSegment--; - } - } - } - -#endif } - - - /*****************************************************************************/ /* Reads an image from the screen. */ /*****************************************************************************/ void readScreenImage(Image *Im, uint16 x, uint16 y) { -#if !defined(DOSCODE) int sx, sy, dx, dy, w, h; sx = 0; @@ -635,73 +483,6 @@ void readScreenImage(Image *Im, uint16 x, uint16 y) { ungetVGABaseAddr(); } - -#else - uint32 RealOffset, - SegmentOffset, - LeftInSegment; - char *video, - *curline, - *imdata = Im->ImageData; - uint16 counterx, - countery = 0, - numwholelines, - numpartiallines, - curpage; - - while (countery < Im->Height) { - RealOffset = (VGAScreenWidth * (y + countery)) + x; - curpage = RealOffset / VGABytesPerPage; - SegmentOffset = RealOffset - (curpage * VGABytesPerPage); - LeftInSegment = VGABytesPerPage - SegmentOffset; - setPage(curpage); - video = (char *)(((int32)(VGABASEADDRESS)) + SegmentOffset); - - numwholelines = LeftInSegment / VGAScreenWidth; - numpartiallines = 0; - counterx = LeftInSegment - (numwholelines * VGAScreenWidth); - - if (counterx >= Im->Width) - numwholelines++; - else - numpartiallines = 1; - - while (numwholelines && (countery < Im->Height)) { - curline = video; - - for (counterx = 0; counterx < Im->Width; counterx++) { - *imdata = *video; - video++; - imdata++; - } - - video = curline; - video += VGAScreenWidth; - countery ++; - numwholelines --; - LeftInSegment -= VGAScreenWidth; - } - - if (numpartiallines && (countery < Im->Height)) { - countery ++; - curline = video; - - for (counterx = 0; counterx < Im->Width; counterx++) { - if (LeftInSegment == 0L) { - setPage(curpage + 1); - LeftInSegment = VGABytesPerPage; - video = (char *)(VGABASEADDRESS); - } - - *imdata = *video; - video++; - imdata++; - LeftInSegment--; - } - } - } - -#endif } @@ -713,7 +494,6 @@ void readScreenImage(Image *Im, uint16 x, uint16 y) { /*****************************************************************************/ void bltBitMap(Image *ImSource, uint16 xs, uint16 ys, Image *ImDest, uint16 xd, uint16 yd, uint16 width, uint16 height) { -#if !defined(DOSCODE) // I think the old code assumed that the source image data was valid for the given box. // I will proceed on that assumption. int sx, sy, dx, dy, w, h; @@ -751,94 +531,10 @@ void bltBitMap(Image *ImSource, uint16 xs, uint16 ys, Image *ImDest, d += ImDest->Width; } } - -#else - uint32 RealOffset, - SegmentOffset, - LeftInSegment; - char *video, - *curdestline, - *cursourceline = ImSource->ImageData, - *imdata; - uint16 counterx, - countery = 0, - numwholelines, - numpartiallines, - curpage; - - cursourceline += (((int32) ys) * ImSource->Width) + xs; - imdata = cursourceline; - - while (countery < height) { - RealOffset = (ImDest->Width * (yd + countery)) + xd; - curpage = RealOffset / VGABytesPerPage; - SegmentOffset = RealOffset - (curpage * VGABytesPerPage); - LeftInSegment = VGABytesPerPage - SegmentOffset; - setPage(curpage); - - video = (char *)(((int32)(ImDest->ImageData)) + SegmentOffset); - - numwholelines = LeftInSegment / ImDest->Width; - numpartiallines = 0; - counterx = LeftInSegment - (numwholelines * ImDest->Width); - - if (counterx >= width) - numwholelines++; - else - numpartiallines = 1; - - while (numwholelines && (countery < height)) { - curdestline = video; - cursourceline = imdata; - - for (counterx = 0; counterx < width; counterx++) { - *video = *imdata; - video++; - imdata++; - } - - video = curdestline; - video += ImDest->Width; - imdata = cursourceline; - imdata += ImSource->Width; - - countery ++; - numwholelines --; - LeftInSegment -= ImDest->Width; - } - - if (numpartiallines && (countery < height)) { - countery ++; - curdestline = video; - cursourceline = imdata; - - for (counterx = 0; counterx < width; counterx++) { - if (LeftInSegment == 0L) { - setPage(curpage + 1); - LeftInSegment = VGABytesPerPage; - video = ImDest->ImageData; - } - - *video = *imdata; - video++; - imdata++; - LeftInSegment--; - } - - video = curdestline; - video += ImDest->Width; - imdata = cursourceline; - imdata += ImSource->Width; - } - } - -#endif } - byte *TempScrollData; - /*****************************************************************************/ /* Scrolls the display in the x direction by blitting. */ /* The TempScrollData variable must be initialized to some memory, or this */ @@ -883,10 +579,6 @@ void scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint16 y2) { } } - - - - /*****************************************************************************/ /* Scrolls the display in the y direction by blitting. */ /*****************************************************************************/ @@ -929,8 +621,6 @@ void scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2) { } } - - static unsigned char curapen = 0; /*****************************************************************************/ @@ -940,14 +630,10 @@ void setAPen(uint16 pennum) { curapen = (unsigned char)pennum; } - - - /*****************************************************************************/ /* Fills in a rectangle. */ /*****************************************************************************/ void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2) { -#if !defined(DOSCODE) int dx, dy, w, h; dx = x1; @@ -987,74 +673,8 @@ void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2) { ungetVGABaseAddr(); } - -#else - uint32 RealOffset, - SegmentOffset, - LeftInSegment; - char *video, - *curline; - uint16 counterx, - countery = y1, - numwholelines, - numpartiallines, - curpage; - - while (countery <= y2) { - RealOffset = (VGAScreenWidth * countery) + x1; - curpage = RealOffset / VGABytesPerPage; - SegmentOffset = RealOffset - (curpage * VGABytesPerPage); - LeftInSegment = VGABytesPerPage - SegmentOffset; - setPage(curpage); - video = (char *)(((int32)(VGABASEADDRESS)) + SegmentOffset); - - numwholelines = LeftInSegment / VGAScreenWidth; - numpartiallines = 0; - counterx = LeftInSegment - (numwholelines * VGAScreenWidth); - - if (counterx >= (x2 - x1 + 1)) - numwholelines++; - else - numpartiallines = 1; - - while (numwholelines && (countery <= y2)) { - curline = video; - - for (counterx = x1; counterx <= x2; counterx++) { - *video = curapen; - video++; - } - - video = curline; - video += VGAScreenWidth; - countery ++; - numwholelines --; - LeftInSegment -= VGAScreenWidth; - } - - if (numpartiallines && (countery <= y2)) { - countery ++; - curline = video; - - for (counterx = x1; counterx <= x2; counterx++) { - if (LeftInSegment == 0L) { - setPage(curpage + 1); - LeftInSegment = VGABytesPerPage; - video = (char *)(VGABASEADDRESS); - } - - *video = curapen; - video++; - LeftInSegment--; - } - } - } - -#endif } - - /*****************************************************************************/ /* Draws a horizontal line. */ /*****************************************************************************/ @@ -1062,9 +682,6 @@ void drawVLine(uint16 x, uint16 y1, uint16 y2) { rectFill(x, y1, x, y2); } - - - /*****************************************************************************/ /* Draws a vertical line. */ /*****************************************************************************/ @@ -1072,14 +689,10 @@ void drawHLine(uint16 x1, uint16 y, uint16 x2) { rectFill(x1, y, x2, y); } - - - /*****************************************************************************/ /* Ghoasts a region on the screen using the desired pen color. */ /*****************************************************************************/ void ghoastRect(uint16 pencolor, uint16 x1, uint16 y1, uint16 x2, uint16 y2) { -#if !defined(DOSCODE) int dx, dy, w, h; dx = x1; @@ -1127,85 +740,6 @@ void ghoastRect(uint16 pencolor, uint16 x1, uint16 y1, uint16 x2, uint16 y2) { ungetVGABaseAddr(); } - -#else - uint32 RealOffset, - SegmentOffset; - int32 LeftInSegment; - char *video, - *curline; - uint16 counterx, - countery = y1, - numwholelines, - numpartiallines, - curpage; - - while (countery <= y2) { - RealOffset = (VGAScreenWidth * countery) + x1; - curpage = RealOffset / VGABytesPerPage; - SegmentOffset = RealOffset - (curpage * VGABytesPerPage); - LeftInSegment = VGABytesPerPage - SegmentOffset; - setPage(curpage); - video = (char *)(((int32)(VGABASEADDRESS)) + SegmentOffset); - - numwholelines = LeftInSegment / VGAScreenWidth; - numpartiallines = 0; - counterx = LeftInSegment - (numwholelines * VGAScreenWidth); - - if (counterx >= (x2 - x1 + 1)) - numwholelines++; - else - numpartiallines = 1; - - while (numwholelines && (countery <= y2)) { - curline = video; - counterx = x1; - - if (1 & countery) { - video++; - counterx ++; - } - - while (counterx <= x2) { - *video = pencolor; - video += 2; - counterx += 2; - } - - video = curline; - video += VGAScreenWidth; - countery ++; - numwholelines --; - LeftInSegment -= VGAScreenWidth; - } - - if (numpartiallines && (countery <= y2)) { - countery ++; - curline = video; - counterx = x1; - - if (1 & countery) { - video++; - counterx ++; - LeftInSegment --; - } - - while (counterx < x2) { - if (LeftInSegment <= 0L) { - setPage(curpage + 1); - video = (char *)(((int32)(VGABASEADDRESS)) - LeftInSegment); - LeftInSegment = VGABytesPerPage + LeftInSegment; - } - - *video = pencolor; - video += 2; - counterx += 2; - LeftInSegment -= 2; - } - } - } - -#endif } } // End of namespace Lab diff --git a/engines/lab/vga.h b/engines/lab/vga.h index 8c1d3729a2..fe6b9f07a7 100644 --- a/engines/lab/vga.h +++ b/engines/lab/vga.h @@ -59,9 +59,7 @@ void quickWaitTOF(void); byte *getVGABaseAddr(void); -#if !defined(DOSCODE) void ungetVGABaseAddr(); -#endif void writeColorReg(byte *buf, uint16 regnum); |