@@ -6470,21 +6470,21 @@ function Game.getTempFlagName(byte, tempbit)
64706470 return " Unknown at " .. toHexString (byte ).. " >" .. tempbit ;
64716471end
64726472
6473- function setTempFlag (byte ,tempBit )
6473+ function setTempFlag (byte , tempBit )
64746474 local temp_flag_value = mainmemory .readbyte (temp_flag_boundaries .start [Game .version ] + byte );
6475- temp_flag_value = bit .set (temp_flag_value ,tempBit );
6475+ temp_flag_value = bit .set (temp_flag_value , tempBit );
64766476 mainmemory .writebyte (temp_flag_boundaries .start [Game .version ] + byte , temp_flag_value );
64776477end
64786478
6479- function clearTempFlag (byte ,tempBit )
6479+ function clearTempFlag (byte , tempBit )
64806480 local temp_flag_value = mainmemory .readbyte (temp_flag_boundaries .start [Game .version ] + byte );
6481- temp_flag_value = bit .clear (temp_flag_value ,tempBit );
6481+ temp_flag_value = bit .clear (temp_flag_value , tempBit );
64826482 mainmemory .writebyte (temp_flag_boundaries .start [Game .version ] + byte , temp_flag_value );
64836483end
64846484
6485- function checkTempFlag (byte ,tempBit )
6485+ function checkTempFlag (byte , tempBit )
64866486 local temp_flag_value = mainmemory .readbyte (temp_flag_boundaries .start [Game .version ] + byte );
6487- local return_value = bit .check (temp_flag_value ,tempBit );
6487+ local return_value = bit .check (temp_flag_value , tempBit );
64886488 if return_value then
64896489 print (Game .getTempFlagName (byte , tempBit ).. " is SET" );
64906490 else
@@ -8013,13 +8013,15 @@ end
80138013function Game .getCurrentAnimationIndexAndSize ()
80148014 local current_animation_start_pointer = Game .getCurrentAnimationStartPointer ();
80158015 local animation_block_pointer = Game .getAnimationBlockPointer ();
8016- local diff = ((current_animation_start_pointer - animation_block_pointer ) - 0x80000000 );
8017- for i = 0 , animation_count do
8018- if diff == mainmemory .read_u32_be (animation_block_pointer + i * 0x4 ) then
8019- local size = mainmemory .read_u32_be (animation_block_pointer + (i + 1 )* 0x4 ) - diff ; -- next entry for size calc
8020- -- for some reason, there are empty animations, so continue until size != 0
8021- if size ~= 0 then
8022- return {i , size };
8016+ if (isPointer (animation_block_pointer )) then
8017+ local diff = ((current_animation_start_pointer - animation_block_pointer ) - RDRAMBase );
8018+ for i = 0 , animation_count do
8019+ if diff == mainmemory .read_u32_be (animation_block_pointer + i * 0x4 ) then
8020+ local size = mainmemory .read_u32_be (animation_block_pointer + (i + 1 )* 0x4 ) - diff ; -- next entry for size calc
8021+ -- for some reason, there are empty animations, so continue until size != 0
8022+ if size ~= 0 then
8023+ return {i , size };
8024+ end
80238025 end
80248026 end
80258027 end
0 commit comments