Fix small references
replace "bin" with "binary_bit_pos" in RAMHandler.py
This commit is contained in:
@@ -210,6 +210,7 @@ class GrinchClient(BizHawkClient):
|
|||||||
|
|
||||||
for addr_to_update in grinch_loc_ram_data.update_ram_addr:
|
for addr_to_update in grinch_loc_ram_data.update_ram_addr:
|
||||||
is_binary = True if not addr_to_update.binary_bit_pos is None else False
|
is_binary = True if not addr_to_update.binary_bit_pos is None else False
|
||||||
|
|
||||||
orig_index: int = addr_list_to_read.index(
|
orig_index: int = addr_list_to_read.index(
|
||||||
(addr_to_update.ram_address, addr_to_update.byte_size, "MainRAM")
|
(addr_to_update.ram_address, addr_to_update.byte_size, "MainRAM")
|
||||||
)
|
)
|
||||||
@@ -308,24 +309,24 @@ class GrinchClient(BizHawkClient):
|
|||||||
async def goal_checker(self, ctx: "BizHawkClientContext"):
|
async def goal_checker(self, ctx: "BizHawkClientContext"):
|
||||||
if not ctx.finished_game:
|
if not ctx.finished_game:
|
||||||
goal_loc = grinch_locations["MC - Sleigh Ride - Neutralizing Santa"]
|
goal_loc = grinch_locations["MC - Sleigh Ride - Neutralizing Santa"]
|
||||||
goal_ram_address = goal_loc.update_ram_addr[0]
|
goal_ram_data = goal_loc.update_ram_addr[0]
|
||||||
current_ram_address_value = int.from_bytes(
|
current_ram_address_value = int.from_bytes(
|
||||||
(
|
(
|
||||||
await bizhawk.read(
|
await bizhawk.read(
|
||||||
ctx.bizhawk_ctx,
|
ctx.bizhawk_ctx,
|
||||||
[
|
[
|
||||||
(
|
(
|
||||||
goal_ram_address.ram_address,
|
goal_ram_data.ram_address,
|
||||||
goal_ram_address.byte_size,
|
goal_ram_data.byte_size,
|
||||||
goal_ram_address.ram_area,
|
goal_ram_data.ram_area,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
)[0],
|
)[0],
|
||||||
goal_ram_address.endian,
|
goal_ram_data.endian,
|
||||||
)
|
)
|
||||||
|
|
||||||
if (current_ram_address_value & (1 << goal_ram_address.binary_bit_pos)) > 0:
|
if (current_ram_address_value & (1 << goal_ram_data.binary_bit_pos)) > 0:
|
||||||
# if current_ram_address_value == goal_ram_address.value:
|
# if current_ram_address_value == goal_ram_address.value:
|
||||||
ctx.finished_game = True
|
ctx.finished_game = True
|
||||||
await ctx.send_msgs(
|
await ctx.send_msgs(
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class UpdateMethod(IntEnum, boundary=STRICT):
|
|||||||
SET = 1
|
SET = 1
|
||||||
ADD = 2
|
ADD = 2
|
||||||
SUBTRACT = 3
|
SUBTRACT = 3
|
||||||
FREEZE = 4
|
FREEZE = 4 # Currently Non-functional
|
||||||
|
|
||||||
|
|
||||||
class GrinchRamData:
|
class GrinchRamData:
|
||||||
@@ -51,7 +51,7 @@ class GrinchRamData:
|
|||||||
self.value = 1
|
self.value = 1
|
||||||
|
|
||||||
if binary_bit_pos > -1:
|
if binary_bit_pos > -1:
|
||||||
self.binary_bit_pos = bin
|
self.binary_bit_pos = binary_bit_pos
|
||||||
|
|
||||||
if byte_size > 0:
|
if byte_size > 0:
|
||||||
self.byte_size = byte_size
|
self.byte_size = byte_size
|
||||||
|
|||||||
Reference in New Issue
Block a user