I want to better organize my game assets so I placed them into directories. However, I cant seem to get ASM6 to access the files. Any advice?
Here is what I was hoping ASM6 would let me do...
Code:
DAT.TITLE.Background.Tiles:
incbin "/TILE/TITLE.chr"
DAT.TITLE.Background.Nametable:
incbin "/TILE/TITLE.nam"
DAT.TITLE.Background.Palette:
incbin "/TILE/TITLE.pal"
DAT.TITLE.Sprites.Palette:
incbin "/TILE/TITLE_SPRITES.pal"
DAT.TITLE.Sprites.Tiles:
incbin "/TILE/TITLE_SPRITES.chr"
DAT.CUTSCENE1.Background.Tiles:
incbin "/CUTSCENE1/CUTSCENE1.chr"
DAT.CUTSCENE1.Background.Nametable:
incbin "/CUTSCENE1/CUTSCENE1.nam"
DAT.CUTSCENE1.Background.Palette:
incbin "/CUTSCENE1/CUTSCENE1.pal"
DAT.CUTSCENE1.Sprites.Palette:
incbin "/CUTSCENE1/CUTSCENE1_SPRITES.pal"
DAT.CUTSCENE1.Sprites.Tiles:
incbin "/CUTSCENE1/CUTSCENE1_SPRITES.chr"
DAT.Scroll.Tiles:
incbin "/CUTSCENE1/TILES_Scroll.chr"
DAT.Font.Tiles:
incbin "/FONTS/Font.chr"
Try removing the first slash, e.g. "TILE/TITLE.chr"
Do what loopy said (he made asm6!! Thank you so much loopy!!
) and reverse your slashes. Webpage urls use "/"; but, directory paths use "\", at least in Windows OS, what we use.
(was blessed to figure this out after opening command prompt
)
Also, my sister created our "nametable" files with
.db statements so we must use
.incsrc for those.
To quote wikipedia...
"Contrary to popular belief, the Windows system API accepts slash, and thus all the above Unix examples should work. But many applications on Windows interpret a slash for other purposes or treat it as an invalid character, and thus require you to enter backslash — notably the cmd.exe shell"
That being said, I think I use forward slashes even on Windows, except in the command line.
I also use normal slashes wherever I can as backslash is a pain to enter (AltGr). I'm pretty sure I use slash in ASM6 include statements without problems.
Lucradan, sorry, like dougeff and Pokun said, normal slashes
/ do work just fine in ASM6. But, after being blessed with discovering that Command Prompt uses backslashes
\ and changing all of the normal slashes, for directory paths, to backslashes in our game, its random spastic color flickering (normal/bright/normal) was reduced greatly.
However, I forgot that and just checked my code and found a bunch of "\"s and made a mistake.
Removing the first slash fixed the problem, thanks.
Good to hear.
unregistered wrote:
after being blessed with discovering that Command Prompt uses backslashes
\ and changing all of the normal slashes, for directory paths, to backslashes in our game, its random spastic color flickering (normal/bright/normal) was reduced greatly.
However, I forgot that and just checked my code and found a bunch of "\"s and made a mistake.
The Unix world uses normal slashes in directory paths while AFAIK only DOS/Windows are using backslashes (slash was already used for options to commands instead of a dash like in Unix). Modern programs may accept both though as someone already mentioned, but the command prompt probably don't.
I highly doubt what type of slash you used has anything to do with any glitches in your game unless there's some serious bug in asm6.
The first slash indicates a rooted path.
So let's say your project directory was C:\development\myproject\source, and you included /data/something.h. The first slash turns the path back to C:\, then it looks in C:\data, which fails.
You can also put a dot before the slash, that will also fix the path.
Forward vs Backslash isn't an issue here, Windows accepts both as long as you aren't at the cmd prompt.
Yeah, the problem is that a path starting with a slash or backslash is relative to the root, in this case, the root of the drive where your project is. If you start the path with a folder's name, then that's relative to the current path.
A single dot means "the current path", which's why it could also have fixed your problem (e.g. incbin "./TILE/TITLE.chr"). If you use two dots, that means "the parent path", which you can use to reference folders that come before the one you're in. For example, if you're currently in "c:\my-name\projects\platformer" you can use "..\..\asm6\asm6.exe" to call "c:\my-name\asm6\asm6.exe", but without using an absolute path, meaning you can even move "my-name" and everything it contains to some other folder/drive and the references will keep working.