Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 1 | /* |
| 2 | * BIOS interrupt 15h handler |
| 3 | */ |
| 4 | |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 5 | #include <stdlib.h> |
| 6 | #include "miscemu.h" |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 7 | #include "debugtools.h" |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 8 | |
Dimitrie O. Paun | 529da54 | 2000-11-27 23:54:25 +0000 | [diff] [blame] | 9 | DEFAULT_DEBUG_CHANNEL(int); |
Patrik Stridvall | b4b9fae | 1999-04-19 14:56:29 +0000 | [diff] [blame] | 10 | |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 11 | |
| 12 | /********************************************************************** |
Patrik Stridvall | 3ca9823 | 2001-06-20 23:03:14 +0000 | [diff] [blame] | 13 | * INT_Int15Handler (WPROCS.121) |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 14 | * |
Chris Morgan | c0b2b9e | 2000-08-20 18:47:48 +0000 | [diff] [blame] | 15 | * Handler for int 15h |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 16 | */ |
Alexandre Julliard | 617955d | 1999-06-26 18:40:24 +0000 | [diff] [blame] | 17 | void WINAPI INT_Int15Handler( CONTEXT86 *context ) |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 18 | { |
| 19 | switch(AH_reg(context)) |
| 20 | { |
Chris Morgan | c0b2b9e | 2000-08-20 18:47:48 +0000 | [diff] [blame] | 21 | case 0x84: /* read joystick information */ |
| 22 | FIXME("Read joystick information not implemented\n"); |
| 23 | |
| 24 | /* FIXME: report status as if no game port exists */ |
| 25 | switch(DX_reg(context)) |
| 26 | { |
| 27 | case 0x0: /* read joystick switches */ |
| 28 | AL_reg(context) = 0x0; /* all switches open */ |
| 29 | break; |
| 30 | case 0x1: /* read joystick position */ |
| 31 | AX_reg(context) = 0x0; |
| 32 | BX_reg(context) = 0x0; |
| 33 | CX_reg(context) = 0x0; |
| 34 | DX_reg(context) = 0x0; |
| 35 | break; |
| 36 | default: |
| 37 | INT_BARF( context, 0x15 ); |
| 38 | break; |
| 39 | } |
| 40 | |
| 41 | RESET_CFLAG(context); |
| 42 | |
| 43 | break; |
| 44 | |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 45 | case 0x88: /* get size of memory above 1 M */ |
| 46 | AX_reg(context) = 64; /* FIXME: are 64K ok? */ |
| 47 | RESET_CFLAG(context); |
| 48 | break; |
| 49 | |
Andreas Mohr | a7894d9 | 1999-01-24 09:32:10 +0000 | [diff] [blame] | 50 | case 0xc0: /* GET CONFIGURATION */ |
| 51 | if (ISV86(context)) /* real */ |
Alexandre Julliard | d8fab2e | 2000-09-25 23:53:07 +0000 | [diff] [blame] | 52 | context->SegEs = 0xf000; |
Andreas Mohr | a7894d9 | 1999-01-24 09:32:10 +0000 | [diff] [blame] | 53 | else |
Alexandre Julliard | d8fab2e | 2000-09-25 23:53:07 +0000 | [diff] [blame] | 54 | context->SegEs = DOSMEM_BiosSysSeg; |
Andreas Mohr | a7894d9 | 1999-01-24 09:32:10 +0000 | [diff] [blame] | 55 | BX_reg(context) = 0xe6f5; |
| 56 | AH_reg(context) = 0x0; |
| 57 | RESET_CFLAG(context); |
| 58 | break; |
Jess Haas | d11443e | 1999-03-17 15:15:14 +0000 | [diff] [blame] | 59 | case 0xc2: |
| 60 | switch(AL_reg(context)) |
| 61 | { |
| 62 | case 0x00: /* Enable-Disable Pointing Device (mouse) */ |
| 63 | /* BH = newstate, 00h = disabled 01h = enabled */ |
| 64 | switch(BH_reg(context)) |
| 65 | { |
| 66 | case 0x00: |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 67 | FIXME("Disable Pointing Device - not implemented\n"); |
Jess Haas | d11443e | 1999-03-17 15:15:14 +0000 | [diff] [blame] | 68 | break; |
| 69 | case 0x01: |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 70 | FIXME("Enable Pointing Device - not implemented\n"); |
Jess Haas | d11443e | 1999-03-17 15:15:14 +0000 | [diff] [blame] | 71 | break; |
| 72 | default: |
| 73 | INT_BARF( context, 0x15 ); |
| 74 | break; |
| 75 | } |
| 76 | AH_reg(context) = 0x00; /* successful */ |
| 77 | break; |
| 78 | case 0x02: /* Set Sampling Rate */ |
| 79 | /* BH = sampling rate */ |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 80 | FIXME("Set Sampling Rate - not implemented\n"); |
Jess Haas | d11443e | 1999-03-17 15:15:14 +0000 | [diff] [blame] | 81 | AH_reg(context) = 0x00; /* successful */ |
| 82 | break; |
| 83 | case 0x04: /* Get Pointing Device Type */ |
Alexandre Julliard | 61fece0 | 1999-06-26 19:09:08 +0000 | [diff] [blame] | 84 | FIXME("Get Pointing Device Type - not implemented\n"); |
Francois Gouget | 519346a | 2000-12-02 20:18:08 +0000 | [diff] [blame] | 85 | BH_reg(context) = 0x01;/*Device id FIXME what is it supposed to be?*/ |
Jess Haas | d11443e | 1999-03-17 15:15:14 +0000 | [diff] [blame] | 86 | break; |
| 87 | default: |
| 88 | INT_BARF( context, 0x15 ); |
| 89 | } |
| 90 | break; |
Andreas Mohr | a7894d9 | 1999-01-24 09:32:10 +0000 | [diff] [blame] | 91 | |
Alexandre Julliard | 17216f5 | 1997-10-12 16:30:17 +0000 | [diff] [blame] | 92 | default: |
| 93 | INT_BARF( context, 0x15 ); |
| 94 | } |
| 95 | } |