2012-04-26 10:51:13 +00:00
|
|
|
struct CPU : Processor::LR35902, Thread, MMIO {
|
2011-01-02 04:46:54 +00:00
|
|
|
enum class Interrupt : unsigned {
|
|
|
|
Vblank,
|
|
|
|
Stat,
|
|
|
|
Timer,
|
|
|
|
Serial,
|
|
|
|
Joypad,
|
|
|
|
};
|
|
|
|
|
2010-12-28 06:03:02 +00:00
|
|
|
struct Status {
|
2011-01-04 10:42:27 +00:00
|
|
|
unsigned clock;
|
2010-12-30 07:18:47 +00:00
|
|
|
|
|
|
|
//$ff00 JOYP
|
|
|
|
bool p15;
|
|
|
|
bool p14;
|
2010-12-31 05:43:47 +00:00
|
|
|
uint8 joyp;
|
2011-01-06 10:16:07 +00:00
|
|
|
uint8 mlt_req;
|
2010-12-30 07:18:47 +00:00
|
|
|
|
Update to v074r11 release.
byuu says:
Changelog:
- debugger compiles on all three profiles
- libsnes compiles on all three platforms (no API changes to libsnes)
- memory.cpp : namespace memory removed (wram -> cpu, apuram -> smp,
vram, oam, cgram -> ppu)
- sa1.cpp : namespace memory removed (SA-1 specific functions merged
inline to SA1::bus_read,write)
- GameBoy: added serial link support with interrupts and proper 8192hz
timing, but obviously it acts as if no other GB is connected to it
- GameBoy: added STAT OAM interrupt, and better STAT d1,d0 mode values
- UI: since Qt is dead, I've renamed the config files back to bsnes.cfg
and bsnes-geometry.cfg
- SA1: IRAM was not syncing to CPU on SA-1 side
- PPU/Accuracy and PPU/Performance needed Sprite oam renamed to Sprite
sprite; so that I could add uint8 oam[544]
- makes more sense anyway, OAM = object attribute memory, obj or
sprite are better names for Sprite rendering class
- more cleanup
2011-01-24 09:03:17 +00:00
|
|
|
//$ff01 SB
|
|
|
|
uint8 serial_data;
|
|
|
|
unsigned serial_bits;
|
|
|
|
|
|
|
|
//$ff02 SC
|
|
|
|
bool serial_transfer;
|
|
|
|
bool serial_clock;
|
|
|
|
|
2010-12-30 07:18:47 +00:00
|
|
|
//$ff04 DIV
|
|
|
|
uint8 div;
|
|
|
|
|
|
|
|
//$ff05 TIMA
|
|
|
|
uint8 tima;
|
|
|
|
|
|
|
|
//$ff06 TMA
|
|
|
|
uint8 tma;
|
|
|
|
|
|
|
|
//$ff07 TAC
|
|
|
|
bool timer_enable;
|
|
|
|
unsigned timer_clock;
|
|
|
|
|
|
|
|
//$ff0f IF
|
|
|
|
bool interrupt_request_joypad;
|
|
|
|
bool interrupt_request_serial;
|
|
|
|
bool interrupt_request_timer;
|
|
|
|
bool interrupt_request_stat;
|
|
|
|
bool interrupt_request_vblank;
|
|
|
|
|
2011-10-27 00:00:17 +00:00
|
|
|
//$ff4d KEY1
|
|
|
|
bool speed_double;
|
|
|
|
bool speed_switch;
|
|
|
|
|
|
|
|
//$ff51,$ff52 HDMA1,HDMA2
|
|
|
|
uint16 dma_source;
|
|
|
|
|
|
|
|
//$ff53,$ff54 HDMA3,HDMA4
|
|
|
|
uint16 dma_target;
|
|
|
|
|
|
|
|
//$ff55 HDMA5
|
|
|
|
bool dma_mode;
|
|
|
|
uint16 dma_length;
|
|
|
|
|
|
|
|
//$ff6c ???
|
|
|
|
uint8 ff6c;
|
|
|
|
|
|
|
|
//$ff70 SVBK
|
|
|
|
uint3 wram_bank;
|
|
|
|
|
|
|
|
//$ff72-$ff75 ???
|
|
|
|
uint8 ff72;
|
|
|
|
uint8 ff73;
|
|
|
|
uint8 ff74;
|
|
|
|
uint8 ff75;
|
|
|
|
|
2010-12-30 07:18:47 +00:00
|
|
|
//$ffff IE
|
|
|
|
bool interrupt_enable_joypad;
|
|
|
|
bool interrupt_enable_serial;
|
|
|
|
bool interrupt_enable_timer;
|
|
|
|
bool interrupt_enable_stat;
|
|
|
|
bool interrupt_enable_vblank;
|
2010-12-28 06:03:02 +00:00
|
|
|
} status;
|
|
|
|
|
2011-10-27 00:00:17 +00:00
|
|
|
uint8 wram[32768]; //GB=8192, GBC=32768
|
2010-12-29 11:03:42 +00:00
|
|
|
uint8 hram[128];
|
|
|
|
|
2010-12-28 06:03:02 +00:00
|
|
|
static void Main();
|
2010-12-28 01:53:15 +00:00
|
|
|
void main();
|
2011-01-02 04:46:54 +00:00
|
|
|
void interrupt_raise(Interrupt id);
|
2010-12-30 07:18:47 +00:00
|
|
|
void interrupt_test();
|
|
|
|
void interrupt_exec(uint16 pc);
|
Update to v088r08 release.
byuu says:
From this WIP, I'm starting on the impossible task of
a declarative-based GUI, which I'm calling Ethos.
base/ becomes emulator/, and we add emulator/interface.hpp, which is
a base API that all emulation cores must implement in full.
(Right now, it's kind of a hybrid to work with the old GUI and the new
GUI at the same time, of course.)
Unlike the old interfaces, the new base class also provides all general
usability hooks: loading and saving files and states, cheat codes, etc.
The new interface also contains information and vector structs to
describe all possible loading methods, controller bindings, etc; and
gives names for them all.
The actual GUI in fact should not include eg <gba/gba.hpp> anymore.
Should speed up GUI compilation.
So the idea going forward is that ethos will build a list of emulators
right when the application starts up.
Once you've appended an emulator to that list, you're done. No more GUI
changes are needed to support that system.
The GUI will have code to parse the emulator interfaces list, and build
all the requisite GUI options dynamically, declarative style.
Ultimately, once the project is finished, the new GUI should look ~99%
identical to the current GUI. But it'll probably be a whole lot smaller.
2012-04-29 06:29:54 +00:00
|
|
|
bool stop();
|
2010-12-28 01:53:15 +00:00
|
|
|
void power();
|
2011-01-07 11:11:56 +00:00
|
|
|
|
|
|
|
void serialize(serializer&);
|
2012-04-26 10:51:13 +00:00
|
|
|
|
|
|
|
//mmio.cpp
|
|
|
|
unsigned wram_addr(uint16 addr) const;
|
|
|
|
void mmio_joyp_poll();
|
|
|
|
uint8 mmio_read(uint16 addr);
|
|
|
|
void mmio_write(uint16 addr, uint8 data);
|
|
|
|
|
|
|
|
//memory.cpp
|
|
|
|
void op_io();
|
|
|
|
uint8 op_read(uint16 addr);
|
|
|
|
void op_write(uint16 addr, uint8 data);
|
|
|
|
void cycle_edge();
|
|
|
|
uint8 debugger_read(uint16 addr);
|
|
|
|
|
|
|
|
//timing.cpp
|
|
|
|
void add_clocks(unsigned clocks);
|
|
|
|
void timer_262144hz();
|
|
|
|
void timer_65536hz();
|
|
|
|
void timer_16384hz();
|
|
|
|
void timer_8192hz();
|
|
|
|
void timer_4096hz();
|
|
|
|
void hblank();
|
2010-12-28 01:53:15 +00:00
|
|
|
};
|
|
|
|
|
2011-01-22 08:15:49 +00:00
|
|
|
extern CPU cpu;
|