Skip to content

Commit

Permalink
pulse_reset returns number of reset cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
cnvogelg committed Sep 30, 2024
1 parent 9a30f76 commit f558f5d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/m68k.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cdef extern from "m68k.h":

void m68k_set_cpu_type(unsigned int cpu_type)
void m68k_init()
void m68k_pulse_reset()
int m68k_pulse_reset()
int m68k_execute(int num_cycles)
void m68k_end_timeslice()
int m68k_cycles_run()
Expand Down
2 changes: 1 addition & 1 deletion src/musashi/m68k.h
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ void m68k_init(void);
* the CPU for the first time, the CPU will be set to
* M68K_CPU_TYPE_68000.
*/
void m68k_pulse_reset(void);
int m68k_pulse_reset(void);

/* execute num_cycles worth of instructions. returns number of cycles used */
int m68k_execute(int num_cycles);
Expand Down
4 changes: 3 additions & 1 deletion src/musashi/m68kcpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ void m68k_pulse_bus_error(void)
}

/* Pulse the RESET line on the CPU */
void m68k_pulse_reset(void)
int m68k_pulse_reset(void)
{
/* Disable the PMMU on reset */
m68ki_cpu.pmmu_enabled = 0;
Expand Down Expand Up @@ -1152,6 +1152,8 @@ void m68k_pulse_reset(void)
CPU_RUN_MODE = RUN_MODE_NORMAL;

RESET_CYCLES = CYC_EXCEPTION[EXCEPTION_RESET];

return RESET_CYCLES;
}

/* Pulse the HALT line on the CPU */
Expand Down
2 changes: 1 addition & 1 deletion src/pycpu.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ cdef class CPU:
return self.r_reg_internal(M68K_REG_MSP)

def pulse_reset(self):
m68k_pulse_reset()
return m68k_pulse_reset()

def execute(self, num_cycles):
clear_run_exc()
Expand Down

0 comments on commit f558f5d

Please sign in to comment.