Reset from Amiga CTRL+A+A

This commit is contained in:
shanshe 2021-04-13 20:10:24 +02:00
parent b2121be23f
commit 75bbc70be8
7 changed files with 34096 additions and 34060 deletions

View File

@ -109,6 +109,8 @@ char keyboard_file[256] = "/dev/input/event1";
uint64_t trig_irq = 0, serv_irq = 0;
uint16_t irq_delay = 0;
unsigned int amiga_reset=0, amiga_reset_last=0;
unsigned int do_reset=0;
void *ipl_task(void *args) {
printf("IPL thread running\n");
@ -139,6 +141,24 @@ void *ipl_task(void *args) {
//usleep(0);
}
}
if(do_reset==0)
{
amiga_reset=(value & (1 << PIN_RESET));
if(amiga_reset!=amiga_reset_last)
{
amiga_reset_last=amiga_reset;
if(amiga_reset==0)
{
printf("Amiga Reset is down...\n");
do_reset=1;
M68K_END_TIMESLICE;
}
else
{
printf("Amiga Reset is up...\n");
}
}
}
/*if (gayle_ide_enabled) {
if (((gayle_int & 0x80) || gayle_a4k_int) && (get_ide(0)->drive[0].intrq || get_ide(0)->drive[1].intrq)) {
@ -211,6 +231,15 @@ cpu_loop:
last_irq = 0;
}
}*/
if (do_reset) {
cpu_pulse_reset();
m68k_pulse_reset();
do_reset=0;
usleep(1000000); // 1sec
// while(amiga_reset==0);
// printf("CPU emulation reset.\n");
}
if (mouse_hook_enabled && (mouse_extra != 0x00)) {
// mouse wheel events have occurred; unlike l/m/r buttons, these are queued as keypresses, so add to end of buffer

View File

@ -11,7 +11,7 @@
#define PIN_A0 2
#define PIN_A1 3
#define PIN_CLK 4
#define PIN_UNUSED 5
#define PIN_RESET 5
#define PIN_RD 6
#define PIN_WR 7
#define PIN_D(x) (8 + x)

View File

@ -1159,9 +1159,6 @@ void m68k_pulse_reset(void)
/* Read the initial stack pointer and program counter */
m68ki_jump(0);
REG_SP = m68ki_read_imm_32();
REG_PC = m68ki_read_imm_32();
m68ki_jump(REG_PC);
CPU_RUN_MODE = RUN_MODE_NORMAL;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@ set_global_assignment -name ERROR_CHECK_FREQUENCY_DIVISOR "-1"
set_global_assignment -name POWER_EXT_SUPPLY_VOLTAGE_TO_REGULATOR 3.3V
set_location_assignment PIN_12 -to PI_CLK
set_location_assignment PIN_34 -to PI_UNUSED
set_location_assignment PIN_34 -to PI_RESET
set_location_assignment PIN_28 -to PI_A[1]
set_location_assignment PIN_27 -to PI_A[0]
set_location_assignment PIN_2 -to PI_D[0]
@ -111,6 +111,10 @@ set_location_assignment PIN_74 -to M68K_LDS_n
set_location_assignment PIN_75 -to M68K_RW
set_location_assignment PIN_76 -to M68K_DTACK_n
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to M68K_IPL_n[0]
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to M68K_IPL_n[1]
set_instance_assignment -name WEAK_PULL_UP_RESISTOR ON -to M68K_IPL_n[2]
set_global_assignment -name AUTO_RESTART_CONFIGURATION OFF
set_global_assignment -name ENABLE_OCT_DONE OFF
set_global_assignment -name ENABLE_CONFIGURATION_PINS OFF

View File

@ -7,7 +7,7 @@ module pistorm(
output reg PI_IPL_ZERO, // GPIO1
input [1:0] PI_A, // GPIO[3..2]
input PI_CLK, // GPIO4
input PI_UNUSED, // GPIO5
output reg PI_RESET, // GPIO5
input PI_RD, // GPIO6
input PI_WR, // GPIO7
inout [15:0] PI_D, // GPIO[23..8]
@ -61,6 +61,8 @@ module pistorm(
PI_TXN_IN_PROGRESS <= 1'b0;
PI_IPL_ZERO <= 1'b0;
PI_RESET <= 1'b0;
M68K_FC <= 3'd0;
M68K_RW <= 1'b1;
@ -179,6 +181,10 @@ module pistorm(
PI_IPL_ZERO <= ipl == 3'd0;
end
always @(posedge c200m) begin
PI_RESET <= reset_out ? 1'b1 : M68K_RESET_n;
end
reg [3:0] e_counter = 4'd0;
always @(negedge c7m) begin