GeorgRottensteiner/C64Studio

Cannot type "\" in a BASIC #include directive

Pinacolada64 opened this issue · 2 comments

I want to #include symbol addresses from an .asm module in another directory, but can't type "\" in the #include directive.

I'd like to do something like:

.\asm\equates.asm:

ntscpal = $0a03 ; for the c128

then:

.\basic.bas:

#include ".\asm\equates.asm"
10 a=peek({ntscpal}):if a=255 then ...

I'd be okay with using forward slashes, but they aren't recognized as valid subdirectory separators on Windows.

Two issues :)

Windows can perfectly fine use forward slashes. I've just tested, and it works as expected.
I can also enter back slashes in the BASIC editor, this could be a key mapping issue.

Buuut:
C64Studio doesn't support including assembly files in BASIC directly. You can include other BASIC code.
If you want to access ASM symbols, you have to do it differently:

  • You need a project/solution for this to work.
  • In Solution Explorer, right click on the BASIC file, Properties
    • In tab "Compile Target" for the assembly file, set a check mark on "Dependency" and "Symbols"

Whenever the BASIC file is now built, C64Studio will make sure the assembly file output is up to date first, and then build the BASIC file. In the BASIC file you can now access the symbols as you already shown up there.

There is a short entry in the help for including assembly in BASIC, I need to update that with more details.

I've added a new feature in the last commit, that might help you somewhat:

With
#BINDATA "STARTERASM.PRG",,2,100,10
inside a BASIC file you can auto-include a binary, which will be inserted as DATA statements.

The syntax is
#BINDATA ,,,,

If length in bytes is empty or zero, the full file is used.
The DATA lines are made as long as manual entry would allow (e.g. 80 characters with BASIC V2)

Hope that helps.

If these comments do not help you, feel free to reopen.