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
|
|
|
|
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;
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
Memory::~Memory() {
|
|
|
|
free();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto Memory::operator[](uint addr) -> uint8& {
|
2010-12-28 01:53:15 +00:00
|
|
|
return data[addr];
|
|
|
|
}
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto Memory::allocate(uint size_) -> void {
|
2010-12-28 01:53:15 +00:00
|
|
|
free();
|
|
|
|
size = size_;
|
|
|
|
data = new uint8_t[size]();
|
|
|
|
}
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto Memory::copy(const uint8_t* data_, unsigned size_) -> void {
|
2010-12-28 01:53:15 +00:00
|
|
|
free();
|
|
|
|
size = size_;
|
|
|
|
data = new uint8_t[size];
|
|
|
|
memcpy(data, data_, size);
|
|
|
|
}
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto Memory::free() -> void {
|
2010-12-28 01:53:15 +00:00
|
|
|
if(data) {
|
|
|
|
delete[] data;
|
2015-11-21 07:36:48 +00:00
|
|
|
data = nullptr;
|
2010-12-28 01:53:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto Bus::read(uint16 addr) -> uint8 {
|
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);
|
|
|
|
|
2014-01-13 09:35:46 +00:00
|
|
|
if(cheat.enable()) {
|
|
|
|
if(auto result = cheat.find(addr, data)) return result();
|
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
|
|
|
}
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto Bus::write(uint16 addr, uint8 data) -> void {
|
2010-12-29 11:03:42 +00:00
|
|
|
mmio[addr]->mmio_write(addr, data);
|
|
|
|
}
|
2010-12-28 01:53:15 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto Bus::power() -> void {
|
|
|
|
for(auto n : range(65536)) mmio[n] = &unmapped;
|
2010-12-28 01:53:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|