Skip to content

Commit

Permalink
n64: Only interrupt if n64 is on
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryzee119 committed Dec 14, 2020
1 parent e384334 commit 30552d4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,33 @@ static void ring_buffer_flush();

n64_controller n64_c[MAX_CONTROLLERS];
n64_settings *settings;
int n64_is_on = 0;

#if (MAX_CONTROLLERS >= 1)
void n64_controller1_clock_edge()
{
if(input_is_connected(0))
if(input_is_connected(0) && n64_is_on)
n64_controller_hande_new_edge(&n64_c[0]);
}
#endif
#if (MAX_CONTROLLERS >= 2)
void n64_controller2_clock_edge()
{
if(input_is_connected(1))
if(input_is_connected(1) && n64_is_on)
n64_controller_hande_new_edge(&n64_c[1]);
}
#endif
#if (MAX_CONTROLLERS >= 3)
void n64_controller3_clock_edge()
{
if(input_is_connected(2))
if(input_is_connected(2) && n64_is_on)
n64_controller_hande_new_edge(&n64_c[2]);
}
#endif
#if (MAX_CONTROLLERS >= 4)
void n64_controller4_clock_edge()
{
if(input_is_connected(3))
if(input_is_connected(3) && n64_is_on)
n64_controller_hande_new_edge(&n64_c[3]);
}
#endif
Expand Down Expand Up @@ -237,7 +238,8 @@ void loop()

//Handle ram flushing. Auto flushes when the N64 is turned off :)
static uint32_t flushing_toggle[MAX_CONTROLLERS] = {0};
if ((n64_combo && (n64_buttons[c] & N64_A)) || digitalRead(N64_CONSOLE_SENSE) == 0)
n64_is_on = digitalRead(N64_CONSOLE_SENSE);
if ((n64_combo && (n64_buttons[c] & N64_A)) || (n64_is_on == 0))
{
if (flushing_toggle[c] == 0)
{
Expand Down

0 comments on commit 30552d4

Please sign in to comment.