From cd3e6a9c728250044fb705b3009339ac8ffa3926 Mon Sep 17 00:00:00 2001 From: kalymos Date: Fri, 7 Mar 2025 16:10:36 +0100 Subject: [PATCH] corect bug SWITCH end up fuses --- PSNee_V8.6/PSNee_V8.6/PSNee_V8.6.ino | 72 ++++++++----------- .../avr/boards.txt | 23 ++---- .../avr/bootloaders/bootloader.txt | 0 .../avr/platform.txt | 6 +- .../avr/variants/leonardo/pins_arduino.h | 0 .../avr/variants/micro/pins_arduino.h | 0 .../avr/variants/pb-variant/pins_arduino.h | 0 .../avr/variants/standard/pins_arduino.h | 0 .../avr/variants/tiny8/pins_arduino.h | 0 .../avr/variants/tinyx8/pins_arduino.h | 0 .../avr/variants/tinyx8_mh/pins_arduino.h | 0 11 files changed, 37 insertions(+), 64 deletions(-) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/boards.txt (89%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/bootloaders/bootloader.txt (100%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/platform.txt (93%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/variants/leonardo/pins_arduino.h (100%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/variants/micro/pins_arduino.h (100%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/variants/pb-variant/pins_arduino.h (100%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/variants/standard/pins_arduino.h (100%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/variants/tiny8/pins_arduino.h (100%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/variants/tinyx8/pins_arduino.h (100%) rename {PSNeecore-1.1 => PSNeecore-1.2}/avr/variants/tinyx8_mh/pins_arduino.h (100%) diff --git a/PSNee_V8.6/PSNee_V8.6/PSNee_V8.6.ino b/PSNee_V8.6/PSNee_V8.6/PSNee_V8.6.ino index 495eeb4..84b0e37 100644 --- a/PSNee_V8.6/PSNee_V8.6/PSNee_V8.6.ino +++ b/PSNee_V8.6/PSNee_V8.6/PSNee_V8.6.ino @@ -1,3 +1,21 @@ +//------------------------------------------------------------------------------------------------ +// Select your console +//------------------------------------------------------------------------------------------------ +// Attention! +// If a BIOS checksum is specified, it is more important than the SCPH model number! +//------------------------------------------------------------------------------------------------ + +//#define SCPH_xxx1 // Use for all NTSC-U/C models. No BIOS patching needed. +//#define SCPH_xxx2 // Use for all PAL FAT models. No BIOS patching needed. +//#define SCPH_103 // No BIOS patching needed. +//#define SCPH_102 // DX - D0, AX - A7. BIOS ver. 4.4e, CRC 0BAD7EA9 | 4.5e, CRC 76B880E5 +//#define SCPH_100 // DX - D0, AX - A7. BIOS ver. 4.3j, CRC F2AF798B +//#define SCPH_7000_9000 // DX - D0, AX - A7. BIOS ver. 4.0j, CRC EC541CD0 +//#define SCPH_5500 // DX - D0, AX - A5. BIOS ver. 3.0j, CRC FF3EEB8C +//#define SCPH_3500_5000 // DX - D0, for 40-pin BIOS: AX - A4, for 32-pin BIOS: AX - A5. BIOS ver. 2.2j, CRC 24FC7E17 | 2.1j, CRC BC190209 +//#define SCPH_3000 // DX - D5, for 40-pin BIOS: AX - A6, AY - A7, for 32-pin BIOS: AX - A7, AY - A8. BIOS ver. 1.1j, CRC 3539DEF6 +//#define SCPH_1000 // DX - D5, for 40-pin BIOS: AX - A6, AY - A7, for 32-pin BIOS: AX - A7, AY - A8. BIOS ver. 1.0j, CRC 3B601FC8 + //------------------------------------------------------------------------------------------------ // Select your chip //------------------------------------------------------------------------------------------------ @@ -8,9 +26,8 @@ /* Fuses: - BIOS patch - H: DF, L: EE, E: FF; - ATmega - H: DF, L: FF, E: FF. - ATtiny - H: DF, L: E2; E: FF, + ATmega - H: DF, L: EE, E: FD. + ATtiny - H: DF, L: E2; E: FD. Pinout Arduino: VCC-3.5v, PinGND-GND, @@ -35,23 +52,6 @@ Pin8-VCC */ -//------------------------------------------------------------------------------------------------ -// Select your console -//------------------------------------------------------------------------------------------------ -// Attention! -// If a BIOS checksum is specified, it is more important than the SCPH model number! -//------------------------------------------------------------------------------------------------ - -//#define SCPH_xxx1 // Use for all NTSC-U/C models. No BIOS patching needed. -//#define SCPH_xxx2 // Use for all PAL FAT models. No BIOS patching needed. -//#define SCPH_103 // No BIOS patching needed. -//#define SCPH_102 // DX - D0, AX - A7. BIOS ver. 4.4e, CRC 0BAD7EA9 | 4.5e, CRC 76B880E5 -//#define SCPH_100 // DX - D0, AX - A7. BIOS ver. 4.3j, CRC F2AF798B -//#define SCPH_7000_9000 // DX - D0, AX - A7. BIOS ver. 4.0j, CRC EC541CD0 -//#define SCPH_5500 // DX - D0, AX - A5. BIOS ver. 3.0j, CRC FF3EEB8C -//#define SCPH_3500_5000 // DX - D0, for 40-pin BIOS: AX - A4, for 32-pin BIOS: AX - A5. BIOS ver. 2.2j, CRC 24FC7E17 | 2.1j, CRC BC190209 -//#define SCPH_3000 // DX - D5, for 40-pin BIOS: AX - A6, AY - A7, for 32-pin BIOS: AX - A7, AY - A8. BIOS ver. 1.1j, CRC 3539DEF6 -//#define SCPH_1000 // DX - D5, for 40-pin BIOS: AX - A6, AY - A7, for 32-pin BIOS: AX - A7, AY - A8. BIOS ver. 1.0j, CRC 3B601FC8 //------------------------------------------------------------------------------------------------ // Options @@ -81,6 +81,8 @@ volatile uint16_t millisec = 0; //Flag initializing for automatic console generation selection 0 = old, 1 = pu-22 end ++ volatile bool wfck_mode = 0; +volatile bool Flag_Switch = 0; + //------------------------------------------------------------------------------------------------ // Code section //------------------------------------------------------------------------------------------------ @@ -286,6 +288,9 @@ void Init() { #if defined(PATCH_SW) && defined(BIOS_PATCH) PIN_SWITCH_INPUT; PIN_SWITCH_SET; + if (PIN_SWICHE_READ = 0){ + Flag_Switch =1; + } #endif #ifdef LED_RUN @@ -297,10 +302,7 @@ void Init() { PIN_SQCK_INPUT; PIN_SUBQ_INPUT; } -void BIOS_Patching_Fonc(){ - -} int main() { uint8_t hysteresis = 0; uint8_t scbuf[12] = { 0 }; // SUBQ bit storage @@ -312,38 +314,22 @@ int main() { Init(); - - -#if defined(BIOS_PATCH) && !defined(PATCH_SWICHE) +#if defined(BIOS_PATCH) #ifdef LED_RUN PIN_LED_ON; #endif - Bios_Patching(); -#elif defined(BIOS_PATCH) && defined(PATCH_SWICHE) - if (PIN_SWICHE_READ != 0) { + + if (Flag_Switch == 0) { Bios_Patching(); - } else { - - while (PIN_SQCK_READ == 0) - ; - while (PIN_WFCK_READ == 0) - ; } - // wait for console power on and stable signals -#else - while (PIN_SQCK_READ == 0) - ; - while (PIN_WFCK_READ == 0) - ; #ifdef LED_RUN PIN_LED_OFF; #endif + #endif - - Timer_Start(); //************************************************************************ // Board detection diff --git a/PSNeecore-1.1/avr/boards.txt b/PSNeecore-1.2/avr/boards.txt similarity index 89% rename from PSNeecore-1.1/avr/boards.txt rename to PSNeecore-1.2/avr/boards.txt index 8c5866e..5b7a63d 100644 --- a/PSNeecore-1.1/avr/boards.txt +++ b/PSNeecore-1.2/avr/boards.txt @@ -1,6 +1,6 @@ # Menu options menu.variant=Variant -menu.fuses=Fuses +#menu.fuses=Fuses ############################## ### ATiny25/45/85 ######## @@ -86,11 +86,11 @@ ATtinyX8.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff # General 328.name=ATmega328 -328.32u4.tool=arduino:avrdude +328.upload.tool=arduino:avrdude 328.upload.default_speed=57600 328.upload.maximum_data_size=2048 328.upload.maximum_size=30720 - +328.upload.low_fuses=0xee 328.build.core=arduino:arduino 328.build.board=AVR_ATmega328 @@ -109,11 +109,7 @@ ATtinyX8.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff 328.menu.variant.modelPB.build.variant=pb-variant 328.menu.variant.modelPB.build.mcu=atmega328pb -328.menu.fuses.BIOSpatch=BIOS patch -328.menu.fuses.BIOSpatch.upload.low_fuses=0xee -328.menu.fuses.NoBIOSpatch=No BIOS patch -328.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff ############################# #### ATmega168/A/P/PA/PB #### @@ -125,6 +121,7 @@ ATtinyX8.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff 168.upload.default_speed=57600 168.upload.maximum_size=15872 168.upload.maximum_data_size=1024 +168.upload.low_fuses=0xee 168.build.core=arduino:arduino 168.build.board=AVR_ATmega168 @@ -144,12 +141,6 @@ ATtinyX8.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff 168.menu.variant.modelPB.build.variant=pb-variant 168.menu.variant.modelPB.build.mcu=atmega168pb -168.menu.fuses.BIOSpatch=BIOS patch -168.menu.fuses.BIOSpatch.upload.low_fuses=0xee - -168.menu.fuses.NoBIOSpatch=No BIOS patch -168.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff - ############################# #### atmega32u4 #### ############################# @@ -188,6 +179,7 @@ ATtinyX8.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff 32u4.upload.maximum_size=30720 32u4.upload.use_1200bps_touch=true 32u4.upload.wait_for_upload_port=true +32u4.upload.low_fuses=0xee @@ -205,9 +197,4 @@ ATtinyX8.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff 32u4.vid.0=0x239A 32u4.pid.0=0x800C -32u4.menu.fuses.BIOSpatch=BIOS patch -32u4.menu.fuses.BIOSpatch.upload.low_fuses=0xee - -32u4.menu.fuses.NoBIOSpatch=No BIOS patch -32u4.menu.fuses.NoBIOSpatch.upload.low_fuses=0xff diff --git a/PSNeecore-1.1/avr/bootloaders/bootloader.txt b/PSNeecore-1.2/avr/bootloaders/bootloader.txt similarity index 100% rename from PSNeecore-1.1/avr/bootloaders/bootloader.txt rename to PSNeecore-1.2/avr/bootloaders/bootloader.txt diff --git a/PSNeecore-1.1/avr/platform.txt b/PSNeecore-1.2/avr/platform.txt similarity index 93% rename from PSNeecore-1.1/avr/platform.txt rename to PSNeecore-1.2/avr/platform.txt index 0c2a193..abf3ee2 100644 --- a/PSNeecore-1.1/avr/platform.txt +++ b/PSNeecore-1.2/avr/platform.txt @@ -1,5 +1,5 @@ -name=PSNee -version=1.1.0 +name=PSNeeCore +version=1.2.0 tools.avrdude.path={runtime.tools.avrdude.path} tools.avrdude.cmd.path={path}/bin/avrdude @@ -11,7 +11,7 @@ tools.avrdude.program.params.quiet=-q -q # tools.avrdude.program.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value tools.avrdude.program.verify= tools.avrdude.program.params.noverify=-V -tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" -F {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} -Uefuse:w:0xff:m -Uhfuse:w:0xdf:m -Ulfuse:w:{upload.low_fuses}:m "-Uflash:w:{build.path}/{build.project_name}.hex:i" +tools.avrdude.program.pattern="{cmd.path}" "-C{config.path}" -F {program.verbose} {program.verify} -p{build.mcu} -c{protocol} {program.extra_params} -Uefuse:w:0xfd:m -Uhfuse:w:0xdf:m -Ulfuse:w:{upload.low_fuses}:m "-Uflash:w:{build.path}/{build.project_name}.hex:i" tools.avrdude.erase.params.verbose=-v -v -v -v tools.avrdude.erase.params.quiet=-q -q diff --git a/PSNeecore-1.1/avr/variants/leonardo/pins_arduino.h b/PSNeecore-1.2/avr/variants/leonardo/pins_arduino.h similarity index 100% rename from PSNeecore-1.1/avr/variants/leonardo/pins_arduino.h rename to PSNeecore-1.2/avr/variants/leonardo/pins_arduino.h diff --git a/PSNeecore-1.1/avr/variants/micro/pins_arduino.h b/PSNeecore-1.2/avr/variants/micro/pins_arduino.h similarity index 100% rename from PSNeecore-1.1/avr/variants/micro/pins_arduino.h rename to PSNeecore-1.2/avr/variants/micro/pins_arduino.h diff --git a/PSNeecore-1.1/avr/variants/pb-variant/pins_arduino.h b/PSNeecore-1.2/avr/variants/pb-variant/pins_arduino.h similarity index 100% rename from PSNeecore-1.1/avr/variants/pb-variant/pins_arduino.h rename to PSNeecore-1.2/avr/variants/pb-variant/pins_arduino.h diff --git a/PSNeecore-1.1/avr/variants/standard/pins_arduino.h b/PSNeecore-1.2/avr/variants/standard/pins_arduino.h similarity index 100% rename from PSNeecore-1.1/avr/variants/standard/pins_arduino.h rename to PSNeecore-1.2/avr/variants/standard/pins_arduino.h diff --git a/PSNeecore-1.1/avr/variants/tiny8/pins_arduino.h b/PSNeecore-1.2/avr/variants/tiny8/pins_arduino.h similarity index 100% rename from PSNeecore-1.1/avr/variants/tiny8/pins_arduino.h rename to PSNeecore-1.2/avr/variants/tiny8/pins_arduino.h diff --git a/PSNeecore-1.1/avr/variants/tinyx8/pins_arduino.h b/PSNeecore-1.2/avr/variants/tinyx8/pins_arduino.h similarity index 100% rename from PSNeecore-1.1/avr/variants/tinyx8/pins_arduino.h rename to PSNeecore-1.2/avr/variants/tinyx8/pins_arduino.h diff --git a/PSNeecore-1.1/avr/variants/tinyx8_mh/pins_arduino.h b/PSNeecore-1.2/avr/variants/tinyx8_mh/pins_arduino.h similarity index 100% rename from PSNeecore-1.1/avr/variants/tinyx8_mh/pins_arduino.h rename to PSNeecore-1.2/avr/variants/tinyx8_mh/pins_arduino.h