Fixed incorrect error handling of realloc function to prevent memory leak.
Fixed a few uninitialized local stack variables.
Changed (1 << 31) to (1u << 31) to fix error stating that a signed 32 bit integer shifted by 31 bits can result in undefined behavior.
returning 0 from iNES_Init is not ideal, error is "unsupported mapper" but at least it's an error
also adding CHRmask1/2/4/8 fallback, not sure if needed but looks suspicious for <8k
- new inex 2.0 mapper 406 added without flash support though
- dpcm data log now does proper memory area logging (not worth actually, always be like C000 lol)
I realized that the watch operation need to be decoupled from the RAM Watch list, but things seem get too complicated, hoping this is not get even worse.
changes in accordance to the reverse-engineered mapper schematics:
- changed bank mode 1 mapping CPU $C000-$DFFF from "fixed to last bank" to "B OR 7" to support multiple 128KiB UNROM games in one cart
- latch D.7 bit ignored outside bank mode 2
- fixed latch D.6 bit interpreted as bank number bit
* correcting x64 configurations to actually use x64
defining NOMINMAX to fix std::max error
* more preprocessor definitions for x64
* 64-bit libraries from the last published version of DXSDK with dinput
* should define WIN64 as well? unfortunately seem to require retention of WIN32
* added an x64 build of luaperks.lib, this compiles links and runs now
* relocate win32 luaperks.lib to src/drivers/win/lua/win32 and leave a note explaining it
* luaperks.lib x64 needed to be /MT
two more missing x64 libs
debug x64 configuration was set to compile C++ as C?
* importing the rest of the usable WIN32 preprocessor defines, debugger now functions!
* revert unnecessary VS solution version change
* 64-bit lua working (fixed the 64-bit build of luaperks.lib)
* VSUIENTRY hashes are unsigned, not signed
* more hashes that are actually unsigned
* fix a few pointer to int casts in lua console
* fix a few more pointer truncations in windows dialog stuff
a few printf arguments need a cast to int
* explicit size_t cast to quiet spurious warnings on an inline function
2. As bbbradsmith in Pull Request #62 mentioned, SetWindowLong is replaced by SetWindowLongPtr for 64 bit compatible, I partially changed those written by myself.
2. Fix a bug, when the cheat editing controls lost focus, but editing mode is still there, which makes case EN_UPDATE triggered when user is not typing in them, that's an inappropriate circumstance. It might make the cheat editing control shows nothing when selecting a cheat.
3. Re-arranged some controls in resource file.
4. Changed some directory dialog logic, use defined ID rather than hard-code the actural number.
5. Detail.
2. Add text limit to Memory Watch for experiment.
3. Make the IDs of controls in Memory Watch predefined rather than directly coded, that's not quite standard in programming. Calculations to ID is not always trusted as they are automatically determined by the development tool.
2. Add text limit to Memory Watch for experiment.
3. Make the IDs of controls in Memory Watch predefined rather than directly coded, that's not quite standard in programming. Calculations to ID is not always trusted as they are automatically determined by the development tool.
2. Separated cheat code and game genie in Cheat window.
3. Don't show a game genie code when affected address is under 0x8000.
4. Detail: set font for some edit control, replaced some static global variable.
5. Other details.
By the way, why there're so many useless brackets in some functions?
1. Added a global switch for all cheats, it is checked by default. Check or uncheck it can quickly tweak all cheats enabled or disabled. It's not game specific and effective to all games.
2. Added a checkmark to check behaviour of automatically load cheats.
3. Fixed a wierd bug in loading names of cheats from file.
iNES Header Editor:
4. Disable iNES header editor menu when currently loaded game is not in iNES format.
Others:
5. Some of the checkbox passed parameter MF_CHECKED, the right one is BST_CHECKED, though they have the same value.
6. Code/Data Logger is created by CreateDialog(), but destroyed by EndDialog()? A non-modal window should be destroy by DestroyWindow(), EndDialog() is for DialogBox(). It seems nobody noticed this bug for years.
7. Detail.
Currently there are some opposite tweaks in the config file for the new feature in cheat console, for example the unchcecked state is 1 in config file, that's for backward compatibility.
The iNES header editor might not quite stable as newly baked from the oven, there might be some improvements to its code.
1. Added a global switch for all cheats, it is checked by default. Check or uncheck it can quickly tweak all cheats enabled or disabled. It's not game specific and effective to all games.
2. Added a checkmark to check behaviour of automatically load cheats.
3. Fixed a wierd bug in loading names of cheats from file.
iNES Header Editor:
4. Disable iNES header editor menu when currently loaded game is not in iNES format.
Others:
5. Some of the checkbox passed parameter MF_CHECKED, the right one is BST_CHECKED, though they have the same value.
6. Code/Data Logger is created by CreateDialog(), but destroyed by EndDialog()? A non-modal window should be destroy by DestroyWindow(), EndDialog() is for DialogBox(). It seems nobody noticed this bug for years.
Currently there are some opposite tweaks in the config file for the new feature in cheat console, for example the unchcecked state is 1 in config file, that's for backward compatibility.
The iNES header editor might not quite stable as newly baked from the oven, there might be some improvements to its code.
the debugger was replacing comments and names inside a buffer returned from the old portable disassembly function, which was returning a privately retained 64 byte buffer. previously names were limited to 30 characters, so it's possible expanding names in disassembly never blew that buffer.
testing of the 0d26e6f commit either stressed it harder than ever before, or hard enough to break it for the first time
solved by copying the disassembly buffer into a new buffer for expanding address labels to names, etc
2. After some nightly consideration, I decided to remove some unused resource IDs from resource file, some of them were obseleted, renamed, mistyped or temporary, currently nothing was corrupted...
3. Detail.
2. After some nightly consideration, I decided to remove some unused resource IDs from resource file, some of them were obseleted, renamed, mistyped or temporary, currently nothing was corrupted...
3. Detail.
2. Solved a problem of the add/editing watch dialog when pop up repeatedly from multiple places, because there are 3 places can pop up it now.
3. Fixed a bug when loading cheats from file crashes the emulator.
4. Detail.
2. New cheat list box 0.0.0.3 Alpha, changed the possibilities box to a CListCtrl rather than a simple CListBox, use a map for its buffer. It may not quite efficient currently, but I personally think it's much better than adding and deleting the items repeatedly every frame, and now its item can be selected while emulation is running, although there's not much usage for this...
3. added several context menus to possible list, now you can directly add address to memory watch or ram watch, or go to hex editor from here, currently it's still a single select list.
2. Fixed an ancient bug of cheat dialog that importing new cheats makes old existing cheats uneffective.
3. Restructured some cheat searching type to macros since the meaning of the mysterious number is unclear. Maybe the switch case was more efficient than if else... or not?
4. Use a temporary variable rather than a global one to indicate whether the null file pointer is cased by user clicking the cancel or close button of the open archive dialog or a loading error.
5. When recording a movie with cheats, show warning to the user and asking for disabling them.
6. Removed some seems like unused variables, hope this didn't break compiling crossing platforms.
cheats.cpp int converions warnings fix
change default tool index for vc project. if you have problem with it, feel free to revert. but i can't compile with just "8.1" in there sadly...
There are still many disadvantages, the list is not efficient enough since the separator needs too much calculation, when there are too many separators, the watchlist maybe slow.
I think some of their data can be stored in some map or list for fast accessing in the future development, since they don't requires calc every time.
2. Fix nothing was checked in the View menu when Hex Editor first launch.
3. Fix when Hex Editor is open, disabling all cheats in replay doesn't refresh the freezed addresses.
2. Some mysterious things:
In RAM Search, when the Data size was set to 4 Bytes, the value in the list was changed to 4 bytes but the gap of the items is still 2 bytes. I'm unclear it's an old bug or intentional, since some of the macros are used in comparison, they describe the template of the function as a short even in 4 bytes situation, but that might not compare 4 bytes value correctly.