bsnes v0.036 - 模擬器

By Jacob
at 2008-09-15T11:58
at 2008-09-15T11:58
Table of Contents
http://byuu.cinnamonpirate.com/
This release fixes a somewhat serious bug introduced in v035, and also vastly
improves Windows support for non-ANSI filenames.
The bug was triggered when HDMA would occur during DMA. If the DMA were long
enough, subsequent HDMA transfers would be blocked. This caused graphical
glitches in Star Ocean, Super Mario Kart, and possible more games. If you
noticed any regressions from v034 to v035, this was almost certainly the
cause. Once again, we′re operating under the assumption that there are no
known bugs currently, so please let us know here if you find any.
I′ve also rewritten the file handling for the emulator. On Windows,
attempting to load a file with non-ANSI characters (eg Russian, Japanese,
etc) would cause these characters to be removed. This meant that no version
of bsnes thus far could load these files. This problem was exacerbated when I
ported the user interface to Unicode (UTF-16), this caused even config and
locale file loading to crash the emulator.
The root of the problem is that Windows only accepts non-ANSI strings in
UTF-16 format, whereas bsnes′ UI wrapper converts strings to UTF-8
interally. When passing these file names to the standard file functions
(fopen(), std::ifstream, etc), file loading would fail. To fix this, I
replaced all file access functions with a new version that would convert the
UTF-8 filenames back to UTF-16, and use appropriate access functions
(_wfopen(), _wmkdir(), etc.)
... but there is still one limitation to this: ZIP and GZ support use zlib,
and JMA support uses libjma. Neither of these libraries convert UTF-8 strings
to UTF-16 before attempting to open files. Due to licensing issues, as well
as technical issues, I am unable to correct this at this time. What this
means is that loading ZIP, GZ and JMA files; on Windows only; and with
Unicode characters in the file name only; will cause the image load to fail.
Loading uncompressed images (SMC, SFC, etc) will work with or without Unicode
on all platforms.
I tried to be as thorough as possible with this fix: command-line arguments
(via CommandLineToArvW + GetCommandLineW), user path (via SHGetFolderPathW),
real path (via _wfullpath),folder creation (via _wmkdir) and file
access/existence checks (via _wfopen) were updated in all cases. I also
updated file loading for ROMs (SMC, SFC, etc), save RAM (SRM), real-time
clock save (RTC), cheat files (CHT), UPS patches (UPS) and both configuration
files (bsnes.cfg and locale.cfg.) Configuration file loading should work even
if your username contains non-ANSI characters, and it should also detect
config files put in the same folder as the bsnes executable, even if the path
to the executable contains non-ANSI characters.
Still, if you spot any bugs, aside from the ZIP/GZ/JMA loading issue, please
let me know via e-mail at setsunakun0; at hotmail.
Lastly, I′d like to apologize for the poor support for non-ANSI filenames in
the past. Using an English version of Windows didn′t expose the problems to
me. I′ll be more thorough in the future with this.
--
This release fixes a somewhat serious bug introduced in v035, and also vastly
improves Windows support for non-ANSI filenames.
The bug was triggered when HDMA would occur during DMA. If the DMA were long
enough, subsequent HDMA transfers would be blocked. This caused graphical
glitches in Star Ocean, Super Mario Kart, and possible more games. If you
noticed any regressions from v034 to v035, this was almost certainly the
cause. Once again, we′re operating under the assumption that there are no
known bugs currently, so please let us know here if you find any.
I′ve also rewritten the file handling for the emulator. On Windows,
attempting to load a file with non-ANSI characters (eg Russian, Japanese,
etc) would cause these characters to be removed. This meant that no version
of bsnes thus far could load these files. This problem was exacerbated when I
ported the user interface to Unicode (UTF-16), this caused even config and
locale file loading to crash the emulator.
The root of the problem is that Windows only accepts non-ANSI strings in
UTF-16 format, whereas bsnes′ UI wrapper converts strings to UTF-8
interally. When passing these file names to the standard file functions
(fopen(), std::ifstream, etc), file loading would fail. To fix this, I
replaced all file access functions with a new version that would convert the
UTF-8 filenames back to UTF-16, and use appropriate access functions
(_wfopen(), _wmkdir(), etc.)
... but there is still one limitation to this: ZIP and GZ support use zlib,
and JMA support uses libjma. Neither of these libraries convert UTF-8 strings
to UTF-16 before attempting to open files. Due to licensing issues, as well
as technical issues, I am unable to correct this at this time. What this
means is that loading ZIP, GZ and JMA files; on Windows only; and with
Unicode characters in the file name only; will cause the image load to fail.
Loading uncompressed images (SMC, SFC, etc) will work with or without Unicode
on all platforms.
I tried to be as thorough as possible with this fix: command-line arguments
(via CommandLineToArvW + GetCommandLineW), user path (via SHGetFolderPathW),
real path (via _wfullpath),folder creation (via _wmkdir) and file
access/existence checks (via _wfopen) were updated in all cases. I also
updated file loading for ROMs (SMC, SFC, etc), save RAM (SRM), real-time
clock save (RTC), cheat files (CHT), UPS patches (UPS) and both configuration
files (bsnes.cfg and locale.cfg.) Configuration file loading should work even
if your username contains non-ANSI characters, and it should also detect
config files put in the same folder as the bsnes executable, even if the path
to the executable contains non-ANSI characters.
Still, if you spot any bugs, aside from the ZIP/GZ/JMA loading issue, please
let me know via e-mail at setsunakun0; at hotmail.
Lastly, I′d like to apologize for the poor support for non-ANSI filenames in
the past. Using an English version of Windows didn′t expose the problems to
me. I′ll be more thorough in the future with this.
--
Tags:
模擬器
All Comments
Related Posts
SEGA game gear 我想破關阿Q_Q

By Audriana
at 2008-09-15T10:52
at 2008-09-15T10:52
MAME接關問題

By Daniel
at 2008-09-15T09:23
at 2008-09-15T09:23
MAME XML Cheats Collection for MAME …

By Emma
at 2008-09-15T02:20
at 2008-09-15T02:20
有中華棒球隊的遊戲

By Vanessa
at 2008-09-14T23:55
at 2008-09-14T23:55
SEGA game gear 我想破關阿Q_Q

By Tom
at 2008-09-14T22:44
at 2008-09-14T22:44