1
0
Fork 0

move callback default segment to bios standard;

use fixed default offset for irq0 as well (ripsaw, fixes tinker tales)


Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3423
This commit is contained in:
Sebastian Strohhäcker 2009-06-11 16:05:17 +00:00
parent c2eeb226ba
commit 58ce4315f8
5 changed files with 77 additions and 58 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: bios.cpp,v 1.75 2009-06-07 10:18:14 c2woody Exp $ */
/* $Id: bios.cpp,v 1.76 2009-06-11 16:05:17 c2woody Exp $ */
#include "dosbox.h"
#include "mem.h"
@ -759,9 +759,11 @@ public:
for (Bit16u i=0;i<0x200;i++) real_writeb(0x40,i,0);
/* Setup all the interrupt handlers the bios controls */
/* INT 8 Clock IRQ Handler */
callback[0].Install(INT8_Handler,CB_IRQ0,"Int 8 Clock");
callback[0].Set_RealVec(0x8);
Bitu call_irq0=CALLBACK_Allocate();
CALLBACK_Setup(call_irq0,INT8_Handler,CB_IRQ0,Real2Phys(BIOS_DEFAULT_IRQ0_LOCATION),"IRQ 0 Clock");
RealSetVec(0x08,BIOS_DEFAULT_IRQ0_LOCATION);
// pseudocode for CB_IRQ0:
// callback INT8_Handler
// push ax,dx,ds
@ -835,15 +837,12 @@ public:
phys_writew(0xFFFF3,RealSeg(rptr)); // segment
/* Irq 2 */
RealPt irq2pt=RealMake(0xf000,0xff55); /* Ghost busters 2 mt32 mode */
Bitu call_irq2=CALLBACK_Allocate();
CALLBACK_Setup(call_irq2,NULL,CB_IRET_EOI_PIC1,Real2Phys(irq2pt),"irq 2 bios");
RealSetVec(0x0a,irq2pt);
CALLBACK_Setup(call_irq2,NULL,CB_IRET_EOI_PIC1,Real2Phys(BIOS_DEFAULT_IRQ2_LOCATION),"irq 2 bios");
RealSetVec(0x0a,BIOS_DEFAULT_IRQ2_LOCATION);
/* Some hardcoded vectors */
phys_writeb(0xfff53,0xcf); /* bios default interrupt vector location */
phys_writeb(0xfe987,0xea); /* original IRQ1 location (Defender booter) */
phys_writed(0xfe988,RealGetVec(0x09));
phys_writeb(Real2Phys(BIOS_DEFAULT_HANDLER_LOCATION),0xcf); /* bios default interrupt vector location -> IRET */
phys_writew(Real2Phys(RealGetVec(0x12))+0x12,0x20); //Hack for Jurresic
if (machine==MCH_TANDY) phys_writeb(0xffffe,0xff) ; /* Tandy model */

View file

@ -16,6 +16,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: bios_keyboard.cpp,v 1.36 2009-06-11 16:05:17 c2woody Exp $ */
#include "dosbox.h"
#include "callback.h"
#include "mem.h"
@ -382,7 +384,7 @@ static Bitu IRQ1_Handler(void) {
}
if(flags1 &0x08) {
Bit8u token = mem_readb(BIOS_KEYBOARD_TOKEN);
token= token*10 + scan_to_scanascii[scancode].alt;
token = token*10 + (Bit8u)(scan_to_scanascii[scancode].alt&0xff);
mem_writeb(BIOS_KEYBOARD_TOKEN,token);
} else if (flags1 &0x04) {
add_key(scan_to_scanascii[scancode].control);
@ -601,12 +603,12 @@ void BIOS_SetupKeyboard(void) {
/* Allocate/setup a callback for int 0x16 and for standard IRQ 1 handler */
call_int16=CALLBACK_Allocate();
CALLBACK_Setup(call_int16,&INT16_Handler,CB_INT16,"keyboard");
CALLBACK_Setup(call_int16,&INT16_Handler,CB_INT16,"Keyboard");
RealSetVec(0x16,CALLBACK_RealPointer(call_int16));
call_irq1=CALLBACK_Allocate();
CALLBACK_Setup(call_irq1,&IRQ1_Handler,CB_IRQ1,"keyboard irq");
RealSetVec(0x9,CALLBACK_RealPointer(call_irq1));
CALLBACK_Setup(call_irq1,&IRQ1_Handler,CB_IRQ1,Real2Phys(BIOS_DEFAULT_IRQ1_LOCATION),"IRQ 1 Keyboard");
RealSetVec(0x09,BIOS_DEFAULT_IRQ1_LOCATION);
// pseudocode for CB_IRQ1:
// push ax
// in al, 0x60