From 3e17dbf35cde35cd046804570bab208fe907c233 Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Tue, 5 Jun 2018 07:17:59 -0700 Subject: [PATCH] Just use memset to 0 out structs --- src/emulator.c | 39 --------------------------------------- src/hardwareRegisters.c | 14 -------------- 2 files changed, 53 deletions(-) diff --git a/src/emulator.c b/src/emulator.c index 4ac2055..ff7d1b8 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -391,38 +391,6 @@ uint32_t emulatorInit(buffer_t palmRomDump, buffer_t palmBootDump, uint32_t spec ads7846Reset(); sdCardInit(); - /* - //input - palmInput.buttonUp = false; - palmInput.buttonDown = false; - palmInput.buttonLeft = false;//only used in hybrid mode - palmInput.buttonRight = false;//only used in hybrid mode - palmInput.buttonSelect = false;//only used in hybrid mode - - palmInput.buttonCalendar = false; - palmInput.buttonAddress = false; - palmInput.buttonTodo = false; - palmInput.buttonNotes = false; - - palmInput.buttonPower = false; - palmInput.buttonContrast = false; - - palmInput.touchscreenX = 0; - palmInput.touchscreenY = 0; - palmInput.touchscreenTouched = false; - - //sdcard - palmSdCard.sessionId = 0x0000000000000000; - palmSdCard.stateId = 0x0000000000000000; - palmSdCard.size = 0; - palmSdCard.type = CARD_NONE; - palmSdCard.inserted = false; - - //misc settable attributes - palmMisc.batteryCharging = false; - palmMisc.batteryLevel = 100; - palmMisc.inDock = false; - */ memset(&palmInput, 0x00, sizeof(palmInput)); memset(&palmSdCard, 0x00, sizeof(palmSdCard)); memset(&palmMisc, 0x00, sizeof(palmMisc)); @@ -483,13 +451,6 @@ uint32_t emulatorSetNewSdCard(uint64_t size, uint8_t type){ } else{ memset(&palmSdCard, 0x00, sizeof(palmSdCard)); - /* - palmSdCard.sessionId = 0x0000000000000000; - palmSdCard.stateId = 0x0000000000000000; - palmSdCard.size = 0; - palmSdCard.type = CARD_NONE; - palmSdCard.inserted = false; - */ } return EMU_ERROR_NONE; diff --git a/src/hardwareRegisters.c b/src/hardwareRegisters.c index 8f10a7d..3a6cbb2 100644 --- a/src/hardwareRegisters.c +++ b/src/hardwareRegisters.c @@ -972,20 +972,6 @@ void resetHwRegisters(){ spi1TxPosition = 0; memset(chips, 0x00, sizeof(chips)); - /* - for(uint8_t chip = CHIP_BEGIN; chip < CHIP_END; chip++){ - chips[chip].enable = false; - chips[chip].start = 0x00000000; - chips[chip].size = 0x00000000; - chips[chip].mask = 0x00000000; - - chips[chip].inBootMode = false; - chips[chip].readOnly = false; - chips[chip].readOnlyForProtectedMemory = false; - chips[chip].supervisorOnlyProtectedMemory = false; - chips[chip].unprotectedSize = 0x00000000; - } - */ //all chipselects are disabled at boot and CSA is mapped to 0x00000000 and covers the entire address range until CSGBA set otherwise chips[CHIP_A_ROM].inBootMode = true;