Update to v087r04 release.
byuu says:
Changelog:
- gameboy/ -> gb/
- GameBoy -> GB
- basic memory map for GBA
- enough code to execute the first BIOS instruction (b 0x68)
I have the code resetting r(15) to 0 on an exception just as a test.
Since that flushes the pipeline, that means we're basically executing "b
0x68" at 8MHz, and nothing else.
... and I am getting __6 motherfucking FPS__ at 4.4GHz on an i7.
Something is seriously, horribly, unfuckingbelievably wrong here, and
I can't figure out what it is.
My *fully complete* ARM core on the ST018 is even less efficient and
runs at 21.47MHz, and yet I get 60fps even after emulating the SNES
CPU+PPU @ 10+MHz each as well.
... I'm stuck. I can't proceed until we figure out what in the holy fuck
is going on here. So ... if anyone can help, please do. If we can't fix
this, the GBA emulation is dead.
I was able to profile on Windows, and I've included that in this WIP
under out/log.txt.
But it looks normal to me. But yeah, there's NO. FUCKING. WAY. This code
should be running this slowly.
2012-03-18 12:35:53 +00:00
|
|
|
#include <gb/gb.hpp>
|
2010-12-28 01:53:15 +00:00
|
|
|
|
|
|
|
#define MEMORY_CPP
|
2012-04-26 10:51:13 +00:00
|
|
|
namespace GameBoy {
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2010-12-29 11:03:42 +00:00
|
|
|
Unmapped unmapped;
|
2010-12-28 01:53:15 +00:00
|
|
|
Bus bus;
|
|
|
|
|
|
|
|
uint8_t& Memory::operator[](unsigned addr) {
|
|
|
|
return data[addr];
|
|
|
|
}
|
|
|
|
|
|
|
|
void Memory::allocate(unsigned size_) {
|
|
|
|
free();
|
|
|
|
size = size_;
|
|
|
|
data = new uint8_t[size]();
|
|
|
|
}
|
|
|
|
|
|
|
|
void Memory::copy(const uint8_t *data_, unsigned size_) {
|
|
|
|
free();
|
|
|
|
size = size_;
|
|
|
|
data = new uint8_t[size];
|
|
|
|
memcpy(data, data_, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Memory::free() {
|
|
|
|
if(data) {
|
|
|
|
delete[] data;
|
|
|
|
data = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Memory::Memory() {
|
|
|
|
data = 0;
|
|
|
|
size = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Memory::~Memory() {
|
|
|
|
free();
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
uint8 Bus::read(uint16 addr) {
|
Update to v082r10 release.
byuu says:
Emulated the Game Genie for the NES and Game Boy, and wrote a new cheat
editor that doesn't reach into specific emulation cores so that it would
work.
Before you ask: yes, long-term I'd like Super Game Boy mode to accept
Game Boy codes. But that's not high on the priority list.
Renamed the mappers toward board names, LZ...->BandaiFCG,
LS161...->AOROM, added CNROM emulation (Adventure Island, Gradius, etc.)
Added the tools menu load/save state stuff, but note that the NES
doesn't have save state support yet (waiting for the interface to
stabilize a bit more first.)
Note: this will be the last release to have the ui-gameboy folder, it's
been deleted locally from my end, as the new multi-GUI does all that it
does and more now.
2011-09-15 12:23:13 +00:00
|
|
|
uint8 data = mmio[addr]->mmio_read(addr);
|
|
|
|
|
|
|
|
if(cheat.override[addr]) {
|
2011-09-15 12:41:49 +00:00
|
|
|
for(unsigned n = 0; n < cheat.size(); n++) {
|
|
|
|
if(cheat[n].addr == addr) {
|
|
|
|
if(cheat[n].comp > 255 || cheat[n].comp == data) {
|
Update to v082r15 release.
byuu says:
7.5 hours of power coding. Das Keyboard definitely helped (but didn't
eliminate) RSI, neato.
Okay, the NES resampler was using 315 / 88.8 by mistake, so the output
rate was wrong, causing way more video/audio stuttering than necessary.
STILL forgot the NES APU frame IRQ clear thing on $4015 reads, blah. Why
do I always remember things right after uploading the WIPs?
Recreated the input manager with a new design, works much nicer than the
old one, a whole lot less duplicated code.
Recreated the input settings window to work with the new multi-system
emulation.
All input settings are saved to their own configuration file, input.cfg.
Going to batch folder for now.
Okay, so the new input settings window ... basically there are now three
drop-downs, and I'm not even trying to label them anymore.
They are primary, secondary, tertiary selectors for the listed group
below. Examples:
"NES -> Controller Port 1 -> Gamepad"
"SNES -> Controller Port 2 -> Super Scope"
"User Interface -> Hotkeys -> Save States"
I am aware that "Clear" gets disabled when assigning. I will work on
that later, being lazy for now and disabling the entire window. Have to
add the mouse binders back, too.
Escape and modifiers are both mappable as individual keys now. If you
want to clear, click the damn clear button :P
Oh, and all input goes to all windows for now. That'll be fixed too when
input focus stuff is re-added.
2011-09-17 06:42:17 +00:00
|
|
|
data = cheat[n].data;
|
|
|
|
break;
|
Update to v082r10 release.
byuu says:
Emulated the Game Genie for the NES and Game Boy, and wrote a new cheat
editor that doesn't reach into specific emulation cores so that it would
work.
Before you ask: yes, long-term I'd like Super Game Boy mode to accept
Game Boy codes. But that's not high on the priority list.
Renamed the mappers toward board names, LZ...->BandaiFCG,
LS161...->AOROM, added CNROM emulation (Adventure Island, Gradius, etc.)
Added the tools menu load/save state stuff, but note that the NES
doesn't have save state support yet (waiting for the interface to
stabilize a bit more first.)
Note: this will be the last release to have the ui-gameboy folder, it's
been deleted locally from my end, as the new multi-GUI does all that it
does and more now.
2011-09-15 12:23:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return data;
|
2010-12-28 01:53:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Bus::write(uint16 addr, uint8 data) {
|
2010-12-29 11:03:42 +00:00
|
|
|
mmio[addr]->mmio_write(addr, data);
|
|
|
|
}
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2010-12-29 11:03:42 +00:00
|
|
|
void Bus::power() {
|
2011-01-29 09:48:44 +00:00
|
|
|
for(unsigned n = 0x0000; n <= 0xffff; n++) mmio[n] = &unmapped;
|
2010-12-28 01:53:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|