Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions .github/workflows/sunshine-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Sunshine-Release-World # Can be named whatever you want.
on:
push:
branches: # Specifying a trigger point to start this process. Can be pushing to a specific branch or group of branches that start/end with certain characters. Can be also be done via tags.
- main
workflow_dispatch: # This trigger point means on manually starting it by going to project > actions > click on the name of the action (see above name) and then start.

jobs: # Define 1 or more "steps" to complete as part of this automatic release. If they don't "depend" on a prior step to complete, they will run in parallel.
windows-deps: # Name of this job can be whatever you want, i went ahead and named these based on what its trying to do, like download windows libraries, Linux, etc.
runs-on: windows-latest
steps:
- uses: actions/checkout@v4 # Downloads the latest copy of the current repo this is attached to. Can be used to checkout other repos as well.
- uses: actions/setup-python@v5
with:
python-version: "~3.12.10"
cache: pip
- name: Clear pip cache # This clears the pip cache in case any libraries with the same name were already installed on the same machine.
run: pip cache purge
- name: Create Lib-Windows
run: mkdir lib-windows
- name: Install Windows-Deps
run: pip install -r ${{github.workspace}}/worlds/sms/requirements.txt --target ./lib-windows --verbose # this looks for wherever the repo was downloaded, then fins the worlds folder, your world, then checks your world's python requirements file to download via Pip.
- uses: actions/upload-artifact@v4 # uploads this zip as part of the GitHub action, NOT a release. Actions have what are called artifacts, which are basically one or more output files that may be required between different stages or just an output in general.
with:
name: lib-windows
path: ./lib-windows/**

linux-deps: # Same actions as above except on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "~3.12.10"
cache: pip
- name: Clear pip cache
run: pip cache purge
- name: Create Lib-Linux
run: mkdir lib-linux
- name: Install Linux-Deps
run: pip install -r ${{github.workspace}}/worlds/sms/requirements.txt --target ./lib-linux --verbose
- uses: actions/upload-artifact@v4
with:
name: lib-linux
path: ./lib-linux/**

package: # Waits on both types of dependencies to complete, then creates an AP world.
needs: [windows-deps, linux-deps]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Compress Directory # This is still using the old methodology. I plan to do some updates in the next few days to use the new "Build APWorld" thing core made.
run: Compress-Archive -Path ./worlds/sms -DestinationPath ./sms.apworld
shell: pwsh

- uses: actions/upload-artifact@v4
with:
name: apworld
path: sms.apworld

publish: # Once the world is created we are ready to publish a draft release. I purposely dont let it fully release and instead create drafts so I can write up notes, etc.
runs-on: ubuntu-latest
needs: [package]
permissions:
contents: write
steps:
- name: Create Local Artifact Folder
run: mkdir tmp-artifacts
- name: Create Local Windows Lib Folder
run: mkdir tmp-windows-lib
- name: Create Local Linux Lib Folder
run: mkdir tmp-linux-lib

- uses: actions/download-artifact@v4 # Downloads the previous artifacts from the other jobs/steps. Note: It does unzip them so thats why in a later step a few down we re-zip them again as part of the draft release.
with:
name: lib-windows
path: tmp-windows-lib
- uses: actions/download-artifact@v4
with:
name: lib-linux
path: tmp-linux-lib
- uses: actions/download-artifact@v4
with:
name: apworld
path: tmp-artifacts

- name: Zip Lib Windows folder
run: cd tmp-windows-lib && zip -r ../tmp-artifacts/lib-windows.zip * && cd ../
- name: Zip Lib Linux folder
run: cd tmp-linux-lib && zip -r ../tmp-artifacts/lib-linux.zip * && cd ../

name: Create Manual Release
uses: softprops/action-gh-release@v2.3.2
with:
draft: true
prerelease: false
name: Mario Sunshine AP
files: |
tmp-artifacts/*
9 changes: 5 additions & 4 deletions worlds/sms/SMSClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class SmsContext(SuperContext):
corona_message_given = False
blue_status = 1
fludd_start = 0
bianco_flag = 0
yoshi_mode = 0
ticket_mode = False
victory = False
Expand Down Expand Up @@ -284,13 +285,13 @@ async def handle_stages(ctx):
#Gravi01 change to connection status
next_stage = dme.read_byte(addresses.SMS_NEXT_STAGE)
cur_stage = dme.read_byte(addresses.SMS_CURRENT_STAGE)

if next_stage == 0x01: # Delfino Plaza
next_episode = dme.read_byte(addresses.SMS_NEXT_EPISODE)

# If starting Fluddless without ticket mode on, open Bianco Hills
if next_episode == 0x0 and ctx.fludd_start == 2 and ctx.ticket_mode == 0:
check_world_flags(TICKETS[0].address, 4, True)
if not ctx.bianco_flag and ctx.fludd_start == 2 and ctx.ticket_mode == 0:
ctx.bianco_flag |= dme.read_byte(TICKETS[0].address)
dme.write_byte(TICKETS[0].address, ctx.bianco_flag)
open_stage(TICKETS[0])
# Sets plaza state to 8 if it is not and goal hasn't been reached
if ctx.ticket_mode == 1 and next_episode != 0x8 and not ctx.corona_message_given:
Expand Down Expand Up @@ -322,7 +323,7 @@ async def dolphin_sync_task(ctx: SmsContext) -> None:
logger.info("Attempting to connect to Dolphin...")
dme.hook()
if dme.is_hooked():
if dme.read_bytes(0x80000000, 6) != b"GMSE01":
if dme.read_bytes(0x80000000, 6) != b"GMSEAP":
logger.info(CONNECTION_REFUSED_GAME_STATUS)
ctx.dolphin_status = CONNECTION_REFUSED_GAME_STATUS
dme.un_hook()
Expand Down
Binary file added worlds/sms/SMS_custom_code(backup).smsco
Binary file not shown.
16 changes: 12 additions & 4 deletions worlds/sms/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ def update_dol_offsets(gcm: GCM, dol: DOL, seed: str, slot_name: str, starting_n
plaza_darkness1_value = "4800006C"
plaza_darkness2_value = "4E800020"

# Changing Game ID and Game Name from boot.bin
bin_data = gcm.read_file_data("sys/boot.bin")
bin_data.seek(0x04)
bin_data.write(bytes.fromhex("4150"))
bin_data.seek(0x34)
bin_data.write(bytes.fromhex("20417263686970656C61676F"))
gcm.changed_files["sys/boot.bin"] = bin_data

# ChangeNozzle offset to check if we own the nozzles
change_nozzle_offset = dol.convert_address_to_offset(0x8026a164)

Expand Down Expand Up @@ -69,7 +77,7 @@ def update_dol_offsets(gcm: GCM, dol: DOL, seed: str, slot_name: str, starting_n
dol.data.write(blank_data)

custom_dol_code = read_binary(__name__, "SMS_custom_code.smsco")
print(f"{custom_dol_code}")
# print(f"{custom_dol_code}")

dol.data.seek(CUSTOM_CODE_OFFSET_START)
dol.data.write(custom_dol_code)
Expand Down Expand Up @@ -129,7 +137,7 @@ def update_dol_offsets(gcm: GCM, dol: DOL, seed: str, slot_name: str, starting_n
dol.data.seek(noki_entrance_requirement)
dol.data.write(bytes.fromhex("00"))

# If starting Fludd, changes so File Select boots straight to plaza 8
# If starting Fluddless, changes flags to skip Airstrip and start in post-statue plaza
if starting_nozzle == 2:
boot_to_plaza_offset = dol.convert_address_to_offset(0x80164E32)
dol.data.seek(boot_to_plaza_offset)
Expand All @@ -140,8 +148,8 @@ def update_dol_offsets(gcm: GCM, dol: DOL, seed: str, slot_name: str, starting_n
# QOL shines no longer boot out of stage


for section in dol.sections:
print(f"Section at 0x{section.offset:X} (0x{section.address:X}) size 0x{section.size:X}")
# for section in dol.sections:
# print(f"Section at 0x{section.offset:X} (0x{section.address:X}) size 0x{section.size:X}")

dol.save_changes()
gcm.changed_files["sys/main.dol"] = dol.data
Expand Down
4 changes: 1 addition & 3 deletions worlds/sms/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@


def sms_requirements_satisfied(state: CollectionState, requirements: Requirements, world: "SmsWorld"):

if requirements.skip_into and world.options.starting_nozzle == 2:
if requirements.skip_into and (world.options.starting_nozzle == 2 or world.options.level_access == 1):
return True

my_nozzles: NozzleType = NozzleType.none
Expand All @@ -27,7 +26,6 @@ def sms_requirements_satisfied(state: CollectionState, requirements: Requirement
my_nozzles |= NozzleType.turbo
if state.has("Yoshi", world.player):
my_nozzles |= NozzleType.yoshi
my_nozzles |= NozzleType.splasher

for req in requirements.nozzles:
if my_nozzles & req == NozzleType(0):
Expand Down
Loading
Loading