[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:
@@ -2,6 +2,7 @@ import Utils
|
||||
from Patch import read_rom
|
||||
|
||||
JAP10HASH = '21f3e98df4780ee1c667b84e57d88675'
|
||||
ROM_PLAYER_LIMIT = 255
|
||||
|
||||
import hashlib
|
||||
import os
|
||||
@@ -27,4 +28,4 @@ def get_base_rom_path(file_name: str = "") -> str:
|
||||
file_name = options["sm_options"]["rom_file"]
|
||||
if not os.path.exists(file_name):
|
||||
file_name = Utils.local_path(file_name)
|
||||
return file_name
|
||||
return file_name
|
||||
|
||||
@@ -11,7 +11,7 @@ from .Items import lookup_name_to_id as items_lookup_name_to_id
|
||||
from .Regions import create_regions
|
||||
from .Rules import set_rules, add_entrance_rule
|
||||
from .Options import sm_options
|
||||
from .Rom import get_base_rom_path
|
||||
from .Rom import get_base_rom_path, ROM_PLAYER_LIMIT
|
||||
import Utils
|
||||
|
||||
from BaseClasses import Region, Entrance, Location, MultiWorld, Item, RegionType, CollectionState
|
||||
@@ -242,7 +242,7 @@ class SMWorld(World):
|
||||
idx += 1
|
||||
(w0, w1) = self.getWord(0 if itemLoc.item.player == self.player else 1)
|
||||
(w2, w3) = self.getWord(itemId)
|
||||
(w4, w5) = self.getWord(itemLoc.item.player - 1)
|
||||
(w4, w5) = self.getWord(itemLoc.item.player if itemLoc.item.player <= ROM_PLAYER_LIMIT else 0)
|
||||
(w6, w7) = self.getWord(0 if itemLoc.item.advancement else 1)
|
||||
multiWorldLocations[0x1C6000 + locationsDict[itemLoc.name].Id*8] = [w0, w1, w2, w3, w4, w5, w6, w7]
|
||||
|
||||
@@ -268,9 +268,10 @@ class SMWorld(World):
|
||||
romPatcher.applyIPSPatchDict(patchDict)
|
||||
|
||||
playerNames = {}
|
||||
for p in range(1, self.world.players + 1):
|
||||
playerNames[0x1C5000 + (p - 1) * 16] = self.world.player_name[p][:16].upper().center(16).encode()
|
||||
playerNames[0x1C5000 + (self.world.players) * 16] = "Archipelago".upper().center(16).encode()
|
||||
playerNames[0x1C5000] = "Archipelago".upper().center(16).encode()
|
||||
for p in range(1, min(self.world.players, ROM_PLAYER_LIMIT) + 1):
|
||||
playerNames[0x1C5000 + p * 16] = self.world.player_name[p][:16].upper().center(16).encode()
|
||||
|
||||
|
||||
romPatcher.applyIPSPatch('PlayerName', { 'PlayerName': playerNames })
|
||||
|
||||
|
||||
@@ -573,12 +573,12 @@ class RomPatcher:
|
||||
self.writeCreditsStringBig(address, line, top=False)
|
||||
address += 0x80
|
||||
|
||||
value = " "+settings.progSpeed.upper()
|
||||
value = " "+"NA" # settings.progSpeed.upper()
|
||||
line = " PROGRESSION SPEED ....%s " % value.rjust(8, '.')
|
||||
self.writeCreditsString(address, 0x04, line)
|
||||
address += 0x40
|
||||
|
||||
line = " PROGRESSION DIFFICULTY %s " % settings.progDiff.upper()
|
||||
line = " PROGRESSION DIFFICULTY %s " % value.rjust(7, '.') # settings.progDiff.upper()
|
||||
self.writeCreditsString(address, 0x04, line)
|
||||
address += 0x80 # skip item distrib title
|
||||
|
||||
|
||||
Reference in New Issue
Block a user