Fceux Qt/SDL Port Testing

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Fri Oct 16, 2020 10:22 pm

Hello,
I am a C++ developer that has been working on porting the fceux emulator to run under a cross platform Qt based GUI. This new port of fceux utilizes Qt and SDL2 and runs natively in Linux and Mac OSX. Included in the new Qt port, are most of the debug tools that previously only existed in the windows port of fceux. I am nearing the finish line regarding new development and could use some feedback from Linux or Mac users (especially those that have experience using the Rom hacking tools). Having some beta testers would go a long way in helping me decide if the code is ready for a new release. For those interested, the latest stable code can be found on github.com/tasvideos/fceux and build instructions are in the projects README file. For mac users, there are instructions on the fceux web site on how to use the dmg package artifact that is created by the appveyor autobuild system (If you don't want to have to build from source)

lidnariq
Posts: 9882
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Fceux Qt/SDL Port Testing

Post by lidnariq » Fri Oct 16, 2020 11:37 pm

I was confused by having the qmake fceux.pro file <_< It's missing dependencies, by the way :mrgreen:

Looks good! The only real problem I've noticed so far has to do with font spacing: in the debugger, the stack display will overflow to wider than the window it's allocated, without a scrollbar. I'm seeing some variant of Courier, and I (obviously) don't have FixedSys available.

... also, a random weird bug in the file selector: it only knows about directories that I've previously explicitly told it about? Probably not your bug.
there-are-other-directories-here.png
there-are-other-directories-here.png (6.88 KiB) Viewed 3501 times

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Sat Oct 17, 2020 4:26 pm

Sorry, about that .pro file. I moved to cmake a while back and had intended to get rid of that file. I will look into your two comments and see if they can be improved. I'm pretty sure I have the Rom open file browser saving the location of the last file opened and uses that directory as the starting point for subsequent opens. I should also be able to figure out how to get the stack display to not cut off text. Thank you for the feedback and let me know if you find more issues.

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Sat Oct 17, 2020 7:24 pm

Regarding the debugger stack display issue, I have just pushed a change that will now auto display a horizontal scroll bar should the widget need it (same goes for the vertical scroll bar). I have also added code that allows the number of stack bytes per line to be configurable. There are two ways to change the number of bytes per line for the stack display:
1. Right click on the widget to open a context menu. There will be a sub-menu in there to select number of bytes per line 1-4.
2. Left click to the widget to ensure that it has focus, then using the number keys 1-8 will change the number of bytes per line to the pressed key value.

I also added the Stack address to the beginning of each line, I can make the display of the stack address on the line toggle-able on/off in the future if others prefer the old display format.

lidnariq
Posts: 9882
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Fceux Qt/SDL Port Testing

Post by lidnariq » Sat Oct 17, 2020 7:52 pm

Mjbudd77 wrote:
Sat Oct 17, 2020 7:24 pm
Regarding the debugger stack display issue, I have just pushed a change that will now auto display a horizontal scroll bar should the widget need it
Looks good!
I also added the Stack address to the beginning of each line, I can make the display of the stack address on the line toggle-able on/off in the future if others prefer the old display format.
Feels a little wasteful? For whatever reason, I only get 17 characters per line in that dialog, and using 9 of them as a reminder for where the bytes in the stack are is a bit much. Maybe if you just condensed it a little that's be good enough (e.g. 1F7: instead of  $01F7 : )

Ooh, I get a SEGV when I quit FCEUX while the debugger is open. Need to rebuild with debugging symbols to narrow that down.

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Sat Oct 17, 2020 8:33 pm

Ooh, I get a SEGV when I quit FCEUX while the debugger is open. Need to rebuild with debugging symbols to narrow that down.
I believe I have just found the cause of this, a pointer was not being nulled appropriately during destruction. I will push the fix shortly.

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Sat Oct 17, 2020 8:53 pm

Feels a little wasteful? For whatever reason, I only get 17 characters per line in that dialog, and using 9 of them as a reminder for where the bytes in the stack are is a bit much. Maybe if you just condensed it a little that's be good enough (e.g. 1F7: instead of  $01F7 : )
I think you are right. I will change it to use a more compact format like you suggested.

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Fri Oct 23, 2020 3:01 pm

lidnariq wrote:
Fri Oct 16, 2020 11:37 pm
... also, a random weird bug in the file selector: it only knows about directories that I've previously explicitly told it about? Probably not your bug. there-are-other-directories-here.png
I believe I may have found a solution for this directory issue. Would you be able to check this with the latest code?

lidnariq
Posts: 9882
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Fceux Qt/SDL Port Testing

Post by lidnariq » Fri Oct 23, 2020 3:05 pm

Yup, that appears to have fixed it. (Why on earth would QDir::AllDirs not be default?)

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Sat Nov 07, 2020 2:46 pm

I’m still looking for some more beta testers for this. For Linux or Mac fceux users out there, any feedback on the new Qt/SDL port of fceux would be most appreciated.

tepples
Posts: 22171
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Fceux Qt/SDL Port Testing

Post by tepples » Sat Nov 07, 2020 6:25 pm

After I upgraded from Xubuntu 18.04 LTS to Xubuntu 20.04 LTS, I decided to try the new Qt front end for FCEUX. Here are the first few things I found:

1. Why can't I set Ctrl+R as the hotkey for soft reset? It only takes Ctrl or R.
2. Setting up keyboard controls for two players confused me, particularly if I want both players' key bindings to save across closing and reopening the emulator.
3. Audio output on Ubuntu 20.04 on a Dell Inspiron 11-3168 with a Pentium N3710 CPU is clicky. I can provide a recording on request.
4. A lot more spacing on the debugger under Qt than under Wine. It looks like "Breakpoints" and "Address Bookmarks" in particular got a lot wider. It's now a bit harder to lay out to show both a text editor and the debugger or both the screen (at 2x zoom) and the debugger.
5. Is the NTSC filter planned? The "Chroma crosstalk" activity in 240p Test Suite requires it.
6. Is connecting a Zapper through the GUI planned, or will it remain a command-line thing? The "Zapper test" activity in 240p Test Suite requires it.
7. Is there a way to double the pixels before doing the linear filtering, so I can have a 2.28x2.00 resize without making everything overly blurry? One way to simulate this through a shader can be found by search this forum for "fractional bilinear interpolation".
8. In the Windows version, I can advance to the next frame with the frame advance hotkey even while execution is stopped at a debugger breakpoint. It runs to the next breakpoint or to vblank, whichever comes first. In the Qt version, frame advance doesn't seem to do anything while at a debugger breakpoint. I have found this useful when trying to debug a particular part of the program (which has a breakpoint) while holding buttons on the controller.

Qt debugger (898x671 pixels)
Qt_debugger.png
Wine debugger (724x581 pixels)
Wine_debugger.png

Sonny_Jim
Posts: 13
Joined: Sat Jan 13, 2018 7:45 am

Re: Fceux Qt/SDL Port Testing

Post by Sonny_Jim » Sun Nov 08, 2020 6:48 pm

I've been using the port on an old Laptop, a few thoughts (apologies if others have covered it above).

On the whole, very good. I too have some audio issues like tepples, but it's nothing too drastic. It's perfectly adequate for me to do disassembly. The only niggles I have are that the debugger/hex editor are missing a few features the Windows version has.

1. Please can we have 'freeze/unfreeze' in the hex editor, it's a very valuable feature and it's a pain having to go to the cheats menu to set/unset a location
2. Cheat menu can be a little weird, same with the breakpoint section of the debugger. It seems it gets confused as to what is selected and what isn't
3. Please change the default button selection in the 'Add symbolic name' window. Right now if I type in a name and hit enter, it cancels the selection.
4. I'd love to be able to symbolically name things like in the windows version by right clicking any location in the debugger window, rather than having to click on the left hand side address. At the moment, it means having to pop open the hexeditor and locate the address manually.

There's a bug somewhere in the hexeditor bookmark that generates weird filenames like ' hE'$'\016''B'$'\177', with contents like this:

Code: Select all

Bookmark: addr=867A  desc="enemy_type_table?"
Bookmark: addr=9BF7  desc=""
Bookmark: addr=A09C  desc=""
Bookmark: addr=A1AF  desc="" 
Bookmark: addr=A381  desc="clear enemy " 
Bookmark: addr=A39A  desc="" 
Bookmark: addr=C568  desc="" 
Bookmark: addr=E526  desc="item_rewards" 
Bookmark: addr=EA86  desc="" 
EDIT: The rom filename is 'Bomber King (Japan).nes', so maybe the parentheses aren't being escaped properly or something?

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Sun Nov 08, 2020 9:40 pm

Thank you for the feedback. I will do my best to address the items you have idenified.
As far as the sound issues that both of you are happening, my only thought is that maybe the computer is not running the emulator with a high enough scheduling priority. I will look into a way to test. I am curious as to how much the emulator is taxing you system, when I run a 'top' on a command line I can see that the fceux process is using about 27% CPU on my laptop which uses i7 processors. How much CPU is yours using? I have a lower end desktop computer in my office that reports about 80% CPU usage when running fceux and that does have some intermittent audio clicking. However, I have been able to reduce that by running the fceux process with a higher scheduling priority. I can give you more details if you want on that.
I can certainly look at fixing items 1-3. Item number 3 will be merged into the master as soon as the pipeline passes.
For item number 4, whenever I right click anywhere in the debugger window it pulls up the context menu for that line that was right clicked on. The click doesn't have to be on the left side of the window.

Mjbudd77
Posts: 24
Joined: Fri Oct 16, 2020 9:53 pm
Location: Tampa

Re: Fceux Qt/SDL Port Testing

Post by Mjbudd77 » Sun Nov 08, 2020 9:53 pm

Thank you for your feedback.
tepples wrote:
Sat Nov 07, 2020 6:25 pm
After I upgraded from Xubuntu 18.04 LTS to Xubuntu 20.04 LTS, I decided to try the new Qt front end for FCEUX. Here are the first few things I found:

1. Why can't I set Ctrl+R as the hotkey for soft reset? It only takes Ctrl or R.
2. Setting up keyboard controls for two players confused me, particularly if I want both players' key bindings to save across closing and reopening the emulator.
3. Audio output on Ubuntu 20.04 on a Dell Inspiron 11-3168 with a Pentium N3710 CPU is clicky. I can provide a recording on request.
4. A lot more spacing on the debugger under Qt than under Wine. It looks like "Breakpoints" and "Address Bookmarks" in particular got a lot wider. It's now a bit harder to lay out to show both a text editor and the debugger or both the screen (at 2x zoom) and the debugger.
5. Is the NTSC filter planned? The "Chroma crosstalk" activity in 240p Test Suite requires it.
6. Is connecting a Zapper through the GUI planned, or will it remain a command-line thing? The "Zapper test" activity in 240p Test Suite requires it.
7. Is there a way to double the pixels before doing the linear filtering, so I can have a 2.28x2.00 resize without making everything overly blurry? One way to simulate this through a shader can be found by search this forum for "fractional bilinear interpolation".
8. In the Windows version, I can advance to the next frame with the frame advance hotkey even while execution is stopped at a debugger breakpoint. It runs to the next breakpoint or to vblank, whichever comes first. In the Qt version, frame advance doesn't seem to do anything while at a debugger breakpoint. I have found this useful when trying to debug a particular part of the program (which has a breakpoint) while holding buttons on the controller.
I have just merged an update into master for items 1 and 8.
For item 2, can you describe in more detail what confused you about the gamepad config window. I have it setup when you can save different mapping profiles for various input devices.
For item 3, can you tell me how much CPU fceux is using when you are running the emulator with a loaded ROM? Use top command.
For item 4, I'm trying not to hard code widget pixel sizes into the GUI since it I want it to try to auto scale to the resolution of the screen. But I will try to see what I can do about make the window more compact. One thing that I could do is put the entire window in a scrollable viewport so that it can be further shrunk down. But this would only really be valuable if you don't care to see the entire window all the time.
For item 5, is this the NTSC 2x special scaler that is mentioned on the website help pages?
For item 6, do you just need an input device select window like the windows GUI has?
For item 7, I wonder if bringing back the x2,x3, and x4 video prescalers would help with the hardware accel linear filtering? I can look into this.

UPDATE: I believe I have addressed all items here except 2 & 6.
Last edited by Mjbudd77 on Thu Nov 19, 2020 7:33 pm, edited 1 time in total.

Sonny_Jim
Posts: 13
Joined: Sat Jan 13, 2018 7:45 am

Re: Fceux Qt/SDL Port Testing

Post by Sonny_Jim » Sun Nov 08, 2020 10:41 pm

Mjbudd77 wrote:
Sun Nov 08, 2020 9:40 pm
For item number 4, whenever I right click anywhere in the debugger window it pulls up the context menu for that line that was right clicked on. The click doesn't have to be on the left side of the window.
This is different behavior than the Windows version, or rather, it's lacking functionality that's in the Windows version. I'll try to explain better what I mean:

Code: Select all

07:D41C: A5 12 LDA $0012 = #$00
In the Windows version, I can right click $0012 and it'll allow me to set a symbolic name for $0012. (In fact I think the Win trace logger window behaves like this as well)
In the Linux version, right clicking $0012 sets the symbolic name for $D41C, rather than $0012.

This is what I mean by having to set the symbolic name via the hex editor rather than the debug window. It's not a massive issue, but it sure is handy. Also I can't seem to select and copy text in the debugger/trace logger windows in the Linux version, but that might be down to how I built it.

EDIT: Another random one, the settings in the tracelogger window aren't saved/restored, so I have to turn on 'Symbolic Trace' each time I restart FCEUX
Last edited by Sonny_Jim on Mon Nov 09, 2020 1:09 am, edited 1 time in total.

Post Reply