diff --git a/hash/cgenie_cass.xml b/hash/cgenie_cass.xml index 6b3b5a89819..c2e8bbeb5a2 100644 --- a/hash/cgenie_cass.xml +++ b/hash/cgenie_cass.xml @@ -1643,7 +1643,7 @@ Screen-Printer (standalone) - + diff --git a/hash/compis.xml b/hash/compis.xml index d0eea76cb38..8f71e7e6157 100644 --- a/hash/compis.xml +++ b/hash/compis.xml @@ -157,7 +157,7 @@ Systemskiva för hårdskiveenhet [version 7242] Stava rätt på nytt sätt (version 8481) 19?? - Esselte Stadium + Esselte Studium @@ -169,7 +169,7 @@ Systemskiva för hårdskiveenhet [version 7242] Matematikverkstad I (beta, nät/skollicens) 1987 - Esselte Stadium + Esselte Studium @@ -182,7 +182,7 @@ Systemskiva för hårdskiveenhet [version 7242] Video-butiken (enanvändare) 1986 - Esselte Stadium + Esselte Studium @@ -202,7 +202,7 @@ Systemskiva för hårdskiveenhet [version 7242] StatEtt - Analys 1990 - Esselte Stadium + Esselte Studium @@ -216,7 +216,7 @@ Systemskiva för hårdskiveenhet [version 7242] Räkna lätt, räkna rätt (demo, version 6175) 19?? - Esselte Stadium + Esselte Studium @@ -224,4 +224,110 @@ Systemskiva för hårdskiveenhet [version 7242] + + + Stil-Plus (alfa 1.0, nät/skollicens) + 1989 + Esselte Studium + + + + + + + + + + + Action1 Glosprogram (nät/skollicens) + 1987 + Almqvist & Wiksell Läromedel AB + + + + + + + + + + + Coulombs lag (nät/skollicens) + 1987 + Esselte Studium + + + + + + + + + + + Kinetik (nät/skollicens) + 1987 + Esselte Studium + + + + + + + + + + + Jorden skiftas, folket skingras (nät/skollicens) + 1987 + Esselte Studium + + + + + + + + + + + + Får dataregister skvallra? (enanvändare) + 1985 + Esselte Studium + + + + + + + + + + + Får dataregister skvallra? (komplement) + 1986 + Esselte Studium + + + + + + + + + + + + Datorn i kommunikation (enanvändare) + 1986 + Esselte Studium + + + + + + + + diff --git a/hash/famicom_flop.xml b/hash/famicom_flop.xml index ca85aaa1e39..ca18f468f71 100644 --- a/hash/famicom_flop.xml +++ b/hash/famicom_flop.xml @@ -1366,7 +1366,7 @@ Re-releases (probably the same as the original release, but listed while waiting Meikyuu Jiin Dababa - 1986 + 1987 Konami diff --git a/hash/megadriv.xml b/hash/megadriv.xml index b3cd72cfa9f..9aeb072afcd 100644 --- a/hash/megadriv.xml +++ b/hash/megadriv.xml @@ -11042,7 +11042,7 @@ but dumps still have to be confirmed. Baby Boom (Prototype, 19940811) - 199? + 1994 <unknown> @@ -11053,7 +11053,7 @@ but dumps still have to be confirmed. Baby Boom (Prototype, 19940603) - 199? + 1994 <unknown> @@ -11064,7 +11064,7 @@ but dumps still have to be confirmed. Baby Boom (Prototype, 19940606) - 199? + 1994 <unknown> diff --git a/hash/msx1_cart.xml b/hash/msx1_cart.xml index 42255a56f87..53fe52b1d71 100644 --- a/hash/msx1_cart.xml +++ b/hash/msx1_cart.xml @@ -5312,7 +5312,7 @@ kept for now until finding out what those bytes affect... - + Game World - 126 Games (Kor, Hacked?) 19?? Zemina diff --git a/hash/nes.xml b/hash/nes.xml index 47314395060..4eb2d296645 100644 --- a/hash/nes.xml +++ b/hash/nes.xml @@ -15269,7 +15269,7 @@ license:CC0 - + The Guardian Legend (USA) 1989 Brøderbund @@ -15288,7 +15288,7 @@ license:CC0 - + The Guardian Legend (Euro) 1992 Nintendo @@ -15307,7 +15307,7 @@ license:CC0 - + Guardic Gaiden (Jpn) 1987 Irem @@ -25010,7 +25010,7 @@ license:CC0 Jaleco - + @@ -75764,7 +75764,7 @@ be better to redump them properly. --> - + Street Fighter III (Asia, 9 characters) 19?? <unknown> diff --git a/hash/qx10_flop.xml b/hash/qx10_flop.xml index 9d148fe6093..cc240fa768c 100644 --- a/hash/qx10_flop.xml +++ b/hash/qx10_flop.xml @@ -7,7 +7,7 @@ license:CC0 CP/M-80 R2.2 for QX-10 & QX-16 - 198? + 1984 Epson @@ -17,6 +17,18 @@ license:CC0 + + CP/M-80 R2.2 for QX-10 & QX-16 1983 + 1983 + Epson + + + + + + + + TMP-II for QX-10 256K (v2.44) 1983 diff --git a/hash/sgi_mips.xml b/hash/sgi_mips.xml index 4d37233da79..99b31ebf294 100644 --- a/hash/sgi_mips.xml +++ b/hash/sgi_mips.xml @@ -7,6 +7,37 @@ license:CC0 + + Barco Creator 7.2 + 1999 + Barco Graphics + + + + + + + + + + + CATIA V5R16 + 2005 + Dassault Systèmes + + + + + + + + + + + + + + Common Desktop Environment 4.3 1998 @@ -186,42 +217,7 @@ license:CC0 - - - - - - - Freeware May 1999 - 1999 - Silicon Graphics - - - - - - - - - - - Freeware November 1999 - 1999 - Silicon Graphics - - - - - - - - - - - - - - + @@ -319,6 +315,18 @@ license:CC0 + + Adobe Illustrator 5.5 + 1995 + Adobe + + + + + + + + IRIS PERFORMER 2.0 1995 @@ -371,6 +379,84 @@ license:CC0 + + IRIS Inventor 1.1.2 + 1993 + Silicon Graphics + + + + + + + + + + + MineSet 2.0.1 for IRIX 6.2 and later + 1998 + Silicon Graphics + + + + + + + + + + + Molecular Inventor Development Kit 1.1 + 1997 + Silicon Graphics + + + + + + + + + + + IRIX Networker 4.1.3 + 1996 + Silicon Graphics + + + + + + + + + + + NetWorker 4.2.5 for IRIX 5.3, 6.2, 6.3 and 6.4 + 1998 + Silicon Graphics + + + + + + + + + + + Networker 4.2.5 for IRIX 6.2, 6.3 and 6.4 + 1997 + Silicon Graphics + + + + + + + + + NetWorker 4.2.9 for IRIX 6.2, 6.4 and 6.5 1998 @@ -384,6 +470,58 @@ license:CC0 + + Network File System 5.0 + 1993 + Silicon Graphics + + + + + + + + + + + Network File System 5.0.1 + 1993 + Silicon Graphics + + + + + + + + + + + Network File System 5.1 + 1993 + Silicon Graphics + + + + + + + + + + + Network File System 5.2 + 1994 + Silicon Graphics + + + + + + + + + Network File System 5.3 1994 @@ -398,6 +536,19 @@ license:CC0 + + O2 Demos 1.0 for IRIX 6.3 including R10000 + 1997 + Silicon Graphics + + + + + + + + + O2 Demos 1.1.1 for IRIX 6.3 including R10000 1997 @@ -412,6 +563,71 @@ license:CC0 + + O2 Demos 1.3 for IRIX 6.5 and later + 1999 + Silicon Graphics + + + + + + + + + + + O2 Out of Box Experience + 1997 + Silicon Graphics + + + + + + + + + + + O2 Out of Box Experience 2.4 for IRIX 6.5 and later + 2000 + Silicon Graphics + + + + + + + + + + + OCTANE Demos 1.3 for IRIX 6.5 and later + 1999 + Silicon Graphics + + + + + + + + + + + NFS/ONC3 for IRIX 6.2 Version 1.2 + 1996 + Silicon Graphics + + + + + + + + + ONC3/NFS Version 2, for IRIX 6.2, 6.3 and 6.4 1997 @@ -426,19 +642,121 @@ license:CC0 + + Open Inventor 3D Toolkit 2.1.2 + 1996 + Silicon Graphics + + + + + + + + + Open Inventor 2.1.5 for IRIX 6.2, 6.3, 6.4 and 6.5 1998 Silicon Graphics + - + + Performance Co-Pilot 1.3 for IRIX 5.3, 6.2, 6.3 and 6.4 + 1997 + Silicon Graphics + + + + + + + + + + + Performance Co-Pilot 2.1 for IRIX 6.2, 6.3, 6.4 and 6.5.5 + 1999 + Silicon Graphics + + + + + + + + + + + Performance Co-Pilot for Oracle 2.0 for IRIX 5.3, 6.2, 6.3, 6.4 and 6.5 + 1998 + Silicon Graphics + + + + + + + + + + + Performance Co-Pilot for WebServers 1.1 + 1996 + Silicon Graphics + + + + + + + + + + + Performance Co-Pilot for Web Servers 2.0 for IRIX 5.3, 6.2, 6.3, 6.4 and 6.5 + 1998 + Silicon Graphics + + + + + + + + + + + Adobe Photoshop 2.5.2 + 1993 + Adobe + + + + + + + + + + Adobe Photoshop 3.0.1 + 1994 + Adobe + + + + + + + + Samba 2.0.0 for IRIX for IRIX 6.5 and later 1998 @@ -452,6 +770,28 @@ license:CC0 + + Silicon Graphics General and Platform Demos 6.5.12 + 2001 + Silicon Graphics + + + + + + + + + + + + + + + + + + SGImeeting 1.0 for IRIX 6.5.2 1998 @@ -492,6 +832,32 @@ license:CC0 + + Silicon Graphics 1600SW Flat Panel Monitor Owner's Manual + 1999 + Silicon Graphics + + + + + + + + + + + Silicon Graphics MultiLink Adapter Documentation + 2000 + Silicon Graphics + + + + + + + + + Teleffect 1.0 for IRIX 6.2, 6.3, 6.4, 6.5 for Microsoft NT 4.0 1998 @@ -504,7 +870,67 @@ license:CC0 - + + + Visual Magic Tools 1.0 + 1993 + Silicon Graphics + + + + + + + + + + + Wavefront Composer 3.5.1 Visualizer Paint 3.5.1 + 1995 + Wavefront Technologies + + + + + + + + + + WebFORCE February 1998 + 1998 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + WorkShop Pro MPF 2.7 for IRIX 6.2, 6.3 and 6.4 + 1997 + Silicon Graphics + + + + + + + + + @@ -546,6 +972,45 @@ license:CC0 + + C++ Translator 3.2 + 1993 + Silicon Graphics + + + + + + + + + + + IRIX 6.2 Development Foundation + 1997 + Silicon Graphics + + + + + + + + + + + IRIX Development Foundation 1.2 for IRIX 6.2 + 1999 + Silicon Graphics + + + + + + + + + IRIX 6.2 Development Libraries 1997 @@ -572,6 +1037,331 @@ license:CC0 + + IRIX 6.3 Development Foundation 1.2 for IRIX 6.3 + 1999 + Silicon Graphics + + + + + + + + + + + IRIX 6.3 Development Libraries + 1997 + Silicon Graphics + + + + + + + + + + + IRIX 6.4 Development Foundation + 1997 + Silicon Graphics + + + + + + + + + + + IRIX Development Foundation 1.2 for IRIX 6.4 + 1999 + Silicon Graphics + + + + + + + + + + + IRIX 6.4 Development Libraries + 1997 + Silicon Graphics + + + + + + + + + + + Digital Media Dev Option 1.1 + 1993 + Silicon Graphics + + + + + + + + + + + ImageVision Library 3.2 + 1998 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + ImageVision Library 3.2.1 + 1998 + Silicon Graphics + + + + + + + + + + + + IRIS Development Option 4.0 + 1991 + Silicon Graphics + + + + + + + + + + + IRIS Development Option 4.0.1 + 1991 + Silicon Graphics + + + + + + + + + + + IRIS Development Option 4.1.1 + 1993 + Silicon Graphics + + + + + + + + + + + IRIS Development Option 5.0 + 1993 + Silicon Graphics + + + + + + + + + + + IRIS Development Option 5.1 + 1993 + Silicon Graphics + + + + + + + + + + + IRIS Development Option 5.3 + 1994 + Silicon Graphics + + + + + + + + + + + IRIS Development Option 6.2 + 1996 + Silicon Graphics + + + + + + + + + + + MIPSpro 7.2 + 1997 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MIPSpro 7.3 + 1999 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + MIPSpro All-Compiler CD May 1999 for IRIX 6.5 and later + 1999 + Silicon Graphics + + + + + + + + + + + ProDev Developers Suite + 1999 + Silicon Graphics + + + + + + + + + + + ProDev Workshop 2.6.5 for IRIX 6.2, 6.3 and 6.4 + 1997 + Silicon Graphics + + + + + + + + + + + SCSL Scientific Library 1.2 for IRIX 6.4 and 6.5 + 1999 + Silicon Graphics + + + + + + + + + @@ -681,6 +1471,19 @@ license:CC0 + + IndiZone + 1993 + Silicon Graphics + + + + + + + + + IndiZone^2 1994 @@ -708,7 +1511,7 @@ license:CC0 - + SupportFolio 5/96 @@ -732,6 +1535,28 @@ license:CC0 + + SupportFolio June 96 + 1996 + Silicon Graphics + + + + + + + + + + + + + + + + + + SupportFolio 10/96 1996 @@ -745,11 +1570,68 @@ license:CC0 + + Support Advantage 9/95 + 1995 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + Support Advantage 12/95 + 1995 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + IRIX 6.2 Applications May 1996 + 1996 + Silicon Graphics + + + + + + + + + IRIX 6.2 Applications August 1996 - 1996 + 1996 Silicon Graphics @@ -760,8 +1642,21 @@ license:CC0 + + IRIX 6.2 Auxiliary Applications + 1997 + Silicon Graphics + + + + + + + + + - IRIX 6.3 Applications August_1997 + IRIX 6.3 Applications August 1997 1997 Silicon Graphics @@ -773,6 +1668,19 @@ license:CC0 + + IRIX 6.4 Applications August 1997 + 1997 + Silicon Graphics + + + + + + + + + IRIX 6.5 Applications August 2001 2001 @@ -801,6 +1709,32 @@ license:CC0 + + IRIX 4.0.5H and 4.0.5IOP R4400 Patch + 1993 + Silicon Graphics + + + + + + + + + + + IRIX Patch 5.1.1.1 + 1993 + Silicon Graphics + + + + + + + + + IRIX 5.3 Recommended/Required Patches September 1997 1997 @@ -866,8 +1800,82 @@ license:CC0 + + Origin and Onyx2 System Disk Patches + 1998 + Silicon Graphics + + + + + + + + + + + Origin/Onyx2 Patch Supplement for IRIX 6.5 + 1998 + Silicon Graphics + + + + + + + + + + + IRIX W4D Update 4.0.1 + 1991 + Silicon Graphics + + + + + + + + + + + IRIX Update 4.0.4 + 1992 + Silicon Graphics + + + + + + + + + + + IRIX 4.0.1 + 1991 + Silicon Graphics + + + + + + + + + + + + + + + + + + IRIX 4.0.2 1992 @@ -890,6 +1898,41 @@ license:CC0 + + IRIX 4.0.4 + 1992 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + IRIX 4.0.4B for IP4, IP5, IP6, IP12 and IP17 + 1992 + Silicon Graphics + + + + + + + + + IRIX 4.0.5 1992 @@ -912,9 +1955,84 @@ license:CC0 + + IRIX 4.0.5H + 1993 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + IRIX 5.0 + 1993 + Silicon Graphics + + + + + + + + + + + IRIX 5.1.1 + 1993 + Silicon Graphics + + + + + + + + + + + Indy IRIX 5.1.1 + 1993 + Silicon Graphics + + + + + + + + + + + IRIX 5.2 Beta II + 1994 + Silicon Graphics + + + + + + + + + IRIX 5.2 - 1994 + 1994 Silicon Graphics @@ -953,7 +2071,7 @@ license:CC0 IRIX 5.3 for Indy R4400 175MHz - 1994 + 1995 Silicon Graphics @@ -964,6 +2082,45 @@ license:CC0 + + IRIX 5.3 All Indigo2 IMPACT + 1995 + Silicon Graphics + + + + + + + + + + + IRIX 5.3 for Indy including R5000 + 1996 + Silicon Graphics + + + + + + + + + + + IRIX 5.3 for Indy R4000, R4400, R4600 (100-200 MHz) + 1995 + Silicon Graphics + + + + + + + + + IRIX 6.0.1 1994 @@ -997,7 +2154,7 @@ license:CC0 - + @@ -1005,7 +2162,7 @@ license:CC0 - + @@ -1047,8 +2204,91 @@ license:CC0 + + IRIX 6.4 for Origin, Onyx2 and OCTANE + 1997 + Silicon Graphics + + + + + + + + + + + IRIX 6.5 Beta + 1998 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - IRIX 6.5 Installation Tools + IRIX 6.5 1998 Silicon Graphics @@ -1133,13 +2373,111 @@ license:CC0 + + IRIX 6.5.1 + 1998 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + IRIX 6.5.2 + 1998 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.3 + 1999 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.4 1999 Silicon Graphics - + @@ -1147,7 +2485,7 @@ license:CC0 - + @@ -1161,6 +2499,145 @@ license:CC0 + + + + + + + + + + + + IRIX 6.5.5 + 1999 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.6 + 1999 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.7 + 2000 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1169,24 +2646,24 @@ license:CC0 Silicon Graphics - - + + - - + + - - + + @@ -1194,7 +2671,7 @@ license:CC0 - + @@ -1217,13 +2694,265 @@ license:CC0 + + IRIX 6.5.9 + 2000 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.10 + 2000 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.13 + 2001 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.15 + 2002 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.22 + 2003 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.26 + 2004 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IRIX 6.5.29 2006 Silicon Graphics - + @@ -1231,7 +2960,7 @@ license:CC0 - + @@ -1239,7 +2968,7 @@ license:CC0 - + @@ -1271,4 +3000,50 @@ license:CC0 + + IRIX 6.5.30 + 2006 + Silicon Graphics + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hash/super80_flop.xml b/hash/super80_flop.xml new file mode 100644 index 00000000000..1b757f39956 --- /dev/null +++ b/hash/super80_flop.xml @@ -0,0 +1,53 @@ + + + + + + + CP/M boot disk + 198? + <unknown> + + + + + + + + + Super-80 DOS disk + 198? + <unknown> + + + + + + + + + Super-80 DOS disk with games + 198? + <unknown> + + + + + + + + + diff --git a/hash/vgmplay.xml b/hash/vgmplay.xml index 15788cb9320..758aa43be0b 100644 --- a/hash/vgmplay.xml +++ b/hash/vgmplay.xml @@ -313074,9 +313074,6 @@ license:CC0 - - - @@ -314209,6 +314206,440 @@ license:CC0 + + + + Joe Montana II - Sports Talk Football (GEN/MD) + 1991 + Sega + + + + + + + + + + + Lotus Turbo Challenge (GEN/MD) + 1992 + Gremlin Graphics Software Ltd. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Madden NFL '95 (GEN/MD) + 1994 + Electronic Arts + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Teddy Boy Blues (GEN/MD) + 1992 + Sega + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Urusei Yatsura - Dear My Friends (Sega CD) (GEN/MD) + 1994 + Game Arts Co., Ltd. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hash/vsmile_cart.xml b/hash/vsmile_cart.xml index 4089f9c8d1b..1915a0adbca 100644 --- a/hash/vsmile_cart.xml +++ b/hash/vsmile_cart.xml @@ -107,7 +107,7 @@ Regular game cartridges | | 80-090160(US) | (Should be Monsters vs. Aliens #80-084440, exists in VTech V.Link database) | | | 80-090163(UK) | Monsters vs. Aliens | | XX | 80-090164(GE) | Monsters vs. Aliens | -| | 80-090165(FR) | Monsters Contre Aliens | +| XX | 80-090165(FR) | Monsters Contre Aliens | | XX | 80-090167(SP) | Monstruos contra Alienígenas (52-090167(SP) on back label) | +========+===================+================================================================================================+ | | 80-090180(US) | | @@ -421,7 +421,7 @@ Regular game cartridges | | 80-092503(UK) | Whiz Kid Wheels | | | 80-092504(GE) | Flitzers Schlaue Staedtetour (diff color) | | XX | 80-092504(GE) | Flitzers Schlaue Staedtetour (purple, 52-092504(GER) on back label) | -| | 80-092505(FR) | Mission Pilote | +| XX | 80-092505(FR) | Mission Pilote | | | 80-092506(PT) | Conducao Diverrido (Cart# 92516) | | XX | 80-092507(SP) | Conducción Divertida (52-92507(SP) on back label) | | | 80-092510(KOR) | Whiz Kid Wheels - 꼬마 자동차 트러클 (50-92510(KOR) on back label) | @@ -510,6 +510,7 @@ Regular game cartridges | XX | 80-092854(SE) | Wall-E | | | (NO) | Wall-E | | | (FI) | Wall-E | +| | (CN) | 瓦力 | +========+===================+================================================================================================+ | XX | 80-092860(US) | Shrek the Third: Arthur's School Day Adventure | | XX | 80-092860(US) | Shrek the Third: Arthur's School Day Adventure (alt) | @@ -1998,8 +1999,6 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul - - @@ -2512,6 +2511,22 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul + + + DreamWorks Monstres contre Aliens (France) + 2009? + VTech + + + + + + + + + + + DreamWorks Monstruos contra Alienígenas (Spain) @@ -4563,7 +4578,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul VTech - + @@ -4571,7 +4586,20 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul - + + + + + Mission Pilote (France) + 200? + VTech + + + + + + + @@ -4582,7 +4610,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul VTech - + @@ -4590,8 +4618,6 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul - - @@ -4602,7 +4628,7 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul VTech - + @@ -4610,8 +4636,6 @@ V.Smile Smartbook Smartidges (need a Smartbook touch tablet connected to a regul - - diff --git a/hash/vsmilem_cart.xml b/hash/vsmilem_cart.xml index 456fd1986f7..09045d9c320 100644 --- a/hash/vsmilem_cart.xml +++ b/hash/vsmilem_cart.xml @@ -141,7 +141,7 @@ Language: | | 80-084362(NL) | Handy Manny | | | 80-084363(UK) | Handy Manny | | | 80-084364(GE) | Meister Manny's Werkzeugkiste | -| | 80-084365(FR) | Manny Et Ses Outils | +| XX | 80-084365(FR) | Manny et ses outils | | | 80-084366(PT) | Manny Maozinhas (84376 on cart) | | | 80-084367(SP) | Manny Manitas | +========+===================+===========================================================================================+ @@ -187,20 +187,20 @@ Language: | | 80-084482(NL) | Prinses en de Kikker (label in english) | | XX | 80-084483(UK) | The Princess and the Frog | | XX | 80-084484(GE) | Kuess den Frosch | -| | 80-084485(FR) | La Princesse Et La Grenouille | +| XX | 80-084485(FR) | La Princesse Et La Grenouille - Le grand rêve de Tiana | | | 80-084487(SP) | Tiana y el Sapo - El gran sueño de Tiana | +========+===================+===========================================================================================+ | XX | 80-084500(US) | Shrek Forever After | | | 80-084502(NL) | Sjrek voor eeuwig en altijd | | | 80-084503(UK) | Shrek Forever After | | XX | 80-084504(GE) | Fuer immer Shrek | -| | 80-084505(FR) | Shrek 4 - Il Etait une Fin | +| XX | 80-084505(FR) | Shrek 4 - Il était une fin | | | 80-084507(SP) | Shrek Felices para siempre | +========+===================+===========================================================================================+ | | 80-084520(US) | | +========+===================+===========================================================================================+ | | 80-084540(US) | Super Why to the Rescue! The Beach Day Mystery | -| | 80-084541(US) | Super Why to the Rescue! The Beach Day Mystery (pocket version) | +| | 80-084541(US) | Super Why to the Rescue! The Beach Day Mystery (pocket version) | +========+===================+===========================================================================================+ | | 80-084560(US) | | +========+===================+===========================================================================================+ @@ -473,7 +473,7 @@ Language: - + Disney Handy Manny (USA, Rev. 2?) 2009 VTech @@ -486,6 +486,19 @@ Language: + + Disney Manny et ses outils (France) + 2009 + VTech + + + + + + + + + DreamWorks Kung Fu Panda - Der Weg des Panda (Germany) 2008? @@ -826,6 +839,18 @@ Language: + + Disney La Princesse Et La Grenouille - Le grand rêve de Tiana (France) + 2010 + VTech + + + + + + + + Scooby-Doo! - Panique à Funland (France) 2008 @@ -886,6 +911,20 @@ Language: + + + Shrek 4 - Il était une fin (France) + 2010? + VTech + + + + + + + + + Fussball Meisterschaft (Germany) diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 14e6b6187f6..11b8e4ea7b8 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -3306,6 +3306,8 @@ if (BUSES["COCO"]~=null) then MAME_DIR .. "src/devices/bus/coco/coco_dcmodem.h", MAME_DIR .. "src/devices/bus/coco/coco_orch90.cpp", MAME_DIR .. "src/devices/bus/coco/coco_orch90.h", + MAME_DIR .. "src/devices/bus/coco/coco_ram.cpp", + MAME_DIR .. "src/devices/bus/coco/coco_ram.h", MAME_DIR .. "src/devices/bus/coco/coco_ssc.cpp", MAME_DIR .. "src/devices/bus/coco/coco_ssc.h", MAME_DIR .. "src/devices/bus/coco/coco_pak.cpp", diff --git a/scripts/src/machine.lua b/scripts/src/machine.lua index ff3315b13de..b758031f6e2 100644 --- a/scripts/src/machine.lua +++ b/scripts/src/machine.lua @@ -2781,7 +2781,7 @@ end --------------------------------------------------- -- ---@src/devices/machine/scnxx562.h,MACHINES["SCN_PCI"] = true +--@src/devices/machine/scn_pci.h,MACHINES["SCN_PCI"] = true --------------------------------------------------- if (MACHINES["SCN_PCI"]~=null) then diff --git a/scripts/src/video.lua b/scripts/src/video.lua index 210501f525f..77e3f9063dc 100644 --- a/scripts/src/video.lua +++ b/scripts/src/video.lua @@ -850,6 +850,17 @@ if (VIDEOS["SED1330"]~=null) then } end +-------------------------------------------------- +-- +--@src/devices/video/sed1500.h,VIDEOS["SED1500"] = true +-------------------------------------------------- +if (VIDEOS["SED1500"]~=null) then + files { + MAME_DIR .. "src/devices/video/sed1500.cpp", + MAME_DIR .. "src/devices/video/sed1500.h", + } +end + -------------------------------------------------- -- --@src/devices/video/sed1520.h,VIDEOS["SED1520"] = true diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index bdd5b7f2b0d..fd0a950e205 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -354,6 +354,7 @@ VIDEOS["SCN2674"] = true VIDEOS["PWM_DISPLAY"] = true --VIDEOS["SED1200"] = true --VIDEOS["SED1330"] = true +--VIDEOS["SED1500"] = true --VIDEOS["SED1520"] = true VIDEOS["SNES_PPU"] = true VIDEOS["STVVDP"] = true @@ -1521,8 +1522,6 @@ files { MAME_DIR .. "src/mame/includes/mitchell.h", MAME_DIR .. "src/mame/video/mitchell.cpp", MAME_DIR .. "src/mame/drivers/sf.cpp", - MAME_DIR .. "src/mame/includes/sf.h", - MAME_DIR .. "src/mame/video/sf.cpp", MAME_DIR .. "src/mame/drivers/sidearms.cpp", MAME_DIR .. "src/mame/includes/sidearms.h", MAME_DIR .. "src/mame/video/sidearms.cpp", diff --git a/scripts/target/mame/mess.lua b/scripts/target/mame/mess.lua index f21de018f9c..eac401549d8 100644 --- a/scripts/target/mame/mess.lua +++ b/scripts/target/mame/mess.lua @@ -382,6 +382,7 @@ VIDEOS["PWM_DISPLAY"] = true VIDEOS["SDA5708"] = true VIDEOS["SED1200"] = true VIDEOS["SED1330"] = true +VIDEOS["SED1500"] = true VIDEOS["SED1520"] = true VIDEOS["SNES_PPU"] = true VIDEOS["STVVDP"] = true @@ -1901,6 +1902,8 @@ files { MAME_DIR .. "src/mame/drivers/fp200.cpp", MAME_DIR .. "src/mame/drivers/fp1100.cpp", MAME_DIR .. "src/mame/drivers/fp6000.cpp", + MAME_DIR .. "src/mame/machine/fp6000_kbd.cpp", + MAME_DIR .. "src/mame/machine/fp6000_kbd.h", MAME_DIR .. "src/mame/drivers/ht6000.cpp", MAME_DIR .. "src/mame/drivers/pb1000.cpp", MAME_DIR .. "src/mame/drivers/pv1000.cpp", @@ -2003,6 +2006,8 @@ files { MAME_DIR .. "src/mame/machine/cit101_kbd.cpp", MAME_DIR .. "src/mame/machine/cit101_kbd.h", MAME_DIR .. "src/mame/drivers/cit220.cpp", + MAME_DIR .. "src/mame/machine/cit220_kbd.cpp", + MAME_DIR .. "src/mame/machine/cit220_kbd.h", } createMESSProjects(_target, _subtarget, "coleco") @@ -4279,6 +4284,7 @@ files { MAME_DIR .. "src/mame/drivers/elwro800.cpp", MAME_DIR .. "src/mame/drivers/emate.cpp", MAME_DIR .. "src/mame/drivers/epic14e.cpp", + MAME_DIR .. "src/mame/drivers/ergo201.cpp", MAME_DIR .. "src/mame/drivers/esprit.cpp", MAME_DIR .. "src/mame/drivers/eti660.cpp", MAME_DIR .. "src/mame/includes/eti660.h", @@ -4460,6 +4466,10 @@ files { MAME_DIR .. "src/mame/drivers/palestra.cpp", MAME_DIR .. "src/mame/machine/nl_palestra.cpp", MAME_DIR .. "src/mame/drivers/mindset.cpp", + MAME_DIR .. "src/mame/drivers/gs6502.cpp", + MAME_DIR .. "src/mame/drivers/gs6809.cpp", + MAME_DIR .. "src/mame/drivers/gscpm.cpp", + MAME_DIR .. "src/mame/drivers/gsz80.cpp", } end diff --git a/src/devices/bus/amiga/keyboard/matrix.cpp b/src/devices/bus/amiga/keyboard/matrix.cpp index 6ff33666fcb..fa588052cd7 100644 --- a/src/devices/bus/amiga/keyboard/matrix.cpp +++ b/src/devices/bus/amiga/keyboard/matrix.cpp @@ -661,7 +661,6 @@ INPUT_PORTS_START(matrix_dk) INPUT_PORTS_END INPUT_PORTS_START(matrix_ch) - // FIXME: natural keyboard doesn't play nicely with PORT_CONDITION, but it's an issue with natural keyboard itself PORT_INCLUDE(matrix_common) PORT_START("CFG") diff --git a/src/devices/bus/bbc/1mhzbus/datacentre.cpp b/src/devices/bus/bbc/1mhzbus/datacentre.cpp index 8cac8ab9a55..71ea5c50767 100644 --- a/src/devices/bus/bbc/1mhzbus/datacentre.cpp +++ b/src/devices/bus/bbc/1mhzbus/datacentre.cpp @@ -82,8 +82,7 @@ void bbc_datacentre_device::device_add_mconfig(machine_config &config) ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", "hdd", false); m_ide->irq_handler().set(FUNC(bbc_datacentre_device::irq_w)); - /* 24LC512 - 512Kb I2C Serial EEPROM */ - I2CMEM(config, m_nvram).set_page_size(128).set_data_size(0x10000); + I2C_24C512(config, m_nvram); // 24LC512 /* import floppy images - delayed to allow RAMFS to initialise before import */ QUICKLOAD(config, "import0", "ssd,dsd,img", attotime::from_seconds(1)).set_load_callback(FUNC(bbc_datacentre_device::quickload_cb<0>)); diff --git a/src/devices/bus/coco/coco_fdc.cpp b/src/devices/bus/coco/coco_fdc.cpp index c0f8295716b..4ee5a759c30 100644 --- a/src/devices/bus/coco/coco_fdc.cpp +++ b/src/devices/bus/coco/coco_fdc.cpp @@ -40,6 +40,32 @@ Reading from $FF48-$FF4F clears bit 7 of DSKREG ($FF40) + --------------------------------------------------------------------------- + + Disto No Halt Extension + + The Disto Super Controller II includes "no halt" circuitry. Implemented + by using a read and write cache. + + CachDat - Cache Data Register + $FF74 & $FF75: Read/Write cache data. + + CachCtrl - Cache Controller + $FF76: Read + Bit 7 low indicates an interrupt request from the disk controller + + $FF76: Write: + 00000000 = Caching off + 00001000 = Tell cache controller to send interrupt when device is + ready to send/receive a buffer (seek done, etc.) + 00000111 = Read cache on - Get next 256 data bytes from controller + to cache + 00000100 = Write cache on - Next 256 bytes stored in cache are + sector + 00000110 = Copy Write cache to controller + + + *********************************************************************/ #include "emu.h" @@ -49,18 +75,20 @@ #include "machine/msm6242.h" #include "machine/ds1315.h" #include "machine/wd_fdc.h" +#include "machine/ram.h" #include "formats/dmk_dsk.h" #include "formats/jvc_dsk.h" #include "formats/vdk_dsk.h" #include "formats/sdf_dsk.h" #include "formats/os9_dsk.h" +// #define VERBOSE (LOG_GENERAL ) +#include "logmacro.h" /*************************************************************************** PARAMETERS ***************************************************************************/ -#define LOG_FDC 0 #define WD_TAG "wd17xx" #define WD2797_TAG "wd2797" #define DISTO_TAG "disto" @@ -88,6 +116,10 @@ protected: NONE = 0xFF }; + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + // device-level overrides virtual DECLARE_READ8_MEMBER(cts_read) override; virtual DECLARE_READ8_MEMBER(scs_read) override; @@ -108,6 +140,16 @@ protected: required_device m_disto_msm6242; // 6242 RTC on Disto interface offs_t m_msm6242_rtc_address; optional_ioport m_rtc; + + // Protected + virtual DECLARE_READ8_MEMBER(ff74_read); + virtual DECLARE_WRITE8_MEMBER(ff74_write); + +private: + // registers + uint8_t m_cache_controler; + uint8_t m_cache_pointer; + required_device m_cache_buffer; }; @@ -143,6 +185,8 @@ void coco_fdc_device_base::device_add_mconfig(machine_config &config) MSM6242(config, m_disto_msm6242, 32.768_kHz_XTAL); DS1315(config, CLOUD9_TAG, 0); + + RAM(config, "cachebuffer").set_default_size("256").set_default_value(0); } @@ -183,6 +227,7 @@ uint8_t* coco_family_fdc_device_base::get_cart_base() return memregion("eprom")->base(); } + //------------------------------------------------- // coco_family_fdc_device_base::get_cart_memregion //------------------------------------------------- @@ -209,9 +254,100 @@ coco_fdc_device_base::coco_fdc_device_base(const machine_config &mconfig, device , m_disto_msm6242(*this, DISTO_TAG) , m_msm6242_rtc_address(0) , m_rtc(*this, ":real_time_clock") + , m_cache_buffer(*this, "cachebuffer") { } + +//------------------------------------------------- +// device_start - device-specific start +//------------------------------------------------- + +void coco_fdc_device_base::device_start() +{ + install_readwrite_handler(0xFF74, 0xFF76, + read8_delegate(*this, FUNC(coco_fdc_device_base::ff74_read)), + write8_delegate(*this, FUNC(coco_fdc_device_base::ff74_write))); + + save_item(NAME(m_cache_controler)); + save_item(NAME(m_cache_pointer)); +} + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void coco_fdc_device_base::device_reset() +{ + m_cache_controler = 0x80; + m_cache_pointer = 0; +} + + +//------------------------------------------------- +// ff74_read - no halt registers +//------------------------------------------------- + +READ8_MEMBER(coco_fdc_device_base::ff74_read) +{ + uint8_t data = 0x0; + + switch(offset) + { + case 0x0: + data = m_cache_buffer->read(m_cache_pointer++); + LOG( "CachDat_A read: %2.2x\n", data ); + break; + case 0x1: + data = m_cache_buffer->read(m_cache_pointer++); + LOG( "CachDat_B read: %2.2x\n", data ); + break; + case 0x2: + data = m_cache_controler; + LOG( "CachCtrl read: %2.2x\n", data ); + break; + } + + return data; +} + + +//------------------------------------------------- +// ff74_write - no halt registers +//------------------------------------------------- + +WRITE8_MEMBER(coco_fdc_device_base::ff74_write) +{ + switch(offset) + { + case 0x0: + LOG( "CachDat_A write: %2.2x\n", data ); + m_cache_buffer->write(m_cache_pointer++, data); + break; + case 0x1: + LOG( "CachDat_B write: %2.2x\n", data ); + m_cache_buffer->write(m_cache_pointer++, data); + break; + case 0x2: + LOG( "CachCtrl write: %2.2x\n", data ); + + // reset static ram buffer pointer on any write + m_cache_pointer = 0; + + if(data == 0) + { + // Clear interrupt when caching is turned off + set_line_value(line::CART, CLEAR_LINE); + m_cache_controler |= 0x80; + } + + m_cache_controler = (m_cache_controler & 0x80) | (data & 0x7f); + break; + } +} + + //------------------------------------------------- // real_time_clock //------------------------------------------------- @@ -238,15 +374,60 @@ coco_fdc_device_base::rtc_type coco_fdc_device_base::real_time_clock() void coco_fdc_device_base::update_lines() { - // clear HALT enable under certain circumstances - if (intrq() && (dskreg() & 0x20)) - set_dskreg(dskreg() & ~0x80); // clear halt enable + if( (m_cache_controler & 0x7f) == 0) /* cache disabled */ + { + // clear HALT enable under certain circumstances + if (intrq() && (dskreg() & 0x20)) + set_dskreg(dskreg() & ~0x80); // clear halt enable - // set the NMI line - set_line_value(line::NMI, intrq() && (dskreg() & 0x20)); + // set the NMI line + set_line_value(line::NMI, intrq() && (dskreg() & 0x20)); - // set the HALT line - set_line_value(line::HALT, !drq() && (dskreg() & 0x80)); + // set the HALT line + set_line_value(line::HALT, !drq() && (dskreg() & 0x80)); + } + else + { + if( drq() == ASSERT_LINE) + { + if( (m_cache_controler & 0x07) == 0x07) /* Read cache on */ + { + uint8_t data = m_wd17xx->data_r(); + LOG("Cached drq read: %2.2x\n", data ); + m_cache_buffer->write(m_cache_pointer++, data); + } + else if( (m_cache_controler & 0x07) == 0x04 ) /* Write cache on */ + { + uint8_t data = m_cache_buffer->read(m_cache_pointer++); + LOG("Cached drq write: %2.2x\n", data ); + m_wd17xx->data_w(data); + } + else if( (m_cache_controler & 0x07) == 0x06 ) /* Copy Write cache to controller */ + { + uint8_t data = m_cache_buffer->read(m_cache_pointer++); + LOG("Cached drq write: %2.2x\n", data ); + m_wd17xx->data_w(data); + } + else + { + LOG("illegal DRQ cached assert mode\n" ); + } + } + + if( (m_cache_controler & 0x08) == 0x08) + { + set_line_value(line::CART, intrq()); + } + + if( intrq() == ASSERT_LINE) + { + m_cache_controler &= 0x7f; + } + else + { + m_cache_controler |= 0x80; + } + } } @@ -259,19 +440,16 @@ void coco_fdc_device_base::dskreg_w(uint8_t data) uint8_t drive = 0; uint8_t head; - if (LOG_FDC) - { - logerror("fdc_coco_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n", - data & 0x80 ? 'H' : 'h', - data & 0x40 ? '3' : '.', - data & 0x20 ? 'D' : 'S', - data & 0x10 ? 'P' : 'p', - data & 0x08 ? 'M' : 'm', - data & 0x04 ? '2' : '.', - data & 0x02 ? '1' : '.', - data & 0x01 ? '0' : '.', - data); - } + LOG("fdc_coco_dskreg_w(): %c%c%c%c%c%c%c%c ($%02x)\n", + data & 0x80 ? 'H' : 'h', + data & 0x40 ? '3' : '.', + data & 0x20 ? 'D' : 'S', + data & 0x10 ? 'P' : 'p', + data & 0x08 ? 'M' : 'm', + data & 0x04 ? '2' : '.', + data & 0x02 ? '1' : '.', + data & 0x01 ? '0' : '.', + data); // An email from John Kowalski informed me that if the DS3 is // high, and one of the other drive bits is selected (DS0-DS2), then the @@ -334,41 +512,46 @@ READ8_MEMBER(coco_fdc_device_base::scs_read) { case 8: result = m_wd17xx->status_r(); + LOG("m_wd17xx->status_r: %2.2x\n", result ); break; case 9: result = m_wd17xx->track_r(); + LOG("m_wd17xx->track_r: %2.2x\n", result ); break; case 10: result = m_wd17xx->sector_r(); + LOG("m_wd17xx->sector_r: %2.2x\n", result ); break; case 11: result = m_wd17xx->data_r(); + LOG("m_wd17xx->data_r: %2.2x\n", result ); break; } /* other stuff for RTCs */ switch (offset) { - case 0x10: /* FF50 */ - if (real_time_clock() == rtc_type::DISTO) - result = m_disto_msm6242->read(m_msm6242_rtc_address); - break; + case 0x10: /* FF50 */ + if (real_time_clock() == rtc_type::DISTO) + result = m_disto_msm6242->read(m_msm6242_rtc_address); + break; - case 0x38: /* FF78 */ - if (real_time_clock() == rtc_type::CLOUD9) - m_ds1315->read_0(); - break; + case 0x38: /* FF78 */ + if (real_time_clock() == rtc_type::CLOUD9) + m_ds1315->read_0(); + break; - case 0x39: /* FF79 */ - if (real_time_clock() == rtc_type::CLOUD9) - m_ds1315->read_1(); - break; + case 0x39: /* FF79 */ + if (real_time_clock() == rtc_type::CLOUD9) + m_ds1315->read_1(); + break; - case 0x3C: /* FF7C */ - if (real_time_clock() == rtc_type::CLOUD9) - result = m_ds1315->read_data(); - break; + case 0x3C: /* FF7C */ + if (real_time_clock() == rtc_type::CLOUD9) + result = m_ds1315->read_data(); + break; } + return result; } @@ -386,15 +569,19 @@ WRITE8_MEMBER(coco_fdc_device_base::scs_write) dskreg_w(data); break; case 8: + LOG("m_wd17xx->cmd_w: %2.2x\n", data ); m_wd17xx->cmd_w(data); break; case 9: + LOG("m_wd17xx->track_w: %2.2x\n", data ); m_wd17xx->track_w(data); break; case 10: + LOG("m_wd17xx->sector_w: %2.2x\n", data ); m_wd17xx->sector_w(data); break; case 11: + LOG("m_wd17xx->data_w: %2.2x\n", data ); m_wd17xx->data_w(data); break; }; diff --git a/src/devices/bus/coco/coco_multi.cpp b/src/devices/bus/coco/coco_multi.cpp index a6705a7b751..1ffa00e3078 100644 --- a/src/devices/bus/coco/coco_multi.cpp +++ b/src/devices/bus/coco/coco_multi.cpp @@ -64,6 +64,7 @@ #include "coco_pak.h" #include "coco_rs232.h" #include "coco_ssc.h" +#include "coco_ram.h" #define SLOT1_TAG "slot1" #define SLOT2_TAG "slot2" @@ -164,6 +165,7 @@ static void coco_cart_slot1_3(device_slot_interface &device) device.option_add("dcmodem", COCO_DCMODEM); device.option_add("orch90", COCO_ORCH90); device.option_add("ssc", COCO_SSC); + device.option_add("ram", COCO_PAK_RAM); device.option_add("games_master", COCO_PAK_GMC); device.option_add("banked_16k", COCO_PAK_BANKED); device.option_add("pak", COCO_PAK); @@ -177,6 +179,7 @@ static void coco_cart_slot4(device_slot_interface &device) device.option_add("dcmodem", COCO_DCMODEM); device.option_add("orch90", COCO_ORCH90); device.option_add("ssc", COCO_SSC); + device.option_add("ram", COCO_PAK_RAM); device.option_add("games_master", COCO_PAK_GMC); device.option_add("banked_16k", COCO_PAK_BANKED); device.option_add("pak", COCO_PAK); diff --git a/src/devices/bus/coco/coco_ram.cpp b/src/devices/bus/coco/coco_ram.cpp new file mode 100644 index 00000000000..46a2b8bfd4e --- /dev/null +++ b/src/devices/bus/coco/coco_ram.cpp @@ -0,0 +1,183 @@ +// license:BSD-3-Clause +// copyright-holders:tim lindner +/*************************************************************************** + + coco_ram.cpp + + Code for emulating the Disto RAM cartridge + + This cartridge came in several forms: 256K, 512K, 768K, and 1024K. + +***************************************************************************/ + +#include "emu.h" +#include "coco_ram.h" +#include "cococart.h" +#include "machine/ram.h" + +#define STATICRAM_TAG "static_ram" + + +// #define VERBOSE (LOG_GENERAL ) +#include "logmacro.h" + +#define RAM_SIZE_IN_K 1024 +#define BUFFER_SIZE (RAM_SIZE_IN_K * 1024) + +#define STRINGIZE_HELPER(expr) #expr +#define STRINGIZE(expr) STRINGIZE_HELPER(expr) + +//************************************************************************** +// TYPE DECLARATIONS +//************************************************************************** + +namespace +{ + // ======================> coco_pak_device + + class coco_pak_ram_device : + public device_t, + public device_cococart_interface + { + public: + // construction/destruction + coco_pak_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual void device_add_mconfig(machine_config &config) override; + + protected: + // device-level overrides + virtual void device_start() override; + virtual void device_reset() override; + virtual DECLARE_WRITE8_MEMBER(scs_write) override; + virtual DECLARE_READ8_MEMBER(scs_read) override; + + private: + required_device m_staticram; + int m_offset; + }; +}; + + + +//************************************************************************** +// GLOBAL VARIABLES +//************************************************************************** + +DEFINE_DEVICE_TYPE_PRIVATE(COCO_PAK_RAM, device_cococart_interface, coco_pak_ram_device, "cocopakram", "Disto " STRINGIZE(RAM_SIZE_IN_K) "K RAM Cartridge") + + + +//------------------------------------------------- +// coco_pak_device - constructor +//------------------------------------------------- + +coco_pak_ram_device::coco_pak_ram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, COCO_PAK_RAM, tag, owner, clock) + , device_cococart_interface(mconfig, *this) + , m_staticram(*this, STATICRAM_TAG) + , m_offset(0) +{ +} + + + +//************************************************************************** +// MACHINE FRAGMENTS AND ADDRESS MAPS +//************************************************************************** + +void coco_pak_ram_device::device_add_mconfig(machine_config &config) +{ + RAM(config, STATICRAM_TAG).set_default_size(STRINGIZE(RAM_SIZE_IN_K) "K").set_default_value(0); +} + + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void coco_pak_ram_device::device_start() +{ + // initial state + m_offset = 0; + + // save state + save_item(NAME(m_offset)); +} + + + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void coco_pak_ram_device::device_reset() +{ + m_offset = 0; +} + + + +//------------------------------------------------- +// scs_write +//------------------------------------------------- + +WRITE8_MEMBER(coco_pak_ram_device::scs_write) +{ +// int idata = data; + + switch(offset) + { + case 0: + m_offset = ((m_offset & 0xffff00) + data); + break; + case 1: + m_offset = ((m_offset & 0xff00ff) + (data << 8)); + break; + case 2: + m_offset = ((m_offset & 0x00ffff) + (data << 16)); + break; + case 3: + if( m_offset < BUFFER_SIZE ) + { + m_staticram->write(m_offset, data); + } + break; + } + + LOG("scs_write: %s: %06x, %02x, %02x\n", machine().describe_context(), m_offset, offset, data); +} + + + +//------------------------------------------------- +// scs_read +//------------------------------------------------- + +READ8_MEMBER(coco_pak_ram_device::scs_read) +{ + uint8_t data = 0x00; + + switch (offset) + { + case 0: + data = (m_offset) & 0xff; + break; + case 1: + data = (m_offset & 0xff00ff) >> 8; + break; + case 2: + data = (m_offset & 0xff0000) >> 16; + break; + case 3: + if( m_offset < BUFFER_SIZE ) + { + data = m_staticram->read(m_offset); + } + + break; + } + + LOG("scs_read: %s: %06x, %02x, %02x\n", machine().describe_context(), m_offset, offset, data); + return data; +} diff --git a/src/devices/bus/coco/coco_ram.h b/src/devices/bus/coco/coco_ram.h new file mode 100644 index 00000000000..a88874cc959 --- /dev/null +++ b/src/devices/bus/coco/coco_ram.h @@ -0,0 +1,14 @@ +// license:BSD-3-Clause +// copyright-holders:tim lindner +#ifndef MAME_BUS_COCO_COCO_RAM_H +#define MAME_BUS_COCO_COCO_RAM_H + +#pragma once + +#include "cococart.h" + +// device type definition +DECLARE_DEVICE_TYPE(COCO_PAK_RAM, device_cococart_interface) + +#endif // MAME_BUS_COCO_COCO_RAM_H + diff --git a/src/devices/bus/ekara/rom.cpp b/src/devices/bus/ekara/rom.cpp index f55fd325d2a..de65f3abeb2 100644 --- a/src/devices/bus/ekara/rom.cpp +++ b/src/devices/bus/ekara/rom.cpp @@ -148,21 +148,21 @@ bool ekara_rom_i2c_24c08_epitch_device::is_write_access_not_rom(void) void ekara_rom_i2c_24c08_epitch_device::device_add_mconfig(machine_config &config) { - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x400); // 24C08 + I2C_24C08(config, "i2cmem", 0); } // i2c 24lc04 void ekara_rom_i2c_24lc04_device::device_add_mconfig(machine_config &config) { - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24LC04 + I2C_24C04(config, "i2cmem", 0); // 24LC04 } // i2c 24lc02 void ekara_rom_i2c_24lc02_device::device_add_mconfig(machine_config &config) { - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02 + I2C_24C02(config, "i2cmem", 0); // 24LC02 } // i2c 24lc02 with direct IO port access @@ -206,7 +206,7 @@ READ_LINE_MEMBER(ekara_rom_i2c_24lc02_gc0010_device::read_sda ) void ekara_rom_i2c_24lc02_gc0010_device::device_add_mconfig(machine_config &config) { - I2CMEM(config, "i2cmem", 0)/*.set_page_size(16)*/.set_data_size(0x100); // 24LC02 + I2C_24C02(config, "i2cmem", 0); // 24LC02 } diff --git a/src/devices/bus/ieee488/grid2102.cpp b/src/devices/bus/ieee488/grid2102.cpp index f8e4ac5a142..a903ef1dc3e 100644 --- a/src/devices/bus/ieee488/grid2102.cpp +++ b/src/devices/bus/ieee488/grid2102.cpp @@ -9,6 +9,7 @@ **********************************************************************/ +#include "emu.h" #include "grid2102.h" // device type definition diff --git a/src/devices/bus/isa/mc1502_fdc.cpp b/src/devices/bus/isa/mc1502_fdc.cpp index f901580314f..2f991d88820 100644 --- a/src/devices/bus/isa/mc1502_fdc.cpp +++ b/src/devices/bus/isa/mc1502_fdc.cpp @@ -70,13 +70,30 @@ TIMER_CALLBACK_MEMBER(mc1502_fdc_device::motor_callback) motor_on = 0; } +void mc1502_fdc_device::motors_onoff() +{ + floppy_image_device *floppy0 = m_fdc->subdevice("0")->get_device(); + floppy_image_device *floppy1 = m_fdc->subdevice("1")->get_device(); + + if (motor_on) + { + // bits 2, 3 -- motor on (drive 0, 1) + floppy0->mon_w(!(m_control & 4)); + floppy1->mon_w(!(m_control & 8)); + } + else + { + floppy0->mon_w(ASSERT_LINE); + floppy1->mon_w(ASSERT_LINE); + } +} + uint8_t mc1502_fdc_device::mc1502_wd17xx_aux_r() { - uint8_t data; - - data = 0; - - return data; + motor_timer->adjust(attotime::from_msec(3000)); + motor_on = 1; + motors_onoff(); + return 0; } void mc1502_fdc_device::mc1502_wd17xx_aux_w(uint8_t data) @@ -86,24 +103,15 @@ void mc1502_fdc_device::mc1502_wd17xx_aux_w(uint8_t data) floppy_image_device *floppy = ((data & 0x10) ? floppy1 : floppy0); // master reset - if ((data & 1) == 0) - m_fdc->reset(); + m_fdc->mr_w(data & 1); m_fdc->set_floppy(floppy); // SIDE ONE floppy->ss_w((data & 2) ? 1 : 0); - // bits 2, 3 -- motor on (drive 0, 1) - // the schematic appears to show the motor lines connected, if they aren't then motor_on doesn't work correctly - floppy0->mon_w(!(data & 12)); - floppy1->mon_w(!(data & 12)); - - if (data & 12) - { - motor_timer->adjust(attotime::from_msec(3000)); - motor_on = 1; - } + m_control = data; + motors_onoff(); } /* @@ -191,6 +199,7 @@ mc1502_fdc_device::mc1502_fdc_device(const machine_config &mconfig, const char * , device_isa8_card_interface(mconfig, *this) , m_fdc(*this, "fdc") , motor_on(0) + , m_control(0) , motor_timer(nullptr) , m_cpu(*this, finder_base::DUMMY_TAG) { @@ -214,4 +223,5 @@ void mc1502_fdc_device::device_start() motor_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mc1502_fdc_device::motor_callback),this)); motor_on = 0; + m_control = 0; } diff --git a/src/devices/bus/isa/mc1502_fdc.h b/src/devices/bus/isa/mc1502_fdc.h index 5689409e63e..c05f2bef328 100644 --- a/src/devices/bus/isa/mc1502_fdc.h +++ b/src/devices/bus/isa/mc1502_fdc.h @@ -51,9 +51,10 @@ private: required_device m_fdc; int motor_on; + u8 m_control; emu_timer *motor_timer; required_device m_cpu; - + void motors_onoff(); public: void mc1502_wd17xx_aux_w(uint8_t data); uint8_t mc1502_wd17xx_aux_r(); diff --git a/src/devices/bus/jakks_gamekey/rom.cpp b/src/devices/bus/jakks_gamekey/rom.cpp index 0ca9b7024d9..c18d24d06ba 100644 --- a/src/devices/bus/jakks_gamekey/rom.cpp +++ b/src/devices/bus/jakks_gamekey/rom.cpp @@ -96,7 +96,7 @@ WRITE16_MEMBER(jakks_gamekey_rom_i2c_base_device::write_cart_seeprom) void jakks_gamekey_rom_i2c_24lc04_device::device_add_mconfig(machine_config &config) { - I2CMEM(config, "i2cmem", 0)/*.set_page_size(16)*/.set_data_size(0x200); // 24LC04 + I2C_24C04(config, "i2cmem", 0); // 24LC04 } diff --git a/src/devices/bus/megadrive/jcart.cpp b/src/devices/bus/megadrive/jcart.cpp index 76f38ff0dd3..80ade82bd86 100644 --- a/src/devices/bus/megadrive/jcart.cpp +++ b/src/devices/bus/megadrive/jcart.cpp @@ -88,7 +88,7 @@ void md_seprom_codemast_device::device_add_mconfig(machine_config &config) void md_seprom_mm96_device::device_add_mconfig(machine_config &config) { - I2C_24C16A(config, m_i2cmem); + I2C_24C16(config, m_i2cmem); // 24C16A } diff --git a/src/devices/cpu/i8085/i8085.cpp b/src/devices/cpu/i8085/i8085.cpp index a0f58190824..aae072b6cb7 100644 --- a/src/devices/cpu/i8085/i8085.cpp +++ b/src/devices/cpu/i8085/i8085.cpp @@ -212,6 +212,7 @@ i8085a_cpu_device::i8085a_cpu_device(const machine_config &mconfig, device_type , m_program_config("program", ENDIANNESS_LITTLE, 8, 16, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 8, 0) , m_opcode_config("opcodes", ENDIANNESS_LITTLE, 8, 16, 0) + , m_in_inta_func(*this) , m_out_status_func(*this) , m_out_inte_func(*this) , m_in_sid_func(*this) @@ -308,6 +309,7 @@ void i8085a_cpu_device::device_start() m_trap_pending = 0; m_trap_im_copy = 0; m_sod_state = 0; + m_in_acknowledge = false; m_ietemp = false; init_tables(); @@ -351,6 +353,7 @@ void i8085a_cpu_device::device_start() m_io = &space(AS_IO); /* resolve callbacks */ + m_in_inta_func.resolve(); m_out_status_func.resolve_safe(); m_out_inte_func.resolve_safe(); m_in_sid_func.resolve_safe(0); @@ -372,6 +375,7 @@ void i8085a_cpu_device::device_start() save_item(NAME(m_trap_pending)); save_item(NAME(m_trap_im_copy)); save_item(NAME(m_sod_state)); + save_item(NAME(m_in_acknowledge)); set_icountptr(m_icount); } @@ -479,11 +483,13 @@ void i8085a_cpu_device::execute_set_input(int irqline, int state) { int newstate = (state != CLEAR_LINE); - /* NMI is edge-triggered */ - if (irqline == INPUT_LINE_NMI) + /* TRAP is level and edge-triggered NMI */ + if (irqline == I8085_TRAP_LINE) { if (!m_nmi_state && newstate) m_trap_pending = true; + else if (!newstate) + m_trap_pending = false; m_nmi_state = newstate; } @@ -511,6 +517,8 @@ void i8085a_cpu_device::break_halt_for_interrupt() } else set_status(0x23); /* int ack */ + + m_in_acknowledge = true; } void i8085a_cpu_device::check_for_interrupts() @@ -527,7 +535,7 @@ void i8085a_cpu_device::check_for_interrupts() /* break out of HALT state and call the IRQ ack callback */ break_halt_for_interrupt(); - standard_irq_callback(INPUT_LINE_NMI); + standard_irq_callback(I8085_TRAP_LINE); /* push the PC and jump to $0024 */ op_push(m_PC); @@ -584,29 +592,17 @@ void i8085a_cpu_device::check_for_interrupts() /* followed by classic INTR */ else if (m_irq_state[I8085_INTR_LINE] && (m_im & IM_IE)) { - u32 vector; - /* break out of HALT state and call the IRQ ack callback */ + if (!m_in_inta_func.isnull()) + standard_irq_callback(I8085_INTR_LINE); break_halt_for_interrupt(); - vector = standard_irq_callback(I8085_INTR_LINE); + + u8 vector = read_inta(); /* use the resulting vector as an opcode to execute */ set_inte(0); - switch (vector & 0xff0000) - { - case 0xcd0000: /* CALL nnnn */ - m_icount -= 7; - op_push(m_PC); - case 0xc30000: /* JMP nnnn */ - m_icount -= 10; - m_PC.d = vector & 0xffff; - break; - - default: - LOG("i8085 take int $%02x\n", vector); - execute_one(vector & 0xff); - break; - } + LOG("i8085 take int $%02x\n", vector); + execute_one(vector); } } @@ -670,14 +666,27 @@ u8 i8085a_cpu_device::get_rim_value() // memory access u8 i8085a_cpu_device::read_arg() { - return m_cache->read_byte(m_PC.w.l++); + set_status(0x82); // memory read + if (m_in_acknowledge) + return read_inta(); + else + return m_cache->read_byte(m_PC.w.l++); } PAIR i8085a_cpu_device::read_arg16() { PAIR p; - p.b.l = m_cache->read_byte(m_PC.w.l++); - p.b.h = m_cache->read_byte(m_PC.w.l++); + set_status(0x82); // memory read + if (m_in_acknowledge) + { + p.b.l = read_inta(); + p.b.h = read_inta(); + } + else + { + p.b.l = m_cache->read_byte(m_PC.w.l++); + p.b.h = m_cache->read_byte(m_PC.w.l++); + } return p; } @@ -687,6 +696,14 @@ u8 i8085a_cpu_device::read_op() return m_opcode_cache->read_byte(m_PC.w.l++); } +u8 i8085a_cpu_device::read_inta() +{ + if (m_in_inta_func.isnull()) + return standard_irq_callback(I8085_INTR_LINE); + else + return m_in_inta_func(m_PC.w.l); +} + u8 i8085a_cpu_device::read_mem(u32 a) { set_status(0x82); // memory read @@ -855,13 +872,15 @@ void i8085a_cpu_device::execute_run() do { - debugger_instruction_hook(m_PC.d); - /* the instruction after an EI does not take an interrupt, so we cannot check immediately; handle post-EI behavior here */ if (m_after_ei != 0 && --m_after_ei == 0) check_for_interrupts(); + m_in_acknowledge = false; + logerror("PC=%04X\n", m_PC.d); + debugger_instruction_hook(m_PC.d); + /* here we go... */ execute_one(read_op()); diff --git a/src/devices/cpu/i8085/i8085.h b/src/devices/cpu/i8085/i8085.h index f97a9020852..0c67c3a3c56 100644 --- a/src/devices/cpu/i8085/i8085.h +++ b/src/devices/cpu/i8085/i8085.h @@ -45,6 +45,9 @@ public: // CLK rate callback (8085A only) template void set_clk_out(T &&... args) { m_clk_out_func.set(std::forward(args)...); } + // INTA vector fetch callback + auto in_inta_func() { return m_in_inta_func.bind(); } + // STATUS changed callback auto out_status_func() { return m_out_status_func.bind(); } @@ -100,6 +103,7 @@ private: address_space_config m_io_config; address_space_config m_opcode_config; + devcb_read8 m_in_inta_func; devcb_write8 m_out_status_func; devcb_write_line m_out_inte_func; devcb_read_line m_in_sid_func; @@ -121,6 +125,7 @@ private: u8 m_trap_pending; /* TRAP interrupt latched? */ u8 m_trap_im_copy; /* copy of IM register when TRAP was taken */ u8 m_sod_state; /* state of the SOD line */ + bool m_in_acknowledge; bool m_ietemp; /* import/export temp space */ @@ -144,6 +149,7 @@ private: u8 get_rim_value(); void break_halt_for_interrupt(); u8 read_op(); + u8 read_inta(); u8 read_arg(); PAIR read_arg16(); u8 read_mem(u32 a); diff --git a/src/devices/cpu/i86/i186.cpp b/src/devices/cpu/i86/i186.cpp index 17b6dccfd86..468283588e7 100644 --- a/src/devices/cpu/i86/i186.cpp +++ b/src/devices/cpu/i86/i186.cpp @@ -586,7 +586,7 @@ void i80186_cpu_device::device_start() state_add( I8086_VECTOR, "V", m_int_vector).formatstr("%02X"); state_add( I8086_PC, "PC", m_pc ).callimport().formatstr("%05X"); - state_add( STATE_GENPCBASE, "CURPC", m_pc ).callimport().formatstr("%05X").noshow(); + state_add( STATE_GENPCBASE, "CURPC", [this] { return (m_sregs[CS] << 4) + m_prev_ip; }).mask(0xfffff).noshow(); state_add( I8086_HALT, "HALT", m_halt ).mask(1); // Most of these mnemonics are borrowed from the Intel 80C186EA/80C188EA User's Manual. diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index 4bf1adcc008..c307e23901b 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -275,7 +275,7 @@ void i80286_cpu_device::device_start() state_add( I286_VECTOR, "V", m_int_vector).formatstr("%02X"); state_add( I286_PC, "PC", m_pc).callimport().formatstr("%06X"); - state_add( STATE_GENPCBASE, "CURPC", m_pc ).callimport().formatstr("%06X").noshow(); + state_add( STATE_GENPCBASE, "CURPC", [this] { return m_base[CS] + m_prev_ip; }).mask(0xffffff).noshow(); state_add( I8086_HALT, "HALT", m_halt ).mask(1); m_out_shutdown_func.resolve_safe(); @@ -316,7 +316,6 @@ void i80286_cpu_device::state_import(const device_state_entry &entry) break; case STATE_GENPC: - case STATE_GENPCBASE: if (m_pc - m_base[CS] > m_limit[CS]) { // TODO: should this call data_descriptor instead of ignoring jumps outside the current segment? @@ -331,6 +330,7 @@ void i80286_cpu_device::state_import(const device_state_entry &entry) } } m_ip = m_pc - m_base[CS]; + m_prev_ip = m_ip; break; } } @@ -769,7 +769,7 @@ void i80286_cpu_device::code_descriptor(uint16_t selector, uint16_t offset, int m_limit[CS] = LIMIT(desc); m_base[CS] = BASE(desc); m_rights[CS] = RIGHTS(desc); - m_ip = offset; + m_prev_ip = m_ip = offset; } else { // systemdescriptor @@ -862,7 +862,7 @@ void i80286_cpu_device::code_descriptor(uint16_t selector, uint16_t offset, int } else { - m_ip = offset; + m_prev_ip = m_ip = offset; m_sregs[CS]=selector; m_base[CS]=selector<<4; m_rights[CS]=0x93; @@ -880,11 +880,11 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) { number = standard_irq_callback(0); - m_irq_state = CLEAR_LINE; - m_pending_irq &= ~INT_IRQ; hwint = 1; } + debugger_exception_hook(number); + if(!PM) { PUSH(flags & ~0xf000); @@ -979,7 +979,7 @@ void i80286_cpu_device::interrupt_descriptor(int number, int hwint, int error) m_limit[CS] = LIMIT(gatedesc); m_base[CS] = BASE(gatedesc); m_rights[CS] = RIGHTS(gatedesc); - m_ip = GATEOFF(desc); + m_prev_ip = m_ip = GATEOFF(desc); m_TF = 0; m_NT = 0; if(GATE(RIGHTS(desc)) == INTGATE) diff --git a/src/devices/cpu/i86/i286.h b/src/devices/cpu/i86/i286.h index 8c028b44571..489e7beb099 100644 --- a/src/devices/cpu/i86/i286.h +++ b/src/devices/cpu/i86/i286.h @@ -23,6 +23,16 @@ enum I286_BP, I286_SI, I286_DI, + + I286_AL, + I286_AH, + I286_CL, + I286_CH, + I286_DL, + I286_DH, + I286_BL, + I286_BH, + I286_FLAGS, I286_ES, diff --git a/src/devices/cpu/i86/i86.cpp b/src/devices/cpu/i86/i86.cpp index 0233d66ece2..8f9697cb97d 100644 --- a/src/devices/cpu/i86/i86.cpp +++ b/src/devices/cpu/i86/i86.cpp @@ -359,7 +359,7 @@ void i8086_cpu_device::device_start() state_add( I8086_VECTOR, "V", m_int_vector).formatstr("%02X"); state_add( I8086_PC, "PC", m_pc ).callimport().formatstr("%05X"); - state_add( STATE_GENPCBASE, "CURPC", m_pc ).callimport().formatstr("%05X").noshow(); + state_add( STATE_GENPCBASE, "CURPC", [this] { return (m_sregs[CS] << 4) + m_prev_ip; }).mask(0xfffff).noshow(); state_add( I8086_HALT, "HALT", m_halt ).mask(1); } @@ -421,10 +421,10 @@ void i8086_common_cpu_device::state_import(const device_state_entry &entry) break; case STATE_GENPC: - case STATE_GENPCBASE: if (m_pc - (m_sregs[CS] << 4) > 0xffff) m_sregs[CS] = m_pc >> 4; m_ip = m_pc - (m_sregs[CS] << 4); + m_prev_ip = m_ip; break; } } @@ -506,7 +506,7 @@ void i8086_common_cpu_device::device_start() // Register state for debugger state_add( I8086_IP, "IP", m_ip ).callimport().formatstr("%04X"); state_add( I8086_AX, "AX", m_regs.w[AX] ).formatstr("%04X"); - state_add( I8086_CX, "CX", m_regs.w[CS] ).formatstr("%04X"); + state_add( I8086_CX, "CX", m_regs.w[CX] ).formatstr("%04X"); state_add( I8086_DX, "DX", m_regs.w[DX] ).formatstr("%04X"); state_add( I8086_BX, "BX", m_regs.w[BX] ).formatstr("%04X"); state_add( I8086_SP, "SP", m_regs.w[SP] ).formatstr("%04X"); @@ -514,6 +514,15 @@ void i8086_common_cpu_device::device_start() state_add( I8086_SI, "SI", m_regs.w[SI] ).formatstr("%04X"); state_add( I8086_DI, "DI", m_regs.w[DI] ).formatstr("%04X"); + state_add( I8086_AL, "AL", m_regs.b[AL] ).noshow(); + state_add( I8086_AH, "AH", m_regs.b[AH] ).noshow(); + state_add( I8086_CL, "CL", m_regs.b[CL] ).noshow(); + state_add( I8086_CH, "CH", m_regs.b[CH] ).noshow(); + state_add( I8086_DL, "DL", m_regs.b[DL] ).noshow(); + state_add( I8086_DH, "DH", m_regs.b[DH] ).noshow(); + state_add( I8086_BL, "BL", m_regs.b[BL] ).noshow(); + state_add( I8086_BH, "BH", m_regs.b[BH] ).noshow(); + state_add(STATE_GENFLAGS, "GENFLAGS", m_TF).formatstr("%16s").noshow(); set_icountptr(m_icount); @@ -586,7 +595,7 @@ void i8086_common_cpu_device::interrupt(int int_num, int trap) PUSH(m_sregs[CS]); PUSH(m_ip); - m_ip = dest_off; + m_prev_ip = m_ip = dest_off; m_sregs[CS] = dest_seg; } diff --git a/src/devices/cpu/i86/i86.h b/src/devices/cpu/i86/i86.h index 6943cc6a7eb..3ecf3050dda 100644 --- a/src/devices/cpu/i86/i86.h +++ b/src/devices/cpu/i86/i86.h @@ -20,6 +20,7 @@ enum { I8086_PC = STATE_GENPC, I8086_IP = 1, I8086_AX, I8086_CX, I8086_DX, I8086_BX, I8086_SP, I8086_BP, I8086_SI, I8086_DI, + I8086_AL, I8086_AH, I8086_CL, I8086_CH, I8086_DL, I8086_DH, I8086_BL, I8086_BH, I8086_FLAGS, I8086_ES, I8086_CS, I8086_SS, I8086_DS, I8086_VECTOR, I8086_HALT }; diff --git a/src/devices/cpu/i960/i960.cpp b/src/devices/cpu/i960/i960.cpp index 10409923b15..abf2c089cb2 100644 --- a/src/devices/cpu/i960/i960.cpp +++ b/src/devices/cpu/i960/i960.cpp @@ -91,6 +91,27 @@ void i960_cpu_device::send_iac(uint32_t adr) iac[3] = m_program->read_dword(adr+12); switch(iac[0]>>24) { + case 0x40: // generate irq + break; + case 0x41: // test for pending interrupts + // check_irqs() seems to take care of this + // though it may not be entirely accurate + check_irqs(); + break; + case 0x80: // store SAT & PRCB in memory + m_program->write_dword(iac[1], m_SAT); + m_program->write_dword(iac[1]+4, m_PRCB); + break; + case 0x89: // invalidate internal instruction cache + // we do not emulate the instruction cache, so this is safe to ignore + break; + case 0x8F: // enable/disable breakpoints + // processor breakpoints are not emulated, safe to ignore + break; + case 0x91: // stop processor + break; + case 0x92: // continue initialization + break; case 0x93: // reinit m_SAT = iac[1]; m_PRCB = iac[2]; diff --git a/src/devices/cpu/i960/i960dis.cpp b/src/devices/cpu/i960/i960dis.cpp index eb6227a8154..5bb99c75458 100644 --- a/src/devices/cpu/i960/i960dis.cpp +++ b/src/devices/cpu/i960/i960dis.cpp @@ -9,90 +9,169 @@ #include "emu.h" #include "i960dis.h" +/* + Based on documents: + 270567-001 80960KB Programmer's Reference Manual (March 1988) + 270710-003 i960 CA/CF Microprocessor User's Manual (March 1994) + 271081-001 80960MC Programmer's Reference Manual (July 1988) + 272483-001 i960 Jx Microprocessor User's Manual (September 1994) + 272484-002 i960 Hx Microprocessor Developer's Manual (September 1998) + 272736-002 i960 Rx I/O Microprocessor Developer's Manual (April 1997) + 273353-001 Intel 80303 I/O Processor Developer's Manual (May 2000) +*/ const i960_disassembler::mnemonic_t i960_disassembler::mnemonic[256] = { - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // 00 - { "b", 8 }, { "call", 8 }, { "ret", 9 }, { "bal", 8 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // 00 + { "b", 1, 1 }, { "call", 1, 1 }, { "ret", 1, 0 }, { "bal", 1, 1 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "bno", 8 }, { "bg", 8 }, { "be", 8 }, { "bge", 8 }, { "bl", 8 }, { "bne", 8 }, { "ble", 8 }, { "bo", 8 }, // 10 - { "faultno", 0 }, { "faultg", 0 }, { "faulte", 0 }, { "faultge", 0 }, { "faultl", 0 }, { "faultne", 0 }, { "faultle", 0 }, { "faulto", 0 }, + { "bno", 1, 1 }, { "bg", 1, 1 }, { "be", 1, 1 }, { "bge", 1, 1 }, { "bl", 1, 1 }, { "bne", 1, 1 }, { "ble", 1, 1 }, { "bo", 1, 1 }, // 10 + { "faultno", 1, 0 }, { "faultg", 1, 0 }, { "faulte", 1, 0 }, { "faultge", 1, 0 }, { "faultl", 1, 0 }, { "faultne", 1, 0 }, { "faultle", 1, 0 }, { "faulto", 1, 0 }, - { "testno", 10 }, { "testg", 10 }, { "teste", 10 }, { "testge", 10 }, { "testl", 10 }, { "testne", 10 }, { "testle", 10 }, { "testo", 10 }, // 20 - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "testno", 2, 1 }, { "testg", 2, 1 }, { "teste", 2, 1 }, { "testge", 2, 1 }, { "testl", 2, 1 }, { "testne", 2, 1 }, { "testle", 2, 1 }, { "testo", 2, 1 }, // 20 + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "bbc", 6 }, { "cmpobg", 7 }, { "cmpobe", 7 }, { "cmpobge", 7 }, { "cmpobl", 7 }, { "cmpobne", 7 }, { "cmpoble", 7 }, { "bbs", 6 }, // 30 - { "cmpibno", 7 }, { "cmpibg", 7 }, { "cmpibe", 7 }, { "cmpibge", 7 }, { "cmpibl", 7 }, { "cmpibne", 7 }, { "cmpible", 7 }, { "cmpibo", 7 }, + { "bbc", 2, 3 }, { "cmpobg", 2, 3 }, { "cmpobe", 2, 3 }, { "cmpobge", 2, 3 }, { "cmpobl", 2, 3 }, { "cmpobne", 2, 3 }, { "cmpoble", 2, 3 }, { "bbs", 2, 3 }, // 30 + { "cmpibno", 2, 3 }, { "cmpibg", 2, 3 }, { "cmpibe", 2, 3 }, { "cmpibge", 2, 3 }, { "cmpibl", 2, 3 }, { "cmpibne", 2, 3 }, { "cmpible", 2, 3 }, { "cmpibo", 2, 3 }, - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // 40 - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // 40 + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // 50 - { "58", 3 }, { "59", 3 }, { "5A", 3 }, { "5B", 3 }, { "5C", 2 }, { "5D", 2 }, { "?", 0 }, { "5F", 2 }, + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // 50 + { "58", 4, 0 }, { "59", 4, 0 }, { "5A", 4, 0 }, { "5B", 4, 0 }, { "5C", 4, 0 }, { "5D", 4, 0 }, { "?", 0, 0 }, { "5F", 4, 0 }, - { "60", 3 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "64", 3 }, { "65", 3 }, { "calls", 0 }, { "67", 3 }, // 60 - { "68", 3 }, { "69", 3 }, { "?", 0 }, { "?", 0 }, { "6C", 3 }, { "6D", 3 }, { "6E", 3 }, { "?", 0 }, + { "60", 4, 0 }, { "61", 4, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "64", 4, 0 }, { "65", 4, 0 }, { "66", 4, 0 }, { "67", 4, 0 }, // 60 + { "68", 4, 0 }, { "69", 4, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "6C", 4, 0 }, { "6D", 4, 0 }, { "6E", 4, 0 }, { "?", 0, 0 }, - { "70", 3 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "74", 3 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // 70 - { "78", 3 }, { "79", 3 }, { "7A", 3 }, { "7B", 3 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "70", 4, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "74", 4, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // 70 + { "78", 4, 0 }, { "79", 4, 0 }, { "7A", 4, 0 }, { "7B", 4, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "ldob", 4 }, { "?", 0 }, { "stob", 1 }, { "?", 0 }, { "bx", 11 }, { "balx", 1 }, { "callx", 11 }, { "?", 0 }, // 80 - { "ldos", 4 }, { "?", 0 }, { "stos", 1 }, { "?", 0 }, { "lda", 4 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "ldob", 3, 2 }, { "?", 0, 0 }, { "stob", 3, -2 }, { "?", 0, 0 }, { "bx", 3, 1 }, { "balx", 3, 2 }, { "callx", 3, 1 }, { "?", 0, 0 }, // 80 + { "ldos", 3, 2 }, { "?", 0, 0 }, { "stos", 3, -2 }, { "?", 0, 0 }, { "lda", 3, 2 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "ld", 4 }, { "?", 0 }, { "st", 1 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // 90 - { "ldl", 4 }, { "?", 0 }, { "stl", 1 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "ld", 3, 2 }, { "?", 0, 0 }, { "st", 3, -2 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // 90 + { "ldl", 3, 2 }, { "?", 0, 0 }, { "stl", 3, -2 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "ldt", 4 }, { "?", 0 }, { "stt", 1 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // a0 - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "ldt", 3, 2 }, { "?", 0, 0 }, { "stt", 3, -2 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // a0 + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "dcinva", 3, 1 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "ldq", 4 }, { "?", 0 }, { "stq", 1 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // b0 - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "ldq", 3, 2 }, { "?", 0, 0 }, { "stq", 3, -2 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // b0 + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "ldib", 4 }, { "?", 0 }, { "stib", 1 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // c0 - { "ldis", 4 }, { "?", 0 }, { "stis", 1 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "ldib", 3, 2 }, { "?", 0, 0 }, { "stib", 3, -2 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // c0 + { "ldis", 3, 2 }, { "?", 0, 0 }, { "stis", 3, -2 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // d0 - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // d0 + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // e0 - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // e0 + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, // f0 - { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 }, { "?", 0 } + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, // f0 + { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 }, { "?", 0, 0 } }; -const i960_disassembler::mnemonic_t i960_disassembler::mnem_reg[111] = +const i960_disassembler::mnemonic_t i960_disassembler::mnem_reg[197] = { - { "notbit", 0x580 }, { "and", 0x581 }, { "andnot", 0x582 }, { "setbit", 0x583 }, { "notand",0x584 }, - { "xor", 0x586 }, { "or", 0x587 }, { "nor", 0x588 }, { "xnor",0x589 }, { "not",0x58a }, - { "clrbit", 0x58c }, { "alterbit", 0x58f }, - { "addo", 0x590 }, { "addi",0x591 }, { "subo",0x592 }, { "subi",0x593 }, { "cmpob",0x594 }, { "shro",0x598 }, { "shrdi",0x59a }, { "shri",0x59b }, { "shlo",0x59c }, { "rotate",0x59d }, { "shli",0x59e }, - { "cmpo",0x5a0 }, { "cmpi",0x5a1 }, { "concmpo",0x5a2 }, { "concmpi",0x5a3 }, { "cmpinco",0x5a4 }, { "cmpinci",0x5a5 }, { "cmpdeco",0x5a6 }, { "cmpdeci",0x5a7 }, { "scanbyte",0x5ac }, { "bswap",0x5ad }, { "chkbit",0x5ae }, - { "addc",0x5b0 }, { "subc",0x5b2 }, - { "mov", 0x5cc }, - { "movl",0x5dc }, - { "movq",0x5fc }, - { "synmov",0x600 }, { "synmovq",0x602 }, - { "scanbit", 0x641 }, { "daddc", 0x642 }, { "dsubc", 0x643 }, { "dmovt", 0x644 }, { "modac",0x645 }, - { "modify",0x650 }, { "extract",0x651 }, { "modtc",0x654 }, { "modpc",0x655 }, - { "emul",0x670 }, { "ediv",0x671 }, { "cvtir", 0x674 }, { "cvtilr", 0x675 }, { "scalerl", 0x676 }, { "scaler", 0x677 }, - { "atanr",0x680 }, { "logepr", 0x681 }, { "logr", 0x682 }, { "remr", 0x683 }, { "cmpor", 0x684 }, { "cmpr", 0x685 }, { "sqrtr", 0x688 }, - { "expr", 0x689 }, { "logbnr", 0x68a }, { "roundr", 0x68b }, { "sinr", 0x68c }, { "cosr", 0x68d }, { "tanr", 0x68e }, { "classr", 0x68f }, - { "atanrl",0x690 }, { "logeprl", 0x691 }, { "logrl", 0x692 }, { "remrl", 0x693 }, { "cmporl", 0x694 }, { "cmprl", 0x695 }, { "sqrtrl", 0x698 }, - { "exprl", 0x699 }, { "logbnrl", 0x69a }, { "roundrl", 0x69b }, { "sinrl", 0x69c }, { "cosrl", 0x69d }, { "tanrl", 0x69e }, { "classrl", 0x69f }, - { "cvtri", 0x6c0 }, { "cvtril", 0x6c1 }, { "cvtzri", 0x6c2 }, { "cvtzril", 0x6c3 }, { "movr", 0x6c9 }, - { "movrl", 0x6d9 }, - { "movre", 0x6e1 }, { "cpysre", 0x6e2 }, { "cpyrsre", 0x6e3 }, - { "mulo", 0x701 }, { "remo",0x708 }, { "divo",0x70b }, - { "muli",0x741 }, { "remi",0x748 }, { "modi",0x749 }, { "divi",0x74b }, - { "divr",0x78b }, { "mulr",0x78c }, { "subr",0x78d }, { "addr",0x78f }, - { "divrl",0x79b }, { "mulrl",0x79c }, { "subrl",0x79d }, { "addrl",0x79f }, - { "ending_code",0 } -}; + { "notbit", 0x580, -3 }, { "and", 0x581, -3 }, { "andnot", 0x582, -3 }, { "setbit", 0x583, -3 }, // 58 + { "notand", 0x584, -3 }, { "xor", 0x586, -3 }, { "or", 0x587, -3 }, + { "nor", 0x588, -3 }, { "xnor", 0x589, -3 }, { "not", 0x58a, -2 }, { "ornot", 0x58b, -3 }, + { "clrbit", 0x58c, -3 }, { "notor", 0x58d, -3 }, { "nand", 0x58e, -3 }, { "alterbit", 0x58f, -3 }, -const char *const i960_disassembler::constnames[32] = -{ - "0x0", "0x1", "0x2", "0x3", "0x4", "0x5", "0x6", "0x7", "0x8", "0x9", "0xa", "0xb", "0xc", "0xd", "0xe", "0xf", - "0x10", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "0x17", "0x18", "0x19", "0x1a", "0x1b", "0x1c", "0x1d", "0x1e", "0x1f" + { "addo", 0x590, -3 }, { "addi", 0x591, -3 }, { "subo", 0x592, -3 }, { "subi", 0x593, -3 }, // 59 + { "cmpob", 0x594, 2 }, { "cmpib", 0x595, 2 }, { "cmpos", 0x596, 2 }, { "cmpis", 0x597, 2 }, + { "shro", 0x598, -3 }, { "shrdi", 0x59a, -3 }, { "shri", 0x59b, -3 }, + { "shlo", 0x59c, -3 }, { "rotate", 0x59d, -3 }, { "shli", 0x59e, -3 }, + + { "cmpo", 0x5a0, 2 }, { "cmpi", 0x5a1, 2 }, { "concmpo", 0x5a2, 2 }, { "concmpi", 0x5a3, 2 }, // 5a + { "cmpinco", 0x5a4, -3 }, { "cmpinci", 0x5a5, -3 }, { "cmpdeco", 0x5a6, -3 }, { "cmpdeci", 0x5a7, -3 }, + { "scanbyte", 0x5ac, 2 }, { "bswap", 0x5ad, -2 }, { "chkbit", 0x5ae, 2 }, + + { "addc", 0x5b0, -3 }, { "subc", 0x5b2, -3 }, { "intdis", 0x5b4, 0 }, { "inten", 0x5b5, 0 }, // 5b + + { "mov", 0x5cc, -2 }, // 5c + + { "eshro", 0x5d8, -3 }, // 5d + { "movl", 0x5dc, -2 }, + + { "movt", 0x5ec, -2 }, // 5e + + { "movq", 0x5fc, -2 }, // 5f + + { "synmov", 0x600, 2 }, { "synmovl", 0x601, 2 }, { "synmovq", 0x602, 2 }, { "cmpstr", 0x603, 3 }, // 60 + { "movqstr", 0x604, -3 }, { "movstr", 0x605, -3 }, + + { "atmod", 0x610, 33 }, { "atadd", 0x612, 33 }, { "inspacc", 0x613, -2 }, // 61 + { "ldphy", 0x614, -2 }, { "synld", 0x615, -2 }, { "fill", 0x617, 3 }, + + { "sdma", 0x630, 3 }, { "udma", 0x631, 0 }, // 63 + + { "spanbit", 0x640, -2 }, { "scanbit", 0x641, -2 }, { "daddc", 0x642, -3 }, { "dsubc", 0x643, -3 }, // 64 + { "dmovt", 0x644, -2 }, { "modac", 0x645, 3 }, + + { "modify", 0x650, 33 }, { "extract", 0x651, 33 }, // 65 + { "modtc", 0x654, 33 }, { "modpc", 0x655, 33 }, { "receive", 0x656, -2 }, + { "intctl", 0x658, -2 }, { "sysctl", 0x659, 33 }, { "icctl", 0x65b, 33 }, + { "dcctl", 0x65c, 33 }, { "halt", 0x65d, 0 }, + + { "calls", 0x660, 1 }, { "send", 0x662, -3 }, { "sendserv", 0x663, 1 }, // 66 + { "resumprcs", 0x664, 1 }, { "schedprcs", 0x665, 1 }, { "saveprcs", 0x666, 0 }, + { "condwait", 0x668, 1 }, { "wait", 0x669, 1 }, { "signal", 0x66a, 1 }, { "mark", 0x66b, 0 }, + { "fmark", 0x66c, 0 }, { "flushreg", 0x66d, 0 }, { "syncf", 0x66f, 0 }, + + { "emul", 0x670, -3 }, { "ediv", 0x671, -3 }, { "ldtime", 0x671, -1 }, // 67 + { "cvtir", 0x674, -20 }, { "cvtilr", 0x675, -20 }, { "scalerl", 0x676, -30 }, { "scaler", 0x677, -30 }, + + { "atanr", 0x680, -30 }, { "logepr", 0x681, -30 }, { "logr", 0x682, -30 }, { "remr", 0x683, -30 }, // 68 + { "cmpor", 0x684, 20 }, { "cmpr", 0x685, 20 }, + { "sqrtr", 0x688, -20 }, { "expr", 0x689, -20 }, { "logbnr", 0x68a, -20 }, { "roundr", 0x68b, -20 }, + { "sinr", 0x68c, -20 }, { "cosr", 0x68d, -20 }, { "tanr", 0x68e, -20 }, { "classr", 0x68f, 10 }, + + { "atanrl", 0x690, -30 }, { "logeprl", 0x691, -30 }, { "logrl", 0x692, -30 }, { "remrl", 0x693, -30 }, // 69 + { "cmporl", 0x694, 20 }, { "cmprl", 0x695, 20 }, + { "sqrtrl", 0x698, -20 }, { "exprl", 0x699, -20 }, { "logbnrl", 0x69a, -20 }, { "roundrl", 0x69b, -20 }, + { "sinrl", 0x69c, -20 }, { "cosrl", 0x69d, -20 }, { "tanrl", 0x69e, -20 }, { "classrl", 0x69f, 10 }, + + { "cvtri", 0x6c0, -20 }, { "cvtril", 0x6c1, -20 }, { "cvtzri", 0x6c2, -20 }, { "cvtzril", 0x6c3, -20 }, // 6c + { "movr", 0x6c9, -20 }, + + { "movrl", 0x6d9, -20 }, // 6d + + { "movre", 0x6e1, -20 }, { "cpysre", 0x6e2, -30 }, { "cpyrsre", 0x6e3, -30 }, // 6e + { "movre", 0x6e9, -20 }, + + { "mulo", 0x701, -3 }, // 70 + { "remo", 0x708, -3 }, { "divo", 0x70b, -3 }, + + { "muli", 0x741, -3 }, // 74 + { "remi", 0x748, -3 }, { "modi", 0x749, -3 }, { "divi", 0x74b, -3 }, + + { "addono", 0x780, -3 }, { "addino", 0x781, -3 }, { "subono", 0x782, -3 }, { "subino", 0x783, -3 }, // 78 + { "selno", 0x784, -3 }, + { "divr", 0x78b, -30 }, { "mulr", 0x78c, -30 }, { "subr", 0x78d, -30 }, { "addr", 0x78f, -30 }, + + { "addog", 0x790, -3 }, { "addig", 0x791, -3 }, { "subog", 0x792, -3 }, { "subig", 0x793, -3 }, // 79 + { "selg", 0x794, -3 }, + { "divrl", 0x79b, -30 }, { "mulrl", 0x79c, -30 }, { "subrl", 0x79d, -30 }, { "addrl", 0x79f, -30 }, + + { "addoe", 0x7a0, -3 }, { "addie", 0x7a1, -3 }, { "suboe", 0x7a2, -3 }, { "subie", 0x7a3, -3 }, // 7a + { "sele", 0x7a4, -3 }, + + { "addoge", 0x7b0, -3 }, { "addige", 0x7b1, -3 }, { "suboge", 0x7b2, -3 }, { "subige", 0x7b3, -3 }, // 7b + { "selge", 0x7b4, -3 }, + + { "addol", 0x7c0, -3 }, { "addil", 0x7c1, -3 }, { "subol", 0x7c2, -3 }, { "subil", 0x7c3, -3 }, // 7c + { "sell", 0x7c4, -3 }, + + { "addone", 0x7d0, -3 }, { "addine", 0x7d1, -3 }, { "subone", 0x7d2, -3 }, { "subine", 0x7d3, -3 }, // 7d + { "selne", 0x7d4, -3 }, + + { "addole", 0x7e0, -3 }, { "addile", 0x7e1, -3 }, { "subole", 0x7e2, -3 }, { "subile", 0x7e3, -3 }, // 7e + { "selle", 0x7e4, -3 }, + + { "addoo", 0x7f0, -3 }, { "addio", 0x7f1, -3 }, { "suboo", 0x7f2, -3 }, { "subio", 0x7f3, -3 }, // 7f + { "selo", 0x7f4, -3 }, + + { "ending_code", 0, 0 } }; const char *const i960_disassembler::regnames[32] = @@ -101,80 +180,355 @@ const char *const i960_disassembler::regnames[32] = "g0","g1","g2","g3", "g4","g5","g6","g7", "g8","g9","g10","g11", "g12","g13","g14","fp", }; -#define REG_DST regnames[dst] -#define REG_ABASE regnames[abase] -#define REG_REG2 regnames[reg2] -#define REG_COBR_SRC1 ((iCode & 0x2000) ? constnames[COBRSRC1] : regnames[COBRSRC1]) -#define REG_COBR_SRC2 regnames[COBRSRC2] -#define NEM mnemonic[op].mnem - -// REG format -#define SRC1 (iCode & 0x1f) -#define S1 ((iCode >> 5) & 0x1) -#define S2 ((iCode >> 6) & 0x1) -#define OP2 ((iCode >> 7) & 0xf) -#define M1 ((iCode >> 11) & 0x1) -#define M2 ((iCode >> 12) & 0x1) -#define M3 ((iCode >> 13) & 0x1) -#define SRC2 ((iCode >> 14) & 0x1f) -#define DST ((iCode >> 19) & 0x1f) -#define OP ((iCode >> 24) & 0xff) - -// COBR format -#define COBRSRC1 ((iCode >> 19) & 0x1f) -#define COBRSRC2 ((iCode >> 14) & 0x1f) - -std::string i960_disassembler::dis_decode_reg(u32 iCode, unsigned char cnt) +const char *const i960_disassembler::fprnames[32] = { - std::string src1, src2, dst; + "fp0","fp1","fp2","fp3", "?","?","?","?", "?","?","?","?", "?","?","?","?", + "+0.0","?","?","?", "?","?","+1.0","?", "?","?","?","?", "?","?","?","?", +}; - if (S1) - src1 = ""; - else +offs_t i960_disassembler::dis_decode_invalid(std::ostream &stream, u32 iCode) +{ + /* + u8 op = (unsigned char) (iCode >> 24); + u8 op2 = (unsigned char) (iCode >> 7)&0xf; + u8 model = (unsigned char) (iCode >> 10) &0x3; + u8 modeh = (unsigned char) (iCode >> 12) &0x3; + return util::stream_format(stream, "%s %08lx %02x:%01x %1x %1x", mnemonic[op].mnem, iCode, op, op2, modeh, model); + */ + //util::stream_format(stream, ".word\t0x%08x", iCode); + util::stream_format(stream, "? %08x", iCode); + + return 4; +} + +offs_t i960_disassembler::dis_decode_ctrl(std::ostream &stream, u32 iCode, u32 ip, signed char cnt) +{ + u8 op = (unsigned char) (iCode >> 24); + //u8 t = (unsigned char) (iCode >> 1 & 1); // Cx, Hx, Rx - branch prediction (ignored for now) + u32 disp = iCode & 0x00fffffc; + + // check bit 0 + if ((iCode & 1) != 0x0) return dis_decode_invalid(stream, iCode); + + switch(cnt) { - if(M1) - src1 = util::string_format("0x%lx", SRC1); - else - src1 = util::string_format("%s", regnames[SRC1]); + case 0: // no operand + util::stream_format(stream, "%s", mnemonic[op].mnem); + break; + case 1: // 1 operand + util::stream_format(stream, "%-8s%08lx", mnemonic[op].mnem, ((((s32)disp) << 8) >> 8) + (ip)); + break; + default: + return dis_decode_invalid(stream, iCode); + break; } - if (S2) - src2 = ",reserved"; - else + return 4; +} + +offs_t i960_disassembler::dis_decode_cobr(std::ostream &stream, u32 iCode, u32 ip, signed char cnt) +{ + u8 op = (unsigned char) (iCode >> 24); + u8 src1 = (unsigned char) (iCode >> 19) & 0x1f; + u8 src2 = (unsigned char) (iCode >> 14) & 0x1f; + u8 m1 = (unsigned char) (iCode >> 13 & 1); + //u8 t = (unsigned char) (iCode >> 1 & 1); // Cx, Hx, Rx - branch prediction + u8 s2 = (unsigned char) iCode & 1; // Cx, Hx, Rx - src2 = special function register + u32 disp = iCode & 0x1ffc; + + std::string op1, op2, op3; + + switch(cnt) { - if(M2) - src2 = util::string_format(",0x%lx", SRC2); - else - src2 = util::string_format(",%s", regnames[SRC2]); + case 1: // 1 operand (test*) + // For the test-if instructions, only the srcl field is used. Here, this field specifies a destination global or local register (ml is ignored). + util::stream_format(stream, "%-8s%s", mnemonic[op].mnem, regnames[src1]); + break; + case 3: // 3 operands + // TODO m1 set differs on Mx, Kx, Jx, Rx references (literal) and Hx reference (sf-register) + if (m1) op1 = util::string_format("%d", src1); + else op1 = util::string_format("%s", regnames[src1]); + if (s2) op2 = util::string_format("sf%d", src2); + else op2 = util::string_format("%s", regnames[src2]); + op3 = util::string_format("0x%lx", ((((s32)disp) << 19) >> 19) + (ip)); + + util::stream_format(stream, "%-8s%s,%s,%s", mnemonic[op].mnem, op1, op2, op3); + break; + default: + return dis_decode_invalid(stream, iCode); + break; } - if(M3) - dst = ""; - else - dst = util::string_format(",%s", regnames[DST]); + return 4; +} - if (cnt == 1) - return util::string_format("%s%s", src1, dst); - else - return util::string_format("%s%s%s", src1, src2, dst); +offs_t i960_disassembler::dis_decode_mema(std::ostream &stream, u32 iCode, signed char cnt) +{ + u8 op = (unsigned char) (iCode >> 24); + u8 srcdst = (unsigned char) (iCode >> 19) & 0x1f; + u8 abase = (unsigned char) (iCode >> 14) & 0x1f; + u8 mode = (unsigned char) (iCode >> 13) & 0x1; + u32 offset = iCode & 0xfff; + + switch(mode) + { + case 0: + // offset + switch(cnt) + { + case 1: // bx/callx + util::stream_format(stream, "%-8s0x%lx", mnemonic[op].mnem, offset); + break; + case 2: // load + util::stream_format(stream, "%-8s0x%lx,%s", mnemonic[op].mnem, offset, regnames[srcdst]); + break; + case -2: // store + util::stream_format(stream, "%-8s%s,0x%lx", mnemonic[op].mnem, regnames[srcdst], offset); + break; + default: + return dis_decode_invalid(stream, iCode); + break; + } + break; + case 1: + // (abase) + offset + switch(cnt) + { + case 1: // bx/callx + util::stream_format(stream, "%-8s0x%lx(%s)", mnemonic[op].mnem, offset, regnames[abase]); + break; + case 2: // load + util::stream_format(stream, "%-8s0x%lx(%s),%s", mnemonic[op].mnem, offset, regnames[abase], regnames[srcdst]); + break; + case -2: // store + util::stream_format(stream, "%-8s%s,0x%lx(%s)", mnemonic[op].mnem, regnames[srcdst], offset, regnames[abase]); + break; + default: + return dis_decode_invalid(stream, iCode); + break; + } + break; + default: + return dis_decode_invalid(stream, iCode); + break; + } + + return 4; +} + +offs_t i960_disassembler::dis_decode_memb(std::ostream &stream, u32 iCode, u32 ip, u32 disp, signed char cnt) +{ + u8 op = (unsigned char) (iCode >> 24); + u8 srcdst = (unsigned char) (iCode >> 19) & 0x1f; + u8 abase = (unsigned char) (iCode >> 14) & 0x1f; + u8 mode = (unsigned char) (iCode >> 10) & 0xf; + u8 scale = (unsigned char) (iCode >> 7) & 0x7; + u8 index = (unsigned char) iCode & 0x1f; + + offs_t IPinc; + std::string efa; + + // check bits 5 and 6 + if ((iCode & 0x60) != 0x0) return dis_decode_invalid(stream, iCode); + + // check scale + if (scale > 4) return dis_decode_invalid(stream, iCode); + + if ((mode == 0x5) || (mode >= 0xc)) IPinc = 8; + else IPinc = 4; + + switch(mode) + { + case 0x4: // (abase) + efa = util::string_format("(%s)", regnames[abase]); + break; + case 0x5: // (IP) + displacement + 8 + efa = util::string_format("0x%x", ip + disp + 8); + break; + case 0x6: // reserved + return dis_decode_invalid(stream, iCode); + break; + case 0x7: // (abase) + (index) * 2^scale + if (scale == 0) efa = util::string_format("(%s)[%s]", regnames[abase], regnames[index]); + else efa = util::string_format("(%s)[%s*%ld]", regnames[abase], regnames[index], 1 << scale); + break; + case 0xc: // displacement + efa = util::string_format("0x%x", disp); + break; + case 0xd: // (abase) + displacement + efa = util::string_format("0x%x(%s)", disp, regnames[abase]); + break; + case 0xe: // (index) * 2^scale + displacement + if (scale == 0) efa = util::string_format("0x%x[%s]", disp, regnames[index]); + else efa = util::string_format("0x%x[%s*%ld]", disp, regnames[index], 1 << scale); + break; + case 0xf: // (abase) + (index) * 2^scale + displacement + if (scale == 0) efa = util::string_format("0x%x(%s)[%s]", disp, regnames[abase], regnames[index]); + else efa = util::string_format("0x%x(%s)[%s*%ld]", disp, regnames[abase], regnames[index], 1 << scale); + break; + default: + return dis_decode_invalid(stream, iCode); + break; + } + + switch (cnt) + { + case 1: // bx/callx + util::stream_format(stream, "%-8s%s", mnemonic[op].mnem, efa); + break; + case 2: // load + util::stream_format(stream, "%-8s%s,%s", mnemonic[op].mnem, efa, regnames[srcdst]); + break; + case -2: // store + util::stream_format(stream, "%-8s%s,%s", mnemonic[op].mnem, regnames[srcdst], efa); + break; + default: + return dis_decode_invalid(stream, iCode); + break; + } + + return IPinc; +} + +offs_t i960_disassembler::dis_decode_reg(std::ostream &stream, u32 iCode) +{ + u16 op = (unsigned short) ((iCode >> 20) & 0xff0) | ((iCode >> 7) & 0xf); + u8 srcdst = (unsigned char) (iCode >> 19) & 0x1f; + u8 src2 = (unsigned char) (iCode >> 14) & 0x1f; + u8 m3 = (unsigned char) (iCode >> 13) & 1; + u8 m2 = (unsigned char) (iCode >> 12) & 1; + u8 m1 = (unsigned char) (iCode >> 11) & 1; + u8 s2 = (unsigned char) (iCode >> 6) & 1; + u8 s1 = (unsigned char) (iCode >> 5) & 1; + u8 src1 = (unsigned char) iCode & 0x1f; + + u8 sm1 = ((s1 << 1) | m1); + u8 sm2 = ((s2 << 1) | m2); + u32 i = 0; + std::string op1, op2, op3; + + while(mnem_reg[i].type != 0) + { + if (mnem_reg[i].type == op) break; + i++; + } + if (mnem_reg[i].type != op) return dis_decode_invalid(stream, iCode); + + switch (sm1) + { + case 0: // neither set + op1 = util::string_format("%s", regnames[src1]); + break; + case 1: // M1 set + op1 = util::string_format("%d", src1); + break; + case 2: // S1 set + op1 = util::string_format("sf%d", src1); + break; + case 3: // M1 and S1 set + default: + return dis_decode_invalid(stream, iCode); + break; + } + + switch (sm2) + { + case 0: // neither set + op2 = util::string_format("%s", regnames[src2]); + break; + case 1: // M2 set + op2 = util::string_format("%d", src2); + break; + case 2: // S2 set + op2 = util::string_format("sf%d", src2); + break; + case 3: // M2 and S2 set + default: + return dis_decode_invalid(stream, iCode); + break; + } + + switch (mnem_reg[i].flags) + { + case 0: // no operand + util::stream_format(stream, "%-8s", mnem_reg[i].mnem); + break; + case 1: // single operand, which is NOT a destination. + util::stream_format(stream, "%-8s%s", mnem_reg[i].mnem, op1); + break; + case -1: // single operand, which IS a destination. + if (m3) op3 = util::string_format("sf%d", srcdst); + else op3 = util::string_format("%s", regnames[srcdst]); + util::stream_format(stream, "%-8s%s", mnem_reg[i].mnem, op3); + break; + case 2: // 2 operands, the 2nd of which is NOT a destination. + util::stream_format(stream, "%-8s%s,%s", mnem_reg[i].mnem, op1, op2); + break; + case -2: // 2 operands, the 2nd of which IS a destination. + if (m3) op3 = util::string_format("sf%d", srcdst); + else op3 = util::string_format("%s", regnames[srcdst]); + util::stream_format(stream, "%-8s%s,%s", mnem_reg[i].mnem, op1, op3); + break; + case 3: // 3 operands, the 3rd of which is NOT a destination. + if (m3) op3 = util::string_format("%d", srcdst); + else op3 = util::string_format("%s", regnames[srcdst]); + util::stream_format(stream, "%-8s%s,%s,%s", mnem_reg[i].mnem, op1, op2, op3); + break; + case -3: // 3 operands, the 3rd of which IS a destination. + if (m3) op3 = util::string_format("sf%d", srcdst); + else op3 = util::string_format("%s", regnames[srcdst]); + util::stream_format(stream, "%-8s%s,%s,%s", mnem_reg[i].mnem, op1, op2, op3); + break; + case 33: // 3 operands, the 3rd of which is source and destination. + // m3 must NOT be set for src/dst type + if (m3) return dis_decode_invalid(stream, iCode); + op3 = util::string_format("%s", regnames[srcdst]); + util::stream_format(stream, "%-8s%s,%s,%s", mnem_reg[i].mnem, op1, op2, op3); + break; + + // floating point opcodes + case 10: // single operand, which is NOT a destination. + if (m1) op1 = util::string_format("%s", fprnames[src1]); + else op1 = util::string_format("%s", regnames[src1]); + util::stream_format(stream, "%-8s%s", mnem_reg[i].mnem, op1); + break; + case 20: // 2 operands, the 2nd of which is NOT a destination. + if (m1) op1 = util::string_format("%s", fprnames[src1]); + else op1 = util::string_format("%s", regnames[src1]); + if (m2) op2 = util::string_format("%s", fprnames[src2]); + else op2 = util::string_format("%s", regnames[src2]); + util::stream_format(stream, "%-8s%s,%s", mnem_reg[i].mnem, op1, op2); + break; + case -20: // 2 operands, the 2nd of which IS a destination. + if (m1) op1 = util::string_format("%s", fprnames[src1]); + else op1 = util::string_format("%s", regnames[src1]); + if (m3) op3 = util::string_format("%s", fprnames[srcdst]); + else op3 = util::string_format("%s", regnames[srcdst]); + util::stream_format(stream, "%-8s%s,%s", mnem_reg[i].mnem, op1, op3); + break; + case -30: // 3 operands, the 3rd of which IS a destination. + if (m1) op1 = util::string_format("%s", fprnames[src1]); + else op1 = util::string_format("%s", regnames[src1]); + if (m2) op2 = util::string_format("%s", fprnames[src2]); + else op2 = util::string_format("%s", regnames[src2]); + if (m3) op3 = util::string_format("%s", fprnames[srcdst]); + else op3 = util::string_format("%s", regnames[srcdst]); + util::stream_format(stream, "%-8s%s,%s,%s", mnem_reg[i].mnem, op1, op2, op3); + break; + default: + return dis_decode_invalid(stream, iCode); + break; + } + + return 4; } offs_t i960_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) { u32 IP = pc; - u32 iCode = opcodes.r32(IP); - u8 op = (unsigned char) (iCode >> 24); - u8 op2 = (unsigned char) (iCode >> 7)&0xf; - u16 opc = 0; - u32 i = 0; - u8 model = (unsigned char) (iCode >> 10) &0x3; - u8 modeh = (unsigned char) (iCode >> 12) &0x3; - //mode = (unsigned char) (iCode >> 10) &0x7; - u8 dst = (unsigned char) (iCode >> 19) &0x1f; - u8 abase = (unsigned char) (iCode>>14)&0x1f; - u8 reg2 = (unsigned char) (iCode)&0x1f; + u8 op = (unsigned char) (iCode >> 24); offs_t IPinc = 4; offs_t disflags = 0; @@ -186,157 +540,25 @@ offs_t i960_disassembler::disassemble(std::ostream &stream, offs_t pc, const dat switch(mnemonic[op].type) { - case 0: // not yet implemented - util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); + case 0: // invalid / not yet implemented + IPinc = dis_decode_invalid(stream, iCode); break; - case 1: // memory access (write) - switch(modeh) - { - case 0: - util::stream_format(stream, "%-8s%s,0x%lx",NEM,REG_DST, iCode&0xfff); - break; - case 1: - switch (model) - { - case 0: - util::stream_format(stream, "%-8s%s,(%s)",NEM,REG_DST, REG_ABASE); - break; - case 3: - util::stream_format(stream, "%-8s%s,(%s)[%s*%ld]",NEM,REG_DST, REG_ABASE,REG_REG2,1<<((iCode>>7)&0x7)); - break; - default: - util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); - break; - } - break; - case 2: - util::stream_format(stream, "%-8s%s,0x%lx(%s)",NEM,REG_DST, iCode&0xfff,REG_ABASE); - break; - case 3: - switch (model) - { - case 0: - util::stream_format(stream, "%-8s%s,0x%x",NEM,REG_DST, opcodes.r32(IP + 4)); - IPinc = 8; - break; - case 1: - util::stream_format(stream, "%-8s%s,0x%x(%s)",NEM,REG_DST, opcodes.r32(IP + 4),REG_ABASE); - IPinc = 8; - break; - case 2: - util::stream_format(stream, "%-8s%s,0x%x[%s*%ld]",NEM,REG_DST, opcodes.r32(IP + 4),REG_REG2,1<<((iCode>>7)&0x7)); - IPinc = 8; - break; - case 3: - util::stream_format(stream, "%-8s%s,0x%x(%s)[%s*%ld]",NEM,REG_DST, opcodes.r32(IP + 4),REG_ABASE,REG_REG2,1<<((iCode>>7)&0x7)); - IPinc = 8; - break; - default: - util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); - break; - } - break; - default: - util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); - break; - } + case 1: // CTRL format + IPinc = dis_decode_ctrl(stream, iCode, IP, mnemonic[op].flags); break; - case 2: - i = 0; - opc = op<<4|op2; - - while(mnem_reg[i].type != 0) - { - if (mnem_reg[i].type == opc) break; - i++; - } - - if (mnem_reg[i].type == opc) util::stream_format(stream, "%-8s%s", mnem_reg[i].mnem,dis_decode_reg(iCode,1)); - else util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); + case 2: // COBR compare and branch type + IPinc = dis_decode_cobr(stream, iCode, IP, mnemonic[op].flags); break; - case 3: - i = 0; - opc = op<<4|op2; - - while(mnem_reg[i].type != 0) - { - if (mnem_reg[i].type == opc) break; - i++; - } - - if (mnem_reg[i].type == opc) util::stream_format(stream, "%-8s%s", mnem_reg[i].mnem,dis_decode_reg(iCode,0)); - else util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); + case 3: // MEM format + if ((iCode >> 12) & 0x1) + // MEMB format + IPinc = dis_decode_memb(stream, iCode, IP, opcodes.r32(IP + 4), mnemonic[op].flags); + else + // MEMA format + IPinc = dis_decode_mema(stream, iCode, mnemonic[op].flags); break; - case 4: // memory access (read) - switch(modeh) - { - case 0: - util::stream_format(stream, "%-8s0x%lx,%s",NEM,iCode&0xfff,REG_DST); - break; - case 1: - switch (model) - { - case 0: - util::stream_format(stream, "%-8s(%s),%s",NEM,REG_ABASE,REG_DST); - break; - case 3: - util::stream_format(stream, "%-8s(%s)[%s*%ld],%s",NEM,REG_ABASE,REG_REG2,1<<((iCode>>7)&0x7),REG_DST); - break; - default: - util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); - break; - } - break; - case 2: - util::stream_format(stream, "%-8s0x%lx(%s),%s",NEM,iCode&0xfff,REG_ABASE,REG_DST); - break; - case 3: - switch (model) - { - case 0: - util::stream_format(stream, "%-8s0x%x,%s",NEM,opcodes.r32(IP + 4),REG_DST); - IPinc = 8; - break; - case 1: - util::stream_format(stream, "%-8s0x%x(%s),%s",NEM,opcodes.r32(IP + 4),REG_ABASE,REG_DST); - IPinc = 8; - break; - case 2: - util::stream_format(stream, "%-8s0x%x[%s*%ld],%s",NEM,opcodes.r32(IP + 4),REG_REG2,1<<((iCode>>7)&0x7),REG_DST); - IPinc = 8; - break; - case 3: - util::stream_format(stream, "%-8s0x%x(%s)[%s*%ld],%s",NEM, opcodes.r32(IP + 4),REG_ABASE,REG_REG2,1<<((iCode>>7)&0x7),REG_DST); - IPinc = 8; - break; - default: - util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); - break; - } - break; - default: - util::stream_format(stream, "%s %02x:%01x %08lx %1x %1x",mnemonic[op].mnem,op,op2,iCode, modeh, model); - break; - } - break; - - case 6: // bitpos and branch type - util::stream_format(stream, "%-8s%ld,%s,0x%lx",NEM, COBRSRC1, REG_COBR_SRC2,((((s32)iCode&0x00fffffc)<<19)>>19) + (IP)); - break; - case 7: // compare and branch type - util::stream_format(stream, "%-8s%s,%s,0x%lx",NEM,REG_COBR_SRC1,REG_COBR_SRC2,((((s32)iCode&0x00fffffc)<<19)>>19) + (IP)); - break; - case 8: // target type - util::stream_format(stream, "%-8s%08lx",NEM,((((s32)iCode&0x00fffffc)<<8)>>8) + (IP)); - break; - case 9: // no operands - util::stream_format(stream, "%s",NEM); - break; - case 10: // TEST type: register only - util::stream_format(stream, "%s %s", NEM, REG_DST); - break; - case 11: // workaround to match users guide - util::stream_format(stream, "%-8s(%s)",NEM, REG_ABASE); + case 4: // REG format + IPinc = dis_decode_reg(stream, iCode); break; default: stream << "???"; diff --git a/src/devices/cpu/i960/i960dis.h b/src/devices/cpu/i960/i960dis.h index b3620371545..16941815acd 100644 --- a/src/devices/cpu/i960/i960dis.h +++ b/src/devices/cpu/i960/i960dis.h @@ -19,14 +19,20 @@ private: { const char *mnem; unsigned short type; + signed char flags; }; static const mnemonic_t mnemonic[256]; - static const mnemonic_t mnem_reg[111]; - static const char *const constnames[32]; + static const mnemonic_t mnem_reg[197]; static const char *const regnames[32]; + static const char *const fprnames[32]; - std::string dis_decode_reg(u32 iCode, unsigned char cnt); + offs_t dis_decode_invalid(std::ostream &stream, u32 iCode); + offs_t dis_decode_ctrl(std::ostream &stream, u32 iCode, u32 ip, signed char cnt); + offs_t dis_decode_cobr(std::ostream &stream, u32 iCode, u32 ip, signed char cnt); + offs_t dis_decode_mema(std::ostream &stream, u32 iCode, signed char cnt); + offs_t dis_decode_memb(std::ostream &stream, u32 iCode, u32 ip, u32 disp, signed char cnt); + offs_t dis_decode_reg(std::ostream &stream, u32 iCode); }; diff --git a/src/devices/cpu/m6800/m6801.cpp b/src/devices/cpu/m6800/m6801.cpp index 9e791d3b3bc..a2c036825f4 100644 --- a/src/devices/cpu/m6800/m6801.cpp +++ b/src/devices/cpu/m6800/m6801.cpp @@ -37,7 +37,7 @@ #define OC2 m_output_compare2.w.l #define OC2H m_output_compare2.w.h #define OC2D m_output_compare2.d -#define TOH m_timer_over.w.l +#define TOH m_timer_over.w.h #define TOD m_timer_over.d // serial I/O @@ -1352,10 +1352,10 @@ uint8_t hd6301x_cpu_device::p7_data_r() void hd6301x_cpu_device::p7_data_w(uint8_t data) { - LOGPORT("Port 7 Data Register: %02x\n", data); - data &= 0x1f; + LOGPORT("Port 7 Data Register: %02x\n", data); + m_portx_data[2] = data; m_out_portx_func[2](0, m_portx_data[2], 0x1f); } @@ -1369,9 +1369,11 @@ uint8_t m6801_cpu_device::tcsr_r() void m6801_cpu_device::tcsr_w(uint8_t data) { + data &= 0x1f; + LOGTIMER("Timer Control and Status Register: %02x\n", data); - m_tcsr = data; + m_tcsr = data | (m_tcsr & 0xe0); m_pending_tcsr &= m_tcsr; modified_tcsr(); if( !(m_cc & 0x10) ) @@ -1390,11 +1392,7 @@ uint8_t m6801_cpu_device::ch_r() uint8_t m6801_cpu_device::cl_r() { - uint8_t data = m_counter.b.l; - - // HACK there should be a break here, but Coleco Adam won't boot with it present, proper fix required to the free-running counter - (void)data; - return ocrh_r(); + return m_counter.b.l; } void m6801_cpu_device::ch_w(uint8_t data) diff --git a/src/devices/cpu/m6800/m6801.h b/src/devices/cpu/m6800/m6801.h index b9d65bb9d02..ecb34ccf65a 100644 --- a/src/devices/cpu/m6800/m6801.h +++ b/src/devices/cpu/m6800/m6801.h @@ -91,10 +91,9 @@ protected: uint8_t p4_data_r(); void p4_data_w(uint8_t data); -public: // FIXME: psion.cpp accesses this +protected: uint8_t tcsr_r(); void tcsr_w(uint8_t data); -protected: uint8_t ch_r(); uint8_t cl_r(); void ch_w(uint8_t data); diff --git a/src/devices/cpu/m68000/m68kfpu.hxx b/src/devices/cpu/m68000/m68kfpu.hxx index 43471ea4801..866301acb9f 100644 --- a/src/devices/cpu/m68000/m68kfpu.hxx +++ b/src/devices/cpu/m68000/m68kfpu.hxx @@ -1480,6 +1480,16 @@ void fpgen_rm_reg(u16 w2) m_icount -= 43; break; } + case 0x21: // FMOD + { + s8 const mode = float_rounding_mode; + float_rounding_mode = float_round_to_zero; + m_fpr[dst] = floatx80_rem(m_fpr[dst], source); + SET_CONDITION_CODES(m_fpr[dst]); + float_rounding_mode = mode; + m_icount -= 43; // guess + break; + } case 0x22: // FADD { m_fpr[dst] = floatx80_add(m_fpr[dst], source); diff --git a/src/devices/cpu/m6809/hd6309.ops b/src/devices/cpu/m6809/hd6309.ops index c96e3082d4f..e8e1a53f78f 100644 --- a/src/devices/cpu/m6809/hd6309.ops +++ b/src/devices/cpu/m6809/hd6309.ops @@ -50,7 +50,7 @@ MAIN: case 0x1E: %EXG; return; case 0x1F: %TFR; return; - case 0x20: set_cond(true); %BRANCH; return; + case 0x20: set_cond(true); %BRANCH; return; case 0x21: set_cond(false); %BRANCH; return; case 0x22: set_cond(cond_hi()); %BRANCH; return; case 0x23: set_cond(!cond_hi()); %BRANCH; return; @@ -271,7 +271,7 @@ MAIN: case 0xFD: set_regop16(m_q.p.d); %EXTENDED; %ST16; return; case 0xFE: set_regop16(m_u); %EXTENDED; %LD16; return; case 0xFF: set_regop16(m_u); %EXTENDED; %ST16; return; - default: %ILLEGAL; return; + default: %ILLEGAL; return; } return; @@ -279,7 +279,6 @@ DISPATCH10: @m_opcode = read_opcode(); switch(m_opcode) { - case 0x20: set_cond(true); %LBRANCH; return; case 0x21: set_cond(false); %LBRANCH; return; case 0x22: set_cond(cond_hi()); %LBRANCH; return; case 0x23: set_cond(!cond_hi()); %LBRANCH; return; @@ -410,7 +409,7 @@ DISPATCH10: case 0xFE: set_regop16(m_s); %EXTENDED; %LD16; return; case 0xFF: set_regop16(m_s); %EXTENDED; %ST16; return; - default: %ILLEGAL; return; + default: %ILLEGAL; return; } return; @@ -512,7 +511,7 @@ DISPATCH11: case 0xF7: set_regop8(m_q.r.f); %EXTENDED; %ST8; return; case 0xFB: set_regop8(m_q.r.f); %EXTENDED; %ADD8; return; - default: %ILLEGAL; return; + default: %ILLEGAL; return; } return; @@ -891,7 +890,7 @@ TFM: // operation that executed one transfer, and bumped the program // counter back. However, some documentation suggests that TFM // was abortable, so we now have a get_pending_interrupt() call - // here. + // here. // // Lastly, I have no information on the precise sub-instruction timing // here; the timings of the reads and writes are really just a guess. diff --git a/src/devices/cpu/nec/nec.cpp b/src/devices/cpu/nec/nec.cpp index e0363f54d40..09469dcad16 100644 --- a/src/devices/cpu/nec/nec.cpp +++ b/src/devices/cpu/nec/nec.cpp @@ -285,6 +285,7 @@ void nec_common_device::device_reset() memset( &m_regs.w, 0, sizeof(m_regs.w)); m_ip = 0; + m_prev_ip = 0; m_TF = 0; m_IF = 0; m_DF = 0; @@ -331,7 +332,7 @@ void nec_common_device::nec_interrupt(unsigned int_num, int/*INTSOURCES*/ source PUSH(Sreg(PS)); PUSH(m_ip); - m_ip = (WORD)dest_off; + m_prev_ip = m_ip = (WORD)dest_off; Sreg(PS) = (WORD)dest_seg; CHANGE_PC; } @@ -352,7 +353,7 @@ void nec_common_device::nec_brk(unsigned int_num) PUSH(Sreg(PS)); PUSH(m_ip); } - m_ip = read_mem_word(int_num*4); + m_prev_ip = m_ip = read_mem_word(int_num*4); Sreg(PS) = read_mem_word(int_num*4+2); CHANGE_PC; } @@ -464,6 +465,7 @@ void nec_common_device::device_start() m_E16 = 0; m_debugger_temp = 0; m_ip = 0; + m_prev_ip = 0; memset(m_regs.w, 0x00, sizeof(m_regs.w)); memset(m_sregs, 0x00, sizeof(m_sregs)); @@ -472,6 +474,7 @@ void nec_common_device::device_start() save_item(NAME(m_sregs)); save_item(NAME(m_ip)); + save_item(NAME(m_prev_ip)); save_item(NAME(m_TF)); save_item(NAME(m_IF)); save_item(NAME(m_DF)); @@ -511,21 +514,29 @@ void nec_common_device::device_start() m_io = &space(AS_IO); - state_add( NEC_PC, "PC", m_debugger_temp).callimport().callexport().formatstr("%05X"); - state_add( NEC_IP, "IP", m_ip).formatstr("%04X"); - state_add( NEC_SP, "SP", Wreg(SP)).formatstr("%04X"); - state_add( NEC_FLAGS, "F", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( NEC_AW, "AW", Wreg(AW)).formatstr("%04X"); - state_add( NEC_CW, "CW", Wreg(CW)).formatstr("%04X"); - state_add( NEC_DW, "DW", Wreg(DW)).formatstr("%04X"); - state_add( NEC_BW, "BW", Wreg(BW)).formatstr("%04X"); - state_add( NEC_BP, "BP", Wreg(BP)).formatstr("%04X"); - state_add( NEC_IX, "IX", Wreg(IX)).formatstr("%04X"); - state_add( NEC_IY, "IY", Wreg(IY)).formatstr("%04X"); - state_add( NEC_ES, "DS1", Sreg(DS1)).formatstr("%04X"); - state_add( NEC_CS, "PS", Sreg(PS)).formatstr("%04X"); - state_add( NEC_SS, "SS", Sreg(SS)).formatstr("%04X"); - state_add( NEC_DS, "DS0", Sreg(DS0)).formatstr("%04X"); + state_add( NEC_PC, "PC", m_ip).formatstr("%04X"); + state_add( NEC_PSW, "PSW", m_debugger_temp).callimport().callexport().formatstr("%04X"); + state_add( NEC_AW, "AW", Wreg(AW)).formatstr("%04X"); + state_add( NEC_CW, "CW", Wreg(CW)).formatstr("%04X"); + state_add( NEC_DW, "DW", Wreg(DW)).formatstr("%04X"); + state_add( NEC_BW, "BW", Wreg(BW)).formatstr("%04X"); + state_add( NEC_SP, "SP", Wreg(SP)).formatstr("%04X"); + state_add( NEC_BP, "BP", Wreg(BP)).formatstr("%04X"); + state_add( NEC_IX, "IX", Wreg(IX)).formatstr("%04X"); + state_add( NEC_IY, "IY", Wreg(IY)).formatstr("%04X"); + state_add( NEC_DS1, "DS1", Sreg(DS1)).formatstr("%04X"); + state_add( NEC_PS, "PS", Sreg(PS)).formatstr("%04X"); + state_add( NEC_SS, "SS", Sreg(SS)).formatstr("%04X"); + state_add( NEC_DS0, "DS0", Sreg(DS0)).formatstr("%04X"); + + state_add( NEC_AL, "AL", Breg(AL)).noshow(); + state_add( NEC_AH, "AH", Breg(AH)).noshow(); + state_add( NEC_CL, "CL", Breg(CL)).noshow(); + state_add( NEC_CH, "CH", Breg(CH)).noshow(); + state_add( NEC_DL, "DL", Breg(DL)).noshow(); + state_add( NEC_DH, "DH", Breg(DH)).noshow(); + state_add( NEC_BL, "BL", Breg(BL)).noshow(); + state_add( NEC_BH, "BH", Breg(BH)).noshow(); if (m_chip_type == V33_TYPE) state_add(NEC_XA, "XA", m_xa); @@ -570,7 +581,7 @@ void nec_common_device::state_import(const device_state_entry &entry) { switch (entry.index()) { - case NEC_PC: + case STATE_GENPC: if (m_debugger_temp - (Sreg(PS)<<4) < 0x10000) { m_ip = m_debugger_temp - (Sreg(PS)<<4); @@ -580,9 +591,10 @@ void nec_common_device::state_import(const device_state_entry &entry) Sreg(PS) = m_debugger_temp >> 4; m_ip = m_debugger_temp & 0x0000f; } + m_prev_ip = m_ip; break; - case NEC_FLAGS: + case NEC_PSW: ExpandFlags(m_debugger_temp); break; } @@ -594,16 +606,18 @@ void nec_common_device::state_export(const device_state_entry &entry) switch (entry.index()) { case STATE_GENPC: - case STATE_GENPCBASE: - case NEC_PC: m_debugger_temp = (Sreg(PS)<<4) + m_ip; break; + case STATE_GENPCBASE: + m_debugger_temp = (Sreg(PS)<<4) + m_prev_ip; + break; + case STATE_GENSP: m_debugger_temp = (Sreg(SS)<<4) + Wreg(SP); break; - case NEC_FLAGS: + case NEC_PSW: m_debugger_temp = CompressFlags(); break; } @@ -622,6 +636,8 @@ void nec_common_device::execute_run() } while(m_icount>0) { + m_prev_ip = m_ip; + /* Dispatch IRQ */ if (m_pending_irq && m_no_interrupt==0) { diff --git a/src/devices/cpu/nec/nec.h b/src/devices/cpu/nec/nec.h index 1e3a0dbc22f..7734c1dd40c 100644 --- a/src/devices/cpu/nec/nec.h +++ b/src/devices/cpu/nec/nec.h @@ -13,8 +13,10 @@ enum { NEC_PC=0, - NEC_IP, NEC_AW, NEC_CW, NEC_DW, NEC_BW, NEC_SP, NEC_BP, NEC_IX, NEC_IY, - NEC_FLAGS, NEC_ES, NEC_CS, NEC_SS, NEC_DS, + NEC_AW, NEC_CW, NEC_DW, NEC_BW, NEC_SP, NEC_BP, NEC_IX, NEC_IY, + NEC_DS1, NEC_PS, NEC_SS, NEC_DS0, + NEC_AL, NEC_AH, NEC_CL, NEC_CH, NEC_DL, NEC_DH, NEC_BL, NEC_BH, + NEC_PSW, NEC_XA, NEC_PENDING }; @@ -77,6 +79,7 @@ private: uint16_t m_sregs[4]; uint16_t m_ip; + uint16_t m_prev_ip; /* PSW flags */ int32_t m_SignVal; diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp index e5f18733719..9d57b0f2733 100644 --- a/src/devices/cpu/nec/v25.cpp +++ b/src/devices/cpu/nec/v25.cpp @@ -180,6 +180,7 @@ uint8_t v25_common_device::fetchop() void v25_common_device::device_reset() { m_ip = 0; + m_prev_ip = 0; m_IBRK = 1; m_F0 = 0; m_F1 = 0; @@ -270,7 +271,7 @@ void v25_common_device::nec_interrupt(unsigned int_num, int /*INTSOURCES*/ sourc PUSH(Sreg(PS)); PUSH(m_ip); - m_ip = (WORD)dest_off; + m_prev_ip = m_ip = (WORD)dest_off; Sreg(PS) = (WORD)dest_seg; CHANGE_PC; } @@ -286,7 +287,7 @@ void v25_common_device::nec_bankswitch(unsigned bank_num) Wreg(PSW_SAVE) = tmp; Wreg(PC_SAVE) = m_ip; - m_ip = Wreg(VECTOR_PC); + m_prev_ip = m_ip = Wreg(VECTOR_PC); CHANGE_PC; } @@ -565,6 +566,7 @@ void v25_common_device::device_start() save_item(NAME(m_intp_state)); save_item(NAME(m_ip)); + save_item(NAME(m_prev_ip)); save_item(NAME(m_IBRK)); save_item(NAME(m_F0)); save_item(NAME(m_F1)); @@ -637,23 +639,32 @@ void v25_common_device::device_start() m_p1_out.resolve_safe(); m_p2_out.resolve_safe(); - state_add( V25_PC, "PC", m_debugger_temp).callimport().callexport().formatstr("%05X"); - state_add( V25_IP, "IP", m_ip).formatstr("%04X"); - state_add( V25_SP, "SP", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_FLAGS, "F", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_AW, "AW", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_CW, "CW", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_DW, "DW", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_BW, "BW", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_BP, "BP", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_IX, "IX", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_IY, "IY", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_ES, "DS1", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_CS, "PS", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_SS, "SS", m_debugger_temp).callimport().callexport().formatstr("%04X"); - state_add( V25_DS, "DS0", m_debugger_temp).callimport().callexport().formatstr("%04X"); + state_add( V25_PC, "PC", m_ip).formatstr("%04X"); + state_add( V25_PSW, "PSW", [this]() { return CompressFlags(); }, [this](uint16_t data) { ExpandFlags(data); }); - state_add( V25_IDB, "IDB", m_IDB).mask(0xffe00).callimport(); + state_add( V25_AW, "AW", [this]() { return Wreg(AW); }, [this](uint16_t data) { Wreg(AW) = data; }); + state_add( V25_CW, "CW", [this]() { return Wreg(CW); }, [this](uint16_t data) { Wreg(CW) = data; }); + state_add( V25_DW, "DW", [this]() { return Wreg(DW); }, [this](uint16_t data) { Wreg(DW) = data; }); + state_add( V25_BW, "BW", [this]() { return Wreg(BW); }, [this](uint16_t data) { Wreg(BW) = data; }); + state_add( V25_SP, "SP", [this]() { return Wreg(SP); }, [this](uint16_t data) { Wreg(SP) = data; }); + state_add( V25_BP, "BP", [this]() { return Wreg(BP); }, [this](uint16_t data) { Wreg(BP) = data; }); + state_add( V25_IX, "IX", [this]() { return Wreg(IX); }, [this](uint16_t data) { Wreg(IX) = data; }); + state_add( V25_IY, "IY", [this]() { return Wreg(IY); }, [this](uint16_t data) { Wreg(IY) = data; }); + state_add( V25_DS1, "DS1", [this]() { return Sreg(DS1); }, [this](uint16_t data) { Sreg(DS1) = data; }); + state_add( V25_PS, "PS", [this]() { return Sreg(PS); }, [this](uint16_t data) { Sreg(PS) = data; }); + state_add( V25_SS, "SS", [this]() { return Sreg(SS); }, [this](uint16_t data) { Sreg(SS) = data; }); + state_add( V25_DS0, "DS0", [this]() { return Sreg(DS0); }, [this](uint16_t data) { Sreg(DS0) = data; }); + + state_add( V25_AL, "AL", [this]() { return Breg(AL); }, [this](uint8_t data) { Breg(AL) = data; }).noshow(); + state_add( V25_AH, "AH", [this]() { return Breg(AH); }, [this](uint8_t data) { Breg(AH) = data; }).noshow(); + state_add( V25_CL, "CL", [this]() { return Breg(CL); }, [this](uint8_t data) { Breg(CL) = data; }).noshow(); + state_add( V25_CH, "CH", [this]() { return Breg(CH); }, [this](uint8_t data) { Breg(CH) = data; }).noshow(); + state_add( V25_DL, "DL", [this]() { return Breg(DL); }, [this](uint8_t data) { Breg(DL) = data; }).noshow(); + state_add( V25_DH, "DH", [this]() { return Breg(DH); }, [this](uint8_t data) { Breg(DH) = data; }).noshow(); + state_add( V25_BL, "BL", [this]() { return Breg(BL); }, [this](uint8_t data) { Breg(BL) = data; }).noshow(); + state_add( V25_BH, "BH", [this]() { return Breg(BH); }, [this](uint8_t data) { Breg(BH) = data; }).noshow(); + + state_add( V25_IDB, "IDB", m_IDB).mask(0xffe00).callimport(); state_add( STATE_GENPC, "GENPC", m_debugger_temp).callexport().noshow(); state_add( STATE_GENPCBASE, "CURPC", m_debugger_temp).callexport().noshow(); @@ -694,7 +705,7 @@ void v25_common_device::state_import(const device_state_entry &entry) { switch (entry.index()) { - case V25_PC: + case STATE_GENPC: if( m_debugger_temp - (Sreg(PS)<<4) < 0x10000 ) { m_ip = m_debugger_temp - (Sreg(PS)<<4); @@ -704,58 +715,7 @@ void v25_common_device::state_import(const device_state_entry &entry) Sreg(PS) = m_debugger_temp >> 4; m_ip = m_debugger_temp & 0x0000f; } - break; - - case V25_SP: - Wreg(SP) = m_debugger_temp; - break; - - case V25_FLAGS: - ExpandFlags(m_debugger_temp); - break; - - case V25_AW: - Wreg(AW) = m_debugger_temp; - break; - - case V25_CW: - Wreg(CW) = m_debugger_temp; - break; - - case V25_DW: - Wreg(DW) = m_debugger_temp; - break; - - case V25_BW: - Wreg(BW) = m_debugger_temp; - break; - - case V25_BP: - Wreg(BP) = m_debugger_temp; - break; - - case V25_IX: - Wreg(IX) = m_debugger_temp; - break; - - case V25_IY: - Wreg(IY) = m_debugger_temp; - break; - - case V25_ES: - Sreg(DS1) = m_debugger_temp; - break; - - case V25_CS: - Sreg(PS) = m_debugger_temp; - break; - - case V25_SS: - Sreg(SS) = m_debugger_temp; - break; - - case V25_DS: - Sreg(DS0) = m_debugger_temp; + m_prev_ip = m_ip; break; case V25_IDB: @@ -770,66 +730,16 @@ void v25_common_device::state_export(const device_state_entry &entry) switch (entry.index()) { case STATE_GENPC: - case STATE_GENPCBASE: - case V25_PC: m_debugger_temp = (Sreg(PS)<<4) + m_ip; break; + case STATE_GENPCBASE: + m_debugger_temp = (Sreg(PS)<<4) + m_prev_ip; + break; + case STATE_GENSP: m_debugger_temp = (Sreg(SS)<<4) + Wreg(SP); break; - - case V25_SP: - m_debugger_temp = Wreg(SP); - break; - - case V25_FLAGS: - m_debugger_temp = CompressFlags(); - break; - - case V25_AW: - m_debugger_temp = Wreg(AW); - break; - - case V25_CW: - m_debugger_temp = Wreg(CW); - break; - - case V25_DW: - m_debugger_temp = Wreg(DW); - break; - - case V25_BW: - m_debugger_temp = Wreg(BW); - break; - - case V25_BP: - m_debugger_temp = Wreg(BP); - break; - - case V25_IX: - m_debugger_temp = Wreg(IX); - break; - - case V25_IY: - m_debugger_temp = Wreg(IY); - break; - - case V25_ES: - m_debugger_temp = Sreg(DS1); - break; - - case V25_CS: - m_debugger_temp = Sreg(PS); - break; - - case V25_SS: - m_debugger_temp = Sreg(SS); - break; - - case V25_DS: - m_debugger_temp = Sreg(DS0); - break; } } @@ -875,6 +785,7 @@ void v25_common_device::execute_run() while(m_icount>0) { /* Dispatch IRQ */ + m_prev_ip = m_ip; if (m_no_interrupt==0 && (m_pending_irq & m_unmasked_irq)) { if (m_pending_irq & NMI_IRQ) diff --git a/src/devices/cpu/nec/v25.h b/src/devices/cpu/nec/v25.h index 6669006886d..8d37752c85d 100644 --- a/src/devices/cpu/nec/v25.h +++ b/src/devices/cpu/nec/v25.h @@ -16,8 +16,10 @@ enum { V25_PC=0, - V25_IP, V25_AW, V25_CW, V25_DW, V25_BW, V25_SP, V25_BP, V25_IX, V25_IY, - V25_FLAGS, V25_ES, V25_CS, V25_SS, V25_DS, + V25_AW, V25_CW, V25_DW, V25_BW, V25_SP, V25_BP, V25_IX, V25_IY, + V25_DS1, V25_PS, V25_SS, V25_DS0, + V25_AL, V25_AH, V25_CL, V25_CH, V25_DL, V25_DH, V25_BL, V25_BH, + V25_PSW, V25_IDB, V25_PENDING }; @@ -80,6 +82,7 @@ private: required_shared_ptr m_internal_ram; uint16_t m_ip; + uint16_t m_prev_ip; /* PSW flags */ int32_t m_SignVal; diff --git a/src/devices/machine/6522via.cpp b/src/devices/machine/6522via.cpp index 3a9f6b10378..a0b66c138d8 100644 --- a/src/devices/machine/6522via.cpp +++ b/src/devices/machine/6522via.cpp @@ -19,7 +19,7 @@ 2017-Feb-15 Edstrom Fixed shift registers to be more accurate, eg 50/50 duty cycle, latching - on correct flanks and leading and trailing flanks added + logging. + on correct edges and leading and trailing edges added + logging. */ #include "emu.h" @@ -386,7 +386,7 @@ void via6522_device::clear_int(int data) void via6522_device::shift_out() { - // Only shift out msb on falling flank + // Only shift out msb on falling edge if (m_shift_counter & 1) { LOGSHIFT(" %s shift Out SR: %02x->", tag(), m_sr); @@ -399,26 +399,26 @@ void via6522_device::shift_out() if (m_shift_counter == 1 && SO_EXT_CONTROL(m_acr)) { LOGINT("SHIFT EXT out INT request "); - set_int(INT_SR); // IRQ on last falling flank for external clock (mode 7) + set_int(INT_SR); // IRQ on last falling edge for external clock (mode 7) } } - else // Check for INT condition, eg the last and raising flank of the 15-0 falling/raising flanks + else // Check for INT condition, eg the last and raising edge of the 15-0 falling/raising edges { if (!SO_T2_RATE(m_acr)) // The T2 continous shifter doesn't do interrupts (mode 4) { if (m_shift_counter == 0 && (SO_O2_CONTROL(m_acr) || SO_T2_CONTROL(m_acr))) { LOGINT("SHIFT O2/T2 out INT request "); - set_int(INT_SR); // IRQ on last raising flank for internal clock (mode 5-6) + set_int(INT_SR); // IRQ on last raising edge for internal clock (mode 5-6) } } } - m_shift_counter = (m_shift_counter - 1) & 0x0f; // Count all flanks + m_shift_counter = (m_shift_counter - 1) & 0x0f; // Count all edges } void via6522_device::shift_in() { - // Only shift in data on raising flank + // Only shift in data on raising edge if ( !(m_shift_counter & 1) ) { LOGSHIFT("%s shift In SR: %02x->", tag(), m_sr); @@ -429,10 +429,10 @@ void via6522_device::shift_in() { LOGINT("SHIFT in INT request "); // set_int(INT_SR);// TODO: this interrupt is 1-2 clock cycles too early - m_shift_irq_timer->adjust(clocks_to_attotime(2)/2); // Delay IRQ 2 flanks for all shift INs (mode 1-3) + m_shift_irq_timer->adjust(clocks_to_attotime(2)/2); // Delay IRQ 2 edges for all shift INs (mode 1-3) } } - m_shift_counter = (m_shift_counter - 1) & 0x0f; // Count all flanks + m_shift_counter = (m_shift_counter - 1) & 0x0f; // Count all edges } void via6522_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) @@ -440,7 +440,7 @@ void via6522_device::device_timer(emu_timer &timer, device_timer_id id, int para switch (id) { case TIMER_SHIFT_IRQ: // This timer event is a delayed IRQ for improved cycle accuracy - set_int(INT_SR); // triggered from shift_in or shift_out on the last rising flank + set_int(INT_SR); // triggered from shift_in or shift_out on the last rising edge m_shift_irq_timer->adjust(attotime::never); // Not needed really... break; case TIMER_SHIFT: @@ -448,7 +448,7 @@ void via6522_device::device_timer(emu_timer &timer, device_timer_id id, int para m_out_cb1 ^= 1; m_cb1_handler(m_out_cb1); - // we call shift methods for all flanks + // we call shift methods for all edges if (SO_T2_RATE(m_acr) || SO_T2_CONTROL(m_acr) || SO_O2_CONTROL(m_acr)) { shift_out(); @@ -459,7 +459,7 @@ void via6522_device::device_timer(emu_timer &timer, device_timer_id id, int para } // If in continous mode or the shifter is still shifting we re-arm the timer - if (SO_T2_RATE(m_acr) || (m_shift_counter != 0x0f)) + if (SO_T2_RATE(m_acr) || (m_shift_counter < 0x0f)) { if (SI_O2_CONTROL(m_acr) || SO_O2_CONTROL(m_acr)) { @@ -703,15 +703,20 @@ u8 via6522_device::read(offs_t offset) val = m_sr; if (!machine().side_effects_disabled()) { - m_out_cb1 = 1; - m_cb1_handler(m_out_cb1); - m_shift_counter = 0x0f; + if (!(SI_EXT_CONTROL(m_acr) || SO_EXT_CONTROL(m_acr))) { + m_out_cb1 = 1; + m_cb1_handler(m_out_cb1); + m_shift_counter = 0x0f; + } + else + m_shift_counter = m_in_cb1 ? 0x0f : 0x10; + LOGINT("SR INT "); clear_int(INT_SR); LOGSHIFT(" - ACR: %02x ", m_acr); if (SI_O2_CONTROL(m_acr) || SO_O2_CONTROL(m_acr)) { - m_shift_timer->adjust(clocks_to_attotime(8) / 2); // 8 flanks to start shifter from a read + m_shift_timer->adjust(clocks_to_attotime(8) / 2); // 8 edges to start shifter from a read LOGSHIFT(" - read SR starts O2 timer "); } else if (SI_T2_CONTROL(m_acr) || SO_T2_CONTROL(m_acr)) @@ -889,21 +894,20 @@ void via6522_device::write(offs_t offset, u8 data) m_sr = data; LOGSHIFT("Write SR: %02x\n", m_sr); - // make sure CB1 is high - this should not be needed though - if (m_out_cb1 != 1) - { - logerror("VIA: CB1 is low starting shifter\n"); + if (!(SI_EXT_CONTROL(m_acr) || SO_EXT_CONTROL(m_acr))) { m_out_cb1 = 1; m_cb1_handler(m_out_cb1); + m_shift_counter = 0x0f; } + else + m_shift_counter = m_in_cb1 ? 0x0f : 0x10; - m_shift_counter = 0x0f; LOGINT("SR INT "); clear_int(INT_SR); LOGSHIFT(" - ACR is: %02x ", m_acr); if (SO_O2_CONTROL(m_acr) || SI_O2_CONTROL(m_acr)) { - m_shift_timer->adjust(clocks_to_attotime(8) / 2); // 8 flanks to start shifter from a write + m_shift_timer->adjust(clocks_to_attotime(8) / 2); // 8 edges to start shifter from a write LOGSHIFT(" - write SR starts O2 timer"); } else if (SO_T2_RATE(m_acr) || SO_T2_CONTROL(m_acr) || SI_T2_CONTROL(m_acr)) @@ -966,6 +970,13 @@ void via6522_device::write(offs_t offset, u8 data) m_t1->adjust(clocks_to_attotime(counter1 + IFR_DELAY)); m_t1_active = 1; } + + if (SI_T2_CONTROL(m_acr) || SI_O2_CONTROL(m_acr) || SI_EXT_CONTROL(m_acr)) + { + m_out_cb2 = 1; + m_cb2_handler(m_out_cb2); + } + LOGSHIFT("\n"); } break; diff --git a/src/devices/machine/i2cmem.cpp b/src/devices/machine/i2cmem.cpp index 140e60dc145..94c08716f97 100644 --- a/src/devices/machine/i2cmem.cpp +++ b/src/devices/machine/i2cmem.cpp @@ -4,8 +4,7 @@ I2C Memory -Generic ram/rom/eeprom/flash on an i2c bus. Supports specifying the slave address, -the data size & the page size for writing. +ram/rom/eeprom/flash on an i2c bus. inputs: e0,e1,e2 lower 3 bits of the slave address @@ -16,9 +15,11 @@ inputs: outputs: sda serial data -The memory address is only 8 bits, devices larger than this have multiple slave addresses. -The top five address bits are set at manufacture time, two values are standard. +The memory address is only 8 bits for devices up to 2048 bytes, +devices from 512 to 2048 bytes occupy multiple slave addresses. +The top five address bits are set at manufacture time, +there are two standard values. ***************************************************************************/ #include "emu.h" @@ -59,15 +60,16 @@ static inline void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level //************************************************************************** // device type definition -DEFINE_DEVICE_TYPE(I2CMEM, i2cmem_device, "i2cmem", "I2C Memory") -DEFINE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device, "x2404p", "X2404P I2C Memory") DEFINE_DEVICE_TYPE(I2C_24C01, i2c_24c01_device, "24c01", "24C01 I2C Memory") +DEFINE_DEVICE_TYPE(I2C_PCD8572, i2c_pcd8572_device, "pcd8572", "PCD8572 I2C Memory") DEFINE_DEVICE_TYPE(I2C_24C02, i2c_24c02_device, "24c02", "24C02 I2C Memory") +DEFINE_DEVICE_TYPE(I2C_M24C02, i2c_m24c02_device, "m24c02", "M24C02 I2C Memory") DEFINE_DEVICE_TYPE(I2C_24C04, i2c_24c04_device, "24c04", "24C04 I2C Memory") +DEFINE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device, "x2404p", "X2404P I2C Memory") DEFINE_DEVICE_TYPE(I2C_24C08, i2c_24c08_device, "24c08", "24C08 I2C Memory") DEFINE_DEVICE_TYPE(I2C_24C16, i2c_24c16_device, "24c16", "24C16 I2C Memory") -DEFINE_DEVICE_TYPE(I2C_24C16A, i2c_24c16a_device, "24c16a", "24C16A I2C Memory") DEFINE_DEVICE_TYPE(I2C_24C64, i2c_24c64_device, "24c64", "24C64 I2C Memory") +DEFINE_DEVICE_TYPE(I2C_24C512, i2c_24c512_device, "24c512", "24C512 I2C Memory") //************************************************************************** // LIVE DEVICE @@ -83,13 +85,15 @@ i2cmem_device::i2cmem_device( const char *tag, device_t *owner, uint32_t clock, - int page_size, + int read_page_size, + int write_page_size, int data_size) : device_t(mconfig, type, tag, owner, clock), device_nvram_interface(mconfig, *this), m_region(*this, DEVICE_SELF), m_slave_address(I2CMEM_SLAVE_ADDRESS), - m_page_size(page_size), + m_read_page_size(read_page_size), + m_write_page_size(write_page_size), m_data_size(data_size), m_scl(0), m_sdaw(0), @@ -110,48 +114,53 @@ i2cmem_device::i2cmem_device( assert(!clock); } -i2cmem_device::i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2CMEM, tag, owner, clock, 0, 0) -{ -} - -i2c_x2404p_device::i2c_x2404p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_X2404P, tag, owner, clock, 8, 0x200) -{ -} - i2c_24c01_device::i2c_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_24C01, tag, owner, clock, 4, 0x80) + i2cmem_device(mconfig, I2C_24C01, tag, owner, clock, 0, 8, 0x80) +{ +} + +i2c_pcd8572_device::i2c_pcd8572_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : + i2cmem_device(mconfig, I2C_PCD8572, tag, owner, clock, 0, 0, 0x80) { } i2c_24c02_device::i2c_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_24C02, tag, owner, clock, 4, 0x100) + i2cmem_device(mconfig, I2C_24C02, tag, owner, clock, 0, 8, 0x100) +{ +} + +i2c_m24c02_device::i2c_m24c02_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : + i2cmem_device(mconfig, I2C_M24C02, tag, owner, clock, 0, 16, 0x100) { } i2c_24c04_device::i2c_24c04_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_24C04, tag, owner, clock, 8, 0x200) + i2cmem_device(mconfig, I2C_24C04, tag, owner, clock, 0, 16, 0x200) +{ +} + +i2c_x2404p_device::i2c_x2404p_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : + i2cmem_device(mconfig, I2C_X2404P, tag, owner, clock, 0x100, 8, 0x200) { } i2c_24c08_device::i2c_24c08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_24C08, tag, owner, clock, 0, 0x400) + i2cmem_device(mconfig, I2C_24C08, tag, owner, clock, 0, 16, 0x400) { } i2c_24c16_device::i2c_24c16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_24C16, tag, owner, clock, 8, 0x800) -{ -} - -i2c_24c16a_device::i2c_24c16a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_24C16A, tag, owner, clock, 0, 0x800) + i2cmem_device(mconfig, I2C_24C16, tag, owner, clock, 0, 16, 0x800) { } i2c_24c64_device::i2c_24c64_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - i2cmem_device(mconfig, I2C_24C64, tag, owner, clock, 8, 0x2000) + i2cmem_device(mconfig, I2C_24C64, tag, owner, clock, 0, 32, 0x2000) +{ +} + +i2c_24c512_device::i2c_24c512_device(const machine_config& mconfig, const char* tag, device_t* owner, uint32_t clock) : + i2cmem_device(mconfig, I2C_24C512, tag, owner, clock, 0, 128, 0x10000) { } @@ -162,7 +171,7 @@ i2c_24c64_device::i2c_24c64_device(const machine_config &mconfig, const char *ta void i2cmem_device::device_start() { m_data = std::make_unique(m_data_size); - m_page.resize( m_page_size ); + m_page.resize( m_write_page_size ); save_item( NAME(m_scl) ); save_item( NAME(m_sdaw) ); @@ -181,7 +190,7 @@ void i2cmem_device::device_start() save_item( NAME(m_page_offset) ); save_item( NAME(m_page_written_size) ); save_pointer( &m_data[0], "m_data", m_data_size ); - if ( m_page_size > 0 ) + if ( m_write_page_size > 0 ) { save_item( NAME(m_page) ); } @@ -286,13 +295,15 @@ WRITE_LINE_MEMBER( i2cmem_device::write_sda ) { if( m_sdaw ) { - if( m_state == STATE_DATAIN && m_page_size > 0 ) + if( m_page_written_size > 0 ) { int base = data_offset(); - int root = base & ~( m_page_size - 1); - for( int i=0; i < m_page_written_size; i++) - m_data[root | ((base + i) & (m_page_size - 1))] = m_page[i]; - verboselog( this, 1, "data[ %04x to %04x ] = %x bytes\n", base, root | ((base + m_page_written_size - 1) & (m_page_size - 1)), m_page_written_size ); + int root = base & ~( m_write_page_size - 1 ); + for( int i = 0; i < m_page_written_size; i++ ) + m_data[root | ((base + i) & (m_write_page_size - 1))] = m_page[i]; + verboselog( this, 1, "data[ %04x to %04x ] = %x bytes\n", base, root | ((base + m_page_written_size - 1) & (m_write_page_size - 1)), m_page_written_size ); + + m_page_written_size = 0; } verboselog( this, 1, "stop\n" ); m_state = STATE_IDLE; @@ -373,7 +384,7 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) break; case STATE_ADDRESSLOW: - m_byteaddr = m_shift | (skip_addresshigh() ? (m_devsel & DEVSEL_ADDRESS) << 7 : m_addresshigh << 8); + m_byteaddr = m_shift | (skip_addresshigh() ? ((m_devsel & DEVSEL_ADDRESS) << 7) & address_mask() : m_addresshigh << 8); m_page_offset = 0; m_page_written_size = 0; @@ -388,17 +399,17 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) verboselog( this, 0, "write not enabled\n" ); m_state = STATE_IDLE; } - else if( m_page_size > 0 ) + else if( m_write_page_size > 0 ) { m_page[ m_page_offset ] = m_shift; verboselog( this, 1, "page[ %04x ] <- %02x\n", m_page_offset, m_page[ m_page_offset ] ); m_page_offset++; - if( m_page_offset == m_page_size ) + if( m_page_offset == m_write_page_size ) m_page_offset = 0; m_page_written_size++; - if( m_page_written_size > m_page_size) - m_page_written_size = m_page_size; + if( m_page_written_size > m_write_page_size) + m_page_written_size = m_write_page_size; } else { @@ -440,7 +451,7 @@ WRITE_LINE_MEMBER( i2cmem_device::write_scl ) m_shift = m_data[offset]; verboselog( this, 1, "data[ %04x ] -> %02x\n", offset, m_shift ); - m_byteaddr++; + m_byteaddr = (m_byteaddr & ~(m_read_page_size - 1)) | ((m_byteaddr + 1) & (m_read_page_size - 1)); } m_sdar = ( m_shift >> 7 ) & 1; diff --git a/src/devices/machine/i2cmem.h b/src/devices/machine/i2cmem.h index 5e67fda009a..3a7916a838a 100644 --- a/src/devices/machine/i2cmem.h +++ b/src/devices/machine/i2cmem.h @@ -33,12 +33,7 @@ class i2cmem_device : public device_nvram_interface { public: - // construction/destruction - i2cmem_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - i2cmem_device & set_address(int address) { m_slave_address = address; return *this; } - i2cmem_device & set_page_size(int page_size) { m_page_size = page_size; return *this; } - i2cmem_device & set_data_size(int data_size) { m_data_size = data_size; return *this; } i2cmem_device & set_e0(int e0) { m_e0 = e0; return *this; } i2cmem_device & set_e1(int e1) { m_e1 = e1; return *this; } i2cmem_device & set_e2(int e2) { m_e2 = e2; return *this; } @@ -55,7 +50,7 @@ public: protected: // construction/destruction - i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int page_size, int data_size); + i2cmem_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int read_page_size, int write_page_size, int data_size); // device-level overrides virtual void device_start() override; @@ -76,7 +71,8 @@ protected: // internal state std::unique_ptr m_data; int m_slave_address; - int m_page_size; + int m_read_page_size; + int m_write_page_size; int m_data_size; int m_scl; int m_sdaw; @@ -103,24 +99,27 @@ protected: i2c_##name##_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); \ }; -DECLARE_I2C_DEVICE(x2404p) -DECLARE_I2C_DEVICE(24c01) -DECLARE_I2C_DEVICE(24c02) -DECLARE_I2C_DEVICE(24c04) -DECLARE_I2C_DEVICE(24c08) +DECLARE_I2C_DEVICE(24c01); +DECLARE_I2C_DEVICE(pcd8572); +DECLARE_I2C_DEVICE(24c02); +DECLARE_I2C_DEVICE(m24c02); +DECLARE_I2C_DEVICE(24c04); +DECLARE_I2C_DEVICE(x2404p); +DECLARE_I2C_DEVICE(24c08); DECLARE_I2C_DEVICE(24c16); -DECLARE_I2C_DEVICE(24c16a); DECLARE_I2C_DEVICE(24c64); +DECLARE_I2C_DEVICE(24c512); // device type definition -DECLARE_DEVICE_TYPE(I2CMEM, i2cmem_device) -DECLARE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device) DECLARE_DEVICE_TYPE(I2C_24C01, i2c_24c01_device) +DECLARE_DEVICE_TYPE(I2C_PCD8572, i2c_pcd8572_device) DECLARE_DEVICE_TYPE(I2C_24C02, i2c_24c02_device) +DECLARE_DEVICE_TYPE(I2C_M24C02, i2c_m24c02_device) DECLARE_DEVICE_TYPE(I2C_24C04, i2c_24c04_device) +DECLARE_DEVICE_TYPE(I2C_X2404P, i2c_x2404p_device) DECLARE_DEVICE_TYPE(I2C_24C08, i2c_24c08_device) DECLARE_DEVICE_TYPE(I2C_24C16, i2c_24c16_device) -DECLARE_DEVICE_TYPE(I2C_24C16A, i2c_24c16a_device) DECLARE_DEVICE_TYPE(I2C_24C64, i2c_24c64_device) +DECLARE_DEVICE_TYPE(I2C_24C512, i2c_24c512_device) #endif // MAME_MACHINE_I2CMEM_H diff --git a/src/devices/machine/i82357.cpp b/src/devices/machine/i82357.cpp index 7fa9a62d556..80319a8a52a 100644 --- a/src/devices/machine/i82357.cpp +++ b/src/devices/machine/i82357.cpp @@ -46,12 +46,12 @@ void i82357_device::device_add_mconfig(machine_config &config) PIC8259(config, m_pic[0], 0); m_pic[0]->in_sp_callback().set_constant(1); m_pic[0]->read_slave_ack_callback().set( - [this](offs_t offset) + [this](offs_t offset) -> u8 { if (offset == 2) return m_pic[1]->acknowledge(); - return u32(0); + return 0; }); PIC8259(config, m_pic[1], 0); diff --git a/src/devices/machine/keyboard.cpp b/src/devices/machine/keyboard.cpp index 182751b46cc..6f7c7fb125f 100644 --- a/src/devices/machine/keyboard.cpp +++ b/src/devices/machine/keyboard.cpp @@ -158,7 +158,7 @@ INPUT_PORTS_START( generic_keyboard ) PORT_BIT( 0x0100U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x01) PORT_CHAR('8') PORT_CHAR('(') PORT_BIT( 0x0200U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x00) PORT_CHAR('9') PORT_CHAR('(') PORT_BIT( 0x0200U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x01) PORT_CHAR('9') PORT_CHAR(')') - PORT_BIT( 0x0400U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x00) PORT_CHAR('0') PORT_CHAR('(') + PORT_BIT( 0x0400U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x00) PORT_CHAR('0') PORT_CHAR(')') PORT_BIT( 0x0400U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x01) PORT_CHAR('0') PORT_BIT( 0x0800U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x00) PORT_CHAR('-') PORT_CHAR('_') PORT_BIT( 0x0800U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CONDITION("GENKBD_CFG", 0x01, EQUALS, 0x01) PORT_CHAR('-') PORT_CHAR('=') diff --git a/src/devices/machine/ncr5380n.cpp b/src/devices/machine/ncr5380n.cpp index bd7d2ee89ac..a0158c5fee3 100644 --- a/src/devices/machine/ncr5380n.cpp +++ b/src/devices/machine/ncr5380n.cpp @@ -1,437 +1,335 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Olivier Galibert -/********************************************************************* +// copyright-holders:Patrick Mackinlay - ncr5380n.c - - Implementation of the NCR 5380, aka the Zilog Z5380 & AMD Am5380 - - TODO: - - IRQs - - Target mode - - NMOS/CMOS functional differences - - Timings should not be clock-based (5380 has no clock input) - - 40801766 - IIx ROM waiting point for "next read fails" - -*********************************************************************/ +/* + * NCR 5380 and 53C80, aka Zilog Z5380, AMD Am5380, Sony CXD1180 and others. + * + * Sources: + * - http://bitsavers.org/components/ncr/scsi/SP-1051_NCR_5380-53C80_SCSI_Interface_Chip_Design_Manual_Mar86.pdf + * + * TODO: + * - target mode + * - cxd1180 enhancements + */ #include "emu.h" #include "ncr5380n.h" +#define LOG_GENERAL (1U << 0) +#define LOG_REGW (1U << 1) +#define LOG_REGR (1U << 2) +#define LOG_SCSI (1U << 3) +#define LOG_ARB (1U << 4) +#define LOG_DMA (1U << 5) + +//#define VERBOSE (LOG_GENERAL|LOG_REGW|LOG_REGR|LOG_SCSI|LOG_ARB|LOG_DMA) +#include "logmacro.h" + DEFINE_DEVICE_TYPE(NCR5380N, ncr5380n_device, "ncr5380_new", "NCR 5380 SCSI (new)") -DEFINE_DEVICE_TYPE(NCR53C80, ncr53c80_device, "ncr53c80", "NCR 53C80 SCSI") +DEFINE_DEVICE_TYPE(NCR53C80, ncr53c80_device, "ncr53c80", "NCR 53C80 SCSI") +DEFINE_DEVICE_TYPE(CXD1180, cxd1180_device, "cxd1180", "Sony CXD1180") -void ncr5380n_device::map(address_map &map) -{ - map(0x0, 0x0).rw(FUNC(ncr5380n_device::scsidata_r), FUNC(ncr5380n_device::outdata_w)); - map(0x1, 0x1).rw(FUNC(ncr5380n_device::icmd_r), FUNC(ncr5380n_device::icmd_w)); - map(0x2, 0x2).rw(FUNC(ncr5380n_device::mode_r), FUNC(ncr5380n_device::mode_w)); - map(0x3, 0x3).rw(FUNC(ncr5380n_device::command_r), FUNC(ncr5380n_device::command_w)); - map(0x4, 0x4).rw(FUNC(ncr5380n_device::status_r), FUNC(ncr5380n_device::selenable_w)); - map(0x5, 0x5).rw(FUNC(ncr5380n_device::busandstatus_r), FUNC(ncr5380n_device::startdmasend_w)); - map(0x6, 0x6).rw(FUNC(ncr5380n_device::indata_r), FUNC(ncr5380n_device::startdmatargetrx_w)); - map(0x7, 0x7).rw(FUNC(ncr5380n_device::resetparityirq_r), FUNC(ncr5380n_device::startdmainitrx_w)); -} +ALLOW_SAVE_TYPE(ncr5380n_device::state); -ncr5380n_device::ncr5380n_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +ncr5380n_device::ncr5380n_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, bool has_lbs) : nscsi_device(mconfig, type, tag, owner, clock) , nscsi_slot_card_interface(mconfig, *this, DEVICE_SELF) - , m_fake_clock(10000000) - , tm(nullptr), status(0), istatus(0), m_mode(0) - , m_outdata(0), m_busstatus(0), m_dmalatch(0), m_icommand(0), m_tcommand(0), clock_conv(0), sync_offset(0), sync_period(0), bus_id(0), select_timeout(0) - , seq(0), tcount(0), mode(0), state(0), irq(false), drq(false) , m_irq_handler(*this) , m_drq_handler(*this) + , m_has_lbs(has_lbs) { } -ncr5380n_device::ncr5380n_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +ncr5380n_device::ncr5380n_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : ncr5380n_device(mconfig, NCR5380N, tag, owner, clock) { } -ncr53c80_device::ncr53c80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : ncr5380n_device(mconfig, NCR53C80, tag, owner, clock) +ncr53c80_device::ncr53c80_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : ncr5380n_device(mconfig, NCR53C80, tag, owner, clock, true) { } +cxd1180_device::cxd1180_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) + : ncr5380n_device(mconfig, CXD1180, tag, owner, clock, true) +{ +} + +void ncr5380n_device::map(address_map &map) +{ + map(0x0, 0x0).rw(FUNC(ncr5380n_device::csdata_r), FUNC(ncr5380n_device::odata_w)); + map(0x1, 0x1).rw(FUNC(ncr5380n_device::icmd_r), FUNC(ncr5380n_device::icmd_w)); + map(0x2, 0x2).rw(FUNC(ncr5380n_device::mode_r), FUNC(ncr5380n_device::mode_w)); + map(0x3, 0x3).rw(FUNC(ncr5380n_device::tcmd_r), FUNC(ncr5380n_device::tcmd_w)); + map(0x4, 0x4).rw(FUNC(ncr5380n_device::csstat_r), FUNC(ncr5380n_device::selen_w)); + map(0x5, 0x5).rw(FUNC(ncr5380n_device::bas_r), FUNC(ncr5380n_device::sds_w)); + map(0x6, 0x6).rw(FUNC(ncr5380n_device::idata_r), FUNC(ncr5380n_device::sdtr_w)); + map(0x7, 0x7).rw(FUNC(ncr5380n_device::rpi_r), FUNC(ncr5380n_device::sdir_w)); +} + void ncr5380n_device::device_start() { - save_item(NAME(m_tcommand)); - save_item(NAME(m_icommand)); - save_item(NAME(status)); - save_item(NAME(istatus)); - save_item(NAME(m_busstatus)); - save_item(NAME(tcount)); - save_item(NAME(mode)); - save_item(NAME(irq)); - save_item(NAME(drq)); - save_item(NAME(clock_conv)); - save_item(NAME(m_dmalatch)); - m_irq_handler.resolve_safe(); m_drq_handler.resolve_safe(); - tcount = 0; - status = 0; - bus_id = 0; - select_timeout = 0; - tm = timer_alloc(0); + m_state_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(ncr5380n_device::state_timer), this)); + + save_item(NAME(m_state)); + + save_item(NAME(m_odata)); + save_item(NAME(m_icmd)); + save_item(NAME(m_mode)); + save_item(NAME(m_tcmd)); + save_item(NAME(m_bas)); + save_item(NAME(m_idata)); + + save_item(NAME(m_scsi_ctrl)); + save_item(NAME(m_irq_state)); + save_item(NAME(m_drq_state)); } void ncr5380n_device::device_reset() { - clock_conv = 2; - sync_period = 5; - sync_offset = 0; - seq = 0; - status = 0; - m_tcommand = 0; - m_icommand = 0; - istatus = 0; - m_busstatus = 0; - irq = false; - m_irq_handler(irq); - reset_soft(); -} + m_state = IDLE; -void ncr5380n_device::reset_soft() -{ - state = IDLE; - scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); // clear any signals we're driving + // clear registers + m_odata = 0; + m_icmd = 0; + m_mode = 0; + m_tcmd = 0; + m_bas = 0; + m_idata = 0; + + // clear scsi bus + scsi_bus->data_w(scsi_refid, 0); + scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); + + // monitor all control lines + m_scsi_ctrl = 0; scsi_bus->ctrl_wait(scsi_refid, S_ALL, S_ALL); - status = 0; - drq = false; - m_drq_handler(drq); - reset_disconnect(); -} -void ncr5380n_device::reset_disconnect() -{ - mode = MODE_D; + // clear output lines + set_irq(false); + set_drq(false); } -//static int last_phase = -1; - void ncr5380n_device::scsi_ctrl_changed() { - uint32_t ctrl = scsi_bus->ctrl_r(); + u32 const ctrl = scsi_bus->ctrl_r(); -// logerror("scsi_ctrl_changed: lines now %x\n", ctrl); - -/* if ((ctrl & (S_PHASE_MASK|S_SEL|S_BSY)) != last_phase) - { - logerror("phase now %d, REQ %x SEL %x BSY %x\n", ctrl & S_PHASE_MASK, ctrl & S_REQ, ctrl & S_SEL, ctrl & S_BSY); - last_phase = (S_PHASE_MASK|S_SEL|S_BSY); - }*/ - - // recalculate phase match - m_busstatus &= ~BAS_PHASEMATCH; - if ((ctrl & S_PHASE_MASK) == (m_tcommand & S_PHASE_MASK)) + if (VERBOSE & LOG_SCSI) { - m_busstatus |= BAS_PHASEMATCH; + static char const *const nscsi_phase[] = { "DATA OUT", "DATA IN", "COMMAND", "STATUS", "*", "*", "MESSAGE OUT", "MESSAGE IN" }; + + if (ctrl & S_RST) + LOGMASKED(LOG_SCSI, "scsi_ctrl_changed 0x%x BUS RESET\n", ctrl); + else if ((ctrl & S_BSY) && !(ctrl & S_SEL)) + LOGMASKED(LOG_SCSI, "scsi_ctrl_changed 0x%x phase %s%s%s\n", ctrl, nscsi_phase[ctrl & S_PHASE_MASK], + ctrl & S_REQ ? " REQ" : "", ctrl & S_ACK ? " ACK" : ""); + else if (ctrl & S_BSY) + LOGMASKED(LOG_SCSI, "scsi_ctrl_changed 0x%x arbitration/selection\n", ctrl); + else + LOGMASKED(LOG_SCSI, "scsi_ctrl_changed 0x%x BUS FREE\n", ctrl); } - if (m_mode & MODE_DMA) + m_bas &= ~BAS_BUSYERROR; + + if (ctrl & S_RST) { - // if BSY drops or the phase goes mismatch, that terminates the DMA - if ((!(ctrl & S_BSY)) || !(m_busstatus & BAS_PHASEMATCH)) - { -// logerror("BSY dropped or phase mismatch during DMA, ending DMA\n"); - m_mode &= ~MODE_DMA; - m_busstatus |= BAS_ENDOFDMA; - drq_clear(); - } + LOG("scsi reset received\n"); + device_reset(); + + set_irq(true); } + else if (!(m_mode & MODE_TARGET) && (m_scsi_ctrl & S_BSY) && !(ctrl & S_BSY)) + { + LOG("target disconnected\n"); + m_icmd &= (IC_RST | IC_AIP); - if(ctrl & S_RST) { - logerror("%s: scsi bus reset\n", tag()); - return; - } - - step(false); -} - -void ncr5380n_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - step(true); -} - -void ncr5380n_device::step(bool timeout) -{ - uint32_t ctrl = scsi_bus->ctrl_r(); - uint32_t data = scsi_bus->data_r(); - - if(0) - logerror("%s: state=%d.%d %s\n", - tag(), state & STATE_MASK, (state & SUB_MASK) >> SUB_SHIFT, - timeout ? "timeout" : "change"); - - if(mode == MODE_I && !(ctrl & S_BSY)) { - state = IDLE; - reset_disconnect(); - check_irq(); - } - switch(state & SUB_MASK ? state & SUB_MASK : state & STATE_MASK) { - case IDLE: - break; - - case ARB_COMPLETE << SUB_SHIFT: { - if(!timeout) - break; - - int win; - for(win=7; win>=0 && !(data & (1<data_w(scsi_refid, 0); - scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); - logerror("need to wait for bus free\n"); - } - - state &= STATE_MASK; - step(true); - break; - } - - case SEND_WAIT_SETTLE << SUB_SHIFT: - if(!timeout) - break; - - state = (state & STATE_MASK) | (SEND_WAIT_REQ_0 << SUB_SHIFT); - step(false); - break; - - case SEND_WAIT_REQ_0 << SUB_SHIFT: - if(ctrl & S_REQ) - break; - state = state & STATE_MASK; - scsi_bus->data_w(scsi_refid, 0); - scsi_bus->ctrl_w(scsi_refid, 0, S_ACK); - step(false); - - // byte's done, ask for another if the target hasn't said otherwise if (m_mode & MODE_DMA) { - drq_set(); + // stop dma + m_mode &= ~MODE_DMA; + m_bas &= ~BAS_ENDOFDMA; + + set_drq(false); } - break; - case RECV_WAIT_REQ_1 << SUB_SHIFT: - if(!(ctrl & S_REQ)) - break; + if (m_mode & MODE_BSYIRQ) + { + m_bas |= BAS_BUSYERROR; - state = (state & STATE_MASK) | (RECV_WAIT_SETTLE << SUB_SHIFT); - delay_cycles(sync_period); - break; + set_irq(true); + } - case RECV_WAIT_SETTLE << SUB_SHIFT: - if(!timeout) - break; + m_state = IDLE; + m_state_timer->enable(false); - m_dmalatch = scsi_bus->data_r(); - scsi_bus->ctrl_w(scsi_refid, S_ACK, S_ACK); - state = (state & STATE_MASK) | (RECV_WAIT_REQ_0 << SUB_SHIFT); - step(false); - break; - - case RECV_WAIT_REQ_0 << SUB_SHIFT: - if(ctrl & S_REQ) - break; - state = state & STATE_MASK; - step(false); - - drq_set(); // raise DRQ now that we've completed - break; - - default: - logerror("%s: step() unexpected state %d.%d\n", - tag(), - state & STATE_MASK, (state & SUB_MASK) >> SUB_SHIFT); - exit(0); + // clear scsi bus + scsi_bus->data_w(scsi_refid, 0); + scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); } -} - -void ncr5380n_device::send_byte() -{ - state = (state & STATE_MASK) | (SEND_WAIT_SETTLE << SUB_SHIFT); - scsi_bus->data_w(scsi_refid, m_dmalatch); - - scsi_bus->ctrl_w(scsi_refid, S_ACK, S_ACK); - scsi_bus->ctrl_wait(scsi_refid, S_REQ, S_REQ); - delay_cycles(sync_period); -} - -void ncr5380n_device::recv_byte() -{ - state = (state & STATE_MASK) | (RECV_WAIT_REQ_1 << SUB_SHIFT); - step(false); -} - -void ncr5380n_device::function_bus_complete() -{ - state = IDLE; -// istatus |= I_FUNCTION|I_BUS; - check_irq(); -} - -void ncr5380n_device::function_complete() -{ - state = IDLE; -// istatus |= I_FUNCTION; - check_irq(); -} - -void ncr5380n_device::bus_complete() -{ - state = IDLE; -// istatus |= I_BUS; - check_irq(); -} - -void ncr5380n_device::delay(int cycles) -{ - if(!clock_conv) - return; - cycles *= clock_conv; - tm->adjust(attotime::from_ticks(cycles, m_fake_clock)); -} - -void ncr5380n_device::delay_cycles(int cycles) -{ - tm->adjust(attotime::from_ticks(cycles, m_fake_clock)); -} - -uint8_t ncr5380n_device::scsidata_r() -{ - return scsi_bus->data_r(); -} - -void ncr5380n_device::outdata_w(uint8_t data) -{ - m_outdata = data; - - // are we driving the data bus? - if (m_icommand & IC_DBUS) + else if (!(m_scsi_ctrl & S_REQ) && (ctrl & S_REQ)) { - scsi_bus->data_w(scsi_refid, data); + // target asserted REQ + if (m_mode & MODE_DMA) + { + if ((ctrl & S_PHASE_MASK) == (m_tcmd & TC_PHASE)) + { + // transfer cycle + if (m_state != IDLE && !m_state_timer->enabled()) + m_state_timer->adjust(attotime::zero); + } + else + { + LOG("phase mismatch %d != %d\n", (ctrl & S_PHASE_MASK), (m_tcmd & TC_PHASE)); + m_state_timer->enable(false); + + set_irq(true); + } + } } + + m_scsi_ctrl = ctrl; } -uint8_t ncr5380n_device::icmd_r() +u8 ncr5380n_device::csdata_r() { - return m_icommand; + u8 const data = scsi_bus->data_r(); + LOGMASKED(LOG_REGR, "csdata_r 0x%02x (%s)\n", data, machine().describe_context()); + + return data; } -void ncr5380n_device::icmd_w(uint8_t data) +void ncr5380n_device::odata_w(u8 data) { - // asserting to drive the data bus? - if ((data & IC_DBUS) && !(m_icommand & IC_DBUS)) + LOGMASKED(LOG_REGW, "odata_w 0x%02x (%s)\n", data, machine().describe_context()); + + // drive scsi data + if (m_icmd & IC_DBUS) + scsi_data_w(data); + + m_odata = data; +} + +u8 ncr5380n_device::icmd_r() +{ + LOGMASKED(LOG_REGR, "icmd_r 0x%02x (%s)\n", m_icmd, machine().describe_context()); + + return m_icmd; +} + +void ncr5380n_device::icmd_w(u8 data) +{ + LOGMASKED(LOG_REGW, "icmd_w 0x%02x (%s)\n", data, machine().describe_context()); + + if (!(data & IC_RST)) { -// logerror("%s: driving data bus with %02x\n", tag(), m_outdata); - scsi_bus->data_w(scsi_refid, m_outdata); - delay(2); - } + // drive scsi data + if ((data ^ m_icmd) & IC_DBUS) + scsi_data_w((data & IC_DBUS) ? m_odata : 0); - // any control lines changing? - uint8_t mask = (data & IC_PHASEMASK) ^ (m_icommand & IC_PHASEMASK); - if (mask) + // check for control line changes + if ((data & IC_PHASE) ^ (m_icmd & IC_PHASE)) + { + u32 const mask = (m_mode & MODE_TARGET) ? + (S_RST | S_BSY | S_SEL) : + (S_RST | S_ACK | S_BSY | S_SEL | S_ATN); + + // translate to nscsi + u32 const ctrl = + (data & IC_RST ? S_RST : 0) | + (data & IC_ACK ? S_ACK : 0) | + (data & IC_BSY ? S_BSY : 0) | + (data & IC_SEL ? S_SEL : 0) | + (data & IC_ATN ? S_ATN : 0); + + LOGMASKED(LOG_SCSI, "changing control lines 0x%04x\n", ctrl); + scsi_bus->ctrl_w(scsi_refid, ctrl, mask); + } + } + else { - // translate data to nscsi - uint8_t newdata; + LOG("scsi reset issued\n"); + device_reset(); + scsi_bus->ctrl_w(scsi_refid, S_RST, S_RST); - newdata = (data & IC_RST ? S_RST : 0) | - (data & IC_ACK ? S_ACK : 0) | - (data & IC_BSY ? S_BSY : 0) | - (data & IC_SEL ? S_SEL : 0) | - (data & IC_ATN ? S_ATN : 0); - -// logerror("%s: changing control lines %04x\n", tag(), newdata); - scsi_bus->ctrl_w(scsi_refid, newdata, S_RST|S_ACK|S_BSY|S_SEL|S_ATN); + set_irq(true); } - m_icommand = (data & IC_WRITEMASK); - delay(2); + m_icmd = (m_icmd & ~IC_WRITE) | (data & IC_WRITE); } -uint8_t ncr5380n_device::mode_r() +u8 ncr5380n_device::mode_r() { + LOGMASKED(LOG_REGR, "mode_r 0x%02x (%s)\n", m_mode, machine().describe_context()); + return m_mode; } -void ncr5380n_device::mode_w(uint8_t data) +void ncr5380n_device::mode_w(u8 data) { -// logerror("%s: mode_w %02x (%s)\n", tag(), data, machine().describe_context()); - // arbitration bit being set? - if ((data & MODE_ARBITRATE) && !(m_mode & MODE_ARBITRATE)) + LOGMASKED(LOG_REGW, "mode_w 0x%02x (%s)\n", data, machine().describe_context()); + + if (!(data & MODE_BSYIRQ)) + m_bas &= ~BAS_BUSYERROR; + + // disable dma + if ((m_mode & MODE_DMA) && !(data & MODE_DMA)) { - // if SEL is selected and the assert SEL bit in the initiator - // command register is clear, fail - if ((scsi_bus->ctrl_r() & S_SEL) && !(m_icommand & IC_SEL)) + m_state = IDLE; + m_state_timer->enable(false); + + m_bas &= ~BAS_ENDOFDMA; + + if (m_has_lbs) + m_tcmd &= ~TC_LBS; + + set_drq(false); + } + + // start/stop arbitration + if ((m_mode ^ data) & MODE_ARBITRATE) + { + if (data & MODE_ARBITRATE) { - m_icommand |= IC_ARBLOST; + // start arbitration + m_icmd &= ~IC_LA; + m_state = ARB_BUS_FREE; + m_state_timer->adjust(attotime::zero); } else { - seq = 0; -// state = DISC_SEL_ARBITRATION; - arbitrate(); + // stop arbitration + m_state = IDLE; + m_icmd &= ~(IC_AIP | IC_LA); } } - else if (!(data & MODE_ARBITRATE) && (m_mode & MODE_ARBITRATE)) - { - // arbitration in progress bit ONLY clears when the host disables arbitration. (thanks, Zilog Z8530 manual!) - // the Apple II High Speed SCSI Card boot code explicitly requires this. - m_icommand &= ~ IC_ARBITRATION; - } + m_mode = data; } -uint8_t ncr5380n_device::command_r() +u8 ncr5380n_device::tcmd_r() { -// logerror("%s: command_r %02x (%s)\n", tag(), m_tcommand, machine().describe_context()); - return m_tcommand; + LOGMASKED(LOG_REGR, "tcmd_r 0x%02x (%s)\n", m_tcmd, machine().describe_context()); + + return m_tcmd; } -void ncr5380n_device::command_w(uint8_t data) +void ncr5380n_device::tcmd_w(u8 data) { -// logerror("%s: command_w %02x (%s)\n", tag(), data, machine().describe_context()); - m_tcommand = data; + LOGMASKED(LOG_REGW, "tcmd_w 0x%02x (%s)\n", data, machine().describe_context()); - // recalculate phase match - m_busstatus &= ~BAS_PHASEMATCH; - if ((scsi_bus->ctrl_r() & S_PHASE_MASK) == (m_tcommand & S_PHASE_MASK)) - { - m_busstatus |= BAS_PHASEMATCH; - } + if (m_has_lbs) + m_tcmd = (m_tcmd & TC_LBS) | (data & ~TC_LBS); + else + m_tcmd = data; } -void ncr5380n_device::arbitrate() +u8 ncr5380n_device::csstat_r() { - m_icommand &= ~IC_ARBLOST; - m_icommand |= IC_ARBITRATION; // set in progress flag - state = (state & STATE_MASK) | (ARB_COMPLETE << SUB_SHIFT); - scsi_bus->data_w(scsi_refid, m_outdata); - scsi_bus->ctrl_w(scsi_refid, S_BSY, S_BSY); - m_icommand |= IC_BSY; // make sure BSY shows in icommand (Zilog 5380 manual suggests this behavior, Apple II High-Speed SCSI Card firmware requires it) - delay(11); -} - -void ncr5380n_device::check_irq() -{ - #if 0 - bool oldirq = irq; - irq = istatus != 0; - if(irq != oldirq) - m_irq_handler(irq); - #endif -} - -uint8_t ncr5380n_device::status_r() -{ - uint32_t ctrl = scsi_bus->ctrl_r(); - uint8_t res = status | + u32 const ctrl = scsi_bus->ctrl_r(); + u8 const data = (ctrl & S_RST ? ST_RST : 0) | (ctrl & S_BSY ? ST_BSY : 0) | (ctrl & S_REQ ? ST_REQ : 0) | @@ -440,169 +338,325 @@ uint8_t ncr5380n_device::status_r() (ctrl & S_INP ? ST_IO : 0) | (ctrl & S_SEL ? ST_SEL : 0); -// logerror("%s: status_r %02x (%s)\n", tag(), res, machine().describe_context()); - return res; + LOGMASKED(LOG_REGR, "csstat_r 0x%02x (%s)\n", data, machine().describe_context()); + return data; } -void ncr5380n_device::selenable_w(uint8_t data) +void ncr5380n_device::selen_w(u8 data) { + LOGMASKED(LOG_REGW, "selen_w 0x%02x (%s)\n", data, machine().describe_context()); } -uint8_t ncr5380n_device::busandstatus_r() +u8 ncr5380n_device::bas_r() { - uint32_t ctrl = scsi_bus->ctrl_r(); - uint8_t res = m_busstatus | + u32 const ctrl = scsi_bus->ctrl_r(); + u8 const data = m_bas | + (((ctrl & S_PHASE_MASK) == (m_tcmd & TC_PHASE)) ? BAS_PHASEMATCH : 0) | (ctrl & S_ATN ? BAS_ATN : 0) | (ctrl & S_ACK ? BAS_ACK : 0); -// logerror("%s: busandstatus_r %02x (%s)\n", tag(), res, machine().describe_context()); + LOGMASKED(LOG_REGR, "bas_r 0x%02x (%s)\n", data, machine().describe_context()); - return res; + return data; } -void ncr5380n_device::startdmasend_w(uint8_t data) +void ncr5380n_device::sds_w(u8 data) { - logerror("%02x to start dma send\n", data); - drq_set(); -} - -uint8_t ncr5380n_device::indata_r() -{ - return dma_r(); -} - -void ncr5380n_device::startdmatargetrx_w(uint8_t data) -{ - logerror("%02x to start dma target Rx\n", data); -} - -uint8_t ncr5380n_device::resetparityirq_r() -{ - return 0; -} - -void ncr5380n_device::startdmainitrx_w(uint8_t data) -{ -// logerror("%02x to start dma initiator Rx\n", data); - recv_byte(); -} - -void ncr5380n_device::dma_w(uint8_t val) -{ - // drop DRQ until we're ready for another byte - drq_clear(); + LOGMASKED(LOG_REGW, "sds_w 0x%02x (%s)\n", data, machine().describe_context()); if (m_mode & MODE_DMA) { - m_dmalatch = val; - send_byte(); + m_state = DMA_OUT_REQ; + m_state_timer->adjust(attotime::zero); } } -uint8_t ncr5380n_device::dma_r() +u8 ncr5380n_device::idata_r() { - if (!machine().side_effects_disabled()) - { - // drop DRQ - drq_clear(); + LOGMASKED(LOG_REGR, "idata_r 0x%02x (%s)\n", m_idata, machine().describe_context()); - // set up to receive our next byte if still in DMA mode - scsi_bus->ctrl_w(scsi_refid, 0, S_ACK); - if (m_mode & MODE_DMA) + return m_idata; +} + +void ncr5380n_device::sdtr_w(u8 data) +{ + LOGMASKED(LOG_REGW, "sdtr_w 0x%02x (%s)\n", data, machine().describe_context()); +} + +u8 ncr5380n_device::rpi_r() +{ + LOGMASKED(LOG_REGR, "rpi_r (%s)\n", machine().describe_context()); + + m_bas &= ~(BAS_PARITYERROR | BAS_BUSYERROR); + set_irq(false); + + return 0; +} + +void ncr5380n_device::sdir_w(u8 data) +{ + LOGMASKED(LOG_REGW, "sdir_w 0x%02x (%s)\n", data, machine().describe_context()); + + if ((m_mode & MODE_DMA) && !(m_mode & MODE_TARGET)) + { + m_state = DMA_IN_REQ; + m_state_timer->adjust(attotime::zero); + } +} + +void ncr5380n_device::state_timer(void *ptr, s32 param) +{ + // step state machine + int const delay = state_step(); + + // check for data stall + if (delay < 0) + return; + + // repeat until idle + if (m_state != IDLE) + m_state_timer->adjust(attotime::from_nsec(delay)); +} + +int ncr5380n_device::state_step() +{ + u32 const ctrl = scsi_bus->ctrl_r(); + int delay = 0; + + switch (m_state) + { + case IDLE: + break; + + case ARB_BUS_FREE: + if (!(ctrl & (S_SEL | S_BSY | S_RST))) { - recv_byte(); + LOGMASKED(LOG_ARB, "arbitration: bus free\n"); + // FIXME: AIP should only be set when arbitration begins + m_icmd |= IC_AIP; + m_state = ARB_START; + delay = 1700; + } + else + { + LOGMASKED(LOG_ARB, "arbitration: bus not free\n"); + m_state = IDLE; + } + break; + case ARB_START: + LOGMASKED(LOG_ARB, "arbitration: started\n"); + m_icmd |= IC_BSY; + m_state = ARB_EVALUATE; + delay = 2200; + + // assert own ID and BSY + scsi_bus->data_w(scsi_refid, m_odata); + scsi_bus->ctrl_w(scsi_refid, S_BSY, S_BSY); + break; + case ARB_EVALUATE: + // check if SEL asserted, or if there's a higher ID on the bus + if ((ctrl & S_SEL) || (scsi_bus->data_r() & ~((m_odata - 1) | m_odata))) + { + LOGMASKED(LOG_ARB, "arbitration: lost\n"); + m_icmd &= ~IC_BSY; + m_icmd |= IC_LA; + + m_state = IDLE; + + // clear data and BSY + scsi_bus->data_w(scsi_refid, 0); + scsi_bus->ctrl_w(scsi_refid, 0, S_BSY); + } + else + { + LOGMASKED(LOG_ARB, "arbitration: won\n"); + m_state = IDLE; + } + break; + + case DMA_IN_REQ: + if (ctrl & S_REQ) + { + if ((ctrl & S_PHASE_MASK) == (m_tcmd & TC_PHASE)) + { + m_idata = scsi_bus->data_r(); + LOGMASKED(LOG_DMA, "dma in: 0x%02x\n", m_idata); + + m_state = DMA_IN_ACK; + set_drq(true); + + // assert ACK + scsi_bus->ctrl_w(scsi_refid, S_ACK, S_ACK); + } + + delay = -1; + } + break; + case DMA_IN_ACK: + if (!(ctrl & S_REQ)) + { + m_state = (m_bas & BAS_ENDOFDMA) ? IDLE : DMA_IN_REQ; + + // clear ACK + scsi_bus->ctrl_w(scsi_refid, 0, S_ACK); + } + break; + + case DMA_OUT_REQ: + if (ctrl & S_REQ) + { + if ((ctrl & S_PHASE_MASK) == (m_tcmd & TC_PHASE)) + { + m_state = DMA_OUT_DRQ; + set_drq(true); + } + + delay = -1; + } + break; + case DMA_OUT_DRQ: + LOGMASKED(LOG_DMA, "dma out: 0x%02x\n", m_odata); + m_state = DMA_OUT_ACK; + + // assert data and ACK + scsi_bus->data_w(scsi_refid, m_odata); + scsi_bus->ctrl_w(scsi_refid, S_ACK, S_ACK); + break; + case DMA_OUT_ACK: + if (!(ctrl & S_REQ)) + { + if (m_bas & BAS_ENDOFDMA) + { + m_state = IDLE; + + if (m_has_lbs) + m_tcmd |= TC_LBS; + } + else + m_state = DMA_OUT_REQ; + + // clear data and ACK + scsi_bus->data_w(scsi_refid, 0); + scsi_bus->ctrl_w(scsi_refid, 0, S_ACK); + } + break; + } + + return delay; +} + +void ncr5380n_device::eop_w(int state) +{ + LOGMASKED(LOG_DMA, "eop_w %d\n", state); + if (state && (m_mode & MODE_DMA)) + { + m_bas |= BAS_ENDOFDMA; + + if (m_mode & MODE_EOPIRQ) + { + // FIXME: should only trigger when combined with dma_r/dma_w + LOG("eop irq asserted\n"); + + set_irq(true); } } - return m_dmalatch; } -void ncr5380n_device::drq_set() +void ncr5380n_device::dma_w(u8 data) { - if(!drq) + set_drq(false); + + if (m_mode & MODE_DMA) { - drq = true; - m_busstatus |= BAS_DMAREQUEST; - m_drq_handler(drq); + m_odata = data; + + m_state_timer->adjust(attotime::zero); } } -void ncr5380n_device::drq_clear() +u8 ncr5380n_device::dma_r() { - if(drq) + set_drq(false); + + if (m_mode & MODE_DMA) + m_state_timer->adjust(attotime::zero); + + return m_idata; +} + +void ncr5380n_device::scsi_data_w(u8 data) +{ + // TODO: release data bus when any of the prerequisite conditions expire + u32 const ctrl = scsi_bus->ctrl_r(); + + if ((m_mode & MODE_TARGET) || (!(ctrl & S_INP) && (ctrl & S_PHASE_MASK) == (m_tcmd & S_PHASE_MASK))) { - drq = false; - m_busstatus &= ~BAS_DMAREQUEST; - m_drq_handler(drq); + LOGMASKED(LOG_SCSI, "scsi data 0x%02x\n", data); + scsi_bus->data_w(scsi_refid, data); } } -uint8_t ncr5380n_device::read(offs_t offset) +void ncr5380n_device::set_irq(bool irq_state) +{ + if (irq_state != m_irq_state) + { + LOG("set_irq %d\n", irq_state); + + if (irq_state) + m_bas |= BAS_IRQACTIVE; + else + m_bas &= ~BAS_IRQACTIVE; + + m_irq_state = irq_state; + m_irq_handler(m_irq_state); + } +} + +void ncr5380n_device::set_drq(bool drq_state) +{ + if (drq_state != m_drq_state) + { + LOGMASKED(LOG_DMA, "set_drq %d\n", drq_state); + + if (drq_state) + m_bas |= BAS_DMAREQUEST; + else + m_bas &= ~BAS_DMAREQUEST; + + m_drq_state = drq_state; + m_drq_handler(m_drq_state); + } +} + +u8 ncr5380n_device::read(offs_t offset) { switch (offset & 7) { - case 0: - return scsidata_r(); - - case 1: - return icmd_r(); - - case 2: - return mode_r(); - - case 3: - return command_r(); - - case 4: - return status_r(); - - case 5: - return busandstatus_r(); - - case 6: - return indata_r(); - - case 7: - return resetparityirq_r(); + case 0: return csdata_r(); + case 1: return icmd_r(); + case 2: return mode_r(); + case 3: return tcmd_r(); + case 4: return csstat_r(); + case 5: return bas_r(); + case 6: return idata_r(); + case 7: return rpi_r(); } - return 0xff; + // can't happen + return 0; } -void ncr5380n_device::write(offs_t offset, uint8_t data) +void ncr5380n_device::write(offs_t offset, u8 data) { -// logerror("%x to 5380 @ %x\n", data, offset); switch (offset & 7) { - case 0: - outdata_w(data); - break; - - case 1: - icmd_w(data); - break; - - case 2: - mode_w(data); - break; - - case 3: - command_w(data); - break; - - case 4: - selenable_w(data); - break; - - case 5: - startdmasend_w(data); - break; - - case 6: - startdmatargetrx_w(data); - break; - - case 7: - startdmainitrx_w(data); - break; + case 0: odata_w(data); break; + case 1: icmd_w(data); break; + case 2: mode_w(data); break; + case 3: tcmd_w(data); break; + case 4: selen_w(data); break; + case 5: sds_w(data); break; + case 6: sdtr_w(data); break; + case 7: sdir_w(data); break; } } diff --git a/src/devices/machine/ncr5380n.h b/src/devices/machine/ncr5380n.h index 5bf01b10bb8..ae9a87b4344 100644 --- a/src/devices/machine/ncr5380n.h +++ b/src/devices/machine/ncr5380n.h @@ -1,12 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:R. Belmont, Olivier Galibert -/********************************************************************* - - ncr5380n.c - - Implementation of the NCR 5380 - -*********************************************************************/ +// copyright-holders:Patrick Mackinlay #ifndef MAME_MACHINE_NCR5380N_H #define MAME_MACHINE_NCR5380N_H @@ -15,221 +8,179 @@ #include "machine/nscsi_bus.h" - -class ncr5380n_device : public nscsi_device, public nscsi_slot_card_interface +class ncr5380n_device + : public nscsi_device + , public nscsi_slot_card_interface { public: - ncr5380n_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ncr5380n_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); - // configuration helpers + // device configuration auto irq_handler() { return m_irq_handler.bind(); } auto drq_handler() { return m_drq_handler.bind(); } - uint8_t read(offs_t offset); - void write(offs_t offset, uint8_t data); + // register access + void map(address_map &map); + u8 read(offs_t offset); + void write(offs_t offset, u8 data); - uint8_t dma_r(); - void dma_w(uint8_t val); + // dma access + void eop_w(int state); + u8 dma_r(); + void dma_w(u8 val); protected: - ncr5380n_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + ncr5380n_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock, bool has_lbs = false); + // device_t overrides virtual void device_start() override; virtual void device_reset() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + // ncsci_device overrides virtual void scsi_ctrl_changed() override; + // register read handlers + u8 csdata_r(); + u8 icmd_r(); + u8 mode_r(); + u8 tcmd_r(); + u8 csstat_r(); + u8 bas_r(); + u8 idata_r(); + u8 rpi_r(); + + // register write handlers + void odata_w(u8 data); + void icmd_w(u8 data); + void mode_w(u8 data); + void tcmd_w(u8 data); + void selen_w(u8 data); + void sds_w(u8 data); + void sdtr_w(u8 data); + void sdir_w(u8 data); + + // state machine + void state_timer(void *ptr, s32 param); + int state_step(); + + // other helpers + void scsi_data_w(u8 data); + void set_irq(bool irq_state); + void set_drq(bool drq_state); + private: - enum { MODE_D, MODE_T, MODE_I }; - enum { IDLE }; + enum icmd_mask : u8 + { + IC_RST = 0x80, // assert R̅S̅T̅ + IC_TEST = 0x40, // test mode (wo) + IC_AIP = 0x40, // arbitration in progress (ro) + IC_LA = 0x20, // lost arbitration (ro) + IC_ACK = 0x10, // assert A̅C̅K̅ + IC_BSY = 0x08, // assert B̅S̅Y̅ + IC_SEL = 0x04, // assert S̅E̅L̅ + IC_ATN = 0x02, // assert A̅T̅N̅ + IC_DBUS = 0x01, // assert data bus - enum { - // Bus initiated sequences - BUSINIT_SETTLE_DELAY = 1, - BUSINIT_ASSERT_BUS_SEL, - BUSINIT_MSG_OUT, - BUSINIT_RECV_BYTE, - BUSINIT_ASSERT_BUS_RESEL, - BUSINIT_WAIT_REQ, - BUSINIT_RECV_BYTE_NACK, - - // Bus SCSI Reset - BUSRESET_WAIT_INT, - BUSRESET_RESET_BOARD, - - // Disconnected state commands - DISC_SEL_ARBITRATION, - DISC_SEL_ATN_WAIT_REQ, - DISC_SEL_ATN_SEND_BYTE, - DISC_SEL_WAIT_REQ, - DISC_SEL_SEND_BYTE, - DISC_REC_ARBITRATION, - DISC_REC_MSG_IN, - DISC_REC_SEND_BYTE, - DISC_RESET, - - // Command sequence - CMDSEQ_CMD_PHASE, - CMDSEQ_RECV_BYTE, - - // Target commands - TARGET_SEND_BYTE, - TARGET_CMD_RECV_BYTE, - TARGET_MSG_RECV_BYTE, - TARGET_MSG_RECV_PAD, - TARGET_DISC_SEND_BYTE, - TARGET_DISC_MSG_IN, - TARGET_DISC_SEND_BYTE_2, - - // Initiator commands - INIT_MSG_WAIT_REQ, - INIT_XFR, - INIT_XFR_SEND_BYTE, - INIT_XFR_SEND_PAD_WAIT_REQ, - INIT_XFR_SEND_PAD, - INIT_XFR_RECV_PAD_WAIT_REQ, - INIT_XFR_RECV_PAD, - INIT_XFR_RECV_BYTE_ACK, - INIT_XFR_RECV_BYTE_NACK, - INIT_XFR_WAIT_REQ, - INIT_CPT_RECV_BYTE_ACK, - INIT_CPT_RECV_WAIT_REQ, - INIT_CPT_RECV_BYTE_NACK + IC_PHASE = 0x9e, + IC_WRITE = 0x9f, }; - - enum { - // Arbitration - ARB_WAIT_BUS_FREE = 1, - ARB_COMPLETE, - ARB_ASSERT_SEL, - ARB_SET_DEST, - ARB_RELEASE_BUSY, - ARB_TIMEOUT_BUSY, - ARB_TIMEOUT_ABORT, - ARB_DESKEW_WAIT, - - // Send/receive byte - SEND_WAIT_SETTLE, - SEND_WAIT_REQ_0, - RECV_WAIT_REQ_1, - RECV_WAIT_SETTLE, - RECV_WAIT_REQ_0 + enum mode_mask : u8 + { + MODE_BLOCKDMA = 0x80, + MODE_TARGET = 0x40, + MODE_PARITYCHK = 0x20, + MODE_PARITYIRQ = 0x10, + MODE_EOPIRQ = 0x08, + MODE_BSYIRQ = 0x04, + MODE_DMA = 0x02, + MODE_ARBITRATE = 0x01, }; + enum tcmd_mask : u8 + { + TC_LBS = 0x80, // last byte sent + TC_REQ = 0x08, // assert R̅E̅Q̅ + TC_MSG = 0x04, // assert M̅S̅G̅ + TC_CD = 0x02, // assert C̅/D + TC_IO = 0x01, // assert I̅/O - enum { - STATE_MASK = 0x00ff, - SUB_SHIFT = 8, - SUB_MASK = 0xff00 + TC_PHASE = 0x07, }; - - enum { BUS_BUSY, BUS_FREE_WAIT, BUS_FREE }; - - enum { - ST_RST = 0x80, - ST_BSY = 0x40, - ST_REQ = 0x20, - ST_MSG = 0x10, - ST_CD = 0x08, - ST_IO = 0x04, - ST_SEL = 0x02, - ST_DBP = 0x01, - - BAS_ENDOFDMA = 0x80, - BAS_DMAREQUEST = 0x40, - BAS_PARITYERROR = 0x20, - BAS_IRQACTIVE = 0x10, - BAS_PHASEMATCH = 0x08, - BAS_BUSYERROR = 0x04, - BAS_ATN = 0x02, - BAS_ACK = 0x01, - - IC_RST = 0x80, - IC_ARBITRATION = 0x40, - IC_ARBLOST = 0x20, - IC_ACK = 0x10, - IC_BSY = 0x08, - IC_SEL = 0x04, - IC_ATN = 0x02, - IC_DBUS = 0x01, - IC_PHASEMASK = 0x9e, - IC_WRITEMASK = 0x9f, - - MODE_BLOCKDMA = 0x80, - MODE_TARGET = 0x40, - MODE_PARITYCHK = 0x20, - MODE_PARITYIRQ = 0x10, - MODE_EOPIRQ = 0x08, - MODE_BSYIRQ = 0x04, - MODE_DMA = 0x02, - MODE_ARBITRATE = 0x01 + enum csstat_mask : u8 + { + ST_RST = 0x80, + ST_BSY = 0x40, + ST_REQ = 0x20, + ST_MSG = 0x10, + ST_CD = 0x08, + ST_IO = 0x04, + ST_SEL = 0x02, + ST_DBP = 0x01, + }; + enum bas_mask : u8 + { + BAS_ENDOFDMA = 0x80, + BAS_DMAREQUEST = 0x40, + BAS_PARITYERROR = 0x20, + BAS_IRQACTIVE = 0x10, + BAS_PHASEMATCH = 0x08, + BAS_BUSYERROR = 0x04, + BAS_ATN = 0x02, + BAS_ACK = 0x01, }; - - enum { DMA_NONE, DMA_IN, DMA_OUT }; - - uint32_t m_fake_clock; - - emu_timer *tm; - - uint8_t status, istatus, m_mode, m_outdata, m_busstatus, m_dmalatch; - uint8_t m_icommand, m_tcommand; - uint8_t clock_conv, sync_offset, sync_period, bus_id, select_timeout, seq; - uint16_t tcount; - int mode; - int state/*, xfr_phase*/; - - bool irq, drq; - - void drq_set(); - void drq_clear(); - - void step(bool timeout); - void function_complete(); - void function_bus_complete(); - void bus_complete(); - - void arbitrate(); - void check_irq(); - - void reset_soft(); - void reset_disconnect(); - - void send_byte(); - void recv_byte(); - - void delay(int cycles); - void delay_cycles(int cycles); - - void map(address_map &map); - - uint8_t scsidata_r(); - void outdata_w(uint8_t data); - uint8_t icmd_r(); - void icmd_w(uint8_t data); - uint8_t mode_r(); - void mode_w(uint8_t data); - uint8_t command_r(); - void command_w(uint8_t data); - uint8_t status_r(); - void selenable_w(uint8_t data); - uint8_t busandstatus_r(); - void startdmasend_w(uint8_t data); - uint8_t indata_r(); - void startdmatargetrx_w(uint8_t data); - uint8_t resetparityirq_r(); - void startdmainitrx_w(uint8_t data); devcb_write_line m_irq_handler; devcb_write_line m_drq_handler; + + // state machine + emu_timer *m_state_timer; + enum state : unsigned + { + IDLE, + + // arbitration + ARB_BUS_FREE, + ARB_START, + ARB_EVALUATE, + + // dma transfer + DMA_IN_REQ, + DMA_IN_ACK, + DMA_OUT_REQ, + DMA_OUT_DRQ, + DMA_OUT_ACK, + } + m_state; + + // registers + u8 m_odata; + u8 m_icmd; + u8 m_mode; + u8 m_tcmd; + u8 m_bas; + u8 m_idata; + + // line state + u32 m_scsi_ctrl; + bool m_irq_state; + bool m_drq_state; + + bool const m_has_lbs; }; class ncr53c80_device : public ncr5380n_device { public: - ncr53c80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + ncr53c80_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); +}; + +class cxd1180_device : public ncr5380n_device +{ +public: + cxd1180_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0); }; DECLARE_DEVICE_TYPE(NCR5380N, ncr5380n_device) DECLARE_DEVICE_TYPE(NCR53C80, ncr53c80_device) +DECLARE_DEVICE_TYPE(CXD1180, cxd1180_device) #endif // MAME_MACHINE_NCR5380N_H diff --git a/src/devices/machine/nscsi_bus.cpp b/src/devices/machine/nscsi_bus.cpp index 489a5b6f171..99de59881fe 100644 --- a/src/devices/machine/nscsi_bus.cpp +++ b/src/devices/machine/nscsi_bus.cpp @@ -288,6 +288,11 @@ void nscsi_full_device::step(bool timeout) scsi_bus->ctrl_w(scsi_refid, 0, S_ALL); scsi_state = IDLE; LOG("scsi bus reset\n"); + scsi_state = scsi_substate = IDLE; + buf_control_rpos = buf_control_wpos = 0; + scsi_identify = 0; + data_buffer_size = 0; + data_buffer_pos = 0; return; } diff --git a/src/devices/machine/pic8259.cpp b/src/devices/machine/pic8259.cpp index b7e048170ed..3866b4e4163 100644 --- a/src/devices/machine/pic8259.cpp +++ b/src/devices/machine/pic8259.cpp @@ -39,14 +39,15 @@ void pic8259_device::device_timer(emu_timer &timer, device_timer_id id, int para /* is this IRQ in service and not cascading and sfnm? */ if ((m_isr & mask) && !(m_master && m_cascade && m_nested && (m_slave & mask))) { - LOG("pic8259_timerproc(): PIC IRQ #%d still in service\n", irq); + LOG("pic8259_timerproc(): PIC IR%d still in service\n", irq); break; } /* is this IRQ pending and enabled? */ if ((m_state == state_t::READY) && (m_irr & mask) && !(m_imr & mask)) { - LOG("pic8259_timerproc(): PIC triggering IRQ #%d\n", irq); + LOG("pic8259_timerproc(): PIC triggering IR%d\n", irq); + m_current_level = irq; m_out_int_func(1); return; } @@ -54,6 +55,7 @@ void pic8259_device::device_timer(emu_timer &timer, device_timer_id id, int para if((m_isr & mask) && m_master && m_cascade && m_nested && (m_slave & mask)) break; } + m_current_level = -1; m_out_int_func(0); } @@ -64,7 +66,7 @@ void pic8259_device::set_irq_line(int irq, int state) if (state) { /* setting IRQ line */ - LOG("set_irq_line(): PIC set IRQ line #%d\n", irq); + LOG("set_irq_line(): PIC set IR%d line\n", irq); if(m_level_trig_mode || (!m_level_trig_mode && !(m_irq_lines & mask))) { @@ -75,26 +77,28 @@ void pic8259_device::set_irq_line(int irq, int state) else { /* clearing IRQ line */ - LOG("set_irq_line(): PIC cleared IRQ line #%d\n", irq); + LOG("set_irq_line(): PIC cleared IR%d line\n", irq); m_irq_lines &= ~mask; m_irr &= ~mask; } - set_timer(); + + if (m_inta_sequence == 0) + set_timer(); } -uint32_t pic8259_device::acknowledge() +uint8_t pic8259_device::acknowledge() { - for (int n = 0, irq = m_prio; n < 8; n++, irq = (irq + 1) & 7) + if (is_x86()) { - uint8_t mask = 1 << irq; - /* is this IRQ pending and enabled? */ - if ((m_irr & mask) && !(m_imr & mask)) + if (m_current_level != -1) { - if (!machine().side_effects_disabled()) { - LOG("pic8259_acknowledge(): PIC acknowledge IRQ #%d\n", irq); + uint8_t mask = 1 << m_current_level; + if (!machine().side_effects_disabled()) + { + LOG("pic8259_acknowledge(): PIC acknowledge IR%d\n", m_current_level); if (!m_level_trig_mode) m_irr &= ~mask; @@ -107,29 +111,70 @@ uint32_t pic8259_device::acknowledge() if ((m_cascade!=0) && (m_master!=0) && (mask & m_slave)) { // it's from slave device - return m_read_slave_ack_func(irq); + return m_read_slave_ack_func(m_current_level); } else { - if (is_x86()) - { - /* For x86 mode*/ - return irq + m_base; - } - else - { - /* in case of 8080/85) */ - return 0xcd0000 + (m_vector_addr_high << 8) + m_vector_addr_low + (irq << (3-m_vector_size)); - } + /* For x86 mode*/ + return m_current_level + m_base; } } + else + { + if (!machine().side_effects_disabled()) + logerror("Spurious INTA\n"); + return m_base + 7; + } } - if (!machine().side_effects_disabled()) - logerror("Spurious IRQ\n"); - if (is_x86()) - return m_base + 7; else - return 0xcd0000 + (m_vector_addr_high << 8) + m_vector_addr_low + (7 << (3-m_vector_size)); + { + /* in case of 8080/85 */ + if (m_inta_sequence == 0) + { + if (!machine().side_effects_disabled()) + { + if (m_current_level != -1) + { + LOG("pic8259_acknowledge(): PIC acknowledge IR%d\n", m_current_level); + + uint8_t mask = 1 << m_current_level; + if (!m_level_trig_mode) + m_irr &= ~mask; + m_isr |= mask; + } + else + logerror("Spurious INTA\n"); + m_inta_sequence = 1; + } + if (m_cascade && m_master && m_current_level != -1 && BIT(m_slave, m_current_level)) + return m_read_slave_ack_func(m_current_level); + else + return 0xcd; + } + else if (m_inta_sequence == 1) + { + if (!machine().side_effects_disabled()) + m_inta_sequence = 2; + if (m_cascade && m_master && m_current_level != -1 && BIT(m_slave, m_current_level)) + return m_read_slave_ack_func(m_current_level); + else + return m_vector_addr_low + ((m_current_level & 7) << (3-m_vector_size)); + } + else + { + if (!machine().side_effects_disabled()) + { + m_inta_sequence = 0; + if (m_auto_eoi && m_current_level != -1) + m_isr &= ~(1 << m_current_level); + set_timer(); + } + if (m_cascade && m_master && m_current_level != -1 && BIT(m_slave, m_current_level)) + return m_read_slave_ack_func(m_current_level); + else + return m_vector_addr_high; + } + } } @@ -150,18 +195,17 @@ uint8_t pic8259_device::read(offs_t offset) if ( m_ocw3 & 0x04 ) { /* Polling mode */ - if ( m_irr & ~m_imr ) + if (m_current_level != -1) { - /* check the various IRQs */ - for (int n = 0, irq = m_prio; n < 8; n++, irq = (irq + 1) & 7) - { - if ( ( 1 << irq ) & m_irr & ~m_imr ) - { - data = 0x80 | irq; - break; - } - } - acknowledge(); + data = 0x80 | m_current_level; + + if (!m_level_trig_mode) + m_irr &= ~(1 << m_current_level); + + if (!m_auto_eoi) + m_isr |= 1 << m_current_level; + + set_timer(); } } else @@ -207,7 +251,9 @@ void pic8259_device::write(offs_t offset, uint8_t data) m_cascade = (data & 0x02) ? 0 : 1; m_icw4_needed = (data & 0x01) ? 1 : 0; m_vector_addr_low = (data & 0xe0); - m_state = state_t::ICW2; + m_state = state_t::ICW2; + m_current_level = -1; + m_inta_sequence = 0; m_out_int_func(0); } else if (m_state == state_t::READY) @@ -377,6 +423,8 @@ void pic8259_device::device_start() save_item(NAME(m_mode)); save_item(NAME(m_auto_eoi)); save_item(NAME(m_is_x86)); + save_item(NAME(m_current_level)); + save_item(NAME(m_inta_sequence)); } @@ -406,6 +454,8 @@ void pic8259_device::device_reset() m_is_x86 = 0; m_vector_addr_low = 0; m_vector_addr_high = 0; + m_current_level = -1; + m_inta_sequence = 0; m_master = m_in_sp_func(); } diff --git a/src/devices/machine/pic8259.h b/src/devices/machine/pic8259.h index 298ef1debea..a1f14b4c51d 100644 --- a/src/devices/machine/pic8259.h +++ b/src/devices/machine/pic8259.h @@ -39,7 +39,7 @@ public: uint8_t read(offs_t offset); void write(offs_t offset, uint8_t data); - uint32_t acknowledge(); + uint8_t acknowledge(); DECLARE_WRITE_LINE_MEMBER( ir0_w ) { set_irq_line(0, state); } DECLARE_WRITE_LINE_MEMBER( ir1_w ) { set_irq_line(1, state); } @@ -113,6 +113,9 @@ private: uint8_t m_mode; uint8_t m_auto_eoi; uint8_t m_is_x86; + + int8_t m_current_level; + uint8_t m_inta_sequence; }; class v5x_icu_device : public pic8259_device diff --git a/src/devices/machine/rescap.h b/src/devices/machine/rescap.h index 851a7c25528..d96347bacbc 100644 --- a/src/devices/machine/rescap.h +++ b/src/devices/machine/rescap.h @@ -3,7 +3,7 @@ #ifndef MAME_MACHINE_RESCAP_H #define MAME_MACHINE_RESCAP_H -/* Little helpers for magnitude conversions */ +// Little helpers for magnitude conversions #define RES_R(res) ((double)(res)) #define RES_K(res) ((double)(res) * 1e3) #define RES_M(res) ((double)(res) * 1e6) @@ -15,7 +15,7 @@ #define IND_N(ind) ((double)(ind) * 1e-9) #define IND_P(ind) ((double)(ind) * 1e-12) -/* vin --/\r1/\-- out --/\r2/\-- gnd */ +// vin --/\r1/\-- out --/\r2/\-- gnd #define RES_VOLTAGE_DIVIDER(r1, r2) ((double)(r2) / ((double)(r1) + (double)(r2))) #define RES_2_PARALLEL(r1, r2) (((r1) * (r2)) / ((r1) + (r2))) @@ -26,4 +26,15 @@ #define RES_2_SERIAL(r1,r2) ((r1)+(r2)) +// macro for the RC time constant on a 74LS123 with C > 1000pF +// R is in ohms, C is in farads +#define TIME_OF_74LS123(r,c) (0.45 * (double)(r) * (double)(c)) + +// macros for the RC time constant on a 555 timer IC +// R is in ohms, C is in farads +#define PERIOD_OF_555_MONOSTABLE_NSEC(r,c) ((attoseconds_t)(1100000000 * (double)(r) * (double)(c))) +#define PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c) ((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c))) +#define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c)) +#define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)) + #endif // MAME_MACHINE_RESCAP_H diff --git a/src/devices/machine/timer.h b/src/devices/machine/timer.h index 64dc66f38c5..04d0f192325 100644 --- a/src/devices/machine/timer.h +++ b/src/devices/machine/timer.h @@ -85,7 +85,7 @@ public: bool enabled() const { return m_timer->enabled(); } // property setters - void set_param(int param) const { assert(m_type == TIMER_TYPE_GENERIC); m_timer->set_param(param); } + void set_param(int param) const { if(m_type != TIMER_TYPE_GENERIC) fatalerror("Cannot change parameter on a non-generic timer.\n"); m_timer->set_param(param); } void set_ptr(void *ptr) { m_ptr = ptr; } void enable(bool enable = true) const { m_timer->enable(enable); } @@ -93,7 +93,8 @@ public: void reset() { adjust(attotime::never, 0, attotime::never); } void adjust(const attotime &duration, s32 param = 0, const attotime &period = attotime::never) const { - assert(m_type == TIMER_TYPE_GENERIC); + if(m_type != TIMER_TYPE_GENERIC) + fatalerror("Cannot adjust a non-generic timer.\n"); m_timer->adjust(duration, param, period); } diff --git a/src/devices/machine/tms1024.h b/src/devices/machine/tms1024.h index 127909d27f2..1920c5efb42 100644 --- a/src/devices/machine/tms1024.h +++ b/src/devices/machine/tms1024.h @@ -68,6 +68,7 @@ public: auto write_port5_callback() { return m_write_port[4].bind(); } auto write_port6_callback() { return m_write_port[5].bind(); } auto write_port7_callback() { return m_write_port[6].bind(); } + tms1024_device &set_ms(u8 i) { m_ms = i & 1; return *this; } // if hardwired, can just set MS pin state here void write_h(u8 data); u8 read_h(); diff --git a/src/devices/machine/z80scc.cpp b/src/devices/machine/z80scc.cpp index 6f0e293809a..0259fb5d0b0 100644 --- a/src/devices/machine/z80scc.cpp +++ b/src/devices/machine/z80scc.cpp @@ -1840,8 +1840,8 @@ void z80scc_channel::do_sccreg_wr0(uint8_t data) // loop over all interrupt sources for (auto & elem : m_uart->m_int_state) { - // find the first channel with an interrupt requested - if (elem & Z80_DAISY_INT) + // find the first interrupt under service + if (elem & Z80_DAISY_IEO) { LOGCMD("- %c found IUS bit to clear\n", 'A' + m_index); elem = 0; // Clear IUS bit (called IEO in z80 daisy lingo) @@ -1858,7 +1858,8 @@ void z80scc_channel::do_sccreg_wr0(uint8_t data) of these modes is selected and this command is issued before the data has been read from the Receive FIFO, the data is lost */ LOGCMD("%s: %c : WR0_ERROR_RESET - not implemented\n", owner()->tag(), 'A' + m_index); - m_rx_fifo_rp_step(); // Reset error state in fifo and unlock it. unlock == step to next slot in fifo. + if (m_rx_fifo_wp != m_rx_fifo_rp) + m_rx_fifo_rp_step(); // Reset error state in fifo and unlock it. unlock == step to next slot in fifo. break; case WR0_SEND_ABORT: // Flush transmitter and Send 8-13 bits of '1's, used with SDLC LOGCMD("%s: %c : WR0_SEND_ABORT - not implemented\n", owner()->tag(), 'A' + m_index); diff --git a/src/devices/sound/c140.cpp b/src/devices/sound/c140.cpp index ca3bdc90977..7b0b13b9cb4 100644 --- a/src/devices/sound/c140.cpp +++ b/src/devices/sound/c140.cpp @@ -1,16 +1,21 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont /* -C140.c +c140.cpp Simulator based on AMUSE sources. The C140 sound chip is used by Namco System 2 and System 21 The 219 ASIC (which incorporates a modified C140) is used by Namco NA-1 and NA-2 This chip controls 24 channels (C140) or 16 (219) of PCM. 16 bytes are associated with each channel. -Channels can be 8 bit signed PCM, or 12 bit signed PCM. +Channels can be 8 bit compressed PCM, or 12 bit signed PCM. -TODO: What does the INT0 pin do? Normally Namco tied it to VOL0 (with VOL1 = VCC). +TODO: +- What does the INT0 pin do? Normally Namco tied it to VOL0 (with VOL1 = VCC). +- Acknowledge A9 bit (9th address bit) of host interface +- Verify data bus bits of C219 +- Verify C219 LFSR algorithm (same as c352.cpp?) +- Verify unknown mode bits (0x40 for C140, 0x02 for C219) -------------- @@ -37,43 +42,44 @@ TODO: What does the INT0 pin do? Normally Namco tied it to VOL0 (with VOL1 = VCC 2000.06.26 CAB fixed compressed pcm playback 2002.07.20 R. Belmont added support for multiple banking types 2006.01.08 R. Belmont added support for NA-1/2 "219" derivative + 2020.05.06 cam900 Implement some features from QuattroPlay sources, by superctr */ #include "emu.h" #include "c140.h" +#include struct voice_registers { - uint8_t volume_right; - uint8_t volume_left; - uint8_t frequency_msb; - uint8_t frequency_lsb; - uint8_t bank; - uint8_t mode; - uint8_t start_msb; - uint8_t start_lsb; - uint8_t end_msb; - uint8_t end_lsb; - uint8_t loop_msb; - uint8_t loop_lsb; - uint8_t reserved[4]; + u8 volume_right; + u8 volume_left; + u8 frequency_msb; + u8 frequency_lsb; + u8 bank; + u8 mode; + u8 start_msb; + u8 start_lsb; + u8 end_msb; + u8 end_lsb; + u8 loop_msb; + u8 loop_lsb; + u8 reserved[4]; }; // device type definition DEFINE_DEVICE_TYPE(C140, c140_device, "c140", "Namco C140") +DEFINE_DEVICE_TYPE(C219, c219_device, "c219", "Namco C219") //************************************************************************** // LIVE DEVICE //************************************************************************** -static inline int limit(int32_t in) +static inline int limit(s32 in) { - if(in>0x7fff) return 0x7fff; - else if(in<-0x8000) return -0x8000; - return in; + return std::max(-0x7fff, std::min(0x8000, in)); } @@ -82,19 +88,29 @@ static inline int limit(int32_t in) //------------------------------------------------- c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, C140, tag, owner, clock) + : c140_device(mconfig, C140, tag, owner, clock) +{ +} + +c140_device::c140_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, type, tag, owner, clock) , device_sound_interface(mconfig, *this) - , device_rom_interface(mconfig, *this, 21) + , device_rom_interface(mconfig, *this, 25, ENDIANNESS_BIG, 16) // Verified from schematics (24 bit address, 12(16? for C219) bit data) , m_int1_callback(*this) , m_sample_rate(0) , m_stream(nullptr) - , m_banking_type(C140_TYPE::SYSTEM2) , m_mixer_buffer_left(nullptr) , m_mixer_buffer_right(nullptr) , m_baserate(0) { - memset(m_REG, 0, sizeof(uint8_t)*0x200); - memset(m_pcmtbl, 0, sizeof(int16_t)*8); + std::fill(std::begin(m_REG), std::end(m_REG), 0); + std::fill(std::begin(m_pcmtbl), std::end(m_pcmtbl), 0); +} + +c219_device::c219_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : c140_device(mconfig, C219, tag, owner, clock) +{ + // TODO: unknown address bus bits } @@ -111,46 +127,76 @@ void c140_device::device_start() m_stream = stream_alloc(0, 2, m_sample_rate); - /* make decompress pcm table */ //2000.06.26 CAB - int32_t segbase = 0; - for(int i = 0; i < 8; i++) + // make decompress pcm table (Verified from Wii Virtual Console Arcade Starblade) + for (int i = 0; i < 256; i++) { - m_pcmtbl[i]=segbase; //segment base value - segbase += 16<> 3) & 31; + + m_pcmtbl[i] = 0x80 << s1 & 0xff00; + m_pcmtbl[i] += s2 << (s1 ? s1 + 3 : 4); + + if (j < 0) + m_pcmtbl[i] = -m_pcmtbl[i]; } - memset(m_REG,0,sizeof(m_REG)); + std::fill(std::begin(m_REG), std::end(m_REG), 0); - for(int i = 0; i < MAX_VOICE; i++) + for (int i = 0; i < MAX_VOICE; i++) { init_voice(&m_voi[i]); } /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ - m_mixer_buffer_left = std::make_unique(m_sample_rate); - m_mixer_buffer_right = std::make_unique(m_sample_rate); + m_mixer_buffer_left = std::make_unique(m_sample_rate); + m_mixer_buffer_right = std::make_unique(m_sample_rate); save_item(NAME(m_REG)); - for (int i = 0; i < MAX_VOICE; i++) - { - save_item(NAME(m_voi[i].ptoffset), i); - save_item(NAME(m_voi[i].pos), i); - save_item(NAME(m_voi[i].key), i); - save_item(NAME(m_voi[i].lastdt), i); - save_item(NAME(m_voi[i].prevdt), i); - save_item(NAME(m_voi[i].dltdt), i); - save_item(NAME(m_voi[i].rvol), i); - save_item(NAME(m_voi[i].lvol), i); - save_item(NAME(m_voi[i].frequency), i); - save_item(NAME(m_voi[i].bank), i); - save_item(NAME(m_voi[i].mode), i); - save_item(NAME(m_voi[i].sample_start), i); - save_item(NAME(m_voi[i].sample_end), i); - save_item(NAME(m_voi[i].sample_loop), i); - } + save_item(STRUCT_MEMBER(m_voi, ptoffset)); + save_item(STRUCT_MEMBER(m_voi, pos)); + save_item(STRUCT_MEMBER(m_voi, key)); + save_item(STRUCT_MEMBER(m_voi, lastdt)); + save_item(STRUCT_MEMBER(m_voi, prevdt)); + save_item(STRUCT_MEMBER(m_voi, dltdt)); + save_item(STRUCT_MEMBER(m_voi, rvol)); + save_item(STRUCT_MEMBER(m_voi, lvol)); + save_item(STRUCT_MEMBER(m_voi, frequency)); + save_item(STRUCT_MEMBER(m_voi, bank)); + save_item(STRUCT_MEMBER(m_voi, mode)); + save_item(STRUCT_MEMBER(m_voi, sample_start)); + save_item(STRUCT_MEMBER(m_voi, sample_end)); + save_item(STRUCT_MEMBER(m_voi, sample_loop)); } +void c219_device::device_start() +{ + c140_device::device_start(); + // generate mulaw table (Verified from Wii Virtual Console Arcade Knuckle Heads) + // same as c352.cpp + int j = 0; + for (int i = 0; i < 128; i++) + { + m_pcmtbl[i] = j << 5; + if (i < 16) + j += 1; + else if (i < 24) + j += 2; + else if (i < 48) + j += 4; + else if (i < 100) + j += 8; + else + j += 16; + } + for (int i = 0; i < 128; i++) + m_pcmtbl[i + 128] = (~m_pcmtbl[i]) & 0xffe0; + + m_lfsr = 0x1234; + + save_item(NAME(m_lfsr)); +} void c140_device::device_clock_changed() { @@ -159,8 +205,8 @@ void c140_device::device_clock_changed() m_stream->set_sample_rate(m_sample_rate); /* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */ - m_mixer_buffer_left = std::make_unique(m_sample_rate); - m_mixer_buffer_right = std::make_unique(m_sample_rate);; + m_mixer_buffer_left = std::make_unique(m_sample_rate); + m_mixer_buffer_right = std::make_unique(m_sample_rate);; } @@ -176,181 +222,100 @@ void c140_device::rom_bank_updated() void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) { - int i,j; + s32 dt; - int32_t rvol,lvol; - int32_t dt; - int32_t sdt; - int32_t st,ed,sz; + float pbase = (float)m_baserate * 2.0f / (float)m_sample_rate; - long sampleData; - int32_t frequency,delta,offset,pos; - int32_t cnt, voicecnt; - int32_t lastdt,prevdt,dltdt; - float pbase=(float)m_baserate*2.0f / (float)m_sample_rate; + s16 *lmix, *rmix; - int16_t *lmix, *rmix; - - if(samples>m_sample_rate) samples=m_sample_rate; + if (samples > m_sample_rate) samples = m_sample_rate; /* zap the contents of the mixer buffer */ - memset(m_mixer_buffer_left.get(), 0, samples * sizeof(int16_t)); - memset(m_mixer_buffer_right.get(), 0, samples * sizeof(int16_t)); - - /* get the number of voices to update */ - voicecnt = (m_banking_type == C140_TYPE::ASIC219) ? 16 : 24; + std::fill_n(&m_mixer_buffer_left[0], samples, 0); + std::fill_n(&m_mixer_buffer_right[0], samples, 0); //--- audio update - for( i=0;ikey ) + if (v->key) { - frequency= vreg->frequency_msb*256 + vreg->frequency_lsb; + const u16 frequency = (vreg->frequency_msb << 8) | vreg->frequency_lsb; /* Abort voice if no frequency value set */ - if(frequency==0) continue; + if (frequency == 0) continue; /* Delta = frequency * ((8MHz/374)*2 / sample rate) */ - delta=(long)((float)frequency * pbase); + const int delta = (int)((float)frequency * pbase); /* Calculate left/right channel volumes */ - lvol=(vreg->volume_left*32)/MAX_VOICE; //32ch -> 24ch - rvol=(vreg->volume_right*32)/MAX_VOICE; + const int lvol = (vreg->volume_left * 32) / MAX_VOICE; //32ch -> 24ch + const int rvol = (vreg->volume_right * 32) / MAX_VOICE; /* Set mixer outputs base pointers */ lmix = m_mixer_buffer_left.get(); rmix = m_mixer_buffer_right.get(); /* Retrieve sample start/end and calculate size */ - st=v->sample_start; - ed=v->sample_end; - sz=ed-st; + const int st = v->sample_start; + const int ed = v->sample_end; + const int sz = ed - st; /* Retrieve base pointer to the sample data */ - sampleData = find_sample(st, v->bank, i); + const int sampleData = find_sample(st, v->bank, i); /* Fetch back previous data pointers */ - offset=v->ptoffset; - pos=v->pos; - lastdt=v->lastdt; - prevdt=v->prevdt; - dltdt=v->dltdt; + int offset = v->ptoffset; + int pos = v->pos; + s32 lastdt = v->lastdt; + s32 prevdt = v->prevdt; + s32 dltdt = v->dltdt; - /* Switch on data type - compressed PCM is only for C140 */ - if ((v->mode&8) && (m_banking_type != C140_TYPE::ASIC219)) + /* linear or compressed 12bit signed PCM */ + for (int j = 0; j < samples; j++) { - //compressed PCM (maybe correct...) - /* Loop for enough to fill sample buffer as requested */ - for(j=0;j> 16) & 0x7fff; + offset &= 0xffff; + pos += cnt; + /* Check for the end of the sample */ + if (pos >= sz) { - offset += delta; - cnt = (offset>>16)&0x7fff; - offset &= 0xffff; - pos+=cnt; - //for(;cnt>0;cnt--) + /* Check if its a looping sample, either stop or loop */ + if (ch_looped(v)) { - /* Check for the end of the sample */ - if(pos >= sz) - { - /* Check if its a looping sample, either stop or loop */ - if(v->mode&0x10) - { - pos = (v->sample_loop - st); - } - else - { - v->key=0; - break; - } - } - - /* Read the chosen sample byte */ - dt = (int8_t) read_byte(sampleData + pos); - - /* decompress to 13bit range */ //2000.06.26 CAB - sdt=dt>>3; //signed - if(sdt<0) sdt = (sdt<<(dt&7)) - m_pcmtbl[dt&7]; - else sdt = (sdt<<(dt&7)) + m_pcmtbl[dt&7]; - - prevdt=lastdt; - lastdt=sdt; - dltdt=(lastdt - prevdt); + pos = (v->sample_loop - st); + } + else + { + v->key = 0; + break; } - - /* Caclulate the sample value */ - dt=((dltdt*offset)>>16)+prevdt; - - /* Write the data to the sample buffers */ - *lmix++ +=(dt*lvol)>>(5+5); - *rmix++ +=(dt*rvol)>>(5+5); } - } - else - { - /* linear 8bit signed PCM */ - for(j=0;j>16)&0x7fff; - offset &= 0xffff; - pos += cnt; - /* Check for the end of the sample */ - if(pos >= sz) - { - /* Check if its a looping sample, either stop or loop */ - if( v->mode&0x10 ) - { - pos = (v->sample_loop - st); - } - else - { - v->key=0; - break; - } - } - - if( cnt ) - { - prevdt=lastdt; - - if (m_banking_type == C140_TYPE::ASIC219) - { - lastdt = (int8_t) read_byte(sampleData + BYTE_XOR_BE(pos)); - - // Sign + magnitude format - if ((v->mode & 0x01) && (lastdt & 0x80)) - lastdt = -(lastdt & 0x7f); - - // Sign flip - if (v->mode & 0x40) - lastdt = -lastdt; - } - else - { - lastdt = (int8_t) read_byte(sampleData + pos); - } - - dltdt = (lastdt - prevdt); - } - - /* Caclulate the sample value */ - dt=((dltdt*offset)>>16)+prevdt; - - /* Write the data to the sample buffers */ - *lmix++ +=(dt*lvol)>>5; - *rmix++ +=(dt*rvol)>>5; + prevdt = lastdt; + lastdt = ((ch_mulaw(v)) ? m_pcmtbl[read_byte((sampleData + pos) << 1)] : s16(read_word((sampleData + pos) << 1) & 0xfff0)) >> 4; // 12bit + dltdt = (lastdt - prevdt); } + + /* Caclulate the sample value */ + dt = ((dltdt * offset) >> 16) + prevdt; + + /* Write the data to the sample buffers */ + *lmix++ += (dt * lvol) >> (5 + 4); + *rmix++ += (dt * rvol) >> (5 + 4); } /* Save positional data for next callback */ - v->ptoffset=offset; - v->pos=pos; - v->lastdt=lastdt; - v->prevdt=prevdt; - v->dltdt=dltdt; + v->ptoffset = offset; + v->pos = pos; + v->lastdt = lastdt; + v->prevdt = prevdt; + v->dltdt = dltdt; } } @@ -360,9 +325,146 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in { stream_sample_t *dest1 = outputs[0]; stream_sample_t *dest2 = outputs[1]; - for (i = 0; i < samples; i++) + for (int i = 0; i < samples; i++) { - int32_t val; + s32 val; + + val = 8 * (*lmix++); + *dest1++ = limit(val); + val = 8 * (*rmix++); + *dest2++ = limit(val); + } + } +} + +void c219_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +{ + s32 dt; + + float pbase = (float)m_baserate * 2.0f / (float)m_sample_rate; + + s16 *lmix, *rmix; + + if (samples > m_sample_rate) samples = m_sample_rate; + + /* zap the contents of the mixer buffer */ + std::fill_n(&m_mixer_buffer_left[0], samples, 0); + std::fill_n(&m_mixer_buffer_right[0], samples, 0); + + //--- audio update + for (int i = 0; i < 16; i++) + { + C140_VOICE *v = &m_voi[i]; + const struct voice_registers *vreg = (struct voice_registers *)&m_REG[i * 16]; + + if (v->key) + { + const u16 frequency = (vreg->frequency_msb << 8) | vreg->frequency_lsb; + + /* Abort voice if no frequency value set */ + if (frequency == 0) continue; + + /* Delta = frequency * ((8MHz/374)*2 / sample rate) */ + const int delta = (int)((float)frequency * pbase); + + /* Calculate left/right channel volumes */ + const int lvol = (vreg->volume_left * 32) / MAX_VOICE; //32ch -> 24ch + const int rvol = (vreg->volume_right * 32) / MAX_VOICE; + + /* Set mixer outputs base pointers */ + lmix = m_mixer_buffer_left.get(); + rmix = m_mixer_buffer_right.get(); + + /* Retrieve sample start/end and calculate size */ + const int st = v->sample_start; + const int ed = v->sample_end; + const int sz = ed - st; + + /* Retrieve base pointer to the sample data */ + const int sampleData = find_sample(st, v->bank, i); + + /* Fetch back previous data pointers */ + int offset = v->ptoffset; + int pos = v->pos; + s32 lastdt = v->lastdt; + s32 prevdt = v->prevdt; + s32 dltdt = v->dltdt; + + /* linear or compressed 8bit signed PCM */ + for (int j = 0; j < samples; j++) + { + offset += delta; + const int cnt = (offset >> 16) & 0x7fff; + offset &= 0xffff; + pos += cnt; + /* Check for the end of the sample */ + if (pos >= sz) + { + /* Check if its a looping sample, either stop or loop */ + if (ch_looped(v) || ch_noise(v)) + { + pos = (v->sample_loop - st); + } + else + { + v->key = 0; + break; + } + } + + const int shift = ch_noise(v) ? 8 : 3; + if (cnt) + { + prevdt = lastdt; + + if (ch_noise(v)) // noise + { + m_lfsr = (m_lfsr >> 1) ^ ((-(m_lfsr & 1)) & 0xfff6); + lastdt = s16(m_lfsr); + } + else + { + lastdt = s8(read_byte(sampleData + pos)); + // 11 bit mulaw + if (ch_mulaw(v)) + lastdt = m_pcmtbl[lastdt & 0xff] >> 5; + else + lastdt <<= 3; // scale as 11bit + } + + // Sign flip + if (ch_inv_sign(v)) + lastdt = -lastdt; + + dltdt = (lastdt - prevdt); + } + + /* Caclulate the sample value */ + dt = ((dltdt * offset) >> 16) + prevdt; + + /* Write the data to the sample buffers */ + *lmix++ += ((ch_inv_lout(v)) ? -(dt * lvol) : (dt * lvol)) >> (5 + shift); + *rmix++ += (dt * rvol) >> (5 + shift); + } + + /* Save positional data for next callback */ + v->ptoffset = offset; + v->pos = pos; + v->lastdt = lastdt; + v->prevdt = prevdt; + v->dltdt = dltdt; + } + } + + /* render to MAME's stream buffer */ + lmix = m_mixer_buffer_left.get(); + rmix = m_mixer_buffer_right.get(); + { + stream_sample_t *dest1 = outputs[0]; + stream_sample_t *dest2 = outputs[1]; + for (int i = 0; i < samples; i++) + { + s32 val; val = 8 * (*lmix++); *dest1++ = limit(val); @@ -375,7 +477,7 @@ void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **in u8 c140_device::c140_r(offs_t offset) { - offset&=0x1ff; + offset &= 0x1ff; return m_REG[offset]; } @@ -384,58 +486,38 @@ void c140_device::c140_w(offs_t offset, u8 data) { m_stream->update(); - offset&=0x1ff; + offset &= 0x1ff; - // mirror the bank registers on the 219, fixes bkrtmaq (and probably xday2 based on notes in the HLE) - if ((offset >= 0x1f8) && BIT(offset, 0) && (m_banking_type == C140_TYPE::ASIC219)) + m_REG[offset] = data; + if (offset < 0x180) { - offset -= 8; - } + const u8 ch = offset >> 4; + C140_VOICE *v = &m_voi[ch]; - m_REG[offset]=data; - if( offset<0x180 ) - { - C140_VOICE *v = &m_voi[offset>>4]; - - if( (offset&0xf)==0x5 ) + if ((offset & 0xf) == 0x5) { - if( data&0x80 ) + if (data & 0x80) { - const struct voice_registers *vreg = (struct voice_registers *) &m_REG[offset&0x1f0]; - v->key=1; - v->ptoffset=0; - v->pos=0; - v->lastdt=0; - v->prevdt=0; - v->dltdt=0; + const struct voice_registers *vreg = (struct voice_registers *) &m_REG[offset & 0x1f0]; + v->key = 1; + v->ptoffset = 0; + v->pos = 0; + v->lastdt = 0; + v->prevdt = 0; + v->dltdt = 0; v->bank = vreg->bank; v->mode = data; - // on the 219 asic, addresses are in words - if (m_banking_type == C140_TYPE::ASIC219) - { - v->sample_loop = (vreg->loop_msb*256 + vreg->loop_lsb)*2; - v->sample_start = (vreg->start_msb*256 + vreg->start_lsb)*2; - v->sample_end = (vreg->end_msb*256 + vreg->end_lsb)*2; - - #if 0 - logerror("219: play v %d mode %02x start %x loop %x end %x\n", - offset>>4, v->mode, - find_sample(v->sample_start, v->bank, offset>>4), - find_sample(v->sample_loop, v->bank, offset>>4), - find_sample(v->sample_end, v->bank, offset>>4)); - #endif - } - else - { - v->sample_loop = vreg->loop_msb*256 + vreg->loop_lsb; - v->sample_start = vreg->start_msb*256 + vreg->start_lsb; - v->sample_end = vreg->end_msb*256 + vreg->end_lsb; - } + const u32 loop = (vreg->loop_msb << 8) + vreg->loop_lsb; + const u32 start = (vreg->start_msb << 8) + vreg->start_lsb; + const u32 end = (vreg->end_msb << 8) + vreg->end_lsb; + v->sample_loop = loop; + v->sample_start = start; + v->sample_end = end; } else { - v->key=0; + v->key = 0; } } } @@ -466,61 +548,108 @@ void c140_device::c140_w(offs_t offset, u8 data) } +u8 c219_device::c219_r(offs_t offset) +{ + offset &= 0x1ff; + return m_REG[offset]; +} + + +void c219_device::c219_w(offs_t offset, u8 data) +{ + m_stream->update(); + + offset &= 0x1ff; + + // mirror the bank registers on the 219, fixes bkrtmaq (and probably xday2 based on notes in the HLE) + if ((offset >= 0x1f8) && BIT(offset, 0)) + { + offset -= 8; + } + + m_REG[offset] = data; + if (offset < 0x100) // only 16 voices + { + const u8 ch = offset >> 4; + C140_VOICE *v = &m_voi[ch]; + + if ((offset & 0xf) == 0x5) + { + if (data & 0x80) + { + const struct voice_registers *vreg = (struct voice_registers *) &m_REG[offset & 0x1f0]; + v->key = 1; + v->ptoffset = 0; + v->pos = 0; + v->lastdt = 0; + v->prevdt = 0; + v->dltdt = 0; + v->bank = vreg->bank; + v->mode = data; + + const u32 loop = (vreg->loop_msb << 8) + vreg->loop_lsb; + const u32 start = (vreg->start_msb << 8) + vreg->start_lsb; + const u32 end = (vreg->end_msb << 8) + vreg->end_lsb; + // on the 219 asic, addresses are in words + v->sample_loop = loop << 1; + v->sample_start = start << 1; + v->sample_end = end << 1; + + #if 0 + logerror("219: play v %d mode %02x start %x loop %x end %x\n", + ch, v->mode, + find_sample(v->sample_start, v->bank, ch), + find_sample(v->sample_loop, v->bank, ch), + find_sample(v->sample_end, v->bank, ch)); + #endif + } + else + { + v->key = 0; + } + } + } + // TODO: No interrupt/timers? +} + TIMER_CALLBACK_MEMBER(c140_device::int1_on) { m_int1_callback(ASSERT_LINE); } -void c140_device::init_voice( C140_VOICE *v ) +void c140_device::init_voice(C140_VOICE *v) { - v->key=0; - v->ptoffset=0; - v->rvol=0; - v->lvol=0; - v->frequency=0; - v->bank=0; - v->mode=0; - v->sample_start=0; - v->sample_end=0; - v->sample_loop=0; + v->key = 0; + v->ptoffset = 0; + v->rvol = 0; + v->lvol = 0; + v->frequency = 0; + v->bank = 0; + v->mode = 0; + v->sample_start = 0; + v->sample_end = 0; + v->sample_loop = 0; } /* find_sample: compute the actual address of a sample given it's - address and banking registers, as well as the board type. - - I suspect in "real life" this works like the Sega MultiPCM where the banking - is done by a small PAL or GAL external to the sound chip, which can be switched - per-game or at least per-PCB revision as addressing range needs grow. + address and banking registers, as well as the chip type. */ -long c140_device::find_sample(long adrs, long bank, int voice) +int c140_device::find_sample(int adrs, int bank, int voice) { - long newadr = 0; + adrs = (bank << 16) + adrs; - static const int16_t asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 }; - - adrs=(bank<<16)+adrs; - - switch (m_banking_type) - { - case C140_TYPE::SYSTEM2: - // System 2 banking - newadr = ((adrs&0x200000)>>2)|(adrs&0x7ffff); - break; - - case C140_TYPE::SYSTEM21: - // System 21 banking. - // similar to System 2's. - newadr = ((adrs&0x300000)>>1)+(adrs&0x7ffff); - break; - - case C140_TYPE::ASIC219: - // ASIC219's banking is fairly simple - newadr = ((m_REG[asic219banks[voice/4]]&0x3) * 0x20000) + adrs; - break; - } - - return (newadr); + return adrs; +} + +int c219_device::find_sample(int adrs, int bank, int voice) +{ + static const s16 asic219banks[4] = { 0x1f7, 0x1f1, 0x1f3, 0x1f5 }; + + adrs = (bank << 16) + adrs; + + // ASIC219's banking is fairly simple + return ((m_REG[asic219banks[voice / 4]] & 0x3) * 0x20000) + adrs; } diff --git a/src/devices/sound/c140.h b/src/devices/sound/c140.h index 4644e8cc62c..1d3279730ee 100644 --- a/src/devices/sound/c140.h +++ b/src/devices/sound/c140.h @@ -1,6 +1,6 @@ // license:BSD-3-Clause // copyright-holders:R. Belmont -/* C140.h */ +/* c140.h */ #ifndef MAME_SOUND_C140_H #define MAME_SOUND_C140_H @@ -20,23 +20,21 @@ class c140_device : public device_t, public device_rom_interface { public: - enum class C140_TYPE - { - SYSTEM2, - SYSTEM21, - ASIC219 - }; - c140_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // configuration - void set_bank_type(C140_TYPE bank) { m_banking_type = bank; } auto int1_callback() { return m_int1_callback.bind(); } u8 c140_r(offs_t offset); void c140_w(offs_t offset, u8 data); + // little endian: Swap even and odd word + u8 c140_le_r(offs_t offset) { return c140_r(offset ^ 1); } + void c140_le_w(offs_t offset, u8 data) { c140_w(offset ^ 1, data);} + protected: + c140_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + // device-level overrides virtual void device_start() override; virtual void device_clock_changed() override; @@ -46,34 +44,38 @@ protected: // sound stream update overrides virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; -private: + virtual int find_sample(int adrs, int bank, int voice); + static constexpr unsigned MAX_VOICE = 24; struct C140_VOICE { C140_VOICE() { } - int32_t ptoffset = 0; - int32_t pos = 0; - int32_t key = 0; + s32 ptoffset = 0; + s32 pos = 0; + s32 key = 0; //--work - int32_t lastdt = 0; - int32_t prevdt = 0; - int32_t dltdt = 0; + s32 lastdt = 0; + s32 prevdt = 0; + s32 dltdt = 0; //--reg - int32_t rvol = 0; - int32_t lvol = 0; - int32_t frequency = 0; - int32_t bank = 0; - int32_t mode = 0; + s32 rvol = 0; + s32 lvol = 0; + s32 frequency = 0; + s32 bank = 0; + s32 mode = 0; - int32_t sample_start = 0; - int32_t sample_end = 0; - int32_t sample_loop = 0; + s32 sample_start = 0; + s32 sample_end = 0; + s32 sample_loop = 0; }; - void init_voice( C140_VOICE *v ); - long find_sample(long adrs, long bank, int voice); + void init_voice(C140_VOICE *v); + const inline bool ch_looped(C140_VOICE *v) { return BIT(v->mode, 4); } // shared as c140 and c219 + + virtual const inline bool ch_mulaw(C140_VOICE *v) { return BIT(v->mode, 3); } + // bit 6 used, unknown TIMER_CALLBACK_MEMBER(int1_on); @@ -81,21 +83,51 @@ private: int m_sample_rate; sound_stream *m_stream; - C140_TYPE m_banking_type; /* internal buffers */ - std::unique_ptr m_mixer_buffer_left; - std::unique_ptr m_mixer_buffer_right; + std::unique_ptr m_mixer_buffer_left; + std::unique_ptr m_mixer_buffer_right; int m_baserate; - uint8_t m_REG[0x200]; + u8 m_REG[0x200]; - int16_t m_pcmtbl[8]; //2000.06.26 CAB + s16 m_pcmtbl[256]; //2000.06.26 CAB C140_VOICE m_voi[MAX_VOICE]; emu_timer *m_int1_timer; }; +class c219_device : public c140_device +{ +public: + c219_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + u8 c219_r(offs_t offset); + void c219_w(offs_t offset, u8 data); + + // little endian: Swap even and odd word + u8 c219_le_r(offs_t offset) { return c219_r(offset ^ 1); } + void c219_le_w(offs_t offset, u8 data) { c219_w(offset ^ 1, data);} + +protected: + // device-level overrides + virtual void device_start() override; + + // sound stream update overrides + virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; + + virtual int find_sample(int adrs, int bank, int voice) override; + + virtual const inline bool ch_mulaw(C140_VOICE *v) override { return BIT(v->mode, 0); } +private: + // bit 1 used, unknown + const inline bool ch_noise(C140_VOICE *v) { return BIT(v->mode, 2); } + const inline bool ch_inv_lout(C140_VOICE *v) { return BIT(v->mode, 3); } + const inline bool ch_inv_sign(C140_VOICE *v) { return BIT(v->mode, 6); } + u16 m_lfsr; +}; + DECLARE_DEVICE_TYPE(C140, c140_device) +DECLARE_DEVICE_TYPE(C219, c219_device) #endif // MAME_SOUND_C140_H diff --git a/src/devices/sound/c352.cpp b/src/devices/sound/c352.cpp index 142c82349bb..73fe655522d 100644 --- a/src/devices/sound/c352.cpp +++ b/src/devices/sound/c352.cpp @@ -27,7 +27,7 @@ #if C352_LOG_PCM #include -static std::map s_found_pcm; +static std::map s_found_pcm; #endif // device type definition @@ -41,7 +41,7 @@ DEFINE_DEVICE_TYPE(C352, c352_device, "c352", "Namco C352") // c352_device - constructor //------------------------------------------------- -c352_device::c352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +c352_device::c352_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, C352, tag, owner, clock) , device_sound_interface(mconfig, *this) , device_rom_interface(mconfig, *this, 24) @@ -69,14 +69,14 @@ void c352_device::fetch_sample(c352_voice_t& v) } else { - int8_t s = (int8_t)read_byte(v.pos); + s8 s = (s8)read_byte(v.pos); if (v.flags & C352_FLG_MULAW) v.sample = m_mulawtab[s & 0xff]; else v.sample = s << 8; - uint16_t pos = v.pos & 0xffff; + u16 pos = v.pos & 0xffff; if ((v.flags & C352_FLG_LOOP) && v.flags & C352_FLG_REVERSE) { @@ -115,9 +115,9 @@ void c352_device::fetch_sample(c352_voice_t& v) } } -void c352_device::ramp_volume(c352_voice_t &v, int ch, uint8_t val) +void c352_device::ramp_volume(c352_voice_t &v, int ch, u8 val) { - int16_t vol_delta = v.curr_vol[ch] - val; + s16 vol_delta = v.curr_vol[ch] - val; if (vol_delta != 0) v.curr_vol[ch] += (vol_delta > 0) ? -1 : 1; } @@ -131,16 +131,16 @@ void c352_device::sound_stream_update(sound_stream &stream, stream_sample_t **in for (int i = 0; i < samples; i++) { - long out[4] = { 0, 0, 0, 0 }; + int out[4] = { 0, 0, 0, 0 }; for (int j = 0; j < 32; j++) { c352_voice_t &v = m_c352_v[j]; - int16_t s = 0; + s16 s = 0; if (v.flags & C352_FLG_BUSY) { - int32_t next_counter = v.counter + v.freq; + s32 next_counter = v.counter + v.freq; if (next_counter & 0x10000) { @@ -173,32 +173,32 @@ void c352_device::sound_stream_update(sound_stream &stream, stream_sample_t **in out[3] += (((v.flags & C352_FLG_PHASEFR) ? -s : s) * v.curr_vol[3]) >> 8; } - *buffer_fl++ = (int16_t)(out[0] >> 3); - *buffer_fr++ = (int16_t)(out[1] >> 3); - *buffer_rl++ = (int16_t)(out[2] >> 3); - *buffer_rr++ = (int16_t)(out[3] >> 3); + *buffer_fl++ = (s16)(out[0] >> 3); + *buffer_fr++ = (s16)(out[1] >> 3); + *buffer_rl++ = (s16)(out[2] >> 3); + *buffer_rr++ = (s16)(out[3] >> 3); } } -uint16_t c352_device::read_reg16(unsigned long address) +u16 c352_device::read_reg16(offs_t offset) { m_stream->update(); const int reg_map[8] = { - offsetof(c352_voice_t, vol_f) / sizeof(uint16_t), - offsetof(c352_voice_t, vol_r) / sizeof(uint16_t), - offsetof(c352_voice_t, freq) / sizeof(uint16_t), - offsetof(c352_voice_t, flags) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_bank) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_start) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_end) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_loop) / sizeof(uint16_t), + offsetof(c352_voice_t, vol_f) / sizeof(u16), + offsetof(c352_voice_t, vol_r) / sizeof(u16), + offsetof(c352_voice_t, freq) / sizeof(u16), + offsetof(c352_voice_t, flags) / sizeof(u16), + offsetof(c352_voice_t, wave_bank) / sizeof(u16), + offsetof(c352_voice_t, wave_start) / sizeof(u16), + offsetof(c352_voice_t, wave_end) / sizeof(u16), + offsetof(c352_voice_t, wave_loop) / sizeof(u16), }; - if (address < 0x100) - return *((uint16_t*)&m_c352_v[address / 8] + reg_map[address % 8]); - else if (address == 0x200) + if (offset < 0x100) + return *((u16*)&m_c352_v[offset / 8] + reg_map[offset % 8]); + else if (offset == 0x200) return m_control; else return 0; @@ -206,33 +206,38 @@ uint16_t c352_device::read_reg16(unsigned long address) return 0; } -void c352_device::write_reg16(unsigned long address, unsigned short val) +void c352_device::write_reg16(offs_t offset, u16 data, u16 mem_mask) { m_stream->update(); const int reg_map[8] = { - offsetof(c352_voice_t, vol_f) / sizeof(uint16_t), - offsetof(c352_voice_t, vol_r) / sizeof(uint16_t), - offsetof(c352_voice_t, freq) / sizeof(uint16_t), - offsetof(c352_voice_t, flags) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_bank) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_start) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_end) / sizeof(uint16_t), - offsetof(c352_voice_t, wave_loop) / sizeof(uint16_t), + offsetof(c352_voice_t, vol_f) / sizeof(u16), + offsetof(c352_voice_t, vol_r) / sizeof(u16), + offsetof(c352_voice_t, freq) / sizeof(u16), + offsetof(c352_voice_t, flags) / sizeof(u16), + offsetof(c352_voice_t, wave_bank) / sizeof(u16), + offsetof(c352_voice_t, wave_start) / sizeof(u16), + offsetof(c352_voice_t, wave_end) / sizeof(u16), + offsetof(c352_voice_t, wave_loop) / sizeof(u16), }; - if (address < 0x100) + if (offset < 0x100) { - *((uint16_t*)&m_c352_v[address / 8] + reg_map[address % 8]) = val; + u16 newval = read_reg16(offset); + COMBINE_DATA(&newval); + *((u16*)&m_c352_v[offset / 8] + reg_map[offset % 8]) = newval; } - else if (address == 0x200) + else if (offset == 0x200) { - m_control = val; - logerror("C352 control register write: %04x\n",val); + COMBINE_DATA(&m_control); + logerror("C352 control register write: %04x & %04x\n", data, mem_mask); } - else if (address == 0x202) // execute keyons/keyoffs + else if (offset == 0x202) // execute keyons/keyoffs { + if (mem_mask != 0xffff) // 16 bit only? + return; + for (int i = 0; i < 32; i++) { if (m_c352_v[i].flags & C352_FLG_KEYON) @@ -252,7 +257,7 @@ void c352_device::write_reg16(unsigned long address, unsigned short val) #if C352_LOG_PCM if (!(m_c352_v[i].flags & C352_FLG_NOISE)) { - std::map::iterator iter = s_found_pcm.find(m_c352_v[i].pos); + std::map::iterator iter = s_found_pcm.find(m_c352_v[i].pos); if (iter != s_found_pcm.end()) { return; @@ -266,27 +271,27 @@ void c352_device::write_reg16(unsigned long address, unsigned short val) if (file != nullptr) { c352_voice_t &v = m_c352_v[i]; - uint32_t pos = v.pos; - uint32_t flags = v.flags; - uint32_t counter = v.counter; - int16_t sample = 0; + u32 pos = v.pos; + u32 flags = v.flags; + u32 counter = v.counter; + s16 sample = 0; while (pos != v.wave_end && !(flags & C352_FLG_KEYOFF)) { - int32_t next_counter = counter + v.freq; + s32 next_counter = counter + v.freq; if (next_counter & 0x10000) { counter = next_counter & 0xffff; - int8_t s = (int8_t)read_byte(pos); + s8 s = (s8)read_byte(pos); if (v.flags & C352_FLG_MULAW) sample = m_mulawtab[s & 0xff]; else sample = s << 8; - uint16_t subpos = pos & 0xffff; + u16 subpos = pos & 0xffff; if ((flags & C352_FLG_LOOP) && flags & C352_FLG_REVERSE) { @@ -382,22 +387,20 @@ void c352_device::device_start() m_mulawtab[i + 128] = (~m_mulawtab[i]) & 0xffe0; // register save state info - for (int i = 0; i < 32; i++) - { - save_item(NAME(m_c352_v[i].pos), i); - save_item(NAME(m_c352_v[i].counter), i); - save_item(NAME(m_c352_v[i].sample), i); - save_item(NAME(m_c352_v[i].last_sample), i); - save_item(NAME(m_c352_v[i].vol_f), i); - save_item(NAME(m_c352_v[i].vol_r), i); - save_item(NAME(m_c352_v[i].curr_vol), i); - save_item(NAME(m_c352_v[i].freq), i); - save_item(NAME(m_c352_v[i].flags), i); - save_item(NAME(m_c352_v[i].wave_bank), i); - save_item(NAME(m_c352_v[i].wave_start), i); - save_item(NAME(m_c352_v[i].wave_end), i); - save_item(NAME(m_c352_v[i].wave_loop), i); - } + save_item(STRUCT_MEMBER(m_c352_v, pos)); + save_item(STRUCT_MEMBER(m_c352_v, counter)); + save_item(STRUCT_MEMBER(m_c352_v, sample)); + save_item(STRUCT_MEMBER(m_c352_v, last_sample)); + save_item(STRUCT_MEMBER(m_c352_v, vol_f)); + save_item(STRUCT_MEMBER(m_c352_v, vol_r)); + save_item(STRUCT_MEMBER(m_c352_v, curr_vol)); + save_item(STRUCT_MEMBER(m_c352_v, freq)); + save_item(STRUCT_MEMBER(m_c352_v, flags)); + save_item(STRUCT_MEMBER(m_c352_v, wave_bank)); + save_item(STRUCT_MEMBER(m_c352_v, wave_start)); + save_item(STRUCT_MEMBER(m_c352_v, wave_end)); + save_item(STRUCT_MEMBER(m_c352_v, wave_loop)); + save_item(NAME(m_random)); save_item(NAME(m_control)); } @@ -419,12 +422,5 @@ READ16_MEMBER( c352_device::read ) WRITE16_MEMBER( c352_device::write ) { - if (mem_mask == 0xffff) - { - write_reg16(offset, data); - } - else - { - logerror("C352: byte-wide write unsupported at this time!\n"); - } + write_reg16(offset, data, mem_mask); } diff --git a/src/devices/sound/c352.h b/src/devices/sound/c352.h index 9a97dd78622..e5cc155dae5 100644 --- a/src/devices/sound/c352.h +++ b/src/devices/sound/c352.h @@ -18,13 +18,13 @@ class c352_device : public device_t, { public: // construction/destruction - c352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, int divider) + c352_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, int divider) : c352_device(mconfig, tag, owner, clock) { set_divider(divider); } - c352_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + c352_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); void set_divider(int divider) { m_divider = divider; } @@ -67,31 +67,31 @@ private: struct c352_voice_t { - uint32_t pos; - uint32_t counter; + u32 pos; + u32 counter; - int16_t sample; - int16_t last_sample; + s16 sample; + s16 last_sample; - uint16_t vol_f; - uint16_t vol_r; - uint8_t curr_vol[4]; + u16 vol_f; + u16 vol_r; + u8 curr_vol[4]; - uint16_t freq; - uint16_t flags; + u16 freq; + u16 flags; - uint16_t wave_bank; - uint16_t wave_start; - uint16_t wave_end; - uint16_t wave_loop; + u16 wave_bank; + u16 wave_start; + u16 wave_end; + u16 wave_loop; }; void fetch_sample(c352_voice_t &v); - void ramp_volume(c352_voice_t &v, int ch, uint8_t val); + void ramp_volume(c352_voice_t &v, int ch, u8 val); - unsigned short read_reg16(unsigned long address); - void write_reg16(unsigned long address, unsigned short val); + u16 read_reg16(offs_t offset); + void write_reg16(offs_t offset, u16 data, u16 mem_mask = 0); sound_stream *m_stream; @@ -100,10 +100,10 @@ private: c352_voice_t m_c352_v[32]; - int16_t m_mulawtab[256]; + s16 m_mulawtab[256]; - uint16_t m_random; - uint16_t m_control; // control flags, purpose unknown. + u16 m_random; + u16 m_control; // control flags, purpose unknown. }; diff --git a/src/devices/sound/pokey.h b/src/devices/sound/pokey.h index 75a62df413f..47ad6519ab8 100644 --- a/src/devices/sound/pokey.h +++ b/src/devices/sound/pokey.h @@ -16,8 +16,6 @@ #pragma once -#include "machine/rescap.h" - /* * ATARI Pokey (CO12294) pin-out * diff --git a/src/devices/video/scn2674.cpp b/src/devices/video/scn2674.cpp index 568347567dc..17fc68c6b9a 100644 --- a/src/devices/video/scn2674.cpp +++ b/src/devices/video/scn2674.cpp @@ -661,17 +661,17 @@ void scn2674_device::write_delayed_command(uint8_t data) { case 0xa4: // read at pointer address - m_char_buffer = m_char_space->read_byte(m_screen2_address); + m_char_buffer = m_char_space->read_byte(m_display_pointer_address); if (m_attr_space != nullptr) - m_attr_buffer = m_attr_space->read_byte(m_screen2_address); + m_attr_buffer = m_attr_space->read_byte(m_display_pointer_address); LOGMASKED(LOG_COMMAND, "%s: DELAYED read at pointer address %02x\n", machine().describe_context(), data); break; case 0xa2: // write at pointer address - m_char_space->write_byte(m_screen2_address, m_char_buffer); + m_char_space->write_byte(m_display_pointer_address, m_char_buffer); if (m_attr_space != nullptr) - m_attr_space->write_byte(m_screen2_address, m_attr_buffer); + m_attr_space->write_byte(m_display_pointer_address, m_attr_buffer); LOGMASKED(LOG_COMMAND, "%s: DELAYED write at pointer address %02x\n", machine().describe_context(), data); break; @@ -730,7 +730,7 @@ void scn2674_device::write_delayed_command(uint8_t data) m_display_enabled = false; m_display_enabled_field = true; m_display_enabled_scanline = false; - for (i = m_cursor_address; i != m_screen2_address; i = ((i + 1) & 0xffff)) + for (i = m_cursor_address; i != m_display_pointer_address; i = ((i + 1) & 0xffff)) { m_char_space->write_byte(i, m_char_buffer); if (m_attr_space != nullptr) @@ -739,7 +739,7 @@ void scn2674_device::write_delayed_command(uint8_t data) m_char_space->write_byte(i, m_char_buffer); // get the last if (m_attr_space != nullptr) m_attr_space->write_byte(i, m_attr_buffer); - m_cursor_address = m_screen2_address; + m_cursor_address = m_display_pointer_address; LOGMASKED(LOG_COMMAND, "%s: DELAYED write from cursor address to pointer address %02x\n", machine().describe_context(), data); break; @@ -963,15 +963,30 @@ void scn2674_device::write(offs_t offset, uint8_t data) break; case 6: - m_screen2_address = (m_screen2_address & 0x3f00) | data; - break; - case 7: + write_screen2_address(BIT(offset, 0), data); + break; + } +} + +void scn2674_device::write_screen2_address(bool msb, uint8_t data) +{ + if (msb) + { m_screen2_address = (m_screen2_address & 0x00ff) | (data & 0x3f) << 8; m_spl[0] = BIT(data, 6); m_spl[1] = BIT(data, 7); - break; } + else + m_screen2_address = (m_screen2_address & 0x3f00) | data; +} + +void scn2672_device::write_screen2_address(bool msb, uint8_t data) +{ + if (msb) + m_display_pointer_address = (m_display_pointer_address & 0x00ff) | (data & 0x3f) << 8; + else + m_display_pointer_address = (m_display_pointer_address & 0x3f00) | data; } void scn2674_device::recompute_parameters() diff --git a/src/devices/video/scn2674.h b/src/devices/video/scn2674.h index f3bd19b406a..ebcea6915b8 100644 --- a/src/devices/video/scn2674.h +++ b/src/devices/video/scn2674.h @@ -119,6 +119,7 @@ protected: void write_interrupt_mask(bool enabled, uint8_t bits); void write_delayed_command(uint8_t data); void write_command(uint8_t data); + virtual void write_screen2_address(bool msb, uint8_t data); void recompute_parameters(); @@ -141,6 +142,7 @@ public: protected: virtual void write_init_regs(uint8_t data) override; + virtual void write_screen2_address(bool msb, uint8_t data) override; }; diff --git a/src/devices/video/sed1500.cpp b/src/devices/video/sed1500.cpp new file mode 100644 index 00000000000..57d6fe5f281 --- /dev/null +++ b/src/devices/video/sed1500.cpp @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + +Epson SED1500 series LCD Driver +128 bytes internal RAM. + +SED1500: 8 commons, 42 segments +SED1501: 10 commons, 40 segments +SED1502: 16 commons, 34 segments +SED1503: 8 commons, 42 segments, needs multiple of 2 chips to function + +The default input OSC frequency is 32768Hz, the frame output frequency is +divided by 64 and by number of commons, eg. 64Hz on a SED1500. + +TODO: +- bus mode (only mode 3 now) +- EI pin (master/slave mode) +- SYNC pin, used for frame synchronizing if multiple chips are used +- SED1503 only has 8 COM pins, the extra 8 outputs are from the slave chip + +*/ + +#include "emu.h" +#include "video/sed1500.h" + + +DEFINE_DEVICE_TYPE(SED1500, sed1500_device, "sed1500", "Epson SED1500 LCD Driver") +DEFINE_DEVICE_TYPE(SED1501, sed1501_device, "sed1501", "Epson SED1501 LCD Driver") +DEFINE_DEVICE_TYPE(SED1502, sed1502_device, "sed1502", "Epson SED1502 LCD Driver") +DEFINE_DEVICE_TYPE(SED1503, sed1503_device, "sed1503", "Epson SED1503 LCD Driver") + +//------------------------------------------------- +// constructor +//------------------------------------------------- + +sed1500_device::sed1500_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cmax, u8 smax) : + device_t(mconfig, type, tag, owner, clock), + m_cmax(cmax), m_smax(smax), + m_write_segs(*this) +{ } + +sed1500_device::sed1500_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sed1500_device(mconfig, SED1500, tag, owner, clock, 8, 42) +{ } + +sed1501_device::sed1501_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sed1500_device(mconfig, SED1501, tag, owner, clock, 10, 40) +{ } + +sed1502_device::sed1502_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sed1500_device(mconfig, SED1502, tag, owner, clock, 16, 34) +{ } + +sed1503_device::sed1503_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : + sed1500_device(mconfig, SED1503, tag, owner, clock, 8+8, 42) +{ } + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void sed1500_device::device_start() +{ + memset(m_ram, 0, sizeof(m_ram)); + + // resolve callbacks + m_write_segs.resolve_safe(); + + // timer + m_lcd_timer = timer_alloc(); + attotime period = attotime::from_hz(clock() / 64); + m_lcd_timer->adjust(period, 0, period); + + // register for savestates + save_item(NAME(m_mode)); + save_item(NAME(m_cout)); + save_item(NAME(m_ram)); +} + + +//------------------------------------------------- +// handlers +//------------------------------------------------- + +void sed1500_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + u64 data = 0; + + for (int i = m_smax-1; i >= 0; i--) + data = data << 1 | BIT(m_ram[i | 0x40] << 8 | m_ram[i], m_cout); + + // transfer segments to output + m_write_segs(m_cout, data); + m_cout = (m_cout + 1) % m_cmax; +} + +void sed1500_device::write(offs_t offset, u8 data) +{ + offset &= 0x7f; + m_ram[offset] = data; + + // bus mode command: + // 0 = 4-bit addr, 4-bit data, combined + // 1 = 7-bit addr, 4-bit data, separate + // 2 = 7-bit addr, 8-bit data, combined + // 3 = 7-bit addr, 8-bit data, separate + if ((offset & 0x3f) == 0x3f && ~data & 1) + m_mode = data >> 1 & 3; +} + +u8 sed1500_device::read(offs_t offset) +{ + return m_ram[offset & 0x7f]; +} diff --git a/src/devices/video/sed1500.h b/src/devices/video/sed1500.h new file mode 100644 index 00000000000..e26360966bb --- /dev/null +++ b/src/devices/video/sed1500.h @@ -0,0 +1,85 @@ +// license:BSD-3-Clause +// copyright-holders:hap +/* + + Epson SED1500 series LCD Driver + +*/ + +#ifndef MAME_VIDEO_SED1500_H +#define MAME_VIDEO_SED1500_H + +#pragma once + +/* + +pinout reference (brief) + +OSC: oscillator (resistors or XTAL) +A0-A6: address +D0-D7: data (I/O) +WR/RD: write/read signal +CS: chip select +SYNC: frame synchronize (I/O) + +CL: OSC output +COM: LCD commons +SEG: LCD segments + +*/ + +class sed1500_device : public device_t +{ +public: + sed1500_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // configuration helpers + auto write_segs() { return m_write_segs.bind(); } // common number in offset, segment data in data + + void write(offs_t offset, u8 data); + u8 read(offs_t offset); + +protected: + sed1500_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, u8 cmax, u8 smax); + + // device-level overrides + virtual void device_start() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + + emu_timer *m_lcd_timer; + + const u8 m_cmax; // number of COL pins + const u8 m_smax; // number of SEG pins + u8 m_mode = 0; + u8 m_cout = 0; + u8 m_ram[0x80]; + + // callbacks + devcb_write64 m_write_segs; +}; + +class sed1501_device : public sed1500_device +{ +public: + sed1501_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class sed1502_device : public sed1500_device +{ +public: + sed1502_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class sed1503_device : public sed1500_device +{ +public: + sed1503_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + + +DECLARE_DEVICE_TYPE(SED1500, sed1500_device) +DECLARE_DEVICE_TYPE(SED1501, sed1501_device) +DECLARE_DEVICE_TYPE(SED1502, sed1502_device) +DECLARE_DEVICE_TYPE(SED1503, sed1503_device) + +#endif // MAME_VIDEO_SED1500_H diff --git a/src/emu/attotime.cpp b/src/emu/attotime.cpp index bda9a5b7a24..6624872a4b6 100644 --- a/src/emu/attotime.cpp +++ b/src/emu/attotime.cpp @@ -153,3 +153,20 @@ const char *attotime::as_string(int precision) const } return buffer; } + +//------------------------------------------------- +// to_string - return a human-readable string +// describing an attotime for use in logs +//------------------------------------------------- + +std::string attotime::to_string() const +{ + attotime t = *this; + const char *sign = ""; + if(t.seconds() < 0) { + t = attotime::zero-t; + sign = "-"; + } + int nsec = t.attoseconds() / ATTOSECONDS_PER_NANOSECOND; + return util::string_format("%s%04d.%03d,%03d,%03d", sign, int(t.seconds()), nsec/1000000, (nsec/1000)%1000, nsec % 1000); +} diff --git a/src/emu/attotime.h b/src/emu/attotime.h index cce1cb5e836..be75c48615c 100644 --- a/src/emu/attotime.h +++ b/src/emu/attotime.h @@ -122,6 +122,9 @@ public: /** Convert to string using at @p precision */ const char *as_string(int precision = 9) const; + /** Convert to string for human readability in logs */ + std::string to_string() const; + /** @return the attoseconds portion. */ constexpr attoseconds_t attoseconds() const noexcept { return m_attoseconds; } /** @return the seconds portion. */ diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp index 5af1288ddb8..01d2f462d50 100644 --- a/src/emu/debug/debugcmd.cpp +++ b/src/emu/debug/debugcmd.cpp @@ -157,8 +157,8 @@ debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu m_console.register_command("gv", CMDFLAG_NONE, 0, 0, 0, std::bind(&debugger_commands::execute_go_vblank, this, _1, _2)); m_console.register_command("gint", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_interrupt, this, _1, _2)); m_console.register_command("gi", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_interrupt, this, _1, _2)); - m_console.register_command("gex", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_exception, this, _1, _2)); - m_console.register_command("ge", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_exception, this, _1, _2)); + m_console.register_command("gex", CMDFLAG_NONE, 0, 0, 2, std::bind(&debugger_commands::execute_go_exception, this, _1, _2)); + m_console.register_command("ge", CMDFLAG_NONE, 0, 0, 2, std::bind(&debugger_commands::execute_go_exception, this, _1, _2)); m_console.register_command("gtime", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_time, this, _1, _2)); m_console.register_command("gt", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_time, this, _1, _2)); m_console.register_command("gp", CMDFLAG_NONE, 0, 0, 1, std::bind(&debugger_commands::execute_go_privilege, this, _1, _2)); @@ -899,7 +899,11 @@ void debugger_commands::execute_go_exception(int ref, const std::vector 0 && !validate_number_parameter(params[0], exception)) return; - m_cpu.get_visible_cpu()->debug()->go_exception(exception); + parsed_expression condition(m_cpu.get_visible_cpu()->debug()->symtable()); + if (params.size() > 1 && !debug_command_parameter_expression(params[1], condition)) + return; + + m_cpu.get_visible_cpu()->debug()->go_exception(exception, (condition.is_empty()) ? "1" : condition.original_string()); } diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp index 35b142d1fa2..fb5db3ffb89 100644 --- a/src/emu/debug/debugcpu.cpp +++ b/src/emu/debug/debugcpu.cpp @@ -1146,8 +1146,15 @@ void debugger_cpu::start_hook(device_t *device, bool stop_on_vblank) assert(m_livecpu == nullptr); m_livecpu = device; + // can't stop on a device without a state interface + if (m_execution_state == exec_state::STOPPED && dynamic_cast(device) == nullptr) + { + if (m_stop_when_not_device == nullptr) + m_stop_when_not_device = device; + m_execution_state = exec_state::RUNNING; + } // if we're a new device, stop now - if (m_stop_when_not_device != nullptr && m_stop_when_not_device != device) + else if (m_stop_when_not_device != nullptr && m_stop_when_not_device != device && device->debug()->observing()) { m_stop_when_not_device = nullptr; m_execution_state = exec_state::STOPPED; @@ -1163,7 +1170,7 @@ void debugger_cpu::start_hook(device_t *device, bool stop_on_vblank) m_machine.debug_view().flush_osd_updates(); m_last_periodic_update_time = osd_ticks(); } - else if (device == m_breakcpu) + if (device == m_breakcpu) { // check for pending breaks m_execution_state = exec_state::STOPPED; m_breakcpu = nullptr; @@ -1183,7 +1190,10 @@ void debugger_cpu::start_hook(device_t *device, bool stop_on_vblank) } // check for debug keypresses if (m_machine.ui_input().pressed(IPT_UI_DEBUG_BREAK)) + { + m_visiblecpu->debug()->ignore(false); m_visiblecpu->debug()->halt_on_next_instruction("User-initiated break\n"); + } } } @@ -1191,6 +1201,13 @@ void debugger_cpu::stop_hook(device_t *device) { assert(m_livecpu == device); + // if we are supposed to be stopped at this point (most likely because of a watchpoint), keep going until this CPU is live again + if (m_execution_state == exec_state::STOPPED) + { + m_breakcpu = device; + m_execution_state = exec_state::RUNNING; + } + // clear the live CPU m_livecpu = nullptr; } @@ -1492,9 +1509,25 @@ void device_debug::exception_hook(int exception) // see if this matches an exception breakpoint if ((m_flags & DEBUG_FLAG_STOP_EXCEPTION) != 0 && (m_stopexception == -1 || m_stopexception == exception)) { - m_device.machine().debugger().cpu().set_execution_stopped(); - m_device.machine().debugger().console().printf("Stopped on exception (CPU '%s', exception %d)\n", m_device.tag(), exception); - compute_debug_flags(); + bool matched = true; + if (m_exception_condition && !m_exception_condition->is_empty()) + { + try + { + matched = m_exception_condition->execute(); + } + catch (expression_error &) + { + return; + } + } + + if (matched) + { + m_device.machine().debugger().cpu().set_execution_stopped(); + m_device.machine().debugger().console().printf("Stopped on exception (CPU '%s', exception %d, PC=%X)\n", m_device.tag(), exception, m_state->pcbase()); + compute_debug_flags(); + } } } @@ -1506,18 +1539,18 @@ void device_debug::exception_hook(int exception) void device_debug::privilege_hook() { - bool matched = 1; - if ((m_flags & DEBUG_FLAG_STOP_PRIVILEGE) != 0) { + bool matched = true; if (m_privilege_condition && !m_privilege_condition->is_empty()) { try { matched = m_privilege_condition->execute(); } - catch (...) + catch (expression_error &) { + return; } } @@ -1840,12 +1873,13 @@ void device_debug::go_next_device() // exception fires on the visible CPU //------------------------------------------------- -void device_debug::go_exception(int exception) +void device_debug::go_exception(int exception, const char *condition) { assert(m_exec != nullptr); m_device.machine().rewind_invalidate(); m_stopexception = exception; + m_exception_condition = std::make_unique(m_symtable, condition); m_flags |= DEBUG_FLAG_STOP_EXCEPTION; m_device.machine().debugger().cpu().set_execution_running(); } @@ -2956,6 +2990,7 @@ void device_debug::watchpoint::triggered(read_or_write type, offs_t address, u64 } // halt in the debugger by default + bool was_stopped = debug.cpu().is_stopped(); debug.cpu().set_execution_stopped(); // evaluate the action @@ -2965,19 +3000,28 @@ void device_debug::watchpoint::triggered(read_or_write type, offs_t address, u64 // print a notification, unless the action made us go again if (debug.cpu().is_stopped()) { - offs_t pc = m_space.device().state().pcbase(); std::string buffer; buffer = string_format(type == read_or_write::READ ? - "Stopped at watchpoint %X reading %0*X from %08X (PC=%X)" : - "Stopped at watchpoint %X writing %0*X to %08X (PC=%X)", + "Stopped at watchpoint %X reading %0*X from %08X" : + "Stopped at watchpoint %X writing %0*X to %08X", m_index, size * unit_size / 4, data, - address, - pc); - debug.console().printf("%s\n", buffer); - m_debugInterface->compute_debug_flags(); + address); + + if (debug.cpu().live_cpu() == &m_space.device()) + { + offs_t pc = m_space.device().state().pcbase(); + debug.console().printf("%s (PC=%X)\n", buffer, pc); + m_debugInterface->compute_debug_flags(); + } + else if (!was_stopped) + { + debug.console().printf("%s\n", buffer); + debug.cpu().set_execution_running(); + debug.cpu().set_break_cpu(&m_space.device()); + } m_debugInterface->set_triggered_watchpoint(this); } diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h index 8c8a5cc1cbb..36b718c6a16 100644 --- a/src/emu/debug/debugcpu.h +++ b/src/emu/debug/debugcpu.h @@ -201,7 +201,7 @@ public: void go(offs_t targetpc = ~0); void go_vblank(); void go_interrupt(int irqline = -1); - void go_exception(int exception); + void go_exception(int exception, const char *condition); void go_milliseconds(u64 milliseconds); void go_privilege(const char *condition); void go_next_device(); @@ -320,6 +320,7 @@ private: int m_stopirq; // stop IRQ number for DEBUG_FLAG_STOP_INTERRUPT int m_stopexception; // stop exception number for DEBUG_FLAG_STOP_EXCEPTION std::unique_ptr m_privilege_condition; // expression to evaluate on privilege change + std::unique_ptr m_exception_condition; // expression to evaluate on exception hit attotime m_endexectime; // ending time of the current execution u64 m_total_cycles; // current total cycles u64 m_last_total_cycles; // last total cycles diff --git a/src/emu/debug/debughlp.cpp b/src/emu/debug/debughlp.cpp index 8eb65554f90..4a6b265628e 100644 --- a/src/emu/debug/debughlp.cpp +++ b/src/emu/debug/debughlp.cpp @@ -137,7 +137,7 @@ static const help_item static_help_list[] = " o[ver] [=1] -- single steps over instructions (F10)\n" " out -- single steps until the current subroutine/exception handler is exited (Shift-F11)\n" " g[o] [
] -- resumes execution, sets temp breakpoint at
(F5)\n" - " ge[x] [] -- resumes execution, setting temp breakpoint if is raised\n" + " ge[x] [[,]] -- resumes execution, setting temp breakpoint if is raised\n" " gi[nt] [] -- resumes execution, setting temp breakpoint if is taken (F7)\n" " gt[ime] -- resumes execution until the given delay has elapsed\n" " gv[blank] -- resumes execution, setting temp breakpoint on the next VBLANK (F8)\n" diff --git a/src/emu/diimage.cpp b/src/emu/diimage.cpp index 8a38739933a..d8235569d1d 100644 --- a/src/emu/diimage.cpp +++ b/src/emu/diimage.cpp @@ -195,7 +195,7 @@ void device_image_interface::set_image_filename(const std::string &filename) auto iter = std::find_if( m_image_name.rbegin(), m_image_name.rend(), - [](char c) { return (c == '\\') || (c == '/') || (c == ':'); }); + [](char c) { return (c == '\\') || (c == '/'); }); if (iter != m_image_name.rend()) m_basename.assign(iter.base(), m_image_name.end()); diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp index 29c05730c2f..ce7391c67cd 100644 --- a/src/emu/natkeyboard.cpp +++ b/src/emu/natkeyboard.cpp @@ -644,32 +644,33 @@ void natural_keyboard::build_codes(ioport_manager &manager) { if (((code < UCHAR_SHIFT_BEGIN) || (code > UCHAR_SHIFT_END)) && (code != 0)) { - // prefer lowest shift state keycode_map::iterator const found(m_keycode_map.find(code)); - if ((m_keycode_map.end() == found) || (found->second.shift > curshift)) + keycode_map_entry newcode; + std::fill(std::begin(newcode.field), std::end(newcode.field), nullptr); + newcode.shift = curshift; + newcode.condition = field.condition(); + + unsigned fieldnum = 0; + for (unsigned i = 0, bits = curshift; (i < SHIFT_COUNT) && bits; ++i, bits >>= 1) { - keycode_map_entry newcode; - std::fill(std::begin(newcode.field), std::end(newcode.field), nullptr); - newcode.shift = curshift; + if (BIT(bits, 0)) + newcode.field[fieldnum++] = shift[i]; + } - unsigned fieldnum = 0; - for (unsigned i = 0, bits = curshift; (i < SHIFT_COUNT) && bits; ++i, bits >>= 1) - { - if (BIT(bits, 0)) - newcode.field[fieldnum++] = shift[i]; - } + newcode.field[fieldnum] = &field; + if (m_keycode_map.end() == found) + { + keycode_map_list map_list; + map_list.emplace_back(newcode); + m_keycode_map.emplace(code, map_list); + } + else + found->second.emplace_back(newcode); - newcode.field[fieldnum] = &field; - if (m_keycode_map.end() == found) - m_keycode_map.emplace(code, newcode); - else - found->second = newcode; - - if (LOG_NATURAL_KEYBOARD) - { - machine().logerror("natural_keyboard: code=%u (%s) port=%p field.name='%s'\n", - code, unicode_to_string(code), (void *)&port, field.name()); - } + if (LOG_NATURAL_KEYBOARD) + { + machine().logerror("natural_keyboard: code=%u (%s) port=%p field.name='%s'\n", + code, unicode_to_string(code), (void *)&port, field.name()); } } } @@ -879,7 +880,13 @@ std::string natural_keyboard::unicode_to_string(char32_t ch) const const natural_keyboard::keycode_map_entry *natural_keyboard::find_code(char32_t ch) const { keycode_map::const_iterator const found(m_keycode_map.find(ch)); - return (m_keycode_map.end() != found) ? &found->second : nullptr; + if (m_keycode_map.end() == found) return nullptr; + for(const keycode_map_entry &entry : found->second) + { + if (entry.condition.eval()) + return &entry; + } + return nullptr; } @@ -901,13 +908,16 @@ void natural_keyboard::dump(std::ostream &str) const // pad with spaces util::stream_format(str, "%-*s", left_column_width, description); - // identify the keys used - for (std::size_t field = 0; (code.second.field.size() > field) && code.second.field[field]; ++field) - util::stream_format(str, "%s'%s'", first ? "" : ", ", code.second.field[field]->name()); + for (auto &entry : code.second) + { + // identify the keys used + for (std::size_t field = 0; (entry.field.size() > field) && entry.field[field]; ++field) + util::stream_format(str, "%s'%s'", first ? "" : ", ", entry.field[field]->name()); - // carriage return - str << '\n'; - first = false; + // carriage return + str << '\n'; + first = false; + } } } diff --git a/src/emu/natkeyboard.h b/src/emu/natkeyboard.h index 23abd9ac437..d99e0cdf009 100644 --- a/src/emu/natkeyboard.h +++ b/src/emu/natkeyboard.h @@ -74,8 +74,10 @@ private: { std::array field; unsigned shift; + ioport_condition condition; }; - typedef std::unordered_map keycode_map; + typedef std::list keycode_map_list; + typedef std::unordered_map keycode_map; // internal helpers void build_codes(ioport_manager &manager); diff --git a/src/emu/schedule.h b/src/emu/schedule.h index b7658c682ac..67f6d945898 100644 --- a/src/emu/schedule.h +++ b/src/emu/schedule.h @@ -24,17 +24,6 @@ #define TIMER_CALLBACK_MEMBER(name) void name(void *ptr, s32 param) -// macro for the RC time constant on a 74LS123 with C > 1000pF -// R is in ohms, C is in farads -#define TIME_OF_74LS123(r,c) (0.45 * (double)(r) * (double)(c)) - -// macros for the RC time constant on a 555 timer IC -// R is in ohms, C is in farads -#define PERIOD_OF_555_MONOSTABLE_NSEC(r,c) ((attoseconds_t)(1100000000 * (double)(r) * (double)(c))) -#define PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c) ((attoseconds_t)( 693000000 * ((double)(r1) + 2.0 * (double)(r2)) * (double)(c))) -#define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c)) -#define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c)) - //************************************************************************** // TYPE DEFINITIONS diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index c4b8a8c13dc..8796f2cefee 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -243,6 +243,7 @@ const double XTAL::known_xtals[] = { 16'128'000, /* 16.128_MHz_XTAL Fujitsu FM-7 */ 16'200'000, /* 16.2_MHz_XTAL Debut */ 16'257'000, /* 16.257_MHz_XTAL IBM PC MDA & EGA */ + 16'313'000, /* 16.313_MHz_XTAL Micro-Term ERGO 201 */ 16'364'000, /* 16.364_MHz_XTAL Corvus Concept */ 16'384'000, /* 16.384_MHz_XTAL - */ 16'400'000, /* 16.4_MHz_XTAL MS 6102 */ diff --git a/src/lib/formats/hxchfe_dsk.cpp b/src/lib/formats/hxchfe_dsk.cpp index 3fa42793a01..8e51af8a825 100644 --- a/src/lib/formats/hxchfe_dsk.cpp +++ b/src/lib/formats/hxchfe_dsk.cpp @@ -615,7 +615,6 @@ void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& sampl // Start of track? Use next entry. if (edge==0) { - cur_pos = 0; edge = tbuf[++cur_entry] & floppy_image::TIME_MASK; } @@ -671,10 +670,6 @@ void hfe_format::generate_hfe_bitstream_from_track(int cyl, int head, int& sampl } cur_pos = next; - if(cur_pos >= 200000000) { - cur_pos -= 200000000; - cur_entry = 0; - } bit = (bit << 1) & 0xff; if (bit == 0) diff --git a/src/lib/netlist/.gitignore b/src/lib/netlist/.gitignore index db6d315f3ef..946de7294de 100644 --- a/src/lib/netlist/.gitignore +++ b/src/lib/netlist/.gitignore @@ -5,8 +5,18 @@ buildVS/x64/* buildVS/.vs/* nltool nlwav -nltool.exe -nlwav.exe + +# Windows executables +*.exe + +# Local doxygen binaries doxygen doxyindexer doxysearch.cgi + +# nltool/nlwav output files +*.log +*.wav + +# VS 2019 +*.user \ No newline at end of file diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp index e5e8c64de25..a4ae9a38c9f 100644 --- a/src/lib/netlist/analog/nld_bjt.cpp +++ b/src/lib/netlist/analog/nld_bjt.cpp @@ -97,27 +97,26 @@ namespace analog /// | | FC | coefficient for forward-bias depletion capacitance formula | - | 0.5 | | | /// | | TNOM | Parameter measurement temperature | C | 27 | 50 | | /// - class bjt_model_t : public param_model_t + class bjt_model_t { public: - bjt_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_IS (*this, "IS") - , m_BF (*this, "BF") - , m_NF (*this, "NF") - , m_BR (*this, "BR") - , m_NR (*this, "NR") - , m_CJE(*this, "CJE") - , m_CJC(*this, "CJC") + bjt_model_t(param_model_t &model) + : m_IS (model, "IS") + , m_BF (model, "BF") + , m_NF (model, "NF") + , m_BR (model, "BR") + , m_NR (model, "NR") + , m_CJE(model, "CJE") + , m_CJC(model, "CJC") {} - value_t m_IS; //!< transport saturation current - value_t m_BF; //!< ideal maximum forward beta - value_t m_NF; //!< forward current emission coefficient - value_t m_BR; //!< ideal maximum reverse beta - value_t m_NR; //!< reverse current emission coefficient - value_t m_CJE; //!< B-E zero-bias depletion capacitance - value_t m_CJC; //!< B-C zero-bias depletion capacitance + param_model_t::value_t m_IS; //!< transport saturation current + param_model_t::value_t m_BF; //!< ideal maximum forward beta + param_model_t::value_t m_NF; //!< forward current emission coefficient + param_model_t::value_t m_BR; //!< ideal maximum reverse beta + param_model_t::value_t m_NR; //!< reverse current emission coefficient + param_model_t::value_t m_CJE; //!< B-E zero-bias depletion capacitance + param_model_t::value_t m_CJC; //!< B-C zero-bias depletion capacitance }; @@ -147,7 +146,7 @@ namespace analog void set_qtype(q_type atype) noexcept { m_qtype = atype; } protected: - bjt_model_t m_model; + param_model_t m_model; private: q_type m_qtype; }; @@ -179,7 +178,7 @@ namespace analog , m_gB(nlconst::cgmin()) , m_gC(nlconst::cgmin()) , m_V(nlconst::zero()) - , m_state_on(*this, "m_state_on", 0) + , m_state_on(*this, "m_state_on", 0u) { register_subalias("B", m_RB.P()); register_subalias("E", m_RB.N()); @@ -216,6 +215,7 @@ namespace analog { public: NETLIB_CONSTRUCTOR_DERIVED(QBJT_EB, QBJT) + , m_modacc(m_model) , m_gD_BC(*this, "m_D_BC") , m_gD_BE(*this, "m_D_BE") , m_D_CB(*this, "m_D_CB", true) @@ -233,13 +233,13 @@ namespace analog connect(m_D_EB.N(), m_D_CB.N()); connect(m_D_CB.P(), m_D_EC.N()); - if (m_model.m_CJE > nlconst::zero()) + if (m_modacc.m_CJE > nlconst::zero()) { create_and_register_subdevice("m_CJE", m_CJE); connect("B", "m_CJE.1"); connect("E", "m_CJE.2"); } - if (m_model.m_CJC > nlconst::zero()) + if (m_modacc.m_CJC > nlconst::zero()) { create_and_register_subdevice("m_CJC", m_CJC); connect("B", "m_CJC.1"); @@ -256,6 +256,7 @@ namespace analog NETLIB_UPDATE_TERMINALSI(); private: + bjt_model_t m_modacc; generic_diode m_gD_BC; generic_diode m_gD_BE; @@ -313,11 +314,14 @@ namespace analog NETLIB_UPDATE_PARAM(QBJT_switch) { - nl_fptype IS = m_model.m_IS; - nl_fptype BF = m_model.m_BF; - nl_fptype NF = m_model.m_NF; - //nl_fptype VJE = m_model.dValue("VJE", 0.75); + bjt_model_t model(m_model); + nl_fptype IS = model.m_IS; + nl_fptype BF = model.m_BF; + nl_fptype NF = model.m_NF; + //nl_fptype VJE = model.dValue("VJE", 0.75); + + // FIXME: check for PNP as well and bail out set_qtype((m_model.type() == "NPN") ? BJT_NPN : BJT_PNP); nl_fptype alpha = BF / (nlconst::one() + BF); @@ -382,12 +386,12 @@ namespace analog if (m_CJE) { m_CJE->reset(); - m_CJE->set_cap_embedded(m_model.m_CJE); + m_CJE->set_cap_embedded(m_modacc.m_CJE); } if (m_CJC) { m_CJC->reset(); - m_CJC->set_cap_embedded(m_model.m_CJC); + m_CJC->set_cap_embedded(m_modacc.m_CJC); } } @@ -421,13 +425,14 @@ namespace analog NETLIB_UPDATE_PARAM(QBJT_EB) { - nl_fptype IS = m_model.m_IS; - nl_fptype BF = m_model.m_BF; - nl_fptype NF = m_model.m_NF; - nl_fptype BR = m_model.m_BR; - nl_fptype NR = m_model.m_NR; + nl_fptype IS = m_modacc.m_IS; + nl_fptype BF = m_modacc.m_BF; + nl_fptype NF = m_modacc.m_NF; + nl_fptype BR = m_modacc.m_BR; + nl_fptype NR = m_modacc.m_NR; //nl_fptype VJE = m_model.dValue("VJE", 0.75); + // FIXME: check for PNP as well and bail out set_qtype((m_model.type() == "NPN") ? BJT_NPN : BJT_PNP); m_alpha_f = BF / (nlconst::one() + BF); diff --git a/src/lib/netlist/analog/nld_fourterm.h b/src/lib/netlist/analog/nld_fourterm.h index 9f0d7760c3b..5912f374ece 100644 --- a/src/lib/netlist/analog/nld_fourterm.h +++ b/src/lib/netlist/analog/nld_fourterm.h @@ -15,7 +15,7 @@ // ---------------------------------------------------------------------------------------- #define VCCS(name, G) \ - NET_REGISTER_DEVEXT(VCCS, G) + NET_REGISTER_DEVEXT(VCCS, name, G) #define CCCS(name, G) \ NET_REGISTER_DEVEXT(CCCS, name, G) diff --git a/src/lib/netlist/analog/nld_mosfet.cpp b/src/lib/netlist/analog/nld_mosfet.cpp index db22297470a..e7dce0db3bc 100644 --- a/src/lib/netlist/analog/nld_mosfet.cpp +++ b/src/lib/netlist/analog/nld_mosfet.cpp @@ -95,53 +95,52 @@ namespace analog /// | Y |W | Width scaling |-|100e-6|| /// - class fet_model_t : public param_model_t + class fet_model_t { public: - fet_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_VTO(*this, "VTO") - , m_N(*this, "N") - , m_ISS(*this, "IS") // Haven't seen a model using ISS / ISD - , m_ISD(*this, "IS") - , m_LD(*this, "LD") - , m_L(*this, "L") - , m_W(*this, "W") - , m_TOX(*this, "TOX") - , m_KP(*this, "KP") - , m_UO(*this, "UO") - , m_PHI(*this, "PHI") - , m_NSUB(*this, "NSUB") - , m_GAMMA(*this, "GAMMA") - , m_LAMBDA(*this, "LAMBDA") - , m_RD(*this, "RD") - , m_RS(*this, "RS") - , m_CGSO(*this, "CGSO") - , m_CGDO(*this, "CGDO") - , m_CGBO(*this, "CGBO") - , m_CAPMOD(*this, "CAPMOD") + fet_model_t(param_model_t &model) + : m_VTO(model, "VTO") + , m_N(model, "N") + , m_ISS(model, "IS") // Haven't seen a model using ISS / ISD + , m_ISD(model, "IS") + , m_LD(model, "LD") + , m_L(model, "L") + , m_W(model, "W") + , m_TOX(model, "TOX") + , m_KP(model, "KP") + , m_UO(model, "UO") + , m_PHI(model, "PHI") + , m_NSUB(model, "NSUB") + , m_GAMMA(model, "GAMMA") + , m_LAMBDA(model, "LAMBDA") + , m_RD(model, "RD") + , m_RS(model, "RS") + , m_CGSO(model, "CGSO") + , m_CGDO(model, "CGDO") + , m_CGBO(model, "CGBO") + , m_CAPMOD(model, "CAPMOD") {} - value_t m_VTO; //!< Threshold voltage [V] - value_t m_N; //!< Bulk diode emission coefficient - value_t m_ISS; //!< Body diode saturation current - value_t m_ISD; //!< Body diode saturation current - value_t m_LD; //!< Lateral diffusion [m] - value_t m_L; //!< Length scaling - value_t m_W; //!< Width scaling - value_t m_TOX; //!< Oxide thickness - value_t m_KP; //!< Transconductance parameter [A/V²] - value_t m_UO; //!< Surface mobility [cm²/V/s] - value_t m_PHI; //!< Surface inversion potential [V] - value_t m_NSUB; //!< Substrate doping [1/cm³] - value_t m_GAMMA; //!< Bulk threshold parameter [V^½] - value_t m_LAMBDA; //!< Channel-length modulation [1/V] - value_t m_RD; //!< Drain ohmic resistance - value_t m_RS; //!< Source ohmic resistance - value_t m_CGSO; //!< Gate-source overlap capacitance per meter channel width - value_t m_CGDO; //!< Gate-drain overlap capacitance per meter channel width - value_t m_CGBO; //!< Gate-bulk overlap capacitance per meter channel width - value_base_t m_CAPMOD; //!< Capacitance model (0=no model 2=Meyer) + param_model_t::value_t m_VTO; //!< Threshold voltage [V] + param_model_t::value_t m_N; //!< Bulk diode emission coefficient + param_model_t::value_t m_ISS; //!< Body diode saturation current + param_model_t::value_t m_ISD; //!< Body diode saturation current + param_model_t::value_t m_LD; //!< Lateral diffusion [m] + param_model_t::value_t m_L; //!< Length scaling + param_model_t::value_t m_W; //!< Width scaling + param_model_t::value_t m_TOX; //!< Oxide thickness + param_model_t::value_t m_KP; //!< Transconductance parameter [A/V²] + param_model_t::value_t m_UO; //!< Surface mobility [cm²/V/s] + param_model_t::value_t m_PHI; //!< Surface inversion potential [V] + param_model_t::value_t m_NSUB; //!< Substrate doping [1/cm³] + param_model_t::value_t m_GAMMA; //!< Bulk threshold parameter [V^½] + param_model_t::value_t m_LAMBDA; //!< Channel-length modulation [1/V] + param_model_t::value_t m_RD; //!< Drain ohmic resistance + param_model_t::value_t m_RS; //!< Source ohmic resistance + param_model_t::value_t m_CGSO; //!< Gate-source overlap capacitance per meter channel width + param_model_t::value_t m_CGDO; //!< Gate-drain overlap capacitance per meter channel width + param_model_t::value_t m_CGBO; //!< Gate-bulk overlap capacitance per meter channel width + param_model_t::value_base_t m_CAPMOD; //!< Capacitance model (0=no model 2=Meyer) }; // Have a common start for mosfets @@ -170,7 +169,7 @@ namespace analog void set_qtype(q_type atype) noexcept { m_qtype = atype; } protected: - fet_model_t m_model; + param_model_t m_model; private: q_type m_qtype; }; @@ -207,6 +206,7 @@ namespace analog , m_capmod(2) , m_Vgs(*this, "m_Vgs", nlconst::zero()) , m_Vgd(*this, "m_Vgd", nlconst::zero()) + , m_modacc(m_model) { register_subalias("S", m_SG.P()); // Source register_subalias("G", m_SG.N()); // Gate @@ -220,8 +220,8 @@ namespace analog set_qtype((m_model.type() == "NMOS_DEFAULT") ? FET_NMOS : FET_PMOS); m_polarity = (qtype() == FET_NMOS ? nlconst::one() : -nlconst::one()); - m_capmod = m_model.m_CAPMOD; - // printf("capmod %d %g %g\n", m_capmod, (nl_fptype)m_model.m_VTO, m_polarity); + m_capmod = m_modacc.m_CAPMOD; + // printf("capmod %d %g %g\n", m_capmod, (nl_fptype)m_modacc.m_VTO, m_polarity); nl_assert_always(m_capmod == 0 || m_capmod == 2, "Error: CAPMODEL invalid value"); // @@ -234,51 +234,51 @@ namespace analog // But couldn't find a formula for lambda anywhere // - m_lambda = m_model.m_LAMBDA; // FIXME: m_lambda only set once + m_lambda = m_modacc.m_LAMBDA; // FIXME: m_lambda only set once // calculate effective channel length - m_Leff = m_model.m_L - 2 * m_model.m_LD; + m_Leff = m_modacc.m_L - 2 * m_modacc.m_LD; nl_assert_always(m_Leff > nlconst::zero(), "Effective Lateral diffusion would be negative for model"); - nl_fptype Cox = (m_model.m_TOX > nlconst::zero()) ? (constants::eps_SiO2() * constants::eps_0() / m_model.m_TOX) : nlconst::zero(); + nl_fptype Cox = (m_modacc.m_TOX > nlconst::zero()) ? (constants::eps_SiO2() * constants::eps_0() / m_modacc.m_TOX) : nlconst::zero(); // calculate DC transconductance coefficient - if (m_model.m_KP > nlconst::zero()) - m_beta = m_model.m_KP * m_model.m_W / m_Leff; - else if (Cox > nlconst::zero() && m_model.m_UO > nlconst::zero()) - m_beta = m_model.m_UO * nlconst::magic(1e-4) * Cox * m_model.m_W / m_Leff; + if (m_modacc.m_KP > nlconst::zero()) + m_beta = m_modacc.m_KP * m_modacc.m_W / m_Leff; + else if (Cox > nlconst::zero() && m_modacc.m_UO > nlconst::zero()) + m_beta = m_modacc.m_UO * nlconst::magic(1e-4) * Cox * m_modacc.m_W / m_Leff; else - m_beta = nlconst::magic(2e-5) * m_model.m_W / m_Leff; + m_beta = nlconst::magic(2e-5) * m_modacc.m_W / m_Leff; //FIXME::UT can disappear const nl_fptype Vt = constants::T0() * constants::k_b() / constants::Q_e(); // calculate surface potential if not given - if (m_model.m_PHI > nlconst::zero()) - m_phi = m_model.m_PHI; - else if (m_model.m_NSUB > nlconst::zero()) + if (m_modacc.m_PHI > nlconst::zero()) + m_phi = m_modacc.m_PHI; + else if (m_modacc.m_NSUB > nlconst::zero()) { - nl_assert_always(m_model.m_NSUB * nlconst::magic(1e6) >= constants::NiSi(), "Error calculating phi for model"); - m_phi = nlconst::two() * Vt * plib::log (m_model.m_NSUB * nlconst::magic(1e6) / constants::NiSi()); + nl_assert_always(m_modacc.m_NSUB * nlconst::magic(1e6) >= constants::NiSi(), "Error calculating phi for model"); + m_phi = nlconst::two() * Vt * plib::log (m_modacc.m_NSUB * nlconst::magic(1e6) / constants::NiSi()); } else m_phi = nlconst::magic(0.6); // calculate bulk threshold if not given - if (m_model.m_GAMMA > nlconst::zero()) - m_gamma = m_model.m_GAMMA; + if (m_modacc.m_GAMMA > nlconst::zero()) + m_gamma = m_modacc.m_GAMMA; else { - if (Cox > nlconst::zero() && m_model.m_NSUB > nlconst::zero()) + if (Cox > nlconst::zero() && m_modacc.m_NSUB > nlconst::zero()) m_gamma = plib::sqrt (nlconst::two() * constants::Q_e() * constants::eps_Si() * constants::eps_0() - * m_model.m_NSUB * nlconst::magic(1e6)) / Cox; + * m_modacc.m_NSUB * nlconst::magic(1e6)) / Cox; else m_gamma = nlconst::zero(); } - m_vto = m_model.m_VTO; + m_vto = m_modacc.m_VTO; // FIXME zero conversion if(m_vto != nlconst::zero()) log().warning(MW_MOSFET_THRESHOLD_VOLTAGE(m_model.name())); @@ -286,7 +286,7 @@ namespace analog // FIXME: VTO if missing may be calculated from TPG, NSS and temperature. Usually models // specify VTO so skip this here. - m_CoxWL = Cox * m_model.m_W * m_Leff; + m_CoxWL = Cox * m_modacc.m_W * m_Leff; //printf("Cox: %g\n", m_Cox); } @@ -317,9 +317,9 @@ namespace analog NETLIB_NAME(FET)::reset(); // Bulk diodes - m_D_BD.set_param(m_model.m_ISD, m_model.m_N, exec().gmin(), constants::T0()); + m_D_BD.set_param(m_modacc.m_ISD, m_modacc.m_N, exec().gmin(), constants::T0()); #if (!BODY_CONNECTED_TO_SOURCE) - m_D_BS.set_param(m_model.m_ISS, m_model.m_N, exec().gmin(), constants::T0()); + m_D_BS.set_param(m_modacc.m_ISS, m_modacc.m_N, exec().gmin(), constants::T0()); #endif } @@ -362,6 +362,7 @@ namespace analog int m_capmod; state_var m_Vgs; state_var m_Vgd; + fet_model_t m_modacc; void set_cap(generic_capacitor cap, nl_fptype capval, nl_fptype V, @@ -573,9 +574,9 @@ namespace analog else calculate_caps(Vgd, Vgs, Vth, m_Cgd, m_Cgs, m_Cgb); - set_cap(m_cap_gb, m_Cgb + m_model.m_CGBO * m_Leff, Vgb, gGG, gGB, gBG, gBB, IG, IB); - set_cap(m_cap_gs, m_Cgs + m_model.m_CGSO * m_model.m_W, Vgs, gGG, gGS, gSG, gSS, IG, IS); - set_cap(m_cap_gd, m_Cgd + m_model.m_CGDO * m_model.m_W, Vgd, gGG, gGD, gDG, gDD, IG, ID); + set_cap(m_cap_gb, m_Cgb + m_modacc.m_CGBO * m_Leff, Vgb, gGG, gGB, gBG, gBB, IG, IB); + set_cap(m_cap_gs, m_Cgs + m_modacc.m_CGSO * m_modacc.m_W, Vgs, gGG, gGS, gSG, gSS, IG, IS); + set_cap(m_cap_gd, m_Cgd + m_modacc.m_CGDO * m_modacc.m_W, Vgd, gGG, gGD, gDG, gDD, IG, ID); } // Source connected to body, Diode S-B shorted! diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp index 232dcdf90d9..26a69b52b59 100644 --- a/src/lib/netlist/analog/nld_opamps.cpp +++ b/src/lib/netlist/analog/nld_opamps.cpp @@ -75,31 +75,30 @@ namespace netlist /// http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm /// /// - class opamp_model_t : public param_model_t + class opamp_model_t { public: - opamp_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_TYPE(*this, "TYPE") - , m_FPF(*this, "FPF") - , m_SLEW(*this, "SLEW") - , m_RI(*this, "RI") - , m_RO(*this, "RO") - , m_UGF(*this, "UGF") - , m_VLL(*this, "VLL") - , m_VLH(*this, "VLH") - , m_DAB(*this, "DAB") + opamp_model_t(param_model_t &model) + : m_TYPE(model, "TYPE") + , m_FPF(model, "FPF") + , m_SLEW(model, "SLEW") + , m_RI(model, "RI") + , m_RO(model, "RO") + , m_UGF(model, "UGF") + , m_VLL(model, "VLL") + , m_VLH(model, "VLH") + , m_DAB(model, "DAB") {} - value_t m_TYPE; //!< Model Type, 1 and 3 are supported - value_t m_FPF; //!< frequency of first pole - value_t m_SLEW; //!< unity gain slew rate - value_t m_RI; //!< input resistance - value_t m_RO; //!< output resistance - value_t m_UGF; //!< unity gain frequency (transition frequency) - value_t m_VLL; //!< low output swing minus low supply rail - value_t m_VLH; //!< high supply rail minus high output swing - value_t m_DAB; //!< Differential Amp Bias - total quiescent current + param_model_t::value_t m_TYPE; //!< Model Type, 1 and 3 are supported + param_model_t::value_t m_FPF; //!< frequency of first pole + param_model_t::value_t m_SLEW; //!< unity gain slew rate + param_model_t::value_t m_RI; //!< input resistance + param_model_t::value_t m_RO; //!< output resistance + param_model_t::value_t m_UGF; //!< unity gain frequency (transition frequency) + param_model_t::value_t m_VLL; //!< low output swing minus low supply rail + param_model_t::value_t m_VLH; //!< high supply rail minus high output swing + param_model_t::value_t m_DAB; //!< Differential Amp Bias - total quiescent current }; @@ -111,11 +110,12 @@ namespace netlist , m_VCC(*this, "VCC") , m_GND(*this, "GND") , m_model(*this, "MODEL", "LM324") + , m_modacc(m_model) , m_VH(*this, "VH") , m_VL(*this, "VL") , m_VREF(*this, "VREF") { - m_type = static_cast(m_model.m_TYPE); + m_type = static_cast(m_modacc.m_TYPE); if (m_type < 1 || m_type > 3) { log().fatal(MF_OPAMP_UNKNOWN_TYPE(m_type)); @@ -204,7 +204,8 @@ namespace netlist analog_input_t m_VCC; analog_input_t m_GND; - opamp_model_t m_model; + param_model_t m_model; + opamp_model_t m_modacc; analog_output_t m_VH; analog_output_t m_VL; analog_output_t m_VREF; @@ -216,33 +217,33 @@ namespace netlist NETLIB_UPDATE(opamp) { const nl_fptype cVt = nlconst::np_VT(nlconst::one()); // * m_n; - const nl_fptype cId = m_model.m_DAB; // 3 mA + const nl_fptype cId = m_modacc.m_DAB; // 3 mA const nl_fptype cVd = cVt * plib::log(cId / nlconst::np_Is() + nlconst::one()); - m_VH.push(m_VCC() - m_model.m_VLH - cVd); - m_VL.push(m_GND() + m_model.m_VLL + cVd); + m_VH.push(m_VCC() - m_modacc.m_VLH - cVd); + m_VL.push(m_GND() + m_modacc.m_VLL + cVd); m_VREF.push((m_VCC() + m_GND()) / nlconst::two()); } NETLIB_UPDATE_PARAM(opamp) { - m_G1.m_RI.set(m_model.m_RI); + m_G1.m_RI.set(m_modacc.m_RI); if (m_type == 1) { - nl_fptype RO = m_model.m_RO; - nl_fptype G = m_model.m_UGF / m_model.m_FPF / RO; + nl_fptype RO = m_modacc.m_RO; + nl_fptype G = m_modacc.m_UGF / m_modacc.m_FPF / RO; m_RP.set_R(RO); m_G1.m_G.set(G); } if (m_type == 3 || m_type == 2) { - nl_fptype CP = m_model.m_DAB / m_model.m_SLEW; - nl_fptype RP = nlconst::half() / nlconst::pi() / CP / m_model.m_FPF; - nl_fptype G = m_model.m_UGF / m_model.m_FPF / RP; + nl_fptype CP = m_modacc.m_DAB / m_modacc.m_SLEW; + nl_fptype RP = nlconst::half() / nlconst::pi() / CP / m_modacc.m_FPF; + nl_fptype G = m_modacc.m_UGF / m_modacc.m_FPF / RP; //printf("OPAMP %s: %g %g %g\n", name().c_str(), CP, RP, G); - if (m_model.m_SLEW / (nlconst::four() * nlconst::pi() * nlconst::np_VT()) < m_model.m_UGF) + if (m_modacc.m_SLEW / (nlconst::four() * nlconst::pi() * nlconst::np_VT()) < m_modacc.m_UGF) log().warning(MW_OPAMP_FAIL_CONVERGENCE(this->name())); m_CP->set_cap_embedded(CP); @@ -255,9 +256,9 @@ namespace netlist m_EBUF->m_G.set(nlconst::one()); #if TEST_ALT_OUTPUT m_EBUF->m_RO.set(0.001); - m_RO->set_R(m_model.m_RO); + m_RO->set_R(m_modacc.m_RO); #else - m_EBUF->m_RO.set(m_model.m_RO); + m_EBUF->m_RO.set(m_modacc.m_RO); #endif } if (m_type == 3) @@ -265,9 +266,9 @@ namespace netlist m_EBUF->m_G.set(nlconst::one()); #if TEST_ALT_OUTPUT m_EBUF->m_RO.set(0.001); - m_RO->set_R(m_model.m_RO); + m_RO->set_R(m_modacc.m_RO); #else - m_EBUF->m_RO.set(m_model.m_RO); + m_EBUF->m_RO.set(m_modacc.m_RO); #endif } } diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp index 82fdf0f5691..1981b1c6e12 100644 --- a/src/lib/netlist/analog/nlid_twoterm.cpp +++ b/src/lib/netlist/analog/nlid_twoterm.cpp @@ -145,8 +145,9 @@ namespace analog NETLIB_RESET(D) { - nl_fptype Is = m_model.m_IS; - nl_fptype n = m_model.m_N; + diode_model_t modacc(m_model); + nl_fptype Is = modacc.m_IS; + nl_fptype n = modacc.m_N; m_D.set_param(Is, n, exec().gmin(), nlconst::T0()); set_G_V_I(m_D.G(), nlconst::zero(), m_D.Ieq()); @@ -154,8 +155,9 @@ namespace analog NETLIB_UPDATE_PARAM(D) { - nl_fptype Is = m_model.m_IS; - nl_fptype n = m_model.m_N; + diode_model_t modacc(m_model); + nl_fptype Is = modacc.m_IS; + nl_fptype n = modacc.m_N; m_D.set_param(Is, n, exec().gmin(), nlconst::T0()); } @@ -176,19 +178,21 @@ namespace analog NETLIB_RESET(Z) { - nl_fptype IsBV = m_model.m_IBV / (plib::exp(m_model.m_BV / nlconst::np_VT(m_model.m_NBV)) - nlconst::one()); + zdiode_model_t modacc(m_model); + nl_fptype IsBV = modacc.m_IBV / (plib::exp(modacc.m_BV / nlconst::np_VT(modacc.m_NBV)) - nlconst::one()); - m_D.set_param(m_model.m_IS, m_model.m_N, exec().gmin(), nlconst::T0()); - m_R.set_param(IsBV, m_model.m_NBV, exec().gmin(), nlconst::T0()); + m_D.set_param(modacc.m_IS, modacc.m_N, exec().gmin(), nlconst::T0()); + m_R.set_param(IsBV, modacc.m_NBV, exec().gmin(), nlconst::T0()); set_G_V_I(m_D.G(), nlconst::zero(), m_D.Ieq()); } NETLIB_UPDATE_PARAM(Z) { - nl_fptype IsBV = m_model.m_IBV / (plib::exp(m_model.m_BV / nlconst::np_VT(m_model.m_NBV)) - nlconst::one()); + zdiode_model_t modacc(m_model); + nl_fptype IsBV = modacc.m_IBV / (plib::exp(modacc.m_BV / nlconst::np_VT(modacc.m_NBV)) - nlconst::one()); - m_D.set_param(m_model.m_IS, m_model.m_N, exec().gmin(), nlconst::T0()); - m_R.set_param(IsBV, m_model.m_NBV, exec().gmin(), nlconst::T0()); + m_D.set_param(modacc.m_IS, modacc.m_N, exec().gmin(), nlconst::T0()); + m_R.set_param(IsBV, modacc.m_NBV, exec().gmin(), nlconst::T0()); set_G_V_I(m_D.G(), nlconst::zero(), m_D.Ieq()); } diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index 161e1fc924f..f7226ee57db 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -452,32 +452,31 @@ namespace analog /// | Y |IBV |current at breakdown voltage |A | 0.001| | | /// | |TNOM |parameter measurement temperature|deg C| 27| 50| | /// - class diode_model_t : public param_model_t + class diode_model_t { public: - diode_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_IS(*this, "IS") - , m_N(*this, "N") + diode_model_t(param_model_t &model) + : m_IS(model, "IS") + , m_N(model, "N") {} - value_t m_IS; //!< saturation current. - value_t m_N; //!< emission coefficient. + param_model_t::value_t m_IS; //!< saturation current. + param_model_t::value_t m_N; //!< emission coefficient. }; class zdiode_model_t : public diode_model_t { public: - zdiode_model_t(device_t &device, const pstring &name, const pstring &val) - : diode_model_t(device, name, val) - , m_NBV(*this, "NBV") - , m_BV(*this, "BV") - , m_IBV(*this, "IBV") + zdiode_model_t(param_model_t &model) + : diode_model_t(model) + , m_NBV(model, "NBV") + , m_BV(model, "BV") + , m_IBV(model, "IBV") {} - value_t m_NBV; //!< reverse emission coefficient. - value_t m_BV; //!< reverse breakdown voltage. - value_t m_IBV; //!< current at breakdown voltage. + param_model_t::value_t m_NBV; //!< reverse emission coefficient. + param_model_t::value_t m_BV; //!< reverse breakdown voltage. + param_model_t::value_t m_IBV; //!< current at breakdown voltage. }; // ----------------------------------------------------------------------------- @@ -504,7 +503,7 @@ namespace analog NETLIB_UPDATE_PARAMI(); private: - diode_model_t m_model; + param_model_t m_model; generic_diode m_D; }; @@ -533,7 +532,7 @@ namespace analog NETLIB_UPDATE_PARAMI(); private: - zdiode_model_t m_model; + param_model_t m_model; generic_diode m_D; // REVERSE diode generic_diode m_R; @@ -553,14 +552,13 @@ namespace analog , m_R(*this, "RI", nlconst::magic(0.1)) , m_V(*this, "V", nlconst::zero()) , m_func(*this,"FUNC", "") - , m_compiled() + , m_compiled(*this, "m_compiled") , m_funcparam({nlconst::zero()}) { - m_compiled.save_state(*this, "m_compiled"); register_subalias("P", P()); register_subalias("N", N()); if (m_func() != "") - m_compiled.compile(m_func(), std::vector({{pstring("T")}})); + m_compiled->compile(m_func(), std::vector({{pstring("T")}})); } NETLIB_IS_TIMESTEP(m_func() != "") @@ -570,7 +568,7 @@ namespace analog m_t += step; m_funcparam[0] = m_t; this->set_G_V_I(plib::reciprocal(m_R()), - m_compiled.evaluate(m_funcparam), + m_compiled->evaluate(m_funcparam), nlconst::zero()); } @@ -587,7 +585,7 @@ namespace analog param_fp_t m_R; param_fp_t m_V; param_str_t m_func; - plib::pfunction m_compiled; + state_var> m_compiled; std::vector m_funcparam; }; @@ -602,14 +600,13 @@ namespace analog , m_t(*this, "m_t", nlconst::zero()) , m_I(*this, "I", nlconst::one()) , m_func(*this,"FUNC", "") - , m_compiled() + , m_compiled(*this, "m_compiled") , m_funcparam({nlconst::zero()}) { - m_compiled.save_state(*this, "m_compiled"); register_subalias("P", P()); register_subalias("N", N()); if (m_func() != "") - m_compiled.compile(m_func(), std::vector({{pstring("T")}})); + m_compiled->compile(m_func(), std::vector({{pstring("T")}})); } NETLIB_IS_TIMESTEP(m_func() != "") @@ -617,7 +614,7 @@ namespace analog { m_t += step; m_funcparam[0] = m_t; - const nl_fptype I = m_compiled.evaluate(m_funcparam); + const nl_fptype I = m_compiled->evaluate(m_funcparam); const auto zero(nlconst::zero()); set_mat(zero, zero, -I, zero, zero, I); @@ -649,7 +646,7 @@ namespace analog state_var m_t; param_fp_t m_I; param_str_t m_func; - plib::pfunction m_compiled; + state_var> m_compiled; std::vector m_funcparam; }; diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile index fbc24d490ff..0d68806ed1f 100644 --- a/src/lib/netlist/build/makefile +++ b/src/lib/netlist/build/makefile @@ -73,7 +73,10 @@ TIDY_DB = $(OBJ)/compile_commands.json # LTO = -flto=4 -fuse-linker-plugin -flto-partition=balanced -Wodr -CFLAGS = $(LTO) -g -O3 -std=c++14 -I$(CURDIR)/.. -I$(CURDIR)/../.. $(CEXTRAFLAGS) +CCOREFLAGS = -g -O3 -std=c++14 -I$(CURDIR)/.. -I$(CURDIR)/../.. + + +CFLAGS = $(LTO) $(CCOREFLAGS) $(CEXTRAFLAGS) LDFLAGS = $(LTO) -g -O3 -std=c++14 $(LDEXTRAFLAGS) LIBS = -lpthread -ldl $(EXTRALIBS) @@ -82,6 +85,8 @@ LD = @g++ MD = @mkdir RM = @rm CLANG_TIDY = clang-tidy-11 +DEPENDCC=$(CC) + ifndef FAST FAST=1 @@ -278,17 +283,20 @@ native: $(MAKE) CEXTRAFLAGS="-march=native -msse4.2 -Wall -Wpedantic -Wsign-compare -Wextra " gcc9: - $(MAKE) CC=g++-9 LD=g++-9 CEXTRAFLAGS="-march=native -fext-numeric-literals -msse4.2 -Wall -pedantic -Wpedantic -Wsign-compare -Wextra" EXTRALIBS="-lquadmath" + $(MAKE) CC=g++-9 LD=g++-9 CEXTRAFLAGS="-march=native -fext-numeric-literals -msse4.2 -Wall -pedantic -Wpedantic -Wsign-compare -Wextra " EXTRALIBS="-lquadmath" clang: - $(MAKE) CC=clang++-11 LD=clang++-11 OBJ=obj/clang CEXTRAFLAGS="-march=native -msse4.2 -Weverything -Wall -pedantic -Wpedantic -Werror -Wno-padded -Wno-weak-vtables -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors" + #$(MAKE) CC=clang++-11 LD=clang++-11 OBJ=obj/clang CEXTRAFLAGS="-march=native -msse4.2 -Weverything -Wall -pedantic -Wpedantic -Wunused-private-field -Wno-padded -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors" + $(MAKE) CC=clang++-11 LD=clang++-11 OBJ=obj/clang CEXTRAFLAGS="-march=native -msse4.2 -Weverything -Wall -pedantic -Wpedantic -Wunused-private-field -Werror -Wno-padded -Wno-weak-vtables -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors" clang-5: $(MAKE) CC=clang++-5.0 LD=clang++-5.0 CEXTRAFLAGS="-march=native -Weverything -Werror -Wno-inconsistent-missing-destructor-override -Wno-unreachable-code -Wno-padded -Wno-weak-vtables -Wno-missing-variable-declarations -Wconversion -Wno-c++98-compat -Wno-float-equal -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-weak-template-vtables -Wno-exit-time-destructors" nvcc: - $(MAKE) CC=/usr/local/cuda-9.0/bin/nvcc LD=/usr/local/cuda-9.2/bin/nvcc OBJ=obj/nvcc \ - CEXTRAFLAGS="-x cu -DNVCCBUILD=1 --expt-extended-lambda --expt-relaxed-constexpr --default-stream per-thread --restrict" + $(MAKE) CC=/usr/local/cuda-9.0/bin/nvcc LD=/usr/local/cuda-9.2/bin/nvcc \ + OBJ=obj/nvcc CEXTRAFLAGS="-x cu -DNVCCBUILD=1 --expt-extended-lambda \ + --expt-relaxed-constexpr --default-stream per-thread --restrict" \ + DEPENDCC=g++ tidy_db: compile_commands_prefix $(ALL_TIDY_FILES) compile_commands_postfix @@ -327,7 +335,7 @@ $(DEPEND): maketree $(SOURCES) @echo creating $(DEPEND) @rm -f $(DEPEND) @for i in $(SOURCES); do \ - $(CC) $(CFLAGS) -MM $$i -MT `echo $$i | sed -e 's+$(SRC)+$(OBJ)+' -e 's+.cpp+.o+' ` >> $(DEPEND); \ + $(DEPENDCC) $(CCOREFLAGS) -MM $$i -MT `echo $$i | sed -e 's+$(SRC)+$(OBJ)+' -e 's+.cpp+.o+' ` >> $(DEPEND); \ done depend: $(DEPEND) diff --git a/src/lib/netlist/buildVS/netlist.sln b/src/lib/netlist/buildVS/netlist.sln index a06f407d3c2..433d034cf6f 100755 --- a/src/lib/netlist/buildVS/netlist.sln +++ b/src/lib/netlist/buildVS/netlist.sln @@ -1,12 +1,14 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netlistlib", "netlistlib.vcxproj", "{A374399B-B87F-4E0F-9525-6C099600705F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nltool", "nltool.vcxproj", "{9204EC28-A29B-4A36-9E47-2C46041D67D3}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlwav", "nlwav.vcxproj", "{48D0ADAF-62EC-472E-A51B-8D837280649D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -31,8 +33,19 @@ Global {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Release|x64.Build.0 = Release|x64 {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Release|x86.ActiveCfg = Release|Win32 {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Release|x86.Build.0 = Release|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x64.ActiveCfg = Debug|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x64.Build.0 = Debug|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x86.ActiveCfg = Debug|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x86.Build.0 = Debug|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x64.ActiveCfg = Release|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x64.Build.0 = Release|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x86.ActiveCfg = Release|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {992701A0-B9F5-4F7D-BF3F-5B0EBEA51F04} + EndGlobalSection EndGlobal diff --git a/src/lib/netlist/buildVS/netlistlib.vcxproj.user b/src/lib/netlist/buildVS/netlistlib.vcxproj.user deleted file mode 100755 index abe8dd8961e..00000000000 --- a/src/lib/netlist/buildVS/netlistlib.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/lib/netlist/buildVS/nlwav.vcxproj b/src/lib/netlist/buildVS/nlwav.vcxproj new file mode 100755 index 00000000000..7b191fedccd --- /dev/null +++ b/src/lib/netlist/buildVS/nlwav.vcxproj @@ -0,0 +1,162 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + {a374399b-b87f-4e0f-9525-6c099600705f} + + + + 16.0 + {48D0ADAF-62EC-472E-A51B-8D837280649D} + Win32Proj + nlwav + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + false + + + true + + + true + + + false + + + + + + Level3 + true + true + + + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + $(SolutionDir)..\..\ + + + Console + true + true + true + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + \ No newline at end of file diff --git a/src/lib/netlist/buildVS/nlwav.vcxproj.filters b/src/lib/netlist/buildVS/nlwav.vcxproj.filters new file mode 100755 index 00000000000..7b114761bb4 --- /dev/null +++ b/src/lib/netlist/buildVS/nlwav.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/src/lib/netlist/devices/nld_2102A.cpp b/src/lib/netlist/devices/nld_2102A.cpp index 8aea0e398ca..59ad96668bb 100644 --- a/src/lib/netlist/devices/nld_2102A.cpp +++ b/src/lib/netlist/devices/nld_2102A.cpp @@ -7,7 +7,6 @@ #include "nld_2102A.h" #include "netlist/nl_base.h" -#include "nlid_system.h" #define ADDR2BYTE(a) ((a) >> 3) #define ADDR2BIT(a) ((a) & 0x7) @@ -33,7 +32,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(2102A_dip); + private: object_array_t m_A; logic_input_t m_CEQ; logic_input_t m_RWQ; @@ -46,31 +46,36 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(2102A_dip, 2102A) + NETLIB_OBJECT(2102A_dip) { - NETLIB_CONSTRUCTOR_DERIVED(2102A_dip, 2102A) + NETLIB_CONSTRUCTOR(2102A_dip) + , A(*this, "A") { - register_subalias("8", m_A[0]); - register_subalias("4", m_A[1]); - register_subalias("5", m_A[2]); - register_subalias("6", m_A[3]); - register_subalias("7", m_A[4]); - register_subalias("2", m_A[5]); - register_subalias("1", m_A[6]); - register_subalias("16", m_A[7]); - register_subalias("15", m_A[8]); - register_subalias("14", m_A[9]); + register_subalias("8", A.m_A[0]); + register_subalias("4", A.m_A[1]); + register_subalias("5", A.m_A[2]); + register_subalias("6", A.m_A[3]); + register_subalias("7", A.m_A[4]); + register_subalias("2", A.m_A[5]); + register_subalias("1", A.m_A[6]); + register_subalias("16", A.m_A[7]); + register_subalias("15", A.m_A[8]); + register_subalias("14", A.m_A[9]); - register_subalias("13", m_CEQ); - register_subalias("3", m_RWQ); + register_subalias("13", A.m_CEQ); + register_subalias("3", A.m_RWQ); - register_subalias("11", m_DI); - register_subalias("12", m_DO); + register_subalias("11", A.m_DI); + register_subalias("12", A.m_DO); - register_subalias("10", "VCC"); - register_subalias("9", "GND"); + register_subalias("10", "A.VCC"); + register_subalias("9", "A.GND"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(2102A) A; }; NETLIB_UPDATE(2102A) diff --git a/src/lib/netlist/devices/nld_2716.cpp b/src/lib/netlist/devices/nld_2716.cpp index 73ce2c41dc4..2e2899ce96e 100644 --- a/src/lib/netlist/devices/nld_2716.cpp +++ b/src/lib/netlist/devices/nld_2716.cpp @@ -7,7 +7,6 @@ #include "nld_2716.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -28,7 +27,8 @@ namespace netlist NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(2716_dip); + private: object_array_t m_A; logic_input_t m_GQ; logic_input_t m_EPQ; @@ -40,37 +40,42 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(2716_dip, 2716) + NETLIB_OBJECT(2716_dip) { - NETLIB_CONSTRUCTOR_DERIVED(2716_dip, 2716) + NETLIB_CONSTRUCTOR(2716_dip) + , A(*this, "A") { - register_subalias("8", m_A[0]); - register_subalias("7", m_A[1]); - register_subalias("6", m_A[2]); - register_subalias("5", m_A[3]); - register_subalias("4", m_A[4]); - register_subalias("3", m_A[5]); - register_subalias("2", m_A[6]); - register_subalias("1", m_A[7]); - register_subalias("23", m_A[8]); - register_subalias("22", m_A[9]); - register_subalias("19", m_A[10]); + register_subalias("8", A.m_A[0]); + register_subalias("7", A.m_A[1]); + register_subalias("6", A.m_A[2]); + register_subalias("5", A.m_A[3]); + register_subalias("4", A.m_A[4]); + register_subalias("3", A.m_A[5]); + register_subalias("2", A.m_A[6]); + register_subalias("1", A.m_A[7]); + register_subalias("23", A.m_A[8]); + register_subalias("22", A.m_A[9]); + register_subalias("19", A.m_A[10]); - register_subalias("20", m_GQ); - register_subalias("18", m_EPQ); + register_subalias("20", A.m_GQ); + register_subalias("18", A.m_EPQ); - register_subalias("9", m_D[0]); - register_subalias("10", m_D[1]); - register_subalias("11", m_D[2]); - register_subalias("13", m_D[3]); - register_subalias("14", m_D[4]); - register_subalias("15", m_D[5]); - register_subalias("16", m_D[6]); - register_subalias("17", m_D[7]); + register_subalias("9", A.m_D[0]); + register_subalias("10", A.m_D[1]); + register_subalias("11", A.m_D[2]); + register_subalias("13", A.m_D[3]); + register_subalias("14", A.m_D[4]); + register_subalias("15", A.m_D[5]); + register_subalias("16", A.m_D[6]); + register_subalias("17", A.m_D[7]); - register_subalias("12", "GND"); - register_subalias("24", "VCC"); + register_subalias("12", "A.GND"); + register_subalias("24", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(2716) A; }; // FIXME: timing! diff --git a/src/lib/netlist/devices/nld_4006.cpp b/src/lib/netlist/devices/nld_4006.cpp index 70b5e8456c0..96e38813402 100644 --- a/src/lib/netlist/devices/nld_4006.cpp +++ b/src/lib/netlist/devices/nld_4006.cpp @@ -6,7 +6,7 @@ */ #include "nld_4006.h" -#include "nlid_system.h" +#include "nl_base.h" namespace netlist { @@ -61,7 +61,8 @@ namespace netlist } } - protected: + friend class NETLIB_NAME(CD4006_dip); + private: logic_input_t m_CLOCK; object_array_t m_I; object_array_t m_Q; @@ -70,27 +71,32 @@ namespace netlist nld_power_pins m_supply; }; - NETLIB_OBJECT_DERIVED(CD4006_dip, CD4006) + NETLIB_OBJECT(CD4006_dip) { - NETLIB_CONSTRUCTOR_DERIVED(CD4006_dip, CD4006) + NETLIB_CONSTRUCTOR(CD4006_dip) + , A(*this, "A") { - register_subalias("1", m_I[0]); - register_subalias("2", m_Q[1]); - register_subalias("3", m_CLOCK); - register_subalias("4", m_I[1]); - register_subalias("5", m_I[2]); - register_subalias("6", m_I[3]); - register_subalias("7", "VSS"); + register_subalias("1", A.m_I[0]); + register_subalias("2", A.m_Q[1]); + register_subalias("3", A.m_CLOCK); + register_subalias("4", A.m_I[1]); + register_subalias("5", A.m_I[2]); + register_subalias("6", A.m_I[3]); + register_subalias("7", "A.VSS"); - register_subalias("8", m_Q[5]); - register_subalias("9", m_Q[6]); - register_subalias("10", m_Q[4]); - register_subalias("11", m_Q[2]); - register_subalias("12", m_Q[3]); - register_subalias("13", m_Q[0]); - register_subalias("14", "VDD"); + register_subalias("8", A.m_Q[5]); + register_subalias("9", A.m_Q[6]); + register_subalias("10", A.m_Q[4]); + register_subalias("11", A.m_Q[2]); + register_subalias("12", A.m_Q[3]); + register_subalias("13", A.m_Q[0]); + register_subalias("14", "A.VDD"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(CD4006) A; }; NETLIB_DEVICE_IMPL(CD4006, "CD4006", "+CLOCK,+D1,+D2,+D3,+D4,+D1P4,+D1P4S,+D2P4,+D2P5,+D3P4,+D4P4,+D3P5,@VCC,@GND") diff --git a/src/lib/netlist/devices/nld_4020.cpp b/src/lib/netlist/devices/nld_4020.cpp index 96051322fa8..4fbe3486b4f 100644 --- a/src/lib/netlist/devices/nld_4020.cpp +++ b/src/lib/netlist/devices/nld_4020.cpp @@ -6,7 +6,8 @@ */ #include "nld_4020.h" -#include "nlid_system.h" +#include "nl_base.h" +#include "nl_factory.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp index b6215ea89e3..30536b2009d 100644 --- a/src/lib/netlist/devices/nld_4066.cpp +++ b/src/lib/netlist/devices/nld_4066.cpp @@ -9,7 +9,6 @@ #include "netlist/analog/nlid_twoterm.h" #include "netlist/solver/nld_solver.h" -#include "nlid_system.h" // This is an experimental approach to implement the analog switch. // This will make the switch a 3 terminal element which is completely diff --git a/src/lib/netlist/devices/nld_4316.cpp b/src/lib/netlist/devices/nld_4316.cpp index 84668be5221..8d807b79bbd 100644 --- a/src/lib/netlist/devices/nld_4316.cpp +++ b/src/lib/netlist/devices/nld_4316.cpp @@ -8,7 +8,6 @@ #include "nld_4316.h" #include "netlist/analog/nlid_twoterm.h" #include "netlist/solver/nld_solver.h" -#include "nlid_system.h" namespace netlist { namespace devices { diff --git a/src/lib/netlist/devices/nld_74107.cpp b/src/lib/netlist/devices/nld_74107.cpp index 53279f7df3a..38da321d75e 100644 --- a/src/lib/netlist/devices/nld_74107.cpp +++ b/src/lib/netlist/devices/nld_74107.cpp @@ -7,7 +7,6 @@ #include "nld_74107.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74123.cpp b/src/lib/netlist/devices/nld_74123.cpp index ba1eb4ff54d..e4cdd8b5312 100644 --- a/src/lib/netlist/devices/nld_74123.cpp +++ b/src/lib/netlist/devices/nld_74123.cpp @@ -5,17 +5,19 @@ * */ -#include "nlid_system.h" #include "netlist/analog/nlid_twoterm.h" +#include "nlid_system.h" namespace netlist { namespace devices { - NETLIB_OBJECT(74123) + template + NETLIB_OBJECT(74123_base) { - NETLIB_CONSTRUCTOR_EX(74123, int dev_type = 74123) - , m_dev_type(dev_type) + static_assert((DEVTYPE == 9602) || (DEVTYPE == 4538) || (DEVTYPE == 74123), "wrong device type"); + + NETLIB_CONSTRUCTOR(74123_base) , m_RP(*this, "RP") , m_RN(*this, "RN") , m_RP_Q(*this, "_RP_Q") @@ -29,11 +31,9 @@ namespace netlist , m_last_trig(*this, "m_last_trig", 0) , m_state(*this, "m_state", 0) , m_KP(*this, "m_KP", 0) - , m_K(*this, "K", (m_dev_type == 4538) ? nlconst::one() : nlconst::magic(0.4)) // CD4538 datasheet states PW=RC + , m_K(*this, "K", (DEVTYPE == 4538) ? nlconst::one() : nlconst::magic(0.4)) // CD4538 datasheet states PW=RC , m_RI(*this, "RI", nlconst::magic(400.0)) // around 250 for HC series, 400 on LS/TTL, estimated from datasheets { - if ((m_dev_type != 9602) && (m_dev_type != 4538) ) - m_dev_type = 74123; register_subalias("GND", m_RN.m_R.N()); register_subalias("VCC", m_RP.m_R.P()); @@ -50,11 +50,94 @@ namespace netlist m_RN.m_RON.set(m_RI()); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_UPDATEI() + { + netlist_sig_t m_trig(0); + netlist_sig_t res = !m_CLRQ(); + netlist_time t_AB_to_Q = NLTIME_FROM_NS(10); + netlist_time t_C_to_Q = NLTIME_FROM_NS(10); + + if (DEVTYPE == 74123) + { + m_trig = (m_A() ^ 1) & m_B() & m_CLRQ(); + } + else if (DEVTYPE == 9602) + { + m_trig = (m_A() ^ 1) | m_B(); + } + else // 4538 + { + m_trig = (m_B() ^ 1) | m_A(); + // The line below is from the datasheet truthtable ... doesn't make sense at all + //res = res | m_A) | (m_B) ^ 1); + t_AB_to_Q = NLTIME_FROM_NS(300); + t_C_to_Q = NLTIME_FROM_NS(250); + } + + if (res) + { + m_Q.push(0, t_C_to_Q); + m_QQ.push(1, t_C_to_Q); + /* quick charge until trigger */ + /* FIXME: SGS datasheet shows quick charge to 5V, + * though schematics indicate quick charge to Vhigh only. + */ + m_RP_Q.push(1, t_C_to_Q); // R_ON + m_RN_Q.push(0, t_C_to_Q); // R_OFF + m_state = 2; //charging (quick) + } + else if (!m_last_trig && m_trig) + { + // FIXME: Timing! + m_Q.push(1, t_AB_to_Q); + m_QQ.push(0,t_AB_to_Q); + + m_RN_Q.push(1, t_AB_to_Q); // R_ON + m_RP_Q.push(0, t_AB_to_Q); // R_OFF + + m_state = 1; // discharging + } + + m_last_trig = m_trig; + + if (m_state == 1) + { + const nl_fptype vLow = m_KP * m_RP.m_R.P()(); + if (m_CV() < vLow) + { + m_RN_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF + m_state = 2; // charging + } + } + if (m_state == 2) + { + const nl_fptype vHigh = m_RP.m_R.P()() * (nlconst::one() - m_KP); + if (m_CV() > vHigh) + { + m_RP_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF + + m_Q.push(0, NLTIME_FROM_NS(10)); + m_QQ.push(1, NLTIME_FROM_NS(10)); + m_state = 0; // waiting + } + } + } + + NETLIB_RESETI() + { + m_KP = plib::reciprocal(nlconst::one() + plib::exp(m_K())); + + m_RP.reset(); + m_RN.reset(); + + //m_RP.set_R(R_OFF); + //m_RN.set_R(R_OFF); + + m_last_trig = 0; + m_state = 0; + } private: - int m_dev_type; public: NETLIB_SUB(sys_dsw1) m_RP; NETLIB_SUB(sys_dsw1) m_RN; @@ -81,8 +164,8 @@ namespace netlist NETLIB_OBJECT(74123_dip) { NETLIB_CONSTRUCTOR(74123_dip) - , m_A(*this, "A", 74123) - , m_B(*this, "B", 74123) + , m_A(*this, "A") + , m_B(*this, "B") { register_subalias("1", m_A.m_A); register_subalias("2", m_A.m_B); @@ -104,18 +187,18 @@ namespace netlist register_subalias("16", m_A.m_RP.m_R.P()); connect(m_A.m_RP.m_R.P(), m_B.m_RP.m_R.P()); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} private: - NETLIB_SUB(74123) m_A; - NETLIB_SUB(74123) m_B; + NETLIB_SUB(74123_base)<74123> m_A; + NETLIB_SUB(74123_base)<74123> m_B; }; NETLIB_OBJECT(9602_dip) { NETLIB_CONSTRUCTOR(9602_dip) - , m_A(*this, "A", 9602) - , m_B(*this, "B", 9602) + , m_A(*this, "A") + , m_B(*this, "B") { register_subalias("1", m_A.m_RN.m_R.N()); // C1 register_subalias("2", m_A.m_RN.m_R.P()); // RC1 @@ -137,19 +220,19 @@ namespace netlist register_subalias("16", m_A.m_RP.m_R.P()); connect(m_A.m_RP.m_R.P(), m_B.m_RP.m_R.P()); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() { } + NETLIB_UPDATEI() { } private: - NETLIB_SUB(74123) m_A; - NETLIB_SUB(74123) m_B; + NETLIB_SUB(74123_base)<9602> m_A; + NETLIB_SUB(74123_base)<9602> m_B; }; NETLIB_OBJECT(4538_dip) { NETLIB_CONSTRUCTOR(4538_dip) NETLIB_FAMILY("CD4XXX") - , m_A(*this, "A", 4538) - , m_B(*this, "B", 4538) + , m_A(*this, "A") + , m_B(*this, "B") { register_subalias("1", m_A.m_RN.m_R.N()); // C1 register_subalias("2", m_A.m_RN.m_R.P()); // RC1 @@ -174,123 +257,10 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); private: - NETLIB_SUB(74123) m_A; - NETLIB_SUB(74123) m_B; + NETLIB_SUB(74123_base)<4538> m_A; + NETLIB_SUB(74123_base)<4538> m_B; }; - NETLIB_UPDATE(74123) - { - netlist_sig_t m_trig(0); - netlist_sig_t res = !m_CLRQ(); - netlist_time t_AB_to_Q = NLTIME_FROM_NS(10); - netlist_time t_C_to_Q = NLTIME_FROM_NS(10); - - if (m_dev_type == 74123) - { - m_trig = (m_A() ^ 1) & m_B() & m_CLRQ(); - } - else if (m_dev_type == 9602) - { - m_trig = (m_A() ^ 1) | m_B(); - } - else // 4538 - { - m_trig = (m_B() ^ 1) | m_A(); - // The line below is from the datasheet truthtable ... doesn't make sense at all - //res = res | m_A) | (m_B) ^ 1); - t_AB_to_Q = NLTIME_FROM_NS(300); - t_C_to_Q = NLTIME_FROM_NS(250); - } - - if (res) - { - m_Q.push(0, t_C_to_Q); - m_QQ.push(1, t_C_to_Q); - /* quick charge until trigger */ - /* FIXME: SGS datasheet shows quick charge to 5V, - * though schematics indicate quick charge to Vhigh only. - */ - m_RP_Q.push(1, t_C_to_Q); // R_ON - m_RN_Q.push(0, t_C_to_Q); // R_OFF - m_state = 2; //charging (quick) - } - else if (!m_last_trig && m_trig) - { - // FIXME: Timing! - m_Q.push(1, t_AB_to_Q); - m_QQ.push(0,t_AB_to_Q); - - m_RN_Q.push(1, t_AB_to_Q); // R_ON - m_RP_Q.push(0, t_AB_to_Q); // R_OFF - - m_state = 1; // discharging - } - - m_last_trig = m_trig; - - if (m_state == 1) - { - const nl_fptype vLow = m_KP * m_RP.m_R.P()(); - if (m_CV() < vLow) - { - m_RN_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF - m_state = 2; // charging - } - } - if (m_state == 2) - { - const nl_fptype vHigh = m_RP.m_R.P()() * (nlconst::one() - m_KP); - if (m_CV() > vHigh) - { - m_RP_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF - - m_Q.push(0, NLTIME_FROM_NS(10)); - m_QQ.push(1, NLTIME_FROM_NS(10)); - m_state = 0; // waiting - } - } - } - - NETLIB_RESET(74123) - { - m_KP = plib::reciprocal(nlconst::one() + plib::exp(m_K())); - - m_RP.reset(); - m_RN.reset(); - - //m_RP.set_R(R_OFF); - //m_RN.set_R(R_OFF); - - m_last_trig = 0; - m_state = 0; - } - - NETLIB_UPDATE(74123_dip) - { - /* only called during startup */ - //_1.update_dev(); - //m_2.update_dev(); - } - - NETLIB_RESET(74123_dip) - { - //m_1.reset(); - //m_2.reset(); - } - - NETLIB_UPDATE(9602_dip) - { - /* only called during startup */ - //m_1.update_dev(); - //m_2.update_dev(); - } - - NETLIB_RESET(9602_dip) - { - //m_1.reset(); - //m_2.reset(); - } - NETLIB_UPDATE(4538_dip) { /* only called during startup */ @@ -304,6 +274,8 @@ namespace netlist m_B.reset(); } + using NETLIB_NAME(74123) = NETLIB_NAME(74123_base)<74123>; + NETLIB_DEVICE_IMPL(74123, "TTL_74123", "") NETLIB_DEVICE_IMPL(74123_dip, "TTL_74123_DIP", "") NETLIB_DEVICE_IMPL(4538_dip, "CD4538_DIP", "") diff --git a/src/lib/netlist/devices/nld_74153.cpp b/src/lib/netlist/devices/nld_74153.cpp index 729055767cc..6fa8fad4cb7 100644 --- a/src/lib/netlist/devices/nld_74153.cpp +++ b/src/lib/netlist/devices/nld_74153.cpp @@ -7,7 +7,6 @@ #include "nld_74153.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_74161.cpp b/src/lib/netlist/devices/nld_74161.cpp index 76a41d00e16..7c116948be3 100644 --- a/src/lib/netlist/devices/nld_74161.cpp +++ b/src/lib/netlist/devices/nld_74161.cpp @@ -7,7 +7,6 @@ #include "nld_74161.h" #include "netlist/nl_base.h" -#include "nlid_system.h" #include @@ -41,7 +40,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74161_dip); + private: logic_input_t m_A; logic_input_t m_B; logic_input_t m_C; @@ -61,29 +61,35 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74161_dip, 74161) + NETLIB_OBJECT(74161_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74161_dip, 74161) + NETLIB_CONSTRUCTOR(74161_dip) + , A(*this, "A") { - register_subalias("1", m_CLRQ); - register_subalias("2", m_CLK); - register_subalias("3", m_A); - register_subalias("4", m_B); - register_subalias("5", m_C); - register_subalias("6", m_D); - register_subalias("7", m_ENABLEP); - register_subalias("8", "GND"); - - register_subalias("9", m_LOADQ); - register_subalias("10", m_ENABLET); - register_subalias("11", m_Q[3]); - register_subalias("12", m_Q[2]); - register_subalias("13", m_Q[1]); - register_subalias("14", m_Q[0]); - register_subalias("15", m_RCO); - register_subalias("16", "VCC"); + register_subalias("1", A.m_CLRQ); + register_subalias("2", A.m_CLK); + register_subalias("3", A.m_A); + register_subalias("4", A.m_B); + register_subalias("5", A.m_C); + register_subalias("6", A.m_D); + register_subalias("7", A.m_ENABLEP); + register_subalias("8", "A.GND"); + register_subalias("9", A.m_LOADQ); + register_subalias("10", A.m_ENABLET); + register_subalias("11", A.m_Q[3]); + register_subalias("12", A.m_Q[2]); + register_subalias("13", A.m_Q[1]); + register_subalias("14", A.m_Q[0]); + register_subalias("15", A.m_RCO); + register_subalias("16", "A.VCC"); } + + NETLIB_RESETI() { } + NETLIB_UPDATEI() { } + + private: + NETLIB_SUB(74161) A; }; NETLIB_RESET(74161) diff --git a/src/lib/netlist/devices/nld_74164.cpp b/src/lib/netlist/devices/nld_74164.cpp index cb6b1c6972a..d42e49640a6 100644 --- a/src/lib/netlist/devices/nld_74164.cpp +++ b/src/lib/netlist/devices/nld_74164.cpp @@ -10,7 +10,6 @@ #include "nld_74164.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -33,7 +32,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74164_dip); + private: logic_input_t m_A; logic_input_t m_B; logic_input_t m_CLRQ; @@ -46,30 +46,29 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74164_dip, 74164) + NETLIB_OBJECT(74164_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74164_dip, 74164) + NETLIB_CONSTRUCTOR(74164_dip) + , A(*this, "A") { - register_subalias("1", m_A); - register_subalias("2", m_B); - register_subalias("3", m_Q[0]); - register_subalias("4", m_Q[1]); - register_subalias("5", m_Q[2]); - register_subalias("6", m_Q[3]); + register_subalias("1", A.m_A); + register_subalias("2", A.m_B); + register_subalias("3", A.m_Q[0]); + register_subalias("4", A.m_Q[1]); + register_subalias("5", A.m_Q[2]); + register_subalias("6", A.m_Q[3]); register_subalias("7", "A.GND"); - register_subalias("8", m_CLK); - register_subalias("9", m_CLRQ); - register_subalias("10", m_Q[4]); - register_subalias("11", m_Q[5]); - register_subalias("12", m_Q[6]); - register_subalias("13", m_Q[7]); + register_subalias("8", A.m_CLK); + register_subalias("9", A.m_CLRQ); + register_subalias("10", A.m_Q[4]); + register_subalias("11", A.m_Q[5]); + register_subalias("12", A.m_Q[6]); + register_subalias("13", A.m_Q[7]); register_subalias("14", "A.VCC"); - - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); - } + private: + NETLIB_SUB(74164) A; }; NETLIB_RESET(74164) diff --git a/src/lib/netlist/devices/nld_74165.cpp b/src/lib/netlist/devices/nld_74165.cpp index bf266f2d0dc..41ad825af9a 100644 --- a/src/lib/netlist/devices/nld_74165.cpp +++ b/src/lib/netlist/devices/nld_74165.cpp @@ -7,7 +7,6 @@ #include "nld_74165.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -32,7 +31,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74165_dip); + private: object_array_t m_DATA; logic_input_t m_SER; logic_input_t m_SH_LDQ; @@ -46,28 +46,33 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74165_dip, 74165) + NETLIB_OBJECT(74165_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74165_dip, 74165) + NETLIB_CONSTRUCTOR(74165_dip) + , A(*this, "A") { - register_subalias("1", m_SH_LDQ); - register_subalias("2", m_CLK); - register_subalias("3", m_DATA[4]); - register_subalias("4", m_DATA[5]); - register_subalias("5", m_DATA[6]); - register_subalias("6", m_DATA[7]); - register_subalias("7", m_QHQ); - register_subalias("8", "GND"); + register_subalias("1", A.m_SH_LDQ); + register_subalias("2", A.m_CLK); + register_subalias("3", A.m_DATA[4]); + register_subalias("4", A.m_DATA[5]); + register_subalias("5", A.m_DATA[6]); + register_subalias("6", A.m_DATA[7]); + register_subalias("7", A.m_QHQ); + register_subalias("8", "A.GND"); - register_subalias("9", m_QH); - register_subalias("10", m_SER); - register_subalias("11", m_DATA[0]); - register_subalias("12", m_DATA[1]); - register_subalias("13", m_DATA[2]); - register_subalias("14", m_DATA[3]); - register_subalias("15", m_CLKINH); - register_subalias("16", "VCC"); + register_subalias("9", A.m_QH); + register_subalias("10", A.m_SER); + register_subalias("11", A.m_DATA[0]); + register_subalias("12", A.m_DATA[1]); + register_subalias("13", A.m_DATA[2]); + register_subalias("14", A.m_DATA[3]); + register_subalias("15", A.m_CLKINH); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {}; + private: + NETLIB_SUB(74165) A; }; NETLIB_RESET(74165) diff --git a/src/lib/netlist/devices/nld_74166.cpp b/src/lib/netlist/devices/nld_74166.cpp index 4c598aa3156..75595342d15 100644 --- a/src/lib/netlist/devices/nld_74166.cpp +++ b/src/lib/netlist/devices/nld_74166.cpp @@ -7,7 +7,6 @@ #include "nld_74166.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -33,7 +32,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74166_dip); + private: object_array_t m_DATA; logic_input_t m_SER; logic_input_t m_CLRQ; @@ -48,28 +48,33 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74166_dip, 74166) + NETLIB_OBJECT(74166_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74166_dip, 74166) + NETLIB_CONSTRUCTOR(74166_dip) + , A(*this, "A") { - register_subalias("1", m_SER); - register_subalias("2", m_DATA[7]); - register_subalias("3", m_DATA[6]); - register_subalias("4", m_DATA[5]); - register_subalias("5", m_DATA[4]); - register_subalias("6", m_CLKINH); - register_subalias("7", m_CLK); - register_subalias("8", "GND"); + register_subalias("1", A.m_SER); + register_subalias("2", A.m_DATA[7]); + register_subalias("3", A.m_DATA[6]); + register_subalias("4", A.m_DATA[5]); + register_subalias("5", A.m_DATA[4]); + register_subalias("6", A.m_CLKINH); + register_subalias("7", A.m_CLK); + register_subalias("8", "A.GND"); - register_subalias("9", m_CLRQ); - register_subalias("10", m_DATA[3]); - register_subalias("11", m_DATA[2]); - register_subalias("12", m_DATA[1]); - register_subalias("13", m_QH); - register_subalias("14", m_DATA[0]); - register_subalias("15", m_SH_LDQ); - register_subalias("16", "VCC"); + register_subalias("9", A.m_CLRQ); + register_subalias("10", A.m_DATA[3]); + register_subalias("11", A.m_DATA[2]); + register_subalias("12", A.m_DATA[1]); + register_subalias("13", A.m_QH); + register_subalias("14", A.m_DATA[0]); + register_subalias("15", A.m_SH_LDQ); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(74166) A; }; NETLIB_RESET(74166) diff --git a/src/lib/netlist/devices/nld_74174.cpp b/src/lib/netlist/devices/nld_74174.cpp index f957547f223..c6073322082 100644 --- a/src/lib/netlist/devices/nld_74174.cpp +++ b/src/lib/netlist/devices/nld_74174.cpp @@ -7,7 +7,6 @@ #include "nld_74174.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -42,7 +41,8 @@ namespace devices } } - protected: + friend class NETLIB_NAME(74174_dip); + private: logic_input_t m_CLK; object_array_t m_Q; @@ -54,35 +54,39 @@ namespace devices nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74174_dip, 74174) + NETLIB_OBJECT(74174_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74174_dip, 74174) + NETLIB_CONSTRUCTOR(74174_dip) + , A(*this, "A") { - register_subalias("1", m_CLRQ); - register_subalias("9", m_CLK); + register_subalias("1", A.m_CLRQ); + register_subalias("9", A.m_CLK); - register_subalias("3", m_D[0]); - register_subalias("2", m_Q[0]); + register_subalias("3", A.m_D[0]); + register_subalias("2", A.m_Q[0]); - register_subalias("4", m_D[1]); - register_subalias("5", m_Q[1]); + register_subalias("4", A.m_D[1]); + register_subalias("5", A.m_Q[1]); - register_subalias("6", m_D[2]); - register_subalias("7", m_Q[2]); + register_subalias("6", A.m_D[2]); + register_subalias("7", A.m_Q[2]); - register_subalias("11", m_D[3]); - register_subalias("10", m_Q[3]); + register_subalias("11", A.m_D[3]); + register_subalias("10", A.m_Q[3]); - register_subalias("13", m_D[4]); - register_subalias("12", m_Q[4]); + register_subalias("13", A.m_D[4]); + register_subalias("12", A.m_Q[4]); - register_subalias("14", m_D[5]); - register_subalias("15", m_Q[5]); - - register_subalias("8", "GND"); - register_subalias("16", "VCC"); + register_subalias("14", A.m_D[5]); + register_subalias("15", A.m_Q[5]); + register_subalias("8", "A.GND"); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(74174) A; }; NETLIB_UPDATE(74174) diff --git a/src/lib/netlist/devices/nld_74175.cpp b/src/lib/netlist/devices/nld_74175.cpp index c7ad69d65b3..0a1ea12d7aa 100644 --- a/src/lib/netlist/devices/nld_74175.cpp +++ b/src/lib/netlist/devices/nld_74175.cpp @@ -7,7 +7,6 @@ #include "nld_74175.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -31,7 +30,8 @@ namespace netlist NETLIB_UPDATEI(); NETLIB_HANDLERI(clk); - protected: + friend class NETLIB_NAME(74175_dip); + private: object_array_t m_D; logic_input_t m_CLRQ; @@ -43,32 +43,37 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74175_dip, 74175) + NETLIB_OBJECT(74175_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74175_dip, 74175) + NETLIB_CONSTRUCTOR(74175_dip) + , A(*this, "A") { - register_subalias("9", m_CLK); - register_subalias("1", m_CLRQ); + register_subalias("9", A.m_CLK); + register_subalias("1", A.m_CLRQ); - register_subalias("4", m_D[0]); - register_subalias("2", m_Q[0]); - register_subalias("3", m_QQ[0]); + register_subalias("4", A.m_D[0]); + register_subalias("2", A.m_Q[0]); + register_subalias("3", A.m_QQ[0]); - register_subalias("5", m_D[1]); - register_subalias("7", m_Q[1]); - register_subalias("6", m_QQ[1]); + register_subalias("5", A.m_D[1]); + register_subalias("7", A.m_Q[1]); + register_subalias("6", A.m_QQ[1]); - register_subalias("12", m_D[2]); - register_subalias("10", m_Q[2]); - register_subalias("11", m_QQ[2]); + register_subalias("12", A.m_D[2]); + register_subalias("10", A.m_Q[2]); + register_subalias("11", A.m_QQ[2]); - register_subalias("13", m_D[3]); - register_subalias("15", m_Q[3]); - register_subalias("14", m_QQ[3]); + register_subalias("13", A.m_D[3]); + register_subalias("15", A.m_Q[3]); + register_subalias("14", A.m_QQ[3]); - register_subalias("8", "GND"); - register_subalias("16", "VCC"); + register_subalias("8", "A.GND"); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(74175) A; }; constexpr const std::array delay = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(25) }; diff --git a/src/lib/netlist/devices/nld_74192.cpp b/src/lib/netlist/devices/nld_74192.cpp index d2931bfc87c..c201efe1feb 100644 --- a/src/lib/netlist/devices/nld_74192.cpp +++ b/src/lib/netlist/devices/nld_74192.cpp @@ -7,7 +7,6 @@ #include "nld_74192.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -40,7 +39,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74192_dip); + private: logic_input_t m_CLEAR; logic_input_t m_LOADQ; logic_input_t m_CU; @@ -72,28 +72,33 @@ namespace netlist }; - NETLIB_OBJECT_DERIVED(74192_dip, 74192) + NETLIB_OBJECT(74192_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74192_dip, 74192) + NETLIB_CONSTRUCTOR(74192_dip) + , A(*this, "A") { - register_subalias("1", m_B); - register_subalias("2", m_Q[1]); - register_subalias("3", m_Q[0]); - register_subalias("4", m_CD); - register_subalias("5", m_CU); - register_subalias("6", m_Q[2]); - register_subalias("7", m_Q[3]); - register_subalias("8", "GND"); + register_subalias("1", A.m_B); + register_subalias("2", A.m_Q[1]); + register_subalias("3", A.m_Q[0]); + register_subalias("4", A.m_CD); + register_subalias("5", A.m_CU); + register_subalias("6", A.m_Q[2]); + register_subalias("7", A.m_Q[3]); + register_subalias("8", "A.GND"); - register_subalias("9", m_D); - register_subalias("10", m_C); - register_subalias("11", m_LOADQ); - register_subalias("12", m_CARRYQ); - register_subalias("13", m_BORROWQ); - register_subalias("14", m_CLEAR); - register_subalias("15", m_A); - register_subalias("16", "VCC"); + register_subalias("9", A.m_D); + register_subalias("10", A.m_C); + register_subalias("11", A.m_LOADQ); + register_subalias("12", A.m_CARRYQ); + register_subalias("13", A.m_BORROWQ); + register_subalias("14", A.m_CLEAR); + register_subalias("15", A.m_A); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(74192) A; }; NETLIB_RESET(74192) diff --git a/src/lib/netlist/devices/nld_74193.cpp b/src/lib/netlist/devices/nld_74193.cpp index e159c49426a..80866ecc1ee 100644 --- a/src/lib/netlist/devices/nld_74193.cpp +++ b/src/lib/netlist/devices/nld_74193.cpp @@ -7,7 +7,6 @@ #include "nld_74193.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -39,7 +38,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74193_dip); + private: logic_input_t m_A; logic_input_t m_B; logic_input_t m_C; @@ -59,28 +59,33 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74193_dip, 74193) + NETLIB_OBJECT(74193_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74193_dip, 74193) + NETLIB_CONSTRUCTOR(74193_dip) + , A(*this, "A") { - register_subalias("1", m_B); - register_subalias("2", m_Q[1]); - register_subalias("3", m_Q[0]); - register_subalias("4", m_CD); - register_subalias("5", m_CU); - register_subalias("6", m_Q[2]); - register_subalias("7", m_Q[3]); - register_subalias("8", "GND"); + register_subalias("1", A.m_B); + register_subalias("2", A.m_Q[1]); + register_subalias("3", A.m_Q[0]); + register_subalias("4", A.m_CD); + register_subalias("5", A.m_CU); + register_subalias("6", A.m_Q[2]); + register_subalias("7", A.m_Q[3]); + register_subalias("8", "A.GND"); - register_subalias("9", m_D); - register_subalias("10", m_C); - register_subalias("11", m_LOADQ); - register_subalias("12", m_CARRYQ); - register_subalias("13", m_BORROWQ); - register_subalias("14", m_CLEAR); - register_subalias("15", m_A); - register_subalias("16", "VCC"); + register_subalias("9", A.m_D); + register_subalias("10", A.m_C); + register_subalias("11", A.m_LOADQ); + register_subalias("12", A.m_CARRYQ); + register_subalias("13", A.m_BORROWQ); + register_subalias("14", A.m_CLEAR); + register_subalias("15", A.m_A); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(74193) A; }; NETLIB_RESET(74193) diff --git a/src/lib/netlist/devices/nld_74194.cpp b/src/lib/netlist/devices/nld_74194.cpp index fbffd650433..a5cce89feee 100644 --- a/src/lib/netlist/devices/nld_74194.cpp +++ b/src/lib/netlist/devices/nld_74194.cpp @@ -7,7 +7,6 @@ #include "nld_74194.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -33,7 +32,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74194_dip); + private: object_array_t m_DATA; logic_input_t m_SLIN; logic_input_t m_SRIN; @@ -48,29 +48,34 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74194_dip, 74194) + NETLIB_OBJECT(74194_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74194_dip, 74194) + NETLIB_CONSTRUCTOR(74194_dip) + , A(*this, "A") { - register_subalias("1", m_CLRQ); - register_subalias("2", m_SRIN); - register_subalias("3", m_DATA[3]); - register_subalias("4", m_DATA[2]); - register_subalias("5", m_DATA[1]); - register_subalias("6", m_DATA[0]); - register_subalias("7", m_SLIN); - register_subalias("8", "GND"); + register_subalias("1", A.m_CLRQ); + register_subalias("2", A.m_SRIN); + register_subalias("3", A.m_DATA[3]); + register_subalias("4", A.m_DATA[2]); + register_subalias("5", A.m_DATA[1]); + register_subalias("6", A.m_DATA[0]); + register_subalias("7", A.m_SLIN); + register_subalias("8", "A.GND"); - register_subalias("9", m_S0); - register_subalias("10", m_S1); - register_subalias("11", m_CLK); - register_subalias("12", m_Q[0]); - register_subalias("13", m_Q[1]); - register_subalias("14", m_Q[2]); - register_subalias("15", m_Q[3]); + register_subalias("9", A.m_S0); + register_subalias("10", A.m_S1); + register_subalias("11", A.m_CLK); + register_subalias("12", A.m_Q[0]); + register_subalias("13", A.m_Q[1]); + register_subalias("14", A.m_Q[2]); + register_subalias("15", A.m_Q[3]); register_subalias("16", "VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(74194) A; }; NETLIB_RESET(74194) diff --git a/src/lib/netlist/devices/nld_74365.cpp b/src/lib/netlist/devices/nld_74365.cpp index 92ef393e017..935d51b9916 100644 --- a/src/lib/netlist/devices/nld_74365.cpp +++ b/src/lib/netlist/devices/nld_74365.cpp @@ -7,7 +7,6 @@ #include "nld_74365.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -34,7 +33,8 @@ namespace netlist NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(74365_dip); + private: logic_input_t m_G1Q; logic_input_t m_G2Q; object_array_t m_A; @@ -42,29 +42,33 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74365_dip, 74365) + NETLIB_OBJECT(74365_dip) { - NETLIB_CONSTRUCTOR_DERIVED(74365_dip, 74365) + NETLIB_CONSTRUCTOR(74365_dip) + , A(*this, "A") { - register_subalias("1", m_G1Q); - register_subalias("2", m_A[0]); - register_subalias("3", m_Y[0]); - register_subalias("4", m_A[1]); - register_subalias("5", m_Y[1]); - register_subalias("6", m_A[2]); - register_subalias("7", m_Y[2]); - register_subalias("8", "GND"); - - register_subalias("9", m_A[3]); - register_subalias("10", m_Y[3]); - register_subalias("11", m_A[4]); - register_subalias("12", m_Y[4]); - register_subalias("13", m_A[5]); - register_subalias("14", m_Y[5]); - register_subalias("15", m_G2Q); - register_subalias("16", "VCC"); + register_subalias("1", A.m_G1Q); + register_subalias("2", A.m_A[0]); + register_subalias("3", A.m_Y[0]); + register_subalias("4", A.m_A[1]); + register_subalias("5", A.m_Y[1]); + register_subalias("6", A.m_A[2]); + register_subalias("7", A.m_Y[2]); + register_subalias("8", "A.GND"); + register_subalias("9", A.m_A[3]); + register_subalias("10", A.m_Y[3]); + register_subalias("11", A.m_A[4]); + register_subalias("12", A.m_Y[4]); + register_subalias("13", A.m_A[5]); + register_subalias("14", A.m_Y[5]); + register_subalias("15", A.m_G2Q); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(74365) A; }; NETLIB_UPDATE(74365) diff --git a/src/lib/netlist/devices/nld_74393.cpp b/src/lib/netlist/devices/nld_74393.cpp index 2cd84c32380..b63605dafca 100644 --- a/src/lib/netlist/devices/nld_74393.cpp +++ b/src/lib/netlist/devices/nld_74393.cpp @@ -7,7 +7,6 @@ #include "nld_74393.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7442.cpp b/src/lib/netlist/devices/nld_7442.cpp index 49356d7c6f7..e745b1785ba 100644 --- a/src/lib/netlist/devices/nld_7442.cpp +++ b/src/lib/netlist/devices/nld_7442.cpp @@ -7,7 +7,6 @@ #include "nld_7442.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -51,28 +50,33 @@ namespace devices nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7442_dip, 7442) + NETLIB_OBJECT(7442_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7442_dip, 7442) + NETLIB_CONSTRUCTOR(7442_dip) + , A(*this, "A") { - register_subalias("1", "Q0"); - register_subalias("2", "Q1"); - register_subalias("3", "Q2"); - register_subalias("4", "Q3"); - register_subalias("5", "Q4"); - register_subalias("6", "Q5"); - register_subalias("7", "Q6"); - register_subalias("8", "GND"); + register_subalias("1", "A.Q0"); + register_subalias("2", "A.Q1"); + register_subalias("3", "A.Q2"); + register_subalias("4", "A.Q3"); + register_subalias("5", "A.Q4"); + register_subalias("6", "A.Q5"); + register_subalias("7", "A.Q6"); + register_subalias("8", "A.GND"); - register_subalias("9", "Q7"); - register_subalias("10", "Q8"); - register_subalias("11", "Q9"); - register_subalias("12", "D"); - register_subalias("13", "C"); - register_subalias("14", "B"); - register_subalias("15", "A"); - register_subalias("16", "VCC"); + register_subalias("9", "A.Q7"); + register_subalias("10", "A.Q8"); + register_subalias("11", "A.Q9"); + register_subalias("12", "A.D"); + register_subalias("13", "A.C"); + register_subalias("14", "A.B"); + register_subalias("15", "A.A"); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7442) A; }; NETLIB_RESET(7442) diff --git a/src/lib/netlist/devices/nld_7448.cpp b/src/lib/netlist/devices/nld_7448.cpp index df3e6d60b32..e0943ac3a2c 100644 --- a/src/lib/netlist/devices/nld_7448.cpp +++ b/src/lib/netlist/devices/nld_7448.cpp @@ -6,7 +6,6 @@ */ #include "nld_7448.h" -#include "nlid_system.h" #include "nlid_truthtable.h" #include @@ -35,7 +34,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - public: + friend class NETLIB_NAME(7448_dip); + private: void update_outputs(unsigned v) noexcept { nl_assert(v<16); @@ -62,32 +62,35 @@ namespace netlist object_array_t m_Q; /* a .. g */ nld_power_pins m_power_pins; - private: + static const std::array tab7448; }; - NETLIB_OBJECT_DERIVED(7448_dip, 7448) + NETLIB_OBJECT(7448_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7448_dip, 7448) + NETLIB_CONSTRUCTOR(7448_dip) + , A(*this, "A") { - register_subalias("1", m_B); - register_subalias("2", m_C); - register_subalias("3", m_LTQ); - register_subalias("4", m_BIQ); - register_subalias("5", m_RBIQ); - register_subalias("6", m_D); - register_subalias("7", m_A); - register_subalias("8", "GND"); + register_subalias("1", A.m_B); + register_subalias("2", A.m_C); + register_subalias("3", A.m_LTQ); + register_subalias("4", A.m_BIQ); + register_subalias("5", A.m_RBIQ); + register_subalias("6", A.m_D); + register_subalias("7", A.m_A); + register_subalias("8", "A.GND"); - register_subalias("9", m_Q[4]); // e - register_subalias("10", m_Q[3]); // d - register_subalias("11", m_Q[2]); // c - register_subalias("12", m_Q[1]); // b - register_subalias("13", m_Q[0]); // a - register_subalias("14", m_Q[6]); // g - register_subalias("15", m_Q[5]); // f - register_subalias("16", "VCC"); + register_subalias("9", A.m_Q[4]); // e + register_subalias("10", A.m_Q[3]); // d + register_subalias("11", A.m_Q[2]); // c + register_subalias("12", A.m_Q[1]); // b + register_subalias("13", A.m_Q[0]); // a + register_subalias("14", A.m_Q[6]); // g + register_subalias("15", A.m_Q[5]); // f + register_subalias("16", "A.VCC"); } + private: + NETLIB_SUB(7448) A; }; #endif diff --git a/src/lib/netlist/devices/nld_7450.cpp b/src/lib/netlist/devices/nld_7450.cpp index 8187af87122..2adad87ffc1 100644 --- a/src/lib/netlist/devices/nld_7450.cpp +++ b/src/lib/netlist/devices/nld_7450.cpp @@ -7,7 +7,6 @@ #include "nld_7450.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7473.cpp b/src/lib/netlist/devices/nld_7473.cpp index 5c75115c970..199fbb931f1 100644 --- a/src/lib/netlist/devices/nld_7473.cpp +++ b/src/lib/netlist/devices/nld_7473.cpp @@ -7,7 +7,6 @@ #include "nld_7473.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { diff --git a/src/lib/netlist/devices/nld_7474.cpp b/src/lib/netlist/devices/nld_7474.cpp index 42d4d06b429..5d56d1708d4 100644 --- a/src/lib/netlist/devices/nld_7474.cpp +++ b/src/lib/netlist/devices/nld_7474.cpp @@ -8,7 +8,6 @@ #include "nld_7474.h" #include "netlist/nl_base.h" -#include "nlid_system.h" #include diff --git a/src/lib/netlist/devices/nld_7475.cpp b/src/lib/netlist/devices/nld_7475.cpp index 7e8c82b122e..e15c1718256 100644 --- a/src/lib/netlist/devices/nld_7475.cpp +++ b/src/lib/netlist/devices/nld_7475.cpp @@ -8,7 +8,6 @@ #include "nld_7475.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -32,7 +31,11 @@ namespace netlist void update_outputs(std::size_t start, std::size_t end); - public: + friend class NETLIB_NAME(7477_dip); + friend class NETLIB_NAME(7475_dip); + // FIXME: needs cleanup + friend class NETLIB_NAME(7475); + private: logic_input_t m_C1C2; logic_input_t m_C3C4; state_var m_last_Q; @@ -50,54 +53,66 @@ namespace netlist NETLIB_UPDATEI(); - public: + friend class NETLIB_NAME(7477_dip); + friend class NETLIB_NAME(7475_dip); + private: object_array_t m_QQ; }; - NETLIB_OBJECT_DERIVED(7475_dip, 7475) + NETLIB_OBJECT(7475_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7475_dip, 7475) + NETLIB_CONSTRUCTOR(7475_dip) + , A(*this, "A") { - register_subalias("1", m_QQ[0]); - register_subalias("2", m_D[0]); - register_subalias("3", m_D[1]); - register_subalias("4", m_C3C4); - register_subalias("5", "VCC"); - register_subalias("6", m_D[2]); - register_subalias("7", m_D[3]); - register_subalias("8", m_QQ[3]); + register_subalias("1", A.m_QQ[0]); + register_subalias("2", A.m_D[0]); + register_subalias("3", A.m_D[1]); + register_subalias("4", A.m_C3C4); + register_subalias("5", "A.VCC"); + register_subalias("6", A.m_D[2]); + register_subalias("7", A.m_D[3]); + register_subalias("8", A.m_QQ[3]); - register_subalias("9", m_Q[3]); - register_subalias("10", m_Q[2]); - register_subalias("11", m_QQ[2]); - register_subalias("12", "GND"); - register_subalias("13", m_C1C2); - register_subalias("14", m_QQ[1]); - register_subalias("15", m_Q[1]); - register_subalias("16", m_Q[0]); + register_subalias("9", A.m_Q[3]); + register_subalias("10", A.m_Q[2]); + register_subalias("11", A.m_QQ[2]); + register_subalias("12", "A.GND"); + register_subalias("13", A.m_C1C2); + register_subalias("14", A.m_QQ[1]); + register_subalias("15", A.m_Q[1]); + register_subalias("16", A.m_Q[0]); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7475) A; }; - NETLIB_OBJECT_DERIVED(7477_dip, 7477) + NETLIB_OBJECT(7477_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7477_dip, 7477) + NETLIB_CONSTRUCTOR(7477_dip) + , A(*this, "A") { - register_subalias("1", m_D[0]); - register_subalias("2", m_D[1]); - register_subalias("3", m_C3C4); - //register_subalias("4", ); ==> VCC - register_subalias("5", m_D[2]); - register_subalias("6", m_D[3]); + register_subalias("1", A.m_D[0]); + register_subalias("2", A.m_D[1]); + register_subalias("3", A.m_C3C4); + register_subalias("4", "A.VCC"); + register_subalias("5", A.m_D[2]); + register_subalias("6", A.m_D[3]); //register_subalias("7", ); ==> NC - register_subalias("8", m_Q[3]); - register_subalias("9", m_Q[2]); + register_subalias("8", A.m_Q[3]); + register_subalias("9", A.m_Q[2]); //register_subalias("10", ); ==> NC - //register_subalias("11", ); ==> GND - register_subalias("12", m_C1C2); - register_subalias("13", m_Q[1]); - register_subalias("14", m_Q[0]); + register_subalias("11", "A.GND"); + register_subalias("12", A.m_C1C2); + register_subalias("13", A.m_Q[1]); + register_subalias("14", A.m_Q[0]); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7477) A; }; NETLIB_UPDATE(7475) diff --git a/src/lib/netlist/devices/nld_7483.cpp b/src/lib/netlist/devices/nld_7483.cpp index a2c479a5488..b9d45d4d54d 100644 --- a/src/lib/netlist/devices/nld_7483.cpp +++ b/src/lib/netlist/devices/nld_7483.cpp @@ -7,7 +7,6 @@ #include "nld_7483.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -41,7 +40,8 @@ namespace netlist NETLIB_HANDLERI(upd_a); NETLIB_HANDLERI(upd_b); - protected: + friend class NETLIB_NAME(7483_dip); + private: logic_input_t m_C0; logic_input_t m_A1; logic_input_t m_A2; @@ -64,30 +64,33 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7483_dip, 7483) + NETLIB_OBJECT(7483_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7483_dip, 7483) + NETLIB_CONSTRUCTOR(7483_dip) + , A(*this, "A") { - register_subalias("1", m_A4); - register_subalias("2", m_S3); - register_subalias("3", m_A3); - register_subalias("4", m_B3); - register_subalias("5", "VCC"); - register_subalias("6", m_S2); - register_subalias("7", m_B2); - register_subalias("8", m_A2); + register_subalias("1", A.m_A4); + register_subalias("2", A.m_S3); + register_subalias("3", A.m_A3); + register_subalias("4", A.m_B3); + register_subalias("5", "A.VCC"); + register_subalias("6", A.m_S2); + register_subalias("7", A.m_B2); + register_subalias("8", A.m_A2); - register_subalias("9", m_S1); - register_subalias("10", m_A1); - register_subalias("11", m_B1); - register_subalias("12", "GND"); - register_subalias("13", m_C0); - register_subalias("14", m_C4); - register_subalias("15", m_S4); - register_subalias("16", m_B4); + register_subalias("9", A.m_S1); + register_subalias("10", A.m_A1); + register_subalias("11", A.m_B1); + register_subalias("12", "A.GND"); + register_subalias("13", A.m_C0); + register_subalias("14", A.m_C4); + register_subalias("15", A.m_S4); + register_subalias("16", A.m_B4); } - //NETLIB_RESETI(); - //NETLIB_UPDATEI(); + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7483) A; }; NETLIB_RESET(7483) diff --git a/src/lib/netlist/devices/nld_7485.cpp b/src/lib/netlist/devices/nld_7485.cpp index eaf952e4fe4..8ec04ac9a82 100644 --- a/src/lib/netlist/devices/nld_7485.cpp +++ b/src/lib/netlist/devices/nld_7485.cpp @@ -7,7 +7,6 @@ #include "nld_7485.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -32,7 +31,8 @@ namespace netlist void update_outputs(unsigned gt, unsigned lt, unsigned eq); - protected: + friend class NETLIB_NAME(7485_dip); + private: object_array_t m_A; object_array_t m_B; logic_input_t m_LTIN; @@ -44,29 +44,34 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7485_dip, 7485) + NETLIB_OBJECT(7485_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7485_dip, 7485) + NETLIB_CONSTRUCTOR(7485_dip) + , A(*this, "A") { - register_subalias("1", m_B[3]); - register_subalias("2", m_LTIN); - register_subalias("3", m_EQIN); - register_subalias("4", m_GTIN); - register_subalias("5", m_GTOUT); - register_subalias("6", m_EQOUT); - register_subalias("7", m_LTOUT); - register_subalias("8", "GND"); + register_subalias("1", A.m_B[3]); + register_subalias("2", A.m_LTIN); + register_subalias("3", A.m_EQIN); + register_subalias("4", A.m_GTIN); + register_subalias("5", A.m_GTOUT); + register_subalias("6", A.m_EQOUT); + register_subalias("7", A.m_LTOUT); + register_subalias("8", "A.GND"); - register_subalias("9", m_B[0]); - register_subalias("10", m_A[0]); - register_subalias("11", m_B[1]); - register_subalias("12", m_A[1]); - register_subalias("13", m_A[2]); - register_subalias("14", m_B[2]); - register_subalias("15", m_A[3]); - register_subalias("16", "VCC"); + register_subalias("9", A.m_B[0]); + register_subalias("10", A.m_A[0]); + register_subalias("11", A.m_B[1]); + register_subalias("12", A.m_A[1]); + register_subalias("13", A.m_A[2]); + register_subalias("14", A.m_B[2]); + register_subalias("15", A.m_A[3]); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7485) A; }; void NETLIB_NAME(7485)::update_outputs(unsigned gt, unsigned lt, unsigned eq) diff --git a/src/lib/netlist/devices/nld_7490.cpp b/src/lib/netlist/devices/nld_7490.cpp index 518d52dd87d..d8680e2a1d9 100644 --- a/src/lib/netlist/devices/nld_7490.cpp +++ b/src/lib/netlist/devices/nld_7490.cpp @@ -7,7 +7,6 @@ #include "nld_7490.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -64,27 +63,32 @@ namespace devices nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7490_dip, 7490) + NETLIB_OBJECT(7490_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7490_dip, 7490) + NETLIB_CONSTRUCTOR(7490_dip) + , A(*this, "A") { - register_subalias("1", "B"); - register_subalias("2", "R1"); - register_subalias("3", "R2"); + register_subalias("1", "A.B"); + register_subalias("2", "A.R1"); + register_subalias("3", "A.R2"); // register_subalias("4", ); --> NC - register_subalias("5", "VCC"); - register_subalias("6", "R91"); - register_subalias("7", "R92"); + register_subalias("5", "A.VCC"); + register_subalias("6", "A.R91"); + register_subalias("7", "A.R92"); - register_subalias("8", "QC"); - register_subalias("9", "QB"); - register_subalias("10", "GND"); - register_subalias("11", "QD"); - register_subalias("12", "QA"); + register_subalias("8", "A.QC"); + register_subalias("9", "A.QB"); + register_subalias("10", "A.GND"); + register_subalias("11", "A.QD"); + register_subalias("12", "A.QA"); // register_subalias("13", ); --> NC - register_subalias("14", "A"); + register_subalias("14", "A.A"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7490) A; }; NETLIB_RESET(7490) diff --git a/src/lib/netlist/devices/nld_7492.cpp b/src/lib/netlist/devices/nld_7492.cpp index acee92a5ee7..4bf6d316729 100644 --- a/src/lib/netlist/devices/nld_7492.cpp +++ b/src/lib/netlist/devices/nld_7492.cpp @@ -7,7 +7,6 @@ #include "nld_7492.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -60,27 +59,32 @@ namespace devices nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7492_dip, 7492) + NETLIB_OBJECT(7492_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7492_dip, 7492) + NETLIB_CONSTRUCTOR(7492_dip) + , A(*this, "A") { - register_subalias("1", "B"); + register_subalias("1", "A.B"); // register_subalias("2", ); --> NC // register_subalias("3", ); --> NC // register_subalias("4", ); --> NC - register_subalias("5", "VCC"); - register_subalias("6", "R1"); - register_subalias("7", "R2"); + register_subalias("5", "A.VCC"); + register_subalias("6", "A.R1"); + register_subalias("7", "A.R2"); - register_subalias("8", "QC"); - register_subalias("9", "QB"); - register_subalias("10", "GND"); - register_subalias("11", "QD"); - register_subalias("12", "QA"); + register_subalias("8", "A.QC"); + register_subalias("9", "A.QB"); + register_subalias("10", "A.GND"); + register_subalias("11", "A.QD"); + register_subalias("12", "A.QA"); // register_subalias("13", ); --> NC - register_subalias("14", "A"); + register_subalias("14", "A.A"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7492) A; }; NETLIB_RESET(7492) diff --git a/src/lib/netlist/devices/nld_7493.cpp b/src/lib/netlist/devices/nld_7493.cpp index 48c2b179073..ec2fd9f89fc 100644 --- a/src/lib/netlist/devices/nld_7493.cpp +++ b/src/lib/netlist/devices/nld_7493.cpp @@ -7,7 +7,6 @@ #include "nld_7493.h" #include "netlist/nl_base.h" -#include "nlid_system.h" //- Identifier: TTL_7493_DIP //- Title: 7493 Binary Counters @@ -153,27 +152,32 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7493_dip, 7493) + NETLIB_OBJECT(7493_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7493_dip, 7493) + NETLIB_CONSTRUCTOR(7493_dip) + , A(*this, "A") { - register_subalias("1", "CLKB"); - register_subalias("2", "R1"); - register_subalias("3", "R2"); + register_subalias("1", "A.CLKB"); + register_subalias("2", "A.R1"); + register_subalias("3", "A.R2"); // register_subalias("4", ); --> NC - register_subalias("5", "VCC"); + register_subalias("5", "A.VCC"); // register_subalias("6", ); --> NC // register_subalias("7", ); --> NC - register_subalias("8", "QC"); - register_subalias("9", "QB"); - register_subalias("10", "GND"); - register_subalias("11", "QD"); - register_subalias("12", "QA"); + register_subalias("8", "A.QC"); + register_subalias("9", "A.QB"); + register_subalias("10", "A.GND"); + register_subalias("11", "A.QD"); + register_subalias("12", "A.QA"); // register_subalias("13", ); -. NC - register_subalias("14", "CLKA"); + register_subalias("14", "A.CLKA"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7493) A; }; NETLIB_DEVICE_IMPL(7493, "TTL_7493", "+CLKA,+CLKB,+R1,+R2,@VCC,@GND") diff --git a/src/lib/netlist/devices/nld_7497.cpp b/src/lib/netlist/devices/nld_7497.cpp index 6429e33e8b6..a9aab390f27 100644 --- a/src/lib/netlist/devices/nld_7497.cpp +++ b/src/lib/netlist/devices/nld_7497.cpp @@ -11,7 +11,6 @@ #include "nld_7497.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -50,7 +49,8 @@ namespace netlist NETLIB_HANDLERI(clr); NETLIB_HANDLERI(clk_strb); - protected: + friend class NETLIB_NAME(7497_dip); + private: object_array_t m_B; logic_input_t m_CLK; logic_input_t m_STRBQ; @@ -147,28 +147,33 @@ namespace netlist } - NETLIB_OBJECT_DERIVED(7497_dip, 7497) + NETLIB_OBJECT(7497_dip) { - NETLIB_CONSTRUCTOR_DERIVED(7497_dip, 7497) + NETLIB_CONSTRUCTOR(7497_dip) + , A(*this, "A") { - register_subalias("1", m_B[4]); // B0 - register_subalias("2", m_B[1]); // B4 - register_subalias("3", m_B[0]); // B5 - register_subalias("4", m_B[5]); // B0 - register_subalias("5", m_ZQ); - register_subalias("6", m_Y); - register_subalias("7", m_ENOUTQ); - register_subalias("8", "GND"); + register_subalias("1", A.m_B[4]); // B0 + register_subalias("2", A.m_B[1]); // B4 + register_subalias("3", A.m_B[0]); // B5 + register_subalias("4", A.m_B[5]); // B0 + register_subalias("5", A.m_ZQ); + register_subalias("6", A.m_Y); + register_subalias("7", A.m_ENOUTQ); + register_subalias("8", "A.GND"); - register_subalias("9", m_CLK); - register_subalias("10", m_STRBQ); - register_subalias("11", m_UNITYQ); - register_subalias("12", m_ENQ); - register_subalias("13", m_CLR); - register_subalias("14", m_B[3]); // B2 - register_subalias("15", m_B[2]); // B3 - register_subalias("16", "VCC"); + register_subalias("9", A.m_CLK); + register_subalias("10", A.m_STRBQ); + register_subalias("11", A.m_UNITYQ); + register_subalias("12", A.m_ENQ); + register_subalias("13", A.m_CLR); + register_subalias("14", A.m_B[3]); // B2 + register_subalias("15", A.m_B[2]); // B3 + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(7497) A; }; diff --git a/src/lib/netlist/devices/nld_82S115.cpp b/src/lib/netlist/devices/nld_82S115.cpp index d0ee2490a05..2c0a0ef16e6 100644 --- a/src/lib/netlist/devices/nld_82S115.cpp +++ b/src/lib/netlist/devices/nld_82S115.cpp @@ -7,7 +7,6 @@ #include "nld_82S115.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -30,7 +29,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(82S115_dip); + private: object_array_t m_A; logic_input_t m_CE1Q; logic_input_t m_CE2; @@ -43,40 +43,46 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(82S115_dip, 82S115) + NETLIB_OBJECT(82S115_dip) { - NETLIB_CONSTRUCTOR_DERIVED(82S115_dip, 82S115) + NETLIB_CONSTRUCTOR(82S115_dip) + , A(*this, "A") { - register_subalias("21", m_A[0]); - register_subalias("22", m_A[1]); - register_subalias("23", m_A[2]); - register_subalias("1", m_A[3]); - register_subalias("2", m_A[4]); - register_subalias("3", m_A[5]); - register_subalias("4", m_A[6]); - register_subalias("5", m_A[7]); - register_subalias("6", m_A[8]); + register_subalias("21", A.m_A[0]); + register_subalias("22", A.m_A[1]); + register_subalias("23", A.m_A[2]); + register_subalias("1", A.m_A[3]); + register_subalias("2", A.m_A[4]); + register_subalias("3", A.m_A[5]); + register_subalias("4", A.m_A[6]); + register_subalias("5", A.m_A[7]); + register_subalias("6", A.m_A[8]); - register_subalias("20", m_CE1Q); - register_subalias("19", m_CE2); + register_subalias("20", A.m_CE1Q); + register_subalias("19", A.m_CE2); + // FIXME: implement FE1, FE2 // register_subalias("13", m_FE1); // register_subalias("11", m_FE2); - register_subalias("18", m_STROBE); + register_subalias("18", A.m_STROBE); - register_subalias("7", m_O[0]); - register_subalias("8", m_O[1]); - register_subalias("9", m_O[2]); - register_subalias("10", m_O[3]); - register_subalias("14", m_O[4]); - register_subalias("15", m_O[5]); - register_subalias("16", m_O[6]); - register_subalias("17", m_O[7]); + register_subalias("7", A.m_O[0]); + register_subalias("8", A.m_O[1]); + register_subalias("9", A.m_O[2]); + register_subalias("10", A.m_O[3]); + register_subalias("14", A.m_O[4]); + register_subalias("15", A.m_O[5]); + register_subalias("16", A.m_O[6]); + register_subalias("17", A.m_O[7]); - register_subalias("12", "GND"); - register_subalias("24", "VCC"); + register_subalias("12", "A.GND"); + register_subalias("24", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(82S115) A; }; NETLIB_RESET(82S115) diff --git a/src/lib/netlist/devices/nld_82S123.cpp b/src/lib/netlist/devices/nld_82S123.cpp index 1dedc8989ea..83a0074d134 100644 --- a/src/lib/netlist/devices/nld_82S123.cpp +++ b/src/lib/netlist/devices/nld_82S123.cpp @@ -7,7 +7,6 @@ #include "nld_82S123.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -26,7 +25,8 @@ namespace netlist NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(82S123_dip); + private: object_array_t m_A; logic_input_t m_CEQ; object_array_t m_O; @@ -35,28 +35,33 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(82S123_dip, 82S123) + NETLIB_OBJECT(82S123_dip) { - NETLIB_CONSTRUCTOR_DERIVED(82S123_dip, 82S123) + NETLIB_CONSTRUCTOR(82S123_dip) + , A(*this, "A") { - register_subalias("1", m_O[0]); - register_subalias("2", m_O[1]); - register_subalias("3", m_O[2]); - register_subalias("4", m_O[3]); - register_subalias("5", m_O[4]); - register_subalias("6", m_O[5]); - register_subalias("7", m_O[6]); - register_subalias("8", "GND"); + register_subalias("1", A.m_O[0]); + register_subalias("2", A.m_O[1]); + register_subalias("3", A.m_O[2]); + register_subalias("4", A.m_O[3]); + register_subalias("5", A.m_O[4]); + register_subalias("6", A.m_O[5]); + register_subalias("7", A.m_O[6]); + register_subalias("8", "A.GND"); - register_subalias("9", m_O[7]); - register_subalias("10", m_A[0]); - register_subalias("11", m_A[1]); - register_subalias("12", m_A[2]); - register_subalias("13", m_A[3]); - register_subalias("14", m_A[4]); - register_subalias("15", m_CEQ); - register_subalias("16", "VCC"); + register_subalias("9", A.m_O[7]); + register_subalias("10", A.m_A[0]); + register_subalias("11", A.m_A[1]); + register_subalias("12", A.m_A[2]); + register_subalias("13", A.m_A[3]); + register_subalias("14", A.m_A[4]); + register_subalias("15", A.m_CEQ); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(82S123) A; }; // FIXME: timing! diff --git a/src/lib/netlist/devices/nld_82S126.cpp b/src/lib/netlist/devices/nld_82S126.cpp index 9655ba67fb9..99bf3920a60 100644 --- a/src/lib/netlist/devices/nld_82S126.cpp +++ b/src/lib/netlist/devices/nld_82S126.cpp @@ -7,7 +7,6 @@ #include "nld_82S126.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -27,7 +26,8 @@ namespace netlist NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(82S126_dip); + private: object_array_t m_A; logic_input_t m_CE1Q; logic_input_t m_CE2Q; @@ -37,30 +37,35 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(82S126_dip, 82S126) + NETLIB_OBJECT(82S126_dip) { - NETLIB_CONSTRUCTOR_DERIVED(82S126_dip, 82S126) + NETLIB_CONSTRUCTOR(82S126_dip) + , A(*this, "A") { - register_subalias("5", m_A[0]); - register_subalias("6", m_A[1]); - register_subalias("7", m_A[2]); - register_subalias("4", m_A[3]); - register_subalias("3", m_A[4]); - register_subalias("2", m_A[5]); - register_subalias("1", m_A[6]); - register_subalias("15", m_A[7]); + register_subalias("5", A.m_A[0]); + register_subalias("6", A.m_A[1]); + register_subalias("7", A.m_A[2]); + register_subalias("4", A.m_A[3]); + register_subalias("3", A.m_A[4]); + register_subalias("2", A.m_A[5]); + register_subalias("1", A.m_A[6]); + register_subalias("15", A.m_A[7]); - register_subalias("13", m_CE1Q); - register_subalias("14", m_CE2Q); + register_subalias("13", A.m_CE1Q); + register_subalias("14", A.m_CE2Q); - register_subalias("12", m_O[0]); - register_subalias("11", m_O[1]); - register_subalias("10", m_O[2]); - register_subalias("9", m_O[3]); + register_subalias("12", A.m_O[0]); + register_subalias("11", A.m_O[1]); + register_subalias("10", A.m_O[2]); + register_subalias("9", A.m_O[3]); - register_subalias("8", "GND"); - register_subalias("16", "VCC"); + register_subalias("8", "A.GND"); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(82S126) A; }; // FIXME: timing! diff --git a/src/lib/netlist/devices/nld_82S16.cpp b/src/lib/netlist/devices/nld_82S16.cpp index b02fbcc08e5..0a3dbf8fd61 100644 --- a/src/lib/netlist/devices/nld_82S16.cpp +++ b/src/lib/netlist/devices/nld_82S16.cpp @@ -7,7 +7,6 @@ #include "nld_82S16.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -66,8 +65,8 @@ namespace netlist } } - - protected: + friend class NETLIB_NAME(82S16_dip); + private: object_array_t m_A; logic_input_t m_CE1Q; logic_input_t m_CE2Q; @@ -82,31 +81,36 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(82S16_dip, 82S16) + NETLIB_OBJECT(82S16_dip) { - NETLIB_CONSTRUCTOR_DERIVED(82S16_dip, 82S16) + NETLIB_CONSTRUCTOR(82S16_dip) + , A(*this, "A") { - register_subalias("2", m_A[0]); - register_subalias("1", m_A[1]); - register_subalias("15", m_A[2]); - register_subalias("14", m_A[3]); - register_subalias("7", m_A[4]); - register_subalias("9", m_A[5]); - register_subalias("10", m_A[6]); - register_subalias("11", m_A[7]); + register_subalias("2", A.m_A[0]); + register_subalias("1", A.m_A[1]); + register_subalias("15", A.m_A[2]); + register_subalias("14", A.m_A[3]); + register_subalias("7", A.m_A[4]); + register_subalias("9", A.m_A[5]); + register_subalias("10", A.m_A[6]); + register_subalias("11", A.m_A[7]); - register_subalias("3", m_CE1Q); - register_subalias("4", m_CE2Q); - register_subalias("5", m_CE3Q); + register_subalias("3", A.m_CE1Q); + register_subalias("4", A.m_CE2Q); + register_subalias("5", A.m_CE3Q); - register_subalias("12", m_WEQ); - register_subalias("13", m_DIN); + register_subalias("12", A.m_WEQ); + register_subalias("13", A.m_DIN); - register_subalias("6", m_DOUTQ); + register_subalias("6", A.m_DOUTQ); - register_subalias("8", "GND"); - register_subalias("16", "VCC"); + register_subalias("8", "A.GND"); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(82S16) A; }; // FIXME: timing! diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index 81c26928be3..2658026ea9e 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -7,7 +7,6 @@ #include "nld_9310.h" #include "netlist/nl_base.h" -#include "nlid_system.h" #define MAXCNT 9 @@ -78,7 +77,8 @@ namespace netlist m_cnt = cnt; } - protected: + friend class NETLIB_NAME(9310_dip); + private: unsigned read_ABCD() const { @@ -160,28 +160,34 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(9310_dip, 9310) + NETLIB_OBJECT(9310_dip) { - NETLIB_CONSTRUCTOR_DERIVED(9310_dip, 9310) + NETLIB_CONSTRUCTOR(9310_dip) + , A(*this, "A") { - register_subalias("1", m_CLRQ); - register_subalias("2", m_CLK); - register_subalias("3", m_A); - register_subalias("4", m_B); - register_subalias("5", m_C); - register_subalias("6", m_D); - register_subalias("7", m_ENP); - register_subalias("8", "GND"); + register_subalias("1", A.m_CLRQ); + register_subalias("2", A.m_CLK); + register_subalias("3", A.m_A); + register_subalias("4", A.m_B); + register_subalias("5", A.m_C); + register_subalias("6", A.m_D); + register_subalias("7", A.m_ENP); + register_subalias("8", "A.GND"); - register_subalias("9", m_LOADQ); - register_subalias("10", m_ENT); - register_subalias("11", m_QD); - register_subalias("12", m_QC); - register_subalias("13", m_QB); - register_subalias("14", m_QA); - register_subalias("15", m_RC); - register_subalias("16", "VCC"); + register_subalias("9", A.m_LOADQ); + register_subalias("10", A.m_ENT); + register_subalias("11", A.m_QD); + register_subalias("12", A.m_QC); + register_subalias("13", A.m_QB); + register_subalias("14", A.m_QA); + register_subalias("15", A.m_RC); + register_subalias("16", "A.VCC"); } + + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(9310) A; }; NETLIB_RESET(9310) diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp index 988de6eedc4..a6879ff6f47 100644 --- a/src/lib/netlist/devices/nld_9316.cpp +++ b/src/lib/netlist/devices/nld_9316.cpp @@ -7,7 +7,6 @@ #include "nld_9316.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -122,28 +121,31 @@ namespace netlist }; template - NETLIB_OBJECT_DERIVED(9316_dip_base, 9316_base) + NETLIB_OBJECT(9316_dip_base) { - NETLIB_CONSTRUCTOR_DERIVED(9316_dip_base, 9316_base) + NETLIB_CONSTRUCTOR(9316_dip_base) + , A(*this, "A") { - this->register_subalias("1", "CLRQ"); - this->register_subalias("2", "CLK"); - this->register_subalias("3", "A"); - this->register_subalias("4", "B"); - this->register_subalias("5", "C"); - this->register_subalias("6", "D"); - this->register_subalias("7", "ENP"); - this->register_subalias("8", "GND"); + this->register_subalias("1", "A.CLRQ"); + this->register_subalias("2", "A.CLK"); + this->register_subalias("3", "A.A"); + this->register_subalias("4", "A.B"); + this->register_subalias("5", "A.C"); + this->register_subalias("6", "A.D"); + this->register_subalias("7", "A.ENP"); + this->register_subalias("8", "A.GND"); - this->register_subalias("9", "LOADQ"); - this->register_subalias("10", "ENT"); - this->register_subalias("11", "QD"); - this->register_subalias("12", "QC"); - this->register_subalias("13", "QB"); - this->register_subalias("14", "QA"); - this->register_subalias("15", "RC"); - this->register_subalias("16", "VCC"); + this->register_subalias("9", "A.LOADQ"); + this->register_subalias("10", "A.ENT"); + this->register_subalias("11", "A.QD"); + this->register_subalias("12", "A.QC"); + this->register_subalias("13", "A.QB"); + this->register_subalias("14", "A.QA"); + this->register_subalias("15", "A.RC"); + this->register_subalias("16", "A.VCC"); } + private: + NETLIB_SUB(9316_base) A; }; using NETLIB_NAME(9316) = NETLIB_NAME(9316_base); diff --git a/src/lib/netlist/devices/nld_9322.cpp b/src/lib/netlist/devices/nld_9322.cpp index 14b0a846053..8bdf31afb42 100644 --- a/src/lib/netlist/devices/nld_9322.cpp +++ b/src/lib/netlist/devices/nld_9322.cpp @@ -7,7 +7,6 @@ #include "nld_9322.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -73,10 +72,11 @@ namespace netlist NETLIB_UPDATEI(); + friend class NETLIB_NAME(9322_dip); public: logic_input_t m_SELECT; logic_input_t m_STROBE; - protected: + private: NETLIB_SUB(9322_selector) m_1; NETLIB_SUB(9322_selector) m_2; NETLIB_SUB(9322_selector) m_3; @@ -84,28 +84,34 @@ namespace netlist }; - NETLIB_OBJECT_DERIVED(9322_dip, 9322) + NETLIB_OBJECT(9322_dip) { - NETLIB_CONSTRUCTOR_DERIVED(9322_dip, 9322) + NETLIB_CONSTRUCTOR(9322_dip) + , A(*this, "A") { - register_subalias("1", m_SELECT); - register_subalias("2", m_1.m_A); - register_subalias("3", m_1.m_B); - register_subalias("4", m_1.m_Y); - register_subalias("5", m_2.m_A); - register_subalias("6", m_2.m_B); - register_subalias("7", m_2.m_Y); - register_subalias("8", "GND"); + register_subalias("1", A.m_SELECT); + register_subalias("2", A.m_1.m_A); + register_subalias("3", A.m_1.m_B); + register_subalias("4", A.m_1.m_Y); + register_subalias("5", A.m_2.m_A); + register_subalias("6", A.m_2.m_B); + register_subalias("7", A.m_2.m_Y); + register_subalias("8", "A.GND"); - register_subalias("9", m_3.m_Y); - register_subalias("10", m_3.m_B); - register_subalias("11", m_3.m_A); - register_subalias("12", m_4.m_Y); - register_subalias("13", m_4.m_B); - register_subalias("14", m_4.m_A); - register_subalias("15", m_STROBE); - register_subalias("16", "VCC"); + register_subalias("9", A.m_3.m_Y); + register_subalias("10", A.m_3.m_B); + register_subalias("11", A.m_3.m_A); + register_subalias("12", A.m_4.m_Y); + register_subalias("13", A.m_4.m_B); + register_subalias("14", A.m_4.m_A); + register_subalias("15", A.m_STROBE); + register_subalias("16", "A.VCC"); } + + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(9322) A; }; // FIXME: Timing diff --git a/src/lib/netlist/devices/nld_am2847.cpp b/src/lib/netlist/devices/nld_am2847.cpp index 670477c6e06..f0dc228c7b9 100644 --- a/src/lib/netlist/devices/nld_am2847.cpp +++ b/src/lib/netlist/devices/nld_am2847.cpp @@ -7,7 +7,6 @@ #include "nld_am2847.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -88,7 +87,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(AM2847_dip); + private: NETLIB_SUB(Am2847_shifter) m_A; NETLIB_SUB(Am2847_shifter) m_B; NETLIB_SUB(Am2847_shifter) m_C; @@ -98,27 +98,32 @@ namespace netlist state_var m_last_CP; }; - NETLIB_OBJECT_DERIVED(AM2847_dip, AM2847) + NETLIB_OBJECT(AM2847_dip) { - NETLIB_CONSTRUCTOR_DERIVED(AM2847_dip, AM2847) + NETLIB_CONSTRUCTOR(AM2847_dip) + , A(*this, "A") { - register_subalias("1", m_A.m_OUT); - register_subalias("2", m_A.m_RC); - register_subalias("3", m_A.m_IN); - register_subalias("4", m_B.m_OUT); - register_subalias("5", m_B.m_RC); - register_subalias("6", m_B.m_IN); - register_subalias("7", m_C.m_OUT); - register_subalias("8", "VDD"); + register_subalias("1", A.m_A.m_OUT); + register_subalias("2", A.m_A.m_RC); + register_subalias("3", A.m_A.m_IN); + register_subalias("4", A.m_B.m_OUT); + register_subalias("5", A.m_B.m_RC); + register_subalias("6", A.m_B.m_IN); + register_subalias("7", A.m_C.m_OUT); + register_subalias("8", "A.VDD"); - register_subalias("9", m_C.m_RC); - register_subalias("10", m_C.m_IN); - register_subalias("11", m_CP); - register_subalias("13", m_D.m_OUT); - register_subalias("14", m_D.m_RC); - register_subalias("15", m_D.m_IN); - register_subalias("16", "VSS"); + register_subalias("9", A.m_C.m_RC); + register_subalias("10", A.m_C.m_IN); + register_subalias("11", A.m_CP); + register_subalias("13", A.m_D.m_OUT); + register_subalias("14", A.m_D.m_RC); + register_subalias("15", A.m_D.m_IN); + register_subalias("16", "A.VSS"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(AM2847) A; }; NETLIB_RESET(AM2847) diff --git a/src/lib/netlist/devices/nld_dm9314.cpp b/src/lib/netlist/devices/nld_dm9314.cpp index 22936f0bb05..6cb65a9ea90 100644 --- a/src/lib/netlist/devices/nld_dm9314.cpp +++ b/src/lib/netlist/devices/nld_dm9314.cpp @@ -7,7 +7,6 @@ #include "nld_dm9314.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -33,7 +32,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(9314_dip); + private: logic_input_t m_EQ; logic_input_t m_MRQ; object_array_t m_SQ; @@ -48,29 +48,31 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(9314_dip, 9314) + NETLIB_OBJECT(9314_dip) { - NETLIB_CONSTRUCTOR_DERIVED(9314_dip, 9314) + NETLIB_CONSTRUCTOR(9314_dip) + , A(*this, "A") { - register_subalias("1", m_EQ); - register_subalias("2", m_SQ[0]); - register_subalias("3", m_D[0]); - register_subalias("4", m_D[1]); - register_subalias("5", m_SQ[2]); - register_subalias("6", m_D[2]); - register_subalias("7", m_D[3]); - register_subalias("8", "GND"); - - register_subalias("9", m_MRQ); - register_subalias("10", m_Q[3]); - register_subalias("11", m_SQ[3]); - register_subalias("12", m_Q[2]); - register_subalias("13", m_Q[1]); - register_subalias("14", m_SQ[1]); - register_subalias("15", m_Q[0]); - register_subalias("16", "VCC"); + register_subalias("1", A.m_EQ); + register_subalias("2", A.m_SQ[0]); + register_subalias("3", A.m_D[0]); + register_subalias("4", A.m_D[1]); + register_subalias("5", A.m_SQ[2]); + register_subalias("6", A.m_D[2]); + register_subalias("7", A.m_D[3]); + register_subalias("8", "A.GND"); + register_subalias("9", A.m_MRQ); + register_subalias("10", A.m_Q[3]); + register_subalias("11", A.m_SQ[3]); + register_subalias("12", A.m_Q[2]); + register_subalias("13", A.m_Q[1]); + register_subalias("14", A.m_SQ[1]); + register_subalias("15", A.m_Q[0]); + register_subalias("16", "A.VCC"); } + private: + NETLIB_SUB(9314) A; }; NETLIB_RESET(9314) diff --git a/src/lib/netlist/devices/nld_dm9334.cpp b/src/lib/netlist/devices/nld_dm9334.cpp index 35aaebb258e..50878de8e0b 100644 --- a/src/lib/netlist/devices/nld_dm9334.cpp +++ b/src/lib/netlist/devices/nld_dm9334.cpp @@ -7,7 +7,6 @@ #include "nld_dm9334.h" #include "netlist/nl_base.h" -#include "nlid_system.h" namespace netlist { @@ -33,7 +32,8 @@ namespace netlist NETLIB_RESETI(); NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(9334_dip); + private: logic_input_t m_CQ; logic_input_t m_EQ; logic_input_t m_D; @@ -48,29 +48,34 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(9334_dip, 9334) + NETLIB_OBJECT(9334_dip) { - NETLIB_CONSTRUCTOR_DERIVED(9334_dip, 9334) + NETLIB_CONSTRUCTOR(9334_dip) + , A(*this, "A") { - register_subalias("1", m_A[0]); - register_subalias("2", m_A[1]); - register_subalias("3", m_A[2]); - register_subalias("4", m_Q[0]); - register_subalias("5", m_Q[1]); - register_subalias("6", m_Q[2]); - register_subalias("7", m_Q[3]); - register_subalias("8", "GND"); + register_subalias("1", A.m_A[0]); + register_subalias("2", A.m_A[1]); + register_subalias("3", A.m_A[2]); + register_subalias("4", A.m_Q[0]); + register_subalias("5", A.m_Q[1]); + register_subalias("6", A.m_Q[2]); + register_subalias("7", A.m_Q[3]); + register_subalias("8", "A.GND"); - register_subalias("9", m_Q[4]); - register_subalias("10", m_Q[5]); - register_subalias("11", m_Q[6]); - register_subalias("12", m_Q[7]); - register_subalias("13", m_D); - register_subalias("14", m_EQ); - register_subalias("15", m_CQ); - register_subalias("16", "VCC"); + register_subalias("9", A.m_Q[4]); + register_subalias("10", A.m_Q[5]); + register_subalias("11", A.m_Q[6]); + register_subalias("12", A.m_Q[7]); + register_subalias("13", A.m_D); + register_subalias("14", A.m_EQ); + register_subalias("15", A.m_CQ); + register_subalias("16", "A.VCC"); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(9334) A; }; NETLIB_RESET(9334) diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index 7c799c70718..793e8be842a 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -116,19 +116,24 @@ namespace netlist } }; - NETLIB_OBJECT_DERIVED(NE555_dip, NE555) + NETLIB_OBJECT(NE555_dip) { - NETLIB_CONSTRUCTOR_DERIVED(NE555_dip, NE555) + NETLIB_CONSTRUCTOR(NE555_dip) + , A(*this, "A") { - register_subalias("1", "GND"); // Pin 1 - register_subalias("2", "TRIG"); // Pin 2 - register_subalias("3", "OUT"); // Pin 3 - register_subalias("4", "RESET"); // Pin 4 - register_subalias("5", "CONT"); // Pin 5 - register_subalias("6", "THRESH"); // Pin 6 - register_subalias("7", "DISCH"); // Pin 7 - register_subalias("8", "VCC"); // Pin 8 + register_subalias("1", "A.GND"); // Pin 1 + register_subalias("2", "A.TRIG"); // Pin 2 + register_subalias("3", "A.OUT"); // Pin 3 + register_subalias("4", "A.RESET"); // Pin 4 + register_subalias("5", "A.CONT"); // Pin 5 + register_subalias("6", "A.THRESH"); // Pin 6 + register_subalias("7", "A.DISCH"); // Pin 7 + register_subalias("8", "A.VCC"); // Pin 8 } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(NE555) A; }; NETLIB_RESET(NE555) diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp index 16d822f5462..987691e371b 100644 --- a/src/lib/netlist/devices/nld_schmitt.cpp +++ b/src/lib/netlist/devices/nld_schmitt.cpp @@ -28,34 +28,33 @@ namespace netlist * */ - class schmitt_trigger_model_t : public param_model_t + class schmitt_trigger_model_t { public: - schmitt_trigger_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_VTP(*this, "VTP") - , m_VTM(*this, "VTM") - , m_VI(*this, "VI") - , m_RI(*this, "RI") - , m_VOH(*this, "VOH") - , m_ROH(*this, "ROH") - , m_VOL(*this, "VOL") - , m_ROL(*this, "ROL") - , m_TPLH(*this, "TPLH") - , m_TPHL(*this, "TPHL") + schmitt_trigger_model_t(param_model_t &model) + : m_VTP(model, "VTP") + , m_VTM(model, "VTM") + , m_VI(model, "VI") + , m_RI(model, "RI") + , m_VOH(model, "VOH") + , m_ROH(model, "ROH") + , m_VOL(model, "VOL") + , m_ROL(model, "ROL") + , m_TPLH(model, "TPLH") + , m_TPHL(model, "TPHL") { } - value_t m_VTP; - value_t m_VTM; - value_t m_VI; - value_t m_RI; - value_t m_VOH; - value_t m_ROH; - value_t m_VOL; - value_t m_ROL; - value_t m_TPLH; - value_t m_TPHL; + param_model_t::value_t m_VTP; + param_model_t::value_t m_VTM; + param_model_t::value_t m_VI; + param_model_t::value_t m_RI; + param_model_t::value_t m_VOH; + param_model_t::value_t m_ROH; + param_model_t::value_t m_VOL; + param_model_t::value_t m_ROL; + param_model_t::value_t m_TPLH; + param_model_t::value_t m_TPHL; }; NETLIB_OBJECT(schmitt_trigger) @@ -66,6 +65,7 @@ namespace netlist , m_RVI(*this, "RVI") , m_RVO(*this, "RVO") , m_model(*this, "MODEL", "TTL_7414_GATE") + , m_modacc(m_model) , m_last_state(*this, "m_last_var", 1) { register_subalias("Q", m_RVO.P()); @@ -81,8 +81,8 @@ namespace netlist m_last_state = 1; m_RVI.reset(); m_RVO.reset(); - m_RVI.set_G_V_I(plib::reciprocal(m_model.m_RI()), m_model.m_VI, nlconst::zero()); - m_RVO.set_G_V_I(plib::reciprocal(m_model.m_ROL()), m_model.m_VOL, nlconst::zero()); + m_RVI.set_G_V_I(plib::reciprocal(m_modacc.m_RI()), m_modacc.m_VI, nlconst::zero()); + m_RVO.set_G_V_I(plib::reciprocal(m_modacc.m_ROL()), m_modacc.m_VOL, nlconst::zero()); } NETLIB_UPDATEI() @@ -90,23 +90,23 @@ namespace netlist const auto va(m_A.Q_Analog() - m_supply.GND().Q_Analog()); if (m_last_state) { - if (va < m_model.m_VTM) + if (va < m_modacc.m_VTM) { m_last_state = 0; m_RVO.change_state([this]() { - m_RVO.set_G_V_I(plib::reciprocal(m_model.m_ROH()), m_model.m_VOH, nlconst::zero()); + m_RVO.set_G_V_I(plib::reciprocal(m_modacc.m_ROH()), m_modacc.m_VOH, nlconst::zero()); }); } } else { - if (va > m_model.m_VTP) + if (va > m_modacc.m_VTP) { m_last_state = 1; m_RVO.change_state([this]() { - m_RVO.set_G_V_I(plib::reciprocal(m_model.m_ROL()), m_model.m_VOL, nlconst::zero()); + m_RVO.set_G_V_I(plib::reciprocal(m_modacc.m_ROL()), m_modacc.m_VOL, nlconst::zero()); }); } } @@ -117,7 +117,8 @@ namespace netlist NETLIB_NAME(power_pins) m_supply; analog::NETLIB_SUB(twoterm) m_RVI; analog::NETLIB_SUB(twoterm) m_RVO; - schmitt_trigger_model_t m_model; + param_model_t m_model; + schmitt_trigger_model_t m_modacc; state_var m_last_state; }; diff --git a/src/lib/netlist/devices/nld_system.h b/src/lib/netlist/devices/nld_system.h index 9da5b32890d..70d54016fa8 100644 --- a/src/lib/netlist/devices/nld_system.h +++ b/src/lib/netlist/devices/nld_system.h @@ -67,10 +67,10 @@ NET_REGISTER_DEVEXT(SYS_DSW, name, pI, p1, p2) #define SYS_DSW2(name) \ - NET_REGISTER_DEVEXT(SYS_DSW2, name) + NET_REGISTER_DEV(SYS_DSW2, name) #define SYS_COMPD(name) \ - NET_REGISTER_DEVEXT(SYS_COMPD, name) + NET_REGISTER_DEV(SYS_COMPD, name) #define SYS_NOISE_MT_U(name, pSIGMA) \ NET_REGISTER_DEVEXT(SYS_NOISE_MT_U, name, pSIGMA) diff --git a/src/lib/netlist/devices/nld_tms4800.cpp b/src/lib/netlist/devices/nld_tms4800.cpp index 28788c30467..fa934a78211 100644 --- a/src/lib/netlist/devices/nld_tms4800.cpp +++ b/src/lib/netlist/devices/nld_tms4800.cpp @@ -29,7 +29,8 @@ namespace netlist NETLIB_UPDATEI(); - protected: + friend class NETLIB_NAME(TMS4800_dip); + private: object_array_t m_A; logic_input_t m_AR; logic_input_t m_OE1; @@ -42,35 +43,42 @@ namespace netlist NETLIB_NAME(power_pins) m_supply; }; - NETLIB_OBJECT_DERIVED(TMS4800_dip, TMS4800) + NETLIB_OBJECT(TMS4800_dip) { - NETLIB_CONSTRUCTOR_DERIVED(TMS4800_dip, TMS4800) + NETLIB_CONSTRUCTOR(TMS4800_dip) + , A(*this, "A") { - register_subalias("2", m_A[0]); - register_subalias("3", m_A[1]); - register_subalias("4", m_A[2]); - register_subalias("5", m_A[3]); - register_subalias("6", m_A[4]); - register_subalias("7", m_A[5]); - register_subalias("12", m_A[6]); - register_subalias("11", m_A[7]); - register_subalias("10", m_A[8]); - register_subalias("8", m_A[9]); - register_subalias("15", m_A[10]); + // FIXME: this device is missing supply pins + register_subalias("2", A.m_A[0]); + register_subalias("3", A.m_A[1]); + register_subalias("4", A.m_A[2]); + register_subalias("5", A.m_A[3]); + register_subalias("6", A.m_A[4]); + register_subalias("7", A.m_A[5]); + register_subalias("12", A.m_A[6]); + register_subalias("11", A.m_A[7]); + register_subalias("10", A.m_A[8]); + register_subalias("8", A.m_A[9]); + register_subalias("15", A.m_A[10]); - register_subalias("13", m_AR); - register_subalias("24", m_OE1); - register_subalias("14", m_OE2); + register_subalias("13", A.m_AR); + register_subalias("24", A.m_OE1); + register_subalias("14", A.m_OE2); - register_subalias("23", m_D[0]); - register_subalias("22", m_D[1]); - register_subalias("21", m_D[2]); - register_subalias("20", m_D[3]); - register_subalias("19", m_D[4]); - register_subalias("18", m_D[5]); - register_subalias("17", m_D[6]); - register_subalias("16", m_D[7]); + register_subalias("23", A.m_D[0]); + register_subalias("22", A.m_D[1]); + register_subalias("21", A.m_D[2]); + register_subalias("20", A.m_D[3]); + register_subalias("19", A.m_D[4]); + register_subalias("18", A.m_D[5]); + register_subalias("17", A.m_D[6]); + register_subalias("16", A.m_D[7]); } + NETLIB_RESETI() {} + NETLIB_UPDATEI() {} + private: + NETLIB_SUB(TMS4800) A; + }; // FIXME: timing! diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index 9e0531f80cb..b2c2b078083 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -43,40 +43,6 @@ namespace devices param_num_t m_max_link_loops; }; - // ----------------------------------------------------------------------------- - // power pins - not a device, but a helper - // ----------------------------------------------------------------------------- - - /// \brief Power pins class. - /// - /// Power Pins are passive inputs. Delegate noop will silently ignore any - /// updates. - - class nld_power_pins - { - public: - explicit nld_power_pins(device_t &owner, const pstring &sVCC = sPowerVCC, - const pstring &sGND = sPowerGND) - : m_VCC(owner, sVCC, NETLIB_DELEGATE(power_pins, noop)) - , m_GND(owner, sGND, NETLIB_DELEGATE(power_pins, noop)) - { - } - - const analog_input_t &VCC() const noexcept - { - return m_VCC; - } - const analog_input_t &GND() const noexcept - { - return m_GND; - } - - private: - void noop() { } - analog_input_t m_VCC; - analog_input_t m_GND; - }; - // ----------------------------------------------------------------------------- // clock // ----------------------------------------------------------------------------- @@ -127,12 +93,11 @@ namespace devices , m_feedback(*this, "FB") , m_Q(*this, "Q") , m_func(*this,"FUNC", "") - , m_compiled() + , m_compiled(*this, "m_compiled") , m_funcparam({nlconst::zero()}) { - m_compiled.save_state(*this, "m_compiled"); if (m_func() != "") - m_compiled.compile(m_func(), std::vector({{pstring("T")}})); + m_compiled->compile(m_func(), std::vector({{pstring("T")}})); connect(m_feedback, m_Q); } //NETLIB_RESETI(); @@ -141,7 +106,7 @@ namespace devices NETLIB_UPDATEI() { m_funcparam[0] = exec().time().as_fp(); - const netlist_time m_inc = netlist_time::from_fp(m_compiled.evaluate(m_funcparam)); + const netlist_time m_inc = netlist_time::from_fp(m_compiled->evaluate(m_funcparam)); m_Q.push(!m_feedback(), m_inc); } @@ -150,7 +115,7 @@ namespace devices logic_output_t m_Q; param_str_t m_func; - plib::pfunction m_compiled; + state_var> m_compiled; std::vector m_funcparam; }; @@ -396,9 +361,8 @@ namespace devices , m_N(*this, "N", 1) , m_func(*this, "FUNC", "A0") , m_Q(*this, "Q") - , m_compiled() + , m_compiled(*this, "m_compiled") { - m_compiled.save_state(*this, "m_compiled"); std::vector inps; for (int i=0; i < m_N(); i++) { @@ -407,7 +371,7 @@ namespace devices inps.push_back(inpname); m_vals.push_back(nlconst::zero()); } - m_compiled.compile(m_func(), inps); + m_compiled->compile(m_func(), inps); } protected: @@ -422,7 +386,7 @@ namespace devices { m_vals[i] = (*m_I[i])(); } - m_Q.push(m_compiled.evaluate(m_vals)); + m_Q.push(m_compiled->evaluate(m_vals)); } private: @@ -432,7 +396,7 @@ namespace devices std::vector> m_I; std::vector m_vals; - plib::pfunction m_compiled; + state_var> m_compiled; }; @@ -641,10 +605,9 @@ namespace devices , m_I(*this, "I") , m_RI(*this, "RI", nlconst::magic(0.1)) , m_sigma(*this, "SIGMA", nlconst::zero()) - , m_dis(m_sigma()) + , m_mt(*this, "m_mt") + , m_dis(*this, "m_dis",m_sigma()) { - m_mt.save_state(*this, "m_mt"); - m_dis.save_state(*this, "m_dis"); register_subalias("1", m_T.P()); register_subalias("2", m_T.N()); @@ -654,10 +617,10 @@ namespace devices NETLIB_UPDATEI() { - nl_fptype val = m_dis(m_mt); + nl_fptype val = m_dis.var()(m_mt.var()); m_T.change_state([this, val]() { - m_T.set_G_V_I(plib::reciprocal(m_RI()), val, nlconst::zero());; + m_T.set_G_V_I(plib::reciprocal(m_RI()), val, nlconst::zero()); }); } @@ -671,9 +634,8 @@ namespace devices logic_input_t m_I; param_fp_t m_RI; param_fp_t m_sigma; - engine m_mt; - distribution m_dis; - //std::normal_distribution m_dis; + state_var m_mt; + state_var m_dis; }; } // namespace devices diff --git a/src/lib/netlist/generated/static_solvers.cpp b/src/lib/netlist/generated/static_solvers.cpp index 1361aeea552..2417a3f34c0 100644 --- a/src/lib/netlist/generated/static_solvers.cpp +++ b/src/lib/netlist/generated/static_solvers.cpp @@ -1,5 +1,6 @@ #include "plib/pdynlib.h" +// gamemachine static void nl_gcr_111d6ad4781c136_19_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -94,6 +95,7 @@ const double f5 = 1.0 / m_A10; V[0] = (RHS0 - tmp0) / m_A0; } +// cheekyms static void nl_gcr_11995a0d28843023_150_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -784,6 +786,7 @@ const double f36 = 1.0 / m_A132; V[0] = (RHS0 - tmp0) / m_A0; } +// mario static void nl_gcr_15fa1a3cf923c9fd_29_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -928,6 +931,7 @@ const double f7 = 1.0 / m_A22; V[0] = (RHS0 - tmp0) / m_A0; } +// kidniki static void nl_gcr_169c14d438ffb621_198_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -1848,142 +1852,7 @@ const double f42 = 1.0 / m_A182; V[0] = (RHS0 - tmp0) / m_A0; } -static void nl_gcr_18deaad4b2fab70d_26_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) - -{ - -double m_A0(0.0); -double m_A1(0.0); -double m_A2(0.0); -double m_A3(0.0); -double m_A4(0.0); -double m_A5(0.0); -double m_A6(0.0); -double m_A7(0.0); -double m_A8(0.0); -double m_A9(0.0); -double m_A10(0.0); -double m_A11(0.0); -double m_A12(0.0); -double m_A13(0.0); -double m_A14(0.0); -double m_A15(0.0); -double m_A16(0.0); -double m_A17(0.0); -double m_A18(0.0); -double m_A19(0.0); -double m_A20(0.0); -double m_A21(0.0); -double m_A22(0.0); -double m_A23(0.0); -double m_A24(0.0); -double m_A25(0.0); - m_A0 = gt[0] + gt[1] + gt[2]; - m_A1 = m_A1 + go[0]; - double RHS0 = Idr[0] + Idr[1] + Idr[2] - go[1] * *cnV[1] - go[2] * *cnV[2]; - m_A2 = gt[10] + gt[11] + gt[12]; - m_A3 = m_A3 + go[10]; - double RHS1 = Idr[10] + Idr[11] + Idr[12] - go[11] * *cnV[11] - go[12] * *cnV[12]; - m_A4 = gt[20] + gt[21] + gt[22] + gt[23] + gt[24]; - m_A6 = m_A6 + go[20]; - m_A6 = m_A6 + go[21]; - m_A5 = m_A5 + go[22]; - double RHS2 = Idr[20] + Idr[21] + Idr[22] + Idr[23] + Idr[24] - go[23] * *cnV[23] - go[24] * *cnV[24]; - m_A8 = gt[30] + gt[31] + gt[32] + gt[33] + gt[34] + gt[35] + gt[36]; - m_A7 = m_A7 + go[30]; - m_A9 = m_A9 + go[31]; - m_A8 = m_A8 + go[32]; - m_A8 = m_A8 + go[33]; - double RHS3 = Idr[30] + Idr[31] + Idr[32] + Idr[33] + Idr[34] + Idr[35] + Idr[36] - go[34] * *cnV[34] - go[35] * *cnV[35] - go[36] * *cnV[36]; - m_A11 = gt[40] + gt[41]; - m_A12 = m_A12 + go[40]; - m_A10 = m_A10 + go[41]; - double RHS4 = Idr[40] + Idr[41]; - m_A14 = gt[50] + gt[51] + gt[52] + gt[53] + gt[54] + gt[55] + gt[56]; - m_A15 = m_A15 + go[50]; - m_A15 = m_A15 + go[51]; - m_A16 = m_A16 + go[52]; - m_A13 = m_A13 + go[53]; - double RHS5 = Idr[50] + Idr[51] + Idr[52] + Idr[53] + Idr[54] + Idr[55] + Idr[56] - go[54] * *cnV[54] - go[55] * *cnV[55] - go[56] * *cnV[56]; - m_A19 = gt[60] + gt[61] + gt[62] + gt[63] + gt[64] + gt[65] + gt[66] + gt[67] + gt[68] + gt[69]; - m_A20 = m_A20 + go[60]; - m_A20 = m_A20 + go[61]; - m_A18 = m_A18 + go[62]; - m_A18 = m_A18 + go[63]; - m_A17 = m_A17 + go[64]; - m_A17 = m_A17 + go[65]; - double RHS6 = Idr[60] + Idr[61] + Idr[62] + Idr[63] + Idr[64] + Idr[65] + Idr[66] + Idr[67] + Idr[68] + Idr[69] - go[66] * *cnV[66] - go[67] * *cnV[67] - go[68] * *cnV[68] - go[69] * *cnV[69]; - m_A25 = gt[70] + gt[71] + gt[72] + gt[73] + gt[74] + gt[75] + gt[76]; - m_A24 = m_A24 + go[70]; - m_A24 = m_A24 + go[71]; - m_A22 = m_A22 + go[72]; - m_A23 = m_A23 + go[73]; - m_A21 = m_A21 + go[74]; - double RHS7 = Idr[70] + Idr[71] + Idr[72] + Idr[73] + Idr[74] + Idr[75] + Idr[76] - go[75] * *cnV[75] - go[76] * *cnV[76]; -const double f0 = 1.0 / m_A0; - const double f0_3 = -f0 * m_A7; - m_A8 += m_A1 * f0_3; - RHS3 += f0_3 * RHS0; -const double f1 = 1.0 / m_A2; - const double f1_4 = -f1 * m_A10; - m_A11 += m_A3 * f1_4; - RHS4 += f1_4 * RHS1; -const double f2 = 1.0 / m_A4; - const double f2_5 = -f2 * m_A13; - m_A14 += m_A5 * f2_5; - m_A15 += m_A6 * f2_5; - RHS5 += f2_5 * RHS2; - const double f2_6 = -f2 * m_A17; - m_A18 += m_A5 * f2_6; - m_A19 += m_A6 * f2_6; - RHS6 += f2_6 * RHS2; -const double f3 = 1.0 / m_A8; - const double f3_7 = -f3 * m_A21; - m_A25 += m_A9 * f3_7; - RHS7 += f3_7 * RHS3; -const double f4 = 1.0 / m_A11; - const double f4_7 = -f4 * m_A22; - m_A25 += m_A12 * f4_7; - RHS7 += f4_7 * RHS4; -const double f5 = 1.0 / m_A14; - const double f5_6 = -f5 * m_A18; - m_A19 += m_A15 * f5_6; - m_A20 += m_A16 * f5_6; - RHS6 += f5_6 * RHS5; - const double f5_7 = -f5 * m_A23; - m_A24 += m_A15 * f5_7; - m_A25 += m_A16 * f5_7; - RHS7 += f5_7 * RHS5; -const double f6 = 1.0 / m_A19; - const double f6_7 = -f6 * m_A24; - m_A25 += m_A20 * f6_7; - RHS7 += f6_7 * RHS6; - V[7] = RHS7 / m_A25; - double tmp6 = 0.0; - tmp6 += m_A20 * V[7]; - V[6] = (RHS6 - tmp6) / m_A19; - double tmp5 = 0.0; - tmp5 += m_A15 * V[6]; - tmp5 += m_A16 * V[7]; - V[5] = (RHS5 - tmp5) / m_A14; - double tmp4 = 0.0; - tmp4 += m_A12 * V[7]; - V[4] = (RHS4 - tmp4) / m_A11; - double tmp3 = 0.0; - tmp3 += m_A9 * V[7]; - V[3] = (RHS3 - tmp3) / m_A8; - double tmp2 = 0.0; - tmp2 += m_A5 * V[5]; - tmp2 += m_A6 * V[6]; - V[2] = (RHS2 - tmp2) / m_A4; - double tmp1 = 0.0; - tmp1 += m_A3 * V[4]; - V[1] = (RHS1 - tmp1) / m_A2; - double tmp0 = 0.0; - tmp0 += m_A1 * V[3]; - V[0] = (RHS0 - tmp0) / m_A0; -} - +// cheekyms static void nl_gcr_19f6e9708f37ad65_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -2022,7 +1891,8 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } -static void nl_gcr_1e27a9bddeac729d_64_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) +// zac1b11142 +static void nl_gcr_1dd100c8f34cf889_96_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -2090,258 +1960,384 @@ double m_A60(0.0); double m_A61(0.0); double m_A62(0.0); double m_A63(0.0); - m_A0 = gt[0] + gt[1] + gt[2] + gt[3] + gt[4]; +double m_A64(0.0); +double m_A65(0.0); +double m_A66(0.0); +double m_A67(0.0); +double m_A68(0.0); +double m_A69(0.0); +double m_A70(0.0); +double m_A71(0.0); +double m_A72(0.0); +double m_A73(0.0); +double m_A74(0.0); +double m_A75(0.0); +double m_A76(0.0); +double m_A77(0.0); +double m_A78(0.0); +double m_A79(0.0); +double m_A80(0.0); +double m_A81(0.0); +double m_A82(0.0); +double m_A83(0.0); +double m_A84(0.0); +double m_A85(0.0); +double m_A86(0.0); +double m_A87(0.0); +double m_A88(0.0); +double m_A89(0.0); +double m_A90(0.0); +double m_A91(0.0); +double m_A92(0.0); +double m_A93(0.0); +double m_A94(0.0); +double m_A95(0.0); + m_A0 = gt[0] + gt[1]; m_A1 = m_A1 + go[0]; - m_A2 = m_A2 + go[1]; - m_A2 = m_A2 + go[2]; - double RHS0 = Idr[0] + Idr[1] + Idr[2] + Idr[3] + Idr[4] - go[3] * *cnV[3] - go[4] * *cnV[4]; - m_A3 = gt[10] + gt[11] + gt[12] + gt[13] + gt[14] + gt[15] + gt[16]; - m_A4 = m_A4 + go[10]; - m_A3 = m_A3 + go[11]; - m_A3 = m_A3 + go[12]; - double RHS1 = Idr[10] + Idr[11] + Idr[12] + Idr[13] + Idr[14] + Idr[15] + Idr[16] - go[13] * *cnV[13] - go[14] * *cnV[14] - go[15] * *cnV[15] - go[16] * *cnV[16]; - m_A5 = gt[20] + gt[21]; - m_A6 = m_A6 + go[20]; - double RHS2 = Idr[20] + Idr[21] - go[21] * *cnV[21]; - m_A7 = gt[30] + gt[31] + gt[32] + gt[33]; - m_A8 = m_A8 + go[30]; - double RHS3 = Idr[30] + Idr[31] + Idr[32] + Idr[33] - go[31] * *cnV[31] - go[32] * *cnV[32] - go[33] * *cnV[33]; - m_A9 = gt[40] + gt[41] + gt[42] + gt[43] + gt[44]; - m_A10 = m_A10 + go[40]; - m_A11 = m_A11 + go[41]; - m_A11 = m_A11 + go[42]; - double RHS4 = Idr[40] + Idr[41] + Idr[42] + Idr[43] + Idr[44] - go[43] * *cnV[43] - go[44] * *cnV[44]; - m_A12 = gt[50] + gt[51]; - m_A13 = m_A13 + go[50]; - m_A14 = m_A14 + go[51]; - double RHS5 = Idr[50] + Idr[51]; - m_A15 = gt[60] + gt[61] + gt[62] + gt[63] + gt[64] + gt[65]; - m_A17 = m_A17 + go[60]; - m_A18 = m_A18 + go[61]; - m_A16 = m_A16 + go[62]; - m_A19 = m_A19 + go[63]; - double RHS6 = Idr[60] + Idr[61] + Idr[62] + Idr[63] + Idr[64] + Idr[65] - go[64] * *cnV[64] - go[65] * *cnV[65]; - m_A22 = gt[70] + gt[71] + gt[72] + gt[73] + gt[74] + gt[75] + gt[76]; - m_A20 = m_A20 + go[70]; - m_A21 = m_A21 + go[71]; - m_A22 = m_A22 + go[72]; - m_A22 = m_A22 + go[73]; - double RHS7 = Idr[70] + Idr[71] + Idr[72] + Idr[73] + Idr[74] + Idr[75] + Idr[76] - go[74] * *cnV[74] - go[75] * *cnV[75] - go[76] * *cnV[76]; - m_A27 = gt[80] + gt[81] + gt[82] + gt[83] + gt[84] + gt[85] + gt[86]; - m_A28 = m_A28 + go[80]; - m_A29 = m_A29 + go[81]; - m_A29 = m_A29 + go[82]; - m_A26 = m_A26 + go[83]; - double RHS8 = Idr[80] + Idr[81] + Idr[82] + Idr[83] + Idr[84] + Idr[85] + Idr[86] - go[84] * *cnV[84] - go[85] * *cnV[85] - go[86] * *cnV[86]; - m_A33 = gt[90] + gt[91] + gt[92] + gt[93]; - m_A31 = m_A31 + go[90]; - m_A30 = m_A30 + go[91]; - m_A35 = m_A35 + go[92]; - double RHS9 = Idr[90] + Idr[91] + Idr[92] + Idr[93] - go[93] * *cnV[93]; - m_A41 = gt[100] + gt[101] + gt[102] + gt[103] + gt[104] + gt[105] + gt[106]; - m_A38 = m_A38 + go[100]; - m_A42 = m_A42 + go[101]; - m_A42 = m_A42 + go[102]; - m_A37 = m_A37 + go[103]; - double RHS10 = Idr[100] + Idr[101] + Idr[102] + Idr[103] + Idr[104] + Idr[105] + Idr[106] - go[104] * *cnV[104] - go[105] * *cnV[105] - go[106] * *cnV[106]; - m_A49 = gt[110] + gt[111] + gt[112] + gt[113] + gt[114] + gt[115] + gt[116] + gt[117] + gt[118] + gt[119]; - m_A45 = m_A45 + go[110]; - m_A47 = m_A47 + go[111]; - m_A48 = m_A48 + go[112]; - m_A48 = m_A48 + go[113]; - m_A44 = m_A44 + go[114]; - m_A44 = m_A44 + go[115]; - double RHS11 = Idr[110] + Idr[111] + Idr[112] + Idr[113] + Idr[114] + Idr[115] + Idr[116] + Idr[117] + Idr[118] + Idr[119] - go[116] * *cnV[116] - go[117] * *cnV[117] - go[118] * *cnV[118] - go[119] * *cnV[119]; - m_A54 = gt[120] + gt[121] + gt[122] + gt[123] + gt[124] + gt[125]; - m_A52 = m_A52 + go[120]; - m_A53 = m_A53 + go[121]; - m_A51 = m_A51 + go[122]; - m_A55 = m_A55 + go[123]; - double RHS12 = Idr[120] + Idr[121] + Idr[122] + Idr[123] + Idr[124] + Idr[125] - go[124] * *cnV[124] - go[125] * *cnV[125]; - m_A63 = gt[130] + gt[131] + gt[132] + gt[133] + gt[134] + gt[135] + gt[136] + gt[137] + gt[138]; - m_A57 = m_A57 + go[130]; - m_A58 = m_A58 + go[131]; - m_A58 = m_A58 + go[132]; - m_A62 = m_A62 + go[133]; - m_A56 = m_A56 + go[134]; - m_A56 = m_A56 + go[135]; - double RHS13 = Idr[130] + Idr[131] + Idr[132] + Idr[133] + Idr[134] + Idr[135] + Idr[136] + Idr[137] + Idr[138] - go[136] * *cnV[136] - go[137] * *cnV[137] - go[138] * *cnV[138]; + double RHS0 = Idr[0] + Idr[1] - go[1] * *cnV[1]; + m_A2 = gt[8] + gt[9] + gt[10] + gt[11] + gt[12] + gt[13] + gt[14]; + m_A3 = m_A3 + go[8]; + double RHS1 = Idr[8] + Idr[9] + Idr[10] + Idr[11] + Idr[12] + Idr[13] + Idr[14] - go[9] * *cnV[9] - go[10] * *cnV[10] - go[11] * *cnV[11] - go[12] * *cnV[12] - go[13] * *cnV[13] - go[14] * *cnV[14]; + m_A4 = gt[16] + gt[17]; + m_A5 = m_A5 + go[16]; + double RHS2 = Idr[16] + Idr[17] - go[17] * *cnV[17]; + m_A6 = gt[24] + gt[25] + gt[26] + gt[27] + gt[28] + gt[29] + gt[30]; + m_A7 = m_A7 + go[24]; + double RHS3 = Idr[24] + Idr[25] + Idr[26] + Idr[27] + Idr[28] + Idr[29] + Idr[30] - go[25] * *cnV[25] - go[26] * *cnV[26] - go[27] * *cnV[27] - go[28] * *cnV[28] - go[29] * *cnV[29] - go[30] * *cnV[30]; + m_A8 = gt[32] + gt[33] + gt[34] + gt[35] + gt[36] + gt[37] + gt[38]; + m_A9 = m_A9 + go[32]; + double RHS4 = Idr[32] + Idr[33] + Idr[34] + Idr[35] + Idr[36] + Idr[37] + Idr[38] - go[33] * *cnV[33] - go[34] * *cnV[34] - go[35] * *cnV[35] - go[36] * *cnV[36] - go[37] * *cnV[37] - go[38] * *cnV[38]; + m_A10 = gt[40] + gt[41] + gt[42] + gt[43] + gt[44]; + m_A11 = m_A11 + go[40]; + m_A12 = m_A12 + go[41]; + double RHS5 = Idr[40] + Idr[41] + Idr[42] + Idr[43] + Idr[44] - go[42] * *cnV[42] - go[43] * *cnV[43] - go[44] * *cnV[44]; + m_A13 = gt[48] + gt[49] + gt[50]; + m_A14 = m_A14 + go[48]; + double RHS6 = Idr[48] + Idr[49] + Idr[50] - go[49] * *cnV[49] - go[50] * *cnV[50]; + m_A15 = gt[56] + gt[57]; + m_A16 = m_A16 + go[56]; + double RHS7 = Idr[56] + Idr[57] - go[57] * *cnV[57]; + m_A17 = gt[64] + gt[65] + gt[66]; + m_A18 = m_A18 + go[64]; + double RHS8 = Idr[64] + Idr[65] + Idr[66] - go[65] * *cnV[65] - go[66] * *cnV[66]; + m_A20 = gt[72] + gt[73]; + m_A19 = m_A19 + go[72]; + double RHS9 = Idr[72] + Idr[73] - go[73] * *cnV[73]; + m_A21 = gt[80] + gt[81] + gt[82]; + m_A22 = m_A22 + go[80]; + double RHS10 = Idr[80] + Idr[81] + Idr[82] - go[81] * *cnV[81] - go[82] * *cnV[82]; + m_A23 = gt[88] + gt[89] + gt[90]; + m_A24 = m_A24 + go[88]; + m_A25 = m_A25 + go[89]; + double RHS11 = Idr[88] + Idr[89] + Idr[90] - go[90] * *cnV[90]; + m_A26 = gt[96] + gt[97] + gt[98]; + m_A27 = m_A27 + go[96]; + double RHS12 = Idr[96] + Idr[97] + Idr[98] - go[97] * *cnV[97] - go[98] * *cnV[98]; + m_A29 = gt[104] + gt[105]; + m_A28 = m_A28 + go[104]; + double RHS13 = Idr[104] + Idr[105] - go[105] * *cnV[105]; + m_A31 = gt[112] + gt[113] + gt[114] + gt[115] + gt[116]; + m_A30 = m_A30 + go[112]; + m_A33 = m_A33 + go[113]; + double RHS14 = Idr[112] + Idr[113] + Idr[114] + Idr[115] + Idr[116] - go[114] * *cnV[114] - go[115] * *cnV[115] - go[116] * *cnV[116]; + m_A35 = gt[120] + gt[121] + gt[122]; + m_A37 = m_A37 + go[120]; + m_A34 = m_A34 + go[121]; + double RHS15 = Idr[120] + Idr[121] + Idr[122] - go[122] * *cnV[122]; + m_A39 = gt[128] + gt[129] + gt[130] + gt[131] + gt[132]; + m_A38 = m_A38 + go[128]; + m_A41 = m_A41 + go[129]; + double RHS16 = Idr[128] + Idr[129] + Idr[130] + Idr[131] + Idr[132] - go[130] * *cnV[130] - go[131] * *cnV[131] - go[132] * *cnV[132]; + m_A44 = gt[136] + gt[137]; + m_A43 = m_A43 + go[136]; + m_A42 = m_A42 + go[137]; + double RHS17 = Idr[136] + Idr[137]; + m_A47 = gt[144] + gt[145] + gt[146]; + m_A48 = m_A48 + go[144]; + m_A45 = m_A45 + go[145]; + double RHS18 = Idr[144] + Idr[145] + Idr[146] - go[146] * *cnV[146]; + m_A51 = gt[152] + gt[153] + gt[154] + gt[155]; + m_A52 = m_A52 + go[152]; + m_A50 = m_A50 + go[153]; + double RHS19 = Idr[152] + Idr[153] + Idr[154] + Idr[155] - go[154] * *cnV[154] - go[155] * *cnV[155]; + m_A54 = gt[160] + gt[161]; + m_A56 = m_A56 + go[160]; + m_A53 = m_A53 + go[161]; + double RHS20 = Idr[160] + Idr[161]; + m_A58 = gt[168] + gt[169] + gt[170] + gt[171]; + m_A59 = m_A59 + go[168]; + m_A57 = m_A57 + go[169]; + double RHS21 = Idr[168] + Idr[169] + Idr[170] + Idr[171] - go[170] * *cnV[170] - go[171] * *cnV[171]; + m_A64 = gt[176] + gt[177] + gt[178] + gt[179] + gt[180] + gt[181]; + m_A60 = m_A60 + go[176]; + m_A61 = m_A61 + go[177]; + m_A66 = m_A66 + go[178]; + m_A66 = m_A66 + go[179]; + double RHS22 = Idr[176] + Idr[177] + Idr[178] + Idr[179] + Idr[180] + Idr[181] - go[180] * *cnV[180] - go[181] * *cnV[181]; + m_A73 = gt[184] + gt[185] + gt[186] + gt[187] + gt[188]; + m_A69 = m_A69 + go[184]; + m_A70 = m_A70 + go[185]; + m_A71 = m_A71 + go[186]; + m_A68 = m_A68 + go[187]; + m_A67 = m_A67 + go[188]; + double RHS23 = Idr[184] + Idr[185] + Idr[186] + Idr[187] + Idr[188]; + m_A76 = gt[192] + gt[193] + gt[194] + gt[195]; + m_A77 = m_A77 + go[192]; + m_A75 = m_A75 + go[193]; + double RHS24 = Idr[192] + Idr[193] + Idr[194] + Idr[195] - go[194] * *cnV[194] - go[195] * *cnV[195]; + m_A85 = gt[200] + gt[201] + gt[202] + gt[203] + gt[204]; + m_A81 = m_A81 + go[200]; + m_A80 = m_A80 + go[201]; + m_A82 = m_A82 + go[202]; + m_A79 = m_A79 + go[203]; + m_A78 = m_A78 + go[204]; + double RHS25 = Idr[200] + Idr[201] + Idr[202] + Idr[203] + Idr[204]; + m_A95 = gt[208] + gt[209] + gt[210] + gt[211] + gt[212] + gt[213] + gt[214] + gt[215]; + m_A89 = m_A89 + go[208]; + m_A92 = m_A92 + go[209]; + m_A92 = m_A92 + go[210]; + m_A90 = m_A90 + go[211]; + m_A88 = m_A88 + go[212]; + m_A87 = m_A87 + go[213]; + double RHS26 = Idr[208] + Idr[209] + Idr[210] + Idr[211] + Idr[212] + Idr[213] + Idr[214] + Idr[215] - go[214] * *cnV[214] - go[215] * *cnV[215]; const double f0 = 1.0 / m_A0; - const double f0_8 = -f0 * m_A26; - m_A27 += m_A1 * f0_8; - m_A29 += m_A2 * f0_8; - RHS8 += f0_8 * RHS0; - const double f0_13 = -f0 * m_A56; - m_A58 += m_A1 * f0_13; - m_A63 += m_A2 * f0_13; - RHS13 += f0_13 * RHS0; -const double f1 = 1.0 / m_A3; - const double f1_12 = -f1 * m_A51; - m_A54 += m_A4 * f1_12; - RHS12 += f1_12 * RHS1; -const double f2 = 1.0 / m_A5; - const double f2_12 = -f2 * m_A52; - m_A54 += m_A6 * f2_12; - RHS12 += f2_12 * RHS2; -const double f3 = 1.0 / m_A7; - const double f3_7 = -f3 * m_A20; - m_A22 += m_A8 * f3_7; - RHS7 += f3_7 * RHS3; -const double f4 = 1.0 / m_A9; - const double f4_10 = -f4 * m_A37; - m_A41 += m_A10 * f4_10; - m_A42 += m_A11 * f4_10; - RHS10 += f4_10 * RHS4; - const double f4_11 = -f4 * m_A44; - m_A48 += m_A10 * f4_11; - m_A49 += m_A11 * f4_11; - RHS11 += f4_11 * RHS4; -const double f5 = 1.0 / m_A12; - const double f5_9 = -f5 * m_A30; - m_A33 += m_A13 * f5_9; - m_A36 += m_A14 * f5_9; - RHS9 += f5_9 * RHS5; - const double f5_13 = -f5 * m_A57; - m_A59 += m_A13 * f5_13; - m_A63 += m_A14 * f5_13; - RHS13 += f5_13 * RHS5; -const double f6 = 1.0 / m_A15; - const double f6_7 = -f6 * m_A21; - m_A22 += m_A16 * f6_7; - m_A23 += m_A17 * f6_7; - m_A24 += m_A18 * f6_7; - m_A25 += m_A19 * f6_7; - RHS7 += f6_7 * RHS6; - const double f6_9 = -f6 * m_A31; - m_A32 += m_A16 * f6_9; - m_A33 += m_A17 * f6_9; - m_A34 += m_A18 * f6_9; - m_A35 += m_A19 * f6_9; - RHS9 += f6_9 * RHS6; - const double f6_10 = -f6 * m_A38; - m_A39 += m_A16 * f6_10; - m_A40 += m_A17 * f6_10; - m_A41 += m_A18 * f6_10; - m_A42 += m_A19 * f6_10; - RHS10 += f6_10 * RHS6; - const double f6_11 = -f6 * m_A45; - m_A46 += m_A16 * f6_11; - m_A47 += m_A17 * f6_11; - m_A48 += m_A18 * f6_11; - m_A49 += m_A19 * f6_11; - RHS11 += f6_11 * RHS6; -const double f7 = 1.0 / m_A22; - const double f7_9 = -f7 * m_A32; - m_A33 += m_A23 * f7_9; - m_A34 += m_A24 * f7_9; - m_A35 += m_A25 * f7_9; - RHS9 += f7_9 * RHS7; - const double f7_10 = -f7 * m_A39; - m_A40 += m_A23 * f7_10; - m_A41 += m_A24 * f7_10; - m_A42 += m_A25 * f7_10; - RHS10 += f7_10 * RHS7; - const double f7_11 = -f7 * m_A46; - m_A47 += m_A23 * f7_11; - m_A48 += m_A24 * f7_11; - m_A49 += m_A25 * f7_11; - RHS11 += f7_11 * RHS7; -const double f8 = 1.0 / m_A27; - const double f8_12 = -f8 * m_A53; - m_A54 += m_A28 * f8_12; - m_A55 += m_A29 * f8_12; - RHS12 += f8_12 * RHS8; - const double f8_13 = -f8 * m_A58; - m_A62 += m_A28 * f8_13; - m_A63 += m_A29 * f8_13; - RHS13 += f8_13 * RHS8; -const double f9 = 1.0 / m_A33; - const double f9_10 = -f9 * m_A40; - m_A41 += m_A34 * f9_10; - m_A42 += m_A35 * f9_10; - m_A43 += m_A36 * f9_10; - RHS10 += f9_10 * RHS9; - const double f9_11 = -f9 * m_A47; - m_A48 += m_A34 * f9_11; - m_A49 += m_A35 * f9_11; - m_A50 += m_A36 * f9_11; - RHS11 += f9_11 * RHS9; - const double f9_13 = -f9 * m_A59; - m_A60 += m_A34 * f9_13; - m_A61 += m_A35 * f9_13; - m_A63 += m_A36 * f9_13; - RHS13 += f9_13 * RHS9; -const double f10 = 1.0 / m_A41; - const double f10_11 = -f10 * m_A48; - m_A49 += m_A42 * f10_11; - m_A50 += m_A43 * f10_11; - RHS11 += f10_11 * RHS10; - const double f10_13 = -f10 * m_A60; - m_A61 += m_A42 * f10_13; - m_A63 += m_A43 * f10_13; - RHS13 += f10_13 * RHS10; -const double f11 = 1.0 / m_A49; - const double f11_13 = -f11 * m_A61; - m_A63 += m_A50 * f11_13; - RHS13 += f11_13 * RHS11; -const double f12 = 1.0 / m_A54; - const double f12_13 = -f12 * m_A62; - m_A63 += m_A55 * f12_13; - RHS13 += f12_13 * RHS12; - V[13] = RHS13 / m_A63; + const double f0_9 = -f0 * m_A19; + m_A20 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f0_23 = -f0 * m_A67; + m_A69 += m_A1 * f0_23; + RHS23 += f0_23 * RHS0; +const double f1 = 1.0 / m_A2; + const double f1_16 = -f1 * m_A38; + m_A40 += m_A3 * f1_16; + RHS16 += f1_16 * RHS1; +const double f2 = 1.0 / m_A4; + const double f2_13 = -f2 * m_A28; + m_A29 += m_A5 * f2_13; + RHS13 += f2_13 * RHS2; + const double f2_26 = -f2 * m_A87; + m_A89 += m_A5 * f2_26; + RHS26 += f2_26 * RHS2; +const double f3 = 1.0 / m_A6; + const double f3_22 = -f3 * m_A60; + m_A63 += m_A7 * f3_22; + RHS22 += f3_22 * RHS3; +const double f4 = 1.0 / m_A8; + const double f4_14 = -f4 * m_A30; + m_A32 += m_A9 * f4_14; + RHS14 += f4_14 * RHS4; +const double f5 = 1.0 / m_A10; + const double f5_15 = -f5 * m_A34; + m_A35 += m_A11 * f5_15; + m_A36 += m_A12 * f5_15; + RHS15 += f5_15 * RHS5; + const double f5_18 = -f5 * m_A45; + m_A46 += m_A11 * f5_18; + m_A47 += m_A12 * f5_18; + RHS18 += f5_18 * RHS5; +const double f6 = 1.0 / m_A13; + const double f6_19 = -f6 * m_A50; + m_A52 += m_A14 * f6_19; + RHS19 += f6_19 * RHS6; + const double f6_23 = -f6 * m_A68; + m_A73 += m_A14 * f6_23; + RHS23 += f6_23 * RHS6; +const double f7 = 1.0 / m_A15; + const double f7_17 = -f7 * m_A42; + m_A44 += m_A16 * f7_17; + RHS17 += f7_17 * RHS7; + const double f7_25 = -f7 * m_A78; + m_A81 += m_A16 * f7_25; + RHS25 += f7_25 * RHS7; +const double f8 = 1.0 / m_A17; + const double f8_17 = -f8 * m_A43; + m_A44 += m_A18 * f8_17; + RHS17 += f8_17 * RHS8; +const double f9 = 1.0 / m_A20; + const double f9_23 = -f9 * m_A69; + RHS23 += f9_23 * RHS9; +const double f10 = 1.0 / m_A21; + const double f10_21 = -f10 * m_A57; + m_A59 += m_A22 * f10_21; + RHS21 += f10_21 * RHS10; + const double f10_26 = -f10 * m_A88; + m_A95 += m_A22 * f10_26; + RHS26 += f10_26 * RHS10; +const double f11 = 1.0 / m_A23; + const double f11_20 = -f11 * m_A53; + m_A54 += m_A24 * f11_20; + m_A55 += m_A25 * f11_20; + RHS20 += f11_20 * RHS11; + const double f11_22 = -f11 * m_A61; + m_A62 += m_A24 * f11_22; + m_A64 += m_A25 * f11_22; + RHS22 += f11_22 * RHS11; +const double f12 = 1.0 / m_A26; + const double f12_24 = -f12 * m_A75; + m_A77 += m_A27 * f12_24; + RHS24 += f12_24 * RHS12; + const double f12_25 = -f12 * m_A79; + m_A85 += m_A27 * f12_25; + RHS25 += f12_25 * RHS12; +const double f13 = 1.0 / m_A29; + const double f13_26 = -f13 * m_A89; + RHS26 += f13_26 * RHS13; +const double f14 = 1.0 / m_A31; + const double f14_25 = -f14 * m_A80; + m_A84 += m_A32 * f14_25; + m_A85 += m_A33 * f14_25; + RHS25 += f14_25 * RHS14; +const double f15 = 1.0 / m_A35; + const double f15_18 = -f15 * m_A46; + m_A47 += m_A36 * f15_18; + m_A49 += m_A37 * f15_18; + RHS18 += f15_18 * RHS15; + const double f15_26 = -f15 * m_A90; + m_A91 += m_A36 * f15_26; + m_A95 += m_A37 * f15_26; + RHS26 += f15_26 * RHS15; +const double f16 = 1.0 / m_A39; + const double f16_23 = -f16 * m_A70; + m_A72 += m_A40 * f16_23; + m_A73 += m_A41 * f16_23; + RHS23 += f16_23 * RHS16; +const double f17 = 1.0 / m_A44; + const double f17_25 = -f17 * m_A81; + RHS25 += f17_25 * RHS17; +const double f18 = 1.0 / m_A47; + const double f18_23 = -f18 * m_A71; + m_A73 += m_A48 * f18_23; + m_A74 += m_A49 * f18_23; + RHS23 += f18_23 * RHS18; + const double f18_26 = -f18 * m_A91; + m_A93 += m_A48 * f18_26; + m_A95 += m_A49 * f18_26; + RHS26 += f18_26 * RHS18; +const double f19 = 1.0 / m_A51; + const double f19_23 = -f19 * m_A72; + m_A73 += m_A52 * f19_23; + RHS23 += f19_23 * RHS19; +const double f20 = 1.0 / m_A54; + const double f20_22 = -f20 * m_A62; + m_A64 += m_A55 * f20_22; + m_A65 += m_A56 * f20_22; + RHS22 += f20_22 * RHS20; + const double f20_25 = -f20 * m_A82; + m_A83 += m_A55 * f20_25; + m_A85 += m_A56 * f20_25; + RHS25 += f20_25 * RHS20; +const double f21 = 1.0 / m_A58; + const double f21_22 = -f21 * m_A63; + m_A66 += m_A59 * f21_22; + RHS22 += f21_22 * RHS21; +const double f22 = 1.0 / m_A64; + const double f22_25 = -f22 * m_A83; + m_A85 += m_A65 * f22_25; + m_A86 += m_A66 * f22_25; + RHS25 += f22_25 * RHS22; + const double f22_26 = -f22 * m_A92; + m_A94 += m_A65 * f22_26; + m_A95 += m_A66 * f22_26; + RHS26 += f22_26 * RHS22; +const double f23 = 1.0 / m_A73; + const double f23_26 = -f23 * m_A93; + m_A95 += m_A74 * f23_26; + RHS26 += f23_26 * RHS23; +const double f24 = 1.0 / m_A76; + const double f24_25 = -f24 * m_A84; + m_A85 += m_A77 * f24_25; + RHS25 += f24_25 * RHS24; +const double f25 = 1.0 / m_A85; + const double f25_26 = -f25 * m_A94; + m_A95 += m_A86 * f25_26; + RHS26 += f25_26 * RHS25; + V[26] = RHS26 / m_A95; + double tmp25 = 0.0; + tmp25 += m_A86 * V[26]; + V[25] = (RHS25 - tmp25) / m_A85; + double tmp24 = 0.0; + tmp24 += m_A77 * V[25]; + V[24] = (RHS24 - tmp24) / m_A76; + double tmp23 = 0.0; + tmp23 += m_A74 * V[26]; + V[23] = (RHS23 - tmp23) / m_A73; + double tmp22 = 0.0; + tmp22 += m_A65 * V[25]; + tmp22 += m_A66 * V[26]; + V[22] = (RHS22 - tmp22) / m_A64; + double tmp21 = 0.0; + tmp21 += m_A59 * V[26]; + V[21] = (RHS21 - tmp21) / m_A58; + double tmp20 = 0.0; + tmp20 += m_A55 * V[22]; + tmp20 += m_A56 * V[25]; + V[20] = (RHS20 - tmp20) / m_A54; + double tmp19 = 0.0; + tmp19 += m_A52 * V[23]; + V[19] = (RHS19 - tmp19) / m_A51; + double tmp18 = 0.0; + tmp18 += m_A48 * V[23]; + tmp18 += m_A49 * V[26]; + V[18] = (RHS18 - tmp18) / m_A47; + double tmp17 = 0.0; + V[17] = (RHS17 - tmp17) / m_A44; + double tmp16 = 0.0; + tmp16 += m_A40 * V[19]; + tmp16 += m_A41 * V[23]; + V[16] = (RHS16 - tmp16) / m_A39; + double tmp15 = 0.0; + tmp15 += m_A36 * V[18]; + tmp15 += m_A37 * V[26]; + V[15] = (RHS15 - tmp15) / m_A35; + double tmp14 = 0.0; + tmp14 += m_A32 * V[24]; + tmp14 += m_A33 * V[25]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + V[13] = (RHS13 - tmp13) / m_A29; double tmp12 = 0.0; - tmp12 += m_A55 * V[13]; - V[12] = (RHS12 - tmp12) / m_A54; + tmp12 += m_A27 * V[25]; + V[12] = (RHS12 - tmp12) / m_A26; double tmp11 = 0.0; - tmp11 += m_A50 * V[13]; - V[11] = (RHS11 - tmp11) / m_A49; + tmp11 += m_A24 * V[20]; + tmp11 += m_A25 * V[22]; + V[11] = (RHS11 - tmp11) / m_A23; double tmp10 = 0.0; - tmp10 += m_A42 * V[11]; - tmp10 += m_A43 * V[13]; - V[10] = (RHS10 - tmp10) / m_A41; + tmp10 += m_A22 * V[26]; + V[10] = (RHS10 - tmp10) / m_A21; double tmp9 = 0.0; - tmp9 += m_A34 * V[10]; - tmp9 += m_A35 * V[11]; - tmp9 += m_A36 * V[13]; - V[9] = (RHS9 - tmp9) / m_A33; + V[9] = (RHS9 - tmp9) / m_A20; double tmp8 = 0.0; - tmp8 += m_A28 * V[12]; - tmp8 += m_A29 * V[13]; - V[8] = (RHS8 - tmp8) / m_A27; + tmp8 += m_A18 * V[17]; + V[8] = (RHS8 - tmp8) / m_A17; double tmp7 = 0.0; - tmp7 += m_A23 * V[9]; - tmp7 += m_A24 * V[10]; - tmp7 += m_A25 * V[11]; - V[7] = (RHS7 - tmp7) / m_A22; + tmp7 += m_A16 * V[17]; + V[7] = (RHS7 - tmp7) / m_A15; double tmp6 = 0.0; - tmp6 += m_A16 * V[7]; - tmp6 += m_A17 * V[9]; - tmp6 += m_A18 * V[10]; - tmp6 += m_A19 * V[11]; - V[6] = (RHS6 - tmp6) / m_A15; + tmp6 += m_A14 * V[23]; + V[6] = (RHS6 - tmp6) / m_A13; double tmp5 = 0.0; - tmp5 += m_A13 * V[9]; - tmp5 += m_A14 * V[13]; - V[5] = (RHS5 - tmp5) / m_A12; + tmp5 += m_A11 * V[15]; + tmp5 += m_A12 * V[18]; + V[5] = (RHS5 - tmp5) / m_A10; double tmp4 = 0.0; - tmp4 += m_A10 * V[10]; - tmp4 += m_A11 * V[11]; - V[4] = (RHS4 - tmp4) / m_A9; + tmp4 += m_A9 * V[24]; + V[4] = (RHS4 - tmp4) / m_A8; double tmp3 = 0.0; - tmp3 += m_A8 * V[7]; - V[3] = (RHS3 - tmp3) / m_A7; + tmp3 += m_A7 * V[21]; + V[3] = (RHS3 - tmp3) / m_A6; double tmp2 = 0.0; - tmp2 += m_A6 * V[12]; - V[2] = (RHS2 - tmp2) / m_A5; + tmp2 += m_A5 * V[13]; + V[2] = (RHS2 - tmp2) / m_A4; double tmp1 = 0.0; - tmp1 += m_A4 * V[12]; - V[1] = (RHS1 - tmp1) / m_A3; + tmp1 += m_A3 * V[19]; + V[1] = (RHS1 - tmp1) / m_A2; double tmp0 = 0.0; - tmp0 += m_A1 * V[8]; - tmp0 += m_A2 * V[13]; + tmp0 += m_A1 * V[9]; V[0] = (RHS0 - tmp0) / m_A0; } +// rebound static void nl_gcr_1faccd91c85d3ab3_28_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -2482,6 +2478,7 @@ const double f6 = 1.0 / m_A22; V[0] = (RHS0 - tmp0) / m_A0; } +// breakout static void nl_gcr_1fffb23aa506432d_13_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -2548,6 +2545,7 @@ const double f3 = 1.0 / m_A6; V[0] = (RHS0 - tmp0) / m_A0; } +// pongf static void nl_gcr_20615d28f46254cb_10_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -2600,6 +2598,156 @@ const double f2 = 1.0 / m_A4; V[0] = (RHS0 - tmp0) / m_A0; } +// zac1b11142 +static void nl_gcr_21d92b630d2e9a99_30_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) + +{ + +double m_A0(0.0); +double m_A1(0.0); +double m_A2(0.0); +double m_A3(0.0); +double m_A4(0.0); +double m_A5(0.0); +double m_A6(0.0); +double m_A7(0.0); +double m_A8(0.0); +double m_A9(0.0); +double m_A10(0.0); +double m_A11(0.0); +double m_A12(0.0); +double m_A13(0.0); +double m_A14(0.0); +double m_A15(0.0); +double m_A16(0.0); +double m_A17(0.0); +double m_A18(0.0); +double m_A19(0.0); +double m_A20(0.0); +double m_A21(0.0); +double m_A22(0.0); +double m_A23(0.0); +double m_A24(0.0); +double m_A25(0.0); +double m_A26(0.0); +double m_A27(0.0); +double m_A28(0.0); +double m_A29(0.0); + m_A0 = gt[0] + gt[1] + gt[2] + gt[3] + gt[4] + gt[5] + gt[6]; + m_A1 = m_A1 + go[0]; + double RHS0 = Idr[0] + Idr[1] + Idr[2] + Idr[3] + Idr[4] + Idr[5] + Idr[6] - go[1] * *cnV[1] - go[2] * *cnV[2] - go[3] * *cnV[3] - go[4] * *cnV[4] - go[5] * *cnV[5] - go[6] * *cnV[6]; + m_A2 = gt[8] + gt[9] + gt[10]; + m_A3 = m_A3 + go[8]; + double RHS1 = Idr[8] + Idr[9] + Idr[10] - go[9] * *cnV[9] - go[10] * *cnV[10]; + m_A4 = gt[16] + gt[17]; + m_A5 = m_A5 + go[16]; + double RHS2 = Idr[16] + Idr[17] - go[17] * *cnV[17]; + m_A6 = gt[24] + gt[25] + gt[26]; + m_A7 = m_A7 + go[24]; + double RHS3 = Idr[24] + Idr[25] + Idr[26] - go[25] * *cnV[25] - go[26] * *cnV[26]; + m_A8 = gt[32] + gt[33] + gt[34]; + m_A9 = m_A9 + go[32]; + double RHS4 = Idr[32] + Idr[33] + Idr[34] - go[33] * *cnV[33] - go[34] * *cnV[34]; + m_A11 = gt[40] + gt[41] + gt[42] + gt[43]; + m_A12 = m_A12 + go[40]; + m_A10 = m_A10 + go[41]; + double RHS5 = Idr[40] + Idr[41] + Idr[42] + Idr[43] - go[42] * *cnV[42] - go[43] * *cnV[43]; + m_A14 = gt[48] + gt[49] + gt[50] + gt[51] + gt[52] + gt[53] + gt[54]; + m_A13 = m_A13 + go[48]; + m_A16 = m_A16 + go[49]; + m_A16 = m_A16 + go[50]; + m_A16 = m_A16 + go[51]; + double RHS6 = Idr[48] + Idr[49] + Idr[50] + Idr[51] + Idr[52] + Idr[53] + Idr[54] - go[52] * *cnV[52] - go[53] * *cnV[53] - go[54] * *cnV[54]; + m_A19 = gt[56] + gt[57]; + m_A18 = m_A18 + go[56]; + m_A17 = m_A17 + go[57]; + double RHS7 = Idr[56] + Idr[57]; + m_A21 = gt[64] + gt[65] + gt[66] + gt[67]; + m_A22 = m_A22 + go[64]; + m_A20 = m_A20 + go[65]; + double RHS8 = Idr[64] + Idr[65] + Idr[66] + Idr[67] - go[66] * *cnV[66] - go[67] * *cnV[67]; + m_A29 = gt[72] + gt[73] + gt[74] + gt[75] + gt[76] + gt[77] + gt[78]; + m_A26 = m_A26 + go[72]; + m_A26 = m_A26 + go[73]; + m_A26 = m_A26 + go[74]; + m_A27 = m_A27 + go[75]; + m_A25 = m_A25 + go[76]; + m_A24 = m_A24 + go[77]; + m_A23 = m_A23 + go[78]; + double RHS9 = Idr[72] + Idr[73] + Idr[74] + Idr[75] + Idr[76] + Idr[77] + Idr[78]; +const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A13; + m_A15 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; +const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A10; + m_A11 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; +const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A17; + m_A19 += m_A5 * f2_7; + RHS7 += f2_7 * RHS2; + const double f2_9 = -f2 * m_A23; + m_A27 += m_A5 * f2_9; + RHS9 += f2_9 * RHS2; +const double f3 = 1.0 / m_A6; + const double f3_8 = -f3 * m_A20; + m_A22 += m_A7 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A24; + m_A29 += m_A7 * f3_9; + RHS9 += f3_9 * RHS3; +const double f4 = 1.0 / m_A8; + const double f4_9 = -f4 * m_A25; + m_A29 += m_A9 * f4_9; + RHS9 += f4_9 * RHS4; +const double f5 = 1.0 / m_A11; + const double f5_7 = -f5 * m_A18; + m_A19 += m_A12 * f5_7; + RHS7 += f5_7 * RHS5; +const double f6 = 1.0 / m_A14; + const double f6_9 = -f6 * m_A26; + m_A28 += m_A15 * f6_9; + m_A29 += m_A16 * f6_9; + RHS9 += f6_9 * RHS6; +const double f7 = 1.0 / m_A19; + const double f7_9 = -f7 * m_A27; + RHS9 += f7_9 * RHS7; +const double f8 = 1.0 / m_A21; + const double f8_9 = -f8 * m_A28; + m_A29 += m_A22 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A29; + double tmp8 = 0.0; + tmp8 += m_A22 * V[9]; + V[8] = (RHS8 - tmp8) / m_A21; + double tmp7 = 0.0; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A15 * V[8]; + tmp6 += m_A16 * V[9]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[7]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[9]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// dpatrol static void nl_gcr_27a78682a9b70f8c_10_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -2652,6 +2800,300 @@ const double f2 = 1.0 / m_A4; V[0] = (RHS0 - tmp0) / m_A0; } +// mario +static void nl_gcr_2eb3d95f720484d_62_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) + +{ + +double m_A0(0.0); +double m_A1(0.0); +double m_A2(0.0); +double m_A3(0.0); +double m_A4(0.0); +double m_A5(0.0); +double m_A6(0.0); +double m_A7(0.0); +double m_A8(0.0); +double m_A9(0.0); +double m_A10(0.0); +double m_A11(0.0); +double m_A12(0.0); +double m_A13(0.0); +double m_A14(0.0); +double m_A15(0.0); +double m_A16(0.0); +double m_A17(0.0); +double m_A18(0.0); +double m_A19(0.0); +double m_A20(0.0); +double m_A21(0.0); +double m_A22(0.0); +double m_A23(0.0); +double m_A24(0.0); +double m_A25(0.0); +double m_A26(0.0); +double m_A27(0.0); +double m_A28(0.0); +double m_A29(0.0); +double m_A30(0.0); +double m_A31(0.0); +double m_A32(0.0); +double m_A33(0.0); +double m_A34(0.0); +double m_A35(0.0); +double m_A36(0.0); +double m_A37(0.0); +double m_A38(0.0); +double m_A39(0.0); +double m_A40(0.0); +double m_A41(0.0); +double m_A42(0.0); +double m_A43(0.0); +double m_A44(0.0); +double m_A45(0.0); +double m_A46(0.0); +double m_A47(0.0); +double m_A48(0.0); +double m_A49(0.0); +double m_A50(0.0); +double m_A51(0.0); +double m_A52(0.0); +double m_A53(0.0); +double m_A54(0.0); +double m_A55(0.0); +double m_A56(0.0); +double m_A57(0.0); +double m_A58(0.0); +double m_A59(0.0); +double m_A60(0.0); +double m_A61(0.0); + m_A0 = gt[0] + gt[1]; + m_A1 = m_A1 + go[0]; + double RHS0 = Idr[0] + Idr[1] - go[1] * *cnV[1]; + m_A2 = gt[8] + gt[9] + gt[10]; + m_A3 = m_A3 + go[8]; + double RHS1 = Idr[8] + Idr[9] + Idr[10] - go[9] * *cnV[9] - go[10] * *cnV[10]; + m_A4 = gt[16] + gt[17]; + m_A5 = m_A5 + go[16]; + double RHS2 = Idr[16] + Idr[17] - go[17] * *cnV[17]; + m_A6 = gt[24] + gt[25] + gt[26] + gt[27] + gt[28] + gt[29] + gt[30]; + m_A7 = m_A7 + go[24]; + double RHS3 = Idr[24] + Idr[25] + Idr[26] + Idr[27] + Idr[28] + Idr[29] + Idr[30] - go[25] * *cnV[25] - go[26] * *cnV[26] - go[27] * *cnV[27] - go[28] * *cnV[28] - go[29] * *cnV[29] - go[30] * *cnV[30]; + m_A8 = gt[32] + gt[33] + gt[34] + gt[35] + gt[36] + gt[37] + gt[38]; + m_A9 = m_A9 + go[32]; + double RHS4 = Idr[32] + Idr[33] + Idr[34] + Idr[35] + Idr[36] + Idr[37] + Idr[38] - go[33] * *cnV[33] - go[34] * *cnV[34] - go[35] * *cnV[35] - go[36] * *cnV[36] - go[37] * *cnV[37] - go[38] * *cnV[38]; + m_A10 = gt[40] + gt[41]; + m_A12 = m_A12 + go[40]; + m_A11 = m_A11 + go[41]; + double RHS5 = Idr[40] + Idr[41]; + m_A13 = gt[48] + gt[49] + gt[50]; + m_A14 = m_A14 + go[48]; + double RHS6 = Idr[48] + Idr[49] + Idr[50] - go[49] * *cnV[49] - go[50] * *cnV[50]; + m_A15 = gt[56] + gt[57]; + m_A16 = m_A16 + go[56]; + double RHS7 = Idr[56] + Idr[57] - go[57] * *cnV[57]; + m_A17 = gt[64] + gt[65] + gt[66] + gt[67]; + m_A18 = m_A18 + go[64]; + double RHS8 = Idr[64] + Idr[65] + Idr[66] + Idr[67] - go[65] * *cnV[65] - go[66] * *cnV[66] - go[67] * *cnV[67]; + m_A20 = gt[72] + gt[73]; + m_A19 = m_A19 + go[72]; + double RHS9 = Idr[72] + Idr[73] - go[73] * *cnV[73]; + m_A22 = gt[80] + gt[81] + gt[82] + gt[83]; + m_A21 = m_A21 + go[80]; + m_A23 = m_A23 + go[81]; + double RHS10 = Idr[80] + Idr[81] + Idr[82] + Idr[83] - go[82] * *cnV[82] - go[83] * *cnV[83]; + m_A27 = gt[88] + gt[89] + gt[90] + gt[91] + gt[92]; + m_A24 = m_A24 + go[88]; + m_A25 = m_A25 + go[89]; + m_A28 = m_A28 + go[90]; + double RHS11 = Idr[88] + Idr[89] + Idr[90] + Idr[91] + Idr[92] - go[91] * *cnV[91] - go[92] * *cnV[92]; + m_A32 = gt[96] + gt[97]; + m_A31 = m_A31 + go[96]; + m_A30 = m_A30 + go[97]; + double RHS12 = Idr[96] + Idr[97]; + m_A34 = gt[104] + gt[105] + gt[106] + gt[107] + gt[108] + gt[109]; + m_A33 = m_A33 + go[104]; + m_A37 = m_A37 + go[105]; + m_A36 = m_A36 + go[106]; + double RHS13 = Idr[104] + Idr[105] + Idr[106] + Idr[107] + Idr[108] + Idr[109] - go[107] * *cnV[107] - go[108] * *cnV[108] - go[109] * *cnV[109]; + m_A39 = gt[112] + gt[113] + gt[114] + gt[115]; + m_A40 = m_A40 + go[112]; + m_A38 = m_A38 + go[113]; + double RHS14 = Idr[112] + Idr[113] + Idr[114] + Idr[115] - go[114] * *cnV[114] - go[115] * *cnV[115]; + m_A46 = gt[120] + gt[121] + gt[122] + gt[123] + gt[124]; + m_A44 = m_A44 + go[120]; + m_A45 = m_A45 + go[121]; + m_A43 = m_A43 + go[122]; + m_A42 = m_A42 + go[123]; + m_A41 = m_A41 + go[124]; + double RHS15 = Idr[120] + Idr[121] + Idr[122] + Idr[123] + Idr[124]; + m_A53 = gt[128] + gt[129] + gt[130] + gt[131]; + m_A50 = m_A50 + go[128]; + m_A54 = m_A54 + go[129]; + m_A48 = m_A48 + go[130]; + double RHS16 = Idr[128] + Idr[129] + Idr[130] + Idr[131] - go[131] * *cnV[131]; + m_A61 = gt[136] + gt[137] + gt[138] + gt[139] + gt[140]; + m_A57 = m_A57 + go[136]; + m_A58 = m_A58 + go[137]; + m_A60 = m_A60 + go[138]; + m_A55 = m_A55 + go[139]; + m_A56 = m_A56 + go[140]; + double RHS17 = Idr[136] + Idr[137] + Idr[138] + Idr[139] + Idr[140]; +const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A19; + m_A20 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f0_15 = -f0 * m_A41; + m_A44 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; +const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A21; + m_A23 += m_A3 * f1_10; + RHS10 += f1_10 * RHS1; + const double f1_15 = -f1 * m_A42; + m_A46 += m_A3 * f1_15; + RHS15 += f1_15 * RHS1; +const double f2 = 1.0 / m_A4; + const double f2_15 = -f2 * m_A43; + m_A46 += m_A5 * f2_15; + RHS15 += f2_15 * RHS2; +const double f3 = 1.0 / m_A6; + const double f3_11 = -f3 * m_A24; + m_A26 += m_A7 * f3_11; + RHS11 += f3_11 * RHS3; +const double f4 = 1.0 / m_A8; + const double f4_13 = -f4 * m_A33; + m_A35 += m_A9 * f4_13; + RHS13 += f4_13 * RHS4; +const double f5 = 1.0 / m_A10; + const double f5_11 = -f5 * m_A25; + m_A27 += m_A11 * f5_11; + m_A29 += m_A12 * f5_11; + RHS11 += f5_11 * RHS5; + const double f5_16 = -f5 * m_A48; + m_A49 += m_A11 * f5_16; + m_A53 += m_A12 * f5_16; + RHS16 += f5_16 * RHS5; +const double f6 = 1.0 / m_A13; + const double f6_14 = -f6 * m_A38; + m_A40 += m_A14 * f6_14; + RHS14 += f6_14 * RHS6; + const double f6_17 = -f6 * m_A55; + m_A61 += m_A14 * f6_17; + RHS17 += f6_17 * RHS6; +const double f7 = 1.0 / m_A15; + const double f7_12 = -f7 * m_A30; + m_A32 += m_A16 * f7_12; + RHS12 += f7_12 * RHS7; + const double f7_17 = -f7 * m_A56; + m_A57 += m_A16 * f7_17; + RHS17 += f7_17 * RHS7; +const double f8 = 1.0 / m_A17; + const double f8_12 = -f8 * m_A31; + m_A32 += m_A18 * f8_12; + RHS12 += f8_12 * RHS8; +const double f9 = 1.0 / m_A20; + const double f9_15 = -f9 * m_A44; + RHS15 += f9_15 * RHS9; +const double f10 = 1.0 / m_A22; + const double f10_11 = -f10 * m_A26; + m_A28 += m_A23 * f10_11; + RHS11 += f10_11 * RHS10; +const double f11 = 1.0 / m_A27; + const double f11_15 = -f11 * m_A45; + m_A46 += m_A28 * f11_15; + m_A47 += m_A29 * f11_15; + RHS15 += f11_15 * RHS11; + const double f11_16 = -f11 * m_A49; + m_A52 += m_A28 * f11_16; + m_A53 += m_A29 * f11_16; + RHS16 += f11_16 * RHS11; +const double f12 = 1.0 / m_A32; + const double f12_17 = -f12 * m_A57; + RHS17 += f12_17 * RHS12; +const double f13 = 1.0 / m_A34; + const double f13_16 = -f13 * m_A50; + m_A51 += m_A35 * f13_16; + m_A53 += m_A36 * f13_16; + m_A54 += m_A37 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_17 = -f13 * m_A58; + m_A59 += m_A35 * f13_17; + m_A60 += m_A36 * f13_17; + m_A61 += m_A37 * f13_17; + RHS17 += f13_17 * RHS13; +const double f14 = 1.0 / m_A39; + const double f14_16 = -f14 * m_A51; + m_A54 += m_A40 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_17 = -f14 * m_A59; + m_A61 += m_A40 * f14_17; + RHS17 += f14_17 * RHS14; +const double f15 = 1.0 / m_A46; + const double f15_16 = -f15 * m_A52; + m_A53 += m_A47 * f15_16; + RHS16 += f15_16 * RHS15; +const double f16 = 1.0 / m_A53; + const double f16_17 = -f16 * m_A60; + m_A61 += m_A54 * f16_17; + RHS17 += f16_17 * RHS16; + V[17] = RHS17 / m_A61; + double tmp16 = 0.0; + tmp16 += m_A54 * V[17]; + V[16] = (RHS16 - tmp16) / m_A53; + double tmp15 = 0.0; + tmp15 += m_A47 * V[16]; + V[15] = (RHS15 - tmp15) / m_A46; + double tmp14 = 0.0; + tmp14 += m_A40 * V[17]; + V[14] = (RHS14 - tmp14) / m_A39; + double tmp13 = 0.0; + tmp13 += m_A35 * V[14]; + tmp13 += m_A36 * V[16]; + tmp13 += m_A37 * V[17]; + V[13] = (RHS13 - tmp13) / m_A34; + double tmp12 = 0.0; + V[12] = (RHS12 - tmp12) / m_A32; + double tmp11 = 0.0; + tmp11 += m_A28 * V[15]; + tmp11 += m_A29 * V[16]; + V[11] = (RHS11 - tmp11) / m_A27; + double tmp10 = 0.0; + tmp10 += m_A23 * V[15]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A18 * V[12]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[12]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[17]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[11]; + tmp5 += m_A12 * V[16]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[14]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[10]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[15]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// segas16b_audio static void nl_gcr_35947d349693c22_111_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -3177,6 +3619,7 @@ const double f23 = 1.0 / m_A101; V[0] = (RHS0 - tmp0) / m_A0; } +// cocoloco static void nl_gcr_3641ac25e244c362_16_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -3257,6 +3700,7 @@ const double f4 = 1.0 / m_A9; V[0] = (RHS0 - tmp0) / m_A0; } +// zac1b11142 static void nl_gcr_38a3ac18f52bf78a_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -3297,6 +3741,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// dpatrol static void nl_gcr_38f1806722626d7e_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -3335,6 +3780,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// kidniki static void nl_gcr_3e4821cabc0aeb96_24_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -3451,494 +3897,7 @@ const double f6 = 1.0 / m_A18; V[0] = (RHS0 - tmp0) / m_A0; } -static void nl_gcr_4966c35de59b7e6a_99_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) - -{ - -double m_A0(0.0); -double m_A1(0.0); -double m_A2(0.0); -double m_A3(0.0); -double m_A4(0.0); -double m_A5(0.0); -double m_A6(0.0); -double m_A7(0.0); -double m_A8(0.0); -double m_A9(0.0); -double m_A10(0.0); -double m_A11(0.0); -double m_A12(0.0); -double m_A13(0.0); -double m_A14(0.0); -double m_A15(0.0); -double m_A16(0.0); -double m_A17(0.0); -double m_A18(0.0); -double m_A19(0.0); -double m_A20(0.0); -double m_A21(0.0); -double m_A22(0.0); -double m_A23(0.0); -double m_A24(0.0); -double m_A25(0.0); -double m_A26(0.0); -double m_A27(0.0); -double m_A28(0.0); -double m_A29(0.0); -double m_A30(0.0); -double m_A31(0.0); -double m_A32(0.0); -double m_A33(0.0); -double m_A34(0.0); -double m_A35(0.0); -double m_A36(0.0); -double m_A37(0.0); -double m_A38(0.0); -double m_A39(0.0); -double m_A40(0.0); -double m_A41(0.0); -double m_A42(0.0); -double m_A43(0.0); -double m_A44(0.0); -double m_A45(0.0); -double m_A46(0.0); -double m_A47(0.0); -double m_A48(0.0); -double m_A49(0.0); -double m_A50(0.0); -double m_A51(0.0); -double m_A52(0.0); -double m_A53(0.0); -double m_A54(0.0); -double m_A55(0.0); -double m_A56(0.0); -double m_A57(0.0); -double m_A58(0.0); -double m_A59(0.0); -double m_A60(0.0); -double m_A61(0.0); -double m_A62(0.0); -double m_A63(0.0); -double m_A64(0.0); -double m_A65(0.0); -double m_A66(0.0); -double m_A67(0.0); -double m_A68(0.0); -double m_A69(0.0); -double m_A70(0.0); -double m_A71(0.0); -double m_A72(0.0); -double m_A73(0.0); -double m_A74(0.0); -double m_A75(0.0); -double m_A76(0.0); -double m_A77(0.0); -double m_A78(0.0); -double m_A79(0.0); -double m_A80(0.0); -double m_A81(0.0); -double m_A82(0.0); -double m_A83(0.0); -double m_A84(0.0); -double m_A85(0.0); -double m_A86(0.0); -double m_A87(0.0); -double m_A88(0.0); -double m_A89(0.0); -double m_A90(0.0); -double m_A91(0.0); -double m_A92(0.0); -double m_A93(0.0); -double m_A94(0.0); -double m_A95(0.0); -double m_A96(0.0); -double m_A97(0.0); -double m_A98(0.0); - m_A0 = gt[0] + gt[1] + gt[2]; - m_A1 = m_A1 + go[0]; - double RHS0 = Idr[0] + Idr[1] + Idr[2] - go[1] * *cnV[1] - go[2] * *cnV[2]; - m_A2 = gt[10] + gt[11] + gt[12] + gt[13] + gt[14]; - m_A4 = m_A4 + go[10]; - m_A3 = m_A3 + go[11]; - m_A3 = m_A3 + go[12]; - double RHS1 = Idr[10] + Idr[11] + Idr[12] + Idr[13] + Idr[14] - go[13] * *cnV[13] - go[14] * *cnV[14]; - m_A5 = gt[20] + gt[21] + gt[22] + gt[23] + gt[24] + gt[25] + gt[26]; - m_A6 = m_A6 + go[20]; - m_A5 = m_A5 + go[21]; - m_A5 = m_A5 + go[22]; - double RHS2 = Idr[20] + Idr[21] + Idr[22] + Idr[23] + Idr[24] + Idr[25] + Idr[26] - go[23] * *cnV[23] - go[24] * *cnV[24] - go[25] * *cnV[25] - go[26] * *cnV[26]; - m_A7 = gt[30] + gt[31] + gt[32] + gt[33] + gt[34]; - m_A9 = m_A9 + go[30]; - m_A9 = m_A9 + go[31]; - m_A8 = m_A8 + go[32]; - double RHS3 = Idr[30] + Idr[31] + Idr[32] + Idr[33] + Idr[34] - go[33] * *cnV[33] - go[34] * *cnV[34]; - m_A10 = gt[40] + gt[41] + gt[42]; - m_A12 = m_A12 + go[40]; - m_A11 = m_A11 + go[41]; - double RHS4 = Idr[40] + Idr[41] + Idr[42] - go[42] * *cnV[42]; - m_A13 = gt[50] + gt[51] + gt[52] + gt[53] + gt[54] + gt[55] + gt[56]; - m_A14 = m_A14 + go[50]; - m_A13 = m_A13 + go[51]; - m_A13 = m_A13 + go[52]; - double RHS5 = Idr[50] + Idr[51] + Idr[52] + Idr[53] + Idr[54] + Idr[55] + Idr[56] - go[53] * *cnV[53] - go[54] * *cnV[54] - go[55] * *cnV[55] - go[56] * *cnV[56]; - m_A15 = gt[60] + gt[61] + gt[62] + gt[63] + gt[64]; - m_A17 = m_A17 + go[60]; - m_A17 = m_A17 + go[61]; - m_A16 = m_A16 + go[62]; - double RHS6 = Idr[60] + Idr[61] + Idr[62] + Idr[63] + Idr[64] - go[63] * *cnV[63] - go[64] * *cnV[64]; - m_A18 = gt[70] + gt[71] + gt[72]; - m_A20 = m_A20 + go[70]; - m_A19 = m_A19 + go[71]; - double RHS7 = Idr[70] + Idr[71] + Idr[72] - go[72] * *cnV[72]; - m_A21 = gt[80] + gt[81] + gt[82]; - m_A22 = m_A22 + go[80]; - m_A23 = m_A23 + go[81]; - double RHS8 = Idr[80] + Idr[81] + Idr[82] - go[82] * *cnV[82]; - m_A24 = gt[90] + gt[91] + gt[92] + gt[93] + gt[94] + gt[95]; - m_A25 = m_A25 + go[90]; - m_A28 = m_A28 + go[91]; - m_A26 = m_A26 + go[92]; - m_A27 = m_A27 + go[93]; - double RHS9 = Idr[90] + Idr[91] + Idr[92] + Idr[93] + Idr[94] + Idr[95] - go[94] * *cnV[94] - go[95] * *cnV[95]; - m_A30 = gt[100] + gt[101] + gt[102] + gt[103] + gt[104] + gt[105] + gt[106]; - m_A31 = m_A31 + go[100]; - m_A31 = m_A31 + go[101]; - m_A32 = m_A32 + go[102]; - m_A29 = m_A29 + go[103]; - double RHS10 = Idr[100] + Idr[101] + Idr[102] + Idr[103] + Idr[104] + Idr[105] + Idr[106] - go[104] * *cnV[104] - go[105] * *cnV[105] - go[106] * *cnV[106]; - m_A35 = gt[110] + gt[111] + gt[112] + gt[113] + gt[114]; - m_A34 = m_A34 + go[110]; - m_A33 = m_A33 + go[111]; - double RHS11 = Idr[110] + Idr[111] + Idr[112] + Idr[113] + Idr[114] - go[112] * *cnV[112] - go[113] * *cnV[113] - go[114] * *cnV[114]; - m_A39 = gt[120] + gt[121] + gt[122] + gt[123] + gt[124] + gt[125] + gt[126]; - m_A41 = m_A41 + go[120]; - m_A41 = m_A41 + go[121]; - m_A40 = m_A40 + go[122]; - m_A38 = m_A38 + go[123]; - double RHS12 = Idr[120] + Idr[121] + Idr[122] + Idr[123] + Idr[124] + Idr[125] + Idr[126] - go[124] * *cnV[124] - go[125] * *cnV[125] - go[126] * *cnV[126]; - m_A44 = gt[130] + gt[131]; - m_A43 = m_A43 + go[130]; - m_A42 = m_A42 + go[131]; - double RHS13 = Idr[130] + Idr[131]; - m_A52 = gt[140] + gt[141] + gt[142] + gt[143] + gt[144] + gt[145] + gt[146]; - m_A49 = m_A49 + go[140]; - m_A50 = m_A50 + go[141]; - m_A52 = m_A52 + go[142]; - m_A52 = m_A52 + go[143]; - double RHS14 = Idr[140] + Idr[141] + Idr[142] + Idr[143] + Idr[144] + Idr[145] + Idr[146] - go[144] * *cnV[144] - go[145] * *cnV[145] - go[146] * *cnV[146]; - m_A60 = gt[150] + gt[151] + gt[152] + gt[153] + gt[154] + gt[155] + gt[156] + gt[157] + gt[158]; - m_A57 = m_A57 + go[150]; - m_A61 = m_A61 + go[151]; - m_A61 = m_A61 + go[152]; - m_A56 = m_A56 + go[153]; - m_A56 = m_A56 + go[154]; - double RHS15 = Idr[150] + Idr[151] + Idr[152] + Idr[153] + Idr[154] + Idr[155] + Idr[156] + Idr[157] + Idr[158] - go[155] * *cnV[155] - go[156] * *cnV[156] - go[157] * *cnV[157] - go[158] * *cnV[158]; - m_A65 = gt[160] + gt[161] + gt[162] + gt[163] + gt[164] + gt[165] + gt[166] + gt[167] + gt[168]; - m_A66 = m_A66 + go[160]; - m_A64 = m_A64 + go[161]; - m_A64 = m_A64 + go[162]; - m_A63 = m_A63 + go[163]; - m_A63 = m_A63 + go[164]; - double RHS16 = Idr[160] + Idr[161] + Idr[162] + Idr[163] + Idr[164] + Idr[165] + Idr[166] + Idr[167] + Idr[168] - go[165] * *cnV[165] - go[166] * *cnV[166] - go[167] * *cnV[167] - go[168] * *cnV[168]; - m_A71 = gt[170] + gt[171] + gt[172] + gt[173] + gt[174] + gt[175] + gt[176] + gt[177] + gt[178]; - m_A73 = m_A73 + go[170]; - m_A73 = m_A73 + go[171]; - m_A68 = m_A68 + go[172]; - m_A70 = m_A70 + go[173]; - m_A67 = m_A67 + go[174]; - double RHS17 = Idr[170] + Idr[171] + Idr[172] + Idr[173] + Idr[174] + Idr[175] + Idr[176] + Idr[177] + Idr[178] - go[175] * *cnV[175] - go[176] * *cnV[176] - go[177] * *cnV[177] - go[178] * *cnV[178]; - m_A79 = gt[180] + gt[181] + gt[182] + gt[183] + gt[184] + gt[185] + gt[186]; - m_A75 = m_A75 + go[180]; - m_A78 = m_A78 + go[181]; - m_A78 = m_A78 + go[182]; - m_A74 = m_A74 + go[183]; - double RHS18 = Idr[180] + Idr[181] + Idr[182] + Idr[183] + Idr[184] + Idr[185] + Idr[186] - go[184] * *cnV[184] - go[185] * *cnV[185] - go[186] * *cnV[186]; - m_A87 = gt[190] + gt[191] + gt[192] + gt[193] + gt[194] + gt[195]; - m_A85 = m_A85 + go[190]; - m_A82 = m_A82 + go[191]; - m_A83 = m_A83 + go[192]; - m_A81 = m_A81 + go[193]; - double RHS19 = Idr[190] + Idr[191] + Idr[192] + Idr[193] + Idr[194] + Idr[195] - go[194] * *cnV[194] - go[195] * *cnV[195]; - m_A98 = gt[200] + gt[201] + gt[202] + gt[203] + gt[204] + gt[205] + gt[206] + gt[207] + gt[208] + gt[209]; - m_A90 = m_A90 + go[200]; - m_A95 = m_A95 + go[201]; - m_A95 = m_A95 + go[202]; - m_A91 = m_A91 + go[203]; - m_A91 = m_A91 + go[204]; - m_A89 = m_A89 + go[205]; - m_A89 = m_A89 + go[206]; - double RHS20 = Idr[200] + Idr[201] + Idr[202] + Idr[203] + Idr[204] + Idr[205] + Idr[206] + Idr[207] + Idr[208] + Idr[209] - go[207] * *cnV[207] - go[208] * *cnV[208] - go[209] * *cnV[209]; -const double f0 = 1.0 / m_A0; - const double f0_14 = -f0 * m_A49; - m_A52 += m_A1 * f0_14; - RHS14 += f0_14 * RHS0; -const double f1 = 1.0 / m_A2; - const double f1_15 = -f1 * m_A56; - m_A60 += m_A3 * f1_15; - m_A61 += m_A4 * f1_15; - RHS15 += f1_15 * RHS1; - const double f1_18 = -f1 * m_A74; - m_A78 += m_A3 * f1_18; - m_A79 += m_A4 * f1_18; - RHS18 += f1_18 * RHS1; -const double f2 = 1.0 / m_A5; - const double f2_19 = -f2 * m_A81; - m_A87 += m_A6 * f2_19; - RHS19 += f2_19 * RHS2; -const double f3 = 1.0 / m_A7; - const double f3_10 = -f3 * m_A29; - m_A30 += m_A8 * f3_10; - m_A31 += m_A9 * f3_10; - RHS10 += f3_10 * RHS3; - const double f3_16 = -f3 * m_A63; - m_A64 += m_A8 * f3_16; - m_A65 += m_A9 * f3_16; - RHS16 += f3_16 * RHS3; -const double f4 = 1.0 / m_A10; - const double f4_11 = -f4 * m_A33; - m_A35 += m_A11 * f4_11; - m_A37 += m_A12 * f4_11; - RHS11 += f4_11 * RHS4; - const double f4_19 = -f4 * m_A82; - m_A84 += m_A11 * f4_19; - m_A87 += m_A12 * f4_19; - RHS19 += f4_19 * RHS4; -const double f5 = 1.0 / m_A13; - const double f5_17 = -f5 * m_A67; - m_A71 += m_A14 * f5_17; - RHS17 += f5_17 * RHS5; -const double f6 = 1.0 / m_A15; - const double f6_12 = -f6 * m_A38; - m_A39 += m_A16 * f6_12; - m_A41 += m_A17 * f6_12; - RHS12 += f6_12 * RHS6; - const double f6_20 = -f6 * m_A89; - m_A91 += m_A16 * f6_20; - m_A98 += m_A17 * f6_20; - RHS20 += f6_20 * RHS6; -const double f7 = 1.0 / m_A18; - const double f7_11 = -f7 * m_A34; - m_A35 += m_A19 * f7_11; - m_A36 += m_A20 * f7_11; - RHS11 += f7_11 * RHS7; - const double f7_17 = -f7 * m_A68; - m_A69 += m_A19 * f7_17; - m_A71 += m_A20 * f7_17; - RHS17 += f7_17 * RHS7; -const double f8 = 1.0 / m_A21; - const double f8_13 = -f8 * m_A42; - m_A44 += m_A22 * f8_13; - m_A48 += m_A23 * f8_13; - RHS13 += f8_13 * RHS8; - const double f8_20 = -f8 * m_A90; - m_A92 += m_A22 * f8_20; - m_A98 += m_A23 * f8_20; - RHS20 += f8_20 * RHS8; -const double f9 = 1.0 / m_A24; - const double f9_13 = -f9 * m_A43; - m_A44 += m_A25 * f9_13; - m_A45 += m_A26 * f9_13; - m_A46 += m_A27 * f9_13; - m_A47 += m_A28 * f9_13; - RHS13 += f9_13 * RHS9; - const double f9_14 = -f9 * m_A50; - m_A51 += m_A25 * f9_14; - m_A52 += m_A26 * f9_14; - m_A53 += m_A27 * f9_14; - m_A54 += m_A28 * f9_14; - RHS14 += f9_14 * RHS9; - const double f9_15 = -f9 * m_A57; - m_A58 += m_A25 * f9_15; - m_A59 += m_A26 * f9_15; - m_A60 += m_A27 * f9_15; - m_A61 += m_A28 * f9_15; - RHS15 += f9_15 * RHS9; - const double f9_18 = -f9 * m_A75; - m_A76 += m_A25 * f9_18; - m_A77 += m_A26 * f9_18; - m_A78 += m_A27 * f9_18; - m_A79 += m_A28 * f9_18; - RHS18 += f9_18 * RHS9; -const double f10 = 1.0 / m_A30; - const double f10_16 = -f10 * m_A64; - m_A65 += m_A31 * f10_16; - m_A66 += m_A32 * f10_16; - RHS16 += f10_16 * RHS10; - const double f10_19 = -f10 * m_A83; - m_A85 += m_A31 * f10_19; - m_A87 += m_A32 * f10_19; - RHS19 += f10_19 * RHS10; -const double f11 = 1.0 / m_A35; - const double f11_17 = -f11 * m_A69; - m_A71 += m_A36 * f11_17; - m_A72 += m_A37 * f11_17; - RHS17 += f11_17 * RHS11; - const double f11_19 = -f11 * m_A84; - m_A86 += m_A36 * f11_19; - m_A87 += m_A37 * f11_19; - RHS19 += f11_19 * RHS11; -const double f12 = 1.0 / m_A39; - const double f12_17 = -f12 * m_A70; - m_A71 += m_A40 * f12_17; - m_A73 += m_A41 * f12_17; - RHS17 += f12_17 * RHS12; - const double f12_20 = -f12 * m_A91; - m_A95 += m_A40 * f12_20; - m_A98 += m_A41 * f12_20; - RHS20 += f12_20 * RHS12; -const double f13 = 1.0 / m_A44; - const double f13_14 = -f13 * m_A51; - m_A52 += m_A45 * f13_14; - m_A53 += m_A46 * f13_14; - m_A54 += m_A47 * f13_14; - m_A55 += m_A48 * f13_14; - RHS14 += f13_14 * RHS13; - const double f13_15 = -f13 * m_A58; - m_A59 += m_A45 * f13_15; - m_A60 += m_A46 * f13_15; - m_A61 += m_A47 * f13_15; - m_A62 += m_A48 * f13_15; - RHS15 += f13_15 * RHS13; - const double f13_18 = -f13 * m_A76; - m_A77 += m_A45 * f13_18; - m_A78 += m_A46 * f13_18; - m_A79 += m_A47 * f13_18; - m_A80 += m_A48 * f13_18; - RHS18 += f13_18 * RHS13; - const double f13_20 = -f13 * m_A92; - m_A93 += m_A45 * f13_20; - m_A94 += m_A46 * f13_20; - m_A96 += m_A47 * f13_20; - m_A98 += m_A48 * f13_20; - RHS20 += f13_20 * RHS13; -const double f14 = 1.0 / m_A52; - const double f14_15 = -f14 * m_A59; - m_A60 += m_A53 * f14_15; - m_A61 += m_A54 * f14_15; - m_A62 += m_A55 * f14_15; - RHS15 += f14_15 * RHS14; - const double f14_18 = -f14 * m_A77; - m_A78 += m_A53 * f14_18; - m_A79 += m_A54 * f14_18; - m_A80 += m_A55 * f14_18; - RHS18 += f14_18 * RHS14; - const double f14_20 = -f14 * m_A93; - m_A94 += m_A53 * f14_20; - m_A96 += m_A54 * f14_20; - m_A98 += m_A55 * f14_20; - RHS20 += f14_20 * RHS14; -const double f15 = 1.0 / m_A60; - const double f15_18 = -f15 * m_A78; - m_A79 += m_A61 * f15_18; - m_A80 += m_A62 * f15_18; - RHS18 += f15_18 * RHS15; - const double f15_20 = -f15 * m_A94; - m_A96 += m_A61 * f15_20; - m_A98 += m_A62 * f15_20; - RHS20 += f15_20 * RHS15; -const double f16 = 1.0 / m_A65; - const double f16_19 = -f16 * m_A85; - m_A87 += m_A66 * f16_19; - RHS19 += f16_19 * RHS16; -const double f17 = 1.0 / m_A71; - const double f17_19 = -f17 * m_A86; - m_A87 += m_A72 * f17_19; - m_A88 += m_A73 * f17_19; - RHS19 += f17_19 * RHS17; - const double f17_20 = -f17 * m_A95; - m_A97 += m_A72 * f17_20; - m_A98 += m_A73 * f17_20; - RHS20 += f17_20 * RHS17; -const double f18 = 1.0 / m_A79; - const double f18_20 = -f18 * m_A96; - m_A98 += m_A80 * f18_20; - RHS20 += f18_20 * RHS18; -const double f19 = 1.0 / m_A87; - const double f19_20 = -f19 * m_A97; - m_A98 += m_A88 * f19_20; - RHS20 += f19_20 * RHS19; - V[20] = RHS20 / m_A98; - double tmp19 = 0.0; - tmp19 += m_A88 * V[20]; - V[19] = (RHS19 - tmp19) / m_A87; - double tmp18 = 0.0; - tmp18 += m_A80 * V[20]; - V[18] = (RHS18 - tmp18) / m_A79; - double tmp17 = 0.0; - tmp17 += m_A72 * V[19]; - tmp17 += m_A73 * V[20]; - V[17] = (RHS17 - tmp17) / m_A71; - double tmp16 = 0.0; - tmp16 += m_A66 * V[19]; - V[16] = (RHS16 - tmp16) / m_A65; - double tmp15 = 0.0; - tmp15 += m_A61 * V[18]; - tmp15 += m_A62 * V[20]; - V[15] = (RHS15 - tmp15) / m_A60; - double tmp14 = 0.0; - tmp14 += m_A53 * V[15]; - tmp14 += m_A54 * V[18]; - tmp14 += m_A55 * V[20]; - V[14] = (RHS14 - tmp14) / m_A52; - double tmp13 = 0.0; - tmp13 += m_A45 * V[14]; - tmp13 += m_A46 * V[15]; - tmp13 += m_A47 * V[18]; - tmp13 += m_A48 * V[20]; - V[13] = (RHS13 - tmp13) / m_A44; - double tmp12 = 0.0; - tmp12 += m_A40 * V[17]; - tmp12 += m_A41 * V[20]; - V[12] = (RHS12 - tmp12) / m_A39; - double tmp11 = 0.0; - tmp11 += m_A36 * V[17]; - tmp11 += m_A37 * V[19]; - V[11] = (RHS11 - tmp11) / m_A35; - double tmp10 = 0.0; - tmp10 += m_A31 * V[16]; - tmp10 += m_A32 * V[19]; - V[10] = (RHS10 - tmp10) / m_A30; - double tmp9 = 0.0; - tmp9 += m_A25 * V[13]; - tmp9 += m_A26 * V[14]; - tmp9 += m_A27 * V[15]; - tmp9 += m_A28 * V[18]; - V[9] = (RHS9 - tmp9) / m_A24; - double tmp8 = 0.0; - tmp8 += m_A22 * V[13]; - tmp8 += m_A23 * V[20]; - V[8] = (RHS8 - tmp8) / m_A21; - double tmp7 = 0.0; - tmp7 += m_A19 * V[11]; - tmp7 += m_A20 * V[17]; - V[7] = (RHS7 - tmp7) / m_A18; - double tmp6 = 0.0; - tmp6 += m_A16 * V[12]; - tmp6 += m_A17 * V[20]; - V[6] = (RHS6 - tmp6) / m_A15; - double tmp5 = 0.0; - tmp5 += m_A14 * V[17]; - V[5] = (RHS5 - tmp5) / m_A13; - double tmp4 = 0.0; - tmp4 += m_A11 * V[11]; - tmp4 += m_A12 * V[19]; - V[4] = (RHS4 - tmp4) / m_A10; - double tmp3 = 0.0; - tmp3 += m_A8 * V[10]; - tmp3 += m_A9 * V[16]; - V[3] = (RHS3 - tmp3) / m_A7; - double tmp2 = 0.0; - tmp2 += m_A6 * V[19]; - V[2] = (RHS2 - tmp2) / m_A5; - double tmp1 = 0.0; - tmp1 += m_A3 * V[15]; - tmp1 += m_A4 * V[18]; - V[1] = (RHS1 - tmp1) / m_A2; - double tmp0 = 0.0; - tmp0 += m_A1 * V[14]; - V[0] = (RHS0 - tmp0) / m_A0; -} - +// dpatrol static void nl_gcr_57a832104e53c9a8_20_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4037,6 +3996,7 @@ const double f4 = 1.0 / m_A14; V[0] = (RHS0 - tmp0) / m_A0; } +// rebound static void nl_gcr_5985dfb549280eeb_13_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4103,6 +4063,7 @@ const double f3 = 1.0 / m_A6; V[0] = (RHS0 - tmp0) / m_A0; } +// tp1985 static void nl_gcr_5ca1779d1825c4c9_26_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4229,6 +4190,7 @@ const double f6 = 1.0 / m_A19; V[0] = (RHS0 - tmp0) / m_A0; } +// tp1985 static void nl_gcr_6148fa421800febb_10_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4281,416 +4243,7 @@ const double f2 = 1.0 / m_A5; V[0] = (RHS0 - tmp0) / m_A0; } -static void nl_gcr_63b745ec069c7245_82_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) - -{ - -double m_A0(0.0); -double m_A1(0.0); -double m_A2(0.0); -double m_A3(0.0); -double m_A4(0.0); -double m_A5(0.0); -double m_A6(0.0); -double m_A7(0.0); -double m_A8(0.0); -double m_A9(0.0); -double m_A10(0.0); -double m_A11(0.0); -double m_A12(0.0); -double m_A13(0.0); -double m_A14(0.0); -double m_A15(0.0); -double m_A16(0.0); -double m_A17(0.0); -double m_A18(0.0); -double m_A19(0.0); -double m_A20(0.0); -double m_A21(0.0); -double m_A22(0.0); -double m_A23(0.0); -double m_A24(0.0); -double m_A25(0.0); -double m_A26(0.0); -double m_A27(0.0); -double m_A28(0.0); -double m_A29(0.0); -double m_A30(0.0); -double m_A31(0.0); -double m_A32(0.0); -double m_A33(0.0); -double m_A34(0.0); -double m_A35(0.0); -double m_A36(0.0); -double m_A37(0.0); -double m_A38(0.0); -double m_A39(0.0); -double m_A40(0.0); -double m_A41(0.0); -double m_A42(0.0); -double m_A43(0.0); -double m_A44(0.0); -double m_A45(0.0); -double m_A46(0.0); -double m_A47(0.0); -double m_A48(0.0); -double m_A49(0.0); -double m_A50(0.0); -double m_A51(0.0); -double m_A52(0.0); -double m_A53(0.0); -double m_A54(0.0); -double m_A55(0.0); -double m_A56(0.0); -double m_A57(0.0); -double m_A58(0.0); -double m_A59(0.0); -double m_A60(0.0); -double m_A61(0.0); -double m_A62(0.0); -double m_A63(0.0); -double m_A64(0.0); -double m_A65(0.0); -double m_A66(0.0); -double m_A67(0.0); -double m_A68(0.0); -double m_A69(0.0); -double m_A70(0.0); -double m_A71(0.0); -double m_A72(0.0); -double m_A73(0.0); -double m_A74(0.0); -double m_A75(0.0); -double m_A76(0.0); -double m_A77(0.0); -double m_A78(0.0); -double m_A79(0.0); -double m_A80(0.0); -double m_A81(0.0); - m_A0 = gt[0] + gt[1] + gt[2]; - m_A1 = m_A1 + go[0]; - double RHS0 = Idr[0] + Idr[1] + Idr[2] - go[1] * *cnV[1] - go[2] * *cnV[2]; - m_A2 = gt[10] + gt[11] + gt[12]; - m_A3 = m_A3 + go[10]; - double RHS1 = Idr[10] + Idr[11] + Idr[12] - go[11] * *cnV[11] - go[12] * *cnV[12]; - m_A4 = gt[20] + gt[21] + gt[22]; - m_A5 = m_A5 + go[20]; - double RHS2 = Idr[20] + Idr[21] + Idr[22] - go[21] * *cnV[21] - go[22] * *cnV[22]; - m_A6 = gt[30] + gt[31] + gt[32] + gt[33] + gt[34]; - m_A8 = m_A8 + go[30]; - m_A8 = m_A8 + go[31]; - m_A7 = m_A7 + go[32]; - double RHS3 = Idr[30] + Idr[31] + Idr[32] + Idr[33] + Idr[34] - go[33] * *cnV[33] - go[34] * *cnV[34]; - m_A9 = gt[40] + gt[41] + gt[42] + gt[43] + gt[44] + gt[45] + gt[46]; - m_A13 = m_A13 + go[40]; - m_A13 = m_A13 + go[41]; - m_A11 = m_A11 + go[42]; - m_A12 = m_A12 + go[43]; - m_A10 = m_A10 + go[44]; - double RHS4 = Idr[40] + Idr[41] + Idr[42] + Idr[43] + Idr[44] + Idr[45] + Idr[46] - go[45] * *cnV[45] - go[46] * *cnV[46]; - m_A14 = gt[50] + gt[51]; - m_A15 = m_A15 + go[50]; - m_A16 = m_A16 + go[51]; - double RHS5 = Idr[50] + Idr[51]; - m_A17 = gt[60] + gt[61] + gt[62] + gt[63] + gt[64]; - m_A19 = m_A19 + go[60]; - m_A19 = m_A19 + go[61]; - m_A18 = m_A18 + go[62]; - double RHS6 = Idr[60] + Idr[61] + Idr[62] + Idr[63] + Idr[64] - go[63] * *cnV[63] - go[64] * *cnV[64]; - m_A22 = gt[70] + gt[71] + gt[72] + gt[73] + gt[74] + gt[75] + gt[76]; - m_A20 = m_A20 + go[70]; - m_A21 = m_A21 + go[71]; - m_A22 = m_A22 + go[72]; - m_A22 = m_A22 + go[73]; - double RHS7 = Idr[70] + Idr[71] + Idr[72] + Idr[73] + Idr[74] + Idr[75] + Idr[76] - go[74] * *cnV[74] - go[75] * *cnV[75] - go[76] * *cnV[76]; - m_A29 = gt[80] + gt[81]; - m_A27 = m_A27 + go[80]; - m_A26 = m_A26 + go[81]; - double RHS8 = Idr[80] + Idr[81]; - m_A32 = gt[90] + gt[91] + gt[92] + gt[93] + gt[94] + gt[95] + gt[96]; - m_A36 = m_A36 + go[90]; - m_A36 = m_A36 + go[91]; - m_A33 = m_A33 + go[92]; - m_A35 = m_A35 + go[93]; - m_A34 = m_A34 + go[94]; - double RHS9 = Idr[90] + Idr[91] + Idr[92] + Idr[93] + Idr[94] + Idr[95] + Idr[96] - go[95] * *cnV[95] - go[96] * *cnV[96]; - m_A39 = gt[100] + gt[101] + gt[102]; - m_A38 = m_A38 + go[100]; - m_A37 = m_A37 + go[101]; - double RHS10 = Idr[100] + Idr[101] + Idr[102] - go[102] * *cnV[102]; - m_A47 = gt[110] + gt[111] + gt[112] + gt[113] + gt[114] + gt[115] + gt[116]; - m_A44 = m_A44 + go[110]; - m_A45 = m_A45 + go[111]; - m_A47 = m_A47 + go[112]; - m_A47 = m_A47 + go[113]; - double RHS11 = Idr[110] + Idr[111] + Idr[112] + Idr[113] + Idr[114] + Idr[115] + Idr[116] - go[114] * *cnV[114] - go[115] * *cnV[115] - go[116] * *cnV[116]; - m_A55 = gt[120] + gt[121] + gt[122] + gt[123] + gt[124] + gt[125] + gt[126]; - m_A56 = m_A56 + go[120]; - m_A56 = m_A56 + go[121]; - m_A52 = m_A52 + go[122]; - m_A51 = m_A51 + go[123]; - double RHS12 = Idr[120] + Idr[121] + Idr[122] + Idr[123] + Idr[124] + Idr[125] + Idr[126] - go[124] * *cnV[124] - go[125] * *cnV[125] - go[126] * *cnV[126]; - m_A61 = gt[130] + gt[131] + gt[132] + gt[133] + gt[134] + gt[135] + gt[136]; - m_A63 = m_A63 + go[130]; - m_A63 = m_A63 + go[131]; - m_A58 = m_A58 + go[132]; - m_A57 = m_A57 + go[133]; - double RHS13 = Idr[130] + Idr[131] + Idr[132] + Idr[133] + Idr[134] + Idr[135] + Idr[136] - go[134] * *cnV[134] - go[135] * *cnV[135] - go[136] * *cnV[136]; - m_A73 = gt[140] + gt[141] + gt[142] + gt[143] + gt[144] + gt[145] + gt[146] + gt[147] + gt[148] + gt[149]; - m_A66 = m_A66 + go[140]; - m_A65 = m_A65 + go[141]; - m_A65 = m_A65 + go[142]; - m_A71 = m_A71 + go[143]; - m_A71 = m_A71 + go[144]; - m_A64 = m_A64 + go[145]; - m_A64 = m_A64 + go[146]; - double RHS14 = Idr[140] + Idr[141] + Idr[142] + Idr[143] + Idr[144] + Idr[145] + Idr[146] + Idr[147] + Idr[148] + Idr[149] - go[147] * *cnV[147] - go[148] * *cnV[148] - go[149] * *cnV[149]; - m_A81 = gt[150] + gt[151] + gt[152] + gt[153] + gt[154] + gt[155] + gt[156] + gt[157] + gt[158] + gt[159]; - m_A76 = m_A76 + go[150]; - m_A76 = m_A76 + go[151]; - m_A79 = m_A79 + go[152]; - m_A79 = m_A79 + go[153]; - m_A75 = m_A75 + go[154]; - m_A75 = m_A75 + go[155]; - double RHS15 = Idr[150] + Idr[151] + Idr[152] + Idr[153] + Idr[154] + Idr[155] + Idr[156] + Idr[157] + Idr[158] + Idr[159] - go[156] * *cnV[156] - go[157] * *cnV[157] - go[158] * *cnV[158] - go[159] * *cnV[159]; -const double f0 = 1.0 / m_A0; - const double f0_7 = -f0 * m_A20; - m_A22 += m_A1 * f0_7; - RHS7 += f0_7 * RHS0; -const double f1 = 1.0 / m_A2; - const double f1_11 = -f1 * m_A44; - m_A47 += m_A3 * f1_11; - RHS11 += f1_11 * RHS1; -const double f2 = 1.0 / m_A4; - const double f2_8 = -f2 * m_A26; - m_A29 += m_A5 * f2_8; - RHS8 += f2_8 * RHS2; -const double f3 = 1.0 / m_A6; - const double f3_12 = -f3 * m_A51; - m_A55 += m_A7 * f3_12; - m_A56 += m_A8 * f3_12; - RHS12 += f3_12 * RHS3; - const double f3_14 = -f3 * m_A64; - m_A71 += m_A7 * f3_14; - m_A73 += m_A8 * f3_14; - RHS14 += f3_14 * RHS3; -const double f4 = 1.0 / m_A9; - const double f4_7 = -f4 * m_A21; - m_A22 += m_A10 * f4_7; - m_A23 += m_A11 * f4_7; - m_A24 += m_A12 * f4_7; - m_A25 += m_A13 * f4_7; - RHS7 += f4_7 * RHS4; - const double f4_8 = -f4 * m_A27; - m_A28 += m_A10 * f4_8; - m_A29 += m_A11 * f4_8; - m_A30 += m_A12 * f4_8; - m_A31 += m_A13 * f4_8; - RHS8 += f4_8 * RHS4; - const double f4_12 = -f4 * m_A52; - m_A53 += m_A10 * f4_12; - m_A54 += m_A11 * f4_12; - m_A55 += m_A12 * f4_12; - m_A56 += m_A13 * f4_12; - RHS12 += f4_12 * RHS4; - const double f4_14 = -f4 * m_A65; - m_A67 += m_A10 * f4_14; - m_A68 += m_A11 * f4_14; - m_A71 += m_A12 * f4_14; - m_A73 += m_A13 * f4_14; - RHS14 += f4_14 * RHS4; -const double f5 = 1.0 / m_A14; - const double f5_10 = -f5 * m_A37; - m_A39 += m_A15 * f5_10; - m_A42 += m_A16 * f5_10; - RHS10 += f5_10 * RHS5; - const double f5_14 = -f5 * m_A66; - m_A69 += m_A15 * f5_14; - m_A73 += m_A16 * f5_14; - RHS14 += f5_14 * RHS5; -const double f6 = 1.0 / m_A17; - const double f6_13 = -f6 * m_A57; - m_A61 += m_A18 * f6_13; - m_A63 += m_A19 * f6_13; - RHS13 += f6_13 * RHS6; - const double f6_15 = -f6 * m_A75; - m_A79 += m_A18 * f6_15; - m_A81 += m_A19 * f6_15; - RHS15 += f6_15 * RHS6; -const double f7 = 1.0 / m_A22; - const double f7_8 = -f7 * m_A28; - m_A29 += m_A23 * f7_8; - m_A30 += m_A24 * f7_8; - m_A31 += m_A25 * f7_8; - RHS8 += f7_8 * RHS7; - const double f7_12 = -f7 * m_A53; - m_A54 += m_A23 * f7_12; - m_A55 += m_A24 * f7_12; - m_A56 += m_A25 * f7_12; - RHS12 += f7_12 * RHS7; - const double f7_14 = -f7 * m_A67; - m_A68 += m_A23 * f7_14; - m_A71 += m_A24 * f7_14; - m_A73 += m_A25 * f7_14; - RHS14 += f7_14 * RHS7; -const double f8 = 1.0 / m_A29; - const double f8_12 = -f8 * m_A54; - m_A55 += m_A30 * f8_12; - m_A56 += m_A31 * f8_12; - RHS12 += f8_12 * RHS8; - const double f8_14 = -f8 * m_A68; - m_A71 += m_A30 * f8_14; - m_A73 += m_A31 * f8_14; - RHS14 += f8_14 * RHS8; -const double f9 = 1.0 / m_A32; - const double f9_10 = -f9 * m_A38; - m_A39 += m_A33 * f9_10; - m_A40 += m_A34 * f9_10; - m_A41 += m_A35 * f9_10; - m_A43 += m_A36 * f9_10; - RHS10 += f9_10 * RHS9; - const double f9_11 = -f9 * m_A45; - m_A46 += m_A33 * f9_11; - m_A47 += m_A34 * f9_11; - m_A48 += m_A35 * f9_11; - m_A50 += m_A36 * f9_11; - RHS11 += f9_11 * RHS9; - const double f9_13 = -f9 * m_A58; - m_A59 += m_A33 * f9_13; - m_A60 += m_A34 * f9_13; - m_A61 += m_A35 * f9_13; - m_A63 += m_A36 * f9_13; - RHS13 += f9_13 * RHS9; - const double f9_15 = -f9 * m_A76; - m_A77 += m_A33 * f9_15; - m_A78 += m_A34 * f9_15; - m_A79 += m_A35 * f9_15; - m_A81 += m_A36 * f9_15; - RHS15 += f9_15 * RHS9; -const double f10 = 1.0 / m_A39; - const double f10_11 = -f10 * m_A46; - m_A47 += m_A40 * f10_11; - m_A48 += m_A41 * f10_11; - m_A49 += m_A42 * f10_11; - m_A50 += m_A43 * f10_11; - RHS11 += f10_11 * RHS10; - const double f10_13 = -f10 * m_A59; - m_A60 += m_A40 * f10_13; - m_A61 += m_A41 * f10_13; - m_A62 += m_A42 * f10_13; - m_A63 += m_A43 * f10_13; - RHS13 += f10_13 * RHS10; - const double f10_14 = -f10 * m_A69; - m_A70 += m_A40 * f10_14; - m_A72 += m_A41 * f10_14; - m_A73 += m_A42 * f10_14; - m_A74 += m_A43 * f10_14; - RHS14 += f10_14 * RHS10; - const double f10_15 = -f10 * m_A77; - m_A78 += m_A40 * f10_15; - m_A79 += m_A41 * f10_15; - m_A80 += m_A42 * f10_15; - m_A81 += m_A43 * f10_15; - RHS15 += f10_15 * RHS10; -const double f11 = 1.0 / m_A47; - const double f11_13 = -f11 * m_A60; - m_A61 += m_A48 * f11_13; - m_A62 += m_A49 * f11_13; - m_A63 += m_A50 * f11_13; - RHS13 += f11_13 * RHS11; - const double f11_14 = -f11 * m_A70; - m_A72 += m_A48 * f11_14; - m_A73 += m_A49 * f11_14; - m_A74 += m_A50 * f11_14; - RHS14 += f11_14 * RHS11; - const double f11_15 = -f11 * m_A78; - m_A79 += m_A48 * f11_15; - m_A80 += m_A49 * f11_15; - m_A81 += m_A50 * f11_15; - RHS15 += f11_15 * RHS11; -const double f12 = 1.0 / m_A55; - const double f12_14 = -f12 * m_A71; - m_A73 += m_A56 * f12_14; - RHS14 += f12_14 * RHS12; -const double f13 = 1.0 / m_A61; - const double f13_14 = -f13 * m_A72; - m_A73 += m_A62 * f13_14; - m_A74 += m_A63 * f13_14; - RHS14 += f13_14 * RHS13; - const double f13_15 = -f13 * m_A79; - m_A80 += m_A62 * f13_15; - m_A81 += m_A63 * f13_15; - RHS15 += f13_15 * RHS13; -const double f14 = 1.0 / m_A73; - const double f14_15 = -f14 * m_A80; - m_A81 += m_A74 * f14_15; - RHS15 += f14_15 * RHS14; - V[15] = RHS15 / m_A81; - double tmp14 = 0.0; - tmp14 += m_A74 * V[15]; - V[14] = (RHS14 - tmp14) / m_A73; - double tmp13 = 0.0; - tmp13 += m_A62 * V[14]; - tmp13 += m_A63 * V[15]; - V[13] = (RHS13 - tmp13) / m_A61; - double tmp12 = 0.0; - tmp12 += m_A56 * V[14]; - V[12] = (RHS12 - tmp12) / m_A55; - double tmp11 = 0.0; - tmp11 += m_A48 * V[13]; - tmp11 += m_A49 * V[14]; - tmp11 += m_A50 * V[15]; - V[11] = (RHS11 - tmp11) / m_A47; - double tmp10 = 0.0; - tmp10 += m_A40 * V[11]; - tmp10 += m_A41 * V[13]; - tmp10 += m_A42 * V[14]; - tmp10 += m_A43 * V[15]; - V[10] = (RHS10 - tmp10) / m_A39; - double tmp9 = 0.0; - tmp9 += m_A33 * V[10]; - tmp9 += m_A34 * V[11]; - tmp9 += m_A35 * V[13]; - tmp9 += m_A36 * V[15]; - V[9] = (RHS9 - tmp9) / m_A32; - double tmp8 = 0.0; - tmp8 += m_A30 * V[12]; - tmp8 += m_A31 * V[14]; - V[8] = (RHS8 - tmp8) / m_A29; - double tmp7 = 0.0; - tmp7 += m_A23 * V[8]; - tmp7 += m_A24 * V[12]; - tmp7 += m_A25 * V[14]; - V[7] = (RHS7 - tmp7) / m_A22; - double tmp6 = 0.0; - tmp6 += m_A18 * V[13]; - tmp6 += m_A19 * V[15]; - V[6] = (RHS6 - tmp6) / m_A17; - double tmp5 = 0.0; - tmp5 += m_A15 * V[10]; - tmp5 += m_A16 * V[14]; - V[5] = (RHS5 - tmp5) / m_A14; - double tmp4 = 0.0; - tmp4 += m_A10 * V[7]; - tmp4 += m_A11 * V[8]; - tmp4 += m_A12 * V[12]; - tmp4 += m_A13 * V[14]; - V[4] = (RHS4 - tmp4) / m_A9; - double tmp3 = 0.0; - tmp3 += m_A7 * V[12]; - tmp3 += m_A8 * V[14]; - V[3] = (RHS3 - tmp3) / m_A6; - double tmp2 = 0.0; - tmp2 += m_A5 * V[8]; - V[2] = (RHS2 - tmp2) / m_A4; - double tmp1 = 0.0; - tmp1 += m_A3 * V[11]; - V[1] = (RHS1 - tmp1) / m_A2; - double tmp0 = 0.0; - tmp0 += m_A1 * V[7]; - V[0] = (RHS0 - tmp0) / m_A0; -} - +// tp1985 static void nl_gcr_6480c7a1d69e9131_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4729,6 +4282,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// stuntcyc static void nl_gcr_6c599fc01f5b084c_20_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4827,6 +4381,7 @@ const double f4 = 1.0 / m_A14; V[0] = (RHS0 - tmp0) / m_A0; } +// breakout static void nl_gcr_6d40bbc695987ef5_13_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4893,6 +4448,7 @@ const double f3 = 1.0 / m_A6; V[0] = (RHS0 - tmp0) / m_A0; } +// pongf static void nl_gcr_70e1061a9deb37a4_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4931,6 +4487,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// breakout static void nl_gcr_7421995adbfda1ad_10_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -4983,6 +4540,341 @@ const double f2 = 1.0 / m_A4; V[0] = (RHS0 - tmp0) / m_A0; } +// zac1b11142 +static void nl_gcr_7572db25f250cf5a_71_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) + +{ + +double m_A0(0.0); +double m_A1(0.0); +double m_A2(0.0); +double m_A3(0.0); +double m_A4(0.0); +double m_A5(0.0); +double m_A6(0.0); +double m_A7(0.0); +double m_A8(0.0); +double m_A9(0.0); +double m_A10(0.0); +double m_A11(0.0); +double m_A12(0.0); +double m_A13(0.0); +double m_A14(0.0); +double m_A15(0.0); +double m_A16(0.0); +double m_A17(0.0); +double m_A18(0.0); +double m_A19(0.0); +double m_A20(0.0); +double m_A21(0.0); +double m_A22(0.0); +double m_A23(0.0); +double m_A24(0.0); +double m_A25(0.0); +double m_A26(0.0); +double m_A27(0.0); +double m_A28(0.0); +double m_A29(0.0); +double m_A30(0.0); +double m_A31(0.0); +double m_A32(0.0); +double m_A33(0.0); +double m_A34(0.0); +double m_A35(0.0); +double m_A36(0.0); +double m_A37(0.0); +double m_A38(0.0); +double m_A39(0.0); +double m_A40(0.0); +double m_A41(0.0); +double m_A42(0.0); +double m_A43(0.0); +double m_A44(0.0); +double m_A45(0.0); +double m_A46(0.0); +double m_A47(0.0); +double m_A48(0.0); +double m_A49(0.0); +double m_A50(0.0); +double m_A51(0.0); +double m_A52(0.0); +double m_A53(0.0); +double m_A54(0.0); +double m_A55(0.0); +double m_A56(0.0); +double m_A57(0.0); +double m_A58(0.0); +double m_A59(0.0); +double m_A60(0.0); +double m_A61(0.0); +double m_A62(0.0); +double m_A63(0.0); +double m_A64(0.0); +double m_A65(0.0); +double m_A66(0.0); +double m_A67(0.0); +double m_A68(0.0); +double m_A69(0.0); +double m_A70(0.0); + m_A0 = gt[0] + gt[1] + gt[2] + gt[3] + gt[4] + gt[5] + gt[6]; + m_A1 = m_A1 + go[0]; + double RHS0 = Idr[0] + Idr[1] + Idr[2] + Idr[3] + Idr[4] + Idr[5] + Idr[6] - go[1] * *cnV[1] - go[2] * *cnV[2] - go[3] * *cnV[3] - go[4] * *cnV[4] - go[5] * *cnV[5] - go[6] * *cnV[6]; + m_A2 = gt[8] + gt[9] + gt[10] + gt[11] + gt[12] + gt[13] + gt[14]; + m_A3 = m_A3 + go[8]; + double RHS1 = Idr[8] + Idr[9] + Idr[10] + Idr[11] + Idr[12] + Idr[13] + Idr[14] - go[9] * *cnV[9] - go[10] * *cnV[10] - go[11] * *cnV[11] - go[12] * *cnV[12] - go[13] * *cnV[13] - go[14] * *cnV[14]; + m_A4 = gt[16] + gt[17] + gt[18]; + m_A5 = m_A5 + go[16]; + double RHS2 = Idr[16] + Idr[17] + Idr[18] - go[17] * *cnV[17] - go[18] * *cnV[18]; + m_A6 = gt[24] + gt[25]; + m_A7 = m_A7 + go[24]; + double RHS3 = Idr[24] + Idr[25] - go[25] * *cnV[25]; + m_A8 = gt[32] + gt[33] + gt[34]; + m_A9 = m_A9 + go[32]; + double RHS4 = Idr[32] + Idr[33] + Idr[34] - go[33] * *cnV[33] - go[34] * *cnV[34]; + m_A10 = gt[40] + gt[41]; + m_A11 = m_A11 + go[40]; + double RHS5 = Idr[40] + Idr[41] - go[41] * *cnV[41]; + m_A12 = gt[48] + gt[49] + gt[50]; + m_A13 = m_A13 + go[48]; + double RHS6 = Idr[48] + Idr[49] + Idr[50] - go[49] * *cnV[49] - go[50] * *cnV[50]; + m_A14 = gt[56] + gt[57] + gt[58]; + m_A15 = m_A15 + go[56]; + double RHS7 = Idr[56] + Idr[57] + Idr[58] - go[57] * *cnV[57] - go[58] * *cnV[58]; + m_A17 = gt[64] + gt[65] + gt[66] + gt[67] + gt[68] + gt[69]; + m_A16 = m_A16 + go[64]; + m_A18 = m_A18 + go[65]; + m_A19 = m_A19 + go[66]; + m_A19 = m_A19 + go[67]; + double RHS8 = Idr[64] + Idr[65] + Idr[66] + Idr[67] + Idr[68] + Idr[69] - go[68] * *cnV[68] - go[69] * *cnV[69]; + m_A21 = gt[72] + gt[73] + gt[74]; + m_A22 = m_A22 + go[72]; + double RHS9 = Idr[72] + Idr[73] + Idr[74] - go[73] * *cnV[73] - go[74] * *cnV[74]; + m_A23 = gt[80] + gt[81] + gt[82]; + m_A25 = m_A25 + go[80]; + m_A24 = m_A24 + go[81]; + double RHS10 = Idr[80] + Idr[81] + Idr[82] - go[82] * *cnV[82]; + m_A27 = gt[88] + gt[89] + gt[90] + gt[91] + gt[92] + gt[93]; + m_A26 = m_A26 + go[88]; + m_A29 = m_A29 + go[89]; + m_A29 = m_A29 + go[90]; + double RHS11 = Idr[88] + Idr[89] + Idr[90] + Idr[91] + Idr[92] + Idr[93] - go[91] * *cnV[91] - go[92] * *cnV[92] - go[93] * *cnV[93]; + m_A31 = gt[96] + gt[97]; + m_A32 = m_A32 + go[96]; + m_A30 = m_A30 + go[97]; + double RHS12 = Idr[96] + Idr[97]; + m_A35 = gt[104] + gt[105]; + m_A34 = m_A34 + go[104]; + m_A33 = m_A33 + go[105]; + double RHS13 = Idr[104] + Idr[105]; + m_A38 = gt[112] + gt[113]; + m_A37 = m_A37 + go[112]; + m_A36 = m_A36 + go[113]; + double RHS14 = Idr[112] + Idr[113]; + m_A40 = gt[120] + gt[121] + gt[122] + gt[123]; + m_A41 = m_A41 + go[120]; + m_A39 = m_A39 + go[121]; + double RHS15 = Idr[120] + Idr[121] + Idr[122] + Idr[123] - go[122] * *cnV[122] - go[123] * *cnV[123]; + m_A44 = gt[128] + gt[129]; + m_A43 = m_A43 + go[128]; + m_A42 = m_A42 + go[129]; + double RHS16 = Idr[128] + Idr[129]; + m_A54 = gt[136] + gt[137] + gt[138] + gt[139] + gt[140] + gt[141]; + m_A52 = m_A52 + go[136]; + m_A50 = m_A50 + go[137]; + m_A50 = m_A50 + go[138]; + m_A51 = m_A51 + go[139]; + m_A49 = m_A49 + go[140]; + m_A48 = m_A48 + go[141]; + double RHS17 = Idr[136] + Idr[137] + Idr[138] + Idr[139] + Idr[140] + Idr[141]; + m_A65 = gt[144] + gt[145] + gt[146] + gt[147] + gt[148] + gt[149]; + m_A61 = m_A61 + go[144]; + m_A60 = m_A60 + go[145]; + m_A60 = m_A60 + go[146]; + m_A59 = m_A59 + go[147]; + m_A58 = m_A58 + go[148]; + m_A57 = m_A57 + go[149]; + double RHS18 = Idr[144] + Idr[145] + Idr[146] + Idr[147] + Idr[148] + Idr[149]; + m_A70 = gt[152] + gt[153] + gt[154] + gt[155]; + m_A68 = m_A68 + go[152]; + m_A67 = m_A67 + go[153]; + double RHS19 = Idr[152] + Idr[153] + Idr[154] + Idr[155] - go[154] * *cnV[154] - go[155] * *cnV[155]; +const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A16; + m_A20 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; +const double f1 = 1.0 / m_A2; + const double f1_11 = -f1 * m_A26; + m_A28 += m_A3 * f1_11; + RHS11 += f1_11 * RHS1; +const double f2 = 1.0 / m_A4; + const double f2_12 = -f2 * m_A30; + m_A31 += m_A5 * f2_12; + RHS12 += f2_12 * RHS2; +const double f3 = 1.0 / m_A6; + const double f3_13 = -f3 * m_A33; + m_A35 += m_A7 * f3_13; + RHS13 += f3_13 * RHS3; + const double f3_17 = -f3 * m_A48; + m_A52 += m_A7 * f3_17; + RHS17 += f3_17 * RHS3; +const double f4 = 1.0 / m_A8; + const double f4_13 = -f4 * m_A34; + m_A35 += m_A9 * f4_13; + RHS13 += f4_13 * RHS4; +const double f5 = 1.0 / m_A10; + const double f5_14 = -f5 * m_A36; + m_A38 += m_A11 * f5_14; + RHS14 += f5_14 * RHS5; + const double f5_18 = -f5 * m_A57; + m_A61 += m_A11 * f5_18; + RHS18 += f5_18 * RHS5; +const double f6 = 1.0 / m_A12; + const double f6_14 = -f6 * m_A37; + m_A38 += m_A13 * f6_14; + RHS14 += f6_14 * RHS6; +const double f7 = 1.0 / m_A14; + const double f7_17 = -f7 * m_A49; + m_A54 += m_A15 * f7_17; + RHS17 += f7_17 * RHS7; + const double f7_19 = -f7 * m_A67; + m_A68 += m_A15 * f7_19; + RHS19 += f7_19 * RHS7; +const double f8 = 1.0 / m_A17; + const double f8_16 = -f8 * m_A42; + m_A44 += m_A18 * f8_16; + m_A45 += m_A19 * f8_16; + m_A47 += m_A20 * f8_16; + RHS16 += f8_16 * RHS8; + const double f8_17 = -f8 * m_A50; + m_A53 += m_A18 * f8_17; + m_A54 += m_A19 * f8_17; + m_A56 += m_A20 * f8_17; + RHS17 += f8_17 * RHS8; +const double f9 = 1.0 / m_A21; + const double f9_15 = -f9 * m_A39; + m_A41 += m_A22 * f9_15; + RHS15 += f9_15 * RHS9; + const double f9_18 = -f9 * m_A58; + m_A65 += m_A22 * f9_18; + RHS18 += f9_18 * RHS9; +const double f10 = 1.0 / m_A23; + const double f10_16 = -f10 * m_A43; + m_A44 += m_A24 * f10_16; + m_A46 += m_A25 * f10_16; + RHS16 += f10_16 * RHS10; + const double f10_18 = -f10 * m_A59; + m_A63 += m_A24 * f10_18; + m_A65 += m_A25 * f10_18; + RHS18 += f10_18 * RHS10; +const double f11 = 1.0 / m_A27; + const double f11_18 = -f11 * m_A60; + m_A62 += m_A28 * f11_18; + m_A65 += m_A29 * f11_18; + RHS18 += f11_18 * RHS11; +const double f12 = 1.0 / m_A31; + const double f12_17 = -f12 * m_A51; + m_A54 += m_A32 * f12_17; + RHS17 += f12_17 * RHS12; +const double f13 = 1.0 / m_A35; + const double f13_17 = -f13 * m_A52; + RHS17 += f13_17 * RHS13; +const double f14 = 1.0 / m_A38; + const double f14_18 = -f14 * m_A61; + RHS18 += f14_18 * RHS14; +const double f15 = 1.0 / m_A40; + const double f15_18 = -f15 * m_A62; + m_A65 += m_A41 * f15_18; + RHS18 += f15_18 * RHS15; +const double f16 = 1.0 / m_A44; + const double f16_17 = -f16 * m_A53; + m_A54 += m_A45 * f16_17; + m_A55 += m_A46 * f16_17; + m_A56 += m_A47 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_18 = -f16 * m_A63; + m_A64 += m_A45 * f16_18; + m_A65 += m_A46 * f16_18; + m_A66 += m_A47 * f16_18; + RHS18 += f16_18 * RHS16; +const double f17 = 1.0 / m_A54; + const double f17_18 = -f17 * m_A64; + m_A65 += m_A55 * f17_18; + m_A66 += m_A56 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_19 = -f17 * m_A68; + m_A69 += m_A55 * f17_19; + m_A70 += m_A56 * f17_19; + RHS19 += f17_19 * RHS17; +const double f18 = 1.0 / m_A65; + const double f18_19 = -f18 * m_A69; + m_A70 += m_A66 * f18_19; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A70; + double tmp18 = 0.0; + tmp18 += m_A66 * V[19]; + V[18] = (RHS18 - tmp18) / m_A65; + double tmp17 = 0.0; + tmp17 += m_A55 * V[18]; + tmp17 += m_A56 * V[19]; + V[17] = (RHS17 - tmp17) / m_A54; + double tmp16 = 0.0; + tmp16 += m_A45 * V[17]; + tmp16 += m_A46 * V[18]; + tmp16 += m_A47 * V[19]; + V[16] = (RHS16 - tmp16) / m_A44; + double tmp15 = 0.0; + tmp15 += m_A41 * V[18]; + V[15] = (RHS15 - tmp15) / m_A40; + double tmp14 = 0.0; + V[14] = (RHS14 - tmp14) / m_A38; + double tmp13 = 0.0; + V[13] = (RHS13 - tmp13) / m_A35; + double tmp12 = 0.0; + tmp12 += m_A32 * V[17]; + V[12] = (RHS12 - tmp12) / m_A31; + double tmp11 = 0.0; + tmp11 += m_A28 * V[15]; + tmp11 += m_A29 * V[18]; + V[11] = (RHS11 - tmp11) / m_A27; + double tmp10 = 0.0; + tmp10 += m_A24 * V[16]; + tmp10 += m_A25 * V[18]; + V[10] = (RHS10 - tmp10) / m_A23; + double tmp9 = 0.0; + tmp9 += m_A22 * V[18]; + V[9] = (RHS9 - tmp9) / m_A21; + double tmp8 = 0.0; + tmp8 += m_A18 * V[16]; + tmp8 += m_A19 * V[17]; + tmp8 += m_A20 * V[19]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A15 * V[17]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[14]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[14]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[13]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[13]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[12]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[19]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// popeye static void nl_gcr_794f14a13bda75f0_50_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -5223,6 +5115,7 @@ const double f10 = 1.0 / m_A45; V[0] = (RHS0 - tmp0) / m_A0; } +// breakout static void nl_gcr_7a4e8b4f388d66d7_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -5261,6 +5154,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// kidniki static void nl_gcr_7b1592d23e41ce56_37_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -5443,6 +5337,7 @@ const double f7 = 1.0 / m_A30; V[0] = (RHS0 - tmp0) / m_A0; } +// rebound static void nl_gcr_7c58698d6a68f4a0_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -5481,6 +5376,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// gunfight static void nl_gcr_7dbbdf7feecfa9bd_108_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -5983,6 +5879,7 @@ const double f26 = 1.0 / m_A100; V[0] = (RHS0 - tmp0) / m_A0; } +// konami1x static void nl_gcr_7f2f6447ea71d31e_49_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -6217,6 +6114,7 @@ const double f15 = 1.0 / m_A43; V[0] = (RHS0 - tmp0) / m_A0; } +// dpatrol static void nl_gcr_81bfac76b696d9f3_22_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -6329,6 +6227,7 @@ const double f4 = 1.0 / m_A16; V[0] = (RHS0 - tmp0) / m_A0; } +// breakout static void nl_gcr_876240e48d904d1f_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -6367,6 +6266,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// konami2x static void nl_gcr_8e55e5f9e065890e_85_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -6769,834 +6669,7 @@ const double f27 = 1.0 / m_A75; V[0] = (RHS0 - tmp0) / m_A0; } -static void nl_gcr_92523d559b657838_175_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) - -{ - -double m_A0(0.0); -double m_A1(0.0); -double m_A2(0.0); -double m_A3(0.0); -double m_A4(0.0); -double m_A5(0.0); -double m_A6(0.0); -double m_A7(0.0); -double m_A8(0.0); -double m_A9(0.0); -double m_A10(0.0); -double m_A11(0.0); -double m_A12(0.0); -double m_A13(0.0); -double m_A14(0.0); -double m_A15(0.0); -double m_A16(0.0); -double m_A17(0.0); -double m_A18(0.0); -double m_A19(0.0); -double m_A20(0.0); -double m_A21(0.0); -double m_A22(0.0); -double m_A23(0.0); -double m_A24(0.0); -double m_A25(0.0); -double m_A26(0.0); -double m_A27(0.0); -double m_A28(0.0); -double m_A29(0.0); -double m_A30(0.0); -double m_A31(0.0); -double m_A32(0.0); -double m_A33(0.0); -double m_A34(0.0); -double m_A35(0.0); -double m_A36(0.0); -double m_A37(0.0); -double m_A38(0.0); -double m_A39(0.0); -double m_A40(0.0); -double m_A41(0.0); -double m_A42(0.0); -double m_A43(0.0); -double m_A44(0.0); -double m_A45(0.0); -double m_A46(0.0); -double m_A47(0.0); -double m_A48(0.0); -double m_A49(0.0); -double m_A50(0.0); -double m_A51(0.0); -double m_A52(0.0); -double m_A53(0.0); -double m_A54(0.0); -double m_A55(0.0); -double m_A56(0.0); -double m_A57(0.0); -double m_A58(0.0); -double m_A59(0.0); -double m_A60(0.0); -double m_A61(0.0); -double m_A62(0.0); -double m_A63(0.0); -double m_A64(0.0); -double m_A65(0.0); -double m_A66(0.0); -double m_A67(0.0); -double m_A68(0.0); -double m_A69(0.0); -double m_A70(0.0); -double m_A71(0.0); -double m_A72(0.0); -double m_A73(0.0); -double m_A74(0.0); -double m_A75(0.0); -double m_A76(0.0); -double m_A77(0.0); -double m_A78(0.0); -double m_A79(0.0); -double m_A80(0.0); -double m_A81(0.0); -double m_A82(0.0); -double m_A83(0.0); -double m_A84(0.0); -double m_A85(0.0); -double m_A86(0.0); -double m_A87(0.0); -double m_A88(0.0); -double m_A89(0.0); -double m_A90(0.0); -double m_A91(0.0); -double m_A92(0.0); -double m_A93(0.0); -double m_A94(0.0); -double m_A95(0.0); -double m_A96(0.0); -double m_A97(0.0); -double m_A98(0.0); -double m_A99(0.0); -double m_A100(0.0); -double m_A101(0.0); -double m_A102(0.0); -double m_A103(0.0); -double m_A104(0.0); -double m_A105(0.0); -double m_A106(0.0); -double m_A107(0.0); -double m_A108(0.0); -double m_A109(0.0); -double m_A110(0.0); -double m_A111(0.0); -double m_A112(0.0); -double m_A113(0.0); -double m_A114(0.0); -double m_A115(0.0); -double m_A116(0.0); -double m_A117(0.0); -double m_A118(0.0); -double m_A119(0.0); -double m_A120(0.0); -double m_A121(0.0); -double m_A122(0.0); -double m_A123(0.0); -double m_A124(0.0); -double m_A125(0.0); -double m_A126(0.0); -double m_A127(0.0); -double m_A128(0.0); -double m_A129(0.0); -double m_A130(0.0); -double m_A131(0.0); -double m_A132(0.0); -double m_A133(0.0); -double m_A134(0.0); -double m_A135(0.0); -double m_A136(0.0); -double m_A137(0.0); -double m_A138(0.0); -double m_A139(0.0); -double m_A140(0.0); -double m_A141(0.0); -double m_A142(0.0); -double m_A143(0.0); -double m_A144(0.0); -double m_A145(0.0); -double m_A146(0.0); -double m_A147(0.0); -double m_A148(0.0); -double m_A149(0.0); -double m_A150(0.0); -double m_A151(0.0); -double m_A152(0.0); -double m_A153(0.0); -double m_A154(0.0); -double m_A155(0.0); -double m_A156(0.0); -double m_A157(0.0); -double m_A158(0.0); -double m_A159(0.0); -double m_A160(0.0); -double m_A161(0.0); -double m_A162(0.0); -double m_A163(0.0); -double m_A164(0.0); -double m_A165(0.0); -double m_A166(0.0); -double m_A167(0.0); -double m_A168(0.0); -double m_A169(0.0); -double m_A170(0.0); -double m_A171(0.0); -double m_A172(0.0); -double m_A173(0.0); -double m_A174(0.0); - m_A0 = gt[0] + gt[1] + gt[2]; - m_A1 = m_A1 + go[0]; - double RHS0 = Idr[0] + Idr[1] + Idr[2] - go[1] * *cnV[1] - go[2] * *cnV[2]; - m_A2 = gt[10] + gt[11]; - m_A3 = m_A3 + go[10]; - double RHS1 = Idr[10] + Idr[11] - go[11] * *cnV[11]; - m_A4 = gt[20] + gt[21]; - m_A6 = m_A6 + go[20]; - m_A5 = m_A5 + go[21]; - double RHS2 = Idr[20] + Idr[21]; - m_A7 = gt[30] + gt[31] + gt[32] + gt[33] + gt[34]; - m_A8 = m_A8 + go[30]; - m_A9 = m_A9 + go[31]; - m_A9 = m_A9 + go[32]; - double RHS3 = Idr[30] + Idr[31] + Idr[32] + Idr[33] + Idr[34] - go[33] * *cnV[33] - go[34] * *cnV[34]; - m_A10 = gt[40] + gt[41]; - m_A11 = m_A11 + go[40]; - double RHS4 = Idr[40] + Idr[41] - go[41] * *cnV[41]; - m_A12 = gt[50] + gt[51]; - m_A13 = m_A13 + go[50]; - double RHS5 = Idr[50] + Idr[51] - go[51] * *cnV[51]; - m_A14 = gt[60] + gt[61]; - m_A15 = m_A15 + go[60]; - double RHS6 = Idr[60] + Idr[61] - go[61] * *cnV[61]; - m_A16 = gt[70] + gt[71]; - m_A17 = m_A17 + go[70]; - double RHS7 = Idr[70] + Idr[71] - go[71] * *cnV[71]; - m_A18 = gt[80] + gt[81]; - m_A19 = m_A19 + go[80]; - m_A20 = m_A20 + go[81]; - double RHS8 = Idr[80] + Idr[81]; - m_A21 = gt[90] + gt[91] + gt[92] + gt[93]; - m_A22 = m_A22 + go[90]; - m_A22 = m_A22 + go[91]; - double RHS9 = Idr[90] + Idr[91] + Idr[92] + Idr[93] - go[92] * *cnV[92] - go[93] * *cnV[93]; - m_A23 = gt[100] + gt[101] + gt[102] + gt[103]; - m_A24 = m_A24 + go[100]; - m_A24 = m_A24 + go[101]; - double RHS10 = Idr[100] + Idr[101] + Idr[102] + Idr[103] - go[102] * *cnV[102] - go[103] * *cnV[103]; - m_A25 = gt[110] + gt[111] + gt[112] + gt[113] + gt[114] + gt[115] + gt[116]; - m_A27 = m_A27 + go[110]; - m_A26 = m_A26 + go[111]; - m_A25 = m_A25 + go[112]; - m_A25 = m_A25 + go[113]; - double RHS11 = Idr[110] + Idr[111] + Idr[112] + Idr[113] + Idr[114] + Idr[115] + Idr[116] - go[114] * *cnV[114] - go[115] * *cnV[115] - go[116] * *cnV[116]; - m_A28 = gt[120] + gt[121] + gt[122]; - m_A29 = m_A29 + go[120]; - double RHS12 = Idr[120] + Idr[121] + Idr[122] - go[121] * *cnV[121] - go[122] * *cnV[122]; - m_A30 = gt[130] + gt[131] + gt[132] + gt[133]; - m_A31 = m_A31 + go[130]; - m_A31 = m_A31 + go[131]; - double RHS13 = Idr[130] + Idr[131] + Idr[132] + Idr[133] - go[132] * *cnV[132] - go[133] * *cnV[133]; - m_A32 = gt[140] + gt[141] + gt[142]; - m_A33 = m_A33 + go[140]; - double RHS14 = Idr[140] + Idr[141] + Idr[142] - go[141] * *cnV[141] - go[142] * *cnV[142]; - m_A34 = gt[150] + gt[151] + gt[152] + gt[153]; - m_A35 = m_A35 + go[150]; - double RHS15 = Idr[150] + Idr[151] + Idr[152] + Idr[153] - go[151] * *cnV[151] - go[152] * *cnV[152] - go[153] * *cnV[153]; - m_A36 = gt[160] + gt[161] + gt[162]; - m_A37 = m_A37 + go[160]; - double RHS16 = Idr[160] + Idr[161] + Idr[162] - go[161] * *cnV[161] - go[162] * *cnV[162]; - m_A38 = gt[170] + gt[171] + gt[172]; - m_A39 = m_A39 + go[170]; - double RHS17 = Idr[170] + Idr[171] + Idr[172] - go[171] * *cnV[171] - go[172] * *cnV[172]; - m_A40 = gt[180] + gt[181]; - m_A41 = m_A41 + go[180]; - double RHS18 = Idr[180] + Idr[181] - go[181] * *cnV[181]; - m_A42 = gt[190] + gt[191] + gt[192] + gt[193] + gt[194] + gt[195] + gt[196]; - m_A43 = m_A43 + go[190]; - m_A42 = m_A42 + go[191]; - m_A42 = m_A42 + go[192]; - double RHS19 = Idr[190] + Idr[191] + Idr[192] + Idr[193] + Idr[194] + Idr[195] + Idr[196] - go[193] * *cnV[193] - go[194] * *cnV[194] - go[195] * *cnV[195] - go[196] * *cnV[196]; - m_A44 = gt[200] + gt[201]; - m_A46 = m_A46 + go[200]; - m_A45 = m_A45 + go[201]; - double RHS20 = Idr[200] + Idr[201]; - m_A47 = gt[210] + gt[211] + gt[212] + gt[213] + gt[214]; - m_A49 = m_A49 + go[210]; - m_A49 = m_A49 + go[211]; - m_A48 = m_A48 + go[212]; - double RHS21 = Idr[210] + Idr[211] + Idr[212] + Idr[213] + Idr[214] - go[213] * *cnV[213] - go[214] * *cnV[214]; - m_A50 = gt[220] + gt[221] + gt[222] + gt[223] + gt[224]; - m_A51 = m_A51 + go[220]; - double RHS22 = Idr[220] + Idr[221] + Idr[222] + Idr[223] + Idr[224] - go[221] * *cnV[221] - go[222] * *cnV[222] - go[223] * *cnV[223] - go[224] * *cnV[224]; - m_A52 = gt[230] + gt[231]; - m_A53 = m_A53 + go[230]; - m_A54 = m_A54 + go[231]; - double RHS23 = Idr[230] + Idr[231]; - m_A55 = gt[240] + gt[241]; - m_A57 = m_A57 + go[240]; - m_A56 = m_A56 + go[241]; - double RHS24 = Idr[240] + Idr[241]; - m_A58 = gt[250] + gt[251] + gt[252] + gt[253]; - m_A59 = m_A59 + go[250]; - m_A59 = m_A59 + go[251]; - m_A60 = m_A60 + go[252]; - double RHS25 = Idr[250] + Idr[251] + Idr[252] + Idr[253] - go[253] * *cnV[253]; - m_A61 = gt[260] + gt[261]; - m_A63 = m_A63 + go[260]; - m_A62 = m_A62 + go[261]; - double RHS26 = Idr[260] + Idr[261]; - m_A64 = gt[270] + gt[271]; - m_A65 = m_A65 + go[270]; - m_A66 = m_A66 + go[271]; - double RHS27 = Idr[270] + Idr[271]; - m_A67 = gt[280] + gt[281]; - m_A69 = m_A69 + go[280]; - m_A68 = m_A68 + go[281]; - double RHS28 = Idr[280] + Idr[281]; - m_A73 = gt[290] + gt[291] + gt[292]; - m_A72 = m_A72 + go[290]; - m_A71 = m_A71 + go[291]; - m_A70 = m_A70 + go[292]; - double RHS29 = Idr[290] + Idr[291] + Idr[292]; - m_A82 = gt[300] + gt[301] + gt[302] + gt[303] + gt[304] + gt[305] + gt[306] + gt[307] + gt[308] + gt[309]; - m_A81 = m_A81 + go[300]; - m_A80 = m_A80 + go[301]; - m_A79 = m_A79 + go[302]; - m_A78 = m_A78 + go[303]; - m_A78 = m_A78 + go[304]; - m_A77 = m_A77 + go[305]; - m_A77 = m_A77 + go[306]; - m_A76 = m_A76 + go[307]; - m_A76 = m_A76 + go[308]; - m_A75 = m_A75 + go[309]; - double RHS30 = Idr[300] + Idr[301] + Idr[302] + Idr[303] + Idr[304] + Idr[305] + Idr[306] + Idr[307] + Idr[308] + Idr[309]; - m_A86 = gt[310] + gt[311]; - m_A85 = m_A85 + go[310]; - m_A84 = m_A84 + go[311]; - double RHS31 = Idr[310] + Idr[311]; - m_A90 = gt[320] + gt[321] + gt[322] + gt[323] + gt[324] + gt[325] + gt[326]; - m_A89 = m_A89 + go[320]; - m_A88 = m_A88 + go[321]; - double RHS32 = Idr[320] + Idr[321] + Idr[322] + Idr[323] + Idr[324] + Idr[325] + Idr[326] - go[322] * *cnV[322] - go[323] * *cnV[323] - go[324] * *cnV[324] - go[325] * *cnV[325] - go[326] * *cnV[326]; - m_A94 = gt[330] + gt[331]; - m_A95 = m_A95 + go[330]; - m_A92 = m_A92 + go[331]; - double RHS33 = Idr[330] + Idr[331]; - m_A97 = gt[340] + gt[341] + gt[342] + gt[343] + gt[344] + gt[345] + gt[346]; - m_A98 = m_A98 + go[340]; - m_A99 = m_A99 + go[341]; - m_A99 = m_A99 + go[342]; - m_A96 = m_A96 + go[343]; - double RHS34 = Idr[340] + Idr[341] + Idr[342] + Idr[343] + Idr[344] + Idr[345] + Idr[346] - go[344] * *cnV[344] - go[345] * *cnV[345] - go[346] * *cnV[346]; - m_A103 = gt[350] + gt[351] + gt[352] + gt[353] + gt[354] + gt[355] + gt[356]; - m_A105 = m_A105 + go[350]; - m_A105 = m_A105 + go[351]; - m_A101 = m_A101 + go[352]; - m_A104 = m_A104 + go[353]; - m_A100 = m_A100 + go[354]; - double RHS35 = Idr[350] + Idr[351] + Idr[352] + Idr[353] + Idr[354] + Idr[355] + Idr[356] - go[355] * *cnV[355] - go[356] * *cnV[356]; - m_A108 = gt[360] + gt[361] + gt[362] + gt[363] + gt[364]; - m_A106 = m_A106 + go[360]; - m_A107 = m_A107 + go[361]; - m_A107 = m_A107 + go[362]; - double RHS36 = Idr[360] + Idr[361] + Idr[362] + Idr[363] + Idr[364] - go[363] * *cnV[363] - go[364] * *cnV[364]; - m_A112 = gt[370] + gt[371] + gt[372]; - m_A111 = m_A111 + go[370]; - m_A110 = m_A110 + go[371]; - double RHS37 = Idr[370] + Idr[371] + Idr[372] - go[372] * *cnV[372]; - m_A118 = gt[380] + gt[381] + gt[382]; - m_A116 = m_A116 + go[380]; - m_A115 = m_A115 + go[381]; - double RHS38 = Idr[380] + Idr[381] + Idr[382] - go[382] * *cnV[382]; - m_A122 = gt[390] + gt[391] + gt[392]; - m_A123 = m_A123 + go[390]; - m_A120 = m_A120 + go[391]; - m_A124 = m_A124 + go[392]; - double RHS39 = Idr[390] + Idr[391] + Idr[392]; - m_A130 = gt[400] + gt[401] + gt[402] + gt[403]; - m_A127 = m_A127 + go[400]; - m_A126 = m_A126 + go[401]; - m_A125 = m_A125 + go[402]; - double RHS40 = Idr[400] + Idr[401] + Idr[402] + Idr[403] - go[403] * *cnV[403]; - m_A141 = gt[410] + gt[411] + gt[412] + gt[413] + gt[414] + gt[415] + gt[416]; - m_A136 = m_A136 + go[410]; - m_A135 = m_A135 + go[411]; - m_A134 = m_A134 + go[412]; - m_A133 = m_A133 + go[413]; - m_A137 = m_A137 + go[414]; - m_A138 = m_A138 + go[415]; - m_A140 = m_A140 + go[416]; - double RHS41 = Idr[410] + Idr[411] + Idr[412] + Idr[413] + Idr[414] + Idr[415] + Idr[416]; - m_A146 = gt[420] + gt[421] + gt[422]; - m_A143 = m_A143 + go[420]; - m_A144 = m_A144 + go[421]; - double RHS42 = Idr[420] + Idr[421] + Idr[422] - go[422] * *cnV[422]; - m_A153 = gt[430] + gt[431] + gt[432] + gt[433] + gt[434] + gt[435]; - m_A150 = m_A150 + go[430]; - m_A151 = m_A151 + go[431]; - m_A149 = m_A149 + go[432]; - m_A154 = m_A154 + go[433]; - double RHS43 = Idr[430] + Idr[431] + Idr[432] + Idr[433] + Idr[434] + Idr[435] - go[434] * *cnV[434] - go[435] * *cnV[435]; - m_A160 = gt[440] + gt[441] + gt[442] + gt[443] + gt[444] + gt[445] + gt[446] + gt[447] + gt[448]; - m_A157 = m_A157 + go[440]; - m_A159 = m_A159 + go[441]; - m_A156 = m_A156 + go[442]; - m_A156 = m_A156 + go[443]; - m_A155 = m_A155 + go[444]; - m_A155 = m_A155 + go[445]; - double RHS44 = Idr[440] + Idr[441] + Idr[442] + Idr[443] + Idr[444] + Idr[445] + Idr[446] + Idr[447] + Idr[448] - go[446] * *cnV[446] - go[447] * *cnV[447] - go[448] * *cnV[448]; - m_A164 = gt[450] + gt[451] + gt[452] + gt[453] + gt[454] + gt[455] + gt[456]; - m_A165 = m_A165 + go[450]; - m_A165 = m_A165 + go[451]; - m_A163 = m_A163 + go[452]; - m_A162 = m_A162 + go[453]; - double RHS45 = Idr[450] + Idr[451] + Idr[452] + Idr[453] + Idr[454] + Idr[455] + Idr[456] - go[454] * *cnV[454] - go[455] * *cnV[455] - go[456] * *cnV[456]; - m_A174 = gt[460] + gt[461] + gt[462] + gt[463] + gt[464] + gt[465] + gt[466] + gt[467] + gt[468] + gt[469]; - m_A167 = m_A167 + go[460]; - m_A168 = m_A168 + go[461]; - m_A168 = m_A168 + go[462]; - m_A173 = m_A173 + go[463]; - m_A173 = m_A173 + go[464]; - m_A166 = m_A166 + go[465]; - m_A166 = m_A166 + go[466]; - double RHS46 = Idr[460] + Idr[461] + Idr[462] + Idr[463] + Idr[464] + Idr[465] + Idr[466] + Idr[467] + Idr[468] + Idr[469] - go[467] * *cnV[467] - go[468] * *cnV[468] - go[469] * *cnV[469]; -const double f0 = 1.0 / m_A0; - const double f0_29 = -f0 * m_A70; - m_A73 += m_A1 * f0_29; - RHS29 += f0_29 * RHS0; -const double f1 = 1.0 / m_A2; - const double f1_29 = -f1 * m_A71; - m_A73 += m_A3 * f1_29; - RHS29 += f1_29 * RHS1; -const double f2 = 1.0 / m_A4; - const double f2_29 = -f2 * m_A72; - m_A73 += m_A5 * f2_29; - m_A74 += m_A6 * f2_29; - RHS29 += f2_29 * RHS2; - const double f2_33 = -f2 * m_A92; - m_A93 += m_A5 * f2_33; - m_A94 += m_A6 * f2_33; - RHS33 += f2_33 * RHS2; -const double f3 = 1.0 / m_A7; - const double f3_34 = -f3 * m_A96; - m_A97 += m_A8 * f3_34; - m_A99 += m_A9 * f3_34; - RHS34 += f3_34 * RHS3; - const double f3_44 = -f3 * m_A155; - m_A156 += m_A8 * f3_44; - m_A160 += m_A9 * f3_44; - RHS44 += f3_44 * RHS3; -const double f4 = 1.0 / m_A10; - const double f4_41 = -f4 * m_A133; - m_A141 += m_A11 * f4_41; - RHS41 += f4_41 * RHS4; -const double f5 = 1.0 / m_A12; - const double f5_41 = -f5 * m_A134; - m_A141 += m_A13 * f5_41; - RHS41 += f5_41 * RHS5; -const double f6 = 1.0 / m_A14; - const double f6_41 = -f6 * m_A135; - m_A141 += m_A15 * f6_41; - RHS41 += f6_41 * RHS6; -const double f7 = 1.0 / m_A16; - const double f7_41 = -f7 * m_A136; - m_A141 += m_A17 * f7_41; - RHS41 += f7_41 * RHS7; -const double f8 = 1.0 / m_A18; - const double f8_30 = -f8 * m_A75; - m_A82 += m_A19 * f8_30; - m_A83 += m_A20 * f8_30; - RHS30 += f8_30 * RHS8; - const double f8_41 = -f8 * m_A137; - m_A139 += m_A19 * f8_41; - m_A141 += m_A20 * f8_41; - RHS41 += f8_41 * RHS8; -const double f9 = 1.0 / m_A21; - const double f9_30 = -f9 * m_A76; - m_A82 += m_A22 * f9_30; - RHS30 += f9_30 * RHS9; -const double f10 = 1.0 / m_A23; - const double f10_30 = -f10 * m_A77; - m_A82 += m_A24 * f10_30; - RHS30 += f10_30 * RHS10; -const double f11 = 1.0 / m_A25; - const double f11_41 = -f11 * m_A138; - m_A141 += m_A26 * f11_41; - m_A142 += m_A27 * f11_41; - RHS41 += f11_41 * RHS11; - const double f11_43 = -f11 * m_A149; - m_A152 += m_A26 * f11_43; - m_A153 += m_A27 * f11_43; - RHS43 += f11_43 * RHS11; -const double f12 = 1.0 / m_A28; - const double f12_43 = -f12 * m_A150; - m_A153 += m_A29 * f12_43; - RHS43 += f12_43 * RHS12; -const double f13 = 1.0 / m_A30; - const double f13_30 = -f13 * m_A78; - m_A82 += m_A31 * f13_30; - RHS30 += f13_30 * RHS13; -const double f14 = 1.0 / m_A32; - const double f14_36 = -f14 * m_A106; - m_A108 += m_A33 * f14_36; - RHS36 += f14_36 * RHS14; -const double f15 = 1.0 / m_A34; - const double f15_31 = -f15 * m_A84; - m_A86 += m_A35 * f15_31; - RHS31 += f15_31 * RHS15; -const double f16 = 1.0 / m_A36; - const double f16_30 = -f16 * m_A79; - m_A82 += m_A37 * f16_30; - RHS30 += f16_30 * RHS16; -const double f17 = 1.0 / m_A38; - const double f17_30 = -f17 * m_A80; - m_A82 += m_A39 * f17_30; - RHS30 += f17_30 * RHS17; -const double f18 = 1.0 / m_A40; - const double f18_30 = -f18 * m_A81; - m_A82 += m_A41 * f18_30; - RHS30 += f18_30 * RHS18; -const double f19 = 1.0 / m_A42; - const double f19_35 = -f19 * m_A100; - m_A103 += m_A43 * f19_35; - RHS35 += f19_35 * RHS19; -const double f20 = 1.0 / m_A44; - const double f20_31 = -f20 * m_A85; - m_A86 += m_A45 * f20_31; - m_A87 += m_A46 * f20_31; - RHS31 += f20_31 * RHS20; - const double f20_35 = -f20 * m_A101; - m_A102 += m_A45 * f20_35; - m_A103 += m_A46 * f20_35; - RHS35 += f20_35 * RHS20; -const double f21 = 1.0 / m_A47; - const double f21_45 = -f21 * m_A162; - m_A164 += m_A48 * f21_45; - m_A165 += m_A49 * f21_45; - RHS45 += f21_45 * RHS21; - const double f21_46 = -f21 * m_A166; - m_A173 += m_A48 * f21_46; - m_A174 += m_A49 * f21_46; - RHS46 += f21_46 * RHS21; -const double f22 = 1.0 / m_A50; - const double f22_32 = -f22 * m_A88; - m_A90 += m_A51 * f22_32; - RHS32 += f22_32 * RHS22; -const double f23 = 1.0 / m_A52; - const double f23_37 = -f23 * m_A110; - m_A112 += m_A53 * f23_37; - m_A114 += m_A54 * f23_37; - RHS37 += f23_37 * RHS23; - const double f23_46 = -f23 * m_A167; - m_A169 += m_A53 * f23_46; - m_A174 += m_A54 * f23_46; - RHS46 += f23_46 * RHS23; -const double f24 = 1.0 / m_A55; - const double f24_32 = -f24 * m_A89; - m_A90 += m_A56 * f24_32; - m_A91 += m_A57 * f24_32; - RHS32 += f24_32 * RHS24; - const double f24_38 = -f24 * m_A115; - m_A117 += m_A56 * f24_38; - m_A118 += m_A57 * f24_38; - RHS38 += f24_38 * RHS24; -const double f25 = 1.0 / m_A58; - const double f25_36 = -f25 * m_A107; - m_A108 += m_A59 * f25_36; - m_A109 += m_A60 * f25_36; - RHS36 += f25_36 * RHS25; - const double f25_39 = -f25 * m_A120; - m_A121 += m_A59 * f25_39; - m_A122 += m_A60 * f25_39; - RHS39 += f25_39 * RHS25; -const double f26 = 1.0 / m_A61; - const double f26_37 = -f26 * m_A111; - m_A112 += m_A62 * f26_37; - m_A113 += m_A63 * f26_37; - RHS37 += f26_37 * RHS26; - const double f26_40 = -f26 * m_A125; - m_A128 += m_A62 * f26_40; - m_A130 += m_A63 * f26_40; - RHS40 += f26_40 * RHS26; -const double f27 = 1.0 / m_A64; - const double f27_38 = -f27 * m_A116; - m_A118 += m_A65 * f27_38; - m_A119 += m_A66 * f27_38; - RHS38 += f27_38 * RHS27; - const double f27_40 = -f27 * m_A126; - m_A129 += m_A65 * f27_40; - m_A130 += m_A66 * f27_40; - RHS40 += f27_40 * RHS27; -const double f28 = 1.0 / m_A67; - const double f28_40 = -f28 * m_A127; - m_A130 += m_A68 * f28_40; - m_A131 += m_A69 * f28_40; - RHS40 += f28_40 * RHS28; - const double f28_42 = -f28 * m_A143; - m_A145 += m_A68 * f28_42; - m_A146 += m_A69 * f28_42; - RHS42 += f28_42 * RHS28; -const double f29 = 1.0 / m_A73; - const double f29_33 = -f29 * m_A93; - m_A94 += m_A74 * f29_33; - RHS33 += f29_33 * RHS29; -const double f30 = 1.0 / m_A82; - const double f30_41 = -f30 * m_A139; - m_A141 += m_A83 * f30_41; - RHS41 += f30_41 * RHS30; -const double f31 = 1.0 / m_A86; - const double f31_35 = -f31 * m_A102; - m_A103 += m_A87 * f31_35; - RHS35 += f31_35 * RHS31; -const double f32 = 1.0 / m_A90; - const double f32_38 = -f32 * m_A117; - m_A118 += m_A91 * f32_38; - RHS38 += f32_38 * RHS32; -const double f33 = 1.0 / m_A94; - const double f33_41 = -f33 * m_A140; - m_A141 += m_A95 * f33_41; - RHS41 += f33_41 * RHS33; -const double f34 = 1.0 / m_A97; - const double f34_43 = -f34 * m_A151; - m_A153 += m_A98 * f34_43; - m_A154 += m_A99 * f34_43; - RHS43 += f34_43 * RHS34; - const double f34_44 = -f34 * m_A156; - m_A159 += m_A98 * f34_44; - m_A160 += m_A99 * f34_44; - RHS44 += f34_44 * RHS34; -const double f35 = 1.0 / m_A103; - const double f35_45 = -f35 * m_A163; - m_A164 += m_A104 * f35_45; - m_A165 += m_A105 * f35_45; - RHS45 += f35_45 * RHS35; - const double f35_46 = -f35 * m_A168; - m_A173 += m_A104 * f35_46; - m_A174 += m_A105 * f35_46; - RHS46 += f35_46 * RHS35; -const double f36 = 1.0 / m_A108; - const double f36_39 = -f36 * m_A121; - m_A122 += m_A109 * f36_39; - RHS39 += f36_39 * RHS36; -const double f37 = 1.0 / m_A112; - const double f37_40 = -f37 * m_A128; - m_A130 += m_A113 * f37_40; - m_A132 += m_A114 * f37_40; - RHS40 += f37_40 * RHS37; - const double f37_46 = -f37 * m_A169; - m_A170 += m_A113 * f37_46; - m_A174 += m_A114 * f37_46; - RHS46 += f37_46 * RHS37; -const double f38 = 1.0 / m_A118; - const double f38_40 = -f38 * m_A129; - m_A130 += m_A119 * f38_40; - RHS40 += f38_40 * RHS38; -const double f39 = 1.0 / m_A122; - const double f39_42 = -f39 * m_A144; - m_A146 += m_A123 * f39_42; - m_A147 += m_A124 * f39_42; - RHS42 += f39_42 * RHS39; - const double f39_44 = -f39 * m_A157; - m_A158 += m_A123 * f39_44; - m_A160 += m_A124 * f39_44; - RHS44 += f39_44 * RHS39; -const double f40 = 1.0 / m_A130; - const double f40_42 = -f40 * m_A145; - m_A146 += m_A131 * f40_42; - m_A148 += m_A132 * f40_42; - RHS42 += f40_42 * RHS40; - const double f40_46 = -f40 * m_A170; - m_A171 += m_A131 * f40_46; - m_A174 += m_A132 * f40_46; - RHS46 += f40_46 * RHS40; -const double f41 = 1.0 / m_A141; - const double f41_43 = -f41 * m_A152; - m_A153 += m_A142 * f41_43; - RHS43 += f41_43 * RHS41; -const double f42 = 1.0 / m_A146; - const double f42_44 = -f42 * m_A158; - m_A160 += m_A147 * f42_44; - m_A161 += m_A148 * f42_44; - RHS44 += f42_44 * RHS42; - const double f42_46 = -f42 * m_A171; - m_A172 += m_A147 * f42_46; - m_A174 += m_A148 * f42_46; - RHS46 += f42_46 * RHS42; -const double f43 = 1.0 / m_A153; - const double f43_44 = -f43 * m_A159; - m_A160 += m_A154 * f43_44; - RHS44 += f43_44 * RHS43; -const double f44 = 1.0 / m_A160; - const double f44_46 = -f44 * m_A172; - m_A174 += m_A161 * f44_46; - RHS46 += f44_46 * RHS44; -const double f45 = 1.0 / m_A164; - const double f45_46 = -f45 * m_A173; - m_A174 += m_A165 * f45_46; - RHS46 += f45_46 * RHS45; - V[46] = RHS46 / m_A174; - double tmp45 = 0.0; - tmp45 += m_A165 * V[46]; - V[45] = (RHS45 - tmp45) / m_A164; - double tmp44 = 0.0; - tmp44 += m_A161 * V[46]; - V[44] = (RHS44 - tmp44) / m_A160; - double tmp43 = 0.0; - tmp43 += m_A154 * V[44]; - V[43] = (RHS43 - tmp43) / m_A153; - double tmp42 = 0.0; - tmp42 += m_A147 * V[44]; - tmp42 += m_A148 * V[46]; - V[42] = (RHS42 - tmp42) / m_A146; - double tmp41 = 0.0; - tmp41 += m_A142 * V[43]; - V[41] = (RHS41 - tmp41) / m_A141; - double tmp40 = 0.0; - tmp40 += m_A131 * V[42]; - tmp40 += m_A132 * V[46]; - V[40] = (RHS40 - tmp40) / m_A130; - double tmp39 = 0.0; - tmp39 += m_A123 * V[42]; - tmp39 += m_A124 * V[44]; - V[39] = (RHS39 - tmp39) / m_A122; - double tmp38 = 0.0; - tmp38 += m_A119 * V[40]; - V[38] = (RHS38 - tmp38) / m_A118; - double tmp37 = 0.0; - tmp37 += m_A113 * V[40]; - tmp37 += m_A114 * V[46]; - V[37] = (RHS37 - tmp37) / m_A112; - double tmp36 = 0.0; - tmp36 += m_A109 * V[39]; - V[36] = (RHS36 - tmp36) / m_A108; - double tmp35 = 0.0; - tmp35 += m_A104 * V[45]; - tmp35 += m_A105 * V[46]; - V[35] = (RHS35 - tmp35) / m_A103; - double tmp34 = 0.0; - tmp34 += m_A98 * V[43]; - tmp34 += m_A99 * V[44]; - V[34] = (RHS34 - tmp34) / m_A97; - double tmp33 = 0.0; - tmp33 += m_A95 * V[41]; - V[33] = (RHS33 - tmp33) / m_A94; - double tmp32 = 0.0; - tmp32 += m_A91 * V[38]; - V[32] = (RHS32 - tmp32) / m_A90; - double tmp31 = 0.0; - tmp31 += m_A87 * V[35]; - V[31] = (RHS31 - tmp31) / m_A86; - double tmp30 = 0.0; - tmp30 += m_A83 * V[41]; - V[30] = (RHS30 - tmp30) / m_A82; - double tmp29 = 0.0; - tmp29 += m_A74 * V[33]; - V[29] = (RHS29 - tmp29) / m_A73; - double tmp28 = 0.0; - tmp28 += m_A68 * V[40]; - tmp28 += m_A69 * V[42]; - V[28] = (RHS28 - tmp28) / m_A67; - double tmp27 = 0.0; - tmp27 += m_A65 * V[38]; - tmp27 += m_A66 * V[40]; - V[27] = (RHS27 - tmp27) / m_A64; - double tmp26 = 0.0; - tmp26 += m_A62 * V[37]; - tmp26 += m_A63 * V[40]; - V[26] = (RHS26 - tmp26) / m_A61; - double tmp25 = 0.0; - tmp25 += m_A59 * V[36]; - tmp25 += m_A60 * V[39]; - V[25] = (RHS25 - tmp25) / m_A58; - double tmp24 = 0.0; - tmp24 += m_A56 * V[32]; - tmp24 += m_A57 * V[38]; - V[24] = (RHS24 - tmp24) / m_A55; - double tmp23 = 0.0; - tmp23 += m_A53 * V[37]; - tmp23 += m_A54 * V[46]; - V[23] = (RHS23 - tmp23) / m_A52; - double tmp22 = 0.0; - tmp22 += m_A51 * V[32]; - V[22] = (RHS22 - tmp22) / m_A50; - double tmp21 = 0.0; - tmp21 += m_A48 * V[45]; - tmp21 += m_A49 * V[46]; - V[21] = (RHS21 - tmp21) / m_A47; - double tmp20 = 0.0; - tmp20 += m_A45 * V[31]; - tmp20 += m_A46 * V[35]; - V[20] = (RHS20 - tmp20) / m_A44; - double tmp19 = 0.0; - tmp19 += m_A43 * V[35]; - V[19] = (RHS19 - tmp19) / m_A42; - double tmp18 = 0.0; - tmp18 += m_A41 * V[30]; - V[18] = (RHS18 - tmp18) / m_A40; - double tmp17 = 0.0; - tmp17 += m_A39 * V[30]; - V[17] = (RHS17 - tmp17) / m_A38; - double tmp16 = 0.0; - tmp16 += m_A37 * V[30]; - V[16] = (RHS16 - tmp16) / m_A36; - double tmp15 = 0.0; - tmp15 += m_A35 * V[31]; - V[15] = (RHS15 - tmp15) / m_A34; - double tmp14 = 0.0; - tmp14 += m_A33 * V[36]; - V[14] = (RHS14 - tmp14) / m_A32; - double tmp13 = 0.0; - tmp13 += m_A31 * V[30]; - V[13] = (RHS13 - tmp13) / m_A30; - double tmp12 = 0.0; - tmp12 += m_A29 * V[43]; - V[12] = (RHS12 - tmp12) / m_A28; - double tmp11 = 0.0; - tmp11 += m_A26 * V[41]; - tmp11 += m_A27 * V[43]; - V[11] = (RHS11 - tmp11) / m_A25; - double tmp10 = 0.0; - tmp10 += m_A24 * V[30]; - V[10] = (RHS10 - tmp10) / m_A23; - double tmp9 = 0.0; - tmp9 += m_A22 * V[30]; - V[9] = (RHS9 - tmp9) / m_A21; - double tmp8 = 0.0; - tmp8 += m_A19 * V[30]; - tmp8 += m_A20 * V[41]; - V[8] = (RHS8 - tmp8) / m_A18; - double tmp7 = 0.0; - tmp7 += m_A17 * V[41]; - V[7] = (RHS7 - tmp7) / m_A16; - double tmp6 = 0.0; - tmp6 += m_A15 * V[41]; - V[6] = (RHS6 - tmp6) / m_A14; - double tmp5 = 0.0; - tmp5 += m_A13 * V[41]; - V[5] = (RHS5 - tmp5) / m_A12; - double tmp4 = 0.0; - tmp4 += m_A11 * V[41]; - V[4] = (RHS4 - tmp4) / m_A10; - double tmp3 = 0.0; - tmp3 += m_A8 * V[34]; - tmp3 += m_A9 * V[44]; - V[3] = (RHS3 - tmp3) / m_A7; - double tmp2 = 0.0; - tmp2 += m_A5 * V[29]; - tmp2 += m_A6 * V[33]; - V[2] = (RHS2 - tmp2) / m_A4; - double tmp1 = 0.0; - tmp1 += m_A3 * V[29]; - V[1] = (RHS1 - tmp1) / m_A2; - double tmp0 = 0.0; - tmp0 += m_A1 * V[29]; - V[0] = (RHS0 - tmp0) / m_A0; -} - +// kidniki static void nl_gcr_933b3efec18faab_37_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -7779,6 +6852,7 @@ const double f7 = 1.0 / m_A28; V[0] = (RHS0 - tmp0) / m_A0; } +// 1942 static void nl_gcr_a1b753ac9c408940_90_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -8245,6 +7319,7 @@ const double f14 = 1.0 / m_A85; V[0] = (RHS0 - tmp0) / m_A0; } +// zac1b11142 static void nl_gcr_a26cb0ca00cdeba6_12_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -8305,6 +7380,7 @@ const double f2 = 1.0 / m_A7; V[0] = (RHS0 - tmp0) / m_A0; } +// kidniki static void nl_gcr_a2b9e1d13f95c2d3_34_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -8467,6 +7543,7 @@ const double f7 = 1.0 / m_A27; V[0] = (RHS0 - tmp0) / m_A0; } +// breakout static void nl_gcr_a5e9537117c3969a_31_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -8615,6 +7692,154 @@ const double f7 = 1.0 / m_A23; V[0] = (RHS0 - tmp0) / m_A0; } +// zac1b11142 +static void nl_gcr_a88b481713b08b7b_30_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) + +{ + +double m_A0(0.0); +double m_A1(0.0); +double m_A2(0.0); +double m_A3(0.0); +double m_A4(0.0); +double m_A5(0.0); +double m_A6(0.0); +double m_A7(0.0); +double m_A8(0.0); +double m_A9(0.0); +double m_A10(0.0); +double m_A11(0.0); +double m_A12(0.0); +double m_A13(0.0); +double m_A14(0.0); +double m_A15(0.0); +double m_A16(0.0); +double m_A17(0.0); +double m_A18(0.0); +double m_A19(0.0); +double m_A20(0.0); +double m_A21(0.0); +double m_A22(0.0); +double m_A23(0.0); +double m_A24(0.0); +double m_A25(0.0); +double m_A26(0.0); +double m_A27(0.0); +double m_A28(0.0); +double m_A29(0.0); + m_A0 = gt[0] + gt[1] + gt[2] + gt[3] + gt[4] + gt[5] + gt[6]; + m_A1 = m_A1 + go[0]; + double RHS0 = Idr[0] + Idr[1] + Idr[2] + Idr[3] + Idr[4] + Idr[5] + Idr[6] - go[1] * *cnV[1] - go[2] * *cnV[2] - go[3] * *cnV[3] - go[4] * *cnV[4] - go[5] * *cnV[5] - go[6] * *cnV[6]; + m_A2 = gt[8] + gt[9] + gt[10]; + m_A3 = m_A3 + go[8]; + double RHS1 = Idr[8] + Idr[9] + Idr[10] - go[9] * *cnV[9] - go[10] * *cnV[10]; + m_A4 = gt[16] + gt[17]; + m_A5 = m_A5 + go[16]; + double RHS2 = Idr[16] + Idr[17] - go[17] * *cnV[17]; + m_A6 = gt[24] + gt[25] + gt[26]; + m_A7 = m_A7 + go[24]; + double RHS3 = Idr[24] + Idr[25] + Idr[26] - go[25] * *cnV[25] - go[26] * *cnV[26]; + m_A8 = gt[32] + gt[33] + gt[34]; + m_A9 = m_A9 + go[32]; + double RHS4 = Idr[32] + Idr[33] + Idr[34] - go[33] * *cnV[33] - go[34] * *cnV[34]; + m_A11 = gt[40] + gt[41] + gt[42] + gt[43] + gt[44] + gt[45]; + m_A10 = m_A10 + go[40]; + m_A12 = m_A12 + go[41]; + m_A12 = m_A12 + go[42]; + double RHS5 = Idr[40] + Idr[41] + Idr[42] + Idr[43] + Idr[44] + Idr[45] - go[43] * *cnV[43] - go[44] * *cnV[44] - go[45] * *cnV[45]; + m_A16 = gt[48] + gt[49]; + m_A15 = m_A15 + go[48]; + m_A14 = m_A14 + go[49]; + double RHS6 = Idr[48] + Idr[49]; + m_A18 = gt[56] + gt[57]; + m_A19 = m_A19 + go[56]; + m_A17 = m_A17 + go[57]; + double RHS7 = Idr[56] + Idr[57]; + m_A25 = gt[64] + gt[65] + gt[66] + gt[67] + gt[68] + gt[69]; + m_A23 = m_A23 + go[64]; + m_A22 = m_A22 + go[65]; + m_A22 = m_A22 + go[66]; + m_A24 = m_A24 + go[67]; + m_A21 = m_A21 + go[68]; + m_A20 = m_A20 + go[69]; + double RHS8 = Idr[64] + Idr[65] + Idr[66] + Idr[67] + Idr[68] + Idr[69]; + m_A29 = gt[72] + gt[73] + gt[74] + gt[75]; + m_A28 = m_A28 + go[72]; + m_A27 = m_A27 + go[73]; + double RHS9 = Idr[72] + Idr[73] + Idr[74] + Idr[75] - go[74] * *cnV[74] - go[75] * *cnV[75]; +const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A10; + m_A13 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; +const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A17; + m_A18 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; +const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A14; + m_A16 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_8 = -f2 * m_A20; + m_A23 += m_A5 * f2_8; + RHS8 += f2_8 * RHS2; +const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A15; + m_A16 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; +const double f4 = 1.0 / m_A8; + const double f4_8 = -f4 * m_A21; + m_A25 += m_A9 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_9 = -f4 * m_A27; + m_A28 += m_A9 * f4_9; + RHS9 += f4_9 * RHS4; +const double f5 = 1.0 / m_A11; + const double f5_8 = -f5 * m_A22; + m_A25 += m_A12 * f5_8; + m_A26 += m_A13 * f5_8; + RHS8 += f5_8 * RHS5; +const double f6 = 1.0 / m_A16; + const double f6_8 = -f6 * m_A23; + RHS8 += f6_8 * RHS6; +const double f7 = 1.0 / m_A18; + const double f7_8 = -f7 * m_A24; + m_A25 += m_A19 * f7_8; + RHS8 += f7_8 * RHS7; +const double f8 = 1.0 / m_A25; + const double f8_9 = -f8 * m_A28; + m_A29 += m_A26 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A29; + double tmp8 = 0.0; + tmp8 += m_A26 * V[9]; + V[8] = (RHS8 - tmp8) / m_A25; + double tmp7 = 0.0; + tmp7 += m_A19 * V[8]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A12 * V[8]; + tmp5 += m_A13 * V[9]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[8]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki static void nl_gcr_b42f307001315373_21_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -8717,6 +7942,7 @@ const double f4 = 1.0 / m_A14; V[0] = (RHS0 - tmp0) / m_A0; } +// pongf static void nl_gcr_b8e1f7dd43c1da70_35_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -8889,6 +8115,7 @@ const double f7 = 1.0 / m_A28; V[0] = (RHS0 - tmp0) / m_A0; } +// gtrak10 static void nl_gcr_b9ccfa3d1681baf3_43_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -9097,152 +8324,7 @@ const double f13 = 1.0 / m_A30; V[0] = (RHS0 - tmp0) / m_A0; } -static void nl_gcr_ce10642feea9ba8d_28_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) - -{ - -double m_A0(0.0); -double m_A1(0.0); -double m_A2(0.0); -double m_A3(0.0); -double m_A4(0.0); -double m_A5(0.0); -double m_A6(0.0); -double m_A7(0.0); -double m_A8(0.0); -double m_A9(0.0); -double m_A10(0.0); -double m_A11(0.0); -double m_A12(0.0); -double m_A13(0.0); -double m_A14(0.0); -double m_A15(0.0); -double m_A16(0.0); -double m_A17(0.0); -double m_A18(0.0); -double m_A19(0.0); -double m_A20(0.0); -double m_A21(0.0); -double m_A22(0.0); -double m_A23(0.0); -double m_A24(0.0); -double m_A25(0.0); -double m_A26(0.0); -double m_A27(0.0); - m_A0 = gt[0] + gt[1] + gt[2] + gt[3]; - m_A1 = m_A1 + go[0]; - m_A2 = m_A2 + go[1]; - double RHS0 = Idr[0] + Idr[1] + Idr[2] + Idr[3] - go[2] * *cnV[2] - go[3] * *cnV[3]; - m_A3 = gt[12] + gt[13] + gt[14]; - m_A4 = m_A4 + go[12]; - double RHS1 = Idr[12] + Idr[13] + Idr[14] - go[13] * *cnV[13] - go[14] * *cnV[14]; - m_A5 = gt[24] + gt[25] + gt[26] + gt[27] + gt[28]; - m_A7 = m_A7 + go[24]; - m_A7 = m_A7 + go[25]; - m_A6 = m_A6 + go[26]; - double RHS2 = Idr[24] + Idr[25] + Idr[26] + Idr[27] + Idr[28] - go[27] * *cnV[27] - go[28] * *cnV[28]; - m_A9 = gt[36] + gt[37] + gt[38]; - m_A8 = m_A8 + go[36]; - double RHS3 = Idr[36] + Idr[37] + Idr[38] - go[37] * *cnV[37] - go[38] * *cnV[38]; - m_A13 = gt[48] + gt[49] + gt[50] + gt[51] + gt[52] + gt[53] + gt[54]; - m_A14 = m_A14 + go[48]; - m_A11 = m_A11 + go[49]; - m_A13 = m_A13 + go[50]; - m_A13 = m_A13 + go[51]; - double RHS4 = Idr[48] + Idr[49] + Idr[50] + Idr[51] + Idr[52] + Idr[53] + Idr[54] - go[52] * *cnV[52] - go[53] * *cnV[53] - go[54] * *cnV[54]; - m_A16 = gt[60] + gt[61] + gt[62] + gt[63] + gt[64] + gt[65] + gt[66]; - m_A17 = m_A17 + go[60]; - m_A17 = m_A17 + go[61]; - m_A18 = m_A18 + go[62]; - m_A15 = m_A15 + go[63]; - double RHS5 = Idr[60] + Idr[61] + Idr[62] + Idr[63] + Idr[64] + Idr[65] + Idr[66] - go[64] * *cnV[64] - go[65] * *cnV[65] - go[66] * *cnV[66]; - m_A21 = gt[72] + gt[73] + gt[74] + gt[75] + gt[76] + gt[77] + gt[78] + gt[79] + gt[80] + gt[81] + gt[82]; - m_A22 = m_A22 + go[72]; - m_A22 = m_A22 + go[73]; - m_A22 = m_A22 + go[74]; - m_A20 = m_A20 + go[75]; - m_A20 = m_A20 + go[76]; - m_A19 = m_A19 + go[77]; - m_A19 = m_A19 + go[78]; - double RHS6 = Idr[72] + Idr[73] + Idr[74] + Idr[75] + Idr[76] + Idr[77] + Idr[78] + Idr[79] + Idr[80] + Idr[81] + Idr[82] - go[79] * *cnV[79] - go[80] * *cnV[80] - go[81] * *cnV[81] - go[82] * *cnV[82]; - m_A27 = gt[84] + gt[85] + gt[86] + gt[87] + gt[88] + gt[89] + gt[90] + gt[91]; - m_A26 = m_A26 + go[84]; - m_A26 = m_A26 + go[85]; - m_A26 = m_A26 + go[86]; - m_A23 = m_A23 + go[87]; - m_A25 = m_A25 + go[88]; - m_A24 = m_A24 + go[89]; - double RHS7 = Idr[84] + Idr[85] + Idr[86] + Idr[87] + Idr[88] + Idr[89] + Idr[90] + Idr[91] - go[90] * *cnV[90] - go[91] * *cnV[91]; -const double f0 = 1.0 / m_A0; - const double f0_3 = -f0 * m_A8; - m_A9 += m_A1 * f0_3; - m_A10 += m_A2 * f0_3; - RHS3 += f0_3 * RHS0; - const double f0_4 = -f0 * m_A11; - m_A12 += m_A1 * f0_4; - m_A13 += m_A2 * f0_4; - RHS4 += f0_4 * RHS0; -const double f1 = 1.0 / m_A3; - const double f1_7 = -f1 * m_A23; - m_A27 += m_A4 * f1_7; - RHS7 += f1_7 * RHS1; -const double f2 = 1.0 / m_A5; - const double f2_5 = -f2 * m_A15; - m_A16 += m_A6 * f2_5; - m_A17 += m_A7 * f2_5; - RHS5 += f2_5 * RHS2; - const double f2_6 = -f2 * m_A19; - m_A20 += m_A6 * f2_6; - m_A21 += m_A7 * f2_6; - RHS6 += f2_6 * RHS2; -const double f3 = 1.0 / m_A9; - const double f3_4 = -f3 * m_A12; - m_A13 += m_A10 * f3_4; - RHS4 += f3_4 * RHS3; -const double f4 = 1.0 / m_A13; - const double f4_7 = -f4 * m_A24; - m_A27 += m_A14 * f4_7; - RHS7 += f4_7 * RHS4; -const double f5 = 1.0 / m_A16; - const double f5_6 = -f5 * m_A20; - m_A21 += m_A17 * f5_6; - m_A22 += m_A18 * f5_6; - RHS6 += f5_6 * RHS5; - const double f5_7 = -f5 * m_A25; - m_A26 += m_A17 * f5_7; - m_A27 += m_A18 * f5_7; - RHS7 += f5_7 * RHS5; -const double f6 = 1.0 / m_A21; - const double f6_7 = -f6 * m_A26; - m_A27 += m_A22 * f6_7; - RHS7 += f6_7 * RHS6; - V[7] = RHS7 / m_A27; - double tmp6 = 0.0; - tmp6 += m_A22 * V[7]; - V[6] = (RHS6 - tmp6) / m_A21; - double tmp5 = 0.0; - tmp5 += m_A17 * V[6]; - tmp5 += m_A18 * V[7]; - V[5] = (RHS5 - tmp5) / m_A16; - double tmp4 = 0.0; - tmp4 += m_A14 * V[7]; - V[4] = (RHS4 - tmp4) / m_A13; - double tmp3 = 0.0; - tmp3 += m_A10 * V[4]; - V[3] = (RHS3 - tmp3) / m_A9; - double tmp2 = 0.0; - tmp2 += m_A6 * V[5]; - tmp2 += m_A7 * V[6]; - V[2] = (RHS2 - tmp2) / m_A5; - double tmp1 = 0.0; - tmp1 += m_A4 * V[7]; - V[1] = (RHS1 - tmp1) / m_A3; - double tmp0 = 0.0; - tmp0 += m_A1 * V[3]; - tmp0 += m_A2 * V[4]; - V[0] = (RHS0 - tmp0) / m_A0; -} - +// gamemachine static void nl_gcr_d028b2a263a6b4a7_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -9285,6 +8367,838 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// zac1b11142 +static void nl_gcr_dded752996a524fc_178_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) + +{ + +double m_A0(0.0); +double m_A1(0.0); +double m_A2(0.0); +double m_A3(0.0); +double m_A4(0.0); +double m_A5(0.0); +double m_A6(0.0); +double m_A7(0.0); +double m_A8(0.0); +double m_A9(0.0); +double m_A10(0.0); +double m_A11(0.0); +double m_A12(0.0); +double m_A13(0.0); +double m_A14(0.0); +double m_A15(0.0); +double m_A16(0.0); +double m_A17(0.0); +double m_A18(0.0); +double m_A19(0.0); +double m_A20(0.0); +double m_A21(0.0); +double m_A22(0.0); +double m_A23(0.0); +double m_A24(0.0); +double m_A25(0.0); +double m_A26(0.0); +double m_A27(0.0); +double m_A28(0.0); +double m_A29(0.0); +double m_A30(0.0); +double m_A31(0.0); +double m_A32(0.0); +double m_A33(0.0); +double m_A34(0.0); +double m_A35(0.0); +double m_A36(0.0); +double m_A37(0.0); +double m_A38(0.0); +double m_A39(0.0); +double m_A40(0.0); +double m_A41(0.0); +double m_A42(0.0); +double m_A43(0.0); +double m_A44(0.0); +double m_A45(0.0); +double m_A46(0.0); +double m_A47(0.0); +double m_A48(0.0); +double m_A49(0.0); +double m_A50(0.0); +double m_A51(0.0); +double m_A52(0.0); +double m_A53(0.0); +double m_A54(0.0); +double m_A55(0.0); +double m_A56(0.0); +double m_A57(0.0); +double m_A58(0.0); +double m_A59(0.0); +double m_A60(0.0); +double m_A61(0.0); +double m_A62(0.0); +double m_A63(0.0); +double m_A64(0.0); +double m_A65(0.0); +double m_A66(0.0); +double m_A67(0.0); +double m_A68(0.0); +double m_A69(0.0); +double m_A70(0.0); +double m_A71(0.0); +double m_A72(0.0); +double m_A73(0.0); +double m_A74(0.0); +double m_A75(0.0); +double m_A76(0.0); +double m_A77(0.0); +double m_A78(0.0); +double m_A79(0.0); +double m_A80(0.0); +double m_A81(0.0); +double m_A82(0.0); +double m_A83(0.0); +double m_A84(0.0); +double m_A85(0.0); +double m_A86(0.0); +double m_A87(0.0); +double m_A88(0.0); +double m_A89(0.0); +double m_A90(0.0); +double m_A91(0.0); +double m_A92(0.0); +double m_A93(0.0); +double m_A94(0.0); +double m_A95(0.0); +double m_A96(0.0); +double m_A97(0.0); +double m_A98(0.0); +double m_A99(0.0); +double m_A100(0.0); +double m_A101(0.0); +double m_A102(0.0); +double m_A103(0.0); +double m_A104(0.0); +double m_A105(0.0); +double m_A106(0.0); +double m_A107(0.0); +double m_A108(0.0); +double m_A109(0.0); +double m_A110(0.0); +double m_A111(0.0); +double m_A112(0.0); +double m_A113(0.0); +double m_A114(0.0); +double m_A115(0.0); +double m_A116(0.0); +double m_A117(0.0); +double m_A118(0.0); +double m_A119(0.0); +double m_A120(0.0); +double m_A121(0.0); +double m_A122(0.0); +double m_A123(0.0); +double m_A124(0.0); +double m_A125(0.0); +double m_A126(0.0); +double m_A127(0.0); +double m_A128(0.0); +double m_A129(0.0); +double m_A130(0.0); +double m_A131(0.0); +double m_A132(0.0); +double m_A133(0.0); +double m_A134(0.0); +double m_A135(0.0); +double m_A136(0.0); +double m_A137(0.0); +double m_A138(0.0); +double m_A139(0.0); +double m_A140(0.0); +double m_A141(0.0); +double m_A142(0.0); +double m_A143(0.0); +double m_A144(0.0); +double m_A145(0.0); +double m_A146(0.0); +double m_A147(0.0); +double m_A148(0.0); +double m_A149(0.0); +double m_A150(0.0); +double m_A151(0.0); +double m_A152(0.0); +double m_A153(0.0); +double m_A154(0.0); +double m_A155(0.0); +double m_A156(0.0); +double m_A157(0.0); +double m_A158(0.0); +double m_A159(0.0); +double m_A160(0.0); +double m_A161(0.0); +double m_A162(0.0); +double m_A163(0.0); +double m_A164(0.0); +double m_A165(0.0); +double m_A166(0.0); +double m_A167(0.0); +double m_A168(0.0); +double m_A169(0.0); +double m_A170(0.0); +double m_A171(0.0); +double m_A172(0.0); +double m_A173(0.0); +double m_A174(0.0); +double m_A175(0.0); +double m_A176(0.0); +double m_A177(0.0); + m_A0 = gt[0] + gt[1] + gt[2]; + m_A1 = m_A1 + go[0]; + double RHS0 = Idr[0] + Idr[1] + Idr[2] - go[1] * *cnV[1] - go[2] * *cnV[2]; + m_A2 = gt[10] + gt[11]; + m_A3 = m_A3 + go[10]; + double RHS1 = Idr[10] + Idr[11] - go[11] * *cnV[11]; + m_A4 = gt[20] + gt[21]; + m_A6 = m_A6 + go[20]; + m_A5 = m_A5 + go[21]; + double RHS2 = Idr[20] + Idr[21]; + m_A7 = gt[30] + gt[31]; + m_A8 = m_A8 + go[30]; + double RHS3 = Idr[30] + Idr[31] - go[31] * *cnV[31]; + m_A9 = gt[40] + gt[41] + gt[42] + gt[43] + gt[44] + gt[45] + gt[46]; + m_A10 = m_A10 + go[40]; + double RHS4 = Idr[40] + Idr[41] + Idr[42] + Idr[43] + Idr[44] + Idr[45] + Idr[46] - go[41] * *cnV[41] - go[42] * *cnV[42] - go[43] * *cnV[43] - go[44] * *cnV[44] - go[45] * *cnV[45] - go[46] * *cnV[46]; + m_A11 = gt[50] + gt[51]; + m_A12 = m_A12 + go[50]; + double RHS5 = Idr[50] + Idr[51] - go[51] * *cnV[51]; + m_A13 = gt[60] + gt[61]; + m_A14 = m_A14 + go[60]; + double RHS6 = Idr[60] + Idr[61] - go[61] * *cnV[61]; + m_A15 = gt[70] + gt[71]; + m_A16 = m_A16 + go[70]; + double RHS7 = Idr[70] + Idr[71] - go[71] * *cnV[71]; + m_A17 = gt[80] + gt[81]; + m_A18 = m_A18 + go[80]; + double RHS8 = Idr[80] + Idr[81] - go[81] * *cnV[81]; + m_A19 = gt[90] + gt[91]; + m_A20 = m_A20 + go[90]; + m_A21 = m_A21 + go[91]; + double RHS9 = Idr[90] + Idr[91]; + m_A22 = gt[100] + gt[101] + gt[102] + gt[103]; + m_A23 = m_A23 + go[100]; + m_A23 = m_A23 + go[101]; + double RHS10 = Idr[100] + Idr[101] + Idr[102] + Idr[103] - go[102] * *cnV[102] - go[103] * *cnV[103]; + m_A24 = gt[110] + gt[111] + gt[112] + gt[113]; + m_A25 = m_A25 + go[110]; + m_A25 = m_A25 + go[111]; + double RHS11 = Idr[110] + Idr[111] + Idr[112] + Idr[113] - go[112] * *cnV[112] - go[113] * *cnV[113]; + m_A26 = gt[120] + gt[121] + gt[122] + gt[123]; + m_A27 = m_A27 + go[120]; + m_A27 = m_A27 + go[121]; + double RHS12 = Idr[120] + Idr[121] + Idr[122] + Idr[123] - go[122] * *cnV[122] - go[123] * *cnV[123]; + m_A28 = gt[130] + gt[131]; + m_A29 = m_A29 + go[130]; + double RHS13 = Idr[130] + Idr[131] - go[131] * *cnV[131]; + m_A30 = gt[140] + gt[141] + gt[142]; + m_A31 = m_A31 + go[140]; + double RHS14 = Idr[140] + Idr[141] + Idr[142] - go[141] * *cnV[141] - go[142] * *cnV[142]; + m_A32 = gt[150] + gt[151] + gt[152]; + m_A33 = m_A33 + go[150]; + double RHS15 = Idr[150] + Idr[151] + Idr[152] - go[151] * *cnV[151] - go[152] * *cnV[152]; + m_A34 = gt[160] + gt[161] + gt[162]; + m_A35 = m_A35 + go[160]; + double RHS16 = Idr[160] + Idr[161] + Idr[162] - go[161] * *cnV[161] - go[162] * *cnV[162]; + m_A36 = gt[170] + gt[171]; + m_A37 = m_A37 + go[170]; + double RHS17 = Idr[170] + Idr[171] - go[171] * *cnV[171]; + m_A38 = gt[180] + gt[181] + gt[182] + gt[183]; + m_A39 = m_A39 + go[180]; + double RHS18 = Idr[180] + Idr[181] + Idr[182] + Idr[183] - go[181] * *cnV[181] - go[182] * *cnV[182] - go[183] * *cnV[183]; + m_A40 = gt[190] + gt[191] + gt[192] + gt[193] + gt[194]; + m_A41 = m_A41 + go[190]; + double RHS19 = Idr[190] + Idr[191] + Idr[192] + Idr[193] + Idr[194] - go[191] * *cnV[191] - go[192] * *cnV[192] - go[193] * *cnV[193] - go[194] * *cnV[194]; + m_A42 = gt[200] + gt[201] + gt[202] + gt[203] + gt[204] + gt[205] + gt[206]; + m_A43 = m_A43 + go[200]; + double RHS20 = Idr[200] + Idr[201] + Idr[202] + Idr[203] + Idr[204] + Idr[205] + Idr[206] - go[201] * *cnV[201] - go[202] * *cnV[202] - go[203] * *cnV[203] - go[204] * *cnV[204] - go[205] * *cnV[205] - go[206] * *cnV[206]; + m_A44 = gt[210] + gt[211] + gt[212]; + m_A45 = m_A45 + go[210]; + double RHS21 = Idr[210] + Idr[211] + Idr[212] - go[211] * *cnV[211] - go[212] * *cnV[212]; + m_A46 = gt[220] + gt[221]; + m_A48 = m_A48 + go[220]; + m_A47 = m_A47 + go[221]; + double RHS22 = Idr[220] + Idr[221]; + m_A49 = gt[230] + gt[231] + gt[232]; + m_A51 = m_A51 + go[230]; + m_A50 = m_A50 + go[231]; + double RHS23 = Idr[230] + Idr[231] + Idr[232] - go[232] * *cnV[232]; + m_A52 = gt[240] + gt[241] + gt[242]; + m_A53 = m_A53 + go[240]; + double RHS24 = Idr[240] + Idr[241] + Idr[242] - go[241] * *cnV[241] - go[242] * *cnV[242]; + m_A54 = gt[250] + gt[251] + gt[252] + gt[253]; + m_A55 = m_A55 + go[250]; + m_A55 = m_A55 + go[251]; + m_A56 = m_A56 + go[252]; + double RHS25 = Idr[250] + Idr[251] + Idr[252] + Idr[253] - go[253] * *cnV[253]; + m_A60 = gt[260] + gt[261] + gt[262]; + m_A59 = m_A59 + go[260]; + m_A58 = m_A58 + go[261]; + m_A57 = m_A57 + go[262]; + double RHS26 = Idr[260] + Idr[261] + Idr[262]; + m_A62 = gt[270] + gt[271]; + m_A63 = m_A63 + go[270]; + m_A64 = m_A64 + go[271]; + double RHS27 = Idr[270] + Idr[271]; + m_A65 = gt[280] + gt[281] + gt[282]; + m_A66 = m_A66 + go[280]; + double RHS28 = Idr[280] + Idr[281] + Idr[282] - go[281] * *cnV[281] - go[282] * *cnV[282]; + m_A67 = gt[290] + gt[291] + gt[292]; + m_A69 = m_A69 + go[290]; + m_A68 = m_A68 + go[291]; + double RHS29 = Idr[290] + Idr[291] + Idr[292] - go[292] * *cnV[292]; + m_A70 = gt[300] + gt[301]; + m_A72 = m_A72 + go[300]; + m_A71 = m_A71 + go[301]; + double RHS30 = Idr[300] + Idr[301]; + m_A74 = gt[310] + gt[311]; + m_A73 = m_A73 + go[310]; + double RHS31 = Idr[310] + Idr[311] - go[311] * *cnV[311]; + m_A82 = gt[320] + gt[321] + gt[322] + gt[323] + gt[324] + gt[325] + gt[326] + gt[327] + gt[328] + gt[329]; + m_A81 = m_A81 + go[320]; + m_A80 = m_A80 + go[321]; + m_A79 = m_A79 + go[322]; + m_A78 = m_A78 + go[323]; + m_A78 = m_A78 + go[324]; + m_A77 = m_A77 + go[325]; + m_A77 = m_A77 + go[326]; + m_A76 = m_A76 + go[327]; + m_A76 = m_A76 + go[328]; + m_A75 = m_A75 + go[329]; + double RHS32 = Idr[320] + Idr[321] + Idr[322] + Idr[323] + Idr[324] + Idr[325] + Idr[326] + Idr[327] + Idr[328] + Idr[329]; + m_A86 = gt[330] + gt[331] + gt[332] + gt[333] + gt[334] + gt[335] + gt[336]; + m_A85 = m_A85 + go[330]; + m_A84 = m_A84 + go[331]; + double RHS33 = Idr[330] + Idr[331] + Idr[332] + Idr[333] + Idr[334] + Idr[335] + Idr[336] - go[332] * *cnV[332] - go[333] * *cnV[333] - go[334] * *cnV[334] - go[335] * *cnV[335] - go[336] * *cnV[336]; + m_A90 = gt[340] + gt[341]; + m_A91 = m_A91 + go[340]; + m_A88 = m_A88 + go[341]; + double RHS34 = Idr[340] + Idr[341]; + m_A94 = gt[350] + gt[351] + gt[352] + gt[353] + gt[354]; + m_A92 = m_A92 + go[350]; + m_A93 = m_A93 + go[351]; + m_A93 = m_A93 + go[352]; + double RHS35 = Idr[350] + Idr[351] + Idr[352] + Idr[353] + Idr[354] - go[353] * *cnV[353] - go[354] * *cnV[354]; + m_A97 = gt[360] + gt[361]; + m_A98 = m_A98 + go[360]; + m_A96 = m_A96 + go[361]; + double RHS36 = Idr[360] + Idr[361]; + m_A100 = gt[370] + gt[371]; + m_A99 = m_A99 + go[370]; + m_A102 = m_A102 + go[371]; + double RHS37 = Idr[370] + Idr[371]; + m_A105 = gt[380] + gt[381]; + m_A107 = m_A107 + go[380]; + m_A103 = m_A103 + go[381]; + double RHS38 = Idr[380] + Idr[381]; + m_A111 = gt[390] + gt[391] + gt[392]; + m_A109 = m_A109 + go[390]; + m_A108 = m_A108 + go[391]; + double RHS39 = Idr[390] + Idr[391] + Idr[392] - go[392] * *cnV[392]; + m_A116 = gt[400] + gt[401] + gt[402]; + m_A114 = m_A114 + go[400]; + m_A113 = m_A113 + go[401]; + m_A118 = m_A118 + go[402]; + double RHS40 = Idr[400] + Idr[401] + Idr[402]; + m_A120 = gt[410] + gt[411] + gt[412] + gt[413]; + m_A121 = m_A121 + go[410]; + m_A119 = m_A119 + go[411]; + double RHS41 = Idr[410] + Idr[411] + Idr[412] + Idr[413] - go[412] * *cnV[412] - go[413] * *cnV[413]; + m_A124 = gt[420] + gt[421]; + m_A123 = m_A123 + go[420]; + m_A122 = m_A122 + go[421]; + double RHS42 = Idr[420] + Idr[421]; + m_A131 = gt[430] + gt[431] + gt[432] + gt[433] + gt[434] + gt[435]; + m_A132 = m_A132 + go[430]; + m_A132 = m_A132 + go[431]; + m_A129 = m_A129 + go[432]; + m_A128 = m_A128 + go[433]; + m_A127 = m_A127 + go[434]; + m_A126 = m_A126 + go[435]; + double RHS43 = Idr[430] + Idr[431] + Idr[432] + Idr[433] + Idr[434] + Idr[435]; + m_A141 = gt[440] + gt[441] + gt[442] + gt[443] + gt[444] + gt[445] + gt[446]; + m_A136 = m_A136 + go[440]; + m_A135 = m_A135 + go[441]; + m_A134 = m_A134 + go[442]; + m_A133 = m_A133 + go[443]; + m_A140 = m_A140 + go[444]; + m_A137 = m_A137 + go[445]; + m_A139 = m_A139 + go[446]; + double RHS44 = Idr[440] + Idr[441] + Idr[442] + Idr[443] + Idr[444] + Idr[445] + Idr[446]; + m_A143 = gt[450] + gt[451] + gt[452] + gt[453]; + m_A144 = m_A144 + go[450]; + m_A142 = m_A142 + go[451]; + double RHS45 = Idr[450] + Idr[451] + Idr[452] + Idr[453] - go[452] * *cnV[452] - go[453] * *cnV[453]; + m_A147 = gt[460] + gt[461]; + m_A145 = m_A145 + go[460]; + m_A148 = m_A148 + go[461]; + double RHS46 = Idr[460] + Idr[461]; + m_A155 = gt[470] + gt[471] + gt[472] + gt[473] + gt[474] + gt[475]; + m_A150 = m_A150 + go[470]; + m_A151 = m_A151 + go[471]; + m_A154 = m_A154 + go[472]; + m_A154 = m_A154 + go[473]; + double RHS47 = Idr[470] + Idr[471] + Idr[472] + Idr[473] + Idr[474] + Idr[475] - go[474] * *cnV[474] - go[475] * *cnV[475]; + m_A162 = gt[480] + gt[481] + gt[482] + gt[483] + gt[484]; + m_A163 = m_A163 + go[480]; + m_A159 = m_A159 + go[481]; + m_A160 = m_A160 + go[482]; + m_A158 = m_A158 + go[483]; + m_A157 = m_A157 + go[484]; + double RHS48 = Idr[480] + Idr[481] + Idr[482] + Idr[483] + Idr[484]; + m_A169 = gt[490] + gt[491] + gt[492] + gt[493]; + m_A167 = m_A167 + go[490]; + m_A164 = m_A164 + go[491]; + m_A165 = m_A165 + go[492]; + double RHS49 = Idr[490] + Idr[491] + Idr[492] + Idr[493] - go[493] * *cnV[493]; + m_A177 = gt[500] + gt[501] + gt[502] + gt[503] + gt[504]; + m_A171 = m_A171 + go[500]; + m_A172 = m_A172 + go[501]; + m_A175 = m_A175 + go[502]; + double RHS50 = Idr[500] + Idr[501] + Idr[502] + Idr[503] + Idr[504] - go[503] * *cnV[503] - go[504] * *cnV[504]; +const double f0 = 1.0 / m_A0; + const double f0_26 = -f0 * m_A57; + m_A60 += m_A1 * f0_26; + RHS26 += f0_26 * RHS0; +const double f1 = 1.0 / m_A2; + const double f1_26 = -f1 * m_A58; + m_A60 += m_A3 * f1_26; + RHS26 += f1_26 * RHS1; +const double f2 = 1.0 / m_A4; + const double f2_26 = -f2 * m_A59; + m_A60 += m_A5 * f2_26; + m_A61 += m_A6 * f2_26; + RHS26 += f2_26 * RHS2; + const double f2_34 = -f2 * m_A88; + m_A89 += m_A5 * f2_34; + m_A90 += m_A6 * f2_34; + RHS34 += f2_34 * RHS2; +const double f3 = 1.0 / m_A7; + const double f3_36 = -f3 * m_A96; + m_A97 += m_A8 * f3_36; + RHS36 += f3_36 * RHS3; + const double f3_48 = -f3 * m_A157; + m_A160 += m_A8 * f3_48; + RHS48 += f3_48 * RHS3; +const double f4 = 1.0 / m_A9; + const double f4_50 = -f4 * m_A171; + m_A173 += m_A10 * f4_50; + RHS50 += f4_50 * RHS4; +const double f5 = 1.0 / m_A11; + const double f5_44 = -f5 * m_A133; + m_A141 += m_A12 * f5_44; + RHS44 += f5_44 * RHS5; +const double f6 = 1.0 / m_A13; + const double f6_44 = -f6 * m_A134; + m_A141 += m_A14 * f6_44; + RHS44 += f6_44 * RHS6; +const double f7 = 1.0 / m_A15; + const double f7_44 = -f7 * m_A135; + m_A141 += m_A16 * f7_44; + RHS44 += f7_44 * RHS7; +const double f8 = 1.0 / m_A17; + const double f8_44 = -f8 * m_A136; + m_A141 += m_A18 * f8_44; + RHS44 += f8_44 * RHS8; +const double f9 = 1.0 / m_A19; + const double f9_32 = -f9 * m_A75; + m_A82 += m_A20 * f9_32; + m_A83 += m_A21 * f9_32; + RHS32 += f9_32 * RHS9; + const double f9_44 = -f9 * m_A137; + m_A138 += m_A20 * f9_44; + m_A141 += m_A21 * f9_44; + RHS44 += f9_44 * RHS9; +const double f10 = 1.0 / m_A22; + const double f10_32 = -f10 * m_A76; + m_A82 += m_A23 * f10_32; + RHS32 += f10_32 * RHS10; +const double f11 = 1.0 / m_A24; + const double f11_32 = -f11 * m_A77; + m_A82 += m_A25 * f11_32; + RHS32 += f11_32 * RHS11; +const double f12 = 1.0 / m_A26; + const double f12_32 = -f12 * m_A78; + m_A82 += m_A27 * f12_32; + RHS32 += f12_32 * RHS12; +const double f13 = 1.0 / m_A28; + const double f13_31 = -f13 * m_A73; + m_A74 += m_A29 * f13_31; + RHS31 += f13_31 * RHS13; + const double f13_43 = -f13 * m_A126; + m_A129 += m_A29 * f13_43; + RHS43 += f13_43 * RHS13; +const double f14 = 1.0 / m_A30; + const double f14_32 = -f14 * m_A79; + m_A82 += m_A31 * f14_32; + RHS32 += f14_32 * RHS14; +const double f15 = 1.0 / m_A32; + const double f15_35 = -f15 * m_A92; + m_A94 += m_A33 * f15_35; + RHS35 += f15_35 * RHS15; +const double f16 = 1.0 / m_A34; + const double f16_32 = -f16 * m_A80; + m_A82 += m_A35 * f16_32; + RHS32 += f16_32 * RHS16; +const double f17 = 1.0 / m_A36; + const double f17_32 = -f17 * m_A81; + m_A82 += m_A37 * f17_32; + RHS32 += f17_32 * RHS17; +const double f18 = 1.0 / m_A38; + const double f18_42 = -f18 * m_A122; + m_A124 += m_A39 * f18_42; + RHS42 += f18_42 * RHS18; +const double f19 = 1.0 / m_A40; + const double f19_33 = -f19 * m_A84; + m_A86 += m_A41 * f19_33; + RHS33 += f19_33 * RHS19; +const double f20 = 1.0 / m_A42; + const double f20_47 = -f20 * m_A150; + m_A153 += m_A43 * f20_47; + RHS47 += f20_47 * RHS20; +const double f21 = 1.0 / m_A44; + const double f21_45 = -f21 * m_A142; + m_A144 += m_A45 * f21_45; + RHS45 += f21_45 * RHS21; + const double f21_48 = -f21 * m_A158; + m_A162 += m_A45 * f21_48; + RHS48 += f21_48 * RHS21; +const double f22 = 1.0 / m_A46; + const double f22_33 = -f22 * m_A85; + m_A86 += m_A47 * f22_33; + m_A87 += m_A48 * f22_33; + RHS33 += f22_33 * RHS22; + const double f22_39 = -f22 * m_A108; + m_A110 += m_A47 * f22_39; + m_A111 += m_A48 * f22_39; + RHS39 += f22_39 * RHS22; +const double f23 = 1.0 / m_A49; + const double f23_37 = -f23 * m_A99; + m_A100 += m_A50 * f23_37; + m_A101 += m_A51 * f23_37; + RHS37 += f23_37 * RHS23; + const double f23_38 = -f23 * m_A103; + m_A104 += m_A50 * f23_38; + m_A105 += m_A51 * f23_38; + RHS38 += f23_38 * RHS23; +const double f24 = 1.0 / m_A52; + const double f24_48 = -f24 * m_A159; + m_A162 += m_A53 * f24_48; + RHS48 += f24_48 * RHS24; +const double f25 = 1.0 / m_A54; + const double f25_35 = -f25 * m_A93; + m_A94 += m_A55 * f25_35; + m_A95 += m_A56 * f25_35; + RHS35 += f25_35 * RHS25; + const double f25_40 = -f25 * m_A113; + m_A115 += m_A55 * f25_40; + m_A116 += m_A56 * f25_40; + RHS40 += f25_40 * RHS25; +const double f26 = 1.0 / m_A60; + const double f26_34 = -f26 * m_A89; + m_A90 += m_A61 * f26_34; + RHS34 += f26_34 * RHS26; +const double f27 = 1.0 / m_A62; + const double f27_39 = -f27 * m_A109; + m_A111 += m_A63 * f27_39; + m_A112 += m_A64 * f27_39; + RHS39 += f27_39 * RHS27; + const double f27_49 = -f27 * m_A164; + m_A166 += m_A63 * f27_49; + m_A169 += m_A64 * f27_49; + RHS49 += f27_49 * RHS27; +const double f28 = 1.0 / m_A65; + const double f28_41 = -f28 * m_A119; + m_A121 += m_A66 * f28_41; + RHS41 += f28_41 * RHS28; + const double f28_43 = -f28 * m_A127; + m_A131 += m_A66 * f28_43; + RHS43 += f28_43 * RHS28; +const double f29 = 1.0 / m_A67; + const double f29_40 = -f29 * m_A114; + m_A116 += m_A68 * f29_40; + m_A117 += m_A69 * f29_40; + RHS40 += f29_40 * RHS29; + const double f29_46 = -f29 * m_A145; + m_A146 += m_A68 * f29_46; + m_A147 += m_A69 * f29_46; + RHS46 += f29_46 * RHS29; +const double f30 = 1.0 / m_A70; + const double f30_42 = -f30 * m_A123; + m_A124 += m_A71 * f30_42; + m_A125 += m_A72 * f30_42; + RHS42 += f30_42 * RHS30; + const double f30_43 = -f30 * m_A128; + m_A130 += m_A71 * f30_43; + m_A131 += m_A72 * f30_43; + RHS43 += f30_43 * RHS30; +const double f31 = 1.0 / m_A74; + const double f31_43 = -f31 * m_A129; + RHS43 += f31_43 * RHS31; +const double f32 = 1.0 / m_A82; + const double f32_44 = -f32 * m_A138; + m_A141 += m_A83 * f32_44; + RHS44 += f32_44 * RHS32; +const double f33 = 1.0 / m_A86; + const double f33_39 = -f33 * m_A110; + m_A111 += m_A87 * f33_39; + RHS39 += f33_39 * RHS33; +const double f34 = 1.0 / m_A90; + const double f34_44 = -f34 * m_A139; + m_A141 += m_A91 * f34_44; + RHS44 += f34_44 * RHS34; +const double f35 = 1.0 / m_A94; + const double f35_40 = -f35 * m_A115; + m_A116 += m_A95 * f35_40; + RHS40 += f35_40 * RHS35; +const double f36 = 1.0 / m_A97; + const double f36_44 = -f36 * m_A140; + m_A141 += m_A98 * f36_44; + RHS44 += f36_44 * RHS36; + const double f36_48 = -f36 * m_A160; + m_A161 += m_A98 * f36_48; + RHS48 += f36_48 * RHS36; +const double f37 = 1.0 / m_A100; + const double f37_38 = -f37 * m_A104; + m_A105 += m_A101 * f37_38; + m_A106 += m_A102 * f37_38; + RHS38 += f37_38 * RHS37; + const double f37_47 = -f37 * m_A151; + m_A152 += m_A101 * f37_47; + m_A155 += m_A102 * f37_47; + RHS47 += f37_47 * RHS37; +const double f38 = 1.0 / m_A105; + const double f38_47 = -f38 * m_A152; + m_A155 += m_A106 * f38_47; + m_A156 += m_A107 * f38_47; + RHS47 += f38_47 * RHS38; + const double f38_49 = -f38 * m_A165; + m_A168 += m_A106 * f38_49; + m_A169 += m_A107 * f38_49; + RHS49 += f38_49 * RHS38; +const double f39 = 1.0 / m_A111; + const double f39_49 = -f39 * m_A166; + m_A169 += m_A112 * f39_49; + RHS49 += f39_49 * RHS39; +const double f40 = 1.0 / m_A116; + const double f40_46 = -f40 * m_A146; + m_A147 += m_A117 * f40_46; + m_A149 += m_A118 * f40_46; + RHS46 += f40_46 * RHS40; + const double f40_50 = -f40 * m_A172; + m_A174 += m_A117 * f40_50; + m_A177 += m_A118 * f40_50; + RHS50 += f40_50 * RHS40; +const double f41 = 1.0 / m_A120; + const double f41_47 = -f41 * m_A153; + m_A154 += m_A121 * f41_47; + RHS47 += f41_47 * RHS41; +const double f42 = 1.0 / m_A124; + const double f42_43 = -f42 * m_A130; + m_A131 += m_A125 * f42_43; + RHS43 += f42_43 * RHS42; +const double f43 = 1.0 / m_A131; + const double f43_47 = -f43 * m_A154; + m_A155 += m_A132 * f43_47; + RHS47 += f43_47 * RHS43; +const double f44 = 1.0 / m_A141; + const double f44_48 = -f44 * m_A161; + RHS48 += f44_48 * RHS44; +const double f45 = 1.0 / m_A143; + const double f45_50 = -f45 * m_A173; + m_A175 += m_A144 * f45_50; + RHS50 += f45_50 * RHS45; +const double f46 = 1.0 / m_A147; + const double f46_49 = -f46 * m_A167; + m_A169 += m_A148 * f46_49; + m_A170 += m_A149 * f46_49; + RHS49 += f46_49 * RHS46; + const double f46_50 = -f46 * m_A174; + m_A176 += m_A148 * f46_50; + m_A177 += m_A149 * f46_50; + RHS50 += f46_50 * RHS46; +const double f47 = 1.0 / m_A155; + const double f47_49 = -f47 * m_A168; + m_A169 += m_A156 * f47_49; + RHS49 += f47_49 * RHS47; +const double f48 = 1.0 / m_A162; + const double f48_50 = -f48 * m_A175; + m_A177 += m_A163 * f48_50; + RHS50 += f48_50 * RHS48; +const double f49 = 1.0 / m_A169; + const double f49_50 = -f49 * m_A176; + m_A177 += m_A170 * f49_50; + RHS50 += f49_50 * RHS49; + V[50] = RHS50 / m_A177; + double tmp49 = 0.0; + tmp49 += m_A170 * V[50]; + V[49] = (RHS49 - tmp49) / m_A169; + double tmp48 = 0.0; + tmp48 += m_A163 * V[50]; + V[48] = (RHS48 - tmp48) / m_A162; + double tmp47 = 0.0; + tmp47 += m_A156 * V[49]; + V[47] = (RHS47 - tmp47) / m_A155; + double tmp46 = 0.0; + tmp46 += m_A148 * V[49]; + tmp46 += m_A149 * V[50]; + V[46] = (RHS46 - tmp46) / m_A147; + double tmp45 = 0.0; + tmp45 += m_A144 * V[48]; + V[45] = (RHS45 - tmp45) / m_A143; + double tmp44 = 0.0; + V[44] = (RHS44 - tmp44) / m_A141; + double tmp43 = 0.0; + tmp43 += m_A132 * V[47]; + V[43] = (RHS43 - tmp43) / m_A131; + double tmp42 = 0.0; + tmp42 += m_A125 * V[43]; + V[42] = (RHS42 - tmp42) / m_A124; + double tmp41 = 0.0; + tmp41 += m_A121 * V[43]; + V[41] = (RHS41 - tmp41) / m_A120; + double tmp40 = 0.0; + tmp40 += m_A117 * V[46]; + tmp40 += m_A118 * V[50]; + V[40] = (RHS40 - tmp40) / m_A116; + double tmp39 = 0.0; + tmp39 += m_A112 * V[49]; + V[39] = (RHS39 - tmp39) / m_A111; + double tmp38 = 0.0; + tmp38 += m_A106 * V[47]; + tmp38 += m_A107 * V[49]; + V[38] = (RHS38 - tmp38) / m_A105; + double tmp37 = 0.0; + tmp37 += m_A101 * V[38]; + tmp37 += m_A102 * V[47]; + V[37] = (RHS37 - tmp37) / m_A100; + double tmp36 = 0.0; + tmp36 += m_A98 * V[44]; + V[36] = (RHS36 - tmp36) / m_A97; + double tmp35 = 0.0; + tmp35 += m_A95 * V[40]; + V[35] = (RHS35 - tmp35) / m_A94; + double tmp34 = 0.0; + tmp34 += m_A91 * V[44]; + V[34] = (RHS34 - tmp34) / m_A90; + double tmp33 = 0.0; + tmp33 += m_A87 * V[39]; + V[33] = (RHS33 - tmp33) / m_A86; + double tmp32 = 0.0; + tmp32 += m_A83 * V[44]; + V[32] = (RHS32 - tmp32) / m_A82; + double tmp31 = 0.0; + V[31] = (RHS31 - tmp31) / m_A74; + double tmp30 = 0.0; + tmp30 += m_A71 * V[42]; + tmp30 += m_A72 * V[43]; + V[30] = (RHS30 - tmp30) / m_A70; + double tmp29 = 0.0; + tmp29 += m_A68 * V[40]; + tmp29 += m_A69 * V[46]; + V[29] = (RHS29 - tmp29) / m_A67; + double tmp28 = 0.0; + tmp28 += m_A66 * V[43]; + V[28] = (RHS28 - tmp28) / m_A65; + double tmp27 = 0.0; + tmp27 += m_A63 * V[39]; + tmp27 += m_A64 * V[49]; + V[27] = (RHS27 - tmp27) / m_A62; + double tmp26 = 0.0; + tmp26 += m_A61 * V[34]; + V[26] = (RHS26 - tmp26) / m_A60; + double tmp25 = 0.0; + tmp25 += m_A55 * V[35]; + tmp25 += m_A56 * V[40]; + V[25] = (RHS25 - tmp25) / m_A54; + double tmp24 = 0.0; + tmp24 += m_A53 * V[48]; + V[24] = (RHS24 - tmp24) / m_A52; + double tmp23 = 0.0; + tmp23 += m_A50 * V[37]; + tmp23 += m_A51 * V[38]; + V[23] = (RHS23 - tmp23) / m_A49; + double tmp22 = 0.0; + tmp22 += m_A47 * V[33]; + tmp22 += m_A48 * V[39]; + V[22] = (RHS22 - tmp22) / m_A46; + double tmp21 = 0.0; + tmp21 += m_A45 * V[48]; + V[21] = (RHS21 - tmp21) / m_A44; + double tmp20 = 0.0; + tmp20 += m_A43 * V[41]; + V[20] = (RHS20 - tmp20) / m_A42; + double tmp19 = 0.0; + tmp19 += m_A41 * V[33]; + V[19] = (RHS19 - tmp19) / m_A40; + double tmp18 = 0.0; + tmp18 += m_A39 * V[42]; + V[18] = (RHS18 - tmp18) / m_A38; + double tmp17 = 0.0; + tmp17 += m_A37 * V[32]; + V[17] = (RHS17 - tmp17) / m_A36; + double tmp16 = 0.0; + tmp16 += m_A35 * V[32]; + V[16] = (RHS16 - tmp16) / m_A34; + double tmp15 = 0.0; + tmp15 += m_A33 * V[35]; + V[15] = (RHS15 - tmp15) / m_A32; + double tmp14 = 0.0; + tmp14 += m_A31 * V[32]; + V[14] = (RHS14 - tmp14) / m_A30; + double tmp13 = 0.0; + tmp13 += m_A29 * V[31]; + V[13] = (RHS13 - tmp13) / m_A28; + double tmp12 = 0.0; + tmp12 += m_A27 * V[32]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A25 * V[32]; + V[11] = (RHS11 - tmp11) / m_A24; + double tmp10 = 0.0; + tmp10 += m_A23 * V[32]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + tmp9 += m_A20 * V[32]; + tmp9 += m_A21 * V[44]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[44]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[44]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[44]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A12 * V[44]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[45]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[36]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[26]; + tmp2 += m_A6 * V[34]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[26]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[26]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// cheekyms static void nl_gcr_e67e623b6c100b4e_12_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -9347,6 +9261,7 @@ const double f2 = 1.0 / m_A6; V[0] = (RHS0 - tmp0) / m_A0; } +// kidniki static void nl_gcr_e7e5566e352b80c1_67_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -9685,6 +9600,7 @@ const double f11 = 1.0 / m_A57; V[0] = (RHS0 - tmp0) / m_A0; } +// gamemachine static void nl_gcr_ec17a9dbc8cd78fd_10_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -9737,6 +9653,7 @@ const double f2 = 1.0 / m_A4; V[0] = (RHS0 - tmp0) / m_A0; } +// breakout static void nl_gcr_fbbf6eebb7621abc_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -9775,6 +9692,7 @@ const double f1 = 1.0 / m_A2; V[0] = (RHS0 - tmp0) / m_A0; } +// cheekyms static void nl_gcr_feb42362d28845e7_7_double_double(double * __restrict V, double * __restrict go, double * __restrict gt, double * __restrict Idr, double ** __restrict cnV) { @@ -9816,57 +9734,109 @@ const double f1 = 1.0 / m_A2; } plib::dynlib_static_sym nl_static_solver_syms[] = { +// gamemachine {"nl_gcr_111d6ad4781c136_19_double_double", reinterpret_cast(&nl_gcr_111d6ad4781c136_19_double_double)}, +// cheekyms {"nl_gcr_11995a0d28843023_150_double_double", reinterpret_cast(&nl_gcr_11995a0d28843023_150_double_double)}, +// mario {"nl_gcr_15fa1a3cf923c9fd_29_double_double", reinterpret_cast(&nl_gcr_15fa1a3cf923c9fd_29_double_double)}, +// kidniki {"nl_gcr_169c14d438ffb621_198_double_double", reinterpret_cast(&nl_gcr_169c14d438ffb621_198_double_double)}, - {"nl_gcr_18deaad4b2fab70d_26_double_double", reinterpret_cast(&nl_gcr_18deaad4b2fab70d_26_double_double)}, +// cheekyms {"nl_gcr_19f6e9708f37ad65_7_double_double", reinterpret_cast(&nl_gcr_19f6e9708f37ad65_7_double_double)}, - {"nl_gcr_1e27a9bddeac729d_64_double_double", reinterpret_cast(&nl_gcr_1e27a9bddeac729d_64_double_double)}, +// zac1b11142 + {"nl_gcr_1dd100c8f34cf889_96_double_double", reinterpret_cast(&nl_gcr_1dd100c8f34cf889_96_double_double)}, +// rebound {"nl_gcr_1faccd91c85d3ab3_28_double_double", reinterpret_cast(&nl_gcr_1faccd91c85d3ab3_28_double_double)}, +// breakout {"nl_gcr_1fffb23aa506432d_13_double_double", reinterpret_cast(&nl_gcr_1fffb23aa506432d_13_double_double)}, +// pongf {"nl_gcr_20615d28f46254cb_10_double_double", reinterpret_cast(&nl_gcr_20615d28f46254cb_10_double_double)}, +// zac1b11142 + {"nl_gcr_21d92b630d2e9a99_30_double_double", reinterpret_cast(&nl_gcr_21d92b630d2e9a99_30_double_double)}, +// dpatrol {"nl_gcr_27a78682a9b70f8c_10_double_double", reinterpret_cast(&nl_gcr_27a78682a9b70f8c_10_double_double)}, +// mario + {"nl_gcr_2eb3d95f720484d_62_double_double", reinterpret_cast(&nl_gcr_2eb3d95f720484d_62_double_double)}, +// segas16b_audio {"nl_gcr_35947d349693c22_111_double_double", reinterpret_cast(&nl_gcr_35947d349693c22_111_double_double)}, +// cocoloco {"nl_gcr_3641ac25e244c362_16_double_double", reinterpret_cast(&nl_gcr_3641ac25e244c362_16_double_double)}, +// zac1b11142 {"nl_gcr_38a3ac18f52bf78a_7_double_double", reinterpret_cast(&nl_gcr_38a3ac18f52bf78a_7_double_double)}, +// dpatrol {"nl_gcr_38f1806722626d7e_7_double_double", reinterpret_cast(&nl_gcr_38f1806722626d7e_7_double_double)}, +// kidniki {"nl_gcr_3e4821cabc0aeb96_24_double_double", reinterpret_cast(&nl_gcr_3e4821cabc0aeb96_24_double_double)}, - {"nl_gcr_4966c35de59b7e6a_99_double_double", reinterpret_cast(&nl_gcr_4966c35de59b7e6a_99_double_double)}, +// dpatrol {"nl_gcr_57a832104e53c9a8_20_double_double", reinterpret_cast(&nl_gcr_57a832104e53c9a8_20_double_double)}, +// rebound {"nl_gcr_5985dfb549280eeb_13_double_double", reinterpret_cast(&nl_gcr_5985dfb549280eeb_13_double_double)}, +// tp1985 {"nl_gcr_5ca1779d1825c4c9_26_double_double", reinterpret_cast(&nl_gcr_5ca1779d1825c4c9_26_double_double)}, +// tp1985 {"nl_gcr_6148fa421800febb_10_double_double", reinterpret_cast(&nl_gcr_6148fa421800febb_10_double_double)}, - {"nl_gcr_63b745ec069c7245_82_double_double", reinterpret_cast(&nl_gcr_63b745ec069c7245_82_double_double)}, +// tp1985 {"nl_gcr_6480c7a1d69e9131_7_double_double", reinterpret_cast(&nl_gcr_6480c7a1d69e9131_7_double_double)}, +// stuntcyc {"nl_gcr_6c599fc01f5b084c_20_double_double", reinterpret_cast(&nl_gcr_6c599fc01f5b084c_20_double_double)}, +// breakout {"nl_gcr_6d40bbc695987ef5_13_double_double", reinterpret_cast(&nl_gcr_6d40bbc695987ef5_13_double_double)}, +// pongf {"nl_gcr_70e1061a9deb37a4_7_double_double", reinterpret_cast(&nl_gcr_70e1061a9deb37a4_7_double_double)}, +// breakout {"nl_gcr_7421995adbfda1ad_10_double_double", reinterpret_cast(&nl_gcr_7421995adbfda1ad_10_double_double)}, +// zac1b11142 + {"nl_gcr_7572db25f250cf5a_71_double_double", reinterpret_cast(&nl_gcr_7572db25f250cf5a_71_double_double)}, +// popeye {"nl_gcr_794f14a13bda75f0_50_double_double", reinterpret_cast(&nl_gcr_794f14a13bda75f0_50_double_double)}, +// breakout {"nl_gcr_7a4e8b4f388d66d7_7_double_double", reinterpret_cast(&nl_gcr_7a4e8b4f388d66d7_7_double_double)}, +// kidniki {"nl_gcr_7b1592d23e41ce56_37_double_double", reinterpret_cast(&nl_gcr_7b1592d23e41ce56_37_double_double)}, +// rebound {"nl_gcr_7c58698d6a68f4a0_7_double_double", reinterpret_cast(&nl_gcr_7c58698d6a68f4a0_7_double_double)}, +// gunfight {"nl_gcr_7dbbdf7feecfa9bd_108_double_double", reinterpret_cast(&nl_gcr_7dbbdf7feecfa9bd_108_double_double)}, +// konami1x {"nl_gcr_7f2f6447ea71d31e_49_double_double", reinterpret_cast(&nl_gcr_7f2f6447ea71d31e_49_double_double)}, +// dpatrol {"nl_gcr_81bfac76b696d9f3_22_double_double", reinterpret_cast(&nl_gcr_81bfac76b696d9f3_22_double_double)}, +// breakout {"nl_gcr_876240e48d904d1f_7_double_double", reinterpret_cast(&nl_gcr_876240e48d904d1f_7_double_double)}, +// konami2x {"nl_gcr_8e55e5f9e065890e_85_double_double", reinterpret_cast(&nl_gcr_8e55e5f9e065890e_85_double_double)}, - {"nl_gcr_92523d559b657838_175_double_double", reinterpret_cast(&nl_gcr_92523d559b657838_175_double_double)}, +// kidniki {"nl_gcr_933b3efec18faab_37_double_double", reinterpret_cast(&nl_gcr_933b3efec18faab_37_double_double)}, +// 1942 {"nl_gcr_a1b753ac9c408940_90_double_double", reinterpret_cast(&nl_gcr_a1b753ac9c408940_90_double_double)}, +// zac1b11142 {"nl_gcr_a26cb0ca00cdeba6_12_double_double", reinterpret_cast(&nl_gcr_a26cb0ca00cdeba6_12_double_double)}, +// kidniki {"nl_gcr_a2b9e1d13f95c2d3_34_double_double", reinterpret_cast(&nl_gcr_a2b9e1d13f95c2d3_34_double_double)}, +// breakout {"nl_gcr_a5e9537117c3969a_31_double_double", reinterpret_cast(&nl_gcr_a5e9537117c3969a_31_double_double)}, +// zac1b11142 + {"nl_gcr_a88b481713b08b7b_30_double_double", reinterpret_cast(&nl_gcr_a88b481713b08b7b_30_double_double)}, +// kidniki {"nl_gcr_b42f307001315373_21_double_double", reinterpret_cast(&nl_gcr_b42f307001315373_21_double_double)}, +// pongf {"nl_gcr_b8e1f7dd43c1da70_35_double_double", reinterpret_cast(&nl_gcr_b8e1f7dd43c1da70_35_double_double)}, +// gtrak10 {"nl_gcr_b9ccfa3d1681baf3_43_double_double", reinterpret_cast(&nl_gcr_b9ccfa3d1681baf3_43_double_double)}, - {"nl_gcr_ce10642feea9ba8d_28_double_double", reinterpret_cast(&nl_gcr_ce10642feea9ba8d_28_double_double)}, +// gamemachine {"nl_gcr_d028b2a263a6b4a7_7_double_double", reinterpret_cast(&nl_gcr_d028b2a263a6b4a7_7_double_double)}, +// zac1b11142 + {"nl_gcr_dded752996a524fc_178_double_double", reinterpret_cast(&nl_gcr_dded752996a524fc_178_double_double)}, +// cheekyms {"nl_gcr_e67e623b6c100b4e_12_double_double", reinterpret_cast(&nl_gcr_e67e623b6c100b4e_12_double_double)}, +// kidniki {"nl_gcr_e7e5566e352b80c1_67_double_double", reinterpret_cast(&nl_gcr_e7e5566e352b80c1_67_double_double)}, +// gamemachine {"nl_gcr_ec17a9dbc8cd78fd_10_double_double", reinterpret_cast(&nl_gcr_ec17a9dbc8cd78fd_10_double_double)}, +// breakout {"nl_gcr_fbbf6eebb7621abc_7_double_double", reinterpret_cast(&nl_gcr_fbbf6eebb7621abc_7_double_double)}, +// cheekyms {"nl_gcr_feb42362d28845e7_7_double_double", reinterpret_cast(&nl_gcr_feb42362d28845e7_7_double_double)}, {"", nullptr} }; diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 25fbe484b3b..8f84e8812d3 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -195,8 +195,8 @@ namespace netlist , m_queue(*this) , m_use_stats(false) { - state.run_state_manager().save_item(this, static_cast(m_queue), "m_queue"); - state.run_state_manager().save_item(this, m_time, "m_time"); + state.save(*this, static_cast(m_queue), "netlist", "m_queue"); + state.save(*this, m_time, "netlist", "m_time"); } // ---------------------------------------------------------------------------------------- @@ -655,8 +655,8 @@ namespace netlist detail::net_t::net_t(netlist_state_t &nl, const pstring &aname, core_terminal_t *railterminal) : netlist_object_t(nl.exec(), aname) - , m_new_Q(*this, "m_new_Q", 0) - , m_cur_Q (*this, "m_cur_Q", 0) + , m_new_Q(*this, "m_new_Q", netlist_sig_t(0)) + , m_cur_Q (*this, "m_cur_Q", netlist_sig_t(0)) , m_in_queue(*this, "m_in_queue", queue_status::DELIVERED) , m_next_scheduled_time(*this, "m_time", netlist_time_ext::zero()) , m_railterminal(railterminal) diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index a504dc800ba..8b0b5ecd5ee 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -340,6 +340,12 @@ namespace netlist const T &value //!< Initial value after construction ); + template + //! Constructor. + state_var(O &owner, //!< owner must have a netlist() method. + const pstring &name //!< identifier/name for this state variable + ); + //! Destructor. ~state_var() noexcept = default; //! Copy Constructor. @@ -359,6 +365,10 @@ namespace netlist //! Return const value of state variable. constexpr operator const T & () const noexcept { return m_value; } //! Return non-const value of state variable. + C14CONSTEXPR T & var() noexcept { return m_value; } + //! Return const value of state variable. + constexpr const T & var() const noexcept { return m_value; } + //! Return non-const value of state variable. C14CONSTEXPR T & operator ()() noexcept { return m_value; } //! Return const value of state variable. constexpr const T & operator ()() const noexcept { return m_value; } @@ -366,6 +376,10 @@ namespace netlist C14CONSTEXPR T * ptr() noexcept { return &m_value; } //! Return const pointer to state variable. constexpr const T * ptr() const noexcept{ return &m_value; } + //! Access state variable by ->. + C14CONSTEXPR T * operator->() noexcept { return &m_value; } + //! Access state variable by const ->. + constexpr const T * operator->() const noexcept{ return &m_value; } private: T m_value; @@ -525,11 +539,6 @@ namespace netlist netlist_t & exec() noexcept { return m_netlist; } const netlist_t & exec() const noexcept { return m_netlist; } - // State saving support - allows this to be passed - // to generic save_state members - template - void save_item(C &state, const pstring &membername, const pstring &itemname); - private: netlist_t & m_netlist; @@ -1773,6 +1782,40 @@ namespace netlist }; + // ----------------------------------------------------------------------------- + // power pins - not a device, but a helper + // ----------------------------------------------------------------------------- + + /// \brief Power pins class. + /// + /// Power Pins are passive inputs. Delegate noop will silently ignore any + /// updates. + + class nld_power_pins + { + public: + explicit nld_power_pins(device_t &owner, const pstring &sVCC = sPowerVCC, + const pstring &sGND = sPowerGND) + : m_VCC(owner, sVCC, NETLIB_DELEGATE(power_pins, noop)) + , m_GND(owner, sGND, NETLIB_DELEGATE(power_pins, noop)) + { + } + + const analog_input_t &VCC() const noexcept + { + return m_VCC; + } + const analog_input_t &GND() const noexcept + { + return m_GND; + } + + private: + void noop() { } + analog_input_t m_VCC; + analog_input_t m_GND; + }; + // ----------------------------------------------------------------------------- // inline implementations // ----------------------------------------------------------------------------- @@ -1787,12 +1830,6 @@ namespace netlist return m_netlist.nlstate(); } - template - inline void detail::netlist_object_t::save_item(C &state, const pstring &membername, const pstring &itemname) - { - this->state().save(*this, state, name(), membername + "." + itemname); - } - template void device_t::create_and_register_subdevice(const pstring &name, unique_pool_ptr &dev, Args&&... args) { @@ -2048,6 +2085,13 @@ namespace netlist owner.state().save(owner, m_value, owner.name(), name); } + template + template + state_var::state_var(O &owner, const pstring &name) + { + owner.state().save(owner, m_value, owner.name(), name); + } + template template state_container::state_container(O &owner, const pstring &name, diff --git a/src/lib/netlist/nl_config.h b/src/lib/netlist/nl_config.h index 1025673ccf6..68d9224135c 100644 --- a/src/lib/netlist/nl_config.h +++ b/src/lib/netlist/nl_config.h @@ -17,7 +17,7 @@ /// /// \brief Version - Minor. /// -#define NL_VERSION_MINOR 12 +#define NL_VERSION_MINOR 13 /// \brief Version - Patch level. /// #define NL_VERSION_PATCHLEVEL 0 diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h index 542a3d8c816..03bb7e30fc0 100644 --- a/src/lib/netlist/nltypes.h +++ b/src/lib/netlist/nltypes.h @@ -164,13 +164,5 @@ namespace netlist } // namespace netlist -namespace plib { - - template<> - inline void state_manager_t::save_item(const void *owner, netlist::netlist_time &state, const pstring &stname) - { - save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), true, false), 1, state.get_internaltype_ptr()); - } -} // namespace plib #endif // NLTYPES_H_ diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index b5c1a46dda2..aa9524e1ee9 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -9,6 +9,7 @@ #include "pstrutil.h" #include "putil.h" +#include #include #include #include diff --git a/src/lib/netlist/plib/pfunction.h b/src/lib/netlist/plib/pfunction.h index bf76b3f14d1..7fcac29aed9 100644 --- a/src/lib/netlist/plib/pfunction.h +++ b/src/lib/netlist/plib/pfunction.h @@ -92,10 +92,10 @@ namespace plib { /// value_type evaluate(const values_container &values = values_container()) noexcept; - template - void save_state(ST &st, const STR &name) + template + void save_state(ST &st) { - st.save_item(m_lfsr, name, "m_lfsr"); + st.save_item(m_lfsr, "m_lfsr"); } private: diff --git a/src/lib/netlist/plib/poptions.h b/src/lib/netlist/plib/poptions.h index 3a807c3c7f0..2db0e7e9585 100755 --- a/src/lib/netlist/plib/poptions.h +++ b/src/lib/netlist/plib/poptions.h @@ -12,6 +12,7 @@ #include "pstonum.h" #include "pstring.h" #include "putil.h" +#include "pfmtlog.h" namespace plib { @@ -27,7 +28,7 @@ namespace plib { PCOPYASSIGNMOVE(option_base, delete) - pstring help() const { return m_help; } + virtual pstring help() const { return m_help; } private: pstring m_help; }; @@ -169,16 +170,23 @@ namespace plib { public: option_num(options &parent, const pstring &ashort, const pstring &along, T defval, const pstring &help, - T minval = std::numeric_limits::min(), + T minval = std::numeric_limits::lowest(), T maxval = std::numeric_limits::max() ) : option(parent, ashort, along, help, true) , m_val(defval) , m_min(minval) , m_max(maxval) + , m_def(defval) {} T operator ()() const { return m_val; } + pstring help() const override + { + auto hs(option::help()); + return plib::pfmt(hs)(m_def, m_min, m_max); + } + protected: int parse(const pstring &argument) override { @@ -191,6 +199,7 @@ namespace plib { T m_val; T m_min; T m_max; + T m_def; }; class option_vec : public option diff --git a/src/lib/netlist/plib/ppreprocessor.cpp b/src/lib/netlist/plib/ppreprocessor.cpp index 089188f3106..d6126b68fea 100644 --- a/src/lib/netlist/plib/ppreprocessor.cpp +++ b/src/lib/netlist/plib/ppreprocessor.cpp @@ -484,6 +484,18 @@ namespace plib { { m_if_flag ^= (1 << m_if_level); } + else if (lti[0] == "#elif") + { + m_if_flag ^= (1 << m_if_level); + lt = replace_macros(lt); + auto t(simple_iter(this, tokenize(lt.substr(5), m_expr_sep, true, true))); + auto val = static_cast(prepro_expr(t, 255)); + t.skip_ws(); + if (!t.eod()) + error("found unprocessed content at end of line"); + if (val == 0) + m_if_flag |= (1 << m_if_level); + } else if (lti[0] == "#endif") { m_if_flag &= ~(1 << m_if_level); diff --git a/src/lib/netlist/plib/prandom.h b/src/lib/netlist/plib/prandom.h index 8c607719930..c5d363b2f5c 100644 --- a/src/lib/netlist/plib/prandom.h +++ b/src/lib/netlist/plib/prandom.h @@ -52,11 +52,11 @@ namespace plib static constexpr T min() noexcept { return static_cast(0); } static constexpr T max() noexcept { return ~T(0) >> (sizeof(T)*8 - w); } - template - void save_state(ST &st, const STR &name) + template + void save_state(ST &st) { - st.save_item(m_p, name, "index"); - st.save_item(m_mt, name, "mt"); + st.save_item(m_p, "index"); + st.save_item(m_mt, "mt"); } void seed(T val) noexcept @@ -142,9 +142,10 @@ namespace plib * constants::sqrt3() * m_stddev; } - template - void save_state(ST &st, const STR &name) + template + void save_state(ST &st) { + plib::unused_var(st); /* no state to save */ } @@ -169,11 +170,11 @@ namespace plib return m_buf[m_p++]; } - template - void save_state(ST &st, const STR &name) + template + void save_state(ST &st) { - st.save_item(m_p, name, "m_p"); - st.save_item(m_buf, name, "m_buf"); + st.save_item(m_p, "m_p"); + st.save_item(m_buf, "m_buf"); } private: diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h index 5f93c539ba0..59e7d5006f1 100644 --- a/src/lib/netlist/plib/pstate.h +++ b/src/lib/netlist/plib/pstate.h @@ -97,10 +97,29 @@ public: state_manager_t() = default; + struct saver_t + { + saver_t(state_manager_t &sm, const void *owner, const pstring &membername) + : m_sm(sm) + , m_owner(owner) + , m_membername(membername) + { } + + template + void save_item(XS &xstate, const pstring &itemname) + { + m_sm.save_item(m_owner, xstate, m_membername + "." + itemname); + } + + state_manager_t &m_sm; + const void * m_owner; + const pstring m_membername; + }; + template void save_item(const void *owner, C &state, const pstring &stname) { - save_state_ptr( owner, stname, dtype(), 1, &state); + save_item_dispatch(owner, state, stname); } template @@ -173,12 +192,32 @@ public: protected: private: + + template + typename std::enable_if::value || std::is_enum::value + || plib::is_floating_point::value>::type + save_item_dispatch(const void *owner, C &state, const pstring &stname) + { + save_state_ptr( owner, stname, dtype(), 1, &state); + } + + + template + typename std::enable_if::value || std::is_enum::value + || plib::is_floating_point::value)>::type + save_item_dispatch(const void *owner, C &state, const pstring &stname) + { + saver_t sav(*this, owner, stname); + state.save_state(sav); + } + entry_t::list_t m_save; entry_t::list_t m_custom; }; -template<> inline void state_manager_t::save_item(const void *owner, callback_t &state, const pstring &stname) +template<> +inline void state_manager_t::save_item(const void *owner, callback_t &state, const pstring &stname) { m_custom.emplace_back(stname, owner, &state); state.register_state(*this, stname); diff --git a/src/lib/netlist/plib/ptime.h b/src/lib/netlist/plib/ptime.h index 836f832bda8..3cdb9f30d33 100644 --- a/src/lib/netlist/plib/ptime.h +++ b/src/lib/netlist/plib/ptime.h @@ -27,13 +27,6 @@ namespace plib const static bool value = sizeof(T) <= sizeof(U); }; -#if 0 - template - struct ptime_res { - using type = typename std::conditional= sizeof(U), T, U>::type; - }; -#endif - template struct ptime final { @@ -165,7 +158,14 @@ namespace plib constexpr ptime shr(unsigned shift) const noexcept { return ptime(m_time >> shift); } // for save states .... +#if 0 C14CONSTEXPR internal_type *get_internaltype_ptr() noexcept { return &m_time; } +#endif + template + void save_state(ST &st) + { + st.save_item(m_time, "m_time"); + } static constexpr ptime from_nsec(internal_type ns) noexcept { return ptime(ns, UINT64_C(1000000000)); } static constexpr ptime from_usec(internal_type us) noexcept { return ptime(us, UINT64_C( 1000000)); } diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index ca05dc689b7..22cc021baaf 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -149,13 +149,23 @@ private: plib::option_example opt_ex3; plib::option_example opt_ex4; + struct compile_map_entry + { + compile_map_entry(pstring mod, pstring code) + : m_module(mod), m_code(code) { } + pstring m_module; + pstring m_code; + }; + + using compile_map = std::map; + void run(); void validate(); void convert(); void compile_one_and_add_to_map(const pstring &file, const pstring &name, netlist::solver::static_compile_target target, - std::map &map); + compile_map &map); void static_compile(); void mac_out(const pstring &s, bool cont = true); @@ -547,7 +557,7 @@ void tool_app_t::validate() void tool_app_t::compile_one_and_add_to_map(const pstring &file, const pstring &name, netlist::solver::static_compile_target target, - std::map &map) + compile_map &map) { try { @@ -571,10 +581,10 @@ void tool_app_t::compile_one_and_add_to_map(const pstring &file, { auto it = map.find(e.first); if (it == map.end()) - map.insert(e); + map.insert({e.first, compile_map_entry(name, e.second)}); else { - if (it->second != e.second) + if (it->second.m_code != e.second) { pstring msg = plib::pfmt("nltool: found hash conflict in {1}, netlist {2}")(file, name); throw netlist::nl_exception(msg); @@ -607,19 +617,19 @@ void tool_app_t::static_compile() if (opt_files().size() != 1) throw netlist::nl_exception("nltool: static_compile needs exactly one file"); - std::map mp; + compile_map mp; compile_one_and_add_to_map(opt_files()[0], opt_name(), target, mp); for (auto &e : mp) { auto sout(std::ofstream(opt_dir() + "/" + e.first + ".c" )); - sout << e.second; + sout << e.second.m_code; } } else { - std::map map; + compile_map map; for (const auto &f : opt_files()) { @@ -664,10 +674,16 @@ void tool_app_t::static_compile() sout << "#include \"plib/pdynlib.h\"\n\n"; for (auto &e : map) - sout << e.second; + { + sout << "// " << e.second.m_module << "\n"; + sout << e.second.m_code; + } sout << "plib::dynlib_static_sym nl_static_solver_syms[] = {\n"; for (auto &e : map) + { + sout << "// " << e.second.m_module << "\n"; sout << "\t{\"" << e.first << "\", reinterpret_cast(&" << e.first << ")},\n"; + } sout << "{\"\", nullptr}\n"; sout << "};\n"; @@ -1195,14 +1211,9 @@ int tool_app_t::execute() return 1; } } - catch (netlist::nl_exception &e) - { - perr("Netlist exception caught: {}\n", e.text()); - return 2; - } catch (plib::pexception &e) { - perr("plib exception caught: {}\n", e.text()); + perr("Exception caught: {}\n", e.text()); return 2; } diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp old mode 100644 new mode 100755 index ad3050ff798..6e8bce036d1 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -1,14 +1,21 @@ // license:GPL-2.0+ // copyright-holders:Couriersud -#include "plib/pstring.h" +#include "netlist/plib/pstring.h" #include "netlist/nl_setup.h" -#include "plib/plists.h" -#include "plib/pmain.h" -#include "plib/ppmf.h" -#include "plib/pstream.h" +#include "netlist/plib/plists.h" +#include "netlist/plib/pmain.h" +#include "netlist/plib/ppmf.h" +#include "netlist/plib/pstream.h" #include +// see below - this belongs somewhere else! +#ifdef _WIN32 +#include +#include +#include +#endif + // From: https://ffmpeg.org/pipermail/ffmpeg-devel/2007-October/038122.html // The most compatible way to make a wav header for unknown length is to put // 0xffffffff in the header. 0 as the RIFF length and 0 as the data chunk length @@ -24,12 +31,20 @@ class wav_t { public: - // XXNOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) - wav_t(std::ostream &strm, bool is_seekable, std::size_t sr, std::size_t channels) + + enum format + { + s16, + s32, + f32 + }; + + wav_t(std::ostream &strm, bool is_seekable, format fmt, std::size_t sr, std::size_t channels) : m_f(strm) , m_stream_is_seekable(is_seekable) + , m_format(fmt) // force "play" to play and warn about eof instead of being silent - , m_fmt(static_cast(channels), static_cast(sr)) + , m_fmt(static_cast(channels), static_cast(sr), fmt) , m_data(is_seekable ? 0 : 0xffffffff) { @@ -60,16 +75,43 @@ public: template void write(const T &val) { - m_f.write(reinterpret_cast(&val), sizeof(T)); + static_assert(sizeof(std::ostream::char_type) == 1, "char_type size must be 1"); + auto ptr(reinterpret_cast(&val)); + m_f.write(ptr, sizeof(T)); } - void write_sample(const int *sample) + template + void write_sample_int(double sample) + { + const auto mmax(static_cast(plib::numeric_limits::max())); + const auto mmin(static_cast(plib::numeric_limits::min())); + + sample *= mmax; + sample = std::max(mmin, sample); + sample = std::min(mmax, sample); + const auto dest(static_cast(sample)); + write(dest); + } + + // expects normalized samples between -1.0 to 1.0 for s16 and s32 + void write_samples(double *sample) { m_data.len += m_fmt.block_align; for (std::size_t i = 0; i < channels(); i++) { - auto ps = static_cast(sample[i]); // 16 bit sample, FIXME: Endianess? - write(ps); + switch (m_format) + { + case s16: + write_sample_int(sample[i]); + break; + case s32: + write_sample_int(sample[i]); + break; + case f32: + const auto df32(static_cast(sample[i])); + write(df32); + break; + } } } @@ -83,8 +125,23 @@ private: struct riff_format_t { - riff_format_t(uint16_t achannels, uint32_t asample_rate) + riff_format_t(uint16_t achannels, uint32_t asample_rate, format fm) { + switch (fm) + { + case s16: + format_tag = 0x0001; // PCM + bits_sample = 16; + break; + case s32: + format_tag = 0x0001; // PCM + bits_sample = 32; + break; + case f32: + format_tag = 0x0003; // FLOAT + bits_sample = 32; + break; + } channels = achannels; sample_rate = asample_rate; block_align = channels * ((bits_sample + 7) / 8); @@ -92,12 +149,12 @@ private: } std::array signature = {{'f','m','t',' '}}; uint32_t fmt_length = 16; - uint16_t format_tag = 0x0001; // PCM + uint16_t format_tag; uint16_t channels; uint32_t sample_rate; uint32_t bytes_per_second; uint16_t block_align; - uint16_t bits_sample = 16; + uint16_t bits_sample; }; struct riff_data_t @@ -110,6 +167,7 @@ private: std::ostream &m_f; bool m_stream_is_seekable; + format m_format; riff_chunk_t m_fh; riff_format_t m_fmt; @@ -213,6 +271,7 @@ struct aggregator { while (time >= ct + m_quantum) { + ct += m_quantum; for (std::size_t i=0; i< m_channels; i++) { outsam[i] += (ct - lt) * cursam[i]; @@ -221,7 +280,6 @@ struct aggregator outsam[i] = 0.0; } lt = ct; - ct += m_quantum; } for (std::size_t i=0; i< m_channels; i++) outsam[i] += (time-lt)*cursam[i]; @@ -239,52 +297,126 @@ private: std::vector cursam; }; +struct filter_hp +{ + using callback_type = plib::pmfp; + + filter_hp(double freq, bool boost, std::size_t channels, callback_type cb) + : m_cb(cb) + , m_hp_omega(plib::constants::two() * plib::constants::pi() * freq) + , m_boost(boost) + , m_lt(channels, 0.0) + , m_in(channels, 0.0) + , m_cap(channels, 0.0) + { } + void process(std::size_t chan, double time, double val) + { + // based on CR filter + auto dt(time - m_lt[chan]); + + double omega = ((m_boost && (time < 1.0/m_hp_omega)) ? 1e12 : m_hp_omega); + auto m(1.0 - plib::exp(-dt * omega)); + m_cap[chan] += m * (m_in[chan] - m_cap[chan]); + // out = in - vcap + m_cb(chan, time, m_in[chan] - m_cap[chan]); + + m_in[chan] = val; + m_lt[chan] = time; + } + +private: + callback_type m_cb; + double m_hp_omega; + bool m_boost; + std::vector m_lt; + std::vector m_in; + std::vector m_cap; +}; + +struct filter_lp +{ + using callback_type = plib::pmfp; + + filter_lp(double freq, std::size_t channels, callback_type cb) + : m_cb(cb) + , m_lp_omega(plib::constants::two() * plib::constants::pi() * freq) + , m_lt(channels, 0.0) + , m_in(channels, 0.0) // lp filter + , m_cap(channels, 0.0) // hp filter + { } + void process(std::size_t chan, double time, double val) + { + // based on RC filter + auto dt(time - m_lt[chan]); + + auto m(1.0 - plib::exp(-dt * m_lp_omega)); + + m_cap[chan] += m * (m_in[chan] - m_cap[chan]); + // out = vcap + m_cb(chan, time, m_cap[chan]); + + m_in[chan] = val; + m_lt[chan] = time; + } + +private: + callback_type m_cb; + double m_lp_omega; + std::vector m_lt; + std::vector m_in; + std::vector m_cap; +}; + class wavwriter { public: - wavwriter(std::ostream &fo, bool is_seekable, std::size_t channels, std::size_t sample_rate, double ampa) - : mean(channels, 0.0) - , means(channels, 0.0) - , maxsam(channels, -1e9) + wavwriter(std::ostream &fo, bool is_seekable, wav_t::format fmt, + std::size_t channels, std::size_t sample_rate, double ampa) + : maxsam(channels, -1e9) , minsam(channels, 1e9) , m_n(channels, 0) , m_samples(channels, 0) , m_last_time(0) , m_fo(fo) - , m_amp(ampa) - , m_wo(m_fo, is_seekable, sample_rate, channels) + , m_amp(ampa <= 0.0 ? 1.0e6 : ampa) + , m_auto(ampa <= 0.0) + , m_wo(m_fo, is_seekable, fmt, sample_rate, channels) { } void process(std::size_t chan, double time, double outsam) { if (time > m_last_time) - m_wo.write_sample(m_samples.data()); + m_wo.write_samples(m_samples.data()); m_last_time = time; - means[chan] += outsam; maxsam[chan] = std::max(maxsam[chan], outsam); minsam[chan] = std::min(minsam[chan], outsam); m_n[chan]++; - //mean = means / (double) m_n; - mean[chan] += 5.0 / static_cast(m_wo.sample_rate()) * (outsam - mean[chan]); - outsam = (outsam - mean[chan]) * m_amp; - outsam = std::max(-32000.0, outsam); - outsam = std::min(32000.0, outsam); - m_samples[chan] = static_cast(outsam); + auto val(outsam * m_amp); + if (m_auto && plib::abs(val) > 1.0) + { + do + { + m_amp /= 2.0; + val = outsam * m_amp; + } while (plib::abs(val) > 1.0); + // FIXME: log this in state and provide on verbose output + //printf("dynamp adjusted to %f at %f\n", m_amp, time); + } + m_samples[chan] = val; } - std::vector mean; - std::vector means; std::vector maxsam; std::vector minsam; std::vector m_n; - std::vector m_samples; + std::vector m_samples; double m_last_time; private: std::ostream &m_fo; double m_amp; + bool m_auto; wav_t m_wo; }; @@ -440,18 +572,23 @@ class nlwav_app : public plib::app public: nlwav_app() : plib::app(), - opt_fmt(*this, "f", "format", 0, std::vector({"wav","vcda","vcdd", "tab"}), - "output format. Available options are wav|vcda|vcdd|tab." - " wav : multichannel wav output" - " vcda : analog VCD output" - " vcdd : digital VCD output" - " tab : sampled output" + opt_fmt(*this, "f", "format", 0, std::vector({"wav16s","wav32s","wav32f","vcda","vcdd", "tab"}), + "output format. Available options are wav16s|wav32s|wav32f|vcda|vcdd|tab.\n" + " wav16s : multichannel wav output 16 bit signed\n" + " wav32s : multichannel wav output 32 bit signed\n" + " wav32f : multichannel wav output 32 bit float\n" + " vcda : analog VCD output\n" + " vcdd : digital VCD output\n" + " tab : sampled output\n" " Digital signals are created using the --high and --low options" ), opt_out(*this, "o", "output", "-", "output file"), opt_grp1(*this, "wav options", "These options apply to wav output only"), opt_rate(*this, "r", "rate", 48000, "sample rate of output file"), opt_amp(*this, "a", "amp", 10000.0, "amplification after mean correction"), + opt_lowpass(*this, "", "lowpass", 20000.0, "lowpass filter frequency.\nDefault {1:.0} Hz."), + opt_highpass(*this, "", "highpass", 20.0, "highpass filter frequency.\nDefault is {1:.0} Hz."), + opt_hpboost(*this, "", "hpboost", "enable highpass boost to filter out initial click."), opt_grp2(*this, "vcdd options", "These options apply to vcdd output only"), opt_high(*this, "u", "high", 2.0, "minimum input for high level"), opt_low(*this, "l", "low", 1.0, "maximum input for low level"), @@ -467,8 +604,8 @@ public: opt_help(*this, "h", "help", "display help and exit"), opt_ex1(*this, "./nlwav -f vcdd -o x.vcd log_V*", "convert all files starting with \"log_V\" into a digital vcd file"), - opt_ex2(*this, "./nlwav -f wav -o x.wav log_V*", - "convert all files starting with \"log_V\" into a multichannel wav file"), + opt_ex2(*this, "./nlwav -f wav16s -o x.wav log_V*", + "convert all files starting with \"log_V\" into a multichannel wav file (16bit, signed)"), opt_ex3(*this, "./nlwav -f tab -o x.tab -s 0.0000005 -i 0.000001 -n 256 log_BLUE.log", "convert file log_BLUE.log to sampled output. First sample at 500ns " "followed by 255 samples every micro-second.") @@ -478,16 +615,19 @@ public: pstring usage() override; private: - void convert_wav(std::ostream &ostrm); + void convert_wav(std::ostream &ostrm, wav_t::format fmt); void convert_vcd(std::ostream &ostrm, vcdwriter::format_e format); void convert_tab(std::ostream &ostrm); - void convert(std::ostream &ostrm); + void convert(const pstring &outname); plib::option_str_limit opt_fmt; plib::option_str opt_out; plib::option_group opt_grp1; plib::option_num opt_rate; plib::option_num opt_amp; + plib::option_num opt_lowpass; + plib::option_num opt_highpass; + plib::option_bool opt_hpboost; plib::option_group opt_grp2; plib::option_num opt_high; plib::option_num opt_low; @@ -508,16 +648,20 @@ private: std::vector> m_instrms; }; -void nlwav_app::convert_wav(std::ostream &ostrm) +void nlwav_app::convert_wav(std::ostream &ostrm, wav_t::format fmt) { double dt = plib::reciprocal(static_cast(opt_rate())); + auto nchan = m_instrms.size(); - plib::unique_ptr wo = plib::make_unique(ostrm, opt_out() != "-", m_instrms.size(), opt_rate(), opt_amp()); - plib::unique_ptr ago = plib::make_unique(m_instrms.size(), dt, aggregator::callback_type(&wavwriter::process, wo.get())); - aggregator::callback_type agcb = log_processor::callback_type(&aggregator::process, ago.get()); + auto wo = plib::make_unique(ostrm, opt_out() != "-", fmt, nchan, opt_rate(), opt_amp()); + auto ago = plib::make_unique(nchan, dt, aggregator::callback_type(&wavwriter::process, wo.get())); + auto fgo_hp = plib::make_unique(opt_highpass(), opt_hpboost(), nchan, filter_hp::callback_type(&aggregator::process, ago.get())); + auto fgo_lp = plib::make_unique(opt_lowpass(), nchan, filter_lp::callback_type(&filter_hp::process, fgo_hp.get())); - log_processor lp(m_instrms.size(), agcb); + auto topcb = log_processor::callback_type(&filter_lp::process, fgo_lp.get()); + + log_processor lp(nchan, topcb); lp.process(m_instrms); @@ -574,18 +718,52 @@ pstring nlwav_app::usage() "nlwav [OPTION] ... [FILE] ..."); } -void nlwav_app::convert(std::ostream &ostrm) +template +static void open_ostream_and_exec(pstring fname, bool binary, F func) +{ + if (fname != "-") + { + // FIXME: binary depends on format! + auto outstrm(std::ofstream(plib::filesystem::u8path(fname), + binary ? (std::ios::out | std::ios::binary) : std::ios::out)); + if (outstrm.fail()) + throw plib::file_open_e(fname); + outstrm.imbue(std::locale::classic()); + func(outstrm); + } + else + { + std::cout.imbue(std::locale::classic()); + // FIXME: switch to binary on windows +#ifdef _WIN32 + _setmode(_fileno(stdout), _O_BINARY); +#endif + func(std::cout); + } +} + +void nlwav_app::convert(const pstring &outname) { switch (opt_fmt()) { case 0: - convert_wav(ostrm); break; + open_ostream_and_exec(outname, true, [this](std::ostream &ostrm) { convert_wav(ostrm, wav_t::s16); }); + break; case 1: - convert_vcd(ostrm, vcdwriter::ANALOG); break; + open_ostream_and_exec(outname, true, [this](std::ostream &ostrm) { convert_wav(ostrm, wav_t::s32); }); + break; case 2: - convert_vcd(ostrm, vcdwriter::DIGITAL); break; + open_ostream_and_exec(outname, true, [this](std::ostream &ostrm) { convert_wav(ostrm, wav_t::f32); }); + break; case 3: - convert_tab(ostrm); break; + open_ostream_and_exec(outname, false, [this](std::ostream &ostrm) { convert_vcd(ostrm, vcdwriter::ANALOG); }); + break; + case 4: + open_ostream_and_exec(outname, false, [this](std::ostream &ostrm) { convert_vcd(ostrm, vcdwriter::DIGITAL); }); + break; + case 5: + open_ostream_and_exec(outname, false, [this](std::ostream &ostrm) { convert_tab(ostrm); }); + break; default: // tease compiler - can't happen break; @@ -612,35 +790,34 @@ int nlwav_app::execute() return 0; } - for (const auto &oi: opt_args()) + try { - plib::unique_ptr fin; - if (oi == "-") + for (const auto &oi: opt_args()) { - auto temp(plib::make_unique()); - plib::copystream(*temp, std::cin); - fin = std::move(temp); + plib::unique_ptr fin; + if (oi == "-") + { + auto temp(plib::make_unique()); + plib::copystream(*temp, std::cin); + fin = std::move(temp); + } + else + { + fin = plib::make_unique(plib::filesystem::u8path(oi), std::ios::in); + if (fin->fail()) + throw plib::file_open_e(oi); + } + fin->imbue(std::locale::classic()); + m_instrms.push_back(std::move(fin)); } - else - fin = plib::make_unique(plib::filesystem::u8path(oi)); - fin->imbue(std::locale::classic()); - m_instrms.push_back(std::move(fin)); - } - if (opt_out() != "-") - { - auto outstrm(std::ofstream(plib::filesystem::u8path(opt_out()))); - if (outstrm.fail()) - throw plib::file_open_e(opt_out()); - outstrm.imbue(std::locale::classic()); - convert(outstrm); + convert(opt_out()); } - else + catch (plib::pexception &e) { - std::cout.imbue(std::locale::classic()); - convert(std::cout); + perr("Exception caught: {}\n", e.text()); + return 1; } - return 0; } diff --git a/src/mame/audio/ad_sound.cpp b/src/mame/audio/ad_sound.cpp index d9eff0b74df..3b7fe72959f 100644 --- a/src/mame/audio/ad_sound.cpp +++ b/src/mame/audio/ad_sound.cpp @@ -432,9 +432,13 @@ void ad_59mc07_device::device_reset() /* Functions to emulate the Alpha Denshi "60MC01" audio board - CPU :Z80A - Sound:AY-3-8910A (unpopulated: another 8910 and a YM2203) - OSC :16.000MHz + CPU : Z80A + Sound: AY-3-8910A (unpopulated: another 8910 and a YM2203) + OSC : 16.000MHz + + TODO: This bears a lot of similarities with the Super Stingray audio board. Verify if PCB codes match and if so merge implementations; + fix interrupts; + is there really no music? */ //************************************************************************** @@ -449,19 +453,21 @@ DEFINE_DEVICE_TYPE(AD_60MC01, ad_60mc01_device, "ad_60mc01", "Alpha Denshi 60MC0 // MEMORY MAPS //************************************************************************** -void ad_60mc01_device::sound_map(address_map &map) // TODO: verify everything +void ad_60mc01_device::sound_map(address_map &map) { map(0x0000, 0x1fff).rom(); map(0x8000, 0x87ff).ram(); - // map(0xc100, 0xc100).r(m_soundlatch, FUNC(generic_latch_8_device::read)); - // map(0xc102, 0xc102).w(m_soundlatch, FUNC(generic_latch_8_device::clear_w)); + map(0xc100, 0xc100).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xc102, 0xc102).w(m_soundlatch, FUNC(generic_latch_8_device::clear_w)); + map(0xc104, 0xc104).nopw(); // written at start up, would be DAC if it were populated + map(0xc106, 0xc10e).nopw(); // written continuously, it's audio board I/O according to Super Stingray's emulation } void ad_60mc01_device::sound_portmap(address_map &map) { map.global_mask(0xff); - // map(0x10, 0x11).w("aysnd", FUNC(ay8910_device::data_address_w)); - // map(0x80, 0x81).w + map(0x10, 0x11).nopw(); // written at start up, would be the YM2203 if it were populated + map(0x80, 0x81).w("aysnd", FUNC(ay8910_device::data_address_w)); } //************************************************************************** @@ -487,6 +493,7 @@ void ad_60mc01_device::device_add_mconfig(machine_config &config) Z80(config, m_audiocpu, 16_MHz_XTAL / 4); // divider not verified m_audiocpu->set_addrmap(AS_PROGRAM, &ad_60mc01_device::sound_map); m_audiocpu->set_addrmap(AS_IO, &ad_60mc01_device::sound_portmap); + m_audiocpu->set_periodic_int(FUNC(ad_60mc01_device::sound_irq), attotime::from_hz(128)); // sound hardware SPEAKER(config, "speaker").front_center(); diff --git a/src/mame/audio/ad_sound.h b/src/mame/audio/ad_sound.h index fd3e33e5421..1c169709cae 100644 --- a/src/mame/audio/ad_sound.h +++ b/src/mame/audio/ad_sound.h @@ -108,7 +108,7 @@ public: // construction/destruction ad_60mc01_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); - static constexpr feature_type unemulated_features() { return feature::SOUND; } + static constexpr feature_type imperfect_features() { return feature::SOUND; } // TODO: fix interrupts, missing music? void sound_command_w(uint8_t data) { m_soundlatch->write(data); } @@ -124,6 +124,8 @@ private: void sound_map(address_map &map); void sound_portmap(address_map &map); + + INTERRUPT_GEN_MEMBER(sound_irq) { m_audiocpu->set_input_line(0, HOLD_LINE); } }; #endif // MAME_AUDIO_AD_SOUND_BOARDS_H diff --git a/src/mame/audio/circus.cpp b/src/mame/audio/circus.cpp index c5e27151029..a1d302e77ac 100644 --- a/src/mame/audio/circus.cpp +++ b/src/mame/audio/circus.cpp @@ -149,7 +149,7 @@ DISCRETE_SOUND_END /* and also is used to enable the amplifier and trigger the */ /* discrete circuitry that produces sound effects and music */ -WRITE8_MEMBER(circus_state::circus_clown_z_w) +void circus_state::circus_clown_z_w(uint8_t data) { m_clown_z = (data & 0x0f); *(memregion("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG diff --git a/src/mame/audio/jedi.cpp b/src/mame/audio/jedi.cpp index 33d19e1cd2a..003cda873a7 100644 --- a/src/mame/audio/jedi.cpp +++ b/src/mame/audio/jedi.cpp @@ -11,6 +11,7 @@ #include "emu.h" #include "includes/jedi.h" #include "cpu/m6502/m6502.h" +#include "machine/rescap.h" #include "sound/pokey.h" #include "speaker.h" diff --git a/src/mame/audio/tx1.cpp b/src/mame/audio/tx1.cpp index 54357134dc6..2cc1a8fe69b 100644 --- a/src/mame/audio/tx1.cpp +++ b/src/mame/audio/tx1.cpp @@ -481,7 +481,7 @@ INPUT_PORTS_START( tx1_inputs ) PORT_DIPSETTING( 0xe000, "No Bonus" ) PORT_START("AN_STEERING") - PORT_BIT( 0x0f, 0x00, IPT_DIAL ) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) + PORT_BIT( 0xff, 0x00, IPT_DIAL ) PORT_SENSITIVITY(20) PORT_KEYDELTA(6) PORT_START("AN_ACCELERATOR") PORT_BIT( 0x1f, 0x00, IPT_PEDAL ) PORT_MINMAX(0x00,0x1f) PORT_SENSITIVITY(25) PORT_KEYDELTA(10) diff --git a/src/mame/audio/williams.cpp b/src/mame/audio/williams.cpp index c78684aa3dc..582b7f9bb48 100644 --- a/src/mame/audio/williams.cpp +++ b/src/mame/audio/williams.cpp @@ -33,6 +33,7 @@ #include "emu.h" #include "williams.h" #include "machine/6821pia.h" +#include "machine/rescap.h" #include "cpu/m6809/m6809.h" #include "sound/ym2151.h" #include "sound/okim6295.h" diff --git a/src/mame/drivers/4enlinea.cpp b/src/mame/drivers/4enlinea.cpp index 9247d314ba8..cc49fd44f50 100644 --- a/src/mame/drivers/4enlinea.cpp +++ b/src/mame/drivers/4enlinea.cpp @@ -614,7 +614,7 @@ void _4enlinea_state::_4enlinea(machine_config &config) audiocpu.set_addrmap(AS_PROGRAM, &_4enlinea_state::audio_map); audiocpu.set_periodic_int(FUNC(_4enlinea_state::_4enlinea_audio_irq), attotime::from_hz(60)); //TODO - I2CMEM(config, m_eeprom).set_page_size(16).set_data_size(0x800); // X24C16P + I2C_24C16(config, m_eeprom); // X24C16P // FIXME: determine ISA bus clock isa8_device &isa(ISA8(config, "isa", 0)); @@ -650,7 +650,7 @@ void _4enlinea_state::k7_olym(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // D4464C-15L (6264) + battery - I2CMEM(config, m_eeprom).set_page_size(16).set_data_size(0x800); // X24C16P + I2C_24C16(config, m_eeprom); // X24C16P isa8_device &isa(ISA8(config, "isa", 0)); isa.set_memspace("maincpu", AS_PROGRAM); diff --git a/src/mame/drivers/8080bw.cpp b/src/mame/drivers/8080bw.cpp index 5d5e5555645..7105ee48010 100644 --- a/src/mame/drivers/8080bw.cpp +++ b/src/mame/drivers/8080bw.cpp @@ -5678,10 +5678,10 @@ GAME( 1980, invaddlx, invadpt2, invaders, invadpt2, mw8080bw_state, empty_i GAME( 1979, moonbase, invadpt2, invadpt2, invadpt2, _8080bw_state, empty_init, ROT270, "Taito / Nichibutsu", "Moon Base Zeta (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // this has a 'Taito Corp' string hidden away in the rom - to display it, press P1 Right+P1 Fire+2P Start then P1 Left+P1 Fire+P1 Start at the attract gameplay sequence GAME( 1979, moonbasea, invadpt2, invadpt2, invadpt2, _8080bw_state, empty_init, ROT270, "Taito / Nichibutsu", "Moon Base Zeta (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) // this has the same string replaced with Nichibutsu, no other differences -GAME( 1980, spclaser, 0, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "Taito", "Space Laser", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1980, intruder, spclaser, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "Taito (Game Plan license)", "Intruder", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) -GAME( 1980, laser, spclaser, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "bootleg (Leisure Time Electronics)", "Astro Laser (bootleg of Space Laser)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) -GAME( 1979, spcewarl, spclaser, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "Leijac Corporation", "Space War (Leijac Corporation)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // Taito's version is actually a spin-off of this? +GAME( 1979, spcewarl, 0, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "Leijac Corporation", "Space War (Leijac Corporation)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // Taito's version is actually a spin-off of this? +GAME( 1980, spclaser, spcewarl, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "Taito", "Space Laser", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) +GAME( 1980, intruder, spcewarl, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "Taito (Game Plan license)", "Intruder", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) +GAME( 1980, laser, spcewarl, invadpt2, spclaser, _8080bw_state, empty_init, ROT270, "bootleg (Leisure Time Electronics)", "Astro Laser (bootleg of Space Laser)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) GAME( 1979, lrescue, 0, lrescue, lrescue, _8080bw_state, empty_init, ROT270, "Taito", "Lunar Rescue", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAME( 1979, grescue, lrescue, lrescue, lrescue, _8080bw_state, empty_init, ROT270, "Taito (Universal license?)", "Galaxy Rescue", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/drivers/aa310.cpp b/src/mame/drivers/aa310.cpp index c78f23f31c5..13257526b84 100644 --- a/src/mame/drivers/aa310.cpp +++ b/src/mame/drivers/aa310.cpp @@ -91,7 +91,6 @@ #include "formats/apd_dsk.h" #include "formats/jfd_dsk.h" #include "formats/pc_dsk.h" -#include "machine/i2cmem.h" #include "machine/ram.h" #include "machine/wd_fdc.h" #include "sound/volt_reg.h" @@ -427,7 +426,7 @@ void aa310_state::aa310(machine_config &config) m_kart->out_tx_callback().set(FUNC(archimedes_state::a310_kart_tx_w)); m_kart->out_rx_callback().set(FUNC(archimedes_state::a310_kart_rx_w)); - I2CMEM(config, "i2cmem", 0).set_data_size(0x100); + I2C_24C02(config, "i2cmem", 0); // TODO: PCF8583 SCREEN(config, "screen", SCREEN_TYPE_RASTER); diff --git a/src/mame/drivers/aci_boris.cpp b/src/mame/drivers/aci_boris.cpp index 814fd0c30b4..0b8a16c3972 100644 --- a/src/mame/drivers/aci_boris.cpp +++ b/src/mame/drivers/aci_boris.cpp @@ -66,16 +66,12 @@ private: void digit_w(u8 data); u8 input_r(); - u8 m_io[2]; // MK3850 I/O ports - u8 m_4042; // 4042 latch output + u8 m_io[2] = { 0, 0 }; + u8 m_4042 = 0; }; void boris_state::machine_start() { - // zerofill - memset(m_io, 0, sizeof(m_io)); - m_4042 = 0; - // register for savestates save_item(NAME(m_io)); save_item(NAME(m_4042)); diff --git a/src/mame/drivers/aci_borisdpl.cpp b/src/mame/drivers/aci_borisdpl.cpp index 1f27cfe3428..f6bd43a8dc7 100644 --- a/src/mame/drivers/aci_borisdpl.cpp +++ b/src/mame/drivers/aci_borisdpl.cpp @@ -67,18 +67,14 @@ private: void ram_data_w(u8 data) { m_ram[m_ram_address] = data; } std::unique_ptr m_ram; - u8 m_ram_address; - u8 m_matrix; - u8 m_digit_data; + u8 m_ram_address = 0; + u8 m_matrix = 0; + u8 m_digit_data = 0; }; void borisdpl_state::machine_start() { - // zerofill m_ram = make_unique_clear(0x100); - m_ram_address = 0; - m_matrix = 0; - m_digit_data = 0; // register for savestates save_pointer(NAME(m_ram), 0x100); diff --git a/src/mame/drivers/amiga.cpp b/src/mame/drivers/amiga.cpp index 7f8550dd95b..f63b98a889c 100644 --- a/src/mame/drivers/amiga.cpp +++ b/src/mame/drivers/amiga.cpp @@ -2123,7 +2123,7 @@ void cd32_state::cd32(machine_config &config) ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(1024); + I2C_24C08(config, "i2cmem", 0); // AT24C08N akiko_device &akiko(AKIKO(config, "akiko", 0)); akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r)); diff --git a/src/mame/drivers/apple2gs.cpp b/src/mame/drivers/apple2gs.cpp index ea41b6ae4c3..96f3550b3ef 100644 --- a/src/mame/drivers/apple2gs.cpp +++ b/src/mame/drivers/apple2gs.cpp @@ -141,7 +141,6 @@ #define A2GS_LC00_TAG "lc00" #define A2GS_LC01_TAG "lc01" #define A2GS_B0CXXX_TAG "bnk0atc" -#define A2GS_B01_TAG "bnk1at0" #define A2GS_B1CXXX_TAG "bnk1atc" #define A2GS_B00000_TAG "b0r00bank" #define A2GS_B00200_TAG "b0r02bank" @@ -203,7 +202,6 @@ public: m_lc00(*this, A2GS_LC00_TAG), m_lc01(*this, A2GS_LC01_TAG), m_bank0_atc(*this, A2GS_B0CXXX_TAG), - m_bank1_at0(*this, A2GS_B01_TAG), m_bank1_atc(*this, A2GS_B1CXXX_TAG), m_scc(*this, SCC_TAG), m_doc(*this, A2GS_DOC_TAG), @@ -242,7 +240,7 @@ public: required_device m_upperbank, m_upperaux, m_upper00, m_upper01; required_device m_c100bank, m_c300bank, m_c400bank, m_c800bank; required_device m_b0_0000bank, m_b0_0200bank, m_b0_0400bank, m_b0_0800bank, m_b0_2000bank, m_b0_4000bank; - required_device m_lcbank, m_lcaux, m_lc00, m_lc01, m_bank0_atc, m_bank1_at0, m_bank1_atc; + required_device m_lcbank, m_lcaux, m_lc00, m_lc01, m_bank0_atc, m_bank1_atc; required_device m_scc; required_device m_doc; required_device m_iwm; @@ -479,7 +477,6 @@ private: DECLARE_READ8_MEMBER(bank0_c000_r); DECLARE_WRITE8_MEMBER(bank0_c000_w); DECLARE_READ8_MEMBER(bank1_0000_r); - DECLARE_WRITE8_MEMBER(bank1_0000_w); DECLARE_WRITE8_MEMBER(bank1_0000_sh_w); DECLARE_READ8_MEMBER(bank1_c000_r); DECLARE_WRITE8_MEMBER(bank1_c000_w); @@ -1457,7 +1454,6 @@ void apple2gs_state::machine_reset() m_b0_2000bank->set_bank(0); m_b0_4000bank->set_bank(0); m_bank0_atc->set_bank(1); - m_bank1_at0->set_bank(1); m_bank1_atc->set_bank(1); // LC default state: read ROM, write enabled, Dxxx bank 2 @@ -3466,7 +3462,7 @@ WRITE8_MEMBER(apple2gs_state::b1ram4000_w) m_ram_ptr[offset+0x14000] = data; if (offset < 0x2000) { - if (!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) + if ((!(m_shadow & SHAD_HIRESPG2) && !(m_shadow & SHAD_AUXHIRES)) || (!(m_shadow & SHAD_SUPERHIRES))) { auxram0000_w(space, offset+0x4000, data); } @@ -3512,7 +3508,6 @@ WRITE8_MEMBER(apple2gs_state::bank0_c000_w) } READ8_MEMBER(apple2gs_state::bank1_0000_r) { return m_ram_ptr[offset + 0x10000]; } -WRITE8_MEMBER(apple2gs_state::bank1_0000_w) { m_ram_ptr[offset + 0x10000] = data; } READ8_MEMBER(apple2gs_state::bank1_c000_r) { if (offset & 0x2000) offset ^= 0x1000; return m_ram_ptr[offset + 0x1c000]; } WRITE8_MEMBER(apple2gs_state::bank1_c000_w) { if (offset & 0x2000) offset ^= 0x1000; m_ram_ptr[offset + 0x1c000] = data; } WRITE8_MEMBER(apple2gs_state::bank1_0000_sh_w) @@ -3590,7 +3585,7 @@ void apple2gs_state::apple2gs_map(address_map &map) map(0x002000, 0x003fff).m(m_b0_2000bank, FUNC(address_map_bank_device::amap8)); map(0x004000, 0x00bfff).m(m_b0_4000bank, FUNC(address_map_bank_device::amap8)); map(0x00c000, 0x00ffff).m(m_bank0_atc, FUNC(address_map_bank_device::amap8)); - map(0x010000, 0x01bfff).m(m_bank1_at0, FUNC(address_map_bank_device::amap8)); + map(0x010000, 0x01bfff).rw(FUNC(apple2gs_state::bank1_0000_r), FUNC(apple2gs_state::bank1_0000_sh_w)); map(0x01c000, 0x01ffff).m(m_bank1_atc, FUNC(address_map_bank_device::amap8)); /* "Mega II side" - this is basically a 128K IIe on a chip that runs merrily at 1 MHz */ @@ -3705,12 +3700,6 @@ void apple2gs_state::bank0_iolc_map(address_map &map) map(0x5000, 0x7fff).m(m_upper00, FUNC(address_map_bank_device::amap8)); } -void apple2gs_state::bank1_lower48_map(address_map &map) -{ - map(0x0000, 0x0bfff).rw(FUNC(apple2gs_state::bank1_0000_r), FUNC(apple2gs_state::bank1_0000_w)); - map(0xc000, 0x17fff).rw(FUNC(apple2gs_state::bank1_0000_r), FUNC(apple2gs_state::bank1_0000_sh_w)); -} - void apple2gs_state::bank1_iolc_map(address_map &map) { map(0x0000, 0x3fff).rw(FUNC(apple2gs_state::bank1_c000_r), FUNC(apple2gs_state::bank1_c000_w)); @@ -4698,9 +4687,6 @@ void apple2gs_state::apple2gs(machine_config &config) /* Bank 0 - I/O and LC area */ ADDRESS_MAP_BANK(config, A2GS_B0CXXX_TAG).set_map(&apple2gs_state::bank0_iolc_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x4000); - /* Bank 1 - lower 48K */ - ADDRESS_MAP_BANK(config, A2GS_B01_TAG).set_map(&apple2gs_state::bank1_lower48_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0xc000); - /* Bank 1 - I/O and LC area */ ADDRESS_MAP_BANK(config, A2GS_B1CXXX_TAG).set_map(&apple2gs_state::bank1_iolc_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x4000); diff --git a/src/mame/drivers/apricotf.cpp b/src/mame/drivers/apricotf.cpp index 76b7c7ee1ea..7b876a96184 100644 --- a/src/mame/drivers/apricotf.cpp +++ b/src/mame/drivers/apricotf.cpp @@ -55,6 +55,19 @@ // TYPE DEFINITIONS //************************************************************************** +// ======================> f1_daisy_device + +class f1_daisy_device : public device_t, public z80_daisy_chain_interface +{ +public: + f1_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + IRQ_CALLBACK_MEMBER(inta_cb); + +protected: + virtual void device_start() override; +}; + // ======================> f1_state class f1_state : public driver_device @@ -92,11 +105,11 @@ private: required_device m_centronics; required_device m_cent_data_out; required_device m_irqs; - required_shared_ptr m_p_scrollram; - required_shared_ptr m_p_paletteram; + required_shared_ptr m_p_scrollram; + required_shared_ptr m_p_paletteram; required_device m_palette; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); DECLARE_READ16_MEMBER(palette_r); DECLARE_WRITE16_MEMBER(palette_w); @@ -117,7 +130,7 @@ private: // VIDEO //************************************************************************** -uint32_t f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { address_space &program = m_maincpu->space(AS_PROGRAM); int lines = m_200_256 ? 200 : 256; @@ -128,7 +141,7 @@ uint32_t f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, co for (int sx = 0; sx < 80; sx++) { - uint16_t data = program.read_word(addr); + u16 data = program.read_word(addr); if (m_40_80) { @@ -168,7 +181,7 @@ READ16_MEMBER(f1_state::palette_r) WRITE16_MEMBER(f1_state::palette_w) { - uint8_t i,r,g,b; + u8 i,r,g,b; COMBINE_DATA(&m_p_paletteram[offset]); if(ACCESSING_BITS_0_7 && offset) //TODO: offset 0 looks bogus @@ -336,6 +349,34 @@ void apricotf_floppies(device_slot_interface &device) } +DEFINE_DEVICE_TYPE(F1_DAISY, f1_daisy_device, "f1_daisy", "F1 daisy chain abstraction") + +f1_daisy_device::f1_daisy_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, F1_DAISY, tag, owner, clock) + , z80_daisy_chain_interface(mconfig, *this) +{ +} + +void f1_daisy_device::device_start() +{ +} + +IRQ_CALLBACK_MEMBER(f1_daisy_device::inta_cb) +{ + device_z80daisy_interface *intf = daisy_get_irq_device(); + if (intf != nullptr) + return intf->z80daisy_irq_ack(); + else + return 0xff; +} + +static const z80_daisy_config f1_daisy_config[] = +{ + { Z80SIO2_TAG }, + { Z80CTC_TAG }, + { nullptr } +}; + //************************************************************************** // MACHINE DRIVERS @@ -351,6 +392,9 @@ void f1_state::act_f1(machine_config &config) I8086(config, m_maincpu, 14_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &f1_state::act_f1_mem); m_maincpu->set_addrmap(AS_IO, &f1_state::act_f1_io); + m_maincpu->set_irq_acknowledge_callback("daisy", FUNC(f1_daisy_device::inta_cb)); + + F1_DAISY(config, "daisy").set_daisy_config(f1_daisy_config); INPUT_MERGER_ANY_HIGH(config, "irqs").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp index 4468e740f4a..d3480749f66 100644 --- a/src/mame/drivers/asteroid.cpp +++ b/src/mame/drivers/asteroid.cpp @@ -250,6 +250,7 @@ NOTE: Previous program versions, for the second line would only show 4 digits. #include "cpu/m6502/m6502.h" #include "machine/74259.h" #include "machine/output_latch.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "sound/pokey.h" #include "video/avgdvg.h" diff --git a/src/mame/drivers/b2m.cpp b/src/mame/drivers/b2m.cpp index 929c08c7a36..7aeb9cb3c8d 100644 --- a/src/mame/drivers/b2m.cpp +++ b/src/mame/drivers/b2m.cpp @@ -189,11 +189,11 @@ static void b2m_floppies(device_slot_interface &device) void b2m_state::b2m(machine_config &config) { /* basic machine hardware */ - I8080(config, m_maincpu, 2000000); - m_maincpu->set_addrmap(AS_PROGRAM, &b2m_state::b2m_mem); - m_maincpu->set_addrmap(AS_IO, &b2m_state::b2m_io); - m_maincpu->set_vblank_int("screen", FUNC(b2m_state::b2m_vblank_interrupt)); - m_maincpu->set_irq_acknowledge_callback("pic8259", FUNC(pic8259_device::inta_cb)); + i8080_cpu_device &maincpu(I8080(config, m_maincpu, 2000000)); + maincpu.set_addrmap(AS_PROGRAM, &b2m_state::b2m_mem); + maincpu.set_addrmap(AS_IO, &b2m_state::b2m_io); + maincpu.set_vblank_int("screen", FUNC(b2m_state::b2m_vblank_interrupt)); + maincpu.in_inta_func().set("pic8259", FUNC(pic8259_device::acknowledge)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/drivers/bbc.cpp b/src/mame/drivers/bbc.cpp index a43af0061d6..d8966c27c60 100644 --- a/src/mame/drivers/bbc.cpp +++ b/src/mame/drivers/bbc.cpp @@ -1786,8 +1786,7 @@ void bbcm_state::bbcmc(machine_config &config) FLOPPY_CONNECTOR(config, "wd1772:0", bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true); FLOPPY_CONNECTOR(config, "wd1772:1", bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true); - /* eeprom pcd8572 */ - I2CMEM(config, "i2cmem", 0).set_data_size(0x80); + I2C_PCD8572(config, "i2cmem", 0); config.device_remove("rtc"); /* user via */ diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index b3a0a3d6ba5..6018a8374fd 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -101,6 +101,7 @@ Optional (on expansion card) (Viper) #include "machine/gen_latch.h" #include "machine/watchdog.h" #include "machine/bfm_comn.h" +#include "machine/rescap.h" #include "speaker.h" #include "sc1_vfd.lh" diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index f976ba2cd75..64e6a8ae3fc 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -160,6 +160,7 @@ Adder hardware: #include "machine/bfm_bd1.h" // vfd #include "machine/meters.h" +#include "machine/rescap.h" #include "speaker.h" diff --git a/src/mame/drivers/capbowl.cpp b/src/mame/drivers/capbowl.cpp index 96a31ab31ea..c98bc2a67f5 100644 --- a/src/mame/drivers/capbowl.cpp +++ b/src/mame/drivers/capbowl.cpp @@ -90,6 +90,7 @@ #include "emu.h" #include "includes/capbowl.h" +#include "machine/rescap.h" #include "machine/ticket.h" #include "cpu/m6809/m6809.h" #include "sound/2203intf.h" diff --git a/src/mame/drivers/ccastles.cpp b/src/mame/drivers/ccastles.cpp index 0650a3f9463..72f873ce8b3 100644 --- a/src/mame/drivers/ccastles.cpp +++ b/src/mame/drivers/ccastles.cpp @@ -123,6 +123,7 @@ #include "includes/ccastles.h" #include "cpu/m6502/m6502.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "sound/pokey.h" #include "speaker.h" diff --git a/src/mame/drivers/centiped.cpp b/src/mame/drivers/centiped.cpp index a6377f50a2a..6e6488571fd 100644 --- a/src/mame/drivers/centiped.cpp +++ b/src/mame/drivers/centiped.cpp @@ -419,6 +419,7 @@ each direction to assign the boundries. #include "cpu/m6502/m6502.h" #include "cpu/s2650/s2650.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "sound/sn76496.h" #include "sound/pokey.h" diff --git a/src/mame/drivers/circus.cpp b/src/mame/drivers/circus.cpp index 2a1f9bd0c0d..bde941740c6 100644 --- a/src/mame/drivers/circus.cpp +++ b/src/mame/drivers/circus.cpp @@ -35,7 +35,7 @@ C000 Option Switches D000 Paddle Position and Interrupt Reset (where applicable) NOTES: - - Circus: Taito licensed and releasd the game as "Acrobat TV" + - Circus: Taito licensed and released the game as "Acrobat TV" TODO: - generic video timing (vsync, vblank, # of scanlines) @@ -56,7 +56,7 @@ D000 Paddle Position and Interrupt Reset (where applicable) #include "crash.lh" -READ8_MEMBER(circus_state::circus_paddle_r) +uint8_t circus_state::circus_paddle_r() { // also clears irq m_maincpu->set_input_line(0, CLEAR_LINE); @@ -441,6 +441,10 @@ ROM_START( circus ) ROM_REGION( 0x0200, "gfx2", 0 ) // clown sprite ROM_LOAD( "9012.14d", 0x0000, 0x0200, CRC(2fde3930) SHA1(a21e2d342f16a39a07edf4bea8d698a52216ecba) ) + + ROM_REGION( 0x400, "extra_proms", 0 ) // timing? not used by the emulation, dumped for the circusb bootleg but should match + ROM_LOAD( "dm74s570-d4.4d", 0x000, 0x200, BAD_DUMP CRC(aad8da33) SHA1(1d60a6b75b94f5be5bad190ef56e9e3da20bf81a) ) + ROM_LOAD( "dm74s570-d5.5d", 0x200, 0x200, BAD_DUMP CRC(ed2493fa) SHA1(57ee357b68383b0880bfa385820605bede500747) ) ROM_END ROM_START( springbd ) @@ -463,6 +467,36 @@ ROM_START( springbd ) ROM_REGION( 0x0200, "gfx2", 0 ) // clown sprite ROM_LOAD( "93448.14d", 0x0000, 0x0200, CRC(2fde3930) SHA1(a21e2d342f16a39a07edf4bea8d698a52216ecba) ) + + ROM_REGION( 0x400, "extra_proms", 0 ) // timing? not used by the emulation, dumped for the circusb bootleg but should match + ROM_LOAD( "dm74s570-d4.4d", 0x000, 0x200, BAD_DUMP CRC(aad8da33) SHA1(1d60a6b75b94f5be5bad190ef56e9e3da20bf81a) ) + ROM_LOAD( "dm74s570-d5.5d", 0x200, 0x200, BAD_DUMP CRC(ed2493fa) SHA1(57ee357b68383b0880bfa385820605bede500747) ) +ROM_END + +ROM_START( circusb ) // bootleg found both on a PCB and a PROMs blister, labeled 'Circus - punteggio basso' ('Circus - low scoring') + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "6341-1j-a1.1a", 0x1000, 0x0200, CRC(68e710ba) SHA1(63957802f8db3b4ac7bbab83376771ce1744c6b3) ) + ROM_LOAD( "f93448bpc-a2.2a", 0x1200, 0x0200, CRC(b8acdbc5) SHA1(634bb11089f7a57a316b6829954cc4da4523f267) ) + ROM_LOAD( "sn74s474n1-a3.3a", 0x1400, 0x0200, CRC(901dfff6) SHA1(c1f48845456e88d54981608afd00ddb92d97da99) ) + ROM_LOAD( "sn74s474n1-a5.5a", 0x1600, 0x0200, CRC(9dfdae38) SHA1(dc59a5f90a5a49fa071aada67eda768d3ecef010) ) + ROM_LOAD( "sn74s474n1-a6.6a", 0x1800, 0x0200, CRC(c8681cf6) SHA1(681cfea75bee8a86f9f4645e6c6b94b44762dae9) ) + ROM_LOAD( "6341-1j-a7.7a", 0x1a00, 0x0200, CRC(585f633e) SHA1(46133409f42e8cbc095dde576ce07d97b235972d) ) + ROM_LOAD( "6341-1j-a8.8a", 0x1c00, 0x0200, CRC(69cc409f) SHA1(b77289e62313e8535ce40686df7238aa9c0035bc) ) + ROM_LOAD( "6341-1j-a9.9a", 0x1e00, 0x0200, CRC(aff835eb) SHA1(d6d95510d4a046f48358fef01103bcc760eb71ed) ) + ROM_RELOAD( 0xfe00, 0x0200 ) // for the reset and interrupt vectors + + ROM_REGION( 0x0800, "gfx1", 0 ) // character set + ROM_LOAD( "sn74s474n1-c4.4c", 0x0000, 0x0200, CRC(6efc315a) SHA1(d5a4a64a901853fff56df3c65512afea8336aad2) ) + ROM_LOAD( "sn74s474n1-c3.3c", 0x0200, 0x0200, CRC(30d72ef5) SHA1(45fc8285e213bf3906a26205a8c0b22f311fd6c3) ) + ROM_LOAD( "sn74s474n1-c2.2c", 0x0400, 0x0200, CRC(361da7ee) SHA1(6e6fe5b37ccb4c11aa4abbd9b7df772953abfe7e) ) + ROM_LOAD( "sn74s474n1-c1.1c", 0x0600, 0x0200, CRC(1f954bb3) SHA1(62a958b48078caa639b96f62a690583a1c8e83f5) ) + + ROM_REGION( 0x0200, "gfx2", 0 ) // clown sprite + ROM_LOAD( "sn74s474n1-d14.14d", 0x0000, 0x0200, CRC(2fde3930) SHA1(a21e2d342f16a39a07edf4bea8d698a52216ecba) ) + + ROM_REGION( 0x400, "extra_proms", 0 ) // timing? not used by the emulation + ROM_LOAD( "dm74s570-d4.4d", 0x000, 0x200, CRC(aad8da33) SHA1(1d60a6b75b94f5be5bad190ef56e9e3da20bf81a) ) + ROM_LOAD( "dm74s570-d5.5d", 0x200, 0x200, CRC(ed2493fa) SHA1(57ee357b68383b0880bfa385820605bede500747) ) ROM_END ROM_START( robotbwl ) @@ -589,6 +623,7 @@ void circus_state::init_ripcord() GAMEL( 1977, circus, 0, circus, circus, circus_state, init_circus, ROT0, "Exidy / Taito", "Circus / Acrobat TV", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_circus ) GAMEL( 1977, springbd, circus, circus, circus, circus_state, init_circus, ROT0, "bootleg (Sub-Electro)", "Springboard (bootleg of Circus)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_circus ) // looks like a text hack, but we've seen 2 identical copies so it's worth supporting +GAMEL( 1977, circusb, circus, circus, circus, circus_state, init_circus, ROT0, "bootleg", "Circus (bootleg)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_circus ) GAME( 1977, robotbwl, 0, robotbwl, robotbwl, circus_state, init_robotbwl, ROT0, "Exidy", "Robot Bowl", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) GAMEL( 1979, crash, 0, crash, crash, circus_state, init_crash, ROT0, "Exidy", "Crash", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_crash ) GAMEL( 1979, crasha, crash, crash, crash, circus_state, init_crash, ROT0, "Exidy", "Crash (alt)", MACHINE_IMPERFECT_COLORS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND, layout_crash ) diff --git a/src/mame/drivers/cit220.cpp b/src/mame/drivers/cit220.cpp index 9e5ce5d9800..18651203502 100644 --- a/src/mame/drivers/cit220.cpp +++ b/src/mame/drivers/cit220.cpp @@ -15,7 +15,7 @@ and the SCN2674 video timing parameters appear to be identical. #include "emu.h" //#include "bus/rs232/rs232.h" #include "cpu/i8085/i8085.h" -#include "cpu/mcs48/mcs48.h" +#include "machine/cit220_kbd.h" //#include "machine/eeprompar.h" #include "machine/i8251.h" #include "machine/mc68681.h" @@ -52,8 +52,6 @@ private: void vp122_io_map(address_map &map); void char_map(address_map &map); void attr_map(address_map &map); - void keyboard_map(address_map &map); - void kbd_io_map(address_map &map); required_device m_maincpu; required_device m_screen; @@ -130,6 +128,10 @@ SCN2674_DRAW_CHARACTER_MEMBER(cit220_state::draw_character) if (BIT(dots, 2)) dots |= 3; + if (BIT(attrcode, 2)) + dots = ~dots; + if (cursor) + dots = ~dots; for (int i = 0; i < width; i++) { @@ -148,15 +150,6 @@ void cit220_state::attr_map(address_map &map) map(0x0000, 0x2fff).ram(); } -void cit220_state::keyboard_map(address_map &map) -{ - map(0x000, 0xfff).rom().region("keyboard", 0); -} - -void cit220_state::kbd_io_map(address_map &map) -{ -} - static INPUT_PORTS_START( cit220p ) INPUT_PORTS_END @@ -184,15 +177,15 @@ void cit220_state::cit220p(machine_config &config) scn2681_device &duart(SCN2681(config, "duart", 3'686'400)); duart.irq_cb().set_inputline("maincpu", I8085_RST55_LINE); - duart.outport_cb().set("usart", FUNC(i8251_device::write_txc)).bit(3); // 9600 baud? + duart.outport_cb().set("usart", FUNC(i8251_device::write_txc)).bit(3); duart.outport_cb().append("usart", FUNC(i8251_device::write_rxc)).bit(3); duart.outport_cb().append(FUNC(cit220_state::cols_w)).bit(7); - I8251(config, "usart", 4'000'000); + i8251_device &usart(I8251(config, "usart", 4'000'000)); + usart.txd_handler().set("keyboard", FUNC(cit220p_keyboard_device::write_rxd)); - mcs48_cpu_device &kbdmcu(I8035(config, "kbdmcu", 4'608'000)); - kbdmcu.set_addrmap(AS_PROGRAM, &cit220_state::keyboard_map); - kbdmcu.set_addrmap(AS_IO, &cit220_state::kbd_io_map); + cit220p_keyboard_device &keyboard(CIT220P_KEYBOARD(config, "keyboard")); + keyboard.txd_callback().set("usart", FUNC(i8251_device::write_rxd)); } void cit220_state::vp122(machine_config &config) @@ -224,7 +217,7 @@ void cit220_state::vp122(machine_config &config) I8251(config, "usart", 8_MHz_XTAL / 2); - PIT8253(config, "pit", 0); + PIT8253(config, "pit"); // Input clocks are video-related and should differ for 80-column and 132-column modes } @@ -239,9 +232,6 @@ ROM_START( cit220p ) ROM_REGION(0x1000, "chargen", 0) ROM_LOAD( "v20_cg.ic17", 0x0000, 0x1000, CRC(76ef7ca9) SHA1(6e7799ca0a41350fbc369bbbd4ab581150f37b10) ) - - ROM_REGION(0x1000, "keyboard", 0) - ROM_LOAD( "v00_kbd.bin", 0x0000, 0x1000, CRC(f9d24190) SHA1(c4e9ef8188afb18de373f2a537ca9b7a315bfb76) ) ROM_END /************************************************************************************************************** @@ -262,5 +252,5 @@ ROM_START( vp122 ) ROM_LOAD( "223-48700.uk4", 0x0000, 0x2000, CRC(4dbab4bd) SHA1(18e9a23ba22e2096fa529541fa329f5a56740e62) ) ROM_END -COMP(1984, cit220p, 0, 0, cit220p, cit220p, cit220_state, empty_init, "C. Itoh Electronics", "CIT-220+ Video Terminal", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) +COMP(1984, cit220p, 0, 0, cit220p, cit220p, cit220_state, empty_init, "C. Itoh Electronics", "CIT-220+ Video Terminal", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND) COMP(1985, vp122, 0, 0, vp122, cit220p, cit220_state, empty_init, "ADDS", "Viewpoint 122", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_SOUND) diff --git a/src/mame/drivers/cloak.cpp b/src/mame/drivers/cloak.cpp index 3a9606f1cbb..31d1a1a36a8 100644 --- a/src/mame/drivers/cloak.cpp +++ b/src/mame/drivers/cloak.cpp @@ -123,6 +123,7 @@ #include "sound/pokey.h" #include "machine/74259.h" #include "machine/nvram.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "speaker.h" diff --git a/src/mame/drivers/coco12.cpp b/src/mame/drivers/coco12.cpp index 6b14aedbb0e..83f06dd04a9 100644 --- a/src/mame/drivers/coco12.cpp +++ b/src/mame/drivers/coco12.cpp @@ -36,6 +36,7 @@ #include "bus/coco/coco_psg.h" #include "bus/coco/coco_rs232.h" #include "bus/coco/coco_ssc.h" +#include "bus/coco/coco_ram.h" #include "bus/coco/coco_t4426.h" #include "cpu/m6809/m6809.h" @@ -173,6 +174,13 @@ INPUT_PORTS_START( coco_beckerport ) PORT_CONFSETTING( 0x01, DEF_STR( On )) INPUT_PORTS_END +INPUT_PORTS_START( coco_beckerport_dw ) + PORT_START(BECKERPORT_TAG) + PORT_CONFNAME( 0x01, 0x01, "Becker Port" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off )) + PORT_CONFSETTING( 0x01, DEF_STR( On )) +INPUT_PORTS_END + //------------------------------------------------- // INPUT_PORTS( coco_rtc ) //------------------------------------------------- @@ -408,6 +416,7 @@ void coco_cart(device_slot_interface &device) device.option_add("dcmodem", COCO_DCMODEM); device.option_add("orch90", COCO_ORCH90); device.option_add("ssc", COCO_SSC); + device.option_add("ram", COCO_PAK_RAM); device.option_add("games_master", COCO_PAK_GMC); device.option_add("banked_16k", COCO_PAK_BANKED); device.option_add("pak", COCO_PAK); diff --git a/src/mame/drivers/coco3.cpp b/src/mame/drivers/coco3.cpp index e4aed9ff9a8..f105e8a8437 100644 --- a/src/mame/drivers/coco3.cpp +++ b/src/mame/drivers/coco3.cpp @@ -166,9 +166,9 @@ static INPUT_PORTS_START( coco3_joystick ) PORT_BIT( 0xff, 0x80, IPT_AD_STICK_Y) PORT_SENSITIVITY(JOYSTICK_SENSITIVITY) PORT_KEYDELTA(JOYSTICK_DELTA) PORT_MINMAX(0x00,0xFF) PORT_CODE_DEC(KEYCODE_8_PAD) PORT_CODE_INC(KEYCODE_2_PAD) PORT_CODE_DEC(JOYCODE_Y_UP_SWITCH) PORT_CODE_INC(JOYCODE_Y_DOWN_SWITCH) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) PORT_START(JOYSTICK_BUTTONS_TAG) PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Right Button 1") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 1") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Right Button 2") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(1) PORT_CONDITION(CTRL_SEL_TAG, 0x0f, EQUALS, 0x01) PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Left Button 1") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(JOYCODE_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Button 1") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Left Button 2") PORT_CHANGED_MEMBER(DEVICE_SELF, coco3_state, coco_state::keyboard_changed, 0) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_PLAYER(2) PORT_CONDITION(CTRL_SEL_TAG, 0xf0, EQUALS, 0x10) INPUT_PORTS_END @@ -229,6 +229,16 @@ static INPUT_PORTS_START( coco3 ) PORT_INCLUDE( coco_beckerport ) INPUT_PORTS_END +static INPUT_PORTS_START( coco3dw ) + PORT_INCLUDE( coco3_keyboard ) + PORT_INCLUDE( coco3_joystick ) + PORT_INCLUDE( coco_analog_control ) + PORT_INCLUDE( coco_rat_mouse ) + PORT_INCLUDE( coco_lightgun ) + PORT_INCLUDE( coco_rtc ) + PORT_INCLUDE( coco_beckerport_dw ) +INPUT_PORTS_END + static DEVICE_INPUT_DEFAULTS_START( printer ) DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_600 ) DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) @@ -386,4 +396,4 @@ ROM_END COMP( 1986, coco3, coco, 0, coco3, coco3, coco3_state, empty_init, "Tandy Radio Shack", "Color Computer 3 (NTSC)", 0 ) COMP( 1986, coco3p, coco, 0, coco3p, coco3, coco3_state, empty_init, "Tandy Radio Shack", "Color Computer 3 (PAL)", 0 ) COMP( 19??, coco3h, coco, 0, coco3h, coco3, coco3_state, empty_init, "Tandy Radio Shack", "Color Computer 3 (NTSC; HD6309)", MACHINE_UNOFFICIAL ) -COMP( 19??, coco3dw1, coco, 0, coco3dw1, coco3, coco3_state, empty_init, "Tandy Radio Shack", "Color Computer 3 (NTSC; HDB-DOS)", MACHINE_UNOFFICIAL ) +COMP( 19??, coco3dw1, coco, 0, coco3dw1, coco3dw, coco3_state, empty_init, "Tandy Radio Shack", "Color Computer 3 (NTSC; HDB-DOS)", MACHINE_UNOFFICIAL ) diff --git a/src/mame/drivers/cubo.cpp b/src/mame/drivers/cubo.cpp index 75572b5c596..a8c5713533a 100644 --- a/src/mame/drivers/cubo.cpp +++ b/src/mame/drivers/cubo.cpp @@ -1042,7 +1042,7 @@ void cubo_state::cubo(machine_config &config) ADDRESS_MAP_BANK(config, "overlay").set_map(&amiga_state::overlay_2mb_map32).set_options(ENDIANNESS_BIG, 32, 22, 0x200000); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(1024); + I2C_24C08(config, "i2cmem", 0); // AT24C08N akiko_device &akiko(AKIKO(config, "akiko", 0)); akiko.mem_r_callback().set(FUNC(amiga_state::chip_ram_r)); diff --git a/src/mame/drivers/cxg_dominator.cpp b/src/mame/drivers/cxg_dominator.cpp index 166aae962da..ff1e72eb1f3 100644 --- a/src/mame/drivers/cxg_dominator.cpp +++ b/src/mame/drivers/cxg_dominator.cpp @@ -160,7 +160,7 @@ void dominator_state::main_map(address_map &map) map(0x0000, 0x1fff).ram().share("nvram"); map(0x4000, 0x400f).rw(FUNC(dominator_state::input_r), FUNC(dominator_state::leds_w)); map(0x4010, 0x4010).w(FUNC(dominator_state::control_w)); - //map(0x7f00, 0x7fff).nopr(); // mid-opcode dummy read + map(0x7f00, 0x7fff).nopr(); // dummy read on 6502 absolute X page wrap map(0x8000, 0xffff).rom(); } diff --git a/src/mame/drivers/cxhumax.cpp b/src/mame/drivers/cxhumax.cpp index 3f990dd8a32..15fdc62b66a 100644 --- a/src/mame/drivers/cxhumax.cpp +++ b/src/mame/drivers/cxhumax.cpp @@ -1062,7 +1062,7 @@ void cxhumax_state::cxhumax(machine_config &config) INTEL_28F320J3D(config, "flash"); - I2CMEM(config, "eeprom", 0).set_data_size(0x2000); + I2C_24C64(config, "eeprom", 0); // 24LC64 /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); diff --git a/src/mame/drivers/dragon.cpp b/src/mame/drivers/dragon.cpp index 4c59f4df2cc..f244a3ecba7 100644 --- a/src/mame/drivers/dragon.cpp +++ b/src/mame/drivers/dragon.cpp @@ -19,6 +19,7 @@ #include "formats/dmk_dsk.h" #include "formats/sdf_dsk.h" #include "imagedev/floppy.h" +#include "bus/rs232/rs232.h" #include "bus/coco/dragon_amtor.h" #include "bus/coco/dragon_fdc.h" @@ -27,6 +28,7 @@ #include "bus/coco/dragon_sprites.h" #include "bus/coco/coco_pak.h" #include "bus/coco/coco_ssc.h" +#include "bus/coco/coco_ram.h" #include "bus/coco/coco_orch90.h" #include "bus/coco/coco_gmc.h" #include "bus/coco/coco_psg.h" @@ -207,6 +209,7 @@ void dragon_cart(device_slot_interface &device) device.option_add("jcbspch", DRAGON_JCBSPCH); device.option_add("sprites", DRAGON_SPRITES); device.option_add("ssc", COCO_SSC); + device.option_add("ram", COCO_PAK_RAM); device.option_add("orch90", COCO_ORCH90); device.option_add("gmc", COCO_PAK_GMC); device.option_add("pak", COCO_PAK); @@ -343,12 +346,25 @@ void dragon64_state::dragon64(machine_config &config) // acia mos6551_device &acia(MOS6551(config, "acia", 0)); acia.set_xtal(1.8432_MHz_XTAL); + acia.irq_handler().set(FUNC(dragon64_state::acia_irq)); + acia.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, nullptr)); + rs232.rxd_handler().set(acia, FUNC(mos6551_device::write_rxd)); + rs232.dcd_handler().set(acia, FUNC(mos6551_device::write_dcd)); + rs232.dsr_handler().set(acia, FUNC(mos6551_device::write_dsr)); + rs232.cts_handler().set(acia, FUNC(mos6551_device::write_cts)); // software lists SOFTWARE_LIST(config, "dragon_flex_list").set_original("dragon_flex"); SOFTWARE_LIST(config, "dragon_os9_list").set_original("dragon_os9"); } +WRITE_LINE_MEMBER( dragon64_state::acia_irq ) +{ + m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); +} + void dragon64_state::dragon64h(machine_config &config) { dragon64(config); diff --git a/src/mame/drivers/dvk_ksm.cpp b/src/mame/drivers/dvk_ksm.cpp index 4ed4f335f49..4a5a84b1b33 100644 --- a/src/mame/drivers/dvk_ksm.cpp +++ b/src/mame/drivers/dvk_ksm.cpp @@ -151,7 +151,7 @@ private: void update_brg(bool a, bool b, int c); required_shared_ptr m_p_videoram; - required_device m_maincpu; + required_device m_maincpu; required_device m_pic8259; required_device m_i8251line; required_device m_rs232; @@ -416,7 +416,7 @@ void ksm_state::ksm(machine_config &config) I8080(config, m_maincpu, XTAL(15'400'000)/10); m_maincpu->set_addrmap(AS_PROGRAM, &ksm_state::ksm_mem); m_maincpu->set_addrmap(AS_IO, &ksm_state::ksm_io); - m_maincpu->set_irq_acknowledge_callback("pic8259", FUNC(pic8259_device::inta_cb)); + m_maincpu->in_inta_func().set("pic8259", FUNC(pic8259_device::acknowledge)); TIMER(config, "scantimer").configure_scanline(FUNC(ksm_state::scanline_callback), "screen", 0, 1); diff --git a/src/mame/drivers/equites.cpp b/src/mame/drivers/equites.cpp index 2366be1a5a9..c9e0f1bd8bf 100644 --- a/src/mame/drivers/equites.cpp +++ b/src/mame/drivers/equites.cpp @@ -468,7 +468,7 @@ void equites_state::bngotime_map(address_map &map) { equites_common_map(map); map(0x040000, 0x040fff).ram(); - // map(0x180001, 0x180001).w("sound_board", FUNC(ad_60mc01_device::sound_command_w)); // where's this? + map(0x180001, 0x180001).w("sound_board", FUNC(ad_60mc01_device::sound_command_w)); } void splndrbt_state::splndrbt_map(address_map &map) @@ -722,7 +722,7 @@ static INPUT_PORTS_START( hvoltage ) PORT_ADJUSTER(27, "MSM5232 Clock") // approximate factory setting INPUT_PORTS_END -static INPUT_PORTS_START( bngotime ) +static INPUT_PORTS_START( bngotime ) // TODO: possibly still missing something? Couldn't find any use for the unknown inputs PORT_START("IN0") PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) // tilt up, only has effect when ball's in play PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) @@ -730,14 +730,14 @@ static INPUT_PORTS_START( bngotime ) PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) // tilt left, only has effect when ball's in play PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) // spring launcher and tilt up (doubled?) PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_START1 ) // starts game after betting, also changes background before launching first ball - PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON2 ) // buys extra ball after game over PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_GAMBLE_BET ) PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_GAMBLE_TAKE ) PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_COIN1 ) @@ -1742,7 +1742,7 @@ GAME( 1984, bullfgtr, 0, equites, bullfgtr, equites_state, init_equite GAME( 1984, bullfgtrs, bullfgtr, equites, bullfgtr, equites_state, init_equites, ROT90, "Alpha Denshi Co. (Sega license)", "Bull Fighter (Sega)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1985, kouyakyu, 0, equites, kouyakyu, equites_state, init_equites, ROT0, "Alpha Denshi Co.", "The Koukou Yakyuu", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) GAME( 1985, gekisou, 0, gekisou, gekisou, gekisou_state, init_equites, ROT90, "Eastern Corp.", "Gekisou (Japan)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1986, bngotime, 0, bngotime, bngotime, equites_state, init_equites, ROT90, "CLS", "Bingo Time", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // needs verification of the inputs, emulation of the sound board (flag is in the audio device) +GAME( 1986, bngotime, 0, bngotime, bngotime, equites_state, init_equites, ROT90, "CLS", "Bingo Time", MACHINE_SUPPORTS_SAVE ) // emulation of the sound board is imperfect (flag is in the audio device) // Splendor Blast Hardware GAME( 1985, splndrbt, 0, splndrbt, splndrbt, splndrbt_state, init_splndrbt, ROT0, "Alpha Denshi Co.", "Splendor Blast (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/ergo201.cpp b/src/mame/drivers/ergo201.cpp new file mode 100644 index 00000000000..8130028471b --- /dev/null +++ b/src/mame/drivers/ergo201.cpp @@ -0,0 +1,152 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/**************************************************************************** + + Skeleton driver for Micro-Term ERGO 201 terminal. + + The ERGO 201 belongs to one half of a paired series of terminals. Half + of these terminals emulate the VT100 and support a 132 column mode; the + other half emulate the VT52, ADM3A and ACT-5A instead but do appear to + have been influenced by the VT100 in overall design. + + The first members of this series, the MIME 340 (non-VT100 emulation) + and MIME 740 (VT100 emulation), were single units with non-detachable + keyboards like Micro-Term's older ACT and MIME terminals. They were + respectively succeeded by the ERGO 2000 and ERGO 3001 with tiltable + screens and similar but detached keyboards. The ERGO 201 and ERGO 301 + appear to be newer versions of these two with keyboards redesigned yet + again to more closely resemble the VT100. There was also the ERGO 4000, + a portrait-mode terminal displaying 66 lines of 80 characters. + +****************************************************************************/ + +#include "emu.h" +//#include "bus/rs232/rs232.h" +#include "cpu/z80/z80.h" +#include "machine/ay31015.h" +#include "machine/er1400.h" +#include "machine/z80ctc.h" +#include "machine/z80sio.h" +#include "video/tms9927.h" +#include "screen.h" + +class ergo201_state : public driver_device +{ +public: + ergo201_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_earom(*this, "earom") + , m_vtac(*this, "vtac") + , m_chargen(*this, "chargen") + { + } + + void ergo201(machine_config &config); + +private: + u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void earom_latch_w(u8 data); + u8 status_r(); + + void mem_map(address_map &map); + void io_map(address_map &map); + + required_device m_maincpu; + required_device m_earom; + required_device m_vtac; + required_region_ptr m_chargen; +}; + + +u32 ergo201_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + return 0; +} + + +void ergo201_state::earom_latch_w(u8 data) +{ + m_earom->c1_w(BIT(data, 0)); + m_earom->data_w(BIT(data, 1)); + m_earom->c3_w(BIT(data, 2)); + m_earom->c2_w(BIT(data, 3)); + m_earom->clock_w(BIT(data, 4)); +} + +u8 ergo201_state::status_r() +{ + return m_earom->data_r() << 5; +} + +void ergo201_state::mem_map(address_map &map) +{ + map(0x0000, 0x5fff).rom().region("program", 0); + map(0x3000, 0x300f).w(m_vtac, FUNC(tms9927_device::write)); + map(0x4000, 0x4000).w(FUNC(ergo201_state::earom_latch_w)); + map(0x6001, 0x6001).r(FUNC(ergo201_state::status_r)); + map(0x7000, 0x77ff).ram(); + map(0x8000, 0x87ff).ram(); + map(0xc000, 0xc7ff).ram(); +} + +void ergo201_state::io_map(address_map &map) +{ + map.global_mask(0xff); + map(0xf4, 0xf7).rw("dart", FUNC(z80dart_device::cd_ba_r), FUNC(z80dart_device::cd_ba_w)); + map(0xf8, 0xfb).rw("ctc", FUNC(z80ctc_device::read), FUNC(z80ctc_device::write)); +} + + +static INPUT_PORTS_START(ergo201) +INPUT_PORTS_END + +static const z80_daisy_config daisy_chain[] = +{ + { "ctc" }, + { "dart" }, + { nullptr } +}; + +void ergo201_state::ergo201(machine_config &config) +{ + Z80(config, m_maincpu, 16.313_MHz_XTAL / 4); // SGS Z8400AB1 (divider guessed) + m_maincpu->set_addrmap(AS_PROGRAM, &ergo201_state::mem_map); + m_maincpu->set_addrmap(AS_IO, &ergo201_state::io_map); + m_maincpu->set_daisy_config(daisy_chain); + + z80ctc_device &ctc(Z80CTC(config, "ctc", 16.313_MHz_XTAL / 4)); // SGS Z8430AB1 + ctc.zc_callback<0>().set("dart", FUNC(z80dart_device::rxca_w)); + ctc.zc_callback<1>().set("dart", FUNC(z80dart_device::txca_w)); + ctc.zc_callback<2>().set("dart", FUNC(z80dart_device::rxtxcb_w)); + ctc.intr_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + z80dart_device &dart(Z80DART(config, "dart", 16.313_MHz_XTAL / 4)); // Zilog Z8470A PS + dart.out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + AY31015(config, "uart"); // GI AY-3-1015D + + ER1400(config, m_earom); // GI ER-1400 + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(16.313_MHz_XTAL, 855, 0, 720, 318, 0, 300); + screen.set_screen_update(FUNC(ergo201_state::screen_update)); + + CRT5037(config, m_vtac, 16.313_MHz_XTAL / 9); // TI TMS9937NL + m_vtac->set_char_width(9); + m_vtac->set_screen("screen"); +} + + +ROM_START(ergo201) + ROM_REGION(0x6000, "program", 0) + ROM_LOAD("201.u18", 0x0000, 0x2000, CRC(fec9fa3c) SHA1(3c1f9de9f62e74fbd1c9b67736d0959c0f6b46b1)) // M5L2764K + ROM_LOAD("r1.0_special_5786.u73", 0x2000, 0x2000, CRC(5a31b6bc) SHA1(6929fa8f6d481790cd43732a9a97a9110ad9fb6c)) // MBM2764-25 + ROM_LOAD("201.u17", 0x4000, 0x2000, CRC(e7197403) SHA1(96fff6fb30eeac616d71da731b0ea79c8cd35096)) // M5L2764K + + ROM_REGION(0x1000, "chargen", 0) + ROM_LOAD("201.u53", 0x0000, 0x1000, CRC(907dac04) SHA1(5bae6680f1ef3f5335a223bdf403e8f3ef272430)) // MBM2732A-35 +ROM_END + +COMP(1983, ergo201, 0, 0, ergo201, ergo201, ergo201_state, empty_init, "Micro-Term", "ERGO 201 Kurzweil", MACHINE_IS_SKELETON) diff --git a/src/mame/drivers/ertictac.cpp b/src/mame/drivers/ertictac.cpp index 6b2ec938466..28abf1dfb12 100644 --- a/src/mame/drivers/ertictac.cpp +++ b/src/mame/drivers/ertictac.cpp @@ -26,7 +26,6 @@ PCB has a single OSC at 24MHz #include "includes/archimds.h" #include "cpu/arm/arm.h" #include "machine/aakart.h" -#include "machine/i2cmem.h" #include "screen.h" @@ -219,17 +218,13 @@ INTERRUPT_GEN_MEMBER(ertictac_state::ertictac_podule_irq) archimedes_request_irq_b(ARCHIMEDES_IRQB_PODULE_IRQ); } -/* TODO: Are we sure that this HW have I2C device? */ -#define NVRAM_SIZE 256 -#define NVRAM_PAGE_SIZE 0 /* max size of one write request */ - void ertictac_state::ertictac(machine_config &config) { ARM(config, m_maincpu, 24_MHz_XTAL/3); /* guess, 12MHz 8MHz or 6MHz, what's the correct divider 2, 3 or 4? */ m_maincpu->set_addrmap(AS_PROGRAM, &ertictac_state::ertictac_map); m_maincpu->set_periodic_int(FUNC(ertictac_state::ertictac_podule_irq), attotime::from_hz(60)); // FIXME: timing of this - I2CMEM(config, "i2cmem", 0).set_page_size(NVRAM_PAGE_SIZE).set_data_size(NVRAM_SIZE); + I2C_24C02(config, "i2cmem", 0); // TODO: PCF8583 // TODO: Are we sure that this HW have I2C device? // AAKART(config, m_kart, 24_MHz_XTAL/3); // TODO: frequency diff --git a/src/mame/drivers/fastinvaders.cpp b/src/mame/drivers/fastinvaders.cpp index be476450b7a..1a4e70c3681 100644 --- a/src/mame/drivers/fastinvaders.cpp +++ b/src/mame/drivers/fastinvaders.cpp @@ -634,7 +634,7 @@ void fastinvaders_state::fastinvaders(machine_config &config) // m_maincpu->set_addrmap(AS_IO, &fastinvaders_state::fastinvaders_io_map); // m_maincpu->set_vblank_int("screen", FUNC(fastinvaders_state::irq0_line_hold)); m_maincpu->in_sid_func().set(FUNC(fastinvaders_state::sid_read)); - m_maincpu->set_irq_acknowledge_callback("pic8259", FUNC(pic8259_device::inta_cb)); + m_maincpu->in_inta_func().set("pic8259", FUNC(pic8259_device::acknowledge)); TIMER(config, "scantimer").configure_scanline(FUNC(fastinvaders_state::scanline_timer), "screen", 0, 1); diff --git a/src/mame/drivers/fidel_desdis.cpp b/src/mame/drivers/fidel_desdis.cpp index cbe105e2dca..545d40ebbb2 100644 --- a/src/mame/drivers/fidel_desdis.cpp +++ b/src/mame/drivers/fidel_desdis.cpp @@ -96,12 +96,13 @@ protected: template TIMER_DEVICE_CALLBACK_MEMBER(irq_off) { m_maincpu->set_input_line(Line, CLEAR_LINE); } // I/O handlers + void update_lcd(); virtual DECLARE_WRITE8_MEMBER(control_w); virtual DECLARE_WRITE8_MEMBER(lcd_w); virtual DECLARE_READ8_MEMBER(input_r); - u8 m_select; - u32 m_lcd_data; + u8 m_select = 0; + u32 m_lcd_data = 0; }; void desdis_state::init_fdes2100d() @@ -111,10 +112,6 @@ void desdis_state::init_fdes2100d() void desdis_state::machine_start() { - // zerofill - m_select = 0; - m_lcd_data = 0; - // register for savestates save_item(NAME(m_select)); save_item(NAME(m_lcd_data)); @@ -140,9 +137,8 @@ private: void fdes2265_map(address_map &map); void fdes2325_map(address_map &map); - // I/O handlers, slightly different (control_w is d0 instead of d7, lcd_w is inverted) + // I/O handlers, slightly different (control_w is d0 instead of d7) virtual DECLARE_WRITE8_MEMBER(control_w) override { desdis_state::control_w(space, offset, data << 7); } - virtual DECLARE_WRITE8_MEMBER(lcd_w) override { desdis_state::lcd_w(space, offset, ~data); } }; void desmas_state::init_fdes2265() @@ -169,10 +165,17 @@ void desmas_state::init_fdes2265() // TTL/generic +void desdis_state::update_lcd() +{ + u8 mask = (m_select & 8) ? 0 : 0xff; + for (int i = 0; i < 4; i++) + m_display->write_row(i+2, (m_lcd_data >> (8*i) & 0xff) ^ mask); + + m_display->update(); +} + WRITE8_MEMBER(desdis_state::control_w) { - u8 q3_old = m_select & 8; - // a0-a2,d7: 74259 u8 mask = 1 << offset; m_select = (m_select & ~mask) | ((data & 0x80) ? mask : 0); @@ -192,13 +195,8 @@ WRITE8_MEMBER(desdis_state::control_w) if (m_rombank != nullptr) m_rombank->set_entry(~m_select >> 2 & 1); - // 74259 Q3: lcd common, update on rising edge - if (~q3_old & m_select & 8) - { - for (int i = 0; i < 4; i++) - m_display->write_row(i+2, m_lcd_data >> (8*i) & 0xff); - } - m_display->update(); + // 74259 Q3: lcd polarity + update_lcd(); } WRITE8_MEMBER(desdis_state::lcd_w) @@ -210,6 +208,8 @@ WRITE8_MEMBER(desdis_state::lcd_w) m_lcd_data = (m_lcd_data & ~mask) | ((data >> i & 1) ? 0 : mask); mask <<= 8; } + + update_lcd(); } READ8_MEMBER(desdis_state::input_r) diff --git a/src/mame/drivers/fidel_phantom.cpp b/src/mame/drivers/fidel_phantom.cpp index 60f549c4a92..66921ca16a0 100644 --- a/src/mame/drivers/fidel_phantom.cpp +++ b/src/mame/drivers/fidel_phantom.cpp @@ -76,12 +76,10 @@ private: void main_map(address_map &map); TIMER_DEVICE_CALLBACK_MEMBER(motors_timer); - DECLARE_WRITE8_MEMBER(mux_w); + void update_lcd(); + DECLARE_WRITE8_MEMBER(control_w); DECLARE_WRITE8_MEMBER(lcd_w); - DECLARE_WRITE8_MEMBER(lcd_mask_w); DECLARE_WRITE8_MEMBER(motors_w); - DECLARE_WRITE8_MEMBER(led_w); - DECLARE_WRITE8_MEMBER(rombank_w); DECLARE_READ8_MEMBER(input_r); DECLARE_READ8_MEMBER(motors_r); DECLARE_READ8_MEMBER(irq_ack_r); @@ -89,8 +87,7 @@ private: DECLARE_READ8_MEMBER(vmotor_ff_clear_r); void update_pieces_position(int state); - uint8_t m_mux; - uint8_t m_lcd_mask; + uint8_t m_select; uint32_t m_lcd_data; uint8_t m_motors_ctrl; uint8_t m_hmotor_pos; @@ -108,8 +105,7 @@ void phantom_state::machine_start() { m_out_motor.resolve(); - save_item(NAME(m_mux)); - save_item(NAME(m_lcd_mask)); + save_item(NAME(m_select)); save_item(NAME(m_lcd_data)); save_item(NAME(m_motors_ctrl)); save_item(NAME(m_hmotor_pos)); @@ -125,8 +121,7 @@ void phantom_state::machine_start() void phantom_state::machine_reset() { - m_mux = 0; - m_lcd_mask = 0; + m_select = 0; m_lcd_data = 0; m_motors_ctrl = 0; m_hmotor_pos = 0xff; @@ -148,6 +143,10 @@ void phantom_state::init_fphantom() } +/****************************************************************************** + Motor Sim +******************************************************************************/ + TIMER_DEVICE_CALLBACK_MEMBER(phantom_state::motors_timer) { if (m_motors_ctrl & 0x03) m_vmotor_sensor0_ff = true; @@ -212,25 +211,31 @@ void phantom_state::update_pieces_position(int state) I/O ******************************************************************************/ -WRITE8_MEMBER(phantom_state::mux_w) +void phantom_state::update_lcd() { + u8 mask = (m_select & 0x80) ? 0xff : 0; + for (int i = 0; i < 4; i++) + m_display->write_row(i+1, (m_lcd_data >> (8*i) & 0xff) ^ mask); + + m_display->update(); +} + +WRITE8_MEMBER(phantom_state::control_w) +{ + // a0-a2,d1: 74259 uint8_t mask = 1 << offset; - m_mux = (m_mux & ~mask) | ((data & 0x02) ? mask : 0); -} + m_select = (m_select & ~mask) | ((data & 0x02) ? mask : 0); -WRITE8_MEMBER(phantom_state::lcd_mask_w) -{ - m_lcd_mask = (data & 0x02) ? 0x00 : 0xff; -} + // 74259 Q0-Q3: 7442 a0-a3 + // 7442 0-8: led data, input mux + // 74259 Q4: led select + m_display->matrix_partial(0, 1, BIT(~m_select, 4), 1 << (m_select & 0xf), false); -WRITE8_MEMBER(phantom_state::led_w) -{ - m_display->matrix_partial(0, 2, 1, BIT(~data, 7) << m_mux); -} + // 74259 Q6: bookrom bank + m_rombank->set_entry(BIT(m_select, 6)); -WRITE8_MEMBER(phantom_state::rombank_w) -{ - m_rombank->set_entry(data & 1); + // 74259 Q7: lcd polarity + update_lcd(); } WRITE8_MEMBER(phantom_state::motors_w) @@ -254,38 +259,36 @@ WRITE8_MEMBER(phantom_state::motors_w) WRITE8_MEMBER(phantom_state::lcd_w) { - data ^= m_lcd_mask; - + // a0-a2,d0,d2,d4,d6: 4*74259 to lcd digit segments u32 mask = bitswap<8>(1 << offset,3,7,6,0,1,2,4,5); for (int i = 0; i < 4; i++) { m_lcd_data = (m_lcd_data & ~mask) | (BIT(data, i * 2) ? mask : 0); mask <<= 8; - - m_display->write_row(i+2, m_lcd_data >> (8*i) & 0xff); } - m_display->update(); + update_lcd(); } READ8_MEMBER(phantom_state::input_r) { + uint8_t mux = m_select & 0xf; uint8_t data = 0xff; - if (m_mux == 8) + if (mux == 8) { if (BIT(m_input->read(), offset * 2 + 1)) data &= ~0x40; if (BIT(m_input->read(), offset * 2 + 0)) data &= ~0x80; } else if (offset < 4) { - if (BIT(m_board->read_file(offset * 2 + 1), m_mux)) data &= ~0x40; - if (BIT(m_board->read_file(offset * 2 + 0), m_mux)) data &= ~0x80; + if (BIT(m_board->read_file(offset * 2 + 1), mux)) data &= ~0x40; + if (BIT(m_board->read_file(offset * 2 + 0), mux)) data &= ~0x80; } else { - if (BIT(m_board->read_file( 8 + (offset & 1)), m_mux)) data &= ~0x40; // black captured pieces - if (BIT(m_board->read_file(11 - (offset & 1)), m_mux)) data &= ~0x80; // white captured pieces + if (BIT(m_board->read_file( 8 + (offset & 1)), mux)) data &= ~0x40; // black captured pieces + if (BIT(m_board->read_file(11 - (offset & 1)), mux)) data &= ~0x80; // white captured pieces } return data; @@ -341,10 +344,7 @@ READ8_MEMBER(phantom_state::vmotor_ff_clear_r) void phantom_state::main_map(address_map &map) { map(0x0000, 0x1fff).ram(); - map(0x2000, 0x2003).w(FUNC(phantom_state::mux_w)); - map(0x2004, 0x2004).w(FUNC(phantom_state::led_w)); - map(0x2006, 0x2006).w(FUNC(phantom_state::rombank_w)); - map(0x20ff, 0x20ff).w(FUNC(phantom_state::lcd_mask_w)); + map(0x2000, 0x2007).mirror(0x00f8).w(FUNC(phantom_state::control_w)); map(0x2100, 0x2107).w(FUNC(phantom_state::lcd_w)).nopr(); map(0x2200, 0x2200).w(FUNC(phantom_state::motors_w)); map(0x2400, 0x2405).r(FUNC(phantom_state::input_r)); @@ -399,8 +399,8 @@ void phantom_state::fphantom(machine_config &config) TIMER(config, "motors_timer").configure_periodic(FUNC(phantom_state::motors_timer), attotime::from_hz(120)); /* video hardware */ - PWM_DISPLAY(config, m_display).set_size(2+4, 9); - m_display->set_segmask(0x3c, 0x7f); + PWM_DISPLAY(config, m_display).set_size(1+4, 9); + m_display->set_segmask(0x1e, 0x7f); config.set_default_layout(layout_fidel_phantom); diff --git a/src/mame/drivers/fp6000.cpp b/src/mame/drivers/fp6000.cpp index 7c30866c595..9a7403aba34 100644 --- a/src/mame/drivers/fp6000.cpp +++ b/src/mame/drivers/fp6000.cpp @@ -1,278 +1,283 @@ -// license:BSD-3-Clause -// copyright-holders:Angelo Salese +// license: BSD-3-Clause +// copyright-holders: Angelo Salese, Dirk Best /*************************************************************************** Casio FP-6000 - preliminary driver by Angelo Salese - TODO: - - keyboard; - - fdc / cmt; + - Fix cassette (SAVE is at 300 baud Kansas City format, loadable + on the super80, but LOAD throws RW error). + - Floppy/HDD + - Printer - gvram color pen is a rather crude guess (the layer is monochrome on BASIC?); - everything else - Debug trick for the keyboard: - - bp 0xfc93e, ip+=2 then define al = ASCII code - ****************************************************************************/ #include "emu.h" #include "cpu/i86/i86.h" +#include "machine/pic8259.h" +#include "machine/pit8253.h" #include "video/mc6845.h" +#include "sound/spkrdev.h" +#include "bus/centronics/ctronics.h" +#include "machine/fp6000_kbd.h" +#include "imagedev/cassette.h" #include "emupal.h" #include "screen.h" +#include "speaker.h" +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + class fp6000_state : public driver_device { public: fp6000_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_gvram(*this, "gvram"), - m_vram(*this, "vram"), m_maincpu(*this, "maincpu"), + m_pic(*this, "pic"), + m_pit(*this, "pit"), m_crtc(*this, "crtc"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_speaker(*this, "speaker"), + m_cassette(*this, "cassette"), + m_centronics(*this, "centronics"), + m_gvram(*this, "gvram"), + m_vram(*this, "vram"), + m_pcg(*this, "pcg") { } void fp6000(machine_config &config); -private: - uint8_t *m_char_rom; - required_shared_ptr m_gvram; - required_shared_ptr m_vram; - uint8_t m_crtc_vreg[0x100],m_crtc_index; - - struct { - uint16_t cmd; - }m_key; - DECLARE_READ8_MEMBER(fp6000_pcg_r); - DECLARE_WRITE8_MEMBER(fp6000_pcg_w); - DECLARE_WRITE8_MEMBER(fp6000_6845_address_w); - DECLARE_WRITE8_MEMBER(fp6000_6845_data_w); - DECLARE_READ8_MEMBER(fp6000_key_r); - DECLARE_WRITE8_MEMBER(fp6000_key_w); - DECLARE_READ16_MEMBER(unk_r); - DECLARE_READ16_MEMBER(ex_board_r); - DECLARE_READ16_MEMBER(pit_r); +protected: virtual void machine_start() override; virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_fp6000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + +private: required_device m_maincpu; + required_device m_pic; + required_device m_pit; required_devicem_crtc; required_device m_gfxdecode; required_device m_palette; + required_device m_speaker; + required_device m_cassette; + required_device m_centronics; + + required_shared_ptr m_gvram; + required_shared_ptr m_vram; + required_shared_ptr m_pcg; + void fp6000_io(address_map &map); void fp6000_map(address_map &map); + + emu_timer *m_pit_timer; + void pit_timer0_w(int state); + TIMER_CALLBACK_MEMBER(pit_timer0_clear); + void pit_timer2_w(int state); + + uint8_t port_08_r(); + void port_08_w(uint8_t data); + uint8_t port_09_r(); + void port_09_w(uint8_t data); + void port_0a_w(uint8_t data); + uint8_t port_0b_r(); + void port_0b_w(uint8_t data); + uint8_t port_0c_r(); + void port_0c_w(uint8_t data); + uint8_t port_0d_r(); + void port_0d_w(uint8_t data); + uint8_t port_0e_r(); + uint8_t port_0f_r(); + void port_0f_w(uint8_t data); + + MC6845_UPDATE_ROW(crtc_update_row); + DECLARE_READ16_MEMBER(unk_r); + + void centronics_busy_w(int state) { m_centronics_busy = state; }; + void centronics_fault_w(int state) { m_centronics_fault = state; }; + void centronics_perror_w(int state) { m_centronics_perror = state; }; + + uint8_t m_port_0a; + + int m_centronics_busy; + int m_centronics_fault; + int m_centronics_perror; }; -void fp6000_state::video_start() -{ -} -#define mc6845_h_char_total (m_crtc_vreg[0]) -#define mc6845_h_display (m_crtc_vreg[1]) -#define mc6845_h_sync_pos (m_crtc_vreg[2]) -#define mc6845_sync_width (m_crtc_vreg[3]) -#define mc6845_v_char_total (m_crtc_vreg[4]) -#define mc6845_v_total_adj (m_crtc_vreg[5]) -#define mc6845_v_display (m_crtc_vreg[6]) -#define mc6845_v_sync_pos (m_crtc_vreg[7]) -#define mc6845_mode_ctrl (m_crtc_vreg[8]) -#define mc6845_tile_height (m_crtc_vreg[9]+1) -#define mc6845_cursor_y_start (m_crtc_vreg[0x0a]) -#define mc6845_cursor_y_end (m_crtc_vreg[0x0b]) -#define mc6845_start_addr (((m_crtc_vreg[0x0c]<<8) & 0x3f00) | (m_crtc_vreg[0x0d] & 0xff)) -#define mc6845_cursor_addr (((m_crtc_vreg[0x0e]<<8) & 0x3f00) | (m_crtc_vreg[0x0f] & 0xff)) -#define mc6845_light_pen_addr (((m_crtc_vreg[0x10]<<8) & 0x3f00) | (m_crtc_vreg[0x11] & 0xff)) -#define mc6845_update_addr (((m_crtc_vreg[0x12]<<8) & 0x3f00) | (m_crtc_vreg[0x13] & 0xff)) - - -uint32_t fp6000_state::screen_update_fp6000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int x,y; - int xi,yi; - uint8_t *gfx_rom = memregion("pcg")->base(); - uint32_t count; - - count = 0; - - for(y=0;y<400;y++) - { - for(x=0;x<640/4;x++) - { - for(xi=0;xi<4;xi++) - { - int dot = (m_gvram[count] >> (12-xi*4)) & 0xf; - - if(y < 400 && x*4+xi < 640) /* TODO: safety check */ - bitmap.pix16(y, x*4+xi) = m_palette->pen(dot); - } - - count++; - } - } - - for(y=0;y> 8; - int pen; - - for(yi=0;yi> (7-xi) & 1) ? color : -1; - - if(pen != -1) - if(y*mc6845_tile_height < 400 && x*8+xi < 640) /* TODO: safety check */ - bitmap.pix16(y*mc6845_tile_height+yi, x*8+xi) = m_palette->pen(pen); - } - } - } - } - - /* quick and dirty way to do the cursor */ - for(yi=0;yipen(7); - } - } - } - - return 0; -} - -READ8_MEMBER(fp6000_state::fp6000_pcg_r) -{ - return m_char_rom[offset]; -} - -WRITE8_MEMBER(fp6000_state::fp6000_pcg_w) -{ - m_char_rom[offset] = data; - m_gfxdecode->gfx(0)->mark_dirty(offset >> 4); -} - -WRITE8_MEMBER(fp6000_state::fp6000_6845_address_w) -{ - m_crtc_index = data; - m_crtc->address_w(data); -} - -WRITE8_MEMBER(fp6000_state::fp6000_6845_data_w) -{ - m_crtc_vreg[m_crtc_index] = data; - m_crtc->register_w(data); -} +//************************************************************************** +// ADDRESS MAPS +//************************************************************************** void fp6000_state::fp6000_map(address_map &map) { map.unmap_value_high(); map(0x00000, 0xbffff).ram(); - map(0xc0000, 0xdffff).ram().share("gvram");//gvram + map(0xc0000, 0xdffff).ram().share("gvram"); map(0xe0000, 0xe0fff).ram().share("vram"); - map(0xe7000, 0xe7fff).rw(FUNC(fp6000_state::fp6000_pcg_r), FUNC(fp6000_state::fp6000_pcg_w)); + map(0xe7000, 0xe7fff).ram().share("pcg"); map(0xf0000, 0xfffff).rom().region("ipl", 0); } -/* Hack until I understand what UART is this one ... */ -READ8_MEMBER(fp6000_state::fp6000_key_r) -{ - if(offset) - { - switch(m_key.cmd) - { - case 0x7e15: return 3; - case 0x1b15: return 1; - case 0x2415: return 0; - default: printf("%04x\n",m_key.cmd); - } - return 0; - } - - return 0x40; -} - -WRITE8_MEMBER(fp6000_state::fp6000_key_w) -{ - if(offset) - m_key.cmd = (data & 0xff) | (m_key.cmd << 8); - else - m_key.cmd = (data << 8) | (m_key.cmd & 0xff); -} - -READ16_MEMBER(fp6000_state::unk_r) -{ - return 0x40; -} - -READ16_MEMBER(fp6000_state::ex_board_r) -{ - return 0xffff; -} - -READ16_MEMBER(fp6000_state::pit_r) -{ - return machine().rand(); -} - void fp6000_state::fp6000_io(address_map &map) { map.unmap_value_high(); - map(0x08, 0x09).r(FUNC(fp6000_state::ex_board_r)); // BIOS of some sort ... - map(0x0a, 0x0b).portr("DSW"); // installed RAM id? - map(0x10, 0x11).nopr(); - map(0x20, 0x23).rw(FUNC(fp6000_state::fp6000_key_r), FUNC(fp6000_state::fp6000_key_w)).umask16(0x00ff); - map(0x38, 0x39).r(FUNC(fp6000_state::pit_r)); // pit? - map(0x70, 0x70).w(FUNC(fp6000_state::fp6000_6845_address_w)); - map(0x72, 0x72).w(FUNC(fp6000_state::fp6000_6845_data_w)); + map(0x08, 0x08).r(FUNC(fp6000_state::port_08_r)); + map(0x08, 0x08).w(FUNC(fp6000_state::port_08_w)); + map(0x09, 0x09).r(FUNC(fp6000_state::port_09_r)); + map(0x09, 0x09).w(FUNC(fp6000_state::port_09_w)); + map(0x0a, 0x0a).lr8(NAME([this] () { return ioport("cpudsw")->read(); })); + map(0x0a, 0x0a).w(FUNC(fp6000_state::port_0a_w)); + map(0x0b, 0x0b).r(FUNC(fp6000_state::port_0b_r)); + map(0x0b, 0x0b).w(FUNC(fp6000_state::port_0b_w)); + map(0x0c, 0x0c).r(FUNC(fp6000_state::port_0c_r)); + map(0x0c, 0x0c).w(FUNC(fp6000_state::port_0c_w)); + map(0x0d, 0x0d).r(FUNC(fp6000_state::port_0d_r)); + map(0x0d, 0x0d).w(FUNC(fp6000_state::port_0d_w)); + map(0x0e, 0x0e).r(FUNC(fp6000_state::port_0e_r)); + map(0x0e, 0x0e).w("centronics_data_out", FUNC(output_latch_device::write)); + map(0x0f, 0x0f).r(FUNC(fp6000_state::port_0f_r)); + map(0x0f, 0x0f).w(FUNC(fp6000_state::port_0f_w)); + // 10-17 floppy? + map(0x14, 0x14).lr8(NAME([this] () { return ioport("floppydsw")->read(); })); + map(0x20, 0x23).rw("keyboard", FUNC(fp6000_kbd_device::read), FUNC(fp6000_kbd_device::write)).umask16(0x00ff); + map(0x30, 0x33).rw(m_pic, FUNC(pic8259_device::read), FUNC(pic8259_device::write)).umask16(0x00ff); + map(0x38, 0x3f).rw(m_pit, FUNC(pit8253_device::read), FUNC(pit8253_device::write)).umask16(0x00ff); + // 50-5f dma? + map(0x70, 0x70).w(m_crtc, FUNC(mc6845_device::address_w)); + map(0x72, 0x72).rw(m_crtc, FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w)); map(0x74, 0x75).r(FUNC(fp6000_state::unk_r)); //bit 6 busy flag } -/* Input ports */ + +//************************************************************************** +// INPUT PORT DEFINITIONS +//************************************************************************** + static INPUT_PORTS_START( fp6000 ) - PORT_START("DSW") - PORT_DIPNAME( 0x01, 0x00, "DSW" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xe0, 0x40, "Installed RAM banks" ) - PORT_DIPSETTING( 0xe0, "0" ) - PORT_DIPSETTING( 0xc0, "1" ) - PORT_DIPSETTING( 0xa0, "2" ) - PORT_DIPSETTING( 0x80, "3" ) - PORT_DIPSETTING( 0x60, "4" ) - PORT_DIPSETTING( 0x40, "5" ) - PORT_DIPSETTING( 0x20, "6 (INVALID)" ) //exceeds 768KB limit (writes to gvram et al) - PORT_DIPSETTING( 0x00, "7 (INVALID)" ) + PORT_START("cpudsw") + PORT_DIPNAME(0x1f, 0x1e, "Printer type") + PORT_DIPSETTING( 0x1f, "0") + PORT_DIPSETTING( 0x1e, "1") + PORT_DIPSETTING( 0x1d, "2") + PORT_DIPSETTING( 0x1c, "3") + PORT_DIPSETTING( 0x1b, "4") + PORT_DIPSETTING( 0x1a, "5") + PORT_DIPSETTING( 0x19, "6") + PORT_DIPSETTING( 0x18, "7") + PORT_DIPSETTING( 0x17, "8") + PORT_DIPSETTING( 0x16, "9") + PORT_DIPSETTING( 0x15, "10") + PORT_DIPSETTING( 0x14, "11") + PORT_DIPSETTING( 0x13, "12") + PORT_DIPSETTING( 0x12, "13") + PORT_DIPSETTING( 0x11, "14") + PORT_DIPSETTING( 0x10, "15") + PORT_DIPSETTING( 0x0f, "16") + PORT_DIPSETTING( 0x0e, "17") + PORT_DIPSETTING( 0x0d, "18") + PORT_DIPSETTING( 0x0c, "19") + PORT_DIPSETTING( 0x0b, "20") + PORT_DIPSETTING( 0x0a, "21") + PORT_DIPSETTING( 0x09, "22") + PORT_DIPSETTING( 0x08, "23") + PORT_DIPSETTING( 0x07, "24") + PORT_DIPSETTING( 0x06, "25") + PORT_DIPSETTING( 0x05, "26") + PORT_DIPSETTING( 0x04, "27") + PORT_DIPSETTING( 0x03, "28") + PORT_DIPSETTING( 0x02, "29") + PORT_DIPSETTING( 0x01, "30") + PORT_DIPSETTING( 0x00, "31") + PORT_DIPNAME(0xe0, 0x40, "Installed RAM banks") + PORT_DIPSETTING( 0xe0, "0") + PORT_DIPSETTING( 0xc0, "1") + PORT_DIPSETTING( 0xa0, "2") + PORT_DIPSETTING( 0x80, "3") + PORT_DIPSETTING( 0x60, "4") + PORT_DIPSETTING( 0x40, "5") + PORT_DIPSETTING( 0x20, "6 (INVALID)") // exceeds 768KB limit (writes to gvram et al) + PORT_DIPSETTING( 0x00, "7 (INVALID)") + + PORT_START("floppydsw") + PORT_DIPNAME(0x07, 0x07, "Floppy type?") + PORT_DIPSETTING( 0x07, DEF_STR( None )) + PORT_DIPSETTING( 0x06, "1") + PORT_DIPSETTING( 0x05, "2") + PORT_DIPSETTING( 0x04, "3") + PORT_DIPSETTING( 0x03, "4") + PORT_DIPSETTING( 0x02, "5") + PORT_DIPSETTING( 0x01, "6") + PORT_DIPSETTING( 0x00, "7") + PORT_DIPUNKNOWN(0x08, 0x08) + PORT_DIPUNKNOWN(0x10, 0x10) + PORT_DIPUNKNOWN(0x20, 0x20) + PORT_DIPUNKNOWN(0x40, 0x40) + PORT_DIPUNKNOWN(0x80, 0x80) INPUT_PORTS_END -static const gfx_layout fp6000_charlayout = + +//************************************************************************** +// VIDEO EMULATION +//************************************************************************** + +READ16_MEMBER(fp6000_state::unk_r) +{ + // 7------- + // -6------ ? + // --5----- + // ---4---- + // ----3--- + // -----2-- + // ------1- screen lines: 0=200, 1=400 + // -------0 + + return 0x40; +} + +MC6845_UPDATE_ROW( fp6000_state::crtc_update_row ) +{ + const pen_t *pen = m_palette->pens(); + uint8_t *pcg = reinterpret_cast(m_pcg.target()); + uint32_t *vram = reinterpret_cast(m_gvram.target()); + + for (int x = 0; x < x_count; x++) + { + // text mode + uint8_t code = (m_vram[ma + x] >> 0) & 0xff; + uint8_t color = (m_vram[ma + x] >> 8) & 0x0f; + uint8_t gfx = pcg[(code << 4) | ra]; + + // cursor? + if (x == cursor_x) + gfx = 0xff; + + // draw 8 pixels of the character + for (int i = 0; i < 8; i++) + bitmap.pix32(y, x * 8 + i) = BIT(gfx, 7 - i) ? pen[color] : 0; + + // graphics + uint32_t data = vram[(ma << 3) + (ra * x_count) + x]; + + // draw 8 gfx pixels + if ((data >> 12) & 0x0f) bitmap.pix32(y, x * 8 + 0) = pen[(data >> 12) & 0x0f]; + if ((data >> 8) & 0x0f) bitmap.pix32(y, x * 8 + 1) = pen[(data >> 8) & 0x0f]; + if ((data >> 4) & 0x0f) bitmap.pix32(y, x * 8 + 2) = pen[(data >> 4) & 0x0f]; + if ((data >> 0) & 0x0f) bitmap.pix32(y, x * 8 + 3) = pen[(data >> 0) & 0x0f]; + if ((data >> 28) & 0x0f) bitmap.pix32(y, x * 8 + 4) = pen[(data >> 28) & 0x0f]; + if ((data >> 24) & 0x0f) bitmap.pix32(y, x * 8 + 5) = pen[(data >> 24) & 0x0f]; + if ((data >> 20) & 0x0f) bitmap.pix32(y, x * 8 + 6) = pen[(data >> 20) & 0x0f]; + if ((data >> 16) & 0x0f) bitmap.pix32(y, x * 8 + 7) = pen[(data >> 16) & 0x0f]; + } +} + +static const gfx_layout charlayout = { 8, 16, RGN_FRAC(1,1), @@ -283,58 +288,242 @@ static const gfx_layout fp6000_charlayout = 8*16 }; -static GFXDECODE_START( gfx_fp6000 ) - GFXDECODE_ENTRY( "pcg", 0x0000, fp6000_charlayout, 0, 1 ) +static GFXDECODE_START( gfx ) + GFXDECODE_RAM("pcg", 0, charlayout, 0, 1) GFXDECODE_END +//************************************************************************** +// MACHINE EMULATION +//************************************************************************** + +// 7------- option rom available (1=no) +// -654---- unknown +// ----3--- cassette in +// -----21- unknown +// -------0 cassette motor + +uint8_t fp6000_state::port_08_r() +{ + uint8_t data = 0; + + data |= 0x80; // no option rom + data |= (m_cassette->input() > 0 ? 0x00 : 0x08); + + return data; +} + +void fp6000_state::port_08_w(uint8_t data) +{ + logerror("port_08 write %02x\n", data); + + m_cassette->change_state(BIT(data, 0) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR); +} + +uint8_t fp6000_state::port_09_r() +{ + logerror("port_09 read\n"); + return 0xff; +} + +void fp6000_state::port_09_w(uint8_t data) +{ + logerror("port_09 write %02x\n", data); +} + +void fp6000_state::port_0a_w(uint8_t data) +{ + // 7------- speaker/cassette output select + // -6543210 unknown + + logerror("port_0a write %02x\n", data); + + m_port_0a = data; +} + +uint8_t fp6000_state::port_0b_r() +{ + logerror("port_0b read\n"); + return 0xff; +} + +void fp6000_state::port_0b_w(uint8_t data) +{ + // printer control? + logerror("port_0b write %02x\n", data); + m_pic->ir7_w(1); // ? +} + +uint8_t fp6000_state::port_0c_r() +{ + logerror("port_0c read\n"); + return 0xff; +} + +void fp6000_state::port_0c_w(uint8_t data) +{ + // 7------- unknown + // -6------ pit timer2 gate? + // --543210 unknown + + logerror("port_0c write %02x\n", data); +} + +uint8_t fp6000_state::port_0d_r() +{ + logerror("port_0d read\n"); + return 0xff; +} + +void fp6000_state::port_0d_w(uint8_t data) +{ + // after writing printer data + logerror("port_0d write %02x\n", data); + + // ? + m_centronics->write_strobe(1); + m_centronics->write_strobe(0); +} + +uint8_t fp6000_state::port_0e_r() +{ + uint8_t data = 0; + + // 765----- unknown + // ---4321- printer status lines + // -------0 printer busy + + logerror("port_0e read\n"); + + data |= m_centronics_perror << 2; // guess + data |= m_centronics_fault << 1; // guess + data |= m_centronics_busy << 0; + + return data; +} + +uint8_t fp6000_state::port_0f_r() +{ + // read at end of timer interrupt routine, result discarded + return 0xff; +} + +void fp6000_state::port_0f_w(uint8_t data) +{ + logerror("port_0f write %02x\n", data); + m_pic->ir7_w(0); // ? +} + +void fp6000_state::pit_timer0_w(int state) +{ + // work around pit issue, it issues set and clear at the same time, + // leaving the pic no time to react + if (state) + m_pic->ir0_w(1); + else + m_pit_timer->adjust(attotime::from_hz(100000)); // timing? +} + +TIMER_CALLBACK_MEMBER(fp6000_state::pit_timer0_clear) +{ + m_pic->ir0_w(0); +} + +void fp6000_state::pit_timer2_w(int state) +{ + if (BIT(m_port_0a, 7)) + m_speaker->level_w(state); + else + m_cassette->output(state ? -1.0 : +1.0); +} + void fp6000_state::machine_start() { - m_char_rom = memregion("pcg")->base(); + m_pit_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fp6000_state::pit_timer0_clear), this)); } void fp6000_state::machine_reset() { } + +//************************************************************************** +// MACHINE DEFINTIONS +//************************************************************************** + void fp6000_state::fp6000(machine_config &config) { - /* basic machine hardware */ - I8086(config, m_maincpu, 16000000/2); + I8086(config, m_maincpu, 16000000 / 2); // 8 Mhz? m_maincpu->set_addrmap(AS_PROGRAM, &fp6000_state::fp6000_map); m_maincpu->set_addrmap(AS_IO, &fp6000_state::fp6000_io); + m_maincpu->set_irq_acknowledge_callback(m_pic, FUNC(pic8259_device::inta_cb)); - /* video hardware */ + PIC8259(config, m_pic, 0); + m_pic->out_int_callback().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + + PIT8253(config, m_pit, 0); + m_pit->set_clk<0>(16000000 / 16); // 1 MHz + m_pit->out_handler<0>().set(FUNC(fp6000_state::pit_timer0_w)).invert(); + m_pit->set_clk<2>(16000000 / 8); // 2 MHz? + m_pit->out_handler<2>().set(FUNC(fp6000_state::pit_timer2_w)); + + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ - screen.set_size(640, 480); - screen.set_visarea_full(); - screen.set_screen_update(FUNC(fp6000_state::screen_update_fp6000)); - screen.set_palette(m_palette); + screen.set_raw(16000000, 1024, 0, 640, 272, 0, 200); // 16 MHz? + screen.set_screen_update("crtc", FUNC(mc6845_device::screen_update)); - MC6845(config, m_crtc, 16000000/5); /* unknown variant, unknown clock, hand tuned to get ~60 fps */ + MC6845(config, m_crtc, 16000000 / 8); // unknown variant, 2 MHz? m_crtc->set_screen("screen"); m_crtc->set_show_border_area(false); m_crtc->set_char_width(8); + m_crtc->set_update_row_callback(FUNC(fp6000_state::crtc_update_row)); - PALETTE(config, m_palette).set_entries(8); + PALETTE(config, m_palette).set_entries(16); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_fp6000); + GFXDECODE(config, m_gfxdecode, m_palette, gfx); + + // audio hardware + SPEAKER(config, "mono").front_center(); + + SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); + + // keyboard + fp6000_kbd_device &keyboard(FP6000_KBD(config, "keyboard")); + keyboard.int_handler().set(m_pic, FUNC(pic8259_device::ir1_w)); + + // cassette + CASSETTE(config, m_cassette); + m_cassette->set_default_state(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED); + m_cassette->add_route(ALL_OUTPUTS, "mono", 0.05); + + // centronics printer + output_latch_device ¢ronics_data_out(OUTPUT_LATCH(config, "centronics_data_out")); + + CENTRONICS(config, m_centronics, centronics_devices, "printer"); + m_centronics->set_output_latch(centronics_data_out); + m_centronics->ack_handler().set(m_pic, FUNC(pic8259_device::ir7_w)).invert(); + m_centronics->busy_handler().set(FUNC(fp6000_state::centronics_busy_w)); + m_centronics->fault_handler().set(FUNC(fp6000_state::centronics_fault_w)); + m_centronics->perror_handler().set(FUNC(fp6000_state::centronics_perror_w)); } -/* ROM definition */ + +//************************************************************************** +// ROM DEFINITIONS +//************************************************************************** + ROM_START( fp6000 ) - ROM_REGION16_LE( 0x10000, "ipl", ROMREGION_ERASEFF ) - ROM_LOAD( "ipl.rom", 0x0000, 0x10000, CRC(c72fe40a) SHA1(0e4c60dc27f6c7f461c4bc382b81602b3327a7a4)) + ROM_REGION16_LE(0x10000, "ipl", 0) + ROM_LOAD("ipl.rom", 0x0000, 0x10000, CRC(c72fe40a) SHA1(0e4c60dc27f6c7f461c4bc382b81602b3327a7a4)) - ROM_REGION( 0x1000, "mcu", ROMREGION_ERASEFF ) - ROM_LOAD( "mcu", 0x0000, 0x1000, NO_DUMP ) //unknown MCU type - - ROM_REGION( 0x10000, "pcg", ROMREGION_ERASE00 ) + ROM_REGION(0x1000, "mcu", 0) + ROM_LOAD("mcu", 0x0000, 0x1000, NO_DUMP) // unknown MCU type ROM_END -/* Driver */ -/* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ -COMP( 1985, fp6000, 0, 0, fp6000, fp6000, fp6000_state, empty_init, "Casio", "FP-6000", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +//************************************************************************** +// SYSTEM DRIVERS +//************************************************************************** + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 1985, fp6000, 0, 0, fp6000, fp6000, fp6000_state, empty_init, "Casio", "FP-6000", MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/funworld.cpp b/src/mame/drivers/funworld.cpp index 2f92f3b8054..e31ae730960 100644 --- a/src/mame/drivers/funworld.cpp +++ b/src/mame/drivers/funworld.cpp @@ -3123,9 +3123,7 @@ void funworld_state::saloon(machine_config &config) config.device_remove("pia1"); /* Serial Memory */ - i2cmem_device &m_i2cmem(I2CMEM(config, "i2cmem", 0)); - m_i2cmem.set_data_size(256); - m_i2cmem.set_e0(1); + I2C_24C02(config, "i2cmem", 0).set_e0(1); // ? or maybe 2nd half of 24C04? } diff --git a/src/mame/drivers/gal3.cpp b/src/mame/drivers/gal3.cpp index c9e7123c673..610e03ff5a2 100644 --- a/src/mame/drivers/gal3.cpp +++ b/src/mame/drivers/gal3.cpp @@ -680,12 +680,12 @@ void gal3_state::gal3(machine_config &config) SPEAKER(config, "rspeaker").front_right(); C140(config, m_c140_16g, 8000000/374); - m_c140_16g->set_bank_type(c140_device::C140_TYPE::SYSTEM21); //to be verified + //m_c140_16g->set_addrmap(0, &gal3_state::c140_16g_map); //to be verified m_c140_16g->add_route(0, "lspeaker", 0.50); m_c140_16g->add_route(1, "rspeaker", 0.50); C140(config, m_c140_16a, 8000000/374); - m_c140_16a->set_bank_type(c140_device::C140_TYPE::SYSTEM21); + //m_c140_16a->set_addrmap(0, &gal3_state::c140_16a_map); //to be verified m_c140_16a->add_route(0, "lspeaker", 0.50); m_c140_16a->add_route(1, "rspeaker", 0.50); } @@ -888,7 +888,7 @@ ROM_START( gal3 ) ROM_LOAD( "glc1-snd-voi8.10g", 0x000000, 0x80000, CRC(bba0c15b) SHA1(b0abc22fd1ae8a9970ad45d9ebdb38e6b06033a7) ) ROM_LOAD( "glc1-snd-voi9.11g", 0x080000, 0x80000, CRC(dd1b1ee4) SHA1(b69af15acaa9c3d79d7758adc8722ff5c1129b76) ) ROM_LOAD( "glc1-snd-voi10.13g",0x100000, 0x80000, CRC(1c1dedf4) SHA1(b6b9dac68103ff2206d731d409a557a71afd98f7) ) - ROM_LOAD( "glc1-snd-voi11.14g",0x180000, 0x80000, CRC(559e2a8a) SHA1(9a2f28305c6073a0b9b80a5d9617cc25a921e9d0)) + ROM_LOAD( "glc1-snd-voi11.14g",0x180000, 0x80000, CRC(559e2a8a) SHA1(9a2f28305c6073a0b9b80a5d9617cc25a921e9d0) ) /********* Laserdiscs *********/ /* used 2 apparently, no idea what they connect to */ diff --git a/src/mame/drivers/ghosteo.cpp b/src/mame/drivers/ghosteo.cpp index 97485bbdee4..61c4e0dbf31 100644 --- a/src/mame/drivers/ghosteo.cpp +++ b/src/mame/drivers/ghosteo.cpp @@ -635,7 +635,7 @@ void ghosteo_state::ghosteo(machine_config &config) // nand.set_nand_type(nand_device::chip::K9F5608U0D); // or another variant with ID 0xEC 0x75 ? // nand.rnb_wr_callback().set(m_s3c2410, FUNC(s3c2410_device::s3c24xx_pin_frnb_w)); -// I2CMEM(config, "i2cmem", 0, 0xA0, 0, 0x100, nullptr); + I2C_24C16(config, "i2cmem", 0); // M24CL16-S /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -659,14 +659,12 @@ void ghosteo_state::bballoon(machine_config &config) { ghosteo(config); m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::bballoon_map); - I2CMEM(config, "i2cmem", 0).set_data_size(256); } void ghosteo_state::touryuu(machine_config &config) { ghosteo(config); m_maincpu->set_addrmap(AS_PROGRAM, &ghosteo_state::touryuu_map); - I2CMEM(config, "i2cmem", 0).set_data_size(1024); } diff --git a/src/mame/drivers/gottlieb.cpp b/src/mame/drivers/gottlieb.cpp index 2270b468c7b..cd626844e2f 100644 --- a/src/mame/drivers/gottlieb.cpp +++ b/src/mame/drivers/gottlieb.cpp @@ -200,6 +200,7 @@ VBlank duration: 1/VSYNC * (16/256) = 1017.6 us #include "includes/gottlieb.h" #include "machine/nvram.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "sound/dac.h" #include "speaker.h" diff --git a/src/mame/drivers/gs6502.cpp b/src/mame/drivers/gs6502.cpp new file mode 100644 index 00000000000..59f57820b75 --- /dev/null +++ b/src/mame/drivers/gs6502.cpp @@ -0,0 +1,77 @@ + +// MAME driver for Grant Searle's Simple 6502 Computer +// http://www.searle.wales/ +// Written by Frank Palazzolo - frank@avoidspikes.com + +#include "emu.h" + +#include "cpu/m6502/m6502.h" +#include "machine/6850acia.h" + +#include "machine/clock.h" +#include "bus/rs232/rs232.h" + +class gs6502_state : public driver_device +{ +public: + gs6502_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_acia(*this, "acia") + { } + + void gs6502(machine_config &config); + +private: + void gs6502_mem(address_map &map); + + required_device m_maincpu; + required_device m_acia; +}; + +void gs6502_state::gs6502_mem(address_map &map) +{ + map(0x0000, 0x7fff).ram(); + map(0xa000, 0xbfff).rw("acia", FUNC(acia6850_device::read), FUNC(acia6850_device::write)); + map(0xc000, 0xffff).rom(); +} + +// This is here only to configure our terminal for interactive use +static DEVICE_INPUT_DEFAULTS_START( terminal ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END + +void gs6502_state::gs6502(machine_config &config) +{ + /* basic machine hardware */ + M6502(config, m_maincpu, XTAL(1'843'200)); + m_maincpu->set_addrmap(AS_PROGRAM, &gs6502_state::gs6502_mem); + + // Configure UART (via m_acia) + ACIA6850(config, m_acia, 0); + m_acia->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + // should this be reverse polarity? + m_acia->irq_handler().set("rs232", FUNC(rs232_port_device::write_rts)); + + clock_device &acia_clock(CLOCK(config, "acia_clock", 1'843'200)); + acia_clock.signal_handler().set("acia", FUNC(acia6850_device::write_txc)); + acia_clock.signal_handler().append("acia", FUNC(acia6850_device::write_rxc)); + + // Configure a "default terminal" to connect to the 6850, so we have a console + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); + rs232.rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd)); + rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be below the DEVICE_INPUT_DEFAULTS_START block +} + +ROM_START(gs6502) + ROM_REGION(0x10000, "maincpu",0) + ROM_LOAD("gs6502.bin", 0xc000, 0x4000, CRC(0b1d8348) SHA1(482451aa8cc0c470ce9706b43bfa093df47c8ab1)) +ROM_END + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 201?, gs6502, 0, 0, gs6502, 0, gs6502_state, empty_init, "Grant Searle", "Simple 6502 Machine", MACHINE_NO_SOUND_HW ) diff --git a/src/mame/drivers/gs6809.cpp b/src/mame/drivers/gs6809.cpp new file mode 100644 index 00000000000..561e57cd246 --- /dev/null +++ b/src/mame/drivers/gs6809.cpp @@ -0,0 +1,77 @@ + +// MAME driver for Grant Searle's Simple 6809 Computer +// http://www.searle.wales/ +// Written by Frank Palazzolo - frank@avoidspikes.com + +#include "emu.h" + +#include "cpu/m6809/m6809.h" +#include "machine/6850acia.h" + +#include "machine/clock.h" +#include "bus/rs232/rs232.h" + +class gs6809_state : public driver_device +{ +public: + gs6809_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_acia(*this, "acia") + { } + + void gs6809(machine_config &config); + +private: + void gs6809_mem(address_map &map); + + required_device m_maincpu; + required_device m_acia; +}; + +void gs6809_state::gs6809_mem(address_map &map) +{ + map(0x0000, 0x7fff).ram(); + map(0xa000, 0xbfff).rw("acia", FUNC(acia6850_device::read), FUNC(acia6850_device::write)); + map(0xc000, 0xffff).rom(); +} + +// This is here only to configure our terminal for interactive use +static DEVICE_INPUT_DEFAULTS_START( terminal ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END + +void gs6809_state::gs6809(machine_config &config) +{ + /* basic machine hardware */ + MC6809(config, m_maincpu, XTAL(7'372'800)); + m_maincpu->set_addrmap(AS_PROGRAM, &gs6809_state::gs6809_mem); + + // Configure UART (via m_acia) + ACIA6850(config, m_acia, 0); + m_acia->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + // should this be reverse polarity? + m_acia->irq_handler().set("rs232", FUNC(rs232_port_device::write_rts)); + + clock_device &acia_clock(CLOCK(config, "acia_clock", 7'372'800/4)); // E Clock from M6809 + acia_clock.signal_handler().set("acia", FUNC(acia6850_device::write_txc)); + acia_clock.signal_handler().append("acia", FUNC(acia6850_device::write_rxc)); + + // Configure a "default terminal" to connect to the 6850, so we have a console + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); + rs232.rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd)); + rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be below the DEVICE_INPUT_DEFAULTS_START block +} + +ROM_START(gs6809) + ROM_REGION(0x10000, "maincpu",0) + ROM_LOAD("gs6809.bin", 0xc000, 0x4000, CRC(f997a378) SHA1(1e0d5997b1b286aa328bdbff776bcddbb68d1c34)) +ROM_END + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 201?, gs6809, 0, 0, gs6809, 0, gs6809_state, empty_init, "Grant Searle", "Simple 6809 Machine", MACHINE_NO_SOUND_HW ) diff --git a/src/mame/drivers/gscpm.cpp b/src/mame/drivers/gscpm.cpp new file mode 100644 index 00000000000..73f27fad0bd --- /dev/null +++ b/src/mame/drivers/gscpm.cpp @@ -0,0 +1,188 @@ + +// MAME driver for Grant Searle's Simple CP/M Computer +// http://searle.x10host.com/cpm/index.html +// Written by Frank Palazzolo - frank@avoidspikes.com + +// This driver uses a compact flash card as a hard disk device. +// To create a virtual disk file, use the following (for a 128MB card): +// chdman createhd -s 134217728 -o filename.chd +// (or use -s 67108864 for 64MB card) +// +// Then, run MAME with -hard filename.chd, or mount it using the GUI +// and restart the driver +// + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "bus/ata/ataintf.h" +#include "machine/z80sio.h" +#include "machine/ram.h" +#include "machine/clock.h" +#include "bus/rs232/rs232.h" + +class gscpm_state : public driver_device +{ +public: + gscpm_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_ram(*this, "ram") + , m_ide(*this, "ide") + , m_sio(*this, "sio") + { } + + void gscpm(machine_config &config); + +protected: + void machine_reset() override; + + void gscpm_mem(address_map &map); + void gscpm_io(address_map &map); + + READ8_MEMBER( cflash_r ); + WRITE8_MEMBER( cflash_w ); + READ8_MEMBER( sio_r ); + WRITE8_MEMBER( sio_w ); + + WRITE8_MEMBER( switch_to_ram_w ); + + required_device m_maincpu; + required_device m_ram; + required_device m_ide; + required_device m_sio; +}; + +void gscpm_state::gscpm_mem(address_map &map) +{ + //map(0x0000, 0x3fff).rom("maincpu"); // This is ROM after reset, and RAM is switched in when CP/M is booted + // (will install handlers dynamically) + map(0x4000, 0xffff).ram(); +} + +void gscpm_state::gscpm_io(address_map &map) +{ + map.global_mask(0xff); // use 8-bit ports + map.unmap_value_high(); // unmapped addresses return 0xff + map(0x00, 0x07).rw(FUNC(gscpm_state::sio_r), FUNC(gscpm_state::sio_w)); + map(0x10, 0x17).rw(FUNC(gscpm_state::cflash_r), FUNC(gscpm_state::cflash_w)); // compact flash + map(0x38, 0x3f).w(FUNC(gscpm_state::switch_to_ram_w)); +} + +READ8_MEMBER( gscpm_state::cflash_r ) +{ + return m_ide->read_cs0(offset, 0xff); +} + +WRITE8_MEMBER( gscpm_state::cflash_w ) +{ + m_ide->write_cs0(offset, data, 0xff); +} + +READ8_MEMBER( gscpm_state::sio_r ) +{ + switch(offset & 3) + { + case 0x00: + return m_sio->da_r(); + break; + case 0x01: + return m_sio->db_r(); + break; + case 0x02: + return m_sio->ca_r(); + break; + case 0x03: + return m_sio->cb_r(); + break; + } + return 0x00; // can't happen +} + +WRITE8_MEMBER( gscpm_state::sio_w ) +{ + switch(offset & 3) + { + case 0x00: + m_sio->da_w(data); + break; + case 0x01: + m_sio->db_w(data); + break; + case 0x02: + m_sio->ca_w(data); + break; + case 0x03: + m_sio->cb_w(data); + break; + } +} + +WRITE8_MEMBER( gscpm_state::switch_to_ram_w ) +{ + // Install the RAM handler here + m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x3fff); // Unmap the ROM handler + m_maincpu->space(AS_PROGRAM).install_ram(0x0000, 0x3fff, m_ram->pointer()); +} + +void gscpm_state::machine_reset() +{ + driver_device::machine_reset(); + // Install the ROM handler here + m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x0000, 0x3fff); // Unmap RAM handler if being rebooted + m_maincpu->space(AS_PROGRAM).install_rom(0x0000, 0x3fff, memregion("maincpu")->base()); +} + +// This is here only to configure our terminal for interactive use +static DEVICE_INPUT_DEFAULTS_START( terminal ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END + +static const z80_daisy_config gscpm_daisy_chain[] = +{ + { "sio" }, + { nullptr } +}; + +void gscpm_state::gscpm(machine_config &config) +{ + /* basic machine hardware */ + Z80(config, m_maincpu, XTAL(7'372'800)); + m_maincpu->set_addrmap(AS_PROGRAM, &gscpm_state::gscpm_mem); + m_maincpu->set_addrmap(AS_IO, &gscpm_state::gscpm_io); + m_maincpu->set_daisy_config(gscpm_daisy_chain); + + /* compact flash hard drive */ + ATA_INTERFACE(config, m_ide).options(ata_devices, "hdd", nullptr, false); + + RAM(config, m_ram).set_default_size("16K"); // This shadows the ROM + + Z80SIO(config, m_sio, 0); + m_sio->out_txdb_callback().set("rs232", FUNC(rs232_port_device::write_txd)); + m_sio->out_rtsb_callback().set("rs232", FUNC(rs232_port_device::write_rts)); + m_sio->out_int_callback().set_inputline("maincpu", INPUT_LINE_IRQ0); // Connect interrupt pin to our Z80 INT line + + clock_device &sio_clock(CLOCK(config, "sio_clock", 7'372'800)); + sio_clock.signal_handler().set("sio", FUNC(z80sio_device::txca_w)); + sio_clock.signal_handler().append("sio", FUNC(z80sio_device::rxca_w)); + sio_clock.signal_handler().append("sio", FUNC(z80sio_device::txcb_w)); + sio_clock.signal_handler().append("sio", FUNC(z80sio_device::rxcb_w)); + + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); + rs232.rxd_handler().set("sio", FUNC(z80sio_device::rxb_w)); + rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be below the DEVICE_INPUT_DEFAULTS_START block +} + +// ROM mapping is trivial, this binary was created from the HEX file on Grant's website +ROM_START(gscpm) + ROM_REGION(0x4000, "maincpu",0) + ROM_LOAD("gscpm.bin", 0x0000, 0x4000, CRC(35ae0d43) SHA1(7fae4df419d38a1787a4a97cbef558f402109959)) +ROM_END + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 201?, gscpm, 0, 0, gscpm, 0, gscpm_state, empty_init, "Grant Searle", "Simple CP/M Machine", MACHINE_NO_SOUND_HW ) diff --git a/src/mame/drivers/gsz80.cpp b/src/mame/drivers/gsz80.cpp new file mode 100644 index 00000000000..f2881275369 --- /dev/null +++ b/src/mame/drivers/gsz80.cpp @@ -0,0 +1,100 @@ + +// MAME Reference driver for Grant Searle's Simple Z80 Computer +// http://www.searle.wales/ +// Written by Frank Palazzolo - frank@avoidspikes.com + +// All the common emulator stuff is here +#include "emu.h" + +// Two member devices referenced in state class, a Z80 and a UART +#include "cpu/z80/z80.h" +#include "machine/6850acia.h" + +// Two more devices needed, a clock device for the UART, and RS-232 devices +#include "machine/clock.h" +#include "bus/rs232/rs232.h" + +// State class - derives from driver_device +class gsz80_state : public driver_device +{ +public: + gsz80_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") // Tag name for Z80 is "maincpu" + , m_acia(*this, "acia") // Tag name for UART is "acia" + { } + + // This function sets up the machine configuration + void gsz80(machine_config &config); + +private: + // address maps for program memory and io memory + void gsz80_mem(address_map &map); + void gsz80_io(address_map &map); + + // two member devices required here + required_device m_maincpu; + required_device m_acia; +}; + +// Trivial memory map for program memory +void gsz80_state::gsz80_mem(address_map &map) +{ + map(0x0000, 0x1fff).rom(); + map(0x2000, 0xffff).ram(); +} + +void gsz80_state::gsz80_io(address_map &map) +{ + map.global_mask(0xff); // use 8-bit ports + map.unmap_value_high(); // unmapped addresses return 0xff + map(0x80, 0xbf).rw("acia", FUNC(acia6850_device::read), FUNC(acia6850_device::write)); +} + +// This is here only to configure our terminal for interactive use +static DEVICE_INPUT_DEFAULTS_START( terminal ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_115200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END + +void gsz80_state::gsz80(machine_config &config) +{ + /* basic machine hardware */ + + // Configure member Z80 (via m_maincpu) + Z80(config, m_maincpu, XTAL(7'372'800)); + m_maincpu->set_addrmap(AS_PROGRAM, &gsz80_state::gsz80_mem); + m_maincpu->set_addrmap(AS_IO, &gsz80_state::gsz80_io); + + // Configure UART (via m_acia) + ACIA6850(config, m_acia, 0); + m_acia->txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); + m_acia->rts_handler().set("rs232", FUNC(rs232_port_device::write_rts)); + m_acia->irq_handler().set_inputline("maincpu", INPUT_LINE_IRQ0); // Connect interrupt pin to our Z80 INT line + + // Create a clock device to connect to the transmit and receive clock on the 6850 + clock_device &acia_clock(CLOCK(config, "acia_clock", 7'372'800)); + acia_clock.signal_handler().set("acia", FUNC(acia6850_device::write_txc)); + acia_clock.signal_handler().append("acia", FUNC(acia6850_device::write_rxc)); + + // Configure a "default terminal" to connect to the 6850, so we have a console + rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "terminal")); + rs232.rxd_handler().set(m_acia, FUNC(acia6850_device::write_rxd)); + rs232.dcd_handler().set(m_acia, FUNC(acia6850_device::write_dcd)); + rs232.cts_handler().set(m_acia, FUNC(acia6850_device::write_cts)); + rs232.set_option_device_input_defaults("terminal", DEVICE_INPUT_DEFAULTS_NAME(terminal)); // must be below the DEVICE_INPUT_DEFAULTS_START block +} + +// ROM mapping is trivial, this binary was created from the HEX file on Grant's website +ROM_START(gsz80) + ROM_REGION(0x2000, "maincpu",0) + ROM_LOAD("gsz80.bin", 0x0000, 0x2000, CRC(6f4bc7e5) SHA1(9008fe3b9754ec5537b3ad90f748096602ba008e)) +ROM_END + +// This ties everything together +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +COMP( 201?, gsz80, 0, 0, gsz80, 0, gsz80_state, empty_init, "Grant Searle", "Simple Z-80 Machine", MACHINE_NO_SOUND_HW ) diff --git a/src/mame/drivers/gticlub.cpp b/src/mame/drivers/gticlub.cpp index 50cf2e0339c..27b9a4c8184 100644 --- a/src/mame/drivers/gticlub.cpp +++ b/src/mame/drivers/gticlub.cpp @@ -255,6 +255,7 @@ public: m_dsp(*this, "dsp"), m_dsp2(*this, "dsp2"), m_k056800(*this, "k056800"), + m_gn680(*this, "gn680"), m_adc1038(*this, "adc1038"), m_eeprom(*this, "eeprom"), m_palette(*this, "palette"), @@ -297,6 +298,7 @@ private: required_device m_dsp; optional_device m_dsp2; required_device m_k056800; + optional_device m_gn680; required_device m_adc1038; required_device m_eeprom; required_device m_palette; @@ -327,6 +329,7 @@ private: DECLARE_WRITE32_MEMBER(gticlub_k001604_reg_w); DECLARE_READ8_MEMBER(sysreg_r); DECLARE_WRITE8_MEMBER(sysreg_w); + DECLARE_WRITE16_MEMBER(gn680_sysctrl); DECLARE_READ32_MEMBER(dsp_dataram0_r); DECLARE_WRITE32_MEMBER(dsp_dataram0_w); DECLARE_READ32_MEMBER(dsp_dataram1_r); @@ -351,6 +354,7 @@ private: void gticlub_map(address_map &map); void hangplt_map(address_map &map); + void gn680_memmap(address_map &map); void hangplt_sharc0_map(address_map &map); void hangplt_sharc1_map(address_map &map); void sharc_map(address_map &map); @@ -579,6 +583,26 @@ void gticlub_state::sound_memmap(address_map &map) /*****************************************************************************/ +WRITE16_MEMBER(gticlub_state::gn680_sysctrl) +{ + // bit 15 = watchdog toggle + // lower 4 bits = LEDs? +} + +// WORD at 30000e: IRQ 5 tests bits 6 and 7, IRQ 6 tests bits 4 and 5 +// IRQ 3 tests for network/056230 at 310000 to communicate with the main pcb + +void gticlub_state::gn680_memmap(address_map &map) +{ + map(0x000000, 0x01ffff).rom(); + map(0x200000, 0x203fff).ram(); + map(0x300000, 0x300001).w(FUNC(gticlub_state::gn680_sysctrl)); +// map(0x310000, 0x311fff).nopw(); //056230 regs? +// map(0x312000, 0x313fff).nopw(); //056230 ram? +} + +/*****************************************************************************/ + READ32_MEMBER(gticlub_state::dsp_dataram0_r) { return m_sharc_dataram_0[offset] & 0xffff; @@ -1006,13 +1030,16 @@ void gticlub_state::gticlub(machine_config &config) m_konppc->set_cbboard_type(konppc_device::CGBOARD_TYPE_GTICLUB); } -void gticlub_state::thunderh(machine_config &config) //todo: add 68000 and K056230 from the I/O board +void gticlub_state::thunderh(machine_config &config) // Todo: K056230 from the I/O board { gticlub(config); m_adc1038->set_gti_club_hack(false); m_k056230->set_thunderh_hack(true); + + M68000(config, m_gn680, XTAL(32'000'000) / 2); // 16MHz + m_gn680->set_addrmap(AS_PROGRAM, >iclub_state::gn680_memmap); } void gticlub_state::slrasslt(machine_config &config) @@ -1259,7 +1286,7 @@ ROM_START( thunderh ) /* Euro version EAA */ ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "680a07.13k", 0x000000, 0x080000, CRC(12247a3e) SHA1(846cd9423efd3c9b17fce08393c6c83307d72f92) ) - ROM_REGION(0x20000, "dsp", 0) /* GN680 program */ + ROM_REGION(0x20000, "gn680", 0) /* GN680 program */ ROM_LOAD16_WORD_SWAP( "680c22.20k", 0x000000, 0x020000, CRC(d93c0ee2) SHA1(4b58418cbb01b51e12d6e7c86b2c81cd35d86248) ) ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ @@ -1289,7 +1316,7 @@ ROM_START( thunderhu ) /* USA version UAA */ ROM_REGION(0x80000, "audiocpu", 0) /* 68k program */ ROM_LOAD16_WORD_SWAP( "680a07.13k", 0x000000, 0x080000, CRC(12247a3e) SHA1(846cd9423efd3c9b17fce08393c6c83307d72f92) ) - ROM_REGION(0x20000, "dsp", 0) /* GN680 program */ + ROM_REGION(0x20000, "gn680", 0) /* GN680 program */ ROM_LOAD16_WORD_SWAP( "680c22.20k", 0x000000, 0x020000, CRC(d93c0ee2) SHA1(4b58418cbb01b51e12d6e7c86b2c81cd35d86248) ) ROM_REGION16_LE(0x800000, "rfsnd", 0) /* sound roms */ diff --git a/src/mame/drivers/hh_pic16.cpp b/src/mame/drivers/hh_pic16.cpp index 6db069b125c..a1c763be43f 100644 --- a/src/mame/drivers/hh_pic16.cpp +++ b/src/mame/drivers/hh_pic16.cpp @@ -652,9 +652,10 @@ ROM_END Flash is a wall-mounted game, players throw beanbags to activate the buttons. It's described in patent US4333657 as an electronic dart game. - In games 4 and 5 it's easy to lock up the program by pressing the buttons - repeatedly and causing a score overflow. Although that wouldn't be possible - by properly throwing beanbags at it. + BTANB: In games 4 and 5 it's easy to lock up the program by pressing the + buttons repeatedly and causing a score overflow. Although that wouldn't be + possible by properly throwing beanbags at it. This bug is warned about in + the manual. This could also be purchased as a bare PCB from Radio Shack under the Archer brand, catalog number 277-1013. It was named "Sound Effects Chassis" but @@ -1909,8 +1910,8 @@ CONS( 1979, pabball, 0, 0, pabball, pabball, pabball_state, empty_ CONS( 1980, melodym, 0, 0, melodym, melodym, melodym_state, empty_init, "GAF", "Melody Madness", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1979, maniac, 0, 0, maniac, maniac, maniac_state, empty_init, "Ideal", "Maniac", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1980, flash, 0, 0, flash, flash, flash_state, empty_init, "Ideal", "Flash (Ideal)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1979, maniac, 0, 0, maniac, maniac, maniac_state, empty_init, "Ideal Toy Corporation", "Maniac", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) +CONS( 1980, flash, 0, 0, flash, flash, flash_state, empty_init, "Ideal Toy Corporation", "Flash (Ideal)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1980, matchme, 0, 0, matchme, matchme, matchme_state, empty_init, "Kingsford", "Match Me", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/hh_tms1k.cpp b/src/mame/drivers/hh_tms1k.cpp index 1dee5cdbcaa..a0326d3911e 100644 --- a/src/mame/drivers/hh_tms1k.cpp +++ b/src/mame/drivers/hh_tms1k.cpp @@ -5371,17 +5371,8 @@ public: virtual DECLARE_WRITE16_MEMBER(write_o); virtual DECLARE_READ8_MEMBER(read_k); void ginv2000(machine_config &config); - -protected: - virtual void machine_reset() override; }; -void ginv2000_state::machine_reset() -{ - hh_tms1k_state::machine_reset(); - m_expander->write_ms(1); // Vss -} - // handlers void ginv2000_state::update_display() @@ -5453,7 +5444,7 @@ void ginv2000_state::ginv2000(machine_config &config) m_maincpu->r().set(FUNC(ginv2000_state::write_r)); m_maincpu->o().set(FUNC(ginv2000_state::write_o)); - TMS1024(config, m_expander); + TMS1024(config, m_expander).set_ms(1); // MS tied high m_expander->write_port4_callback().set(FUNC(ginv2000_state::expander_w)); m_expander->write_port5_callback().set(FUNC(ginv2000_state::expander_w)); m_expander->write_port6_callback().set(FUNC(ginv2000_state::expander_w)); @@ -11926,7 +11917,6 @@ void tbreakup_state::machine_reset() { hh_tms1k_state::machine_reset(); set_clock(); - m_expander->write_ms(1); // Vss } // handlers @@ -12021,7 +12011,7 @@ void tbreakup_state::tbreakup(machine_config &config) m_maincpu->r().set(FUNC(tbreakup_state::write_r)); m_maincpu->o().set(FUNC(tbreakup_state::write_o)); - TMS1025(config, m_expander); + TMS1025(config, m_expander).set_ms(1); // MS tied high m_expander->write_port1_callback().set(FUNC(tbreakup_state::expander_w)); m_expander->write_port2_callback().set(FUNC(tbreakup_state::expander_w)); m_expander->write_port3_callback().set(FUNC(tbreakup_state::expander_w)); @@ -12564,7 +12554,7 @@ CONS( 1981, ginv1000, 0, 0, ginv1000, ginv1000, ginv1000_state, emp CONS( 1982, ginv2000, 0, 0, ginv2000, ginv2000, ginv2000_state, empty_init, "Gakken", "Invader 2000", MACHINE_SUPPORTS_SAVE ) COMP( 1983, fxmcr165, 0, 0, fxmcr165, fxmcr165, fxmcr165_state, empty_init, "Gakken", "FX-Micom R-165", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) -CONS( 1979, elecdet, 0, 0, elecdet, elecdet, elecdet_state, empty_init, "Ideal", "Electronic Detective", MACHINE_SUPPORTS_SAVE ) // *** +CONS( 1979, elecdet, 0, 0, elecdet, elecdet, elecdet_state, empty_init, "Ideal Toy Corporation", "Electronic Detective", MACHINE_SUPPORTS_SAVE ) // *** CONS( 1979, starwbc, 0, 0, starwbc, starwbc, starwbc_state, empty_init, "Kenner", "Star Wars - Electronic Battle Command", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, starwbc_state, empty_init, "Kenner", "Star Wars - Electronic Battle Command (patent)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) diff --git a/src/mame/drivers/hotblock.cpp b/src/mame/drivers/hotblock.cpp index 5a1ed17a897..56cab2e41fa 100644 --- a/src/mame/drivers/hotblock.cpp +++ b/src/mame/drivers/hotblock.cpp @@ -184,7 +184,7 @@ void hotblock_state::hotblock(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &hotblock_state::hotblock_map); m_maincpu->set_addrmap(AS_IO, &hotblock_state::hotblock_io); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24C04A + I2C_24C04(config, "i2cmem", 0); // 24C04A ADDRESS_MAP_BANK(config, m_video_bank).set_map(&hotblock_state::banked_video_map).set_options(ENDIANNESS_LITTLE, 8, 24, 0x10000); diff --git a/src/mame/drivers/ht68k.cpp b/src/mame/drivers/ht68k.cpp index 22bfa0651f8..e13dae1aa5d 100644 --- a/src/mame/drivers/ht68k.cpp +++ b/src/mame/drivers/ht68k.cpp @@ -44,11 +44,7 @@ public: m_maincpu(*this, "maincpu"), m_duart(*this, "duart68681"), m_fdc(*this, "wd1770"), - m_floppy0(*this, "wd1770:0"), - m_floppy1(*this, "wd1770:1"), - m_floppy2(*this, "wd1770:2"), - m_floppy3(*this, "wd1770:3"), - m_floppy(nullptr), + m_floppy(*this, "wd1770:%u", 0U), m_p_ram(*this, "p_ram") { } @@ -59,14 +55,10 @@ private: required_device m_maincpu; required_device m_duart; required_device m_fdc; - required_device m_floppy0; - required_device m_floppy1; - required_device m_floppy2; - required_device m_floppy3; - floppy_image_device *m_floppy; - DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); + required_device_array m_floppy; + DECLARE_WRITE_LINE_MEMBER(duart_txb); - DECLARE_WRITE8_MEMBER(duart_output); + void duart_output(uint8_t data); required_shared_ptr m_p_ram; virtual void machine_reset() override; void ht68k_mem(address_map &map); @@ -96,11 +88,7 @@ void ht68k_state::machine_reset() m_fdc->reset(); m_fdc->set_floppy(nullptr); -} - -WRITE_LINE_MEMBER(ht68k_state::duart_irq_handler) -{ - m_maincpu->set_input_line(M68K_IRQ_3, state); + m_fdc->dden_w(0); } WRITE_LINE_MEMBER(ht68k_state::duart_txb) @@ -108,18 +96,24 @@ WRITE_LINE_MEMBER(ht68k_state::duart_txb) //This is the second serial channel named AUX, for modem or other serial devices. } -WRITE8_MEMBER(ht68k_state::duart_output) +void ht68k_state::duart_output(uint8_t data) { - m_floppy = nullptr; + logerror("%s: DUART output = %02X\n", machine().describe_context(), data); - if ((BIT(data, 7)) == 0) { m_floppy = m_floppy0->get_device(); } - if ((BIT(data, 6)) == 0) { m_floppy = m_floppy1->get_device(); } - if ((BIT(data, 5)) == 0) { m_floppy = m_floppy2->get_device(); } - if ((BIT(data, 4)) == 0) { m_floppy = m_floppy3->get_device(); } + floppy_image_device *floppy = nullptr; - m_fdc->set_floppy(m_floppy); + for (int i = 0; i < 4; i++) + { + if (!BIT(data, 7 - i) && m_floppy[i]->get_device() != nullptr) + { + floppy = m_floppy[i]->get_device(); + break; + } + } - if (m_floppy) {m_floppy->ss_w(BIT(data,3) ? 0 : 1);} + m_fdc->set_floppy(floppy); + + if (floppy) {floppy->ss_w(BIT(data,3) ? 0 : 1);} } static void ht68k_floppies(device_slot_interface &device) @@ -137,7 +131,7 @@ void ht68k_state::ht68k(machine_config &config) /* video hardware */ MC68681(config, m_duart, 8_MHz_XTAL / 2); m_duart->set_clocks(500000, 500000, 1000000, 1000000); - m_duart->irq_cb().set(FUNC(ht68k_state::duart_irq_handler)); + m_duart->irq_cb().set_inputline(m_maincpu, M68K_IRQ_3); m_duart->a_tx_cb().set("rs232", FUNC(rs232_port_device::write_txd)); m_duart->b_tx_cb().set(FUNC(ht68k_state::duart_txb)); m_duart->outport_cb().set(FUNC(ht68k_state::duart_output)); @@ -146,11 +140,12 @@ void ht68k_state::ht68k(machine_config &config) rs232.rxd_handler().set(m_duart, FUNC(mc68681_device::rx_a_w)); WD1770(config, m_fdc, 8_MHz_XTAL); + m_fdc->intrq_wr_callback().set_inputline(m_maincpu, M68K_IRQ_4); FLOPPY_CONNECTOR(config, "wd1770:0", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats); - FLOPPY_CONNECTOR(config, "wd1770:1", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats); - FLOPPY_CONNECTOR(config, "wd1770:2", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats); - FLOPPY_CONNECTOR(config, "wd1770:3", ht68k_floppies, "525dd", floppy_image_device::default_floppy_formats); + FLOPPY_CONNECTOR(config, "wd1770:1", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats); + FLOPPY_CONNECTOR(config, "wd1770:2", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats); + FLOPPY_CONNECTOR(config, "wd1770:3", ht68k_floppies, nullptr, floppy_image_device::default_floppy_formats); SOFTWARE_LIST(config, "flop525_list").set_original("ht68k"); } diff --git a/src/mame/drivers/imds2.cpp b/src/mame/drivers/imds2.cpp index 1d059f11269..f0f00854f1c 100644 --- a/src/mame/drivers/imds2.cpp +++ b/src/mame/drivers/imds2.cpp @@ -258,7 +258,7 @@ void imds2_state::imds2(machine_config &config) I8085A(config, m_ipccpu, IPC_XTAL_Y2); // CLK OUT = 4 MHz m_ipccpu->set_addrmap(AS_PROGRAM, &imds2_state::ipc_mem_map); m_ipccpu->set_addrmap(AS_IO, &imds2_state::ipc_io_map); - m_ipccpu->set_irq_acknowledge_callback("ipcsyspic", FUNC(pic8259_device::inta_cb)); + m_ipccpu->in_inta_func().set("ipcsyspic", FUNC(pic8259_device::acknowledge)); //config.set_maximum_quantum(attotime::from_hz(100)); PIC8259(config, m_ipcsyspic, 0); @@ -267,7 +267,7 @@ void imds2_state::imds2(machine_config &config) PIC8259(config, m_ipclocpic, 0); m_ipclocpic->out_int_callback().set(m_ipcsyspic, FUNC(pic8259_device::ir7_w)); - m_ipclocpic->in_sp_callback().set_constant(1); + m_ipclocpic->in_sp_callback().set_constant(0); PIT8253(config, m_ipctimer, 0); m_ipctimer->set_clk<0>(IPC_XTAL_Y1 / 16); diff --git a/src/mame/drivers/indy_indigo2.cpp b/src/mame/drivers/indy_indigo2.cpp index a825d9a7358..14f6588d91d 100644 --- a/src/mame/drivers/indy_indigo2.cpp +++ b/src/mame/drivers/indy_indigo2.cpp @@ -474,10 +474,12 @@ void ip22_state::indigo2_4415(machine_config &config) #define INDY_BIOS_R4K \ INDY_BIOS_R5K \ - ROM_SYSTEM_BIOS( 1, "b4", "Version 5.1.2 Rev B4 R4X00 Dec 9, 1993" ) \ - ROMX_LOAD( "ip24prom.070-9101-005.bin", 0x000000, 0x080000, CRC(f5e41008) SHA1(28b769b28218a1fcd0400dceef9a284dcfbdda5b), INDY_BIOS_FLAGS(1) ) \ + ROM_SYSTEM_BIOS( 1, "b7", "Version 5.3 Rev B7 R4X00 IP24 Feb 16, 1995" ) \ + ROMX_LOAD( "ip24prom.070-9101-008.bin", 0x000000, 0x080000, CRC(ee0b55c4) SHA1(a752a4aef7e2c6086b8b0244e9f064861a11870f), INDY_BIOS_FLAGS(1) ) \ ROM_SYSTEM_BIOS( 2, "b6", "Version 5.0 Rev B6 Sep 28, 1994" ) \ - ROMX_LOAD( "ip24prom.070-9101-007.bin", 0x000000, 0x080000, CRC(70d8d1b1) SHA1(ade54cd2ecb7064957f8602894f05685e2f4e8fb), INDY_BIOS_FLAGS(2) ) + ROMX_LOAD( "ip24prom.070-9101-007.bin", 0x000000, 0x080000, CRC(70d8d1b1) SHA1(ade54cd2ecb7064957f8602894f05685e2f4e8fb), INDY_BIOS_FLAGS(2) ) \ + ROM_SYSTEM_BIOS( 3, "b4", "Version 5.1.2 Rev B4 R4X00 Dec 9, 1993" ) \ + ROMX_LOAD( "ip24prom.070-9101-005.bin", 0x000000, 0x080000, CRC(f5e41008) SHA1(28b769b28218a1fcd0400dceef9a284dcfbdda5b), INDY_BIOS_FLAGS(3) ) /* SCC init ip225015 * Channel A diff --git a/src/mame/drivers/iq151.cpp b/src/mame/drivers/iq151.cpp index 21e39460884..361cb5a0d65 100644 --- a/src/mame/drivers/iq151.cpp +++ b/src/mame/drivers/iq151.cpp @@ -105,7 +105,7 @@ private: void iq151_io(address_map &map); void iq151_mem(address_map &map); - required_device m_maincpu; + required_device m_maincpu; required_device m_pic; required_device m_speaker; required_device m_cassette; @@ -395,7 +395,7 @@ void iq151_state::iq151(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &iq151_state::iq151_mem); m_maincpu->set_addrmap(AS_IO, &iq151_state::iq151_io); m_maincpu->set_vblank_int("screen", FUNC(iq151_state::iq151_vblank_interrupt)); - m_maincpu->set_irq_acknowledge_callback("pic8259", FUNC(pic8259_device::inta_cb)); + m_maincpu->in_inta_func().set("pic8259", FUNC(pic8259_device::acknowledge)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER, rgb_t::green())); diff --git a/src/mame/drivers/isbc8030.cpp b/src/mame/drivers/isbc8030.cpp index 36752136c1f..b0a7188e509 100644 --- a/src/mame/drivers/isbc8030.cpp +++ b/src/mame/drivers/isbc8030.cpp @@ -57,7 +57,7 @@ private: void isbc8030_io(address_map &map); void isbc8030_mem(address_map &map); - required_device m_maincpu; + required_device m_maincpu; required_device m_usart; required_device m_ppi; required_device m_pic; @@ -90,6 +90,7 @@ void isbc8030_state::isbc8030(machine_config &config) I8085A(config, m_maincpu, XTAL(22'118'400) / 4); m_maincpu->set_addrmap(AS_PROGRAM, &isbc8030_state::isbc8030_mem); m_maincpu->set_addrmap(AS_IO, &isbc8030_state::isbc8030_io); + m_maincpu->in_inta_func().set(m_pic, FUNC(pic8259_device::acknowledge)); PIC8259(config, m_pic, 0); m_pic->out_int_callback().set_inputline(m_maincpu, 0); diff --git a/src/mame/drivers/itech32.cpp b/src/mame/drivers/itech32.cpp index 6a33868da69..eca98352c21 100644 --- a/src/mame/drivers/itech32.cpp +++ b/src/mame/drivers/itech32.cpp @@ -17,7 +17,7 @@ * Driver's Edge (1 set) * World Class Bowling (14 sets) * Street Fighter: The Movie (5 sets) - * Shuffleshot (3 sets) + * Shuffleshot (5 sets) * Golden Tee 3D Golf (12 sets) * Golden Tee Golf '97 (7 sets) * Golden Tee Golf '98 (6 sets) @@ -2381,7 +2381,7 @@ ROM_START( hotmemry11 ) /* Version 1.1 (3-tier board set: P/N 1059 Rev 3, P/N 10 ROM_LOAD16_BYTE( "hotmem_v1.srom0", 0x000000, 0x80000, CRC(c18b76cd) SHA1(2d9ddda3b1d199289792c2e8b8add4a0f35c4a48) ) ROM_END -ROM_START( wcbowldx ) /* Deluxe version 2.00 (PCB P/N 1083 Rev 2), This version is derived from the Tournament version, but tournament features have be removed/disabled */ +ROM_START( wcbowldx ) /* Deluxe version 2.00 (PCB P/N 1083 Rev 2), This version is derived from the Tournament v1.40 set, but tournament features have be removed/disabled */ ROM_REGION32_BE( CODE_SIZE, "user1", 0 ) ROM_LOAD32_BYTE( "wcbd_prom0_2.00.prom0", 0x00000, 0x20000, CRC(280df7f0) SHA1(dacffe8fc21263093b0f4a4fbf444abd49afbff1) ) ROM_LOAD32_BYTE( "wcbd_prom1_2.00.prom1", 0x00001, 0x20000, CRC(526eded0) SHA1(106d5503ed4db2411e1f3446d613eac525a8a9cc) ) @@ -2419,8 +2419,8 @@ ROM_END ROM_START( wcbowl140 ) /* Version 1.40 Tournament (PCB P/N 1083 Rev 2) */ ROM_REGION32_BE( CODE_SIZE, "user1", 0 ) - ROM_LOAD32_BYTE( "wcbf_prom0_1.40.prom0", 0x00000, 0x20000, CRC(9d31ceb1) SHA1(d147976a763ba1e18d861351b12c5d275b94a562) ) - ROM_LOAD32_BYTE( "wcbf_prom1_1.40.prom1", 0x00001, 0x20000, CRC(c6669452) SHA1(ba58da7bee5120682e2306454da287c969014899) ) + ROM_LOAD32_BYTE( "wcbf_prom0_1.40.prom0", 0x00000, 0x20000, CRC(9d31ceb1) SHA1(d147976a763ba1e18d861351b12c5d275b94a562) ) /* First WCB set to contain the Flash Bowling */ + ROM_LOAD32_BYTE( "wcbf_prom1_1.40.prom1", 0x00001, 0x20000, CRC(c6669452) SHA1(ba58da7bee5120682e2306454da287c969014899) ) /* Has BLUE background like the WCB Deluxe set */ ROM_LOAD32_BYTE( "wcbf_prom2_1.40.prom2", 0x00002, 0x20000, CRC(d2fc4d09) SHA1(17983759ad6137a2e67b8414ea58880865311534) ) ROM_LOAD32_BYTE( "wcbf_prom3_1.40.prom3", 0x00003, 0x20000, CRC(c41258a4) SHA1(182e8a25bdb126a4de8a44a1c26fd8b66f06d66e) ) @@ -2458,8 +2458,8 @@ ROM_END ROM_START( wcbowl130 ) /* Version 1.30 Tournament (PCB P/N 1083 Rev 2) */ ROM_REGION32_BE( CODE_SIZE, "user1", 0 ) - ROM_LOAD32_BYTE( "wcb_prom0_v1.30t.prom0", 0x00000, 0x20000, NO_DUMP ) /* found as 3 loose chips missing WCB PROM0 V1.30T ROM */ - ROM_LOAD32_BYTE( "wcb_prom1_v1.30t.prom1", 0x00001, 0x20000, CRC(f4b8e7c3) SHA1(29471a464e783e820d7cde356b49d26b9394f513) ) + ROM_LOAD32_BYTE( "wcb_prom0_v1.30t.prom0", 0x00000, 0x20000, CRC(fbcde4e0) SHA1(8174c045686305c398f0414e2dea666ee4f9d668) ) /* Does NOT contain the Flash Bowling variation game */ + ROM_LOAD32_BYTE( "wcb_prom1_v1.30t.prom1", 0x00001, 0x20000, CRC(f4b8e7c3) SHA1(29471a464e783e820d7cde356b49d26b9394f513) ) /* Has RED background like other WCB sets */ ROM_LOAD32_BYTE( "wcb_prom2_v1.30t.prom2", 0x00002, 0x20000, CRC(f441afae) SHA1(31d619e63f951cfb08481474f08d278aeaa15c46) ) ROM_LOAD32_BYTE( "wcb_prom3_v1.30t.prom3", 0x00003, 0x20000, CRC(47e26d4b) SHA1(44459daef1ffe19640b26adcf122dfcd4a327a68) ) @@ -3115,22 +3115,22 @@ ROM_START( shufshot ) /* Version 1.40 (PCB P/N 1083 Rev 2) */ ROM_CONTINUE( 0x08000, 0x08000 ) ROM_REGION( 0x800000, "gfx1", 0 ) - ROM_LOAD32_BYTE( "shf_grom0_0.grm0_0", 0x000000, 0x80000, CRC(832a3d6a) SHA1(443328fa61b79c93ec6c9d24893b2ec38358a905) ) - ROM_LOAD32_BYTE( "shf_grom0_1.grm0_1", 0x000001, 0x80000, CRC(155e48a2) SHA1(187d65423ff9a3d6b6c34c885a1b2397fa5371cf) ) - ROM_LOAD32_BYTE( "shf_grom0_2.grm0_2", 0x000002, 0x80000, CRC(9f2b470d) SHA1(012e917856042cbe00d476e3220a7f9c841bd199) ) - ROM_LOAD32_BYTE( "shf_grom0_3.grm0_3", 0x000003, 0x80000, CRC(3855a16a) SHA1(f8c03efab87ddcb6940f657ad1f0138ceaa2118e) ) - ROM_LOAD32_BYTE( "shf_grom1_0.grm1_0", 0x200000, 0x80000, CRC(ed140389) SHA1(f438a887b44a277f81e954bef73ac478eaff58c8) ) - ROM_LOAD32_BYTE( "shf_grom1_1.grm1_1", 0x200001, 0x80000, CRC(bd2ffbca) SHA1(667692ce61a4896ceecf2a2bb37f742f175a6152) ) - ROM_LOAD32_BYTE( "shf_grom1_2.grm1_2", 0x200002, 0x80000, CRC(c6de4187) SHA1(4854604330bb14f862abe22d755e08b54e0b1a04) ) - ROM_LOAD32_BYTE( "shf_grom1_3.grm1_3", 0x200003, 0x80000, CRC(0c707aa2) SHA1(1da83523e04eeae4dbc8748a31a074331bf975d1) ) - ROM_LOAD32_BYTE( "shf_grom2_0.grm2_0", 0x400000, 0x80000, CRC(529b4259) SHA1(4f98f28c83c3f8f822ea45d31be526af4a504cbc) ) - ROM_LOAD32_BYTE( "shf_grom2_1.grm2_1", 0x400001, 0x80000, CRC(4b52ab1a) SHA1(5c438df7f2edea8f4d8734408fd94acf9d340755) ) - ROM_LOAD32_BYTE( "shf_grom2_2.grm2_2", 0x400002, 0x80000, CRC(f45fad03) SHA1(3ff062928ef5bcdce8748ddd972c5da67207227a) ) - ROM_LOAD32_BYTE( "shf_grom2_3.grm2_3", 0x400003, 0x80000, CRC(1bcb26c8) SHA1(49e730c56c4a3171a2962fa65f3b16481590c636) ) - ROM_LOAD32_BYTE( "shf_grom3_0.grm3_0", 0x600000, 0x80000, CRC(a29763db) SHA1(e2154fb3e400aba300f1a23d53504588426dfbfe) ) - ROM_LOAD32_BYTE( "shf_grom3_1.grm3_1", 0x600001, 0x80000, CRC(c757084c) SHA1(6f78ee13c68afd635aa3871cddf7207a19d4039b) ) - ROM_LOAD32_BYTE( "shf_grom3_2.grm3_2", 0x600002, 0x80000, CRC(2971cb25) SHA1(5f0508ebff1bf66ee0f78addfa09a43f8fff9a36) ) - ROM_LOAD32_BYTE( "shf_grom3_3.grm3_3", 0x600003, 0x80000, CRC(4fcbee51) SHA1(4e2ec4475986c3916c4566b2bc007f41a8c13609) ) + ROM_LOAD32_BYTE( "shf_grom0_0.grm0_0", 0x000000, 0x80000, CRC(832a3d6a) SHA1(443328fa61b79c93ec6c9d24893b2ec38358a905) ) + ROM_LOAD32_BYTE( "shf_grom0_1.grm0_1", 0x000001, 0x80000, CRC(155e48a2) SHA1(187d65423ff9a3d6b6c34c885a1b2397fa5371cf) ) + ROM_LOAD32_BYTE( "shf_grom0_2.grm0_2", 0x000002, 0x80000, CRC(9f2b470d) SHA1(012e917856042cbe00d476e3220a7f9c841bd199) ) + ROM_LOAD32_BYTE( "shf_grom0_3.grm0_3", 0x000003, 0x80000, CRC(3855a16a) SHA1(f8c03efab87ddcb6940f657ad1f0138ceaa2118e) ) + ROM_LOAD32_BYTE( "shf_grom1_0.grm1_0", 0x200000, 0x80000, CRC(ed140389) SHA1(f438a887b44a277f81e954bef73ac478eaff58c8) ) + ROM_LOAD32_BYTE( "shf_grom1_1.grm1_1", 0x200001, 0x80000, CRC(bd2ffbca) SHA1(667692ce61a4896ceecf2a2bb37f742f175a6152) ) + ROM_LOAD32_BYTE( "shf_grom1_2.grm1_2", 0x200002, 0x80000, CRC(c6de4187) SHA1(4854604330bb14f862abe22d755e08b54e0b1a04) ) + ROM_LOAD32_BYTE( "shf_grom1_3.grm1_3", 0x200003, 0x80000, CRC(0c707aa2) SHA1(1da83523e04eeae4dbc8748a31a074331bf975d1) ) + ROM_LOAD32_BYTE( "shf_grom2_0.grm2_0", 0x400000, 0x80000, CRC(529b4259) SHA1(4f98f28c83c3f8f822ea45d31be526af4a504cbc) ) + ROM_LOAD32_BYTE( "shf_grom2_1.grm2_1", 0x400001, 0x80000, CRC(4b52ab1a) SHA1(5c438df7f2edea8f4d8734408fd94acf9d340755) ) + ROM_LOAD32_BYTE( "shf_grom2_2.grm2_2", 0x400002, 0x80000, CRC(f45fad03) SHA1(3ff062928ef5bcdce8748ddd972c5da67207227a) ) + ROM_LOAD32_BYTE( "shf_grom2_3.grm2_3", 0x400003, 0x80000, CRC(1bcb26c8) SHA1(49e730c56c4a3171a2962fa65f3b16481590c636) ) + ROM_LOAD32_BYTE( "shfa_grom3_0.grm3_0", 0x600000, 0x80000, CRC(c5afc9d1) SHA1(db1f1559b26d2a7c21486f005fffae16e74af1c6) ) /* although different CRC32 values, they match programs internal checksum values */ + ROM_LOAD32_BYTE( "shfa_grom3_1.grm3_1", 0x600001, 0x80000, CRC(70dd7b68) SHA1(305bfcefb24f68bed4055c0e8819c31c95f7f853) ) /* changed with version 1.38 on IT dev CD */ + ROM_LOAD32_BYTE( "shfa_grom3_2.grm3_2", 0x600002, 0x80000, CRC(da56512d) SHA1(dce114b079ff06693a8ec8247c3d4e87969d686f) ) + ROM_LOAD32_BYTE( "shfa_grom3_3.grm3_3", 0x600003, 0x80000, CRC(21727c50) SHA1(db7f16f045f04b3bcb4b968344bc2eb641658add) ) ROM_REGION16_BE( 0x400000, "ensoniq.0", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE( "shf_srom0.srom0", 0x000000, 0x80000, CRC(9a3cb6c9) SHA1(2af3ce3b1cd7688199195a66cf01bb83775d42fa) ) @@ -3149,6 +3149,76 @@ ROM_START( shufshot139 ) /* Version 1.39 (PCB P/N 1083 Rev 2) */ ROM_LOAD( "shotsnd.u88", 0x10000, 0x18000, CRC(e37d599d) SHA1(105f91e968ecf553d910a97726ddc536289bbb2b) ) ROM_CONTINUE( 0x08000, 0x08000 ) + ROM_REGION( 0x800000, "gfx1", 0 ) + ROM_LOAD32_BYTE( "shf_grom0_0.grm0_0", 0x000000, 0x80000, CRC(832a3d6a) SHA1(443328fa61b79c93ec6c9d24893b2ec38358a905) ) + ROM_LOAD32_BYTE( "shf_grom0_1.grm0_1", 0x000001, 0x80000, CRC(155e48a2) SHA1(187d65423ff9a3d6b6c34c885a1b2397fa5371cf) ) + ROM_LOAD32_BYTE( "shf_grom0_2.grm0_2", 0x000002, 0x80000, CRC(9f2b470d) SHA1(012e917856042cbe00d476e3220a7f9c841bd199) ) + ROM_LOAD32_BYTE( "shf_grom0_3.grm0_3", 0x000003, 0x80000, CRC(3855a16a) SHA1(f8c03efab87ddcb6940f657ad1f0138ceaa2118e) ) + ROM_LOAD32_BYTE( "shf_grom1_0.grm1_0", 0x200000, 0x80000, CRC(ed140389) SHA1(f438a887b44a277f81e954bef73ac478eaff58c8) ) + ROM_LOAD32_BYTE( "shf_grom1_1.grm1_1", 0x200001, 0x80000, CRC(bd2ffbca) SHA1(667692ce61a4896ceecf2a2bb37f742f175a6152) ) + ROM_LOAD32_BYTE( "shf_grom1_2.grm1_2", 0x200002, 0x80000, CRC(c6de4187) SHA1(4854604330bb14f862abe22d755e08b54e0b1a04) ) + ROM_LOAD32_BYTE( "shf_grom1_3.grm1_3", 0x200003, 0x80000, CRC(0c707aa2) SHA1(1da83523e04eeae4dbc8748a31a074331bf975d1) ) + ROM_LOAD32_BYTE( "shf_grom2_0.grm2_0", 0x400000, 0x80000, CRC(529b4259) SHA1(4f98f28c83c3f8f822ea45d31be526af4a504cbc) ) + ROM_LOAD32_BYTE( "shf_grom2_1.grm2_1", 0x400001, 0x80000, CRC(4b52ab1a) SHA1(5c438df7f2edea8f4d8734408fd94acf9d340755) ) + ROM_LOAD32_BYTE( "shf_grom2_2.grm2_2", 0x400002, 0x80000, CRC(f45fad03) SHA1(3ff062928ef5bcdce8748ddd972c5da67207227a) ) + ROM_LOAD32_BYTE( "shf_grom2_3.grm2_3", 0x400003, 0x80000, CRC(1bcb26c8) SHA1(49e730c56c4a3171a2962fa65f3b16481590c636) ) + ROM_LOAD32_BYTE( "shfa_grom3_0.grm3_0", 0x600000, 0x80000, CRC(c5afc9d1) SHA1(db1f1559b26d2a7c21486f005fffae16e74af1c6) ) /* although different CRC32 values, they match programs internal checksum values */ + ROM_LOAD32_BYTE( "shfa_grom3_1.grm3_1", 0x600001, 0x80000, CRC(70dd7b68) SHA1(305bfcefb24f68bed4055c0e8819c31c95f7f853) ) /* changed with version 1.38 on IT dev CD */ + ROM_LOAD32_BYTE( "shfa_grom3_2.grm3_2", 0x600002, 0x80000, CRC(da56512d) SHA1(dce114b079ff06693a8ec8247c3d4e87969d686f) ) + ROM_LOAD32_BYTE( "shfa_grom3_3.grm3_3", 0x600003, 0x80000, CRC(21727c50) SHA1(db7f16f045f04b3bcb4b968344bc2eb641658add) ) + + ROM_REGION16_BE( 0x400000, "ensoniq.0", ROMREGION_ERASE00 ) + ROM_LOAD16_BYTE( "shf_srom0.srom0", 0x000000, 0x80000, CRC(9a3cb6c9) SHA1(2af3ce3b1cd7688199195a66cf01bb83775d42fa) ) + ROM_LOAD16_BYTE( "shf_srom1.srom1", 0x200000, 0x80000, CRC(8c89948a) SHA1(1054eca5de352c17f34f31ef16297ba6177a37ba) ) +ROM_END + + +ROM_START( shufshot138 ) /* Version 1.38 (PCB P/N 1083 Rev 2) - Not offically released? - found on dev CD */ + ROM_REGION32_BE( CODE_SIZE, "user1", 0 ) + ROM_LOAD32_BYTE( "shot_prom0_v1.38.prom0", 0x00000, 0x20000, CRC(68f823ff) SHA1(f9de8e45dd87e39bb256963cd356cbb9f985f3e8) ) + ROM_LOAD32_BYTE( "shot_prom1_v1.38.prom1", 0x00001, 0x20000, CRC(bdd9a8e9) SHA1(b4c0d3ab5ed66c7f43f309236708df355385ec5e) ) + ROM_LOAD32_BYTE( "shot_prom2_v1.38.prom2", 0x00002, 0x20000, CRC(92008e13) SHA1(2ed7cde67131e4baf1c127004d61d433d983467e) ) + ROM_LOAD32_BYTE( "shot_prom3_v1.38.prom3", 0x00003, 0x20000, CRC(723cb9a5) SHA1(2ac209053bce245130b6056fe0ebe048596ae3b4) ) + + ROM_REGION( 0x28000, "soundcpu", 0 ) + ROM_LOAD( "shotsnd.u88", 0x10000, 0x18000, CRC(e37d599d) SHA1(105f91e968ecf553d910a97726ddc536289bbb2b) ) + ROM_CONTINUE( 0x08000, 0x08000 ) + + ROM_REGION( 0x800000, "gfx1", 0 ) + ROM_LOAD32_BYTE( "shf_grom0_0.grm0_0", 0x000000, 0x80000, CRC(832a3d6a) SHA1(443328fa61b79c93ec6c9d24893b2ec38358a905) ) + ROM_LOAD32_BYTE( "shf_grom0_1.grm0_1", 0x000001, 0x80000, CRC(155e48a2) SHA1(187d65423ff9a3d6b6c34c885a1b2397fa5371cf) ) + ROM_LOAD32_BYTE( "shf_grom0_2.grm0_2", 0x000002, 0x80000, CRC(9f2b470d) SHA1(012e917856042cbe00d476e3220a7f9c841bd199) ) + ROM_LOAD32_BYTE( "shf_grom0_3.grm0_3", 0x000003, 0x80000, CRC(3855a16a) SHA1(f8c03efab87ddcb6940f657ad1f0138ceaa2118e) ) + ROM_LOAD32_BYTE( "shf_grom1_0.grm1_0", 0x200000, 0x80000, CRC(ed140389) SHA1(f438a887b44a277f81e954bef73ac478eaff58c8) ) + ROM_LOAD32_BYTE( "shf_grom1_1.grm1_1", 0x200001, 0x80000, CRC(bd2ffbca) SHA1(667692ce61a4896ceecf2a2bb37f742f175a6152) ) + ROM_LOAD32_BYTE( "shf_grom1_2.grm1_2", 0x200002, 0x80000, CRC(c6de4187) SHA1(4854604330bb14f862abe22d755e08b54e0b1a04) ) + ROM_LOAD32_BYTE( "shf_grom1_3.grm1_3", 0x200003, 0x80000, CRC(0c707aa2) SHA1(1da83523e04eeae4dbc8748a31a074331bf975d1) ) + ROM_LOAD32_BYTE( "shf_grom2_0.grm2_0", 0x400000, 0x80000, CRC(529b4259) SHA1(4f98f28c83c3f8f822ea45d31be526af4a504cbc) ) + ROM_LOAD32_BYTE( "shf_grom2_1.grm2_1", 0x400001, 0x80000, CRC(4b52ab1a) SHA1(5c438df7f2edea8f4d8734408fd94acf9d340755) ) + ROM_LOAD32_BYTE( "shf_grom2_2.grm2_2", 0x400002, 0x80000, CRC(f45fad03) SHA1(3ff062928ef5bcdce8748ddd972c5da67207227a) ) + ROM_LOAD32_BYTE( "shf_grom2_3.grm2_3", 0x400003, 0x80000, CRC(1bcb26c8) SHA1(49e730c56c4a3171a2962fa65f3b16481590c636) ) + ROM_LOAD32_BYTE( "shfa_grom3_0.grm3_0", 0x600000, 0x80000, CRC(c5afc9d1) SHA1(db1f1559b26d2a7c21486f005fffae16e74af1c6) ) /* although different CRC32 values, they match programs internal checksum values */ + ROM_LOAD32_BYTE( "shfa_grom3_1.grm3_1", 0x600001, 0x80000, CRC(70dd7b68) SHA1(305bfcefb24f68bed4055c0e8819c31c95f7f853) ) /* changed with version 1.38 on IT dev CD */ + ROM_LOAD32_BYTE( "shfa_grom3_2.grm3_2", 0x600002, 0x80000, CRC(da56512d) SHA1(dce114b079ff06693a8ec8247c3d4e87969d686f) ) + ROM_LOAD32_BYTE( "shfa_grom3_3.grm3_3", 0x600003, 0x80000, CRC(21727c50) SHA1(db7f16f045f04b3bcb4b968344bc2eb641658add) ) + + ROM_REGION16_BE( 0x400000, "ensoniq.0", ROMREGION_ERASE00 ) + ROM_LOAD16_BYTE( "shf_srom0.srom0", 0x000000, 0x80000, CRC(9a3cb6c9) SHA1(2af3ce3b1cd7688199195a66cf01bb83775d42fa) ) + ROM_LOAD16_BYTE( "shf_srom1.srom1", 0x200000, 0x80000, CRC(8c89948a) SHA1(1054eca5de352c17f34f31ef16297ba6177a37ba) ) +ROM_END + + +ROM_START( shufshot137 ) /* Version 1.37 (PCB P/N 1083 Rev 2) */ + ROM_REGION32_BE( CODE_SIZE, "user1", 0 ) + ROM_LOAD32_BYTE( "shot_prom0_v1.37.prom0", 0x00000, 0x20000, CRC(6499c76f) SHA1(60fdaefb09088ac609addd40569bd7fab12593bc) ) + ROM_LOAD32_BYTE( "shot_prom1_v1.37.prom1", 0x00001, 0x20000, CRC(64fb47a4) SHA1(32ce9d91b16b8aaf545c0a22842ad8d806727a17) ) + ROM_LOAD32_BYTE( "shot_prom2_v1.37.prom2", 0x00002, 0x20000, CRC(e0df3025) SHA1(edff5c5c4486981ac0783f337a0845854d0217f0) ) + ROM_LOAD32_BYTE( "shot_prom3_v1.37.prom3", 0x00003, 0x20000, CRC(efa66ad8) SHA1(d8dc754529284e6c06b912e226c8a4520aab49fc) ) + + ROM_REGION( 0x28000, "soundcpu", 0 ) + ROM_LOAD( "shotsnd.u88", 0x10000, 0x18000, CRC(e37d599d) SHA1(105f91e968ecf553d910a97726ddc536289bbb2b) ) + ROM_CONTINUE( 0x08000, 0x08000 ) + ROM_REGION( 0x800000, "gfx1", 0 ) ROM_LOAD32_BYTE( "shf_grom0_0.grm0_0", 0x000000, 0x80000, CRC(832a3d6a) SHA1(443328fa61b79c93ec6c9d24893b2ec38358a905) ) ROM_LOAD32_BYTE( "shf_grom0_1.grm0_1", 0x000001, 0x80000, CRC(155e48a2) SHA1(187d65423ff9a3d6b6c34c885a1b2397fa5371cf) ) @@ -3173,12 +3243,12 @@ ROM_START( shufshot139 ) /* Version 1.39 (PCB P/N 1083 Rev 2) */ ROM_END -ROM_START( shufshot137 ) /* Version 1.37 (PCB P/N 1083 Rev 2) */ +ROM_START( shufshot135 ) /* Version 1.35 (PCB P/N 1083 Rev 2) - Not offically released? - found on dev CD */ ROM_REGION32_BE( CODE_SIZE, "user1", 0 ) - ROM_LOAD32_BYTE( "shot_prom0_v1.37.prom0", 0x00000, 0x20000, CRC(6499c76f) SHA1(60fdaefb09088ac609addd40569bd7fab12593bc) ) - ROM_LOAD32_BYTE( "shot_prom1_v1.37.prom1", 0x00001, 0x20000, CRC(64fb47a4) SHA1(32ce9d91b16b8aaf545c0a22842ad8d806727a17) ) - ROM_LOAD32_BYTE( "shot_prom2_v1.37.prom2", 0x00002, 0x20000, CRC(e0df3025) SHA1(edff5c5c4486981ac0783f337a0845854d0217f0) ) - ROM_LOAD32_BYTE( "shot_prom3_v1.37.prom3", 0x00003, 0x20000, CRC(efa66ad8) SHA1(d8dc754529284e6c06b912e226c8a4520aab49fc) ) + ROM_LOAD32_BYTE( "shot_prom0_v1.35.prom0", 0x00000, 0x20000, CRC(1a1d510c) SHA1(b1919beee499fb4e213a987ad796742dbfbd540b) ) + ROM_LOAD32_BYTE( "shot_prom1_v1.35.prom1", 0x00001, 0x20000, CRC(5d7d5017) SHA1(8330339bd45c30066650a2a6cc7e12f365c91608) ) + ROM_LOAD32_BYTE( "shot_prom2_v1.35.prom2", 0x00002, 0x20000, CRC(6f27b111) SHA1(9f9a95948662003edee2aeb2230b64e6401b4e49) ) + ROM_LOAD32_BYTE( "shot_prom3_v1.35.prom3", 0x00003, 0x20000, CRC(bf6fabbb) SHA1(3f52791b974a6170fad492c0270270f5712c8506) ) ROM_REGION( 0x28000, "soundcpu", 0 ) ROM_LOAD( "shotsnd.u88", 0x10000, 0x18000, CRC(e37d599d) SHA1(105f91e968ecf553d910a97726ddc536289bbb2b) ) @@ -4770,6 +4840,9 @@ GAME( 1995, wcbowl13j, wcbowl, bloodstm, wcbowlj, itech32_state, init_wcb GAME( 1995, wcbowl12, wcbowl, bloodstm, wcbowl, itech32_state, init_wcbowl, ROT0, "Incredible Technologies", "World Class Bowling (v1.2)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-1 */ GAME( 1995, wcbowl11, wcbowl, bloodstm, wcbowl, itech32_state, init_wcbowl, ROT0, "Incredible Technologies", "World Class Bowling (v1.1)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-1 */ GAME( 1995, wcbowl10, wcbowl, bloodstm, wcbowl, itech32_state, init_wcbowl, ROT0, "Incredible Technologies", "World Class Bowling (v1.0)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-1 */ +GAME( 1999, wcbowldx, wcbowl, sftm, wcbowldx, itech32_state, init_shufshot, ROT0, "Incredible Technologies", "World Class Bowling Deluxe (v2.00)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-4 */ +GAME( 1997, wcbowl140, wcbowl, tourny, wcbowldx, itech32_state, init_wcbowlt, ROT0, "Incredible Technologies", "World Class Bowling Tournament (v1.40)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-3 */ +GAME( 1997, wcbowl130, wcbowl, tourny, wcbowlo, itech32_state, init_wcbowlt, ROT0, "Incredible Technologies", "World Class Bowling Tournament (v1.30)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-3 */ GAME( 1995, sftm, 0, sftm, sftm, itech32_state, init_sftm, ROT0, "Capcom / Incredible Technologies", "Street Fighter: The Movie (v1.12)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSF-1 */ GAME( 1995, sftm111, sftm, sftm, sftm, itech32_state, init_sftm110, ROT0, "Capcom / Incredible Technologies", "Street Fighter: The Movie (v1.11)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSF-1 */ GAME( 1995, sftm110, sftm, sftm, sftm, itech32_state, init_sftm110, ROT0, "Capcom / Incredible Technologies", "Street Fighter: The Movie (v1.10)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSF-1 */ @@ -4777,10 +4850,9 @@ GAME( 1995, sftmj114, sftm, sftm, sftm, itech32_state, init_sft GAME( 1995, sftmj112, sftm, sftm, sftm, itech32_state, init_sftm, ROT0, "Capcom / Incredible Technologies", "Street Fighter: The Movie (v1.12N, Japan)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSF-1 */ GAME( 1997, shufshot, 0, sftm, shufshot, itech32_state, init_shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.40)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSHF-1 */ GAME( 1997, shufshot139, shufshot, sftm, shufshot, itech32_state, init_shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.39)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSHF-1 */ +GAME( 1997, shufshot138, shufshot, sftm, shufshto, itech32_state, init_shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.38)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSHF-1 */ GAME( 1997, shufshot137, shufshot, sftm, shufshto, itech32_state, init_shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.37)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSHF-1 */ -GAME( 1997, wcbowl130, wcbowldx, tourny, wcbowldx, itech32_state, init_wcbowlt, ROT0, "Incredible Technologies", "World Class Bowling Tournament (v1.30)" , MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-3 *** missing program ROM PROM0 */ -GAME( 1997, wcbowl140, wcbowldx, tourny, wcbowldx, itech32_state, init_wcbowlt, ROT0, "Incredible Technologies", "World Class Bowling Tournament (v1.40)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-3 */ -GAME( 1999, wcbowldx, 0, sftm, wcbowldx, itech32_state, init_shufshot, ROT0, "Incredible Technologies", "World Class Bowling Deluxe (v2.00)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITBWL-4 */ +GAME( 1997, shufshot135, shufshot, sftm, shufshot, itech32_state, init_shufshot, ROT0, "Strata/Incredible Technologies", "Shuffleshot (v1.35)" , MACHINE_SUPPORTS_SAVE ) /* PIC 16C54 labeled as ITSHF-1 */ /* The following naming conventions are used: diff --git a/src/mame/drivers/jr100.cpp b/src/mame/drivers/jr100.cpp index 842c0d20607..24854edc556 100644 --- a/src/mame/drivers/jr100.cpp +++ b/src/mame/drivers/jr100.cpp @@ -44,8 +44,12 @@ bit 1: left bit 0: right TODO: -- Cassette loading doesn't work. Save is verified good. - Need software. +- Paste drops many characters. +- Cassette not working correctly. If the VIA divider is 32, then SAVE produces + a good 600 baud recording (verified on super80). But the divider must be 16 + to LOAD the tape back in. It is suspected that the VIA has a timer bug. + ****************************************************************************/ @@ -127,70 +131,70 @@ void jr100_state::mem_map(address_map &map) map(0xe000, 0xffff).rom().share("rom"); } -/* Input ports */ +// Input ports - names in [ ] are screen actions; otherwise the text is literally printed onscreen INPUT_PORTS_START( jr100 ) PORT_START("LINE0") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) // Z - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) // X - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) // C + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z [Line Insert]") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X [Cancel]") PORT_CODE(KEYCODE_X) PORT_CHAR('X') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C [Break]") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE1") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) // A - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) // S - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) // D - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) // F - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) // G + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A Auto") PORT_CODE(KEYCODE_A) PORT_CHAR('A') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S Stop") PORT_CODE(KEYCODE_S) PORT_CHAR('S') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D Dim") PORT_CODE(KEYCODE_D) PORT_CHAR('D') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F For") PORT_CODE(KEYCODE_F) PORT_CHAR('F') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G Goto") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) // Q - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) // W - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) // E - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) // R - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) // T + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q Gosub") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W Ret") PORT_CODE(KEYCODE_W) PORT_CHAR('W') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E End") PORT_CODE(KEYCODE_E) PORT_CHAR('E') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R Run") PORT_CODE(KEYCODE_R) PORT_CHAR('R') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T Then") PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE3") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) // 1 - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) // 2 - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) // 3 - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) // 4 - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) // 5 + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 ! [Home]") PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 \" Verify") PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR(34) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 # Save") PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $ Load") PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 % [Delete]") PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE4") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) // 6 - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) // 7 - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) // 8 - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) // 9 - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) // 0 + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6 & " UTF8_LEFT) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7 ' " UTF8_DOWN) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR(39) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 ( " UTF8_UP) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 ) " UTF8_RIGHT) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 ^ [Insert]") PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('^') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE5") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) // Y - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) // U - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) // I - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) // O - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) // P + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y Locate") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U @ If") PORT_CODE(KEYCODE_U) PORT_CHAR('U') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I \xc2\xa5 Input") PORT_CODE(KEYCODE_I) PORT_CHAR('I') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O [ Option") PORT_CODE(KEYCODE_O) PORT_CHAR('O') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P ] Print") PORT_CODE(KEYCODE_P) PORT_CHAR('P') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE6") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) // H - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) // J - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) // K - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) // L - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) // ; + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H Poke") PORT_CODE(KEYCODE_H) PORT_CHAR('H') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J Rnd(") PORT_CODE(KEYCODE_J) PORT_CHAR('J') + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K ? Read") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_CHAR('?') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L / List") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_CHAR('/') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("; + Rem") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE7") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) // V - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) // B - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) // N - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) // M - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) // , + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V [Graphics]") PORT_CODE(KEYCODE_V) PORT_CHAR('V') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B [Hcopy]") PORT_CODE(KEYCODE_B) PORT_CHAR('B') // HCOPY doesn't seem to do anything + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N Next") PORT_CODE(KEYCODE_N) PORT_CHAR('N') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M _ Cls") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_CHAR('_') + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(", < Data") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("LINE8") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) // . - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) // space - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) // : - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) // enter - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) // - + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(". > Peek(") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(32) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(": * Chr$(") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("- = [Del]") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') PORT_BIT(0xE0, IP_ACTIVE_LOW, IPT_UNUSED) INPUT_PORTS_END @@ -298,7 +302,6 @@ WRITE_LINE_MEMBER(jr100_state::cb2_w) m_cassette->output(state ? -1.0 : +1.0); } -// not working; code doesn't seem right TIMER_CALLBACK_MEMBER(jr100_state::sound_tick) { double level = (m_cassette->input()); @@ -386,7 +389,7 @@ void jr100_state::jr100(machine_config &config) GFXDECODE(config, "gfxdecode", "palette", gfx_jr100); PALETTE(config, "palette", palette_device::MONOCHROME); - VIA6522(config, m_via, XTAL(14'318'181) / 32); // this divider produces the correct cassette save frequencies + VIA6522(config, m_via, XTAL(14'318'181) / 16); // see note in TODO m_via->readpb_handler().set(FUNC(jr100_state::pb_r)); m_via->writepa_handler().set(FUNC(jr100_state::pa_w)); m_via->writepb_handler().set(FUNC(jr100_state::pb_w)); diff --git a/src/mame/drivers/juku.cpp b/src/mame/drivers/juku.cpp index 0da5ae5672a..0ab5ca60f12 100644 --- a/src/mame/drivers/juku.cpp +++ b/src/mame/drivers/juku.cpp @@ -70,7 +70,7 @@ protected: virtual void machine_reset() override; private: - required_device m_maincpu; + required_device m_maincpu; required_device m_bank; required_device m_pic; required_device_array m_pit; @@ -456,7 +456,7 @@ void juku_state::juku(machine_config &config) I8080A(config, m_maincpu, 2000000); m_maincpu->set_addrmap(AS_PROGRAM, &juku_state::mem_map); m_maincpu->set_addrmap(AS_IO, &juku_state::io_map); - m_maincpu->set_irq_acknowledge_callback("pic", FUNC(pic8259_device::inta_cb)); + m_maincpu->in_inta_func().set("pic", FUNC(pic8259_device::acknowledge)); ADDRESS_MAP_BANK(config, m_bank); m_bank->set_map(&juku_state::bank_map); diff --git a/src/mame/drivers/kikikai.cpp b/src/mame/drivers/kikikai.cpp index dd587149397..f8fd906e102 100644 --- a/src/mame/drivers/kikikai.cpp +++ b/src/mame/drivers/kikikai.cpp @@ -24,10 +24,6 @@ Notes: To set it up, just enable the single board 4p mode and keep the master/slave mode to off and the board ID to master. -- kicknrun the MC6801U4 mcu has been decapped and it's internal ROM has beed dumped. - Currently it's not hooked up properly, initial hook up is based the code from - Bubble Bobble - see bublbobl.ccp - - mexico86 does a PS4 STOP ERROR shortly after boot, but works afterwards. PS4 is the MC6801U4 mcu, the bootleggers replaced it with a custom programmed 68705 MCU. @@ -90,21 +86,21 @@ READ8_MEMBER(kikikai_state::kiki_ym2203_r) * *************************************/ -void kikikai_state::mexico86_map(address_map &map) +void kikikai_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xbfff).bankr("bank1"); /* banked roms */ map(0xc000, 0xe7ff).ram().share("mainram"); /* shared with sound cpu */ map(0xe800, 0xe8ff).ram().share("mcu_sharedram"); /* shared with mcu */ map(0xe900, 0xefff).ram(); - map(0xf000, 0xf000).w(FUNC(kikikai_state::mexico86_bankswitch_w)); /* program and gfx ROM banks */ - map(0xf008, 0xf008).w(FUNC(kikikai_state::mexico86_f008_w)); /* cpu reset lines + other unknown stuff */ + map(0xf000, 0xf000).w(FUNC(kikikai_state::main_bankswitch_w)); /* program and gfx ROM banks */ + map(0xf008, 0xf008).w(FUNC(kikikai_state::main_f008_w)); /* cpu reset lines + other unknown stuff */ map(0xf010, 0xf010).portr("IN3"); map(0xf018, 0xf018).nopw(); /* watchdog? */ map(0xf800, 0xffff).ram().share("subram"); /* communication ram - to connect 4 players's subboard */ } -void kikikai_state::mexico86_sound_map(address_map &map) +void kikikai_state::sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0xa7ff).ram().share("mainram"); /* shared with main */ @@ -112,7 +108,7 @@ void kikikai_state::mexico86_sound_map(address_map &map) map(0xc000, 0xc001).r(FUNC(kikikai_state::kiki_ym2203_r)).w(m_ymsnd, FUNC(ym2203_device::write)); } -WRITE8_MEMBER(kikikai_state::mexico86_sub_output_w) +WRITE8_MEMBER(kikikai_state::kicknrun_sub_output_w) { /*--x- ---- coin lockout 2*/ /*---x ---- coin lockout 1*/ @@ -120,7 +116,7 @@ WRITE8_MEMBER(kikikai_state::mexico86_sub_output_w) /*---- --x- */ } -void kikikai_state::mexico86_sub_cpu_map(address_map &map) +void kikikai_state::kicknrun_sub_cpu_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0x47ff).ram(); /* sub cpu ram */ @@ -129,7 +125,7 @@ void kikikai_state::mexico86_sub_cpu_map(address_map &map) map(0xc001, 0xc001).portr("IN5"); map(0xc002, 0xc002).portr("IN6"); map(0xc003, 0xc003).portr("IN7"); - map(0xc004, 0xc004).w(FUNC(kikikai_state::mexico86_sub_output_w)); + map(0xc004, 0xc004).w(FUNC(kikikai_state::kicknrun_sub_output_w)); } /************************************* @@ -138,6 +134,130 @@ void kikikai_state::mexico86_sub_cpu_map(address_map &map) * *************************************/ +static INPUT_PORTS_START( kicknrun ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) /* service 2 */ + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW0") + /* When Bit 1 is On, the machine waits a signal from another one */ + /* Seems like if you can join two cabinets, one as master */ + /* and the other as slave, probably to play four players. */ + PORT_DIPNAME( 0x01, 0x01, "Master/Slave Mode" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") // Screen ? + PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) PORT_DIPLOCATION("SW1:3") + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:4") // Demo Sounds only play every 8th Demo + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:5,6") + PORT_DIPSETTING( 0x10, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x30, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 1C_2C ) ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:7,8") + PORT_DIPSETTING( 0x40, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0xc0, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x00, DEF_STR( 2C_3C ) ) + PORT_DIPSETTING( 0x80, DEF_STR( 1C_2C ) ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x03, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x01, DEF_STR( Hard ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) + PORT_DIPNAME( 0x0c, 0x08, "Playing Time" ) PORT_DIPLOCATION("SW2:3,4") + PORT_DIPSETTING( 0x00, "40 Seconds" ) + PORT_DIPSETTING( 0x0c, "One Minute" ) + PORT_DIPSETTING( 0x08, "One Minute and 20 Sec." ) + PORT_DIPSETTING( 0x04, "One Minute and 40 Sec." ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + /* The following dip seems to be related with the first one */ + PORT_DIPNAME( 0x20, 0x20, "Board ID" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x20, "Master" ) + PORT_DIPSETTING( 0x00, "Slave" ) + PORT_DIPNAME( 0x40, 0x40, "Number of Matches" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x00, "2" ) + PORT_DIPSETTING( 0x40, "6" ) + PORT_DIPNAME( 0x80, 0x80, "Single board 4 Players Mode" ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //p3 service + + PORT_START("IN5") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) //p4 service + + PORT_START("IN6") + PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_COIN3 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START3 ) + PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN7") + PORT_BIT( 0x01, IP_ACTIVE_HIGH,IPT_COIN4 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START4 ) + PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + static INPUT_PORTS_START( mexico86 ) PORT_START("IN0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) @@ -400,53 +520,75 @@ void kikikai_state::machine_start() membank("bank1")->configure_entries(0, 6, &ROM[0x08000], 0x4000); + save_item(NAME(m_charbank)); + +} + +void mexico86_state::machine_start() +{ + kikikai_state::machine_start(); + save_item(NAME(m_port_a_out)); save_item(NAME(m_port_b_out)); save_item(NAME(m_address)); save_item(NAME(m_latch)); + m_port_a_out = 0xff; + m_port_b_out = 0xff; +} + +void kikikai_simulation_state::machine_start() +{ + kikikai_state::machine_start(); + save_item(NAME(m_kikikai_simulated_mcu_running)); save_item(NAME(m_kikikai_simulated_mcu_initialised)); save_item(NAME(m_coin_last)); save_item(NAME(m_coin_fract)); - - save_item(NAME(m_charbank)); - - m_port_a_out = 0xff; - m_port_b_out = 0xff; } + void kikikai_state::machine_reset() { /*TODO: check the PCB and see how the halt / reset lines are connected. */ if (m_subcpu != nullptr) m_subcpu->set_input_line(INPUT_LINE_RESET, (ioport("DSW1")->read() & 0x80) ? ASSERT_LINE : CLEAR_LINE); + m_charbank = 0; +} + +void mexico86_state::machine_reset() +{ + kikikai_state::machine_reset(); + m_address = 0; m_latch = 0; +} + +void kikikai_simulation_state::machine_reset() +{ + kikikai_state::machine_reset(); m_kikikai_simulated_mcu_running = 0; m_kikikai_simulated_mcu_initialised = 0; m_coin_last[0] = false; m_coin_last[1] = false; m_coin_fract = 0; - - m_charbank = 0; } -void kikikai_state::mexico86(machine_config &config) +void kikikai_state::base(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 24000000/4); /* 6 MHz, Uses clock divided 24MHz OSC */ - m_maincpu->set_addrmap(AS_PROGRAM, &kikikai_state::mexico86_map); + m_maincpu->set_addrmap(AS_PROGRAM, &kikikai_state::main_map); Z80(config, m_audiocpu, 24000000/4); /* 6 MHz, Uses clock divided 24MHz OSC */ - m_audiocpu->set_addrmap(AS_PROGRAM, &kikikai_state::mexico86_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &kikikai_state::sound_map); m_audiocpu->set_vblank_int("screen", FUNC(kikikai_state::irq0_line_hold)); Z80(config, m_subcpu, 8000000/2); /* 4 MHz, Uses 8Mhz OSC */ - m_subcpu->set_addrmap(AS_PROGRAM, &kikikai_state::mexico86_sub_cpu_map); + m_subcpu->set_addrmap(AS_PROGRAM, &kikikai_state::kicknrun_sub_cpu_map); m_subcpu->set_vblank_int("screen", FUNC(kikikai_state::irq0_line_hold)); /* 100 CPU slices per frame - high value to ensure proper synchronization of the CPUs */ @@ -454,11 +596,8 @@ void kikikai_state::mexico86(machine_config &config) /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); /* frames per second, vblank duration */ - m_screen->set_size(32*8, 32*8); - m_screen->set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - m_screen->set_screen_update(FUNC(kikikai_state::screen_update_mexico86)); + m_screen->set_raw(24000000/4, 384, 0, 256, 264, 16, 240); + m_screen->set_screen_update(FUNC(kikikai_state::screen_update_kicknrun)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_mexico86); @@ -476,62 +615,66 @@ void kikikai_state::mexico86(machine_config &config) m_ymsnd->add_route(3, "mono", 1.00); } -void kikikai_state::mexico86_68705(machine_config& config) -{ - mexico86(config); - - M68705P3(config, m_68705mcu, 4000000); /* xtal is 4MHz, divided by 4 internally */ - m_68705mcu->portc_r().set_ioport("IN0"); - m_68705mcu->porta_w().set(FUNC(kikikai_state::mexico86_68705_port_a_w)); - m_68705mcu->portb_w().set(FUNC(kikikai_state::mexico86_68705_port_b_w)); - m_68705mcu->set_vblank_int("screen", FUNC(kikikai_state::mexico86_m68705_interrupt)); -} void kikikai_state::mcu_map(address_map &map) { - map(0x0000, 0x0000).rw(FUNC(kikikai_state::bublbobl_mcu_ddr1_r), FUNC(kikikai_state::bublbobl_mcu_ddr1_w)); - map(0x0001, 0x0001).rw(FUNC(kikikai_state::bublbobl_mcu_ddr2_r), FUNC(kikikai_state::bublbobl_mcu_ddr2_w)); - map(0x0002, 0x0002).rw(FUNC(kikikai_state::bublbobl_mcu_port1_r), FUNC(kikikai_state::bublbobl_mcu_port1_w)); - map(0x0003, 0x0003).rw(FUNC(kikikai_state::bublbobl_mcu_port2_r), FUNC(kikikai_state::bublbobl_mcu_port2_w)); - map(0x0004, 0x0004).rw(FUNC(kikikai_state::bublbobl_mcu_ddr3_r), FUNC(kikikai_state::bublbobl_mcu_ddr3_w)); - map(0x0005, 0x0005).rw(FUNC(kikikai_state::bublbobl_mcu_ddr4_r), FUNC(kikikai_state::bublbobl_mcu_ddr4_w)); - map(0x0006, 0x0006).rw(FUNC(kikikai_state::bublbobl_mcu_port3_r), FUNC(kikikai_state::bublbobl_mcu_port3_w)); - map(0x0007, 0x0007).rw(FUNC(kikikai_state::bublbobl_mcu_port4_r), FUNC(kikikai_state::bublbobl_mcu_port4_w)); + map(0x0000, 0x0000).rw(FUNC(kikikai_state::kikikai_mcu_ddr1_r), FUNC(kikikai_state::kikikai_mcu_ddr1_w)); + map(0x0001, 0x0001).rw(FUNC(kikikai_state::kikikai_mcu_ddr2_r), FUNC(kikikai_state::kikikai_mcu_ddr2_w)); + map(0x0002, 0x0002).rw(FUNC(kikikai_state::kikikai_mcu_port1_r), FUNC(kikikai_state::kikikai_mcu_port1_w)); + map(0x0003, 0x0003).rw(FUNC(kikikai_state::kikikai_mcu_port2_r), FUNC(kikikai_state::kikikai_mcu_port2_w)); + map(0x0004, 0x0004).rw(FUNC(kikikai_state::kikikai_mcu_ddr3_r), FUNC(kikikai_state::kikikai_mcu_ddr3_w)); + map(0x0005, 0x0005).rw(FUNC(kikikai_state::kikikai_mcu_ddr4_r), FUNC(kikikai_state::kikikai_mcu_ddr4_w)); + map(0x0006, 0x0006).rw(FUNC(kikikai_state::kikikai_mcu_port3_r), FUNC(kikikai_state::kikikai_mcu_port3_w)); + map(0x0007, 0x0007).rw(FUNC(kikikai_state::kikikai_mcu_port4_r), FUNC(kikikai_state::kikikai_mcu_port4_w)); map(0x0040, 0x00ff).ram(); map(0xf000, 0xffff).rom(); } - void kikikai_state::kicknrun(machine_config& config) { - mexico86(config); + base(config); + + // Not too sure IRQs are triggered by MCU.. + m_maincpu->set_vblank_int("screen", FUNC(kikikai_state::kikikai_interrupt)); M6801(config, m_mcu, XTAL(4'000'000)); // actually 6801U4 - xtal is 4MHz, divided by 4 internally m_mcu->set_addrmap(AS_PROGRAM, &kikikai_state::mcu_map); + config.set_perfect_quantum(m_maincpu); + m_screen->screen_vblank().set_inputline(m_mcu, M6801_IRQ_LINE); // same clock latches the INT pin on the second Z80 } -void kikikai_state::knightb(machine_config &config) +void kikikai_simulation_state::kikikai(machine_config &config) +{ + base(config); + + config.device_remove("sub"); + m_screen->set_screen_update(FUNC(kikikai_simulation_state::screen_update_kikikai)); + + // IRQs should be triggered by the MCU, but we don't have it + m_maincpu->set_vblank_int("screen", FUNC(kikikai_simulation_state::kikikai_interrupt)); +} + + +void mexico86_state::mexico86_68705(machine_config& config) +{ + base(config); + + M68705P3(config, m_68705mcu, 4000000); /* xtal is 4MHz, divided by 4 internally */ + m_68705mcu->portc_r().set_ioport("IN0"); + m_68705mcu->porta_w().set(FUNC(mexico86_state::mexico86_68705_port_a_w)); + m_68705mcu->portb_w().set(FUNC(mexico86_state::mexico86_68705_port_b_w)); + m_68705mcu->set_vblank_int("screen", FUNC(mexico86_state::mexico86_m68705_interrupt)); +} + +void mexico86_state::knightb(machine_config &config) { mexico86_68705(config); config.device_remove("sub"); - m_screen->set_screen_update(FUNC(kikikai_state::screen_update_kikikai)); -} - -void kikikai_state::kikikai(machine_config &config) -{ - knightb(config); - - // IRQs should be triggered by the MCU, but we don't have it - m_maincpu->set_vblank_int("screen", FUNC(kikikai_state::kikikai_interrupt)); - - config.device_remove("68705mcu"); // we don't have code for the MC6801U4 - - /* video hardware */ - m_screen->set_screen_update(FUNC(kikikai_state::screen_update_kikikai)); + m_screen->set_screen_update(FUNC(mexico86_state::screen_update_kikikai)); } @@ -734,9 +877,10 @@ ROM_END * *************************************/ -GAME( 1986, kikikai, 0, kikikai, kikikai, kikikai_state, empty_init, ROT90, "Taito Corporation", "KiKi KaiKai", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, knightb, kikikai, knightb, kikikai, kikikai_state, empty_init, ROT90, "bootleg", "Knight Boy", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, kicknrun, 0, kicknrun, mexico86, kikikai_state, empty_init, ROT0, "Taito Corporation", "Kick and Run (World)", MACHINE_NOT_WORKING ) -GAME( 1986, kicknrunu,kicknrun, kicknrun, mexico86, kikikai_state, empty_init, ROT0, "Taito America Corp", "Kick and Run (US)", MACHINE_NOT_WORKING ) -GAME( 1986, mexico86, kicknrun, mexico86_68705, mexico86, kikikai_state, empty_init, ROT0, "bootleg", "Mexico 86 (bootleg of Kick and Run) (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, mexico86a,kicknrun, mexico86_68705, mexico86, kikikai_state, empty_init, ROT0, "bootleg", "Mexico 86 (bootleg of Kick and Run) (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, kikikai, 0, kikikai, kikikai, kikikai_simulation_state, empty_init, ROT90, "Taito Corporation", "KiKi KaiKai", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, knightb, kikikai, knightb, kikikai, mexico86_state, empty_init, ROT90, "bootleg", "Knight Boy", MACHINE_SUPPORTS_SAVE ) + +GAME( 1986, kicknrun, 0, kicknrun, kicknrun, kikikai_state, empty_init, ROT0, "Taito Corporation", "Kick and Run (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, kicknrunu,kicknrun, kicknrun, kicknrun, kikikai_state, empty_init, ROT0, "Taito America Corp", "Kick and Run (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, mexico86, kicknrun, mexico86_68705, mexico86, mexico86_state, empty_init, ROT0, "bootleg", "Mexico 86 (bootleg of Kick and Run) (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, mexico86a,kicknrun, mexico86_68705, mexico86, mexico86_state, empty_init, ROT0, "bootleg", "Mexico 86 (bootleg of Kick and Run) (set 2)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/ladybug.cpp b/src/mame/drivers/ladybug.cpp index 6160930e578..150a1327936 100644 --- a/src/mame/drivers/ladybug.cpp +++ b/src/mame/drivers/ladybug.cpp @@ -1016,7 +1016,7 @@ GAME( 1981, cavenger, 0, ladybug, cavenger, ladybug_state, empty_init, GAME( 1981, ladybug, 0, ladybug, ladybug, ladybug_state, empty_init, ROT270, "Universal", "Lady Bug", MACHINE_SUPPORTS_SAVE ) GAME( 1981, ladybugb, ladybug, ladybug, ladybug, ladybug_state, empty_init, ROT270, "bootleg", "Lady Bug (bootleg set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1981, ladybugb2, ladybug, ladybug, ladybug, ladybug_state, empty_init, ROT270, "bootleg (Model Racing)", "Coccinelle (bootleg of Lady Bug, set 2)", MACHINE_SUPPORTS_SAVE ) // title removed, but manual names it Coccinelle +GAME( 1981, snapjack, 0, ladybug, snapjack, ladybug_state, empty_init, ROT0, "Universal", "Snap Jack", MACHINE_SUPPORTS_SAVE ) GAME( 1982, dorodon, 0, dorodon, dorodon, dorodon_state, init_dorodon, ROT270, "UPL (Falcon license?)", "Dorodon (set 1)", MACHINE_SUPPORTS_SAVE ) // license or bootleg? GAME( 1982, dorodon2, dorodon, dorodon, dorodon, dorodon_state, init_dorodon, ROT270, "UPL (Falcon license?)", "Dorodon (set 2)", MACHINE_SUPPORTS_SAVE ) // " -GAME( 1982, snapjack, 0, ladybug, snapjack, ladybug_state, empty_init, ROT0, "Universal", "Snap Jack", MACHINE_SUPPORTS_SAVE ) GAME( 1982, sraider, 0, sraider, sraider, sraider_state, empty_init, ROT270, "Universal", "Space Raider", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/liberatr.cpp b/src/mame/drivers/liberatr.cpp index ad85bacf248..f659567caa9 100644 --- a/src/mame/drivers/liberatr.cpp +++ b/src/mame/drivers/liberatr.cpp @@ -138,6 +138,7 @@ #include "emu.h" #include "includes/liberatr.h" +#include "machine/rescap.h" #include "speaker.h" #define MASTER_CLOCK 20000000 /* 20Mhz Main Clock Xtal */ diff --git a/src/mame/drivers/lockon.cpp b/src/mame/drivers/lockon.cpp index 8a38382647b..ec1497f273e 100644 --- a/src/mame/drivers/lockon.cpp +++ b/src/mame/drivers/lockon.cpp @@ -19,6 +19,7 @@ #include "cpu/nec/nec.h" #include "cpu/z80/z80.h" #include "machine/adc0808.h" +#include "machine/rescap.h" #include "sound/2203intf.h" #include "sound/flt_vol.h" #include "speaker.h" diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp index 3c7d19ef6a7..a3944ba5d82 100644 --- a/src/mame/drivers/mac.cpp +++ b/src/mame/drivers/mac.cpp @@ -179,14 +179,14 @@ WRITE32_MEMBER( mac_state::ariel_ramdac_w ) // this is for the "Ariel" style RAM { m_palette->set_pen_color(m_rbv_clutoffs, rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2])); m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[2], m_rbv_colors[2], m_rbv_colors[2]); - m_rbv_clutoffs++; + m_rbv_clutoffs = (m_rbv_clutoffs + 1) & 0xff; m_rbv_count = 0; } else { m_palette->set_pen_color(m_rbv_clutoffs, rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2])); m_rbv_palette[m_rbv_clutoffs] = rgb_t(m_rbv_colors[0], m_rbv_colors[1], m_rbv_colors[2]); - m_rbv_clutoffs++; + m_rbv_clutoffs = (m_rbv_clutoffs + 1) & 0xff; m_rbv_count = 0; } } diff --git a/src/mame/drivers/mac128.cpp b/src/mame/drivers/mac128.cpp index d5c5b8dc957..c6799f2f564 100644 --- a/src/mame/drivers/mac128.cpp +++ b/src/mame/drivers/mac128.cpp @@ -114,9 +114,6 @@ c0 8 data bits, Rx disabled #define C7M (15.6672_MHz_XTAL / 2) #define C3_7M (15.6672_MHz_XTAL / 4).value() -// uncomment to run i8021 keyboard in original Mac/512(e)/Plus -//#define MAC_USE_EMULATED_KBD (1) - /* tells which model is being emulated (set by macxxx_init) */ enum mac128model_t { @@ -192,26 +189,6 @@ private: int m_irq_count, m_ca1_data, m_ca2_data; -#ifndef MAC_USE_EMULATED_KBD - /* used to store the reply to most keyboard commands */ - int m_keyboard_reply; - - /* Keyboard communication in progress? */ - int m_kbd_comm; - int m_kbd_receive; - /* timer which is used to time out inquiry */ - emu_timer *m_inquiry_timeout; - - int m_kbd_shift_reg; - int m_kbd_shift_count; - - /* keycode buffer (used for keypad/arrow key transition) */ - int m_keycode_buf[2]; - int m_keycode_buf_index; - - int m_cb2_in; -#endif - /* keyboard matrix to detect transition - macadb needs to stop relying on this */ int m_key_matrix[7]; @@ -252,12 +229,9 @@ private: TIMER_CALLBACK_MEMBER(mac_hblank); DECLARE_VIDEO_START(mac); uint32_t screen_update_mac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); -#ifndef MAC_USE_EMULATED_KBD - TIMER_CALLBACK_MEMBER(kbd_clock); - TIMER_CALLBACK_MEMBER(inquiry_timeout_func); -#else + DECLARE_WRITE_LINE_MEMBER(mac_kbd_clk_in); -#endif + DECLARE_WRITE_LINE_MEMBER(mac_via_out_cb2); DECLARE_READ8_MEMBER(mac_via_in_a); DECLARE_READ8_MEMBER(mac_via_in_b); @@ -305,13 +279,6 @@ void mac128_state::machine_reset() m_last_taken_interrupt = -1; m_overlay = 1; m_screen_buffer = 1; -#ifndef MAC_USE_EMULATED_KBD - m_keyboard_reply = 0; - m_kbd_comm = 0; - m_kbd_receive = 0; - m_kbd_shift_reg = 0; - m_kbd_shift_count = 0; -#endif m_mouse_bit_x = m_mouse_bit_y = 0; m_last_taken_interrupt = 0; m_snd_enable = false; @@ -398,24 +365,6 @@ void mac128_state::set_via_interrupt(int value) void mac128_state::vblank_irq() { -#ifndef MAC_USE_EMULATED_KBD - /* handle keyboard */ - if (m_kbd_comm == true && m_kbd_receive == false) - { - int keycode = scan_keyboard(); - - if (keycode != 0x7B) - { - /* if key pressed, send the code */ - - logerror("keyboard enquiry successful, keycode %X\n", keycode); - - m_inquiry_timeout->reset(); - kbd_shift_out(keycode); - } - } -#endif - m_ca1_data ^= 1; m_via->write_ca1(m_ca1_data); @@ -797,334 +746,18 @@ WRITE8_MEMBER(mac128_state::mac_via_out_b) m_rtc->clk_w((data >> 1) & 0x01); } -/* - R Nabet 000531 : added keyboard code -*/ - -/* ************************************************************************* - * non-ADB keyboard support - * - * The keyboard uses a i8021 (?) microcontroller. - * It uses a bidirectional synchonous serial line, connected to the VIA (SR feature) - * - * Our emulation is more a hack than anything else - the keyboard controller is - * not emulated, instead we interpret keyboard commands directly. I made - * many guesses, which may be wrong - * - * todo : - * * find the correct model number for the Mac Plus keyboard ? - * * emulate original Macintosh keyboards (2 layouts : US and international) - * - * references : - * * IM III-29 through III-32 and III-39 through III-42 - * * IM IV-250 - * *************************************************************************/ - -/* - scan_keyboard() - - scan the keyboard, and returns key transition code (or NULL ($7B) if none) -*/ -#ifndef MAC_USE_EMULATED_KBD -int mac128_state::scan_keyboard() -{ - int i, j; - int keybuf = 0; - int keycode; - - if (m_keycode_buf_index) - { - return m_keycode_buf[--m_keycode_buf_index]; - } - - for (i=0; i<7; i++) - { - keybuf = m_key_port[i]->read(); - - if (keybuf != m_key_matrix[i]) - { - /* if state has changed, find first bit which has changed */ - if (LOG_KEYBOARD) - logerror("keyboard state changed, %d %X\n", i, keybuf); - - for (j=0; j<16; j++) - { - if (((keybuf ^ m_key_matrix[i]) >> j) & 1) - { - /* update m_key_matrix */ - m_key_matrix[i] = (m_key_matrix[i] & ~ (1 << j)) | (keybuf & (1 << j)); - - if (i < 4) - { - /* create key code */ - keycode = (i << 5) | (j << 1) | 0x01; - if (! (keybuf & (1 << j))) - { - /* key up */ - keycode |= 0x80; - } - return keycode; - } - else if (i < 6) - { - /* create key code */ - keycode = ((i & 3) << 5) | (j << 1) | 0x01; - - if ((keycode == 0x05) || (keycode == 0x0d) || (keycode == 0x11) || (keycode == 0x1b)) - { - /* these keys cause shift to be pressed (for compatibility with mac 128/512) */ - if (keybuf & (1 << j)) - { - /* key down */ - if (! (m_key_matrix[3] & 0x0100)) - { - /* shift key is really up */ - m_keycode_buf[0] = keycode; - m_keycode_buf[1] = 0x79; - m_keycode_buf_index = 2; - return 0x71; /* "presses" shift down */ - } - } - else - { /* key up */ - if (! (m_key_matrix[3] & 0x0100)) - { - /* shift key is really up */ - m_keycode_buf[0] = keycode | 0x80; - m_keycode_buf[1] = 0x79; - m_keycode_buf_index = 2; - return 0xF1; /* "releases" shift */ - } - } - } - - if (! (keybuf & (1 << j))) - { - /* key up */ - keycode |= 0x80; - } - m_keycode_buf[0] = keycode; - m_keycode_buf_index = 1; - return 0x79; - } - else /* i == 6 */ - { - /* create key code */ - keycode = (j << 1) | 0x01; - if (! (keybuf & (1 << j))) - { - /* key up */ - keycode |= 0x80; - } - m_keycode_buf[0] = keycode; - m_keycode_buf_index = 1; - return 0x79; - } - } - } - } - } - - return 0x7B; /* return NULL */ -} - -/* - power-up init -*/ -void mac128_state::keyboard_init() -{ - int i; - - /* init flag */ - m_kbd_comm = FALSE; - m_kbd_receive = FALSE; - m_kbd_shift_reg=0; - m_kbd_shift_count=0; - - /* clear key matrix */ - for (i=0; i<7; i++) - { - m_key_matrix[i] = 0; - } - - /* purge transmission buffer */ - m_keycode_buf_index = 0; -} -#endif - /******************* Keyboard <-> VIA communication ***********************/ -#ifdef MAC_USE_EMULATED_KBD - WRITE_LINE_MEMBER(mac128_state::mac_kbd_clk_in) { - printf("CLK: %d\n", state^1); m_via->write_cb1(state ? 0 : 1); } WRITE_LINE_MEMBER(mac128_state::mac_via_out_cb2) { - printf("Sending %d to kbd (PC=%x)\n", state, m_maincpu->pc()); - m_mackbd->data_w(state ? ASSERT_LINE : CLEAR_LINE); + m_mackbd->datain_w(state); } -#else // keyboard HLE - -TIMER_CALLBACK_MEMBER(mac128_state::kbd_clock) -{ - int i; - - if (m_kbd_comm == TRUE) - { - for (i=0; i<9; i++) - { - /* Put data on CB2 if we are sending*/ - if (m_kbd_receive == FALSE) - { - m_via->write_cb2(m_kbd_shift_reg&0x80?1:0); - if (i > 0) - { - m_kbd_shift_reg <<= 1; - } - } - - m_via->write_cb1(0); - m_via->write_cb1(1); - - if (m_kbd_receive == TRUE) - { - if (i < 8) - { - m_kbd_shift_reg <<= 1; - m_kbd_shift_reg |= (m_cb2_in & 1); - } - } - } - if (m_kbd_receive == TRUE) - { - m_kbd_receive = FALSE; - /* Process the command received from mac */ - //printf("Mac sent %02x\n", m_kbd_shift_reg & 0xff); - keyboard_receive(m_kbd_shift_reg & 0xff); - } - else - { - /* Communication is over */ - m_kbd_comm = FALSE; - } - } -} - -void mac128_state::kbd_shift_out(int data) -{ - if (m_kbd_comm == TRUE) - { - //printf("%02x to Mac\n", data); - m_kbd_shift_reg = data; - machine().scheduler().timer_set(attotime::from_msec(1), timer_expired_delegate(FUNC(mac128_state::kbd_clock),this)); - } -} - -WRITE_LINE_MEMBER(mac128_state::mac_via_out_cb2) -{ - //printf("CB2 = %d, kbd_comm = %d\n", state, m_kbd_comm); - if (m_kbd_comm == FALSE && state == 0) - { - /* Mac pulls CB2 down to initiate communication */ - m_kbd_comm = TRUE; - m_kbd_receive = TRUE; - machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(mac128_state::kbd_clock),this)); - } - if (m_kbd_comm == TRUE && m_kbd_receive == TRUE) - { - /* Shift in what mac is sending */ - m_cb2_in = state; - } -} - -/* - called when inquiry times out (1/4s) -*/ -TIMER_CALLBACK_MEMBER(mac128_state::inquiry_timeout_func) -{ - if (LOG_KEYBOARD) - logerror("keyboard enquiry timeout\n"); - kbd_shift_out(0x7B); /* always send NULL */ -} - -/* - called when a command is received from the mac -*/ -void mac128_state::keyboard_receive(int val) -{ - //printf("Mac sent %02x\n", val); - switch (val) - { - case 0x10: - /* inquiry - returns key transition code, or NULL ($7B) if time out (1/4s) */ - if (LOG_KEYBOARD) - logerror("keyboard command : inquiry\n"); - - m_inquiry_timeout->adjust( - attotime(0, DOUBLE_TO_ATTOSECONDS(0.25)), 0); - break; - - case 0x14: - /* instant - returns key transition code, or NULL ($7B) */ - if (LOG_KEYBOARD) - logerror("keyboard command : instant\n"); - - kbd_shift_out(scan_keyboard()); - break; - - case 0x16: - /* model number - resets keyboard, return model number */ - if (LOG_KEYBOARD) - logerror("keyboard command : model number\n"); - - { /* reset */ - int i; - - /* clear key matrix */ - for (i=0; i<7; i++) - { - m_key_matrix[i] = 0; - } - - /* purge transmission buffer */ - m_keycode_buf_index = 0; - } - - /* format : 1 if another device (-> keypad ?) connected | next device (-> keypad ?) number 1-8 - | keyboard model number 1-8 | 1 */ - /* keyboards : - 3 : mac 512k, US and international layout ? Mac plus ??? - other values : Apple II keyboards ? - */ - /* keypads : - ??? : standard keypad (always available on Mac Plus) ??? - */ - kbd_shift_out(0x17); /* probably wrong */ - break; - - case 0x36: - /* test - resets keyboard, return ACK ($7D) or NAK ($77) */ - if (LOG_KEYBOARD) - logerror("keyboard command : test\n"); - - kbd_shift_out(0x7D); /* ACK */ - break; - - default: - if (LOG_KEYBOARD) - logerror("unknown keyboard command 0x%X\n", val); - - kbd_shift_out(0); - break; - } -} -#endif - /* ************************************************************************* * Mouse * *************************************************************************/ @@ -1222,17 +855,11 @@ void mac128_state::mac_driver_init(mac128model_t model) memset(m_ram->pointer(), 0, m_ram->size()); - /* setup keyboard */ -#ifndef MAC_USE_EMULATED_KBD - keyboard_init(); - m_inquiry_timeout = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mac128_state::inquiry_timeout_func),this)); -#else /* clear key matrix for macadb */ for (int i=0; i<7; i++) { m_key_matrix[i] = 0; } -#endif /* save state stuff */ machine().save().register_postload(save_prepost_delegate(FUNC(mac128_state::mac128_state_load), this)); @@ -1385,13 +1012,9 @@ void mac128_state::mac512ke(machine_config &config) m_via->cb2_handler().set(FUNC(mac128_state::mac_via_out_cb2)); m_via->irq_handler().set(FUNC(mac128_state::mac_via_irq)); -#ifdef MAC_USE_EMULATED_KBD mackbd_device &mackbd(MACKBD(config, MACKBD_TAG, 0)); mackbd.dataout_handler().set(m_via, FUNC(via6522_device::write_cb2)); mackbd.clkout_handler().set(FUNC(mac128_state::mac_kbd_clk_in)); -#else - MACKBD(config, MACKBD_TAG, 0); -#endif /* internal ram */ RAM(config, m_ram); diff --git a/src/mame/drivers/maxaflex.cpp b/src/mame/drivers/maxaflex.cpp index 1202d575b79..9c4785416d6 100644 --- a/src/mame/drivers/maxaflex.cpp +++ b/src/mame/drivers/maxaflex.cpp @@ -19,6 +19,7 @@ #include "cpu/m6805/m68705.h" #include "machine/6821pia.h" +#include "machine/rescap.h" #include "machine/timer.h" #include "sound/spkrdev.h" diff --git a/src/mame/drivers/mephisto_modena.cpp b/src/mame/drivers/mephisto_modena.cpp index 6a067126691..4dd0f90f106 100644 --- a/src/mame/drivers/mephisto_modena.cpp +++ b/src/mame/drivers/mephisto_modena.cpp @@ -13,10 +13,11 @@ Hold Pawn + Knight buttons at boot for test mode. #include "cpu/m6502/m65c02.h" #include "machine/nvram.h" -#include "machine/mmboard.h" +#include "machine/sensorboard.h" #include "machine/timer.h" #include "sound/dac.h" #include "sound/volt_reg.h" +#include "video/pwm.h" #include "speaker.h" @@ -30,25 +31,24 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_board(*this, "board") + , m_display(*this, "display") , m_dac(*this, "dac") , m_keys(*this, "KEY") , m_digits(*this, "digit%u", 0U) - , m_leds(*this, "led%u.%u", 0U, 0U) { } void modena(machine_config &config); protected: - virtual void machine_reset() override; virtual void machine_start() override; private: required_device m_maincpu; - required_device m_board; + required_device m_board; + required_device m_display; required_device m_dac; required_ioport m_keys; output_finder<4> m_digits; - output_finder<3, 8> m_leds; void modena_mem(address_map &map); @@ -56,10 +56,12 @@ private: DECLARE_WRITE8_MEMBER(digits_w); DECLARE_WRITE8_MEMBER(io_w); DECLARE_WRITE8_MEMBER(led_w); + void update_display(); TIMER_DEVICE_CALLBACK_MEMBER(nmi_on) { m_maincpu->set_input_line(M6502_NMI_LINE, ASSERT_LINE); } TIMER_DEVICE_CALLBACK_MEMBER(nmi_off) { m_maincpu->set_input_line(M6502_NMI_LINE, CLEAR_LINE); } + uint8_t m_board_mux = 0xff; uint8_t m_digits_idx = 0; uint8_t m_io_ctrl = 0; }; @@ -67,49 +69,53 @@ private: void mephisto_modena_state::machine_start() { m_digits.resolve(); - m_leds.resolve(); save_item(NAME(m_digits_idx)); save_item(NAME(m_io_ctrl)); } -void mephisto_modena_state::machine_reset() -{ - m_digits_idx = 0; - m_io_ctrl = 0; -} - /****************************************************************************** I/O ******************************************************************************/ +void mephisto_modena_state::update_display() +{ + m_display->matrix(m_io_ctrl >> 1 & 7, ~m_board_mux); +} + READ8_MEMBER(mephisto_modena_state::input_r) { - if (m_board->mux_r() == 0xff) - return m_keys->read(); - else - return m_board->input_r() ^ 0xff; + uint8_t data = 0; + + // read buttons + if (~m_io_ctrl & 1) + data |= m_keys->read(); + + // read chessboard sensors + for (int i=0; i<8; i++) + if (!BIT(m_board_mux, i)) + data |= m_board->read_rank(i); + + return data; } WRITE8_MEMBER(mephisto_modena_state::led_w) { - m_board->mux_w(data); - - for (int sel = 0; sel < 3; sel++) - { - if (BIT(m_io_ctrl, sel+1)) - { - for (int i = 0; i < 8; i++) - m_leds[sel][i] = BIT(data, i) ? 0 : 1; - } - } + // d0-d7: chessboard mux, led data + m_board_mux = data; + update_display(); } WRITE8_MEMBER(mephisto_modena_state::io_w) { + // d0: button select + // d1-d3: led select + // d4: lcd polarity + // d6: speaker out m_io_ctrl = data; + update_display(); m_dac->write(BIT(data, 6)); } @@ -131,7 +137,8 @@ void mephisto_modena_state::modena_mem(address_map &map) map(0x4000, 0x4000).w(FUNC(mephisto_modena_state::digits_w)); map(0x5000, 0x5000).w(FUNC(mephisto_modena_state::led_w)); map(0x6000, 0x6000).w(FUNC(mephisto_modena_state::io_w)); - map(0x7000, 0x7fff).r(FUNC(mephisto_modena_state::input_r)); + map(0x7000, 0x7000).r(FUNC(mephisto_modena_state::input_r)); + map(0x7f00, 0x7fff).nopr(); // dummy read on 6502 absolute X page wrap map(0x8000, 0xffff).rom().region("maincpu", 0); } @@ -161,6 +168,7 @@ INPUT_PORTS_END void mephisto_modena_state::modena(machine_config &config) { + /* basic machine hardware */ M65C02(config, m_maincpu, XTAL(4'194'304)); // W65C02SP or RP65C02G m_maincpu->set_addrmap(AS_PROGRAM, &mephisto_modena_state::modena_mem); timer_device &nmi_on(TIMER(config, "nmi_on")); @@ -170,8 +178,12 @@ void mephisto_modena_state::modena(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - MEPHISTO_BUTTONS_BOARD(config, m_board); - m_board->set_disable_leds(true); + SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); + m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); + m_board->set_delay(attotime::from_msec(150)); + + /* video hardware */ + PWM_DISPLAY(config, m_display).set_size(3, 8); config.set_default_layout(layout_mephisto_modena); /* sound hardware */ diff --git a/src/mame/drivers/mephisto_mondial68k.cpp b/src/mame/drivers/mephisto_mondial68k.cpp index cd452ffd3d3..4e41ccdaac8 100644 --- a/src/mame/drivers/mephisto_mondial68k.cpp +++ b/src/mame/drivers/mephisto_mondial68k.cpp @@ -15,13 +15,15 @@ Hardware: ***************************************************************************/ #include "emu.h" + #include "cpu/m68000/m68000.h" #include "machine/74259.h" #include "machine/sensorboard.h" -#include "machine/timer.h" #include "sound/dac.h" #include "sound/volt_reg.h" #include "video/pcf2100.h" +#include "video/pwm.h" + #include "speaker.h" // internal artwork @@ -36,17 +38,16 @@ public: , m_maincpu(*this, "maincpu") , m_dac(*this, "dac") , m_board(*this, "board") + , m_display(*this, "display") , m_lcd(*this, "lcd") , m_inputs(*this, "IN.%u", 0) , m_digits(*this, "digit%u", 0U) - , m_leds(*this, "led%u", 0U) { } void mondial68k(machine_config &config); protected: virtual void machine_start() override; - virtual void machine_reset() override; void mondial68k_mem(address_map &map); @@ -54,46 +55,38 @@ protected: DECLARE_WRITE8_MEMBER(input_mux_w); DECLARE_WRITE8_MEMBER(board_mux_w); DECLARE_READ8_MEMBER(inputs_r); - TIMER_DEVICE_CALLBACK_MEMBER(refresh_leds); + void update_display(); required_device m_maincpu; required_device m_dac; required_device m_board; + required_device m_display; required_device m_lcd; required_ioport_array<4> m_inputs; output_finder<4> m_digits; - output_finder<16> m_leds; - uint8_t m_input_mux; - uint8_t m_board_mux; + uint8_t m_input_mux = 0xff; + uint8_t m_board_mux = 0xff; }; void mondial68k_state::machine_start() { m_digits.resolve(); - m_leds.resolve(); save_item(NAME(m_input_mux)); save_item(NAME(m_board_mux)); } -void mondial68k_state::machine_reset() -{ - m_input_mux = 0; - m_board_mux = 0; -} - /****************************************************************************** I/O ******************************************************************************/ -TIMER_DEVICE_CALLBACK_MEMBER(mondial68k_state::refresh_leds) +void mondial68k_state::update_display() { - for (int i=0; i<16; i++) - m_leds[0 + i] = 0; + m_display->matrix(m_input_mux >> 6, ~m_board_mux); } WRITE32_MEMBER(mondial68k_state::lcd_s_w) @@ -105,30 +98,29 @@ WRITE32_MEMBER(mondial68k_state::lcd_s_w) WRITE8_MEMBER(mondial68k_state::board_mux_w) { + // d0-d7: chessboard mux, led data m_board_mux = data; + update_display(); } WRITE8_MEMBER(mondial68k_state::input_mux_w) { + // d0-d3: button mux + // d6,d7: led select m_input_mux = data; - for (int i=0; i<8; i++) - { - if (!BIT(m_board_mux, i)) - { - if (BIT(m_input_mux, 7)) m_leds[0 + i] = 1; - if (BIT(m_input_mux, 6)) m_leds[8 + i] = 1; - } - } + update_display(); } READ8_MEMBER(mondial68k_state::inputs_r) { - if (!(m_input_mux & 0x01)) return m_inputs[0]->read(); - else if (!(m_input_mux & 0x02)) return m_inputs[1]->read(); - else if (!(m_input_mux & 0x04)) return m_inputs[2]->read(); - else if (!(m_input_mux & 0x08)) return m_inputs[3]->read(); - uint8_t data = 0x00; + + // read buttons + for (int i=0; i<4; i++) + if (!BIT(m_input_mux, i)) + data |= m_inputs[i]->read(); + + // read chessboard sensors for (int i=0; i<8; i++) if (!BIT(m_board_mux, i)) data |= m_board->read_rank(i); @@ -211,14 +203,14 @@ void mondial68k_state::mondial68k(machine_config &config) /* video hardware */ PCF2112(config, m_lcd, 50); // frequency guessed m_lcd->write_segs().set(FUNC(mondial68k_state::lcd_s_w)); + + PWM_DISPLAY(config, m_display).set_size(2, 8); config.set_default_layout(layout_mephisto_mondial68k); /* sound hardware */ SPEAKER(config, "speaker").front_center(); DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); - - TIMER(config, "refresh_leds").configure_periodic(FUNC(mondial68k_state::refresh_leds), attotime::from_hz(10)); } diff --git a/src/mame/drivers/mhavoc.cpp b/src/mame/drivers/mhavoc.cpp index e4c558188a1..d9b698b3fa9 100644 --- a/src/mame/drivers/mhavoc.cpp +++ b/src/mame/drivers/mhavoc.cpp @@ -192,6 +192,7 @@ #include "video/avgdvg.h" #include "video/vector.h" #include "machine/eeprompar.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "screen.h" #include "speaker.h" diff --git a/src/mame/drivers/microdar.cpp b/src/mame/drivers/microdar.cpp index e4bda73c915..21bf927a6bb 100644 --- a/src/mame/drivers/microdar.cpp +++ b/src/mame/drivers/microdar.cpp @@ -120,7 +120,7 @@ void microdar_state::microdar(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); // GM76C88ALK-15 + battery - I2CMEM(config, m_eeprom).set_page_size(16).set_data_size(0x800); + I2C_24C16(config, m_eeprom); // 24LC16B // Code also references some sort of serial RTC? } diff --git a/src/mame/drivers/missile.cpp b/src/mame/drivers/missile.cpp index 868fae7611d..51729fe4949 100644 --- a/src/mame/drivers/missile.cpp +++ b/src/mame/drivers/missile.cpp @@ -351,6 +351,7 @@ Super Missile Attack Board Layout #include "emu.h" #include "cpu/m6502/m6502.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "sound/pokey.h" #include "sound/ay8910.h" diff --git a/src/mame/drivers/monty.cpp b/src/mame/drivers/monty.cpp index abd558008a8..dfe1366644e 100644 --- a/src/mame/drivers/monty.cpp +++ b/src/mame/drivers/monty.cpp @@ -1,38 +1,49 @@ // license:BSD-3-Clause -// copyright-holders:Andrew Gardner +// copyright-holders:Andrew Gardner, hap /*************************************************************************** - 2015-05-08 Skeleton driver for Ritam Monty Plays Scrabble BRAND crossword game +Driver for Ritam Monty Plays Scrabble BRAND crossword game - Scrabble computer that allows you play a game of Scrabble by yourself (or you - can play with up to 3 players). Has a built-in 12,000 vocabulary, expandable - to 44,000 by way of 2 expansion modules each containing 16,000 more obscure words. - You can use the included 'score cards' (which look like little Scrabble boards), - or you can use a real Scrabble board and tiles to play. Also note, Monty - apparently originally came with a little pen. +Scrabble computer that allows you play a game of Scrabble by yourself (or you +can play with up to 3 players). Has a built-in 12,000 vocabulary, expandable +to 44,000 by way of 2 expansion modules each containing 16,000 more obscure words. +You can use the included 'score cards' (which look like little Scrabble boards), +or you can use a real Scrabble board and tiles to play. Also note, Monty +apparently originally came with a little pen. - This game was later upgraded by Ritam to Master Monty which had 24,000 words - built-in (expandable to a total of 56,000 with the same 2 expansion modules). - Two variations on Master Monty have been seen: one looks exactly the same as the - Monty but the electronics on the inside have been upgraded. The later version - is blue and says Master Monty at the top. Both of these versions are hand-upgraded - by adding chips and wires to the inside of the game. +This game was later upgraded by Ritam to Master Monty which had 24,000 words +built-in (expandable to a total of 56,000 with the same 2 expansion modules). +Two variations on Master Monty have been seen: one looks exactly the same as the +Monty but the electronics on the inside have been upgraded. The later version +is blue and says Master Monty at the top. Both of these versions are hand-upgraded +by adding chips and wires to the inside of the game. - TODO: - - Need instructions - - Proper SED1503F emulation (it's simulated in-driver for now) - - When it wants tiles, put 64 into FD1B (monty), 7D1B (mmonty) and press - Enter. +Hardware notes: +- Z80 @ ~3.58MHz +- 2KB SRAM, 16KB ROM(32KB on mmonty) +- 2*16KB ROM sockets for vocabulary expansion +- 2*SED1503F, 40*32 LCD screen, beeper + +TODO: +- put expansion roms in softwarelist? (note: slot #1 only accepts rom #1, + slot #2 only accepts rom #2), they can be disabled in-game with option M ****************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" -#include "sound/spkrdev.h" -#include "video/sed1520.h" +#include "sound/dac.h" +#include "sound/volt_reg.h" +#include "video/sed1500.h" + #include "screen.h" #include "speaker.h" +#include "monty.lh" + + +namespace { class monty_state : public driver_device { @@ -40,72 +51,114 @@ public: monty_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - , m_speaker(*this, "speaker") - , m_sed0(*this, "sed1520_0") - , m_writeUpper(false) - , m_halt(0) - { - for (auto & elem : m_pixels) - elem = 0xff000000; - } + , m_lcd(*this, "lcd%u", 0) + , m_dac(*this, "dac") + { } DECLARE_WRITE_LINE_MEMBER(key_pressed); void monty(machine_config &config); void mmonty(machine_config &config); +protected: + virtual void machine_start() override; + private: - DECLARE_WRITE8_MEMBER(sound_w); - DECLARE_WRITE8_MEMBER(ioDisplayWrite_w); - DECLARE_WRITE8_MEMBER(ioCommandWrite0_w); - DECLARE_WRITE8_MEMBER(ioCommandWrite1_w); - DECLARE_WRITE_LINE_MEMBER(halt_changed); - - // screen updates - uint32_t lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); - SED1520_UPDATE_CB(screen_update); + required_device m_maincpu; + required_device_array m_lcd; + required_device m_dac; + void monty_mem(address_map &map); void mmonty_mem(address_map &map); void monty_io(address_map &map); - void monty_mem(address_map &map); - required_device m_maincpu; - required_device m_speaker; - required_device m_sed0; // TODO: This isn't actually a SED1520, it's a SED1503F - //required_device m_sed1; // TODO: Also, there are 2 SED1503Fs on the board - one is flipped upside down + template void lcd_output_w(offs_t offset, u64 data) { m_lcd_data[N << 4 | offset] = data; } // buffer for screen_update + u32 screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect); - // Test - uint8_t m_writeUpper; - uint32_t m_pixels[42*32]; - bool m_sound_sw; - bool m_dirty; - int m_halt; + DECLARE_WRITE8_MEMBER(control_w); + DECLARE_WRITE8_MEMBER(lcd_w) { m_lcd[m_lcd_cs]->write(offset, data); } + DECLARE_WRITE_LINE_MEMBER(halt_changed) { m_halt = state; } + + u64 m_lcd_data[32]; + int m_lcd_cs = 0; + int m_halt = 0; }; +void monty_state::machine_start() +{ + memset(m_lcd_data, 0, sizeof(m_lcd_data)); + + save_item(NAME(m_lcd_data)); + save_item(NAME(m_lcd_cs)); + save_item(NAME(m_halt)); +} + + + +/****************************************************************************** + Video +******************************************************************************/ + +u32 monty_state::screen_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect) +{ + bitmap.fill(0xffffff); + + // letters with width 5 with space in between them + for (int y = 0; y < 32; y++) + for (int x = 0; x < 40; x++) + bitmap.pix32(y + 1, x + x/5 + 1) = BIT(m_lcd_data[y], x) ? 0 : 0xffffff; + + return 0; +} + + + +/****************************************************************************** + I/O +******************************************************************************/ + +WRITE8_MEMBER(monty_state::control_w) +{ + // a0: speaker out + m_dac->write(BIT(offset, 0)); + + // a1: lcd chip select + m_lcd_cs = BIT(offset, 1); +} + +WRITE_LINE_MEMBER(monty_state::key_pressed) +{ + if (!state && m_halt) + m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); +} + + + +/****************************************************************************** + Address Maps +******************************************************************************/ void monty_state::monty_mem(address_map &map) { - map(0x0000, 0xbfff).rom(); - //map(0x4000, 0x4000) // The main rom checks to see if another program is here on startup + map(0x0000, 0x3fff).rom(); + map(0x4000, 0x7fff).rom(); // slot 1 + map(0x8000, 0xbfff).rom(); // slot 2 map(0xf800, 0xffff).ram(); } void monty_state::mmonty_mem(address_map &map) { - map(0x0000, 0x3fff).rom(); - //map(0xc000, 0xc000) // The main rom checks to see if another program is here on startup - map(0x8000, 0xffff).rom(); + map(0x0000, 0x77ff).rom(); map(0x7800, 0x7fff).ram(); + map(0x8000, 0xbfff).rom(); // slot 2 + map(0xc000, 0xffff).rom(); // slot 1 } - void monty_state::monty_io(address_map &map) { map.global_mask(0xff); - map(0x00, 0x00).w(FUNC(monty_state::ioCommandWrite0_w)); - map(0x01, 0x01).w(FUNC(monty_state::sound_w)); - map(0x02, 0x02).w(FUNC(monty_state::ioCommandWrite1_w)); - map(0x80, 0xff).w(FUNC(monty_state::ioDisplayWrite_w)); + map(0x00, 0x03).w(FUNC(monty_state::control_w)); + map(0x80, 0xff).w(FUNC(monty_state::lcd_w)); // 7 reads from a bit shifted IO port map(0x01, 0x01).portr("X1"); @@ -118,13 +171,17 @@ void monty_state::monty_io(address_map &map) } -// Input ports + +/****************************************************************************** + Input Ports +******************************************************************************/ + static INPUT_PORTS_START( monty ) PORT_START("X1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Left") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Enter") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Erase") PORT_CODE(KEYCODE_DEL) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Option") PORT_CODE(KEYCODE_SPACE) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Blank") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -147,145 +204,61 @@ static INPUT_PORTS_START( monty ) PORT_START("X4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CODE(KEYCODE_DOWN) PORT_CHAR('M') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("X5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR('I') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CODE(KEYCODE_LEFT) PORT_CHAR('G') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("X6") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CODE(KEYCODE_UP) PORT_CHAR('C') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, monty_state, key_pressed) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("X7") - PORT_BIT( 0xFF, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -WRITE8_MEMBER( monty_state::sound_w ) -{ - m_sound_sw ^= 1; - m_speaker->level_w(m_sound_sw); -} +/****************************************************************************** + Machine Configs +******************************************************************************/ -WRITE8_MEMBER( monty_state::ioCommandWrite0_w ) -{ - //printf("(%04x) Command Port 0 write : %02x\n", m_maincpu->pc(), data); - m_writeUpper = false; -} - - -WRITE8_MEMBER( monty_state::ioCommandWrite1_w ) -{ - //if (data == 0xfe) - // printf("---\n"); - - //printf("(%04x) Command Port 1 write : %02x\n", m_maincpu->pc(), data); - m_writeUpper = true; -} - - -WRITE8_MEMBER( monty_state::ioDisplayWrite_w ) -{ - m_dirty = true; - // Offset directly corresponds to sed1503, DD RAM address (offset 0x7f may be special?) - //printf("(%04x) %02x %02x\n", m_maincpu->pc(), offset, data); - - uint8_t x = offset & 0x3f; - uint8_t y = (BIT(offset, 6) + (m_writeUpper ? 2 : 0)) << 3; - - // Skip the controller and write straight to the LCD (pc=134f) - for (int i = 0; i < 8; i++) - { - // Pixel color - if (x < 42) - m_pixels[(y*42) + x] = BIT(data, i) ? 0xffffffff : 0xff000000; - - y++; - } -} - - -WRITE_LINE_MEMBER( monty_state::halt_changed ) -{ - m_halt = state; -} - - -WRITE_LINE_MEMBER( monty_state::key_pressed ) -{ - if (!state && m_halt) - m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); -} - - -uint32_t monty_state::lcd_update(screen_device& screen, bitmap_rgb32& bitmap, const rectangle& cliprect) -{ - if (!m_dirty) - return 1; - - uint8_t x,y,z; - m_dirty = false; - for (y = 0; y < 32; y++) - { - for (z = 0; z < 8; z++) - { - for (x = 0; x < 5; x++) - { - bitmap.pix32(y, x+z*6) = m_pixels[y*42 + z*5 + x]; - } - bitmap.pix32(y, 5+z*6) = 0; // space between letters - } - bitmap.pix32(y, 48) = m_pixels[y*42 + 40]; - bitmap.pix32(y, 49) = m_pixels[y*42 + 41]; - } - - return 0; -} - - -SED1520_UPDATE_CB(monty_state::screen_update) -{ - // TODO: Not really a SED1520 - there are two SED1503s - return 0x00; -} - - -// TODO: Additional machine definition - Master Monty has a different memory layout void monty_state::monty(machine_config &config) { // Basic machine hardware - Z80(config, m_maincpu, 3580000); // Ceramic resonator labeled 3.58MT + Z80(config, m_maincpu, 3.579545_MHz_XTAL); // Ceramic resonator labeled 3.58MT m_maincpu->set_addrmap(AS_PROGRAM, &monty_state::monty_mem); m_maincpu->set_addrmap(AS_IO, &monty_state::monty_io); m_maincpu->halt_cb().set(FUNC(monty_state::halt_changed)); // Video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); - screen.set_refresh_hz(50); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // Not accurate - screen.set_size(50, 32); // Two SED1503s (42x16 pixels) control the top and bottom halves - screen.set_visarea(0, 50-1, 0, 32-1); - screen.set_screen_update(FUNC(monty_state::lcd_update)); + screen.set_refresh_hz(60); + screen.set_vblank_time(0); + screen.set_size(40+8+1, 32+1); + screen.set_visarea_full(); + screen.set_screen_update(FUNC(monty_state::screen_update)); - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - SPEAKER_SOUND(config, m_speaker).add_route(ALL_OUTPUTS, "mono", 0.50); + SED1503(config, m_lcd[0], 32768).write_segs().set(FUNC(monty_state::lcd_output_w<0>)); + SED1503(config, m_lcd[1], 32768).write_segs().set(FUNC(monty_state::lcd_output_w<1>)); + config.set_default_layout(layout_monty); - // LCD controller interfaces - SED1520(config, m_sed0).set_screen_update_cb(FUNC(monty_state::screen_update)); + // Sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); + VOLTAGE_REGULATOR(config, "vref").add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT); } void monty_state::mmonty(machine_config &config) @@ -295,23 +268,33 @@ void monty_state::mmonty(machine_config &config) } -// ROM definitions + +/****************************************************************************** + ROM Definitions +******************************************************************************/ + ROM_START( monty ) - ROM_REGION(0xc000, "maincpu", 0) - ROM_LOAD( "monty_main.bin", 0x0000, 0x4000, CRC(720b4f55) SHA1(0106eb88d3fbbf25a745b9b6ee785ba13689d095) ) // 27128 - ROM_LOAD( "monty_module1.bin", 0x4000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128 - ROM_LOAD( "monty_module2.bin", 0x8000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "monty_main.bin", 0x0000, 0x4000, CRC(720b4f55) SHA1(0106eb88d3fbbf25a745b9b6ee785ba13689d095) ) // 27128 + ROM_LOAD( "monty_module1.bin", 0x4000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128 + ROM_LOAD( "monty_module2.bin", 0x8000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128 ROM_END ROM_START( mmonty ) - ROM_REGION(0x10000, "maincpu", 0) - ROM_LOAD( "master_monty_main.bin", 0x0000, 0x8000, CRC(bb5ef4d4) SHA1(ba2c759e429f8740df419f9abb60832eddfba8ab) ) // 27C256 - ROM_LOAD( "monty_module1.bin", 0x8000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128 - ROM_LOAD( "monty_module2.bin", 0xc000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128 + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "master_monty_main.bin", 0x0000, 0x8000, CRC(bb5ef4d4) SHA1(ba2c759e429f8740df419f9abb60832eddfba8ab) ) // 27C256 + ROM_LOAD( "monty_module2.bin", 0x8000, 0x4000, CRC(db672e47) SHA1(bb14fe86df06cfa4b19625ba417d1a5bc8eae155) ) // 27128 + ROM_LOAD( "monty_module1.bin", 0xc000, 0x4000, CRC(2725d8c3) SHA1(8273b9779c0915f9c7c43ea4fb460f43ce036358) ) // 27128 ROM_END +} // anonymous namespace + + + +/****************************************************************************** + Drivers +******************************************************************************/ -// Drivers // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -COMP( 1980, monty, 0, 0, monty, monty, monty_state, empty_init, "Ritam", "Monty Plays Scrabble", MACHINE_NOT_WORKING ) -COMP( 1982, mmonty, 0, 0, mmonty, monty, monty_state, empty_init, "Ritam", "Master Monty", MACHINE_NOT_WORKING ) +COMP( 1983, monty, 0, 0, monty, monty, monty_state, empty_init, "Ritam", "Monty Plays Scrabble", MACHINE_SUPPORTS_SAVE ) +COMP( 1987, mmonty, 0, 0, mmonty, monty, monty_state, empty_init, "Ritam", "Master Monty", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/mpu3.cpp b/src/mame/drivers/mpu3.cpp index 484ca9bc24a..2da8102b82f 100644 --- a/src/mame/drivers/mpu3.cpp +++ b/src/mame/drivers/mpu3.cpp @@ -112,6 +112,7 @@ TODO: - Distinguish door switches using manual #include "machine/steppers.h" #include "machine/roc10937.h" #include "machine/meters.h" +#include "machine/rescap.h" #include "mpu3.lh" diff --git a/src/mame/drivers/mpu4dealem.cpp b/src/mame/drivers/mpu4dealem.cpp index 3cb9e3b3116..7edc140c156 100644 --- a/src/mame/drivers/mpu4dealem.cpp +++ b/src/mame/drivers/mpu4dealem.cpp @@ -84,7 +84,7 @@ static const gfx_layout dealemcharlayout = static GFXDECODE_START( gfx_dealem ) - GFXDECODE_ENTRY( "gfx1", 0x0000, dealemcharlayout, 0, 32 ) + GFXDECODE_ENTRY( "gfx1", 0x0000, dealemcharlayout, 0, 16 ) GFXDECODE_END diff --git a/src/mame/drivers/namcona1.cpp b/src/mame/drivers/namcona1.cpp index ff49f38dd44..a6583d4e7a0 100644 --- a/src/mame/drivers/namcona1.cpp +++ b/src/mame/drivers/namcona1.cpp @@ -592,7 +592,7 @@ void namcona1_state::namcona1_main_map(address_map &map) map(0xfff000, 0xffffff).ram().share("spriteram"); /* spriteram */ } -void namcona1_state::namcona1_c140_map(address_map &map) +void namcona1_state::namcona1_c219_map(address_map &map) { map(0x000000, 0x07ffff).ram().share("workram"); } @@ -649,9 +649,7 @@ void namcona1_state::na1mcu_shared_w(offs_t offset, u16 data, u16 mem_mask) void namcona1_state::namcona1_mcu_map(address_map &map) { map(0x000800, 0x000fff).rw(FUNC(namcona1_state::mcu_mailbox_r), FUNC(namcona1_state::mcu_mailbox_w_mcu)); // "Mailslot" communications ports - map(0x001000, 0x001fff).lrw8( - NAME([this](offs_t offset) { return m_c140->c140_r(offset ^ 1)/* need ^ 1 because endian issue */; }), - NAME([this](offs_t offset, u8 data) { m_c140->c140_w(offset ^ 1, data); })); // C140-alike sound chip + map(0x001000, 0x0011ff).mirror(0x000e00).rw(m_c219, FUNC(c219_device::c219_le_r), FUNC(c219_device::c219_le_w)); // C140-alike sound chip map(0x002000, 0x002fff).rw(FUNC(namcona1_state::na1mcu_shared_r), FUNC(namcona1_state::na1mcu_shared_w)); // mirror of first page of shared work RAM map(0x003000, 0x00afff).ram(); // there is a 32k RAM chip according to CGFM map(0x200000, 0x27ffff).rw(FUNC(namcona1_state::na1mcu_shared_r), FUNC(namcona1_state::na1mcu_shared_w)); // shared work RAM @@ -1010,11 +1008,10 @@ void namcona1_state::namcona_base(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - C140(config, m_c140, 44100); - m_c140->set_bank_type(c140_device::C140_TYPE::ASIC219); - m_c140->set_addrmap(0, &namcona1_state::namcona1_c140_map); - m_c140->add_route(0, "rspeaker", 1.00); - m_c140->add_route(1, "lspeaker", 1.00); + C219(config, m_c219, 44100); + m_c219->set_addrmap(0, &namcona1_state::namcona1_c219_map); + m_c219->add_route(0, "rspeaker", 1.00); + m_c219->add_route(1, "lspeaker", 1.00); } void namcona1_state::namcona1(machine_config &config) diff --git a/src/mame/drivers/namcos2.cpp b/src/mame/drivers/namcos2.cpp index c5a5cab08e8..59cbfc3ecbd 100644 --- a/src/mame/drivers/namcos2.cpp +++ b/src/mame/drivers/namcos2.cpp @@ -864,9 +864,9 @@ void namcos2_state::sound_default_am(address_map &map) { map(0x0000, 0x3fff).bankr("audiobank"); /* banked */ map(0x4000, 0x4001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x5000, 0x6fff).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); - map(0x7000, 0x77ff).rw(FUNC(namcos2_state::dpram_byte_r), FUNC(namcos2_state::dpram_byte_w)).share("dpram"); - map(0x7800, 0x7fff).rw(FUNC(namcos2_state::dpram_byte_r), FUNC(namcos2_state::dpram_byte_w)); /* mirror */ + map(0x5000, 0x51ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); + map(0x6000, 0x61ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); // mirrored + map(0x7000, 0x77ff).mirror(0x0800).rw(FUNC(namcos2_state::dpram_byte_r), FUNC(namcos2_state::dpram_byte_w)).share("dpram"); map(0x8000, 0x9fff).ram(); map(0xa000, 0xbfff).nopw(); /* Amplifier enable on 1st write */ map(0xc000, 0xc001).w(FUNC(namcos2_state::sound_bankselect_w)); @@ -875,6 +875,12 @@ void namcos2_state::sound_default_am(address_map &map) map(0xd000, 0xffff).rom().region("audiocpu", 0x01000); } +void namcos2_state::c140_default_am(address_map &map) +{ + map.global_mask(0x7fffff); // bit 23-24 not connected + map(0x000000, 0x7fffff).r(FUNC(namcos2_state::c140_rom_r)); +} + /*************************************************************/ /* */ /* NAMCO SYSTEM 2 PORT MACROS */ @@ -1718,7 +1724,7 @@ void namcos2_state::configure_common_standard(machine_config &config) SPEAKER(config, "rspeaker").front_right(); C140(config, m_c140, C140_SOUND_CLOCK); /* 21.333kHz */ - m_c140->set_bank_type(c140_device::C140_TYPE::SYSTEM2); + m_c140->set_addrmap(0, &namcos2_state::c140_default_am); m_c140->int1_callback().set_inputline(m_audiocpu, M6809_FIRQ_LINE); } @@ -2191,8 +2197,8 @@ ROM_START( assault ) NAMCOS2_DATA_LOAD_E_128K( "at1dat0.13s", 0x000000, CRC(844890f4) SHA1(1be30760acd81fae836301d81d6adbb3e5941373) ) NAMCOS2_DATA_LOAD_O_128K( "at1dat1.13p", 0x000000, CRC(21715313) SHA1(97c6edae6a5f1df434f1dcf7be307b5e006e72a6) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "atvoi1.bin", 0x000000, 0x080000, CRC(d36a649e) SHA1(30173f32c6ec9dda6b8946baa14266e828b0324e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "atvoi1.bin", 0x000000, 0x080000, CRC(d36a649e) SHA1(30173f32c6ec9dda6b8946baa14266e828b0324e) ) ROM_END /* ASSAULT (JAPAN) */ @@ -2242,8 +2248,8 @@ ROM_START( assaultj ) NAMCOS2_DATA_LOAD_E_128K( "at1dat0.13s", 0x000000, CRC(844890f4) SHA1(1be30760acd81fae836301d81d6adbb3e5941373) ) NAMCOS2_DATA_LOAD_O_128K( "at1dat1.13p", 0x000000, CRC(21715313) SHA1(97c6edae6a5f1df434f1dcf7be307b5e006e72a6) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "atvoi1.bin", 0x000000, 0x080000, CRC(d36a649e) SHA1(30173f32c6ec9dda6b8946baa14266e828b0324e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "atvoi1.bin", 0x000000, 0x080000, CRC(d36a649e) SHA1(30173f32c6ec9dda6b8946baa14266e828b0324e) ) ROM_END /* ASSAULT PLUS (NAMCO) */ @@ -2293,8 +2299,8 @@ ROM_START( assaultp ) NAMCOS2_DATA_LOAD_E_128K( "at1dat0.13s", 0x000000, CRC(844890f4) SHA1(1be30760acd81fae836301d81d6adbb3e5941373) ) NAMCOS2_DATA_LOAD_O_128K( "at1dat1.13p", 0x000000, CRC(21715313) SHA1(97c6edae6a5f1df434f1dcf7be307b5e006e72a6) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "atvoi1.bin", 0x000000, 0x080000, CRC(d36a649e) SHA1(30173f32c6ec9dda6b8946baa14266e828b0324e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "atvoi1.bin", 0x000000, 0x080000, CRC(d36a649e) SHA1(30173f32c6ec9dda6b8946baa14266e828b0324e) ) ROM_END /* BURNING FORCE */ @@ -2343,8 +2349,8 @@ ROM_START( burnforc ) NAMCOS2_DATA_LOAD_E_128K( "bu1_dat0.13s", 0x000000, CRC(e0a9d92f) SHA1(15042e6d7b31bec08ccdf36e89fdb4b6fb62fa4b) ) NAMCOS2_DATA_LOAD_O_128K( "bu1_dat1.13p", 0x000000, CRC(5fe54b73) SHA1(a5d4895f0a4523be20de40ccaa74f8fad0d5df7d) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "bu_voi-1.bin", 0x000000, 0x080000, CRC(99d8a239) SHA1(1ebc586048e757ac0ac68dc9cc171f4849e67cef) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "bu_voi-1.bin", 0x000000, 0x080000, CRC(99d8a239) SHA1(1ebc586048e757ac0ac68dc9cc171f4849e67cef) ) ROM_END ROM_START( burnforco ) @@ -2392,8 +2398,8 @@ ROM_START( burnforco ) NAMCOS2_DATA_LOAD_E_128K( "bu1_dat0.13s", 0x000000, CRC(e0a9d92f) SHA1(15042e6d7b31bec08ccdf36e89fdb4b6fb62fa4b) ) NAMCOS2_DATA_LOAD_O_128K( "bu1_dat1.13p", 0x000000, CRC(5fe54b73) SHA1(a5d4895f0a4523be20de40ccaa74f8fad0d5df7d) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "bu_voi-1.bin", 0x000000, 0x080000, CRC(99d8a239) SHA1(1ebc586048e757ac0ac68dc9cc171f4849e67cef) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "bu_voi-1.bin", 0x000000, 0x080000, CRC(99d8a239) SHA1(1ebc586048e757ac0ac68dc9cc171f4849e67cef) ) ROM_END /* COSMO GANG THE VIDEO (USA) */ @@ -2434,9 +2440,9 @@ ROM_START( cosmogng ) NAMCOS2_DATA_LOAD_E_128K( "co1dat0.13s", 0x000000, CRC(b53da2ae) SHA1(a7fe63668d50928d5d2e2249a5f377c7e8dfc6a5) ) NAMCOS2_DATA_LOAD_O_128K( "co1dat1.13p", 0x000000, CRC(d21ad10b) SHA1(dcf2d4cc048ea57507952a9a35390af7de5cfe34) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "co2voi1.bin", 0x000000, 0x080000, CRC(5a301349) SHA1(e333ea5955a66ac8d7c94cd50047efaf6fa95b15) ) - ROM_LOAD( "co2voi2.bin", 0x080000, 0x080000, CRC(a27cb45a) SHA1(08ccaaf43369e8358e31b213877829bdfd61479e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "co2voi1.bin", 0x000000, 0x080000, CRC(5a301349) SHA1(e333ea5955a66ac8d7c94cd50047efaf6fa95b15) ) + ROM_LOAD16_BYTE( "co2voi2.bin", 0x100000, 0x080000, CRC(a27cb45a) SHA1(08ccaaf43369e8358e31b213877829bdfd61479e) ) ROM_END /* COSMO GANG THE VIDEO (JAPAN) */ @@ -2477,9 +2483,9 @@ ROM_START( cosmogngj ) NAMCOS2_DATA_LOAD_E_128K( "co1dat0.13s", 0x000000, CRC(b53da2ae) SHA1(a7fe63668d50928d5d2e2249a5f377c7e8dfc6a5) ) NAMCOS2_DATA_LOAD_O_128K( "co1dat1.13p", 0x000000, CRC(d21ad10b) SHA1(dcf2d4cc048ea57507952a9a35390af7de5cfe34) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "co1voi1.bin", 0x000000, 0x080000, CRC(b5ba8f15) SHA1(9e54b9ba1cd44353782adf337376dff9eec4e937) ) - ROM_LOAD( "co1voi2.bin", 0x080000, 0x080000, CRC(b566b105) SHA1(b5530b0f3dea0135f28419044aee923d855f382c) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "co1voi1.bin", 0x000000, 0x080000, CRC(b5ba8f15) SHA1(9e54b9ba1cd44353782adf337376dff9eec4e937) ) + ROM_LOAD16_BYTE( "co1voi2.bin", 0x100000, 0x080000, CRC(b566b105) SHA1(b5530b0f3dea0135f28419044aee923d855f382c) ) ROM_END /* DIRT FOX (JAPAN) */ @@ -2527,8 +2533,8 @@ ROM_START( dirtfoxj ) NAMCOS2_DATA_LOAD_E_256K( "df1_dat0.13s", 0x000000, CRC(f5851c85) SHA1(e99c05891622cdaab394630b7b2678968e6761d7) ) NAMCOS2_DATA_LOAD_O_256K( "df1_dat1.13p", 0x000000, CRC(1a31e46b) SHA1(4be7115893b27d6a3dc38c97dcb41eafebb423cd) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "df1_voi1.bin", 0x000000, 0x080000, CRC(15053904) SHA1(b8ca7e5e53249dbee8284ce1e5c0e6438e64b2cf) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "df1_voi1.bin", 0x000000, 0x080000, CRC(15053904) SHA1(b8ca7e5e53249dbee8284ce1e5c0e6438e64b2cf) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "nvram", 0x000000, 0x2000, CRC(4b9f7b06) SHA1(384496d2d80a48d31084dc316ebae3a5c1aa1ab9) ) @@ -2571,9 +2577,9 @@ ROM_START( dsaber ) NAMCOS2_DATA_LOAD_E_128K( "do1 dat0.13s", 0x000000, CRC(3e53331f) SHA1(3dd4c133f587361f30ab1b890f5b05749d5838e3) ) NAMCOS2_DATA_LOAD_O_128K( "do1 dat1.13p", 0x000000, CRC(d5427f11) SHA1(af8d8153dc60044616a6b0571831c53c09fefda1) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "do voi-1a.voice1", 0x000000, 0x080000, CRC(dadf6a57) SHA1(caba21fc6b62d140f6d8231411ce82ae0ad2837a) ) - ROM_LOAD( "do voi-2a.voice2", 0x080000, 0x080000, CRC(81078e01) SHA1(adc70506b21b9a12eadd2f3fd1e920c2eb27c36e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "do voi-1a.voice1", 0x000000, 0x080000, CRC(dadf6a57) SHA1(caba21fc6b62d140f6d8231411ce82ae0ad2837a) ) + ROM_LOAD16_BYTE( "do voi-2a.voice2", 0x100000, 0x080000, CRC(81078e01) SHA1(adc70506b21b9a12eadd2f3fd1e920c2eb27c36e) ) ROM_REGION( 0x0500, "plds", 0 ) ROM_LOAD( "pal16l8a.4g", 0x0000, 0x0104, CRC(660e1655) SHA1(ffb43238c5ffa3fa831975bc3cde72334c4c2540) ) @@ -2619,9 +2625,9 @@ ROM_START( dsabera ) NAMCOS2_DATA_LOAD_E_128K( "do1 dat0.13s", 0x000000, CRC(3e53331f) SHA1(3dd4c133f587361f30ab1b890f5b05749d5838e3) ) NAMCOS2_DATA_LOAD_O_128K( "do1 dat1.13p", 0x000000, CRC(d5427f11) SHA1(af8d8153dc60044616a6b0571831c53c09fefda1) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "do voi-1a.voice1", 0x000000, 0x080000, CRC(dadf6a57) SHA1(caba21fc6b62d140f6d8231411ce82ae0ad2837a) ) - ROM_LOAD( "do voi-2a.voice2", 0x080000, 0x080000, CRC(81078e01) SHA1(adc70506b21b9a12eadd2f3fd1e920c2eb27c36e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "do voi-1a.voice1", 0x000000, 0x080000, CRC(dadf6a57) SHA1(caba21fc6b62d140f6d8231411ce82ae0ad2837a) ) + ROM_LOAD16_BYTE( "do voi-2a.voice2", 0x100000, 0x080000, CRC(81078e01) SHA1(adc70506b21b9a12eadd2f3fd1e920c2eb27c36e) ) ROM_REGION( 0x0500, "plds", 0 ) ROM_LOAD( "pal16l8a.4g", 0x0000, 0x0104, CRC(660e1655) SHA1(ffb43238c5ffa3fa831975bc3cde72334c4c2540) ) @@ -2666,9 +2672,9 @@ ROM_START( dsaberj ) NAMCOS2_DATA_LOAD_E_128K( "do1 dat0.13s", 0x000000, CRC(3e53331f) SHA1(3dd4c133f587361f30ab1b890f5b05749d5838e3) ) NAMCOS2_DATA_LOAD_O_128K( "do1 dat1.13p", 0x000000, CRC(d5427f11) SHA1(af8d8153dc60044616a6b0571831c53c09fefda1) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "do voi-1a.voice1", 0x000000, 0x080000, CRC(dadf6a57) SHA1(caba21fc6b62d140f6d8231411ce82ae0ad2837a) ) - ROM_LOAD( "do voi-2a.voice2", 0x080000, 0x080000, CRC(81078e01) SHA1(adc70506b21b9a12eadd2f3fd1e920c2eb27c36e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "do voi-1a.voice1", 0x000000, 0x080000, CRC(dadf6a57) SHA1(caba21fc6b62d140f6d8231411ce82ae0ad2837a) ) + ROM_LOAD16_BYTE( "do voi-2a.voice2", 0x100000, 0x080000, CRC(81078e01) SHA1(adc70506b21b9a12eadd2f3fd1e920c2eb27c36e) ) ROM_REGION( 0x0500, "plds", 0 ) ROM_LOAD( "pal16l8a.4g", 0x0000, 0x0104, CRC(660e1655) SHA1(ffb43238c5ffa3fa831975bc3cde72334c4c2540) ) @@ -2717,15 +2723,9 @@ ROM_START( finallap ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fl1-v1", 0x000000, 0x020000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) - ROM_RELOAD( 0x020000, 0x020000 ) - ROM_RELOAD( 0x040000, 0x020000 ) - ROM_RELOAD( 0x060000, 0x020000 ) - ROM_LOAD( "fl1-v2", 0x080000, 0x020000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) - ROM_RELOAD( 0x0a0000, 0x020000 ) - ROM_RELOAD( 0x0c0000, 0x020000 ) - ROM_RELOAD( 0x0e0000, 0x020000 ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + NAMCOS2_DATA_LOAD_E_128K( "fl1-v1", 0x000000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) + NAMCOS2_DATA_LOAD_E_128K( "fl1-v2", 0x100000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) ROM_END /* FINAL LAP (revision D) */ @@ -2769,15 +2769,9 @@ ROM_START( finallapd ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fl1-v1", 0x000000, 0x020000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) - ROM_RELOAD( 0x020000, 0x020000 ) - ROM_RELOAD( 0x040000, 0x020000 ) - ROM_RELOAD( 0x060000, 0x020000 ) - ROM_LOAD( "fl1-v2", 0x080000, 0x020000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) - ROM_RELOAD( 0x0a0000, 0x020000 ) - ROM_RELOAD( 0x0c0000, 0x020000 ) - ROM_RELOAD( 0x0e0000, 0x020000 ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + NAMCOS2_DATA_LOAD_E_128K( "fl1-v1", 0x000000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) + NAMCOS2_DATA_LOAD_E_128K( "fl1-v2", 0x100000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) ROM_END /* FINAL LAP (revision C) */ @@ -2821,15 +2815,9 @@ ROM_START( finallapc ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fl1-v1", 0x000000, 0x020000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) - ROM_RELOAD( 0x020000, 0x020000 ) - ROM_RELOAD( 0x040000, 0x020000 ) - ROM_RELOAD( 0x060000, 0x020000 ) - ROM_LOAD( "fl1-v2", 0x080000, 0x020000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) - ROM_RELOAD( 0x0a0000, 0x020000 ) - ROM_RELOAD( 0x0c0000, 0x020000 ) - ROM_RELOAD( 0x0e0000, 0x020000 ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + NAMCOS2_DATA_LOAD_E_128K( "fl1-v1", 0x000000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) + NAMCOS2_DATA_LOAD_E_128K( "fl1-v2", 0x100000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) ROM_END /* FINAL LAP (Rev C - Japan) */ @@ -2873,15 +2861,9 @@ ROM_START( finallapjc ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fl1-v1", 0x000000, 0x020000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) - ROM_RELOAD( 0x020000, 0x020000 ) - ROM_RELOAD( 0x040000, 0x020000 ) - ROM_RELOAD( 0x060000, 0x020000 ) - ROM_LOAD( "fl1-v2", 0x080000, 0x020000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) - ROM_RELOAD( 0x0a0000, 0x020000 ) - ROM_RELOAD( 0x0c0000, 0x020000 ) - ROM_RELOAD( 0x0e0000, 0x020000 ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + NAMCOS2_DATA_LOAD_E_128K( "fl1-v1", 0x000000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) + NAMCOS2_DATA_LOAD_E_128K( "fl1-v2", 0x100000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) ROM_END /* FINAL LAP (REV B - JAPAN) */ @@ -2925,15 +2907,9 @@ ROM_START( finallapjb ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fl1-v1", 0x000000, 0x020000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) - ROM_RELOAD( 0x020000, 0x020000 ) - ROM_RELOAD( 0x040000, 0x020000 ) - ROM_RELOAD( 0x060000, 0x020000 ) - ROM_LOAD( "fl1-v2", 0x080000, 0x020000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) - ROM_RELOAD( 0x0a0000, 0x020000 ) - ROM_RELOAD( 0x0c0000, 0x020000 ) - ROM_RELOAD( 0x0e0000, 0x020000 ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + NAMCOS2_DATA_LOAD_E_128K( "fl1-v1", 0x000000, CRC(86b21996) SHA1(833ffde729199c81e472fb88ed5b7f4ce08a83d6) ) + NAMCOS2_DATA_LOAD_E_128K( "fl1-v2", 0x100000, CRC(6a164647) SHA1(3162457beccccdb416994ebd32fb83b13eb719e0) ) ROM_END ROM_START( finalap2 ) @@ -2981,9 +2957,9 @@ ROM_START( finalap2 ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "flsvoi1", 0x000000, 0x080000, CRC(590be52f) SHA1(9ef2728dd533979b6019b422fc4961a6085428b4) ) - ROM_LOAD( "flsvoi2", 0x080000, 0x080000, CRC(204b3c27) SHA1(80cd13bfe2a4b3039b4a120b905674e46b8b3b9c) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "flsvoi1", 0x000000, 0x080000, CRC(590be52f) SHA1(9ef2728dd533979b6019b422fc4961a6085428b4) ) + ROM_LOAD16_BYTE( "flsvoi2", 0x100000, 0x080000, CRC(204b3c27) SHA1(80cd13bfe2a4b3039b4a120b905674e46b8b3b9c) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "finalap2.nv", 0x000000, 0x2000, CRC(c7ae5d0a) SHA1(9527e44accec0ec9d1990138d1b0bfc71957cc8a) ) @@ -3036,9 +3012,9 @@ ROM_START( finalap2j ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "flsvoi1", 0x000000, 0x080000, CRC(590be52f) SHA1(9ef2728dd533979b6019b422fc4961a6085428b4) ) - ROM_LOAD( "flsvoi2", 0x080000, 0x080000, CRC(204b3c27) SHA1(80cd13bfe2a4b3039b4a120b905674e46b8b3b9c) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "flsvoi1", 0x000000, 0x080000, CRC(590be52f) SHA1(9ef2728dd533979b6019b422fc4961a6085428b4) ) + ROM_LOAD16_BYTE( "flsvoi2", 0x100000, 0x080000, CRC(204b3c27) SHA1(80cd13bfe2a4b3039b4a120b905674e46b8b3b9c) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "finalap2.nv", 0x000000, 0x2000, CRC(c7ae5d0a) SHA1(9527e44accec0ec9d1990138d1b0bfc71957cc8a) ) @@ -3090,9 +3066,9 @@ ROM_START( finalap3 ) // this set displays MOTION (Ver. 3) in the test mode menu ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1_3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) - ROM_LOAD( "flt_voi-2.3l", 0x080000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) + ROM_LOAD16_BYTE( "flt_voi-2.3l", 0x100000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) ROM_REGION( 8*1024, "user2", 0 ) /* zoom */ ROM_LOAD( "04544191.6r", 0, 8*1024, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -3148,9 +3124,9 @@ ROM_START( finalap3a ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1_3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) - ROM_LOAD( "flt_voi-2.3l", 0x080000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) + ROM_LOAD16_BYTE( "flt_voi-2.3l", 0x100000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) ROM_REGION( 8*1024, "user2", 0 ) /* zoom */ ROM_LOAD( "04544191.6r", 0, 8*1024, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -3209,9 +3185,9 @@ ROM_START( finalap3j ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1_3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) - ROM_LOAD( "flt_voi-2.3l", 0x080000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) + ROM_LOAD16_BYTE( "flt_voi-2.3l", 0x100000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) ROM_REGION( 8*1024, "user2", 0 ) /* zoom */ ROM_LOAD( "04544191.6r", 0, 8*1024, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -3266,9 +3242,9 @@ ROM_START( finalap3jc ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* PROM for road colors */ ROM_LOAD( "fl1_3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) - ROM_LOAD( "flt_voi-2.3l", 0x080000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "flt_voi-1.3m", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) + ROM_LOAD16_BYTE( "flt_voi-2.3l", 0x100000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) ROM_REGION( 8*1024, "user2", 0 ) /* zoom */ ROM_LOAD( "04544191.6r", 0, 8*1024, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -3322,9 +3298,9 @@ ROM_START( finalap3bl ) // bootleg set ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "fl1-3.5b", 0, 0x100, CRC(d179d99a) SHA1(4e64f284c74d2b77f893bd28aaa6489084056aa2) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fltvoi1", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) - ROM_LOAD( "fltvoi2", 0x080000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "fltvoi1", 0x000000, 0x080000, CRC(4fc7c0ba) SHA1(bbfd1764fd79087bba5e6199e8916c28bed4d3f4) ) + ROM_LOAD16_BYTE( "fltvoi2", 0x100000, 0x080000, CRC(409c62df) SHA1(0c2f088168f1f92f2f767ea47522c0e8f4a10265) ) ROM_REGION( 8*1024, "user2", 0 ) /* zoom */ ROM_LOAD( "04544191.6r", 0, 8*1024, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -3380,8 +3356,8 @@ ROM_START( finehour ) NAMCOS2_DATA_LOAD_E_128K( "fh1_dt2.13r", 0x100000, CRC(12453ba4) SHA1(26ad0da6e56ece6f1ba0b0cf23d2fdae2ce24100) ) NAMCOS2_DATA_LOAD_O_128K( "fh1_dt3.13n", 0x100000, CRC(50bab9da) SHA1(9c18e5fb810123f9d17042212e0878172e220d2a) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fh1_vo1.bin", 0x000000, 0x080000, CRC(07560fc7) SHA1(76f3855f5a4567dc65d513e37072072c2a011e7e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "fh1_vo1.bin", 0x000000, 0x080000, CRC(07560fc7) SHA1(76f3855f5a4567dc65d513e37072072c2a011e7e) ) ROM_END /* @@ -3600,8 +3576,8 @@ ROM_START( fourtrax ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "fx1_1.5b", 0, 0x100, CRC(85ffd753) SHA1(7dbc8c295204877f41289141a146aa4f5f9f9c96) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) ) ROM_END ROM_START( fourtraxj ) @@ -3659,8 +3635,8 @@ ROM_START( fourtraxj ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "fx1_1.5b", 0, 0x100, CRC(85ffd753) SHA1(7dbc8c295204877f41289141a146aa4f5f9f9c96) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) ) ROM_END /* This is a strange set, it's based on the fx2 set, but with one of the 68k pair modified (21 bytes changed) and a unique GFX ROM @@ -3729,8 +3705,8 @@ ROM_START( fourtraxa ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "fx1_1.5b", 0, 0x100, CRC(85ffd753) SHA1(7dbc8c295204877f41289141a146aa4f5f9f9c96) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "fx_voi-1.3m", 0x000000, 0x080000, CRC(6173364f) SHA1(cc426f49b7e87b11f1f51e8e10db7cad87ffb44d) ) ROM_END /* MARVEL LAND (USA) */ @@ -3777,8 +3753,8 @@ ROM_START( marvland ) NAMCOS2_DATA_LOAD_E_128K( "mv2_dat2.13r", 0x100000, CRC(f5c6408c) SHA1(568fb08d0763dc91674d708fa2d15ca952956145) ) NAMCOS2_DATA_LOAD_O_128K( "mv2_dat3.13n", 0x100000, CRC(6df76955) SHA1(fcfb520399acdd3776f66944121d6980552d3100) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "mv1-voi1.bin", 0x000000, 0x080000, BAD_DUMP CRC(de5cac09) SHA1(2d73e54c4f159e52db2c403a59d6c137cce6f53e) ) // either undumped, or PCB was wrongly populated with JP samples ROM? + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "mv1-voi1.bin", 0x000000, 0x080000, BAD_DUMP CRC(de5cac09) SHA1(2d73e54c4f159e52db2c403a59d6c137cce6f53e) ) // either undumped, or PCB was wrongly populated with JP samples ROM? ROM_END /* MARVEL LAND (JAPAN) */ @@ -3823,8 +3799,8 @@ ROM_START( marvlandj ) NAMCOS2_DATA_LOAD_E_128K( "mv1-dat0.13s", 0x000000, CRC(e15f412e) SHA1(d3ff006d4577540a690c912e94897a1b638ac265) ) NAMCOS2_DATA_LOAD_O_128K( "mv1-dat1.13p", 0x000000, CRC(73e1545a) SHA1(a04034e56fef69fb2a2eb88f2f392c376e52d00d) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "mv1-voi1.bin", 0x000000, 0x080000, CRC(de5cac09) SHA1(2d73e54c4f159e52db2c403a59d6c137cce6f53e) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "mv1-voi1.bin", 0x000000, 0x080000, CRC(de5cac09) SHA1(2d73e54c4f159e52db2c403a59d6c137cce6f53e) ) ROM_END /* METAL HAWK */ @@ -3879,9 +3855,9 @@ ROM_START( metlhawk ) NAMCOS2_DATA_LOAD_E_128K( "mh1d0.13s", 0x000000, CRC(8b178ac7) SHA1(210d31baf0aaba1af5efc15ec05714123f669030) ) NAMCOS2_DATA_LOAD_O_128K( "mh1d1.13p", 0x000000, CRC(10684fd6) SHA1(1e39d32dcf7ab9a146aa01f47e2737142874eede) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "mhvoi-1.bin", 0x000000, 0x080000, CRC(2723d137) SHA1(f67334f8e456ae9e6aee39f0cf5e73449838f37f) ) - ROM_LOAD( "mhvoi-2.bin", 0x080000, 0x080000, CRC(dbc92d91) SHA1(a8c50f607d5283c8bd9688d2149b811e7ddb77dd) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "mhvoi-1.bin", 0x000000, 0x080000, CRC(2723d137) SHA1(f67334f8e456ae9e6aee39f0cf5e73449838f37f) ) + ROM_LOAD16_BYTE( "mhvoi-2.bin", 0x100000, 0x080000, CRC(dbc92d91) SHA1(a8c50f607d5283c8bd9688d2149b811e7ddb77dd) ) ROM_REGION( 0x2000, "user2", 0 ) /* sprite zoom lookup table */ ROM_LOAD( "mh5762.7p", 0x00000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -3947,9 +3923,9 @@ ROM_START( metlhawkj ) NAMCOS2_DATA_LOAD_E_128K( "mh1d0.13s", 0x000000, CRC(8b178ac7) SHA1(210d31baf0aaba1af5efc15ec05714123f669030) ) NAMCOS2_DATA_LOAD_O_128K( "mh1d1.13p", 0x000000, CRC(10684fd6) SHA1(1e39d32dcf7ab9a146aa01f47e2737142874eede) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "mhvoi-1.bin", 0x000000, 0x080000, CRC(2723d137) SHA1(f67334f8e456ae9e6aee39f0cf5e73449838f37f) ) - ROM_LOAD( "mhvoi-2.bin", 0x080000, 0x080000, CRC(dbc92d91) SHA1(a8c50f607d5283c8bd9688d2149b811e7ddb77dd) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "mhvoi-1.bin", 0x000000, 0x080000, CRC(2723d137) SHA1(f67334f8e456ae9e6aee39f0cf5e73449838f37f) ) + ROM_LOAD16_BYTE( "mhvoi-2.bin", 0x100000, 0x080000, CRC(dbc92d91) SHA1(a8c50f607d5283c8bd9688d2149b811e7ddb77dd) ) ROM_REGION( 0x2000, "user2", 0 ) /* sprite zoom lookup table */ ROM_LOAD( "mh5762.7p", 0x00000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -4010,9 +3986,9 @@ ROM_START( mirninja ) NAMCOS2_DATA_LOAD_E_128K( "mn1_dat0.13s", 0x000000, CRC(104bcca8) SHA1(e8368d0dc51bf0653143bf2261d7ed5b54d92941) ) NAMCOS2_DATA_LOAD_O_128K( "mn1_dat1.13p", 0x000000, CRC(d2a918fb) SHA1(032b7a7bcc60c41325e7b35df9a932e68cdd0788) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "mn_voi1.bin", 0x000000, 0x080000, CRC(2ca3573c) SHA1(b2af101730de4ccc68acc1ed143c21a8c81f64db) ) - ROM_LOAD( "mn_voi2.bin", 0x080000, 0x080000, CRC(466c3b47) SHA1(9c282ffda8b0620ae60789c81c6e36c086a9a335) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "mn_voi1.bin", 0x000000, 0x080000, CRC(2ca3573c) SHA1(b2af101730de4ccc68acc1ed143c21a8c81f64db) ) + ROM_LOAD16_BYTE( "mn_voi2.bin", 0x100000, 0x080000, CRC(466c3b47) SHA1(9c282ffda8b0620ae60789c81c6e36c086a9a335) ) ROM_END /* ORDYNE */ @@ -4063,9 +4039,9 @@ ROM_START( ordyne ) NAMCOS2_DATA_LOAD_E_128K( "or1_d0.13s", 0x000000, CRC(de214f7a) SHA1(59883c7886b403306c30e51d7f49225483792650) ) NAMCOS2_DATA_LOAD_O_128K( "or1_d1.13p", 0x000000, CRC(25e3e6c8) SHA1(ad093f15edaea71f6c7226c6e4f3c2130d418013) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "or_voi1.voice1", 0x000000, 0x080000, CRC(369e0bca) SHA1(2a921bb373dd043bd7b2a30e5e46ec3b8b3b5c8d) ) - ROM_LOAD( "or_voi2.voice2", 0x080000, 0x080000, CRC(9f4cd7b5) SHA1(10941dd5ab3846c0cb2543655944eaec742f8f21) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "or_voi1.voice1", 0x000000, 0x080000, CRC(369e0bca) SHA1(2a921bb373dd043bd7b2a30e5e46ec3b8b3b5c8d) ) + ROM_LOAD16_BYTE( "or_voi2.voice2", 0x100000, 0x080000, CRC(9f4cd7b5) SHA1(10941dd5ab3846c0cb2543655944eaec742f8f21) ) ROM_REGION( 0x2000, "user2", 0 ) /* sprite zoom lookup table */ ROM_LOAD( "lh5762.6n", 0x00000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -4119,9 +4095,9 @@ ROM_START( ordyneje ) NAMCOS2_DATA_LOAD_E_128K( "or1_d0.13s", 0x000000, CRC(de214f7a) SHA1(59883c7886b403306c30e51d7f49225483792650) ) NAMCOS2_DATA_LOAD_O_128K( "or1_d1.13p", 0x000000, CRC(25e3e6c8) SHA1(ad093f15edaea71f6c7226c6e4f3c2130d418013) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "or_voi1.voice1", 0x000000, 0x080000, CRC(369e0bca) SHA1(2a921bb373dd043bd7b2a30e5e46ec3b8b3b5c8d) ) - ROM_LOAD( "or_voi2.voice2", 0x080000, 0x080000, CRC(9f4cd7b5) SHA1(10941dd5ab3846c0cb2543655944eaec742f8f21) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "or_voi1.voice1", 0x000000, 0x080000, CRC(369e0bca) SHA1(2a921bb373dd043bd7b2a30e5e46ec3b8b3b5c8d) ) + ROM_LOAD16_BYTE( "or_voi2.voice2", 0x100000, 0x080000, CRC(9f4cd7b5) SHA1(10941dd5ab3846c0cb2543655944eaec742f8f21) ) ROM_REGION( 0x2000, "user2", 0 ) /* sprite zoom lookup table */ ROM_LOAD( "lh5762.6n", 0x00000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -4175,9 +4151,9 @@ ROM_START( ordynej ) NAMCOS2_DATA_LOAD_E_128K( "or1_d0.13s", 0x000000, CRC(de214f7a) SHA1(59883c7886b403306c30e51d7f49225483792650) ) NAMCOS2_DATA_LOAD_O_128K( "or1_d1.13p", 0x000000, CRC(25e3e6c8) SHA1(ad093f15edaea71f6c7226c6e4f3c2130d418013) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "or_voi1.voice1", 0x000000, 0x080000, CRC(369e0bca) SHA1(2a921bb373dd043bd7b2a30e5e46ec3b8b3b5c8d) ) - ROM_LOAD( "or_voi2.voice2", 0x080000, 0x080000, CRC(9f4cd7b5) SHA1(10941dd5ab3846c0cb2543655944eaec742f8f21) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "or_voi1.voice1", 0x000000, 0x080000, CRC(369e0bca) SHA1(2a921bb373dd043bd7b2a30e5e46ec3b8b3b5c8d) ) + ROM_LOAD16_BYTE( "or_voi2.voice2", 0x100000, 0x080000, CRC(9f4cd7b5) SHA1(10941dd5ab3846c0cb2543655944eaec742f8f21) ) ROM_REGION( 0x2000, "user2", 0 ) /* sprite zoom lookup table */ ROM_LOAD( "lh5762.6n", 0x00000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) @@ -4234,8 +4210,8 @@ ROM_START( phelios ) NAMCOS2_DATA_LOAD_E_128K( "ps2_dat0.13s", 0x000000, CRC(ee4194b0) SHA1(a0c2a807db70164ed761e5ad04301e5ae1173e7a) ) NAMCOS2_DATA_LOAD_O_128K( "ps2_dat1.13p", 0x000000, CRC(5b22d714) SHA1(f6cb1fe661f7691269840245f06875845fd6eb33) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ps_voi-1.voice1", 0x000000, 0x080000, CRC(f67376ed) SHA1(b54257aad34c6ad03d5b040e6a5dda94a48b6780) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ps_voi-1.voice1", 0x000000, 0x080000, CRC(f67376ed) SHA1(b54257aad34c6ad03d5b040e6a5dda94a48b6780) ) ROM_END /* PHELIOS (Japan) */ @@ -4289,8 +4265,8 @@ ROM_START( pheliosj ) NAMCOS2_DATA_LOAD_E_128K( "ps1_dat0.13s", 0x000000, CRC(ee4194b0) SHA1(a0c2a807db70164ed761e5ad04301e5ae1173e7a) ) /* Same DATA as World set, but labeled PS1 */ NAMCOS2_DATA_LOAD_O_128K( "ps1_dat1.13p", 0x000000, CRC(5b22d714) SHA1(f6cb1fe661f7691269840245f06875845fd6eb33) ) /* Same DATA as World set, but labeled PS1 */ - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ps_voi-1.voice1", 0x000000, 0x080000, CRC(f67376ed) SHA1(b54257aad34c6ad03d5b040e6a5dda94a48b6780) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ps_voi-1.voice1", 0x000000, 0x080000, CRC(f67376ed) SHA1(b54257aad34c6ad03d5b040e6a5dda94a48b6780) ) ROM_END /* ROLLING THUNDER 2 */ @@ -4331,9 +4307,9 @@ ROM_START( rthun2 ) NAMCOS2_DATA_LOAD_O_128K( "rst1_data1.13p", 0x000000, CRC(58a8daac) SHA1(c13ae8fc25b748a006c6db5b4b7ae593738544e8) ) NAMCOS2_DATA_LOAD_E_128K( "rst1_data2.13r", 0x100000, CRC(8e850a2a) SHA1(e5230e80a23ca6d09c2c53f443ecf70cc74075d7) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "rst1_voi1.bin", 0x000000, 0x080000, CRC(e42027cd) SHA1(fa3a81118c7f112289c27023236dec2e9cbc78b5) ) - ROM_LOAD( "rst1_voi2.bin", 0x080000, 0x080000, CRC(0c4c2b66) SHA1(7723cbef755439a66d026015596fe1547ccd65b1) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "rst1_voi1.bin", 0x000000, 0x080000, CRC(e42027cd) SHA1(fa3a81118c7f112289c27023236dec2e9cbc78b5) ) + ROM_LOAD16_BYTE( "rst1_voi2.bin", 0x100000, 0x080000, CRC(0c4c2b66) SHA1(7723cbef755439a66d026015596fe1547ccd65b1) ) ROM_END /* ROLLING THUNDER 2 (Japan) */ @@ -4374,9 +4350,9 @@ ROM_START( rthun2j ) NAMCOS2_DATA_LOAD_O_128K( "rst1_data1.13p", 0x000000, CRC(58a8daac) SHA1(c13ae8fc25b748a006c6db5b4b7ae593738544e8) ) NAMCOS2_DATA_LOAD_E_128K( "rst1_data2.13r", 0x100000, CRC(8e850a2a) SHA1(e5230e80a23ca6d09c2c53f443ecf70cc74075d7) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "rst1_voi1.bin", 0x000000, 0x080000, CRC(e42027cd) SHA1(fa3a81118c7f112289c27023236dec2e9cbc78b5) ) - ROM_LOAD( "rst1_voi2.bin", 0x080000, 0x080000, CRC(0c4c2b66) SHA1(7723cbef755439a66d026015596fe1547ccd65b1) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "rst1_voi1.bin", 0x000000, 0x080000, CRC(e42027cd) SHA1(fa3a81118c7f112289c27023236dec2e9cbc78b5) ) + ROM_LOAD16_BYTE( "rst1_voi2.bin", 0x100000, 0x080000, CRC(0c4c2b66) SHA1(7723cbef755439a66d026015596fe1547ccd65b1) ) /* stuff below isn't used but loaded because it was on the board .. */ ROM_REGION( 0x0950, "plds", 0 ) @@ -4427,9 +4403,9 @@ ROM_START( sgunner ) NAMCOS2_DATA_LOAD_E_128K( "sn1_dat0.13s", 0x000000, CRC(72bfeca8) SHA1(88a2f8959d803611b2f2e219cb8ff085a37d01fe) ) NAMCOS2_DATA_LOAD_O_128K( "sn1_dat1.13p", 0x000000, CRC(99b3e653) SHA1(d7e29ad4e059f5d5e03386d903428c879d591459) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "sn_voi1.3m", 0x000000, 0x080000, CRC(464e616d) SHA1(7279a2af64bdf76972bcf326611e6bff57a9cd39) ) - ROM_LOAD( "sn_voi2.3l", 0x080000, 0x080000, CRC(8c3251b5) SHA1(fa364c8462f490c636605262c5492a6a9b00e5b1) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "sn_voi1.3m", 0x000000, 0x080000, CRC(464e616d) SHA1(7279a2af64bdf76972bcf326611e6bff57a9cd39) ) + ROM_LOAD16_BYTE( "sn_voi2.3l", 0x100000, 0x080000, CRC(8c3251b5) SHA1(fa364c8462f490c636605262c5492a6a9b00e5b1) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "sgunner.nv", 0x000000, 0x2000, CRC(106026f8) SHA1(e4be6701d4eef6c18406593c6dee10644f29a15b) ) @@ -4475,9 +4451,9 @@ ROM_START( sgunnerj ) NAMCOS2_DATA_LOAD_E_128K( "sn1_dat0.13s", 0x000000, CRC(72bfeca8) SHA1(88a2f8959d803611b2f2e219cb8ff085a37d01fe) ) NAMCOS2_DATA_LOAD_O_128K( "sn1_dat1.13p", 0x000000, CRC(99b3e653) SHA1(d7e29ad4e059f5d5e03386d903428c879d591459) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "sn_voi1.3m", 0x000000, 0x080000, CRC(464e616d) SHA1(7279a2af64bdf76972bcf326611e6bff57a9cd39) ) - ROM_LOAD( "sn_voi2.3l", 0x080000, 0x080000, CRC(8c3251b5) SHA1(fa364c8462f490c636605262c5492a6a9b00e5b1) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "sn_voi1.3m", 0x000000, 0x080000, CRC(464e616d) SHA1(7279a2af64bdf76972bcf326611e6bff57a9cd39) ) + ROM_LOAD16_BYTE( "sn_voi2.3l", 0x100000, 0x080000, CRC(8c3251b5) SHA1(fa364c8462f490c636605262c5492a6a9b00e5b1) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "sgunner.nv", 0x000000, 0x2000, CRC(106026f8) SHA1(e4be6701d4eef6c18406593c6dee10644f29a15b) ) @@ -4527,9 +4503,9 @@ ROM_START( sgunner2 ) NAMCOS2_DATA_LOAD_E_128K( "sns_dat2.13r", 0x100000, CRC(ca2ae645) SHA1(8addc8ed8244d0ff4c03909e865e3f15934963f1) ) NAMCOS2_DATA_LOAD_O_128K( "sns_dat3.13n", 0x100000, CRC(203bb018) SHA1(36e20ab81ed69a941e13518ff2ae52acd6b22a78) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "sns_voi1.bin", 0x000000, 0x080000, CRC(219c97f7) SHA1(d4b1d81e3d0e2585bc2fa305c0d80beef15b2a9f) ) - ROM_LOAD( "sns_voi2.bin", 0x080000, 0x080000, CRC(562ec86b) SHA1(c9874c7e1f38c5b38d21f45a82028651cf9089a5) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "sns_voi1.bin", 0x000000, 0x080000, CRC(219c97f7) SHA1(d4b1d81e3d0e2585bc2fa305c0d80beef15b2a9f) ) + ROM_LOAD16_BYTE( "sns_voi2.bin", 0x100000, 0x080000, CRC(562ec86b) SHA1(c9874c7e1f38c5b38d21f45a82028651cf9089a5) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "sgunner2.nv", 0x000000, 0x2000, CRC(57a521c6) SHA1(d60b4f6f099b7f9fb1e575c5f9a74397986c6dac) ) @@ -4579,9 +4555,9 @@ ROM_START( sgunner2j ) NAMCOS2_DATA_LOAD_E_128K( "sns_dat2.13r", 0x100000, CRC(ca2ae645) SHA1(8addc8ed8244d0ff4c03909e865e3f15934963f1) ) NAMCOS2_DATA_LOAD_O_128K( "sns_dat3.13n", 0x100000, CRC(203bb018) SHA1(36e20ab81ed69a941e13518ff2ae52acd6b22a78) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "sns_voi1.bin", 0x000000, 0x080000, CRC(219c97f7) SHA1(d4b1d81e3d0e2585bc2fa305c0d80beef15b2a9f) ) - ROM_LOAD( "sns_voi2.bin", 0x080000, 0x080000, CRC(562ec86b) SHA1(c9874c7e1f38c5b38d21f45a82028651cf9089a5) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "sns_voi1.bin", 0x000000, 0x080000, CRC(219c97f7) SHA1(d4b1d81e3d0e2585bc2fa305c0d80beef15b2a9f) ) + ROM_LOAD16_BYTE( "sns_voi2.bin", 0x100000, 0x080000, CRC(562ec86b) SHA1(c9874c7e1f38c5b38d21f45a82028651cf9089a5) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "sgunner2j.nv", 0x000000, 0x2000, CRC(014bccf9) SHA1(b6437fadf3e71df7a71fde9ec7ffc95fe6c057b3) ) @@ -4624,8 +4600,8 @@ ROM_START( sws ) NAMCOS2_DATA_LOAD_E_256K( "ss1_dat0.13s", 0x000000, CRC(6a360f91) SHA1(22597c6bf7c597cf554a27182b4748de43a87b0a) ) NAMCOS2_DATA_LOAD_O_256K( "ss1_dat1.13p", 0x000000, CRC(ab1e487d) SHA1(b40ea6c28dd9adae4939f69fcbf53414ae4703c6) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) ROM_END /* SUPER WORLD STADIUM 92 */ @@ -4667,8 +4643,8 @@ ROM_START( sws92 ) NAMCOS2_DATA_LOAD_E_256K( "sss1dat0.13s", 0x000000, CRC(db3e6aec) SHA1(928960e3dc9c8225e695d12e9b18fbb7f151c151) ) NAMCOS2_DATA_LOAD_O_256K( "sss1dat1.13p", 0x000000, CRC(463b5ba8) SHA1(029dce2e7ee50181392b6ef409bbd192105fb065) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) ROM_END /* SUPER WORLD STADIUM 92 */ @@ -4712,8 +4688,8 @@ ROM_START( sws92g ) NAMCOS2_DATA_LOAD_E_256K( "ssg1dat2.13r", 0x080000, CRC(754128aa) SHA1(459ffb08bcd905644d6019e5b25870dcb1e2b418) ) NAMCOS2_DATA_LOAD_O_256K( "ssg1dat3.13n", 0x080000, CRC(cb3fed01) SHA1(68887d46fd07cd8fb67d58f37e74a6aefdae4328) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) ROM_END /* SUPER WORLD STADIUM 93 */ @@ -4755,8 +4731,8 @@ ROM_START( sws93 ) NAMCOS2_DATA_LOAD_E_512K( "sst1dat0.13s", 0x000000, CRC(b99c9656) SHA1(ac9e6bf46204dad70caf0d75614a20af0269a07f) ) NAMCOS2_DATA_LOAD_O_512K( "sst1dat1.13p", 0x000000, CRC(60cf6281) SHA1(c02a5bf8f4f94cbe8b0448c9457af53cd1c043d0) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ss_voi1.bin", 0x000000, 0x080000, CRC(503e51b7) SHA1(2e159fcc9bb0bef9a3476ae233bc8d61fabbb4bd) ) ROM_END /* SUZUKA 8 HOURS (World?) */ @@ -4801,9 +4777,9 @@ ROM_START( suzuka8h ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "ehs1_landdt.10w", 0, 0x100, CRC(cde7e8a6) SHA1(860273daf2e649418746adf50a67ae33f9f3740c) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "eh1-voi1.bin", 0x000000, 0x080000, CRC(71e534d3) SHA1(2981de315e660b878673b5d3816886e96f0556d6) ) - ROM_LOAD( "eh1-voi2.bin", 0x080000, 0x080000, CRC(3e20df8e) SHA1(7f1d57a5a73c45c69f0afd137a630bf07c4e7a9c) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "eh1-voi1.bin", 0x000000, 0x080000, CRC(71e534d3) SHA1(2981de315e660b878673b5d3816886e96f0556d6) ) + ROM_LOAD16_BYTE( "eh1-voi2.bin", 0x100000, 0x080000, CRC(3e20df8e) SHA1(7f1d57a5a73c45c69f0afd137a630bf07c4e7a9c) ) ROM_END /* suzuka8h */ /* SUZUKA 8 HOURS (Japan) */ @@ -4848,9 +4824,9 @@ ROM_START( suzuka8hj ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "ehs1_landdt.10w", 0, 0x100, CRC(cde7e8a6) SHA1(860273daf2e649418746adf50a67ae33f9f3740c) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "eh1-voi1.bin", 0x000000, 0x080000, CRC(71e534d3) SHA1(2981de315e660b878673b5d3816886e96f0556d6) ) - ROM_LOAD( "eh1-voi2.bin", 0x080000, 0x080000, CRC(3e20df8e) SHA1(7f1d57a5a73c45c69f0afd137a630bf07c4e7a9c) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "eh1-voi1.bin", 0x000000, 0x080000, CRC(71e534d3) SHA1(2981de315e660b878673b5d3816886e96f0556d6) ) + ROM_LOAD16_BYTE( "eh1-voi2.bin", 0x100000, 0x080000, CRC(3e20df8e) SHA1(7f1d57a5a73c45c69f0afd137a630bf07c4e7a9c) ) ROM_END /* suzuk8hj */ /* SUZUKA 8 HOURS 2 */ @@ -4901,9 +4877,9 @@ ROM_START( suzuk8h2 ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "ehs1-landdt.10w", 0, 0x100, CRC(cde7e8a6) SHA1(860273daf2e649418746adf50a67ae33f9f3740c) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ehs1-voi1.3m", 0x000000, 0x080000, CRC(bf94eb42) SHA1(61bb36550a58ffb8ad0ab8f5b51eddd7824ae8bc) ) - ROM_LOAD( "ehs1-voi2.3l", 0x080000, 0x080000, CRC(0e427604) SHA1(ebb15f53713c24731f6ebdc37ece88587cce5616) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ehs1-voi1.3m", 0x000000, 0x080000, CRC(bf94eb42) SHA1(61bb36550a58ffb8ad0ab8f5b51eddd7824ae8bc) ) + ROM_LOAD16_BYTE( "ehs1-voi2.3l", 0x100000, 0x080000, CRC(0e427604) SHA1(ebb15f53713c24731f6ebdc37ece88587cce5616) ) ROM_END /* suzuk8h2 */ /* SUZUKA 8 HOURS 2 Japan */ @@ -4954,9 +4930,9 @@ ROM_START( suzuk8h2j ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "ehs1-landdt.10w", 0, 0x100, CRC(cde7e8a6) SHA1(860273daf2e649418746adf50a67ae33f9f3740c) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ehs1-voi1.3m", 0x000000, 0x080000, CRC(bf94eb42) SHA1(61bb36550a58ffb8ad0ab8f5b51eddd7824ae8bc) ) - ROM_LOAD( "ehs1-voi2.3l", 0x080000, 0x080000, CRC(0e427604) SHA1(ebb15f53713c24731f6ebdc37ece88587cce5616) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ehs1-voi1.3m", 0x000000, 0x080000, CRC(bf94eb42) SHA1(61bb36550a58ffb8ad0ab8f5b51eddd7824ae8bc) ) + ROM_LOAD16_BYTE( "ehs1-voi2.3l", 0x100000, 0x080000, CRC(0e427604) SHA1(ebb15f53713c24731f6ebdc37ece88587cce5616) ) ROM_END /* suzuk8h2j */ /* LEGEND OF THE VALKYRIE */ @@ -5006,13 +4982,9 @@ ROM_START( valkyrie ) NAMCOS2_DATA_LOAD_E_128K( "wd1dat0.13s", 0x000000, CRC(ea209f48) SHA1(5e73a745dc2faaa4ce6c633d4072d41e9e494276) ) NAMCOS2_DATA_LOAD_O_128K( "wd1dat1.13p", 0x000000, CRC(04b48ada) SHA1(aa046f8856bdd5b56d481c2c12ad2808c6517a5f) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "wd1voi1.bin", 0x000000, 0x040000, CRC(f1ace193) SHA1(dd13bdf4b99c6bf4e356d623ff2e3da72db331dd) ) - ROM_RELOAD( 0x040000, 0x040000 ) - ROM_LOAD( "wd1voi2.bin", 0x080000, 0x020000, CRC(e95c5cf3) SHA1(4bfc7303bde23bcf6739c7877dd87671c33135bc) ) - ROM_RELOAD( 0x0a0000, 0x020000 ) - ROM_RELOAD( 0x0c0000, 0x020000 ) - ROM_RELOAD( 0x0e0000, 0x020000 ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + NAMCOS2_DATA_LOAD_E_256K( "wd1voi1.bin", 0x000000, CRC(f1ace193) SHA1(dd13bdf4b99c6bf4e356d623ff2e3da72db331dd) ) + NAMCOS2_DATA_LOAD_E_128K( "wd1voi2.bin", 0x100000, CRC(e95c5cf3) SHA1(4bfc7303bde23bcf6739c7877dd87671c33135bc) ) ROM_END /* KYUUKAI DOUCHUUKI */ @@ -5058,8 +5030,8 @@ ROM_START( kyukaidk ) NAMCOS2_DATA_LOAD_E_128K( "ky1_d2.13r", 0x100000, CRC(eb6d19c8) SHA1(c9fdb33fe191d3c4d284db7cbb05d852551a998d) ) NAMCOS2_DATA_LOAD_O_128K( "ky1_d3.13n", 0x100000, CRC(95674701) SHA1(9a8832837b9a3f8b75437717ea84d86261bfce59) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ky1_v1.bin", 0x000000, 0x080000, CRC(5ff81aec) SHA1(0535eda474de0a4aa3b48649b04afe2b7a8619c9) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ky1_v1.bin", 0x000000, 0x080000, CRC(5ff81aec) SHA1(0535eda474de0a4aa3b48649b04afe2b7a8619c9) ) ROM_END /* KYUUKAI DOUCHUUKI (OLD) */ @@ -5105,8 +5077,8 @@ ROM_START( kyukaidko ) NAMCOS2_DATA_LOAD_E_128K( "ky1_d2.13r", 0x100000, CRC(eb6d19c8) SHA1(c9fdb33fe191d3c4d284db7cbb05d852551a998d) ) NAMCOS2_DATA_LOAD_O_128K( "ky1_d3.13n", 0x100000, CRC(95674701) SHA1(9a8832837b9a3f8b75437717ea84d86261bfce59) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "ky1_v1.bin", 0x000000, 0x080000, CRC(5ff81aec) SHA1(0535eda474de0a4aa3b48649b04afe2b7a8619c9) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "ky1_v1.bin", 0x000000, 0x080000, CRC(5ff81aec) SHA1(0535eda474de0a4aa3b48649b04afe2b7a8619c9) ) ROM_END /* GOLLY GHOST */ @@ -5148,8 +5120,8 @@ ROM_START( gollygho ) ROM_REGION16_BE( 0x2000, "user2", 0 ) /* sprite zoom */ ROM_LOAD( "04544191.6n", 0x000000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "gl1voi1.3m", 0x000000, 0x080000, CRC(0eca0efb) SHA1(4e8e1b3118ee0b76c34dd6631047080ba1fcf576) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "gl1voi1.3m", 0x000000, 0x080000, CRC(0eca0efb) SHA1(4e8e1b3118ee0b76c34dd6631047080ba1fcf576) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "gollygho.nv", 0x000000, 0x2000, CRC(b7e67b9d) SHA1(bb6e2d2cac1a2f3c26fa1327db0eb53b521005a3) ) @@ -5194,8 +5166,8 @@ ROM_START( bubbletr ) /* All labels were hand written and included the rom size, ROM_REGION16_BE( 0x2000, "user2", 0 ) /* sprite zoom */ ROM_LOAD( "04544191.6n", 0x000000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "bt1-voi1.3m", 0x000000, 0x080000, CRC(08b3a089) SHA1(5023c2c0d0a94f0a2f98605d9b93d2d6ce626aa8) ) /* dated 6/8 */ + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "bt1-voi1.3m", 0x000000, 0x080000, CRC(08b3a089) SHA1(5023c2c0d0a94f0a2f98605d9b93d2d6ce626aa8) ) /* dated 6/8 */ ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "bubbletr.nv", 0x000000, 0x2000, CRC(75ace624) SHA1(1acd2af0c825e50c542db975e1fbda8cbb009f1d) ) @@ -5240,8 +5212,8 @@ ROM_START( bubbletrj ) ROM_REGION16_BE( 0x2000, "user2", 0 ) /* sprite zoom */ ROM_LOAD( "04544191.6n", 0x000000, 0x002000, CRC(90db1bf6) SHA1(dbb9e50a8efc3b4012fcf587cc87da9ef42a1b80) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "bt1-voi1.3m", 0x000000, 0x080000, CRC(08b3a089) SHA1(5023c2c0d0a94f0a2f98605d9b93d2d6ce626aa8) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "bt1-voi1.3m", 0x000000, 0x080000, CRC(08b3a089) SHA1(5023c2c0d0a94f0a2f98605d9b93d2d6ce626aa8) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "bubbletr.nv", 0x000000, 0x2000, CRC(75ace624) SHA1(1acd2af0c825e50c542db975e1fbda8cbb009f1d) ) @@ -5406,9 +5378,9 @@ ROM_START( luckywld ) ROM_LOAD16_BYTE( "lw1dat2.13r", 0x100000, 0x80000, CRC(eeba7c62) SHA1(6468518d3a5499b3f9a066488d83252cfc804d69) ) ROM_LOAD16_BYTE( "lw1dat3.13n", 0x100001, 0x80000, CRC(ec3b36ea) SHA1(734549ada73a687377134051fa906b489ffd0dc4) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "lw1voi1.3m", 0x000000, 0x080000, CRC(b3e57993) SHA1(ff7071fc2e2c00f0cf819860c2a9be353474920a) ) - ROM_LOAD( "lw1voi2.3l", 0x080000, 0x080000, CRC(cd8b86a2) SHA1(54bbc91e995ea0c33874ce6fe5c3f014e173da07) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "lw1voi1.3m", 0x000000, 0x080000, CRC(b3e57993) SHA1(ff7071fc2e2c00f0cf819860c2a9be353474920a) ) + ROM_LOAD16_BYTE( "lw1voi2.3l", 0x100000, 0x080000, CRC(cd8b86a2) SHA1(54bbc91e995ea0c33874ce6fe5c3f014e173da07) ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "lw1ld8.10w", 0, 0x100, CRC(29058c73) SHA1(4916d6bdb7f78e6803698cab32d1586ea457dfc8) ) @@ -5468,9 +5440,9 @@ ROM_START( luckywldj ) ROM_LOAD16_BYTE( "lw1dat2.13r", 0x100000, 0x80000, CRC(eeba7c62) SHA1(6468518d3a5499b3f9a066488d83252cfc804d69) ) ROM_LOAD16_BYTE( "lw1dat3.13n", 0x100001, 0x80000, CRC(ec3b36ea) SHA1(734549ada73a687377134051fa906b489ffd0dc4) ) - ROM_REGION( 0x100000, "c140", 0 ) /* Sound voices */ - ROM_LOAD( "lw1voi1.3m", 0x000000, 0x080000, CRC(b3e57993) SHA1(ff7071fc2e2c00f0cf819860c2a9be353474920a) ) - ROM_LOAD( "lw1voi2.3l", 0x080000, 0x080000, CRC(cd8b86a2) SHA1(54bbc91e995ea0c33874ce6fe5c3f014e173da07) ) + ROM_REGION16_BE( 0x200000, "c140", ROMREGION_ERASE00 ) /* Sound voices */ + ROM_LOAD16_BYTE( "lw1voi1.3m", 0x000000, 0x080000, CRC(b3e57993) SHA1(ff7071fc2e2c00f0cf819860c2a9be353474920a) ) + ROM_LOAD16_BYTE( "lw1voi2.3l", 0x100000, 0x080000, CRC(cd8b86a2) SHA1(54bbc91e995ea0c33874ce6fe5c3f014e173da07) ) ROM_REGION( 0x100, "c45_road:clut", 0 ) /* prom for road colors */ ROM_LOAD( "lw1ld8.10w", 0, 0x100, CRC(29058c73) SHA1(4916d6bdb7f78e6803698cab32d1586ea457dfc8) ) diff --git a/src/mame/drivers/namcos21.cpp b/src/mame/drivers/namcos21.cpp index 32c8bee1c4b..1c979048921 100644 --- a/src/mame/drivers/namcos21.cpp +++ b/src/mame/drivers/namcos21.cpp @@ -309,6 +309,7 @@ public: m_palette(*this, "palette"), m_screen(*this, "screen"), m_audiobank(*this, "audiobank"), + m_c140_region(*this, "c140"), m_dpram(*this, "dpram"), m_gpu_intc(*this, "gpu_intc"), m_namcos21_3d(*this, "namcos21_3d"), @@ -332,6 +333,7 @@ private: required_device m_palette; required_device m_screen; required_memory_bank m_audiobank; + required_region_ptr m_c140_region; required_shared_ptr m_dpram; required_device m_gpu_intc; required_device m_namcos21_3d; @@ -386,6 +388,7 @@ private: void winrun_gpu_map(address_map &map); void sound_map(address_map &map); + void c140_map(address_map &map); }; READ16_MEMBER(namcos21_state::winrun_gpu_color_r) @@ -586,9 +589,9 @@ void namcos21_state::sound_map(address_map &map) map(0x0000, 0x3fff).bankr("audiobank"); /* banked */ map(0x3000, 0x3003).nopw(); /* ? */ map(0x4000, 0x4001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x5000, 0x6fff).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); - map(0x7000, 0x77ff).rw(FUNC(namcos21_state::dpram_byte_r), FUNC(namcos21_state::dpram_byte_w)).share("dpram"); - map(0x7800, 0x7fff).rw(FUNC(namcos21_state::dpram_byte_r), FUNC(namcos21_state::dpram_byte_w)); /* mirror */ + map(0x5000, 0x51ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); + map(0x6000, 0x61ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); // mirrored + map(0x7000, 0x77ff).mirror(0x0800).rw(FUNC(namcos21_state::dpram_byte_r), FUNC(namcos21_state::dpram_byte_w)).share("dpram"); map(0x8000, 0x9fff).ram(); map(0xa000, 0xbfff).nopw(); /* amplifier enable on 1st write */ map(0xc000, 0xffff).nopw(); /* avoid debug log noise; games write frequently to 0xe000 */ @@ -597,6 +600,13 @@ void namcos21_state::sound_map(address_map &map) map(0xd000, 0xffff).rom().region("audiocpu", 0x01000); } +void namcos21_state::c140_map(address_map &map) +{ + map.global_mask(0x7fffff); + // TODO: LSB not used? verify from schematics/real hardware + map(0x000000, 0x7fffff).lr16([this](offs_t offset) { return m_c140_region[((offset & 0x300000) >> 1) | (offset & 0x7ffff)]; }, "c140_rom_r"); +} + /*************************************************************/ /* I/O HD63705 MCU Memory declarations */ @@ -898,7 +908,7 @@ void namcos21_state::winrun(machine_config &config) SPEAKER(config, "rspeaker").front_right(); C140(config, m_c140, 8000000/374); - m_c140->set_bank_type(c140_device::C140_TYPE::SYSTEM21); + m_c140->set_addrmap(0, &namcos21_state::c140_map); m_c140->int1_callback().set_inputline(m_audiocpu, M6809_FIRQ_LINE); m_c140->add_route(0, "lspeaker", 0.50); m_c140->add_route(1, "rspeaker", 0.50); @@ -942,11 +952,11 @@ ROM_START( winrun ) ROM_LOAD16_BYTE( "wr1-pt0u.8j", 0x00000, 0x20000, CRC(7ec4cf6b) SHA1(92ec92567b9f7321efb4a3724cbcdba216eb22f9) ) ROM_LOAD16_BYTE( "wr1-pt0l.8d", 0x00001, 0x20000, CRC(58c14b73) SHA1(e34a26866cd870743e166669f7fa5915a82104e9) ) - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("wr-voi-0.11b", 0x040000, 0x40000, CRC(8040b645) SHA1(7ccafb3073fa79910e26cf9b8b6e8e9ae22e55fc) ) - ROM_LOAD("wr-voi-1.11c", 0x0c0000, 0x40000, CRC(d347e904) SHA1(620cd07e6230322c306283e45a43fa1e217028d4) ) - ROM_LOAD("wr-voi-2.11d", 0x140000, 0x40000, CRC(b34747af) SHA1(7e0b55631bffa0583bf4f7f5368db9f09e411ba1) ) - ROM_LOAD("wr-voi-3.11e", 0x1c0000, 0x40000, CRC(43085303) SHA1(9f743055c20df3548879118194244e37a0b91f7e) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("wr-voi-0.11b", 0x080000, 0x40000, CRC(8040b645) SHA1(7ccafb3073fa79910e26cf9b8b6e8e9ae22e55fc) ) + ROM_LOAD16_BYTE("wr-voi-1.11c", 0x180000, 0x40000, CRC(d347e904) SHA1(620cd07e6230322c306283e45a43fa1e217028d4) ) + ROM_LOAD16_BYTE("wr-voi-2.11d", 0x280000, 0x40000, CRC(b34747af) SHA1(7e0b55631bffa0583bf4f7f5368db9f09e411ba1) ) + ROM_LOAD16_BYTE("wr-voi-3.11e", 0x380000, 0x40000, CRC(43085303) SHA1(9f743055c20df3548879118194244e37a0b91f7e) ) ROM_REGION( 0x1000, "pals", 0 ) /* Main PCB (2252960101) */ @@ -1010,9 +1020,9 @@ ROM_START( winrungp ) ROM_LOAD16_BYTE( "sg1-pt1-u.8l", 0x40000, 0x20000, CRC(b63d3006) SHA1(78e78619766b0fd91b1e830cfb066495d6773981) ) ROM_LOAD16_BYTE( "sg1-pt1-l.8e", 0x40001, 0x20000, CRC(6385e325) SHA1(d50bceb2e9c0d0a38d7b0f918f99c482649e260d) ) - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("sg-voi-1.11c", 0x080000, 0x80000,CRC(7dcccb31) SHA1(4441b37691434b13eae5dee2d04dc12a56b04d2a) ) - ROM_LOAD("sg-voi-3.11e", 0x180000, 0x80000,CRC(a198141c) SHA1(b4ca352e6aedd9d7a7e5e39e840f1d3a7145900e) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("sg-voi-1.11c", 0x100000, 0x80000,CRC(7dcccb31) SHA1(4441b37691434b13eae5dee2d04dc12a56b04d2a) ) + ROM_LOAD16_BYTE("sg-voi-3.11e", 0x300000, 0x80000,CRC(a198141c) SHA1(b4ca352e6aedd9d7a7e5e39e840f1d3a7145900e) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "nvram", 0x0000, 0x2000, CRC(93cca84c) SHA1(e39510d9f066266a77780662a6d991c3dd0348d1) ) @@ -1057,9 +1067,9 @@ ROM_START( winrun91 ) ROM_LOAD16_BYTE( "r911-pt1u.8l", 0x40000, 0x20000, CRC(7e5dab74) SHA1(5bde219d5b4305d38d17b494b2e759f05d05329f) ) ROM_LOAD16_BYTE( "r911-pt1l.8e", 0x40001, 0x20000, CRC(38a54ec5) SHA1(5c6017c98cae674868153ff2d64532027cf0ab83) ) - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("r911-avo1.11c", 0x080000, 0x80000,CRC(9fb33af3) SHA1(666630a8e5766ca4c3275961963c3e713dfdda2d) ) - ROM_LOAD("r911-avo3.11e", 0x180000, 0x80000,CRC(76e22f92) SHA1(0e1b8d35a5b9c20cc3192d935f0c9da1e69679d2) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("r911-avo1.11c", 0x100000, 0x80000,CRC(9fb33af3) SHA1(666630a8e5766ca4c3275961963c3e713dfdda2d) ) + ROM_LOAD16_BYTE("r911-avo3.11e", 0x300000, 0x80000,CRC(76e22f92) SHA1(0e1b8d35a5b9c20cc3192d935f0c9da1e69679d2) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "nvram", 0x0000, 0x2000, CRC(75bcbc22) SHA1(1e7e785735d27aa8cd8393b16b589a46ecd7956a) ) diff --git a/src/mame/drivers/namcos21_c67.cpp b/src/mame/drivers/namcos21_c67.cpp index 81d688d9b19..6fbde2a8e6d 100644 --- a/src/mame/drivers/namcos21_c67.cpp +++ b/src/mame/drivers/namcos21_c67.cpp @@ -290,6 +290,7 @@ public: m_palette(*this, "palette"), m_screen(*this, "screen"), m_audiobank(*this, "audiobank"), + m_c140_region(*this, "c140"), m_dpram(*this, "dpram"), m_namcos21_3d(*this, "namcos21_3d"), m_namcos21_dsp_c67(*this, "namcos21dsp_c67") @@ -317,6 +318,7 @@ private: required_device m_palette; required_device m_screen; required_memory_bank m_audiobank; + required_region_ptr m_c140_region; required_shared_ptr m_dpram; required_device m_namcos21_3d; required_device m_namcos21_dsp_c67; @@ -358,6 +360,7 @@ private: void slave_map(address_map &map); void sound_map(address_map &map); + void c140_map(address_map &map); }; @@ -482,9 +485,9 @@ void namcos21_c67_state::sound_map(address_map &map) map(0x0000, 0x3fff).bankr("audiobank"); /* banked */ map(0x3000, 0x3003).nopw(); /* ? */ map(0x4000, 0x4001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x5000, 0x6fff).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); - map(0x7000, 0x77ff).rw(FUNC(namcos21_c67_state::dpram_byte_r), FUNC(namcos21_c67_state::dpram_byte_w)).share("dpram"); - map(0x7800, 0x7fff).rw(FUNC(namcos21_c67_state::dpram_byte_r), FUNC(namcos21_c67_state::dpram_byte_w)); /* mirror */ + map(0x5000, 0x51ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); + map(0x6000, 0x61ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); // mirrored + map(0x7000, 0x77ff).mirror(0x0800).rw(FUNC(namcos21_c67_state::dpram_byte_r), FUNC(namcos21_c67_state::dpram_byte_w)).share("dpram"); map(0x8000, 0x9fff).ram(); map(0xa000, 0xbfff).nopw(); /* amplifier enable on 1st write */ map(0xc000, 0xffff).nopw(); /* avoid debug log noise; games write frequently to 0xe000 */ @@ -493,6 +496,13 @@ void namcos21_c67_state::sound_map(address_map &map) map(0xd000, 0xffff).rom().region("audiocpu", 0x01000); } +void namcos21_c67_state::c140_map(address_map &map) +{ + map.global_mask(0x7fffff); + // TODO: LSB not used? verify from schematics/real hardware + map(0x000000, 0x7fffff).lr16([this](offs_t offset) { return m_c140_region[((offset & 0x300000) >> 1) | (offset & 0x7ffff)]; }, "c140_rom_r"); +} + /*************************************************************/ /* I/O HD63705 MCU Memory declarations */ /*************************************************************/ @@ -829,7 +839,7 @@ void namcos21_c67_state::namcos21(machine_config &config) SPEAKER(config, "rspeaker").front_right(); C140(config, m_c140, 8000000/374); - m_c140->set_bank_type(c140_device::C140_TYPE::SYSTEM21); + m_c140->set_addrmap(0, &namcos21_c67_state::c140_map); m_c140->int1_callback().set_inputline(m_audiocpu, M6809_FIRQ_LINE); m_c140->add_route(0, "lspeaker", 0.50); m_c140->add_route(1, "rspeaker", 0.50); @@ -903,11 +913,11 @@ ROM_START( starblad ) ROM_LOAD32_BYTE( "st1-pt1-u.bin", 0x200002, 0x80000, CRC(ecf21047) SHA1(ddb13f5a2e7d192f0662fa420b49f89e1e991e66) ) ROM_LOAD32_BYTE( "st1-pt1-l.bin", 0x200003, 0x80000, CRC(01cb0407) SHA1(4b58860bbc353de8b4b8e83d12b919d9386846e8) ) - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("st1-voi0.bin", 0x000000, 0x80000,CRC(5b3d43a9) SHA1(cdc04f19dc91dca9fa88ba0c2fca72aa195a3694) ) - ROM_LOAD("st1-voi1.bin", 0x080000, 0x80000,CRC(413e6181) SHA1(e827ec11f5755606affd2635718512aeac9354da) ) - ROM_LOAD("st1-voi2.bin", 0x100000, 0x80000,CRC(067d0720) SHA1(a853b2d43027a46c5e707fc677afdaae00f450c7) ) - ROM_LOAD("st1-voi3.bin", 0x180000, 0x80000,CRC(8b5aa45f) SHA1(e1214e639200758ad2045bde0368a2d500c1b84a) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("st1-voi0.bin", 0x000000, 0x80000,CRC(5b3d43a9) SHA1(cdc04f19dc91dca9fa88ba0c2fca72aa195a3694) ) + ROM_LOAD16_BYTE("st1-voi1.bin", 0x100000, 0x80000,CRC(413e6181) SHA1(e827ec11f5755606affd2635718512aeac9354da) ) + ROM_LOAD16_BYTE("st1-voi2.bin", 0x200000, 0x80000,CRC(067d0720) SHA1(a853b2d43027a46c5e707fc677afdaae00f450c7) ) + ROM_LOAD16_BYTE("st1-voi3.bin", 0x300000, 0x80000,CRC(8b5aa45f) SHA1(e1214e639200758ad2045bde0368a2d500c1b84a) ) ROM_REGION( 0x2000, "nvram", ROMREGION_ERASE00) // starblad needs default NVRAM to be all 0 @@ -948,11 +958,11 @@ ROM_START( starbladj ) ROM_LOAD32_BYTE( "st1-pt1-u.bin", 0x200002, 0x80000, CRC(ecf21047) SHA1(ddb13f5a2e7d192f0662fa420b49f89e1e991e66) ) ROM_LOAD32_BYTE( "st1-pt1-l.bin", 0x200003, 0x80000, CRC(01cb0407) SHA1(4b58860bbc353de8b4b8e83d12b919d9386846e8) ) - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("st1-voi0.bin", 0x000000, 0x80000,CRC(5b3d43a9) SHA1(cdc04f19dc91dca9fa88ba0c2fca72aa195a3694) ) - ROM_LOAD("st1-voi1.bin", 0x080000, 0x80000,CRC(413e6181) SHA1(e827ec11f5755606affd2635718512aeac9354da) ) - ROM_LOAD("st1-voi2.bin", 0x100000, 0x80000,CRC(067d0720) SHA1(a853b2d43027a46c5e707fc677afdaae00f450c7) ) - ROM_LOAD("st1-voi3.bin", 0x180000, 0x80000,CRC(8b5aa45f) SHA1(e1214e639200758ad2045bde0368a2d500c1b84a) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("st1-voi0.bin", 0x000000, 0x80000,CRC(5b3d43a9) SHA1(cdc04f19dc91dca9fa88ba0c2fca72aa195a3694) ) + ROM_LOAD16_BYTE("st1-voi1.bin", 0x100000, 0x80000,CRC(413e6181) SHA1(e827ec11f5755606affd2635718512aeac9354da) ) + ROM_LOAD16_BYTE("st1-voi2.bin", 0x200000, 0x80000,CRC(067d0720) SHA1(a853b2d43027a46c5e707fc677afdaae00f450c7) ) + ROM_LOAD16_BYTE("st1-voi3.bin", 0x300000, 0x80000,CRC(8b5aa45f) SHA1(e1214e639200758ad2045bde0368a2d500c1b84a) ) ROM_REGION( 0x2000, "nvram", ROMREGION_ERASE00) // starblad needs default NVRAM to be all 0 @@ -994,11 +1004,11 @@ ROM_START( solvalou ) ROM_LOAD32_BYTE( "sv1-pt0-u.bin", 0x000002, 0x80000, CRC(4aacfc42) SHA1(f0e179e057183b41744ca429764f44306f0ce9bf) ) ROM_LOAD32_BYTE( "sv1-pt0-l.bin", 0x000003, 0x80000, CRC(6a4dddff) SHA1(9ed182d21d328c6a684ee6658a9dfcf3f3dd8646) ) /* least significant */ - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("sv1-voi0.bin", 0x000000, 0x80000,CRC(7f61bbcf) SHA1(b3b7e66e24d9cb16ebd139237c1e51f5d60c1585) ) - ROM_LOAD("sv1-voi1.bin", 0x080000, 0x80000,CRC(c732e66c) SHA1(14e75dd9bea4055f85eb2bcbf69cf6695a3f7ec4) ) - ROM_LOAD("sv1-voi2.bin", 0x100000, 0x80000,CRC(51076298) SHA1(ec52c9ae3029118f3ea3732948d6de28f5fba561) ) - ROM_LOAD("sv1-voi3.bin", 0x180000, 0x80000,CRC(33085ff3) SHA1(0a30b91618c250a5e7bd896a8ceeb3d16da178a9) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("sv1-voi0.bin", 0x000000, 0x80000,CRC(7f61bbcf) SHA1(b3b7e66e24d9cb16ebd139237c1e51f5d60c1585) ) + ROM_LOAD16_BYTE("sv1-voi1.bin", 0x100000, 0x80000,CRC(c732e66c) SHA1(14e75dd9bea4055f85eb2bcbf69cf6695a3f7ec4) ) + ROM_LOAD16_BYTE("sv1-voi2.bin", 0x200000, 0x80000,CRC(51076298) SHA1(ec52c9ae3029118f3ea3732948d6de28f5fba561) ) + ROM_LOAD16_BYTE("sv1-voi3.bin", 0x300000, 0x80000,CRC(33085ff3) SHA1(0a30b91618c250a5e7bd896a8ceeb3d16da178a9) ) ROM_END @@ -1040,11 +1050,11 @@ ROM_START( aircomb ) ROM_LOAD32_BYTE( "ac1-poi-lu.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) ) ROM_LOAD32_BYTE( "ac1-poi-ll.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) ) /* least significant */ - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("ac1-voi0.12b", 0x000000, 0x80000,CRC(f427b119) SHA1(bd45bbe41c8be26d6c997fcdc226d080b416a2cf) ) - ROM_LOAD("ac1-voi1.12c", 0x080000, 0x80000,CRC(c9490667) SHA1(4b6fbe635c32469870a8e6f82742be6a9d4918c9) ) - ROM_LOAD("ac1-voi2.12d", 0x100000, 0x80000,CRC(1fcb51ba) SHA1(80fc815e5fad76d20c3795ab1d89b57d9abc3efd) ) - ROM_LOAD("ac1-voi3.12e", 0x180000, 0x80000,CRC(cd202e06) SHA1(72a18f5ba402caefef14b8d1304f337eaaa3eb1d) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("ac1-voi0.12b", 0x000000, 0x80000,CRC(f427b119) SHA1(bd45bbe41c8be26d6c997fcdc226d080b416a2cf) ) + ROM_LOAD16_BYTE("ac1-voi1.12c", 0x100000, 0x80000,CRC(c9490667) SHA1(4b6fbe635c32469870a8e6f82742be6a9d4918c9) ) + ROM_LOAD16_BYTE("ac1-voi2.12d", 0x200000, 0x80000,CRC(1fcb51ba) SHA1(80fc815e5fad76d20c3795ab1d89b57d9abc3efd) ) + ROM_LOAD16_BYTE("ac1-voi3.12e", 0x300000, 0x80000,CRC(cd202e06) SHA1(72a18f5ba402caefef14b8d1304f337eaaa3eb1d) ) ROM_REGION( 0x0600, "plds", 0 ) ROM_LOAD( "gal16v8a-3pdsp5.17d", 0x0000, 0x0117, CRC(799c1f26) SHA1(d28ed1b9fa78180c5a0b01a7198a2870137c7349) ) @@ -1093,11 +1103,11 @@ ROM_START( aircombj ) ROM_LOAD32_BYTE( "ac1-poi-lu.2k", 0x000002, 0x80000, CRC(d99084b9) SHA1(c604d60a2162af7610e5ff7c1aa4195f7df82efe) ) ROM_LOAD32_BYTE( "ac1-poi-ll.2n", 0x000003, 0x80000, CRC(abb32307) SHA1(8e936ba99479215dd33a951d81ec2b04020dfd62) ) /* least significant */ - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("ac1-voi0.12b", 0x000000, 0x80000,CRC(f427b119) SHA1(bd45bbe41c8be26d6c997fcdc226d080b416a2cf) ) - ROM_LOAD("ac1-voi1.12c", 0x080000, 0x80000,CRC(c9490667) SHA1(4b6fbe635c32469870a8e6f82742be6a9d4918c9) ) - ROM_LOAD("ac1-voi2.12d", 0x100000, 0x80000,CRC(1fcb51ba) SHA1(80fc815e5fad76d20c3795ab1d89b57d9abc3efd) ) - ROM_LOAD("ac1-voi3.12e", 0x180000, 0x80000,CRC(cd202e06) SHA1(72a18f5ba402caefef14b8d1304f337eaaa3eb1d) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("ac1-voi0.12b", 0x000000, 0x80000,CRC(f427b119) SHA1(bd45bbe41c8be26d6c997fcdc226d080b416a2cf) ) + ROM_LOAD16_BYTE("ac1-voi1.12c", 0x100000, 0x80000,CRC(c9490667) SHA1(4b6fbe635c32469870a8e6f82742be6a9d4918c9) ) + ROM_LOAD16_BYTE("ac1-voi2.12d", 0x200000, 0x80000,CRC(1fcb51ba) SHA1(80fc815e5fad76d20c3795ab1d89b57d9abc3efd) ) + ROM_LOAD16_BYTE("ac1-voi3.12e", 0x300000, 0x80000,CRC(cd202e06) SHA1(72a18f5ba402caefef14b8d1304f337eaaa3eb1d) ) ROM_REGION( 0x0600, "plds", 0 ) ROM_LOAD( "gal16v8a-3pdsp5.17d", 0x0000, 0x0117, CRC(799c1f26) SHA1(d28ed1b9fa78180c5a0b01a7198a2870137c7349) ) @@ -1149,11 +1159,11 @@ ROM_START( cybsled ) ROM_LOAD32_BYTE( "cy1-poi-lu2.2l", 0x200002, 0x80000, CRC(61d816d4) SHA1(7991957b910d32530151abc7f469fcf1de62d8f3) ) ROM_LOAD32_BYTE( "cy1-poi-ll2.2p", 0x200003, 0x80000, CRC(faf09158) SHA1(b56ebed6012362b1d599c396a43e90a1e4d9dc38) ) - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("cy1-voi0.12b", 0x000000, 0x80000,CRC(99d7ce46) SHA1(b75f4055c3ce847daabfacda22df14e3f80c4fb9) ) - ROM_LOAD("cy1-voi1.12c", 0x080000, 0x80000,CRC(2b335f06) SHA1(2b2cd407c34388b56496f84a414daa153780b098) ) - ROM_LOAD("cy1-voi2.12d", 0x100000, 0x80000,CRC(10cd15f0) SHA1(9b721654ed97a13287373c1b2854ac9aeddc271f) ) - ROM_LOAD("cy1-voi3.12e", 0x180000, 0x80000,CRC(c902b4a4) SHA1(816357ec1a02a7ebf817ac1182e9c50ce5ca71f6) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("cy1-voi0.12b", 0x000000, 0x80000,CRC(99d7ce46) SHA1(b75f4055c3ce847daabfacda22df14e3f80c4fb9) ) + ROM_LOAD16_BYTE("cy1-voi1.12c", 0x100000, 0x80000,CRC(2b335f06) SHA1(2b2cd407c34388b56496f84a414daa153780b098) ) + ROM_LOAD16_BYTE("cy1-voi2.12d", 0x200000, 0x80000,CRC(10cd15f0) SHA1(9b721654ed97a13287373c1b2854ac9aeddc271f) ) + ROM_LOAD16_BYTE("cy1-voi3.12e", 0x300000, 0x80000,CRC(c902b4a4) SHA1(816357ec1a02a7ebf817ac1182e9c50ce5ca71f6) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "cybsled.nv", 0x0000, 0x2000, CRC(aa18bf9e) SHA1(3712d4d20e5f5f1c920e3f1f6a00101e874662d0) ) @@ -1200,11 +1210,11 @@ ROM_START( cybsleda ) ROM_LOAD32_BYTE( "cy1-poi-lu2.2l", 0x200002, 0x80000, CRC(61d816d4) SHA1(7991957b910d32530151abc7f469fcf1de62d8f3) ) ROM_LOAD32_BYTE( "cy1-poi-ll2.2p", 0x200003, 0x80000, CRC(faf09158) SHA1(b56ebed6012362b1d599c396a43e90a1e4d9dc38) ) - ROM_REGION( 0x200000, "c140", 0 ) /* sound samples */ - ROM_LOAD("cy1-voi0.12b", 0x000000, 0x80000,CRC(99d7ce46) SHA1(b75f4055c3ce847daabfacda22df14e3f80c4fb9) ) - ROM_LOAD("cy1-voi1.12c", 0x080000, 0x80000,CRC(2b335f06) SHA1(2b2cd407c34388b56496f84a414daa153780b098) ) - ROM_LOAD("cy1-voi2.12d", 0x100000, 0x80000,CRC(10cd15f0) SHA1(9b721654ed97a13287373c1b2854ac9aeddc271f) ) - ROM_LOAD("cy1-voi3.12e", 0x180000, 0x80000,CRC(c902b4a4) SHA1(816357ec1a02a7ebf817ac1182e9c50ce5ca71f6) ) + ROM_REGION16_BE( 0x400000, "c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_LOAD16_BYTE("cy1-voi0.12b", 0x000000, 0x80000,CRC(99d7ce46) SHA1(b75f4055c3ce847daabfacda22df14e3f80c4fb9) ) + ROM_LOAD16_BYTE("cy1-voi1.12c", 0x100000, 0x80000,CRC(2b335f06) SHA1(2b2cd407c34388b56496f84a414daa153780b098) ) + ROM_LOAD16_BYTE("cy1-voi2.12d", 0x200000, 0x80000,CRC(10cd15f0) SHA1(9b721654ed97a13287373c1b2854ac9aeddc271f) ) + ROM_LOAD16_BYTE("cy1-voi3.12e", 0x300000, 0x80000,CRC(c902b4a4) SHA1(816357ec1a02a7ebf817ac1182e9c50ce5ca71f6) ) ROM_REGION( 0x2000, "nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "cybsleda.nv", 0x0000, 0x2000, CRC(a73bb03e) SHA1(e074bfeae14178c867070e06f6690ed13115f5fa) ) diff --git a/src/mame/drivers/namcos21_de.cpp b/src/mame/drivers/namcos21_de.cpp index dd3a688578d..ec45c4a4579 100644 --- a/src/mame/drivers/namcos21_de.cpp +++ b/src/mame/drivers/namcos21_de.cpp @@ -84,6 +84,7 @@ private: required_device m_palette; required_device m_screen; required_memory_bank m_audiobank; + required_region_ptr m_c140_region; required_shared_ptr m_dpram; required_device m_namcos21_3d; required_device m_namcos21_dsp; @@ -120,6 +121,7 @@ private: void driveyes_slave_map(address_map &map); void sound_map(address_map &map); + void c140_map(address_map &map); }; @@ -140,6 +142,7 @@ namco_de_pcbstack_device::namco_de_pcbstack_device(const machine_config &mconfig m_palette(*this, "palette"), m_screen(*this, "screen"), m_audiobank(*this, "audiobank"), + m_c140_region(*this, "c140"), m_dpram(*this, "dpram"), m_namcos21_3d(*this, "namcos21_3d"), m_namcos21_dsp(*this, "namcos21dsp") @@ -202,7 +205,7 @@ void namco_de_pcbstack_device::device_add_mconfig(machine_config &config) SPEAKER(config, "rspeaker").front_right(); C140(config, m_c140, 8000000/374); - m_c140->set_bank_type(c140_device::C140_TYPE::SYSTEM21); + m_c140->set_addrmap(0, &namco_de_pcbstack_device::c140_map); m_c140->int1_callback().set_inputline(m_audiocpu, M6809_FIRQ_LINE); m_c140->add_route(0, "lspeaker", 0.50); m_c140->add_route(1, "rspeaker", 0.50); @@ -291,9 +294,9 @@ void namco_de_pcbstack_device::sound_map(address_map &map) map(0x0000, 0x3fff).bankr("audiobank"); /* banked */ map(0x3000, 0x3003).nopw(); /* ? */ map(0x4000, 0x4001).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); - map(0x5000, 0x6fff).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); - map(0x7000, 0x77ff).rw(FUNC(namco_de_pcbstack_device::dpram_byte_r), FUNC(namco_de_pcbstack_device::dpram_byte_w)).share("dpram"); - map(0x7800, 0x7fff).rw(FUNC(namco_de_pcbstack_device::dpram_byte_r), FUNC(namco_de_pcbstack_device::dpram_byte_w)); /* mirror */ + map(0x5000, 0x51ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); + map(0x6000, 0x61ff).mirror(0x0e00).rw(m_c140, FUNC(c140_device::c140_r), FUNC(c140_device::c140_w)); // mirrored + map(0x7000, 0x77ff).mirror(0x0800).rw(FUNC(namco_de_pcbstack_device::dpram_byte_r), FUNC(namco_de_pcbstack_device::dpram_byte_w)).share("dpram"); map(0x8000, 0x9fff).ram(); map(0xa000, 0xbfff).nopw(); /* amplifier enable on 1st write */ map(0xc000, 0xffff).nopw(); /* avoid debug log noise; games write frequently to 0xe000 */ @@ -302,6 +305,13 @@ void namco_de_pcbstack_device::sound_map(address_map &map) map(0xd000, 0xffff).rom().region("audiocpu", 0x01000); } +void namco_de_pcbstack_device::c140_map(address_map &map) +{ + map.global_mask(0x7fffff); + // TODO: LSB not used? verify from schematics/real hardware + map(0x000000, 0x7fffff).lr16([this](offs_t offset) { return m_c140_region[((offset & 0x300000) >> 1) | (offset & 0x7ffff)]; }, "c140_rom_r"); +} + /*************************************************************/ /* I/O HD63705 MCU Memory declarations */ /*************************************************************/ @@ -696,11 +706,11 @@ ROM_START( driveyes ) ROM_REGION( 0x20000, "pcb_1:audiocpu", 0 ) /* Sound */ ROM_LOAD( "de1-snd0.8j", 0x000000, 0x020000, CRC(5474f203) SHA1(e0ae2f6978deb0c934d9311a334a6e36bb402aee) ) /* correct for center view */ - ROM_REGION( 0x200000, "pcb_1:c140", 0 ) /* sound samples - populated for center view only */ - ROM_LOAD("de1-voi0.12b", 0x040000, 0x40000, CRC(fc44adbd) SHA1(4268bb1f025e47a94212351d1c1cfd0e5029221f) ) - ROM_LOAD("de1-voi1.12c", 0x0c0000, 0x40000, CRC(a71dc55a) SHA1(5e746184db9144ab4e3a97b20195b92b0f56c8cc) ) - ROM_LOAD("de1-voi2.12d", 0x140000, 0x40000, CRC(4d32879a) SHA1(eae65f4b98cee9efe4e5dad7298c3717cfb1e6bf) ) - ROM_LOAD("de1-voi3.12e", 0x1c0000, 0x40000, CRC(e4832d18) SHA1(0460c79d3942aab89a765b0bd8bbddaf19a6d682) ) + ROM_REGION16_BE( 0x400000, "pcb_1:c140", ROMREGION_ERASE00 ) /* sound samples - populated for center view only */ + ROM_LOAD16_BYTE("de1-voi0.12b", 0x080000, 0x40000, CRC(fc44adbd) SHA1(4268bb1f025e47a94212351d1c1cfd0e5029221f) ) + ROM_LOAD16_BYTE("de1-voi1.12c", 0x180000, 0x40000, CRC(a71dc55a) SHA1(5e746184db9144ab4e3a97b20195b92b0f56c8cc) ) + ROM_LOAD16_BYTE("de1-voi2.12d", 0x280000, 0x40000, CRC(4d32879a) SHA1(eae65f4b98cee9efe4e5dad7298c3717cfb1e6bf) ) + ROM_LOAD16_BYTE("de1-voi3.12e", 0x380000, 0x40000, CRC(e4832d18) SHA1(0460c79d3942aab89a765b0bd8bbddaf19a6d682) ) ROM_REGION( 0x8000, "pcb_1:c68mcu:external", ROMREGION_ERASE00 ) /* C68 (M37450) I/O MCU program */ /* external ROM not populated, unclear how it would map */ @@ -742,7 +752,7 @@ ROM_START( driveyes ) ROM_REGION( 0x20000, "pcb_0:audiocpu", 0 ) /* Sound */ ROM_LOAD( "de1-snd0r.8j", 0x000000, 0x020000, CRC(7bbeda42) SHA1(fe840cc9069758928492bbeec79acded18daafd9) ) // correct for left & right views - ROM_REGION( 0x200000, "pcb_0:c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_REGION16_BE( 0x400000, "pcb_0:c140", ROMREGION_ERASE00 ) /* sound samples */ /* unpopulated for left / right views */ ROM_REGION( 0x8000, "pcb_0:c68mcu:external", ROMREGION_ERASE00 ) /* C68 (M37450) I/O MCU program */ @@ -785,7 +795,7 @@ ROM_START( driveyes ) ROM_REGION( 0x20000, "pcb_2:audiocpu", 0 ) /* Sound */ ROM_LOAD( "de1-snd0r.8j", 0x000000, 0x020000, CRC(7bbeda42) SHA1(fe840cc9069758928492bbeec79acded18daafd9) ) // correct for left & right views - ROM_REGION( 0x200000, "pcb_2:c140", ROMREGION_ERASE00 ) /* sound samples */ + ROM_REGION16_BE( 0x400000, "pcb_2:c140", ROMREGION_ERASE00 ) /* sound samples */ /* unpopulated for left / right views */ ROM_REGION( 0x8000, "pcb_2:c68mcu:external", ROMREGION_ERASE00 ) /* C68 (M37450) I/O MCU program */ diff --git a/src/mame/drivers/nemesis.cpp b/src/mame/drivers/nemesis.cpp index 383fccf3d90..9fa97266383 100644 --- a/src/mame/drivers/nemesis.cpp +++ b/src/mame/drivers/nemesis.cpp @@ -481,6 +481,7 @@ void nemesis_state::bubsys_map(address_map &map) map(0x054000, 0x054fff).ram().w(FUNC(nemesis_state::nemesis_colorram1_word_w)).share("colorram1"); map(0x055000, 0x055fff).ram().w(FUNC(nemesis_state::nemesis_colorram2_word_w)).share("colorram2"); map(0x056000, 0x056fff).ram().share("spriteram"); + map(0x057000, 0x057fff).ram(); map(0x05a000, 0x05afff).ram().w(FUNC(nemesis_state::nemesis_palette_word_w)).share("paletteram"); map(0x05c001, 0x05c001).w("soundlatch", FUNC(generic_latch_8_device::write)); map(0x05c402, 0x05c403).portr("DSW0"); @@ -3034,6 +3035,27 @@ ROM_START( gradiusb ) ROM_LOAD( "400a2.1b", 0x100, 0x100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) ROM_END +ROM_START( twinbeeb ) + ROM_REGION( 0x80000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD( "boot.bin", 0x000, 0x1e0, CRC(ee6e93d7) SHA1(7302c08a726a760f59d6837be8fd10bbd1f79da0) ) + + ROM_REGION( 0x806*0x90, "bubblememory", ROMREGION_ERASE00 ) +// ROM_LOAD16_WORD_SWAP( "bubble_twinbeeb", 0x000, 0x48360, CRC(21599cf5) SHA1(7eb068e10134d5c66f7f90f6d6b265353b7bd8be) ) // re-encoded data + + ROM_REGION( 0x806*0x80, "bubblememory_temp", 0 ) + ROM_LOAD( "twinbee.bin", 0x00000, 0x40300, CRC(4d396a0a) SHA1(ee922a1bd7062c0fcf358f5079cca6424aadc975) ) + + ROM_REGION( 0x1000, "mcu", ROMREGION_ERASE00 ) // Fujitsu MCU + ROM_LOAD( "mcu", 0x0000, 0x1000, NO_DUMP ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) + ROM_LOAD( "400-e03.5l", 0x00000, 0x02000, CRC(a5a8e57d) SHA1(f4236770093392dec3f76835a5766e9b3ed64e2e) ) + + ROM_REGION( 0x0200, "k005289", 0 ) + ROM_LOAD( "400-a01.fse", 0x00000, 0x0100, CRC(5827b1e8) SHA1(fa8cf5f868cfb08bce203baaebb6c4055ee2a000) ) + ROM_LOAD( "400-a02.fse", 0x00100, 0x0100, CRC(2f44f970) SHA1(7ab46f9d5d587665782cefc623b8de0124a6d38a) ) +ROM_END + void nemesis_state::bubsys_init() { /* @@ -3060,9 +3082,48 @@ void nemesis_state::bubsys_init() m_bubsys_control_ram[3]=0x240; } + +void nemesis_state::bubsys_twinbeeb_init() +{ + // the twinbee bubble data is in a stripped down, predecoded state already, why? + // this reencodes it to something the loading code can actually use + + uint8_t *src = memregion("bubblememory_temp")->base(); + uint8_t *dst = memregion("bubblememory")->base(); + + for (int i = 0; i < 0x806; i++) + { + uint16_t crc = 0; + + int sourcebase = i * 0x80; + int destbase = i * 0x90; + + for (int j = 0; j < 0x80; j++) + { + uint8_t dat = src[sourcebase + j]; + dst[destbase + j + 0] |= (dat >> 6) & 0x03; + dst[destbase + j + 1] |= (dat << 2) & 0xfc; + + crc += dat; + } + + for (int j = 0; j < 0x82; j += 2) + { + uint8_t temp1 = dst[destbase + j + 0]; + dst[destbase + j + 0] = dst[destbase + j + 1]; + dst[destbase + j + 1] = temp1; + } + + dst[destbase+0x83] = i >> 8; + dst[destbase+0x82] = i & 0xff; + } + + bubsys_init(); +} + GAME( 1985, bubsys, 0, bubsys, bubsys, nemesis_state, bubsys_init, ROT0, "Konami", "Bubble System BIOS", MACHINE_IS_BIOS_ROOT ) GAME( 1985, gradiusb, bubsys, bubsys, bubsys, nemesis_state, bubsys_init, ROT0, "Konami", "Gradius (Bubble System)", MACHINE_UNEMULATED_PROTECTION ) -// Bubble System Twinbee +GAME( 1985, twinbeeb, bubsys, bubsys, bubsys, nemesis_state, bubsys_twinbeeb_init, ROT90, "Konami", "TwinBee (Bubble System)", MACHINE_UNEMULATED_PROTECTION ) // Bubble System RF2 // Bubble System Galactic Warriors // Bubble System Attack Rush diff --git a/src/mame/drivers/nes_sh6578.cpp b/src/mame/drivers/nes_sh6578.cpp index 60cf7780fac..d0db1f56e8b 100644 --- a/src/mame/drivers/nes_sh6578.cpp +++ b/src/mame/drivers/nes_sh6578.cpp @@ -577,7 +577,7 @@ void nes_sh6578_state::nes_sh6578(machine_config& config) m_screen->set_visarea(0*8, 32*8-1, 0*8, 30*8-1); m_screen->set_screen_update(FUNC(nes_sh6578_state::screen_update)); - TIMER(config, m_timer).configure_periodic(FUNC(nes_sh6578_state::timer_expired), attotime::never); + TIMER(config, m_timer).configure_generic(FUNC(nes_sh6578_state::timer_expired)); /* sound hardware */ SPEAKER(config, "mono").front_center(); diff --git a/src/mame/drivers/news_68k.cpp b/src/mame/drivers/news_68k.cpp index db2afea7141..8c6900ada66 100644 --- a/src/mame/drivers/news_68k.cpp +++ b/src/mame/drivers/news_68k.cpp @@ -30,6 +30,7 @@ // video #include "screen.h" +#include "video/bt45x.h" // busses and connectors #include "machine/nscsi_bus.h" @@ -46,6 +47,8 @@ #define VERBOSE 0 #include "logmacro.h" +#define GRAPHICS 0 + class news_68k_state : public driver_device { public: @@ -61,10 +64,16 @@ public: , m_scsi(*this, "scsi:7:cxd1180") , m_hid(*this, "hid") , m_serial(*this, "serial%u", 0U) - , m_scsibus(*this, "scsi") - , m_scc_irq(*this, "scc_irq") - , m_fdc_irq(*this, "fdc_irq") + , m_irq5(*this, "irq5") + , m_irq7(*this, "irq7") + , m_sw1(*this, "SW1") , m_eprom(*this, "eprom") + , m_led(*this, "led%u", 0U) +#if GRAPHICS + , m_screen(*this, "screen") + , m_ramdac(*this, "ramdac") + , m_vram(*this, "vram") +#endif { } @@ -102,6 +111,10 @@ protected: u32 bus_error_r(); +#if GRAPHICS + u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rectangle const &cliprect) { return 0; } +#endif + private: DECLARE_FLOPPY_FORMATS(floppy_formats); @@ -113,43 +126,54 @@ private: required_device m_scc; required_device m_net; required_device m_fdc; - required_device m_scsi; + required_device m_scsi; required_device m_hid; required_device_array m_serial; - required_device m_scsibus; - required_device m_scc_irq; - required_device m_fdc_irq; + required_device m_irq5; + required_device m_irq7; + required_ioport m_sw1; required_region_ptr m_eprom; std::unique_ptr m_net_ram; + output_finder<2> m_led; + +#if GRAPHICS + required_device m_screen; + required_device m_ramdac; + required_device m_vram; +#endif emu_timer *m_timer; u8 m_intst; + u8 m_parity_vector; bool m_int_state[2]; bool m_scc_irq_state; + bool m_parity_irq_state; }; void news_68k_state::machine_start() { + m_led.resolve(); + m_net_ram = std::make_unique(8192); m_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(news_68k_state::timer), this)); + m_intst = 0; for (bool &int_state : m_int_state) int_state = false; m_scc_irq_state = false; + m_parity_irq_state = false; } void news_68k_state::machine_reset() { // eprom is mapped at 0 after reset m_cpu->space(0).install_rom(0x00000000, 0x0000ffff, m_eprom); - - m_timer->adjust(attotime::from_hz(100), 0, attotime::from_hz(100)); } void news_68k_state::init_common() @@ -162,37 +186,52 @@ void news_68k_state::cpu_map(address_map &map) { map(0xe0000000, 0xe000ffff).rom().region("eprom", 0); + // 0xe0c40000 // centronics map(0xe0c80000, 0xe0c80003).m(m_fdc, FUNC(upd72067_device::map)); - //map(0xe0c80100, 0xe0c80100); // fdc psuedo - dma ? - //map(0xe0cc0000, 0xe0cc0007).m(m_scsi, FUNC(ncr5380n_device::map)); - map(0xe0cc0000, 0xe0cc0007).rw(m_scsi, FUNC(ncr5380n_device::read), FUNC(ncr5380n_device::write)); + map(0xe0c80100, 0xe0c80100).rw(m_fdc, FUNC(upd72067_device::dma_r), FUNC(upd72067_device::dma_w)); + map(0xe0cc0000, 0xe0cc0007).m(m_scsi, FUNC(ncr5380n_device::map)); map(0xe0d00000, 0xe0d00007).m(m_hid, FUNC(news_hid_hle_device::map_68k)); map(0xe0d40000, 0xe0d40003).rw(m_scc, FUNC(z80scc_device::ab_dc_r), FUNC(z80scc_device::ab_dc_w)); map(0xe0d80000, 0xe0d807ff).rw(m_rtc, FUNC(m48t02_device::read), FUNC(m48t02_device::write)); - map(0xe0dc0000, 0xe0dc0000).lw8([this](u8 data) { logerror("debug_w 0x%02x\n", data); }, "debug_w"); + map(0xe0dc0000, 0xe0dc0000).lw8([this](u8 data) { m_led[0] = BIT(data, 0); m_led[1] = BIT(data, 1); }, "led_w"); map(0xe0e00000, 0xe0e03fff).lrw16( [this](offs_t offset) { return m_net_ram[offset]; }, "net_ram_r", [this](offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_net_ram[offset]); }, "net_ram_w"); map(0xe0e80000, 0xe0e80017).m(m_dma, FUNC(dmac_0266_device::map)); - + // e0ec0000 // sound board map(0xe0f00000, 0xe0f00003).rw(m_net, FUNC(am7990_device::regs_r), FUNC(am7990_device::regs_w)); + // e0f40000 + //map(0xe0f40000, 0xe0f40000).lr8([]() { return 0xfb; }, "scc_ridsr_r"); map(0xe1000000, 0xe1000000).w(FUNC(news_68k_state::timer_w)); - map(0xe1080000, 0xe1080000).lw8([this](u8 data) { logerror("parity enable 0x%02x\n", data); }, "parity_enable_w"); - map(0xe1180000, 0xe1180000).lw8([this](u8 data) { logerror("intl2 enable 0x%02x\n", data); }, "intl2_enable_w"); - map(0xe1200000, 0xe1200000).lw8([this](u8 data) { m_cpu->space(0).install_ram(0x00000000, m_ram->mask(), 0xc0000000, m_ram->pointer()); }, "ram_enable"); - map(0xe1280000, 0xe1280000).lw8([this](u8 data) { logerror("ast enable 0x%02x\n", data); }, "ast_enable_w"); - map(0xe1300000, 0xe1300000).lw8([this](u8 data) { logerror("cache enable 0x%02x (%s)\n", data, machine().describe_context()); }, "cache_enable_w"); - map(0xe1900000, 0xe1900000).lw8([this](u8 data) { logerror("cache clear 0x%02x\n", data); }, "cache_clear_w"); - map(0xe1a00000, 0xe1a00000).lw8([this](u8 data) { logerror("parity clear 0x%02x\n", data); }, "parity_clear_w"); - + map(0xe1080000, 0xe1080000).lw8([this](u8 data) { LOG("parity check enable 0x%02x\n", data); }, "parity_check_enable_w"); + map(0xe1180000, 0xe1180000).lw8([this](u8 data) { m_cpu->set_input_line(INPUT_LINE_IRQ2, bool(data)); }, "irq2_w"); + map(0xe1200000, 0xe1200000).lw8([this](u8 data) { m_cpu->space(0).install_ram(0, m_ram->mask(), 0xc0000000, m_ram->pointer()); }, "ram_enable"); + map(0xe1280000, 0xe1280000).lw8([this](u8 data) { m_cpu->set_input_line(INPUT_LINE_IRQ1, bool(data)); }, "ast_w"); + map(0xe1300000, 0xe1300000).lw8([this](u8 data) { LOG("cache enable 0x%02x (%s)\n", data, machine().describe_context()); }, "cache_enable_w"); + // 0xe1380000 // power on/off + map(0xe1900000, 0xe1900000).lw8([this](u8 data) { LOG("cache clear 0x%02x\n", data); }, "cache_clear_w"); + map(0xe1a00000, 0xe1a00000).lw8([this](u8 data) { LOG("parity interrupt clear 0x%02x\n", data); }, "parity_interrupt_clear_w"); + // 0xe1b00000 // fdc vfo external/internal map(0xe1c00000, 0xe1c000ff).rom().region("idrom", 0); - map(0xe1c00100, 0xe1c00103).portr("SW1"); - map(0xe1c00200, 0xe1c00203).lr8([this]() { return m_intst; }, "intst_r"); + map(0xe1c00100, 0xe1c00103).lr8([this]() { return u8(m_sw1->read()); }, "sw1_r"); + // HACK: disable fdc irq for NetBSD + map(0xe1c00200, 0xe1c00200).lrw8([this]() { return m_intst; }, "intst_r", [this](u8 data) { irq_w(0); m_parity_vector = data; }, "parity_vector_w"); + // external I/O map(0xf0000000, 0xffffffff).r(FUNC(news_68k_state::bus_error_r)); +#if GRAPHICS + // POPC + //map(0xf0fc0000, 0xf0fc0003).unmaprw(); + // f0fc0000 & 0x40 == 0x00 -> popm + // f0fc0000 & 0xc0 == 0xc0 -> popc + map(0xf0fc0000, 0xf0fc0001).lr16([]() {return 0x00c0; }, "popc_probe"); // lower 2 bits give busy state + map(0xf0fc4000, 0xf0fc4007).m(m_ramdac, FUNC(bt458_device::map)).umask32(0x00ff00ff); + + //map(0xf0fc0000, 0xf10bffff).rom().region("krom", 0); +#endif // 0xf0c30000 expansion lance #1 // 0xf0c20000 lance #1 memory @@ -201,6 +240,8 @@ void news_68k_state::cpu_map(address_map &map) // 0xf0c60000 lance #2 memory // 0xf0c78000 lance #2 etherid + // 0xf0d04000 isdn? + // 0xf0f00000 nwb512_base // 0xf0fc0000 nwb512krom_base // 0xf0700000 nwb225_base @@ -209,15 +250,13 @@ void news_68k_state::cpu_map(address_map &map) void news_68k_state::cpu_autovector_map(address_map &map) { - map.global_mask(0xffffffff); - map(0xfffffff3, 0xfffffff3).lr8(NAME([]() { return m68000_base_device::autovector(1); })); map(0xfffffff5, 0xfffffff5).lr8(NAME([]() { return m68000_base_device::autovector(2); })); map(0xfffffff7, 0xfffffff7).lr8(NAME([]() { return m68000_base_device::autovector(3); })); map(0xfffffff9, 0xfffffff9).lr8(NAME([]() { return m68000_base_device::autovector(4); })); map(0xfffffffb, 0xfffffffb).lr8(NAME([this]() { return m_scc_irq_state ? m_scc->m1_r() : m68000_base_device::autovector(5); })); map(0xfffffffd, 0xfffffffd).lr8(NAME([]() { return m68000_base_device::autovector(6); })); - map(0xffffffff, 0xffffffff).lr8(NAME([]() { return m68000_base_device::autovector(7); })); + map(0xffffffff, 0xffffffff).lr8(NAME([this]() { return m_parity_irq_state ? m_parity_vector : m68000_base_device::autovector(7); })); } template void news_68k_state::irq_w(int state) @@ -254,16 +293,15 @@ void news_68k_state::timer_w(u8 data) { LOG("timer_w 0x%02x\n", data); - m_timer->set_param(data); - - if (!data) + if (data) + m_timer->adjust(attotime::from_hz(100)); + else m_cpu->set_input_line(INPUT_LINE_IRQ6, CLEAR_LINE); } void news_68k_state::timer(void *ptr, s32 param) { - if (param) - m_cpu->set_input_line(INPUT_LINE_IRQ6, ASSERT_LINE); + m_cpu->set_input_line(INPUT_LINE_IRQ6, ASSERT_LINE); } u32 news_68k_state::bus_error_r() @@ -289,29 +327,30 @@ void news_68k_state::common(machine_config &config) // 16 SIMM slots for RAM arranged as two groups of 8 slots, with each bank // corresponding to a pair of slots in each group; first bank soldered in RAM(config, m_ram); - m_ram->set_default_size("4M"); + m_ram->set_default_size("8M"); // TODO: assume only 1M modules are supported - m_ram->set_extra_options("8M,12M,16M"); + m_ram->set_extra_options("4M,12M,16M"); m_ram->set_default_value(0); M48T02(config, m_rtc); DMAC_0266(config, m_dma, 0); m_dma->set_bus(m_cpu, 0); + m_dma->out_int_cb().set(*this, FUNC(news_68k_state::irq_w)); - INPUT_MERGER_ANY_HIGH(config, m_scc_irq); - m_scc_irq->output_handler().set_inputline(m_cpu, INPUT_LINE_IRQ5); + INPUT_MERGER_ANY_HIGH(config, m_irq5); + m_irq5->output_handler().set_inputline(m_cpu, INPUT_LINE_IRQ5); SCC85C30(config, m_scc, 3993600); m_scc->out_int_callback().set( [this](int state) { m_scc_irq_state = bool(state); - m_scc_irq->in_w<2>(state); + m_irq5->in_w<2>(state); }); // scc channel A - RS232_PORT(config, m_serial[0], default_rs232_devices, nullptr); + RS232_PORT(config, m_serial[0], default_rs232_devices, GRAPHICS ? nullptr : "terminal"); m_serial[0]->cts_handler().set(m_scc, FUNC(z80scc_device::ctsa_w)); m_serial[0]->dcd_handler().set(m_scc, FUNC(z80scc_device::dcda_w)); m_serial[0]->rxd_handler().set(m_scc, FUNC(z80scc_device::rxa_w)); @@ -328,19 +367,19 @@ void news_68k_state::common(machine_config &config) AM7990(config, m_net); m_net->intr_out().set(FUNC(news_68k_state::irq_w)).invert(); - m_net->dma_in().set([this](offs_t offset) { return m_net_ram[offset >> 1]; }); - m_net->dma_out().set([this](offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_net_ram[offset >> 1]); }); + m_net->dma_in().set([this](offs_t offset) { return m_net_ram[(offset >> 1) & 0x1fff]; }); + m_net->dma_out().set([this](offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_net_ram[(offset >> 1) & 0x1fff]); }); - INPUT_MERGER_ANY_HIGH(config, m_fdc_irq); - m_fdc_irq->output_handler().set(FUNC(news_68k_state::irq_w)); + INPUT_MERGER_ANY_HIGH(config, m_irq7); + m_irq7->output_handler().set_inputline(m_cpu, INPUT_LINE_IRQ7); UPD72067(config, m_fdc, 16_MHz_XTAL); - m_fdc->intrq_wr_callback().set(m_fdc_irq, FUNC(input_merger_any_high_device::in_w<0>)); - m_fdc->drq_wr_callback().set(m_fdc_irq, FUNC(input_merger_any_high_device::in_w<1>)); + m_fdc->intrq_wr_callback().set(FUNC(news_68k_state::irq_w)); + m_fdc->drq_wr_callback().set(m_irq7, FUNC(input_merger_device::in_w<0>)); FLOPPY_CONNECTOR(config, "fdc:0", "35hd", FLOPPY_35_HD, true, floppy_formats).enable_sound(false); // scsi bus and devices - NSCSI_BUS(config, m_scsibus); + NSCSI_BUS(config, "scsi"); /* * CDC WREN V HH 94221-5 (5.25" half-height SCSI-1 single-ended) @@ -358,22 +397,36 @@ void news_68k_state::common(machine_config &config) NSCSI_CONNECTOR(config, "scsi:6", news_scsi_devices, nullptr); // scsi host adapter - NSCSI_CONNECTOR(config, "scsi:7").option_set("cxd1180", NCR5380N).machine_config( + NSCSI_CONNECTOR(config, "scsi:7").option_set("cxd1180", CXD1180).machine_config( [this](device_t *device) { - ncr5380n_device &adapter = downcast(*device); + cxd1180_device &adapter = downcast(*device); - adapter.irq_handler().set(*this, FUNC(news_68k_state::irq_w)); + adapter.irq_handler().set(m_dma, FUNC(dmac_0266_device::irq_w)); adapter.drq_handler().set(m_dma, FUNC(dmac_0266_device::drq_w)); - //subdevice(":dma")->out_eop_cb().set(adapter, FUNC(ncr5380n_device::eop_w)); - subdevice(":dma")->dma_r_cb().set(adapter, FUNC(ncr5380n_device::dma_r)); - subdevice(":dma")->dma_w_cb().set(adapter, FUNC(ncr5380n_device::dma_w)); + subdevice(":dma")->dma_r_cb().set(adapter, FUNC(cxd1180_device::dma_r)); + subdevice(":dma")->dma_w_cb().set(adapter, FUNC(cxd1180_device::dma_w)); }); NEWS_HID_HLE(config, m_hid); - //m_hid->irq_out().set(m_scc_irq, FUNC(input_merger_device::in_w<0>)); - //m_hid->irq_out().set(m_scc_irq, FUNC(input_merger_device::in_w<1>)); + +#if GRAPHICS + m_hid->irq_out().set(m_irq5, FUNC(input_merger_device::in_w<0>)); + m_hid->irq_out().set(m_irq5, FUNC(input_merger_device::in_w<1>)); + + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_raw(64.0_MHz_XTAL, 1024, 0, 1024, 768, 0, 768); + m_screen->set_screen_update(FUNC(news_68k_state::screen_update)); + + // AM81C458-80JC + BT458(config, m_ramdac, 64.0_MHz_XTAL); + + // 32 x MB81461-12 (256Kbit ZIP VRAM) + RAM(config, m_vram); + m_vram->set_default_size("1MiB"); + m_vram->set_default_value(0); +#endif } void news_68k_state::nws1580(machine_config &config) @@ -387,36 +440,40 @@ FLOPPY_FORMATS_END static INPUT_PORTS_START(nws15x0) PORT_START("SW1") - PORT_DIPNAME(0x07000000, 0x07000000, "Display") PORT_DIPLOCATION("SW1:1,2,3") - PORT_DIPSETTING(0x07000000, "Console") - PORT_DIPSETTING(0x06000000, "NWB-512") - PORT_DIPSETTING(0x03000000, "NWB-225A") - PORT_DIPSETTING(0x00000000, "Autoselect") + PORT_DIPNAME(0x07, 0x07, "Display") PORT_DIPLOCATION("SW1:1,2,3") + PORT_DIPSETTING(0x07, "Console") + PORT_DIPSETTING(0x06, "NWB-512") + PORT_DIPSETTING(0x03, "NWB-225A") + PORT_DIPSETTING(0x00, "Autoselect") - PORT_DIPNAME(0x08000000, 0x08000000, "Boot Device") PORT_DIPLOCATION("SW1:4") - PORT_DIPSETTING(0x08000000, "SCSI") - PORT_DIPSETTING(0x00000000, "Floppy") + PORT_DIPNAME(0x08, 0x08, "Boot Device") PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING(0x08, "SCSI") + PORT_DIPSETTING(0x00, "Floppy") - PORT_DIPNAME(0x10000000, 0x10000000, "Automatic Boot") PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING(0x10000000, DEF_STR(Off)) - PORT_DIPSETTING(0x00000000, DEF_STR(On)) + PORT_DIPNAME(0x10, 0x10, "Automatic Boot") PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING(0x10, DEF_STR(Off)) + PORT_DIPSETTING(0x00, DEF_STR(On)) - PORT_DIPNAME(0x20000000, 0x20000000, "Diagnostic Mode") PORT_DIPLOCATION("SW1:6") - PORT_DIPSETTING(0x20000000, DEF_STR(Off)) - PORT_DIPSETTING(0x00000000, DEF_STR(On)) + PORT_DIPNAME(0x20, 0x20, "Diagnostic Mode") PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING(0x20, DEF_STR(Off)) + PORT_DIPSETTING(0x00, DEF_STR(On)) - PORT_DIPNAME(0xc0000000, 0xc0000000, "Unused") PORT_DIPLOCATION("SW1:7,8") - PORT_DIPSETTING(0xc0000000, DEF_STR(Off)) + PORT_DIPUNUSED_DIPLOC(0xc0, 0xc0, "SW1:7,8") INPUT_PORTS_END ROM_START(nws1580) ROM_REGION32_BE(0x10000, "eprom", 0) ROM_SYSTEM_BIOS(0, "nws1580", "NWS-1580 v1.3") - ROMX_LOAD("pws_1500__ver_1.3__8906.bin", 0x00000, 0x10000, CRC(76395ad9) SHA1(c2ae00218c23cef6519a4d7c74ac2c552790dfd4), ROM_BIOS(0)) + ROMX_LOAD("pws-1500__ver_1.3__8906.bin", 0x00000, 0x10000, CRC(76395ad9) SHA1(c2ae00218c23cef6519a4d7c74ac2c552790dfd4), ROM_BIOS(0)) // MB7114 256x4 TTL PROM ROM_REGION32_BE(0x100, "idrom", 0) ROM_LOAD("n1580_50093.ic63", 0x000, 0x100, CRC(a7f293d6) SHA1(21deffed69e07af515ffc5511bdbf73a2a4c14fb)) + + // 2 x HN62321BP (128K x 8-bit mask ROM) + ROM_REGION32_BE(0x100000, "krom", ROMREGION_ERASEFF) + ROM_LOAD64_BYTE("aa1.ic14", 0x00000, 0x20000, CRC(db274954) SHA1(4bc9b8a862ce9bdbf43c70f84921253876e21e58)) + ROM_LOAD64_BYTE("aa2.ic15", 0x00001, 0x20000, CRC(0d7686c7) SHA1(b0be18166b4690518e6a11ea194cc1c7a1ea6347)) ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ diff --git a/src/mame/drivers/novag_diablo.cpp b/src/mame/drivers/novag_diablo.cpp index 722740eab01..50e52cb42b9 100644 --- a/src/mame/drivers/novag_diablo.cpp +++ b/src/mame/drivers/novag_diablo.cpp @@ -129,7 +129,7 @@ void diablo_state::machine_start() void diablo_state::lcd_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(138, 146, 148)); // background - palette.set_pen_color(1, rgb_t(92, 83, 88)); // lcd pixel on + palette.set_pen_color(1, rgb_t(51, 42, 43)); // lcd pixel on palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off } diff --git a/src/mame/drivers/novag_sexpert.cpp b/src/mame/drivers/novag_sexpert.cpp index 1c87ed901b2..9d527cd4a56 100644 --- a/src/mame/drivers/novag_sexpert.cpp +++ b/src/mame/drivers/novag_sexpert.cpp @@ -197,7 +197,7 @@ void sforte_state::machine_start() void sexpert_state::lcd_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(138, 146, 148)); // background - palette.set_pen_color(1, rgb_t(92, 83, 88)); // lcd pixel on + palette.set_pen_color(1, rgb_t(51, 42, 43)); // lcd pixel on palette.set_pen_color(2, rgb_t(131, 136, 139)); // lcd pixel off } diff --git a/src/mame/drivers/okean240.cpp b/src/mame/drivers/okean240.cpp index 207089c5ae5..3faf605f317 100644 --- a/src/mame/drivers/okean240.cpp +++ b/src/mame/drivers/okean240.cpp @@ -118,7 +118,7 @@ private: required_shared_ptr m_p_videoram; optional_ioport m_io_modifiers; ioport_port *m_io_port[11]; - required_device m_maincpu; + required_device m_maincpu; required_device m_ppikbd; }; @@ -513,6 +513,7 @@ void okean240_state::okean240t(machine_config &config) I8080(config, m_maincpu, XTAL(12'000'000) / 6); m_maincpu->set_addrmap(AS_PROGRAM, &okean240_state::okean240_mem); m_maincpu->set_addrmap(AS_IO, &okean240_state::okean240t_io); + m_maincpu->in_inta_func().set("pic", FUNC(pic8259_device::acknowledge)); i8251_device &uart(I8251(config, "uart", 0)); uart.txd_handler().set("rs232", FUNC(rs232_port_device::write_txd)); diff --git a/src/mame/drivers/olyboss.cpp b/src/mame/drivers/olyboss.cpp index f1a667f5f88..a6d5ec61508 100644 --- a/src/mame/drivers/olyboss.cpp +++ b/src/mame/drivers/olyboss.cpp @@ -111,7 +111,6 @@ private: void olyboss_io(address_map &map); void olyboss_mem(address_map &map); void olyboss85_io(address_map &map); - IRQ_CALLBACK_MEMBER(irq_cb); required_device m_maincpu; required_device m_dma; @@ -252,13 +251,6 @@ WRITE_LINE_MEMBER( olyboss_state::romdis_w ) m_romen = state ? false : true; } -IRQ_CALLBACK_MEMBER( olyboss_state::irq_cb ) -{ - if(!irqline) - return m_pic->acknowledge(); - return 0; -} - //************************************************************************** // VIDEO //************************************************************************** @@ -501,7 +493,7 @@ void olyboss_state::bossb85(machine_config &config) i8085a_cpu_device &maincpu(I8085A(config, m_maincpu, 4_MHz_XTAL)); maincpu.set_addrmap(AS_PROGRAM, &olyboss_state::olyboss_mem); maincpu.set_addrmap(AS_IO, &olyboss_state::olyboss85_io); - maincpu.set_irq_acknowledge_callback(FUNC(olyboss_state::irq_cb)); + maincpu.in_inta_func().set(m_pic, FUNC(pic8259_device::acknowledge)); maincpu.out_sod_func().set(FUNC(olyboss_state::romdis_w)); /* video hardware */ diff --git a/src/mame/drivers/pacman.cpp b/src/mame/drivers/pacman.cpp index b3e23171df8..c699c6221c2 100644 --- a/src/mame/drivers/pacman.cpp +++ b/src/mame/drivers/pacman.cpp @@ -3563,17 +3563,21 @@ void pacman_state::pacman(machine_config &config, bool latch) m_namco_sound->add_route(ALL_OUTPUTS, "mono", 1.0); } -void pacman_state::maketrax(machine_config &config) +void pacman_state::crush2(machine_config &config) { pacman(config); - MCFG_MACHINE_RESET_OVERRIDE(pacman_state,maketrax) + + m_mainlatch->q_out_cb<7>().set_nop(); // coin counter not hooked up here } void pacman_state::korosuke(machine_config &config) { - maketrax(config); + pacman(config); + // 8K on original boards m_mainlatch->q_out_cb<7>().set_nop(); // outputs 4-7 go to protection chip at 6P + + MCFG_MACHINE_RESET_OVERRIDE(pacman_state,maketrax) } void pacman_state::pengojpm(machine_config &config) @@ -3875,11 +3879,13 @@ void pacman_state::crush4(machine_config &config) /* basic machine hardware */ m_gfxdecode->set_info(gfx_crush4); + + m_mainlatch->q_out_cb<7>().set_nop(); // coin counter is not hooked up here } void pacman_state::crushs(machine_config &config) { - pacman(config); + crush2(config); /* basic machine hardware */ m_maincpu->set_addrmap(AS_PROGRAM, &pacman_state::crushs_map); @@ -7661,21 +7667,21 @@ GAME( 1985, jumpshotp,jumpshot, pacman, jumpshotp,pacman_state, init_jumpshot GAME( 1985, shootbul, 0, pacman, shootbul, pacman_state, init_jumpshot, ROT90, "Bally Midway", "Shoot the Bull", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, crush, 0, maketrax, maketrax, pacman_state, init_maketrax, ROT90, "Alpha Denshi Co. / Kural Samno Electric, Ltd.", "Crush Roller (set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, crush2, crush, pacman, maketrax, pacman_state, empty_init, ROT90, "Alpha Denshi Co. / Kural Esco Electric, Ltd.", "Crush Roller (set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, crush3, crush, maketrax, maketrax, pacman_state, init_maketrax, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Crush Roller (set 3)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, crush4, crush, pacman, maketrax, pacman_state, init_eyes, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Crush Roller (set 4)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crush, 0, korosuke, maketrax, pacman_state, init_maketrax, ROT90, "Alpha Denshi Co. / Kural Samno Electric, Ltd.", "Crush Roller (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crush2, crush, crush2, maketrax, pacman_state, empty_init, ROT90, "Alpha Denshi Co. / Kural Esco Electric, Ltd.", "Crush Roller (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crush3, crush, korosuke, maketrax, pacman_state, init_maketrax, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Crush Roller (set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crush4, crush, crush2, maketrax, pacman_state, init_eyes, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Crush Roller (set 4)", MACHINE_SUPPORTS_SAVE ) GAME( 1981, crush5, crush, crush4, crush4, pacman_state, empty_init, ROT90, "Alpha Denshi Co. / Kural TWT", "Crush Roller (set 5)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, maketrax, crush, maketrax, maketrax, pacman_state, init_maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, maketrxb, crush, maketrax, maketrax, pacman_state, init_maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, maketrax, crush, korosuke, maketrax, pacman_state, init_maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, maketrxb, crush, korosuke, maketrax, pacman_state, init_maketrax, ROT270, "Alpha Denshi Co. / Kural (Williams license)", "Make Trax (US set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1981, korosuke, crush, korosuke, korosuke, pacman_state, init_maketrax, ROT90, "Alpha Denshi Co. / Kural Electric, Ltd.", "Korosuke Roller (Japan)", MACHINE_SUPPORTS_SAVE ) // ADK considers it a sequel? -GAME( 1981, crushrlf, crush, pacman, maketrax, pacman_state, empty_init, ROT90, "bootleg", "Crush Roller (Famare SA PCB)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, crushbl, crush, pacman, maketrax, pacman_state, empty_init, ROT90, "bootleg", "Crush Roller (bootleg set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, crushbl2, crush, maketrax, mbrush, pacman_state, init_mbrush, ROT90, "bootleg", "Crush Roller (bootleg set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, crushbl3, crush, maketrax, mbrush, pacman_state, init_maketrax, ROT90, "bootleg", "Crush Roller (bootleg set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crushrlf, crush, crush2, maketrax, pacman_state, empty_init, ROT90, "bootleg", "Crush Roller (Famare SA PCB)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crushbl, crush, crush2, maketrax, pacman_state, empty_init, ROT90, "bootleg", "Crush Roller (bootleg set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crushbl2, crush, korosuke, mbrush, pacman_state, init_mbrush, ROT90, "bootleg", "Crush Roller (bootleg set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, crushbl3, crush, korosuke, mbrush, pacman_state, init_maketrax, ROT90, "bootleg", "Crush Roller (bootleg set 3)", MACHINE_SUPPORTS_SAVE ) GAME( 1981, crushs, crush, crushs, crushs, pacman_state, empty_init, ROT90, "bootleg (Sidam)", "Crush Roller (bootleg set 4)", MACHINE_SUPPORTS_SAVE ) // Sidam PCB, no Sidam text -GAME( 1981, mbrush, crush, maketrax, mbrush, pacman_state, init_mbrush, ROT90, "bootleg (Olympia)", "Magic Brush (bootleg of Crush Roller)", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, paintrlr, crush, pacman, paintrlr, pacman_state, empty_init, ROT90, "bootleg", "Paint Roller (bootleg of Crush Roller)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, mbrush, crush, korosuke, mbrush, pacman_state, init_mbrush, ROT90, "bootleg (Olympia)", "Magic Brush (bootleg of Crush Roller)", MACHINE_SUPPORTS_SAVE ) +GAME( 1981, paintrlr, crush, crush2, paintrlr, pacman_state, empty_init, ROT90, "bootleg", "Paint Roller (bootleg of Crush Roller)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, eyes, 0, pacman, eyes, pacman_state, init_eyes, ROT90, "Techstar (Rock-Ola license)", "Eyes (US set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, eyes2, eyes, pacman, eyes, pacman_state, init_eyes, ROT90, "Techstar (Rock-Ola license)", "Eyes (US set 2)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/pcw.cpp b/src/mame/drivers/pcw.cpp index 370639c1611..04b2563e543 100644 --- a/src/mame/drivers/pcw.cpp +++ b/src/mame/drivers/pcw.cpp @@ -104,6 +104,7 @@ // pcw/pcw16 beeper #include "sound/beep.h" #include "machine/ram.h" +#include "machine/rescap.h" #include "render.h" #include "softlist.h" #include "speaker.h" diff --git a/src/mame/drivers/pk8020.cpp b/src/mame/drivers/pk8020.cpp index e533baba70a..359f761edab 100644 --- a/src/mame/drivers/pk8020.cpp +++ b/src/mame/drivers/pk8020.cpp @@ -237,11 +237,11 @@ static void pk8020_floppies(device_slot_interface &device) void pk8020_state::pk8020(machine_config &config) { /* basic machine hardware */ - I8080(config, m_maincpu, 20_MHz_XTAL / 8); // КР580ВМ80А - m_maincpu->set_addrmap(AS_PROGRAM, &pk8020_state::pk8020_mem); - m_maincpu->set_addrmap(AS_IO, &pk8020_state::pk8020_io); - m_maincpu->set_vblank_int("screen", FUNC(pk8020_state::pk8020_interrupt)); - m_maincpu->set_irq_acknowledge_callback("inr", FUNC(pic8259_device::inta_cb)); + i8080a_cpu_device &maincpu(I8080A(config, m_maincpu, 20_MHz_XTAL / 8)); // КР580ВМ80А + maincpu.set_addrmap(AS_PROGRAM, &pk8020_state::pk8020_mem); + maincpu.set_addrmap(AS_IO, &pk8020_state::pk8020_io); + maincpu.set_vblank_int("screen", FUNC(pk8020_state::pk8020_interrupt)); + maincpu.in_inta_func().set("inr", FUNC(pic8259_device::acknowledge)); PLS100(config, m_decplm); // КР556РТ2 (82S100 equivalent; D31) diff --git a/src/mame/drivers/pokemini.cpp b/src/mame/drivers/pokemini.cpp index 39ed4cf2eda..90c37a17415 100644 --- a/src/mame/drivers/pokemini.cpp +++ b/src/mame/drivers/pokemini.cpp @@ -1770,7 +1770,7 @@ void pokemini_state::pokemini(machine_config &config) config.set_maximum_quantum(attotime::from_hz(60)); - I2CMEM(config, m_i2cmem, 0).set_data_size(0x2000); + I2C_24C64(config, m_i2cmem, 0); // ? /* This still needs to be improved to actually match the hardware */ SCREEN(config, m_screen, SCREEN_TYPE_LCD); diff --git a/src/mame/drivers/psion.cpp b/src/mame/drivers/psion.cpp index 0f67945d5ff..1b941b19d11 100644 --- a/src/mame/drivers/psion.cpp +++ b/src/mame/drivers/psion.cpp @@ -76,19 +76,6 @@ uint8_t psion_state::port2_r() return m_pack1->data_r() | m_pack2->data_r(); } -void psion_state::tcsr_w(uint8_t data) -{ - m_tcsr_value = data; - m_maincpu->tcsr_w(data); -} - -uint8_t psion_state::tcsr_r() -{ - if (!machine().side_effects_disabled()) - m_maincpu->tcsr_w(m_tcsr_value); - return m_maincpu->tcsr_r(); -} - uint8_t psion_state::rcp5c_r() { return (m_maincpu->rcr_r()&0x7f) | (m_stby_pwr<<7); @@ -247,7 +234,6 @@ void psion_state::psion_int_reg(address_map &map) { // FIXME: this should all be made internal to the CPU device map(0x0000, 0x001f).m(m_maincpu, FUNC(hd6301x_cpu_device::hd6301x_io)); - map(0x0008, 0x0008).rw(FUNC(psion_state::tcsr_r), FUNC(psion_state::tcsr_w)); map(0x0014, 0x0014).r(FUNC(psion_state::rcp5c_r)); } @@ -496,7 +482,6 @@ void psion_state::machine_start() save_item(NAME(m_kb_counter)); save_item(NAME(m_enable_nmi)); - save_item(NAME(m_tcsr_value)); save_item(NAME(m_stby_pwr)); save_item(NAME(m_pulse)); save_item(NAME(m_rom_bank)); diff --git a/src/mame/drivers/qx10.cpp b/src/mame/drivers/qx10.cpp index 3e4ff612e69..a9f9e235009 100644 --- a/src/mame/drivers/qx10.cpp +++ b/src/mame/drivers/qx10.cpp @@ -113,7 +113,8 @@ private: DECLARE_WRITE_LINE_MEMBER( tc_w ); DECLARE_READ8_MEMBER( mc146818_r ); DECLARE_WRITE8_MEMBER( mc146818_w ); - DECLARE_READ8_MEMBER( get_slave_ack ); + IRQ_CALLBACK_MEMBER( inta_call ); + uint8_t get_slave_ack(offs_t offset); DECLARE_READ8_MEMBER( vram_bank_r ); DECLARE_WRITE8_MEMBER( vram_bank_w ); DECLARE_READ16_MEMBER( vram_r ); @@ -504,7 +505,15 @@ WRITE_LINE_MEMBER(qx10_state::keyboard_clk) IR7 Slave cascade */ -READ8_MEMBER( qx10_state::get_slave_ack ) +IRQ_CALLBACK_MEMBER(qx10_state::inta_call) +{ + uint32_t vector = m_pic_m->acknowledge() << 16; + vector |= m_pic_m->acknowledge(); + vector |= m_pic_m->acknowledge() << 8; + return vector; +} + +uint8_t qx10_state::get_slave_ack(offs_t offset) { if (offset==7) { // IRQ = 7 return m_pic_s->acknowledge(); @@ -727,15 +736,12 @@ void qx10_state::qx10(machine_config &config) Z80(config, m_maincpu, MAIN_CLK / 4); m_maincpu->set_addrmap(AS_PROGRAM, &qx10_state::qx10_mem); m_maincpu->set_addrmap(AS_IO, &qx10_state::qx10_io); - m_maincpu->set_irq_acknowledge_callback("pic8259_master", FUNC(pic8259_device::inta_cb)); + m_maincpu->set_irq_acknowledge_callback(FUNC(qx10_state::inta_call)); /* video hardware */ SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(50); - m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate m_screen->set_screen_update(FUNC(qx10_state::screen_update)); - m_screen->set_size(640, 480); - m_screen->set_visarea(0, 640-1, 0, 480-1); + m_screen->set_raw(16.67_MHz_XTAL, 872, 152, 792, 421, 4, 404); GFXDECODE(config, "gfxdecode", m_palette, gfx_qx10); PALETTE(config, m_palette, FUNC(qx10_state::qx10_palette), 8); @@ -800,7 +806,7 @@ void qx10_state::qx10(machine_config &config) I8255(config, m_ppi, 0); - UPD7220(config, m_hgdc, MAIN_CLK/6); // unk clock + UPD7220(config, m_hgdc, 16.67_MHz_XTAL/4/2); m_hgdc->set_addrmap(0, &qx10_state::upd7220_map); m_hgdc->set_display_pixels(FUNC(qx10_state::hgdc_display_pixels)); m_hgdc->set_draw_text(FUNC(qx10_state::hgdc_draw_text)); @@ -846,7 +852,8 @@ ROM_START( qx10 ) ROM_REGION( 0x1000, "chargen", 0 ) // ROM_LOAD( "qge.2e", 0x0000, 0x0800, BAD_DUMP CRC(ed93cb81) SHA1(579e68bde3f4184ded7d89b72c6936824f48d10b)) //this one contains special characters only - ROM_LOAD( "qge.2e", 0x0000, 0x1000, BAD_DUMP CRC(eb31a2d5) SHA1(6dc581bf2854a07ae93b23b6dfc9c7abd3c0569e)) +// ROM_LOAD( "qge.2e", 0x0000, 0x1000, BAD_DUMP CRC(eb31a2d5) SHA1(6dc581bf2854a07ae93b23b6dfc9c7abd3c0569e)) + ROM_LOAD( "qga.2e", 0x0000, 0x1000, CRC(4120b128) SHA1(9b96f6d78cfd402f8aec7c063ffb70a21b78eff0)) ROM_END /* Driver */ diff --git a/src/mame/drivers/raiden2.cpp b/src/mame/drivers/raiden2.cpp index 097fd061c7d..cc8fa3d0062 100644 --- a/src/mame/drivers/raiden2.cpp +++ b/src/mame/drivers/raiden2.cpp @@ -1306,7 +1306,7 @@ ROM_START( raiden2 ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1347,7 +1347,7 @@ ROM_START( raiden2g ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1407,7 +1407,7 @@ ROM_START( raiden2hk ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1483,7 +1483,7 @@ ROM_START( raiden2j ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1524,7 +1524,7 @@ ROM_START( raiden2sw ) // original board with serial # 0008307 // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1565,7 +1565,7 @@ ROM_START( raiden2f ) // original board with serial # 12476 that matches raiden2 // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1606,7 +1606,7 @@ ROM_START( raiden2nl ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1647,7 +1647,7 @@ ROM_START( raiden2u ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1688,7 +1688,7 @@ ROM_START( raiden2i ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1730,7 +1730,7 @@ ROM_START( raiden2k ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1788,7 +1788,7 @@ ROM_START( raiden2e ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1829,7 +1829,7 @@ ROM_START( raiden2ea ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1870,7 +1870,7 @@ ROM_START( raiden2eu ) // same as raiden2ea, different region // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1915,7 +1915,7 @@ ROM_START( raiden2eua ) // sort of a mixture of raiden2e easy set with voice ROM // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -1960,7 +1960,7 @@ ROM_START( raiden2eg ) // this is the same code revision as raiden2eua but a ger // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below @@ -2005,7 +2005,7 @@ ROM_START( raiden2eup ) // Common Raiden II PALs below ROM_REGION( 0x10000, "pals", 0 ) /* PALS */ - ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x288, NO_DUMP) + ROM_LOAD( "jj4b02__ami18cv8-15.u0342", 0x0000, 0x155, CRC(057a9cdc) SHA1(8b46f6673ddf11efbc3394ae423ec89d4a1283bf) ) ROM_LOAD( "jj4b01__mmipal16l8bcn.u0341", 0x0000, 0x117, CRC(20931f21) SHA1(95ce9cfbfb280dfc6a326e378684eff3c6f54701) ) // Common Raiden II soldered mask ROMs below diff --git a/src/mame/drivers/saitek_delta1.cpp b/src/mame/drivers/saitek_delta1.cpp index 4b0384d9feb..c3361d18e91 100644 --- a/src/mame/drivers/saitek_delta1.cpp +++ b/src/mame/drivers/saitek_delta1.cpp @@ -11,6 +11,22 @@ Hardware notes: - 4KB ROM(2332A), 256 bytes RAM(2*2111A-4) - 4-digit 7seg panel, no sound, no chessboard +------------------------------------------------------------------------------- + +Program origin notes by bataais: + +They (some SciSys engineers) took the rom of Boris Master (rev. 1) and tried to +rewrite it for a 4x 7-Segment LED, unfortunately they botched the hack job, the +timer interrupt calls the new display routine much more frequently and so loses +time for chess calculations; and more weird stuff is going on. + +No wonder it plays so weak. + +In the Delta-1 ROM is even some fragmented code remaining of the message: + +0878:BORIS AWAITS YOUR MOVE +01 CD 7E 53 09 37 AE 50 (BC FD 59 C0 86 0) + ******************************************************************************/ #include "emu.h" @@ -62,27 +78,21 @@ private: DECLARE_WRITE8_MEMBER(digit_w); DECLARE_READ8_MEMBER(input_r); - u8 m_mux_data; - u8 m_led_select; - u8 m_inp_mux; - u8 m_7seg_data; - bool m_7seg_rc; - bool m_blink; + u8 m_mux_data = 0; + u8 m_led_select = 0; + u8 m_inp_mux = 0; + u8 m_7seg_data = 0; + bool m_7seg_rc = false; + bool m_blink = false; }; void delta1_state::machine_start() { - // zerofill - m_mux_data = 0; - m_led_select = 0; - m_inp_mux = 0; - m_7seg_rc = false; - m_blink = false; - // register for savestates save_item(NAME(m_mux_data)); save_item(NAME(m_led_select)); save_item(NAME(m_inp_mux)); + save_item(NAME(m_7seg_data)); save_item(NAME(m_7seg_rc)); save_item(NAME(m_blink)); diff --git a/src/mame/drivers/saitek_leonardo.cpp b/src/mame/drivers/saitek_leonardo.cpp index 4f7a93b4bf2..e5a67f1d2f1 100644 --- a/src/mame/drivers/saitek_leonardo.cpp +++ b/src/mame/drivers/saitek_leonardo.cpp @@ -100,10 +100,10 @@ private: void unk_w(u8 data); u8 p2_r(); - u8 p5_r(); - u8 p6_r(); void p2_w(u8 data); + u8 p6_r(); void p5_w(u8 data); + u8 p5_r(); void p6_w(u8 data); u8 m_inp_mux = 0; @@ -139,7 +139,7 @@ void leo_state::mux_w(u8 data) update_display(); // d4: speaker out - m_dac->write(data >> 4 & 1); + m_dac->write(BIT(data, 4)); } void leo_state::leds_w(u8 data) diff --git a/src/mame/drivers/saitek_renaissance.cpp b/src/mame/drivers/saitek_renaissance.cpp index 601c5a694a1..cd349ed44d7 100644 --- a/src/mame/drivers/saitek_renaissance.cpp +++ b/src/mame/drivers/saitek_renaissance.cpp @@ -22,7 +22,10 @@ The LCD screen is fairly large, it's the same one as in Saitek Simultano, so a chessboard display + 7seg info. TODO: -- WIP +- LCD (need SVG screen) +- not sure about comm/module leds +- make it a subdriver of saitek_leonardo.cpp? or too many differences +- same TODO list as saitek_leonardo.cpp ******************************************************************************/ @@ -32,9 +35,14 @@ TODO: #include "machine/sensorboard.h" #include "sound/dac.h" #include "sound/volt_reg.h" +#include "video/pwm.h" +#include "video/sed1500.h" #include "speaker.h" +// internal artwork +#include "saitek_renaissance.lh" // clickable + namespace { @@ -45,7 +53,9 @@ public: driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_board(*this, "board"), - m_dac(*this, "dac") + m_display(*this, "display"), + m_dac(*this, "dac"), + m_inputs(*this, "IN.%u", 0) { } // machine configs @@ -58,13 +68,33 @@ private: // devices/pointers required_device m_maincpu; required_device m_board; + required_device m_display; optional_device m_dac; + required_ioport_array<8+1> m_inputs; void main_map(address_map &map); + + void update_display(); + void mux_w(u8 data); + void leds_w(u8 data); + void control_w(u8 data); + u8 control_r(); + + u8 p2_r(); + void p2_w(u8 data); + u8 p5_r(); + void p5_w(u8 data); + u8 p6_r(); + void p6_w(u8 data); + + u8 m_inp_mux = 0; + u8 m_led_data[2] = { 0, 0 }; }; void ren_state::machine_start() { + save_item(NAME(m_inp_mux)); + save_item(NAME(m_led_data)); } @@ -73,7 +103,100 @@ void ren_state::machine_start() I/O ******************************************************************************/ -// ... +// misc + +void ren_state::update_display() +{ + m_display->matrix_partial(0, 9, 1 << (m_inp_mux & 0xf), (m_inp_mux << 4 & 0x100) | m_led_data[0], false); + m_display->matrix_partial(9, 1, 1, (m_inp_mux >> 2 & 0x30) | m_led_data[1], true); +} + +void ren_state::mux_w(u8 data) +{ + // d0-d3 input/chessboard led mux + // d4: chessboard led data + // d6,d7: mode led + m_inp_mux = data; + update_display(); + + // d5: ? +} + +void ren_state::leds_w(u8 data) +{ + // chessboard led data + m_led_data[0] = data; + update_display(); +} + +void ren_state::control_w(u8 data) +{ + // d1: speaker out + m_dac->write(BIT(data, 1)); + + // d2,d3: comm/module leds? + m_led_data[1] = (m_led_data[1] & ~0xc) | (~data & 0xc); + update_display(); + + // d6: power off? + + // other: ? +} + +u8 ren_state::control_r() +{ + // d5,d6: freq sel? + // d7: ? + return 0; +} + + +// MCU ports + +u8 ren_state::p2_r() +{ + u8 data = 0; + + // d0-d2: multiplexed inputs + if (~m_inp_mux & 8) + data = m_inputs[m_inp_mux & 7]->read(); + + // d3: ? + + return ~data; +} + +void ren_state::p2_w(u8 data) +{ + // d5,d6: b/w leds + m_led_data[1] = (m_led_data[1] & ~3) | (~data >> 5 & 3); + update_display(); +} + +u8 ren_state::p5_r() +{ + // d6: battery status + u8 b = m_inputs[8]->read() & 0x40; + + // other: ? + return b | 0xbf; +} + +void ren_state::p5_w(u8 data) +{ + // ? +} + +u8 ren_state::p6_r() +{ + // read chessboard sensors + return ~m_board->read_file(m_inp_mux & 0xf); +} + +void ren_state::p6_w(u8 data) +{ + // module data +} @@ -85,7 +208,11 @@ void ren_state::main_map(address_map &map) { map(0x0000, 0x0027).m(m_maincpu, FUNC(hd6303y_cpu_device::hd6301y_io)); map(0x0040, 0x013f).ram(); // internal + map(0x2000, 0x2000).w(FUNC(ren_state::mux_w)); + map(0x2400, 0x2400).w(FUNC(ren_state::leds_w)); + map(0x2600, 0x2600).rw(FUNC(ren_state::control_r), FUNC(ren_state::control_w)); map(0x4000, 0x5fff).ram(); + map(0x6000, 0x607f).w("lcd", FUNC(sed1502_device::write)); map(0x8000, 0xffff).rom(); } @@ -96,6 +223,50 @@ void ren_state::main_map(address_map &map) ******************************************************************************/ static INPUT_PORTS_START( ren ) + PORT_START("IN.0") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) // king + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) // rook + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) // knight + + PORT_START("IN.1") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) // queen + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) // bishop + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) // pawn + + PORT_START("IN.2") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) // scroll? + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) // tab + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) // + + + PORT_START("IN.3") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) // n + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) // function? + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) // sound + + PORT_START("IN.4") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) // n + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_T) // stop? + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Y) // library + + PORT_START("IN.5") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_U) // info + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_I) // play? + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_O) // level + + PORT_START("IN.6") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) // - + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_S) // normal? + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_D) // analysis + + PORT_START("IN.7") + PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_F) // n + PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_G) // new game + PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_H) // setup + + PORT_START("IN.8") + PORT_CONFNAME( 0x40, 0x00, "Battery Status" ) + PORT_CONFSETTING( 0x40, "Low" ) + PORT_CONFSETTING( 0x00, DEF_STR( Normal ) ) INPUT_PORTS_END @@ -109,11 +280,22 @@ void ren_state::ren(machine_config &config) /* basic machine hardware */ HD6303Y(config, m_maincpu, 10_MHz_XTAL); m_maincpu->set_addrmap(AS_PROGRAM, &ren_state::main_map); + m_maincpu->in_p2_cb().set(FUNC(ren_state::p2_r)); + m_maincpu->out_p2_cb().set(FUNC(ren_state::p2_w)); + m_maincpu->in_p5_cb().set(FUNC(ren_state::p5_r)); + m_maincpu->out_p5_cb().set(FUNC(ren_state::p5_w)); + m_maincpu->in_p6_cb().set(FUNC(ren_state::p6_r)); + m_maincpu->out_p6_cb().set(FUNC(ren_state::p6_w)); SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS); m_board->init_cb().set(m_board, FUNC(sensorboard_device::preset_chess)); m_board->set_delay(attotime::from_msec(150)); + /* video hardware */ + SED1502(config, "lcd", 32768); + PWM_DISPLAY(config, m_display).set_size(9+1, 9); + config.set_default_layout(layout_saitek_renaissance); + /* sound hardware */ SPEAKER(config, "speaker").front_center(); DAC_1BIT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); @@ -145,5 +327,5 @@ ROM_END ******************************************************************************/ // YEAR NAME PARENT CMP MACHINE INPUT CLASS INIT COMPANY, FULLNAME, FLAGS -CONS( 1989, renaissa, 0, 0, ren, ren, ren_state, empty_init, "Saitek", "Kasparov Renaissance (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) -CONS( 1989, renaissaa, renaissa, 0, ren, ren, ren_state, empty_init, "Saitek", "Kasparov Renaissance (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING ) +CONS( 1989, renaissa, 0, 0, ren, ren, ren_state, empty_init, "Saitek", "Kasparov Renaissance (set 1)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_NOT_WORKING ) +CONS( 1989, renaissaa, renaissa, 0, ren, ren, ren_state, empty_init, "Saitek", "Kasparov Renaissance (set 2)", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK | MACHINE_NOT_WORKING ) diff --git a/src/mame/drivers/saitek_ssystem3.cpp b/src/mame/drivers/saitek_ssystem3.cpp index 4d0d6f81511..5cb0988702a 100644 --- a/src/mame/drivers/saitek_ssystem3.cpp +++ b/src/mame/drivers/saitek_ssystem3.cpp @@ -122,20 +122,14 @@ private: DECLARE_WRITE8_MEMBER(control_w); DECLARE_READ8_MEMBER(control_r); - u8 m_inp_mux; - u8 m_control; - u8 m_shift; - u32 m_lcd_q; + u8 m_inp_mux = 0; + u8 m_control = 0; + u8 m_shift = 0; + u32 m_lcd_q = 0; }; void ssystem3_state::machine_start() { - // zerofill - m_inp_mux = 0; - m_control = 0; - m_shift = 0; - m_lcd_q = 0; - // register for savestates save_item(NAME(m_inp_mux)); save_item(NAME(m_control)); diff --git a/src/mame/drivers/seta2.cpp b/src/mame/drivers/seta2.cpp index 6c683b603da..9d724ecea85 100644 --- a/src/mame/drivers/seta2.cpp +++ b/src/mame/drivers/seta2.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia +// copyright-holders:Luca Elia, David Haywood /*************************************************************************** -= Newer Seta Hardware =- @@ -4400,20 +4400,32 @@ ROM_START( telpacfl ) ROM_END GAME( 1994, gundamex, 0, gundamex, gundamex, seta2_state, empty_init, ROT0, "Banpresto", "Mobile Suit Gundam EX Revue", 0 ) + GAME( 1995, grdians, 0, grdians, grdians, seta2_state, empty_init, ROT0, "Winkysoft (Banpresto license)", "Guardians / Denjin Makai II (P-FG01-1 PCB)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1995, grdiansa, grdians, grdians, grdians, seta2_state, empty_init, ROT0, "Winkysoft (Banpresto license)", "Guardians / Denjin Makai II (P0-113A PCB)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 1996, mj4simai, 0, seta2, mj4simai, mj4simai_state, empty_init, ROT0, "Maboroshi Ware", "Wakakusamonogatari Mahjong Yonshimai (Japan)", MACHINE_NO_COCKTAIL ) + GAME( 1996, myangel, 0, myangel, myangel, seta2_state, empty_init, ROT0, "MOSS / Namco", "Kosodate Quiz My Angel (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 1997, myangel2, 0, myangel2, myangel2, seta2_state, empty_init, ROT0, "MOSS / Namco", "Kosodate Quiz My Angel 2 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 1996, telpacfl, 0, telpacfl, telpacfl, seta2_state, empty_init, ROT270, "Sunsoft", "TelePachi Fever Lion (V1.0)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 1997, reelquak, 0, reelquak, reelquak, seta2_state, empty_init, ROT0, "", "Reel'N Quake! (Version 1.05)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 199?, endrichs, 0, reelquak, endrichs, seta2_state, empty_init, ROT0, "E.N.Tiger", "Endless Riches (Ver 1.20)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 1997, staraudi, 0, staraudi, staraudi, staraudi_state, empty_init, ROT0, "Namco", "Star Audition", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) + GAME( 1999, pzlbowl, 0, pzlbowl, pzlbowl, seta2_state, empty_init, ROT0, "MOSS / Nihon System", "Puzzle De Bowling (Japan)", MACHINE_NO_COCKTAIL ) + GAME( 2000, penbros, 0, penbros, penbros, seta2_state, empty_init, ROT0, "Subsino", "Penguin Brothers (Japan)", MACHINE_NO_COCKTAIL ) GAME( 2000, ablast, penbros, penbros, penbros, seta2_state, empty_init, ROT0, "Subsino", "Hong Tian Lei (A-Blast) (Japan)", MACHINE_NO_COCKTAIL ) // 轟天雷/Hōng tiān léi GAME( 2000, ablastb, penbros, ablastb, penbros, seta2_state, empty_init, ROT0, "bootleg", "Hong Tian Lei (A-Blast) (bootleg)", MACHINE_NO_COCKTAIL | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND ) // at least "tilemap sprite" scrolly flag differs, FPGA instead of x1-010 + GAME( 2000, namcostr, 0, namcostr, funcube, seta2_state, init_namcostr, ROT0, "Namco", "Namco Stars", MACHINE_NO_COCKTAIL | MACHINE_NOT_WORKING ) + GAME( 2000, deerhunt, 0, samshoot, deerhunt, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.3", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 2000, deerhunta, deerhunt, samshoot, deerhunt, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.2", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 2000, deerhuntb, deerhunt, samshoot, deerhunt, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.0", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) @@ -4421,14 +4433,22 @@ GAME( 2000, deerhuntc, deerhunt, samshoot, deerhunt, seta2_state, empty_init, GAME( 2000, deerhuntd, deerhunt, samshoot, deerhunt, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Deer Hunting USA V2", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 2000, deerhunte, deerhunt, samshoot, deerhunt, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Deer Hunting USA V1", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 2000, deerhuntj, deerhunt, samshoot, deerhunt, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Deer Hunting USA V4.4.1 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 2001, turkhunt, 0, samshoot, turkhunt, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Turkey Hunting USA V1.00", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 2001, wschamp, 0, samshoot, wschamp, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V2.00", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 2001, wschampa, wschamp, samshoot, wschamp, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V1.01", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 2001, wschampb, wschamp, samshoot, wschamp, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Wing Shooting Championship V1.00", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 2002, trophyh, 0, samshoot, trophyh, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Trophy Hunting - Bear & Moose V1.00", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) GAME( 2002, trophyht, trophyh, samshoot, trophyht, seta2_state, empty_init, ROT0, "Sammy USA Corporation", "Trophy Hunting - Bear & Moose V1.00 (location test)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS ) + GAME( 2000, funcube, 0, funcube, funcube, funcube_state, init_funcube, ROT0, "Namco", "Funcube (v1.5)", MACHINE_NO_COCKTAIL ) + GAME( 2001, funcube2, 0, funcube2, funcube, funcube_state, init_funcube2, ROT0, "Namco", "Funcube 2 (v1.1)", MACHINE_NO_COCKTAIL ) + GAME( 2001, funcube3, 0, funcube3, funcube, funcube_state, init_funcube3, ROT0, "Namco", "Funcube 3 (v1.1)", MACHINE_NO_COCKTAIL ) + GAME( 2001, funcube4, 0, funcube2, funcube, funcube_state, init_funcube2, ROT0, "Namco", "Funcube 4 (v1.0)", MACHINE_NO_COCKTAIL ) + GAME( 2002, funcube5, 0, funcube2, funcube, funcube_state, init_funcube2, ROT0, "Namco", "Funcube 5 (v1.0)", MACHINE_NO_COCKTAIL ) diff --git a/src/mame/drivers/sf.cpp b/src/mame/drivers/sf.cpp index 6b02c2cb044..8ff7194572e 100644 --- a/src/mame/drivers/sf.cpp +++ b/src/mame/drivers/sf.cpp @@ -6,124 +6,105 @@ driver by Olivier Galibert - TODO: - - acquire i8751 protection mcu internal rom dump and emulate it - ***************************************************************************/ #include "emu.h" -#include "includes/sf.h" -#include "cpu/z80/z80.h" #include "cpu/m68000/m68000.h" -#include "sound/ym2151.h" +#include "cpu/mcs51/mcs51.h" +#include "cpu/z80/z80.h" +#include "emupal.h" +#include "machine/gen_latch.h" #include "screen.h" +#include "sound/msm5205.h" +#include "sound/ym2151.h" #include "speaker.h" +#include "tilemap.h" -/* The protection of the Japanese (and alt US) version */ -/* I'd love to see someone dump the i8751 rom */ - -void sf_state::write_dword( address_space &space, offs_t offset, uint32_t data ) +class sf_state : public driver_device { - space.write_word(offset, data >> 16); - space.write_word(offset + 2, data); -} +public: + sf_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_protcpu(*this, "protcpu"), + m_msm(*this, "msm%u", 1U), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), + m_soundlatch(*this, "soundlatch"), + m_videoram(*this, "videoram"), + m_objectram(*this, "objectram"), + m_tilerom(*this, "tilerom"), + m_audiobank(*this, "audiobank") + { } -WRITE16_MEMBER(sf_state::protection_w) -{ - static const int maplist[4][10] = { - { 1, 0, 3, 2, 4, 5, 6, 7, 8, 9 }, - { 4, 5, 6, 7, 1, 0, 3, 2, 8, 9 }, - { 3, 2, 1, 0, 6, 7, 4, 5, 8, 9 }, - { 6, 7, 4, 5, 3, 2, 1, 0, 8, 9 } - }; - int map = maplist - [space.read_byte(0xffc006)] - [(space.read_byte(0xffc003) << 1) + (space.read_word(0xffc004) >> 8)]; + void sfp(machine_config &config); + void sfjp(machine_config &config); + void sfus(machine_config &config); + void sfan(machine_config &config); - switch (space.read_byte(0xffc684)) - { - case 1: - { - int base; +private: + /* devices */ + required_device m_maincpu; + required_device m_audiocpu; + optional_device m_protcpu; + required_device_array m_msm; + required_device m_gfxdecode; + required_device m_palette; + required_device m_soundlatch; - base = 0x1b6e8 + 0x300e * map; + /* memory pointers */ + required_shared_ptr m_videoram; + required_shared_ptr m_objectram; + required_region_ptr m_tilerom; - write_dword(space, 0xffc01c, 0x16bfc + 0x270 * map); - write_dword(space, 0xffc020, base + 0x80); - write_dword(space, 0xffc024, base); - write_dword(space, 0xffc028, base + 0x86); - write_dword(space, 0xffc02c, base + 0x8e); - write_dword(space, 0xffc030, base + 0x20e); - write_dword(space, 0xffc034, base + 0x30e); - write_dword(space, 0xffc038, base + 0x38e); - write_dword(space, 0xffc03c, base + 0x40e); - write_dword(space, 0xffc040, base + 0x80e); - write_dword(space, 0xffc044, base + 0xc0e); - write_dword(space, 0xffc048, base + 0x180e); - write_dword(space, 0xffc04c, base + 0x240e); - write_dword(space, 0xffc050, 0x19548 + 0x60 * map); - write_dword(space, 0xffc054, 0x19578 + 0x60 * map); - break; - } - case 2: - { - static const int delta1[10] = { - 0x1f80, 0x1c80, 0x2700, 0x2400, 0x2b80, 0x2e80, 0x3300, 0x3600, 0x3a80, 0x3d80 - }; - static const int delta2[10] = { - 0x2180, 0x1800, 0x3480, 0x2b00, 0x3e00, 0x4780, 0x5100, 0x5a80, 0x6400, 0x6d80 - }; + required_memory_bank m_audiobank; - int d1 = delta1[map] + 0xc0; - int d2 = delta2[map]; + /* video-related */ + tilemap_t *m_bg_tilemap; + tilemap_t *m_fg_tilemap; + tilemap_t *m_tx_tilemap; + int m_active; + bool m_prot_t0; + uint16_t m_bgscroll; + uint16_t m_fgscroll; - space.write_word(0xffc680, d1); - space.write_word(0xffc682, d2); - space.write_word(0xffc00c, 0xc0); - space.write_word(0xffc00e, 0); + void coin_w(u8 data); + void soundcmd_w(u8 data); + void protection_w(u16); + void sound2_bank_w(u8 data); + void videoram_w(offs_t offset, u16 data, u16 mem_mask); + void bg_scroll_w(offs_t, u16 data, u16 mem_mask); + void fg_scroll_w(offs_t, u16 data, u16 mem_mask); + void gfxctrl_w(offs_t, u16 data, u16 mem_mask); + template void msm_w(u8 data); + void prot_p3_w(u8 data); + void prot_ram_w(offs_t offset, u8 data); + u8 prot_ram_r(offs_t offset); - fg_scroll_w(space, 0, d1, 0xffff); - bg_scroll_w(space, 0, d2, 0xffff); - break; - } - case 4: - { - int pos = space.read_byte(0xffc010); - pos = (pos + 1) & 3; - space.write_byte(0xffc010, pos); - if(!pos) - { - int d1 = space.read_word(0xffc682); - int off = space.read_word(0xffc00e); - if (off!=512) - { - off++; - d1++; - } - else - { - off = 0; - d1 -= 512; - } - space.write_word(0xffc682, d1); - space.write_word(0xffc00e, off); - bg_scroll_w(space, 0, d1, 0xffff); - } - break; - } - default: - { - logerror("Write protection at %06x (%04x)\n", m_maincpu->pc(), data & 0xffff); - logerror("*** Unknown protection %d\n", space.read_byte(0xffc684)); - break; - } - } -} + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + TILE_GET_INFO_MEMBER(get_tx_tile_info); + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + inline int invert( int nb ); + void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); + void write_dword( address_space &space, offs_t offset, uint32_t data ); + void sfan_map(address_map &map); + void sfjp_map(address_map &map); + void sfus_map(address_map &map); + void sound2_io_map(address_map &map); + void sound2_map(address_map &map); + void sound_map(address_map &map); + void prot_map(address_map &map); +}; -WRITE8_MEMBER(sf_state::coin_w) +void sf_state::coin_w(u8 data) { machine().bookkeeping().coin_counter_w(0, data & 0x01); machine().bookkeeping().coin_counter_w(1, data & 0x02); @@ -132,19 +113,19 @@ WRITE8_MEMBER(sf_state::coin_w) machine().bookkeeping().coin_lockout_w(2, ~data & 0x40); /* is there a third coin input? */ } -WRITE8_MEMBER(sf_state::soundcmd_w) +void sf_state::soundcmd_w(u8 data) { m_soundlatch->write(data & 0xff); m_audiocpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero); } -WRITE8_MEMBER(sf_state::sound2_bank_w) +void sf_state::sound2_bank_w(u8 data) { m_audiobank->set_entry(data); } template -WRITE8_MEMBER(sf_state::msm_w) +void sf_state::msm_w(u8 data) { m_msm[Chip]->reset_w(BIT(data, 7)); /* ?? bit 6?? */ @@ -172,7 +153,6 @@ void sf_state::sfan_map(address_map &map) map(0xc00018, 0xc00019).w(FUNC(sf_state::bg_scroll_w)); map(0xc0001a, 0xc0001b).w(FUNC(sf_state::gfxctrl_w)); map(0xc0001d, 0xc0001d).w(FUNC(sf_state::soundcmd_w)); -// map(0xc0001e, 0xc0001f).w(FUNC(sf_state::protection_w)); map(0xff8000, 0xffdfff).ram(); map(0xffe000, 0xffffff).ram().share("objectram"); } @@ -196,7 +176,6 @@ void sf_state::sfus_map(address_map &map) map(0xc00018, 0xc00019).w(FUNC(sf_state::bg_scroll_w)); map(0xc0001a, 0xc0001b).w(FUNC(sf_state::gfxctrl_w)); map(0xc0001d, 0xc0001d).w(FUNC(sf_state::soundcmd_w)); -// map(0xc0001e, 0xc0001f).w(FUNC(sf_state::protection_w)); map(0xff8000, 0xffdfff).ram(); map(0xffe000, 0xffffff).ram().share("objectram"); } @@ -250,6 +229,240 @@ void sf_state::sound2_io_map(address_map &map) map(0x02, 0x02).w(FUNC(sf_state::sound2_bank_w)); } +void sf_state::prot_map(address_map &map) +{ + map(0x0000, 0xffff).rw(FUNC(sf_state::prot_ram_r), FUNC(sf_state::prot_ram_w)); +} + +TILE_GET_INFO_MEMBER(sf_state::get_bg_tile_info) +{ + uint8_t *base = &m_tilerom[2 * tile_index]; + int attr = base[0x10000]; + int color = base[0]; + int code = (base[0x10000 + 1] << 8) | base[1]; + tileinfo.set(0, code, color, TILE_FLIPYX(attr & 3)); +} + +TILE_GET_INFO_MEMBER(sf_state::get_fg_tile_info) +{ + uint8_t *base = &m_tilerom[0x20000 + 2 * tile_index]; + int attr = base[0x10000]; + int color = base[0]; + int code = (base[0x10000 + 1] << 8) | base[1]; + tileinfo.set(1, code, color, TILE_FLIPYX(attr & 3)); +} + +TILE_GET_INFO_MEMBER(sf_state::get_tx_tile_info) +{ + int code = m_videoram[tile_index]; + tileinfo.set(3, code & 0x3ff, code>>12, TILE_FLIPYX((code & 0xc00)>>10)); +} + +void sf_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sf_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 2048, 16); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sf_state::get_fg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 2048, 16); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sf_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + + m_fg_tilemap->set_transparent_pen(15); + m_tx_tilemap->set_transparent_pen(3); +} + +void sf_state::protection_w(u16) +{ + m_protcpu->set_input_line(MCS51_INT0_LINE, ASSERT_LINE); + m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); +} + +void sf_state::prot_p3_w(u8 data) +{ + m_prot_t0 = data & 0x10; + + // Dunno if it's using HALT or DTACK, not really important though + if(!(data & 0x02)) { + m_maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); + m_protcpu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE); + } +} + +void sf_state::prot_ram_w(offs_t offset, u8 data) +{ + offset = offset * 2 + m_prot_t0; + if(offset & 0x8000) + offset = 0xff8000 | offset; + else + offset = 0xc00000 | (offset & 0x7fff); + + m_maincpu->space(AS_PROGRAM).write_byte(offset, data); +} + +u8 sf_state::prot_ram_r(offs_t offset) +{ + offset = offset * 2 + m_prot_t0; + if(offset & 0x8000) + offset = 0xff8000 | offset; + else + offset = 0xc00000 | (offset & 0x7fff); + + return m_maincpu->space(AS_PROGRAM).read_byte(offset); +} + + + +/*************************************************************************** + + Memory handlers + +***************************************************************************/ + +void sf_state::videoram_w(offs_t offset, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_videoram[offset]); + m_tx_tilemap->mark_tile_dirty(offset); +} + +void sf_state::bg_scroll_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_bgscroll); + m_bg_tilemap->set_scrollx(0, m_bgscroll); +} + +void sf_state::fg_scroll_w(offs_t, u16 data, u16 mem_mask) +{ + COMBINE_DATA(&m_fgscroll); + m_fg_tilemap->set_scrollx(0, m_fgscroll); +} + +void sf_state::gfxctrl_w(offs_t, u16 data, u16 mem_mask) +{ + /* b0 = reset, or maybe "set anyway" */ + /* b1 = pulsed when control6.b6==0 until it's 1 */ + /* b2 = active when dip 8 (flip) on */ + /* b3 = active character plane */ + /* b4 = unused */ + /* b5 = active background plane */ + /* b6 = active middle plane */ + /* b7 = active sprites */ + + if(ACCESSING_BITS_0_7) { + m_active = data & 0xff; + flip_screen_set(data & 0x04); + m_tx_tilemap->enable(data & 0x08); + m_bg_tilemap->enable(data & 0x20); + m_fg_tilemap->enable(data & 0x40); + } +} + + +inline int sf_state::invert( int nb ) +{ + static const int delta[4] = {0x00, 0x18, 0x18, 0x00}; + return nb ^ delta[(nb >> 3) & 3]; +} + +void sf_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ) +{ + int offs; + + for (offs = 0x1000 - 0x20; offs >= 0; offs -= 0x20) + { + int c = m_objectram[offs]; + int attr = m_objectram[offs + 1]; + int sy = m_objectram[offs + 2]; + int sx = m_objectram[offs + 3]; + int color = attr & 0x000f; + int flipx = attr & 0x0100; + int flipy = attr & 0x0200; + + if (attr & 0x400) /* large sprite */ + { + int c1, c2, c3, c4, t; + + if (flip_screen()) + { + sx = 480 - sx; + sy = 224 - sy; + flipx = !flipx; + flipy = !flipy; + } + + c1 = c; + c2 = c + 1; + c3 = c + 16; + c4 = c + 17; + + if (flipx) + { + t = c1; c1 = c2; c2 = t; + t = c3; c3 = c4; c4 = t; + } + if (flipy) + { + t = c1; c1 = c3; c3 = t; + t = c2; c2 = c4; c4 = t; + } + + m_gfxdecode->gfx(2)->transpen(bitmap, + cliprect, + invert(c1), + color, + flipx,flipy, + sx,sy, 15); + m_gfxdecode->gfx(2)->transpen(bitmap, + cliprect, + invert(c2), + color, + flipx,flipy, + sx+16,sy, 15); + m_gfxdecode->gfx(2)->transpen(bitmap, + cliprect, + invert(c3), + color, + flipx,flipy, + sx,sy+16, 15); + m_gfxdecode->gfx(2)->transpen(bitmap, + cliprect, + invert(c4), + color, + flipx,flipy, + sx+16,sy+16, 15); + } + else + { + if (flip_screen()) + { + sx = 496 - sx; + sy = 240 - sy; + flipx = !flipx; + flipy = !flipy; + } + + m_gfxdecode->gfx(2)->transpen(bitmap, + cliprect, + invert(c), + color, + flipx,flipy, + sx,sy, 15); + } + } +} + + +uint32_t sf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + if(m_active & 0x20) + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + else + bitmap.fill(0, cliprect); + + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + if(m_active & 0x80) + draw_sprites(bitmap, cliprect); + + m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; +} /*************************************************************************** @@ -519,6 +732,7 @@ void sf_state::machine_start() save_item(NAME(m_active)); save_item(NAME(m_bgscroll)); save_item(NAME(m_fgscroll)); + save_item(NAME(m_prot_t0)); m_audiobank->configure_entries(0, 256, memregion("audio2")->base() + 0x8000, 0x8000); } @@ -528,6 +742,7 @@ void sf_state::machine_reset() m_active = 0; m_bgscroll = 0; m_fgscroll = 0; + m_prot_t0 = 0; } void sf_state::sfan(machine_config &config) @@ -589,6 +804,10 @@ void sf_state::sfjp(machine_config &config) { sfan(config); m_maincpu->set_addrmap(AS_PROGRAM, &sf_state::sfjp_map); + + I8751(config, m_protcpu, XTAL(8'000'000)); // Clock unknown, but shares the bus with the 68k, so could be similar + m_protcpu->set_addrmap(AS_IO, &sf_state::prot_map); + m_protcpu->port_out_cb<3>().set(FUNC(sf_state::prot_p3_w)); } void sf_state::sfp(machine_config &config) @@ -684,13 +903,13 @@ ROM_START( sfua ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the music CPU */ ROM_LOAD( "sf-02.7k", 0x0000, 0x8000, CRC(4a9ac534) SHA1(933645f8db4756aa2a35a843c3ac6f93cb8d565d) ) + ROM_REGION( 0x1000, "protcpu", 0 ) + ROM_LOAD( "sf_s.id8751h-8.14f", 0x0000, 0x1000, CRC(6588891f) SHA1(699a96c682dd527dc77aa5cb2c2655136d2bfc90) ) // is this mcu label right for the US set? + ROM_REGION( 0x40000, "audio2", 0 ) /* 256k for the samples CPU */ ROM_LOAD( "sfu-00.1h",0x00000, 0x20000, CRC(a7cce903) SHA1(76f521c9a00abd95a3491ab95e8eccd0fc7ea0e5) ) ROM_LOAD( "sf-01.1k", 0x20000, 0x20000, CRC(86e0f0d5) SHA1(7cef8056f83dac15f1b47d7be705d26170858337) ) - ROM_REGION( 0x0800, "mcu", 0 ) /* i8751 MCU */ - ROM_LOAD( "sf_s.id8751h-8.14f", 0x0000, 0x0800, NO_DUMP ) // is this mcu label right for the US set? - ROM_REGION( 0x080000, "gfx1", 0 ) ROM_LOAD( "sf-39.2k", 0x000000, 0x020000, CRC(cee3d292) SHA1(a8c22f1dc81976e8dd5d6c70361c61fa3f9f89d6) ) /* Background b planes 0-1*/ ROM_LOAD( "sf-38.1k", 0x020000, 0x020000, CRC(2ea99676) SHA1(5f3eb77e75f0ee27fb8fc7bab2819b3fdd480206) ) @@ -754,13 +973,13 @@ ROM_START( sfj ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the music CPU */ ROM_LOAD( "sf-02.7k", 0x0000, 0x8000, CRC(4a9ac534) SHA1(933645f8db4756aa2a35a843c3ac6f93cb8d565d) ) + ROM_REGION( 0x1000, "protcpu", 0 ) + ROM_LOAD( "sf_s.id8751h-8.14f", 0x0000, 0x1000, CRC(6588891f) SHA1(699a96c682dd527dc77aa5cb2c2655136d2bfc90) ) + ROM_REGION( 0x40000, "audio2", 0 ) /* 256k for the samples CPU */ ROM_LOAD( "sf-00.1h", 0x00000, 0x20000, CRC(4b733845) SHA1(f7ff46e02f8ce6682d6e573588271bae2edfa90f) ) ROM_LOAD( "sf-01.1k", 0x20000, 0x20000, CRC(86e0f0d5) SHA1(7cef8056f83dac15f1b47d7be705d26170858337) ) - ROM_REGION( 0x0800, "mcu", 0 ) /* i8751 MCU */ - ROM_LOAD( "sf_s.id8751h-8.14f", 0x0000, 0x0800, NO_DUMP ) - ROM_REGION( 0x080000, "gfx1", 0 ) ROM_LOAD( "sf-39.2k", 0x000000, 0x020000, CRC(cee3d292) SHA1(a8c22f1dc81976e8dd5d6c70361c61fa3f9f89d6) ) /* Background b planes 0-1*/ ROM_LOAD( "sf-38.1k", 0x020000, 0x020000, CRC(2ea99676) SHA1(5f3eb77e75f0ee27fb8fc7bab2819b3fdd480206) ) @@ -958,13 +1177,13 @@ ROM_START( sfw ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the music CPU */ ROM_LOAD( "sf-02.7k", 0x0000, 0x8000, CRC(4a9ac534) SHA1(933645f8db4756aa2a35a843c3ac6f93cb8d565d) ) + ROM_REGION( 0x1000, "protcpu", 0 ) + ROM_LOAD( "sf.14e", 0x0000, 0x1000, CRC(6588891f) SHA1(699a96c682dd527dc77aa5cb2c2655136d2bfc90) ) + ROM_REGION( 0x40000, "audio2", 0 ) /* 256k for the samples CPU */ ROM_LOAD( "sfu-00.1h",0x00000, 0x20000, CRC(a7cce903) SHA1(76f521c9a00abd95a3491ab95e8eccd0fc7ea0e5) ) ROM_LOAD( "sf-01.2k", 0x20000, 0x20000, CRC(86e0f0d5) SHA1(7cef8056f83dac15f1b47d7be705d26170858337) ) - ROM_REGION( 0x0800, "mcu", 0 ) /* i8751 MCU */ - ROM_LOAD( "sf.14e", 0x0000, 0x0800, NO_DUMP ) - ROM_REGION( 0x080000, "gfx1", 0 ) ROM_LOAD( "sf-39.2k", 0x000000, 0x020000, CRC(cee3d292) SHA1(a8c22f1dc81976e8dd5d6c70361c61fa3f9f89d6) ) /* Background b planes 0-1*/ ROM_LOAD( "sf-38.1k", 0x020000, 0x020000, CRC(2ea99676) SHA1(5f3eb77e75f0ee27fb8fc7bab2819b3fdd480206) ) diff --git a/src/mame/drivers/slapfght.cpp b/src/mame/drivers/slapfght.cpp index 0534bb87727..99205d866d1 100644 --- a/src/mame/drivers/slapfght.cpp +++ b/src/mame/drivers/slapfght.cpp @@ -10,7 +10,7 @@ Alcon / Slap Fight Guardian / Get Star Performan - Tiger Heli + Tiger-Heli TODO: - proper MCU emulation (mame/machine/slapfght.cpp) @@ -36,7 +36,7 @@ $f000-$f7ff READ:SF_S16 WRITE:Character RAM $f800-$ffff READ:Unknown H/W WRITE:Attribute RAM $c800-$cfff Appears to be RAM BUT 1st 0x10 bytes are swapped with - the sound CPU and visversa for READ OPERATIONS + the sound CPU and vice versa for READ OPERATIONS Write I/O MAP @@ -63,7 +63,7 @@ $0f Read I/O Map ------------ -$00 Status regsiter - cycle 0xc7, 0x55, 0x00 (Thanks to Dave Spicer for the info) +$00 Status register - cycle 0xc7, 0x55, 0x00 (Thanks to Dave Spicer for the info) Known Info @@ -210,7 +210,7 @@ Stephh's notes (based on the games Z80 code and some tests) : - US version, licensed to Kitkorp - name "Guardian". - MCU dumped and emulated. - Difficulty determines the number of energy bars you get. - - Each hit removes 1 enegy bar. + - Each hit removes 1 energy bar. - According to the manual, default difficulty shall be set to "Hard". - You can only get ONE extra life. - I don't know if it's an ingame bug, but you always have to enter @@ -236,7 +236,7 @@ Stephh's notes (based on the games Z80 code and some tests) : - Bootleg based on 'getstarj' - MCU reads/writes are patched, but this hasn't been done in the "test mode". - The game seems to have its own protection (check code at 0x0569 and 0x0ac6). - - Patches are coded diffrently than in 'getstarb1' and code isn't always perfect + - Patches are coded differently than in 'getstarb1' and code isn't always perfect (lazy coding ?) which causes LOTS of ingames bugs or strange behaviours : * patched command 0x20 : NO continue play * patched command 0x21 : as soon as a player loses all his lives, @@ -250,7 +250,7 @@ Stephh's notes (based on the games Z80 code and some tests) : (thus the need of a specific INPUT_PORTS definition for this game) * patched command 0x2a : player flag (which determines if player 1 or player 2 is playing) is NOT updated, causing the following things : - . current player score will ALWAYS be dusplayed under player 1 + . current player score will ALWAYS be displayed under player 1 . when cabinet is set to "Cocktail", player 2 uses player 1 inputs * patched command 0x38 : laser position does NOT change according to player position (it ALWATS starts from the middle of the screen) @@ -789,7 +789,7 @@ void slapfght_state::init_getstarb1() init_banks(); /* requires this or it gets stuck with 'rom test' on screen */ - /* it is possible the program roms are slighly corrupt like the gfx roms, or + /* it is possible the program roms are slightly corrupt like the gfx roms, or that the bootleg simply shouldn't execute the code due to the modified roms */ /* TODO: find & fix the cause of the following happening. */ uint8_t *ROM = memregion("maincpu")->base(); @@ -1181,19 +1181,19 @@ ROM_END /* -Tiger Heli +Tiger-Heli 1985 Taito Corporation -The Tiger Heli PCB is almost exactly the same PCB as Slap Fight/Alcon but a few chips +The Tiger-Heli PCB is almost exactly the same PCB as Slap Fight/Alcon but a few chips have different placings and there's more EPROM locations on one of the boards (although they're not populated). -Also, Tiger Heli has a 22-way edge connector, while Alcon/Slap Fight is JAMMA. +Also, Tiger-Heli has a 22-way edge connector, while Alcon/Slap Fight is JAMMA. PCB Layouts - Top Board ----------------------- -Tiger Heli - M6100111A +Tiger-Heli - M6100111A 850011401 GX-511-A MADE IN JAPAN @@ -1636,7 +1636,7 @@ ROM_END This set comes from a different type of board with unique Taito ID code of "A76" PCBs are labeled GX-006-A & GX-006-B It has a 22pin edge connector and closely -resembles the Tigher Heli PCB (shown above) with rom placement and components. +resembles the Tiger-Heli PCB (shown above) with rom placement and components. */ @@ -1813,7 +1813,7 @@ ROM_END Guardian 1986 Taito Corporation -The Guardian PCB is exactly the same PCB as Tiger Heli, including the +The Guardian PCB is exactly the same PCB as Tiger-Heli, including the edge connector pinout. PCB Layout @@ -2049,12 +2049,12 @@ ROM_END GAME( 1985, perfrman, 0, perfrman, perfrman, slapfght_state, empty_init, ROT270, "Toaplan / Data East Corporation", "Performan (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, perfrmanu, perfrman, perfrman, perfrman, slapfght_state, empty_init, ROT270, "Toaplan / Data East USA", "Performan (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, tigerh, 0, tigerh, tigerh, slapfght_state, empty_init, ROT270, "Toaplan / Taito America Corp.", "Tiger Heli (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, tigerhj, tigerh, tigerh, tigerh, slapfght_state, empty_init, ROT270, "Toaplan / Taito", "Tiger Heli (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, tigerhb1, tigerh, tigerhb1, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger Heli (bootleg set 1)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, tigerhb2, tigerh, tigerhb2, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger Heli (bootleg set 2)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, tigerhb3, tigerh, tigerhb2, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger Heli (bootleg set 3)", MACHINE_SUPPORTS_SAVE ) -GAME( 1985, tigerhb4, tigerh, tigerhb4, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger Heli (bootleg set 4)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // MCU not hooked up +GAME( 1985, tigerh, 0, tigerh, tigerh, slapfght_state, empty_init, ROT270, "Toaplan / Taito America Corp.", "Tiger-Heli (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, tigerhj, tigerh, tigerh, tigerh, slapfght_state, empty_init, ROT270, "Toaplan / Taito", "Tiger-Heli (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, tigerhb1, tigerh, tigerhb1, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger-Heli (bootleg set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, tigerhb2, tigerh, tigerhb2, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger-Heli (bootleg set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, tigerhb3, tigerh, tigerhb2, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger-Heli (bootleg set 3)", MACHINE_SUPPORTS_SAVE ) +GAME( 1985, tigerhb4, tigerh, tigerhb4, tigerh, slapfght_state, empty_init, ROT270, "bootleg", "Tiger-Heli (bootleg set 4)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // MCU not hooked up GAME( 1986, alcon, 0, slapfigh, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito America Corp.", "Alcon (US)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) GAME( 1986, slapfigh, alcon, slapfigh, slapfigh, slapfght_state, init_slapfigh, ROT270, "Toaplan / Taito", "Slap Fight (A77 set, 8606M PCB)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) diff --git a/src/mame/drivers/sm7238.cpp b/src/mame/drivers/sm7238.cpp index 9b86da964d7..0c33a4ddd5c 100644 --- a/src/mame/drivers/sm7238.cpp +++ b/src/mame/drivers/sm7238.cpp @@ -98,7 +98,7 @@ private: virtual void machine_reset() override; virtual void video_start() override; - required_device m_maincpu; + required_device m_maincpu; required_device m_nvram; required_device m_videobank; required_shared_ptr m_p_videoram; @@ -357,7 +357,7 @@ void sm7238_state::sm7238(machine_config &config) I8080(config, m_maincpu, 16.5888_MHz_XTAL/9); m_maincpu->set_addrmap(AS_PROGRAM, &sm7238_state::sm7238_mem); m_maincpu->set_addrmap(AS_IO, &sm7238_state::sm7238_io); - m_maincpu->set_irq_acknowledge_callback("pic8259", FUNC(pic8259_device::inta_cb)); + m_maincpu->in_inta_func().set("pic8259", FUNC(pic8259_device::acknowledge)); ADDRESS_MAP_BANK(config, "videobank").set_map(&sm7238_state::videobank_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x2000); diff --git a/src/mame/drivers/spg2xx_jakks.cpp b/src/mame/drivers/spg2xx_jakks.cpp index 705a580c288..70e0c3feeb5 100644 --- a/src/mame/drivers/spg2xx_jakks.cpp +++ b/src/mame/drivers/spg2xx_jakks.cpp @@ -124,7 +124,7 @@ void jakks_state::base_config(machine_config& config) m_maincpu->portc_in().set_ioport("P3"); m_maincpu->portc_out().set(FUNC(jakks_state::portc_w)); - I2CMEM(config, m_i2cmem, 0).set_data_size(0x200); + I2C_24C04(config, m_i2cmem, 0); // ? } void jakks_state::batman(machine_config &config) diff --git a/src/mame/drivers/spg2xx_jakks_gkr.cpp b/src/mame/drivers/spg2xx_jakks_gkr.cpp index f9f6b8258d7..b637ee8ddc6 100644 --- a/src/mame/drivers/spg2xx_jakks_gkr.cpp +++ b/src/mame/drivers/spg2xx_jakks_gkr.cpp @@ -447,7 +447,7 @@ void jakks_gkr_state::jakks_gkr(machine_config &config) void jakks_gkr_state::jakks_gkr_i2c(machine_config &config) { jakks_gkr(config); - I2CMEM(config, m_i2cmem, 0).set_data_size(0x200); + I2C_24C04(config, m_i2cmem, 0); // ? } diff --git a/src/mame/drivers/subsino2.cpp b/src/mame/drivers/subsino2.cpp index 206c9b3ab94..1fba689faff 100644 --- a/src/mame/drivers/subsino2.cpp +++ b/src/mame/drivers/subsino2.cpp @@ -37,7 +37,7 @@ To do: - humlan: empty reels when bonus image should scroll in via L0 scroll. The image (crown/fruits) is at y > 0x100 in the tilemap. - bishjan, new2001, humlan, saklove, squeenb: game is sometimes too fast (can bishjan read the VBLANK state? saklove and xplan can). - xtrain: it runs faster than a video from the real thing. It doesn't use vblank irqs (but reads the vblank bit). -- mtrain: implement hopper. Double up does not work? +- mtrain: implement hopper. - xplan: starts with 4 credits, no controls to move the aircraft ************************************************************************************************************/ @@ -1915,8 +1915,8 @@ static INPUT_PORTS_START( mtrain ) PORT_DIPSETTING( 0x40, "30k" ) PORT_DIPSETTING( 0x60, "60k" ) PORT_DIPNAME( 0x80, 0x80, "Double Up" ) PORT_DIPLOCATION("SW2:8") - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x80, DEF_STR( No ) ) PORT_START("DSW3") PORT_DIPNAME( 0x07, 0x07, "Win Rate" ) PORT_DIPLOCATION("SW3:1,2,3") @@ -1991,10 +1991,10 @@ static INPUT_PORTS_START( mtrain ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // key out PORT_START("IN C") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop 3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_NAME("Stop 3 / Small") PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2 / Big") PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_NAME("Stop 1 / Take") diff --git a/src/mame/drivers/super80.cpp b/src/mame/drivers/super80.cpp index 1f3db3b0983..93e2f3ee5a9 100644 --- a/src/mame/drivers/super80.cpp +++ b/src/mame/drivers/super80.cpp @@ -2,7 +2,7 @@ // copyright-holders:Robbbert /***************************************************************************** -Super80.c written by Robbbert, 2005-2010. +Super80.cpp written by Robbbert, 2005-2010. 2010-12-19: Added V3.7 bios freshly dumped today. 2014-04-28: Added disk system and did cleanups @@ -173,11 +173,6 @@ are high, and /M1 is active. This particular combination occurs on all ROM varia fifth byte in the ROM. In reality, the switchover can take place any time between the 4th byte until the computer has booted up. This is because the low RAM does not contain any system areas. -Since MAME does not emulate /M1, a banking scheme has had to be used. Bank 0 is normal RAM. Bank 1 -points to the ROMs. When a machine reset occurs, bank 1 is switched in. A timer is triggered, and -after 4 bytes are read, bank 0 is selected. The timer is as close as can be to real operation of the -hardware. - Super80 disk WD2793, Z80DMA: @@ -207,7 +202,6 @@ Port(hex) Role Comment ToDo: - Fix Paste: Shift operates randomly (only super80m is suitable, the others drop characters because of the horrible inline editor they use) -- Disk system works, only connected to super80r atm - is it needed for super80v? ***********************************************************************************************************/ @@ -864,6 +858,7 @@ void super80v_state::super80v(machine_config &config) // software list SOFTWARE_LIST(config, "cass_list").set_original("super80_cass").set_filter("V"); + SOFTWARE_LIST(config, "flop_list").set_original("super80_flop"); } void super80r_state::super80r(machine_config &config) @@ -989,9 +984,10 @@ ROM_START( super80v ) ROM_END /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ -COMP( 1981, super80, 0, 0, super80, super80, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (V1.2)" , 0) -COMP( 1981, super80d, super80, 0, super80d, super80d, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (V2.2)" , 0) -COMP( 1981, super80e, super80, 0, super80e, super80d, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (El Graphix 4)" , MACHINE_UNOFFICIAL) -COMP( 1981, super80m, super80, 0, super80m, super80m, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (with colour)" , MACHINE_UNOFFICIAL) -COMP( 1981, super80r, super80, 0, super80r, super80r, super80r_state, empty_init, "Dick Smith Electronics", "Super-80 (with VDUEB)" , MACHINE_UNOFFICIAL) -COMP( 1981, super80v, super80, 0, super80v, super80v, super80v_state, empty_init, "Dick Smith Electronics", "Super-80 (with enhanced VDUEB)" , MACHINE_UNOFFICIAL) +COMP( 1981, super80, 0, 0, super80, super80, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (V1.2)" , MACHINE_SUPPORTS_SAVE ) +COMP( 1981, super80d, super80, 0, super80d, super80d, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (V2.2)" , MACHINE_SUPPORTS_SAVE ) +COMP( 1981, super80e, super80, 0, super80e, super80d, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (El Graphix 4)" , MACHINE_UNOFFICIAL | MACHINE_SUPPORTS_SAVE ) +COMP( 1981, super80m, super80, 0, super80m, super80m, super80_state, empty_init, "Dick Smith Electronics", "Super-80 (with colour)" , MACHINE_UNOFFICIAL | MACHINE_SUPPORTS_SAVE ) +COMP( 1981, super80r, super80, 0, super80r, super80r, super80r_state, empty_init, "Dick Smith Electronics", "Super-80 (with VDUEB)" , MACHINE_UNOFFICIAL | MACHINE_SUPPORTS_SAVE ) +COMP( 1981, super80v, super80, 0, super80v, super80v, super80v_state, empty_init, "Dick Smith Electronics", "Super-80 (with enhanced VDUEB)" , MACHINE_UNOFFICIAL | MACHINE_SUPPORTS_SAVE ) + diff --git a/src/mame/drivers/tdv2324.cpp b/src/mame/drivers/tdv2324.cpp index a5add5199fa..a57544fdd68 100644 --- a/src/mame/drivers/tdv2324.cpp +++ b/src/mame/drivers/tdv2324.cpp @@ -267,9 +267,10 @@ static void tdv2324_floppies(device_slot_interface &device) void tdv2324_state::tdv2324(machine_config &config) { // basic system hardware - I8085A(config, m_maincpu, 8700000/2); // ??? - m_maincpu->set_addrmap(AS_PROGRAM, &tdv2324_state::tdv2324_mem); - m_maincpu->set_addrmap(AS_IO, &tdv2324_state::tdv2324_io); + i8085a_cpu_device &maincpu(I8085A(config, m_maincpu, 8700000/2)); // ??? + maincpu.set_addrmap(AS_PROGRAM, &tdv2324_state::tdv2324_mem); + maincpu.set_addrmap(AS_IO, &tdv2324_state::tdv2324_io); + maincpu.in_inta_func().set(P8259A_TAG, FUNC(pic8259_device::acknowledge)); I8085A(config, m_subcpu, 8000000/2); // ??? m_subcpu->set_addrmap(AS_PROGRAM, &tdv2324_state::tdv2324_sub_mem); diff --git a/src/mame/drivers/tempest.cpp b/src/mame/drivers/tempest.cpp index 0b3f08575cb..ea741eeae87 100644 --- a/src/mame/drivers/tempest.cpp +++ b/src/mame/drivers/tempest.cpp @@ -278,6 +278,7 @@ Note: Roms for Tempest Analog Vector-Generator PCB Assembly A037383-03 or A03738 #include "emu.h" #include "cpu/m6502/m6502.h" #include "machine/mathbox.h" +#include "machine/rescap.h" #include "machine/watchdog.h" #include "video/avgdvg.h" #include "video/vector.h" diff --git a/src/mame/drivers/tunhunt.cpp b/src/mame/drivers/tunhunt.cpp index ce56dbdd969..b425aec34e6 100644 --- a/src/mame/drivers/tunhunt.cpp +++ b/src/mame/drivers/tunhunt.cpp @@ -49,6 +49,7 @@ #include "includes/tunhunt.h" #include "cpu/m6502/m6502.h" +#include "machine/rescap.h" #include "sound/pokey.h" #include "speaker.h" diff --git a/src/mame/drivers/twinkle.cpp b/src/mame/drivers/twinkle.cpp index 41e1d251004..30f917b65cf 100644 --- a/src/mame/drivers/twinkle.cpp +++ b/src/mame/drivers/twinkle.cpp @@ -1115,7 +1115,7 @@ void twinkle_state::twinklex(machine_config &config) void twinkle_state::twinklei(machine_config &config) { twinkle(config); - I2CMEM(config, "security", 0).set_data_size(0x100); + I2C_M24C02(config, "security", 0); // M24C02-W } static INPUT_PORTS_START( twinkle ) diff --git a/src/mame/drivers/vgmplay.cpp b/src/mame/drivers/vgmplay.cpp index d6b80d4b0e4..c45c5c39c2d 100644 --- a/src/mame/drivers/vgmplay.cpp +++ b/src/mame/drivers/vgmplay.cpp @@ -126,6 +126,14 @@ enum vgm_chip CT_COUNT, }; +enum C140_TYPE +{ + C140_LINEAR = 0, + C140_SYSTEM2, + C140_SYSTEM21, + C140_ASIC219 +}; + class vgmplay_device : public cpu_device { public: @@ -250,7 +258,8 @@ public: template DECLARE_READ8_MEMBER(upd7759_rom_r); template DECLARE_READ8_MEMBER(okim6295_rom_r); template DECLARE_READ8_MEMBER(k054539_rom_r); - template DECLARE_READ8_MEMBER(c140_rom_r); + template DECLARE_READ16_MEMBER(c140_rom_r); + template DECLARE_READ16_MEMBER(c219_rom_r); template DECLARE_READ8_MEMBER(k053260_rom_r); template DECLARE_READ8_MEMBER(qsound_rom_r); template DECLARE_READ8_MEMBER(es5505_rom_r); @@ -267,6 +276,9 @@ public: template DECLARE_WRITE8_MEMBER(okim6295_bank_w); template DECLARE_WRITE8_MEMBER(okim6295_nmk112_bank_w); + void set_c140_bank_type(int index, C140_TYPE type); + C140_TYPE c140_bank(int index) { return m_c140_bank[index]; } + void stop(); void pause(); bool paused() const { return m_paused; } @@ -379,6 +391,8 @@ private: uint32_t m_okim6295_bank[2]; uint32_t m_okim6295_nmk112_bank[2][4]; + C140_TYPE m_c140_bank[2]; + int m_sega32x_channel_hack; int m_nes_apu_channel_hack[2]; uint8_t m_c6280_channel[2]; @@ -419,6 +433,7 @@ public: template DECLARE_WRITE8_MEMBER(okim6295_clock_w); template DECLARE_WRITE8_MEMBER(okim6295_pin7_w); template DECLARE_WRITE8_MEMBER(scc_w); + template DECLARE_WRITE8_MEMBER(c140_c219_w); void vgmplay(machine_config &config); void file_map(address_map &map); @@ -440,6 +455,7 @@ public: template void okim6295_map(address_map &map); template void k054539_map(address_map &map); template void c140_map(address_map &map); + template void c219_map(address_map &map); template void k053260_map(address_map &map); template void qsound_map(address_map &map); template void scsp_map(address_map &map); @@ -488,6 +504,7 @@ private: required_device_array m_k054539; required_device_array m_huc6280; required_device_array m_c140; + required_device_array m_c219; required_device_array m_k053260; required_device_array m_pokey; required_device m_qsound; @@ -2515,9 +2532,31 @@ READ8_MEMBER(vgmplay_device::k054539_rom_r) } template -READ8_MEMBER(vgmplay_device::c140_rom_r) +READ16_MEMBER(vgmplay_device::c140_rom_r) { - return rom_r(Index, 0x8d, offset); + switch (m_c140_bank[Index]) + { + case C140_SYSTEM2: + offset = ((offset & 0x200000) >> 2) | (offset & 0x7ffff); + return rom_r(Index, 0x8d, offset) << 8; // high 8 bit only + case C140_SYSTEM21: + offset = ((offset & 0x300000) >> 1) | (offset & 0x7ffff); + return rom_r(Index, 0x8d, offset) << 8; // high 8 bit only + case C140_ASIC219: + return 0; // c140 not used in this mode + default: + return (rom_r(Index, 0x8d, offset * 2 + 1) << 8) | rom_r(Index, 0x8d, offset * 2); // 8 bit sample + } + return 0; +} + +template +READ16_MEMBER(vgmplay_device::c219_rom_r) +{ + if (m_c140_bank[Index] == C140_ASIC219) + return (rom_r(Index, 0x8d, offset * 2 + 1) << 8) | rom_r(Index, 0x8d, offset * 2); // 8 bit sample + + return 0; } template @@ -2591,6 +2630,7 @@ vgmplay_state::vgmplay_state(const machine_config &mconfig, device_type type, co , m_k054539(*this, "k054539.%d", 0) , m_huc6280(*this, "huc6280.%d", 0) , m_c140(*this, "c140.%d", 0) + , m_c219(*this, "c219.%d", 0) , m_k053260(*this, "k053260.%d", 0) , m_pokey(*this, "pokey.%d", 0) , m_qsound(*this, "qsound") @@ -2642,20 +2682,25 @@ static const uint8_t vgm_ay8910_flags(uint8_t vgm_flags) return flags; } -static const c140_device::C140_TYPE c140_bank_type(uint8_t vgm_type) +static const C140_TYPE c140_bank_type(uint8_t vgm_type) { switch (vgm_type) { case 0: default: - return c140_device::C140_TYPE::SYSTEM2; + return C140_SYSTEM2; case 1: - return c140_device::C140_TYPE::SYSTEM21; + return C140_SYSTEM21; case 2: - return c140_device::C140_TYPE::ASIC219; + return C140_ASIC219; } } +void vgmplay_device::set_c140_bank_type(int index, C140_TYPE type) +{ + m_c140_bank[index] = type; +} + QUICKLOAD_LOAD_MEMBER(vgmplay_state::load_file) { m_vgmplay->stop(); @@ -2874,8 +2919,9 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state::load_file) m_k054539[0]->init_flags(version >= 0x161 && header_size >= 0x96 ? r8(0x95) : 0); m_k054539[1]->init_flags(version >= 0x161 && header_size >= 0x96 ? r8(0x95) : 0); - m_c140[0]->set_bank_type(c140_bank_type(version >= 0x161 && header_size >= 0x96 ? r8(0x96) : 0)); - m_c140[1]->set_bank_type(c140_bank_type(version >= 0x161 && header_size >= 0x96 ? r8(0x96) : 0)); + C140_TYPE c140_type = c140_bank_type(version >= 0x161 && header_size >= 0x96 ? r8(0x96) : 0); + m_vgmplay->set_c140_bank_type(0, c140_type); + m_vgmplay->set_c140_bank_type(1, c140_type); m_okim6295_pin7[0] = setup_device(*m_okim6295[0], 0, CT_OKIM6295, 0x98, 0x161); m_okim6295_pin7[1] = setup_device(*m_okim6295[1], 1, CT_OKIM6295, 0x98, 0x161); @@ -2901,8 +2947,16 @@ QUICKLOAD_LOAD_MEMBER(vgmplay_state::load_file) setup_device(*m_huc6280[0], 0, CT_C6280, 0xa4, 0x161); setup_device(*m_huc6280[1], 1, CT_C6280, 0xa4, 0x161); - setup_device(*m_c140[0], 0, CT_C140, 0xa8, 0x161); - setup_device(*m_c140[1], 1, CT_C140, 0xa8, 0x161); + if (c140_type == C140_ASIC219) + { + setup_device(*m_c219[0], 0, CT_C140, 0xa8, 0x161); + setup_device(*m_c219[1], 1, CT_C140, 0xa8, 0x161); + } + else + { + setup_device(*m_c140[0], 0, CT_C140, 0xa8, 0x161); + setup_device(*m_c140[1], 1, CT_C140, 0xa8, 0x161); + } setup_device(*m_k053260[0], 0, CT_K053260, 0xac, 0x161); setup_device(*m_k053260[1], 1, CT_K053260, 0xac, 0x161); setup_device(*m_pokey[0], 0, CT_POKEY, 0xb0, 0x161); @@ -3147,6 +3201,15 @@ WRITE8_MEMBER(vgmplay_state::scc_w) } } +template +WRITE8_MEMBER(vgmplay_state::c140_c219_w) +{ + if (m_vgmplay->c140_bank(Index) == C140_ASIC219) + m_c219[Index]->c219_w(offset, data); + else + m_c140[Index]->c140_w(offset, data); +} + INPUT_CHANGED_MEMBER(vgmplay_state::key_pressed) { if (!newval && param != VGMPLAY_HOLD) @@ -3306,8 +3369,8 @@ void vgmplay_state::soundchips_map(address_map &map) map(vgmplay_device::A_K054539_1, vgmplay_device::A_K054539_1 + 0x22f).w(m_k054539[1], FUNC(k054539_device::write)); map(vgmplay_device::A_C6280_0, vgmplay_device::A_C6280_0 + 0xf).w("huc6280.0:psg", FUNC(c6280_device::c6280_w)); map(vgmplay_device::A_C6280_1, vgmplay_device::A_C6280_1 + 0xf).w("huc6280.1:psg", FUNC(c6280_device::c6280_w)); - map(vgmplay_device::A_C140_0, vgmplay_device::A_C140_0 + 0x1ff).w(m_c140[0], FUNC(c140_device::c140_w)); - map(vgmplay_device::A_C140_1, vgmplay_device::A_C140_1 + 0x1ff).w(m_c140[1], FUNC(c140_device::c140_w)); + map(vgmplay_device::A_C140_0, vgmplay_device::A_C140_0 + 0x1ff).w(FUNC(vgmplay_state::c140_c219_w<0>)); + map(vgmplay_device::A_C140_1, vgmplay_device::A_C140_1 + 0x1ff).w(FUNC(vgmplay_state::c140_c219_w<1>)); map(vgmplay_device::A_K053260_0, vgmplay_device::A_K053260_0 + 0x2f).w(m_k053260[0], FUNC(k053260_device::write)); map(vgmplay_device::A_K053260_1, vgmplay_device::A_K053260_1 + 0x2f).w(m_k053260[1], FUNC(k053260_device::write)); map(vgmplay_device::A_POKEY_0, vgmplay_device::A_POKEY_0 + 0xf).w(m_pokey[0], FUNC(pokey_device::write)); @@ -3430,7 +3493,13 @@ void vgmplay_state::k054539_map(address_map &map) template void vgmplay_state::c140_map(address_map &map) { - map(0, 0x1fffff).r("vgmplay", FUNC(vgmplay_device::c140_rom_r)); + map(0, 0x1ffffff).r("vgmplay", FUNC(vgmplay_device::c140_rom_r)); +} + +template +void vgmplay_state::c219_map(address_map &map) +{ + map(0, 0x07ffff).r("vgmplay", FUNC(vgmplay_device::c219_rom_r)); } template @@ -3804,6 +3873,16 @@ void vgmplay_state::vgmplay(machine_config &config) m_c140[1]->add_route(0, m_mixer, 0.50, AUTO_ALLOC_INPUT, 0); m_c140[1]->add_route(1, m_mixer, 0.50, AUTO_ALLOC_INPUT, 1); + C219(config, m_c219[0], 0); + m_c219[0]->set_addrmap(0, &vgmplay_state::c219_map<0>); + m_c219[0]->add_route(0, m_mixer, 0.50, AUTO_ALLOC_INPUT, 0); + m_c219[0]->add_route(1, m_mixer, 0.50, AUTO_ALLOC_INPUT, 1); + + C219(config, m_c219[1], 0); + m_c219[1]->set_addrmap(0, &vgmplay_state::c219_map<1>); + m_c219[1]->add_route(0, m_mixer, 0.50, AUTO_ALLOC_INPUT, 0); + m_c219[1]->add_route(1, m_mixer, 0.50, AUTO_ALLOC_INPUT, 1); + K053260(config, m_k053260[0], 0); m_k053260[0]->set_addrmap(0, &vgmplay_state::k053260_map<0>); m_k053260[0]->add_route(0, m_mixer, 1, AUTO_ALLOC_INPUT, 0); diff --git a/src/mame/drivers/videopin.cpp b/src/mame/drivers/videopin.cpp index d10b44855bf..06b2bd74b9b 100644 --- a/src/mame/drivers/videopin.cpp +++ b/src/mame/drivers/videopin.cpp @@ -393,6 +393,8 @@ void videopin_state::videopin(machine_config &config) * *************************************/ +// This is PCB revision -01 (older version) with 16 PROMs (1024x4) +// A later undumped revision (still marked -01) only had 8 PROMs (2048x4) ROM_START( videopin ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD_NIB_LOW ( "34242-01.e0", 0x2000, 0x0400, CRC(c6a83795) SHA1(73a65cca7c1e337b336b7d515eafc2981e669be8) ) @@ -425,6 +427,26 @@ ROM_START( videopin ) ROM_LOAD( "9402-01.h4", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* sync */ ROM_END +// This is an even later revision (marked -02) with 4 EPROMs (4096x8 according to manual, while 2048x8 in reality) +ROM_START( videopina ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "034253-01.m0", 0x2000, 0x0800, CRC(981b5986) SHA1(78ca6dc1b968529e23796884aa461e71bf7f9a48) ) + ROM_LOAD( "034254-01.h2", 0x2800, 0x0800, CRC(c3eebf23) SHA1(e9a0e2bf71a5131a8317ad40c1c56f84b5ae1643) ) + ROM_LOAD( "034255-01.j2", 0x3000, 0x0800, CRC(5565ae42) SHA1(4a9f376650684217d523d3378a5852aaa9fdfedc) ) + ROM_LOAD( "034256-01.k2", 0x3800, 0x0800, CRC(9f24428c) SHA1(df35225afebb4cc18a593ec665e94f677b3606ee) ) + ROM_COPY( "maincpu" , 0x3c00, 0xfc00, 0x400 ) + + ROM_REGION( 0x0200, "gfx1", 0 ) // tiles + ROM_LOAD_NIB_LOW ( "34259-01.d5", 0x0000, 0x0200, CRC(6cd98c06) SHA1(48bf077b7abbd2f529a19bdf85700b93014f39f9) ) + ROM_LOAD_NIB_HIGH( "34258-01.c5", 0x0000, 0x0200, CRC(91a5f117) SHA1(03ac6b0b3da0ed5faf1ba6695d16918d12ceeff5) ) + + ROM_REGION( 0x0020, "gfx2", 0 ) // ball + ROM_LOAD( "34257-01.m1", 0x0000, 0x0020, CRC(50245866) SHA1(b0692bc8d44f127f6e7182a1ce75a785e22ac5b9) ) + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "9402-01.h4", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) // sync +ROM_END + ROM_START( solarwar ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD_NIB_LOW ( "36159-01.e0", 0x2000, 0x0400, CRC(0db9f0fc) SHA1(191429a25b43727694f75c0ae9cbff705fbc4d77) ) @@ -464,5 +486,6 @@ ROM_END * *************************************/ -GAMEL( 1979, videopin, 0, videopin, videopin, videopin_state, empty_init, ROT270, "Atari", "Video Pinball", MACHINE_SUPPORTS_SAVE, layout_videopin ) -GAMEL( 1979, solarwar, 0, videopin, solarwar, videopin_state, empty_init, ROT270, "Atari", "Solar War", MACHINE_SUPPORTS_SAVE, layout_videopin ) +GAMEL( 1979, videopin, 0, videopin, videopin, videopin_state, empty_init, ROT270, "Atari", "Video Pinball (16 PROMs version)", MACHINE_SUPPORTS_SAVE, layout_videopin ) +GAMEL( 1979, videopina, videopin, videopin, videopin, videopin_state, empty_init, ROT270, "Atari", "Video Pinball (4 ROMs version)", MACHINE_SUPPORTS_SAVE, layout_videopin ) +GAMEL( 1979, solarwar, 0, videopin, solarwar, videopin_state, empty_init, ROT270, "Atari", "Solar War", MACHINE_SUPPORTS_SAVE, layout_videopin ) diff --git a/src/mame/drivers/vsmile.cpp b/src/mame/drivers/vsmile.cpp index 62de4a483b6..0e015f9eaef 100644 --- a/src/mame/drivers/vsmile.cpp +++ b/src/mame/drivers/vsmile.cpp @@ -191,7 +191,7 @@ static INPUT_PORTS_START( vsmile ) PORT_DIPSETTING( 0x04, "UK/US" ) PORT_DIPSETTING( 0x07, "China" ) PORT_DIPSETTING( 0x08, "Mexico" ) - PORT_DIPSETTING( 0x0a, "Italy" ) + PORT_DIPSETTING( 0x0a, "Italy" ) // not valid on V.Smile Motion? PORT_DIPSETTING( 0x0b, "Germany" ) PORT_DIPSETTING( 0x0c, "Spain" ) PORT_DIPSETTING( 0x0d, "France" ) @@ -201,6 +201,32 @@ static INPUT_PORTS_START( vsmile ) PORT_BIT( 0xe0, 0x00, IPT_UNUSED ) INPUT_PORTS_END +static INPUT_PORTS_START( vsmilem ) + PORT_START("REGION") + PORT_DIPNAME( 0x0f, 0x0f, "sysrom Region" ) + //PORT_DIPSETTING( 0x00, "0" ) // no V.Smile Motion logo, blank cartridge image, "Please insert a Learning Game" text + //PORT_DIPSETTING( 0x01, "1" ) // no V.Smile Motion logo, blank cartridge image, no text + PORT_DIPSETTING( 0x02, "Italy" ) // V.Smile Motion logo with "Active Learning System", voice 1, regular cartridge image, "Per favore inserisci una cartuccia di gioco" text (possibly invalid as text on logo is still in English and Italy was previously 0x0a) + //PORT_DIPSETTING( 0x03, "3" ) // V.Smile Motion logo with no text, voice 2, regular cartridge image, no text + //PORT_DIPSETTING( 0x04, "4" ) // V.Smile Motion logo with no text, voice 2, regular cartridge image, "Please insert a Learning Game" text + PORT_DIPSETTING( 0x05, "English (1)" ) // V.Smile Motion logo with "Active Learning System", voice 2, regular cartridge image, "Please insert a Learning Game" text + PORT_DIPSETTING( 0x06, "English (2)" ) // V.Smile Motion logo with "Active Learning System", voice 1, regular cartridge image, "Please insert a Learning Game" text + PORT_DIPSETTING( 0x07, "China" ) // V.Smile Motion logo with "Active Learning System", voice 1, regular cartridge image, Chinese text + PORT_DIPSETTING( 0x08, "Mexico" ) // V.Smile Motion logo with "Sistema Educativo", voice 1, regular cartridge image, "TV Learning System" text + PORT_DIPSETTING( 0x09, "Netherlands?" ) // V.Smile Motion logo with "Active Learning System", voice 3, regular cartridge image, "Plaats een game" + //PORT_DIPSETTING( 0x0a, "a" ) // V.Smile Motion logo with "Active Learning System", voice 1, regular cartridge image, "Please insert a Learning Game" text (was 'Italy' on regular vsmile) + PORT_DIPSETTING( 0x0b, "Germany" ) // V.Smile Motion logo with "Aktives Lernspiel - System", voice 4, regular cartridge image, "Bitte Lernspiel einstecken" + PORT_DIPSETTING( 0x0c, "Spain" ) // V.Smile Motion logo with "Aprendizaje Inteligente En Accion", voice 5, regular cartridge image, "Por favor, inserta un cartuncho" + PORT_DIPSETTING( 0x0d, "France" ) // V.Smile Motion logo with "Apprendre En Mouvements", voice 6, regular cartridge image, "Inserer une cartouche" + //PORT_DIPSETTING( 0x0e, "e" ) // V.Smile Motion logo with "Active Learning System", voice 1, regular cartridge image, "Please insert a Learning Game" text (same as 0x06?) + PORT_DIPSETTING( 0x0f, "English (3)" ) // V.Smile Motion logo with "Active Learning System", voice 2, regular cartridge image, "Please insert a Smartridge(tm)" text (Smartridge must be a region specific term?) + + PORT_DIPNAME( 0x10, 0x10, "VTech Intro" ) + PORT_DIPSETTING( 0x00, "Off" ) + PORT_DIPSETTING( 0x10, "On" ) + PORT_BIT( 0xe0, 0x00, IPT_UNUSED ) +INPUT_PORTS_END + /************************************ * * Machine Configs @@ -297,9 +323,9 @@ ROM_END ROM_START( vsmilem ) ROM_REGION16_BE( 0x800000, "sysrom", ROMREGION_ERASEFF ) - ROM_LOAD( "vsmilebios.bin", 0x000000, 0x200000, BAD_DUMP CRC(11f1b416) SHA1(11f77c4973d29c962567390e41879c86a759c93b) ) + ROM_LOAD16_WORD_SWAP( "vsmilemotion.bin", 0x000000, 0x200000, CRC(60fa5426) SHA1(91e0b7b44b975df65095d6ee622436d65fb1aca5) ) // from a Spanish unit (but doesn't seem region specific) ROM_END // year, name, parent, compat, machine, input, class, init, company, fullname, flags CONS( 2005, vsmile, 0, 0, vsmile, vsmile, vsmile_state, empty_init, "VTech", "V.Smile", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -CONS( 2008, vsmilem, vsmile, 0, vsmilem, vsmile, vsmilem_state, empty_init, "VTech", "V.Smile Motion (US)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +CONS( 2008, vsmilem, vsmile, 0, vsmilem, vsmilem, vsmilem_state, empty_init, "VTech", "V.Smile Motion", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) diff --git a/src/mame/drivers/vt1682.cpp b/src/mame/drivers/vt1682.cpp index 8791fbacba2..ae2e3653965 100644 --- a/src/mame/drivers/vt1682.cpp +++ b/src/mame/drivers/vt1682.cpp @@ -5487,7 +5487,7 @@ void vt_vt1682_state::vt_vt1682_palbase(machine_config& config) void vt_vt1682_state::vt_vt1682_common(machine_config& config) { TIMER(config, "scantimer").configure_scanline(FUNC(vt_vt1682_state::scanline), "screen", 0, 1); - TIMER(config, m_render_timer).configure_periodic(FUNC(vt_vt1682_state::line_render_start), attotime::never); + TIMER(config, m_render_timer).configure_generic(FUNC(vt_vt1682_state::line_render_start)); VT_VT1682_ALU(config, m_maincpu_alu, 0); VT_VT1682_ALU(config, m_soundcpu_alu, 0); diff --git a/src/mame/drivers/vta2000.cpp b/src/mame/drivers/vta2000.cpp index 23e2226eafe..4c5fa46565e 100644 --- a/src/mame/drivers/vta2000.cpp +++ b/src/mame/drivers/vta2000.cpp @@ -52,7 +52,7 @@ private: void io_map(address_map &map); virtual void machine_reset() override; - required_device m_maincpu; + required_device m_maincpu; required_device m_mainpit; required_device m_speaker; required_shared_ptr m_p_videoram; @@ -186,7 +186,7 @@ void vta2000_state::vta2000(machine_config &config) I8080(config, m_maincpu, XTAL(4'000'000) / 4); m_maincpu->set_addrmap(AS_PROGRAM, &vta2000_state::mem_map); m_maincpu->set_addrmap(AS_IO, &vta2000_state::io_map); - m_maincpu->set_irq_acknowledge_callback("pic", FUNC(pic8259_device::inta_cb)); + m_maincpu->in_inta_func().set("pic", FUNC(pic8259_device::acknowledge)); PIT8253(config, m_mainpit, 0); m_mainpit->set_clk<0>(500'000); diff --git a/src/mame/drivers/williams.cpp b/src/mame/drivers/williams.cpp index 28e192f5d58..1a747643f48 100644 --- a/src/mame/drivers/williams.cpp +++ b/src/mame/drivers/williams.cpp @@ -755,7 +755,7 @@ void williams2_state::sound_map(address_map &map) * *************************************/ -static INPUT_PORTS_START( monitor_controls ) +static INPUT_PORTS_START( monitor_controls_mysticm ) PORT_START("REDG") PORT_ADJUSTER( 80, "Monitor Gain Red" ) PORT_MINMAX(0, 250) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 0) PORT_START("GREENG") @@ -770,6 +770,20 @@ static INPUT_PORTS_START( monitor_controls ) PORT_ADJUSTER( 78, "Monitor Offset Blue" ) PORT_MINMAX(0, 200) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 5) INPUT_PORTS_END +static INPUT_PORTS_START( monitor_controls ) + PORT_START("REDG") + PORT_ADJUSTER( 25, "Monitor Gain Red" ) PORT_MINMAX(0, 250) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 0) + PORT_START("GREENG") + PORT_ADJUSTER( 25, "Monitor Gain Green" ) PORT_MINMAX(0, 250) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 1) + PORT_START("BLUEG") + PORT_ADJUSTER( 25, "Monitor Gain Blue" ) PORT_MINMAX(0, 250) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 2) + PORT_START("REDO") + PORT_ADJUSTER(100, "Monitor Offset Red" ) PORT_MINMAX(0, 200) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 3) + PORT_START("GREENO") + PORT_ADJUSTER(100, "Monitor Offset Green" ) PORT_MINMAX(0, 200) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 4) + PORT_START("BLUEO") + PORT_ADJUSTER(100, "Monitor Offset Blue" ) PORT_MINMAX(0, 200) PORT_CHANGED_MEMBER(DEVICE_SELF, mysticm_state, rgb_gain, 5) +INPUT_PORTS_END static INPUT_PORTS_START( defender ) PORT_START("IN0") @@ -1357,7 +1371,7 @@ static INPUT_PORTS_START( mysticm ) PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_TILT ) PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_INCLUDE(monitor_controls) + PORT_INCLUDE(monitor_controls_mysticm) INPUT_PORTS_END diff --git a/src/mame/drivers/xavix.cpp b/src/mame/drivers/xavix.cpp index 50ce2923ff8..7e611c8d655 100644 --- a/src/mame/drivers/xavix.cpp +++ b/src/mame/drivers/xavix.cpp @@ -1562,25 +1562,18 @@ void xavix_guru_state::xavix_guru(machine_config &config) } -void xavix_i2c_state::xavix_i2c_24lc02(machine_config &config) -{ - xavix(config); - - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02 (taiko) -} - void xavix_i2c_state::xavix_i2c_24c02(machine_config &config) { xavix(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24C02 + I2C_24C02(config, "i2cmem", 0); } void xavix_i2c_state::xavix_i2c_24lc04(machine_config &config) { xavix(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24LC04 on Nostalgia games, 24C04 on others + I2C_24C04(config, "i2cmem", 0); // 24LC04 on Nostalgia games, 24C04 on others } void xavix_i2c_ltv_tam_state::xavix_i2c_24lc04_tam(machine_config &config) @@ -1597,7 +1590,7 @@ void xavix_i2c_state::xavix_i2c_24c08(machine_config &config) { xavix(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x400); // 24C08 (Excite Fishing DX) + I2C_24C08(config, "i2cmem", 0); } void xavix_state::xavixp(machine_config &config) @@ -1654,9 +1647,7 @@ void xavix_state::xavix2002(machine_config &config) void xavix_i2c_jmat_state::xavix2002_i2c_jmat(machine_config &config) { - xavix2002(config); - - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // ? + xavix2002_i2c_24c04(config); m_xavix2002io->read_0_callback().set(FUNC(xavix_i2c_jmat_state::read_extended_io0)); m_xavix2002io->write_0_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io0)); @@ -1688,14 +1679,14 @@ void xavix_i2c_state::xavix2000_i2c_24c04(machine_config &config) { xavix2000(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24C04 + I2C_24C04(config, "i2cmem", 0); } void xavix_i2c_state::xavix2000_i2c_24c02(machine_config &config) { xavix2000(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24C02 + I2C_24C02(config, "i2cmem", 0); } void xavix_mtrk_state::xavix_mtrk(machine_config &config) @@ -1733,7 +1724,7 @@ void xavix_i2c_cart_state::xavix_i2c_taiko(machine_config &config) { xavix_cart(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02 + I2C_24C02(config, "i2cmem", 0); // 24LC02 SOFTWARE_LIST(config, "cart_list_japan_d").set_original("ekara_japan_d"); SOFTWARE_LIST(config, "cart_list_japan_sp").set_original("ekara_japan_sp"); @@ -1745,7 +1736,7 @@ void xavix_i2c_cart_state::xavix_i2c_jpopira(machine_config &config) NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24LC02 + I2C_24C02(config, "i2cmem", 0); // 24LC02 SOFTWARE_LIST(config, "cart_list_jpopira_jp").set_original("jpopira_jp"); // NOTE, these are for Jumping Popira only, they don't work with the karaoke or regular popira units SOFTWARE_LIST(config, "cart_list_japan_sp").set_original("ekara_japan_sp"); @@ -1856,14 +1847,14 @@ void xavix_i2c_state::xavix2002_i2c_24c04(machine_config &config) { xavix2002(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x200); // 24C04 + I2C_24C04(config, "i2cmem", 0); } void xavix_i2c_state::xavix2002_i2c_mrangbat(machine_config &config) { xavix2002(config); - I2CMEM(config, "i2cmem", 0).set_page_size(16).set_data_size(0x100); // 24C02? + I2C_24C02(config, "i2cmem", 0); // 24C02? m_xavix2002io->read_0_callback().set_ioport("EX0"); //m_xavix2002io->write_0_callback().set(FUNC(xavix_i2c_jmat_state::write_extended_io0)); diff --git a/src/mame/includes/circus.h b/src/mame/includes/circus.h index d081c378530..80b439aee0e 100644 --- a/src/mame/includes/circus.h +++ b/src/mame/includes/circus.h @@ -24,6 +24,22 @@ public: m_palette(*this, "palette") { } + void robotbwl(machine_config &config); + void ripcord(machine_config &config); + void crash(machine_config &config); + void circus(machine_config &config); + + void init_ripcord(); + void init_circus(); + void init_robotbwl(); + void init_crash(); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: /* memory pointers */ required_shared_ptr m_videoram; @@ -42,19 +58,12 @@ public: /* game id */ int m_game_id; - DECLARE_READ8_MEMBER(circus_paddle_r); - DECLARE_WRITE8_MEMBER(circus_videoram_w); - DECLARE_WRITE8_MEMBER(circus_clown_x_w); - DECLARE_WRITE8_MEMBER(circus_clown_y_w); - DECLARE_WRITE8_MEMBER(circus_clown_z_w); - void init_ripcord(); - void init_circus(); - void init_robotbwl(); - void init_crash(); + uint8_t circus_paddle_r(); + void circus_videoram_w(offs_t offset, uint8_t data); + void circus_clown_x_w(uint8_t data); + void circus_clown_y_w(uint8_t data); + void circus_clown_z_w(uint8_t data); TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; uint32_t screen_update_circus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_robotbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_crash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -68,10 +77,6 @@ public: void robotbwl_draw_bowling_alley( bitmap_ind16 &bitmap, const rectangle &cliprect ); void robotbwl_draw_ball( bitmap_ind16 &bitmap, const rectangle &cliprect ); void crash_draw_car( bitmap_ind16 &bitmap, const rectangle &cliprect ); - void robotbwl(machine_config &config); - void ripcord(machine_config &config); - void crash(machine_config &config); - void circus(machine_config &config); void circus_map(address_map &map); }; /*----------- defined in audio/circus.c -----------*/ diff --git a/src/mame/includes/coco.h b/src/mame/includes/coco.h index 55b9dacb39c..9395615ef8c 100644 --- a/src/mame/includes/coco.h +++ b/src/mame/includes/coco.h @@ -34,6 +34,7 @@ INPUT_PORTS_EXTERN( coco_analog_control ); INPUT_PORTS_EXTERN( coco_joystick ); INPUT_PORTS_EXTERN( coco_rtc ); INPUT_PORTS_EXTERN( coco_beckerport ); +INPUT_PORTS_EXTERN( coco_beckerport_dw ); void coco_cart(device_slot_interface &device); diff --git a/src/mame/includes/dragon.h b/src/mame/includes/dragon.h index 5e69c4f6ee6..498c00e5ead 100644 --- a/src/mame/includes/dragon.h +++ b/src/mame/includes/dragon.h @@ -69,6 +69,7 @@ public: void dragon64(machine_config &config); void tanodr64h(machine_config &config); void dragon64h(machine_config &config); + DECLARE_WRITE_LINE_MEMBER( acia_irq ); protected: void d64_rom0(address_map &map); void d64_rom1(address_map &map); diff --git a/src/mame/includes/kikikai.h b/src/mame/includes/kikikai.h index 588a33b7354..ff3e5cc9e8f 100644 --- a/src/mame/includes/kikikai.h +++ b/src/mame/includes/kikikai.h @@ -13,81 +13,66 @@ class kikikai_state : public driver_device public: kikikai_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_mcu_sharedram(*this, "mcu_sharedram"), - m_mainram(*this, "mainram"), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), + m_screen(*this, "screen"), + m_mcu_sharedram(*this, "mcu_sharedram"), + m_mainram(*this, "mainram"), m_subcpu(*this, "sub"), m_mcu(*this, "mcu"), - m_68705mcu(*this, "68705mcu"), m_ymsnd(*this, "ymsnd"), m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_screen(*this, "screen") + m_palette(*this, "palette") { } - void knightb(machine_config &config); - void mexico86(machine_config &config); - void mexico86_68705(machine_config &config); - void kikikai(machine_config &config); + void base(machine_config &config); void kicknrun(machine_config &config); +protected: + required_device m_maincpu; + required_device m_audiocpu; + required_device m_screen; + required_shared_ptr m_mcu_sharedram; + + u32 screen_update_kicknrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update_kikikai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + virtual void machine_start() override; + virtual void machine_reset() override; + private: /* memory pointers */ - required_shared_ptr m_mcu_sharedram; required_shared_ptr m_mainram; /* video-related */ int m_charbank; - /* mcu */ - /* mexico86 68705 protection */ - u8 m_port_a_out; - u8 m_port_b_out; - int m_address; - u8 m_latch; - /* kikikai mcu simulation */ - int m_kikikai_simulated_mcu_running; - int m_kikikai_simulated_mcu_initialised; - bool m_coin_last[2]; - u8 m_coin_fract; - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - optional_device m_subcpu; + optional_device m_subcpu; // kicknrun / mexico86 only optional_device m_mcu; - optional_device m_68705mcu; required_device m_ymsnd; required_device m_gfxdecode; required_device m_palette; - required_device m_screen; /* queue */ - u8 m_queue[64]; - int m_qfront; - int m_qstate; - DECLARE_WRITE8_MEMBER(mexico86_sub_output_w); - DECLARE_WRITE8_MEMBER(mexico86_f008_w); - DECLARE_WRITE8_MEMBER(mexico86_68705_port_a_w); - DECLARE_WRITE8_MEMBER(mexico86_68705_port_b_w); - DECLARE_WRITE8_MEMBER(mexico86_bankswitch_w); + //u8 m_queue[64]; + //int m_qfront; + //int m_qstate; + DECLARE_WRITE8_MEMBER(kicknrun_sub_output_w); + virtual DECLARE_WRITE8_MEMBER(main_f008_w); + + DECLARE_WRITE8_MEMBER(main_bankswitch_w); DECLARE_READ8_MEMBER(kiki_ym2203_r); - virtual void machine_start() override; - virtual void machine_reset() override; - u32 screen_update_mexico86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - u32 screen_update_kikikai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(kikikai_interrupt); - INTERRUPT_GEN_MEMBER(mexico86_m68705_interrupt); - void mcu_simulate( ); - bool mcu_coin_counter_w(bool condition); - void mexico86_map(address_map &map); - void mexico86_sound_map(address_map &map); - void mexico86_sub_cpu_map(address_map &map); + + virtual INTERRUPT_GEN_MEMBER(kikikai_interrupt); + + void main_map(address_map &map); + void sound_map(address_map &map); + void kicknrun_sub_cpu_map(address_map &map); void mcu_map(address_map& map); - /* Bubble Bobble MCU */ + /* Kiki KaiKai / Kick 'n Run MCU */ uint8_t m_ddr1; uint8_t m_ddr2; uint8_t m_ddr3; @@ -101,20 +86,82 @@ private: uint8_t m_port3_out; uint8_t m_port4_out; - DECLARE_READ8_MEMBER(bublbobl_mcu_ddr1_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_ddr1_w); - DECLARE_READ8_MEMBER(bublbobl_mcu_ddr2_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_ddr2_w); - DECLARE_READ8_MEMBER(bublbobl_mcu_ddr3_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_ddr3_w); - DECLARE_READ8_MEMBER(bublbobl_mcu_ddr4_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_ddr4_w); - DECLARE_READ8_MEMBER(bublbobl_mcu_port1_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_port1_w); - DECLARE_READ8_MEMBER(bublbobl_mcu_port2_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_port2_w); - DECLARE_READ8_MEMBER(bublbobl_mcu_port3_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_port3_w); - DECLARE_READ8_MEMBER(bublbobl_mcu_port4_r); - DECLARE_WRITE8_MEMBER(bublbobl_mcu_port4_w); + DECLARE_READ8_MEMBER(kikikai_mcu_ddr1_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_ddr1_w); + DECLARE_READ8_MEMBER(kikikai_mcu_ddr2_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_ddr2_w); + DECLARE_READ8_MEMBER(kikikai_mcu_ddr3_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_ddr3_w); + DECLARE_READ8_MEMBER(kikikai_mcu_ddr4_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_ddr4_w); + DECLARE_READ8_MEMBER(kikikai_mcu_port1_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_port1_w); + DECLARE_READ8_MEMBER(kikikai_mcu_port2_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_port2_w); + DECLARE_READ8_MEMBER(kikikai_mcu_port3_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_port3_w); + DECLARE_READ8_MEMBER(kikikai_mcu_port4_r); + DECLARE_WRITE8_MEMBER(kikikai_mcu_port4_w); +}; + +class mexico86_state : public kikikai_state +{ +public: + mexico86_state(const machine_config& mconfig, device_type type, const char* tag) + : kikikai_state(mconfig, type, tag), + m_68705mcu(*this, "68705mcu") + { + } + + void mexico86_68705(machine_config& config); + void knightb(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + virtual DECLARE_WRITE8_MEMBER(main_f008_w) override; + + INTERRUPT_GEN_MEMBER(mexico86_m68705_interrupt); + DECLARE_WRITE8_MEMBER(mexico86_68705_port_a_w); + DECLARE_WRITE8_MEMBER(mexico86_68705_port_b_w); + + optional_device m_68705mcu; + + /* mcu */ + /* mexico86 68705 protection */ + u8 m_port_a_out; + u8 m_port_b_out; + int m_address; + u8 m_latch; + +}; + +class kikikai_simulation_state : public kikikai_state +{ +public: + kikikai_simulation_state(const machine_config& mconfig, device_type type, const char* tag) + : kikikai_state(mconfig, type, tag) + { + } + + void kikikai(machine_config& config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + virtual DECLARE_WRITE8_MEMBER(main_f008_w) override; + + virtual INTERRUPT_GEN_MEMBER(kikikai_interrupt) override; + + void mcu_simulate( ); + + /* kikikai mcu simulation */ + int m_kikikai_simulated_mcu_running; + int m_kikikai_simulated_mcu_initialised; + bool m_coin_last[2]; + u8 m_coin_fract; }; diff --git a/src/mame/includes/namcona1.h b/src/mame/includes/namcona1.h index c41bf3349b8..3e3907e62cd 100644 --- a/src/mame/includes/namcona1.h +++ b/src/mame/includes/namcona1.h @@ -30,7 +30,7 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_palette(*this, "palette"), - m_c140(*this, "c140"), + m_c219(*this, "c219"), m_muxed_inputs(*this, { { "P4", "DSW", "P1", "P2" } }), m_io_p3(*this, "P3"), m_workram(*this, "workram"), @@ -93,7 +93,7 @@ protected: void scanline_interrupt(int scanline); void namcona1_main_map(address_map &map); - void namcona1_c140_map(address_map &map); + void namcona1_c219_map(address_map &map); virtual void machine_start() override; virtual void machine_reset() override; @@ -127,7 +127,7 @@ protected: required_device m_gfxdecode; required_device m_screen; required_device m_palette; - required_device m_c140; + required_device m_c219; required_ioport_array<4> m_muxed_inputs; required_ioport m_io_p3; diff --git a/src/mame/includes/namcos2.h b/src/mame/includes/namcos2.h index 4138570b452..df80e3bab52 100644 --- a/src/mame/includes/namcos2.h +++ b/src/mame/includes/namcos2.h @@ -55,6 +55,7 @@ public: m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), m_audiobank(*this, "audiobank"), + m_c140_region(*this, "c140"), m_dpram(*this, "dpram"), m_spriteram(*this, "spriteram"), m_c45_road(*this, "c45_road"), @@ -182,6 +183,7 @@ enum optional_device m_gfxdecode; required_device m_screen; required_memory_bank m_audiobank; + required_region_ptr m_c140_region; std::unique_ptr m_eeprom; @@ -193,6 +195,7 @@ enum DECLARE_WRITE8_MEMBER(eeprom_w); DECLARE_READ8_MEMBER(eeprom_r); + DECLARE_READ16_MEMBER(c140_rom_r); DECLARE_WRITE8_MEMBER(sound_bankselect_w); DECLARE_WRITE8_MEMBER(sound_reset_w); @@ -248,6 +251,7 @@ enum void RozCB_luckywld(uint16_t code, int *tile, int *mask, int which); void RozCB_metlhawk(uint16_t code, int *tile, int *mask, int which); + void c140_default_am(address_map &map); void common_default_am(address_map &map); void common_finallap_am(address_map &map); void common_suzuka8h_am(address_map &map); diff --git a/src/mame/includes/nemesis.h b/src/mame/includes/nemesis.h index 7abce049384..cec7817ddbd 100644 --- a/src/mame/includes/nemesis.h +++ b/src/mame/includes/nemesis.h @@ -61,6 +61,7 @@ public: void blkpnthr(machine_config &config); void bubsys_init(); + void bubsys_twinbeeb_init(); private: /* memory pointers */ diff --git a/src/mame/includes/pacman.h b/src/mame/includes/pacman.h index 2e2ed18dfd8..b0b9726810e 100644 --- a/src/mame/includes/pacman.h +++ b/src/mame/includes/pacman.h @@ -224,7 +224,7 @@ public: void porky(machine_config &config); void pacman(machine_config &config, bool latch = true); void _8bpm(machine_config &config); - void maketrax(machine_config &config); + void crush2(machine_config &config); void korosuke(machine_config &config); void alibaba(machine_config &config); void drivfrcp(machine_config &config); diff --git a/src/mame/includes/psion.h b/src/mame/includes/psion.h index ee852094b87..f0f6f970ae3 100644 --- a/src/mame/includes/psion.h +++ b/src/mame/includes/psion.h @@ -85,8 +85,6 @@ protected: void update_banks(); void port2_w(offs_t offset, uint8_t data, uint8_t ddr); uint8_t port2_r(); - void tcsr_w(uint8_t data); - uint8_t tcsr_r(); uint8_t rcp5c_r(); uint8_t port5_r(); void port6_w(uint8_t data); diff --git a/src/mame/includes/seta2.h b/src/mame/includes/seta2.h index 61fc336788e..30d993b7a69 100644 --- a/src/mame/includes/seta2.h +++ b/src/mame/includes/seta2.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia +// copyright-holders:Luca Elia, David Haywood #ifndef MAME_INCLUDES_SETA2_H #define MAME_INCLUDES_SETA2_H @@ -84,6 +84,9 @@ protected: DECLARE_READ16_MEMBER(spriteram_r); DECLARE_WRITE16_MEMBER(spriteram_w); + int calculate_global_xoffset(int special); + int calculate_global_yoffset(int special); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int scanline); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -135,7 +138,7 @@ protected: std::unique_ptr m_private_spriteram; private: - void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int shadow, int realline, int line, int opaque); + void drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int shadow, int screenline, int line, int opaque); inline void get_tile(uint16_t* spriteram, int is_16x16, int x, int y, int page, int& code, int& attr, int& flipx, int& flipy, int& color); std::unique_ptr m_realtilenumber; diff --git a/src/mame/includes/sf.h b/src/mame/includes/sf.h deleted file mode 100644 index 164a5a8ba6b..00000000000 --- a/src/mame/includes/sf.h +++ /dev/null @@ -1,86 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert -/************************************************************************* - - Street Fighter hardware - -*************************************************************************/ - -#include "machine/gen_latch.h" -#include "sound/msm5205.h" -#include "emupal.h" -#include "tilemap.h" - -class sf_state : public driver_device -{ -public: - sf_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_msm(*this, "msm%u", 1U), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch"), - m_videoram(*this, "videoram"), - m_objectram(*this, "objectram"), - m_tilerom(*this, "tilerom"), - m_audiobank(*this, "audiobank") - { } - - void sfp(machine_config &config); - void sfjp(machine_config &config); - void sfus(machine_config &config); - void sfan(machine_config &config); - -private: - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device_array m_msm; - required_device m_gfxdecode; - required_device m_palette; - required_device m_soundlatch; - - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_objectram; - required_region_ptr m_tilerom; - - required_memory_bank m_audiobank; - - /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - tilemap_t *m_tx_tilemap; - int m_active; - uint16_t m_bgscroll; - uint16_t m_fgscroll; - - DECLARE_WRITE8_MEMBER(coin_w); - DECLARE_WRITE8_MEMBER(soundcmd_w); - DECLARE_WRITE16_MEMBER(protection_w); - DECLARE_WRITE8_MEMBER(sound2_bank_w); - DECLARE_WRITE16_MEMBER(videoram_w); - DECLARE_WRITE16_MEMBER(bg_scroll_w); - DECLARE_WRITE16_MEMBER(fg_scroll_w); - DECLARE_WRITE16_MEMBER(gfxctrl_w); - template DECLARE_WRITE8_MEMBER(msm_w); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - TILE_GET_INFO_MEMBER(get_tx_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - inline int invert( int nb ); - void draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ); - void write_dword( address_space &space, offs_t offset, uint32_t data ); - - void sfan_map(address_map &map); - void sfjp_map(address_map &map); - void sfus_map(address_map &map); - void sound2_io_map(address_map &map); - void sound2_map(address_map &map); - void sound_map(address_map &map); -}; diff --git a/src/mame/includes/super80.h b/src/mame/includes/super80.h index 949cae73378..39e6d7a3ae8 100644 --- a/src/mame/includes/super80.h +++ b/src/mame/includes/super80.h @@ -57,8 +57,8 @@ public: void super80d(machine_config &config); protected: - void machine_start() override; - void machine_common(); + void machine_reset_common(); + void machine_start_common(); void cassette_motor(bool data); void screen_vblank_super80m(bool state); void portf0_w(u8 data); @@ -72,6 +72,7 @@ protected: u8 m_keylatch; u8 m_cass_data[4]; u8 m_key_pressed; + u8 m_last_data; bool m_boot_in_progress; std::unique_ptr m_ram; void super80m_palette(palette_device &palette) const; @@ -98,6 +99,7 @@ protected: private: void machine_reset() override; + void machine_start() override; void portf1_w(u8 data); TIMER_DEVICE_CALLBACK_MEMBER(timer_h); uint32_t screen_update_super80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -111,7 +113,6 @@ private: void super80m_map(address_map &map); u8 m_int_sw; - u8 m_last_data; u16 m_vidpg; bool m_current_charset; }; @@ -155,6 +156,7 @@ protected: private: void machine_reset() override; + void machine_start() override; void low_w(u16 offset, u8 data); void high_w(u16 offset, u8 data); u8 low_r(u16 offset); @@ -171,6 +173,7 @@ public: private: void machine_reset() override; + void machine_start() override; void low_w(u16 offset, u8 data); void high_w(u16 offset, u8 data); void super80r_map(address_map &map); diff --git a/src/mame/includes/videopin.h b/src/mame/includes/videopin.h index 151badea154..73ddc3131af 100644 --- a/src/mame/includes/videopin.h +++ b/src/mame/includes/videopin.h @@ -40,6 +40,12 @@ public: void videopin(machine_config &config); +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; + private: enum { @@ -57,10 +63,6 @@ private: TILEMAP_MAPPER_MEMBER(get_memory_offset); TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; void main_map(address_map &map); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); diff --git a/src/mame/includes/williams.h b/src/mame/includes/williams.h index 696d10c55f2..c36e13a040c 100644 --- a/src/mame/includes/williams.h +++ b/src/mame/includes/williams.h @@ -315,8 +315,8 @@ public: m_bank8000(*this, "bank8000"), m_gfxdecode(*this, "gfxdecode"), m_tileram(*this, "williams2_tile"), - m_gain({ 0.8f, 0.73f, 0.81f }), - m_offset({ -0.27f, 0.0f, -0.22f }) + m_gain( { 0.25f, 0.25f, 0.25f }), + m_offset({ 0.00f, 0.00f, 0.00f }) { } void williams2_base(machine_config &config); @@ -418,7 +418,11 @@ class mysticm_state : public williams_d000_ram_state public: mysticm_state(const machine_config &mconfig, device_type type, const char *tag) : williams_d000_ram_state(mconfig, type, tag) - { } + { + // overwrite defaults for mysticm + m_gain = { 0.8f, 0.73f, 0.81f }; + m_offset = { -0.27f, 0.00f, -0.22f }; + } void mysticm(machine_config &config); diff --git a/src/mame/includes/xavix.h b/src/mame/includes/xavix.h index e5ebcb0f865..d1ef57f5899 100644 --- a/src/mame/includes/xavix.h +++ b/src/mame/includes/xavix.h @@ -626,7 +626,6 @@ public: hackaddress2(-1) { } - void xavix_i2c_24lc02(machine_config &config); void xavix_i2c_24lc04(machine_config &config); void xavix_i2c_24c02(machine_config &config); void xavix_i2c_24c08(machine_config &config); diff --git a/src/mame/layout/fidel_phantom.lay b/src/mame/layout/fidel_phantom.lay index a98ade96bee..d9926999a65 100644 --- a/src/mame/layout/fidel_phantom.lay +++ b/src/mame/layout/fidel_phantom.lay @@ -641,17 +641,17 @@ license:CC0 - - - - + + + + - - - + + + - - + + diff --git a/src/mame/layout/mephisto_modena.lay b/src/mame/layout/mephisto_modena.lay index d65ade190d5..d03f5213eb6 100644 --- a/src/mame/layout/mephisto_modena.lay +++ b/src/mame/layout/mephisto_modena.lay @@ -199,14 +199,14 @@ license:CC0 - - - - - - - - + + + + + + + + @@ -288,8 +288,8 @@ license:CC0 - - + + @@ -309,18 +309,18 @@ license:CC0 - - - - - - - - - - - - + + + + + + + + + + + + @@ -329,7 +329,7 @@ license:CC0 - + @@ -342,10 +342,10 @@ license:CC0 - - - - + + + + @@ -395,12 +395,12 @@ license:CC0 - - - - - - + + + + + + @@ -431,23 +431,23 @@ license:CC0 - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/src/mame/layout/mephisto_mondial68k.lay b/src/mame/layout/mephisto_mondial68k.lay index 77946e2450f..46b379c0803 100644 --- a/src/mame/layout/mephisto_mondial68k.lay +++ b/src/mame/layout/mephisto_mondial68k.lay @@ -445,23 +445,23 @@ license:CC0 - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + diff --git a/src/mame/layout/microvision.lay b/src/mame/layout/microvision.lay index 4e88c9e4e6f..d7d1124d3d5 100644 --- a/src/mame/layout/microvision.lay +++ b/src/mame/layout/microvision.lay @@ -6,9 +6,8 @@ license:CC0 - - - + + @@ -25,7 +24,7 @@ license:CC0 - + @@ -35,7 +34,6 @@ license:CC0 - diff --git a/src/mame/layout/monty.lay b/src/mame/layout/monty.lay new file mode 100644 index 00000000000..d189041f3f6 --- /dev/null +++ b/src/mame/layout/monty.lay @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/saitek_leonardo.lay b/src/mame/layout/saitek_leonardo.lay index be76ae61b55..d2270488d2f 100644 --- a/src/mame/layout/saitek_leonardo.lay +++ b/src/mame/layout/saitek_leonardo.lay @@ -6,7 +6,7 @@ license:CC0 - + diff --git a/src/mame/layout/saitek_renaissance.lay b/src/mame/layout/saitek_renaissance.lay new file mode 100644 index 00000000000..a01c5522791 --- /dev/null +++ b/src/mame/layout/saitek_renaissance.lay @@ -0,0 +1,433 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/layout/tascr30.lay b/src/mame/layout/tascr30.lay index 143613749d1..7dc21ef9e89 100644 --- a/src/mame/layout/tascr30.lay +++ b/src/mame/layout/tascr30.lay @@ -10,10 +10,11 @@ license:CC0 + - + @@ -189,10 +190,10 @@ license:CC0 - + - - + + @@ -311,18 +312,18 @@ license:CC0 - + - - - - - - - - - + + + + + + + + + diff --git a/src/mame/machine/cit220_kbd.cpp b/src/mame/machine/cit220_kbd.cpp new file mode 100644 index 00000000000..3523e592ece --- /dev/null +++ b/src/mame/machine/cit220_kbd.cpp @@ -0,0 +1,259 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/********************************************************************** + + CIT-220+ keyboard + + This uses more or less the same protocol as the CIT-101 keyboard: + alternating asynchronous serial communication at 4800 baud. In + this case, however, the scancodes are translated by the host + (though letters and digits use ASCII codes by coincidence). + + The Lock key is programmable as either Caps Lock or Shift Lock. + + TODO: figure out what the remaining two dozen keys are + +**********************************************************************/ + +#include "emu.h" +#include "cit220_kbd.h" + +#include "speaker.h" + +//************************************************************************** +// LLE KEYBOARD DEVICE +//************************************************************************** + +DEFINE_DEVICE_TYPE(CIT220P_KEYBOARD, cit220p_keyboard_device, "cit220p_kbd", "CIT-220+ Keyboard") + +cit220p_keyboard_device::cit220p_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, CIT220P_KEYBOARD, tag, owner, clock) + , m_mcu(*this, "mcu") + , m_beeper(*this, "beeper") + , m_rows(*this, "ROW%X", 0U) + , m_modifiers(*this, "MODIFIERS") + , m_txd_callback(*this) +{ +} + +void cit220p_keyboard_device::device_resolve_objects() +{ + m_txd_callback.resolve_safe(); +} + +void cit220p_keyboard_device::device_start() +{ +} + +WRITE_LINE_MEMBER(cit220p_keyboard_device::write_rxd) +{ + m_mcu->set_input_line(MCS48_INPUT_IRQ, state ? CLEAR_LINE : ASSERT_LINE); +} + + +u8 cit220p_keyboard_device::mcu_bus_r() +{ + u16 scan = m_mcu->p1_r() | (m_mcu->p2_r() ^ 0x10) << 8; + u8 ret = 0xff; + + for (int i = 0; i < 13; i++) + if (!BIT(scan, i)) + ret &= m_rows[i]->read(); + + return ret; +} + +u8 cit220p_keyboard_device::mcu_p2_r() +{ + return BIT(m_modifiers->read(), 1) ? 0xff : 0xbf; +} + +void cit220p_keyboard_device::mcu_p2_w(u8 data) +{ + m_beeper->set_state(BIT(data, 5)); + m_txd_callback(!BIT(data, 7)); +} + +void cit220p_keyboard_device::mcu_movx_w(u8 data) +{ + // TODO: LEDs? +} + +void cit220p_keyboard_device::prog_map(address_map &map) +{ + map(0x000, 0xfff).rom().region("program", 0); +} + +void cit220p_keyboard_device::ext_map(address_map &map) +{ + map(0x00, 0x00).mirror(0xff).w(FUNC(cit220p_keyboard_device::mcu_movx_w)); +} + + +INPUT_PORTS_START(cit220p_keyboard) + PORT_START("MODIFIERS") // Shift keys might be the other way around + PORT_BIT(1, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CHAR(UCHAR_SHIFT_2) PORT_CODE(KEYCODE_LCONTROL) + PORT_BIT(2, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CHAR(UCHAR_SHIFT_1) PORT_CODE(KEYCODE_LSHIFT) + PORT_BIT(4, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) + + PORT_START("ROW0") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 0, Key 0") + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 0, Key 1") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Set-Up") PORT_CHAR(UCHAR_MAMEKEY(F3)) PORT_CODE(KEYCODE_F3) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 0, Key 3") + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 0, Key 4") + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 0, Key 5") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 0, Key 6") + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 0, Key 7") + + PORT_START("ROW1") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Back Space") PORT_CHAR(0x08) PORT_CODE(KEYCODE_BACKSPACE) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(0x09) PORT_CODE(KEYCODE_TAB) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(0x0a) PORT_CODE(KEYCODE_RALT) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 1, Key 3") + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 1, Key 4") + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CHAR(0x0d) PORT_CODE(KEYCODE_ENTER) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 1, Key 6") + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 1, Key 7") + + PORT_START("ROW2") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CODE(KEYCODE_0_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) PORT_CODE(KEYCODE_1_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) PORT_CODE(KEYCODE_2_PAD) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) PORT_CODE(KEYCODE_3_PAD) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) PORT_CODE(KEYCODE_4_PAD) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) PORT_CODE(KEYCODE_5_PAD) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) PORT_CODE(KEYCODE_6_PAD) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) PORT_CODE(KEYCODE_7_PAD) + + PORT_START("ROW3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) PORT_CODE(KEYCODE_8_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) PORT_CODE(KEYCODE_9_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF1") PORT_CODE(KEYCODE_NUMLOCK) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF2") PORT_CODE(KEYCODE_EQUALS_PAD) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF3") PORT_CODE(KEYCODE_SLASH_PAD) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PF4") PORT_CODE(KEYCODE_ASTERISK) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) PORT_CODE(KEYCODE_MINUS_PAD) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(COMMA_PAD)) PORT_CODE(KEYCODE_PLUS_PAD) + + PORT_START("ROW4") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) PORT_CODE(KEYCODE_DEL_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CHAR(0x1b) PORT_CODE(KEYCODE_ESC) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space Bar") PORT_CHAR(0x20) PORT_CODE(KEYCODE_SPACE) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 4, Key 4") + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 4, Key 5") + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 4, Key 6") + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 4, Key 7") + + PORT_START("ROW5") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('`') PORT_CHAR('~') PORT_CODE(KEYCODE_TILDE) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('-') PORT_CHAR('_') PORT_CODE(KEYCODE_MINUS) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('=') PORT_CHAR('+') PORT_CODE(KEYCODE_EQUALS) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(';') PORT_CHAR(':') PORT_CODE(KEYCODE_COLON) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\'') PORT_CHAR('"') PORT_CODE(KEYCODE_QUOTE) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('<') PORT_CHAR('>') PORT_CODE(KEYCODE_BACKSLASH2) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(',') PORT_CODE(KEYCODE_COMMA) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('.') PORT_CODE(KEYCODE_STOP) + + PORT_START("ROW6") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('0') PORT_CHAR(')') PORT_CODE(KEYCODE_0) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('1') PORT_CHAR('!') PORT_CODE(KEYCODE_1) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('2') PORT_CHAR('@') PORT_CODE(KEYCODE_2) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('3') PORT_CHAR('#') PORT_CODE(KEYCODE_3) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('4') PORT_CHAR('$') PORT_CODE(KEYCODE_4) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('5') PORT_CHAR('%') PORT_CODE(KEYCODE_5) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('6') PORT_CHAR('^') PORT_CODE(KEYCODE_6) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('7') PORT_CHAR('&') PORT_CODE(KEYCODE_7) + + PORT_START("ROW7") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('8') PORT_CHAR('*') PORT_CODE(KEYCODE_8) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('9') PORT_CHAR('(') PORT_CODE(KEYCODE_9) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 7, Key 2") + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 7, Key 3") + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 7, Key 4") + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Lock") PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CODE(KEYCODE_CAPSLOCK) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Compose Character") PORT_CHAR(UCHAR_MAMEKEY(LALT)) PORT_CODE(KEYCODE_LALT) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('/') PORT_CHAR('?') PORT_CODE(KEYCODE_SLASH) + + PORT_START("ROW8") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row 8, Key 0") + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('a') PORT_CHAR('A') PORT_CODE(KEYCODE_A) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('b') PORT_CHAR('B') PORT_CODE(KEYCODE_B) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('c') PORT_CHAR('C') PORT_CODE(KEYCODE_C) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('d') PORT_CHAR('D') PORT_CODE(KEYCODE_D) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('e') PORT_CHAR('E') PORT_CODE(KEYCODE_E) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('f') PORT_CHAR('F') PORT_CODE(KEYCODE_F) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('g') PORT_CHAR('G') PORT_CODE(KEYCODE_G) + + PORT_START("ROW9") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('h') PORT_CHAR('H') PORT_CODE(KEYCODE_H) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('i') PORT_CHAR('I') PORT_CODE(KEYCODE_I) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('j') PORT_CHAR('J') PORT_CODE(KEYCODE_J) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('k') PORT_CHAR('K') PORT_CODE(KEYCODE_K) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('l') PORT_CHAR('L') PORT_CODE(KEYCODE_L) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('m') PORT_CHAR('M') PORT_CODE(KEYCODE_M) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('n') PORT_CHAR('N') PORT_CODE(KEYCODE_N) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('o') PORT_CHAR('O') PORT_CODE(KEYCODE_O) + + PORT_START("ROWA") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('p') PORT_CHAR('P') PORT_CODE(KEYCODE_P) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('q') PORT_CHAR('Q') PORT_CODE(KEYCODE_Q) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('r') PORT_CHAR('R') PORT_CODE(KEYCODE_R) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('s') PORT_CHAR('S') PORT_CODE(KEYCODE_S) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('t') PORT_CHAR('T') PORT_CODE(KEYCODE_T) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('u') PORT_CHAR('U') PORT_CODE(KEYCODE_U) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('v') PORT_CHAR('V') PORT_CODE(KEYCODE_V) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('w') PORT_CHAR('W') PORT_CODE(KEYCODE_W) + + PORT_START("ROWB") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('x') PORT_CHAR('X') PORT_CODE(KEYCODE_X) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('y') PORT_CHAR('Y') PORT_CODE(KEYCODE_Y) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('z') PORT_CHAR('Z') PORT_CODE(KEYCODE_Z) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR('{') PORT_CODE(KEYCODE_OPENBRACE) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('|') PORT_CODE(KEYCODE_BACKSLASH) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(']') PORT_CHAR('}') PORT_CODE(KEYCODE_CLOSEBRACE) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row B, Key 6") + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row B, Key 7") + + PORT_START("ROWC") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row C, Key 0") + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row C, Key 1") + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Row C, Key 2") + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CODE(KEYCODE_UP) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_CODE(KEYCODE_LEFT) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CODE(KEYCODE_DOWN) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CODE(KEYCODE_RIGHT) + PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) +INPUT_PORTS_END + +ioport_constructor cit220p_keyboard_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(cit220p_keyboard); +} + +void cit220p_keyboard_device::device_add_mconfig(machine_config &config) +{ + I8035(config, m_mcu, 2376000); // type and clock guessed + m_mcu->set_addrmap(AS_PROGRAM, &cit220p_keyboard_device::prog_map); + m_mcu->set_addrmap(AS_IO, &cit220p_keyboard_device::ext_map); + m_mcu->bus_in_cb().set(FUNC(cit220p_keyboard_device::mcu_bus_r)); + m_mcu->p2_in_cb().set(FUNC(cit220p_keyboard_device::mcu_p2_r)); + m_mcu->p2_out_cb().set(FUNC(cit220p_keyboard_device::mcu_p2_w)); + m_mcu->t0_in_cb().set_ioport("MODIFIERS").bit(2); + m_mcu->t1_in_cb().set_ioport("MODIFIERS").bit(0); + + SPEAKER(config, "mono").front_center(); + BEEP(config, m_beeper, 1000).add_route(ALL_OUTPUTS, "mono", 1.0); // unknown frequency +} + + +ROM_START(cit220p_kbd) + ROM_REGION(0x1000, "program", 0) + ROM_LOAD("v00_kbd.bin", 0x0000, 0x1000, CRC(f9d24190) SHA1(c4e9ef8188afb18de373f2a537ca9b7a315bfb76)) +ROM_END + +const tiny_rom_entry *cit220p_keyboard_device::device_rom_region() const +{ + return ROM_NAME(cit220p_kbd); +} diff --git a/src/mame/machine/cit220_kbd.h b/src/mame/machine/cit220_kbd.h new file mode 100644 index 00000000000..f63b07daf47 --- /dev/null +++ b/src/mame/machine/cit220_kbd.h @@ -0,0 +1,63 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_MACHINE_CIT220_KBD_H +#define MAME_MACHINE_CIT220_KBD_H + +#pragma once + +#include "cpu/mcs48/mcs48.h" +#include "sound/beep.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> cit220p_keyboard_device + +class cit220p_keyboard_device : public device_t +{ +public: + // device type constructor + cit220p_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0); + + // callback configuration + auto txd_callback() { return m_txd_callback.bind(); } + + // serial line input + DECLARE_WRITE_LINE_MEMBER(write_rxd); + +protected: + // device-level overrides + virtual void device_resolve_objects() override; + virtual void device_start() override; + virtual ioport_constructor device_input_ports() const override; + virtual void device_add_mconfig(machine_config &config) override; + virtual const tiny_rom_entry *device_rom_region() const override; + +private: + // MCU handlers + u8 mcu_bus_r(); + u8 mcu_p2_r(); + void mcu_p2_w(u8 data); + void mcu_movx_w(u8 data); + + // address maps + void prog_map(address_map &map); + void ext_map(address_map &map); + + // object finders + required_device m_mcu; + required_device m_beeper; + required_ioport_array<13> m_rows; + required_ioport m_modifiers; + + // output callback + devcb_write_line m_txd_callback; +}; + +// device type declaration +DECLARE_DEVICE_TYPE(CIT220P_KEYBOARD, cit220p_keyboard_device) + +#endif // MAME_MACHINE_CIT220_KBD_H diff --git a/src/mame/machine/dmac_0266.cpp b/src/mame/machine/dmac_0266.cpp index 9b88d0a3648..97a7c1bb7e5 100644 --- a/src/mame/machine/dmac_0266.cpp +++ b/src/mame/machine/dmac_0266.cpp @@ -20,7 +20,10 @@ #include "emu.h" #include "dmac_0266.h" -#define VERBOSE 0 +#define LOG_GENERAL (1U << 0) +#define LOG_DATA (1U << 1) + +//#define VERBOSE (LOG_GENERAL) #include "logmacro.h" DEFINE_DEVICE_TYPE(DMAC_0266, dmac_0266_device, "dmac_0266", "Sony 0266 DMA Controller") @@ -28,7 +31,7 @@ DEFINE_DEVICE_TYPE(DMAC_0266, dmac_0266_device, "dmac_0266", "Sony 0266 DMA Cont dmac_0266_device::dmac_0266_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, DMAC_0266, tag, owner, clock) , m_bus(*this, finder_base::DUMMY_TAG, -1, 32) - , m_eop(*this) + , m_int(*this) , m_dma_r(*this) , m_dma_w(*this) { @@ -36,9 +39,9 @@ dmac_0266_device::dmac_0266_device(machine_config const &mconfig, char const *ta void dmac_0266_device::map(address_map &map) { - map(0x00, 0x03).w(FUNC(dmac_0266_device::control_w)); + map(0x00, 0x03).rw(FUNC(dmac_0266_device::control_r), FUNC(dmac_0266_device::control_w)); map(0x04, 0x07).r(FUNC(dmac_0266_device::status_r)); - map(0x08, 0x0b).w(FUNC(dmac_0266_device::tcount_w)); + map(0x08, 0x0b).rw(FUNC(dmac_0266_device::tcount_r), FUNC(dmac_0266_device::tcount_w)); map(0x0c, 0x0f).w(FUNC(dmac_0266_device::tag_w)); map(0x10, 0x13).w(FUNC(dmac_0266_device::offset_w)); map(0x14, 0x17).w(FUNC(dmac_0266_device::entry_w)); @@ -46,23 +49,24 @@ void dmac_0266_device::map(address_map &map) void dmac_0266_device::device_start() { - m_eop.resolve(); + m_int.resolve_safe(); m_dma_r.resolve_safe(0); m_dma_w.resolve_safe(); + save_item(NAME(m_control)); save_item(NAME(m_status)); save_item(NAME(m_tcount)); save_item(NAME(m_tag)); save_item(NAME(m_offset)); save_item(NAME(m_map)); - save_item(NAME(m_eop_state)); + save_item(NAME(m_int_state)); save_item(NAME(m_drq_state)); m_dma_check = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(dmac_0266_device::dma_check), this)); - m_eop_state = false; + m_int_state = false; m_drq_state = false; } @@ -77,15 +81,25 @@ void dmac_0266_device::device_reset() void dmac_0266_device::soft_reset() { // soft reset does not clear map entries - m_status = 0; + m_control = 0; + m_status &= INTERRUPT; m_tcount = 0; m_tag = 0; m_offset = 0; - set_eop(false); m_dma_check->enable(false); } +void dmac_0266_device::irq_w(int state) +{ + if (state) + m_status |= INTERRUPT; + else + m_status &= ~INTERRUPT; + + set_int(state); +} + void dmac_0266_device::drq_w(int state) { m_drq_state = bool(state); @@ -94,12 +108,12 @@ void dmac_0266_device::drq_w(int state) m_dma_check->adjust(attotime::zero); } -void dmac_0266_device::set_eop(bool eop_state) +void dmac_0266_device::set_int(bool int_state) { - if (eop_state != m_eop_state) + if (int_state != m_int_state) { - m_eop_state = eop_state; - m_eop(eop_state); + m_int_state = int_state; + m_int(int_state); } } @@ -109,7 +123,7 @@ void dmac_0266_device::control_w(u32 data) if (!(data & RESET)) { - if ((data ^ m_status) & ENABLE) + if ((data ^ m_control) & ENABLE) { if (data & ENABLE) { @@ -122,7 +136,7 @@ void dmac_0266_device::control_w(u32 data) m_dma_check->enable(false); } - m_status = data & (ENABLE | DIRECTION); + m_control = data; } else soft_reset(); @@ -135,26 +149,22 @@ void dmac_0266_device::dma_check(void *ptr, s32 param) return; // check enabled - if (!(m_status & ENABLE)) + if (!(m_control & ENABLE)) return; // check transfer count if (!m_tcount) return; - u32 const address = u32(m_map[m_tag & 0x7f]) << 12 | (m_offset & 0xfff); - - // assert eop during last transfer - if (m_tcount == 1) - set_eop(true); + u32 const address = (m_map[m_tag & 0x7f] << 12) | (m_offset & 0xfff); // perform dma transfer - if (m_status & DIRECTION) + if (m_control & DIRECTION) { // device to memory u8 const data = m_dma_r(); - LOG("dma_r data 0x%02x address 0x%08x\n", data, address); + LOGMASKED(LOG_DATA, "dma_r data 0x%02x address 0x%08x\n", data, address); m_bus->write_byte(address, data); } @@ -163,7 +173,7 @@ void dmac_0266_device::dma_check(void *ptr, s32 param) // memory to device u8 const data = m_bus->read_byte(address); - LOG("dma_w data 0x%02x address 0x%08x\n", data, address); + LOGMASKED(LOG_DATA, "dma_w data 0x%02x address 0x%08x\n", data, address); m_dma_w(data); } @@ -185,10 +195,8 @@ void dmac_0266_device::dma_check(void *ptr, s32 param) if (!m_tcount) { LOG("transfer complete\n"); - m_status &= ~ENABLE; - m_status |= INTERRUPT | TCZERO; - - set_eop(false); + m_control &= ~ENABLE; + m_status |= TCZERO; } else m_dma_check->adjust(attotime::zero); diff --git a/src/mame/machine/dmac_0266.h b/src/mame/machine/dmac_0266.h index 2ee81a4e55e..bfadb405ca2 100644 --- a/src/mame/machine/dmac_0266.h +++ b/src/mame/machine/dmac_0266.h @@ -14,12 +14,13 @@ public: // configuration template void set_bus(T &&tag, int spacenum) { m_bus.set_tag(std::forward(tag), spacenum); } - auto out_eop_cb() { return m_eop.bind(); } + auto out_int_cb() { return m_int.bind(); } auto dma_r_cb() { return m_dma_r.bind(); } auto dma_w_cb() { return m_dma_w.bind(); } void map(address_map &map); + void irq_w(int state); void drq_w(int state); protected: @@ -28,8 +29,11 @@ protected: virtual void device_reset() override; // register handlers + u32 control_r() { return m_control; } + u32 status_r() { return m_status | (m_control & (DIRECTION | ENABLE)); } + u32 tcount_r() { return m_tcount; } + void control_w(u32 data); - u32 status_r() { return m_status; } void tcount_w(offs_t offset, u32 data, u32 mem_mask) { COMBINE_DATA(&m_tcount); } void tag_w(offs_t offset, u32 data, u32 mem_mask) { COMBINE_DATA(&m_tag); } void offset_w(offs_t offset, u32 data, u32 mem_mask) { COMBINE_DATA(&m_offset); } @@ -37,28 +41,33 @@ protected: // dma logic void soft_reset(); - void set_eop(bool eop_state); + void set_int(bool int_state); void dma_check(void *ptr, s32 param); private: required_address_space m_bus; - devcb_write_line m_eop; + devcb_write_line m_int; devcb_read8 m_dma_r; devcb_write8 m_dma_w; emu_timer *m_dma_check; - enum status_mask : u32 + enum control_mask : u32 { ENABLE = 0x01, DIRECTION = 0x02, RESET = 0x04, + }; + + enum status_mask : u32 + { INTERRUPT = 0x08, TCZERO = 0x10, }; // registers + u32 m_control; u32 m_status; u32 m_tcount; u32 m_tag; @@ -66,7 +75,7 @@ private: u32 m_map[128]; // internal state - bool m_eop_state; + bool m_int_state; bool m_drq_state; }; diff --git a/src/mame/machine/fp6000_kbd.cpp b/src/mame/machine/fp6000_kbd.cpp new file mode 100644 index 00000000000..128a7b75a8c --- /dev/null +++ b/src/mame/machine/fp6000_kbd.cpp @@ -0,0 +1,314 @@ +// license: BSD-3-Clause +// copyright-holders: Dirk Best +/*************************************************************************** + + Casio FP-6000 Keyboard + +***************************************************************************/ + +#include "emu.h" +#include "fp6000_kbd.h" +#include "machine/keyboard.ipp" + + +DEFINE_DEVICE_TYPE(FP6000_KBD, fp6000_kbd_device, "fp6000_kbd", "FP-6000 Keyboard") + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( keyboard ) + PORT_START("row_0") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 00 */ PORT_CODE(KEYCODE_PRTSCR) PORT_CHAR(UCHAR_MAMEKEY(PRTSCR)) PORT_NAME("Copy") + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 01 */ PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 02 */ PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 03 */ PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 04 */ PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 05 */ PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 06 */ PORT_CODE(KEYCODE_F6) PORT_CHAR(UCHAR_MAMEKEY(F6)) + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 07 */ PORT_CODE(KEYCODE_F7) PORT_CHAR(UCHAR_MAMEKEY(F7)) + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 08 */ PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8)) + PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 09 */ PORT_CODE(KEYCODE_F9) PORT_CHAR(UCHAR_MAMEKEY(F9)) + PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 0a */ PORT_CODE(KEYCODE_F10) PORT_CHAR(UCHAR_MAMEKEY(F10)) + PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 0b */ PORT_CODE(KEYCODE_F11) PORT_CHAR(UCHAR_MAMEKEY(F11)) + PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 0c */ PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) PORT_NAME("Ins") + PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 0d */ PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) PORT_NAME("Del") + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 0e */ PORT_CODE(KEYCODE_HOME) PORT_CHAR(0) PORT_CHAR(UCHAR_MAMEKEY(HOME)) PORT_NAME("Cls / Home") + PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 0f */ PORT_CODE(KEYCODE_SCRLOCK) PORT_CHAR(UCHAR_MAMEKEY(SCRLOCK)) PORT_NAME("SLock / Break") + + PORT_START("row_1") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 10 */ PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 11 */ PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 12 */ PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 13 */ PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 14 */ PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 15 */ PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 16 */ PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 17 */ PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 18 */ PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 19 */ PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~') + PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 1a */ PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 1b */ PORT_CODE(KEYCODE_F12) PORT_CHAR(UCHAR_MAMEKEY(F12)) + PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 1c */ PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) PORT_CHAR(UCHAR_MAMEKEY(PGUP)) PORT_NAME("\xe2\x86\x91 PgUp") + PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 1d */ PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_NAME("\xe2\x86\x92 PgRt") + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 1e */ PORT_CODE(KEYCODE_END) PORT_CHAR(0) PORT_CHAR(UCHAR_MAMEKEY(END)) PORT_NAME("Clr / End") + PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 1f */ PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + + PORT_START("row_2") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 20 */ PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 21 */ PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 22 */ PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 23 */ PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 24 */ PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 25 */ PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 26 */ PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 27 */ PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 28 */ PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('@') PORT_CHAR('`') + PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 29 */ PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') PORT_NAME("\xC2\xA5 |") // ¥ + PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 2a */ PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) + PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 2b */ PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) PORT_NAME("\xe2\x86\x90 PgLt") + PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 2c */ PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR(UCHAR_MAMEKEY(PGDN)) PORT_NAME("\xe2\x86\x93 PgDn") + PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 2d */ PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 2e */ PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) + PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 2f */ PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) + + PORT_START("row_3") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 30 */ PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 31 */ PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 32 */ PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 33 */ PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 34 */ PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 35 */ PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 36 */ PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 37 */ PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 38 */ PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('*') + PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 39 */ PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_UNUSED) /* 3a */ // ? + PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 3b */ PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) + PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 3c */ PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) + PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 3d */ PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_UNUSED) /* 3e */ // ? + PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 3f */ PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) PORT_NAME("Ctrl") + + PORT_START("row_4") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 40 */ PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 41 */ PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 42 */ PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 43 */ PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 44 */ PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 45 */ PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 46 */ PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 47 */ PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 48 */ PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 49 */ PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_UNUSED) /* 4a */ // ? + PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 4b */ PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) + PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 4c */ PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) + PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 4d */ PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 4e */ PORT_CODE(KEYCODE_ENTER_PAD) PORT_CHAR(UCHAR_MAMEKEY(ENTER_PAD)) + PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 4f */ PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) PORT_NAME("Alt") + + PORT_START("row_5") + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 50 */ PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 51 */ PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 52 */ PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 53 */ PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 54 */ PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 55 */ PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 56 */ PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 57 */ PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 58 */ PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 59 */ PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR(0) PORT_CHAR('_') PORT_NAME(" _") + PORT_BIT(0x0400, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 5a */ PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(RALT)) PORT_NAME("Kana") + PORT_BIT(0x0800, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 5b */ PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) + PORT_BIT(0x1000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 5c */ PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) + PORT_BIT(0x2000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 5d */ PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) + PORT_BIT(0x4000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 5e */ PORT_CODE(KEYCODE_COMMA_PAD) PORT_CHAR(UCHAR_MAMEKEY(COMMA_PAD)) + PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_KEYBOARD) /* 5f */ PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_NAME("Caps") + + // codes 0x60 to 0x7f seem to be copies of other codes +INPUT_PORTS_END + +ioport_constructor fp6000_kbd_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( keyboard ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// fp6000_kbd_device - constructor +//------------------------------------------------- + +fp6000_kbd_device::fp6000_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, FP6000_KBD, tag, owner, clock), + device_matrix_keyboard_interface(mconfig, *this, "row_0", "row_1", "row_2", "row_3", "row_4", "row_5"), + m_int_handler(*this) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void fp6000_kbd_device::device_start() +{ + // resolve callbacks + m_int_handler.resolve_safe(); + + // register for state saving + save_item(NAME(m_status)); + save_item(NAME(m_data)); +} + +//------------------------------------------------- +// device_start - device-specific reset +//------------------------------------------------- + +void fp6000_kbd_device::device_reset() +{ + reset_key_state(); + start_processing(attotime::from_hz(9600)); + typematic_stop(); + + m_status = 0x00; + m_data = 0x7f; +} + +//------------------------------------------------- +// read - external read from keyboard +//------------------------------------------------- + +uint8_t fp6000_kbd_device::read(offs_t offset) +{ + uint8_t data = 0xff; + + switch (offset) + { + case 0: + if (0) + logerror("Read data from keyboard: %02x\n", m_data); + + m_int_handler(0); + m_status &= ~STATUS_DATA_AVAILABLE; + data = m_data; + break; + + case 1: + if (0) + logerror("Read status from keyboard: %02x\n", m_status); + + data = m_status; + break; + } + + return data; +} + +//------------------------------------------------- +// write - external data to keyboard +//------------------------------------------------- + +void fp6000_kbd_device::write(offs_t offset, uint8_t data) +{ + switch (offset) + { + case 0: + logerror("Write data to keyboard: %02x\n", data); + + switch (data) + { + case 0x0f: + m_status &= ~STATUS_READY_FOR_DATA; + m_status |= STATUS_DATA_AVAILABLE; + m_data = 0x35; // or 0x40 + break; + } + + break; + + case 1: + logerror("Write command to keyboard: %02x\n", data); + + switch (data) + { + case 0x7e: + m_status |= STATUS_READY_FOR_DATA; + break; + } + + break; + } +} + +//------------------------------------------------- +// key_make - handle a key being pressed +//------------------------------------------------- + +void fp6000_kbd_device::key_make(uint8_t row, uint8_t column) +{ + uint8_t code = translate(row, column); + + if (code != 0x7f) + { + send_key(code); + + // no typematic for modifier keys + if (code != 0x3f && code != 0x4f && code != 0x50 && code != 0x5a && code != 0x5f) + typematic_start(row, column, attotime::from_msec(750), attotime::from_msec(50)); + } +} + +//------------------------------------------------- +// key_break - handle a key being released +//------------------------------------------------- + +void fp6000_kbd_device::key_break(uint8_t row, uint8_t column) +{ + if (typematic_is(row, column)) + typematic_stop(); + + uint8_t code = translate(row, column); + + if (code != 0x7f) + send_key(0x80 | code); +} + +//------------------------------------------------- +// key_repeat - handle a key being repeated +//------------------------------------------------- + +void fp6000_kbd_device::key_repeat(u8 row, u8 column) +{ + uint8_t code = translate(row, column); + send_key(code); +} + +//------------------------------------------------- +// translate - row and column to key code +//------------------------------------------------- + +uint8_t fp6000_kbd_device::translate(uint8_t row, uint8_t column) +{ + return row * 16 + column; +} + +//------------------------------------------------- +// send_key - send key code to host +//------------------------------------------------- + +void fp6000_kbd_device::send_key(uint8_t code) +{ + m_status |= STATUS_DATA_AVAILABLE; + m_data = code; + m_int_handler(1); +} diff --git a/src/mame/machine/fp6000_kbd.h b/src/mame/machine/fp6000_kbd.h new file mode 100644 index 00000000000..978a2b49e3f --- /dev/null +++ b/src/mame/machine/fp6000_kbd.h @@ -0,0 +1,65 @@ +// license: BSD-3-Clause +// copyright-holders: Dirk Best +/*************************************************************************** + + Casio FP-6000 Keyboard + +***************************************************************************/ + +#ifndef MAME_MACHINE_FP6000_KBD_H +#define MAME_MACHINE_FP6000_KBD_H + +#pragma once + +#include "machine/keyboard.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> fp6000_kbd_device + +class fp6000_kbd_device : public device_t, protected device_matrix_keyboard_interface<6> +{ +public: + // construction/destruction + fp6000_kbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + + // callbacks + auto int_handler() { return m_int_handler.bind(); } + + uint8_t read(offs_t offset); + void write(offs_t offset, uint8_t data); + +protected: + // device-level overrides + virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + virtual void device_reset() override; + + // device_matrix_keyboard_interface overrides + virtual void key_make(uint8_t row, uint8_t column) override; + virtual void key_break(uint8_t row, uint8_t column) override; + virtual void key_repeat(uint8_t row, uint8_t column) override; + +private: + devcb_write_line m_int_handler; + + enum + { + STATUS_READY_FOR_DATA = 0x01, + STATUS_DATA_AVAILABLE = 0x02 + }; + + uint8_t translate(uint8_t row, uint8_t column); + void send_key(uint8_t code); + + uint8_t m_status; + uint8_t m_data; +}; + +// device type definition +DECLARE_DEVICE_TYPE(FP6000_KBD, fp6000_kbd_device) + +#endif // MAME_MACHINE_FP6000_KBD_H diff --git a/src/mame/machine/generalplus_gpl16250.cpp b/src/mame/machine/generalplus_gpl16250.cpp index a946571ec48..d7c1d03e3e7 100644 --- a/src/mame/machine/generalplus_gpl16250.cpp +++ b/src/mame/machine/generalplus_gpl16250.cpp @@ -1,6 +1,7 @@ // license:BSD-3-Clause // copyright-holders:David Haywood +#include "emu.h" #include "generalplus_gpl16250.h" // device type definition diff --git a/src/mame/machine/gridkeyb.cpp b/src/mame/machine/gridkeyb.cpp index 0d00db9d4cb..59f4bf8529e 100644 --- a/src/mame/machine/gridkeyb.cpp +++ b/src/mame/machine/gridkeyb.cpp @@ -125,7 +125,7 @@ INPUT_PORTS_START( grid_keyboard ) PORT_BIT( 0x0080U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') PORT_BIT( 0x0100U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') PORT_BIT( 0x0200U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') - PORT_BIT( 0x0400U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('(') + PORT_BIT( 0x0400U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') PORT_BIT( 0x0800U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') PORT_BIT( 0x1000U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') PORT_BIT( 0x2000U, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSPACE) PORT_NAME("Backspace") PORT_CHAR(0x08U) diff --git a/src/mame/machine/kikikai.cpp b/src/mame/machine/kikikai.cpp index 628a4dbe689..1247dba7452 100644 --- a/src/mame/machine/kikikai.cpp +++ b/src/mame/machine/kikikai.cpp @@ -14,25 +14,31 @@ bit 2 = sound cpu reset line bit 1 = microcontroller reset line bit 0 = ? (unused?) */ -WRITE8_MEMBER(kikikai_state::mexico86_f008_w) +WRITE8_MEMBER(kikikai_state::main_f008_w) { m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); - if (m_68705mcu != nullptr) - { - // mexico 86, knight boy - m_68705mcu->set_input_line(INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); - } - else - { - // simulation for KiKi KaiKai - m_kikikai_simulated_mcu_running = data & 2; - - if (!m_kikikai_simulated_mcu_running) - m_kikikai_simulated_mcu_initialised = 0; - } + m_mcu->set_input_line(INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); } +WRITE8_MEMBER(mexico86_state::main_f008_w) +{ + m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); + + // mexico 86, knight boy + m_68705mcu->set_input_line(INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); +} + +WRITE8_MEMBER(kikikai_simulation_state::main_f008_w) +{ + m_audiocpu->set_input_line(INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); + + // simulation for KiKi KaiKai + m_kikikai_simulated_mcu_running = data & 2; + + if (!m_kikikai_simulated_mcu_running) + m_kikikai_simulated_mcu_initialised = 0; +} /*************************************************************************** @@ -43,7 +49,7 @@ WRITE8_MEMBER(kikikai_state::mexico86_f008_w) ***************************************************************************/ -void kikikai_state::mcu_simulate( ) +void kikikai_simulation_state::mcu_simulate( ) { if (!m_kikikai_simulated_mcu_initialised) { @@ -180,6 +186,13 @@ void kikikai_state::mcu_simulate( ) INTERRUPT_GEN_MEMBER(kikikai_state::kikikai_interrupt) +{ + device.execute().set_input_line_vector(0, m_mcu_sharedram[0]); // Z80 + device.execute().set_input_line(0, HOLD_LINE); +} + + +INTERRUPT_GEN_MEMBER(kikikai_simulation_state::kikikai_interrupt) { if (m_kikikai_simulated_mcu_running) mcu_simulate(); @@ -188,8 +201,6 @@ INTERRUPT_GEN_MEMBER(kikikai_state::kikikai_interrupt) device.execute().set_input_line(0, HOLD_LINE); } - - #if 0 /*************************************************************************** @@ -244,13 +255,13 @@ void kikikai_state::kiki_clogic(int address, int latch) ***************************************************************************/ -INTERRUPT_GEN_MEMBER(kikikai_state::mexico86_m68705_interrupt) +INTERRUPT_GEN_MEMBER(mexico86_state::mexico86_m68705_interrupt) { device.execute().set_input_line(M68705_IRQ_LINE, ASSERT_LINE); } -WRITE8_MEMBER(kikikai_state::mexico86_68705_port_a_w) +WRITE8_MEMBER(mexico86_state::mexico86_68705_port_a_w) { //logerror("%s: 68705 port A write %02x\n", machine().describe_context(), data); m_port_a_out = data; @@ -274,7 +285,7 @@ WRITE8_MEMBER(kikikai_state::mexico86_68705_port_a_w) * 7 W not used? */ -WRITE8_MEMBER(kikikai_state::mexico86_68705_port_b_w) +WRITE8_MEMBER(mexico86_state::mexico86_68705_port_b_w) { //logerror("%s: 68705 port B write %02x\n", machine().describe_context(), data); @@ -329,145 +340,137 @@ WRITE8_MEMBER(kikikai_state::mexico86_68705_port_b_w) /*************************************************************************** -Bubble Bobble MCU (assume all this to be wrong - not yet adapted for Kick and Run) +Kiki KaiKai / Kick 'n Run MCU ***************************************************************************/ -READ8_MEMBER(kikikai_state::bublbobl_mcu_ddr1_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_ddr1_r) { return m_ddr1; } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_ddr1_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_ddr1_w) { m_ddr1 = data; } -READ8_MEMBER(kikikai_state::bublbobl_mcu_ddr2_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_ddr2_r) { return m_ddr2; } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_ddr2_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_ddr2_w) { m_ddr2 = data; } -READ8_MEMBER(kikikai_state::bublbobl_mcu_ddr3_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_ddr3_r) { return m_ddr3; } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_ddr3_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_ddr3_w) { m_ddr3 = data; } -READ8_MEMBER(kikikai_state::bublbobl_mcu_ddr4_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_ddr4_r) { return m_ddr4; } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_ddr4_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_ddr4_w) { m_ddr4 = data; } -READ8_MEMBER(kikikai_state::bublbobl_mcu_port1_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_port1_r) { //logerror("%04x: 6801U4 port 1 read\n", m_mcu->pc()); m_port1_in = ioport("IN0")->read(); return (m_port1_out & m_ddr1) | (m_port1_in & ~m_ddr1); } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_port1_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_port1_w) { //logerror("%04x: 6801U4 port 1 write %02x\n", m_mcu->pc(), data); - // bit 4: coin lockout - machine().bookkeeping().coin_lockout_global_w(~data & 0x10); - - // bit 5: select 1-way or 2-way coin counter - - // bit 6: trigger IRQ on main CPU (jumper switchable to vblank) - // trigger on high->low transition - if ((m_port1_out & 0x40) && (~data & 0x40)) - { - // logerror("triggering IRQ on main CPU\n"); - m_maincpu->set_input_line_vector(0, m_mcu_sharedram[0]); // Z80 - m_maincpu->set_input_line(0, HOLD_LINE); + // bit 0, 1: coin counters (?) + if (data & 0x01 && ~m_port1_out & 0x01) { + machine().bookkeeping().coin_counter_w(0, data & 0x01); } - // bit 7: select read or write shared RAM + if (data & 0x02 && ~m_port1_out & 0x02) { + machine().bookkeeping().coin_counter_w(1, data & 0x02); + } + + // bit 4, 5: coin lockouts + machine().bookkeeping().coin_lockout_w(0, ~data & 0x10); + machine().bookkeeping().coin_lockout_w(0, ~data & 0x20); + + // bit 7: ? (set briefly while MCU boots) m_port1_out = data; } -READ8_MEMBER(kikikai_state::bublbobl_mcu_port2_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_port2_r) { //logerror("%04x: 6801U4 port 2 read\n", m_mcu->pc()); return (m_port2_out & m_ddr2) | (m_port2_in & ~m_ddr2); } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_port2_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_port2_w) { //logerror("%04x: 6801U4 port 2 write %02x\n", m_mcu->pc(), data); - static const char *const portnames[] = { "DSW0", "DSW1", "IN1", "IN2" }; + static const char *const portnames[] = { "IN1", "IN2" }; - // bits 0-3: bits 8-11 of shared RAM address - - // bit 4: clock (goes to PAL A78-04.12) - // latch on low->high transition - if ((~m_port2_out & 0x10) && (data & 0x10)) + // bit 2: clock + // latch on high->low transition + if ((m_port2_out & 0x04) && (~data & 0x04)) { - int address = m_port4_out | ((data & 0x0f) << 8); + int address = m_port4_out; - if (m_port1_out & 0x80) + if (data & 0x10) { // read - if ((address & 0x0800) == 0x0000) + if (data & 0x01) { - m_port3_in = ioport(portnames[address & 3])->read(); + m_port3_in = m_mcu_sharedram[address]; } - else if ((address & 0x0c00) == 0x0c00) + else { - logerror("reading %02x from shared RAM %04x\n", m_port3_in, address); - m_port3_in = m_mcu_sharedram[address & 0xff /* & 0x03ff */]; + m_port3_in = ioport(portnames[address & 1])->read(); } } else { // write - if ((address & 0x0c00) == 0x0c00) - { - m_mcu_sharedram[address & 0xff /* & 0x03ff */] = m_port3_out; - logerror("writing %02x to shared RAM %04x\n", m_port3_out, address); - } + m_mcu_sharedram[address] = m_port3_out; } } m_port2_out = data; } -READ8_MEMBER(kikikai_state::bublbobl_mcu_port3_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_port3_r) { //logerror("%04x: 6801U4 port 3 read\n", m_mcu->pc()); return (m_port3_out & m_ddr3) | (m_port3_in & ~m_ddr3); } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_port3_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_port3_w) { //logerror("%04x: 6801U4 port 3 write %02x\n", m_mcu->pc(), data); m_port3_out = data; } -READ8_MEMBER(kikikai_state::bublbobl_mcu_port4_r) +READ8_MEMBER(kikikai_state::kikikai_mcu_port4_r) { //logerror("%04x: 6801U4 port 4 read\n", m_mcu->pc()); return (m_port4_out & m_ddr4) | (m_port4_in & ~m_ddr4); } -WRITE8_MEMBER(kikikai_state::bublbobl_mcu_port4_w) +WRITE8_MEMBER(kikikai_state::kikikai_mcu_port4_w) { //logerror("%04x: 6801U4 port 4 write %02x\n", m_mcu->pc(), data); diff --git a/src/mame/machine/macadb.cpp b/src/mame/machine/macadb.cpp index 0e4d33e76fc..b301dfa6e15 100644 --- a/src/mame/machine/macadb.cpp +++ b/src/mame/machine/macadb.cpp @@ -448,6 +448,11 @@ void mac_state::adb_talk() } m_adb_datasize = 2; } + else + { + m_adb_buffer[0] = 0xff; + m_adb_buffer[1] = 0xff; + } break; // read modifier keys diff --git a/src/mame/machine/mackbd.cpp b/src/mame/machine/mackbd.cpp index 753947618a0..4918cc8e875 100644 --- a/src/mame/machine/mackbd.cpp +++ b/src/mame/machine/mackbd.cpp @@ -19,7 +19,7 @@ Port 0: - x------- Clock to Mac + x------- Clock, pulled up, driven by the 8021 -x------ Caps Lock --x----- Row 5 readback (tied to Vcc for keypad) ---x---- Row 4 readback @@ -43,7 +43,7 @@ x--- Command/Apple -x-- Shift --x- Column 0 strobe - ---x Data to Mac + ---x Data, pulled up, driven by both sides The T1 line is "Option". @@ -78,76 +78,76 @@ ROM_END static INPUT_PORTS_START( mackbd ) PORT_START("COL0") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') PORT_START("COL1") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN) - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') PORT_START("COL2") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') PORT_START("COL3") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') PORT_START("COL4") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') PORT_START("COL5") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') PORT_START("COL6") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r') PORT_NAME("Return") + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('"') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r') PORT_NAME("Return") PORT_START("COL7") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') PORT_START("COL8") - PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN) - PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN) - PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) - PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') - PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') - PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') + PORT_BIT(0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN) + PORT_BIT(0x0008, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) + PORT_BIT(0x0004, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') PORT_CHAR('~') + PORT_BIT(0x0002, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') PORT_START("MODS") PORT_BIT(0x0001, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE @@ -193,6 +193,7 @@ ioport_constructor mackbd_device::device_input_ports() const mackbd_device::mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MACKBD, tag, owner, clock), m_maincpu(*this, MACKBD_CPU_TAG), + m_col(*this, "COL%u", 0U), m_clkout_handler(*this), m_dataout_handler(*this) { @@ -205,6 +206,8 @@ mackbd_device::mackbd_device(const machine_config &mconfig, const char *tag, dev void mackbd_device::device_start() { m_clkout_handler.resolve_safe(); + m_dataout_handler.resolve_safe(); + m_sync = timer_alloc(0); } @@ -214,92 +217,71 @@ void mackbd_device::device_start() void mackbd_device::device_reset() { - p0 = p1 = p2 = 0; - p0 = 0x3f; - data_from_mac = data_to_mac = 0; + p0 = p1 = p2 = 0xff; + datain = true; + m_clkout_handler(1); + m_dataout_handler(1); } -void mackbd_device::scan_kbd_col(int col) +u8 mackbd_device::p0_r() { - char tempcol[8]; - uint16_t keydata; + u8 ret = p0; - // read the selected col - sprintf(tempcol, "COL%d", col); - keydata = ioport(tempcol)->read(); + for(int i=0; i<8; i++) + if(!(p1 & (1<read(); - p0 &= ~0x3f; - p0 |= (keydata & 0x3f); - - // set modifier bits in p2 - p2 = ioport("MODS")->read() & 0xc; -} - -uint8_t mackbd_device::p0_r() -{ - uint8_t ret = p0; + if(!(p2 & 0x02)) + ret &= m_col[0]->read(); // capslock - if (ioport("MODS")->read() & 0x1) - { - ret |= 0x40; - } + if(!(ioport("MODS")->read() & 0x1)) + ret &= ~0x40; return ret; } -void mackbd_device::p0_w(uint8_t data) +void mackbd_device::p0_w(u8 data) { - if (!(data & 2)) - { - scan_kbd_col(0); - } + u8 delta = p0 ^ data; + p0 = data; - if (data & 0x80) - { - m_clkout_handler(ASSERT_LINE); - } - else - { - m_clkout_handler(CLEAR_LINE); -// machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10)); - } + if(delta & 0x80) + m_sync->adjust(attotime::zero); } -uint8_t mackbd_device::p1_r() +void mackbd_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + m_clkout_handler(p0 & 0x80 ? ASSERT_LINE : CLEAR_LINE); +} + +u8 mackbd_device::p1_r() { return p1; } -void mackbd_device::p1_w(uint8_t data) +void mackbd_device::p1_w(u8 data) { - data ^= 0xff; - if (data & 0x01) scan_kbd_col(1); - if (data & 0x02) scan_kbd_col(2); - if (data & 0x04) scan_kbd_col(3); - if (data & 0x08) scan_kbd_col(4); - if (data & 0x10) scan_kbd_col(5); - if (data & 0x20) scan_kbd_col(6); - if (data & 0x40) scan_kbd_col(7); - if (data & 0x80) scan_kbd_col(8); + p1 = data; } -uint8_t mackbd_device::p2_r() +u8 mackbd_device::p2_r() { - return p2 | data_from_mac; + // Keypad has bit 5 connected to GND, but this is the keyboard. + u8 ret = p2; + if(!datain) + ret &= 0xfe; + ret &= ioport("MODS")->read() | ~0x0c; + return ret; } -void mackbd_device::p2_w(uint8_t data) +void mackbd_device::p2_w(u8 data) { - // prevent key scan accesses to the port from messing with the data line (how does this work on h/w?) - if (m_maincpu->pc() != 0x19e && m_maincpu->pc() != 0x1a3) - { - data_to_mac = data_from_mac = (data & 1); -// printf("data to/from mac = %d (PC=%x)\n", data_to_mac, m_maincpu->pc()); - } + p2 = data; + m_dataout_handler(p2 & datain & 1); } -WRITE_LINE_MEMBER(mackbd_device::data_w) +void mackbd_device::datain_w(int state) { - data_from_mac = (state == ASSERT_LINE) ? 1 : 0; + datain = state; } diff --git a/src/mame/machine/mackbd.h b/src/mame/machine/mackbd.h index 1b40b9fc591..01cb62c68b2 100644 --- a/src/mame/machine/mackbd.h +++ b/src/mame/machine/mackbd.h @@ -18,14 +18,11 @@ public: // config helper auto clkout_handler() { return m_clkout_handler.bind(); } auto dataout_handler() { return m_dataout_handler.bind(); } + void datain_w(int state); // construction/destruction mackbd_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void p0_w(uint8_t data); - - DECLARE_WRITE_LINE_MEMBER(data_w); - protected: // device-level overrides virtual void device_start() override; @@ -33,22 +30,26 @@ protected: virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; virtual ioport_constructor device_input_ports() const override; - - required_device m_maincpu; + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; private: - uint8_t p0, p1, p2, data_from_mac, data_to_mac; - + required_device m_maincpu; + required_ioport_array<9> m_col; devcb_write_line m_clkout_handler; devcb_write_line m_dataout_handler; + emu_timer *m_sync; + + u8 p0, p1, p2; + bool datain; void scan_kbd_col(int col); - uint8_t p0_r(); - uint8_t p1_r(); - void p1_w(uint8_t data); - uint8_t p2_r(); - void p2_w(uint8_t data); + u8 p0_r(); + void p0_w(u8 data); + u8 p1_r(); + void p1_w(u8 data); + u8 p2_r(); + void p2_w(u8 data); }; // device type definition diff --git a/src/mame/machine/mpu4.cpp b/src/mame/machine/mpu4.cpp index 25ecc5d8c4e..dfb871d00d7 100644 --- a/src/mame/machine/mpu4.cpp +++ b/src/mame/machine/mpu4.cpp @@ -264,6 +264,7 @@ TODO: - Distinguish door switches using manual #include "video/awpvid.h" //Fruit Machines Only +#include "machine/rescap.h" #include "speaker.h" #include "mpu4.lh" diff --git a/src/mame/machine/namcos2.cpp b/src/mame/machine/namcos2.cpp index 4014dd4bd16..f0d3dba8133 100644 --- a/src/mame/machine/namcos2.cpp +++ b/src/mame/machine/namcos2.cpp @@ -397,3 +397,34 @@ WRITE8_MEMBER( namcos2_state::sound_bankselect_w ) { m_audiobank->set_entry(data>>4); } + +READ16_MEMBER( namcos2_state::c140_rom_r ) +{ + /* + Verified from schematics: + MD0-MD3 : Connected in 3N "voice0" D0-D3 or D4-D7, Nibble changeable with 74LS157 + MD4-MD11 : Connected in 3M "voice1" or 3L "voice2" D0-D7 + MA0-MA18 : Connected in Address bus of ROMs + MA19 : Connected in 74LS157 Select Pin + MA20 : Connected in 74LS157 Strobe(Enable) Pin + MA21 : ROM select in MD4-MD11 area + */ + if (m_c140_region != nullptr) + { + bool romsel = BIT(offset, 21); + bool lsb_en = BIT(~offset, 20); + bool lsb_swap = BIT(~offset, 19); + offset &= 0x7ffff; + u16 ret = m_c140_region[(romsel << 19) | offset] & 0xff00; // voice1 or voice2 + if (lsb_en) + { + u8 lsb = m_c140_region[offset] & 0xff; // voice0 + if (lsb_swap) + lsb <<= 4; // D0-D3 + + ret |= (lsb & 0xf0); + } + return ret; + } + return 0; +} diff --git a/src/mame/machine/super80.cpp b/src/mame/machine/super80.cpp index c20551531a8..599be67c6e8 100644 --- a/src/mame/machine/super80.cpp +++ b/src/mame/machine/super80.cpp @@ -189,21 +189,45 @@ void super80_state::portf0_w(u8 data) /**************************** BASIC MACHINE CONSTRUCTION ***********************************************************/ -void super80_state::machine_start() +void super80_state::machine_start_common() { // zerofill m_ram = make_unique_clear(0x10000); - m_vidpg = 0xfe00; m_cass_led.resolve(); // register for savestates save_pointer(NAME(m_ram), 0x10000); -// save_item(NAME(m_ram_address)); -// save_item(NAME(m_matrix)); -// save_item(NAME(m_digit_data)); + save_item(NAME(m_portf0)); + save_item(NAME(m_s_options)); + save_item(NAME(m_palette_index)); + save_item(NAME(m_keylatch)); + save_item(NAME(m_cass_data)); + save_item(NAME(m_key_pressed)); + save_item(NAME(m_boot_in_progress)); + save_item(NAME(m_last_data)); } -void super80_state::machine_common() +void super80_state::machine_start() +{ + machine_start_common(); + save_item(NAME(m_int_sw)); + save_item(NAME(m_vidpg)); + save_item(NAME(m_current_charset)); + std::copy_n(&m_rom[0], 0x3000, &m_ram[0xc000]); // make 0 F1 C0 work + std::fill_n(&m_ram[0xf000], 0x1000, 0xff); // make O F1 FF work +} + +void super80r_state::machine_start() +{ + machine_start_common(); +} + +void super80v_state::machine_start() +{ + machine_start_common(); +} + +void super80_state::machine_reset_common() { m_boot_in_progress = true; m_portf0 = 0; // must be 0 like real machine, or banking breaks on 32-col systems @@ -216,17 +240,18 @@ void super80_state::machine_reset() { std::copy_n(&m_rom[0], 0x3000, &m_ram[0xc000]); // make 0 F1 C0 work std::fill_n(&m_ram[0xf000], 0x1000, 0xff); // make O F1 FF work - machine_common(); + machine_reset_common(); + m_vidpg = 0xfe00; } void super80r_state::machine_reset() { - machine_common(); + machine_reset_common(); } void super80v_state::machine_reset() { - machine_common(); + machine_reset_common(); } diff --git a/src/mame/machine/taito68705interface.cpp b/src/mame/machine/taito68705interface.cpp index 5256bfd8cd2..dc86368a954 100644 --- a/src/mame/machine/taito68705interface.cpp +++ b/src/mame/machine/taito68705interface.cpp @@ -46,7 +46,7 @@ DEFINE_DEVICE_TYPE(TAITO68705_MCU, taito68705_mcu_device, "taito68705", "Taito MC68705 MCU Interface") -DEFINE_DEVICE_TYPE(TAITO68705_MCU_TIGER, taito68705_mcu_tiger_device, "taito68705tiger", "Taito MC68705 MCU Interface (Tiger Heli)") +DEFINE_DEVICE_TYPE(TAITO68705_MCU_TIGER, taito68705_mcu_tiger_device, "taito68705tiger", "Taito MC68705 MCU Interface (Tiger-Heli)") DEFINE_DEVICE_TYPE(ARKANOID_68705P3, arkanoid_68705p3_device, "arkanoid68705p3", "Arkanoid MC68705P3 Interface") DEFINE_DEVICE_TYPE(ARKANOID_68705P5, arkanoid_68705p5_device, "arkanoid68705p5", "Arkanoid MC68705P5 Interface") @@ -254,7 +254,7 @@ void taito68705_mcu_device::mcu_portb_w(offs_t offset, u8 data, u8 mem_mask) } -/* The Tiger Heli interface has some extensions, handle them here */ +/* The Tiger-Heli interface has some extensions, handle them here */ taito68705_mcu_tiger_device::taito68705_mcu_tiger_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : taito68705_mcu_device(mconfig, TAITO68705_MCU_TIGER, tag, owner, clock) @@ -263,7 +263,7 @@ taito68705_mcu_tiger_device::taito68705_mcu_tiger_device(const machine_config &m u8 taito68705_mcu_tiger_device::mcu_portc_r() { - // Tiger Heli has these status bits inverted MCU-side + // Tiger-Heli has these status bits inverted MCU-side return taito68705_mcu_device::mcu_portc_r() ^ 0x03; } diff --git a/src/mame/machine/vt1682_timer.cpp b/src/mame/machine/vt1682_timer.cpp index 393dadf2ea8..c7d27522e6b 100644 --- a/src/mame/machine/vt1682_timer.cpp +++ b/src/mame/machine/vt1682_timer.cpp @@ -199,7 +199,7 @@ WRITE8_MEMBER(vrt_vt1682_timer_device::vt1682_timer_irqclear_w) void vrt_vt1682_timer_device::device_add_mconfig(machine_config& config) { - TIMER(config, m_timer).configure_periodic(FUNC(vrt_vt1682_timer_device::timer_expired), attotime::never); + TIMER(config, m_timer).configure_generic(FUNC(vrt_vt1682_timer_device::timer_expired)); } void vrt_vt1682_timer_device::change_clock() diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 36ab8b2f576..55ac23f48aa 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -10282,6 +10282,7 @@ wotwc // (c) 1981 @source:circus.cpp circus // no copyright notice [1977?] +circusb // bootleg crash // Exidy [1979?] crasha // no copyright notice [1979?] ripcord // Exidy [1977?] @@ -13082,6 +13083,9 @@ splndrbtb // (c) 1985 Alpha Denshi Co. @source:eispc.cpp epc // 1984 Ericsson PC +@source:ergo201.cpp +ergo201 // + @source:ertictac.cpp ertictac // (c) 1992 Sisteme ertictaca // (c) 1992 Sisteme @@ -16771,7 +16775,9 @@ sftm111 // (c) 1995 Capcom/Incredible Technologies sftmj114 // (c) 1995 Capcom/Incredible Technologies sftmj112 // (c) 1995 Capcom/Incredible Technologies shufshot // (c) Strata/Incredible Technologies +shufshot135 // (c) Strata/Incredible Technologies shufshot137 // (c) Strata/Incredible Technologies +shufshot138 // (c) Strata/Incredible Technologies shufshot139 // (c) Strata/Incredible Technologies timekill // (c) 1992 Strata/Incredible Technologies timekill100 // (c) 1992 Strata/Incredible Technologies @@ -31211,6 +31217,7 @@ rf2 // GX561 (c) 1985 salamand // GX587 (c) 1986 salamandj // GX587 (c) 1986 twinbee // GX412 (c) 1985 +twinbeeb // Bubble System @source:neogeo.cpp neogeo // NeoGeo MV-6F @@ -40428,6 +40435,7 @@ video21 // Videogames GmbH 1980 @source:videopin.cpp solarwar // 036154-036169 1979 [6502] videopin // 034253-034267 1979/02 [6502] +videopina // @source:videopkr.cpp babydad // (c) 1987 Recreativos Franco @@ -42135,3 +42143,15 @@ vgmplay @source:ldplayer.cpp simldv1000 // Pioneer LD-V1000 simpr8210 // Pioneer PR-8210 + +@source:gsz80.cpp +gsz80 + +@source:gscpm.cpp +gscpm + +@source:gs6502.cpp +gs6502 + +@source:gs6809.cpp +gs6809 diff --git a/src/mame/mess.flt b/src/mame/mess.flt index 9b746d68a21..152498c92f2 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -256,6 +256,7 @@ emu3.cpp enmirage.cpp ep64.cpp epic14e.cpp +ergo201.cpp esprit.cpp esq1.cpp esq5505.cpp @@ -342,6 +343,10 @@ gp2x.cpp gp32.cpp grfd2301.cpp gridcomp.cpp +gs6502.cpp +gs6809.cpp +gscpm.cpp +gsz80.cpp h01x.cpp h19.cpp h8.cpp diff --git a/src/mame/video/apple2.cpp b/src/mame/video/apple2.cpp index 5a9070de63c..7556984010b 100644 --- a/src/mame/video/apple2.cpp +++ b/src/mame/video/apple2.cpp @@ -1195,6 +1195,12 @@ void a2_video_device::dhgr_update(screen_device &screen, bitmap_ind16 &bitmap, c int page = m_page2 ? 0x4000 : 0x2000; int mon_type = m_sysconfig & 0x03; + // IIgs force-monochrome-DHR setting + if (m_newvideo & 0x20) + { + mon_type = 1; + } + /* sanity checks */ if (beginrow < cliprect.top()) beginrow = cliprect.top(); diff --git a/src/mame/video/circus.cpp b/src/mame/video/circus.cpp index 366470bf735..e70aad8cb83 100644 --- a/src/mame/video/circus.cpp +++ b/src/mame/video/circus.cpp @@ -13,18 +13,18 @@ #include "includes/circus.h" -WRITE8_MEMBER(circus_state::circus_videoram_w) +void circus_state::circus_videoram_w(offs_t offset, uint8_t data) { m_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); } -WRITE8_MEMBER(circus_state::circus_clown_x_w) +void circus_state::circus_clown_x_w(uint8_t data) { m_clown_x = 240 - data; } -WRITE8_MEMBER(circus_state::circus_clown_y_w) +void circus_state::circus_clown_y_w(uint8_t data) { m_clown_y = 240 - data; } diff --git a/src/mame/video/gp9001.cpp b/src/mame/video/gp9001.cpp index 77217b96449..6a42ea9c6e7 100644 --- a/src/mame/video/gp9001.cpp +++ b/src/mame/video/gp9001.cpp @@ -719,7 +719,7 @@ void gp9001vdp_device::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clip else sy = sy_base + dim_y; for (int dim_x = 0; dim_x < sprite_sizex; dim_x += 8) { - clk += 64; // 64? cycle per each tile + clk += 32; // 32? cycle per each tile; TODO: verify from real hardware if (clk > clk_max) return; diff --git a/src/mame/video/kikikai.cpp b/src/mame/video/kikikai.cpp index 9d05f06650c..3ed05c6a315 100644 --- a/src/mame/video/kikikai.cpp +++ b/src/mame/video/kikikai.cpp @@ -4,7 +4,7 @@ #include "includes/kikikai.h" -WRITE8_MEMBER(kikikai_state::mexico86_bankswitch_w) +WRITE8_MEMBER(kikikai_state::main_bankswitch_w) { if ((data & 7) > 5) popmessage("Switching to invalid bank!"); @@ -16,7 +16,7 @@ WRITE8_MEMBER(kikikai_state::mexico86_bankswitch_w) -uint32_t kikikai_state::screen_update_mexico86(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t kikikai_state::screen_update_kicknrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int offs; int sx, sy, xc, yc; diff --git a/src/mame/video/mmdisplay2.cpp b/src/mame/video/mmdisplay2.cpp index 170cba76f06..fee2739463e 100644 --- a/src/mame/video/mmdisplay2.cpp +++ b/src/mame/video/mmdisplay2.cpp @@ -59,8 +59,8 @@ void mephisto_display_module2_device::device_add_mconfig(machine_config &config) void mephisto_display_module2_device::lcd_palette(palette_device &palette) const { - palette.set_pen_color(0, rgb_t(138, 146, 148)); - palette.set_pen_color(1, rgb_t(92, 83, 88)); + palette.set_pen_color(0, rgb_t(138, 146, 148)); // background + palette.set_pen_color(1, rgb_t(51, 42, 43)); // lcd pixel on } diff --git a/src/mame/video/pcd.cpp b/src/mame/video/pcd.cpp index 75f0478d0a3..4e7a9362730 100644 --- a/src/mame/video/pcd.cpp +++ b/src/mame/video/pcd.cpp @@ -164,7 +164,7 @@ void pcx_video_device::device_add_mconfig(machine_config &config) SCN2672(config, m_crtc, 24_MHz_XTAL / 12); // used with SCB2673B m_crtc->intr_callback().set_inputline("graphics", MCS51_INT0_LINE); - m_crtc->set_character_width(12); + m_crtc->set_character_width(8); m_crtc->set_display_callback(FUNC(pcx_video_device::display_pixels)); m_crtc->set_screen("screen"); m_crtc->set_addrmap(0, &pcx_video_device::pcx_char_ram); @@ -221,22 +221,16 @@ SCN2672_DRAW_CHARACTER_MEMBER(pcx_video_device::display_pixels) uint16_t data = m_charrom[charcode * 16 + linecount + (attrcode & 0x20 ? 4096 : 0)]; if (cursor) - data = 0x7ff; - else - { - data <<= 1; - data |= data << 1; - } + data = 0xff; if (BIT(m_p1, 5)) - data ^= 0x7ff; + data ^= 0xff; - for (int i = 0; i < 12; i++) + for (int i = 0; i < 8; i++) { - rgb_t pix = palette().pen(BIT(data, 10) ? 1 : 0); + rgb_t pix = palette().pen(BIT(data, 7) ? 1 : 0); bitmap.pix32(y, x++) = pix; - if (i != 1) - data <<= 1; + data <<= 1; } } @@ -429,7 +423,7 @@ void pcx_video_device::device_start() m_txd_handler.resolve_safe(); set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); - set_rate(600*2); // FIXME: fix the keyboard when the mc2661 baud rate calc is fixed + set_rate(600); decode_gfx(gfx_pcx); } diff --git a/src/mame/video/seta2.cpp b/src/mame/video/seta2.cpp index 414e0362841..9d388e125d4 100644 --- a/src/mame/video/seta2.cpp +++ b/src/mame/video/seta2.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia +// copyright-holders:Luca Elia, David Haywood /*************************************************************************** -= Newer Seta Hardware =- @@ -75,6 +75,15 @@ The low bits of the pens from a "shadowing" tile (regardless of color code) substitute the top bits of the color index (0-7fff) in the frame buffer. + Note: + + Based on raster effect usage in Guardians it would appear this list is + transformed into an alt format by the hardware. It is unknown if this + alt format is visible to the CPU for reading, or only writing the updated + scroll positions. We could do with attempting a RAM capture to see what + this format really looks like if it is CPU visible as the current + implementation of this copy / reformat operation is pure guesswork + ***************************************************************************/ #include "emu.h" @@ -282,7 +291,7 @@ WRITE16_MEMBER(seta2_state::spriteram_w) ***************************************************************************/ -inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int which_gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int use_shadow, int realline, int line, int opaque) +inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cliprect, int which_gfx, const uint8_t* const addr, const uint32_t realcolor, int flipx, int flipy, int base_sx, int use_shadow, int screenline, int line, int opaque) { struct drawmodes { @@ -313,7 +322,7 @@ inline void seta2_state::drawgfx_line(bitmap_ind16 &bitmap, const rectangle &cli const uint8_t* const source = flipy ? addr + (7 - line) * 8 : addr + line * 8; - uint16_t* dest = &bitmap.pix16(realline); + uint16_t* dest = &bitmap.pix16(screenline); const int x0 = flipx ? (base_sx + 8 - 1) : (base_sx); const int x1 = flipx ? (base_sx - 1) : (x0 + 8); @@ -395,19 +404,8 @@ inline void seta2_state::get_tile(uint16_t* spriteram, int is_16x16, int x, int } } -void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +int seta2_state::calculate_global_xoffset(int special) { - if (!m_vregs.found()) - return; // ablastb (bootleg) doesn't have obvious video registers, so just abandon, probably needs a different driver - - // Sprites list - uint16_t *spriteram = m_spriteram; - int global_yoffset = (m_vregs[0x1a/2] & 0x7ff); // and 0x18/2 for low bits - if (global_yoffset & 0x400) - global_yoffset -= 0x800; - - global_yoffset += 1; // +2 for myangel / myangel2? - int global_xoffset = (m_vregs[0x12/2] & 0x7ff); // and 0x10/2 for low bits if (global_xoffset & 0x400) global_xoffset -= 0x800; @@ -424,6 +422,35 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) global_xoffset -= 0x14f; } + if (special) + global_xoffset = 0x80; + + return global_xoffset; +} + +int seta2_state::calculate_global_yoffset(int special) +{ + // Sprites list + int global_yoffset = (m_vregs[0x1a / 2] & 0x7ff); // and 0x18/2 for low bits + if (global_yoffset & 0x400) + global_yoffset -= 0x800; + + global_yoffset += 1; // +2 for myangel / myangel2? + + if (special) + global_yoffset = -0x90; + + return global_yoffset; +} + + +void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int scanline) +{ + if (!m_vregs.found()) + return; // ablastb (bootleg) doesn't have obvious video registers, so just abandon, probably needs a different driver + + uint16_t* spriteram = m_spriteram; + uint16_t *s1 = m_private_spriteram.get(); for (; s1 < &m_private_spriteram[0x1000 / 2]; s1 += 4) @@ -451,12 +478,12 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) xoffs &= 0x3ff; yoffs &= 0x3ff; + int global_xoffset = calculate_global_xoffset(special); + int global_yoffset = calculate_global_yoffset(special); if (special) { use_shadow = 0; // which_gfx = 4 << 8; - global_yoffset = -0x90; - global_xoffset = 0x80; } // Number of single-sprites @@ -471,108 +498,85 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) if (sprite & 0x8000) { + // "floating tilemap" sprite // the 'floating tilemap sprites' are just a window into the tilemap, the position of the sprite does not change the scroll values - int sx = s2[0]; + // get everything we need to calculate if sprite covers this scanline int sy = s2[1]; - int scrollx = s2[2]; - int scrolly = s2[3]; - int is_16x16 = (scrollx & 0x8000) >> 15; - int page = (scrollx & 0x7c00) >> 10; - int local_sizex = sx & 0xfc00; int local_sizey = sy & 0xfc00; - sx &= 0x3ff; - sy += global_yoffset; - sy &= 0x1ff; - if (sy & 0x100) sy -= 0x200; + int height = use_global_size ? global_sizey : local_sizey; + height = ((height & 0xfc00) >> 10) + 1; + int firstline = (sy + yoffs) & 0x1ff; + if (firstline & 0x100) firstline -= 0x200; + int endline = firstline + height * 0x10 - 1; + // if the sprite doesn't cover this scanline, bail now + if (firstline > scanline) continue; + if (endline < scanline) continue; + + // get everything we need to calculate if sprite is actually within the x co-ordinates of the screen + int sx = s2[0]; + int local_sizex = sx & 0xfc00; + sx &= 0x3ff; sx -= global_xoffset; int width = use_global_size ? global_sizex : local_sizex; - int height = use_global_size ? global_sizey : local_sizey; - - height = ((height & 0xfc00) >> 10) + 1; width = ((width & 0xfc00) >> 10)/* + 1*/; // reelquak reels if (!width) continue; - scrollx &= 0x3ff; + int firstcolumn = (sx + xoffs); + firstcolumn = (firstcolumn & 0x1ff) - (firstcolumn & 0x200); + int lastcolumn = firstcolumn + width * 0x10 - 1; + + // if the sprite isn't within the x-coordinates of the screen, bail + if (firstcolumn > cliprect.max_x) continue; + if (lastcolumn < cliprect.min_x) continue; + + + // otherwise get the rest of the things we need to draw + int scrolly = s2[3]; scrolly &= 0x1ff; - scrolly += global_yoffset; + int sourceline = (scanline - scrolly) & 0x1ff; - rectangle clip; - // sprite clipping region (x) - clip.min_x = (sx + xoffs); - clip.min_x = (clip.min_x & 0x1ff) - (clip.min_x & 0x200); - clip.max_x = clip.min_x + width * 0x10 - 1; + int scrollx = s2[2]; + int is_16x16 = (scrollx & 0x8000) >> 15; + int page = (scrollx & 0x7c00) >> 10; + scrollx &= 0x3ff; - if (clip.min_x > cliprect.max_x) continue; - if (clip.max_x < cliprect.min_x) continue; - if (clip.min_x < cliprect.min_x) clip.min_x = cliprect.min_x; - if (clip.max_x > cliprect.max_x) clip.max_x = cliprect.max_x; - - // sprite clipping region (y) - - int basey = (sy + yoffs) & 0x1ff; - if (basey & 0x100) basey -= 0x200; - - clip.min_y = basey; - clip.max_y = clip.min_y + height * 0x10 - 1; - - if (clip.min_y > cliprect.max_y) continue; - if (clip.max_y < cliprect.min_y) continue; - if (clip.min_y < cliprect.min_y) clip.min_y = cliprect.min_y; - if (clip.max_y > cliprect.max_y) clip.max_y = cliprect.max_y; - - for (int realline = clip.min_y; realline <= clip.max_y; realline++) + // we treat 16x16 tiles as 4 8x8 tiles, so while the tilemap is 0x40 tiles wide in memory, that becomes 0x80 tiles in 16x16 mode, with the data wrapping in 8x8 mode + for (int x = 0; x < 0x80; x++) { - int sourceline = (realline - scrolly) & 0x1ff; + int code, attr, flipx, flipy, color; + // tilemap data is NOT buffered? + get_tile(spriteram, is_16x16, x * 8, sourceline, page, code, attr, flipx, flipy, color); - // we treat 16x16 tiles as 4 8x8 tiles, so while the tilemap is 0x40 tiles wide in memory, that becomes 0x80 tiles in 16x16 mode, with the data wrapping in 8x8 mode - for (int x = 0; x < 0x80; x++) + int tileline = sourceline & 0x07; + int dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; + int px = (((dx + x * 8) + 0x10) & 0x3ff) - 0x10; + int dst_x = px & 0x3ff; + dst_x = (dst_x & 0x1ff) - (dst_x & 0x200); + + if ((dst_x >= firstcolumn - 8) && (dst_x <= lastcolumn)) // reelnquak reels are heavily glitched without this check { - int code, attr, flipx, flipy, color; - // tilemap data is NOT buffered? - get_tile(spriteram, is_16x16, x * 8, sourceline, page, code, attr, flipx, flipy, color); - - int tileline = sourceline & 0x07; - int dx = sx + (scrollx & 0x3ff) + xoffs + 0x10; - int px = (((dx + x * 8) + 0x10) & 0x3ff) - 0x10; - int dst_x = px & 0x3ff; - dst_x = (dst_x & 0x1ff) - (dst_x & 0x200); - - if ((dst_x >= clip.min_x - 8) && (dst_x <= clip.max_x)) - { - drawgfx_line(bitmap, clip, which_gfx, m_spritegfx->get_data(m_realtilenumber[code]), color << 4, flipx, flipy, dst_x, use_shadow, realline, tileline, opaque); - } + drawgfx_line(bitmap, cliprect, which_gfx, m_spritegfx->get_data(m_realtilenumber[code]), color << 4, flipx, flipy, dst_x, use_shadow, scanline, tileline, opaque); } } } else { // "normal" sprite - int sx = s2[0]; int sy = s2[1]; - int attr = s2[2]; - int code = s2[3] + ((attr & 0x0007) << 16); - int flipx = (attr & 0x0010); - int flipy = (attr & 0x0008); - int color = (attr & 0xffe0) >> 5; - int sizex = use_global_size ? global_sizex : sx; int sizey = use_global_size ? global_sizey : sy; - sizex = (1 << ((sizex & 0x0c00) >> 10)) - 1; - sizey = (1 << ((sizey & 0x0c00) >> 10)) - 1; - sx += xoffs; - sx = (sx & 0x1ff) - (sx & 0x200); - sx -= global_xoffset; + sizey = (1 << ((sizey & 0x0c00) >> 10)) - 1; sy += yoffs; sy += global_yoffset; @@ -582,35 +586,47 @@ void seta2_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) if (sy & 0x100) sy -= 0x200; - - int basecode = code &= ~((sizex + 1) * (sizey + 1) - 1); // see myangel, myangel2 and grdians - int firstline = sy; int endline = (sy + (sizey + 1) * 8) - 1; - int realfirstline = firstline; + // if the sprite doesn't cover this scanline, bail now + if (firstline > scanline) continue; + if (endline < scanline) continue; - if (firstline < cliprect.min_y) realfirstline = cliprect.min_y; - if (endline > cliprect.max_y) endline = cliprect.max_y; + // otherwise get the rest of the things we need to draw + int attr = s2[2]; + int code = s2[3] + ((attr & 0x0007) << 16); + int flipx = (attr & 0x0010); + int flipy = (attr & 0x0008); + int color = (attr & 0xffe0) >> 5; - for (int realline = realfirstline; realline <= endline; realline++) + int sx = s2[0]; + int sizex = use_global_size ? global_sizex : sx; + sizex = (1 << ((sizex & 0x0c00) >> 10)) - 1; + + sx += xoffs; + sx = (sx & 0x1ff) - (sx & 0x200); + sx -= global_xoffset; + + int basecode = code &= ~((sizex + 1) * (sizey + 1) - 1); // see myangel, myangel2 and grdians + + + int line = scanline - firstline; + int y = (line >> 3); + line &= 0x7; + + if (special) { - int line = realline - firstline; - int y = (line >> 3); - line &= 0x7; - - if (special) - { - // grdians map... - color = 0x7ff; - } - - for (int x = 0; x <= sizex; x++) - { - int realcode = (basecode + (flipy ? sizey - y : y)*(sizex + 1)) + (flipx ? sizex - x : x); - drawgfx_line(bitmap, cliprect, which_gfx, m_spritegfx->get_data(m_realtilenumber[realcode]), color << 4, flipx, flipy, sx + x * 8, use_shadow, realline, line, opaque); - } + // grdians map... + color = 0x7ff; } + + for (int x = 0; x <= sizex; x++) + { + int realcode = (basecode + (flipy ? sizey - y : y)*(sizex + 1)) + (flipx ? sizex - x : x); + drawgfx_line(bitmap, cliprect, which_gfx, m_spritegfx->get_data(m_realtilenumber[realcode]), color << 4, flipx, flipy, sx + x * 8, use_shadow, scanline, line, opaque); + } + } } } @@ -634,6 +650,18 @@ TIMER_CALLBACK_MEMBER(seta2_state::raster_timer_done) } +void seta2_state::draw_sprites(bitmap_ind16& bitmap, const rectangle& cliprect) +{ + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) + { + rectangle tempcliprect(cliprect); + + tempcliprect.sety(y,y); + + draw_sprites(bitmap, tempcliprect, y); + } +} + /*************************************************************************** diff --git a/src/mame/video/sf.cpp b/src/mame/video/sf.cpp deleted file mode 100644 index 71516db2489..00000000000 --- a/src/mame/video/sf.cpp +++ /dev/null @@ -1,226 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Olivier Galibert -#include "emu.h" -#include "includes/sf.h" - -/*************************************************************************** - - Callbacks for the TileMap code - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(sf_state::get_bg_tile_info) -{ - uint8_t *base = &m_tilerom[2 * tile_index]; - int attr = base[0x10000]; - int color = base[0]; - int code = (base[0x10000 + 1] << 8) | base[1]; - tileinfo.set(0, - code, - color, - TILE_FLIPYX(attr & 3)); -} - -TILE_GET_INFO_MEMBER(sf_state::get_fg_tile_info) -{ - uint8_t *base = &m_tilerom[0x20000 + 2 * tile_index]; - int attr = base[0x10000]; - int color = base[0]; - int code = (base[0x10000 + 1] << 8) | base[1]; - tileinfo.set(1, - code, - color, - TILE_FLIPYX(attr & 3)); -} - -TILE_GET_INFO_MEMBER(sf_state::get_tx_tile_info) -{ - int code = m_videoram[tile_index]; - tileinfo.set(3, - code & 0x3ff, - code>>12, - TILE_FLIPYX((code & 0xc00)>>10)); -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void sf_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sf_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 2048, 16); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sf_state::get_fg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 2048, 16); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(sf_state::get_tx_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - - m_fg_tilemap->set_transparent_pen(15); - m_tx_tilemap->set_transparent_pen(3); -} - - - -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -WRITE16_MEMBER(sf_state::videoram_w) -{ - COMBINE_DATA(&m_videoram[offset]); - m_tx_tilemap->mark_tile_dirty(offset); -} - -WRITE16_MEMBER(sf_state::bg_scroll_w) -{ - COMBINE_DATA(&m_bgscroll); - m_bg_tilemap->set_scrollx(0, m_bgscroll); -} - -WRITE16_MEMBER(sf_state::fg_scroll_w) -{ - COMBINE_DATA(&m_fgscroll); - m_fg_tilemap->set_scrollx(0, m_fgscroll); -} - -WRITE16_MEMBER(sf_state::gfxctrl_w) -{ - /* b0 = reset, or maybe "set anyway" */ - /* b1 = pulsed when control6.b6==0 until it's 1 */ - /* b2 = active when dip 8 (flip) on */ - /* b3 = active character plane */ - /* b4 = unused */ - /* b5 = active background plane */ - /* b6 = active middle plane */ - /* b7 = active sprites */ - - if (ACCESSING_BITS_0_7) - { - m_active = data & 0xff; - flip_screen_set(data & 0x04); - m_tx_tilemap->enable(data & 0x08); - m_bg_tilemap->enable(data & 0x20); - m_fg_tilemap->enable(data & 0x40); - } -} - - - -/*************************************************************************** - - Display refresh - -***************************************************************************/ - -inline int sf_state::invert( int nb ) -{ - static const int delta[4] = {0x00, 0x18, 0x18, 0x00}; - return nb ^ delta[(nb >> 3) & 3]; -} - -void sf_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cliprect ) -{ - int offs; - - for (offs = 0x1000 - 0x20; offs >= 0; offs -= 0x20) - { - int c = m_objectram[offs]; - int attr = m_objectram[offs + 1]; - int sy = m_objectram[offs + 2]; - int sx = m_objectram[offs + 3]; - int color = attr & 0x000f; - int flipx = attr & 0x0100; - int flipy = attr & 0x0200; - - if (attr & 0x400) /* large sprite */ - { - int c1, c2, c3, c4, t; - - if (flip_screen()) - { - sx = 480 - sx; - sy = 224 - sy; - flipx = !flipx; - flipy = !flipy; - } - - c1 = c; - c2 = c + 1; - c3 = c + 16; - c4 = c + 17; - - if (flipx) - { - t = c1; c1 = c2; c2 = t; - t = c3; c3 = c4; c4 = t; - } - if (flipy) - { - t = c1; c1 = c3; c3 = t; - t = c2; c2 = c4; c4 = t; - } - - m_gfxdecode->gfx(2)->transpen(bitmap, - cliprect, - invert(c1), - color, - flipx,flipy, - sx,sy, 15); - m_gfxdecode->gfx(2)->transpen(bitmap, - cliprect, - invert(c2), - color, - flipx,flipy, - sx+16,sy, 15); - m_gfxdecode->gfx(2)->transpen(bitmap, - cliprect, - invert(c3), - color, - flipx,flipy, - sx,sy+16, 15); - m_gfxdecode->gfx(2)->transpen(bitmap, - cliprect, - invert(c4), - color, - flipx,flipy, - sx+16,sy+16, 15); - } - else - { - if (flip_screen()) - { - sx = 496 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(2)->transpen(bitmap, - cliprect, - invert(c), - color, - flipx,flipy, - sx,sy, 15); - } - } -} - - -uint32_t sf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - if (m_active & 0x20) - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - else - bitmap.fill(0, cliprect); - - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - if (m_active & 0x80) - draw_sprites(bitmap, cliprect); - - m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); - return 0; -} diff --git a/src/mame/video/vtvideo.cpp b/src/mame/video/vtvideo.cpp index 5aa6c06e29c..ffe42801c93 100644 --- a/src/mame/video/vtvideo.cpp +++ b/src/mame/video/vtvideo.cpp @@ -1,4 +1,4 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Miodrag Milanovic,Karl-Ludwig Deisenhofer /********************************************************************** DEC VT Terminal video emulation @@ -630,6 +630,53 @@ void vt100_video_device::display_char(bitmap_ind16 &bitmap, uint8_t code, int x, if (m_columns == 80) bitmap.pix16(y_preset, x_preset + 9) = bit; } + + /* The DEC terminals use a single ROM bitmap font and + * dot-stretching to synthesize multiple variants that are not + * just nearest neighbor resampled. The result is the same + * as one would get by fake-bolding; the already doubled raster image; + * by rendering twice with 1px horizontal offset. + * + * For details see: https://vt100.net/dec/vt220/glyphs + */ + int prev_bit = back_intensity; + int bits_width = 21; + if (!double_width) + { + if (m_columns == 80) + bits_width = 11; + else + bits_width = 10; + } + for (int b = 0; b < bits_width; b++) + { + if (double_width) + { + if (bitmap.pix16(y_preset, DOUBLE_x_preset + b) == fg_intensity) + { + prev_bit = fg_intensity; + } + else + { + if (prev_bit == fg_intensity) + bitmap.pix16(y_preset, DOUBLE_x_preset + b) = fg_intensity; + prev_bit = back_intensity; + } + } + else + { + if (bitmap.pix16(y_preset, x_preset + b) == fg_intensity) + { + prev_bit = fg_intensity; + } + else + { + if (prev_bit == fg_intensity) + bitmap.pix16(y_preset, x_preset + b) = fg_intensity; + prev_bit = back_intensity; + } + } + } } // for (scan_line) } diff --git a/src/mame/video/vtvideo.h b/src/mame/video/vtvideo.h index 866322d6d2c..37e73e12c08 100644 --- a/src/mame/video/vtvideo.h +++ b/src/mame/video/vtvideo.h @@ -1,4 +1,4 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Miodrag Milanovic,Karl-Ludwig Deisenhofer /********************************************************************** diff --git a/src/mame/video/xbox_nv2a.cpp b/src/mame/video/xbox_nv2a.cpp index 6a32a0d8172..cdc75a5fa4b 100644 --- a/src/mame/video/xbox_nv2a.cpp +++ b/src/mame/video/xbox_nv2a.cpp @@ -826,15 +826,25 @@ void vertex_program_simulator::compute_scalar_operation(float t_out[4], int inst t_out[3] = par_in[p3_C + 3]; break; case 2: // "RCP" - t_out[0] = t_out[1] = t_out[2] = t_out[3] = 1.0f / par_in[p3_C + 0]; + if (par_in[p3_C + 0] == 0) + t.f = std::numeric_limits::infinity(); + else if (par_in[p3_C + 0] == 1.0f) + t.f = 1.0f; + else + t.f = 1.0f / par_in[p3_C + 0]; + t_out[0] = t_out[1] = t_out[2] = t_out[3] = t.f; break; case 3: // "RCC" - t_out[0] = t_out[1] = t_out[2] = t_out[3] = 1.0f / par_in[p3_C + 0]; // ? + t.f = par_in[p3_C + 0]; + if ((t.f < 0) && (t.f > -5.42101e-20f)) + t.f = -5.42101e-20f; + else if ((t.f >= 0) && (t.f < 5.42101e-20f)) + t.f = 5.42101e-20f; + if (t.f != 1.0f) + t.f = 1.0f / t.f; + t_out[0] = t_out[1] = t_out[2] = t_out[3] = t.f; break; case 4: // "RSQ" - /* - * NOTE: this was abs which is "int abs(int x)" - and changed to fabsf due to clang 3.6 warning - */ t_out[0] = t_out[1] = t_out[2] = t_out[3] = 1.0f / sqrtf(fabsf(par_in[p3_C + 0])); break; case 5: // "EXP" @@ -849,9 +859,6 @@ void vertex_program_simulator::compute_scalar_operation(float t_out[4], int inst t_out[1] = frexp(par_in[p3_C + 0], &e)*2.0; // frexp gives mantissa as 0.5....1 t_out[0] = e - 1; #ifndef __OS2__ - /* - * NOTE: this was abs which is "int abs(int x)" - and changed to fabsf due to clang 3.6 warning - */ t.f = log2(fabsf(par_in[p3_C + 0])); #else static double log_2 = 0.0;