[Scummvm-git-logs] scummvm master -> 5f494eb99dced13960f9747b8dc9f209916e98ce
sev-
noreply at scummvm.org
Thu Feb 26 23:17:48 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
effa725947 CHAMBER: Fix HGA rendering logic in cga_blitToScreen
5f494eb99d CHAMBER: Refactor splash screen to use Graphics::Surface
Commit: effa72594700cf53dbf7a774fdc625402684bb1d
https://github.com/scummvm/scummvm/commit/effa72594700cf53dbf7a774fdc625402684bb1d
Author: 11-andy-11 (lecturatul2017 at gmail.com)
Date: 2026-02-27T00:17:43+01:00
Commit Message:
CHAMBER: Fix HGA rendering logic in cga_blitToScreen
Changed paths:
engines/chamber/cga.cpp
engines/chamber/cga.h
diff --git a/engines/chamber/cga.cpp b/engines/chamber/cga.cpp
index 052c6182f5a..94be0f600fe 100644
--- a/engines/chamber/cga.cpp
+++ b/engines/chamber/cga.cpp
@@ -163,7 +163,13 @@ void cga_blitToScreen(int16 dx, int16 dy, int16 w, int16 h) {
w = (w + (0x8 / g_vm->_screenBits - 1)) / (0x8 / g_vm->_screenBits);
for (int16 y = 0; y < h; y++) {
- byte *src = CGA_SCREENBUFFER + CalcXY(dx, dy + y);
+ uint16 line_start = 0;
+ if (g_vm->_videoMode == Common::RenderMode::kRenderHercG) {
+ line_start = HGA_CALCXY_RAW(dx, dy + y);
+ } else {
+ line_start = cga_CalcXY(dx, dy + y);
+ }
+ byte *src = CGA_SCREENBUFFER + line_start;
byte *dst = scrbuffer + (y + dy) * g_vm->_screenW + dx;
for (int16 x = 0; x < w; x++) {
@@ -218,12 +224,12 @@ void cga_BackBufferToRealFull(void) {
odd += 2 * CGA_BYTES_PER_LINE;
}
- const int16 START_X_PIXELS = (HGA_WIDTH - (2 * CGA_WIDTH)) / 4;
- const int16 START_Y = (HGA_HEIGHT - CGA_HEIGHT) / 2;
+ //const int16 START_X_PIXELS = (HGA_WIDTH - (2 * CGA_WIDTH)) / 4;
+ //const int16 START_Y = (HGA_HEIGHT - CGA_HEIGHT) / 2;
byte *srcPtr = tempBackbuffer;
for (int16 row = 0; row < CGA_HEIGHT; row++) {
- byte *destPtr = CGA_SCREENBUFFER + HGA_CalcXY(START_X_PIXELS, START_Y + row);
+ byte *destPtr = CGA_SCREENBUFFER + HGA_CalcXY(0, row);
memmove(destPtr, srcPtr, CGA_BYTES_PER_LINE);
srcPtr += CGA_BYTES_PER_LINE;
}
@@ -559,8 +565,8 @@ void cga_PrintChar(byte c, byte *target) {
cga_blitToScreen((char_draw_coords_x - 1) * g_vm->_fontWidth, char_draw_coords_y, g_vm->_fontWidth, g_vm->_fontHeight);
} else if (g_vm->_videoMode == Common::RenderMode::kRenderHercG) {
- const int16 START_X = char_draw_coords_x++ + (HGA_WIDTH / 8 - (2 * CGA_WIDTH) / 8) / 2; // x + 5
- const int16 START_Y = char_draw_coords_y + (HGA_HEIGHT - CGA_HEIGHT) / 2; // y + 74
+ const int16 START_X = char_draw_coords_x++;
+ const int16 START_Y = char_draw_coords_y;
for (i = 0; i < g_vm->_fontHeight; i++) {
uint16 ofs = HGA_CalcXY_p(START_X, START_Y + i);
c = *font++;
diff --git a/engines/chamber/cga.h b/engines/chamber/cga.h
index 2a7da226e45..911180674b5 100644
--- a/engines/chamber/cga.h
+++ b/engines/chamber/cga.h
@@ -34,7 +34,7 @@ namespace Chamber {
#define HGA_PIXELS_PER_BYTE (8 / HGA_BITS_PER_PIXEL)
#define HGA_BYTES_PER_LINE (HGA_WIDTH / HGA_PIXELS_PER_BYTE)
#define HGA_CALCXY_RAW(x, y) ( ((y) % 4) * HGA_NEXT_LINES_OFS + ((y) / 4) * HGA_BYTES_PER_LINE + (x) / HGA_PIXELS_PER_BYTE )
-#define HGA_CENTERED_BASE_OFS HGA_CALCXY_RAW(-76, 8)
+#define HGA_CENTERED_BASE_OFS HGA_CALCXY_RAW(40, 72)
#ifdef __386__
#define HGA_SCREENBUFFER ((byte*)(HGA_BASE_SEG * 16))
#define HGA_BACKBUFFER ((byte*)(HGA_PAGE2_SEG * 16))
Commit: 5f494eb99dced13960f9747b8dc9f209916e98ce
https://github.com/scummvm/scummvm/commit/5f494eb99dced13960f9747b8dc9f209916e98ce
Author: 11-andy-11 (lecturatul2017 at gmail.com)
Date: 2026-02-27T00:17:43+01:00
Commit Message:
CHAMBER: Refactor splash screen to use Graphics::Surface
Changed paths:
engines/chamber/chamber.cpp
engines/chamber/chamber.h
engines/chamber/kult.cpp
diff --git a/engines/chamber/chamber.cpp b/engines/chamber/chamber.cpp
index f4cbc665fca..b2185d34c66 100644
--- a/engines/chamber/chamber.cpp
+++ b/engines/chamber/chamber.cpp
@@ -90,4 +90,18 @@ void ChamberEngine::syncGameStream(Common::Serializer &s) {
s.syncAsUint16LE(dummy);
}
+int ChamberEngine::getX(int original_x) {
+ if (_videoMode == Common::RenderMode::kRenderHercG) {
+ return original_x + 40;
+ }
+ return original_x;
+}
+
+int ChamberEngine::getY(int original_y) {
+ if (_videoMode == Common::RenderMode::kRenderHercG) {
+ return original_y + 74;
+ }
+ return original_y;
+}
+
} // End of namespace Chamber
diff --git a/engines/chamber/chamber.h b/engines/chamber/chamber.h
index b8dcfe53a56..d70a40c208c 100644
--- a/engines/chamber/chamber.h
+++ b/engines/chamber/chamber.h
@@ -72,6 +72,9 @@ public:
void initSound();
void deinitSound();
+ int getX(int original_x);
+ int getY(int original_y);
+
public:
bool _shouldQuit;
bool _shouldRestart;
diff --git a/engines/chamber/kult.cpp b/engines/chamber/kult.cpp
index 05e74782f40..f646c7ac3dd 100644
--- a/engines/chamber/kult.cpp
+++ b/engines/chamber/kult.cpp
@@ -40,6 +40,8 @@
#include "chamber/dialog.h"
#include "chamber/menu.h"
#include "chamber/ifgm.h"
+#include "graphics/surface.h"
+#include "graphics/paletteman.h"
namespace Chamber {
@@ -61,11 +63,39 @@ void saveToFile(char *filename, void *data, uint16 size) {
#endif
}
-int16 loadSplash(const char *filename) {
+Graphics::Surface *loadSplash(const char *filename) {
if (!loadFile(filename, scratch_mem1))
- return 0;
- decompress(scratch_mem1 + 8, backbuffer); /* skip compressed/decompressed size fields */
- return 1;
+ return nullptr;
+
+ Graphics::Surface *surface = new Graphics::Surface();
+ int width = (g_vm->_videoMode == Common::kRenderHercG) ? 640 : 320;
+ int height = (g_vm->_videoMode == Common::kRenderHercG) ? 640 : 200;
+ surface->create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+
+ decompress(scratch_mem1 + 8, backbuffer);
+
+ for (int y = 0; y < CGA_HEIGHT; ++y) {
+ byte *dst = (byte *)surface->getBasePtr(0, y);
+ for (int x = 0; x < CGA_WIDTH; x += 4) {
+ int cga_offset = (y % 2) * 8192 + (y / 2) * 80 + (x / 4);
+ byte cga_byte = backbuffer[cga_offset];
+
+ if (g_vm->_videoMode == Common::RenderMode::kRenderHercG) {
+ byte colors = cga_byte;
+ for (int i = 0; i < 8; i++) {
+ byte bit = (colors & 0x80) >> 7;
+ colors <<= 1;
+ dst[x * 2 + i] = bit;
+ }
+ } else{
+ for (int i = 0; i < 4; i++) {
+ byte color = (cga_byte >> (6 - i * 2)) & 0x03;
+ dst[x + i] = color;
+ }
+ }
+ }
+ }
+ return surface;
}
uint16 benchmarkCpu(void) {
@@ -236,10 +266,13 @@ Common::Error ChamberEngine::init() {
/* Install timer callback */
initTimer();
+
+ Graphics::Surface *splash = nullptr;
if (g_vm->getLanguage() == Common::EN_USA) {
/* Load title screen */
- if (!loadSplash("PRESCGA.BIN"))
+ splash = loadSplash("PRESCGA.BIN");
+ if (!splash)
exitGame();
if (ifgm_loaded) {
@@ -247,7 +280,8 @@ Common::Error ChamberEngine::init() {
}
} else {
/* Load title screen */
- if (!loadSplash("PRES.BIN"))
+ splash = loadSplash("PRES.BIN");
+ if (!splash)
exitGame();
}
@@ -261,11 +295,20 @@ Common::Error ChamberEngine::init() {
cga_BackBufferToRealFull();
}
+ int splash_x = getX(0);
+ int splash_y = getY(0);
+
+ g_system->copyRectToScreen(splash->getPixels(), splash->pitch, splash_x, splash_y, splash->w, splash->h);
+ g_system->updateScreen();
+
+ splash->free();
+ delete splash;
+
/* Wait for a keypress */
clearKeyboard();
readKeyboardChar();
-
+
if (g_vm->getLanguage() == Common::EN_USA) {
if (ifgm_loaded) {
/*TODO*/
More information about the Scummvm-git-logs
mailing list