mirror of
https://github.com/LIV2/WinUAE.git
synced 2025-12-06 00:12:52 +00:00
pre-exit callback
This commit is contained in:
parent
fe444426bf
commit
18b8df5898
@ -1153,7 +1153,7 @@ static bool a2065_config (struct autoconfig_info *aci)
|
||||
|
||||
device_add_hsync(a2065_hsync_handler);
|
||||
device_add_rethink(rethink_a2065);
|
||||
device_add_exit(a2065_free);
|
||||
device_add_exit(a2065_free, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -4567,9 +4567,9 @@ static void wd_init(void)
|
||||
{
|
||||
device_add_hsync(scsi_hsync);
|
||||
device_add_rethink(rethink_a2091);
|
||||
device_add_exit(a2091_free);
|
||||
device_add_exit(gvp_free);
|
||||
device_add_exit(a3000scsi_free);
|
||||
device_add_exit(a2091_free, NULL);
|
||||
device_add_exit(gvp_free, NULL);
|
||||
device_add_exit(a3000scsi_free, NULL);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
@ -2154,7 +2154,7 @@ int akiko_init(void)
|
||||
device_add_rethink(rethink_akiko);
|
||||
}
|
||||
|
||||
device_add_exit(akiko_free);
|
||||
device_add_exit(akiko_free, NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -1585,7 +1585,7 @@ addrbank *cd32_fmv_init (struct autoconfig_info *aci)
|
||||
|
||||
device_add_hsync(cd32_fmv_hsync_handler);
|
||||
device_add_vsync_pre(cd32_fmv_vsync_handler);
|
||||
device_add_exit(cd32_fmv_free);
|
||||
device_add_exit(cd32_fmv_free, NULL);
|
||||
device_add_rethink(rethink_cd32fmv);
|
||||
|
||||
return &fmv_rom_bank;
|
||||
|
||||
2
cdtv.cpp
2
cdtv.cpp
@ -1760,7 +1760,7 @@ bool cdtv_init(struct autoconfig_info *aci)
|
||||
|
||||
device_add_hsync(CDTV_hsync_handler);
|
||||
device_add_rethink(rethink_cdtv);
|
||||
device_add_exit(cdtv_free);
|
||||
device_add_exit(cdtv_free, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -1043,7 +1043,7 @@ bool cdtvcr_init(struct autoconfig_info *aci)
|
||||
|
||||
device_add_hsync(CDTVCR_hsync_handler);
|
||||
device_add_rethink(rethink_cdtvcr);
|
||||
device_add_exit(cdtvcr_free);
|
||||
device_add_exit(cdtvcr_free, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
15
devices.cpp
15
devices.cpp
@ -96,6 +96,8 @@ static int device_rethink_cnt;
|
||||
static DEVICE_VOID device_rethinks[MAX_DEVICE_ITEMS];
|
||||
static int device_leave_cnt;
|
||||
static DEVICE_VOID device_leaves[MAX_DEVICE_ITEMS];
|
||||
static int device_leave_early_cnt;
|
||||
static DEVICE_VOID device_leaves_early[MAX_DEVICE_ITEMS];
|
||||
static int device_resets_cnt;
|
||||
static DEVICE_INT device_resets[MAX_DEVICE_ITEMS];
|
||||
static bool device_reset_done[MAX_DEVICE_ITEMS];
|
||||
@ -109,6 +111,7 @@ static void reset_device_items(void)
|
||||
device_rethink_cnt = 0;
|
||||
device_resets_cnt = 0;
|
||||
device_leave_cnt = 0;
|
||||
device_leave_early_cnt = 0;
|
||||
memset(device_reset_done, 0, sizeof(device_reset_done));
|
||||
}
|
||||
|
||||
@ -132,9 +135,14 @@ void device_add_check_config(DEVICE_VOID p)
|
||||
{
|
||||
add_device_item(device_configs, &device_configs_cnt, p);
|
||||
}
|
||||
void device_add_exit(DEVICE_VOID p)
|
||||
void device_add_exit(DEVICE_VOID p, DEVICE_VOID p2)
|
||||
{
|
||||
add_device_item(device_leaves, &device_leave_cnt, p);
|
||||
if (p != NULL) {
|
||||
add_device_item(device_leaves, &device_leave_cnt, p);
|
||||
}
|
||||
if (p2 != NULL) {
|
||||
add_device_item(device_leaves_early, &device_leave_early_cnt, p2);
|
||||
}
|
||||
}
|
||||
void device_add_reset(DEVICE_INT p)
|
||||
{
|
||||
@ -308,6 +316,9 @@ void virtualdevice_free(void)
|
||||
// must be first
|
||||
uae_ppc_free();
|
||||
#endif
|
||||
|
||||
execute_device_items(device_leaves_early, device_leave_early_cnt);
|
||||
|
||||
#ifdef FILESYS
|
||||
filesys_cleanup();
|
||||
#endif
|
||||
|
||||
@ -2207,7 +2207,7 @@ static void gayle_init(void)
|
||||
device_add_check_config(check_prefs_changed_gayle);
|
||||
device_add_rethink(rethink_gayle);
|
||||
device_add_hsync(gayle_hsync);
|
||||
device_add_exit(gayle_free);
|
||||
device_add_exit(gayle_free, NULL);
|
||||
}
|
||||
|
||||
uae_u8 *save_gayle(size_t *len, uae_u8 *dstptr)
|
||||
|
||||
@ -1974,7 +1974,7 @@ static struct ide_board *getide(struct autoconfig_info *aci)
|
||||
{
|
||||
device_add_rethink(idecontroller_rethink);
|
||||
device_add_hsync(idecontroller_hsync);
|
||||
device_add_exit(idecontroller_free);
|
||||
device_add_exit(idecontroller_free, NULL);
|
||||
|
||||
for (int i = 0; i < MAX_IDE_UNITS; i++) {
|
||||
if (ide_boards[i]) {
|
||||
|
||||
@ -30,7 +30,7 @@ void device_add_rethink(DEVICE_VOID p);
|
||||
void device_add_check_config(DEVICE_VOID p);
|
||||
void device_add_reset(DEVICE_INT p);
|
||||
void device_add_reset_imm(DEVICE_INT p);
|
||||
void device_add_exit(DEVICE_VOID p);
|
||||
void device_add_exit(DEVICE_VOID p, DEVICE_VOID p2);
|
||||
|
||||
#define IRQ_SOURCE_PCI 0
|
||||
#define IRQ_SOURCE_SOUND 1
|
||||
|
||||
@ -1931,7 +1931,7 @@ static void ncr9x_reset_board(struct ncr9x_state *ncr)
|
||||
|
||||
device_add_rethink(ncr9x_rethink);
|
||||
device_add_reset(ncr9x_reset);
|
||||
device_add_exit(ncr9x_free);
|
||||
device_add_exit(ncr9x_free, NULL);
|
||||
}
|
||||
|
||||
void ncr_squirrel_init(struct romconfig *rc, uaecptr baseaddress)
|
||||
|
||||
@ -872,7 +872,7 @@ static void ncr_reset_board (struct ncr_state *ncr)
|
||||
ncr->irq = false;
|
||||
|
||||
device_add_rethink(ncr_rethink);
|
||||
device_add_exit(ncr_free);
|
||||
device_add_exit(ncr_free, NULL);
|
||||
device_add_vsync_pre(ncr_vsync);
|
||||
device_add_reset(ncr_reset);
|
||||
}
|
||||
|
||||
@ -6659,7 +6659,7 @@ void uaegfx_install_code (uaecptr start)
|
||||
|
||||
device_add_reset(picasso_reset);
|
||||
device_add_hsync(picasso_handle_hsync);
|
||||
device_add_exit(picasso_free);
|
||||
device_add_exit(picasso_free, NULL);
|
||||
}
|
||||
|
||||
#define UAEGFX_VERSION 3
|
||||
|
||||
2
pci.cpp
2
pci.cpp
@ -1768,7 +1768,7 @@ static void pci_init(void)
|
||||
{
|
||||
device_add_reset(pci_reset);
|
||||
device_add_rethink(pci_rethink);
|
||||
device_add_exit(pci_free);
|
||||
device_add_exit(pci_free, NULL);
|
||||
device_add_hsync(pci_hsync);
|
||||
}
|
||||
|
||||
|
||||
@ -1947,7 +1947,7 @@ static void ne2000_free(void)
|
||||
|
||||
static void init(void)
|
||||
{
|
||||
device_add_exit(ne2000_free);
|
||||
device_add_exit(ne2000_free, NULL);
|
||||
device_add_reset(ne2000_reset);
|
||||
device_add_hsync(ne2000_hsync);
|
||||
device_add_rethink(rethink_ne2000);
|
||||
|
||||
2
scsi.cpp
2
scsi.cpp
@ -4327,7 +4327,7 @@ static struct soft_scsi *getscsi(struct romconfig *rc)
|
||||
{
|
||||
device_add_rethink(ncr80_rethink);
|
||||
device_add_reset(soft_scsi_reset);
|
||||
device_add_exit(soft_scsi_free);
|
||||
device_add_exit(soft_scsi_free, NULL);
|
||||
if (rc->unitdata)
|
||||
return (struct soft_scsi *)rc->unitdata;
|
||||
return NULL;
|
||||
|
||||
@ -3002,8 +3002,8 @@ static void snd_init(void)
|
||||
device_add_hsync(sndboard_hsync);
|
||||
device_add_vsync_post(sndboard_vsync);
|
||||
device_add_rethink(sndboard_rethink);
|
||||
device_add_exit(sndboard_free);
|
||||
device_add_exit(uaesndboard_free);
|
||||
device_add_exit(sndboard_free, NULL);
|
||||
device_add_exit(uaesndboard_free, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
||||
2
x86.cpp
2
x86.cpp
@ -3854,7 +3854,7 @@ bool x86_bridge_init(struct autoconfig_info *aci, uae_u32 romtype, int type)
|
||||
|
||||
device_add_hsync(x86_bridge_hsync);
|
||||
device_add_vsync_pre(x86_bridge_vsync);
|
||||
device_add_exit(x86_bridge_free);
|
||||
device_add_exit(x86_bridge_free, NULL);
|
||||
device_add_rethink(x86_bridge_rethink);
|
||||
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user