Bug: Screenshots do not save to proper folder

Found a bug? Please report it, but remember to follow the bug reporting guidelines.
Missing a sane feature? Let us know!
But please do NOT request ports to other systems.

Moderator: ZSNES Mods

rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Bug: Screenshots do not save to proper folder

Post by rlbond »

ZSNES WIP July 10, Win Version

My screenshots (both png and bmp) save to the folder for SAVES instead of SCREENSHOTS. I have saves set to save to .\saves and screenshots to save to .\screens but the images go to .\saves instead.

Using Windows XP Home Edition SP2.
To truly own, you must own at all games.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

I'll have a look, till then, can anyone else replicate?

Also mention with methods you used to save screenshots.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Re: Bug: Screenshots do not save to proper folder

Post by xamenus »

rlbond wrote:I have saves set to save to .\saves and screenshots to save to .\screens
Does the .\screens folder actually exist yet? As far as I can tell, this folder must first exist; ZSNES will not create it automatically. So if the folder doesn't exist, the snapshot will go into the save folder.

It works fine for me.
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

I FIGURED IT OUT!!

Nach, when using relative paths, ZSNES does not change back to its directory before changing directories.

Here's what I did:

I made a folder inside my \saves folder called \screens. Then, I took a screenshot, and VIOLA!! The screenshot appeared in \saves\screens; I.E. it followed the following logic:

1. Load the rom.
2. Change directories to read sram (or zst files, or whatever), basically the DOS command "cd .\saves", changing the directory to c:\emu\snes\saves
(Then I saved a screenshot)
3. WITHOUT changing back to c:\emu\snes, it once again changes directories using something akin to "cd .\screens", so now it is in c:\emu\snes\saves\screens (instead of just \screens). Since i had no saves\screens folder, it just saved the screenshots in the saves folder.

That's why it couldn't be replicated... you needed to have the relative paths set, and not absolute ones.

Hope this helps!
Last edited by rlbond on Wed Jul 13, 2005 6:06 am, edited 4 times in total.
To truly own, you must own at all games.
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Are you absolutely sure you have the correct path configured in the Paths menu? I don't have the problem at all, and I'm using a CVS build near July 10th, and the same OS as you.
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

(see edit above)
To truly own, you must own at all games.
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

Ah, you're right, I was using absolute paths rather than relative. Bug confirmed.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

The question is if it's a bug.
If you specified it in relative terms, perhaps you want it created in current location. Only thing I would need to add is an mkdir() before the chdir().
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

Nach wrote:The question is if it's a bug.
If you specified it in relative terms, perhaps you want it created in current location. Only thing I would need to add is an mkdir() before the chdir().
Well as the user, I assumed that .\saves would be the same as c:\emu\snes\saves and .\screens would be c:\emu\snes\screens, instead of c:\emu\snes\saves\screens. If I wanted that, I would have made the screenshot directory .\saves\screens in the first place, right?
To truly own, you must own at all games.
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

rlbond wrote:VIOLA!!
* Noxious Ninja cringes
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

rlbond wrote:
Nach wrote:The question is if it's a bug.
If you specified it in relative terms, perhaps you want it created in current location. Only thing I would need to add is an mkdir() before the chdir().
Well as the user, I assumed that .\saves would be the same as c:\emu\snes\saves and .\screens would be c:\emu\snes\screens, instead of c:\emu\snes\saves\screens. If I wanted that, I would have made the screenshot directory .\saves\screens in the first place, right?
No, you'd make it c:\emu\snes\saves\screens
As I said, what should be the correct behavior? I'm sure some people want certain things to be saved whereever it is.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

I don't think you are understanding, sorry I'm being confusing.

Here's what I have set for zsnes:

ZSNESW.exe is located in c:\emu\snes

I have the savegame directory set to ".\saves" because I want it to save to c:\emu\snes\saves, which it does.

Likewise, I have the snapshot directory set to ".\screens" because I want it to save to c:\emu\snes\screens, but it doesn't, it tries to save to c:\emu\snes\saves\screens instead, because zsnes has already changed to the .\saves directory and "forgot" to change back.

I hope this isn't as confusing.
To truly own, you must own at all games.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

I understand you perfectly.

I asked if I should make it that c:\emu\snes\saves saves in c:\emu\snes\saves, c:\emu\snes\saves\screens saves in c:\emu\snes\saves\screens, c:\emu\snes\screens saves in c:\emu\snes\screens, and .\saves or \screens should save relative to whereever ZSNES is now and create the directory if needed.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
DOLLS (J) [!]
ZNES Developer
Posts: 215
Joined: Mon Aug 02, 2004 11:22 pm

Post by DOLLS (J) [!] »

rlbond wrote:
Nach wrote:The question is if it's a bug.
If you specified it in relative terms, perhaps you want it created in current location. Only thing I would need to add is an mkdir() before the chdir().
Well as the user, I assumed that .\saves would be the same as c:\emu\snes\saves and .\screens would be c:\emu\snes\screens, instead of c:\emu\snes\saves\screens. If I wanted that, I would have made the screenshot directory .\saves\screens in the first place, right?
I'd expect this too.
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

Nach wrote:The question is if it's a bug.
If you specified it in relative terms, perhaps you want it created in current location. Only thing I would need to add is an mkdir() before the chdir().
I'm not sure if that would fix the problem, because it doesn't seem to actually change to the correct directory if the paths are relative. But you're the programmer, you know more about zsnes than I do, obviously.
Nach wrote:I understand you perfectly.

I asked if I should make it that c:\emu\snes\saves saves in c:\emu\snes\saves, c:\emu\snes\saves\screens saves in c:\emu\snes\saves\screens, c:\emu\snes\screens saves in c:\emu\snes\screens, and .\saves or \screens should save relative to whereever ZSNES is now and create the directory if needed.
yes, that is what needs to happen, although I'm not sure what creating the directory if needed has to do with the bug in the first place -- the directory already existed on my pc.
Last edited by rlbond on Wed Jul 13, 2005 10:46 pm, edited 1 time in total.
To truly own, you must own at all games.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

rlbond wrote:
Nach wrote:I understand you perfectly.

I asked if I should make it that c:\emu\snes\saves saves in c:\emu\snes\saves, c:\emu\snes\saves\screens saves in c:\emu\snes\saves\screens, c:\emu\snes\screens saves in c:\emu\snes\screens, and .\saves or \screens should save relative to whereever ZSNES is now and create the directory if needed.
yes, that is what needs to happen.
Seems you're changing what you want.


What do others want?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Agozer
16-bit Corpse | Nyoron~
Posts: 3534
Joined: Sun Aug 01, 2004 7:14 pm
Location: Nokia Land

Post by Agozer »

Is it so hard to just type the full directory path, or am I missing something relevant here?
whicker: franpa is grammatically correct, and he still gets ripped on?
sweener2001: Grammatically correct this one time? sure. every other time? no. does that give him a right? not really.
Image
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

Nach wrote:
rlbond wrote:
Nach wrote:I understand you perfectly.

I asked if I should make it that c:\emu\snes\saves saves in c:\emu\snes\saves, c:\emu\snes\saves\screens saves in c:\emu\snes\saves\screens, c:\emu\snes\screens saves in c:\emu\snes\screens, and .\saves or \screens should save relative to whereever ZSNES is now and create the directory if needed.
yes, that is what needs to happen.
Seems you're changing what you want.


What do others want?

I'm not changing what I want.

Here's what I want:

When I make the save directory called ".\saves", I want it to put all of my save files in {zsnes folder}\saves.
When I make the screenshot directory called ".\screens", I want it to put all of my screenshot files in {zsnes folder}\screens.

This is, logically, what should happen. But it doesn't.

Instead, the saves directory works (".\saves" puts all the save files in {zsnes folder}\saves) but the screenshot and spc directories do not. Instead, if I put, for example, ".\screens" as the folder to save my screenshots to, it does not save to {zsnes folder}\screens, like it should. After all, .\ means the current directory, and the current directory should be {zsnes folder}, so ".\screens" should be the same as {zsnes folder}\screens.
But, instead, if I put ".\screens" as the directory to save my screenshots, it saves to {zsnes folder}\saves\screens instead of the correct folder, which would be {zsnes folder}\screens. And since this folder wouldn't normally exist, since the user would expect the screenshots to go in the {zsnes folder}\screens folder, they would wind up in {zsnes folder}\saves instead of {zsnes folder}\screens.

Try it -- make your save and snapshots folders relative paths (and in different locations) and take a snapshot. It'll end up in the wrong place.

And I am not changing what I want.
rlbond wrote:ZSNES WIP July 10, Win Version

My screenshots (both png and bmp) save to the folder for SAVES instead of SCREENSHOTS. I have saves set to save to .\saves and screenshots to save to .\screens but the images go to .\saves instead.

Using Windows XP Home Edition SP2.
That's what I said. It's a bug. When using relative paths, the screenshots and spcs do not save to the correct directories. And Agozer, no, it's not so hard to do that, but ZSNES should not have bugs. "Don't use relative paths anymore" shouldn't be a solution to this problem.

Nach, you said yourself:
Nach wrote:
... .\saves or .\screens should save relative to whereever ZSNES is now...
THIS IS WHAT NEEDS TO HAPPEN, But this is not what happens. Try it.
To truly own, you must own at all games.
xamenus
Veteran
Posts: 907
Joined: Fri Jul 30, 2004 12:26 am

Post by xamenus »

rlbond wrote:stuff
Agreed.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

rlbond wrote: Nach, you said yourself:
Nach wrote:
... .\saves or .\screens should save relative to whereever ZSNES is now...
Wherever ZSNES is now in it's stage of execution not where the ZSNES executable is stored.
Since if you wanted it to be in an absolute place, you'd use an absolute directory path, right?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

ZSNES changes the active directory?

Why?
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

creaothceann wrote:ZSNES changes the active directory?

Why?
It's better if you don't ask questions like that.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
creaothceann
Seen it all
Posts: 2302
Joined: Mon Jan 03, 2005 5:04 pm
Location: Germany
Contact:

Post by creaothceann »

I don't have a problem with that, just saying that I don't understand it.
vSNES | Delphi 10 BPLs
bsnes launcher with recent files list
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

creaothceann wrote:I don't have a problem with that, just saying that I don't understand it.
There are two not understandings.

The first is where you don't understand it at all, does not compute.
The second is where you understand it, but you scratch your head wondering why.

ZSNES is a collection of the second. Don't question it, and hope or help the new people work it out.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
rlbond
Hazed
Posts: 82
Joined: Tue Jul 12, 2005 5:13 am

Post by rlbond »

Nach wrote:
rlbond wrote: Nach, you said yourself:
Nach wrote:
... .\saves or .\screens should save relative to whereever ZSNES is now...
Wherever ZSNES is now in it's stage of execution not where the ZSNES executable is stored.
Since if you wanted it to be in an absolute place, you'd use an absolute directory path, right?
Except, this would lead to problems.

For example, let's say, once again, I have .\saves and .\screens set as my directories.

First I save state. That changes the current directory to {zsnes}\saves.
Then I take a screenshot. That changes it to {zsnes}\saves\screens.
Then I save state again. Now it's in {zsnes}\saves\screens\saves!
But if I load zsnes again, it would use my first savestate.

Logically, I think most people who would use relative paths would assume .\path would be relative to the zsnes executable. .\saves is just much easier to type, especially in zsnes where there is no "browse" button and you can't copy and paste from the other fields (remember that I would have to type the full path 11 times with the current gui! What if it was stored in some place like c:\program files\emulation\snes\zsnes? That would drive anyone nuts.

So here is what I propose:

When ZSNES starts, it stores its current (absolute) location to a string. Then, whenever it runs a chdir command, first it changes to this directory in the string, then does an mkdir command, then the chdir command. This would fix the problem. I honestly can't imagine anyone actually wanting their save directories to constantly change. The assumption when using relative paths is that they are RELATIVE to whatever directory you're in AT THE MOMENT. Maybe you could have zsnes convert these into absolute paths once you typed them in instead? That would work too.
To truly own, you must own at all games.
Post Reply