Debugging on Linux(Ubuntu)

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Debugging on Linux(Ubuntu)
by on (#85296)
I'm quite surprised how hard of a time I'm having with making nes programs in linux compared to windows. I won't have access to my windows computer for a while so for now I have to use my linux laptop. I've gotten cc65 to install and kind of work, yet I have no idea how to debug the programs in linux.

FCEUX seems to have a debugger in Windows, yet in Linux there doesn't seem to be one? Or maybe I just can't find it....

Nintendulator is only on windows, so that's out.

I have no idea how to compile NESICIDE(NESICIDE 2?). INSTALL file says to do the regular "./configure; make" routine yet that doesn't seem to work(there's no configure file...). Maybe I got the wrong source code or something?





The program that I made in windows(a sound test) is not working right(the sprites are a random mess, yet background tiles work fine) despite that I'm fairly sure I didn't change a thing, with exception to changing backslashes to forward-slashes in ".include" calls.

Maybe I just forgot how to compile? I can't remember exactly what options I picked in windows. I have it like this:

Code:
ca65 -o main.o main.asm


I have a whole bunch of .asm files that branches from main.asm, but I guess I'm only supposed to mention main.asm? Assembles just fine, at any rate.

For linking it's:

Code:
cl65 -o linux_test.nes -t nes -C nes.cfg main.o


Same result happens whether I include "-t nes" or not.

Somewhat unrelated to linux, but I'm also not sure what I'm doing when it comes to the config file for cl65:

Code:
MEMORY
{
            ZP: start = $00, size = $100, type = rw;
            RAM: start = $200, size = $600, type = rw;
            HEAD: start =  $0000, size = $10, type = ro, file = %O;
            PRG: start = $8000, size = $8000, type = ro, file = %O;
            CHR: start = 0, size = $2000, file = %O, fill = yes;
}
SEGMENTS
{
            CODE: load = PRG, type = ro, start = $8000;
            RODATA: load = PRG, type = ro;
            DATA: load = RAM, type = bss;
            ZEROPAGE: load = ZP, type = zp;
            BSS: load = RAM, type = bss, define = yes;
            VECTORS: load = PRG, type = ro, start = $FFFA;
            HEADER: load = HEAD, type = ro;
            CHARS: load = CHR, type = rw;
}


When I did this in windows, the CHR/CHARS Segment was missing and when I compile in linux I got an error that CHARS is missing.
Code:
ld65: Error: Missing memory area assignment for segment `CHARS'

I'm pretty sure I had a reason to leave out CHARS in config, but I forgot why.... And I'm also kinda sure that the way I handled CHARS is the problem. If it's not, I need to debug to find out what happened.

by on (#85299)
Last time I checked there wasn't much available for Linux. Personally I'd just install VirtualBox and setup a virtual machine with Windows. Even Windows 98 will do, and you don't need particularly good hardware to virtualize that (emulators might not run at full speed though, but that's not a requirement for debugging).
Re: Debugging on Linux(Ubuntu)
by on (#85323)
Undubbed wrote:
I have no idea how to compile NESICIDE(NESICIDE 2?). INSTALL file says to do the regular "./configure; make" routine yet that doesn't seem to work(there's no configure file...). Maybe I got the wrong source code or something?


There have been various efforts to compile NESICIDE in Linux. I'm not much of a Linux geek so I unfortunately can't say I know the magic sauce. I know it *has* worked in Linux and OSX in the past.

by on (#85326)
I guess Wine is your friend here. Probably no need for Virtual box that'd be complete overkill.

by on (#85327)
FCEUX debugs nicely enough, and works fine under wine.

by on (#85328)
Try Mednafen, it has nice debugger.

by on (#85329)
I can't belive I missed an emualtor that supoorts SO MANY platforms ! It sure looks interesting.

Also, more platform does not mean better, REW, a GB/NES emulator, is even less accurate than Nesticle ;)

by on (#85330)
Bregalad wrote:
I can't belive I missed an emualtor that supoorts SO MANY platforms !

Have you ever heard of MESS? According to that page it emulates 577 unique systems. Here's the full list.

by on (#85331)
Oh my god !! Is it some kind of joke or something ?

by on (#85333)
MAME emulates hundreds of platforms because arcade platforms are often custom-built for one game. Not all arcade platforms are Neo-Geo MVS, Vs. System, PlayChoice, Nintendo Super System, Capcom ZN, Konami System 573, or other interchangeable systems. If MAME can emulate hundreds of platforms, PlayChoice among them, why can't its offshoot MESS?

by on (#85336)
Bregalad wrote:
Also, more platform does not mean better, REW, a GB/NES emulator, is even less accurate than Nesticle ;)


REW may be bad, but it's not THAT bad. Nesticle doesn't even know about the 341 pixels per scanline rule, or even have the correct number of scanlines.
Try Slalom in both emulators. REW at least is attempting to emulate a NES.

by on (#85337)
ooh, I forgot all about wine for some reason. Thanks!