Coder Social home page Coder Social logo

clownacy / sonic-2-clone-driver-v2 Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 2.0 4.02 MB

Enhanced SMPS 68k Type 1b sound driver, featuring a two-channel DAC driver.

Assembly 99.95% Makefile 0.01% C 0.05%
68000 romhacking sega-genesis sega-mega-drive sequencer smps sn76489 sonic-the-hedgehog sound-engine ym2612 z80

sonic-2-clone-driver-v2's Introduction

Clownacy's Sonic 2 Clone Driver v2 (v2.8.0.1)

This is a heavily-modified version of Sonic 1's SMPS sound driver (which itself is a modified SMPS 68k Type 1b). It is designed to maximise compatibility with music from Sonic 2, Sonic 3 & Knuckles, and Chaotix.

You can find more information at the GitHub repository's wiki: https://github.com/Clownacy/Sonic-2-Clone-Driver-v2/wiki

This driver is designed for use with 'The Macroassembler AS', found here: http://john.ccac.rwth-aachen.de:8000/as/

More information at: https://forums.sonicretro.org/index.php?showtopic=32801 https://sonicresearch.org/community/index.php?threads/sonic-2-clone-driver-v2.4621/

sonic-2-clone-driver-v2's People

Contributors

clownacy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sonic-2-clone-driver-v2's Issues

please politely disable interrupts

You have a nasty bug when loading a Z80 driver. In an incredibly rare chance, an interrupt can happen after z80 is stopped and before the Z80 stop check is cleared, soft locking the entire consol. Worse, once it happens, its consistent (at least on emulators). Please go here to disable your interrupts, politely of course

PSG playing wrong notes on hardware

PSG plays fine on Fusion, Regen, and Genesis Plus GX, but on hardware, it plays incorrect notes. I don't even know how this is caused.

I can also confirm this does this to the stock Sonic 1 music as well.

Adding a 32x PWM install guide to the wiki

While not a lot of people may use it, i feel like it's a nice thing to have if someone is wanting to make there ROM hack work with the 32x/PWM channel for, well anything

Clone Driver occasionally locks up 68k waiting for Z80

Very rarely, the Clone Driver v2 will freeze gameplay when attempting to change songs. It seems to happen in the SMPS_waitZ80 macro under "DACUpdateSample". The odd thing is, if I skip past the bne loop using regens' debugger, everything continues as normal. The music plays properly, DAC samples work as normal, and gameplay is completely unaffected.

I can provide a savestate, rom and maybe even some source code in private if necessary.

1UP RAM

When I try to play 1UP music, the game freezes

And I noticed that the music buffer is bigger than the buffer for 1UP

Music buffer (for example is $1B8 bytes, channel size is $2C bytes):

	v_music_track_ram:
	v_music_fmdac_tracks:
	v_music_dac_track:	SMPS_Track
	v_music_fm_tracks:
	v_music_fm1_track:	SMPS_Track
	v_music_fm2_track:	SMPS_Track
	v_music_fm3_track:	SMPS_Track
	v_music_fm4_track:	SMPS_Track
	v_music_fm5_track:	SMPS_Track
	v_music_fm6_track:	SMPS_Track
	v_music_fm_tracks_end:
	v_music_fmdac_tracks_end:
	v_music_psg_tracks:
	v_music_psg1_track:	SMPS_Track
	v_music_psg2_track:	SMPS_Track
	v_music_psg3_track:	SMPS_Track
	v_music_psg_tracks_end:
    if SMPS_EnablePWM
	v_music_pwm_tracks:
	v_music_pwm1_track:	SMPS_Track
	v_music_pwm2_track:	SMPS_Track
	v_music_pwm3_track:	SMPS_Track
	v_music_pwm4_track:	SMPS_Track
	v_music_pwm_tracks_end:
    endif
	v_music_track_ram_end:

And 1UP buffer ($160 bytes):

	v_1up_ram_copy:
	v_sfx_track_ram:
	v_sfx_fm_tracks:
	v_1up_dac_track:
	v_sfx_fm3_track:	SMPS_Track
	v_1up_fm1_track:
	v_sfx_fm4_track:	SMPS_Track
	v_1up_fm2_track:
	v_sfx_fm5_track:	SMPS_Track
	v_sfx_fm_tracks_end:
	v_sfx_psg_tracks:
	v_1up_fm3_track:
	v_sfx_psg1_track:	SMPS_Track
	v_1up_fm4_track:
	v_sfx_psg2_track:	SMPS_Track
	v_1up_fm5_track:
	v_sfx_psg3_track:	SMPS_Track
	v_sfx_psg_tracks_end:
	v_sfx_track_ram_end:

    if SMPS_EnableSpecSFX
	v_spcsfx_track_ram:
	v_spcsfx_fm_tracks:
	v_1up_fm6_track:
	v_spcsfx_fm4_track:	SMPS_Track
	v_spcsfx_fm_tracks_end:
	v_spcsfx_psg_tracks:
	v_1up_psg1_track:
	v_spcsfx_psg3_track:	SMPS_Track
	v_spcsfx_psg_tracks_end:
	v_spcsfx_track_ram_end:
    endif

	v_track_ram_end:

	v_1up_psg2_track:	SMPS_Track
	v_1up_psg3_track:	SMPS_Track
    if SMPS_EnablePWM
	v_1up_pwm1_track:	SMPS_Track
	v_1up_pwm2_track:	SMPS_Track
	v_1up_pwm3_track:	SMPS_Track
	v_1up_pwm4_track:	SMPS_Track
    endif

Older versions of the sound driver had no problems because there was no check for SMPS_EnableSpecSFX there

If I increase the 1UP buffer with SMPS_Track, the problem disappears

In Sonic 1 there was no problem, because SMPS_EnableSpecSFX is enabled from the beginning. But S2 and S3K has problems

Assemble separately

It appears that the original SMPS drivers were binary blobs. Doing the same for this driver should help with compatibility, and ease-of-use. Then again, only one disasm primarily uses asm68k, and the actual music would need building at assemble-time, too, making SMPS2ASM a dependency. Problem is, SMPS2ASM is bound to AS in its current state.

Perhaps the driver should be pre-assembled, and music should be assembled separately, with a copy of AS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.