Path: blob/master/libmupen64plus/mupen64plus-video-z64/src/z64.h
2 views
/*1* z642*3* Copyright (C) 2007 ziggy4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License along16* with this program; if not, write to the Free Software Foundation, Inc.,17* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.18*19**/2021#ifndef _Z64_H_22#define _Z64_H_23#include <stdint.h>2425#define DACRATE_NTSC (48681812)26#define DACRATE_PAL (49656530)27#define DACRATE_MPAL (48628316)2829#define SP_INTERRUPT 0x130#define SI_INTERRUPT 0x231#define AI_INTERRUPT 0x432#define VI_INTERRUPT 0x833#define PI_INTERRUPT 0x1034#define DP_INTERRUPT 0x203536#define SP_STATUS_HALT 0x000137#define SP_STATUS_BROKE 0x000238#define SP_STATUS_DMABUSY 0x000439#define SP_STATUS_DMAFULL 0x000840#define SP_STATUS_IOFULL 0x001041#define SP_STATUS_SSTEP 0x002042#define SP_STATUS_INTR_BREAK 0x004043#define SP_STATUS_SIGNAL0 0x008044#define SP_STATUS_SIGNAL1 0x010045#define SP_STATUS_SIGNAL2 0x020046#define SP_STATUS_SIGNAL3 0x040047#define SP_STATUS_SIGNAL4 0x080048#define SP_STATUS_SIGNAL5 0x100049#define SP_STATUS_SIGNAL6 0x200050#define SP_STATUS_SIGNAL7 0x40005152#define DP_STATUS_XBUS_DMA 0x0153#define DP_STATUS_FREEZE 0x0254#define DP_STATUS_FLUSH 0x0455#define DP_STATUS_START_GCLK 0x00856#define DP_STATUS_TMEM_BUSY 0x01057#define DP_STATUS_PIPE_BUSY 0x02058#define DP_STATUS_CMD_BUSY 0x04059#define DP_STATUS_CBUF_READY 0x08060#define DP_STATUS_DMA_BUSY 0x10061#define DP_STATUS_END_VALID 0x20062#define DP_STATUS_START_VALID 0x4006364#define R4300i_SP_Intr 1656667#define LSB_FIRST 1 // TODO : check for platform68#ifdef LSB_FIRST69#define BYTE_ADDR_XOR 370#define WORD_ADDR_XOR 171#define BYTE4_XOR_BE(a) ((a) ^ 3) /* read/write a byte to a 32-bit space */72#else73#define BYTE_ADDR_XOR 074#define WORD_ADDR_XOR 075#define BYTE4_XOR_BE(a) (a)76#endif777879typedef uint64_t UINT64;80typedef int64_t INT64;81typedef uint32_t UINT32;82typedef int32_t INT32;83typedef uint16_t UINT16;84typedef int16_t INT16;85typedef uint8_t UINT8;86typedef int8_t INT8;87typedef unsigned int offs_t;88#endif89909192