State of RV Flag during Soft Reset

Ask anything your want about the 32X Mushroom programming.

Moderator: BigEvilCorporation

Post Reply
Ralakimus
Interested
Posts: 19
Joined: Mon Nov 30, 2015 12:38 pm

State of RV Flag during Soft Reset

Post by Ralakimus » Thu Nov 23, 2023 3:48 am

Does the RV flag get reset on a soft reset or nah? I tried testing it myself, and it seems it doesn't. Keeping it set during a soft reset would not work out so well, since the internal vector table is still mapped and would cause the 68000 to jump to the 32X cartridge area, which isn't mapped due to the RV flag, and thus cause a crash on the 68000 side. I have seen sample code for the SH-2 side that just puts them into an infinite loop if the RV flag is set in the VRES interrupt handler.

I guess my actual question is, is my understanding of this correct? Or is there something I am missing or messed up on?

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: State of RV Flag during Soft Reset

Post by Chilly Willy » Sun Dec 03, 2023 6:23 pm

There's notes on that in the 32X docs, but no, it's not reset. One of the things I do in my MD side hardware init code is clear RV and wait for the 32X side to reboot.

Code: Select all

| wait on Mars side
        move.w  #0,0xA15104             /* set cart bank select */
        move.b  #0,0xA15107             /* clear RV - allow SH2 to access ROM */
8:
        cmp.l   #0x4D5F4F4B,0xA15120    /* M_OK */
        bne.b   8b                      /* wait for master ok */
9:
        cmp.l   #0x535F4F4B,0xA15124    /* S_OK */
        bne.b   9b                      /* wait for slave ok */

Post Reply