mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-10-14 02:17:36 +08:00
BIOS and DOS CON device: Make STOP key work the same way as CTRL+C and CTRL+BREAK
This commit is contained in:
@@ -672,6 +672,12 @@ bool device_CON::Read(uint8_t * data,uint16_t * size) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Make STOP key work
|
||||
if (IS_PC98_ARCH && DOS_BreakFlag) {
|
||||
data[count++]=0x03; // CTRL+C
|
||||
continue;
|
||||
}
|
||||
|
||||
reg_ah=(IS_EGAVGA_ARCH)?0x10:0x0;
|
||||
|
||||
/* FIXME: PC-98 emulation should eventually use CONIO emulation that
|
||||
|
@@ -6972,11 +6972,18 @@ uint32_t BIOS_get_PC98_INT_STUB(void) {
|
||||
|
||||
Bitu call_pc98_default_stop;
|
||||
|
||||
extern bool DOS_BreakFlag;
|
||||
|
||||
static Bitu pc98_default_stop_handler(void) {
|
||||
// INT 06h, which means someone pressed the STOP key... or the CPU is signalling an invalid opcode.
|
||||
// The overlap makes it extremely unclear.
|
||||
LOG_MSG("Invalid opcode or unhandled PC-98 STOP key interrupt 06h");
|
||||
return CBRET_NONE;
|
||||
|
||||
// try to make it work as CTRL+BREAK in the built-in DOS environment.
|
||||
if (!dos_kernel_disabled)
|
||||
DOS_BreakFlag = true;
|
||||
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
/* NTS: Remember the 8259 is non-sentient, and the term "slave" is used in a computer programming context */
|
||||
|
@@ -1402,6 +1402,8 @@ static bool IsEnhancedKey(uint16_t &key) {
|
||||
return false;
|
||||
}
|
||||
|
||||
extern bool DOS_BreakFlag;
|
||||
|
||||
bool int16_unmask_irq1_on_read = true;
|
||||
bool int16_ah_01_cf_undoc = true;
|
||||
|
||||
@@ -1412,6 +1414,12 @@ Bitu INT16_Handler(void) {
|
||||
if (int16_unmask_irq1_on_read)
|
||||
PIC_SetIRQMask(1,false); /* unmask keyboard */
|
||||
|
||||
// HACK: Make STOP key work
|
||||
if (IS_PC98_ARCH && DOS_BreakFlag) {
|
||||
reg_ax=0;
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
if ((get_key(temp)) && (!IsEnhancedKey(temp))) {
|
||||
/* normal key found, return translated key in ax */
|
||||
reg_ax=temp;
|
||||
@@ -1424,6 +1432,12 @@ Bitu INT16_Handler(void) {
|
||||
if (int16_unmask_irq1_on_read)
|
||||
PIC_SetIRQMask(1,false); /* unmask keyboard */
|
||||
|
||||
// HACK: Make STOP key work
|
||||
if (IS_PC98_ARCH && DOS_BreakFlag) {
|
||||
reg_ax=0;
|
||||
return CBRET_NONE;
|
||||
}
|
||||
|
||||
if (get_key(temp)) {
|
||||
if (!IS_PC98_ARCH && ((temp&0xff)==0xf0) && (temp>>8)) {
|
||||
/* special enhanced key, clear low part before returning key */
|
||||
|
Reference in New Issue
Block a user