Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nesfab does nothing when trying to compile certain examples #9

Open
danielah05 opened this issue Apr 8, 2023 · 18 comments
Open

nesfab does nothing when trying to compile certain examples #9

danielah05 opened this issue Apr 8, 2023 · 18 comments

Comments

@danielah05
Copy link

dont know why this is happening specifically but it seems like some of the examples (for example, hang_glider) does absolutely nothing when trying to run its cfg file through nesfab while others (hello_world in this case) work perfectly fine.
image

@pubby
Copy link
Owner

pubby commented Apr 9, 2023

That's a strange bug. Seeing "NROM requries chrrom" implies it's not parsing the files or something. I'm able to compile the example on my own computers though.

Tell me me more about your setup. It looks like you're on Windows? Are you running the latest version (0.4)?

@danielah05
Copy link
Author

yes i am on windows (windows 10 to be specific) and i am running 0.4

@danielah05
Copy link
Author

the examples are also just straight from the github cuz i downloaded the full repo and then just used the nesfab exe itself from the releases
image

@pubby
Copy link
Owner

pubby commented Apr 10, 2023

Thanks.

Can you verify that no .nes file was generated? On windows, sometimes the .nes file ends up in the directory of the nesfab.exe executable, while other times it ends up where the .cfg file was. It depends on how you invoke the program. If you find hang_glider.nes, the program is working correctly.

@danielah05
Copy link
Author

nope, nothing
image

@pubby
Copy link
Owner

pubby commented Apr 11, 2023

Hmm. If you don't mind trying one more thing, could you try an older version, like 0.3, and see if that works? That would help narrow things down.

@danielah05
Copy link
Author

0.3 does the same as latest
cmd_G72yxwPjVM
0.2-0.1 gives me an "unknown flag error" but after downgrading the project files to 45b8ca5 it started having the same problem as latest
cmd_G72yxwPjVM

@danielah05
Copy link
Author

update on this, nesfab seems to fail for me when trying to compile a project with a chrrom file getting loaded, removing this line in a thing im making makes it work instantly
image

@danielah05
Copy link
Author

interesting enough after getting nesfab running on WSL trying to compile hang_glider for example gives me a new error that it never gave me on CMD just called "Illegal instruction"
image

@danielah05
Copy link
Author

like mentioned earlier, if i remove the chrrom file loading part it also compiles hang_glider in this case, so something fails on that line of code for me

@danielah05
Copy link
Author

did some experimenting to see if it was just my current windows install messing something up but even trying this both in a windows 10 and 11 vm gives the same issue

@danielah05
Copy link
Author

danielah05 commented May 7, 2023

same issue on a ubuntu virtual machine, this time with an extra "(core dumped)" message
vmware_ei97ZOsAoe

@pubby
Copy link
Owner

pubby commented May 7, 2023

Very helpful results :)

The 'illegal instruction' is because the executable was compiled with extension flags (-mpopcnt -msse4 -mcx16 -mmovbe) and either your CPU, or the VM doesn't support them.

I think it's reasonable to drop support for these extensions in the next release, as you're the second person to get this error.

Until then, you can compile without extensions using:

make ARCH= release

@pubby
Copy link
Owner

pubby commented May 7, 2023

The CHRROM stuff is a little baffling still. Can you narrow it down even further?

For example, if this fails then it's chrrom which is the problem:

chrrom
    U(10)

If this fails then it's the PNG loader:

chrrom
    file(raw, "file.bin")

(where file.bin is some arbitrary file)

@danielah05
Copy link
Author

swapping out the file loading line with "U(10)" makes the hang_glider rom compile, really seems like something is wrong with the png loader then

@danielah05
Copy link
Author

Very helpful results :)

The 'illegal instruction' is because the executable was compiled with extension flags (-mpopcnt -msse4 -mcx16 -mmovbe) and either your CPU, or the VM doesn't support them.

I think it's reasonable to drop support for these extensions in the next release, as you're the second person to get this error.

Until then, you can compile without extensions using:

make ARCH= release

most likely my cpu just not supporting them as my cpu is fairly old by now, this isnt fully a problem for me as on the windows build it works fine, just the linux build has this issue

@danielah05
Copy link
Author

also probably shouldve mentioned this, i managed to compile a rom when swapping out a png with a bin file instead by doing the "raw, "file.bin"" thing, it just really doesnt wanna do pngs for some reason

@pubby
Copy link
Owner

pubby commented May 9, 2023

Yeah, sounds like the PNG loader is the problem. Nesfab uses lodepng for this, so the bug might be out of my control. But I will review the code anyway.

In the mean time, I'm glad there's a workaround. Instead of PNGs, you can load CHR graphics directly. External tools exist for this, like nexxt, nes asset workshop, or https://github.com/pubby/Ralph-4/blob/master/tools/pilbmp2nes.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants