It is currently Mon Jul 16, 2018 9:51 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Thu Jan 11, 2018 5:41 pm 
Offline
User avatar

Joined: Wed Sep 21, 2016 12:08 pm
Posts: 83
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"


Top
 Profile  
 
PostPosted: Thu Jan 11, 2018 6:12 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:52 pm
Posts: 376
Location: UT
Try removing the first slash, e.g. "TILE/TITLE.chr"


Top
 Profile  
 
PostPosted: Fri Jan 12, 2018 10:47 am 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
Do what loopy said (he made asm6!! Thank you so much loopy!! :D ) 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 :mrgreen: :))

Also, my sister created our "nametable" files with .db statements so we must use .incsrc for those. :)


Top
 Profile  
 
PostPosted: Fri Jan 12, 2018 1:54 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2140
Location: DIGDUG
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.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Mon Jan 15, 2018 7:36 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 977
Location: Sweden
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.


Top
 Profile  
 
PostPosted: Mon Jan 15, 2018 11:21 am 
Offline
User avatar

Joined: Thu Apr 23, 2009 11:21 pm
Posts: 898
Location: cypress, texas
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. :mrgreen: :) However, I forgot that and just checked my code and found a bunch of "\"s and made a mistake. :oops: :(


Top
 Profile  
 
PostPosted: Tue Jan 16, 2018 9:35 am 
Offline
User avatar

Joined: Wed Sep 21, 2016 12:08 pm
Posts: 83
Removing the first slash fixed the problem, thanks.


Top
 Profile  
 
PostPosted: Tue Jan 16, 2018 9:29 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 977
Location: Sweden
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. :mrgreen: :) However, I forgot that and just checked my code and found a bunch of "\"s and made a mistake. :oops: :(
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.


Top
 Profile  
 
PostPosted: Tue Jan 16, 2018 10:25 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 4055
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.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Tue Jan 16, 2018 11:10 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10583
Location: Rio de Janeiro - Brazil
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group