mirror of
https://github.com/libretro/beetle-pce-fast-libretro.git
synced 2024-11-30 03:20:31 +00:00
Update Mednafen GBA core to 0.9.33.3
This commit is contained in:
parent
06e6fc406f
commit
6ef78525c5
3
Makefile
3
Makefile
@ -192,8 +192,9 @@ else ifeq ($(core), gba)
|
||||
NEED_BLIP = 1
|
||||
NEED_STEREO_SOUND = 1
|
||||
NEED_CRC32 = 1
|
||||
WANT_NEW_API = 1
|
||||
CORE_DEFINE := -DWANT_GBA_EMU
|
||||
CORE_DIR := $(MEDNAFEN_DIR)/gba
|
||||
CORE_DIR := $(MEDNAFEN_DIR)/gba-09333
|
||||
|
||||
CORE_SOURCES := $(CORE_DIR)/arm.cpp \
|
||||
$(CORE_DIR)/bios.cpp \
|
||||
|
@ -137,8 +137,8 @@ static bool is_pal = false;
|
||||
#elif defined(WANT_GBA_EMU)
|
||||
#define MEDNAFEN_CORE_NAME_MODULE "gba"
|
||||
#define MEDNAFEN_CORE_NAME "Mednafen VBA-M"
|
||||
#define MEDNAFEN_CORE_VERSION "v0.9.26"
|
||||
#define MEDNAFEN_CORE_EXTENSIONS "gba"
|
||||
#define MEDNAFEN_CORE_VERSION "v0.9.33.3"
|
||||
#define MEDNAFEN_CORE_EXTENSIONS "gba|agb|bin"
|
||||
#define MEDNAFEN_CORE_TIMING_FPS 59.73
|
||||
#define MEDNAFEN_CORE_GEOMETRY_BASE_W (game->nominal_width)
|
||||
#define MEDNAFEN_CORE_GEOMETRY_BASE_H (game->nominal_height)
|
||||
|
3435
mednafen/gba-09333/GBA.cpp
Normal file
3435
mednafen/gba-09333/GBA.cpp
Normal file
File diff suppressed because it is too large
Load Diff
155
mednafen/gba-09333/GBA.h
Normal file
155
mednafen/gba-09333/GBA.h
Normal file
@ -0,0 +1,155 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_GBA_H
|
||||
#define VBA_GBA_H
|
||||
|
||||
#include "../mednafen.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
typedef struct {
|
||||
uint8 *address;
|
||||
uint32 mask;
|
||||
} memoryMap;
|
||||
|
||||
typedef union {
|
||||
struct {
|
||||
#ifdef MSB_FIRST
|
||||
uint8 B3;
|
||||
uint8 B2;
|
||||
uint8 B1;
|
||||
uint8 B0;
|
||||
#else
|
||||
uint8 B0;
|
||||
uint8 B1;
|
||||
uint8 B2;
|
||||
uint8 B3;
|
||||
#endif
|
||||
} B;
|
||||
struct {
|
||||
#ifdef MSB_FIRST
|
||||
uint16 W1;
|
||||
uint16 W0;
|
||||
#else
|
||||
uint16 W0;
|
||||
uint16 W1;
|
||||
#endif
|
||||
} W;
|
||||
#ifdef MSB_FIRST
|
||||
volatile uint32 I;
|
||||
#else
|
||||
uint32 I;
|
||||
#endif
|
||||
} reg_pair;
|
||||
|
||||
#ifndef NO_GBA_MAP
|
||||
extern memoryMap map[256];
|
||||
#endif
|
||||
|
||||
extern bool busPrefetch;
|
||||
extern bool busPrefetchEnable;
|
||||
extern uint32 busPrefetchCount;
|
||||
extern uint32 cpuPrefetch[2];
|
||||
|
||||
|
||||
extern uint8 memoryWait[16];
|
||||
extern uint8 memoryWait32[16];
|
||||
extern uint8 memoryWaitSeq[16];
|
||||
extern uint8 memoryWaitSeq32[16];
|
||||
|
||||
extern reg_pair reg[45];
|
||||
extern uint8 biosProtected[4];
|
||||
|
||||
extern uint32 N_FLAG;
|
||||
extern bool Z_FLAG;
|
||||
extern bool C_FLAG;
|
||||
extern bool V_FLAG;
|
||||
extern bool armIrqEnable;
|
||||
extern bool armState;
|
||||
extern int armMode;
|
||||
extern void (*cpuSaveGameFunc)(uint32,uint8);
|
||||
|
||||
extern void doMirroring(bool);
|
||||
extern void CPUUpdateRegister(uint32, uint16);
|
||||
extern void applyTimer ();
|
||||
|
||||
void CPUWriteMemory(uint32 address, uint32 value);
|
||||
void CPUWriteHalfWord(uint32, uint16);
|
||||
void CPUWriteByte(uint32, uint8);
|
||||
|
||||
extern void CPUCheckDMA(int,int);
|
||||
|
||||
extern void CPUSwitchMode(int mode, bool saveState, bool breakLoop);
|
||||
extern void CPUSwitchMode(int mode, bool saveState);
|
||||
extern void CPUUndefinedException();
|
||||
extern void CPUSoftwareInterrupt();
|
||||
extern void CPUSoftwareInterrupt(int comment);
|
||||
extern void CPUCompareVCOUNT();
|
||||
extern void CPUUpdateCPSR();
|
||||
extern void CPUUpdateFlags(bool breakLoop);
|
||||
extern void CPUUpdateFlags();
|
||||
|
||||
|
||||
extern uint8 cpuBitsSet[256];
|
||||
extern uint8 cpuLowestBitSet[256];
|
||||
|
||||
extern struct EmulatedSystem GBASystem;
|
||||
|
||||
int32 MDFNGBA_GetTimerPeriod(int which);
|
||||
|
||||
|
||||
#define R13_IRQ 18
|
||||
#define R14_IRQ 19
|
||||
#define SPSR_IRQ 20
|
||||
#define R13_USR 26
|
||||
#define R14_USR 27
|
||||
#define R13_SVC 28
|
||||
#define R14_SVC 29
|
||||
#define SPSR_SVC 30
|
||||
#define R13_ABT 31
|
||||
#define R14_ABT 32
|
||||
#define SPSR_ABT 33
|
||||
#define R13_UND 34
|
||||
#define R14_UND 35
|
||||
#define SPSR_UND 36
|
||||
#define R8_FIQ 37
|
||||
#define R9_FIQ 38
|
||||
#define R10_FIQ 39
|
||||
#define R11_FIQ 40
|
||||
#define R12_FIQ 41
|
||||
#define R13_FIQ 42
|
||||
#define R14_FIQ 43
|
||||
#define SPSR_FIQ 44
|
||||
}
|
||||
|
||||
#include "Globals.h"
|
||||
#include "eeprom.h"
|
||||
#include "flash.h"
|
||||
#include "RTC.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
extern RTC *GBA_RTC;
|
||||
|
||||
}
|
||||
|
||||
#endif //VBA_GBA_H
|
285
mednafen/gba-09333/GBAinline.cpp
Normal file
285
mednafen/gba-09333/GBAinline.cpp
Normal file
@ -0,0 +1,285 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Port.h"
|
||||
#include "RTC.h"
|
||||
#include "GBAinline.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
uint32 CPUReadMemory(uint32 address)
|
||||
{
|
||||
uint32 value;
|
||||
|
||||
switch(address >> 24)
|
||||
{
|
||||
case 0:
|
||||
if(reg[15].I >> 24)
|
||||
{
|
||||
if(address < 0x4000)
|
||||
{
|
||||
value = READ32LE(((uint32 *)&biosProtected));
|
||||
}
|
||||
else goto unreadable;
|
||||
}
|
||||
else
|
||||
value = READ32LE(((uint32 *)&bios[address & 0x3FFC]));
|
||||
break;
|
||||
case 2:
|
||||
value = READ32LE(((uint32 *)&workRAM[address & 0x3FFFC]));
|
||||
break;
|
||||
case 3:
|
||||
value = READ32LE(((uint32 *)&internalRAM[address & 0x7ffC]));
|
||||
break;
|
||||
case 4:
|
||||
if((address < 0x4000400) && ioReadable[address & 0x3fc]) {
|
||||
if(ioReadable[(address & 0x3fc) + 2])
|
||||
value = READ32LE(((uint32 *)&ioMem[address & 0x3fC]));
|
||||
else
|
||||
value = READ16LE(((uint16 *)&ioMem[address & 0x3fc]));
|
||||
} else goto unreadable;
|
||||
break;
|
||||
case 5:
|
||||
value = READ32LE(((uint32 *)&paletteRAM[address & 0x3fC]));
|
||||
break;
|
||||
case 6:
|
||||
address = (address & 0x1fffc);
|
||||
if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000))
|
||||
{
|
||||
value = 0;
|
||||
break;
|
||||
}
|
||||
if ((address & 0x18000) == 0x18000)
|
||||
address &= 0x17fff;
|
||||
value = READ32LE(((uint32 *)&vram[address]));
|
||||
break;
|
||||
case 7:
|
||||
value = READ32LE(((uint32 *)&oam[address & 0x3FC]));
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
value = READ32LE(((uint32 *)&rom[address&0x1FFFFFC]));
|
||||
break;
|
||||
case 13:
|
||||
if(cpuEEPROMEnabled)
|
||||
// no need to swap this
|
||||
return eepromRead(address);
|
||||
goto unreadable;
|
||||
case 14:
|
||||
if(cpuFlashEnabled | cpuSramEnabled)
|
||||
// no need to swap this
|
||||
return flashRead(address);
|
||||
// default
|
||||
|
||||
default:
|
||||
unreadable:
|
||||
if(cpuDmaHack) {
|
||||
value = cpuDmaLast;
|
||||
} else {
|
||||
if(armState) {
|
||||
value = CPUReadMemoryQuick(reg[15].I);
|
||||
} else {
|
||||
value = CPUReadHalfWordQuick(reg[15].I) |
|
||||
CPUReadHalfWordQuick(reg[15].I) << 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(address & 3) {
|
||||
int shift = (address & 3) << 3;
|
||||
value = (value >> shift) | (value << (32 - shift));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
uint32 CPUReadHalfWord(uint32 address)
|
||||
{
|
||||
uint32 value;
|
||||
|
||||
switch(address >> 24) {
|
||||
case 0:
|
||||
if (reg[15].I >> 24) {
|
||||
if(address < 0x4000) {
|
||||
value = READ16LE(((uint16 *)&biosProtected[address&2]));
|
||||
} else goto unreadable;
|
||||
} else
|
||||
value = READ16LE(((uint16 *)&bios[address & 0x3FFE]));
|
||||
break;
|
||||
case 2:
|
||||
value = READ16LE(((uint16 *)&workRAM[address & 0x3FFFE]));
|
||||
break;
|
||||
case 3:
|
||||
value = READ16LE(((uint16 *)&internalRAM[address & 0x7ffe]));
|
||||
break;
|
||||
case 4:
|
||||
if((address < 0x4000400) && ioReadable[address & 0x3fe])
|
||||
{
|
||||
value = READ16LE(((uint16 *)&ioMem[address & 0x3fe]));
|
||||
if (((address & 0x3fe)>0xFF) && ((address & 0x3fe)<0x10E))
|
||||
{
|
||||
if (((address & 0x3fe) == 0x100) && timers[0].On)
|
||||
value = 0xFFFF - ((timers[0].Ticks-cpuTotalTicks) >> timers[0].ClockReload);
|
||||
else
|
||||
if (((address & 0x3fe) == 0x104) && timers[1].On && !(timers[1].CNT & 4))
|
||||
value = 0xFFFF - ((timers[1].Ticks-cpuTotalTicks) >> timers[1].ClockReload);
|
||||
else
|
||||
if (((address & 0x3fe) == 0x108) && timers[2].On && !(timers[2].CNT & 4))
|
||||
value = 0xFFFF - ((timers[2].Ticks-cpuTotalTicks) >> timers[2].ClockReload);
|
||||
else
|
||||
if (((address & 0x3fe) == 0x10C) && timers[3].On && !(timers[3].CNT & 4))
|
||||
value = 0xFFFF - ((timers[3].Ticks-cpuTotalTicks) >> timers[3].ClockReload);
|
||||
}
|
||||
}
|
||||
else goto unreadable;
|
||||
break;
|
||||
case 5:
|
||||
value = READ16LE(((uint16 *)&paletteRAM[address & 0x3fe]));
|
||||
break;
|
||||
case 6:
|
||||
address = (address & 0x1fffe);
|
||||
if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000))
|
||||
{
|
||||
value = 0;
|
||||
break;
|
||||
}
|
||||
if ((address & 0x18000) == 0x18000)
|
||||
address &= 0x17fff;
|
||||
value = READ16LE(((uint16 *)&vram[address]));
|
||||
break;
|
||||
case 7:
|
||||
value = READ16LE(((uint16 *)&oam[address & 0x3fe]));
|
||||
break;
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
if(GBA_RTC && (address == 0x80000c4 || address == 0x80000c6 || address == 0x80000c8))
|
||||
value = GBA_RTC->Read(address);
|
||||
else
|
||||
value = READ16LE(((uint16 *)&rom[address & 0x1FFFFFE]));
|
||||
break;
|
||||
case 13:
|
||||
if(cpuEEPROMEnabled)
|
||||
// no need to swap this
|
||||
return eepromRead(address);
|
||||
goto unreadable;
|
||||
case 14:
|
||||
if(cpuFlashEnabled | cpuSramEnabled)
|
||||
// no need to swap this
|
||||
return flashRead(address);
|
||||
// default
|
||||
default:
|
||||
unreadable:
|
||||
if(cpuDmaHack) {
|
||||
value = cpuDmaLast & 0xFFFF;
|
||||
} else {
|
||||
if(armState) {
|
||||
value = CPUReadHalfWordQuick(reg[15].I + (address & 2));
|
||||
} else {
|
||||
value = CPUReadHalfWordQuick(reg[15].I);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(address & 1) {
|
||||
value = (value >> 8) | (value << 24);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
uint8 CPUReadByte(uint32 address)
|
||||
{
|
||||
switch(address >> 24) {
|
||||
case 0:
|
||||
if (reg[15].I >> 24) {
|
||||
if(address < 0x4000) {
|
||||
return biosProtected[address & 3];
|
||||
} else goto unreadable;
|
||||
}
|
||||
return bios[address & 0x3FFF];
|
||||
case 2:
|
||||
return workRAM[address & 0x3FFFF];
|
||||
case 3:
|
||||
return internalRAM[address & 0x7fff];
|
||||
case 4:
|
||||
if((address < 0x4000400) && ioReadable[address & 0x3ff])
|
||||
return ioMem[address & 0x3ff];
|
||||
else goto unreadable;
|
||||
case 5:
|
||||
return paletteRAM[address & 0x3ff];
|
||||
case 6:
|
||||
address = (address & 0x1ffff);
|
||||
if (((DISPCNT & 7) >2) && ((address & 0x1C000) == 0x18000))
|
||||
return 0;
|
||||
if ((address & 0x18000) == 0x18000)
|
||||
address &= 0x17fff;
|
||||
return vram[address];
|
||||
case 7:
|
||||
return oam[address & 0x3ff];
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
return rom[address & 0x1FFFFFF];
|
||||
case 13:
|
||||
if(cpuEEPROMEnabled)
|
||||
return eepromRead(address);
|
||||
goto unreadable;
|
||||
case 14:
|
||||
if(cpuSramEnabled | cpuFlashEnabled)
|
||||
return flashRead(address);
|
||||
if(cpuEEPROMSensorEnabled) {
|
||||
switch(address & 0x00008f00) {
|
||||
case 0x8200:
|
||||
//return systemGetSensorX() & 255;
|
||||
case 0x8300:
|
||||
//return (systemGetSensorX() >> 8)|0x80;
|
||||
case 0x8400:
|
||||
//return systemGetSensorY() & 255;
|
||||
case 0x8500:
|
||||
//return systemGetSensorY() >> 8;
|
||||
return(0);
|
||||
}
|
||||
}
|
||||
// default
|
||||
default:
|
||||
unreadable:
|
||||
if(cpuDmaHack) {
|
||||
return cpuDmaLast & 0xFF;
|
||||
} else {
|
||||
if(armState) {
|
||||
return CPUReadByteQuick(reg[15].I+(address & 3));
|
||||
} else {
|
||||
return CPUReadByteQuick(reg[15].I+(address & 1));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
315
mednafen/gba-09333/GBAinline.h
Normal file
315
mednafen/gba-09333/GBAinline.h
Normal file
@ -0,0 +1,315 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_GBAinline_H
|
||||
#define VBA_GBAinline_H
|
||||
|
||||
#include "Port.h"
|
||||
#include "RTC.h"
|
||||
#include "sram.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
#ifdef INCED_FROM_ARM_CPP
|
||||
#define EXCLUDE_ARM_FROM_INLINE
|
||||
#else
|
||||
#define EXCLUDE_ARM_FROM_INLINE INLINE
|
||||
#endif
|
||||
|
||||
extern bool cpuSramEnabled;
|
||||
extern bool cpuFlashEnabled;
|
||||
extern bool cpuEEPROMEnabled;
|
||||
extern bool cpuEEPROMSensorEnabled;
|
||||
extern bool cpuDmaHack;
|
||||
extern uint32 cpuDmaLast;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16 Value;
|
||||
bool On;
|
||||
int32 Ticks;
|
||||
int32 Reload;
|
||||
int32 ClockReload;
|
||||
uint16 D;
|
||||
uint16 CNT;
|
||||
} GBATimer;
|
||||
|
||||
extern GBATimer timers[4];
|
||||
|
||||
extern int cpuTotalTicks;
|
||||
|
||||
#define ARM_PREFETCH \
|
||||
{\
|
||||
cpuPrefetch[0] = CPUReadMemoryQuick(armNextPC);\
|
||||
cpuPrefetch[1] = CPUReadMemoryQuick(armNextPC+4);\
|
||||
}
|
||||
|
||||
#define THUMB_PREFETCH \
|
||||
{\
|
||||
cpuPrefetch[0] = CPUReadHalfWordQuick(armNextPC);\
|
||||
cpuPrefetch[1] = CPUReadHalfWordQuick(armNextPC+2);\
|
||||
}
|
||||
|
||||
#define ARM_PREFETCH_NEXT \
|
||||
cpuPrefetch[1] = CPUReadMemoryQuick(armNextPC+4);
|
||||
|
||||
#define THUMB_PREFETCH_NEXT\
|
||||
cpuPrefetch[1] = CPUReadHalfWordQuick(armNextPC+2);
|
||||
|
||||
#define CPUReadByteQuick(addr) \
|
||||
map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]
|
||||
|
||||
#define CPUReadHalfWordQuick(addr) \
|
||||
READ16LE(((uint16*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]))
|
||||
|
||||
#define CPUReadMemoryQuick(addr) \
|
||||
READ32LE(((uint32*)&map[(addr)>>24].address[(addr) & map[(addr)>>24].mask]))
|
||||
|
||||
uint32 CPUReadMemory(uint32 address);
|
||||
|
||||
uint32 CPUReadHalfWord(uint32 address);
|
||||
|
||||
static INLINE uint16 CPUReadHalfWordSigned(uint32 address)
|
||||
{
|
||||
uint16 value = CPUReadHalfWord(address);
|
||||
if((address & 1))
|
||||
value = (int8)value;
|
||||
return value;
|
||||
}
|
||||
|
||||
uint8 CPUReadByte(uint32 address);
|
||||
|
||||
// Waitstates when accessing data
|
||||
static EXCLUDE_ARM_FROM_INLINE int dataTicksAccesint16(uint32 address) // DATA 8/16bits NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWait[addr];
|
||||
|
||||
if (addr>=0x08)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (waitState>0)
|
||||
waitState--;
|
||||
waitState++;
|
||||
busPrefetchCount = (busPrefetchCount<<waitState) | (0xFF>>(8-waitState));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static EXCLUDE_ARM_FROM_INLINE int dataTicksAccesint32(uint32 address) // DATA 32bits NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWait32[addr];
|
||||
|
||||
if (addr>=0x08)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (waitState>0)
|
||||
waitState--;
|
||||
waitState++;
|
||||
busPrefetchCount = (busPrefetchCount<<waitState) | (0xFF>>(8-waitState));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static EXCLUDE_ARM_FROM_INLINE int dataTicksAccessSeq16(uint32 address)// DATA 8/16bits SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWaitSeq[addr];
|
||||
|
||||
if (addr>=0x08)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (waitState>0)
|
||||
waitState--;
|
||||
waitState++;
|
||||
busPrefetchCount = (busPrefetchCount<<waitState) | (0xFF>>(8-waitState));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static EXCLUDE_ARM_FROM_INLINE int dataTicksAccessSeq32(uint32 address)// DATA 32bits SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
int value = memoryWaitSeq32[addr];
|
||||
|
||||
if (addr>=0x08)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
busPrefetch=false;
|
||||
}
|
||||
else if (busPrefetch)
|
||||
{
|
||||
int waitState = value;
|
||||
if (waitState>0)
|
||||
waitState--;
|
||||
waitState++;
|
||||
busPrefetchCount = (busPrefetchCount<<waitState) | (0xFF>>(8-waitState));
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
// Waitstates when executing opcode
|
||||
static EXCLUDE_ARM_FROM_INLINE int codeTicksAccesint16(uint32 address) // THUMB NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if ((busPrefetchCount&0x3) == 3)
|
||||
{
|
||||
busPrefetchCount=((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount=((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return memoryWaitSeq[addr]-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
}
|
||||
|
||||
static EXCLUDE_ARM_FROM_INLINE int codeTicksAccesint32(uint32 address) // ARM NON SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount=((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount=((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
}
|
||||
|
||||
static EXCLUDE_ARM_FROM_INLINE int codeTicksAccessSeq16(uint32 address) // THUMB SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount=((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
if (busPrefetchCount>0xFF)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait[addr];
|
||||
}
|
||||
else
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
else
|
||||
{
|
||||
busPrefetchCount = 0;
|
||||
return memoryWaitSeq[addr];
|
||||
}
|
||||
}
|
||||
|
||||
static EXCLUDE_ARM_FROM_INLINE int codeTicksAccessSeq32(uint32 address) // ARM SEQ
|
||||
{
|
||||
int addr = (address>>24)&15;
|
||||
|
||||
if ((addr>=0x08) && (addr<=0x0D))
|
||||
{
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount=((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
if (busPrefetchCount&0x1)
|
||||
{
|
||||
busPrefetchCount=((busPrefetchCount&0xFF)>>1) | (busPrefetchCount&0xFFFFFF00);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return memoryWaitSeq[addr];
|
||||
|
||||
}
|
||||
else
|
||||
if (busPrefetchCount>0xFF)
|
||||
{
|
||||
busPrefetchCount=0;
|
||||
return memoryWait32[addr];
|
||||
}
|
||||
else
|
||||
return memoryWaitSeq32[addr];
|
||||
}
|
||||
else
|
||||
{
|
||||
return memoryWaitSeq32[addr];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif //VBA_GBAinline_H
|
1409
mednafen/gba-09333/Gfx.cpp
Normal file
1409
mednafen/gba-09333/Gfx.cpp
Normal file
File diff suppressed because it is too large
Load Diff
85
mednafen/gba-09333/Gfx.h
Normal file
85
mednafen/gba-09333/Gfx.h
Normal file
@ -0,0 +1,85 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_GFX_H
|
||||
#define VBA_GFX_H
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Gfx.h"
|
||||
#include "Globals.h"
|
||||
|
||||
#include "Port.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
//#define SPRITE_DEBUG
|
||||
|
||||
void mode0RenderLine();
|
||||
void mode0RenderLineNoWindow();
|
||||
void mode0RenderLineAll();
|
||||
|
||||
void mode1RenderLine();
|
||||
void mode1RenderLineNoWindow();
|
||||
void mode1RenderLineAll();
|
||||
|
||||
void mode2RenderLine();
|
||||
void mode2RenderLineNoWindow();
|
||||
void mode2RenderLineAll();
|
||||
|
||||
void mode3RenderLine();
|
||||
void mode3RenderLineNoWindow();
|
||||
void mode3RenderLineAll();
|
||||
|
||||
void mode4RenderLine();
|
||||
void mode4RenderLineNoWindow();
|
||||
void mode4RenderLineAll();
|
||||
|
||||
void mode5RenderLine();
|
||||
void mode5RenderLineNoWindow();
|
||||
void mode5RenderLineAll();
|
||||
|
||||
extern int all_coeff[32];
|
||||
extern uint32 AlphaClampLUT[64];
|
||||
extern MDFN_ALIGN(16) uint32 line0[512];
|
||||
extern MDFN_ALIGN(16) uint32 line1[512];
|
||||
extern MDFN_ALIGN(16) uint32 line2[512];
|
||||
extern MDFN_ALIGN(16) uint32 line3[512];
|
||||
extern MDFN_ALIGN(16) uint32 lineOBJ[512];
|
||||
extern MDFN_ALIGN(16) uint32 lineOBJWin[512];
|
||||
extern MDFN_ALIGN(16) uint32 lineMix[512];
|
||||
extern bool gfxInWin0[512];
|
||||
extern bool gfxInWin1[512];
|
||||
|
||||
extern int gfxBG2Changed;
|
||||
extern int gfxBG3Changed;
|
||||
|
||||
extern int gfxBG2X;
|
||||
extern int gfxBG2Y;
|
||||
extern int gfxBG2LastX;
|
||||
extern int gfxBG2LastY;
|
||||
extern int gfxBG3X;
|
||||
extern int gfxBG3Y;
|
||||
extern int gfxBG3LastX;
|
||||
extern int gfxBG3LastY;
|
||||
extern int gfxLastVCOUNT;
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_GFX_H
|
110
mednafen/gba-09333/Globals.cpp
Normal file
110
mednafen/gba-09333/Globals.cpp
Normal file
@ -0,0 +1,110 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
reg_pair reg[45];
|
||||
memoryMap map[256];
|
||||
bool ioReadable[0x400];
|
||||
|
||||
uint32 N_FLAG = 0;
|
||||
bool C_FLAG = 0;
|
||||
bool Z_FLAG = 0;
|
||||
bool V_FLAG = 0;
|
||||
|
||||
bool armState = true;
|
||||
bool armIrqEnable = true;
|
||||
uint32 armNextPC = 0x00000000;
|
||||
int armMode = 0x1f;
|
||||
uint32 stop = 0x08000568;
|
||||
int saveType = 0;
|
||||
bool useBios = false;
|
||||
bool skipBios = false;
|
||||
int frameSkip = 1;
|
||||
bool speedup = false;
|
||||
bool synchronize = true;
|
||||
bool cpuDisableSfx = false;
|
||||
bool cpuIsMultiBoot = false;
|
||||
bool parseDebug = true;
|
||||
int layerSettings = 0xff00;
|
||||
int layerEnable = 0xff00;
|
||||
|
||||
uint8 *bios = NULL;
|
||||
uint8 *rom = NULL;
|
||||
uint8 *internalRAM = NULL;
|
||||
uint8 *workRAM = NULL;
|
||||
uint8 *paletteRAM = NULL;
|
||||
uint8 *vram = NULL;
|
||||
uint8 *pix = NULL;
|
||||
uint8 *oam = NULL;
|
||||
uint8 *ioMem = NULL;
|
||||
|
||||
uint16 DISPCNT = 0x0080;
|
||||
uint16 DISPSTAT = 0x0000;
|
||||
uint16 VCOUNT = 0x0000;
|
||||
uint16 BG0CNT = 0x0000;
|
||||
uint16 BG1CNT = 0x0000;
|
||||
uint16 BG2CNT = 0x0000;
|
||||
uint16 BG3CNT = 0x0000;
|
||||
|
||||
uint16 BGHOFS[4];
|
||||
uint16 BGVOFS[4];
|
||||
|
||||
uint16 BG2PA = 0x0100;
|
||||
uint16 BG2PB = 0x0000;
|
||||
uint16 BG2PC = 0x0000;
|
||||
uint16 BG2PD = 0x0100;
|
||||
uint16 BG2X_L = 0x0000;
|
||||
uint16 BG2X_H = 0x0000;
|
||||
uint16 BG2Y_L = 0x0000;
|
||||
uint16 BG2Y_H = 0x0000;
|
||||
uint16 BG3PA = 0x0100;
|
||||
uint16 BG3PB = 0x0000;
|
||||
uint16 BG3PC = 0x0000;
|
||||
uint16 BG3PD = 0x0100;
|
||||
uint16 BG3X_L = 0x0000;
|
||||
uint16 BG3X_H = 0x0000;
|
||||
uint16 BG3Y_L = 0x0000;
|
||||
uint16 BG3Y_H = 0x0000;
|
||||
uint16 WIN0H = 0x0000;
|
||||
uint16 WIN1H = 0x0000;
|
||||
uint16 WIN0V = 0x0000;
|
||||
uint16 WIN1V = 0x0000;
|
||||
uint16 WININ = 0x0000;
|
||||
uint16 WINOUT = 0x0000;
|
||||
uint16 MOSAIC = 0x0000;
|
||||
uint16 BLDMOD = 0x0000;
|
||||
uint16 COLEV = 0x0000;
|
||||
uint16 COLY = 0x0000;
|
||||
|
||||
uint16 DMSAD_L[4] = {0};
|
||||
uint16 DMSAD_H[4] = {0};
|
||||
uint16 DMDAD_L[4] = {0};
|
||||
uint16 DMDAD_H[4] = {0};
|
||||
uint16 DMCNT_L[4] = {0};
|
||||
uint16 DMCNT_H[4] = {0};
|
||||
|
||||
uint16 P1 = 0xFFFF;
|
||||
uint16 IE = 0x0000;
|
||||
uint16 IF = 0x0000;
|
||||
uint16 IME = 0x0000;
|
||||
|
||||
}
|
132
mednafen/gba-09333/Globals.h
Normal file
132
mednafen/gba-09333/Globals.h
Normal file
@ -0,0 +1,132 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_GLOBALS_H
|
||||
#define VBA_GLOBALS_H
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
#define VERBOSE_SWI 1
|
||||
#define VERBOSE_UNALIGNED_MEMORY 2
|
||||
#define VERBOSE_ILLEGAL_WRITE 4
|
||||
#define VERBOSE_ILLEGAL_READ 8
|
||||
#define VERBOSE_DMA0 16
|
||||
#define VERBOSE_DMA1 32
|
||||
#define VERBOSE_DMA2 64
|
||||
#define VERBOSE_DMA3 128
|
||||
#define VERBOSE_UNDEFINED 256
|
||||
#define VERBOSE_AGBPRINT 512
|
||||
|
||||
extern reg_pair reg[45];
|
||||
extern bool ioReadable[0x400];
|
||||
|
||||
extern uint32 N_FLAG;
|
||||
extern bool C_FLAG;
|
||||
extern bool Z_FLAG;
|
||||
extern bool V_FLAG;
|
||||
|
||||
extern bool armState;
|
||||
extern bool armIrqEnable;
|
||||
extern uint32 armNextPC;
|
||||
extern int armMode;
|
||||
extern uint32 stop;
|
||||
extern int saveType;
|
||||
extern bool useBios;
|
||||
extern bool skipBios;
|
||||
extern int frameSkip;
|
||||
extern bool speedup;
|
||||
extern bool synchronize;
|
||||
extern bool cpuDisableSfx;
|
||||
extern bool cpuIsMultiBoot;
|
||||
extern bool parseDebug;
|
||||
extern int layerSettings;
|
||||
extern int layerEnable;
|
||||
|
||||
extern uint8 *bios;
|
||||
extern uint8 *rom;
|
||||
extern uint8 *internalRAM;
|
||||
extern uint8 *workRAM;
|
||||
extern uint8 *paletteRAM;
|
||||
extern uint8 *vram;
|
||||
extern uint8 *pix;
|
||||
extern uint8 *oam;
|
||||
extern uint8 *ioMem;
|
||||
|
||||
extern uint16 DISPCNT;
|
||||
extern uint16 DISPSTAT;
|
||||
extern uint16 VCOUNT;
|
||||
extern uint16 BG0CNT;
|
||||
extern uint16 BG1CNT;
|
||||
extern uint16 BG2CNT;
|
||||
extern uint16 BG3CNT;
|
||||
|
||||
extern uint16 BGHOFS[4];
|
||||
extern uint16 BGVOFS[4];
|
||||
|
||||
extern uint16 BG2PA;
|
||||
extern uint16 BG2PB;
|
||||
extern uint16 BG2PC;
|
||||
extern uint16 BG2PD;
|
||||
extern uint16 BG2X_L;
|
||||
extern uint16 BG2X_H;
|
||||
extern uint16 BG2Y_L;
|
||||
extern uint16 BG2Y_H;
|
||||
extern uint16 BG3PA;
|
||||
extern uint16 BG3PB;
|
||||
extern uint16 BG3PC;
|
||||
extern uint16 BG3PD;
|
||||
extern uint16 BG3X_L;
|
||||
extern uint16 BG3X_H;
|
||||
extern uint16 BG3Y_L;
|
||||
extern uint16 BG3Y_H;
|
||||
extern uint16 WIN0H;
|
||||
extern uint16 WIN1H;
|
||||
extern uint16 WIN0V;
|
||||
extern uint16 WIN1V;
|
||||
extern uint16 WININ;
|
||||
extern uint16 WINOUT;
|
||||
extern uint16 MOSAIC;
|
||||
extern uint16 BLDMOD;
|
||||
extern uint16 COLEV;
|
||||
extern uint16 COLY;
|
||||
|
||||
extern uint16 DMSAD_L[4];
|
||||
extern uint16 DMSAD_H[4];
|
||||
extern uint16 DMDAD_L[4];
|
||||
extern uint16 DMDAD_H[4];
|
||||
extern uint16 DMCNT_L[4];
|
||||
extern uint16 DMCNT_H[4];
|
||||
|
||||
extern uint16 TM0D;
|
||||
extern uint16 TM0CNT;
|
||||
extern uint16 TM1D;
|
||||
extern uint16 TM1CNT;
|
||||
extern uint16 TM2D;
|
||||
extern uint16 TM2CNT;
|
||||
extern uint16 TM3D;
|
||||
extern uint16 TM3CNT;
|
||||
extern uint16 P1;
|
||||
extern uint16 IE;
|
||||
extern uint16 IF;
|
||||
extern uint16 IME;
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_GLOBALS_H
|
644
mednafen/gba-09333/Makefile
Normal file
644
mednafen/gba-09333/Makefile
Normal file
@ -0,0 +1,644 @@
|
||||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# src/gba/Makefile. Generated from Makefile.in by configure.
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
|
||||
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/mednafen
|
||||
pkgincludedir = $(includedir)/mednafen
|
||||
pkglibdir = $(libdir)/mednafen
|
||||
pkglibexecdir = $(libexecdir)/mednafen
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = x86_64-unknown-linux-gnu
|
||||
host_triplet = x86_64-unknown-linux-gnu
|
||||
target_triplet = x86_64-unknown-linux-gnu
|
||||
subdir = src/gba
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
|
||||
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/fcntl-o.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc2.m4 \
|
||||
$(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/intl.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax.m4 \
|
||||
$(top_srcdir)/m4/inttypes-pri.m4 \
|
||||
$(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lcmessage.m4 \
|
||||
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
|
||||
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \
|
||||
$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
|
||||
$(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/uintmax_t.m4 \
|
||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/wchar_t.m4 \
|
||||
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
AM_V_AR = $(am__v_AR_$(V))
|
||||
am__v_AR_ = $(am__v_AR_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_AR_0 = @echo " AR " $@;
|
||||
AM_V_at = $(am__v_at_$(V))
|
||||
am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_at_0 = @
|
||||
libgba_a_AR = $(AR) $(ARFLAGS)
|
||||
libgba_a_LIBADD =
|
||||
am_libgba_a_OBJECTS = GBAinline.$(OBJEXT) arm.$(OBJEXT) \
|
||||
thumb.$(OBJEXT) bios.$(OBJEXT) eeprom.$(OBJEXT) \
|
||||
flash.$(OBJEXT) GBA.$(OBJEXT) Gfx.$(OBJEXT) Globals.$(OBJEXT) \
|
||||
Mode0.$(OBJEXT) Mode1.$(OBJEXT) Mode2.$(OBJEXT) \
|
||||
Mode3.$(OBJEXT) Mode4.$(OBJEXT) Mode5.$(OBJEXT) RTC.$(OBJEXT) \
|
||||
Sound.$(OBJEXT) sram.$(OBJEXT)
|
||||
libgba_a_OBJECTS = $(am_libgba_a_OBJECTS)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
AM_V_lt = $(am__v_lt_$(V))
|
||||
am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_lt_0 = --silent
|
||||
LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
AM_V_CXX = $(am__v_CXX_$(V))
|
||||
am__v_CXX_ = $(am__v_CXX_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CXX_0 = @echo " CXX " $@;
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CXXLD = $(am__v_CXXLD_$(V))
|
||||
am__v_CXXLD_ = $(am__v_CXXLD_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_CXXLD_0 = @echo " CXXLD " $@;
|
||||
AM_V_GEN = $(am__v_GEN_$(V))
|
||||
am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
SOURCES = $(libgba_a_SOURCES)
|
||||
DIST_SOURCES = $(libgba_a_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /home/squarepusher/Downloads/mednafen/missing --run aclocal-1.11
|
||||
ALLOCA =
|
||||
ALSA_CFLAGS =
|
||||
ALSA_LIBS = -lasound -lm -ldl -lpthread
|
||||
AMTAR = $${TAR-tar}
|
||||
AM_CFLAGS = -fsigned-char -Wall -Winline -Wshadow -Wempty-body -Wignored-qualifiers -fno-fast-math -fno-unsafe-math-optimizations -fno-aggressive-loop-optimizations -fomit-frame-pointer -finline-limit=6000 --param large-function-growth=800 --param inline-unit-growth=175 --param max-inline-insns-single=10000 -fno-strict-overflow
|
||||
AM_CXXFLAGS = -fsigned-char -Wall -Winline -Wshadow -Wempty-body -Wignored-qualifiers -fno-fast-math -fno-unsafe-math-optimizations -fno-aggressive-loop-optimizations -fomit-frame-pointer -finline-limit=6000 --param large-function-growth=800 --param inline-unit-growth=175 --param max-inline-insns-single=10000 -fno-strict-overflow
|
||||
AM_DEFAULT_VERBOSITY = 1
|
||||
AR = ar
|
||||
AUTOCONF = ${SHELL} /home/squarepusher/Downloads/mednafen/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /home/squarepusher/Downloads/mednafen/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /home/squarepusher/Downloads/mednafen/missing --run automake-1.11
|
||||
AWK = gawk
|
||||
BUILD_INCLUDED_LIBINTL = no
|
||||
CATOBJEXT = .gmo
|
||||
CC = gcc
|
||||
CCAS = gcc
|
||||
CCASDEPMODE = depmode=gcc3
|
||||
CCASFLAGS = -g -O2
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -g -O2
|
||||
CFLAG_VISIBILITY = -fvisibility=hidden
|
||||
CPP = gcc -E
|
||||
CPPFLAGS =
|
||||
CXX = g++
|
||||
CXXCPP = g++ -E
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -g -O2
|
||||
CYGPATH_W = echo
|
||||
DATADIRNAME = share
|
||||
DEFS = -DLOCALEDIR=\"$(datadir)/locale\" -DHAVE_CONFIG_H -fno-unit-at-a-time
|
||||
DEPDIR = .deps
|
||||
DLLTOOL = false
|
||||
DSYMUTIL =
|
||||
DUMPBIN =
|
||||
ECHO_C =
|
||||
ECHO_N = -n
|
||||
ECHO_T =
|
||||
EGREP = /usr/bin/grep -E
|
||||
EXEEXT =
|
||||
FGREP = /usr/bin/grep -F
|
||||
GBA_EXTRA_FLAGS = -fno-unit-at-a-time
|
||||
GENCAT = gencat
|
||||
GETTEXT_MACRO_VERSION = 0.18
|
||||
GLIBC2 = yes
|
||||
GLIBC21 = yes
|
||||
GMSGFMT = /usr/bin/msgfmt
|
||||
GMSGFMT_015 = /usr/bin/msgfmt
|
||||
GREP = /usr/bin/grep
|
||||
HAVE_ASPRINTF = 1
|
||||
HAVE_NEWLOCALE = 1
|
||||
HAVE_POSIX_PRINTF = 1
|
||||
HAVE_SNPRINTF = 1
|
||||
HAVE_VISIBILITY = 1
|
||||
HAVE_WPRINTF = 0
|
||||
INSTALL = /usr/bin/install -c
|
||||
INSTALL_DATA = ${INSTALL} -m 644
|
||||
INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
|
||||
INSTOBJEXT = .mo
|
||||
INTLBISON = bison
|
||||
INTLLIBS =
|
||||
INTLOBJS =
|
||||
INTL_DEFAULT_VERBOSITY = 1
|
||||
INTL_LIBTOOL_SUFFIX_PREFIX =
|
||||
INTL_MACOSX_LIBS =
|
||||
JACK_CFLAGS =
|
||||
JACK_LIBS = -ljack -lpthread
|
||||
LD = /usr/bin/ld -m elf_x86_64
|
||||
LDFLAGS =
|
||||
LIBCDIO_CFLAGS =
|
||||
LIBCDIO_LIBS = -lcdio -lm
|
||||
LIBICONV =
|
||||
LIBINTL =
|
||||
LIBMULTITHREAD = -lpthread
|
||||
LIBOBJS =
|
||||
LIBPTH =
|
||||
LIBPTH_PREFIX =
|
||||
LIBS = -lsndfile -lcdio -lm -lz -lz -lasound -lm -ldl -lpthread -ljack -lpthread
|
||||
LIBTHREAD =
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
LIPO =
|
||||
LN_S = ln -s
|
||||
LTLIBC = -lc
|
||||
LTLIBICONV =
|
||||
LTLIBINTL =
|
||||
LTLIBMULTITHREAD = -lpthread
|
||||
LTLIBOBJS =
|
||||
LTLIBPTH =
|
||||
LTLIBTHREAD =
|
||||
MAKEINFO = ${SHELL} /home/squarepusher/Downloads/mednafen/missing --run makeinfo
|
||||
MANIFEST_TOOL = :
|
||||
MKDIR_P = /usr/bin/mkdir -p
|
||||
MMX_CFLAGS = -mmmx
|
||||
MSGFMT = /usr/bin/msgfmt
|
||||
MSGFMT_015 = /usr/bin/msgfmt
|
||||
MSGMERGE = /usr/bin/msgmerge
|
||||
NM = /usr/bin/nm -B
|
||||
NMEDIT =
|
||||
OBJDUMP = objdump
|
||||
OBJEXT = o
|
||||
OTOOL =
|
||||
OTOOL64 =
|
||||
PACKAGE = mednafen
|
||||
PACKAGE_BUGREPORT =
|
||||
PACKAGE_NAME =
|
||||
PACKAGE_STRING =
|
||||
PACKAGE_TARNAME =
|
||||
PACKAGE_URL =
|
||||
PACKAGE_VERSION =
|
||||
PATH_SEPARATOR = :
|
||||
PKG_CONFIG = /usr/bin/pkg-config
|
||||
PKG_CONFIG_LIBDIR =
|
||||
PKG_CONFIG_PATH =
|
||||
POSUB = po
|
||||
PRI_MACROS_BROKEN = 0
|
||||
RANLIB = ranlib
|
||||
SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
|
||||
SDL_CONFIG = /usr/bin/sdl-config
|
||||
SDL_LIBS = -L/usr/lib -lSDL -lpthread
|
||||
SED = /usr/bin/sed
|
||||
SET_MAKE =
|
||||
SHELL = /bin/sh
|
||||
SNDFILE_CFLAGS =
|
||||
SNDFILE_LIBS = -lsndfile
|
||||
SNES_EXTRA_CXXFLAGS =
|
||||
SNES_EXTRA_FLAGS = -Wno-unused -Wno-inline -Wno-shadow -Wno-sign-compare -Wno-ignored-qualifiers -Wno-uninitialized -Wno-parentheses -Wno-switch
|
||||
SNES_PERF_EXTRA_CXXFLAGS = -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize -fipa-cp-clone -fno-stack-protector
|
||||
SNES_PERF_EXTRA_FLAGS = -Wno-unused -Wno-inline -Wno-shadow -Wno-sign-compare -Wno-ignored-qualifiers -Wno-uninitialized -Wno-parentheses -Wno-switch
|
||||
SSE2_CFLAGS = -msse2
|
||||
SSE3_CFLAGS = -msse3
|
||||
SSE_CFLAGS = -msse
|
||||
STRIP = strip
|
||||
TRIO_CFLAGS =
|
||||
USE_INCLUDED_LIBINTL = no
|
||||
USE_NLS = yes
|
||||
VERSION = 0.9.33.3
|
||||
WARNING_FLAGS = -Wall -Winline -Wshadow -Wempty-body -Wignored-qualifiers
|
||||
WINDRES =
|
||||
WOE32 = no
|
||||
WOE32DLL = no
|
||||
XGETTEXT = /usr/bin/xgettext
|
||||
XGETTEXT_015 = /usr/bin/xgettext
|
||||
XGETTEXT_EXTRA_OPTIONS =
|
||||
abs_builddir = /home/squarepusher/Downloads/mednafen/src/gba
|
||||
abs_srcdir = /home/squarepusher/Downloads/mednafen/src/gba
|
||||
abs_top_builddir = /home/squarepusher/Downloads/mednafen
|
||||
abs_top_srcdir = /home/squarepusher/Downloads/mednafen
|
||||
ac_ct_AR = ar
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = g++
|
||||
ac_ct_DUMPBIN =
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
am__quote =
|
||||
am__tar = $${TAR-tar} chof - "$$tardir"
|
||||
am__untar = $${TAR-tar} xf -
|
||||
bindir = ${exec_prefix}/bin
|
||||
build = x86_64-unknown-linux-gnu
|
||||
build_alias =
|
||||
build_cpu = x86_64
|
||||
build_os = linux-gnu
|
||||
build_vendor = unknown
|
||||
builddir = .
|
||||
datadir = ${datarootdir}
|
||||
datarootdir = ${prefix}/share
|
||||
docdir = ${datarootdir}/doc/${PACKAGE}
|
||||
dvidir = ${docdir}
|
||||
exec_prefix = ${prefix}
|
||||
host = x86_64-unknown-linux-gnu
|
||||
host_alias =
|
||||
host_cpu = x86_64
|
||||
host_os = linux-gnu
|
||||
host_vendor = unknown
|
||||
htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /home/squarepusher/Downloads/mednafen/install-sh
|
||||
libdir = ${exec_prefix}/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
mandir = ${datarootdir}/man
|
||||
mkdir_p = /usr/bin/mkdir -p
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix = /usr/local
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
sharedstatedir = ${prefix}/com
|
||||
srcdir = .
|
||||
sysconfdir = ${prefix}/etc
|
||||
target = x86_64-unknown-linux-gnu
|
||||
target_alias =
|
||||
target_cpu = x86_64
|
||||
target_os = linux-gnu
|
||||
target_vendor = unknown
|
||||
top_build_prefix = ../../
|
||||
top_builddir = ../..
|
||||
top_srcdir = ../..
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/intl -I$(top_builddir)/include/blip -I$(top_srcdir)/src/hw_sound -I$(top_srcdir)
|
||||
noinst_LIBRARIES = libgba.a
|
||||
libgba_a_SOURCES = GBAinline.cpp arm.cpp thumb.cpp bios.cpp eeprom.cpp flash.cpp GBA.cpp Gfx.cpp Globals.cpp Mode0.cpp Mode1.cpp Mode2.cpp Mode3.cpp Mode4.cpp Mode5.cpp RTC.cpp Sound.cpp sram.cpp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gba/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/gba/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libgba.a: $(libgba_a_OBJECTS) $(libgba_a_DEPENDENCIES) $(EXTRA_libgba_a_DEPENDENCIES)
|
||||
$(AM_V_at)-rm -f libgba.a
|
||||
$(AM_V_AR)$(libgba_a_AR) libgba.a $(libgba_a_OBJECTS) $(libgba_a_LIBADD)
|
||||
$(AM_V_at)$(RANLIB) libgba.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
include ./$(DEPDIR)/GBA.Po
|
||||
include ./$(DEPDIR)/GBAinline.Po
|
||||
include ./$(DEPDIR)/Gfx.Po
|
||||
include ./$(DEPDIR)/Globals.Po
|
||||
include ./$(DEPDIR)/Mode0.Po
|
||||
include ./$(DEPDIR)/Mode1.Po
|
||||
include ./$(DEPDIR)/Mode2.Po
|
||||
include ./$(DEPDIR)/Mode3.Po
|
||||
include ./$(DEPDIR)/Mode4.Po
|
||||
include ./$(DEPDIR)/Mode5.Po
|
||||
include ./$(DEPDIR)/RTC.Po
|
||||
include ./$(DEPDIR)/Sound.Po
|
||||
include ./$(DEPDIR)/arm.Po
|
||||
include ./$(DEPDIR)/bios.Po
|
||||
include ./$(DEPDIR)/eeprom.Po
|
||||
include ./$(DEPDIR)/flash.Po
|
||||
include ./$(DEPDIR)/sram.Po
|
||||
include ./$(DEPDIR)/thumb.Po
|
||||
|
||||
.cpp.o:
|
||||
$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
$(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
# $(AM_V_CXX)source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
$(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
# $(AM_V_CXX)source='$<' object='$@' libtool=no \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CXX_no)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cpp.lo:
|
||||
$(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||
$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
$(am__mv) $$depbase.Tpo $$depbase.Plo
|
||||
# $(AM_V_CXX)source='$<' object='$@' libtool=yes \
|
||||
# DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
|
||||
# $(AM_V_CXX_no)$(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
6
mednafen/gba-09333/Makefile.am
Normal file
6
mednafen/gba-09333/Makefile.am
Normal file
@ -0,0 +1,6 @@
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
DEFS = -DLOCALEDIR=\"$(datadir)/locale\" @DEFS@ @GBA_EXTRA_FLAGS@
|
||||
DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/intl -I$(top_builddir)/include/blip -I$(top_srcdir)/src/hw_sound -I$(top_srcdir)
|
||||
|
||||
noinst_LIBRARIES = libgba.a
|
||||
libgba_a_SOURCES = GBAinline.cpp arm.cpp thumb.cpp bios.cpp eeprom.cpp flash.cpp GBA.cpp Gfx.cpp Globals.cpp Mode0.cpp Mode1.cpp Mode2.cpp Mode3.cpp Mode4.cpp Mode5.cpp RTC.cpp Sound.cpp sram.cpp
|
644
mednafen/gba-09333/Makefile.in
Normal file
644
mednafen/gba-09333/Makefile.in
Normal file
@ -0,0 +1,644 @@
|
||||
# Makefile.in generated by automake 1.11.6 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
|
||||
# Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
am__make_dryrun = \
|
||||
{ \
|
||||
am__dry=no; \
|
||||
case $$MAKEFLAGS in \
|
||||
*\\[\ \ ]*) \
|
||||
echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
|
||||
| grep '^AM OK$$' >/dev/null || am__dry=yes;; \
|
||||
*) \
|
||||
for am__flg in $$MAKEFLAGS; do \
|
||||
case $$am__flg in \
|
||||
*=*|--*) ;; \
|
||||
*n*) am__dry=yes; break;; \
|
||||
esac; \
|
||||
done;; \
|
||||
esac; \
|
||||
test $$am__dry = yes; \
|
||||
}
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = src/gba
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cflags_gcc_option.m4 \
|
||||
$(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/fcntl-o.m4 \
|
||||
$(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/glibc2.m4 \
|
||||
$(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/iconv.m4 \
|
||||
$(top_srcdir)/m4/intdiv0.m4 $(top_srcdir)/m4/intl.m4 \
|
||||
$(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax.m4 \
|
||||
$(top_srcdir)/m4/inttypes-pri.m4 \
|
||||
$(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/lcmessage.m4 \
|
||||
$(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
|
||||
$(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libtool.m4 \
|
||||
$(top_srcdir)/m4/lock.m4 $(top_srcdir)/m4/longlong.m4 \
|
||||
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
|
||||
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
|
||||
$(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \
|
||||
$(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \
|
||||
$(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \
|
||||
$(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/uintmax_t.m4 \
|
||||
$(top_srcdir)/m4/visibility.m4 $(top_srcdir)/m4/wchar_t.m4 \
|
||||
$(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \
|
||||
$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
LIBRARIES = $(noinst_LIBRARIES)
|
||||
ARFLAGS = cru
|
||||
AM_V_AR = $(am__v_AR_@AM_V@)
|
||||
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
|
||||
am__v_AR_0 = @echo " AR " $@;
|
||||
AM_V_at = $(am__v_at_@AM_V@)
|
||||
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
||||
am__v_at_0 = @
|
||||
libgba_a_AR = $(AR) $(ARFLAGS)
|
||||
libgba_a_LIBADD =
|
||||
am_libgba_a_OBJECTS = GBAinline.$(OBJEXT) arm.$(OBJEXT) \
|
||||
thumb.$(OBJEXT) bios.$(OBJEXT) eeprom.$(OBJEXT) \
|
||||
flash.$(OBJEXT) GBA.$(OBJEXT) Gfx.$(OBJEXT) Globals.$(OBJEXT) \
|
||||
Mode0.$(OBJEXT) Mode1.$(OBJEXT) Mode2.$(OBJEXT) \
|
||||
Mode3.$(OBJEXT) Mode4.$(OBJEXT) Mode5.$(OBJEXT) RTC.$(OBJEXT) \
|
||||
Sound.$(OBJEXT) sram.$(OBJEXT)
|
||||
libgba_a_OBJECTS = $(am_libgba_a_OBJECTS)
|
||||
depcomp = $(SHELL) $(top_srcdir)/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
am__mv = mv -f
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
AM_V_lt = $(am__v_lt_@AM_V@)
|
||||
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
|
||||
am__v_lt_0 = --silent
|
||||
LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
|
||||
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
|
||||
$(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
AM_V_CXX = $(am__v_CXX_@AM_V@)
|
||||
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
|
||||
am__v_CXX_0 = @echo " CXX " $@;
|
||||
CXXLD = $(CXX)
|
||||
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
|
||||
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
|
||||
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
|
||||
am__v_CXXLD_0 = @echo " CXXLD " $@;
|
||||
AM_V_GEN = $(am__v_GEN_@AM_V@)
|
||||
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
|
||||
am__v_GEN_0 = @echo " GEN " $@;
|
||||
SOURCES = $(libgba_a_SOURCES)
|
||||
DIST_SOURCES = $(libgba_a_SOURCES)
|
||||
am__can_run_installinfo = \
|
||||
case $$AM_UPDATE_INFO_DIR in \
|
||||
n|no|NO) false;; \
|
||||
*) (install-info --version) >/dev/null 2>&1;; \
|
||||
esac
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALSA_CFLAGS = @ALSA_CFLAGS@
|
||||
ALSA_LIBS = @ALSA_LIBS@
|
||||
AMTAR = @AMTAR@
|
||||
AM_CFLAGS = @AM_CFLAGS@
|
||||
AM_CXXFLAGS = @AM_CXXFLAGS@
|
||||
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
|
||||
CATOBJEXT = @CATOBJEXT@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASDEPMODE = @CCASDEPMODE@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DATADIRNAME = @DATADIRNAME@
|
||||
DEFS = -DLOCALEDIR=\"$(datadir)/locale\" @DEFS@ @GBA_EXTRA_FLAGS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GBA_EXTRA_FLAGS = @GBA_EXTRA_FLAGS@
|
||||
GENCAT = @GENCAT@
|
||||
GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
|
||||
GLIBC2 = @GLIBC2@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
GMSGFMT_015 = @GMSGFMT_015@
|
||||
GREP = @GREP@
|
||||
HAVE_ASPRINTF = @HAVE_ASPRINTF@
|
||||
HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
|
||||
HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@
|
||||
HAVE_SNPRINTF = @HAVE_SNPRINTF@
|
||||
HAVE_VISIBILITY = @HAVE_VISIBILITY@
|
||||
HAVE_WPRINTF = @HAVE_WPRINTF@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
INSTOBJEXT = @INSTOBJEXT@
|
||||
INTLBISON = @INTLBISON@
|
||||
INTLLIBS = @INTLLIBS@
|
||||
INTLOBJS = @INTLOBJS@
|
||||
INTL_DEFAULT_VERBOSITY = @INTL_DEFAULT_VERBOSITY@
|
||||
INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
|
||||
INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
|
||||
JACK_CFLAGS = @JACK_CFLAGS@
|
||||
JACK_LIBS = @JACK_LIBS@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBCDIO_CFLAGS = @LIBCDIO_CFLAGS@
|
||||
LIBCDIO_LIBS = @LIBCDIO_LIBS@
|
||||
LIBICONV = @LIBICONV@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBMULTITHREAD = @LIBMULTITHREAD@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPTH = @LIBPTH@
|
||||
LIBPTH_PREFIX = @LIBPTH_PREFIX@
|
||||
LIBS = @LIBS@
|
||||
LIBTHREAD = @LIBTHREAD@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBC = @LTLIBC@
|
||||
LTLIBICONV = @LTLIBICONV@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LTLIBPTH = @LTLIBPTH@
|
||||
LTLIBTHREAD = @LTLIBTHREAD@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
MMX_CFLAGS = @MMX_CFLAGS@
|
||||
MSGFMT = @MSGFMT@
|
||||
MSGFMT_015 = @MSGFMT_015@
|
||||
MSGMERGE = @MSGMERGE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
|
||||
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
|
||||
POSUB = @POSUB@
|
||||
PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
|
||||
RANLIB = @RANLIB@
|
||||
SDL_CFLAGS = @SDL_CFLAGS@
|
||||
SDL_CONFIG = @SDL_CONFIG@
|
||||
SDL_LIBS = @SDL_LIBS@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
SNDFILE_CFLAGS = @SNDFILE_CFLAGS@
|
||||
SNDFILE_LIBS = @SNDFILE_LIBS@
|
||||
SNES_EXTRA_CXXFLAGS = @SNES_EXTRA_CXXFLAGS@
|
||||
SNES_EXTRA_FLAGS = @SNES_EXTRA_FLAGS@
|
||||
SNES_PERF_EXTRA_CXXFLAGS = @SNES_PERF_EXTRA_CXXFLAGS@
|
||||
SNES_PERF_EXTRA_FLAGS = @SNES_PERF_EXTRA_FLAGS@
|
||||
SSE2_CFLAGS = @SSE2_CFLAGS@
|
||||
SSE3_CFLAGS = @SSE3_CFLAGS@
|
||||
SSE_CFLAGS = @SSE_CFLAGS@
|
||||
STRIP = @STRIP@
|
||||
TRIO_CFLAGS = @TRIO_CFLAGS@
|
||||
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
WARNING_FLAGS = @WARNING_FLAGS@
|
||||
WINDRES = @WINDRES@
|
||||
WOE32 = @WOE32@
|
||||
WOE32DLL = @WOE32DLL@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
XGETTEXT_015 = @XGETTEXT_015@
|
||||
XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
DEFAULT_INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/intl -I$(top_builddir)/include/blip -I$(top_srcdir)/src/hw_sound -I$(top_srcdir)
|
||||
noinst_LIBRARIES = libgba.a
|
||||
libgba_a_SOURCES = GBAinline.cpp arm.cpp thumb.cpp bios.cpp eeprom.cpp flash.cpp GBA.cpp Gfx.cpp Globals.cpp Mode0.cpp Mode1.cpp Mode2.cpp Mode3.cpp Mode4.cpp Mode5.cpp RTC.cpp Sound.cpp sram.cpp
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .cpp .lo .o .obj
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gba/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu src/gba/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
clean-noinstLIBRARIES:
|
||||
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
|
||||
libgba.a: $(libgba_a_OBJECTS) $(libgba_a_DEPENDENCIES) $(EXTRA_libgba_a_DEPENDENCIES)
|
||||
$(AM_V_at)-rm -f libgba.a
|
||||
$(AM_V_AR)$(libgba_a_AR) libgba.a $(libgba_a_OBJECTS) $(libgba_a_LIBADD)
|
||||
$(AM_V_at)$(RANLIB) libgba.a
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GBA.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GBAinline.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Gfx.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Globals.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mode0.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mode1.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mode2.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mode3.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mode4.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Mode5.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RTC.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Sound.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arm.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bios.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eeprom.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flash.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sram.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thumb.Po@am__quote@
|
||||
|
||||
.cpp.o:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
|
||||
|
||||
.cpp.obj:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
|
||||
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
|
||||
|
||||
.cpp.lo:
|
||||
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
|
||||
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
|
||||
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
dist_files=`for file in $$list; do echo $$file; done | \
|
||||
sed -e "s|^$$srcdirstrip/||;t" \
|
||||
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
|
||||
case $$dist_files in \
|
||||
*/*) $(MKDIR_P) `echo "$$dist_files" | \
|
||||
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
|
||||
sort -u` ;; \
|
||||
esac; \
|
||||
for file in $$dist_files; do \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test -d "$(distdir)/$$file"; then \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
|
||||
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
|
||||
fi; \
|
||||
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
|
||||
else \
|
||||
test -f "$(distdir)/$$file" \
|
||||
|| cp -p $$d/$$file "$(distdir)/$$file" \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LIBRARIES)
|
||||
installdirs:
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
if test -z '$(STRIP)'; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
install; \
|
||||
else \
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
|
||||
fi
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am:
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-noinstLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am html html-am info info-am \
|
||||
install install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
|
||||
pdf pdf-am ps ps-am tags uninstall uninstall-am
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
558
mednafen/gba-09333/Mode0.cpp
Normal file
558
mednafen/gba-09333/Mode0.cpp
Normal file
@ -0,0 +1,558 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "Gfx.h"
|
||||
#include "gfx-draw.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
void mode0RenderLine()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0100) {
|
||||
gfxDrawTextScreen(BG0CNT, BGHOFS[0], BGVOFS[0], line0);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0200) {
|
||||
gfxDrawTextScreen(BG1CNT, BGHOFS[1], BGVOFS[1], line1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
gfxDrawTextScreen(BG2CNT, BGHOFS[2], BGVOFS[2], line2);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0800) {
|
||||
gfxDrawTextScreen(BG3CNT, BGHOFS[3], BGVOFS[3], line3);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line0[x] < color) {
|
||||
color = line0[x];
|
||||
top = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (color & 0xFF000000)) {
|
||||
color = line1[x];
|
||||
top = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (color & 0xFF000000)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (color & 0xFF000000)) {
|
||||
color = line3[x];
|
||||
top = 0x08;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if((top & 0x10) && (color & 0x00010000)) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line0[x] < (back & 0xFF000000)) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (back & 0xFF000000)) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (back & 0xFF000000)) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
}
|
||||
|
||||
void mode0RenderLineNoWindow()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0100) {
|
||||
gfxDrawTextScreen(BG0CNT, BGHOFS[0], BGVOFS[0], line0);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0200) {
|
||||
gfxDrawTextScreen(BG1CNT, BGHOFS[1], BGVOFS[1], line1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
gfxDrawTextScreen(BG2CNT, BGHOFS[2], BGVOFS[2], line2);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0800) {
|
||||
gfxDrawTextScreen(BG3CNT, BGHOFS[3], BGVOFS[3], line3);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
int effect = (BLDMOD >> 6) & 3;
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line0[x] < color) {
|
||||
color = line0[x];
|
||||
top = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (color & 0xFF000000)) {
|
||||
color = line1[x];
|
||||
top = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (color & 0xFF000000)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (color & 0xFF000000)) {
|
||||
color = line3[x];
|
||||
top = 0x08;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(!(color & 0x00010000)) {
|
||||
switch(effect) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
if(line0[x] < back) {
|
||||
if(top != 0x01) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
}
|
||||
|
||||
if(line1[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x02) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
}
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if(line3[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x08) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line0[x] < back) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (back & 0xFF000000)) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (back & 0xFF000000)) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
}
|
||||
|
||||
void mode0RenderLineAll()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool inWindow0 = false;
|
||||
bool inWindow1 = false;
|
||||
|
||||
if(layerEnable & 0x2000) {
|
||||
uint8 v0 = WIN0V >> 8;
|
||||
uint8 v1 = WIN0V & 255;
|
||||
inWindow0 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow0 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow0 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
if(layerEnable & 0x4000) {
|
||||
uint8 v0 = WIN1V >> 8;
|
||||
uint8 v1 = WIN1V & 255;
|
||||
inWindow1 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow1 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow1 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
|
||||
if((layerEnable & 0x0100)) {
|
||||
gfxDrawTextScreen(BG0CNT, BGHOFS[0], BGVOFS[0], line0);
|
||||
}
|
||||
|
||||
if((layerEnable & 0x0200)) {
|
||||
gfxDrawTextScreen(BG1CNT, BGHOFS[1], BGVOFS[1], line1);
|
||||
}
|
||||
|
||||
if((layerEnable & 0x0400)) {
|
||||
gfxDrawTextScreen(BG2CNT, BGHOFS[2], BGVOFS[2], line2);
|
||||
}
|
||||
|
||||
if((layerEnable & 0x0800)) {
|
||||
gfxDrawTextScreen(BG3CNT, BGHOFS[3], BGVOFS[3], line3);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
gfxDrawOBJWin();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
uint8 inWin0Mask = WININ & 0xFF;
|
||||
uint8 inWin1Mask = WININ >> 8;
|
||||
uint8 outMask = WINOUT & 0xFF;
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
uint8 mask = outMask;
|
||||
|
||||
if(!(lineOBJWin[x] & 0x80000000)) {
|
||||
mask = WINOUT >> 8;
|
||||
}
|
||||
|
||||
if(inWindow1) {
|
||||
if(gfxInWin1[x])
|
||||
mask = inWin1Mask;
|
||||
}
|
||||
|
||||
if(inWindow0) {
|
||||
if(gfxInWin0[x]) {
|
||||
mask = inWin0Mask;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 1) && (line0[x] < color)) {
|
||||
color = line0[x];
|
||||
top = 0x01;
|
||||
}
|
||||
|
||||
if((mask & 2) && (line1[x] < (color & 0xFF000000))) {
|
||||
color = line1[x];
|
||||
top = 0x02;
|
||||
}
|
||||
|
||||
if((mask & 4) && (line2[x] < (color & 0xFF000000))) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 8) && (line3[x] < (color & 0xFF000000))) {
|
||||
color = line3[x];
|
||||
top = 0x08;
|
||||
}
|
||||
|
||||
if((mask & 16) && (lineOBJ[x] < (color & 0xFF000000))) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
// special FX on in the window
|
||||
if(mask & 32) {
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
if((mask & 1) && line0[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x01) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 2) && line1[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x02) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 4) && line2[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 8) && line3[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x08) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 16) && lineOBJ[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 1) && (line0[x] < (back & 0xFF000000))) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if((mask & 2) && (line1[x] < (back & 0xFF000000))) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if((mask & 4) && (line2[x] < (back & 0xFF000000))) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 8) && (line3[x] < (back & 0xFF000000))) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(color & 0x00010000) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 1) && (line0[x] < (back & 0xFF000000))) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if((mask & 2) && (line1[x] < (back & 0xFF000000))) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if((mask & 4) && (line2[x] < (back & 0xFF000000))) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 8) && (line3[x] < (back & 0xFF000000))) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
519
mednafen/gba-09333/Mode1.cpp
Normal file
519
mednafen/gba-09333/Mode1.cpp
Normal file
@ -0,0 +1,519 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "Gfx.h"
|
||||
#include "gfx-draw.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
void mode1RenderLine()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0100) {
|
||||
gfxDrawTextScreen(BG0CNT, BGHOFS[0], BGVOFS[0], line0);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0200) {
|
||||
gfxDrawTextScreen(BG1CNT, BGHOFS[1], BGVOFS[1], line1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
gfxDrawRotScreen(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed, line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line0[x] < color) {
|
||||
color = line0[x];
|
||||
top = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (color & 0xFF000000)) {
|
||||
color = line1[x];
|
||||
top = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (color & 0xFF000000)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if((top & 0x10) && (color & 0x00010000)) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line0[x] < (back & 0xFF000000)) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (back & 0xFF000000)) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode1RenderLineNoWindow()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0100) {
|
||||
gfxDrawTextScreen(BG0CNT, BGHOFS[0], BGVOFS[0], line0);
|
||||
}
|
||||
|
||||
|
||||
if(layerEnable & 0x0200) {
|
||||
gfxDrawTextScreen(BG1CNT, BGHOFS[1], BGVOFS[1], line1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
gfxDrawRotScreen(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed, line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line0[x] < color) {
|
||||
color = line0[x];
|
||||
top = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (color & 0xFF000000)) {
|
||||
color = line1[x];
|
||||
top = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (color & 0xFF000000)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
if(line0[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x01) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
}
|
||||
|
||||
if(line1[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x02) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
}
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line0[x] < (back & 0xFF000000)) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (back & 0xFF000000)) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode1RenderLineAll()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
bool inWindow0 = false;
|
||||
bool inWindow1 = false;
|
||||
|
||||
if(layerEnable & 0x2000) {
|
||||
uint8 v0 = WIN0V >> 8;
|
||||
uint8 v1 = WIN0V & 255;
|
||||
inWindow0 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow0 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow0 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
if(layerEnable & 0x4000) {
|
||||
uint8 v0 = WIN1V >> 8;
|
||||
uint8 v1 = WIN1V & 255;
|
||||
inWindow1 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow1 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow1 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0100) {
|
||||
gfxDrawTextScreen(BG0CNT, BGHOFS[0], BGVOFS[0], line0);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0200) {
|
||||
gfxDrawTextScreen(BG1CNT, BGHOFS[1], BGVOFS[1], line1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
gfxDrawRotScreen(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed, line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
gfxDrawOBJWin();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
uint8 inWin0Mask = WININ & 0xFF;
|
||||
uint8 inWin1Mask = WININ >> 8;
|
||||
uint8 outMask = WINOUT & 0xFF;
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
uint8 mask = outMask;
|
||||
|
||||
if(!(lineOBJWin[x] & 0x80000000)) {
|
||||
mask = WINOUT >> 8;
|
||||
}
|
||||
|
||||
if(inWindow1) {
|
||||
if(gfxInWin1[x])
|
||||
mask = inWin1Mask;
|
||||
}
|
||||
|
||||
if(inWindow0) {
|
||||
if(gfxInWin0[x]) {
|
||||
mask = inWin0Mask;
|
||||
}
|
||||
}
|
||||
|
||||
if(line0[x] < color && (mask & 1)) {
|
||||
color = line0[x];
|
||||
top = 0x01;
|
||||
}
|
||||
|
||||
if(line1[x] < (color & 0xFF000000) && (mask & 2)) {
|
||||
color = line1[x];
|
||||
top = 0x02;
|
||||
}
|
||||
|
||||
if(line2[x] < (color & 0xFF000000) && (mask & 4)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000) && (mask & 16)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
// special FX on the window
|
||||
if(mask & 32) {
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
if((mask & 1) && line0[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x01) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 2) && line1[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x02) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 4) && line2[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 16) && lineOBJ[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 1) && line0[x] < (back & 0xFF000000)) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if((mask & 2) && line1[x] < (back & 0xFF000000)) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if((mask & 4) && line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(color & 0x00010000) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 1) && line0[x] < (back & 0xFF000000)) {
|
||||
back = line0[x];
|
||||
top2 = 0x01;
|
||||
}
|
||||
|
||||
if((mask & 2) && line1[x] < (back & 0xFF000000)) {
|
||||
back = line1[x];
|
||||
top2 = 0x02;
|
||||
}
|
||||
|
||||
if((mask & 4) && line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
}
|
484
mednafen/gba-09333/Mode2.cpp
Normal file
484
mednafen/gba-09333/Mode2.cpp
Normal file
@ -0,0 +1,484 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "Gfx.h"
|
||||
#include "gfx-draw.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
void mode2RenderLine()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD, gfxBG2X, gfxBG2Y,
|
||||
changed, line2);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0800) {
|
||||
int changed = gfxBG3Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen(BG3CNT, BG3X_L, BG3X_H, BG3Y_L, BG3Y_H,
|
||||
BG3PA, BG3PB, BG3PC, BG3PD, gfxBG3X, gfxBG3Y,
|
||||
changed, line3);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
|
||||
if(line2[x] < (color & 0xFF000000)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (color & 0xFF000000)) {
|
||||
color = line3[x];
|
||||
top = 0x08;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if((top & 0x10) && (color & 0x00010000)) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (back & 0xFF000000)) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxBG3Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode2RenderLineNoWindow()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD, gfxBG2X, gfxBG2Y,
|
||||
changed, line2);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0800) {
|
||||
int changed = gfxBG3Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen(BG3CNT, BG3X_L, BG3X_H, BG3Y_L, BG3Y_H,
|
||||
BG3PA, BG3PB, BG3PC, BG3PD, gfxBG3X, gfxBG3Y,
|
||||
changed, line3);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
|
||||
if(line2[x] < (color & 0xFF000000)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (color & 0xFF000000)) {
|
||||
color = line3[x];
|
||||
top = 0x08;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if(line3[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x08) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < (back & 0xFF000000)) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (back & 0xFF000000)) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxBG3Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode2RenderLineAll()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
bool inWindow0 = false;
|
||||
bool inWindow1 = false;
|
||||
|
||||
if(layerEnable & 0x2000) {
|
||||
uint8 v0 = WIN0V >> 8;
|
||||
uint8 v1 = WIN0V & 255;
|
||||
inWindow0 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow0 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow0 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
if(layerEnable & 0x4000) {
|
||||
uint8 v0 = WIN1V >> 8;
|
||||
uint8 v1 = WIN1V & 255;
|
||||
inWindow1 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow1 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow1 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD, gfxBG2X, gfxBG2Y,
|
||||
changed, line2);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0800) {
|
||||
int changed = gfxBG3Changed;
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen(BG3CNT, BG3X_L, BG3X_H, BG3Y_L, BG3Y_H,
|
||||
BG3PA, BG3PB, BG3PC, BG3PD, gfxBG3X, gfxBG3Y,
|
||||
changed, line3);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
gfxDrawOBJWin();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
uint8 inWin0Mask = WININ & 0xFF;
|
||||
uint8 inWin1Mask = WININ >> 8;
|
||||
uint8 outMask = WINOUT & 0xFF;
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
uint8 mask = outMask;
|
||||
|
||||
if(!(lineOBJWin[x] & 0x80000000)) {
|
||||
mask = WINOUT >> 8;
|
||||
}
|
||||
|
||||
if(inWindow1) {
|
||||
if(gfxInWin1[x])
|
||||
mask = inWin1Mask;
|
||||
}
|
||||
|
||||
if(inWindow0) {
|
||||
if(gfxInWin0[x]) {
|
||||
mask = inWin0Mask;
|
||||
}
|
||||
}
|
||||
|
||||
if(line2[x] < color && (mask & 4)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if(line3[x] < (color & 0xFF000000) && (mask & 8)) {
|
||||
color = line3[x];
|
||||
top = 0x08;
|
||||
}
|
||||
|
||||
if(lineOBJ[x] < (color & 0xFF000000) && (mask & 16)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(mask & 32) {
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 8) && line3[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x08) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 16) && lineOBJ[x] < (back & 0xFF000000)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 8) && line3[x] < (back & 0xFF000000)) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(color & 0x00010000) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 8) && line3[x] < (back & 0xFF000000)) {
|
||||
back = line3[x];
|
||||
top2 = 0x08;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxBG3Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
}
|
411
mednafen/gba-09333/Mode3.cpp
Normal file
411
mednafen/gba-09333/Mode3.cpp
Normal file
@ -0,0 +1,411 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "Gfx.h"
|
||||
#include "gfx-draw.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
void mode3RenderLine()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen16Bit(BG2CNT, BG2X_L, BG2X_H,
|
||||
BG2Y_L, BG2Y_H, BG2PA, BG2PB,
|
||||
BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 background = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = background;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line2[x] < color) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(color >>24)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if((top & 0x10) && (color & 0x00010000)) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode3RenderLineNoWindow()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen16Bit(BG2CNT, BG2X_L, BG2X_H,
|
||||
BG2Y_L, BG2Y_H, BG2PA, BG2PB,
|
||||
BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 background = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = background;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line2[x] < color) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(color >>24)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(back >> 24)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode3RenderLineAll()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x80) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
bool inWindow0 = false;
|
||||
bool inWindow1 = false;
|
||||
|
||||
if(layerEnable & 0x2000) {
|
||||
uint8 v0 = WIN0V >> 8;
|
||||
uint8 v1 = WIN0V & 255;
|
||||
inWindow0 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow0 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow0 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
if(layerEnable & 0x4000) {
|
||||
uint8 v0 = WIN1V >> 8;
|
||||
uint8 v1 = WIN1V & 255;
|
||||
inWindow1 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow1 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow1 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen16Bit(BG2CNT, BG2X_L, BG2X_H,
|
||||
BG2Y_L, BG2Y_H, BG2PA, BG2PB,
|
||||
BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
gfxDrawOBJWin();
|
||||
|
||||
uint8 inWin0Mask = WININ & 0xFF;
|
||||
uint8 inWin1Mask = WININ >> 8;
|
||||
uint8 outMask = WINOUT & 0xFF;
|
||||
|
||||
uint32 background = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = background;
|
||||
uint8 top = 0x20;
|
||||
uint8 mask = outMask;
|
||||
|
||||
if(!(lineOBJWin[x] & 0x80000000)) {
|
||||
mask = WINOUT >> 8;
|
||||
}
|
||||
|
||||
if(inWindow1) {
|
||||
if(gfxInWin1[x])
|
||||
mask = inWin1Mask;
|
||||
}
|
||||
|
||||
if(inWindow0) {
|
||||
if(gfxInWin0[x]) {
|
||||
mask = inWin0Mask;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 4) && (line2[x] < color)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 16) && ((uint8)(lineOBJ[x]>>24) < (uint8)(color >>24))) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(mask & 32) {
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 16) && (uint8)(lineOBJ[x]>>24) < (uint8)(back >> 24)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(color & 0x00010000) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
}
|
407
mednafen/gba-09333/Mode4.cpp
Normal file
407
mednafen/gba-09333/Mode4.cpp
Normal file
@ -0,0 +1,407 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Gfx.h"
|
||||
#include "Globals.h"
|
||||
#include "gfx-draw.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
void mode4RenderLine()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x0080) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
gfxDrawRotScreen256(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line2[x] < color) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(color >> 24)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if((top & 0x10) && (color & 0x00010000)) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode4RenderLineNoWindow()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x0080) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
if(layerEnable & 0x400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen256(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line2[x] < color) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(color >> 24)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(back >> 24)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode4RenderLineAll()
|
||||
{
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(DISPCNT & 0x0080) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
bool inWindow0 = false;
|
||||
bool inWindow1 = false;
|
||||
|
||||
if(layerEnable & 0x2000) {
|
||||
uint8 v0 = WIN0V >> 8;
|
||||
uint8 v1 = WIN0V & 255;
|
||||
inWindow0 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow0 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow0 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
if(layerEnable & 0x4000) {
|
||||
uint8 v0 = WIN1V >> 8;
|
||||
uint8 v1 = WIN1V & 255;
|
||||
inWindow1 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow1 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow1 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
|
||||
if(layerEnable & 0x400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen256(BG2CNT, BG2X_L, BG2X_H, BG2Y_L, BG2Y_H,
|
||||
BG2PA, BG2PB, BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
gfxDrawOBJWin();
|
||||
|
||||
uint32 backdrop = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
uint8 inWin0Mask = WININ & 0xFF;
|
||||
uint8 inWin1Mask = WININ >> 8;
|
||||
uint8 outMask = WINOUT & 0xFF;
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = backdrop;
|
||||
uint8 top = 0x20;
|
||||
uint8 mask = outMask;
|
||||
|
||||
if(!(lineOBJWin[x] & 0x80000000)) {
|
||||
mask = WINOUT >> 8;
|
||||
}
|
||||
|
||||
if(inWindow1) {
|
||||
if(gfxInWin1[x])
|
||||
mask = inWin1Mask;
|
||||
}
|
||||
|
||||
if(inWindow0) {
|
||||
if(gfxInWin0[x]) {
|
||||
mask = inWin0Mask;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 4) && (line2[x] < color)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 16) && ((uint8)(lineOBJ[x]>>24) < (uint8)(color >>24))) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(mask & 32) {
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 16) && (uint8)(lineOBJ[x]>>24) < (uint8)(back >> 24)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(color & 0x00010000) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = backdrop;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
}
|
411
mednafen/gba-09333/Mode5.cpp
Normal file
411
mednafen/gba-09333/Mode5.cpp
Normal file
@ -0,0 +1,411 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "Gfx.h"
|
||||
#include "gfx-draw.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
void mode5RenderLine()
|
||||
{
|
||||
if(DISPCNT & 0x0080) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen16Bit160(BG2CNT, BG2X_L, BG2X_H,
|
||||
BG2Y_L, BG2Y_H, BG2PA, BG2PB,
|
||||
BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 background = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = background;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line2[x] < color) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(color >>24)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if((top & 0x10) && (color & 0x00010000)) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode5RenderLineNoWindow()
|
||||
{
|
||||
if(DISPCNT & 0x0080) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen16Bit160(BG2CNT, BG2X_L, BG2X_H,
|
||||
BG2Y_L, BG2Y_H, BG2PA, BG2PB,
|
||||
BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
|
||||
uint32 background = ( READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = background;
|
||||
uint8 top = 0x20;
|
||||
|
||||
if(line2[x] < color) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(color >>24)) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((uint8)(lineOBJ[x]>>24) < (uint8)(back >> 24)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if(line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
void mode5RenderLineAll()
|
||||
{
|
||||
if(DISPCNT & 0x0080) {
|
||||
for(int x = 0; x < 240; x++) {
|
||||
lineMix[x] = 0x7fff;
|
||||
}
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
return;
|
||||
}
|
||||
|
||||
uint16 *palette = (uint16 *)paletteRAM;
|
||||
|
||||
if(layerEnable & 0x0400) {
|
||||
int changed = gfxBG2Changed;
|
||||
|
||||
if(gfxLastVCOUNT > VCOUNT)
|
||||
changed = 3;
|
||||
|
||||
gfxDrawRotScreen16Bit160(BG2CNT, BG2X_L, BG2X_H,
|
||||
BG2Y_L, BG2Y_H, BG2PA, BG2PB,
|
||||
BG2PC, BG2PD,
|
||||
gfxBG2X, gfxBG2Y, changed,
|
||||
line2);
|
||||
}
|
||||
|
||||
gfxDrawSprites();
|
||||
gfxDrawOBJWin();
|
||||
|
||||
bool inWindow0 = false;
|
||||
bool inWindow1 = false;
|
||||
|
||||
if(layerEnable & 0x2000) {
|
||||
uint8 v0 = WIN0V >> 8;
|
||||
uint8 v1 = WIN0V & 255;
|
||||
inWindow0 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow0 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow0 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
if(layerEnable & 0x4000) {
|
||||
uint8 v0 = WIN1V >> 8;
|
||||
uint8 v1 = WIN1V & 255;
|
||||
inWindow1 = ((v0 == v1) && (v0 >= 0xe8));
|
||||
if(v1 >= v0)
|
||||
inWindow1 |= (VCOUNT >= v0 && VCOUNT < v1);
|
||||
else
|
||||
inWindow1 |= (VCOUNT >= v0 || VCOUNT < v1);
|
||||
}
|
||||
|
||||
uint8 inWin0Mask = WININ & 0xFF;
|
||||
uint8 inWin1Mask = WININ >> 8;
|
||||
uint8 outMask = WINOUT & 0xFF;
|
||||
|
||||
uint32 background = (READ16LE(&palette[0]) | 0x30000000);
|
||||
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = background;
|
||||
uint8 top = 0x20;
|
||||
uint8 mask = outMask;
|
||||
|
||||
if(!(lineOBJWin[x] & 0x80000000)) {
|
||||
mask = WINOUT >> 8;
|
||||
}
|
||||
|
||||
if(inWindow1) {
|
||||
if(gfxInWin1[x])
|
||||
mask = inWin1Mask;
|
||||
}
|
||||
|
||||
if(inWindow0) {
|
||||
if(gfxInWin0[x]) {
|
||||
mask = inWin0Mask;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 4) && (line2[x] < color)) {
|
||||
color = line2[x];
|
||||
top = 0x04;
|
||||
}
|
||||
|
||||
if((mask & 16) && ((uint8)(lineOBJ[x]>>24) < (uint8)(color >>24))) {
|
||||
color = lineOBJ[x];
|
||||
top = 0x10;
|
||||
}
|
||||
|
||||
if(mask & 32) {
|
||||
if(!(color & 0x00010000)) {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
if(top & BLDMOD) {
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
if(top != 0x04) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
}
|
||||
|
||||
if((mask & 16) && (uint8)(lineOBJ[x]>>24) < (uint8)(back >> 24)) {
|
||||
if(top != 0x10) {
|
||||
back = lineOBJ[x];
|
||||
top2 = 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(color & 0x00010000) {
|
||||
// semi-transparent OBJ
|
||||
uint32 back = background;
|
||||
uint8 top2 = 0x20;
|
||||
|
||||
if((mask & 4) && line2[x] < back) {
|
||||
back = line2[x];
|
||||
top2 = 0x04;
|
||||
}
|
||||
|
||||
if(top2 & (BLDMOD>>8))
|
||||
color = gfxAlphaBlend(color, back,
|
||||
all_coeff[COLEV & 0x1F],
|
||||
all_coeff[(COLEV >> 8) & 0x1F]);
|
||||
else {
|
||||
switch((BLDMOD >> 6) & 3) {
|
||||
case 2:
|
||||
if(BLDMOD & top)
|
||||
color = gfxIncreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
case 3:
|
||||
if(BLDMOD & top)
|
||||
color = gfxDecreaseBrightness(color, all_coeff[COLY & 0x1F]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lineMix[x] = color;
|
||||
}
|
||||
gfxBG2Changed = 0;
|
||||
gfxLastVCOUNT = VCOUNT;
|
||||
}
|
||||
|
||||
}
|
31
mednafen/gba-09333/Port.h
Normal file
31
mednafen/gba-09333/Port.h
Normal file
@ -0,0 +1,31 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_PORT_H
|
||||
#define VBA_PORT_H
|
||||
|
||||
#include <mednafen/masmem.h>
|
||||
|
||||
#define READ16LE(base) LoadU16_LE(base)
|
||||
#define READ32LE(base) LoadU32_LE(base)
|
||||
|
||||
#define WRITE16LE(x,v) StoreU16_LE(x,v)
|
||||
#define WRITE32LE(x,v) StoreU32_LE(x,v)
|
||||
|
||||
#endif
|
229
mednafen/gba-09333/RTC.cpp
Normal file
229
mednafen/gba-09333/RTC.cpp
Normal file
@ -0,0 +1,229 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "../mednafen.h"
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "Port.h"
|
||||
|
||||
#include <time.h>
|
||||
#include <memory.h>
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
RTC::RTC()
|
||||
{
|
||||
InitTime();
|
||||
Reset();
|
||||
}
|
||||
|
||||
RTC::~RTC()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RTC::InitTime(void)
|
||||
{
|
||||
time_t long_time;
|
||||
|
||||
time( &long_time ); /* Get time as long integer. */
|
||||
|
||||
curtime = (int64)long_time * 16777216;
|
||||
}
|
||||
|
||||
void RTC::AddTime(int32 amount)
|
||||
{
|
||||
curtime += amount;
|
||||
}
|
||||
|
||||
uint16 RTC::Read(uint32 address)
|
||||
{
|
||||
if(address == 0x80000c8)
|
||||
return byte2;
|
||||
else if(address == 0x80000c6)
|
||||
return byte1;
|
||||
else if(address == 0x80000c4)
|
||||
return byte0;
|
||||
|
||||
abort();
|
||||
}
|
||||
|
||||
static uint8 toBCD(uint8 value)
|
||||
{
|
||||
value = value % 100;
|
||||
int l = value % 10;
|
||||
int h = value / 10;
|
||||
return h * 16 + l;
|
||||
}
|
||||
|
||||
void RTC::Write(uint32 address, uint16 value)
|
||||
{
|
||||
if(address == 0x80000c8) {
|
||||
byte2 = (uint8)value; // enable ?
|
||||
} else if(address == 0x80000c6) {
|
||||
byte1 = (uint8)value; // read/write
|
||||
} else if(address == 0x80000c4) {
|
||||
if(byte2 & 1) {
|
||||
if(state == IDLE && byte0 == 1 && value == 5) {
|
||||
state = COMMAND;
|
||||
bits = 0;
|
||||
command = 0;
|
||||
} else if(!(byte0 & 1) && (value & 1)) { // bit transfer
|
||||
byte0 = (uint8)value;
|
||||
switch(state) {
|
||||
case COMMAND:
|
||||
command |= ((value & 2) >> 1) << (7-bits);
|
||||
bits++;
|
||||
if(bits == 8) {
|
||||
bits = 0;
|
||||
switch(command) {
|
||||
case 0x60:
|
||||
// not sure what this command does but it doesn't take parameters
|
||||
// maybe it is a reset or stop
|
||||
state = IDLE;
|
||||
bits = 0;
|
||||
break;
|
||||
case 0x62:
|
||||
// this sets the control state but not sure what those values are
|
||||
state = READDATA;
|
||||
dataLen = 1;
|
||||
break;
|
||||
case 0x63:
|
||||
dataLen = 1;
|
||||
data[0] = 0x40;
|
||||
state = DATA;
|
||||
break;
|
||||
case 0x64:
|
||||
break;
|
||||
case 0x65:
|
||||
{
|
||||
struct tm *newtime;
|
||||
time_t long_time;
|
||||
|
||||
long_time = curtime / 16777216;
|
||||
newtime = localtime( &long_time ); /* Convert to local time. */
|
||||
|
||||
dataLen = 7;
|
||||
data[0] = toBCD(newtime->tm_year);
|
||||
data[1] = toBCD(newtime->tm_mon+1);
|
||||
data[2] = toBCD(newtime->tm_mday);
|
||||
data[3] = toBCD(newtime->tm_wday);
|
||||
data[4] = toBCD(newtime->tm_hour);
|
||||
data[5] = toBCD(newtime->tm_min);
|
||||
data[6] = toBCD(newtime->tm_sec);
|
||||
state = DATA;
|
||||
}
|
||||
break;
|
||||
case 0x67:
|
||||
{
|
||||
struct tm *newtime;
|
||||
time_t long_time;
|
||||
|
||||
long_time = curtime / 16777216;
|
||||
newtime = localtime( &long_time ); /* Convert to local time. */
|
||||
|
||||
dataLen = 3;
|
||||
data[0] = toBCD(newtime->tm_hour);
|
||||
data[1] = toBCD(newtime->tm_min);
|
||||
data[2] = toBCD(newtime->tm_sec);
|
||||
state = DATA;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//systemMessage(0, N_("Unknown RTC command %02x"), command);
|
||||
state = IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DATA:
|
||||
if(byte1 & 2) {
|
||||
} else {
|
||||
byte0 = (byte0 & ~2) |
|
||||
((data[bits >> 3] >>
|
||||
(bits & 7)) & 1)*2;
|
||||
bits++;
|
||||
if(bits == 8*dataLen) {
|
||||
bits = 0;
|
||||
state = IDLE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case READDATA:
|
||||
if(!(byte1 & 2)) {
|
||||
} else {
|
||||
data[bits >> 3] =
|
||||
(data[bits >> 3] >> 1) |
|
||||
((value << 6) & 128);
|
||||
bits++;
|
||||
if(bits == 8*dataLen) {
|
||||
bits = 0;
|
||||
state = IDLE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else
|
||||
byte0 = (uint8)value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RTC::Reset(void)
|
||||
{
|
||||
byte0 = 0;
|
||||
byte1 = 0;
|
||||
byte2 = 0;
|
||||
command = 0;
|
||||
dataLen = 0;
|
||||
bits = 0;
|
||||
state = IDLE;
|
||||
|
||||
memset(data, 0, sizeof(data));
|
||||
}
|
||||
|
||||
int RTC::StateAction(StateMem *sm, int load, int data_only)
|
||||
{
|
||||
SFORMAT StateRegs[] =
|
||||
{
|
||||
SFVAR(byte0),
|
||||
SFVAR(byte1),
|
||||
SFVAR(byte2),
|
||||
SFVAR(command),
|
||||
SFVAR(dataLen),
|
||||
SFVAR(bits),
|
||||
SFVAR(state),
|
||||
SFARRAY(data, 12),
|
||||
SFEND
|
||||
};
|
||||
|
||||
|
||||
int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "RTC");
|
||||
|
||||
if(load)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
}
|
62
mednafen/gba-09333/RTC.h
Normal file
62
mednafen/gba-09333/RTC.h
Normal file
@ -0,0 +1,62 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_RTC_H
|
||||
#define VBA_RTC_H
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
class RTC
|
||||
{
|
||||
public:
|
||||
|
||||
RTC();
|
||||
~RTC();
|
||||
|
||||
void InitTime(void);
|
||||
|
||||
uint16 Read(uint32 address);
|
||||
void Write(uint32 address, uint16 value);
|
||||
void Reset(void);
|
||||
|
||||
void AddTime(int32 amount);
|
||||
|
||||
int StateAction(StateMem *sm, int load, int data_only);
|
||||
|
||||
private:
|
||||
|
||||
enum RTCSTATE { IDLE, COMMAND, DATA, READDATA };
|
||||
|
||||
uint8 byte0;
|
||||
uint8 byte1;
|
||||
uint8 byte2;
|
||||
uint8 command;
|
||||
int dataLen;
|
||||
int bits;
|
||||
RTCSTATE state;
|
||||
uint8 data[12];
|
||||
|
||||
int64 curtime; // GBA CPU cycles since the Epoch, in local time.
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
451
mednafen/gba-09333/Sound.cpp
Normal file
451
mednafen/gba-09333/Sound.cpp
Normal file
@ -0,0 +1,451 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "Sound.h"
|
||||
#include "Port.h"
|
||||
|
||||
#include <memory.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <blip/Blip_Buffer.h>
|
||||
#include "gb_apu/Gb_Apu.h"
|
||||
|
||||
#include <blip/Stereo_Buffer.h>
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
typedef Blip_Synth<blip_good_quality, 0xFF * 2> Synth;
|
||||
|
||||
static Synth synth;
|
||||
|
||||
static Gb_Apu gba_apu;
|
||||
static Stereo_Buffer gba_buf;
|
||||
|
||||
extern uint32 soundTS;
|
||||
|
||||
static int lleft = 0, lright = 0;
|
||||
|
||||
int soundControl = 0;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32 FifoIndex;
|
||||
int32 FifoCount;
|
||||
int32 FifoWriteIndex;
|
||||
bool Enabled;
|
||||
int32 Timer;
|
||||
uint8 Fifo[32];
|
||||
uint8 Value;
|
||||
} GBADigiSound;
|
||||
|
||||
GBADigiSound DSChans[2]; // Digital sound channels, not Nintendo DS :b
|
||||
|
||||
#define soundDSFifoAIndex DSChans[0].FifoIndex
|
||||
#define soundDSFifoACount DSChans[0].FifoCount
|
||||
#define soundDSFifoAWriteIndex DSChans[0].FifoWriteIndex
|
||||
#define soundDSAEnabled DSChans[0].Enabled
|
||||
#define soundDSATimer DSChans[0].Timer
|
||||
#define soundDSFifoA DSChans[0].Fifo
|
||||
#define soundDSAValue DSChans[0].Value
|
||||
|
||||
#define soundDSFifoBIndex DSChans[1].FifoIndex
|
||||
#define soundDSFifoBCount DSChans[1].FifoCount
|
||||
#define soundDSFifoBWriteIndex DSChans[1].FifoWriteIndex
|
||||
#define soundDSBEnabled DSChans[1].Enabled
|
||||
#define soundDSBTimer DSChans[1].Timer
|
||||
#define soundDSFifoB DSChans[1].Fifo
|
||||
#define soundDSBValue DSChans[1].Value
|
||||
|
||||
#include "../state.h"
|
||||
|
||||
int MDFNGBASOUND_StateAction(StateMem *sm, int load, int data_only)
|
||||
{
|
||||
gb_apu_state_t apu_state;
|
||||
|
||||
//if(!load) // always save state, in case there is none to load
|
||||
gba_apu.save_state( &apu_state );
|
||||
|
||||
SFORMAT StateRegs[] =
|
||||
{
|
||||
SFVAR(soundControl),
|
||||
SFVAR(soundDSFifoAIndex),
|
||||
SFVAR(soundDSFifoACount),
|
||||
SFVAR(soundDSFifoAWriteIndex),
|
||||
SFVAR(soundDSAEnabled),
|
||||
SFVAR(soundDSATimer),
|
||||
SFARRAYN(soundDSFifoA, sizeof(soundDSFifoA), "soundDSFifoA"),
|
||||
SFVAR(soundDSAValue),
|
||||
SFVAR(soundDSFifoBIndex),
|
||||
SFVAR(soundDSFifoBCount),
|
||||
SFVAR(soundDSFifoBWriteIndex),
|
||||
SFVAR(soundDSBEnabled),
|
||||
SFVAR(soundDSBTimer),
|
||||
SFARRAYN(soundDSFifoB, sizeof(soundDSFifoB), "soundDSFifoB"),
|
||||
SFVAR(soundDSBValue),
|
||||
|
||||
SFVARN(apu_state, "apu_state"),
|
||||
SFEND
|
||||
};
|
||||
|
||||
int ret = MDFNSS_StateAction(sm, load, data_only, StateRegs, "SND");
|
||||
if(ret && load)
|
||||
{
|
||||
gba_apu.reset( gba_apu.mode_agb, true );
|
||||
(void) gba_apu.load_state( apu_state ); // TODO: warn if this returns error
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
uint8 soundRead(uint32 address)
|
||||
{
|
||||
if(address == 0x80)
|
||||
return(gba_apu.read_register(soundTS, 0xff24));
|
||||
else if(address == 0x81)
|
||||
return(gba_apu.read_register(soundTS, 0xff25));
|
||||
else if(address == 0x84)
|
||||
return(gba_apu.read_register(soundTS, 0xff26));
|
||||
else if(address >= 0x90 && address <= 0x9f)
|
||||
{
|
||||
return(gba_apu.read_register(soundTS, address - 0x90 + 0xff30));
|
||||
}
|
||||
return(ioMem[address]);
|
||||
}
|
||||
|
||||
void soundEvent(uint32 address, uint8 data)
|
||||
{
|
||||
uint32 origa = address;
|
||||
address &= 0xFF;
|
||||
|
||||
if(address == 0x60)
|
||||
address = 0xff10;
|
||||
else if(address == 0x62)
|
||||
address = 0xff11;
|
||||
else if(address == 0x63)
|
||||
address = 0xff12;
|
||||
else if(address == 0x64)
|
||||
address = 0xff13;
|
||||
else if(address == 0x65)
|
||||
address = 0xff14;
|
||||
|
||||
else if(address == 0x68)
|
||||
address = 0xff16;
|
||||
else if(address == 0x69)
|
||||
address = 0xff17;
|
||||
else if(address == 0x6c)
|
||||
address = 0xff18;
|
||||
else if(address == 0x6d)
|
||||
address = 0xff19;
|
||||
|
||||
else if(address == 0x70)
|
||||
address = 0xff1a;
|
||||
else if(address == 0x72)
|
||||
address = 0xff1b;
|
||||
else if(address == 0x73)
|
||||
address = 0xff1c;
|
||||
else if(address == 0x74)
|
||||
address = 0xff1d;
|
||||
else if(address == 0x75)
|
||||
address = 0xff1e;
|
||||
|
||||
else if(address == 0x78)
|
||||
address = 0xff20;
|
||||
else if(address == 0x79)
|
||||
address = 0xff21;
|
||||
else if(address == 0x7c)
|
||||
address = 0xff22;
|
||||
else if(address == 0x7d)
|
||||
address = 0xff23;
|
||||
|
||||
else if(address == 0x80)
|
||||
address = 0xff24;
|
||||
else if(address == 0x81)
|
||||
address = 0xff25;
|
||||
else if(address == 0x84)
|
||||
address = 0xff26;
|
||||
else if(address >= 0x90 && address <= 0x9f)
|
||||
{
|
||||
address += 0xff30 - 0x90;
|
||||
}
|
||||
else
|
||||
{
|
||||
ioMem[origa] = data;
|
||||
return;
|
||||
}
|
||||
ioMem[origa] = data;
|
||||
|
||||
gba_apu.write_register(soundTS, address, data);
|
||||
}
|
||||
|
||||
void soundEvent(uint32 address, uint16 data)
|
||||
{
|
||||
switch(address) {
|
||||
case SGCNT0_H:
|
||||
data &= 0xFF0F;
|
||||
soundControl = data & 0x770F;;
|
||||
if(data & 0x0800) {
|
||||
soundDSFifoAWriteIndex = 0;
|
||||
soundDSFifoAIndex = 0;
|
||||
soundDSFifoACount = 0;
|
||||
soundDSAValue = 0;
|
||||
memset(soundDSFifoA, 0, 32);
|
||||
}
|
||||
soundDSAEnabled = (data & 0x0300) ? true : false;
|
||||
soundDSATimer = (data & 0x0400) ? 1 : 0;
|
||||
if(data & 0x8000) {
|
||||
soundDSFifoBWriteIndex = 0;
|
||||
soundDSFifoBIndex = 0;
|
||||
soundDSFifoBCount = 0;
|
||||
soundDSBValue = 0;
|
||||
memset(soundDSFifoB, 0, 32);
|
||||
}
|
||||
soundDSBEnabled = (data & 0x3000) ? true : false;
|
||||
soundDSBTimer = (data & 0x4000) ? 1 : 0;
|
||||
WRITE16LE(((uint16 *)&ioMem[address]), data);
|
||||
break;
|
||||
case FIFOA_L:
|
||||
case FIFOA_H:
|
||||
soundDSFifoA[soundDSFifoAWriteIndex++] = data & 0xFF;
|
||||
soundDSFifoA[soundDSFifoAWriteIndex++] = data >> 8;
|
||||
soundDSFifoACount += 2;
|
||||
soundDSFifoAWriteIndex &= 31;
|
||||
WRITE16LE(((uint16 *)&ioMem[address]), data);
|
||||
break;
|
||||
case FIFOB_L:
|
||||
case FIFOB_H:
|
||||
soundDSFifoB[soundDSFifoBWriteIndex++] = data & 0xFF;
|
||||
soundDSFifoB[soundDSFifoBWriteIndex++] = data >> 8;
|
||||
soundDSFifoBCount += 2;
|
||||
soundDSFifoBWriteIndex &= 31;
|
||||
WRITE16LE(((uint16 *)&ioMem[address]), data);
|
||||
break;
|
||||
case 0x88:
|
||||
data &= 0xC3FF;
|
||||
WRITE16LE(((uint16 *)&ioMem[address]), data);
|
||||
break;
|
||||
case 0x90:
|
||||
case 0x92:
|
||||
case 0x94:
|
||||
case 0x96:
|
||||
case 0x98:
|
||||
case 0x9a:
|
||||
case 0x9c:
|
||||
case 0x9e:
|
||||
//printf("Yay: %04x: %04x\n", 0xFF30 + (address & 0xF), data);
|
||||
gba_apu.write_register(soundTS, 0xFF30 + (address & 0xF), data & 0xFF);
|
||||
gba_apu.write_register(soundTS, 0xFF30 + (address & 0xF) + 1, data >> 8);
|
||||
//*((uint16 *)&sound3WaveRam[(sound3Bank*0x10)^0x10+(address&14)]) = data;
|
||||
//WRITE16LE(((uint16 *)&ioMem[address]), data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) (a)<(b)?(b):(a)
|
||||
#endif
|
||||
|
||||
static inline void soundMix(int &left, int &right)
|
||||
{
|
||||
int res = 0;
|
||||
int dsaRatio = ioMem[0x82] & 4;
|
||||
int dsbRatio = ioMem[0x82] & 8;
|
||||
|
||||
if(soundControl & 0x0200)
|
||||
{
|
||||
if(!dsaRatio)
|
||||
{
|
||||
res = (int8)soundDSAValue >> 1;
|
||||
}
|
||||
else
|
||||
res = (int8)soundDSAValue;
|
||||
}
|
||||
|
||||
if(soundControl & 0x2000)
|
||||
{
|
||||
if(!dsbRatio)
|
||||
{
|
||||
res += (int8)soundDSBValue >> 1;
|
||||
}
|
||||
else
|
||||
res += (int8)soundDSBValue;
|
||||
}
|
||||
|
||||
left = res;
|
||||
|
||||
res = 0;
|
||||
|
||||
if(soundControl & 0x0100)
|
||||
{
|
||||
if(!dsaRatio)
|
||||
res = (int8)soundDSAValue >> 1;
|
||||
else
|
||||
res = (int8)soundDSAValue;
|
||||
}
|
||||
|
||||
if(soundControl & 0x1000)
|
||||
{
|
||||
if(!dsbRatio)
|
||||
res += (int8)soundDSAValue >> 1;
|
||||
else
|
||||
res += (int8)soundDSBValue;
|
||||
}
|
||||
right = res;
|
||||
}
|
||||
|
||||
int meow = 0;
|
||||
|
||||
static inline void soundLick(void)
|
||||
{
|
||||
int left, right;
|
||||
|
||||
left = right = 0;
|
||||
|
||||
soundMix(left, right);
|
||||
|
||||
if(left != lleft)
|
||||
synth.offset_inline(soundTS, left - lleft, gba_buf.left());
|
||||
|
||||
if(right != lright)
|
||||
synth.offset_inline(soundTS, right - lright, gba_buf.right());
|
||||
|
||||
lleft = left;
|
||||
lright = right;
|
||||
}
|
||||
|
||||
static void DSTimer(int which, int dmamask)
|
||||
{
|
||||
if(DSChans[which].Enabled)
|
||||
{
|
||||
if(DSChans[which].FifoCount <= 16)
|
||||
{
|
||||
CPUCheckDMA(3, dmamask);
|
||||
}
|
||||
|
||||
if(DSChans[which].FifoCount > 16)
|
||||
{
|
||||
DSChans[which].Value = (DSChans[which].Fifo[DSChans[which].FifoIndex]);
|
||||
DSChans[which].FifoIndex = (DSChans[which].FifoIndex + 1) & 0x1F;
|
||||
DSChans[which].FifoCount--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DSChans[which].Value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void soundTimerOverflow(int timer)
|
||||
{
|
||||
bool NeedLick = FALSE;
|
||||
|
||||
if(soundDSAEnabled && (soundDSATimer == timer))
|
||||
{
|
||||
DSTimer(0, 2);
|
||||
NeedLick = TRUE;
|
||||
}
|
||||
|
||||
if(soundDSBEnabled && (soundDSBTimer == timer))
|
||||
{
|
||||
DSTimer(1, 4);
|
||||
NeedLick = TRUE;
|
||||
}
|
||||
|
||||
if(NeedLick)
|
||||
soundLick();
|
||||
}
|
||||
|
||||
int32 MDFNGBASOUND_Flush(int16 *SoundBuf, const int32 MaxSoundFrames)
|
||||
{
|
||||
const int ratio = ioMem[0x82] & 3;
|
||||
static const int rat_table[4] = { 2, 1, 0, 2 };
|
||||
int32 FrameCount = 0;
|
||||
|
||||
gba_apu.volume(0.333 * (double)(4 >> rat_table[ratio]) / 4);
|
||||
|
||||
gba_apu.end_frame(soundTS);
|
||||
|
||||
gba_buf.end_frame(soundTS);
|
||||
|
||||
if(SoundBuf)
|
||||
FrameCount = gba_buf.read_samples(SoundBuf, MaxSoundFrames * 2) / 2;
|
||||
else
|
||||
gba_buf.clear();
|
||||
|
||||
soundTS = 0;
|
||||
|
||||
|
||||
#if 0
|
||||
if(SoundBuf)
|
||||
{
|
||||
unsigned long long crf = (unsigned long long)gba_buf.left()->clock_rate_factor(gba_buf.left()->clock_rate());
|
||||
double real_rate = (double)crf * gba_buf.left()->clock_rate() / (1ULL << BLIP_BUFFER_ACCURACY);
|
||||
|
||||
printf("%f\n", real_rate);
|
||||
}
|
||||
#endif
|
||||
|
||||
return(FrameCount);
|
||||
}
|
||||
|
||||
void MDFNGBASOUND_Init(void)
|
||||
{
|
||||
MDFNGBA_SetSoundRate(0);
|
||||
|
||||
gba_buf.clock_rate((long)(4194304 * 4));
|
||||
|
||||
gba_apu.set_output(gba_buf.center(), gba_buf.left(), gba_buf.right());
|
||||
|
||||
gba_apu.reset( gba_apu.mode_agb, true );
|
||||
|
||||
gba_apu.volume(0.333);
|
||||
synth.volume(0.666);
|
||||
|
||||
gba_buf.bass_freq(20);
|
||||
}
|
||||
|
||||
void soundReset()
|
||||
{
|
||||
for(int ch = 0; ch < 2; ch++)
|
||||
{
|
||||
DSChans[ch].FifoIndex = 0;
|
||||
DSChans[ch].FifoCount = 0;
|
||||
DSChans[ch].FifoWriteIndex = 0;
|
||||
DSChans[ch].Enabled = false;
|
||||
DSChans[ch].Timer = 0;
|
||||
memset(DSChans[ch].Fifo, 0, 32);
|
||||
DSChans[ch].Value = 0;
|
||||
}
|
||||
|
||||
for(int addr = 0x90; addr < 0xA0;)
|
||||
{
|
||||
ioMem[addr++] = 0x00;
|
||||
ioMem[addr++] = 0xff;
|
||||
}
|
||||
|
||||
gba_apu.reset( gba_apu.mode_agb, true );
|
||||
}
|
||||
|
||||
bool MDFNGBA_SetSoundRate(uint32 rate)
|
||||
{
|
||||
gba_buf.set_sample_rate(rate?rate:44100, 60);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
}
|
69
mednafen/gba-09333/Sound.h
Normal file
69
mednafen/gba-09333/Sound.h
Normal file
@ -0,0 +1,69 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_SOUND_H
|
||||
#define VBA_SOUND_H
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
#define NR10 0x60
|
||||
#define NR11 0x62
|
||||
#define NR12 0x63
|
||||
#define NR13 0x64
|
||||
#define NR14 0x65
|
||||
#define NR21 0x68
|
||||
#define NR22 0x69
|
||||
#define NR23 0x6c
|
||||
#define NR24 0x6d
|
||||
#define NR30 0x70
|
||||
#define NR31 0x72
|
||||
#define NR32 0x73
|
||||
#define NR33 0x74
|
||||
#define NR34 0x75
|
||||
#define NR41 0x78
|
||||
#define NR42 0x79
|
||||
#define NR43 0x7c
|
||||
#define NR44 0x7d
|
||||
#define NR50 0x80
|
||||
#define NR51 0x81
|
||||
#define NR52 0x84
|
||||
#define SGCNT0_H 0x82
|
||||
#define FIFOA_L 0xa0
|
||||
#define FIFOA_H 0xa2
|
||||
#define FIFOB_L 0xa4
|
||||
#define FIFOB_H 0xa6
|
||||
|
||||
extern void soundReset();
|
||||
extern void soundEvent(uint32, uint8);
|
||||
extern void soundEvent(uint32, uint16);
|
||||
extern void soundTimerOverflow(int);
|
||||
|
||||
int32 MDFNGBASOUND_Flush(int16 *SoundBuf, const int32 MaxSoundFrames);
|
||||
void MDFNGBASOUND_Init(void);
|
||||
|
||||
uint8 soundRead(uint32 address);
|
||||
|
||||
void MDFNGBA_SetSoundVolume(uint32 volume);
|
||||
bool MDFNGBA_SetSoundRate(uint32 rate);
|
||||
int MDFNGBASOUND_StateAction(StateMem *sm, int load, int data_only);
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_SOUND_H
|
7952
mednafen/gba-09333/arm.cpp
Normal file
7952
mednafen/gba-09333/arm.cpp
Normal file
File diff suppressed because it is too large
Load Diff
6
mednafen/gba-09333/arm.h
Normal file
6
mednafen/gba-09333/arm.h
Normal file
@ -0,0 +1,6 @@
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
unsigned int RunARM(void);
|
||||
|
||||
}
|
1165
mednafen/gba-09333/bios.cpp
Normal file
1165
mednafen/gba-09333/bios.cpp
Normal file
File diff suppressed because it is too large
Load Diff
52
mednafen/gba-09333/bios.h
Normal file
52
mednafen/gba-09333/bios.h
Normal file
@ -0,0 +1,52 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_BIOS_H
|
||||
#define VBA_BIOS_H
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
extern void BIOS_ArcTan();
|
||||
extern void BIOS_ArcTan2();
|
||||
extern void BIOS_BitUnPack();
|
||||
extern void BIOS_BgAffineSet();
|
||||
extern void BIOS_CpuSet();
|
||||
extern void BIOS_CpuFastSet();
|
||||
extern void BIOS_Diff8bitUnFilterWram();
|
||||
extern void BIOS_Diff8bitUnFilterVram();
|
||||
extern void BIOS_Diff16bitUnFilter();
|
||||
extern void BIOS_Div();
|
||||
extern void BIOS_DivARM();
|
||||
extern void BIOS_HuffUnComp();
|
||||
extern void BIOS_LZ77UnCompVram();
|
||||
extern void BIOS_LZ77UnCompWram();
|
||||
extern void BIOS_ObjAffineSet();
|
||||
extern void BIOS_RegisterRamReset();
|
||||
extern void BIOS_RegisterRamReset(uint32);
|
||||
extern void BIOS_RLUnCompVram();
|
||||
extern void BIOS_RLUnCompWram();
|
||||
extern void BIOS_SoftReset();
|
||||
extern void BIOS_Sqrt();
|
||||
extern void BIOS_MidiKey2Freq();
|
||||
extern void BIOS_SndDriverJmpTableCopy();
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_BIOS_H
|
223
mednafen/gba-09333/eeprom.cpp
Normal file
223
mednafen/gba-09333/eeprom.cpp
Normal file
@ -0,0 +1,223 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include <memory.h>
|
||||
#include "eeprom.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
extern int cpuDmaCount;
|
||||
|
||||
int eepromMode = EEPROM_IDLE;
|
||||
int eepromByte = 0;
|
||||
int eepromBits = 0;
|
||||
int eepromAddress = 0;
|
||||
uint8 eepromData[0x2000];
|
||||
static uint8 eepromBuffer[16];
|
||||
bool eepromInUse = false;
|
||||
int eepromSize = 512;
|
||||
|
||||
#include "../state.h"
|
||||
|
||||
SFORMAT eepromSaveData[] =
|
||||
{
|
||||
SFVAR(eepromMode),
|
||||
SFVAR(eepromByte),
|
||||
SFVAR(eepromBits),
|
||||
SFVAR(eepromAddress),
|
||||
SFVAR(eepromInUse),
|
||||
SFVAR(eepromSize),
|
||||
SFARRAYN(eepromData, 0x2000, "eepromData"),
|
||||
SFARRAYN(eepromBuffer, 16, "eepromBuffer"),
|
||||
SFEND
|
||||
};
|
||||
|
||||
bool GBA_EEPROM_SaveFile(const char *filename)
|
||||
{
|
||||
if(eepromInUse)
|
||||
{
|
||||
if(!MDFN_DumpToFile(filename, 0, eepromData, eepromSize))
|
||||
return(0);
|
||||
}
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
bool GBA_EEPROM_LoadFile(const char *filename)
|
||||
{
|
||||
FILE *fp = fopen(filename, "rb");
|
||||
|
||||
if(fp)
|
||||
{
|
||||
long size;
|
||||
|
||||
fseek(fp, 0, SEEK_END);
|
||||
size = ftell(fp);
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
|
||||
if(size == 512 || size == 0x2000)
|
||||
{
|
||||
if((long)fread(eepromData, 1, size, fp) == size)
|
||||
{
|
||||
eepromInUse = TRUE;
|
||||
eepromSize = size;
|
||||
fclose(fp);
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
void eepromInit(void)
|
||||
{
|
||||
memset(eepromData, 0xFF, sizeof(eepromData));
|
||||
}
|
||||
|
||||
void eepromReset(void)
|
||||
{
|
||||
eepromMode = EEPROM_IDLE;
|
||||
eepromByte = 0;
|
||||
eepromBits = 0;
|
||||
eepromAddress = 0;
|
||||
eepromInUse = false;
|
||||
eepromSize = 512;
|
||||
}
|
||||
|
||||
int eepromRead(uint32 /* address */)
|
||||
{
|
||||
switch(eepromMode) {
|
||||
case EEPROM_IDLE:
|
||||
case EEPROM_READADDRESS:
|
||||
case EEPROM_WRITEDATA:
|
||||
return 1;
|
||||
case EEPROM_READDATA:
|
||||
{
|
||||
eepromBits++;
|
||||
if(eepromBits == 4) {
|
||||
eepromMode = EEPROM_READDATA2;
|
||||
eepromBits = 0;
|
||||
eepromByte = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case EEPROM_READDATA2:
|
||||
{
|
||||
int data = 0;
|
||||
int address = eepromAddress << 3;
|
||||
int mask = 1 << (7 - (eepromBits & 7));
|
||||
data = (eepromData[address+eepromByte] & mask) ? 1 : 0;
|
||||
eepromBits++;
|
||||
if((eepromBits & 7) == 0)
|
||||
eepromByte++;
|
||||
if(eepromBits == 0x40)
|
||||
eepromMode = EEPROM_IDLE;
|
||||
return data;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
void eepromWrite(uint32 /* address */, uint8 value)
|
||||
{
|
||||
if(cpuDmaCount == 0)
|
||||
return;
|
||||
int bit = value & 1;
|
||||
switch(eepromMode) {
|
||||
case EEPROM_IDLE:
|
||||
eepromByte = 0;
|
||||
eepromBits = 1;
|
||||
eepromBuffer[eepromByte] = bit;
|
||||
eepromMode = EEPROM_READADDRESS;
|
||||
break;
|
||||
case EEPROM_READADDRESS:
|
||||
eepromBuffer[eepromByte] <<= 1;
|
||||
eepromBuffer[eepromByte] |= bit;
|
||||
eepromBits++;
|
||||
if((eepromBits & 7) == 0) {
|
||||
eepromByte++;
|
||||
}
|
||||
if(cpuDmaCount == 0x11 || cpuDmaCount == 0x51) {
|
||||
if(eepromBits == 0x11) {
|
||||
eepromInUse = true;
|
||||
eepromSize = 0x2000;
|
||||
eepromAddress = ((eepromBuffer[0] & 0x3F) << 8) |
|
||||
((eepromBuffer[1] & 0xFF));
|
||||
if(!(eepromBuffer[0] & 0x40)) {
|
||||
eepromBuffer[0] = bit;
|
||||
eepromBits = 1;
|
||||
eepromByte = 0;
|
||||
eepromMode = EEPROM_WRITEDATA;
|
||||
} else {
|
||||
eepromMode = EEPROM_READDATA;
|
||||
eepromByte = 0;
|
||||
eepromBits = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(eepromBits == 9) {
|
||||
eepromInUse = true;
|
||||
eepromAddress = (eepromBuffer[0] & 0x3F);
|
||||
if(!(eepromBuffer[0] & 0x40)) {
|
||||
eepromBuffer[0] = bit;
|
||||
eepromBits = 1;
|
||||
eepromByte = 0;
|
||||
eepromMode = EEPROM_WRITEDATA;
|
||||
} else {
|
||||
eepromMode = EEPROM_READDATA;
|
||||
eepromByte = 0;
|
||||
eepromBits = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EEPROM_READDATA:
|
||||
case EEPROM_READDATA2:
|
||||
// should we reset here?
|
||||
eepromMode = EEPROM_IDLE;
|
||||
break;
|
||||
case EEPROM_WRITEDATA:
|
||||
eepromBuffer[eepromByte] <<= 1;
|
||||
eepromBuffer[eepromByte] |= bit;
|
||||
eepromBits++;
|
||||
if((eepromBits & 7) == 0) {
|
||||
eepromByte++;
|
||||
}
|
||||
if(eepromBits == 0x40) {
|
||||
eepromInUse = true;
|
||||
// write data;
|
||||
for(int i = 0; i < 8; i++) {
|
||||
eepromData[(eepromAddress << 3) + i] = eepromBuffer[i];
|
||||
}
|
||||
} else if(eepromBits == 0x41) {
|
||||
eepromMode = EEPROM_IDLE;
|
||||
eepromByte = 0;
|
||||
eepromBits = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
46
mednafen/gba-09333/eeprom.h
Normal file
46
mednafen/gba-09333/eeprom.h
Normal file
@ -0,0 +1,46 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_EEPROM_H
|
||||
#define VBA_EEPROM_H
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
bool GBA_EEPROM_SaveFile(const char *filename) MDFN_COLD;
|
||||
bool GBA_EEPROM_LoadFile(const char *filename) MDFN_COLD;
|
||||
|
||||
|
||||
int eepromRead(uint32 address);
|
||||
void eepromWrite(uint32 address, uint8 value);
|
||||
void eepromInit(void) MDFN_COLD;
|
||||
void eepromReset(void) MDFN_COLD;
|
||||
extern bool eepromInUse;
|
||||
extern int eepromSize;
|
||||
extern uint8 eepromData[0x2000];
|
||||
|
||||
#define EEPROM_IDLE 0
|
||||
#define EEPROM_READADDRESS 1
|
||||
#define EEPROM_READDATA 2
|
||||
#define EEPROM_READDATA2 3
|
||||
#define EEPROM_WRITEDATA 4
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_EEPROM_H
|
229
mednafen/gba-09333/flash.cpp
Normal file
229
mednafen/gba-09333/flash.cpp
Normal file
@ -0,0 +1,229 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "flash.h"
|
||||
#include "sram.h"
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
#define FLASH_READ_ARRAY 0
|
||||
#define FLASH_CMD_1 1
|
||||
#define FLASH_CMD_2 2
|
||||
#define FLASH_AUTOSELECT 3
|
||||
#define FLASH_CMD_3 4
|
||||
#define FLASH_CMD_4 5
|
||||
#define FLASH_CMD_5 6
|
||||
#define FLASH_ERASE_COMPLETE 7
|
||||
#define FLASH_PROGRAM 8
|
||||
#define FLASH_SETBANK 9
|
||||
|
||||
uint8 *flashSaveMemory = NULL;
|
||||
int flashState = FLASH_READ_ARRAY;
|
||||
int flashReadState = FLASH_READ_ARRAY;
|
||||
int flashSize = 0x10000;
|
||||
static int flashDeviceID = 0x1b;
|
||||
static int flashManufacturerID = 0x32;
|
||||
static int flashBank = 0;
|
||||
|
||||
int GBA_Flash_StateAction(StateMem *sm, int load, int data_only)
|
||||
{
|
||||
SFORMAT flashSaveData[] =
|
||||
{
|
||||
SFVAR(flashState),
|
||||
SFVAR(flashReadState),
|
||||
SFVAR(flashSize),
|
||||
SFVAR(flashBank),
|
||||
SFARRAYN(flashSaveMemory, 0x20000, "flashSaveMemory"),
|
||||
SFEND
|
||||
};
|
||||
|
||||
int ret = MDFNSS_StateAction(sm, load, data_only, flashSaveData, "FLSH");
|
||||
|
||||
return(ret);
|
||||
};
|
||||
|
||||
bool GBA_Flash_Init(void)
|
||||
{
|
||||
if(!(flashSaveMemory = (uint8 *)MDFN_malloc(0x20000, _("flash memory"))))
|
||||
return(0);
|
||||
|
||||
memset(flashSaveMemory, 0x00, 0x20000);
|
||||
return(1);
|
||||
}
|
||||
|
||||
void GBA_Flash_Kill(void)
|
||||
{
|
||||
if(flashSaveMemory)
|
||||
{
|
||||
free(flashSaveMemory);
|
||||
flashSaveMemory = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void GBA_Flash_Reset(void)
|
||||
{
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
flashBank = 0;
|
||||
}
|
||||
|
||||
void flashSetSize(int size)
|
||||
{
|
||||
//printf("Setting flash size to %d\n", size);
|
||||
flashSize = size;
|
||||
if(size == 0x10000) {
|
||||
flashDeviceID = 0x1b;
|
||||
flashManufacturerID = 0x32;
|
||||
} else {
|
||||
flashDeviceID = 0x13; //0x09;
|
||||
flashManufacturerID = 0x62; //0xc2;
|
||||
}
|
||||
}
|
||||
|
||||
uint8 flashRead(uint32 address)
|
||||
{
|
||||
// log("Reading %08x from %08x\n", address, reg[15].I);
|
||||
// log("Current read state is %d\n", flashReadState);
|
||||
address &= 0xFFFF;
|
||||
|
||||
//printf("Read: %04x\n", address);
|
||||
switch(flashReadState) {
|
||||
case FLASH_READ_ARRAY:
|
||||
return flashSaveMemory[(flashBank << 16) + address];
|
||||
case FLASH_AUTOSELECT:
|
||||
switch(address & 0xFF) {
|
||||
case 0:
|
||||
// manufacturer ID
|
||||
return flashManufacturerID;
|
||||
case 1:
|
||||
// device ID
|
||||
return flashDeviceID;
|
||||
}
|
||||
break;
|
||||
case FLASH_ERASE_COMPLETE:
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
return 0xFF;
|
||||
};
|
||||
return 0;
|
||||
}
|
||||
|
||||
void flashWrite(uint32 address, uint8 byte)
|
||||
{
|
||||
|
||||
//printf("Writing %02x at %08x\n", byte, address);
|
||||
// log("Current state is %d\n", flashState);
|
||||
address &= 0xFFFF;
|
||||
switch(flashState) {
|
||||
case FLASH_READ_ARRAY:
|
||||
if(address == 0x5555 && byte == 0xAA)
|
||||
flashState = FLASH_CMD_1;
|
||||
break;
|
||||
case FLASH_CMD_1:
|
||||
if(address == 0x2AAA && byte == 0x55)
|
||||
flashState = FLASH_CMD_2;
|
||||
else
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
break;
|
||||
case FLASH_CMD_2:
|
||||
if(address == 0x5555) {
|
||||
if(byte == 0x90) {
|
||||
flashState = FLASH_AUTOSELECT;
|
||||
flashReadState = FLASH_AUTOSELECT;
|
||||
} else if(byte == 0x80) {
|
||||
flashState = FLASH_CMD_3;
|
||||
} else if(byte == 0xF0) {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
} else if(byte == 0xA0) {
|
||||
flashState = FLASH_PROGRAM;
|
||||
} else if(byte == 0xB0 && flashSize == 0x20000) {
|
||||
flashState = FLASH_SETBANK;
|
||||
} else {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
}
|
||||
} else {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
}
|
||||
break;
|
||||
case FLASH_CMD_3:
|
||||
if(address == 0x5555 && byte == 0xAA) {
|
||||
flashState = FLASH_CMD_4;
|
||||
} else {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
}
|
||||
break;
|
||||
case FLASH_CMD_4:
|
||||
if(address == 0x2AAA && byte == 0x55) {
|
||||
flashState = FLASH_CMD_5;
|
||||
} else {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
}
|
||||
break;
|
||||
case FLASH_CMD_5:
|
||||
if(byte == 0x30) {
|
||||
// SECTOR ERASE
|
||||
memset(&flashSaveMemory[(flashBank << 16) + (address & 0xF000)],
|
||||
0x00,
|
||||
0x1000);
|
||||
flashReadState = FLASH_ERASE_COMPLETE;
|
||||
} else if(byte == 0x10) {
|
||||
// CHIP ERASE
|
||||
memset(flashSaveMemory, 0, flashSize);
|
||||
flashReadState = FLASH_ERASE_COMPLETE;
|
||||
} else {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
}
|
||||
break;
|
||||
case FLASH_AUTOSELECT:
|
||||
if(byte == 0xF0) {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
} else if(address == 0x5555 && byte == 0xAA)
|
||||
flashState = FLASH_CMD_1;
|
||||
else {
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
}
|
||||
break;
|
||||
case FLASH_PROGRAM:
|
||||
flashSaveMemory[(flashBank<<16)+address] = byte;
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
break;
|
||||
case FLASH_SETBANK:
|
||||
if(address == 0) {
|
||||
flashBank = (byte & 1);
|
||||
}
|
||||
flashState = FLASH_READ_ARRAY;
|
||||
flashReadState = FLASH_READ_ARRAY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
43
mednafen/gba-09333/flash.h
Normal file
43
mednafen/gba-09333/flash.h
Normal file
@ -0,0 +1,43 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_FLASH_H
|
||||
#define VBA_FLASH_H
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
bool GBA_Flash_Init(void) MDFN_COLD;
|
||||
void GBA_Flash_Kill(void) MDFN_COLD;
|
||||
void GBA_Flash_Reset(void) MDFN_COLD;
|
||||
|
||||
extern void flashSaveGame(FILE *gzFile) MDFN_COLD;
|
||||
extern void flashReadGame(FILE *gzFile, int version) MDFN_COLD;
|
||||
extern uint8 flashRead(uint32 address);
|
||||
extern void flashWrite(uint32 address, uint8 byte);
|
||||
extern uint8 *flashSaveMemory;
|
||||
extern void flashSetSize(int size);
|
||||
|
||||
extern int flashSize;
|
||||
|
||||
int GBA_Flash_StateAction(StateMem *sm, int load, int data_only);
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_FLASH_H
|
233
mednafen/gba-09333/gfx-draw.h
Normal file
233
mednafen/gba-09333/gfx-draw.h
Normal file
@ -0,0 +1,233 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2005 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_GFX_DRAW_H
|
||||
#define VBA_GFX_DRAW_H
|
||||
|
||||
#include "Gfx.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
//#define SPRITE_DEBUG
|
||||
|
||||
void gfxDrawTextScreen(uint16, uint16, uint16, uint32 *);
|
||||
void gfxDrawRotScreen(uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
int&, int&,
|
||||
int,
|
||||
uint32*);
|
||||
void gfxDrawRotScreen16Bit(uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
int&, int&,
|
||||
int,
|
||||
uint32*);
|
||||
void gfxDrawRotScreen256(uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
int&, int&,
|
||||
int,
|
||||
uint32*);
|
||||
void gfxDrawRotScreen16Bit160(uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
uint16, uint16,
|
||||
int&, int&,
|
||||
int,
|
||||
uint32*);
|
||||
void gfxDrawSprites(void);
|
||||
|
||||
void gfxDrawOBJWin(void);
|
||||
|
||||
|
||||
|
||||
//void gfxIncreaseBrightness(uint32 *line, int coeff);
|
||||
//void gfxDecreaseBrightness(uint32 *line, int coeff);
|
||||
//void gfxAlphaBlend(uint32 *ta, uint32 *tb, int ca, int cb);
|
||||
|
||||
extern uint32 AlphaClampLUT[64];
|
||||
extern MDFN_ALIGN(16) uint32 line0[512];
|
||||
extern MDFN_ALIGN(16) uint32 line1[512];
|
||||
extern MDFN_ALIGN(16) uint32 line2[512];
|
||||
extern MDFN_ALIGN(16) uint32 line3[512];
|
||||
extern MDFN_ALIGN(16) uint32 lineOBJ[512];
|
||||
extern MDFN_ALIGN(16) uint32 lineOBJWin[512];
|
||||
extern MDFN_ALIGN(16) uint32 lineMix[512];
|
||||
extern bool gfxInWin0[512];
|
||||
extern bool gfxInWin1[512];
|
||||
|
||||
extern int gfxBG2Changed;
|
||||
extern int gfxBG3Changed;
|
||||
|
||||
extern int gfxBG2X;
|
||||
extern int gfxBG2Y;
|
||||
extern int gfxBG2LastX;
|
||||
extern int gfxBG2LastY;
|
||||
extern int gfxBG3X;
|
||||
extern int gfxBG3Y;
|
||||
extern int gfxBG3LastX;
|
||||
extern int gfxBG3LastY;
|
||||
extern int gfxLastVCOUNT;
|
||||
|
||||
static INLINE void gfxClearArray(uint32 *array)
|
||||
{
|
||||
MDFN_FastU32MemsetM8(array, 0x80000000, 240);
|
||||
// for(int i = 0; i < 240; i++) {
|
||||
// *array++ = 0x80000000;
|
||||
// }
|
||||
}
|
||||
|
||||
// Max coefficient is 16, so...
|
||||
static INLINE uint32 gfxIncreaseBrightness(uint32 color, int coeff)
|
||||
{
|
||||
int r = (color & 0x1F);
|
||||
int g = ((color >> 5) & 0x1F);
|
||||
int b = ((color >> 10) & 0x1F);
|
||||
|
||||
r = r + (((31 - r) * coeff) >> 4);
|
||||
g = g + (((31 - g) * coeff) >> 4);
|
||||
b = b + (((31 - b) * coeff) >> 4);
|
||||
//if(r > 31)
|
||||
// r = 31;
|
||||
//if(g > 31)
|
||||
// g = 31;
|
||||
//if(b > 31)
|
||||
// b = 31;
|
||||
color = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;
|
||||
return color;
|
||||
}
|
||||
|
||||
static INLINE void gfxIncreaseBrightness(uint32 *line, int coeff)
|
||||
{
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = *line;
|
||||
int r = (color & 0x1F);
|
||||
int g = ((color >> 5) & 0x1F);
|
||||
int b = ((color >> 10) & 0x1F);
|
||||
|
||||
r = r + (((31 - r) * coeff) >> 4);
|
||||
g = g + (((31 - g) * coeff) >> 4);
|
||||
b = b + (((31 - b) * coeff) >> 4);
|
||||
//if(r > 31)
|
||||
// r = 31;
|
||||
//if(g > 31)
|
||||
// g = 31;
|
||||
//if(b > 31)
|
||||
// b = 31;
|
||||
*line++ = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE uint32 gfxDecreaseBrightness(uint32 color, int coeff)
|
||||
{
|
||||
int r = (color & 0x1F);
|
||||
int g = ((color >> 5) & 0x1F);
|
||||
int b = ((color >> 10) & 0x1F);
|
||||
|
||||
r = r - ((r * coeff) >> 4);
|
||||
g = g - ((g * coeff) >> 4);
|
||||
b = b - ((b * coeff) >> 4);
|
||||
//if(r < 0)
|
||||
// r = 0;
|
||||
//if(g < 0)
|
||||
// g = 0;
|
||||
//if(b < 0)
|
||||
// b = 0;
|
||||
color = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
static INLINE void gfxDecreaseBrightness(uint32 *line, int coeff)
|
||||
{
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = *line;
|
||||
int r = (color & 0x1F);
|
||||
int g = ((color >> 5) & 0x1F);
|
||||
int b = ((color >> 10) & 0x1F);
|
||||
|
||||
r = r - ((r * coeff) >> 4);
|
||||
g = g - ((g * coeff) >> 4);
|
||||
b = b - ((b * coeff) >> 4);
|
||||
//if(r < 0)
|
||||
// r = 0;
|
||||
//if(g < 0)
|
||||
// g = 0;
|
||||
//if(b < 0)
|
||||
// b = 0;
|
||||
*line++ = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;
|
||||
}
|
||||
}
|
||||
|
||||
static INLINE uint32 gfxAlphaBlend(uint32 color, uint32 color2, int ca, int cb)
|
||||
{
|
||||
if(color < 0x80000000) {
|
||||
int r = (color & 0x1F);
|
||||
int g = ((color >> 5) & 0x1F);
|
||||
int b = ((color >> 10) & 0x1F);
|
||||
int r0 = (color2 & 0x1F);
|
||||
int g0 = ((color2 >> 5) & 0x1F);
|
||||
int b0 = ((color2 >> 10) & 0x1F);
|
||||
|
||||
r = AlphaClampLUT[((r * ca) >> 4) + ((r0 * cb) >> 4)];
|
||||
g = AlphaClampLUT[((g * ca) >> 4) + ((g0 * cb) >> 4)];
|
||||
b = AlphaClampLUT[((b * ca) >> 4) + ((b0 * cb) >> 4)];
|
||||
|
||||
return (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
static INLINE void gfxAlphaBlend(uint32 *ta, uint32 *tb, int ca, int cb)
|
||||
{
|
||||
for(int x = 0; x < 240; x++) {
|
||||
uint32 color = *ta;
|
||||
if(color < 0x80000000) {
|
||||
int r = (color & 0x1F);
|
||||
int g = ((color >> 5) & 0x1F);
|
||||
int b = ((color >> 10) & 0x1F);
|
||||
uint32 color2 = (*tb++);
|
||||
int r0 = (color2 & 0x1F);
|
||||
int g0 = ((color2 >> 5) & 0x1F);
|
||||
int b0 = ((color2 >> 10) & 0x1F);
|
||||
|
||||
r = AlphaClampLUT[((r * ca) >> 4) + ((r0 * cb) >> 4)];
|
||||
g = AlphaClampLUT[((g * ca) >> 4) + ((g0 * cb) >> 4)];
|
||||
b = AlphaClampLUT[((b * ca) >> 4) + ((b0 * cb) >> 4)];
|
||||
|
||||
*ta++ = (color & 0xFFFF0000) | (b << 10) | (g << 5) | r;
|
||||
} else {
|
||||
ta++;
|
||||
tb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_GFX_DRAW_H
|
174
mednafen/gba-09333/myrom.h
Normal file
174
mednafen/gba-09333/myrom.h
Normal file
@ -0,0 +1,174 @@
|
||||
0xEA000006,
|
||||
0xEA000093,
|
||||
0xEA000006,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0x00000000,
|
||||
0xEA000088,
|
||||
0x00000000,
|
||||
0xE3A00302,
|
||||
0xE1A0F000,
|
||||
0xE92D5800,
|
||||
0xE55EC002,
|
||||
0xE28FB03C,
|
||||
0xE79BC10C,
|
||||
0xE14FB000,
|
||||
0xE92D0800,
|
||||
0xE20BB080,
|
||||
0xE38BB01F,
|
||||
0xE129F00B,
|
||||
0xE92D4004,
|
||||
0xE1A0E00F,
|
||||
0xE12FFF1C,
|
||||
0xE8BD4004,
|
||||
0xE3A0C0D3,
|
||||
0xE129F00C,
|
||||
0xE8BD0800,
|
||||
0xE169F00B,
|
||||
0xE8BD5800,
|
||||
0xE1B0F00E,
|
||||
0x0000009C,
|
||||
0x0000009C,
|
||||
0x0000009C,
|
||||
0x0000009C,
|
||||
0x000001F8,
|
||||
0x000001F0,
|
||||
0x000000AC,
|
||||
0x000000A0,
|
||||
0x000000FC,
|
||||
0x00000168,
|
||||
0xE12FFF1E,
|
||||
0xE1A03000,
|
||||
0xE1A00001,
|
||||
0xE1A01003,
|
||||
0xE2113102,
|
||||
0x42611000,
|
||||
0xE033C040,
|
||||
0x22600000,
|
||||
0xE1B02001,
|
||||
0xE15200A0,
|
||||
0x91A02082,
|
||||
0x3AFFFFFC,
|
||||
0xE1500002,
|
||||
0xE0A33003,
|
||||
0x20400002,
|
||||
0xE1320001,
|
||||
0x11A020A2,
|
||||
0x1AFFFFF9,
|
||||
0xE1A01000,
|
||||
0xE1A00003,
|
||||
0xE1B0C08C,
|
||||
0x22600000,
|
||||
0x42611000,
|
||||
0xE12FFF1E,
|
||||
0xE92D0010,
|
||||
0xE1A0C000,
|
||||
0xE3A01001,
|
||||
0xE1500001,
|
||||
0x81A000A0,
|
||||
0x81A01081,
|
||||
0x8AFFFFFB,
|
||||
0xE1A0000C,
|
||||
0xE1A04001,
|
||||
0xE3A03000,
|
||||
0xE1A02001,
|
||||
0xE15200A0,
|
||||
0x91A02082,
|
||||
0x3AFFFFFC,
|
||||
0xE1500002,
|
||||
0xE0A33003,
|
||||
0x20400002,
|
||||
0xE1320001,
|
||||
0x11A020A2,
|
||||
0x1AFFFFF9,
|
||||
0xE0811003,
|
||||
0xE1B010A1,
|
||||
0xE1510004,
|
||||
0x3AFFFFEE,
|
||||
0xE1A00004,
|
||||
0xE8BD0010,
|
||||
0xE12FFF1E,
|
||||
0xE0010090,
|
||||
0xE1A01741,
|
||||
0xE2611000,
|
||||
0xE3A030A9,
|
||||
0xE0030391,
|
||||
0xE1A03743,
|
||||
0xE2833E39,
|
||||
0xE0030391,
|
||||
0xE1A03743,
|
||||
0xE2833C09,
|
||||
0xE283301C,
|
||||
0xE0030391,
|
||||
0xE1A03743,
|
||||
0xE2833C0F,
|
||||
0xE28330B6,
|
||||
0xE0030391,
|
||||
0xE1A03743,
|
||||
0xE2833C16,
|
||||
0xE28330AA,
|
||||
0xE0030391,
|
||||
0xE1A03743,
|
||||
0xE2833A02,
|
||||
0xE2833081,
|
||||
0xE0030391,
|
||||
0xE1A03743,
|
||||
0xE2833C36,
|
||||
0xE2833051,
|
||||
0xE0030391,
|
||||
0xE1A03743,
|
||||
0xE2833CA2,
|
||||
0xE28330F9,
|
||||
0xE0000093,
|
||||
0xE1A00840,
|
||||
0xE12FFF1E,
|
||||
0xE3A00001,
|
||||
0xE3A01001,
|
||||
0xE92D4010,
|
||||
0xE3A03000,
|
||||
0xE3A04001,
|
||||
0xE3500000,
|
||||
0x1B000004,
|
||||
0xE5CC3301,
|
||||
0xEB000002,
|
||||
0x0AFFFFFC,
|
||||
0xE8BD4010,
|
||||
0xE12FFF1E,
|
||||
0xE3A0C301,
|
||||
0xE5CC3208,
|
||||
0xE15C20B8,
|
||||
0xE0110002,
|
||||
0x10222000,
|
||||
0x114C20B8,
|
||||
0xE5CC4208,
|
||||
0xE12FFF1E,
|
||||
0xE92D500F,
|
||||
0xE3A00301,
|
||||
0xE1A0E00F,
|
||||
0xE510F004,
|
||||
0xE8BD500F,
|
||||
0xE25EF004,
|
||||
0xE59FD044,
|
||||
0xE92D5000,
|
||||
0xE14FC000,
|
||||
0xE10FE000,
|
||||
0xE92D5000,
|
||||
0xE3A0C302,
|
||||
0xE5DCE09C,
|
||||
0xE35E00A5,
|
||||
0x1A000004,
|
||||
0x05DCE0B4,
|
||||
0x021EE080,
|
||||
0xE28FE004,
|
||||
0x159FF018,
|
||||
0x059FF018,
|
||||
0xE59FD018,
|
||||
0xE8BD5000,
|
||||
0xE169F00C,
|
||||
0xE8BD5000,
|
||||
0xE25EF004,
|
||||
0x03007FF0,
|
||||
0x09FE2000,
|
||||
0x09FFC000,
|
||||
0x03007FE0
|
||||
|
37
mednafen/gba-09333/sram.cpp
Normal file
37
mednafen/gba-09333/sram.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#include "GBA.h"
|
||||
#include "Globals.h"
|
||||
#include "flash.h"
|
||||
#include "sram.h"
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
uint8 sramRead(uint32 address)
|
||||
{
|
||||
return flashSaveMemory[address & 0xFFFF];
|
||||
}
|
||||
|
||||
void sramWrite(uint32 address, uint8 byte)
|
||||
{
|
||||
flashSaveMemory[address & 0xFFFF] = byte;
|
||||
}
|
||||
|
||||
}
|
31
mednafen/gba-09333/sram.h
Normal file
31
mednafen/gba-09333/sram.h
Normal file
@ -0,0 +1,31 @@
|
||||
// -*- C++ -*-
|
||||
// VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator.
|
||||
// Copyright (C) 1999-2003 Forgotten
|
||||
// Copyright (C) 2004 Forgotten and the VBA development team
|
||||
|
||||
// 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, 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.
|
||||
|
||||
#ifndef VBA_SRAM_H
|
||||
#define VBA_SRAM_H
|
||||
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
extern uint8 sramRead(uint32 address);
|
||||
extern void sramWrite(uint32 address, uint8 byte);
|
||||
|
||||
}
|
||||
|
||||
#endif // VBA_SRAM_H
|
2115
mednafen/gba-09333/thumb.cpp
Normal file
2115
mednafen/gba-09333/thumb.cpp
Normal file
File diff suppressed because it is too large
Load Diff
6
mednafen/gba-09333/thumb.h
Normal file
6
mednafen/gba-09333/thumb.h
Normal file
@ -0,0 +1,6 @@
|
||||
namespace MDFN_IEN_GBA
|
||||
{
|
||||
|
||||
unsigned int RunTHUMB(void);
|
||||
|
||||
}
|
@ -25,6 +25,8 @@
|
||||
#define gzopen(a, b) fopen(a, b)
|
||||
#define gzread(a, b, c) fread(b, c, 1, a)
|
||||
#define gzclose(a) fclose(a)
|
||||
#define gzgetc(a) fgetc(a)
|
||||
#define gzseek(a,b,c) fseek(a,b,c)
|
||||
#else
|
||||
#define GET_FDATA(fp) (fp.Data())
|
||||
#define GET_FSIZE(fp) (fp.Size())
|
||||
@ -33,6 +35,8 @@
|
||||
#define GET_FEXTS_PTR(fp) (fp->ext)
|
||||
#define gzread(a, b, c) gzread(a, b, c)
|
||||
#define gzclose(a) gzclose(a)
|
||||
#define gzgetc(a) gzgetc(a)
|
||||
#define gzseek(a,b,c) gzseek(a,b,c)
|
||||
#endif
|
||||
|
||||
#ifndef gettext_noop
|
||||
|
@ -38,14 +38,10 @@ namespace MDFN_IEN_PSX
|
||||
|
||||
#define PSX_WARNING(format, ...) { PSX_DBG(PSX_DBG_WARNING, format "\n", ## __VA_ARGS__); }
|
||||
#define PSX_DBGINFO(format, ...) { }
|
||||
#elif defined(_WIN32)
|
||||
static INLINE void PSX_DBG(unsigned level, const char* format, ...) { }
|
||||
static INLINE void PSX_WARNING(const char* format, ...) { }
|
||||
static INLINE void PSX_DBGINFO(const char* format, ...) { }
|
||||
#else
|
||||
void PSX_DBG(unsigned level, const char *format, ...) throw() MDFN_COLD MDFN_FORMATSTR(printf, 2, 3);
|
||||
#define PSX_WARNING(format, ...) { }
|
||||
#define PSX_DBGINFO(format, ...) { }
|
||||
static void PSX_DBG(unsigned level, const char* format, ...) { }
|
||||
static void PSX_WARNING(const char* format, ...) { }
|
||||
static void PSX_DBGINFO(const char* format, ...) { }
|
||||
#endif
|
||||
|
||||
typedef int32 pscpu_timestamp_t;
|
||||
|
Loading…
Reference in New Issue
Block a user