Bus stuffing.

This commit is contained in:
Christian Speckner 2024-07-28 14:13:49 +02:00
parent 5e8e31b2d8
commit 4bcc8056b9
3 changed files with 20 additions and 1 deletions

View File

@ -92,6 +92,13 @@ BusTransactionQueue& BusTransactionQueue::injectROM(uInt8 value, uInt16 address)
return *this;
}
BusTransactionQueue& BusTransactionQueue::stuffByte(uInt8 value, uInt16 address)
{
push(Transaction::transactionDrive(address, value));
return *this;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BusTransactionQueue& BusTransactionQueue::yield(uInt16 address)
{

View File

@ -43,12 +43,17 @@ class BusTransactionQueue {
BusTransactionQueue& injectROM(uInt8 value);
BusTransactionQueue& injectROM(uInt8 value, uInt16 address);
BusTransactionQueue& stuffByte(uInt8 value, uInt16 address);
BusTransactionQueue& yield(uInt16 address);
bool hasPendingTransaction() const;
Transaction* getNextTransaction(uInt16 address);
inline size_t size() const {
return myQueueSize;
}
private:
void push(const Transaction& transaction);

View File

@ -146,7 +146,14 @@ CortexM0::err_t VcsLib::fetch16(uInt32 address, uInt16& value, uInt8& op, Cortex
return returnFromStub(value, op);
case ADDR_VCS_WRITE3:
FatalEmulationError::raise("unimplemented: vcsWrite3");
arg = cortex.getRegister(0);
myTransactionQueue
.injectROM(0x85)
.injectROM(arg)
.stuffByte(arg, cortex.getRegister(1));
return returnFromStub(value, op);
case ADDR_VCS_JMP3:
myTransactionQueue