I've had the same problem half a year ago, and didn't find a solution:by scognito - Coding
I ported Syobon Action for Wii, sources are a *MESS* but it was fun to (partially) "decrypt" them, have a look at it (http://wiibrew.org/wiki/Syobon_action_wii) I've included original sources. What I did was to replace all the original graphics/input/sounds calls with Wii ones...not difficult but not easy though, becasue it involves some correction to fit on the new platform. The hardest tby scognito - Coding
Just search something like wifi debug or something similiar in this forum, someone did a patch for libogc for debugging via wifi using GDB iirc.by scognito - Coding
I'm not an homebrew expert, but I guess you must link your .dol (wii executable) statically with the libraries you compiled.by scognito - Coding
I don't think the bool patch is the cause of correct behaviour. I decided to stop wasting time on this, even if the idea of using sqlite was very very interesting. Thanks drtwox and others for help and patience, hoping someday this problem will be fixed. Cheers, Scognitoby scognito - Coding
Compiling your code with my configuration (devkitppc-r16, libogc 1.7, libfat20081205) I get the same result (fat corrupted). Also the size of my elf is 3055 KB instead of your 3062. Tried with svn libogc and svn libfat (updated today) and got the same result. Tried with svn libogc and libfat-ogc-20081205 and got the same elf file size when the elf is compiled, but still corrupted filename.by scognito - Coding
I've downloaded devkitppc-r16, libogc 1.7, libfat20081205, and your sqlite wii lib, gettimeofday() removed from my app. Got a code dump. Since I want to run it as separate dol, now I want to compile and run like you did. What else I'm missing? If it is ok can you send me back the sources since I modified them a lot? Thanks!by scognito - Coding
I tried to separate the db creation code and the insert code in 2 separate apps. The first app creates the db ok. The second seems to insert ok but the db is corrupted, as usual. The problem is that the application should insert records in the db for each game a user has, so I can't provide a db with all games released. Still don't understand why with R16 it work.by scognito - Coding
have a look at thisby scognito - Coding
The problem is that gettimeofday is declared in devkitppc directory (also confirmed here: ), but anyway I've updated libogc/libfat to svn and reinstalled devkitpro r17, but had the same error (I've commented the gettimeofday from my db.c and db.h): C:\wiidev\sqlitexample2>make linking ... sqlitexample2.elf c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../pby scognito - Coding
I'm using devkitppc r17 iirc and latest stable one libogc because I had this problem too : What libraries are you using? EDIT: since I had 5 minutes free I did some test: added #elif SQLITE_OS_LIBOGC time_t t; time(&t); *prNow = t/86400.0 + 2440587.5; in sqlite3.c, removed the call of gettimeofday function from my code, re-added int _EXFUN(gettimeofday, (struct tiby scognito - Coding
If you want to create a corrupted file there is my application in the sqlite topic that creates a file that is not even copiable or moved. Doing a chkdsk fix it (but the file data is corrupted) so it could be' used as test case :)by scognito - Coding
It was one of the thing I tried, but didn't had luck :( You could try it on my code and see that it doesn't work (at least for me). I don't really know if this problem can be' solved, I wonder if disabling commit works to you. Are you sure it is a sqlite problem and not a fat one? Thanks for testing anyway.by scognito - Coding
Your help is really appreciated, thanks a lot!by scognito - Coding
Here it is a sample to try, it is a stripped down version of my project. It simply create a db, insert a record, close the db. Pretty easy. But doesn't work. It creates a corrupted file without giving an error. Maybe drtwox can have a look in it, it is just an insert. The curious thing is that if you remove the bind_text 6 and 7, it will work. There is bug somewhere: fat / sqlite / myby scognito - Coding
I'll have a look at it. Did you use prepared statement in your code? Can't find wiimp sources and I'm curious to see some part of the code. You can send it to me at my nick at gmail. Thanks! Edit: the latest fat I tried is libfat 1.0.4 (used also a custom svn one) What do you think about the corruption of the file? Could it be a FAT problem or a SQLite one? I guess it isby scognito - Coding
Dr Twox, I've compiled sqlite 3.6.16 with your patches if you want, as I hoped it was a library issue, but it didn't. Also tried with standard libfat provided with libogc...no luck. I don't know what else to do :(by scognito - Coding
Should be one of the latest (if not the latest), anyway I use that version without any problem in other projects (FAT32). Could it be related in how the sqlite3 is compiled?by scognito - Coding
Here I'm again, with a new problem this time :) After spending *days* in trying to figure out why my code didn't work, I decided to ask a friend to test my dol. The scenario is simple: insert 3 rows in a table, and each row contains about 40 fields. I'm using prepared statement and (tried also without) BEGIN / END transaction. On my card, after 3 insert (no error reported by sqby scognito - Coding
Yeah I don't want a strict memory limit, a soft one is good, I want to have an upperbound of of 100K is ok. I'll test with a lower value to see how "soft" it is. The drawback is that the executable is 500KB bigger, but that's fine, sqlite rocks :)by scognito - Coding
Didn't have much time to testing these days... Anyway last thing I did was read a bit of "Dynamic Memory Allocation In SQLite" and I used the function: sqlite3_status(verb, ¤t, &highwater, resetflag); (http://www.sqlite.org/c3ref/status.html) where verb is SQLITE_STATUS_MEMORY_USED, and reset flag is 1. I noticed that each query increase the value of "current", but executingby scognito - Coding
Using valgrind on the text I get: ==2987== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 11 from 1) ==2987== malloc/free: in use at exit: 0 bytes in 0 blocks. ==2987== malloc/free: 1,387 allocs, 1,387 frees, 64,390 bytes allocated. ==2987== For counts of detected errors, rerun with: -v ==2987== All heap blocks were freed -- no leaks are possible. Seems I don't have memory leby scognito - Coding
Ah ok now I understand, thanks. Do you know anyway if you think it's normal I get the memory leak (almost) each time I execute a query? I posted the code on pastebin. Thanks!by scognito - Coding
Quotedaniel_c_w I do not see why sqlite3_free(zErrMsg) fails, but free(zErrMsg) can't work. I don't know why them crashes...anyway why the free can't work? Just curious.by scognito - Coding
The leak seems still there, so or I'm doing something *really* lame, or the is something else I didn't catch about sqlite. Test is run on linux, and the code is available here: I used both frees for the zErrMsg but the result is the same (no crash, but memory leak still there) This is the result DB OPENED OK RZDP01 PAL The Legend Of Zelda: Twilight Princess all: 1188 KB used:by scognito - Coding
I just get a code dump, anyway I'm trying on linux to see if I get this memory leak and if the free works. I'll post results soon, thanks.by scognito - Coding
Thanks DrTwox, but the problem is that it crashes if I use one of the free above... Probably there is something that doesn't work correctly on the free in sqlcode? Offtopic As for the project, probably no one will help me after I say the project I'm working on, but who cares, I'm coding that only for the fun of that. It's one of the 1000 usb loaders, but I use that for learby scognito - Coding
Ok, everything works, but seems I'm having a bit of memory trashing. This is what I use: void getNameFromId(char* id, char* title){ char q[300]; sprintf(q, "select id, version, region, \ from table \ where id = '%s'", id); execQuery(q, db); } void execQuery(char* command, sqlite3* db) { char *zErrMsg = 0; int rc = sqlite3by scognito - Coding
( EDITED, don't forget to look at the end of the post ) Thanks! At least now I made a step further! (I was trying to sleep when I read the response on the phone and powered on the wii again!) I'm using the precompiled one, (the one I compiled used your makefile, but didn't had a look inside it :)) Didn't noticed that I pasted half db.c, here it is the complete one:by scognito - Coding