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

Cannot type "\" in a BASIC #include directive #93

Closed
Pinacolada64 opened this issue Aug 15, 2023 · 2 comments
Closed

Cannot type "\" in a BASIC #include directive #93

Pinacolada64 opened this issue Aug 15, 2023 · 2 comments

Comments

@Pinacolada64
Copy link

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.

@GeorgRottensteiner
Copy link
Owner

GeorgRottensteiner commented Aug 15, 2023

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.

@GeorgRottensteiner
Copy link
Owner

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.

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