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

Problems with sprites example #1

Open
danboid opened this issue May 6, 2024 · 1 comment
Open

Problems with sprites example #1

danboid opened this issue May 6, 2024 · 1 comment

Comments

@danboid
Copy link

danboid commented May 6, 2024

Hi James

So far I have only watched your video on how to set up zcc, I haven't watched the sprites video yet but I thought I'd try building and running this under CSpect first.

I get this warning when building it:

~/src/specnext-sprites-example$ make
mkdir -p build bin
zcc +zxn -subtype=nex -vn --list -m -s -clib=sdcc_iy -pragma-include:zpragma.inc -startup=31  src/main.c -o build/zxn_sprite_1 -create-app
src/main.c:394: warning 126: unreachable code

I have attached a video of what your sprite demo looks like for me under CSpect. The sprites are just a garbled mess of pixels.

I am running zcc v22399-e4f3b9db61-20240504 under Debian Testing / trixie amd64

sprite-demo.webm
@danboid
Copy link
Author

danboid commented May 12, 2024

I have now got this sprite example to run correctly under CSpect.

David Crespo explained the problem and solution like this:

I think you are compiling your .nex executable correctly, but seems you aren't setting the correct path for CSpect to search for assets (in that demo, they are loading from disk, and from your screencap, looks like they haven't loaded)

If your .nex is in /sprites_demo and the assets in /sprites_demo/assets, and assuming your cwd is /sprites_demo, then the command line for CSpect should be something like

CSpect -sound -w2 -vsync -zxnext -mmc=assets multiple-sprites.nex

The -mmc parameter is key for this, it should point to where the assets are located.

Personally, I prefer to include my assets inside the executable and not load them from disk, but it's just a different approach.

In my case I found it easiest to copy zxn_sprite_1.nex and the assets dir from this repo into the same dir as CSpect.exe then I ran

mono CSpect.exe -mmc=./assets/ zxn_sprite_1.nex

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

1 participant