BACKUP ~after_backup~ AUTHOR ~aqrit~ README ~~ VERSION ~test3~ // the size of panel was expanded to fill screen by adding black bars around the edges to center the original background // so here we fixup the control (buttons, labels, etc.) positions for the new size of the panel. // Arg: panel_index DEFINE_PATCH_MACRO FixupChuPanel BEGIN READ_LONG 0x10 offset_panels WRITE_SHORT ( offset_panels + ( panel_index * 0x1C ) + 0x04 ) 0 WRITE_SHORT ( offset_panels + ( panel_index * 0x1C ) + 0x06 ) 0 WRITE_SHORT ( offset_panels + ( panel_index * 0x1C ) + 0x08 ) Xnew WRITE_SHORT ( offset_panels + ( panel_index * 0x1C ) + 0x0A ) Ynew READ_LONG 0x0C offset_controls READ_SHORT ( offset_panels + panel_index * 0x1C + 0x0E ) num_controls READ_SHORT ( offset_panels + panel_index * 0x1C + 0x18 ) controls_index FOR (j = 0; j < num_controls; j += 1) BEGIN READ_LONG offset_controls + ( ( controls_index + j ) * 0x08 ) ctrl READ_SHORT ( ctrl + 0x04 ) x READ_SHORT ( ctrl + 0x06 ) y WRITE_SHORT ( ctrl + 0x04 ) x + ( Xnew - 640 ) / 2 WRITE_SHORT ( ctrl + 0x06 ) y + ( Ynew - 480 ) / 2 END END BEGIN ~4CD~ SUBCOMPONENT ~after~ PRINT ~enter width:~ ACTION_READLN ~Xnew~ PRINT ~enter height:~ ACTION_READLN ~Ynew~ // load and save menus: fill unused portions of the background with black COPY_EXISTING ~SGMOS.MOS~ ~override/SGMOS.MOS~ EXTEND_MOS ~HCENT~ ~Xnew~ EXTEND_MOS ~VCENT~ ~Ynew~ COPY_EXISTING ~guiload.chu~ ~override/guiload.chu~ SET panel_index = 0 LAUNCH_PATCH_MACRO FixupChuPanel COPY_EXISTING ~guisave.chu~ ~override/guisave.chu~ SET panel_index = 0 LAUNCH_PATCH_MACRO FixupChuPanel // main menu: fill unused portions of the background with black COPY_EXISTING ~IDMOS.MOS~ ~override/IDMOS.MOS~ EXTEND_MOS ~HCENT~ ~Xnew~ EXTEND_MOS ~VCENT~ ~Ynew~ COPY_EXISTING ~start.chu~ ~override/start.chu~ // can't use the macro here... //IDMOS.MOS WRITE_SHORT "0x00000018" 0 WRITE_SHORT "0x0000001A" 0 WRITE_SHORT "0x0000001C" Xnew WRITE_SHORT "0x0000001E" Ynew // SPNEWGM.BAM WRITE_SHORT "0x000000D0" Xnew / 2 - 74 WRITE_SHORT "0x000000D2" Ynew / 2 - 90 // IDQUIT.BAM WRITE_SHORT "0x000000F0" Xnew / 2 - 117 WRITE_SHORT "0x000000F2" Ynew / 2 - 2 // SPLOAD.BAM WRITE_SHORT "0x00000110" Xnew / 2 + 29 WRITE_SHORT "0x00000112" Ynew / 2 - 1 COPY ~Torment.exe~ ~Torment.exe~ // Sleep CPU When Idle DEFINE_ARRAY sleep BEGIN 0x8B 0x4D 0xB8 0x83 0xB9 0xC6 0x32 0x00 0x00 0x00 0x75 0x2F 0x83 0xB9 0xCA 0x32 0x00 0x00 0x01 0x75 0x26 0xC7 0x81 0xCA 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0xC7 0x81 0xCE 0x32 0x00 0x00 0x01 0x00 0x00 0x00 0x8B 0x11 0x51 0xFF 0x12 0x59 0xC7 0x81 0xCE 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0xEB 0x0E 0x68 0x01 0x00 0x00 0x00 0xFF 0x15 0xA8 0xB2 0x8D 0x00 0x90 0x90 0x90 END PATCH_PHP_EACH sleep AS index => value BEGIN WRITE_BYTE ( 0x0042569B + index ) %value% END //// Draw Menu Backgrounds //// DEFINE_ARRAY inv BEGIN 0x55 0x89 0xCD 0xE8 0x51 0x5F 0x1B 0x00 0x53 0x31 0xDB 0x53 0x89 0xE9 0x83 0xC1 0x30 0xE8 0xD4 0x82 0xED 0xFF 0x85 0xC0 0x74 0x0C 0x89 0xC1 0x68 0x00 0x00 0x00 0x00 0xE8 0x19 0x74 0xED 0xFF 0x43 0x83 0xFB 0x20 0x75 0xDF 0x89 0xE9 0xE8 0x89 0xB1 0xFC 0xFF 0x5B 0x5D 0xC3 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 END PATCH_PHP_EACH inv AS index => value BEGIN WRITE_BYTE ( 0x00220F4F + index ) %value% END DEFINE_ARRAY wiz BEGIN 0x51 0xE8 0x73 0x9D 0xF9 0xFF 0x59 0xE8 0xBC 0xFA 0xFF 0xFF 0xC3 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 END PATCH_PHP_EACH wiz AS index => value BEGIN WRITE_BYTE ( 0x002871D6 + index ) %value% END DEFINE_ARRAY priest BEGIN 0x51 0xE8 0x5C 0xEA 0xFB 0xFF 0x59 0xE8 0xB9 0xFA 0xFF 0xFF 0xC3 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 END PATCH_PHP_EACH priest AS index => value BEGIN WRITE_BYTE ( 0x002624ED + index ) %value% END WRITE_LONG 0x004E31DC 0x00620F4F // stat screen WRITE_LONG 0x004E9290 0x00620F4F // store screen /////////////////// BEGIN ~2CD~ SUBCOMPONENT ~after~ PRINT ~enter width:~ ACTION_READLN ~Xnew~ PRINT ~enter height:~ ACTION_READLN ~Ynew~ // load and save menus: fill unused portions of the background with black COPY_EXISTING ~SGMOS.MOS~ ~override/SGMOS.MOS~ EXTEND_MOS ~HCENT~ ~Xnew~ EXTEND_MOS ~VCENT~ ~Ynew~ COPY_EXISTING ~guiload.chu~ ~override/guiload.chu~ SET panel_index = 0 LAUNCH_PATCH_MACRO FixupChuPanel COPY_EXISTING ~guisave.chu~ ~override/guisave.chu~ SET panel_index = 0 LAUNCH_PATCH_MACRO FixupChuPanel // main menu: fill unused portions of the background with black COPY_EXISTING ~IDMOS.MOS~ ~override/IDMOS.MOS~ EXTEND_MOS ~HCENT~ ~Xnew~ EXTEND_MOS ~VCENT~ ~Ynew~ COPY_EXISTING ~start.chu~ ~override/start.chu~ // can't use the macro here... //IDMOS.MOS WRITE_SHORT "0x00000018" 0 WRITE_SHORT "0x0000001A" 0 WRITE_SHORT "0x0000001C" Xnew WRITE_SHORT "0x0000001E" Ynew // SPNEWGM.BAM WRITE_SHORT "0x000000D0" Xnew / 2 - 74 WRITE_SHORT "0x000000D2" Ynew / 2 - 90 // IDQUIT.BAM WRITE_SHORT "0x000000F0" Xnew / 2 - 117 WRITE_SHORT "0x000000F2" Ynew / 2 - 2 // SPLOAD.BAM WRITE_SHORT "0x00000110" Xnew / 2 + 29 WRITE_SHORT "0x00000112" Ynew / 2 - 1 COPY ~Torment.exe~ ~Torment.exe~ // Sleep CPU When Idle DEFINE_ARRAY sleep BEGIN 0x8B 0x4D 0xB8 0x83 0xB9 0xC6 0x32 0x00 0x00 0x00 0x75 0x2F 0x83 0xB9 0xCA 0x32 0x00 0x00 0x01 0x75 0x26 0xC7 0x81 0xCA 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0xC7 0x81 0xCE 0x32 0x00 0x00 0x01 0x00 0x00 0x00 0x8B 0x11 0x51 0xFF 0x12 0x59 0xC7 0x81 0xCE 0x32 0x00 0x00 0x00 0x00 0x00 0x00 0xEB 0x0E 0x68 0x01 0x00 0x00 0x00 0xFF 0x15 0xAC 0xC2 0x8D 0x00 0x90 0x90 0x90 END PATCH_PHP_EACH sleep AS index => value BEGIN WRITE_BYTE ( 0x004262FB + index ) %value% END //// Draw Menu Backgrounds //// DEFINE_ARRAY inv BEGIN 0x55 0x89 0xCD 0xE8 0x51 0x5F 0x1B 0x00 0x53 0x31 0xDB 0x53 0x89 0xE9 0x83 0xC1 0x30 0xE8 0x54 0x84 0xED 0xFF 0x85 0xC0 0x74 0x0C 0x89 0xC1 0x68 0x00 0x00 0x00 0x00 0xE8 0x99 0x75 0xED 0xFF 0x43 0x83 0xFB 0x20 0x75 0xDF 0x89 0xE9 0xE8 0x89 0xB1 0xFC 0xFF 0x5B 0x5D 0xC3 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 END PATCH_PHP_EACH inv AS index => value BEGIN WRITE_BYTE ( 0x00220D8F + index ) %value% END DEFINE_ARRAY wiz BEGIN 0x51 0xE8 0x73 0x9D 0xF9 0xFF 0x59 0xE8 0xBC 0xFA 0xFF 0xFF 0xC3 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 END PATCH_PHP_EACH wiz AS index => value BEGIN WRITE_BYTE ( 0x00287016 + index ) %value% END DEFINE_ARRAY priest BEGIN 0x51 0xE8 0x5C 0xEA 0xFB 0xFF 0x59 0xE8 0xB9 0xFA 0xFF 0xFF 0xC3 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 0x90 END PATCH_PHP_EACH priest AS index => value BEGIN WRITE_BYTE ( 0x0026232D + index ) %value% END WRITE_LONG 0x004E41EC 0x00620D8F // stat screen WRITE_LONG 0x004EA2A0 0x00620D8F // store screen