AMPS in Sonic 2 is, pretty simply what it says in the tin, Sonic the Hedgehog 2 with an AS port of AMPS added. Additionally, there are some engine optimizations to make gameplay smooth. These are meant to showcase, that with a few fairly simple optimizations, the overhead caused by a 68k sound driver can be completely negated, and a lot more.
For those that do not know, AMPS is a 68k sound driver, based on SMPS, that I developed for anyone to use for their Sonic hacks or Mega Drive software. AMPS brings many new features compared to SMPS, such as full Dual PCM FlexEd support, highly efficient (both cpu and memory) codebase, wider support for common SMPS coordination flags, custom flags that allow the programmer to have a greater control over the driver and hardware, a well-documented source code, and even more!
This hack also applies the following optimizations:
- Objects use a pointer to object code, as opposed to an id.
- Priority is now the direct address for the desired priority layer
- Respawn index is the direct address for respawn data
- S3K ring manager.
- ObjectMove and ObjectFall use more optimized code.
- Calcsine uses more optimized code.
These optimizations alone are enough to counteract the 1-3% cpu penalty for using AMPS (for a typical frame) a few times over. I've done more optimizations than necessary to show just how many cycles are wasted by inefficient code. For example, for Achi in 2016, I optimized the game as much as I could at the time. I measured that, despite the pretty inefficient way many objects were still handled in Sonic 1, I was still able to make the hack almost completely lag-free. You all know how laggy Sonic 1 can be, even in GHZ. This is all to show, that unlike what most people claim, 68k drivers aren't really all that bad. Sometimes they may cause occasional lag frames caused by the tracker, but its barely noticeable.
I will be releasing the source code for AMPS in Sonic 2 (without the extras added for the Expo entry, of course) after the contest week is over. I will post about it in the AMPS thread, but I am dropping the link here as well (it will become after after the contest): https://github.com/NatsumiFox/AMPS-Sonic-2
- Natsumi - AMPS, AMPS AS port, Sonic 2 port
- Clownacy - s2p2bin with kosinski compression
- MarkeyJester - Testing, reporting bugs, additional graphics.
- FoxConED - Custom theme, testing, reporting bugs.
- GENATAR_I - Custom theme.
- MainMemory, Novedicus, G4, Nat The Porcupine - Testing the port, reporting bugs