From 99118711d523d2bd434659223c222764b95d1b1a Mon Sep 17 00:00:00 2001 From: Gustavo Valiente Date: Sun, 6 Dec 2020 21:41:02 +0100 Subject: [PATCH] butano: redundant reset code removed --- butano/hw/include/bn_hw_core.h | 8 ++------ butano/hw/src/bn_hw_soft_reset.s | 28 ---------------------------- butano/include/bn_documentation.h | 1 + docs/changelog.html | 2 +- 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 butano/hw/src/bn_hw_soft_reset.s diff --git a/butano/hw/include/bn_hw_core.h b/butano/hw/include/bn_hw_core.h index 6a11dbdb9..42c1368eb 100644 --- a/butano/hw/include/bn_hw_core.h +++ b/butano/hw/include/bn_hw_core.h @@ -8,11 +8,6 @@ #include "bn_hw_tonc.h" -extern "C" -{ - void bn_hw_soft_reset(unsigned reset_flags); -} - namespace bn::hw::core { inline void wait_for_vblank() @@ -27,7 +22,8 @@ namespace bn::hw::core [[noreturn]] inline void reset() { - bn_hw_soft_reset(0xFF); + RegisterRamReset(0xFF); + SoftReset(); while(true) { diff --git a/butano/hw/src/bn_hw_soft_reset.s b/butano/hw/src/bn_hw_soft_reset.s deleted file mode 100644 index ee0612a6a..000000000 --- a/butano/hw/src/bn_hw_soft_reset.s +++ /dev/null @@ -1,28 +0,0 @@ -@ Thanks Ketsuban! -@ -@ reset_flags: -@ -@ #define RESET_EWRAM 0x01 -@ #define RESET_IWRAM 0x02 -@ #define RESET_PALETTE 0x04 -@ #define RESET_VRAM 0x08 -@ #define RESET_OAM 0x10 -@ #define RESET_SIO_REGS 0x20 -@ #define RESET_SOUND_REGS 0x40 -@ #define RESET_REGS 0x80 -@ #define RESET_ALL 0xFF - -@ void bn_hw_soft_reset(u32 reset_flags) - .align 2 - .thumb_func - .global bn_hw_soft_reset - .type bn_hw_soft_reset STT_FUNC -bn_hw_soft_reset: - ldr r3, =0x4000208 - mov r2, #0 - strb r2, [r3, #0] - ldr r1, =0x3007f00 - mov sp, r1 - swi 1 - swi 0 - .pool diff --git a/butano/include/bn_documentation.h b/butano/include/bn_documentation.h index bf19736f6..c70baebc8 100644 --- a/butano/include/bn_documentation.h +++ b/butano/include/bn_documentation.h @@ -1091,6 +1091,7 @@ * * H-Blank effects EWRAM usage reduced (more than 2KB by default). * * Optimization level changed to `-O2` to avoid another No$gba crash. * * SRAM code moved back from ROM to EWRAM, since doing that doesn't make No$gba crash anymore. + * * Redundant reset code removed. * * * @section changelog_4_2_0 4.2.0 diff --git a/docs/changelog.html b/docs/changelog.html index 0269dbace..1574f5ee8 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -69,7 +69,7 @@

Contents

  • 0.1.0
  • -

    4.3.0 (next release)

    4.2.0

    4.1.0

    4.0.0

    3.3.0

    3.2.1

    bn::optional build fix.

    3.2.0

    bn::optional is now constexpr.

    3.1.0

    3.0.0

    Thanks to the awesome gba-link-connection, multiplayer support has been implemented! See bn::link and the link example for more.

    2.0.0

    1.0.0

    0.4.0

    0.3.0

    0.2.0

    0.1.0

    First release.

    +

    4.3.0 (next release)

    4.2.0

    4.1.0

    4.0.0

    3.3.0

    3.2.1

    bn::optional build fix.

    3.2.0

    bn::optional is now constexpr.

    3.1.0

    3.0.0

    Thanks to the awesome gba-link-connection, multiplayer support has been implemented! See bn::link and the link example for more.

    2.0.0

    1.0.0

    0.4.0

    0.3.0

    0.2.0

    0.1.0

    First release.