mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-06-16 21:29:48 +00:00
More fixes, plus a temp icon
This commit is contained in:
parent
f89c54848b
commit
c9854b36c6
|
@ -13,7 +13,9 @@
|
||||||
<Option type="1" />
|
<Option type="1" />
|
||||||
<Option compiler="gcc" />
|
<Option compiler="gcc" />
|
||||||
<Compiler>
|
<Compiler>
|
||||||
<Add option="-std=c++14" />
|
<Add option="-Weffc++" />
|
||||||
|
<Add option="-Wall" />
|
||||||
|
<Add option="-std=c++11" />
|
||||||
<Add option="-m32" />
|
<Add option="-m32" />
|
||||||
<Add option="-g" />
|
<Add option="-g" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
|
@ -27,11 +29,13 @@
|
||||||
<Option type="1" />
|
<Option type="1" />
|
||||||
<Option compiler="gcc" />
|
<Option compiler="gcc" />
|
||||||
<Compiler>
|
<Compiler>
|
||||||
|
<Add option="-march=core2" />
|
||||||
|
<Add option="-Os" />
|
||||||
<Add option="-std=c++14" />
|
<Add option="-std=c++14" />
|
||||||
<Add option="-m32" />
|
<Add option="-m32" />
|
||||||
</Compiler>
|
</Compiler>
|
||||||
<Linker>
|
<Linker>
|
||||||
<Add option="-O3" />
|
<Add option="-s" />
|
||||||
<Add option="-m32" />
|
<Add option="-m32" />
|
||||||
</Linker>
|
</Linker>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
BIN
dppcicon.ico
Normal file
BIN
dppcicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 91 KiB |
|
@ -10,6 +10,12 @@
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
//Uncomment this to help debug the emulator further
|
||||||
|
//#define EXHAUSTIVE_DEBUG 1
|
||||||
|
|
||||||
|
//Uncomment this to have a more graceful approach to illegal opcodes
|
||||||
|
//#define ILLEGAL_OP_SAFE 1
|
||||||
|
|
||||||
enum endian_switch {big_end = 0, little_end = 1};
|
enum endian_switch {big_end = 0, little_end = 1};
|
||||||
|
|
||||||
typedef void (*PPCOpcode)(void);
|
typedef void (*PPCOpcode)(void);
|
||||||
|
@ -616,7 +622,7 @@ static std::map<uint8_t, PPCOpcode> OpcodeGrabber =
|
||||||
{44, &ppc_sth}, {45, &ppc_sthu}, {46, &ppc_lmw}, {47, &ppc_stmw},
|
{44, &ppc_sth}, {45, &ppc_sthu}, {46, &ppc_lmw}, {47, &ppc_stmw},
|
||||||
{48, &ppc_lfs}, {49, &ppc_lfsu}, {50, &ppc_lfd}, {51, &ppc_lfdu},
|
{48, &ppc_lfs}, {49, &ppc_lfsu}, {50, &ppc_lfd}, {51, &ppc_lfdu},
|
||||||
{52, &ppc_stfs}, {53, &ppc_stfsu}, {54, &ppc_stfd}, {55, &ppc_stfdu},
|
{52, &ppc_stfs}, {53, &ppc_stfsu}, {54, &ppc_stfd}, {55, &ppc_stfdu},
|
||||||
{56, &ppc_psq_l}, {57, &ppc_psq_lu}, {58, &ppc_illegalop}, {59, &ppc_illegalop},
|
{56, &ppc_psq_l}, {57, &ppc_psq_lu}, {58, &ppc_illegalop}, {59, &ppc_opcode59},
|
||||||
{60, &ppc_psq_st}, {61, &ppc_psq_stu}, {62, &ppc_illegalop}, {63, &ppc_opcode63}};
|
{60, &ppc_psq_st}, {61, &ppc_psq_stu}, {62, &ppc_illegalop}, {63, &ppc_opcode63}};
|
||||||
|
|
||||||
//All of the opcodes possible are generated from the first 6 bits
|
//All of the opcodes possible are generated from the first 6 bits
|
||||||
|
|
|
@ -730,7 +730,7 @@ void address_quickinsert_translate(uint32_t value_insert, uint32_t address_grab,
|
||||||
void address_quickgrab_translate(uint32_t address_grab, uint8_t bit_num){
|
void address_quickgrab_translate(uint32_t address_grab, uint8_t bit_num){
|
||||||
//Grab a value from memory into a register
|
//Grab a value from memory into a register
|
||||||
|
|
||||||
printf("Grabbing from address %x \n", address_grab);
|
//printf("Grabbing from address %x \n", address_grab);
|
||||||
|
|
||||||
uint32_t storage_area = 0;
|
uint32_t storage_area = 0;
|
||||||
uint32_t grab_batl = 537;
|
uint32_t grab_batl = 537;
|
||||||
|
@ -782,7 +782,7 @@ void address_quickgrab_translate(uint32_t address_grab, uint8_t bit_num){
|
||||||
}
|
}
|
||||||
|
|
||||||
if (address_grab >= 0xFFC00000){
|
if (address_grab >= 0xFFC00000){
|
||||||
printf("Charting ROM Area: %x \n", address_grab);
|
//printf("Charting ROM Area: %x \n", address_grab);
|
||||||
storage_area = address_grab % rom_file_setsize;
|
storage_area = address_grab % rom_file_setsize;
|
||||||
grab_macmem_ptr = machine_sysrom_mem;
|
grab_macmem_ptr = machine_sysrom_mem;
|
||||||
ppc_set_return_val(storage_area, bit_num);
|
ppc_set_return_val(storage_area, bit_num);
|
||||||
|
|
|
@ -224,26 +224,30 @@ void ppc_opcode4(){
|
||||||
}
|
}
|
||||||
|
|
||||||
void ppc_opcode16(){
|
void ppc_opcode16(){
|
||||||
//printf("Reading from Opcode 16 table \n");
|
|
||||||
uint8_t subop_grab = ppc_cur_instruction & 3;
|
uint8_t subop_grab = ppc_cur_instruction & 3;
|
||||||
//uint32_t regrab = (uint32_t)subop_grab;
|
|
||||||
//printf("Executing subopcode entry %d \n", regrab);
|
#ifdef EXHAUSTIVE_DEBUG
|
||||||
|
uint32_t regrab = (uint32_t)subop_grab;
|
||||||
|
printf("Executing Opcode 16 table subopcode entry %d \n", regrab);
|
||||||
SubOpcode16Grabber[subop_grab]();
|
SubOpcode16Grabber[subop_grab]();
|
||||||
|
#else
|
||||||
|
SubOpcode16Grabber[subop_grab]();
|
||||||
|
#endif // EXHAUSTIVE_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
void ppc_opcode18(){
|
void ppc_opcode18(){
|
||||||
//printf("Reading from Opcode 18 table \n");
|
|
||||||
uint8_t subop_grab = ppc_cur_instruction & 3;
|
uint8_t subop_grab = ppc_cur_instruction & 3;
|
||||||
|
//printf("Reading from Opcode 18 table \n");
|
||||||
//uint32_t regrab = (uint32_t)subop_grab;
|
//uint32_t regrab = (uint32_t)subop_grab;
|
||||||
//printf("Executing subopcode entry %d \n", regrab);
|
//printf("Executing subopcode entry %d \n", regrab);
|
||||||
SubOpcode18Grabber[subop_grab]();
|
SubOpcode18Grabber[subop_grab]();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ppc_opcode19(){
|
void ppc_opcode19(){
|
||||||
//printf("Reading from Opcode 19 table \n");
|
|
||||||
uint16_t subop_grab = ppc_cur_instruction & 2047;
|
uint16_t subop_grab = ppc_cur_instruction & 2047;
|
||||||
//uint32_t regrab = (uint32_t)subop_grab;
|
#ifdef EXHAUSTIVE_DEBUG
|
||||||
//printf("Executing subopcode entry %d \n", regrab);
|
uint32_t regrab = (uint32_t)subop_grab;
|
||||||
|
printf("Executing Opcode 19 table supopcode entry %d \n", regrab);
|
||||||
if (SubOpcode19Grabber.count(subop_grab) == 1){
|
if (SubOpcode19Grabber.count(subop_grab) == 1){
|
||||||
SubOpcode19Grabber[subop_grab]();
|
SubOpcode19Grabber[subop_grab]();
|
||||||
}
|
}
|
||||||
|
@ -251,13 +255,16 @@ void ppc_opcode19(){
|
||||||
std::cout << "ILLEGAL SUBOPCODE: " << subop_grab << std::endl;
|
std::cout << "ILLEGAL SUBOPCODE: " << subop_grab << std::endl;
|
||||||
ppc_expection_handler(0x0700, 0x80000);
|
ppc_expection_handler(0x0700, 0x80000);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
SubOpcode19Grabber[subop_grab]();
|
||||||
|
#endif // EXHAUSTIVE_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
void ppc_opcode31(){
|
void ppc_opcode31(){
|
||||||
//printf("Reading from Opcode 31 table \n");
|
|
||||||
uint16_t subop_grab = ppc_cur_instruction & 2047;
|
uint16_t subop_grab = ppc_cur_instruction & 2047;
|
||||||
//uint32_t regrab = (uint32_t)subop_grab;
|
#ifdef EXHAUSTIVE_DEBUG
|
||||||
//printf("Executing subopcode entry %d \n", regrab);
|
uint32_t regrab = (uint32_t)subop_grab;
|
||||||
|
printf("Executing Opcode 31 table supopcode entry %d \n", regrab);
|
||||||
if (SubOpcode31Grabber.count(subop_grab) == 1){
|
if (SubOpcode31Grabber.count(subop_grab) == 1){
|
||||||
SubOpcode31Grabber[subop_grab]();
|
SubOpcode31Grabber[subop_grab]();
|
||||||
}
|
}
|
||||||
|
@ -265,20 +272,43 @@ void ppc_opcode31(){
|
||||||
std::cout << "ILLEGAL SUBOPCODE: " << subop_grab << std::endl;
|
std::cout << "ILLEGAL SUBOPCODE: " << subop_grab << std::endl;
|
||||||
ppc_expection_handler(0x0700, 0x80000);
|
ppc_expection_handler(0x0700, 0x80000);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
SubOpcode31Grabber[subop_grab]();
|
||||||
|
#endif // EXHAUSTIVE_DEBUG
|
||||||
|
}
|
||||||
|
|
||||||
|
void ppc_opcode59(){
|
||||||
|
uint16_t subop_grab = ppc_cur_instruction & 2047;
|
||||||
|
#ifdef EXHAUSTIVE_DEBUG
|
||||||
|
uint32_t regrab = (uint32_t)subop_grab;
|
||||||
|
printf("Executing Opcode 59 table supopcode entry %d \n", regrab);
|
||||||
|
if (SubOpcode59Grabber.count(subop_grab) == 1){
|
||||||
|
SubOpcode59Grabber[subop_grab]();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
std::cout << "ILLEGAL SUBOPCODE: " << subop_grab << std::endl;
|
||||||
|
ppc_expection_handler(0x0700, 0x80000);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
SubOpcode59Grabber[subop_grab]();
|
||||||
|
#endif // EXHAUSTIVE_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
void ppc_opcode63(){
|
void ppc_opcode63(){
|
||||||
//printf("Reading from Opcode 63 table \n");
|
|
||||||
uint16_t subop_grab = ppc_cur_instruction & 2047;
|
uint16_t subop_grab = ppc_cur_instruction & 2047;
|
||||||
//uint32_t regrab = (uint32_t)subop_grab;
|
#ifdef EXHAUSTIVE_DEBUG
|
||||||
//std::cout << "Executing subopcode entry " << regrab << std::endl;
|
uint32_t regrab = (uint32_t)subop_grab;
|
||||||
|
std::cout << "Executing Opcode 63 table subopcode entry " << regrab << std::endl;
|
||||||
if (SubOpcode63Grabber.count(subop_grab) == 1){
|
if (SubOpcode63Grabber.count(subop_grab) == 1){
|
||||||
SubOpcode63Grabber[subop_grab]();
|
SubOpcode63Grabber[subop_grab]();
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
//std::cout << "ILLEGAL SUBOPCODE: " << subop_grab << std::endl;
|
std::cout << "ILLEGAL SUBOPCODE: " << subop_grab << std::endl;
|
||||||
ppc_expection_handler(0x0700, 0x80000);
|
ppc_expection_handler(0x0700, 0x80000);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
SubOpcode63Grabber[subop_grab]();
|
||||||
|
#endif // EXHAUSTIVE_DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
void ppc_main_opcode(){
|
void ppc_main_opcode(){
|
||||||
|
@ -1906,7 +1936,9 @@ void ppc_stb(){
|
||||||
ppc_grab_regssa();
|
ppc_grab_regssa();
|
||||||
grab_d = (uint32_t)((int32_t)((int16_t)(ppc_cur_instruction & 0xFFFF)));
|
grab_d = (uint32_t)((int32_t)((int16_t)(ppc_cur_instruction & 0xFFFF)));
|
||||||
ppc_effective_address = (reg_a == 0)?grab_d:(ppc_result_a + grab_d);
|
ppc_effective_address = (reg_a == 0)?grab_d:(ppc_result_a + grab_d);
|
||||||
|
#ifdef EXHAUSTIVE_DEBUG
|
||||||
printf("STB Storage Area: %x \n",ppc_effective_address);
|
printf("STB Storage Area: %x \n",ppc_effective_address);
|
||||||
|
#endif // EXHAUSTIVE_DEBUG
|
||||||
address_quickinsert_translate(ppc_result_d, ppc_effective_address, 1);
|
address_quickinsert_translate(ppc_result_d, ppc_effective_address, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user