src/memory.c

changeset 151
b63a3999e2e7
parent 150
c19afa2c81db
     1.1 --- a/src/memory.c	Fri Apr 18 01:26:01 2014 -0600
     1.2 +++ b/src/memory.c	Fri Apr 18 01:34:20 2014 -0600
     1.3 @@ -377,6 +377,13 @@
     1.4  			case 0x070000:				// Line Printer Status Register
     1.5  				break;
     1.6  			case 0x080000:				// Real Time Clock
     1.7 +				ENFORCE_SIZE_W(bits, address, 16, "RTCWRITE");
     1.8 +				/*printf("IoWrite RTCWRITE %x\n", data);*/
     1.9 +				tc8250_set_chip_enable(&state.rtc_ctx, data & 0x8000);
    1.10 +				tc8250_set_address_latch_enable(&state.rtc_ctx, data & 0x4000);
    1.11 +				tc8250_set_write_enable(&state.rtc_ctx, data & 0x2000);
    1.12 +				tc8250_write_reg(&state.rtc_ctx, (data & 0x0F00) >> 8);
    1.13 +				handled = true;
    1.14  				break;
    1.15  			case 0x090000:				// Phone registers
    1.16  				switch (address & 0x0FF000) {
    1.17 @@ -693,7 +700,7 @@
    1.18  					case 0x020000:		// [ef][2a]xxxx ==> Miscellaneous Control Register 2
    1.19  						break;
    1.20  					case 0x030000:		// [ef][3b]xxxx ==> Real Time Clock data bits
    1.21 -						break;
    1.22 +						return (tc8250_read_reg(&state.rtc_ctx));
    1.23  					case 0x040000:		// [ef][4c]xxxx ==> General Control Register
    1.24  						switch (address & 0x077000) {
    1.25  							case 0x040000:		// [ef][4c][08]xxx ==> EE