From b62d9c72c460c6cc9803c21e5d30dde5410cf48c Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Sun, 26 Aug 2018 19:01:55 -0500 Subject: [PATCH 1/5] Update scrollrt.cpp --- Source/scrollrt.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 52b0e6968..3046796dd 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -999,7 +999,7 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4, if ( v49 ) { v16 = &item[v49-1]; - if ( !v16->_iPostDraw && (unsigned char)v49 <= 0x7Fu ) + if ( !v16->_iPostDraw && (unsigned char)v49 <= MAXITEMS ) { v17 = (char *)v16->_iAnimData; if ( v17 ) @@ -1048,7 +1048,7 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4, { v23 = -1 - v41; draw_monster_num = -1 - v41; - if ( (unsigned int)(-1 - v41) < 0xC8 ) + if ( (unsigned int)(-1 - v41) < MAXMONSTERS ) { v24 = &monster[v23]; if ( !(v24->_mFlags & 1) ) @@ -1105,7 +1105,7 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4, { v31 = v40 - 1; draw_monster_num = v40 - 1; - if ( (unsigned int)(v40 - 1) < 0xC8 ) + if ( (unsigned int)(v40 - 1) < MAXMONSTERS ) { v32 = &monster[v31]; if ( !(v32->_mFlags & 1) ) @@ -1136,7 +1136,7 @@ void __fastcall scrollrt_draw_clipped_dungeon(char *a1, int sx, int sy, int a4, v36 = &item[v49-1]; if ( v36->_iPostDraw ) { - if ( (unsigned char)v49 <= 0x7Fu ) + if ( (unsigned char)v49 <= MAXITEMS ) { v37 = (char *)v36->_iAnimData; if ( v37 ) @@ -1183,7 +1183,7 @@ void __fastcall DrawClippedMonster(int x, int y, int a3, int a4, int mon_id, int CMonster *v11; // eax char mon_ida; // [esp+1Ch] [ebp+10h] - if ( (unsigned int)mon_id < 0xC8 ) + if ( (unsigned int)mon_id < MAXMONSTERS ) { v7 = mon_id; v8 = (char *)monster[mon_id]._mAnimData; @@ -1270,7 +1270,7 @@ void __fastcall DrawClippedObject(int x, int y, int a3, int a4, int pre_flag, in v11 = a4; v12 = a3 - object[v10]._oAnimWidth2; } - if ( v9 < 0x7Fu ) + if ( v9 < MAXOBJECTS ) { v15 = (char *)object[v10]._oAnimData; if ( v15 ) @@ -1672,7 +1672,7 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int if ( v52 ) { v19 = &item[v52-1]; - if ( !v19->_iPostDraw && (unsigned char)v52 <= 0x7Fu ) + if ( !v19->_iPostDraw && (unsigned char)v52 <= MAXITEMS ) { v20 = (char *)v19->_iAnimData; if ( v20 ) @@ -1721,7 +1721,7 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int { v26 = -1 - v44; draw_monster_num = -1 - v44; - if ( (unsigned int)(-1 - v44) < 0xC8 ) + if ( (unsigned int)(-1 - v44) < MAXMONSTERS ) { v27 = &monster[v26]; if ( !(v27->_mFlags & 1) ) @@ -1779,7 +1779,7 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int { v34 = v43 - 1; draw_monster_num = v43 - 1; - if ( (unsigned int)(v43 - 1) < 0xC8 ) + if ( (unsigned int)(v43 - 1) < MAXMONSTERS ) { v35 = &monster[v34]; if ( !(v35->_mFlags & 1) ) @@ -1811,7 +1811,7 @@ void __fastcall scrollrt_draw_clipped_dungeon_2(char *buffer, int x, int y, int v39 = &item[v52-1]; if ( v39->_iPostDraw ) { - if ( (unsigned char)v52 <= 0x7Fu ) + if ( (unsigned char)v52 <= MAXITEMS ) { v40 = (char *)v39->_iAnimData; if ( v40 ) @@ -2274,7 +2274,7 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5 if ( v51 ) { v18 = &item[v51-1]; - if ( !v18->_iPostDraw && (unsigned char)v51 <= 0x7Fu ) + if ( !v18->_iPostDraw && (unsigned char)v51 <= MAXITEMS ) { v19 = (char *)v18->_iAnimData; if ( v19 ) @@ -2323,7 +2323,7 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5 { v25 = -1 - v43; draw_monster_num = -1 - v43; - if ( (unsigned int)(-1 - v43) < 0xC8 ) + if ( (unsigned int)(-1 - v43) < MAXMONSTERS ) { v26 = &monster[v25]; if ( !(v26->_mFlags & 1) ) @@ -2380,7 +2380,7 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5 { v33 = v42 - 1; draw_monster_num = v42 - 1; - if ( (unsigned int)(v42 - 1) < 0xC8 ) + if ( (unsigned int)(v42 - 1) < MAXMONSTERS ) { v34 = &monster[v33]; if ( !(v34->_mFlags & 1) ) @@ -2411,7 +2411,7 @@ void __fastcall scrollrt_draw_dungeon(char *buffer, int x, int y, int a4, int a5 v38 = &item[v51-1]; if ( v38->_iPostDraw ) { - if ( (unsigned char)v51 <= 0x7Fu ) + if ( (unsigned char)v51 <= MAXITEMS ) { v39 = (char *)v38->_iAnimData; if ( v39 ) @@ -2458,7 +2458,7 @@ void __fastcall DrawMonster(int x, int y, int a3, int a4, int mon_id, int a6, in CMonster *v11; // eax char mon_ida; // [esp+1Ch] [ebp+10h] - if ( (unsigned int)mon_id < 0xC8 ) + if ( (unsigned int)mon_id < MAXMONSTERS ) { v7 = mon_id; v8 = (char *)monster[mon_id]._mAnimData; @@ -2543,7 +2543,7 @@ void __fastcall DrawObject(int x, int y, int a3, int a4, int pre_flag, int a6, i v11 = a4; v12 = a3 - object[v10]._oAnimWidth2; } - if ( v9 < 0x7Fu ) + if ( v9 < MAXOBJECTS ) { v15 = (char *)object[v10]._oAnimData; if ( v15 ) From 14a0241d4de4b0ae8db66e57208480172cf86195 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Sun, 26 Aug 2018 19:04:35 -0500 Subject: [PATCH 2/5] render.cpp -> take out the trash --- Source/render.cpp | 671 ++++++++++++++++------------------------------ 1 file changed, 225 insertions(+), 446 deletions(-) diff --git a/Source/render.cpp b/Source/render.cpp index b989e32e8..19128b5ba 100644 --- a/Source/render.cpp +++ b/Source/render.cpp @@ -95,13 +95,10 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) unsigned int chk_sh_and; // ecx MAPDST unsigned char chk_andone; // cf unsigned int n_draw_shift; // ecx MAPDST - unsigned int temp32; // eax MAPDST unsigned int x_minus; // ecx MAPDST unsigned int y_minus; // ecx MAPDST char *tmp_dst; // edi MAPDST signed int junk_v134; // ebp - char *junk_v139; // esi - char temp8; // al MAPDST short temp16; // ax MAPDST char junk_minus; // bp int junk_v180; // ebp @@ -1167,14 +1164,10 @@ LABEL_11: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --j; } while ( j ); @@ -1184,12 +1177,10 @@ LABEL_11: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --j; } while ( j ); @@ -1244,21 +1235,18 @@ LABEL_265: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - temp8 = *pdung_cels; + *tmp_pbDst = *pdung_cels; pdung_cels += 2; - *tmp_pbDst = temp8; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1271,33 +1259,25 @@ LABEL_265: chk_sh_and = dung_and80 >> 1; if ( !(dung_and80 & 1) ) goto LABEL_265; - temp8 = *pdung_cels++; - *tmp_pbDst++ = temp8; + *tmp_pbDst++ = *pdung_cels++; if ( chk_sh_and ) { LABEL_258: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - junk_v139 = pdung_cels + 1; - tmp_dst = tmp_pbDst + 1; - temp8 = *junk_v139; - pdung_cels = junk_v139 + 1; - *tmp_dst = temp8; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = pdung_cels[1]; + pdung_cels += 2; + tmp_pbDst += 2; } if ( n_draw_shift ) { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1338,14 +1318,10 @@ LABEL_268: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1356,21 +1332,18 @@ LABEL_268: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + *tmp_pbDst = *((_WORD *)pdung_cels + 1); pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1403,14 +1376,10 @@ LABEL_268: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1421,21 +1390,18 @@ LABEL_268: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + *tmp_pbDst = *((_WORD *)pdung_cels + 1); pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1466,14 +1432,10 @@ LABEL_268: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; } junk_v180 = junk_minus & 2; if ( junk_v180 ) @@ -1489,19 +1451,16 @@ LABEL_268: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; } junk_v180 = junk_minus & 2; if ( junk_v180 ) { - temp16 = *(_WORD *)pdung_cels; + *tmp_pbDst = *(_WORD *)pdung_cels; pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } } @@ -1520,14 +1479,10 @@ LABEL_268: { for ( n_draw_shift = y_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; } junk_v180 &= 2u; if ( junk_v180 ) @@ -1543,19 +1498,16 @@ LABEL_268: { for ( n_draw_shift = y_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; } junk_v180 &= 2u; if ( junk_v180 ) { - temp16 = *(_WORD *)pdung_cels; + *tmp_pbDst = *(_WORD *)pdung_cels; pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } } @@ -1595,14 +1547,10 @@ LABEL_268: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1613,21 +1561,18 @@ LABEL_268: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + *tmp_pbDst = *((_WORD *)pdung_cels + 1); pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -1645,14 +1590,10 @@ LABEL_268: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --j; } while ( j ); @@ -1662,12 +1603,10 @@ LABEL_268: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --j; } while ( j ); @@ -1695,14 +1634,10 @@ LABEL_268: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) { @@ -1717,18 +1652,15 @@ LABEL_268: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + *tmp_pbDst = *(_WORD *)pdung_cels; pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } } @@ -1744,14 +1676,10 @@ LABEL_268: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --j; } while ( j ); @@ -1761,12 +1689,10 @@ LABEL_268: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --j; } while ( j ); @@ -1890,9 +1816,8 @@ LABEL_378: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -2799,16 +2724,11 @@ LABEL_50: { do { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; --n_draw_shift; } @@ -2839,16 +2759,11 @@ LABEL_50: { do { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; --n_draw_shift; } @@ -2873,16 +2788,11 @@ LABEL_50: { for ( n_draw_shift = (unsigned int)(32 - xx_32) >> 2; n_draw_shift; --n_draw_shift ) { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) @@ -2906,16 +2816,11 @@ LABEL_50: break; for ( n_draw_shift = (unsigned int)(32 - yy_32) >> 2; n_draw_shift; --n_draw_shift ) { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; } if ( (32 - (_BYTE)yy_32) & 2 ) @@ -2961,16 +2866,11 @@ LABEL_50: { do { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; --n_draw_shift; } @@ -3020,16 +2920,11 @@ LABEL_50: { for ( n_draw_shift = (unsigned int)(32 - xx_32) >> 2; n_draw_shift; --n_draw_shift ) { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) @@ -3428,7 +3323,6 @@ void __fastcall drawUpperScreen(unsigned char *pbDst) signed int yy_32; // edx MAPDST unsigned int dung_and80; // eax MAPDST unsigned int chk_sh_and; // ecx MAPDST - unsigned char temp8; // al MAPDST unsigned int n_draw_shift; // ecx MAPDST signed int i; // edx MAPDST signed int j; // ecx MAPDST @@ -3533,9 +3427,8 @@ LABEL_22: if ( !chk_sh_and ) continue; } - temp8 = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( temp8 ) + if ( chk_sh_and & 1 ) { *(_WORD *)tmp_pbDst = *(_WORD *)pdung_cels; pdung_cels += 2; @@ -4201,9 +4094,8 @@ LABEL_58: if ( !chk_sh_and ) continue; } - temp8 = chk_sh_and & 1; n_draw_shift = dung_and80 >> 2; - if ( temp8 ) + if ( chk_sh_and & 1 ) { *(_WORD *)tmp_pbDst = 0; tmp_pbDst += 2; @@ -4628,9 +4520,8 @@ LABEL_420: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -4676,9 +4567,8 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -4735,9 +4625,8 @@ LABEL_430: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -4800,9 +4689,8 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -4859,9 +4747,8 @@ LABEL_430: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -4925,9 +4812,8 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -5032,9 +4918,8 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -6287,14 +6172,10 @@ LABEL_11: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --j; } while ( j ); @@ -6310,12 +6191,10 @@ LABEL_11: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --j; } while ( j ); @@ -6365,21 +6244,18 @@ LABEL_287: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - temp8 = *pdung_cels; + *tmp_pbDst = *pdung_cels; pdung_cels += 2; - *tmp_pbDst = temp8; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -6392,8 +6268,7 @@ LABEL_287: chk_sh_and = dung_and80 >> 1; if ( !(dung_and80 & 1) ) goto LABEL_287; - temp8 = *pdung_cels++; - *tmp_pbDst++ = temp8; + *tmp_pbDst++ = *pdung_cels++; if ( chk_sh_and ) { LABEL_280: @@ -6411,14 +6286,10 @@ LABEL_280: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -6498,14 +6369,10 @@ LABEL_308: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -6516,9 +6383,8 @@ LABEL_308: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + *tmp_pbDst = *((_WORD *)pdung_cels + 1); pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; --n_draw_shift; /* check */ } @@ -6526,12 +6392,10 @@ LABEL_308: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -6571,14 +6435,10 @@ LABEL_308: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -6589,21 +6449,18 @@ LABEL_308: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + *tmp_pbDst = *((_WORD *)pdung_cels + 1); pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -6643,14 +6500,10 @@ LABEL_326: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) { @@ -6665,18 +6518,15 @@ LABEL_326: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + *tmp_pbDst = *(_WORD *)pdung_cels; pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } } @@ -6711,14 +6561,10 @@ LABEL_336: { for ( n_draw_shift = y_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; } if ( (32 - (_BYTE)yy_32) & 2 ) { @@ -6733,18 +6579,15 @@ LABEL_336: { for ( n_draw_shift = y_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; } if ( (32 - (_BYTE)yy_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + *tmp_pbDst = *(_WORD *)pdung_cels; pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } } @@ -6777,14 +6620,10 @@ LABEL_364: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --j; } while ( j ); @@ -6800,12 +6639,10 @@ LABEL_364: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --j; } while ( j ); @@ -6849,14 +6686,10 @@ LABEL_364: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --n_draw_shift; } while ( n_draw_shift ); @@ -6867,9 +6700,8 @@ LABEL_364: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + *tmp_pbDst = *((_WORD *)pdung_cels + 1); pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } if ( n_draw_shift ) @@ -6916,14 +6748,10 @@ LABEL_389: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; --j; } while ( j ); @@ -6939,12 +6767,10 @@ LABEL_389: j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; --j; } while ( j ); @@ -6976,14 +6802,10 @@ LABEL_389: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; + tmp_pbDst[3] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - temp32 = __ROR4__(temp32, 8); - *tmp_dst = temp32; - tmp_dst += 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) { @@ -6998,18 +6820,15 @@ LABEL_389: { for ( n_draw_shift = x_minus >> 2; n_draw_shift; --n_draw_shift ) { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); - tmp_pbDst = tmp_dst + 2; + tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + *tmp_pbDst = *(_WORD *)pdung_cels; pdung_cels += 4; - *tmp_pbDst = temp16; tmp_pbDst += 2; } } @@ -7184,7 +7003,7 @@ LABEL_252: } else { - pdung_cels = &pdung_cels[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; tmp_pbDst += 32; } tmp_pbDst -= 800; @@ -7216,7 +7035,7 @@ LABEL_252: } else { - pdung_cels = &pdung_cels[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; tmp_pbDst += 32; } tmp_pbDst -= 800; @@ -7253,8 +7072,8 @@ LABEL_252: } else { - pdung_cels = &pdung_cels[-i + 32]; - tmp_pbDst = &tmp_pbDst[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; + tmp_pbDst = &tmp_pbDst[32 - i]; } tmp_pbDst -= 800; if ( !i ) @@ -7285,8 +7104,8 @@ LABEL_252: } else { - pdung_cels = &pdung_cels[-i + 32]; - tmp_pbDst = &tmp_pbDst[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; + tmp_pbDst = &tmp_pbDst[32 - i]; } tmp_pbDst = &tmp_pbDst[i - 800]; i += 2; @@ -7323,7 +7142,7 @@ LABEL_252: } else { - pdung_cels = &pdung_cels[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; tmp_pbDst += 32; } tmp_pbDst -= 800; @@ -7390,8 +7209,8 @@ LABEL_252: } else { - pdung_cels = &pdung_cels[-i + 32]; - tmp_pbDst = &tmp_pbDst[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; + tmp_pbDst = &tmp_pbDst[32 - i]; } tmp_pbDst -= 800; if ( !i ) @@ -7578,16 +7397,11 @@ LABEL_62: { do { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; --n_draw_shift; } @@ -7622,16 +7436,11 @@ LABEL_62: { do { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; --n_draw_shift; } @@ -7672,16 +7481,11 @@ LABEL_80: { for ( n_draw_shift = (unsigned int)(32 - yy_32) >> 2; n_draw_shift; --n_draw_shift ) { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; } if ( (32 - (_BYTE)yy_32) & 2 ) @@ -7709,16 +7513,11 @@ LABEL_80: { for ( n_draw_shift = (unsigned int)(32 - xx_32) >> 2; n_draw_shift; --n_draw_shift ) { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) @@ -7807,16 +7606,11 @@ LABEL_98: { do { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; --n_draw_shift; } @@ -7885,16 +7679,11 @@ LABEL_117: { for ( n_draw_shift = (unsigned int)(32 - xx_32) >> 2; n_draw_shift; --n_draw_shift ) { - _EAX = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + tmp_pbDst[2] = _EBX[pdung_cels[2]]; + tmp_pbDst[3] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR4__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_DWORD *)tmp_pbDst = __ROR4__(_EAX, 8); tmp_pbDst += 4; } if ( (32 - (_BYTE)xx_32) & 2 ) @@ -8356,7 +8145,6 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) signed int tile_42_45; // eax MAPDST unsigned int world_tbl; // ecx MAPDST unsigned int n_draw_shift; // ecx MAPDST - int temp32; // eax MAPDST unsigned int dung_and80; // eax MAPDST signed int i; // edx MAPDST signed int j; // ecx MAPDST @@ -8531,7 +8319,7 @@ LABEL_232: } else { - pdung_cels = &pdung_cels[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; tmp_pbDst += 32; } tmp_pbDst -= 800; @@ -8563,7 +8351,7 @@ LABEL_232: } else { - pdung_cels = &pdung_cels[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; tmp_pbDst += 32; } tmp_pbDst -= 800; @@ -8600,8 +8388,8 @@ LABEL_232: } else { - pdung_cels = &pdung_cels[-i + 32]; - tmp_pbDst = &tmp_pbDst[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; + tmp_pbDst = &tmp_pbDst[32 - i]; } tmp_pbDst -= 800; if ( !i ) @@ -8632,8 +8420,8 @@ LABEL_232: } else { - pdung_cels = &pdung_cels[-i + 32]; - tmp_pbDst = &tmp_pbDst[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; + tmp_pbDst = &tmp_pbDst[32 - i]; } tmp_pbDst = &tmp_pbDst[i - 800]; i += 2; @@ -8670,7 +8458,7 @@ LABEL_232: } else { - pdung_cels = &pdung_cels[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; tmp_pbDst += 32; } tmp_pbDst -= 800; @@ -8730,8 +8518,8 @@ LABEL_232: } else { - pdung_cels = &pdung_cels[-i + 32]; - tmp_pbDst = &tmp_pbDst[-i + 32]; + pdung_cels = &pdung_cels[32 - i]; + tmp_pbDst = &tmp_pbDst[32 - i]; } tmp_pbDst -= 800; if ( !i ) @@ -8784,24 +8572,15 @@ LABEL_232: x32_temp = xx_32; if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - l_index = 0; + l_index = 0; /* remove */ j = 8; do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = l_tbl[pdung_cels[0]]; + tmp_pbDst[1] = l_tbl[pdung_cels[1]]; + tmp_pbDst[2] = l_tbl[pdung_cels[2]]; + tmp_pbDst[3] = l_tbl[pdung_cels[3]]; pdung_cels += 4; - temp32 = __ROR4__(temp32, 16); - l_index = temp32; - _LOBYTE(pbDst) = l_tbl[l_index]; - l_index = BYTE1(temp32); - BYTE1(pbDst) = l_tbl[l_index]; - temp32 = __ROR4__(temp32, 16); - pbDst = (unsigned char *)((_DWORD)pbDst << 16); - l_index = temp32; - _LOBYTE(pbDst) = l_tbl[l_index]; - l_index = BYTE1(temp32); - BYTE1(pbDst) = l_tbl[l_index]; - *(_DWORD *)tmp_pbDst = (unsigned int)pbDst; /* check */ tmp_pbDst += 4; --j; } From d2f109801c65f9588ec61df6913d0f941652e11c Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Sun, 26 Aug 2018 22:08:45 -0500 Subject: [PATCH 3/5] render.cpp -> remove last asm and cleanup --- Source/render.cpp | 364 ++++++++++++++++++---------------------------- 1 file changed, 142 insertions(+), 222 deletions(-) diff --git a/Source/render.cpp b/Source/render.cpp index 19128b5ba..15f511aeb 100644 --- a/Source/render.cpp +++ b/Source/render.cpp @@ -97,9 +97,7 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) unsigned int n_draw_shift; // ecx MAPDST unsigned int x_minus; // ecx MAPDST unsigned int y_minus; // ecx MAPDST - char *tmp_dst; // edi MAPDST signed int junk_v134; // ebp - short temp16; // ax MAPDST char junk_minus; // bp int junk_v180; // ebp signed int i; // edx MAPDST @@ -1235,7 +1233,7 @@ LABEL_265: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 2; tmp_pbDst += 2; } @@ -1308,11 +1306,9 @@ LABEL_268: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + tmp_pbDst[1] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -1332,7 +1328,7 @@ LABEL_268: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = pdung_cels[2]; pdung_cels += 4; tmp_pbDst += 2; } @@ -1366,11 +1362,9 @@ LABEL_268: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + tmp_pbDst[1] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -1390,7 +1384,7 @@ LABEL_268: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - *tmp_pbDst = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = pdung_cels[2]; pdung_cels += 4; tmp_pbDst += 2; } @@ -1440,11 +1434,9 @@ LABEL_268: junk_v180 = junk_minus & 2; if ( junk_v180 ) { - temp16 = *(_WORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } } else @@ -1459,7 +1451,7 @@ LABEL_268: junk_v180 = junk_minus & 2; if ( junk_v180 ) { - *tmp_pbDst = *(_WORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; tmp_pbDst += 2; } @@ -1487,11 +1479,9 @@ LABEL_268: junk_v180 &= 2u; if ( junk_v180 ) { - temp16 = *(_WORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } } else @@ -1506,7 +1496,7 @@ LABEL_268: junk_v180 &= 2u; if ( junk_v180 ) { - *tmp_pbDst = *(_WORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; tmp_pbDst += 2; } @@ -1537,11 +1527,9 @@ LABEL_268: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + tmp_pbDst[1] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } if ( n_draw_shift) { @@ -1561,7 +1549,7 @@ LABEL_268: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = pdung_cels[2]; pdung_cels += 4; tmp_pbDst += 2; } @@ -1641,11 +1629,9 @@ LABEL_268: } if ( (32 - (_BYTE)xx_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } } else @@ -1659,7 +1645,7 @@ LABEL_268: } if ( (32 - (_BYTE)xx_32) & 2 ) { - *tmp_pbDst = *(_WORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; tmp_pbDst += 2; } @@ -1742,7 +1728,7 @@ LABEL_268: j = 8; do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --j; @@ -1787,14 +1773,14 @@ LABEL_385: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -1867,9 +1853,8 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -1888,14 +1873,14 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -1920,9 +1905,8 @@ LABEL_391: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -1941,14 +1925,14 @@ LABEL_391: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -1979,9 +1963,8 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -2000,14 +1983,14 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -2032,9 +2015,8 @@ LABEL_391: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -2053,14 +2035,14 @@ LABEL_391: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -2092,9 +2074,8 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -2113,14 +2094,14 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -2152,7 +2133,7 @@ LABEL_391: j = 8; do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --j; @@ -2181,9 +2162,8 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - tmp_dst = tmp_pbDst + 1; - *tmp_dst = 0; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = 0; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -2202,14 +2182,14 @@ LABEL_391: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -2242,7 +2222,7 @@ LABEL_391: j = 8; do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --j; @@ -2273,7 +2253,6 @@ void __fastcall drawBottomArchesUpperScreen(unsigned char *pbDst, unsigned int * signed int i; // ecx MAPDST int y32_temp; // [esp-8h] [ebp-14h] MAPDST int x32_temp; // [esp-4h] [ebp-10h] MAPDST - int _EAX; char *_EBX; gpCelFrame = (unsigned char *)speed_cel_frame_num_from_light_index_frame_num; @@ -2308,7 +2287,7 @@ LABEL_12: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -2357,7 +2336,7 @@ LABEL_12: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -2533,7 +2512,7 @@ LABEL_129: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -2586,7 +2565,7 @@ LABEL_129: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -2632,7 +2611,7 @@ LABEL_129: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -2681,7 +2660,7 @@ LABEL_129: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -2712,12 +2691,9 @@ LABEL_50: n_draw_shift = (unsigned int)(32 - xx_32) >> 2; if ( (32 - xx_32) & 2 ) { - _EAX = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = _EBX[pdung_cels[2]]; + tmp_pbDst[1] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } if ( n_draw_shift ) @@ -2747,12 +2723,9 @@ LABEL_50: n_draw_shift = (unsigned int)(32 - yy_32) >> 2; if ( (32 - yy_32) & 2 ) { - _EAX = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = _EBX[pdung_cels[2]]; + tmp_pbDst[1] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } if ( n_draw_shift ) @@ -2797,12 +2770,9 @@ LABEL_50: } if ( (32 - (_BYTE)xx_32) & 2 ) { - _EAX = *(_WORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; @@ -2825,12 +2795,9 @@ LABEL_50: } if ( (32 - (_BYTE)yy_32) & 2 ) { - _EAX = *(_WORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } tmp_pbDst = &tmp_pbDst[yy_32 - 800]; @@ -2854,12 +2821,9 @@ LABEL_50: n_draw_shift = (unsigned int)(32 - xx_32) >> 2; if ( (32 - xx_32) & 2 ) { - _EAX = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = _EBX[pdung_cels[2]]; + tmp_pbDst[1] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } if ( n_draw_shift ) @@ -2893,7 +2857,7 @@ LABEL_50: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -2929,12 +2893,9 @@ LABEL_50: } if ( (32 - (_BYTE)xx_32) & 2 ) { - _EAX = *(_WORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; @@ -2953,7 +2914,7 @@ LABEL_50: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -3004,7 +2965,7 @@ LABEL_50: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --i; @@ -3053,7 +3014,7 @@ LABEL_50: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --and80_i; @@ -3230,7 +3191,7 @@ LABEL_208: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --i; @@ -3286,7 +3247,7 @@ LABEL_208: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --i; @@ -4350,20 +4311,15 @@ void __fastcall drawTopArchesLowerScreen(unsigned char *pbDst) short cel_type_16; // ax MAPDST unsigned int cel_type_16_tmp; // eax MAPDST int cel_type_32; // eax - unsigned int temp32; // eax MAPDST unsigned char junk_ror; // cf signed int tile_42_45; // eax MAPDST unsigned int world_tbl; // ecx MAPDST int world_192; // eax MAPDST - char *junk_v155; // esi - char temp8; // al MAPDST - short temp16; // ax MAPDST unsigned int dung_and80; // eax MAPDST unsigned int chk_sh_and; // ecx MAPDST int xx_32; // edx MAPDST unsigned int x_minus; // ecx MAPDST unsigned int n_draw_shift; // ecx MAPDST - char *tmp_dst; // edi MAPDST int yy_32; // edx MAPDST unsigned int y_minus; // ecx MAPDST signed int i; // edx MAPDST @@ -4426,7 +4382,7 @@ void __fastcall drawTopArchesLowerScreen(unsigned char *pbDst) j = 8; do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --j; @@ -4491,14 +4447,14 @@ LABEL_427: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -4587,14 +4543,14 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -4645,14 +4601,14 @@ LABEL_430: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -4709,14 +4665,14 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -4767,14 +4723,14 @@ LABEL_430: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -4832,14 +4788,14 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -4883,7 +4839,7 @@ LABEL_430: j = 8; do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --j; @@ -4938,14 +4894,14 @@ LABEL_430: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst += 2; } if ( n_draw_shift ) { do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --n_draw_shift; @@ -4990,7 +4946,7 @@ LABEL_430: j = 8; do { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; tmp_pbDst[2] = 0; tmp_pbDst += 4; --j; @@ -6244,7 +6200,7 @@ LABEL_287: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 2; tmp_pbDst += 2; } @@ -6275,12 +6231,9 @@ LABEL_280: n_draw_shift = chk_sh_and >> 1; if ( chk_sh_and & 1 ) { - junk_v155 = pdung_cels + 1; - tmp_dst = tmp_pbDst + 1; - temp8 = *junk_v155; - pdung_cels = junk_v155 + 1; - *tmp_dst = temp8; - tmp_pbDst = tmp_dst + 1; + tmp_pbDst[1] = pdung_cels[1]; + pdung_cels += 2; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -6359,11 +6312,9 @@ LABEL_308: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + tmp_pbDst[1] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -6383,10 +6334,10 @@ LABEL_308: n_draw_shift = y_minus >> 2; if ( y_minus & 2 ) { - *tmp_pbDst = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = pdung_cels[2]; pdung_cels += 4; tmp_pbDst += 2; - --n_draw_shift; /* check */ + --n_draw_shift; /* check SHOULDNT BE HERE */ } if ( n_draw_shift ) { @@ -6425,11 +6376,9 @@ LABEL_308: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + tmp_pbDst[1] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -6449,7 +6398,7 @@ LABEL_308: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = pdung_cels[2]; pdung_cels += 4; tmp_pbDst += 2; } @@ -6507,11 +6456,9 @@ LABEL_326: } if ( (32 - (_BYTE)xx_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } } else @@ -6525,7 +6472,7 @@ LABEL_326: } if ( (32 - (_BYTE)xx_32) & 2 ) { - *tmp_pbDst = *(_WORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; tmp_pbDst += 2; } @@ -6568,11 +6515,9 @@ LABEL_336: } if ( (32 - (_BYTE)yy_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } } else @@ -6586,7 +6531,7 @@ LABEL_336: } if ( (32 - (_BYTE)yy_32) & 2 ) { - *tmp_pbDst = *(_WORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; tmp_pbDst += 2; } @@ -6676,11 +6621,9 @@ LABEL_364: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - temp16 = *((_WORD *)pdung_cels + 1); + tmp_pbDst[1] = pdung_cels[3]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } if ( n_draw_shift ) { @@ -6700,7 +6643,7 @@ LABEL_364: n_draw_shift = x_minus >> 2; if ( x_minus & 2 ) { - *tmp_pbDst = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = pdung_cels[2]; pdung_cels += 4; tmp_pbDst += 2; } @@ -6708,13 +6651,11 @@ LABEL_364: { do { - temp32 = *(_DWORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; + tmp_pbDst[2] = pdung_cels[2]; pdung_cels += 4; - *tmp_pbDst = temp32; - tmp_dst = tmp_pbDst + 2; - *tmp_dst = __ROR4__(temp32, 16); + tmp_pbDst += 4; --n_draw_shift; - tmp_pbDst = tmp_dst + 2; } while ( n_draw_shift ); } @@ -6809,11 +6750,9 @@ LABEL_389: } if ( (32 - (_BYTE)xx_32) & 2 ) { - temp16 = *(_WORD *)pdung_cels; + tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; - tmp_dst = tmp_pbDst + 1; - *tmp_dst = __ROR4__(temp16, 8); - tmp_pbDst = tmp_dst + 1; + tmp_pbDst += 2; } } else @@ -6827,7 +6766,7 @@ LABEL_389: } if ( (32 - (_BYTE)xx_32) & 2 ) { - *tmp_pbDst = *(_WORD *)pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; tmp_pbDst += 2; } @@ -6858,7 +6797,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * unsigned int n_draw_shift; // ecx MAPDST int y32_temp; // [esp-8h] [ebp-14h] MAPDST int x32_temp; // [esp-4h] [ebp-10h] MAPDST - int _EAX; char *_EBX; gpCelFrame = (unsigned char *)speed_cel_frame_num_from_light_index_frame_num; @@ -6894,7 +6832,7 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --i; @@ -6942,7 +6880,7 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --and80_i; @@ -7161,7 +7099,7 @@ LABEL_252: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --i; @@ -7229,7 +7167,7 @@ LABEL_252: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; left_shift *= 2; ++tmp_pbDst; --i; @@ -7274,7 +7212,7 @@ LABEL_252: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -7321,7 +7259,7 @@ LABEL_252: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -7385,12 +7323,9 @@ LABEL_62: n_draw_shift = (unsigned int)(32 - yy_32) >> 2; if ( (32 - yy_32) & 2 ) { - _EAX = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = _EBX[pdung_cels[2]]; + tmp_pbDst[1] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } if ( n_draw_shift ) @@ -7424,12 +7359,9 @@ LABEL_62: n_draw_shift = (unsigned int)(32 - xx_32) >> 2; if ( (32 - xx_32) & 2 ) { - _EAX = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = _EBX[pdung_cels[2]]; + tmp_pbDst[1] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } if ( n_draw_shift ) @@ -7490,12 +7422,9 @@ LABEL_80: } if ( (32 - (_BYTE)yy_32) & 2 ) { - _EAX = *(_WORD *)pdung_cels; - pdung_cels += 2; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; + pdung_cels += 2; /* check SHOULD BE +4 */ tmp_pbDst += 2; } tmp_pbDst = &tmp_pbDst[yy_32 - 800]; @@ -7522,12 +7451,9 @@ LABEL_80: } if ( (32 - (_BYTE)xx_32) & 2 ) { - _EAX = *(_WORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; @@ -7562,7 +7488,7 @@ LABEL_98: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -7594,12 +7520,9 @@ LABEL_98: n_draw_shift = (unsigned int)(32 - xx_32) >> 2; if ( (32 - xx_32) & 2 ) { - _EAX = *((_WORD *)pdung_cels + 1); + tmp_pbDst[0] = _EBX[pdung_cels[2]]; + tmp_pbDst[1] = _EBX[pdung_cels[3]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } if ( n_draw_shift ) @@ -7648,7 +7571,7 @@ LABEL_117: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = _EBX[*pdung_cels]; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -7688,12 +7611,9 @@ LABEL_117: } if ( (32 - (_BYTE)xx_32) & 2 ) { - _EAX = *(_WORD *)pdung_cels; + tmp_pbDst[0] = _EBX[pdung_cels[0]]; + tmp_pbDst[1] = _EBX[pdung_cels[1]]; pdung_cels += 4; - ASM_XLAT(_EAX,_EBX); - _EAX = __ROR2__(_EAX, 8); - ASM_XLAT(_EAX,_EBX); - *(_WORD *)tmp_pbDst = __ROR2__(_EAX, 8); tmp_pbDst += 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; @@ -7737,7 +7657,7 @@ LABEL_117: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -7785,7 +7705,7 @@ LABEL_117: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -7998,7 +7918,7 @@ LABEL_198: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -8077,7 +7997,7 @@ LABEL_217: do { if ( left_shift & 0x80000000 ) - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; left_shift *= 2; ++pdung_cels; ++tmp_pbDst; @@ -8253,7 +8173,7 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) chk_sh_and = dung_and80 >> 1; if ( dung_and80 & 1 ) { - *tmp_pbDst = 0; + tmp_pbDst[0] = 0; ++tmp_pbDst; } if ( chk_sh_and ) @@ -9018,7 +8938,7 @@ LABEL_116: chk_sh_and = dung_and80 >> 1; if ( dung_and80 & 1 ) { - *tmp_pbDst = *pdung_cels; + tmp_pbDst[0] = pdung_cels[0]; ++pdung_cels; ++tmp_pbDst; } From 8a4196fe76852324874f0dec7bad4d7cefb941a0 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Mon, 27 Aug 2018 00:28:23 -0500 Subject: [PATCH 4/5] render.cpp -> remove all garbage vars --- Source/render.cpp | 693 +++++++++++++++------------------------------- 1 file changed, 220 insertions(+), 473 deletions(-) diff --git a/Source/render.cpp b/Source/render.cpp index 15f511aeb..b681f9ecd 100644 --- a/Source/render.cpp +++ b/Source/render.cpp @@ -86,23 +86,15 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) char *l_tbl; // ebx char *pdung_cels; // esi MAPDST short cel_type_16; // ax MAPDST - unsigned int cel_type_16_tmp; // eax MAPDST - int cel_type_32; // eax signed int xx_32; // ebp MAPDST signed int yy_32; // edx MAPDST unsigned int dung_and80; // eax MAPDST - char l_index; // edx MAPDST unsigned int chk_sh_and; // ecx MAPDST - unsigned char chk_andone; // cf unsigned int n_draw_shift; // ecx MAPDST unsigned int x_minus; // ecx MAPDST unsigned int y_minus; // ecx MAPDST - signed int junk_v134; // ebp - char junk_minus; // bp - int junk_v180; // ebp signed int i; // edx MAPDST signed int j; // ecx MAPDST - int y32_temp; // [esp-14h] [ebp-18h] MAPDST gpCelFrame = (unsigned char *)speed_cel_frame_num_from_light_index_frame_num; tmp_pbDst = (char *)pbDst; @@ -112,9 +104,7 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_16 = ((cel_type_16_tmp >> 4) & 7) + 8; + cel_type_16 = ((level_cel_block >> 12) & 7) + 8; goto LABEL_11; } if ( (_BYTE)light_table_index != lightmax ) @@ -123,7 +113,7 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) { pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); l_tbl = &pLightTbl[256 * light_table_index]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); switch ( cel_type_16 ) { case 0: // upper (top transparent), with lighting @@ -189,20 +179,17 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) if ( !yy_32 ) goto LABEL_67; } - l_index = yy_32 - dung_and80; if ( (unsigned int)tmp_pbDst < screen_buf_end ) return; if ( ((unsigned char)tmp_pbDst & 1) == WorldBoolFlag ) { - y32_temp = l_index; chk_sh_and = dung_and80 >> 1; if ( dung_and80 & 1 ) { ++pdung_cels; ++tmp_pbDst; - chk_andone = chk_sh_and & 1; n_draw_shift = dung_and80 >> 2; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -223,9 +210,8 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) } else { - chk_andone = chk_sh_and & 1; n_draw_shift = dung_and80 >> 2; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -244,19 +230,15 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) while ( n_draw_shift ); } } - yy_32 = y32_temp; } else { - y32_temp = l_index; chk_sh_and = dung_and80 >> 1; if ( dung_and80 & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - chk_andone = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = dung_and80 >> 2; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -277,9 +259,8 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) } else { - chk_andone = chk_sh_and & 1; n_draw_shift = dung_and80 >> 2; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -298,8 +279,8 @@ void __fastcall drawTopArchesUpperScreen(unsigned char *pbDst) while ( n_draw_shift ); } } - yy_32 = y32_temp; } + yy_32 -= dung_and80; } while ( yy_32 ); LABEL_67: @@ -324,17 +305,14 @@ LABEL_67: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - l_index = x_minus & 2; - pdung_cels += l_index; - chk_andone = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -355,9 +333,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -379,17 +356,13 @@ LABEL_67: } else { - l_index = x_minus & 2; - pdung_cels += l_index; - chk_andone = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - chk_andone = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -410,9 +383,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -446,17 +418,14 @@ LABEL_67: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - l_index = y_minus & 2; - pdung_cels += l_index; - chk_andone = y_minus & 1; + pdung_cels += y_minus & 2; chk_sh_and = y_minus >> 1; - if ( chk_andone ) + if ( y_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -477,9 +446,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -501,17 +469,13 @@ LABEL_67: } else { - l_index = y_minus & 2; - pdung_cels += l_index; - chk_andone = y_minus & 1; + pdung_cels += y_minus & 2; chk_sh_and = y_minus >> 1; - if ( chk_andone ) + if ( y_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - chk_andone = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -532,9 +496,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -576,15 +539,13 @@ LABEL_67: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - chk_andone = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -605,9 +566,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -626,20 +586,16 @@ LABEL_67: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } else { - chk_andone = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - chk_andone = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -660,9 +616,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -681,8 +636,7 @@ LABEL_67: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; @@ -697,15 +651,13 @@ LABEL_67: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - chk_andone = y_minus & 1; chk_sh_and = y_minus >> 1; - if ( chk_andone ) + if ( y_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -726,9 +678,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -747,20 +698,16 @@ LABEL_67: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } else { - chk_andone = y_minus & 1; chk_sh_and = y_minus >> 1; - if ( chk_andone ) + if ( y_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - chk_andone = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -781,9 +728,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -802,8 +748,7 @@ LABEL_67: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } tmp_pbDst = &tmp_pbDst[yy_32 - 800]; yy_32 += 2; @@ -828,17 +773,14 @@ LABEL_67: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - l_index = x_minus & 2; - pdung_cels += l_index; - chk_andone = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -859,9 +801,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -883,17 +824,13 @@ LABEL_67: } else { - l_index = x_minus & 2; - pdung_cels += l_index; - chk_andone = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - chk_andone = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -914,9 +851,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -990,15 +926,13 @@ LABEL_67: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - chk_andone = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -1019,9 +953,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -1040,20 +973,16 @@ LABEL_67: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } else { - chk_andone = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( chk_andone ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - chk_andone = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -1074,9 +1003,8 @@ LABEL_67: } else { - chk_andone = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( chk_andone ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -1095,8 +1023,7 @@ LABEL_67: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; @@ -1143,7 +1070,7 @@ LABEL_67: } pdung_cels = (char *)pSpeedCels + *(_DWORD *)&gpCelFrame[4 * (light_table_index + 16 * (level_cel_block & 0xFFF))]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); LABEL_11: switch ( cel_type_16 ) @@ -1194,7 +1121,7 @@ LABEL_11: \/ */ WorldBoolFlag = (unsigned char)pbDst & 1; - junk_v134 = 32; + yy_32 = 32; LABEL_251: xx_32 = 32; while ( 1 ) @@ -1212,7 +1139,7 @@ LABEL_251: LABEL_271: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; tmp_pbDst -= 800; - if ( !--junk_v134 ) + if ( !--yy_32 ) return; goto LABEL_251; } @@ -1420,7 +1347,6 @@ LABEL_268: while ( (unsigned int)tmp_pbDst >= screen_buf_end ) { x_minus = 32 - xx_32; - junk_minus = 32 - xx_32; WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { @@ -1431,8 +1357,7 @@ LABEL_268: pdung_cels += 4; tmp_pbDst += 4; } - junk_v180 = junk_minus & 2; - if ( junk_v180 ) + if ( x_minus & 2 ) { tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; @@ -1448,8 +1373,7 @@ LABEL_268: pdung_cels += 4; tmp_pbDst += 4; } - junk_v180 = junk_minus & 2; - if ( junk_v180 ) + if ( x_minus & 2 ) { tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; @@ -1476,8 +1400,7 @@ LABEL_268: pdung_cels += 4; tmp_pbDst += 4; } - junk_v180 &= 2u; - if ( junk_v180 ) + if ( x_minus & 2 ) /* should be y_minus */ { tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; @@ -1493,8 +1416,7 @@ LABEL_268: pdung_cels += 4; tmp_pbDst += 4; } - junk_v180 &= 2u; - if ( junk_v180 ) + if ( x_minus & 2 ) /* should be y_minus */ { tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; @@ -1697,10 +1619,8 @@ LABEL_268: level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_32 = (cel_type_16_tmp >> 4) & 7; - switch ( (_WORD)cel_type_32 ) + cel_type_16 = (level_cel_block >> 12) & 7; + switch ( cel_type_16 ) { case 0: // upper (top transparent), black /* @@ -2241,18 +2161,13 @@ void __fastcall drawBottomArchesUpperScreen(unsigned char *pbDst, unsigned int * char *tmp_pbDst; // edi MAPDST char *pdung_cels; // esi MAPDST short cel_type_16; // ax MAPDST - unsigned int cel_type_16_tmp; // eax MAPDST - int cel_type_32; // eax int xx_32; // edx MAPDST unsigned int left_shift; // edx MAPDST int yy_32; // edx MAPDST int dung_and80; // eax MAPDST - int y_minus; // edx MAPDST int and80_i; // ecx MAPDST unsigned int n_draw_shift; // ecx MAPDST signed int i; // ecx MAPDST - int y32_temp; // [esp-8h] [ebp-14h] MAPDST - int x32_temp; // [esp-4h] [ebp-10h] MAPDST char *_EBX; gpCelFrame = (unsigned char *)speed_cel_frame_num_from_light_index_frame_num; @@ -2264,9 +2179,7 @@ void __fastcall drawBottomArchesUpperScreen(unsigned char *pbDst, unsigned int * level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_16 = ((cel_type_16_tmp >> 4) & 7) + 8; + cel_type_16 = ((level_cel_block >> 12) & 7) + 8; LABEL_12: switch ( cel_type_16 ) { @@ -2281,7 +2194,6 @@ LABEL_12: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - x32_temp = xx_32; left_shift = *gpDrawMask; i = 32; do @@ -2296,9 +2208,9 @@ LABEL_12: while ( i ); tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 9: // upper (bottom transparent), without lighting /* @@ -2309,7 +2221,6 @@ LABEL_12: xx_32 = 32; do { - x32_temp = xx_32; gdwCurrentMask = *gpDrawMask; yy_32 = 32; do @@ -2327,10 +2238,9 @@ LABEL_12: if ( !yy_32 ) goto LABEL_129; } - y_minus = yy_32 - dung_and80; + yy_32 -= dung_and80; if ( (unsigned int)tmp_pbDst < screen_buf_end ) return; - y32_temp = y_minus; left_shift = gdwCurrentMask; and80_i = dung_and80; do @@ -2344,15 +2254,14 @@ LABEL_12: } while ( and80_i ); gdwCurrentMask = left_shift; - yy_32 = y32_temp; } - while ( y32_temp ); + while ( yy_32 ); LABEL_129: tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 10: // upper (bottom transparent), without lighting /* @@ -2506,7 +2415,6 @@ LABEL_129: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -2521,9 +2429,9 @@ LABEL_129: while ( i ); tmp_pbDst -= 800; --gpDrawMask; - yy_32 = y32_temp - 1; + --yy_32; } - while ( y32_temp != 1 ); + while ( yy_32 ); return; } } @@ -2559,7 +2467,6 @@ LABEL_129: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -2575,9 +2482,9 @@ LABEL_129: pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst -= 800; --gpDrawMask; - yy_32 = y32_temp - 1; + --yy_32; } - while ( y32_temp != 1 ); + while ( yy_32 ); return; } } @@ -2591,7 +2498,7 @@ LABEL_129: { pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); _EBX = &pLightTbl[256 * light_table_index]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); switch ( cel_type_16 ) { case 0: // upper (bottom transparent), with lighting @@ -2605,7 +2512,6 @@ LABEL_129: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - x32_temp = xx_32; left_shift = *gpDrawMask; i = 32; do @@ -2620,9 +2526,9 @@ LABEL_129: while ( i ); tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 1: // upper (bottom transparent), with lighting /* @@ -2633,7 +2539,6 @@ LABEL_129: xx_32 = 32; do { - x32_temp = xx_32; gdwCurrentMask = *gpDrawMask; yy_32 = 32; do @@ -2651,11 +2556,10 @@ LABEL_129: if ( !yy_32 ) goto LABEL_50; } - y_minus = yy_32 - dung_and80; + yy_32 -= dung_and80; if ( (unsigned int)tmp_pbDst < screen_buf_end ) return; and80_i = dung_and80; - y32_temp = y_minus; left_shift = gdwCurrentMask; do { @@ -2668,15 +2572,14 @@ LABEL_129: } while ( and80_i ); gdwCurrentMask = left_shift; - yy_32 = y32_temp; } - while ( y32_temp ); + while ( yy_32 ); LABEL_50: tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 2: // upper (bottom transparent), with lighting /* @@ -2850,7 +2753,6 @@ LABEL_50: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; pdung_cels += (unsigned char)pdung_cels & 2; @@ -2866,9 +2768,9 @@ LABEL_50: while ( i ); tmp_pbDst -= 800; --gpDrawMask; - yy_32 = y32_temp - 1; + --yy_32; } - while ( y32_temp != 1 ); + while ( yy_32 ); return; } } @@ -2908,7 +2810,6 @@ LABEL_50: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -2924,9 +2825,9 @@ LABEL_50: pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst -= 800; --gpDrawMask; - yy_32 = y32_temp - 1; + --yy_32; } - while ( y32_temp != 1 ); + while ( yy_32 ); return; } } @@ -2936,17 +2837,15 @@ LABEL_50: } pdung_cels = (char *)pSpeedCels + *(_DWORD *)&gpCelFrame[4 * (light_table_index + 16 * (level_cel_block & 0xFFF))]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); goto LABEL_12; } if ( level_cel_block & 0x8000 ) level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_32 = (cel_type_16_tmp >> 4) & 7; - switch ( (_WORD)cel_type_32 ) + cel_type_16 = (level_cel_block >> 12) & 7; + switch ( cel_type_16 ) { case 0: // upper (bottom transparent), black /* @@ -2959,7 +2858,6 @@ LABEL_50: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - x32_temp = xx_32; left_shift = *gpDrawMask; i = 32; do @@ -2973,9 +2871,9 @@ LABEL_50: while ( i ); tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 1: // upper (bottom transparent), black /* @@ -2986,7 +2884,6 @@ LABEL_50: xx_32 = 32; do { - x32_temp = xx_32; gdwCurrentMask = *gpDrawMask; yy_32 = 32; do @@ -3004,10 +2901,9 @@ LABEL_50: if ( !yy_32 ) goto LABEL_208; } - y_minus = yy_32 - dung_and80; + yy_32 -= dung_and80; if ( (unsigned int)tmp_pbDst < screen_buf_end ) return; - y32_temp = y_minus; left_shift = gdwCurrentMask; and80_i = dung_and80; pdung_cels += dung_and80; @@ -3021,15 +2917,14 @@ LABEL_50: } while ( and80_i ); gdwCurrentMask = left_shift; - yy_32 = y32_temp; } - while ( y32_temp ); + while ( yy_32 ); LABEL_208: tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 2: // upper (bottom transparent), black /* @@ -3185,7 +3080,6 @@ LABEL_208: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -3199,9 +3093,9 @@ LABEL_208: while ( i ); tmp_pbDst -= 800; --gpDrawMask; - yy_32 = y32_temp - 1; + --yy_32; } - while ( y32_temp != 1 ); + while ( yy_32 ); return; } xx_32 -= 2; @@ -3241,7 +3135,6 @@ LABEL_208: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -3255,9 +3148,9 @@ LABEL_208: while ( i ); tmp_pbDst -= 800; --gpDrawMask; - yy_32 = y32_temp - 1; + --yy_32; } - while ( y32_temp != 1 ); + while ( yy_32 ); return; } tmp_pbDst += xx_32; @@ -3269,14 +3162,10 @@ LABEL_208: void __fastcall drawUpperScreen(unsigned char *pbDst) { - char junk_v2; // al MAPDST unsigned char *tmp_pbDst; // edi MAPDST char *l_tbl; // ebx unsigned char *pdung_cels; // esi MAPDST short cel_type_16; // ax MAPDST - unsigned int cel_type_16_tmp; // eax - unsigned int cel_type_32; // eax - char l_index; // edx MAPDST char base_4; // cl MAPDST char x_minus; // cl MAPDST char y_minus; // cl @@ -3287,9 +3176,7 @@ void __fastcall drawUpperScreen(unsigned char *pbDst) unsigned int n_draw_shift; // ecx MAPDST signed int i; // edx MAPDST signed int j; // ecx MAPDST - int y32_temp; // [esp-14h] [ebp-18h] MAPDST - l_index = cel_transparency_active; if ( cel_transparency_active ) { if ( !arch_draw_type ) @@ -3299,8 +3186,7 @@ void __fastcall drawUpperScreen(unsigned char *pbDst) } if ( arch_draw_type == 1 ) { - junk_v2 = block_lvid[level_piece_id]; - if ( junk_v2 == 1 || junk_v2 == 3 ) + if ( block_lvid[level_piece_id] == 1 || block_lvid[level_piece_id] == 3 ) { drawBottomArchesUpperScreen(pbDst, &LeftMask[31]); return; @@ -3308,8 +3194,7 @@ void __fastcall drawUpperScreen(unsigned char *pbDst) } if ( arch_draw_type == 2 ) { - junk_v2 = block_lvid[level_piece_id]; - if ( junk_v2 == 2 || junk_v2 == 3 ) + if ( block_lvid[level_piece_id] == 2 || block_lvid[level_piece_id] == 3 ) { drawBottomArchesUpperScreen(pbDst, &RightMask[31]); return; @@ -3324,9 +3209,7 @@ void __fastcall drawUpperScreen(unsigned char *pbDst) level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (unsigned char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_16 = ((cel_type_16_tmp >> 4) & 7) + 8; + cel_type_16 = ((level_cel_block >> 12) & 7) + 8; LABEL_22: switch ( cel_type_16 ) { @@ -3646,13 +3529,12 @@ LABEL_133: | | |--| */ - l_index = 32; + xx_32 = 32; do { if ( (unsigned int)tmp_pbDst < screen_buf_end ) break; base_4 = 32; - y32_temp = l_index; do { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; @@ -3665,9 +3547,9 @@ LABEL_133: } while ( base_4 >= 4 ); tmp_pbDst -= 800; - l_index = y32_temp - 1; + --xx_32; } - while ( y32_temp != 1 ); + while ( xx_32 ); break; case 1: // upper (solid), with lighting /* @@ -3692,11 +3574,10 @@ LABEL_133: if ( !yy_32 ) goto LABEL_58; } - l_index = yy_32 - dung_and80; + yy_32 -= dung_and80; if ( (unsigned int)tmp_pbDst < screen_buf_end ) return; - base_4 = dung_and80; - for ( y32_temp = l_index; base_4 >= 4; base_4 -= 4 ) + for ( base_4 = dung_and80; base_4 >= 4; base_4 -= 4 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; tmp_pbDst[1] = l_tbl[pdung_cels[1]]; @@ -3716,9 +3597,8 @@ LABEL_133: { *tmp_pbDst++ = l_tbl[*pdung_cels++]; } - yy_32 = y32_temp; } - while ( y32_temp ); + while ( yy_32 ); LABEL_58: tmp_pbDst -= 800; --xx_32; @@ -3736,8 +3616,7 @@ LABEL_58: { tmp_pbDst += xx_32; x_minus = 32 - xx_32; - l_index = (32 - (_BYTE)xx_32) & 2; - pdung_cels += l_index; + pdung_cels += (32 - (_BYTE)xx_32) & 2; if ( (char)(32 - xx_32) >= 4 ) { do @@ -3770,8 +3649,7 @@ LABEL_58: break; tmp_pbDst += yy_32; y_minus = 32 - yy_32; - l_index = (32 - (_BYTE)yy_32) & 2; - pdung_cels += l_index; + pdung_cels += (32 - (_BYTE)yy_32) & 2; if ( (char)(32 - yy_32) >= 4 ) { do @@ -3826,8 +3704,7 @@ LABEL_58: pdung_cels += 2; tmp_pbDst += 2; } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; if ( xx_32 < 0 ) @@ -3853,8 +3730,7 @@ LABEL_58: pdung_cels += 2; tmp_pbDst += 2; } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst = &tmp_pbDst[yy_32 - 800]; yy_32 += 2; } @@ -3874,8 +3750,7 @@ LABEL_58: { tmp_pbDst += xx_32; x_minus = 32 - xx_32; - l_index = (32 - (_BYTE)xx_32) & 2; - pdung_cels += l_index; + pdung_cels += (32 - (_BYTE)xx_32) & 2; if ( (char)(32 - xx_32) >= 4 ) { do @@ -3951,8 +3826,7 @@ LABEL_58: pdung_cels += 2; tmp_pbDst += 2; } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; if ( xx_32 < 0 ) @@ -3994,8 +3868,8 @@ LABEL_58: level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (unsigned char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_32 = ((unsigned int)level_cel_block >> 12) & 7; - switch ( (_WORD)cel_type_32 ) + cel_type_16 = ((unsigned int)level_cel_block >> 12) & 7; + switch ( cel_type_16 ) { case 0: // upper (solid), black /* @@ -4304,14 +4178,10 @@ LABEL_205: void __fastcall drawTopArchesLowerScreen(unsigned char *pbDst) { - char l_index; // edx MAPDST char *tmp_pbDst; // edi MAPDST char *l_tbl; // ebx char *pdung_cels; // esi MAPDST short cel_type_16; // ax MAPDST - unsigned int cel_type_16_tmp; // eax MAPDST - int cel_type_32; // eax - unsigned char junk_ror; // cf signed int tile_42_45; // eax MAPDST unsigned int world_tbl; // ecx MAPDST int world_192; // eax MAPDST @@ -4324,7 +4194,6 @@ void __fastcall drawTopArchesLowerScreen(unsigned char *pbDst) unsigned int y_minus; // ecx MAPDST signed int i; // edx MAPDST signed int j; // ecx MAPDST - int x32_temp; // [esp-14h] [ebp-18h] MAPDST gpCelFrame = (unsigned char *)speed_cel_frame_num_from_light_index_frame_num; tmp_pbDst = (char *)pbDst; @@ -4334,9 +4203,7 @@ void __fastcall drawTopArchesLowerScreen(unsigned char *pbDst) level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_16 = ((cel_type_16_tmp >> 4) & 7) + 8; + cel_type_16 = ((level_cel_block >> 12) & 7) + 8; goto LABEL_11; } if ( (_BYTE)light_table_index == lightmax ) @@ -4345,10 +4212,8 @@ void __fastcall drawTopArchesLowerScreen(unsigned char *pbDst) level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_32 = (cel_type_16_tmp >> 4) & 7; - switch ( (_WORD)cel_type_32 ) + cel_type_16 = (level_cel_block >> 12) & 7; + switch ( cel_type_16 ) { case 0: // lower (top transparent), black /* @@ -4408,7 +4273,6 @@ void __fastcall drawTopArchesLowerScreen(unsigned char *pbDst) WorldBoolFlag = (unsigned char)pbDst & 1; xx_32 = 32; LABEL_412: - x32_temp = xx_32; yy_32 = 32; while ( 1 ) { @@ -4425,8 +4289,7 @@ LABEL_412: LABEL_433: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; tmp_pbDst -= 800; - xx_32 = x32_temp - 1; - if ( x32_temp == 1 ) + if ( !--xx_32 ) return; goto LABEL_412; } @@ -4970,7 +4833,7 @@ LABEL_430: { pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); l_tbl = &pLightTbl[256 * light_table_index]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); switch ( cel_type_16 ) { case 0: // lower (top transparent), with lighting @@ -5034,7 +4897,6 @@ LABEL_430: xx_32 = 32; do { - x32_temp = xx_32; yy_32 = 32; do { @@ -5059,9 +4921,8 @@ LABEL_430: { ++pdung_cels; ++tmp_pbDst; - junk_ror = chk_sh_and & 1; n_draw_shift = dung_and80 >> 2; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5082,9 +4943,8 @@ LABEL_430: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = dung_and80 >> 2; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5109,11 +4969,9 @@ LABEL_430: chk_sh_and = dung_and80 >> 1; if ( dung_and80 & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - junk_ror = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = dung_and80 >> 2; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5134,9 +4992,8 @@ LABEL_430: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = dung_and80 >> 2; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5167,9 +5024,9 @@ LABEL_430: LABEL_69: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; tmp_pbDst -= 800; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 2: // lower (top transparent), with lighting /* @@ -5208,17 +5065,14 @@ LABEL_98: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - l_index = y_minus & 2; - pdung_cels += l_index; - junk_ror = y_minus & 1; + pdung_cels += y_minus & 2; chk_sh_and = y_minus >> 1; - if ( junk_ror ) + if ( y_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5239,9 +5093,8 @@ LABEL_98: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5263,17 +5116,13 @@ LABEL_98: } else { - l_index = y_minus & 2; - pdung_cels += l_index; - junk_ror = y_minus & 1; + pdung_cels += y_minus & 2; chk_sh_and = y_minus >> 1; - if ( junk_ror ) + if ( y_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - junk_ror = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5294,9 +5143,8 @@ LABEL_98: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5337,17 +5185,14 @@ LABEL_98: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - l_index = x_minus & 2; - pdung_cels += l_index; - junk_ror = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5368,9 +5213,8 @@ LABEL_98: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5392,17 +5236,13 @@ LABEL_98: } else { - l_index = x_minus & 2; - pdung_cels += l_index; - junk_ror = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - junk_ror = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5423,9 +5263,8 @@ LABEL_98: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5486,15 +5325,13 @@ LABEL_154: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - junk_ror = y_minus & 1; chk_sh_and = y_minus >> 1; - if ( junk_ror ) + if ( y_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5515,9 +5352,8 @@ LABEL_154: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5536,20 +5372,16 @@ LABEL_154: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } else { - junk_ror = y_minus & 1; chk_sh_and = y_minus >> 1; - if ( junk_ror ) + if ( y_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - junk_ror = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5570,9 +5402,8 @@ LABEL_154: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5591,8 +5422,7 @@ LABEL_154: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } tmp_pbDst = &tmp_pbDst[yy_32 - 800]; yy_32 += 2; @@ -5614,15 +5444,13 @@ LABEL_154: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - junk_ror = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5643,9 +5471,8 @@ LABEL_154: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5664,20 +5491,16 @@ LABEL_154: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } else { - junk_ror = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - junk_ror = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5698,9 +5521,8 @@ LABEL_154: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5719,8 +5541,7 @@ LABEL_154: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; @@ -5804,17 +5625,14 @@ LABEL_210: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - l_index = x_minus & 2; - pdung_cels += l_index; - junk_ror = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5835,9 +5653,8 @@ LABEL_210: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5859,17 +5676,13 @@ LABEL_210: } else { - l_index = x_minus & 2; - pdung_cels += l_index; - junk_ror = x_minus & 1; + pdung_cels += x_minus & 2; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - junk_ror = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -5890,9 +5703,8 @@ LABEL_210: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -5993,15 +5805,13 @@ LABEL_249: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; if ( WorldBoolFlag ) { - junk_ror = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { ++pdung_cels; ++tmp_pbDst; - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -6022,9 +5832,8 @@ LABEL_249: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -6043,20 +5852,16 @@ LABEL_249: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } else { - junk_ror = x_minus & 1; chk_sh_and = x_minus >> 1; - if ( junk_ror ) + if ( x_minus & 1 ) { - l_index = *pdung_cels++; - *tmp_pbDst++ = l_tbl[l_index]; - junk_ror = chk_sh_and & 1; + *tmp_pbDst++ = l_tbl[*pdung_cels++]; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[1] = l_tbl[pdung_cels[1]]; pdung_cels += 2; @@ -6077,9 +5882,8 @@ LABEL_249: } else { - junk_ror = chk_sh_and & 1; n_draw_shift = chk_sh_and >> 1; - if ( junk_ror ) + if ( chk_sh_and & 1 ) { tmp_pbDst[0] = l_tbl[pdung_cels[0]]; pdung_cels += 2; @@ -6098,8 +5902,7 @@ LABEL_249: while ( n_draw_shift ); } } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; } tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; @@ -6110,7 +5913,7 @@ LABEL_249: return; } pdung_cels = (char *)pSpeedCels + *(_DWORD *)&gpCelFrame[4 * (light_table_index + 16 * (level_cel_block & 0xFFF))]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); LABEL_11: switch ( cel_type_16 ) { @@ -6175,7 +5978,6 @@ LABEL_11: xx_32 = 32; while ( 1 ) { - x32_temp = xx_32; yy_32 = 32; do { @@ -6268,8 +6070,7 @@ LABEL_290: LABEL_293: WorldBoolFlag = ((_BYTE)WorldBoolFlag + 1) & 1; tmp_pbDst -= 800; - xx_32 = x32_temp - 1; - if ( x32_temp == 1 ) + if ( !--xx_32 ) return; } case 10: // lower (top transparent), without lighting @@ -6784,8 +6585,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * char *tmp_pbDst; // edi MAPDST short cel_type_16; // ax MAPDST char *pdung_cels; // esi MAPDST - unsigned int cel_type_16_tmp; // eax MAPDST - int cel_type_32; // eax int and80_i; // ecx MAPDST signed int tile_42_45; // eax MAPDST unsigned int world_tbl; // ecx MAPDST @@ -6795,8 +6594,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * unsigned int left_shift; // edx MAPDST signed int i; // edx MAPDST unsigned int n_draw_shift; // ecx MAPDST - int y32_temp; // [esp-8h] [ebp-14h] MAPDST - int x32_temp; // [esp-4h] [ebp-10h] MAPDST char *_EBX; gpCelFrame = (unsigned char *)speed_cel_frame_num_from_light_index_frame_num; @@ -6810,10 +6607,8 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_32 = (cel_type_16_tmp >> 4) & 7; - switch ( (_WORD)cel_type_32 ) + cel_type_16 = (level_cel_block >> 12) & 7; + switch ( cel_type_16 ) { case 0: // lower (bottom transparent), black /* @@ -6826,7 +6621,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -6838,7 +6632,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * --i; } while ( i ); - yy_32 = y32_temp; } else { @@ -6860,7 +6653,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * xx_32 = 32; do { - x32_temp = xx_32; gdwCurrentMask = *gpDrawMask; yy_32 = 32; do @@ -6875,7 +6667,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * { and80_i = dung_and80; pdung_cels += dung_and80; - y32_temp = yy_32; left_shift = gdwCurrentMask; do { @@ -6887,7 +6678,6 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * } while ( and80_i ); gdwCurrentMask = left_shift; - yy_32 = y32_temp; } else { @@ -6907,9 +6697,9 @@ void __fastcall drawBottomArchesLowerScreen(unsigned char *pbDst, unsigned int * LABEL_252: tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 2: // lower (bottom transparent), black /* @@ -7093,7 +6883,6 @@ LABEL_252: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -7105,7 +6894,6 @@ LABEL_252: --i; } while ( i ); - yy_32 = y32_temp; } else { @@ -7161,7 +6949,6 @@ LABEL_252: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -7173,7 +6960,6 @@ LABEL_252: --i; } while ( i ); - yy_32 = y32_temp; } else { @@ -7193,7 +6979,7 @@ LABEL_252: { pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); _EBX = &pLightTbl[256 * light_table_index]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); switch ( cel_type_16 ) { case 0: // lower (bottom transparent), with lighting @@ -7240,7 +7026,6 @@ LABEL_252: xx_32 = 32; do { - x32_temp = xx_32; gdwCurrentMask = *gpDrawMask; yy_32 = 32; do @@ -7254,7 +7039,6 @@ LABEL_252: if ( (unsigned int)tmp_pbDst < screen_buf_end ) { and80_i = dung_and80; - y32_temp = yy_32; left_shift = gdwCurrentMask; do { @@ -7267,7 +7051,6 @@ LABEL_252: } while ( and80_i ); gdwCurrentMask = left_shift; - yy_32 = y32_temp; } else { @@ -7287,9 +7070,9 @@ LABEL_252: LABEL_52: tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 2: // lower (bottom transparent), with lighting /* @@ -7482,7 +7265,6 @@ LABEL_98: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -7495,7 +7277,6 @@ LABEL_98: --i; } while ( i ); - yy_32 = y32_temp; } else { @@ -7565,7 +7346,6 @@ LABEL_117: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -7579,7 +7359,6 @@ LABEL_117: } while ( i ); pdung_cels += (unsigned char)pdung_cels & 2; - yy_32 = y32_temp; } else { @@ -7626,7 +7405,7 @@ LABEL_117: } pdung_cels = (char *)pSpeedCels + *(_DWORD *)&gpCelFrame[4 * (light_table_index + 16 * (level_cel_block & 0xFFF))]; - cel_type_16 = (unsigned char)(BYTE1(level_cel_block) >> 4); + cel_type_16 = (unsigned char)(level_cel_block >> 12); } else { @@ -7634,9 +7413,7 @@ LABEL_117: level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_16 = ((cel_type_16_tmp >> 4) & 7) + 8; + cel_type_16 = ((level_cel_block >> 12) & 7) + 8; } switch ( cel_type_16 ) { @@ -7651,7 +7428,6 @@ LABEL_117: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -7664,7 +7440,6 @@ LABEL_117: --i; } while ( i ); - yy_32 = y32_temp; } else { @@ -7686,7 +7461,6 @@ LABEL_117: xx_32 = 32; do { - x32_temp = xx_32; gdwCurrentMask = *gpDrawMask; yy_32 = 32; do @@ -7700,7 +7474,6 @@ LABEL_117: if ( (unsigned int)tmp_pbDst < screen_buf_end ) { and80_i = dung_and80; - y32_temp = yy_32; left_shift = gdwCurrentMask; do { @@ -7713,7 +7486,6 @@ LABEL_117: } while ( and80_i ); gdwCurrentMask = left_shift; - yy_32 = y32_temp; } else { @@ -7733,9 +7505,9 @@ LABEL_117: LABEL_152: tmp_pbDst -= 800; --gpDrawMask; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 10: // lower (bottom transparent), without lighting /* @@ -7912,7 +7684,6 @@ LABEL_198: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -7925,7 +7696,6 @@ LABEL_198: --i; } while ( i ); - yy_32 = y32_temp; } else { @@ -7991,7 +7761,6 @@ LABEL_217: { if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - y32_temp = yy_32; left_shift = *gpDrawMask; i = 32; do @@ -8005,7 +7774,6 @@ LABEL_217: } while ( i ); pdung_cels += (unsigned char)pdung_cels & 2; - yy_32 = y32_temp; } else { @@ -8048,15 +7816,11 @@ LABEL_217: void __fastcall drawLowerScreen(unsigned char *pbDst) { - char junk_v2; // al MAPDST unsigned char *tmp_pbDst; // edi MAPDST char *pdung_cels; // esi MAPDST char *l_tbl; // ebx short cel_type_16; // ax MAPDST - unsigned int cel_type_16_tmp; // eax - int cel_type_32; // eax int xx_32; // edx MAPDST - char l_index; // edx MAPDST int yy_32; // ebp MAPDST char block_4; // cl MAPDST int x_minus; // ecx MAPDST @@ -8068,9 +7832,7 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) unsigned int dung_and80; // eax MAPDST signed int i; // edx MAPDST signed int j; // ecx MAPDST - int x32_temp; // [esp-14h] [ebp-18h] MAPDST - l_index = cel_transparency_active; if ( cel_transparency_active ) { if ( !arch_draw_type ) @@ -8080,8 +7842,7 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) } if ( arch_draw_type == 1 ) { - junk_v2 = block_lvid[level_piece_id]; - if ( junk_v2 == 1 || junk_v2 == 3 ) + if ( block_lvid[level_piece_id] == 1 || block_lvid[level_piece_id] == 3 ) { drawBottomArchesLowerScreen(pbDst, &LeftMask[31]); return; @@ -8089,8 +7850,7 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) } if ( arch_draw_type == 2 ) { - junk_v2 = block_lvid[level_piece_id]; - if ( junk_v2 == 2 || junk_v2 == 3 ) + if ( block_lvid[level_piece_id] == 2 || block_lvid[level_piece_id] == 3 ) { drawBottomArchesLowerScreen(pbDst, &RightMask[31]); return; @@ -8107,10 +7867,8 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) level_cel_block = *(_DWORD *)&gpCelFrame[64 * (level_cel_block & 0xFFF)] + (unsigned short)(level_cel_block & 0xF000); pdung_cels = (char *)pDungeonCels + *((_DWORD *)pDungeonCels + (level_cel_block & 0xFFF)); - cel_type_16_tmp = level_cel_block; - _LOBYTE(cel_type_16_tmp) = BYTE1(cel_type_16_tmp); - cel_type_32 = (cel_type_16_tmp >> 4) & 7; - switch ( (_WORD)cel_type_32 ) + cel_type_16 = (level_cel_block >> 12) & 7; + switch ( cel_type_16 ) { case 0: // lower (solid), black /* @@ -8151,7 +7909,6 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) xx_32 = 32; do { - x32_temp = xx_32; yy_32 = 32; do { @@ -8205,9 +7962,9 @@ void __fastcall drawLowerScreen(unsigned char *pbDst) while ( yy_32 ); LABEL_232: tmp_pbDst -= 800; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 2: // lower (solid), black /* @@ -8489,10 +8246,8 @@ LABEL_232: xx_32 = 32; do { - x32_temp = xx_32; if ( (unsigned int)tmp_pbDst < screen_buf_end ) { - l_index = 0; /* remove */ j = 8; do { @@ -8512,9 +8267,9 @@ LABEL_232: tmp_pbDst += 32; } tmp_pbDst -= 800; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 1: // lower (solid), with lighting /* @@ -8525,7 +8280,6 @@ LABEL_232: xx_32 = 32; do { - x32_temp = xx_32; yy_32 = 32; do { @@ -8571,9 +8325,9 @@ LABEL_232: } while ( yy_32 ); tmp_pbDst -= 800; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 2: // lower (solid), with lighting /* @@ -8605,8 +8359,7 @@ LABEL_68: { tmp_pbDst += yy_32; y_minus = 32 - yy_32; - l_index = (32 - (_BYTE)yy_32) & 2; - pdung_cels += l_index; + pdung_cels += (32 - (_BYTE)yy_32) & 2; do { *tmp_pbDst++ = l_tbl[*pdung_cels++]; @@ -8628,8 +8381,7 @@ LABEL_68: { tmp_pbDst += xx_32; x_minus = 32 - xx_32; - l_index = (32 - (_BYTE)xx_32) & 2; - pdung_cels += l_index; + pdung_cels += (32 - (_BYTE)xx_32) & 2; do { *tmp_pbDst++ = l_tbl[*pdung_cels++]; @@ -8676,8 +8428,7 @@ LABEL_83: --y_minus; } while ( y_minus ); - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst = &tmp_pbDst[yy_32 - 800]; yy_32 += 2; } @@ -8698,8 +8449,7 @@ LABEL_83: --x_minus; } while ( x_minus ); - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; } @@ -8758,8 +8508,7 @@ LABEL_100: { tmp_pbDst += xx_32; block_4 = 32 - xx_32; - l_index = (32 - (_BYTE)xx_32) & 2; - pdung_cels += l_index; + pdung_cels += (32 - (_BYTE)xx_32) & 2; if ( (char)(32 - xx_32) >= 4 ) { do @@ -8853,8 +8602,7 @@ LABEL_116: pdung_cels += 2; tmp_pbDst += 2; } - l_index = (unsigned char)pdung_cels & 2; - pdung_cels += l_index; + pdung_cels += (unsigned char)pdung_cels & 2; tmp_pbDst = &tmp_pbDst[xx_32 - 800]; xx_32 -= 2; } @@ -8917,7 +8665,6 @@ LABEL_116: xx_32 = 32; do { - x32_temp = xx_32; yy_32 = 32; do { @@ -8973,9 +8720,9 @@ LABEL_116: while ( yy_32 ); LABEL_143: tmp_pbDst -= 800; - xx_32 = x32_temp - 1; + --xx_32; } - while ( x32_temp != 1 ); + while ( xx_32 ); break; case 10: // lower (solid), without lighting /* From 1ec606131c7df9f9721736e9cb7311c002c71922 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Mon, 27 Aug 2018 01:42:52 -0500 Subject: [PATCH 5/5] render.cpp -> add bug notes --- Source/render.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/render.cpp b/Source/render.cpp index b681f9ecd..440d82d41 100644 --- a/Source/render.cpp +++ b/Source/render.cpp @@ -1400,7 +1400,7 @@ LABEL_268: pdung_cels += 4; tmp_pbDst += 4; } - if ( x_minus & 2 ) /* should be y_minus */ + if ( x_minus & 2 ) /// BUGFIX: change to `y_minus & 2` { tmp_pbDst[1] = pdung_cels[1]; pdung_cels += 4; @@ -1416,7 +1416,7 @@ LABEL_268: pdung_cels += 4; tmp_pbDst += 4; } - if ( x_minus & 2 ) /* should be y_minus */ + if ( x_minus & 2 ) /// BUGFIX: change to `y_minus & 2` { tmp_pbDst[0] = pdung_cels[0]; pdung_cels += 4; @@ -6138,7 +6138,7 @@ LABEL_308: tmp_pbDst[0] = pdung_cels[2]; pdung_cels += 4; tmp_pbDst += 2; - --n_draw_shift; /* check SHOULDNT BE HERE */ + --n_draw_shift; /// BUGFIX: delete this line } if ( n_draw_shift ) { @@ -7207,7 +7207,7 @@ LABEL_80: { tmp_pbDst[0] = _EBX[pdung_cels[0]]; tmp_pbDst[1] = _EBX[pdung_cels[1]]; - pdung_cels += 2; /* check SHOULD BE +4 */ + pdung_cels += 2; /// BUGFIX: change to `pdung_cels += 4` tmp_pbDst += 2; } tmp_pbDst = &tmp_pbDst[yy_32 - 800];