mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
BizHawkClient: Add command to get size of memory domain (#4439)
* Mega Man 2: Remove mm2 commands from client if rom size too small
This commit is contained in:
@@ -214,10 +214,19 @@ class MegaMan2Client(BizHawkClient):
|
||||
last_wily: Optional[int] = None # default to wily 1
|
||||
|
||||
async def validate_rom(self, ctx: "BizHawkClientContext") -> bool:
|
||||
from worlds._bizhawk import RequestFailedError, read
|
||||
from worlds._bizhawk import RequestFailedError, read, get_memory_size
|
||||
from . import MM2World
|
||||
|
||||
try:
|
||||
if (await get_memory_size(ctx.bizhawk_ctx, "PRG ROM")) < 0x3FFB0:
|
||||
if "pool" in ctx.command_processor.commands:
|
||||
ctx.command_processor.commands.pop("pool")
|
||||
if "request" in ctx.command_processor.commands:
|
||||
ctx.command_processor.commands.pop("request")
|
||||
if "autoheal" in ctx.command_processor.commands:
|
||||
ctx.command_processor.commands.pop("autoheal")
|
||||
return False
|
||||
|
||||
game_name, version = (await read(ctx.bizhawk_ctx, [(0x3FFB0, 21, "PRG ROM"),
|
||||
(0x3FFC8, 3, "PRG ROM")]))
|
||||
if game_name[:3] != b"MM2" or version != bytes(MM2World.world_version):
|
||||
|
Reference in New Issue
Block a user