#include "amiga-autoconf.h"
#include "amiga-registers.h"
#include "../shared/rtc.h"
+#include "hunk-reloc.h"
#include "piscsi/piscsi.h"
#include "piscsi/piscsi-enums.h"
#include "net/pi-net.h"
int handle_register_write_amiga(unsigned int addr, unsigned int value, unsigned char type);
int init_rtg_data();
+extern int ac_z2_current_pic;
extern int ac_z2_done;
extern int ac_z2_pic_count;
extern int ac_z2_type[AC_PIC_LIMIT];
extern int ac_z2_index[AC_PIC_LIMIT];
+extern int ac_z3_current_pic;
extern int ac_z3_pic_count;
extern int ac_z3_done;
extern int ac_z3_type[AC_PIC_LIMIT];
static uint8_t rtg_enabled = 0, piscsi_enabled = 0, pinet_enabled = 0;
+extern uint32_t piscsi_base;
+
+extern void stop_cpu_emulation(uint8_t disasm_cur);
+
inline int custom_read_amiga(struct emulator_config *cfg, unsigned int addr, unsigned int *val, unsigned char type) {
if (!ac_z2_done && addr >= AC_Z2_BASE && addr < AC_Z2_BASE + AC_SIZE) {
if (ac_z2_pic_count == 0) {
}
}
+ if (addr >= piscsi_base && addr < piscsi_base + (64 * SIZE_KILO)) {
+ //printf("[Amiga-Custom] %s read from PISCSI base @$%.8X.\n", op_type_names[type], addr);
+ //stop_cpu_emulation(1);
+ *val = handle_piscsi_read(addr, type);
+ return 1;
+ }
+
return -1;
}
}
}
+ if (addr >= piscsi_base && addr < piscsi_base + (64 * SIZE_KILO)) {
+ //printf("[Amiga-Custom] %s write to PISCSI base @$%.8x: %.8X\n", op_type_names[type], addr, val);
+ handle_piscsi_write(addr, val, type);
+ return 1;
+ }
+
return -1;
}
cfg->custom_low = 0;
// Set up the min/max ranges for mapped reads/writes
- if (gayle_emulation_enabled) {
- cfg->mapped_low = GAYLEBASE;
- cfg->mapped_high = GAYLEBASE + GAYLESIZE;
- }
for (int i = 0; i < MAX_NUM_MAPPED_ITEMS; i++) {
if (cfg->map_type[i] != MAPTYPE_NONE) {
if ((cfg->map_offset[i] != 0 && cfg->map_offset[i] < cfg->mapped_low) || cfg->mapped_low == 0)
else
cfg->custom_low = min(cfg->custom_low, PISCSI_OFFSET);
cfg->custom_high = max(cfg->custom_high, PISCSI_UPPER);
+ if (piscsi_base != 0) {
+ cfg->custom_low = min(cfg->custom_low, piscsi_base);
+ }
}
if (pinet_enabled) {
if (cfg->custom_low == 0)
printf("[AMIGA] PISCSI Interface Enabled.\n");
piscsi_enabled = 1;
piscsi_init();
- ac_z2_type[ac_z2_pic_count] = ACTYPE_PSICSI;
+ ac_z2_type[ac_z2_pic_count] = ACTYPE_PISCSI;
ac_z2_pic_count++;
adjust_ranges_amiga(cfg);
}
void handle_reset_amiga(struct emulator_config *cfg) {
ac_z3_done = 0;
ac_z2_done = 0;
+ ac_z2_current_pic = 0;
+ ac_z3_current_pic = 0;
+
+ if (piscsi_enabled)
+ piscsi_refresh_drives();
adjust_ranges_amiga(cfg);
}