MORTEVIELLE: Rename more globals
This commit is contained in:
parent
b2b16cefce
commit
2a32c9d1f4
16 changed files with 254 additions and 275 deletions
|
@ -911,7 +911,7 @@ void ScreenSurface::drawPicture(GfxSurface &surface, int x, int y) {
|
|||
(x + surface.w) * 2, (y + surface.h) * 2));
|
||||
|
||||
// Get a lookup for the palette mapping
|
||||
const byte *paletteMap = &mem[0x7000 * 16 + 2];
|
||||
const byte *paletteMap = &g_mem[0x7000 * 16 + 2];
|
||||
|
||||
// Loop through writing
|
||||
for (int yp = 0; yp < surface.h; ++yp) {
|
||||
|
|
|
@ -46,7 +46,7 @@ int testou() {
|
|||
break;
|
||||
case '\26' :
|
||||
if ((g_c_zzz == 1) || (g_c_zzz == 2)) {
|
||||
zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
|
||||
zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
|
||||
++g_c_zzz;
|
||||
|
||||
return 61;
|
||||
|
|
|
@ -61,12 +61,13 @@ bool isMouseIn(rectangle r) {
|
|||
void outbloc(int n, pattern p, nhom *pal) {
|
||||
int ad = n * 404 + 0xd700;
|
||||
|
||||
WRITE_LE_UINT16(&mem[0x6000 * 16 + ad], p._tax);
|
||||
WRITE_LE_UINT16(&mem[0x6000 * 16 + ad + 2], p._tay);
|
||||
WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad], p._tax);
|
||||
WRITE_LE_UINT16(&g_mem[0x6000 * 16 + ad + 2], p._tay);
|
||||
ad += 4;
|
||||
for (int i = 1; i <= p._tax; ++i)
|
||||
for (int i = 1; i <= p._tax; ++i) {
|
||||
for (int j = 1; j <= p._tay; ++j)
|
||||
mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
|
||||
g_mem[(0x6000 * 16) + ad + (j - 1) * p._tax + i - 1] = pal[n]._hom[p._des[i][j]];
|
||||
}
|
||||
}
|
||||
|
||||
void writepal(int n) {
|
||||
|
@ -75,22 +76,22 @@ void writepal(int n) {
|
|||
case MODE_EGA:
|
||||
case MODE_AMSTRAD1512:
|
||||
for (int i = 1; i <= 16; ++i) {
|
||||
mem[(0x7000 * 16) + (2 * i)] = tabpal[n][i].x;
|
||||
mem[(0x7000 * 16) + (2 * i) + 1] = tabpal[n][i].y;
|
||||
g_mem[(0x7000 * 16) + (2 * i)] = g_tabpal[n][i].x;
|
||||
g_mem[(0x7000 * 16) + (2 * i) + 1] = g_tabpal[n][i].y;
|
||||
}
|
||||
break;
|
||||
case MODE_CGA: {
|
||||
warning("TODO: If this code is needed, resolve the incompatible types");
|
||||
nhom pal[16];
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
pal[i] = palcga[n]._a[i];
|
||||
pal[i] = g_palcga[n]._a[i];
|
||||
}
|
||||
// nhom pal[16] = palcga[n]._a;
|
||||
if (n < 89)
|
||||
palette(palcga[n]._p);
|
||||
palette(g_palcga[n]._p);
|
||||
|
||||
for (int i = 0; i <= 15; ++i)
|
||||
outbloc(i, tpt[pal[i]._id], pal);
|
||||
outbloc(i, g_tpt[pal[i]._id], pal);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -101,15 +102,15 @@ void writepal(int n) {
|
|||
|
||||
void pictout(int seg, int dep, int x, int y) {
|
||||
GfxSurface surface;
|
||||
surface.decode(&mem[seg * 16 + dep]);
|
||||
surface.decode(&g_mem[seg * 16 + dep]);
|
||||
|
||||
if (g_currGraphicalDevice == MODE_HERCULES) {
|
||||
mem[0x7000 * 16 + 2] = 0;
|
||||
mem[0x7000 * 16 + 32] = 15;
|
||||
g_mem[0x7000 * 16 + 2] = 0;
|
||||
g_mem[0x7000 * 16 + 32] = 15;
|
||||
}
|
||||
|
||||
if ((g_caff != 51) && (READ_LE_UINT16(&mem[0x7000 * 16 + 0x4138]) > 0x100))
|
||||
WRITE_LE_UINT16(&mem[0x7000 * 16 + 0x4138], 0x100);
|
||||
if ((g_caff != 51) && (READ_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138]) > 0x100))
|
||||
WRITE_LE_UINT16(&g_mem[0x7000 * 16 + 0x4138], 0x100);
|
||||
|
||||
g_vm->_screenSurface.drawPicture(surface, x, y);
|
||||
}
|
||||
|
@ -144,7 +145,7 @@ void adzon() {
|
|||
if (!f.open("dec.mor"))
|
||||
error("Missing file - dec.mor");
|
||||
|
||||
f.read(&mem[0x73a2 * 16 + 0], 1 * 1664);
|
||||
f.read(&g_mem[0x73a2 * 16 + 0], 1 * 1664);
|
||||
f.close();
|
||||
}
|
||||
|
||||
|
@ -152,12 +153,12 @@ void adzon() {
|
|||
* Returns the offset within the compressed image data resource of the desired image
|
||||
*/
|
||||
int animof(int ouf, int num) {
|
||||
int nani = mem[adani * 16 + 1];
|
||||
int nani = g_mem[adani * 16 + 1];
|
||||
int aux = num;
|
||||
if (ouf != 1)
|
||||
aux += nani;
|
||||
|
||||
int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&mem[adani * 16 + (aux << 1)]);
|
||||
int animof_result = (nani << 2) + 2 + READ_BE_UINT16(&g_mem[adani * 16 + (aux << 1)]);
|
||||
|
||||
return animof_result;
|
||||
}
|
||||
|
|
|
@ -38,16 +38,10 @@ extern bool isMouseIn(rectangle r);
|
|||
extern void outbloc(int n, pattern p, nhom *pal);
|
||||
extern void writepal(int n);
|
||||
extern void pictout(int seg, int dep, int x, int y);
|
||||
// extern int calad(int x, int y);
|
||||
extern void sauvecr(int y, int dy);
|
||||
extern void charecr(int y, int dy);
|
||||
// extern int peek(int ad);
|
||||
// extern int peekw(int ad);
|
||||
// extern real peekl(int ad);
|
||||
// extern void procedure poke(int ad, int n);
|
||||
extern void adzon();
|
||||
extern int animof(int ouf, int num);
|
||||
// extern void affgd(int offs, int dep, int x, int y);
|
||||
|
||||
} // End of namespace Mortevielle
|
||||
#endif
|
||||
|
|
|
@ -115,7 +115,7 @@ void dessine(int ad, int x, int y) {
|
|||
void dessine_rouleau() {
|
||||
writepal(89);
|
||||
if (g_currGraphicalDevice == MODE_HERCULES) {
|
||||
mem[0x7000 * 16 + 14] = 15;
|
||||
g_mem[0x7000 * 16 + 14] = 15;
|
||||
}
|
||||
hideMouse();
|
||||
pictout(0x73a2, 0, 0, 0);
|
||||
|
@ -1325,7 +1325,7 @@ void aniof(int ouf, int num) {
|
|||
int offset = animof(ouf, num);
|
||||
|
||||
GfxSurface surface;
|
||||
surface.decode(&mem[ad * 16 + offset]);
|
||||
surface.decode(&g_mem[ad * 16 + offset]);
|
||||
g_vm->_screenSurface.drawPicture(surface, 0, 12);
|
||||
|
||||
ecrf1();
|
||||
|
|
|
@ -237,15 +237,15 @@ void tkey1(bool d) {
|
|||
showMouse();
|
||||
}
|
||||
|
||||
void tmlieu(int mli) {
|
||||
void tmlieu(int roomId) {
|
||||
Common::String nomp;
|
||||
|
||||
if (mli == 26)
|
||||
mli = 15;
|
||||
if (roomId == 26)
|
||||
roomId = 15;
|
||||
|
||||
int i = 1;
|
||||
while ((i < 8) && (v_lieu[i][mli] != 0)) {
|
||||
nomp = deline(v_lieu[i][mli] + kMenuPlaceStringIndex);
|
||||
while ((i < 8) && (g_v_lieu[i][roomId] != 0)) {
|
||||
nomp = deline(g_v_lieu[i][roomId] + kMenuPlaceStringIndex);
|
||||
while (nomp.size() < 20)
|
||||
nomp += ' ';
|
||||
g_vm->_menu.menut(g_vm->_menu._moveMenu[i], nomp);
|
||||
|
|
|
@ -43,7 +43,7 @@ extern void fenat(char ans);
|
|||
/* NIVEAU 8 */
|
||||
extern void afdes(int ad);
|
||||
extern void tkey1(bool d);
|
||||
extern void tmlieu(int mli);
|
||||
extern void tmlieu(int roomId);
|
||||
/* NIVEAU 7 */
|
||||
extern void tlu(int af, int ob);
|
||||
extern void affrep();
|
||||
|
|
|
@ -149,7 +149,7 @@ Common::ErrorCode MortevielleEngine::initialise() {
|
|||
charpal();
|
||||
charge_cfiph();
|
||||
charge_cfiec();
|
||||
zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
|
||||
zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
|
||||
g_c_zzz = 1;
|
||||
init_nbrepm();
|
||||
initMouse();
|
||||
|
@ -504,7 +504,7 @@ void MortevielleEngine::mainGame() {
|
|||
charge_cfiec();
|
||||
|
||||
for (g_crep = 1; g_crep <= g_c_zzz; ++g_crep)
|
||||
zzuul(&adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
|
||||
zzuul(&g_adcfiec[161 * 16], ((822 * 128) - (161 * 16)) / 64);
|
||||
|
||||
charge_bruit5();
|
||||
_menu.initMenu();
|
||||
|
|
|
@ -60,7 +60,7 @@ void initMouse() {
|
|||
|
||||
g_vm->setMouseClick(false);
|
||||
m_show = m_arrow;
|
||||
if ((READ_LE_UINT16(&mem[0xcc]) == 0) && (READ_LE_UINT16(&mem[0xce]) == 0))
|
||||
if ((READ_LE_UINT16(&g_mem[0xcc]) == 0) && (READ_LE_UINT16(&g_mem[0xce]) == 0))
|
||||
int_m = false;
|
||||
|
||||
if (int_m) {
|
||||
|
@ -91,10 +91,10 @@ void hideMouse() {
|
|||
int k = 0;
|
||||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
|
||||
do {
|
||||
WRITE_LE_UINT16(&mem[0xb000 * 16 + j], s_s[0][k]);
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + j + 2], s_s[1][k]);
|
||||
WRITE_LE_UINT16(&mem[0xba00 * 16 + j], s_s[2][k]);
|
||||
WRITE_LE_UINT16(&mem[0xba00 * 16 + j + 2], s_s[3][k]);
|
||||
WRITE_LE_UINT16(&g_mem[0xb000 * 16 + j], s_s[0][k]);
|
||||
WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j + 2], s_s[1][k]);
|
||||
WRITE_LE_UINT16(&g_mem[0xba00 * 16 + j], s_s[2][k]);
|
||||
WRITE_LE_UINT16(&g_mem[0xba00 * 16 + j + 2], s_s[3][k]);
|
||||
j += 80;
|
||||
++k;
|
||||
} while (k < 5);
|
||||
|
@ -102,15 +102,15 @@ void hideMouse() {
|
|||
break;
|
||||
case MODE_AMSTRAD1512:
|
||||
for (int i = 0; i <= 3; ++i) {
|
||||
port[0x3dd] = 1 << i;
|
||||
g_port[0x3dd] = 1 << i;
|
||||
int k = 0;
|
||||
j = p_o_s;
|
||||
do {
|
||||
if (imp) {
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
|
||||
WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j], s_s[i][k]);
|
||||
j += 80 - 0x2000;
|
||||
} else {
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + j], s_s[i][k]);
|
||||
WRITE_LE_UINT16(&g_mem[0xb800 * 16 + j], s_s[i][k]);
|
||||
j += 0x2000;
|
||||
}
|
||||
imp = !imp;
|
||||
|
@ -119,22 +119,22 @@ void hideMouse() {
|
|||
}
|
||||
break;
|
||||
case MODE_EGA: {
|
||||
port[0x3c4] = 2;
|
||||
port[0x3ce] = 8;
|
||||
port[0x3cf] = 255;
|
||||
g_port[0x3c4] = 2;
|
||||
g_port[0x3ce] = 8;
|
||||
g_port[0x3cf] = 255;
|
||||
int i = 0;
|
||||
do {
|
||||
port[0x3c5] = 1 << i;
|
||||
g_port[0x3c5] = 1 << i;
|
||||
int k = 0;
|
||||
j = p_o_s;
|
||||
do {
|
||||
// Useless ?
|
||||
// ps = mem[0xa000 * 16 + j];
|
||||
mem[0xa000 * 16 + j] = lo(s_s[i][k]);
|
||||
g_mem[0xa000 * 16 + j] = lo(s_s[i][k]);
|
||||
|
||||
// Useless ??
|
||||
// ps = mem[0xa000 * 16 + j + 1];
|
||||
mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
|
||||
g_mem[0xa000 * 16 + j + 1] = hi(s_s[i][k]);
|
||||
j += 80;
|
||||
++k;
|
||||
} while (k < 8);
|
||||
|
@ -146,7 +146,7 @@ void hideMouse() {
|
|||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
|
||||
for (int i = 0; i <= 5; ++i) {
|
||||
for (int k = 0; k <= 3; ++k)
|
||||
WRITE_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
|
||||
WRITE_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j], s_s[i][k]);
|
||||
j += 80;
|
||||
}
|
||||
break;
|
||||
|
@ -155,8 +155,8 @@ void hideMouse() {
|
|||
int k = 0;
|
||||
do {
|
||||
for (int i = 0; i <= 3; ++i) {
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
|
||||
WRITE_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
|
||||
WRITE_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j], s_s[k][i + (k << 2)]);
|
||||
WRITE_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j + 2], s_s[k + 3][i + (k << 2)]);
|
||||
}
|
||||
j += 160;
|
||||
++k;
|
||||
|
@ -188,10 +188,10 @@ void showMouse() {
|
|||
k = 0;
|
||||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 2);
|
||||
do {
|
||||
s_s[0][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
|
||||
s_s[1][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j + 2]);
|
||||
s_s[2][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j]);
|
||||
s_s[3][k] = READ_LE_UINT16(&mem[0xba00 * 16 + j + 2]);
|
||||
s_s[0][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
|
||||
s_s[1][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j + 2]);
|
||||
s_s[2][k] = READ_LE_UINT16(&g_mem[0xba00 * 16 + j]);
|
||||
s_s[3][k] = READ_LE_UINT16(&g_mem[0xba00 * 16 + j + 2]);
|
||||
j += 80;
|
||||
++k;
|
||||
} while (k < 5);
|
||||
|
@ -200,14 +200,14 @@ void showMouse() {
|
|||
for (i = 0; i <= 3; ++i) {
|
||||
j = p_o_s;
|
||||
imp = odd(y_s);
|
||||
port[0x3de] = i;
|
||||
g_port[0x3de] = i;
|
||||
k = 0;
|
||||
do {
|
||||
if (imp) {
|
||||
s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
|
||||
s_s[i][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
|
||||
j += 80 - 0x2000;
|
||||
} else {
|
||||
s_s[i][k] = READ_LE_UINT16(&mem[0xb800 * 16 + j]);
|
||||
s_s[i][k] = READ_LE_UINT16(&g_mem[0xb800 * 16 + j]);
|
||||
j += 0x2000;
|
||||
}
|
||||
imp = !imp;
|
||||
|
@ -216,14 +216,14 @@ void showMouse() {
|
|||
}
|
||||
break;
|
||||
case MODE_EGA:
|
||||
port[0x3ce] = 4;
|
||||
g_port[0x3ce] = 4;
|
||||
l = 0;
|
||||
do {
|
||||
port[0x3cf] = l;
|
||||
g_port[0x3cf] = l;
|
||||
k = 0;
|
||||
j = p_o_s;
|
||||
do {
|
||||
s_s[l][k] = mem[0xa000 * 16 + j] + (mem[(0xa000 * 16) + j + 1] << 8);
|
||||
s_s[l][k] = g_mem[0xa000 * 16 + j] + (g_mem[(0xa000 * 16) + j + 1] << 8);
|
||||
j += 80;
|
||||
++k;
|
||||
} while (k < 8);
|
||||
|
@ -234,7 +234,7 @@ void showMouse() {
|
|||
j = ((uint)y_s >> 1) * 80 + ((uint)x_s >> 3);
|
||||
for (i = 0; i <= 5; ++i) {
|
||||
for (k = 0; k <= 3; ++k)
|
||||
s_s[i][k] = READ_LE_UINT16(&mem[0xb000 * 16 + k * 0x200 + j]);
|
||||
s_s[i][k] = READ_LE_UINT16(&g_mem[0xb000 * 16 + k * 0x200 + j]);
|
||||
j += 80;
|
||||
}
|
||||
break;
|
||||
|
@ -243,8 +243,8 @@ void showMouse() {
|
|||
k = 0;
|
||||
do {
|
||||
for (i = 0; i <= 3; ++i) {
|
||||
s_s[k][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j]);
|
||||
s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&mem[0xb800 * 16 + 0x200 * i + j + 2]);
|
||||
s_s[k][i + (k << 2)] = READ_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j]);
|
||||
s_s[k + 3][i + (k << 2)] = READ_LE_UINT16(&g_mem[0xb800 * 16 + 0x200 * i + j + 2]);
|
||||
}
|
||||
j += 160;
|
||||
++k;
|
||||
|
|
|
@ -76,13 +76,13 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
|
|||
uint16 oct, ocd;
|
||||
|
||||
/* 5-8 */
|
||||
oct = t_mot[idx];
|
||||
oct = g_t_mot[idx];
|
||||
oct = ((uint16)(oct << (16 - pt))) >> (16 - pt);
|
||||
if (pt < 6) {
|
||||
++idx;
|
||||
oct = oct << (5 - pt);
|
||||
pt += 11;
|
||||
oct = oct | ((uint)t_mot[idx] >> pt);
|
||||
oct = oct | ((uint)g_t_mot[idx] >> pt);
|
||||
} else {
|
||||
pt -= 5;
|
||||
oct = (uint)oct >> pt;
|
||||
|
@ -95,13 +95,13 @@ static void cinq_huit(char &c, int &idx, byte &pt, bool &the_end) {
|
|||
break;
|
||||
case 30:
|
||||
case 31:
|
||||
ocd = t_mot[idx];
|
||||
ocd = g_t_mot[idx];
|
||||
ocd = (uint16)(ocd << (16 - pt)) >> (16 - pt);
|
||||
if (pt < 6) {
|
||||
++idx;
|
||||
ocd = ocd << (5 - pt);
|
||||
pt += 11;
|
||||
ocd = ocd | ((uint)t_mot[idx] >> pt);
|
||||
ocd = ocd | ((uint)g_t_mot[idx] >> pt);
|
||||
} else {
|
||||
pt -= 5;
|
||||
ocd = (uint)ocd >> pt;
|
||||
|
@ -134,8 +134,8 @@ Common::String deline(int num) {
|
|||
} else if (!g_vm->_txxFileFl) {
|
||||
wrkStr = g_vm->getGameString(num);
|
||||
} else {
|
||||
int i = t_rec[num]._indis;
|
||||
byte k = t_rec[num]._point;
|
||||
int i = g_t_rec[num]._indis;
|
||||
byte k = g_t_rec[num]._point;
|
||||
int length = 0;
|
||||
bool endFl = false;
|
||||
char let;
|
||||
|
|
|
@ -68,8 +68,8 @@ void charpal() {
|
|||
error("Missing file - plxx.mor");
|
||||
for (int i = 0; i <= 90; ++i) {
|
||||
for (int j = 1; j <= 16; ++j) {
|
||||
tabpal[i][j].x = f.readByte();
|
||||
tabpal[i][j].y = f.readByte();
|
||||
g_tabpal[i][j].x = f.readByte();
|
||||
g_tabpal[i][j].y = f.readByte();
|
||||
}
|
||||
}
|
||||
f.close();
|
||||
|
@ -78,9 +78,9 @@ void charpal() {
|
|||
error("Missing file - cxx.mor");
|
||||
|
||||
for (int j = 0; j <= 90; ++j) {
|
||||
palcga[j]._p = fb.readByte();
|
||||
g_palcga[j]._p = fb.readByte();
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
nhom &with = palcga[j]._a[i];
|
||||
nhom &with = g_palcga[j]._a[i];
|
||||
|
||||
b = fb.readByte();
|
||||
with._id = (uint)b >> 4;
|
||||
|
@ -88,13 +88,13 @@ void charpal() {
|
|||
with._hom[1] = b & 3;
|
||||
}
|
||||
}
|
||||
palcga[10]._a[9] = palcga[10]._a[5];
|
||||
g_palcga[10]._a[9] = g_palcga[10]._a[5];
|
||||
for (int j = 0; j <= 14; ++j) {
|
||||
tpt[j]._tax = fb.readByte();
|
||||
tpt[j]._tay = fb.readByte();
|
||||
g_tpt[j]._tax = fb.readByte();
|
||||
g_tpt[j]._tay = fb.readByte();
|
||||
for (int i = 1; i <= 20; ++i)
|
||||
for (int k = 1; k <= 20; ++k)
|
||||
tpt[j]._des[i][k] = fb.readByte();
|
||||
g_tpt[j]._des[i][k] = fb.readByte();
|
||||
}
|
||||
fb.close();
|
||||
}
|
||||
|
@ -112,35 +112,29 @@ void chartex() {
|
|||
if (!inpFile.open("TXX.INP")) {
|
||||
if (!inpFile.open("TXX.MOR")) {
|
||||
warning("Missing file - TXX.INP or .MOR - Switching to DAT file");
|
||||
return;
|
||||
}
|
||||
} else if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
|
||||
warning("TXX file - Unexpected format - Switching to DAT file");
|
||||
return;
|
||||
} else {
|
||||
for (int i = 0; i < inpFile.size() / 2; ++i)
|
||||
g_t_mot[i] = inpFile.readUint16LE();
|
||||
|
||||
inpFile.close();
|
||||
g_vm->_txxFileFl = true;
|
||||
}
|
||||
|
||||
if (!ntpFile.open("TXX.NTP")) {
|
||||
if (!ntpFile.open("TXX.IND")) {
|
||||
warning("Missing file - TXX.NTP or .IND - Switching to DAT file");
|
||||
return;
|
||||
}
|
||||
error("Missing file - TXX.NTP");
|
||||
}
|
||||
|
||||
if ((inpFile.size() > (maxti * 2)) || (ntpFile.size() > (maxtd * 3))) {
|
||||
warning("TXX file - Unexpected format - Switching to DAT file");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < inpFile.size() / 2; ++i)
|
||||
t_mot[i] = inpFile.readUint16LE();
|
||||
|
||||
inpFile.close();
|
||||
|
||||
for (int i = 0; i < (ntpFile.size() / 3); ++i) {
|
||||
t_rec[i]._indis = ntpFile.readSint16LE();
|
||||
t_rec[i]._point = ntpFile.readByte();
|
||||
g_t_rec[i]._indis = ntpFile.readSint16LE();
|
||||
g_t_rec[i]._point = ntpFile.readByte();
|
||||
}
|
||||
|
||||
ntpFile.close();
|
||||
|
||||
g_vm->_txxFileFl = true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -154,17 +148,17 @@ void dialpre() {
|
|||
}
|
||||
|
||||
void init_lieu() {
|
||||
Common::File f_lieu; // tab_mlieu
|
||||
Common::File f;
|
||||
|
||||
/* debug('o3 init_lieu'); */
|
||||
if (!f_lieu.open("MXX.mor"))
|
||||
if (!f.open("MXX.mor"))
|
||||
error("Missing file - MXX.mor");
|
||||
|
||||
for (int i = 1; i < 8; ++i)
|
||||
for (int i = 1; i < 8; ++i) {
|
||||
for (int j = 0; j < 25; ++j)
|
||||
v_lieu[i][j] = f_lieu.readByte();
|
||||
g_v_lieu[i][j] = f.readByte();
|
||||
}
|
||||
|
||||
f_lieu.close();
|
||||
f.close();
|
||||
}
|
||||
|
||||
|
||||
|
@ -182,19 +176,19 @@ void music() {
|
|||
if (!fic.open("mort.img"))
|
||||
error("Missing file - mort.img");
|
||||
|
||||
fic.read(&mem[0x3800 * 16 + 0], 500);
|
||||
fic.read(&mem[0x47a0 * 16 + 0], 123);
|
||||
fic.read(&g_mem[0x3800 * 16 + 0], 500);
|
||||
fic.read(&g_mem[0x47a0 * 16 + 0], 123);
|
||||
fic.close();
|
||||
|
||||
g_vm->_soundManager.decodeMusic(&mem[0x3800 * 16], &mem[0x5000 * 16], 623);
|
||||
addfix = (float)((kTempoMusic - g_addv[1])) / 256;
|
||||
cctable(tbi);
|
||||
g_vm->_soundManager.decodeMusic(&g_mem[0x3800 * 16], &g_mem[0x5000 * 16], 623);
|
||||
g_addfix = (float)((kTempoMusic - g_addv[1])) / 256;
|
||||
cctable(g_tbi);
|
||||
|
||||
fin = false;
|
||||
k = 0;
|
||||
do {
|
||||
fin = keypressed();
|
||||
g_vm->_soundManager.musyc(tbi, 9958, kTempoMusic);
|
||||
g_vm->_soundManager.musyc(g_tbi, 9958, kTempoMusic);
|
||||
++k;
|
||||
fin = fin | keypressed() | (k >= 5);
|
||||
} while (!fin);
|
||||
|
@ -209,7 +203,7 @@ void charge_bruit5() {
|
|||
if (!f.open("bruit5"))
|
||||
error("Missing file - bruit5");
|
||||
|
||||
f.read(&mem[adbruit5 * 16 + 0], 149 * 128);
|
||||
f.read(&g_mem[adbruit5 * 16 + 0], 149 * 128);
|
||||
f.close();
|
||||
}
|
||||
|
||||
|
@ -219,7 +213,7 @@ void charge_cfiec() {
|
|||
if (!f.open("cfiec.mor"))
|
||||
error("Missing file - cfiec.mor");
|
||||
|
||||
f.read(&adcfiec[0], 822 * 128);
|
||||
f.read(&g_adcfiec[0], 822 * 128);
|
||||
f.close();
|
||||
|
||||
g_rech_cfiec = false;
|
||||
|
|
|
@ -33,49 +33,49 @@
|
|||
namespace Mortevielle {
|
||||
|
||||
void spfrac(int wor) {
|
||||
c3._rep = (uint)wor >> 12;
|
||||
if ((g_typlec == 0) && (c3._code != 9))
|
||||
if (((c3._code > 4) && (c3._val != 20) && (c3._rep != 3) && (c3._rep != 6) && (c3._rep != 9)) ||
|
||||
((c3._code < 5) && ((c3._val != 19) && (c3._val != 22) && (c3._rep != 4) && (c3._rep != 9)))) {
|
||||
++c3._rep;
|
||||
g_c3._rep = (uint)wor >> 12;
|
||||
if ((g_typlec == 0) && (g_c3._code != 9))
|
||||
if (((g_c3._code > 4) && (g_c3._val != 20) && (g_c3._rep != 3) && (g_c3._rep != 6) && (g_c3._rep != 9)) ||
|
||||
((g_c3._code < 5) && ((g_c3._val != 19) && (g_c3._val != 22) && (g_c3._rep != 4) && (g_c3._rep != 9)))) {
|
||||
++g_c3._rep;
|
||||
}
|
||||
|
||||
c3._freq = ((uint)wor >> 6) & 7;
|
||||
c3._acc = ((uint)wor >> 9) & 7;
|
||||
g_c3._freq = ((uint)wor >> 6) & 7;
|
||||
g_c3._acc = ((uint)wor >> 9) & 7;
|
||||
}
|
||||
|
||||
void charg_car() {
|
||||
int wor, int_;
|
||||
|
||||
wor = swap(READ_LE_UINT16(&mem[adword + g_ptr_word]));
|
||||
wor = swap(READ_LE_UINT16(&g_mem[adword + g_ptr_word]));
|
||||
int_ = wor & 0x3f;
|
||||
|
||||
if ((int_ >= 0) && (int_ <= 13)) {
|
||||
c3._val = int_;
|
||||
c3._code = 5;
|
||||
g_c3._val = int_;
|
||||
g_c3._code = 5;
|
||||
} else if ((int_ >= 14) && (int_ <= 21)) {
|
||||
c3._val = int_;
|
||||
c3._code = 6;
|
||||
g_c3._val = int_;
|
||||
g_c3._code = 6;
|
||||
} else if ((int_ >= 22) && (int_ <= 47)) {
|
||||
int_ = int_ - 22;
|
||||
c3._val = int_;
|
||||
c3._code = g_typcon[int_];
|
||||
g_c3._val = int_;
|
||||
g_c3._code = g_typcon[int_];
|
||||
} else if ((int_ >= 48) && (int_ <= 56)) {
|
||||
c3._val = int_ - 22;
|
||||
c3._code = 4;
|
||||
g_c3._val = int_ - 22;
|
||||
g_c3._code = 4;
|
||||
} else {
|
||||
switch (int_) {
|
||||
case 60:
|
||||
c3._val = 32; /* " " */
|
||||
c3._code = 9;
|
||||
g_c3._val = 32; /* " " */
|
||||
g_c3._code = 9;
|
||||
break;
|
||||
case 61:
|
||||
c3._val = 46; /* "." */
|
||||
c3._code = 9;
|
||||
g_c3._val = 46; /* "." */
|
||||
g_c3._code = 9;
|
||||
break;
|
||||
case 62:
|
||||
c3._val = 35; /* "#" */
|
||||
c3._code = 9;
|
||||
g_c3._val = 35; /* "#" */
|
||||
g_c3._code = 9;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ void charg_car() {
|
|||
|
||||
|
||||
void entroct(byte o) {
|
||||
mem[adtroct * 16 + g_ptr_oct] = o;
|
||||
g_mem[adtroct * 16 + g_ptr_oct] = o;
|
||||
++g_ptr_oct;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ void cctable(tablint &t) {
|
|||
|
||||
tb[0] = 0;
|
||||
for (int k = 0; k <= 255; ++k) {
|
||||
tb[k + 1] = addfix + tb[k];
|
||||
tb[k + 1] = g_addfix + tb[k];
|
||||
t[255 - k] = abs((int)tb[k] + 1);
|
||||
}
|
||||
}
|
||||
|
@ -109,7 +109,7 @@ void regenbruit() {
|
|||
int i = offsetb3 + 8590;
|
||||
int j = 0;
|
||||
do {
|
||||
g_t_cph[j] = READ_LE_UINT16(&mem[adbruit3 + i]);
|
||||
g_t_cph[j] = READ_LE_UINT16(&g_mem[adbruit3 + i]);
|
||||
i += 2;
|
||||
++j;
|
||||
} while (i < offsetb3 + 8790);
|
||||
|
@ -121,9 +121,9 @@ void charge_son() {
|
|||
if (!f.open("sonmus.mor"))
|
||||
error("Missing file - sonmus.mor");
|
||||
|
||||
f.read(&mem[0x7414 * 16 + 0], 273);
|
||||
f.read(&g_mem[0x7414 * 16 + 0], 273);
|
||||
|
||||
g_vm->_soundManager.decodeMusic(&mem[0x7414 * 16], &mem[adson * 16], 273);
|
||||
g_vm->_soundManager.decodeMusic(&g_mem[0x7414 * 16], &g_mem[adson * 16], 273);
|
||||
f.close();
|
||||
}
|
||||
|
||||
|
@ -146,10 +146,10 @@ void charge_bruit() {
|
|||
if (!f.open("bruits")) //Translation: "noise"
|
||||
error("Missing file - bruits");
|
||||
|
||||
f.read(&mem[adbruit * 16 + 0], 250);
|
||||
f.read(&g_mem[adbruit * 16 + 0], 250);
|
||||
for (i = 0; i <= 19013; ++i)
|
||||
mem[adbruit * 16 + 32000 + i] = mem[adbruit5 + i];
|
||||
f.read(&mem[adbruit1 * 16 + offsetb1], 149);
|
||||
g_mem[adbruit * 16 + 32000 + i] = g_mem[adbruit5 + i];
|
||||
f.read(&g_mem[adbruit1 * 16 + offsetb1], 149);
|
||||
|
||||
f.close();
|
||||
}
|
||||
|
@ -158,40 +158,40 @@ void trait_car() {
|
|||
byte d3;
|
||||
int d2, i;
|
||||
|
||||
switch (c2._code) {
|
||||
switch (g_c2._code) {
|
||||
case 9:
|
||||
if (c2._val != ord('#'))
|
||||
for (i = 0; i <= c2._rep; ++i)
|
||||
entroct(c2._val);
|
||||
if (g_c2._val != ord('#'))
|
||||
for (i = 0; i <= g_c2._rep; ++i)
|
||||
entroct(g_c2._val);
|
||||
break;
|
||||
case 5:
|
||||
case 6:
|
||||
if (c2._code == 6)
|
||||
d3 = g_tabdph[(c2._val - 14) << 1];
|
||||
if (g_c2._code == 6)
|
||||
d3 = g_tabdph[(g_c2._val - 14) << 1];
|
||||
else
|
||||
d3 = null;
|
||||
if (c1._code >= 5) {
|
||||
veracf(c2._acc);
|
||||
if (c1._code == 9) {
|
||||
if (g_c1._code >= 5) {
|
||||
veracf(g_c2._acc);
|
||||
if (g_c1._code == 9) {
|
||||
entroct(4);
|
||||
if (d3 == null)
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
else
|
||||
entroct(d3);
|
||||
entroct(22);
|
||||
}
|
||||
}
|
||||
|
||||
switch (c2._rep) {
|
||||
switch (g_c2._rep) {
|
||||
case 0:
|
||||
entroct(0);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
if (d3 == null)
|
||||
if (c3._code == 9)
|
||||
if (g_c3._code == 9)
|
||||
entroct(2);
|
||||
else
|
||||
entroct(4);
|
||||
else if (c3._code == 9)
|
||||
else if (g_c3._code == 9)
|
||||
entroct(0);
|
||||
else
|
||||
entroct(1);
|
||||
|
@ -199,13 +199,13 @@ void trait_car() {
|
|||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
if (c2._rep != 4) {
|
||||
i = c2._rep - 5;
|
||||
if (g_c2._rep != 4) {
|
||||
i = g_c2._rep - 5;
|
||||
do {
|
||||
--i;
|
||||
entroct(0);
|
||||
if (d3 == null)
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
else
|
||||
entroct(d3);
|
||||
entroct(3);
|
||||
|
@ -213,24 +213,24 @@ void trait_car() {
|
|||
}
|
||||
if (d3 == null) {
|
||||
entroct(4);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(0);
|
||||
} else {
|
||||
entroct(0);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(3);
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
if (c2._rep != 7) {
|
||||
i = c2._rep - 8;
|
||||
if (g_c2._rep != 7) {
|
||||
i = g_c2._rep - 8;
|
||||
do {
|
||||
--i;
|
||||
entroct(0);
|
||||
if (d3 == null)
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
else
|
||||
entroct(d3);
|
||||
entroct(3);
|
||||
|
@ -238,32 +238,32 @@ void trait_car() {
|
|||
}
|
||||
if (d3 == null) {
|
||||
entroct(0);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(2);
|
||||
} else {
|
||||
entroct(0);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(0);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
if (c2._rep != 1) {
|
||||
i = c2._rep - 2;
|
||||
if (g_c2._rep != 1) {
|
||||
i = g_c2._rep - 2;
|
||||
do {
|
||||
--i;
|
||||
entroct(0);
|
||||
if (d3 == null)
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
else
|
||||
entroct(d3);
|
||||
entroct(3);
|
||||
} while (i >= 0);
|
||||
}
|
||||
entroct(0);
|
||||
entroct(c2._val);
|
||||
if (c3._code == 9)
|
||||
entroct(g_c2._val);
|
||||
if (g_c3._code == 9)
|
||||
entroct(0);
|
||||
else
|
||||
entroct(1);
|
||||
|
@ -275,16 +275,16 @@ void trait_car() {
|
|||
|
||||
case 2:
|
||||
case 3:
|
||||
d3 = c2._code + 5; // 7 ou 8 => Corresponding vowel
|
||||
if (c1._code > 4) {
|
||||
veracf(c2._acc);
|
||||
if (c1._code == 9) {
|
||||
d3 = g_c2._code + 5; // 7 ou 8 => Corresponding vowel
|
||||
if (g_c1._code > 4) {
|
||||
veracf(g_c2._acc);
|
||||
if (g_c1._code == 9) {
|
||||
entroct(4);
|
||||
entroct(d3);
|
||||
entroct(22);
|
||||
}
|
||||
}
|
||||
i = c2._rep;
|
||||
i = g_c2._rep;
|
||||
assert(i >= 0);
|
||||
if (i != 0) {
|
||||
do {
|
||||
|
@ -294,24 +294,24 @@ void trait_car() {
|
|||
entroct(3);
|
||||
} while (i > 0);
|
||||
}
|
||||
veracf(c3._acc);
|
||||
if (c3._code == 6) {
|
||||
veracf(g_c3._acc);
|
||||
if (g_c3._code == 6) {
|
||||
entroct(4);
|
||||
entroct(g_tabdph[(c3._val - 14) << 1]);
|
||||
entroct(c2._val);
|
||||
entroct(g_tabdph[(g_c3._val - 14) << 1]);
|
||||
entroct(g_c2._val);
|
||||
} else {
|
||||
entroct(4);
|
||||
if (c3._val == 4)
|
||||
if (g_c3._val == 4)
|
||||
entroct(3);
|
||||
else
|
||||
entroct(c3._val);
|
||||
entroct(c2._val);
|
||||
entroct(g_c3._val);
|
||||
entroct(g_c2._val);
|
||||
}
|
||||
break;
|
||||
case 0:
|
||||
case 1:
|
||||
veracf(c2._acc);
|
||||
switch (c3._code) {
|
||||
veracf(g_c2._acc);
|
||||
switch (g_c3._code) {
|
||||
case 2:
|
||||
d2 = 7;
|
||||
break;
|
||||
|
@ -319,66 +319,66 @@ void trait_car() {
|
|||
d2 = 8;
|
||||
break;
|
||||
case 6:
|
||||
d2 = g_tabdph[(c3._val - 14) << 1];
|
||||
d2 = g_tabdph[(g_c3._val - 14) << 1];
|
||||
break;
|
||||
case 5:
|
||||
d2 = c3._val;
|
||||
d2 = g_c3._val;
|
||||
break;
|
||||
default:
|
||||
d2 = 10;
|
||||
break;
|
||||
} // switch c3._code
|
||||
d2 = d2 * 26 + c2._val;
|
||||
d2 = (d2 * 26) + g_c2._val;
|
||||
if (g_tnocon[d2] == 0)
|
||||
d3 = 2;
|
||||
else
|
||||
d3 = 6;
|
||||
if (c2._rep >= 5) {
|
||||
c2._rep = c2._rep - 5;
|
||||
if (g_c2._rep >= 5) {
|
||||
g_c2._rep = g_c2._rep - 5;
|
||||
d3 = 8 - d3; // Swap 2 and 6
|
||||
}
|
||||
if (c2._code == 0) {
|
||||
i = c2._rep;
|
||||
if (g_c2._code == 0) {
|
||||
i = g_c2._rep;
|
||||
if (i != 0) {
|
||||
do {
|
||||
--i;
|
||||
entroct(d3);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(3);
|
||||
} while (i > 0);
|
||||
}
|
||||
entroct(d3);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(4);
|
||||
} else {
|
||||
entroct(d3);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(3);
|
||||
i = c2._rep;
|
||||
i = g_c2._rep;
|
||||
if (i != 0) {
|
||||
do {
|
||||
--i;
|
||||
entroct(d3);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(4);
|
||||
} while (i > 0);
|
||||
}
|
||||
}
|
||||
if (c3._code == 9) {
|
||||
if (g_c3._code == 9) {
|
||||
entroct(d3);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(5);
|
||||
} else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
|
||||
veracf(c3._acc);
|
||||
switch (c3._code) {
|
||||
} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
|
||||
veracf(g_c3._acc);
|
||||
switch (g_c3._code) {
|
||||
case 3:
|
||||
d2 = 8;
|
||||
break;
|
||||
case 6:
|
||||
d2 = g_tabdph[(c3._val - 14) << 1];
|
||||
d2 = g_tabdph[(g_c3._val - 14) << 1];
|
||||
break;
|
||||
case 5:
|
||||
d2 = c3._val;
|
||||
d2 = g_c3._val;
|
||||
break;
|
||||
default:
|
||||
d2 = 7;
|
||||
|
@ -387,47 +387,47 @@ void trait_car() {
|
|||
if (d2 == 4)
|
||||
d2 = 3;
|
||||
|
||||
if (g_intcon[c2._val] != 0)
|
||||
++c2._val;
|
||||
if (g_intcon[g_c2._val] != 0)
|
||||
++g_c2._val;
|
||||
|
||||
if ((c2._val == 17) || (c2._val == 18))
|
||||
c2._val = 16;
|
||||
if ((g_c2._val == 17) || (g_c2._val == 18))
|
||||
g_c2._val = 16;
|
||||
|
||||
entroct(4);
|
||||
entroct(d2);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
}
|
||||
|
||||
break;
|
||||
case 4:
|
||||
veracf(c2._acc);
|
||||
i = c2._rep;
|
||||
veracf(g_c2._acc);
|
||||
i = g_c2._rep;
|
||||
if (i != 0) {
|
||||
do {
|
||||
--i;
|
||||
entroct(2);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(3);
|
||||
} while (i > 0);
|
||||
}
|
||||
entroct(2);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(4);
|
||||
if (c3._code == 9) {
|
||||
if (g_c3._code == 9) {
|
||||
entroct(2);
|
||||
entroct(c2._val);
|
||||
entroct(g_c2._val);
|
||||
entroct(5);
|
||||
} else if ((c3._code != 0) && (c3._code != 1) && (c3._code != 4)) {
|
||||
veracf(c3._acc);
|
||||
switch (c3._code) {
|
||||
} else if ((g_c3._code != 0) && (g_c3._code != 1) && (g_c3._code != 4)) {
|
||||
veracf(g_c3._acc);
|
||||
switch (g_c3._code) {
|
||||
case 3:
|
||||
d2 = 8;
|
||||
break;
|
||||
case 6:
|
||||
d2 = g_tabdph[(c3._val - 14) << 1];
|
||||
d2 = g_tabdph[(g_c3._val - 14) << 1];
|
||||
break;
|
||||
case 5:
|
||||
d2 = c3._val;
|
||||
d2 = g_c3._val;
|
||||
break;
|
||||
default:
|
||||
d2 = 7;
|
||||
|
@ -437,12 +437,12 @@ void trait_car() {
|
|||
if (d2 == 4)
|
||||
d2 = 3;
|
||||
|
||||
if (g_intcon[c2._val] != 0)
|
||||
++c2._val;
|
||||
if (g_intcon[g_c2._val] != 0)
|
||||
++g_c2._val;
|
||||
|
||||
entroct(4);
|
||||
entroct(d2);
|
||||
entroct(g_tabdbc[((c2._val - 26) << 1) + 1]);
|
||||
entroct(g_tabdbc[((g_c2._val - 26) << 1) + 1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -36,16 +36,16 @@
|
|||
namespace Mortevielle {
|
||||
|
||||
void rot_chariot() {
|
||||
c1 = c2;
|
||||
c2 = c3;
|
||||
c3._val = 32;
|
||||
c3._code = 9;
|
||||
g_c1 = g_c2;
|
||||
g_c2 = g_c3;
|
||||
g_c3._val = 32;
|
||||
g_c3._code = 9;
|
||||
}
|
||||
|
||||
void init_chariot() {
|
||||
c3._rep = 0;
|
||||
c3._freq = 0;
|
||||
c3._acc = 0;
|
||||
g_c3._rep = 0;
|
||||
g_c3._freq = 0;
|
||||
g_c3._acc = 0;
|
||||
rot_chariot();
|
||||
rot_chariot();
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ void trait_ph() {
|
|||
g_ptr_tcph = (uint)g_ledeb >> 1;
|
||||
g_ptr_word = 0;
|
||||
do {
|
||||
WRITE_LE_UINT16(&mem[adword + g_ptr_word], g_t_cph[g_ptr_tcph]);
|
||||
WRITE_LE_UINT16(&g_mem[adword + g_ptr_word], g_t_cph[g_ptr_tcph]);
|
||||
g_ptr_word += 2;
|
||||
++g_ptr_tcph;
|
||||
} while (g_ptr_tcph < (int)((uint)g_lefin >> 1));
|
||||
|
@ -101,8 +101,8 @@ void parole(int rep, int ht, int typ) {
|
|||
tempo = kTempoF;
|
||||
else
|
||||
tempo = kTempoM;
|
||||
addfix = (float)((tempo - g_addv[0])) / 256;
|
||||
cctable(tbi);
|
||||
g_addfix = (float)((tempo - g_addv[0])) / 256;
|
||||
cctable(g_tbi);
|
||||
switch (typ) {
|
||||
case 1:
|
||||
charge_bruit();
|
||||
|
@ -117,7 +117,7 @@ void parole(int rep, int ht, int typ) {
|
|||
break;
|
||||
}
|
||||
trait_ph();
|
||||
g_vm->_soundManager.litph(tbi, typ, tempo);
|
||||
g_vm->_soundManager.litph(g_tbi, typ, tempo);
|
||||
if (g_typlec != 0)
|
||||
for (int i = 0; i <= 500; ++i) {
|
||||
g_t_cph[i] = savph[i];
|
||||
|
|
|
@ -52,7 +52,7 @@ void chardes(Common::String filename, int32 skipSize, int length) {
|
|||
int totalLength = length + remainingSkipSize;
|
||||
int memIndx = 0x6000 * 16;
|
||||
while (totalLength > 0) {
|
||||
f.read(&mem[memIndx], 128);
|
||||
f.read(&g_mem[memIndx], 128);
|
||||
testfi();
|
||||
totalLength -= 128;
|
||||
memIndx += 128;
|
||||
|
@ -60,7 +60,7 @@ void chardes(Common::String filename, int32 skipSize, int length) {
|
|||
f.close();
|
||||
|
||||
for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
|
||||
mem[0x7000 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
|
||||
g_mem[0x7000 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
|
||||
}
|
||||
|
||||
void charani(Common::String filename, int32 skipSize, int length) {
|
||||
|
@ -80,7 +80,7 @@ void charani(Common::String filename, int32 skipSize, int length) {
|
|||
int fullLength = length + remainingSkipSize;
|
||||
int memIndx = 0x6000 * 16;
|
||||
while (fullLength > 0) {
|
||||
f.read(&mem[memIndx], 128);
|
||||
f.read(&g_mem[memIndx], 128);
|
||||
testfi();
|
||||
fullLength -= 128;
|
||||
memIndx += 128;
|
||||
|
@ -88,7 +88,7 @@ void charani(Common::String filename, int32 skipSize, int length) {
|
|||
f.close();
|
||||
|
||||
for (int i = remainingSkipSize; i <= length + remainingSkipSize; ++i)
|
||||
mem[0x7314 * 16 + i - remainingSkipSize] = mem[0x6000 * 16 + i];
|
||||
g_mem[0x7314 * 16 + i - remainingSkipSize] = g_mem[0x6000 * 16 + i];
|
||||
}
|
||||
|
||||
void taffich() {
|
||||
|
@ -214,7 +214,7 @@ void taffich() {
|
|||
chardes(filename, lgt, handle);
|
||||
if (g_currGraphicalDevice == MODE_HERCULES) {
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
int palh = READ_LE_UINT16(&mem[(0x7000 * 16) + ((i + 1) << 1)]);
|
||||
int palh = READ_LE_UINT16(&g_mem[(0x7000 * 16) + ((i + 1) << 1)]);
|
||||
alllum[i] = (palh & 15) + (((uint)palh >> 12) & 15) + (((uint)palh >> 8) & 15);
|
||||
}
|
||||
for (int i = 0; i <= 15; ++i) {
|
||||
|
@ -222,7 +222,7 @@ void taffich() {
|
|||
for (int j = 0; j <= 15; ++j)
|
||||
if (alllum[j] > alllum[k])
|
||||
k = j;
|
||||
mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
|
||||
g_mem[(0x7000 * 16) + 2 + (k << 1)] = g_rang[i];
|
||||
alllum[k] = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -183,24 +183,19 @@ byte g_bufcha[391];
|
|||
|
||||
byte g_lettres[7][24];
|
||||
|
||||
byte palher[16];
|
||||
|
||||
uint16 t_mot[maxti + 1];
|
||||
int tay_tchar;
|
||||
ind t_rec[maxtd + 1];
|
||||
//file<ind> sauv_t;
|
||||
//untyped_file fibyte;
|
||||
byte v_lieu[8][25];
|
||||
uint16 g_t_mot[maxti + 1];
|
||||
int g_tay_tchar;
|
||||
ind g_t_rec[maxtd + 1];
|
||||
byte g_v_lieu[8][25];
|
||||
int g_l[108];
|
||||
int tbi[256];
|
||||
chariot c1, c2, c3;
|
||||
float addfix;
|
||||
t_pcga palsav[91];
|
||||
Common::Point tabpal[91][17];
|
||||
t_pcga palcga[91];
|
||||
pattern tpt[15];
|
||||
int g_tbi[256];
|
||||
chariot g_c1, g_c2, g_c3;
|
||||
float g_addfix;
|
||||
Common::Point g_tabpal[91][17];
|
||||
t_pcga g_palcga[91];
|
||||
pattern g_tpt[15];
|
||||
|
||||
byte adcfiec[(4088 * 16) + (311 * 0x80)];
|
||||
byte g_adcfiec[(4088 * 16) + (311 * 0x80)];
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*-------------------- PROCEDURES AND FONCTIONS -----------------------*/
|
||||
|
@ -236,8 +231,8 @@ Common::String copy(const Common::String &s, int idx, size_t size) {
|
|||
/*------------------------------ STUBS ------------------------------*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int port[0xfff];
|
||||
byte mem[65536 * 16];
|
||||
int g_port[0xfff];
|
||||
byte g_mem[65536 * 16];
|
||||
|
||||
void intr(int intNum, registres ®s) {
|
||||
warning("STUBBED: Call to DOS interrupt #%d", intNum);
|
||||
|
|
|
@ -319,24 +319,19 @@ extern byte g_bufcha[391];
|
|||
|
||||
extern byte g_lettres[7][24];
|
||||
|
||||
extern byte palher[16];
|
||||
|
||||
extern uint16 t_mot[maxti + 1];
|
||||
extern int tay_tchar;
|
||||
extern ind t_rec[maxtd + 1];
|
||||
//file<ind> sauv_t;
|
||||
//untyped_file fibyte;
|
||||
extern byte v_lieu[8][25];
|
||||
extern uint16 g_t_mot[maxti + 1];
|
||||
extern int g_tay_tchar;
|
||||
extern ind g_t_rec[maxtd + 1];
|
||||
extern byte g_v_lieu[8][25];
|
||||
extern int g_l[108];
|
||||
extern int tbi[256];
|
||||
extern chariot c1, c2, c3;
|
||||
extern float addfix;
|
||||
extern t_pcga palsav[91];
|
||||
extern Common::Point tabpal[91][17];
|
||||
extern t_pcga palcga[91];
|
||||
extern pattern tpt[15];
|
||||
extern int g_tbi[256];
|
||||
extern chariot g_c1, g_c2, g_c3;
|
||||
extern float g_addfix;
|
||||
extern Common::Point g_tabpal[91][17];
|
||||
extern t_pcga g_palcga[91];
|
||||
extern pattern g_tpt[15];
|
||||
|
||||
extern byte adcfiec[822 * 128];
|
||||
extern byte g_adcfiec[822 * 128];
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/*------------------- PROCEDURES AND FONCTIONS ------------------------*/
|
||||
|
@ -351,8 +346,8 @@ void Val(const Common::String &s, int &V, int Code);
|
|||
/*---------------------------------------------------------------------------*/
|
||||
// TODO: Replace the following with proper implementations, or refactor out the code using them
|
||||
|
||||
extern int port[0xfff];
|
||||
extern byte mem[65536 * 16];
|
||||
extern int g_port[0xfff];
|
||||
extern byte g_mem[65536 * 16];
|
||||
|
||||
#define hires {}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue