Previous 199869 Revisions Next

r26737 Tuesday 24th December, 2013 at 07:24:51 UTC by Miodrag Milanović
Cleanups and version bump
[hash]gp32.xml pet_hdd.xml
[src]version.c
[src/build]makedep.c
[src/emu]diimage.c diserial.h
[src/emu/bus/a2bus]a2alfam2.c
[src/emu/bus/abcbus]lux21046.c lux21056.c
[src/emu/bus/adamnet]fdc.c
[src/emu/bus/c64]pagefox.c
[src/emu/bus/pc_kbd]iskr1030.c
[src/emu/bus/plus4]std.h
[src/emu/bus/vic10]std.h
[src/emu/cpu]cpu.mak
[src/emu/cpu/8x300]8x300.c 8x300.h 8x300dasm.c
[src/emu/cpu/t11]t11.c
[src/emu/cpu/tms57002]tms57002.c
[src/emu/cpu/z8]z8.c
[src/emu/machine]mc2661.c netlist.c netlist.h nscsi_cb.c nscsi_s1410.c nscsi_s1410.h t10mmc.c t10sbc.c tmp68301.c tmp68301.h upd4992.c upd4992.h z80dart.c z80dma.c
[src/emu/netlist]nl_base.c nl_base.h nl_config.h nl_lists.h nl_parser.c nl_parser.h nl_setup.c nl_setup.h nl_time.h nl_util.h pstate.c pstate.h pstring.c pstring.h
[src/emu/netlist/devices]net_lib.c net_lib.h nld_7400.h nld_7402.h nld_7404.c nld_7404.h nld_7410.h nld_7420.h nld_7425.h nld_7427.h nld_7430.h nld_7474.c nld_7474.h nld_7483.c nld_7483.h nld_7486.c nld_7486.h nld_7490.c nld_7490.h nld_7493.c nld_7493.h nld_9316.c nld_9316.h nld_legacy.c nld_legacy.h nld_log.c nld_log.h nld_ne555.c nld_ne555.h nld_signal.h nld_solver.c nld_solver.h nld_system.c nld_system.h nld_twoterm.c nld_twoterm.h
[src/emu/sound]discrete.c discrete.h es5506.c es5506.h k054539.c k054539.h k056800.c k056800.h mpeg_audio.c nes_apu.h sn76477.c sn76477.h speaker.h wave.h ymz770.c
[src/emu/video]fixfreq.c mb_vcu.c v9938.c
[src/lib/formats]abc800_dsk.c adam_dsk.c itt3030_dsk.c
[src/mame]mame.lst
[src/mame/audio]taito_en.c taito_en.h
[src/mame/drivers]1942.c 2mindril.c acefruit.c arachnid.c arcadia.c aristmk4.c atari_s1.c atarig42.c bfm_sc4h.c capbowl.c cham24.c cinemat.c csplayh5.c deco_ld.c exidy440.c famibox.c galaxold.c ghosteo.c harddriv.c hng64.c hornet.c konamigq.c konendev.c lbeach.c legionna.c lethal.c maygayv1.c mcr3.c meritm.c midyunit.c midzeus.c multigam.c mw18w.c naomi.c peplus.c pgm.c pinkiri8.c plygonet.c pong.c qdrmfgp.c rungun.c sangho.c seta.c superchs.c toaplan2.c twinkle.c ultrsprt.c vegas.c zr107.c
[src/mame/includes]40love.h astrocde.h bfm_sc45.h bfm_sc5.h harddriv.h maygay1b.h namcos1.h pgm.h plygonet.h rungun.h stv.h vsnes.h
[src/mame/machine]asic65.c asic65.h harddriv.c igs025.c k573npu.c pgmprot_igs027a_type3.c pgmprot_orlegend.c seicop.c seicop.h zs01.h
[src/mame/video]1942.c hng64.c tia.c
[src/mess]mess.lst
[src/mess/drivers]a7800.c apple2gs.c atari400.c bullet.c c80.c cbm2.c ec184x.c esqasr.c esqkt.c ht68k.c isbc.c iskr103x.c itt3030.c mc1502.c mkit09.c myvision.c next.c pc.c poisk1.c prof80.c rainbow.c sh4robot.c tiki100.c v1050.c v6809.c wicat.c xavix.c xerox820.c
[src/mess/includes]mc1502.h poisk1.h prof80.h
[src/mess/layout]rainbow.lay
[src/mess/machine]dec_lk201.c kb_poisk1.h mb8795.c mc1502_fdc.c nes_mmc5.c p1_fdc.c p1_hdc.c prof80mmu.c prof80mmu.h xsu_cards.c
[src/mess/video]isa_cga.c isa_cga.h pc_t1t.h poisk1.c vtvideo.c
[src/osd/windows]drawd3d.c vconv.c window.c
[src/tools]jedutil.c nltool.c romcmp.c

trunk/hash/pet_hdd.xml
r26736r26737
2727         </diskarea>
2828      </part>
2929   </software>
30   
30
3131</softwarelist>
trunk/hash/gp32.xml
r26736r26737
1111
1212* 강행돌파 [same as herknite?!?]
1313
14* Tears - Another Story added (not 100% verified whether it is a final version or not)
14* Tears - Another Story added (not 100% verified whether it is a final version or not)
1515
1616It is recommended to use the firmware 1.6.6 as default BIOS!
1717
r26736r26737
409409         </dataarea>
410410      </part>
411411   </software>
412   
412
413413   <software name="pinbdrea">
414414      <description>Pinball Dreams (Eur)</description>
415415      <year>2002</year>
r26736r26737
421421         </dataarea>
422422      </part>
423423   </software>
424   
424
425425   <software name="sobemons">
426426      <description>Story of Bug eyed Monster (Kor)</description>
427427      <year>2003</year>
r26736r26737
444444            <rom name="winter is.smc" size="69207040" crc="62c4a3fb" sha1="cf072fae0825164ff8c7393ab513058b78c46061" offset="0" />
445445         </dataarea>
446446      </part>
447   </software>   
448   
447   </software>
448
449449   <software name="suplusha">
450450      <description>Super Plusha (Eur)</description>
451451      <year>2002</year>
r26736r26737
456456            <rom name="super plusha.smc" size="17302528" crc="65da87fc" sha1="1e2e984014f184759a35df93160f0fb4d11c7742" offset="0" />
457457         </dataarea>
458458      </part>
459   </software>   
459   </software>
460460
461461   <software name="talowila">
462462      <description>Tales of Windy Land (Kor)</description>
r26736r26737
468468            <rom name="tales of windy land.smc" size="17302528" crc="83b9c315" sha1="51679a8197f721fc601ea0cd8c91a3bbabed9585" offset="0" />
469469         </dataarea>
470470      </part>
471   </software>   
471   </software>
472472
473473   <software name="totogogo">
474474      <description>Topy Topy Gogo (Eur)</description>
r26736r26737
480480            <rom name="topy topy gogo.smc" size="17302528" crc="9a5faa26" sha1="46e1f08ec260a633e8e4c44b3b46b5135e6c76a6" offset="0" />
481481         </dataarea>
482482      </part>
483   </software>   
484   
483   </software>
484
485485      <software name="tearsast">
486486      <description>Tears - Another Story (Kor)</description>
487487      <year>2003</year>
r26736r26737
493493         </dataarea>
494494      </part>
495495   </software>
496   
496
497497</softwarelist>
trunk/src/mame/machine/k573npu.c
r26736r26737
4848  Notes: (all IC's shown)
4949        TMPR3927 - Toshiba TMPR3927CF Risc Microprocessor (QFP240)
5050        FLASH    - Fujitsu 29F400TC Flash ROM (TSOP48)
51        IDE44    - IDE44 44-pin laptop type HDD connector. The Hard Drive connected is a
51        IDE44    - IDE44 44-pin laptop type HDD connector. The Hard Drive connected is a
5252                   2.5" Fujitsu MHR2010AT 10GB HDD with Konami sticker C07JAA03
5353        48LC4M16 - Micron Technology 48LC4M16 4M x16-bit SDRAM (TSSOP54)
5454        XC9572XL - XILINX XC9572XL In-system Programmable CPLD stamped 'UC07A1' (TQFP100)
r26736r26737
5757        93LC46   - 128 bytes x8-bit EEPROM (SOIC8)
5858        MB3793   - Fujitsu MB3793 Power-Voltage Monitoring IC with Watchdog Timer (SOIC8)
5959        PE68515L - Pulse PE-68515L 10/100 Base-T Single Port Transformer Module
60        DP83815  - National Semiconductor DP83815 10/100 Mb/s Integrated PCI Ethernet Media
60        DP83815  - National Semiconductor DP83815 10/100 Mb/s Integrated PCI Ethernet Media
6161                   Access Controller and Physical Layer (TQFP144)
6262        SP232    - Sipex Corporation SP232 Enhanced RS-232 Line Drivers/Receiver (SOIC16)
6363        RJ45     - RJ45 network connector
r26736r26737
8282
8383ROM_START( k573npu )
8484   ROM_REGION( 0x080000, "tmpr3927", 0 )
85   ROM_LOAD( "29f400.24e",   0x000000, 0x080000, CRC(8dcf294b) SHA1(efac79e18db22c30886463ec1bc448187da7a95a) )
85   ROM_LOAD( "29f400.24e",   0x000000, 0x080000, CRC(8dcf294b) SHA1(efac79e18db22c30886463ec1bc448187da7a95a) )
8686ROM_END
8787
8888const rom_entry *k573npu_device::device_rom_region() const
trunk/src/mame/machine/zs01.h
r26736r26737
1515#include "machine/ds2401.h"
1616
1717#define MCFG_ZS01_ADD( _tag ) \
18   MCFG_DEVICE_ADD( _tag, ZS01, 0 ) \
19
18   MCFG_DEVICE_ADD( _tag, ZS01, 0 )
2019#define MCFG_ZS01_DS2401( ds2401_tag ) \
2120   zs01_device::static_set_ds2401_tag( *device, ds2401_tag );
2221
trunk/src/mame/machine/igs025.c
r26736r26737
273273
274274      case 0x05:
275275      {
276                switch (m_kb_ptr)
277                {
278                case 1:
279                   return 0x3f00 | ((m_kb_game_id >> 0) & 0xff);
276                  switch (m_kb_ptr)
277                  {
278                  case 1:
279                     return 0x3f00 | ((m_kb_game_id >> 0) & 0xff);
280280
281                case 2:
282                   return 0x3f00 | ((m_kb_game_id >> 8) & 0xff);
281                  case 2:
282                     return 0x3f00 | ((m_kb_game_id >> 8) & 0xff);
283283
284                case 3:
285                   return 0x3f00 | ((m_kb_game_id >> 16) & 0xff);
284                  case 3:
285                     return 0x3f00 | ((m_kb_game_id >> 16) & 0xff);
286286
287                case 4:
288                   return 0x3f00 | ((m_kb_game_id >> 24) & 0xff);
287                  case 4:
288                     return 0x3f00 | ((m_kb_game_id >> 24) & 0xff);
289289
290                default: // >= 5
291                   return 0x3f00 | BITSWAP8(m_kb_prot_hold, 5, 2, 9, 7, 10, 13, 12, 15);
292                }
290                  default: // >= 5
291                     return 0x3f00 | BITSWAP8(m_kb_prot_hold, 5, 2, 9, 7, 10, 13, 12, 15);
292                  }
293293
294                return 0x3f00;
295                //return 0;
294                  return 0x3f00;
295                  //return 0;
296296      }
297297
298298      case 0x40:
trunk/src/mame/machine/pgmprot_orlegend.c
r26736r26737
8181      case 0x33: return 0x49;
8282      case 0x34: return 0x32;
8383
84   //   default:
85   //       logerror("ASIC3 R: CMD %2.2X PC: %6.6x\n", m_asic3_reg, space.device().safe_pc());
84   //  default:
85   //       logerror("ASIC3 R: CMD %2.2X PC: %6.6x\n", m_asic3_reg, space.device().safe_pc());
8686   }
8787
8888   return 0;
r26736r26737
103103         m_asic3_latch[m_asic3_reg] = data << 1;
104104      break;
105105
106   //   case 0x03: // move.w  #$88, $c0400e.l
107   //   case 0x04: // move.w  #$84, $c0400e.l
108   //   case 0x05: // move.w  #$A0, $c0400e.l
109   //   break;
106   //  case 0x03: // move.w  #$88, $c0400e.l
107   //  case 0x04: // move.w  #$84, $c0400e.l
108   //  case 0x05: // move.w  #$A0, $c0400e.l
109   //  break;
110110
111111      case 0x40:
112112         m_asic3_hilo = (m_asic3_hilo << 8) | data;
r26736r26737
131131      }
132132      break;
133133
134   //   case 0x50: // move.w  #$50, $c0400e.l
135   //   break;
134   //  case 0x50: // move.w  #$50, $c0400e.l
135   //  break;
136136
137137      case 0x80:
138138      case 0x81:
r26736r26737
150150      break;
151151
152152      default:
153          logerror("ASIC3 W: CMD %2.2X DATA: %4.4x, PC: %6.6x\n", m_asic3_reg, data, space.device().safe_pc());
153            logerror("ASIC3 W: CMD %2.2X DATA: %4.4x, PC: %6.6x\n", m_asic3_reg, data, space.device().safe_pc());
154154   }
155155}
156156
trunk/src/mame/machine/harddriv.c
r26736r26737
322322{
323323   static const char *const adc8names[] = { "8BADC0", "8BADC1", "8BADC2", "8BADC3", "8BADC4", "8BADC5", "8BADC6", "8BADC7" };
324324   static const char *const adc12names[] = { "12BADC0", "12BADC1", "12BADC2", "12BADC3" };
325   
325
326326   COMBINE_DATA(&m_adc_control);
327327
328328   /* handle a write to the 8-bit ADC address select */
trunk/src/mame/machine/pgmprot_igs027a_type3.c
r26736r26737
5454READ32_MEMBER(pgm_arm_type3_state::svg_arm7_shareram_r )
5555{
5656   UINT32 retdata = m_svg_shareram[m_svg_ram_sel & 1][offset];
57//   printf("(%08x) ARM7: shared read (bank %02x) offset - %08x retdata - %08x mask - %08x\n", space.device().safe_pc(), m_svg_ram_sel, offset*4, retdata, mem_mask );
57//  printf("(%08x) ARM7: shared read (bank %02x) offset - %08x retdata - %08x mask - %08x\n", space.device().safe_pc(), m_svg_ram_sel, offset*4, retdata, mem_mask );
5858   return retdata;
5959}
6060
6161WRITE32_MEMBER(pgm_arm_type3_state::svg_arm7_shareram_w )
6262{
63//   printf("(%08x) ARM7: shared write (bank %02x) offset - %08x retdata - %08x mask - %08x\n", space.device().safe_pc(), m_svg_ram_sel, offset*4, data, mem_mask );
63//  printf("(%08x) ARM7: shared write (bank %02x) offset - %08x retdata - %08x mask - %08x\n", space.device().safe_pc(), m_svg_ram_sel, offset*4, data, mem_mask );
6464   COMBINE_DATA(&m_svg_shareram[m_svg_ram_sel & 1][offset]);
6565}
6666
r26736r26737
145145   AM_RANGE(0x40000018, 0x4000001b) AM_WRITE(svg_arm7_ram_sel_w) /* RAM SEL */
146146   AM_RANGE(0x50000000, 0x500003ff) AM_RAM
147147
148//   AM_RANGE(0xc0000000, 0xffffffff) AM_RAM
148//  AM_RANGE(0xc0000000, 0xffffffff) AM_RAM
149149
150150ADDRESS_MAP_END
151151
r26736r26737
169169      int regionhack = ioport("RegionHack")->read();
170170      if (regionhack != 0xff)
171171      {
172//         printf("%04x\n", temp16[(base) / 2]);
172//          printf("%04x\n", temp16[(base) / 2]);
173173         temp16[(base) / 2] = regionhack; base += 2;
174174      }
175175   }
r26736r26737
260260{
261261   int pc = space.device().safe_pc();
262262   if (pc == 0x9e0) space.device().execute().eat_cycles(500);
263//   else printf("killbldp_speedup_r %08x\n", pc);
263//  else printf("killbldp_speedup_r %08x\n", pc);
264264   return m_armrom[0x9e0/4];
265265}
266266
r26736r26737
376376   temp16[(base) /2] = 0xE080; base += 2;
377377   temp16[(base) /2] = 0x6000; base += 2;
378378   temp16[(base) /2] = 0xE587; base += 2;
379   
379
380380   // set the SR13 to something sensible
381381   temp16[(base) /2] = 0x00D3; base += 2;
382382   temp16[(base) /2] = 0xE3A0; base += 2;
r26736r26737
410410      base = 0x154;
411411
412412      // this actually makes matters worse here
413//      temp16[(base) / 2] = 0x1010; base += 2;
414//      temp16[(base) / 2] = 0xe59f; base += 2;
415//      temp16[(base) / 2] = 0x0001; base += 2;
416//      temp16[(base) / 2] = 0xe3a0; base += 2;
417//      temp16[(base) / 2] = 0x0000; base += 2;
418//      temp16[(base) / 2] = 0xe581; base += 2;
413//      temp16[(base) / 2] = 0x1010; base += 2;
414//      temp16[(base) / 2] = 0xe59f; base += 2;
415//      temp16[(base) / 2] = 0x0001; base += 2;
416//      temp16[(base) / 2] = 0xe3a0; base += 2;
417//      temp16[(base) / 2] = 0x0000; base += 2;
418//      temp16[(base) / 2] = 0xe581; base += 2;
419419
420420      temp16[(base) / 2] = 0xf000; base += 2;
421421      temp16[(base) / 2] = 0xe59f; base += 2;
r26736r26737
424424      temp16[(base) / 2] = 0x0028; base += 2;
425425      temp16[(base) / 2] = 0x0800; base += 2;
426426
427//      temp16[(base) / 2] = 0x003c; base += 2;
428//      temp16[(base) / 2] = 0x1000; base += 2;
427//      temp16[(base) / 2] = 0x003c; base += 2;
428//      temp16[(base) / 2] = 0x1000; base += 2;
429429
430430   }
431431
432   
432
433433   base = 0;
434434   temp16[(base) /2] = 0x000a; base += 2;
435435   temp16[(base) /2] = 0xEA00; base += 2;
r26736r26737
459459   temp16[(base) /2] = 0xFF1E; base += 2;
460460   temp16[(base) /2] = 0xE12F; base += 2;
461461
462//   base = 0xfc; // already at 0xfc
462//  base = 0xfc; // already at 0xfc
463463   temp16[(base) /2] = 0xE004; base += 2; // based on killbldp
464464   temp16[(base) /2] = 0xE52D; base += 2;
465465   temp16[(base) /2] = 0x0013; base += 2;
r26736r26737
471471   temp16[(base) /2] = 0xFF1E; base += 2;
472472   temp16[(base) /2] = 0xE12F; base += 2;
473473
474//   base = 0x110; // already at 0x110
475//   temp16[(base) /2] = 0xff1e; base += 2;
476//   temp16[(base) /2] = 0xe12f; base += 2;
477//   temp16[(base) /2] = 0xf302; base += 2;
478//   temp16[(base) /2] = 0xe3a0; base += 2;
474//  base = 0x110; // already at 0x110
475//  temp16[(base) /2] = 0xff1e; base += 2;
476//  temp16[(base) /2] = 0xe12f; base += 2;
477//  temp16[(base) /2] = 0xf302; base += 2;
478//  temp16[(base) /2] = 0xe3a0; base += 2;
479479   // set up stack again, soft-reset reset with a ram variable set to 0
480480   temp16[(base) /2] = 0x00D1; base += 2;
481481   temp16[(base) /2] = 0xE3A0; base += 2;
r26736r26737
499499   temp16[(base) /2] = 0xE3A0; base += 2;
500500
501501
502   
503502
503
504504   base = 0x150;
505505   temp16[(base) /2] = 0xff1e; base += 2;
506506   temp16[(base) /2] = 0xe12f; base += 2;
r26736r26737
517517   svg_basic_init();
518518   pgm_theglad_decrypt(machine());
519519   svg_latch_init();
520//   pgm_create_dummy_internal_arm_region(0x188);
520//  pgm_create_dummy_internal_arm_region(0x188);
521521
522522   pgm_create_dummy_internal_arm_region_theglad(0);
523   
524523
524
525525   machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::theglad_speedup_r),this));
526526}
527527
r26736r26737
606606
607607   for (int i = 0; i < 131; i++)
608608   {
609//      UINT32 addr = extprot[(base/2)] | (extprot[(base/2) + 1] << 16);
609//      UINT32 addr = extprot[(base/2)] | (extprot[(base/2) + 1] << 16);
610610      extprot[(base / 2)] = subroutine_addresses[i];
611611
612612      base += 4;
613//      printf("%04x (%08x)\n", subroutine_addresses[i], addr );
613//      printf("%04x (%08x)\n", subroutine_addresses[i], addr );
614614   }
615615}
616616
r26736r26737
619619   DRIVER_INIT_CALL(theglad);
620620
621621   pgm_patch_external_arm_rom_jumptable_theglada(0x82078);
622   
622
623623}
624624
625625INPUT_PORTS_START( theglad )
r26736r26737
692692
693693   machine().device("prot")->memory().space(AS_PROGRAM).install_read_handler(0x1000000c, 0x1000000f, read32_delegate(FUNC(pgm_arm_type3_state::killbldp_speedup_r),this));
694694
695//   UINT16 *temp16 = (UINT16 *)memregion("prot")->base();
696//   int base = 0xfc; // startup table uploads
697//   temp16[(base) /2] = 0x0000; base += 2;   
698//   temp16[(base) /2] = 0xE1A0; base += 2;   
699   
700//   base = 0xd4; // startup table uploads
701//   temp16[(base) /2] = 0x0000; base += 2;   
702//   temp16[(base) /2] = 0xE1A0; base += 2;   
695//  UINT16 *temp16 = (UINT16 *)memregion("prot")->base();
696//  int base = 0xfc; // startup table uploads
697//  temp16[(base) /2] = 0x0000; base += 2;
698//  temp16[(base) /2] = 0xE1A0; base += 2;
699
700//  base = 0xd4; // startup table uploads
701//  temp16[(base) /2] = 0x0000; base += 2;
702//  temp16[(base) /2] = 0xE1A0; base += 2;
703703//
704//   base = 0x120; // reset game state, uncomment this to break boot sequence how theglad was broken...
705//   temp16[(base) /2] = 0x0000; base += 2;   
706//   temp16[(base) /2] = 0xE1A0; base += 2;   
704//  base = 0x120; // reset game state, uncomment this to break boot sequence how theglad was broken...
705//  temp16[(base) /2] = 0x0000; base += 2;
706//  temp16[(base) /2] = 0xE1A0; base += 2;
707707
708708}
709709
r26736r26737
757757{
758758   UINT8* buffer = auto_alloc_array(machine(), UINT8, 0x800000);
759759   int writeaddress = 0;
760   
760
761761   for (int j = 0; j < 0x800; j += 0x200)
762762   {
763763      for (int i = j; i < 0x800000; i += 0x800)
r26736r26737
807807DRIVER_INIT_MEMBER(pgm_arm_type3_state,happy6)
808808{
809809   UINT8 *src;
810   
810
811811   src = (UINT8 *)(machine().root_device().memregion("tiles")->base()) + 0x180000;
812812   pgm_descramble_happy6(src);
813813   pgm_descramble_happy6_2(src);
trunk/src/mame/machine/seicop.c
r26736r26737
16491649   memset(m_cop_dma_size, 0, sizeof(UINT16)*0x200);
16501650   memset(m_cop_dma_dst, 0, sizeof(UINT16)*0x200);
16511651   memset(m_seibu_vregs, 0, sizeof(UINT16)*0x50/2);
1652   
1652
16531653   for (int i = 0; i < 8; i++)
16541654   {
16551655      m_cop_register[i] = 0;
r26736r26737
16731673void seibu_cop_legacy_device::device_start()
16741674{
16751675   m_cop_mcu_ram = reinterpret_cast<UINT16 *>(machine().root_device().memshare("cop_mcu_ram")->ptr());
1676   
1676
16771677   save_item(NAME(m_cop_438));
16781678   save_item(NAME(m_cop_43a));
16791679   save_item(NAME(m_cop_43c));
r26736r26737
22382238WRITE16_MEMBER( seibu_cop_legacy_device::generic_cop_w )
22392239{
22402240   UINT32 temp32;
2241   
2241
22422242   switch (offset)
22432243   {
22442244      default:
trunk/src/mame/machine/seicop.h
r26736r26737
1111      hitbox(0),
1212      hitbox_x(0),
1313      hitbox_y(0) {}
14     
14
1515   int x,y;
1616   INT16 min_x,min_y,max_x,max_y;
1717   UINT16 hitbox;
r26736r26737
4141   DECLARE_READ16_MEMBER( legionna_mcu_r );
4242   DECLARE_WRITE16_MEMBER( legionna_mcu_w );
4343
44   //DECLARE_READ16_MEMBER( raiden2_mcu_r );   unused
45   //DECLARE_WRITE16_MEMBER( raiden2_mcu_w );   unused
44   //DECLARE_READ16_MEMBER( raiden2_mcu_r );   unused
45   //DECLARE_WRITE16_MEMBER( raiden2_mcu_w );  unused
4646
4747protected:
4848   // device-level overrides
r26736r26737
9797extern const device_type SEIBU_COP_LEGACY;
9898
9999#define MCFG_SEIBU_COP_ADD(_tag) \
100   MCFG_DEVICE_ADD(_tag, SEIBU_COP_LEGACY, 0)
100   MCFG_DEVICE_ADD(_tag, SEIBU_COP_LEGACY, 0)
trunk/src/mame/machine/asic65.c
r26736r26737
555555   MCFG_CPU_ADD("asic65cpu", TMS32010, 20000000)
556556   MCFG_CPU_PROGRAM_MAP(asic65_program_map)
557557   MCFG_CPU_IO_MAP(asic65_io_map)
558MACHINE_CONFIG_END
558MACHINE_CONFIG_END
559559
560560//-------------------------------------------------
561561//  machine_config_additions - device-specific
trunk/src/mame/machine/asic65.h
r26736r26737
55 *  Implementation of ASIC65
66 *
77 *************************************/
8 
9 #include "cpu/tms32010/tms32010.h"
10 
11 enum {
8
9   #include "cpu/tms32010/tms32010.h"
10
11   enum {
1212   ASIC65_STANDARD,
1313   ASIC65_STEELTAL,
1414   ASIC65_GUARDIANS,
r26736r26737
1919{
2020public:
2121   asic65_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22   
22
2323   // (static) configuration helpers
2424   static void set_type(device_t &device, int type) { downcast<asic65_device &>(device).m_asic65_type = type; }
2525
r26736r26737
2727   DECLARE_WRITE16_MEMBER( data_w );
2828   DECLARE_READ16_MEMBER( read );
2929   DECLARE_READ16_MEMBER( io_r );
30   
30
3131   TIMER_CALLBACK_MEMBER( m68k_asic65_deferred_w );
3232   WRITE16_MEMBER( m68k_w );
3333   READ16_MEMBER( m68k_r );
3434   WRITE16_MEMBER( stat_w );
3535   READ16_MEMBER( stat_r );
3636   READ16_MEMBER( get_bio );
37   
37
3838   enum
3939   {
4040      TIMER_M68K_ASIC65_DEFERRED_W
trunk/src/mame/includes/harddriv.h
r26736r26737
292292   required_device<duartn68681_device> m_duart;
293293   optional_device<asic65_device> m_asic65;
294294   DECLARE_WRITE_LINE_MEMBER(harddriv_duart_irq_handler);
295   
295
296296   /*----------- defined in audio/harddriv.c -----------*/
297297
298298   void hdsnd_init();
299   
299
300300   /*----------- defined in machine/harddriv.c -----------*/
301301
302302   /* Driver/Multisync board */
r26736r26737
329329   DECLARE_WRITE16_MEMBER( hdgsp_io_w );
330330
331331   DECLARE_WRITE16_MEMBER( hdgsp_protection_w );
332   
332
333333   /* ADSP board */
334334   DECLARE_READ16_MEMBER( hd68k_adsp_program_r );
335335   DECLARE_WRITE16_MEMBER( hd68k_adsp_program_w );
r26736r26737
346346
347347   DECLARE_READ16_MEMBER( hdadsp_special_r );
348348   DECLARE_WRITE16_MEMBER( hdadsp_special_w );
349   
349
350350   /* DS III/IV board */
351351   void update_ds3_irq();
352352   void update_ds3_sirq();
353   
353
354354   DECLARE_WRITE16_MEMBER( hd68k_ds3_control_w );
355355   DECLARE_READ16_MEMBER( hd68k_ds3_girq_state_r );
356356
r26736r26737
377377   DECLARE_WRITE16_MEMBER( hdds3_sdsp_control_w );
378378   DECLARE_READ16_MEMBER( hdds3_xdsp_control_r );
379379   DECLARE_WRITE16_MEMBER( hdds3_xdsp_control_w );
380   
380
381381   /* DSK board */
382382   DECLARE_WRITE16_MEMBER( hd68k_dsk_control_w );
383383   DECLARE_READ16_MEMBER( hd68k_dsk_ram_r );
r26736r26737
418418   /* ADSP optimizations */
419419   DECLARE_READ16_MEMBER( hdadsp_speedup_r );
420420   DECLARE_READ16_MEMBER( hdds3_speedup_r );
421   
421
422422   /*----------- defined in video/harddriv.c -----------*/
423423   DECLARE_READ16_MEMBER( hdgsp_control_lo_r );
424424   DECLARE_WRITE16_MEMBER( hdgsp_control_lo_w );
trunk/src/mame/includes/rungun.h
r26736r26737
4646   int         m_sprite_colorbase;
4747
4848   /* sound */
49   UINT8      m_sound_ctrl;
50   UINT8      m_sound_status;
51   UINT8      m_sound_nmi_clk;
49   UINT8       m_sound_ctrl;
50   UINT8       m_sound_status;
51   UINT8       m_sound_nmi_clk;
5252
5353   DECLARE_READ16_MEMBER(rng_sysregs_r);
5454   DECLARE_WRITE16_MEMBER(rng_sysregs_w);
trunk/src/mame/includes/maygay1b.h
r26736r26737
5252   optional_device<roc10937_t> m_vfd;
5353   optional_device<okim6376_device> m_msm6376;
5454   required_device<duartn68681_device> m_duart68681;
55   
55
5656   UINT8 m_lamppos;
5757   int m_alpha_clock;
5858   int m_RAMEN;
trunk/src/mame/includes/pgm.h
r26736r26737
8080   DECLARE_WRITE8_MEMBER(z80_l3_w);
8181   DECLARE_WRITE16_MEMBER(pgm_tx_videoram_w);
8282   DECLARE_WRITE16_MEMBER(pgm_bg_videoram_w);
83   
83
8484   DECLARE_DRIVER_INIT(pgm);
8585
8686   TILE_GET_INFO_MEMBER(get_pgm_tx_tilemap_tile_info);
trunk/src/mame/includes/stv.h
r26736r26737
739739   DECLARE_READ16_MEMBER( adsp_control_r );
740740   DECLARE_WRITE16_MEMBER( adsp_control_w );
741741   DECLARE_WRITE32_MEMBER(batmanfr_sound_comms_w);
742   
742
743743   // protection specific variables and functions (see machine/stvprot.c)
744744   UINT32 m_abus_protenable;
745745   UINT32 m_abus_prot_addr;
r26736r26737
751751   UINT8 m_char_offset; //helper to jump the decoding of the NULL chars.
752752
753753   UINT32 (*m_prot_readback)(address_space&,int,UINT32);
754   
754
755755   DECLARE_READ32_MEMBER( common_prot_r );
756756   DECLARE_WRITE32_MEMBER( common_prot_w );
757     
757
758758   void install_common_protection();
759   
759
760760   void install_twcup98_protection();
761761   void install_sss_protection();
762762   void install_astrass_protection();
763763   void install_rsgun_protection();
764764   void install_elandore_protection();
765765   void install_ffreveng_protection();
766   
767   void stv_register_protection_savestates();   
768   
766
767   void stv_register_protection_savestates();
768
769769   // Decathlete specific variables and functions (see machine/decathlt.c)
770770   UINT32 m_decathlt_protregs[4];
771771   UINT32 m_decathlt_lastcount;
r26736r26737
774774   UINT32 m_decathlt_prot_uploadoffset;
775775   UINT16 m_decathlt_prottable1[24];
776776   UINT16 m_decathlt_prottable2[128];
777   
777
778778   DECLARE_READ32_MEMBER( decathlt_prot_r );
779779   DECLARE_WRITE32_MEMBER( decathlt_prot1_w );
780780   DECLARE_WRITE32_MEMBER( decathlt_prot2_w );
trunk/src/mame/includes/bfm_sc5.h
r26736r26737
2424   DECLARE_READ8_MEMBER( sc5_mux1_r );
2525   DECLARE_WRITE8_MEMBER( sc5_mux1_w );
2626   DECLARE_WRITE8_MEMBER( sc5_mux2_w );
27   
27
2828   DECLARE_WRITE_LINE_MEMBER(bfm_sc5_duart_irq_handler);
2929   DECLARE_WRITE_LINE_MEMBER(bfm_sc5_duart_txa);
3030   DECLARE_READ8_MEMBER(bfm_sc5_duart_input_r);
trunk/src/mame/includes/vsnes.h
r26736r26737
1010      m_subcpu(*this, "sub"),
1111      m_nesapu1(*this, "nesapu1"),
1212      m_nesapu2(*this, "nesapu2"),
13      m_ppu1(*this, "ppu1"),     
14      m_ppu2(*this, "ppu2"),     
13      m_ppu1(*this, "ppu1"),
14      m_ppu2(*this, "ppu2"),
1515      m_work_ram(*this, "work_ram"),
1616      m_work_ram_1(*this, "work_ram_1")
1717      { }
trunk/src/mame/includes/40love.h
r26736r26737
2525   required_shared_ptr<UINT8> m_colorram;
2626   required_shared_ptr<UINT8> m_spriteram2;
2727   optional_shared_ptr<UINT8> m_mcu_ram;
28   
28
2929   /* video-related */
3030   bitmap_ind16    *m_tmp_bitmap1;
3131   bitmap_ind16    *m_tmp_bitmap2;
r26736r26737
114114   void fortyl_plot_pix( int offset );
115115   void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect );
116116   void draw_pixram( bitmap_ind16 &bitmap, const rectangle &cliprect );
117   
117
118118   enum
119119   {
120120      TIMER_NMI_CALLBACK
121121   };
122122
123123protected:
124   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);   
124   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
125125};
trunk/src/mame/includes/plygonet.h
r26736r26737
4646   tilemap_t *m_roz_tilemap;
4747   UINT16 m_ttl_vram[0x800];
4848   UINT16 m_roz_vram[0x800];
49   
49
5050   /* sound */
51   UINT8 m_sound_ctrl;   
51   UINT8 m_sound_ctrl;
5252   UINT8 m_sound_intck;
5353
5454   /* memory buffers */
trunk/src/mame/includes/namcos1.h
r26736r26737
113113   virtual void video_start();
114114   UINT32 screen_update_namcos1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
115115   void screen_eof_namcos1(screen_device &screen, bool state);
116   
117116
117
118118private:
119119   inline void bg_get_info(tile_data &tileinfo,int tile_index,UINT8 *info_vram);
120120   inline void fg_get_info(tile_data &tileinfo,int tile_index,UINT8 *info_vram);
trunk/src/mame/includes/bfm_sc45.h
r26736r26737
103103   DECLARE_WRITE16_MEMBER(sc4_mem_w);
104104
105105   DECLARE_READ16_MEMBER(sc4_cs1_r);
106   
106
107107   DECLARE_WRITE_LINE_MEMBER(bfm_sc4_duart_irq_handler);
108108   DECLARE_WRITE_LINE_MEMBER(bfm_sc4_duart_txa);
109109   DECLARE_READ8_MEMBER(bfm_sc4_duart_input_r);
trunk/src/mame/includes/astrocde.h
r26736r26737
4343   optional_device<astrocade_device> m_astrocade_sound1;
4444   optional_shared_ptr<UINT8> m_videoram;
4545   optional_shared_ptr<UINT8> m_protected_ram;
46   
46
4747   UINT8 m_video_config;
4848   UINT8 m_sparkle[4];
4949   char m_totalword[256];
r26736r26737
152152   void execute_blit(address_space &space);
153153   void init_sparklestar();
154154   virtual void machine_start();
155   
155
156156   /*----------- defined in audio/wow.c -----------*/
157157   DECLARE_READ8_MEMBER( wow_speech_r );
158158   CUSTOM_INPUT_MEMBER( wow_speech_status_r );
159   
159
160160   /*----------- defined in audio/gorf.c -----------*/
161161   DECLARE_READ8_MEMBER( gorf_speech_r );
162162   CUSTOM_INPUT_MEMBER( gorf_speech_status_r );
trunk/src/mame/video/1942.c
r26736r26737
2626
2727void _1942_state::create_palette()
2828{
29
30
3129   const UINT8 *color_prom = memregion("proms")->base();
3230   int i;
3331
r26736r26737
6361   machine().colortable = colortable_alloc(machine(), 0x600);
6462
6563   create_palette();
66   
64
6765   const UINT8 *color_prom = memregion("proms")->base();
6866   int i, colorbase;
6967   color_prom += 3 * 256;
r26736r26737
9795   {
9896      colortable_entry_set_value(machine().colortable, i, i);
9997   }
100     
98
10199}
102100
103101void _1942_state::palette_init_1942p()
104102{
105103   machine().colortable = colortable_alloc(machine(), 0x500);
106   
104
107105   for (int i = 0; i < 0x400; i++)
108106   {
109107      colortable_entry_set_value(machine().colortable, i, i);
r26736r26737
291289      code = (m_spriteram[offs] & 0x7f) + 4 * (m_spriteram[offs + 3] & 0x20)
292290            + 2 * (m_spriteram[offs] & 0x80);
293291      col = m_spriteram[offs + 3] & 0x0f;
294     
295     
292
293
296294      sx = m_spriteram[offs + 2] - 0x10 * (m_spriteram[offs + 3] & 0x10);
297295      sy = m_spriteram[offs + 1];
298296
trunk/src/mame/video/hng64.c
r26736r26737
16371637{
16381638   // rising edge
16391639   //if (state)
1640   //   clear3d();
1640   //  clear3d();
16411641}
16421642
16431643void hng64_state::video_start()
trunk/src/mame/video/tia.c
r26736r26737
5151/********************************************************************
5252Atari 2600 NTSC Palette Notes:
5353
54Palette on a modern flat panel display (LCD, LED, Plasma, etc.)
55appears different from a traditional CRT. The most outstanding
56difference is Hue 1x, the hue begin point. Hue 1x looks very
57'green' (~-60 to -45 degrees - depending on how poor or well it
58handles the signal conversion and its calibration) on a modern
54Palette on a modern flat panel display (LCD, LED, Plasma, etc.)
55appears different from a traditional CRT. The most outstanding
56difference is Hue 1x, the hue begin point. Hue 1x looks very
57'green' (~-60 to -45 degrees - depending on how poor or well it
58handles the signal conversion and its calibration) on a modern
5959flat panel display, as opposed to 'gold' (~-33 degrees) on a CRT.
6060
61The official technical documents: "Television Interface Adaptor
62[TIA] (Model 1A)", "Atari VCS POP Field Service Manual", and
61The official technical documents: "Television Interface Adaptor
62[TIA] (Model 1A)", "Atari VCS POP Field Service Manual", and
6363"Stella Programmer's Guide" stipulate Hue 1x to be gold.
6464
65The system's pot adjustment manually manipulates the degree of
66phase shift, while the system 'warming-up' will automatically
67push whatever degrees has been manually set, higher.  According
68to the Atari VCS POP Field Service Manual and system diagnostic
69and test (color) cart, instructions are provide to set the pot
70adjustment having Hue 1x and Hue 15x (F$) match or within one
65The system's pot adjustment manually manipulates the degree of
66phase shift, while the system 'warming-up' will automatically
67push whatever degrees has been manually set, higher.  According
68to the Atari VCS POP Field Service Manual and system diagnostic
69and test (color) cart, instructions are provide to set the pot
70adjustment having Hue 1x and Hue 15x (F$) match or within one
7171shade of each other, both a 'goldenrod'.
7272
73At power on, the system's phase shift appears as low as ~23
74degrees and after a considerable consistent runtime, can be as
75high as ~28 degrees.
76 
77In general, the low end of ~23 degrees lasts for several seconds,
78whereas higher values such as ~25-27 degrees are the most
79dominant during system run time.  180 degrees colorburst takes
80place at ~25.7 degrees (A near exact match of Hue 1x and 15x -
81To the naked eye they appear to be the same). 
82 
83However, if the system is adjusted within the first several
84minutes of running, the warm up, consistent system run time,
85causes Hue 15x (F$) to become stronger/darker gold (More brown
86then ultimately red-brown); as well as leans Hue 14x (E$) more
87brown than green.  Once achieving a phase shift of 27.7 degrees,
88Hue 14x (E$) and Hue 15x (F$) near-exact match Hue 1x and 2x
89respectively.
90 
91Therefore, an ideal phase shift while accounting for properly
92calibrating a system's color palette within the first several
93minutes of it running via the pot adjustment, the reality of
94shifting while warming up, as well as maintaining differences
95between Hues 1x, 2x and 14x, 15x, would likely fall between 25.7
96and 27.7 degrees.  Phase shifts 26.2 and 26.7 places Hue 15x/F$
97between Hue 1x and Hue 2x, having 26.2 degrees leaning closer to
73At power on, the system's phase shift appears as low as ~23
74degrees and after a considerable consistent runtime, can be as
75high as ~28 degrees.
76
77In general, the low end of ~23 degrees lasts for several seconds,
78whereas higher values such as ~25-27 degrees are the most
79dominant during system run time.  180 degrees colorburst takes
80place at ~25.7 degrees (A near exact match of Hue 1x and 15x -
81To the naked eye they appear to be the same).
82
83However, if the system is adjusted within the first several
84minutes of running, the warm up, consistent system run time,
85causes Hue 15x (F$) to become stronger/darker gold (More brown
86then ultimately red-brown); as well as leans Hue 14x (E$) more
87brown than green.  Once achieving a phase shift of 27.7 degrees,
88Hue 14x (E$) and Hue 15x (F$) near-exact match Hue 1x and 2x
89respectively.
90
91Therefore, an ideal phase shift while accounting for properly
92calibrating a system's color palette within the first several
93minutes of it running via the pot adjustment, the reality of
94shifting while warming up, as well as maintaining differences
95between Hues 1x, 2x and 14x, 15x, would likely fall between 25.7
96and 27.7 degrees.  Phase shifts 26.2 and 26.7 places Hue 15x/F$
97between Hue 1x and Hue 2x, having 26.2 degrees leaning closer to
9898Hue 1x and 26.7 degrees leaning closer to Hue 2x.
99 
100The above notion would also harmonize with what has been
101documented within "Stella Programmer's Guide" for the colors of
1021x, 2x, 14x, 15x on the 2600 and 7800.  1x = Gold, 2x = Orange,
10314x (E$) = Orange-Green. 15x (F$) = Light Orange.  Color
104descriptions are best measured in the middle of the brightness
105scale.  It should be mentioned that Green-Yellow is referenced
106at Hue 13x (D$), nowhere near Hue 1x.  A Green-Yellow Hue 1x is
107how the palette is manipulated and modified (in part) under a
99
100The above notion would also harmonize with what has been
101documented within "Stella Programmer's Guide" for the colors of
1021x, 2x, 14x, 15x on the 2600 and 7800.  1x = Gold, 2x = Orange,
10314x (E$) = Orange-Green. 15x (F$) = Light Orange.  Color
104descriptions are best measured in the middle of the brightness
105scale.  It should be mentioned that Green-Yellow is referenced
106at Hue 13x (D$), nowhere near Hue 1x.  A Green-Yellow Hue 1x is
107how the palette is manipulated and modified (in part) under a
108108modern flat panel display.
109109
110Additionally, the blue to red (And consequently blue to green)
111ratio proportions may appear different on a modern flat panel
112display than a CRT in some instances for the Atari 2600 system. 
113Furthermore, you may have some variation of proportions even
110Additionally, the blue to red (And consequently blue to green)
111ratio proportions may appear different on a modern flat panel
112display than a CRT in some instances for the Atari 2600 system.
113Furthermore, you may have some variation of proportions even
114114within the same display type.
115 
116One side effect of this on the console's palette is that some
117values of red may appear too pinkish - Too much blue to red. 
118This is not the same as a traditional tint-hue control adjustment;
119rather, can be demonstrated by changing the blue ratio values
115
116One side effect of this on the console's palette is that some
117values of red may appear too pinkish - Too much blue to red.
118This is not the same as a traditional tint-hue control adjustment;
119rather, can be demonstrated by changing the blue ratio values
120120via MESS HLSL settings.
121121
122Lastly, the Atari 5200 & 7800 NTSC color palettes hold the same
123hue structure order and have similar appearance differences that
122Lastly, the Atari 5200 & 7800 NTSC color palettes hold the same
123hue structure order and have similar appearance differences that
124124are dependent upon display type.
125125********************************************************************/
126126/*********************************
trunk/src/mame/drivers/meritm.c
r26736r26737
14841484   ROM_RELOAD(                        0x380000, 0x080000)
14851485
14861486   ROM_REGION( 0x000022, "ds1204", 0 )
1487   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
1487   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
14881488ROM_END
14891489
14901490ROM_START( megat2a ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26736r26737
14991499   ROM_RELOAD(                        0x380000, 0x080000)
15001500
15011501   ROM_REGION( 0x000022, "ds1204", 0 )
1502   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
1502   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
15031503ROM_END
15041504
15051505ROM_START( megat2b ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26736r26737
15141514   ROM_RELOAD(                        0x380000, 0x080000)
15151515
15161516   ROM_REGION( 0x000022, "ds1204", 0 )
1517   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
1517   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
15181518ROM_END
15191519
15201520ROM_START( megat2mn ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26736r26737
15291529   ROM_RELOAD(                        0x380000, 0x080000)
15301530
15311531   ROM_REGION( 0x000022, "ds1204", 0 )
1532   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
1532   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
15331533ROM_END
15341534
15351535ROM_START( megat2ca ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26736r26737
15441544   ROM_RELOAD(                        0x380000, 0x080000)
15451545
15461546   ROM_REGION( 0x000022, "ds1204", 0 )
1547   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
1547   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
15481548ROM_END
15491549
15501550ROM_START( megat2caa ) /* Dallas DS1204U-3 security key labeled 9255-10-01-U5-R0 */
r26736r26737
15591559   ROM_RELOAD(                        0x380000, 0x080000)
15601560
15611561   ROM_REGION( 0x000022, "ds1204", 0 )
1562   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
1562   ROM_LOAD( "9255-10-01-u5-r0", 0x000000, 0x000022, BAD_DUMP CRC(b13c68d2) SHA1(99f9584ba005d32ad8abefd64159a8c296dcd580) )
15631563ROM_END
15641564
15651565ROM_START( megat3 ) /* Dallas DS1204V security key at U5 labeled 9255-20-01 U5-RO1 C1995 MII */
trunk/src/mame/drivers/capbowl.c
r26736r26737
9292#include "sound/2203intf.h"
9393#include "sound/dac.h"
9494
95#define MASTER_CLOCK      XTAL_8MHz
95#define MASTER_CLOCK        XTAL_8MHz
9696
9797
9898/*************************************
r26736r26737
370370
371371   MCFG_CPU_ADD("audiocpu", M6809E, MASTER_CLOCK)
372372   MCFG_CPU_PROGRAM_MAP(sound_map)
373//   MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_ASTABLE(100000.0, 100000.0, 0.1e-6) * 15.5) // TODO
373//  MCFG_WATCHDOG_TIME_INIT(PERIOD_OF_555_ASTABLE(100000.0, 100000.0, 0.1e-6) * 15.5) // TODO
374374
375375   MCFG_NVRAM_ADD_RANDOM_FILL("nvram")
376376
trunk/src/mame/drivers/cinemat.c
r26736r26737
631631   PORT_BIT( 0xe000, IP_ACTIVE_LOW, IPT_UNUSED )
632632
633633   PORT_START("SWITCHES")
634   PORT_DIPNAME( 0x03, 0x02, "Time" )      PORT_DIPLOCATION("SW1:!1,!2")
634   PORT_DIPNAME( 0x03, 0x02, "Time" )      PORT_DIPLOCATION("SW1:!1,!2")
635635   PORT_DIPSETTING(    0x00, "0:30/coin" )
636636   PORT_DIPSETTING(    0x02, "1:00/coin" )
637637   PORT_DIPSETTING(    0x01, "1:30/coin" )
638638   PORT_DIPSETTING(    0x03, "2:00/coin" )
639639   PORT_SERVICE_DIPLOC( 0x04, IP_ACTIVE_HIGH, "SW1:!3" )
640   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )   PORT_DIPLOCATION("SW1:!4")
640   PORT_DIPNAME( 0x08, 0x08, DEF_STR( Coinage ) )  PORT_DIPLOCATION("SW1:!4")
641641   PORT_DIPSETTING(    0x00, DEF_STR( 2C_1C ) )
642642   PORT_DIPSETTING(    0x08, DEF_STR( 1C_1C ) )
643643   PORT_DIPUNUSED_DIPLOC( 0x10, IP_ACTIVE_HIGH, "SW1:!5" )
trunk/src/mame/drivers/vegas.c
r26736r26737
16101610   /* unmap everything we know about */
16111611   for (addr = 0; addr < m_dynamic_count; addr++)
16121612      m_maincpu->space(AS_PROGRAM).unmap_readwrite(dynamic[addr].start, dynamic[addr].end);
1613   
1613
16141614   for (l_addr = 0; l_addr < m_legacy_dynamic_count; l_addr++)
16151615      m_maincpu->space(AS_PROGRAM).unmap_readwrite(l_dynamic[l_addr].start, l_dynamic[l_addr].end);
16161616
r26736r26737
17411741      if (!dynamic[addr].write.isnull())
17421742         space.install_write_handler(dynamic[addr].start, dynamic[addr].end, 0, 0, dynamic[addr].write);
17431743   }
1744   
1744
17451745   for (l_addr = 0; l_addr < m_legacy_dynamic_count; l_addr++)
17461746   {
17471747      if (LOG_DYNAMIC) logerror("  installing: %08X-%08X %s,%s\n", l_dynamic[l_addr].start, l_dynamic[l_addr].end, l_dynamic[l_addr].rdname, l_dynamic[l_addr].wrname);
trunk/src/mame/drivers/csplayh5.c
r26736r26737
1111    - Implement DVD routing and YUV decoding;
1212    - game timings seem busted, could be due of missing DVD hook-up
1313    - csplayh1: inputs doesn't work at all, slower than the others too
14   - h8 type is almost likely to be wrong;
14    - h8 type is almost likely to be wrong;
1515
16   DVD Notes:
17   - TMP68301 communicates with h8 via their respective internal serial comms
18   - First command is a "?P<CR>", which, according to the Pioneer V5000 protocol manual
19     is an Active Mode request. Manual is at:
20     http://www.pioneerelectronics.com/ephox/StaticFiles/Manuals/Business/Pio%20V5000-RS232%20-%20CPM.pdf
16    DVD Notes:
17    - TMP68301 communicates with h8 via their respective internal serial comms
18    - First command is a "?P<CR>", which, according to the Pioneer V5000 protocol manual
19      is an Active Mode request. Manual is at:
20      http://www.pioneerelectronics.com/ephox/StaticFiles/Manuals/Business/Pio%20V5000-RS232%20-%20CPM.pdf
2121      After returning a correct status code, tmp68301 sends "FSDVD04.MPG00001<CR>" to serial, probably tries
2222      to playback the file ...
2323
trunk/src/mame/drivers/lbeach.c
r26736r26737
88  16MHz XTAL, M6800 @ 500kHz
99  2x 5101 sram 256x4bit (256 byte) battery backed
1010  4x 4045 sram 1kx4 (2K byte)
11 
11
1212  Game should be in b&w? But then highlighted blocks in testmode
1313  would be invisible.
1414
r26736r26737
129129
130130   m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(lbeach_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 8, 32, 32);
131131   m_fg_tilemap->set_transparent_pen(0);
132   
132
133133   m_screen->register_screen_bitmap(m_colmap_car);
134134}
135135
r26736r26737
151151
152152   m_collision_bg_car = 0;
153153   m_collision_fg_car = 0;
154   
154
155155   for (int y = sprite_y; y < (sprite_y + 16); y++)
156156   {
157157      for (int x = sprite_x; x < (sprite_x + 16) && cliprect.contains(x, y); x++)
r26736r26737
160160         m_collision_fg_car |= (fg_bitmap.pix16(y, x) & m_colmap_car.pix16(y, x) & 1);
161161      }
162162   }
163   
163
164164   // draw fg layer (tiles)
165165   m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
166166
r26736r26737
202202   // d6 and d7 are for collision detection
203203   UINT8 d6 = m_collision_fg_car ? 0x40 : 0;
204204   UINT8 d7 = m_collision_bg_car ? 0x80 : 0;
205   
205
206206   return (ioport("IN2")->read() & 0x3f) | d6 | d7;
207207}
208208
r26736r26737
216216   AM_RANGE(0x8000, 0x8000) AM_WRITEONLY AM_SHARE("scroll_y")
217217   AM_RANGE(0x8001, 0x8001) AM_WRITEONLY AM_SHARE("sprite_x")
218218   AM_RANGE(0x8002, 0x8002) AM_WRITEONLY AM_SHARE("sprite_code")
219//   AM_RANGE(0x8003, 0x8003) AM_WRITENOP // ?
220//   AM_RANGE(0x8004, 0x8004) AM_WRITENOP // ?
221//   AM_RANGE(0x8005, 0x8005) AM_WRITENOP // ?
219//  AM_RANGE(0x8003, 0x8003) AM_WRITENOP // ?
220//  AM_RANGE(0x8004, 0x8004) AM_WRITENOP // ?
221//  AM_RANGE(0x8005, 0x8005) AM_WRITENOP // ?
222222   AM_RANGE(0x8007, 0x8007) AM_WRITENOP // probably watchdog
223223   AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN0")
224//   AM_RANGE(0xa003, 0xa003) AM_READNOP // ? tests d7 at game over
224//  AM_RANGE(0xa003, 0xa003) AM_READNOP // ? tests d7 at game over
225225   AM_RANGE(0xc000, 0xcfff) AM_ROM
226226   AM_RANGE(0xf000, 0xffff) AM_ROM
227227ADDRESS_MAP_END
trunk/src/mame/drivers/cham24.c
r26736r26737
7373   required_device<cpu_device> m_maincpu;
7474   required_device<nesapu_device> m_nesapu;
7575   required_device<ppu2c0x_device> m_ppu;
76   
76
7777   UINT8* m_nt_ram;
7878   UINT8* m_nt_page[4];
7979   UINT32 m_in_0;
trunk/src/mame/drivers/arcadia.c
r26736r26737
395395   ROM_LOAD16_BYTE_BIOS( 5, "gcp_v400_1-hi.u16", 0x000000, 0x10000, CRC(69295167) SHA1(855f53abbb9dc15e5518e16c5c2dfe4134d07306) ) \
396396   ROM_LOAD16_BYTE_BIOS( 5, "gcp_v400_1-lo.u11", 0x000001, 0x10000, CRC(504c2171) SHA1(a93367f520afb86c97c0a191714b72823c95cdd2) ) \
397397   ROM_LOAD16_BYTE_BIOS( 5, "gcp_v400_2-hi.u17", 0x020000, 0x10000, CRC(13fb4e2d) SHA1(3eef07aecc3a201ae0b20634c7fd0c87c89fd7f1) ) \
398   ROM_LOAD16_BYTE_BIOS( 5, "gcp_v400_2-lo.u12", 0x020001, 0x10000, CRC(a5cc4515) SHA1(80070521476e92323a6baa6e55928ca5b751a332) ) \
398   ROM_LOAD16_BYTE_BIOS( 5, "gcp_v400_2-lo.u12", 0x020001, 0x10000, CRC(a5cc4515) SHA1(80070521476e92323a6baa6e55928ca5b751a332) )
399399
400
401400ROM_START( ar_bios )
402401   ARCADIA_BIOS
403402
r26736r26737
952951DRIVER_INIT_MEMBER(arcadia_amiga_state,sprg) { arcadia_init(); generic_decode("user3", 4, 7, 3, 0, 6, 5, 2, 1); }
953952DRIVER_INIT_MEMBER(arcadia_amiga_state,xeon) { arcadia_init(); generic_decode("user3", 3, 1, 2, 4, 0, 5, 6, 7); }
954953DRIVER_INIT_MEMBER(arcadia_amiga_state,pm)   { arcadia_init(); generic_decode("user3", 7, 6, 5, 4, 3, 2, 1, 0); } // no scramble
955DRIVER_INIT_MEMBER(arcadia_amiga_state,dlta) { arcadia_init(); generic_decode("user3", 4, 6, 5, 7, 3, 2, 1, 0); generic_decode("user3", 7, 6, 0, 4, 3, 2, 1, 5); generic_decode("user3", 7, 6, 5, 4, 1, 2, 3, 0);  generic_decode("user3", 7, 6, 2, 4, 3, 5, 1, 0);  generic_decode("user3", 7, 6, 3, 4, 5, 2, 1, 0); generic_decode("user3", 7, 4, 5, 6, 3, 2, 1, 0);  generic_decode("user3", 7, 5, 6, 4, 3, 2, 1, 0); }
954DRIVER_INIT_MEMBER(arcadia_amiga_state,dlta) { arcadia_init(); generic_decode("user3", 4, 6, 5, 7, 3, 2, 1, 0); generic_decode("user3", 7, 6, 0, 4, 3, 2, 1, 5); generic_decode("user3", 7, 6, 5, 4, 1, 2, 3, 0);  generic_decode("user3", 7, 6, 2, 4, 3, 5, 1, 0);  generic_decode("user3", 7, 6, 3, 4, 5, 2, 1, 0); generic_decode("user3", 7, 4, 5, 6, 3, 2, 1, 0);  generic_decode("user3", 7, 5, 6, 4, 3, 2, 1, 0); }
956955
957956
958957
trunk/src/mame/drivers/pinkiri8.c
r26736r26737
198198   {
199199   /*  "vram1" (video map 0xfc2000)
200200
201      tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx |
201       tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx |
202202
203      "vram2" (video map 0xfc3800)
203       "vram2" (video map 0xfc3800)
204204
205      yyyy yyyy | ???? ???? |
205       yyyy yyyy | ???? ???? |
206206
207207
208      widths come from "widthflags" (0xfc3780)
209      "unk1" (0xfc3700) and "unk2" (0xfc37c0) are a mystery
208       widths come from "widthflags" (0xfc3780)
209       "unk1" (0xfc3700) and "unk2" (0xfc37c0) are a mystery
210210
211      */
211       */
212212
213213      spr_offs = ((m_janshi_vram1[(i*4)+0] & 0xff) | (m_janshi_vram1[(i*4)+1]<<8)) & 0xffff;
214214      col = (m_janshi_vram1[(i*4)+2] & 0xf8) >> 3;
r26736r26737
321321
322322UINT32 pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
323323{
324
325324   /* update palette */
326325   for (int pen = 0; pen < 0x800 ; pen++)
327326   {
trunk/src/mame/drivers/rungun.c
r26736r26737
201201WRITE8_MEMBER(rungun_state::sound_ctrl_w)
202202{
203203   /*
204      .... xxxx - Z80 ROM bank
205      ...x .... - NMI enable/acknowledge
206      xx.. .... - BLT2/1 (?)
204       .... xxxx - Z80 ROM bank
205       ...x .... - NMI enable/acknowledge
206       xx.. .... - BLT2/1 (?)
207207   */
208208
209209   membank("bank2")->set_entry(data & 0x07);
trunk/src/mame/drivers/atari_s1.c
r26736r26737
328328//  ROM_LOAD("atarianb.e00", 0x7000, 0x0800, CRC(74fc86e4) SHA1(135d75e5c03feae0929fa84caa3c802353cdd94e))
329329//  ROM_LOAD("atarian.e0", 0x7800, 0x0800, CRC(45cb0427) SHA1(e286930ca36bdd0f79acefd142d2a5431fa8005b))
330330//
331//   ROM_REGION(0x1000, "sound1", 0)
332//   ROM_LOAD("82s130.bin", 0x0000, 0x0200, CRC(da1f77b4) SHA1(b21fdc1c6f196c320ec5404013d672c35f95890b))
331//  ROM_REGION(0x1000, "sound1", 0)
332//  ROM_LOAD("82s130.bin", 0x0000, 0x0200, CRC(da1f77b4) SHA1(b21fdc1c6f196c320ec5404013d672c35f95890b))
333333//ROM_END
334334
335335/*-------------------------------------------------------------------
trunk/src/mame/drivers/konamigq.c
r26736r26737
9494   DECLARE_MACHINE_RESET(konamigq);
9595   INTERRUPT_GEN_MEMBER(tms_sync);
9696   DECLARE_WRITE_LINE_MEMBER(k054539_irq_gen);
97   
97
9898   void scsi_dma_read( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
9999   void scsi_dma_write( UINT32 *p_n_psxram, UINT32 n_address, INT32 n_size );
100100};
trunk/src/mame/drivers/toaplan2.c
r26736r26737
3737    batsuguna   TP-030        Toaplan       Batsugun (older)
3838    batsugunsp  TP-030        Toaplan       Batsugun (Special Version)
3939    pwrkick     ??????        Sunwise       Power Kick
40   othldrby    ??????        Sunwise       Othello Derby
40    othldrby    ??????        Sunwise       Othello Derby
4141    snowbro2    ??????        Hanafram      Snow Bros. 2 - With New Elves
4242
4343    * This version of Whoopee!! is on a board labeled TP-020
r26736r26737
53485348GAME( 1999, bbakraidj,  bbakraid, bbakraid, bbakraid, toaplan2_state,  bbakraid, ROT270, "Eighting", "Battle Bakraid - Unlimited Version (Japan) (Tue Jun 8 1999)", GAME_SUPPORTS_SAVE )
53495349// older revision of the code
53505350GAME( 1999, bbakraidja, bbakraid, bbakraid, bbakraid, toaplan2_state,  bbakraid, ROT270, "Eighting", "Battle Bakraid (Japan) (Wed Apr 7 1999)", GAME_SUPPORTS_SAVE )
5351
trunk/src/mame/drivers/maygayv1.c
r26736r26737
227227   required_device<i8052_device> m_soundcpu;
228228   required_device<upd7759_device> m_upd7759;
229229   required_device<duartn68681_device> m_duart68681;
230   
230
231231   int m_vsync_latch_preset;
232232   UINT8 m_p1;
233233   UINT8 m_p3;
trunk/src/mame/drivers/pgm.c
r26736r26737
483483   int scanline = param;
484484
485485// already being generated  by MCFG_CPU_VBLANK_INT_DRIVER("screen", pgm_state,  irq6_line_hold)
486//   if(scanline == 224)
487//      m_maincpu->set_input_line(6, HOLD_LINE);
486//  if(scanline == 224)
487//      m_maincpu->set_input_line(6, HOLD_LINE);
488488
489489   if(scanline == 0)
490490      if (!m_irq4_disabled) m_maincpu->set_input_line(4, HOLD_LINE);
r26736r26737
32883288ROM_START( thegladpcb )
32893289   ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code */
32903290   ROM_LOAD16_WORD_SWAP( "bios.42",    0x000000, 0x020000, CRC(517cf7a2) SHA1(f5720b29e3be6ec22be03a768618cb2a1aa4ade7) )
3291   ROM_LOAD16_WORD_SWAP( "glad_v100.43",  0x100000, 0x080000, CRC(bcf3b172) SHA1(df7e2808c0341be0a59eefa852c857a3a919223e) )
3291   ROM_LOAD16_WORD_SWAP( "glad_v100.43",  0x100000, 0x080000, CRC(bcf3b172) SHA1(df7e2808c0341be0a59eefa852c857a3a919223e) )
32923292
32933293   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
32943294   ROM_LOAD( "thegladpcb_igs027a_execute_only_area", 0x0000, 0x00188, NO_DUMP )
3295   ROM_LOAD( "thegladpcb_igs027a_v100_japan.bin", 0x0188, 0x3e78, CRC(d7f06e2d) SHA1(9c3aca7a487f5329d84731e2c63d5ed591bf9d24) )    // from 'thegladpcb set'
3295   ROM_LOAD( "thegladpcb_igs027a_v100_japan.bin", 0x0188, 0x3e78, CRC(d7f06e2d) SHA1(9c3aca7a487f5329d84731e2c63d5ed591bf9d24) )    // from 'thegladpcb set'
32963296
32973297   ROM_REGION( 0x800000, "user1", 0 ) /* Protection Data (encrypted external ARM data, internal missing) */
32983298   ROM_LOAD( "igs_v100.62", 0x000000, 0x200000, CRC(0f3f511e) SHA1(28dd8d27495cec86e968a3ea549c5b30513dbb6e) )
r26736r26737
35813581
35823582   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
35833583   /* the first 0x268 bytes of this are EXECUTE ONLY in the original chip, attempting to read them even via the original CPU just returns what is on the bus */
3584//   ROM_LOAD( "killbldp_igs027a.bin", 0x000000, 0x04000, CRC(c7868d90) SHA1(335c99933a38b77fcfc3f8004063f35124364f3e) ) // this is the original rom with the first 0x268 bytes from the bootleg - but it doesn't work?
3584//  ROM_LOAD( "killbldp_igs027a.bin", 0x000000, 0x04000, CRC(c7868d90) SHA1(335c99933a38b77fcfc3f8004063f35124364f3e) ) // this is the original rom with the first 0x268 bytes from the bootleg - but it doesn't work?
35853585   /* there are some differences around 0x2e80, investigate - maybe above is badly dumped?, padding at 0x3ac0 is also different */
35863586   ROM_LOAD( "killbldp_igs027a_alt.bin", 0x000000, 0x04000, CRC(98316b06) SHA1(09be9fad24d68980a0a5beae60ced48012286216) ) // from a bootleg
35873587
r26736r26737
36143614   ROM_LOAD16_WORD_SWAP( "u30.bin",      0x100000, 0x080000, CRC(34c18f3f) SHA1(42d1edd0dcfaa5e44861c6a1d4cb24f51ba23de8) )
36153615
36163616   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
3617//   ROM_LOAD( "svg_igs027a.bin", 0x000000, 0x04000, NO_DUMP ) // different from PCB version..
3617//  ROM_LOAD( "svg_igs027a.bin", 0x000000, 0x04000, NO_DUMP ) // different from PCB version..
36183618   ROM_LOAD( "svg_igs027a_execute_only_area", 0x0000, 0x00188, NO_DUMP )
36193619   ROM_LOAD( "svg_igs027a.bin", 0x0188, 0x3e78, BAD_DUMP CRC(7a59da5d) SHA1(d67ba465db40ca716b4b901b1c8e762716fb954e) ) // taken from svgpcb
36203620
r26736r26737
36523652   ROM_LOAD( "svgpcb_igs027a_execute_only_area", 0x0000, 0x00188, NO_DUMP )
36533653   ROM_LOAD( "svgcpb_igs027a_v100_japan.bin", 0x0188, 0x3e78, CRC(7a59da5d) SHA1(d67ba465db40ca716b4b901b1c8e762716fb954e) )
36543654
3655   
3655
36563656   ROM_REGION( 0x800000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */
36573657   ROM_LOAD( "svg_v100jp.u64", 0x000000, 0x400000, CRC(399d4a8b) SHA1(b120e8386a259e6fd7941acf3c33cf288eda616c) )
36583658   ROM_LOAD( "svg_v100jp.u65", 0x400000, 0x400000, CRC(6e1c33b1) SHA1(66f26b2f4c0b3dcf6d1bb1df48e2ddbcc9d9432d) )
r26736r26737
36853685
36863686   ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */
36873687   // data before 0x188 is read-protected and cannot be read even with a trojan (as with most 2001/2+ IGS titles)
3688//   ROM_LOAD( "happy6_igs027a.bin", 0x000000, 0x04000, NO_DUMP )
3688//  ROM_LOAD( "happy6_igs027a.bin", 0x000000, 0x04000, NO_DUMP )
36893689   // for testing only, this is from the gladiator and wrong for this game.
36903690   ROM_LOAD( "happy6_igs027a_execute_only_area", 0x0000, 0x00188, NO_DUMP )
3691   ROM_LOAD( "happy6_igs027a_v100_japan.bin", 0x0188, 0x3e78, BAD_DUMP CRC(d7f06e2d) SHA1(9c3aca7a487f5329d84731e2c63d5ed591bf9d24) )    // from 'thegladpcb set'
3691   ROM_LOAD( "happy6_igs027a_v100_japan.bin", 0x0188, 0x3e78, BAD_DUMP CRC(d7f06e2d) SHA1(9c3aca7a487f5329d84731e2c63d5ed591bf9d24) )  // from 'thegladpcb set'
36923692
36933693
36943694   ROM_REGION( 0x800000, "user1", 0 ) /* Protection Data (encrypted external ARM data) */
r26736r26737
41754175GAME( 2003, theglad,      pgm,       pgm_arm_type3,     theglad, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V101) (ARM label V107, ROM 06/06/03 SHEN JIAN V107)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // ARM time: 16:17:27
41764176GAME( 2003, theglad101,   theglad,   pgm_arm_type3,     theglad, pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V100) (ARM label V101, ROM 03/13/03 SHEN JIAN)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // ARM time: 14:06:44
41774177// the v100 68k ROM on this is older than the v101 set, this set also uses a different internal ROM to everything else, must be a very early release, maybe pre v100 proto with v100 strings?
4178GAME( 2003, theglad100,   theglad,   pgm_arm_type3,     theglad, pgm_arm_type3_state,    theglada,   ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 01/16/03 SHEN JIAN)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) /* need correct internal rom of IGS027A - we currently patch the one we have */ // ARM time: 10:39:25
4178GAME( 2003, theglad100,   theglad,   pgm_arm_type3,     theglad, pgm_arm_type3_state,    theglada,   ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 01/16/03 SHEN JIAN)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) /* need correct internal rom of IGS027A - we currently patch the one we have */ // ARM time: 10:39:25
41794179// newer than ARM V100 Cart, older than ARM V101 Cart, same 68k rom as V101 Cart.
41804180GAME( 2003, thegladpcb,   theglad,   pgm_arm_type3,     pgm,    pgm_arm_type3_state,    theglad,    ROT0,   "IGS", "The Gladiator / Road of the Sword / Shen Jian (M68k label V100) (ARM label V100, ROM 02/25/03 SHEN JIAN) (Japan, JAMMA PCB)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )// ARM time: 16:32:21 // PCB version only released in Japan?
41814181
trunk/src/mame/drivers/sangho.c
r26736r26737
8181};
8282
8383/*
84   slot 0 selects RAM
85   slot 1 selects ?
86   slot 2 selects code ROMs
87   slot 3 selects data ROMs
84    slot 0 selects RAM
85    slot 1 selects ?
86    slot 2 selects code ROMs
87    slot 3 selects data ROMs
8888*/
8989void sangho_state::pzlestar_map_banks()
9090{
trunk/src/mame/drivers/zr107.c
r26736r26737
207207   int m_ccu_vctl;
208208   UINT8 m_sound_ctrl;
209209   UINT8 m_sound_intck;
210   
210
211211   DECLARE_WRITE32_MEMBER(paletteram32_w);
212212   DECLARE_READ8_MEMBER(sysreg_r);
213213   DECLARE_WRITE8_MEMBER(sysreg_w);
r26736r26737
841841   MCFG_K001604_ADD("k001604", jetwave_k001604_intf)
842842
843843   MCFG_K056800_ADD("k056800", XTAL_18_432MHz)
844   MCFG_K056800_INT_HANDLER(INPUTLINE("audiocpu", M68K_IRQ_1))   
844   MCFG_K056800_INT_HANDLER(INPUTLINE("audiocpu", M68K_IRQ_1))
845845
846846   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
847847
848848   MCFG_K054539_ADD("k054539_1", XTAL_18_432MHz, k054539_config)
849   MCFG_K054539_TIMER_HANDLER(WRITELINE(zr107_state, k054539_irq_gen))   
849   MCFG_K054539_TIMER_HANDLER(WRITELINE(zr107_state, k054539_irq_gen))
850850   MCFG_SOUND_ROUTE(0, "lspeaker", 0.75)
851851   MCFG_SOUND_ROUTE(1, "rspeaker", 0.75)
852852
trunk/src/mame/drivers/superchs.c
r26736r26737
530530   ROM_LOAD16_BYTE( "ic127 ae27.bin", 0x00000, 0x40000, CRC(8c8cd2a1) SHA1(178ab2df0ea7371ce275d38051643ea19ba88047) )
531531
532532   ROM_REGION( 0x200000, "gfx1", 0 ) /* SCR 16x16 tiles */
533   ROM_LOAD32_BYTE( "0scn.ic9",    0x00000, 0x080000, CRC(d54e80ec) SHA1(83460cf97b0da8523486ede5bd504710c790b1a6) )   
534   ROM_LOAD32_BYTE( "8scn.ic8",    0x00002, 0x080000, CRC(b3da122d) SHA1(1e4198b2d5ce2144a7ca01f418aca33f799dcad2) )   
535   ROM_LOAD32_BYTE( "16scn.ic12",  0x00001, 0x080000, CRC(dd26932c) SHA1(31bcc4e0195a6d966829976b89e81e6eb7dde8b6) )   
536   ROM_LOAD32_BYTE( "24scn.ic13",  0x00003, 0x080000, CRC(4f560680) SHA1(6398013b8fa5aebc905bf31918e990dd7f5d9490) )   
533   ROM_LOAD32_BYTE( "0scn.ic9",    0x00000, 0x080000, CRC(d54e80ec) SHA1(83460cf97b0da8523486ede5bd504710c790b1a6) )
534   ROM_LOAD32_BYTE( "8scn.ic8",    0x00002, 0x080000, CRC(b3da122d) SHA1(1e4198b2d5ce2144a7ca01f418aca33f799dcad2) )
535   ROM_LOAD32_BYTE( "16scn.ic12",  0x00001, 0x080000, CRC(dd26932c) SHA1(31bcc4e0195a6d966829976b89e81e6eb7dde8b6) )
536   ROM_LOAD32_BYTE( "24scn.ic13",  0x00003, 0x080000, CRC(4f560680) SHA1(6398013b8fa5aebc905bf31918e990dd7f5d9490) )
537537
538538   ROM_REGION( 0x800000, "gfx2", 0 )
539539   ROMX_LOAD( "0lobj.ic14",   0x000003, 0x80000, CRC(972d0866) SHA1(7787312ba99d971eee30d50ddff12629e3bdc8b9) , ROM_SKIP(7) )
trunk/src/mame/drivers/famibox.c
r26736r26737
7979   required_device<cpu_device> m_maincpu;
8080   required_device<nesapu_device> m_nesapu;
8181   required_device<ppu2c0x_device> m_ppu;
82   
82
8383   UINT8* m_nt_ram;
8484   UINT8* m_nt_page[4];
8585
trunk/src/mame/drivers/exidy440.c
r26736r26737
16981698   ROM_LOAD( "wda6.s2",   0x0c000, 0x2000, CRC(23d5c5a9) SHA1(ab8997556b6a9c4a011c367a2035aeba3c752be1) ) // WDL-9_2-S_2764.bin
16991699   ROM_LOAD( "wda6.t2",   0x0e000, 0x2000, CRC(a807536d) SHA1(154564c189c7e6f755acda95178db503991ecbaa) ) // WDL-9_2-T_2764.bin
17001700   ROM_LOAD( "wda8.l1",   0x12000, 0x2000, CRC(27b856bd) SHA1(f66f6f898d2a7f044b7d331290a7bf32715b5587) ) // WDL-9_1-L_2764.bin
1701   ROM_LOAD( "wda8.m1",   0x14000, 0x2000, CRC(8e15c601) SHA1(924b10523cf8ff802c0907dae96cbc9bae9fe4b0) ) // WDL-9_1-M_2764.bin   
1701   ROM_LOAD( "wda8.m1",   0x14000, 0x2000, CRC(8e15c601) SHA1(924b10523cf8ff802c0907dae96cbc9bae9fe4b0) ) // WDL-9_1-M_2764.bin
17021702   ROM_LOAD( "xba1.1n",   0x16000, 0x2000, CRC(2e855698) SHA1(fa4c3ec03fdd1c569c0ca2418899ffa81b5259ec) ) // WDL-9_1-N_2764.bin
17031703   ROM_LOAD( "wda6.p1",   0x18000, 0x2000, CRC(3ffaaa22) SHA1(a0848c0f4d799c3b6e9fe8e8f89e7e36754174f6) ) // WDL-9_1-P_2764.bin
17041704   ROM_LOAD( "wda6.r1",   0x1a000, 0x2000, CRC(0579a3b8) SHA1(554bced664c12547a766ee6df1278b967714b5ae) ) // WDL-9_1-R_2764.bin
trunk/src/mame/drivers/twinkle.c
r26736r26737
10861086   ROM_LOAD( "a03", 0x000000, 0x000100, BAD_DUMP CRC(8860cfb6) SHA1(85a5b27f24d4baa7960e692b91c0cf3dc5388e72) )
10871087
10881088   DISK_REGION( "scsi:cdrom" )
1089   DISK_IMAGE_READONLY( "a03jaa01", 0, SHA1(f54fc778c2187ccd950402a159babef956b71492   ) )
1089   DISK_IMAGE_READONLY( "a03jaa01", 0, SHA1(f54fc778c2187ccd950402a159babef956b71492   ) )
10901090
10911091   DISK_REGION( "cdrom1" ) // video CD
10921092   DISK_IMAGE_READONLY( "a03jaa02", 0, SHA1(d6f01d666e8de285a02215f7ef987073e2b25019) )
trunk/src/mame/drivers/legionna.c
r26736r26737
10661066   MCFG_CPU_VBLANK_INT_DRIVER("screen", legionna_state,  irq4_line_hold)/* VBL */
10671067
10681068   SEIBU_SOUND_SYSTEM_CPU(14318180/4)
1069   
1069
10701070   MCFG_SEIBU_COP_ADD("seibucop")
10711071
10721072   /* video hardware */
r26736r26737
10961096   MCFG_CPU_VBLANK_INT_DRIVER("screen", legionna_state,  irq4_line_hold)/* VBL */
10971097
10981098   SEIBU_SOUND_SYSTEM_CPU(14318180/4)
1099   
1099
11001100   MCFG_SEIBU_COP_ADD("seibucop")
11011101
11021102   /* video hardware */
r26736r26737
11251125   MCFG_CPU_VBLANK_INT_DRIVER("screen", legionna_state,  irq4_line_hold)
11261126
11271127   SEIBU2_SOUND_SYSTEM_CPU(14318180/4)
1128   
1128
11291129   MCFG_SEIBU_COP_ADD("seibucop")
11301130
11311131   /* video hardware */
r26736r26737
11551155   MCFG_CPU_VBLANK_INT_DRIVER("screen", legionna_state,  irq4_line_hold)
11561156
11571157   SEIBU2_SOUND_SYSTEM_CPU(14318180/4)
1158   
1158
11591159   MCFG_SEIBU_COP_ADD("seibucop")
11601160
11611161   /* video hardware */
r26736r26737
11841184   MCFG_CPU_VBLANK_INT_DRIVER("screen", legionna_state,  irq4_line_hold)
11851185
11861186   SEIBU2_SOUND_SYSTEM_CPU(14318180/4)
1187   
1187
11881188   MCFG_SEIBU_COP_ADD("seibucop")
11891189
11901190   /* video hardware */
r26736r26737
12141214   MCFG_CPU_VBLANK_INT_DRIVER("screen", legionna_state,  irq4_line_hold)/* VBL */
12151215
12161216   SEIBU_SOUND_SYSTEM_CPU(14318180/4)
1217   
1217
12181218   MCFG_SEIBU_COP_ADD("seibucop")
12191219
12201220   /* video hardware */
r26736r26737
12481248   MCFG_CPU_VBLANK_INT_DRIVER("screen", legionna_state,  irq4_line_hold) /* VBL */
12491249
12501250   MCFG_SEIBU_COP_ADD("seibucop")
1251   
1251
12521252   /*Different Sound hardware*/
12531253   //SEIBU_SOUND_SYSTEM_CPU(14318180/4)
12541254   MCFG_CPU_ADD("audiocpu", Z80,14318180/4)
trunk/src/mame/drivers/aristmk4.c
r26736r26737
170170    Promoted Fortune Hunter and clone to working status, as they were in fact working for quite a while.
171171    Fixed ROM names for kgbird/kgbirda; 5c and 10c variants were mixed up.
172172
173   11/12/13 - Lord-Data
174   Added hopper and meter outputs.
173    11/12/13 - Lord-Data
174    Added hopper and meter outputs.
175175
176176    ****************************************************************************
177177
r26736r26737
631631               printf("Unhandled Mechanical meter %d pulse: %02d\n",i+1, emet[i]);
632632               break;
633633         }
634         
634
635635         m_samples->start(i,0); // pulse sound for mechanical meters
636636      }
637637      else
638638      {
639         // if there is not a value set, this meter is not active, reset output to 0
639         // if there is not a value set, this meter is not active, reset output to 0
640640         switch(i+1)
641641         {
642642            case 4:
r26736r26737
649649               break;
650650         }
651651      }
652   }
652   }
653653}
654654
655655/* sound interface for playing mechanical meter sound */
r26736r26737
715715//   CBOPT1 - Bit7 - Cash box optics
716716/* Coin input... CBOPT2 goes LOW, then the optic detectors OPTA1 / OPTB1 detect the coin passing */
717717/* The timer causes one credit, per 150ms or so... */
718   
718
719719   switch(m_inscrd)
720720   {
721721   case 0x00:
r26736r26737
864864   if (data==0x01)
865865      m_hopper_motor=data;
866866   else if (m_hopper_motor<0x02)
867      m_hopper_motor=data;
867      m_hopper_motor=data;
868868
869869   output_set_value("hopper_motor", m_hopper_motor); // stop motor
870870}
r26736r26737
10161016static INPUT_PORTS_START(aristmk4)
10171017
10181018   PORT_START("via_port_b")
1019   PORT_DIPNAME( 0x10, 0x00, "1" )                                                                     // "COIN FAULT"
1019   PORT_DIPNAME( 0x10, 0x00, "1" )                                                                                         // "COIN FAULT"
10201020   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10211021   PORT_DIPSETTING(    0x10, DEF_STR( On ) ) PORT_DIPLOCATION("AY:1")
1022   PORT_DIPNAME( 0x20, 0x00, "2" )                                                                     // "COIN FAULT"
1022   PORT_DIPNAME( 0x20, 0x00, "2" )                                                                                         // "COIN FAULT"
10231023   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10241024   PORT_DIPSETTING(    0x20, DEF_STR( On ) ) PORT_DIPLOCATION("AY:2")
1025   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hopper Coin Release") PORT_CODE(KEYCODE_BACKSLASH)            // "ILLEGAL COIN PAID"
1026   
1025   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Hopper Coin Release") PORT_CODE(KEYCODE_BACKSLASH)              // "ILLEGAL COIN PAID"
1026
10271027   PORT_DIPNAME( 0x80, 0x00, "CBOPT1" )
10281028   PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
10291029   PORT_DIPSETTING(    0x80, DEF_STR( On ) ) PORT_DIPLOCATION("AY:4")
r26736r26737
10371037   PORT_DIPNAME( 0x04, 0x00, "HOPHI2") // hopper 2 full
10381038   PORT_DIPSETTING(    0x00, DEF_STR( Off ) ) PORT_DIPLOCATION("5002:3")
10391039   PORT_DIPSETTING(    0x04, DEF_STR( On ) )
1040   PORT_DIPNAME( 0x08, 0x00, "DOPTI")  // photo optic door                                                         DOOR OPEN SENSE SWITCH
1040   PORT_DIPNAME( 0x08, 0x00, "DOPTI")  // photo optic door                                                                         DOOR OPEN SENSE SWITCH
10411041   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
10421042   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
10431043   PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_NAME("Audit Key") PORT_TOGGLE PORT_CODE(KEYCODE_K) // AUDTSW
trunk/src/mame/drivers/mcr3.c
r26736r26737
536536
537537WRITE8_MEMBER(mcr3_state::spyhuntpr_a800_w)
538538{
539
540539}
541540
542541WRITE8_MEMBER(mcr3_state::spyhuntpr_a801_w)
543542{
544
545543}
546544
547545WRITE8_MEMBER(mcr3_state::spyhuntpr_a802_w)
548546{
549
550547}
551548
552549WRITE8_MEMBER(mcr3_state::spyhuntpr_a803_w)
553550{
554
555551}
556552
557553WRITE8_MEMBER(mcr3_state::spyhuntpr_a900_w)
558554{
559
560555}
561556
562557WRITE8_MEMBER(mcr3_state::spyhuntpr_fd00_w)
563558{
564
565559}
566560
567561static ADDRESS_MAP_START( spyhuntpr_map, AS_PROGRAM, 8, mcr3_state )
r26736r26737
579573   AM_RANGE(0xf000, 0xf7ff) AM_RAM //AM_SHARE("nvram")
580574   AM_RANGE(0xf800, 0xf9ff) AM_RAM AM_SHARE("spriteram")
581575   AM_RANGE(0xfa00, 0xfa7f) AM_MIRROR(0x0180) AM_RAM AM_WRITE(spyhuntpr_paletteram_w) AM_SHARE("paletteram")
582   
576
583577   AM_RANGE(0xfc00, 0xfc00) AM_READ_PORT("DSW0")
584578   AM_RANGE(0xfc01, 0xfc01) AM_READ_PORT("DSW1")
585579   AM_RANGE(0xfc02, 0xfc02) AM_READ_PORT("IN2")
586580   AM_RANGE(0xfc03, 0xfc03) AM_READ_PORT("IN3")
587   
581
588582   AM_RANGE(0xfd00, 0xfd00) AM_WRITE( spyhuntpr_fd00_w )
589583
590584   AM_RANGE(0xfe00, 0xffff) AM_RAM // a modified copy of spriteram for this hw??
r26736r26737
592586
593587WRITE8_MEMBER(mcr3_state::spyhuntpr_port04_w)
594588{
595
596589}
597590
598591static ADDRESS_MAP_START( spyhuntpr_portmap, AS_IO, 8, mcr3_state )
r26736r26737
601594   AM_RANGE(0x04, 0x04) AM_WRITE(spyhuntpr_port04_w)
602595   AM_RANGE(0x84, 0x86) AM_WRITE(spyhunt_scroll_value_w)
603596   AM_RANGE(0xe0, 0xe0) AM_WRITENOP // was watchdog
604//   AM_RANGE(0xe8, 0xe8) AM_WRITENOP
597//  AM_RANGE(0xe8, 0xe8) AM_WRITENOP
605598   AM_RANGE(0xf0, 0xf3) AM_DEVREADWRITE("ctc", z80ctc_device, read, write)
606599ADDRESS_MAP_END
607600
r26736r26737
14041397static ADDRESS_MAP_START( spyhuntpr_sound_map, AS_PROGRAM, 8, mcr3_state )
14051398   AM_RANGE(0x0000, 0x1fff) AM_ROM
14061399   AM_RANGE(0x8000, 0x83ff) AM_RAM
1407//   AM_RANGE(0xfe00, 0xffff) AM_RAM
1400//  AM_RANGE(0xfe00, 0xffff) AM_RAM
14081401ADDRESS_MAP_END
14091402
14101403static ADDRESS_MAP_START( spyhuntpr_sound_portmap, AS_IO, 8, mcr3_state )
r26736r26737
14371430   MCFG_MACHINE_START_OVERRIDE(mcr3_state,mcr)
14381431   MCFG_MACHINE_RESET_OVERRIDE(mcr3_state,mcr)
14391432
1440//   MCFG_NVRAM_ADD_0FILL("nvram")
1433//  MCFG_NVRAM_ADD_0FILL("nvram")
14411434
1442   
1435
14431436   /* video hardware */
14441437   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
14451438
r26736r26737
14611454   MCFG_CPU_ADD("audiocpu", Z80, 3000000 )
14621455   MCFG_CPU_PROGRAM_MAP(spyhuntpr_sound_map)
14631456   MCFG_CPU_IO_MAP(spyhuntpr_sound_portmap)
1464//   MCFG_CPU_PERIODIC_INT_DRIVER(mcr3_state, irq0_line_hold, 4*60)
1457//  MCFG_CPU_PERIODIC_INT_DRIVER(mcr3_state, irq0_line_hold, 4*60)
14651458
14661459   MCFG_SPEAKER_STANDARD_MONO("mono")
14671460
r26736r26737
17871780   ROM_CONTINUE(0x3002, 0x200)
17881781   ROM_CONTINUE(0x3003, 0x200)
17891782   ROM_CONTINUE(0x3802, 0x200)
1790   ROM_CONTINUE(0x3803, 0x200)   
1783   ROM_CONTINUE(0x3803, 0x200)
17911784   ROM_LOAD32_BYTE( "8.bin",   0x4000, 0x200, CRC(e699b329) SHA1(cb4b8c7b6fa1cb1144a18f1442dc3b267c408914) )
17921785   ROM_CONTINUE(0x4001, 0x200)
17931786   ROM_CONTINUE(0x4800, 0x200)
r26736r26737
18191812   ROM_CONTINUE(0x7002, 0x200)
18201813   ROM_CONTINUE(0x7003, 0x200)
18211814   ROM_CONTINUE(0x7802, 0x200)
1822   ROM_CONTINUE(0x7803, 0x200)   
1815   ROM_CONTINUE(0x7803, 0x200)
18231816
18241817   ROM_REGION( 0x10000, "gfx2", ROMREGION_INVERT )
18251818   ROM_LOAD( "10.bin",   0x00000, 0x4000, CRC(6f9fd416) SHA1(a51c86e5b22c91fc44673f53400b58af40b18065) )
r26736r26737
19941987DRIVER_INIT_MEMBER(mcr3_state,spyhuntpr)
19951988{
19961989   mcr_common_init();
1997//   machine().device<midway_ssio_device>("ssio")->set_custom_input(1, 0x60, read8_delegate(FUNC(mcr3_state::spyhunt_ip1_r),this));
1998//   machine().device<midway_ssio_device>("ssio")->set_custom_input(2, 0xff, read8_delegate(FUNC(mcr3_state::spyhunt_ip2_r),this));
1999//   machine().device<midway_ssio_device>("ssio")->set_custom_output(4, 0xff, write8_delegate(FUNC(mcr3_state::spyhunt_op4_w),this));
1990//  machine().device<midway_ssio_device>("ssio")->set_custom_input(1, 0x60, read8_delegate(FUNC(mcr3_state::spyhunt_ip1_r),this));
1991//  machine().device<midway_ssio_device>("ssio")->set_custom_input(2, 0xff, read8_delegate(FUNC(mcr3_state::spyhunt_ip2_r),this));
1992//  machine().device<midway_ssio_device>("ssio")->set_custom_output(4, 0xff, write8_delegate(FUNC(mcr3_state::spyhunt_op4_w),this));
20001993
20011994   m_spyhunt_sprite_color_mask = 0x00;
20021995   m_spyhunt_scroll_offset = 16;
trunk/src/mame/drivers/mw18w.c
r26736r26737
6363   // d0-d5: engine sound
6464   // d6: bell sound
6565   // d7: backdrop lamp dim control
66   
66
6767   output_set_lamp_value(80, data >> 7 & 1);
6868}
6969
r26736r26737
7171{
7272   // d0-3, d7: selected rows
7373   int rows = (data & 0xf) | (data >> 3 & 0x10);
74   
74
7575   // d4-d6: column
7676   int col = data >> 4 & 7;
77   
77
7878   // refresh lamp status
7979   for (int i = 0; i < 5; i++)
8080      output_set_lamp_value(col * 10 + i, rows >> i & 1);
8181
8282   /* lamps info:
83   
83
8484   00: upper right load zone
8585   01: lower right load zone
8686   02: lost cargo
r26736r26737
128128   72: extended play
129129   73: credit
130130   74: game over
131   
131
132132   (80: backdrop dim)
133   
133
134134   */
135135}
136136
trunk/src/mame/drivers/hng64.c
r26736r26737
650650
651651   switch (offset*4)
652652   {
653      case 0x000:   return 0x00000400;
653      case 0x000: return 0x00000400;
654654      case 0x004: return ioport("SYSTEM")->read();
655655      case 0x008: return ioport("P1_P2")->read();
656656      case 0x600: return m_no_machine_error_code;
r26736r26737
921921      clear3d();
922922   }
923923
924//   printf("%02x\n",data);
924//  printf("%02x\n",data);
925925
926//   if(data & 1) // swap buffers?
926//  if(data & 1) // swap buffers?
927927
928928//  if(data & 4) // reset buffer count
929929}
r26736r26737
983983   */
984984READ32_MEMBER(hng64_state::unk_vreg_r)
985985{
986//   m_unk_vreg_toggle^=0x8000;
986//  m_unk_vreg_toggle^=0x8000;
987987
988988   return 0;
989989
990//   return ++m_unk_vreg_toggle;
990//  return ++m_unk_vreg_toggle;
991991}
992992
993993/***** I don't think there is a soundram2, having it NOT hooked up causes xrally to copy the sound program to the expected location, see memory map note *****/
r26736r26737
18921892
18931893   switch(scanline)
18941894   {
1895      case 224*2:   m_set_irq(0x0001);  break; // lv 0 vblank irq
1896//      case 0*2:   m_set_irq(0x0002);  break; // lv 1
1897//      case 32*2:  m_set_irq(0x0008);  break; // lv 2
1898//      case 64*2:  m_set_irq(0x0008);  break; // lv 2
1899      case 128*2:   m_set_irq(0x0800);  break; // lv 11 network irq?
1895      case 224*2: m_set_irq(0x0001);  break; // lv 0 vblank irq
1896//      case 0*2:   m_set_irq(0x0002);  break; // lv 1
1897//      case 32*2:  m_set_irq(0x0008);  break; // lv 2
1898//      case 64*2:  m_set_irq(0x0008);  break; // lv 2
1899      case 128*2: m_set_irq(0x0800);  break; // lv 11 network irq?
19001900   }
19011901}
19021902
r26736r26737
19251925   m_audiocpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
19261926   m_audiocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
19271927
1928//   m_comm->set_input_line(INPUT_LINE_RESET, PULSE_LINE);     // reset the CPU and let 'er rip
1928//  m_comm->set_input_line(INPUT_LINE_RESET, PULSE_LINE);     // reset the CPU and let 'er rip
19291929//  m_comm->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);     // hold on there pardner...
19301930
19311931   // "Display List" init - ugly
1932//   m_activeBuffer = 0;
1932//  m_activeBuffer = 0;
19331933
19341934   /* For simulate MCU stepping */
19351935   m_mcu_fake_time = 0;
trunk/src/mame/drivers/bfm_sc4h.c
r26736r26737
702702void m68307_duart_tx(device_t *device, int channel, UINT8 data)
703703{
704704   if (channel==0)
705    {
705   {
706706      logerror("m68307_duart_tx %02x\n",data);
707707   }
708708   else
trunk/src/mame/drivers/qdrmfgp.c
r26736r26737
3030#include "includes/qdrmfgp.h"
3131
3232
33#define IDE_HACK   1
33#define IDE_HACK    1
3434
3535
3636/*************************************
trunk/src/mame/drivers/multigam.c
r26736r26737
119119      m_maincpu(*this, "maincpu"),
120120      m_nesapu(*this, "nesapu"),
121121      m_ppu(*this, "ppu") { }
122     
122
123123   required_device<cpu_device> m_maincpu;
124124   required_device<nesapu_device> m_nesapu;
125125   required_device<ppu2c0x_device> m_ppu;
126   
126
127127   UINT8* m_nt_ram;
128128   UINT8* m_vram;
129129   UINT8* m_nt_page[4];
r26736r26737
875875void multigam_state::multigam_init_mmc1(UINT8 *prg_base, int prg_size, int chr_bank_base)
876876{
877877   UINT8* dst = memregion("maincpu")->base();
878   
878
879879   memcpy(&dst[0x8000], prg_base + (prg_size - 0x8000), 0x8000);
880880
881881   m_maincpu->space(AS_PROGRAM).install_write_handler(0x8000, 0xffff, write8_delegate(FUNC(multigam_state::mmc1_rom_switch_w),this));
trunk/src/mame/drivers/lethal.c
r26736r26737
561561   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_er5911_device, ready_read)
562562   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
563563   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
564   PORT_DIPNAME( 0x10, 0x10, DEF_STR(Language) )      PORT_DIPLOCATION("DSW:4")
564   PORT_DIPNAME( 0x10, 0x10, DEF_STR(Language) )       PORT_DIPLOCATION("DSW:4")
565565   PORT_DIPSETTING(    0x10, DEF_STR(English) )
566566   PORT_DIPSETTING(    0x00, DEF_STR(Spanish) )
567   PORT_DIPNAME( 0x20, 0x00, "Game Type" )         PORT_DIPLOCATION("DSW:3")
567   PORT_DIPNAME( 0x20, 0x00, "Game Type" )         PORT_DIPLOCATION("DSW:3")
568568   PORT_DIPSETTING(    0x20, "Street" )
569569   PORT_DIPSETTING(    0x00, "Arcade" )
570   PORT_DIPNAME( 0x40, 0x40, "Coin Mechanism" )      PORT_DIPLOCATION("DSW:2")
570   PORT_DIPNAME( 0x40, 0x40, "Coin Mechanism" )        PORT_DIPLOCATION("DSW:2")
571571   PORT_DIPSETTING(    0x40, "Common" )
572572   PORT_DIPSETTING(    0x00, "Independent" )
573   PORT_DIPNAME( 0x80, 0x80, "Sound Output" )      PORT_DIPLOCATION("DSW:1")
573   PORT_DIPNAME( 0x80, 0x80, "Sound Output" )      PORT_DIPLOCATION("DSW:1")
574574   PORT_DIPSETTING(    0x00, DEF_STR( Mono ) )
575575   PORT_DIPSETTING(    0x80, DEF_STR( Stereo ) )
576576
r26736r26737
595595static INPUT_PORTS_START( lethalenj )
596596   PORT_INCLUDE( lethalen )
597597
598        PORT_MODIFY("DSW")  /* Normal DIPs appear to do nothing for Japan region - wrong location?  Set to unknown */
599        PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DSW:4")
600        PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW:3")
601        PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DSW:2")
602        PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW:1")
598      PORT_MODIFY("DSW")  /* Normal DIPs appear to do nothing for Japan region - wrong location?  Set to unknown */
599      PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DSW:4")
600      PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DSW:3")
601      PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DSW:2")
602      PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DSW:1")
603603
604        PORT_MODIFY("LIGHT0_X")
604      PORT_MODIFY("LIGHT0_X")
605605   PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) PORT_REVERSE
606606
607607   PORT_MODIFY("LIGHT0_Y")
r26736r26737
618618   PORT_INCLUDE( lethalen )
619619
620620   PORT_MODIFY("DSW")
621        PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "DSW:4")
621      PORT_DIPUNUSED_DIPLOC( 0x10, 0x10, "DSW:4")
622622INPUT_PORTS_END
623623
624624static const gfx_layout lethal_6bpp =
trunk/src/mame/drivers/seta.c
r26736r26737
58025802
58035803static INPUT_PORTS_START( thunderlbl )
58045804   PORT_INCLUDE(thunderl)
5805   
5805
58065806   PORT_MODIFY("DSW")
58075807   PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW1:2")
58085808   PORT_DIPSETTING(      0x0200, DEF_STR( Off ) )
r26736r26737
87588758
87598759   /* the sound hardware / program is ripped from Tetris (S16B) */
87608760   MCFG_DEVICE_REMOVE("x1snd")
8761   
8761
87628762   MCFG_YM2151_ADD("ymsnd", 16000000/2)
87638763   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
87648764   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
trunk/src/mame/drivers/ultrsprt.c
r26736r26737
11/*
2   Konami Ultra Sports hardware
2    Konami Ultra Sports hardware
33
4   Driver by Ville Linde
4    Driver by Ville Linde
55*/
66
77#include "emu.h"
r26736r26737
2222      m_k056800(*this, "k056800"),
2323      m_workram(*this, "workram") { }
2424
25   static const UINT32 VRAM_PAGES      = 2;
26   static const UINT32 VRAM_PAGE_BYTES   = 512 * 1024;
25   static const UINT32 VRAM_PAGES      = 2;
26   static const UINT32 VRAM_PAGE_BYTES = 512 * 1024;
2727
2828   required_device<cpu_device> m_maincpu;
2929   required_device<cpu_device> m_audiocpu;
r26736r26737
109109   if (ACCESSING_BITS_24_31)
110110   {
111111      /*
112         .... ...x - EEPROM DI
113         .... ..x. - EEPROM CLK
114         .... .x.. - EEPROM /CS
115         .... x... - VRAM page (CPU access)
116         ...x .... - Coin counter
117         ..x. .... - Watchdog /Reset
118         .x.. .... - Trackball /Reset
119         x... .... - Sound CPU /Reset
112          .... ...x - EEPROM DI
113          .... ..x. - EEPROM CLK
114          .... .x.. - EEPROM /CS
115          .... x... - VRAM page (CPU access)
116          ...x .... - Coin counter
117          ..x. .... - Watchdog /Reset
118          .x.. .... - Trackball /Reset
119          x... .... - Sound CPU /Reset
120120      */
121121      ioport("EEPROMOUT")->write(data, 0xffffffff);
122122
trunk/src/mame/drivers/midyunit.c
r26736r26737
412412   PORT_DIPSETTING(      0x0058, DEF_STR( 2C_1C ))        PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
413413   PORT_DIPSETTING(      0x0068, "2 Coins/1 Credit 4/3" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
414414   PORT_DIPSETTING(      0x0048, "2 Coins/1 Credit 4/4" ) PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000)
415   PORT_DIPSETTING(      0x0070, "ECA" )                  PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000) /* 25 cents; 4 chutes - dollar/quarter/dime/nickel */
415   PORT_DIPSETTING(      0x0070, "ECA" )                  PORT_CONDITION("DSW", 0xc000, EQUALS, 0xc000) /* 25 cents; 4 chutes - dollar/quarter/dime/nickel */
416416   PORT_DIPSETTING(      0x0078, "1DM/1 Credit 6/5" )     PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000) /* German coinage; these 4 have 2 chutes (1DM/5DM) */
417417   PORT_DIPSETTING(      0x0058, "1DM/1 Credit 7/5" )     PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
418418   PORT_DIPSETTING(      0x0068, "1DM/1 Credit 8/5" )     PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
419419   PORT_DIPSETTING(      0x0048, "1DM/1 Credit" )         PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000)
420   PORT_DIPSETTING(      0x0070, "ECA" )                  PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000) /* 1/1DM 6/5DM; 3 chutes (5DM/2DM/1DM) */
420   PORT_DIPSETTING(      0x0070, "ECA" )                  PORT_CONDITION("DSW", 0xc000, EQUALS, 0x4000) /* 1/1DM 6/5DM; 3 chutes (5DM/2DM/1DM) */
421421   PORT_DIPSETTING(      0x0078, "5F/2 Credits 10/5" )    PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000) /* French coinage; 2 chutes (5F/10F) */
422422   PORT_DIPSETTING(      0x0058, "5F/2 Credits" )         PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
423423   PORT_DIPSETTING(      0x0068, "5F/1 Credit 10/3" )     PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
424424   PORT_DIPSETTING(      0x0048, "5F/1 Credit" )          PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000)
425   PORT_DIPSETTING(      0x0070, "ECA" )                  PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000) /* 1/3F 2/5F 5/10F; 3 chutes (1F/5F/10F) */
425   PORT_DIPSETTING(      0x0070, "ECA" )                  PORT_CONDITION("DSW", 0xc000, EQUALS, 0x8000) /* 1/3F 2/5F 5/10F; 3 chutes (1F/5F/10F) */
426426   PORT_DIPSETTING(      0x0040, DEF_STR( Free_Play ))
427427   PORT_DIPSETTING(      0x0038, "Other (See Service Menu)" )
428428   PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Players )) PORT_DIPLOCATION("SW1:1")
trunk/src/mame/drivers/arachnid.c
r26736r26737
11/*
2   Arachnid - English Mark Darts
2    Arachnid - English Mark Darts
33
4   Driver by Jim Stolis.
4    Driver by Jim Stolis.
55
66    --- Technical Notes ---
77    Name:    English Mark Darts
r26736r26737
99    Year:    1987/88/89/90
1010
1111    --- Hardware ---
12   A 6809 CPU (U3) is clocked by a 556 (U2) circuit with 3 Pin addressing decoding via a 74LS138 (U14)
13   Program ROM is a 27256 (U15)
14   Two 6821 PIAs (U4/U17) are used for I/O
15   Video is processed via a TMS9118 (U11) with two TMS4416 (U12/U13) as RAM
16   Main RAM is a 2K 6116 (U23) chip
17   Sound is generated via a PTM 6840 (U16) directly to an amplified speaker
12    A 6809 CPU (U3) is clocked by a 556 (U2) circuit with 3 Pin addressing decoding via a 74LS138 (U14)
13    Program ROM is a 27256 (U15)
14    Two 6821 PIAs (U4/U17) are used for I/O
15    Video is processed via a TMS9118 (U11) with two TMS4416 (U12/U13) as RAM
16    Main RAM is a 2K 6116 (U23) chip
17    Sound is generated via a PTM 6840 (U16) directly to an amplified speaker
1818
19   --- Target Interface Board ---
20   The target interface board is used to combine 33 conductors from the switch matrix
21   into 16 conductors.  The middle 13 pin connector is common to all switches.
19    --- Target Interface Board ---
20    The target interface board is used to combine 33 conductors from the switch matrix
21    into 16 conductors.  The middle 13 pin connector is common to all switches.
2222
23   3 connectors and their labels
24   EFBHDACGH   NMPLMNJOMIKOP   EBACFDCEAHB
23    3 connectors and their labels
24    EFBHDACGH   NMPLMNJOMIKOP   EBACFDCEAHB
2525
26   Switch Matrix Table
27   Score   Single   Double   Triple
28   1      DN      EN      FN
29   2      AL      BL      CL
30   3      AN      BN      CN
31   4      DL      EL      FL
32   5      AP      BP      CP
33   6      GL      HL      GP
34   7      DO      EO      FO
35   8      GI      HI      GM
36   9      AO      BO      CO
37   10      AI      BI      CI
38   11      AK      BK      CK
39   12      DP      EP      FP
40   13      AM      BM      CM
41   14      GK      HK      GO
42   15      GJ      HJ      GN
43   16      AJ      BJ      CJ
44   17      DM      EM      FM
45   18      DI      EI      FI
46   19      DJ      EJ      FJ
47   20      DK      EK      FK
48   Bull   --      HM      --
26    Switch Matrix Table
27    Score   Single  Double  Triple
28    1       DN      EN      FN
29    2       AL      BL      CL
30    3       AN      BN      CN
31    4       DL      EL      FL
32    5       AP      BP      CP
33    6       GL      HL      GP
34    7       DO      EO      FO
35    8       GI      HI      GM
36    9       AO      BO      CO
37    10      AI      BI      CI
38    11      AK      BK      CK
39    12      DP      EP      FP
40    13      AM      BM      CM
41    14      GK      HK      GO
42    15      GJ      HJ      GN
43    16      AJ      BJ      CJ
44    17      DM      EM      FM
45    18      DI      EI      FI
46    19      DJ      EJ      FJ
47    20      DK      EK      FK
48    Bull    --      HM      --
4949
5050
51   TODO:
52   - Dip Switches (Controls credits per coin), Currently 2 coins per credit
53   - Test Mode Won't Activate
54   - Layout with Lamps   
51    TODO:
52    - Dip Switches (Controls credits per coin), Currently 2 coins per credit
53    - Test Mode Won't Activate
54    - Layout with Lamps
5555*/
5656
5757#include "emu.h"
r26736r26737
6565#define SCREEN_TAG      "screen"
6666#define M6809_TAG       "u3"
6767#define TMS9118_TAG     "u11"
68#define PIA6821_U4_TAG   "u4"
69#define PIA6821_U17_TAG   "u17"
70#define   PTM6840_TAG      "u16"
71#define SPEAKER_TAG      "speaker"
68#define PIA6821_U4_TAG  "u4"
69#define PIA6821_U17_TAG "u17"
70#define PTM6840_TAG     "u16"
71#define SPEAKER_TAG     "speaker"
7272
7373class arachnid_state : public driver_device
7474{
r26736r26737
9595   DECLARE_WRITE8_MEMBER( pia_u4_pb_w );
9696   DECLARE_WRITE8_MEMBER( pia_u4_pca_w );
9797   DECLARE_WRITE8_MEMBER( pia_u4_pcb_w );
98   
98
9999   DECLARE_READ8_MEMBER( pia_u17_pa_r );
100100   DECLARE_READ8_MEMBER( pia_u17_pca_r );
101   DECLARE_WRITE8_MEMBER( pia_u17_pb_w );   
102   DECLARE_WRITE8_MEMBER( pia_u17_pcb_w );   
101   DECLARE_WRITE8_MEMBER( pia_u17_pb_w );
102   DECLARE_WRITE8_MEMBER( pia_u17_pcb_w );
103103
104104   DECLARE_WRITE8_MEMBER(ptm_o1_callback);
105105
r26736r26737
421421
422422static const pia6821_interface pia_u4_intf =
423423{
424   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pa_r),   // input A - From Switch Matrix
424   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pa_r),   // input A - From Switch Matrix
425425   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pb_r),   // input B - From Switch Matrix
426426   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pca_r),  // input CA1 - SW1 Coin In (Coin Door)
427   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pcb_r),   // input CB1 - SW2 Test Mode (Coin Door)
427   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pcb_r),  // input CB1 - SW2 Test Mode (Coin Door)
428428   DEVCB_NULL,                                         // input CA2
429   DEVCB_NULL,                                  // input CB2
430   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pa_w),   // output A - To Switch Matrix
431   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pb_w),   // output B - To Switch Matrix
429   DEVCB_NULL,                                         // input CB2
430   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pa_w),   // output A - To Switch Matrix
431   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pb_w),   // output B - To Switch Matrix
432432   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pca_w),  // output CA2 - Remove Darts Lamp
433433   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u4_pcb_w),  // output CB2 - Throw Darts Lamp
434434   DEVCB_NULL,                                         // irq A
r26736r26737
437437
438438static const pia6821_interface pia_u17_intf =
439439{
440   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u17_pa_r),   // input A - Select, Player Change, Coin, Test, DIPSW1
441   DEVCB_NULL,                                 // input B
440   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u17_pa_r),  // input A - Select, Player Change, Coin, Test, DIPSW1
441   DEVCB_NULL,                                         // input B
442442   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u17_pca_r), // input CA1 - 1000 Hz Input
443   DEVCB_NULL,                                 // input CB1
443   DEVCB_NULL,                                         // input CB1
444444   DEVCB_NULL,                                         // input CA2
445   DEVCB_NULL,                                  // input CB2
446   DEVCB_NULL,                                 // output A
447   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u17_pb_w),   // output B - Select Lamp, Player Change Lamp
448   DEVCB_NULL,                                 // output CA2
445   DEVCB_NULL,                                         // input CB2
446   DEVCB_NULL,                                         // output A
447   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u17_pb_w),  // output B - Select Lamp, Player Change Lamp
448   DEVCB_NULL,                                         // output CA2
449449   DEVCB_DRIVER_MEMBER(arachnid_state, pia_u17_pcb_w), // output CB2 - Target Lamp
450450   DEVCB_NULL,                                         // irq A
451451   DEVCB_NULL                                          // irq B
r26736r26737
461461
462462void arachnid_state::machine_start()
463463{
464
465464}
466465
467466/***************************************************************************
trunk/src/mame/drivers/1942.c
r26736r26737
107107
108108WRITE8_MEMBER(_1942_state::c1942p_f600_w)
109109{
110//   printf("c1942p_f600_w %02x\n", data);
110//  printf("c1942p_f600_w %02x\n", data);
111111}
112112
113113WRITE8_MEMBER(_1942_state::c1942p_palette_w)
r26736r26737
124124static ADDRESS_MAP_START( c1942p_map, AS_PROGRAM, 8, _1942_state )
125125   AM_RANGE(0x0000, 0x7fff) AM_ROM
126126   AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
127   
127
128128   AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(c1942_fgvideoram_w) AM_SHARE("fg_videoram")
129129   AM_RANGE(0xd800, 0xdbff) AM_RAM_WRITE(c1942_bgvideoram_w) AM_SHARE("bg_videoram")
130130
r26736r26737
146146   AM_RANGE(0xf701, 0xf701) AM_READ_PORT("SYSTEM")
147147   AM_RANGE(0xf702, 0xf702) AM_READ_PORT("DSWB")
148148   AM_RANGE(0xf703, 0xf703) AM_READ_PORT("P1")
149   AM_RANGE(0xf704, 0xf704) AM_READ_PORT("P2") 
149   AM_RANGE(0xf704, 0xf704) AM_READ_PORT("P2")
150150ADDRESS_MAP_END
151151
152152static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, _1942_state )
trunk/src/mame/drivers/peplus.c
r26736r26737
55345534
55355535  Super Aces shows as just Bonus Poker
55365536  Triple Bonus Poker Plus shows as just Triple Bonus
5537
5537
55385538*/
55395539   ROM_REGION( 0x10000, "maincpu", 0 )
55405540   ROM_LOAD( "xmp00017.u67",   0x00000, 0x10000, CRC(129e6eaa) SHA1(1dd2b83a672a618f338b553a6cbd598b6d4ce672) )
trunk/src/mame/drivers/ghosteo.c
r26736r26737
9393   required_device<i2cmem_device> m_i2cmem;
9494   required_device<s3c2410_device> m_s3c2410;
9595   required_shared_ptr<UINT32> m_system_memory;
96     
96
9797   int m_security_count;
9898   UINT32 m_bballoon_port[20];
9999   struct nand_t m_nand;
r26736r26737
614614void ghosteo_state::machine_start()
615615{
616616   m_flash = (UINT8 *)memregion( "user1")->base();
617   
617
618618   // Set up the QS1000 program ROM banking, taking care not to overlap the internal RAM
619619   machine().device("qs1000:cpu")->memory().space(AS_IO).install_read_bank(0x0100, 0xffff, "bank");
620620   membank("qs1000:bank")->configure_entries(0, 8, memregion("qs1000:cpu")->base()+0x100, 0x10000);
r26736r26737
665665
666666   /* sound hardware */
667667   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
668   
668
669669   MCFG_QS1000_ADD("qs1000", XTAL_24MHz, qs1000_intf)
670670   MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
671671   MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
r26736r26737
736736   ROM_LOAD( "flash.u1",     0x000000, 0x2000000, BAD_DUMP CRC(73285634) SHA1(4d0210c1bebdf3113a99978ffbcd77d6ee854168) ) // missing ECC data
737737
738738   // banked every 0x10000 bytes ?
739   ROM_REGION( 0x080000, "qs1000:cpu", 0 )
739   ROM_REGION( 0x080000, "qs1000:cpu", 0 )
740740   ROM_LOAD( "b2.u20",       0x000000, 0x080000, CRC(0a12334c) SHA1(535b5b34f28435517218100d70147d87809f485a) )
741741
742   ROM_REGION( 0x1000000, "qs1000", 0 )
742   ROM_REGION( 0x1000000, "qs1000", 0 )
743743   ROM_LOAD( "b1.u16",       0x000000, 0x100000, CRC(c42c1c85) SHA1(e1f49d556ffd6bc27142a7784c3bb8e37999857d) ) /* QDSP samples (SFX) */
744744   ROM_LOAD( "qs1001a.u17",  0x200000, 0x080000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) ) /* QDSP wavetable rom */
745745ROM_END
r26736r26737
752752   ROM_REGION( 0x080000, "qs1000:cpu", 0 )
753753   ROM_LOAD( "ht.u20",       0x000000, 0x080000, CRC(c0581fce) SHA1(dafce679002534ffabed249a92e6b83301b8312b) )
754754
755   ROM_REGION( 0x1000000, "qs1000", 0 )
755   ROM_REGION( 0x1000000, "qs1000", 0 )
756756   ROM_LOAD( "ht.u16",       0x000000, 0x100000, CRC(6a590a3a) SHA1(c1140f70c919661162334db66c6aa0ad656bfc47) ) /* QDSP samples (SFX) */
757757   ROM_LOAD( "qs1001a.u17",  0x200000, 0x080000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) ) /* QDSP wavetable rom */
758758ROM_END
r26736r26737
766766   ROM_REGION( 0x080000, "qs1000:cpu", 0 )
767767   ROM_LOAD( "4m.eeprom_c.s(bad1h).u20",       0x000000, 0x080000, CRC(f81a6530) SHA1(c7fa412102328d06823e73d7d07cadfc25db6d28) )
768768
769   ROM_REGION( 0x1000000, "qs1000", 0 )
769   ROM_REGION( 0x1000000, "qs1000", 0 )
770770   ROM_LOAD( "8m.eprom_c.s(f8b1h).u16",       0x000000, 0x100000, CRC(238a85ab) SHA1(ddd79429c0c1e67fcbca1e4ebded97ea46229f0b) ) /* QDSP samples (SFX) */
771771   ROM_LOAD( "qs1001a.u17",  0x200000, 0x080000, CRC(d13c6407) SHA1(57b14f97c7d4f9b5d9745d3571a0b7115fbe3176) ) /* QDSP wavetable rom */
772772ROM_END
trunk/src/mame/drivers/deco_ld.c
r26736r26737
640640   ROM_REGION( 0x40000, "misc", 0 )
641641   ROM_LOAD( "lp4-1.pal16l8cn.bin",        0x0000, 0x40000, CRC(4aeb2c7e) SHA1(3c962656cffc8d927047c64a15afccab767d776f) ) // dumped with cgfm's tool
642642   ROM_LOAD( "lp4-1.pal16l8cn.pld",        0x0000, 0x00f71, CRC(ac1f1177) SHA1(ab721a840207354916c96e0ae83220fed12c6352) )
643//   ROM_LOAD( "lp4-2-pal10l8.d6.jed",       0x0000, 0x00249, CRC(309b3ce5) SHA1(04f185911d33730004c7cd44a693dd1b69b82032) )
643//  ROM_LOAD( "lp4-2-pal10l8.d6.jed",       0x0000, 0x00249, CRC(309b3ce5) SHA1(04f185911d33730004c7cd44a693dd1b69b82032) )
644644   ROM_LOAD( "lp4-2-pal10l8.d6.bin",       0x0000, 0x0002c, CRC(e594fd13) SHA1(4bb8a9b7cf8f8eaa3c9f290b6e5085a10c927e20) )
645645
646646   ROM_REGION( 0x20, "proms", 0 )
trunk/src/mame/drivers/acefruit.c
r26736r26737
4444   UINT32 screen_update_acefruit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4545   INTERRUPT_GEN_MEMBER(acefruit_vblank);
4646   void acefruit_update_irq(int vpos);
47   
47
4848   enum
4949   {
5050      TIMER_ACEFRUIT_REFRESH
5151   };
5252
5353protected:
54   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);   
54   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
5555};
5656
5757
r26736r26737
8383   switch(id)
8484   {
8585   case TIMER_ACEFRUIT_REFRESH:
86         
86
8787         m_screen->update_partial(vpos );
8888         acefruit_update_irq(vpos);
8989
trunk/src/mame/drivers/hornet.c
r26736r26737
393393   DECLARE_WRITE_LINE_MEMBER(voodoo_vblank_1);
394394   DECLARE_WRITE16_MEMBER(soundtimer_en_w);
395395   DECLARE_WRITE16_MEMBER(soundtimer_count_w);
396   
396
397397   DECLARE_DRIVER_INIT(hornet);
398398   DECLARE_DRIVER_INIT(hornet_2board);
399399   virtual void machine_start();
trunk/src/mame/drivers/naomi.c
r26736r26737
39553955   ROM_LOAD16_WORD("main_eeprom.bin", 0x0000, 0x0080, CRC(fea29cbb) SHA1(4099f1747aafa07db34f6e072cd9bfaa83bae10e) )
39563956
39573957   ROM_REGION( 0x4000000, "rom_board", ROMREGION_ERASEFF)
3958   ROM_LOAD( "epr-22073.ic22", 0x0000000, 0x200000, CRC(dbeee93c) SHA1(95a761aa07b231f36e1656f46d3a711a4eea0210) )
3959   ROM_LOAD( "mpr-22074.ic1",  0x0800000, 0x800000, CRC(fd6070a4) SHA1(8fb01c39e5deb002401b971aa415f7d7e220134d) )
3960   ROM_LOAD( "mpr-22075.ic2",  0x1000000, 0x800000, CRC(4c11d298) SHA1(d4edfd2a2c81dd45356ee53de27a86e04a13011b) )
3961   ROM_LOAD( "mpr-22076.ic3",  0x1800000, 0x800000, CRC(e4c98898) SHA1(c13c842874a9266a7bd5856f298687e0f8c07fc1) )
3962   ROM_LOAD( "mpr-22077.ic4",  0x2000000, 0x400000, CRC(f33d7620) SHA1(82c3e2bb6feed68670798efa3e17c9f6d6d0070a) )
3958   ROM_LOAD( "epr-22073.ic22", 0x0000000, 0x200000, CRC(dbeee93c) SHA1(95a761aa07b231f36e1656f46d3a711a4eea0210) )
3959   ROM_LOAD( "mpr-22074.ic1",  0x0800000, 0x800000, CRC(fd6070a4) SHA1(8fb01c39e5deb002401b971aa415f7d7e220134d) )
3960   ROM_LOAD( "mpr-22075.ic2",  0x1000000, 0x800000, CRC(4c11d298) SHA1(d4edfd2a2c81dd45356ee53de27a86e04a13011b) )
3961   ROM_LOAD( "mpr-22076.ic3",  0x1800000, 0x800000, CRC(e4c98898) SHA1(c13c842874a9266a7bd5856f298687e0f8c07fc1) )
3962   ROM_LOAD( "mpr-22077.ic4",  0x2000000, 0x400000, CRC(f33d7620) SHA1(82c3e2bb6feed68670798efa3e17c9f6d6d0070a) )
39633963
39643964   // on-cart X76F100 eeprom contents
39653965   ROM_REGION( 0x84, "naomibd_eeprom", 0 )
3966   ROM_LOAD( "x76f100.ic37", 0x000000, 0x000084, CRC(c79251d5) SHA1(3e70bbbb6d28bade7eec7e27d716463045656f98) )
3966   ROM_LOAD( "x76f100.ic37", 0x000000, 0x000084, CRC(c79251d5) SHA1(3e70bbbb6d28bade7eec7e27d716463045656f98) )
39673967
39683968   ROM_REGION( 4, "rom_key", 0 )
3969   ROM_LOAD( "tduno.key",    0x000000, 0x000004, CRC(217ce9d0) SHA1(39d71a84b2769cd0c1521ddf1c617c18f577020c) )
3969   ROM_LOAD( "tduno.key",    0x000000, 0x000004, CRC(217ce9d0) SHA1(39d71a84b2769cd0c1521ddf1c617c18f577020c) )
39703970ROM_END
39713971
39723972ROM_START( tduno2 )
r26736r26737
56455645   NAOMI_DEFAULT_EEPROM
56465646
56475647   ROM_REGION( 0xb000000, "rom_board", ROMREGION_ERASEFF)
5648   ROM_LOAD( "wk3vera_fl1.2d", 0x0400000, 0x800000, CRC(cfdd5c5d) SHA1(ffc5d38edb600462574d4ed8ce5ada8625d59c74) )
5649   ROM_LOAD( "wk3vera_fl2.2c", 0x0c00000, 0x800000, CRC(ad2577d5) SHA1(f7b6bab001c5f5cf0b33a70cd0dfdca8f7d25921) )
5648   ROM_LOAD( "wk3vera_fl1.2d", 0x0400000, 0x800000, CRC(cfdd5c5d) SHA1(ffc5d38edb600462574d4ed8ce5ada8625d59c74) )
5649   ROM_LOAD( "wk3vera_fl2.2c", 0x0c00000, 0x800000, CRC(ad2577d5) SHA1(f7b6bab001c5f5cf0b33a70cd0dfdca8f7d25921) )
56505650   ROM_LOAD( "wk1ma2.4m",   0x1000000, 0x1000000, CRC(650590ec) SHA1(bb9d5d5df2321df24ee0fb9e8bf2757d5277f8ea) )
56515651   ROM_RELOAD( 0x800000, 0x400000)
56525652   ROM_LOAD( "wk1ma3.4l",   0x2000000, 0x1000000, CRC(3b340dc0) SHA1(2412e41d5bd74d1233fb91f8ce2276a318bfc53d) )
trunk/src/mame/drivers/galaxold.c
r26736r26737
934934
935935static ADDRESS_MAP_START( racknrol_io, AS_IO, 8, galaxold_state )
936936   AM_RANGE(0x1d, 0x1d) AM_DEVWRITE("snsnd", sn76489a_device, write)
937//   AM_RANGE(0x1e, 0x1e) AM_WRITENOP
938//   AM_RANGE(0x1f, 0x1f) AM_WRITENOP
937//  AM_RANGE(0x1e, 0x1e) AM_WRITENOP
938//  AM_RANGE(0x1f, 0x1f) AM_WRITENOP
939939   AM_RANGE(0x20, 0x3f) AM_WRITE(racknrol_tiles_bank_w) AM_SHARE("racknrol_tbank")
940940   AM_RANGE(S2650_SENSE_PORT, S2650_SENSE_PORT) AM_READ_PORT("SENSE")
941941ADDRESS_MAP_END
trunk/src/mame/drivers/atarig42.c
r26736r26737
569569
570570static MACHINE_CONFIG_DERIVED( atarig42_0x200, atarig42 )
571571   MCFG_ATARIRLE_ADD("rle", modesc_0x200)
572   
572
573573   /* ASIC65 */
574574   MCFG_ASIC65_ADD("asic65", ASIC65_ROMBASED)
575575MACHINE_CONFIG_END
576576
577577static MACHINE_CONFIG_DERIVED( atarig42_0x400, atarig42 )
578578   MCFG_ATARIRLE_ADD("rle", modesc_0x400)
579   
579
580580   /* ASIC65 */
581581   MCFG_ASIC65_ADD("asic65", ASIC65_GUARDIANS)
582582MACHINE_CONFIG_END
r26736r26737
783783   main.set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this));
784784
785785   /*
786    Road Riot color MUX
786   Road Riot color MUX
787787
788    CRA10=!MGEP*!AN.VID7*AN.0               -- if (mopri < pfpri) && (!alpha)
789       +!AN.VID7*AN.0*MO.0                  or if (mopix == 0) && (!alpha)
788   CRA10=!MGEP*!AN.VID7*AN.0               -- if (mopri < pfpri) && (!alpha)
789      +!AN.VID7*AN.0*MO.0                  or if (mopix == 0) && (!alpha)
790790
791    CRA9=MGEP*!AN.VID7*AN.0*!MO.0           -- if (mopri >= pfpri) && (mopix != 0) && (!alpha)
792       +!AN.VID7*AN.0*PF.VID9               or if (pfpix & 0x200) && (!alpha)
791   CRA9=MGEP*!AN.VID7*AN.0*!MO.0           -- if (mopri >= pfpri) && (mopix != 0) && (!alpha)
792      +!AN.VID7*AN.0*PF.VID9               or if (pfpix & 0x200) && (!alpha)
793793
794    CRA8=MGEP*!AN.VID7*AN.0*!MO.0*MVID8     -- if (mopri >= pfpri) && (mopix != 0) && (mopix & 0x100) && (!alpha)
795       +!MGEP*!AN.VID7*AN.0*PF.VID8         or if (mopri < pfpri) && (pfpix & 0x100) && (!alpha)
796       +!AN.VID7*AN.0*MO.0*PF.VID8          or if (pfpix & 0x100) && (!alpha)
794   CRA8=MGEP*!AN.VID7*AN.0*!MO.0*MVID8     -- if (mopri >= pfpri) && (mopix != 0) && (mopix & 0x100) && (!alpha)
795      +!MGEP*!AN.VID7*AN.0*PF.VID8         or if (mopri < pfpri) && (pfpix & 0x100) && (!alpha)
796      +!AN.VID7*AN.0*MO.0*PF.VID8          or if (pfpix & 0x100) && (!alpha)
797797
798    CRMUXB=!AN.VID7*AN.0                    -- if (!alpha)
798   CRMUXB=!AN.VID7*AN.0                    -- if (!alpha)
799799
800    CRMUXA=!MGEP                            -- if (mopri < pfpri)
801       +MO.0                                or (mopix == 0)
802       +AN.VID7                             or (alpha)
803       +!AN.0
800   CRMUXA=!MGEP                            -- if (mopri < pfpri)
801      +MO.0                                or (mopix == 0)
802      +AN.VID7                             or (alpha)
803      +!AN.0
804804*/
805805}
806806
r26736r26737
818818   main.set_direct_update_handler(direct_update_delegate(FUNC(atarig42_state::atarig42_sloop_direct_handler), this));
819819
820820   /*
821    Guardians color MUX
821   Guardians color MUX
822822
823    CRA10=MGEP*!AN.VID7*AN.0*!MO.0          -- if (mopri >= pfpri) && (!alpha) && (mopix != 0)
823   CRA10=MGEP*!AN.VID7*AN.0*!MO.0          -- if (mopri >= pfpri) && (!alpha) && (mopix != 0)
824824
825    CRA9=MGEP*!AN.VID7*AN.0*!MO.0*MVID9     -- if (mopri >= pfpri) && (!alpha) && (mopix != 0) && (mopix & 0x200)
826       +!MGEP*!AN.VID7*AN.0*PF.VID9         or if (mopri < pfpri) && (!alpha) && (pfpix & 0x200)
827       +!AN.VID7*AN.0*MO.0*PF.VID9          or if (mopix == 0) && (!alpha) && (pfpix & 0x200)
825   CRA9=MGEP*!AN.VID7*AN.0*!MO.0*MVID9     -- if (mopri >= pfpri) && (!alpha) && (mopix != 0) && (mopix & 0x200)
826      +!MGEP*!AN.VID7*AN.0*PF.VID9         or if (mopri < pfpri) && (!alpha) && (pfpix & 0x200)
827      +!AN.VID7*AN.0*MO.0*PF.VID9          or if (mopix == 0) && (!alpha) && (pfpix & 0x200)
828828
829    CRA8=MGEP*!AN.VID7*AN.0*!MO.0*MVID8     -- if (mopri >= pfpri) && (!alpha) && (mopix != 0) && (mopix & 0x100)
830       +!MGEP*!AN.VID7*AN.0*PF.VID8         or if (mopri < pfpri) && (!alpha) && (pfpix & 0x100)
831       +!AN.VID7*AN.0*MO.0*PF.VID8          or if (mopix == 0) && (!alpha) && (pfpix & 0x100)
829   CRA8=MGEP*!AN.VID7*AN.0*!MO.0*MVID8     -- if (mopri >= pfpri) && (!alpha) && (mopix != 0) && (mopix & 0x100)
830      +!MGEP*!AN.VID7*AN.0*PF.VID8         or if (mopri < pfpri) && (!alpha) && (pfpix & 0x100)
831      +!AN.VID7*AN.0*MO.0*PF.VID8          or if (mopix == 0) && (!alpha) && (pfpix & 0x100)
832832
833    CRMUXB=!AN.VID7*AN.0                    -- if (!alpha)
833   CRMUXB=!AN.VID7*AN.0                    -- if (!alpha)
834834
835    CRMUXA=!MGEP                            -- if (mopri < pfpri)
836       +MO.0                                or (mopix == 0)
837       +AN.VID7                             or (alpha)
838       +!AN.0
835   CRMUXA=!MGEP                            -- if (mopri < pfpri)
836      +MO.0                                or (mopix == 0)
837      +AN.VID7                             or (alpha)
838      +!AN.0
839839*/
840840}
841841
trunk/src/mame/drivers/plygonet.c
r26736r26737
546546{
547547   // .... .xxx - Sound bank
548548   // ...x .... - NMI clear (clocked?)
549   
549
550550   if ((m_sound_ctrl & 7) != (data & 7))
551551      membank("bank1")->set_entry(data & 7);
552552
trunk/src/mame/drivers/pong.c
r26736r26737
148148
149149   // ----------------------------------------------------------------------------------------
150150   // horizontal counter
151    // ----------------------------------------------------------------------------------------
151   // ----------------------------------------------------------------------------------------
152152   TTL_7493(ic_f8, clk, ic_f8.QA, ic_e7b.QQ, ic_e7b.QQ)    // f8, f9, f6b
153153   TTL_7493(ic_f9, ic_f8.QD, ic_f9.QA, ic_e7b.QQ, ic_e7b.QQ)   // f8, f9, f6b
154154   TTL_74107(ic_f6b, ic_f9.QD, high, high, ic_e7b.Q)
r26736r26737
166166   NET_ALIAS(256H, ic_f6b.Q)
167167   NET_ALIAS(256HQ, ic_f6b.QQ)
168168
169    // ----------------------------------------------------------------------------------------
169   // ----------------------------------------------------------------------------------------
170170   // vertical counter
171    // ----------------------------------------------------------------------------------------
171   // ----------------------------------------------------------------------------------------
172172   TTL_7493(ic_e8, hreset, ic_e8.QA, ic_e7a.QQ, ic_e7a.QQ) // e8, e9, d9b
173173   TTL_7493(ic_e9, ic_e8.QD,ic_e9.QA,  ic_e7a.QQ, ic_e7a.QQ)   // e8, e9, d9b
174174   TTL_74107(ic_d9b, ic_e9.QD, high, high, ic_e7a.Q)
r26736r26737
186186   NET_ALIAS(256VQ, ic_d9b.QQ)
187187
188188
189    // ----------------------------------------------------------------------------------------
189   // ----------------------------------------------------------------------------------------
190190   // hblank flip flop
191    // ----------------------------------------------------------------------------------------
191   // ----------------------------------------------------------------------------------------
192192
193193   TTL_7400_NAND(ic_g5b, 16H, 64H)
194194
r26736r26737
200200   NET_ALIAS(hblankQ,  ic_h5b.Q)
201201   TTL_7400_NAND(hsyncQ, hblank, 32H)
202202
203    // ----------------------------------------------------------------------------------------
203   // ----------------------------------------------------------------------------------------
204204   // vblank flip flop
205    // ----------------------------------------------------------------------------------------
205   // ----------------------------------------------------------------------------------------
206206   TTL_7402_NOR(ic_f5c, ic_f5d.Q, vreset)
207207   TTL_7402_NOR(ic_f5d, ic_f5c.Q, 16V)
208208
r26736r26737
213213   TTL_7410_NAND(ic_g5a, vblank, 4V, ic_h5a.Q)
214214   NET_ALIAS(vsyncQ, ic_g5a.Q)
215215
216    // ----------------------------------------------------------------------------------------
216   // ----------------------------------------------------------------------------------------
217217   // move logic
218    // ----------------------------------------------------------------------------------------
218   // ----------------------------------------------------------------------------------------
219219
220220   TTL_7400_NAND(ic_e1d, hit_sound, ic_e1c.Q)
221221   TTL_7400_NAND(ic_e1c, ic_f1.QC, ic_f1.QD)
r26736r26737
245245   NET_ALIAS(Aa, ic_h4c.Q)
246246   NET_ALIAS(Ba, ic_h4b.Q)
247247
248    // ----------------------------------------------------------------------------------------
248   // ----------------------------------------------------------------------------------------
249249   // hvid circuit
250    // ----------------------------------------------------------------------------------------
250   // ----------------------------------------------------------------------------------------
251251
252252   TTL_7400_NAND(hball_resetQ, Serve, attractQ)
253253
r26736r26737
258258   TTL_7420_NAND(ic_h6b, ic_g6b.Q, ic_h7.RC, ic_g7.QC, ic_g7.QD)
259259   NET_ALIAS(hvidQ, ic_h6b.Q)
260260
261    // ----------------------------------------------------------------------------------------
261   // ----------------------------------------------------------------------------------------
262262   // vvid circuit
263    // ----------------------------------------------------------------------------------------
263   // ----------------------------------------------------------------------------------------
264264
265265   TTL_9316(ic_b3, hsyncQ, high, vblankQ, high, ic_b2b.Q, a6, b6, c6, d6)
266266   TTL_9316(ic_a3, hsyncQ, ic_b3.RC, high, high, ic_b2b.Q, low, low, low, low)
r26736r26737
272272   NET_ALIAS(vpos32, ic_a3.QB)
273273   NET_ALIAS(vpos16, ic_a3.QA)
274274
275    // ----------------------------------------------------------------------------------------
275   // ----------------------------------------------------------------------------------------
276276   // vball ctrl circuit
277    // ----------------------------------------------------------------------------------------
277   // ----------------------------------------------------------------------------------------
278278
279279   TTL_7450_ANDORINVERT(ic_a6a, b1, 256HQ, b2, 256H)
280280   TTL_7450_ANDORINVERT(ic_a6b, c1, 256HQ, c2, 256H)
r26736r26737
298298   NET_ALIAS(c6, ic_b4.SC)
299299   NET_ALIAS(d6, ic_b4.SD)
300300
301    // ----------------------------------------------------------------------------------------
301   // ----------------------------------------------------------------------------------------
302302   // serve monoflop
303    // ----------------------------------------------------------------------------------------
303   // ----------------------------------------------------------------------------------------
304304
305305   TTL_7404_INVERT(f4_trig, rstspeed)
306306
307307   NETDEV_R(ic_f4_serve_R, RES_K(330))
308    NETDEV_C(ic_f4_serve_C, CAP_U(4.7))
309    NETDEV_NE555(ic_f4_serve)
308   NETDEV_C(ic_f4_serve_C, CAP_U(4.7))
309   NETDEV_NE555(ic_f4_serve)
310310
311    NET_C(ic_f4_serve.VCC, V5)
312    NET_C(ic_f4_serve.GND, GND)
313    NET_C(ic_f4_serve.RESET, V5)
314    NET_C(ic_f4_serve_R.1, V5)
315    NET_C(ic_f4_serve_R.2, ic_f4_serve.THRESH)
316    NET_C(ic_f4_serve_R.2, ic_f4_serve.DISCH)
317    NET_C(f4_trig, ic_f4_serve.TRIG)
318    NET_C(ic_f4_serve_R.2, ic_f4_serve_C.1)
319    NET_C(GND, ic_f4_serve_C.2)
311   NET_C(ic_f4_serve.VCC, V5)
312   NET_C(ic_f4_serve.GND, GND)
313   NET_C(ic_f4_serve.RESET, V5)
314   NET_C(ic_f4_serve_R.1, V5)
315   NET_C(ic_f4_serve_R.2, ic_f4_serve.THRESH)
316   NET_C(ic_f4_serve_R.2, ic_f4_serve.DISCH)
317   NET_C(f4_trig, ic_f4_serve.TRIG)
318   NET_C(ic_f4_serve_R.2, ic_f4_serve_C.1)
319   NET_C(GND, ic_f4_serve_C.2)
320320
321    TTL_7427_NOR(ic_e5a, ic_f4_serve.OUT, StopG, runQ)
321   TTL_7427_NOR(ic_e5a, ic_f4_serve.OUT, StopG, runQ)
322322   TTL_7474(ic_b5b_serve, pad1, ic_e5a, ic_e5a, high)
323323
324324   NET_ALIAS(Serve, ic_b5b_serve.QQ)
325325   NET_ALIAS(ServeQ, ic_b5b_serve.Q)
326326
327    // ----------------------------------------------------------------------------------------
327   // ----------------------------------------------------------------------------------------
328328   // score logic
329    // ----------------------------------------------------------------------------------------
329   // ----------------------------------------------------------------------------------------
330330
331331   TTL_7474(ic_h3a, 4H, 128H, high, attractQ)
332332
333    // ----------------------------------------------------------------------------------------
333   // ----------------------------------------------------------------------------------------
334334   // sound logic
335    // ----------------------------------------------------------------------------------------
335   // ----------------------------------------------------------------------------------------
336336   TTL_7474(ic_c2a, vpos256, high, hitQ, high)
337337   TTL_74107(ic_f3_topbot, vblank, vvid, vvidQ, ServeQ)
338338
339    // ----------------------------------------------------------------------------------------
339   // ----------------------------------------------------------------------------------------
340340   // monoflop with NE555 determines duration of score sound
341    // ----------------------------------------------------------------------------------------
341   // ----------------------------------------------------------------------------------------
342342
343343   NETDEV_R(ic_g4_R, RES_K(220))
344    NETDEV_C(ic_g4_C, CAP_U(1))
345    NETDEV_NE555(ic_g4_sc)
346    NET_ALIAS(SC, ic_g4_sc.OUT)
344   NETDEV_C(ic_g4_C, CAP_U(1))
345   NETDEV_NE555(ic_g4_sc)
346   NET_ALIAS(SC, ic_g4_sc.OUT)
347347
348    NET_C(ic_g4_sc.VCC, V5)
349    NET_C(ic_g4_sc.GND, GND)
350    NET_C(ic_g4_sc.RESET, V5)
351    NET_C(ic_g4_R.1, V5)
352    NET_C(ic_g4_R.2, ic_g4_sc.THRESH)
353    NET_C(ic_g4_R.2, ic_g4_sc.DISCH)
354    NET_C(MissQ, ic_g4_sc.TRIG)
355    NET_C(ic_g4_R.2, ic_g4_C.1)
356    NET_C(GND, ic_g4_C.2)
348   NET_C(ic_g4_sc.VCC, V5)
349   NET_C(ic_g4_sc.GND, GND)
350   NET_C(ic_g4_sc.RESET, V5)
351   NET_C(ic_g4_R.1, V5)
352   NET_C(ic_g4_R.2, ic_g4_sc.THRESH)
353   NET_C(ic_g4_R.2, ic_g4_sc.DISCH)
354   NET_C(MissQ, ic_g4_sc.TRIG)
355   NET_C(ic_g4_R.2, ic_g4_C.1)
356   NET_C(GND, ic_g4_C.2)
357357
358    NET_ALIAS(hit_sound_en, ic_c2a.QQ)
358   NET_ALIAS(hit_sound_en, ic_c2a.QQ)
359359   TTL_7400_NAND(hit_sound, hit_sound_en, vpos16)
360360   TTL_7400_NAND(score_sound, SC, vpos32)
361361   TTL_7400_NAND(topbothitsound, ic_f3_topbot.Q, vpos32)
r26736r26737
365365   NET_ALIAS(sound, ic_c1b.Q)
366366
367367
368    // ----------------------------------------------------------------------------------------
368   // ----------------------------------------------------------------------------------------
369369   // paddle1 logic 1
370    // ----------------------------------------------------------------------------------------
370   // ----------------------------------------------------------------------------------------
371371
372    NETDEV_POT(ic_b9_POT, RES_K(1))     // This is a guess!!
373    NETDEV_R(ic_b9_RPRE, 470)
372   NETDEV_POT(ic_b9_POT, RES_K(1))     // This is a guess!!
373   NETDEV_R(ic_b9_RPRE, 470)
374374
375    NET_C(ic_b9_POT.1, V5)
376    NET_C(ic_b9_POT.3, GND)
377    NET_C(ic_b9_POT.2, ic_b9_RPRE.1)
378    NET_C(ic_b9_RPRE.2, ic_b9.CONT)
375   NET_C(ic_b9_POT.1, V5)
376   NET_C(ic_b9_POT.3, GND)
377   NET_C(ic_b9_POT.2, ic_b9_RPRE.1)
378   NET_C(ic_b9_RPRE.2, ic_b9.CONT)
379379
380    NETDEV_R(ic_b9_R, RES_K(71))
381    NETDEV_C(ic_b9_C, CAP_U(.1))
382    NETDEV_D(ic_b9_D, 1N914)
383    NETDEV_NE555(ic_b9)
380   NETDEV_R(ic_b9_R, RES_K(71))
381   NETDEV_C(ic_b9_C, CAP_U(.1))
382   NETDEV_D(ic_b9_D, 1N914)
383   NETDEV_NE555(ic_b9)
384384
385    NET_C(ic_b9.VCC, V5)
386    NET_C(ic_b9.GND, GND)
387    NET_C(ic_b9.RESET, V5)
388    NET_C(ic_b9_R.1, V5)
389    NET_C(ic_b9_R.2, ic_b9.THRESH)
390    NET_C(ic_b9_R.2, ic_b9_D.A)
391    NET_C(ic_b9_D.K, ic_b9.DISCH)
392    NET_C(256VQ, ic_b9.TRIG)
393    NET_C(ic_b9_R.2, ic_b9_C.1)
394    NET_C(GND, ic_b9_C.2)
385   NET_C(ic_b9.VCC, V5)
386   NET_C(ic_b9.GND, GND)
387   NET_C(ic_b9.RESET, V5)
388   NET_C(ic_b9_R.1, V5)
389   NET_C(ic_b9_R.2, ic_b9.THRESH)
390   NET_C(ic_b9_R.2, ic_b9_D.A)
391   NET_C(ic_b9_D.K, ic_b9.DISCH)
392   NET_C(256VQ, ic_b9.TRIG)
393   NET_C(ic_b9_R.2, ic_b9_C.1)
394   NET_C(GND, ic_b9_C.2)
395395
396396   TTL_7404_INVERT(ic_c9b, ic_b9.OUT)
397397   TTL_7400_NAND(ic_b7b, ic_a7b.Q, hsyncQ)
r26736r26737
404404   NET_ALIAS(c1, ic_b8.QC)
405405   NET_ALIAS(d1, ic_b8.QD)
406406
407    // ----------------------------------------------------------------------------------------
407   // ----------------------------------------------------------------------------------------
408408   // paddle1 logic 2
409    // ----------------------------------------------------------------------------------------
409   // ----------------------------------------------------------------------------------------
410410
411411   NETDEV_POT(ic_a9_POT, RES_K(1))     // This is a guess!!
412    NETDEV_R(ic_a9_RPRE, 470)
412   NETDEV_R(ic_a9_RPRE, 470)
413413
414    NET_C(ic_a9_POT.1, V5)
415    NET_C(ic_a9_POT.3, GND)
416    NET_C(ic_a9_POT.2, ic_a9_RPRE.1)
417    NET_C(ic_a9_RPRE.2, ic_a9.CONT)
414   NET_C(ic_a9_POT.1, V5)
415   NET_C(ic_a9_POT.3, GND)
416   NET_C(ic_a9_POT.2, ic_a9_RPRE.1)
417   NET_C(ic_a9_RPRE.2, ic_a9.CONT)
418418
419    NETDEV_R(ic_a9_R, RES_K(71))
420    NETDEV_C(ic_a9_C, CAP_U(.1))
421    NETDEV_D(ic_a9_D, 1N914)
422    NETDEV_NE555(ic_a9)
419   NETDEV_R(ic_a9_R, RES_K(71))
420   NETDEV_C(ic_a9_C, CAP_U(.1))
421   NETDEV_D(ic_a9_D, 1N914)
422   NETDEV_NE555(ic_a9)
423423
424    NET_C(ic_a9.VCC, V5)
425    NET_C(ic_a9.GND, GND)
426    NET_C(ic_a9.RESET, V5)
427    NET_C(ic_a9_R.1, V5)
428    NET_C(ic_a9_R.2, ic_a9.THRESH)
429    NET_C(ic_a9_R.2, ic_a9_D.A)
430    NET_C(ic_a9_D.K, ic_a9.DISCH)
431    NET_C(256VQ, ic_a9.TRIG)
432    NET_C(ic_a9_R.2, ic_a9_C.1)
433    NET_C(GND, ic_a9_C.2)
424   NET_C(ic_a9.VCC, V5)
425   NET_C(ic_a9.GND, GND)
426   NET_C(ic_a9.RESET, V5)
427   NET_C(ic_a9_R.1, V5)
428   NET_C(ic_a9_R.2, ic_a9.THRESH)
429   NET_C(ic_a9_R.2, ic_a9_D.A)
430   NET_C(ic_a9_D.K, ic_a9.DISCH)
431   NET_C(256VQ, ic_a9.TRIG)
432   NET_C(ic_a9_R.2, ic_a9_C.1)
433   NET_C(GND, ic_a9_C.2)
434434
435435   TTL_7404_INVERT(ic_c9a, ic_a9.OUT)
436436   TTL_7400_NAND(ic_b7c, ic_a7a.Q, hsyncQ)
r26736r26737
443443   NET_ALIAS(c2, ic_a8.QC)
444444   NET_ALIAS(d2, ic_a8.QD)
445445
446    // ----------------------------------------------------------------------------------------
446   // ----------------------------------------------------------------------------------------
447447   // C5-EN Logic
448    // ----------------------------------------------------------------------------------------
448   // ----------------------------------------------------------------------------------------
449449
450450   TTL_7404_INVERT(ic_e3a, 128H)
451451   TTL_7427_NOR( ic_e3b, 256H, 64H, ic_e3a.Q)
r26736r26737
456456   TTL_7425_NOR(ic_f2a, ic_g1a.Q, 64V, 128V, ic_d2c.Q)
457457   NET_ALIAS(c5-en, ic_f2a.Q)
458458
459    // ----------------------------------------------------------------------------------------
459   // ----------------------------------------------------------------------------------------
460460   // Score logic ...
461    // ----------------------------------------------------------------------------------------
461   // ----------------------------------------------------------------------------------------
462462
463463   TTL_7402_NOR(ic_f5b, L, Missed)
464464   TTL_7490(ic_c7, ic_f5b, SRST, SRST, low, low)
r26736r26737
490490   NET_ALIAS(score2_10, ic_c8b.Q)
491491   NET_ALIAS(score2_10Q, ic_c8b.QQ)
492492
493    // ----------------------------------------------------------------------------------------
493   // ----------------------------------------------------------------------------------------
494494   // Score display
495    // ----------------------------------------------------------------------------------------
495   // ----------------------------------------------------------------------------------------
496496
497497   TTL_74153(ic_d6a, score1_10Q, score1_4, score2_10Q, score2_4, 32H, 64H, low)
498498   TTL_74153(ic_d6b, score1_10Q, score1_8, score2_10Q, score2_8, 32H, 64H, low)
r26736r26737
537537   TTL_7427_NOR(ic_g2b, ic_g3b.Q, vblank, 4V)
538538   NET_ALIAS(net, ic_g2b.Q)
539539
540    // ----------------------------------------------------------------------------------------
540   // ----------------------------------------------------------------------------------------
541541   // video
542    // ----------------------------------------------------------------------------------------
542   // ----------------------------------------------------------------------------------------
543543
544544   TTL_7402_NOR(ic_g1b, hvidQ, vvidQ)
545545   TTL_7425_NOR(ic_f2b, ic_g1b.Q, pad1, pad2, net)
r26736r26737
550550   TTL_7404_INVERT(ic_e4f, ic_a4d.Q)
551551
552552   NETDEV_R(RV1, RES_K(1))
553    NETDEV_R(RV2, RES_K(1.2))
554    NETDEV_R(RV3, RES_K(22))
555    NET_C(video, RV1.1)
556    NET_C(score, RV2.1)
557    NET_C(ic_e4f.Q, RV3.1)
558    NET_C(RV1.2, RV2.2)
559    NET_C(RV2.2, RV3.2)
553   NETDEV_R(RV2, RES_K(1.2))
554   NETDEV_R(RV3, RES_K(22))
555   NET_C(video, RV1.1)
556   NET_C(score, RV2.1)
557   NET_C(ic_e4f.Q, RV3.1)
558   NET_C(RV1.2, RV2.2)
559   NET_C(RV2.2, RV3.2)
560560
561    NET_ALIAS(videomix, RV3.2)
561   NET_ALIAS(videomix, RV3.2)
562562
563    NETDEV_SOLVER(Solver)
564    NETDEV_PARAM(Solver.FREQ, 48000)
565    NETDEV_ANALOG_CONST(V5, 5)
566    NETDEV_ANALOG_CONST(V1, 1)
567    NETDEV_ANALOG_CONST(GND, 0)
563   NETDEV_SOLVER(Solver)
564   NETDEV_PARAM(Solver.FREQ, 48000)
565   NETDEV_ANALOG_CONST(V5, 5)
566   NETDEV_ANALOG_CONST(V1, 1)
567   NETDEV_ANALOG_CONST(GND, 0)
568568
569569#if 0
570    NETDEV_R(R1, 10)
571    NETDEV_R(R2, 10)
572    NETDEV_R(R3, 10)
573    NET_C(V5,R1.1)
574    NET_C(R1.2, R2.1)
575    NET_C(R2.2, R3.1)
576    NET_C(R3.2, GND)
570   NETDEV_R(R1, 10)
571   NETDEV_R(R2, 10)
572   NETDEV_R(R3, 10)
573   NET_C(V5,R1.1)
574   NET_C(R1.2, R2.1)
575   NET_C(R2.2, R3.1)
576   NET_C(R3.2, GND)
577577#endif
578578#if 0
579    NETDEV_R(R4, 1000)
580    NETDEV_C(C1, 1e-6)
581    NET_C(V5,R4.1)
582    NET_C(R4.2, C1.1)
583    NET_C(C1.2, GND)
584    //NETDEV_LOG(log1, C1.1)
579   NETDEV_R(R4, 1000)
580   NETDEV_C(C1, 1e-6)
581   NET_C(V5,R4.1)
582   NET_C(R4.2, C1.1)
583   NET_C(C1.2, GND)
584   //NETDEV_LOG(log1, C1.1)
585585#endif
586586
587587#define tt(_n) \
588    NETDEV_R(R ## _n, 1000) \
588   NETDEV_R(R ## _n, 1000) \
589589   NETDEV_D(D ## _n) \
590    NET_C(V5, R ## _n.1) \
591    NET_C(R ## _n.2, D ## _n.A) \
592    NET_C(D ## _n.K, GND)
590   NET_C(V5, R ## _n.1) \
591   NET_C(R ## _n.2, D ## _n.A) \
592   NET_C(D ## _n.K, GND)
593593
594594/*    tt(20)
595595    tt(21)
r26736r26737
604604*/
605605
606606#if 0
607    NETDEV_R(R5, 1000)
608    NETDEV_1N914(D1)
609    NET_C(V5, R5.1)
610    NET_C(R5.2, D1.A)
611    NET_C(D1.K, GND)
612    //NETDEV_LOG(log1, D1.A)
607   NETDEV_R(R5, 1000)
608   NETDEV_1N914(D1)
609   NET_C(V5, R5.1)
610   NET_C(R5.2, D1.A)
611   NET_C(D1.K, GND)
612   //NETDEV_LOG(log1, D1.A)
613613#endif
614614
615615#if 0
616    // astable NAND Multivibrator
617    NETDEV_R(R1, 1000)
618    NETDEV_C(C1, 1e-6)
619    TTL_7400_NAND(n1,R1.1,R1.1)
620    TTL_7400_NAND(n2,R1.2,R1.2)
621    NET_C(n1.Q, R1.2)
622    NET_C(n2.Q, C1.1)
623    NET_C(C1.2, R1.1)
624    //NETDEV_LOG(log2, C1.2)
625    //NETDEV_LOG(log2, n1.Q)
626    //NETDEV_LOG(log3, n2.Q)
616   // astable NAND Multivibrator
617   NETDEV_R(R1, 1000)
618   NETDEV_C(C1, 1e-6)
619   TTL_7400_NAND(n1,R1.1,R1.1)
620   TTL_7400_NAND(n2,R1.2,R1.2)
621   NET_C(n1.Q, R1.2)
622   NET_C(n2.Q, C1.1)
623   NET_C(C1.2, R1.1)
624   //NETDEV_LOG(log2, C1.2)
625   //NETDEV_LOG(log2, n1.Q)
626   //NETDEV_LOG(log3, n2.Q)
627627#endif
628628
629629#if 0
630    // astable NE555, 1.13 ms period
631    NETDEV_R(RA, 5000)
632    NETDEV_R(RB, 3000)
633    NETDEV_C(C, 0.15e-6)
634    NETDEV_NE555(555)
630   // astable NE555, 1.13 ms period
631   NETDEV_R(RA, 5000)
632   NETDEV_R(RB, 3000)
633   NETDEV_C(C, 0.15e-6)
634   NETDEV_NE555(555)
635635
636    NET_C(GND, 555.GND)
637    NET_C(V5, 555.VCC)
636   NET_C(GND, 555.GND)
637   NET_C(V5, 555.VCC)
638638
639    NET_C(RA.1, 555.VCC)
640    NET_C(RA.2, 555.DISCH)
639   NET_C(RA.1, 555.VCC)
640   NET_C(RA.2, 555.DISCH)
641641
642    NET_C(RB.1, 555.DISCH)
643    NET_C(RB.2, 555.TRIG)
642   NET_C(RB.1, 555.DISCH)
643   NET_C(RB.2, 555.TRIG)
644644
645    NET_C(RB.2, 555.THRESH)
645   NET_C(RB.2, 555.THRESH)
646646
647    NET_C(555.TRIG, C.1)
648    NET_C(C.2, GND)
649    //NETDEV_LOG(log2, C.1)
650    //NETDEV_LOG(log3, 555.OUT)
647   NET_C(555.TRIG, C.1)
648   NET_C(C.2, GND)
649   //NETDEV_LOG(log2, C.1)
650   //NETDEV_LOG(log3, 555.OUT)
651651#endif
652652
653653#if 0
654    NETDEV_BC238B(Q)
655    NETDEV_R(RB, 1000)
656    NETDEV_R(RC, 1000)
654   NETDEV_BC238B(Q)
655   NETDEV_R(RB, 1000)
656   NETDEV_R(RC, 1000)
657657
658    NET_C(RC.1, V5)
659    NET_C(RC.2, Q.C)
660    NET_C(RB.1, 128H)
661    NET_C(RB.2, Q.B)
662    NET_C(Q.E, GND)
663    //NETDEV_LOG(logB, Q.B)
664    //NETDEV_LOG(logC, Q.C)
658   NET_C(RC.1, V5)
659   NET_C(RC.2, Q.C)
660   NET_C(RB.1, 128H)
661   NET_C(RB.2, Q.B)
662   NET_C(Q.E, GND)
663   //NETDEV_LOG(logB, Q.B)
664   //NETDEV_LOG(logC, Q.C)
665665#endif
666666
667667#if 0
668    NETDEV_VCVS(VV)
669    NETDEV_R(R1, 1000)
670    NETDEV_R(R2, 10000)
668   NETDEV_VCVS(VV)
669   NETDEV_R(R1, 1000)
670   NETDEV_R(R2, 10000)
671671
672    NET_C(V5, R1.1)
673    NET_C(R1.2, VV.IN)
674    NET_C(R2.1, VV.OP)
675    NET_C(R2.2, VV.IN)
676    NET_C(VV.ON, GND)
677    NET_C(VV.IP, GND)
678    NETDEV_LOG(logX, VV.OP)
672   NET_C(V5, R1.1)
673   NET_C(R1.2, VV.IN)
674   NET_C(R2.1, VV.OP)
675   NET_C(R2.2, VV.IN)
676   NET_C(VV.ON, GND)
677   NET_C(VV.IP, GND)
678   NETDEV_LOG(logX, VV.OP)
679679
680680#endif
681681
682682#if 0
683    NETDEV_VCCS(VV)
684    NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
685    NETDEV_R(R1, 1000)
686    NETDEV_R(R2, 1)
687    NETDEV_R(R3, 10000)
683   NETDEV_VCCS(VV)
684   NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
685   NETDEV_R(R1, 1000)
686   NETDEV_R(R2, 1)
687   NETDEV_R(R3, 10000)
688688
689    NET_C(4V, R1.1)
690    NET_C(R1.2, VV.IN)
691    NET_C(R2.1, VV.OP)
692    NET_C(R3.1, VV.IN)
693    NET_C(R3.2, VV.OP)
694    NET_C(R2.2, GND)
695    NET_C(VV.ON, GND)
696    NET_C(VV.IP, GND)
697    //NETDEV_LOG(logX, VV.OP)
698    //NETDEV_LOG(logY, 4V)
689   NET_C(4V, R1.1)
690   NET_C(R1.2, VV.IN)
691   NET_C(R2.1, VV.OP)
692   NET_C(R3.1, VV.IN)
693   NET_C(R3.2, VV.OP)
694   NET_C(R2.2, GND)
695   NET_C(VV.ON, GND)
696   NET_C(VV.IP, GND)
697   //NETDEV_LOG(logX, VV.OP)
698   //NETDEV_LOG(logY, 4V)
699699
700700#endif
701701
702702#if 0
703    NETDEV_VCVS(VV)
704    NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
705    NETDEV_PARAM(VV.RO, 50)  // typical OP-AMP amplification
706    NETDEV_R(R1, 1000)
707    NETDEV_R(R3, 10000) // ==> 10x amplification (inverting)
703   NETDEV_VCVS(VV)
704   NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
705   NETDEV_PARAM(VV.RO, 50)  // typical OP-AMP amplification
706   NETDEV_R(R1, 1000)
707   NETDEV_R(R3, 10000) // ==> 10x amplification (inverting)
708708
709    NET_C(4V, R1.1)
710    NET_C(R1.2, VV.IN)
711    NET_C(R3.1, VV.IN)
712    NET_C(R3.2, VV.OP)
713    NET_C(VV.ON, GND)
714    NET_C(VV.IP, GND)
715    NETDEV_LOG(logX, VV.OP)
716    NETDEV_LOG(logY, 4V)
709   NET_C(4V, R1.1)
710   NET_C(R1.2, VV.IN)
711   NET_C(R3.1, VV.IN)
712   NET_C(R3.2, VV.OP)
713   NET_C(VV.ON, GND)
714   NET_C(VV.IP, GND)
715   NETDEV_LOG(logX, VV.OP)
716   NETDEV_LOG(logY, 4V)
717717
718718#endif
719719
720720#if 0
721    // Impedance converter with resistor
722    NETDEV_VCVS(VV)
723    NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
724    NETDEV_PARAM(VV.RO, 50)  // typical OP-AMP amplification
725    NETDEV_R(R3, 10000)
721   // Impedance converter with resistor
722   NETDEV_VCVS(VV)
723   NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
724   NETDEV_PARAM(VV.RO, 50)  // typical OP-AMP amplification
725   NETDEV_R(R3, 10000)
726726
727    NET_C(4V, VV.IP)
728    NET_C(R3.1, VV.IN)
729    NET_C(R3.2, VV.OP)
730    NET_C(VV.ON, GND)
731    NETDEV_LOG(logX, VV.OP)
732    NETDEV_LOG(logY, 4V)
727   NET_C(4V, VV.IP)
728   NET_C(R3.1, VV.IN)
729   NET_C(R3.2, VV.OP)
730   NET_C(VV.ON, GND)
731   NETDEV_LOG(logX, VV.OP)
732   NETDEV_LOG(logY, 4V)
733733
734734#endif
735735
736736#if 0
737    // Impedance converter without resistor
738    NETDEV_VCVS(VV)
739    NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
740    NETDEV_PARAM(VV.RO, 50)  // typical OP-AMP amplification
737   // Impedance converter without resistor
738   NETDEV_VCVS(VV)
739   NETDEV_PARAM(VV.G, 100000)  // typical OP-AMP amplification
740   NETDEV_PARAM(VV.RO, 50)  // typical OP-AMP amplification
741741
742    NET_C(4V, VV.IP)
743    NET_C(VV.IN, VV.OP)
744    NET_C(VV.ON, GND)
745    NETDEV_LOG(logX, VV.OP)
746    NETDEV_LOG(logY, 4V)
742   NET_C(4V, VV.IP)
743   NET_C(VV.IN, VV.OP)
744   NET_C(VV.ON, GND)
745   NETDEV_LOG(logX, VV.OP)
746   NETDEV_LOG(logY, 4V)
747747
748748#endif
749749
750750#if 0
751    /* Impedance converter current source opamp model from
752     *
753     * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm
754     *
755     * Bandwidth 10Mhz
756     *
757     */
758    NETDEV_VCCS(G1)
759    NETDEV_PARAM(G1.G, 100)  // typical OP-AMP amplification 100 * 1000 = 100000
760    NETDEV_R(RP1, 1000)
761    NETDEV_C(CP1, 1.59e-6)   // <== change to 1.59e-3 for 10Khz bandwidth
762    NETDEV_VCVS(EBUF)
763    NETDEV_PARAM(EBUF.RO, 50)
764    NETDEV_PARAM(EBUF.G, 1)
751   /* Impedance converter current source opamp model from
752    *
753    * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm
754    *
755    * Bandwidth 10Mhz
756    *
757    */
758   NETDEV_VCCS(G1)
759   NETDEV_PARAM(G1.G, 100)  // typical OP-AMP amplification 100 * 1000 = 100000
760   NETDEV_R(RP1, 1000)
761   NETDEV_C(CP1, 1.59e-6)   // <== change to 1.59e-3 for 10Khz bandwidth
762   NETDEV_VCVS(EBUF)
763   NETDEV_PARAM(EBUF.RO, 50)
764   NETDEV_PARAM(EBUF.G, 1)
765765
766    NET_C(G1.IP, 4V)
767    NET_C(G1.IN, EBUF.OP)
768    NET_C(EBUF.ON, GND)
766   NET_C(G1.IP, 4V)
767   NET_C(G1.IN, EBUF.OP)
768   NET_C(EBUF.ON, GND)
769769
770    NET_C(G1.ON, GND)
771    NET_C(RP1.2, GND)
772    NET_C(CP1.2, GND)
773    NET_C(EBUF.IN, GND)
770   NET_C(G1.ON, GND)
771   NET_C(RP1.2, GND)
772   NET_C(CP1.2, GND)
773   NET_C(EBUF.IN, GND)
774774
775    NET_C(RP1.1, G1.OP)
776    NET_C(CP1.1, RP1.1)
777    NET_C(EBUF.IP, RP1.1)
775   NET_C(RP1.1, G1.OP)
776   NET_C(CP1.1, RP1.1)
777   NET_C(EBUF.IP, RP1.1)
778778
779    //NETDEV_LOG(logX, EBUF.OP)
780    //NETDEV_LOG(logY, 4V)
779   //NETDEV_LOG(logX, EBUF.OP)
780   //NETDEV_LOG(logY, 4V)
781781
782782#endif
783783
r26736r26737
794794         m_dac(*this, "dac"),                /* just to have a sound device */
795795         m_srst(*this, "maincpu", "SRST"),
796796         m_p_P0(*this, "maincpu", "ic_b9_POT.DIAL"),
797            m_p_P1(*this, "maincpu", "ic_a9_POT.DIAL"),
797         m_p_P1(*this, "maincpu", "ic_a9_POT.DIAL"),
798798         m_sw1a(*this, "maincpu", "sw1a.POS"),
799799         m_sw1b(*this, "maincpu", "sw1b.POS"),
800800         m_p_R0(*this, "maincpu", "ic_a9_R.R"),
r26736r26737
809809
810810   // sub devices
811811   netlist_mame_device::required_output<netlist_logic_output_t> m_srst;
812    netlist_mame_device::required_param<netlist_param_double_t> m_p_P0;
813    netlist_mame_device::required_param<netlist_param_double_t> m_p_P1;
812   netlist_mame_device::required_param<netlist_param_double_t> m_p_P0;
813   netlist_mame_device::required_param<netlist_param_double_t> m_p_P1;
814814   netlist_mame_device::required_param<netlist_param_int_t> m_sw1a;
815815   netlist_mame_device::required_param<netlist_param_int_t> m_sw1b;
816816   netlist_mame_device::required_param<netlist_param_double_t> m_p_R0;
r26736r26737
847847
848848static NETLIST_START(pong)
849849
850    //NETLIST_INCLUDE(pong_schematics)
851    NETLIST_MEMREGION("maincpu")
850   //NETLIST_INCLUDE(pong_schematics)
851   NETLIST_MEMREGION("maincpu")
852852
853    NETDEV_ANALOG_CALLBACK(sound_cb, sound, pong_state, sound_cb, "")
854    NETDEV_ANALOG_CALLBACK(video_cb, videomix, pong_state, video_cb, "")
853   NETDEV_ANALOG_CALLBACK(sound_cb, sound, pong_state, sound_cb, "")
854   NETDEV_ANALOG_CALLBACK(video_cb, videomix, pong_state, video_cb, "")
855855NETLIST_END
856856
857857static NETLIST_START(pong_fast)
858858
859    NETLIST_INCLUDE(pong_schematics)
859   NETLIST_INCLUDE(pong_schematics)
860860
861    NETDEV_ANALOG_CALLBACK(sound_cb, sound, pong_state, sound_cb, "")
862    NETDEV_ANALOG_CALLBACK(video_cb, videomix, pong_state, video_cb, "")
861   NETDEV_ANALOG_CALLBACK(sound_cb, sound, pong_state, sound_cb, "")
862   NETDEV_ANALOG_CALLBACK(video_cb, videomix, pong_state, video_cb, "")
863863
864864NETLIST_END
865865
r26736r26737
891891
892892      double fac = (double) newval / (double) 256;
893893      fac = (exp(fac) - 1.0) / (exp(1.0) -1.0) ;
894        switch (numpad)
895        {
896        case IC_PADDLE1:    m_p_P0->setTo(fac); break;
897        case IC_PADDLE2:    m_p_P1->setTo(fac); break;
898        }
894      switch (numpad)
895      {
896      case IC_PADDLE1:    m_p_P0->setTo(fac); break;
897      case IC_PADDLE2:    m_p_P1->setTo(fac); break;
898      }
899899      break;
900900   }
901901   case IC_SWITCH:
r26736r26737
908908   case IC_VR1:
909909   case IC_VR2:
910910      pad = (double) newval / (double) 100 * RES_K(50) + RES_K(56);
911        switch (numpad)
912        {
913        case IC_VR1:    m_p_R0->setTo(pad); break;
914        case IC_VR2:    m_p_R1->setTo(pad); break;
915        }
911      switch (numpad)
912      {
913      case IC_VR1:    m_p_R0->setTo(pad); break;
914      case IC_VR2:    m_p_R1->setTo(pad); break;
915      }
916916      break;
917917   }
918918
trunk/src/mame/drivers/harddriv.c
r26736r26737
15991599   MCFG_DEVICE_REMOVE("rspeaker")
16001600
16011601   MCFG_ASIC65_ADD("asic65", ASIC65_STEELTAL)         /* ASIC65 on DSPCOM board */
1602   
1602
16031603   /* sund hardware */
16041604   MCFG_SPEAKER_STANDARD_MONO("mono")
16051605
r26736r26737
43904390/* COMMON INIT: initialize the DSPCOM add-on board */
43914391void harddriv_state::init_dspcom()
43924392{
4393    /* install ASIC65 */
4393      /* install ASIC65 */
43944394   m_maincpu->space(AS_PROGRAM).install_write_handler(0x900000, 0x900003, write16_delegate(FUNC(asic65_device::data_w), (asic65_device*)m_asic65));
43954395   m_maincpu->space(AS_PROGRAM).install_read_handler(0x900000, 0x900003, read16_delegate(FUNC(asic65_device::read), (asic65_device*)m_asic65));
43964396   m_maincpu->space(AS_PROGRAM).install_read_handler(0x901000, 0x910001, read16_delegate(FUNC(asic65_device::io_r), (asic65_device*)m_asic65));
trunk/src/mame/drivers/2mindril.c
r26736r26737
5050
5151   /* memory pointers */
5252   required_shared_ptr<UINT16> m_iodata;
53   
53
5454   /* input-related */
5555   UINT16        m_defender_sensor;
5656   UINT16        m_shutter_sensor;
r26736r26737
7676      TIMER_SHUTTER_REQ,
7777      TIMER_DEFENDER_REQ
7878   };
79   
79
8080protected:
8181   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
8282   #endif
r26736r26737
152152         m_shutter_sensor = param;
153153         break;
154154   case TIMER_DEFENDER_REQ:
155          m_defender_sensor = param;
155         m_defender_sensor = param;
156156         break;
157157   default:
158158         assert_always(FALSE, "Unknown id in _2mindril_state::device_timer");
trunk/src/mame/drivers/midzeus.c
r26736r26737
12711271   ROM_LOAD32_WORD( "invasion2.u15", 0x0800002, 0x200000, CRC(584b0596) SHA1(cab8222977ecc8a689f1f3f7ebc38ff7bec6a43f) )
12721272   ROM_LOAD32_WORD( "invasion2.u16", 0x0c00000, 0x200000, CRC(5d422855) SHA1(ceafd60b020b03de051765b9e9dd0d01285a0335) )
12731273   ROM_LOAD32_WORD( "invasion2.u17", 0x0c00002, 0x200000, CRC(c6555769) SHA1(a97361001311dd6fb28f79df422e6e8c27ea2495) )
1274    ROM_LOAD32_WORD( "invasion2.u18", 0x1000000, 0x200000, CRC(dbc9548e) SHA1(6deac9fde26144a61bd63833a197801d159f0c9a) )
1275    ROM_LOAD32_WORD( "invasion2.u19", 0x1000002, 0x200000, CRC(4b05a2a9) SHA1(3d47c22a809f5883e4795a9153161d3e29c64662) )
1274   ROM_LOAD32_WORD( "invasion2.u18", 0x1000000, 0x200000, CRC(dbc9548e) SHA1(6deac9fde26144a61bd63833a197801d159f0c9a) )
1275   ROM_LOAD32_WORD( "invasion2.u19", 0x1000002, 0x200000, CRC(4b05a2a9) SHA1(3d47c22a809f5883e4795a9153161d3e29c64662) )
12761276ROM_END
12771277
12781278ROM_START( crusnexo )
trunk/src/mame/drivers/konendev.c
r26736r26737
11/*
2   Konami Endeavour hardware (gambling games)
2    Konami Endeavour hardware (gambling games)
33
44
5   Hardware:
5    Hardware:
66
7   1. Backplane PCB (GGAT2 PWB(A1) 10000094517)
8      - VGA connector
9      - RJ45 connector
7    1. Backplane PCB (GGAT2 PWB(A1) 10000094517)
8       - VGA connector
9       - RJ45 connector
1010
11   2. Main PCB (GGAT2 PWB(B2) 0000093536)
12      - PowerPC 403GCX
13      - Unknown large QFP IC under heatsink (0000057714/Firebeat GCU?)
14      - Xilinx CPLD
15      - 2 x Hynix RAM
16      - 4 x HY57V641620 SDRAM
17      - 2 x Hynix RAM (sound?)
18      - 2 x EPROMs
19      - 1 x SRAM (battery backup?)
20      - 2 x CR2032, 2 x supercaps
21      - Unknown Fujitsu IC
22      - YMZ280B
23      - Sound amplifier with heatsink
11    2. Main PCB (GGAT2 PWB(B2) 0000093536)
12       - PowerPC 403GCX
13       - Unknown large QFP IC under heatsink (0000057714/Firebeat GCU?)
14       - Xilinx CPLD
15       - 2 x Hynix RAM
16       - 4 x HY57V641620 SDRAM
17       - 2 x Hynix RAM (sound?)
18       - 2 x EPROMs
19       - 1 x SRAM (battery backup?)
20       - 2 x CR2032, 2 x supercaps
21       - Unknown Fujitsu IC
22       - YMZ280B
23       - Sound amplifier with heatsink
2424
25   3. I/O PCB (GGAT2 PWB(B2) ???????????)
26      - H8/3001
27      - EPROM socket
28      - Various CPLDs
25    3. I/O PCB (GGAT2 PWB(B2) ???????????)
26       - H8/3001
27       - EPROM socket
28       - Various CPLDs
2929
30   I think they use CF cards for resources, one game has what appears to be a dump of one
31   but the rest don't.  It's quite possibly (even likely) that all the sets here are incomplete.
30    I think they use CF cards for resources, one game has what appears to be a dump of one
31    but the rest don't.  It's quite possibly (even likely) that all the sets here are incomplete.
3232*/
3333
3434
r26736r26737
238238
239239DRIVER_INIT_MEMBER(konendev_state,konendev)
240240{
241
242241}
243242
244243// has a flash dump?
trunk/src/mame/mame.lst
r26736r26737
307307strfbomb        // bootleg
308308scrambp         // bootleg (Billport S.A.)
309309scrampt         // bootleg (Petaco S.A.)
310scramrf         // bootleg (Recreativos Franco)
310scramrf         // bootleg (Recreativos Franco)
311311atlantis        // (c) 1981 Comsoft
312312atlantis2       // (c) 1981 Comsoft
313313theend          // (c) 1980 Konami
r26736r26737
16291629maxrpm          // (c) 1986
16301630spyhunt         // (c) 1983
16311631spyhuntp        // (c) 1983
1632spyhuntpr      //
1632spyhuntpr       //
16331633turbotag        // (c) 1985
16341634crater          // (c) 1984
16351635// MCR 68000
r26736r26737
21132113cadashi         // C21 (c) 1989 Taito Corporation Japan
21142114cadashf         // C21 (c) 1989 Taito Corporation Japan
21152115cadashg         // C21 (c) 1989 Taito Corporation Japan
2116cadashp         // prototype
2116cadashp         // prototype
21172117parentj         // C42 (c) 199? Taito
21182118galmedes        // (c) 1992 Visco (Japan)
21192119earthjkr        // (c) 1993 Visco (Japan)
2120earthjkrp      //
2120earthjkrp       //
21212121eto             // (c) 1994 Visco (Japan)
21222122wgp             // C32 (c) 1989 Taito America Corporation (US)
21232123wgpj            // C32 (c) 1989 Taito Corporation (Japan)
r26736r26737
22192219
22202220// Taito H-System games
22212221syvalion        // B51 (c) 1988 Taito Corporation (Japan)
2222syvalionp      //
2222syvalionp       //
22232223recordbr        // B56 (c) 1988 Taito Corporation Japan (World)
22242224gogold          // B56 (c) 1988 Taito Corporation (Japan)
22252225dleague         // C02 (c) 1990 Taito America Corporation (US)
r26736r26737
23092309superchs        // D46 (c) 1992 Taito Corporation Japan (World)
23102310superchsu       // D46 (c) 1992 Taito America Corporation (US)
23112311superchsj       // D46 (c) 1992 Taito Corporation (Japan)
2312superchsp      // prototype
2312superchsp       // prototype
23132313groundfx        // D51 (c) 1992 Taito Coporation
23142314undrfire        // D67 (c) 1993 Taito Coporation Japan (World)
23152315undrfireu       // D67 (c) 1993 Taito America Corporation (US)
23162316undrfirej       // D67 (c) 1993 Taito Coporation (Japan)
23172317cbombers        // D83 (c) 1993 Taito Coporation Japan (World)
23182318cbombersj       // D83 (c) 1993 Taito Coporation (Japan)
2319cbombersp      //
2319cbombersp       //
23202320
23212321// Taito F2 games
23222322finalb          // 1989.?? B82 (c) 1988 Taito Corporation Japan (World)
r26736r26737
26532653batsuguna       // TP-030 (c) 1993 Toaplan
26542654batsugunsp      // TP-??? (c) 1993 Toaplan
26552655snowbro2        // TP-??? (c) 1994 Hanafram
2656pwrkick         // (c) 1994 Sunwise
2656pwrkick         // (c) 1994 Sunwise
26572657sstriker        // (c) 1993 Raizing
26582658sstrikera       // (c) 1993 Raizing
26592659mahoudai        // (c) 1993 Raizing + Able license
r26736r26737
286228621942abl         // bootleg
286328631942b           // 12/1984 (c) 1984
286428641942w           // 12/1984 (c) 1984 + Williams Electronics license (c) 1985
28651942p         // prototype
28651942p           // prototype
28662866exedexes        //  2/1985 (c) 1985
28672867savgbees        //  2/1985 (c) 1985 + Memetron license
28682868commando        //  5/1985 (c) 1985 (World)
r26736r26737
51325132f355            // 1999.07 F355 Challenge
51335133f355twin        // 1999.07 F355 Challenge Twin
51345134shangril        // 1999.08 Dengen Tenshi Taisen Janshi Shangri-la
5135tduno           // 1999.08 Touch de UNO! / Unou Nouryoku Check Machine
5135tduno           // 1999.08 Touch de UNO! / Unou Nouryoku Check Machine
51365136vs2_2k          // 1999.08 Virtua Striker 2 version 2000 (Rev C)
51375137suchie3         // 1999.09 Idol Janshi Su-Chi-Pi 3
51385138jambo           // 1999.09 Jambo! Safari (Rev A)
r26736r26737
56125612begas           // (c) 1983
56135613begas1          // (c) 1983
56145614cobra           // (c) 1984
5615cobraa         //
5615cobraa          //
56165616rblaster        // (c) 1985
56175617
56185618// other Data East games
r26736r26737
89388938hardhea2        // (c) 1991 SunA
89398939brickzn         // (c) 1992 SunA
89408940brickznv4       // (c) 1992 SunA
8941brickzn11      // (c) 1992 SunA
8941brickzn11       // (c) 1992 SunA
89428942bestbest        // (c) 1994 SunA
89438943sunaq           // (c) 1994 SunA
89448944bssoccer        // (c) 1996 SunA
r26736r26737
92719271quizchq         // "73" (c) 1993 Nakanihon
92729272quizchql        // "73" (c) 1993 Laxan
92739273funkyfig        // "74" (c) 1993 Nakanihon + East Technology
9274funkyfiga      //
9274funkyfiga       //
92759275animaljr        // "75" 1993 Nakanihon/Taito (USA)
92769276animaljrs       // "75" 1993 Nakanihon/Taito (Spanish version)
92779277animaljrj       // "75" 1993 Nakanihon/Taito (Japan)
r26736r26737
95279527martmastc102        //
95289528theglad         // (c) 2003 The Gladiator
95299529theglad100      //
9530theglad101      //
9530theglad101      //
95319531thegladpcb      //
95329532dw2001          // (c) 2001 Dragon World 2001
95339533dwpc            // (c) 2001 Dragon World Pretty Chance
r26736r26737
97449744ar_bios
97459745ar_airh         // (c) 1988
97469746ar_airh2        // (c) 1988
9747ar_blast      // (c) 1988
9747ar_blast        // (c) 1988
97489748ar_bowl         // (c) 1988
97499749ar_dart         // (c) 1987
97509750ar_dart2        // (c) 1987
r26736r26737
97559755ar_ldrbb        // (c) 1988
97569756ar_ninj         // (c) 1987
97579757ar_ninj2        // (c) 1987
9758ar_pm         // (c) 198?
9758ar_pm           // (c) 198?
97599759ar_rdwr         // (c) 1988
97609760ar_sdwr         // (c) 1988
97619761ar_sdwr2        // (c) 1988
r26736r26737
97639763ar_spot         // (c) 1990
97649764ar_sprg         // (c) 1987
97659765ar_xeon         // (c) 1988
9766ar_dlta         // (c) 198?
9766ar_dlta         // (c) 198?
97679767
97689768// Sente Super System
97699769mquake          // (c) 1987
r26736r26737
99779977nostj           // (c) 1993 Face
99789978nostk           // (c) 1993 Face
997999794enraya         // (c) 1990 IDSA
99804enrayaa      //
99804enrayaa        //
99819981unkpacg         // (c) 19?? ???
99829982oneshot         // no copyright notice
99839983maddonna        // (c) 1995 Tuning
r26736r26737
1044710447mosaicf2        // (c) 1999 F2 System
1044810448finalgdr        // (c) 2001 Semicom
1044910449mrkicker        // (c) 2001 Semicom
10450wivernwg      // (c) 2001 Semicom
10450wivernwg        // (c) 2001 Semicom
1045110451wyvernwg        // (c) 2001 Semicom / Game Vision
1045210452wyvernwga       // (c) 2001 Semicom / Game Vision
1045310453rbmk            // (c) 1995 GMS
trunk/src/mame/audio/taito_en.c
r26736r26737
5050   save_item(NAME(m_es5510_dadr_latch));
5151   save_item(NAME(m_es5510_gpr_latch));
5252   save_item(NAME(m_es5510_ram_sel));
53   
53
5454   m_duart68681 = machine().device<duartn68681_device>("duart68681");
5555}
5656
trunk/src/mame/audio/taito_en.h
r26736r26737
1717   //todo: hook up cpu/es5510
1818   DECLARE_READ16_MEMBER( es5510_dsp_r );
1919   DECLARE_WRITE16_MEMBER( es5510_dsp_w );
20   
20
2121   DECLARE_WRITE_LINE_MEMBER(duart_irq_handler);
2222
2323protected:
r26736r26737
4040   UINT8    m_es5510_ram_sel;
4141
4242   UINT32   *m_snd_shared_ram;
43   
43
4444   duartn68681_device *m_duart68681;
4545
4646};
trunk/src/build/makedep.c
r26736r26737
138138         (*excpathhead)->pathlen = (*excpathhead)->path.len();
139139         excpathhead = &(*excpathhead)->next;
140140      }
141     
141
142142      else if (arg[0] == '-' && arg[1] == 'F')
143143      {
144144         argnum++;
145145      }
146146
147        else if (arg[0] == '-' && arg[1] == 'D')
148        {
149            // some pkgconfigs return defines (e.g. pkg-config QtGui --cflags) ==> ignore
150            argnum++;
151        }
147      else if (arg[0] == '-' && arg[1] == 'D')
148      {
149         // some pkgconfigs return defines (e.g. pkg-config QtGui --cflags) ==> ignore
150         argnum++;
151      }
152152
153153      // ignore -include which is used by sdlmame to include sdlprefix.h before all other includes
154154      else if (strcmp(arg,"-include") == 0)
trunk/src/tools/romcmp.c
r26736r26737
472472            UINT64 size = d->size;
473473            while (size && (size & 1) == 0) size >>= 1;
474474            //if (size & ~1)
475            //   printf("%-23s %-23s ignored (not a ROM)\n",i ? "" : d_name,i ? d_name : "");
475            //  printf("%-23s %-23s ignored (not a ROM)\n",i ? "" : d_name,i ? d_name : "");
476476            //else
477477            {
478478               strcpy(files[i][found[i]].name,d_name);
trunk/src/tools/jedutil.c
r26736r26737
232232struct _pal_data
233233{
234234   const char *name;
235    UINT32 numfuses;
235   UINT32 numfuses;
236236   const pin_fuse_rows *pinfuserows;
237237   UINT16 pinfuserowscount;
238238   const pin_fuse_columns *pinfusecolumns;
r26736r26737
698698static pin_fuse_rows epl16rp8pinfuserows[] = {
699699   {12, NO_OUTPUT_ENABLE_FUSE_ROW, 1792, 2016}, /* Registered Output */
700700   {13, NO_OUTPUT_ENABLE_FUSE_ROW, 1536, 1760}, /* Registered Output */
701    {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504}, /* Registered Output */
701   {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504}, /* Registered Output */
702702   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 1024, 1248}, /* Registered Output */
703703   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 768, 992},   /* Registered Output */
704704   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 736},   /* Registered Output */
r26736r26737
795795   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 224}};    /* Registered Output */
796796
797797static pin_fuse_rows pal6l16pinfuserows[] = {
798    {1, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
799    {2, NO_OUTPUT_ENABLE_FUSE_ROW, 24, 24},
800    {3, NO_OUTPUT_ENABLE_FUSE_ROW, 36, 36},
801    {10, NO_OUTPUT_ENABLE_FUSE_ROW, 132, 132},
802    {11, NO_OUTPUT_ENABLE_FUSE_ROW, 168, 168},
803    {13, NO_OUTPUT_ENABLE_FUSE_ROW, 180, 180},
804    {14, NO_OUTPUT_ENABLE_FUSE_ROW, 156, 156},
805    {15, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 144},
806    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 120, 120},
807    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 108, 108},
808    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 96},
809    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 84, 84},
810    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 72, 72},
811    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 60, 60},
812    {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 48},
813    {23, NO_OUTPUT_ENABLE_FUSE_ROW, 12, 12}};
798   {1, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
799   {2, NO_OUTPUT_ENABLE_FUSE_ROW, 24, 24},
800   {3, NO_OUTPUT_ENABLE_FUSE_ROW, 36, 36},
801   {10, NO_OUTPUT_ENABLE_FUSE_ROW, 132, 132},
802   {11, NO_OUTPUT_ENABLE_FUSE_ROW, 168, 168},
803   {13, NO_OUTPUT_ENABLE_FUSE_ROW, 180, 180},
804   {14, NO_OUTPUT_ENABLE_FUSE_ROW, 156, 156},
805   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 144},
806   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 120, 120},
807   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 108, 108},
808   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 96},
809   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 84, 84},
810   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 72, 72},
811   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 60, 60},
812   {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 48},
813   {23, NO_OUTPUT_ENABLE_FUSE_ROW, 12, 12}};
814814
815815static pin_fuse_rows pal8l14pinfuserows[] = {
816    {1, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
817    {2, NO_OUTPUT_ENABLE_FUSE_ROW, 32, 32},
818    {11, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 192},
819    {13, NO_OUTPUT_ENABLE_FUSE_ROW, 208, 208},
820    {14, NO_OUTPUT_ENABLE_FUSE_ROW, 176, 176},
821    {15, NO_OUTPUT_ENABLE_FUSE_ROW, 160, 160},
822    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 144},
823    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 128, 128},
824    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 112},
825    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 96},
826    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 80, 80},
827    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 64, 64},
828    {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 48},
829    {23, NO_OUTPUT_ENABLE_FUSE_ROW, 16, 16}};
816   {1, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 0},
817   {2, NO_OUTPUT_ENABLE_FUSE_ROW, 32, 32},
818   {11, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 192},
819   {13, NO_OUTPUT_ENABLE_FUSE_ROW, 208, 208},
820   {14, NO_OUTPUT_ENABLE_FUSE_ROW, 176, 176},
821   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 160, 160},
822   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 144},
823   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 128, 128},
824   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 112},
825   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 96},
826   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 80, 80},
827   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 64, 64},
828   {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 48},
829   {23, NO_OUTPUT_ENABLE_FUSE_ROW, 16, 16}};
830830
831831static pin_fuse_rows pal12h10pinfuserows[] = {
832    {14, NO_OUTPUT_ENABLE_FUSE_ROW, 432, 456},
833    {15, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 408},
834    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 360},
835    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 288, 312},
836    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 264},
837    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 216},
838    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 168},
839    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 120},
840    {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 72},
841    {23, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 24}};
832   {14, NO_OUTPUT_ENABLE_FUSE_ROW, 432, 456},
833   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 408},
834   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 360},
835   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 288, 312},
836   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 264},
837   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 216},
838   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 168},
839   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 120},
840   {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 72},
841   {23, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 24}};
842842
843843static pin_fuse_rows pal12l10pinfuserows[] = {
844    {14, NO_OUTPUT_ENABLE_FUSE_ROW, 432, 456},
845    {15, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 408},
846    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 360},
847    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 288, 312},
848    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 264},
849    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 216},
850    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 168},
851    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 120},
852    {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 72},
853    {23, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 24}};
844   {14, NO_OUTPUT_ENABLE_FUSE_ROW, 432, 456},
845   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 408},
846   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 360},
847   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 288, 312},
848   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 264},
849   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 216},
850   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 168},
851   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 120},
852   {22, NO_OUTPUT_ENABLE_FUSE_ROW, 48, 72},
853   {23, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 24}};
854854
855855static pin_fuse_rows pal14h8pinfuserows[] = {
856    {15, NO_OUTPUT_ENABLE_FUSE_ROW, 448, 532},
857    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 392, 420},
858    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 364},
859    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 280, 308},
860    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 224, 252},
861    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 168, 196},
862    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 140},
863    {22, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 84}};
856   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 448, 532},
857   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 392, 420},
858   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 364},
859   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 280, 308},
860   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 224, 252},
861   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 168, 196},
862   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 140},
863   {22, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 84}};
864864
865865static pin_fuse_rows pal14l8pinfuserows[] = {
866    {15, NO_OUTPUT_ENABLE_FUSE_ROW, 448, 532},
867    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 392, 420},
868    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 364},
869    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 280, 308},
870    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 224, 252},
871    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 168, 196},
872    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 140},
873    {22, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 84}};
866   {15, NO_OUTPUT_ENABLE_FUSE_ROW, 448, 532},
867   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 392, 420},
868   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 364},
869   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 280, 308},
870   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 224, 252},
871   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 168, 196},
872   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 140},
873   {22, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 84}};
874874
875875static pin_fuse_rows pal16h6pinfuserows[] = {
876    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 608},
877    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 480},
878    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 352},
879    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 288},
880    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 128, 224},
881    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 96}};
876   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 608},
877   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 480},
878   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 352},
879   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 288},
880   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 128, 224},
881   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 96}};
882882
883883static pin_fuse_rows pal16l6pinfuserows[] = {
884    {16, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 608},
885    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 480},
886    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 352},
887    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 288},
888    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 128, 224},
889    {21, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 96}};
884   {16, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 608},
885   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 384, 480},
886   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 352},
887   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 288},
888   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 128, 224},
889   {21, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 96}};
890890
891891static pin_fuse_rows pal18h4pinfuserows[] = {
892    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 504, 684},
893    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 360, 468},
894    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 216, 324},
895    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 180}};
892   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 504, 684},
893   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 360, 468},
894   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 216, 324},
895   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 180}};
896896
897897static pin_fuse_rows pal18l4pinfuserows[] = {
898    {17, NO_OUTPUT_ENABLE_FUSE_ROW, 504, 684},
899    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 360, 468},
900    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 216, 324},
901    {20, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 180}};
898   {17, NO_OUTPUT_ENABLE_FUSE_ROW, 504, 684},
899   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 360, 468},
900   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 216, 324},
901   {20, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 180}};
902902
903903static pin_fuse_rows pal20c1pinfuserows[] = {
904    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 280},
905    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 600}};
904   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 280},
905   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 600}};
906906
907907static pin_fuse_rows pal20l2pinfuserows[] = {
908    {18, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 600},
909    {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 280}};
908   {18, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 600},
909   {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 280}};
910910
911911static pin_fuse_columns pal10l8pinfusecolumns[] = {
912912   {1, 3, 2},
r26736r26737
15011501   {9,  29, 28},
15021502   {12, 31, 30},
15031503   {13, 27, 26},
1504    {14, 23, 22},
1505    {15, 19, 18},
1506    {16, 15, 14},
1507    {17, 11, 10},
1504   {14, 23, 22},
1505   {15, 19, 18},
1506   {16, 15, 14},
1507   {17, 11, 10},
15081508   {18, 7,  6},
15091509   {19, 3,  2}};
15101510
r26736r26737
15191519   {9,  29, 28},
15201520   {12, 31, 30},
15211521   {13, 27, 26},
1522    {14, 23, 22},
1523    {15, 19, 18},
1524    {16, 15, 14},
1525    {17, 11, 10},
1522   {14, 23, 22},
1523   {15, 19, 18},
1524   {16, 15, 14},
1525   {17, 11, 10},
15261526   {18, 7,  6},
15271527   {19, 3,  2}};
15281528
r26736r26737
16741674   {19, 3, 2}};  /* Registered Output */
16751675
16761676static pin_fuse_columns pal6l16pinfusecolumns[] = {
1677    {4, 1, 0},
1678    {5, 3, 2},
1679    {6, 5, 4},
1680    {7, 7, 6},
1681    {8, 9, 8},
1682    {9, 11, 10}};
1677   {4, 1, 0},
1678   {5, 3, 2},
1679   {6, 5, 4},
1680   {7, 7, 6},
1681   {8, 9, 8},
1682   {9, 11, 10}};
16831683
16841684static pin_fuse_columns pal8l14pinfusecolumns[] = {
1685    {3, 1, 0},
1686    {4, 3, 2},
1687    {5, 5, 4},
1688    {6, 7, 6},
1689    {7, 9, 8},
1690    {8, 11, 10},
1691    {9, 13, 12},
1692    {10, 15, 14}};
1685   {3, 1, 0},
1686   {4, 3, 2},
1687   {5, 5, 4},
1688   {6, 7, 6},
1689   {7, 9, 8},
1690   {8, 11, 10},
1691   {9, 13, 12},
1692   {10, 15, 14}};
16931693
16941694static pin_fuse_columns pal12h10pinfusecolumns[] = {
1695    {1, 3, 2},
1696    {2, 1, 0},
1697    {3, 5, 4},
1698    {4, 7, 6},
1699    {5, 9, 8},
1700    {6, 11, 10},
1701    {7, 13, 12},
1702    {8, 15, 14},
1703    {9, 17, 16},
1704    {10, 19, 18},
1705    {11, 21, 20},
1706    {13, 23, 22}};
1695   {1, 3, 2},
1696   {2, 1, 0},
1697   {3, 5, 4},
1698   {4, 7, 6},
1699   {5, 9, 8},
1700   {6, 11, 10},
1701   {7, 13, 12},
1702   {8, 15, 14},
1703   {9, 17, 16},
1704   {10, 19, 18},
1705   {11, 21, 20},
1706   {13, 23, 22}};
17071707
17081708static pin_fuse_columns pal12l10pinfusecolumns[] = {
1709    {1, 3, 2},
1710    {2, 1, 0},
1711    {3, 5, 4},
1712    {4, 7, 6},
1713    {5, 9, 8},
1714    {6, 11, 10},
1715    {7, 13, 12},
1716    {8, 15, 14},
1717    {9, 17, 16},
1718    {10, 19, 18},
1719    {11, 21, 20},
1720    {13, 23, 22}};
1709   {1, 3, 2},
1710   {2, 1, 0},
1711   {3, 5, 4},
1712   {4, 7, 6},
1713   {5, 9, 8},
1714   {6, 11, 10},
1715   {7, 13, 12},
1716   {8, 15, 14},
1717   {9, 17, 16},
1718   {10, 19, 18},
1719   {11, 21, 20},
1720   {13, 23, 22}};
17211721
17221722static pin_fuse_columns pal14h8pinfusecolumns[] = {
1723    {1, 3, 2},
1724    {2, 1, 0},
1725    {3, 5, 4},
1726    {4, 9, 8},
1727    {5, 11, 10},
1728    {6, 13, 12},
1729    {7, 15, 14},
1730    {8, 17, 16},
1731    {9, 19, 18},
1732    {10, 21, 20},
1733    {11, 25, 24},
1734    {13, 27, 26},
1735    {14, 23, 22},
1736    {23, 7, 6}};
1723   {1, 3, 2},
1724   {2, 1, 0},
1725   {3, 5, 4},
1726   {4, 9, 8},
1727   {5, 11, 10},
1728   {6, 13, 12},
1729   {7, 15, 14},
1730   {8, 17, 16},
1731   {9, 19, 18},
1732   {10, 21, 20},
1733   {11, 25, 24},
1734   {13, 27, 26},
1735   {14, 23, 22},
1736   {23, 7, 6}};
17371737
17381738static pin_fuse_columns pal14l8pinfusecolumns[] = {
1739    {1, 3, 2},
1740    {2, 1, 0},
1741    {3, 5, 4},
1742    {4, 9, 8},
1743    {5, 11, 10},
1744    {6, 13, 12},
1745    {7, 15, 14},
1746    {8, 17, 16},
1747    {9, 19, 18},
1748    {10, 21, 20},
1749    {11, 25, 24},
1750    {13, 27, 26},
1751    {14, 23, 22},
1752    {23, 7, 6}};
1739   {1, 3, 2},
1740   {2, 1, 0},
1741   {3, 5, 4},
1742   {4, 9, 8},
1743   {5, 11, 10},
1744   {6, 13, 12},
1745   {7, 15, 14},
1746   {8, 17, 16},
1747   {9, 19, 18},
1748   {10, 21, 20},
1749   {11, 25, 24},
1750   {13, 27, 26},
1751   {14, 23, 22},
1752   {23, 7, 6}};
17531753
17541754static pin_fuse_columns pal16h6pinfusecolumns[] = {
1755    {1, 3, 2},
1756    {2, 1, 0},
1757    {3, 5, 4},
1758    {4, 9, 8},
1759    {5, 13, 12},
1760    {6, 15, 14},
1761    {7, 17, 16},
1762    {8, 19, 18},
1763    {9, 21, 20},
1764    {10, 25, 24},
1765    {11, 29, 28},
1766    {13, 31, 30},
1767    {14, 27, 26},
1768    {15, 23, 22},
1769    {22, 11, 10},
1770    {23, 7, 6}};
1755   {1, 3, 2},
1756   {2, 1, 0},
1757   {3, 5, 4},
1758   {4, 9, 8},
1759   {5, 13, 12},
1760   {6, 15, 14},
1761   {7, 17, 16},
1762   {8, 19, 18},
1763   {9, 21, 20},
1764   {10, 25, 24},
1765   {11, 29, 28},
1766   {13, 31, 30},
1767   {14, 27, 26},
1768   {15, 23, 22},
1769   {22, 11, 10},
1770   {23, 7, 6}};
17711771
17721772static pin_fuse_columns pal16l6pinfusecolumns[] = {
1773    {1, 3, 2},
1774    {2, 1, 0},
1775    {3, 5, 4},
1776    {4, 9, 8},
1777    {5, 13, 12},
1778    {6, 15, 14},
1779    {7, 17, 16},
1780    {8, 19, 18},
1781    {9, 21, 20},
1782    {10, 25, 24},
1783    {11, 29, 28},
1784    {13, 31, 30},
1785    {14, 27, 26},
1786    {15, 23, 22},
1787    {22, 11, 10},
1788    {23, 7, 6}};
1773   {1, 3, 2},
1774   {2, 1, 0},
1775   {3, 5, 4},
1776   {4, 9, 8},
1777   {5, 13, 12},
1778   {6, 15, 14},
1779   {7, 17, 16},
1780   {8, 19, 18},
1781   {9, 21, 20},
1782   {10, 25, 24},
1783   {11, 29, 28},
1784   {13, 31, 30},
1785   {14, 27, 26},
1786   {15, 23, 22},
1787   {22, 11, 10},
1788   {23, 7, 6}};
17891789
17901790static pin_fuse_columns pal18h4pinfusecolumns[] = {
1791    {1, 3, 2},
1792    {2, 1, 0},
1793    {3, 5, 4},
1794    {4, 9, 8},
1795    {5, 13, 12},
1796    {6, 17, 16},
1797    {7, 19, 18},
1798    {8, 21, 20},
1799    {9, 25, 24},
1800    {10, 29, 28},
1801    {11, 33, 32},
1802    {13, 35, 34},
1803    {14, 31, 30},
1804    {15, 27, 26},
1805    {16, 23, 22},
1806    {21, 15, 14},
1807    {22, 11, 10},
1808    {23, 7, 6}};
1791   {1, 3, 2},
1792   {2, 1, 0},
1793   {3, 5, 4},
1794   {4, 9, 8},
1795   {5, 13, 12},
1796   {6, 17, 16},
1797   {7, 19, 18},
1798   {8, 21, 20},
1799   {9, 25, 24},
1800   {10, 29, 28},
1801   {11, 33, 32},
1802   {13, 35, 34},
1803   {14, 31, 30},
1804   {15, 27, 26},
1805   {16, 23, 22},
1806   {21, 15, 14},
1807   {22, 11, 10},
1808   {23, 7, 6}};
18091809
18101810static pin_fuse_columns pal18l4pinfusecolumns[] = {
1811    {1, 3, 2},
1812    {2, 1, 0},
1813    {3, 5, 4},
1814    {4, 9, 8},
1815    {5, 13, 12},
1816    {6, 17, 16},
1817    {7, 19, 18},
1818    {8, 21, 20},
1819    {9, 25, 24},
1820    {10, 29, 28},
1821    {11, 33, 32},
1822    {13, 35, 34},
1823    {14, 31, 30},
1824    {15, 27, 26},
1825    {16, 23, 22},
1826    {21, 15, 14},
1827    {22, 11, 10},
1828    {23, 7, 6}};
1811   {1, 3, 2},
1812   {2, 1, 0},
1813   {3, 5, 4},
1814   {4, 9, 8},
1815   {5, 13, 12},
1816   {6, 17, 16},
1817   {7, 19, 18},
1818   {8, 21, 20},
1819   {9, 25, 24},
1820   {10, 29, 28},
1821   {11, 33, 32},
1822   {13, 35, 34},
1823   {14, 31, 30},
1824   {15, 27, 26},
1825   {16, 23, 22},
1826   {21, 15, 14},
1827   {22, 11, 10},
1828   {23, 7, 6}};
18291829
18301830static pin_fuse_columns pal20c1pinfusecolumns[] = {
1831    {1, 3, 2},
1832    {2, 1, 0},
1833    {3, 5, 4},
1834    {4, 9, 8},
1835    {5, 13, 12},
1836    {6, 17, 16},
1837    {7, 21, 20},
1838    {8, 25, 24},
1839    {9, 29, 28},
1840    {10, 33, 32},
1841    {11, 37, 36},
1842    {13, 39, 38},
1843    {14, 35, 34},
1844    {15, 31, 30},
1845    {16, 27, 26},
1846    {17, 23, 22},
1847    {20, 19, 18},
1848    {21, 15, 14},
1849    {22, 11, 10},
1850    {23, 7, 6}};
1831   {1, 3, 2},
1832   {2, 1, 0},
1833   {3, 5, 4},
1834   {4, 9, 8},
1835   {5, 13, 12},
1836   {6, 17, 16},
1837   {7, 21, 20},
1838   {8, 25, 24},
1839   {9, 29, 28},
1840   {10, 33, 32},
1841   {11, 37, 36},
1842   {13, 39, 38},
1843   {14, 35, 34},
1844   {15, 31, 30},
1845   {16, 27, 26},
1846   {17, 23, 22},
1847   {20, 19, 18},
1848   {21, 15, 14},
1849   {22, 11, 10},
1850   {23, 7, 6}};
18511851
18521852static pin_fuse_columns pal20l2pinfusecolumns[] = {
1853    {1, 3, 2},
1854    {2, 1, 0},
1855    {3, 5, 4},
1856    {4, 9, 8},
1857    {5, 13, 12},
1858    {6, 17, 16},
1859    {7, 21, 20},
1860    {8, 25, 24},
1861    {9, 29, 28},
1862    {10, 33, 32},
1863    {11, 37, 36},
1864    {13, 39, 38},
1865    {14, 35, 34},
1866    {15, 31, 30},
1867    {16, 27, 26},
1868    {17, 23, 22},
1869    {20, 19, 18},
1870    {21, 15, 14},
1871    {22, 11, 10},
1872    {23, 7, 6}};
1853   {1, 3, 2},
1854   {2, 1, 0},
1855   {3, 5, 4},
1856   {4, 9, 8},
1857   {5, 13, 12},
1858   {6, 17, 16},
1859   {7, 21, 20},
1860   {8, 25, 24},
1861   {9, 29, 28},
1862   {10, 33, 32},
1863   {11, 37, 36},
1864   {13, 39, 38},
1865   {14, 35, 34},
1866   {15, 31, 30},
1867   {16, 27, 26},
1868   {17, 23, 22},
1869   {20, 19, 18},
1870   {21, 15, 14},
1871   {22, 11, 10},
1872   {23, 7, 6}};
18731873
18741874static pal_data paldata[] = {
18751875   {"PAL10L8", 320,
r26736r26737
21242124      print_epl16rp6_product_terms,
21252125      config_epl16rp6_pins,
21262126      NULL,
2127        NULL},
2127      NULL},
21282128   {"EPL16RP4", 2072,
21292129      epl16rp4pinfuserows, ARRAY_LEN(epl16rp4pinfuserows),
21302130      epl16rp4pinfusecolumns, ARRAY_LEN(epl16rp4pinfusecolumns),
21312131      print_epl16rp4_product_terms,
21322132      config_epl16rp4_pins,
21332133      NULL,
2134        NULL},
2134      NULL},
21352135#endif
21362136   {"PAL10P8", 328,
21372137      pal10p8pinfuserows, ARRAY_LEN(pal10p8pinfuserows),
r26736r26737
21392139      print_pal10p8_product_terms,
21402140      config_pal10p8_pins,
21412141      NULL,
2142        NULL},
2142      NULL},
21432143   {"PAL12P6", 390,
21442144      pal12p6pinfuserows, ARRAY_LEN(pal12p6pinfuserows),
21452145      pal12p6pinfusecolumns, ARRAY_LEN(pal12p6pinfusecolumns),
21462146      print_pal12p6_product_terms,
21472147      config_pal12p6_pins,
21482148      NULL,
2149        NULL},
2149      NULL},
21502150   {"PAL14P4", 452,
21512151      pal14p4pinfuserows, ARRAY_LEN(pal14p4pinfuserows),
21522152      pal14p4pinfusecolumns, ARRAY_LEN(pal14p4pinfusecolumns),
21532153      print_pal14p4_product_terms,
21542154      config_pal14p4_pins,
21552155      NULL,
2156        NULL},
2156      NULL},
21572157   {"PAL16P2", 514,
21582158      pal16p2pinfuserows, ARRAY_LEN(pal16p2pinfuserows),
21592159      pal16p2pinfusecolumns, ARRAY_LEN(pal16p2pinfusecolumns),
21602160      print_pal16p2_product_terms,
21612161      config_pal16p2_pins,
21622162      NULL,
2163        NULL},
2163      NULL},
21642164   {"PAL16P8", 2056,
21652165      pal16p8pinfuserows, ARRAY_LEN(pal16p8pinfuserows),
21662166      pal16p8pinfusecolumns, ARRAY_LEN(pal16p8pinfusecolumns),
21672167      print_pal16p8_product_terms,
2168        config_pal16p8_pins,
2169        NULL,
2170        NULL},
2168      config_pal16p8_pins,
2169      NULL,
2170      NULL},
21712171   {"PAL16RP4", 2056,
21722172      pal16rp4pinfuserows, ARRAY_LEN(pal16rp4pinfuserows),
21732173      pal16rp4pinfusecolumns, ARRAY_LEN(pal16rp4pinfusecolumns),
21742174      print_pal16rp4_product_terms,
2175        config_pal16rp4_pins,
2176        NULL,
2177        NULL},
2175      config_pal16rp4_pins,
2176      NULL,
2177      NULL},
21782178   {"PAL16RP6", 2056,
21792179      pal16rp6pinfuserows, ARRAY_LEN(pal16rp6pinfuserows),
21802180      pal16rp6pinfusecolumns, ARRAY_LEN(pal16rp6pinfusecolumns),
21812181      print_pal16rp6_product_terms,
2182        config_pal16rp6_pins,
2183        NULL,
2184        NULL},
2182      config_pal16rp6_pins,
2183      NULL,
2184      NULL},
21852185   {"PAL16RP8", 2056,
21862186      pal16rp8pinfuserows, ARRAY_LEN(pal16rp8pinfuserows),
21872187      pal16rp8pinfusecolumns, ARRAY_LEN(pal16rp8pinfusecolumns),
21882188      print_pal16rp8_product_terms,
2189        config_pal16rp8_pins,
2190        NULL,
2191        NULL},
2192    {"PAL6L16", 192,
2193        pal6l16pinfuserows, ARRAY_LEN(pal6l16pinfuserows),
2194        pal6l16pinfusecolumns, ARRAY_LEN(pal6l16pinfusecolumns),
2195        print_pal6l16_product_terms,
2196        config_pal6l16_pins,
2197        NULL,
2198        NULL},
2199    {"PAL8L14", 224,
2200        pal8l14pinfuserows, ARRAY_LEN(pal8l14pinfuserows),
2201        pal8l14pinfusecolumns, ARRAY_LEN(pal8l14pinfusecolumns),
2202        print_pal8l14_product_terms,
2203        config_pal8l14_pins,
2204        NULL,
2205        NULL},
2206    {"PAL12H10", 480,
2207        pal12h10pinfuserows, ARRAY_LEN(pal12h10pinfuserows),
2208        pal12h10pinfusecolumns, ARRAY_LEN(pal12h10pinfusecolumns),
2209        print_pal12h10_product_terms,
2210        config_pal12h10_pins,
2211        NULL,
2212        NULL},
2213    {"PAL12L10", 480,
2214        pal12l10pinfuserows, ARRAY_LEN(pal12l10pinfuserows),
2215        pal12l10pinfusecolumns, ARRAY_LEN(pal12l10pinfusecolumns),
2216        print_pal12l10_product_terms,
2217        config_pal12l10_pins,
2218        NULL,
2219        NULL},
2220    {"PAL14H8", 560,
2221        pal14h8pinfuserows, ARRAY_LEN(pal14h8pinfuserows),
2222        pal14h8pinfusecolumns, ARRAY_LEN(pal14h8pinfusecolumns),
2223        print_pal14h8_product_terms,
2224        config_pal14h8_pins,
2225        NULL,
2226        NULL},
2227    {"PAL14L8", 560,
2228        pal14l8pinfuserows, ARRAY_LEN(pal14l8pinfuserows),
2229        pal14l8pinfusecolumns, ARRAY_LEN(pal14l8pinfusecolumns),
2230        print_pal14l8_product_terms,
2231        config_pal14l8_pins,
2232        NULL,
2233        NULL},
2234    {"PAL16H6", 640,
2235        pal16h6pinfuserows, ARRAY_LEN(pal16h6pinfuserows),
2236        pal16h6pinfusecolumns, ARRAY_LEN(pal16h6pinfusecolumns),
2237        print_pal16h6_product_terms,
2238        config_pal16h6_pins,
2239        NULL,
2240        NULL},
2241    {"PAL16L6", 640,
2242        pal16l6pinfuserows, ARRAY_LEN(pal16l6pinfuserows),
2243        pal16l6pinfusecolumns, ARRAY_LEN(pal16l6pinfusecolumns),
2244        print_pal16l6_product_terms,
2245        config_pal16l6_pins,
2246        NULL,
2247        NULL},
2248    {"PAL18H4", 720,
2249        pal18h4pinfuserows, ARRAY_LEN(pal18h4pinfuserows),
2250        pal18h4pinfusecolumns, ARRAY_LEN(pal18h4pinfusecolumns),
2251        print_pal18h4_product_terms,
2252        config_pal18h4_pins,
2253        NULL,
2254        NULL},
2255    {"PAL18L4", 720,
2256        pal18l4pinfuserows, ARRAY_LEN(pal18l4pinfuserows),
2257        pal18l4pinfusecolumns, ARRAY_LEN(pal18l4pinfusecolumns),
2258        print_pal18l4_product_terms,
2259        config_pal18l4_pins,
2260        NULL,
2261        NULL},
2262    {"PAL20C1", 640,
2263        pal20c1pinfuserows, ARRAY_LEN(pal20c1pinfuserows),
2264        pal20c1pinfusecolumns, ARRAY_LEN(pal20c1pinfusecolumns),
2265        print_pal20c1_product_terms,
2266        config_pal20c1_pins,
2267        NULL,
2268        NULL},
2269    {"PAL20L2", 640,
2270        pal20l2pinfuserows, ARRAY_LEN(pal20l2pinfuserows),
2271        pal20l2pinfusecolumns, ARRAY_LEN(pal20l2pinfusecolumns),
2272        print_pal20l2_product_terms,
2273        config_pal20l2_pins,
2274        NULL,
2275        NULL}};
2189      config_pal16rp8_pins,
2190      NULL,
2191      NULL},
2192   {"PAL6L16", 192,
2193      pal6l16pinfuserows, ARRAY_LEN(pal6l16pinfuserows),
2194      pal6l16pinfusecolumns, ARRAY_LEN(pal6l16pinfusecolumns),
2195      print_pal6l16_product_terms,
2196      config_pal6l16_pins,
2197      NULL,
2198      NULL},
2199   {"PAL8L14", 224,
2200      pal8l14pinfuserows, ARRAY_LEN(pal8l14pinfuserows),
2201      pal8l14pinfusecolumns, ARRAY_LEN(pal8l14pinfusecolumns),
2202      print_pal8l14_product_terms,
2203      config_pal8l14_pins,
2204      NULL,
2205      NULL},
2206   {"PAL12H10", 480,
2207      pal12h10pinfuserows, ARRAY_LEN(pal12h10pinfuserows),
2208      pal12h10pinfusecolumns, ARRAY_LEN(pal12h10pinfusecolumns),
2209      print_pal12h10_product_terms,
2210      config_pal12h10_pins,
2211      NULL,
2212      NULL},
2213   {"PAL12L10", 480,
2214      pal12l10pinfuserows, ARRAY_LEN(pal12l10pinfuserows),
2215      pal12l10pinfusecolumns, ARRAY_LEN(pal12l10pinfusecolumns),
2216      print_pal12l10_product_terms,
2217      config_pal12l10_pins,
2218      NULL,
2219      NULL},
2220   {"PAL14H8", 560,
2221      pal14h8pinfuserows, ARRAY_LEN(pal14h8pinfuserows),
2222      pal14h8pinfusecolumns, ARRAY_LEN(pal14h8pinfusecolumns),
2223      print_pal14h8_product_terms,
2224      config_pal14h8_pins,
2225      NULL,
2226      NULL},
2227   {"PAL14L8", 560,
2228      pal14l8pinfuserows, ARRAY_LEN(pal14l8pinfuserows),
2229      pal14l8pinfusecolumns, ARRAY_LEN(pal14l8pinfusecolumns),
2230      print_pal14l8_product_terms,
2231      config_pal14l8_pins,
2232      NULL,
2233      NULL},
2234   {"PAL16H6", 640,
2235      pal16h6pinfuserows, ARRAY_LEN(pal16h6pinfuserows),
2236      pal16h6pinfusecolumns, ARRAY_LEN(pal16h6pinfusecolumns),
2237      print_pal16h6_product_terms,
2238      config_pal16h6_pins,
2239      NULL,
2240      NULL},
2241   {"PAL16L6", 640,
2242      pal16l6pinfuserows, ARRAY_LEN(pal16l6pinfuserows),
2243      pal16l6pinfusecolumns, ARRAY_LEN(pal16l6pinfusecolumns),
2244      print_pal16l6_product_terms,
2245      config_pal16l6_pins,
2246      NULL,
2247      NULL},
2248   {"PAL18H4", 720,
2249      pal18h4pinfuserows, ARRAY_LEN(pal18h4pinfuserows),
2250      pal18h4pinfusecolumns, ARRAY_LEN(pal18h4pinfusecolumns),
2251      print_pal18h4_product_terms,
2252      config_pal18h4_pins,
2253      NULL,
2254      NULL},
2255   {"PAL18L4", 720,
2256      pal18l4pinfuserows, ARRAY_LEN(pal18l4pinfuserows),
2257      pal18l4pinfusecolumns, ARRAY_LEN(pal18l4pinfusecolumns),
2258      print_pal18l4_product_terms,
2259      config_pal18l4_pins,
2260      NULL,
2261      NULL},
2262   {"PAL20C1", 640,
2263      pal20c1pinfuserows, ARRAY_LEN(pal20c1pinfuserows),
2264      pal20c1pinfusecolumns, ARRAY_LEN(pal20c1pinfusecolumns),
2265      print_pal20c1_product_terms,
2266      config_pal20c1_pins,
2267      NULL,
2268      NULL},
2269   {"PAL20L2", 640,
2270      pal20l2pinfuserows, ARRAY_LEN(pal20l2pinfuserows),
2271      pal20l2pinfusecolumns, ARRAY_LEN(pal20l2pinfusecolumns),
2272      print_pal20l2_product_terms,
2273      config_pal20l2_pins,
2274      NULL,
2275      NULL}};
22762276
22772277/***************************************************************************
22782278    CORE IMPLEMENTATION
r26736r26737
29762976
29772977static void config_palce16v8_pin_as_7_product_terms_and_oe_term(UINT16 pin)
29782978{
2979    static pin_fuse_rows pinfuserows[] = {
2980       {12, 1792, 1824, 2016},
2981       {13, 1536, 1568, 1760},
2982       {14, 1280, 1312, 1504},
2983       {15, 1024, 1056, 1248},
2984       {16, 768, 800, 992},
2985       {17, 512, 544, 736},
2986       {18, 256, 288, 480},
2987       {19, 0, 32, 224}};
2988    UINT16 index;
2979   static pin_fuse_rows pinfuserows[] = {
2980      {12, 1792, 1824, 2016},
2981      {13, 1536, 1568, 1760},
2982      {14, 1280, 1312, 1504},
2983      {15, 1024, 1056, 1248},
2984      {16, 768, 800, 992},
2985      {17, 512, 544, 736},
2986      {18, 256, 288, 480},
2987      {19, 0, 32, 224}};
2988   UINT16 index;
29892989
2990    for (index = 0; index < ARRAY_LEN(pinfuserows); ++index)
2991    {
2992        if (pinfuserows[index].pin == pin)
2993        {
2994            palce16v8pinfuserows[index].fuserowoutputenable = pinfuserows[index].fuserowoutputenable;
2995            palce16v8pinfuserows[index].fuserowtermstart = pinfuserows[index].fuserowtermstart;
2996           palce16v8pinfuserows[index].fuserowtermend = pinfuserows[index].fuserowtermend;
2990   for (index = 0; index < ARRAY_LEN(pinfuserows); ++index)
2991   {
2992      if (pinfuserows[index].pin == pin)
2993      {
2994         palce16v8pinfuserows[index].fuserowoutputenable = pinfuserows[index].fuserowoutputenable;
2995         palce16v8pinfuserows[index].fuserowtermstart = pinfuserows[index].fuserowtermstart;
2996         palce16v8pinfuserows[index].fuserowtermend = pinfuserows[index].fuserowtermend;
29972997
2998            break;
2999        }
3000    }
2998         break;
2999      }
3000   }
30013001}
30023002
30033003
r26736r26737
30103010
30113011static void config_palce16v8_pin_as_8_product_terms(UINT16 pin)
30123012{
3013    static pin_fuse_rows pinfuserows[] = {
3014       {12, NO_OUTPUT_ENABLE_FUSE_ROW, 1792, 2016},
3015       {13, NO_OUTPUT_ENABLE_FUSE_ROW, 1536, 1760},
3016       {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504},
3017       {15, NO_OUTPUT_ENABLE_FUSE_ROW, 1024, 1248},
3018       {16, NO_OUTPUT_ENABLE_FUSE_ROW, 768, 992},
3019       {17, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 736},
3020       {18, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 480},
3021       {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 224}};
3022    UINT16 index;
3013   static pin_fuse_rows pinfuserows[] = {
3014      {12, NO_OUTPUT_ENABLE_FUSE_ROW, 1792, 2016},
3015      {13, NO_OUTPUT_ENABLE_FUSE_ROW, 1536, 1760},
3016      {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504},
3017      {15, NO_OUTPUT_ENABLE_FUSE_ROW, 1024, 1248},
3018      {16, NO_OUTPUT_ENABLE_FUSE_ROW, 768, 992},
3019      {17, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 736},
3020      {18, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 480},
3021      {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 224}};
3022   UINT16 index;
30233023
3024    for (index = 0; index < ARRAY_LEN(pinfuserows); ++index)
3025    {
3026        if (pinfuserows[index].pin == pin)
3027        {
3028            palce16v8pinfuserows[index].fuserowoutputenable = pinfuserows[index].fuserowoutputenable;
3029            palce16v8pinfuserows[index].fuserowtermstart = pinfuserows[index].fuserowtermstart;
3030           palce16v8pinfuserows[index].fuserowtermend = pinfuserows[index].fuserowtermend;
3024   for (index = 0; index < ARRAY_LEN(pinfuserows); ++index)
3025   {
3026      if (pinfuserows[index].pin == pin)
3027      {
3028         palce16v8pinfuserows[index].fuserowoutputenable = pinfuserows[index].fuserowoutputenable;
3029         palce16v8pinfuserows[index].fuserowtermstart = pinfuserows[index].fuserowtermstart;
3030         palce16v8pinfuserows[index].fuserowtermend = pinfuserows[index].fuserowtermend;
30313031
3032            break;
3033        }
3034    }
3032         break;
3033      }
3034   }
30353035}
30363036
30373037
r26736r26737
30613061
30623062      indent = 0;
30633063
3064        if (flags & OUTPUT_COMBINATORIAL)
3065        {
3066          sprintf(buffer, LOW_SYMBOL OUTPUT_SYMBOL "%d " COMBINATORIAL_ASSIGNMENT " ", outputpins[index].pin);
3064      if (flags & OUTPUT_COMBINATORIAL)
3065      {
3066         sprintf(buffer, LOW_SYMBOL OUTPUT_SYMBOL "%d " COMBINATORIAL_ASSIGNMENT " ", outputpins[index].pin);
30673067
3068          printf("%s", buffer);
3068         printf("%s", buffer);
30693069
3070          haveterms = 0;
3071          indent += strlen(buffer);
3070         haveterms = 0;
3071         indent += strlen(buffer);
30723072
3073          fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
3073         fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
30743074
3075             for (row = fuse_rows->fuserowtermstart; row <= fuse_rows->fuserowtermend;
3076             row += columncount)
3077            {
3075         for (row = fuse_rows->fuserowtermstart; row <= fuse_rows->fuserowtermend;
3076               row += columncount)
3077         {
30783078            generate_product_terms(pal, jed, row, buffer);
30793079
30803080            if (strlen(buffer) > 0)
r26736r26737
30823082               if (haveterms)
30833083               {
30843084                  printf(" ");
3085                        printf(OR_SYMBOL);
3086                        printf("\n");
3085                  printf(OR_SYMBOL);
3086                  printf("\n");
30873087
30883088                  for (indentindex = 0; indentindex < indent; ++indentindex)
30893089                  {
r26736r26737
30973097
30983098               printf("%s", buffer);
30993099            }
3100            }
3100         }
31013101
3102          printf("\n");
3102         printf("\n");
31033103
3104          /* output enable equation */
3104         /* output enable equation */
31053105
3106          printf(OUTPUT_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " ", outputpins[index].pin);
3106         printf(OUTPUT_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " ", outputpins[index].pin);
31073107
3108          if (all_fuses_in_row_blown(pal, jed, fuse_rows->fuserowoutputenable))
3109          {
3110             printf("vcc\n");
3111          }
3112          else
3113          {
3114             generate_product_terms(pal, jed, fuse_rows->fuserowoutputenable, buffer);
3108         if (all_fuses_in_row_blown(pal, jed, fuse_rows->fuserowoutputenable))
3109         {
3110            printf("vcc\n");
3111         }
3112         else
3113         {
3114            generate_product_terms(pal, jed, fuse_rows->fuserowoutputenable, buffer);
31153115
3116             printf("%s\n", buffer);
3117          }
3118        }
3119        else if (flags & OUTPUT_REGISTERED)
3120        {
3121          sprintf(buffer, LOW_SYMBOL REGISTERED_FEEDBACK_SYMBOL "%d " REGISTERED_ASSIGNMENT " ", outputpins[index].pin);
3116            printf("%s\n", buffer);
3117         }
3118      }
3119      else if (flags & OUTPUT_REGISTERED)
3120      {
3121         sprintf(buffer, LOW_SYMBOL REGISTERED_FEEDBACK_SYMBOL "%d " REGISTERED_ASSIGNMENT " ", outputpins[index].pin);
31223122
3123          printf("%s", buffer);
3123         printf("%s", buffer);
31243124
3125          haveterms = 0;
3126          indent += strlen(buffer);
3125         haveterms = 0;
3126         indent += strlen(buffer);
31273127
3128          fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
3129          tmpindex = 0;
3128         fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
3129         tmpindex = 0;
31303130
3131            memset(rowhasterms, 0, sizeof(rowhasterms));
3131         memset(rowhasterms, 0, sizeof(rowhasterms));
31323132
3133             for (row = fuse_rows->fuserowtermstart; row <= fuse_rows->fuserowtermend;
3134             row += columncount)
3135            {
3133         for (row = fuse_rows->fuserowtermstart; row <= fuse_rows->fuserowtermend;
3134               row += columncount)
3135         {
31363136            generate_product_terms(pal, jed, row, buffer);
31373137
31383138            if (strlen(buffer) > 0)
3139                {
3140                    rowhasterms[tmpindex] = 1;
3139            {
3140               rowhasterms[tmpindex] = 1;
31413141
31423142               if (haveterms)
31433143               {
3144                        if (tmpindex == 1)
3145                        {
3146                            printf(" " OR_SYMBOL "\n");
3147                        }
3148                        else if (tmpindex == 2)
3149                        {
3150                            printf(" " XOR_SYMBOL "\n");
3151                        }
3152                        else if (tmpindex == 3)
3153                        {
3154                            if (rowhasterms[2])
3155                            {
3156                                printf(" " OR_SYMBOL "\n");
3157                            }
3158                            else
3159                            {
3160                                printf(" " XOR_SYMBOL "\n");
3161                            }
3162                        }
3144                  if (tmpindex == 1)
3145                  {
3146                     printf(" " OR_SYMBOL "\n");
3147                  }
3148                  else if (tmpindex == 2)
3149                  {
3150                     printf(" " XOR_SYMBOL "\n");
3151                  }
3152                  else if (tmpindex == 3)
3153                  {
3154                     if (rowhasterms[2])
3155                     {
3156                        printf(" " OR_SYMBOL "\n");
3157                     }
3158                     else
3159                     {
3160                        printf(" " XOR_SYMBOL "\n");
3161                     }
3162                  }
31633163
31643164                  for (indentindex = 0; indentindex < indent; ++indentindex)
31653165                  {
r26736r26737
31723172               }
31733173
31743174               printf("%s", buffer);
3175                }
3175            }
31763176
3177                ++tmpindex;
3178            }
3177            ++tmpindex;
3178         }
31793179
3180            printf("\n");
3180         printf("\n");
31813181
3182          /* output enable equation */
3182         /* output enable equation */
31833183
3184          printf(REGISTERED_FEEDBACK_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " OE\n", outputpins[index].pin);
3185        }
3186        else
3187        {
3188            fprintf(stderr, "Unknown output type for pin %d!\n", outputpins[index].pin);
3189        }
3184         printf(REGISTERED_FEEDBACK_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " OE\n", outputpins[index].pin);
3185      }
3186      else
3187      {
3188         fprintf(stderr, "Unknown output type for pin %d!\n", outputpins[index].pin);
3189      }
31903190
3191       printf("\n");
3191      printf("\n");
31923192   }
31933193}
31943194
r26736r26737
37063706            {
37073707               if (haveterms)
37083708               {
3709                        printf(" " OR_SYMBOL "\n");
3709                  printf(" " OR_SYMBOL "\n");
37103710
37113711                  for (indentindex = 0; indentindex < indent; ++indentindex)
37123712                  {
r26736r26737
37613761   {
37623762      UINT16 pin;
37633763      UINT16 or_fuse; /* 0 - intact? */
3764        UINT16 xor_fuse; /* 0 - intact? */
3764      UINT16 xor_fuse; /* 0 - intact? */
37653765   };
37663766
3767    static memory_cell memory_cells[] = {
3768        {12, 661, 662},
3769        {13, 658, 659},
3770        {14, 655, 656},
3771        {15, 652, 653},
3772        {16, 649, 650},
3773        {17, 646, 647},
3774        {18, 643, 644},
3775        {19, 640, 641}};
3767   static memory_cell memory_cells[] = {
3768      {12, 661, 662},
3769      {13, 658, 659},
3770      {14, 655, 656},
3771      {15, 652, 653},
3772      {16, 649, 650},
3773      {17, 646, 647},
3774      {18, 643, 644},
3775      {19, 640, 641}};
37763776   UINT16 index, columncount, flags, haveterms, fuserow;
37773777   char buffer[200];
37783778   int indent, row, indentindex;
37793779   const pin_fuse_rows* fuse_rows;
37803780
3781    printf("Warning: This is experimental support!\n");
3781   printf("Warning: This is experimental support!\n");
37823782
37833783   columncount = calc_fuse_column_count(pal);
37843784
r26736r26737
37863786   print_output_pins();
37873787
37883788   printf("Equations:\n\n");
3789   
3790    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
3791    {
3789
3790   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
3791   {
37923792      flags = outputpins[index].flags;
37933793
37943794      indent = 0;
r26736r26737
38103810      fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
38113811
38123812      if (!jed_get_fuse(jed, memory_cells[index].or_fuse) ||
3813            !jed_get_fuse(jed, memory_cells[index].xor_fuse))
3814        {
3815            /* MMI PAL pin compatible configuration */
3813         !jed_get_fuse(jed, memory_cells[index].xor_fuse))
3814      {
3815         /* MMI PAL pin compatible configuration */
38163816
3817            fuserow = fuse_rows->fuserowtermstart;
3817         fuserow = fuse_rows->fuserowtermstart;
38183818
3819            for (row = 0; row < 2; ++row)
3820            {
3819         for (row = 0; row < 2; ++row)
3820         {
38213821            generate_product_terms(pal, jed, fuserow, buffer);
38223822
38233823            if (strlen(buffer) > 0)
38243824            {
38253825               if (haveterms)
38263826               {
3827                        printf(" " OR_SYMBOL "\n");
3827                  printf(" " OR_SYMBOL "\n");
38283828
38293829                  for (indentindex = 0; indentindex < indent; ++indentindex)
38303830                  {
r26736r26737
38393839               printf("%s", buffer);
38403840            }
38413841
3842                fuserow += columncount;
3843            }
3842            fuserow += columncount;
3843         }
38443844
3845           printf("\n");
3845         printf("\n");
38463846
3847          printf(OUTPUT_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " vcc\n", outputpins[index].pin);
3847         printf(OUTPUT_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " vcc\n", outputpins[index].pin);
38483848
3849            printf("\n");
3850        }
3849         printf("\n");
3850      }
38513851      else if (!jed_get_fuse(jed, memory_cells[index].or_fuse) ||
3852                 jed_get_fuse(jed, memory_cells[index].xor_fuse))
3853        {
3854            /* or configuration */
3852               jed_get_fuse(jed, memory_cells[index].xor_fuse))
3853      {
3854         /* or configuration */
38553855
3856            fuserow = fuse_rows->fuserowtermstart;
3856         fuserow = fuse_rows->fuserowtermstart;
38573857
3858            for (row = 0; row < 4; ++row)
3859            {
3858         for (row = 0; row < 4; ++row)
3859         {
38603860            generate_product_terms(pal, jed, fuserow, buffer);
38613861
38623862            if (strlen(buffer) > 0)
38633863            {
38643864               if (haveterms)
38653865               {
3866                        printf(" " OR_SYMBOL "\n");
3866                  printf(" " OR_SYMBOL "\n");
38673867
38683868                  for (indentindex = 0; indentindex < indent; ++indentindex)
38693869                  {
r26736r26737
38783878               printf("%s", buffer);
38793879            }
38803880
3881                fuse_rows += columncount;
3882            }
3881            fuse_rows += columncount;
3882         }
38833883
3884           printf("\n");
3884         printf("\n");
38853885
3886          printf(OUTPUT_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " vcc\n", outputpins[index].pin);
3886         printf(OUTPUT_SYMBOL "%d.oe " COMBINATORIAL_ASSIGNMENT " vcc\n", outputpins[index].pin);
38873887
3888            printf("\n");
3889        }
3888         printf("\n");
3889      }
38903890      else if (jed_get_fuse(jed, memory_cells[index].or_fuse) ||
3891                 !jed_get_fuse(jed, memory_cells[index].xor_fuse))
3892        {
3893            /* xor configuration */
3894        }
3895        else
3896        {
3897            fprintf(stderr, "Unknown fuse configuration for pin %d!", memory_cells[index].pin);
3898        }
3899    }
3891               !jed_get_fuse(jed, memory_cells[index].xor_fuse))
3892      {
3893         /* xor configuration */
3894      }
3895      else
3896      {
3897         fprintf(stderr, "Unknown fuse configuration for pin %d!", memory_cells[index].pin);
3898      }
3899   }
39003900
3901    printf("Warning: This is experimental support!\n");
3901   printf("Warning: This is experimental support!\n");
39023902}
39033903
39043904
r26736r26737
39103910
39113911static void print_epl12p6_product_terms(const pal_data* pal, const jed_data* jed)
39123912{
3913    fprintf(stderr, "Printing product terms not supported for this device!\n");
3913   fprintf(stderr, "Printing product terms not supported for this device!\n");
39143914}
39153915
39163916
r26736r26737
39223922
39233923static void print_epl14p4_product_terms(const pal_data* pal, const jed_data* jed)
39243924{
3925    fprintf(stderr, "Printing product terms not supported for this device!\n");
3925   fprintf(stderr, "Printing product terms not supported for this device!\n");
39263926}
39273927
39283928
r26736r26737
39343934
39353935static void print_epl16p2_product_terms(const pal_data* pal, const jed_data* jed)
39363936{
3937    fprintf(stderr, "Printing product terms not supported for this device!\n");
3937   fprintf(stderr, "Printing product terms not supported for this device!\n");
39383938}
39393939
39403940
r26736r26737
39463946
39473947static void print_epl16p8_product_terms(const pal_data* pal, const jed_data* jed)
39483948{
3949    fprintf(stderr, "Printing product terms not supported for this device!\n");
3949   fprintf(stderr, "Printing product terms not supported for this device!\n");
39503950}
39513951
39523952
r26736r26737
39583958
39593959static void print_epl16rp8_product_terms(const pal_data* pal, const jed_data* jed)
39603960{
3961    fprintf(stderr, "Printing product terms not supported for this device!\n");
3961   fprintf(stderr, "Printing product terms not supported for this device!\n");
39623962}
39633963
39643964
r26736r26737
39703970
39713971static void print_epl16rp6_product_terms(const pal_data* pal, const jed_data* jed)
39723972{
3973    fprintf(stderr, "Printing product terms not supported for this device!\n");
3973   fprintf(stderr, "Printing product terms not supported for this device!\n");
39743974}
39753975
39763976
r26736r26737
39823982
39833983static void print_epl16rp4_product_terms(const pal_data* pal, const jed_data* jed)
39843984{
3985    fprintf(stderr, "Printing product terms not supported for this device!\n");
3985   fprintf(stderr, "Printing product terms not supported for this device!\n");
39863986}
39873987#endif
39883988
r26736r26737
40914091
40924092static void print_pal6l16_product_terms(const pal_data* pal, const jed_data* jed)
40934093{
4094    print_product_terms(pal, jed);
4094   print_product_terms(pal, jed);
40954095}
40964096
40974097
r26736r26737
45854585      UINT16 pin;
45864586      UINT16 sl0_fuse; /* registers allowed (0 - registered, 1 - not registered) */
45874587      UINT16 sl1_fuse; /* output polarity (0 - low, 1 - high) */
4588        UINT16 fuserowoutputenable;
4588      UINT16 fuserowoutputenable;
45894589   };
45904590
45914591   static output_logic_macrocell macrocells[] = {
r26736r26737
45984598      {18, 2121, 2049, 256},
45994599      {19, 2120, 2048, 0}};
46004600   static pin_fuse_columns pinfusecolumns_i_or_o[] = {
4601       {1, 3, 2},
4602       {2, 1, 0},
4603       {3, 5, 4},
4604       {4, 9, 8},
4605       {5, 13, 12},
4606       {6, 17, 16},
4607       {7, 21, 20},
4608       {8, 25, 24},
4609       {9, 29, 28},
4610       {11, 31, 30},
4611       {12, 27, 26},
4612       {13, 23, 22},
4613        {14, 19, 18},
4614        {17, 15, 14},
4615        {18, 11, 10},
4616        {19, 7, 6}};
4601      {1, 3, 2},
4602      {2, 1, 0},
4603      {3, 5, 4},
4604      {4, 9, 8},
4605      {5, 13, 12},
4606      {6, 17, 16},
4607      {7, 21, 20},
4608      {8, 25, 24},
4609      {9, 29, 28},
4610      {11, 31, 30},
4611      {12, 27, 26},
4612      {13, 23, 22},
4613      {14, 19, 18},
4614      {17, 15, 14},
4615      {18, 11, 10},
4616      {19, 7, 6}};
46174617   static pin_fuse_columns pinfusecolumns_io[] = {
4618       {1, 3, 2},
4619       {2, 1, 0},
4620       {3, 5, 4},
4621       {4, 9, 8},
4622       {5, 13, 12},
4623       {6, 17, 16},
4624       {7, 21, 20},
4625       {8, 25, 24},
4626       {9, 29, 28},
4627       {11, 31, 30},
4628       {13, 27, 26},
4629       {14, 23, 22},
4630        {15, 19, 18},
4631        {16, 15, 14},
4632        {17, 11, 10},
4633        {18, 7, 6}};
4618      {1, 3, 2},
4619      {2, 1, 0},
4620      {3, 5, 4},
4621      {4, 9, 8},
4622      {5, 13, 12},
4623      {6, 17, 16},
4624      {7, 21, 20},
4625      {8, 25, 24},
4626      {9, 29, 28},
4627      {11, 31, 30},
4628      {13, 27, 26},
4629      {14, 23, 22},
4630      {15, 19, 18},
4631      {16, 15, 14},
4632      {17, 11, 10},
4633      {18, 7, 6}};
46344634   static pin_fuse_columns pinfusecolumns_regs[] = {
4635       {2, 1, 0},
4636       {3, 5, 4},
4637       {4, 9, 8},
4638       {5, 13, 12},
4639       {6, 17, 16},
4640       {7, 21, 20},
4641       {8, 25, 24},
4642       {9, 29, 28},
4643       {12, 31, 30},
4644       {13, 27, 26},
4645       {14, 23, 22},
4646        {15, 19, 18},
4647        {16, 15, 14},
4648        {17, 11, 10},
4649        {18, 7, 6},
4650        {19, 3, 2}};
4651    static UINT16 input_pins_i_or_o[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
4652    static UINT16 input_pins_io[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
4653    static UINT16 input_pins_regs[] = {2, 3, 4, 5, 6, 7, 8, 9};
4654    static UINT16 sg0 = 2192;
4655    static UINT16 sg1 = 2193;
4656    UINT16 input_pins[18];
4657    pin_output_config output_pins[ARRAY_LEN(macrocells)];
4658    UINT16 index, input_pin_count, output_pin_count;
4635      {2, 1, 0},
4636      {3, 5, 4},
4637      {4, 9, 8},
4638      {5, 13, 12},
4639      {6, 17, 16},
4640      {7, 21, 20},
4641      {8, 25, 24},
4642      {9, 29, 28},
4643      {12, 31, 30},
4644      {13, 27, 26},
4645      {14, 23, 22},
4646      {15, 19, 18},
4647      {16, 15, 14},
4648      {17, 11, 10},
4649      {18, 7, 6},
4650      {19, 3, 2}};
4651   static UINT16 input_pins_i_or_o[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
4652   static UINT16 input_pins_io[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
4653   static UINT16 input_pins_regs[] = {2, 3, 4, 5, 6, 7, 8, 9};
4654   static UINT16 sg0 = 2192;
4655   static UINT16 sg1 = 2193;
4656   UINT16 input_pins[18];
4657   pin_output_config output_pins[ARRAY_LEN(macrocells)];
4658   UINT16 index, input_pin_count, output_pin_count;
46594659
4660    input_pin_count = 0;
4660   input_pin_count = 0;
46614661   output_pin_count = 0;
46624662
4663    if (!jed_get_fuse(jed, sg0))
4664    {
4665        /* Device uses registers */
4663   if (!jed_get_fuse(jed, sg0))
4664   {
4665      /* Device uses registers */
46664666
4667        if (jed_get_fuse(jed, sg1))
4668        {
4669            memcpy(palce16v8pinfusecolumns, pinfusecolumns_regs, sizeof(pinfusecolumns_regs));
4667      if (jed_get_fuse(jed, sg1))
4668      {
4669         memcpy(palce16v8pinfusecolumns, pinfusecolumns_regs, sizeof(pinfusecolumns_regs));
46704670
4671           memcpy(input_pins, input_pins_regs, sizeof(input_pins_regs));
4671         memcpy(input_pins, input_pins_regs, sizeof(input_pins_regs));
46724672
4673            input_pin_count = ARRAY_LEN(input_pins_regs);
4673         input_pin_count = ARRAY_LEN(input_pins_regs);
46744674
4675            for (index = 0; index < ARRAY_LEN(macrocells); ++index)
4676            {
4677                if (!jed_get_fuse(jed, macrocells[index].sl0_fuse))
4678                {
4679                    /* Registered output */
4675         for (index = 0; index < ARRAY_LEN(macrocells); ++index)
4676         {
4677            if (!jed_get_fuse(jed, macrocells[index].sl0_fuse))
4678            {
4679               /* Registered output */
46804680
4681                    config_palce16v8_pin_as_8_product_terms(macrocells[index].pin);
4681               config_palce16v8_pin_as_8_product_terms(macrocells[index].pin);
46824682
4683                    output_pins[output_pin_count].pin = macrocells[index].pin;
4684                output_pins[output_pin_count].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
4683               output_pins[output_pin_count].pin = macrocells[index].pin;
4684               output_pins[output_pin_count].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
46854685
4686                   if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4687                    {
4688                   output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4689                    }
4690                    else
4691                    {
4692                   output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4693                    }
4686               if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4687               {
4688                  output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4689               }
4690               else
4691               {
4692                  output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4693               }
46944694
4695                   ++output_pin_count;
4695               ++output_pin_count;
46964696
4697                    input_pins[input_pin_count] = macrocells[index].pin;
4697               input_pins[input_pin_count] = macrocells[index].pin;
46984698
4699                    ++input_pin_count;
4700                }
4701                else
4702                {
4703                    /* Combinatorial I/O */
4699               ++input_pin_count;
4700            }
4701            else
4702            {
4703               /* Combinatorial I/O */
47044704
4705                    if (does_output_enable_fuse_row_allow_output(pal, jed, macrocells[index].fuserowoutputenable))
4706                    {
4707                        config_palce16v8_pin_as_7_product_terms_and_oe_term(macrocells[index].pin);
4705               if (does_output_enable_fuse_row_allow_output(pal, jed, macrocells[index].fuserowoutputenable))
4706               {
4707                  config_palce16v8_pin_as_7_product_terms_and_oe_term(macrocells[index].pin);
47084708
4709                        output_pins[output_pin_count].pin = macrocells[index].pin;
4710                    output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
4709                  output_pins[output_pin_count].pin = macrocells[index].pin;
4710                  output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
47114711
4712                       if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4713                        {
4714                       output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4715                        }
4716                        else
4717                        {
4718                       output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4719                        }
4712                  if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4713                  {
4714                     output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4715                  }
4716                  else
4717                  {
4718                     output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4719                  }
47204720
4721                       ++output_pin_count;
4722                    }
4721                  ++output_pin_count;
4722               }
47234723
4724                    input_pins[input_pin_count] = macrocells[index].pin;
4724               input_pins[input_pin_count] = macrocells[index].pin;
47254725
4726                    ++input_pin_count;
4727                }
4728            }
4729        }
4730        else
4731        {
4732            fprintf(stderr, "Unknown configuration type!\n");
4733        }
4734    }
4735    else
4736    {
4737        /* Device uses no registers */
4726               ++input_pin_count;
4727            }
4728         }
4729      }
4730      else
4731      {
4732         fprintf(stderr, "Unknown configuration type!\n");
4733      }
4734   }
4735   else
4736   {
4737      /* Device uses no registers */
47384738
4739        if (jed_get_fuse(jed, sg1))
4740        {
4741            /* Combinatorial I/O (7 product terms and 1 output enable product term) */
4739      if (jed_get_fuse(jed, sg1))
4740      {
4741         /* Combinatorial I/O (7 product terms and 1 output enable product term) */
47424742
4743            memcpy(palce16v8pinfusecolumns, pinfusecolumns_io, sizeof(pinfusecolumns_io));
4743         memcpy(palce16v8pinfusecolumns, pinfusecolumns_io, sizeof(pinfusecolumns_io));
47444744
4745           memcpy(input_pins, input_pins_io, sizeof(input_pins_io));
4745         memcpy(input_pins, input_pins_io, sizeof(input_pins_io));
47464746
4747            input_pin_count = ARRAY_LEN(input_pins_io);
4747         input_pin_count = ARRAY_LEN(input_pins_io);
47484748
4749            for (index = 0; index < ARRAY_LEN(macrocells); ++index)
4750            {
4751                if (does_output_enable_fuse_row_allow_output(pal, jed, macrocells[index].fuserowoutputenable))
4752                {
4753                    config_palce16v8_pin_as_7_product_terms_and_oe_term(macrocells[index].pin);
4749         for (index = 0; index < ARRAY_LEN(macrocells); ++index)
4750         {
4751            if (does_output_enable_fuse_row_allow_output(pal, jed, macrocells[index].fuserowoutputenable))
4752            {
4753               config_palce16v8_pin_as_7_product_terms_and_oe_term(macrocells[index].pin);
47544754
4755                    output_pins[output_pin_count].pin = macrocells[index].pin;
4756                output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
4755               output_pins[output_pin_count].pin = macrocells[index].pin;
4756               output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
47574757
4758                   if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4759                    {
4760                   output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4761                    }
4762                    else
4763                    {
4764                   output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4765                    }
4758               if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4759               {
4760                  output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4761               }
4762               else
4763               {
4764                  output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4765               }
47664766
4767                   ++output_pin_count;
4768                }
4767               ++output_pin_count;
4768            }
47694769
4770                /* Pins 12 and 19 cannot be used as an input only an output. */
4770            /* Pins 12 and 19 cannot be used as an input only an output. */
47714771
4772                if (macrocells[index].pin != 12 && macrocells[index].pin != 19)
4773                {
4774                    input_pins[input_pin_count] = macrocells[index].pin;
4772            if (macrocells[index].pin != 12 && macrocells[index].pin != 19)
4773            {
4774               input_pins[input_pin_count] = macrocells[index].pin;
47754775
4776                    ++input_pin_count;
4777                }
4778            }
4779        }
4780        else
4781        {
4782            /* Combinatorial Output or Input */
4776               ++input_pin_count;
4777            }
4778         }
4779      }
4780      else
4781      {
4782         /* Combinatorial Output or Input */
47834783
4784            memcpy(palce16v8pinfusecolumns, pinfusecolumns_i_or_o, sizeof(pinfusecolumns_i_or_o));
4784         memcpy(palce16v8pinfusecolumns, pinfusecolumns_i_or_o, sizeof(pinfusecolumns_i_or_o));
47854785
4786           memcpy(input_pins, input_pins_i_or_o, sizeof(input_pins_i_or_o));
4786         memcpy(input_pins, input_pins_i_or_o, sizeof(input_pins_i_or_o));
47874787
4788            input_pin_count = ARRAY_LEN(input_pins_i_or_o);
4788         input_pin_count = ARRAY_LEN(input_pins_i_or_o);
47894789
4790            for (index = 0; index < ARRAY_LEN(macrocells); ++index)
4791            {
4792                if (!jed_get_fuse(jed, macrocells[index].sl0_fuse))
4793                {
4794                    /* pin configured as an output only */
4790         for (index = 0; index < ARRAY_LEN(macrocells); ++index)
4791         {
4792            if (!jed_get_fuse(jed, macrocells[index].sl0_fuse))
4793            {
4794               /* pin configured as an output only */
47954795
4796                    config_palce16v8_pin_as_8_product_terms(macrocells[index].pin);
4796               config_palce16v8_pin_as_8_product_terms(macrocells[index].pin);
47974797
4798                    output_pins[output_pin_count].pin = macrocells[index].pin;
4799                output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
4798               output_pins[output_pin_count].pin = macrocells[index].pin;
4799               output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
48004800
4801                   if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4802                    {
4803                   output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4804                    }
4805                    else
4806                    {
4807                   output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4808                    }
4801               if (!jed_get_fuse(jed, macrocells[index].sl1_fuse))
4802               {
4803                  output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
4804               }
4805               else
4806               {
4807                  output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
4808               }
48094809
4810                   ++output_pin_count;
4811                }
4812                else
4813                {
4814                    /* pin configured as an input only */
4810               ++output_pin_count;
4811            }
4812            else
4813            {
4814               /* pin configured as an input only */
48154815
4816                    input_pins[input_pin_count] = macrocells[index].pin;
4816               input_pins[input_pin_count] = macrocells[index].pin;
48174817
4818                    ++input_pin_count;
4819                }
4820            }
4821        }
4822    }
4818               ++input_pin_count;
4819            }
4820         }
4821      }
4822   }
48234823
4824    set_input_pins(input_pins, input_pin_count);
4824   set_input_pins(input_pins, input_pin_count);
48254825   set_output_pins(output_pins, output_pin_count);
48264826
4827    /* 2056 - 2119 are the 64 bit signature fuses */
4827   /* 2056 - 2119 are the 64 bit signature fuses */
48284828
4829    /* 2128 - 2135 product term 8? */
4830    /* 2136 - 2143 product term 7? */
4831    /* 2144 - 2151 product term 6? */
4832    /* 2152 - 2159 product term 5? */
4833    /* 2160 - 2167 product term 4? */
4834    /* 2168 - 2175 product term 3? */
4835    /* 2176 - 2183 product term 2? */
4836    /* 2184 - 2191 product term 1? */
4829   /* 2128 - 2135 product term 8? */
4830   /* 2136 - 2143 product term 7? */
4831   /* 2144 - 2151 product term 6? */
4832   /* 2152 - 2159 product term 5? */
4833   /* 2160 - 2167 product term 4? */
4834   /* 2168 - 2175 product term 3? */
4835   /* 2176 - 2183 product term 2? */
4836   /* 2184 - 2191 product term 1? */
48374837}
48384838
48394839
r26736r26737
56985698      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
56995699   };
57005700
5701    static memory_cell memory_cells[] = {
5702        {12, 663},
5703        {13, 660},
5704        {14, 657},
5705        {15, 654},
5706        {16, 651},
5707        {17, 648},
5708        {18, 645},
5709        {19, 642}};
5701   static memory_cell memory_cells[] = {
5702      {12, 663},
5703      {13, 660},
5704      {14, 657},
5705      {15, 654},
5706      {16, 651},
5707      {17, 648},
5708      {18, 645},
5709      {19, 642}};
57105710   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
57115711   pin_output_config output_pins[8];
57125712   UINT16 index;
5713   
5714    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5715    {
5713
5714   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5715   {
57165716      output_pins[index].pin = memory_cells[index].pin;
57175717      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
57185718
r26736r26737
57245724      {
57255725         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
57265726      }
5727    }
5727   }
57285728
57295729   set_input_pins(input_pins, ARRAY_LEN(input_pins));
57305730   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
57455745      UINT16 pin;
57465746      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
57475747      UINT16 or_fuse; /* 0 - intact? */
5748        UINT16 xor_fuse; /* 0 - intact? */
5748      UINT16 xor_fuse; /* 0 - intact? */
57495749   };
57505750
5751    static memory_cell memory_cells[] = {
5752        {13, 785, 783, 784},
5753        {14, 782, 780, 781},
5754        {15, 779, 777, 778},
5755        {16, 776, 774, 775},
5756        {17, 773, 771, 772},
5757        {18, 770, 768, 769}};
5751   static memory_cell memory_cells[] = {
5752      {13, 785, 783, 784},
5753      {14, 782, 780, 781},
5754      {15, 779, 777, 778},
5755      {16, 776, 774, 775},
5756      {17, 773, 771, 772},
5757      {18, 770, 768, 769}};
57585758   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 19};
57595759   pin_output_config output_pins[8];
57605760   UINT16 index;
5761   
5762    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5763    {
5761
5762   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5763   {
57645764      output_pins[index].pin = memory_cells[index].pin;
57655765      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
57665766
r26736r26737
57725772      {
57735773         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
57745774      }
5775    }
5775   }
57765776
57775777   set_input_pins(input_pins, ARRAY_LEN(input_pins));
57785778   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
57935793      UINT16 pin;
57945794      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
57955795      UINT16 or_fuse; /* 0 - intact? */
5796        UINT16 xor_fuse; /* 0 - intact? */
5796      UINT16 xor_fuse; /* 0 - intact? */
57975797   };
57985798
5799    static memory_cell memory_cells[] = {
5800        {14, 907, 905, 906},
5801        {15, 904, 902, 903},
5802        {16, 901, 899, 900},
5803        {17, 898, 896, 897}};
5799   static memory_cell memory_cells[] = {
5800      {14, 907, 905, 906},
5801      {15, 904, 902, 903},
5802      {16, 901, 899, 900},
5803      {17, 898, 896, 897}};
58045804   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 18, 19};
58055805   pin_output_config output_pins[8];
58065806   UINT16 index;
5807   
5808    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5809    {
5807
5808   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5809   {
58105810      output_pins[index].pin = memory_cells[index].pin;
58115811      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
58125812
r26736r26737
58185818      {
58195819         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
58205820      }
5821    }
5821   }
58225822
58235823   set_input_pins(input_pins, ARRAY_LEN(input_pins));
58245824   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
58395839      UINT16 pin;
58405840      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
58415841      UINT16 or_fuse; /* 0 - intact? */
5842        UINT16 xor_fuse; /* 0 - intact? */
5842      UINT16 xor_fuse; /* 0 - intact? */
58435843   };
58445844
5845    static memory_cell memory_cells[] = {
5846        {15, 1029, 1027, 1028},
5847        {16, 1026, 1024, 1025}};
5845   static memory_cell memory_cells[] = {
5846      {15, 1029, 1027, 1028},
5847      {16, 1026, 1024, 1025}};
58485848   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 17, 18, 19};
58495849   pin_output_config output_pins[8];
58505850   UINT16 index;
5851   
5852    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5853    {
5851
5852   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5853   {
58545854      output_pins[index].pin = memory_cells[index].pin;
58555855      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
58565856
r26736r26737
58625862      {
58635863         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
58645864      }
5865    }
5865   }
58665866
58675867   set_input_pins(input_pins, ARRAY_LEN(input_pins));
58685868   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
58835883      UINT16 pin;
58845884      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
58855885      UINT16 or_fuse; /* 0 - intact? */
5886        UINT16 xor_fuse; /* 0 - intact? */
5886      UINT16 xor_fuse; /* 0 - intact? */
58875887   };
58885888
5889    static memory_cell memory_cells[] = {
5890        {12, 2071, 2069, 2070},
5891        {13, 2068, 2066, 2067},
5892        {14, 2065, 2063, 2064},
5893        {15, 2062, 2060, 2061},
5894        {16, 2059, 2057, 2058},
5895        {17, 2056, 2054, 2055},
5896        {18, 2053, 2051, 2052},
5897        {19, 2050, 2048, 2049}};
5889   static memory_cell memory_cells[] = {
5890      {12, 2071, 2069, 2070},
5891      {13, 2068, 2066, 2067},
5892      {14, 2065, 2063, 2064},
5893      {15, 2062, 2060, 2061},
5894      {16, 2059, 2057, 2058},
5895      {17, 2056, 2054, 2055},
5896      {18, 2053, 2051, 2052},
5897      {19, 2050, 2048, 2049}};
58985898   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
58995899   pin_output_config output_pins[8];
59005900   UINT16 index;
5901   
5902    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5903    {
5901
5902   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5903   {
59045904      output_pins[index].pin = memory_cells[index].pin;
59055905      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
59065906
r26736r26737
59125912      {
59135913         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
59145914      }
5915    }
5915   }
59165916
59175917   set_input_pins(input_pins, ARRAY_LEN(input_pins));
59185918   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
59335933      UINT16 pin;
59345934      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
59355935      UINT16 or_fuse; /* 0 - intact? */
5936        UINT16 xor_fuse; /* 0 - intact? */
5936      UINT16 xor_fuse; /* 0 - intact? */
59375937   };
59385938
5939    static memory_cell memory_cells[] = {
5940        {12, 2071, 2069, 2070},
5941        {13, 2068, 2066, 2067},
5942        {14, 2065, 2063, 2064},
5943        {15, 2062, 2060, 2061},
5944        {16, 2059, 2057, 2058},
5945        {17, 2056, 2054, 2055},
5946        {18, 2053, 2051, 2052},
5947        {19, 2050, 2048, 2049}};
5939   static memory_cell memory_cells[] = {
5940      {12, 2071, 2069, 2070},
5941      {13, 2068, 2066, 2067},
5942      {14, 2065, 2063, 2064},
5943      {15, 2062, 2060, 2061},
5944      {16, 2059, 2057, 2058},
5945      {17, 2056, 2054, 2055},
5946      {18, 2053, 2051, 2052},
5947      {19, 2050, 2048, 2049}};
59485948   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
59495949   pin_output_config output_pins[8];
59505950   UINT16 index;
5951   
5952    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5953    {
5951
5952   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
5953   {
59545954      output_pins[index].pin = memory_cells[index].pin;
5955       output_pins[index].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
5955      output_pins[index].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
59565956
59575957      if (!jed_get_fuse(jed, memory_cells[index].polarity_fuse))
59585958      {
r26736r26737
59625962      {
59635963         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
59645964      }
5965    }
5965   }
59665966
59675967   set_input_pins(input_pins, ARRAY_LEN(input_pins));
59685968   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
59835983      UINT16 pin;
59845984      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
59855985      UINT16 or_fuse; /* 0 - intact? */
5986        UINT16 xor_fuse; /* 0 - intact? */
5986      UINT16 xor_fuse; /* 0 - intact? */
59875987   };
59885988
5989    static memory_cell memory_cells[] = {
5990        {12, 2071, 2069, 2070},
5991        {13, 2068, 2066, 2067},
5992        {14, 2065, 2063, 2064},
5993        {15, 2062, 2060, 2061},
5994        {16, 2059, 2057, 2058},
5995        {17, 2056, 2054, 2055},
5996        {18, 2053, 2051, 2052},
5997        {19, 2050, 2048, 2049}};
5989   static memory_cell memory_cells[] = {
5990      {12, 2071, 2069, 2070},
5991      {13, 2068, 2066, 2067},
5992      {14, 2065, 2063, 2064},
5993      {15, 2062, 2060, 2061},
5994      {16, 2059, 2057, 2058},
5995      {17, 2056, 2054, 2055},
5996      {18, 2053, 2051, 2052},
5997      {19, 2050, 2048, 2049}};
59985998   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
59995999   pin_output_config output_pins[8];
60006000   UINT16 index;
6001   
6002    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
6003    {
6001
6002   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
6003   {
60046004      output_pins[index].pin = memory_cells[index].pin;
60056005
6006        if (memory_cells[index].pin == 13 || memory_cells[index].pin == 14 ||
6007            memory_cells[index].pin == 15 || memory_cells[index].pin == 16 ||
6008            memory_cells[index].pin == 17 || memory_cells[index].pin == 18)
6009        {
6010          output_pins[index].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
6011        }
6012        else
6013        {
6014          output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
6015        }
6006      if (memory_cells[index].pin == 13 || memory_cells[index].pin == 14 ||
6007         memory_cells[index].pin == 15 || memory_cells[index].pin == 16 ||
6008         memory_cells[index].pin == 17 || memory_cells[index].pin == 18)
6009      {
6010         output_pins[index].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
6011      }
6012      else
6013      {
6014         output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
6015      }
60166016
60176017      if (!jed_get_fuse(jed, memory_cells[index].polarity_fuse))
60186018      {
r26736r26737
60226022      {
60236023         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
60246024      }
6025    }
6025   }
60266026
60276027   set_input_pins(input_pins, ARRAY_LEN(input_pins));
60286028   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
60436043      UINT16 pin;
60446044      UINT16 polarity_fuse; /* 0 - active low?, 1 - active high? */
60456045      UINT16 or_fuse; /* 0 - intact? */
6046        UINT16 xor_fuse; /* 0 - intact? */
6046      UINT16 xor_fuse; /* 0 - intact? */
60476047   };
60486048
6049    static memory_cell memory_cells[] = {
6050        {12, 2071, 2069, 2070},
6051        {13, 2068, 2066, 2067},
6052        {14, 2065, 2063, 2064},
6053        {15, 2062, 2060, 2061},
6054        {16, 2059, 2057, 2058},
6055        {17, 2056, 2054, 2055},
6056        {18, 2053, 2051, 2052},
6057        {19, 2050, 2048, 2049}};
6049   static memory_cell memory_cells[] = {
6050      {12, 2071, 2069, 2070},
6051      {13, 2068, 2066, 2067},
6052      {14, 2065, 2063, 2064},
6053      {15, 2062, 2060, 2061},
6054      {16, 2059, 2057, 2058},
6055      {17, 2056, 2054, 2055},
6056      {18, 2053, 2051, 2052},
6057      {19, 2050, 2048, 2049}};
60586058   static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
60596059   pin_output_config output_pins[8];
60606060   UINT16 index;
6061   
6062    for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
6063    {
6061
6062   for (index = 0; index < ARRAY_LEN(memory_cells); ++index)
6063   {
60646064      output_pins[index].pin = memory_cells[index].pin;
60656065
6066        if (memory_cells[index].pin == 14 || memory_cells[index].pin == 15 ||
6067            memory_cells[index].pin == 16 || memory_cells[index].pin == 17)
6068        {
6069          output_pins[index].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
6070        }
6071        else
6072        {
6073          output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
6074        }
6066      if (memory_cells[index].pin == 14 || memory_cells[index].pin == 15 ||
6067         memory_cells[index].pin == 16 || memory_cells[index].pin == 17)
6068      {
6069         output_pins[index].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
6070      }
6071      else
6072      {
6073         output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
6074      }
60756075
60766076      if (!jed_get_fuse(jed, memory_cells[index].polarity_fuse))
60776077      {
r26736r26737
60816081      {
60826082         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
60836083      }
6084    }
6084   }
60856085
60866086   set_input_pins(input_pins, ARRAY_LEN(input_pins));
60876087   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
61016101   pin_output_config output_pins[8];
61026102   UINT16 index;
61036103
6104    for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6105    {
6104   for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6105   {
61066106      output_pins[index].pin = index + 12;
6107        output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
6107      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
61086108
61096109      if (!jed_get_fuse(jed, 327 - index))
61106110      {
r26736r26737
61146114      {
61156115         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
61166116      }
6117    }
6117   }
61186118
61196119   set_input_pins(input_pins, ARRAY_LEN(input_pins));
61206120   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
61336133   pin_output_config output_pins[6];
61346134   UINT16 index;
61356135
6136    for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6137    {
6136   for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6137   {
61386138      output_pins[index].pin = index + 13;
6139        output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
6139      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
61406140
61416141      if (!jed_get_fuse(jed, 389 - index))
61426142      {
r26736r26737
61466146      {
61476147         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
61486148      }
6149    }
6149   }
61506150
61516151   set_input_pins(input_pins, ARRAY_LEN(input_pins));
61526152   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
61656165   pin_output_config output_pins[4];
61666166   UINT16 index;
61676167
6168    for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6169    {
6168   for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6169   {
61706170      output_pins[index].pin = index + 14;
6171        output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
6171      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
61726172
61736173      if (!jed_get_fuse(jed, 451 - index))
61746174      {
r26736r26737
61786178      {
61796179         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
61806180      }
6181    }
6181   }
61826182
61836183   set_input_pins(input_pins, ARRAY_LEN(input_pins));
61846184   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
61976197   pin_output_config output_pins[2];
61986198   UINT16 index;
61996199
6200    for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6201    {
6200   for (index = 0; index < ARRAY_LEN(output_pins); ++index)
6201   {
62026202      output_pins[index].pin = index + 15;
6203        output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
6203      output_pins[index].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_NONE;
62046204
62056205      if (!jed_get_fuse(jed, 513 - index))
62066206      {
r26736r26737
62106210      {
62116211         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
62126212      }
6213    }
6213   }
62146214
62156215   set_input_pins(input_pins, ARRAY_LEN(input_pins));
62166216   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
63106310      output_pins[output_pin_count].pin = registered_pins[index];
63116311      output_pins[output_pin_count].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
63126312
6313        if (!jed_get_fuse(jed, 2053 - index))
6313      if (!jed_get_fuse(jed, 2053 - index))
63146314      {
63156315         output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
63166316      }
r26736r26737
63986398      output_pins[output_pin_count].pin = registered_pins[index];
63996399      output_pins[output_pin_count].flags = OUTPUT_REGISTERED | OUTPUT_FEEDBACK_REGISTERED;
64006400
6401        if (!jed_get_fuse(jed, 2054 - index))
6401      if (!jed_get_fuse(jed, 2054 - index))
64026402      {
64036403         output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
64046404      }
r26736r26737
64156415      output_pins[output_pin_count].pin = 19;
64166416      output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL | OUTPUT_FEEDBACK_OUTPUT;
64176417
6418        if (!jed_get_fuse(jed, 2048))
6418      if (!jed_get_fuse(jed, 2048))
64196419      {
64206420         output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
64216421      }
r26736r26737
64546454
64556455   for (index = 0; index < ARRAY_LEN(output_pins); ++index)
64566456   {
6457        if (!jed_get_fuse(jed, 2055 - index))
6457      if (!jed_get_fuse(jed, 2055 - index))
64586458      {
64596459         output_pins[index].flags |= OUTPUT_ACTIVELOW;
64606460      }
r26736r26737
64626462      {
64636463         output_pins[index].flags |= OUTPUT_ACTIVEHIGH;
64646464      }
6465    }
6465   }
64666466
64676467   set_input_pins(input_pins, ARRAY_LEN(input_pins));
64686468   set_output_pins(output_pins, ARRAY_LEN(output_pins));
r26736r26737
71147114
71157115static int command_view(int argc, char *argv[])
71167116{
7117    int result = 0;
7117   int result = 0;
71187118   const char *srcfile, *palname;
71197119   int is_jed;
71207120   const pal_data* pal;
r26736r26737
71457145   err = read_source_file(srcfile);
71467146   if (err != 0)
71477147   {
7148        result = 1;
7149        goto end;
7148      result = 1;
7149      goto end;
71507150   }
71517151
71527152   /* if the source is JED, convert to binary */
r26736r26737
71717171      }
71727172   }
71737173
7174    if (jed.numfuses != pal->numfuses)
7175    {
7174   if (jed.numfuses != pal->numfuses)
7175   {
71767176      fprintf(stderr, "Fuse count does not match this pal type.");
7177        result = 1;
7178        goto end;
7179    }
7177      result = 1;
7178      goto end;
7179   }
71807180
71817181   /* generate equations from fuse map */
71827182
trunk/src/tools/nltool.c
r26736r26737
2525#if 0
2626void mame_printf_warning(const char *format, ...)
2727{
28    va_list argptr;
28   va_list argptr;
2929
30    /* do the output */
31    va_start(argptr, format);
32    vprintf(format, argptr);
33    va_end(argptr);
30   /* do the output */
31   va_start(argptr, format);
32   vprintf(format, argptr);
33   va_end(argptr);
3434}
3535#endif
3636
3737void *malloc_file_line(size_t size, const char *file, int line)
3838{
39    // allocate the memory and fail if we can't
40    void *ret = osd_malloc(size);
41    memset(ret, 0, size);
42    return ret;
39   // allocate the memory and fail if we can't
40   void *ret = osd_malloc(size);
41   memset(ret, 0, size);
42   return ret;
4343}
4444
4545void *malloc_array_file_line(size_t size, const char *file, int line)
4646{
47    // allocate the memory and fail if we can't
48    void *ret = osd_malloc_array(size);
49    memset(ret, 0, size);
50    return ret;
47   // allocate the memory and fail if we can't
48   void *ret = osd_malloc_array(size);
49   memset(ret, 0, size);
50   return ret;
5151}
5252
5353void free_file_line( void *memory, const char *file, int line )
5454{
55    osd_free( memory );
55   osd_free( memory );
5656}
5757
5858
5959struct options_entry oplist[] =
6060{
61    { "time_to_run;ttr", "1.0", OPTION_FLOAT,   "time to run the emulation (seconds)" },
62    { "f",               "-",   OPTION_STRING,  "file to process (default is stdin)" },
63    { "help;h",          "0",   OPTION_BOOLEAN, "display help" },
64    { NULL }
61   { "time_to_run;ttr", "1.0", OPTION_FLOAT,   "time to run the emulation (seconds)" },
62   { "f",               "-",   OPTION_STRING,  "file to process (default is stdin)" },
63   { "help;h",          "0",   OPTION_BOOLEAN, "display help" },
64   { NULL }
6565};
6666
6767/***************************************************************************
r26736r26737
7070
7171const char *filetobuf(pstring fname)
7272{
73    static pstring pbuf = "";
73   static pstring pbuf = "";
7474
75    if (fname == "-")
76    {
77        char lbuf[1024];
78        while (!feof(stdin))
79        {
80            fgets(lbuf, 1024, stdin);
81            pbuf += lbuf;
82        }
83        printf("%d\n",*(pbuf.right(1).cstr()+1));
84        return pbuf.cstr();
85    }
86    else
87    {
88        FILE *f;
89        f = fopen(fname, "rb");
90        fseek(f, 0, SEEK_END);
91        long fsize = ftell(f);
92        fseek(f, 0, SEEK_SET);
75   if (fname == "-")
76   {
77      char lbuf[1024];
78      while (!feof(stdin))
79      {
80         fgets(lbuf, 1024, stdin);
81         pbuf += lbuf;
82      }
83      printf("%d\n",*(pbuf.right(1).cstr()+1));
84      return pbuf.cstr();
85   }
86   else
87   {
88      FILE *f;
89      f = fopen(fname, "rb");
90      fseek(f, 0, SEEK_END);
91      long fsize = ftell(f);
92      fseek(f, 0, SEEK_SET);
9393
94        char *buf = (char *) malloc(fsize);
95        fread(buf, fsize, 1, f);
96        buf[fsize] = 0;
97        fclose(f);
98        return buf;
99    }
94      char *buf = (char *) malloc(fsize);
95      fread(buf, fsize, 1, f);
96      buf[fsize] = 0;
97      fclose(f);
98      return buf;
99   }
100100}
101101
102102class netlist_tool_t : public netlist_base_t
103103{
104104public:
105105
106    netlist_tool_t()
107    : netlist_base_t(), m_setup(NULL)
108    {
106   netlist_tool_t()
107   : netlist_base_t(), m_setup(NULL)
108   {
109   }
109110
110    }
111   virtual ~netlist_tool_t() { };
111112
112    virtual ~netlist_tool_t() { };
113   void read_netlist(const char *buffer)
114   {
115      m_setup = new netlist_setup_t(*this);
116      this->set_clock_freq(NETLIST_CLOCK);
113117
114    void read_netlist(const char *buffer)
115    {
116        m_setup = new netlist_setup_t(*this);
117        this->set_clock_freq(NETLIST_CLOCK);
118      // register additional devices
119      //m_setup->factory().register_device<nld_analog_callback>( "NETDEV_CALLBACK", "nld_analog_callback");
118120
119        // register additional devices
120        //m_setup->factory().register_device<nld_analog_callback>( "NETDEV_CALLBACK", "nld_analog_callback");
121      // read the netlist ...
122      //m_setup_func(*m_setup);
121123
122        // read the netlist ...
123        //m_setup_func(*m_setup);
124      m_setup->parse(buffer);
124125
125        m_setup->parse(buffer);
126      // start devices
127      m_setup->start_devices();
128      m_setup->resolve_inputs();
129      // reset
130      this->reset();
131   }
126132
127        // start devices
128        m_setup->start_devices();
129        m_setup->resolve_inputs();
130        // reset
131        this->reset();
132    }
133
134133protected:
135134
136    void vfatalerror(const char *format, va_list ap) const
137    {
138        vprintf(format, ap);
139        throw;
140    }
135   void vfatalerror(const char *format, va_list ap) const
136   {
137      vprintf(format, ap);
138      throw;
139   }
141140
142141private:
143    netlist_setup_t *m_setup;
142   netlist_setup_t *m_setup;
144143};
145144
146145void usage(core_options &opts)
147146{
148    astring buffer;
149    fprintf(stderr,
150        "Usage:\n"
151        "  nltool -help\n"
152        "  nltool [options]\n"
153        "\n"
154        "Where:\n"
155    );
156    fprintf(stderr, "%s\n", opts.output_help(buffer));
147   astring buffer;
148   fprintf(stderr,
149      "Usage:\n"
150      "  nltool -help\n"
151      "  nltool [options]\n"
152      "\n"
153      "Where:\n"
154   );
155   fprintf(stderr, "%s\n", opts.output_help(buffer));
157156}
158157
159158/*-------------------------------------------------
r26736r26737
166165   netlist_tool_t nt;
167166   core_options opts(oplist);
168167   astring aerror("");
169    osd_ticks_t t = osd_ticks();
168   osd_ticks_t t = osd_ticks();
170169
171    fprintf(stderr, "%s", "WARNING: This is Work In Progress! - It may fail anytime\n");
170   fprintf(stderr, "%s", "WARNING: This is Work In Progress! - It may fail anytime\n");
172171   if (!opts.parse_command_line(argc, argv, OPTION_PRIORITY_DEFAULT, aerror))
173172   {
174        fprintf(stderr, "%s\n", aerror.cstr());
175        usage(opts);
176        return 1;
173      fprintf(stderr, "%s\n", aerror.cstr());
174      usage(opts);
175      return 1;
177176   }
178177   if (opts.bool_value("h"))
179178   {
180        usage(opts);
181        return 1;
179      usage(opts);
180      return 1;
182181   }
183182
184    nt.read_netlist(filetobuf(opts.value("f")));
185    double ttr = opts.float_value("ttr");
183   nt.read_netlist(filetobuf(opts.value("f")));
184   double ttr = opts.float_value("ttr");
186185
187    INT64 tt = ttr * NETLIST_CLOCK;
186   INT64 tt = ttr * NETLIST_CLOCK;
188187
189    printf("startup time ==> %5.3f\n", (double) (osd_ticks() - t) / (double) osd_ticks_per_second() );
190    printf("runnning ...\n");
191    t = osd_ticks();
192    while (tt>0)
193    {
194        INT32 tr = MIN(tt, NETLIST_CLOCK / 10);
195        tt -= tr;
196        nt.process_queue(tr);
197    }
198    double emutime = (double) (osd_ticks() - t) / (double) osd_ticks_per_second();
199    printf("%f seconds emulation took %f real time ==> %5.2f%%\n", ttr, emutime, ttr/emutime*100.0);
200   
201    return 0;
188   printf("startup time ==> %5.3f\n", (double) (osd_ticks() - t) / (double) osd_ticks_per_second() );
189   printf("runnning ...\n");
190   t = osd_ticks();
191   while (tt>0)
192   {
193      INT32 tr = MIN(tt, NETLIST_CLOCK / 10);
194      tt -= tr;
195      nt.process_queue(tr);
196   }
197   double emutime = (double) (osd_ticks() - t) / (double) osd_ticks_per_second();
198   printf("%f seconds emulation took %f real time ==> %5.2f%%\n", ttr, emutime, ttr/emutime*100.0);
199
200   return 0;
202201}
trunk/src/osd/windows/window.c
r26736r26737
13471347      case WM_SYSCOMMAND:
13481348      {
13491349         UINT16 cmd = wparam & 0xfff0;
1350         
1350
13511351         // prevent screensaver or monitor power events
13521352         if (cmd == SC_MONITORPOWER || cmd == SC_SCREENSAVE)
13531353            return 1;
trunk/src/osd/windows/vconv.c
r26736r26737
318318   else if (!strcmp(argv[1], "ar"))
319319   {
320320      transtable = ar_translate;
321     
321
322322      if (!icl_compile)
323323      {
324324         executable = "link.exe";
trunk/src/osd/windows/drawd3d.c
r26736r26737
777777   }
778778
779779   m_line_count = 0;
780   
780
781781   // loop over primitives
782782   for (render_primitive *prim = m_window->primlist->first(); prim != NULL; prim = prim->next())
783783      if (prim->type == render_primitive::LINE && PRIMFLAG_GET_VECTOR(prim->flags))
r26736r26737
14851485   {
14861486      start_index %= m_line_count;
14871487   }
1488   
1488
14891489   m_line_count = 0;
14901490}
14911491
trunk/src/emu/diimage.c
r26736r26737
442442bool device_image_interface::load_software_region(const char *tag, optional_shared_ptr<UINT8> &ptr)
443443{
444444   size_t size = get_software_region_length(tag);
445   
445
446446   if (size)
447447   {
448448      ptr.allocate(size);
trunk/src/emu/sound/wave.h
r26736r26737
1313{
1414public:
1515   wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
16   
16
1717   static void static_set_cassette_tag(device_t &device, const char *cassette_tag);
18   
18
1919protected:
2020   // device-level overrides
2121   virtual void device_config_complete();
trunk/src/emu/sound/discrete.c
r26736r26737
698698   {
699699      const discrete_block *block = block_list[i];
700700
701        //discrete_base_node *node = block->factory->Create(this, block);
701      //discrete_base_node *node = block->factory->Create(this, block);
702702      discrete_base_node *node = block->factory(this, block);
703703      /* keep track of special nodes */
704704      if (block->node == NODE_SPECIAL)
trunk/src/emu/sound/discrete.h
r26736r26737
45314531template <class C>
45324532discrete_base_node *discrete_create_node(discrete_device * pdev, const discrete_block *block)
45334533{
4534    return discrete_node_factory< C >().Create(pdev, block);
4534   return discrete_node_factory< C >().Create(pdev, block);
45354535}
45364536
45374537#define DISCRETE_SOUND_EXTERN(name) extern const discrete_block name##_discrete_interface[]
trunk/src/emu/sound/mpeg_audio.c
r26736r26737
128128   int stereo_mode_ext = gb(2);
129129   param_index = gb(3);
130130   gb(1); // must be zero
131   
131
132132   channel_count = stereo_mode != 3 ? 2 : 1;
133133
134134   total_bands = total_band_counts[param_index];
r26736r26737
137137      joint_bands = joint_band_counts[stereo_mode_ext];
138138   if(joint_bands > total_bands )
139139      joint_bands = total_bands;
140   
140
141141   return true;
142142}
143143
trunk/src/emu/sound/k056800.c
r26736r26737
5959{
6060   UINT32 r = offset & 7;
6161   UINT8 data = 0;
62   
62
6363   switch (r)
6464   {
6565      case 0:
r26736r26737
102102         // .... ...x - Mute front
103103         // .... ..x. - Mute rear
104104         break;
105         
105
106106      case 7:
107107         // Sound interrupt
108108         m_int_pending = true;
r26736r26737
119119{
120120   UINT32 r = offset & 7;
121121   UINT8 data = 0;
122   
122
123123   switch (r)
124124   {
125125      case 0:
r26736r26737
144144      case 1:
145145         m_snd_to_host_regs[r] = data;
146146         break;
147         
147
148148      case 2:
149149      case 3:
150150         // TODO: Unknown
r26736r26737
167167            m_int_handler(CLEAR_LINE);
168168         }
169169         break;
170         
170
171171      case 5:
172172         // TODO: Unknown
173173         break;
174174   }
175}
No newline at end of file
175}
trunk/src/emu/sound/k056800.h
r26736r26737
1313***************************************************************************/
1414
1515#define MCFG_K056800_ADD(_tag, _clock) \
16   MCFG_DEVICE_ADD(_tag, K056800, _clock) \
17
16   MCFG_DEVICE_ADD(_tag, K056800, _clock)
1817#define MCFG_K056800_INT_HANDLER(_devcb) \
1918   devcb = &k056800_device::set_int_handler(*device, DEVCB2_##_devcb);
2019
r26736r26737
4544
4645private:
4746   // internal state
48   bool            m_int_pending;
49   bool            m_int_enabled;
50   UINT8            m_host_to_snd_regs[4];
51   UINT8            m_snd_to_host_regs[2];
47   bool                m_int_pending;
48   bool                m_int_enabled;
49   UINT8               m_host_to_snd_regs[4];
50   UINT8               m_snd_to_host_regs[2];
5251
53   devcb2_write_line   m_int_handler;
52   devcb2_write_line   m_int_handler;
5453};
5554
5655extern const device_type K056800;
trunk/src/emu/sound/speaker.h
r26736r26737
8383   void speaker_postload();
8484
8585   // DC blocker state
86   double   m_prevx, m_prevy;
86   double  m_prevx, m_prevy;
8787};
8888
8989extern const device_type SPEAKER_SOUND;
trunk/src/emu/sound/es5506.c
r26736r26737
381381   /* initialize the regions */
382382   m_region_base[0] = m_es5505_region0 ? (UINT16 *)machine().root_device().memregion(m_es5505_region0)->base() : NULL;
383383   m_region_base[1] = m_es5505_region1 ? (UINT16 *)machine().root_device().memregion(m_es5505_region1)->base() : NULL;
384   
384
385385   /* initialize the rest of the structure */
386386   m_master_clock = clock();
387387   m_irq_callback_func.resolve(m_es5505_irq_callback, *this);
r26736r26737
22082208
22092209void es5505_device::voice_bank_w(int voice, int bank)
22102210{
2211   
22122211#if RAINE_CHECK
22132212   m_voice[voice].control = CONTROL_STOPMASK;
22142213#endif
r26736r26737
22262225
22272226void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
22282227{
2229     
22302228#if MAKE_WAVS
22312229   /* start the logging once we have a sample rate */
22322230   if (m_sample_rate)
r26736r26737
22732271
22742272void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
22752273{
2276     
22772274#if MAKE_WAVS
22782275   /* start the logging once we have a sample rate */
22792276   if (m_sample_rate)
r26736r26737
23162313      offset += length;
23172314      samples -= length;
23182315   }
2319}
No newline at end of file
2316}
trunk/src/emu/sound/es5506.h
r26736r26737
6464      index(0),
6565      filtcount(0),
6666      accum_mask(0) {}
67   
67
6868   /* external state */
6969   UINT32      control;                /* control register */
7070   UINT32      freqcount;              /* frequency count register */
r26736r26737
139139   #if MAKE_WAVS
140140   void *      m_wavraw;                 /* raw waveform */
141141   #endif
142   
142
143143   FILE *m_eslog;
144   
144
145145   void update_irq_state();
146146   void update_internal_irq_state();
147147   void compute_tables();
r26736r26737
158158public:
159159   es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
160160   ~es5506_device() {}
161   
161
162162   DECLARE_READ8_MEMBER( read );
163163   DECLARE_WRITE8_MEMBER( write );
164164   void voice_bank_w(int voice, int bank);
r26736r26737
170170
171171   // sound stream update overrides
172172   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
173   
174   
173
174
175175   void generate_samples(INT32 **outputs, int offset, int samples);
176176
177177private:
r26736r26737
191191{
192192public:
193193   es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
194   
194
195195   DECLARE_READ16_MEMBER( read );
196196   DECLARE_WRITE16_MEMBER( write );
197197   void voice_bank_w(int voice, int bank);
r26736r26737
200200   // device-level overrides
201201   virtual void device_config_complete();
202202   virtual void device_start();
203   
203
204204   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
205   
205
206206   void generate_samples(INT32 **outputs, int offset, int samples);
207   
207
208208private:
209209   // internal state
210210   inline void reg_write_low(es550x_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask);
trunk/src/emu/sound/sn76477.c
r26736r26737
301301   }
302302
303303   intialize_noise();
304   
304
305305   /* set up interface values */
306306   _SN76477_enable_w(m_intf_enable);
307307   _SN76477_vco_w(m_intf_vco);
trunk/src/emu/sound/sn76477.h
r26736r26737
8282public:
8383   sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
8484   ~sn76477_device() {}
85   
85
8686   /* these functions take 0 or 1 as a logic input */
8787   WRITE_LINE_MEMBER( enable_w );      /* active LO, 0 = enabled, 1 = disabled */
8888   WRITE_LINE_MEMBER( mixer_a_w );
r26736r26737
106106
107107   /* these functions take a capacitor value in Farads or the voltage on it in Volts */
108108   #define SN76477_EXTERNAL_VOLTAGE_DISCONNECT   (-1.0)    /* indicates that the voltage is internally computed,
109                                                can be used in all the functions that take a
110                                                voltage on a capacitor */
109                                                               can be used in all the functions that take a
110                                                               voltage on a capacitor */
111111   void one_shot_cap_w(double data);
112112   void one_shot_cap_voltage_w(double data);
113113   void slf_cap_w(double data);
r26736r26737
131131
132132   // sound stream update overrides
133133   virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
134   
134
135135private:
136136   /* chip's external interface */
137137   UINT32 m_enable;
r26736r26737
167167   double m_amplitude_res;
168168   double m_feedback_res;
169169   double m_pitch_voltage;
170   
170
171171   // internal state
172172   double m_one_shot_cap_voltage;        /* voltage on the one-shot cap */
173173   UINT32 m_one_shot_running_ff;         /* 1 = one-shot running, 0 = stopped */
r26736r26737
191191   /* others */
192192   sound_stream *m_channel;              /* returned by stream_create() */
193193   int m_our_sample_rate;                    /* from machine.sample_rate() */
194   
194
195195   wav_file *m_file;                     /* handle of the wave file to produce */
196   
196
197197   double compute_one_shot_cap_charging_rate();
198198   double compute_one_shot_cap_discharging_rate();
199199   double compute_slf_cap_charging_rate();
r26736r26737
206206   double compute_attack_decay_cap_charging_rate();
207207   double compute_attack_decay_cap_discharging_rate();
208208   double compute_center_to_peak_voltage_out();
209   
209
210210   void log_enable_line();
211211   void log_mixer_mode();
212212   void log_envelope_mode();
r26736r26737
223223   void log_decay_time();
224224   void log_voltage_out();
225225   void log_complete_state();
226   
226
227227   void open_wav_file();
228228   void close_wav_file();
229229   void add_wav_data(INT16 data_l, INT16 data_r);
230   
230
231231   void intialize_noise();
232232   inline UINT32 generate_next_real_noise_bit();
233   
233
234234   void state_save_register();
235   
235
236236   void _SN76477_enable_w(UINT32 data);
237237   void _SN76477_vco_w(UINT32 data);
238238   void _SN76477_mixer_a_w(UINT32 data);
trunk/src/emu/sound/nes_apu.h
r26736r26737
3434 * Also make sure to correspond the memory regions to those used in the
3535 * processor, as each is shared.
3636 */
37
37
3838#include "nes_defs.h"
39
39
4040/* GLOBAL CONSTANTS */
4141#define  SYNCS_MAX1     0x20
4242#define  SYNCS_MAX2     0x80
r26736r26737
5656
5757   DECLARE_READ8_MEMBER( read );
5858   DECLARE_WRITE8_MEMBER( write );
59   
59
6060protected:
6161   // device-level overrides
6262   virtual void device_config_complete();
r26736r26737
7777   uint32  m_sync_times1[SYNCS_MAX1]; /* Samples per sync table */
7878   uint32  m_sync_times2[SYNCS_MAX2]; /* Samples per sync table */
7979   sound_stream *m_stream;
80   
80
8181   void create_syncs(unsigned long sps);
8282   int8 apu_square(square_t *chan);
8383   int8 apu_triangle(triangle_t *chan);
trunk/src/emu/sound/k054539.c
r26736r26737
6363   22d: Data read/write port
6464   22e: ROM/RAM select (00..7f == ROM banks, 80 = Reverb RAM)
6565   22f: Global control:
66      .......x - Enable PCM
67      ......x. - Timer related?
68      ...x.... - Enable ROM/RAM readback from 0x22d
69      ..x..... - Timer output enable?
70      x....... - Disable register RAM updates
66        .......x - Enable PCM
67        ......x. - Timer related?
68        ...x.... - Enable ROM/RAM readback from 0x22d
69        ..x..... - Timer output enable?
70        x....... - Disable register RAM updates
7171
72   The chip has an optional 0x8000 byte reverb buffer.
73   The reverb delay is actually an offset in this buffer.
72    The chip has an optional 0x8000 byte reverb buffer.
73    The reverb delay is actually an offset in this buffer.
7474*/
7575
7676void k054539_device::init_flags(int _flags)
r26736r26737
440440         cur_limit = data == 0x80 ? 0x4000 : 0x20000;
441441         cur_ptr = 0;
442442      break;
443     
443
444444      case 0x22f:
445445         if (!(data & 0x20)) // Disable timer output?
446446         {
r26736r26737
537537void k054539_device::device_reset()
538538{
539539   m_timer->enable(false);
540}
No newline at end of file
540}
trunk/src/emu/sound/k054539.h
r26736r26737
4949   k054539_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
5050
5151   // static configuration helpers
52   static void static_set_interface(device_t &device, const k054539_interface &interface);   
52   static void static_set_interface(device_t &device, const k054539_interface &interface);
5353   template<class _Object> static devcb2_base &set_timer_handler(device_t &device, _Object object) { return downcast<k054539_device &>(device).m_timer_handler.set_callback(object); }
54   
5554
55
5656   DECLARE_WRITE8_MEMBER(write);
5757   DECLARE_READ8_MEMBER(read);
5858
r26736r26737
109109
110110   channel channels[8];
111111   sound_stream *stream;
112   
113   emu_timer         *m_timer;
114   UINT32            m_timer_state;
115   devcb2_write_line   m_timer_handler;
116112
113   emu_timer           *m_timer;
114   UINT32              m_timer_state;
115   devcb2_write_line   m_timer_handler;
116
117117   bool regupdate();
118118   void keyon(int channel);
119119   void keyoff(int channel);
trunk/src/emu/sound/ymz770.c
r26736r26737
163163            }
164164         }
165165      }
166     
166
167167      // process channels
168168      INT32 mix = 0;
169169
r26736r26737
174174            // force finish current block
175175            mix += (m_channels[ch].output_data[m_channels[ch].output_ptr++]*m_channels[ch].volume);
176176            m_channels[ch].output_remaining--;
177           
177
178178            if (m_channels[ch].output_remaining == 0 && !m_channels[ch].is_playing)
179179               m_channels[ch].decoder->clear();
180180         }
181         
181
182182         else if (m_channels[ch].is_playing)
183183         {
184184retry:
r26736r26737
254254            m_mute = data & 1;
255255            m_doen = data >> 1 & 1;
256256            break;
257         
257
258258         case 0x01:
259259            m_vlma = data;
260260            break;
261         
261
262262         case 0x02:
263263            m_bsl = data & 7;
264264            m_cpl = data >> 4 & 7;
r26736r26737
308308            break;
309309      }
310310   }
311   
311
312312   // sequencer registers
313313   else
314314   {
trunk/src/emu/bus/plus4/std.h
r26736r26737
4040   // device_plus4_expansion_card_interface overrides
4141   virtual UINT8 plus4_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int cs0, int c1l, int c2l, int cs1, int c1h, int c2h);
4242
43   
43
4444};
4545
4646
trunk/src/emu/bus/adamnet/fdc.c
r26736r26737
1010**********************************************************************/
1111
1212/*
13   
14   TODO:
1513
16   - 320KB DSDD 5.25"
17   - 720KB DSDD 3.5"
18   - 1.44MB DSHD 3.5"
14    TODO:
1915
16    - 320KB DSDD 5.25"
17    - 720KB DSDD 3.5"
18    - 1.44MB DSHD 3.5"
19
2020*/
2121
2222#include "fdc.h"
trunk/src/emu/bus/a2bus/a2alfam2.c
r26736r26737
177177      case 3:
178178         if (m_has4thsn)
179179         {
180            m_sn4->write(space, 0, data);
180            m_sn4->write(space, 0, data);
181181            m_latch3 = data;
182182         }
183183         break;
trunk/src/emu/bus/vic10/std.h
r26736r26737
2626// ======================> vic10_standard_cartridge_device
2727
2828class vic10_standard_cartridge_device :  public device_t,
29                              public device_vic10_expansion_card_interface
29                                 public device_vic10_expansion_card_interface
3030{
3131public:
3232   // construction/destruction
trunk/src/emu/bus/pc_kbd/iskr1030.c
r26736r26737
6666   AM_RANGE(0x00, 0xFF) AM_RAM
6767   AM_RANGE(MCS48_PORT_P1, MCS48_PORT_P1) AM_READWRITE(p1_r, p1_w)
6868   AM_RANGE(MCS48_PORT_P2, MCS48_PORT_P2) AM_WRITE(p2_w)
69//   AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_r)
69//  AM_RANGE(MCS48_PORT_T0, MCS48_PORT_T0) AM_READ(t0_r)
7070   AM_RANGE(MCS48_PORT_T1, MCS48_PORT_T1) AM_READ(t1_r)
7171ADDRESS_MAP_END
7272
r26736r26737
358358READ8_MEMBER( iskr_1030_keyboard_device::t0_r )
359359{
360360   return 0;
361//   return clock_signal();
361//  return clock_signal();
362362}
363363
364364
trunk/src/emu/bus/c64/pagefox.c
r26736r26737
6767{
6868   // allocate memory
6969   m_ram.allocate(0x8000);
70   
70
7171   // state saving
7272   save_item(NAME(m_bank));
7373}
trunk/src/emu/bus/abcbus/lux21046.c
r26736r26737
498498   PORT_START("SW3")
499499   PORT_DIPNAME( 0x7f, 0x2d, "Card Address" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
500500   PORT_DIPSETTING(    0x2d, "45" )
501   
501
502502   PORT_START("S1") // also S3,S5
503503   PORT_DIPNAME( 0x01, 0x01, "Interface Type" )
504504   PORT_DIPSETTING(    0x00, "ABC 1600" )
r26736r26737
549549   PORT_START("SW3")
550550   PORT_DIPNAME( 0x7f, 0x2c, "Card Address" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
551551   PORT_DIPSETTING(    0x2c, "44" )
552   
552
553553   PORT_START("S1") // also S3,S5
554554   PORT_DIPNAME( 0x01, 0x01, "Interface Type" )
555555   PORT_DIPSETTING(    0x00, "ABC 1600" )
r26736r26737
629629   PORT_START("SW1")
630630   PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:1,2,3,4")
631631   PORT_DIPSETTING(    0x00, DEF_STR( Unused ) )
632   
632
633633   PORT_START("SW2")
634634   PORT_DIPNAME( 0x0f, 0x0e, "Drive Type" ) PORT_DIPLOCATION("SW2:1,2,3,4")
635635   PORT_DIPSETTING(    0x0e, "BASF 6105" )
r26736r26737
688688   PORT_START("SW3")
689689   PORT_DIPNAME( 0x7f, 0x2c, "Card Address" ) PORT_DIPLOCATION("SW3:1,2,3,4,5,6,7")
690690   PORT_DIPSETTING(    0x2c, "44" )
691   
691
692692   PORT_START("S1") // also S3,S5
693693   PORT_DIPNAME( 0x01, 0x01, "Interface Type" )
694694   PORT_DIPSETTING(    0x00, "ABC 1600" )
r26736r26737
11251125
11261126   if (BIT(data, 2))
11271127   {
1128       m_fdc->set_unscaled_clock(XTAL_16MHz/16);
1128      m_fdc->set_unscaled_clock(XTAL_16MHz/16);
11291129   }
11301130   else
11311131   {
1132       m_fdc->set_unscaled_clock(XTAL_16MHz/8);
1132      m_fdc->set_unscaled_clock(XTAL_16MHz/8);
11331133   }
11341134}
11351135
trunk/src/emu/bus/abcbus/lux21056.c
r26736r26737
3030
3131    $ mess abc800m -bus abc850 -flop1 ufd631 -hard ro202.chd
3232    $ mess abc800m -bus abc850 -bus:abc850:io2 xebec,bios=basf6186 -flop1 ufd631 -hard basf6186.chd
33   
34   or with the ABC 852 attached:
3533
34    or with the ABC 852 attached:
35
3636    $ mess abc800m -bus abc852 -flop1 ufd631 -hard basf6185.chd
3737    $ mess abc800m -bus abc852 -bus:abc852:io2 xebec,bios=nec5126 -flop1 ufd631 -hard nec5126.chd
38   
38
3939    or with the ABC 856 attached:
4040
4141    $ mess abc800m -bus abc856 -flop1 ufd631 -hard micr1325.chd
r26736r26737
5959    Enter "DOSGEN,F HD0:" to start the formatting utility.
6060    Enter "J", and enter "J" to confirm the formatting.
6161
62   If you have a 20MB image, format the second partition by entering "DOSGEN,F HD1:", "J", and "J".
62    If you have a 20MB image, format the second partition by entering "DOSGEN,F HD1:", "J", and "J".
6363
64   If you have a 60MB image, format the third partition by entering "DOSGEN,F HD2:", "J", and "J",
65   and format the fourth partition by entering "DOSGEN,F HD3:", "J", and "J".
64    If you have a 60MB image, format the third partition by entering "DOSGEN,F HD2:", "J", and "J",
65    and format the fourth partition by entering "DOSGEN,F HD3:", "J", and "J".
6666
67   You can now list your freshly created partitions by   entering "LIB".
67    You can now list your freshly created partitions by entering "LIB".
6868
6969    Or skip all of the above and use the preformatted images in the software list:
7070
trunk/src/emu/machine/tmp68301.h
r26736r26737
2929{
3030   devcb_read16         m_in_parallel_cb;
3131   devcb_write16        m_out_parallel_cb;
32//    TODO: serial ports
32// TODO: serial ports
3333};
3434
3535class tmp68301_device : public device_t,
trunk/src/emu/machine/z80dart.c
r26736r26737
12271227      m_rx_clock++;
12281228      if (m_rx_clock == clocks)
12291229         m_rx_clock = 0;
1230         
1230
12311231   }
12321232}
12331233
r26736r26737
12491249      m_tx_clock++;
12501250      if (m_tx_clock == clocks)
12511251         m_tx_clock = 0;
1252         
1252
12531253   }
12541254}
12551255
r26736r26737
13391339      input_callback(m_input_state & ~RX);
13401340   }
13411341}
1342
trunk/src/emu/machine/t10sbc.c
r26736r26737
4242
4343   case T10SBC_CMD_SEEK_6:
4444      m_lba = (command[1]&0x1f)<<16 | command[2]<<8 | command[3];
45     
45
4646      logerror("S1410: SEEK to LBA %x\n", m_lba);
47     
47
4848      m_phase = SCSI_PHASE_STATUS;
4949      m_transfer_length = 0;
5050      break;
trunk/src/emu/machine/netlist.c
r26736r26737
6363netlist_mame_device::netlist_mame_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
6464   : device_t(mconfig, NETLIST, "netlist", tag, owner, clock, "netlist_mame", __FILE__),
6565      device_execute_interface(mconfig, *this),
66        //device_state_interface(mconfig, *this),
66      //device_state_interface(mconfig, *this),
6767      m_device_start_list(100),
6868      m_netlist(NULL),
6969      m_setup(NULL),
r26736r26737
8181
8282void netlist_mame_device::device_config_complete()
8383{
84    LOG_DEV_CALLS(("device_config_complete\n"));
84   LOG_DEV_CALLS(("device_config_complete\n"));
8585}
8686
8787void netlist_mame_device::device_start()
8888{
89    LOG_DEV_CALLS(("device_start\n"));
89   LOG_DEV_CALLS(("device_start\n"));
9090
9191   m_netlist = global_alloc_clear(netlist_mame_t(*this));
9292   m_setup = global_alloc_clear(netlist_setup_t(*m_netlist));
93    m_netlist->init_object(*m_netlist, "netlist");
94    m_setup->init();
93   m_netlist->init_object(*m_netlist, "netlist");
94   m_setup->init();
9595
96    m_netlist->set_clock_freq(this->clock());
96   m_netlist->set_clock_freq(this->clock());
9797
98    // register additional devices
98   // register additional devices
9999
100100   m_setup->factory().register_device<nld_analog_callback>( "NETDEV_CALLBACK", "nld_analog_callback");
101101
r26736r26737
104104   m_setup->start_devices();
105105   m_setup->resolve_inputs();
106106
107    bool allok = true;
108    for (device_start_list_t::entry_t *ods = m_device_start_list.first(); ods != NULL; ods = m_device_start_list.next(ods))
109        allok &= ods->object()->OnDeviceStart();
107   bool allok = true;
108   for (device_start_list_t::entry_t *ods = m_device_start_list.first(); ods != NULL; ods = m_device_start_list.next(ods))
109      allok &= ods->object()->OnDeviceStart();
110110
111    if (!allok)
112        m_netlist->xfatalerror("required elements not found\n");
111   if (!allok)
112      m_netlist->xfatalerror("required elements not found\n");
113113
114114   save_state();
115115
r26736r26737
119119
120120void netlist_mame_device::device_reset()
121121{
122    LOG_DEV_CALLS(("device_reset\n"));
122   LOG_DEV_CALLS(("device_reset\n"));
123123   m_netlist->reset();
124124}
125125
126126void netlist_mame_device::device_stop()
127127{
128    LOG_DEV_CALLS(("device_stop\n"));
128   LOG_DEV_CALLS(("device_stop\n"));
129129   m_setup->print_stats();
130130
131131   global_free(m_setup);
r26736r26737
136136
137137ATTR_COLD void netlist_mame_device::device_post_load()
138138{
139    LOG_DEV_CALLS(("device_post_load\n"));
140    m_netlist->queue().clear();
141    NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
142    for (int i = 0; i < qsize; i++ )
143    {
144        netlist_net_t *n = m_netlist->find_net(qtemp[i].m_name);
145        NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n));
146        NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), qtemp[i].m_time.as_double()));
147        m_netlist->queue().push(netlist_base_t::queue_t::entry_t(qtemp[i].m_time, *n));
148    }
139   LOG_DEV_CALLS(("device_post_load\n"));
140   m_netlist->queue().clear();
141   NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
142   for (int i = 0; i < qsize; i++ )
143   {
144      netlist_net_t *n = m_netlist->find_net(qtemp[i].m_name);
145      NL_VERBOSE_OUT(("Got %s ==> %p\n", qtemp[i].m_name, n));
146      NL_VERBOSE_OUT(("schedule time %f (%f)\n", n->time().as_double(), qtemp[i].m_time.as_double()));
147      m_netlist->queue().push(netlist_base_t::queue_t::entry_t(qtemp[i].m_time, *n));
148   }
149149}
150150
151151ATTR_COLD void netlist_mame_device::device_pre_save()
152152{
153    LOG_DEV_CALLS(("device_pre_save\n"));
153   LOG_DEV_CALLS(("device_pre_save\n"));
154154
155    qsize = m_netlist->queue().count();
156    NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
157    for (int i = 0; i < qsize; i++ )
158    {
159        qtemp[i].m_time =  m_netlist->queue().listptr()[i].time();
160        const char *p = m_netlist->queue().listptr()[i].object().name().cstr();
161        int n = MIN(63, strlen(p));
162        strncpy(qtemp[i].m_name, p, n);
163        qtemp[i].m_name[n] = 0;
164    }
155   qsize = m_netlist->queue().count();
156   NL_VERBOSE_OUT(("current time %f qsize %d\n", m_netlist->time().as_double(), qsize));
157   for (int i = 0; i < qsize; i++ )
158   {
159      qtemp[i].m_time =  m_netlist->queue().listptr()[i].time();
160      const char *p = m_netlist->queue().listptr()[i].object().name().cstr();
161      int n = MIN(63, strlen(p));
162      strncpy(qtemp[i].m_name, p, n);
163      qtemp[i].m_name[n] = 0;
164   }
165165#if 0
166166
167    netlist_time *nlt = (netlist_time *) ;
168    netlist_base_t::queue_t::entry_t *p = m_netlist->queue().listptr()[i];
169    netlist_time *nlt = (netlist_time *) p->time_ptr();
170    save_pointer(nlt->get_internaltype_ptr(), "queue", 1, i);
167   netlist_time *nlt = (netlist_time *) ;
168   netlist_base_t::queue_t::entry_t *p = m_netlist->queue().listptr()[i];
169   netlist_time *nlt = (netlist_time *) p->time_ptr();
170   save_pointer(nlt->get_internaltype_ptr(), "queue", 1, i);
171171#endif
172172}
173173
r26736r26737
179179
180180ATTR_COLD void netlist_mame_device::save_state()
181181{
182    for (pstate_entry_t::list_t::entry_t *p = m_netlist->save_list().first(); p != NULL; p = m_netlist->save_list().next(p))
183    {
184        pstate_entry_t *s = p->object();
185        NL_VERBOSE_OUT(("saving state for %s\n", s->m_name.cstr()));
186        switch (s->m_dt)
187        {
188            case DT_DOUBLE:
189                save_pointer((double *) s->m_ptr, s->m_name, s->m_count);
190                break;
191            case DT_INT64:
192                save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count);
193                break;
194            case DT_INT8:
195                save_pointer((INT8 *) s->m_ptr, s->m_name, s->m_count);
196                break;
197            case DT_INT:
198                save_pointer((int *) s->m_ptr, s->m_name, s->m_count);
199                break;
200            case DT_BOOLEAN:
201                save_pointer((bool *) s->m_ptr, s->m_name, s->m_count);
202                break;
203            case NOT_SUPPORTED:
204            default:
205                m_netlist->xfatalerror("found unsupported save element %s\n", s->m_name.cstr());
206                break;
207        }
208    }
182   for (pstate_entry_t::list_t::entry_t *p = m_netlist->save_list().first(); p != NULL; p = m_netlist->save_list().next(p))
183   {
184      pstate_entry_t *s = p->object();
185      NL_VERBOSE_OUT(("saving state for %s\n", s->m_name.cstr()));
186      switch (s->m_dt)
187      {
188         case DT_DOUBLE:
189            save_pointer((double *) s->m_ptr, s->m_name, s->m_count);
190            break;
191         case DT_INT64:
192            save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count);
193            break;
194         case DT_INT8:
195            save_pointer((INT8 *) s->m_ptr, s->m_name, s->m_count);
196            break;
197         case DT_INT:
198            save_pointer((int *) s->m_ptr, s->m_name, s->m_count);
199            break;
200         case DT_BOOLEAN:
201            save_pointer((bool *) s->m_ptr, s->m_name, s->m_count);
202            break;
203         case NOT_SUPPORTED:
204         default:
205            m_netlist->xfatalerror("found unsupported save element %s\n", s->m_name.cstr());
206            break;
207      }
208   }
209209
210    // handle the queue
210   // handle the queue
211211
212    save_item(NAME(qsize));
213    for (int i = 0; i < m_netlist->queue().capacity(); i++ )
214    {
215        save_pointer(qtemp[i].m_time.get_internaltype_ptr(), "queue_time", 1, i);
216        save_pointer(qtemp[i].m_name, "queue_name", sizeof(qtemp[i].m_name), i);
212   save_item(NAME(qsize));
213   for (int i = 0; i < m_netlist->queue().capacity(); i++ )
214   {
215      save_pointer(qtemp[i].m_time.get_internaltype_ptr(), "queue_time", 1, i);
216      save_pointer(qtemp[i].m_name, "queue_name", sizeof(qtemp[i].m_name), i);
217217
218    }
218   }
219219}
220220
221221ATTR_COLD UINT64 netlist_mame_device::execute_clocks_to_cycles(UINT64 clocks) const
r26736r26737
235235   // debugging
236236   //m_ppc = m_pc; // copy PC to previous PC
237237   if (check_debugger)
238       debugger_instruction_hook(this, 0); //m_pc);
238      debugger_instruction_hook(this, 0); //m_pc);
239239
240240   m_netlist->process_queue(m_icount);
241241}
trunk/src/emu/machine/nscsi_cb.c
r26736r26737
44
55nscsi_callback_device::nscsi_callback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
66   : nscsi_device(mconfig, NSCSI_CB, "SCSI callback (new)", tag, owner, clock, "nscsi_cb", __FILE__),
7     m_write_rst(*this),
8     m_write_atn(*this),
9     m_write_ack(*this),
10     m_write_req(*this),
11     m_write_msg(*this),
12     m_write_io(*this),
13     m_write_cd(*this),
14     m_write_sel(*this),
15     m_write_bsy(*this)
7      m_write_rst(*this),
8      m_write_atn(*this),
9      m_write_ack(*this),
10      m_write_req(*this),
11      m_write_msg(*this),
12      m_write_io(*this),
13      m_write_cd(*this),
14      m_write_sel(*this),
15      m_write_bsy(*this)
1616{
1717}
1818
trunk/src/emu/machine/netlist.h
r26736r26737
7070// ----------------------------------------------------------------------------------------
7171
7272#define NETLIST_MEMREGION(_name)                                                    \
73        netlist.parse((char *)downcast<netlist_mame_t &>(netlist.netlist()).machine().root_device().memregion(_name)->base());
73      netlist.parse((char *)downcast<netlist_mame_t &>(netlist.netlist()).machine().root_device().memregion(_name)->base());
7474
7575#define NETDEV_ANALOG_CALLBACK(_name, _IN, _class, _member, _tag) \
76        { \
77            NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>(netlist.register_dev(NET_NEW(analog_callback), # _name)); \
78            netlist_analog_output_delegate d = netlist_analog_output_delegate(& _class :: _member, # _class "::" # _member, _tag, (_class *) 0); \
79            dev->register_callback(d); \
80        } \
81        NET_CONNECT(_name, IN, _IN)
76      { \
77         NETLIB_NAME(analog_callback) *dev = downcast<NETLIB_NAME(analog_callback) *>(netlist.register_dev(NET_NEW(analog_callback), # _name)); \
78         netlist_analog_output_delegate d = netlist_analog_output_delegate(& _class :: _member, # _class "::" # _member, _tag, (_class *) 0); \
79         dev->register_callback(d); \
80      } \
81      NET_CONNECT(_name, IN, _IN)
8282
8383#define NETDEV_ANALOG_CALLBACK_MEMBER(_name) \
84    void _name(const double data, const attotime &time)
84   void _name(const double data, const attotime &time)
8585
8686class netlist_mame_device;
8787
r26736r26737
8989{
9090public:
9191
92    netlist_mame_t(netlist_mame_device &parent)
93    : netlist_base_t(),
94        m_parent(parent)
95    {}
96    virtual ~netlist_mame_t() { };
92   netlist_mame_t(netlist_mame_device &parent)
93   : netlist_base_t(),
94      m_parent(parent)
95   {}
96   virtual ~netlist_mame_t() { };
9797
98    inline running_machine &machine();
98   inline running_machine &machine();
9999
100    netlist_mame_device &parent() { return m_parent; }
100   netlist_mame_device &parent() { return m_parent; }
101101
102102protected:
103103
104    void vfatalerror(const char *format, va_list ap) const
105    {
106        emu_fatalerror error(format, ap);
107        throw error;
108    }
104   void vfatalerror(const char *format, va_list ap) const
105   {
106      emu_fatalerror error(format, ap);
107      throw error;
108   }
109109
110110private:
111    netlist_mame_device &m_parent;
111   netlist_mame_device &m_parent;
112112};
113113
114114// ----------------------------------------------------------------------------------------
r26736r26737
121121// ======================> netlist_mame_device
122122
123123class netlist_mame_device : public device_t,
124                      public device_execute_interface
125                          //public device_state_interface
126                      //, public device_memory_interface
124                     public device_execute_interface
125                     //public device_state_interface
126                     //, public device_memory_interface
127127{
128128public:
129129
130130   template<bool _Required, class _NETClass>
131131   class output_finder;
132    template<class C>
132   template<class C>
133133   class optional_output;
134134   template<class C>
135135   class required_output;
136    template<class C>
136   template<class C>
137137   class optional_param;
138    template<class C>
138   template<class C>
139139   class required_param;
140140   class on_device_start;
141141
r26736r26737
159159   virtual void device_stop();
160160   virtual void device_reset();
161161   virtual void device_post_load();
162    virtual void device_pre_save();
162   virtual void device_pre_save();
163163   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
164164   virtual UINT64 execute_clocks_to_cycles(UINT64 clocks) const;
165165   virtual UINT64 execute_cycles_to_clocks(UINT64 cycles) const;
r26736r26737
173173// more save state ... needs to go somewhere else
174174
175175   struct qentry {
176        netlist_time m_time;
177       char m_name[64];
176      netlist_time m_time;
177      char m_name[64];
178178   };
179179
180180   qentry qtemp[1024];
r26736r26737
193193
194194inline running_machine &netlist_mame_t::machine()
195195{
196    return m_parent.machine();
196   return m_parent.machine();
197197}
198198
199199// ----------------------------------------------------------------------------------------
r26736r26737
205205class NETLIB_NAME(analog_callback) : public netlist_device_t
206206{
207207public:
208    NETLIB_NAME(analog_callback)()
209        : netlist_device_t() { }
208   NETLIB_NAME(analog_callback)()
209      : netlist_device_t() { }
210210
211    ATTR_COLD void start()
212    {
213        register_input("IN", m_in);
214        m_callback.bind_relative_to(downcast<netlist_mame_t &>(netlist()).machine().root_device());
215    }
211   ATTR_COLD void start()
212   {
213      register_input("IN", m_in);
214      m_callback.bind_relative_to(downcast<netlist_mame_t &>(netlist()).machine().root_device());
215   }
216216
217    ATTR_COLD void register_callback(netlist_analog_output_delegate callback)
218    {
219        m_callback = callback;
220    }
217   ATTR_COLD void register_callback(netlist_analog_output_delegate callback)
218   {
219      m_callback = callback;
220   }
221221
222    ATTR_HOT void update()
223    {
224        // FIXME: Remove after device cleanup
225        if (!m_callback.isnull())
226            m_callback(INPANALOG(m_in), downcast<netlist_mame_t &>(netlist()).parent().local_time());
227    }
222   ATTR_HOT void update()
223   {
224      // FIXME: Remove after device cleanup
225      if (!m_callback.isnull())
226         m_callback(INPANALOG(m_in), downcast<netlist_mame_t &>(netlist()).parent().local_time());
227   }
228228
229229private:
230    netlist_analog_input_t m_in;
231    netlist_analog_output_delegate m_callback;
230   netlist_analog_input_t m_in;
231   netlist_analog_output_delegate m_callback;
232232};
233233
234234class NETLIB_NAME(sound) : public netlist_device_t
235235{
236236public:
237    NETLIB_NAME(sound)()
238        : netlist_device_t() { }
237   NETLIB_NAME(sound)()
238      : netlist_device_t() { }
239239
240    static const int BUFSIZE = 2048;
240   static const int BUFSIZE = 2048;
241241
242    ATTR_COLD void start()
243    {
244        register_input("IN", m_in);
245        m_cur = 0;
246        m_last_pos = 0;
247        m_last_buffer = netlist_time::zero;
248        m_sample = netlist_time::zero;  // FIXME: divide by zero
249     }
242   ATTR_COLD void start()
243   {
244      register_input("IN", m_in);
245      m_cur = 0;
246      m_last_pos = 0;
247      m_last_buffer = netlist_time::zero;
248      m_sample = netlist_time::zero;  // FIXME: divide by zero
249      }
250250
251    ATTR_HOT void sound_update()
252    {
253        netlist_time current = netlist().time();
254        int pos = (current - m_last_buffer) / m_sample;
255        if (pos >= BUFSIZE)
256            netlist().xfatalerror("sound %s: exceeded BUFSIZE\n", name().cstr());
257        while (m_last_pos < pos )
258        {
259            m_buffer[m_last_pos++] = m_cur;
260        }
261    }
251   ATTR_HOT void sound_update()
252   {
253      netlist_time current = netlist().time();
254      int pos = (current - m_last_buffer) / m_sample;
255      if (pos >= BUFSIZE)
256         netlist().xfatalerror("sound %s: exceeded BUFSIZE\n", name().cstr());
257      while (m_last_pos < pos )
258      {
259         m_buffer[m_last_pos++] = m_cur;
260      }
261   }
262262
263    ATTR_HOT void update()
264    {
265        double val = INPANALOG(m_in);
266        sound_update();
267        m_cur = val;
268    }
263   ATTR_HOT void update()
264   {
265      double val = INPANALOG(m_in);
266      sound_update();
267      m_cur = val;
268   }
269269
270270private:
271    netlist_analog_input_t m_in;
272    netlist_time m_sample;
273    double m_cur;
274    int m_last_pos;
275    netlist_time m_last_buffer;
276    stream_sample_t m_buffer[BUFSIZE];
271   netlist_analog_input_t m_in;
272   netlist_time m_sample;
273   double m_cur;
274   int m_last_pos;
275   netlist_time m_last_buffer;
276   stream_sample_t m_buffer[BUFSIZE];
277277};
278278
279279
trunk/src/emu/machine/nscsi_s1410.c
r26736r26737
1010void nscsi_s1410_device::device_reset()
1111{
1212   nscsi_harddisk_device::device_reset();
13   
13
1414   // initialize drive characteristics
1515   params[0] = 0;
1616   params[1] = 153;
r26736r26737
4444         scsi_status_complete(SS_NOT_READY);
4545         return;
4646      }
47     
47
4848      scsi_status_complete(SS_GOOD);
4949      break;
5050
r26736r26737
5656
5757      lba = ((scsi_cmdbuf[1] & 0x1f)<<16) | (scsi_cmdbuf[2]<<8) | scsi_cmdbuf[3];
5858      blocks = (bytes_per_sector == 256) ? 32 : 17;
59     
59
6060      int track_length = blocks*bytes_per_sector;
6161      UINT8 *data = global_alloc_array(UINT8,track_length);
6262      memset(data, 0xc6, track_length);
r26736r26737
7676         scsi_status_complete(SS_NOT_READY);
7777         return;
7878      }
79     
79
8080      scsi_data_in(2, 3);
8181      scsi_status_complete(SS_GOOD);
8282      break;
r26736r26737
103103      }
104104      scsi_status_complete(SS_GOOD);
105105      break;
106     
106
107107   case SC_READ_ECC_BURST:
108108   case SC_RAM_DIAG:
109109   case SC_DRIVE_DIAG:
r26736r26737
135135   switch(scsi_cmdbuf[0]) {
136136   case SC_FORMAT_ALT_TRACK:
137137      break;
138   
138
139139   case SC_INIT_DRIVE_PARAMS:
140140      params[pos] = data;
141141      break;
trunk/src/emu/machine/nscsi_s1410.h
r26736r26737
1212protected:
1313   // SCSI status returns
1414   enum {
15      SS_GOOD                 = 0x00,
16      SS_NO_INDEX             = 0x01,
17      SS_NO_SEEK_COMPLETE     = 0x02,
18      SS_WRITE_FAULT          = 0x03,
19      SS_NOT_READY          = 0x04,
20      SS_TK00_NOT_FOUND       = 0x06,
21      SS_SEEK_IN_PROGRESS     = 0x08,
22      SS_ID_FIELD_ERROR       = 0x10,
23      SS_DATA_ERROR          = 0x11,
24      SS_SAM_NOT_FOUND       = 0x12,
25      SS_SECTOR_NOT_FOUND     = 0x14,
26      SS_SEEK_ERROR          = 0x15,
27      SS_ECC                = 0x18,
28      SS_BAD_TRACK          = 0x19,
29      SS_FORMAT_ERROR            = 0x1a,
30      SS_ALT_TRACK          = 0x1c,
31      SS_ALT_TRACK_DEFECT     = 0x1d,
15      SS_GOOD                 = 0x00,
16      SS_NO_INDEX             = 0x01,
17      SS_NO_SEEK_COMPLETE     = 0x02,
18      SS_WRITE_FAULT          = 0x03,
19      SS_NOT_READY            = 0x04,
20      SS_TK00_NOT_FOUND       = 0x06,
21      SS_SEEK_IN_PROGRESS     = 0x08,
22      SS_ID_FIELD_ERROR       = 0x10,
23      SS_DATA_ERROR           = 0x11,
24      SS_SAM_NOT_FOUND        = 0x12,
25      SS_SECTOR_NOT_FOUND     = 0x14,
26      SS_SEEK_ERROR           = 0x15,
27      SS_ECC                  = 0x18,
28      SS_BAD_TRACK            = 0x19,
29      SS_FORMAT_ERROR         = 0x1a,
30      SS_ALT_TRACK            = 0x1c,
31      SS_ALT_TRACK_DEFECT     = 0x1d,
3232      SS_ALT_TRACK_NOT_FOUND  = 0x1e,
3333      SS_ALT_TRACK_SAME       = 0x1f,
34      SS_RAM_ERROR         = 0x30,
35      SS_ROM_ERROR         = 0x31,
36      SS_ECC_CHECK_FAILURE   = 0x32
34      SS_RAM_ERROR            = 0x30,
35      SS_ROM_ERROR            = 0x31,
36      SS_ECC_CHECK_FAILURE    = 0x32
3737   };
3838
3939   // SCSI commands
4040   enum {
41      SC_TEST_UNIT_READY      = 0x00,
42      SC_REZERO               = 0x01,
43      SC_REQUEST_SENSE        = 0x03,
44      SC_FORMAT_UNIT          = 0x04,
45      SC_CHECK_TRACK_FORMAT    = 0x05,
46      SC_FORMAT_TRACK       = 0x06,
47      SC_REASSIGN_BLOCKS      = 0x07,
48      SC_READ                 = 0x08,
49      SC_WRITE                = 0x0a,
50      SC_SEEK                 = 0x0b,
41      SC_TEST_UNIT_READY      = 0x00,
42      SC_REZERO               = 0x01,
43      SC_REQUEST_SENSE        = 0x03,
44      SC_FORMAT_UNIT          = 0x04,
45      SC_CHECK_TRACK_FORMAT   = 0x05,
46      SC_FORMAT_TRACK         = 0x06,
47      SC_REASSIGN_BLOCKS      = 0x07,
48      SC_READ                 = 0x08,
49      SC_WRITE                = 0x0a,
50      SC_SEEK                 = 0x0b,
5151      SC_INIT_DRIVE_PARAMS    = 0x0c,
5252      SC_READ_ECC_BURST       = 0x0d,
5353      SC_FORMAT_ALT_TRACK     = 0x0e,
trunk/src/emu/machine/upd4992.c
r26736r26737
22// copyright-holders: Angelo Salese
33/***************************************************************************
44
5   uPD4992 parallel RTC
5    uPD4992 parallel RTC
66
7   TODO:
8   - Add timers
9   - Add leap year count
10   - Add 12 hours mode
11   - Add mode/control register
7    TODO:
8    - Add timers
9    - Add leap year count
10    - Add 12 hours mode
11    - Add mode/control register
1212
1313***************************************************************************/
1414
r26736r26737
3535
3636upd4992_device::upd4992_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
3737   : device_t(mconfig, UPD4992, "uPD4992", tag, owner, clock, "upd4992", __FILE__),
38     device_rtc_interface(mconfig, *this)
38      device_rtc_interface(mconfig, *this)
3939{
4040}
4141
trunk/src/emu/machine/upd4992.h
r26736r26737
22// copyright-holders: Angelo Salese
33/***************************************************************************
44
5   uPD4992 RTC
5    uPD4992 RTC
66
77***************************************************************************/
88
r26736r26737
2727// ======================> upd4992_device
2828
2929class upd4992_device : public device_t,
30                  public device_rtc_interface
30                  public device_rtc_interface
3131{
3232public:
3333   // construction/destruction
trunk/src/emu/machine/z80dma.c
r26736r26737
123123#define EOB_F_CLEAR             (m_status |= 0x20)
124124
125125#define READY_ACTIVE_HIGH       ((WR5>>3) & 0x01)
126#define AUTO_RESTART         ((WR5>>5) & 0x01)
126#define AUTO_RESTART            ((WR5>>5) & 0x01)
127127
128128#define INTERRUPT_ENABLE        (WR3 & 0x20)
129129#define INT_ON_MATCH            (INTERRUPT_CTRL & 0x01)
trunk/src/emu/machine/mc2661.c
r26736r26737
370370         UINT32 tx_baud = baud_rates[data & 0x0f];
371371         if(data & 0x10)  // internal receiver clock
372372         {
373//            if((m_mr[0] & 0x03) != 0)
374//               rx_baud *= 16;
373//              if((m_mr[0] & 0x03) != 0)
374//                  rx_baud *= 16;
375375         }
376376         else  // external receiver clock
377377         {
r26736r26737
390390         }
391391         if(data & 0x20)  // internal transmitter clock
392392         {
393//            if((m_mr[0] & 0x03) != 0)
394//               tx_baud *= 16;
393//              if((m_mr[0] & 0x03) != 0)
394//                  tx_baud *= 16;
395395         }
396396         else  // external transmitter clock
397397         {
trunk/src/emu/machine/t10mmc.c
r26736r26737
550550
551551   case T10MMC_CMD_READ_TOC_PMA_ATIP:
552552      /*
553         Track numbers are problematic here: 0 = lead-in, 0xaa = lead-out.
554         That makes sense in terms of how real-world CDs are referred to, but
555         our internal routines for tracks use "0" as track 1.  That probably
556         should be fixed...
553          Track numbers are problematic here: 0 = lead-in, 0xaa = lead-out.
554          That makes sense in terms of how real-world CDs are referred to, but
555          our internal routines for tracks use "0" as track 1.  That probably
556          should be fixed...
557557      */
558558      {
559559         bool msf = (command[1] & 0x2) != 0;
trunk/src/emu/machine/tmp68301.c
r26736r26737
66    3 timers, address decoder, wait generator, interrupt controller,
77    all integrated in a single chip.
88
9   TODO:
10   - Interrupt generation: handle pending / in-service mechanisms
11   - Parallel port: handle timing latency
12   - Serial port: not done at all
13   - (and many other things)
9    TODO:
10    - Interrupt generation: handle pending / in-service mechanisms
11    - Parallel port: handle timing latency
12    - Serial port: not done at all
13    - (and many other things)
1414
1515***************************************************************************/
1616
r26736r26737
2020const device_type TMP68301 = &device_creator<tmp68301_device>;
2121
2222static ADDRESS_MAP_START( tmp68301_regs, AS_0, 16, tmp68301_device )
23//   AM_RANGE(0x000,0x3ff) AM_RAM
23//  AM_RANGE(0x000,0x3ff) AM_RAM
2424   AM_RANGE(0x094,0x095) AM_READWRITE(imr_r,imr_w)
2525   AM_RANGE(0x098,0x099) AM_READWRITE(iisr_r,iisr_w)
2626
r26736r26737
6363WRITE16_MEMBER(tmp68301_device::scr_w)
6464{
6565   /*
66      *--- ---- CKSE
67      --*- ---- RES
68      ---- ---* INTM
66       *--- ---- CKSE
67       --*- ---- RES
68       ---- ---* INTM
6969   */
7070
7171   COMBINE_DATA(&m_scr);
trunk/src/emu/netlist/nl_parser.c
r26736r26737
2727      NL_VERBOSE_OUT(("Parser: Device: %s\n", n.cstr()));
2828      if (n == "NET_ALIAS")
2929         net_alias();
30        else if (n == "NET_C")
31            net_c();
30      else if (n == "NET_C")
31         net_c();
3232      else if (n == "NETDEV_PARAM")
3333         netdev_param();
34        else if (n == "NETDEV_R")
35            netdev_device(n, "R");
36        else if (n == "NETDEV_C")
37            netdev_device(n, "C");
38        else if (n == "NETDEV_POT")
39            netdev_device(n, "R");
40        else if (n == "NETDEV_D")
41            netdev_device(n, "model", true);
34      else if (n == "NETDEV_R")
35         netdev_device(n, "R");
36      else if (n == "NETDEV_C")
37         netdev_device(n, "C");
38      else if (n == "NETDEV_POT")
39         netdev_device(n, "R");
40      else if (n == "NETDEV_D")
41         netdev_device(n, "model", true);
4242      else if ((n == "NETDEV_TTL_CONST") || (n == "NETDEV_ANALOG_CONST"))
4343         netdev_const(n);
4444      else
r26736r26737
6060
6161void netlist_parser::net_c()
6262{
63    pstring t1;
64    pstring t2;
65    skipws();
66    t1 = getname(',');
67    skipws();
68    t2 = getname(')');
69    NL_VERBOSE_OUT(("Parser: Connect: %s %s\n", t1.cstr(), t2.cstr()));
70    m_setup.register_link(t1 , t2);
63   pstring t1;
64   pstring t2;
65   skipws();
66   t1 = getname(',');
67   skipws();
68   t2 = getname(')');
69   NL_VERBOSE_OUT(("Parser: Connect: %s %s\n", t1.cstr(), t2.cstr()));
70   m_setup.register_link(t1 , t2);
7171}
7272
7373void netlist_parser::netdev_param()
r26736r26737
9898   val = eval_param();
9999   paramfq = name + ".CONST";
100100   NL_VERBOSE_OUT(("Parser: Const: %s %f\n", name.cstr(), val));
101    check_char(')');
101   check_char(')');
102102   m_setup.register_param(paramfq, val);
103103}
104104
r26736r26737
126126   }
127127/*
128128    if (cnt != dev->m_terminals.count() && !dev->variable_input_count())
129      fatalerror("netlist: input count mismatch for %s - expected %d found %d\n", devname.cstr(), dev->m_terminals.count(), cnt);
130   if (dev->variable_input_count())
131   {
132      NL_VERBOSE_OUT(("variable inputs %s: %d\n", dev->name().cstr(), cnt));
133   }
134   */
129        fatalerror("netlist: input count mismatch for %s - expected %d found %d\n", devname.cstr(), dev->m_terminals.count(), cnt);
130    if (dev->variable_input_count())
131    {
132        NL_VERBOSE_OUT(("variable inputs %s: %d\n", dev->name().cstr(), cnt));
133    }
134    */
135135}
136136
137137void netlist_parser::netdev_device(const pstring &dev_type, const pstring &default_param, bool isString)
138138{
139    netlist_device_t *dev;
139   netlist_device_t *dev;
140140
141    skipws();
142    pstring devname = getname2(',', ')');
143    pstring defparam = devname + "." + default_param;
144    dev = m_setup.factory().new_device_by_name(dev_type, m_setup);
145    m_setup.register_dev(dev, devname);
146    NL_VERBOSE_OUT(("Parser: IC: %s\n", devname.cstr()));
147    if (getc() != ')')
148    {
149        // have a default param
150        skipws();
151        if (isString)
152        {
153            pstring val = getname(')');
154            ungetc();
155            NL_VERBOSE_OUT(("Parser: Default param: %s %s\n", defparam.cstr(), val.cstr()));
156            m_setup.register_param(defparam, val);
157        }
158        else
159        {
160            double val = eval_param();
161            NL_VERBOSE_OUT(("Parser: Default param: %s %f\n", defparam.cstr(), val));
162            m_setup.register_param(defparam, val);
163        }
164    }
165    check_char(')');
141   skipws();
142   pstring devname = getname2(',', ')');
143   pstring defparam = devname + "." + default_param;
144   dev = m_setup.factory().new_device_by_name(dev_type, m_setup);
145   m_setup.register_dev(dev, devname);
146   NL_VERBOSE_OUT(("Parser: IC: %s\n", devname.cstr()));
147   if (getc() != ')')
148   {
149      // have a default param
150      skipws();
151      if (isString)
152      {
153         pstring val = getname(')');
154         ungetc();
155         NL_VERBOSE_OUT(("Parser: Default param: %s %s\n", defparam.cstr(), val.cstr()));
156         m_setup.register_param(defparam, val);
157      }
158      else
159      {
160         double val = eval_param();
161         NL_VERBOSE_OUT(("Parser: Default param: %s %f\n", defparam.cstr(), val));
162         m_setup.register_param(defparam, val);
163      }
164   }
165   check_char(')');
166166}
167167
168168// ----------------------------------------------------------------------------------------
r26736r26737
171171
172172void netlist_parser::skipeol()
173173{
174    char c = getc();
174   char c = getc();
175175   while (c)
176176   {
177177      if (c == 10)
r26736r26737
197197      case 13:
198198         break;
199199      case '/':
200          c = getc();
200         c = getc();
201201         if (c == '/')
202202         {
203                skipeol();
203            skipeol();
204204         }
205205         else if (c == '*')
206206         {
207             int f=0;
208             while ((c = getc()) != 0 )
209             {
210                 if (f == 0 && c == '*')
211                     f=1;
212                 else if (f == 1 && c== '/' )
213                     break;
214                 else
215                     f=0;
216             }
207            int f=0;
208            while ((c = getc()) != 0 )
209            {
210               if (f == 0 && c == '*')
211                  f=1;
212               else if (f == 1 && c== '/' )
213                  break;
214               else
215                  f=0;
216            }
217217         }
218218         break;
219219      default:
220          ungetc();
220         ungetc();
221221         return;
222222      }
223223   }
r26736r26737
243243
244244   while ((c != sep1) && (c != sep2))
245245   {
246        *p1++ = c;
247        c = getc();
246      *p1++ = c;
247      c = getc();
248248   }
249249   *p1 = 0;
250250   ungetc();
r26736r26737
278278         f = i;
279279   ret = s.substr(strlen(macs[f])).as_double(&e);
280280   if ((f>0) && e)
281       m_setup.netlist().xfatalerror("Parser: Error with parameter ...\n");
282    if (f>0)
283        check_char(')');
281      m_setup.netlist().xfatalerror("Parser: Error with parameter ...\n");
282   if (f>0)
283      check_char(')');
284284   return ret * facs[f];
285285}
286286
287287unsigned char netlist_parser::getc()
288288{
289    if (*m_px)
290        return *(m_px++);
291    else
292        return *m_px;
289   if (*m_px)
290      return *(m_px++);
291   else
292      return *m_px;
293293}
294294
295295void netlist_parser::ungetc()
296296{
297    m_px--;
297   m_px--;
298298}
trunk/src/emu/netlist/pstring.c
r26736r26737
2424//#define DEBUG_MODE      (0)
2525
2626#ifdef MAME_DEBUG
27    #ifndef IMMEDIATE_MODE
28        #define IMMEDIATE_MODE  (0)
29    #endif
30    #ifndef DEBUG_MODE
31        #define DEBUG_MODE      (1)
32    #endif
27   #ifndef IMMEDIATE_MODE
28      #define IMMEDIATE_MODE  (0)
29   #endif
30   #ifndef DEBUG_MODE
31      #define DEBUG_MODE      (1)
32   #endif
3333#else
34    #ifndef IMMEDIATE_MODE
35        #define IMMEDIATE_MODE  (1)
36    #endif
37    #ifndef DEBUG_MODE
38        #define DEBUG_MODE      (0)
39    #endif
34   #ifndef IMMEDIATE_MODE
35      #define IMMEDIATE_MODE  (1)
36   #endif
37   #ifndef DEBUG_MODE
38      #define DEBUG_MODE      (0)
39   #endif
4040#endif
4141
4242pstring::~pstring()
4343{
44   sfree(m_ptr);
44   sfree(m_ptr);
4545}
4646
4747void pstring::pcat(const char *s)
4848{
49    int slen = strlen(s);
50    str_t *n = salloc(m_ptr->len() + slen);
51    if (m_ptr->len() > 0)
52        memcpy(n->str(), m_ptr->str(), m_ptr->len());
53    if (slen > 0)
54        memcpy(n->str() + m_ptr->len(), s, slen);
55    *(n->str() + n->len()) = 0;
56    sfree(m_ptr);
57    m_ptr = n;
49   int slen = strlen(s);
50   str_t *n = salloc(m_ptr->len() + slen);
51   if (m_ptr->len() > 0)
52      memcpy(n->str(), m_ptr->str(), m_ptr->len());
53   if (slen > 0)
54      memcpy(n->str() + m_ptr->len(), s, slen);
55   *(n->str() + n->len()) = 0;
56   sfree(m_ptr);
57   m_ptr = n;
5858}
5959
6060void pstring::pcopy(const char *from, int size)
6161{
62    str_t *n = salloc(size);
63    if (size > 0)
64        memcpy(n->str(), from, size);
65    *(n->str() + size) = 0;
66    sfree(m_ptr);
67    m_ptr = n;
62   str_t *n = salloc(size);
63   if (size > 0)
64      memcpy(n->str(), from, size);
65   *(n->str() + size) = 0;
66   sfree(m_ptr);
67   m_ptr = n;
6868}
6969
7070pstring pstring::substr(unsigned int start, int count) const
7171{
72    int alen = len();
73    if (start >= alen)
74        return pstring();
75    if (count <0 || start + count > alen)
76        count = alen - start;
77    pstring ret;
78    ret.pcopy(cstr() + start, count);
79    return ret;
72   int alen = len();
73   if (start >= alen)
74      return pstring();
75   if (count <0 || start + count > alen)
76      count = alen - start;
77   pstring ret;
78   ret.pcopy(cstr() + start, count);
79   return ret;
8080}
8181
8282pstring pstring::ucase() const
8383{
84    pstring ret = *this;
85    ret.pcopy(cstr(), len());
86    for (int i=0; i<ret.len(); i++)
87        ret.m_ptr->m_str[i] = toupper((unsigned) ret.m_ptr->m_str[i]);
88    return ret;
84   pstring ret = *this;
85   ret.pcopy(cstr(), len());
86   for (int i=0; i<ret.len(); i++)
87      ret.m_ptr->m_str[i] = toupper((unsigned) ret.m_ptr->m_str[i]);
88   return ret;
8989}
9090
9191//-------------------------------------------------
r26736r26737
9494
9595int pstring::pcmpi(const char *lhs, const char *rhs, int count) const
9696{
97    // loop while equal until we hit the end of strings
98    int index;
99    for (index = 0; index < count; index++)
100        if (lhs[index] == 0 || tolower(lhs[index]) != tolower(rhs[index]))
101            break;
97   // loop while equal until we hit the end of strings
98   int index;
99   for (index = 0; index < count; index++)
100      if (lhs[index] == 0 || tolower(lhs[index]) != tolower(rhs[index]))
101         break;
102102
103    // determine the final result
104    if (index < count)
105        return tolower(lhs[index]) - tolower(rhs[index]);
106    if (lhs[index] == 0)
107        return 0;
108    return 1;
103   // determine the final result
104   if (index < count)
105      return tolower(lhs[index]) - tolower(rhs[index]);
106   if (lhs[index] == 0)
107      return 0;
108   return 1;
109109}
110110
111111double pstring::as_double(bool *error) const
112112{
113    double ret;
114    char *e = NULL;
113   double ret;
114   char *e = NULL;
115115
116    if (error != NULL)
117        *error = false;
118    ret = strtod(cstr(), &e);
119    if (*e != 0)
120        if (error != NULL)
121            *error = true;
122    return ret;
116   if (error != NULL)
117      *error = false;
118   ret = strtod(cstr(), &e);
119   if (*e != 0)
120      if (error != NULL)
121         *error = true;
122   return ret;
123123}
124124
125125long pstring::as_long(bool *error) const
126126{
127    double ret;
128    char *e = NULL;
127   double ret;
128   char *e = NULL;
129129
130    if (error != NULL)
131        *error = false;
132    if (startsWith("0x"))
133        ret = strtol(&(cstr()[2]), &e, 16);
134    else
135        ret = strtol(cstr(), &e, 10);
136    if (*e != 0)
137        if (error != NULL)
138            *error = true;
139    return ret;
130   if (error != NULL)
131      *error = false;
132   if (startsWith("0x"))
133      ret = strtol(&(cstr()[2]), &e, 16);
134   else
135      ret = strtol(cstr(), &e, 10);
136   if (*e != 0)
137      if (error != NULL)
138         *error = true;
139   return ret;
140140}
141141
142142pstring pstring::vprintf(va_list args) const
143143{
144    // sprintf into the temporary buffer
145    char tempbuf[4096];
146    vsprintf(tempbuf, cstr(), args);
144   // sprintf into the temporary buffer
145   char tempbuf[4096];
146   vsprintf(tempbuf, cstr(), args);
147147
148    return pstring(tempbuf);
148   return pstring(tempbuf);
149149}
150150
151151// ----------------------------------------------------------------------------------------
r26736r26737
154154
155155void pstring::sfree(str_t *s)
156156{
157    s->m_ref_count--;
158    if (s->m_ref_count == 0)
159        m_pool.dealloc(s);
157   s->m_ref_count--;
158   if (s->m_ref_count == 0)
159      m_pool.dealloc(s);
160160}
161161
162162pstring::str_t *pstring::salloc(int n)
163163{
164    str_t *ret = new(m_pool, n+1) str_t(n);
165    return ret;
164   str_t *ret = new(m_pool, n+1) str_t(n);
165   return ret;
166166}
167167
168168pstring pstring::sprintf(const char *format, ...)
169169{
170    va_list ap;
171    va_start(ap, format);
172    pstring ret = pstring(format).vprintf(ap);
173    va_end(ap);
174    return ret;
170   va_list ap;
171   va_start(ap, format);
172   pstring ret = pstring(format).vprintf(ap);
173   va_end(ap);
174   return ret;
175175}
176176
177177
178178void pstring::resetmem()
179179{
180    // Release the 0 string
181    if (m_zero != NULL)
182        sfree(m_zero);
183    m_zero = NULL;
184    m_pool.m_shutdown = true;
185    m_pool.resetmem();
180   // Release the 0 string
181   if (m_zero != NULL)
182      sfree(m_zero);
183   m_zero = NULL;
184   m_pool.m_shutdown = true;
185   m_pool.resetmem();
186186}
187187
188188// ----------------------------------------------------------------------------------------
r26736r26737
191191
192192
193193pblockpool::pblockpool()
194    : m_shutdown(false)
195    , m_first(NULL)
196    , m_blocksize((DEBUG_MODE) ? 16384 : 16384)
197    , m_align(8)
194   : m_shutdown(false)
195   , m_first(NULL)
196   , m_blocksize((DEBUG_MODE) ? 16384 : 16384)
197   , m_align(8)
198198{
199199}
200200
r26736r26737
205205
206206void *pblockpool::alloc(const std::size_t n)
207207{
208    if (IMMEDIATE_MODE)
209        return (char *) malloc(n);
210    else
211    {
212        int memsize = ((n + m_align - 1) / m_align) * m_align;
213        int min_alloc = MAX(m_blocksize, memsize+sizeof(memblock)-MINDATASIZE);
214        char *ret = NULL;
215        //std::printf("m_first %p\n", m_first);
216        for (memblock *p = m_first; p != NULL && ret == NULL; p = p->next)
217        {
218            if (p->remaining > memsize)
219            {
220                ret = p->cur;
221                p->cur += memsize;
222                p->allocated += 1;
223                p->remaining -= memsize;
224            }
225        }
208   if (IMMEDIATE_MODE)
209      return (char *) malloc(n);
210   else
211   {
212      int memsize = ((n + m_align - 1) / m_align) * m_align;
213      int min_alloc = MAX(m_blocksize, memsize+sizeof(memblock)-MINDATASIZE);
214      char *ret = NULL;
215      //std::printf("m_first %p\n", m_first);
216      for (memblock *p = m_first; p != NULL && ret == NULL; p = p->next)
217      {
218         if (p->remaining > memsize)
219         {
220            ret = p->cur;
221            p->cur += memsize;
222            p->allocated += 1;
223            p->remaining -= memsize;
224         }
225      }
226226
227        if (ret == NULL)
228        {
229            // need to allocate a new block
230            memblock *p = (memblock *) malloc(min_alloc); //new char[min_alloc];
231            p->allocated = 0;
232            p->cur = &p->data[0];
233            p->size = p->remaining = min_alloc - (sizeof(memblock)-MINDATASIZE);
234            p->next = m_first;
235            //std::printf("allocated block size %d\n", sizeof(p->data));
227      if (ret == NULL)
228      {
229         // need to allocate a new block
230         memblock *p = (memblock *) malloc(min_alloc); //new char[min_alloc];
231         p->allocated = 0;
232         p->cur = &p->data[0];
233         p->size = p->remaining = min_alloc - (sizeof(memblock)-MINDATASIZE);
234         p->next = m_first;
235         //std::printf("allocated block size %d\n", sizeof(p->data));
236236
237            ret = p->cur;
238            p->cur += memsize;
239            p->allocated += 1;
240            p->remaining -= memsize;
237         ret = p->cur;
238         p->cur += memsize;
239         p->allocated += 1;
240         p->remaining -= memsize;
241241
242            m_first = p;
243        }
242         m_first = p;
243      }
244244
245        return ret;
246    }
245      return ret;
246   }
247247}
248248
249249void pblockpool::dealloc(void *ptr)
250250{
251    if (IMMEDIATE_MODE)
252        free(ptr);
253    else
254    {
255        for (memblock *p = m_first; p != NULL; p = p->next)
256        {
257            if (ptr >= &p->data[0] && ptr < &p->data[p->size])
258            {
259                p->allocated -= 1;
260                if (p->allocated < 0)
261                    std::fprintf(stderr, "nstring: memory corruption - crash likely\n");
262                if (p->allocated == 0)
263                {
264                    //std::printf("Block entirely freed\n");
265                    p->remaining = p->size;
266                    p->cur = &p->data[0];
267                }
268                // shutting down ?
269                if (m_shutdown)
270                    resetmem(); // try to free blocks
271                return;
272            }
273        }
274        std::fprintf(stderr, "nstring: string <%p> not found on free\n", ptr);
275    }
251   if (IMMEDIATE_MODE)
252      free(ptr);
253   else
254   {
255      for (memblock *p = m_first; p != NULL; p = p->next)
256      {
257         if (ptr >= &p->data[0] && ptr < &p->data[p->size])
258         {
259            p->allocated -= 1;
260            if (p->allocated < 0)
261               std::fprintf(stderr, "nstring: memory corruption - crash likely\n");
262            if (p->allocated == 0)
263            {
264               //std::printf("Block entirely freed\n");
265               p->remaining = p->size;
266               p->cur = &p->data[0];
267            }
268            // shutting down ?
269            if (m_shutdown)
270               resetmem(); // try to free blocks
271            return;
272         }
273      }
274      std::fprintf(stderr, "nstring: string <%p> not found on free\n", ptr);
275   }
276276}
277277
278278void pblockpool::resetmem()
279279{
280    if (!IMMEDIATE_MODE)
281    {
282        memblock **p = &m_first;
283        int totalblocks = 0;
284        int freedblocks = 0;
280   if (!IMMEDIATE_MODE)
281   {
282      memblock **p = &m_first;
283      int totalblocks = 0;
284      int freedblocks = 0;
285285
286        while (*p != NULL)
287        {
288            totalblocks++;
289            memblock **next = &((*p)->next);
290            if ((*p)->allocated == 0)
291            {
292                //std::printf("freeing block %p\n", *p);
293                memblock *freeme = *p;
294                *p = *next;
295                free(freeme); //delete[] *p;
296                freedblocks++;
297            }
298            else
299            {
300                //if (DEBUG_MODE)
301                //    std::printf("Allocated: <%s>\n", ((str_t *)(&(*p)->data[0]))->str());
286      while (*p != NULL)
287      {
288         totalblocks++;
289         memblock **next = &((*p)->next);
290         if ((*p)->allocated == 0)
291         {
292            //std::printf("freeing block %p\n", *p);
293            memblock *freeme = *p;
294            *p = *next;
295            free(freeme); //delete[] *p;
296            freedblocks++;
297         }
298         else
299         {
300            //if (DEBUG_MODE)
301            //    std::printf("Allocated: <%s>\n", ((str_t *)(&(*p)->data[0]))->str());
302302
303                p = next;
304            }
305        }
306        if (DEBUG_MODE)
307            std::printf("Freed %d out of total %d blocks\n", freedblocks, totalblocks);
308    }
303            p = next;
304         }
305      }
306      if (DEBUG_MODE)
307         std::printf("Freed %d out of total %d blocks\n", freedblocks, totalblocks);
308   }
309309}
trunk/src/emu/netlist/nl_setup.c
r26736r26737
1717   NETDEV_TTL_CONST(ttllow, 0)
1818   NETDEV_ANALOG_CONST(NC, NETLIST_HIGHIMP_V)
1919
20    NET_MODEL(".model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
21    NET_MODEL(".model 1N4148 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
22    NET_MODEL(".MODEL BC237B NPN(IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45V ICRATING=100M MFG=ZETEX)")
20   NET_MODEL(".model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
21   NET_MODEL(".model 1N4148 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)")
22   NET_MODEL(".MODEL BC237B NPN(IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45V ICRATING=100M MFG=ZETEX)")
2323
2424NETLIST_END
2525
r26736r26737
3030
3131netlist_setup_t::netlist_setup_t(netlist_base_t &netlist)
3232   : m_netlist(netlist)
33    , m_proxy_cnt(0)
33   , m_proxy_cnt(0)
3434{
35    netlist.set_setup(this);
35   netlist.set_setup(this);
3636}
3737
3838void netlist_setup_t::init()
3939{
40    m_factory.initialize();
41    NETLIST_NAME(base)(*this);
40   m_factory.initialize();
41   NETLIST_NAME(base)(*this);
4242}
4343
4444
r26736r26737
5959netlist_device_t *netlist_setup_t::register_dev(netlist_device_t *dev, const pstring &name)
6060{
6161   if (!(netlist().m_devices.add(name, dev, false)==TMERR_NONE))
62       netlist().xfatalerror("Error adding %s to device list\n", name.cstr());
62      netlist().xfatalerror("Error adding %s to device list\n", name.cstr());
6363   return dev;
6464}
6565
r26736r26737
8585   netlist_device_t *dev = netlist().m_devices.find(name);
8686   pstring temp = name + ".";
8787   if (dev == NULL)
88       netlist().xfatalerror("Device %s does not exist\n", name.cstr());
88      netlist().xfatalerror("Device %s does not exist\n", name.cstr());
8989
9090   //remove_start_with<tagmap_input_t>(m_inputs, temp);
9191   remove_start_with<tagmap_terminal_t>(m_terminals, temp);
r26736r26737
9494   tagmap_link_t::entry_t *p = m_links.first();
9595   while (p != NULL)
9696   {
97       tagmap_link_t::entry_t *n = m_links.next(p);
98       if (temp.equals(p->object().e1.substr(0,temp.len())) || temp.equals(p->object().e2.substr(0,temp.len())))
99           m_links.remove(p->object());
100       p = n;
97      tagmap_link_t::entry_t *n = m_links.next(p);
98      if (temp.equals(p->object().e1.substr(0,temp.len())) || temp.equals(p->object().e2.substr(0,temp.len())))
99         m_links.remove(p->object());
100      p = n;
101101   }
102102   netlist().m_devices.remove(name);
103103}
104104
105105void netlist_setup_t::register_model(const pstring &model)
106106{
107    m_models.add(model);
107   m_models.add(model);
108108}
109109
110110void netlist_setup_t::register_alias(const pstring &alias, const pstring &out)
111111{
112    //if (!(m_alias.add(alias, new nstring(out), false)==TMERR_NONE))
112   //if (!(m_alias.add(alias, new nstring(out), false)==TMERR_NONE))
113113   if (!(m_alias.add(alias, out, false)==TMERR_NONE))
114       netlist().xfatalerror("Error adding alias %s to alias list\n", alias.cstr());
114      netlist().xfatalerror("Error adding alias %s to alias list\n", alias.cstr());
115115}
116116
117117pstring netlist_setup_t::objtype_as_astr(netlist_object_t &in)
118118{
119    switch (in.type())
120    {
121        case netlist_terminal_t::TERMINAL:
122            return "TERMINAL";
123            break;
124        case netlist_terminal_t::INPUT:
125            return "INPUT";
126            break;
127        case netlist_terminal_t::OUTPUT:
128            return "OUTPUT";
129            break;
130        case netlist_terminal_t::NET:
131            return "NET";
132            break;
133        case netlist_terminal_t::PARAM:
134            return "PARAM";
135            break;
136        case netlist_terminal_t::DEVICE:
137            return "DEVICE";
138            break;
139        case netlist_terminal_t::NETLIST:
140            return "NETLIST";
141            break;
142    }
143    // FIXME: noreturn
144    netlist().xfatalerror("Unknown object type %d\n", in.type());
145    return "Error";
119   switch (in.type())
120   {
121      case netlist_terminal_t::TERMINAL:
122         return "TERMINAL";
123         break;
124      case netlist_terminal_t::INPUT:
125         return "INPUT";
126         break;
127      case netlist_terminal_t::OUTPUT:
128         return "OUTPUT";
129         break;
130      case netlist_terminal_t::NET:
131         return "NET";
132         break;
133      case netlist_terminal_t::PARAM:
134         return "PARAM";
135         break;
136      case netlist_terminal_t::DEVICE:
137         return "DEVICE";
138         break;
139      case netlist_terminal_t::NETLIST:
140         return "NETLIST";
141         break;
142   }
143   // FIXME: noreturn
144   netlist().xfatalerror("Unknown object type %d\n", in.type());
145   return "Error";
146146}
147147
148148void netlist_setup_t::register_object(netlist_device_t &dev, netlist_core_device_t &upd_dev, const pstring &name, netlist_object_t &obj, const netlist_input_t::state_e state)
149149{
150    switch (obj.type())
151    {
152        case netlist_terminal_t::TERMINAL:
153        case netlist_terminal_t::INPUT:
154        case netlist_terminal_t::OUTPUT:
155            {
156                netlist_core_terminal_t &term = dynamic_cast<netlist_core_terminal_t &>(obj);
157                if (obj.isType(netlist_terminal_t::OUTPUT))
158                    dynamic_cast<netlist_output_t &>(term).init_object(upd_dev, dev.name() + "." + name);
159                else
160                    term.init_object(upd_dev, dev.name() + "." + name, state);
150   switch (obj.type())
151   {
152      case netlist_terminal_t::TERMINAL:
153      case netlist_terminal_t::INPUT:
154      case netlist_terminal_t::OUTPUT:
155         {
156            netlist_core_terminal_t &term = dynamic_cast<netlist_core_terminal_t &>(obj);
157            if (obj.isType(netlist_terminal_t::OUTPUT))
158               dynamic_cast<netlist_output_t &>(term).init_object(upd_dev, dev.name() + "." + name);
159            else
160               term.init_object(upd_dev, dev.name() + "." + name, state);
161161
162                if (!(m_terminals.add(term.name(), &term, false)==TMERR_NONE))
163                    netlist().xfatalerror("Error adding %s %s to terminal list\n", objtype_as_astr(term).cstr(), term.name().cstr());
164                NL_VERBOSE_OUT(("%s %s\n", objtype_as_astr(term).cstr(), name.cstr()));
165            }
166            break;
167        case netlist_terminal_t::NET:
168            break;
169        case netlist_terminal_t::PARAM:
170            {
171                netlist_param_t &param = dynamic_cast<netlist_param_t &>(obj);
172                const pstring val = m_params_temp.find(name);
173                if (val != "")
174                {
175                    switch (param.param_type())
176                    {
177                        case netlist_param_t::DOUBLE:
178                        {
179                            NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", temp.cstr(), val->cstr()));
180                            double vald = 0;
181                            if (sscanf(val.cstr(), "%lf", &vald) != 1)
182                                netlist().xfatalerror("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
183                            dynamic_cast<netlist_param_double_t &>(param).initial(vald);
184                        }
185                        break;
186                        case netlist_param_t::INTEGER:
187                        case netlist_param_t::LOGIC:
188                        {
189                            NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", name.cstr(), val->cstr()));
190                            int vald = 0;
191                            if (sscanf(val.cstr(), "%d", &vald) != 1)
192                                netlist().xfatalerror("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
193                            dynamic_cast<netlist_param_int_t &>(param).initial(vald);
194                        }
195                        break;
196                        case netlist_param_t::STRING:
197                        {
198                            dynamic_cast<netlist_param_str_t &>(param).initial(val);
199                        }
200                        break;
201                        case netlist_param_t::MODEL:
202                        {
203                            pstring search = (".model " + val + " ").ucase();
204                            bool found = false;
205                            for (int i=0; i < m_models.count(); i++)
206                            {
207                                if (m_models[i].ucase().startsWith(search))
208                                {
209                                    int pl=m_models[i].find("(");
210                                    int pr=m_models[i].find("(");
211                                    dynamic_cast<netlist_param_model_t &>(param).initial(m_models[i].substr(pl+1,pr-pl-1));
212                                    found = true;
213                                    break;
214                                }
215                            }
216                            if (!found)
217                                netlist().xfatalerror("Model %s not found\n", val.cstr());
218                        }
219                        break;
220                        default:
221                            netlist().xfatalerror("Parameter is not supported %s : %s\n", name.cstr(), val.cstr());
222                    }
223                }
224                if (!(m_params.add(name, &param, false)==TMERR_NONE))
225                    netlist().xfatalerror("Error adding parameter %s to parameter list\n", name.cstr());
226            }
227            break;
228        case netlist_terminal_t::DEVICE:
229            netlist().xfatalerror("Device registration not yet supported - \n", name.cstr());
230            break;
231        case netlist_terminal_t::NETLIST:
232            netlist().xfatalerror("Netlist registration not yet supported - \n", name.cstr());
233            break;
234    }
162            if (!(m_terminals.add(term.name(), &term, false)==TMERR_NONE))
163               netlist().xfatalerror("Error adding %s %s to terminal list\n", objtype_as_astr(term).cstr(), term.name().cstr());
164            NL_VERBOSE_OUT(("%s %s\n", objtype_as_astr(term).cstr(), name.cstr()));
165         }
166         break;
167      case netlist_terminal_t::NET:
168         break;
169      case netlist_terminal_t::PARAM:
170         {
171            netlist_param_t &param = dynamic_cast<netlist_param_t &>(obj);
172            const pstring val = m_params_temp.find(name);
173            if (val != "")
174            {
175               switch (param.param_type())
176               {
177                  case netlist_param_t::DOUBLE:
178                  {
179                     NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", temp.cstr(), val->cstr()));
180                     double vald = 0;
181                     if (sscanf(val.cstr(), "%lf", &vald) != 1)
182                        netlist().xfatalerror("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
183                     dynamic_cast<netlist_param_double_t &>(param).initial(vald);
184                  }
185                  break;
186                  case netlist_param_t::INTEGER:
187                  case netlist_param_t::LOGIC:
188                  {
189                     NL_VERBOSE_OUT(("Found parameter ... %s : %s\n", name.cstr(), val->cstr()));
190                     int vald = 0;
191                     if (sscanf(val.cstr(), "%d", &vald) != 1)
192                        netlist().xfatalerror("Invalid number conversion %s : %s\n", name.cstr(), val.cstr());
193                     dynamic_cast<netlist_param_int_t &>(param).initial(vald);
194                  }
195                  break;
196                  case netlist_param_t::STRING:
197                  {
198                     dynamic_cast<netlist_param_str_t &>(param).initial(val);
199                  }
200                  break;
201                  case netlist_param_t::MODEL:
202                  {
203                     pstring search = (".model " + val + " ").ucase();
204                     bool found = false;
205                     for (int i=0; i < m_models.count(); i++)
206                     {
207                        if (m_models[i].ucase().startsWith(search))
208                        {
209                           int pl=m_models[i].find("(");
210                           int pr=m_models[i].find("(");
211                           dynamic_cast<netlist_param_model_t &>(param).initial(m_models[i].substr(pl+1,pr-pl-1));
212                           found = true;
213                           break;
214                        }
215                     }
216                     if (!found)
217                        netlist().xfatalerror("Model %s not found\n", val.cstr());
218                  }
219                  break;
220                  default:
221                     netlist().xfatalerror("Parameter is not supported %s : %s\n", name.cstr(), val.cstr());
222               }
223            }
224            if (!(m_params.add(name, &param, false)==TMERR_NONE))
225               netlist().xfatalerror("Error adding parameter %s to parameter list\n", name.cstr());
226         }
227         break;
228      case netlist_terminal_t::DEVICE:
229         netlist().xfatalerror("Device registration not yet supported - \n", name.cstr());
230         break;
231      case netlist_terminal_t::NETLIST:
232         netlist().xfatalerror("Netlist registration not yet supported - \n", name.cstr());
233         break;
234   }
235235}
236236
237237void netlist_setup_t::register_link(const pstring &sin, const pstring &sout)
238238{
239239   link_t temp = link_t(sin, sout);
240240   NL_VERBOSE_OUT(("link %s <== %s\n", sin.cstr(), sout.cstr()));
241    m_links.add(temp);
241   m_links.add(temp);
242242   //if (!(m_links.add(sin + "." + sout, temp, false)==TMERR_NONE))
243   //   fatalerror("Error adding link %s<==%s to link list\n", sin.cstr(), sout.cstr());
243   //  fatalerror("Error adding link %s<==%s to link list\n", sin.cstr(), sout.cstr());
244244}
245245
246246void netlist_setup_t::register_param(const pstring &param, const double value)
247247{
248    // FIXME: there should be a better way
249    register_param(param, pstring::sprintf("%.9e", value));
248   // FIXME: there should be a better way
249   register_param(param, pstring::sprintf("%.9e", value));
250250}
251251
252252void netlist_setup_t::register_param(const pstring &param, const pstring &value)
253253{
254    //if (!(m_params_temp.add(param, new nstring(value), false)==TMERR_NONE))
255    if (!(m_params_temp.add(param, value, false)==TMERR_NONE))
256        netlist().xfatalerror("Error adding parameter %s to parameter list\n", param.cstr());
254   //if (!(m_params_temp.add(param, new nstring(value), false)==TMERR_NONE))
255   if (!(m_params_temp.add(param, value, false)==TMERR_NONE))
256      netlist().xfatalerror("Error adding parameter %s to parameter list\n", param.cstr());
257257}
258258
259259const pstring netlist_setup_t::resolve_alias(const pstring &name) const
260260{
261    pstring temp = name;
262    pstring ret;
261   pstring temp = name;
262   pstring ret;
263263
264    /* FIXME: Detect endless loop */
265    do {
266        ret = temp;
267        temp = m_alias.find(ret);
268    } while (temp != "");
264   /* FIXME: Detect endless loop */
265   do {
266      ret = temp;
267      temp = m_alias.find(ret);
268   } while (temp != "");
269269
270    int p = ret.find(".[");
270   int p = ret.find(".[");
271271   if (p > 0)
272272   {
273       pstring dname = ret;
274       netlist_device_t *dev = netlist().m_devices.find(dname.substr(0,p));
275       if (dev == NULL)
276           netlist().xfatalerror("Device for %s not found\n", name.cstr());
277       int c = atoi(ret.substr(p+2,ret.len()-p-3));
278       temp = dev->name() + "." + dev->m_terminals[c];
279       // reresolve ....
280       do {
281           ret = temp;
282           temp = m_alias.find(ret);
283       } while (temp != "");
273      pstring dname = ret;
274      netlist_device_t *dev = netlist().m_devices.find(dname.substr(0,p));
275      if (dev == NULL)
276         netlist().xfatalerror("Device for %s not found\n", name.cstr());
277      int c = atoi(ret.substr(p+2,ret.len()-p-3));
278      temp = dev->name() + "." + dev->m_terminals[c];
279      // reresolve ....
280      do {
281         ret = temp;
282         temp = m_alias.find(ret);
283      } while (temp != "");
284284   }
285285
286286   NL_VERBOSE_OUT(("%s==>%s\n", name.cstr(), ret.cstr()));
r26736r26737
289289
290290netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_in, bool required)
291291{
292    const pstring &tname = resolve_alias(terminal_in);
293    netlist_core_terminal_t *ret;
292   const pstring &tname = resolve_alias(terminal_in);
293   netlist_core_terminal_t *ret;
294294
295    ret = m_terminals.find(tname);
296    /* look for default */
297    if (ret == NULL)
298    {
299        /* look for ".Q" std output */
300        pstring s = tname + ".Q";
301        ret = m_terminals.find(s);
302    }
303    if (ret == NULL && required)
304        netlist().xfatalerror("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr());
305    if (ret != NULL)
306        NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
307    return ret;
295   ret = m_terminals.find(tname);
296   /* look for default */
297   if (ret == NULL)
298   {
299      /* look for ".Q" std output */
300      pstring s = tname + ".Q";
301      ret = m_terminals.find(s);
302   }
303   if (ret == NULL && required)
304      netlist().xfatalerror("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr());
305   if (ret != NULL)
306      NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
307   return ret;
308308}
309309
310310netlist_core_terminal_t *netlist_setup_t::find_terminal(const pstring &terminal_in, netlist_object_t::type_t atype, bool required)
r26736r26737
322322   }
323323   if (ret == NULL && required)
324324      netlist().xfatalerror("terminal %s(%s) not found!\n", terminal_in.cstr(), tname.cstr());
325    if (ret != NULL && ret->type() != atype)
326    {
327        if (required)
328            netlist().xfatalerror("object %s(%s) found but wrong type\n", terminal_in.cstr(), tname.cstr());
329        else
330            ret = NULL;
331    }
332    if (ret != NULL)
333        NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
325   if (ret != NULL && ret->type() != atype)
326   {
327      if (required)
328         netlist().xfatalerror("object %s(%s) found but wrong type\n", terminal_in.cstr(), tname.cstr());
329      else
330         ret = NULL;
331   }
332   if (ret != NULL)
333      NL_VERBOSE_OUT(("Found input %s\n", tname.cstr()));
334334   return ret;
335335}
336336
r26736r26737
341341
342342   ret = m_params.find(outname);
343343   if (ret == NULL && required)
344       netlist().xfatalerror("parameter %s(%s) not found!\n", param_in.cstr(), outname.cstr());
344      netlist().xfatalerror("parameter %s(%s) not found!\n", param_in.cstr(), outname.cstr());
345345   if (ret != NULL)
346       NL_VERBOSE_OUT(("Found parameter %s\n", outname.cstr()));
346      NL_VERBOSE_OUT(("Found parameter %s\n", outname.cstr()));
347347   return ret;
348348}
349349
350350
351351void netlist_setup_t::connect_input_output(netlist_input_t &in, netlist_output_t &out)
352352{
353    if (out.isFamily(netlist_terminal_t::ANALOG) && in.isFamily(netlist_terminal_t::LOGIC))
354    {
355        nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(in);
356        pstring x = pstring::sprintf("proxy_ad_%d", m_proxy_cnt);
357        m_proxy_cnt++;
353   if (out.isFamily(netlist_terminal_t::ANALOG) && in.isFamily(netlist_terminal_t::LOGIC))
354   {
355      nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(in);
356      pstring x = pstring::sprintf("proxy_ad_%d", m_proxy_cnt);
357      m_proxy_cnt++;
358358
359        proxy->init(netlist(), x);
360        register_dev(proxy, x);
359      proxy->init(netlist(), x);
360      register_dev(proxy, x);
361361
362        proxy->m_Q.net().register_con(in);
363        out.net().register_con(proxy->m_I);
362      proxy->m_Q.net().register_con(in);
363      out.net().register_con(proxy->m_I);
364364
365    }
366    else if (out.isFamily(netlist_terminal_t::LOGIC) && in.isFamily(netlist_terminal_t::ANALOG))
367    {
368        nld_d_to_a_proxy *proxy = new nld_d_to_a_proxy(out);
369        pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
370        m_proxy_cnt++;
365   }
366   else if (out.isFamily(netlist_terminal_t::LOGIC) && in.isFamily(netlist_terminal_t::ANALOG))
367   {
368      nld_d_to_a_proxy *proxy = new nld_d_to_a_proxy(out);
369      pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
370      m_proxy_cnt++;
371371
372        proxy->init(netlist(), x);
373        register_dev(proxy, x);
372      proxy->init(netlist(), x);
373      register_dev(proxy, x);
374374
375        proxy->m_Q.net().register_con(in);
376        out.net().register_con(proxy->m_I);
377    }
378    else
379    {
380        out.net().register_con(in);
381    }
375      proxy->m_Q.net().register_con(in);
376      out.net().register_con(proxy->m_I);
377   }
378   else
379   {
380      out.net().register_con(in);
381   }
382382}
383383
384384void netlist_setup_t::connect_terminal_input(netlist_terminal_t &term, netlist_input_t &inp)
385385{
386    if (inp.isFamily(netlist_terminal_t::ANALOG))
387    {
388        connect_terminals(inp, term);
389    }
390    else if (inp.isFamily(netlist_terminal_t::LOGIC))
391    {
392        NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n"));
393        nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(inp);
394        pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
395        m_proxy_cnt++;
386   if (inp.isFamily(netlist_terminal_t::ANALOG))
387   {
388      connect_terminals(inp, term);
389   }
390   else if (inp.isFamily(netlist_terminal_t::LOGIC))
391   {
392      NL_VERBOSE_OUT(("connect_terminal_input: connecting proxy\n"));
393      nld_a_to_d_proxy *proxy = new nld_a_to_d_proxy(inp);
394      pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
395      m_proxy_cnt++;
396396
397        proxy->init(netlist(), x);
398        register_dev(proxy, x);
397      proxy->init(netlist(), x);
398      register_dev(proxy, x);
399399
400        connect_terminals(term, proxy->m_I);
400      connect_terminals(term, proxy->m_I);
401401
402        if (inp.has_net())
403            //fatalerror("logic inputs can only belong to one net!\n");
404            proxy->m_Q.net().merge_net(&inp.net());
405        else
406            proxy->m_Q.net().register_con(inp);
407    }
408    else
409    {
410        netlist().xfatalerror("Netlist: Severe Error");
411    }
402      if (inp.has_net())
403         //fatalerror("logic inputs can only belong to one net!\n");
404         proxy->m_Q.net().merge_net(&inp.net());
405      else
406         proxy->m_Q.net().register_con(inp);
407   }
408   else
409   {
410      netlist().xfatalerror("Netlist: Severe Error");
411   }
412412}
413413
414414// FIXME: optimize code  ...
415415void netlist_setup_t::connect_terminal_output(netlist_terminal_t &in, netlist_output_t &out)
416416{
417    if (out.isFamily(netlist_terminal_t::ANALOG))
418    {
419        /* no proxy needed, just merge existing terminal net */
420        if (in.has_net())
421            out.net().merge_net(&in.net());
422        else
423            out.net().register_con(in);
417   if (out.isFamily(netlist_terminal_t::ANALOG))
418   {
419      /* no proxy needed, just merge existing terminal net */
420      if (in.has_net())
421         out.net().merge_net(&in.net());
422      else
423         out.net().register_con(in);
424424
425    }
426    else if (out.isFamily(netlist_terminal_t::LOGIC))
427    {
428        NL_VERBOSE_OUT(("connect_terminal_output: connecting proxy\n"));
429        nld_d_to_a_proxy *proxy = new nld_d_to_a_proxy(out);
430        pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
431        m_proxy_cnt++;
425   }
426   else if (out.isFamily(netlist_terminal_t::LOGIC))
427   {
428      NL_VERBOSE_OUT(("connect_terminal_output: connecting proxy\n"));
429      nld_d_to_a_proxy *proxy = new nld_d_to_a_proxy(out);
430      pstring x = pstring::sprintf("proxy_da_%d", m_proxy_cnt);
431      m_proxy_cnt++;
432432
433        proxy->init(netlist(), x);
434        register_dev(proxy, x);
433      proxy->init(netlist(), x);
434      register_dev(proxy, x);
435435
436        out.net().register_con(proxy->m_I);
436      out.net().register_con(proxy->m_I);
437437
438        if (in.has_net())
439            proxy->m_Q.net().merge_net(&in.net());
440        else
441            proxy->m_Q.net().register_con(in);
442    }
443    else
444    {
445        netlist().xfatalerror("Netlist: Severe Error");
446    }
438      if (in.has_net())
439         proxy->m_Q.net().merge_net(&in.net());
440      else
441         proxy->m_Q.net().register_con(in);
442   }
443   else
444   {
445      netlist().xfatalerror("Netlist: Severe Error");
446   }
447447}
448448
449449void netlist_setup_t::connect_terminals(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2)
450450{
451    //assert(in.isType(netlist_terminal_t::TERMINAL));
452    //assert(out.isType(netlist_terminal_t::TERMINAL));
451   //assert(in.isType(netlist_terminal_t::TERMINAL));
452   //assert(out.isType(netlist_terminal_t::TERMINAL));
453453
454    if (t1.has_net() && t2.has_net())
455    {
456        NL_VERBOSE_OUT(("T2 and T1 have net\n"));
457        t1.net().merge_net(&t2.net());
458    }
459    else if (t2.has_net())
460    {
461        NL_VERBOSE_OUT(("T2 has net\n"));
462        t2.net().register_con(t1);
463    }
464    else if (t1.has_net())
465    {
466        NL_VERBOSE_OUT(("T1 has net\n"));
467        t1.net().register_con(t2);
468    }
469    else
470    {
471        NL_VERBOSE_OUT(("adding net ...\n"));
472        netlist_net_t *anet =  new netlist_net_t(netlist_object_t::NET, netlist_object_t::ANALOG);
473        t1.set_net(*anet);
474        //m_netlist.solver()->m_nets.add(anet);
475        // FIXME: Nets should have a unique name
476        t1.net().init_object(netlist(),"net." + t1.name() );
477        t1.net().register_con(t2);
478        t1.net().register_con(t1);
479    }
454   if (t1.has_net() && t2.has_net())
455   {
456      NL_VERBOSE_OUT(("T2 and T1 have net\n"));
457      t1.net().merge_net(&t2.net());
458   }
459   else if (t2.has_net())
460   {
461      NL_VERBOSE_OUT(("T2 has net\n"));
462      t2.net().register_con(t1);
463   }
464   else if (t1.has_net())
465   {
466      NL_VERBOSE_OUT(("T1 has net\n"));
467      t1.net().register_con(t2);
468   }
469   else
470   {
471      NL_VERBOSE_OUT(("adding net ...\n"));
472      netlist_net_t *anet =  new netlist_net_t(netlist_object_t::NET, netlist_object_t::ANALOG);
473      t1.set_net(*anet);
474      //m_netlist.solver()->m_nets.add(anet);
475      // FIXME: Nets should have a unique name
476      t1.net().init_object(netlist(),"net." + t1.name() );
477      t1.net().register_con(t2);
478      t1.net().register_con(t1);
479   }
480480}
481481
482482void netlist_setup_t::connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2)
483483{
484    NL_VERBOSE_OUT(("Connecting %s to %s\n", t1.name().cstr(), t2.name().cstr()));
485    // FIXME: amend device design so that warnings can be turned into errors
486    //        Only variable inputs have this issue
487    if (t1.isType(netlist_core_terminal_t::OUTPUT) && t2.isType(netlist_core_terminal_t::INPUT))
488    {
489        if (t2.has_net())
490            NL_VERBOSE_OUT(("Input %s already connected\n", t2.name().cstr()));
491        connect_input_output(dynamic_cast<netlist_input_t &>(t2), dynamic_cast<netlist_output_t &>(t1));
492    }
493    else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::OUTPUT))
494    {
495        if (t1.has_net())
496            NL_VERBOSE_OUT(("Input %s already connected\n", t1.name().cstr()));
497        connect_input_output(dynamic_cast<netlist_input_t &>(t1), dynamic_cast<netlist_output_t &>(t2));
498    }
499    else if (t1.isType(netlist_core_terminal_t::OUTPUT) && t2.isType(netlist_core_terminal_t::TERMINAL))
500    {
501        connect_terminal_output(dynamic_cast<netlist_terminal_t &>(t2), dynamic_cast<netlist_output_t &>(t1));
502    }
503    else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::OUTPUT))
504    {
505        connect_terminal_output(dynamic_cast<netlist_terminal_t &>(t1), dynamic_cast<netlist_output_t &>(t2));
506    }
507    else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::TERMINAL))
508    {
509        connect_terminal_input(dynamic_cast<netlist_terminal_t &>(t2), dynamic_cast<netlist_input_t &>(t1));
510    }
511    else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::INPUT))
512    {
513        connect_terminal_input(dynamic_cast<netlist_terminal_t &>(t1), dynamic_cast<netlist_input_t &>(t2));
514    }
515    else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::TERMINAL))
516    {
517        connect_terminals(dynamic_cast<netlist_terminal_t &>(t1), dynamic_cast<netlist_terminal_t &>(t2));
518    }
519    else
520        netlist().xfatalerror("Connecting %s to %s not supported!\n", t1.name().cstr(), t2.name().cstr());
484   NL_VERBOSE_OUT(("Connecting %s to %s\n", t1.name().cstr(), t2.name().cstr()));
485   // FIXME: amend device design so that warnings can be turned into errors
486   //        Only variable inputs have this issue
487   if (t1.isType(netlist_core_terminal_t::OUTPUT) && t2.isType(netlist_core_terminal_t::INPUT))
488   {
489      if (t2.has_net())
490         NL_VERBOSE_OUT(("Input %s already connected\n", t2.name().cstr()));
491      connect_input_output(dynamic_cast<netlist_input_t &>(t2), dynamic_cast<netlist_output_t &>(t1));
492   }
493   else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::OUTPUT))
494   {
495      if (t1.has_net())
496         NL_VERBOSE_OUT(("Input %s already connected\n", t1.name().cstr()));
497      connect_input_output(dynamic_cast<netlist_input_t &>(t1), dynamic_cast<netlist_output_t &>(t2));
498   }
499   else if (t1.isType(netlist_core_terminal_t::OUTPUT) && t2.isType(netlist_core_terminal_t::TERMINAL))
500   {
501      connect_terminal_output(dynamic_cast<netlist_terminal_t &>(t2), dynamic_cast<netlist_output_t &>(t1));
502   }
503   else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::OUTPUT))
504   {
505      connect_terminal_output(dynamic_cast<netlist_terminal_t &>(t1), dynamic_cast<netlist_output_t &>(t2));
506   }
507   else if (t1.isType(netlist_core_terminal_t::INPUT) && t2.isType(netlist_core_terminal_t::TERMINAL))
508   {
509      connect_terminal_input(dynamic_cast<netlist_terminal_t &>(t2), dynamic_cast<netlist_input_t &>(t1));
510   }
511   else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::INPUT))
512   {
513      connect_terminal_input(dynamic_cast<netlist_terminal_t &>(t1), dynamic_cast<netlist_input_t &>(t2));
514   }
515   else if (t1.isType(netlist_core_terminal_t::TERMINAL) && t2.isType(netlist_core_terminal_t::TERMINAL))
516   {
517      connect_terminals(dynamic_cast<netlist_terminal_t &>(t1), dynamic_cast<netlist_terminal_t &>(t2));
518   }
519   else
520      netlist().xfatalerror("Connecting %s to %s not supported!\n", t1.name().cstr(), t2.name().cstr());
521521}
522522
523523void netlist_setup_t::resolve_inputs()
524524{
525   NL_VERBOSE_OUT(("Resolving ...\n"));
526   for (tagmap_link_t::entry_t *entry = m_links.first(); entry != NULL; entry = m_links.next(entry))
527   {
528      const pstring t1s = entry->object().e1;
529      const pstring t2s = entry->object().e2;
530      netlist_core_terminal_t *t1 = find_terminal(t1s);
531      netlist_core_terminal_t *t2 = find_terminal(t2s);
525532
526    NL_VERBOSE_OUT(("Resolving ...\n"));
527    for (tagmap_link_t::entry_t *entry = m_links.first(); entry != NULL; entry = m_links.next(entry))
528    {
529        const pstring t1s = entry->object().e1;
530        const pstring t2s = entry->object().e2;
531        netlist_core_terminal_t *t1 = find_terminal(t1s);
532        netlist_core_terminal_t *t2 = find_terminal(t2s);
533      connect(*t1, *t2);
534   }
533535
534        connect(*t1, *t2);
535    }
536   /* print all outputs */
537   for (tagmap_terminal_t::entry_t *entry = m_terminals.first(); entry != NULL; entry = m_terminals.next(entry))
538   {
539      ATTR_UNUSED netlist_output_t *out = dynamic_cast<netlist_output_t *>(entry->object());
540      //if (out != NULL)
541         //VERBOSE_OUT(("%s %d\n", out->netdev()->name(), *out->Q_ptr()));
542   }
536543
537    /* print all outputs */
538    for (tagmap_terminal_t::entry_t *entry = m_terminals.first(); entry != NULL; entry = m_terminals.next(entry))
539    {
540        ATTR_UNUSED netlist_output_t *out = dynamic_cast<netlist_output_t *>(entry->object());
541        //if (out != NULL)
542            //VERBOSE_OUT(("%s %d\n", out->netdev()->name(), *out->Q_ptr()));
543    }
544
545544#if 0
546    NL_VERBOSE_OUT(("deleting empty nets ...\n"));
545   NL_VERBOSE_OUT(("deleting empty nets ...\n"));
547546
548    // delete empty nets ...
549    for (netlist_net_t::list_t::entry_t *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
550    {
551        if (pn->object()->m_head == NULL)
552        {
553            NL_VERBOSE_OUT(("Deleting net ...\n"));
554            netlist_net_t *to_delete = pn->object();
555            netlist().m_nets.remove(to_delete);
556            if (!to_delete->isRailNet())
557                delete to_delete;
558            pn--;
559        }
560    }
547   // delete empty nets ...
548   for (netlist_net_t::list_t::entry_t *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
549   {
550      if (pn->object()->m_head == NULL)
551      {
552         NL_VERBOSE_OUT(("Deleting net ...\n"));
553         netlist_net_t *to_delete = pn->object();
554         netlist().m_nets.remove(to_delete);
555         if (!to_delete->isRailNet())
556            delete to_delete;
557         pn--;
558      }
559   }
561560#endif
562    if (m_netlist.solver() != NULL)
563        m_netlist.solver()->post_start();
561   if (m_netlist.solver() != NULL)
562      m_netlist.solver()->post_start();
564563
565564
566565}
567566
568567void netlist_setup_t::start_devices()
569568{
569   if (getenv("NL_LOGS"))
570   {
571      NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
572      nl_util::pstring_list ll = nl_util::split(getenv("NL_LOGS"), ":");
573      for (int i=0; i < ll.count(); i++)
574      {
575         NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
576         netlist_device_t *nc = factory().new_device_by_classname("nld_log", *this);
577         pstring name = "log_" + ll[i];
578         register_dev(nc, name);
579         register_link(name + ".I", ll[i]);
580      }
581   }
570582
571    if (getenv("NL_LOGS"))
572    {
573        NL_VERBOSE_OUT(("Creating dynamic logs ...\n"));
574        nl_util::pstring_list ll = nl_util::split(getenv("NL_LOGS"), ":");
575        for (int i=0; i < ll.count(); i++)
576        {
577            NL_VERBOSE_OUT(("%d: <%s>\n",i, ll[i].cstr()));
578            netlist_device_t *nc = factory().new_device_by_classname("nld_log", *this);
579            pstring name = "log_" + ll[i];
580            register_dev(nc, name);
581            register_link(name + ".I", ll[i]);
582        }
583    }
584583
584   NL_VERBOSE_OUT(("Searching for mainclock and solver ...\n"));
585   /* find the main clock ... */
586   for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
587   {
588      netlist_device_t *dev = entry->object();
589      if (dynamic_cast<NETLIB_NAME(mainclock)*>(dev) != NULL)
590      {
591         m_netlist.set_mainclock_dev(dynamic_cast<NETLIB_NAME(mainclock)*>(dev));
592      }
593      if (dynamic_cast<NETLIB_NAME(solver)*>(dev) != NULL)
594      {
595         m_netlist.set_solver_dev(dynamic_cast<NETLIB_NAME(solver)*>(dev));
596      }
597   }
585598
586    NL_VERBOSE_OUT(("Searching for mainclock and solver ...\n"));
587    /* find the main clock ... */
588    for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
589    {
590        netlist_device_t *dev = entry->object();
591        if (dynamic_cast<NETLIB_NAME(mainclock)*>(dev) != NULL)
592        {
593            m_netlist.set_mainclock_dev(dynamic_cast<NETLIB_NAME(mainclock)*>(dev));
594        }
595        if (dynamic_cast<NETLIB_NAME(solver)*>(dev) != NULL)
596        {
597            m_netlist.set_solver_dev(dynamic_cast<NETLIB_NAME(solver)*>(dev));
598        }
599    }
599   NL_VERBOSE_OUT(("Initializing devices ...\n"));
600   for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
601   {
602      netlist_device_t *dev = entry->object();
603      dev->init(netlist(), entry->tag().cstr());
604   }
600605
601    NL_VERBOSE_OUT(("Initializing devices ...\n"));
602    for (tagmap_devices_t::entry_t *entry = netlist().m_devices.first(); entry != NULL; entry = netlist().m_devices.next(entry))
603    {
604        netlist_device_t *dev = entry->object();
605        dev->init(netlist(), entry->tag().cstr());
606    }
607
608606}
609607
610608void netlist_setup_t::parse(const char *buf)
trunk/src/emu/netlist/nl_parser.h
r26736r26737
1212
1313class netlist_parser
1414{
15    NETLIST_PREVENT_COPYING(netlist_parser)
15   NETLIST_PREVENT_COPYING(netlist_parser)
1616public:
1717   netlist_parser(netlist_setup_t &setup)
1818   : m_setup(setup) {}
r26736r26737
2020   void parse(const char *buf);
2121   void net_alias();
2222   void netdev_param();
23    void net_c();
23   void net_c();
2424   void netdev_const(const pstring &dev_name);
2525   void netdev_device(const pstring &dev_type);
26    void netdev_device(const pstring &dev_type, const pstring &default_param, bool isString = false);
26   void netdev_device(const pstring &dev_type, const pstring &default_param, bool isString = false);
2727
2828private:
2929
trunk/src/emu/netlist/pstring.h
r26736r26737
1515// ----------------------------------------------------------------------------------------
1616
1717struct pblockpool {
18    NETLIST_PREVENT_COPYING(pblockpool)
18   NETLIST_PREVENT_COPYING(pblockpool)
1919public:
20    static const int MINDATASIZE = 8;
20   static const int MINDATASIZE = 8;
2121
22    pblockpool();
23    ~pblockpool();
22   pblockpool();
23   ~pblockpool();
2424
25    void resetmem();
25   void resetmem();
2626
27    void *alloc(std::size_t n);
28    void dealloc(void *ptr);
27   void *alloc(std::size_t n);
28   void dealloc(void *ptr);
2929
30    template<class T>
31    void destroy(T* object)
32    {
33        object->~T();
34        dealloc(object);
35    }
36    bool m_shutdown;
30   template<class T>
31   void destroy(T* object)
32   {
33      object->~T();
34      dealloc(object);
35   }
36   bool m_shutdown;
3737
3838private:
39    struct memblock
40    {
41        memblock *next;
42        int size;
43        int allocated;
44        int remaining;
45        char *cur;
46        char data[MINDATASIZE];
47    };
39   struct memblock
40   {
41      memblock *next;
42      int size;
43      int allocated;
44      int remaining;
45      char *cur;
46      char data[MINDATASIZE];
47   };
4848
49    memblock *m_first;
50    int m_blocksize;
51    int m_align;
49   memblock *m_first;
50   int m_blocksize;
51   int m_align;
5252};
5353
5454/* objects must be destroyed using destroy above */
5555
5656inline void *operator new(std::size_t size, pblockpool &pool, int extra = 0) throw (std::bad_alloc)
5757{
58    void *result = pool.alloc(size + extra);
59    //std::printf("allocating %ld + %d\n", size, extra);
60    if (result == NULL)
61        throw std::bad_alloc();
62    return result;
58   void *result = pool.alloc(size + extra);
59   //std::printf("allocating %ld + %d\n", size, extra);
60   if (result == NULL)
61      throw std::bad_alloc();
62   return result;
6363}
6464
6565inline void operator delete(void *pMem, pblockpool &pool, int extra)
6666{
67    pool.dealloc(pMem);
67   pool.dealloc(pMem);
6868}
6969
7070// ----------------------------------------------------------------------------------------
r26736r26737
7777struct pstring
7878{
7979public:
80    // simple construction/destruction
81    pstring()
82    {
83        init();
84    }
85    ~pstring();
80   // simple construction/destruction
81   pstring()
82   {
83      init();
84   }
85   ~pstring();
8686
87    // construction with copy
88    pstring(const char *string) {init(); if (string != NULL && *string != 0) pcopy(string); }
89    pstring(const pstring &string) {init(); pcopy(string); }
87   // construction with copy
88   pstring(const char *string) {init(); if (string != NULL && *string != 0) pcopy(string); }
89   pstring(const pstring &string) {init(); pcopy(string); }
9090
91    // assignment operators
92    pstring &operator=(const char *string) { pcopy(string); return *this; }
93    pstring &operator=(const pstring &string) { pcopy(string); return *this; }
91   // assignment operators
92   pstring &operator=(const char *string) { pcopy(string); return *this; }
93   pstring &operator=(const pstring &string) { pcopy(string); return *this; }
9494
95    // C string conversion operators and helpers
96    operator const char *() const { return m_ptr->str(); }
97    inline const char *cstr() const { return m_ptr->str(); }
95   // C string conversion operators and helpers
96   operator const char *() const { return m_ptr->str(); }
97   inline const char *cstr() const { return m_ptr->str(); }
9898
99    // concatenation operators
100    pstring& operator+=(const pstring &string) { pcat(string.cstr()); return *this; }
101    friend pstring operator+(const pstring &lhs, const pstring &rhs) { return pstring(lhs) += rhs; }
102    friend pstring operator+(const pstring &lhs, const char *rhs) { return pstring(lhs) += rhs; }
103    friend pstring operator+(const char *lhs, const pstring &rhs) { return pstring(lhs) += rhs; }
99   // concatenation operators
100   pstring& operator+=(const pstring &string) { pcat(string.cstr()); return *this; }
101   friend pstring operator+(const pstring &lhs, const pstring &rhs) { return pstring(lhs) += rhs; }
102   friend pstring operator+(const pstring &lhs, const char *rhs) { return pstring(lhs) += rhs; }
103   friend pstring operator+(const char *lhs, const pstring &rhs) { return pstring(lhs) += rhs; }
104104
105    // comparison operators
106    bool operator==(const char *string) const { return (pcmp(string) == 0); }
107    bool operator==(const pstring &string) const { return (pcmp(string.cstr()) == 0); }
108    bool operator!=(const char *string) const { return (pcmp(string) != 0); }
109    bool operator!=(const pstring &string) const { return (pcmp(string.cstr()) != 0); }
110    bool operator<(const char *string) const { return (pcmp(string) < 0); }
111    bool operator<(const pstring &string) const { return (pcmp(string.cstr()) < 0); }
112    bool operator<=(const char *string) const { return (pcmp(string) <= 0); }
113    bool operator<=(const pstring &string) const { return (pcmp(string.cstr()) <= 0); }
114    bool operator>(const char *string) const { return (pcmp(string) > 0); }
115    bool operator>(const pstring &string) const { return (pcmp(string.cstr()) > 0); }
116    bool operator>=(const char *string) const { return (pcmp(string) >= 0); }
117    bool operator>=(const pstring &string) const { return (pcmp(string.cstr()) >= 0); }
105   // comparison operators
106   bool operator==(const char *string) const { return (pcmp(string) == 0); }
107   bool operator==(const pstring &string) const { return (pcmp(string.cstr()) == 0); }
108   bool operator!=(const char *string) const { return (pcmp(string) != 0); }
109   bool operator!=(const pstring &string) const { return (pcmp(string.cstr()) != 0); }
110   bool operator<(const char *string) const { return (pcmp(string) < 0); }
111   bool operator<(const pstring &string) const { return (pcmp(string.cstr()) < 0); }
112   bool operator<=(const char *string) const { return (pcmp(string) <= 0); }
113   bool operator<=(const pstring &string) const { return (pcmp(string.cstr()) <= 0); }
114   bool operator>(const char *string) const { return (pcmp(string) > 0); }
115   bool operator>(const pstring &string) const { return (pcmp(string.cstr()) > 0); }
116   bool operator>=(const char *string) const { return (pcmp(string) >= 0); }
117   bool operator>=(const pstring &string) const { return (pcmp(string.cstr()) >= 0); }
118118
119    //
120    inline int len() const { return m_ptr->len(); }
119   //
120   inline int len() const { return m_ptr->len(); }
121121
122    inline bool equals(const pstring &string) { return (pcmp(string.cstr(), m_ptr->str()) == 0); }
123    inline bool iequals(const pstring &string) { return (pcmpi(string.cstr(), m_ptr->str()) == 0); }
122   inline bool equals(const pstring &string) { return (pcmp(string.cstr(), m_ptr->str()) == 0); }
123   inline bool iequals(const pstring &string) { return (pcmpi(string.cstr(), m_ptr->str()) == 0); }
124124
125    inline int cmp(const pstring &string) const { return pcmp(string.cstr()); }
126    inline int cmpi(const pstring &string) const { return pcmpi(cstr(), string.cstr()); }
125   inline int cmp(const pstring &string) const { return pcmp(string.cstr()); }
126   inline int cmpi(const pstring &string) const { return pcmpi(cstr(), string.cstr()); }
127127
128    inline int find(const char *search, int start = 0) const
129    {
130        int alen = len();
131        const char *result = strstr(cstr() + MIN(start, alen), search);
132        return (result != NULL) ? (result - cstr()) : -1;
133    }
128   inline int find(const char *search, int start = 0) const
129   {
130      int alen = len();
131      const char *result = strstr(cstr() + MIN(start, alen), search);
132      return (result != NULL) ? (result - cstr()) : -1;
133   }
134134
135    // various
135   // various
136136
137    inline bool startsWith(const pstring &arg) const { return (pcmp(cstr(), arg.cstr(), arg.len()) == 0); }
138    inline bool startsWith(const char *arg) const { return (pcmp(cstr(), arg, strlen(arg)) == 0); }
137   inline bool startsWith(const pstring &arg) const { return (pcmp(cstr(), arg.cstr(), arg.len()) == 0); }
138   inline bool startsWith(const char *arg) const { return (pcmp(cstr(), arg, strlen(arg)) == 0); }
139139
140    // these return nstring ...
141    inline pstring cat(const pstring &s) const { return *this + s; }
142    inline pstring cat(const char *s) const { return *this + s; }
140   // these return nstring ...
141   inline pstring cat(const pstring &s) const { return *this + s; }
142   inline pstring cat(const char *s) const { return *this + s; }
143143
144    pstring substr(unsigned int start, int count = -1) const ;
144   pstring substr(unsigned int start, int count = -1) const ;
145145
146    inline pstring left(unsigned int count) const { return substr(0, count); }
147    inline pstring right(unsigned int count) const  { return substr(len() - count, count); }
146   inline pstring left(unsigned int count) const { return substr(0, count); }
147   inline pstring right(unsigned int count) const  { return substr(len() - count, count); }
148148
149    pstring ucase() const;
149   pstring ucase() const;
150150
151    // conversions
151   // conversions
152152
153    double as_double(bool *error = NULL) const;
153   double as_double(bool *error = NULL) const;
154154
155    long as_long(bool *error = NULL) const;
155   long as_long(bool *error = NULL) const;
156156
157    // printf using string as format ...
157   // printf using string as format ...
158158
159    pstring vprintf(va_list args) const;
159   pstring vprintf(va_list args) const;
160160
161    // static
162    static pstring sprintf(const char *format, ...);
163    static void resetmem();
161   // static
162   static pstring sprintf(const char *format, ...);
163   static void resetmem();
164164
165165protected:
166166
167    struct str_t
168    {
169        str_t(int alen) : m_ref_count(1), m_len(alen) { m_str[0] = 0; }
167   struct str_t
168   {
169      str_t(int alen) : m_ref_count(1), m_len(alen) { m_str[0] = 0; }
170170
171        char *str() { return &m_str[0]; }
172        int len() { return m_len; }
173    //private:
174        int m_ref_count;
175        int m_len;
176        char m_str[1];
177    };
171      char *str() { return &m_str[0]; }
172      int len() { return m_len; }
173   //private:
174      int m_ref_count;
175      int m_len;
176      char m_str[1];
177   };
178178
179    str_t *m_ptr;
179   str_t *m_ptr;
180180
181    static pblockpool m_pool;
181   static pblockpool m_pool;
182182
183183private:
184    inline void init()
185    {
186        if (m_zero == NULL)
187        {
188            m_zero = new(pstring::m_pool, 0) pstring::str_t(0);
189        }
190        m_ptr = m_zero;
191        m_ptr->m_ref_count++;
192    }
184   inline void init()
185   {
186      if (m_zero == NULL)
187      {
188         m_zero = new(pstring::m_pool, 0) pstring::str_t(0);
189      }
190      m_ptr = m_zero;
191      m_ptr->m_ref_count++;
192   }
193193
194    inline int pcmp(const char *right) const
195    {
196        return pcmp(m_ptr->str(), right);
197    }
194   inline int pcmp(const char *right) const
195   {
196      return pcmp(m_ptr->str(), right);
197   }
198198
199    inline int pcmp(const char *left, const char *right, int count = -1) const
200    {
201        if (count < 0)
202            return strcmp(left, right);
203        else
204            return strncmp(left, right, count);
205    }
199   inline int pcmp(const char *left, const char *right, int count = -1) const
200   {
201      if (count < 0)
202         return strcmp(left, right);
203      else
204         return strncmp(left, right, count);
205   }
206206
207    int pcmpi(const char *lhs, const char *rhs, int count = -1) const;
207   int pcmpi(const char *lhs, const char *rhs, int count = -1) const;
208208
209    void pcopy(const char *from, int size);
209   void pcopy(const char *from, int size);
210210
211    inline void pcopy(const char *from)
212    {
213        pcopy(from, strlen(from));
214    }
211   inline void pcopy(const char *from)
212   {
213      pcopy(from, strlen(from));
214   }
215215
216    inline void pcopy(const pstring &from)
217    {
218        sfree(m_ptr);
219        m_ptr = from.m_ptr;
220        m_ptr->m_ref_count++;
221    }
216   inline void pcopy(const pstring &from)
217   {
218      sfree(m_ptr);
219      m_ptr = from.m_ptr;
220      m_ptr->m_ref_count++;
221   }
222222
223    void pcat(const char *s);
223   void pcat(const char *s);
224224
225    static str_t *salloc(int n);
226    static void sfree(str_t *s);
225   static str_t *salloc(int n);
226   static void sfree(str_t *s);
227227
228    static str_t *m_zero;
228   static str_t *m_zero;
229229};
230230
231231
232232
233233#endif /* _PSTRING_H_ */
234
trunk/src/emu/netlist/nl_time.h
r26736r26737
2626{
2727public:
2828
29    typedef UINT64 INTERNALTYPE;
29   typedef UINT64 INTERNALTYPE;
3030
31    static const INTERNALTYPE RESOLUTION = NETLIST_INTERNAL_RES;
31   static const INTERNALTYPE RESOLUTION = NETLIST_INTERNAL_RES;
3232
33    ATTR_HOT inline netlist_time() : m_time(0) {}
33   ATTR_HOT inline netlist_time() : m_time(0) {}
3434
35    ATTR_HOT friend inline const netlist_time operator-(const netlist_time &left, const netlist_time &right);
36    ATTR_HOT friend inline const netlist_time operator+(const netlist_time &left, const netlist_time &right);
37    ATTR_HOT friend inline const netlist_time operator*(const netlist_time &left, const UINT32 factor);
38    ATTR_HOT friend inline const UINT32 operator/(const netlist_time &left, const netlist_time &right);
39    ATTR_HOT friend inline bool operator>(const netlist_time &left, const netlist_time &right);
40    ATTR_HOT friend inline bool operator<(const netlist_time &left, const netlist_time &right);
41    ATTR_HOT friend inline bool operator>=(const netlist_time &left, const netlist_time &right);
42    ATTR_HOT friend inline bool operator<=(const netlist_time &left, const netlist_time &right);
35   ATTR_HOT friend inline const netlist_time operator-(const netlist_time &left, const netlist_time &right);
36   ATTR_HOT friend inline const netlist_time operator+(const netlist_time &left, const netlist_time &right);
37   ATTR_HOT friend inline const netlist_time operator*(const netlist_time &left, const UINT32 factor);
38   ATTR_HOT friend inline const UINT32 operator/(const netlist_time &left, const netlist_time &right);
39   ATTR_HOT friend inline bool operator>(const netlist_time &left, const netlist_time &right);
40   ATTR_HOT friend inline bool operator<(const netlist_time &left, const netlist_time &right);
41   ATTR_HOT friend inline bool operator>=(const netlist_time &left, const netlist_time &right);
42   ATTR_HOT friend inline bool operator<=(const netlist_time &left, const netlist_time &right);
4343
44    ATTR_HOT inline const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; }
45    ATTR_HOT inline const netlist_time &operator=(const double &right) { m_time = (INTERNALTYPE) ( right * (double) RESOLUTION); return *this; }
46    ATTR_HOT inline operator double() const { return as_double(); }
44   ATTR_HOT inline const netlist_time &operator=(const netlist_time &right) { m_time = right.m_time; return *this; }
45   ATTR_HOT inline const netlist_time &operator=(const double &right) { m_time = (INTERNALTYPE) ( right * (double) RESOLUTION); return *this; }
46   ATTR_HOT inline operator double() const { return as_double(); }
4747
48    ATTR_HOT inline const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; }
48   ATTR_HOT inline const netlist_time &operator+=(const netlist_time &right) { m_time += right.m_time; return *this; }
4949
50    ATTR_HOT inline const INTERNALTYPE as_raw() const { return m_time; }
51    ATTR_HOT inline const double as_double() const { return (double) m_time / (double) RESOLUTION; }
50   ATTR_HOT inline const INTERNALTYPE as_raw() const { return m_time; }
51   ATTR_HOT inline const double as_double() const { return (double) m_time / (double) RESOLUTION; }
5252
53    // for save states ....
54    ATTR_HOT inline INTERNALTYPE *get_internaltype_ptr() { return &m_time; }
53   // for save states ....
54   ATTR_HOT inline INTERNALTYPE *get_internaltype_ptr() { return &m_time; }
5555
56    ATTR_HOT static inline const netlist_time from_nsec(const int ns) { return netlist_time((UINT64) ns * (RESOLUTION / U64(1000000000))); }
57    ATTR_HOT static inline const netlist_time from_usec(const int us) { return netlist_time((UINT64) us * (RESOLUTION / U64(1000000))); }
58    ATTR_HOT static inline const netlist_time from_msec(const int ms) { return netlist_time((UINT64) ms * (RESOLUTION / U64(1000))); }
59    ATTR_HOT static inline const netlist_time from_hz(const UINT64 hz) { return netlist_time(RESOLUTION / hz); }
60    ATTR_HOT static inline const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); }
61    ATTR_HOT static inline const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); }
56   ATTR_HOT static inline const netlist_time from_nsec(const int ns) { return netlist_time((UINT64) ns * (RESOLUTION / U64(1000000000))); }
57   ATTR_HOT static inline const netlist_time from_usec(const int us) { return netlist_time((UINT64) us * (RESOLUTION / U64(1000000))); }
58   ATTR_HOT static inline const netlist_time from_msec(const int ms) { return netlist_time((UINT64) ms * (RESOLUTION / U64(1000))); }
59   ATTR_HOT static inline const netlist_time from_hz(const UINT64 hz) { return netlist_time(RESOLUTION / hz); }
60   ATTR_HOT static inline const netlist_time from_double(const double t) { return netlist_time((INTERNALTYPE) ( t * (double) RESOLUTION)); }
61   ATTR_HOT static inline const netlist_time from_raw(const INTERNALTYPE raw) { return netlist_time(raw); }
6262
63    static const netlist_time zero;
63   static const netlist_time zero;
6464
6565protected:
6666
67    ATTR_HOT inline netlist_time(const INTERNALTYPE val) : m_time(val) {}
67   ATTR_HOT inline netlist_time(const INTERNALTYPE val) : m_time(val) {}
6868
69    INTERNALTYPE m_time;
69   INTERNALTYPE m_time;
7070};
7171
7272ATTR_HOT inline const netlist_time operator-(const netlist_time &left, const netlist_time &right)
7373{
74    return netlist_time::from_raw(left.m_time - right.m_time);
74   return netlist_time::from_raw(left.m_time - right.m_time);
7575}
7676
7777ATTR_HOT inline const netlist_time operator*(const netlist_time &left, const UINT32 factor)
7878{
79    return netlist_time::from_raw(left.m_time * factor);
79   return netlist_time::from_raw(left.m_time * factor);
8080}
8181
8282ATTR_HOT inline const UINT32 operator/(const netlist_time &left, const netlist_time &right)
8383{
84    return left.m_time / right.m_time;
84   return left.m_time / right.m_time;
8585}
8686
8787ATTR_HOT inline const netlist_time operator+(const netlist_time &left, const netlist_time &right)
8888{
89    return netlist_time::from_raw(left.m_time + right.m_time);
89   return netlist_time::from_raw(left.m_time + right.m_time);
9090}
9191
9292ATTR_HOT inline bool operator<(const netlist_time &left, const netlist_time &right)
9393{
94    return (left.m_time < right.m_time);
94   return (left.m_time < right.m_time);
9595}
9696
9797ATTR_HOT inline bool operator>(const netlist_time &left, const netlist_time &right)
9898{
99    return (left.m_time > right.m_time);
99   return (left.m_time > right.m_time);
100100}
101101
102102ATTR_HOT inline bool operator<=(const netlist_time &left, const netlist_time &right)
103103{
104    return (left.m_time <= right.m_time);
104   return (left.m_time <= right.m_time);
105105}
106106
107107ATTR_HOT inline bool operator>=(const netlist_time &left, const netlist_time &right)
108108{
109    return (left.m_time >= right.m_time);
109   return (left.m_time >= right.m_time);
110110}
111111
112112
trunk/src/emu/netlist/nl_lists.h
r26736r26737
2020{
2121public:
2222
23    struct entry_t {
23   struct entry_t {
24      // keep compatibility with tagmap
25      _ListClass object() { return m_obj; }
2426
25        // keep compatibility with tagmap
26        _ListClass object() { return m_obj; }
27      _ListClass m_obj;
28   };
2729
28        _ListClass m_obj;
29    };
30
3130   ATTR_COLD netlist_list_t(int numElements = _NumElem)
3231   {
3332      m_num_elements = numElements;
r26736r26737
3635      m_ptr--;
3736   }
3837
39    ATTR_COLD netlist_list_t(const netlist_list_t &rhs)
40    {
41        m_list = new entry_t[m_num_elements];
42        m_ptr = m_list;
43        m_ptr--;
44        for (int i=0; i<rhs.count(); i++)
45        {
46            this->add(rhs[i]);
47        }
48    }
38   ATTR_COLD netlist_list_t(const netlist_list_t &rhs)
39   {
40      m_list = new entry_t[m_num_elements];
41      m_ptr = m_list;
42      m_ptr--;
43      for (int i=0; i<rhs.count(); i++)
44      {
45         this->add(rhs[i]);
46      }
47   }
4948
50    ATTR_COLD netlist_list_t &operator=(const netlist_list_t &rhs)
51    {
52        for (int i=0; i<rhs.count(); i++)
53        {
54            this->add(rhs[i]);
55        }
56        return *this;
57    }
49   ATTR_COLD netlist_list_t &operator=(const netlist_list_t &rhs)
50   {
51      for (int i=0; i<rhs.count(); i++)
52      {
53         this->add(rhs[i]);
54      }
55      return *this;
56   }
5857
5958
6059   ATTR_COLD ~netlist_list_t()
r26736r26737
6463   ATTR_HOT inline void add(const _ListClass elem)
6564   {
6665      if (m_ptr-m_list >= m_num_elements - 1)
67          resize(m_num_elements * 2);
66         resize(m_num_elements * 2);
6867
6968      (++m_ptr)->m_obj = elem;
7069   }
7170   ATTR_HOT inline void resize(const int new_size)
7271   {
73       int cnt = count();
74       entry_t *m_new = new entry_t[new_size];
75       entry_t *pd = m_new;
72      int cnt = count();
73      entry_t *m_new = new entry_t[new_size];
74      entry_t *pd = m_new;
7675
77       for (entry_t *ps = m_list; ps <= m_ptr; ps++, pd++)
78           *pd = *ps;
79       delete[] m_list;
80       m_list = m_new;
81       m_ptr = m_list + cnt - 1;
82       m_num_elements = new_size;
76      for (entry_t *ps = m_list; ps <= m_ptr; ps++, pd++)
77         *pd = *ps;
78      delete[] m_list;
79      m_list = m_new;
80      m_ptr = m_list + cnt - 1;
81      m_num_elements = new_size;
8382   }
84    ATTR_HOT inline void remove(const _ListClass elem)
85    {
86        for (entry_t *i = m_list; i <= m_ptr; i++)
87        {
88            if (i->object() == elem)
89            {
90                while (i < m_ptr)
91                {
92                    *i = *(i+1);
93                    i++;
94                }
95                m_ptr--;
96                return;
97            }
98        }
99    }
100    ATTR_HOT inline bool contains(const _ListClass elem) const
101    {
102        for (entry_t *i = m_list; i <= m_ptr; i++)
103        {
104            if (i->object() == elem)
105                return true;
106        }
107        return false;
108    }
83   ATTR_HOT inline void remove(const _ListClass elem)
84   {
85      for (entry_t *i = m_list; i <= m_ptr; i++)
86      {
87         if (i->object() == elem)
88         {
89            while (i < m_ptr)
90            {
91               *i = *(i+1);
92               i++;
93            }
94            m_ptr--;
95            return;
96         }
97      }
98   }
99   ATTR_HOT inline bool contains(const _ListClass elem) const
100   {
101      for (entry_t *i = m_list; i <= m_ptr; i++)
102      {
103         if (i->object() == elem)
104            return true;
105      }
106      return false;
107   }
109108   ATTR_HOT inline entry_t *first() const { return (m_ptr >= m_list ? &m_list[0] : NULL ); }
110    ATTR_HOT inline entry_t *next(entry_t *lc) const { return (lc < last() ? lc + 1 : NULL ); }
109   ATTR_HOT inline entry_t *next(entry_t *lc) const { return (lc < last() ? lc + 1 : NULL ); }
111110   ATTR_HOT inline entry_t *last() const { return m_ptr; }
112111   ATTR_HOT inline int count() const { return m_ptr - m_list + 1; }
113112   ATTR_HOT inline bool empty() const { return (m_ptr < m_list); }
r26736r26737
115114
116115   ATTR_COLD void reset_and_free()
117116   {
118        for (entry_t *i = m_list; i <= m_ptr; i++)
119        {
120            delete i->object();
121        }
122        reset();
117      for (entry_t *i = m_list; i <= m_ptr; i++)
118      {
119         delete i->object();
120      }
121      reset();
123122   }
124123
125    //ATTR_HOT inline entry_t *item(int i) const { return &m_list[i]; }
124   //ATTR_HOT inline entry_t *item(int i) const { return &m_list[i]; }
126125   ATTR_HOT inline _ListClass& operator[](const int & index) { return m_list[index].m_obj; }
127    ATTR_HOT inline const _ListClass& operator[](const int & index) const { return m_list[index].m_obj; }
126   ATTR_HOT inline const _ListClass& operator[](const int & index) const { return m_list[index].m_obj; }
128127
129128private:
130129   entry_t * m_ptr;
r26736r26737
140139template <class _Element, class _Time, int _Size>
141140class netlist_timed_queue
142141{
143    NETLIST_PREVENT_COPYING(netlist_timed_queue)
142   NETLIST_PREVENT_COPYING(netlist_timed_queue)
144143public:
145144
146145   struct entry_t
r26736r26737
153152      ATTR_HOT inline _Element & object() const { return *m_object; }
154153
155154      ATTR_HOT inline const _Time *time_ptr() const { return &m_time; }
156        ATTR_HOT inline _Element *object_ptr() const { return m_object; }
155      ATTR_HOT inline _Element *object_ptr() const { return m_object; }
157156   private:
158157      _Time m_time;
159158      _Element *m_object;
r26736r26737
165164      clear();
166165   }
167166
168    ATTR_HOT inline int capacity() const { return _Size; }
167   ATTR_HOT inline int capacity() const { return _Size; }
169168   ATTR_HOT inline bool is_empty() const { return (m_end == &m_list[0]); }
170169   ATTR_HOT inline bool is_not_empty() const { return (m_end > &m_list[0]); }
171170
trunk/src/emu/netlist/nl_setup.h
r26736r26737
1919#define NET_STR(_x) # _x
2020
2121#define NET_MODEL(_model)                                                           \
22    netlist.register_model(_model);
22   netlist.register_model(_model);
2323
2424#define NET_ALIAS(_alias, _name)                                                    \
2525   netlist.register_alias(# _alias, # _name);
r26736r26737
3939      netlist.register_link(# _name "." # _input, # _output);
4040
4141#define NET_C(_input, _output)                                                      \
42        netlist.register_link(NET_STR(_input) , NET_STR(_output));
42      netlist.register_link(NET_STR(_input) , NET_STR(_output));
4343
4444#define NETDEV_PARAM(_name, _val)                                                   \
4545      netlist.register_param(# _name, _val);
4646
4747#define NETDEV_PARAMI(_name, _param, _val)                                           \
48        netlist.register_param(# _name "." # _param, _val);
48      netlist.register_param(# _name "." # _param, _val);
4949
5050#define NETLIST_NAME(_name) netlist ## _ ## _name
5151
r26736r26737
6969
7070class netlist_setup_t
7171{
72    NETLIST_PREVENT_COPYING(netlist_setup_t)
72   NETLIST_PREVENT_COPYING(netlist_setup_t)
7373public:
7474
75    struct link_t
76    {
77        link_t() { }
78        // Copy constructor
79        link_t(const link_t &from)
80        {
81            e1 = from.e1;
82            e2 = from.e2;
83        }
75   struct link_t
76   {
77      link_t() { }
78      // Copy constructor
79      link_t(const link_t &from)
80      {
81         e1 = from.e1;
82         e2 = from.e2;
83      }
8484
85        link_t(const pstring &ae1, const pstring &ae2)
86        {
87            e1 = ae1;
88            e2 = ae2;
89        }
90        pstring e1;
91        pstring e2;
85      link_t(const pstring &ae1, const pstring &ae2)
86      {
87         e1 = ae1;
88         e2 = ae2;
89      }
90      pstring e1;
91      pstring e2;
9292
93        bool operator==(const link_t &rhs) const { return (e1 == rhs.e1) && (e2 == rhs.e2); }
94        link_t &operator=(const link_t &rhs) { e1 = rhs.e1; e2 = rhs.e2; return *this; }
95    };
93      bool operator==(const link_t &rhs) const { return (e1 == rhs.e1) && (e2 == rhs.e2); }
94      link_t &operator=(const link_t &rhs) { e1 = rhs.e1; e2 = rhs.e2; return *this; }
95   };
9696
9797   typedef tagmap_t<pstring, 393> tagmap_nstring_t;
9898   typedef tagmap_t<netlist_param_t *, 393> tagmap_param_t;
r26736r26737
105105   void init();
106106
107107   netlist_base_t &netlist() { return m_netlist; }
108    const netlist_base_t &netlist() const { return m_netlist; }
108   const netlist_base_t &netlist() const { return m_netlist; }
109109   netlist_factory &factory() { return m_factory; }
110110
111111   netlist_device_t *register_dev(netlist_device_t *dev, const pstring &name);
112112   void remove_dev(const pstring &name);
113113
114    void register_model(const pstring &model);
115    void register_alias(const pstring &alias, const pstring &out);
116    void register_link(const pstring &sin, const pstring &sout);
117    void register_param(const pstring &param, const pstring &value);
118    void register_param(const pstring &param, const double value);
114   void register_model(const pstring &model);
115   void register_alias(const pstring &alias, const pstring &out);
116   void register_link(const pstring &sin, const pstring &sout);
117   void register_param(const pstring &param, const pstring &value);
118   void register_param(const pstring &param, const double value);
119119
120    void register_object(netlist_device_t &dev, netlist_core_device_t &upd_dev, const pstring &name, netlist_object_t &obj, netlist_input_t::state_e state);
121    void connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2);
120   void register_object(netlist_device_t &dev, netlist_core_device_t &upd_dev, const pstring &name, netlist_object_t &obj, netlist_input_t::state_e state);
121   void connect(netlist_core_terminal_t &t1, netlist_core_terminal_t &t2);
122122
123    netlist_core_terminal_t *find_terminal(const pstring &outname_in, bool required = true);
124    netlist_core_terminal_t *find_terminal(const pstring &outname_in, netlist_object_t::type_t atype, bool required = true);
123   netlist_core_terminal_t *find_terminal(const pstring &outname_in, bool required = true);
124   netlist_core_terminal_t *find_terminal(const pstring &outname_in, netlist_object_t::type_t atype, bool required = true);
125125
126    netlist_param_t *find_param(const pstring &param_in, bool required = true);
126   netlist_param_t *find_param(const pstring &param_in, bool required = true);
127127
128    void parse(const char *buf);
128   void parse(const char *buf);
129129
130    void start_devices();
130   void start_devices();
131131   void resolve_inputs();
132132
133133   /* not ideal, but needed for save_state */
r26736r26737
144144   tagmap_nstring_t m_alias;
145145   tagmap_param_t  m_params;
146146   tagmap_link_t   m_links;
147    tagmap_nstring_t m_params_temp;
147   tagmap_nstring_t m_params_temp;
148148
149    netlist_factory m_factory;
149   netlist_factory m_factory;
150150
151    netlist_list_t<pstring> m_models;
151   netlist_list_t<pstring> m_models;
152152
153153   int m_proxy_cnt;
154154
155155   void connect_terminals(netlist_core_terminal_t &in, netlist_core_terminal_t &out);
156156   void connect_input_output(netlist_input_t &in, netlist_output_t &out);
157    void connect_terminal_output(netlist_terminal_t &in, netlist_output_t &out);
158    void connect_terminal_input(netlist_terminal_t &term, netlist_input_t &inp);
157   void connect_terminal_output(netlist_terminal_t &in, netlist_output_t &out);
158   void connect_terminal_input(netlist_terminal_t &term, netlist_input_t &inp);
159159
160    // helpers
161    pstring objtype_as_astr(netlist_object_t &in);
160   // helpers
161   pstring objtype_as_astr(netlist_object_t &in);
162162
163163   const pstring resolve_alias(const pstring &name) const;
164164};
trunk/src/emu/netlist/pstate.c
r26736r26737
77
88ATTR_COLD pstate_manager_t::~pstate_manager_t()
99{
10    m_save.reset_and_free();
10   m_save.reset_and_free();
1111}
1212
1313
1414
1515ATTR_COLD void pstate_manager_t::save_state_ptr(const pstring &stname, const netlist_data_type_e dt, const int size, const int count, void *ptr)
1616{
17    pstring fullname = stname;
18    ATTR_UNUSED  pstring ts[] = {
19            "NOT_SUPPORTED",
20            "DT_DOUBLE",
21            "DT_INT64",
22            "DT_INT8",
23            "DT_INT",
24            "DT_BOOLEAN"
25    };
17   pstring fullname = stname;
18   ATTR_UNUSED  pstring ts[] = {
19         "NOT_SUPPORTED",
20         "DT_DOUBLE",
21         "DT_INT64",
22         "DT_INT8",
23         "DT_INT",
24         "DT_BOOLEAN"
25   };
2626
27    NL_VERBOSE_OUT(("SAVE: <%s> %s(%d) %p\n", fullname.cstr(), ts[dt].cstr(), size, ptr));
28    pstate_entry_t *p = new pstate_entry_t(stname, dt, size, count, ptr);
29    m_save.add(p);
27   NL_VERBOSE_OUT(("SAVE: <%s> %s(%d) %p\n", fullname.cstr(), ts[dt].cstr(), size, ptr));
28   pstate_entry_t *p = new pstate_entry_t(stname, dt, size, count, ptr);
29   m_save.add(p);
3030}
trunk/src/emu/netlist/devices/nld_signal.h
r26736r26737
9393      {
9494         register_input(sIN[i], m_i[i]);
9595      }
96        save(NAME(m_active));
96      save(NAME(m_active));
9797   }
9898
9999   #if (USE_DEACTIVE_DEVICE)
r26736r26737
167167      {
168168         register_input(sIN[i], m_i[i], netlist_input_t::STATE_INP_ACTIVE);
169169      }
170        save(NAME(m_active));
170      save(NAME(m_active));
171171   }
172172
173173   #if (USE_DEACTIVE_DEVICE)
trunk/src/emu/netlist/devices/nld_log.h
r26736r26737
2121#include "../nl_base.h"
2222
2323#define NETDEV_LOG(_name, _I)                                                       \
24        NET_REGISTER_DEV(log, _name)                                                \
25        NET_CONNECT(_name, I, _I)
24      NET_REGISTER_DEV(log, _name)                                                \
25      NET_CONNECT(_name, I, _I)
2626
2727NETLIB_DEVICE(log,
28    ~NETLIB_NAME(log)();
29    netlist_analog_input_t m_I;
28   ~NETLIB_NAME(log)();
29   netlist_analog_input_t m_I;
3030protected:
31    FILE *m_file;
31   FILE *m_file;
3232);
3333
3434#define NETDEV_LOGD(_name, _I, _I2)                                                 \
35        NET_REGISTER_DEV(logD, _name)                                               \
36        NET_CONNECT(_name, I, _I)                                                   \
37        NET_CONNECT(_name, I2, _I2)
35      NET_REGISTER_DEV(logD, _name)                                               \
36      NET_CONNECT(_name, I, _I)                                                   \
37      NET_CONNECT(_name, I2, _I2)
3838
3939NETLIB_DEVICE_DERIVED(logD, log,
40    netlist_analog_input_t m_I2;
40   netlist_analog_input_t m_I2;
4141);
4242
4343#if 0
4444NETLIB_DEVICE(wav,
45    ~NETLIB_NAME(wav)();
46    netlist_analog_input_t m_I;
45   ~NETLIB_NAME(wav)();
46   netlist_analog_input_t m_I;
4747private:
48    // FIXME: rewrite sound/wavwrite.h to be an object ...
49    void *m_file;
48   // FIXME: rewrite sound/wavwrite.h to be an object ...
49   void *m_file;
5050);
5151#endif
5252
trunk/src/emu/netlist/devices/nld_7404.c
r26736r26737
77
88NETLIB_START(nic7404)
99{
10    register_input("A", m_I);
11    register_output("Q", m_Q);
12    m_Q.initial(1);
10   register_input("A", m_I);
11   register_output("Q", m_Q);
12   m_Q.initial(1);
1313}
1414
1515NETLIB_UPDATE(nic7404)
1616{
17    static const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
18    UINT8 t = (INPLOGIC(m_I)) ^ 1;
19    OUTLOGIC(m_Q, t, delay[t]);
17   static const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
18   UINT8 t = (INPLOGIC(m_I)) ^ 1;
19   OUTLOGIC(m_Q, t, delay[t]);
2020}
trunk/src/emu/netlist/devices/nld_7400.h
r26736r26737
4343
4444NETLIB_DEVICE(7400pin,
4545
46    NETLIB_NAME(7400) m_1;
47    NETLIB_NAME(7400) m_2;
48    NETLIB_NAME(7400) m_3;
49    NETLIB_NAME(7400) m_4;
46   NETLIB_NAME(7400) m_1;
47   NETLIB_NAME(7400) m_2;
48   NETLIB_NAME(7400) m_3;
49   NETLIB_NAME(7400) m_4;
5050);
5151
5252inline NETLIB_START(7400pin)
5353{
54    register_sub(m_1, "1");
55    register_sub(m_2, "2");
56    register_sub(m_3, "3");
57    register_sub(m_4, "4");
54   register_sub(m_1, "1");
55   register_sub(m_2, "2");
56   register_sub(m_3, "3");
57   register_sub(m_4, "4");
5858
59    register_subalias("1", m_1.m_i[0]);
60    register_subalias("2", m_1.m_i[1]);
61    register_subalias("3", m_1.m_Q);
59   register_subalias("1", m_1.m_i[0]);
60   register_subalias("2", m_1.m_i[1]);
61   register_subalias("3", m_1.m_Q);
6262
63    register_subalias("4", m_2.m_i[0]);
64    register_subalias("5", m_2.m_i[1]);
65    register_subalias("6", m_2.m_Q);
63   register_subalias("4", m_2.m_i[0]);
64   register_subalias("5", m_2.m_i[1]);
65   register_subalias("6", m_2.m_Q);
6666
67    register_subalias("9", m_3.m_i[0]);
68    register_subalias("10", m_3.m_i[1]);
69    register_subalias("8", m_3.m_Q);
67   register_subalias("9", m_3.m_i[0]);
68   register_subalias("10", m_3.m_i[1]);
69   register_subalias("8", m_3.m_Q);
7070
71    register_subalias("12", m_4.m_i[0]);
72    register_subalias("13", m_4.m_i[1]);
73    register_subalias("11", m_4.m_Q);
71   register_subalias("12", m_4.m_i[0]);
72   register_subalias("13", m_4.m_i[1]);
73   register_subalias("11", m_4.m_Q);
7474}
7575
7676#endif /* NLD_7400_H_ */
trunk/src/emu/netlist/devices/nld_ne555.c
r26736r26737
1111
1212inline double NETLIB_NAME(NE555)::clamp(const double v, const double a, const double b)
1313{
14    double ret = v;
15    double vcc = TERMANALOG(m_R1.m_P);
14   double ret = v;
15   double vcc = TERMANALOG(m_R1.m_P);
1616
17    if (ret >  vcc - a)
18        ret = vcc - a;
19    if (ret < b)
20        ret = b;
21    return ret;
17   if (ret >  vcc - a)
18      ret = vcc - a;
19   if (ret < b)
20      ret = b;
21   return ret;
2222}
2323
2424NETLIB_START(NE555)
2525{
26   register_sub(m_R1, "R1");
27   register_sub(m_R2, "R2");
28   register_sub(m_R3, "R3");
29   register_sub(m_RDIS, "RDIS");
2630
27    register_sub(m_R1, "R1");
28    register_sub(m_R2, "R2");
29    register_sub(m_R3, "R3");
30    register_sub(m_RDIS, "RDIS");
31   register_subalias("GND",  m_R3.m_N);    // Pin 1
32   register_input("TRIG",    m_TRIG);      // Pin 2
33   register_output("OUT",    m_OUT);       // Pin 3
34   register_input("RESET",   m_RESET);     // Pin 4
35   register_subalias("CONT", m_R1.m_N);    // Pin 5
36   register_input("THRESH",  m_THRES);     // Pin 6
37   register_subalias("DISCH", m_RDIS.m_P); // Pin 7
38   register_subalias("VCC",  m_R1.m_P);    // Pin 8
3139
32    register_subalias("GND",  m_R3.m_N);    // Pin 1
33    register_input("TRIG",    m_TRIG);      // Pin 2
34    register_output("OUT",    m_OUT);       // Pin 3
35    register_input("RESET",   m_RESET);     // Pin 4
36    register_subalias("CONT", m_R1.m_N);    // Pin 5
37    register_input("THRESH",  m_THRES);     // Pin 6
38    register_subalias("DISCH", m_RDIS.m_P); // Pin 7
39    register_subalias("VCC",  m_R1.m_P);    // Pin 8
40   m_R1.set_R(5000);
41   m_R2.set_R(5000);
42   m_R3.set_R(5000);
43   m_RDIS.set_R(R_OFF);
4044
41    m_R1.set_R(5000);
42    m_R2.set_R(5000);
43    m_R3.set_R(5000);
44    m_RDIS.set_R(R_OFF);
45   setup().connect(m_R1.m_N, m_R2.m_P);
46   setup().connect(m_R2.m_N, m_R3.m_P);
47   setup().connect(m_RDIS.m_N, m_R3.m_N);
4548
46    setup().connect(m_R1.m_N, m_R2.m_P);
47    setup().connect(m_R2.m_N, m_R3.m_P);
48    setup().connect(m_RDIS.m_N, m_R3.m_N);
49   m_last_out = false;
4950
50    m_last_out = false;
51
52    save(NAME(m_last_out));
51   save(NAME(m_last_out));
5352}
5453
5554NETLIB_UPDATE(NE555)
5655{
57    // FIXME: assumes GND is connected to 0V.
56   // FIXME: assumes GND is connected to 0V.
5857
59    double vt = clamp(TERMANALOG(m_R2.m_P), 0.7, 1.4);
60    bool bthresh = (INPANALOG(m_THRES) > vt);
61    bool btrig = (INPANALOG(m_TRIG) > clamp(TERMANALOG(m_R2.m_N), 0.7, 1.4));
62    bool out = m_last_out;
58   double vt = clamp(TERMANALOG(m_R2.m_P), 0.7, 1.4);
59   bool bthresh = (INPANALOG(m_THRES) > vt);
60   bool btrig = (INPANALOG(m_TRIG) > clamp(TERMANALOG(m_R2.m_N), 0.7, 1.4));
61   bool out = m_last_out;
6362
64    if (!btrig)
65    {
66        out = true;
67    }
68    else if (bthresh)
69    {
70        out = false;
71    }
63   if (!btrig)
64   {
65      out = true;
66   }
67   else if (bthresh)
68   {
69      out = false;
70   }
7271
73    if (!m_last_out && out)
74    {
75        OUTANALOG(m_OUT, TERMANALOG(m_R1.m_P), NLTIME_FROM_NS(100));
76        m_RDIS.set_R(R_OFF);
77    }
78    else if (m_last_out && !out)
79    {
80        OUTANALOG(m_OUT, TERMANALOG(m_R3.m_N), NLTIME_FROM_NS(100));
81        m_RDIS.set_R(R_ON);
82    }
83    m_last_out = out;
72   if (!m_last_out && out)
73   {
74      OUTANALOG(m_OUT, TERMANALOG(m_R1.m_P), NLTIME_FROM_NS(100));
75      m_RDIS.set_R(R_OFF);
76   }
77   else if (m_last_out && !out)
78   {
79      OUTANALOG(m_OUT, TERMANALOG(m_R3.m_N), NLTIME_FROM_NS(100));
80      m_RDIS.set_R(R_ON);
81   }
82   m_last_out = out;
8483}
trunk/src/emu/netlist/devices/nld_twoterm.c
r26736r26737
1212// ----------------------------------------------------------------------------------------
1313
1414ATTR_COLD NETLIB_NAME(twoterm)::NETLIB_NAME(twoterm)(const family_t afamily) :
15        netlist_device_t(afamily)
15      netlist_device_t(afamily)
1616{
17    m_P.m_otherterm = &m_N;
18    m_N.m_otherterm = &m_P;
17   m_P.m_otherterm = &m_N;
18   m_N.m_otherterm = &m_P;
1919}
2020
2121NETLIB_START(twoterm)
r26736r26737
2424
2525NETLIB_UPDATE(twoterm)
2626{
27    /* only called if connected to a rail net ==> notify the solver to recalculate */
28    netlist().solver()->schedule();
27   /* only called if connected to a rail net ==> notify the solver to recalculate */
28   netlist().solver()->schedule();
2929}
3030
3131// ----------------------------------------------------------------------------------------
r26736r26737
3434
3535NETLIB_START(R_base)
3636{
37    register_terminal("1", m_P);
38    register_terminal("2", m_N);
37   register_terminal("1", m_P);
38   register_terminal("2", m_N);
3939}
4040
4141NETLIB_UPDATE(R_base)
4242{
43    NETLIB_NAME(twoterm)::update();
43   NETLIB_NAME(twoterm)::update();
4444}
4545
4646NETLIB_START(R)
4747{
48    NETLIB_NAME(R_base)::start();
49    register_param("R", m_R, 1.0 / NETLIST_GMIN);
48   NETLIB_NAME(R_base)::start();
49   register_param("R", m_R, 1.0 / NETLIST_GMIN);
5050}
5151
5252NETLIB_UPDATE(R)
5353{
54    NETLIB_NAME(twoterm)::update();
54   NETLIB_NAME(twoterm)::update();
5555}
5656
5757NETLIB_UPDATE_PARAM(R)
5858{
59    set_R(m_R.Value());
59   set_R(m_R.Value());
6060}
6161
6262// ----------------------------------------------------------------------------------------
r26736r26737
6565
6666NETLIB_START(POT)
6767{
68    register_sub(m_R1, "R1");
69    register_sub(m_R2, "R2");
68   register_sub(m_R1, "R1");
69   register_sub(m_R2, "R2");
7070
71    register_subalias("1", m_R1.m_P);
72    register_subalias("2", m_R1.m_N);
73    register_subalias("3", m_R2.m_N);
71   register_subalias("1", m_R1.m_P);
72   register_subalias("2", m_R1.m_N);
73   register_subalias("3", m_R2.m_N);
7474
75    setup().connect(m_R2.m_P, m_R1.m_N);
75   setup().connect(m_R2.m_P, m_R1.m_N);
7676
77    register_param("R", m_R, 1.0 / NETLIST_GMIN);
78    register_param("DIAL", m_Dial, 0.5);
77   register_param("R", m_R, 1.0 / NETLIST_GMIN);
78   register_param("DIAL", m_Dial, 0.5);
7979
8080}
8181
8282NETLIB_UPDATE(POT)
8383{
84    m_R1.update_dev();
85    m_R2.update_dev();
84   m_R1.update_dev();
85   m_R2.update_dev();
8686}
8787
8888NETLIB_UPDATE_PARAM(POT)
8989{
90    m_R1.set_R(MAX(m_R.Value() * m_Dial.Value(), NETLIST_GMIN));
91    m_R2.set_R(MAX(m_R.Value() * (1.0 - m_Dial.Value()), NETLIST_GMIN));
90   m_R1.set_R(MAX(m_R.Value() * m_Dial.Value(), NETLIST_GMIN));
91   m_R2.set_R(MAX(m_R.Value() * (1.0 - m_Dial.Value()), NETLIST_GMIN));
9292}
9393// ----------------------------------------------------------------------------------------
9494// nld_C
r26736r26737
9696
9797NETLIB_START(C)
9898{
99    register_terminal("1", m_P);
100    register_terminal("2", m_N);
99   register_terminal("1", m_P);
100   register_terminal("2", m_N);
101101
102    register_param("C", m_C, 1e-6);
102   register_param("C", m_C, 1e-6);
103103}
104104
105105NETLIB_UPDATE_PARAM(C)
106106{
107    // set to some very small step time for now
108    step_time(1e-9);
107   // set to some very small step time for now
108   step_time(1e-9);
109109}
110110
111111NETLIB_UPDATE(C)
112112{
113    NETLIB_NAME(twoterm)::update();
113   NETLIB_NAME(twoterm)::update();
114114}
115115
116116// ----------------------------------------------------------------------------------------
r26736r26737
119119
120120NETLIB_START(D)
121121{
122    register_terminal("A", m_P);
123    register_terminal("K", m_N);
124    register_param("model", m_model, "");
122   register_terminal("A", m_P);
123   register_terminal("K", m_N);
124   register_param("model", m_model, "");
125125
126    m_Vd = 0.7;
126   m_Vd = 0.7;
127127
128    save(NAME(m_Vd));
128   save(NAME(m_Vd));
129129
130130}
131131
132132
133133NETLIB_UPDATE_PARAM(D)
134134{
135    m_Is = m_model.dValue("Is", 1e-15);
136    m_n = m_model.dValue("N", 1);
135   m_Is = m_model.dValue("Is", 1e-15);
136   m_n = m_model.dValue("N", 1);
137137
138    m_Vt = 0.0258 * m_n;
138   m_Vt = 0.0258 * m_n;
139139
140    m_Vcrit = m_Vt * log(m_Vt / m_Is / sqrt(2.0));
141    m_VtInv = 1.0 / m_Vt;
142    NL_VERBOSE_OUT(("VCutoff: %f\n", m_Vcrit));
140   m_Vcrit = m_Vt * log(m_Vt / m_Is / sqrt(2.0));
141   m_VtInv = 1.0 / m_Vt;
142   NL_VERBOSE_OUT(("VCutoff: %f\n", m_Vcrit));
143143}
144144
145145NETLIB_UPDATE(D)
146146{
147    NETLIB_NAME(twoterm)::update();
147   NETLIB_NAME(twoterm)::update();
148148}
149149
150150class diode
151151{
152152public:
153    diode() : m_Is(1e-15), m_VT(0.0258), m_VT_inv(1.0 / m_VT) {}
154    diode(const double Is, const double n)
155    {
156        m_Is = Is;
157        m_VT = 0.0258 * n;
158        m_VT_inv = 1.0 / m_VT;
159    }
160    void set(const double Is, const double n)
161    {
162        m_Is = Is;
163        m_VT = 0.0258 * n;
164        m_VT_inv = 1.0 / m_VT;
165    }
166    double I(const double V) const { return m_Is * exp(V * m_VT_inv) - m_Is; }
167    double g(const double V) const { return m_Is * m_VT_inv * exp(V * m_VT_inv); }
168    double V(const double I) const { return log(1.0 + I / m_Is) * m_VT; }
169    double gI(const double I) const { return m_VT_inv * (I + m_Is); }
153   diode() : m_Is(1e-15), m_VT(0.0258), m_VT_inv(1.0 / m_VT) {}
154   diode(const double Is, const double n)
155   {
156      m_Is = Is;
157      m_VT = 0.0258 * n;
158      m_VT_inv = 1.0 / m_VT;
159   }
160   void set(const double Is, const double n)
161   {
162      m_Is = Is;
163      m_VT = 0.0258 * n;
164      m_VT_inv = 1.0 / m_VT;
165   }
166   double I(const double V) const { return m_Is * exp(V * m_VT_inv) - m_Is; }
167   double g(const double V) const { return m_Is * m_VT_inv * exp(V * m_VT_inv); }
168   double V(const double I) const { return log(1.0 + I / m_Is) * m_VT; }
169   double gI(const double I) const { return m_VT_inv * (I + m_Is); }
170170
171171private:
172    double m_Is;
173    double m_VT;
174    double m_VT_inv;
172   double m_Is;
173   double m_VT;
174   double m_VT_inv;
175175};
176176
177177// ----------------------------------------------------------------------------------------
r26736r26737
180180
181181NETLIB_START(Q)
182182{
183    register_param("model", m_model, "");
183   register_param("model", m_model, "");
184184}
185185
186186template <NETLIB_NAME(Q)::q_type _type>
187187NETLIB_START(QBJT_switch<_type>)
188188{
189    NETLIB_NAME(Q)::start();
189   NETLIB_NAME(Q)::start();
190190
191    register_sub(m_RB, "RB");
192    register_sub(m_RC, "RC");
193    register_input("BV", m_BV);
194    register_input("EV", m_EV);
191   register_sub(m_RB, "RB");
192   register_sub(m_RC, "RC");
193   register_input("BV", m_BV);
194   register_input("EV", m_EV);
195195
196    register_subalias("B", m_RB.m_P);
197    register_subalias("E", m_RB.m_N);
198    register_subalias("C", m_RC.m_P);
196   register_subalias("B", m_RB.m_P);
197   register_subalias("E", m_RB.m_N);
198   register_subalias("C", m_RC.m_P);
199199
200    setup().connect(m_RB.m_N, m_RC.m_N);
201    setup().connect(m_RB.m_P, m_BV);
202    setup().connect(m_RB.m_N, m_EV);
200   setup().connect(m_RB.m_N, m_RC.m_N);
201   setup().connect(m_RB.m_P, m_BV);
202   setup().connect(m_RB.m_N, m_EV);
203203
204    save(NAME(m_state_on));
204   save(NAME(m_state_on));
205205}
206206
207207NETLIB_UPDATE(Q)
208208{
209    netlist().solver()->schedule();
209   netlist().solver()->schedule();
210210}
211211
212212template <NETLIB_NAME(Q)::q_type _type>
213213NETLIB_UPDATE_PARAM(QBJT_switch<_type>)
214214{
215    double IS = m_model.dValue("IS", 1e-15);
216    double BF = m_model.dValue("BF", 100);
217    double NF = m_model.dValue("NF", 1);
218    //double VJE = m_model.dValue("VJE", 0.75);
215   double IS = m_model.dValue("IS", 1e-15);
216   double BF = m_model.dValue("BF", 100);
217   double NF = m_model.dValue("NF", 1);
218   //double VJE = m_model.dValue("VJE", 0.75);
219219
220    double alpha = BF / (1.0 + BF);
220   double alpha = BF / (1.0 + BF);
221221
222    diode d(IS, NF);
222   diode d(IS, NF);
223223
224    // Assume 5mA Collector current for switch operation
224   // Assume 5mA Collector current for switch operation
225225
226    if (_type == BJT_NPN)
227        m_V = d.V(0.005 / alpha);
228    else
229        m_V = - d.V(0.005 / alpha);
226   if (_type == BJT_NPN)
227      m_V = d.V(0.005 / alpha);
228   else
229      m_V = - d.V(0.005 / alpha);
230230
231    m_gB = d.gI(0.005 / alpha);
232    if (m_gB < NETLIST_GMIN)
233        m_gB = NETLIST_GMIN;
234    m_gC = BF * m_gB; // very rough estimate
235    //printf("%f %f \n", m_V, m_gB);
236    m_RB.set(NETLIST_GMIN, 0.0, 0.0);
237    m_RC.set(NETLIST_GMIN, 0.0, 0.0);
231   m_gB = d.gI(0.005 / alpha);
232   if (m_gB < NETLIST_GMIN)
233      m_gB = NETLIST_GMIN;
234   m_gC = BF * m_gB; // very rough estimate
235   //printf("%f %f \n", m_V, m_gB);
236   m_RB.set(NETLIST_GMIN, 0.0, 0.0);
237   m_RC.set(NETLIST_GMIN, 0.0, 0.0);
238238}
239239
240240template NETLIB_START(QBJT_switch<NETLIB_NAME(Q)::BJT_NPN>);
r26736r26737
248248
249249NETLIB_START(VCCS)
250250{
251    configure(1.0, NETLIST_GMIN);
251   configure(1.0, NETLIST_GMIN);
252252}
253253
254254ATTR_COLD void NETLIB_NAME(VCCS)::configure(const double Gfac, const double GI)
255255{
256   register_param("G", m_G, 1.0);
256257
257    register_param("G", m_G, 1.0);
258   register_terminal("IP", m_IP);
259   register_terminal("IN", m_IN);
260   register_terminal("OP", m_OP);
261   register_terminal("ON", m_ON);
258262
259    register_terminal("IP", m_IP);
260    register_terminal("IN", m_IN);
261    register_terminal("OP", m_OP);
262    register_terminal("ON", m_ON);
263   m_OP1.init_object(*this, name() + ".OP1", netlist_core_terminal_t::STATE_INP_ACTIVE);
264   m_ON1.init_object(*this, name() + ".ON1", netlist_core_terminal_t::STATE_INP_ACTIVE);
263265
264    m_OP1.init_object(*this, name() + ".OP1", netlist_core_terminal_t::STATE_INP_ACTIVE);
265    m_ON1.init_object(*this, name() + ".ON1", netlist_core_terminal_t::STATE_INP_ACTIVE);
266   const double m_mult = m_G.Value() * Gfac; // 1.0 ==> 1V ==> 1A
267   m_IP.set(GI);
268   m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving...
269   m_IN.set(GI);
270   m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving...
266271
267    const double m_mult = m_G.Value() * Gfac; // 1.0 ==> 1V ==> 1A
268    m_IP.set(GI);
269    m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving...
270    m_IN.set(GI);
271    m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving...
272   m_OP.set(m_mult, 0.0);
273   m_OP.m_otherterm = &m_IP;
274   m_OP1.set(-m_mult, 0.0);
275   m_OP1.m_otherterm = &m_IN;
272276
273    m_OP.set(m_mult, 0.0);
274    m_OP.m_otherterm = &m_IP;
275    m_OP1.set(-m_mult, 0.0);
276    m_OP1.m_otherterm = &m_IN;
277   m_ON.set(-m_mult, 0.0);
278   m_ON.m_otherterm = &m_IP;
279   m_ON1.set(m_mult, 0.0);
280   m_ON1.m_otherterm = &m_IN;
277281
278    m_ON.set(-m_mult, 0.0);
279    m_ON.m_otherterm = &m_IP;
280    m_ON1.set(m_mult, 0.0);
281    m_ON1.m_otherterm = &m_IN;
282
283    setup().connect(m_OP, m_OP1);
284    setup().connect(m_ON, m_ON1);
282   setup().connect(m_OP, m_OP1);
283   setup().connect(m_ON, m_ON1);
285284}
286285
287286NETLIB_UPDATE_PARAM(VCCS)
r26736r26737
290289
291290NETLIB_UPDATE(VCCS)
292291{
293    /* only called if connected to a rail net ==> notify the solver to recalculate */
294    netlist().solver()->schedule();
292   /* only called if connected to a rail net ==> notify the solver to recalculate */
293   netlist().solver()->schedule();
295294}
296295
297296// ----------------------------------------------------------------------------------------
r26736r26737
300299
301300NETLIB_START(VCVS)
302301{
303    register_param("RO", m_RO, 1.0);
302   register_param("RO", m_RO, 1.0);
304303
305    const double gRO = 1.0 / m_RO.Value();
304   const double gRO = 1.0 / m_RO.Value();
306305
307    configure(gRO, NETLIST_GMIN);
306   configure(gRO, NETLIST_GMIN);
308307
309    m_OP2.init_object(*this, "OP2", netlist_core_terminal_t::STATE_INP_ACTIVE);
310    m_ON2.init_object(*this, "ON2", netlist_core_terminal_t::STATE_INP_ACTIVE);
308   m_OP2.init_object(*this, "OP2", netlist_core_terminal_t::STATE_INP_ACTIVE);
309   m_ON2.init_object(*this, "ON2", netlist_core_terminal_t::STATE_INP_ACTIVE);
311310
312    m_OP2.set(gRO);
313    m_ON2.set(gRO);
314    m_OP2.m_otherterm = &m_ON2;
315    m_ON2.m_otherterm = &m_OP2;
311   m_OP2.set(gRO);
312   m_ON2.set(gRO);
313   m_OP2.m_otherterm = &m_ON2;
314   m_ON2.m_otherterm = &m_OP2;
316315
317    setup().connect(m_OP2, m_OP1);
318    setup().connect(m_ON2, m_ON1);
316   setup().connect(m_OP2, m_OP1);
317   setup().connect(m_ON2, m_ON1);
319318}
320319
321320NETLIB_UPDATE_PARAM(VCVS)
322321{
323322}
324
trunk/src/emu/netlist/devices/nld_7420.h
r26736r26737
3636#include "nld_signal.h"
3737
3838#define TTL_7420_NAND(_name, _I1, _I2, _I3, _I4)                                    \
39        NET_REGISTER_DEV(7420, _name)                                               \
40        NET_CONNECT(_name, A, _I1)                                                  \
41        NET_CONNECT(_name, B, _I2)                                                  \
42        NET_CONNECT(_name, C, _I3)                                                  \
43        NET_CONNECT(_name, D, _I4)
39      NET_REGISTER_DEV(7420, _name)                                               \
40      NET_CONNECT(_name, A, _I1)                                                  \
41      NET_CONNECT(_name, B, _I2)                                                  \
42      NET_CONNECT(_name, C, _I3)                                                  \
43      NET_CONNECT(_name, D, _I4)
4444
4545
4646NETLIB_SIGNAL(7420, 4, 0, 0);
trunk/src/emu/netlist/devices/nld_7402.h
r26736r26737
3535#include "nld_signal.h"
3636
3737#define TTL_7402_NOR(_name, _I1, _I2)                                               \
38        NET_REGISTER_DEV(7402, _name)                                               \
39        NET_CONNECT(_name, A, _I1)                                                  \
40        NET_CONNECT(_name, B, _I2)
38      NET_REGISTER_DEV(7402, _name)                                               \
39      NET_CONNECT(_name, A, _I1)                                                  \
40      NET_CONNECT(_name, B, _I2)
4141
4242NETLIB_SIGNAL(7402, 2, 1, 0);
4343
trunk/src/emu/netlist/devices/nld_7404.h
r26736r26737
3333#include "nld_signal.h"
3434
3535NETLIB_DEVICE(nic7404,
36    netlist_ttl_input_t m_I;
37    netlist_ttl_output_t m_Q;
36   netlist_ttl_input_t m_I;
37   netlist_ttl_output_t m_Q;
3838);
3939
4040#define TTL_7404_INVERT(_name, _A)                                                  \
41        NET_REGISTER_DEV(nic7404, _name)                                            \
42        NET_CONNECT(_name, A, _A)
41      NET_REGISTER_DEV(nic7404, _name)                                            \
42      NET_CONNECT(_name, A, _A)
4343
4444#endif /* NLD_7404_H_ */
trunk/src/emu/netlist/devices/nld_legacy.c
r26736r26737
77
88NETLIB_START(nicMultiSwitch)
99{
10    static const char *sIN[8] = { "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8" };
11    int i;
10   static const char *sIN[8] = { "i1", "i2", "i3", "i4", "i5", "i6", "i7", "i8" };
11   int i;
1212
13    m_position = 0;
14    m_low.initial(0);
13   m_position = 0;
14   m_low.initial(0);
1515
16    for (i=0; i<8; i++)
17    {
18        register_input(sIN[i], m_I[i]);
19        m_low.net().register_con(m_I[i]);
20        //m_I[i].set_net(m_low.m_net);
21    }
22    register_param("POS", m_POS, 0);
23    register_output("Q", m_Q);
16   for (i=0; i<8; i++)
17   {
18      register_input(sIN[i], m_I[i]);
19      m_low.net().register_con(m_I[i]);
20      //m_I[i].set_net(m_low.m_net);
21   }
22   register_param("POS", m_POS, 0);
23   register_output("Q", m_Q);
2424
25    save(NAME(m_position));
25   save(NAME(m_position));
2626
2727}
2828
2929NETLIB_UPDATE(nicMultiSwitch)
3030{
31    assert(m_position<8);
32    OUTANALOG(m_Q, INPANALOG(m_I[m_position]), NLTIME_FROM_NS(1));
31   assert(m_position<8);
32   OUTANALOG(m_Q, INPANALOG(m_I[m_position]), NLTIME_FROM_NS(1));
3333}
3434
3535NETLIB_UPDATE_PARAM(nicMultiSwitch)
3636{
37    m_position = m_POS.Value();
38    //update();
37   m_position = m_POS.Value();
38   //update();
3939}
4040
4141NETLIB_START(nicMixer8)
4242{
43    static const char *sI[8] = { "I1", "I2", "I3", "I4", "I5", "I6", "I7", "I8" };
44    static const char *sR[8] = { "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8" };
45    int i;
43   static const char *sI[8] = { "I1", "I2", "I3", "I4", "I5", "I6", "I7", "I8" };
44   static const char *sR[8] = { "R1", "R2", "R3", "R4", "R5", "R6", "R7", "R8" };
45   int i;
4646
47    m_low.initial(0);
47   m_low.initial(0);
4848
49    for (i=0; i<8; i++)
50    {
51        register_input(sI[i], m_I[i]);
52        m_low.net().register_con(m_I[i]);
53        //m_I[i].set_output(m_low);
54        register_param(sR[i], m_R[i], 1e12);
55    }
56    register_output("Q", m_Q);
49   for (i=0; i<8; i++)
50   {
51      register_input(sI[i], m_I[i]);
52      m_low.net().register_con(m_I[i]);
53      //m_I[i].set_output(m_low);
54      register_param(sR[i], m_R[i], 1e12);
55   }
56   register_output("Q", m_Q);
5757}
5858
5959NETLIB_UPDATE(nicMixer8)
6060{
61    int i;
62    double r = 0;
61   int i;
62   double r = 0;
6363
64    for (i=0; i<8; i++)
65    {
66        r += m_w[i] * INPANALOG(m_I[i]);
67    }
68    OUTANALOG(m_Q, r, NLTIME_IMMEDIATE);
64   for (i=0; i<8; i++)
65   {
66      r += m_w[i] * INPANALOG(m_I[i]);
67   }
68   OUTANALOG(m_Q, r, NLTIME_IMMEDIATE);
6969}
7070
7171NETLIB_UPDATE_PARAM(nicMixer8)
7272{
73    double t = 0;
74    int i;
73   double t = 0;
74   int i;
7575
76    for (i=0; i<8; i++)
77        t += 1.0 / m_R[i].Value();
78    t = 1.0 / t;
76   for (i=0; i<8; i++)
77      t += 1.0 / m_R[i].Value();
78   t = 1.0 / t;
7979
80    for (i=0; i<8; i++)
81        m_w[i] = t / m_R[i].Value();
80   for (i=0; i<8; i++)
81      m_w[i] = t / m_R[i].Value();
8282}
8383
8484
8585
8686NETLIB_START(nicRSFF)
8787{
88    register_input("S", m_S);
89    register_input("R", m_R);
90    register_output("Q", m_Q);
91    register_output("QQ", m_QQ);
92    m_Q.initial(0);
93    m_QQ.initial(1);
88   register_input("S", m_S);
89   register_input("R", m_R);
90   register_output("Q", m_Q);
91   register_output("QQ", m_QQ);
92   m_Q.initial(0);
93   m_QQ.initial(1);
9494}
9595
9696NETLIB_UPDATE(nicRSFF)
9797{
98    if (INPLOGIC(m_S))
99    {
100        OUTLOGIC(m_Q,  1, NLTIME_FROM_NS(10));
101        OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(10));
102    }
103    else if (INPLOGIC(m_R))
104    {
105        OUTLOGIC(m_Q,  0, NLTIME_FROM_NS(10));
106        OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10));
107    }
98   if (INPLOGIC(m_S))
99   {
100      OUTLOGIC(m_Q,  1, NLTIME_FROM_NS(10));
101      OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(10));
102   }
103   else if (INPLOGIC(m_R))
104   {
105      OUTLOGIC(m_Q,  0, NLTIME_FROM_NS(10));
106      OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10));
107   }
108108}
109109
110110
111111NETLIB_START(nicNE555N_MSTABLE)
112112{
113    register_input("TRIG", m_trigger);
114    register_input("CV", m_CV);
113   register_input("TRIG", m_trigger);
114   register_input("CV", m_CV);
115115
116    register_output("Q", m_Q);
117    register_param("R", m_R, 0.0);
118    register_param("C", m_C, 0.0);
119    register_param("VS", m_VS, 5.0);
120    register_param("VL", m_VL, 0.0 *5.0);
116   register_output("Q", m_Q);
117   register_param("R", m_R, 0.0);
118   register_param("C", m_C, 0.0);
119   register_param("VS", m_VS, 5.0);
120   register_param("VL", m_VL, 0.0 *5.0);
121121
122    m_THRESHOLD_OUT.init_object(*this, name() + "THRESHOLD");
123    register_link_internal(m_THRESHOLD, m_THRESHOLD_OUT, netlist_input_t::STATE_INP_ACTIVE);
122   m_THRESHOLD_OUT.init_object(*this, name() + "THRESHOLD");
123   register_link_internal(m_THRESHOLD, m_THRESHOLD_OUT, netlist_input_t::STATE_INP_ACTIVE);
124124
125    m_Q.initial(5.0 * 0.4);
126    m_last = false;
125   m_Q.initial(5.0 * 0.4);
126   m_last = false;
127127
128    save(NAME(m_last));
128   save(NAME(m_last));
129129
130130}
131131
132132inline double NETLIB_NAME(nicNE555N_MSTABLE)::nicNE555N_cv()
133133{
134    return (m_CV.is_highz() ? 0.67 * m_VS.Value() : INPANALOG(m_CV));
134   return (m_CV.is_highz() ? 0.67 * m_VS.Value() : INPANALOG(m_CV));
135135}
136136
137137inline double NETLIB_NAME(nicNE555N_MSTABLE)::nicNE555N_clamp(const double v, const double a, const double b)
138138{
139    double ret = v;
140    if (ret >  m_VS.Value() - a)
141        ret = m_VS.Value() - a;
142    if (ret < b)
143        ret = b;
144    return ret;
139   double ret = v;
140   if (ret >  m_VS.Value() - a)
141      ret = m_VS.Value() - a;
142   if (ret < b)
143      ret = b;
144   return ret;
145145}
146146
147147NETLIB_UPDATE_PARAM(nicNE555N_MSTABLE)
r26736r26737
150150
151151NETLIB_UPDATE(nicNE555N_MSTABLE)
152152{
153    update_param(); // FIXME : m_CV should be on a sub device ...
153   update_param(); // FIXME : m_CV should be on a sub device ...
154154
155    double vt = nicNE555N_clamp(nicNE555N_cv(), 0.7, 1.4);
156    bool bthresh = (INPANALOG(m_THRESHOLD) > vt);
157    bool btrig = (INPANALOG(m_trigger) > nicNE555N_clamp(nicNE555N_cv() * 0.5, 0.7, 1.4));
158    bool out = m_last;
155   double vt = nicNE555N_clamp(nicNE555N_cv(), 0.7, 1.4);
156   bool bthresh = (INPANALOG(m_THRESHOLD) > vt);
157   bool btrig = (INPANALOG(m_trigger) > nicNE555N_clamp(nicNE555N_cv() * 0.5, 0.7, 1.4));
158   bool out = m_last;
159159
160    if (!btrig)
161    {
162        out = true;
163    }
164    else if (bthresh)
165    {
166        out = false;
167    }
160   if (!btrig)
161   {
162      out = true;
163   }
164   else if (bthresh)
165   {
166      out = false;
167   }
168168
169    if (!m_last && out)
170    {
171        double vl = m_VL.Value();
172        double time;
169   if (!m_last && out)
170   {
171      double vl = m_VL.Value();
172      double time;
173173
174        // FIXME : m_CV should be on a sub device ...
174      // FIXME : m_CV should be on a sub device ...
175175
176        // TI datasheet states minimum pulse of 10 us
177        if (vt<vl)
178            time = 10;
179        else
180        {
181            time = - log((m_VS.Value()-vt)/(m_VS.Value()-vl)) * m_R.Value() * m_C.Value() * 1.0e6; // in us
182            if (time < 10.0)
183                time = 10.0;
184        }
176      // TI datasheet states minimum pulse of 10 us
177      if (vt<vl)
178         time = 10;
179      else
180      {
181         time = - log((m_VS.Value()-vt)/(m_VS.Value()-vl)) * m_R.Value() * m_C.Value() * 1.0e6; // in us
182         if (time < 10.0)
183            time = 10.0;
184      }
185185
186        OUTANALOG(m_Q, m_VS.Value() * 0.7, NLTIME_FROM_NS(100));
187        OUTANALOG(m_THRESHOLD_OUT, m_VS.Value(), NLTIME_FROM_US(time ));
188    }
189    else if (m_last && !out)
190    {
191        OUTANALOG(m_Q, 0.25, NLTIME_FROM_NS(100));
192        OUTANALOG(m_THRESHOLD_OUT, 0.0, NLTIME_FROM_NS(1));
193    }
194    m_last = out;
186      OUTANALOG(m_Q, m_VS.Value() * 0.7, NLTIME_FROM_NS(100));
187      OUTANALOG(m_THRESHOLD_OUT, m_VS.Value(), NLTIME_FROM_US(time ));
188   }
189   else if (m_last && !out)
190   {
191      OUTANALOG(m_Q, 0.25, NLTIME_FROM_NS(100));
192      OUTANALOG(m_THRESHOLD_OUT, 0.0, NLTIME_FROM_NS(1));
193   }
194   m_last = out;
195195}
trunk/src/emu/netlist/devices/nld_7483.c
r26736r26737
77
88NETLIB_START(7483)
99{
10    m_lastr = 0;
10   m_lastr = 0;
1111
12    register_input("A1", m_A1);
13    register_input("A2", m_A2);
14    register_input("A3", m_A3);
15    register_input("A4", m_A4);
16    register_input("B1", m_B1);
17    register_input("B2", m_B2);
18    register_input("B3", m_B3);
19    register_input("B4", m_B4);
20    register_input("C0", m_C0);
12   register_input("A1", m_A1);
13   register_input("A2", m_A2);
14   register_input("A3", m_A3);
15   register_input("A4", m_A4);
16   register_input("B1", m_B1);
17   register_input("B2", m_B2);
18   register_input("B3", m_B3);
19   register_input("B4", m_B4);
20   register_input("C0", m_C0);
2121
22    register_output("SA", m_SA);
23    register_output("SB", m_SB);
24    register_output("SC", m_SC);
25    register_output("SD", m_SD);
26    register_output("C4", m_C4);
22   register_output("SA", m_SA);
23   register_output("SB", m_SB);
24   register_output("SC", m_SC);
25   register_output("SD", m_SD);
26   register_output("C4", m_C4);
2727
28    save(NAME(m_lastr));
28   save(NAME(m_lastr));
2929}
3030
3131NETLIB_UPDATE(7483)
3232{
33    UINT8 a = (INPLOGIC(m_A1) << 0) | (INPLOGIC(m_A2) << 1) | (INPLOGIC(m_A3) << 2) | (INPLOGIC(m_A4) << 3);
34    UINT8 b = (INPLOGIC(m_B1) << 0) | (INPLOGIC(m_B2) << 1) | (INPLOGIC(m_B3) << 2) | (INPLOGIC(m_B4) << 3);
33   UINT8 a = (INPLOGIC(m_A1) << 0) | (INPLOGIC(m_A2) << 1) | (INPLOGIC(m_A3) << 2) | (INPLOGIC(m_A4) << 3);
34   UINT8 b = (INPLOGIC(m_B1) << 0) | (INPLOGIC(m_B2) << 1) | (INPLOGIC(m_B3) << 2) | (INPLOGIC(m_B4) << 3);
3535
36    UINT8 r = a + b + INPLOGIC(m_C0);
36   UINT8 r = a + b + INPLOGIC(m_C0);
3737
38    if (r != m_lastr)
39    {
40        m_lastr = r;
41        OUTLOGIC(m_SA, (r >> 0) & 1, NLTIME_FROM_NS(23));
42        OUTLOGIC(m_SB, (r >> 1) & 1, NLTIME_FROM_NS(23));
43        OUTLOGIC(m_SC, (r >> 2) & 1, NLTIME_FROM_NS(23));
44        OUTLOGIC(m_SD, (r >> 3) & 1, NLTIME_FROM_NS(23));
45        OUTLOGIC(m_C4, (r >> 4) & 1, NLTIME_FROM_NS(23));
46    }
38   if (r != m_lastr)
39   {
40      m_lastr = r;
41      OUTLOGIC(m_SA, (r >> 0) & 1, NLTIME_FROM_NS(23));
42      OUTLOGIC(m_SB, (r >> 1) & 1, NLTIME_FROM_NS(23));
43      OUTLOGIC(m_SC, (r >> 2) & 1, NLTIME_FROM_NS(23));
44      OUTLOGIC(m_SD, (r >> 3) & 1, NLTIME_FROM_NS(23));
45      OUTLOGIC(m_C4, (r >> 4) & 1, NLTIME_FROM_NS(23));
46   }
4747}
48
trunk/src/emu/netlist/devices/nld_twoterm.h
r26736r26737
4040// ----------------------------------------------------------------------------------------
4141
4242#define NETDEV_R(_name, _R)                                                         \
43        NET_REGISTER_DEV(R, _name)                                                  \
44        NETDEV_PARAMI(_name, R, _R)
43      NET_REGISTER_DEV(R, _name)                                                  \
44      NETDEV_PARAMI(_name, R, _R)
4545
4646#define NETDEV_POT(_name, _R)                                                       \
47        NET_REGISTER_DEV(POT, _name)                                                \
48        NETDEV_PARAMI(_name, R, _R)
47      NET_REGISTER_DEV(POT, _name)                                                \
48      NETDEV_PARAMI(_name, R, _R)
4949
5050
5151#define NETDEV_C(_name, _C)                                                         \
52        NET_REGISTER_DEV(C, _name)                                                  \
53        NETDEV_PARAMI(_name, C, _C)
52      NET_REGISTER_DEV(C, _name)                                                  \
53      NETDEV_PARAMI(_name, C, _C)
5454
5555/* Generic Diode */
5656#define NETDEV_D(_name,  _model)                                                    \
57        NET_REGISTER_DEV(D, _name)                                                  \
58        NETDEV_PARAMI(_name, model, # _model)
57      NET_REGISTER_DEV(D, _name)                                                  \
58      NETDEV_PARAMI(_name, model, # _model)
5959
6060#define NETDEV_QPNP(_name, _model)                                                 \
61        NET_REGISTER_DEV(QPNP_switch, _name)                                       \
62        NETDEV_PARAMI(_name,  model, # _model)
61      NET_REGISTER_DEV(QPNP_switch, _name)                                       \
62      NETDEV_PARAMI(_name,  model, # _model)
6363
6464#define NETDEV_QNPN(_name, _model)                                                 \
65        NET_REGISTER_DEV(QNPN_switch, _name)                                       \
66        NETDEV_PARAMI(_name,  model, # _model)
65      NET_REGISTER_DEV(QNPN_switch, _name)                                       \
66      NETDEV_PARAMI(_name,  model, # _model)
6767
6868// ----------------------------------------------------------------------------------------
6969// Implementation
r26736r26737
7676class NETLIB_NAME(twoterm) : public netlist_device_t
7777{
7878public:
79    ATTR_COLD NETLIB_NAME(twoterm)(const family_t afamily);
79   ATTR_COLD NETLIB_NAME(twoterm)(const family_t afamily);
8080
81    netlist_terminal_t m_P;
82    netlist_terminal_t m_N;
81   netlist_terminal_t m_P;
82   netlist_terminal_t m_N;
8383
84    virtual NETLIB_UPDATE_TERMINALS()
85    {
86    }
84   virtual NETLIB_UPDATE_TERMINALS()
85   {
86   }
8787
88    ATTR_HOT inline void set(const double G, const double V, const double I)
89    {
90        m_P.m_go = m_N.m_go = m_P.m_gt = m_N.m_gt = G;
91        m_N.m_Idr = ( -V) * G + I;
92        m_P.m_Idr = (  V) * G - I;
93    }
88   ATTR_HOT inline void set(const double G, const double V, const double I)
89   {
90      m_P.m_go = m_N.m_go = m_P.m_gt = m_N.m_gt = G;
91      m_N.m_Idr = ( -V) * G + I;
92      m_P.m_Idr = (  V) * G - I;
93   }
9494protected:
95    ATTR_COLD virtual void start();
96    ATTR_HOT ATTR_ALIGN void update();
95   ATTR_COLD virtual void start();
96   ATTR_HOT ATTR_ALIGN void update();
9797
9898private:
9999};
r26736r26737
105105class NETLIB_NAME(R_base) : public NETLIB_NAME(twoterm)
106106{
107107public:
108    ATTR_COLD NETLIB_NAME(R_base)() : NETLIB_NAME(twoterm)(RESISTOR) { }
108   ATTR_COLD NETLIB_NAME(R_base)() : NETLIB_NAME(twoterm)(RESISTOR) { }
109109
110    inline void set_R(const double R) { set(1.0 / R, 0.0, 0.0); }
110   inline void set_R(const double R) { set(1.0 / R, 0.0, 0.0); }
111111
112112protected:
113    ATTR_COLD virtual void start();
114    ATTR_HOT ATTR_ALIGN void update();
113   ATTR_COLD virtual void start();
114   ATTR_HOT ATTR_ALIGN void update();
115115};
116116
117117NETLIB_DEVICE_WITH_PARAMS_DERIVED(R, R_base,
118    netlist_param_double_t m_R;
118   netlist_param_double_t m_R;
119119);
120120
121121// ----------------------------------------------------------------------------------------
r26736r26737
123123// ----------------------------------------------------------------------------------------
124124
125125NETLIB_DEVICE_WITH_PARAMS(POT,
126    NETLIB_NAME(R_base) m_R1;
127    NETLIB_NAME(R_base) m_R2;
126   NETLIB_NAME(R_base) m_R1;
127   NETLIB_NAME(R_base) m_R2;
128128
129    netlist_param_double_t m_R;
130    netlist_param_double_t m_Dial;
129   netlist_param_double_t m_R;
130   netlist_param_double_t m_Dial;
131131);
132132
133133
r26736r26737
138138class NETLIB_NAME(C) : public NETLIB_NAME(twoterm)
139139{
140140public:
141    ATTR_COLD NETLIB_NAME(C)() : NETLIB_NAME(twoterm)(CAPACITOR) { }
141   ATTR_COLD NETLIB_NAME(C)() : NETLIB_NAME(twoterm)(CAPACITOR) { }
142142
143    ATTR_HOT void step_time(const double st)
144    {
145        double G = m_C.Value() / st;
146        double I = -G * (m_P.net().Q_Analog()- m_N.net().Q_Analog());
147        set(G, 0.0, I);
148    }
143   ATTR_HOT void step_time(const double st)
144   {
145      double G = m_C.Value() / st;
146      double I = -G * (m_P.net().Q_Analog()- m_N.net().Q_Analog());
147      set(G, 0.0, I);
148   }
149149
150150protected:
151    ATTR_COLD virtual void start();
152    ATTR_COLD virtual void update_param();
153    ATTR_HOT ATTR_ALIGN void update();
151   ATTR_COLD virtual void start();
152   ATTR_COLD virtual void update_param();
153   ATTR_HOT ATTR_ALIGN void update();
154154
155    netlist_param_double_t m_C;
155   netlist_param_double_t m_C;
156156
157157};
158158
r26736r26737
167167#if 0
168168inline double fastexp_h(const double x)
169169{
170    static const double ln2r = 1.442695040888963387;
171    static const double ln2  = 0.693147180559945286;
172    //static const double c3   = 0.166666666666666667;
170   static const double ln2r = 1.442695040888963387;
171   static const double ln2  = 0.693147180559945286;
172   //static const double c3   = 0.166666666666666667;
173173
174    const double y = x * ln2r;
175    const unsigned int t = y;
176    const double z = (x - ln2 * (double) t);
177    const double zz = z * z;
178    //const double zzz = zz * z;
174   const double y = x * ln2r;
175   const unsigned int t = y;
176   const double z = (x - ln2 * (double) t);
177   const double zz = z * z;
178   //const double zzz = zz * z;
179179
180    return (double)(1 << t)*(1.0 + z + 0.5 * zz); // + c3*zzz;
180   return (double)(1 << t)*(1.0 + z + 0.5 * zz); // + c3*zzz;
181181}
182182
183183inline double fastexp(const double x)
184184{
185    if (x<0)
186        return 1.0 / fastexp_h(-x);
187    else
188        return fastexp_h(x);
185   if (x<0)
186      return 1.0 / fastexp_h(-x);
187   else
188      return fastexp_h(x);
189189}
190190#endif
191191
192192class NETLIB_NAME(D) : public NETLIB_NAME(twoterm)
193193{
194194public:
195    ATTR_COLD NETLIB_NAME(D)() : NETLIB_NAME(twoterm)(DIODE) { }
195   ATTR_COLD NETLIB_NAME(D)() : NETLIB_NAME(twoterm)(DIODE) { }
196196
197    NETLIB_UPDATE_TERMINALS()
198    {
199        const double nVd = m_P.net().Q_Analog()- m_N.net().Q_Analog();
197   NETLIB_UPDATE_TERMINALS()
198   {
199      const double nVd = m_P.net().Q_Analog()- m_N.net().Q_Analog();
200200
201        //FIXME: Optimize cutoff case
201      //FIXME: Optimize cutoff case
202202
203        double Id;
204        double G;
203      double Id;
204      double G;
205205
206        if (nVd < -5.0 * m_Vt)
207        {
208            m_Vd = nVd;
209            G = NETLIST_GMIN;
210            Id = - m_Is;
211        }
212        else if (nVd < m_Vcrit)
213        {
214            m_Vd = nVd;
206      if (nVd < -5.0 * m_Vt)
207      {
208         m_Vd = nVd;
209         G = NETLIST_GMIN;
210         Id = - m_Is;
211      }
212      else if (nVd < m_Vcrit)
213      {
214         m_Vd = nVd;
215215
216            const double eVDVt = exp(m_Vd * m_VtInv);
217            Id = m_Is * (eVDVt - 1.0);
218            G = m_Is * m_VtInv * eVDVt;
219        }
220        else
221        {
216         const double eVDVt = exp(m_Vd * m_VtInv);
217         Id = m_Is * (eVDVt - 1.0);
218         G = m_Is * m_VtInv * eVDVt;
219      }
220      else
221      {
222222#if defined(_MSC_VER) && _MSC_VER < 1800
223            m_Vd = m_Vd + log((nVd - m_Vd) * m_VtInv + 1.0) * m_Vt;
223         m_Vd = m_Vd + log((nVd - m_Vd) * m_VtInv + 1.0) * m_Vt;
224224#else
225            m_Vd = m_Vd + log1p((nVd - m_Vd) * m_VtInv) * m_Vt;
225         m_Vd = m_Vd + log1p((nVd - m_Vd) * m_VtInv) * m_Vt;
226226#endif
227            const double eVDVt = exp(m_Vd * m_VtInv);
228            Id = m_Is * (eVDVt - 1.0);
227         const double eVDVt = exp(m_Vd * m_VtInv);
228         Id = m_Is * (eVDVt - 1.0);
229229
230            G = m_Is * m_VtInv * eVDVt;
231        }
230         G = m_Is * m_VtInv * eVDVt;
231      }
232232
233        double I = (Id - m_Vd * G);
234        set(G, 0.0, I);
235    }
233      double I = (Id - m_Vd * G);
234      set(G, 0.0, I);
235   }
236236
237237protected:
238    ATTR_COLD virtual void start();
239    ATTR_COLD virtual void update_param();
240    ATTR_HOT ATTR_ALIGN void update();
238   ATTR_COLD virtual void start();
239   ATTR_COLD virtual void update_param();
240   ATTR_HOT ATTR_ALIGN void update();
241241
242    netlist_param_model_t m_model;
242   netlist_param_model_t m_model;
243243
244    double m_Vt;
245    double m_Is;
246    double m_n;
244   double m_Vt;
245   double m_Is;
246   double m_n;
247247
248    double m_VtInv;
249    double m_Vcrit;
250    double m_Vd;
248   double m_VtInv;
249   double m_Vcrit;
250   double m_Vd;
251251
252252};
253253
r26736r26737
269269class NETLIB_NAME(Q) : public netlist_device_t
270270{
271271public:
272    enum q_type {
273        BJT_NPN,
274        BJT_PNP
275    };
272   enum q_type {
273      BJT_NPN,
274      BJT_PNP
275   };
276276
277    ATTR_COLD NETLIB_NAME(Q)(const q_type atype, const family_t afamily)
278    : netlist_device_t(afamily)
279    , m_qtype(atype) { }
277   ATTR_COLD NETLIB_NAME(Q)(const q_type atype, const family_t afamily)
278   : netlist_device_t(afamily)
279   , m_qtype(atype) { }
280280
281    inline q_type qtype() const { return m_qtype; }
282    inline bool is_qtype(q_type atype) const { return m_qtype == atype; }
281   inline q_type qtype() const { return m_qtype; }
282   inline bool is_qtype(q_type atype) const { return m_qtype == atype; }
283283protected:
284    ATTR_COLD virtual void start();
285    ATTR_HOT ATTR_ALIGN void update();
284   ATTR_COLD virtual void start();
285   ATTR_HOT ATTR_ALIGN void update();
286286
287    netlist_param_model_t m_model;
287   netlist_param_model_t m_model;
288288private:
289    q_type m_qtype;
289   q_type m_qtype;
290290};
291291
292292class NETLIB_NAME(QBJT) : public NETLIB_NAME(Q)
293293{
294294public:
295295
296    ATTR_COLD NETLIB_NAME(QBJT)(const q_type atype, const family_t afamily)
297    : NETLIB_NAME(Q)(atype, afamily) { }
296   ATTR_COLD NETLIB_NAME(QBJT)(const q_type atype, const family_t afamily)
297   : NETLIB_NAME(Q)(atype, afamily) { }
298298
299299protected:
300300
r26736r26737
306306class NETLIB_NAME(QBJT_switch) : public NETLIB_NAME(QBJT)
307307{
308308public:
309    ATTR_COLD NETLIB_NAME(QBJT_switch)()
310    : NETLIB_NAME(QBJT)(_type, BJT_SWITCH), m_gB(NETLIST_GMIN), m_gC(NETLIST_GMIN), m_V(0.0), m_state_on(0) { }
309   ATTR_COLD NETLIB_NAME(QBJT_switch)()
310   : NETLIB_NAME(QBJT)(_type, BJT_SWITCH), m_gB(NETLIST_GMIN), m_gC(NETLIST_GMIN), m_V(0.0), m_state_on(0) { }
311311
312    NETLIB_UPDATEI()
313    {
314        double vE = INPANALOG(m_EV);
315        double vB = INPANALOG(m_BV);
312   NETLIB_UPDATEI()
313   {
314      double vE = INPANALOG(m_EV);
315      double vB = INPANALOG(m_BV);
316316
317        int new_state = (vB - vE > m_V ) ? 1 : 0;
318        if (m_state_on ^ new_state)
319        {
320            double gb = m_gB;
321            double gc = m_gC;
322            double v  = m_V;
323            if (!new_state )
324            {
325                // not conducting
326                gb = NETLIST_GMIN;
327                v = 0;
328                gc = NETLIST_GMIN;
329            }
330            m_RB.set(gb, v,   0.0);
331            m_RC.set(gc, 0.0, 0.0);
332            m_state_on = new_state;
333            m_RB.update_dev();
334            m_RC.update_dev();
335        }
317      int new_state = (vB - vE > m_V ) ? 1 : 0;
318      if (m_state_on ^ new_state)
319      {
320         double gb = m_gB;
321         double gc = m_gC;
322         double v  = m_V;
323         if (!new_state )
324         {
325            // not conducting
326            gb = NETLIST_GMIN;
327            v = 0;
328            gc = NETLIST_GMIN;
329         }
330         m_RB.set(gb, v,   0.0);
331         m_RC.set(gc, 0.0, 0.0);
332         m_state_on = new_state;
333         m_RB.update_dev();
334         m_RC.update_dev();
335      }
336336
337    }
337   }
338338
339    NETLIB_NAME(R) m_RB;
340    NETLIB_NAME(R) m_RC;
339   NETLIB_NAME(R) m_RB;
340   NETLIB_NAME(R) m_RC;
341341
342    netlist_analog_input_t m_BV;
343    netlist_analog_input_t m_EV;
342   netlist_analog_input_t m_BV;
343   netlist_analog_input_t m_EV;
344344
345345protected:
346346
347    ATTR_COLD virtual void start();
348    ATTR_COLD void update_param();
347   ATTR_COLD virtual void start();
348   ATTR_COLD void update_param();
349349
350    double m_gB; // base conductance / switch on
351    double m_gC; // collector conductance / switch on
352    double m_V; // internal voltage source
353    UINT8 m_state_on;
350   double m_gB; // base conductance / switch on
351   double m_gC; // collector conductance / switch on
352   double m_V; // internal voltage source
353   UINT8 m_state_on;
354354
355355private:
356356};
r26736r26737
380380 */
381381
382382#define NETDEV_VCCS(_name)                                                         \
383        NET_REGISTER_DEV(VCCS, _name)                                              \
384
383      NET_REGISTER_DEV(VCCS, _name)
385384//NETDEV_PARAMI(_name, model, _model)
386385
387386class NETLIB_NAME(VCCS) : public netlist_device_t
388387{
389388public:
390    ATTR_COLD NETLIB_NAME(VCCS)()
391    : netlist_device_t(VCCS) {  }
392    ATTR_COLD NETLIB_NAME(VCCS)(const family_t afamily)
393    : netlist_device_t(afamily) {  }
389   ATTR_COLD NETLIB_NAME(VCCS)()
390   : netlist_device_t(VCCS) {  }
391   ATTR_COLD NETLIB_NAME(VCCS)(const family_t afamily)
392   : netlist_device_t(afamily) {  }
394393
395394protected:
396    ATTR_COLD virtual void start();
397    ATTR_COLD virtual void update_param();
398    ATTR_HOT ATTR_ALIGN void update();
395   ATTR_COLD virtual void start();
396   ATTR_COLD virtual void update_param();
397   ATTR_HOT ATTR_ALIGN void update();
399398
400    ATTR_COLD void configure(const double Gfac, const double GI);
399   ATTR_COLD void configure(const double Gfac, const double GI);
401400
402    netlist_terminal_t m_OP;
403    netlist_terminal_t m_ON;
401   netlist_terminal_t m_OP;
402   netlist_terminal_t m_ON;
404403
405    netlist_terminal_t m_IP;
406    netlist_terminal_t m_IN;
404   netlist_terminal_t m_IP;
405   netlist_terminal_t m_IN;
407406
408    netlist_terminal_t m_OP1;
409    netlist_terminal_t m_ON1;
407   netlist_terminal_t m_OP1;
408   netlist_terminal_t m_ON1;
410409
411    netlist_param_double_t m_G;
410   netlist_param_double_t m_G;
412411};
413412
414413// ----------------------------------------------------------------------------------------
r26736r26737
439438 */
440439
441440#define NETDEV_VCVS(_name)                                                         \
442        NET_REGISTER_DEV(VCVS, _name)                                              \
443
441      NET_REGISTER_DEV(VCVS, _name)
444442//NETDEV_PARAMI(_name, model, _model)
445443
446444
447445class NETLIB_NAME(VCVS) : public NETLIB_NAME(VCCS)
448446{
449447public:
450    ATTR_COLD NETLIB_NAME(VCVS)()
451    : NETLIB_NAME(VCCS)(VCVS) { }
448   ATTR_COLD NETLIB_NAME(VCVS)()
449   : NETLIB_NAME(VCCS)(VCVS) { }
452450
453451protected:
454    ATTR_COLD virtual void start();
455    ATTR_COLD virtual void update_param();
456    //ATTR_HOT ATTR_ALIGN void update();
452   ATTR_COLD virtual void start();
453   ATTR_COLD virtual void update_param();
454   //ATTR_HOT ATTR_ALIGN void update();
457455
458    netlist_terminal_t m_OP2;
459    netlist_terminal_t m_ON2;
456   netlist_terminal_t m_OP2;
457   netlist_terminal_t m_ON2;
460458
461    double m_mult;
459   double m_mult;
462460
463    netlist_param_double_t m_RO;
461   netlist_param_double_t m_RO;
464462};
465463
466464
trunk/src/emu/netlist/devices/nld_ne555.h
r26736r26737
2323#include "nld_twoterm.h"
2424
2525#define NETDEV_NE555(_name)                                                        \
26      NET_REGISTER_DEV(NE555, _name)                                             \
27
26      NET_REGISTER_DEV(NE555, _name)
2827NETLIB_DEVICE(NE555,
29    NETLIB_NAME(R) m_R1;
30    NETLIB_NAME(R) m_R2;
31    NETLIB_NAME(R) m_R3;
32    NETLIB_NAME(R) m_RDIS;
28   NETLIB_NAME(R) m_R1;
29   NETLIB_NAME(R) m_R2;
30   NETLIB_NAME(R) m_R3;
31   NETLIB_NAME(R) m_RDIS;
3332
34    netlist_logic_input_t m_RESET;
35    netlist_analog_input_t m_THRES;
36    netlist_analog_input_t m_TRIG;
37    netlist_analog_output_t m_OUT;
33   netlist_logic_input_t m_RESET;
34   netlist_analog_input_t m_THRES;
35   netlist_analog_input_t m_TRIG;
36   netlist_analog_output_t m_OUT;
3837
39    bool m_last_out;
38   bool m_last_out;
4039
41    double clamp(const double v, const double a, const double b);
40   double clamp(const double v, const double a, const double b);
4241
4342);
4443
trunk/src/emu/netlist/devices/nld_7425.h
r26736r26737
3939#include "nld_signal.h"
4040
4141#define TTL_7425_NOR(_name, _I1, _I2, _I3, _I4)                                     \
42        NET_REGISTER_DEV(7425, _name)                                               \
43        NET_CONNECT(_name, A, _I1)                                                  \
44        NET_CONNECT(_name, B, _I2)                                                  \
45        NET_CONNECT(_name, C, _I3)                                                  \
46        NET_CONNECT(_name, D, _I4)
42      NET_REGISTER_DEV(7425, _name)                                               \
43      NET_CONNECT(_name, A, _I1)                                                  \
44      NET_CONNECT(_name, B, _I2)                                                  \
45      NET_CONNECT(_name, C, _I3)                                                  \
46      NET_CONNECT(_name, D, _I4)
4747
4848
4949NETLIB_SIGNAL(7425, 4, 1, 0);
trunk/src/emu/netlist/devices/nld_7486.c
r26736r26737
77
88NETLIB_START(7486)
99{
10    register_input("A", m_A);
11    register_input("B", m_B);
12    register_output("Q", m_Q);
10   register_input("A", m_A);
11   register_input("B", m_B);
12   register_output("Q", m_Q);
1313}
1414
1515NETLIB_UPDATE(7486)
1616{
17    static const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
18    UINT8 t = INPLOGIC(m_A) ^ INPLOGIC(m_B);
19    OUTLOGIC(m_Q, t, delay[t]);
17   static const netlist_time delay[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) };
18   UINT8 t = INPLOGIC(m_A) ^ INPLOGIC(m_B);
19   OUTLOGIC(m_Q, t, delay[t]);
2020}
21
trunk/src/emu/netlist/devices/nld_7427.h
r26736r26737
3535#include "nld_signal.h"
3636
3737#define TTL_7427_NOR(_name, _I1, _I2, _I3)                                          \
38        NET_REGISTER_DEV(7427, _name)                                               \
39        NET_CONNECT(_name, A, _I1)                                                  \
40        NET_CONNECT(_name, B, _I2)                                                  \
41        NET_CONNECT(_name, C, _I3)
38      NET_REGISTER_DEV(7427, _name)                                               \
39      NET_CONNECT(_name, A, _I1)                                                  \
40      NET_CONNECT(_name, B, _I2)                                                  \
41      NET_CONNECT(_name, C, _I3)
4242
4343NETLIB_SIGNAL(7427, 3, 1, 0);
4444
trunk/src/emu/netlist/devices/nld_legacy.h
r26736r26737
2020// ----------------------------------------------------------------------------------------
2121
2222#define NETDEV_RSFF(_name, _S, _R)                                                  \
23        NET_REGISTER_DEV(nicRSFF, _name)                                            \
24        NET_CONNECT(_name, S, _S)                                                   \
25        NET_CONNECT(_name, R, _R)
23      NET_REGISTER_DEV(nicRSFF, _name)                                            \
24      NET_CONNECT(_name, S, _S)                                                   \
25      NET_CONNECT(_name, R, _R)
2626
2727
2828#define NE555N_MSTABLE(_name, _TRIG, _CV)                                           \
29        NET_REGISTER_DEV(nicNE555N_MSTABLE, _name)                                  \
30        NET_CONNECT(_name, TRIG, _TRIG)                                             \
31        NET_CONNECT(_name, CV, _CV)
29      NET_REGISTER_DEV(nicNE555N_MSTABLE, _name)                                  \
30      NET_CONNECT(_name, TRIG, _TRIG)                                             \
31      NET_CONNECT(_name, CV, _CV)
3232
3333#define NETDEV_MIXER3(_name, _I1, _I2, _I3)                                         \
34        NET_REGISTER_DEV(nicMixer8, _name)                                          \
35        NET_CONNECT(_name, I1, _I1)                                                 \
36        NET_CONNECT(_name, I2, _I2)                                                 \
37        NET_CONNECT(_name, I3, _I3)
34      NET_REGISTER_DEV(nicMixer8, _name)                                          \
35      NET_CONNECT(_name, I1, _I1)                                                 \
36      NET_CONNECT(_name, I2, _I2)                                                 \
37      NET_CONNECT(_name, I3, _I3)
3838
3939#define NETDEV_SWITCH2(_name, _i1, _i2)                                             \
40        NET_REGISTER_DEV(nicMultiSwitch, _name)                                     \
41        NET_CONNECT(_name, i1, _i1)                                                 \
42        NET_CONNECT(_name, i2, _i2)
40      NET_REGISTER_DEV(nicMultiSwitch, _name)                                     \
41      NET_CONNECT(_name, i1, _i1)                                                 \
42      NET_CONNECT(_name, i2, _i2)
4343
4444// ----------------------------------------------------------------------------------------
4545// Devices ...
4646// ----------------------------------------------------------------------------------------
4747
4848NETLIB_DEVICE(nicRSFF,
49    netlist_ttl_input_t m_S;
50    netlist_ttl_input_t m_R;
49   netlist_ttl_input_t m_S;
50   netlist_ttl_input_t m_R;
5151
52    netlist_ttl_output_t m_Q;
53    netlist_ttl_output_t m_QQ;
52   netlist_ttl_output_t m_Q;
53   netlist_ttl_output_t m_QQ;
5454);
5555
5656NETLIB_DEVICE_WITH_PARAMS(nicMixer8,
57    netlist_analog_input_t m_I[8];
57   netlist_analog_input_t m_I[8];
5858
59    netlist_analog_output_t m_Q;
60    netlist_analog_output_t m_low;
59   netlist_analog_output_t m_Q;
60   netlist_analog_output_t m_low;
6161
62    netlist_param_double_t m_R[8];
62   netlist_param_double_t m_R[8];
6363
64    double m_w[8];
64   double m_w[8];
6565);
6666
6767NETLIB_DEVICE_WITH_PARAMS(nicNE555N_MSTABLE,
6868
69    //ATTR_HOT void timer_cb(INT32 timer_id);
69   //ATTR_HOT void timer_cb(INT32 timer_id);
7070
71    netlist_analog_input_t m_trigger;
72    netlist_analog_input_t m_CV;
73    netlist_analog_input_t m_THRESHOLD; /* internal */
71   netlist_analog_input_t m_trigger;
72   netlist_analog_input_t m_CV;
73   netlist_analog_input_t m_THRESHOLD; /* internal */
7474
75    bool m_last;
75   bool m_last;
7676
77    netlist_analog_output_t m_Q;
78    netlist_analog_output_t m_THRESHOLD_OUT; /* internal */
77   netlist_analog_output_t m_Q;
78   netlist_analog_output_t m_THRESHOLD_OUT; /* internal */
7979
80    //netlist_base_timer_t *m_timer;
81    netlist_param_double_t m_R;
82    netlist_param_double_t m_C;
83    netlist_param_double_t m_VS;
84    netlist_param_double_t m_VL;
80   //netlist_base_timer_t *m_timer;
81   netlist_param_double_t m_R;
82   netlist_param_double_t m_C;
83   netlist_param_double_t m_VS;
84   netlist_param_double_t m_VL;
8585
86    double nicNE555N_cv();
87    double nicNE555N_clamp(const double v, const double a, const double b);
86   double nicNE555N_cv();
87   double nicNE555N_clamp(const double v, const double a, const double b);
8888
8989);
9090
9191NETLIB_DEVICE_WITH_PARAMS(nicMultiSwitch,
92    netlist_analog_input_t m_I[8];
92   netlist_analog_input_t m_I[8];
9393
94    netlist_analog_output_t m_Q;
95    netlist_analog_output_t m_low;
94   netlist_analog_output_t m_Q;
95   netlist_analog_output_t m_low;
9696
97    netlist_param_int_t m_POS;
97   netlist_param_int_t m_POS;
9898
99    int m_position;
99   int m_position;
100100);
101101
102102
trunk/src/emu/netlist/devices/nld_7483.h
r26736r26737
77 *
88 *          +--------------+
99 *       A4 |1     ++    16| B4
10 *       Ʃ3 |2           15| Ʃ3
10 *       ??3 |2           15| ??3
1111 *       A3 |3           14| C4
1212 *       B3 |4    7483   13| C0
1313 *      VCC |5           12| GND
14 *       Ʃ3 |6           11| B1
14 *       ??3 |6           11| B1
1515 *       B2 |7           10| A1
16 *       A2 |8            9| Ʃ3
16 *       A2 |8            9| ??3
1717 *          +--------------+
1818 *
19 *          Ʃ = (A + B + C) & 0x0f
19 *          ?? = (A + B + C) & 0x0f
2020 *
2121 *          C4 = (A + B + C) > 15 ? 1 : 0
2222 *
r26736r26737
3030#include "../nl_base.h"
3131
3232#define TTL_7483(_name, _A1, _A2, _A3, _A4, _B1, _B2, _B3, _B4, _CI)                \
33        NET_REGISTER_DEV(7483, _name)                                               \
34        NET_CONNECT(_name, A1, _A1)                                                 \
35        NET_CONNECT(_name, A2, _A2)                                                 \
36        NET_CONNECT(_name, A3, _A3)                                                 \
37        NET_CONNECT(_name, A4, _A4)                                                 \
38        NET_CONNECT(_name, B1, _B1)                                                 \
39        NET_CONNECT(_name, B2, _B2)                                                 \
40        NET_CONNECT(_name, B3, _B3)                                                 \
41        NET_CONNECT(_name, B4, _B4)                                                 \
42        NET_CONNECT(_name, C0, _CI)
33      NET_REGISTER_DEV(7483, _name)                                               \
34      NET_CONNECT(_name, A1, _A1)                                                 \
35      NET_CONNECT(_name, A2, _A2)                                                 \
36      NET_CONNECT(_name, A3, _A3)                                                 \
37      NET_CONNECT(_name, A4, _A4)                                                 \
38      NET_CONNECT(_name, B1, _B1)                                                 \
39      NET_CONNECT(_name, B2, _B2)                                                 \
40      NET_CONNECT(_name, B3, _B3)                                                 \
41      NET_CONNECT(_name, B4, _B4)                                                 \
42      NET_CONNECT(_name, C0, _CI)
4343
4444NETLIB_DEVICE(7483,
45    netlist_ttl_input_t m_C0;
46    netlist_ttl_input_t m_A1;
47    netlist_ttl_input_t m_A2;
48    netlist_ttl_input_t m_A3;
49    netlist_ttl_input_t m_A4;
50    netlist_ttl_input_t m_B1;
51    netlist_ttl_input_t m_B2;
52    netlist_ttl_input_t m_B3;
53    netlist_ttl_input_t m_B4;
45   netlist_ttl_input_t m_C0;
46   netlist_ttl_input_t m_A1;
47   netlist_ttl_input_t m_A2;
48   netlist_ttl_input_t m_A3;
49   netlist_ttl_input_t m_A4;
50   netlist_ttl_input_t m_B1;
51   netlist_ttl_input_t m_B2;
52   netlist_ttl_input_t m_B3;
53   netlist_ttl_input_t m_B4;
5454
55    UINT8 m_lastr;
55   UINT8 m_lastr;
5656
57    netlist_ttl_output_t m_SA;
58    netlist_ttl_output_t m_SB;
59    netlist_ttl_output_t m_SC;
60    netlist_ttl_output_t m_SD;
61    netlist_ttl_output_t m_C4;
57   netlist_ttl_output_t m_SA;
58   netlist_ttl_output_t m_SB;
59   netlist_ttl_output_t m_SC;
60   netlist_ttl_output_t m_SD;
61   netlist_ttl_output_t m_C4;
6262
6363);
6464
trunk/src/emu/netlist/devices/nld_7486.h
r26736r26737
3535#include "nld_signal.h"
3636
3737#define TTL_7486_XOR(_name, _A, _B)                                                 \
38        NET_REGISTER_DEV(7486, _name)                                               \
39        NET_CONNECT(_name, A, _A)                                                   \
40        NET_CONNECT(_name, B, _B)
38      NET_REGISTER_DEV(7486, _name)                                               \
39      NET_CONNECT(_name, A, _A)                                                   \
40      NET_CONNECT(_name, B, _B)
4141
4242NETLIB_DEVICE(7486,
43        netlist_ttl_input_t m_A;
44        netlist_ttl_input_t m_B;
45        netlist_ttl_output_t m_Q;
43      netlist_ttl_input_t m_A;
44      netlist_ttl_input_t m_B;
45      netlist_ttl_output_t m_Q;
4646);
4747#endif /* NLD_7486_H_ */
trunk/src/emu/netlist/devices/net_lib.c
r26736r26737
5353
5454NETLIB_START(nic7448)
5555{
56    register_sub(sub, "sub");
56   register_sub(sub, "sub");
5757
58    register_subalias("A0", sub.m_A0);
59    register_subalias("A1", sub.m_A1);
60    register_subalias("A2", sub.m_A2);
61    register_subalias("A3", sub.m_A3);
62    register_input("LTQ", m_LTQ);
63    register_input("BIQ", m_BIQ);
64    register_subalias("RBIQ",sub.m_RBIQ);
58   register_subalias("A0", sub.m_A0);
59   register_subalias("A1", sub.m_A1);
60   register_subalias("A2", sub.m_A2);
61   register_subalias("A3", sub.m_A3);
62   register_input("LTQ", m_LTQ);
63   register_input("BIQ", m_BIQ);
64   register_subalias("RBIQ",sub.m_RBIQ);
6565
66    register_subalias("a", sub.m_a);
67    register_subalias("b", sub.m_b);
68    register_subalias("c", sub.m_c);
69    register_subalias("d", sub.m_d);
70    register_subalias("e", sub.m_e);
71    register_subalias("f", sub.m_f);
72    register_subalias("g", sub.m_g);
66   register_subalias("a", sub.m_a);
67   register_subalias("b", sub.m_b);
68   register_subalias("c", sub.m_c);
69   register_subalias("d", sub.m_d);
70   register_subalias("e", sub.m_e);
71   register_subalias("f", sub.m_f);
72   register_subalias("g", sub.m_g);
7373}
7474
7575NETLIB_UPDATE(nic7448)
7676{
77    if (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ))
78    {
79        sub.update_outputs(8);
80    }
81    else if (!INPLOGIC(m_BIQ))
82    {
83        sub.update_outputs(15);
84    }
77   if (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ))
78   {
79      sub.update_outputs(8);
80   }
81   else if (!INPLOGIC(m_BIQ))
82   {
83      sub.update_outputs(15);
84   }
8585
86    if (!INPLOGIC(m_BIQ) || (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ)))
87    {
88        sub.m_A0.inactivate();
89        sub.m_A1.inactivate();
90        sub.m_A2.inactivate();
91        sub.m_A3.inactivate();
92        sub.m_RBIQ.inactivate();
93    } else {
94        sub.m_RBIQ.activate();
95        sub.m_A3.activate();
96        sub.m_A2.activate();
97        sub.m_A1.activate();
98        sub.m_A0.activate();
99        sub.update();
100    }
86   if (!INPLOGIC(m_BIQ) || (INPLOGIC(m_BIQ) && !INPLOGIC(m_LTQ)))
87   {
88      sub.m_A0.inactivate();
89      sub.m_A1.inactivate();
90      sub.m_A2.inactivate();
91      sub.m_A3.inactivate();
92      sub.m_RBIQ.inactivate();
93   } else {
94      sub.m_RBIQ.activate();
95      sub.m_A3.activate();
96      sub.m_A2.activate();
97      sub.m_A1.activate();
98      sub.m_A0.activate();
99      sub.update();
100   }
101101
102102}
103103
104104NETLIB_START(nic7448_sub)
105105{
106    m_state = 0;
106   m_state = 0;
107107
108    register_input("A0", m_A0);
109    register_input("A1", m_A1);
110    register_input("A2", m_A2);
111    register_input("A3", m_A3);
112    register_input("RBIQ", m_RBIQ);
108   register_input("A0", m_A0);
109   register_input("A1", m_A1);
110   register_input("A2", m_A2);
111   register_input("A3", m_A3);
112   register_input("RBIQ", m_RBIQ);
113113
114    register_output("a", m_a);
115    register_output("b", m_b);
116    register_output("c", m_c);
117    register_output("d", m_d);
118    register_output("e", m_e);
119    register_output("f", m_f);
120    register_output("g", m_g);
114   register_output("a", m_a);
115   register_output("b", m_b);
116   register_output("c", m_c);
117   register_output("d", m_d);
118   register_output("e", m_e);
119   register_output("f", m_f);
120   register_output("g", m_g);
121121
122    save(NAME(m_state));
122   save(NAME(m_state));
123123}
124124
125125NETLIB_UPDATE(nic7448_sub)
126126{
127    UINT8 v;
127   UINT8 v;
128128
129    v = (INPLOGIC(m_A0) << 0) | (INPLOGIC(m_A1) << 1) | (INPLOGIC(m_A2) << 2) | (INPLOGIC(m_A3) << 3);
130    if ((!INPLOGIC(m_RBIQ) && (v==0)))
131            v = 15;
132    update_outputs(v);
129   v = (INPLOGIC(m_A0) << 0) | (INPLOGIC(m_A1) << 1) | (INPLOGIC(m_A2) << 2) | (INPLOGIC(m_A3) << 3);
130   if ((!INPLOGIC(m_RBIQ) && (v==0)))
131         v = 15;
132   update_outputs(v);
133133}
134134
135135NETLIB_FUNC_VOID(nic7448_sub, update_outputs, (UINT8 v))
136136{
137    assert(v<16);
138    if (v != m_state)
139    {
140        OUTLOGIC(m_a, tab7448[v][0], NLTIME_FROM_NS(100));
141        OUTLOGIC(m_b, tab7448[v][1], NLTIME_FROM_NS(100));
142        OUTLOGIC(m_c, tab7448[v][2], NLTIME_FROM_NS(100));
143        OUTLOGIC(m_d, tab7448[v][3], NLTIME_FROM_NS(100));
144        OUTLOGIC(m_e, tab7448[v][4], NLTIME_FROM_NS(100));
145        OUTLOGIC(m_f, tab7448[v][5], NLTIME_FROM_NS(100));
146        OUTLOGIC(m_g, tab7448[v][6], NLTIME_FROM_NS(100));
147        m_state = v;
148    }
137   assert(v<16);
138   if (v != m_state)
139   {
140      OUTLOGIC(m_a, tab7448[v][0], NLTIME_FROM_NS(100));
141      OUTLOGIC(m_b, tab7448[v][1], NLTIME_FROM_NS(100));
142      OUTLOGIC(m_c, tab7448[v][2], NLTIME_FROM_NS(100));
143      OUTLOGIC(m_d, tab7448[v][3], NLTIME_FROM_NS(100));
144      OUTLOGIC(m_e, tab7448[v][4], NLTIME_FROM_NS(100));
145      OUTLOGIC(m_f, tab7448[v][5], NLTIME_FROM_NS(100));
146      OUTLOGIC(m_g, tab7448[v][6], NLTIME_FROM_NS(100));
147      m_state = v;
148   }
149149}
150150
151151const UINT8 NETLIB_NAME(nic7448_sub)::tab7448[16][7] =
152152{
153        {   1, 1, 1, 1, 1, 1, 0 },  /* 00 - not blanked ! */
154        {   0, 1, 1, 0, 0, 0, 0 },  /* 01 */
155        {   1, 1, 0, 1, 1, 0, 1 },  /* 02 */
156        {   1, 1, 1, 1, 0, 0, 1 },  /* 03 */
157        {   0, 1, 1, 0, 0, 1, 1 },  /* 04 */
158        {   1, 0, 1, 1, 0, 1, 1 },  /* 05 */
159        {   0, 0, 1, 1, 1, 1, 1 },  /* 06 */
160        {   1, 1, 1, 0, 0, 0, 0 },  /* 07 */
161        {   1, 1, 1, 1, 1, 1, 1 },  /* 08 */
162        {   1, 1, 1, 0, 0, 1, 1 },  /* 09 */
163        {   0, 0, 0, 1, 1, 0, 1 },  /* 10 */
164        {   0, 0, 1, 1, 0, 0, 1 },  /* 11 */
165        {   0, 1, 0, 0, 0, 1, 1 },  /* 12 */
166        {   1, 0, 0, 1, 0, 1, 1 },  /* 13 */
167        {   0, 0, 0, 1, 1, 1, 1 },  /* 14 */
168        {   0, 0, 0, 0, 0, 0, 0 },  /* 15 */
153      {   1, 1, 1, 1, 1, 1, 0 },  /* 00 - not blanked ! */
154      {   0, 1, 1, 0, 0, 0, 0 },  /* 01 */
155      {   1, 1, 0, 1, 1, 0, 1 },  /* 02 */
156      {   1, 1, 1, 1, 0, 0, 1 },  /* 03 */
157      {   0, 1, 1, 0, 0, 1, 1 },  /* 04 */
158      {   1, 0, 1, 1, 0, 1, 1 },  /* 05 */
159      {   0, 0, 1, 1, 1, 1, 1 },  /* 06 */
160      {   1, 1, 1, 0, 0, 0, 0 },  /* 07 */
161      {   1, 1, 1, 1, 1, 1, 1 },  /* 08 */
162      {   1, 1, 1, 0, 0, 1, 1 },  /* 09 */
163      {   0, 0, 0, 1, 1, 0, 1 },  /* 10 */
164      {   0, 0, 1, 1, 0, 0, 1 },  /* 11 */
165      {   0, 1, 0, 0, 0, 1, 1 },  /* 12 */
166      {   1, 0, 0, 1, 0, 1, 1 },  /* 13 */
167      {   0, 0, 0, 1, 1, 1, 1 },  /* 14 */
168      {   0, 0, 0, 0, 0, 0, 0 },  /* 15 */
169169};
170170
171171NETLIB_START(nic7450)
172172{
173    register_input("I1", m_I0);
174    register_input("I2", m_I1);
175    register_input("I3", m_I2);
176    register_input("I4", m_I3);
177    register_output("Q", m_Q);
173   register_input("I1", m_I0);
174   register_input("I2", m_I1);
175   register_input("I3", m_I2);
176   register_input("I4", m_I3);
177   register_output("Q", m_Q);
178178}
179179
180180NETLIB_UPDATE(nic7450)
181181{
182    m_I0.activate();
183    m_I1.activate();
184    m_I2.activate();
185    m_I3.activate();
186    UINT8 t1 = INPLOGIC(m_I0) & INPLOGIC(m_I1);
187    UINT8 t2 = INPLOGIC(m_I2) & INPLOGIC(m_I3);
182   m_I0.activate();
183   m_I1.activate();
184   m_I2.activate();
185   m_I3.activate();
186   UINT8 t1 = INPLOGIC(m_I0) & INPLOGIC(m_I1);
187   UINT8 t2 = INPLOGIC(m_I2) & INPLOGIC(m_I3);
188188#if 0
189    UINT8 t =  (t1 | t2) ^ 1;
190    OUTLOGIC(m_Q, t, t ? NLTIME_FROM_NS(22) : NLTIME_FROM_NS(15));
189   UINT8 t =  (t1 | t2) ^ 1;
190   OUTLOGIC(m_Q, t, t ? NLTIME_FROM_NS(22) : NLTIME_FROM_NS(15));
191191#else
192    const netlist_time times[2] = { NLTIME_FROM_NS(22), NLTIME_FROM_NS(15) };
192   const netlist_time times[2] = { NLTIME_FROM_NS(22), NLTIME_FROM_NS(15) };
193193
194    UINT8 res = 0;
195    if (t1 ^ 1)
196    {
197        if (t2 ^ 1)
198        {
199            res = 1;
200        }
201        else
202        {
203            m_I0.inactivate();
204            m_I1.inactivate();
205        }
206    } else {
207        if (t2 ^ 1)
208        {
209            m_I2.inactivate();
210            m_I3.inactivate();
211        }
212    }
213    OUTLOGIC(m_Q, res, times[1 - res]);// ? 22000 : 15000);
194   UINT8 res = 0;
195   if (t1 ^ 1)
196   {
197      if (t2 ^ 1)
198      {
199         res = 1;
200      }
201      else
202      {
203         m_I0.inactivate();
204         m_I1.inactivate();
205      }
206   } else {
207      if (t2 ^ 1)
208      {
209         m_I2.inactivate();
210         m_I3.inactivate();
211      }
212   }
213   OUTLOGIC(m_Q, res, times[1 - res]);// ? 22000 : 15000);
214214
215215#endif
216216}
r26736r26737
221221
222222NETLIB_START(nic74107Asub)
223223{
224    register_input("CLK", m_clk, netlist_input_t::STATE_INP_HL);
225    register_output("Q", m_Q);
226    register_output("QQ", m_QQ);
224   register_input("CLK", m_clk, netlist_input_t::STATE_INP_HL);
225   register_output("Q", m_Q);
226   register_output("QQ", m_QQ);
227227
228    m_Q.initial(0);
229    m_QQ.initial(1);
228   m_Q.initial(0);
229   m_QQ.initial(1);
230230
231    save(NAME(m_Q1));
232    save(NAME(m_Q2));
233    save(NAME(m_F));
231   save(NAME(m_Q1));
232   save(NAME(m_Q2));
233   save(NAME(m_F));
234234}
235235
236236NETLIB_START(nic74107A)
237237{
238    register_sub(sub, "sub");
238   register_sub(sub, "sub");
239239
240    register_subalias("CLK", sub.m_clk);
241    register_input("J", m_J);
242    register_input("K", m_K);
243    register_input("CLRQ", m_clrQ);
244    register_subalias("Q", sub.m_Q);
245    register_subalias("QQ", sub.m_QQ);
240   register_subalias("CLK", sub.m_clk);
241   register_input("J", m_J);
242   register_input("K", m_K);
243   register_input("CLRQ", m_clrQ);
244   register_subalias("Q", sub.m_Q);
245   register_subalias("QQ", sub.m_QQ);
246246
247    sub.m_Q.initial(0);
248    sub.m_QQ.initial(1);
247   sub.m_Q.initial(0);
248   sub.m_QQ.initial(1);
249249}
250250
251251ATTR_HOT inline void NETLIB_NAME(nic74107Asub)::newstate(const netlist_sig_t state)
252252{
253    const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
253   const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) };
254254#if 1
255    OUTLOGIC(m_Q, state, delay[state ^ 1]);
256    OUTLOGIC(m_QQ, state ^ 1, delay[state]);
255   OUTLOGIC(m_Q, state, delay[state ^ 1]);
256   OUTLOGIC(m_QQ, state ^ 1, delay[state]);
257257#else
258    if (state != Q.new_Q())
259    {
260        Q.setToNoCheck(state, delay[1-state]);
261        QQ.setToNoCheck(1-state, delay[state]);
262    }
258   if (state != Q.new_Q())
259   {
260      Q.setToNoCheck(state, delay[1-state]);
261      QQ.setToNoCheck(1-state, delay[state]);
262   }
263263#endif
264264}
265265
266266NETLIB_UPDATE(nic74107Asub)
267267{
268    {
269        const netlist_sig_t t = m_Q.net().new_Q();
270        newstate((!t & m_Q1) | (t & m_Q2) | m_F);
271        if (!m_Q1)
272            m_clk.inactivate();
273    }
268   {
269      const netlist_sig_t t = m_Q.net().new_Q();
270      newstate((!t & m_Q1) | (t & m_Q2) | m_F);
271      if (!m_Q1)
272         m_clk.inactivate();
273   }
274274}
275275
276276NETLIB_UPDATE(nic74107A)
277277{
278    if (INPLOGIC(m_J) & INPLOGIC(m_K))
279    {
280        sub.m_Q1 = 1;
281        sub.m_Q2 = 0;
282        sub.m_F  = 0;
283    }
284    else if (!INPLOGIC(m_J) & INPLOGIC(m_K))
285    {
286        sub.m_Q1 = 0;
287        sub.m_Q2 = 0;
288        sub.m_F  = 0;
289    }
290    else if (INPLOGIC(m_J) & !INPLOGIC(m_K))
291    {
292        sub.m_Q1 = 0;
293        sub.m_Q2 = 0;
294        sub.m_F  = 1;
295    }
296    else
297    {
298        sub.m_Q1 = 0;
299        sub.m_Q2 = 1;
300        sub.m_F  = 0;
301        sub.m_clk.inactivate();
302    }
303    if (!INPLOGIC(m_clrQ))
304    {
305        sub.m_clk.inactivate();
306        sub.newstate(0);
307    }
308    else if (!sub.m_Q2)
309        sub.m_clk.activate_hl();
310    //if (!sub.m_Q2 & INPLOGIC(m_clrQ))
311    //  sub.m_clk.activate_hl();
278   if (INPLOGIC(m_J) & INPLOGIC(m_K))
279   {
280      sub.m_Q1 = 1;
281      sub.m_Q2 = 0;
282      sub.m_F  = 0;
283   }
284   else if (!INPLOGIC(m_J) & INPLOGIC(m_K))
285   {
286      sub.m_Q1 = 0;
287      sub.m_Q2 = 0;
288      sub.m_F  = 0;
289   }
290   else if (INPLOGIC(m_J) & !INPLOGIC(m_K))
291   {
292      sub.m_Q1 = 0;
293      sub.m_Q2 = 0;
294      sub.m_F  = 1;
295   }
296   else
297   {
298      sub.m_Q1 = 0;
299      sub.m_Q2 = 1;
300      sub.m_F  = 0;
301      sub.m_clk.inactivate();
302   }
303   if (!INPLOGIC(m_clrQ))
304   {
305      sub.m_clk.inactivate();
306      sub.newstate(0);
307   }
308   else if (!sub.m_Q2)
309      sub.m_clk.activate_hl();
310   //if (!sub.m_Q2 & INPLOGIC(m_clrQ))
311   //  sub.m_clk.activate_hl();
312312}
313313
314314NETLIB_START(nic74153)
315315{
316    register_input("A1", m_I[0]);
317    register_input("A2", m_I[1]);
318    register_input("A3", m_I[2]);
319    register_input("A4", m_I[3]);
320    register_input("A", m_A);
321    register_input("B", m_B);
322    register_input("GA", m_GA);
316   register_input("A1", m_I[0]);
317   register_input("A2", m_I[1]);
318   register_input("A3", m_I[2]);
319   register_input("A4", m_I[3]);
320   register_input("A", m_A);
321   register_input("B", m_B);
322   register_input("GA", m_GA);
323323
324    register_output("AY", m_AY);
324   register_output("AY", m_AY);
325325}
326326
327327NETLIB_UPDATE(nic74153)
328328{
329    const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
330    if (!INPLOGIC(m_GA))
331    {
332        UINT8 chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
333        UINT8 t = INPLOGIC(m_I[chan]);
334        OUTLOGIC(m_AY, t, delay[t] ); /* data to y only, FIXME */
335    }
336    else
337    {
338        OUTLOGIC(m_AY, 0, delay[0]);
339    }
329   const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) };
330   if (!INPLOGIC(m_GA))
331   {
332      UINT8 chan = (INPLOGIC(m_A) | (INPLOGIC(m_B)<<1));
333      UINT8 t = INPLOGIC(m_I[chan]);
334      OUTLOGIC(m_AY, t, delay[t] ); /* data to y only, FIXME */
335   }
336   else
337   {
338      OUTLOGIC(m_AY, 0, delay[0]);
339   }
340340}
341341
342342
r26736r26737
346346
347347netlist_factory::netlist_factory()
348348{
349
350349}
351350
352351netlist_factory::~netlist_factory()
353352{
354    for (list_t::entry_t *e = m_list.first(); e != NULL; e = m_list.next(e))
355    {
356        net_device_t_base_factory *p = e->object();
357        delete p;
358    }
359    m_list.reset();
353   for (list_t::entry_t *e = m_list.first(); e != NULL; e = m_list.next(e))
354   {
355      net_device_t_base_factory *p = e->object();
356      delete p;
357   }
358   m_list.reset();
360359}
361360
362361void netlist_factory::initialize()
363362{
364    ENTRY(R,                    NETDEV_R)
365    ENTRY(POT,                  NETDEV_POT)
366    ENTRY(C,                    NETDEV_C)
367    ENTRY(D,                    NETDEV_D)
368    ENTRY(VCVS,                 NETDEV_VCVS)
369    ENTRY(VCCS,                 NETDEV_VCCS)
370    ENTRY(QPNP_switch,          NETDEV_QPNP)
371    ENTRY(QNPN_switch,          NETDEV_QNPN)
372    ENTRY(ttl_const,            NETDEV_TTL_CONST)
373    ENTRY(analog_const,         NETDEV_ANALOG_CONST)
374    ENTRY(logic_input,          NETDEV_LOGIC_INPUT)
375    ENTRY(analog_input,         NETDEV_ANALOG_INPUT)
376    ENTRY(log,                  NETDEV_LOG)
377    ENTRY(logD,                 NETDEV_LOGD)
378    ENTRY(clock,                NETDEV_CLOCK)
379    ENTRY(mainclock,            NETDEV_MAINCLOCK)
380    ENTRY(solver,               NETDEV_SOLVER)
381    ENTRY(nicMultiSwitch,       NETDEV_SWITCH2)
382    ENTRY(nicRSFF,              NETDEV_RSFF)
383    ENTRY(nicMixer8,            NETDEV_MIXER)
384    ENTRY(7400,                 TTL_7400_NAND)
385    ENTRY(7402,                 TTL_7402_NOR)
386    ENTRY(nic7404,              TTL_7404_INVERT)
387    ENTRY(7410,                 TTL_7410_NAND)
388    ENTRY(7420,                 TTL_7420_NAND)
389    ENTRY(7425,                 TTL_7425_NOR)
390    ENTRY(7427,                 TTL_7427_NOR)
391    ENTRY(7430,                 TTL_7430_NAND)
392    ENTRY(nic7450,              TTL_7450_ANDORINVERT)
393    ENTRY(7486,                 TTL_7486_XOR)
394    ENTRY(nic7448,              TTL_7448)
395    ENTRY(7474,                 TTL_7474)
396    ENTRY(7483,                 TTL_7483)
397    ENTRY(7490,                 TTL_7490)
398    ENTRY(7493,                 TTL_7493)
399    ENTRY(nic74107,             TTL_74107)
400    ENTRY(nic74107A,            TTL_74107A)
401    ENTRY(nic74153,             TTL_74153)
402    ENTRY(9316,                 TTL_9316)
403    ENTRY(NE555,                NETDEV_NE555)
404    ENTRY(nicNE555N_MSTABLE,    NE555N_MSTABLE)
363   ENTRY(R,                    NETDEV_R)
364   ENTRY(POT,                  NETDEV_POT)
365   ENTRY(C,                    NETDEV_C)
366   ENTRY(D,                    NETDEV_D)
367   ENTRY(VCVS,                 NETDEV_VCVS)
368   ENTRY(VCCS,                 NETDEV_VCCS)
369   ENTRY(QPNP_switch,          NETDEV_QPNP)
370   ENTRY(QNPN_switch,          NETDEV_QNPN)
371   ENTRY(ttl_const,            NETDEV_TTL_CONST)
372   ENTRY(analog_const,         NETDEV_ANALOG_CONST)
373   ENTRY(logic_input,          NETDEV_LOGIC_INPUT)
374   ENTRY(analog_input,         NETDEV_ANALOG_INPUT)
375   ENTRY(log,                  NETDEV_LOG)
376   ENTRY(logD,                 NETDEV_LOGD)
377   ENTRY(clock,                NETDEV_CLOCK)
378   ENTRY(mainclock,            NETDEV_MAINCLOCK)
379   ENTRY(solver,               NETDEV_SOLVER)
380   ENTRY(nicMultiSwitch,       NETDEV_SWITCH2)
381   ENTRY(nicRSFF,              NETDEV_RSFF)
382   ENTRY(nicMixer8,            NETDEV_MIXER)
383   ENTRY(7400,                 TTL_7400_NAND)
384   ENTRY(7402,                 TTL_7402_NOR)
385   ENTRY(nic7404,              TTL_7404_INVERT)
386   ENTRY(7410,                 TTL_7410_NAND)
387   ENTRY(7420,                 TTL_7420_NAND)
388   ENTRY(7425,                 TTL_7425_NOR)
389   ENTRY(7427,                 TTL_7427_NOR)
390   ENTRY(7430,                 TTL_7430_NAND)
391   ENTRY(nic7450,              TTL_7450_ANDORINVERT)
392   ENTRY(7486,                 TTL_7486_XOR)
393   ENTRY(nic7448,              TTL_7448)
394   ENTRY(7474,                 TTL_7474)
395   ENTRY(7483,                 TTL_7483)
396   ENTRY(7490,                 TTL_7490)
397   ENTRY(7493,                 TTL_7493)
398   ENTRY(nic74107,             TTL_74107)
399   ENTRY(nic74107A,            TTL_74107A)
400   ENTRY(nic74153,             TTL_74153)
401   ENTRY(9316,                 TTL_9316)
402   ENTRY(NE555,                NETDEV_NE555)
403   ENTRY(nicNE555N_MSTABLE,    NE555N_MSTABLE)
405404}
406405
407406netlist_device_t *netlist_factory::new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const
408407{
409    for (list_t::entry_t *e = m_list.first(); e != NULL; e = m_list.next(e))
410    {
411        net_device_t_base_factory *p = e->object();
412        if (strcmp(p->classname(), classname) == 0)
413        {
414            netlist_device_t *ret = p->Create();
415            return ret;
416        }
417        p++;
418    }
419    setup.netlist().xfatalerror("Class %s not found!\n", classname.cstr());
420    return NULL; // appease code analysis
408   for (list_t::entry_t *e = m_list.first(); e != NULL; e = m_list.next(e))
409   {
410      net_device_t_base_factory *p = e->object();
411      if (strcmp(p->classname(), classname) == 0)
412      {
413         netlist_device_t *ret = p->Create();
414         return ret;
415      }
416      p++;
417   }
418   setup.netlist().xfatalerror("Class %s not found!\n", classname.cstr());
419   return NULL; // appease code analysis
421420}
422421
423422netlist_device_t *netlist_factory::new_device_by_name(const pstring &name, netlist_setup_t &setup) const
424423{
425    for (list_t::entry_t *e = m_list.first(); e != NULL; e = m_list.next(e))
426    {
427        net_device_t_base_factory *p = e->object();
428        if (strcmp(p->name(), name) == 0)
429        {
430            netlist_device_t *ret = p->Create();
431            return ret;
432        }
433        p++;
434    }
435    setup.netlist().xfatalerror("Class %s not found!\n", name.cstr());
436    return NULL; // appease code analysis
424   for (list_t::entry_t *e = m_list.first(); e != NULL; e = m_list.next(e))
425   {
426      net_device_t_base_factory *p = e->object();
427      if (strcmp(p->name(), name) == 0)
428      {
429         netlist_device_t *ret = p->Create();
430         return ret;
431      }
432      p++;
433   }
434   setup.netlist().xfatalerror("Class %s not found!\n", name.cstr());
435   return NULL; // appease code analysis
437436}
438
trunk/src/emu/netlist/devices/nld_system.c
r26736r26737
1212
1313NETLIB_START(ttl_const)
1414{
15    register_output("Q", m_Q);
16    register_param("CONST", m_const, 0);
15   register_output("Q", m_Q);
16   register_param("CONST", m_const, 0);
1717}
1818
1919NETLIB_UPDATE(ttl_const)
r26736r26737
2222
2323NETLIB_UPDATE_PARAM(ttl_const)
2424{
25    OUTLOGIC(m_Q, m_const.Value(), NLTIME_IMMEDIATE);
25   OUTLOGIC(m_Q, m_const.Value(), NLTIME_IMMEDIATE);
2626}
2727
2828NETLIB_START(analog_const)
2929{
30    register_output("Q", m_Q);
31    register_param("CONST", m_const, 0.0);
30   register_output("Q", m_Q);
31   register_param("CONST", m_const, 0.0);
3232}
3333
3434NETLIB_UPDATE(analog_const)
r26736r26737
3737
3838NETLIB_UPDATE_PARAM(analog_const)
3939{
40    m_Q.initial(m_const.Value());
40   m_Q.initial(m_const.Value());
4141}
4242
4343// ----------------------------------------------------------------------------------------
r26736r26737
4646
4747NETLIB_START(clock)
4848{
49    register_output("Q", m_Q);
50    //register_input("FB", m_feedback);
49   register_output("Q", m_Q);
50   //register_input("FB", m_feedback);
5151
52    register_param("FREQ", m_freq, 7159000.0 * 5.0);
53    m_inc = netlist_time::from_hz(m_freq.Value()*2);
52   register_param("FREQ", m_freq, 7159000.0 * 5.0);
53   m_inc = netlist_time::from_hz(m_freq.Value()*2);
5454
55    register_link_internal(m_feedback, m_Q, netlist_input_t::STATE_INP_ACTIVE);
55   register_link_internal(m_feedback, m_Q, netlist_input_t::STATE_INP_ACTIVE);
5656
5757}
5858
5959NETLIB_UPDATE_PARAM(clock)
6060{
61    m_inc = netlist_time::from_hz(m_freq.Value()*2);
61   m_inc = netlist_time::from_hz(m_freq.Value()*2);
6262}
6363
6464NETLIB_UPDATE(clock)
6565{
66    OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc  );
66   OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc  );
6767}
6868
6969// ----------------------------------------------------------------------------------------
r26736r26737
7272
7373NETLIB_START(logic_input)
7474{
75    register_output("Q", m_Q);
75   register_output("Q", m_Q);
7676}
7777
7878NETLIB_UPDATE(logic_input)
r26736r26737
8585
8686NETLIB_START(analog_input)
8787{
88    register_output("Q", m_Q);
88   register_output("Q", m_Q);
8989}
9090
9191NETLIB_UPDATE(analog_input)
trunk/src/emu/netlist/devices/net_lib.h
r26736r26737
136136 */
137137
138138NETLIB_SUBDEVICE(nic74107Asub,
139    netlist_ttl_input_t m_clk;
139   netlist_ttl_input_t m_clk;
140140
141141   netlist_ttl_output_t m_Q;
142142   netlist_ttl_output_t m_QQ;
trunk/src/emu/netlist/devices/nld_system.h
r26736r26737
2525      NETDEV_PARAM(_name.CONST, _v)
2626
2727#define NETDEV_MAINCLOCK(_name)                                                     \
28        NET_REGISTER_DEV(mainclock, _name)
28      NET_REGISTER_DEV(mainclock, _name)
2929
3030#define NETDEV_CLOCK(_name)                                                         \
31        NET_REGISTER_DEV(clock, _name)
31      NET_REGISTER_DEV(clock, _name)
3232
3333#define NETDEV_LOGIC_INPUT(_name)                                                   \
34        NET_REGISTER_DEV(logic_input, _name)
34      NET_REGISTER_DEV(logic_input, _name)
3535
3636#define NETDEV_ANALOG_INPUT(_name)                                                  \
37        NET_REGISTER_DEV(analog_input, _name)
37      NET_REGISTER_DEV(analog_input, _name)
3838
3939// ----------------------------------------------------------------------------------------
4040// netdev_*_const
r26736r26737
5656
5757NETLIB_DEVICE_WITH_PARAMS(mainclock,
5858public:
59    netlist_ttl_output_t m_Q;
59   netlist_ttl_output_t m_Q;
6060
6161   netlist_param_double_t m_freq;
6262   netlist_time m_inc;
r26736r26737
6969// ----------------------------------------------------------------------------------------
7070
7171NETLIB_DEVICE_WITH_PARAMS(clock,
72    netlist_ttl_input_t m_feedback;
73    netlist_ttl_output_t m_Q;
72   netlist_ttl_input_t m_feedback;
73   netlist_ttl_output_t m_Q;
7474
75    netlist_param_double_t m_freq;
76    netlist_time m_inc;
75   netlist_param_double_t m_freq;
76   netlist_time m_inc;
7777);
7878
7979
r26736r26737
8282// ----------------------------------------------------------------------------------------
8383
8484NETLIB_DEVICE(logic_input,
85    netlist_ttl_output_t m_Q;
85   netlist_ttl_output_t m_Q;
8686);
8787
8888NETLIB_DEVICE(analog_input,
89    netlist_analog_output_t m_Q;
89   netlist_analog_output_t m_Q;
9090);
9191
9292
trunk/src/emu/netlist/devices/nld_7410.h
r26736r26737
3535#include "nld_signal.h"
3636
3737#define TTL_7410_NAND(_name, _I1, _I2, _I3)                                         \
38        NET_REGISTER_DEV(7410, _name)                                               \
39        NET_CONNECT(_name, A, _I1)                                                  \
40        NET_CONNECT(_name, B, _I2)                                                  \
41        NET_CONNECT(_name, C, _I3)
38      NET_REGISTER_DEV(7410, _name)                                               \
39      NET_CONNECT(_name, A, _I1)                                                  \
40      NET_CONNECT(_name, B, _I2)                                                  \
41      NET_CONNECT(_name, C, _I3)
4242
4343NETLIB_SIGNAL(7410, 3, 0, 0);
4444
trunk/src/emu/netlist/devices/nld_9316.c
r26736r26737
77
88NETLIB_START(9316)
99{
10    register_sub(sub, "sub");
10   register_sub(sub, "sub");
1111
12    register_subalias("CLK", sub.m_clk);
12   register_subalias("CLK", sub.m_clk);
1313
14    register_input("ENP", m_ENP);
15    register_input("ENT", m_ENT);
16    register_input("CLRQ", m_CLRQ);
17    register_input("LOADQ", m_LOADQ);
14   register_input("ENP", m_ENP);
15   register_input("ENT", m_ENT);
16   register_input("CLRQ", m_CLRQ);
17   register_input("LOADQ", m_LOADQ);
1818
19    register_subalias("A", sub.m_A);
20    register_subalias("B", sub.m_B);
21    register_subalias("C", sub.m_C);
22    register_subalias("D", sub.m_D);
19   register_subalias("A", sub.m_A);
20   register_subalias("B", sub.m_B);
21   register_subalias("C", sub.m_C);
22   register_subalias("D", sub.m_D);
2323
24    register_subalias("QA", sub.m_QA);
25    register_subalias("QB", sub.m_QB);
26    register_subalias("QC", sub.m_QC);
27    register_subalias("QD", sub.m_QD);
28    register_subalias("RC", sub.m_RC);
24   register_subalias("QA", sub.m_QA);
25   register_subalias("QB", sub.m_QB);
26   register_subalias("QC", sub.m_QC);
27   register_subalias("QD", sub.m_QD);
28   register_subalias("RC", sub.m_RC);
2929
3030}
3131
3232NETLIB_START(9316_sub)
3333{
34    m_cnt = 0;
35    m_loadq = 1;
36    m_ent = 1;
34   m_cnt = 0;
35   m_loadq = 1;
36   m_ent = 1;
3737
38    register_input("CLK", m_clk, netlist_input_t::STATE_INP_LH);
38   register_input("CLK", m_clk, netlist_input_t::STATE_INP_LH);
3939
40    register_input("A", m_A, netlist_input_t::STATE_INP_PASSIVE);
41    register_input("B", m_B, netlist_input_t::STATE_INP_PASSIVE);
42    register_input("C", m_C, netlist_input_t::STATE_INP_PASSIVE);
43    register_input("D", m_D, netlist_input_t::STATE_INP_PASSIVE);
40   register_input("A", m_A, netlist_input_t::STATE_INP_PASSIVE);
41   register_input("B", m_B, netlist_input_t::STATE_INP_PASSIVE);
42   register_input("C", m_C, netlist_input_t::STATE_INP_PASSIVE);
43   register_input("D", m_D, netlist_input_t::STATE_INP_PASSIVE);
4444
45    register_output("QA", m_QA);
46    register_output("QB", m_QB);
47    register_output("QC", m_QC);
48    register_output("QD", m_QD);
49    register_output("RC", m_RC);
45   register_output("QA", m_QA);
46   register_output("QB", m_QB);
47   register_output("QC", m_QC);
48   register_output("QD", m_QD);
49   register_output("RC", m_RC);
5050
51    save(NAME(m_cnt));
52    save(NAME(m_loadq));
53    save(NAME(m_ent));
51   save(NAME(m_cnt));
52   save(NAME(m_loadq));
53   save(NAME(m_ent));
5454}
5555
5656NETLIB_UPDATE(9316_sub)
5757{
58    UINT8 cnt = m_cnt;
59    if (m_loadq)
60    {
61        cnt = ( cnt + 1) & 0x0f;
62        update_outputs(cnt);
63        if (cnt == 0x0f)
64            OUTLOGIC(m_RC, m_ent, NLTIME_FROM_NS(20));
65        else if (cnt == 0)
66            OUTLOGIC(m_RC, 0, NLTIME_FROM_NS(20));
67    }
68    else
69    {
70        cnt = (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0);
71        update_outputs_all(cnt);
72        OUTLOGIC(m_RC, m_ent & (cnt == 0x0f), NLTIME_FROM_NS(20));
73    }
74    m_cnt = cnt;
58   UINT8 cnt = m_cnt;
59   if (m_loadq)
60   {
61      cnt = ( cnt + 1) & 0x0f;
62      update_outputs(cnt);
63      if (cnt == 0x0f)
64         OUTLOGIC(m_RC, m_ent, NLTIME_FROM_NS(20));
65      else if (cnt == 0)
66         OUTLOGIC(m_RC, 0, NLTIME_FROM_NS(20));
67   }
68   else
69   {
70      cnt = (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0);
71      update_outputs_all(cnt);
72      OUTLOGIC(m_RC, m_ent & (cnt == 0x0f), NLTIME_FROM_NS(20));
73   }
74   m_cnt = cnt;
7575}
7676
7777NETLIB_UPDATE(9316)
7878{
79    sub.m_loadq = INPLOGIC(m_LOADQ);
80    sub.m_ent = INPLOGIC(m_ENT);
81    const netlist_sig_t clrq = INPLOGIC(m_CLRQ);
79   sub.m_loadq = INPLOGIC(m_LOADQ);
80   sub.m_ent = INPLOGIC(m_ENT);
81   const netlist_sig_t clrq = INPLOGIC(m_CLRQ);
8282
83    if ((!sub.m_loadq || (sub.m_ent & INPLOGIC(m_ENP))) & clrq)
84    {
85        sub.m_clk.activate_lh();
86    }
87    else
88    {
89        sub.m_clk.inactivate();
90        if (!clrq & (sub.m_cnt>0))
91        {
92            sub.m_cnt = 0;
93            sub.update_outputs(sub.m_cnt);
94            OUTLOGIC(sub.m_RC, 0, NLTIME_FROM_NS(20));
95            return;
96        }
97    }
98    OUTLOGIC(sub.m_RC, sub.m_ent & (sub.m_cnt == 0x0f), NLTIME_FROM_NS(20));
83   if ((!sub.m_loadq || (sub.m_ent & INPLOGIC(m_ENP))) & clrq)
84   {
85      sub.m_clk.activate_lh();
86   }
87   else
88   {
89      sub.m_clk.inactivate();
90      if (!clrq & (sub.m_cnt>0))
91      {
92         sub.m_cnt = 0;
93         sub.update_outputs(sub.m_cnt);
94         OUTLOGIC(sub.m_RC, 0, NLTIME_FROM_NS(20));
95         return;
96      }
97   }
98   OUTLOGIC(sub.m_RC, sub.m_ent & (sub.m_cnt == 0x0f), NLTIME_FROM_NS(20));
9999}
100100
101101inline NETLIB_FUNC_VOID(9316_sub, update_outputs_all, (const UINT8 cnt))
102102{
103    const netlist_time out_delay = NLTIME_FROM_NS(20);
104    OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
105    OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay);
106    OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay);
107    OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
103   const netlist_time out_delay = NLTIME_FROM_NS(20);
104   OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
105   OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay);
106   OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay);
107   OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
108108}
109109
110110inline NETLIB_FUNC_VOID(9316_sub, update_outputs, (const UINT8 cnt))
111111{
112    const netlist_time out_delay = NLTIME_FROM_NS(20);
112   const netlist_time out_delay = NLTIME_FROM_NS(20);
113113#if 0
114114//    for (int i=0; i<4; i++)
115115//        OUTLOGIC(m_Q[i], (cnt >> i) & 1, delay[i]);
116    OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
117    OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay);
118    OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay);
119    OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
116   OUTLOGIC(m_QA, (cnt >> 0) & 1, out_delay);
117   OUTLOGIC(m_QB, (cnt >> 1) & 1, out_delay);
118   OUTLOGIC(m_QC, (cnt >> 2) & 1, out_delay);
119   OUTLOGIC(m_QD, (cnt >> 3) & 1, out_delay);
120120#else
121    if ((cnt & 1) == 1)
122        OUTLOGIC(m_QA, 1, out_delay);
123    else
124    {
125        OUTLOGIC(m_QA, 0, out_delay);
126        switch (cnt)
127        {
128        case 0x00:
129            OUTLOGIC(m_QB, 0, out_delay);
130            OUTLOGIC(m_QC, 0, out_delay);
131            OUTLOGIC(m_QD, 0, out_delay);
132            break;
133        case 0x02:
134        case 0x06:
135        case 0x0A:
136        case 0x0E:
137            OUTLOGIC(m_QB, 1, out_delay);
138            break;
139        case 0x04:
140        case 0x0C:
141            OUTLOGIC(m_QB, 0, out_delay);
142            OUTLOGIC(m_QC, 1, out_delay);
143            break;
144        case 0x08:
145            OUTLOGIC(m_QB, 0, out_delay);
146            OUTLOGIC(m_QC, 0, out_delay);
147            OUTLOGIC(m_QD, 1, out_delay);
148            break;
149        }
121   if ((cnt & 1) == 1)
122      OUTLOGIC(m_QA, 1, out_delay);
123   else
124   {
125      OUTLOGIC(m_QA, 0, out_delay);
126      switch (cnt)
127      {
128      case 0x00:
129         OUTLOGIC(m_QB, 0, out_delay);
130         OUTLOGIC(m_QC, 0, out_delay);
131         OUTLOGIC(m_QD, 0, out_delay);
132         break;
133      case 0x02:
134      case 0x06:
135      case 0x0A:
136      case 0x0E:
137         OUTLOGIC(m_QB, 1, out_delay);
138         break;
139      case 0x04:
140      case 0x0C:
141         OUTLOGIC(m_QB, 0, out_delay);
142         OUTLOGIC(m_QC, 1, out_delay);
143         break;
144      case 0x08:
145         OUTLOGIC(m_QB, 0, out_delay);
146         OUTLOGIC(m_QC, 0, out_delay);
147         OUTLOGIC(m_QD, 1, out_delay);
148         break;
149      }
150150
151    }
151   }
152152#endif
153153}
154
trunk/src/emu/netlist/devices/nld_7430.h
r26736r26737
4040#include "nld_signal.h"
4141
4242#define TTL_7430_NAND(_name, _I1, _I2, _I3, _I4, _I5, _I6, _I7, _I8)                \
43        NET_REGISTER_DEV(7430, _name)                                               \
44        NET_CONNECT(_name, A, _I1)                                                  \
45        NET_CONNECT(_name, B, _I2)                                                  \
46        NET_CONNECT(_name, C, _I3)                                                  \
47        NET_CONNECT(_name, D, _I4)                                                  \
48        NET_CONNECT(_name, E, _I5)                                                  \
49        NET_CONNECT(_name, F, _I6)                                                  \
50        NET_CONNECT(_name, G, _I7)                                                  \
51        NET_CONNECT(_name, H, _I8)
43      NET_REGISTER_DEV(7430, _name)                                               \
44      NET_CONNECT(_name, A, _I1)                                                  \
45      NET_CONNECT(_name, B, _I2)                                                  \
46      NET_CONNECT(_name, C, _I3)                                                  \
47      NET_CONNECT(_name, D, _I4)                                                  \
48      NET_CONNECT(_name, E, _I5)                                                  \
49      NET_CONNECT(_name, F, _I6)                                                  \
50      NET_CONNECT(_name, G, _I7)                                                  \
51      NET_CONNECT(_name, H, _I8)
5252
5353
5454NETLIB_SIGNAL(7430, 8, 0, 0);
trunk/src/emu/netlist/devices/nld_7490.c
r26736r26737
77
88NETLIB_START(7490)
99{
10    m_cnt = 0;
10   m_cnt = 0;
1111
12    register_input("CLK", m_clk);
13    register_input("R1",  m_R1);
14    register_input("R2",  m_R2);
15    register_input("R91", m_R91);
16    register_input("R92", m_R92);
12   register_input("CLK", m_clk);
13   register_input("R1",  m_R1);
14   register_input("R2",  m_R2);
15   register_input("R91", m_R91);
16   register_input("R92", m_R92);
1717
18    register_output("QA", m_Q[0]);
19    register_output("QB", m_Q[1]);
20    register_output("QC", m_Q[2]);
21    register_output("QD", m_Q[3]);
18   register_output("QA", m_Q[0]);
19   register_output("QB", m_Q[1]);
20   register_output("QC", m_Q[2]);
21   register_output("QD", m_Q[3]);
2222
23    save(NAME(m_cnt));
23   save(NAME(m_cnt));
2424
2525}
2626
2727NETLIB_UPDATE(7490)
2828{
29    if (INPLOGIC(m_R91) & INPLOGIC(m_R92))
30    {
31        m_cnt = 9;
32        update_outputs();
33    }
34    else if (INPLOGIC(m_R1) & INPLOGIC(m_R2))
35    {
36        m_cnt = 0;
37        update_outputs();
38    }
39    else if (INP_HL(m_clk))
40    {
41        m_cnt++;
42        if (m_cnt >= 10)
43            m_cnt = 0;
44        update_outputs();
45    }
29   if (INPLOGIC(m_R91) & INPLOGIC(m_R92))
30   {
31      m_cnt = 9;
32      update_outputs();
33   }
34   else if (INPLOGIC(m_R1) & INPLOGIC(m_R2))
35   {
36      m_cnt = 0;
37      update_outputs();
38   }
39   else if (INP_HL(m_clk))
40   {
41      m_cnt++;
42      if (m_cnt >= 10)
43         m_cnt = 0;
44      update_outputs();
45   }
4646}
4747
4848NETLIB_FUNC_VOID(7490, update_outputs, (void))
4949{
50    const netlist_time delay[4] = { NLTIME_FROM_NS(18), NLTIME_FROM_NS(36), NLTIME_FROM_NS(54), NLTIME_FROM_NS(72) };
51    for (int i=0; i<4; i++)
52        OUTLOGIC(m_Q[i], (m_cnt >> i) & 1, delay[i]);
50   const netlist_time delay[4] = { NLTIME_FROM_NS(18), NLTIME_FROM_NS(36), NLTIME_FROM_NS(54), NLTIME_FROM_NS(72) };
51   for (int i=0; i<4; i++)
52      OUTLOGIC(m_Q[i], (m_cnt >> i) & 1, delay[i]);
5353}
trunk/src/emu/netlist/devices/nld_7474.c
r26736r26737
77
88ATTR_HOT inline void NETLIB_NAME(7474sub)::newstate(const UINT8 state)
99{
10    static const netlist_time delay[2] = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(40) };
11    OUTLOGIC(m_Q, state, delay[state]);
12    OUTLOGIC(m_QQ, !state, delay[!state]);
10   static const netlist_time delay[2] = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(40) };
11   OUTLOGIC(m_Q, state, delay[state]);
12   OUTLOGIC(m_QQ, !state, delay[!state]);
1313}
1414
1515NETLIB_UPDATE(7474sub)
1616{
17    //if (!INP_LAST(m_clk) & INP(m_clk))
18    {
19        newstate(m_nextD);
20        m_clk.inactivate();
21    }
17   //if (!INP_LAST(m_clk) & INP(m_clk))
18   {
19      newstate(m_nextD);
20      m_clk.inactivate();
21   }
2222}
2323
2424NETLIB_UPDATE(7474)
2525{
26    if (!INPLOGIC(m_preQ))
27    {
28        sub.newstate(1);
29        sub.m_clk.inactivate();
30        m_D.inactivate();
31    }
32    else if (!INPLOGIC(m_clrQ))
33    {
34        sub.newstate(0);
35        sub.m_clk.inactivate();
36        m_D.inactivate();
37    }
38    else
39    {
40        m_D.activate();
41        sub.m_nextD = INPLOGIC(m_D);
42        sub.m_clk.activate_lh();
43    }
26   if (!INPLOGIC(m_preQ))
27   {
28      sub.newstate(1);
29      sub.m_clk.inactivate();
30      m_D.inactivate();
31   }
32   else if (!INPLOGIC(m_clrQ))
33   {
34      sub.newstate(0);
35      sub.m_clk.inactivate();
36      m_D.inactivate();
37   }
38   else
39   {
40      m_D.activate();
41      sub.m_nextD = INPLOGIC(m_D);
42      sub.m_clk.activate_lh();
43   }
4444}
4545
4646NETLIB_START(7474)
4747{
48    register_sub(sub, "sub");
48   register_sub(sub, "sub");
4949
50    register_subalias("CLK",  sub.m_clk);
51    register_input("D",    m_D);
52    register_input("CLRQ", m_clrQ);
53    register_input("PREQ", m_preQ);
50   register_subalias("CLK",  sub.m_clk);
51   register_input("D",    m_D);
52   register_input("CLRQ", m_clrQ);
53   register_input("PREQ", m_preQ);
5454
55    register_subalias("Q",   sub.m_Q);
56    register_subalias("QQ",  sub.m_QQ);
55   register_subalias("Q",   sub.m_Q);
56   register_subalias("QQ",  sub.m_QQ);
5757
5858}
5959
6060NETLIB_START(7474sub)
6161{
62    register_input("CLK",  m_clk, netlist_input_t::STATE_INP_LH);
62   register_input("CLK",  m_clk, netlist_input_t::STATE_INP_LH);
6363
64    register_output("Q",   m_Q);
65    register_output("QQ",  m_QQ);
64   register_output("Q",   m_Q);
65   register_output("QQ",  m_QQ);
6666
67    m_Q.initial(1);
68    m_QQ.initial(0);
67   m_Q.initial(1);
68   m_QQ.initial(0);
6969}
trunk/src/emu/netlist/devices/nld_7493.c
r26736r26737
77
88NETLIB_START(7493)
99{
10    register_sub(A, "A");
11    register_sub(B, "B");
12    register_sub(C, "C");
13    register_sub(D, "D");
10   register_sub(A, "A");
11   register_sub(B, "B");
12   register_sub(C, "C");
13   register_sub(D, "D");
1414
15    register_subalias("CLKA", A.m_I);
16    register_subalias("CLKB", B.m_I);
17    register_input("R1",  m_R1);
18    register_input("R2",  m_R2);
15   register_subalias("CLKA", A.m_I);
16   register_subalias("CLKB", B.m_I);
17   register_input("R1",  m_R1);
18   register_input("R2",  m_R2);
1919
20    register_subalias("QA", A.m_Q);
21    register_subalias("QB", B.m_Q);
22    register_subalias("QC", C.m_Q);
23    register_subalias("QD", D.m_Q);
20   register_subalias("QA", A.m_Q);
21   register_subalias("QB", B.m_Q);
22   register_subalias("QC", C.m_Q);
23   register_subalias("QD", D.m_Q);
2424
25    register_link_internal(C, C.m_I, B.m_Q, netlist_input_t::STATE_INP_HL);
26    register_link_internal(D, D.m_I, C.m_Q, netlist_input_t::STATE_INP_HL);
25   register_link_internal(C, C.m_I, B.m_Q, netlist_input_t::STATE_INP_HL);
26   register_link_internal(D, D.m_I, C.m_Q, netlist_input_t::STATE_INP_HL);
2727}
2828
2929NETLIB_START(7493ff)
3030{
31    m_reset = 0;
31   m_reset = 0;
3232
33    register_input("CLK", m_I, netlist_input_t::STATE_INP_HL);
34    register_output("Q", m_Q);
33   register_input("CLK", m_I, netlist_input_t::STATE_INP_HL);
34   register_output("Q", m_Q);
3535
36    save(NAME(m_reset));
36   save(NAME(m_reset));
3737}
3838
3939NETLIB_UPDATE(7493ff)
4040{
41    if (m_reset == 0)
42        OUTLOGIC(m_Q, !m_Q.net().new_Q(), NLTIME_FROM_NS(18));
41   if (m_reset == 0)
42      OUTLOGIC(m_Q, !m_Q.net().new_Q(), NLTIME_FROM_NS(18));
4343}
4444
4545NETLIB_UPDATE(7493)
4646{
47    netlist_sig_t r = INPLOGIC(m_R1) & INPLOGIC(m_R2);
47   netlist_sig_t r = INPLOGIC(m_R1) & INPLOGIC(m_R2);
4848
49    if (r)
50    {
51        A.m_reset = B.m_reset = C.m_reset = D.m_reset = 1;
52        A.m_I.inactivate();
53        B.m_I.inactivate();
54        OUTLOGIC(A.m_Q, 0, NLTIME_FROM_NS(40));
55        OUTLOGIC(B.m_Q, 0, NLTIME_FROM_NS(40));
56        OUTLOGIC(C.m_Q, 0, NLTIME_FROM_NS(40));
57        OUTLOGIC(D.m_Q, 0, NLTIME_FROM_NS(40));
58    }
59    else
60    {
61        A.m_reset = B.m_reset = C.m_reset = D.m_reset = 0;
62        A.m_I.activate_hl();
63        B.m_I.activate_hl();
64    }
49   if (r)
50   {
51      A.m_reset = B.m_reset = C.m_reset = D.m_reset = 1;
52      A.m_I.inactivate();
53      B.m_I.inactivate();
54      OUTLOGIC(A.m_Q, 0, NLTIME_FROM_NS(40));
55      OUTLOGIC(B.m_Q, 0, NLTIME_FROM_NS(40));
56      OUTLOGIC(C.m_Q, 0, NLTIME_FROM_NS(40));
57      OUTLOGIC(D.m_Q, 0, NLTIME_FROM_NS(40));
58   }
59   else
60   {
61      A.m_reset = B.m_reset = C.m_reset = D.m_reset = 0;
62      A.m_I.activate_hl();
63      B.m_I.activate_hl();
64   }
6565}
trunk/src/emu/netlist/devices/nld_9316.h
r26736r26737
5252#include "../nl_base.h"
5353
5454#define TTL_9316(_name, _CLK, _ENP, _ENT, _CLRQ, _LOADQ, _A, _B, _C, _D)            \
55        NET_REGISTER_DEV(9316, _name)                                               \
56        NET_CONNECT(_name, CLK, _CLK)                                               \
57        NET_CONNECT(_name, ENP,  _ENP)                                              \
58        NET_CONNECT(_name, ENT,  _ENT)                                              \
59        NET_CONNECT(_name, CLRQ, _CLRQ)                                             \
60        NET_CONNECT(_name, LOADQ,_LOADQ)                                            \
61        NET_CONNECT(_name, A,    _A)                                                \
62        NET_CONNECT(_name, B,    _B)                                                \
63        NET_CONNECT(_name, C,    _C)                                                \
64        NET_CONNECT(_name, D,    _D)
55      NET_REGISTER_DEV(9316, _name)                                               \
56      NET_CONNECT(_name, CLK, _CLK)                                               \
57      NET_CONNECT(_name, ENP,  _ENP)                                              \
58      NET_CONNECT(_name, ENT,  _ENT)                                              \
59      NET_CONNECT(_name, CLRQ, _CLRQ)                                             \
60      NET_CONNECT(_name, LOADQ,_LOADQ)                                            \
61      NET_CONNECT(_name, A,    _A)                                                \
62      NET_CONNECT(_name, B,    _B)                                                \
63      NET_CONNECT(_name, C,    _C)                                                \
64      NET_CONNECT(_name, D,    _D)
6565
6666NETLIB_SUBDEVICE(9316_sub,
67    ATTR_HOT void update_outputs_all(const UINT8 cnt);
68    ATTR_HOT void update_outputs(const UINT8 cnt);
67   ATTR_HOT void update_outputs_all(const UINT8 cnt);
68   ATTR_HOT void update_outputs(const UINT8 cnt);
6969
70    netlist_ttl_input_t m_clk;
70   netlist_ttl_input_t m_clk;
7171
72    netlist_ttl_input_t m_A;
73    netlist_ttl_input_t m_B;
74    netlist_ttl_input_t m_C;
75    netlist_ttl_input_t m_D;
72   netlist_ttl_input_t m_A;
73   netlist_ttl_input_t m_B;
74   netlist_ttl_input_t m_C;
75   netlist_ttl_input_t m_D;
7676
77    UINT8 m_cnt;
78    netlist_sig_t m_loadq;
79    netlist_sig_t m_ent;
77   UINT8 m_cnt;
78   netlist_sig_t m_loadq;
79   netlist_sig_t m_ent;
8080
81    netlist_ttl_output_t m_QA;
82    netlist_ttl_output_t m_QB;
83    netlist_ttl_output_t m_QC;
84    netlist_ttl_output_t m_QD;
85    netlist_ttl_output_t m_RC;
81   netlist_ttl_output_t m_QA;
82   netlist_ttl_output_t m_QB;
83   netlist_ttl_output_t m_QC;
84   netlist_ttl_output_t m_QD;
85   netlist_ttl_output_t m_RC;
8686);
8787
8888NETLIB_DEVICE(9316,
89    NETLIB_NAME(9316_sub) sub;
90    netlist_ttl_input_t m_ENP;
91    netlist_ttl_input_t m_ENT;
92    netlist_ttl_input_t m_CLRQ;
93    netlist_ttl_input_t m_LOADQ;
89   NETLIB_NAME(9316_sub) sub;
90   netlist_ttl_input_t m_ENP;
91   netlist_ttl_input_t m_ENT;
92   netlist_ttl_input_t m_CLRQ;
93   netlist_ttl_input_t m_LOADQ;
9494);
9595
9696#endif /* NLD_9316_H_ */
trunk/src/emu/netlist/devices/nld_7490.h
r26736r26737
5858#include "../nl_base.h"
5959
6060#define TTL_7490(_name, _CLK, _R1, _R2, _R91, _R92)                                 \
61        NET_REGISTER_DEV(7490, _name)                                               \
62        NET_CONNECT(_name, CLK, _CLK)                                               \
63        NET_CONNECT(_name, R1,  _R1)                                                \
64        NET_CONNECT(_name, R2,  _R2)                                                \
65        NET_CONNECT(_name, R91, _R91)                                               \
66        NET_CONNECT(_name, R92, _R92)
61      NET_REGISTER_DEV(7490, _name)                                               \
62      NET_CONNECT(_name, CLK, _CLK)                                               \
63      NET_CONNECT(_name, R1,  _R1)                                                \
64      NET_CONNECT(_name, R2,  _R2)                                                \
65      NET_CONNECT(_name, R91, _R91)                                               \
66      NET_CONNECT(_name, R92, _R92)
6767
6868
6969NETLIB_DEVICE(7490,
70    ATTR_HOT void update_outputs();
70   ATTR_HOT void update_outputs();
7171
72    netlist_ttl_input_t m_R1;
73    netlist_ttl_input_t m_R2;
74    netlist_ttl_input_t m_R91;
75    netlist_ttl_input_t m_R92;
76    netlist_ttl_input_t m_clk;
72   netlist_ttl_input_t m_R1;
73   netlist_ttl_input_t m_R2;
74   netlist_ttl_input_t m_R91;
75   netlist_ttl_input_t m_R92;
76   netlist_ttl_input_t m_clk;
7777
78    UINT8 m_cnt;
78   UINT8 m_cnt;
7979
80    netlist_ttl_output_t m_Q[4];
80   netlist_ttl_output_t m_Q[4];
8181);
8282
8383#endif /* NLD_7490_H_ */
trunk/src/emu/netlist/devices/nld_7474.h
r26736r26737
4545#include "nld_signal.h"
4646
4747#define TTL_7474(_name, _CLK, _D, _CLRQ, _PREQ)                                     \
48        NET_REGISTER_DEV(7474, _name)                                               \
49        NET_CONNECT(_name, CLK, _CLK)                                               \
50        NET_CONNECT(_name, D,  _D)                                                  \
51        NET_CONNECT(_name, CLRQ,  _CLRQ)                                            \
52        NET_CONNECT(_name, PREQ,  _PREQ)
48      NET_REGISTER_DEV(7474, _name)                                               \
49      NET_CONNECT(_name, CLK, _CLK)                                               \
50      NET_CONNECT(_name, D,  _D)                                                  \
51      NET_CONNECT(_name, CLRQ,  _CLRQ)                                            \
52      NET_CONNECT(_name, PREQ,  _PREQ)
5353
5454NETLIB_SUBDEVICE(7474sub,
55    netlist_ttl_input_t m_clk;
55   netlist_ttl_input_t m_clk;
5656
57    UINT8 m_nextD;
58    netlist_ttl_output_t m_Q;
59    netlist_ttl_output_t m_QQ;
57   UINT8 m_nextD;
58   netlist_ttl_output_t m_Q;
59   netlist_ttl_output_t m_QQ;
6060
61    ATTR_HOT inline void newstate(const UINT8 state);
61   ATTR_HOT inline void newstate(const UINT8 state);
6262);
6363
6464NETLIB_DEVICE(7474,
65    NETLIB_NAME(7474sub) sub;
65   NETLIB_NAME(7474sub) sub;
6666
67    netlist_ttl_input_t m_D;
68    netlist_ttl_input_t m_clrQ;
69    netlist_ttl_input_t m_preQ;
67   netlist_ttl_input_t m_D;
68   netlist_ttl_input_t m_clrQ;
69   netlist_ttl_input_t m_preQ;
7070);
7171
7272
trunk/src/emu/netlist/devices/nld_solver.c
r26736r26737
1515
1616ATTR_COLD void netlist_matrix_solver_t::setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &aowner)
1717{
18    m_owner = &aowner;
19    for (netlist_net_t::list_t::entry_t *pn = nets.first(); pn != NULL; pn = nets.next(pn))
20    {
21        NL_VERBOSE_OUT(("setting up net\n"));
18   m_owner = &aowner;
19   for (netlist_net_t::list_t::entry_t *pn = nets.first(); pn != NULL; pn = nets.next(pn))
20   {
21      NL_VERBOSE_OUT(("setting up net\n"));
2222
23        m_nets.add(pn->object());
24        pn->object()->m_solver = this;
23      m_nets.add(pn->object());
24      pn->object()->m_solver = this;
2525
26        for (netlist_core_terminal_t *p = pn->object()->m_head; p != NULL; p = p->m_update_list_next)
27        {
28            switch (p->type())
29            {
30                case netlist_terminal_t::TERMINAL:
31                    switch (p->netdev().family())
32                    {
33                        case netlist_device_t::CAPACITOR:
34                            if (!m_steps.contains(&p->netdev()))
35                                m_steps.add(&p->netdev());
36                            break;
37                        case netlist_device_t::DIODE:
38                        //case netlist_device_t::VCVS:
39                        //case netlist_device_t::BJT_SWITCH:
40                            if (!m_dynamic.contains(&p->netdev()))
41                                m_dynamic.add(&p->netdev());
42                            break;
43                        default:
44                            break;
45                    }
46                    pn->object()->m_terms.add(static_cast<netlist_terminal_t *>(p));
47                    NL_VERBOSE_OUT(("Added terminal\n"));
48                    break;
49                case netlist_terminal_t::INPUT:
50                    if (!m_inps.contains(&p->netdev()))
51                        m_inps.add(&p->netdev());
52                    NL_VERBOSE_OUT(("Added input\n"));
53                    break;
54                default:
55                    owner().netlist().xfatalerror("unhandled element found\n");
56                    break;
57            }
58        }
59    }
26      for (netlist_core_terminal_t *p = pn->object()->m_head; p != NULL; p = p->m_update_list_next)
27      {
28         switch (p->type())
29         {
30            case netlist_terminal_t::TERMINAL:
31               switch (p->netdev().family())
32               {
33                  case netlist_device_t::CAPACITOR:
34                     if (!m_steps.contains(&p->netdev()))
35                        m_steps.add(&p->netdev());
36                     break;
37                  case netlist_device_t::DIODE:
38                  //case netlist_device_t::VCVS:
39                  //case netlist_device_t::BJT_SWITCH:
40                     if (!m_dynamic.contains(&p->netdev()))
41                        m_dynamic.add(&p->netdev());
42                     break;
43                  default:
44                     break;
45               }
46               pn->object()->m_terms.add(static_cast<netlist_terminal_t *>(p));
47               NL_VERBOSE_OUT(("Added terminal\n"));
48               break;
49            case netlist_terminal_t::INPUT:
50               if (!m_inps.contains(&p->netdev()))
51                  m_inps.add(&p->netdev());
52               NL_VERBOSE_OUT(("Added input\n"));
53               break;
54            default:
55               owner().netlist().xfatalerror("unhandled element found\n");
56               break;
57         }
58      }
59   }
6060}
6161
6262ATTR_HOT inline void netlist_matrix_solver_t::step(const netlist_time delta)
6363{
64    const double dd = delta.as_double();
65    for (dev_list_t::entry_t *p = m_steps.first(); p != NULL; p = m_steps.next(p))
66        p->object()->step_time(dd);
64   const double dd = delta.as_double();
65   for (dev_list_t::entry_t *p = m_steps.first(); p != NULL; p = m_steps.next(p))
66      p->object()->step_time(dd);
6767}
6868
6969ATTR_HOT inline void netlist_matrix_solver_t::update_inputs()
7070{
71    for (dev_list_t::entry_t *p = m_inps.first(); p != NULL; p = m_inps.next(p))
72        p->object()->update_dev();
71   for (dev_list_t::entry_t *p = m_inps.first(); p != NULL; p = m_inps.next(p))
72      p->object()->update_dev();
7373}
7474
7575
7676ATTR_HOT inline bool netlist_matrix_solver_t::solve()
7777{
78    bool resched = false;
78   bool resched = false;
7979
80    /* update all non-linear devices  */
81    for (dev_list_t::entry_t *p = m_dynamic.first(); p != NULL; p = m_dynamic.next(p))
82        switch (p->object()->family())
83        {
84            case netlist_device_t::DIODE:
85                static_cast<NETLIB_NAME(D) *>(p->object())->update_terminals();
86                break;
87            default:
88                p->object()->update_terminals();
89                break;
90        }
80   /* update all non-linear devices  */
81   for (dev_list_t::entry_t *p = m_dynamic.first(); p != NULL; p = m_dynamic.next(p))
82      switch (p->object()->family())
83      {
84         case netlist_device_t::DIODE:
85            static_cast<NETLIB_NAME(D) *>(p->object())->update_terminals();
86            break;
87         default:
88            p->object()->update_terminals();
89            break;
90      }
9191
92    for (netlist_net_t::list_t::entry_t *pn = m_nets.first(); pn != NULL; pn = m_nets.next(pn))
93    {
94        netlist_net_t *net = pn->object();
92   for (netlist_net_t::list_t::entry_t *pn = m_nets.first(); pn != NULL; pn = m_nets.next(pn))
93   {
94      netlist_net_t *net = pn->object();
9595
96        double gtot = 0;
97        double gabs = 0;
98        double iIdr = 0;
99        const netlist_net_t::terminal_list_t &terms = net->m_terms;
96      double gtot = 0;
97      double gabs = 0;
98      double iIdr = 0;
99      const netlist_net_t::terminal_list_t &terms = net->m_terms;
100100#if 1
101        switch (terms.count())
102        {
103            case 1:
104                {
105                    const netlist_terminal_t *pt = terms.first()->object();
106                    gtot = pt->m_gt;
107                    gabs = fabs(pt->m_go);
108                    iIdr = pt->m_Idr + pt->m_go * pt->m_otherterm->net().Q_Analog();
109                }
110                break;
111            case 2:
112                {
113                    const netlist_terminal_t *pt1 = terms[0];
114                    const netlist_terminal_t *pt2 = terms[1];
115                    gtot = pt1->m_gt + pt2->m_gt;
116                    gabs = fabs(pt1->m_go) + fabs(pt2->m_go);
117                    iIdr = pt1->m_Idr + pt1->m_go * pt1->m_otherterm->net().Q_Analog()
118                         + pt2->m_Idr + pt2->m_go * pt2->m_otherterm->net().Q_Analog();
119                }
120                break;
121            case 3:
122                {
123                    const netlist_terminal_t *pt1 = terms[0];
124                    const netlist_terminal_t *pt2 = terms[1];
125                    const netlist_terminal_t *pt3 = terms[2];
126                    gtot = pt1->m_gt + pt2->m_gt + pt3->m_gt;
127                    gabs = fabs(pt1->m_go) + fabs(pt2->m_go) + fabs(pt3->m_go);
128                    iIdr = pt1->m_Idr + pt1->m_go * pt1->m_otherterm->net().Q_Analog()
129                         + pt2->m_Idr + pt2->m_go * pt2->m_otherterm->net().Q_Analog()
130                         + pt3->m_Idr + pt3->m_go * pt3->m_otherterm->net().Q_Analog();
131                }
132                break;
133            default:
134                for (netlist_net_t::terminal_list_t::entry_t *e = terms.first(); e != NULL; e = terms.next(e))
135                {
136                    netlist_terminal_t *pt = e->object();
137                    gtot += pt->m_gt;
138                    gabs += fabs(pt->m_go);
139                    iIdr += pt->m_Idr + pt->m_go * pt->m_otherterm->net().Q_Analog();
140                }
141                break;
142        }
101      switch (terms.count())
102      {
103         case 1:
104            {
105               const netlist_terminal_t *pt = terms.first()->object();
106               gtot = pt->m_gt;
107               gabs = fabs(pt->m_go);
108               iIdr = pt->m_Idr + pt->m_go * pt->m_otherterm->net().Q_Analog();
109            }
110            break;
111         case 2:
112            {
113               const netlist_terminal_t *pt1 = terms[0];
114               const netlist_terminal_t *pt2 = terms[1];
115               gtot = pt1->m_gt + pt2->m_gt;
116               gabs = fabs(pt1->m_go) + fabs(pt2->m_go);
117               iIdr = pt1->m_Idr + pt1->m_go * pt1->m_otherterm->net().Q_Analog()
118                     + pt2->m_Idr + pt2->m_go * pt2->m_otherterm->net().Q_Analog();
119            }
120            break;
121         case 3:
122            {
123               const netlist_terminal_t *pt1 = terms[0];
124               const netlist_terminal_t *pt2 = terms[1];
125               const netlist_terminal_t *pt3 = terms[2];
126               gtot = pt1->m_gt + pt2->m_gt + pt3->m_gt;
127               gabs = fabs(pt1->m_go) + fabs(pt2->m_go) + fabs(pt3->m_go);
128               iIdr = pt1->m_Idr + pt1->m_go * pt1->m_otherterm->net().Q_Analog()
129                     + pt2->m_Idr + pt2->m_go * pt2->m_otherterm->net().Q_Analog()
130                     + pt3->m_Idr + pt3->m_go * pt3->m_otherterm->net().Q_Analog();
131            }
132            break;
133         default:
134            for (netlist_net_t::terminal_list_t::entry_t *e = terms.first(); e != NULL; e = terms.next(e))
135            {
136               netlist_terminal_t *pt = e->object();
137               gtot += pt->m_gt;
138               gabs += fabs(pt->m_go);
139               iIdr += pt->m_Idr + pt->m_go * pt->m_otherterm->net().Q_Analog();
140            }
141            break;
142      }
143143#else
144        for (netlist_net_t::terminal_list_t::entry_t *e = terms.first(); e != NULL; e = terms.next(e))
145        {
146            netlist_terminal_t *pt = e->object();
147            gtot += pt->m_gt;
148            gabs += fabs(pt->m_go);
149            iIdr += pt->m_Idr + pt->m_go * pt->m_otherterm->net().Q_Analog();
150        }
144      for (netlist_net_t::terminal_list_t::entry_t *e = terms.first(); e != NULL; e = terms.next(e))
145      {
146         netlist_terminal_t *pt = e->object();
147         gtot += pt->m_gt;
148         gabs += fabs(pt->m_go);
149         iIdr += pt->m_Idr + pt->m_go * pt->m_otherterm->net().Q_Analog();
150      }
151151#endif
152        double new_val;
153        gabs *= m_convergence_factor;
154        if (gabs > gtot)
155            new_val = (net->m_cur.Analog * gabs + iIdr) / (gtot + gabs);
156        else
157            new_val = iIdr / gtot;
152      double new_val;
153      gabs *= m_convergence_factor;
154      if (gabs > gtot)
155         new_val = (net->m_cur.Analog * gabs + iIdr) / (gtot + gabs);
156      else
157         new_val = iIdr / gtot;
158158
159        if (fabs(new_val - net->m_cur.Analog) > m_accuracy)
160            resched = true;
161        net->m_cur.Analog = net->m_new.Analog = new_val;
159      if (fabs(new_val - net->m_cur.Analog) > m_accuracy)
160         resched = true;
161      net->m_cur.Analog = net->m_new.Analog = new_val;
162162
163        NL_VERBOSE_OUT(("Info: %d\n", pn->object()->m_num_cons));
164        //NL_VERBOSE_OUT(("New: %lld %f %f\n", netlist().time().as_raw(), netlist().time().as_double(), new_val));
165    }
166    return resched;
163      NL_VERBOSE_OUT(("Info: %d\n", pn->object()->m_num_cons));
164      //NL_VERBOSE_OUT(("New: %lld %f %f\n", netlist().time().as_raw(), netlist().time().as_double(), new_val));
165   }
166   return resched;
167167}
168168
169169// ----------------------------------------------------------------------------------------
r26736r26737
174174
175175static bool already_processed(net_groups_t groups, int &cur_group, netlist_net_t *net)
176176{
177    if (net->isRailNet())
178        return true;
179    for (int i = 0; i <= cur_group; i++)
180    {
181        if (groups[i].contains(net))
182            return true;
183    }
184    return false;
177   if (net->isRailNet())
178      return true;
179   for (int i = 0; i <= cur_group; i++)
180   {
181      if (groups[i].contains(net))
182         return true;
183   }
184   return false;
185185}
186186
187187static void process_net(net_groups_t groups, int &cur_group, netlist_net_t *net)
188188{
189    /* add the net */
190    if (net->m_head == NULL)
191        return;
192    groups[cur_group].add(net);
193    for (netlist_core_terminal_t *p = net->m_head; p != NULL; p = p->m_update_list_next)
194    {
195        if (p->isType(netlist_terminal_t::TERMINAL))
196        {
197            netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p);
198            netlist_net_t *nnet = &pt->m_otherterm->net();
199            if (!already_processed(groups, cur_group, nnet))
200                process_net(groups, cur_group, nnet);
201        }
202    }
189   /* add the net */
190   if (net->m_head == NULL)
191      return;
192   groups[cur_group].add(net);
193   for (netlist_core_terminal_t *p = net->m_head; p != NULL; p = p->m_update_list_next)
194   {
195      if (p->isType(netlist_terminal_t::TERMINAL))
196      {
197         netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p);
198         netlist_net_t *nnet = &pt->m_otherterm->net();
199         if (!already_processed(groups, cur_group, nnet))
200            process_net(groups, cur_group, nnet);
201      }
202   }
203203}
204204
205205
206206NETLIB_START(solver)
207207{
208    register_output("Q_sync", m_Q_sync);
209    register_output("Q_step", m_Q_step);
210    //register_input("FB", m_feedback);
208   register_output("Q_sync", m_Q_sync);
209   register_output("Q_step", m_Q_step);
210   //register_input("FB", m_feedback);
211211
212    register_param("SYNC_DELAY", m_sync_delay, NLTIME_FROM_NS(10).as_double());
213    m_nt_sync_delay = m_sync_delay.Value();
212   register_param("SYNC_DELAY", m_sync_delay, NLTIME_FROM_NS(10).as_double());
213   m_nt_sync_delay = m_sync_delay.Value();
214214
215    register_param("FREQ", m_freq, 48000.0);
216    m_inc = netlist_time::from_hz(m_freq.Value());
215   register_param("FREQ", m_freq, 48000.0);
216   m_inc = netlist_time::from_hz(m_freq.Value());
217217
218    register_param("ACCURACY", m_accuracy, 1e-3);
219    register_param("CONVERG", m_convergence, 0.3);
218   register_param("ACCURACY", m_accuracy, 1e-3);
219   register_param("CONVERG", m_convergence, 0.3);
220220
221    // internal staff
221   // internal staff
222222
223    register_input("FB_sync", m_fb_sync, netlist_input_t::STATE_INP_ACTIVE);
224    register_input("FB_step", m_fb_step, netlist_input_t::STATE_INP_ACTIVE);
223   register_input("FB_sync", m_fb_sync, netlist_input_t::STATE_INP_ACTIVE);
224   register_input("FB_step", m_fb_step, netlist_input_t::STATE_INP_ACTIVE);
225225
226    setup().connect(m_fb_sync, m_Q_sync);
227    setup().connect(m_fb_step, m_Q_step);
226   setup().connect(m_fb_sync, m_Q_sync);
227   setup().connect(m_fb_step, m_Q_step);
228228
229    m_last_step = netlist_time::zero;
229   m_last_step = netlist_time::zero;
230230
231    save(NAME(m_last_step));
231   save(NAME(m_last_step));
232232
233233}
234234
235235NETLIB_UPDATE_PARAM(solver)
236236{
237    m_inc = netlist_time::from_hz(m_freq.Value());
237   m_inc = netlist_time::from_hz(m_freq.Value());
238238}
239239
240240NETLIB_NAME(solver)::~NETLIB_NAME(solver)()
241241{
242    netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first();
243    while (e != NULL)
244    {
245        netlist_matrix_solver_t::list_t::entry_t *en = m_mat_solvers.next(e);
246        delete e->object();
247        e = en;
248    }
242   netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first();
243   while (e != NULL)
244   {
245      netlist_matrix_solver_t::list_t::entry_t *en = m_mat_solvers.next(e);
246      delete e->object();
247      e = en;
248   }
249249
250250}
251251
252252NETLIB_FUNC_VOID(solver, post_start, ())
253253{
254    netlist_net_t::list_t groups[100];
255    int cur_group = -1;
254   netlist_net_t::list_t groups[100];
255   int cur_group = -1;
256256
257    SOLVER_VERBOSE_OUT(("Scanning net groups ...\n"));
258    // determine net groups
259    for (netlist_net_t::list_t::entry_t *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
260    {
261        if (!already_processed(groups, cur_group, pn->object()))
262        {
263            cur_group++;
264            process_net(groups, cur_group, pn->object());
265        }
266    }
257   SOLVER_VERBOSE_OUT(("Scanning net groups ...\n"));
258   // determine net groups
259   for (netlist_net_t::list_t::entry_t *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn))
260   {
261      if (!already_processed(groups, cur_group, pn->object()))
262      {
263         cur_group++;
264         process_net(groups, cur_group, pn->object());
265      }
266   }
267267
268    // setup the solvers
269    SOLVER_VERBOSE_OUT(("Found %d net groups in %d nets\n", cur_group + 1, m_nets.count()));
270    for (int i = 0; i <= cur_group; i++)
271    {
272        netlist_matrix_solver_t *ms = new netlist_matrix_solver_t();
273        ms->m_accuracy = m_accuracy.Value();
274        ms->m_convergence_factor = m_convergence.Value();
275        ms->setup(groups[i], *this);
276        m_mat_solvers.add(ms);
277        SOLVER_VERBOSE_OUT(("%d ==> %d nets %s\n", i, groups[i].count(), groups[i].first()->object()->m_head->name().cstr()));
278        SOLVER_VERBOSE_OUT(("  has %s elements\n", ms->is_dynamic() ? "dynamic" : "no dynamic"));
279    }
268   // setup the solvers
269   SOLVER_VERBOSE_OUT(("Found %d net groups in %d nets\n", cur_group + 1, m_nets.count()));
270   for (int i = 0; i <= cur_group; i++)
271   {
272      netlist_matrix_solver_t *ms = new netlist_matrix_solver_t();
273      ms->m_accuracy = m_accuracy.Value();
274      ms->m_convergence_factor = m_convergence.Value();
275      ms->setup(groups[i], *this);
276      m_mat_solvers.add(ms);
277      SOLVER_VERBOSE_OUT(("%d ==> %d nets %s\n", i, groups[i].count(), groups[i].first()->object()->m_head->name().cstr()));
278      SOLVER_VERBOSE_OUT(("  has %s elements\n", ms->is_dynamic() ? "dynamic" : "no dynamic"));
279   }
280280
281281}
282282
283283NETLIB_UPDATE(solver)
284284{
285    //m_Q.setToNoCheck(!m_Q.new_Q(), m_inc  );
286    //OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc  );
285   //m_Q.setToNoCheck(!m_Q.new_Q(), m_inc  );
286   //OUTLOGIC(m_Q, !m_Q.net().new_Q(), m_inc  );
287287
288    bool resched = false;
289    int  resched_cnt = 0;
290    netlist_time now = netlist().time();
291    netlist_time delta = now - m_last_step;
288   bool resched = false;
289   int  resched_cnt = 0;
290   netlist_time now = netlist().time();
291   netlist_time delta = now - m_last_step;
292292
293    if (delta >= m_inc)
294    {
295        NL_VERBOSE_OUT(("Step!\n"));
296        /* update all terminals for new time step */
297        m_last_step = now;
298        for (netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first(); e != NULL; e = m_mat_solvers.next(e))
299        {
300            e->object()->step(delta);
301        }
302    }
303    bool global_resched = false;
304    for (netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first(); e != NULL; e = m_mat_solvers.next(e))
305    {
306        resched_cnt = (e->object()->is_dynamic() ? 0 : 1);
307        do {
308            resched = e->object()->solve();
309            resched_cnt++;
310        } while ((resched && (resched_cnt < 5)) || (resched_cnt <= 1));
311        global_resched = global_resched || resched;
312    }
313    //if (global_resched)
314    //    printf("rescheduled\n");
315    if (global_resched)
316    {
317        schedule();
318    }
319    else
320    {
321        /* update all inputs connected */
322        for (netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first(); e != NULL; e = m_mat_solvers.next(e))
323        {
324            e->object()->update_inputs();
325        }
293   if (delta >= m_inc)
294   {
295      NL_VERBOSE_OUT(("Step!\n"));
296      /* update all terminals for new time step */
297      m_last_step = now;
298      for (netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first(); e != NULL; e = m_mat_solvers.next(e))
299      {
300         e->object()->step(delta);
301      }
302   }
303   bool global_resched = false;
304   for (netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first(); e != NULL; e = m_mat_solvers.next(e))
305   {
306      resched_cnt = (e->object()->is_dynamic() ? 0 : 1);
307      do {
308         resched = e->object()->solve();
309         resched_cnt++;
310      } while ((resched && (resched_cnt < 5)) || (resched_cnt <= 1));
311      global_resched = global_resched || resched;
312   }
313   //if (global_resched)
314   //    printf("rescheduled\n");
315   if (global_resched)
316   {
317      schedule();
318   }
319   else
320   {
321      /* update all inputs connected */
322      for (netlist_matrix_solver_t::list_t::entry_t *e = m_mat_solvers.first(); e != NULL; e = m_mat_solvers.next(e))
323      {
324         e->object()->update_inputs();
325      }
326326
327        /* step circuit */
328        if (!m_Q_step.net().is_queued())
329            m_Q_step.net().push_to_queue(m_inc);
330    }
327      /* step circuit */
328      if (!m_Q_step.net().is_queued())
329         m_Q_step.net().push_to_queue(m_inc);
330   }
331331
332332}
333
trunk/src/emu/netlist/devices/nld_7493.h
r26736r26737
6060#include "../nl_base.h"
6161
6262#define TTL_7493(_name, _CLKA, _CLKB, _R1, _R2)                                     \
63        NET_REGISTER_DEV(7493, _name)                                               \
64        NET_CONNECT(_name, CLKA, _CLKA)                                             \
65        NET_CONNECT(_name, CLKB, _CLKB)                                             \
66        NET_CONNECT(_name, R1,  _R1)                                                \
67        NET_CONNECT(_name, R2,  _R2)
63      NET_REGISTER_DEV(7493, _name)                                               \
64      NET_CONNECT(_name, CLKA, _CLKA)                                             \
65      NET_CONNECT(_name, CLKB, _CLKB)                                             \
66      NET_CONNECT(_name, R1,  _R1)                                                \
67      NET_CONNECT(_name, R2,  _R2)
6868
6969NETLIB_SUBDEVICE(7493ff,
70    netlist_ttl_input_t m_I;
71    netlist_ttl_output_t m_Q;
70   netlist_ttl_input_t m_I;
71   netlist_ttl_output_t m_Q;
7272
73    UINT8 m_reset;
73   UINT8 m_reset;
7474);
7575
7676NETLIB_DEVICE(7493,
77    netlist_ttl_input_t m_R1;
78    netlist_ttl_input_t m_R2;
77   netlist_ttl_input_t m_R1;
78   netlist_ttl_input_t m_R2;
7979
80    NETLIB_NAME(7493ff) A;
81    NETLIB_NAME(7493ff) B;
82    NETLIB_NAME(7493ff) C;
83    NETLIB_NAME(7493ff) D;
80   NETLIB_NAME(7493ff) A;
81   NETLIB_NAME(7493ff) B;
82   NETLIB_NAME(7493ff) C;
83   NETLIB_NAME(7493ff) D;
8484);
8585
8686#endif /* NLD_7493_H_ */
trunk/src/emu/netlist/devices/nld_solver.h
r26736r26737
1414// ----------------------------------------------------------------------------------------
1515
1616#define NETDEV_SOLVER(_name)                                                        \
17        NET_REGISTER_DEV(solver, _name)
17      NET_REGISTER_DEV(solver, _name)
1818
1919// ----------------------------------------------------------------------------------------
2020// solver
r26736r26737
2525class netlist_matrix_solver_t
2626{
2727public:
28    typedef netlist_list_t<netlist_matrix_solver_t *> list_t;
29    typedef netlist_core_device_t::list_t dev_list_t;
28   typedef netlist_list_t<netlist_matrix_solver_t *> list_t;
29   typedef netlist_core_device_t::list_t dev_list_t;
3030
31    ATTR_COLD void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner);
31   ATTR_COLD void setup(netlist_net_t::list_t &nets, NETLIB_NAME(solver) &owner);
3232
33    // return true if a reschedule is needed ...
34    ATTR_HOT bool solve();
35    ATTR_HOT void step(const netlist_time delta);
36    ATTR_HOT void update_inputs();
33   // return true if a reschedule is needed ...
34   ATTR_HOT bool solve();
35   ATTR_HOT void step(const netlist_time delta);
36   ATTR_HOT void update_inputs();
3737
38    ATTR_HOT inline bool is_dynamic() { return m_dynamic.count() > 0; }
38   ATTR_HOT inline bool is_dynamic() { return m_dynamic.count() > 0; }
3939
40    inline const NETLIB_NAME(solver) &owner() const;
40   inline const NETLIB_NAME(solver) &owner() const;
4141
42    double m_accuracy;
43    double m_convergence_factor;
42   double m_accuracy;
43   double m_convergence_factor;
4444
4545private:
46    netlist_net_t::list_t m_nets;
47    dev_list_t m_dynamic;
48    dev_list_t m_inps;
49    dev_list_t m_steps;
46   netlist_net_t::list_t m_nets;
47   dev_list_t m_dynamic;
48   dev_list_t m_inps;
49   dev_list_t m_steps;
5050
51    NETLIB_NAME(solver) *m_owner;
51   NETLIB_NAME(solver) *m_owner;
5252};
5353
5454NETLIB_DEVICE_WITH_PARAMS(solver,
55        typedef netlist_core_device_t::list_t dev_list_t;
55      typedef netlist_core_device_t::list_t dev_list_t;
5656
57        netlist_ttl_input_t m_fb_sync;
58        netlist_ttl_output_t m_Q_sync;
57      netlist_ttl_input_t m_fb_sync;
58      netlist_ttl_output_t m_Q_sync;
5959
60        netlist_ttl_input_t m_fb_step;
61        netlist_ttl_output_t m_Q_step;
60      netlist_ttl_input_t m_fb_step;
61      netlist_ttl_output_t m_Q_step;
6262
63        netlist_param_double_t m_freq;
64        netlist_param_double_t m_sync_delay;
65        netlist_param_double_t m_accuracy;
66        netlist_param_double_t m_convergence;
63      netlist_param_double_t m_freq;
64      netlist_param_double_t m_sync_delay;
65      netlist_param_double_t m_accuracy;
66      netlist_param_double_t m_convergence;
6767
68        netlist_time m_inc;
69        netlist_time m_last_step;
70        netlist_time m_nt_sync_delay;
68      netlist_time m_inc;
69      netlist_time m_last_step;
70      netlist_time m_nt_sync_delay;
7171
72        netlist_matrix_solver_t::list_t m_mat_solvers;
72      netlist_matrix_solver_t::list_t m_mat_solvers;
7373public:
7474
75        ~NETLIB_NAME(solver)();
75      ~NETLIB_NAME(solver)();
7676
77        ATTR_HOT inline void schedule();
77      ATTR_HOT inline void schedule();
7878
79        ATTR_COLD void post_start();
79      ATTR_COLD void post_start();
8080);
8181
8282inline void NETLIB_NAME(solver)::schedule()
8383{
84    // FIXME: time should be parameter;
85    if (!m_Q_sync.net().is_queued())
86        m_Q_sync.net().push_to_queue(m_nt_sync_delay);
84   // FIXME: time should be parameter;
85   if (!m_Q_sync.net().is_queued())
86      m_Q_sync.net().push_to_queue(m_nt_sync_delay);
8787}
8888
8989inline const NETLIB_NAME(solver) &netlist_matrix_solver_t::owner() const
9090{
91    return *m_owner;
91   return *m_owner;
9292}
9393
9494
trunk/src/emu/netlist/devices/nld_log.c
r26736r26737
1010
1111NETLIB_START(log)
1212{
13    register_input("I", m_I);
13   register_input("I", m_I);
1414
15    pstring filename = "netlist_" + name() + ".log";
16    m_file = fopen(filename, "w");
15   pstring filename = "netlist_" + name() + ".log";
16   m_file = fopen(filename, "w");
1717}
1818
1919NETLIB_UPDATE(log)
2020{
21    fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I));
21   fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I));
2222}
2323
2424NETLIB_NAME(log)::~NETLIB_NAME(log)()
2525{
26    fclose(m_file);
26   fclose(m_file);
2727}
2828
2929NETLIB_START(logD)
3030{
31    NETLIB_NAME(log)::start();
32    register_input("I2", m_I2);
31   NETLIB_NAME(log)::start();
32   register_input("I2", m_I2);
3333}
3434
3535NETLIB_UPDATE(logD)
3636{
37    fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I) - INPANALOG(m_I2));
37   fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I) - INPANALOG(m_I2));
3838}
3939
4040// FIXME: Implement wav later, this must be clock triggered device where the input to be written
r26736r26737
4242#if 0
4343NETLIB_START(wav)
4444{
45    register_input("I", m_I);
45   register_input("I", m_I);
4646
47    pstring filename = "netlist_" + name() + ".wav";
48    m_file = wav_open(filename, sample_rate(), active_inputs()/2)
47   pstring filename = "netlist_" + name() + ".wav";
48   m_file = wav_open(filename, sample_rate(), active_inputs()/2)
4949}
5050
5151NETLIB_UPDATE(wav)
5252{
53    fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I));
53   fprintf(m_file, "%e %e\n", netlist().time().as_double(), INPANALOG(m_I));
5454}
5555
5656NETLIB_NAME(log)::~NETLIB_NAME(wav)()
5757{
58    fclose(m_file);
58   fclose(m_file);
5959}
6060#endif
trunk/src/emu/netlist/nl_config.h
r26736r26737
6565
6666// prevent implicit copying
6767#define NETLIST_PREVENT_COPYING(_name)          \
68    private:                                    \
69        _name(const _name &);                   \
70        _name &operator=(const _name &);        \
71
68   private:                                    \
69      _name(const _name &);                   \
70      _name &operator=(const _name &);
7271#if NL_KEEP_STATISTICS
7372#define add_to_stat(v,x)        do { v += (x); } while (0)
7473#define inc_stat(v)             add_to_stat(v, 1)
trunk/src/emu/netlist/nl_base.c
r26736r26737
2222
2323ATTR_COLD netlist_object_t::~netlist_object_t()
2424{
25    //delete m_name;
25   //delete m_name;
2626}
2727
2828ATTR_COLD void netlist_object_t::init_object(netlist_base_t &nl, const pstring &aname)
2929{
30    m_netlist = &nl;
31    m_name = aname;
32    save_register();
30   m_netlist = &nl;
31   m_name = aname;
32   save_register();
3333}
3434
3535ATTR_COLD const pstring &netlist_object_t::name() const
3636{
37    if (m_name == "")
38        netlist().xfatalerror("object not initialized");
39    return m_name;
37   if (m_name == "")
38      netlist().xfatalerror("object not initialized");
39   return m_name;
4040}
4141
4242// ----------------------------------------------------------------------------------------
r26736r26737
4444// ----------------------------------------------------------------------------------------
4545
4646ATTR_COLD netlist_owned_object_t::netlist_owned_object_t(const type_t atype,
47        const family_t afamily)
47      const family_t afamily)
4848: netlist_object_t(atype, afamily)
4949, m_netdev(NULL)
5050{
5151}
5252
5353ATTR_COLD void netlist_owned_object_t::init_object(netlist_core_device_t &dev,
54        const pstring &aname)
54      const pstring &aname)
5555{
56    netlist_object_t::init_object(dev.netlist(), aname);
57    m_netdev = &dev;
56   netlist_object_t::init_object(dev.netlist(), aname);
57   m_netdev = &dev;
5858}
5959
6060// ----------------------------------------------------------------------------------------
r26736r26737
6262// ----------------------------------------------------------------------------------------
6363
6464netlist_base_t::netlist_base_t()
65    :   netlist_object_t(NETLIST, GENERIC),
66        m_time_ps(netlist_time::zero),
67        m_rem(0),
68        m_div(NETLIST_DIV),
69        m_mainclock(NULL),
70        m_solver(NULL)
65   :   netlist_object_t(NETLIST, GENERIC),
66      m_time_ps(netlist_time::zero),
67      m_rem(0),
68      m_div(NETLIST_DIV),
69      m_mainclock(NULL),
70      m_solver(NULL)
7171{
7272}
7373
7474template <class T>
7575static void tagmap_free_entries(T &tm)
7676{
77    for (typename T::entry_t *entry = tm.first(); entry != NULL; entry = tm.next(entry))
78    {
79        delete entry->object();
80    }
81    tm.reset();
77   for (typename T::entry_t *entry = tm.first(); entry != NULL; entry = tm.next(entry))
78   {
79      delete entry->object();
80   }
81   tm.reset();
8282}
8383
8484netlist_base_t::~netlist_base_t()
8585{
86    tagmap_free_entries<tagmap_devices_t>(m_devices);
86   tagmap_free_entries<tagmap_devices_t>(m_devices);
8787
88    netlist_net_t::list_t::entry_t *p = m_nets.first();
89    while (p != NULL)
90    {
91        netlist_net_t::list_t::entry_t *pn = m_nets.next(p);
92        if (!p->object()->isRailNet())
93            delete p->object();
94        p = pn;
95    }
88   netlist_net_t::list_t::entry_t *p = m_nets.first();
89   while (p != NULL)
90   {
91      netlist_net_t::list_t::entry_t *pn = m_nets.next(p);
92      if (!p->object()->isRailNet())
93         delete p->object();
94      p = pn;
95   }
9696
97    m_nets.reset();
98    pstring::resetmem();
97   m_nets.reset();
98   pstring::resetmem();
9999}
100100
101101ATTR_COLD netlist_net_t *netlist_base_t::find_net(const pstring &name)
102102{
103    for (netlist_net_t::list_t::entry_t *p = m_nets.first(); p != NULL; p = m_nets.next(p))
104    {
105        if (p->object()->name() == name)
106            return p->object();
107    }
108    return NULL;
103   for (netlist_net_t::list_t::entry_t *p = m_nets.first(); p != NULL; p = m_nets.next(p))
104   {
105      if (p->object()->name() == name)
106         return p->object();
107   }
108   return NULL;
109109}
110110
111111ATTR_COLD void netlist_base_t::set_mainclock_dev(NETLIB_NAME(mainclock) *dev)
112112{
113    m_mainclock = dev;
113   m_mainclock = dev;
114114}
115115
116116ATTR_COLD void netlist_base_t::set_solver_dev(NETLIB_NAME(solver) *dev)
117117{
118    m_solver = dev;
118   m_solver = dev;
119119}
120120
121121ATTR_COLD void netlist_base_t::reset()
122122{
123    m_time_ps = netlist_time::zero;
124    m_rem = 0;
125    m_queue.clear();
126    if (m_mainclock != NULL)
127        m_mainclock->m_Q.net().set_time(netlist_time::zero);
123   m_time_ps = netlist_time::zero;
124   m_rem = 0;
125   m_queue.clear();
126   if (m_mainclock != NULL)
127      m_mainclock->m_Q.net().set_time(netlist_time::zero);
128128
129    // FIXME: some const devices rely on this
130    /* make sure params are set now .. */
131    for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
132    {
133        entry->object()->update_param();
134    }
129   // FIXME: some const devices rely on this
130   /* make sure params are set now .. */
131   for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
132   {
133      entry->object()->update_param();
134   }
135135
136    // Step all devices once !
137    for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
138    {
139        netlist_device_t *dev = entry->object();
140        dev->update_dev();
141    }
136   // Step all devices once !
137   for (tagmap_devices_t::entry_t *entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry))
138   {
139      netlist_device_t *dev = entry->object();
140      dev->update_dev();
141   }
142142}
143143
144144void netlist_base_t::set_clock_freq(UINT64 clockfreq)
145145{
146    m_div = netlist_time::from_hz(clockfreq).as_raw();
147    m_rem = 0;
148    assert_always(m_div == NETLIST_DIV, "netlist: illegal clock!");
149    NL_VERBOSE_OUT(("Setting clock %" I64FMT "d and divisor %d\n", clockfreq, m_div));
146   m_div = netlist_time::from_hz(clockfreq).as_raw();
147   m_rem = 0;
148   assert_always(m_div == NETLIST_DIV, "netlist: illegal clock!");
149   NL_VERBOSE_OUT(("Setting clock %" I64FMT "d and divisor %d\n", clockfreq, m_div));
150150}
151151
152152ATTR_HOT ATTR_ALIGN inline void netlist_base_t::update_time(const netlist_time t, INT32 &atime)
153153{
154    if (NETLIST_DIV_BITS == 0)
155    {
156        const netlist_time delta = t - m_time_ps;
157        m_time_ps = t;
158        atime -= delta.as_raw();
159    } else {
160        const netlist_time delta = t - m_time_ps + netlist_time::from_raw(m_rem);
161        m_time_ps = t;
162        m_rem = delta.as_raw() & NETLIST_MASK;
163        atime -= (delta.as_raw() >> NETLIST_DIV_BITS);
154   if (NETLIST_DIV_BITS == 0)
155   {
156      const netlist_time delta = t - m_time_ps;
157      m_time_ps = t;
158      atime -= delta.as_raw();
159   } else {
160      const netlist_time delta = t - m_time_ps + netlist_time::from_raw(m_rem);
161      m_time_ps = t;
162      m_rem = delta.as_raw() & NETLIST_MASK;
163      atime -= (delta.as_raw() >> NETLIST_DIV_BITS);
164164
165        // The folling is suitable for non-power of 2 m_divs ...
166        // atime -= divu_64x32_rem(delta.as_raw(), m_div, &m_rem);
167    }
165      // The folling is suitable for non-power of 2 m_divs ...
166      // atime -= divu_64x32_rem(delta.as_raw(), m_div, &m_rem);
167   }
168168}
169169
170170ATTR_HOT ATTR_ALIGN void netlist_base_t::process_queue(INT32 &atime)
171171{
172    if (m_mainclock == NULL)
173    {
174        while ( (atime > 0) && (m_queue.is_not_empty()))
175        {
176            const queue_t::entry_t &e = m_queue.pop();
177            update_time(e.time(), atime);
172   if (m_mainclock == NULL)
173   {
174      while ( (atime > 0) && (m_queue.is_not_empty()))
175      {
176         const queue_t::entry_t &e = m_queue.pop();
177         update_time(e.time(), atime);
178178
179            //if (FATAL_ERROR_AFTER_NS)
180            //  NL_VERBOSE_OUT(("%s\n", e.object().netdev()->name().cstr());
179         //if (FATAL_ERROR_AFTER_NS)
180         //  NL_VERBOSE_OUT(("%s\n", e.object().netdev()->name().cstr());
181181
182            e.object().update_devs();
182         e.object().update_devs();
183183
184            add_to_stat(m_perf_out_processed, 1);
184         add_to_stat(m_perf_out_processed, 1);
185185
186            if (FATAL_ERROR_AFTER_NS)
187                if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
188                    xfatalerror("Stopped");
189        }
186         if (FATAL_ERROR_AFTER_NS)
187            if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
188               xfatalerror("Stopped");
189      }
190190
191        if (atime > 0)
192        {
193            m_time_ps += netlist_time::from_raw(atime * m_div);
194            atime = 0;
195        }
196    } else {
197        netlist_net_t &mcQ = m_mainclock->m_Q.net();
198        const netlist_time inc = m_mainclock->m_inc;
191      if (atime > 0)
192      {
193         m_time_ps += netlist_time::from_raw(atime * m_div);
194         atime = 0;
195      }
196   } else {
197      netlist_net_t &mcQ = m_mainclock->m_Q.net();
198      const netlist_time inc = m_mainclock->m_inc;
199199
200        while (atime > 0)
201        {
202            if (m_queue.is_not_empty())
203            {
204                while (m_queue.peek().time() > mcQ.time())
205                {
206                    update_time(mcQ.time(), atime);
200      while (atime > 0)
201      {
202         if (m_queue.is_not_empty())
203         {
204            while (m_queue.peek().time() > mcQ.time())
205            {
206               update_time(mcQ.time(), atime);
207207
208                    NETLIB_NAME(mainclock)::mc_update(mcQ, time() + inc);
208               NETLIB_NAME(mainclock)::mc_update(mcQ, time() + inc);
209209
210                }
211                const queue_t::entry_t &e = m_queue.pop();
210            }
211            const queue_t::entry_t &e = m_queue.pop();
212212
213                update_time(e.time(), atime);
213            update_time(e.time(), atime);
214214
215                e.object().update_devs();
215            e.object().update_devs();
216216
217            } else {
218                update_time(mcQ.time(), atime);
217         } else {
218            update_time(mcQ.time(), atime);
219219
220                NETLIB_NAME(mainclock)::mc_update(mcQ, time() + inc);
221            }
222            if (FATAL_ERROR_AFTER_NS)
223                if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
224                    xfatalerror("Stopped");
220            NETLIB_NAME(mainclock)::mc_update(mcQ, time() + inc);
221         }
222         if (FATAL_ERROR_AFTER_NS)
223            if (time() > NLTIME_FROM_NS(FATAL_ERROR_AFTER_NS))
224               xfatalerror("Stopped");
225225
226            add_to_stat(m_perf_out_processed, 1);
227        }
226         add_to_stat(m_perf_out_processed, 1);
227      }
228228
229        if (atime > 0)
230        {
231            m_time_ps += netlist_time::from_raw(atime * m_div);
232            atime = 0;
233        }
234    }
229      if (atime > 0)
230      {
231         m_time_ps += netlist_time::from_raw(atime * m_div);
232         atime = 0;
233      }
234   }
235235}
236236
237237ATTR_COLD void netlist_base_t::xfatalerror(const char *format, ...) const
238238{
239    va_list ap;
240    va_start(ap, format);
241    //emu_fatalerror error(format, ap);
242    vfatalerror(format, ap);
243    va_end(ap);
244    //throw error;
239   va_list ap;
240   va_start(ap, format);
241   //emu_fatalerror error(format, ap);
242   vfatalerror(format, ap);
243   va_end(ap);
244   //throw error;
245245}
246246
247247
r26736r26737
267267
268268ATTR_COLD void netlist_core_device_t::init(netlist_base_t &anetlist, const pstring &name)
269269{
270    init_object(anetlist, name);
270   init_object(anetlist, name);
271271
272272#if USE_DELEGATES
273273#if USE_PMFDELEGATES
274    void (netlist_core_device_t::* pFunc)() = &netlist_core_device_t::update;
275    static_update = reinterpret_cast<net_update_delegate>((this->*pFunc));
274   void (netlist_core_device_t::* pFunc)() = &netlist_core_device_t::update;
275   static_update = reinterpret_cast<net_update_delegate>((this->*pFunc));
276276#else
277    static_update = net_update_delegate(&netlist_core_device_t::update, "update", this);
278    // get the pointer to the member function
277   static_update = net_update_delegate(&netlist_core_device_t::update, "update", this);
278   // get the pointer to the member function
279279#endif
280280#endif
281281
r26736r26737
287287
288288ATTR_HOT ATTR_ALIGN const netlist_sig_t netlist_core_device_t::INPLOGIC_PASSIVE(netlist_logic_input_t &inp)
289289{
290    if (inp.state() == netlist_input_t::STATE_INP_PASSIVE)
291    {
292        inp.activate();
293        const netlist_sig_t ret = inp.Q();
294        inp.inactivate();
295        return ret;
296    }
297    else
298        return inp.Q();
290   if (inp.state() == netlist_input_t::STATE_INP_PASSIVE)
291   {
292      inp.activate();
293      const netlist_sig_t ret = inp.Q();
294      inp.inactivate();
295      return ret;
296   }
297   else
298      return inp.Q();
299299
300300}
301301
r26736r26737
304304// ----------------------------------------------------------------------------------------
305305
306306netlist_device_t::netlist_device_t()
307    : netlist_core_device_t(),
308        m_terminals(20)
307   : netlist_core_device_t(),
308      m_terminals(20)
309309{
310310}
311311
312312netlist_device_t::netlist_device_t(const family_t afamily)
313    : netlist_core_device_t(afamily),
314        m_terminals(20){
313   : netlist_core_device_t(afamily),
314      m_terminals(20){
315315}
316316
317317netlist_device_t::~netlist_device_t()
318318{
319    //NL_VERBOSE_OUT(("~net_device_t\n");
319   //NL_VERBOSE_OUT(("~net_device_t\n");
320320}
321321
322322ATTR_COLD netlist_setup_t &netlist_device_t::setup()
323323{
324    return netlist().setup();
324   return netlist().setup();
325325}
326326
327327ATTR_COLD void netlist_device_t::init(netlist_base_t &anetlist, const pstring &name)
328328{
329    netlist_core_device_t::init(anetlist, name);
330    start();
329   netlist_core_device_t::init(anetlist, name);
330   start();
331331}
332332
333333
334334ATTR_COLD void netlist_device_t::register_sub(netlist_device_t &dev, const pstring &name)
335335{
336    dev.init(netlist(), this->name() + "." + name);
336   dev.init(netlist(), this->name() + "." + name);
337337}
338338
339339ATTR_COLD void netlist_device_t::register_subalias(const pstring &name, const netlist_core_terminal_t &term)
340340{
341    pstring alias = this->name() + "." + name;
341   pstring alias = this->name() + "." + name;
342342
343    setup().register_alias(alias, term.name());
343   setup().register_alias(alias, term.name());
344344
345    if (term.isType(netlist_terminal_t::INPUT))
346        m_terminals.add(name);
345   if (term.isType(netlist_terminal_t::INPUT))
346      m_terminals.add(name);
347347}
348348
349349ATTR_COLD void netlist_device_t::register_terminal(const pstring &name, netlist_terminal_t &port)
350350{
351    setup().register_object(*this,*this,name, port, netlist_terminal_t::STATE_INP_ACTIVE);
351   setup().register_object(*this,*this,name, port, netlist_terminal_t::STATE_INP_ACTIVE);
352352}
353353
354354ATTR_COLD void netlist_device_t::register_output(const pstring &name, netlist_output_t &port)
355355{
356    setup().register_object(*this,*this,name, port, netlist_terminal_t::STATE_OUT);
356   setup().register_object(*this,*this,name, port, netlist_terminal_t::STATE_OUT);
357357}
358358
359359ATTR_COLD void netlist_device_t::register_input(const pstring &name, netlist_input_t &inp, netlist_input_t::state_e type)
360360{
361    m_terminals.add(name);
362    setup().register_object(*this, *this, name, inp, type);
361   m_terminals.add(name);
362   setup().register_object(*this, *this, name, inp, type);
363363}
364364
365365//FIXME: Get rid of this
366366static void init_term(netlist_core_device_t &dev, netlist_core_terminal_t &term, netlist_input_t::state_e aState)
367367{
368    if (!term.isInitalized())
369    {
370        switch (term.type())
371        {
372            case netlist_terminal_t::OUTPUT:
373                dynamic_cast<netlist_output_t &>(term).init_object(dev, dev.name() + ".INTOUT");
374                break;
375            case netlist_terminal_t::INPUT:
376                dynamic_cast<netlist_input_t &>(term).init_object(dev, dev.name() + ".INTINP", aState);
377                break;
378            case netlist_terminal_t::TERMINAL:
379                dynamic_cast<netlist_terminal_t &>(term).init_object(dev, dev.name() + ".INTTERM", aState);
380                break;
381            default:
382                dev.netlist().xfatalerror("Unknown terminal type");
383                break;
384        }
385    }
368   if (!term.isInitalized())
369   {
370      switch (term.type())
371      {
372         case netlist_terminal_t::OUTPUT:
373            dynamic_cast<netlist_output_t &>(term).init_object(dev, dev.name() + ".INTOUT");
374            break;
375         case netlist_terminal_t::INPUT:
376            dynamic_cast<netlist_input_t &>(term).init_object(dev, dev.name() + ".INTINP", aState);
377            break;
378         case netlist_terminal_t::TERMINAL:
379            dynamic_cast<netlist_terminal_t &>(term).init_object(dev, dev.name() + ".INTTERM", aState);
380            break;
381         default:
382            dev.netlist().xfatalerror("Unknown terminal type");
383            break;
384      }
385   }
386386}
387387
388388// FIXME: Revise internal links ...
389389//FIXME: Get rid of this
390390ATTR_COLD void netlist_device_t::register_link_internal(netlist_core_device_t &dev, netlist_input_t &in, netlist_output_t &out, const netlist_input_t::state_e aState)
391391{
392    init_term(dev, in, aState);
393    init_term(dev, out, aState);
394    setup().connect(in, out);
392   init_term(dev, in, aState);
393   init_term(dev, out, aState);
394   setup().connect(in, out);
395395}
396396
397397ATTR_COLD void netlist_device_t::register_link_internal(netlist_input_t &in, netlist_output_t &out, const netlist_input_t::state_e aState)
398398{
399    register_link_internal(*this, in, out, aState);
399   register_link_internal(*this, in, out, aState);
400400}
401401
402402template <class C, class T>
403403ATTR_COLD void netlist_device_t::register_param(netlist_core_device_t &dev, const pstring &sname, C &param, const T initialVal)
404404{
405    pstring fullname = dev.name() + "." + sname;
406    param.init_object(dev, fullname);
407    param.initial(initialVal);
408    //FIXME: pass fullname from above
409    setup().register_object(*this, *this, fullname, param, netlist_terminal_t::STATE_NONEX);
405   pstring fullname = dev.name() + "." + sname;
406   param.init_object(dev, fullname);
407   param.initial(initialVal);
408   //FIXME: pass fullname from above
409   setup().register_object(*this, *this, fullname, param, netlist_terminal_t::STATE_NONEX);
410410}
411411
412412template ATTR_COLD void netlist_device_t::register_param(netlist_core_device_t &dev, const pstring &sname, netlist_param_double_t &param, const double initialVal);
r26736r26737
422422// ----------------------------------------------------------------------------------------
423423
424424ATTR_COLD netlist_net_t::netlist_net_t(const type_t atype, const family_t afamily)
425    : netlist_object_t(atype, afamily)
426    ,  m_head(NULL)
427    , m_num_cons(0)
428    , m_time(netlist_time::zero)
429    , m_active(0)
430    , m_in_queue(2)
431    , m_railterminal(NULL)
425   : netlist_object_t(atype, afamily)
426   ,  m_head(NULL)
427   , m_num_cons(0)
428   , m_time(netlist_time::zero)
429   , m_active(0)
430   , m_in_queue(2)
431   , m_railterminal(NULL)
432432{
433433};
434434
435435ATTR_COLD void netlist_net_t::init_object(netlist_base_t &nl, const pstring &aname)
436436{
437    netlist_object_t::init_object(nl, aname);
438    nl.m_nets.add(this);
437   netlist_object_t::init_object(nl, aname);
438   nl.m_nets.add(this);
439439}
440440
441441ATTR_COLD void netlist_net_t::register_railterminal(netlist_output_t &mr)
442442{
443    assert(m_railterminal == NULL);
444    m_railterminal = &mr;
443   assert(m_railterminal == NULL);
444   m_railterminal = &mr;
445445}
446446
447447ATTR_COLD void netlist_net_t::merge_net(netlist_net_t *othernet)
448448{
449    NL_VERBOSE_OUT(("merging nets ...\n"));
450    if (othernet == NULL)
451        return; // Nothing to do
449   NL_VERBOSE_OUT(("merging nets ...\n"));
450   if (othernet == NULL)
451      return; // Nothing to do
452452
453    if (this->isRailNet() && othernet->isRailNet())
454        netlist().xfatalerror("Trying to merge to rail nets\n");
453   if (this->isRailNet() && othernet->isRailNet())
454      netlist().xfatalerror("Trying to merge to rail nets\n");
455455
456    if (othernet->isRailNet())
457    {
458        NL_VERBOSE_OUT(("othernet is railnet\n"));
459        othernet->merge_net(this);
460    }
461    else
462    {
463        netlist_core_terminal_t *p = othernet->m_head;
464        while (p != NULL)
465        {
466            netlist_core_terminal_t *pn = p->m_update_list_next;
467            register_con(*p);
468            p = pn;
469        }
456   if (othernet->isRailNet())
457   {
458      NL_VERBOSE_OUT(("othernet is railnet\n"));
459      othernet->merge_net(this);
460   }
461   else
462   {
463      netlist_core_terminal_t *p = othernet->m_head;
464      while (p != NULL)
465      {
466         netlist_core_terminal_t *pn = p->m_update_list_next;
467         register_con(*p);
468         p = pn;
469      }
470470
471        othernet->m_head = NULL; // FIXME: othernet needs to be free'd from memory
472    }
471      othernet->m_head = NULL; // FIXME: othernet needs to be free'd from memory
472   }
473473}
474474
475475ATTR_COLD void netlist_net_t::register_con(netlist_core_terminal_t &terminal)
476476{
477    terminal.set_net(*this);
477   terminal.set_net(*this);
478478
479    terminal.m_update_list_next = m_head;
480    m_head = &terminal;
481    m_num_cons++;
479   terminal.m_update_list_next = m_head;
480   m_head = &terminal;
481   m_num_cons++;
482482
483    if (terminal.state() != netlist_input_t::STATE_INP_PASSIVE)
484        m_active++;
483   if (terminal.state() != netlist_input_t::STATE_INP_PASSIVE)
484      m_active++;
485485}
486486
487487ATTR_HOT inline void netlist_net_t::update_dev(const netlist_core_terminal_t *inp, const UINT32 mask) const
488488{
489    if ((inp->state() & mask) != 0)
490    {
491        netlist_core_device_t &netdev = inp->netdev();
492        begin_timing(netdev.total_time);
493        inc_stat(netdev.stat_count);
494        netdev.update_dev();
495        end_timing(netdev().total_time);
496    }
489   if ((inp->state() & mask) != 0)
490   {
491      netlist_core_device_t &netdev = inp->netdev();
492      begin_timing(netdev.total_time);
493      inc_stat(netdev.stat_count);
494      netdev.update_dev();
495      end_timing(netdev().total_time);
496   }
497497}
498498
499499ATTR_HOT inline void netlist_net_t::update_devs()
500500{
501    assert(m_num_cons != 0);
501   assert(m_num_cons != 0);
502502
503    assert(this->isRailNet());
504    {
503   assert(this->isRailNet());
504   {
505      const UINT32 masks[4] = { 1, 5, 3, 1 };
506      m_cur = m_new;
507      m_in_queue = 2; /* mark as taken ... */
505508
506        const UINT32 masks[4] = { 1, 5, 3, 1 };
507        m_cur = m_new;
508        m_in_queue = 2; /* mark as taken ... */
509      const UINT32 mask = masks[ (m_last.Q  << 1) | m_cur.Q ];
509510
510        const UINT32 mask = masks[ (m_last.Q  << 1) | m_cur.Q ];
511
512        netlist_core_terminal_t *p = m_head;
513        switch (m_num_cons)
514        {
515        case 2:
516            update_dev(p, mask);
517            p = p->m_update_list_next;
518        case 1:
519            update_dev(p, mask);
520            break;
521        default:
522            do
523            {
524                update_dev(p, mask);
525                p = p->m_update_list_next;
526            } while (p != NULL);
527            break;
528        }
529        m_last = m_cur;
530    }
511      netlist_core_terminal_t *p = m_head;
512      switch (m_num_cons)
513      {
514      case 2:
515         update_dev(p, mask);
516         p = p->m_update_list_next;
517      case 1:
518         update_dev(p, mask);
519         break;
520      default:
521         do
522         {
523            update_dev(p, mask);
524            p = p->m_update_list_next;
525         } while (p != NULL);
526         break;
527      }
528      m_last = m_cur;
529   }
531530}
532531
533532// ----------------------------------------------------------------------------------------
r26736r26737
540539, m_net(NULL)
541540, m_state(STATE_NONEX)
542541{
543
544542}
545543
546544ATTR_COLD netlist_terminal_t::netlist_terminal_t()
r26736r26737
549547, m_go(NETLIST_GMIN)
550548, m_gt(NETLIST_GMIN)
551549{
552
553550}
554551
555552ATTR_COLD void netlist_core_terminal_t::init_object(netlist_core_device_t &dev, const pstring &aname, const state_e astate)
556553{
557    set_state(astate);
558    netlist_owned_object_t::init_object(dev, aname);
554   set_state(astate);
555   netlist_owned_object_t::init_object(dev, aname);
559556}
560557
561558ATTR_COLD void netlist_core_terminal_t::set_net(netlist_net_t &anet)
562559{
563    m_net = &anet;
560   m_net = &anet;
564561}
565562
566563// ----------------------------------------------------------------------------------------
r26736r26737
572569// ----------------------------------------------------------------------------------------
573570
574571netlist_output_t::netlist_output_t(const type_t atype, const family_t afamily)
575    : netlist_core_terminal_t(atype, afamily)
576    , m_low_V(0.0)
577    , m_high_V(0.0)
578    , m_my_net(NET, afamily)
572   : netlist_core_terminal_t(atype, afamily)
573   , m_low_V(0.0)
574   , m_high_V(0.0)
575   , m_my_net(NET, afamily)
579576{
580    //m_net = new net_net_t(NET_DIGITAL);
581    this->set_net(m_my_net);
577   //m_net = new net_net_t(NET_DIGITAL);
578   this->set_net(m_my_net);
582579}
583580
584581ATTR_COLD void netlist_output_t::init_object(netlist_core_device_t &dev, const pstring &aname)
585582{
586    netlist_core_terminal_t::init_object(dev, aname, STATE_OUT);
587    net().init_object(dev.netlist(), aname + ".net");
588    net().register_railterminal(*this);
583   netlist_core_terminal_t::init_object(dev, aname, STATE_OUT);
584   net().init_object(dev.netlist(), aname + ".net");
585   net().register_railterminal(*this);
589586}
590587
591588ATTR_COLD void netlist_logic_output_t::initial(const netlist_sig_t val)
592589{
593    net().m_cur.Q = val;
594    net().m_new.Q = val;
595    net().m_last.Q = !val;
590   net().m_cur.Q = val;
591   net().m_new.Q = val;
592   net().m_last.Q = !val;
596593}
597594
598595ATTR_COLD netlist_logic_output_t::netlist_logic_output_t()
599    : netlist_output_t(OUTPUT, LOGIC)
596   : netlist_output_t(OUTPUT, LOGIC)
600597{
601    // Default to TTL
602    m_low_V = 0.1;  // these depend on sinked/sourced current. Values should be suitable for typical applications.
603    m_high_V = 4.8;
598   // Default to TTL
599   m_low_V = 0.1;  // these depend on sinked/sourced current. Values should be suitable for typical applications.
600   m_high_V = 4.8;
604601}
605602
606603ATTR_COLD void netlist_logic_output_t::set_levels(const double low, const double high)
607604{
608    m_low_V = low;
609    m_high_V = high;
605   m_low_V = low;
606   m_high_V = high;
610607}
611608
612609// ----------------------------------------------------------------------------------------
r26736r26737
614611// ----------------------------------------------------------------------------------------
615612
616613ATTR_COLD netlist_ttl_output_t::netlist_ttl_output_t()
617    : netlist_logic_output_t()
614   : netlist_logic_output_t()
618615{
619    set_levels(0.3, 3.4);
616   set_levels(0.3, 3.4);
620617}
621618
622619// ----------------------------------------------------------------------------------------
r26736r26737
624621// ----------------------------------------------------------------------------------------
625622
626623ATTR_COLD netlist_analog_output_t::netlist_analog_output_t()
627    : netlist_output_t(OUTPUT, ANALOG)
624   : netlist_output_t(OUTPUT, ANALOG)
628625{
629    net().m_cur.Analog = 0.0;
630    net().m_new.Analog = 99.0;
626   net().m_cur.Analog = 0.0;
627   net().m_new.Analog = 99.0;
631628}
632629
633630ATTR_COLD void netlist_analog_output_t::initial(const double val)
634631{
635    net().m_cur.Analog = val;
636    net().m_new.Analog = 99.0;
632   net().m_cur.Analog = val;
633   net().m_new.Analog = 99.0;
637634}
638635
639636// ----------------------------------------------------------------------------------------
r26736r26737
641638// ----------------------------------------------------------------------------------------
642639
643640ATTR_COLD netlist_param_t::netlist_param_t(const param_type_t atype)
644    : netlist_owned_object_t(PARAM, ANALOG)
645    , m_param_type(atype)
641   : netlist_owned_object_t(PARAM, ANALOG)
642   , m_param_type(atype)
646643{
647644}
648645
649646ATTR_COLD netlist_param_double_t::netlist_param_double_t()
650    : netlist_param_t(DOUBLE)
651    , m_param(0.0)
647   : netlist_param_t(DOUBLE)
648   , m_param(0.0)
652649{
653650}
654651
655652ATTR_COLD netlist_param_int_t::netlist_param_int_t()
656    : netlist_param_t(INTEGER)
657    , m_param(0)
653   : netlist_param_t(INTEGER)
654   , m_param(0)
658655{
659656}
660657
661658ATTR_COLD netlist_param_logic_t::netlist_param_logic_t()
662    : netlist_param_int_t()
659   : netlist_param_int_t()
663660{
664661}
665662
666663ATTR_COLD netlist_param_str_t::netlist_param_str_t()
667    : netlist_param_t(STRING)
668    , m_param("")
664   : netlist_param_t(STRING)
665   , m_param("")
669666{
670667}
671668
672669ATTR_COLD netlist_param_model_t::netlist_param_model_t()
673    : netlist_param_t(MODEL)
674    , m_param("")
670   : netlist_param_t(MODEL)
671   , m_param("")
675672{
676673}
677674
678675ATTR_COLD double netlist_param_model_t::dValue(const pstring &entity, const double defval) const
679676{
680    pstring tmp = this->Value();
681    // .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
682    int p = tmp.ucase().find(entity.ucase() + "=");
683    if (p>=0)
684    {
685        int pblank = tmp.find(" ", p);
686        if (pblank < 0) pblank = tmp.len() + 1;
687        tmp = tmp.substr(p, pblank - p);
688        int pequal = tmp.find("=", 0);
689        if (pequal < 0)
690            netlist().xfatalerror("parameter %s misformat in model %s temp %s\n", entity.cstr(), Value().cstr(), tmp.cstr());
691        tmp = tmp.substr(pequal+1);
692        double factor = 1.0;
693        switch (*(tmp.right(1).cstr()))
694        {
695            case 'm': factor = 1e-3; break;
696            case 'u': factor = 1e-6; break;
697            case 'n': factor = 1e-9; break;
698            case 'p': factor = 1e-12; break;
699            case 'f': factor = 1e-15; break;
700            case 'a': factor = 1e-18; break;
677   pstring tmp = this->Value();
678   // .model 1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)
679   int p = tmp.ucase().find(entity.ucase() + "=");
680   if (p>=0)
681   {
682      int pblank = tmp.find(" ", p);
683      if (pblank < 0) pblank = tmp.len() + 1;
684      tmp = tmp.substr(p, pblank - p);
685      int pequal = tmp.find("=", 0);
686      if (pequal < 0)
687         netlist().xfatalerror("parameter %s misformat in model %s temp %s\n", entity.cstr(), Value().cstr(), tmp.cstr());
688      tmp = tmp.substr(pequal+1);
689      double factor = 1.0;
690      switch (*(tmp.right(1).cstr()))
691      {
692         case 'm': factor = 1e-3; break;
693         case 'u': factor = 1e-6; break;
694         case 'n': factor = 1e-9; break;
695         case 'p': factor = 1e-12; break;
696         case 'f': factor = 1e-15; break;
697         case 'a': factor = 1e-18; break;
701698
702        }
703        if (factor != 1.0)
704            tmp = tmp.left(tmp.len() - 1);
705        return atof(tmp.cstr()) * factor;
706    }
707    else
708        return defval;
699      }
700      if (factor != 1.0)
701         tmp = tmp.left(tmp.len() - 1);
702      return atof(tmp.cstr()) * factor;
703   }
704   else
705      return defval;
709706}
710707
711708
r26736r26737
715712
716713ATTR_HOT inline void NETLIB_NAME(mainclock)::mc_update(netlist_net_t &net, const netlist_time curtime)
717714{
718    net.m_new.Q = !net.m_new.Q;
719    net.set_time(curtime);
720    net.update_devs();
715   net.m_new.Q = !net.m_new.Q;
716   net.set_time(curtime);
717   net.update_devs();
721718}
722719
723720NETLIB_START(mainclock)
724721{
725    register_output("Q", m_Q);
722   register_output("Q", m_Q);
726723
727    register_param("FREQ", m_freq, 7159000.0 * 5);
728    m_inc = netlist_time::from_hz(m_freq.Value()*2);
724   register_param("FREQ", m_freq, 7159000.0 * 5);
725   m_inc = netlist_time::from_hz(m_freq.Value()*2);
729726}
730727
731728NETLIB_UPDATE_PARAM(mainclock)
732729{
733    m_inc = netlist_time::from_hz(m_freq.Value()*2);
730   m_inc = netlist_time::from_hz(m_freq.Value()*2);
734731}
735732
736733NETLIB_UPDATE(mainclock)
737734{
738    netlist_net_t &net = m_Q.net();
739    // this is only called during setup ...
740    net.m_new.Q = !net.m_new.Q;
741    net.set_time(netlist().time() + m_inc);
735   netlist_net_t &net = m_Q.net();
736   // this is only called during setup ...
737   net.m_new.Q = !net.m_new.Q;
738   net.set_time(netlist().time() + m_inc);
742739}
trunk/src/emu/netlist/pstate.h
r26736r26737
1616// ----------------------------------------------------------------------------------------
1717
1818#define PSTATE_INTERFACE(manager, module)               \
19    template<class C> ATTR_COLD void save(C &state, const pstring &stname) \
20    {                                                                       \
21        dynamic_cast<pstate_manager_t &>(manager).save_manager(state, module + "." + stname);  \
22    }
19   template<class C> ATTR_COLD void save(C &state, const pstring &stname) \
20   {                                                                       \
21      dynamic_cast<pstate_manager_t &>(manager).save_manager(state, module + "." + stname);  \
22   }
2323
2424enum netlist_data_type_e {
25    NOT_SUPPORTED,
26    DT_DOUBLE,
27    DT_INT64,
28    DT_INT8,
29    DT_INT,
30    DT_BOOLEAN
25   NOT_SUPPORTED,
26   DT_DOUBLE,
27   DT_INT64,
28   DT_INT8,
29   DT_INT,
30   DT_BOOLEAN
3131};
3232
3333template<typename _ItemType> struct nl_datatype { static const netlist_data_type_e type = netlist_data_type_e(NOT_SUPPORTED); };
r26736r26737
4646
4747struct pstate_entry_t
4848{
49    typedef netlist_list_t<pstate_entry_t *> list_t;
49   typedef netlist_list_t<pstate_entry_t *> list_t;
5050
51    pstate_entry_t(const pstring &stname, const netlist_data_type_e dt, const int size, const int count, void *ptr) :
52        m_name(stname), m_dt(dt), m_size(size), m_count(count), m_ptr(ptr) { }
53    pstring m_name;
54    netlist_data_type_e m_dt;
55    int m_size;
56    int m_count;
57    void *m_ptr;
51   pstate_entry_t(const pstring &stname, const netlist_data_type_e dt, const int size, const int count, void *ptr) :
52      m_name(stname), m_dt(dt), m_size(size), m_count(count), m_ptr(ptr) { }
53   pstring m_name;
54   netlist_data_type_e m_dt;
55   int m_size;
56   int m_count;
57   void *m_ptr;
5858};
5959
6060class pstate_manager_t
6161{
6262public:
6363
64    ATTR_COLD ~pstate_manager_t();
64   ATTR_COLD ~pstate_manager_t();
6565
66    template<class C> ATTR_COLD void save_manager(C &state, const pstring &stname)
67    {
68        save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), 1, &state);
69    }
66   template<class C> ATTR_COLD void save_manager(C &state, const pstring &stname)
67   {
68      save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), 1, &state);
69   }
7070
71    template<class C> ATTR_COLD void save_manager(C *state, const pstring &stname, const int count)
72    {
73        save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), count, state);
74    }
71   template<class C> ATTR_COLD void save_manager(C *state, const pstring &stname, const int count)
72   {
73      save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), count, state);
74   }
7575
76    template<class C, std::size_t N> ATTR_COLD void save_manager(C (&state)[N], const pstring &stname)
77    {
78        save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), N, &(state[0]));
79    }
76   template<class C, std::size_t N> ATTR_COLD void save_manager(C (&state)[N], const pstring &stname)
77   {
78      save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), N, &(state[0]));
79   }
8080
81    inline const pstate_entry_t::list_t &save_list() const { return m_save; }
81   inline const pstate_entry_t::list_t &save_list() const { return m_save; }
8282
8383protected:
84    ATTR_COLD void save_state_ptr(const pstring &stname, const netlist_data_type_e, const int size, const int count, void *ptr);
84   ATTR_COLD void save_state_ptr(const pstring &stname, const netlist_data_type_e, const int size, const int count, void *ptr);
8585
8686private:
87    pstate_entry_t::list_t m_save;
87   pstate_entry_t::list_t m_save;
8888};
8989
9090template<> ATTR_COLD inline void pstate_manager_t::save_manager(netlist_time &nlt, const pstring &stname)
9191{
92    save_state_ptr(stname, DT_INT64, sizeof(netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr());
92   save_state_ptr(stname, DT_INT64, sizeof(netlist_time::INTERNALTYPE), 1, nlt.get_internaltype_ptr());
9393}
9494
9595
trunk/src/emu/netlist/nl_base.h
r26736r26737
192192#define NETLIB_UPDATEI() ATTR_HOT ATTR_ALIGN inline void update(void)
193193
194194#define NETLIB_DEVICE_BASE(_name, _pclass, _extra, _priv)                           \
195    class _name : public _pclass                                                    \
196    {                                                                               \
197    public:                                                                         \
198        _name()                                                                     \
199        : _pclass()    { }                                                          \
200    protected:                                                                      \
201        _extra                                                                      \
202        ATTR_HOT void update();                                                     \
203        ATTR_HOT void start();                                                      \
204        _priv                                                                       \
205    }
195   class _name : public _pclass                                                    \
196   {                                                                               \
197   public:                                                                         \
198      _name()                                                                     \
199      : _pclass()    { }                                                          \
200   protected:                                                                      \
201      _extra                                                                      \
202      ATTR_HOT void update();                                                     \
203      ATTR_HOT void start();                                                      \
204      _priv                                                                       \
205   }
206206
207207#define NETLIB_DEVICE_DERIVED(_name, _pclass, _priv)                                \
208208      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass), , _priv)
r26736r26737
211211      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t, , _priv)
212212
213213#define NETLIB_SUBDEVICE(_name, _priv)                                             \
214    class NETLIB_NAME(_name) : public netlist_device_t                              \
215    {                                                                               \
216    public:                                                                         \
217        NETLIB_NAME(_name) ()                                                       \
218        : netlist_device_t()                                                        \
219            { }                                                                     \
220    /*protected:*/                                                                  \
221        ATTR_HOT void update();                                                     \
222        ATTR_HOT void start();                                                      \
223    public:                                                                         \
224        _priv                                                                       \
225    }
214   class NETLIB_NAME(_name) : public netlist_device_t                              \
215   {                                                                               \
216   public:                                                                         \
217      NETLIB_NAME(_name) ()                                                       \
218      : netlist_device_t()                                                        \
219         { }                                                                     \
220   /*protected:*/                                                                  \
221      ATTR_HOT void update();                                                     \
222      ATTR_HOT void start();                                                      \
223   public:                                                                         \
224      _priv                                                                       \
225   }
226226
227227#define NETLIB_DEVICE_WITH_PARAMS(_name, _priv)                                     \
228        NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t,                    \
229           ATTR_HOT void update_param();                                           \
230       , _priv)
228      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), netlist_device_t,                    \
229         ATTR_HOT void update_param();                                           \
230      , _priv)
231231
232232#define NETLIB_DEVICE_WITH_PARAMS_DERIVED(_name, _pclass, _priv)                    \
233        NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass),                \
234            ATTR_HOT void update_param();                                           \
235        , _priv)
233      NETLIB_DEVICE_BASE(NETLIB_NAME(_name), NETLIB_NAME(_pclass),                \
234         ATTR_HOT void update_param();                                           \
235      , _priv)
236236
237237// ----------------------------------------------------------------------------------------
238238// forward definitions
r26736r26737
253253
254254class netlist_object_t
255255{
256    NETLIST_PREVENT_COPYING(netlist_object_t)
256   NETLIST_PREVENT_COPYING(netlist_object_t)
257257public:
258258   enum type_t {
259        TERMINAL = 0,
259      TERMINAL = 0,
260260      INPUT    = 1,
261261      OUTPUT   = 2,
262262      PARAM    = 3,
263263      NET      = 4,
264        DEVICE   = 5,
265        NETLIST   = 6,
264      DEVICE   = 5,
265      NETLIST   = 6,
266266   };
267    enum family_t {
268        // Terminal families
269        LOGIC     = 1,
270        ANALOG    = 2,
271        // Device families
272        GENERIC   = 3,   // <== devices usually fall into this category
273        RESISTOR  = 4,   // Resistor
274        CAPACITOR = 5,   // Capacitor
275        DIODE     = 6,   // Diode
276        BJT_SWITCH = 7,  // BJT(Switch)
277        VCVS       = 8,  // Voltage controlled voltage source
278        VCCS       = 9,  // Voltage controlled voltage source
279    };
267   enum family_t {
268      // Terminal families
269      LOGIC     = 1,
270      ANALOG    = 2,
271      // Device families
272      GENERIC   = 3,   // <== devices usually fall into this category
273      RESISTOR  = 4,   // Resistor
274      CAPACITOR = 5,   // Capacitor
275      DIODE     = 6,   // Diode
276      BJT_SWITCH = 7,  // BJT(Switch)
277      VCVS       = 8,  // Voltage controlled voltage source
278      VCCS       = 9,  // Voltage controlled voltage source
279   };
280280
281281   ATTR_COLD netlist_object_t(const type_t atype, const family_t afamily);
282282
283283   virtual ~netlist_object_t();
284284
285285   ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
286    ATTR_COLD bool isInitalized() { return (m_netlist != NULL); }
286   ATTR_COLD bool isInitalized() { return (m_netlist != NULL); }
287287
288    ATTR_COLD const pstring &name() const;
288   ATTR_COLD const pstring &name() const;
289289
290    PSTATE_INTERFACE(*m_netlist, name())
290   PSTATE_INTERFACE(*m_netlist, name())
291291
292292#if 0
293    template<class C> ATTR_COLD void save(C &state, const pstring &stname)
294    {
295        save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), &state);
296    }
293   template<class C> ATTR_COLD void save(C &state, const pstring &stname)
294   {
295      save_state_ptr(stname, nl_datatype<C>::type, sizeof(C), &state);
296   }
297297#endif
298298
299299   ATTR_HOT inline const type_t type() const { return m_objtype; }
300    ATTR_HOT inline const family_t family() const { return m_family; }
300   ATTR_HOT inline const family_t family() const { return m_family; }
301301
302302   ATTR_HOT inline const bool isType(const type_t atype) const { return (m_objtype == atype); }
303    ATTR_HOT inline const bool isFamily(const family_t afamily) const { return (m_family == afamily); }
303   ATTR_HOT inline const bool isFamily(const family_t afamily) const { return (m_family == afamily); }
304304
305    ATTR_HOT inline netlist_base_t & RESTRICT netlist() { return *m_netlist; }
306    ATTR_HOT inline const netlist_base_t & RESTRICT netlist() const { return *m_netlist; }
305   ATTR_HOT inline netlist_base_t & RESTRICT netlist() { return *m_netlist; }
306   ATTR_HOT inline const netlist_base_t & RESTRICT netlist() const { return *m_netlist; }
307307
308308protected:
309309
310310#if 0
311    // pstate_interface virtual
312    ATTR_COLD virtual void save_state_ptr(const pstring &stname, const netlist_data_type_e, const int size, const int count, void *ptr);
311   // pstate_interface virtual
312   ATTR_COLD virtual void save_state_ptr(const pstring &stname, const netlist_data_type_e, const int size, const int count, void *ptr);
313313#endif
314314
315    // must call parent save_register !
316    ATTR_COLD virtual void save_register() { };
315   // must call parent save_register !
316   ATTR_COLD virtual void save_register() { };
317317
318318private:
319    pstring m_name;
319   pstring m_name;
320320   const type_t m_objtype;
321    const family_t m_family;
322    netlist_base_t * RESTRICT m_netlist;
321   const family_t m_family;
322   netlist_base_t * RESTRICT m_netlist;
323323};
324324
325325// ----------------------------------------------------------------------------------------
r26736r26737
328328
329329class netlist_owned_object_t : public netlist_object_t
330330{
331    NETLIST_PREVENT_COPYING(netlist_owned_object_t)
331   NETLIST_PREVENT_COPYING(netlist_owned_object_t)
332332public:
333    ATTR_COLD netlist_owned_object_t(const type_t atype, const family_t afamily);
333   ATTR_COLD netlist_owned_object_t(const type_t atype, const family_t afamily);
334334
335    ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
335   ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
336336
337    ATTR_HOT inline netlist_core_device_t & RESTRICT netdev() const { return *m_netdev; }
337   ATTR_HOT inline netlist_core_device_t & RESTRICT netdev() const { return *m_netdev; }
338338private:
339    netlist_core_device_t * RESTRICT m_netdev;
339   netlist_core_device_t * RESTRICT m_netdev;
340340};
341341
342342// ----------------------------------------------------------------------------------------
r26736r26737
345345
346346class netlist_core_terminal_t : public netlist_owned_object_t
347347{
348    NETLIST_PREVENT_COPYING(netlist_core_terminal_t)
348   NETLIST_PREVENT_COPYING(netlist_core_terminal_t)
349349public:
350350
351    /* needed here ... */
351   /* needed here ... */
352352
353    enum state_e {
354        STATE_INP_PASSIVE = 0,
355        STATE_INP_ACTIVE = 1,
356        STATE_INP_HL = 2,
357        STATE_INP_LH = 4,
358        STATE_OUT = 128,
359        STATE_NONEX = 256
360    };
353   enum state_e {
354      STATE_INP_PASSIVE = 0,
355      STATE_INP_ACTIVE = 1,
356      STATE_INP_HL = 2,
357      STATE_INP_LH = 4,
358      STATE_OUT = 128,
359      STATE_NONEX = 256
360   };
361361
362362
363363   ATTR_COLD netlist_core_terminal_t(const type_t atype, const family_t afamily);
364364
365365   ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname, const state_e astate);
366366
367    ATTR_COLD void set_net(netlist_net_t &anet);
368    ATTR_COLD inline bool has_net() const { return (m_net != NULL); }
369    ATTR_HOT inline const netlist_net_t & RESTRICT net() const { return *m_net;}
370    ATTR_HOT inline netlist_net_t & RESTRICT net() { return *m_net;}
367   ATTR_COLD void set_net(netlist_net_t &anet);
368   ATTR_COLD inline bool has_net() const { return (m_net != NULL); }
369   ATTR_HOT inline const netlist_net_t & RESTRICT net() const { return *m_net;}
370   ATTR_HOT inline netlist_net_t & RESTRICT net() { return *m_net;}
371371
372    ATTR_HOT inline const bool is_state(const state_e astate) const { return (m_state == astate); }
373    ATTR_HOT inline const state_e state() const { return m_state; }
374    ATTR_HOT inline void set_state(const state_e astate)
375    {
376        assert(astate != STATE_NONEX);
377        m_state = astate;
378    }
372   ATTR_HOT inline const bool is_state(const state_e astate) const { return (m_state == astate); }
373   ATTR_HOT inline const state_e state() const { return m_state; }
374   ATTR_HOT inline void set_state(const state_e astate)
375   {
376      assert(astate != STATE_NONEX);
377      m_state = astate;
378   }
379379
380    netlist_core_terminal_t *m_update_list_next;
380   netlist_core_terminal_t *m_update_list_next;
381381
382382protected:
383    ATTR_COLD virtual void save_register() { save(NAME(m_state)); netlist_owned_object_t::save_register(); }
383   ATTR_COLD virtual void save_register() { save(NAME(m_state)); netlist_owned_object_t::save_register(); }
384384
385385private:
386    netlist_net_t * RESTRICT m_net;
387    state_e m_state;
386   netlist_net_t * RESTRICT m_net;
387   state_e m_state;
388388};
389389
390390NETLIST_SAVE_TYPE(netlist_core_terminal_t::state_e, DT_INT);
r26736r26737
392392
393393class netlist_terminal_t : public netlist_core_terminal_t
394394{
395    NETLIST_PREVENT_COPYING(netlist_terminal_t)
395   NETLIST_PREVENT_COPYING(netlist_terminal_t)
396396public:
397    ATTR_COLD netlist_terminal_t();
397   ATTR_COLD netlist_terminal_t();
398398
399    double m_Idr; // drive current
400    double m_go;  // conductance for Voltage from other term
401    double m_gt;  // conductance for total conductance
399   double m_Idr; // drive current
400   double m_go;  // conductance for Voltage from other term
401   double m_gt;  // conductance for total conductance
402402
403    ATTR_HOT inline void set(const double G)
404    {
405        m_Idr = 0;
406        m_go = m_gt = G;
407    }
403   ATTR_HOT inline void set(const double G)
404   {
405      m_Idr = 0;
406      m_go = m_gt = G;
407   }
408408
409    ATTR_HOT inline void set(const double GO, const double GT)
410    {
411        m_Idr = 0;
412        m_go = GO;
413        m_gt = GT;
414    }
409   ATTR_HOT inline void set(const double GO, const double GT)
410   {
411      m_Idr = 0;
412      m_go = GO;
413      m_gt = GT;
414   }
415415
416    ATTR_HOT inline void set(const double GO, const double GT, const double I)
417    {
418        m_Idr = I;
419        m_go = GO;
420        m_gt = GT;
421    }
416   ATTR_HOT inline void set(const double GO, const double GT, const double I)
417   {
418      m_Idr = I;
419      m_go = GO;
420      m_gt = GT;
421   }
422422
423423
424    netlist_terminal_t *m_otherterm;
424   netlist_terminal_t *m_otherterm;
425425
426426protected:
427    ATTR_COLD virtual void save_register()
428    {
429        save(NAME(m_Idr));
430        save(NAME(m_go));
431        save(NAME(m_gt));
432        netlist_core_terminal_t::save_register();
433    }
427   ATTR_COLD virtual void save_register()
428   {
429      save(NAME(m_Idr));
430      save(NAME(m_go));
431      save(NAME(m_gt));
432      netlist_core_terminal_t::save_register();
433   }
434434
435435};
436436
r26736r26737
446446
447447   ATTR_COLD netlist_input_t(const type_t atype, const family_t afamily)
448448      : netlist_core_terminal_t(atype, afamily)
449        , m_low_thresh_V(0)
450        , m_high_thresh_V(0)
449      , m_low_thresh_V(0)
450      , m_high_thresh_V(0)
451451   {
452       set_state(STATE_INP_ACTIVE);
452      set_state(STATE_INP_ACTIVE);
453453   }
454454
455455   ATTR_HOT inline void inactivate();
r26736r26737
521521
522522class netlist_net_t : public netlist_object_t
523523{
524    NETLIST_PREVENT_COPYING(netlist_net_t)
524   NETLIST_PREVENT_COPYING(netlist_net_t)
525525public:
526526
527    typedef netlist_list_t<netlist_net_t *> list_t;
527   typedef netlist_list_t<netlist_net_t *> list_t;
528528
529    friend class NETLIB_NAME(mainclock);
530    friend class netlist_matrix_solver_t;
531    friend class netlist_logic_output_t;
532    friend class netlist_analog_output_t;
529   friend class NETLIB_NAME(mainclock);
530   friend class netlist_matrix_solver_t;
531   friend class netlist_logic_output_t;
532   friend class netlist_analog_output_t;
533533
534    // FIXME: union does not work
535    struct hybrid_t
536    {
537        inline hybrid_t() : Q(0), Analog(0.0) {}
538        netlist_sig_t Q;
539        double        Analog;
540    };
534   // FIXME: union does not work
535   struct hybrid_t
536   {
537      inline hybrid_t() : Q(0), Analog(0.0) {}
538      netlist_sig_t Q;
539      double        Analog;
540   };
541541
542    ATTR_COLD netlist_net_t(const type_t atype, const family_t afamily);
543    ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
542   ATTR_COLD netlist_net_t(const type_t atype, const family_t afamily);
543   ATTR_COLD void init_object(netlist_base_t &nl, const pstring &aname);
544544
545    ATTR_COLD void register_con(netlist_core_terminal_t &terminal);
546    ATTR_COLD void merge_net(netlist_net_t *othernet);
547    ATTR_COLD void register_railterminal(netlist_output_t &mr);
545   ATTR_COLD void register_con(netlist_core_terminal_t &terminal);
546   ATTR_COLD void merge_net(netlist_net_t *othernet);
547   ATTR_COLD void register_railterminal(netlist_output_t &mr);
548548
549    /* inline not always works out */
550    ATTR_HOT inline void update_devs();
549   /* inline not always works out */
550   ATTR_HOT inline void update_devs();
551551
552    ATTR_HOT inline const netlist_time time() const { return m_time; }
553    ATTR_HOT inline void set_time(const netlist_time ntime) { m_time = ntime; }
552   ATTR_HOT inline const netlist_time time() const { return m_time; }
553   ATTR_HOT inline void set_time(const netlist_time ntime) { m_time = ntime; }
554554
555    ATTR_HOT inline bool isRailNet() const { return !(m_railterminal == NULL); }
556    ATTR_HOT inline const netlist_core_terminal_t & RESTRICT  railterminal() const { return *m_railterminal; }
555   ATTR_HOT inline bool isRailNet() const { return !(m_railterminal == NULL); }
556   ATTR_HOT inline const netlist_core_terminal_t & RESTRICT  railterminal() const { return *m_railterminal; }
557557
558    /* Everything below is used by the logic subsystem */
558   /* Everything below is used by the logic subsystem */
559559
560    ATTR_HOT inline void inc_active();
561    ATTR_HOT inline void dec_active();
560   ATTR_HOT inline void inc_active();
561   ATTR_HOT inline void dec_active();
562562
563    ATTR_HOT inline const int active_count() const { return m_active; }
563   ATTR_HOT inline const int active_count() const { return m_active; }
564564
565    ATTR_HOT inline const netlist_sig_t Q() const
566    {
567        assert(family() == LOGIC);
568        return m_cur.Q;
569    }
565   ATTR_HOT inline const netlist_sig_t Q() const
566   {
567      assert(family() == LOGIC);
568      return m_cur.Q;
569   }
570570
571    ATTR_HOT inline const netlist_sig_t last_Q() const
572    {
573        assert(family() == LOGIC);
574        return m_last.Q;
575    }
571   ATTR_HOT inline const netlist_sig_t last_Q() const
572   {
573      assert(family() == LOGIC);
574      return m_last.Q;
575   }
576576
577    ATTR_HOT inline const netlist_sig_t new_Q() const
578    {
579        assert(family() == LOGIC);
580        return m_new.Q;
581    }
577   ATTR_HOT inline const netlist_sig_t new_Q() const
578   {
579      assert(family() == LOGIC);
580      return m_new.Q;
581   }
582582
583    ATTR_HOT inline const double Q_Analog() const
584    {
585        //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
586        assert(family() == ANALOG);
587        return m_cur.Analog;
588    }
583   ATTR_HOT inline const double Q_Analog() const
584   {
585      //assert(object_type(SIGNAL_MASK) == SIGNAL_ANALOG);
586      assert(family() == ANALOG);
587      return m_cur.Analog;
588   }
589589
590    ATTR_HOT inline void push_to_queue(const netlist_time &delay);
591    ATTR_HOT bool is_queued() { return m_in_queue == 1; }
590   ATTR_HOT inline void push_to_queue(const netlist_time &delay);
591   ATTR_HOT bool is_queued() { return m_in_queue == 1; }
592592
593    // m_terms is only used by analog subsystem
594    typedef netlist_list_t<netlist_terminal_t *> terminal_list_t;
593   // m_terms is only used by analog subsystem
594   typedef netlist_list_t<netlist_terminal_t *> terminal_list_t;
595595
596    terminal_list_t m_terms;
597    netlist_matrix_solver_t *m_solver;
596   terminal_list_t m_terms;
597   netlist_matrix_solver_t *m_solver;
598598
599    netlist_core_terminal_t *m_head;
599   netlist_core_terminal_t *m_head;
600600
601601protected:
602602
603603
604    hybrid_t m_last;
605    hybrid_t m_cur;
606    hybrid_t m_new;
604   hybrid_t m_last;
605   hybrid_t m_cur;
606   hybrid_t m_new;
607607
608    UINT32 m_num_cons;
608   UINT32 m_num_cons;
609609
610610protected:
611    ATTR_COLD virtual void save_register()
612    {
613        save(NAME(m_last.Analog));
614        save(NAME(m_cur.Analog));
615        save(NAME(m_new.Analog));
616        save(NAME(m_last.Q));
617        save(NAME(m_cur.Q));
618        save(NAME(m_new.Q));
619        save(NAME(m_time));
620        save(NAME(m_active));
621        save(NAME(m_in_queue));
622        netlist_object_t::save_register();
623    }
611   ATTR_COLD virtual void save_register()
612   {
613      save(NAME(m_last.Analog));
614      save(NAME(m_cur.Analog));
615      save(NAME(m_new.Analog));
616      save(NAME(m_last.Q));
617      save(NAME(m_cur.Q));
618      save(NAME(m_new.Q));
619      save(NAME(m_time));
620      save(NAME(m_active));
621      save(NAME(m_in_queue));
622      netlist_object_t::save_register();
623   }
624624
625625private:
626    ATTR_HOT void update_dev(const netlist_core_terminal_t *inp, const UINT32 mask) const;
626   ATTR_HOT void update_dev(const netlist_core_terminal_t *inp, const UINT32 mask) const;
627627
628    netlist_time m_time;
629    INT32        m_active;
630    UINT32       m_in_queue;    /* 0: not in queue, 1: in queue, 2: last was taken */
628   netlist_time m_time;
629   INT32        m_active;
630   UINT32       m_in_queue;    /* 0: not in queue, 1: in queue, 2: last was taken */
631631
632    netlist_core_terminal_t * RESTRICT m_railterminal;
632   netlist_core_terminal_t * RESTRICT m_railterminal;
633633};
634634
635635
r26736r26737
639639
640640class netlist_output_t : public netlist_core_terminal_t
641641{
642    NETLIST_PREVENT_COPYING(netlist_output_t)
642   NETLIST_PREVENT_COPYING(netlist_output_t)
643643public:
644644
645645   ATTR_COLD netlist_output_t(const type_t atype, const family_t afamily);
646646
647    ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
647   ATTR_COLD void init_object(netlist_core_device_t &dev, const pstring &aname);
648648
649649   double m_low_V;
650650   double m_high_V;
r26736r26737
658658
659659class netlist_logic_output_t : public netlist_output_t
660660{
661    NETLIST_PREVENT_COPYING(netlist_logic_output_t)
661   NETLIST_PREVENT_COPYING(netlist_logic_output_t)
662662public:
663663
664664   ATTR_COLD netlist_logic_output_t();
665665
666666   ATTR_COLD void initial(const netlist_sig_t val);
667    ATTR_COLD void set_levels(const double low, const double high);
667   ATTR_COLD void set_levels(const double low, const double high);
668668
669669   ATTR_HOT inline void set_Q(const netlist_sig_t newQ, const netlist_time &delay)
670670   {
671       netlist_net_t &anet = net();
671      netlist_net_t &anet = net();
672672
673673      if (EXPECTED(newQ != anet.m_new.Q))
674674      {
675          anet.m_new.Q = newQ;
675         anet.m_new.Q = newQ;
676676         if (anet.m_num_cons)
677             anet.push_to_queue(delay);
677            anet.push_to_queue(delay);
678678      }
679679   }
680680};
r26736r26737
689689
690690class netlist_analog_output_t : public netlist_output_t
691691{
692    NETLIST_PREVENT_COPYING(netlist_analog_output_t)
692   NETLIST_PREVENT_COPYING(netlist_analog_output_t)
693693public:
694694
695695   ATTR_COLD netlist_analog_output_t();
696696
697    ATTR_COLD void initial(const double val);
697   ATTR_COLD void initial(const double val);
698698
699    ATTR_HOT inline void set_Q(const double newQ, const netlist_time &delay)
699   ATTR_HOT inline void set_Q(const double newQ, const netlist_time &delay)
700700   {
701701      if (newQ != net().m_new.Analog)
702702      {
703          net().m_new.Analog = newQ;
704          net().push_to_queue(delay);
703         net().m_new.Analog = newQ;
704         net().push_to_queue(delay);
705705      }
706706   }
707707
r26736r26737
713713
714714class netlist_param_t : public netlist_owned_object_t
715715{
716    NETLIST_PREVENT_COPYING(netlist_param_t)
716   NETLIST_PREVENT_COPYING(netlist_param_t)
717717public:
718718
719    enum param_type_t {
720        MODEL,
721        STRING,
722        DOUBLE,
723        INTEGER,
724        LOGIC
725    };
719   enum param_type_t {
720      MODEL,
721      STRING,
722      DOUBLE,
723      INTEGER,
724      LOGIC
725   };
726726
727    ATTR_COLD netlist_param_t(const param_type_t atype);
727   ATTR_COLD netlist_param_t(const param_type_t atype);
728728
729    ATTR_HOT inline const param_type_t param_type() const { return m_param_type; }
729   ATTR_HOT inline const param_type_t param_type() const { return m_param_type; }
730730
731731private:
732    const param_type_t m_param_type;
732   const param_type_t m_param_type;
733733};
734734
735735class netlist_param_double_t : public netlist_param_t
736736{
737    NETLIST_PREVENT_COPYING(netlist_param_double_t)
737   NETLIST_PREVENT_COPYING(netlist_param_double_t)
738738public:
739    ATTR_COLD netlist_param_double_t();
739   ATTR_COLD netlist_param_double_t();
740740
741    ATTR_HOT inline void setTo(const double param);
742    ATTR_COLD inline void initial(const double val) { m_param = val; }
743    ATTR_HOT inline const double Value() const        { return m_param;   }
741   ATTR_HOT inline void setTo(const double param);
742   ATTR_COLD inline void initial(const double val) { m_param = val; }
743   ATTR_HOT inline const double Value() const        { return m_param;   }
744744
745745protected:
746    ATTR_COLD virtual void save_register()
747    {
748        save(NAME(m_param));
749        netlist_param_t::save_register();
750    }
746   ATTR_COLD virtual void save_register()
747   {
748      save(NAME(m_param));
749      netlist_param_t::save_register();
750   }
751751
752752private:
753    double m_param;
753   double m_param;
754754};
755755
756756class netlist_param_int_t : public netlist_param_t
757757{
758    NETLIST_PREVENT_COPYING(netlist_param_int_t)
758   NETLIST_PREVENT_COPYING(netlist_param_int_t)
759759public:
760    ATTR_COLD netlist_param_int_t();
760   ATTR_COLD netlist_param_int_t();
761761
762    ATTR_HOT inline void setTo(const int param);
763    ATTR_COLD inline void initial(const int val) { m_param = val; }
762   ATTR_HOT inline void setTo(const int param);
763   ATTR_COLD inline void initial(const int val) { m_param = val; }
764764
765    ATTR_HOT inline const int Value() const     { return m_param;     }
765   ATTR_HOT inline const int Value() const     { return m_param;     }
766766
767767protected:
768    ATTR_COLD virtual void save_register()
769    {
770        save(NAME(m_param));
771        netlist_param_t::save_register();
772    }
768   ATTR_COLD virtual void save_register()
769   {
770      save(NAME(m_param));
771      netlist_param_t::save_register();
772   }
773773
774774private:
775    int m_param;
775   int m_param;
776776};
777777
778778class netlist_param_logic_t : public netlist_param_int_t
779779{
780    NETLIST_PREVENT_COPYING(netlist_param_logic_t)
780   NETLIST_PREVENT_COPYING(netlist_param_logic_t)
781781public:
782    ATTR_COLD netlist_param_logic_t();
782   ATTR_COLD netlist_param_logic_t();
783783};
784784
785785class netlist_param_str_t : public netlist_param_t
786786{
787    NETLIST_PREVENT_COPYING(netlist_param_str_t)
787   NETLIST_PREVENT_COPYING(netlist_param_str_t)
788788public:
789    ATTR_COLD netlist_param_str_t();
789   ATTR_COLD netlist_param_str_t();
790790
791    ATTR_HOT inline void setTo(const pstring &param);
792    ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
791   ATTR_HOT inline void setTo(const pstring &param);
792   ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
793793
794    ATTR_HOT inline const pstring &Value() const     { return m_param;     }
794   ATTR_HOT inline const pstring &Value() const     { return m_param;     }
795795
796796private:
797   pstring m_param;
797   pstring m_param;
798798};
799799
800800class netlist_param_model_t : public netlist_param_t
801801{
802    NETLIST_PREVENT_COPYING(netlist_param_model_t)
802   NETLIST_PREVENT_COPYING(netlist_param_model_t)
803803public:
804    ATTR_COLD netlist_param_model_t();
804   ATTR_COLD netlist_param_model_t();
805805
806    ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
806   ATTR_COLD inline void initial(const pstring &val) { m_param = val; }
807807
808    ATTR_HOT inline const pstring &Value() const     { return m_param;     }
808   ATTR_HOT inline const pstring &Value() const     { return m_param;     }
809809
810    /* these should be cached! */
811    ATTR_COLD double dValue(const pstring &entity, const double defval = 0.0) const;
810   /* these should be cached! */
811   ATTR_COLD double dValue(const pstring &entity, const double defval = 0.0) const;
812812
813813private:
814    pstring m_param;
814   pstring m_param;
815815};
816816
817817// ----------------------------------------------------------------------------------------
r26736r26737
820820
821821class netlist_core_device_t : public netlist_object_t
822822{
823    NETLIST_PREVENT_COPYING(netlist_core_device_t)
823   NETLIST_PREVENT_COPYING(netlist_core_device_t)
824824public:
825825
826    typedef netlist_list_t<netlist_core_device_t *> list_t;
826   typedef netlist_list_t<netlist_core_device_t *> list_t;
827827
828    ATTR_COLD netlist_core_device_t();
829    ATTR_COLD netlist_core_device_t(const family_t afamily);
828   ATTR_COLD netlist_core_device_t();
829   ATTR_COLD netlist_core_device_t(const family_t afamily);
830830
831    ATTR_COLD virtual ~netlist_core_device_t();
831   ATTR_COLD virtual ~netlist_core_device_t();
832832
833833   ATTR_COLD virtual void init(netlist_base_t &anetlist, const pstring &name);
834834
r26736r26737
848848#endif
849849   }
850850
851    ATTR_HOT const netlist_sig_t INPLOGIC_PASSIVE(netlist_logic_input_t &inp);
851   ATTR_HOT const netlist_sig_t INPLOGIC_PASSIVE(netlist_logic_input_t &inp);
852852
853853   ATTR_HOT inline const netlist_sig_t INPLOGIC(const netlist_logic_input_t &inp) const
854854   {
r26736r26737
885885   ATTR_HOT virtual void dec_active() {  }
886886
887887   ATTR_HOT virtual void step_time(const double st) { }
888    ATTR_HOT virtual void update_terminals() { }
888   ATTR_HOT virtual void update_terminals() { }
889889
890890#if (NL_KEEP_STATISTICS)
891    /* stats */
891   /* stats */
892892   osd_ticks_t total_time;
893893   INT32 stat_count;
894894#endif
r26736r26737
908908
909909class netlist_device_t : public netlist_core_device_t
910910{
911    NETLIST_PREVENT_COPYING(netlist_device_t)
911   NETLIST_PREVENT_COPYING(netlist_device_t)
912912public:
913913
914914   ATTR_COLD netlist_device_t();
915    ATTR_COLD netlist_device_t(const family_t afamily);
915   ATTR_COLD netlist_device_t(const family_t afamily);
916916
917917   ATTR_COLD virtual ~netlist_device_t();
918918
r26736r26737
921921   ATTR_COLD netlist_setup_t &setup();
922922
923923   ATTR_COLD void register_sub(netlist_device_t &dev, const pstring &name);
924    ATTR_COLD void register_subalias(const pstring &name, const netlist_core_terminal_t &term);
924   ATTR_COLD void register_subalias(const pstring &name, const netlist_core_terminal_t &term);
925925
926    ATTR_COLD void register_terminal(const pstring &name, netlist_terminal_t &port);
926   ATTR_COLD void register_terminal(const pstring &name, netlist_terminal_t &port);
927927
928928   ATTR_COLD void register_output(const pstring &name, netlist_output_t &out);
929929
r26736r26737
932932   ATTR_COLD void register_link_internal(netlist_input_t &in, netlist_output_t &out, const netlist_input_t::state_e aState);
933933   ATTR_COLD void register_link_internal(netlist_core_device_t &dev, netlist_input_t &in, netlist_output_t &out, const netlist_input_t::state_e aState);
934934
935    /* driving logic outputs don't count in here */
935   /* driving logic outputs don't count in here */
936936   netlist_list_t<pstring, 20> m_terminals;
937937
938938protected:
939939
940940   ATTR_HOT virtual void update() { }
941941   ATTR_HOT virtual void start() { }
942    ATTR_HOT virtual void update_terminals() { }
942   ATTR_HOT virtual void update_terminals() { }
943943
944    template <class C, class T>
944   template <class C, class T>
945945   ATTR_COLD void register_param(const pstring &sname, C &param, const T initialVal)
946946   {
947       register_param(*this, sname, param, initialVal);
947      register_param(*this, sname, param, initialVal);
948948   }
949949
950950   template <class C, class T>
951    ATTR_COLD void register_param(netlist_core_device_t &dev, const pstring &sname, C &param, const T initialVal);
951   ATTR_COLD void register_param(netlist_core_device_t &dev, const pstring &sname, C &param, const T initialVal);
952952
953953private:
954954};
r26736r26737
962962
963963class netlist_base_t : public netlist_object_t, public pstate_manager_t
964964{
965    NETLIST_PREVENT_COPYING(netlist_base_t)
965   NETLIST_PREVENT_COPYING(netlist_base_t)
966966public:
967967
968968   typedef netlist_timed_queue<netlist_net_t, netlist_time, 512> queue_t;
r26736r26737
970970   netlist_base_t();
971971   virtual ~netlist_base_t();
972972
973    ATTR_HOT inline const queue_t &queue() const { return m_queue; }
974    ATTR_HOT inline queue_t &queue() { return m_queue; }
973   ATTR_HOT inline const queue_t &queue() const { return m_queue; }
974   ATTR_HOT inline queue_t &queue() { return m_queue; }
975975
976976   ATTR_HOT inline void push_to_queue(netlist_net_t &out, const netlist_time &attime)
977977   {
r26736r26737
984984
985985   ATTR_HOT inline const netlist_time &time() const { return m_time_ps; }
986986
987    ATTR_COLD void set_mainclock_dev(NETLIB_NAME(mainclock) *dev);
988    ATTR_COLD void set_solver_dev(NETLIB_NAME(solver) *dev);
989    ATTR_COLD void set_setup(netlist_setup_t *asetup) { m_setup = asetup;  }
987   ATTR_COLD void set_mainclock_dev(NETLIB_NAME(mainclock) *dev);
988   ATTR_COLD void set_solver_dev(NETLIB_NAME(solver) *dev);
989   ATTR_COLD void set_setup(netlist_setup_t *asetup) { m_setup = asetup;  }
990990
991    ATTR_COLD netlist_net_t *find_net(const pstring &name);
991   ATTR_COLD netlist_net_t *find_net(const pstring &name);
992992
993    ATTR_COLD void set_clock_freq(UINT64 clockfreq);
993   ATTR_COLD void set_clock_freq(UINT64 clockfreq);
994994
995    ATTR_COLD netlist_setup_t &setup() { return *m_setup; }
995   ATTR_COLD netlist_setup_t &setup() { return *m_setup; }
996996   ATTR_COLD void reset();
997997
998998   ATTR_COLD void xfatalerror(const char *format, ...) const;
999999
1000    tagmap_devices_t m_devices;
1001    netlist_net_t::list_t m_nets;
1000   tagmap_devices_t m_devices;
1001   netlist_net_t::list_t m_nets;
10021002
10031003protected:
10041004
r26736r26737
10061006   virtual void vfatalerror(const char *format, va_list ap) const = 0;
10071007
10081008protected:
1009    ATTR_COLD virtual void save_register()
1010    {
1011        //queue_t                     m_queue;
1012        save(NAME(m_time_ps));
1013        save(NAME(m_rem));
1014        save(NAME(m_div));
1015        netlist_object_t::save_register();
1016    }
1009   ATTR_COLD virtual void save_register()
1010   {
1011      //queue_t                     m_queue;
1012      save(NAME(m_time_ps));
1013      save(NAME(m_rem));
1014      save(NAME(m_div));
1015      netlist_object_t::save_register();
1016   }
10171017
10181018#if (NL_KEEP_STATISTICS)
10191019   // performance
r26736r26737
10231023#endif
10241024
10251025private:
1026    ATTR_HOT void update_time(const netlist_time t, INT32 &atime);
1026   ATTR_HOT void update_time(const netlist_time t, INT32 &atime);
10271027
1028    netlist_time                m_time_ps;
1029    queue_t                     m_queue;
1028   netlist_time                m_time_ps;
1029   queue_t                     m_queue;
10301030   UINT32                      m_rem;
10311031   UINT32                      m_div;
10321032
10331033   NETLIB_NAME(mainclock) *    m_mainclock;
1034    NETLIB_NAME(solver) *       m_solver;
1034   NETLIB_NAME(solver) *       m_solver;
10351035
1036    netlist_setup_t *m_setup;
1036   netlist_setup_t *m_setup;
10371037};
10381038
10391039// ----------------------------------------------------------------------------------------
r26736r26737
10601060protected:
10611061   ATTR_COLD void start()
10621062   {
1063       register_input("I", m_I, netlist_terminal_t::STATE_INP_ACTIVE);
1064       register_output("Q", m_Q);
1063      register_input("I", m_I, netlist_terminal_t::STATE_INP_ACTIVE);
1064      register_output("Q", m_Q);
10651065      m_Q.initial(1);
10661066   }
10671067
r26736r26737
10721072      else if (m_I.Q_Analog() < m_I.m_low_thresh_V)
10731073         OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(1));
10741074      else
1075          OUTLOGIC(m_Q, m_Q.net().last_Q(), NLTIME_FROM_NS(1));
1075         OUTLOGIC(m_Q, m_Q.net().last_Q(), NLTIME_FROM_NS(1));
10761076   }
10771077
10781078};
r26736r26737
10841084class nld_d_to_a_proxy : public netlist_device_t
10851085{
10861086public:
1087    ATTR_COLD nld_d_to_a_proxy(netlist_output_t &out_proxied)
1087   ATTR_COLD nld_d_to_a_proxy(netlist_output_t &out_proxied)
10881088         : netlist_device_t()
10891089   {
10901090      //assert(out_proxied.object_type(SIGNAL_MASK) == SIGNAL_DIGITAL);
r26736r26737
10931093      m_high_V = out_proxied.m_high_V;
10941094   }
10951095
1096    ATTR_COLD virtual ~nld_d_to_a_proxy() {}
1096   ATTR_COLD virtual ~nld_d_to_a_proxy() {}
10971097
10981098   netlist_ttl_input_t m_I;
10991099   netlist_analog_output_t m_Q;
r26736r26737
11011101protected:
11021102   ATTR_COLD void start()
11031103   {
1104        register_input("I", m_I, netlist_terminal_t::STATE_INP_ACTIVE);
1105        register_output("Q", m_Q);
1104      register_input("I", m_I, netlist_terminal_t::STATE_INP_ACTIVE);
1105      register_output("Q", m_Q);
11061106      m_Q.initial(0);
11071107   }
11081108
r26736r26737
11221122
11231123ATTR_HOT inline void netlist_param_str_t::setTo(const pstring &param)
11241124{
1125    m_param = param;
1126    netdev().update_param();
1125   m_param = param;
1126   netdev().update_param();
11271127}
11281128
11291129ATTR_HOT inline void netlist_param_int_t::setTo(const int param)
11301130{
1131    m_param = param;
1132    netdev().update_param();
1131   m_param = param;
1132   netdev().update_param();
11331133}
11341134
11351135ATTR_HOT inline void netlist_param_double_t::setTo(const double param)
11361136{
1137    m_param = param;
1138    netdev().update_param();
1137   m_param = param;
1138   netdev().update_param();
11391139}
11401140
11411141
r26736r26737
11931193   m_active++;
11941194
11951195   if (USE_DEACTIVE_DEVICE)
1196        if (m_active == 1 && m_in_queue > 0)
1197        {
1198            m_last = m_cur;
1199            railterminal().netdev().inc_active();
1200            m_cur = m_new;
1201        }
1196      if (m_active == 1 && m_in_queue > 0)
1197      {
1198         m_last = m_cur;
1199         railterminal().netdev().inc_active();
1200         m_cur = m_new;
1201      }
12021202
12031203   if (EXPECTED(m_active == 1 && m_in_queue == 0))
12041204   {
r26736r26737
12191219{
12201220   m_active--;
12211221   if (USE_DEACTIVE_DEVICE)
1222       if (m_active == 0)
1223           railterminal().netdev().dec_active();
1222      if (m_active == 0)
1223         railterminal().netdev().dec_active();
12241224
12251225}
12261226
r26736r26737
12511251
12521252class net_device_t_base_factory
12531253{
1254    NETLIST_PREVENT_COPYING(net_device_t_base_factory)
1254   NETLIST_PREVENT_COPYING(net_device_t_base_factory)
12551255public:
12561256   net_device_t_base_factory(const pstring &name, const pstring &classname)
12571257   : m_name(name), m_classname(classname)
r26736r26737
12711271template <class C>
12721272class net_device_t_factory : public net_device_t_base_factory
12731273{
1274    NETLIST_PREVENT_COPYING(net_device_t_factory)
1274   NETLIST_PREVENT_COPYING(net_device_t_factory)
12751275public:
12761276   net_device_t_factory(const pstring &name, const pstring &classname)
12771277   : net_device_t_base_factory(name, classname) { }
r26736r26737
12881288{
12891289public:
12901290
1291    netlist_factory();
1292    ~netlist_factory();
1291   netlist_factory();
1292   ~netlist_factory();
12931293
1294    void initialize();
1294   void initialize();
12951295
1296    template<class _C>
1297    void register_device(const pstring &name, const pstring &classname)
1298    {
1299        m_list.add(new net_device_t_factory< _C >(name, classname) );
1300    }
1296   template<class _C>
1297   void register_device(const pstring &name, const pstring &classname)
1298   {
1299      m_list.add(new net_device_t_factory< _C >(name, classname) );
1300   }
13011301
1302    netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
1303    netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
1302   netlist_device_t *new_device_by_classname(const pstring &classname, netlist_setup_t &setup) const;
1303   netlist_device_t *new_device_by_name(const pstring &name, netlist_setup_t &setup) const;
13041304
13051305private:
1306    typedef netlist_list_t<net_device_t_base_factory *> list_t;
1307    list_t m_list;
1306   typedef netlist_list_t<net_device_t_base_factory *> list_t;
1307   list_t m_list;
13081308
13091309};
13101310
trunk/src/emu/netlist/nl_util.h
r26736r26737
1313{
1414// this is purely static
1515private:
16    nl_util() {};
16   nl_util() {};
1717
1818public:
19    typedef netlist_list_t<pstring, 10> pstring_list;
19   typedef netlist_list_t<pstring, 10> pstring_list;
2020
21    static pstring_list split(const pstring &str, const pstring &onstr)
22    {
23        pstring_list temp;
21   static pstring_list split(const pstring &str, const pstring &onstr)
22   {
23      pstring_list temp;
2424
25        int p = 0;
26        int pn;
25      int p = 0;
26      int pn;
2727
28        pn = str.find(onstr, p);
29        while (pn>=0)
30        {
31            temp.add(str.substr(p, pn - p));
32            p = pn + onstr.len();
33            pn = str.find(onstr, p);
34        }
35        if (p<str.len())
36            temp.add(str.substr(p));
37        return temp;
38    }
28      pn = str.find(onstr, p);
29      while (pn>=0)
30      {
31         temp.add(str.substr(p, pn - p));
32         p = pn + onstr.len();
33         pn = str.find(onstr, p);
34      }
35      if (p<str.len())
36         temp.add(str.substr(p));
37      return temp;
38   }
3939};
4040
4141#endif /* NL_UTIL_H_ */
trunk/src/emu/cpu/z8/z8.c
r26736r26737
163163***************************************************************************/
164164
165165static ADDRESS_MAP_START( program_2kb, AS_PROGRAM, 8, z8_device )
166    AM_RANGE(0x0000, 0x07ff) AM_ROM
166   AM_RANGE(0x0000, 0x07ff) AM_ROM
167167ADDRESS_MAP_END
168168
169169static ADDRESS_MAP_START( program_4kb, AS_PROGRAM, 8, z8_device )
170    AM_RANGE(0x0000, 0x0fff) AM_ROM
170   AM_RANGE(0x0000, 0x0fff) AM_ROM
171171ADDRESS_MAP_END
172172
173173
r26736r26737
846846
847847   }
848848}
849
trunk/src/emu/cpu/tms57002/tms57002.c
r26736r26737
682682   for(;;) {
683683      short ipc;
684684      UINT32 opcode = program->read_dword(adr << 2);
685     
685
686686      cs.inc = 0;
687687
688688      if((opcode & 0xfc0000) == 0xfc0000)
r26736r26737
743743         case 1:
744744            ++ca;
745745            goto inst;
746         
746
747747         case 2:
748748            ++id;
749749            goto inst;
750         
750
751751         case 3:
752752            ++ca, ++id;
753753            goto inst;
trunk/src/emu/cpu/t11/t11.c
r26736r26737
4141t11_device::t11_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
4242   : cpu_device(mconfig, T11, "T11", tag, owner, clock, "t11", __FILE__)
4343   , m_program_config("program", ENDIANNESS_LITTLE, 16, 16, 0)
44    , c_initial_mode(0)
44   , c_initial_mode(0)
4545{
4646   m_is_octal = true;
4747}
r26736r26737
379379   extern CPU_DISASSEMBLE( t11 );
380380   return CPU_DISASSEMBLE_NAME(t11)(this, buffer, pc, oprom, opram, options);
381381}
382
trunk/src/emu/cpu/8x300/8x300.c
r26736r26737
11/*
22 * 8x300.c
33 *
4 *   Implementation of the Scientific Micro Systems SMS300 / Signetics 8X300 CPU
4 *  Implementation of the Scientific Micro Systems SMS300 / Signetics 8X300 CPU
55 *  Created on: 18/12/2013
66 *
7 *   Written by Barry Rodewald
7 *  Written by Barry Rodewald
88 */
99
1010#include "debugger.h"
r26736r26737
5656   case 0x05: m_R5 = val; break;
5757   case 0x06: m_R6 = val; break;
5858   case 0x07: m_IVL = val; break;
59//   OVF is read-only
59//  OVF is read-only
6060   case 0x09: m_R11 = val; break;
6161   case 0x0f: m_IVR = val; break;
6262   default: logerror("8X300: Invalid register %02x written to.\n",reg); break;
r26736r26737
7474   case 0x04: return m_R4;
7575   case 0x05: return m_R5;
7676   case 0x06: return m_R6;
77//   IVL is write-only
77//  IVL is write-only
7878   case 0x08: return m_OVF;
7979   case 0x09: return m_R11;
80//   IVR is write-only
80//  IVR is write-only
8181   default: logerror("8X300: Invalid register %02x read.\n",reg); return 0;
8282   }
8383   return 0;
r26736r26737
142142{
143143   switch (entry.index())
144144   {
145//      case STATE_GENFLAGS:
146//         string.printf("%c%c%c%c%c%c",
147//         break;
145//      case STATE_GENFLAGS:
146//          string.printf("%c%c%c%c%c%c",
147//          break;
148148   }
149149}
150150
r26736r26737
550550   extern CPU_DISASSEMBLE( n8x300 );
551551   return CPU_DISASSEMBLE_NAME(n8x300)(this, buffer, pc, oprom, opram, options);
552552}
553
trunk/src/emu/cpu/8x300/8x300.h
r26736r26737
11/*
22 * 8x300.h
33 *
4 *   Implementation of the Scientific Micro Systems SMS300 / Signetics 8X300 Microcontroller
4 *  Implementation of the Scientific Micro Systems SMS300 / Signetics 8X300 Microcontroller
55 *  Created on: 18/12/2013
66 */
77
trunk/src/emu/cpu/8x300/8x300dasm.c
r26736r26737
11/*
22 * 8x300dasm.c
3 *   Implementation of the Scientific Micro Systems SMS300 / Signetics 8X300 Microcontroller
3 *  Implementation of the Scientific Micro Systems SMS300 / Signetics 8X300 Microcontroller
44 *
55 *  Created on: 18/12/2013
66 */
trunk/src/emu/cpu/cpu.mak
r26736r26737
7777DASMOBJS += $(CPUOBJ)/8x300/8x300dasm.o
7878endif
7979
80$(CPUOBJ)/8x300/8x300.o:   $(CPUSRC)/8x300/8x300.c \
80$(CPUOBJ)/8x300/8x300.o:    $(CPUSRC)/8x300/8x300.c \
8181                     $(CPUSRC)/8x300/8x300.h
8282
8383#-------------------------------------------------
trunk/src/emu/video/v9938.c
r26736r26737
14251425      for (x=0;x<64;x++)
14261426      {
14271427         int colour[4];
1428             int ind;
1428         int ind;
14291429
14301430         colour[0] = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
14311431         nametbl_addr++;
r26736r26737
14351435         nametbl_addr++;
14361436         colour[3] = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
14371437
1438            ind = (colour[0] & 7) << 11 | (colour[1] & 7) << 14 |
1439          (colour[2] & 7) << 5 | (colour[3] & 7) << 8;
1438         ind = (colour[0] & 7) << 11 | (colour[1] & 7) << 14 |
1439         (colour[2] & 7) << 5 | (colour[3] & 7) << 8;
14401440
14411441         *ln++ = s_pal_indYJK[ind | ((colour[0] >> 3) & 31)];
14421442         if (_Width > 512)
r26736r26737
14651465      for (x=0;x<64;x++)
14661466      {
14671467         int colour[4];
1468             int ind;
1468         int ind;
14691469
14701470         colour[0] = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
14711471         nametbl_addr++;
r26736r26737
14751475         nametbl_addr++;
14761476         colour[3] = m_vram_space->read_byte(((nametbl_addr&1) << 16) | (nametbl_addr>>1));
14771477
1478            ind = (colour[0] & 7) << 11 | (colour[1] & 7) << 14 |
1479          (colour[2] & 7) << 5 | (colour[3] & 7) << 8;
1478         ind = (colour[0] & 7) << 11 | (colour[1] & 7) << 14 |
1479         (colour[2] & 7) << 5 | (colour[3] & 7) << 8;
14801480
14811481         *ln++ = colour[0] & 8 ? m_pal_ind16[colour[0] >> 4] : s_pal_indYJK[ind | ((colour[0] >> 3) & 30)];
14821482         if (_Width > 512)
trunk/src/emu/video/mb_vcu.c
r26736r26737
278278   UINT8 pen = 0;
279279   UINT8 cur_layer;
280280
281//   cur_layer = (m_mode & 0x3);
281//  cur_layer = (m_mode & 0x3);
282282   cur_layer = 0;
283283
284284   switch(m_mode >> 2)
trunk/src/emu/video/fixfreq.c
r26736r26737
114114   //m_vblank_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vga_device::vblank_timer_cb),this));
115115   recompute_parameters(false);
116116
117    save_item(NAME(m_vid));
118    save_item(NAME(m_last_x));
119    save_item(NAME(m_last_y));
120    save_item(NAME(m_last_time));
121    save_item(NAME(m_line_time));
122    save_item(NAME(m_last_hsync_time));
123    save_item(NAME(m_last_vsync_time));
124    save_item(NAME(m_refresh));
125    save_item(NAME(m_clock_period));
126    //save_item(NAME(m_bitmap[0]));
127    //save_item(NAME(m_bitmap[1]));
128    save_item(NAME(m_cur_bm));
117   save_item(NAME(m_vid));
118   save_item(NAME(m_last_x));
119   save_item(NAME(m_last_y));
120   save_item(NAME(m_last_time));
121   save_item(NAME(m_line_time));
122   save_item(NAME(m_last_hsync_time));
123   save_item(NAME(m_last_vsync_time));
124   save_item(NAME(m_refresh));
125   save_item(NAME(m_clock_period));
126   //save_item(NAME(m_bitmap[0]));
127   //save_item(NAME(m_bitmap[1]));
128   save_item(NAME(m_cur_bm));
129129
130    /* sync separator */
131    save_item(NAME(m_vint));
132    save_item(NAME(m_int_trig));
133    save_item(NAME(m_mult));
130   /* sync separator */
131   save_item(NAME(m_vint));
132   save_item(NAME(m_int_trig));
133   save_item(NAME(m_mult));
134134
135    save_item(NAME(m_sig_vsync));
136    save_item(NAME(m_sig_composite));
137    save_item(NAME(m_sig_field));
135   save_item(NAME(m_sig_vsync));
136   save_item(NAME(m_sig_composite));
137   save_item(NAME(m_sig_field));
138138
139139
140140
r26736r26737
210210   int ret = 0;
211211
212212   m_vint += ((double) last_comp - m_vint) * (1.0 - exp(-time.as_double() * m_mult));
213    m_sig_composite = (newval < m_sync_threshold) ? 1 : 0 ;
213   m_sig_composite = (newval < m_sync_threshold) ? 1 : 0 ;
214214
215215   m_sig_vsync = (m_vint > m_int_trig) ? 1 : 0;
216216
trunk/src/emu/diserial.h
r26736r26737
3737   {
3838      CTS = 0x0001, /* Clear to Send.       (INPUT)  Other end of connection is ready to accept data */
3939      RTS = 0x0002, /* Request to Send.     (OUTPUT) This end is ready to send data, and requests if the other */
40                    /*                               end is ready to accept it */
40                  /*                               end is ready to accept it */
4141      DSR = 0x0004, /* Data Set ready.      (INPUT)  Other end of connection has data */
4242      DTR = 0x0008, /* Data terminal Ready. (OUTPUT) TX contains new data. */
4343      RX  = 0x0010, /* Recieve data.        (INPUT)  */
r26736r26737
159159
160160
161161class serial_source_device :  public device_t,
162                       public device_serial_interface
162                        public device_serial_interface
163163{
164164public:
165165   // construction/destruction
trunk/src/lib/formats/abc800_dsk.c
r26736r26737
7979      2000, 16, 40, 1, 256, {}, 1, {}, 55, 22, 54
8080   },
8181
82   // track description
82   // track description
8383   // 55x4e 12x00 3xf5 fe 2x00 01 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
8484   // 54x4e 12x00 3xf5 fe 2x00 02 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
8585   // 54x4e 12x00 3xf5 fe 2x00 03 01 f7 22x4e 12x00 3xf5 fb 256xe5 f7
trunk/src/lib/formats/adam_dsk.c
r26736r26737
4545      floppy_image::FF_525, floppy_image::SSDD, floppy_image::MFM,
4646      2000,  8, 40, 1, 512, {}, 1, {}, 100, 22, 100
4747   },
48   
48
4949   // Unverified gap sizes -->
5050   {   /*  320K 5 1/4 inch double density */
5151      floppy_image::FF_525, floppy_image::DSDD, floppy_image::MFM,
trunk/src/lib/formats/itt3030_dsk.c
r26736r26737
66
77    ITT3030 560K disk image format
88
9 
109
10
1111*********************************************************************/
1212
1313#include "emu.h"
r26736r26737
4444
4545
4646const floppy_format_type FLOPPY_ITT3030_FORMAT = &floppy_image_format_creator<itt3030_format>;
47
trunk/src/version.c
r26736r26737
99***************************************************************************/
1010
1111extern const char build_version[];
12const char build_version[] = "0.151 ("__DATE__")";
12const char build_version[] = "0.152 ("__DATE__")";
trunk/src/mess/machine/dec_lk201.c
r26736r26737
66*/
77
88/* LK201-AA keyboard matrix (8048 version with updates)
9   Source: VCB02 Technical Reference.
9   Source: VCB02 Technical Reference.
1010
11   KBD controller scan matrix (PORT 1): 8 x BCD IN => 18 DECIMAL OUT
11   KBD controller scan matrix (PORT 1): 8 x BCD IN => 18 DECIMAL OUT
1212
1313   Keyboard itself:
14   18 x IN (KEYBOARD DRIVE) KBD 17... KBD 0 =>
15   8 OUT (keyboard data @ D7..D0)
16   
14   18 x IN (KEYBOARD DRIVE) KBD 17... KBD 0 =>
15   8 OUT (keyboard data @ D7..D0)
16
1717   to => PORT 0 @ KBD controller.
1818
1919________|D7  |D6  |D5  |D4 |D3 |D2 |D1 |D0
r26736r26737
3434--------|----|----|----|---|---|---|---|---
3535..KBD13:|Ins.|--- |'Do'|Prev { |"  |[R]|[R]
3636........|Here|-   |    Scrn| [ |'  |   |
37........|E17 |E11 |G16 |D17|D11|C11|   |           
37........|E17 |E11 |G16 |D17|D11|C11|   |
3838--------|----|----|----|---|---|---|---|---
3939..KBD12:|Find|+   |Help|Se-| } |Re-|C:L| |
4040........|    |=   |    |lect ] |turn...| \
r26736r26737
4545........|G14 | E13|....|E10|D10|...|C10|B10
4646--------|----|----|----|---|---|---|---|---
4747..KBD10:|[R] |F12 |[R] |F13| ( |O  |L  | .
48........|....|(BS)|    |(LF) 9 |   |   | .
48........|....|(BS)|    |(LF) 9 |   |   | .
4949........|....|G12 |....|G13|E09|D09|C09|B09
5050--------|----|----|----|---|---|---|---|---
5151..KBD_9:|[R] |F11 |[R] |[R]|*  |I  |K  | ,
5252........|....|ESC |    |   |8  |   |   | ,
5353........|....|G11 |....|...|E08|D08|C08|B08
5454--------|----|----|----|---|---|---|---|---
55..KBD_8:|[R] |Main|[R] Exit|&  |U  |J  |M 
55..KBD_8:|[R] |Main|[R] Exit|&  |U  |J  |M
5656........|    |Scrn|    |   |7  |   |   |
5757........|    |G08 |    |G09|E07|D07|C07|B07
5858--------|----|----|----|---|---|---|---|---
r26736r26737
6565........|....|....|....|G05|E05|D05|C05|B05
6666--------|----|----|----|---|---|---|---|---
6767..KBD_5: F4  |Break [R]|$  |R  |F  |V  |Space
68........|....|....|....|4  |   |   |   |         
68........|....|....|....|4  |   |   |   |
6969........ G02 |G03 |....|E04 D04 C04 B04 A01-A09
7070--------|----|----|----|---|---|---|---|---
7171..KBD_4: [R] |Prt.|[R] |Set|#  |E  |D  |C
r26736r26737
7777........|G99 |E02 |....|D00|D02|C02|B02|B00
7878--------|----|----|----|---|---|---|---|---
7979..KBD_2: [R] |[R] |[R] |~  |!  |Q  |A  |Z
80........|..............|...|1 
80........|..............|...|1
8181........|..............|E00 E01 D01 C01 B01
8282--------|----|----|----|---|---|---|---|---
8383..KBD_1: Ctrl|Lock|Comp|[R]
r26736r26737
9393  Normally only the N0 keyswitch is implemented as a double-sized key.
9494  NOTE 3) Return key occupies 2 positions that are
9595  decoded as the Return (C13) key.
96 
96
9797  C:D - Cursor down (B17)
9898  C:U - Cursor up (C17)
9999  C:R - Cursor right (B18)
100100  C:L - Cursor left (B16)
101101 */
102
102
103103#include "emu.h"
104104#include "dec_lk201.h"
105105#include "cpu/m6805/m6805.h"
trunk/src/mess/machine/kb_poisk1.h
r26736r26737
1818   PORT_BIT( 0x020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r')
1919   PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 8") PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_UP)
2020   PORT_BIT( 0x080, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 2") PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_DOWN)
21/*-12*/   PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-12 - ?") /* PORT_CODE(KEYCODE_SLASH) PORT_CHAR('?') PORT_CHAR('/') */
21/*-12*/ PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-12 - ?") /* PORT_CODE(KEYCODE_SLASH) PORT_CHAR('?') PORT_CHAR('/') */
2222   PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
23/*-11*/   PORT_BIT( 0x400, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-11 - %") /* PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') */
23/*-11*/ PORT_BIT( 0x400, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-11 - %") /* PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') */
2424   PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11))
2525
2626   PORT_START("Y2")
27/*-15*/   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-15 - !") /* PORT_CODE(KEYCODE_1) PORT_CHAR('!') PORT_CHAR('1') */
27/*-15*/ PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-15 - !") /* PORT_CODE(KEYCODE_1) PORT_CHAR('!') PORT_CHAR('1') */
2828   PORT_BIT( 0x002, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 4") PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_LEFT)
2929   PORT_BIT( 0x004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 0") PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_INSERT) /* ??? */
3030   PORT_BIT( 0x008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7))
31/*-13*/   PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-13 - ;") /* PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') */
31/*-13*/ PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-13 - ;") /* PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') */
3232   PORT_BIT( 0x020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_BACKSPACE)
3333   PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 7") PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_HOME)
3434   PORT_BIT( 0x080, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 1") PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_END)
35/*-2*/   PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-2 - .") /* PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') */
36/*-3*/   PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-3 - _") /* PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') */
35/*-2*/  PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-2 - .") /* PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') */
36/*-3*/  PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-3 - _") /* PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') */
3737   PORT_BIT( 0x400, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
3838   PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') // 0x54
3939
r26736r26737
5858   PORT_BIT( 0x008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6))
5959   PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))
6060   PORT_BIT( 0x020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1))
61/*-1*/   PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-1 - *") /* PORT_CODE(KEYCODE_8) PORT_CHAR('*') PORT_CHAR('8') */
61/*-1*/  PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-1 - *") /* PORT_CODE(KEYCODE_8) PORT_CHAR('*') PORT_CHAR('8') */
6262   PORT_BIT( 0x080, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Esc") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) /* ??2 */
63/*-9*/   PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-9 - :") /* PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') */
64/*-10*/   PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-10 - ,") /* PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') */
63/*-9*/  PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-9 - :") /* PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') */
64/*-10*/ PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-10 - ,") /* PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') */
6565   PORT_BIT( 0x400, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5))
6666   PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))
6767
6868   PORT_START("Y5")
6969   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
7070   PORT_BIT( 0x002, IP_ACTIVE_LOW, IPT_UNUSED )
71/*?*/   PORT_BIT( 0x004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
71/*?*/   PORT_BIT( 0x004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL))
7272   PORT_BIT( 0x008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
7373   PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
7474   PORT_BIT( 0x020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
r26736r26737
8282   PORT_START("Y6")
8383   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
8484   PORT_BIT( 0x002, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad *") PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK))
85/*?*/   PORT_BIT( 0x004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Alt") PORT_CODE(KEYCODE_RALT)
85/*?*/   PORT_BIT( 0x004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Alt") PORT_CODE(KEYCODE_RALT)
8686   PORT_BIT( 0x008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
8787   PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
8888   PORT_BIT( 0x020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?dc?") // 0xdc = SHIFT2
r26736r26737
108108   PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9))
109109
110110   PORT_START("Y8")
111/*-6*/   PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-6 - -") /* PORT_CODE(KEYCODE_MINUS)     PORT_CHAR('-') PORT_CHAR('_') */
111/*-6*/  PORT_BIT( 0x001, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-6 - -") /* PORT_CODE(KEYCODE_MINUS)     PORT_CHAR('-') PORT_CHAR('_') */
112112   PORT_BIT( 0x002, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad -") PORT_CODE(KEYCODE_MINUS_PAD)
113113   PORT_BIT( 0x004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t')  /* ??? */
114114   PORT_BIT( 0x008, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
115/*-7*/   PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-7 - )") /* PORT_CODE(KEYCODE_0) PORT_CHAR(')') PORT_CHAR('0') */
115/*-7*/  PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-7 - )") /* PORT_CODE(KEYCODE_0) PORT_CHAR(')') PORT_CHAR('0') */
116116   PORT_BIT( 0x020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Scroll Lock")
117/*-4*/   PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-4 - (") /* PORT_CODE(KEYCODE_9) PORT_CHAR('(') PORT_CHAR('9') */
117/*-4*/  PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-4 - (") /* PORT_CODE(KEYCODE_9) PORT_CHAR('(') PORT_CHAR('9') */
118118   PORT_BIT( 0x080, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
119119   PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_UNUSED )
120120   PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
121/*-5*/   PORT_BIT( 0x400, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-5 - \"") /* PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('"') PORT_CHAR('\'') */
122/*-8*/   PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-8 - /") /* PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') */
121/*-5*/  PORT_BIT( 0x400, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-5 - \"") /* PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('"') PORT_CHAR('\'') */
122/*-8*/  PORT_BIT( 0x800, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("?-8 - /") /* PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') */
123123
124124#if 0
125125   PORT_BIT( 0x004, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Delete") PORT_CODE(KEYCODE_DEL_PAD)
r26736r26737
130130   PORT_BIT( 0x000, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^')
131131   PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
132132   PORT_BIT( 0x000, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~')
133   PORT_BIT( 0x000, IP_ACTIVE_LOW, IPT_KEYBOARD )
133   PORT_BIT( 0x000, IP_ACTIVE_LOW, IPT_KEYBOARD )
134134#endif
135135
136136INPUT_PORTS_END
r26736r26737
227227   PORT_BIT( 0x008, IP_ACTIVE_LOW, IPT_UNUSED )
228228   PORT_BIT( 0x010, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("- / UKRAINIAN XXX") PORT_CODE(KEYCODE_MINUS_PAD)
229229   PORT_BIT( 0x020, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9))
230   PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Scroll Lock")
230   PORT_BIT( 0x040, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Scroll Lock")
231231   PORT_BIT( 0x080, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad 6") PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_RIGHT)
232232   PORT_BIT( 0x100, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
233233   PORT_BIT( 0x200, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7))
trunk/src/mess/machine/p1_fdc.c
r26736r26737
134134
135135   if(!BIT(data, 6))
136136      m_fdc->reset();
137   
137
138138   m_fdc->set_floppy(floppy);
139139
140140   floppy->ss_w(BIT(data, 4));
r26736r26737
196196{
197197   set_isa_device();
198198   m_isa->install_rom(this, 0xe0000, 0xe07ff, 0, 0, "XXX", "p1_fdc");
199   m_isa->install_device(0x00c0, 0x00c3, 0, 0,
199   m_isa->install_device(0x00c0, 0x00c3, 0, 0,
200200      READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read),
201201      WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) );
202202   m_isa->install_device(this, 0x00c4, 0x00c7, 0, 0, FUNC(p1_FDC_r), FUNC(p1_FDC_w) );
trunk/src/mess/machine/mc1502_fdc.c
r26736r26737
212212   set_isa_device();
213213
214214   // BIOS 5.0, 5.2
215   m_isa->install_device(0x010c, 0x010f, 0, 0,
215   m_isa->install_device(0x010c, 0x010f, 0, 0,
216216      READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read),
217217      WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) );
218218   m_isa->install_device(this, 0x0100, 0x010b, 0, 0, FUNC(mc1502_FDC_r), FUNC(mc1502_FDC_w) );
219219   // BIOS 5.31, 5.33
220220/*
221   m_isa->install_device(0x010c, 0x010f, 0, 0,
222      READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read),
223      WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) );
224   m_isa->install_device(this, 0x0100, 0x010b, 0, 0, FUNC(mc1502_FDC_r), FUNC(mc1502_FDC_w) );
221    m_isa->install_device(0x010c, 0x010f, 0, 0,
222        READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read),
223        WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) );
224    m_isa->install_device(this, 0x0100, 0x010b, 0, 0, FUNC(mc1502_FDC_r), FUNC(mc1502_FDC_w) );
225225*/
226226   m_fdc->setup_drq_cb(fd1793_t::line_cb(FUNC(mc1502_fdc_device::mc1502_fdc_irq_drq), this));
227227   m_fdc->setup_intrq_cb(fd1793_t::line_cb(FUNC(mc1502_fdc_device::mc1502_fdc_irq_drq), this));
trunk/src/mess/machine/prof80mmu.c
r26736r26737
103103   {
104104      offset |= 0xf0000;
105105   }
106   
106
107107   return this->space(AS_PROGRAM).read_byte(offset);
108108}
109109
r26736r26737
123123   {
124124      offset |= 0xf0000;
125125   }
126   
126
127127   this->space(AS_PROGRAM).write_byte(offset, data);
128128}
trunk/src/mess/machine/prof80mmu.h
r26736r26737
3333// ======================> prof80_mmu_device
3434
3535class prof80_mmu_device : public device_t,
36                    public device_memory_interface
36                     public device_memory_interface
3737{
3838public:
3939   prof80_mmu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
trunk/src/mess/machine/p1_hdc.c
r26736r26737
2828      } \
2929   } while (0)
3030
31#define KM1809VG7_TAG   "d17"
31#define KM1809VG7_TAG   "d17"
3232
3333
3434//**************************************************************************
r26736r26737
109109   UINT8 data = 0x00;
110110
111111   switch (offset >> 8) {
112      case 8:      data = m_hdc->read(space, offset & 255);
112      case 8:     data = m_hdc->read(space, offset & 255);
113113   }
114114   DBG_LOG(1,"hdc",("R $%04x == $%02x\n", offset, data));
115115
r26736r26737
120120{
121121   DBG_LOG(1,"hdc",("W $%04x <- $%02x\n", offset, data));
122122   switch (offset >> 8) {
123      case 8:      m_hdc->write(space, offset & 255, data, 0);
123      case 8:     m_hdc->write(space, offset & 255, data, 0);
124124   }
125125}
126126
r26736r26737
144144{
145145   set_isa_device();
146146   m_isa->install_rom(this, 0xe2000, 0xe27ff, 0, 0, "XXX", "p1_hdc");
147   m_isa->install_memory(0xd0000, 0xd0fff, 0, 0,
147   m_isa->install_memory(0xd0000, 0xd0fff, 0, 0,
148148      READ8_DELEGATE(p1_hdc_device, p1_HDC_r),
149149      WRITE8_DELEGATE(p1_hdc_device, p1_HDC_w) );
150150}
trunk/src/mess/machine/xsu_cards.c
r26736r26737
1111
1212SLOT_INTERFACE_START( p1_isa8_cards )
1313   SLOT_INTERFACE("rom", P1_ROM)
14   SLOT_INTERFACE("fdc", P1_FDC)      // B504
15   SLOT_INTERFACE("hdc", P1_HDC)      // B942
14   SLOT_INTERFACE("fdc", P1_FDC)       // B504
15   SLOT_INTERFACE("hdc", P1_HDC)       // B942
1616/*
17   SLOT_INTERFACE("comlpt", P1_COMLPT)   // B620
18   SLOT_INTERFACE("joy", P1_JOY)      // B621
19   SLOT_INTERFACE("mouse", P1_MOUSE)   // B943
20   SLOT_INTERFACE("lan", P1_LAN)      // B944
17    SLOT_INTERFACE("comlpt", P1_COMLPT) // B620
18    SLOT_INTERFACE("joy", P1_JOY)       // B621
19    SLOT_INTERFACE("mouse", P1_MOUSE)   // B943
20    SLOT_INTERFACE("lan", P1_LAN)       // B944
2121*/
2222   SLOT_INTERFACE("pccom", ISA8_COM)
2323   SLOT_INTERFACE("pclpt", ISA8_LPT)
r26736r26737
2828   SLOT_INTERFACE("rom", MC1502_ROM)
2929   SLOT_INTERFACE("fdc", MC1502_FDC)
3030/*
31   SLOT_INTERFACE("hdc", MC1502_HDC)
31    SLOT_INTERFACE("hdc", MC1502_HDC)
3232*/
3333   SLOT_INTERFACE("pccom", ISA8_COM)
3434   SLOT_INTERFACE("pclpt", ISA8_LPT)
trunk/src/mess/machine/nes_mmc5.c
r26736r26737
4141
4242
4343nes_exrom_device::nes_exrom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
44               : nes_nrom_device(mconfig, NES_EXROM, "NES Cart ExROM (MMC-5) PCB", tag, owner, clock, "nes_exrom", __FILE__)               
44               : nes_nrom_device(mconfig, NES_EXROM, "NES Cart ExROM (MMC-5) PCB", tag, owner, clock, "nes_exrom", __FILE__)
4545{
4646}
4747
trunk/src/mess/machine/mb8795.c
r26736r26737
1818
1919mb8795_device::mb8795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2020   : device_t(mconfig, MB8795, "Fujitsu MB8795", tag, owner, clock, "mb8795", __FILE__),
21     device_network_interface(mconfig, *this, 10)
21      device_network_interface(mconfig, *this, 10)
2222{
2323}
2424
r26736r26737
205205
206206   if(eof) {
207207      logerror("%s: send packet, dest=%02x.%02x.%02x.%02x.%02x.%02x len=%04x loopback=%s\n", tag(),
208             txbuf[0], txbuf[1], txbuf[2], txbuf[3], txbuf[4], txbuf[5],
209             txlen,
210             txmode & EN_TMD_LB_DISABLE ? "off" : "on");
208               txbuf[0], txbuf[1], txbuf[2], txbuf[3], txbuf[4], txbuf[5],
209               txlen,
210               txmode & EN_TMD_LB_DISABLE ? "off" : "on");
211211
212212      if(txlen > 1500)
213213         txlen = 1500; // Weird packet send on loopback test in the next
trunk/src/mess/includes/mc1502.h
r26736r26737
7777   DECLARE_WRITE8_MEMBER(mc1502_kppi_portb_w);
7878   DECLARE_WRITE8_MEMBER(mc1502_kppi_portc_w);
7979/*
80   TIMER_CALLBACK_MEMBER(fdc_motor_callback);
81   static struct {
82      int         fdc_motor_on;
83      emu_timer   *fdc_motor_timer;
84   } m_motor;
80    TIMER_CALLBACK_MEMBER(fdc_motor_callback);
81    static struct {
82        int         fdc_motor_on;
83        emu_timer   *fdc_motor_timer;
84    } m_motor;
8585*/
8686   const char *m_cputag;
8787};
trunk/src/mess/includes/prof80.h
r26736r26737
1717#include "machine/upd765.h"
1818
1919#define Z80_TAG         "z1"
20#define MMU_TAG         "mmu"
20#define MMU_TAG         "mmu"
2121#define UPD765_TAG      "z38"
2222#define UPD1990A_TAG    "z43"
2323#define RS232_A_TAG     "rs232a"
trunk/src/mess/includes/poisk1.h
r26736r26737
1616#include "machine/xsu_cards.h"
1717#include "sound/speaker.h"
1818
19#define POISK1_UPDATE_ROW(name)   \
19#define POISK1_UPDATE_ROW(name) \
2020   void name(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT8 *videoram, UINT16 ma, UINT8 ra, UINT8 stride)
2121
2222class p1_state : public driver_device
r26736r26737
4949   DECLARE_MACHINE_RESET(poisk1);
5050
5151   IRQ_CALLBACK_MEMBER(p1_irq_callback);
52   
52
5353   virtual void palette_init();
5454   virtual void video_start();
5555   UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
trunk/src/mess/video/isa_cga.c
r26736r26737
21512151WRITE8_MEMBER( isa8_ec1841_0002_device::char_ram_write )
21522152{
21532153   offset ^= BIT(offset, 12);
2154//   logerror("write char ram %04x %02x\n",offset,data);
2154//  logerror("write char ram %04x %02x\n",offset,data);
21552155   m_chr_gen_base[offset + 0x0000] = data;
21562156   m_chr_gen_base[offset + 0x0800] = data;
21572157   m_chr_gen_base[offset + 0x1000] = data;
trunk/src/mess/video/isa_cga.h
r26736r26737
1818      public device_isa8_card_interface
1919{
2020   friend class isa8_cga_superimpose_device;
21//   friend class isa8_ec1841_0002_device;
21//  friend class isa8_ec1841_0002_device;
2222   friend class isa8_cga_poisk2_device;
2323   friend class isa8_cga_pc1512_device;
2424
trunk/src/mess/video/vtvideo.c
r26736r26737
1212                          Split & full screen modes exist. Scroll should be synced with beam or DMA.
1313                          See 4.7.4 and up in VT manual.
1414
15   - TESTS REQUIRED : do line and character attributes (plus combinations) match real hardware? 
15    - TESTS REQUIRED : do line and character attributes (plus combinations) match real hardware?
1616
17   - UNDOCUMENTED FEATURES of DC011 / DC012 (CLUES WANTED)
18       A. (VT 100): DEC VT terminals are said to have a feature that doubles the number of lines
19               (50 real lines or just interlaced mode with 500 instead of 250 scanlines?)
17    - UNDOCUMENTED FEATURES of DC011 / DC012 (CLUES WANTED)
18       A. (VT 100): DEC VT terminals are said to have a feature that doubles the number of lines
19                    (50 real lines or just interlaced mode with 500 instead of 250 scanlines?)
2020
21      B. (DEC-100-B) fun PD program SQUEEZE.COM _compresses_ display to X/2 and Y/2
22          - so picture takes a quarter of the original screen. How does it accomplish this?                       
21       B. (DEC-100-B) fun PD program SQUEEZE.COM _compresses_ display to X/2 and Y/2
22          - so picture takes a quarter of the original screen. How does it accomplish this?
2323
2424    - IMPROVEMENTS:
2525        - exact colors for different VR201 monitors ('paper white', green and amber)
r26736r26737
201201// Also used by Rainbow-100 ************
202202WRITE8_MEMBER( vt100_video_device::dc012_w )
203203{
204      // TODO: writes to 10C/0C should be treated differently (emulation disables the watchdog too often).
204   // TODO: writes to 10C/0C should be treated differently (emulation disables the watchdog too often).
205205   if (data == 0) // MHFU is disabled by writing 00 to port 010C.
206   {   
206   {
207207            //if (MHFU_FLAG == true)
208            //   printf("MHFU  *** DISABLED *** \n");
208            //  printf("MHFU  *** DISABLED *** \n");
209209            MHFU_FLAG = false;
210210            MHFU_counter = 0;
211211   }
212   else
213   {           // RESET
214             //if (MHFU_FLAG == false)
215            //   printf("MHFU  ___ENABLED___ \n");
212   else
213   {           // RESET
214            //if (MHFU_FLAG == false)
215            //  printf("MHFU  ___ENABLED___ \n");
216216            MHFU_FLAG = true;
217217
218218            MHFU_counter = 0;
r26736r26737
224224      // The BIOS first writes the least significant bits, then the 2 most significant bits.
225225
226226      // If scrolling up (incrementing the scroll latch), the additional line is linked in at the bottom.
227      // When the scroll latch is incremented back to 0, the top line of the scrolling region must be unlinked.
227      // When the scroll latch is incremented back to 0, the top line of the scrolling region must be unlinked.
228228
229229      // When scrolling down (decrementing the scroll latch), new lines must be linked in at the top of the scroll region
230      // and unlinked down at the bottom.
230      // and unlinked down at the bottom.
231231
232232      // Note that the scroll latch value will be used during the next frame rather than the current frame.
233233      // All line linking/unlinking is done during the vertical blanking interval (< 550ms).
r26736r26737
267267            m_reverse_field = 0;
268268            break;
269269
270         //   Writing a 11XX bit combination clears the blink-flip flop (valid for 0x0C - 0x0F):
270         //  Writing a 11XX bit combination clears the blink-flip flop (valid for 0x0C - 0x0F):
271271         case 0x0c:
272272            // set basic attribute to underline / blink flip-flop off
273273            m_blink_flip_flop = 0;
r26736r26737
290290
291291         case 0x0e:
292292            m_blink_flip_flop = 0;  // 'unsupported' DC012 command. Turn blink flip-flop off.
293            break;                 
293            break;
294294
295         case 0x0f:
296            // (DEC Rainbow 100): reverse video with 48 lines / blink flip-flop off
295         case 0x0f:
296            // (DEC Rainbow 100): reverse video with 48 lines / blink flip-flop off
297297            m_blink_flip_flop = 0;
298298            m_basic_attribute = 1;
299299
300            // 0x0f = 'reserved' on VT 100
300            // 0x0f = 'reserved' on VT 100
301301            //  Abort on VT-100 for now.
302            if (m_height_MAX == 25) break;
302            if (m_height_MAX == 25) break;
303303
304304            if (m_height != 48)
305305            {
r26736r26737
485485//  2) bold and reverse together give a background of normal intensity
486486
487487//  3) blink controls intensity: normal chars vary between A) normal and dim  (B) bold chars vary between bright and normal
488//  4) blink applied to a
488//  4) blink applied to a
489489//       A) reverse character causes it to alternate between normal and reverse video representation
490490//       B) non-rev. "        : alternate between usual intensity and the next lower intensity
491//  5) underline causes the 9.th scan to be forced to
491//  5) underline causes the 9.th scan to be forced to
492492//       A) white of the same intensity as the characters (for nonreversed characters),
493493//       b) to black (for reverse characters)
494494
r26736r26737
499499   UINT16 x_preset, d_x_preset;
500500   if (m_columns == 132)
501501   {     x_preset   = x * 9;
502        d_x_preset = x * 18;
502         d_x_preset = x * 18;
503503   } else
504504   {
505        x_preset   = x * 10;
506        d_x_preset = x * 20;
505         x_preset   = x * 10;
506         d_x_preset = x * 20;
507507   }
508508
509509   UINT8 line = 0;
r26736r26737
512512   int back_intensity, back_default_intensity;
513513
514514   int invert = (display_type &  8) >> 3; // BIT 3 indicates REVERSE
515   int bold = (display_type & 16) >> 4;   // BIT 4 indicates BOLD
515   int bold = (display_type & 16) >> 4;   // BIT 4 indicates BOLD
516516   int blink  = display_type &  32;       // BIT 5 indicates BLINK
517517   int underline = display_type & 64;     // BIT 6 indicates UNDERLINE
518518   bool blank = (display_type & 0x80) ? true : false; // BIT 7 indicates BLANK
519519
520520   display_type = display_type & 3;
521521
522   // CASE 1 A)
522   // CASE 1 A)
523523   // SCREEN ATTRIBUTES (see VT-180 manual 6-30):
524524   // 'reverse field' = reverse video over entire screen (identical on Rainbow-100)
525525
526    // What does 'base attribute' do on Rainbow-100 ?
526   // What does 'base attribute' do on Rainbow-100 ?
527527   // VT-100 interpretation ('without AVO, eigth char.bit defines base attribute') most likely not correct!
528528   // OR 'base attribute' = reverse or underline (depending on the selection of the cursor at SETUP) ??
529529   // VT-100 manual 4-75 / 4-98 says: reverse = (reverse field H) XOR (reverse video H = base attribute input)
530530
531531   // For reference: a complete truth table can be taken from TABLE 4-6-4 / VT100 technical manual.
532    // Following simple IF statements implement it in full. Code should not be shuffled!
532   // Following simple IF statements implement it in full. Code should not be shuffled!
533533   invert = invert ^ m_reverse_field ^ m_basic_attribute;
534534
535535   fg_intensity = bold + 2;   // FOREGROUND (FG):  normal (2) or bright (3)
r26736r26737
540540
541541   // INVERSION: background gets foreground intensity (reduced by 1).
542542   // _RELIES ON_ on_ previous evaluation of the BLINK signal (fg_intensity).
543   if (invert != 0)           
544   {   
543   if (invert != 0)
544   {
545545      back_intensity = fg_intensity - 1; // BG: normal => dim;  dim => OFF;   bright => normal
546546
547547      if (back_intensity != 0)           //  FG: avoid 'black on black'
548         fg_intensity = 0;               
548         fg_intensity = 0;
549549      else
550         fg_intensity = fg_intensity + 1; // FG: dim => normal; normal => bright
550         fg_intensity = fg_intensity + 1; // FG: dim => normal; normal => bright
551551   }
552552
553553   // BG: DEFAULT for entire character (underline overrides this for 1 line) -
554554   back_default_intensity = back_intensity;
555555
556556   bool double_width  = (display_type != 3) ? true  : false; // all except normal: double width
557    bool double_height = (display_type &  1) ? false : true;  // 0,2 = double height
557   bool double_height = (display_type &  1) ? false : true;  // 0,2 = double height
558558
559559   for (int i = 0; i < 10; i++)
560560   {
r26736r26737
563563      switch (display_type)
564564      {
565565         case 0 :  // bottom half of 'double height, double width' char.
566                  j = (i >> 1) + 5;
566                  j = (i >> 1) + 5;
567567                  break;
568568
569569         case 2 :  // top half of 'double height, double width' char.
570                  j = (i >> 1);     
570                  j = (i >> 1);
571571                  break;
572572
573         default : // 1: double width 
574                 // 3: normal
575                  j = i;           
576                  break;
573         default : // 1: double width
574                  // 3: normal
575                  j = i;
576                  break;
577577      }
578578
579579      // modify line since that is how it is stored in rom
r26736r26737
582582      line = m_gfx[ (code << 4) + j]; // code * 16
583583
584584      // UNDERLINED CHARACTERS (CASE 5 - different in 1 line):
585      back_intensity = back_default_intensity; // 0, 1, 2
585      back_intensity = back_default_intensity; // 0, 1, 2
586586      if ( underline != 0 )
587587      {
588         if ( i == 8 )
588         if ( i == 8 )
589589         {
590             if (invert == 0)
591                line = 0xff; // CASE 5 A)
592             else
593             {    line = 0x00; // CASE 5 B)
594                 back_intensity = 0; // OVERRIDE: BLACK BACKGROUND
595             }
596              }
597       }
590               if (invert == 0)
591                  line = 0xff; // CASE 5 A)
592               else
593               {    line = 0x00; // CASE 5 B)
594                  back_intensity = 0; // OVERRIDE: BLACK BACKGROUND
595               }
596         }
597      }
598598
599599      for (int b = 0; b < 8; b++) // 0..7
600600      {
601601         if (blank)
602         {       bit = m_reverse_field ^ m_basic_attribute;
603         }
602         {       bit = m_reverse_field ^ m_basic_attribute;
603         }
604604         else
605605         {
606606               bit = BIT((line << b), 7);
r26736r26737
614614         // Double, 'double_height + double_width', then normal.
615615         if (double_width)
616616         {
617                bitmap.pix16( y_preset, d_x_preset + (b << 1) + 1) = bit;
617            bitmap.pix16( y_preset, d_x_preset + (b << 1) + 1) = bit;
618618            bitmap.pix16( y_preset, d_x_preset + (b << 1)    ) = bit;
619619
620620            if (double_height)
621621            {
622                 bitmap.pix16( 1 + y_preset, d_x_preset + (b << 1) + 1) = bit;
623                 bitmap.pix16( 1 + y_preset, d_x_preset + (b << 1)    ) = bit;
622                  bitmap.pix16( 1 + y_preset, d_x_preset + (b << 1) + 1) = bit;
623                  bitmap.pix16( 1 + y_preset, d_x_preset + (b << 1)    ) = bit;
624624            }
625625         }
626626         else
r26736r26737
629629         }
630630      } // for (8 bit)
631631
632     
632
633633      // char interleave (X) is filled with last bit
634634      if (double_width)
635      {   
635      {
636636         // double chars: 18 or 20 bits
637637         bitmap.pix16(y_preset, d_x_preset + 16) = bit;
638638         bitmap.pix16(y_preset, d_x_preset + 17) = bit;
639639
640         if (m_columns == 80)
641         {   bitmap.pix16(y_preset, d_x_preset + 18) = bit;
642             bitmap.pix16(y_preset, d_x_preset + 19) = bit;
640         if (m_columns == 80)
641         {   bitmap.pix16(y_preset, d_x_preset + 18) = bit;
642            bitmap.pix16(y_preset, d_x_preset + 19) = bit;
643643         }
644644      }
645645      else
646646      {   // normal chars: 9 or 10 bits
647647         bitmap.pix16(y_preset, x_preset + 8) = bit;
648648
649         if (m_columns == 80)
649         if (m_columns == 80)
650650            bitmap.pix16(y_preset, x_preset + 9) = bit;
651651      }
652652
r26736r26737
671671   while (line < (m_height + m_skip_lines))
672672   {
673673      code = m_in_ram_func(addr + xpos);
674 
675       if ( code == 0x00 )        // TODO: investigate side effect on regular zero character!
676          display_type |= 0x80; // DEFAULT: filler chars (till end of line) and empty lines (00) will be blanked
674
675      if ( code == 0x00 )        // TODO: investigate side effect on regular zero character!
676            display_type |= 0x80; // DEFAULT: filler chars (till end of line) and empty lines (00) will be blanked
677677      else
678          display_type &= 0x7f; // else activate display.
678            display_type &= 0x7f; // else activate display.
679679
680680      if ( code == 0xff )
681681      {
r26736r26737
709709         line++;
710710      }
711711      else
712      { 
712      {
713713         // display regular char
714714         if (line >= m_skip_lines)
715715         {
r26736r26737
722722            // 0 = display char. w. BLINK     (encoded as 32)
723723            // 0 = display char. w. UNDERLINE (encoded as 64).
724724            display_char(bitmap, code, xpos, ypos, scroll_region, display_type | (   (    (temp & 1)) << 3 )
725                                                                  | ( (2-(temp & 2)) << 3 )
726                                                                  | ( (4-(temp & 4)) << 3 )
727                                                                  | ( (8-(temp & 8)) << 3 )
725                                                                  | ( (2-(temp & 2)) << 3 )
726                                                                  | ( (4-(temp & 4)) << 3 )
727                                                                  | ( (8-(temp & 8)) << 3 )
728728                                                               );
729729
730         }
730         }
731731         xpos++;
732732
733733         if (xpos > m_columns )
r26736r26737
738738      } // (else) valid char
739739
740740   } // while
741   
742741
742
743743}
744744
745   
745
746746void rainbow_video_device::palette_select ( int choice )
747747{
748748   switch(choice)
749749   {
750          default:
751         case 0x01: 
750         default:
751         case 0x01:
752752                  palette_set_color_rgb(machine(), 1, 0xff-100, 0xff-100, 0xff-100);  // WHITE (dim)
753753                  palette_set_color_rgb(machine(), 2, 0xff-50, 0xff-50, 0xff-50);     // WHITE NORMAL
754                  palette_set_color_rgb(machine(), 3, 0xff, 0xff, 0xff);             // WHITE (brighter)
754                  palette_set_color_rgb(machine(), 3, 0xff, 0xff, 0xff);              // WHITE (brighter)
755755                  break;
756756
757757         case 0x02:
758758                  palette_set_color_rgb(machine(), 1, 0 , 205 -50, 100 - 50);        // GREEN (dim)
759                  palette_set_color_rgb(machine(), 2, 0 , 205,     100     );         // GREEN (NORMAL)
759                  palette_set_color_rgb(machine(), 2, 0 , 205,     100     );        // GREEN (NORMAL)
760760                  palette_set_color_rgb(machine(), 3, 0,  205 +50, 100 + 50);        // GREEN (brighter)
761761                  break;
762762
763         case 0x03:
763         case 0x03:
764764                  palette_set_color_rgb(machine(), 1, 213 - 47, 146 - 47, 82 - 47); // AMBER (dim)
765765                  palette_set_color_rgb(machine(), 2, 213,      146,      82     ); // AMBER (NORMAL)
766766                  palette_set_color_rgb(machine(), 3, 255,      193,      129    ); // AMBER (brighter)
r26736r26737
772772void rainbow_video_device::video_blanking(bitmap_ind16 &bitmap, const rectangle &cliprect)
773773{
774774   // 'In reverse screen mode, termination forces the beam to the screen background intensity'
775   // Background intensity means 'dim' (1) according to one source.
776    bitmap.fill( ((m_reverse_field ^ m_basic_attribute) ? 1 : 0) , cliprect);
775   // Background intensity means 'dim' (1) according to one source.
776   bitmap.fill( ((m_reverse_field ^ m_basic_attribute) ? 1 : 0) , cliprect);
777777}
778778
779779
r26736r26737
781781int rainbow_video_device::MHFU(int ASK)
782782{
783783   switch (ASK)
784   {     
785         case 1:         // "true": RETURN BOOLEAN (MHFU disabled or enabled?)
784   {
785         case 1:         // "true": RETURN BOOLEAN (MHFU disabled or enabled?)
786786            return MHFU_FLAG;
787787
788         case -1:      // -1: increment, return counter value (=> Rainbow.c)
789             if (MHFU_FLAG == true)
790               MHFU_counter++;
788         case -1:        // -1: increment, return counter value (=> Rainbow.c)
789               if (MHFU_FLAG == true)
790               MHFU_counter++;
791791            return MHFU_counter;
792792
793         case -100:         // -100 : RESET and ENABLE MHFU counter
794             //printf("-100 MHFU  * reset and ENABLE * \n");
793         case -100:          // -100 : RESET and ENABLE MHFU counter
794            //printf("-100 MHFU  * reset and ENABLE * \n");
795795            MHFU_counter = 0;
796796
797             //if (MHFU_FLAG == false)
798            //   printf("-100 MHFU  ___ENABLED___\n");
797            //if (MHFU_FLAG == false)
798            //  printf("-100 MHFU  ___ENABLED___\n");
799799            MHFU_FLAG = true;
800800
801801            return -100;
trunk/src/mess/video/poisk1.c
r26736r26737
8282
8383// CGA emulator
8484/*
85068h   D42   0..2   R, G, B      XXX Foreground/Background color
86      3   NMI DISABLE   NMI trap  1: Disabled  0: Enabled
87      4   PALETTE      XXX Colour palette  0: XXX  1: XXX
88      5   I (INTENS)   XXX Foreground/Background color intensity
89      6   DISPLAY BANK   XXX Video RAM page
90      7   HIRES      1: 640x200  0: 320x200
85068h    D42 0..2    R, G, B     XXX Foreground/Background color
86        3   NMI DISABLE NMI trap  1: Disabled  0: Enabled
87        4   PALETTE     XXX Colour palette  0: XXX  1: XXX
88        5   I (INTENS)  XXX Foreground/Background color intensity
89        6   DISPLAY BANK    XXX Video RAM page
90        7   HIRES       1: 640x200  0: 320x200
9191*/
9292
9393WRITE8_MEMBER(p1_state::p1_ppi2_porta_w)
r26736r26737
125125}
126126
127127/*
12806Ah   Dxx   6   Enable/Disable color burst (?)
129      7   Enable/Disable D7H/D7L
12806Ah    Dxx 6   Enable/Disable color burst (?)
129        7   Enable/Disable D7H/D7L
130130*/
131131
132132WRITE8_MEMBER(p1_state::p1_ppi_portc_w)
r26736r26737
151151   }
152152   // B&W -- XXX
153153/*
154   if ( m_video.mode_control_6a & 0x40 )
155   {
156      m_video.palette_lut_2bpp[1] = ( ( m_video.color_select_68 & 0x20 ) >> 2 ) | 3;
157      m_video.palette_lut_2bpp[2] = ( ( m_video.color_select_68 & 0x20 ) >> 2 ) | 4;
158      m_video.palette_lut_2bpp[3] = ( ( m_video.color_select_68 & 0x20 ) >> 2 ) | 7;
159   }
160   else
154    if ( m_video.mode_control_6a & 0x40 )
155    {
156        m_video.palette_lut_2bpp[1] = ( ( m_video.color_select_68 & 0x20 ) >> 2 ) | 3;
157        m_video.palette_lut_2bpp[2] = ( ( m_video.color_select_68 & 0x20 ) >> 2 ) | 4;
158        m_video.palette_lut_2bpp[3] = ( ( m_video.color_select_68 & 0x20 ) >> 2 ) | 7;
159    }
160    else
161161*/
162162   {
163163      // PALETTE
trunk/src/mess/video/pc_t1t.h
r26736r26737
1414         index = 0;
1515         memset(&data, 0, sizeof(data));
1616      }
17     
17
1818   UINT8 index;
1919   UINT8 data[0x20];
2020   /* see vgadoc
r26736r26737
3535   pc_t1t_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
3636
3737   DECLARE_PALETTE_INIT( pcjr );
38   
39   DECLARE_WRITE_LINE_MEMBER( t1000_de_changed );   
4038
39   DECLARE_WRITE_LINE_MEMBER( t1000_de_changed );
40
4141   required_device<mc6845_device> m_mc6845;
4242   UINT8 m_mode_control, m_color_select;
4343   UINT8 m_status;
r26736r26737
6060   UINT8   m_display_enable;
6161   UINT8   m_vsync;
6262   UINT8   m_palette_base;
63   
63
6464   int mode_control_r(void);
6565   void color_select_w(int data);
6666   int color_select_r(void);
r26736r26737
8787protected:
8888   virtual machine_config_constructor device_mconfig_additions() const;
8989   virtual void device_start();
90   
90
9191private:
9292   UINT8 *m_t1_displayram;
9393   void mode_switch( void );
9494   void vga_data_w(int data);
9595   void bank_w(int data);
9696   void mode_control_w(int data);
97};   
97};
9898
9999extern const device_type PCVIDEO_T1000;
100100
101101#define MCFG_PCVIDEO_T1000_ADD(_tag) \
102102      MCFG_DEVICE_ADD(_tag, PCVIDEO_T1000, 0)
103   
103
104104class pcvideo_pcjr_device :  public pc_t1t_device
105105{
106106public:
r26736r26737
109109
110110   DECLARE_WRITE8_MEMBER( write );
111111   DECLARE_WRITE_LINE_MEMBER( pcjr_vsync_changed );
112   
112
113113   UINT8   *m_jxkanji;
114114
115115protected:
trunk/src/mess/mess.lst
r26736r26737
177177sq1         // 1990 SQ-1
178178sqrack      // 1990 SQ-Rack
179179sd132       // 1991 SD-1 32
180asr10      // 1992 ASR-10
180asr10       // 1992 ASR-10
181181kt76        // 1996 KT-76
182182mr61        // 1996 MR-61
183183mrrack      // 1996 MR-Rack
184asrx      // 1997 ASR-X
184asrx        // 1997 ASR-X
185185
186186// Fairchild
187187channelf  // Fairchild Channel F VES - 1976
r26736r26737
451451apple2c3  // Sep 1986 Apple //c (Original Mem. Exp.)
452452apple2c4  // ??? 198? Apple //c (rev 4)
453453apple2cp  // Sep 1988 Apple //c+
454apple2gsr0p   // June 19, 1986 Apple IIgs ROM00 prototype
454apple2gsr0p // June 19, 1986 Apple IIgs ROM00 prototype
455455apple2gsr0  // Sep 1986 Apple IIgs ROM00
456456apple2gsr1  // Sep 1987 Apple IIgs ROM01
457457apple2gs  // Aug 1989 Apple IIgs ROM03
r26736r26737
14371437dectalk // 1982 Digital Equipment Corporation
14381438mc7105 // Elektronika MC7105
14391439rainbow // DEC Rainbow 100B
1440rainb190   // DEC Rainbow 190
1440rainb190    // DEC Rainbow 190
14411441
14421442// Memotech
14431443mtx512  // 1983 Memotech MTX 512
r26736r26737
23112311mkit09
23122312cpu09
23132313ivg09
2314
trunk/src/mess/layout/rainbow.lay
r26736r26737
8484         <color red="0.70" green="0.70" blue="0.70" />
8585      </text>
8686   </element>
87   
87
8888   <element name="l8wait">
8989      <text string="WAIT">
9090         <color red="1.0" green="1.0" blue="1.0" />
trunk/src/mess/drivers/bullet.c
r26736r26737
5353    - memory banking is broken
5454    - z80dart wait/ready
5555    - IMI 7710 Winchester controller
56       chdman createhd -o imi7710.chd -chs 350,3,10 -ss 1024
56        chdman createhd -o imi7710.chd -chs 350,3,10 -ss 1024
5757    - revision E model
5858
5959*/
trunk/src/mess/drivers/ec184x.c
r26736r26737
223223
224224static ADDRESS_MAP_START( ec1847_io, AS_IO, 8, ec184x_state )
225225   ADDRESS_MAP_UNMAP_HIGH
226//   AM_RANGE(0x0210, 0x021f) AM_RAM // internal (non-standard?) bus extender
226//  AM_RANGE(0x0210, 0x021f) AM_RAM // internal (non-standard?) bus extender
227227ADDRESS_MAP_END
228228
229229
r26736r26737
251251   MCFG_IBM5150_MOTHERBOARD_ADD("mb","maincpu")
252252   MCFG_DEVICE_INPUT_DEFAULTS(ec1840)
253253
254   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "mda", false)   // cga is? an option
254   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "mda", false)   // cga is? an option
255255   MCFG_ISA8_SLOT_ADD("mb:isa", "isa2", pc_isa8_cards, "fdc_xt", false)
256   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, NULL, false)   // native variant(s?) not emulated
257   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, NULL, false)   // native serial not emulated
258   MCFG_ISA8_SLOT_ADD("mb:isa", "isa5", pc_isa8_cards, NULL, false)   // native mouse port not emulated
259   MCFG_ISA8_SLOT_ADD("mb:isa", "isa6", pc_isa8_cards, NULL, false)   // game port is an option
256   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, NULL, false)    // native variant(s?) not emulated
257   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, NULL, false)    // native serial not emulated
258   MCFG_ISA8_SLOT_ADD("mb:isa", "isa5", pc_isa8_cards, NULL, false)    // native mouse port not emulated
259   MCFG_ISA8_SLOT_ADD("mb:isa", "isa6", pc_isa8_cards, NULL, false)    // game port is an option
260260
261261   MCFG_SOFTWARE_LIST_ADD("flop_list","ec1841")
262262
r26736r26737
271271   MCFG_CPU_PROGRAM_MAP(ec1841_map)
272272   MCFG_CPU_IO_MAP(ec1841_io)
273273
274//   MCFG_MACHINE_START_OVERRIDE(ec184x_state, ec184x)
274//  MCFG_MACHINE_START_OVERRIDE(ec184x_state, ec184x)
275275   MCFG_MACHINE_RESET_OVERRIDE(ec184x_state, ec184x)
276276
277277   MCFG_EC1841_MOTHERBOARD_ADD("mb", "maincpu")
r26736r26737
279279
280280   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "cga_ec1841", false)// mda is an option
281281   MCFG_ISA8_SLOT_ADD("mb:isa", "isa2", pc_isa8_cards, "fdc_xt", false)
282   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, NULL, false)   // native variants not emulated
283   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, NULL, false)   // native serial not emulated
284   MCFG_ISA8_SLOT_ADD("mb:isa", "isa5", pc_isa8_cards, NULL, false)   // native mouse port not emulated
285   MCFG_ISA8_SLOT_ADD("mb:isa", "isa6", pc_isa8_cards, NULL, false)   // game port is? an option
282   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, NULL, false)    // native variants not emulated
283   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, NULL, false)    // native serial not emulated
284   MCFG_ISA8_SLOT_ADD("mb:isa", "isa5", pc_isa8_cards, NULL, false)    // native mouse port not emulated
285   MCFG_ISA8_SLOT_ADD("mb:isa", "isa6", pc_isa8_cards, NULL, false)    // game port is? an option
286286
287287   MCFG_SOFTWARE_LIST_ADD("flop_list","ec1841")
288288
r26736r26737
290290
291291   MCFG_RAM_ADD(RAM_TAG)
292292   MCFG_RAM_DEFAULT_SIZE("512K")
293   MCFG_RAM_EXTRA_OPTIONS("1024K,1576K,2048K")   // 640K variant not emulated
293   MCFG_RAM_EXTRA_OPTIONS("1024K,1576K,2048K") // 640K variant not emulated
294294MACHINE_CONFIG_END
295295
296296// XXX verify everything
r26736r26737
302302   MCFG_IBM5160_MOTHERBOARD_ADD("mb","maincpu")
303303   MCFG_DEVICE_INPUT_DEFAULTS(ec1847)
304304
305   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "hercules", false)   // cga, ega and vga(?) are options too
305   MCFG_ISA8_SLOT_ADD("mb:isa", "isa1", pc_isa8_cards, "hercules", false)  // cga, ega and vga(?) are options too
306306   MCFG_ISA8_SLOT_ADD("mb:isa", "isa2", pc_isa8_cards, "fdc_xt", false)
307   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, NULL, false)   // native variant (wd1010 + z80) not emulated
308   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, NULL, false)   // native serial (2x8251) not emulated
307   MCFG_ISA8_SLOT_ADD("mb:isa", "isa3", pc_isa8_cards, NULL, false)    // native variant (wd1010 + z80) not emulated
308   MCFG_ISA8_SLOT_ADD("mb:isa", "isa4", pc_isa8_cards, NULL, false)    // native serial (2x8251) not emulated
309309   MCFG_ISA8_SLOT_ADD("mb:isa", "isa5", pc_isa8_cards, NULL, false)
310310   MCFG_ISA8_SLOT_ADD("mb:isa", "isa6", pc_isa8_cards, NULL, false)
311311
trunk/src/mess/drivers/a7800.c
r26736r26737
7070
7171    2013/11/03 Robert Tuccitto Fixed correctly typo under 26.7 7$.
7272
73   2014/11/23 Robert Tuccitto Added NTSC Palette Notes
73    2014/11/23 Robert Tuccitto Added NTSC Palette Notes
7474***************************************************************************/
7575
7676#include "emu.h"
r26736r26737
159159/***************************************************************************
160160Atari 7800 NTSC Palette Notes:
161161
162Palette on a modern flat panel display (LCD, LED, Plasma, etc.) appears
163different from a traditional CRT. The most outstanding difference is Hue 1x,
164the hue begin point. Hue 1x looks very 'green' (~-60 to -45 degrees -
165depending on how poor or well it handles the signal conversion and its
166calibration) on a modern flat panel display, as opposed to 'gold' (~-33
167degrees) on a CRT. 
162Palette on a modern flat panel display (LCD, LED, Plasma, etc.) appears
163different from a traditional CRT. The most outstanding difference is Hue 1x,
164the hue begin point. Hue 1x looks very 'green' (~-60 to -45 degrees -
165depending on how poor or well it handles the signal conversion and its
166calibration) on a modern flat panel display, as opposed to 'gold' (~-33
167degrees) on a CRT.
168168
169The system's pot adjustment manually manipulates the ratio of blue to
170green/blue to red, while the system 'warming-up' causes the palette phase
169The system's pot adjustment manually manipulates the ratio of blue to
170green/blue to red, while the system 'warming-up' causes the palette phase
171171shift to go higher in degrees.
172172
173At power on, the system's phase shift appears as low as ~23 degrees and
174after a considerable consistent runtime, can be as high as ~28 degrees.
175 
176In general, the low end of ~23 degrees lasts for maybe several seconds,
177whereas higher values such as ~25-27 degrees is the most dominant during
178system run time.  180 degrees colorburst takes place at ~25.7 degrees (A
179near exact match of Hue 1x and 15x - To the naked eye they appear to be
180the same). 
181 
182However, if the system is adjusted within the first several minutes of
183running, the warm up, consistent system run time, causes Hue 15x (F$) to
184become stronger/darker gold (More brown then ultimately red-brown); as well
185as leans Hue 14x (E$) more brown than green.  Once achieving a phase shift
186of 27.7, Hue 14x (E$) and Hue 15x (F$) near-exact match Hue 1x and 2x
187respectively.
188 
189Therefore, an ideal phase shift while accounting for the reality of
190shifting while warming up, as well as maintaining differences between 1x,
1912x and 14x, 15x, would likely fall between a 25.7 and 27.7. Phase shifts
19226.2 degrees and 26.7 degrees places Hue 15x (F$) between Hue 1x and
193Hue 2x, having 26.2 degrees leaning closer to Hue 1x and 26.7 degrees
173At power on, the system's phase shift appears as low as ~23 degrees and
174after a considerable consistent runtime, can be as high as ~28 degrees.
175
176In general, the low end of ~23 degrees lasts for maybe several seconds,
177whereas higher values such as ~25-27 degrees is the most dominant during
178system run time.  180 degrees colorburst takes place at ~25.7 degrees (A
179near exact match of Hue 1x and 15x - To the naked eye they appear to be
180the same).
181
182However, if the system is adjusted within the first several minutes of
183running, the warm up, consistent system run time, causes Hue 15x (F$) to
184become stronger/darker gold (More brown then ultimately red-brown); as well
185as leans Hue 14x (E$) more brown than green.  Once achieving a phase shift
186of 27.7, Hue 14x (E$) and Hue 15x (F$) near-exact match Hue 1x and 2x
187respectively.
188
189Therefore, an ideal phase shift while accounting for the reality of
190shifting while warming up, as well as maintaining differences between 1x,
1912x and 14x, 15x, would likely fall between a 25.7 and 27.7. Phase shifts
19226.2 degrees and 26.7 degrees places Hue 15x (F$) between Hue 1x and
193Hue 2x, having 26.2 degrees leaning closer to Hue 1x and 26.7 degrees
194194leaning closer to Hue 2x.
195195
196The above notion would also harmonize with what has been documented for
197the colors of 1x, 2x, 14x, 15x on the 7800.  1x = Gold, 2x = Orange,
19814x (E$) = Orange-Green. 15x (F$) = Light Orange.  Color descriptions are
199best measured in the middle of the brightness scale.  It should be
196The above notion would also harmonize with what has been documented for
197the colors of 1x, 2x, 14x, 15x on the 7800.  1x = Gold, 2x = Orange,
19814x (E$) = Orange-Green. 15x (F$) = Light Orange.  Color descriptions are
199best measured in the middle of the brightness scale.  It should be
200200mentioned that Green-Yellow is referenced at Hue 13x (D$), nowhere near
201Hue 1x.  A Green-Yellow Hue 1x is how the palette is manipulated and
201Hue 1x.  A Green-Yellow Hue 1x is how the palette is manipulated and
202202modified (in part) under a modern flat panel display.
203203
204Additionally, the blue to red (And consequently blue to green) ratio
205proportions may appear different on a modern flat panel display than a CRT
206in some instances for the Atari 7800 system.  Furthermore, you may have
204Additionally, the blue to red (And consequently blue to green) ratio
205proportions may appear different on a modern flat panel display than a CRT
206in some instances for the Atari 7800 system.  Furthermore, you may have
207207some variation of proportions even within the same display type.
208 
209One side effect of this on the console's palette is that some values of
210red may appear too pinkish - Too much blue to red.  This is not the same
211as a traditional tint-hue control adjustment; rather, can be demonstrated
208
209One side effect of this on the console's palette is that some values of
210red may appear too pinkish - Too much blue to red.  This is not the same
211as a traditional tint-hue control adjustment; rather, can be demonstrated
212212by changing the blue ratio values via MESS HLSL settings.
213213
214Lastly, the Atari 2600 & 5200 NTSC color palettes hold the same hue
215structure order and have similar appearance differences that are dependent
214Lastly, the Atari 2600 & 5200 NTSC color palettes hold the same hue
215structure order and have similar appearance differences that are dependent
216216upon display type.
217217***************************************************************************/
218218/***************************************************************************
trunk/src/mess/drivers/ht68k.c
r26736r26737
8787   memcpy((UINT8*)m_p_ram.target(),user1,0x8000);
8888
8989   m_maincpu->reset();
90   
90
9191   m_fdc->reset();
9292   m_fdc->set_floppy(NULL);
9393}
trunk/src/mess/drivers/pc.c
r26736r26737
10751075   MCFG_CPU_PROGRAM_MAP(tandy1000_map) \
10761076   MCFG_CPU_IO_MAP(tandy1000_io)  \
10771077   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, pc_frame_interrupt, "pcvideo_t1000:screen", 0, 1) //with this line commented out, it boots further though keyboard doesn't work, obviously
1078   
1078
10791079   MCFG_MACHINE_START_OVERRIDE(tandy_pc_state,pc)
10801080   MCFG_MACHINE_RESET_OVERRIDE(pc_state,pc)
10811081
r26736r26737
11441144   MCFG_CPU_PROGRAM_MAP(tandy1000_16_map) \
11451145   MCFG_CPU_IO_MAP(tandy1000_16_io)  \
11461146   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, pc_frame_interrupt, "pcvideo_t1000:screen", 0, 1)
1147   
1148   
1147
1148
11491149   MCFG_MACHINE_START_OVERRIDE(tandy_pc_state,pc)
11501150   MCFG_MACHINE_RESET_OVERRIDE(tandy_pc_state,tandy1000rl)
11511151
r26736r26737
12151215   MCFG_CPU_PROGRAM_MAP(tandy1000_286_map) \
12161216   MCFG_CPU_IO_MAP(tandy1000_286_io)  \
12171217   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, pc_frame_interrupt, "pcvideo_t1000:screen", 0, 1)
1218   
1219   
1218
1219
12201220   MCFG_MACHINE_START_OVERRIDE(pc_state,pc)
12211221   MCFG_MACHINE_RESET_OVERRIDE(pc_state,pc)
12221222
r26736r26737
13021302   MCFG_CPU_PROGRAM_MAP(ibmpcjr_map) \
13031303   MCFG_CPU_IO_MAP(ibmpcjr_io)  \
13041304   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, pcjr_frame_interrupt, "pcvideo_pcjr:screen", 0, 1) //with this line commented out, it boots further though keyboard doesn't work, obviously
1305   
1305
13061306   MCFG_MACHINE_START_OVERRIDE(pc_state,pcjr)
13071307   MCFG_MACHINE_RESET_OVERRIDE(pc_state,pcjr)
13081308
trunk/src/mess/drivers/myvision.c
r26736r26737
1717    - Add clickable artwork
1818    - Verify sound chip model
1919    - Verify exact TMS9918 model
20    - Verify clock crystal(s)
21    - Verify size of vram
20    - Verify clock crystal(s)
21    - Verify size of vram
2222
2323****************************************************************************/
2424
r26736r26737
225225
226226static const ay8910_interface myvision_ay8910_interface =
227227{
228    AY8910_LEGACY_OUTPUT,
229    AY8910_DEFAULT_LOADS,
230    DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_r),
231    DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_r),
232    DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_w),
233    DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_w)
228   AY8910_LEGACY_OUTPUT,
229   AY8910_DEFAULT_LOADS,
230   DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_r),
231   DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_r),
232   DEVCB_DRIVER_MEMBER(myvision_state, ay_port_a_w),
233   DEVCB_DRIVER_MEMBER(myvision_state, ay_port_b_w)
234234};
235235
236236
r26736r26737
271271
272272/*    YEAR  NAME      PARENT  COMPAT   MACHINE    INPUT     INIT                  COMPANY        FULLNAME              FLAGS */
273273COMP( 1983, myvision, 0,      0,       myvision,  myvision, driver_device,   0,   "Nichibutsu", "My Vision (KH-1000)", 0 )
274
trunk/src/mess/drivers/mkit09.c
r26736r26737
142142      sprintf(kbdrow,"X%d",m_keydata);
143143      return ioport(kbdrow)->read();
144144   }
145     
145
146146   return 0xff;
147147}
148148
trunk/src/mess/drivers/apple2gs.c
r26736r26737
511511   ROM_REGION(0x20000, "es5503", ROMREGION_ERASE00)
512512ROM_END
513513
514ROM_START(apple2gsr0p)   // 6/19/1986 Cortland prototype
514ROM_START(apple2gsr0p)  // 6/19/1986 Cortland prototype
515515   ROM_REGION(0xc00,"m50740",0)
516516   ROM_LOAD( "341s0345.bin", 0x000000, 0x000c00, CRC(48cd5779) SHA1(97e421f5247c00a0ca34cd08b6209df573101480) )
517517
r26736r26737
535535COMP( 1987, apple2gsr1, apple2gs, 0,    apple2gsr1, apple2gs, driver_device, 0, "Apple Computer", "Apple IIgs (ROM01)", GAME_SUPPORTS_SAVE )
536536COMP( 1986, apple2gsr0, apple2gs, 0,    apple2gsr1, apple2gs, driver_device, 0, "Apple Computer", "Apple IIgs (ROM00)", GAME_SUPPORTS_SAVE )
537537COMP( 1986, apple2gsr0p,apple2gs, 0,    apple2gsr1, apple2gs, driver_device, 0, "Apple Computer", "Apple IIgs (ROM00 prototype 6/19/1986)", GAME_SUPPORTS_SAVE )
538
trunk/src/mess/drivers/iskr103x.c
r26736r26737
8383   MCFG_ISA8_SLOT_ADD("mb:isa", "isa6", pc_isa8_cards, NULL, false)
8484
8585   MCFG_PC_KBDC_SLOT_ADD("mb:pc_kbdc", "kbd", pc_xt_keyboards, STR_KBD_EC_1841)
86//   MCFG_PC_KBDC_SLOT_ADD("mb:pc_kbdc", "kbd", pc_xt_keyboards, STR_KBD_ISKR_1030)
86//  MCFG_PC_KBDC_SLOT_ADD("mb:pc_kbdc", "kbd", pc_xt_keyboards, STR_KBD_ISKR_1030)
8787
8888   MCFG_RAM_ADD(RAM_TAG)
8989   MCFG_RAM_DEFAULT_SIZE("640K")
r26736r26737
105105   MCFG_ISA8_SLOT_ADD("mb:isa", "isa5", pc_isa8_cards, NULL, false)
106106   MCFG_ISA8_SLOT_ADD("mb:isa", "isa6", pc_isa8_cards, NULL, false)
107107
108//   MCFG_SOFTWARE_LIST_ADD("flop_list", "iskr1031")
108//  MCFG_SOFTWARE_LIST_ADD("flop_list", "iskr1031")
109109
110110   MCFG_PC_KBDC_SLOT_ADD("mb:pc_kbdc", "kbd", pc_xt_keyboards, STR_KBD_EC_1841)
111//   MCFG_PC_KBDC_SLOT_ADD("mb:pc_kbdc", "kbd", pc_xt_keyboards, STR_KBD_ISKR_1030)
111//  MCFG_PC_KBDC_SLOT_ADD("mb:pc_kbdc", "kbd", pc_xt_keyboards, STR_KBD_ISKR_1030)
112112
113113   MCFG_RAM_ADD(RAM_TAG)
114114   MCFG_RAM_DEFAULT_SIZE("640K")
trunk/src/mess/drivers/esqkt.c
r26736r26737
291291}
292292
293293CONS( 1996, kt76, 0, 0, kt, kt, esqkt_state, kt, "Ensoniq", "KT-76", GAME_NOT_WORKING )
294
trunk/src/mess/drivers/v6809.c
r26736r26737
317317
318318WRITE_LINE_MEMBER( v6809_state::speaker_w )
319319{
320//   if (m_speaker_en)
321//      m_speaker->level_w(state);
320//  if (m_speaker_en)
321//      m_speaker->level_w(state);
322322}
323323
324324static const ptm6840_interface mc6840_intf =
trunk/src/mess/drivers/wicat.c
r26736r26737
690690   MCFG_CPU_ADD("floppycpu",N8X300,XTAL_8MHz)
691691   MCFG_CPU_PROGRAM_MAP(wicat_flop_mem)
692692   MCFG_CPU_IO_MAP(wicat_flop_io)
693//   MCFG_FD1795_ADD("fdc")
693//  MCFG_FD1795_ADD("fdc")
694694
695695MACHINE_CONFIG_END
696696
trunk/src/mess/drivers/xerox820.c
r26736r26737
1414
1515    - Xerox 820
1616        - floppy format has 3xcd at the end of track data
17           :u109: write track 0
18         :u109: track description 16xff ... 109xff 3xcd
17            :u109: write track 0
18            :u109: track description 16xff ... 109xff 3xcd
1919    - Xerox 820-II
2020        - floppy (read/write to FDC triggers Z80 WAIT)
2121        - Winchester
trunk/src/mess/drivers/cbm2.c
r26736r26737
21662166   MCFG_PLS100_ADD(PLA2_TAG)
21672167   MCFG_TPI6525_ADD(MOS6525_1_TAG, p500_tpi1_intf)
21682168   MCFG_TPI6525_ADD(MOS6525_2_TAG, p500_tpi2_intf)
2169   
2169
21702170   MCFG_DEVICE_ADD(MOS6551A_TAG, MOS6551, XTAL_1_8432MHz)
21712171   MCFG_MOS6551_IRQ_HANDLER(DEVWRITELINE(MOS6525_1_TAG, tpi6525_device, i4_w))
21722172   MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, tx))
trunk/src/mess/drivers/v1050.c
r26736r26737
142142
143143    TODO:
144144
145   - floppy 1 is broken
145    - floppy 1 is broken
146146    - write to banked RAM at 0x0000-0x1fff when ROM is active
147147    - real keyboard w/i8049
148148    - keyboard beeper (NE555 wired in strange mix of astable/monostable modes)
trunk/src/mess/drivers/atari400.c
r26736r26737
2828     - Clean up the whole driver + cart + floppy structure
2929
3030    2013-11-06 Robert Tuccitto:
31    Updated Palette per 'CGIA D020577' and 'GTIA C014805', including
31    Updated Palette per 'CGIA D020577' and 'GTIA C014805', including
3232    normalized grayscale with proper color gradient.  Added Phase Shift
33    values 24.7 thru 27.7 degrees in 0.5 degree increments.  Enabled
33    values 24.7 thru 27.7 degrees in 0.5 degree increments.  Enabled
3434    Phase Shift 26.2 degrees as default.
3535
3636    2013-11-23 Robert Tuccitto:
37   Added palette notes
37    Added palette notes
3838
3939******************************************************************************/
4040
r26736r26737
754754
755755INPUT_PORTS_END
756756/***************************************************************
757Atari 5200 Palette Notes:
757Atari 5200 Palette Notes:
758758
759Palette on a modern flat panel display (LCD, LED, Plasma, etc.)
760appears different from a traditional CRT. The most outstanding
761difference is Hue 1x, the hue begin point. Hue 1x looks very
762'green' (~-60 to -45 degrees - depending on how poor or well it
763handles the signal conversion and its calibration) on a modern
764flat panel display, as opposed to 'gold' (~-33 degrees) on a
765CRT.  The official technical document, "GTIA C014805 NTSC"
759Palette on a modern flat panel display (LCD, LED, Plasma, etc.)
760appears different from a traditional CRT. The most outstanding
761difference is Hue 1x, the hue begin point. Hue 1x looks very
762'green' (~-60 to -45 degrees - depending on how poor or well it
763handles the signal conversion and its calibration) on a modern
764flat panel display, as opposed to 'gold' (~-33 degrees) on a
765CRT.  The official technical document, "GTIA C014805 NTSC"
766766stipulates Hue 1x as gold.
767767
768The "Atari 5200 Field Service Manual" provides two different
769sets of instructions in harmony with utilizing the "PAM
770Diagnostic SALT Cartridge v1.1".  In one account it states the
771color just below and above the reference bar to be within one
772shade of each other. 
768The "Atari 5200 Field Service Manual" provides two different
769sets of instructions in harmony with utilizing the "PAM
770Diagnostic SALT Cartridge v1.1".  In one account it states the
771color just below and above the reference bar to be within one
772shade of each other.
773773
774Under the same reference document, directions are given for it
775to be the same color.  Phase Shift 25.7 degrees matches Hue 1x,
774Under the same reference document, directions are given for it
775to be the same color.  Phase Shift 25.7 degrees matches Hue 1x,
77677615x and the color below the reference bar.
777777
778However, if the system is adjusted within the first several
779minutes of running, the warm up, consistent system run time,
780causes Hue 15x (F$) to become stronger/darker gold (More brown
781then ultimately red-brown); as well as leans Hue 14x (E$) more
782brown than green.  Once achieving a phase shift of 27.7,
783Hue 14x (E$) and Hue 15x (F$) near-exact match Hue 1x and 2x
784respectively.
778However, if the system is adjusted within the first several
779minutes of running, the warm up, consistent system run time,
780causes Hue 15x (F$) to become stronger/darker gold (More brown
781then ultimately red-brown); as well as leans Hue 14x (E$) more
782brown than green.  Once achieving a phase shift of 27.7,
783Hue 14x (E$) and Hue 15x (F$) near-exact match Hue 1x and 2x
784respectively.
785785
786Accounting for system 'warm-up', phase shifting, as well as the
787instructions for it to be within one shade of each other, would
788make Phase Shift 26.2 degrees or 26.7 degrees a realistic
786Accounting for system 'warm-up', phase shifting, as well as the
787instructions for it to be within one shade of each other, would
788make Phase Shift 26.2 degrees or 26.7 degrees a realistic
789789logical choice.
790790
791It also collaborates with the official "GTIA C014805 NTSC"
792document for color order: Hue 1x = Gold, Hue 2x = Orange,
793Hue 15x (F$) = Light-Orange; Phase Shift 26.2 places
794Hue 15x (F$) between Hue 1x, Gold and Hue 2x, Orange;
795a Light Orange in color.  Color descriptions are best measured
796in the middle of the brightness scale.
791It also collaborates with the official "GTIA C014805 NTSC"
792document for color order: Hue 1x = Gold, Hue 2x = Orange,
793Hue 15x (F$) = Light-Orange; Phase Shift 26.2 places
794Hue 15x (F$) between Hue 1x, Gold and Hue 2x, Orange;
795a Light Orange in color.  Color descriptions are best measured
796in the middle of the brightness scale.
797797
798It should be mentioned that Green-Yellow is referenced at
799Hue 13x (D$), nowhere near Hue 1x.  A Green-Yellow Hue 1x is
800how the palette is manipulated and modified (in part) under
798It should be mentioned that Green-Yellow is referenced at
799Hue 13x (D$), nowhere near Hue 1x.  A Green-Yellow Hue 1x is
800how the palette is manipulated and modified (in part) under
801801a modern flat panel display.
802802
803Note though, even a properly calibrated console, at power on,
804the phase shift appears as low as ~23 degrees and after a
805considerable consistent runtime, can be as high as ~28 degrees. 
806In general, the low end of ~23 degrees lasts for maybe several
807seconds, whereas higher values such as ~25-27 degrees is the
808most dominant during system run time.
803Note though, even a properly calibrated console, at power on,
804the phase shift appears as low as ~23 degrees and after a
805considerable consistent runtime, can be as high as ~28 degrees.
806In general, the low end of ~23 degrees lasts for maybe several
807seconds, whereas higher values such as ~25-27 degrees is the
808most dominant during system run time.
809809
810Additionally, the blue to red (And consequently blue to green)
811ratio proportions may appear different on a modern flat panel
812display than a CRT in some instances for the Atari 5200 system. 
813Furthermore, you may have some variation of proportions even
810Additionally, the blue to red (And consequently blue to green)
811ratio proportions may appear different on a modern flat panel
812display than a CRT in some instances for the Atari 5200 system.
813Furthermore, you may have some variation of proportions even
814814within the same display type.
815 
816One side effect of this on the console's palette is that some
817values of red may appear too pinkish - Too much blue to red. 
818This is not the same as a traditional tint-hue control
819adjustment; rather, can be demonstrated by changing the blue
815
816One side effect of this on the console's palette is that some
817values of red may appear too pinkish - Too much blue to red.
818This is not the same as a traditional tint-hue control
819adjustment; rather, can be demonstrated by changing the blue
820820ratio values via MESS HLSL settings.
821821
822Lastly, the Atari 2600 & 7800 NTSC color palettes hold the same
823hue structure order and have similar appearance differences
822Lastly, the Atari 2600 & 7800 NTSC color palettes hold the same
823hue structure order and have similar appearance differences
824824dependent upon display type.
825825***************************************************************/
826826/**************************************************************
r26736r26737
832832static const UINT8 atari_palette[256*3] =
833833{
834834   /* Grey */
835   0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
836   0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
837   0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
838   0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
835   0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
836   0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
837   0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
838   0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
839839   /* Gold */
840   0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
841   0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
842   0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
840   0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
841   0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
842   0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
843843   0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,
844844   /* Orange */
845   0x31,0x00,0x00, 0x42,0x06,0x00, 0x53,0x17,0x00, 0x64,0x28,0x00,
846   0x75,0x39,0x00, 0x86,0X4A,0x00, 0x97,0x5B,0x0B, 0xA8,0x6C,0x1C,
847   0xB9,0x7D,0x2D, 0xCA,0x8E,0x3E, 0xDB,0x9F,0x4F, 0xEC,0xB0,0x60,
848   0xFD,0xC1,0x71, 0xFF,0xD2,0x86, 0xFF,0xE3,0x9D, 0xFF,0xF4,0xB3, 
845   0x31,0x00,0x00, 0x42,0x06,0x00, 0x53,0x17,0x00, 0x64,0x28,0x00,
846   0x75,0x39,0x00, 0x86,0X4A,0x00, 0x97,0x5B,0x0B, 0xA8,0x6C,0x1C,
847   0xB9,0x7D,0x2D, 0xCA,0x8E,0x3E, 0xDB,0x9F,0x4F, 0xEC,0xB0,0x60,
848   0xFD,0xC1,0x71, 0xFF,0xD2,0x86, 0xFF,0xE3,0x9D, 0xFF,0xF4,0xB3,
849849   /* Red-Orange */
850   0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x08,0x00, 0x71,0x19,0x00,
851   0x82,0x2A,0x0F, 0x93,0x3B,0x20, 0xA4,0x4C,0x31, 0xB5,0x5D,0x42,
852   0xC6,0x6E,0x53, 0xD7,0x7F,0x64, 0xE8,0x90,0x75, 0xF9,0xA1,0x86,
850   0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x08,0x00, 0x71,0x19,0x00,
851   0x82,0x2A,0x0F, 0x93,0x3B,0x20, 0xA4,0x4C,0x31, 0xB5,0x5D,0x42,
852   0xC6,0x6E,0x53, 0xD7,0x7F,0x64, 0xE8,0x90,0x75, 0xF9,0xA1,0x86,
853853   0xFF,0xB2,0x9A, 0xFF,0xC3,0xB0, 0xFF,0xD4,0xC6, 0xFF,0xE5,0xDC,
854854   /* Pink */
855   0x3E,0x00,0x06, 0x4F,0x00,0x12, 0x60,0x00,0x1E, 0x71,0x0E,0x2E,
856   0x82,0x1F,0x3F, 0x93,0x30,0x50, 0xA4,0x41,0x61, 0xB5,0x52,0x72,
857   0xC6,0x63,0x83, 0xD7,0x74,0x94, 0xE8,0x85,0xA5, 0xF9,0x96,0xB6,
855   0x3E,0x00,0x06, 0x4F,0x00,0x12, 0x60,0x00,0x1E, 0x71,0x0E,0x2E,
856   0x82,0x1F,0x3F, 0x93,0x30,0x50, 0xA4,0x41,0x61, 0xB5,0x52,0x72,
857   0xC6,0x63,0x83, 0xD7,0x74,0x94, 0xE8,0x85,0xA5, 0xF9,0x96,0xB6,
858858   0xFF,0xA7,0xCB, 0xFF,0xB8,0xE1, 0xFF,0xC9,0xEF, 0xFF,0xDA,0xF4,
859859   /* Purple */
860   0x32,0x00,0x38, 0x43,0x00,0x44, 0x54,0x00,0x50, 0x65,0x0C,0x5F,
861   0x76,0x1D,0x70, 0x87,0x2E,0x81, 0x98,0x3F,0x92, 0xA9,0x50,0xA3,
862   0xBA,0x61,0xB4, 0xCB,0x72,0xC5, 0xDC,0x83,0xD6, 0xED,0x94,0xE4,
860   0x32,0x00,0x38, 0x43,0x00,0x44, 0x54,0x00,0x50, 0x65,0x0C,0x5F,
861   0x76,0x1D,0x70, 0x87,0x2E,0x81, 0x98,0x3F,0x92, 0xA9,0x50,0xA3,
862   0xBA,0x61,0xB4, 0xCB,0x72,0xC5, 0xDC,0x83,0xD6, 0xED,0x94,0xE4,
863863   0xFE,0xA5,0xE4, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,
864864   /* Purple-Blue */
865   0x1B,0x00,0x5F, 0x2C,0x00,0x6B, 0x3D,0x00,0x77, 0x4E,0x11,0x88,
866   0x5F,0x22,0x99, 0x70,0x33,0xAA, 0x81,0x44,0xBB, 0x92,0x55,0xCC,
867   0xA3,0x66,0xDD, 0xB4,0x77,0xED, 0xC5,0x88,0xED, 0xD6,0x99,0xED,
865   0x1B,0x00,0x5F, 0x2C,0x00,0x6B, 0x3D,0x00,0x77, 0x4E,0x11,0x88,
866   0x5F,0x22,0x99, 0x70,0x33,0xAA, 0x81,0x44,0xBB, 0x92,0x55,0xCC,
867   0xA3,0x66,0xDD, 0xB4,0x77,0xED, 0xC5,0x88,0xED, 0xD6,0x99,0xED,
868868   0xE7,0xAA,0xED, 0xF8,0xBB,0xED, 0xFF,0xCC,0xF0, 0xFF,0xDD,0xF5,
869869   /* Blue 1 */
870   0x00,0x00,0x72, 0x10,0x00,0x7E, 0x21,0x0D,0x8E, 0x32,0x1E,0x9F,
871   0x43,0x2F,0xB0, 0x54,0x40,0xC1, 0x65,0x51,0xD2, 0x76,0x62,0xE3,
872   0x87,0x73,0xF4, 0x98,0x84,0xF9, 0xA9,0x95,0xF9, 0xBA,0xA6,0xF9,
870   0x00,0x00,0x72, 0x10,0x00,0x7E, 0x21,0x0D,0x8E, 0x32,0x1E,0x9F,
871   0x43,0x2F,0xB0, 0x54,0x40,0xC1, 0x65,0x51,0xD2, 0x76,0x62,0xE3,
872   0x87,0x73,0xF4, 0x98,0x84,0xF9, 0xA9,0x95,0xF9, 0xBA,0xA6,0xF9,
873873   0xCB,0xB7,0xF9, 0xDC,0xC8,0xF9, 0xED,0xD9,0xF9, 0xFE,0xEA,0xF9,
874874   /* Blue 2 */
875   0x00,0x00,0x65, 0x00,0x0C,0x7A, 0x05,0x1D,0x8E, 0x16,0x2E,0x9F,
876   0x27,0x3F,0xB0, 0x38,0x50,0xC1, 0x49,0x61,0xD2, 0x5A,0x72,0xE3,
877   0x6B,0x83,0xF4, 0x7C,0x94,0xFF, 0x8D,0xA5,0xFF, 0x9E,0xB6,0xFF,
875   0x00,0x00,0x65, 0x00,0x0C,0x7A, 0x05,0x1D,0x8E, 0x16,0x2E,0x9F,
876   0x27,0x3F,0xB0, 0x38,0x50,0xC1, 0x49,0x61,0xD2, 0x5A,0x72,0xE3,
877   0x6B,0x83,0xF4, 0x7C,0x94,0xFF, 0x8D,0xA5,0xFF, 0x9E,0xB6,0xFF,
878878   0xAF,0xC7,0xFF, 0xC0,0xD8,0xFF, 0xD1,0xE9,0xFF, 0xE2,0xFA,0xFF,
879879   /* Light-Blue */
880   0x00,0x0D,0x48, 0x00,0x1E,0x5E, 0x00,0x2F,0x74, 0x00,0x40,0x8A,
881   0x11,0x51,0x9B, 0x22,0x62,0xAC, 0x33,0x73,0xBD, 0x44,0x84,0xCE,
882   0x55,0x95,0xDF, 0x66,0xA6,0xF0, 0x77,0xB7,0xFF, 0x88,0xC8,0xFF,
880   0x00,0x0D,0x48, 0x00,0x1E,0x5E, 0x00,0x2F,0x74, 0x00,0x40,0x8A,
881   0x11,0x51,0x9B, 0x22,0x62,0xAC, 0x33,0x73,0xBD, 0x44,0x84,0xCE,
882   0x55,0x95,0xDF, 0x66,0xA6,0xF0, 0x77,0xB7,0xFF, 0x88,0xC8,0xFF,
883883   0x99,0xD9,0xFF, 0xAA,0xEA,0xFF, 0xBB,0xFB,0xFF, 0xCC,0xFF,0xFF,
884884   /* Turquoise */
885   0x00,0x1C,0x1C, 0x00,0x2D,0x32, 0x00,0x3E,0x49, 0x00,0x4F,0x5F,
886   0x05,0x60,0x73, 0x16,0x71,0x84, 0x27,0x82,0x95, 0x38,0x93,0xA6,
887   0x49,0xA4,0xB7, 0x5A,0xB5,0xC8, 0x6B,0xC6,0xD9, 0x7C,0xD7,0xEA,
885   0x00,0x1C,0x1C, 0x00,0x2D,0x32, 0x00,0x3E,0x49, 0x00,0x4F,0x5F,
886   0x05,0x60,0x73, 0x16,0x71,0x84, 0x27,0x82,0x95, 0x38,0x93,0xA6,
887   0x49,0xA4,0xB7, 0x5A,0xB5,0xC8, 0x6B,0xC6,0xD9, 0x7C,0xD7,0xEA,
888888   0x8D,0xE8,0xFB, 0x9E,0xF9,0xFF, 0xAF,0xFF,0xFF, 0xC0,0xFF,0xFF,
889889   /* Green-Blue */
890   0x00,0x25,0x0B, 0x00,0x36,0x10, 0x00,0x47,0x18, 0x00,0x58,0x2E,
891   0x07,0x69,0x42, 0x18,0x7A,0x53, 0x29,0x8B,0x64, 0x3A,0x9C,0x75,
892   0x4B,0xAD,0x86, 0x5C,0xBE,0x97, 0x6D,0xCF,0xA8, 0x7E,0xE0,0xB9,
890   0x00,0x25,0x0B, 0x00,0x36,0x10, 0x00,0x47,0x18, 0x00,0x58,0x2E,
891   0x07,0x69,0x42, 0x18,0x7A,0x53, 0x29,0x8B,0x64, 0x3A,0x9C,0x75,
892   0x4B,0xAD,0x86, 0x5C,0xBE,0x97, 0x6D,0xCF,0xA8, 0x7E,0xE0,0xB9,
893893   0x8F,0xF1,0xCA, 0xA0,0xFF,0xDA, 0xB1,0xFF,0xE6, 0xC2,0xFF,0xF2,
894894   /* Green */
895   0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x04,0x5A,0x1A,
896   0x15,0x6B,0x1A, 0x26,0x7C,0x22, 0x37,0x8D,0x33, 0x48,0x9E,0x44,
897   0x59,0xAF,0x55, 0x6A,0xC0,0x66, 0x7B,0xD1,0x77, 0x8C,0xE2,0x88,
895   0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x04,0x5A,0x1A,
896   0x15,0x6B,0x1A, 0x26,0x7C,0x22, 0x37,0x8D,0x33, 0x48,0x9E,0x44,
897   0x59,0xAF,0x55, 0x6A,0xC0,0x66, 0x7B,0xD1,0x77, 0x8C,0xE2,0x88,
898898   0x9D,0xF3,0x99, 0xAE,0xFF,0xA8, 0xBF,0xFF,0xB4, 0xD0,0xFF,0xC0,
899899   /* Yellow-Green */
900   0x00,0x21,0x0A, 0x00,0x32,0x0F, 0x0A,0x43,0x11, 0x1B,0x54,0x11,
901   0x2C,0x65,0x11, 0x3D,0x76,0x11, 0x4E,0x87,0x11, 0x5F,0x98,0x1E,
902   0x70,0xA9,0x2F, 0x81,0xBA,0x40, 0x92,0xCB,0x51, 0xA3,0xDC,0x62,
900   0x00,0x21,0x0A, 0x00,0x32,0x0F, 0x0A,0x43,0x11, 0x1B,0x54,0x11,
901   0x2C,0x65,0x11, 0x3D,0x76,0x11, 0x4E,0x87,0x11, 0x5F,0x98,0x1E,
902   0x70,0xA9,0x2F, 0x81,0xBA,0x40, 0x92,0xCB,0x51, 0xA3,0xDC,0x62,
903903   0xB4,0xED,0x73, 0xC5,0xFE,0x84, 0xD6,0xFF,0x90, 0xE7,0xFF,0x9C,
904904   /* Orange-Green */
905   0x05,0x13,0x04, 0x16,0x24,0x04, 0x27,0x35,0x04, 0x38,0x46,0x04,
906   0x49,0x57,0x04, 0x5A,0x68,0x04, 0x6B,0x79,0x04, 0x7C,0x8A,0x09,
907   0x8D,0x9B,0x1A, 0x9E,0xAC,0x2B, 0xAF,0xBD,0x3C, 0xC0,0xCE,0x4D,
905   0x05,0x13,0x04, 0x16,0x24,0x04, 0x27,0x35,0x04, 0x38,0x46,0x04,
906   0x49,0x57,0x04, 0x5A,0x68,0x04, 0x6B,0x79,0x04, 0x7C,0x8A,0x09,
907   0x8D,0x9B,0x1A, 0x9E,0xAC,0x2B, 0xAF,0xBD,0x3C, 0xC0,0xCE,0x4D,
908908   0xD1,0xDF,0x5E, 0xE2,0xF0,0x6F, 0xF3,0xFF,0x80, 0xFF,0xFF,0x8D,
909909   /* Light-Orange */
910   0x21,0x02,0x00, 0x32,0x13,0x00, 0x43,0x24,0x00, 0x54,0x35,0x00,
911   0x65,0x46,0x00, 0x76,0x57,0x00, 0x87,0x68,0x00, 0x98,0x79,0x0C,
912   0xA9,0x8A,0x1D, 0xBA,0x9B,0x2E, 0xCB,0xAC,0x3F, 0xDC,0xBD,0x50,
910   0x21,0x02,0x00, 0x32,0x13,0x00, 0x43,0x24,0x00, 0x54,0x35,0x00,
911   0x65,0x46,0x00, 0x76,0x57,0x00, 0x87,0x68,0x00, 0x98,0x79,0x0C,
912   0xA9,0x8A,0x1D, 0xBA,0x9B,0x2E, 0xCB,0xAC,0x3F, 0xDC,0xBD,0x50,
913913   0xED,0xCE,0x61, 0xFE,0xDF,0x72, 0xFF,0xF0,0x87, 0xFF,0xFF,0x9D
914914};
915915
r26736r26737
928928    PALETTE - PHASE 24.7 SHIFT
929929
930930GREY
931    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
932    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
933    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
934    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,   
931    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
932    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
933    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
934    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
935935
936936GOLD
937    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
938    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
939    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
940    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,   
937    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
938    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
939    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
940    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,
941941
942942ORANGE
943    0x30,0x00,0x00, 0x41,0x07,0x00, 0x52,0x18,0x00, 0x63,0x29,0x00,
944    0x74,0x3A,0x00, 0x85,0x4B,0x00, 0x96,0x5C,0x0A, 0xA7,0x6D,0x1B,
945    0xB8,0x7E,0x2C, 0xC9,0x8F,0x3D, 0xDA,0xA0,0x4E, 0xEB,0xB1,0x5F,
946    0xFC,0xC2,0x70, 0xFF,0xD3,0x85, 0xFF,0xE4,0x9B, 0xFF,0xF5,0xB1,   
943    0x30,0x00,0x00, 0x41,0x07,0x00, 0x52,0x18,0x00, 0x63,0x29,0x00,
944    0x74,0x3A,0x00, 0x85,0x4B,0x00, 0x96,0x5C,0x0A, 0xA7,0x6D,0x1B,
945    0xB8,0x7E,0x2C, 0xC9,0x8F,0x3D, 0xDA,0xA0,0x4E, 0xEB,0xB1,0x5F,
946    0xFC,0xC2,0x70, 0xFF,0xD3,0x85, 0xFF,0xE4,0x9B, 0xFF,0xF5,0xB1,
947947
948948RED-ORANGE
949    0x3D,0x00,0x00, 0x4E,0x00,0x00, 0x5F,0x09,0x00, 0x70,0x1A,0x00,
950    0x81,0x2B,0x09, 0x92,0x3C,0x1A, 0xA3,0x4D,0x2B, 0xB4,0x5E,0x3C,
951    0xC5,0x6F,0x4D, 0xD6,0x80,0x5E, 0xE7,0x91,0x6F, 0xF8,0xA2,0x80,
952    0xFF,0xB3,0x94, 0xFF,0xC4,0xAA, 0xFF,0xD5,0xC0, 0xFF,0xE6,0xD6,   
949    0x3D,0x00,0x00, 0x4E,0x00,0x00, 0x5F,0x09,0x00, 0x70,0x1A,0x00,
950    0x81,0x2B,0x09, 0x92,0x3C,0x1A, 0xA3,0x4D,0x2B, 0xB4,0x5E,0x3C,
951    0xC5,0x6F,0x4D, 0xD6,0x80,0x5E, 0xE7,0x91,0x6F, 0xF8,0xA2,0x80,
952    0xFF,0xB3,0x94, 0xFF,0xC4,0xAA, 0xFF,0xD5,0xC0, 0xFF,0xE6,0xD6,
953953
954954PINK
955    0x3F,0x00,0x00, 0x50,0x00,0x09, 0x61,0x00,0x15, 0x72,0x10,0x26,
956    0x83,0x21,0x37, 0x94,0x32,0x48, 0xA5,0x43,0x59, 0xB6,0x54,0x6A,
957    0xC7,0x65,0x7B, 0xD8,0x76,0x8C, 0xE9,0x87,0x9D, 0xFA,0x98,0xAE,
958    0xFF,0xA9,0xC2, 0xFF,0xBA,0xD8, 0xFF,0xCB,0xEE, 0xFF,0xDC,0xF4,   
955    0x3F,0x00,0x00, 0x50,0x00,0x09, 0x61,0x00,0x15, 0x72,0x10,0x26,
956    0x83,0x21,0x37, 0x94,0x32,0x48, 0xA5,0x43,0x59, 0xB6,0x54,0x6A,
957    0xC7,0x65,0x7B, 0xD8,0x76,0x8C, 0xE9,0x87,0x9D, 0xFA,0x98,0xAE,
958    0xFF,0xA9,0xC2, 0xFF,0xBA,0xD8, 0xFF,0xCB,0xEE, 0xFF,0xDC,0xF4,
959959
960960PURPLE
961    0x36,0x00,0x2E, 0x47,0x00,0x3A, 0x58,0x00,0x46, 0x69,0x0C,0x55,
962    0x7A,0x1D,0x66, 0x8B,0x2E,0x77, 0x9C,0x3F,0x88, 0xAD,0x50,0x99,
963    0xBE,0x61,0xAA, 0xCF,0x72,0xBB, 0xE0,0x83,0xCC, 0xF1,0x94,0xDD,
964    0xFF,0xA5,0xE4, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,   
961    0x36,0x00,0x2E, 0x47,0x00,0x3A, 0x58,0x00,0x46, 0x69,0x0C,0x55,
962    0x7A,0x1D,0x66, 0x8B,0x2E,0x77, 0x9C,0x3F,0x88, 0xAD,0x50,0x99,
963    0xBE,0x61,0xAA, 0xCF,0x72,0xBB, 0xE0,0x83,0xCC, 0xF1,0x94,0xDD,
964    0xFF,0xA5,0xE4, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,
965965
966966PURPLE-BLUE
967    0x23,0x00,0x55, 0x34,0x00,0x61, 0x45,0x00,0x6D, 0x56,0x0F,0x7E,
968    0x67,0x20,0x8F, 0x78,0x31,0xA0, 0x89,0x42,0xB1, 0x9A,0x53,0xC2,
969    0xAB,0x64,0xD3, 0xBC,0x75,0xE4, 0xCD,0x86,0xEA, 0xDE,0x97,0xEA,
970    0xEF,0xA8,0xEA, 0xFF,0xB9,0xEA, 0xFF,0xCA,0xEF, 0xFF,0xDB,0xF4,   
967    0x23,0x00,0x55, 0x34,0x00,0x61, 0x45,0x00,0x6D, 0x56,0x0F,0x7E,
968    0x67,0x20,0x8F, 0x78,0x31,0xA0, 0x89,0x42,0xB1, 0x9A,0x53,0xC2,
969    0xAB,0x64,0xD3, 0xBC,0x75,0xE4, 0xCD,0x86,0xEA, 0xDE,0x97,0xEA,
970    0xEF,0xA8,0xEA, 0xFF,0xB9,0xEA, 0xFF,0xCA,0xEF, 0xFF,0xDB,0xF4,
971971
972972BLUE1
973    0x09,0x00,0x6E, 0x1A,0x00,0x7A, 0x2B,0x08,0x88, 0x3C,0x19,0x99,
974    0x4D,0x2A,0xAA, 0x5E,0x3B,0xBB, 0x6F,0x4C,0xCC, 0x80,0x5D,0xDD,
975    0x91,0x6E,0xEE, 0xA2,0x7F,0xF4, 0xB3,0x90,0xF4, 0xC4,0xA1,0xF4,
976    0xD5,0xB2,0xF4, 0xE6,0xC3,0xF4, 0xF7,0xD4,0xF4, 0xFF,0xE5,0xF7,   
973    0x09,0x00,0x6E, 0x1A,0x00,0x7A, 0x2B,0x08,0x88, 0x3C,0x19,0x99,
974    0x4D,0x2A,0xAA, 0x5E,0x3B,0xBB, 0x6F,0x4C,0xCC, 0x80,0x5D,0xDD,
975    0x91,0x6E,0xEE, 0xA2,0x7F,0xF4, 0xB3,0x90,0xF4, 0xC4,0xA1,0xF4,
976    0xD5,0xB2,0xF4, 0xE6,0xC3,0xF4, 0xF7,0xD4,0xF4, 0xFF,0xE5,0xF7,
977977
978978BLUE2
979    0x00,0x00,0x6D, 0x00,0x05,0x80, 0x10,0x16,0x91, 0x21,0x27,0xA2,
980    0x32,0x38,0xB3, 0x43,0x49,0xC4, 0x54,0x5A,0xD5, 0x65,0x6B,0xE6,
981    0x76,0x7C,0xF7, 0x87,0x8D,0xFF, 0x98,0x9E,0xFF, 0xA9,0xAF,0xFF,
982    0xBA,0xC0,0xFF, 0xCB,0xD1,0xFF, 0xDC,0xE2,0xFF, 0xED,0xF3,0xFF   
979    0x00,0x00,0x6D, 0x00,0x05,0x80, 0x10,0x16,0x91, 0x21,0x27,0xA2,
980    0x32,0x38,0xB3, 0x43,0x49,0xC4, 0x54,0x5A,0xD5, 0x65,0x6B,0xE6,
981    0x76,0x7C,0xF7, 0x87,0x8D,0xFF, 0x98,0x9E,0xFF, 0xA9,0xAF,0xFF,
982    0xBA,0xC0,0xFF, 0xCB,0xD1,0xFF, 0xDC,0xE2,0xFF, 0xED,0xF3,0xFF
983983
984984LIGHT-BLUE
985    0x00,0x05,0x57, 0x00,0x16,0x6E, 0x00,0x27,0x84, 0x09,0x38,0x97,
986    0x1A,0x49,0xA8, 0x2B,0x5A,0xB9, 0x3C,0x6B,0xCA, 0x4D,0x7C,0xDB,
987    0x5E,0x8D,0xEC, 0x6F,0x9E,0xFD, 0x80,0xAF,0xFF, 0x91,0xC0,0xFF,
988    0xA2,0xD1,0xFF, 0xB3,0xE2,0xFF, 0xC4,0xF3,0xFF, 0xD5,0xFF,0xFF,   
985    0x00,0x05,0x57, 0x00,0x16,0x6E, 0x00,0x27,0x84, 0x09,0x38,0x97,
986    0x1A,0x49,0xA8, 0x2B,0x5A,0xB9, 0x3C,0x6B,0xCA, 0x4D,0x7C,0xDB,
987    0x5E,0x8D,0xEC, 0x6F,0x9E,0xFD, 0x80,0xAF,0xFF, 0x91,0xC0,0xFF,
988    0xA2,0xD1,0xFF, 0xB3,0xE2,0xFF, 0xC4,0xF3,0xFF, 0xD5,0xFF,0xFF,
989989
990990TURQUOISE
991    0x00,0x15,0x34, 0x00,0x26,0x4A, 0x00,0x37,0x60, 0x00,0x48,0x77,
992    0x0A,0x59,0x8A, 0x1B,0x6A,0x9B, 0x2C,0x7B,0xAC, 0x3D,0x8C,0xBD,
993    0x4E,0x9D,0xCE, 0x5F,0xAE,0xDF, 0x70,0xBF,0xF0, 0x81,0xD0,0xFF,
994    0x92,0xE1,0xFF, 0xA3,0xF2,0xFF, 0xB4,0xFF,0xFF, 0xC5,0xFF,0xFF   
991    0x00,0x15,0x34, 0x00,0x26,0x4A, 0x00,0x37,0x60, 0x00,0x48,0x77,
992    0x0A,0x59,0x8A, 0x1B,0x6A,0x9B, 0x2C,0x7B,0xAC, 0x3D,0x8C,0xBD,
993    0x4E,0x9D,0xCE, 0x5F,0xAE,0xDF, 0x70,0xBF,0xF0, 0x81,0xD0,0xFF,
994    0x92,0xE1,0xFF, 0xA3,0xF2,0xFF, 0xB4,0xFF,0xFF, 0xC5,0xFF,0xFF
995995
996996GREEN-BLUE
997    0x00,0x21,0x0A, 0x00,0x32,0x1F, 0x00,0x43,0x35, 0x00,0x54,0x4B,
998    0x04,0x65,0x60, 0x15,0x76,0x71, 0x26,0x87,0x82, 0x37,0x98,0x93,
999    0x48,0xA9,0xA4, 0x59,0xBA,0xB5, 0x6A,0xCB,0xC6, 0x7B,0xDC,0xD7,
1000    0x8C,0xED,0xE8, 0x9D,0xFE,0xF9, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,   
997    0x00,0x21,0x0A, 0x00,0x32,0x1F, 0x00,0x43,0x35, 0x00,0x54,0x4B,
998    0x04,0x65,0x60, 0x15,0x76,0x71, 0x26,0x87,0x82, 0x37,0x98,0x93,
999    0x48,0xA9,0xA4, 0x59,0xBA,0xB5, 0x6A,0xCB,0xC6, 0x7B,0xDC,0xD7,
1000    0x8C,0xED,0xE8, 0x9D,0xFE,0xF9, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,
10011001
10021002GREEN
1003    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1D,
1004    0x0A,0x6B,0x30, 0x1B,0x7C,0x41, 0x2C,0x8D,0x52, 0x3D,0x9E,0x63,
1005    0x4E,0xAF,0x74, 0x5F,0xC0,0x85, 0x70,0xD1,0x96, 0x81,0xE2,0xA7,
1006    0x92,0xF3,0xB8, 0xA3,0xFF,0xC8, 0xB4,0xFF,0xD3, 0xC5,0xFF,0xDF,   
1003    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1D,
1004    0x0A,0x6B,0x30, 0x1B,0x7C,0x41, 0x2C,0x8D,0x52, 0x3D,0x9E,0x63,
1005    0x4E,0xAF,0x74, 0x5F,0xC0,0x85, 0x70,0xD1,0x96, 0x81,0xE2,0xA7,
1006    0x92,0xF3,0xB8, 0xA3,0xFF,0xC8, 0xB4,0xFF,0xD3, 0xC5,0xFF,0xDF,
10071007
10081008YELLOW-GREEN
1009    0x00,0x26,0x0B, 0x00,0x37,0x10, 0x00,0x48,0x16, 0x0A,0x59,0x18,
1010    0x1B,0x6A,0x18, 0x2C,0x7B,0x18, 0x3D,0x8C,0x27, 0x4E,0x9D,0x38,
1011    0x5F,0xAE,0x49, 0x70,0xBF,0x5A, 0x81,0xD0,0x6B, 0x92,0xE1,0x7C,
1012    0xA3,0xF2,0x8D, 0xB4,0xFF,0x9C, 0xC5,0xFF,0xA8, 0xD6,0xFF,0xB4,   
1009    0x00,0x26,0x0B, 0x00,0x37,0x10, 0x00,0x48,0x16, 0x0A,0x59,0x18,
1010    0x1B,0x6A,0x18, 0x2C,0x7B,0x18, 0x3D,0x8C,0x27, 0x4E,0x9D,0x38,
1011    0x5F,0xAE,0x49, 0x70,0xBF,0x5A, 0x81,0xD0,0x6B, 0x92,0xE1,0x7C,
1012    0xA3,0xF2,0x8D, 0xB4,0xFF,0x9C, 0xC5,0xFF,0xA8, 0xD6,0xFF,0xB4,
10131013
10141014ORANGE-GREEN
1015    0x00,0x1E,0x09, 0x00,0x2F,0x0E, 0x11,0x40,0x0E, 0x22,0x51,0x0E,
1016    0x33,0x62,0x0E, 0x44,0x73,0x0E, 0x55,0x84,0x0E, 0x66,0x95,0x17,
1017    0x77,0xA6,0x28, 0x88,0xB7,0x39, 0x99,0xC8,0x4A, 0xAA,0xD9,0x5B,
1018    0xBB,0xEA,0x6C, 0xCC,0xFB,0x7D, 0xDD,0xFF,0x8A, 0xEE,0xFF,0x96,   
1015    0x00,0x1E,0x09, 0x00,0x2F,0x0E, 0x11,0x40,0x0E, 0x22,0x51,0x0E,
1016    0x33,0x62,0x0E, 0x44,0x73,0x0E, 0x55,0x84,0x0E, 0x66,0x95,0x17,
1017    0x77,0xA6,0x28, 0x88,0xB7,0x39, 0x99,0xC8,0x4A, 0xAA,0xD9,0x5B,
1018    0xBB,0xEA,0x6C, 0xCC,0xFB,0x7D, 0xDD,0xFF,0x8A, 0xEE,0xFF,0x96,
10191019
10201020LIGHT-ORANGE
1021    0x0A,0x11,0x02, 0x1B,0x22,0x02, 0x2C,0x33,0x02, 0x3D,0x44,0x02,
1022    0x4E,0x55,0x02, 0x5F,0x66,0x02, 0x70,0x77,0x02, 0x81,0x88,0x09,
1023    0x92,0x99,0x1A, 0xA3,0xAA,0x2B, 0xB4,0xBB,0x3C, 0xC5,0xCC,0x4D,
1024    0xD6,0xDD,0x5E, 0xE7,0xEE,0x6F, 0xF8,0xFF,0x80, 0xFF,0xFF,0x8F,   
1021    0x0A,0x11,0x02, 0x1B,0x22,0x02, 0x2C,0x33,0x02, 0x3D,0x44,0x02,
1022    0x4E,0x55,0x02, 0x5F,0x66,0x02, 0x70,0x77,0x02, 0x81,0x88,0x09,
1023    0x92,0x99,0x1A, 0xA3,0xAA,0x2B, 0xB4,0xBB,0x3C, 0xC5,0xCC,0x4D,
1024    0xD6,0xDD,0x5E, 0xE7,0xEE,0x6F, 0xF8,0xFF,0x80, 0xFF,0xFF,0x8F,
10251025*******************************************************************
10261026
10271027*******************************************************************
10281028    PALETTE - PHASE 25.2 SHIFT
10291029
10301030GREY
1031    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1032    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1033    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1034    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,   
1031    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1032    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1033    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1034    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
10351035
10361036GOLD
1037    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1038    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1039    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1040    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,   
1037    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1038    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1039    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1040    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,
10411041
10421042ORANGE
1043    0x30,0x00,0x00, 0x41,0x07,0x00, 0x52,0x18,0x00, 0x63,0x29,0x00,
1044    0x74,0x3A,0x00, 0x85,0x4B,0x00, 0x96,0x5C,0x0A, 0xA7,0x6D,0x1B,
1045    0xB8,0x7E,0x2C, 0xC9,0x8F,0x3D, 0xDA,0xA0,0x4E, 0xEB,0xB1,0x5F,
1046    0xFC,0xC2,0x70, 0xFF,0xD3,0x85, 0xFF,0xE4,0x9B, 0xFF,0xF5,0xB1,   
1043    0x30,0x00,0x00, 0x41,0x07,0x00, 0x52,0x18,0x00, 0x63,0x29,0x00,
1044    0x74,0x3A,0x00, 0x85,0x4B,0x00, 0x96,0x5C,0x0A, 0xA7,0x6D,0x1B,
1045    0xB8,0x7E,0x2C, 0xC9,0x8F,0x3D, 0xDA,0xA0,0x4E, 0xEB,0xB1,0x5F,
1046    0xFC,0xC2,0x70, 0xFF,0xD3,0x85, 0xFF,0xE4,0x9B, 0xFF,0xF5,0xB1,
10471047
10481048RED-ORANGE
1049    0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x09,0x00, 0x71,0x1A,0x00,
1050    0x82,0x2B,0x0B, 0x93,0x3C,0x1C, 0xA4,0x4D,0x2D, 0xB5,0x5E,0x3E,
1051    0xC6,0x6F,0x4F, 0xD7,0x80,0x60, 0xE8,0x91,0x71, 0xF9,0xA2,0x82,
1052    0xFF,0xB3,0x96, 0xFF,0xC4,0xAC, 0xFF,0xD5,0xC2, 0xFF,0xE6,0xD8,   
1049    0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x09,0x00, 0x71,0x1A,0x00,
1050    0x82,0x2B,0x0B, 0x93,0x3C,0x1C, 0xA4,0x4D,0x2D, 0xB5,0x5E,0x3E,
1051    0xC6,0x6F,0x4F, 0xD7,0x80,0x60, 0xE8,0x91,0x71, 0xF9,0xA2,0x82,
1052    0xFF,0xB3,0x96, 0xFF,0xC4,0xAC, 0xFF,0xD5,0xC2, 0xFF,0xE6,0xD8,
10531053
10541054PINK
1055    0x3F,0x00,0x00, 0x50,0x00,0x0C, 0x61,0x00,0x18, 0x72,0x0F,0x28,
1056    0x83,0x20,0x39, 0x94,0x31,0x4A, 0xA5,0x42,0x5B, 0xB6,0x53,0x6C,
1057    0xC7,0x64,0x7D, 0xD8,0x75,0x8E, 0xE9,0x86,0x9F, 0xFA,0x97,0xB0,
1058    0xFF,0xA8,0xC5, 0xFF,0xB9,0xDB, 0xFF,0xCA,0xEF, 0xFF,0xDB,0xF4,   
1055    0x3F,0x00,0x00, 0x50,0x00,0x0C, 0x61,0x00,0x18, 0x72,0x0F,0x28,
1056    0x83,0x20,0x39, 0x94,0x31,0x4A, 0xA5,0x42,0x5B, 0xB6,0x53,0x6C,
1057    0xC7,0x64,0x7D, 0xD8,0x75,0x8E, 0xE9,0x86,0x9F, 0xFA,0x97,0xB0,
1058    0xFF,0xA8,0xC5, 0xFF,0xB9,0xDB, 0xFF,0xCA,0xEF, 0xFF,0xDB,0xF4,
10591059
10601060PURPLE
1061    0x35,0x00,0x31, 0x46,0x00,0x3D, 0x57,0x00,0x49, 0x68,0x0C,0x58,
1062    0x79,0x1D,0x69, 0x8A,0x2E,0x7A, 0x9B,0x3F,0x8B, 0xAC,0x50,0x9C,
1063    0xBD,0x61,0xAD, 0xCE,0x72,0xBE, 0xDF,0x83,0xCF, 0xF0,0x94,0xE0,
1064    0xFF,0xA5,0xE4, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,   
1061    0x35,0x00,0x31, 0x46,0x00,0x3D, 0x57,0x00,0x49, 0x68,0x0C,0x58,
1062    0x79,0x1D,0x69, 0x8A,0x2E,0x7A, 0x9B,0x3F,0x8B, 0xAC,0x50,0x9C,
1063    0xBD,0x61,0xAD, 0xCE,0x72,0xBE, 0xDF,0x83,0xCF, 0xF0,0x94,0xE0,
1064    0xFF,0xA5,0xE4, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,
10651065
10661066PURPLE-BLUE
1067    0x20,0x00,0x59, 0x31,0x00,0x65, 0x42,0x00,0x71, 0x53,0x10,0x82,
1068    0x64,0x21,0x93, 0x75,0x32,0xA4, 0x86,0x43,0xB5, 0x97,0x54,0xC6,
1069    0xA8,0x65,0xD7, 0xB9,0x76,0xE8, 0xCA,0x87,0xEB, 0xDB,0x98,0xEB,
1070    0xEC,0xA9,0xEB, 0xFD,0xBA,0xEB, 0xFF,0xCB,0xEF, 0xFF,0xDC,0xF4,   
1067    0x20,0x00,0x59, 0x31,0x00,0x65, 0x42,0x00,0x71, 0x53,0x10,0x82,
1068    0x64,0x21,0x93, 0x75,0x32,0xA4, 0x86,0x43,0xB5, 0x97,0x54,0xC6,
1069    0xA8,0x65,0xD7, 0xB9,0x76,0xE8, 0xCA,0x87,0xEB, 0xDB,0x98,0xEB,
1070    0xEC,0xA9,0xEB, 0xFD,0xBA,0xEB, 0xFF,0xCB,0xEF, 0xFF,0xDC,0xF4,
10711071
10721072BLUE1
1073    0x05,0x00,0x70, 0x16,0x00,0x7C, 0x27,0x09,0x8B, 0x38,0x1A,0x9C,
1074    0x49,0x2B,0xAD, 0x5A,0x3C,0xBE, 0x6B,0x4D,0xCF, 0x7C,0x5E,0xE0,
1075    0X8D,0x6F,0xF1, 0x9E,0x80,0xF6, 0xAF,0x91,0xF6, 0xC0,0xA2,0xF6,
1076    0xD1,0xB3,0xF6, 0xE2,0xC4,0xF6, 0xF3,0xD5,0xF6, 0xFF,0xE6,0xF7,   
1073    0x05,0x00,0x70, 0x16,0x00,0x7C, 0x27,0x09,0x8B, 0x38,0x1A,0x9C,
1074    0x49,0x2B,0xAD, 0x5A,0x3C,0xBE, 0x6B,0x4D,0xCF, 0x7C,0x5E,0xE0,
1075    0X8D,0x6F,0xF1, 0x9E,0x80,0xF6, 0xAF,0x91,0xF6, 0xC0,0xA2,0xF6,
1076    0xD1,0xB3,0xF6, 0xE2,0xC4,0xF6, 0xF3,0xD5,0xF6, 0xFF,0xE6,0xF7,
10771077
10781078BLUE2
1079    0x00,0x00,0x6B, 0x00,0x08,0x7E, 0x0C,0x19,0x91, 0x1D,0x2A,0xA2,
1080    0x2E,0x3B,0xB3, 0x3F,0x4C,0xC4, 0x50,0x5D,0xD5, 0x61,0x6E,0xE6,
1081    0x72,0x7F,0xF7, 0x83,0x90,0xFF, 0x94,0xA1,0xFF, 0xA5,0xB2,0xFF,
1082    0xB6,0xC3,0xFF, 0xC7,0xD4,0xFF, 0xD8,0xE5,0xFF, 0xE9,0xF6,0xFF,   
1079    0x00,0x00,0x6B, 0x00,0x08,0x7E, 0x0C,0x19,0x91, 0x1D,0x2A,0xA2,
1080    0x2E,0x3B,0xB3, 0x3F,0x4C,0xC4, 0x50,0x5D,0xD5, 0x61,0x6E,0xE6,
1081    0x72,0x7F,0xF7, 0x83,0x90,0xFF, 0x94,0xA1,0xFF, 0xA5,0xB2,0xFF,
1082    0xB6,0xC3,0xFF, 0xC7,0xD4,0xFF, 0xD8,0xE5,0xFF, 0xE9,0xF6,0xFF,
10831083
10841084LIGHT-BLUE
1085    0x00,0x08,0x52, 0x00,0x19,0x68, 0x00,0x2A,0x7F, 0x05,0x3B,0x93,
1086    0x16,0x4C,0xA4, 0x27,0x5D,0xB5, 0x38,0x6E,0xC6, 0x49,0x7F,0xD7,
1087    0x5A,0x90,0xE8, 0x6B,0xA1,0xF9, 0x7C,0xB2,0xFF, 0x8D,0xC3,0xFF,
1088    0x9E,0xD4,0xFF, 0xAF,0xE5,0xFF, 0xC0,0xF6,0xFF, 0xD1,0xFF,0xFF,   
1085    0x00,0x08,0x52, 0x00,0x19,0x68, 0x00,0x2A,0x7F, 0x05,0x3B,0x93,
1086    0x16,0x4C,0xA4, 0x27,0x5D,0xB5, 0x38,0x6E,0xC6, 0x49,0x7F,0xD7,
1087    0x5A,0x90,0xE8, 0x6B,0xA1,0xF9, 0x7C,0xB2,0xFF, 0x8D,0xC3,0xFF,
1088    0x9E,0xD4,0xFF, 0xAF,0xE5,0xFF, 0xC0,0xF6,0xFF, 0xD1,0xFF,0xFF,
10891089
10901090TURQUOISE
1091    0x00,0x17,0x2D, 0x00,0x28,0x43, 0x00,0x39,0x59, 0x00,0x4A,0x6F,
1092    0x08,0x5B,0x83, 0x19,0x6C,0x94, 0x2A,0x7D,0xA5, 0x3B,0x8E,0xB6,
1093    0x4C,0x9F,0xC7, 0x5D,0xB0,0xD8, 0x6E,0xC1,0xE9, 0x7F,0xD2,0xFA,
1094    0x90,0xE3,0xFF, 0xA1,0xF4,0xFF, 0xB2,0xFF,0xFF, 0xC3,0xFF,0xFF,   
1091    0x00,0x17,0x2D, 0x00,0x28,0x43, 0x00,0x39,0x59, 0x00,0x4A,0x6F,
1092    0x08,0x5B,0x83, 0x19,0x6C,0x94, 0x2A,0x7D,0xA5, 0x3B,0x8E,0xB6,
1093    0x4C,0x9F,0xC7, 0x5D,0xB0,0xD8, 0x6E,0xC1,0xE9, 0x7F,0xD2,0xFA,
1094    0x90,0xE3,0xFF, 0xA1,0xF4,0xFF, 0xB2,0xFF,0xFF, 0xC3,0xFF,0xFF,
10951095
10961096GREEN-BLUE
1097    0x00,0x23,0x0A, 0x00,0x34,0x15, 0x00,0x45,0x2B, 0x00,0x56,0x41,
1098    0x04,0x67,0x56, 0x15,0x78,0x67, 0x26,0x89,0x78, 0x37,0x9A,0x89,
1099    0x48,0xAB,0x9A, 0x59,0xBC,0xAB, 0x6A,0xCD,0xBC, 0x7B,0xDE,0xCD,
1100    0x8C,0xEF,0xDE, 0x9D,0xFF,0xEE, 0xAE,0xFF,0xFA, 0xBF,0xFF,0xFF,   
1097    0x00,0x23,0x0A, 0x00,0x34,0x15, 0x00,0x45,0x2B, 0x00,0x56,0x41,
1098    0x04,0x67,0x56, 0x15,0x78,0x67, 0x26,0x89,0x78, 0x37,0x9A,0x89,
1099    0x48,0xAB,0x9A, 0x59,0xBC,0xAB, 0x6A,0xCD,0xBC, 0x7B,0xDE,0xCD,
1100    0x8C,0xEF,0xDE, 0x9D,0xFF,0xEE, 0xAE,0xFF,0xFA, 0xBF,0xFF,0xFF,
11011101
11021102GREEN
1103    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1B,
1104    0x0D,0x6B,0x25, 0x1E,0x7C,0x36, 0x2F,0x8D,0x47, 0x40,0x9E,0x58,
1105    0x51,0xAF,0x69, 0x62,0xC0,0x7A, 0x73,0xD1,0x8B, 0x84,0xE2,0x9C,
1106    0x95,0xF3,0xAD, 0xA6,0xFF,0xBD, 0xB7,0xFF,0xC9, 0xC8,0xFF,0xD4,   
1103    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1B,
1104    0x0D,0x6B,0x25, 0x1E,0x7C,0x36, 0x2F,0x8D,0x47, 0x40,0x9E,0x58,
1105    0x51,0xAF,0x69, 0x62,0xC0,0x7A, 0x73,0xD1,0x8B, 0x84,0xE2,0x9C,
1106    0x95,0xF3,0xAD, 0xA6,0xFF,0xBD, 0xB7,0xFF,0xC9, 0xC8,0xFF,0xD4,
11071107
11081108YELLOW-GREEN
1109    0x00,0x24,0x0B, 0x00,0x35,0x10, 0x00,0x46,0x15, 0x10,0x57,0x15,
1110    0x21,0x68,0x15, 0x32,0x79,0x15, 0x43,0x8A,0x1C, 0x54,0x9B,0x2D,
1111    0x65,0xAC,0x3E, 0x76,0xBD,0x4F, 0x87,0xCE,0x60, 0x98,0xDF,0x71,
1112    0xA9,0xF0,0x82, 0xBA,0xFF,0x93, 0xCB,0xFF,0x9F, 0xDC,0xFF,0xAA,   
1109    0x00,0x24,0x0B, 0x00,0x35,0x10, 0x00,0x46,0x15, 0x10,0x57,0x15,
1110    0x21,0x68,0x15, 0x32,0x79,0x15, 0x43,0x8A,0x1C, 0x54,0x9B,0x2D,
1111    0x65,0xAC,0x3E, 0x76,0xBD,0x4F, 0x87,0xCE,0x60, 0x98,0xDF,0x71,
1112    0xA9,0xF0,0x82, 0xBA,0xFF,0x93, 0xCB,0xFF,0x9F, 0xDC,0xFF,0xAA,
11131113
11141114ORANGE-GREEN
1115    0x00,0x1B,0x08, 0x08,0x2C,0x0B, 0x19,0x3D,0x0B, 0x2A,0x4E,0x0B,
1116    0x3B,0x5F,0x0B, 0x4C,0x70,0x0B, 0x5D,0x81,0x0B, 0x6E,0x92,0x11,
1117    0x7F,0xA3,0x22, 0x90,0xB4,0x33, 0xA1,0xC5,0x44, 0xB2,0xD6,0x55,
1118    0xC3,0xE7,0x66, 0xD4,0xF8,0x77, 0xE5,0xFF,0x85, 0xF6,0xFF,0x91,   
1115    0x00,0x1B,0x08, 0x08,0x2C,0x0B, 0x19,0x3D,0x0B, 0x2A,0x4E,0x0B,
1116    0x3B,0x5F,0x0B, 0x4C,0x70,0x0B, 0x5D,0x81,0x0B, 0x6E,0x92,0x11,
1117    0x7F,0xA3,0x22, 0x90,0xB4,0x33, 0xA1,0xC5,0x44, 0xB2,0xD6,0x55,
1118    0xC3,0xE7,0x66, 0xD4,0xF8,0x77, 0xE5,0xFF,0x85, 0xF6,0xFF,0x91,
11191119
11201120LIGHT-ORANGE
1121    0x12,0x0C,0x00, 0x23,0x1D,0x00, 0x34,0x2E,0x00, 0x45,0x3F,0x00,
1122    0x56,0x50,0x00, 0x67,0x61,0x00, 0x78,0x72,0x00, 0x89,0x83,0x08,
1123    0x9A,0x94,0x19, 0xAB,0xA5,0x2A, 0xBC,0xB6,0x3B, 0xCD,0xC7,0x4C,
1124    0xDE,0xD8,0x5D, 0xEF,0xE9,0x6E, 0xFF,0xFA,0x80, 0xFF,0xFF,0x92,   
1121    0x12,0x0C,0x00, 0x23,0x1D,0x00, 0x34,0x2E,0x00, 0x45,0x3F,0x00,
1122    0x56,0x50,0x00, 0x67,0x61,0x00, 0x78,0x72,0x00, 0x89,0x83,0x08,
1123    0x9A,0x94,0x19, 0xAB,0xA5,0x2A, 0xBC,0xB6,0x3B, 0xCD,0xC7,0x4C,
1124    0xDE,0xD8,0x5D, 0xEF,0xE9,0x6E, 0xFF,0xFA,0x80, 0xFF,0xFF,0x92,
11251125*******************************************************************
11261126
11271127*******************************************************************
11281128    PALETTE - PHASE 25.7 SHIFT
11291129GREY
1130    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1131    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1132    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1133    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,   
1130    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1131    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1132    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1133    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
11341134
11351135GOLD
1136    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1137    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1138    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1139    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,   
1136    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1137    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1138    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1139    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,
11401140
11411141ORANGE
1142    0x31,0x00,0x00, 0x42,0x06,0x00, 0x53,0x17,0x00, 0x64,0x28,0x00,
1143    0x75,0x39,0x00, 0x86,0X4A,0x00, 0x97,0x5B,0x0A, 0xA8,0x6C,0x1B,
1144    0xB9,0x7D,0x2C, 0xCA,0x8E,0x3D, 0xDB,0x9F,0x4E, 0xEC,0xB0,0x5F,
1145    0xFD,0xC1,0x70, 0xFF,0xD2,0x85, 0xFF,0xE3,0x9C, 0xFF,0xF4,0xB2,   
1142    0x31,0x00,0x00, 0x42,0x06,0x00, 0x53,0x17,0x00, 0x64,0x28,0x00,
1143    0x75,0x39,0x00, 0x86,0X4A,0x00, 0x97,0x5B,0x0A, 0xA8,0x6C,0x1B,
1144    0xB9,0x7D,0x2C, 0xCA,0x8E,0x3D, 0xDB,0x9F,0x4E, 0xEC,0xB0,0x5F,
1145    0xFD,0xC1,0x70, 0xFF,0xD2,0x85, 0xFF,0xE3,0x9C, 0xFF,0xF4,0xB2,
11461146
11471147RED-ORANGE
1148    0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x08,0x00, 0x71,0x19,0x00,
1149    0x82,0x2A,0x0D, 0x93,0x3B,0x1E, 0xA4,0x4C,0x2F, 0xB5,0x5D,0x40,
1150    0xC6,0x6E,0x51, 0xD7,0x7F,0x62, 0xE8,0x90,0x73, 0xF9,0xA1,0x83,
1151    0xFF,0xB2,0x98, 0xFF,0xC3,0xAE, 0xFF,0xD4,0xC4, 0xFF,0xE5,0xDA,   
1148    0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x08,0x00, 0x71,0x19,0x00,
1149    0x82,0x2A,0x0D, 0x93,0x3B,0x1E, 0xA4,0x4C,0x2F, 0xB5,0x5D,0x40,
1150    0xC6,0x6E,0x51, 0xD7,0x7F,0x62, 0xE8,0x90,0x73, 0xF9,0xA1,0x83,
1151    0xFF,0xB2,0x98, 0xFF,0xC3,0xAE, 0xFF,0xD4,0xC4, 0xFF,0xE5,0xDA,
11521152
11531153PINK
1154    0x3F,0x00,0x03, 0x50,0x00,0x0F, 0x61,0x00,0x1B, 0x72,0x0F,0x2B,
1155    0x83,0x20,0x3C, 0x94,0x31,0x4D, 0xA5,0x42,0x5E, 0xB6,0x53,0x6F,
1156    0xC7,0x64,0x80, 0xD8,0x75,0x91, 0xE9,0x86,0xA2, 0xFA,0x97,0xB3,
1157    0xFF,0xA8,0xC8, 0xFF,0xB9,0xDE, 0xFF,0xCA,0xEF, 0xFF,0xDB,0xF4,   
1154    0x3F,0x00,0x03, 0x50,0x00,0x0F, 0x61,0x00,0x1B, 0x72,0x0F,0x2B,
1155    0x83,0x20,0x3C, 0x94,0x31,0x4D, 0xA5,0x42,0x5E, 0xB6,0x53,0x6F,
1156    0xC7,0x64,0x80, 0xD8,0x75,0x91, 0xE9,0x86,0xA2, 0xFA,0x97,0xB3,
1157    0xFF,0xA8,0xC8, 0xFF,0xB9,0xDE, 0xFF,0xCA,0xEF, 0xFF,0xDB,0xF4,
11581158
11591159PURPLE
1160    0x33,0x00,0x35, 0x44,0x00,0x41, 0x55,0x00,0x4C, 0x66,0x0C,0x5C,
1161    0x77,0x1D,0x6D, 0x88,0x2E,0x7E, 0x99,0x3F,0x8F, 0xAA,0x50,0xA0,
1162    0xBB,0x61,0xB1, 0xCC,0x72,0xC2, 0xDD,0x83,0xD3, 0xEE,0x94,0xE4,
1163    0xFF,0xA5,0xE4, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,   
1160    0x33,0x00,0x35, 0x44,0x00,0x41, 0x55,0x00,0x4C, 0x66,0x0C,0x5C,
1161    0x77,0x1D,0x6D, 0x88,0x2E,0x7E, 0x99,0x3F,0x8F, 0xAA,0x50,0xA0,
1162    0xBB,0x61,0xB1, 0xCC,0x72,0xC2, 0xDD,0x83,0xD3, 0xEE,0x94,0xE4,
1163    0xFF,0xA5,0xE4, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,
11641164
11651165PURPLE-BLUE
1166    0x1D,0x00,0x5C, 0x2E,0x00,0x68, 0x40,0x00,0x74, 0x51,0x10,0x84,
1167    0x62,0x21,0x95, 0x73,0x32,0xA6, 0x84,0x43,0xB7, 0x95,0x54,0xC8,
1168    0xA6,0x65,0xD9, 0xB7,0x76,0xEA, 0xC8,0x87,0xEB, 0xD9,0x98,0xEB,
1169    0xE9,0xA9,0xEC, 0xFB,0xBA,0xEB, 0xFF,0xCB,0xEF, 0xFF,0xDC,0xF4,   
1166    0x1D,0x00,0x5C, 0x2E,0x00,0x68, 0x40,0x00,0x74, 0x51,0x10,0x84,
1167    0x62,0x21,0x95, 0x73,0x32,0xA6, 0x84,0x43,0xB7, 0x95,0x54,0xC8,
1168    0xA6,0x65,0xD9, 0xB7,0x76,0xEA, 0xC8,0x87,0xEB, 0xD9,0x98,0xEB,
1169    0xE9,0xA9,0xEC, 0xFB,0xBA,0xEB, 0xFF,0xCB,0xEF, 0xFF,0xDC,0xF4,
11701170
11711171BLUE1
1172    0x02,0x00,0x71, 0x13,0x00,0x7D, 0x24,0x0B,0x8C, 0x35,0x1C,0x9D,
1173    0x46,0x2D,0xAE, 0x57,0x3E,0xBF, 0x68,0x4F,0xD0, 0x79,0x60,0xE1,
1174    0x8A,0x71,0xF2, 0x9B,0x82,0xF7, 0xAC,0x93,0xF7, 0xBD,0xA4,0xF7,
1175    0xCE,0xB5,0xF7, 0xDF,0xC6,0xF7, 0xF0,0xD7,0xF7, 0xFF,0xE8,0xF8,   
1172    0x02,0x00,0x71, 0x13,0x00,0x7D, 0x24,0x0B,0x8C, 0x35,0x1C,0x9D,
1173    0x46,0x2D,0xAE, 0x57,0x3E,0xBF, 0x68,0x4F,0xD0, 0x79,0x60,0xE1,
1174    0x8A,0x71,0xF2, 0x9B,0x82,0xF7, 0xAC,0x93,0xF7, 0xBD,0xA4,0xF7,
1175    0xCE,0xB5,0xF7, 0xDF,0xC6,0xF7, 0xF0,0xD7,0xF7, 0xFF,0xE8,0xF8,
11761176
11771177BLUE2
1178    0x00,0x00,0x68, 0x00,0x0A,0x7C, 0x08,0x1B,0x90, 0x19,0x2C,0xA1,
1179    0x2A,0x3D,0xB2, 0x3B,0x4E,0xC3, 0x4C,0x5F,0xD4, 0x5D,0x70,0xE5,
1180    0x6E,0x81,0xF6, 0x7F,0x92,0xFF, 0x90,0xA3,0xFF, 0xA1,0xB4,0xFF,
1181    0xB2,0xC5,0xFF, 0xC3,0xD6,0xFF, 0xD4,0xE7,0xFF, 0xE5,0xF8,0xFF,   
1178    0x00,0x00,0x68, 0x00,0x0A,0x7C, 0x08,0x1B,0x90, 0x19,0x2C,0xA1,
1179    0x2A,0x3D,0xB2, 0x3B,0x4E,0xC3, 0x4C,0x5F,0xD4, 0x5D,0x70,0xE5,
1180    0x6E,0x81,0xF6, 0x7F,0x92,0xFF, 0x90,0xA3,0xFF, 0xA1,0xB4,0xFF,
1181    0xB2,0xC5,0xFF, 0xC3,0xD6,0xFF, 0xD4,0xE7,0xFF, 0xE5,0xF8,0xFF,
11821182
11831183LIGHT-BLUE
1184    0x00,0x0A,0x4D, 0x00,0x1B,0x63, 0x00,0x2C,0x79, 0x02,0x3D,0x8F,
1185    0x13,0x4E,0xA0, 0x24,0x5F,0xB1, 0x35,0x70,0xC2, 0x46,0x81,0xD3,
1186    0x57,0x92,0xE4, 0x68,0xA3,0xF5, 0x79,0xB4,0xFF, 0x8A,0xC5,0xFF,
1187    0x9B,0xD6,0xFF, 0xAC,0xE7,0xFF, 0xBD,0xF8,0xFF, 0xCE,0xFF,0xFF,   
1184    0x00,0x0A,0x4D, 0x00,0x1B,0x63, 0x00,0x2C,0x79, 0x02,0x3D,0x8F,
1185    0x13,0x4E,0xA0, 0x24,0x5F,0xB1, 0x35,0x70,0xC2, 0x46,0x81,0xD3,
1186    0x57,0x92,0xE4, 0x68,0xA3,0xF5, 0x79,0xB4,0xFF, 0x8A,0xC5,0xFF,
1187    0x9B,0xD6,0xFF, 0xAC,0xE7,0xFF, 0xBD,0xF8,0xFF, 0xCE,0xFF,0xFF,
11881188
11891189TURQUOISE
1190    0x00,0x1A,0x26, 0x00,0x2B,0x3C, 0x00,0x3C,0x52, 0x00,0x4D,0x68,
1191    0x06,0x5E,0x7C, 0x17,0x6F,0x8D, 0x28,0x80,0x9E, 0x39,0x91,0xAF,
1192    0x4A,0xA2,0xC0, 0x5B,0xB3,0xD1, 0x6C,0xC4,0xE2, 0x7D,0xD5,0xF3,
1193    0x8E,0xE6,0xFF, 0x9F,0xF7,0xFF, 0xB0,0xFF,0xFF, 0xC1,0xFF,0xFF,   
1190    0x00,0x1A,0x26, 0x00,0x2B,0x3C, 0x00,0x3C,0x52, 0x00,0x4D,0x68,
1191    0x06,0x5E,0x7C, 0x17,0x6F,0x8D, 0x28,0x80,0x9E, 0x39,0x91,0xAF,
1192    0x4A,0xA2,0xC0, 0x5B,0xB3,0xD1, 0x6C,0xC4,0xE2, 0x7D,0xD5,0xF3,
1193    0x8E,0xE6,0xFF, 0x9F,0xF7,0xFF, 0xB0,0xFF,0xFF, 0xC1,0xFF,0xFF,
11941194
11951195GREEN-BLUE
1196    0x00,0x24,0x0B, 0x00,0x35,0x10, 0x00,0x46,0x22, 0x00,0x57,0x38,
1197    0x05,0x68,0x4D, 0x16,0x79,0x5E, 0x27,0x8A,0x6F, 0x38,0x9B,0x80,
1198    0x49,0xAC,0x91, 0x5A,0xBD,0xA2, 0x6B,0xCE,0xB3, 0x7C,0xDF,0xC4,
1199    0x8D,0xF0,0xD5, 0x9E,0xFF,0xE5, 0xAF,0xFF,0xF1, 0xC0,0xFF,0xFD,   
1196    0x00,0x24,0x0B, 0x00,0x35,0x10, 0x00,0x46,0x22, 0x00,0x57,0x38,
1197    0x05,0x68,0x4D, 0x16,0x79,0x5E, 0x27,0x8A,0x6F, 0x38,0x9B,0x80,
1198    0x49,0xAC,0x91, 0x5A,0xBD,0xA2, 0x6B,0xCE,0xB3, 0x7C,0xDF,0xC4,
1199    0x8D,0xF0,0xD5, 0x9E,0xFF,0xE5, 0xAF,0xFF,0xF1, 0xC0,0xFF,0xFD,
12001200
12011201GREEN
1202    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1B,
1203    0x10,0x6B,0x1B, 0x21,0x7C,0x2C, 0x32,0x8D,0x3D, 0x43,0x9E,0x4E,
1204    0x54,0xAF,0x5F, 0x65,0xC0,0x70, 0x76,0xD1,0x81, 0x87,0xE2,0x92,
1205    0x98,0xF3,0xA3, 0xA9,0xFF,0xB3, 0xBA,0xFF,0xBF, 0xCB,0xFF,0xCB,   
1202    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1B,
1203    0x10,0x6B,0x1B, 0x21,0x7C,0x2C, 0x32,0x8D,0x3D, 0x43,0x9E,0x4E,
1204    0x54,0xAF,0x5F, 0x65,0xC0,0x70, 0x76,0xD1,0x81, 0x87,0xE2,0x92,
1205    0x98,0xF3,0xA3, 0xA9,0xFF,0xB3, 0xBA,0xFF,0xBF, 0xCB,0xFF,0xCB,
12061206
12071207YELLOW-GREEN
1208    0x00,0x23,0x0A, 0x00,0x34,0x10, 0x04,0x45,0x13, 0x15,0x56,0x13,
1209    0x26,0x67,0x13, 0x37,0x78,0x13, 0x48,0x89,0x14, 0x59,0x9A,0x25,
1210    0x6A,0xAB,0x36, 0x7B,0xBC,0x47, 0x8C,0xCD,0x58, 0x9D,0xDE,0x69,
1211    0xAE,0xEF,0x7A, 0xBF,0xFF,0x8B, 0xD0,0xFF,0x97, 0xE1,0xFF,0xA3,   
1208    0x00,0x23,0x0A, 0x00,0x34,0x10, 0x04,0x45,0x13, 0x15,0x56,0x13,
1209    0x26,0x67,0x13, 0x37,0x78,0x13, 0x48,0x89,0x14, 0x59,0x9A,0x25,
1210    0x6A,0xAB,0x36, 0x7B,0xBC,0x47, 0x8C,0xCD,0x58, 0x9D,0xDE,0x69,
1211    0xAE,0xEF,0x7A, 0xBF,0xFF,0x8B, 0xD0,0xFF,0x97, 0xE1,0xFF,0xA3,
12121212
12131213ORANGE-GREEN
1214    0x00,0x17,0x07, 0x0E,0x28,0x08, 0x1F,0x39,0x08, 0x30,0x4A,0x08,
1215    0x41,0x5B,0x08, 0x52,0x6C,0x08, 0x63,0x7D,0x08, 0x74,0x8E,0x0D,
1216    0x85,0x9F,0x1E, 0x96,0xB0,0x2F, 0xA7,0xC1,0x40, 0xB8,0xD2,0x51,
1217    0xC9,0xE3,0x62, 0xDA,0xF4,0x73, 0xEB,0xFF,0x82, 0xFC,0xFF,0x8E,   
1214    0x00,0x17,0x07, 0x0E,0x28,0x08, 0x1F,0x39,0x08, 0x30,0x4A,0x08,
1215    0x41,0x5B,0x08, 0x52,0x6C,0x08, 0x63,0x7D,0x08, 0x74,0x8E,0x0D,
1216    0x85,0x9F,0x1E, 0x96,0xB0,0x2F, 0xA7,0xC1,0x40, 0xB8,0xD2,0x51,
1217    0xC9,0xE3,0x62, 0xDA,0xF4,0x73, 0xEB,0xFF,0x82, 0xFC,0xFF,0x8E,
12181218
12191219LIGHT-ORANGE
1220    0x19,0x07,0x00, 0x2A,0x18,0x00, 0x3B,0x29,0x00, 0x4C,0x3A,0x00,
1221    0x5D,0x4B,0x00, 0x6E,0x5C,0x00, 0x7F,0x6D,0x00, 0x90,0x7E,0x09,
1222    0xA1,0x8F,0x1A, 0xB2,0xA0,0x2B, 0xC3,0xB1,0x3C, 0xD4,0xC2,0x4D,
1223    0xE5,0xD3,0x5E, 0xF6,0xE4,0x6F, 0xFF,0xF5,0x82, 0xFF,0xFF,0x96,   
1220    0x19,0x07,0x00, 0x2A,0x18,0x00, 0x3B,0x29,0x00, 0x4C,0x3A,0x00,
1221    0x5D,0x4B,0x00, 0x6E,0x5C,0x00, 0x7F,0x6D,0x00, 0x90,0x7E,0x09,
1222    0xA1,0x8F,0x1A, 0xB2,0xA0,0x2B, 0xC3,0xB1,0x3C, 0xD4,0xC2,0x4D,
1223    0xE5,0xD3,0x5E, 0xF6,0xE4,0x6F, 0xFF,0xF5,0x82, 0xFF,0xFF,0x96,
12241224*******************************************************************
12251225
12261226*******************************************************************
12271227    PALETTE - PHASE 26.7 SHIFT
12281228
12291229GREY
1230    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1231    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1232    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1233    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,   
1230    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1231    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1232    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1233    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
12341234
12351235GOLD
1236    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1237    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1238    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1239    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xFF,0x97,   
1236    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1237    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1238    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1239    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xFF,0x97,
12401240
12411241ORANGE
1242    0x32,0x00,0x00, 0x43,0x06,0x00, 0x54,0x17,0x00, 0x65,0x28,0x00,
1243    0x79,0x39,0x00, 0x87,0x4A,0x00, 0x98,0x5B,0x0C, 0xA9,0x6C,0x1D,
1244    0xBA,0x7D,0x2E, 0xCB,0x8E,0x3F, 0xDC,0x9F,0x50, 0xED,0xB0,0x61,
1245    0xFE,0xC1,0x72, 0xFF,0xD2,0x87, 0xFF,0xE3,0x9E, 0xFF,0xF4,0xB4,   
1242    0x32,0x00,0x00, 0x43,0x06,0x00, 0x54,0x17,0x00, 0x65,0x28,0x00,
1243    0x79,0x39,0x00, 0x87,0x4A,0x00, 0x98,0x5B,0x0C, 0xA9,0x6C,0x1D,
1244    0xBA,0x7D,0x2E, 0xCB,0x8E,0x3F, 0xDC,0x9F,0x50, 0xED,0xB0,0x61,
1245    0xFE,0xC1,0x72, 0xFF,0xD2,0x87, 0xFF,0xE3,0x9E, 0xFF,0xF4,0xB4,
12461246
12471247RED-ORANGE
1248    0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x07,0x00, 0x71,0x18,0x00,
1249    0x82,0x29,0x10, 0x93,0x3A,0x21, 0xA4,0x4B,0x32, 0xB5,0x5C,0x43,
1250    0xC6,0x6D,0x54, 0xD7,0x7E,0x65, 0xE8,0x8F,0x76, 0xF9,0xA0,0x87,
1251    0xFF,0xB1,0x9C, 0xFF,0xC2,0xB2, 0xFF,0xD3,0xC8, 0xFF,0xE4,0xDE,   
1248    0x3E,0x00,0x00, 0x4F,0x00,0x00, 0x60,0x07,0x00, 0x71,0x18,0x00,
1249    0x82,0x29,0x10, 0x93,0x3A,0x21, 0xA4,0x4B,0x32, 0xB5,0x5C,0x43,
1250    0xC6,0x6D,0x54, 0xD7,0x7E,0x65, 0xE8,0x8F,0x76, 0xF9,0xA0,0x87,
1251    0xFF,0xB1,0x9C, 0xFF,0xC2,0xB2, 0xFF,0xD3,0xC8, 0xFF,0xE4,0xDE,
12521252
12531253PINK
1254    0x3E,0x00,0x09, 0x4F,0x00,0x15, 0x60,0x00,0x21, 0x71,0x0E,0x31,
1255    0x82,0x1F,0x42, 0x93,0x30,0x53, 0xA4,0x41,0x64, 0xB5,0x52,0x75,
1256    0xC6,0x63,0x86, 0xD7,0x74,0x97, 0xE8,0x85,0xA8, 0xF9,0x96,0xB9,
1257    0xFF,0xA7,0xCE, 0xFF,0xB8,0xE4, 0xFF,0xC9,0xEF, 0xFF,0xDA,0xF4,   
1254    0x3E,0x00,0x09, 0x4F,0x00,0x15, 0x60,0x00,0x21, 0x71,0x0E,0x31,
1255    0x82,0x1F,0x42, 0x93,0x30,0x53, 0xA4,0x41,0x64, 0xB5,0x52,0x75,
1256    0xC6,0x63,0x86, 0xD7,0x74,0x97, 0xE8,0x85,0xA8, 0xF9,0x96,0xB9,
1257    0xFF,0xA7,0xCE, 0xFF,0xB8,0xE4, 0xFF,0xC9,0xEF, 0xFF,0xDA,0xF4,
12581258
12591259PURPLE
1260    0x30,0x00,0x3D, 0x41,0x00,0x48, 0x52,0x00,0x54, 0x63,0x0C,0x64,
1261    0x74,0x1D,0x75, 0x85,0x2E,0x86, 0x96,0x3F,0x97, 0xA7,0x50,0xA8,
1262    0xB8,0x61,0xB9, 0xC9,0x72,0xCA, 0xDA,0x83,0xDB, 0xEB,0x94,0xE5,
1263    0xFC,0xA5,0xE5, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,   
1260    0x30,0x00,0x3D, 0x41,0x00,0x48, 0x52,0x00,0x54, 0x63,0x0C,0x64,
1261    0x74,0x1D,0x75, 0x85,0x2E,0x86, 0x96,0x3F,0x97, 0xA7,0x50,0xA8,
1262    0xB8,0x61,0xB9, 0xC9,0x72,0xCA, 0xDA,0x83,0xDB, 0xEB,0x94,0xE5,
1263    0xFC,0xA5,0xE5, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,
12641264
12651265PURPLE-BLUE
1266    0x18,0x00,0x62, 0x29,0x00,0x6E, 0x3A,0x01,0x7A, 0x4B,0x12,0x8B,
1267    0x5C,0x23,0x9C, 0x6D,0x34,0xAD, 0x7E,0x45,0xBE, 0x8F,0x56,0xCF,
1268    0xA0,0x67,0xE0, 0xB1,0x78,0xEE, 0xC2,0x89,0xEE, 0xD3,0x9A,0xEE,
1269    0xE4,0xAB,0xEE, 0xF5,0xBC,0xEE, 0xFF,0xCD,0xE0, 0xFF,0xDE,0xF5,   
1266    0x18,0x00,0x62, 0x29,0x00,0x6E, 0x3A,0x01,0x7A, 0x4B,0x12,0x8B,
1267    0x5C,0x23,0x9C, 0x6D,0x34,0xAD, 0x7E,0x45,0xBE, 0x8F,0x56,0xCF,
1268    0xA0,0x67,0xE0, 0xB1,0x78,0xEE, 0xC2,0x89,0xEE, 0xD3,0x9A,0xEE,
1269    0xE4,0xAB,0xEE, 0xF5,0xBC,0xEE, 0xFF,0xCD,0xE0, 0xFF,0xDE,0xF5,
12701270
12711271BLUE1
1272    0x00,0x00,0x72, 0x0C,0x00,0x7F, 0x1D,0x0E,0x8F, 0x2E,0x1F,0xA0,
1273    0x3F,0x30,0xB1, 0x50,0x41,0xC2, 0x61,0x52,0xD3, 0x72,0x63,0xE4,
1274    0x83,0x74,0xF5, 0x94,0x85,0xFA, 0xA5,0x96,0xFA, 0xB6,0xA7,0xFA,
1275    0xC7,0xB8,0xFA, 0xD8,0xC9,0xFA, 0xE9,0xDA,0xFA, 0xFA,0xE8,0xFA, 
1272    0x00,0x00,0x72, 0x0C,0x00,0x7F, 0x1D,0x0E,0x8F, 0x2E,0x1F,0xA0,
1273    0x3F,0x30,0xB1, 0x50,0x41,0xC2, 0x61,0x52,0xD3, 0x72,0x63,0xE4,
1274    0x83,0x74,0xF5, 0x94,0x85,0xFA, 0xA5,0x96,0xFA, 0xB6,0xA7,0xFA,
1275    0xC7,0xB8,0xFA, 0xD8,0xC9,0xFA, 0xE9,0xDA,0xFA, 0xFA,0xE8,0xFA,
12761276
12771277BLUE2
1278    0x00,0x00,0x62, 0x00,0x0F,0x77, 0x01,0x20,0x8D, 0x12,0x31,0x9E,
1279    0x23,0x42,0xAF, 0x34,0x53,0xC0, 0x45,0x64,0xD1, 0x56,0x75,0xE2,
1280    0x67,0x86,0xF3, 0x78,0x97,0xFF, 0x89,0xA8,0xFF, 0x9A,0xB9,0xFF,
1281    0xAB,0xCA,0xFF, 0xBC,0xDB,0xFF, 0xCD,0xEC,0xFF, 0xDE,0xFD,0xFF,   
1278    0x00,0x00,0x62, 0x00,0x0F,0x77, 0x01,0x20,0x8D, 0x12,0x31,0x9E,
1279    0x23,0x42,0xAF, 0x34,0x53,0xC0, 0x45,0x64,0xD1, 0x56,0x75,0xE2,
1280    0x67,0x86,0xF3, 0x78,0x97,0xFF, 0x89,0xA8,0xFF, 0x9A,0xB9,0xFF,
1281    0xAB,0xCA,0xFF, 0xBC,0xDB,0xFF, 0xCD,0xEC,0xFF, 0xDE,0xFD,0xFF,
12821282
12831283LIGHT-BLUE
1284    0x00,0x10,0x42, 0x00,0x21,0x58, 0x00,0x32,0x6E, 0x00,0x43,0x84,
1285    0x0E,0x54,0x96, 0x1F,0x65,0xA7, 0x30,0x76,0xB8, 0x41,0x87,0xC9,
1286    0x52,0x98,0xDA, 0x63,0xA9,0xEB, 0x74,0xBA,0xFC, 0x85,0xCB,0xFF,
1287    0x96,0xDC,0xFF, 0xA7,0xED,0xFF, 0xB8,0xFE,0xFF, 0xC9,0xFF,0xFF,   
1284    0x00,0x10,0x42, 0x00,0x21,0x58, 0x00,0x32,0x6E, 0x00,0x43,0x84,
1285    0x0E,0x54,0x96, 0x1F,0x65,0xA7, 0x30,0x76,0xB8, 0x41,0x87,0xC9,
1286    0x52,0x98,0xDA, 0x63,0xA9,0xEB, 0x74,0xBA,0xFC, 0x85,0xCB,0xFF,
1287    0x96,0xDC,0xFF, 0xA7,0xED,0xFF, 0xB8,0xFE,0xFF, 0xC9,0xFF,0xFF,
12881288
12891289TURQUOISE
1290    0x00,0x1E,0x14, 0x00,0x2F,0x2A, 0x00,0x40,0x40, 0x00,0x51,0x56,
1291    0x04,0x62,0x6B, 0x15,0x73,0x7C, 0x26,0x84,0x8D, 0x37,0x95,0x9E,
1292    0x48,0xA6,0xAF, 0x59,0xB7,0xC0, 0x6A,0xC8,0xD1, 0x7B,0xD9,0xE2,
1293    0x8C,0xEA,0xF3, 0x9D,0xFB,0xFF, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,   
1290    0x00,0x1E,0x14, 0x00,0x2F,0x2A, 0x00,0x40,0x40, 0x00,0x51,0x56,
1291    0x04,0x62,0x6B, 0x15,0x73,0x7C, 0x26,0x84,0x8D, 0x37,0x95,0x9E,
1292    0x48,0xA6,0xAF, 0x59,0xB7,0xC0, 0x6A,0xC8,0xD1, 0x7B,0xD9,0xE2,
1293    0x8C,0xEA,0xF3, 0x9D,0xFB,0xFF, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,
12941294
12951295GREEN-BLUE
1296    0x00,0x26,0x0B, 0x00,0x37,0x10, 0x00,0x48,0x16, 0x00,0x59,0x25,
1297    0x08,0x6A,0x38, 0x19,0x7B,0x49, 0x2A,0x8C,0x5A, 0x3B,0x9D,0x6B,
1298    0x4C,0xAE,0x7C, 0x5D,0xBF,0x8D, 0x6E,0xD0,0x9E, 0x7F,0xE1,0xAF,
1299    0x90,0xF2,0xC0, 0xA1,0xFF,0xD0, 0xB2,0xFF,0xDC, 0xC3,0xFF,0xE8,   
1296    0x00,0x26,0x0B, 0x00,0x37,0x10, 0x00,0x48,0x16, 0x00,0x59,0x25,
1297    0x08,0x6A,0x38, 0x19,0x7B,0x49, 0x2A,0x8C,0x5A, 0x3B,0x9D,0x6B,
1298    0x4C,0xAE,0x7C, 0x5D,0xBF,0x8D, 0x6E,0xD0,0x9E, 0x7F,0xE1,0xAF,
1299    0x90,0xF2,0xC0, 0xA1,0xFF,0xD0, 0xB2,0xFF,0xDC, 0xC3,0xFF,0xE8,
13001300
13011301GREEN
1302    0x00,0x26,0x0B, 0x00,0x37,0x10, 0x00,0x48,0x16, 0x08,0x59,0x18,
1303    0x19,0x6A,0x18, 0x2A,0x7B,0x18, 0x3B,0x8C,0x29, 0x4C,0x9D,0x3A,
1304    0x5D,0xAE,0x4B, 0x6E,0xBF,0x5C, 0x7F,0xD0,0x6D, 0x90,0xE1,0x7E,
1305    0xA1,0xF2,0x8F, 0xB2,0xFF,0x9F, 0xC3,0xFF,0xAB, 0xD4,0xFF,0xB7,   
1302    0x00,0x26,0x0B, 0x00,0x37,0x10, 0x00,0x48,0x16, 0x08,0x59,0x18,
1303    0x19,0x6A,0x18, 0x2A,0x7B,0x18, 0x3B,0x8C,0x29, 0x4C,0x9D,0x3A,
1304    0x5D,0xAE,0x4B, 0x6E,0xBF,0x5C, 0x7F,0xD0,0x6D, 0x90,0xE1,0x7E,
1305    0xA1,0xF2,0x8F, 0xB2,0xFF,0x9F, 0xC3,0xFF,0xAB, 0xD4,0xFF,0xB7,
13061306
13071307YELLOW-GREEN
1308    0x00,0x1E,0x09, 0x00,0x2F,0x0E, 0x11,0x40,0x0E, 0x22,0x51,0x0E,
1309    0x33,0x62,0x0E, 0x44,0x73,0x0E, 0x55,0x84,0x0E, 0x66,0x95,0x17,
1310    0x77,0xA6,0x28, 0x88,0xB7,0x39, 0x99,0xC8,0x4A, 0xAA,0xD9,0x5B,
1311    0xBB,0xEA,0x6C, 0xCC,0xFB,0x7D, 0xDD,0xFF,0x8A, 0xEE,0xFF,0x96,   
1308    0x00,0x1E,0x09, 0x00,0x2F,0x0E, 0x11,0x40,0x0E, 0x22,0x51,0x0E,
1309    0x33,0x62,0x0E, 0x44,0x73,0x0E, 0x55,0x84,0x0E, 0x66,0x95,0x17,
1310    0x77,0xA6,0x28, 0x88,0xB7,0x39, 0x99,0xC8,0x4A, 0xAA,0xD9,0x5B,
1311    0xBB,0xEA,0x6C, 0xCC,0xFB,0x7D, 0xDD,0xFF,0x8A, 0xEE,0xFF,0x96,
13121312
13131313ORANGE-GREEN
1314    0x0D,0x0F,0x01, 0x1E,0x20,0x01, 0x2F,0x31,0x01, 0x40,0x42,0x01,
1315    0x51,0x53,0x01, 0x62,0x64,0x01, 0x73,0x75,0x01, 0x84,0x86,0x08,
1316    0x95,0x97,0x19, 0xA6,0xA8,0x2A, 0xB7,0xB9,0x3B, 0xC8,0xCA,0x4C,
1317    0xD9,0xDB,0x5D, 0xEA,0xEC,0x6E, 0xFB,0xFD,0x7F, 0xFF,0xFF,0x8F,   
1314    0x0D,0x0F,0x01, 0x1E,0x20,0x01, 0x2F,0x31,0x01, 0x40,0x42,0x01,
1315    0x51,0x53,0x01, 0x62,0x64,0x01, 0x73,0x75,0x01, 0x84,0x86,0x08,
1316    0x95,0x97,0x19, 0xA6,0xA8,0x2A, 0xB7,0xB9,0x3B, 0xC8,0xCA,0x4C,
1317    0xD9,0xDB,0x5D, 0xEA,0xEC,0x6E, 0xFB,0xFD,0x7F, 0xFF,0xFF,0x8F,
13181318
13191319LIGHT-ORANGE
1320    0x28,0x00,0x00, 0x39,0x0E,0x00, 0x4A,0x1F,0x00, 0x5B,0x30,0x00,
1321    0x6C,0x41,0x00, 0x7D,0x52,0x00, 0x8E,0x63,0x00, 0x9F,0x74,0x10,
1322    0xB0,0x85,0x21, 0xC1,0x96,0x32, 0xD2,0xA7,0x43, 0xE3,0xB8,0x54,
1323    0xF4,0xC9,0x65, 0xFF,0xDA,0x78, 0xFF,0xEB,0x8E, 0xFF,0xFC,0xA4,   
1320    0x28,0x00,0x00, 0x39,0x0E,0x00, 0x4A,0x1F,0x00, 0x5B,0x30,0x00,
1321    0x6C,0x41,0x00, 0x7D,0x52,0x00, 0x8E,0x63,0x00, 0x9F,0x74,0x10,
1322    0xB0,0x85,0x21, 0xC1,0x96,0x32, 0xD2,0xA7,0x43, 0xE3,0xB8,0x54,
1323    0xF4,0xC9,0x65, 0xFF,0xDA,0x78, 0xFF,0xEB,0x8E, 0xFF,0xFC,0xA4,
13241324*******************************************************************
13251325
13261326*******************************************************************
r26736r26737
13281328
13291329
13301330GREY
1331    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1332    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1333    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1334    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,   
1331    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1332    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1333    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1334    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
13351335
13361336GOLD
1337    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1338    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1339    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1340    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,   
1337    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1338    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1339    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1340    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xF7,0x97,
13411341
13421342ORANGE
1343    0x32,0x00,0x00, 0x43,0x05,0x00, 0x54,0x16,0x00, 0x65,0x27,0x00,
1344    0x76,0x38,0x00, 0x87,0X49,0x00, 0x98,0x5A,0x0C, 0xA9,0x6B,0x1D,
1345    0xBA,0x7C,0x2E, 0xCB,0x8D,0x3F, 0xDC,0x9E,0x50, 0xED,0xAF,0x61,
1346    0xFE,0xC0,0x72, 0xFF,0xD1,0x88, 0xFF,0xE2,0x9E, 0xFF,0xF3,0xB4,   
1343    0x32,0x00,0x00, 0x43,0x05,0x00, 0x54,0x16,0x00, 0x65,0x27,0x00,
1344    0x76,0x38,0x00, 0x87,0X49,0x00, 0x98,0x5A,0x0C, 0xA9,0x6B,0x1D,
1345    0xBA,0x7C,0x2E, 0xCB,0x8D,0x3F, 0xDC,0x9E,0x50, 0xED,0xAF,0x61,
1346    0xFE,0xC0,0x72, 0xFF,0xD1,0x88, 0xFF,0xE2,0x9E, 0xFF,0xF3,0xB4,
13471347
13481348RED-ORANGE
1349    0x3F,0x00,0x00, 0x50,0x00,0x00, 0x61,0x07,0x00, 0x72,0x18,0x01,
1350    0x83,0x29,0x12, 0x94,0x3A,0x23, 0xA5,0x4B,0x34, 0xB6,0x5C,0x45,
1351    0xC7,0x6D,0x56, 0xD8,0x7E,0x67, 0xE9,0x8F,0x78, 0xFA,0xA0,0x89,
1352    0xFF,0xB1,0x9E, 0xFF,0xC2,0xB4, 0xFF,0xD3,0xCA, 0xFF,0xE4,0xE0, 
1349    0x3F,0x00,0x00, 0x50,0x00,0x00, 0x61,0x07,0x00, 0x72,0x18,0x01,
1350    0x83,0x29,0x12, 0x94,0x3A,0x23, 0xA5,0x4B,0x34, 0xB6,0x5C,0x45,
1351    0xC7,0x6D,0x56, 0xD8,0x7E,0x67, 0xE9,0x8F,0x78, 0xFA,0xA0,0x89,
1352    0xFF,0xB1,0x9E, 0xFF,0xC2,0xB4, 0xFF,0xD3,0xCA, 0xFF,0xE4,0xE0,
13531353
13541354PINK
1355    0x3E,0x00,0x0C, 0x4F,0x00,0x18, 0x60,0x00,0x24, 0x71,0x0E,0x34,
1356    0x82,0x1F,0x45, 0x93,0x30,0x56, 0xA4,0x41,0x67, 0xB5,0x52,0x78,
1357    0xC6,0x63,0x89, 0xD7,0x74,0x9A, 0xE8,0x85,0xAB, 0xF9,0x96,0xB6,
1358    0xFF,0xA7,0xD1, 0xFF,0xB8,0xE7, 0xFF,0xC9,0xEF, 0xFF,0xDA,0xF4,   
1355    0x3E,0x00,0x0C, 0x4F,0x00,0x18, 0x60,0x00,0x24, 0x71,0x0E,0x34,
1356    0x82,0x1F,0x45, 0x93,0x30,0x56, 0xA4,0x41,0x67, 0xB5,0x52,0x78,
1357    0xC6,0x63,0x89, 0xD7,0x74,0x9A, 0xE8,0x85,0xAB, 0xF9,0x96,0xB6,
1358    0xFF,0xA7,0xD1, 0xFF,0xB8,0xE7, 0xFF,0xC9,0xEF, 0xFF,0xDA,0xF4,
13591359
13601360PURPLE
1361    0x2F,0x00,0x3F, 0x40,0x00,0x4B, 0x51,0x00,0x57, 0x62,0x0C,0x66,
1362    0x73,0x1D,0x77, 0x84,0x2E,0x88, 0x95,0x3F,0x99, 0xA6,0x50,0xAA,
1363    0xB7,0x61,0xBB, 0xC8,0x72,0xCC, 0xD9,0x83,0xDD, 0xEA,0x94,0xE5,
1364    0xFB,0xA5,0xE5, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,   
1361    0x2F,0x00,0x3F, 0x40,0x00,0x4B, 0x51,0x00,0x57, 0x62,0x0C,0x66,
1362    0x73,0x1D,0x77, 0x84,0x2E,0x88, 0x95,0x3F,0x99, 0xA6,0x50,0xAA,
1363    0xB7,0x61,0xBB, 0xC8,0x72,0xCC, 0xD9,0x83,0xDD, 0xEA,0x94,0xE5,
1364    0xFB,0xA5,0xE5, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,
13651365
13661366PURPLE-BLUE
1367    0x16,0x00,0x64, 0x27,0x00,0x70, 0x38,0x02,0x7D, 0x49,0x13,0x8E,
1368    0x5A,0x24,0x9F, 0x6B,0x35,0xB0, 0x7C,0x46,0xC1, 0x8D,0x57,0xD2,
1369    0x9E,0x68,0xE3, 0xAF,0x79,0xEF, 0xC0,0x8A,0xEF, 0xD1,0x9D,0xEF,
1370    0xE2,0xAC,0xEF, 0xF3,0xBD,0xEF, 0xFF,0xCE,0xF0, 0xFF,0xDF,0xF5,   
1367    0x16,0x00,0x64, 0x27,0x00,0x70, 0x38,0x02,0x7D, 0x49,0x13,0x8E,
1368    0x5A,0x24,0x9F, 0x6B,0x35,0xB0, 0x7C,0x46,0xC1, 0x8D,0x57,0xD2,
1369    0x9E,0x68,0xE3, 0xAF,0x79,0xEF, 0xC0,0x8A,0xEF, 0xD1,0x9D,0xEF,
1370    0xE2,0xAC,0xEF, 0xF3,0xBD,0xEF, 0xFF,0xCE,0xF0, 0xFF,0xDF,0xF5,
13711371
13721372BLUE1
1373    0x00,0x00,0x71, 0x09,0x00,0x7F, 0x1A,0x10,0x90, 0x2B,0x21,0xA1,
1374    0x3C,0x32,0xB2, 0x4D,0x43,0xC3, 0x5E,0x54,0xD4, 0x6F,0x65,0xE5,
1375    0x80,0x76,0xF6, 0x91,0x87,0xFC, 0xA2,0x98,0xFC, 0xB3,0xA9,0xFC,
1376    0xC4,0xBA,0xFC, 0xD5,0xCB,0xFC, 0xE6,0xDC,0xFC, 0xF7,0xED,0xFC,   
1373    0x00,0x00,0x71, 0x09,0x00,0x7F, 0x1A,0x10,0x90, 0x2B,0x21,0xA1,
1374    0x3C,0x32,0xB2, 0x4D,0x43,0xC3, 0x5E,0x54,0xD4, 0x6F,0x65,0xE5,
1375    0x80,0x76,0xF6, 0x91,0x87,0xFC, 0xA2,0x98,0xFC, 0xB3,0xA9,0xFC,
1376    0xC4,0xBA,0xFC, 0xD5,0xCB,0xFC, 0xE6,0xDC,0xFC, 0xF7,0xED,0xFC,
13771377
13781378BLUE2
1379    0x00,0x00,0x5E, 0x00,0x11,0x74, 0x00,0x22,0x8A, 0x0F,0x33,0x9C,
1380    0x20,0x44,0xAD, 0x31,0x55,0xBE, 0x42,0x66,0xCF, 0x53,0x77,0xE0,
1381    0x64,0x88,0xF1, 0x75,0x99,0xFF, 0x86,0xAA,0xFF, 0x97,0xBB,0xFF,
1382    0xA8,0xCC,0xFF, 0xB9,0xDD,0xFF, 0xCA,0xEE,0xFF, 0xDB,0xFF,0xFF,   
1379    0x00,0x00,0x5E, 0x00,0x11,0x74, 0x00,0x22,0x8A, 0x0F,0x33,0x9C,
1380    0x20,0x44,0xAD, 0x31,0x55,0xBE, 0x42,0x66,0xCF, 0x53,0x77,0xE0,
1381    0x64,0x88,0xF1, 0x75,0x99,0xFF, 0x86,0xAA,0xFF, 0x97,0xBB,0xFF,
1382    0xA8,0xCC,0xFF, 0xB9,0xDD,0xFF, 0xCA,0xEE,0xFF, 0xDB,0xFF,0xFF,
13831383
13841384LIGHT-BLUE
1385    0x00,0x12,0x3B, 0x00,0x23,0x51, 0x00,0x34,0x68, 0x00,0x45,0x7E,
1386    0x0C,0x56,0x90, 0x1D,0x67,0xA1, 0x2E,0x78,0xB2, 0x3F,0x89,0xC3,
1387    0x50,0x9A,0xD4, 0x61,0xAB,0xE5, 0x72,0xBC,0xF6, 0x83,0xCD,0xFF,
1388    0x94,0xDE,0xFF, 0xA5,0xEF,0xFF, 0xB6,0xFF,0xFF, 0xC7,0xFF,0xFF,   
1385    0x00,0x12,0x3B, 0x00,0x23,0x51, 0x00,0x34,0x68, 0x00,0x45,0x7E,
1386    0x0C,0x56,0x90, 0x1D,0x67,0xA1, 0x2E,0x78,0xB2, 0x3F,0x89,0xC3,
1387    0x50,0x9A,0xD4, 0x61,0xAB,0xE5, 0x72,0xBC,0xF6, 0x83,0xCD,0xFF,
1388    0x94,0xDE,0xFF, 0xA5,0xEF,0xFF, 0xB6,0xFF,0xFF, 0xC7,0xFF,0xFF,
13891389
13901390TURQUOISE
1391    0x00,0x20,0x0C, 0x00,0x31,0x22, 0x00,0x42,0x38, 0x00,0x53,0x4E,
1392    0x04,0x64,0x63, 0x15,0x75,0x74, 0x26,0x86,0x85, 0x37,0x97,0x96,
1393    0x48,0xA8,0xA7, 0x59,0xB9,0xB8, 0x6A,0xCA,0xC9, 0x7B,0xDB,0xDA,
1394    0x8C,0xEC,0xEB, 0x9D,0xFD,0xFC, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,   
1391    0x00,0x20,0x0C, 0x00,0x31,0x22, 0x00,0x42,0x38, 0x00,0x53,0x4E,
1392    0x04,0x64,0x63, 0x15,0x75,0x74, 0x26,0x86,0x85, 0x37,0x97,0x96,
1393    0x48,0xA8,0xA7, 0x59,0xB9,0xB8, 0x6A,0xCA,0xC9, 0x7B,0xDB,0xDA,
1394    0x8C,0xEC,0xEB, 0x9D,0xFD,0xFC, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,
13951395
13961396GREEN-BLUE
1397    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1C,
1398    0x0B,0x6B,0x2F, 0x1C,0x7C,0x40, 0x2D,0x8D,0x51, 0x3E,0x9E,0x62,
1399    0x4F,0xAF,0x73, 0x60,0xC0,0x84, 0x71,0xD1,0x95, 0x82,0xE2,0xA6,
1400    0x93,0xF3,0xB7, 0xA4,0xFF,0xC6, 0xB5,0xFF,0xD2, 0xC6,0xFF,0xDE,   
1397    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1C,
1398    0x0B,0x6B,0x2F, 0x1C,0x7C,0x40, 0x2D,0x8D,0x51, 0x3E,0x9E,0x62,
1399    0x4F,0xAF,0x73, 0x60,0xC0,0x84, 0x71,0xD1,0x95, 0x82,0xE2,0xA6,
1400    0x93,0xF3,0xB7, 0xA4,0xFF,0xC6, 0xB5,0xFF,0xD2, 0xC6,0xFF,0xDE,
14011401
14021402GREEN
1403    0x00,0x25,0x0B, 0x00,0x36,0x10, 0x00,0x47,0x15, 0x0D,0x58,0x16,
1404    0x1E,0x69,0x16, 0x2F,0x7A,0x16, 0x40,0x8B,0x21, 0x51,0x9C,0x32,
1405    0x62,0xAD,0x43, 0x73,0xBE,0x54, 0x84,0xCF,0x65, 0x95,0xE0,0x76,
1406    0xA6,0xF1,0x87, 0xB7,0xFF,0x98, 0xC8,0xFF,0xA3, 0xD9,0xFF,0xAF,   
1403    0x00,0x25,0x0B, 0x00,0x36,0x10, 0x00,0x47,0x15, 0x0D,0x58,0x16,
1404    0x1E,0x69,0x16, 0x2F,0x7A,0x16, 0x40,0x8B,0x21, 0x51,0x9C,0x32,
1405    0x62,0xAD,0x43, 0x73,0xBE,0x54, 0x84,0xCF,0x65, 0x95,0xE0,0x76,
1406    0xA6,0xF1,0x87, 0xB7,0xFF,0x98, 0xC8,0xFF,0xA3, 0xD9,0xFF,0xAF,
14071407
14081408YELLOW-GREEN
1409    0x00,0x1B,0x08, 0x06,0x2C,0x0B, 0x17,0x3D,0x0B, 0x28,0x4E,0x0B,
1410    0x39,0x5F,0x0B, 0x4A,0x70,0x0B, 0x5B,0x81,0x0B, 0x6C,0x92,0x12,
1411    0x7D,0xA3,0x23, 0x8E,0xB4,0x34, 0x9F,0xC5,0x45, 0xB0,0xD6,0x56,
1412    0xC1,0xE7,0x67, 0xD2,0xF8,0x78, 0xE3,0xFF,0x86, 0xF4,0xFF,0x92,   
1409    0x00,0x1B,0x08, 0x06,0x2C,0x0B, 0x17,0x3D,0x0B, 0x28,0x4E,0x0B,
1410    0x39,0x5F,0x0B, 0x4A,0x70,0x0B, 0x5B,0x81,0x0B, 0x6C,0x92,0x12,
1411    0x7D,0xA3,0x23, 0x8E,0xB4,0x34, 0x9F,0xC5,0x45, 0xB0,0xD6,0x56,
1412    0xC1,0xE7,0x67, 0xD2,0xF8,0x78, 0xE3,0xFF,0x86, 0xF4,0xFF,0x92,
14131413
14141414ORANGE-GREEN
1415    0x13,0x0B,0x00, 0x24,0x1C,0x00, 0x35,0x2D,0x00, 0x46,0x3E,0x00,
1416    0x57,0x4F,0x00, 0x68,0x60,0x00, 0x79,0x71,0x00, 0x8A,0x82,0x08,
1417    0x9B,0x93,0x19, 0xAC,0xA4,0x2A, 0xBD,0xB5,0x3B, 0xCE,0xC6,0x4C,
1418    0xDF,0xD7,0x5D, 0xF0,0xE8,0x6E, 0xFF,0xF9,0x7F, 0xFF,0xFF,0x92,   
1415    0x13,0x0B,0x00, 0x24,0x1C,0x00, 0x35,0x2D,0x00, 0x46,0x3E,0x00,
1416    0x57,0x4F,0x00, 0x68,0x60,0x00, 0x79,0x71,0x00, 0x8A,0x82,0x08,
1417    0x9B,0x93,0x19, 0xAC,0xA4,0x2A, 0xBD,0xB5,0x3B, 0xCE,0xC6,0x4C,
1418    0xDF,0xD7,0x5D, 0xF0,0xE8,0x6E, 0xFF,0xF9,0x7F, 0xFF,0xFF,0x92,
14191419
14201420LIGHT-ORANGE
1421    0x2D,0x00,0x00, 0x3E,0x0A,0x00, 0x4F,0x1B,0x00, 0x60,0x2C,0x00,
1422    0x71,0x3D,0x00, 0x82,0x4E,0x00, 0x93,0x5F,0x05, 0xA4,0x70,0x16,
1423    0xB5,0x81,0x27, 0xC4,0x90,0x37, 0xD7,0xA3,0x49, 0xE8,0xB4,0x5A,
1424    0xF9,0xC5,0x6B, 0xFF,0xD6,0x80, 0xFF,0xE7,0x96, 0xFF,0xF8,0xAC,   
1421    0x2D,0x00,0x00, 0x3E,0x0A,0x00, 0x4F,0x1B,0x00, 0x60,0x2C,0x00,
1422    0x71,0x3D,0x00, 0x82,0x4E,0x00, 0x93,0x5F,0x05, 0xA4,0x70,0x16,
1423    0xB5,0x81,0x27, 0xC4,0x90,0x37, 0xD7,0xA3,0x49, 0xE8,0xB4,0x5A,
1424    0xF9,0xC5,0x6B, 0xFF,0xD6,0x80, 0xFF,0xE7,0x96, 0xFF,0xF8,0xAC,
14251425*******************************************************************
14261426
14271427*******************************************************************
14281428    PALETTE - 27.7 PHASE SHIFT
14291429
14301430GREY
1431    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1432    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1433    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1434    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,   
1431    0x00,0x00,0x00, 0x11,0x11,0x11, 0x22,0x22,0x22, 0x33,0x33,0x33,
1432    0x44,0x44,0x44, 0x55,0x55,0x55, 0x66,0x66,0x66, 0x77,0x77,0x77,
1433    0x88,0x88,0x88, 0x99,0x99,0x99, 0xAA,0xAA,0xAA, 0xBB,0xBB,0xBB,
1434    0xCC,0xCC,0xCC, 0xDD,0xDD,0xDD, 0xEE,0xEE,0xEE, 0xFF,0xFF,0xFF,
14351435
14361436GOLD
1437    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1438    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1439    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1440    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xFF,0x97,   
1437    0x1A,0x07,0x00, 0x2B,0x18,0x00, 0x3C,0x29,0x00, 0x4D,0x3A,0x00,
1438    0x5E,0x4B,0x00, 0x6F,0x5C,0x00, 0x80,0x6D,0x00, 0x91,0x7E,0x09,
1439    0xA2,0x8F,0x1A, 0xB3,0xA0,0x2B, 0xC4,0xB1,0x3C, 0xD5,0xC2,0x4D,
1440    0xE6,0xD3,0x5E, 0xF7,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xFF,0x97,
14411441
14421442ORANGE
1443    0x32,0x00,0x00, 0x43,0x05,0x00, 0x54,0x16,0x00, 0x65,0x27,0x00,
1444    0x76,0x38,0x00, 0x87,0x49,0x00, 0x98,0x5A,0x0C, 0xA9,0x6B,0x1D,
1445    0xBA,0x7C,0x2E, 0xCB,0x8D,0x3F, 0xDC,0x9E,0x50, 0xED,0xAF,0x61,
1446    0xFE,0xC0,0x72, 0xFF,0xD1,0x88, 0xFF,0xE2,0x9E, 0xFF,0xF3,0xB4,   
1443    0x32,0x00,0x00, 0x43,0x05,0x00, 0x54,0x16,0x00, 0x65,0x27,0x00,
1444    0x76,0x38,0x00, 0x87,0x49,0x00, 0x98,0x5A,0x0C, 0xA9,0x6B,0x1D,
1445    0xBA,0x7C,0x2E, 0xCB,0x8D,0x3F, 0xDC,0x9E,0x50, 0xED,0xAF,0x61,
1446    0xFE,0xC0,0x72, 0xFF,0xD1,0x88, 0xFF,0xE2,0x9E, 0xFF,0xF3,0xB4,
14471447
14481448RED-ORANGE
1449    0x3F,0x00,0x00, 0x50,0x00,0x00, 0x61,0x06,0x00, 0x72,0x17,0x03,
1450    0x83,0x28,0x14, 0x94,0x39,0x25, 0xA5,0x4A,0x36, 0xB6,0x5B,0x47,
1451    0xC7,0x6C,0x58, 0xD8,0x7D,0x69, 0xE9,0x8E,0x7A, 0xFA,0x9F,0x8B,
1452    0xFF,0xB0,0x9F, 0xFF,0xC1,0xB5, 0xFF,0xD2,0xCB, 0xFF,0xE3,0xE1,   
1449    0x3F,0x00,0x00, 0x50,0x00,0x00, 0x61,0x06,0x00, 0x72,0x17,0x03,
1450    0x83,0x28,0x14, 0x94,0x39,0x25, 0xA5,0x4A,0x36, 0xB6,0x5B,0x47,
1451    0xC7,0x6C,0x58, 0xD8,0x7D,0x69, 0xE9,0x8E,0x7A, 0xFA,0x9F,0x8B,
1452    0xFF,0xB0,0x9F, 0xFF,0xC1,0xB5, 0xFF,0xD2,0xCB, 0xFF,0xE3,0xE1,
14531453
14541454PINK
1455    0x3D,0x00,0x10, 0x4E,0x00,0x1C, 0x5F,0x00,0x27, 0x70,0x0D,0x37,
1456    0x81,0x1E,0x48, 0x92,0x2F,0x59, 0xA3,0x40,0x6A, 0xB4,0x51,0x7B,
1457    0xC5,0x62,0x8C, 0xD6,0x73,0x9D, 0xE7,0x84,0xAE, 0xF8,0x95,0xBF,
1458    0xFF,0xA6,0xD3, 0xFF,0xB7,0xE9, 0xFF,0xC8,0xEE, 0xFF,0xD9,0xF4,   
1455    0x3D,0x00,0x10, 0x4E,0x00,0x1C, 0x5F,0x00,0x27, 0x70,0x0D,0x37,
1456    0x81,0x1E,0x48, 0x92,0x2F,0x59, 0xA3,0x40,0x6A, 0xB4,0x51,0x7B,
1457    0xC5,0x62,0x8C, 0xD6,0x73,0x9D, 0xE7,0x84,0xAE, 0xF8,0x95,0xBF,
1458    0xFF,0xA6,0xD3, 0xFF,0xB7,0xE9, 0xFF,0xC8,0xEE, 0xFF,0xD9,0xF4,
14591459
14601460PURPLE
1461    0x2D,0x00,0x42, 0x3E,0x00,0x4E, 0x4F,0x00,0x5A, 0x60,0x0C,0x6A,
1462    0x71,0x1D,0x7B, 0x82,0x2E,0x8C, 0x93,0x3F,0x9D, 0xA4,0x50,0xAE,
1463    0xB5,0x61,0xBF, 0xC6,0x72,0xD0, 0xD7,0x83,0xE1, 0xE8,0x94,0xE6,
1464    0xF9,0xA5,0xE6, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,   
1461    0x2D,0x00,0x42, 0x3E,0x00,0x4E, 0x4F,0x00,0x5A, 0x60,0x0C,0x6A,
1462    0x71,0x1D,0x7B, 0x82,0x2E,0x8C, 0x93,0x3F,0x9D, 0xA4,0x50,0xAE,
1463    0xB5,0x61,0xBF, 0xC6,0x72,0xD0, 0xD7,0x83,0xE1, 0xE8,0x94,0xE6,
1464    0xF9,0xA5,0xE6, 0xFF,0xB6,0xE9, 0xFF,0xC7,0xEE, 0xFF,0xD8,0xF3,
14651465
14661466PURPLE-BLUE
1467    0x13,0x00,0x67, 0x24,0x00,0x73, 0x35,0x03,0x80, 0x46,0x14,0x91,
1468    0x57,0x25,0xA2, 0x68,0x36,0xB3, 0x79,0x47,0xC4, 0x8A,0x58,0xD5,
1469    0x9B,0x69,0xE6, 0xAC,0x7A,0xF0, 0xBD,0x8B,0xF0, 0xCE,0x9C,0xF0,
1470    0xDF,0xAD,0xF0, 0xF0,0xBE,0xF0, 0xFF,0xCF,0xF1, 0xFF,0xE0,0xF6,   
1467    0x13,0x00,0x67, 0x24,0x00,0x73, 0x35,0x03,0x80, 0x46,0x14,0x91,
1468    0x57,0x25,0xA2, 0x68,0x36,0xB3, 0x79,0x47,0xC4, 0x8A,0x58,0xD5,
1469    0x9B,0x69,0xE6, 0xAC,0x7A,0xF0, 0xBD,0x8B,0xF0, 0xCE,0x9C,0xF0,
1470    0xDF,0xAD,0xF0, 0xF0,0xBE,0xF0, 0xFF,0xCF,0xF1, 0xFF,0xE0,0xF6,
14711471
14721472BLUE1
1473    0x00,0x00,0x70, 0x05,0x01,0x80, 0x16,0x12,0x91, 0x27,0x23,0xA2,
1474    0x38,0x34,0xB3, 0x49,0x45,0xC4, 0x5A,0x56,0xD5, 0x6B,0x67,0xE6,
1475    0x7C,0x78,0xF7, 0x8D,0x89,0xFE, 0x9E,0x9A,0xFE, 0xAF,0xAB,0xFE,
1476    0xC0,0xBC,0xFE, 0xD1,0xCD,0xFE, 0xE2,0xDE,0xFE, 0xF3,0xEF,0xFE,   
1473    0x00,0x00,0x70, 0x05,0x01,0x80, 0x16,0x12,0x91, 0x27,0x23,0xA2,
1474    0x38,0x34,0xB3, 0x49,0x45,0xC4, 0x5A,0x56,0xD5, 0x6B,0x67,0xE6,
1475    0x7C,0x78,0xF7, 0x8D,0x89,0xFE, 0x9E,0x9A,0xFE, 0xAF,0xAB,0xFE,
1476    0xC0,0xBC,0xFE, 0xD1,0xCD,0xFE, 0xE2,0xDE,0xFE, 0xF3,0xEF,0xFE,
14771477
14781478BLUE2
1479    0x00,0x03,0x5B, 0x00,0x14,0x71, 0x00,0x25,0x87, 0x0C,0x36,0x9A,
1480    0x1D,0x47,0xAB, 0x2E,0x58,0xBC, 0x3F,0x69,0xCD, 0x50,0x7A,0xDE,
1481    0x61,0x8B,0xEF, 0x72,0x9C,0xFF, 0x83,0xAD,0xFF, 0x94,0xBE,0xFF,
1482    0xA5,0xCF,0xFF, 0xB6,0xE0,0xFF, 0xC7,0xF1,0xFF, 0xD8,0xFF,0xFF,   
1479    0x00,0x03,0x5B, 0x00,0x14,0x71, 0x00,0x25,0x87, 0x0C,0x36,0x9A,
1480    0x1D,0x47,0xAB, 0x2E,0x58,0xBC, 0x3F,0x69,0xCD, 0x50,0x7A,0xDE,
1481    0x61,0x8B,0xEF, 0x72,0x9C,0xFF, 0x83,0xAD,0xFF, 0x94,0xBE,0xFF,
1482    0xA5,0xCF,0xFF, 0xB6,0xE0,0xFF, 0xC7,0xF1,0xFF, 0xD8,0xFF,0xFF,
14831483
14841484LIGHT-BLUE
1485    0x00,0x15,0x35, 0x00,0x26,0x4B, 0x00,0x37,0x61, 0x00,0x48,0x78,
1486    0x0A,0x59,0x8B, 0x1B,0x6A,0x9C, 0x2C,0x7B,0xAD, 0x3D,0x8C,0xBE,
1487    0x4E,0x9D,0xCF, 0x5F,0xAE,0xE0, 0x70,0xBF,0xF1, 0x81,0xD0,0xFF,
1488    0x92,0xE1,0xFF, 0xA3,0xF2,0xFF, 0xB4,0xFF,0xFF, 0xC5,0xFF,0xFF,   
1485    0x00,0x15,0x35, 0x00,0x26,0x4B, 0x00,0x37,0x61, 0x00,0x48,0x78,
1486    0x0A,0x59,0x8B, 0x1B,0x6A,0x9C, 0x2C,0x7B,0xAD, 0x3D,0x8C,0xBE,
1487    0x4E,0x9D,0xCF, 0x5F,0xAE,0xE0, 0x70,0xBF,0xF1, 0x81,0xD0,0xFF,
1488    0x92,0xE1,0xFF, 0xA3,0xF2,0xFF, 0xB4,0xFF,0xFF, 0xC5,0xFF,0xFF,
14891489
14901490TURQUOISE
1491    0x00,0x22,0x0A, 0x00,0x33,0x19, 0x00,0x44,0x2F, 0x00,0x55,0x45,
1492    0x04,0x66,0x5A, 0x15,0x77,0x6B, 0x26,0x88,0x7C, 0x37,0x99,0x8D,
1493    0x48,0xAA,0x9E, 0x59,0xBB,0xAF, 0x6A,0xCC,0xC0, 0x7B,0xDD,0xD1,
1494    0x8C,0xEE,0xE2, 0x9D,0xFF,0xF3, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,   
1491    0x00,0x22,0x0A, 0x00,0x33,0x19, 0x00,0x44,0x2F, 0x00,0x55,0x45,
1492    0x04,0x66,0x5A, 0x15,0x77,0x6B, 0x26,0x88,0x7C, 0x37,0x99,0x8D,
1493    0x48,0xAA,0x9E, 0x59,0xBB,0xAF, 0x6A,0xCC,0xC0, 0x7B,0xDD,0xD1,
1494    0x8C,0xEE,0xE2, 0x9D,0xFF,0xF3, 0xAE,0xFF,0xFF, 0xBF,0xFF,0xFF,
14951495
14961496GREEN-BLUE
1497    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1B,
1498    0x0D,0x6B,0x25, 0x1E,0x7C,0x36, 0x2F,0x8D,0x47, 0x40,0x9E,0x58,
1499    0x51,0xAF,0x69, 0x62,0xC0,0x7A, 0x73,0xD1,0x8B, 0x84,0xE2,0x9C,
1500    0x95,0xF3,0xAD, 0xA6,0xFF,0xBD, 0xB7,0xFF,0xC9, 0xC8,0xFF,0xD4,   
1497    0x00,0x27,0x0C, 0x00,0x38,0x11, 0x00,0x49,0x16, 0x00,0x5A,0x1B,
1498    0x0D,0x6B,0x25, 0x1E,0x7C,0x36, 0x2F,0x8D,0x47, 0x40,0x9E,0x58,
1499    0x51,0xAF,0x69, 0x62,0xC0,0x7A, 0x73,0xD1,0x8B, 0x84,0xE2,0x9C,
1500    0x95,0xF3,0xAD, 0xA6,0xFF,0xBD, 0xB7,0xFF,0xC9, 0xC8,0xFF,0xD4,
15011501
15021502GREEN
1503    0x00,0x24,0x0B, 0x00,0x35,0x10, 0x01,0x46,0x15, 0x12,0x57,0x15,
1504    0x23,0x68,0x15, 0x34,0x79,0x15, 0x45,0x8A,0x19, 0x56,0x9B,0x2A,
1505    0x67,0xAC,0x3B, 0x78,0xBD,0x4C, 0x89,0xCE,0x5D, 0x9A,0xDF,0x6E,
1506    0xAB,0xF0,0x7F, 0xBC,0xFF,0x8F, 0xCD,0xFF,0x9B, 0xDE,0xFF,0xA7,   
1503    0x00,0x24,0x0B, 0x00,0x35,0x10, 0x01,0x46,0x15, 0x12,0x57,0x15,
1504    0x23,0x68,0x15, 0x34,0x79,0x15, 0x45,0x8A,0x19, 0x56,0x9B,0x2A,
1505    0x67,0xAC,0x3B, 0x78,0xBD,0x4C, 0x89,0xCE,0x5D, 0x9A,0xDF,0x6E,
1506    0xAB,0xF0,0x7F, 0xBC,0xFF,0x8F, 0xCD,0xFF,0x9B, 0xDE,0xFF,0xA7,
15071507
15081508YELLOW-GREEN
1509    0x00,0x18,0x07, 0x00,0x29,0x0C, 0x1E,0x3A,0x08, 0x2F,0x4B,0x08,
1510    0x40,0x5C,0x08, 0x51,0x6D,0x08, 0x62,0x7E,0x08, 0x73,0x8F,0x0D,
1511    0x84,0xA0,0x1E, 0x95,0xB1,0x2F, 0xA6,0xC2,0x40, 0xB7,0xD3,0x51,
1512    0xC8,0xE4,0x62, 0xD9,0xF5,0x73, 0xEA,0xFF,0x82, 0xFB,0xFF,0x8E,   
1509    0x00,0x18,0x07, 0x00,0x29,0x0C, 0x1E,0x3A,0x08, 0x2F,0x4B,0x08,
1510    0x40,0x5C,0x08, 0x51,0x6D,0x08, 0x62,0x7E,0x08, 0x73,0x8F,0x0D,
1511    0x84,0xA0,0x1E, 0x95,0xB1,0x2F, 0xA6,0xC2,0x40, 0xB7,0xD3,0x51,
1512    0xC8,0xE4,0x62, 0xD9,0xF5,0x73, 0xEA,0xFF,0x82, 0xFB,0xFF,0x8E,
15131513
15141514ORANGE-GREEN
1515    0x1B,0x07,0x00, 0x2C,0x18,0x00, 0x3D,0x29,0x00, 0x4E,0x3A,0x00,
1516    0x5F,0x4B,0x00, 0x70,0x5C,0x00, 0x81,0x6D,0x00, 0x92,0x7E,0x09,
1517    0xA3,0x8F,0x1A, 0xB4,0xA0,0x2B, 0xC5,0xB1,0x3C, 0xD6,0xC2,0x4D,
1518    0xE7,0xD3,0x5E, 0xF8,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xFF,0x97,   
1515    0x1B,0x07,0x00, 0x2C,0x18,0x00, 0x3D,0x29,0x00, 0x4E,0x3A,0x00,
1516    0x5F,0x4B,0x00, 0x70,0x5C,0x00, 0x81,0x6D,0x00, 0x92,0x7E,0x09,
1517    0xA3,0x8F,0x1A, 0xB4,0xA0,0x2B, 0xC5,0xB1,0x3C, 0xD6,0xC2,0x4D,
1518    0xE7,0xD3,0x5E, 0xF8,0xE4,0x6F, 0xFF,0xF5,0x83, 0xFF,0xFF,0x97,
15191519
15201520LIGHT-ORANGE
1521    0x33,0x00,0x00, 0x44,0x05,0x00, 0x55,0x16,0x00, 0x66,0x27,0x00,
1522    0x77,0x38,0x00, 0x88,0x49,0x00, 0x99,0x5A,0x0D, 0xAA,0x6B,0x1E,
1523    0xBB,0x7C,0x2F, 0xCC,0x8D,0x40, 0xDD,0x9E,0x51, 0xEE,0xAF,0x62,
1524    0xFF,0xC0,0x73, 0xFF,0xD1,0x89, 0xFF,0xE2,0x9F, 0xFF,0xF3,0xB5   
1521    0x33,0x00,0x00, 0x44,0x05,0x00, 0x55,0x16,0x00, 0x66,0x27,0x00,
1522    0x77,0x38,0x00, 0x88,0x49,0x00, 0x99,0x5A,0x0D, 0xAA,0x6B,0x1E,
1523    0xBB,0x7C,0x2F, 0xCC,0x8D,0x40, 0xDD,0x9E,0x51, 0xEE,0xAF,0x62,
1524    0xFF,0xC0,0x73, 0xFF,0xD1,0x89, 0xFF,0xE2,0x9F, 0xFF,0xF3,0xB5
15251525*******************************************************************/
15261526
15271527/**************************************************************
trunk/src/mess/drivers/c80.c
r26736r26737
2020    M : MEMory manipulation
2121    G : GO
2222  F10 : RESet
23  ESC : BRK   
23  ESC : BRK
2424
2525Functions (press F1 then the indicated number):
2626    0 : FILL
trunk/src/mess/drivers/mc1502.c
r26736r26737
8383   key |= ioport("Y10")->read();
8484   key |= ioport("Y11")->read();
8585   key |= ioport("Y12")->read();
86//   DBG_LOG(1,"mc1502_k_s_c",("= %02X (%d) %s\n", key, m_kbd.pulsing,
87//         (key || m_kbd.pulsing) ? " will IRQ" : ""));
86//  DBG_LOG(1,"mc1502_k_s_c",("= %02X (%d) %s\n", key, m_kbd.pulsing,
87//          (key || m_kbd.pulsing) ? " will IRQ" : ""));
8888
8989   /*
9090      If a key is pressed and we're not pulsing yet, start pulsing the IRQ1;
r26736r26737
110110
111111WRITE8_MEMBER(mc1502_state::mc1502_ppi_portb_w)
112112{
113//   DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data));
113//  DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data));
114114   m_ppi_portb = data;
115115   machine().device<pit8253_device>("pit8253")->gate2_w(BIT(data, 0));
116//   mc1502_speaker_set_spkrdata(BIT(data, 1));
116//  mc1502_speaker_set_spkrdata(BIT(data, 1));
117117   m_centronics->strobe_w(BIT(data, 2));
118118   m_centronics->autofeed_w(BIT(data, 3));
119119   m_centronics->init_prime_w(BIT(data, 4));
r26736r26737
124124// bit 3: i8251 SYNDET pin triggers NMI (default = 1 = no)
125125WRITE8_MEMBER(mc1502_state::mc1502_ppi_portc_w)
126126{
127//   DBG_LOG(2,"mc1502_ppi_portc_w",("( %02X )\n", data));
127//  DBG_LOG(2,"mc1502_ppi_portc_w",("( %02X )\n", data));
128128   m_ppi_portc = data & 15;
129129}
130130
r26736r26737
154154   data = ( data & ~0x20 ) | ( timer2_output ? 0x20 : 0x00 );
155155   data = ( data & ~0x10 ) | ( (BIT(m_ppi_portb, 1) && timer2_output) ? 0x10 : 0x00 );
156156
157//   DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n",
158//         data, tap_val, timer2_output, machine().describe_context()));
157//  DBG_LOG(2,"mc1502_ppi_portc_r",("= %02X (tap_val %f t2out %d) at %s\n",
158//          data, tap_val, timer2_output, machine().describe_context()));
159159   return data;
160160}
161161
r26736r26737
176176   if (m_kbd.mask & 0x0400) { key |= ioport("Y11")->read(); }
177177   if (m_kbd.mask & 0x0800) { key |= ioport("Y12")->read(); }
178178   key ^= 0xff;
179//   DBG_LOG(2,"mc1502_kppi_porta_r",("= %02X\n", key));
179//  DBG_LOG(2,"mc1502_kppi_porta_r",("= %02X\n", key));
180180   return key;
181181}
182182
r26736r26737
188188      m_kbd.mask |= 1 << 11;
189189   else
190190      m_kbd.mask &= ~(1 << 11);
191//   DBG_LOG(2,"mc1502_kppi_portb_w",("( %02X -> %04X )\n", data, m_kbd.mask));
191//  DBG_LOG(2,"mc1502_kppi_portb_w",("( %02X -> %04X )\n", data, m_kbd.mask));
192192}
193193
194194WRITE8_MEMBER(mc1502_state::mc1502_kppi_portc_w)
195195{
196196   m_kbd.mask &= ~(7 << 8);
197197   m_kbd.mask |= ((data ^ 7) & 7) << 8;
198//   DBG_LOG(2,"mc1502_kppi_portc_w",("( %02X -> %04X )\n", data, m_kbd.mask));
198//  DBG_LOG(2,"mc1502_kppi_portc_w",("( %02X -> %04X )\n", data, m_kbd.mask));
199199}
200200
201201I8255_INTERFACE( mc1502_ppi8255_interface_1 )
r26736r26737
244244
245245WRITE_LINE_MEMBER(mc1502_state::mc1502_pit8253_out2_changed)
246246{
247//   mc1502_speaker_set_input( state );
247//  mc1502_speaker_set_input( state );
248248   m_cassette->output(state ? 1 : -1);
249249}
250250
r26736r26737
311311
312312static ADDRESS_MAP_START( mc1502_map, AS_PROGRAM, 8, mc1502_state )
313313   ADDRESS_MAP_UNMAP_HIGH
314   AM_RANGE(0x00000, 0x97fff) AM_RAM   /* 96K on mainboard + 512K on extension card */
314   AM_RANGE(0x00000, 0x97fff) AM_RAM   /* 96K on mainboard + 512K on extension card */
315315   AM_RANGE(0xc0000, 0xfbfff) AM_NOP
316//   AM_RANGE(0xe8000, 0xeffff) AM_ROM       /* BASIC */
316//  AM_RANGE(0xe8000, 0xeffff) AM_ROM       /* BASIC */
317317   AM_RANGE(0xfc000, 0xfffff) AM_ROM
318318ADDRESS_MAP_END
319319
r26736r26737
379379   MCFG_CASSETTE_ADD( "cassette", mc1502_cassette_interface )
380380
381381   MCFG_SOFTWARE_LIST_ADD("flop_list","mc1502_flop")
382//   MCFG_SOFTWARE_LIST_ADD("cass_list","mc1502_cass")
382//  MCFG_SOFTWARE_LIST_ADD("cass_list","mc1502_cass")
383383
384384   /* internal ram */
385385   MCFG_RAM_ADD(RAM_TAG)
trunk/src/mess/drivers/prof80.c
r26736r26737
1515
1616    TODO:
1717
18   - floppy Err on A: Select
18    - floppy Err on A: Select
1919    - NE555 timeout is 10x too high
2020    - grip31 does not work
2121    - UNIO card (Z80-STI, Z80-SIO, 2x centronics)
trunk/src/mess/drivers/poisk1.c
r26736r26737
9999   if (m_kbpoll_mask & 0x40) { key &= ioport("Y7")->read(); }
100100   if (m_kbpoll_mask & 0x80) { key &= ioport("Y8")->read(); }
101101   ret = key & 0xff;
102//   DBG_LOG(1,"p1_ppi_portb_r",("= %02X\n", ret));
102//  DBG_LOG(1,"p1_ppi_portb_r",("= %02X\n", ret));
103103   return ret;
104104}
105105
r26736r26737
143143
144144I8255_INTERFACE( p1_ppi8255_interface_1 )
145145{
146/*60H*/   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_porta_r),
146/*60H*/ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_porta_r),
147147   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_porta_w),
148/*69H*/   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_portb_r),
148/*69H*/ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_portb_r),
149149   DEVCB_NULL,
150/*6AH*/   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_portc_r),
150/*6AH*/ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_portc_r),
151151   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi_portc_w)
152152};
153153
154154I8255_INTERFACE( p1_ppi8255_interface_2 )
155155{
156/*68H*/   DEVCB_NULL,
156/*68H*/ DEVCB_NULL,
157157   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi2_porta_w),
158/*61H*/   DEVCB_NULL,
158/*61H*/ DEVCB_NULL,
159159   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi2_portb_w),
160/*62H*/   DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi2_portc_r),
160/*62H*/ DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, p1_state, p1_ppi2_portc_r),
161161   DEVCB_NULL
162162};
163163
164164READ8_MEMBER(p1_state::p1_ppi_r)
165165{
166//   DBG_LOG(1,"p1ppi",("R %.2x\n", 0x60+offset));
166//  DBG_LOG(1,"p1ppi",("R %.2x\n", 0x60+offset));
167167   switch (offset) {
168168      case 0:
169169         return m_ppi8255n1->read(space, 0);
r26736r26737
185185
186186WRITE8_MEMBER(p1_state::p1_ppi_w)
187187{
188//   DBG_LOG(1,"p1ppi",("W %.2x $%02x\n", 0x60+offset, data));
188//  DBG_LOG(1,"p1ppi",("W %.2x $%02x\n", 0x60+offset, data));
189189   switch (offset) {
190190      case 0:
191191         return m_ppi8255n1->write(space, 0, data);
trunk/src/mess/drivers/rainbow.c
r26736r26737
22    DEC Rainbow 100
33
44    Driver-in-progress by R. Belmont and Miodrag Milanovic.
5   Portions (2013) by Karl-Ludwig Deisenhofer (VT video, floppy, preliminary keyboard, DIP switches).
5    Portions (2013) by Karl-Ludwig Deisenhofer (VT video, floppy, preliminary keyboard, DIP switches).
66
77    STATE AS OF DECEMBER 2013
88    --------------------------
9   - FLOPPY TIMING: 'wd17xx_complete_command' * must * be hard wired to about 13 usecs.
10     Line 1063 in 'wd17xx.c' has to be changed (until legacy code here is removed):
11     -      w->timer_cmd->adjust(attotime::from_usec(usecs));
12     +      w->timer_cmd->adjust(attotime::from_usec(13));
9    - FLOPPY TIMING: 'wd17xx_complete_command' * must * be hard wired to about 13 usecs.
10      Line 1063 in 'wd17xx.c' has to be changed (until legacy code here is removed):
11      -      w->timer_cmd->adjust(attotime::from_usec(usecs));
12      +      w->timer_cmd->adjust(attotime::from_usec(13));
1313
1414    - WORKAROUND AVAILABLE: keyboard emulation incomplete (inhibits the system from booting with ERROR 50 on cold or ERROR 13 on warm boot).
15   - NOT WORKING: serial (ERROR 60).
15    - NOT WORKING: serial (ERROR 60).
1616    - NOT WORKING: printer interface (ERROR 40). Like error 60 not mission-critical.
1717
1818    - NON-CRITICAL: watchdog logic (triggered after 108 ms without interrupts on original machine) still does not work as intended.
1919
20               Timer is reset by TWO sources: the VERT INT L from the DC012, or the MHFU ENB L from the enable flip-flop.
21               The MHFU gets active if the 8088 has not acknowledged a video processor interrupt within approx. 108 milliseconds.
22   
23               BIOS assumes a power-up reset if MHFU detection is disabled - and assumes a MHFU reset if MHFU detection is ENABLED.
24               
25               As there is no reset switch, only a limited software reset exists on a real DEC-100 (CTRL-SETUP within SETUP).
20                    Timer is reset by TWO sources: the VERT INT L from the DC012, or the MHFU ENB L from the enable flip-flop.
21                    The MHFU gets active if the 8088 has not acknowledged a video processor interrupt within approx. 108 milliseconds.
2622
23                    BIOS assumes a power-up reset if MHFU detection is disabled - and assumes a MHFU reset if MHFU detection is ENABLED.
24
25                    As there is no reset switch, only a limited software reset exists on a real DEC-100 (CTRL-SETUP within SETUP).
26
2727    - TO BE IMPLEMENTED AS SLOT DEVICES (for now, DIP settings affect 'system_parameter_r' only and are disabled):
2828            * Color graphics option (uses NEC upd7220 GDC)
2929            * Extended communication option (same as BUNDLE_OPTION ?)
3030
3131    - OTHER UPGRADES (NEC_V20 should be easy, the TURBOW is harder to come by)
32         * Suitable Solutions TURBOW286: 12 Mhz, 68-pin, low power AMD N80L286-12 and WAYLAND/EDSUN EL286-88-10-B ( 80286 to 8088 Processor Signal Converter )
33           plus DC 7174 or DT 7174 (barely readable). Add-on card, replaces main 8088 cpu (via ribbon cable). Altered BOOT ROM labeled 'TBSS1.3 - 3ED4'.
32            * Suitable Solutions TURBOW286: 12 Mhz, 68-pin, low power AMD N80L286-12 and WAYLAND/EDSUN EL286-88-10-B ( 80286 to 8088 Processor Signal Converter )
33              plus DC 7174 or DT 7174 (barely readable). Add-on card, replaces main 8088 cpu (via ribbon cable). Altered BOOT ROM labeled 'TBSS1.3 - 3ED4'.
3434
35         * NEC_V20 (requires modded BOOT ROM because of - at least 2 - hard coded timing loops):
36                 100A:         100B/100+:                  100B+ ALTERNATE RECOMMENDATION (fixes RAM size auto-detection problems when V20 is in place.
37                                                               Tested on a 30+ year old live machine. Your mileage may vary)
35            * NEC_V20 (requires modded BOOT ROM because of - at least 2 - hard coded timing loops):
36                 100A:         100B/100+:                       100B+ ALTERNATE RECOMMENDATION (fixes RAM size auto-detection problems when V20 is in place.
37                                                                Tested on a 30+ year old live machine. Your mileage may vary)
3838
39                 Location Data   Location Data                   Loc.|Data                       
40                ....     ..    ....     ..  ------------------ 00C6 46 [ increases 'wait for Z80' from approx. 27,5 ms (old value 40) to 30,5 ms ]
41                ....     ..    ....     ..  ------------------ 0303 00 [ disable CHECKSUM ]
42                 043F     64    072F     64   <----------------->   072F 73 [ increases minimum cycle time from 2600 (64) to 3000 ms (73) ]
43                 067D     20   0B36     20   <-----------------> 0B36 20 [ USE A VALUE OF 20 FOR THE NEC - as in the initial patch! CHANGES CAUSE VFR-ERROR 10 ]
44                 1FFE     2B   3FFE     1B  (BIOS CHECKSUM)   
45                 1FFF     70   3FFF     88  (BIOS CHECKSUM)   
39                 Location Data  Location Data                   Loc.|Data
40                 ....     ..    ....     ..  ------------------ 00C6 46 [ increases 'wait for Z80' from approx. 27,5 ms (old value 40) to 30,5 ms ]
41                 ....     ..    ....     ..  ------------------ 0303 00 [ disable CHECKSUM ]
42                 043F     64    072F     64 <-----------------> 072F 73 [ increases minimum cycle time from 2600 (64) to 3000 ms (73) ]
43                 067D     20    0B36     20 <-----------------> 0B36 20 [ USE A VALUE OF 20 FOR THE NEC - as in the initial patch! CHANGES CAUSE VFR-ERROR 10 ]
44                 1FFE     2B    3FFE     1B  (BIOS CHECKSUM)
45                 1FFF     70    3FFF     88  (BIOS CHECKSUM)
4646
47          => the 'leaked' DOS 3.10 Beta -for Rainbow- 'should not be used' on rigs with NEC V20. It possibly wasn't tested, but boots and runs well.
48          => on the NEC, auto detection (of option RAM) fails with the original V20 patch (above, left)
49             Expect RAM related system crashes after swapping CPUs and altering physical RAM _afterwards_.
50            Hard coded CPU loops are to blame. Try values from the alternate patch (right).
51          => AAD/AAM - Intel 8088 honors the second byte (operand), NEC V20 ignores it and always uses base 0Ah (10).
52          => UNDOCUMENTED: NEC V20 does not have "POP CS" (opcode 0F). There are more differences (opcode D6; the 2 byte POP: 8F Cx; FF Fx instructions)
53             Commercial programs had to be patched back then (as was the case with Loderunner for PC).
54          => NEW OPCODES: REPC, REPNC, CHKIND, PREPARE, DISPOSE; BCD string operations (ADD4S, CMP4S, SUB4S), bit-ops (NOT, SET, TEST, ROL4, ROR4)
55             WARNING: undoc'd opcodes, INS, EXT and 8080 behaviour are unemulated yet! MESS' CPU source has up-to-date info.
47             => the 'leaked' DOS 3.10 Beta -for Rainbow- 'should not be used' on rigs with NEC V20. It possibly wasn't tested, but boots and runs well.
48             => on the NEC, auto detection (of option RAM) fails with the original V20 patch (above, left)
49                Expect RAM related system crashes after swapping CPUs and altering physical RAM _afterwards_.
50                Hard coded CPU loops are to blame. Try values from the alternate patch (right).
51             => AAD/AAM - Intel 8088 honors the second byte (operand), NEC V20 ignores it and always uses base 0Ah (10).
52             => UNDOCUMENTED: NEC V20 does not have "POP CS" (opcode 0F). There are more differences (opcode D6; the 2 byte POP: 8F Cx; FF Fx instructions)
53                Commercial programs had to be patched back then (as was the case with Loderunner for PC).
54             => NEW OPCODES: REPC, REPNC, CHKIND, PREPARE, DISPOSE; BCD string operations (ADD4S, CMP4S, SUB4S), bit-ops (NOT, SET, TEST, ROL4, ROR4)
55                WARNING: undoc'd opcodes, INS, EXT and 8080 behaviour are unemulated yet! MESS' CPU source has up-to-date info.
5656
5757    Meaning of Diagnostics LEDs (from PC100ESV1.PDF found, e.g.,
5858    on ftp://ftp.update.uu.se/pub/rainbow/doc/rainbow-docs/
r26736r26737
138138|        ROM (4K)           ...J7...  | ...J9 = RX50 |
139139|------------PCB# 5416206 / 5016205-01C1-------------|
140140NOTES
141W5 + W6 are out when 16K x 8 EPROMS are used 
141W5 + W6 are out when 16K x 8 EPROMS are used
142142/ W5 + W6 installed => 32 K x 8 EPROMs (pin 27 = A14)
143143
144144W13, W14, W15, W18 = for manufacturing tests.
r26736r26737
146146=> W18 pulls DSR to ground and affects 8251A - port $11 (bit 7)
147147
148148!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
149!! DO NOT SHORT JUMPER / CONNECTOR [W90] ON LIVE HARDWARE  !!
150!!                                                         !!   
149!! DO NOT SHORT JUMPER / CONNECTOR [W90] ON LIVE HARDWARE  !!
150!!                                                         !!
151151!! WARNING:  CIRCUIT DAMAGE could occur if this jumper is  !!
152!! set by end users.        See PDF document AA-V523A-TV.  !!
153!!                                                         !!   
154!! W90 connects to pin 2 (Voltage Bias on PWR connector J8)!!
152!! set by end users.        See PDF document AA-V523A-TV.  !!
153!!                                                         !!
154!! W90 connects to pin 2 (Voltage Bias on PWR connector J8)!!
155155!! and is designed FOR ===> FACTORY TESTS OF THE PSU <===  !!
156156!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
157157
r26736r26737
161161****************************************************************************/
162162
163163// Workarounds DO NOT APPLY to the 190-B ROM. Only enable when compiling the 'rainbow' driver -
164//#define FORCE_RAINBOW_100_LOGO
165#define KBD_DELAY 875 // (debounce delay). Recommended: 875.
164//#define FORCE_RAINBOW_100_LOGO
165#define KBD_DELAY 875 // (debounce delay). Recommended: 875.
166166
167167#include "emu.h"
168168#include "cpu/i86/i86.h"
r26736r26737
310310
311311
312312void rainbow_state::machine_start()
313{ 
313{
314314   m_image[0] = subdevice(FLOPPY_0);
315315   m_image[1] = subdevice(FLOPPY_1);
316316   m_image[2] = subdevice(FLOPPY_2);
r26736r26737
329329
330330   UINT8 *rom = memregion("maincpu")->base();
331331
332   
332
333333#ifdef FORCE_RAINBOW_100_LOGO
334 rom[0xf4174]=0xeb; // jmps  RAINBOW100_LOGO__loc_33D
335 rom[0xf4175]=0x08; 
334   rom[0xf4174]=0xeb; // jmps  RAINBOW100_LOGO__loc_33D
335   rom[0xf4175]=0x08;
336336
337 rom[0xf4000 + 0x364a]= 0x0a; 
338 rom[0xf4384]=0xeb; // JMPS  =>  BOOT80
337   rom[0xf4000 + 0x364a]= 0x0a;
338   rom[0xf4384]=0xeb; // JMPS  =>  BOOT80
339339#endif
340340
341341   // Enables PORT90_W + PORT91_W via BIOS call (offset +$21 in HIGH ROM)
r26736r26737
382382   //  - ED000 - ED0FF is the area the _DEC-100-B BIOS_ accesses - and checks.
383383
384384   //  - Specs say that the CPU has direct access to volatile RAM only.
385   //    So NVRAM is hidden now and loads & saves are triggered within the
385   //    So NVRAM is hidden now and loads & saves are triggered within the
386386   //    'diagnostic_w' handler (similar to real hardware).
387387
388   //  - Address bits 8-12 are ignored (-> AM_MIRROR).
389   AM_RANGE(0xed000, 0xed0ff) AM_RAM AM_SHARE("vol_ram") AM_MIRROR(0x1f00)
390   AM_RANGE(0xed100, 0xed1ff) AM_RAM AM_SHARE("nvram")
388   //  - Address bits 8-12 are ignored (-> AM_MIRROR).
389   AM_RANGE(0xed000, 0xed0ff) AM_RAM AM_SHARE("vol_ram") AM_MIRROR(0x1f00)
390   AM_RANGE(0xed100, 0xed1ff) AM_RAM AM_SHARE("nvram")
391391
392392   AM_RANGE(0xee000, 0xeffff) AM_RAM AM_SHARE("p_ram")
393393   AM_RANGE(0xf0000, 0xfffff) AM_ROM
r26736r26737
410410
411411   AM_RANGE (0x0a, 0x0a) AM_READWRITE(diagnostic_r, diagnostic_w)
412412
413   // 0x0C Video processor DC012
414   AM_RANGE (0x0c, 0x0c) AM_DEVWRITE("vt100_video", rainbow_video_device, dc012_w)
413   // 0x0C Video processor DC012
414   AM_RANGE (0x0c, 0x0c) AM_DEVWRITE("vt100_video", rainbow_video_device, dc012_w)
415415
416416   // TODO: unmapped [0e] : PRINTER BIT RATE REGISTER (WO)
417417
r26736r26737
420420
421421   // UNMAPPED:
422422   // 0x20 - 0x2f ***** EXTENDED COMM. OPTION (option select 1)- for example:
423   // 0x27      (RESET EXTENDED COMM OPTION) - OUT 27 @ offset 1EA7
423   // 0x27     (RESET EXTENDED COMM OPTION) - OUT 27 @ offset 1EA7
424424
425425   // 0x40  COMMUNICATIONS DATA REGISTER (MPSC)
426426   // 0x41  PRINTER DATA REGISTER (MPSC)
r26736r26737
428428   // 0x43  PRINTER CONTROL / STATUS REGISTER (MPSC)
429429
430430   // 0x50 - 0xf  ***** OPTIONAL COLOR GRAPHICS - for example:
431   // 0x50     (RESET_GRAPH. OPTION) - OUT 50 @ offsets F5EB5 + F5EB9
431   // 0x50     (RESET_GRAPH. OPTION) - OUT 50 @ offsets F5EB5 + F5EB9
432432
433433   // ===========================================================
434   // TODO: hard disc emulation!                               
435   // ------ Rainbow uses 'WD 1010 AL' (Western Digital 1983)   
436   //        Register compatible to WD2010 (present in MESS)   
437   // R/W REGISTERS 60 - 68 (?)                                 
434   // TODO: hard disc emulation!
435   // ------ Rainbow uses 'WD 1010 AL' (Western Digital 1983)
436   //        Register compatible to WD2010 (present in MESS)
437   // R/W REGISTERS 60 - 68 (?)
438438   // ===========================================================
439439   // HARD DISC SIZES AND LIMITS
440   //   HARDWARE:
441   //      Controller has a built-in limit of 8 heads / 1024 cylinders (67 MB). Standard geometry is 4 surfaces.
442   //   SOFTWARE: the DEC boot loader (and FDISK from DOS 3.10) initially allowed a maximum hard disc size of 20 MB.
443    //   - DOS 3 has a 1024 cylinder limit (32 MB).
444    //   - the custom boot loader that comes with 'WUTIL 3.2' allows 117 MB and 8 surfaces.
440   //   HARDWARE:
441   //      Controller has a built-in limit of 8 heads / 1024 cylinders (67 MB). Standard geometry is 4 surfaces.
442   //   SOFTWARE: the DEC boot loader (and FDISK from DOS 3.10) initially allowed a maximum hard disc size of 20 MB.
443   //   - DOS 3 has a 1024 cylinder limit (32 MB).
444   //   - the custom boot loader that comes with 'WUTIL 3.2' allows 117 MB and 8 surfaces.
445445   AM_RANGE (0x68, 0x68) AM_READ(hd_status_68_r)
446446
447447   AM_RANGE (0x90, 0x90) AM_WRITE(PORT90_W)
r26736r26737
472472static INPUT_PORTS_START( rainbow100b_in )
473473/* DIP switches */
474474      PORT_START("MONITOR TYPE")
475      PORT_DIPNAME( 0x03, 0x03, "MONOCHROME MONITOR")
475      PORT_DIPNAME( 0x03, 0x03, "MONOCHROME MONITOR")
476476      PORT_DIPSETTING(    0x01, "PAPER WHITE" )
477477      PORT_DIPSETTING(    0x02, "GREEN" )
478478      PORT_DIPSETTING(    0x03, "AMBER" )
r26736r26737
516516      PORT_DIPNAME( 0x08, 0x08, "W15 (FACTORY TEST C, LEAVE OFF)") PORT_TOGGLE
517517      PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
518518      PORT_DIPSETTING(    0x00, DEF_STR( On ) )
519    // DSR = 1 when switch is OFF - see i8251.c (status_r)
519   // DSR = 1 when switch is OFF - see i8251.c (status_r)
520520   PORT_START("W18")
521      PORT_DIPNAME( 0x01, 0x00, "W18 (FACTORY TEST D, LEAVE OFF) (8251A: DSR)") PORT_TOGGLE
521      PORT_DIPNAME( 0x01, 0x00, "W18 (FACTORY TEST D, LEAVE OFF) (8251A: DSR)") PORT_TOGGLE
522522      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
523523      PORT_DIPSETTING(    0x01, DEF_STR( On ) )
524524      PORT_WRITE_LINE_DEVICE_MEMBER("kbdser", i8251_device, write_dsr)
525525
526    // J17 jumper on FDC controller board shifts drive select (experimental) -
527   PORT_START("FLOPPY CONTROLLER")
526   // J17 jumper on FDC controller board shifts drive select (experimental) -
527   PORT_START("FLOPPY CONTROLLER")
528528      PORT_DIPNAME( 0x02, 0x00, "J17 DRIVE SELECT (A => C and B => D)") PORT_TOGGLE
529529      PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
530530      PORT_DIPSETTING(    0x02, DEF_STR( On ) )
531531INPUT_PORTS_END
532532
533// 800K native format (80 * 10). Also reads VT-180 disks and PC-DOS 360 k disks
533// 800K native format (80 * 10). Also reads VT-180 disks and PC-DOS 360 k disks
534534// ( both: 512 byte sectors, single sided, 9 sectors per track, 40 tracks )
535535static LEGACY_FLOPPY_OPTIONS_START( dec100_floppy )
536    LEGACY_FLOPPY_OPTION( dec100_floppy, "td0", "Teledisk floppy disk image", td0_dsk_identify, td0_dsk_construct, td0_dsk_destruct, NULL )
537   LEGACY_FLOPPY_OPTION( dec100_floppy, "img", "DEC Rainbow 100", basicdsk_identify_default, basicdsk_construct_default,    NULL,             
536   LEGACY_FLOPPY_OPTION( dec100_floppy, "td0", "Teledisk floppy disk image", td0_dsk_identify, td0_dsk_construct, td0_dsk_destruct, NULL )
537   LEGACY_FLOPPY_OPTION( dec100_floppy, "img", "DEC Rainbow 100", basicdsk_identify_default, basicdsk_construct_default,    NULL,
538538      HEADS([1])
539539      TRACKS(40/[80])
540540      SECTORS(9/[10])
r26736r26737
543543      FIRST_SECTOR_ID([1])
544544                  )
545545LEGACY_FLOPPY_OPTIONS_END
546
546
547547void rainbow_state::machine_reset()
548548{
549549   if (COLD_BOOT == 1)
r26736r26737
595595   m_crtc->palette_select( m_inp9->read() );
596596
597597   if ( m_SCREEN_BLANK )
598       m_crtc->video_blanking(bitmap, cliprect);
599   else
600       m_crtc->video_update(bitmap, cliprect);
598         m_crtc->video_blanking(bitmap, cliprect);
599   else
600         m_crtc->video_update(bitmap, cliprect);
601601   return 0;
602602}
603603
r26736r26737
606606
607607// Unexpected low RAM sizes are an indication of option RAM (at worst: 128 K on board) failure.
608608// While motherboard errors often render the system unbootable, bad option RAM (> 128 K)
609// can be narrowed down with the Diagnostic Disk and codes from the 'Pocket Service Guide'
609// can be narrowed down with the Diagnostic Disk and codes from the 'Pocket Service Guide'
610610// EK-PC100-PS-002 (APPENDIX B.2.2); pc100ps2.pdf
611611// ================================================================
612612// - Simulate floating bus for initial RAM detection -
613613// FIXME: code valid ONLY within ROM section F4Exxx.
614//
614//
615615// NOTE: MS-DOS 2.x unfortunately probes RAM in a similar way.
616616// => SET OPTION RAM to 896 K for unknown applications (and DOS) <=
617617// ================================================================
r26736r26737
619619{
620620   int pc = space.device().safe_pc();
621621
622   if ( ((pc & 0xFFF00) == 0xF4E00) &&
623       ( m_maincpu->state_int(I8086_DS) >= m_inp8->read() )
624      )
622   if ( ((pc & 0xFFF00) == 0xF4E00) &&
623         ( m_maincpu->state_int(I8086_DS) >= m_inp8->read() )
624      )
625625   {
626626      return (offset>>16) + 2;
627   }
627   }
628628   else
629629      return space.read_byte(offset);
630630}
r26736r26737
694694// Until a full-blown hard-disc emulation evolves, deliver an error message:
695695READ8_MEMBER(rainbow_state::hd_status_68_r)
696696{
697   // Top 3 bits = status / error code
697   // Top 3 bits = status / error code
698698   // SEE ->   W_INCHESTER__loc_80E
699699
700700   // return 0xa0; // A0 : OK, DRIVE IS READY (!)
701   
701
702702   return 0xe0; //  => 21 DRIVE NOT READY (BIOS; when W is pressed on boot screen)
703703}
704704
r26736r26737
712712   ( 1 means NOT present )
713713*/
714714   // Hard coded value 0x2000 - see DIP switch setup!
715   return 0x0f - m_inp5->read()
716               - 0                 // floppy is hard coded in emulator.
717            - m_inp7->read()
715   return 0x0f - m_inp5->read()
716            - 0                 // floppy is hard coded in emulator.
717            - m_inp7->read()
718718            - ((m_inp8->read() > 0x2000) ? 8 : 0);
719719}
720720
721721READ8_MEMBER(rainbow_state::comm_control_r)
722{
723/*   [02] COMMUNICATIONS STATUS REGISTER - PAGE 154 (**** READ **** )
724   Used to read status of SERIAL port, IRQ line of each CPU, and MHFU logic enable signal.
722{
723/*  [02] COMMUNICATIONS STATUS REGISTER - PAGE 154 (**** READ **** )
724    Used to read status of SERIAL port, IRQ line of each CPU, and MHFU logic enable signal.
725725
726726//    What the specs says on how MHFU detection is disabled:
727//     1.  by first disabling interrupts with CLI
728//     2.  by writing 0x00 to port 0x10C (handled by 'dc012_w' in vtvideo)
729//    (3.) MHFU is re-enabled by writing to 0x0c (or automatically after STI - when under BIOS control ?)
730*/   
727//    1.  by first disabling interrupts with CLI
728//    2.  by writing 0x00 to port 0x10C (handled by 'dc012_w' in vtvideo)
729//   (3.) MHFU is re-enabled by writing to 0x0c (or automatically after STI - when under BIOS control ?)
730*/
731731   // During boot phase 2, do not consider MHFU ENABLE. Prevents ERROR 16.
732732   int data;
733733   if (COLD_BOOT == 2)
r26736r26737
736736      data = m_crtc->MHFU(1);
737737
738738   return (  ( (data > 0) ? 0x00 : 0x20) |// (L): status of MHFU flag => bit pos.5
739                  (   (INT88)    ? 0x00 : 0x40 ) |               // (L)
740                  (   (INTZ80)   ? 0x00 : 0x80 )                 // (L)
741           );
739               (   (INT88)    ? 0x00 : 0x40 ) |               // (L)
740               (   (INTZ80)   ? 0x00 : 0x80 )                 // (L)
741         );
742742}
743743
744744WRITE8_MEMBER(rainbow_state::comm_control_w)
r26736r26737
765765
766766   m_KBD = 0; // reset previous command.
767767
768  if(MOTOR_DISABLE_counter == 0)
769  {
770
768   if(MOTOR_DISABLE_counter == 0)
769   {
771770   if (data == LK_CMD_POWER_UP) {      // Powerup (beep)
772771      //m_beep->set_state(1);
773772      //m_beep_counter=600;  // BELL = 125 ms
r26736r26737
800799      m_KBD = data;
801800   }
802801
803  } // prevent beeps during disk load operations
802   } // prevent beeps during disk load operations
804803}
805804
806805WRITE8_MEMBER(rainbow_state::PORT91_W)
r26736r26737
823822
824823   // NVRAM offet $A8 : BELL VOLUME (=> ENABLE BELL 0x23)
825824   if ( (m_KBD == LK_CMD_BELL) || (m_KBD == LK_CMD_ENB_BELL) )    /* BOTH sound or enable bell have a parameter */
826   {    /* max volume is 0, lowest is 0x7 */
827//      printf("\n%02x BELL CMD has bell volume = %02x\n", m_KBD, 8 - (data & 7));
825   {   /* max volume is 0, lowest is 0x7 */
826//      printf("\n%02x BELL CMD has bell volume = %02x\n", m_KBD, 8 - (data & 7));
828827      m_KBD = 0; // reset previous command.
829828   }
830829
831830   // NVRAM offet $A9 = KEYCLICK VOLUME (=> ENABLE CLK 0x1b)
832831   // NVRAM offset $8C = KEYCLICK ENABLE / DISABLE (0/1)
833   if ( ( m_KBD == LK_CMD_ENB_KEYCLK ) || ( m_KBD == LK_CMD_SOUND_CLK ) )  /* BOTH keyclick cmds have a parameter */
834   {   // max volume is 0, lowest is 0x7  - 87 (BELL VOL:1) and  80 (BELL VOL:8)
835//      printf("\n%02x CLICK CMD - keyclick volume = %02x\n", m_KBD, 8 - (data & 7));
832   if ( ( m_KBD == LK_CMD_ENB_KEYCLK ) || ( m_KBD == LK_CMD_SOUND_CLK ) )  /* BOTH keyclick cmds have a parameter */
833   {   // max volume is 0, lowest is 0x7  - 87 (BELL VOL:1) and  80 (BELL VOL:8)
834//      printf("\n%02x CLICK CMD - keyclick volume = %02x\n", m_KBD, 8 - (data & 7));
836835      m_KBD = 0; // reset previous command.
837836   }
838837
839if (m_KBD > 0)   
838if (m_KBD > 0)
840839   printf("UNHANDLED PARAM FOR MODE: %02x / KBD PARAM %02x to AH (91) \n", m_KBD, data);
841840
842841}
r26736r26737
846845//    printf("Read %02x from 8088 mailbox\n", m_8088_mailbox);
847846   m_i8088->set_input_line(INPUT_LINE_INT0, CLEAR_LINE);
848847
849   INT88 = false; // BISLANG:  INTZ80 = false; //   
848   INT88 = false; // BISLANG:  INTZ80 = false; //
850849   return m_8088_mailbox;
851850}
852851
r26736r26737
857856   m_z80->set_input_line_and_vector(0, ASSERT_LINE, 0xf7);
858857   m_z80_mailbox = data;
859858
860   INTZ80 = true; //
859   INTZ80 = true; //
861860}
862861
863862// Z80 reads port 0x00
r26736r26737
867866//    printf("Read %02x from Z80 mailbox\n", m_z80_mailbox);
868867   m_z80->set_input_line(0, CLEAR_LINE);
869868
870   INTZ80 = false; // BISLANG: INT88 = false;
869   INTZ80 = false; // BISLANG: INT88 = false;
871870   return m_z80_mailbox;
872871}
873872
r26736r26737
879878   m_i8088->set_input_line_and_vector(INPUT_LINE_INT0, ASSERT_LINE, 0x27);
880879   m_8088_mailbox = data;
881880
882   INT88 = true;
881   INT88 = true;
883882}
884883
885884// WRITE to 0x20
r26736r26737
891890// (Z80) : PORT 21H  _READ_
892891READ8_MEMBER(rainbow_state::z80_generalstat_r)
893892{
894/*   
893/*
895894General / diag.status register Z80 / see page 157 (table 4-18).
896895
897896D7 : STEP L : reflects status of STEP signal _FROM FDC_
r26736r26737
910909NOTES: ALL LOW ACTIVE - EXCEPT TR00
911910*/
912911   // * TRACK 00 *  signal for current drive
913   int tk00 = ( floppy_tk00_r( m_image[m_unit] ) == CLEAR_LINE ) ? 0x20 : 0x00;
912   int tk00 = ( floppy_tk00_r( m_image[m_unit] ) == CLEAR_LINE ) ? 0x20 : 0x00;
914913
915   int fdc_ready = floppy_drive_get_flag_state( m_image[m_unit] , FLOPPY_DRIVE_READY);
914   int fdc_ready = floppy_drive_get_flag_state( m_image[m_unit] , FLOPPY_DRIVE_READY);
916915
917916   int data=(   0x80                    |   // (STEP L)
918//           (  (fdc_write_gate) )       |   
919          (  (tk00)           )                             |
920//          (   fdc_direction)                                |     
921           (  (fdc_ready)? 0x00 : 0x08 )                     |
922           (   (INT88)    ? 0x00 : 0x04 )                     |   
923             (   (INTZ80)   ? 0x00 : 0x02 )                     |     
924          (  (m_zflip)  ? 0x00 : 0x01 )
917//           (  (fdc_write_gate) )       |
918            (  (tk00)           )                             |
919//           (   fdc_direction)                                |
920            (  (fdc_ready)? 0x00 : 0x08 )                     |
921            (   (INT88)    ? 0x00 : 0x04 )                     |
922            (   (INTZ80)   ? 0x00 : 0x02 )                     |
923            (  (m_zflip)  ? 0x00 : 0x01 )
925924         );
926   
925
927926   return data;
928927}
929928
r26736r26737
945944// (Z80) : PORT 40H _READ_
946945
947946// **********************************************************************
948//  POLARITY OF _DRQ_ AND _IRQ_ (depends on controller type!) 
947//  POLARITY OF _DRQ_ AND _IRQ_ (depends on controller type!)
949948// **********************************************************************
950949READ8_MEMBER(rainbow_state::z80_diskstatus_r)
951950{
952951static int last_track;
953952int track = wd17xx_track_r(m_fdc, space, 0);
954953
955if (track != last_track)
954if (track != last_track)
956955   printf("\n%02d",track);
957956last_track = track;
958957
r26736r26737
960959
961960// AND 00111011 - return what was WRITTEN to D5-D3, D1, D0 previously
962961//                (except D7,D6,D2)
963int data = m_z80_diskcontrol && 0x3b;       
962int data = m_z80_diskcontrol && 0x3b;
964963
965// D7: DRQ: reflects status of DATA REQUEST signal from FDC.
964// D7: DRQ: reflects status of DATA REQUEST signal from FDC.
966965// '1' indicates that FDC has read data OR requires new write data.
967data |= wd17xx_drq_r(m_fdc) ? 0x80 : 0x00; 
966data |= wd17xx_drq_r(m_fdc) ? 0x80 : 0x00;
968967
969// D6: IRQ: indicates INTERRUPT REQUEST signal from FDC. Indicates that a
970//          status bit has changed. Set to 1 at the completion of any
968// D6: IRQ: indicates INTERRUPT REQUEST signal from FDC. Indicates that a
969//          status bit has changed. Set to 1 at the completion of any
971970//          command (.. see page 207 or 5-25).
972data |= wd17xx_intrq_r(m_fdc) ? 0x40 : 0x00;                       
971data |= wd17xx_intrq_r(m_fdc) ? 0x40 : 0x00;
973972
974// D5: SIDE 0H: status of side select signal at J2 + J3 of RX50 controller.
975//               For 1 sided drives, this bit will always read low (0).
973// D5: SIDE 0H: status of side select signal at J2 + J3 of RX50 controller.
974//              For 1 sided drives, this bit will always read low (0).
976975
977976// D4: MOTOR 1 ON L: 0 = indicates MOTOR 1 ON bit is set in drive control reg.
978// D3: MOTOR 0 ON L: 0 = indicates MOTOR 0 ON bit is set in drive  "
977// D3: MOTOR 0 ON L: 0 = indicates MOTOR 0 ON bit is set in drive  "
979978
980979// D2: TG43 L :  0 = INDICATES TRACK > 43 SIGNAL FROM FDC TO DISK DRIVE.
981data |= ( track > 43) ? 0x00 : 0x04;
980data |= ( track > 43) ? 0x00 : 0x04;
982981
983982// D1: DS1 H: reflect status of bits 0 and 1 form disk.control reg.
984// D0: DS0 H: " 
985  return data;
983// D0: DS0 H: "
984   return data;
986985}
987986
988987// (Z80) : PORT 40H  * WRITE *
r26736r26737
10061005   int selected_drive = 255;
10071006
10081007   if (flopimg_get_image( floppy_get_device( machine(), drive ) ) != NULL)
1009   {   selected_drive = drive;
1008   {   selected_drive = drive;
10101009      wd17xx_set_drive(m_fdc, selected_drive);
10111010   }
10121011
10131012   // WD emulation (wd17xx.c) will ignore 'side select' if set to WD1793.
10141013   // Is it safe to * always assume * single sided 400 K disks?
1015   wd17xx_set_side(m_fdc, (data & 20) ? 1 : 0); 
1014   wd17xx_set_side(m_fdc, (data & 20) ? 1 : 0);
10161015
10171016   wd17xx_dden_w(m_fdc, 0); /* SEE 'WRITE_TRACK' : 1 = SD; 0 = DD; enable double density */
10181017
1019    output_set_value("driveled0",  (selected_drive == 0) ? 1 : 0 );
1020   output_set_value("driveled1",  (selected_drive == 1) ? 1 : 0 );
1018   output_set_value("driveled0",  (selected_drive == 0) ? 1 : 0 );
1019   output_set_value("driveled1",  (selected_drive == 1) ? 1 : 0 );
10211020
1022   output_set_value("driveled2",  (selected_drive == 2) ? 1 : 0 );
1023   output_set_value("driveled3",  (selected_drive == 3) ? 1 : 0 );
1021   output_set_value("driveled2",  (selected_drive == 2) ? 1 : 0 );
1022   output_set_value("driveled3",  (selected_drive == 3) ? 1 : 0 );
10241023
1025   if (selected_drive < 4)
1026   {       
1027         m_unit = selected_drive;
1024   if (selected_drive < 4)
1025   {
1026         m_unit = selected_drive;
10281027
10291028         // MOTOR ON flags 1+2 proved to be unreliable in this context.
10301029         // So this timeout only disables LEDs.
r26736r26737
10371036            floppy_mon_w(m_image[f_num], (f_num == selected_drive) ? CLEAR_LINE : ASSERT_LINE);
10381037
10391038            // Parameters: DRIVE, STATE, FLAG
1040            floppy_drive_set_ready_state( m_image[f_num],
1041                                         (f_num == selected_drive) ? 1 : 0,
1042                                   (f_num == selected_drive) ? force_ready : 0
1039            floppy_drive_set_ready_state( m_image[f_num],
1040                                    (f_num == selected_drive) ? 1 : 0,
1041                                    (f_num == selected_drive) ? force_ready : 0
10431042                                 );
1044         }   
1043         }
10451044   }
10461045
1047   m_z80_diskcontrol = data;
1046   m_z80_diskcontrol = data;
10481047}
10491048
10501049READ8_MEMBER( rainbow_state::read_video_ram_r )
r26736r26737
10681067
10691068   return ( (m_diagnostic & (0xf1)) | (    m_inp1->read() |
10701069                                 m_inp2->read() |
1071                                 m_inp3->read()   
1072                              )
1070                                 m_inp3->read()
1071                              )
10731072         );
10741073}
10751074
r26736r26737
10781077//    printf("%02x to diag port (PC=%x)\n", data, space.device().safe_pc());
10791078   m_SCREEN_BLANK = (data & 2) ? false : true;
10801079
1081   //  SAVE / PROGRAM NVM: transfer data from volatile memory to NVM
1082   if ( !(data & 0x40)  && (m_diagnostic & 0x40) )
1083      memcpy( m_p_nvram, m_p_vol_ram, 256);
1080   //  SAVE / PROGRAM NVM: transfer data from volatile memory to NVM
1081   if ( !(data & 0x40)  && (m_diagnostic & 0x40) )
1082      memcpy( m_p_nvram, m_p_vol_ram, 256);
10841083
1085   // READ / RECALL NVM: transfer data from NVM to volatile memory
1086   if ( (data & 0x80)  && !(m_diagnostic & 0x80) )
1084   // READ / RECALL NVM: transfer data from NVM to volatile memory
1085   if ( (data & 0x80)  && !(m_diagnostic & 0x80) )
10871086      memcpy( m_p_vol_ram, m_p_nvram, 256);
1088     
1087
10891088   if (!(data & 1))
10901089   {
10911090      m_z80->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
r26736r26737
11001099      m_z80->reset();
11011100   }
11021101
1103   /*   Page 197 or 5-13 of formatter description:
1104      ZRESET L : this low input from the 8088 diagnostic write register
1105      resets the formatter controller, loads 03H into the command register,
1106      and resets the not ready (status bit 7).
1102   /*  Page 197 or 5-13 of formatter description:
1103       ZRESET L : this low input from the 8088 diagnostic write register
1104       resets the formatter controller, loads 03H into the command register,
1105       and resets the not ready (status bit 7).
11071106
1108      When ZRESET goes high (1), a restore command is executed regardless
1109      of the state of the ready signal from the diskette drive and
1110      01H is loaded into the sector register.
1107       When ZRESET goes high (1), a restore command is executed regardless
1108       of the state of the ready signal from the diskette drive and
1109       01H is loaded into the sector register.
11111110   */
1112   
1111
11131112   // reset device when going from high to low,
11141113   // restore command when going from low to high :
11151114   wd17xx_mr_w(m_fdc, (data & 1) ? 1 : 0);
r26736r26737
11561155   m_kbd8251->transmit_clock();
11571156   m_kbd8251->receive_clock();
11581157
1159   if (MOTOR_DISABLE_counter)
1158   if (MOTOR_DISABLE_counter)
11601159      MOTOR_DISABLE_counter--;
11611160
11621161   if (MOTOR_DISABLE_counter == 1)
r26736r26737
11671166         output_set_value("driveled3", 0); // DRIVE 3 (D)
11681167   }
11691168
1170    if ( m_crtc->MHFU(1) ) // MHFU ENABLED ?
1171    {           
1172/*            int data = m_crtc->MHFU(-1); // increment MHFU, return new value
1169   if ( m_crtc->MHFU(1) ) // MHFU ENABLED ?
1170   {
1171/*              int data = m_crtc->MHFU(-1); // increment MHFU, return new value
11731172                //  if (data >  480) ...
1174            //      m_crtc->MHFU(-100);
1175            //      machine().schedule_hard_reset(); // not exactly a proper watchdog reset
1176*/           
1173                //     m_crtc->MHFU(-100);
1174                //     machine().schedule_hard_reset(); // not exactly a proper watchdog reset
1175*/
11771176   }
11781177
11791178   if (m_beep_counter > 1)
r26736r26737
12741273   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
12751274
12761275   MCFG_FD1793_ADD("wd1793", rainbow_wd17xx_interface )
1277   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(floppy_intf)
1276   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(floppy_intf)
12781277   MCFG_SOFTWARE_LIST_ADD("flop_list","rainbow")
12791278
12801279   MCFG_I8251_ADD("kbdser", i8251_intf)
r26736r26737
12861285
12871286
12881287
1289// ROM definition for 100-B
1288// ROM definition for 100-B
12901289ROM_START( rainbow )
12911290   ROM_REGION(0x100000,"maincpu", 0)
12921291   ROM_LOAD( "23-022e5-00.bin",  0xf0000, 0x4000, CRC(9d1332b4) SHA1(736306d2a36bd44f95a39b36ebbab211cc8fea6e))
r26736r26737
13041303// 'Rainbow 190 B' (announced March 1985) is identical hardware with alternate ROM v5.05
13051304// According to an article in Wall Street Journal, it came with a 10 MB HD and 640 K RAM.
13061305
1307// We have no version history. The BOOT 2.4 README reveals 'recent ROM changes for MASS 11'
1308// in January 1985. These were not contained in the older version 04.03.11 (for PC-100-A)
1306// We have no version history. The BOOT 2.4 README reveals 'recent ROM changes for MASS 11'
1307// in January 1985. These were not contained in the older version 04.03.11 (for PC-100-A)
13091308// and also not present in version 05.03 (from PC-100B / PC100B+).
13101309
13111310// A first glance:
r26736r26737
13161315   ROM_REGION(0x100000,"maincpu", 0)
13171316   ROM_LOAD( "dec190rom0.bin",  0xf0000, 0x4000, CRC(FAC191D2) )
13181317   ROM_RELOAD(0xf4000,0x4000)
1319   ROM_LOAD( "dec190rom1.bin", 0xf8000, 0x4000, CRC(5CE59632) )
1318   ROM_LOAD( "dec190rom1.bin", 0xf8000, 0x4000, CRC(5CE59632) )
13201319
13211320   ROM_RELOAD(0xfc000,0x4000)
13221321   ROM_REGION(0x1000, "chargen", 0)
r26736r26737
13271326
13281327/*    YEAR  NAME         PARENT   COMPAT  MACHINE       INPUT      STATE          INIT COMPANY                         FULLNAME       FLAGS */
13291328COMP( 1983, rainbow   , 0      ,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 100-B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
1330COMP( 1985, rainb190, rainbow,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 190-B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
No newline at end of file
1329COMP( 1985, rainb190, rainbow,      0,  rainbow, rainbow100b_in, driver_device, 0,  "Digital Equipment Corporation", "Rainbow 190-B", GAME_NOT_WORKING | GAME_IMPERFECT_COLORS)
trunk/src/mess/drivers/isbc.c
r26736r26737
360360   ROM_REGION( 0x20000, "user1", ROMREGION_ERASEFF )
361361   ROM_LOAD16_BYTE( "u79.bin", 0x00001, 0x10000, CRC(144182ea) SHA1(4620ca205a6ac98fe2636183eaead7c4bfaf7a72))
362362   ROM_LOAD16_BYTE( "u36.bin", 0x00000, 0x10000, CRC(22db075f) SHA1(fd29ea77f5fc0697c8f8b66aca549aad5b9db3ea))
363//   ROM_REGION( 0x4000, "isbc215", ROMREGION_ERASEFF )
364//   ROM_LOAD16_BYTE( "174581.001.bin", 0x0000, 0x2000, CRC(ccdbc7ab) SHA1(5c2ebdde1b0252124177221ba9cacdb6d925a24d))
365//   ROM_LOAD16_BYTE( "174581.002.bin", 0x0001, 0x2000, CRC(6190fa67) SHA1(295dd4e75f699aaf93227cc4876cee8accae383a))
363//  ROM_REGION( 0x4000, "isbc215", ROMREGION_ERASEFF )
364//  ROM_LOAD16_BYTE( "174581.001.bin", 0x0000, 0x2000, CRC(ccdbc7ab) SHA1(5c2ebdde1b0252124177221ba9cacdb6d925a24d))
365//  ROM_LOAD16_BYTE( "174581.002.bin", 0x0001, 0x2000, CRC(6190fa67) SHA1(295dd4e75f699aaf93227cc4876cee8accae383a))
366366ROM_END
367367
368368ROM_START( isbc2861 )
trunk/src/mess/drivers/sh4robot.c
r26736r26737
11/***************************************************************************
2   
2
33        SH4 Robot
44
5      http://perso.telecom-paristech.fr/~polti/robot/
6     
5        http://perso.telecom-paristech.fr/~polti/robot/
6
77        27/11/2013 Skeleton driver.
88
9   
10     0x0000 0000 - 0x7FFF FFFF     : P0 area, cachable
11     0x8000 0000 - 0x9FFF FFFF     : P1 area, cachable
12     0xA000 0000 - 0xBFFF FFFF     : P2 area, non-cachable
13     0xC000 0000 - 0xDFFF FFFF     : P3 area, cachable
14     0xE000 0000 - 0xFFFF FFFF     : P4 area, non-cachable
159
16   
17     0x0000 0000 - 0x03FF FFFF     : Area 0 (boot, ROM)
18     0x0400 0000 - 0x07FF FFFF     : Area 1 (FPGA)
19     0x0800 0000 - 0x08FF FFFF     : Area 2 (SDRAM 1, 16M)
20     0x0C00 0000 - 0x0CFF FFFF     : Area 3 (SDRAM 2, 16M)
21     0x1000 0000 - 0x13FF FFFF     : Area 4 (FPGA)
22     0x1400 0000 - 0x17FF FFFF     : Area 5 (FPGA)
23     0x1800 0000 - 0x1BFF FFFF     : Area 6 (FPGA)
24     0x1C00 0000 - 0x1FFF FFFF     : Area 7 (reserved)
25 
10      0x0000 0000 - 0x7FFF FFFF     : P0 area, cachable
11      0x8000 0000 - 0x9FFF FFFF     : P1 area, cachable
12      0xA000 0000 - 0xBFFF FFFF     : P2 area, non-cachable
13      0xC000 0000 - 0xDFFF FFFF     : P3 area, cachable
14      0xE000 0000 - 0xFFFF FFFF     : P4 area, non-cachable
15
16
17      0x0000 0000 - 0x03FF FFFF     : Area 0 (boot, ROM)
18      0x0400 0000 - 0x07FF FFFF     : Area 1 (FPGA)
19      0x0800 0000 - 0x08FF FFFF     : Area 2 (SDRAM 1, 16M)
20      0x0C00 0000 - 0x0CFF FFFF     : Area 3 (SDRAM 2, 16M)
21      0x1000 0000 - 0x13FF FFFF     : Area 4 (FPGA)
22      0x1400 0000 - 0x17FF FFFF     : Area 5 (FPGA)
23      0x1800 0000 - 0x1BFF FFFF     : Area 6 (FPGA)
24      0x1C00 0000 - 0x1FFF FFFF     : Area 7 (reserved)
25
2626****************************************************************************/
2727
2828#include "emu.h"
r26736r26737
5757static const struct sh4_config sh4cpu_config = {  1,  0,  1,  0,  0,  0,  1,  1,  0, 200000000 };
5858
5959static MACHINE_CONFIG_START( sh4robot, sh4robot_state )
60    /* basic machine hardware */
61    MCFG_CPU_ADD("maincpu", SH4LE, 200000000) // SH7750
60   /* basic machine hardware */
61   MCFG_CPU_ADD("maincpu", SH4LE, 200000000) // SH7750
6262   MCFG_CPU_CONFIG(sh4cpu_config)
63    MCFG_CPU_PROGRAM_MAP(sh4robot_mem)
63   MCFG_CPU_PROGRAM_MAP(sh4robot_mem)
6464   MCFG_CPU_IO_MAP(sh4robot_io)
65   
65
6666MACHINE_CONFIG_END
6767
6868/* ROM definition */
6969ROM_START( sh4robot )
70    ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASEFF )
71   ROM_LOAD( "bootloader.bin", 0x0000, 0x0882, CRC(d2ea0b7d) SHA1(7dd566c5e325d1ce1156a0bcbd7e10d011e9d35f))   
72   
70   ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASEFF )
71   ROM_LOAD( "bootloader.bin", 0x0000, 0x0882, CRC(d2ea0b7d) SHA1(7dd566c5e325d1ce1156a0bcbd7e10d011e9d35f))
72
7373   // FLASH TC58128AFT
7474   // flash blocks 1 till 199 (1*32*512 till 199*32*512)
75   //ROM_LOAD( "vmlinux-nand_img_with_oob-2.6.10-v1.0", 0x0000, 0x149be0, CRC(eec69ef5) SHA1(524e26d2c2c28061911f4726646b18596d134736))
75   //ROM_LOAD( "vmlinux-nand_img_with_oob-2.6.10-v1.0", 0x0000, 0x149be0, CRC(eec69ef5) SHA1(524e26d2c2c28061911f4726646b18596d134736))
7676   // Root FS at flash blocks from 201 till end (201*32*512)
7777   //ROM_LOAD( "shix-linux-v1.0.yaffs", 0x0000, 0x7e9e40, CRC(7a7fdb04) SHA1(0b761e2d179335398399cb046de4e591157cb72f))
7878ROM_END
r26736r26737
8080/* Driver */
8181
8282/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY   FULLNAME       FLAGS */
83COMP( ????, sh4robot,  0,       0,  sh4robot,   sh4robot, driver_device,   0,   "", "Robot", GAME_NOT_WORKING | GAME_NO_SOUND)
No newline at end of file
83COMP( ????, sh4robot,  0,       0,  sh4robot,   sh4robot, driver_device,   0,   "", "Robot", GAME_NOT_WORKING | GAME_NO_SOUND)
trunk/src/mess/drivers/xavix.c
r26736r26737
22// copyright-holders: ?
33/***************************************************************************
44
5   Skeleton driver for XaviX TV PNP console and childs (Let's! Play TV Classic)
5    Skeleton driver for XaviX TV PNP console and childs (Let's! Play TV Classic)
66
7   CPU is M6502 derivative, almost likely to be a G65816
7    CPU is M6502 derivative, almost likely to be a G65816
88
9   TODO:
10   - understand how to map ROM at 0x800000-0x9fffff / 0xc00000 / 0xdfffff
11     banks (granted that we have the ROM for that, of course)
9    TODO:
10    - understand how to map ROM at 0x800000-0x9fffff / 0xc00000 / 0xdfffff
11      banks (granted that we have the ROM for that, of course)
1212
1313***************************************************************************/
1414
trunk/src/mess/drivers/esqasr.c
r26736r26737
88        CPU: 68302 MCU
99        Sound: ES5506
1010        Effects: ES5510
11       FDC: NEC uPD72069
12       DUART: 2681
13 
11        FDC: NEC uPD72069
12        DUART: 2681
13
1414    Memory map:
1515    0x000000-0x03ffff   OS ROM
1616    0xfb0000-0xfcffff   OS RAM
17 
18 
17
18
1919    ASR-X hardware:
20       CPU: 68340 MCU
20        CPU: 68340 MCU
2121        Sound: ES5506
2222        Effects: ES5511
23       FDC: NEC uPD72069
24 
25      http://www.gweep.net/~shifty/music/asrxhack/
26 
23        FDC: NEC uPD72069
24
25    http://www.gweep.net/~shifty/music/asrxhack/
26
2727    Memory map:
2828    0x00000000-0x000fffff   OS ROM
2929    0x00800000-0x008000ff   ESP2 5511?
3030    0x00f00000-0x00f007ff   Unknown
3131    0x08000000-0x08200000   RAM
3232    0x0be00000-0x0befffff   RAM (size unknown)
33
33
3434    These may want to be separated when they run more.
35
35
3636***************************************************************************/
3737
3838#include "emu.h"
r26736r26737
9999};
100100
101101static MACHINE_CONFIG_START( asr, esqasr_state )
102   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)   // actually MC68302
102   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz) // actually MC68302
103103   MCFG_CPU_PROGRAM_MAP(asr_map)
104104
105105   MCFG_CPU_ADD("esp", ES5510, XTAL_10MHz)
r26736r26737
115115MACHINE_CONFIG_END
116116
117117static MACHINE_CONFIG_START( asrx, esqasr_state )
118   MCFG_CPU_ADD("maincpu", M68020, XTAL_16MHz)   // unknown, possibly 68340?
118   MCFG_CPU_ADD("maincpu", M68020, XTAL_16MHz) // unknown, possibly 68340?
119119   MCFG_CPU_PROGRAM_MAP(asrx_map)
120120
121121   MCFG_CPU_ADD("esp", ES5510, XTAL_10MHz)
r26736r26737
135135
136136ROM_START( asr10 )
137137   ROM_REGION(0x100000, "maincpu", 0)
138   ROM_LOAD16_BYTE( "asr-648c-lo-1.5b.bin", 0x000001, 0x020000, CRC(8e437843) SHA1(418f042acbc5323f5b59cbbd71fdc8b2d851f7d0) )
139   ROM_LOAD16_BYTE( "asr-65e0-hi-1.5b.bin", 0x000000, 0x020000, CRC(b37cd3b6) SHA1(c4371848428a628b5e5a50e99be602d7abfc7904) )
138   ROM_LOAD16_BYTE( "asr-648c-lo-1.5b.bin", 0x000001, 0x020000, CRC(8e437843) SHA1(418f042acbc5323f5b59cbbd71fdc8b2d851f7d0) )
139   ROM_LOAD16_BYTE( "asr-65e0-hi-1.5b.bin", 0x000000, 0x020000, CRC(b37cd3b6) SHA1(c4371848428a628b5e5a50e99be602d7abfc7904) )
140140
141141   ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
142142   ROM_REGION(0x200000, "waverom2", ROMREGION_ERASE00)
r26736r26737
146146
147147ROM_START( asrx )
148148   ROM_REGION(0x100000, "maincpu", 0)
149   ROM_LOAD16_BYTE( "asr267lo.bin", 0x000001, 0x080000, CRC(7408d441) SHA1(0113f84b6d224bf1423ad62c173f32a0c95ca715) )
150   ROM_LOAD16_BYTE( "asr267hi.bin", 0x000000, 0x080000, CRC(7df14ea7) SHA1(895b99013c0f924edb52612eb93c3e6babb9f053) )
149   ROM_LOAD16_BYTE( "asr267lo.bin", 0x000001, 0x080000, CRC(7408d441) SHA1(0113f84b6d224bf1423ad62c173f32a0c95ca715) )
150   ROM_LOAD16_BYTE( "asr267hi.bin", 0x000000, 0x080000, CRC(7df14ea7) SHA1(895b99013c0f924edb52612eb93c3e6babb9f053) )
151151
152152   ROM_REGION(0x200000, "waverom", ROMREGION_ERASE00)
153153   ROM_REGION(0x200000, "waverom2", ROMREGION_ERASE00)
trunk/src/mess/drivers/next.c
r26736r26737
966966   // devices
967967   MCFG_NSCSI_BUS_ADD("scsibus")
968968   MCFG_MCCS1850_ADD("rtc", XTAL_32_768kHz,
969                 line_cb_t(), line_cb_t(), line_cb_t())
969                  line_cb_t(), line_cb_t(), line_cb_t())
970970   MCFG_SCC8530_ADD("scc", XTAL_25MHz, line_cb_t(FUNC(next_state::scc_irq), static_cast<next_state *>(owner)))
971971   MCFG_NEXTKBD_ADD("keyboard",
972972                  line_cb_t(FUNC(next_state::keyboard_irq), static_cast<next_state *>(owner)),
trunk/src/mess/drivers/tiki100.c
r26736r26737
1414
1515    TODO:
1616
17   - 3 expansion slots
17    - 3 expansion slots
1818    - palette RAM should be written during HBLANK
1919    - DART clocks
2020    - winchester hard disk
r26736r26737
240240   AM_RANGE(0x17, 0x17) AM_DEVREADWRITE(AY8912_TAG, ay8910_device, data_r, data_w)
241241   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_device, read, write)
242242   AM_RANGE(0x1c, 0x1c) AM_MIRROR(0x03) AM_WRITE(system_w)
243//   AM_RANGE(0x20, 0x27) AM_NOP // winchester controller
243//  AM_RANGE(0x20, 0x27) AM_NOP // winchester controller
244244//  AM_RANGE(0x60, 0x6f) analog I/O (SINTEF)
245245//  AM_RANGE(0x60, 0x67) digital I/O (RVO)
246246//  AM_RANGE(0x70, 0x77) analog/digital I/O
r26736r26737
491491READ8_MEMBER( tiki100_state::pio_pb_r )
492492{
493493   /*
494   
494
495495       bit     description
496   
497       0       
498       1       
499       2       
500       3       
496
497       0
498       1
499       2
500       3
501501       4       ACK
502502       5       BUSY
503503       6       NO PAPER
504504       7       UNIT SELECT, tape in
505   
505
506506   */
507507
508508   UINT8 data = 0;
r26736r26737
521521WRITE8_MEMBER( tiki100_state::pio_pb_w )
522522{
523523   /*
524   
524
525525       bit     description
526   
526
527527       0       STRB
528       1       
529       2       
530       3       
531       4       
532       5       
528       1
529       2
530       3
531       4
532       5
533533       6       tape out
534       7       
535   
534       7
535
536536   */
537537
538538   // centronics
trunk/src/mess/drivers/itt3030.c
r26736r26737
22
33    ITT 3030
44
5   
6   ToDo:
7   - Check Beeper
8   - finish hooking up keyboard
9   - According to the manual, the keyboard is based on a 8278 ... it's nowhere to be found. The keyboard / video card has a 8741 instead of which a ROM dump exists
10   - serial port
11   - daisy chain
12   - ...
13   
145
15   CPU Board, all ICs shown:
16   
17   |-----------------------------------------------------------------|
18   |                                                                 |
19   |    74LS640N            Z80_Combo            74LS138N              |
20   |                                                     74LS00N   |
21   |    74LS240N                               74LS74AN              |
22   |                                                       74LS00N   |
23   |C   74LS240N          Z80_CPU              74LS240N             C|
24   |N                                                      74LS74AN N|
25   |1   74LS241N                               74LS240N             2|
26   |                      ROM_1      74LS20N               74LS38N   |
27    |    74LS240N                               74LS240N             |
28   |                                 74LS04N               74LS02N   |
29   |    74LS138N                               74LS74AN              |
30   |                                                       74LS175N  |
31   |    75154N        74LS156N                 74LS00N               |
32   |                                                       74LS123N  |
33   |    75150P 75150P 74LS175N   X1  74LS00N   74LS132N              |
34   |-----------------------------------------------------------------|     
35   
36   Z80_Combo:   Mostek MK3886 Z80 Combo Chip, Serial, Timer, 256 bytes RAM, Interrupt Controller
37   Z80_CPU:   Zilog Z80A CPU
38   ROM_1:      NEC D2716D marked "BOOTV1.2"
39   X1:         Crystal 4,194 MHz
40   CN1:      Bus Connector
41   CN2:      Memory Board Connector
42   
6    ToDo:
7    - Check Beeper
8    - finish hooking up keyboard
9    - According to the manual, the keyboard is based on a 8278 ... it's nowhere to be found. The keyboard / video card has a 8741 instead of which a ROM dump exists
10    - serial port
11    - daisy chain
12    - ...
13
14
15    CPU Board, all ICs shown:
16
17    |-----------------------------------------------------------------|
18    |                                                                 |
19    |    74LS640N          Z80_Combo            74LS138N              |
20    |                                                       74LS00N   |
21    |    74LS240N                               74LS74AN              |
22    |                                                       74LS00N   |
23    |C   74LS240N          Z80_CPU              74LS240N             C|
24    |N                                                      74LS74AN N|
25    |1   74LS241N                               74LS240N             2|
26    |                      ROM_1      74LS20N               74LS38N   |
27    |    74LS240N                               74LS240N              |
28    |                                 74LS04N               74LS02N   |
29    |    74LS138N                               74LS74AN              |
30    |                                                       74LS175N  |
31    |    75154N        74LS156N                 74LS00N               |
32    |                                                       74LS123N  |
33    |    75150P 75150P 74LS175N   X1  74LS00N   74LS132N              |
34    |-----------------------------------------------------------------|
35
36    Z80_Combo:  Mostek MK3886 Z80 Combo Chip, Serial, Timer, 256 bytes RAM, Interrupt Controller
37    Z80_CPU:    Zilog Z80A CPU
38    ROM_1:      NEC D2716D marked "BOOTV1.2"
39    X1:         Crystal 4,194 MHz
40    CN1:        Bus Connector
41    CN2:        Memory Board Connector
42
4343----------------------------------------------------------------------------------
44   
45   Video / Keyboard Combination board, all ICs shown:
46   
47   |-----------------------------------------------------------------|
48   |                                                                 |
49   |         X1     74276N      MCU_1                  74LS85N       |
50   |                                                                 |
51   |    74LS138N    74LS240                            74LS240N      |
52   |                            75LS257AN  74LS166AN                 |
53   |    74LS08N     74LS85N                            74LS241N      |
54   |                            75LS257AN  ROM_1                    C|
55   |    74LS132N    74LS32N                            74LS240N     N|
56   |                            75LS257AN                           1|
57   |    74LS10N     74LS08N                            74LS240N      |
58   |                            75LS257AN  RAM_1                     |
59   |    74LS163AN   74LS173AN                          74LS374N      |
60   |                                                                 |
61   |    74LS86N     74LS240N                           74LS640N      |
62   |                            Video_1                              |
63   |    74LS74AN    74LS240N                           74LS640N      |
64   |-----------------------------------------------------------------|
65   
66   X1:      Crystal 6 MHz
67   MCU_1:   NEC D8741AD marked "V1.1 3030"
68   ROM_1:   MBM 2716 marked "GB 136-0"
69   RAM_1:  NEC D4016D
70   Video_1   Video-IC SND5027E, compatible with TMS9927
7144
45    Video / Keyboard Combination board, all ICs shown:
46
47    |-----------------------------------------------------------------|
48    |                                                                 |
49    |         X1     74276N      MCU_1                  74LS85N       |
50    |                                                                 |
51    |    74LS138N    74LS240                            74LS240N      |
52    |                            75LS257AN  74LS166AN                 |
53    |    74LS08N     74LS85N                            74LS241N      |
54    |                            75LS257AN  ROM_1                    C|
55    |    74LS132N    74LS32N                            74LS240N     N|
56    |                            75LS257AN                           1|
57    |    74LS10N     74LS08N                            74LS240N      |
58    |                            75LS257AN  RAM_1                     |
59    |    74LS163AN   74LS173AN                          74LS374N      |
60    |                                                                 |
61    |    74LS86N     74LS240N                           74LS640N      |
62    |                            Video_1                              |
63    |    74LS74AN    74LS240N                           74LS640N      |
64    |-----------------------------------------------------------------|
65
66    X1:     Crystal 6 MHz
67    MCU_1:  NEC D8741AD marked "V1.1 3030"
68    ROM_1:  MBM 2716 marked "GB 136-0"
69    RAM_1:  NEC D4016D
70    Video_1 Video-IC SND5027E, compatible with TMS9927
71
7272----------------------------------------------------------------------------------
73   
74   Floppy Controller board, all ICs shown
7573
76   |-----------------------------------------------------------------|
77   |                                                                 |
74    Floppy Controller board, all ICs shown
75
76    |-----------------------------------------------------------------|
77    |                                                                 |
7878    |  X1   74LS51N    F    74LS74AN   74LS02N        MC4044P         |
7979    |                  D                        567                   |
8080    |     74LS04N      C    74LS00N    74LS01N  :::   MC4024P         |
81   |                                                                 |
82   |   74LS00N        1    74LS74AN   74LS74AN       74LS14N        C|
81    |                                                                 |
82    |   74LS00N        1    74LS74AN   74LS74AN       74LS14N        C|
8383    |                  7                                             N|
8484    |  74LS240N        9    74LS161N   74LS393N   74LS74AN           1|
8585    |                  1                                              |
r26736r26737
8888    |    74LS123N   74LS04N  74LS163N   74LS14N    74LS241N           |
8989    |                                                                 |
9090    |     74LS393N   74LS138  74LS175N   74LS85N    74LS645N          |
91   |                                                                 |
92   |-----------------------------------------------------------------|
93   
94   X1:      Crystal 8 MHz
95   FDC:   Siemens SAB1791-02P
96   567:   Jumper Pad (emtpy)
91    |                                                                 |
92    |-----------------------------------------------------------------|
9793
94    X1:     Crystal 8 MHz
95    FDC:    Siemens SAB1791-02P
96    567:    Jumper Pad (emtpy)
97
9898----------------------------------------------------------------------------------
99   
100   256K RAM board, all ICs shown:
101   
102   |-----------------------------------------------------------------|
103   |                                                                 |
104   |   HM4864P   HM4864P   HM4864P   HM4864P       74LS245N          |
105   |                                                                 |
106   |   HM4864P   HM4864P   HM4864P   HM4864P       P     74LS14N     |
107   |                                               R                 |
108   |   HM4864P   HM4864P   HM4864P   HM4864P       M     74LS00N     |
109   |                                                                C|
110   |   HM4864P   HM4864P   HM4864P   HM4864P       AM         A     N|
111   |                                               29         M     1|
112   |   HM4864P   HM4864P   HM4864P   HM4864P       66         2      |
113   |                                               PC         9      |
114   |   HM4864P   HM4864P   HM4864P   HM4864P                  6      |
115   |                                               AM         4      |
116   |   HM4864P   HM4864P   HM4864P   HM4864P       29         8      |
117   |                                               66         P      |
118   |   HM4864P   HM4864P   HM4864P   HM4864P       PC         C      |
119   |                                                      SN7474N    |
120   |-----------------------------------------------------------------|   
121   
122   PRM:    N82S129F 1K Bipolar PROM
123           AM2966PC: Octal Dynamic Memory Drivers with Three-State Outputs
124         AM29648PC
125   CN1:   Connector to CN2 of Z80 CPU card
126   
99
100    256K RAM board, all ICs shown:
101
102    |-----------------------------------------------------------------|
103    |                                                                 |
104    |   HM4864P   HM4864P   HM4864P   HM4864P       74LS245N          |
105    |                                                                 |
106    |   HM4864P   HM4864P   HM4864P   HM4864P       P     74LS14N     |
107    |                                               R                 |
108    |   HM4864P   HM4864P   HM4864P   HM4864P       M     74LS00N     |
109    |                                                                C|
110    |   HM4864P   HM4864P   HM4864P   HM4864P       AM         A     N|
111    |                                               29         M     1|
112    |   HM4864P   HM4864P   HM4864P   HM4864P       66         2      |
113    |                                               PC         9      |
114    |   HM4864P   HM4864P   HM4864P   HM4864P                  6      |
115    |                                               AM         4      |
116    |   HM4864P   HM4864P   HM4864P   HM4864P       29         8      |
117    |                                               66         P      |
118    |   HM4864P   HM4864P   HM4864P   HM4864P       PC         C      |
119    |                                                      SN7474N    |
120    |-----------------------------------------------------------------|
121
122    PRM:    N82S129F 1K Bipolar PROM
123            AM2966PC: Octal Dynamic Memory Drivers with Three-State Outputs
124            AM29648PC
125    CN1:    Connector to CN2 of Z80 CPU card
126
127127----------------------------------------------------------------------------------
128   
129   Parallel I/O board, all ICs shown:
130   
131   |-------------------------------------|                                                                 |
132   |                                     |
133   |  74   74                            |
134   |  LS   LS        Z80A PIO            |
135   |  00   14                            |
136   |   N    N                            |
137   |                                     |
138   |                                     |
139   |  74   74        74   74   D4   74   |
140   |  LS   LS        LS   LS   I3   LS   |
141   |  13   14        24   85   P2   64   |
142   |  2N    N        1N    N    1   0N   |
143   |                                     |
128
129    Parallel I/O board, all ICs shown:
130
131    |-------------------------------------|                                                                 |
132    |                                     |
133    |  74   74                            |
134    |  LS   LS        Z80A PIO            |
135    |  00   14                            |
136    |   N    N                            |
137    |                                     |
138    |                                     |
139    |  74   74        74   74   D4   74   |
140    |  LS   LS        LS   LS   I3   LS   |
141    |  13   14        24   85   P2   64   |
142    |  2N    N        1N    N    1   0N   |
143    |                                     |
144144    |             CN1                     |
145   |                                     |
146   |             74LS00N                 |
147   |-------------------------------------|   
145    |                                     |
146    |             74LS00N                 |
147    |-------------------------------------|
148148
149   CN1: Bus connector
150   DIP: 4x DIP current setting: off-on-on-off, sets the address for the parallel port
151   
149    CN1: Bus connector
150    DIP: 4x DIP current setting: off-on-on-off, sets the address for the parallel port
151
152152----------------------------------------------------------------------------------
153153
154154Beeper Circuit, all ICs shown:
155155
156   |---------------------------|                                                                 |
157   |                           |
158   |   BEEP       74LS132N     |
159   | R1                        |
156    |---------------------------|                                                                 |
157    |                           |
158    |   BEEP       74LS132N     |
159    | R1                        |
160160    |              74LS14N      |
161161    |                           |
162162    |   74LS132N   74LS193N     |
163   |                           |
164   |   74LS74AN   74LS165N     |
165   |            CN1            |
166   |---------------------------|
167   
168   CN1: Connector to mainboard
169   R1:  looks like a potentiometer
170   BEEP: Beeper ... touted in the manual as "Hupe" ... i.e. "horn" :)
171   
163    |                           |
164    |   74LS74AN   74LS165N     |
165    |            CN1            |
166    |---------------------------|
167
168    CN1: Connector to mainboard
169    R1:  looks like a potentiometer
170    BEEP: Beeper ... touted in the manual as "Hupe" ... i.e. "horn" :)
171
172172----------------------------------------------------------------------------------
173   
174   Other boards and extensions mentioned in the manual:
175   - S100 bus adapter board
176   - IEEE 488 bus adapter board
177   - 64K memory board
178   - 8086 CPU board
179   - external harddisk
180   - TV adapter B/W (TV, Save/Load from Audio Cassette) with PROM/RAM/BASIC-Module with 16K or 32K RAM
181   - TV adapter color with connection to Video / Keyboard combination card
182   - Monitor adapters B/W and color
183   - Video / Keyboard interface 2 with grayscale, 8 colors, loadable character set, blinking
184   - Graphics Adapter with 16 colours, hi-res 512x256 pixels
185   - RTC
186   - Arithmetics chip
187 
173
174    Other boards and extensions mentioned in the manual:
175    - S100 bus adapter board
176    - IEEE 488 bus adapter board
177    - 64K memory board
178    - 8086 CPU board
179    - external harddisk
180    - TV adapter B/W (TV, Save/Load from Audio Cassette) with PROM/RAM/BASIC-Module with 16K or 32K RAM
181    - TV adapter color with connection to Video / Keyboard combination card
182    - Monitor adapters B/W and color
183    - Video / Keyboard interface 2 with grayscale, 8 colors, loadable character set, blinking
184    - Graphics Adapter with 16 colours, hi-res 512x256 pixels
185    - RTC
186    - Arithmetics chip
187
188188***************************************************************************/
189189
190190
r26736r26737
194194#include "machine/bankdev.h"
195195#include "machine/ram.h"
196196#include "formats/itt3030_dsk.h"
197#include "video/tms9927.h"         //Display hardware
197#include "video/tms9927.h"          //Display hardware
198198#include "sound/beep.h"
199#include "cpu/mcs48/mcs48.h"      //Keyboard MCU ... talks to the 8278 on the keyboard circuit
199#include "cpu/mcs48/mcs48.h"        //Keyboard MCU ... talks to the 8278 on the keyboard circuit
200200
201201
202202#define MAIN_CLOCK XTAL_4.194MHz
r26736r26737
291291
292292   if (machine().primary_screen->vblank())
293293   {
294      ret |= 0xc0;   // set both bits 6 and 7 if vblank
294      ret |= 0xc0;    // set both bits 6 and 7 if vblank
295295   }
296296
297297   if (machine().primary_screen->hblank())
298298   {
299      ret |= 0x80;   // set only bit 7 if hblank
299      ret |= 0x80;    // set only bit 7 if hblank
300300   }
301301
302302   return ret;
r26736r26737
317317   int bank = 0;
318318   m_bank = data>>4;
319319
320   if (m_bank & 1)   // bank 8
320   if (m_bank & 1) // bank 8
321321   {
322322      bank = 8;
323323   }
324324   else
325325   {
326      bank = m_bank >> 1;
326      bank = m_bank >> 1;
327327   }
328328
329//   printf("bank_w: new value %02x, m_bank %x, bank %x\n", data, m_bank, bank);
329//  printf("bank_w: new value %02x, m_bank %x, bank %x\n", data, m_bank, bank);
330330
331331   m_48kbank->set_bank(bank);
332332}
r26736r26737
376376ADDRESS_MAP_END
377377
378378static ADDRESS_MAP_START( lower48_map, AS_PROGRAM, 8, itt3030_state )
379   AM_RANGE(0x00000, 0x7ffff) AM_READWRITE(bankl_r, bankl_w)   // pages 0-7
379   AM_RANGE(0x00000, 0x7ffff) AM_READWRITE(bankl_r, bankl_w)   // pages 0-7
380380   AM_RANGE(0x80000, 0x807ff) AM_ROM AM_REGION("maincpu", 0)   // begin "page 8"
381381   AM_RANGE(0x80800, 0x80fff) AM_ROM AM_REGION("maincpu", 0)
382   AM_RANGE(0x81000, 0x810ff) AM_RAM AM_MIRROR(0x100)   // only 256 bytes, but ROM also clears 11xx?
382   AM_RANGE(0x81000, 0x810ff) AM_RAM AM_MIRROR(0x100)  // only 256 bytes, but ROM also clears 11xx?
383383   AM_RANGE(0x83000, 0x83fff) AM_RAM AM_SHARE("vram")
384384ADDRESS_MAP_END
385385
r26736r26737
396396
397397READ8_MEMBER(itt3030_state::kbd_fifo_r)
398398{
399   return m_kbdmcu->upi41_master_r(space, 0);   // offset 0 is data, 1 is status
399   return m_kbdmcu->upi41_master_r(space, 0);  // offset 0 is data, 1 is status
400400}
401401
402402READ8_MEMBER(itt3030_state::kbd_matrix_r)
r26736r26737
407407WRITE8_MEMBER(itt3030_state::kbd_matrix_w)
408408{
409409   ioport_port *ports[16] = { m_keyrow1, m_keyrow2, m_keyrow3, m_keyrow4, m_keyrow5, m_keyrow6, m_keyrow7, m_keyrow8, m_keyrow9,
410                        m_keyrow10, m_keyrow11, m_keyrow12, m_keyrow13, m_keyrow14, m_keyrow15, m_keyrow16 };
410                        m_keyrow10, m_keyrow11, m_keyrow12, m_keyrow13, m_keyrow14, m_keyrow15, m_keyrow16 };
411411   int col_masks[8] = { 1, 2, 4, 8, 0x10, 0x20, 0x40, 0x80 };
412412   int tmp_read;
413413
r26736r26737
424424}
425425
426426// Schematics say:
427// Port 1 goes to the keyboard matrix. 
427// Port 1 goes to the keyboard matrix.
428428// bits 0-3 select matrix rows, bits 4-6 choose column to read, bit 7 clocks the process (rising edge strobes the row, falling edge reads the data)
429429// T0 is the key matrix return
430430// Port 2 bit 2 is shown as "IRQ" on the schematics, and the code does a lot with it as well (debug?)
r26736r26737
451451
452452   PORT_START("ROW3")
453453   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2))
454   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')   // actually UK pound symbol
454   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')   // actually UK pound symbol
455455   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
456456   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
457457   PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
r26736r26737
499499   PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR(';')
500500
501501   PORT_START("ROW10")
502   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_F9)
502   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_F9)
503503   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('=')
504504   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
505505   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
506506   PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR(':')
507507
508508   PORT_START("ROW11")
509   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_F10)
509   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_F10)
510510   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('@') PORT_CHAR('?')
511511   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('<') PORT_CHAR('>')
512512   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR('[') PORT_CHAR('{')
513513   PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('-') PORT_CHAR('`')
514514
515515   PORT_START("ROW12")
516   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_F11) PORT_CHAR(27)                                   
516   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CODE(KEYCODE_F11) PORT_CHAR(27)
517517   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('/') PORT_CHAR('\\')
518518   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('+') PORT_CHAR('*')
519519   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(']') PORT_CHAR('}')
r26736r26737
523523   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(R)") PORT_CODE(KEYCODE_F12) PORT_CHAR('=')
524524   PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('~')
525525   PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
526   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_CHAR('^')   // PC doesn't have 3 keys to the right of L, so we sub DEL for the 3rd one
526   PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL) PORT_CHAR('^')    // PC doesn't have 3 keys to the right of L, so we sub DEL for the 3rd one
527527   PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
528528
529529   PORT_START("ROW14")
530   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(CL)") PORT_CODE(KEYCODE_F13) PORT_CHAR(4)   // produces control-D always
530   PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("(CL)") PORT_CODE(KEYCODE_F13) PORT_CHAR(4)    // produces control-D always
531531   PORT_BIT(0x001e, IP_ACTIVE_HIGH, IPT_UNUSED)
532532
533533   PORT_START("ROW15")
r26736r26737
563563   save_item(NAME(m_kbdclk));
564564   save_item(NAME(m_kbdread));
565565
566   m_kbdclk = 0;   // must be initialized here b/c mcs48_reset() causes write of 0xff to all ports
566   m_kbdclk = 0;   // must be initialized here b/c mcs48_reset() causes write of 0xff to all ports
567567}
568568
569569void itt3030_state::machine_reset()
r26736r26737
576576}
577577
578578FLOPPY_FORMATS_MEMBER( itt3030_state::itt3030_floppy_formats )
579  FLOPPY_ITT3030_FORMAT
579   FLOPPY_ITT3030_FORMAT
580580FLOPPY_FORMATS_END
581581
582582
r26736r26737
587587
588588static struct tms9927_interface crtc_intf =
589589{
590   16,      // pixels per video memory address
591   NULL   // "self-load data"?
590   16,     // pixels per video memory address
591   NULL    // "self-load data"?
592592};
593593
594594static MACHINE_CONFIG_START( itt3030, itt3030_state )
r26736r26737
608608   MCFG_SCREEN_UPDATE_DRIVER(itt3030_state, screen_update)
609609   MCFG_SCREEN_SIZE(80*8, 24*16)
610610   MCFG_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 24*16-1)
611   
611
612612   /* devices */
613613   MCFG_DEVICE_ADD("lowerbank", ADDRESS_MAP_BANK, 0)
614614   MCFG_DEVICE_PROGRAM_MAP(lower48_map)
r26736r26737
635635   MCFG_SPEAKER_STANDARD_MONO( "mono" )
636636   MCFG_SOUND_ADD( "beeper", BEEP, 0 )
637637   MCFG_SOUND_ROUTE( ALL_OUTPUTS, "mono", 1.00 )
638   
638
639639MACHINE_CONFIG_END
640640
641641
r26736r26737
655655ROM_END
656656
657657GAME( 1982, itt3030,  0,   itt3030,  itt3030,  driver_device, 0,      ROT0, "ITT RFA",      "ITT3030", GAME_NOT_WORKING | GAME_NO_SOUND )
658

Previous 199869 Revisions Next


© 1997-2024 The MAME Team