trunk/src/emu/cpu/tms0980/tms0980.c
| r18159 | r18160 | |
| 269 | 269 | const tms0980_config *config; |
| 270 | 270 | address_space *program; |
| 271 | 271 | address_space *data; |
| 272 | |
| 273 | devcb_resolved_read8 m_read_k; |
| 274 | devcb_resolved_write16 m_write_o; |
| 275 | devcb_resolved_write16 m_write_r; |
| 272 | 276 | }; |
| 273 | 277 | |
| 274 | 278 | |
| r18159 | r18160 | |
| 505 | 509 | |
| 506 | 510 | cpustate->program = &device->space( AS_PROGRAM ); |
| 507 | 511 | cpustate->data = &device->space( AS_PROGRAM ); |
| 512 | |
| 513 | cpustate->m_read_k.resolve(cpustate->config->read_k, *device); |
| 514 | cpustate->m_write_o.resolve(cpustate->config->write_o, *device); |
| 515 | cpustate->m_write_r.resolve(cpustate->config->write_r, *device); |
| 508 | 516 | |
| 517 | |
| 509 | 518 | device->save_item( NAME(cpustate->prev_pc) ); |
| 510 | 519 | device->save_item( NAME(cpustate->prev_pa) ); |
| 511 | 520 | device->save_item( NAME(cpustate->pc) ); |
| r18159 | r18160 | |
| 764 | 773 | switch( cpustate->opcode & 0x1F8 ) |
| 765 | 774 | { |
| 766 | 775 | case 0x008: |
| 767 | | if ( cpustate->config->read_k ) |
| 776 | if ( !cpustate->m_read_k.isnull() ) |
| 768 | 777 | { |
| 769 | | cpustate->cki_bus = cpustate->config->read_k( device, *cpustate->program, 0, 0xff ); |
| 778 | cpustate->cki_bus = cpustate->m_read_k( 0, 0xff ); |
| 770 | 779 | } |
| 771 | 780 | else |
| 772 | 781 | { |
| r18159 | r18160 | |
| 928 | 937 | if ( cpustate->decode & F_SETR ) |
| 929 | 938 | { |
| 930 | 939 | cpustate->r = cpustate->r | ( 1 << cpustate->y ); |
| 931 | | if ( cpustate->config->write_r ) |
| 940 | if ( !cpustate->m_write_r.isnull() ) |
| 932 | 941 | { |
| 933 | | cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff ); |
| 942 | cpustate->m_write_r( 0, cpustate->r & cpustate->r_mask, 0xffff ); |
| 934 | 943 | } |
| 935 | 944 | } |
| 936 | 945 | if ( cpustate->decode & F_RSTR ) |
| 937 | 946 | { |
| 938 | 947 | cpustate->r = cpustate->r & ( ~( 1 << cpustate->y ) ); |
| 939 | | if ( cpustate->config->write_r ) |
| 948 | if ( !cpustate->m_write_r.isnull() ) |
| 940 | 949 | { |
| 941 | | cpustate->config->write_r( device, *cpustate->program, 0, cpustate->r & cpustate->r_mask, 0xffff ); |
| 950 | cpustate->m_write_r( 0, cpustate->r & cpustate->r_mask, 0xffff ); |
| 942 | 951 | } |
| 943 | 952 | } |
| 944 | 953 | if ( cpustate->decode & F_TDO ) |
| r18159 | r18160 | |
| 955 | 964 | } |
| 956 | 965 | } |
| 957 | 966 | |
| 958 | | if ( cpustate->config->write_o ) |
| 967 | if ( !cpustate->m_write_o.isnull() ) |
| 959 | 968 | { |
| 960 | | cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff ); |
| 969 | cpustate->m_write_o( 0, cpustate->o & cpustate->o_mask, 0xffff ); |
| 961 | 970 | } |
| 962 | 971 | } |
| 963 | 972 | if ( cpustate->decode & F_CLO ) |
| 964 | 973 | { |
| 965 | 974 | cpustate->o = 0; |
| 966 | | if ( cpustate->config->write_o ) |
| 975 | if ( !cpustate->m_write_o.isnull() ) |
| 967 | 976 | { |
| 968 | | cpustate->config->write_o( device, *cpustate->program, 0, cpustate->o & cpustate->o_mask, 0xffff ); |
| 977 | cpustate->m_write_o( 0, cpustate->o & cpustate->o_mask, 0xffff ); |
| 969 | 978 | } |
| 970 | 979 | } |
| 971 | 980 | if ( cpustate->decode & F_LDX ) |
trunk/src/mess/drivers/stopthie.c
| r18159 | r18160 | |
| 11 | 11 | stopthie_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | 12 | : driver_device(mconfig, type, tag) { } |
| 13 | 13 | |
| 14 | DECLARE_READ8_MEMBER(stopthie_read_k); |
| 15 | DECLARE_WRITE16_MEMBER(stopthie_write_o); |
| 16 | DECLARE_WRITE16_MEMBER(stopthie_write_r); |
| 14 | 17 | }; |
| 15 | 18 | |
| 16 | 19 | |
| r18159 | r18160 | |
| 21 | 24 | INPUT_PORTS_END |
| 22 | 25 | |
| 23 | 26 | |
| 24 | | static READ8_DEVICE_HANDLER( stopthie_read_k ) |
| 27 | READ8_MEMBER(stopthie_state::stopthie_read_k) |
| 25 | 28 | { |
| 26 | 29 | UINT8 data = 0xFF; |
| 27 | 30 | |
| r18159 | r18160 | |
| 32 | 35 | } |
| 33 | 36 | |
| 34 | 37 | |
| 35 | | static WRITE16_DEVICE_HANDLER( stopthie_write_o ) |
| 38 | WRITE16_MEMBER(stopthie_state::stopthie_write_o) |
| 36 | 39 | { |
| 37 | 40 | if (LOG) |
| 38 | 41 | logerror( "stopthie_write_o: write %02x\n", data ); |
| 39 | 42 | } |
| 40 | 43 | |
| 41 | 44 | |
| 42 | | static WRITE16_DEVICE_HANDLER( stopthie_write_r ) |
| 45 | WRITE16_MEMBER(stopthie_state::stopthie_write_r) |
| 43 | 46 | { |
| 44 | 47 | if (LOG) |
| 45 | 48 | logerror( "stopthie_write_r: write %04x\n", data ); |
| r18159 | r18160 | |
| 56 | 59 | { 0x0d, 0x0d }, { 0x0e, 0x0e }, { 0x0f, 0x0f }, { 0x10, 0x10 }, |
| 57 | 60 | { 0x11, 0x11 }, { 0x12, 0x12 }, { 0x13, 0x13 }, { 0x14, 0x14 } |
| 58 | 61 | }, |
| 59 | | stopthie_read_k, |
| 60 | | stopthie_write_o, |
| 61 | | stopthie_write_r |
| 62 | DEVCB_DRIVER_MEMBER(stopthie_state, stopthie_read_k), |
| 63 | DEVCB_DRIVER_MEMBER16(stopthie_state, stopthie_write_o), |
| 64 | DEVCB_DRIVER_MEMBER16(stopthie_state, stopthie_write_r) |
| 62 | 65 | }; |
| 63 | 66 | |
| 64 | 67 | |