DualPCM Sample Playbac

Discussion in 'Discussion & Q&A' started by MemeMaster9000, Apr 12, 2023.

  1. MemeMaster9000

    MemeMaster9000 Newcomer Member

    Joined:
    Feb 12, 2023
    Messages:
    21
    Location:
    Ice Cap Zone
    Currently, i'm working on a short Sonic 1 hack, and want to play an imported PCM by itself as music, but have had no luck in doing so. I've attempted to use this script (made by MarkeyJester for DualPCM direct access, modified by me to include the PCM track: )

    lea (MemoryImage).l,a0
    StopZ80
    lea ($A00000+PCM1_Sample).l,a1 ; MJ: load PCM 1 slot address
    move.b (a0)+,(a1)+ ; MJ: set address of sample
    move.b (a0)+,(a1)+ ; MJ: ''
    move.b (a0)+,(a1)+ ; MJ: ''
    move.b #(CUPCM1_NewSample&$FF),($A00000+CU_Stack).l ; MJ: set routine to run
    move.b #(CUPCM1_NewSample>>$08),($A00000+CU_Stack+1).l ; MJ: ''
    move.b #%11001001,($A00000+CUPCM1_RET).l ; MJ: change "NOP" to "RET"
    StartZ80

    The only thing Sonic 1 outputs is a mix of square notes that plays for about 2 minutes and then the game crashes. If anyone has done this in the past, could you please point me in the right direction?
    Thanks!