Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OW_FLAG_PAUSE_TIME, pausefakertc, resumefakertc and togglefakertc #4954

Merged
merged 7 commits into from
Jul 13, 2024

Conversation

pkmnsnfrn
Copy link
Collaborator

@pkmnsnfrn pkmnsnfrn commented Jul 12, 2024

Description

  • Added OW_FLAG_PAUSE_TIME, allowing users to designate a flag for stopping and starting the flow of time when OW_USE_FAKE_RTC is enabled.
    • Introduce a STATIC_ASSERT to prevent users from attempting to pause time unless FakeRtc is enabled.
  • Added pausefakertc, resumefakertc, and togglefakertc allowing users to pause, resume and toggle the flow of time when OW_USE_FAKE_RTC is enabled.

Usage

OW_FLAG_PAUSE_TIME

In include/config/overworld.h, developers must assign a flag to OW_FLAG_PAUSE_TIME.

Set Flag

Setting the flag will pause the flow of time.

Clear Flag

Clearing the flag will resume the flow of time.

Toggle Flag

If time is paused, the flag will be cleared. If time is not paused, the flag will be set.

Testing

Clean Branch

You can recreate this branch by applying a patch or pulling the repo. From a clean version of expansion's upcoming, you can either:

Patch

wget https://files.catbox.moe/igk1yp.patch -O fakeRTC.patch ; git apply fakeRTC.patch ; rm fakeRTC.patch

Repo

git remote add psf-expansion https://github.com/PokemonSanFran/pokeemerald-expansion/ ; git pull psf-expansion fakeRTC_branch

Manual Tests

After replicating the branch, to recreate my testing environment, you can either directly download the debug script and config file, or manually create the changes.

Download

OW_USE_FAKE_RTC OW_FLAG_PAUSE_TIME Command
FALSE FLAG_UNUSED_0x264 wget https://files.catbox.moe/h8ef5x.h -O include/config/overworld.h && wget https://files.catbox.moe/7sgzz3.inc -O data/scripts/debug.inc
FALSE 0 wget https://files.catbox.moe/lxkglx.h -O include/config/overworld.h && wget https://files.catbox.moe/7sgzz3.inc -O data/scripts/debug.inc
TRUE FLAG_UNUSED_0x264 wget https://files.catbox.moe/g1t68r.h -O include/config/overworld.h && wget https://files.catbox.moe/7sgzz3.inc -O data/scripts/debug.inc
TRUE 0 wget https://files.catbox.moe/xfvd8h.h -O include/config/overworld.h && wget https://files.catbox.moe/7sgzz3.inc -O data/scripts/debug.inc

Manual Testing

  • Open the config file and change OW_USE_FAKE_RTC and OW_ALTERED_TIME_RATIO to their desired values.
  • Change data/scripts/debug.inc to match the one provided
  • Compile the game
  • Start a new save
  • Run Script 1

Verified Scenarios

All videos attempt to show:

  • The player sets the clock to 10:00
  • pausefakertc is run
  • The player battles against TRAINER_RONALD and wins in 6 turns.
  • A script prints the current time.

OW_USE_FAKE_RTC == FALSE && OW_FLAG_PAUSE_TIME == FLAG_UNUSED_0x264

Does not compile

OW_USE_FAKE_RTC == FALSE && OW_FLAG_PAUSE_TIME == 0

false0.mp4

OW_USE_FAKE_RTC == TRUE && OW_FLAG_PAUSE_TIME == FLAG_UNUSED_0x264

trueset.mp4

OW_USE_FAKE_RTC == TRUE && OW_FLAG_PAUSE_TIME == 0

true0.mp4

Discord Contact Info

I am pkmnsnfrn on Discord.

@pkmnsnfrn pkmnsnfrn changed the title Add OW_FLAG_PAUSE_TIME, pausefakertc, resumefakertc, a togglefakertc Add OW_FLAG_PAUSE_TIME, pausefakertc, resumefakertc and togglefakertc Jul 12, 2024
src/fake_rtc.c Outdated Show resolved Hide resolved
asm/macros/event.inc Outdated Show resolved Hide resolved
@Bassoonian Bassoonian merged commit 3e03419 into rh-hideout:upcoming Jul 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants