/*
 * $Header$
 * $Locker$
 * $Log$
 */
/************************************************************************/
/* Copyright Metrowerks Corporation. (c) 1999,2000.						*/
/*----------------------------------------------------------------------*/
/* 2000/06/02		Recreated by Toshiaki Koasa.						*/
/* 1999/06/19		Created by Takashi Kashima.							*/
/*																		*/
/* module name		mw_util.h											*/
/*																		*/
/* description		Metrowerks utilities for Dreamcast SDK 2.0			*/
/*																		*/
/* Function																*/
/*	This module is simple overlay support utilities.					*/
/*																		*/
/************************************************************************/

#pragma once

#ifndef _MW_UTILS_H_
#define _MW_UTILS_H_

/*******************************************************************************
	INCLUDE
*******************************************************************************/
#include <shinobi.h>

#ifdef __cplusplus							/* when c++ activated,				*/
extern "C" {								/* start c linkage					*/
#endif										/* __cplusplus						*/

/*----------------------------------------------------------------------*/
/* function prototype declare											*/
/*----------------------------------------------------------------------*/

void* MWGetGroupAddress(					/* get overlay group address		*/
	unsigned int	index					/* overlay group id					*/
											/*  ==0:user code segment			*/
											/*  >=1:each overlay group id		*/
	);										/* report address of overlay group	*/

Sint32 MWbload(								/* load binary file to memory		*/
	const char*			fileName,			/* file name						*/
	void*				address				/* load address						*/
	);										/* report loaded file size,			*/
											/* 0 if read failed					*/

void MWNotifyOverlayLoaded(					/* overlay loaded notify			*/
	const void*			address				/* overlay loaded address			*/
	);										/* report nothing					*/

void MWInitOverlay(							/* initialize overlay				*/
	const void*			address,			/* overlay load address				*/
	Sint32				fileSize			/* overlay file size				*/
	);										/* report nothing					*/

Sint32 MWLoadOverlay(						/* load overlay						*/
	const char*			fileName,			/* overlay file name				*/
	void*				address				/* load address						*/
	);										/* report 1 if success,	0 if not	*/
											/* false if not						*/

#ifdef __cplusplus							/* when c++ activated,				*/
	}										/* end of c linkage					*/
#endif										/* __cplusplus						*/
#endif										/* _MW_UTILS_H_						*/
