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

rgbds-0.6.0 - pb12: BootROMs/pb12.c:90: main: Assertion `outctl != 1' failed. #500

Closed
orbea opened this issue Oct 3, 2022 · 8 comments
Closed

Comments

@orbea
Copy link
Contributor

orbea commented Oct 3, 2022

OS: Gentoo
rgbds: 0.6.0 (https://github.com/gbdev/rgbds/releases/tag/v0.6.0)
SameBoy: 5550727

The recent rgbds v0.6.0 release breaks the SameBoy pb12.c build.

SameBoy/build/pb12 < build/obj/BootROMs/SameBoyLogo.2bpp > build/obj/BootROMs/SameBoyLogo.pb12
pb12: BootROMs/pb12.c:90: main: Assertion `outctl != 1' failed.
Aborted 
make: *** [Makefile:473: build/obj/BootROMs/SameBoyLogo.pb12] Error 134
@LIJI32
Copy link
Owner

LIJI32 commented Oct 3, 2022

This looks strictly related to pb12 itself and not RGBDS, are you sure it's v0.6.0 that broke it?

@orbea
Copy link
Contributor Author

orbea commented Oct 3, 2022

I think this is an intentional change in rgbds.
I bisected it to commit gbdev/rgbds@d86d24b.
Which fixed rgbds issue gbdev/rgbds#1062.

d86d24bdc14fb2fc5c1ca9729495e1a26c2d6d08 is the first bad commit
commit d86d24bdc14fb2fc5c1ca9729495e1a26c2d6d08
Author: Rangi <[email protected]>
Date:   Fri Sep 30 17:13:55 2022 -0400

    Remove legacy support for generating a palette with unused colors
    
    If you need an explicit set of colors, possibly including
    unused ones, use `-c`.
    
    Fixes #1062

 src/gfx/pal_sorting.cpp | 25 -------------------------
 1 file changed, 25 deletions(-)

@orbea
Copy link
Contributor Author

orbea commented Oct 3, 2022

Changing the rgbgfx command line in the Makefile to rgbgfx -h -u -o $@ $< -c embeddedworks.

There are additionally many deprecated warnings including changing -h to -Z. I fear it may be impossible to support newer rgbds without breaking older rgbds...

@Rangi42
Copy link
Contributor

Rangi42 commented Oct 3, 2022

You could check the value of rgbgfx -V and use flags depending on its version.

@orbea
Copy link
Contributor Author

orbea commented Oct 4, 2022

You could check the value of rgbgfx -V and use flags depending on its version.

I thought about that, but checking >= 0.6.0 with pure make is not straight forward. Or do you have an idea how?

@carmiker
Copy link
Contributor

carmiker commented Oct 4, 2022

In my view it just makes sense to accept that 0.6.0 and beyond require a different set of command line switches and building SameBoy now requires >= 0.6.0. Anyone building this from source or packaging it up will have to contend with this now, and in the long run it is a non-issue. That being said, I think it makes sense to avoid changing command line switches often.

@Rangi42
Copy link
Contributor

Rangi42 commented Oct 4, 2022

If you can assume that rgbasm has the same version as rgbgfx:

$(OBJ)/%.2bpp: %.png
	-@$(MKDIR) -p $(dir $@)
	@if test "$$(echo 'print __RGBDS_MAJOR__ || (!__RGBDS_MAJOR__ && __RGBDS_MINOR__ > 5)' | rgbasm -)" = '$$0'; then \
		rgbgfx -h -u -o $@ $<; \
	else \
		rgbgfx -Z -u -c embedded -o $@ $<; \
	fi

(or put that content in versioncheck.asm and do test "$$(rgbasm versioncheck.asm)" = '$$0';)

I think if/else/fi, test A = B, and $(command) are all POSIX sh.

@LIJI32
Copy link
Owner

LIJI32 commented Oct 4, 2022

In my view it just makes sense to accept that 0.6.0 and beyond require a different set of command line switches and building SameBoy now requires >= 0.6.0. Anyone building this from source or packaging it up will have to contend with this now, and in the long run it is a non-issue. That being said, I think it makes sense to avoid changing command line switches often.

I would generally agree, but considering many users install rgbds from a package manager, which are often behind by at least a few weeks, I'd rather avoid that. I like @Rangi42's solution.

@LIJI32 LIJI32 closed this as completed in c0966ce Oct 4, 2022
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

Successfully merging a pull request may close this issue.

4 participants