/**
 *  Sega Saturn USB dev cart firmware for use in ROM
 *  by cafe-alpha.
 *  WWW: http://ppcenter.free.fr/
**/

#ifndef _ROM_MAIN_H_
#define _ROM_MAIN_H_

#define ROM_CHECK_ADDRESS 0x0203FFFF

/**
 * Execute USB dev cart I/O polling code.
**/
#define ROMCODE_MSK_USB_DEV_CART 0x81
#define ROMCODE_VAL_USB_DEV_CART 0x01
#define ROM_USB_EXEC_ADDRESS  0x0203F800
#define rom_usb_dev_cart_io() (((*((unsigned char*)ROM_CHECK_ADDRESS)) & ROMCODE_MSK_USB_DEV_CART) == ROMCODE_VAL_USB_DEV_CART ? ((int (*)(void))ROM_USB_EXEC_ADDRESS)() : -1)


#endif /* _ROM_MAIN_H_ */


