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

3DS build fails to include sprites.t3x, resulting in crash #486

Open
l-austenfeld opened this issue Sep 18, 2023 · 4 comments
Open

3DS build fails to include sprites.t3x, resulting in crash #486

l-austenfeld opened this issue Sep 18, 2023 · 4 comments

Comments

@l-austenfeld
Copy link

Describe the bug
When building Checkpoint using make 3ds the build process fails to include the file sprites.t3x in the resulting .cia files romfs.
This causes Checkpoint to crash on start when trying to load the file.
(This seems to happen here: https://github.com/BernardoGiordano/Checkpoint/blob/master/3ds/source/gui.cpp#L45 maybe a null check for spritesheet and proper error message could be added here)
Running cp 3ds/build/sprites.t3x 3ds/assets/romfs/gfx/ to copy the file manually and rebuilding the .cia produces a working build.

To Reproduce
Steps to reproduce the behavior:

  1. Use make 3ds to build
  2. Use ctrtool --listromfs 3ds/out/Checkpoint.cia to list romfs contents

Expected behavior
The file sprites.t3x should be included in the romfs, because Checkpoint crashes on start without it.

3DS:

  • Entrypoint: CIA
  • System version: 11.17.0-50
  • Checkpoint version: v3.8.0-6-gd34006d
  • Result code (if available):
@l-austenfeld
Copy link
Author

I also just noticed that make clean does NOT remove the 3ds/assets/romfs/gfx/sprites.t3x file.

@BernardoGiordano
Copy link
Owner

I would guess the issue is just your development environment not having tex3ds installed. The make clean shouldn't really matter since assets are not really updated often.

@l-austenfeld
Copy link
Author

  • tex3ds is installed and working, as it produces the file 3ds/build/sprites.t3x
  • make clean not deleting 3ds/assets/romfs/gfx/sprites.t3x is relevant, as just manually copying the file from 3ds/build/sprites.t3x once (such as during initial experimentation with the new location) would make all builds produced with that clone of the git repo work properly. Only a fresh git clone would not work.

@l-austenfeld
Copy link
Author

I found a possible source for this problem:
The 3ds Makefile contains include $(DEVKITARM)/3ds_rules. The included file contains the following rule

%.t3x	%.h	:	%.t3s
#---------------------------------------------------------------------------------
	$(SILENTMSG) $(notdir $<)
	$(SILENTCMD)tex3ds -i $< -H $*.h -d $*.d -o $*.t3x

this seems to take precedence over the rule lower down in the Makefile

%.t3x	%.h	:	%.t3s
#---------------------------------------------------------------------------------
	@echo $(notdir $<)
	@tex3ds -i $< -H $*.h -d $*.d -o $(TOPDIR)/$(GFXBUILD)/$*.t3x

which would place the sprites.t3x file in the correct location.

I don't know how to best fix this, because I am not good at writing Makefiles.

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