Previous 199869 Revisions Next

r31598 Sunday 10th August, 2014 at 19:40:29 UTC by R. Belmont
(MESS) Apple II updates:
- Added additional ROMs for TK3000
- Added preliminary mono/color config switch for pre-IIgs machines (doesn't yet work in lo-res)
- Moved Laser 3000 to its own driver since it's not very Apple-like and got it to boot into BASIC.
[src/mess]mess.lst mess.mak
[src/mess/drivers]apple2.c laser3k.c*
[src/mess/includes]apple2.h
[src/mess/machine]apple2.c
[src/mess/video]apple2.c

trunk/src/mess/machine/apple2.c
r31597r31598
13131313   {
13141314      return m_auxslotdevice->read_auxram(offset);
13151315   }
1316   else if (m_machinetype == APPLE_IIE)
1316   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
13171317   {
13181318      return 0xff;
13191319   }
r31597r31598
13281328   {
13291329      return m_auxslotdevice->read_auxram(offset+0x200);
13301330   }
1331   else if (m_machinetype == APPLE_IIE)
1331   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
13321332   {
13331333      return 0xff;
13341334   }
r31597r31598
13431343   {
13441344      return m_auxslotdevice->read_auxram(offset+0x400);
13451345   }
1346   else if (m_machinetype == APPLE_IIE)
1346   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
13471347   {
13481348      return 0xff;
13491349   }
r31597r31598
13581358   {
13591359      return m_auxslotdevice->read_auxram(offset+0x800);
13601360   }
1361   else if (m_machinetype == APPLE_IIE)
1361   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
13621362   {
13631363      return 0xff;
13641364   }
r31597r31598
13731373   {
13741374      return m_auxslotdevice->read_auxram(offset+0x2000);
13751375   }
1376   else if (m_machinetype == APPLE_IIE)
1376   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
13771377   {
13781378      return 0xff;
13791379   }
r31597r31598
13881388   {
13891389      return m_auxslotdevice->read_auxram(offset+0x4000);
13901390   }
1391   else if (m_machinetype == APPLE_IIE)
1391   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
13921392   {
13931393      return 0xff;
13941394   }
r31597r31598
14031403   {
14041404      return m_auxslotdevice->read_auxram(offset+0xc000);
14051405   }
1406   else if (m_machinetype == APPLE_IIE)
1406   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
14071407   {
14081408      return 0xff;
14091409   }
r31597r31598
14181418   {
14191419      return m_auxslotdevice->read_auxram(offset+0xd000);
14201420   }
1421   else if (m_machinetype == APPLE_IIE)
1421   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
14221422   {
14231423      return 0xff;
14241424   }
r31597r31598
14331433   {
14341434      return m_auxslotdevice->read_auxram(offset+0xe000);
14351435   }
1436   else if (m_machinetype == APPLE_IIE)
1436   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
14371437   {
14381438      return 0xff;
14391439   }
r31597r31598
15031503      m_auxslotdevice->write_auxram(offset, data);
15041504      return;
15051505   }
1506   else if (m_machinetype == APPLE_IIE)
1506   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
15071507   {
15081508      return;
15091509   }
r31597r31598
15191519      m_auxslotdevice->write_auxram(offset+0x200, data);
15201520      return;
15211521   }
1522   else if (m_machinetype == APPLE_IIE)
1522   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
15231523   {
15241524      return;
15251525   }
r31597r31598
15351535      m_auxslotdevice->write_auxram(offset+0x400, data);
15361536      return;
15371537   }
1538   else if (m_machinetype == APPLE_IIE)
1538   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
15391539   {
15401540      return;
15411541   }
r31597r31598
15511551      m_auxslotdevice->write_auxram(offset+0x800, data);
15521552      return;
15531553   }
1554   else if (m_machinetype == APPLE_IIE)
1554   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
15551555   {
15561556      return;
15571557   }
r31597r31598
15671567      m_auxslotdevice->write_auxram(offset+0x2000, data);
15681568      return;
15691569   }
1570   else if (m_machinetype == APPLE_IIE)
1570   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
15711571   {
15721572      return;
15731573   }
r31597r31598
15831583      m_auxslotdevice->write_auxram(offset+0x4000, data);
15841584      return;
15851585   }
1586   else if (m_machinetype == APPLE_IIE)
1586   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
15871587   {
15881588      return;
15891589   }
r31597r31598
15991599      m_auxslotdevice->write_auxram(offset+0xc000, data);
16001600      return;
16011601   }
1602   else if (m_machinetype == APPLE_IIE)
1602   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
16031603   {
16041604      return;
16051605   }
r31597r31598
16151615      m_auxslotdevice->write_auxram(offset+0xd000, data);
16161616      return;
16171617   }
1618   else if (m_machinetype == APPLE_IIE)
1618   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
16191619   {
16201620      return;
16211621   }
r31597r31598
16311631      m_auxslotdevice->write_auxram(offset+0xe000, data);
16321632      return;
16331633   }
1634   else if (m_machinetype == APPLE_IIE)
1634   else if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
16351635   {
16361636      return;
16371637   }
r31597r31598
21432143   m_slot_ram = (m_slot_length > 0) ? &m_rom[m_rom_length] : NULL;
21442144
21452145   m_auxslotdevice = NULL;
2146   if (m_machinetype == APPLE_IIE)
2146   if (m_machinetype == APPLE_IIE || m_machinetype == TK3000)
21472147   {
21482148      m_auxslotdevice = m_a2eauxslot->get_a2eauxslot_card();
21492149   }
r31597r31598
21912191   apple2eplus_init_common((void *)NULL);
21922192}
21932193
2194MACHINE_START_MEMBER(apple2_state,tk3000)
2195{
2196   m_machinetype = TK3000;   // enhanced IIe clone with Z80 keyboard scanner subcpu
2197
2198   apple2eplus_init_common((void *)NULL);
2199}
2200
21942201MACHINE_START_MEMBER(apple2_state,apple2cp)
21952202{
21962203   void *apple2cp_ce00_ram;
trunk/src/mess/includes/apple2.h
r31597r31598
8080   APPLE_IIC,          // Apple IIc
8181   APPLE_IICPLUS,      // Apple IIc+
8282   TK2000,             // Microdigital TK2000
83   TK3000,            // Microdigital TK3000
8384   LASER128,           // Laser 128/128EX/128EX2
8485   SPACE84,            // "Space 84" with flipped text mode
8586   LABA2P              // lab equipment (?) II Plus with flipped text mode
r31597r31598
135136      m_kbspecial(*this, "keyb_special"),
136137      m_kbrepeat(*this, "keyb_repeat"),
137138      m_resetdip(*this, "reset_dip"),
139      m_sysconfig(*this, "a2_config"),
138140      m_cassette(*this, "cassette"),
139141      m_acia1(*this, IIC_ACIA1_TAG),
140142      m_acia2(*this, IIC_ACIA2_TAG)
r31597r31598
151153   required_ioport m_kbspecial;
152154   optional_ioport m_kbrepeat;
153155   optional_ioport m_resetdip;
156   optional_ioport m_sysconfig;
154157   optional_device<cassette_image_device> m_cassette;
155158
156159   optional_device<mos6551_device> m_acia1, m_acia2;
r31597r31598
313316   DECLARE_MACHINE_START(apple2c);
314317   DECLARE_MACHINE_START(apple2cp);
315318   DECLARE_MACHINE_START(tk2000);
319   DECLARE_MACHINE_START(tk3000);
316320   DECLARE_MACHINE_START(laser128);
317321   DECLARE_MACHINE_START(space84);
318322   DECLARE_MACHINE_START(laba2p);
trunk/src/mess/video/apple2.c
r31597r31598
9797   const UINT8 *chardata;
9898   UINT16 color;
9999
100   if (m_sysconfig != NULL)
101   {
102      switch (m_sysconfig->read() & 0x03)
103      {
104         case 0:
105            break;   // leave alone
106
107         case 1:
108            if ((m_machinetype == APPLE_II) || (m_machinetype == LABA2P) || (m_machinetype == SPACE84))
109            {
110               bg = WHITE;
111            }
112            else
113            {
114               fg = WHITE;
115            }
116            break;
117
118         case 2:
119            if ((m_machinetype == APPLE_II) || (m_machinetype == LABA2P) || (m_machinetype == SPACE84))
120            {
121               bg = GREEN;
122            }
123            else
124            {
125               fg = GREEN;
126            }
127            break;
128
129         case 3:
130            if ((m_machinetype == APPLE_II) || (m_machinetype == LABA2P) || (m_machinetype == SPACE84))
131            {
132               bg = ORANGE;
133            }
134            else
135            {
136               fg = ORANGE;
137            }
138            break;
139      }
140   }
141
142
100143   if (my_a2 & VAR_ALTCHARSET)
101144   {
102145      /* we're using an alternate charset */
r31597r31598
139182
140183            for (i = 0; i < xscale; i++)
141184            {
142               bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
185               bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
143186            }
144187         }
145188      }
r31597r31598
242285   UINT16 *p;
243286   UINT32 w;
244287   UINT16 *artifact_map_ptr;
288   int mon_type = 0;
245289
290   if (m_sysconfig != NULL)
291   {
292      mon_type = m_sysconfig->read() & 0x03;
293   }
294
246295   /* sanity checks */
247296   if (beginrow < cliprect.min_y)
248297      beginrow = cliprect.min_y;
r31597r31598
300349         switch(columns)
301350         {
302351            case 40:
303               artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16];
304               for (b = 0; b < 7; b++)
352               switch (mon_type)
305353               {
306                  v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];
307                  *(p++) = v;
308                  *(p++) = v;
354                  case 0:
355                     artifact_map_ptr = &m_hires_artifact_map[((vram_row[col+1] & 0x80) >> 7) * 16];
356                     for (b = 0; b < 7; b++)
357                     {
358                        v = artifact_map_ptr[((w >> (b + 7-1)) & 0x07) | (((b ^ col) & 0x01) << 3)];
359
360                        if ((col == 0) && (row == 0))
361                        {
362                           printf("R0C0 %x\n", v);
363                        }   
364
365                        *(p++) = v;
366                        *(p++) = v;
367                     }
368                     break;
369
370                  case 1:
371                     for (b = 0; b < 7; b++)
372                     {
373                        v = (w & 1);
374                        w >>= 1;
375                        *(p++) = v ? WHITE : BLACK;
376                        *(p++) = v ? WHITE : BLACK;
377                     }
378                     break;
379
380                  case 2:
381                     for (b = 0; b < 7; b++)
382                     {
383                        v = (w & 1);
384                        w >>= 1;
385                        *(p++) = v ? GREEN : BLACK;
386                        *(p++) = v ? GREEN : BLACK;
387                     }
388                     break;
389
390                  case 3:
391                     for (b = 0; b < 7; b++)
392                     {
393                        v = (w & 1);
394                        w >>= 1;
395                        *(p++) = v ? ORANGE : BLACK;
396                        *(p++) = v ? ORANGE : BLACK;
397                     }
398                     break;
309399               }
310400               break;
311401
r31597r31598
321411               }
322412               else
323413               {
324                  for (b = 0; b < 7; b++)
414                  switch (mon_type)
325415                  {
326                     v = m_dhires_artifact_map[((((w >> (b + 7-1)) & 0x0F) * 0x11) >> (((2-(col*7+b))) & 0x03)) & 0x0F];
327                     *(p++) = v;
416                     case 0:
417                        for (b = 0; b < 7; b++)
418                        {
419                           v = m_dhires_artifact_map[((((w >> (b + 7-1)) & 0x0F) * 0x11) >> (((2-(col*7+b))) & 0x03)) & 0x0F];
420                           *(p++) = v;
421                        }
422                        break;
423
424                     case 1:
425                        for (b = 0; b < 7; b++)
426                        {
427                           v = (w & 1);
428                           w >>= 1;
429                           *(p++) = v ? WHITE : BLACK;
430                        }
431                        break;
432
433                     case 2:
434                        for (b = 0; b < 7; b++)
435                        {
436                           v = (w & 1);
437                           w >>= 1;
438                           *(p++) = v ? GREEN : BLACK;
439                        }
440                        break;
441
442                     case 3:
443                        for (b = 0; b < 7; b++)
444                        {
445                           v = (w & 1);
446                           w >>= 1;
447                           *(p++) = v ? ORANGE : BLACK;
448                        }
449                        break;
328450                  }
329451               }
330452               break;
trunk/src/mess/mess.lst
r31597r31598
473473ace100  // ??? 1982 Franklin Ace 100
474474laser128  // ??? 1987 Laser 128
475475las128ex  // ??? 1988 Laser 128 EX
476las3000   // ??? 1983 Laser 3000
477476ivelultr  // Ivasim Ivel Ultra
478477agat7    // Agat-7
479478agat9    // Agat-9
r31597r31598
12931292gl6600cx // Genius Leader 6600CX (Germany)
12941293pitagjr  // Pitagorin Junior
12951294
1295// Other Video Technology Laser machines
1296las3000   // 1983 Laser 3000
12961297
1298
12971299// Tangerine
12981300microtan  // 1979 Microtan 65
12991301
trunk/src/mess/drivers/apple2.c
r31597r31598
177177The external drive port supports not only 5.25 drives but also UniDisk and
178178Apple 3.5 drives, allowing via daisy-chaining any combination of UniDisk,
179179Apple 3.5 and Apple 5.25 drives - up to three devices
180
180 
181----------------------------------
182 
183TK3000 keyboard matrix
184 
185Data bus D0-D7 is X0-X7
186Address bus A0-A11 is Y0-Y11
187 
181188***************************************************************************/
182189
183190
r31597r31598
186193#include "imagedev/cassette.h"
187194#include "formats/ap2_dsk.h"
188195#include "includes/apple2.h"
196#include "cpu/z80/z80.h"
189197
190198#include "bus/a2bus/a2bus.h"
191199#include "bus/a2bus/a2lang.h"
r31597r31598
253261   /* nothing in the address map - everything is added dynamically */
254262ADDRESS_MAP_END
255263
264/*
265 
266    LS259 at H12
267 
268    A8  = D
269    A9  = A
270    A10 = B
271    A11 = C
272 
273   374/259 outputs to 65C02 c000/c010 selected by Z80 WR OR Z80 IORQ? (schematic is not super legible)
274 
275*/
256276
277// RAM and ROM alternate in 8K blocks: ROM at 0/4/8/c, RAM at 2/6/a/e (RAM is only 1k and further mirrors inside those locations)
278static ADDRESS_MAP_START( tk3000_kbd_map, AS_PROGRAM, 8, apple2_state )
279   AM_RANGE(0x0000, 0x1fff) AM_ROM AM_MIRROR(0xc000) AM_REGION("kbdcpu", 0)
280   AM_RANGE(0x2000, 0x3fff) AM_RAM AM_MIRROR(0xcc00) AM_MASK(0x3ff)
281ADDRESS_MAP_END
257282
283
258284/***************************************************************************
259285    INPUT PORTS
260286***************************************************************************/
r31597r31598
341367   //PORT_INCLUDE( apple2_paddle )
342368INPUT_PORTS_END
343369
370static INPUT_PORTS_START( apple2_sysconfig )
371   PORT_START("a2_config")
372   PORT_CONFNAME(0x03, 0x00, "Composite monitor type")
373   PORT_CONFSETTING(0x00, "Color")
374   PORT_CONFSETTING(0x01, "B&W")
375   PORT_CONFSETTING(0x02, "Green")
376   PORT_CONFSETTING(0x03, "Amber")
377INPUT_PORTS_END
378
344379   /*
345380     Apple II / II Plus key matrix (from "The Apple II Circuit Description")
346381
r31597r31598
534569
535570   /* other devices */
536571   PORT_INCLUDE( apple2_gameport )
572
573   PORT_INCLUDE(apple2_sysconfig)
537574INPUT_PORTS_END
538575
539576static INPUT_PORTS_START( apple2p )
r31597r31598
662699   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Open Apple")   PORT_CODE(KEYCODE_LALT)
663700   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Solid Apple")  PORT_CODE(KEYCODE_RALT)
664701   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET")        PORT_CODE(KEYCODE_F12)
702
703   PORT_INCLUDE(apple2_sysconfig)
665704INPUT_PORTS_END
666705
667706static INPUT_PORTS_START( apple2e )
r31597r31598
788827   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET")        PORT_CODE(KEYCODE_F12)
789828
790829   PORT_INCLUDE( apple2_gameport )
830   PORT_INCLUDE(apple2_sysconfig)
791831INPUT_PORTS_END
792832
793833INPUT_PORTS_START( apple2ep )
r31597r31598
909949   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET")        PORT_CODE(KEYCODE_F12)
910950
911951   PORT_INCLUDE( apple2_gameport )
952   PORT_INCLUDE(apple2_sysconfig)
912953INPUT_PORTS_END
913954
914955/* according to Steve Nickolas (author of Dapple), our original palette would
r31597r31598
11451186   MCFG_CPU_REPLACE("maincpu", M65C02, 1021800)        /* close to actual CPU frequency of 1.020484 MHz */
11461187MACHINE_CONFIG_END
11471188
1189static MACHINE_CONFIG_DERIVED( tk3000, apple2e )
1190   MCFG_CPU_REPLACE("maincpu", M65C02, 1021800)        /* close to actual CPU frequency of 1.020484 MHz */
1191
1192   MCFG_CPU_ADD("subcpu", Z80, 1021800)   // schematics are illegible on where the clock comes from, but it *seems* to be the same as the 65C02 clock
1193   MCFG_CPU_PROGRAM_MAP(tk3000_kbd_map)
1194MACHINE_CONFIG_END
1195
11481196static MACHINE_CONFIG_DERIVED( apple2ep, apple2e )
11491197   MCFG_CPU_REPLACE("maincpu", M65C02, 1021800)        /* close to actual CPU frequency of 1.020484 MHz */
11501198MACHINE_CONFIG_END
r31597r31598
11941242
11951243static MACHINE_CONFIG_DERIVED( apple2cp, apple2c )
11961244   MCFG_MACHINE_START_OVERRIDE(apple2_state,apple2cp)
1245
1246   MCFG_A2BUS_SLOT_REMOVE("sl6")
1247   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_IWM_FDC, NULL)
11971248MACHINE_CONFIG_END
11981249
11991250static MACHINE_CONFIG_DERIVED( apple2c_iwm, apple2c )
r31597r31598
12121263   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl3", A2BUS_LASER128, NULL)
12131264   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl4", A2BUS_LASER128, NULL)
12141265   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl5", A2BUS_LASER128, NULL)
1215   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_IWM_FDC, NULL)     // slots 6 and 7 are hacks for now
1266   MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl6", A2BUS_LASER128, NULL)
12161267//    MCFG_A2BUS_ONBOARD_ADD("a2bus", "sl7", A2BUS_LASER128, NULL)
12171268MACHINE_CONFIG_END
12181269
r31597r31598
14591510   ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // probably not this machine's actual ROM
14601511ROM_END
14611512
1462// unlike the very unique TK2000, the TK3000 is a stock enhanced IIe clone
1513// unlike the very unique TK2000, the TK3000 is a mostly stock enhanced IIe clone
14631514ROM_START(tk3000)
14641515   ROM_REGION(0x2000,"gfx1",0)
1465   ROM_LOAD ( "341-0265-a.chr", 0x0000, 0x1000,CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10))
1466   ROM_LOAD ( "341-0265-a.chr", 0x1000, 0x1000,CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10))
1516   ROM_LOAD( "tk3000.f7",    0x000000, 0x002000, CRC(70157693) SHA1(a7922e2137f95271011042441d80466fba7bb828) )
14671517
14681518   ROM_REGION(0x4000,"maincpu",0)
1469   ROM_LOAD( "tk3000e.rom",  0x000000, 0x004000, CRC(5b1e8ab2) SHA1(f163e5753c18ff0e812a448e8da406f102600edf) )
1519   ROM_LOAD( "tk3000.f4f6",  0x000000, 0x004000, CRC(5b1e8ab2) SHA1(f163e5753c18ff0e812a448e8da406f102600edf) )
14701520
1471   ROM_REGION( 0x800, "keyboard", ROMREGION_ERASE00 )
1521   ROM_REGION(0x2000, "kbdcpu", 0)
1522   ROM_LOAD( "tk3000.e13",   0x000000, 0x002000, CRC(f9b860d3) SHA1(6a127f1458f43a00199d3dde94569b8928f05a53) )
1523
1524   ROM_REGION(0x800, "keyboard", ROMREGION_ERASE00)
14721525   ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, BAD_DUMP CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // probably not this machine's actual ROM
14731526ROM_END
14741527
r31597r31598
15231576   ROM_LOAD( "342-0132-c.e12", 0x000, 0x800, CRC(e47045f4) SHA1(12a2e718f5f4acd69b6c33a45a4a940b1440a481) ) // 1983 US-Dvorak
15241577ROM_END
15251578
1526ROM_START(las3000)
1527   ROM_REGION(0x0800,"gfx1",0)
1528   ROM_LOAD ( "341-0036.chr", 0x0000, 0x0800, CRC(64f415c6) SHA1(f9d312f128c9557d9d6ac03bfad6c3ddf83e5659))
1529
1530   ROM_REGION(0x8700,"maincpu",0)
1531   ROM_LOAD ( "las3000.rom", 0x4000, 0x4000, CRC(9C7AEB09) SHA1(3302ADF41E258CF50210C19736948C8FA65E91DE))
1532   ROM_CONTINUE(0x0000, 0x4000)
1533   ROM_LOAD ( "l3kdisk.rom", 0x8500, 0x0100, CRC(2D4B1584) SHA1(989780B77E100598124DF7B72663E5A31A3339C0))
1534ROM_END
1535
15361579ROM_START(laser128)
15371580   ROM_REGION(0x2000,"gfx1",0)
15381581   ROM_LOAD ( "341-0265-a.chr", 0x0000, 0x1000, BAD_DUMP CRC(2651014d) SHA1(b2b5d87f52693817fc747df087a4aa1ddcdb1f10)) // need to dump real laser rom
r31597r31598
16611704COMP( 1987, apple2ep, apple2e,  0,        apple2ep,    apple2ep, driver_device, 0,        "Apple Computer",    "Apple //e (Platinum)", GAME_SUPPORTS_SAVE )
16621705COMP( 1984, apple2c,  0,        apple2,   apple2c,     apple2e, driver_device,  0,        "Apple Computer",    "Apple //c" , GAME_SUPPORTS_SAVE )
16631706COMP( 1984, tk2000,   apple2c,  0,        tk2000,      apple2e, driver_device,  0,        "Microdigital",      "TK2000" , GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1664COMP( 1986, tk3000,   apple2c,  0,        apple2ee,    apple2e, driver_device,  0,        "Microdigital",      "TK3000//e" , GAME_SUPPORTS_SAVE )
1707COMP( 1986, tk3000,   apple2c,  0,        tk3000,      apple2e, driver_device,  0,        "Microdigital",      "TK3000//e" , GAME_SUPPORTS_SAVE )
16651708COMP( 1989, prav8c,   apple2c,  0,        apple2c,     apple2e, driver_device,  0,        "Pravetz",           "Pravetz 8C", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
1666COMP( 1983, las3000,  apple2,   0,        apple2p,     apple2p, driver_device,  0,        "Video Technology",  "Laser 3000",    GAME_NOT_WORKING )
16671709COMP( 1987, laser128, apple2c,  0,        laser128,    apple2e, driver_device,  0,        "Video Technology",  "Laser 128 (version 4.2)", GAME_NOT_WORKING )
16681710COMP( 1988, las128ex, apple2c,  0,        laser128,    apple2e, driver_device,  0,        "Video Technology",  "Laser 128ex (version 4.5)", GAME_NOT_WORKING )
16691711// TODO: add laser128ex2
trunk/src/mess/drivers/laser3k.c
r0r31598
1/***************************************************************************
2 
3  laser3k.c
4  Driver for VTech Laser 3000 / Dick Smith Electronics "The Cat"
5 
6  This machine is somewhat similar to a 48K Apple II if you blur your eyes
7  a lot, but it generally fits in poorly with 100% compatible machines
8  (no chance of a compatible language card or auxmem) so it gets its own driver.
9 
10  An "emulation cartridge" is required to run Apple II software; it's unclear
11  what that consists of.
12 
13  Banking theory:
14  - 6502 has 4 banking windows, 0000-3FFF, 4000-7FFF, 8000-BFFF, C000-FFFF
15  - Physical address space is 0x00000-0x3FFFF.  ROM and I/O at the top, RAM
16    up to 0x2FFFF (192k max).
17  - Each window has a bank number register at physical 3C07C/D/E/F
18 
19  Technical manual at:
20  http://mirrors.apple2.org.za/Apple%20II%20Documentation%20Project/Computers/LASER/LASER%203000/Manuals/The%20Cat%20Technical%20Reference%20Manual.pdf
21 
22  TODO:
23    - keyboard
24    - graphics modes
25    - 80-column text
26    - figure out where the C800 ROM pages for the printer and FDC are (currently the 80-col f/w's pages are mapped there)
27    - Centronics printer port (data at 3c090, read ack at 3c1c0, read busy at 3c1c2)
28 
29***************************************************************************/
30
31#include "emu.h"
32#include "cpu/m6502/m6502.h"
33#include "machine/bankdev.h"
34#include "machine/ram.h"
35#include "sound/speaker.h"
36#include "sound/sn76496.h"
37
38class laser3k_state : public driver_device
39{
40public:
41   laser3k_state(const machine_config &mconfig, device_type type, const char *tag)
42      : driver_device(mconfig, type, tag)
43      , m_maincpu(*this, "maincpu")
44      , m_ram(*this, "mainram")
45      , m_bank0(*this, "bank0")
46      , m_bank1(*this, "bank1")
47      , m_bank2(*this, "bank2")
48      , m_bank3(*this, "bank3")
49      , m_speaker(*this, "speaker")
50      , m_sn(*this, "sn76489")
51   { }
52
53   required_device<m6502_device> m_maincpu;
54   required_device<ram_device> m_ram;
55   required_device<address_map_bank_device> m_bank0;
56   required_device<address_map_bank_device> m_bank1;
57   required_device<address_map_bank_device> m_bank2;
58   required_device<address_map_bank_device> m_bank3;
59   required_device<speaker_sound_device> m_speaker;
60   required_device<sn76489_device> m_sn;
61
62   READ8_MEMBER( ram_r );
63   WRITE8_MEMBER( ram_w );
64   READ8_MEMBER( io_r );
65   WRITE8_MEMBER( io_w );
66   READ8_MEMBER( io2_r );
67
68   virtual void machine_reset();
69   DECLARE_PALETTE_INIT(laser3k);
70   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
71
72private:
73   UINT8 m_bank0val, m_bank1val, m_bank2val, m_bank3val;
74   int m_flash;
75   int m_speaker_state;
76   int m_disp_page;
77   int m_bg_color;
78
79   void plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code, const UINT8 *textgfx_data, UINT32 textgfx_datalen);
80};
81
82/***************************************************************************
83    ADDRESS MAP
84***************************************************************************/
85
86static ADDRESS_MAP_START( laser3k_map, AS_PROGRAM, 8, laser3k_state )
87   AM_RANGE(0x0000, 0x3fff) AM_DEVICE("bank0", address_map_bank_device, amap8)
88   AM_RANGE(0x4000, 0x7fff) AM_DEVICE("bank1", address_map_bank_device, amap8)
89   AM_RANGE(0x8000, 0xbfff) AM_DEVICE("bank2", address_map_bank_device, amap8)
90   AM_RANGE(0xc000, 0xffff) AM_DEVICE("bank3", address_map_bank_device, amap8)
91ADDRESS_MAP_END
92
93static ADDRESS_MAP_START( banks_map, AS_PROGRAM, 8, laser3k_state )
94   AM_RANGE(0x00000, 0x2ffff) AM_READWRITE(ram_r, ram_w)
95   AM_RANGE(0x38000, 0x3bfff) AM_ROM AM_REGION("maincpu", 0)
96   AM_RANGE(0x3c000, 0x3c0ff) AM_READWRITE(io_r, io_w)
97   AM_RANGE(0x3c100, 0x3c1ff) AM_READ(io2_r)
98   AM_RANGE(0x3c200, 0x3ffff) AM_ROM AM_REGION("maincpu", 0x4200)
99ADDRESS_MAP_END
100
101void laser3k_state::machine_reset()
102{
103   m_bank0val = 0;
104   m_bank1val = 1;
105   m_bank2val = 2;
106   m_bank3val = 0xf;
107   m_bank0->set_bank(m_bank0val);
108   m_bank1->set_bank(m_bank1val);
109   m_bank2->set_bank(m_bank2val);
110   m_bank3->set_bank(m_bank3val);
111
112   // reset the 6502 here with the banking set up so we get the right vector
113   m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
114   m_maincpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
115
116   m_flash = 0;
117   m_speaker_state = 0;
118   m_disp_page = 0;
119   m_bg_color = 0;
120
121   UINT8 *rom = (UINT8 *)memregion("maincpu")->base();
122
123   // patch out disk controller ID for now so it drops right into BASIC
124   rom[0x4607] = 0;
125}
126
127READ8_MEMBER( laser3k_state::ram_r )
128{
129   return m_ram->read(offset);
130}
131
132WRITE8_MEMBER( laser3k_state::ram_w )
133{
134   m_ram->write(offset, data);
135}
136
137READ8_MEMBER( laser3k_state::io_r )
138{
139   switch (offset)
140   {
141      case 0x00:   // keyboard latch
142         return 0x00;
143
144      case 0x08:   // set border color to black
145         break;
146
147      case 0x10:   // keyboard strobe
148         return 0x00;
149
150      case 0x18:   // set bg color to black
151         m_bg_color = 0;
152         break;
153      case 0x19:   // set bg color to red
154         m_bg_color = 1;
155         break;
156      case 0x1a:   // set bg color to green
157         m_bg_color = 12;
158         break;
159      case 0x1b:   // set bg color to yellow
160         m_bg_color = 13;
161         break;
162      case 0x1c:   // set bg color to blue
163         m_bg_color = 6;
164         break;
165      case 0x1d:   // set bg color to magenta
166         m_bg_color = 3;
167         break;
168      case 0x1e:   // set bg color to cyan
169         m_bg_color = 14;
170         break;
171      case 0x1f:   // set bg color to white
172         m_bg_color = 15;
173         break;
174
175      case 0x28:   // "enable multi-color mode" - not sure what this means
176         break;
177
178      case 0x4c:   // low resolution (40 column)
179         break;
180
181      case 0x30:
182         m_speaker_state ^= 1;
183         m_speaker->level_w(m_speaker_state);
184         break;
185
186      case 0x51:   // text mode
187         break;
188
189      case 0x54:   // set page 1
190         m_disp_page = 0;
191         break;
192
193      case 0x55:   // set page 2
194         m_disp_page = 1;
195         break;
196
197      case 0x56:   // disable emulation (?)
198         break;
199
200      case 0x7c:
201         return m_bank0val;
202         
203      case 0x7d:
204         return m_bank1val;
205         
206      case 0x7e:
207         return m_bank2val;
208         
209      case 0x7f:
210         return m_bank3val;
211         
212      default:
213         printf("io_r @ unknown %x\n", offset);
214         break;
215   }
216
217   return 0xff;
218}
219
220WRITE8_MEMBER( laser3k_state::io_w )
221{
222   switch (offset)
223   {
224      case 0x10:   // clear keyboard latch
225         break;
226
227      case 0x30:   // speaker toggle sound
228         m_speaker_state ^= 1;
229         m_speaker->level_w(m_speaker_state);
230         break;
231
232      case 0x4c:   // low resolution
233         break;
234
235      case 0x68:   // SN76489 sound
236         m_sn->write(space, 0, data);
237         break;
238
239      case 0x78:   // called "SYSTEM" in the boot ROM listing, but unsure what it does
240         break;
241
242      case 0x7c:   // bank 0
243         m_bank0val = data;
244         m_bank0->set_bank(m_bank0val);
245         break;
246
247      case 0x7d:  // bank 1
248         m_bank1val = data;
249         m_bank1->set_bank(m_bank1val);
250         break;
251
252      case 0x7e:   // bank 2
253         m_bank2val = data;
254         m_bank2->set_bank(m_bank2val);
255         break;
256
257      case 0x7f:   // bank 3
258         m_bank3val = data;
259         m_bank3->set_bank(m_bank3val);
260         break;
261
262      default:
263         printf("io_w %02x @ unknown %x\n", data, offset);
264         break;
265   }
266}
267
268READ8_MEMBER( laser3k_state::io2_r )
269{
270   switch (offset)
271   {
272      case 0xc2:   // h-blank status
273         return space.machine().first_screen()->hblank() ? 0x80 : 0x00;
274
275      case 0xc3:   // v-blank status
276         return space.machine().first_screen()->vblank() ? 0x80 : 0x00;
277
278      case 0xc5:   // CPU 1/2 MHz status?
279         return 0x00;
280         
281      default:
282         printf("io2_r @ unknown %x\n", offset);
283         break;
284   }
285
286   return 0xff;
287}
288
289void laser3k_state::plot_text_character(bitmap_ind16 &bitmap, int xpos, int ypos, int xscale, UINT32 code,
290   const UINT8 *textgfx_data, UINT32 textgfx_datalen)
291{
292   int x, y, i;
293   int fg = 15;
294   int bg = m_bg_color;
295   const UINT8 *chardata;
296   UINT16 color;
297
298   /* look up the character data */
299   chardata = &textgfx_data[(code * 8) % textgfx_datalen];
300
301   if (m_flash && (code >= 0x40) && (code <= 0x7f))
302   {
303      /* we're flashing; swap */
304      i = fg;
305      fg = bg;
306      bg = i;
307   }
308
309   for (y = 0; y < 8; y++)
310   {
311      for (x = 0; x < 7; x++)
312      {
313         color = (chardata[y] & (1 << (6-x))) ? fg : bg;
314
315         for (i = 0; i < xscale; i++)
316         {
317            bitmap.pix16(ypos + y, xpos + (x * xscale) + i) = color;
318         }
319      }
320   }
321}
322
323UINT32 laser3k_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
324{
325   int row, col;
326   UINT32 start_address = (m_disp_page == 0) ? 0x400 : 0x800;
327   UINT32 address;
328   UINT8 *m_a2_videoram = m_ram->pointer();
329   int beginrow = 0, endrow = 191;
330
331   m_flash = ((machine().time() * 4).seconds & 1) ? 1 : 0;
332
333   beginrow = MAX(beginrow, cliprect.min_y - (cliprect.min_y % 8));
334   endrow = MIN(endrow, cliprect.max_y - (cliprect.max_y % 8) + 7);
335
336   for (row = beginrow; row <= endrow; row += 8)
337   {
338      for (col = 0; col < 40; col++)
339      {
340         /* calculate address */
341         address = start_address + ((((row/8) & 0x07) << 7) | (((row/8) & 0x18) * 5 + col));
342
343         plot_text_character(bitmap, col * 14, row, 2, m_a2_videoram[address],
344            memregion("gfx1")->base(), memregion("gfx1")->bytes());
345      }
346   }
347
348   return 0;
349}
350
351/***************************************************************************
352    INPUT PORTS
353***************************************************************************/
354
355static INPUT_PORTS_START( laser3k )
356   PORT_START("X0")
357   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3)  PORT_CHAR('3') PORT_CHAR('#')
358   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4)  PORT_CHAR('4') PORT_CHAR('$')
359   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5)  PORT_CHAR('5') PORT_CHAR('%')
360   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6)  PORT_CHAR('6') PORT_CHAR('&')
361   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7)  PORT_CHAR('7') PORT_CHAR('\'')
362   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8)  PORT_CHAR('8') PORT_CHAR('(')
363   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9)  PORT_CHAR('9') PORT_CHAR(')')
364   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0)      PORT_CHAR('0') PORT_CHAR(')')
365   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON)      PORT_CHAR(';') PORT_CHAR(':')
366   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS)  PORT_CHAR('-') PORT_CHAR('_')
367
368   PORT_START("X1")
369   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q)  PORT_CHAR('Q') PORT_CHAR('q')
370   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W)  PORT_CHAR('W') PORT_CHAR('w')
371   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E)  PORT_CHAR('E') PORT_CHAR('e')
372   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R)  PORT_CHAR('R') PORT_CHAR('r')
373   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T)  PORT_CHAR('T') PORT_CHAR('t')
374   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y)  PORT_CHAR('Y') PORT_CHAR('y')
375   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U)  PORT_CHAR('U') PORT_CHAR('u')
376   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I)  PORT_CHAR('I') PORT_CHAR('i')
377   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O)  PORT_CHAR('O') PORT_CHAR('o')
378   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P)  PORT_CHAR('P') PORT_CHAR('p')
379
380   PORT_START("X2")
381   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D)  PORT_CHAR('D') PORT_CHAR('d')
382   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F)  PORT_CHAR('F') PORT_CHAR('f')
383   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_G)  PORT_CHAR('G') PORT_CHAR('g')
384   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H)  PORT_CHAR('H') PORT_CHAR('h')
385   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J)  PORT_CHAR('J') PORT_CHAR('j')
386   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_K)  PORT_CHAR('K') PORT_CHAR('k')
387   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L)  PORT_CHAR('L') PORT_CHAR('l')
388   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS)     PORT_CHAR('=') PORT_CHAR('+')
389   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT)      PORT_CODE(KEYCODE_LEFT)
390   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT)     PORT_CODE(KEYCODE_RIGHT)
391
392   PORT_START("X3")
393   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z)  PORT_CHAR('Z') PORT_CHAR('z')
394   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X)  PORT_CHAR('X') PORT_CHAR('x')
395   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C)  PORT_CHAR('C') PORT_CHAR('c')
396   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V)  PORT_CHAR('V') PORT_CHAR('v')
397   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_B)          PORT_CHAR('B') PORT_CHAR('b')
398   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_N)  PORT_CHAR('N') PORT_CHAR('n')
399   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_M)  PORT_CHAR('M') PORT_CHAR('m')
400   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA)  PORT_CHAR(',') PORT_CHAR('<')
401   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP)   PORT_CHAR('.') PORT_CHAR('>')
402   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH)  PORT_CHAR('/') PORT_CHAR('?')
403
404   PORT_START("X4")
405   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S)  PORT_CHAR('S') PORT_CHAR('s')
406   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2)  PORT_CHAR('2') PORT_CHAR('\"')
407   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1)      PORT_CHAR('1') PORT_CHAR('!')
408   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc")      PORT_CODE(KEYCODE_ESC)      PORT_CHAR(27)
409   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_A)          PORT_CHAR('A') PORT_CHAR('a')
410   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE)  PORT_CHAR(' ')
411   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
412   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
413   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
414   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Return")   PORT_CODE(KEYCODE_ENTER)    PORT_CHAR(13)
415
416   PORT_START("X5")
417   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
418   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
419   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
420   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
421   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
422   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
423   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
424   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
425   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
426   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
427
428   PORT_START("X6")
429   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
430   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
431   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
432   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
433   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
434   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
435   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
436   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
437   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
438   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
439
440   PORT_START("X7")
441   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
442   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
443   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
444   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
445   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
446   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
447   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
448   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
449   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
450   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
451
452   PORT_START("X8")
453   PORT_BIT(0x001, IP_ACTIVE_HIGH, IPT_UNUSED)
454   PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_UNUSED)
455   PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_UNUSED)
456   PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_UNUSED)
457   PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_UNUSED)
458   PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_UNUSED)
459   PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_UNUSED)
460   PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_UNUSED)
461   PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_UNUSED)
462   PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_UNUSED)
463
464   PORT_START("keyb_special")
465   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED)
466   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Left Shift")   PORT_CODE(KEYCODE_LSHIFT)   PORT_CHAR(UCHAR_SHIFT_1)
467   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Right Shift")  PORT_CODE(KEYCODE_RSHIFT)   PORT_CHAR(UCHAR_SHIFT_1)
468   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Control")      PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2)
469   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED)
470   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED)
471   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET")        PORT_CODE(KEYCODE_F12)
472INPUT_PORTS_END
473
474// this is an apple II palette; it seems more likely the
475// actual laser3000 has a digital RGB palette...
476static const rgb_t laser3k_palette[] =
477{
478   rgb_t::black,
479   rgb_t(0xE3, 0x1E, 0x60), /* Dark Red */
480   rgb_t(0x60, 0x4E, 0xBD), /* Dark Blue */
481   rgb_t(0xFF, 0x44, 0xFD), /* Purple */
482   rgb_t(0x00, 0xA3, 0x60), /* Dark Green */
483   rgb_t(0x9C, 0x9C, 0x9C), /* Dark Gray */
484   rgb_t(0x14, 0xCF, 0xFD), /* Medium Blue */
485   rgb_t(0xD0, 0xC3, 0xFF), /* Light Blue */
486   rgb_t(0x60, 0x72, 0x03), /* Brown */
487   rgb_t(0xFF, 0x6A, 0x3C), /* Orange */
488   rgb_t(0x9C, 0x9C, 0x9C), /* Light Grey */
489   rgb_t(0xFF, 0xA0, 0xD0), /* Pink */
490   rgb_t(0x14, 0xF5, 0x3C), /* Light Green */
491   rgb_t(0xD0, 0xDD, 0x8D), /* Yellow */
492   rgb_t(0x72, 0xFF, 0xD0), /* Aquamarine */
493   rgb_t(0xFF, 0xFF, 0xFF)  /* White */
494};
495
496/* Initialize the palette */
497PALETTE_INIT_MEMBER(laser3k_state, laser3k)
498{
499   palette.set_pen_colors(0, laser3k_palette, ARRAY_LENGTH(laser3k_palette));
500}
501
502static MACHINE_CONFIG_START( laser3k, laser3k_state )
503   /* basic machine hardware */
504   MCFG_CPU_ADD("maincpu", M6502, 1021800)
505   MCFG_CPU_PROGRAM_MAP(laser3k_map)
506
507   MCFG_SCREEN_ADD("screen", RASTER)
508   MCFG_SCREEN_REFRESH_RATE(50)
509   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
510   MCFG_SCREEN_SIZE(300*2, 192)
511   MCFG_SCREEN_VISIBLE_AREA(0, (280*2)-1,0,192-1)
512   MCFG_SCREEN_UPDATE_DRIVER(laser3k_state, screen_update)
513   MCFG_SCREEN_PALETTE("palette")
514
515   MCFG_PALETTE_ADD("palette", ARRAY_LENGTH(laser3k_palette))
516   MCFG_PALETTE_INIT_OWNER(laser3k_state, laser3k)
517
518   /* memory banking */
519   MCFG_DEVICE_ADD("bank0", ADDRESS_MAP_BANK, 0)
520   MCFG_DEVICE_PROGRAM_MAP(banks_map)
521   MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
522   MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
523   MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
524   MCFG_DEVICE_ADD("bank1", ADDRESS_MAP_BANK, 0)
525   MCFG_DEVICE_PROGRAM_MAP(banks_map)
526   MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
527   MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
528   MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
529   MCFG_DEVICE_ADD("bank2", ADDRESS_MAP_BANK, 0)
530   MCFG_DEVICE_PROGRAM_MAP(banks_map)
531   MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
532   MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
533   MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
534   MCFG_DEVICE_ADD("bank3", ADDRESS_MAP_BANK, 0)
535   MCFG_DEVICE_PROGRAM_MAP(banks_map)
536   MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_LITTLE)
537   MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8)
538   MCFG_ADDRESS_MAP_BANK_STRIDE(0x4000)
539
540   MCFG_RAM_ADD("mainram")
541   MCFG_RAM_DEFAULT_SIZE("192K")
542
543   /* sound hardware */
544   MCFG_SPEAKER_STANDARD_MONO("mono")
545   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
546   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
547   MCFG_SOUND_ADD("sn76489", SN76489, 1020484)
548   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
549MACHINE_CONFIG_END
550
551ROM_START(las3000)
552   ROM_REGION(0x0800,"gfx1",0)
553   ROM_LOAD ( "341-0036.chr", 0x0000, 0x0800, CRC(64f415c6) SHA1(f9d312f128c9557d9d6ac03bfad6c3ddf83e5659))
554
555   ROM_REGION(0x8000, "maincpu", 0)
556   ROM_LOAD ( "las3000.rom", 0x0000, 0x8000, CRC(9C7AEB09) SHA1(3302ADF41E258CF50210C19736948C8FA65E91DE))
557
558   ROM_REGION(0x100, "fdc", 0)
559   ROM_LOAD ( "l3kdisk.rom", 0x0000, 0x0100, CRC(2D4B1584) SHA1(989780B77E100598124DF7B72663E5A31A3339C0))
560ROM_END
561
562/*    YEAR  NAME      PARENT    COMPAT    MACHINE      INPUT     INIT      COMPANY          FULLNAME */
563COMP( 1983, las3000,  0,        0,        laser3k,     laser3k, driver_device,  0,        "Video Technology",  "Laser 3000",    GAME_NOT_WORKING )
Property changes on: trunk/src/mess/drivers/laser3k.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/mess/mess.mak
r31597r31598
130130CPUS += IE15
131131CPUS += 8X300
132132CPUS += ALTO2
133#CPUS += W65816
133134
134135#-------------------------------------------------
135136# specify available sound cores; some of these are
r31597r31598
20222023   $(MESS_DRIVERS)/prestige.o  \
20232024   $(MESS_DRIVERS)/pitagjr.o  \
20242025   $(MESS_DRIVERS)/geniusiq.o  \
2026   $(MESS_DRIVERS)/laser3k.o   \
20252027
20262028$(MESSOBJ)/wang.a:              \
20272029   $(MESS_DRIVERS)/wangpc.o    \

Previous 199869 Revisions Next


© 1997-2024 The MAME Team