Genesis-Plus-GX/source/gx/aram.c

65 lines
1.8 KiB
C
Raw Normal View History

2008-12-11 18:38:29 +01:00
/****************************************************************************
* aram.c
2008-08-07 14:26:07 +02:00
*
2008-12-11 18:38:29 +01:00
* ARAM wrapper for libogc
*
* code by Softdev (2006)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
***************************************************************************/
2008-08-07 14:26:07 +02:00
#include "shared.h"
#define ARAMSTART 0x8000
2008-12-10 19:16:30 +01:00
#define ARAM_READ 1
#define ARAM_WRITE 0
2008-08-07 14:26:07 +02:00
/**
* StartARAM
* This simply sets up the call to internal libOGC.
* Passing NULL for array list, and 0 items to allocate.
* Required so libOGC knows to handle any interrupts etc.
*/
2008-12-10 19:16:30 +01:00
void StartARAM ()
2008-08-07 14:26:07 +02:00
{
AR_Init (NULL, 0);
}
/**
* ARAMPut
*
* Move data from MAIN memory to ARAM
*/
2008-12-10 19:16:30 +01:00
void ARAMPut (char *src, char *dst, int len)
2008-08-07 14:26:07 +02:00
{
DCFlushRange (src, len);
AR_StartDMA( ARAM_WRITE, (u32)src, (u32)dst, len);
while (AR_GetDMAStatus());
}
/**
* ARAMFetch
*
* This function will move data from ARAM to MAIN memory
*/
void
ARAMFetch (char *dst, char *src, int len)
{
DCInvalidateRange(dst, len);
AR_StartDMA( ARAM_READ, (u32) dst, (u32) src, len);
while (AR_GetDMAStatus());
}