mIntController =
new IntController(mLcdController, mOsTimer, mGpioController, mUart, mRtc);
mPowerManager = new PowerManager();
+ mAsic14 = new ASIC14(mGpioController);
MemoryBlockC0 = new uint8_t[MemoryBlockMask + 1];
MemoryBlockC8 = new uint8_t[MemoryBlockMask + 1];
delete mPowerManager;
delete mResetController;
delete mRtc;
+ delete mAsic14;
delete[] MemoryBlockC0;
delete[] MemoryBlockC8;
delete[] ROM;
mIntController->reset();
mGpioController->reset();
mRtc->reset();
+ mAsic14->reset();
reset();
}
mIntController->reset();
mGpioController->reset();
mRtc->reset();
+ mAsic14->reset();
reset();
}
nextTickAt += Series7::TICK_INTERVAL;
}
+ mAsic14->tick(passedCycles);
mRtc->run(passedCycles);
mGpioController->run();
mUart->run(passedCycles);
}
void Emulator::updateTouchInput(int32_t x, int32_t y, bool down) {
- mAsic14->setTouch(x, y, down);
+ mAsic14->setTouch(x, y, down);
}
} // namespace SA1100
#include "emubase.h"
#include "series7_defs.h"
+#include "asic14.h"
#include "gpio_controller.h"
#include "interrupt_controller.h"
#include "lcd_controller.h"
namespace SA1100 {
+using namespace Series7;
+
// Relatively simple implementation of a StrongARM SA-1100 CPU
//
// The following resources are invaluable to determining how the SA-1100
ResetController* mResetController;
RTC* mRtc;
Uart* mUart;
+ ASIC14* mAsic14;
public:
MaybeU32 readPhysical(uint32_t physAddr, ValueSize valueSize) override;
private:
uint8_t readPhysical8(uint32_t physAddr);
+ MaybeU32 readPhysical16(uint32_t physAddr);
uint32_t readPhysical32(uint32_t physAddr);
bool writePhysical8(uint8_t value, uint32_t physAddr);
+ bool writePhysical16(uint16_t value, uint32_t physAddr);
bool writePhysical32(uint32_t value, uint32_t physAddr);
uint8_t readPCM8(uint32_t physAddr);
MaybeU32 Emulator::readPhysical(uint32_t physAddr, ValueSize valueSize) {
if (valueSize == V8) {
return readPhysical8(physAddr);
+ } else if (valueSize == V16) {
+ return readPhysical16(physAddr);
} else {
return readPhysical32(physAddr);
}
bool Emulator::writePhysical(uint32_t value, uint32_t physAddr,
ValueSize valueSize) {
- uint8_t region = (physAddr >> 24) & 0xFF;
if (valueSize == V8) {
return writePhysical8((uint8_t)value, physAddr);
+ } else if (valueSize == V16) {
+ return writePhysical16((uint16_t)value, physAddr);
} else {
return writePhysical32(value, physAddr);
}
}
}
+MaybeU32 Emulator::readPhysical16(uint32_t physAddr) {
+ uint8_t region = (physAddr >> 24) & 0xFF;
+ switch (region) {
+ case 0x10:
+ return mAsic14->read16(physAddr);
+ default:
+ LOG("Load16 %08x\n", physAddr);
+ return 0;
+ }
+}
+
+bool Emulator::writePhysical16(uint16_t value, uint32_t physAddr) {
+ uint8_t region = (physAddr >> 24) & 0xFF;
+ switch (region) {
+ case 0x10:
+ mAsic14->write16(physAddr, value);
+ return true;
+ default:
+ LOG("Write16 %08x to %08x\n", value, physAddr);
+ return false;
+ }
+}
+
uint32_t Emulator::readPhysical32(uint32_t physAddr) {
uint8_t region = (physAddr >> 24) & 0xFF;
uint32_t result;