It is currently Mon Oct 21, 2019 8:15 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Thu Feb 04, 2016 2:20 pm 
Offline

Joined: Sun Mar 27, 2011 10:49 am
Posts: 271
Location: Seattle
I would rather use Windows than try to write an NES game without a debugger :|

If it works repeatedly at the beginning of the game

and crashes every time at the end of the level

then something happens during gameplay that causes the crash

(in particular, some global state (either in memory or in the hardware) is changed)

If you know it happens during ppu_on_all(), then you know that the
correct behaviour of ppu_on_all() depends on the the global state that is
changed during gameplay

What does ppu_on_all() look like?


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 3:08 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21643
Location: NE Indiana, USA (NTSC)
calima wrote:
tepples wrote:
Unless you're using Linux on a non-x86 platform, you can do what I did: sudo apt-get install wine and then use the Windows version.

Pure 64-bit, so Wine is not a possibility.

Then go impure (that is, multi-arch) with i386 and amd64. Or install a VM and run 32-bit Linux and Wine in the VM. Or buy a copy of Windows to use on another computer, compile FCEUX for Windows in 64-bit mode, and run that in 64-bit Wine.

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 3:13 pm 
Offline
User avatar

Joined: Sun Nov 09, 2008 9:18 pm
Posts: 1107
Location: Pennsylvania, USA
Something's gotta be stepping on something. While I was experimenting with C, I could swear I got into a situation once where something was mysteriously stepping on a zp variable of mine. It made me wonder at one point if the linker configuration was set up so that my zp variables actually shared space with cc65's zp space. I never found out what that particular problem was as that bug just hid after a while. With 6502, I've been able to consistently find the root cause of bugs throughout the deveopment of each game (and know for sure it was my own code...the assembler itself only caused trouble in 3 instances I can recall and were minor problems)---something I can't say for any other language I've worked with (sometimes a workaround is the only thing you can find in the face of immense complexity).


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 3:24 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8626
Location: Seattle
tepples wrote:
Then go impure (that is, multi-arch) with i386 and amd64. Or install a VM and run 32-bit Linux and Wine in the VM.
Or debootstrap yourself a 32-bit chroot and use schroot.


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 3:53 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2576
Location: DIGDUG
Maybe you could just post the Source Code and/or the ROM, and one of the people here can look at it with a debugger.

(And if cc65 source code, please indicate what version of cc65 you use).

Or perhaps, buy a $20 used windows laptop from ebay.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 5:22 pm 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 468
The Debian version of mednafen has a debugger. It has a really obtuse interface, but it's something.


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 5:27 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11417
Location: Rio de Janeiro - Brazil
Not having a debugger at your disposal is crazy, solving bugs will take you 10 times longer if you have to keep guessing where the problem is... Come on, just install VirtualBox and a 200MB stripped down version of XP so you can do things properly.


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 5:54 pm 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 468
I know I'm being completely unhelpful here, but I find it depressing that the answer to "how to debug a NES game on Linux" is "use Windows".

Seriously though, why is the Linux port of FCEUX so pathetic?


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 5:59 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7608
Location: Canada
Rahsennor wrote:
Seriously though, why is the Linux port of FCEUX so pathetic?

You act like this is some sort of professional project. The reason is obvious: nobody is sufficiently interested to do it for free.

If it's something you care about, why not contribute to the project yourself?


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 6:49 pm 
Offline

Joined: Thu Aug 20, 2015 3:09 am
Posts: 468
I was not intending to act like it was a professional project, and you're right that the answer is obvious. I should have kept my mouth shut.


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 7:32 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7608
Location: Canada
Sorry, I didn't want to admonish you for speaking about it; what I was trying to do (perhaps with too bitter a tone) was encourage you to join the FCEUX project and help bring it up to snuff.


Top
 Profile  
 
PostPosted: Thu Feb 04, 2016 8:39 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21643
Location: NE Indiana, USA (NTSC)
Rahsennor wrote:
I find it depressing that the answer to "how to debug a NES game on Linux" is "use Windows".

No, it's "use Wine". That works for NES (FCEUX), and it works for Super NES (NO$SNS).

Quote:
Seriously though, why is the Linux port of FCEUX so pathetic?

Is it necessarily more pathetic than wanting to adhere to some standard of 64-bit purity?

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Fri Feb 05, 2016 2:32 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 975
tepples wrote:
Is it necessarily more pathetic than wanting to adhere to some standard of 64-bit purity?


And waste several gigs? I have better use for that space.

To the people telling me to pirate or pay for Windows, screw you. That is never the solution, it's a problem.

Quote:
(in particular, some global state (either in memory or in the hardware) is changed)


I know, but there is no such state change in my code. So it must be a compiler bug, which is rather hard to track. If the cc65 stack underflows, it scribbles on the 0x2000 registers, if the hw stack overflows, it scribbles on ZP vars.

Quote:
What does ppu_on_all() look like?


Code:
;void __fastcall__ ppu_on_all(void);

_ppu_on_all:

        lda <PPU_MASK_VAR
        ora #%00011000

ppu_onoff:

        sta <PPU_MASK_VAR
        jmp _ppu_wait_nmi


Quote:
While I was experimenting with C, I could swear I got into a situation once where something was mysteriously stepping on a zp variable of mine


They are allocated the same, so that was a bug in the compiler (or the standard library, if you used it).

dougeff wrote:
Maybe you could just post the Source Code and/or the ROM, and one of the people here can look at it with a debugger.

(And if cc65 source code, please indicate what version of cc65 you use).


I use cc65 from git master. Will post the ROM in a bit.

Quote:
No, it's "use Wine". That works for NES (FCEUX), and it works for Super NES (NO$SNS).


I won't use closed-source software on principle. Yes, fceux Windows would be open source, but that's a huge waste of both time and disk space.

I'm thinking about building fceux with debug symbols, finding where it keeps the RAM, and setting watches by debugging the emulator on the host. Crazy, but far less crazy than installing Windows.


Top
 Profile  
 
PostPosted: Fri Feb 05, 2016 4:02 am 
Offline

Joined: Tue Oct 06, 2015 10:16 am
Posts: 975
ROM link:
https://u.pomf.is/vstins.gz

Wait a second or two and press select.


Top
 Profile  
 
PostPosted: Fri Feb 05, 2016 6:07 am 
Offline
NESICIDE developer
User avatar

Joined: Mon Oct 13, 2008 7:55 pm
Posts: 1089
Location: Minneapolis, MN
calima wrote:
AFAIK no emulator for Linux supports any debugging, though I've only tried the most popular ones. That's making this quite hard.

NESICIDE does. But it's been *forever* since I built and provided a Linux binary. Not that it won't work. Just will take me a little bit to get my Linux VM back.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group