mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-06-04 19:29:29 +00:00
2bd717e293
The following fixes and changes have been made - Better Grackle emulation (though far from perfect) - OpenPIC write/read fixes - DAVBus Stubs - Started splitting functionality from the main routine, to slowly make way for a GUI-based version - Added a new until command argument - Fixed an entry in the floating point instruction dispatch table - CMakeLists.txt added
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
//DingusPPC - Prototype 5bf2
|
|
//Written by divingkatae
|
|
//(c)2018-20 (theweirdo)
|
|
//Please ask for permission
|
|
//if you want to distribute this.
|
|
//(divingkatae#1017 on Discord)
|
|
|
|
//Functionality for the OPENPIC
|
|
|
|
#include <iostream>
|
|
#include <cstring>
|
|
#include <cinttypes>
|
|
#include "ppcemumain.h"
|
|
|
|
uint32_t openpic_address;
|
|
uint32_t openpic_write_word;
|
|
uint32_t openpic_read_word;
|
|
|
|
void openpic_init(){
|
|
for (int i = 0x40004; i < 0x7FFFF; i++){
|
|
if (i % 16 == 0){
|
|
i += 4;
|
|
}
|
|
machine_upperiocontrol_mem[i] = 0xFF;
|
|
}
|
|
}
|
|
|
|
void openpic_read(){
|
|
openpic_read_word = (uint32_t)(machine_upperiocontrol_mem[openpic_address++]);
|
|
openpic_read_word = (uint32_t)((machine_upperiocontrol_mem[openpic_address++]) << 8);
|
|
openpic_read_word = (uint32_t)((machine_upperiocontrol_mem[openpic_address++]) << 16);
|
|
openpic_read_word = (uint32_t)((machine_upperiocontrol_mem[openpic_address]) << 24);
|
|
}
|
|
|
|
void openpic_write(){
|
|
machine_upperiocontrol_mem[openpic_address++] = (uint8_t)(openpic_write_word);
|
|
machine_upperiocontrol_mem[openpic_address++] = (uint8_t)((openpic_write_word) >> 8);
|
|
machine_upperiocontrol_mem[openpic_address++] = (uint8_t)((openpic_write_word) >> 16);
|
|
machine_upperiocontrol_mem[openpic_address] = (uint8_t)((openpic_write_word) >> 24);
|
|
}
|