aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2014-12-14 16:42:44 +0100
committerEugene Sandulenko2015-12-15 00:05:02 +0100
commit11a7ffaabe89920b6481e0efeb744b5efc222996 (patch)
tree073eff775cb57f63b7ed74d38a087abc52fe0a30 /engines
parentb396135a4db8ba9796803b98d648dea77269d8d3 (diff)
downloadscummvm-rg350-11a7ffaabe89920b6481e0efeb744b5efc222996.tar.gz
scummvm-rg350-11a7ffaabe89920b6481e0efeb744b5efc222996.tar.bz2
scummvm-rg350-11a7ffaabe89920b6481e0efeb744b5efc222996.zip
LAB: Started rendering pipeline
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/savegamepalmap.cpp2
-rw-r--r--engines/lab/special.cpp4
-rw-r--r--engines/lab/vga.cpp63
-rw-r--r--engines/lab/vga.h2
4 files changed, 52 insertions, 19 deletions
diff --git a/engines/lab/savegamepalmap.cpp b/engines/lab/savegamepalmap.cpp
index a93b1c3506..0678b7881c 100644
--- a/engines/lab/savegamepalmap.cpp
+++ b/engines/lab/savegamepalmap.cpp
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-
+
/*
* This code is based on Labyrinth of Time code with assistance of
*
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
index 5542b05716..8275517f47 100644
--- a/engines/lab/special.cpp
+++ b/engines/lab/special.cpp
@@ -1224,7 +1224,7 @@ static void drawSaveLoad() {
rectFill(274, 450, 274, 450);
rectFill(274, 454, 276, 454);
- g_system->updateScreen();
+ WSDL_UpdateScreen();
}
static void makeThumbnail(struct SaveGameInfo *info) {
@@ -1535,7 +1535,7 @@ bool saveRestoreGame(void) {
setAPen(0);
rectFill(0, 0, VGAScreenWidth - 1, VGAScreenHeight - 1);
blackScreen();
- g_system->updateScreen();
+ WSDL_UpdateScreen();
journalCleanUp();
diff --git a/engines/lab/vga.cpp b/engines/lab/vga.cpp
index 235d247145..728b15271e 100644
--- a/engines/lab/vga.cpp
+++ b/engines/lab/vga.cpp
@@ -43,6 +43,9 @@ uint32 VGAScreenWidth = 320UL,
uint32 VGABASEADDRESS = 0xA0000L;
+byte *g_DisplayBuffer = 0;
+byte *g_Pixels = 0;
+
/*****************************************************************************/
/* Sets the display mode. */
@@ -61,6 +64,10 @@ bool createScreen(bool HiRes) {
VGAScreenHeight = 480;
VGAPages = 1;
VGABytesPerPage = 640 * 480;
+
+ g_DisplayBuffer = (byte *)malloc(VGABytesPerPage);
+ g_Pixels = (byte *)calloc(VGABytesPerPage, 4);
+
return true;
}
@@ -84,19 +91,27 @@ void VGARestorePage(void) {
// does nothing in SDL
}
-
-void waitTOF(void) {
- warning("STUB: waitTOF");
- //WSDL_WaitTOF(1);
+void WSDL_ProcessInput() {
}
+void waitTOF() {
+ int untilOutOfRefresh = 1;
-// NOTE: I don't think this function is called anywhere in the code.
-void waitTOFQuick(void) {
- warning("STUB: waitTOFQuick");
- //WSDL_WaitTOF(0);
-}
+ g_ScreenIsLocked = 0;
+ if (g_ScreenWasLocked || untilOutOfRefresh) {
+ g_system->copyRectToScreen(g_DisplayBuffer, VGAScreenWidth, 0, 0, VGAScreenWidth, VGAScreenHeight);
+ g_system->updateScreen();
+ }
+
+ g_ScreenWasLocked = 0;
+ WSDL_ProcessInput();
+
+ for (uint32 now = g_system->getMillis(); now - g_LastWaitTOFTicks <= 0xF; now = g_system->getMillis() )
+ g_system->delayMillis(g_LastWaitTOFTicks - now + 17);
+
+ g_LastWaitTOFTicks = now;
+}
static char curvgapal[256 * 3];
@@ -153,7 +168,28 @@ void VGASetPal(void *cmap,
writeColorRegs((char *) cmap, 0, numcolors);
}
+byte *WSDL_LockVideo() {
+ g_ScreenWasLocked = 1;
+ g_ScreenIsLocked = 1;
+ return g_DisplayBuffer;
+}
+
+void WSDL_UnlockVideo() {
+ g_ScreenIsLocked = 0;
+}
+
+void WSDL_UpdateScreen() {
+ WSDL_UnlockVideo();
+
+ if (g_ScreenWasLocked && !g_IgnoreUpdateDisplay) {
+ g_system->copyRectToScreen(g_DisplayBuffer, VGAScreenWidth, 0, 0, VGAScreenWidth, VGAScreenHeight);
+ g_system->updateScreen();
+ }
+
+ g_ScreenWasLocked = 0;
+ WSDL_ProcessInput(0);
+}
/*****************************************************************************/
/* Returns the base address of the current VGA display. */
@@ -162,18 +198,13 @@ byte *getVGABaseAddr(void) {
if (VGABASEADDRESS != 1)
return (byte *)VGABASEADDRESS;
- warning("STUB: getVGABaseAddr");
- return 0; // WSDL_LockVideo();
+ return WSDL_LockVideo();
}
-#if !defined(DOSCODE)
void ungetVGABaseAddr() {
- warning("STUB: ungetVGABaseAddr");
if (VGABASEADDRESS == 1)
- ; //WSDL_UnlockVideo();
+ WSDL_UnlockVideo();
}
-#endif
-
/*****************************************************************************/
/* Gets information about the current display. */
diff --git a/engines/lab/vga.h b/engines/lab/vga.h
index 7080f4ae03..6ed7347dcf 100644
--- a/engines/lab/vga.h
+++ b/engines/lab/vga.h
@@ -95,6 +95,8 @@ void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2);
void ghoastRect(uint16 pencolor, uint16 x1, uint16 y1, uint16 x2, uint16 y2);
+void WSDL_UpdateScreen();
+
} // End of namespace Lab
#endif /* LAB_VGA_H */