Previous 199869 Revisions Next

r21409 Saturday 23rd February, 2013 at 19:58:55 UTC by Sandro Ronco
(MESS) New NOT WORKING system
------------------------------

Yeno - MisterX [Team Europe]
[hash]misterx.xml*
[src/mess]mess.lst
[src/mess/drivers]pc2000.c
[src/mess/video]hd44780.c hd44780.h

trunk/hash/misterx.xml
r0r21409
1<?xml version="1.0"?>
2<!DOCTYPE softwarelist SYSTEM "softwarelist.dtd">
3<softwarelist name="misterx" description="Yeno MisterX cartridges">
4   <software name="ftrivia">
5      <description>Fantasie-Trivia</description>
6      <year>1989</year>
7      <publisher>Video Technology / Yeno</publisher>
8      <part name="cart" interface="pc1000_cart">
9         <feature name="pcb_type" value="ftrivia" />
10         <dataarea name="rom" size="0x20000">
11            <rom name="27-5041-00-0.bin" size="0x20000" crc="cf68c0ec" sha1="d582f454195a416e4bcc235558af0311b543aab0" offset="0" />
12         </dataarea>
13      </part>
14   </software>
15
16   <software name="allgeme2">
17      <description>Allgemeinwissen II</description>
18      <year>1989</year>
19      <publisher>Video Technology / Yeno</publisher>
20      <part name="cart" interface="pc1000_cart">
21         <feature name="pcb_type" value="allgeme2" />
22         <dataarea name="rom" size="0x20000">
23            <rom name="27-5041-00-0.bin" size="0x20000" crc="cf68c0ec" sha1="d582f454195a416e4bcc235558af0311b543aab0" offset="0" />
24         </dataarea>
25      </part>
26   </software>
27</softwarelist>
Property changes on: trunk/hash/misterx.xml
Added: svn:mime-type
   + text/xml
Added: svn:eol-style
   + native
trunk/src/mess/drivers/pc2000.c
r21408r21409
11/***************************************************************************
22
3        VTech PreComputer 2000
3        VTech PreComputer 1000 / 2000
44
55        04/12/2009 Skeleton driver.
66
77        TODO:
8        - fix the keys label
8        - fix MisterX LCD
9        - MisterX bankswitch
910        - dump the chargen
10        - verify the cartridge interface (I don't have dump for test it)
11        - the HD44780 busy line is never checked, it's this correct??
11        - verify pc2000 cartridge interface (I don't have dump for test it)
1212
1313****************************************************************************/
1414
r21408r21409
2626public:
2727   pc2000_state(const machine_config &mconfig, device_type type, const char *tag)
2828      : driver_device(mconfig, type, tag),
29         m_maincpu(*this, "maincpu"),
2930         m_lcdc(*this, "hd44780"),
30         m_beep(*this, BEEPER_TAG)
31         m_beep(*this, BEEPER_TAG),
32         m_bank1(*this, "bank1"),
33         m_bank2(*this, "bank2")
3134      { }
3235
36   required_device<cpu_device> m_maincpu;
3337   required_device<hd44780_device> m_lcdc;
3438   required_device<beep_device> m_beep;
39   required_memory_bank m_bank1;
40   optional_memory_bank m_bank2;
3541
3642   UINT8 m_mux_data;
3743   UINT8 m_beep_state;
r21408r21409
4955   virtual void palette_init();
5056};
5157
58class pc1000_state : public pc2000_state
59{
60public:
61   pc1000_state(const machine_config &mconfig, device_type type, const char *tag)
62      : pc2000_state(mconfig, type, tag)
63      { }
5264
65
66   virtual void machine_start();
67   virtual void machine_reset();
68
69   DECLARE_DEVICE_IMAGE_LOAD_MEMBER( cart_load );
70   DECLARE_READ8_MEMBER( kb_r );
71   DECLARE_READ8_MEMBER( lcdc_data_r );
72   DECLARE_WRITE8_MEMBER( lcdc_data_w );
73   DECLARE_READ8_MEMBER( lcdc_control_r );
74   DECLARE_WRITE8_MEMBER( lcdc_control_w );
75};
76
77
5378/* TODO: put a breakpoint at 1625 and test the inputs, writes at dce4 are the scancode values */
5479READ8_MEMBER( pc2000_state::key_matrix_r )
5580{
r21408r21409
75100
76101WRITE8_MEMBER( pc2000_state::rombank1_w )
77102{
78   membank("bank1")->set_entry(data & 0x0f);
103   m_bank1->set_entry(data & 0x0f);
79104}
80105
81106WRITE8_MEMBER( pc2000_state::rombank2_w )
82107{
83108   if (data == 0x80)
84109   {
85      membank("bank2")->set_entry(data & 0x10);   //cartridge
110      m_bank2->set_entry(data & 0x10);   //cartridge
86111   }
87112   else
88113   {
89      membank("bank2")->set_entry(data & 0x0f);
114      m_bank2->set_entry(data & 0x0f);
90115   }
91116}
92117
r21408r21409
119144   AM_RANGE(0x12, 0x12) AM_READWRITE(beep_r, beep_w)
120145ADDRESS_MAP_END
121146
147READ8_MEMBER( pc1000_state::kb_r )
148{
149   static const char *const bitnames[9] =
150   {
151      "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7", "IN8"
152   };
153
154   UINT8 data = 0xff;
155
156   for (int line=0; line<9; line++)
157      if (!(offset & (1<<line)))
158         data &= ioport(bitnames[line])->read();
159
160   return data;
161}
162
163READ8_MEMBER( pc1000_state::lcdc_data_r )
164{
165   //logerror("lcdc data r\n");
166   return m_lcdc->data_read(space, 0)>>4;
167}
168
169WRITE8_MEMBER( pc1000_state::lcdc_data_w )
170{
171   //popmessage("%s", (char*)m_maincpu->space(AS_PROGRAM).get_read_ptr(0x4290));
172
173   //logerror("lcdc data w %x\n", data);
174   m_lcdc->data_write(space, 0, data<<4);
175}
176
177READ8_MEMBER( pc1000_state::lcdc_control_r )
178{
179   //logerror("lcdc control r\n");
180   return m_lcdc->control_read(space, 0)>>4;
181}
182
183WRITE8_MEMBER( pc1000_state::lcdc_control_w )
184{
185   //logerror("lcdc control w %x\n", data);
186   m_lcdc->control_write(space, 0, data<<4);
187}
188
189static HD44780_PIXEL_UPDATE(pc1000_pixel_update)
190{
191   UINT8 layout[] = { 0x00, 0x4f, 0x4e, 0x4d, 0x4c, 0x4b, 0x4a, 0x49, 0x48, 0x47, 0x40, 0x3f, 0x3e, 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37 };
192   //UINT8 layout[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49 };
193
194   for(int i=0; i<20; i++)
195      if (pos == layout[i])
196      {
197         bitmap.pix16(line*9 + y, i*6 + x) = state;
198         break;
199      }
200}
201
202static ADDRESS_MAP_START(pc1000_mem, AS_PROGRAM, 8, pc1000_state)
203   ADDRESS_MAP_UNMAP_HIGH
204   AM_RANGE(0x0000, 0x3fff) AM_ROM AM_REGION("bios", 0x00000)
205   AM_RANGE(0x4000, 0x47ff) AM_RAM
206   AM_RANGE(0x8000, 0xbfff) AM_ROM AM_REGION("cart", 0x00000)    //0x8000 - 0xbfff tests a cartridge, header is 0x55 0xaa 0x33, if it succeeds a jump at 0x8010 occurs
207   AM_RANGE(0xc000, 0xffff) AM_ROMBANK("bank1")
208ADDRESS_MAP_END
209
210static ADDRESS_MAP_START( pc1000_io , AS_IO, 8, pc1000_state)
211   AM_RANGE(0x0000, 0x01ff) AM_READ(kb_r)
212   AM_RANGE(0x4000, 0x4000) AM_MIRROR(0xfe) AM_READWRITE(lcdc_control_r, lcdc_control_w)
213   AM_RANGE(0x4100, 0x4100) AM_MIRROR(0xfe) AM_READWRITE(lcdc_data_r, lcdc_data_w)
214ADDRESS_MAP_END
215
122216/* Input ports */
123217static INPUT_PORTS_START( pc2000 )
124218   PORT_START("IN0")
r21408r21409
277371   PORT_BIT(0xf0, IP_ACTIVE_LOW, IPT_UNUSED)
278372INPUT_PORTS_END
279373
374static INPUT_PORTS_START( pc1000 )
375   PORT_START("IN0")
376   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SCHREIBMASCHINENKURS") PORT_CODE(KEYCODE_F1)
377   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("COMPUTER-UBUNGEN") PORT_CODE(KEYCODE_F2)
378   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ALLGEMEINWISSEN") PORT_CODE(KEYCODE_F3)
379   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("MATHE")      PORT_CODE(KEYCODE_F7)
380   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("GESCHICHTE") PORT_CODE(KEYCODE_F4)
381   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("GEOGRAPHIE") PORT_CODE(KEYCODE_F5)
382   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("NATURWISSENSCHAFTEN") PORT_CODE(KEYCODE_F6)
383   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPIELE")     PORT_CODE(KEYCODE_F8)
280384
385   PORT_START("IN1")
386   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KASSETTE")   PORT_CODE(KEYCODE_F9)
387   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("AUS")        PORT_CODE(KEYCODE_F12)
388   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left")       PORT_CODE(KEYCODE_LEFT)
389   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right")      PORT_CODE(KEYCODE_RIGHT)
390   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?")          PORT_CODE(KEYCODE_1_PAD)
391   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?")          PORT_CODE(KEYCODE_2_PAD)
392   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?")          PORT_CODE(KEYCODE_3_PAD)
393   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ELEKRONIK-RECHNER")   PORT_CODE(KEYCODE_F10)
394
395   PORT_START("IN2")
396   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0")  PORT_CODE(KEYCODE_0) PORT_CHAR('0')
397   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("?")  PORT_CODE(KEYCODE_4_PAD)
398   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xc3\xb6")  PORT_CODE(KEYCODE_OPENBRACE)
399   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xc3\xa4")  PORT_CODE(KEYCODE_CLOSEBRACE)
400   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("\xc3\xbc")  PORT_CODE(KEYCODE_QUOTE)
401   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("-")  PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-')
402   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift")  PORT_CODE(KEYCODE_LSHIFT)
403   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P")  PORT_CODE(KEYCODE_P) PORT_CHAR('P')
404
405   PORT_START("IN3")
406   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8")  PORT_CODE(KEYCODE_8) PORT_CHAR('8')
407   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9")  PORT_CODE(KEYCODE_9) PORT_CHAR('9')
408   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O")  PORT_CODE(KEYCODE_O) PORT_CHAR('O')
409   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K")  PORT_CODE(KEYCODE_K) PORT_CHAR('K')
410   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L")  PORT_CODE(KEYCODE_L) PORT_CHAR('L')
411   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(",")  PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',')
412   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".")  PORT_CODE(KEYCODE_STOP) PORT_CHAR('.')
413   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I")  PORT_CODE(KEYCODE_I) PORT_CHAR('I')
414
415   PORT_START("IN4")
416   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6")  PORT_CODE(KEYCODE_6) PORT_CHAR('6')
417   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7")  PORT_CODE(KEYCODE_7) PORT_CHAR('7')
418   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U")  PORT_CODE(KEYCODE_U) PORT_CHAR('U')
419   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H")  PORT_CODE(KEYCODE_H) PORT_CHAR('H')
420   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J")  PORT_CODE(KEYCODE_J) PORT_CHAR('J')
421   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N")  PORT_CODE(KEYCODE_N) PORT_CHAR('N')
422   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M")  PORT_CODE(KEYCODE_M) PORT_CHAR('M')
423   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z")  PORT_CODE(KEYCODE_Z) PORT_CHAR('Z')
424
425   PORT_START("IN5")
426   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4")  PORT_CODE(KEYCODE_4) PORT_CHAR('4')
427   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5")  PORT_CODE(KEYCODE_5) PORT_CHAR('5')
428   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T")  PORT_CODE(KEYCODE_T) PORT_CHAR('T')
429   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F")  PORT_CODE(KEYCODE_F) PORT_CHAR('F')
430   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G")  PORT_CODE(KEYCODE_G) PORT_CHAR('G')
431   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V")  PORT_CODE(KEYCODE_V) PORT_CHAR('V')
432   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B")  PORT_CODE(KEYCODE_B) PORT_CHAR('B')
433   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R")  PORT_CODE(KEYCODE_R) PORT_CHAR('R')
434
435   PORT_START("IN6")
436   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2")  PORT_CODE(KEYCODE_2) PORT_CHAR('2')
437   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3")  PORT_CODE(KEYCODE_3) PORT_CHAR('3')
438   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E")  PORT_CODE(KEYCODE_E) PORT_CHAR('E')
439   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S")  PORT_CODE(KEYCODE_S) PORT_CHAR('S')
440   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D")  PORT_CODE(KEYCODE_D) PORT_CHAR('D')
441   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X")  PORT_CODE(KEYCODE_X) PORT_CHAR('X')
442   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C")  PORT_CODE(KEYCODE_C) PORT_CHAR('C')
443   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W")  PORT_CODE(KEYCODE_W) PORT_CHAR('W')
444
445   PORT_START("IN7")
446   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock")  PORT_CODE(KEYCODE_CAPSLOCK)
447   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1")  PORT_CODE(KEYCODE_1) PORT_CHAR('1')
448   PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q")  PORT_CODE(KEYCODE_Q) PORT_CHAR('Q')
449   PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A")  PORT_CODE(KEYCODE_A) PORT_CHAR('A')
450   PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y")  PORT_CODE(KEYCODE_Y) PORT_CHAR('Y')
451   PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL)
452   PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
453   PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD)
454
455   PORT_START("IN8")
456   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD)
457   PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD)
458   PORT_BIT(0xfc, IP_ACTIVE_LOW, IPT_UNUSED)
459INPUT_PORTS_END
460
461
462DEVICE_IMAGE_LOAD_MEMBER(pc1000_state, cart_load)
463{
464   UINT8 *cart = memregion("cart")->base();
465
466   if (image.software_entry() == NULL)
467   {
468      UINT32 size = MIN(image.length(), memregion("cart")->bytes());
469
470      if (image.fread(cart, size) != size)
471         return IMAGE_INIT_FAIL;
472   }
473   else
474   {
475      UINT32 size = MIN(image.get_software_region_length("rom"), memregion("cart")->bytes());
476      const char *pcb_type = image.get_feature("pcb_type");
477
478      if (pcb_type && !strcmp(pcb_type, "allgeme2"))
479         memcpy(cart, image.get_software_region("rom"), size >> 1);
480      else if (pcb_type && !strcmp(pcb_type, "ftrivia"))
481         memcpy(cart, image.get_software_region("rom") + (1<<16), size >> 1);
482      else
483         memcpy(cart, image.get_software_region("rom"), size);
484   }
485
486   return IMAGE_INIT_PASS;
487}
488
489
281490void pc2000_state::machine_start()
282491{
283492   UINT8 *bios = memregion("bios")->base();
284493   UINT8 *cart = memregion("cart")->base();
285494
286   membank("bank1")->configure_entries(0, 0x10, bios, 0x4000);
287   membank("bank2")->configure_entries(0, 0x10, bios, 0x4000);
288   membank("bank2")->configure_entry(0x10, cart);
495   m_bank1->configure_entries(0, 0x10, bios, 0x4000);
496   m_bank2->configure_entries(0, 0x10, bios, 0x4000);
497   m_bank2->configure_entry(0x10, cart);
289498}
290499
291500void pc2000_state::machine_reset()
292501{
293502   //set the initial bank
294   membank("bank1")->set_entry(0);
295   membank("bank2")->set_entry(0);
503   m_bank1->set_entry(0);
504   m_bank2->set_entry(0);
296505}
297506
507void pc1000_state::machine_start()
508{
509   UINT8 *bios = memregion("bios")->base();
510   m_bank1->configure_entries(0, 0x08, bios, 0x4000);
511}
512
513void pc1000_state::machine_reset()
514{
515   m_bank1->set_entry(0);
516}
517
298518void pc2000_state::palette_init()
299519{
300520   palette_set_color(machine(), 0, MAKE_RGB(138, 146, 148));
r21408r21409
321541   MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) /* probably not accurate */
322542   MCFG_CPU_PROGRAM_MAP(pc2000_mem)
323543   MCFG_CPU_IO_MAP(pc2000_io)
324   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc2000_state, irq0_line_hold)
544   MCFG_CPU_PERIODIC_INT_DRIVER(pc2000_state, irq0_line_hold, 50)
325545
326546   /* video hardware */
327547   MCFG_SCREEN_ADD("screen", LCD)
r21408r21409
345565
346566   MCFG_CARTSLOT_ADD("cart")
347567   MCFG_CARTSLOT_EXTENSION_LIST("bin")
568   MCFG_CARTSLOT_INTERFACE("pc2000_cart")
348569   MCFG_CARTSLOT_NOT_MANDATORY
349570MACHINE_CONFIG_END
350571
572static MACHINE_CONFIG_DERIVED_CLASS( misterx, pc2000, pc1000_state )
573   /* basic machine hardware */
574   MCFG_CPU_MODIFY("maincpu")
575   MCFG_CPU_PROGRAM_MAP(pc1000_mem)
576   MCFG_CPU_IO_MAP(pc1000_io)
577   MCFG_CPU_PERIODIC_INT_DRIVER(pc1000_state, irq0_line_hold,  10)
578
579   /* video hardware */
580   MCFG_SCREEN_MODIFY("screen")
581   MCFG_SCREEN_SIZE(120, 9) //1x20 chars
582   MCFG_SCREEN_VISIBLE_AREA(0, 120-1, 0, 9-1)
583
584   MCFG_DEVICE_MODIFY("hd44780")
585   MCFG_HD44780_LCD_SIZE(1, 20)
586   MCFG_HD44780_PIXEL_UPDATE_CB(pc1000_pixel_update)
587
588   MCFG_CARTSLOT_MODIFY("cart")
589   MCFG_CARTSLOT_INTERFACE("pc1000_cart")
590   MCFG_CARTSLOT_LOAD(pc1000_state, cart_load)
591
592   /* Software lists */
593   MCFG_SOFTWARE_LIST_ADD("cart_list", "misterx")
594MACHINE_CONFIG_END
595
351596/* ROM definition */
352597ROM_START( pc2000 )
353   ROM_REGION( 0x40000, "bios", ROMREGION_ERASEFF )
598   ROM_REGION( 0x40000, "bios", 0 )
354599   ROM_LOAD( "lh532hee_9344_d.u4", 0x000000, 0x040000, CRC(0b03bf33) SHA1(cb344b94b14975c685041d3e669f386e8a21909f))
355600
356   ROM_REGION( 0x4000, "cart", ROMREGION_ERASEFF )
357   ROM_CART_LOAD( "cart", 0, 0x4000, 0 )
601   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
602   ROM_CART_LOAD( "cart", 0, 0x40000, 0 )
358603ROM_END
359604
605ROM_START( misterx )
606   ROM_REGION( 0x20000, "bios", 0 )
607   ROM_LOAD( "27-00882-001.bin", 0x000000, 0x020000, CRC(30e0dc94) SHA1(2f4675746a41399b3d9e3e8001a9b4a0dcc5b620))
608
609   ROM_REGION( 0x40000, "cart", ROMREGION_ERASEFF )
610ROM_END
611
360612/* Driver */
361613
362614/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
615COMP( 1988, misterx, 0,       0,    misterx,    pc1000, driver_device,   0,  "Video Technology / Yeno",     "MisterX",      GAME_NOT_WORKING)
363616COMP( 1993, pc2000,  0,       0,    pc2000,     pc2000, driver_device,   0,  "Video Technology",   "PreComputer 2000",      GAME_NOT_WORKING)
trunk/src/mess/video/hd44780.c
r21408r21409
113113   save_item(NAME(m_ddram));
114114   save_item(NAME(m_cgram));
115115   save_item(NAME(m_nibble));
116   save_item(NAME(m_rs_state));
117   save_item(NAME(m_rw_state));
116118}
117119
118120//-------------------------------------------------
r21408r21409
140142   m_blink      = false;
141143   m_nibble     = false;
142144   m_first_cmd  = true;
145   m_rs_state   = 0;
146   m_rw_state   = 0;
143147
144148   set_busy_flag(1520);
145149}
r21408r21409
210214   }
211215}
212216
217void hd44780_device::shift_display(int direction)
218{
219   if (direction == 1)
220   {
221      if(m_disp_shift == 0x4f)
222         m_disp_shift = 0x00;
223      else
224         m_disp_shift++;
225   }
226   else
227   {
228      if(m_disp_shift == 0x00)
229         m_disp_shift = 0x4f;
230      else
231         m_disp_shift--;
232   }
233}
234
235void hd44780_device::update_nibble(int rs, int rw)
236{
237   if (m_rs_state != rs || m_rw_state != rw)
238   {
239      m_rs_state = rs;
240      m_rw_state = rw;
241      m_nibble = false;
242   }
243
244   m_nibble = !m_nibble;
245}
246
213247inline void hd44780_device::pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state)
214248{
215249   if (m_pixel_update_func != NULL)
r21408r21409
261295
262296      for (int line=0; line<m_num_line; line++)
263297      {
264         UINT8 line_base = line * 0x40;
265
266298         for (int pos=0; pos<line_size; pos++)
267299         {
268            INT16 char_pos = line_base + pos + m_disp_shift;
300            UINT16 char_pos = line * 0x40 + ((pos + m_disp_shift) % line_size);
269301
270            while (char_pos < 0 || (char_pos - line_base) >= line_size)
271            {
272               if (char_pos < 0)
273                  char_pos += line_size;
274               else if (char_pos - line_base >= line_size)
275                  char_pos -= line_size;
276            }
277
278302            int char_base = 0;
279303            if (m_ddram[char_pos] < 0x10)
280304            {
r21408r21409
343367{
344368   if (m_data_len == 4)
345369   {
346      m_nibble = !m_nibble;
370      update_nibble(0, 0);
347371
348372      if (m_nibble)
349373      {
r21408r21409
399423      if (LOG) logerror("HD44780 '%s': %s shift %d\n", tag(), BIT(m_ir, 3) ? "display" : "cursor",  direct);
400424
401425      if (BIT(m_ir, 3))
402         m_disp_shift += direct;
426         shift_display(direct);
403427      else
404428         update_ac(direct);
405429
r21408r21409
452476   if (m_data_len == 4)
453477   {
454478      if (!space.debugger_access())
455         m_nibble = !m_nibble;
479         update_nibble(0, 1);
456480
457481      if (m_nibble)
458482         return (m_busy_flag ? 0x80 : 0) | (m_ac & 0x70);
r21408r21409
475499
476500   if (m_data_len == 4)
477501   {
478      m_nibble = !m_nibble;
502      update_nibble(1, 0);
479503
480504      if (m_nibble)
481505      {
r21408r21409
501525
502526   update_ac(m_direction);
503527   if (m_shift_on)
504      m_disp_shift += m_direction;
528      shift_display(m_direction);
505529   set_busy_flag(41);
506530}
507531
r21408r21409
514538   if (m_data_len == 4)
515539   {
516540      if (!space.debugger_access())
517         m_nibble = !m_nibble;
541         update_nibble(1, 1);
518542
519543      if (m_nibble)
520544         return data & 0xf0;
trunk/src/mess/video/hd44780.h
r21408r21409
8383   // internal helper
8484   void set_busy_flag(UINT16 usec);
8585   void update_ac(int direction);
86   void update_nibble(int rs, int rw);
87   void shift_display(int direction);
8688   void pixel_update(bitmap_ind16 &bitmap, UINT8 line, UINT8 pos, UINT8 y, UINT8 x, int state);
8789
8890   // internal state
r21408r21409
108110   bool        m_cursor_on;      // cursor on/off
109111   bool        m_blink_on;       // blink on/off
110112   bool        m_shift_on;       // shift on/off
111   INT8        m_disp_shift;     // display shift
113   UINT8       m_disp_shift;     // display shift
112114   INT8        m_direction;      // auto increment/decrement
113115   UINT8       m_data_len;       // interface data length 4 or 8 bit
114116   UINT8       m_num_line;       // number of lines
115117   UINT8       m_char_size;      // char size 5x8 or 5x10
116118   bool        m_blink;
117119   bool        m_first_cmd;
120   int         m_rs_state;
121   int         m_rw_state;
118122   bool        m_nibble;
119123   int         m_charset_type;
120124
trunk/src/mess/mess.lst
r21408r21409
11641164socratfc  // 1988 Socrates SAITOUT (French Canada)
11651165profweis  // 1988 (Yeno) Proffesor Weiss-Alles (Germany)
11661166gl8008cx
1167iq128_fr // 1997 Genius PC (France) / Genius IQ 128 (Germany)
1168iq128
1167iq128_fr // 1997 Genius PC (France)
1168iq128    // 1997 Genius IQ 128 (Germany)
11691169iqtv512 // IQ TV512 (Germany)
1170misterx // 1988 (Yeno) MisterX
1171pc2000 // 1993 PreComputer 2000
11701172
11711173// Tangerine
11721174microtan  // 1979 Microtan 65
r21408r21409
18641866
18651867//********** To sort (mostly skeleton drivers) *****************************
18661868
1867pc2000 // VTech PreComputer 2000
18681869a5105
18691870bcs3
18701871bcs3a

Previous 199869 Revisions Next


© 1997-2024 The MAME Team