Bugfixes and optimizations for MSX's Salamander (c) 2009 FRS (sd_snatcher@yahoo.com) *************************************************************************** *** You must read the license and agree with it before running, copying *** *** or distributing this patches. If you don't agree with the terms and *** *** conditions, you must delete all its files. *** *************************************************************************** This package contains two bugfixes for the MSX version of Salamander: 1) Dynamic-Vsync + speed optimizations patch Salamander is one of the most (if not the most) CPU-demanding games of Konami for the MSX computer. As a result, when the game is run on a standard 3.57MHz machine, the it crawls like a snail. Its much slower than the MSX's Gradius-1, and when compared to the arcade version of Salamander, the game seems to be on slow-motion. This happens because at 3.5MHz the game drops frames. A lot. Constantly. More than oneframe drop per rendered frame. Worse than that on crowded screens. But the main problem is, as it happens with many Konami megarom games for MSX, there's a bug on the timing routine that causes the game to run at twice the target speed if the CPU can handle that. The Konami's timing routine is based on static-vsync, so the vertical sincronization is aways enabled for their games. Any recent PC gamer knows that vsync takes lot of CPU time, resulting in a lower frames per second rate. Which wasn't known until now was how this could affect a slow CPU like the Z80. And it turned out that the Z80 did had a lot of power being wasted by that routine. This patch replaces the bugged-static-vsync-interrupt-handler from Konami by a new one, featuring dynamic vsync. This is a new method used by modern gaming consoles (like Xbox-360) and 3D graphic cards that enables and disables the vsync on the fly, according to the CPU usage. If the CPU is falling behind the target fps, the vsync gets disabled. Once a less cpu intense area of the game is reached and the CPU usage goes down, the vsync is enabled again. With the original static-vsync, even if bugfixed, Salamander's CPU requirements were very high, even after applying the patch. A 7MHz Z80 wasn't enough and will dropped frames at a fairly high rate The game required at least a 15MHz Z80 to run at full speed most of the time. The dynamic vsync is able to unleash so much CPU power that even the standard 3.57MHz Z80 will run the game 50% faster! This means it will now run the game at about 70% or the desired framerate, from the ridiculous 47% it originally reached. Being a brand new timming routine, this dynamic-vsync patch will also allow you to run the game on any MSX with the turbo enabled, to get the game at the correct speed all the time. And now even a 5.37MHz Z80 is enough to run the game at full speed most of the time. Some speed optimizations were also made on some routines, resulting in a even better framerate for 3.57MHz machines. It will also automatically enable the turbo on the following Panasonic machines, because those don't have an external switch to enable the turbo while running the game. It was also included to allow people not used to the MSX standard to get the benefits of the patch by just selecting "Turbo-R" on their MSX emulators. - Turbo-Rs - FS-A1ST - FS-A1GT - MSX2+ - FS-A1WSX - FS-A1WX - FS-A1FX As a bonus, this patch will also adjust the palette to CoolColors on a MSX2 or higher. CoolColors is an improved palette specially designed by me to enhance the visual of MSX1 games on a V99x8 VDP. If you ever compared any MSX1 game running on both an MSX1 and on a MSX2 (or higher), probably you have noticed that colors are all wrong. This happens because the MSX BIOS set the palette to values that try to ballance everyday use with backwards compatibility. The result was good for using the MSX-DOS and terminal programs, but very poor for running MSX1 games. Back in the 90s I developed CoolColors to solve that. It took about two years of extensive testing and improving to get the final result, published in 1997 and used by many MSX programmers since then. 2) Fix for the Ripple laser bug The ripple is a laser and on the arcade version of Salamander it did behave like that. On any Gradius, lasers will only be stopped by walls and big enemies, but never by the small flying enemies. But on the MSX version there was a bug on the routine that deal with the many types of guns of the game. It clearly included an "last minute quick-and-dirty modification" probably included in a rush to release the game. But this mod had an unfortunate colateral effect: The ripple laser was being treated the same way as non-laser guns, turning the weapon almost useless. This patch will fix the routine, so the ripple laser will now behave correctly as a laser. 3) Invincible patch This one is not a bugfix, but rather a trainer. It will turn your ship undestructible, even against walls. The credits for this one goes to Adriano. I used the patch mainly for debugging purposes and included it here as a bonus. For licensing and distributing conditions on this specific patch, you must contact Adriano at http://www.alsoftware.com.br This archive is composed of the following files: READ-ME.TXT : This file; LEIA-ME.TXT : Readme file in Portuguese; Salamander_DynamicVsync_CoolColors.ips: Turbo-Fix and CoolColors patch in IPS format. IPS patches are normally used on PC/Mac computers; Salamander_RippleFix.ips : Fix for the Ripple laser bug in IPS format; Salamander_Invincible.ips : Invincible trainer in IPS format. salamand.xpc : All the patches above in XPC format. This is the format used by EXECROM, a tool by Adriano for running ROMs on a real MSX using a MegaRAM. If your emulator supports patching ROMs on-the-fly, you should prefer it and preserve your original ROMs. Otherwise apply the patch using your preferred tool. All patches were tested and work well with both the original Salamander 128KB ROM and with the modified "SalaNem2" 256KB version (the complete version that includes the Nemesis-2/Gradius-2 internally. The Nemesis-2 is a requirement to finish the game, either internally or connected to another slot ) The patches ares also compatible with both GameMaster 1 and 2. This patch was developed using the original ROM dump, which has the following checksums: SHA1(SALAMAND.ROM)= 0d459788b6c464b50cbc2436e67a2cef248e0c4a MD5(SALAMAND.ROM)= ec869b375d7517a7ba6161b10f5dee06 Also the "SalaNem2" (Salamander+Nemesis2) tested was: SHA1(SALANEM2.ROM)= a676173780dc3ef4523ff3123fdf179279d22932 MD5(SALANEM2.ROM)= 4ea86c034313f9b1299df9d6d4da30f7 Special Thanks to: - openMSX team, for their excellent emulator and openMSX Debugger; - Adriano Rodrigues Camargo da Cunha, for xpctools. =========================================================================== License Terms of use --------------------------------------------------------------------------- 1) This patches are free (gratis) for non-commercial purposes. You can only run, make backup copies or distribute the patches under this strict condition. 2) You are only allowed distribute the patch files (online or on a removable media) under the following conditions: 2.1) No commercial transaction of any kind is involved 2.2) All readme files (in English and Portuguese) are distributed together with the patches, inside the same compressed file. 3) If you want to use this patches for commercial purposes you MUST contact me first to negotiate the terms and conditions. Use the e-mail supplied at the beginning of this document for contacting me.