trunk/src/mess/includes/odyssey2.h
| r19983 | r19984 | |
| 7 | 7 | #ifndef ODYSSEY2_H_ |
| 8 | 8 | #define ODYSSEY2_H_ |
| 9 | 9 | |
| 10 | #include "machine/i8243.h" |
| 11 | |
| 12 | |
| 10 | 13 | #define P1_BANK_LO_BIT (0x01) |
| 11 | 14 | #define P1_BANK_HI_BIT (0x02) |
| 12 | 15 | #define P1_KEYBOARD_SCAN_ENABLE (0x04) /* active low */ |
| r19983 | r19984 | |
| 77 | 80 | : driver_device(mconfig, type, tag) |
| 78 | 81 | , m_maincpu(*this, "maincpu") |
| 79 | 82 | , m_screen(*this, "screen") |
| 83 | , m_i8243(*this, "i8243") |
| 80 | 84 | , m_g7400(false) |
| 81 | 85 | { } |
| 82 | 86 | |
| 83 | 87 | required_device<cpu_device> m_maincpu; |
| 84 | 88 | required_device<screen_device> m_screen; |
| 89 | optional_device<i8243_device> m_i8243; |
| 85 | 90 | |
| 86 | 91 | int m_the_voice_lrq_state; |
| 87 | 92 | UINT8 *m_ram; |
| r19983 | r19984 | |
| 124 | 129 | virtual void palette_init(); |
| 125 | 130 | UINT32 screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 126 | 131 | DECLARE_WRITE_LINE_MEMBER(the_voice_lrq_callback); |
| 132 | DECLARE_WRITE8_MEMBER(i8243_port_w); |
| 127 | 133 | |
| 128 | 134 | void ef9341_w( UINT8 command, UINT8 b, UINT8 data ); |
| 129 | 135 | UINT8 ef9341_r( UINT8 command, UINT8 b ); |
| r19983 | r19984 | |
| 135 | 141 | UINT8 m_ef934x_ram_b[1024]; |
| 136 | 142 | UINT8 m_ef934x_ext_char_ram[1024]; |
| 137 | 143 | bool m_g7400; |
| 144 | UINT8 m_g7400_ic674_decode[8]; |
| 145 | UINT8 m_g7400_ic678_decode[8]; |
| 138 | 146 | |
| 139 | 147 | inline UINT16 ef9340_get_c_addr(UINT8 x, UINT8 y); |
| 140 | 148 | inline void ef9340_inc_c(); |
trunk/src/mess/video/odyssey2.c
| r19983 | r19984 | |
| 720 | 720 | } |
| 721 | 721 | |
| 722 | 722 | /* |
| 723 | i8243 in the g7400 |
| 724 | */ |
| 725 | |
| 726 | WRITE8_MEMBER(odyssey2_state::i8243_port_w) |
| 727 | { |
| 728 | switch ( offset & 3 ) |
| 729 | { |
| 730 | case 0: // "port 4" |
| 731 | m_g7400_ic674_decode[4] = BIT(data,0); |
| 732 | m_g7400_ic674_decode[5] = BIT(data,1); |
| 733 | m_g7400_ic674_decode[6] = BIT(data,2); |
| 734 | m_g7400_ic674_decode[7] = BIT(data,3); |
| 735 | break; |
| 736 | |
| 737 | case 1: // "port 5" |
| 738 | m_g7400_ic674_decode[0] = BIT(data,0); |
| 739 | m_g7400_ic674_decode[1] = BIT(data,1); |
| 740 | m_g7400_ic674_decode[2] = BIT(data,2); |
| 741 | m_g7400_ic674_decode[3] = BIT(data,3); |
| 742 | break; |
| 743 | |
| 744 | case 2: // "port 6" |
| 745 | m_g7400_ic678_decode[4] = BIT(data,0); |
| 746 | m_g7400_ic678_decode[5] = BIT(data,1); |
| 747 | m_g7400_ic678_decode[6] = BIT(data,2); |
| 748 | m_g7400_ic678_decode[7] = BIT(data,3); |
| 749 | break; |
| 750 | |
| 751 | case 3: // "port 7" |
| 752 | m_g7400_ic678_decode[0] = BIT(data,0); |
| 753 | m_g7400_ic678_decode[1] = BIT(data,1); |
| 754 | m_g7400_ic678_decode[2] = BIT(data,2); |
| 755 | m_g7400_ic678_decode[3] = BIT(data,3); |
| 756 | break; |
| 757 | |
| 758 | } |
| 759 | } |
| 760 | |
| 761 | |
| 762 | /* |
| 723 | 763 | Thomson EF9340/EF9341 extra chips in the g7400 |
| 724 | 764 | */ |
| 725 | 765 | |
| r19983 | r19984 | |
| 910 | 950 | |
| 911 | 951 | if ( y < 10 ) |
| 912 | 952 | { |
| 913 | | // Displaying service row |
| 914 | | y_row = 31; |
| 915 | | slice = y; |
| 953 | // Service row |
| 954 | |
| 955 | if ( m_ef9340.R & 0x08 ) |
| 956 | { |
| 957 | // Service row is enabled |
| 958 | |
| 959 | y_row = 31; |
| 960 | slice = y; |
| 961 | } |
| 962 | else |
| 963 | { |
| 964 | // Service row is disabled |
| 965 | |
| 966 | for ( int i = 0; i < 40 * 8; i++ ) |
| 967 | { |
| 968 | m_tmp_bitmap.pix16(vpos, I824X_START_ACTIVE_SCAN*2 + i ) = 24; |
| 969 | } |
| 970 | return; |
| 971 | } |
| 916 | 972 | } |
| 917 | 973 | else |
| 918 | 974 | { |
| r19983 | r19984 | |
| 920 | 976 | y_row = (y - 10) / 10; |
| 921 | 977 | slice = (y - 10) % 10; |
| 922 | 978 | } |
| 979 | |
| 923 | 980 | for ( int x = 0; x < 40; x++ ) |
| 924 | 981 | { |
| 925 | 982 | UINT16 addr = ef9340_get_c_addr( x, y_row ); |
trunk/src/mess/drivers/odyssey2.c
| r19983 | r19984 | |
| 47 | 47 | AM_RANGE(MCS48_PORT_BUS, MCS48_PORT_BUS) AM_READWRITE(bus_read, bus_write) |
| 48 | 48 | AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_read) |
| 49 | 49 | AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(t1_read) |
| 50 | | //AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) //write to 8243 with low four bits from P2 |
| 50 | AM_RANGE(MCS48_PORT_PROG, MCS48_PORT_PROG) AM_DEVWRITE("i8243", i8243_device, i8243_prog_w); |
| 51 | 51 | ADDRESS_MAP_END |
| 52 | 52 | |
| 53 | 53 | |
| r19983 | r19984 | |
| 255 | 255 | |
| 256 | 256 | /* video hardware */ |
| 257 | 257 | MCFG_SCREEN_ADD("screen", RASTER) |
| 258 | | MCFG_SCREEN_RAW_PARAMS( 3547000*2, 2*I824X_LINE_CLOCKS, 2*I824X_START_ACTIVE_SCAN, 2*I824X_END_ACTIVE_SCAN, 312, I824X_START_Y, I824X_START_Y + I824X_SCREEN_HEIGHT ) |
| 258 | MCFG_SCREEN_RAW_PARAMS( 3547000*2, 2*I824X_LINE_CLOCKS, 2*I824X_START_ACTIVE_SCAN, 2*I824X_END_ACTIVE_SCAN, 312, I824X_START_Y, I824X_START_Y + I824X_SCREEN_HEIGHT + 10 ) |
| 259 | 259 | MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2) |
| 260 | 260 | |
| 261 | 261 | MCFG_VIDEO_START_OVERRIDE(odyssey2_state,g7400) |
| r19983 | r19984 | |
| 263 | 263 | MCFG_GFXDECODE( odyssey2 ) |
| 264 | 264 | MCFG_PALETTE_LENGTH(32) |
| 265 | 265 | |
| 266 | MCFG_I8243_ADD( "i8243", NOOP, WRITE8(odyssey2_state,i8243_port_w)) |
| 267 | |
| 266 | 268 | /* sound hardware */ |
| 267 | 269 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 268 | 270 | MCFG_SOUND_ADD("custom", ODYSSEY2, 3547000) |