GeorgRottensteiner / C64Studio

C64Studio is a .NET based IDE specializing in game development for the C64 in assembler and BASIC
Other
243 stars 36 forks source link

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

Closed Pinacolada64 closed 11 months ago

Pinacolada64 commented 11 months ago

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 commented 11 months ago

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:

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 commented 11 months ago

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.