mirror of
https://github.com/kalymos/PsNee.git
synced 2026-01-11 23:53:07 +00:00
Too many things to summarize
Refactoring of the setting file, to be able to have settings specifying the HYSTERESIS_MAX variable. Renamed precompilation variable in BIOS_patching file. Changing console selection in .ino file
This commit is contained in:
parent
f4e16fe717
commit
e2d07b7f35
@ -1,7 +1,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef BIOS_PATCH
|
||||
#if defined(SCPH_102) || defined(SCPH_100) || defined(SCPH_7000_9000) || defined(SCPH_5500) || defined(SCPH_3500_5000) || defined(SCPH_3000) || defined(SCPH_1000)
|
||||
|
||||
|
||||
void Timer_Start(void);
|
||||
void Timer_Stop(void);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,32 +1,52 @@
|
||||
//------------------------------------------------------------------------------------------------
|
||||
// Select your console
|
||||
//------------------------------------------------------------------------------------------------
|
||||
// Attention!
|
||||
// If a BIOS checksum is specified, it is more important than the SCPH model number!
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
//Legacy mode works the same as V7.
|
||||
|
||||
//All NTSC-U/C SCPH_xxx1, all PAL FAT models SCPH_xxx2, SCPH_103. It's 0.5 seconds longer than choosing a specific region.
|
||||
//On models with problematic CD players the HYSTERESIS_MAX setting may be a little short.
|
||||
|
||||
//#define SCPH_xxxx
|
||||
|
||||
//Here the regions are specified
|
||||
//#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 // Maybe for all SCPH_xxx3 but I have no info.
|
||||
//-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
|
||||
|
||||
//Here the regions are specified. No BIOS patching needed.
|
||||
|
||||
//Here the setting of HYSTERESIS_MAX goes up to 20.
|
||||
|
||||
//#define SCPH_xxx1 // NTSC-U/C FAT.
|
||||
//#define SCPH_xxx2 // PAL FAT.
|
||||
//#define SCPH_xxx3 // NTSC-Asia FAT.
|
||||
|
||||
//Here the HYSTERESIS_MAX setting is 15.
|
||||
|
||||
//#define SCPH_101 // NTSC-U/C.
|
||||
//#define SCPH_103 // NTSC-Asia.
|
||||
|
||||
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
|
||||
|
||||
//And all models that require a BIOS patch.
|
||||
|
||||
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
// Attention!
|
||||
// If a BIOS checksum is specified, it is more important than the SCPH model number!
|
||||
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
||||
|
||||
//And all models that require a BIOS patch
|
||||
//#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
|
||||
//#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
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
//#define ATmega328_168
|
||||
//#define ATmega32U4_16U4
|
||||
//#define ATtiny85_45_25
|
||||
@ -65,7 +85,7 @@
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
||||
#define LED_RUN // Turns on the LED when injections occur. D13 for Arduino, ATtiny add a led between PB3 (pin 2) and gnd with a 1k resistor in series, ATmega32U4 (Pro Micro) add a led between PB6 (pin 10) and gnd with a 1k resistor in series
|
||||
//#define PATCH_SWICHE // Enables hardware support for disabling BIOS patching. Useful in rare cases where the BIOS patch prevents the playback of original games
|
||||
#define PATCH_SWITCH // Enables hardware support for disabling BIOS patching. Useful in rare cases where the BIOS patch prevents the playback of original games
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
// pointer and variable section
|
||||
@ -78,8 +98,8 @@
|
||||
//Initializing values for region code injection timing
|
||||
#define DELAY_BETWEEN_BITS 4000 // 250 bits/s (microseconds) (ATtiny 8Mhz works from 3950 to 4100) PU-23 PU-22 MAX 4250 MIN 3850
|
||||
#define DELAY_BETWEEN_INJECTIONS 90 // The sweet spot is around 80~100. For all observed models, the worst minimum time seen is 72, and it works well up to 250.
|
||||
#define HYSTERESIS_MAX 17 // The sweet spot is between 11~19. All models have bad behavior below 11, PU-41 can start to have bad behavior beyond 20, for fat models we can go up to 60
|
||||
// On fat models if your reader is really bad you can increase this value in steps of 5.
|
||||
//#define HYSTERESIS_MAX 17 // The sweet spot is between 11~19. All models have bad behavior below 11, PU-41 can start to have bad behavior beyond 20, for fat models we can go up to 60
|
||||
|
||||
|
||||
//Creation of the different variables for the counter
|
||||
volatile uint8_t count_isr = 0;
|
||||
@ -293,10 +313,10 @@ void Init() {
|
||||
SET_TIMER_TCCROB;
|
||||
#endif
|
||||
|
||||
#if defined(PATCH_SW) && defined(BIOS_PATCH)
|
||||
#if defined(PATCH_SWITCH) && defined(BIOS_PATCH)
|
||||
PIN_SWITCH_INPUT;
|
||||
PIN_SWITCH_SET;
|
||||
if (PIN_SWICHE_READ = 0){
|
||||
if (PIN_SWITCH_READ == 0){
|
||||
Flag_Switch =1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -17,25 +17,10 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifdef SCPH_xxxx
|
||||
#define SCEZ
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_xxx1
|
||||
#define SCEA
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_xxx2
|
||||
#define SCEE
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_103
|
||||
#define SCEI
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_102
|
||||
#define SCEE
|
||||
#define BIOS_PATCH
|
||||
//#define SCEE
|
||||
//#define BIOS_PATCH
|
||||
#define HOLD _delay_us(2.75)
|
||||
#define PATCHING _delay_us(0.2)
|
||||
#define CHECKPOINT 83900
|
||||
@ -43,8 +28,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_100
|
||||
#define SCEI
|
||||
#define BIOS_PATCH
|
||||
//#define SCEI
|
||||
//#define BIOS_PATCH
|
||||
#define HOLD _delay_us(2.7)
|
||||
#define PATCHING _delay_us(0.2)
|
||||
#define CHECKPOINT 83900
|
||||
@ -52,8 +37,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_7000_9000
|
||||
#define SCEI
|
||||
#define BIOS_PATCH
|
||||
//#define SCEI
|
||||
//#define BIOS_PATCH
|
||||
#define HOLD _delay_us(2.85)
|
||||
#define PATCHING _delay_us(0.1)
|
||||
#define CHECKPOINT 75270
|
||||
@ -61,8 +46,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_5500
|
||||
#define SCEI
|
||||
#define BIOS_PATCH
|
||||
//#define SCEI
|
||||
//#define BIOS_PATCH
|
||||
#define HOLD _delay_us(2.85)
|
||||
#define PATCHING _delay_us(0.1)
|
||||
#define CHECKPOINT 76130
|
||||
@ -71,8 +56,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_3500_5000
|
||||
#define SCEI
|
||||
#define BIOS_PATCH
|
||||
//#define SCEI
|
||||
//#define BIOS_PATCH
|
||||
#define HOLD _delay_us(2.85)
|
||||
#define PATCHING _delay_us(0.1)
|
||||
#define CHECKPOINT 75260
|
||||
@ -81,8 +66,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_3000
|
||||
#define SCEI
|
||||
#define BIOS_PATCH
|
||||
//#define SCEI
|
||||
//#define BIOS_PATCH
|
||||
#define HOLD _delay_us(2.75)
|
||||
#define PATCHING _delay_us(0.1)
|
||||
#define CHECKPOINT 83000
|
||||
@ -97,8 +82,8 @@
|
||||
#endif
|
||||
|
||||
#ifdef SCPH_1000
|
||||
#define SCEI
|
||||
#define BIOS_PATCH
|
||||
//#define SCEI
|
||||
//#define BIOS_PATCH
|
||||
#define HOLD _delay_us(2.7)
|
||||
#define PATCHING _delay_us(0.1)
|
||||
#define CHECKPOINT 83000
|
||||
@ -112,29 +97,38 @@
|
||||
#define TRIGGER2 71
|
||||
#endif
|
||||
|
||||
#ifdef SCEA
|
||||
#if defined(SCPH_xxx1) || defined(SCPH_101)
|
||||
const char region[1] = {'a'};
|
||||
#endif
|
||||
|
||||
#ifdef SCEE
|
||||
#if defined(SCPH_102) || defined(SCPH_xxx2)
|
||||
const char region[1] = {'e'};
|
||||
#endif
|
||||
|
||||
#ifdef SCEI
|
||||
#if defined(SCPH_100) || defined(SCPH_7000_9000) || defined(SCPH_5500) || defined(SCPH_3500_5000) || defined(SCPH_3000) || defined(SCPH_1000) || defined(SCPH_103) || defined(SCPH_xxx3)
|
||||
const char region[1] = {'i'};
|
||||
#endif
|
||||
|
||||
#ifdef SCEZ
|
||||
#ifdef SCPH_xxxx
|
||||
const char region[3] = {'a', 'e', 'i'};
|
||||
#endif
|
||||
|
||||
#if !defined(SCPH_xxx1) && !defined(SCPH_xxx2) && !defined(SCPH_103) && \
|
||||
!defined(SCPH_102) && !defined(SCPH_100) && !defined(SCPH_7000_9000) && \
|
||||
//All models have bad behavior below 11, PU-41 can start to have bad behavior beyond 20, for fat models we can go up to 60
|
||||
#if defined(SCPH_100) || defined(SCPH_101) || defined(SCPH_102) || defined(SCPH_103) || defined(SCPH_xxxx)
|
||||
#define HYSTERESIS_MAX 15
|
||||
#endif
|
||||
|
||||
#if defined(SCPH_xxx1) || defined(SCPH_xxx2) || defined(SCPH_xxx3) || defined(SCPH_7000_9000) || defined(SCPH_5500) || defined(SCPH_3500_5000) || defined(SCPH_3000) || defined(SCPH_1000)
|
||||
#define HYSTERESIS_MAX 20
|
||||
#endif
|
||||
|
||||
#if !defined(SCPH_xxx1) && !defined(SCPH_xxx2) && !defined(SCPH_xxx3) && !defined(SCPH_103) && \
|
||||
!defined(SCPH_102) && !defined(SCPH_101) && !defined(SCPH_100) && !defined(SCPH_7000_9000) && \
|
||||
!defined(SCPH_5500) && !defined(SCPH_3500_5000) && !defined(SCPH_3000) && \
|
||||
!defined(SCPH_1000) && !defined(SCPH_xxxx)
|
||||
#error "Console not selected! Please uncoment #define with SCPH model number."
|
||||
#elif !(defined(SCPH_xxx1) ^ defined(SCPH_xxx2) ^ defined(SCPH_103) ^ \
|
||||
defined(SCPH_102) ^ defined(SCPH_100) ^ defined(SCPH_7000_9000) ^ \
|
||||
#elif !(defined(SCPH_xxx1) ^ defined(SCPH_xxx2) ^ defined(SCPH_xxx3) ^ defined(SCPH_103) ^ \
|
||||
defined(SCPH_102) ^ defined(SCPH_101) ^ defined(SCPH_100) ^ defined(SCPH_7000_9000) ^ \
|
||||
defined(SCPH_5500) ^ defined(SCPH_3500_5000) ^ defined(SCPH_3000) ^ \
|
||||
defined(SCPH_1000) ^ defined(SCPH_xxxx))
|
||||
#error "May be selected only one console! Please check #define with SCPH model number."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user