AMPS in Sonic 2

By AURORA☆FIELDS

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

CREDITS:

  • 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
Gallery
Download

File Type: rom/mega-drive

File Size: 1.23 MB

Romulo @ 2019-12-04 10:26:08

I don't know very well the functions of all this that you have implemented. But if the drive is also for the songs and effects to be reproduced correctly; It really works, I did some gameplay testing and there were no problems reproducing the effects and music of the game. The small audio errors that occur in the original game and some hacks, especially with the theme of super sonic and other effects, these errors are not found here. well done.

Last modified by Romulo @ 2019-12-04 10:31:24

juangenial452 @ 2019-12-12 10:46:56

Is there a tool to convert a midi to AMPS?