diff --git a/src/devices/video/ef9340_1.cpp b/src/devices/video/ef9340_1.cpp index 12439dd12e7..01cb926f1f3 100644 --- a/src/devices/video/ef9340_1.cpp +++ b/src/devices/video/ef9340_1.cpp @@ -2,8 +2,16 @@ // copyright-holders:Wilbert Pol /*************************************************************************** - Thomson EF9340 + EF9341 teletext graphics chips with 1KB external - character ram. +Thomson EF9340 + EF9341 teletext graphics chips with 1KB external character ram. + +TODO: +- busy state (right now it is immediate) +- read slice +- character blinking mode +- character underline mode +- character width/height doubling +- window boxing/conceal +- Y zoom ***************************************************************************/ @@ -52,7 +60,7 @@ void ef9340_1_device::device_start() // zerofill m_ef9341.TA = 0; m_ef9341.TB = 0; - m_ef9341.busy = 0; + m_ef9341.busy = false; m_ef9340.X = 0; m_ef9340.Y = 0; @@ -102,7 +110,7 @@ uint16_t ef9340_1_device::ef9340_get_c_addr(uint8_t x, uint8_t y) { return 0x300 | ( ( y & 0x07 ) << 5 ) | ( y & 0x18 ) | ( x & 0x07 ); } - return y << 5 | x; + return ( y & 0x1f ) << 5 | ( x & 0x1f ); } @@ -144,7 +152,7 @@ void ef9340_1_device::ef9341_write( uint8_t command, uint8_t b, uint8_t data ) if ( b ) { m_ef9341.TB = data; - m_ef9341.busy = 0x80; + m_ef9341.busy = true; switch( m_ef9341.TB & 0xE0 ) { case 0x00: /* Begin row */ @@ -169,8 +177,10 @@ void ef9340_1_device::ef9341_write( uint8_t command, uint8_t b, uint8_t data ) case 0xC0: /* Load Y0 */ m_ef9340.Y0 = m_ef9341.TA & 0x3F; break; + case 0xE0: /* Not interpreted */ + break; } - m_ef9341.busy = 0; + m_ef9341.busy = false; } else { @@ -184,7 +194,7 @@ void ef9340_1_device::ef9341_write( uint8_t command, uint8_t b, uint8_t data ) uint16_t addr = ef9340_get_c_addr( m_ef9340.X, m_ef9340.Y ) & 0x3ff; m_ef9341.TB = data; - m_ef9341.busy = 0x80; + m_ef9341.busy = true; switch ( m_ef9340.M & 0xE0 ) { case 0x00: /* Write */ @@ -231,7 +241,7 @@ void ef9340_1_device::ef9341_write( uint8_t command, uint8_t b, uint8_t data ) default: /* Illegal */ break; } - m_ef9341.busy = 0; + m_ef9341.busy = false; } else { @@ -255,7 +265,7 @@ uint8_t ef9340_1_device::ef9341_read( uint8_t command, uint8_t b ) } else { - data = m_ef9341.busy; + data = (m_ef9341.busy) ? 0x80 : 0; } } else @@ -283,11 +293,12 @@ void ef9340_1_device::ef9340_scanline(int vpos) for ( int i = 0; i < 40 * 8; i++ ) m_tmp_bitmap.pix16(vpos, i) = 0; + // display automaton active at 40-290, or 32-242 int max_vpos = ( m_ef9340.R & 0x40 ) ? 250 : 210; if ( m_ef9340.R & 0x01 && vpos < max_vpos ) { - int y = vpos - 0; + int y = vpos; int y_row, slice; uint8_t fg = 0; uint8_t bg = 0; @@ -310,7 +321,7 @@ void ef9340_1_device::ef9340_scanline(int vpos) else { // Displaying regular row - y_row = (y - 10) / 10; + y_row = ((m_ef9340.Y0 & 0x1f) + (y - 10) / 10) % 24; slice = (y - 10) % 10; } diff --git a/src/devices/video/ef9340_1.h b/src/devices/video/ef9340_1.h index 56ce0459b1c..f2d9d906731 100644 --- a/src/devices/video/ef9340_1.h +++ b/src/devices/video/ef9340_1.h @@ -59,7 +59,7 @@ protected: { uint8_t TA; uint8_t TB; - uint8_t busy; + bool busy; } m_ef9341; struct @@ -71,9 +71,9 @@ protected: uint8_t M; } m_ef9340; - uint8_t m_ef934x_ram_a[1024]; - uint8_t m_ef934x_ram_b[1024]; - uint8_t m_ef934x_ext_char_ram[2048]; /* The G7400 has 2KB of external ram hooked up. The datasheet only describes how to hookup 1KB. */ + uint8_t m_ef934x_ram_a[0x400]; // A10 to GND + uint8_t m_ef934x_ram_b[0x400]; // A10 to GND + uint8_t m_ef934x_ext_char_ram[0x800]; // The G7400 has 2KB of external ram hooked up. The datasheet only describes how to hookup 1KB. }; diff --git a/src/mame/drivers/odyssey2.cpp b/src/mame/drivers/odyssey2.cpp index f85628647f5..f638f336871 100644 --- a/src/mame/drivers/odyssey2.cpp +++ b/src/mame/drivers/odyssey2.cpp @@ -22,7 +22,7 @@ Odyssey 2/Videopac hardware notes: Videopac+ G7400 hardware notes: - same base hardware - Intel 8243 I/O expander -- EF9340 + EF9341 graphics chips +- EF9340 + EF9341 graphics chips + 6KB VRAM(3*2128, only 4KB used) - larger keyboard XTAL notes (differs per model): @@ -46,7 +46,10 @@ TODO: - ppp(the tetris game) does not work properly on PAL, is this homebrew NTSC-only, or is it due to PAL video timing? The game does mid-scanline updates - add 824x vs ef934x collision detection, none of the games use it -- g7400 rally doesn't work, car keeps exploding +- g7400 rally doesn't work, car keeps exploding, it is related to ef9341_read: + If you invert the returned RAM value, the USA map looks better. If you always + return 0, the game can be played but the car is invincible +- g7400 flashp doesn't work, also related to ef9341_read? - g7400 probably has different video timing too (not same as g7000) - g7400 graphics problems, mostly due to missing features in ef934x