Skip to content

Commit

Permalink
190722-05
Browse files Browse the repository at this point in the history
  • Loading branch information
turican0 committed Jul 22, 2019
1 parent a960ec5 commit 510ba74
Show file tree
Hide file tree
Showing 8 changed files with 790 additions and 6,588 deletions.
Binary file modified Debug/biggraphics/bl128n0-0.data
Binary file not shown.
7,227 changes: 684 additions & 6,543 deletions Debug/biggraphics/block128.data

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion remc2/engine/info.x
Original file line number Diff line number Diff line change
Expand Up @@ -7220,4 +7220,13 @@ versus
43434343 266caf
void sub_85C8B_draw_new_game_map_background(Bit8u* a1, Bit8u* a2, int a3, int a4, int a5, int a6)//266c8b

test void sub_81760_new_game_subdraw(type_unk_E17CC_str_0x194* a1x)//262760
test void sub_81760_new_game_subdraw(type_unk_E17CC_str_0x194* a1x)//262760

x_WORD_E1964
514
x_WORD_E1B66

*a5
versus edi

&x_DWORD_17DB70str.x_BYTE_17DB8F
109 changes: 69 additions & 40 deletions remc2/engine/sub_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
//#define SET_OBJECTIVE
//#define SET_LEVEL

#define MOUSE_OFF2
//#define MOUSE_OFF2
//#define OFF_PAUSE_5
#define DEBUG_SEQUENCES
//#define DEBUG_SEQUENCES

//#define TEST_BIG_TEXTURE
#define TEST_BIG_TEXTURE

#define FIX_DETECT_SPEED

Expand All @@ -22,7 +22,7 @@
//#define INTERVAL_SAVE


#define FIX_MOUSE
//#define FIX_MOUSE

int debugafterload = 0;

Expand Down Expand Up @@ -3096,7 +3096,7 @@ type_x_WORD_E2970* sub_824E0(__int16 a1);
// int sub_82510(__int16 a1, int *a2);
void sub_82670();
void sub_82AB0(unsigned __int8 a1);
void sub_82C20(__int16 a1);
void sub_82C20_drawEndGameTable(__int16 a1);
void sub_83250_play_intros(char a1);
void sub_833C0();
int sub_83850_show_welcome_screen();
Expand Down Expand Up @@ -14509,12 +14509,40 @@ Bit8u unk_E17CC_0x194x[0xE6C] = {
};
//_UNKNOWN unk_E192C; // weak
//_UNKNOWN unk_E1960; // weak
__int16 x_WORD_E1964[] = { 116 }; // weak
__int16 x_WORD_E1966[] = { 478 }; // weak
__int16 x_WORD_E196C[] = { 420 }; // weak
__int16 x_WORD_E196E[] = { 820 }; // weak
__int16 x_WORD_E1970 = 33; // weak
char x_BYTE_E1972[484] =
Bit8u x_WORD_E1964x[572] = {
0x74,0x00,0xDE,0x01,0x28,0x00,0x28,0x00,0xA4,0x01,0x34,0x03,0x25,0x00,0x01,0x00,0x00,0x00,0xD5,0x07,0x00,0x00,
0x70,0x01,0xDE,0x01,0x28,0x00,0x28,0x00,0x9A,0x02,0x25,0x03,0x25,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x40,0x02,0xDE,0x01,0x28,0x00,0x28,0x00,0x71,0x03,0xDE,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x04,0x01,0x92,0x01,0x28,0x00,0x28,0x00,0x25,0x02,0x72,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x04,0x01,0x92,0x01,0x28,0x00,0x28,0x00,0xC2,0x01,0x8C,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x01,0x92,0x01,0x28,0x00,0x28,0x00,0x62,0x02,0x9A,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x01,0x92,0x01,0x28,0x00,0x28,0x00,0xFB,0x02,0x8C,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x01,0x92,0x01,0x28,0x00,0x28,0x00,0xDC,0x02,0x2E,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x01,0x92,0x01,0x28,0x00,0x28,0x00,0x84,0x02,0x2A,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x30,0x01,0x92,0x01,0x28,0x00,0x28,0x00,0x18,0x02,0x1C,0x02,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x02,0x32,0x01,0x28,0x00,0x28,0x00,0x36,0x03,0xC2,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7E,0x02,0xBE,0x00,0x28,0x00,0x28,0x00,0xF1,0x03,0x9C,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7E,0x02,0x5C,0x00,0x28,0x00,0x28,0x00,0x22,0x04,0x0C,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xDE,0x01,0x5C,0x00,0x28,0x00,0x28,0x00,0x85,0x03,0x30,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xDE,0x01,0x5C,0x00,0x28,0x00,0x28,0x00,0x31,0x03,0xCA,0x00,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xDE,0x01,0x5C,0x00,0x28,0x00,0x28,0x00,0xAC,0x02,0x06,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7A,0x00,0x60,0x00,0x28,0x00,0x28,0x00,0x12,0x02,0x3C,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7A,0x00,0x60,0x00,0x28,0x00,0x28,0x00,0xAB,0x01,0xCE,0x00,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x7A,0x00,0x60,0x00,0x28,0x00,0x28,0x00,0x42,0x01,0xFE,0x00,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x32,0x01,0xC4,0x00,0x28,0x00,0x28,0x00,0x73,0x02,0xA0,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x01,0x00,0x44,0x00,0x28,0x00,0x28,0x00,0xB4,0x00,0x16,0x01,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x28,0x01,0x44,0x00,0x28,0x00,0x28,0x00,0x61,0x02,0xDA,0x00,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0xE0,0x01,0x00,0x00,0x28,0x00,0x28,0x00,0x46,0x03,0x60,0x00,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x34,0x01,0x00,0x00,0x28,0x00,0x28,0x00,0xA7,0x02,0x7E,0x00,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x34,0x01,0x00,0x00,0x28,0x00,0x28,0x00,0x5D,0x02,0x78,0x00,0x46,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};
/*__int16 x_WORD_E1964[] = { 116 }; // weak*/// *(Bit16s*)&x_WORD_E1964x
//__int16 x_WORD_E1966[] = { 478 }; // weak *(Bit16s*)&x_WORD_E1964x[2+
//__int16 x_WORD_E196C[] = { 420 }; // weak *(Bit16s*)&x_WORD_E1964x[8+
//__int16 x_WORD_E196E[] = { 820 }; // weak *(Bit16s*)&x_WORD_E1964x[10+
//__int16 x_WORD_E1970 = 33; // weak *(Bit16s*)&x_WORD_E1964x[12+
/*char x_BYTE_E1972[484] = x_WORD_E1964x[14+
{
'\x02',
'\0',
Expand Down Expand Up @@ -15000,12 +15028,12 @@ char x_BYTE_E1972[484] =
'\0',
'!',
'\0'
}; // idb
__int16 x_WORD_E1B66 = 679; // weak
__int16 x_WORD_E1B68 = 126; // weak
char x_BYTE_E1B82 = '\x02'; // weak
char x_BYTE_E1B9C[8] = { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' }; // idb
char x_BYTE_E1BA4[8] = { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' }; // idb
}; // idb*/
//__int16 x_WORD_E1B66 = 679; // weak *(Bit16s*)&x_WORD_E1964x[0x202+
//__int16 x_WORD_E1B68 = 126; // weak *(Bit16s*)&x_WORD_E1964x[0x204+
//char x_BYTE_E1B82 = '\x02'; // weak x_WORD_E1964x[0x21E+
char x_BYTE_E1B9C[8] = { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' }; // idb x_WORD_E1964x[0x238+
char x_BYTE_E1BA4[8] = { '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0' }; // idb x_WORD_E1964x[0x240+
Bit8u off_E1BAC[4096] =//buttons positions
{
//adress //var1 //var4 //var5 //var 26(13) //var 28(14) //var26+4(17) //var 26+5(18)
Expand Down Expand Up @@ -59623,7 +59651,7 @@ char sub_46570(unsigned __int16 a1, __int16 a2)//227570


#ifdef DEBUG_SEQUENCES
Bit8u origbyte20 = 0;
/*Bit8u origbyte20 = 0;
Bit8u remakebyte20 = 0;
int comp20;
if (debugafterload)
Expand All @@ -59646,7 +59674,7 @@ char sub_46570(unsigned __int16 a1, __int16 a2)//227570
//comp20 = compare_with_sequence((char*)"0022860F-003AA0A4", x_DWORD_180628b_screen_buffer, 0x3aa0a4, debugcounter_47560, 320 * 200, 320 * 200, &origbyte20, &remakebyte20);

debugcounter_227570++;
}
}*/
#endif DEBUG_SEQUENCES


Expand Down Expand Up @@ -64285,7 +64313,7 @@ type_str_0x6E8E* pre_sub_4A190(Bit32u adress, Bit16s* a1,int type)//pre 22b190
}
case 0x201fc0: {
sub_20FC0((type_str_0x6E8E*)a1);
return fix_it_4A190();
return 0;
break;
}

Expand Down Expand Up @@ -101720,6 +101748,7 @@ void /*__fastcall*/ sub_76FA0_main_menu(/*int a1, */int a2, Bit16u a3x)//257fa0
x_WORD_17DE26 = v4;
//x_DWORD_17DE22 = v3;
//dos_setvect(9, sub_76F40, 0);
VGA_cleanKeyBuffer();
if (x_BYTE_E29E1 || x_D41A0_BYTEARRAY_4_struct.setting_byte1_22 & 0x10 || (sub_77350_new_game_dialog(0), !x_WORD_E29DC))
{
x_D41A0_BYTEARRAY_4_struct.setting_byte1_22 &= 0xEFu;
Expand Down Expand Up @@ -106088,7 +106117,7 @@ void sub_7D400_draw_texts_and_play_sounds(int a1, __int16 a2, __int16 a3, char a
v39 = j___clock();
while (x_BYTE_E25ED_db_str[v4x].word_8)
{
if (x_BYTE_E1B82 != 1 || x_BYTE_E25ED_db_str[v4x].word_12 != 85 && x_BYTE_E25ED_db_str[v4x].word_12 != 86)
if (x_WORD_E1964x[0x21E] != 1 || x_BYTE_E25ED_db_str[v4x].word_12 != 85 && x_BYTE_E25ED_db_str[v4x].word_12 != 86)
sub_81CA0(a2, v5, a2, a3, &x_BYTE_E25ED_db_str[v4x]);
//v4 += 15;
v4x++;
Expand Down Expand Up @@ -106321,7 +106350,7 @@ posistruct* xy_DWORD_17DEC8_spritestr;
{
if (x_DWORD_17DB70str.x_WORD_17DB8A == x_WORD_E2970x[kk].word_6)
{
sub_7DA70(x_WORD_E2970x[kk].word_8, x_WORD_E2970x[kk].word_10, x_WORD_E196C[11 * x_WORD_E2970x[kk].word_4], x_WORD_E196E[11 * x_WORD_E2970x[kk].word_4], a2, a3);
sub_7DA70(x_WORD_E2970x[kk].word_8, x_WORD_E2970x[kk].word_10, *(Bit16s*)&x_WORD_E1964x[8 + 22 * x_WORD_E2970x[kk].word_4], *(Bit16s*)&x_WORD_E1964x[10 + 22 * x_WORD_E2970x[kk].word_4], a2, a3);
return;
}
}
Expand All @@ -106336,7 +106365,7 @@ posistruct* xy_DWORD_17DEC8_spritestr;
//VGA_Debug_Blit(640, 480, x_DWORD_180628b_screen_buffer);
if ((v41x != -1) && (v40x != -1))
return;
sub_7DA70(unk_E17CC_str_0x194[v41x].word_12_x, unk_E17CC_str_0x194[v41x].word_14_y, x_WORD_E1B66, x_WORD_E1B68, a2, a3);
sub_7DA70(unk_E17CC_str_0x194[v41x].word_12_x, unk_E17CC_str_0x194[v41x].word_14_y, *(Bit16s*)&x_WORD_E1964x[0x202], *(Bit16s*)&x_WORD_E1964x[0x204], a2, a3);
}
// 8C250: using guessed type x_DWORD memset(x_DWORD, x_DWORD, x_DWORD);
// 98786: using guessed type int /*__fastcall*/ j___clock(x_DWORD, x_DWORD, x_DWORD);
Expand Down Expand Up @@ -106526,9 +106555,9 @@ void sub_7DD70()//25ed70
x_WORD_E2970x[ir].word_12 = 2;
x_WORD_E2970x[ir].word_14 = 70;
}
x_BYTE_E1972[22 * x_WORD_E2970x[ir].word_4] = 1;
x_WORD_E1964x[14 + 22 * x_WORD_E2970x[ir].word_4] = 1;
//result = 22 * x_WORD_E2970x[ir].word_4;
*(__int16 *)((char *)&x_WORD_E1970 + 22 * x_WORD_E2970x[ir].word_4) = 37;
*(__int16 *)((char *)&x_WORD_E1964x+12+ 22 * x_WORD_E2970x[ir].word_4) = 37;
break;
}
}
Expand Down Expand Up @@ -107250,8 +107279,8 @@ int sub_7EAE0_new_game_draw(Bit16s* posx, Bit16s* posy, __int16* a3, __int16* a4
type_x_WORD_E2970* v8x; // eax
//char *v9; // eax
int v9x;
int v10x; // ecx
int v11x; // edx
//int v10x; // ecx
//int v11x; // edx
//Bit16s* v12; // eax
int v12x;
int v13; // ecx
Expand Down Expand Up @@ -107392,8 +107421,8 @@ int sub_7EAE0_new_game_draw(Bit16s* posx, Bit16s* posy, __int16* a3, __int16* a4
{
if (x_DWORD_17DB70str.x_WORD_17DB8A == x_WORD_E2970x[ii].word_6)
{
*posx = x_WORD_E1964[11 * x_WORD_E2970x[ii].word_4];
*posy = x_WORD_E1966[11 * x_WORD_E2970x[ii].word_4];
*posx = *(Bit16s*)&x_WORD_E1964x[22 * x_WORD_E2970x[ii].word_4];
*posy = *(Bit16s*)&x_WORD_E1964x[2 + 22 * x_WORD_E2970x[ii].word_4];
*a5 = 3;
break;
}
Expand Down Expand Up @@ -107565,15 +107594,15 @@ int sub_7EAE0_new_game_draw(Bit16s* posx, Bit16s* posy, __int16* a3, __int16* a4
v8x = sub_824E0(x_DWORD_17DB70str.x_WORD_17DB8A);
if (!v8x)
goto LABEL_10;
*posx = x_WORD_E1964[11 * v8x->word_4];
*posx = *(Bit16s*)& x_WORD_E1964x[22 * v8x->word_4];
v7 = 11 * v8x->word_4;
}
else
{
v7 = 11 * x_DWORD_17DB70str.x_WORD_17DB8A;
*posx = x_WORD_E1964[v7];
*posx = *(Bit16s*)&x_WORD_E1964x[2 * v7];
}
*posy = x_WORD_E1966[v7];
*posy = *(Bit16s*)&x_WORD_E1964x[2 + 2*v7];
LABEL_10:
if (x_BYTE_17DF10_get_key_scancode || x_WORD_17DEEE)
{
Expand All @@ -107597,20 +107626,20 @@ int sub_7EAE0_new_game_draw(Bit16s* posx, Bit16s* posy, __int16* a3, __int16* a4
v9x++;
v70x++;
}
v10x = v64x;
//v10x = v64x;
if (v64x!=-1)
{
//LOWORD(v9) = v64[2];
unk_E17CC_str_0x194[v64x-1].byte_18_act = 2;
v70x = unk_E17CC_str_0x194[v64x].word_4;
unk_E17CC_str_0x194[v10x].word_4 = 0;
unk_E17CC_str_0x194[v64x].word_4 = 0;
}
sub_81760_new_game_subdraw(&unk_E17CC_str_0x194[v9x]);
if (v64x!=-1)
{
v11x = v64x;
//v11x = v64x;
unk_E17CC_str_0x194[v64x - 1].byte_18_act = 1;
unk_E17CC_str_0x194[v11x].word_4 = v70x;
unk_E17CC_str_0x194[v64x].word_4 = v70x;
}
LABEL_92:
if (x_WORD_E29D6_not_movex)
Expand Down Expand Up @@ -107689,7 +107718,7 @@ int sub_7EAE0_new_game_draw(Bit16s* posx, Bit16s* posy, __int16* a3, __int16* a4
{
v36 = x_DWORD_17DB70str.x_WORD_17DB8A;
LABEL_107:
sub_82C20(v36);
sub_82C20_drawEndGameTable(v36);
goto LABEL_108;
}
if (v35 == 5)
Expand Down Expand Up @@ -109415,7 +109444,7 @@ void sub_81760_new_game_subdraw(type_unk_E17CC_str_0x194* a1x)//262760

v1 = 0;
v24 = 0;
if (x_BYTE_E1B82 == 1)
if (x_WORD_E1964x[0x21E] == 1)
{
//_disable();
temp_screen_buffer = x_DWORD_180628b_screen_buffer;
Expand Down Expand Up @@ -109972,7 +110001,7 @@ void sub_81EE0_draw_and_sound_dragon_and_fire(int a1, int a2, int a3, signed __i
v7[17] = v7[15];
*(x_DWORD *)v7 = v8;
}
if (x_BYTE_E1B82 == 1)
if (x_WORD_E1964x[0x21E] == 1)
{
//_disable();
v41 = x_DWORD_18062C_resolution_x;
Expand Down Expand Up @@ -110381,7 +110410,7 @@ void sub_82AB0(unsigned __int8 a1)//263ab0
// 17DDC8: using guessed type int x_DWORD_17DDC8[];

//----- (00082C20) --------------------------------------------------------
void sub_82C20(__int16 a1)//263c20
void sub_82C20_drawEndGameTable(__int16 a1)//263c20
{
//x_WORD *v1; // edx
__int16 v2; // si
Expand Down
16 changes: 16 additions & 0 deletions remc2/portability/port_sdl_vga_mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1466,6 +1466,22 @@ Bit16u fixchar(Bit16u loclastchar) {

return loclastchar;
}


void VGA_cleanKeyBuffer() {
//bool locpressed = pressed;
Bit16u loclastchar = lastchar;
lastchar = 0;
loclastchar = fixchar(loclastchar);
while(loclastchar!=0)
{
//bool locpressed = pressed;
loclastchar = lastchar;
lastchar = 0;
loclastchar = fixchar(loclastchar);
}
}

Bit16u VGA_read_char_from_buffer() {
bool locpressed = pressed;
Bit16u loclastchar = lastchar;
Expand Down
1 change: 1 addition & 0 deletions remc2/portability/port_sdl_vga_mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ void VGA_Set_mouse(Bit16s a1, Bit16s a2);
void setPress(bool locpressed, Bit16u loclastchar);

void VGA_mouse_clear_keys();
void VGA_cleanKeyBuffer();

extern Bit8u x_BYTE_1806E4; // weak//3516e4
extern Bit8s x_BYTE_180664[128]; // idb
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include <stdio.h>
#include <stdlib.h>

//#define level1
#define level2
#define level1
//#define level2
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

unsigned char get32colorIndex(unsigned char* content_data32, int xindex2, int yindex2, int xpos, int ypos)
Expand Down Expand Up @@ -308,8 +308,8 @@ int main(int argc, char* argv[]) {
inindex = true;
*/
bool inindex = false;
if(get32colorIndex(content_data32, xindex, yindex, xpos, ypos)==1)inindex = true;
if (get32colorIndex(content_data32, xindex, yindex, xpos, ypos) == 2)inindex = true;
//if(get32colorIndex(content_data32, xindex, yindex, xpos, ypos)==1)inindex = true;
//if (get32colorIndex(content_data32, xindex, yindex, xpos, ypos) == 2)inindex = true;
//0 1 2 3 4 5
//int counterremoved = 0;
//unsigned int removed[256];
Expand All @@ -320,6 +320,12 @@ int main(int argc, char* argv[]) {
int best = 1000;
x = 0;
for (int j = 0; j < szstd / 3; j++)
#ifdef level1
//if ((j != 0x3d)&& (j != 0x3e))
#endif level1
#ifdef level2
if ((j != 0x67))
#endif level2
{
int score = 0;
score += abs(content_data[i * 3 + 0] - content_stdpal[j * 3 + 0]);
Expand Down
Binary file not shown.

0 comments on commit 510ba74

Please sign in to comment.