alloc(newmem,2048,"DiabloImmortal.exe"+748302)
label(returnhere)
label(exit)
label(if01)


newmem:

// new 2
// test byte ptr [rdi+00000208],20 = bat 00 = tat
// byte ptr [rdi+158],3F > 0F tat fog

//[rdi+270] = float X LEFT+UP 511
//[rdi+274] = float Y LEFT+UP 510

//[rdi+2B8] = float X RIGHT+DOWN 677
//[rdi+2BC] = float Y RIGHT+DOWN 383

//[rdi+218] = float 572
//[rdi+78] = float (float)0.42


// new 3

// byte ptr [r14+18],3F > 0F tat fog
// byte ptr [r14+38],1F = bat 00 tat
// byte ptr [r14+50],40 = bat

//x RIGHT [r14-10] float 685 autoit 655
//y DOWN [r14-C] float 508  autoit 75
//x LEFT [r14-8] float 559 autoit 585
//y_max [r14-4] float 382 autoit 10






push rax
push rbx
push rcx

// Quản lý bộ đệm bộ nhớ:
// [rax+0]  -> Slot 1 (Flat cũ)
// [rax+8]  -> Slot 2 (Flat mới nhất)
// [rax+50] đến [rax+C8] -> History Storage (16 slots)
mov rax,newmem+500

// =========================================================================
// 1. AUTO REMOVE FOG FOR ALL TILES
// =========================================================================
cmp r14,0
je if01
cmp byte ptr [r14+18],3F
jne if01
cmp byte ptr [r14+38],1F
jne if01
cmp byte ptr [r14+50],40
jne if01
cmp dword ptr [r14-10],(float)665
jb if01
cmp dword ptr [r14-10],(float)705
ja if01
cmp dword ptr [r14-C],(float)488
jb if01
cmp dword ptr [r14-C],(float)528
ja if01
mov byte ptr [r14+18],0F
if01:


exit:
pop rcx
pop rbx
pop rax
jmp returnhere

"DiabloImmortal.exe"+748302:
jmp newmem
returnhere:
