Poobah said:
Might I ask how you learnt all this complicated Unicode stuff? I would like to learn it myself.
Same as anyone else, I just dove into it headfirst. I can get you started, if you want.
First thing to know is that Unicode programming is different in POSIX and in Windows. Windows switched to internal 16-bit Unicode representation back with NT. POSIX decided that compatibility was more important, and switched to UTF-8 internally. It's complicated, but what it boils down to is that characters in Windows internally take up 2 bytes each, and characters in POSIX can take 1, 2, or 3 bytes each, depending on encodings. POSIX UTF-8 is ASCII backwards compatible, so you can still use char * for strings. The Windows representation is NOT backwards compatible, so you have to specify when you compile your program whether you want to use Unicode or MBCS (Multibyte Character Set, MS's internal representation prior to using Unicode). You also have to remember that a character is not necessarily one byte.
Since the size of a character can change between compile versions, instead of using char or wchar_t (the two-byte representation), use TCHAR. When you set a flag in the compiler, it defines _UNICODE and TCHAR gets replaced with wchar_t.
What this means in practice is that you can't tell the length in characters of a string by doing strlen(szFoo). Windows gets around it by having a compile-time macro for most of the string functions, like strchr, strcpy, etc. In this case, you'd use _tcslen(szFoo) (and make szFoo of type TCHAR * not char *). Also, instead of using string literals like "Hello World!" you have to use a macro expansion. The wchar_t representation of "Hello World!" is L"Hello World!" and the TCHAR macro is _T("Hello World!") .
Interestingly, if you compile with Unicode support instead of MBCS support, your code will run faster under NT/2000/XP because native NT kernel has to translate most strings to Unicode. The ASCII versions of functions like RegQueryValueEx are simply wrappers for the Unicode versions. For apps that use a lot of text the speed boost is noticeable.
Anyway, if you're really serious about it, read a couple articles about it. Here's a good place to start:
http://www.jorendorff.com/articles/unicode/windows.html
http://www.i18nguy.com/unicode/c-unicode.html
Legend said:
It doesn't rumble in Mupen or 1964 or PJ64. Which means the emulators aren't doing their job I guess, all 3!!! That sucks. Should I bother to report that? I was hoping it would be something quick and easy, but, oh well. Thanks for trying. :sombrero:
If you're absolutely sure the
original cart rumbles, go ahead and report it. Tell them places it should rumble, preferably easy to test (i.e. it should rumble when I get hit by my own bazooka shot). Make sure you tell them which version (US or European; one has 3 languages and the other has 6). Most likely it's using some undocumented (read screwed up) way of accessing the PIF ram.
Poobah said:
Here's a list of errors and/or warnings produced when trying to build the latest sources with GCC. Most of them are trivial:
Code:
:: === NRage, Release|Win32 ===
:: warning: command line option "-std=c99" is valid for C/ObjC but not for C++
:: warning: command line option "-std=c99" is valid for C/ObjC but not for C++
DirectInput.cpp:246: warning: statement has no effect
DirectInput.cpp:252: warning: statement has no effect
DirectInput.cpp:505: warning: comparison is always false due to limited range of data type
DirectInput.cpp:630: error: name lookup of `i' changed for new ISO `for' scoping
DirectInput.cpp:624: error: using obsolete binding at `i'
DirectInput.cpp:775: warning: left-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:775: warning: right-hand operand of comma has no effect
DirectInput.cpp:827: warning: statement has no effect
DirectInput.cpp:841: warning: statement has no effect
DirectInput.cpp:845: warning: statement has no effect
DirectInput.cpp:1052: warning: left-hand operand of comma has no effect
DirectInput.cpp:1052: warning: right-hand operand of comma has no effect
DirectInput.cpp:1060: warning: left-hand operand of comma has no effect
DirectInput.cpp:1060: warning: right-hand operand of comma has no effect
DirectInput.cpp:1065: warning: left-hand operand of comma has no effect
DirectInput.cpp:1065: warning: right-hand operand of comma has no effect
FileAccess.cpp:451: error: cannot convert `TCHAR*' to `wchar_t*' for argument `1' to `size_t mbstowcs(wchar_t*, const char*, size_t)'
FileAccess.cpp:466: error: cannot convert `TCHAR*' to `wchar_t*' for argument `1' to `size_t mbstowcs(wchar_t*, const char*, size_t)'
FileAccess.cpp:474: error: cannot convert `TCHAR*' to `wchar_t*' for argument `1' to `size_t mbstowcs(wchar_t*, const char*, size_t)'
FileAccess.cpp:482: error: cannot convert `TCHAR*' to `wchar_t*' for argument `1' to `size_t mbstowcs(wchar_t*, const char*, size_t)'
FileAccess.cpp:490: error: cannot convert `TCHAR*' to `wchar_t*' for argument `1' to `size_t mbstowcs(wchar_t*, const char*, size_t)'
FileAccess.cpp:747: error: cannot convert `TCHAR*' to `const wchar_t*' for argument `2' to `size_t wcstombs(char*, const wchar_t*, size_t)'
FileAccess.cpp:794: error: cannot convert `TCHAR*' to `const wchar_t*' for argument `2' to `size_t wcstombs(char*, const wchar_t*, size_t)'
FileAccess.cpp:803: error: cannot convert `const TCHAR*' to `const wchar_t*' for argument `2' to `size_t wcstombs(char*, const wchar_t*, size_t)'
FileAccess.cpp:807: error: cannot convert `const TCHAR*' to `const wchar_t*' for argument `2' to `size_t wcstombs(char*, const wchar_t*, size_t)'
FileAccess.cpp:811: error: cannot convert `const TCHAR*' to `const wchar_t*' for argument `2' to `size_t wcstombs(char*, const wchar_t*, size_t)'
FileAccess.cpp:832: error: cannot convert `TCHAR*' to `const wchar_t*' for argument `2' to `size_t wcstombs(char*, const wchar_t*, size_t)'
According to
this page, wchar.h and wctype.h have "library issues". If this is what's causing the errors, then I guess you might aswell not worry about it.
When you compile, define UNICODE and _UNICODE via switches. TCHAR should be defined as wchar_t by one or more of the header files. The code itself is c even though it has cpp extension; force compile as C and see if that works.
If you get it to compile and run, please send me the MAKEFILE and I'll include it in the source. It's OK if it has lots of warnings with /Wall, as long as it compiles.
OK, sorry about the post mania, guys. I was out for the weekend.
Language DLL files all updated. You guys all got the links to the .rc files, right? Those are in sync with the version I have.
I'm going to ask you to translate two more things:
1. the text "Show Messages" used on a checkbox; it will toggle whether or not the Shortcut popup window messages appear or not (for example, when you hit Tab it says "Mouse Locked"). I made it a toggle option because it screws up the Glide64 plugin if a window appears over the rendered display.
2. Please check the message for IDS_DLG_TPAK_READONLY. Original: "SRAM opened with read-only access.\nAfter exiting the game, the SRAM will NOT be saved." This message didn't appear before. I copied and changed the text from IDS_DLG_MEM_READONLY so it should be pretty close.
If you're editing and compiling yourself, you will need the new resource.h file from the Language SDK.
FOR THE REST OF YOU FOLKS OUT THERE...
I've put in a checkbox for turning off the message windows. Also, I ported over the mempak code to the transfer pak. So now, it will save to disk when it writes to SRAM... but beware, the RTC data doesn't update until you actually close the TPak. Could this be exploited? Yeah, probably. ALSO, I'm using mappings for the GBROM as well, which has the added benefit of only using up as much memory as the ROM file is big. Before, the plugin allocated 8MB to store the GBROM, even if you were loading up a smaller ROM. This way should be much faster, and also swap file friendly for those of you with less RAM. Assuming I didn't break it, of course. Which right now, running on little sleep, it's likely I did break something.
I'm gonna go hunt for this mystical magical Stadium game and a coupla GBROMs to make sure it works. Meanwhile, if you're feeling brave, go ahead and d/l the latest.
Harlay said:
Thanks. Fixed.