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 17982 times)

oziphantom

  • Jr. Member
  • **
  • Posts: 32
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #60 on: August 01, 2015, 09:26:01 am »
I've seen bSNES+ just miss breakpoints, I set it to just the first address. Then I made the both fields with the same address, still missed it. So I made the 2nd one a couple of bytes after, still missed. I had the X ticked.
Am I missing something?

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #61 on: August 01, 2015, 06:17:02 pm »
Which ROM / what address / what were you doing to try to trip the breakpoint?

oziphantom

  • Jr. Member
  • **
  • Posts: 32
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #62 on: August 02, 2015, 04:15:45 am »
HARVEST MOON SNES US smc with header

80C520

Moving from screen to screen. This address should fire when entering the farm during spring. The address show up as red in hex viewer. I've confirmed with Geiger's it does fire.

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1492
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #63 on: August 02, 2015, 12:55:38 pm »
Would it be possible to get this to work more appropriately with Super Mario RPG as well?

There's a certain chunk(s?) that are clearly read but you cannot log them, trace them or anything.  It's like they don't exist even when it's clearly right in your face.  It's something to do with the SA-1 chip that causes the problem with emulators.  There's also a really awkward bit of forcing bank switching repeatedly instead of just flipping them all on to display all data. I'm not sure if that last one is really workable but the first part is EXTREMELY important as it makes debugging certain things impossible.
'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.'

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #64 on: August 02, 2015, 12:59:10 pm »
HARVEST MOON SNES US smc with header

80C520

Moving from screen to screen. This address should fire when entering the farm during spring. The address show up as red in hex viewer. I've confirmed with Geiger's it does fire.

I don't ever see 80C520 being executed, but I can put a breakpoint on a similar-looking section of code right before that and it breaks as expected when entering the farm:



Would it be possible to get this to work more appropriately with Super Mario RPG as well?

There's a certain chunk(s?) that are clearly read but you cannot log them, trace them or anything.  It's like they don't exist even when it's clearly right in your face.  It's something to do with the SA-1 chip that causes the problem with emulators.  There's also a really awkward bit of forcing bank switching repeatedly instead of just flipping them all on to display all data. I'm not sure if that last one is really workable but the first part is EXTREMELY important as it makes debugging certain things impossible.

Can you be more specific?

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1492
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #65 on: August 02, 2015, 01:48:08 pm »
$C0/9C96 is a culprit.  I wasn't able to set a breakpoint on it in any emulator except NO$SNES for some unknown reason.  Fairly certain it's how the game gets emulated due to having the SA-1 chip.  You can actually jump to that location and view it, but you cannot breakpoint it nor trace it, ever.  It's a graphical routine too so it's run fairly often.
'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.'

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #66 on: August 02, 2015, 02:16:05 pm »
I'm able to get the debugger to break at that address several times in a row when entering areas from the overworld or moving between maps (such as entering/leaving Mario's house). Make sure you have "SA-1 bus" selected as the breakpoint source and that it's set as an execute ("X") breakpoint.

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1492
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #67 on: August 02, 2015, 02:44:01 pm »
..I somehow missed the SA-1 bus bit.  WELP.  That takes care of that then!  Thank ya there!
'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.'

oziphantom

  • Jr. Member
  • **
  • Posts: 32
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #68 on: August 03, 2015, 02:29:20 am »
I don't ever see 80C520 being executed, but I can put a breakpoint on a similar-looking section of code right before that and it breaks as expected when entering the farm:



Can you be more specific?

Seems it is all a just so happens. The different address get called at the different time of day in the game. So when using BSnes I had moved out of the time for that first function but when I got to it in Geiger it was the right time of day. Sorry for wasting your time.

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #69 on: November 09, 2015, 07:59:45 pm »
It's been a while. Here's version 073+2. I didn't do everything with it that I actually wanted but I think it merits a new release at this point, and maybe this'll spur me to work on it more often. Download(s) in the original post.

Changelog [mostly scraped from commit messages in no particular order]:
Code: [Select]
Replaced original memory editor with a new, faster and better one [Revenant]
Added hotkeys for breaking and stepping in the debugger (F5 through F8) [Revenant]
Added new "Sound Viewer" window to tools menu [Revenant]
Removed "enable" checkbox from breakpoints, now enabled by R/W/X setting [Revenant]
Re-enabled quickload/save menus [Revenant]
Frame count added to CPU/SA1 traces [Revenant]
Fixed cycle timing issue introduced by debugger in previous release [Revenant]
Slightly improved SPC700, SA1 and SuperFX disassembly [Revenant]
Fixed MMIO mapping on SA1 bus (fixes crash with Marvelous and possibly others) [AWJ]
Various emulation, build, and other improvements [AWJ]
Backported various OpenGL, Direct3D, and rawinput fixes from bsnes 081+ [mziab]
Fixed potential GUI deadlock when Windows system menu is opened [Revenant]
Improved BPS/UPS/IPS soft patching support [mziab, Revenant]
snesreader no longer advertises RAR support that it doesn't actually have [mziab]
Backport newer File Extractor from VBA-M. LZMA2-compressed 7zip archives work now [mziab]
Various build fixes, mostly for clang / Mac OS [Optiroc, AWJ]
Nicer OSX app bundle (custom icon and retina support enabled) [Optiroc]

If there's something I was going to add / should have added but didn't, feel free to poke me about it anyway.

64-bit accuracy builds are still coming eventually.

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1492
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #70 on: November 10, 2015, 07:03:23 am »
Yeeeessss! I'll be checking this out in a couple days when I have time! I'm so glad you're still working 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.'

DackR

  • Full Member
  • ***
  • Posts: 129
  • Mo~
    • View Profile
    • Hackaday.io Page
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #71 on: November 11, 2015, 11:13:12 pm »
Bravo! Been really enjoying some of the new features!

This is now my favorite snes debugger by far! Hot keys are the icing on the cake.

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #72 on: November 14, 2015, 10:29:58 pm »
64-bit builds (including accuracy) are now available in the OP.

Going forward I'll probably keep publishing both 64 and 32-bit builds (but most likely only 64-bit for accuracy).

November 17, 2015, 06:21:01 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
I've uploaded newer 64-bit builds which should be a fair bit faster than the previous ones (blame me not bothering to switch away from outdated sjlj-based tools until now...)

If you were experiencing slower emulation with the x64 builds (especially with coprocessor-based games) that shouldn't be an issue anymore.
« Last Edit: November 17, 2015, 06:21:01 pm by Revenant »

DackR

  • Full Member
  • ***
  • Posts: 129
  • Mo~
    • View Profile
    • Hackaday.io Page
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #73 on: November 21, 2015, 09:52:03 pm »
After using the new version a bit- I have a new wish list.  >:D

Would you consider allowing for global debugger hot keys? I find myself with the main screen or the memory editor open when I wish to break/resume/step in the debugger. I love that there are hot keys at all though.  8)

Also noticed that copying data from the memory editor grabs 1 extra byte than what is highlighted. Copying data from multiple rows of data doesn't copy anything at all.

For the search function, which is heaven-sent, I wish it it would highlight the data as it is found and perhaps be able to continue the search without having to click on search to bring up the dialog again. (Unless I missed something.)

As always-- love, love, love, what you're working on here.  :thumbsup:

mziab

  • Full Member
  • ***
  • Posts: 168
    • View Profile
    • mteam
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #74 on: November 22, 2015, 09:13:12 am »
I love the work being done on this. Looking forward to persistent breakpoints. What would be a real boon is something like the BG layer/tilemap viewer from VSNES. It's probably the only thing I still use ZSNES+VSNES for.

Anyway, the new memory viewer is too narrow when first opened, cutting off part of the the widget. I guess it's using some kind of hardcoded size, which is too little for the style and fonts I have set up. That's only a minor inconvenience, though.
« Last Edit: November 22, 2015, 09:33:36 am by mziab »

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1492
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #75 on: November 22, 2015, 12:57:17 pm »
My only complaint so far at the moment is not being able to use 'Ctrl' and 'Shift' as keys :P

My default keys for SNES tends to be:

A = ]
X = [
Y = P
B = Right Ctrl
L = ;
R = '
Start = Enter
Select = Right Shift

All keys work there except for Ctrl and Shift which is really bothersome.  I could just change my keys but I'm ungodly picky since I've been using that same mapping for.. 12+ years now I believe.
'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.'

mziab

  • Full Member
  • ***
  • Posts: 168
    • View Profile
    • mteam
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #76 on: November 22, 2015, 01:10:17 pm »
I remember this was a limitation in the early bsnes codebase caused by how modifiers were handled. Since then byuu seems to have rewritten the internals a couple of times, addressing that issue at one point.

justin3009

  • RHDN Patreon Supporter!
  • Hero Member
  • *****
  • Posts: 1492
  • Welp
    • View Profile
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #77 on: November 22, 2015, 03:31:04 pm »
Yeah in the later bSNES versions it's remedied.
'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.'

mziab

  • Full Member
  • ***
  • Posts: 168
    • View Profile
    • mteam
Re: bsnes-plus and xkas-plus (new SNES debugger and multiplatform assembler)
« Reply #78 on: December 04, 2015, 06:05:47 pm »
After using the new build extensively, I have two minor usability suggestions.

It would be nice if the new memory viewer displayed the address when you click a byte. It would be a godsend when browsing the memory to find the right address and then e.g. copy it to a breakpoint. Actually, a context menu action to copy the currently selected address would be even better.

Another useful thing would be changing the background of the byte at the given address to yellow or something, so that you see where in the row it is. The old memory viewer just started the row at the address you input. This one always starts at the nearest multiple of 16, so in some cases I need to manually count the bytes to make sure I'm at the right place.

Anyway, I hope those requests are reasonable.
« Last Edit: December 04, 2015, 06:33:24 pm by mziab »

zhade

  • Full Member
  • ***
  • Posts: 171
    • View Profile
    • zhaDe's stuff
I've been using the latest build lately, I love the breakpoint ranges so much !

but and as discussed here, the way the CTRL and SHIFT keys won't work is bothersome, To work around this limitation I made a small AutoHotKey script that changes the input of those keys to other keys (F6 to F12) and it seems to work perfectly for me so I thought I could share it with you guys.

I have not been able to make the RightAlt key work correctly.. it might be an issue with my keyboard.
I compiled the script to an executable file so anybody using windows can use it without the need to have AutoHotKey

here is the AHK script: (kind of self-explanatory)

Code: [Select]
#singleinstance force

#IfWinActive ahk_exe bsnes.exe

Enter::F12
LCtrl::F7
RCtrl::F6
vkDF::F6
LAlt::F9
LShift::F11
RShift::F10

note: vkDF stands for the RightCTRL key on my keyboard, I don't know if yours will trigger the normal "RCtrl" key or work like mine so I remaped both to the F6.

How to use / Issues:
- run the executable, it will stay open in the background, to close it right-click on the tray icon
- in bsnes, go set your controls like you would normally (binding Enter will bind F12 instead, so no need to bother binding the coresponding F keys)
- All keyboard shortcuts using a combination of keys won't work, for example, ALT+enter won't toggle fullscreen (even if you have not bound any button to ALT and/or ENTER), if you want you can use the tray icon menu to suspend the key remaping to be able to use such key shortcuts.
- The remaping only work with bsnes (actually, any program called "bsnes.exe" so it probably will work with other bsnes builds too), all other programs will receive the normal keystrokes.
- Trying to bind the RAlt key (at least on my computer) binds ALT+F7 instead and causes problems so you should avoid using it

Download bsnesKeyRemap

if you don't trust running the executable, or want to modify the script to your needs, the full script (as shown above) is also included in the archive and you can get the latest version of AutoHotKey here.

As you can see by the size of it.. this script is very basic so many things could be added to make it better like making the remaping work only when the "game" and "controls settings" windows are focused on to keep it from interfering with the debugger's windows.

It would also be fairly easy to add debugging hotkeys so that say CTRL+Q for example checks the "step SA-1" checkbox and clicks on "run" or any other thing that is already possible with the mouse, like unchecking all the breakpoints boxes by pressing CTRL+B to disable them all at once, and resetting the boxes back to their previous checked state by pressing CTRL+ALT+B for example. I've manged to do many small shortcuts like this for geiger' snes9x debugger but now that I can use the CTRL / SHIFT / ALT / ENTER keys with bsnes+.. I don't really see anything that geiger's debugger does better so I guess I should addapt my scripts to work with bsnes+ and at the same time if you guys are interested, I could make it customizable using a .ini file where each hotkey could be changed and features switched on/off to your liking.

Hopefully, if I do this, and do it right, it will give the chance to Revenant to focus on developping new / improving existing debugging tools :)