From b92fe60fad4e221a3f757a94eb689f94554a625b Mon Sep 17 00:00:00 2001 From: dingusdev Date: Sun, 5 Jan 2020 10:38:32 -0700 Subject: [PATCH] Header updates + NVRAM Fix --- cpu/ppc/ppcexec.cpp | 7 +++++++ cpu/ppc/ppcfpopcodes.cpp | 8 ++++---- cpu/ppc/ppcgekkoopcodes.cpp | 8 ++++---- cpu/ppc/ppcmmu.cpp | 4 ++-- cpu/ppc/ppcmmu.h | 4 ++-- cpu/ppc/ppcopcodes.cpp | 4 ++-- debugger/debugger.cpp | 7 +++++++ devices/heathrow.cpp | 7 +++++++ devices/memctrlbase.cpp | 7 +++++++ devices/mpc106.cpp | 8 ++++---- devices/nvram.cpp | 13 ++++++++++++- devices/nvram.h | 1 + devices/viacuda.cpp | 6 +++--- main.cpp | 4 ++-- 14 files changed, 64 insertions(+), 24 deletions(-) diff --git a/cpu/ppc/ppcexec.cpp b/cpu/ppc/ppcexec.cpp index 95daab8..64a7d8d 100644 --- a/cpu/ppc/ppcexec.cpp +++ b/cpu/ppc/ppcexec.cpp @@ -1,3 +1,10 @@ +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium +//Please ask for permission +//if you want to distribute this. +//(divingkatae#1017 or powermax#2286 on Discord) + #include #include diff --git a/cpu/ppc/ppcfpopcodes.cpp b/cpu/ppc/ppcfpopcodes.cpp index 921f152..c17c83f 100644 --- a/cpu/ppc/ppcfpopcodes.cpp +++ b/cpu/ppc/ppcfpopcodes.cpp @@ -1,9 +1,9 @@ -//DingusPPC - Prototype 5bf2 -//Written by divingkatae -//(c)2018-20 (theweirdo) +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. -//(divingkatae#1017 on Discord) +//(divingkatae#1017 or powermax#2286 on Discord) // The opcodes for the processor - ppcopcodes.cpp diff --git a/cpu/ppc/ppcgekkoopcodes.cpp b/cpu/ppc/ppcgekkoopcodes.cpp index 027b8cd..6e2b526 100644 --- a/cpu/ppc/ppcgekkoopcodes.cpp +++ b/cpu/ppc/ppcgekkoopcodes.cpp @@ -1,9 +1,9 @@ -//DingusPPC - Prototype 5bf2 -//Written by divingkatae -//(c)2018-20 (theweirdo) +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. -//(divingkatae#1017 on Discord) +//(divingkatae#1017 or powermax#2286 on Discord) // The uniquely Gekko opcodes for the processor - ppcgekkoopcodes.cpp diff --git a/cpu/ppc/ppcmmu.cpp b/cpu/ppc/ppcmmu.cpp index 10275ae..e95575a 100644 --- a/cpu/ppc/ppcmmu.cpp +++ b/cpu/ppc/ppcmmu.cpp @@ -1,9 +1,9 @@ -//DingusPPC - Prototype 5bf2 +//DingusPPC //Written by divingkatae and maximum //(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. -//(divingkatae#1017 on Discord) +//(divingkatae#1017 or powermax#2286 on Discord) /** @file PowerPC Memory management unit emulation. */ diff --git a/cpu/ppc/ppcmmu.h b/cpu/ppc/ppcmmu.h index 6ae54b6..da2c54c 100644 --- a/cpu/ppc/ppcmmu.h +++ b/cpu/ppc/ppcmmu.h @@ -1,9 +1,9 @@ -//DingusPPC - Prototype 5bf2 +//DingusPPC //Written by divingkatae and maximum //(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. -//(divingkatae#1017 on Discord) +//(divingkatae#1017 or powermax#2286 on Discord) // The opcodes for the processor - ppcopcodes.cpp diff --git a/cpu/ppc/ppcopcodes.cpp b/cpu/ppc/ppcopcodes.cpp index 06780d4..63af671 100644 --- a/cpu/ppc/ppcopcodes.cpp +++ b/cpu/ppc/ppcopcodes.cpp @@ -1,9 +1,9 @@ -//DingusPPC - Prototype 5bf2 +//DingusPPC //Written by divingkatae and maximum //(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. -//(divingkatae#1017 on Discord) +//(divingkatae#1017 or powermax#2286 on Discord) // General opcodes for the processor - ppcopcodes.cpp diff --git a/debugger/debugger.cpp b/debugger/debugger.cpp index c797f97..89aa05a 100644 --- a/debugger/debugger.cpp +++ b/debugger/debugger.cpp @@ -1,3 +1,10 @@ +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium +//Please ask for permission +//if you want to distribute this. +//(divingkatae#1017 or powermax#2286 on Discord) + #include #include #include diff --git a/devices/heathrow.cpp b/devices/heathrow.cpp index c7e9b00..9ab975d 100644 --- a/devices/heathrow.cpp +++ b/devices/heathrow.cpp @@ -1,3 +1,10 @@ +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium +//Please ask for permission +//if you want to distribute this. +//(divingkatae#1017 or powermax#2286 on Discord) + #include #include #include diff --git a/devices/memctrlbase.cpp b/devices/memctrlbase.cpp index 9e8c80f..b07c582 100644 --- a/devices/memctrlbase.cpp +++ b/devices/memctrlbase.cpp @@ -1,3 +1,10 @@ +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium +//Please ask for permission +//if you want to distribute this. +//(divingkatae#1017 or powermax#2286 on Discord) + #include #include #include // to shut up MSVC errors (: diff --git a/devices/mpc106.cpp b/devices/mpc106.cpp index 858d8f7..218a22e 100644 --- a/devices/mpc106.cpp +++ b/devices/mpc106.cpp @@ -1,9 +1,9 @@ -//DingusPPC - Prototype 5bf2 -//Written by divingkatae -//(c)2018-20 (theweirdo) +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. -//(divingkatae#1017 on Discord) +//(divingkatae#1017 or powermax#2286 on Discord) /** MPC106 (Grackle) emulation diff --git a/devices/nvram.cpp b/devices/nvram.cpp index 6e0e7ca..51e934a 100644 --- a/devices/nvram.cpp +++ b/devices/nvram.cpp @@ -1,3 +1,10 @@ +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium +//Please ask for permission +//if you want to distribute this. +//(divingkatae#1017 or powermax#2286 on Discord) + #include #include #include @@ -45,7 +52,11 @@ void NVram::nvram_init() { } void NVram::nvram_save() { - NVram::nvram_file.write((char*)nvram_storage, 8192); + std::ofstream outfile("nvram.bin"); + + outfile.write((char*)nvram_storage, 8192); + + outfile.close(); } uint8_t NVram::nvram_read(uint32_t nvram_offset){ diff --git a/devices/nvram.h b/devices/nvram.h index 829a766..34ee66a 100644 --- a/devices/nvram.h +++ b/devices/nvram.h @@ -16,6 +16,7 @@ public: private: std::fstream nvram_file; //NVRAM file for storing and reading values + std::ofstream nvram_savefile; //Save file when closing out DingusPPC /* NVRAM state. */ uint32_t nvram_offset; diff --git a/devices/viacuda.cpp b/devices/viacuda.cpp index 8377d94..0379e0c 100644 --- a/devices/viacuda.cpp +++ b/devices/viacuda.cpp @@ -1,6 +1,6 @@ -//DingusPPC - Prototype 5bf2 -//Written by divingkatae -//(c)2018-20 (theweirdo) +//DingusPPC +//Written by divingkatae and maximum +//(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. //(divingkatae#1017 on Discord) diff --git a/main.cpp b/main.cpp index aafc3c6..c726c49 100644 --- a/main.cpp +++ b/main.cpp @@ -1,9 +1,9 @@ -//DingusPPC - Prototype 5bf2 +//DingusPPC //Written by divingkatae and maximum //(c)2018-20 (theweirdo) spatium //Please ask for permission //if you want to distribute this. -//(divingkatae#1017 on Discord) +//(divingkatae#1017 or powermax#2286 on Discord) //The main runfile - main.cpp //This is where the magic begins