Remove ? from window bar, debugging stuff

This commit is contained in:
meepingsnesroms
2019-12-05 13:38:01 -08:00
parent 34426a791b
commit 87f5312954
7 changed files with 69 additions and 9 deletions

View File

@@ -87,6 +87,7 @@ else ifneq ($(findstring MINGW,$(shell uname -a)),)
endif
#CC = gcc
#CXX = g++
TARGET_NAME := mu
LIBM = -lm

View File

@@ -17,6 +17,7 @@ DebugViewer::DebugViewer(QWidget* parent) :
QDialog(parent),
ui(new Ui::DebugViewer){
ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
bitsPerEntry = 8;
debugRadioButtonHandler();

View File

@@ -19,6 +19,7 @@ SettingsManager::SettingsManager(QWidget* parent) :
//init GUI
ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
//set all GUI items to current config values
ui->homeDirectory->setText(settings->value("resourceDirectory", "").toString());

View File

@@ -21,6 +21,7 @@ StateManager::StateManager(QWidget* parent) :
//init GUI
ui->setupUi(this);
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
//this allows resizing the screenshot of the savestate
this->installEventFilter(this);

View File

@@ -91,12 +91,6 @@ void cpu_arm_loop()
*flags_ptr |= RF_CODE_EXECUTED;
#endif
/*
//TODO: remove this, causes slowdown
if(arm.reg[15] == 0x200AC088)
emuprintf("HAL state set:%d\n", arm.reg[0]);
*/
arm.reg[15] += 4; // Increment now to account for the pipeline
++cycle_count_delta;
do_arm_instruction(*p);

View File

@@ -91,26 +91,86 @@
#if 1
//ARM debugging sandbox, no separate file this time
#include <stdlib.h>
#include "../../emulator.h"
#define DAL_START_IN_ROM 0x0009B130
#define DAL_END_IN_ROM 0x000C7EEB
#define DAL_ADDR_FROM_PC(pc) ((pc) - 0x20000000 - DAL_START_IN_ROM)
#define PC_FROM_DAL_ADDR(dalAddr) ((dalAddr) + 0x20000000 + DAL_START_IN_ROM)
static char* getArmString(ArmCpu* cpu, uint32_t address, uint32_t maxSize){
char* str = malloc(maxSize);
uint8_t fsr;
uint32_t index = 0;
if(!str)
abort();
for(index = 0; index < maxSize; index++){
cpu->memF(cpu, str + index, address + index, 1, false, true, fsr);
if(str[index] == '\0')
break;
}
return str;
}
static void cpuPcChanged(ArmCpu* cpu, uint32_t newPc){
//debug tool for extracting data from ARM function calls
switch(newPc){
bool logSource = true;
switch(newPc){
case PC_FROM_DAL_ADDR(0x00016C94):
//ReadGPIOPin
debugLog("Called \"ReadGPIOPin\", pin:%d\n", cpuGetRegExternal(cpu, 0));
break;
case PC_FROM_DAL_ADDR(0x00016D34):
//WriteGPIOPinInvertedValue
debugLog("Called \"WriteGPIOPinInvertedValue\", pin:%d, value:%d\n", cpuGetRegExternal(cpu, 0), cpuGetRegExternal(cpu, 1));
break;
case PC_FROM_DAL_ADDR(0x00024644):{
//PrintLineError
char* strings[2];
strings[0] = getArmString(cpu, cpuGetRegExternal(cpu, 0), 200);
strings[1] = getArmString(cpu, cpuGetRegExternal(cpu, 2), 200);
debugLog("Called \"PrintLineError\", file:%s, line:%d, error:%s\n", strings[0], cpuGetRegExternal(cpu, 1), strings[1]);
free(strings[0]);
free(strings[1]);
}
break;
case PC_FROM_DAL_ADDR(0x0000B6B4):{
//HALDbgMessage
char* string = getArmString(cpu, cpuGetRegExternal(cpu, 0), 200);
debugLog("Called \"HALDbgMessage\", msg:%s\n", string);
free(string);
}
break;
case PC_FROM_DAL_ADDR(0x00010F58):
//HALSetInitStage
debugLog("Called \"HALSetInitStage\", stage:%d\n", cpuGetRegExternal(cpu, 0));
break;
default:
logSource = false;
break;
}
if(logSource)
debugLog("Called from address:0x%08X\n", cpuGetRegExternal(cpu, 15) - 8);
}
#else
#define cpuPcChanged(x, y)
@@ -126,12 +186,13 @@ static _INLINE_ UInt32 cpuPrvROR(UInt32 val, UInt8 ror){
}
static _INLINE_ void cpuPrvSetPC(ArmCpu* cpu, UInt32 pc){
//call first to allow debug function to access parent callers PC
cpuPcChanged(cpu, pc &~ 1UL);
cpu->regs[15] = pc &~ 1UL;
cpu->CPSR &=~ ARM_SR_T;
if(pc & 1) cpu->CPSR |= ARM_SR_T;
else if(pc & 2) cpu->emulErrF(cpu, "Attempt to branch to non-word-aligned ARM address");
cpuPcChanged(cpu, cpu->regs[15]);
}
static _INLINE_ UInt32 cpuPrvGetReg(ArmCpu* cpu, UInt8 reg, Boolean wasT, Boolean specialPC){

View File

@@ -290,6 +290,7 @@ void pxa260gpioUpdateKeyMatrix(Pxa260gpio* gpio){
pxa260gpioSetState(gpio, 11, inRail2);
//TODO: move these to the init routine
pxa260gpioSetState(gpio, 1, true);//set the reset button to not be pressed
pxa260gpioSetState(gpio, 3, true);//set the slider postion
pxa260gpioSetState(gpio, 12, false);//prevent HotSync button from being pressed
}