Previous 199869 Revisions Next

r19984 Tuesday 1st January, 2013 at 10:45:03 UTC by Wilbert Pol
(MESS) g7400: Added support for enabling/disabling the service row. Hooked up the i8243. (nw)
[src/mess/drivers]odyssey2.c
[src/mess/includes]odyssey2.h
[src/mess/machine]odyssey2.c
[src/mess/video]odyssey2.c

trunk/src/mess/machine/odyssey2.c
r19983r19984
101101   m_p1 = 0xFF;
102102   m_p2 = 0xFF;
103103   switch_banks();
104
105   for ( int i = 0; i < 8; i++ )
106   {
107      m_g7400_ic674_decode[i] = 0;
108      m_g7400_ic678_decode[i] = 0;
109   }
104110}
105111
106112/****** External RAM ******************************/
r19983r19984
246252{
247253   m_p2 = data;
248254
255   if ( m_i8243 )
256   {
257      m_i8243->i8243_p2_w( space, 0, m_p2 & 0x0f );
258   }
259
249260   logerror("%.6f p2 written %.2x\n", machine().time().as_double(), data);
250261}
251262
trunk/src/mess/includes/odyssey2.h
r19983r19984
77#ifndef ODYSSEY2_H_
88#define ODYSSEY2_H_
99
10#include "machine/i8243.h"
11
12
1013#define P1_BANK_LO_BIT            (0x01)
1114#define P1_BANK_HI_BIT            (0x02)
1215#define P1_KEYBOARD_SCAN_ENABLE   (0x04)  /* active low */
r19983r19984
7780      : driver_device(mconfig, type, tag)
7881      , m_maincpu(*this, "maincpu")
7982      , m_screen(*this, "screen")
83      , m_i8243(*this, "i8243")
8084      , m_g7400(false)
8185      { }
8286
8387   required_device<cpu_device> m_maincpu;
8488   required_device<screen_device> m_screen;
89   optional_device<i8243_device> m_i8243;
8590
8691   int m_the_voice_lrq_state;
8792   UINT8 *m_ram;
r19983r19984
124129   virtual void palette_init();
125130   UINT32 screen_update_odyssey2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
126131   DECLARE_WRITE_LINE_MEMBER(the_voice_lrq_callback);
132   DECLARE_WRITE8_MEMBER(i8243_port_w);
127133
128134   void ef9341_w( UINT8 command, UINT8 b, UINT8 data );
129135   UINT8 ef9341_r( UINT8 command, UINT8 b );
r19983r19984
135141   UINT8   m_ef934x_ram_b[1024];
136142   UINT8   m_ef934x_ext_char_ram[1024];
137143   bool   m_g7400;
144   UINT8   m_g7400_ic674_decode[8];
145   UINT8   m_g7400_ic678_decode[8];
138146
139147   inline UINT16 ef9340_get_c_addr(UINT8 x, UINT8 y);
140148   inline void ef9340_inc_c();
trunk/src/mess/video/odyssey2.c
r19983r19984
720720}
721721
722722/*
723    i8243 in the g7400
724*/
725
726WRITE8_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/*
723763    Thomson EF9340/EF9341 extra chips in the g7400
724764 */
725765
r19983r19984
910950
911951      if ( y < 10 )
912952      {
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         }
916972      }
917973      else
918974      {
r19983r19984
920976         y_row = (y - 10) / 10;
921977         slice = (y - 10) % 10;
922978      }
979
923980      for ( int x = 0; x < 40; x++ )
924981      {
925982         UINT16 addr = ef9340_get_c_addr( x, y_row );
trunk/src/mess/drivers/odyssey2.c
r19983r19984
4747   AM_RANGE(MCS48_PORT_BUS,  MCS48_PORT_BUS)  AM_READWRITE(bus_read, bus_write)
4848   AM_RANGE(MCS48_PORT_T0,   MCS48_PORT_T0)   AM_READ(t0_read)
4949   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);
5151ADDRESS_MAP_END
5252
5353
r19983r19984
255255
256256   /* video hardware */
257257   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 )
259259   MCFG_SCREEN_UPDATE_DRIVER(odyssey2_state, screen_update_odyssey2)
260260
261261   MCFG_VIDEO_START_OVERRIDE(odyssey2_state,g7400)
r19983r19984
263263   MCFG_GFXDECODE( odyssey2 )
264264   MCFG_PALETTE_LENGTH(32)
265265
266   MCFG_I8243_ADD( "i8243", NOOP, WRITE8(odyssey2_state,i8243_port_w))
267
266268   /* sound hardware */
267269   MCFG_SPEAKER_STANDARD_MONO("mono")
268270   MCFG_SOUND_ADD("custom", ODYSSEY2, 3547000)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team