Get Screen Resolution

Code return:
Screen resolution with float and int format .
Everything depends which one you need use in your code...

PHP:
:getScreenResolution
//0AB1: @getScreenResolution 0 ScreenX {Float} 0@ ScreenY {Float} 1@ ScreenX {int} 2@ ScreenY {int} 3@
0A8D: 0@ = read_memory 0xC17044 size 4 virtual_protect 0 // (int) full screen X
0085: 4@ = 0@ // copy (int) full screen X
0093: 0@ = integer 0@ to_float
7@ = 640.0 // screen X
0A8D: 1@ = read_memory 0xC17048 size 4 virtual_protect 0 // (int) full screen Y
0085: 5@ = 1@ // copy (int) full screen Y
0093: 1@ = integer 1@ to_float
8@ = 448.0 // screen Y
0087: 2@ = 0@ // copy (float) full screen X
0087: 3@ = 1@ // copy (float) full screen Y
10@ = 1280.0 // screen X * 2
11@ = 896.0 // screen Y * 2
if 0@ > 640.0
then
    0063: 2@ -= 7@  // (float)
    0063: 0@ -= 2@  // (float)
end
if 0@ < 640.0
then
    005B: 2@ += 10@  // (float)
    0063: 2@ -= 7@  // (float)
    0063: 0@ -= 2@  // (float)
end
if 1@ > 448.0
then
    0063: 3@ -= 8@  // (float)
    0063: 1@ -= 3@  // (float)
end  
if 1@ < 448.0
then
    005B: 3@ += 11@  // (float)
    0063: 3@ -= 8@  // (float)
    0063: 1@ -= 3@  // (float)
end   
0AB2: ret 4 0@ 1@ 4@ 5@
 
Last edited:
Top