Add support for Print Screen key and interrupt. The keypress allows Descent 1 and 2 ingame screenshot feature to be used, the keypress and interrupt allow the Horror Hotel (TSR text adventure) hotkey to work, and the compatible interrupt handler location fixes a game bug in The Forgotten Land.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3961
This commit is contained in:
parent
18f5c4c565
commit
26dd1635b5
5 changed files with 39 additions and 2 deletions
|
@ -1102,6 +1102,11 @@ public:
|
|||
CALLBACK_Setup(call_irq2,NULL,CB_IRET_EOI_PIC1,Real2Phys(BIOS_DEFAULT_IRQ2_LOCATION),"irq 2 bios");
|
||||
RealSetVec(0x0a,BIOS_DEFAULT_IRQ2_LOCATION);
|
||||
|
||||
// INT 05h: Print Screen
|
||||
// IRQ1 handler calls it when PrtSc key is pressed; does nothing unless hooked
|
||||
phys_writeb(Real2Phys(BIOS_DEFAULT_INT5_LOCATION),0xcf);
|
||||
RealSetVec(0x05,BIOS_DEFAULT_INT5_LOCATION);
|
||||
|
||||
/* Some hardcoded vectors */
|
||||
phys_writeb(Real2Phys(BIOS_DEFAULT_HANDLER_LOCATION),0xcf); /* bios default interrupt vector location -> IRET */
|
||||
phys_writew(Real2Phys(RealGetVec(0x12))+0x12,0x20); //Hack for Jurresic
|
||||
|
|
|
@ -284,6 +284,13 @@ static Bitu IRQ1_Handler(void) {
|
|||
case 0xb6: /* Right Shift Released */
|
||||
flags1 &=~0x01;
|
||||
break;
|
||||
case 0x37: /* Keypad * or PrtSc Pressed */
|
||||
if (!(flags3 &0x02)) goto normal_key;
|
||||
reg_ip+=7; // call int 5
|
||||
break;
|
||||
case 0xb7: /* Keypad * or PrtSc Released */
|
||||
if (!(flags3 &0x02)) goto normal_key;
|
||||
break;
|
||||
case 0x38: /* Alt Pressed */
|
||||
flags1 |=0x08;
|
||||
if (flags3 &0x02) flags3 |=0x08;
|
||||
|
@ -399,6 +406,7 @@ static Bitu IRQ1_Handler(void) {
|
|||
break;
|
||||
|
||||
default: /* Normal Key */
|
||||
normal_key:
|
||||
Bit16u asciiscan;
|
||||
/* Now Handle the releasing of keys and see if they match up for a code */
|
||||
/* Handle the actual scancode */
|
||||
|
@ -638,6 +646,14 @@ void BIOS_SetupKeyboard(void) {
|
|||
// out 0x20, al
|
||||
// pop ax
|
||||
// iret
|
||||
// cli
|
||||
// mov al, 0x20
|
||||
// out 0x20, al
|
||||
// push bp
|
||||
// int 0x05
|
||||
// pop bp
|
||||
// pop ax
|
||||
// iret
|
||||
|
||||
if (machine==MCH_PCJR) {
|
||||
call_irq6=CALLBACK_Allocate();
|
||||
|
@ -648,7 +664,11 @@ void BIOS_SetupKeyboard(void) {
|
|||
// in al, 0x60
|
||||
// cmp al, 0xe0
|
||||
// je skip
|
||||
// push ds
|
||||
// push 0x40
|
||||
// pop ds
|
||||
// int 0x09
|
||||
// pop ds
|
||||
// label skip:
|
||||
// cli
|
||||
// mov al, 0x20
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue