//=============================================================================
//
// This edits the .chu files for the new resolution. 
//
//=============================================================================



COPY_EXISTING ~guicg.chu~ ~override~
//CGMOSM.MOS
WRITE_SHORT "0x00000018" (Xnew - Xold) / 2
WRITE_SHORT "0x0000001A" (Ynew - Yold) / 2
WRITE_SHORT "0x0000001C" Xold
WRITE_SHORT "0x0000001E" Yold
//GPMOS8.MOS
WRITE_SHORT "0x00000034" (Xnew - 640) / 2 + 214
WRITE_SHORT "0x00000036" (Ynew - 480) / 2 + 32


COPY_EXISTING ~guiinv.chu~ ~override~
//WMMOS1.MOS
WRITE_SHORT "0x0000001A" Ynew - 73
WRITE_SHORT "0x0000001C" 91
WRITE_SHORT "0x0000001E" 73
//WMMOS2.MOS
WRITE_SHORT "0x00000036" Ynew - 73
WRITE_SHORT "0x00000038" Xnew - 214
WRITE_SHORT "0x0000003A" 73
//WMMOS3.MOS
WRITE_SHORT "0x00000050" Xnew - 123
WRITE_SHORT "0x00000052" Ynew - 73
WRITE_SHORT "0x00000054" 123
WRITE_SHORT "0X00000056" 73
//IVMOS.MOS
WRITE_SHORT "0x0000006C" (Xnew - Xold) / 2
WRITE_SHORT "0x00000070" Xold
WRITE_SHORT "0x00000072" 407
//GPMOS9.MOS
WRITE_SHORT "0x00000088" (Xnew - 640) / 2 + 214
//GPMOS4.MOS
WRITE_SHORT "0x000000A4" (Xnew - 640) / 2 + 30
//GPMO11.MOS
WRITE_SHORT "0x000000C0" (Xnew - 640) / 2 + 37
//GPMOS8.MOS
WRITE_SHORT "0x000000DC" (Xnew - 640) / 2 + 214
//GPMOS8.MOS
WRITE_SHORT "0x000000F8" (Xnew - 640) / 2 + 214
//GPMOS8.MOS
WRITE_SHORT "0x00000114" (Xnew - 640) / 2 + 214


COPY_EXISTING ~guijrnl.chu~ ~override~
//GUIJRNL.MOS
WRITE_SHORT "0x00000018" 0
WRITE_SHORT "0x0000001A" 0
WRITE_SHORT "0x0000001C" Xnew
WRITE_SHORT "0x0000001E" Ynew
//buttons:
WRITE_SHORT "0x00000158" (Xnew - 640) / 2 + 322	
WRITE_SHORT "0x0000015A" (Ynew - 480) / 2 + 407	
WRITE_SHORT "0x00000178" (Xnew - 640) / 2 + 346	
WRITE_SHORT "0x0000017A" (Ynew - 480) / 2 + 350	
WRITE_SHORT "0x00000198" (Xnew - 640) / 2 + 432	
WRITE_SHORT "0x0000019A" (Ynew - 480) / 2 + 350	
WRITE_SHORT "0x000001B8" (Xnew - 640) / 2 + 541	
WRITE_SHORT "0x000001BA" (Ynew - 480) / 2 + 378	
//GUIJRNL.MOS
WRITE_SHORT "0x00000034" 0
WRITE_SHORT "0x00000036" 0
WRITE_SHORT "0x00000038" Xnew
WRITE_SHORT "0x0000003A" Ynew
//buttons:
WRITE_SHORT "0x000001D8" (Xnew - 640) / 2 + 541	
WRITE_SHORT "0x000001DA" (Ynew - 480) / 2 + 378	
WRITE_SHORT "0x000001F8" (Xnew - 640) / 2 + 52	
WRITE_SHORT "0x000001FA" (Ynew - 480) / 2 + 51	
WRITE_SHORT "0x00000226" (Xnew - 640) / 2 + 299	
WRITE_SHORT "0x00000228" (Ynew - 480) / 2 + 21	
WRITE_SHORT "0x0000024E" (Xnew - 640) / 2 + 365	
WRITE_SHORT "0x00000250" (Ynew - 480) / 2 + 51	
WRITE_SHORT "0x0000027C" (Xnew - 640) / 2 + 324	
WRITE_SHORT "0x0000027E" (Ynew - 480) / 2 + 21	
WRITE_SHORT "0x000002A4" (Xnew - 640) / 2 + 408	
WRITE_SHORT "0x000002A6" (Ynew - 480) / 2 + 407	
WRITE_SHORT "0x000002C4" (Xnew - 640) / 2 + 52	
WRITE_SHORT "0x000002C6" (Ynew - 480) / 2 + 22	
WRITE_SHORT "0x000002E8" (Xnew - 640) / 2 + 365	
WRITE_SHORT "0x000002EA" (Ynew - 480) / 2 + 22	
WRITE_SHORT "0x0000030C" (Xnew - 640) / 2 + 346	
WRITE_SHORT "0x0000030E" (Ynew - 480) / 2 + 350	
WRITE_SHORT "0x0000032C" (Xnew - 640) / 2 + 432	
WRITE_SHORT "0x0000032E" (Ynew - 480) / 2 + 350	
//GUIJRNL.MOS
WRITE_SHORT "0x00000050" 0
WRITE_SHORT "0x00000052" 0
WRITE_SHORT "0x00000054" Xnew
WRITE_SHORT "0x00000056" Ynew
//buttons:
WRITE_SHORT "0x0000034C" (Xnew - 640) / 2 + 541	
WRITE_SHORT "0x0000034E" (Ynew - 480) / 2 + 378	
WRITE_SHORT "0x0000036C" (Xnew - 640) / 2 + 408	
WRITE_SHORT "0x0000036E" (Ynew - 480) / 2 + 407	
WRITE_SHORT "0x0000038C" (Xnew - 640) / 2 + 35	
WRITE_SHORT "0x0000038E" (Ynew - 480) / 2 + 35	
WRITE_SHORT "0x000003BA" (Xnew - 640) / 2 + 299	
WRITE_SHORT "0x000003BC" (Ynew - 480) / 2 + 21	
//GUIJRN2.MOS
WRITE_SHORT "0x0000006C" 0
WRITE_SHORT "0x0000006E" 0
WRITE_SHORT "0x00000070" Xnew
WRITE_SHORT "0x00000072" Ynew
//Buttons:
WRITE_SHORT "0x000003E2" (Xnew - 640) / 2 + 324	
WRITE_SHORT "0x000003E4" (Ynew - 480) / 2 + 26	
WRITE_SHORT "0x00000410" (Xnew - 640) / 2 + 300	
WRITE_SHORT "0x00000412" (Ynew - 480) / 2 + 11	
WRITE_SHORT "0x00000438" (Xnew - 640) / 2 + 324	
WRITE_SHORT "0x0000043A" (Ynew - 480) / 2 + 175	
WRITE_SHORT "0x00000466" (Xnew - 640) / 2 + 300	
WRITE_SHORT "0x00000468" (Ynew - 480) / 2 + 173	
WRITE_SHORT "0x0000048E" (Xnew - 640) / 2 + 541	
WRITE_SHORT "0x00000490" (Ynew - 480) / 2 + 378	
WRITE_SHORT "0x000004AE" (Xnew - 640) / 2 + 346	
WRITE_SHORT "0x000004B0" (Ynew - 480) / 2 + 350	
WRITE_SHORT "0x000004CE" (Xnew - 640) / 2 + 432	
WRITE_SHORT "0x000004D0" (Ynew - 480) / 2 + 350	
WRITE_SHORT "0X000004EE" (Xnew - 640) / 2 + 408	
WRITE_SHORT "0x000004F0" (Ynew - 480) / 2 + 407	



COPY_EXISTING ~guiload.chu~ ~override~
//SGMOS.MOS
WRITE_SHORT "0x00000018" (Xnew - 640) / 2
WRITE_SHORT "0x0000001A" (Ynew - 480) / 2
WRITE_SHORT "0x0000001C" 640
WRITE_SHORT "0x0000001E" 480
//GPMOS2.MOS
WRITE_SHORT "0x000000034" (Xnew - 640) / 2 + 137
WRITE_SHORT "0x000000036" (Ynew - 480) / 2 + 123


COPY_EXISTING ~guima.chu~ ~override~
//WMMOS1.MOS
WRITE_SHORT "0x0000001A" Ynew - 73
WRITE_SHORT "0x0000001C" 91
WRITE_SHORT "0x0000001E" 73
//WMMOS2.MOS
WRITE_SHORT "0x00000036" Ynew - 73
WRITE_SHORT "0x00000038" Xnew - 214
WRITE_SHORT "0x0000003A" 73
//WMMOS3.MOS
WRITE_SHORT "0x00000050" Xnew - 123
WRITE_SHORT "0x00000052" Ynew - 73
WRITE_SHORT "0x00000054" 123
WRITE_SHORT "0X00000056" 73
//MAPANEL.MOS
WRITE_SHORT "0x0000006C" 0
WRITE_SHORT "0x00000070" Xnew
WRITE_SHORT "0x00000072" Ynew - 73
/////Buttons-notes-background
WRITE_SHORT "0x00000530" (Xnew - 640) / 2 + 24
WRITE_SHORT "0x00000532" (Ynew - 407) / 2 + 23 - 37
WRITE_SHORT "0x000004F0" (Xnew - 640) / 2 + 560
WRITE_SHORT "0x000004F2" (Ynew - 407) / 2 + 41 - 37
WRITE_SHORT "0x00000510" (Xnew - 640) / 2 + 540
WRITE_SHORT "0x00000512" (Ynew - 407) / 2 + 250 - 37
WRITE_SHORT "0x00000530" (Xnew - 640) / 2 + 24
WRITE_SHORT "0x00000532" (Ynew - 407) / 2 + 23 - 37
WRITE_SHORT "0x00000550" (Xnew - 640) / 2 + 54
WRITE_SHORT "0x00000552" (Ynew - 407) / 2 + 353 - 37
WRITE_SHORT "0x000005BA" (Xnew - 640) / 2 + 588
WRITE_SHORT "0x000005BC" (Ynew - 407) / 2 + 320 - 37
WRITE_SHORT "0x000005DA" (Xnew - 640) / 2 + 184
WRITE_SHORT "0x000005DC" (Ynew - 407) / 2 + 26 - 37



COPY_EXISTING ~guimg.chu~ ~override~
//WMMOS1.MOS
WRITE_SHORT "0x0000001A" Ynew - 73
WRITE_SHORT "0x0000001C" 91
WRITE_SHORT "0x0000001E" 73
//WMMOS2.MOS
WRITE_SHORT "0x00000036" Ynew - 73
WRITE_SHORT "0x00000038" Xnew - 214
WRITE_SHORT "0x0000003A" 73
//WMMOS3.MOS
WRITE_SHORT "0x00000050" Xnew - 123
WRITE_SHORT "0x00000052" Ynew - 73
WRITE_SHORT "0x00000054" 123
WRITE_SHORT "0X00000056" 73
//MGMOS1.MOS
WRITE_SHORT "0x0000006C" (Xnew - Xold) / 2
WRITE_SHORT "0x00000070" Xold
WRITE_SHORT "0x00000072" 407
//GPMOS4.MOS
WRITE_SHORT "0x00000088" (Xnew - 640) / 2 + 29
//GPMOS8.MOS: 
WRITE_SHORT "0x000000A4" (Xnew - 640) / 2 + 198
//GPMOS8.MOS: 
WRITE_SHORT "0x000000C0" (Xnew - 640) / 2 + 198


COPY_EXISTING ~GUIMOVIE.CHU~ ~override~
WRITE_SHORT "0x00000018" (Xnew - 640) / 2
WRITE_SHORT "0x0000001A" (Ynew - 480) / 2


COPY_EXISTING ~guiopt.chu~ ~override~
//OSMOS.MOS
WRITE_SHORT "0x00000018" 0
WRITE_SHORT "0x0000001A" 0
WRITE_SHORT "0x0000001C" Xnew
WRITE_SHORT "0x0000001E" Ynew
//buttons:
WRITE_SHORT "0x000004AC" (Xnew - 640) / 2 + 281
WRITE_SHORT "0x000004AE" (Ynew - 480) / 2 + 355
WRITE_SHORT "0x000004CC" (Xnew - 640) / 2 + 515
WRITE_SHORT "0x000004CE" (Ynew - 480) / 2 + 336
WRITE_SHORT "0x000004EC" (Xnew - 640) / 2 + 510
WRITE_SHORT "0x000004EE" (Ynew - 480) / 2 + 198
WRITE_SHORT "0x0000050C" (Xnew - 640) / 2 + 414
WRITE_SHORT "0x0000050E" (Ynew - 480) / 2 + 92
WRITE_SHORT "0x0000052C" (Xnew - 640) / 2 + 148
WRITE_SHORT "0x0000052E" (Ynew - 480) / 2 + 91
WRITE_SHORT "0x0000054C" (Xnew - 640) / 2 + 53
WRITE_SHORT "0x0000054E" (Ynew - 480) / 2 + 197
WRITE_SHORT "0x0000056C" (Xnew - 640) / 2 + 281
WRITE_SHORT "0x0000056E" (Ynew - 480) / 2 + 49
WRITE_SHORT "0x0000058C" (Xnew - 640) / 2 + 47
WRITE_SHORT "0x0000058E" (Ynew - 480) / 2 + 335
WRITE_SHORT "0x000005AC" (Xnew - 640) / 2 + 478
WRITE_SHORT "0x000005AE" (Ynew - 480) / 2 + 451
WRITE_SHORT "0x000005D0" (Xnew - 640) / 2 + 281
WRITE_SHORT "0x000005D2" (Ynew - 480) / 2 + 202
//GPMOS3.MOS:
WRITE_SHORT "0x00000034" (Xnew - 640) / 2
WRITE_SHORT "0x00000036" (Ynew - 480) / 2
WRITE_SHORT "0x00000038" 640
WRITE_SHORT "0x0000003A" 480
//GPMOS.MOS:
WRITE_SHORT "0x00000050" (Xnew - 640) / 2 + 214
WRITE_SHORT "0x00000052" (Ynew - 480) / 2 + 32
//GPMOS.MOS: 
WRITE_SHORT "0x0000006C" (Xnew - 640) / 2 + 214
WRITE_SHORT "0x0000006E" (Ynew - 480) / 2 + 32
//GPMOS.MOS: 
WRITE_SHORT "0x00000088" (Xnew - 640) / 2 + 214
WRITE_SHORT "0x0000008A" (Ynew - 480) / 2 + 32
//GPMOS3.MOS: 
WRITE_SHORT "0x000000A4" (Xnew - 640) / 2
WRITE_SHORT "0x000000A6" (Ynew - 480) / 2
WRITE_SHORT "0x000000A8" 640
WRITE_SHORT "0x000000AA" 480
//GPMOS3.MOS: 
WRITE_SHORT "0x000000C0" (Xnew - 640) / 2
WRITE_SHORT "0x000000C2" (Ynew - 480) / 2
WRITE_SHORT "0x000000C4" 640
WRITE_SHORT "0x000000C6" 480
//GPMOS3.MOS: 
WRITE_SHORT "0x000000DC" (Xnew - 640) / 2
WRITE_SHORT "0x000000DE" (Ynew - 480) / 2
WRITE_SHORT "0x000000E0" 640
WRITE_SHORT "0x000000E2" 480
//GPMOS3.MOS: 
WRITE_SHORT "0x000000F8" (Xnew - 640) / 2
WRITE_SHORT "0x000000FA" (Ynew - 480) / 2
WRITE_SHORT "0x000000FC" 640
WRITE_SHORT "0x000000FE" 480


COPY_EXISTING ~guipr.chu~ ~override~
//WMMOS1.MOS
WRITE_SHORT "0x0000001A" Ynew - 73
WRITE_SHORT "0x0000001C" 91
WRITE_SHORT "0x0000001E" 73
//WMMOS2.MOS
WRITE_SHORT "0x00000036" Ynew - 73
WRITE_SHORT "0x00000038" Xnew - 214
WRITE_SHORT "0x0000003A" 73
//WMMOS3.MOS
WRITE_SHORT "0x00000050" Xnew - 123
WRITE_SHORT "0x00000052" Ynew - 73
WRITE_SHORT "0x00000054" 123
WRITE_SHORT "0X00000056" 73
//PRMOS1.MOS:
WRITE_SHORT "0x0000006C" (Xnew - Xold) / 2
WRITE_SHORT "0x00000070" Xold
WRITE_SHORT "0x00000072" 407
//GPMOS4.MOS:
WRITE_SHORT "0x00000088" (Xnew - 640) / 2 + 29
//GPMOS8.MOS 
WRITE_SHORT "0x000000A4" (Xnew - 640) / 2 + 198
//GPMOS8.MOS 
WRITE_SHORT "0x000000C0" (Xnew - 640) / 2 + 198


COPY_EXISTING ~guirec.chu~ ~override~
//WMMOS1.MOS
WRITE_SHORT "0x0000001A" Ynew - 73
WRITE_SHORT "0x0000001C" 91
WRITE_SHORT "0x0000001E" 73
//WMMOS2.MOS
WRITE_SHORT "0x00000036" Ynew - 73
WRITE_SHORT "0x00000038" Xnew - 214
WRITE_SHORT "0x0000003A" 73
//WMMOS3.MOS
WRITE_SHORT "0x00000050" Xnew - 123
WRITE_SHORT "0x00000052" Ynew - 73
WRITE_SHORT "0x00000054" 123
WRITE_SHORT "0X00000056" 73
//STMOS.MOS:
WRITE_SHORT "0x0000006C" (Xnew - Xold) / 2
WRITE_SHORT "0x00000070" Xold
WRITE_SHORT "0x00000072" 407
//LUMOS.MOS
WRITE_SHORT "0x00000088" (Xnew - 640) / 2 + 5
//GPMOS7.MOS:
WRITE_SHORT "0x000000A4" (Xnew - 640) / 2 + 41
//DCMOS1.MOS:
WRITE_SHORT "0x000000C0" (Xnew - 640) / 2 + 40
//CLMOS.MOS:
WRITE_SHORT "0x000000DC" (Xnew - 640) / 2 + 40
//SKMOS.MOS:
WRITE_SHORT "0x000000F8" (Xnew - 640) / 2 + 40
//CMMOS.MOS:
WRITE_SHORT "0x00000114" (Xnew - 640) / 2 + 40
//GPMOS2.MOS:
WRITE_SHORT "0x00000130" (Xnew - 640) / 2 + 121
//GPMOS2.MOS: 
WRITE_SHORT "0x0000014C" (Xnew - 640) / 2 + 121
//BPMOS1.MOS:
WRITE_SHORT "0x00000168" (Xnew - 640) / 2 + 5
//SMMOS1.MOS
WRITE_SHORT "0x00000184" (Xnew - 640) / 2 + 40
//PPMOS.MOS
WRITE_SHORT "0x000001A0" (Xnew - 640) / 2 + 40
//ZPMOS1.MOS
WRITE_SHORT "0x000001BC" (Xnew - 640) / 2 + 5
//ZPMOS1.MOS 
WRITE_SHORT "0x000001D8" (Xnew - 640) / 2 + 5
//ZPMOS1.MOS 
WRITE_SHORT "0x000001F4" (Xnew - 640) / 2 + 5


COPY_EXISTING ~guisave.chu~ ~override~
//SGMOS.MOS
WRITE_SHORT "0x00000018" (Xnew - 640) / 2
WRITE_SHORT "0x0000001A" (Ynew - 480) / 2
WRITE_SHORT "0x0000001C" 640
WRITE_SHORT "0x0000001E" 480
//SGMOS2.MOS
WRITE_SHORT "0x00000034" 0
WRITE_SHORT "0x00000036" 0
WRITE_SHORT "0x00000038" Xnew
WRITE_SHORT "0x0000003A" Ynew
//buttons-text
WRITE_SHORT "0x00000894" (Xnew - 538) / 2 + 54
WRITE_SHORT "0x00000896" (Ynew - 272) / 2 + 80
WRITE_SHORT "0x000008B4" (Xnew - 538) / 2 + 216
WRITE_SHORT "0x000008B6" (Ynew - 272) / 2 + 50
WRITE_SHORT "0x000008D8" (Xnew - 538) / 2 + 216
WRITE_SHORT "0x000008DA" (Ynew - 272) / 2 + 78
WRITE_SHORT "0x000008FC" (Xnew - 538) / 2 + 242	
WRITE_SHORT "0x000008FE" (Ynew - 272) / 2 + 224
WRITE_SHORT "0x0000091C" (Xnew - 538) / 2 + 377
WRITE_SHORT "0x0000091E" (Ynew - 272) / 2 + 224
WRITE_SHORT "0x0000093C" (Xnew - 538) / 2 + 201
WRITE_SHORT "0x0000093E" (Ynew - 272) / 2 + 179
WRITE_SHORT "0x0000095C" (Xnew - 538) / 2 + 233
WRITE_SHORT "0x0000095E" (Ynew - 272) / 2 + 179
WRITE_SHORT "0x0000097C" (Xnew - 538) / 2 + 265
WRITE_SHORT "0x0000097E" (Ynew - 272) / 2 + 179
WRITE_SHORT "0x0000099C" (Xnew - 538) / 2 + 297
WRITE_SHORT "0x0000099E" (Ynew - 272) / 2 + 179
WRITE_SHORT "0x000009BC" (Xnew - 538) / 2 + 329
WRITE_SHORT "0x000009BE" (Ynew - 272) / 2 + 179
WRITE_SHORT "0x000009DC" (Xnew - 538) / 2 + 361
WRITE_SHORT "0x000009DE" (Ynew - 272) / 2 + 179
WRITE_SHORT "0x000009FC" (Xnew - 538) / 2 + 216
WRITE_SHORT "0x000009FE" (Ynew - 272) / 2 + 121




//GPMOS2.MOS 
WRITE_SHORT "0x0000006C" (Xnew - 640) / 2 + 137
WRITE_SHORT "0x0000006E" (Ynew - 480) / 2 + 116


COPY_EXISTING ~guistore.chu~ ~override~
//WMMOS1.MOS
WRITE_SHORT "0x0000001A" Ynew - 73
WRITE_SHORT "0x0000001C" 91
WRITE_SHORT "0x0000001E" 73
//WMMOS2.MOS
WRITE_SHORT "0x00000036" Ynew - 73
WRITE_SHORT "0x00000038" Xnew - 214
WRITE_SHORT "0x0000003A" 73
//WMMOS3.MOS
WRITE_SHORT "0x00000050" Xnew - 123
WRITE_SHORT "0x00000052" Ynew - 73
WRITE_SHORT "0x00000054" 123
WRITE_SHORT "0X00000056" 73
//SSMOSMP.MOS:
WRITE_SHORT "0x0000006C" (Xnew - 640) / 2
WRITE_SHORT "0x0000006E" (Ynew - 480) / 2 + 302
//SSMOSBSL.MOS:
WRITE_SHORT "0x00000088" (Xnew - 640) / 2
WRITE_SHORT "0x0000008A" (Ynew - 480) / 2
//SSMOSIDP.MOS:
WRITE_SHORT "0x000000A4" (Xnew - 640) / 2
WRITE_SHORT "0x000000A6" (Ynew - 480) / 2
//SSMOSBSP.MOS:
WRITE_SHORT "0x000000C0" (Xnew - 640) / 2
WRITE_SHORT "0x000000C2" (Ynew - 480) / 2
//SSMOSSTP.MOS:
WRITE_SHORT "0x000000DC" (Xnew - 640) / 2
WRITE_SHORT "0x000000DE" (Ynew - 480) / 2
//SSMOSRRP.MOS:
WRITE_SHORT "0x000000F8" (Xnew - 640) / 2
WRITE_SHORT "0x000000FA" (Ynew - 480) / 2
//SSMOSBDK.MOS:
WRITE_SHORT "0x00000114" (Xnew - 640) / 2
WRITE_SHORT "0x00000116" (Ynew - 480) / 2
//SSMOSDON.MOS:
WRITE_SHORT "0x00000130" (Xnew - 640) / 2
WRITE_SHORT "0x00000132" (Ynew - 480) / 2
//GPMOS8.MOS: 
WRITE_SHORT "0x0000014C" (Xnew - 640) / 2 + 197
WRITE_SHORT "0x0000014E" (Ynew - 480) / 2 + 4
//GPMOS8.MOS: 
WRITE_SHORT "0x00000168" (Xnew - 640) / 2 + 197
WRITE_SHORT "0x0000016A" (Ynew - 480) / 2 + 4
//GPMOS4.MOS: 
WRITE_SHORT "0x00000184" (Xnew - 640) / 2 + 29
WRITE_SHORT "0x00000186" (Ynew - 480) / 2 + 18
//GPMOS4.MOS: 
WRITE_SHORT "0x000001A0" (Xnew - 640) / 2 + 29
WRITE_SHORT "0x000001A2" (Ynew - 480) / 2 + 18



COPY_EXISTING ~guiworld.chu~ ~override~
//WMMOS1.MOS 
WRITE_SHORT "0x0000001A" Ynew - 73
WRITE_SHORT "0x0000001C" 91
WRITE_SHORT "0x0000001E" 73
//WMMOSDP.MOS:
WRITE_SHORT "0x00000052" Ynew - 310
WRITE_SHORT "0x00000054" Xnew
//LUA.MOS:
WRITE_SHORT "0x0000006E" Ynew - 73
WRITE_SHORT "0x00000070" Xnew
//CPMOSCP.MOS:
WRITE_SHORT "0x0000008A" Ynew - 73
WRITE_SHORT "0x0000008C" Xnew
//WMMOS2.MOS:
WRITE_SHORT "0x000000A6" Ynew - 73
WRITE_SHORT "0x000000A8" Xnew - 214
WRITE_SHORT "0x000000AA" 73
//WMMOS3.MOS:
WRITE_SHORT "0x000000C0" Xnew - 123
WRITE_SHORT "0x000000C2" Ynew - 73
WRITE_SHORT "0x000000C4" 123
WRITE_SHORT "0X000000C6" 73
//GPMOS6.MOS:
WRITE_SHORT "0x000000FA" Ynew - 73
WRITE_SHORT "0x000000FC" Xnew
//CPMOSPPP.MOS:
WRITE_SHORT "0x00000116" Ynew - 73
WRITE_SHORT "0x00000118" Xnew
//GPMOS5.MOS: 
WRITE_SHORT "0x00000132" Ynew - 73
WRITE_SHORT "0x00000134" Xnew
//GPMOS5.MOS: 
WRITE_SHORT "0x0000014E" Ynew - 73
WRITE_SHORT "0x00000150" Xnew
//WMMOSFM.MOS:
WRITE_SHORT "0x0000016A" Ynew - 73
WRITE_SHORT "0x0000016C" Xnew



COPY_EXISTING ~start.chu~ ~override~
//IDMOS.MOS
WRITE_SHORT "0x00000018" (Xnew - Xold) / 2
WRITE_SHORT "0x0000001A" (Ynew - Yold) / 2
WRITE_SHORT "0x0000001C" Xold
WRITE_SHORT "0x0000001E" Yold
//GPMOS8.MOS:
WRITE_SHORT "0x00000034" (Xnew - 640) / 2 + 196
WRITE_SHORT "0x00000036" (Ynew - 480) / 2 + 11
//GPMOS8.MOS:
WRITE_SHORT "0x00000050" (Xnew - 640) / 2 + 196
WRITE_SHORT "0x00000052" (Ynew - 480) / 2 + 11
//GPMOS8.MOS:
WRITE_SHORT "0x0000006C" (Xnew - 640) / 2 + 196
WRITE_SHORT "0x0000006E" (Ynew - 480) / 2 + 11


COPY_EXISTING ~guikeys.chu~ ~override~
READ_LONG "0x08" cWindows       //number of windows
READ_LONG "0x0c" sControls        //starting offset of controls
READ_LONG "0x10" sWindows       //starting offset of windows

//GPMOS8.MOS
WRITE_SHORT "0x00000034" (Xnew - 640) / 2 + 214
WRITE_SHORT "0x00000036" (Ynew - 480) / 2 + 7

//start of comment
//embedding this part in a FOR loop with appropriate conditions can be used for batch editing of windows.
//CAUTION: the script edits EVERY button/label/... (controls) on every window it modifies.
//Starting from this line to...
      SET i=0                                   //resets for each window
      SET ioffset=0

      READ_SHORT sWindows+0x18 iControls        //index of first control
      READ_SHORT sWindows+0xe  cControls        //number of controls
      WRITE_SHORT sWindows+0x4 0                //position x
      WRITE_SHORT sWindows+0x6 0                //position y
      WRITE_SHORT sWindows+0x8 Xnew             //width
      WRITE_SHORT sWindows+0xa Ynew             //height
      FOR (i=0;i < iControls; i=i+1) BEGIN      //setting "ioffset" to the appropriate control in contorl table
          SET ioffset = ioffset + 8
          END
      FOR (i=0; i < cControls; i=i+1) BEGIN    //setting coordinates of "cControls" number of elements beginning from "iControls" numbered element
          READ_SHORT sControls + ioffset oControl  //current control's offset
          READ_SHORT  oControl + 0x4 oldx       //old position x
          READ_SHORT  oControl + 0x6 oldy       //old position y
          WRITE_SHORT oControl + 0x4 oldx + (Xnew - 640) / 2   //new positon x
          WRITE_SHORT oControl + 0x6 oldy + (Ynew - 480) / 2   //new position y
          SET ioffset = ioffset + 8             //adjusting ioffset to next control
          END
      SET sWindows= sWindows + 28     //skipping to next window
//...up to this line



COPY_EXISTING ~guiwmap.chu~ ~override~
PATCH_IF UI = 1 THEN BEGIN
//WMMOSX.MOS:
WRITE_SHORT "0x00000018" 0
WRITE_SHORT "0x0000001A" 0
WRITE_SHORT "0x0000001C" Xnew
WRITE_SHORT "0x0000001E" Ynew
WRITE_SHORT "0x00000044" Xnew / 2 - 36
WRITE_SHORT "0x00000068" Xnew
WRITE_SHORT "0x0000006A" Ynew - 62
END ELSE BEGIN
//WMMOSX.MOS:
WRITE_SHORT "0x00000018" 0
WRITE_SHORT "0x0000001A" 0
WRITE_SHORT "0x0000001C" Xnew
WRITE_SHORT "0x0000001E" Ynew
WRITE_SHORT "0x00000044" Xnew / 2 - 36
WRITE_SHORT "0x00000046" (Ynew - 640)/ 2
WRITE_SHORT "0x00000068" 960
WRITE_SHORT "0x0000006A" 640
WRITE_SHORT "0x00000064" (Xnew - 960) / 2
WRITE_SHORT "0x00000066" (Ynew - 640) / 2 + 62

END END


