News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)  (Read 18927 times)

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
I meant to mention this much earlier, but there's actually an undocumented setting for that in bsnes-qt.cfg (located in %AppData%/.bsnes/ on Windows, ~/.bsnes/ everywhere else). Changing "input.modifierEnable" from true to false will allow you to bind modifier keys by themselves instead of using them as part of key combos.

I added an actual checkbox for that (as well as "input.allowInvalidInput", which lets you press opposite directions on the D-pad at the same time) to the Input tab in the latest revision, which may or may not show up on EmuCR sometime in the next 24 hours, or you can modify the config file manually (and see what other interesting settings are available).

John Enigma

  • Sr. Member
  • ****
  • Posts: 319
    • View Profile
From what I understand, or for what it looks like, from this bsnes fork version of yours, you look like you are turning the bsnes emulator into something like FCEUX (in which it has NES romhacking & debugging tools, and a built-in hex editor). Isn't that right, Mr. (or Mrs.) @Revenant?

sics

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Hi I would like to turn your work in my emulator header, but I have a problem, I use fictitious extensions currently in my ROMS to maintain separate sets of other compressed files, but this way I can not associate directly with the application.  :-\  :thumbsup:


STARWIN

  • Sr. Member
  • ****
  • Posts: 430
    • View Profile
When a (R/W) breakpoint is hit, and I step, it just hits the breakpoint again, so I have to step again to actually step. Intended?

Trace logs could show the opcodes+operands in addition to the mnemonics.

I don't know how to disassemble anything else than what it decides to show. This gives a claustrophobic feeling.

edit: In a LoROM game if I set a breakpoint at the mirror $80-$BF, it won't trigger if mirrored is accessed. Intentional? Geiger's does.

edit2: Memory editor could show the exact offset of the selected cell.
« Last Edit: July 11, 2016, 07:13:10 am by STARWIN »

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
From what I understand, or for what it looks like, from this bsnes fork version of yours, you look like you are turning the bsnes emulator into something like FCEUX (in which it has NES romhacking & debugging tools, and a built-in hex editor). Isn't that right, Mr. (or Mrs.) @Revenant?

Basically, yes. Well, the debugger was already there, but my goal is to make it more robust/usable (though unfortunately it's not quite as full-featured as the FCEUX debugger yet).

When a (R/W) breakpoint is hit, and I step, it just hits the breakpoint again, so I have to step again to actually step. Intended?

This can happen if a single instruction reads/writes two bytes that are both part of a single breakpoint's address range, or if a read+write breakpoint is triggered by a read-modify-write instruction (because the read and the write don't actually happen simultaneously). This is less "intentional" behavior and more just a side effect of how breakpoints were already implemented in bsnes.

Quote
Trace logs could show the opcodes+operands in addition to the mnemonics.

This is something I already wanted to add at some point, both to the debug/trace window and the disassembly window.

Quote
I don't know how to disassemble anything else than what it decides to show. This gives a claustrophobic feeling.

The disassembly window only shows stuff that has actually been marked as executed, within a certain distance around the current PC. This is another thing from the original bsnes debugger that I would like to improve eventually.

Quote
edit: In a LoROM game if I set a breakpoint at the mirror $80-$BF, it won't trigger if mirrored is accessed. Intentional? Geiger's does.

Right now, breakpoints only support address mirroring when specifying a single address, rather than a range of addresses, for performance reasons. (See this post for an explanation.) This is something I might try to revise eventually. Keep in mind that if you're only breaking on a single address, you can leave the end of the address range blank.

Quote
edit2: Memory editor could show the exact offset of the selected cell.

This is another change to the memory editor that is already going to be in the next release.

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #85 on: October 30, 2016, 12:20:14 am »
Just to prove that this project is still alive, here's a spiffy new overhaul of the VRAM viewer, much thanks to UnDisbeliver:



Very well timed, too, because I've been gearing up to work on some other new graphics-related features (tilemap viewer, etc.) Now that I'm focusing on actual features again, another release should finally be not too far off.

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1510
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #86 on: October 30, 2016, 09:48:49 am »
Oh that is looking VERY nice!  I anxiously await the next update!

This may just me being nit picky, but is it plausible to make all the commands in trace logs to be in capital letters along with the offsets?  I may just be too used to Geiger's but it makes it a bit easier to read and notice some things when it's all caps.

Is there also a possibility of adding in a 'Reset Debug' kind of option like Geiger's where it resets the trace masking?
« Last Edit: October 30, 2016, 10:02:14 am by justin3009 »
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

Nightcrawler

  • Hero Member
  • *****
  • Posts: 5625
    • View Profile
    • Nightcrawler's Translation Corporation
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #87 on: October 30, 2016, 10:28:18 am »
Just to prove that this project is still alive, here's a spiffy new overhaul of the VRAM viewer, much thanks to UnDisbeliver:

That looks nice! If you haven't already, you may want to look at VSNES for additional interface ideas. That screenshot reminded me of it being a bit similar. I still find myself loading up a savestate in VSNES over debuggers at times to get a nicer interface for evaluating of the state of the system and testing quick changes (obviously VSNES is limited in some areas for this not being an emulator).
TransCorp - Nearing 20 years of community dedication.
Dual Orb 2, Wozz, Emerald Dragon, Tenshi No Uta, Glory of Heracles IV SFC/SNES Translations

DackR

  • Full Member
  • ***
  • Posts: 129
  • Mo~
    • View Profile
    • Hackaday.io Page
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #88 on: November 01, 2016, 10:35:52 pm »
Just to prove that this project is still alive, here's a spiffy new overhaul of the VRAM viewer, much thanks to UnDisbeliver:
Very well timed, too, because I've been gearing up to work on some other new graphics-related features (tilemap viewer, etc.) Now that I'm focusing on actual features again, another release should finally be not too far off.

Thanks for your work on bsnes-plus! It's been extremely useful.

I am going to try xkas-plus for the first time tonight since I'm currently unable to download bass v14 from byuu's website (which is what I've been using after switching from xkas a few months ago).

Please keep it up.

Edit: Just tried out xkas-plus and other than the absence of the rep directive (not really a big loss), everything works awesome. Thanks again.
« Last Edit: November 02, 2016, 12:02:08 am by DackR »

Madsiur

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 163
  • FF6 enthusiast!
    • View Profile
    • madsiur's lair
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #89 on: November 02, 2016, 07:02:44 pm »
I'm happy a new release is not too far away. I tend to use bsnes+ over SNES9X Debugger because Geiger's utility doesn't like my OS (Win 8.1), it tend to crash right after going into debugging.

I really like that VRAM viewer :D

Capital letter offsets is also a suggestion I second but it's not an issue as it is now.

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #90 on: November 22, 2016, 09:52:48 pm »
Over a year later, here's a new release, better than ever.

Windows 64-bit compatibility & accuracy
Windows 32-bit compatibility

Things of interest:
  • PPU tools! VRAM viewer, tilemap viewer, and an improved version of the existing sprite viewer.
  • True Satellaview/BS-X support! (1 2) As of this release, bsnes-sx2 is now officially deprecated.
  • MSU1 revision 2 support! Should now behave pretty much exactly the same as current sd2snes firmware.
Huge thanks to UnDisbeliever and LuigiBlood, respectively, for helping out with the first two of those things in the couple of weeks leading up to the release.

Hopefully it won't be another year before I release another one of these (yeah, that's what I said last time, isn't it?) I know there's still some stuff I probably said that I'd do (or that I want to do, anyway) that hasn't been done yet, but it'll happen. Thanks to everyone who motivated me to finally work on this again, especially recently.

Anyway, the rest of the boring changelog:

Code: [Select]
Added tilemap viewer, revamped VRAM viewer and improved OAM viewer [UnDisbeliever]
Added all BS-X/Satellaview support from bsnes-sx2 [LuigiBlood]
Added PPU breakpoint support to accuracy and performance builds [Revenant]
Added more comparison options to cheat search dialog [Grieverheart]
Added some command line debugger arguments (see `bsnes --help`) [UnDisbeliever]
Added debug window option to show H-count as either dots or clocks [Revenant]
Added option to use WDM instruction as a software breakpoint [Revenant]
Added "allow invalid input" and "allow modifier keys" to settings window [Revenant]
Updated MSU1 support to revision 2 (includes pause/resume support) [Revenant]
Improved handling of debug window GUI state when breaking/running/stepping [Revenant]
Expanded debug properties view for multiple chips on all 3 build profiles [Revenant]
Made power-on state (especially accuracy PPU) randomized the same way as higan [Revenant]
Memory viewer displays current address at bottom of window [Revenant]
Memory viewer now displays APU bus instead of just APU RAM [Revenant]
Memory viewer now displays (most) I/O registers as read-only values [Revenant]
Debug log files are now only opened if a game is actually open [Revenant]
Debugger switches between debug/main window depending on focus policy [Revenant]
Fixed flickering/blanking of game screen when changing/resizing windows [Revenant]
Fixed CPU bug w/ direct page wrapping in emulation mode [AWJ]
Fixed disassembly of PEA/PEI/PER instructions [AWJ]
Fixed some details of S-DD1 memory mapping [AWJ]
Fixed typing in native file dialogs triggering emulator hotkeys [Revenant]
Fixed debug events messing with emulation speed if turbo/slowdown keys were held [Revenant]
Fixed spurious debug events caused by dummy reads during SPC write instructions [Revenant]
Fixed file dialog path being cleared when cancelling a native file dialog [Revenant]
Fixed handling of $00Fx registers when dumping SPCs [Revenant]
Fixed "search next/prev" behavior when wrapping to beginning or end of memory [Revenant]

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1510
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #91 on: November 23, 2016, 03:38:17 pm »
That Step in the debugger being fixed is a frikin god send.  Also that Tilemap viewer and VRAM viewer are just absolutely amazing.  You did a wonderful job on this!  I believe bsnes is now my main debugger.

The only couple nitpicks I have still have been said mainly.

1. It's just my personal taste but everything in the debugger being in CAPS would be a lot easier to read.
2. This is probably a bit much honestly but I'll throw it out there anyway.  Would it be possible to add more numbers of Save State slots that behave similar to SNES9X?  AKA:

F1 - Loads Slot 1
F2 - Loads Slot 2.. etc..

Shift F1 - Saves Slot 1
Shift F2 - Saves Slot 2 etc..

I was testing around with the few quick save states BSNES has currently and if you try using even one of the same key for load/save, it'll load and then save instead of loading or saving.

IE: Shift + F1 = Save Slot 1 but if you have F1 as the key to load that slot as well, it'll reload the save state and then save instead of just saving.  I think it needs to realize that Shift + F1 and F1 are completely separate key commands.

Even still, this is such a vast improvement over the original BSNES and it's far superior over SNES9X now with the Tilemap viewer and such.  Thank you so much for your hard work on this!
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

RetroGameFan9000

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
    • My website
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #92 on: November 24, 2016, 12:44:07 pm »
I download the new version but when I opened, my antivirus blocked it.  :-[

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #93 on: November 24, 2016, 03:46:50 pm »
1. It's just my personal taste but everything in the debugger being in CAPS would be a lot easier to read.
I can add that to the debugger options later, no problem.

I was testing around with the few quick save states BSNES has currently and if you try using even one of the same key for load/save, it'll load and then save instead of loading or saving.

IE: Shift + F1 = Save Slot 1 but if you have F1 as the key to load that slot as well, it'll reload the save state and then save instead of just saving.  I think it needs to realize that Shift + F1 and F1 are completely separate key commands.
Yikes, I'll have to check that out.

I download the new version but when I opened, my antivirus blocked it.  :-[
Do you know which file specifically gets flagged?

Either way, I can guarantee it's a false positive and you should ignore it and/or switch to a better antivirus.

RetroGameFan9000

  • Jr. Member
  • **
  • Posts: 11
    • View Profile
    • My website
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #94 on: November 24, 2016, 04:42:30 pm »
Do you know which file specifically gets flagged?

Either way, I can guarantee it's a false positive and you should ignore it and/or switch to a better antivirus.
bsnes.exe. It was blocked by Avast. It says that file may be dangerous and they are testing it. I hope that the file is true negative.

EDIT: The file is safe.
« Last Edit: November 24, 2016, 06:43:49 pm by RetroGameFan9000 »

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 162
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #95 on: November 24, 2016, 11:17:58 pm »
The source is all up on github, I've built it myself several times.  Definitely safe.

RedGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #96 on: November 25, 2016, 07:45:52 am »
Great work on the debugging features.  This is the first time I've tried any variant of bsnes and it along with the additional features have now become my new favorite snes tool.  Thanks for making the source code available.

The hotkey problem that Justin is having is due to how bsnes provides support for modifier as single keys.  The way it works right now is all modifiers work as single keys if you click the checkbox and any existing mappings that use modifier+key result in both pressed separately.  I added a temporary workaround that saves a single modifier key as both the modifier and the actual scancode pressed.  That looks to have solve the problem.  Now bsnes thinks you are pressing the modifier + another key (which happens to be itself).

I coded up a prototype memory location label tool which can be loaded/saved as an xml: http://i.imgur.com/njtlOkO.png
« Last Edit: November 27, 2016, 12:21:59 am by RedGuy »

creaothceann

  • Hero Member
  • *****
  • Posts: 2619
  • SPINESHARK
    • View Profile
    • creaothceann's website
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #97 on: December 05, 2016, 02:25:53 pm »
That looks nice! If you haven't already, you may want to look at VSNES for additional interface ideas. That screenshot reminded me of it being a bit similar. I still find myself loading up a savestate in VSNES over debuggers at times to get a nicer interface for evaluating of the state of the system and testing quick changes (obviously VSNES is limited in some areas for this not being an emulator).

 :)

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #98 on: December 19, 2016, 10:28:22 pm »
Here is a minor release which fixes a few bugs of varying importance. I plan to start doing these more often, maybe monthly. Download links are in the OP as usual.

(justin3009: hopefully the issue with hotkeys and modifier keys should be fixed)

Code: [Select]
Fixed low-res scanlines being horizontally resized too much when fast-forwarding
  while a high-res screen mode is active (compat/performance builds only) [Revenant]
Fixed potential issue with modifier keys triggering multiple wrong inputs [Revenant]
Fixed potential crashes when nonexistent cart RAM would be mapped by a manifest
  and/or certain coprocessors (such as the SA1) [Revenant]
Fixed potential crash when tracing SA1/SuperFX with trace mask enabled [Revenant]
Fixed trace mask being wrongly enabled when loading a cartridge [Revenant]

I'll start addressing more of your ideas and issues once the holidays are over. I wanted to get a few things taken care of before then, but hopefully I can start to keep up more frequent official releases.

qwertymodo

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 162
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #99 on: December 20, 2016, 11:42:12 am »
The memory location labeling would be an AMAZING feature to have. Hopefully there's some way to hide values, so you could build a list of all known values, but then decide which ones you actually want to view for a particular session (like the "watches" dialog in Visual Studio) or possibly an auto option that only displays values that have been accessed or modified in the session (like the "autos" dialog in VS).