2015-11-21 07:36:48 +00:00
|
|
|
//Hitachi HG51B169 (HG51BS family/derivative?)
|
|
|
|
|
Update to v087r08 release.
byuu says:
Added some more ARM opcodes, hooked up MMIO. Bind it with mmio[(addr
000-3ff)] = this; inside CPU/PPU/APU, goes to read(), write().
Also moved the Hitachi HG51B core to processor/, and split it apart from
the snes/chip/hitachidsp implementation.
This one actually worked really well. Very clean split between MMIO/DMA
and the processor core. I may move a more generic DMA function inside
the core, not sure yet.
I still believe the HG51B169 to be a variant of the HG51BS family, but
given they're meant to be incredibly flexible microcontrollers, it's
possible that each variant gets its own instruction set.
So, who knows. We'll worry about it if we ever find another HG51B DSP,
I guess.
GBA BIOS is constantly reading from 04000300, but it never writes. If
I return prng()&1, I can get it to proceed until it hits a bad opcode
(stc opcode, which the GBA lacks a coprocessor so ... bad codepath.)
Without it, it just reads that register forever and keeps resetting the
system, or something ...
I guess we're going to have to try and get ARMwrestler working, because
the BIOS seems to need too much emulation code to do anything at all.
2012-03-24 07:52:36 +00:00
|
|
|
#ifndef PROCESSOR_HG51B_HPP
|
|
|
|
#define PROCESSOR_HG51B_HPP
|
|
|
|
|
|
|
|
namespace Processor {
|
|
|
|
|
|
|
|
struct HG51B {
|
2015-11-21 07:36:48 +00:00
|
|
|
auto exec(uint24 addr) -> void;
|
|
|
|
virtual auto bus_read(uint24 addr) -> uint8 = 0;
|
|
|
|
virtual auto bus_write(uint24 addr, uint8 data) -> void = 0;
|
|
|
|
|
|
|
|
auto power() -> void;
|
|
|
|
auto serialize(serializer&) -> void;
|
|
|
|
|
Update to v087r08 release.
byuu says:
Added some more ARM opcodes, hooked up MMIO. Bind it with mmio[(addr
000-3ff)] = this; inside CPU/PPU/APU, goes to read(), write().
Also moved the Hitachi HG51B core to processor/, and split it apart from
the snes/chip/hitachidsp implementation.
This one actually worked really well. Very clean split between MMIO/DMA
and the processor core. I may move a more generic DMA function inside
the core, not sure yet.
I still believe the HG51B169 to be a variant of the HG51BS family, but
given they're meant to be incredibly flexible microcontrollers, it's
possible that each variant gets its own instruction set.
So, who knows. We'll worry about it if we ever find another HG51B DSP,
I guess.
GBA BIOS is constantly reading from 04000300, but it never writes. If
I return prng()&1, I can get it to proceed until it hits a bad opcode
(stc opcode, which the GBA lacks a coprocessor so ... bad codepath.)
Without it, it just reads that register forever and keeps resetting the
system, or something ...
I guess we're going to have to try and get ARMwrestler working, because
the BIOS seems to need too much emulation code to do anything at all.
2012-03-24 07:52:36 +00:00
|
|
|
//uint16 programROM[2][256];
|
|
|
|
uint24 dataROM[1024];
|
|
|
|
uint8 dataRAM[3072];
|
|
|
|
|
|
|
|
protected:
|
2015-11-21 07:36:48 +00:00
|
|
|
auto push() -> void;
|
|
|
|
auto pull() -> void;
|
|
|
|
auto sa() -> uint;
|
|
|
|
auto ri() -> uint;
|
|
|
|
auto np() -> uint;
|
|
|
|
auto instruction() -> void;
|
|
|
|
|
|
|
|
//registers.cpp
|
|
|
|
auto reg_read(uint8 addr) const -> uint24;
|
|
|
|
auto reg_write(uint8 addr, uint24 data) -> void;
|
|
|
|
|
|
|
|
struct Registers {
|
|
|
|
bool halt;
|
|
|
|
|
|
|
|
uint24 pc;
|
|
|
|
uint16 p;
|
|
|
|
bool n;
|
|
|
|
bool z;
|
|
|
|
bool c;
|
|
|
|
|
|
|
|
uint24 a;
|
|
|
|
uint24 acch;
|
|
|
|
uint24 accl;
|
|
|
|
uint24 busdata;
|
|
|
|
uint24 romdata;
|
|
|
|
uint24 ramdata;
|
|
|
|
uint24 busaddr;
|
|
|
|
uint24 ramaddr;
|
|
|
|
uint24 gpr[16];
|
|
|
|
} regs;
|
|
|
|
|
|
|
|
uint24 stack[8];
|
|
|
|
uint16 opcode;
|
Update to v087r08 release.
byuu says:
Added some more ARM opcodes, hooked up MMIO. Bind it with mmio[(addr
000-3ff)] = this; inside CPU/PPU/APU, goes to read(), write().
Also moved the Hitachi HG51B core to processor/, and split it apart from
the snes/chip/hitachidsp implementation.
This one actually worked really well. Very clean split between MMIO/DMA
and the processor core. I may move a more generic DMA function inside
the core, not sure yet.
I still believe the HG51B169 to be a variant of the HG51BS family, but
given they're meant to be incredibly flexible microcontrollers, it's
possible that each variant gets its own instruction set.
So, who knows. We'll worry about it if we ever find another HG51B DSP,
I guess.
GBA BIOS is constantly reading from 04000300, but it never writes. If
I return prng()&1, I can get it to proceed until it hits a bad opcode
(stc opcode, which the GBA lacks a coprocessor so ... bad codepath.)
Without it, it just reads that register forever and keeps resetting the
system, or something ...
I guess we're going to have to try and get ARMwrestler working, because
the BIOS seems to need too much emulation code to do anything at all.
2012-03-24 07:52:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|