mirror of
https://github.com/kalymos/PsNee.git
synced 2026-05-06 23:57:40 +00:00
Destroyed PSNee_V**.ino (markdown)
@@ -1,69 +0,0 @@
|
||||
This file is the heart of the project, and I will try to explain its content to you as best I can, in the order of appearance.
|
||||
|
||||
### Select your chip
|
||||
|
||||
And the place where you choose the architecture of your MUC. For more details, see the MUC.h page
|
||||
|
||||
### Select your console
|
||||
|
||||
Here is the selection of your target PS1. The details of the targets can be found on the config.h page
|
||||
|
||||
### Options
|
||||
|
||||
**#define PATCH_SWICHE**
|
||||
and useful on some Japanese console models to disable the BIOS patch, in the case of using a Japanese game. To use it, you must add a switch between PIN_SWITCH and GND
|
||||
|
||||
**#define LED_RUN**
|
||||
allows you to activate the LED of the Arduino board when the program injects the region code or modifies the BIOS reading
|
||||
pointer and variable section
|
||||
|
||||
### pointer and variable section
|
||||
|
||||
pointer to other files in the code
|
||||
**#include "MUC.h"**
|
||||
**#include "parameters.h"**
|
||||
**#include "BIOS_patching.h"**
|
||||
|
||||
Specific constant for region code injection
|
||||
**#define DELAY_BETWEEN_BITS 4000** Defines the injection rate of region code bits.
|
||||
**#define DELAY_BETWEEN_INJECTIONS 90** Defines the time between the different injection cycles.
|
||||
**#define HYSTERESIS_MAX 14** This value is used to simulate the reaction time of reading the CD. This value was defined after experimentation on functional but very used players, on players in good condition I could see that it was functional at a value of 5, and that depending on the console could increase it up to 200-250, in rare cases it is possible that increasing this value is necessary.
|
||||
|
||||
Variable of the different clocks allowing to do without Arduino libraries
|
||||
**volatile uint8_t count_isr = 0;** Interrupt counter generated by the internal clocks of the MUC
|
||||
**volatile uint32_t microsec = 0;** Clock in microseconds
|
||||
**Volatile uint16_t millisec = 0;** Clock in milliseconds
|
||||
|
||||
### Code section
|
||||
|
||||
Interrupt Service Routine function for clock increment.
|
||||
**ISR(CTC_TIMER_VECTOR)**
|
||||
This interrupt function uses the register definitions in the MUC.h file, to increment the clocks, bypassing the Arduino libraries.
|
||||
|
||||
clock reset function.
|
||||
**void Timer_Start()**
|
||||
This function is used before BIOS patch and region code injections. To clear the internal clock registers, and to turn on the interrupt register for the clock function.
|
||||
|
||||
Clock stop function.
|
||||
**void Timer_Stop()**
|
||||
Used at the end of injection cycles, to reset clock registers, clear the internal interrupt register, and reset clock variables.
|
||||
|
||||
**void Init()**
|
||||
|
||||
Clear the Timer/Counter Registe.
|
||||
Set the Output Compare Register.
|
||||
Set the Timer/Counter Control Register A.
|
||||
Set the Timer/Counter Control Register B.
|
||||
This first series of operations is used to set the internal clock to 100KHz.
|
||||
|
||||
Initializes the external switch, for disabling the bios patch.
|
||||
|
||||
Initializes the LED of the Arduino cards.
|
||||
|
||||
Allows global interrupts from an external signal.
|
||||
|
||||
Initializes the two pins that are used for signal input, for region injection.
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user