aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2003-08-02 07:00:58 +0000
committerTravis Howell2003-08-02 07:00:58 +0000
commit471bc5ceb5cb57ec12024d577ada641a890f83ee (patch)
treec52d0c2a082c9bfc9a3a7935773e097a5c1e829e /simon
parent326379b95e3c4a4708b7c3f28178ed1853225599 (diff)
downloadscummvm-rg350-471bc5ceb5cb57ec12024d577ada641a890f83ee.tar.gz
scummvm-rg350-471bc5ceb5cb57ec12024d577ada641a890f83ee.tar.bz2
scummvm-rg350-471bc5ceb5cb57ec12024d577ada641a890f83ee.zip
Improved hebrew support, thanks to Jamieson
svn-id: r9397
Diffstat (limited to 'simon')
-rw-r--r--simon/charset.cpp59
-rw-r--r--simon/simon.cpp18
-rw-r--r--simon/simon.h1
3 files changed, 57 insertions, 21 deletions
diff --git a/simon/charset.cpp b/simon/charset.cpp
index cf0e44bfb9..9843822a54 100644
--- a/simon/charset.cpp
+++ b/simon/charset.cpp
@@ -204,18 +204,33 @@ void SimonEngine::showmessage_helper_3(uint a, uint b) {
}
void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c) {
+ byte width = 6;
+
if (c == 0xC) {
video_fill_or_copy_from_3_to_2(fcs);
} else if (c == 0xD || c == 0xA) {
video_putchar_newline(fcs);
- } else if (c == 8 || c == 1) {
- int8 val = (c == 8) ? 6 : 4;
- if (fcs->textLength != 0) {
- fcs->textLength--;
- fcs->textColumnOffset -= val;
- if ((int8)fcs->textColumnOffset < val) {
- fcs->textColumnOffset += 8;
- fcs->textColumn--;
+ } else if (c == 8 || (_language != 20 && c == 1)) {
+ if (_language == 20) { //Hebrew
+ if (fcs->textLength != 0) {
+ if (c >= 64 && c < 91)
+ width = _hebrew_char_widths [c-64];
+ fcs->textLength--;
+ fcs->textColumnOffset += width;
+ if (fcs->textColumnOffset >= 8) {
+ fcs->textColumnOffset -= 8;
+ fcs->textColumn--;
+ }
+ }
+ } else {
+ int8 val = (c == 8) ? 6 : 4;
+ if (fcs->textLength != 0) {
+ fcs->textLength--;
+ fcs->textColumnOffset -= val;
+ if ((int8)fcs->textColumnOffset < val) {
+ fcs->textColumnOffset += 8;
+ fcs->textColumn--;
+ }
}
}
} else if (c >= 0x20) {
@@ -226,19 +241,29 @@ void SimonEngine::video_putchar(FillOrCopyStruct *fcs, byte c) {
fcs->textRow--;
}
- if (_language == 20)
+ if (_language == 20) { //Hebrew
+ if (c >= 64 && c < 91)
+ width = _hebrew_char_widths [c-64];
+
+ fcs->textColumnOffset -= width;
+ if (fcs->textColumnOffset >= width) {
+ ++fcs->textColumn;
+ fcs->textColumnOffset += 8;
+ }
video_putchar_drawchar(fcs, fcs->width + fcs->x - fcs->textColumn, fcs->textRow * 8 + fcs->y, c);
- else
+ fcs->textLength++;
+ } else {
video_putchar_drawchar(fcs, fcs->textColumn + fcs->x, fcs->textRow * 8 + fcs->y, c);
- fcs->textLength++;
- fcs->textColumnOffset += 6;
- if (c == 'i' || c == 'l')
- fcs->textColumnOffset -= 2;
+ fcs->textLength++;
+ fcs->textColumnOffset += 6;
+ if (c == 'i' || c == 'l')
+ fcs->textColumnOffset -= 2;
- if (fcs->textColumnOffset >= 8) {
- fcs->textColumnOffset -= 8;
- fcs->textColumn++;
+ if (fcs->textColumnOffset >= 8) {
+ fcs->textColumnOffset -= 8;
+ fcs->textColumn++;
+ }
}
}
}
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 5e39858db9..18a353dcf0 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -437,6 +437,9 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_sdl_buf_attached = 0;
_vc_10_base_ptr_old = 0;
+ memcpy (_hebrew_char_widths,
+ "\x5\x5\x4\x6\x5\x3\x4\x5\x6\x3\x5\x5\x4\x6\x5\x3\x4\x6\x5\x6\x6\x6\x5\x5\x5\x6\x5\x6\x6\x6\x6\x6", 32);
+
// Setup midi driver
if (!driver)
@@ -2656,10 +2659,17 @@ restart:;
fcs->textRow = unk132_result;
- // init x offset with a 2 character savegame number + a period (18 pix)
- fcs->textColumn = 2;
- fcs->textColumnOffset = 2;
- fcs->textLength = 3;
+ if (_language == 20) {
+ // init x offset with a 2 character savegame number + a period (18 pix)
+ fcs->textColumn = 3;
+ fcs->textColumnOffset = 6;
+ fcs->textLength = 3;
+ } else {
+ // init x offset with a 2 character savegame number + a period (18 pix)
+ fcs->textColumn = 2;
+ fcs->textColumnOffset = 2;
+ fcs->textLength = 3;
+ }
name = buf + i * 18;
diff --git a/simon/simon.h b/simon/simon.h
index d38ebc4eaf..2ece8e813b 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -348,6 +348,7 @@ protected:
RandomSource _rnd;
byte *_vc_10_base_ptr_old;
+ byte _hebrew_char_widths[32];
public:
SimonEngine(GameDetector *detector, OSystem *syst);