[SM] added support for more than 255 players (will print Archipelago for higher player number) (#130)

* added support for more than 255 players (will print Archipelago for higher player number)
This commit is contained in:
lordlou
2021-11-13 15:40:20 +01:00
committed by GitHub
parent 82b8b313f0
commit 452026165f
4 changed files with 12 additions and 10 deletions
+2 -2
View File
@@ -22,6 +22,7 @@ from NetUtils import *
from worlds.alttp import Regions, Shops
from worlds.alttp import Items
from worlds.alttp.Rom import ROM_PLAYER_LIMIT
from worlds.sm.Rom import ROM_PLAYER_LIMIT as SM_ROM_PLAYER_LIMIT
import Utils
from CommonClient import CommonContext, server_loop, console_loop, ClientCommandProcessor, gui_enabled, get_base_parser
from Patch import GAME_ALTTP, GAME_SM
@@ -1048,7 +1049,7 @@ async def game_watcher(ctx: Context):
item = ctx.items_received[itemOutPtr]
itemId = item.item - items_start_id
playerID = (item.player-1) if item.player != 0 else (len(ctx.player_names)-1)
playerID = item.player if item.player <= SM_ROM_PLAYER_LIMIT else 0
snes_buffered_write(ctx, SM_RECV_PROGRESS_ADDR + itemOutPtr * 4, bytes([playerID & 0xFF, (playerID >> 8) & 0xFF, itemId & 0xFF, (itemId >> 8) & 0xFF]))
itemOutPtr += 1
snes_buffered_write(ctx, SM_RECV_PROGRESS_ADDR + 0x602, bytes([itemOutPtr & 0xFF, (itemOutPtr >> 8) & 0xFF]))
@@ -1057,7 +1058,6 @@ async def game_watcher(ctx: Context):
ctx.location_name_getter(item.location), itemOutPtr, len(ctx.items_received)))
await snes_flush_writes(ctx)
async def run_game(romfile):
auto_start = Utils.get_options()["lttp_options"].get("rom_start", True)
if auto_start is True: