ADDED shared, agb_core and gb_apu files to project file
This commit is contained in:
spacy51 2008-03-02 16:11:25 +00:00
parent f6b81b227b
commit 2d36cde81d
12 changed files with 627 additions and 9 deletions

View File

@ -2,21 +2,39 @@ TEMPLATE = app
CONFIG += qt release
QT += opengl
TARGET = VisualBoyAdvance
DEFINES += BKPT_SUPPORT
# Directory Locations
M_DIR_QT = ../../src/qt/
M_DIR_LANG = ../../lang/
M_DIR_SHARED = ../../src/
M_DIR_GBAPU = ../../src/dmg/gb_apu/
M_DIR_AGB = ../../src/agb/
M_DIR_DMG = ../../src/dmg/
# Tweaks
win32-msvc2005 {
DEFINES += _CRT_SECURE_NO_WARNINGS
DEFINES += NO_PNG
}
# Resource Files
RESOURCES += $${M_DIR_QT}vba-m.qrc
win32 {
RC_FILE = $${M_DIR_QT}vba-m.rc
}
# Language Files
# Language Files
TRANSLATIONS += $${M_DIR_LANG}german.ts
TRANSLATIONS += $${M_DIR_LANG}spanish.ts
# Qt GUI Files
PRECOMPILED_HEADER = $${M_DIR_QT}precompile.h
HEADERS += $${M_DIR_QT}version.h
@ -37,8 +55,115 @@ SOURCES += $${M_DIR_QT}MainOptions.cpp
HEADERS += $${M_DIR_QT}configdialog.h
SOURCES += $${M_DIR_QT}configdialog.cpp
HEADERS += $${M_DIR_QT}emu.h
SOURCES += $${M_DIR_QT}emu.cpp
HEADERS += $${M_DIR_QT}EmuManager.h
SOURCES += $${M_DIR_QT}EmuManager.cpp
HEADERS += $${M_DIR_QT}GraphicsOutput.h
SOURCES += $${M_DIR_QT}GraphicsOutput.cpp
# Shared Core Files
HEADERS += $${M_DIR_SHARED}System.h
HEADERS += $${M_DIR_SHARED}Globals.h
SOURCES += $${M_DIR_SHARED}Globals.cpp
#HEADERS += $${M_DIR_SHARED}armdis.h
#SOURCES += $${M_DIR_SHARED}armdis.cpp
HEADERS += $${M_DIR_SHARED}bios.h
SOURCES += $${M_DIR_SHARED}bios.cpp
HEADERS += $${M_DIR_SHARED}Cheats.h
SOURCES += $${M_DIR_SHARED}Cheats.cpp
#HEADERS += $${M_DIR_SHARED}CheatSearch.h
#SOURCES += $${M_DIR_SHARED}CheatSearch.cpp
HEADERS += $${M_DIR_SHARED}EEprom.h
SOURCES += $${M_DIR_SHARED}EEprom.cpp
HEADERS += $${M_DIR_SHARED}Flash.h
SOURCES += $${M_DIR_SHARED}Flash.cpp
HEADERS += $${M_DIR_SHARED}Sram.h
SOURCES += $${M_DIR_SHARED}Sram.cpp
HEADERS += $${M_DIR_SHARED}elf.h
SOURCES += $${M_DIR_SHARED}elf.cpp
HEADERS += $${M_DIR_SHARED}RTC.h
SOURCES += $${M_DIR_SHARED}RTC.cpp
HEADERS += $${M_DIR_SHARED}Sound.h
SOURCES += $${M_DIR_SHARED}Sound.cpp
HEADERS += $${M_DIR_SHARED}memgzio.h
SOURCES += $${M_DIR_SHARED}memgzio.c
HEADERS += $${M_DIR_SHARED}fex.h
SOURCES += $${M_DIR_SHARED}fex_mini.cpp
HEADERS += $${M_DIR_SHARED}Util.h
SOURCES += $${M_DIR_SHARED}Util.cpp
SOURCES += $${M_DIR_SHARED}Mode0.cpp
SOURCES += $${M_DIR_SHARED}Mode1.cpp
SOURCES += $${M_DIR_SHARED}Mode2.cpp
SOURCES += $${M_DIR_SHARED}Mode3.cpp
SOURCES += $${M_DIR_SHARED}Mode4.cpp
SOURCES += $${M_DIR_SHARED}Mode5.cpp
#HEADERS += $${M_DIR_SHARED}NLS.h
#HEADERS += $${M_DIR_SHARED}Port.h
#SOURCES += $${M_DIR_SHARED}remote.cpp
# GB APU
HEADERS += $${M_DIR_GBAPU}blargg_common.h
HEADERS += $${M_DIR_GBAPU}blargg_config.h
HEADERS += $${M_DIR_GBAPU}blargg_source.h
HEADERS += $${M_DIR_GBAPU}Blip_Buffer.h
SOURCES += $${M_DIR_GBAPU}Blip_Buffer.cpp
HEADERS += $${M_DIR_GBAPU}Effects_Buffer.h
SOURCES += $${M_DIR_GBAPU}Effects_Buffer.cpp
HEADERS += $${M_DIR_GBAPU}Gb_Apu.h
SOURCES += $${M_DIR_GBAPU}Gb_Apu.cpp
SOURCES += $${M_DIR_GBAPU}Gb_Apu_State.cpp
HEADERS += $${M_DIR_GBAPU}Gb_Oscs.h
SOURCES += $${M_DIR_GBAPU}Gb_Oscs.cpp
HEADERS += $${M_DIR_GBAPU}Multi_Buffer.h
SOURCES += $${M_DIR_GBAPU}Multi_Buffer.cpp
# GBA Core Files
HEADERS += $${M_DIR_AGB}agbprint.h
SOURCES += $${M_DIR_AGB}agbprint.cpp
HEADERS += $${M_DIR_AGB}GBA.h
SOURCES += $${M_DIR_AGB}GBA.cpp
#HEADERS += $${M_DIR_AGB}gbafilter.h
#SOURCES += $${M_DIR_AGB}gbafilter.cpp
HEADERS += $${M_DIR_AGB}GBAGfx.h
SOURCES += $${M_DIR_AGB}GBAGfx.cpp
#HEADERS += $${M_DIR_AGB}GBALink.h
#SOURCES += $${M_DIR_AGB}GBALink.cpp
SOURCES += $${M_DIR_AGB}GBA-arm.cpp
SOURCES += $${M_DIR_AGB}GBA-thumb.cpp
HEADERS += $${M_DIR_AGB}GBAcpu.h
HEADERS += $${M_DIR_AGB}GBAinline.h

View File

@ -177,6 +177,14 @@
<Filter
Name="EmuManager"
>
<File
RelativePath="..\..\src\qt\emu.cpp"
>
</File>
<File
RelativePath="..\..\src\qt\emu.h"
>
</File>
<File
RelativePath="..\..\src\qt\EmuManager.cpp"
>
@ -187,6 +195,242 @@
</File>
</Filter>
</Filter>
<Filter
Name="Core"
>
<Filter
Name="Shared"
>
<File
RelativePath="..\..\src\bios.cpp"
>
</File>
<File
RelativePath="..\..\src\bios.h"
>
</File>
<File
RelativePath="..\..\src\Cheats.cpp"
>
</File>
<File
RelativePath="..\..\src\Cheats.h"
>
</File>
<File
RelativePath="..\..\src\EEprom.cpp"
>
</File>
<File
RelativePath="..\..\src\EEprom.h"
>
</File>
<File
RelativePath="..\..\src\elf.cpp"
>
</File>
<File
RelativePath="..\..\src\elf.h"
>
</File>
<File
RelativePath="..\..\src\fex.h"
>
</File>
<File
RelativePath="..\..\src\fex_mini.cpp"
>
</File>
<File
RelativePath="..\..\src\Flash.cpp"
>
</File>
<File
RelativePath="..\..\src\Flash.h"
>
</File>
<File
RelativePath="..\..\src\Globals.cpp"
>
</File>
<File
RelativePath="..\..\src\Globals.h"
>
</File>
<File
RelativePath="..\..\src\memgzio.c"
>
</File>
<File
RelativePath="..\..\src\memgzio.h"
>
</File>
<File
RelativePath="..\..\src\Mode0.cpp"
>
</File>
<File
RelativePath="..\..\src\Mode1.cpp"
>
</File>
<File
RelativePath="..\..\src\Mode2.cpp"
>
</File>
<File
RelativePath="..\..\src\Mode3.cpp"
>
</File>
<File
RelativePath="..\..\src\Mode4.cpp"
>
</File>
<File
RelativePath="..\..\src\Mode5.cpp"
>
</File>
<File
RelativePath="..\..\src\RTC.cpp"
>
</File>
<File
RelativePath="..\..\src\RTC.h"
>
</File>
<File
RelativePath="..\..\src\Sound.cpp"
>
</File>
<File
RelativePath="..\..\src\Sound.h"
>
</File>
<File
RelativePath="..\..\src\Sram.cpp"
>
</File>
<File
RelativePath="..\..\src\Sram.h"
>
</File>
<File
RelativePath="..\..\src\System.h"
>
</File>
<File
RelativePath="..\..\src\Util.cpp"
>
</File>
<File
RelativePath="..\..\src\Util.h"
>
</File>
</Filter>
<Filter
Name="GBA"
>
<File
RelativePath="..\..\src\agb\agbprint.cpp"
>
</File>
<File
RelativePath="..\..\src\agb\agbprint.h"
>
</File>
<File
RelativePath="..\..\src\agb\GBA-arm.cpp"
>
</File>
<File
RelativePath="..\..\src\agb\GBA-thumb.cpp"
>
</File>
<File
RelativePath="..\..\src\agb\GBA.cpp"
>
</File>
<File
RelativePath="..\..\src\agb\GBA.h"
>
</File>
<File
RelativePath="..\..\src\agb\GBAcpu.h"
>
</File>
<File
RelativePath="..\..\src\agb\GBAGfx.cpp"
>
</File>
<File
RelativePath="..\..\src\agb\GBAGfx.h"
>
</File>
<File
RelativePath="..\..\src\agb\GBAinline.h"
>
</File>
</Filter>
<Filter
Name="APU"
>
<File
RelativePath="..\..\src\dmg\gb_apu\blargg_common.h"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\blargg_config.h"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\blargg_source.h"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Blip_Buffer.cpp"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Blip_Buffer.h"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Effects_Buffer.cpp"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Effects_Buffer.h"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Gb_Apu.cpp"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Gb_Apu.h"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Gb_Apu_State.cpp"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Gb_Oscs.cpp"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Gb_Oscs.h"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Multi_Buffer.cpp"
>
</File>
<File
RelativePath="..\..\src\dmg\gb_apu\Multi_Buffer.h"
>
</File>
</Filter>
</Filter>
</Files>
<Globals>
</Globals>

View File

@ -111,6 +111,9 @@ extern void Sm60FPS_Sleep();
extern void DbgMsg(const char *msg, ...);
extern void winlog(const char *,...);
extern void dbgOutput(const char *s, u32 addr);
extern void dbgSignal(int sig,int number);
extern bool systemSoundOn;
extern u16 systemColorMap16[0x10000];
extern u32 systemColorMap32[0x10000];

View File

@ -21,9 +21,11 @@
#include <string.h>
#include <zlib.h>
#ifndef NO_PNG
extern "C" {
#include <png.h>
}
#endif
#include "System.h"
#include "NLS.h"
@ -58,6 +60,7 @@ static int (ZEXPORT *utilGzCloseFunc)(gzFile) = NULL;
bool utilWritePNGFile(const char *fileName, int w, int h, u8 *pix)
{
#ifndef NO_PNG
u8 writeBuffer[512 * 3];
FILE *fp = fopen(fileName,"wb");
@ -182,6 +185,9 @@ bool utilWritePNGFile(const char *fileName, int w, int h, u8 *pix)
fclose(fp);
return true;
#else
return false;
#endif
}
void utilPutDword(u8 *p, u32 value)

View File

@ -68,7 +68,6 @@ static INSN_REGPARM void armUnknownInsn(u32 opcode)
#ifdef BKPT_SUPPORT
static INSN_REGPARM void armBreakpoint(u32 opcode)
{
extern void (*dbgSignal)(int,int);
reg[15].I -= 4;
armNextPC -= 4;
dbgSignal(5, (opcode & 0x0f) | ((opcode>>4) & 0xfff0));
@ -119,7 +118,6 @@ static void count(u32 opcode, int cond_res)
#ifdef BKPT_SUPPORT
#define CONSOLE_OUTPUT(a,b) do { \
extern void (*dbgOutput)(char *, u32); \
if ((opcode == 0xe0000000) && (reg[0].I == 0xC0DED00D)) { \
dbgOutput((a), (b)); \
} while (0)

View File

@ -62,7 +62,6 @@ static INSN_REGPARM void thumbUnknownInsn(u32 opcode)
#ifdef BKPT_SUPPORT
static INSN_REGPARM void thumbBreakpoint(u32 opcode)
{
extern void (*dbgSignal)(int,int);
reg[15].I -= 2;
armNextPC -= 2;
dbgSignal(5, opcode & 255);
@ -75,7 +74,6 @@ static INSN_REGPARM void thumbBreakpoint(u32 opcode)
#ifdef BKPT_SUPPORT
# define THUMB_CONSOLE_OUTPUT(a,b) do { \
if ((opcode == 0x4000) && (reg[0].I == 0xC0DED00D)) { \
extern void (*dbgOutput)(const char *, u32); \
dbgOutput((a), (b)); \
} \
} while (0)

View File

@ -1685,7 +1685,6 @@ void CPUSoftwareInterrupt(int comment)
if(armState) comment >>= 16;
#ifdef BKPT_SUPPORT
if(comment == 0xff) {
extern void (*dbgOutput)(const char *, u32);
dbgOutput(NULL, reg[0].I);
return;
}

View File

@ -67,8 +67,6 @@ bool agbPrintIsEnabled()
return agbPrintEnabled;
}
extern void (*dbgOutput)(const char *, u32);
void agbPrintFlush()
{
u16 get = debuggerReadHalfWord(0x9fe20fc);

View File

@ -19,8 +19,12 @@
#ifndef EMUMANAGER_H
#define EMUMANAGER_H
#include "precompile.h"
#include "emu.h"
// class to abstract emulation control
class EmuManager
{
@ -38,4 +42,5 @@ private:
unsigned char *romBuffer;
};
#endif // #ifndef EMUMANAGER_H

173
src/qt/emu.cpp Normal file
View File

@ -0,0 +1,173 @@
// VBA-M, A Nintendo Handheld Console Emulator
// Copyright (C) 2008 VBA-M 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.
// This file adds all the code required by System.h
#include "emu.h"
int emulating = 0;
int systemFrameSkip = 0;
int systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
bool systemSoundOn = false;
u32 systemColorMap32[0x10000];
u16 systemColorMap16[0x10000];
int systemRedShift = 0;
int systemBlueShift = 0;
int systemGreenShift = 0;
int systemColorDepth = 32;
int systemDebug = 0;
int systemVerbose = 0;
bool systemReadJoypads()
{
// TODO: implement
return false;
}
u32 systemReadJoypad( int which )
{
// TODO: implement
return 0;
}
void systemUpdateMotionSensor()
{
// TODO: implement
}
int systemGetSensorX()
{
// TODO: implement
return 0;
}
int systemGetSensorY()
{
// TODO: implement
return 0;
}
u32 systemGetClock()
{
// TODO: implement
return 0;
}
void systemMessage( int number, const char *defaultMsg, ... )
{
// TODO: implement
}
void systemScreenCapture( int captureNumber )
{
// TODO: implement
}
void systemDrawScreen()
{
// TODO: implement
}
void systemShowSpeed( int speed )
{
// TODO: implement
}
void system10Frames( int rate )
{
// TODO: implement
}
void systemFrame()
{
// TODO: implement
}
bool systemPauseOnFrame()
{
// TODO: implement
return false;
}
void dbgOutput( const char *s, u32 addr )
{
// TODO: implement
}
void dbgSignal( int sig,int number )
{
// TODO: implement
}
void winlog( const char *msg, ... )
{
// TODO: implement
}
void systemWriteDataToSoundBuffer()
{
// TODO: implement
}
void systemSoundShutdown()
{
// TODO: implement
}
void systemSoundPause()
{
// TODO: implement
}
void systemSoundResume()
{
// TODO: implement
}
void systemSoundReset()
{
// TODO: implement
}
bool systemSoundInit()
{
// TODO: implement
return false;
}
bool systemCanChangeSoundQuality()
{
// TODO: implement
return false;
}

70
src/qt/emu.h Normal file
View File

@ -0,0 +1,70 @@
// VBA-M, A Nintendo Handheld Console Emulator
// Copyright (C) 2008 VBA-M 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 EMU_H
#define EMU_H
#include "../System.h"
// Global Variables
extern int emulating;
extern int systemFrameSkip;
extern int systemSaveUpdateCounter;
extern bool systemSoundOn;
extern u32 systemColorMap32[0x10000];
extern u16 systemColorMap16[0x10000];
extern int systemRedShift;
extern int systemBlueShift;
extern int systemGreenShift;
extern int systemColorDepth;
extern int systemDebug;
extern int systemVerbose;
// Global Functions
bool systemReadJoypads();
u32 systemReadJoypad( int which );
void systemUpdateMotionSensor();
int systemGetSensorX();
int systemGetSensorY();
u32 systemGetClock();
void systemMessage( int number, const char *defaultMsg, ... );
void dbgOutput( const char *s, u32 addr );
void dbgSignal( int sig,int number );
void winlog( const char *msg, ... );
bool systemPauseOnFrame();
void systemScreenCapture( int captureNumber );
void systemDrawScreen();
void systemShowSpeed( int speed );
void system10Frames( int rate );
void systemFrame();
void systemWriteDataToSoundBuffer();
void systemSoundShutdown();
void systemSoundPause();
void systemSoundResume();
void systemSoundReset();
bool systemSoundInit();
bool systemCanChangeSoundQuality();
#endif // #ifndef EMU_H

View File

@ -48,7 +48,6 @@ extern bool debugger;
extern void CPUUpdateCPSR();
#ifdef SDL
extern void (*dbgMain)();
extern void (*dbgSignal)(int,int);
extern void debuggerMain();
extern void debuggerSignal(int,int);
#endif