iret from dpmi interrupt handler (Developers)
You don't need to care about ret/iret in djgpp.
just define your ISR as simple C function:
void covox_playback_isr(void)
{}
and here is sample code how to install your new ISR:
//***************** install Covox playback ISR at timer interrupt ***********
void covox_playback_install(void)
{
printf("Installing new timer ISR for Covox playback...n");
// lock the functions and variables
_go32_dpmi_lock_code(covox_playback_isr,(DWord)sizeof(covox_playback_isr));
_go32_dpmi_lock_data((void *)&sound_buffer_cnt,(DWord)sizeof(sound_buffer_cnt));
_go32_dpmi_lock_data((void *)&sound_data_request,(DWord)sizeof(sound_data_request));
// load the address of the old timer ISR into the OldISR structure
_go32_dpmi_get_protected_mode_interrupt_vector(INT_TIMER,&timer_isr_old);
// point NewISR to the proper selector:offset for handler function
timer_isr_new.pm_offset=(DWord)covox_playback_isr;
timer_isr_new.pm_selector=_go32_my_cs();
// chain the new ISR onto the old one so that first the old INT_TIMER ISR will be called, then the new timer ISR
// _go32_dpmi_set_protected_mode_interrupt_vector(INT_TIMER,&timer_isr_new);
_go32_dpmi_chain_protected_mode_interrupt_vector(INT_TIMER,&timer_isr_new);
}
//***************** remove Covox playback ISR from timer interrupt chain ****
void covox_playback_uninstall(void)
{
printf("nRemoving new timer ISR for Covox playback...n");
// load the old timer ISR back without the new ISR chained on
_go32_dpmi_set_protected_mode_interrupt_vector(INT_TIMER,&timer_isr_old);
covox_playback_setup_fs(0); // set default timer speed
}
As I told, under DPMI host you cannot manipulate IVT on your own will but ratther use DPMI function wrappers to do things correctly. Read DJGPP FAQ documnt for more...
---
DOS gives me freedom to unlimited HW access.
Complete thread:
- iret from dpmi interrupt handler - cpcdos, 17.03.2018, 18:41 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- iret from dpmi interrupt handler - RayeR, 20.03.2018, 00:59
Mix view