From a51a549ecd3c6d689407878ca5e72d2cc041807d Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Mon, 25 Feb 2019 08:45:11 -0800 Subject: [PATCH] Remove USB hack --- bugs/unimplementedHardware.txt | 2 +- src/debug/sandbox.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bugs/unimplementedHardware.txt b/bugs/unimplementedHardware.txt index 339dd9a..9363671 100644 --- a/bugs/unimplementedHardware.txt +++ b/bugs/unimplementedHardware.txt @@ -57,6 +57,7 @@ MakePalmBitmap: Fixed: +USB chip seems to share an interrupt with the SD card(the SD card interrupt is unimplemented at boot and triggers a printf over USB instead, if USB is not properly emulated that will cause a lock up)(enough of the USB is now emulated to prevent this) (SD Card)need to an input option for the write protect switch on the side of the SD card(will be fixed at input time since you can't flip it when in the slot) (SD Card)memory block ordering is broken (SD Card)block length is fixed at 512 right now(this is actually proper behavior for newer SDSC cards) @@ -98,7 +99,6 @@ Edge triggered IRQ* interrupt pins may actually read the value of the interrupt ADS7846 channels are not implemented properly in the emulator(works now) ADS7846 Channels 3 and 4(they need to be scaled differently)(works now) CPU32 table lookup opcodes(there is no CPU32) -USB chip seems to share an interrupt with the SD card(the SD card interrupt is unimplemented at boot and triggers a printf over USB instead, if USB is not properly emulated that will cause a lock up) IRQ2 seems to not even be hooked up in IDA(IRQ2 is setup after boot by the SD driver, the kernels IRQ2 driver only sends a debug message over USB or serial) framebuffer accesses can cause a buffer overflow(this was always the case, its not a new bug)(just increased the buffer to an address line maskable size) chipselect mirroring is wrong(CS*0 and CS*1 are considered continuous when mapped with more address space than memory, mirroring is currently [CS*0, CS*1, repeat alternating till the end of address space] it should be [CS*0, repeat CS*0 until half way through CS* address space, CS*1, repeat CS*1 until end of CS* address space]) diff --git a/src/debug/sandbox.c b/src/debug/sandbox.c index 0ab319e..74abae9 100644 --- a/src/debug/sandbox.c +++ b/src/debug/sandbox.c @@ -396,20 +396,21 @@ uint32_t sandboxCommand(uint32_t command, void* data){ //remove parts of the OS that cause lockups, yeah its bad //remove ErrDisplayFileLineMsg from HwrIRQ2Handler, device locks on USB polling without this - patchOsRom(0x83652, "4E714E71");//nop; nop + //this is fixed, leaving it here for reference + //patchOsRom(0x83652, "4E714E71");//nop; nop //make SysSetTrapAddress/SysGetTrapAddress support traps > ScrDefaultPaletteState 0xA459 //up to final OS 5.3 trap DmSyncDatabase 0xA476 //SysSetTrapAddress_1001AE36: //SysGetTrapAddress_1001AE7C: - patchOsRom(0x1AE42, "0C410477");//cmpi.w 0x477, d1 - patchOsRom(0x1AE8A, "0C42A477");//cmpi.w 0xA477, d2 + //patchOsRom(0x1AE42, "0C410477");//cmpi.w 0x477, d1 + //patchOsRom(0x1AE8A, "0C42A477");//cmpi.w 0xA477, d2 //double dynamic heap size, verified working //HwrCalcDynamicRAMSize_10005CC6: //HwrCalcDynamicRAMSize_10083B0A: - patchOsRom(0x5CC6, "203C000800004E75");//move.l 0x80000, d0; rts - patchOsRom(0x83B0A, "203C000800004E75");//move.l 0x80000, d0; rts + //patchOsRom(0x5CC6, "203C000800004E75");//move.l 0x80000, d0; rts + //patchOsRom(0x83B0A, "203C000800004E75");//move.l 0x80000, d0; rts //patch PrvChunkNew to only allocate in 4 byte intervals //PrvChunkNew_10020CBC: