Views: 844,342,466
27 users online: Aurel509, autisticsceptile1993,  BeeKaaaay, Bensalot, BreadWheatmann, brickblock369, codfish1002, DasFueller,  E-man38, Fermín Acosta Jr., Hayashi Neru, kaigem, Kusrry, Losoall,  Maarfy,  MarioFanGamer, melondrank, MiracleWater, moriya, PokerFace,  RussianMan,  Samantha, SamuM6pdt, Sonck's entertainment, Swaguy14256, UTF, VideoLight5 - Guests: 46 - Bots: 73 Users: 46,420 (2,763 active)
Latest: DemsPizzaBros
Tip: Use Gopher Popcorn Stew to insert custom blocks into your hack.Not logged in.
Details for BRK Exception Handler
SMW Patches - BRK Exception Handler Show random
File Name: BRK Exception Handler
Version History: View
Authors: p4plus2
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: This patch is pretty useful for those of you who are working with ASM in some way. If your code crashes and triggers a BRK (which happens reasonably often of all the potential crashes), this will display a bunch of debug info. The printed debug info is: registers(PC, D, B, A, X, Y, P, S), layer 1-3 positions, powerup status, and a full stack dump. It can also dump special message based on the BRK number. To add custom exception messages (for example for brk #$02) you would need to add the following line to the exception list:
%exception($02, "Something broke", "FIX IT")

Pretty sure this patch is 100% stable, Enjoy!

v1.1 (Erik and MarioFanGamer)
- Fixed the Free RAM defines as they weren't being used properly.
- Added a !snes9x define which replaces the STP with an infinite loop (as snes9x crashes with STP still to this day and I have no idea how to detect the emulator automatically).
- Fixed an oversight where garbage appears on the debug screen (didn't affect the text).
Tags: debug, lorom
Download: Download - 5.88 KiB
Moderated with:
  • Asar v1.71
  • Lunar Magic 3.4
  • bsnes-plus v073
  • SNES9x 1.60

Fixed an oversight where two labels were swapped which shouldn't be swapped (for this reason, garbage appeared in the original version and the unmoderated remoderated version). No issues otherwise.

Other then that, there are uses in it if you test ASM stuff and things are likely to break (after all, that's what BRK is originally used for debugging when the 6508 was created) but as mentioned by the moderator for the original version, you still should avoid accidental triggers of BRK (at the same time, BRK is much safer to trigger).
Posted by:  MarioFanGamer - | Link
Could SA-1 support be implemented? This actually would be really helpful
Posted by: Knucklesfan - | Link
Tested with: Asar v1.71; Lunar Magic 3.04; bsnes-plus v073+3a; snes9x 1.60
I didn't add SA-1 compatibility as I feared the patch wouldn't output accurate values for debugging should the game crash while the SA-1 is executing.
Posted by:  Erik - | Link

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2020 - SMW Central
Legal Information - Privacy Policy - Link To Us


Follow Us On

  • YouTube
  • Twitch
  • Twitter


  • Super Mario Bros. X Community
  • Mario Fan Games Galaxy