Sega CD Mode 1 Trouble

Discussion in 'Technical Discussion' started by Bibin, Sep 24, 2015.

  1. Bibin

    Bibin

    DON'T LET THE SUN LAUGH AT YOU. Member
    882
    0
    0
    New York City
    Ghost in the Machine
    I'm trying to make some SGDK-compatible Sega CD Mode 1 code so I can add support for having a CD soundtrack option in my game. Here's what I have so far: https://github.com/M...r/src/cdaudio.c

    It gets stuck at waiting for the Sub-CPU to respond. Everything up to that point seems to be going correctly, and the way my CDX is responding supports that belief. I'm not sure why the Sub-CPU doesn't seem to be running correctly. If anyone has any pointers (no pun intended) then that would be great, since I think it's almost there.

    EDIT: First off I read some more documentation on the sega CD and gave registers real names. The important one here is Sub-CPU stuff: $A12000.

    To enable level 2 interrupts I write 0x8000 to it, then in every vblank I OR it with 0x0100 to trigger the interrupt on the sub-CPU. Now my init works! Still haven't made it play any music yet but this is a good step.