Fixed debug stack reading

This commit is contained in:
meepingsnesroms
2019-03-31 12:24:28 -07:00
parent 806c95b20b
commit bdb445fb72
8 changed files with 38 additions and 11 deletions

View File

@@ -87,7 +87,7 @@ MainWindow::MainWindow(QWidget* parent) :
settings->setValue("hideOnscreenKeys", true);
#endif
}
hideOnscreenKeys = settings->value("hideOnscreenKeys", "").toBool();
hideOnscreenKeys = settings->value("hideOnscreenKeys", false).toBool();
//this makes the display window and button icons resize properly
ui->centralWidget->installEventFilter(this);
@@ -205,7 +205,7 @@ void MainWindow::popupInformationDialog(const QString& info){
}
void MainWindow::redraw(){
bool hideOnscreenKeys = settings->value("hideOnscreenKeys", "").toBool();
bool hideOnscreenKeys = settings->value("hideOnscreenKeys", false).toBool();
QResizeEvent* resizeEvent = new QResizeEvent(ui->centralWidget->size(), ui->centralWidget->size());
//update current keys
@@ -236,7 +236,7 @@ bool MainWindow::eventFilter(QObject* object, QEvent* event){
if(object->objectName() == "centralWidget"){
float smallestRatio;
bool hideOnscreenKeys = settings->value("hideOnscreenKeys", "").toBool();
bool hideOnscreenKeys = settings->value("hideOnscreenKeys", false).toBool();
//update displayContainer first, make the display occupy the top 3/5 of the screen if there are Palm keys or 4/5 if theres not
ui->displayContainer->setFixedHeight(ui->centralWidget->height() * (hideOnscreenKeys ? 0.80 : 0.60));

View File

@@ -21,7 +21,7 @@ SettingsManager::SettingsManager(QWidget* parent) :
//set all GUI items to current config values
ui->homeDirectory->setText(settings->value("resourceDirectory", "").toString());
ui->showOnscreenKeys->setChecked(!settings->value("hideOnscreenKeys", "").toBool());
ui->showOnscreenKeys->setChecked(!settings->value("hideOnscreenKeys", false).toBool());
ui->feature128mbRam->setChecked(settings->value("feature128mbRam", false).toBool());
ui->featureFastCpu->setChecked(settings->value("featureFastCpu", false).toBool());

View File

@@ -7,11 +7,6 @@
#define APP_NAME "MuExpDriver"
#define APP_ID 'MuDv'
#define FUNCTION_BLOB_TYPE 'func'
#define ARM_EXIT_FUNC_ID 0x0000
#define ARM_CALL_68K_FUNC_ID 0x0001
#define M68K_CALL_WITH_BLOB_FUNC_ID 0x0002
/*config vars*/
enum{
USER_WARNING_GIVEN = 0,

View File

@@ -6,6 +6,7 @@
#define CODE_SECTION(codeSection) __attribute__((section(codeSection)))
#define NO_RETURN __attribute__((noreturn))
#define ALIGN(size) __attribute__((aligned(size)))
#define PACKED __attribute__((packed))
#define FIXED_ADDRESS_VAR(a, t) (*((volatile t*)a))
#define readArbitraryMemory8(address) (*((volatile uint8_t*)(address)))

View File

@@ -1,6 +1,7 @@
#ifndef PALM_OS_PRIV_H
#define PALM_OS_PRIV_H
#include <stdint.h>
#include "palmGlobalDefines.h"
/*these are all the Palm OS varibles the SDK dosent expose that I have found while decompiling Palm OS*/
@@ -12,6 +13,7 @@
#define ResetVector FIXED_ADDRESS_VAR(0x00000004, void*)
/*OS*/
#define TrapTablePtr FIXED_ADDRESS_VAR(0x00000122, uint32_t*)
#define ScrStatePtr FIXED_ADDRESS_VAR(0x00000164, void*)
#endif

View File

@@ -28,6 +28,34 @@ static void lockCodeXXXX(void){
}
}
static void resizeTrapTable(void){
uint16_t oldSr;
uint32_t* oldTrapTable;
uint32_t* newTrapTable;
/*order and time sensitive code!!!*/
oldSr = SysDisableInts();
/*get new trap table memory*/
newTrapTable = MemChunkNew(0, (sysTrapLastTrapNumber - sysTrapBase) * sizeof(uint32_t), memNewChunkFlagPreLock | memNewChunkFlagNonMovable | memNewChunkFlagAllowLarge);
/*copy over old OS 4 size trap table and 0 out the OS 5 part*/
MemMove(newTrapTable, TrapTablePtr, (sysTrapPceNativeCall - sysTrapBase) * sizeof(uint32_t));
MemSet(newTrapTable + sysTrapPceNativeCall - sysTrapBase, (sysTrapLastTrapNumber - sysTrapPceNativeCall) * sizeof(uint32_t), 0x00);
/*save old table pointer to free*/
oldTrapTable = TrapTablePtr
/*swap the tables*/
TrapTablePtr = newTrapTable;
/*free the old table*/
MemChunkFree(oldTrapTable);
/*return to normal execution*/
SysRestoreStatus(oldSr);
}
static void install128mbRam(uint8_t mbDynamicHeap){
/*these functions are called by HwrInit, which can be called directly by apps*/
/*PrvGetRAMSize_10002C5E, small ROM*/

View File

@@ -6,9 +6,9 @@
#include "palmGlobalDefines.h"
typedef struct{
typedef struct PACKED{
uint32_t linkSp;
uint32_t pc;
uint32_t sp;
}__return_stack_frame_type;
#define __return_stack_frame register __return_stack_frame_type* __stack_frame asm("a6")

View File

@@ -11,6 +11,7 @@ For some reason the new versions of MuExpDriver dont work with Chuzzle anymore
Need to allocate a new trap table and set the global to that, not just write off the end of the existing one
Need to lock the code resources on boot, databases can be shuffled in RAM to free up space and that will corrupt old trap addresses
Need to patch SysGetOSVersionString
Crash on first load when pressing "Emulator", probably caused by accessing the config file wrong
Fixed:
GUI