nextlib v7 compile command options and sound effects functions
Quote from dbolli on 17th February 2021, 7:20 amHi There,
I am trying out nextlib v7 and have found that I get error messages below for existing code that compiles with previous v6 and does not use the v7 sound effects subroutines:
next-demo-sprite-test.bas:3154: error: Undefined GLOBAL label '.playmusicnl'
next-demo-sprite-test.bas:3337: error: Undefined GLOBAL label '.ayfxbankinplaycode'
next-demo-sprite-test.bas:3340: error: Undefined GLOBAL label '.afxChDesc'
I'm not using NextBuild and am just copying the nextlib.bas v7 file to my /path/to/zxbasic/arch/zxnext/library/ dir
If I add -D NOAYFX to my zxbc.py compile command, this helps but I still get some of the above error messages.
So I added
#ifndef NOAYFX
' Added to disable sound effectsBefore
sub fastcall PlaySFX(byval fx as ubyte)
and added
#endif
' Added for #ifndef NOAYFXAfter the end of
sub fastcall CallbackSFX()
After these changes, my code compiled successfully.
Just thought I'd let you know.
Regards,
Derek.
Hi There,
I am trying out nextlib v7 and have found that I get error messages below for existing code that compiles with previous v6 and does not use the v7 sound effects subroutines:
next-demo-sprite-test.bas:3154: error: Undefined GLOBAL label '.playmusicnl'
next-demo-sprite-test.bas:3337: error: Undefined GLOBAL label '.ayfxbankinplaycode'
next-demo-sprite-test.bas:3340: error: Undefined GLOBAL label '.afxChDesc'
I'm not using NextBuild and am just copying the nextlib.bas v7 file to my /path/to/zxbasic/arch/zxnext/library/ dir
If I add -D NOAYFX to my zxbc.py compile command, this helps but I still get some of the above error messages.
So I added
#ifndef NOAYFX
' Added to disable sound effects
Before
sub fastcall PlaySFX(byval fx as ubyte)
and added
#endif
' Added for #ifndef NOAYFX
After the end of
sub fastcall CallbackSFX()
After these changes, my code compiled successfully.
Just thought I'd let you know.
Regards,
Derek.
Quote from em00k on 17th February 2021, 11:16 amHi
I don't know what's in "next-demo-sprite-test.bas" to comment on.
The current version of nextlib is 7.3 and visible at the top the library, and in Nextbuild is it stored in Scripts/ not the arch folder.
You should not need to add any ifdefs manually as they have already been applied correctly but if you're mixing versions and not using Nextbuild I suppose its going to get a bit muddled up, as everything now expect to be built with nextbuild.py - other configurations aren't supported.
If you are not using any of the interrupt routines - none of the interrupt / ayfx code should be included.
The example /Sources/CustomInterrupt.bas shows how to use a CustomISR without AYFX/Music.
Maybe you could post the source so I can see what is heppening?
Thanks.
Hi
I don't know what's in "next-demo-sprite-test.bas" to comment on.
The current version of nextlib is 7.3 and visible at the top the library, and in Nextbuild is it stored in Scripts/ not the arch folder.
You should not need to add any ifdefs manually as they have already been applied correctly but if you're mixing versions and not using Nextbuild I suppose its going to get a bit muddled up, as everything now expect to be built with nextbuild.py - other configurations aren't supported.
If you are not using any of the interrupt routines - none of the interrupt / ayfx code should be included.
The example /Sources/CustomInterrupt.bas shows how to use a CustomISR without AYFX/Music.
Maybe you could post the source so I can see what is heppening?
Thanks.
Quote from dbolli on 17th February 2021, 11:04 pmI'm not using NextBuild and am just copying the nextlib.bas v7 file to my /path/to/zxbasic/arch/zxnext/library/ dir
Hi em00k,
Thanks for your reply, I've created an empty .bas file that just has
' :dbolli:20210218 11:52:06 Empty test of nextlib.bas
' compile with zxbc.py next-demo-empty-test.bas --arch zxnext --zxnext --optimize=3 --tap --BASIC --org=24576 --heap-size=768 --autorun#include <nextlib.bas>
PAPER 7: BORDER 7 : BRIGHT 0: INK 0 : CLS
and when I compile with the command above, I get
next-demo-empty-test.bas:3154: error: Undefined GLOBAL label '.playmusicnl'
next-demo-empty-test.bas:3335: error: Undefined GLOBAL label '.ayfxbankinplaycode'
next-demo-empty-test.bas:3338: error: Undefined GLOBAL label '.afxChDesc'
If I add -D NOAYFX to the compile command, I get
next-demo-empty-test.bas:3335: error: Undefined GLOBAL label '.ayfxbankinplaycode'
next-demo-empty-test.bas:3338: error: Undefined GLOBAL label '.afxChDesc'
If I add -D IM2 to the compile command, I get the same errors as above.
If I add the #ifndef / #endif to nextlib.bas as in previous post, and compile with -D NOAYFX in the compile command, it compiles without errors.
Hope this makes things a bit clearer.
Regards,
Derek.
I'm not using NextBuild and am just copying the nextlib.bas v7 file to my /path/to/zxbasic/arch/zxnext/library/ dir
Hi em00k,
Thanks for your reply, I've created an empty .bas file that just has
' :dbolli:20210218 11:52:06 Empty test of nextlib.bas
' compile with zxbc.py next-demo-empty-test.bas --arch zxnext --zxnext --optimize=3 --tap --BASIC --org=24576 --heap-size=768 --autorun#include <nextlib.bas>
PAPER 7: BORDER 7 : BRIGHT 0: INK 0 : CLS
and when I compile with the command above, I get
next-demo-empty-test.bas:3154: error: Undefined GLOBAL label '.playmusicnl'
next-demo-empty-test.bas:3335: error: Undefined GLOBAL label '.ayfxbankinplaycode'
next-demo-empty-test.bas:3338: error: Undefined GLOBAL label '.afxChDesc'
If I add -D NOAYFX to the compile command, I get
next-demo-empty-test.bas:3335: error: Undefined GLOBAL label '.ayfxbankinplaycode'
next-demo-empty-test.bas:3338: error: Undefined GLOBAL label '.afxChDesc'
If I add -D IM2 to the compile command, I get the same errors as above.
If I add the #ifndef / #endif to nextlib.bas as in previous post, and compile with -D NOAYFX in the compile command, it compiles without errors.
Hope this makes things a bit clearer.
Regards,
Derek.
Quote from dbolli on 1st March 2021, 6:55 amUPDATE: After a bit of jiggling with python3 versions, I found that nextbuild.py works for me 🙂
e.g.
PATH=$PATH:~/Path/to/NextBuildV7/Scripts/
export PATHcd "$HOME/Path/to/NextBuildV7/Sources/TopDownExample/"
nextbuild.py "$HOME/Path/to/NextBuildV7/Sources/TopDownExample/alien-b.bas"
Regards,
Derek.
UPDATE: After a bit of jiggling with python3 versions, I found that nextbuild.py works for me 🙂
e.g.
PATH=$PATH:~/Path/to/NextBuildV7/Scripts/
export PATHcd "$HOME/Path/to/NextBuildV7/Sources/TopDownExample/"
nextbuild.py "$HOME/Path/to/NextBuildV7/Sources/TopDownExample/alien-b.bas"
Regards,
Derek.