Dolphin, the GameCube and Wii emulator - Forums

Full Version: HawaiianPunch's Code Patches
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
I keep getting "BackPatch - no support for operand size 2" errors when I call LoadFile.ReadBytes(out_buf, LoadFile.GetSize()); LoadFile is an object of File::IOFile and out_buf is type u8*.
However, ReadBytes still returns true even though it displays this error. Why? And how can I fix it?
My current Read function implementation is here, albeit commented out so someone checking out the code doesn't get nasty errors.
http://code.google.com/r/hawaiianpunch1-fileloading/source/browse/Source/Core/DolphinWX/Src/FileLoader.cpp?spec=svnc1caf1b9d779f29bc361409f7e45909ccafac060&name=FileLoader&r=c1caf1b9d779f29bc361409f7e45909ccafac060#48
Are you sure out_buf actually has been allocated with at least LoadFile.GetSize() bytes? If you're trying to write 512 bytes to a 256-byte buffer that's obviously going to cause errors.
(02-04-2012, 10:42 PM)neobrain Wrote: [ -> ]Are you sure out_buf actually has been allocated with at least LoadFile.GetSize() bytes? If you're trying to write 512 bytes to a 256-byte buffer that's obviously going to cause errors.

Thanks, lowering the file size of some of the files that I'm trying to load took away that backpatch error. However, I'm still confused as to why the buffer was not large enough; the files I'm loading are identical to the ones in the ISO.

Also, now I'm getting a compile at 0 error, even with identical files.
Undecided
Just poke around some more, I'm sure you'll figure it out some day Big Grin
Is it possible that the offset that is called refers to a specific point in the files, not just the beginning of it?
In other words, should I seek to a certain part of the file I'm loading before loading it, or is the game expecting the entire file to be loaded into memory?
idk, just look up all references to your read function and check what other file loaders are expected to do.. Tongue
I've made more updates here: http://code.google.com/r/hawaiianpunch1-fileloading/source/detail?name=FileLoader&r=dabef497a3ee238f4d989f3647494f7d5277c6be
Games that used to have a Backpatch error still do, and ones that didn't crash Dolphin entirely now. I'm not sure what is going wrong, because the Read function is returning true then immediately crashing.
Any help would be appreciated.
you are almost always going to be attempting to seek past the end of the file. _Offset is from the beginning of the gcm, not the specific file
Woops, gave the wrong link. Here's a better one: http://code.google.com/r/hawaiianpunch1-fileloading/source/list?name=FileLoader
Yeah, so even though I put the offset as a parameter I didn't use it, I just put 0 into ReadBytes. What I need to know is if that full offset just refers to the beginning of the file, or somewhere specific in the file. I don't know if the game expects a certain portion of the file to be loaded, or all of it.
ah, apparently I missed that you changed it to 0.
check out the function GetFileName here http://code.google.com/p/dolphin-emu/source/browse/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
Pages: 1 2 3 4 5 6 7