• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Site › Dolphin Patches (Archive) v
« Previous 1 2 3 4 5 ... 7 Next »

HawaiianPunch's Code Patches
View New Posts | View Today's Posts

Pages (7): « Previous 1 ... 3 4 5 6 7 Next »
Jump to page 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
HawaiianPunch's Code Patches
01-26-2012, 07:29 AM
#41
HawaiianPunch Offline
Posting Freak
*****
Posts: 878
Threads: 2
Joined: Apr 2011
Probably, if that's what the normal file loaders do.
Main Laptop:
Dell XPS 17
i7 2720QM @ 2.2GHz
8GB DDR3 RAM
Nvidia GeForce GT 555M
Windows 7 64-bit
[Image: salsa.gif?noCache=1324617601]
Find
01-26-2012, 09:50 PM
#42
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
http://code.google.com/p/dolphin-emu/source/browse/Source/Core/Common/Src/FileUtil.h#152 is what you need, then.
My blog
Me on Twitter
My wishlist on Amazon.de
Find
01-27-2012, 11:32 AM
#43
HawaiianPunch Offline
Posting Freak
*****
Posts: 878
Threads: 2
Joined: Apr 2011
In GCVolume.cpp, is "u8* _pBuffer" a pointer to the desired output?
Main Laptop:
Dell XPS 17
i7 2720QM @ 2.2GHz
8GB DDR3 RAM
Nvidia GeForce GT 555M
Windows 7 64-bit
[Image: salsa.gif?noCache=1324617601]
Find
01-27-2012, 06:47 PM
#44
neobrain Offline
"Wow, I made my code 1000x faster! That means I can make it 2048x slower now!"
**********
Developers (Some Administrators and Super Moderators)
Posts: 3,208
Threads: 50
Joined: Jun 2009
Erm... idk, I have no idea what you want to do with the data that you've read, so it'd probably be a better idea to allocate your own buffer and do some stuff with it :/ (don't forget to free the buffer later again).
My blog
Me on Twitter
My wishlist on Amazon.de
Find
01-28-2012, 06:10 AM (This post was last modified: 01-28-2012, 01:52 PM by HawaiianPunch.)
#45
HawaiianPunch Offline
Posting Freak
*****
Posts: 878
Threads: 2
Joined: Apr 2011
(01-27-2012, 06:47 PM)neobrain Wrote: Erm... idk, I have no idea what you want to do with the data that you've read, so it'd probably be a better idea to allocate your own buffer and do some stuff with it :/ (don't forget to free the buffer later again).

Well, the same thing the other readers do. Just the source of the file will be in User/Load/Files/<game_id> instead of the ISO. The final copy location should be the same.
Main Laptop:
Dell XPS 17
i7 2720QM @ 2.2GHz
8GB DDR3 RAM
Nvidia GeForce GT 555M
Windows 7 64-bit
[Image: salsa.gif?noCache=1324617601]
Find
01-30-2012, 07:29 AM
#46
HawaiianPunch Offline
Posting Freak
*****
Posts: 878
Threads: 2
Joined: Apr 2011
Why doesn't this read function work? It always returns false because pFile is always null, even when the file is there. Why?
Code:
bool FileLoader::Read(std::string Filename, u8* out_buf)
{
    if(!SConfig::GetInstance().m_LocalCoreStartupParameter.bLoadFiles)
        return false;
    size_t found=Filename.find_last_of("/");
    std::string RealFilename=Filename.substr(found+1);
    if(!IsFilePresent(RealFilename))
    {
        return false;
    }
    FILE* pFile;
    pFile = fopen(RealFilename.c_str(),"rb");
    if(!pFile)
    {
        return false;
    }
    fread(out_buf,1,1000000000,pFile);
    return true;
}
Main Laptop:
Dell XPS 17
i7 2720QM @ 2.2GHz
8GB DDR3 RAM
Nvidia GeForce GT 555M
Windows 7 64-bit
[Image: salsa.gif?noCache=1324617601]
Find
01-30-2012, 07:40 AM
#47
scummos Offline
Level 27 Forum Troll of Trog
****
Posts: 252
Threads: 2
Joined: Nov 2011
Doesn't wx have its own methods of reading files? Just wondering why you don't use those...
http://wiki.wxwidgets.org/Reading_text_from_a_file
Find
01-30-2012, 08:11 AM (This post was last modified: 01-30-2012, 08:12 AM by Shonumi.)
#48
Shonumi Offline
Linux User/Tester
**********
Administrators
Posts: 6,506
Threads: 55
Joined: Dec 2011
(01-30-2012, 07:29 AM)HawaiianPunch Wrote: Why doesn't this read function work? It always returns false because pFile is always null, even when the file is there. Why?

You sure the function is returning false because pFile is always NULL? Did you check to see if the two other if statements aren't the ones returning false? If those statements are fine, it could just be that fopen can't open the file even if it exists (e.g. permission problems, file in use by another program, etc). Also, be sure to verity the value of RealFilename.c_str() with your own eyes by printing it out.
Website Find
01-30-2012, 08:15 AM
#49
HawaiianPunch Offline
Posting Freak
*****
Posts: 878
Threads: 2
Joined: Apr 2011
(01-30-2012, 08:11 AM)Shonumi Wrote:
(01-30-2012, 07:29 AM)HawaiianPunch Wrote: Why doesn't this read function work? It always returns false because pFile is always null, even when the file is there. Why?

You sure the function is returning false because pFile is always NULL? Did you check to see if the two other if statements aren't the ones returning false? If those statements are fine, it could just be that fopen can't open the file even if it exists. Also, be sure to verity the value of RealFilename.c_str() with your own eyes by printing it out.

Yep. I had some panic alerts before I pasted this in and they were triggering, so I know it was null.
Also, I printed RealFile.c_str() and it printed the correct file.
Am I using fopen correctly? Should I use "rb" or just "r"?
Main Laptop:
Dell XPS 17
i7 2720QM @ 2.2GHz
8GB DDR3 RAM
Nvidia GeForce GT 555M
Windows 7 64-bit
[Image: salsa.gif?noCache=1324617601]
Find
01-30-2012, 08:26 AM
#50
LPFaint99 Offline
Developer
**********
Developers (Some Administrators and Super Moderators)
Posts: 531
Threads: 4
Joined: Mar 2009
(01-30-2012, 07:40 AM)scummos Wrote: Doesn't wx have its own methods of reading files? Just wondering why you don't use those...
http://wiki.wxwidgets.org/Reading_text_from_a_file
wx functions are not used in Core

i havent looked at the rest of your code, but IsFilePresent checks a specific directory right? and realfilename doesnt include that directory.
fopen will use the cwd (which shouldn't be changed from the directory that dolphin.exe is located in) which doesnt have the file
use a relative path from the dolphin root dir IE "./User/foo/bar.baz" instead of what i suspect reafilename is "foo.bar"

also use these functions for fileio
(01-26-2012, 09:50 PM)neobrain Wrote: http://code.google.com/p/dolphin-emu/source/browse/Source/Core/Common/Src/FileUtil.h#152 is what you need, then.

Find
« Next Oldest | Next Newest »
Pages (7): « Previous 1 ... 3 4 5 6 7 Next »
Jump to page 


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode