src/memory.c

changeset 84
0d903718da81
parent 79
674226015c8a
child 93
09e3ddeb869a
     1.1 --- a/src/memory.c	Wed Feb 09 15:43:48 2011 +0000
     1.2 +++ b/src/memory.c	Wed Feb 09 16:35:49 2011 +0000
     1.3 @@ -399,6 +399,11 @@
     1.4  						}
     1.5  						break;
     1.6  					case 0x070000:		// [ef][7f]xxxx ==> 6850 Keyboard Controller
     1.7 +						// TODO: figure out which sizes are valid (probably just 8 and 16)
     1.8 +						// ENFORCE_SIZE_W(bits, address, 16, "KEYBOARD CONTROLLER");
     1.9 +						printf("KBD WR %02X => %04X\n", (address >> 1) & 3, data >> 8);
    1.10 +						keyboard_write(&state.kbd, (address >> 1) & 3, data >> 8);
    1.11 +						handled = true;
    1.12  						break;
    1.13  				}
    1.14  		}
    1.15 @@ -544,6 +549,14 @@
    1.16  						}
    1.17  						break;
    1.18  					case 0x070000:		// [ef][7f]xxxx ==> 6850 Keyboard Controller
    1.19 +						// TODO: figure out which sizes are valid (probably just 8 and 16)
    1.20 +						//ENFORCE_SIZE_R(bits, address, 16, "KEYBOARD CONTROLLER");
    1.21 +						{
    1.22 +							uint16_t data = keyboard_read(&state.kbd, (address >> 1) & 3);
    1.23 +							data = (data << 8) + data;
    1.24 +							//printf("KBD RD %02X => %04X\n", (address >> 1) & 3, data);
    1.25 +							return data;
    1.26 +						}
    1.27  						break;
    1.28  				}
    1.29  		}