src/mess/drivers/pc4.c
| r10844 | r10845 | |
| 26 | 26 | #include "emu.h" |
| 27 | 27 | #include "cpu/z80/z80.h" |
| 28 | 28 | #include "includes/pc4.h" |
| 29 | #include "machine/tc8521.h" |
| 29 | 30 | #include "sound/beep.h" |
| 30 | 31 | #include "rendlay.h" |
| 31 | 32 | |
| r10844 | r10845 | |
| 42 | 43 | return data; |
| 43 | 44 | } |
| 44 | 45 | |
| 45 | | |
| 46 | | READ8_MEMBER( pc4_state::clock_r ) |
| 47 | | { |
| 48 | | system_time systime; |
| 49 | | |
| 50 | | //get the current date and time from the core |
| 51 | | machine->current_datetime(systime); |
| 52 | | |
| 53 | | switch(offset) |
| 54 | | { |
| 55 | | case 0x00: |
| 56 | | return systime.local_time.second%10; |
| 57 | | case 0x01: |
| 58 | | return systime.local_time.second/10; |
| 59 | | case 0x02: |
| 60 | | return systime.local_time.minute%10; |
| 61 | | case 0x03: |
| 62 | | return systime.local_time.minute/10; |
| 63 | | case 0x04: |
| 64 | | return systime.local_time.hour%10; |
| 65 | | case 0x05: |
| 66 | | return systime.local_time.hour/10; |
| 67 | | case 0x06: |
| 68 | | return systime.local_time.weekday; |
| 69 | | case 0x07: |
| 70 | | return systime.local_time.mday%10; |
| 71 | | case 0x08: |
| 72 | | return systime.local_time.mday/10; |
| 73 | | case 0x09: |
| 74 | | return (systime.local_time.month+1)%10; |
| 75 | | case 0x0a: |
| 76 | | return systime.local_time.month/10; |
| 77 | | case 0x0b: |
| 78 | | return systime.local_time.year%10; |
| 79 | | case 0x0c: |
| 80 | | return (systime.local_time.year%100)/10; |
| 81 | | case 0x0d: |
| 82 | | case 0x0e: |
| 83 | | case 0x0f: |
| 84 | | default: |
| 85 | | return 0; |
| 86 | | } |
| 87 | | } |
| 88 | | |
| 89 | | WRITE8_MEMBER( pc4_state::clock_w ) |
| 90 | | { |
| 91 | | //TODO |
| 92 | | } |
| 93 | | |
| 94 | 46 | WRITE8_MEMBER( pc4_state::bank_w ) |
| 95 | 47 | { |
| 96 | 48 | //printf("set bank %x\n", data); |
| r10844 | r10845 | |
| 110 | 62 | |
| 111 | 63 | static ADDRESS_MAP_START(pc4_io, ADDRESS_SPACE_IO, 8, pc4_state) |
| 112 | 64 | ADDRESS_MAP_UNMAP_HIGH |
| 113 | | AM_RANGE(0x0000, 0x000f) AM_READWRITE(clock_r, clock_w) |
| 65 | AM_RANGE(0x0000, 0x000f) AM_DEVREADWRITE_LEGACY("rtc", tc8521_r, tc8521_w) |
| 114 | 66 | AM_RANGE(0x1000, 0x1000) AM_WRITE(beep_w) |
| 115 | 67 | AM_RANGE(0x1fff, 0x1fff) AM_WRITE(bank_w) |
| 116 | 68 | |
| r10844 | r10845 | |
| 251 | 203 | m_blink = 0; |
| 252 | 204 | } |
| 253 | 205 | |
| 206 | static const tc8521_interface pc4_tc8521_interface = |
| 207 | { |
| 208 | NULL |
| 209 | }; |
| 210 | |
| 254 | 211 | static MACHINE_CONFIG_START( pc4, pc4_state ) |
| 255 | 212 | /* basic machine hardware */ |
| 256 | 213 | MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz) |
| r10844 | r10845 | |
| 272 | 229 | MCFG_SPEAKER_STANDARD_MONO( "mono" ) |
| 273 | 230 | MCFG_SOUND_ADD( "beep", BEEP, 0 ) |
| 274 | 231 | MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 ) |
| 232 | |
| 233 | MCFG_TC8521_ADD("rtc", pc4_tc8521_interface) |
| 275 | 234 | MACHINE_CONFIG_END |
| 276 | 235 | |
| 277 | 236 | ROM_START( pc4 ) |