Previous 199869 Revisions Next

r32987 Sunday 26th October, 2014 at 18:36:13 UTC by Sergey Svishchev
ec184x: MDA clone
[src/emu/bus/isa]mda.c mda.h
[src/emu/video]upd7220.c
[src/mame/drivers]peplus.c
[src/mess/drivers]ec184x.c pc9801.c

trunk/src/emu/bus/isa/mda.c
r241498r241499
4444{
4545   MDA_TEXT_INTEN = 0,
4646   MDA_TEXT_BLINK,
47   HERCULES_GFX_BLINK
47   HERCULES_GFX_BLINK,
48   MDA_LOWRES_TEXT_INTEN,
49   MDA_LOWRES_TEXT_BLINK
4850};
4951
5052/* F4 Character Displayer */
r241498r241499
750752   }
751753   return data;
752754}
755
756// XXX
757MACHINE_CONFIG_FRAGMENT( pcvideo_ec1840_0002 )
758   MCFG_SCREEN_ADD( MDA_SCREEN_NAME, RASTER)
759   MCFG_SCREEN_RAW_PARAMS(MDA_CLOCK, 792, 0, 640, 370, 0, 350 )
760   MCFG_SCREEN_UPDATE_DEVICE( MDA_MC6845_NAME, mc6845_device, screen_update )
761
762   MCFG_PALETTE_ADD( "palette", 4 )
763
764   MCFG_MC6845_ADD( MDA_MC6845_NAME, MC6845, MDA_SCREEN_NAME, MDA_CLOCK/8)
765   MCFG_MC6845_SHOW_BORDER_AREA(false)
766   MCFG_MC6845_CHAR_WIDTH(8)
767   MCFG_MC6845_UPDATE_ROW_CB(isa8_mda_device, crtc_update_row)
768   MCFG_MC6845_OUT_HSYNC_CB(WRITELINE(isa8_mda_device, hsync_changed))
769   MCFG_MC6845_OUT_VSYNC_CB(WRITELINE(isa8_mda_device, vsync_changed))
770MACHINE_CONFIG_END
771
772const device_type ISA8_EC1840_0002 = &device_creator<isa8_ec1840_0002_device>;
773
774
775//-------------------------------------------------
776//  machine_config_additions - device-specific
777//  machine configurations
778//-------------------------------------------------
779
780machine_config_constructor isa8_ec1840_0002_device::device_mconfig_additions() const
781{
782   return MACHINE_CONFIG_NAME( pcvideo_ec1840_0002 );
783}
784
785//-------------------------------------------------
786//  isa8_ec1840_0002_device - constructor
787//-------------------------------------------------
788
789isa8_ec1840_0002_device::isa8_ec1840_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
790      isa8_mda_device( mconfig, ISA8_EC1840_0002, "EC 1840.0002 (MDA)", tag, owner, clock, "ec1840_0002", __FILE__)
791{
792}
793
794//-------------------------------------------------
795//  device_start - device-specific startup
796//-------------------------------------------------
797
798void isa8_ec1840_0002_device::device_start()
799{
800   isa8_mda_device::device_start();
801
802   m_soft_chr_gen = auto_alloc_array(machine(), UINT8, 0x2000);
803   m_isa->install_bank(0xdc000, 0xddfff, 0, 0x2000, "bank_chargen", m_soft_chr_gen);
804}
805
806void isa8_ec1840_0002_device::device_reset()
807{
808   isa8_mda_device::device_reset();
809
810   m_chr_gen = m_soft_chr_gen;
811}
812
813
814/***************************************************************************
815  Draw text mode with 80x25 characters (default) and intense background.
816  The character cell size is 8x14.
817***************************************************************************/
818
819MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_inten_update_row )
820{
821   const rgb_t *palette = m_palette->palette()->entry_list_raw();
822   UINT32  *p = &bitmap.pix32(y);
823   UINT16  chr_base = ra;
824   int i;
825
826   if ( y == 0 ) MDA_LOG(1,"mda_lowres_text_inten_update_row",("\n"));
827   for ( i = 0; i < x_count; i++ )
828   {
829      UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF;
830      UINT8 chr = m_videoram[ offset ];
831      UINT8 attr = m_videoram[ offset + 1 ];
832      UINT8 data = m_chr_gen[ (chr_base + chr * 16) << 1 ];
833      UINT8 fg = ( attr & 0x08 ) ? 3 : 2;
834      UINT8 bg = 0;
835
836      if ( ( attr & ~0x88 ) == 0 )
837      {
838         data = 0x00;
839      }
840
841      switch( attr )
842      {
843      case 0x70:
844         bg = 2;
845         fg = 0;
846         break;
847      case 0x78:
848         bg = 2;
849         fg = 1;
850         break;
851      case 0xF0:
852         bg = 3;
853         fg = 0;
854         break;
855      case 0xF8:
856         bg = 3;
857         fg = 1;
858         break;
859      }
860
861      if ( ( i == cursor_x && ( m_framecnt & 0x08 ) ) || ( attr & 0x07 ) == 0x01 )
862      {
863         data = 0xFF;
864      }
865
866      *p = palette[( data & 0x80 ) ? fg : bg]; p++;
867      *p = palette[( data & 0x40 ) ? fg : bg]; p++;
868      *p = palette[( data & 0x20 ) ? fg : bg]; p++;
869      *p = palette[( data & 0x10 ) ? fg : bg]; p++;
870      *p = palette[( data & 0x08 ) ? fg : bg]; p++;
871      *p = palette[( data & 0x04 ) ? fg : bg]; p++;
872      *p = palette[( data & 0x02 ) ? fg : bg]; p++;
873      *p = palette[( data & 0x01 ) ? fg : bg]; p++;
874   }
875}
876
877
878/***************************************************************************
879  Draw text mode with 80x25 characters (default) and blinking characters.
880  The character cell size is 8x14.
881***************************************************************************/
882
883MC6845_UPDATE_ROW( isa8_ec1840_0002_device::mda_lowres_text_blink_update_row )
884{
885   const rgb_t *palette = m_palette->palette()->entry_list_raw();
886   UINT32  *p = &bitmap.pix32(y);
887   UINT16  chr_base = ra;
888   int i;
889
890   if ( y == 0 ) MDA_LOG(1,"mda_lowres_text_blink_update_row",("\n"));
891   for ( i = 0; i < x_count; i++ )
892   {
893      UINT16 offset = ( ( ma + i ) << 1 ) & 0x0FFF;
894      UINT8 chr = m_videoram[ offset ];
895      UINT8 attr = m_videoram[ offset + 1 ];
896      UINT8 data = m_chr_gen[ (chr_base + chr * 16) << 1 ];
897      UINT8 fg = ( attr & 0x08 ) ? 3 : 2;
898      UINT8 bg = 0;
899
900      if ( ( attr & ~0x88 ) == 0 )
901      {
902         data = 0x00;
903      }
904
905      switch( attr )
906      {
907      case 0x70:
908      case 0xF0:
909         bg = 2;
910         fg = 0;
911         break;
912      case 0x78:
913      case 0xF8:
914         bg = 2;
915         fg = 1;
916         break;
917      }
918
919      if ( ( attr & 0x07 ) == 0x01 )
920      {
921         data = 0xFF;
922      }
923
924      if ( i == cursor_x )
925      {
926         if ( m_framecnt & 0x08 )
927         {
928            data = 0xFF;
929         }
930      }
931      else
932      {
933         if ( ( attr & 0x80 ) && ( m_framecnt & 0x10 ) )
934         {
935            data = 0x00;
936         }
937      }
938
939      *p = palette[( data & 0x80 ) ? fg : bg]; p++;
940      *p = palette[( data & 0x40 ) ? fg : bg]; p++;
941      *p = palette[( data & 0x20 ) ? fg : bg]; p++;
942      *p = palette[( data & 0x10 ) ? fg : bg]; p++;
943      *p = palette[( data & 0x08 ) ? fg : bg]; p++;
944      *p = palette[( data & 0x04 ) ? fg : bg]; p++;
945      *p = palette[( data & 0x02 ) ? fg : bg]; p++;
946      *p = palette[( data & 0x01 ) ? fg : bg]; p++;
947   }
948}
949
950WRITE8_MEMBER( isa8_ec1840_0002_device::mode_control_w )
951{
952   m_mode_control = data;
953
954   switch( m_mode_control & 0x2a )
955   {
956   case 0x08:
957      m_update_row_type = MDA_LOWRES_TEXT_INTEN;
958      break;
959   case 0x28:
960      m_update_row_type = MDA_LOWRES_TEXT_BLINK;
961      break;
962   default:
963      m_update_row_type = -1;
964   }
965}
966
967MC6845_UPDATE_ROW( isa8_ec1840_0002_device::crtc_update_row )
968{
969   if (m_update_row_type == -1)
970      return;
971   
972   switch (m_update_row_type)
973   {
974      case MDA_LOWRES_TEXT_INTEN:
975         mda_lowres_text_inten_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
976         break;
977      case MDA_LOWRES_TEXT_BLINK:
978         mda_lowres_text_blink_update_row(bitmap, cliprect, ma, ra, y, x_count, cursor_x, de, hbp, vbp);
979         break;
980   }
981}
trunk/src/emu/bus/isa/mda.h
r241498r241499
9797// device type definition
9898extern const device_type ISA8_HERCULES;
9999
100// ======================> isa8_ec1840_0002_device
101
102class isa8_ec1840_0002_device :
103      public isa8_mda_device
104{
105public:
106   // construction/destruction
107   isa8_ec1840_0002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
108   // optional information overrides
109   virtual machine_config_constructor device_mconfig_additions() const;
110
111   virtual DECLARE_WRITE8_MEMBER(mode_control_w);
112
113   virtual MC6845_UPDATE_ROW( crtc_update_row );
114   MC6845_UPDATE_ROW( mda_lowres_text_inten_update_row );
115   MC6845_UPDATE_ROW( mda_lowres_text_blink_update_row );
116
117protected:
118   // device-level overrides
119   virtual void device_start();
120   virtual void device_reset();
121
122public:
123   UINT8   *m_soft_chr_gen;
124
125};
126
127// device type definition
128extern const device_type ISA8_EC1840_0002;
129
100130#endif  /* __ISA_MDA_H__ */
trunk/src/emu/video/upd7220.c
r241498r241499
15921592            addr = ((sad << 1) & 0x3ffff) + (y * (m_pitch << (im ? 0 : 1)));
15931593
15941594            if (!m_display_cb.isnull())
1595               draw_graphics_line(bitmap, addr, y + (bsy / m_lr), wd);
1595               draw_graphics_line(bitmap, addr, y + (im ? bsy : (bsy >> 1)), wd);
15961596         }
15971597      }
15981598      else
trunk/src/mame/drivers/peplus.c
r241498r241499
141141  PPnnnn Poker games. Several different types of poker require specific CG graphics + CAP color prom
142142  IPnnnn International Poker games. Several different types of poker require specific CG graphics + CAP color prom
143143  PSnnnn Slot games. Each slot game requires specific CG graphics + CAP color prom
144  MGnnnn Multi Game programs for the Player's Choice machines that had optional touchscreens and or printers
145144
146145Super PE+
147146 Program Types
r241498r241499
89538952GAMEL(1987, peip0120,  peip0031, peplus,  peplus_poker, peplus_state, nonplus,  ROT0,  "IGT - International Game Technology", "Player's Edge Plus (IP0120) Standard Draw Poker - French",  0, layout_pe_poker )
89548953
89558954/* Normal board : Blackjack */
8956GAMEL(1994, pebe0014, 0,      peplus,  peplus_bjack, peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (BE0014) Blackjack",                        0, layout_pe_bjack )
8955GAMEL(1994, pebe0014, 0,      peplus,  peplus_bjack, peplus_state, peplus,   ROT0,  "IGT - International Game Technology", "Player's Edge Plus (BE0014) Blackjack",                        0,   layout_pe_bjack )
89578956
89588957/* Normal board : Keno */
89598958GAMEL(1994, peke1012,  0,        peplus, peplus_keno, peplus_state, peplus, ROT0,  "IGT - International Game Technology", "Player's Edge Plus (KE1012) Keno",                              0, layout_pe_keno )
trunk/src/mess/drivers/ec184x.c
r241498r241499
88    - memory bank size is smaller (128K)
99
1010    TODO (ec1841)
11    - add chargen upload support for MDA
1211    - hard disk is connected but requires changes to isa_hdc.c
1312
1413***************************************************************************/
r241498r241499
178177   AM_RANGE(0xa0000, 0xbffff) AM_NOP
179178   AM_RANGE(0xc0000, 0xc7fff) AM_ROM
180179   AM_RANGE(0xc8000, 0xcffff) AM_ROM
181   AM_RANGE(0xdc000, 0xdffff) AM_RAM       // monochrome chargen
182180   AM_RANGE(0xf0000, 0xfffff) AM_ROM
183181ADDRESS_MAP_END
184182
trunk/src/mess/drivers/pc9801.c
r241498r241499
19081908   pcg_offset|= offset & 0x1e;
19091909   pcg_offset|= m_font_lr;
19101910
1911   if(!(m_font_addr & 0xff))
1912   {
1913      int char_size = m_video_ff[FONTSEL_REG];
1914      return m_char_rom[(m_font_addr >> 8) * (8 << char_size) + (char_size * 0x800) + ((offset >> 1) & 0xf)];
1915   }
1916
19171911   /* TODO: investigate on this difference */
19181912   if((m_font_addr & 0xff00) == 0x5600 || (m_font_addr & 0xff00) == 0x5700)
19191913      return m_kanji_rom[pcg_offset];


Previous 199869 Revisions Next


© 1997-2024 The MAME Team