| Previous | 199869 Revisions | Next |
| r45045 Saturday 20th February, 2016 at 15:15:39 UTC by Felipe CorrĂȘa da Silva Sanches |
|---|
| [h8 cpu] fix a typo in the array length of the register names string |
| [/trunk] | makefile |
| [3rdparty/rapidjson] | |
| [3rdparty/rapidjson/CMakeModules] | |
| [3rdparty/rapidjson/bin/data] | |
| [3rdparty/rapidjson/bin/draft-04] | |
| [3rdparty/rapidjson/bin/encodings] | |
| [3rdparty/rapidjson/bin/jsonchecker] | |
| [3rdparty/rapidjson/bin/jsonschema] | |
| [3rdparty/rapidjson/bin/jsonschema/bin] | |
| [3rdparty/rapidjson/bin/jsonschema/remotes] | |
| [3rdparty/rapidjson/bin/jsonschema/remotes/folder] | |
| [3rdparty/rapidjson/bin/jsonschema/tests] | |
| [3rdparty/rapidjson/bin/jsonschema/tests/draft3] | |
| [3rdparty/rapidjson/bin/jsonschema/tests/draft3/optional] | |
| [3rdparty/rapidjson/bin/jsonschema/tests/draft4] | |
| [3rdparty/rapidjson/bin/jsonschema/tests/draft4/optional] | |
| [3rdparty/rapidjson/bin/types] | |
| [3rdparty/rapidjson/doc] | |
| [3rdparty/rapidjson/doc/diagram] | |
| [3rdparty/rapidjson/doc/logo] | |
| [3rdparty/rapidjson/doc/misc] | |
| [3rdparty/rapidjson/example] | |
| [3rdparty/rapidjson/example/capitalize] | |
| [3rdparty/rapidjson/example/condense] | |
| [3rdparty/rapidjson/example/jsonx] | |
| [3rdparty/rapidjson/example/messagereader] | |
| [3rdparty/rapidjson/example/pretty] | |
| [3rdparty/rapidjson/example/prettyauto] | |
| [3rdparty/rapidjson/example/schemavalidator] | |
| [3rdparty/rapidjson/example/serialize] | |
| [3rdparty/rapidjson/example/simpledom] | |
| [3rdparty/rapidjson/example/simplereader] | |
| [3rdparty/rapidjson/example/simplewriter] | |
| [3rdparty/rapidjson/example/tutorial] | |
| [3rdparty/rapidjson/include/rapidjson] | |
| [3rdparty/rapidjson/include/rapidjson/error] | |
| [3rdparty/rapidjson/include/rapidjson/internal] | |
| [3rdparty/rapidjson/include/rapidjson/msinttypes] | |
| [3rdparty/rapidjson/test] | |
| [3rdparty/rapidjson/test/perftest] | |
| [3rdparty/rapidjson/test/unittest] | |
| [hash] | c128_cart.xml c64_cart.xml |
| [scripts/src] | machine.lua |
| [scripts/src/osd] | modules.lua windows.lua |
| [scripts/target/mame] | mess.lua |
| [src/devices/cpu/h8] | h8.cpp |
| [src/devices/cpu/hphybrid] | hphybrid.cpp |
| [src/devices/cpu/i386] | i386.cpp i386.h i386op32.inc i386ops.h i386ops.inc i386priv.h |
| [src/devices/machine] | com8116.cpp com8116.h corvushd.cpp |
| [src/emu/ui] | auditmenu.cpp barcode.cpp cheatopt.cpp ctrlmenu.cpp custmenu.cpp dirmenu.cpp filesel.cpp mainmenu.cpp menu.cpp menu.h selgame.cpp selsoft.cpp simpleselgame.cpp swlist.cpp ui.h utils.cpp utils.h |
| [src/mame] | arcade.lst mess.lst |
| [src/mame/drivers] | 1943.cpp 8080bw.cpp at.cpp blmbycar.cpp elecbowl.cpp fidel68k.cpp fidelz80.cpp galaxy.cpp glass.cpp goldstar.cpp hh_cop400.cpp hh_hmcs40.cpp hh_melps4.cpp hh_pic16.cpp hh_tms1k.cpp hh_ucom4.cpp hp9845.cpp kurukuru.cpp mbdtower.cpp mitchell.cpp pc9801.cpp sigmab52.cpp ticalc1x.cpp |
| [src/mame/includes] | blmbycar.h fidelz80.h glass.h hh_tms1k.h hh_ucom4.h xbox.h |
| [src/mame/layout] | |
| [src/mame/machine] | xbox.cpp |
| [src/mame/video] | blmbycar.cpp chihiro.cpp glass.cpp |
| [src/osd/modules/render] | drawbgfx.cpp drawbgfx.h drawdd.cpp* |
| [src/osd/sdl] | video.h |
| [src/osd/windows] | video.cpp video.h window.cpp winmain.cpp |
| r253556 | r253557 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | --> |
| 14 | 14 | <software name="c128diag"> |
| 15 | <description>C | |
| 15 | <description>C128 Diagnostic (v1.1)</description> | |
| 16 | 16 | <year>1987</year> |
| 17 | 17 | <publisher>Commodore</publisher> |
| 18 | 18 | |
| r253556 | r253557 | |
| 21 | 21 | <feature name="exrom" value="1" /> |
| 22 | 22 | |
| 23 | 23 | <dataarea name="roml" size="0x2000"> |
| 24 | <rom name="c128diag.bin" size="0x2000" crc="584f6750" sha1="b3cfd8508b887e9c7e72ed2b0c44fe63e6b44ac4" offset="0" /> | |
| 24 | <rom name="c128diag.bin" size="0x2000" crc="584f6750" sha1="b3cfd8508b887e9c7e72ed2b0c44fe63e6b44ac4" offset="0x0000" /> | |
| 25 | 25 | </dataarea> |
| 26 | 26 | </part> |
| 27 | 27 | </software> |
| 28 | 28 | |
| 29 | 29 | <software name="c128diaga" cloneof="c128diag"> |
| 30 | <description>C | |
| 30 | <description>C128 Diagnostic</description> | |
| 31 | 31 | <year>198?</year> |
| 32 | 32 | <publisher>Commodore</publisher> |
| 33 | 33 | |
| r253556 | r253557 | |
| 41 | 41 | </part> |
| 42 | 42 | </software> |
| 43 | 43 | |
| 44 | <software name="c128diagb" cloneof="c128diag"> | |
| 45 | <description>C128/C128D Diagnostic (Rev 785260)</description> | |
| 46 | <year>198?</year> | |
| 47 | <publisher>Commodore</publisher> | |
| 48 | ||
| 49 | <part name="cart" interface="c64_cart"> | |
| 50 | <feature name="game" value="1" /> | |
| 51 | <feature name="exrom" value="1" /> | |
| 52 | ||
| 53 | <dataarea name="roml" size="0x4000"> | |
| 54 | <rom name="c128_785260.bin" size="0x2000" crc="d4a4e162" sha1="2c861c89be4e556982435d076b012362545f03ca" offset="0" /> | |
| 55 | </dataarea> | |
| 56 | </part> | |
| 57 | </software> | |
| 58 | ||
| 59 | 44 | <software name="c128diagdcr" cloneof="c128diag"> |
| 60 | <description>C | |
| 45 | <description>C128DCR Diagnostic</description> | |
| 61 | 46 | <year>198?</year> |
| 62 | 47 | <publisher>Commodore</publisher> |
| 63 | 48 | |
| r253556 | r253557 | |
| 82 | 67 | <feature name="exrom" value="1" /> |
| 83 | 68 | |
| 84 | 69 | <dataarea name="roml" size="0x2000"> |
| 85 | <rom name="c128diag | |
| 70 | <rom name="c128diag.bin" size="0x2000" crc="b11107be" sha1="c7149ed420d95faa1ab2ecb4a536f5e6effd45e3" offset="0" /> | |
| 86 | 71 | </dataarea> |
| 87 | 72 | </part> |
| 88 | 73 | </software> |
| 89 | 74 | |
| 90 | <software name="c128dg40a" cloneof="c128dg40"> | |
| 91 | <description>C128/40 Diagnostic (Rev 789010)</description> | |
| 92 | <year>198?</year> | |
| 93 | <publisher>Commodore</publisher> | |
| 94 | <sharedfeat name="compatibility" value="NTSC,PAL"/> | |
| 95 | ||
| 96 | <part name="cart" interface="c64_cart"> | |
| 97 | <feature name="game" value="1" /> | |
| 98 | <feature name="exrom" value="1" /> | |
| 99 | ||
| 100 | <dataarea name="roml" size="0x2000"> | |
| 101 | <rom name="c128diag_789010.bin" size="0x2000" crc="3b5fcdbd" sha1="da8851745b90dfafe4e05b2bf4e8e224b553170a" offset="0" /> | |
| 102 | </dataarea> | |
| 103 | </part> | |
| 104 | </software> | |
| 105 | ||
| 106 | 75 | <software name="comal128" supported="no"> |
| 107 | 76 | <description>COMAL 80</description> |
| 108 | 77 | <year>1985</year> |
| r253556 | r253557 | |
| 132 | 101 | <feature name="exrom" value="1" /> |
| 133 | 102 | |
| 134 | 103 | <dataarea name="roml" size="0x2000"> |
| 135 | <rom name="mach_128_v1a.bin" size="0x2000" crc="f91ed380" sha1="6f04d73fcde8b28903075e3adcd2d7ff49d2518a" offset="0" /> | |
| 104 | <rom name="mach_128_v1a.bin" size="0x2000" crc="f91ed380" sha1="6f04d73fcde8b28903075e3adcd2d7ff49d2518a" offset="0x0000" /> | |
| 136 | 105 | </dataarea> |
| 137 | 106 | </part> |
| 138 | 107 | |
| r253556 | r253557 | |
| 154 | 123 | <feature name="exrom" value="1" /> |
| 155 | 124 | |
| 156 | 125 | <dataarea name="roml" size="0x2000"> |
| 157 | <rom name="mach_128_v2a.bin" size="0x2000" crc="fc60d92e" sha1="7f487134d314b4c5158954ad057e01c0da32a468" offset="0" /> | |
| 126 | <rom name="mach_128_v2a.bin" size="0x2000" crc="fc60d92e" sha1="7f487134d314b4c5158954ad057e01c0da32a468" offset="0x0000" /> | |
| 158 | 127 | </dataarea> |
| 159 | 128 | </part> |
| 160 | 129 |
| r253556 | r253557 | |
|---|---|---|
| 4772 | 4772 | </software> |
| 4773 | 4773 | |
| 4774 | 4774 | <software name="c64diag"> |
| 4775 | <description>C-64 Diagnostic | |
| 4775 | <description>C-64 Diagnostic r.586220</description> | |
| 4776 | 4776 | <year>19??</year> |
| 4777 | 4777 | <publisher><unknown></publisher> |
| 4778 | 4778 | <part name="cart" interface="c64_cart"> |
| r253556 | r253557 | |
| 4844 | 4844 | <description>C64 Diagnostic</description> |
| 4845 | 4845 | <year>19??</year> |
| 4846 | 4846 | <publisher>Commodore</publisher> |
| 4847 | <info name="serial" value="324528-02" /> | |
| 4848 | 4847 | <part name="cart" interface="c64_cart"> |
| 4849 | 4848 | <feature name="exrom" value="0" /> |
| 4850 | 4849 | <feature name="game" value="1" /> |
| r253556 | r253557 | |
| 4854 | 4853 | </part> |
| 4855 | 4854 | </software> |
| 4856 | 4855 | |
| 4857 | <software name="c64dia41"> | |
| 4858 | <description>C-64 Diagnostic (Rev 4.1.0)</description> | |
| 4859 | <year>19??</year> | |
| 4860 | <publisher>Commodore</publisher> | |
| 4861 | <part name="cart" interface="c64_cart"> | |
| 4862 | <feature name="exrom" value="0" /> | |
| 4863 | <feature name="game" value="1" /> | |
| 4864 | <dataarea name="roml" size="0x2000"> | |
| 4865 | <rom name="commodorediagrev410.bin" size="0x2000" crc="9d1a9181" sha1="5800219da86c00e583f7100e91febe528208ec46" offset="0x0000" /> | |
| 4866 | </dataarea> | |
| 4867 | </part> | |
| 4868 | </software> | |
| 4869 | ||
| 4870 | 4856 | <software name="calcres"> |
| 4871 | 4857 | <description>Calc Result</description> |
| 4872 | 4858 | <year>1983</year> |
| r253556 | r253557 | |
|---|---|---|
| 1374 | 1374 | |
| 1375 | 1375 | shaders: |
| 1376 | 1376 | $(SILENT) $(MAKE) -C $(SRC)/osd/modules/render/bgfx rebuild |
| 1377 | ||
| 1378 | .PHONY: translation | |
| 1379 | ||
| 1380 | translation: | |
| 1381 | $(SILENT) echo Generating mame.po | |
| 1382 | $(SILENT) find src/emu/ui -iname "*.cpp" | xargs xgettext --from-code=ASCII -k_ --default-domain=mame |
| r253556 | r253557 | |
|---|---|---|
| 773 | 773 | |
| 774 | 774 | --------------------------------------------------- |
| 775 | 775 | -- |
| 776 | --@src/devices/machine/hp_taco.h,MACHINES["HP_TACO"] = true | |
| 777 | --------------------------------------------------- | |
| 778 | ||
| 779 | if (MACHINES["HP_TACO"]~=null) then | |
| 780 | files { | |
| 781 | MAME_DIR .. "src/devices/machine/hp_taco.cpp", | |
| 782 | MAME_DIR .. "src/devices/machine/hp_taco.h", | |
| 783 | } | |
| 784 | end | |
| 785 | ||
| 786 | --------------------------------------------------- | |
| 787 | -- | |
| 788 | 776 | --@src/devices/machine/i2cmem.h,MACHINES["I2CMEM"] = true |
| 789 | 777 | --------------------------------------------------- |
| 790 | 778 |
| r253556 | r253557 | |
|---|---|---|
| 107 | 107 | includedirs { |
| 108 | 108 | MAME_DIR .. "3rdparty/bgfx/include", |
| 109 | 109 | MAME_DIR .. "3rdparty/bx/include", |
| 110 | MAME_DIR .. "3rdparty/rapidjson/include", | |
| 111 | 110 | } |
| 112 | 111 | |
| 113 | 112 | if _OPTIONS["NO_USE_MIDI"]=="1" then |
| r253556 | r253557 | |
|---|---|---|
| 159 | 159 | MAME_DIR .. "src/osd/modules/render/d3d/d3dcomm.h", |
| 160 | 160 | MAME_DIR .. "src/osd/modules/render/d3d/d3dhlsl.h", |
| 161 | 161 | MAME_DIR .. "src/osd/modules/render/d3d/d3dintf.h", |
| 162 | MAME_DIR .. "src/osd/modules/render/drawdd.cpp", | |
| 162 | 163 | MAME_DIR .. "src/osd/modules/render/drawgdi.cpp", |
| 163 | 164 | MAME_DIR .. "src/osd/modules/render/drawnone.cpp", |
| 164 | 165 | MAME_DIR .. "src/osd/windows/input.cpp", |
| r253556 | r253557 | |
|---|---|---|
| 398 | 398 | MACHINES["F3853"] = true |
| 399 | 399 | MACHINES["HD63450"] = true |
| 400 | 400 | MACHINES["HD64610"] = true |
| 401 | MACHINES["HP_TACO"] = true | |
| 402 | 401 | MACHINES["I2CMEM"] = true |
| 403 | 402 | MACHINES["I80130"] = true |
| 404 | 403 | MACHINES["I8089"] = true |
| r253556 | r253557 | |
|---|---|---|
| 281 | 281 | "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", |
| 282 | 282 | }; |
| 283 | 283 | |
| 284 | static const char *const r32_names[8 | |
| 284 | static const char *const r32_names[8] = { | |
| 285 | 285 | "er0", "er1", "er2", "er3", "er4", "er5", "er6", "sp", |
| 286 | 286 | }; |
| 287 | 287 |
| r253556 | r253557 | |
|---|---|---|
| 673 | 673 | return RIO(CURRENT_PA , addr_wo_bsc - HP_REG_R4_ADDR); |
| 674 | 674 | |
| 675 | 675 | case HP_REG_IV_ADDR: |
| 676 | return m_reg_IV; | |
| 676 | // Correct? | |
| 677 | if (!BIT(m_flags , HPHYBRID_IRH_SVC_BIT) && !BIT(m_flags , HPHYBRID_IRL_SVC_BIT)) { | |
| 678 | return m_reg_IV; | |
| 679 | } else { | |
| 680 | return m_reg_IV | CURRENT_PA; | |
| 681 | } | |
| 677 | 682 | |
| 678 | 683 | case HP_REG_PA_ADDR: |
| 679 | 684 | return CURRENT_PA; |
| r253556 | r253557 | |
| 1016 | 1021 | |
| 1017 | 1022 | // Do a double-indirect JSM IV,I instruction |
| 1018 | 1023 | WM(AEC_CASE_C , ++m_reg_R , m_reg_P); |
| 1019 | m_reg_P = RM(AEC_CASE_I , | |
| 1024 | m_reg_P = RM(AEC_CASE_I , RM(HP_REG_IV_ADDR)); | |
| 1020 | 1025 | m_reg_I = fetch(); |
| 1021 | 1026 | } |
| 1022 | 1027 |
| r253556 | r253557 | |
|---|---|---|
| 976 | 976 | //logerror("IRQ (%08x): Interrupt during V8086 task\n",m_pc); |
| 977 | 977 | if(type & 0x08) |
| 978 | 978 | { |
| 979 | PUSH32SEG(m_sreg[GS].selector & 0xffff); | |
| 980 | PUSH32SEG(m_sreg[FS].selector & 0xffff); | |
| 981 | PUSH32SEG(m_sreg[DS].selector & 0xffff); | |
| 982 | PUSH32SEG(m_sreg[ES].selector & 0xffff); | |
| 979 | PUSH32(m_sreg[GS].selector & 0xffff); | |
| 980 | PUSH32(m_sreg[FS].selector & 0xffff); | |
| 981 | PUSH32(m_sreg[DS].selector & 0xffff); | |
| 982 | PUSH32(m_sreg[ES].selector & 0xffff); | |
| 983 | 983 | } |
| 984 | 984 | else |
| 985 | 985 | { |
| r253556 | r253557 | |
| 1001 | 1001 | if(type & 0x08) |
| 1002 | 1002 | { |
| 1003 | 1003 | // 32-bit gate |
| 1004 | PUSH32 | |
| 1004 | PUSH32(oldSS); | |
| 1005 | 1005 | PUSH32(oldESP); |
| 1006 | 1006 | } |
| 1007 | 1007 | else |
| r253556 | r253557 | |
| 1063 | 1063 | else |
| 1064 | 1064 | { |
| 1065 | 1065 | PUSH32(oldflags & 0x00ffffff ); |
| 1066 | PUSH32 | |
| 1066 | PUSH32(m_sreg[CS].selector ); | |
| 1067 | 1067 | if(irq == 3 || irq == 4 || irq == 9 || irq_gate == 1) |
| 1068 | 1068 | PUSH32(m_eip ); |
| 1069 | 1069 | else |
| r253556 | r253557 | |
| 1935 | 1935 | |
| 1936 | 1936 | if(operand32 != 0) |
| 1937 | 1937 | { |
| 1938 | PUSH32 | |
| 1938 | PUSH32(oldSS); | |
| 1939 | 1939 | PUSH32(oldESP); |
| 1940 | 1940 | } |
| 1941 | 1941 | else |
| r253556 | r253557 | |
| 2069 | 2069 | else |
| 2070 | 2070 | { |
| 2071 | 2071 | /* 32-bit operand size */ |
| 2072 | PUSH32 | |
| 2072 | PUSH32(m_sreg[CS].selector ); | |
| 2073 | 2073 | PUSH32(m_eip ); |
| 2074 | 2074 | m_sreg[CS].selector = selector; |
| 2075 | 2075 | m_performed_intersegment_jump = 1; |
| r253556 | r253557 | |
| 2574 | 2574 | } |
| 2575 | 2575 | if((desc.flags & 0x0080) == 0) |
| 2576 | 2576 | { |
| 2577 | logerror("IRET: | |
| 2577 | logerror("IRET: Return CS segment is not present.\n"); | |
| 2578 | 2578 | FAULT(FAULT_NP,newCS & ~0x03) |
| 2579 | 2579 | } |
| 2580 | 2580 | if(newEIP > desc.limit) |
| r253556 | r253557 | |
| 3756 | 3756 | // Family 3 (386), Model 0 (DX), Stepping 8 (D1) |
| 3757 | 3757 | REG32(EAX) = 0; |
| 3758 | 3758 | REG32(EDX) = (3 << 8) | (0 << 4) | (8); |
| 3759 | m_cpu_version = REG32(EDX); | |
| 3760 | 3759 | |
| 3761 | 3760 | m_CPL = 0; |
| 3762 | 3761 | |
| r253556 | r253557 | |
| 3830 | 3829 | WRITE32(REG32(ESI), smram_state+SMRAM_ESI); |
| 3831 | 3830 | WRITE32(REG32(EDI), smram_state+SMRAM_EDI); |
| 3832 | 3831 | WRITE32(m_eip, smram_state+SMRAM_EIP); |
| 3833 | WRITE32(old_flags, smram_state+SMRAM_E | |
| 3832 | WRITE32(old_flags, smram_state+SMRAM_EAX); | |
| 3834 | 3833 | WRITE32(m_cr[3], smram_state+SMRAM_CR3); |
| 3835 | 3834 | WRITE32(old_cr0, smram_state+SMRAM_CR0); |
| 3836 | 3835 | |
| r253556 | r253557 | |
| 4047 | 4046 | // Family 4 (486), Model 0/1 (DX), Stepping 3 |
| 4048 | 4047 | REG32(EAX) = 0; |
| 4049 | 4048 | REG32(EDX) = (4 << 8) | (0 << 4) | (3); |
| 4050 | m_cpu_version = REG32(EDX); | |
| 4051 | 4049 | |
| 4052 | 4050 | CHANGE_PC(m_eip); |
| 4053 | 4051 | } |
| r253556 | r253557 | |
|---|---|---|
| 333 | 333 | inline UINT32 DEC32(UINT32 dst); |
| 334 | 334 | inline void PUSH16(UINT16 value); |
| 335 | 335 | inline void PUSH32(UINT32 value); |
| 336 | inline void PUSH32SEG(UINT32 value); | |
| 337 | 336 | inline void PUSH8(UINT8 value); |
| 338 | 337 | inline UINT8 POP8(); |
| 339 | 338 | inline UINT16 POP16(); |
| r253556 | r253557 | |
|---|---|---|
| 475 | 475 | } |
| 476 | 476 | else |
| 477 | 477 | { |
| 478 | PUSH32 | |
| 478 | PUSH32(m_sreg[CS].selector ); | |
| 479 | 479 | PUSH32(m_eip ); |
| 480 | 480 | m_sreg[CS].selector = ptr; |
| 481 | 481 | m_performed_intersegment_jump = 1; |
| r253556 | r253557 | |
| 1717 | 1717 | else |
| 1718 | 1718 | offset = (REG16(SP) - 4) & 0xffff; |
| 1719 | 1719 | if(i386_limit_check(SS,offset) == 0) |
| 1720 | PUSH32 | |
| 1720 | PUSH32(m_sreg[CS].selector ); | |
| 1721 | 1721 | else |
| 1722 | 1722 | FAULT(FAULT_SS,0) |
| 1723 | 1723 | CYCLES(CYCLES_PUSH_SREG); |
| r253556 | r253557 | |
| 1731 | 1731 | else |
| 1732 | 1732 | offset = (REG16(SP) - 4) & 0xffff; |
| 1733 | 1733 | if(i386_limit_check(SS,offset) == 0) |
| 1734 | PUSH32 | |
| 1734 | PUSH32(m_sreg[DS].selector ); | |
| 1735 | 1735 | else |
| 1736 | 1736 | FAULT(FAULT_SS,0) |
| 1737 | 1737 | CYCLES(CYCLES_PUSH_SREG); |
| r253556 | r253557 | |
| 1745 | 1745 | else |
| 1746 | 1746 | offset = (REG16(SP) - 4) & 0xffff; |
| 1747 | 1747 | if(i386_limit_check(SS,offset) == 0) |
| 1748 | PUSH32 | |
| 1748 | PUSH32(m_sreg[ES].selector ); | |
| 1749 | 1749 | else |
| 1750 | 1750 | FAULT(FAULT_SS,0) |
| 1751 | 1751 | CYCLES(CYCLES_PUSH_SREG); |
| r253556 | r253557 | |
| 1759 | 1759 | else |
| 1760 | 1760 | offset = (REG16(SP) - 4) & 0xffff; |
| 1761 | 1761 | if(i386_limit_check(SS,offset) == 0) |
| 1762 | PUSH32 | |
| 1762 | PUSH32(m_sreg[FS].selector ); | |
| 1763 | 1763 | else |
| 1764 | 1764 | FAULT(FAULT_SS,0) |
| 1765 | 1765 | CYCLES(CYCLES_PUSH_SREG); |
| r253556 | r253557 | |
| 1773 | 1773 | else |
| 1774 | 1774 | offset = (REG16(SP) - 4) & 0xffff; |
| 1775 | 1775 | if(i386_limit_check(SS,offset) == 0) |
| 1776 | PUSH32 | |
| 1776 | PUSH32(m_sreg[GS].selector ); | |
| 1777 | 1777 | else |
| 1778 | 1778 | FAULT(FAULT_SS,0) |
| 1779 | 1779 | CYCLES(CYCLES_PUSH_SREG); |
| r253556 | r253557 | |
| 1787 | 1787 | else |
| 1788 | 1788 | offset = (REG16(SP) - 4) & 0xffff; |
| 1789 | 1789 | if(i386_limit_check(SS,offset) == 0) |
| 1790 | PUSH32 | |
| 1790 | PUSH32(m_sreg[SS].selector ); | |
| 1791 | 1791 | else |
| 1792 | 1792 | FAULT(FAULT_SS,0) |
| 1793 | 1793 | CYCLES(CYCLES_PUSH_SREG); |
| r253556 | r253557 | |
| 2845 | 2845 | } |
| 2846 | 2846 | else |
| 2847 | 2847 | { |
| 2848 | PUSH32 | |
| 2848 | PUSH32(m_sreg[CS].selector ); | |
| 2849 | 2849 | PUSH32(m_eip ); |
| 2850 | 2850 | m_sreg[CS].selector = selector; |
| 2851 | 2851 | m_performed_intersegment_jump = 1; |
| r253556 | r253557 | |
|---|---|---|
| 297 | 297 | { 0x03, OP_2BYTE|OP_I386, &i386_device::i386_lsl_r16_rm16, &i386_device::i386_lsl_r32_rm32, false}, |
| 298 | 298 | { 0x06, OP_2BYTE|OP_I386, &i386_device::i386_clts, &i386_device::i386_clts, false}, |
| 299 | 299 | { 0x07, OP_2BYTE|OP_I386, &i386_device::i386_loadall, &i386_device::i386_loadall, false}, |
| 300 | { 0x07, OP_2BYTE|OP_I486, &i386_device::i386_invalid, &i386_device::i386_invalid, false}, | |
| 301 | 300 | { 0x08, OP_2BYTE|OP_I486, &i386_device::i486_invd, &i386_device::i486_invd, false}, |
| 302 | 301 | { 0x09, OP_2BYTE|OP_I486, &i386_device::i486_wbinvd, &i386_device::i486_wbinvd, false}, |
| 303 | 302 | { 0x0B, OP_2BYTE|OP_PENTIUM, &i386_device::pentium_ud2, &i386_device::pentium_ud2, false}, |
| r253556 | r253557 | |
|---|---|---|
| 2504 | 2504 | |
| 2505 | 2505 | void i386_device::i386_loadall() // Opcode 0x0f 0x07 (0x0f 0x05 on 80286), undocumented |
| 2506 | 2506 | { |
| 2507 | if(PROTECTED_MODE && (m_CPL != 0)) | |
| 2508 | FAULT(FAULT_GP,0) | |
| 2509 | UINT32 ea = i386_translate(ES, REG32(EDI), 0); | |
| 2510 | m_cr[0] = READ32(ea) & 0xfffeffff; // wp not supported on 386 | |
| 2511 | set_flags(READ32(ea + 0x04)); | |
| 2512 | m_eip = READ32(ea + 0x08); | |
| 2513 | REG32(EDI) = READ32(ea + 0x0c); | |
| 2514 | REG32(ESI) = READ32(ea + 0x10); | |
| 2515 | REG32(EBP) = READ32(ea + 0x14); | |
| 2516 | REG32(ESP) = READ32(ea + 0x18); | |
| 2517 | REG32(EBX) = READ32(ea + 0x1c); | |
| 2518 | REG32(EDX) = READ32(ea + 0x20); | |
| 2519 | REG32(ECX) = READ32(ea + 0x24); | |
| 2520 | REG32(EAX) = READ32(ea + 0x28); | |
| 2521 | m_dr[6] = READ32(ea + 0x2c); | |
| 2522 | m_dr[7] = READ32(ea + 0x30); | |
| 2523 | m_task.segment = READ16(ea + 0x34); | |
| 2524 | m_ldtr.segment = READ16(ea + 0x38); | |
| 2525 | m_sreg[GS].selector = READ16(ea + 0x3c); | |
| 2526 | m_sreg[FS].selector = READ16(ea + 0x40); | |
| 2527 | m_sreg[DS].selector = READ16(ea + 0x44); | |
| 2528 | m_sreg[SS].selector = READ16(ea + 0x48); | |
| 2529 | m_sreg[CS].selector = READ16(ea + 0x4c); | |
| 2530 | m_sreg[ES].selector = READ16(ea + 0x50); | |
| 2531 | m_task.flags = READ32(ea + 0x54) >> 8; | |
| 2532 | m_task.base = READ32(ea + 0x58); | |
| 2533 | m_task.limit = READ32(ea + 0x5c); | |
| 2534 | m_idtr.base = READ32(ea + 0x64); | |
| 2535 | m_idtr.limit = READ32(ea + 0x68); | |
| 2536 | m_gdtr.base = READ32(ea + 0x70); | |
| 2537 | m_gdtr.limit = READ32(ea + 0x74); | |
| 2538 | m_ldtr.flags = READ32(ea + 0x78) >> 8; | |
| 2539 | m_ldtr.base = READ32(ea + 0x7c); | |
| 2540 | m_ldtr.limit = READ32(ea + 0x80); | |
| 2541 | m_sreg[GS].flags = READ32(ea + 0x84) >> 8; | |
| 2542 | m_sreg[GS].base = READ32(ea + 0x88); | |
| 2543 | m_sreg[GS].limit = READ32(ea + 0x8c); | |
| 2544 | m_sreg[FS].flags = READ32(ea + 0x90) >> 8; | |
| 2545 | m_sreg[FS].base = READ32(ea + 0x94); | |
| 2546 | m_sreg[FS].limit = READ32(ea + 0x98); | |
| 2547 | m_sreg[DS].flags = READ32(ea + 0x9c) >> 8; | |
| 2548 | m_sreg[DS].base = READ32(ea + 0xa0); | |
| 2549 | m_sreg[DS].limit = READ32(ea + 0xa4); | |
| 2550 | m_sreg[SS].flags = READ32(ea + 0xa8) >> 8; | |
| 2551 | m_sreg[SS].base = READ32(ea + 0xac); | |
| 2552 | m_sreg[SS].limit = READ32(ea + 0xb0); | |
| 2553 | m_sreg[CS].flags = READ32(ea + 0xb4) >> 8; | |
| 2554 | m_sreg[CS].base = READ32(ea + 0xb8); | |
| 2555 | m_sreg[CS].limit = READ32(ea + 0xbc); | |
| 2556 | m_sreg[ES].flags = READ32(ea + 0xc0) >> 8; | |
| 2557 | m_sreg[ES].base = READ32(ea + 0xc4); | |
| 2558 | m_sreg[ES].limit = READ32(ea + 0xc8); | |
| 2559 | m_CPL = (m_sreg[SS].flags >> 5) & 3; // cpl == dpl of ss | |
| 2560 | ||
| 2561 | for(int i = 0; i < GS; i++) | |
| 2562 | { | |
| 2563 | m_sreg[i].valid = (m_sreg[i].flags & 0x80) ? true : false; | |
| 2564 | m_sreg[i].d = (m_sreg[i].flags & 0x4000) ? 1 : 0; | |
| 2565 | } | |
| 2566 | CHANGE_PC(m_eip); | |
| 2507 | fatalerror("i386: LOADALL unimplemented at %08X\n", m_pc - 1); | |
| 2567 | 2508 | } |
| 2568 | 2509 | |
| 2569 | 2510 | void i386_device::i386_invalid() |
| r253556 | r253557 | |
|---|---|---|
| 1000 | 1000 | REG16(SP) = new_esp; |
| 1001 | 1001 | } |
| 1002 | 1002 | } |
| 1003 | ||
| 1004 | void i386_device::PUSH32SEG(UINT32 value) | |
| 1005 | { | |
| 1006 | UINT32 ea, new_esp; | |
| 1007 | if( STACK_32BIT ) { | |
| 1008 | new_esp = REG32(ESP) - 4; | |
| 1009 | ea = i386_translate(SS, new_esp, 1); | |
| 1010 | ((m_cpu_version & 0xf00) == 0x300) ? WRITE16(ea, value) : WRITE32(ea, value ); // 486 also? | |
| 1011 | REG32(ESP) = new_esp; | |
| 1012 | } else { | |
| 1013 | new_esp = (REG16(SP) - 4) & 0xffff; | |
| 1014 | ea = i386_translate(SS, new_esp, 1); | |
| 1015 | ((m_cpu_version & 0xf00) == 0x300) ? WRITE16(ea, value) : WRITE32(ea, value ); | |
| 1016 | REG16(SP) = new_esp; | |
| 1017 | } | |
| 1018 | } | |
| 1019 | ||
| 1020 | 1003 | void i386_device::PUSH8(UINT8 value) |
| 1021 | 1004 | { |
| 1022 | 1005 | if( m_operand_size ) { |
| r253556 | r253557 | |
|---|---|---|
| 25 | 25 | // device type definition |
| 26 | 26 | const device_type COM8116 = &device_creator<com8116_device>; |
| 27 | 27 | |
| 28 | // Parts with T after the number do not have an internal oscillator and require an external clock source | |
| 29 | // The SMC/COM 5xxx parts are all dual 5v/12v parts, while the 8xxx parts are 5v only | |
| 30 | 28 | |
| 31 | // SMC/COM5016(T) with no dash, aka 'STD' part on the datasheet | |
| 32 | // Also COM8116(T)/8126(T)/8136(T)/8146(T) and Synertek sy2661-3 and GI AY-5-8116(T)-000 and GI AY-5-8136(T)-000 and WD WD-1943-00 (aka WD8136-00) | |
| 33 | // SMC/COM8156(T) is the same chip but clocked twice as fast and 32x clocks per baud instead of 16x | |
| 34 | // baud rates are 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200 | |
| 35 | 29 | const int com8116_device::divisors_16X_5_0688MHz[] = |
| 36 | 30 | { 6336, 4224, 2880, 2355, 2112, 1056, 528, 264, 176, 158, 132, 88, 66, 44, 33, 16 }; |
| 37 | 31 | |
| 38 | // SMC/COM8116-003 | |
| 39 | // from http://www.vintagecomputer.net/fjkraan/comp/divcomp/doc/SMC_BaudGen.pdf page 283 (pdf page 20) | |
| 40 | // baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 9600, 19200 | |
| 41 | const int com8116_device::divisors_16X_6_01835MHz[] = | |
| 42 | { 7523, 5015, 3420, 2797, 2508, 1881, 1254, 627, 313, 209, 188, 157, 104, 78, 39, 20 }; | |
| 43 | ||
| 44 | // SMC/COM5016(T)-5 and WD WD-1943-05; Synertek SY2661-1 and 2 are NOT the same as this despite using same clock speed, see below | |
| 45 | // SMC/COM8156(T)-5 is the same chip but clocked twice as fast and 32x clocks per baud instead of 16x | |
| 46 | // baud rates are 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 7200, 9600, 19200 | |
| 47 | 32 | const int com8116_device::divisors_16X_4_9152MHz[] = |
| 48 | 33 | { 6144, 4096, 2793, 2284, 2048, 1024, 512, 256, 171, 154, 128, 85, 64, 43, 32, 16 }; |
| 49 | 34 | |
| 50 | // SMC/COM5016(T)-6 and WD WD-1943-06 | |
| 51 | // baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2400, 3600, 4800, 7200, 9600, 19200 | |
| 52 | 35 | const int com8116_device::divisors_32X_5_0688MHz[] = |
| 53 | 36 | { 3168, 2112, 1440, 1177, 1056, 792, 528, 264, 132, 88, 66, 44, 33, 22, 16, 8 }; |
| 54 | 37 | |
| 55 | // SMC/COM5016(T)-013 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/terminal/vt100/EK-VT100-TM-003_VT100_Technical_Manual_Jul82.pdf page 4-27 (pdf page 78)) | |
| 56 | // and from http://www.vintagecomputer.net/fjkraan/comp/divcomp/doc/SMC_BaudGen.pdf page 283 (pdf page 20) | |
| 57 | // SMC/COM5106-013A is the same chip clocked twice as fast, but with 32x clocks per baud instead of 16x | |
| 58 | // baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1200, 1800, 2000, 2400, 3600, 4800, 9600, 19200 | |
| 59 | const int com8116_device::divisors_16X_2_7648MHz[] = | |
| 60 | { 3456, 2304, 1571, 1285, 1152, 864, 576, 288, 144, 96, 86, 72, 48, 36, 18, 9 }; | |
| 61 | 38 | |
| 62 | // SMC/COM5026(T)-030 (non-standard serial rates, from http://bitsavers.informatik.uni-stuttgart.de/pdf/standardMicrosystems/_dataBooks/1979_StandardMicrosystems.pdf page 135) | |
| 63 | const int com8116_device::divisors_16X_5_0688MHz_030[] = | |
| 64 | { 731, 733, 735, 737, 741, 743, 745, 751, 6970, 5569, 5433, 4752, 4269, 1920, 1584, 301 }; | |
| 65 | 39 | |
| 66 | // SMC/COM5036(T)-080 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/standardMicrosystems/_dataBooks/1979_StandardMicrosystems.pdf page 135) | |
| 67 | const int com8116_device::divisors_16X_4_6080MHz[] = | |
| 68 | { 5760, 3840, 2618, 2141, 1920, 960, 480, 240, 160, 144, 120, 80, 60, 40, 30, 15 }; | |
| 69 | ||
| 70 | // COM8046 combines the -6 and STD tables into one device as a 32-entry table | |
| 71 | ||
| 72 | // Synertek SY2661-1 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/synertek/_dataBooks/Synertek_1981-1982_Data_Catalog.pdf page 3-40 (pdf page 139)) | |
| 73 | // baud rates are 50, 75, 110, 134.5, 150, 200, 300, 600, 1050, 1200, 1800, 2000, 2400, 4800, 9600, 19200 | |
| 74 | const int com8116_device::divisors_16X_4_9152MHz_SY2661_1[] = | |
| 75 | { 6144, 4096, 2793, 2284, 2048, 1536, 1024, 512, 292, 256, 171, 154, 128, 64, 32, 16 }; | |
| 76 | ||
| 77 | // Synertek SY2661-2 (from http://bitsavers.informatik.uni-stuttgart.de/pdf/synertek/_dataBooks/Synertek_1981-1982_Data_Catalog.pdf page 3-40 (pdf page 139)) | |
| 78 | // baud rates are 45.5, 50, 75, 110, 134.5, 150, 300, 600, 1200, 1800, 2000, 2400, 4800, 9600, 19200, 38400 | |
| 79 | const int com8116_device::divisors_16X_4_9152MHz_SY2661_2[] = | |
| 80 | { 6752, 6144, 4096, 2793, 2284, 2048, 1024, 512, 256, 171, 154, 128, 64, 32, 16, 8 }; | |
| 81 | ||
| 82 | 40 | //************************************************************************** |
| 83 | 41 | // LIVE DEVICE |
| 84 | 42 | //************************************************************************** |
| r253556 | r253557 | |
|---|---|---|
| 63 | 63 | DECLARE_WRITE8_MEMBER( stt_w ); |
| 64 | 64 | |
| 65 | 65 | static const int divisors_16X_5_0688MHz[]; |
| 66 | static const int divisors_16X_6_01835MHz[]; | |
| 67 | 66 | static const int divisors_16X_4_9152MHz[]; |
| 68 | 67 | static const int divisors_32X_5_0688MHz[]; |
| 69 | static const int divisors_16X_2_7648MHz[]; | |
| 70 | static const int divisors_16X_5_0688MHz_030[]; | |
| 71 | static const int divisors_16X_4_6080MHz[]; | |
| 72 | static const int divisors_16X_4_9152MHz_SY2661_1[]; | |
| 73 | static const int divisors_16X_4_9152MHz_SY2661_2[]; | |
| 74 | 68 | |
| 75 | 69 | protected: |
| 76 | 70 | // device-level overrides |
| r253556 | r253557 | |
|---|---|---|
| 874 | 874 | // Status of command |
| 875 | 875 | // |
| 876 | 876 | UINT8 corvus_hdc_t::corvus_write_firmware_block(UINT8 head, UINT8 sector, UINT8 *buffer) { |
| 877 | UINT16 relative_sector; // Relative sector on drive for Physical | |
| 877 | UINT16 relative_sector; // Relative sector on drive for Physical Read | |
| 878 | 878 | UINT8 status; |
| 879 | 879 | |
| 880 | 880 | relative_sector = head * m_sectors_per_track + sector; |
| r253556 | r253557 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:F. Ulivi | |
| 3 | /********************************************************************* | |
| 4 | ||
| 5 | hp_taco.cpp | |
| 6 | ||
| 7 | HP TApe COntroller (5006-3012) | |
| 8 | ||
| 9 | *********************************************************************/ | |
| 10 | ||
| 11 | // This device has been reverse engineered entirely through documents & study of HP software. | |
| 12 | // I had no access to the real device to experiment. | |
| 13 | // Available documentation on the internal working of TACO chip is close to nothing. The best | |
| 14 | // I could find is [1] (see below) where all that's described is a (too) brief summary of registers and little else. | |
| 15 | // In other words, no description of the commands that can be issued to TACO chips. | |
| 16 | // So, my main source of information was the careful study of HP software, especially the 9845 system test ROM (09845-66520). | |
| 17 | // The second half of this ROM holds a comprehensive set of tape drive tests. | |
| 18 | // The main shortcomings of my approach are: | |
| 19 | // * I could indentify only those TACO commands that are actually used by the software. I managed | |
| 20 | // to identify 17 out of 32 possible commands. The purpose of the rest of commands is anyone's guess. | |
| 21 | // * I could only guess the behavior of TACO chips in corner cases (especially behavior in various error/abnormal | |
| 22 | // conditions) | |
| 23 | // | |
| 24 | // Documentation I used: | |
| 25 | // [1] HP, manual 64940-90905, may 80 rev. - Model 64940A tape control & drive service manual | |
| 26 | // [2] US patent 4,075,679 describing HP9825 system (this system had a discrete implementation of tape controller). The | |
| 27 | // firmware listing was quite useful in identifying sequences of commands (for example how to find a specific sector etc.). | |
| 28 | // [3] http://www.hp9845.net site | |
| 29 | // [4] April 1978 issue of HP Journal. There is a one-page summary of TACO chip on page 20. | |
| 30 | ||
| 31 | // This is an overview of the TACO/CPU interface. | |
| 32 | // | |
| 33 | // Reg. | R/W | Content | |
| 34 | // ===================== | |
| 35 | // R4 | R/W | Data register: words read/written to/from tape pass through this register | |
| 36 | // R5 | R/W | Command and status register (see below) | |
| 37 | // R6 | R/W | Tachometer register. Writing it sets a pulse counter that counts up on either tachometer pulses or IRGs, depending | |
| 38 | // | | on command. When the counter rolls over from 0xffff to 0 it typically ends the command. It's not clear to me | |
| 39 | // | | what value could be read from this register, if it's just the same value that was written last time or the internal | |
| 40 | // | | counter or something else entirely. | |
| 41 | // R7 | R | Checksum register. Reading it clears it. | |
| 42 | // R7 | W | Timing register. It controls somehow the encoding and decoding of bits. For now I completely ignore it because its | |
| 43 | // | | content it's totally unknown to me. It seems safe to do so, anyway. I can see that it's always set to 0x661d before | |
| 44 | // | | writing to tape and to 0x0635 before reading. | |
| 45 | // | |
| 46 | // Format of TACO command/status register (R5) | |
| 47 | // Bit R/W Content | |
| 48 | // =============== | |
| 49 | // 15 RW Tape direction (1 = forward) | |
| 50 | // 14..10 RW Command (see the "enum" below) | |
| 51 | // 9 RW ? Drive ON according to [1], the actual use seems to be selection of gap length | |
| 52 | // 8 RW ? Size of gaps according to [1], N/U in my opinion | |
| 53 | // 7 RW Speed of tape (1 = 90 ips, 0 = 22 ips) | |
| 54 | // 6 RW Option bit for various commands | |
| 55 | // 5 R Current track (1 = B) | |
| 56 | // 4 R Gap detected (1) | |
| 57 | // 3 R Write protection (1) | |
| 58 | // 2 R Servo failure (1) | |
| 59 | // 1 R Cartridge out (1) | |
| 60 | // 0 R Hole detected (1) | |
| 61 | ||
| 62 | // Here's a summary of the on-tape format of HP9845 systems. | |
| 63 | // * A tape has two independent tracks (A & B). | |
| 64 | // * Each track holds 426 sectors. | |
| 65 | // * Each sector has an header and 256 bytes of payload (see below) | |
| 66 | // * Sectors are separated by gaps of uniform magnetization called IRGs (Inter-Record Gaps) | |
| 67 | // * The basic unit of data I/O are 16-bit words | |
| 68 | // * Bits are encoded by different distances between magnetic flux reversals | |
| 69 | // * The structure of tracks is: | |
| 70 | // - Begin of tape holes | |
| 71 | // - The deadzone: 350x 0xffff words | |
| 72 | // - 1" of IRG | |
| 73 | // - Sector #0 (track A) or #426 (track B) | |
| 74 | // - 1" of IRG (2.5" on track A) | |
| 75 | // - Sector #1 (track A) or #427 (track B) | |
| 76 | // - 1" of IRG | |
| 77 | // - Sector #2 (track A) or #428 (track B) | |
| 78 | // - ...and so on up to sector #425/#851 | |
| 79 | // - 6" of final gap | |
| 80 | // - Non-recorded tape | |
| 81 | // - End of tape holes | |
| 82 | // * Sector #0 is not used | |
| 83 | // * Sectors #1 and #2 hold the first copy of tape directory | |
| 84 | // * Sectors #3 and #4 hold the second/backup copy of tape directory | |
| 85 | // * User data are stored starting from sector #5 | |
| 86 | // * There is no "fragmentation" map (like file allocation table in FAT filesystem): a file | |
| 87 | // spanning more than 1 sector always occupy a single block of contiguous sectors. | |
| 88 | // | |
| 89 | // A sector is structured like this: | |
| 90 | // Word 0: Invisible preamble word (always 0). Preamble comes from 9825, don't know if it's | |
| 91 | // actually there in TACO encoding. I assumed it is. | |
| 92 | // Word 1: Format/sector in use and other unidentified bits. | |
| 93 | // Word 2: Sector number | |
| 94 | // Word 3: Sector length and other bits | |
| 95 | // Word 4: Checksum (sum of words 1..3) | |
| 96 | // Words 5..132: Payload | |
| 97 | // Word 133: Checksum (sum of words 5..132) | |
| 98 | // | |
| 99 | // Physical encoding of words is borrowed from 9825 as I wasn't able | |
| 100 | // to gather any info on the actual encoding of TACO chips. | |
| 101 | // This is how 9825 encodes words on tape: | |
| 102 | // - the unit of encoding are 16-bit words | |
| 103 | // - each word is encoded from MSB to LSB | |
| 104 | // - each word has an extra invisible "1" encoded at the end | |
| 105 | // - tape is read/written at slow speed only (21.98 ips) | |
| 106 | // - a 0 is encoded with a distance between flux reversals of 1/35200 s | |
| 107 | // (giving a maximum density of about 1600 reversals per inch) | |
| 108 | // - a 1 is encoded with a distance that's 1.75 times that of a 0 | |
| 109 | // | |
| 110 | // This driver is based on the following model of the actual TACO/tape system: | |
| 111 | // * Tape immediately reaches working speed (no spin-up time) | |
| 112 | // * Inversion of tape direction and change of speed are immediate as well | |
| 113 | // * Time & distance to stop the tape are modeled, though. Firmware is upset by | |
| 114 | // a tape with null braking time/distance. | |
| 115 | // * Speed of tape is exceptionally accurate. Real tape was controlled by a closed loop | |
| 116 | // with something like 1% accuracy on speed. | |
| 117 | // * Storage is modeled by one "map" data structure per track. Each map maps the tape position | |
| 118 | // to the 16-bit word stored at that position. Gaps are modeled by lack of data in the map. | |
| 119 | // There is no model of the physical encoding of bits (except to compute how long each word | |
| 120 | // is on tape). | |
| 121 | // * Read threshold is ignored. Real tapes could be read with either a low or high threshold. | |
| 122 | // * "Flag" bit is used as a busy/ready signal in real TACO. Here I assumed the device is | |
| 123 | // always ready, so Flag is always active. | |
| 124 | // * I tried to fill the (many) gaps on chip behavior with "sensible" solutions. I could only | |
| 125 | // validate my solutions by running the original firmware in MAME, though (no real hw at hand). | |
| 126 | // | |
| 127 | // TODOs/issues: | |
| 128 | // * Some code cleanup | |
| 129 | // * Handling of tape holes seems to be wrong: test "C" of test ROM only works partially | |
| 130 | // * Find out what is read from register R6 | |
| 131 | // * Handle device_image_interface::call_display to show state of tape | |
| 132 | // * Find more info on TACO chips (does anyone with a working 9845 or access to internal HP docs want to | |
| 133 | // help me here, please?) | |
| 134 | // | |
| 135 | #include "emu.h" | |
| 136 | #include "hp_taco.h" | |
| 137 | ||
| 138 | // Debugging | |
| 139 | #define VERBOSE 1 | |
| 140 | #define LOG(x) do { if (VERBOSE) logerror x; } while (0) | |
| 141 | #define VERBOSE_0 0 | |
| 142 | #define LOG_0(x) do { if (VERBOSE_0) logerror x; } while (0) | |
| 143 | ||
| 144 | // Macros to clear/set single bits | |
| 145 | #define BIT_MASK(n) (1U << (n)) | |
| 146 | #define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n)) | |
| 147 | #define BIT_SET(w , n) ((w) |= BIT_MASK(n)) | |
| 148 | ||
| 149 | // Timers | |
| 150 | enum { | |
| 151 | TAPE_TMR_ID, | |
| 152 | HOLE_TMR_ID | |
| 153 | }; | |
| 154 | ||
| 155 | // Constants | |
| 156 | #define CMD_REG_MASK 0xffc0 // Command register mask | |
| 157 | #define STATUS_REG_MASK 0x003f // Status register mask | |
| 158 | #define TACH_TICKS_PER_INCH 968 // Tachometer pulses per inch of tape movement | |
| 159 | #define TAPE_POS_FRACT 1024 // 10 bits of fractional part in tape_pos_t | |
| 160 | #define ONE_INCH_POS (TACH_TICKS_PER_INCH * TAPE_POS_FRACT) // Value in tape_pos_t representing 1 inch of tape | |
| 161 | #define TACH_FREQ_SLOW 21276 // Tachometer pulse frequency for slow speed (21.98 ips) | |
| 162 | #define TACH_FREQ_FAST 87196 // Tachometer pulse frequency for fast speed (90.08 ips) | |
| 163 | #define TAPE_LENGTH ((140 * 12 + 72 * 2) * ONE_INCH_POS) // Tape length: 140 ft of usable tape + 72" of punched tape at either end | |
| 164 | #define TAPE_INIT_POS (80 * ONE_INCH_POS) // Initial tape position: 80" from beginning (just past the punched part) | |
| 165 | #define ZERO_BIT_LEN 619 // Length of 0 bits at slow tape speed: 1/(35200 Hz) | |
| 166 | #define ONE_BIT_LEN 1083 // Length of 1 bits at slow tape speed: 1.75 times ZERO_BIT_LEN | |
| 167 | #define QUICK_CMD_USEC 25 // usec for "quick" command execution | |
| 168 | #define FAST_BRAKE_MSEC 73 // Braking time from fast speed to stop (2 ips) in msec (deceleration is 1200 in/s^2) | |
| 169 | #define SLOW_BRAKE_MSEC 17 // Braking time from slow speed to stop in msec | |
| 170 | #define FAST_BRAKE_DIST 3350450 // Braking distance at fast speed (~3.38 in) | |
| 171 | #define SLOW_BRAKE_DIST 197883 // Braking distance at slow speed (~0.2 in) | |
| 172 | #define PREAMBLE_WORD 0 // Value of preamble word | |
| 173 | #define END_GAP_LENGTH (6 * ONE_INCH_POS) // Length of final gap: 6" | |
| 174 | #define MIN_IRG_LENGTH ((tape_pos_t)(0.2 * ONE_INCH_POS)) // Minimum length of IRGs: 0.2" (from 9825, not sure about value in TACO) | |
| 175 | #define NULL_TAPE_POS ((tape_pos_t)-1) // Special value for invalid/unknown tape position | |
| 176 | #define NO_DATA_GAP (17 * ONE_BIT_LEN) // Minimum gap size to detect end of data: length of longest word (0xffff) | |
| 177 | #define FILE_MAGIC 0x4f434154 // Magic value at start of image file: "TACO" | |
| 178 | ||
| 179 | // Parts of command register | |
| 180 | #define CMD_CODE(reg) \ | |
| 181 | (((reg) >> 10) & 0x1f) | |
| 182 | #define DIR_FWD(reg) \ | |
| 183 | (BIT(reg , 15)) | |
| 184 | #define SPEED_FAST(reg) \ | |
| 185 | (BIT(reg , 7)) | |
| 186 | #define CMD_OPT(reg) \ | |
| 187 | (BIT(reg , 6)) | |
| 188 | #define UNKNOWN_B9(reg) \ | |
| 189 | (BIT(reg , 9)) | |
| 190 | #define DIR_FWD_MASK BIT_MASK(15) // Direction = forward | |
| 191 | #define SPEED_FAST_MASK BIT_MASK(7) // Speed = fast | |
| 192 | ||
| 193 | // Commands | |
| 194 | enum { | |
| 195 | CMD_INDTA_INGAP, // 00: scan for data first then for gap | |
| 196 | CMD_UNK_01, // 01: unknown | |
| 197 | CMD_FINAL_GAP, // 02: write final gap | |
| 198 | CMD_INIT_WRITE, // 03: write words for tape formatting | |
| 199 | CMD_STOP, // 04: stop | |
| 200 | CMD_UNK_05, // 05: unknown | |
| 201 | CMD_SET_TRACK, // 06: set A/B track | |
| 202 | CMD_UNK_07, // 07: unknown | |
| 203 | CMD_UNK_08, // 08: unknown | |
| 204 | CMD_UNK_09, // 09: unknown | |
| 205 | CMD_MOVE, // 0a: move tape | |
| 206 | CMD_UNK_0b, // 0b: unknown | |
| 207 | CMD_INGAP_MOVE, // 0c: scan for gap then move a bit further (used to gain some margin when inverting tape movement) | |
| 208 | CMD_UNK_0d, // 0d: unknown | |
| 209 | CMD_CLEAR, // 0e: clear errors/unlatch status bits | |
| 210 | CMD_UNK_0f, // 0f: unknown | |
| 211 | CMD_NOT_INDTA, // 10: scan for end of data | |
| 212 | CMD_UNK_11, // 11: unknown | |
| 213 | CMD_UNK_12, // 12: unknown | |
| 214 | CMD_UNK_13, // 13: unknown | |
| 215 | CMD_UNK_14, // 14: unknown | |
| 216 | CMD_UNK_15, // 15: unknown | |
| 217 | CMD_WRITE_IRG, // 16: write inter-record gap | |
| 218 | CMD_UNK_17, // 17: unknown | |
| 219 | CMD_SCAN_RECORDS, // 18: scan records (count IRGs) | |
| 220 | CMD_RECORD_WRITE, // 19: write record words | |
| 221 | CMD_MOVE_INDTA, // 1a: move then scan for data | |
| 222 | CMD_UNK_1b, // 1b: unknown (for now it seems harmless to handle it as NOP) | |
| 223 | CMD_DELTA_MOVE_HOLE, // 1c: move tape a given distance, intr at end or first hole found (whichever comes first) | |
| 224 | CMD_START_READ, // 1d: start record reading | |
| 225 | CMD_DELTA_MOVE_IRG, // 1e: move tape a given distance, detect gaps in parallel | |
| 226 | CMD_END_READ // 1f: stop reading | |
| 227 | }; | |
| 228 | ||
| 229 | // Bits of status register | |
| 230 | #define STATUS_HOLE_BIT 0 // Hole detected | |
| 231 | #define STATUS_CART_OUT_BIT 1 // Cartridge out | |
| 232 | #define STATUS_SFAIL_BIT 2 // Servo failure | |
| 233 | #define STATUS_WPR_BIT 3 // Write protection | |
| 234 | #define STATUS_GAP_BIT 4 // Gap detected | |
| 235 | #define STATUS_TRACKB_BIT 5 // Track B selected | |
| 236 | #define STATUS_CART_OUT_MASK BIT_MASK(STATUS_CART_OUT_BIT) // Cartridge out | |
| 237 | #define STATUS_WPR_MASK BIT_MASK(STATUS_WPR_BIT) // Write protection | |
| 238 | #define STATUS_ERR_MASK (STATUS_CART_OUT_MASK) // Mask of errors in status reg. | |
| 239 | ||
| 240 | // *** Position of tape holes *** | |
| 241 | // At beginning of tape: | |
| 242 | // *START* | |
| 243 | // |<-----24"----->|<---12"--->|<---12"--->|<-----24"----->| | |
| 244 | // O O O O O O O | |
| 245 | // |<->| |<->| |<->| | |
| 246 | // 0.218" 0.218" 0.218" | |
| 247 | // At end of tape: | |
| 248 | // *END* | |
| 249 | // |<-----24"----->|<---12"--->|<---12"--->|<-----24"----->| | |
| 250 | // O O O O | |
| 251 | // | |
| 252 | static const hp_taco_device::tape_pos_t tape_holes[] = { | |
| 253 | (hp_taco_device::tape_pos_t)(23.891 * ONE_INCH_POS), // 24 - 0.218 / 2 | |
| 254 | (hp_taco_device::tape_pos_t)(24.109 * ONE_INCH_POS), // 24 + 0.218 / 2 | |
| 255 | (hp_taco_device::tape_pos_t)(35.891 * ONE_INCH_POS), // 36 - 0.218 / 2 | |
| 256 | (hp_taco_device::tape_pos_t)(36.109 * ONE_INCH_POS), // 36 + 0.218 / 2 | |
| 257 | (hp_taco_device::tape_pos_t)(47.891 * ONE_INCH_POS), // 48 - 0.218 / 2 | |
| 258 | (hp_taco_device::tape_pos_t)(48.109 * ONE_INCH_POS), // 48 + 0.218 / 2 | |
| 259 | 72 * ONE_INCH_POS, // 72 | |
| 260 | 1752 * ONE_INCH_POS, // 1752 | |
| 261 | 1776 * ONE_INCH_POS, // 1776 | |
| 262 | 1788 * ONE_INCH_POS, // 1788 | |
| 263 | 1800 * ONE_INCH_POS // 1800 | |
| 264 | }; | |
| 265 | ||
| 266 | // Device type definition | |
| 267 | const device_type HP_TACO = &device_creator<hp_taco_device>; | |
| 268 | ||
| 269 | // Constructors | |
| 270 | hp_taco_device::hp_taco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname) | |
| 271 | : device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), | |
| 272 | device_image_interface(mconfig , *this), | |
| 273 | m_irq_handler(*this), | |
| 274 | m_flg_handler(*this), | |
| 275 | m_sts_handler(*this), | |
| 276 | m_tape_pos(TAPE_INIT_POS), | |
| 277 | m_image_dirty(false) | |
| 278 | { | |
| 279 | clear_state(); | |
| 280 | } | |
| 281 | ||
| 282 | hp_taco_device::hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 283 | : device_t(mconfig, HP_TACO, "HP TACO", tag, owner, clock, "TACO", __FILE__), | |
| 284 | device_image_interface(mconfig , *this), | |
| 285 | m_irq_handler(*this), | |
| 286 | m_flg_handler(*this), | |
| 287 | m_sts_handler(*this), | |
| 288 | m_tape_pos(TAPE_INIT_POS), | |
| 289 | m_image_dirty(false) | |
| 290 | { | |
| 291 | clear_state(); | |
| 292 | } | |
| 293 | ||
| 294 | WRITE16_MEMBER(hp_taco_device::reg_w) | |
| 295 | { | |
| 296 | LOG_0(("wr R%u = %04x\n", 4 + offset , data)); | |
| 297 | ||
| 298 | // Any I/O activity clears IRQ | |
| 299 | irq_w(false); | |
| 300 | ||
| 301 | switch (offset) { | |
| 302 | case 0: | |
| 303 | // Data register | |
| 304 | m_data_reg = data; | |
| 305 | m_data_reg_full = true; | |
| 306 | break; | |
| 307 | ||
| 308 | case 1: | |
| 309 | // Command register | |
| 310 | start_cmd_exec(data & CMD_REG_MASK); | |
| 311 | break; | |
| 312 | ||
| 313 | case 2: | |
| 314 | // Tachometer register | |
| 315 | m_tach_reg = data; | |
| 316 | break; | |
| 317 | ||
| 318 | case 3: | |
| 319 | // Timing register | |
| 320 | m_timing_reg = data; | |
| 321 | break; | |
| 322 | } | |
| 323 | } | |
| 324 | ||
| 325 | READ16_MEMBER(hp_taco_device::reg_r) | |
| 326 | { | |
| 327 | UINT16 res = 0; | |
| 328 | ||
| 329 | // Any I/O activity clears IRQ | |
| 330 | irq_w(false); | |
| 331 | ||
| 332 | switch (offset) { | |
| 333 | case 0: | |
| 334 | // Data register | |
| 335 | res = m_data_reg; | |
| 336 | break; | |
| 337 | ||
| 338 | case 1: | |
| 339 | // Command & status register | |
| 340 | res = (m_cmd_reg & CMD_REG_MASK) | (m_status_reg & STATUS_REG_MASK); | |
| 341 | break; | |
| 342 | ||
| 343 | case 2: | |
| 344 | // Tachometer register | |
| 345 | res = m_tach_reg; | |
| 346 | break; | |
| 347 | ||
| 348 | case 3: | |
| 349 | // Checksum register: it clears when read | |
| 350 | res = m_checksum_reg; | |
| 351 | m_checksum_reg = 0; | |
| 352 | break; | |
| 353 | } | |
| 354 | ||
| 355 | LOG_0(("rd R%u = %04x\n", 4 + offset , res)); | |
| 356 | ||
| 357 | return res; | |
| 358 | } | |
| 359 | ||
| 360 | READ_LINE_MEMBER(hp_taco_device::flg_r) | |
| 361 | { | |
| 362 | return m_flg; | |
| 363 | } | |
| 364 | ||
| 365 | READ_LINE_MEMBER(hp_taco_device::sts_r) | |
| 366 | { | |
| 367 | return m_sts; | |
| 368 | } | |
| 369 | ||
| 370 | // device_config_complete | |
| 371 | void hp_taco_device::device_config_complete() | |
| 372 | { | |
| 373 | LOG(("device_config_complete")); | |
| 374 | update_names(); | |
| 375 | } | |
| 376 | ||
| 377 | // device_start | |
| 378 | void hp_taco_device::device_start() | |
| 379 | { | |
| 380 | LOG(("device_start")); | |
| 381 | m_irq_handler.resolve_safe(); | |
| 382 | m_flg_handler.resolve_safe(); | |
| 383 | m_sts_handler.resolve_safe(); | |
| 384 | ||
| 385 | save_item(NAME(m_data_reg)); | |
| 386 | save_item(NAME(m_data_reg_full)); | |
| 387 | save_item(NAME(m_cmd_reg)); | |
| 388 | save_item(NAME(m_cmd_state)); | |
| 389 | save_item(NAME(m_status_reg)); | |
| 390 | save_item(NAME(m_tach_reg)); | |
| 391 | save_item(NAME(m_checksum_reg)); | |
| 392 | save_item(NAME(m_timing_reg)); | |
| 393 | save_item(NAME(m_irq)); | |
| 394 | save_item(NAME(m_flg)); | |
| 395 | save_item(NAME(m_sts)); | |
| 396 | save_item(NAME(m_tape_pos)); | |
| 397 | save_item(NAME(m_start_time)); | |
| 398 | save_item(NAME(m_tape_fwd)); | |
| 399 | save_item(NAME(m_tape_fast)); | |
| 400 | save_item(NAME(m_image_dirty)); | |
| 401 | save_item(NAME(m_tape_wr)); | |
| 402 | save_item(NAME(m_rw_pos)); | |
| 403 | save_item(NAME(m_next_word)); | |
| 404 | save_item(NAME(m_rd_it_valid)); | |
| 405 | save_item(NAME(m_gap_detect_start)); | |
| 406 | ||
| 407 | m_tape_timer = timer_alloc(TAPE_TMR_ID); | |
| 408 | m_hole_timer = timer_alloc(HOLE_TMR_ID); | |
| 409 | } | |
| 410 | ||
| 411 | // device_stop | |
| 412 | void hp_taco_device::device_stop() | |
| 413 | { | |
| 414 | } | |
| 415 | ||
| 416 | // device_reset | |
| 417 | void hp_taco_device::device_reset() | |
| 418 | { | |
| 419 | LOG(("device_reset")); | |
| 420 | clear_state(); | |
| 421 | ||
| 422 | m_irq = false; | |
| 423 | m_flg = true; | |
| 424 | ||
| 425 | m_irq_handler(false); | |
| 426 | m_flg_handler(true); | |
| 427 | set_error(false); | |
| 428 | } | |
| 429 | ||
| 430 | void hp_taco_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) | |
| 431 | { | |
| 432 | if (CMD_CODE(m_cmd_reg) != CMD_STOP) { | |
| 433 | update_tape_pos(); | |
| 434 | } | |
| 435 | ||
| 436 | switch (id) { | |
| 437 | case TAPE_TMR_ID: | |
| 438 | LOG_0(("Tape tmr @%g\n" , machine().time().as_double())); | |
| 439 | ||
| 440 | tape_pos_t length; | |
| 441 | ||
| 442 | switch (CMD_CODE(m_cmd_reg)) { | |
| 443 | case CMD_INDTA_INGAP: | |
| 444 | if (m_cmd_state == 0) { | |
| 445 | m_cmd_state = 1; | |
| 446 | tape_pos_t target = m_tape_pos; | |
| 447 | if (next_n_gap(target, 1, MIN_IRG_LENGTH)) { | |
| 448 | m_tape_timer->adjust(time_to_target(target)); | |
| 449 | } | |
| 450 | return; | |
| 451 | } | |
| 452 | break; | |
| 453 | ||
| 454 | case CMD_RECORD_WRITE: | |
| 455 | if (m_cmd_state == 0) { | |
| 456 | if (m_rd_it->second == PREAMBLE_WORD) { | |
| 457 | LOG_0(("Got preamble\n")); | |
| 458 | m_cmd_state = 1; | |
| 459 | // m_rw_pos already at correct position | |
| 460 | m_tape_timer->adjust(fetch_next_wr_word()); | |
| 461 | break; | |
| 462 | } else { | |
| 463 | adv_res_t res = adv_it(m_rd_it); | |
| 464 | if (res != ADV_NO_MORE_DATA) { | |
| 465 | m_tape_timer->adjust(time_to_rd_next_word(m_rw_pos)); | |
| 466 | } | |
| 467 | // No IRQ | |
| 468 | return; | |
| 469 | } | |
| 470 | } | |
| 471 | // Intentional fall-through | |
| 472 | case CMD_INIT_WRITE: | |
| 473 | write_word(m_rw_pos , m_next_word , length); | |
| 474 | pos_offset(m_rw_pos , length); | |
| 475 | // Just to be sure.. | |
| 476 | m_tape_pos = m_rw_pos; | |
| 477 | m_tape_timer->adjust(fetch_next_wr_word()); | |
| 478 | break; | |
| 479 | ||
| 480 | case CMD_STOP: | |
| 481 | move_tape_pos(m_tape_fast ? FAST_BRAKE_DIST : SLOW_BRAKE_DIST); | |
| 482 | stop_tape(); | |
| 483 | break; | |
| 484 | ||
| 485 | case CMD_INGAP_MOVE: | |
| 486 | if (m_cmd_state == 0) { | |
| 487 | m_cmd_state = 1; | |
| 488 | m_tape_timer->adjust(time_to_tach_pulses()); | |
| 489 | return; | |
| 490 | } | |
| 491 | break; | |
| 492 | ||
| 493 | case CMD_FINAL_GAP: | |
| 494 | case CMD_WRITE_IRG: | |
| 495 | write_gap(m_rw_pos , m_tape_pos); | |
| 496 | m_hole_timer->reset(); | |
| 497 | break; | |
| 498 | ||
| 499 | case CMD_SCAN_RECORDS: | |
| 500 | if (m_cmd_state == 0) { | |
| 501 | m_cmd_state = 1; | |
| 502 | tape_pos_t target = m_tape_pos; | |
| 503 | if (next_n_gap(target, 0x10000U - m_tach_reg, MIN_IRG_LENGTH)) { | |
| 504 | LOG_0(("%u gaps @%d\n" , 0x10000U - m_tach_reg, target)); | |
| 505 | m_tape_timer->adjust(time_to_target(target)); | |
| 506 | } | |
| 507 | return; | |
| 508 | } else { | |
| 509 | m_hole_timer->reset(); | |
| 510 | } | |
| 511 | break; | |
| 512 | ||
| 513 | case CMD_MOVE_INDTA: | |
| 514 | if (m_cmd_state == 0) { | |
| 515 | if (next_data(m_rd_it , m_tape_pos , true)) { | |
| 516 | m_cmd_state = 1; | |
| 517 | m_tape_timer->adjust(time_to_target(farthest_end(m_rd_it))); | |
| 518 | } | |
| 519 | // No IRQ | |
| 520 | return; | |
| 521 | } | |
| 522 | // m_cmd_state == 1 -> IRQ & cmd end | |
| 523 | break; | |
| 524 | ||
| 525 | case CMD_DELTA_MOVE_HOLE: | |
| 526 | case CMD_DELTA_MOVE_IRG: | |
| 527 | // Interrupt at end of movement | |
| 528 | m_hole_timer->reset(); | |
| 529 | break; | |
| 530 | ||
| 531 | case CMD_START_READ: | |
| 532 | { | |
| 533 | bool set_intr = true; | |
| 534 | // Just to be sure.. | |
| 535 | m_tape_pos = m_rw_pos; | |
| 536 | if (m_cmd_state == 0) { | |
| 537 | set_intr = false; | |
| 538 | if (m_rd_it->second == PREAMBLE_WORD) { | |
| 539 | m_cmd_state = 1; | |
| 540 | } | |
| 541 | LOG_0(("Got preamble\n")); | |
| 542 | } else { | |
| 543 | m_data_reg = m_rd_it->second; | |
| 544 | m_checksum_reg += m_data_reg; | |
| 545 | LOG_0(("RD %04x\n" , m_data_reg)); | |
| 546 | } | |
| 547 | adv_res_t res = adv_it(m_rd_it); | |
| 548 | LOG_0(("adv_it %d\n" , res)); | |
| 549 | if (res == ADV_NO_MORE_DATA) { | |
| 550 | m_rd_it_valid = false; | |
| 551 | } else { | |
| 552 | if (res == ADV_DISCONT_DATA) { | |
| 553 | // Hit a gap, restart preamble search | |
| 554 | m_cmd_state = 0; | |
| 555 | } | |
| 556 | m_tape_timer->adjust(time_to_rd_next_word(m_rw_pos)); | |
| 557 | } | |
| 558 | if (!set_intr) { | |
| 559 | return; | |
| 560 | } | |
| 561 | } | |
| 562 | break; | |
| 563 | ||
| 564 | case CMD_END_READ: | |
| 565 | { | |
| 566 | m_tape_pos = m_rw_pos; | |
| 567 | // Note: checksum is not updated | |
| 568 | m_data_reg = m_rd_it->second; | |
| 569 | LOG_0(("Final RD %04x\n" , m_data_reg)); | |
| 570 | adv_res_t res = adv_it(m_rd_it); | |
| 571 | if (res == ADV_NO_MORE_DATA) { | |
| 572 | m_rd_it_valid = false; | |
| 573 | } | |
| 574 | m_hole_timer->reset(); | |
| 575 | } | |
| 576 | break; | |
| 577 | ||
| 578 | default: | |
| 579 | // Other commands: just raise irq | |
| 580 | break; | |
| 581 | } | |
| 582 | irq_w(true); | |
| 583 | break; | |
| 584 | ||
| 585 | case HOLE_TMR_ID: | |
| 586 | LOG_0(("Hole tmr @%g\n" , machine().time().as_double())); | |
| 587 | ||
| 588 | BIT_SET(m_status_reg , STATUS_HOLE_BIT); | |
| 589 | ||
| 590 | switch (CMD_CODE(m_cmd_reg)) { | |
| 591 | case CMD_FINAL_GAP: | |
| 592 | case CMD_WRITE_IRG: | |
| 593 | write_gap(m_rw_pos , m_tape_pos); | |
| 594 | m_rw_pos = m_tape_pos; | |
| 595 | break; | |
| 596 | ||
| 597 | case CMD_SCAN_RECORDS: | |
| 598 | case CMD_DELTA_MOVE_HOLE: | |
| 599 | // Cmds 18 & 1c are terminated at first hole | |
| 600 | m_tape_timer->reset(); | |
| 601 | irq_w(true); | |
| 602 | // No reloading of hole timer | |
| 603 | return; | |
| 604 | ||
| 605 | case CMD_DELTA_MOVE_IRG: | |
| 606 | // TODO: update r6 | |
| 607 | m_hole_timer->adjust(time_to_next_hole()); | |
| 608 | // No IRQ at holes | |
| 609 | return; | |
| 610 | ||
| 611 | case CMD_START_READ: | |
| 612 | case CMD_END_READ: | |
| 613 | set_error(true); | |
| 614 | break; | |
| 615 | ||
| 616 | default: | |
| 617 | // Other cmds: default processing (update tape pos, set IRQ, schedule timer for next hole) | |
| 618 | break; | |
| 619 | } | |
| 620 | ||
| 621 | irq_w(true); | |
| 622 | m_hole_timer->adjust(time_to_next_hole()); | |
| 623 | break; | |
| 624 | ||
| 625 | default: | |
| 626 | break; | |
| 627 | } | |
| 628 | } | |
| 629 | ||
| 630 | void hp_taco_device::clear_state(void) | |
| 631 | { | |
| 632 | m_data_reg = 0; | |
| 633 | m_data_reg_full = false; | |
| 634 | m_cmd_reg = 0; | |
| 635 | m_status_reg = 0; | |
| 636 | m_tach_reg = 0; | |
| 637 | m_checksum_reg = 0; | |
| 638 | m_timing_reg = 0; | |
| 639 | m_cmd_state = 0; | |
| 640 | // m_tape_pos is not reset, tape stays where it is | |
| 641 | m_start_time = attotime::never; | |
| 642 | m_tape_fwd = false; | |
| 643 | m_tape_fast = false; | |
| 644 | // m_image_dirty is not touched | |
| 645 | m_tape_wr = false; | |
| 646 | m_rw_pos = 0; | |
| 647 | m_next_word = 0; | |
| 648 | m_rd_it_valid = false; | |
| 649 | m_gap_detect_start = NULL_TAPE_POS; | |
| 650 | ||
| 651 | set_tape_present(false); | |
| 652 | set_tape_present(is_loaded()); | |
| 653 | } | |
| 654 | ||
| 655 | void hp_taco_device::irq_w(bool state) | |
| 656 | { | |
| 657 | if (state != m_irq) { | |
| 658 | m_irq = state; | |
| 659 | m_irq_handler(state); | |
| 660 | LOG_0(("IRQ = %d\n" , state)); | |
| 661 | } | |
| 662 | } | |
| 663 | ||
| 664 | void hp_taco_device::set_error(bool state) | |
| 665 | { | |
| 666 | m_sts = !state; | |
| 667 | m_sts_handler(m_sts); | |
| 668 | LOG_0(("error = %d\n" , state)); | |
| 669 | } | |
| 670 | ||
| 671 | unsigned hp_taco_device::speed_to_tick_freq(void) const | |
| 672 | { | |
| 673 | return m_tape_fast ? TACH_FREQ_FAST * TAPE_POS_FRACT : TACH_FREQ_SLOW * TAPE_POS_FRACT; | |
| 674 | } | |
| 675 | ||
| 676 | bool hp_taco_device::pos_offset(tape_pos_t& pos , tape_pos_t offset) const | |
| 677 | { | |
| 678 | if (offset == 0) { | |
| 679 | return true; | |
| 680 | } | |
| 681 | ||
| 682 | if (!m_tape_fwd) { | |
| 683 | offset = -offset; | |
| 684 | } | |
| 685 | ||
| 686 | pos += offset; | |
| 687 | ||
| 688 | // In real life tape would unspool.. | |
| 689 | if (pos > TAPE_LENGTH) { | |
| 690 | pos = TAPE_LENGTH; | |
| 691 | return false; | |
| 692 | } else if (pos < 0) { | |
| 693 | pos = 0; | |
| 694 | return false; | |
| 695 | } else { | |
| 696 | return true; | |
| 697 | } | |
| 698 | } | |
| 699 | ||
| 700 | void hp_taco_device::move_tape_pos(tape_pos_t delta_pos) | |
| 701 | { | |
| 702 | tape_pos_t tape_start_pos = m_tape_pos; | |
| 703 | if (!pos_offset(m_tape_pos , delta_pos)) { | |
| 704 | LOG(("Tape unspooled!\n")); | |
| 705 | } | |
| 706 | m_start_time = machine().time(); | |
| 707 | LOG_0(("Tape pos = %u\n" , m_tape_pos)); | |
| 708 | if (any_hole(tape_start_pos , m_tape_pos)) { | |
| 709 | // Crossed one or more holes | |
| 710 | BIT_SET(m_status_reg , STATUS_HOLE_BIT); | |
| 711 | } | |
| 712 | } | |
| 713 | ||
| 714 | void hp_taco_device::update_tape_pos(void) | |
| 715 | { | |
| 716 | if (m_start_time.is_never()) { | |
| 717 | // Tape not moving | |
| 718 | return; | |
| 719 | } | |
| 720 | ||
| 721 | attotime delta_time(machine().time() - m_start_time); | |
| 722 | LOG_0(("delta_time = %g\n" , delta_time.as_double())); | |
| 723 | // How many tachometer ticks has the tape moved? | |
| 724 | tape_pos_t delta_tach = (tape_pos_t)(delta_time.as_ticks(speed_to_tick_freq())); | |
| 725 | LOG_0(("delta_tach = %u\n" , delta_tach)); | |
| 726 | ||
| 727 | move_tape_pos(delta_tach); | |
| 728 | ||
| 729 | // Gap detection | |
| 730 | bool gap_detected = false; | |
| 731 | if (m_gap_detect_start != NULL_TAPE_POS && abs(m_gap_detect_start - m_tape_pos) >= MIN_IRG_LENGTH) { | |
| 732 | tape_pos_t tmp = m_tape_pos; | |
| 733 | pos_offset(tmp , -MIN_IRG_LENGTH); | |
| 734 | gap_detected = just_gap(tmp , m_tape_pos); | |
| 735 | } | |
| 736 | if (gap_detected) { | |
| 737 | BIT_SET(m_status_reg, STATUS_GAP_BIT); | |
| 738 | } else { | |
| 739 | BIT_CLR(m_status_reg, STATUS_GAP_BIT); | |
| 740 | } | |
| 741 | } | |
| 742 | ||
| 743 | void hp_taco_device::ensure_a_lt_b(tape_pos_t& a , tape_pos_t& b) | |
| 744 | { | |
| 745 | if (a > b) { | |
| 746 | // Ensure A always comes before B | |
| 747 | tape_pos_t tmp; | |
| 748 | tmp = a; | |
| 749 | a = b; | |
| 750 | b = tmp; | |
| 751 | } | |
| 752 | } | |
| 753 | ||
| 754 | // Is there any hole in a given section of tape? | |
| 755 | bool hp_taco_device::any_hole(tape_pos_t tape_pos_a , tape_pos_t tape_pos_b) | |
| 756 | { | |
| 757 | ensure_a_lt_b(tape_pos_a , tape_pos_b); | |
| 758 | ||
| 759 | for (tape_pos_t hole : tape_holes) { | |
| 760 | if (tape_pos_a < hole && tape_pos_b >= hole) { | |
| 761 | return true; | |
| 762 | } | |
| 763 | } | |
| 764 | ||
| 765 | return false; | |
| 766 | } | |
| 767 | ||
| 768 | // Position of next hole tape will reach in a given direction | |
| 769 | hp_taco_device::tape_pos_t hp_taco_device::next_hole(void) const | |
| 770 | { | |
| 771 | if (m_tape_fwd) { | |
| 772 | for (tape_pos_t hole : tape_holes) { | |
| 773 | if (hole > m_tape_pos) { | |
| 774 | LOG_0(("next hole fwd @%u = %u\n" , m_tape_pos , hole)); | |
| 775 | return hole; | |
| 776 | } | |
| 777 | } | |
| 778 | // No more holes: will hit end of tape | |
| 779 | return TAPE_LENGTH; | |
| 780 | } else { | |
| 781 | for (int i = (sizeof(tape_holes) / sizeof(tape_holes[ 0 ])) - 1; i >= 0; i--) { | |
| 782 | if (tape_holes[ i ] < m_tape_pos) { | |
| 783 | LOG_0(("next hole rev @%u = %u\n" , m_tape_pos , tape_holes[ i ])); | |
| 784 | return tape_holes[ i ]; | |
| 785 | } | |
| 786 | } | |
| 787 | // No more holes: will hit start of tape | |
| 788 | return 0; | |
| 789 | } | |
| 790 | } | |
| 791 | ||
| 792 | attotime hp_taco_device::time_to_distance(tape_pos_t distance) const | |
| 793 | { | |
| 794 | // +1 for rounding | |
| 795 | return attotime::from_ticks(distance + 1 , speed_to_tick_freq()); | |
| 796 | } | |
| 797 | ||
| 798 | attotime hp_taco_device::time_to_target(tape_pos_t target) const | |
| 799 | { | |
| 800 | return time_to_distance(abs(target - m_tape_pos)); | |
| 801 | } | |
| 802 | ||
| 803 | bool hp_taco_device::start_tape_cmd(UINT16 cmd_reg , UINT16 must_be_1 , UINT16 must_be_0) | |
| 804 | { | |
| 805 | m_cmd_reg = cmd_reg; | |
| 806 | ||
| 807 | UINT16 to_be_tested = (m_cmd_reg & CMD_REG_MASK) | (m_status_reg & STATUS_REG_MASK); | |
| 808 | // Bits in STATUS_ERR_MASK must always be 0 | |
| 809 | must_be_0 |= STATUS_ERR_MASK; | |
| 810 | ||
| 811 | // It's not an error if the error state is already set (sts false) | |
| 812 | if (((to_be_tested & (must_be_1 | must_be_0)) ^ must_be_1) != 0) { | |
| 813 | set_error(true); | |
| 814 | return false; | |
| 815 | } else { | |
| 816 | bool prev_tape_wr = m_tape_wr; | |
| 817 | bool prev_tape_fwd = m_tape_fwd; | |
| 818 | bool prev_tape_fast = m_tape_fast; | |
| 819 | bool not_moving = m_start_time.is_never(); | |
| 820 | ||
| 821 | m_start_time = machine().time(); | |
| 822 | m_tape_wr = (must_be_0 & STATUS_WPR_MASK) != 0; | |
| 823 | m_tape_fwd = DIR_FWD(m_cmd_reg); | |
| 824 | m_tape_fast = SPEED_FAST(m_cmd_reg); | |
| 825 | // TODO: remove? | |
| 826 | BIT_CLR(m_status_reg, STATUS_HOLE_BIT); | |
| 827 | ||
| 828 | if (m_tape_wr) { | |
| 829 | // Write command: disable gap detector | |
| 830 | m_gap_detect_start = NULL_TAPE_POS; | |
| 831 | BIT_CLR(m_status_reg, STATUS_GAP_BIT); | |
| 832 | m_image_dirty = true; | |
| 833 | } else if (not_moving || prev_tape_wr != m_tape_wr || prev_tape_fwd != m_tape_fwd || prev_tape_fast != m_tape_fast) { | |
| 834 | // Tape started right now, switched from writing to reading, direction changed or speed changed: (re)start gap detector | |
| 835 | m_gap_detect_start = m_tape_pos; | |
| 836 | BIT_CLR(m_status_reg, STATUS_GAP_BIT); | |
| 837 | } | |
| 838 | return true; | |
| 839 | } | |
| 840 | } | |
| 841 | ||
| 842 | void hp_taco_device::stop_tape(void) | |
| 843 | { | |
| 844 | m_start_time = attotime::never; | |
| 845 | m_gap_detect_start = NULL_TAPE_POS; | |
| 846 | } | |
| 847 | ||
| 848 | hp_taco_device::tape_track_t& hp_taco_device::current_track(void) | |
| 849 | { | |
| 850 | return m_tracks[ BIT(m_status_reg , STATUS_TRACKB_BIT) ]; | |
| 851 | } | |
| 852 | ||
| 853 | // Return physical length of a 16-bit word on tape | |
| 854 | hp_taco_device::tape_pos_t hp_taco_device::word_length(tape_word_t w) | |
| 855 | { | |
| 856 | unsigned zeros , ones; | |
| 857 | ||
| 858 | // pop count of w | |
| 859 | ones = (w & 0x5555) + ((w >> 1) & 0x5555); | |
| 860 | ones = (ones & 0x3333) + ((ones >> 2) & 0x3333); | |
| 861 | ones = (ones & 0x0f0f) + ((ones >> 4) & 0x0f0f); | |
| 862 | ones = (ones & 0x00ff) + ((ones >> 8) & 0x00ff); | |
| 863 | ||
| 864 | zeros = 16 - ones; | |
| 865 | ||
| 866 | return zeros * ZERO_BIT_LEN + (ones + 1) * ONE_BIT_LEN; | |
| 867 | } | |
| 868 | ||
| 869 | hp_taco_device::tape_pos_t hp_taco_device::word_end_pos(const tape_track_t::iterator& it) | |
| 870 | { | |
| 871 | return it->first + word_length(it->second); | |
| 872 | } | |
| 873 | ||
| 874 | void hp_taco_device::adjust_it(tape_track_t& track , tape_track_t::iterator& it , tape_pos_t pos) | |
| 875 | { | |
| 876 | if (it != track.begin()) { | |
| 877 | it--; | |
| 878 | if (word_end_pos(it) <= pos) { | |
| 879 | it++; | |
| 880 | } | |
| 881 | } | |
| 882 | } | |
| 883 | ||
| 884 | // Write a word on current tape track | |
| 885 | void hp_taco_device::write_word(tape_pos_t start , tape_word_t word , tape_pos_t& length) | |
| 886 | { | |
| 887 | tape_track_t& track = current_track(); | |
| 888 | tape_track_t::iterator it_low = track.lower_bound(start); | |
| 889 | adjust_it(track , it_low , start); | |
| 890 | length = word_length(word); | |
| 891 | tape_pos_t end_pos = start + length; | |
| 892 | tape_track_t::iterator it_high = track.lower_bound(end_pos); | |
| 893 | ||
| 894 | track.erase(it_low , it_high); | |
| 895 | ||
| 896 | track.insert(it_high , std::make_pair(start, word)); | |
| 897 | LOG_0(("WR %04x @ T%u:%u\n" , word , BIT(m_status_reg , STATUS_TRACKB_BIT) , start)); | |
| 898 | } | |
| 899 | ||
| 900 | // Write a gap on current track | |
| 901 | void hp_taco_device::write_gap(tape_pos_t a , tape_pos_t b) | |
| 902 | { | |
| 903 | ensure_a_lt_b(a , b); | |
| 904 | tape_track_t& track = current_track(); | |
| 905 | tape_track_t::iterator it_low = track.lower_bound(a); | |
| 906 | adjust_it(track , it_low , a); | |
| 907 | tape_track_t::iterator it_high = track.lower_bound(b); | |
| 908 | ||
| 909 | track.erase(it_low, it_high); | |
| 910 | ||
| 911 | LOG_0(("GAP on T%u:[%u,%u)\n" , BIT(m_status_reg , STATUS_TRACKB_BIT) , a , b)); | |
| 912 | } | |
| 913 | ||
| 914 | bool hp_taco_device::just_gap(tape_pos_t a , tape_pos_t b) | |
| 915 | { | |
| 916 | ensure_a_lt_b(a , b); | |
| 917 | tape_track_t& track = current_track(); | |
| 918 | tape_track_t::iterator it_low = track.lower_bound(a); | |
| 919 | tape_track_t::iterator it_high = track.lower_bound(b); | |
| 920 | ||
| 921 | adjust_it(track, it_low, a); | |
| 922 | ||
| 923 | return it_low == it_high; | |
| 924 | } | |
| 925 | ||
| 926 | hp_taco_device::tape_pos_t hp_taco_device::farthest_end(const tape_track_t::iterator& it) const | |
| 927 | { | |
| 928 | if (m_tape_fwd) { | |
| 929 | return word_end_pos(it); | |
| 930 | } else { | |
| 931 | return it->first; | |
| 932 | } | |
| 933 | } | |
| 934 | ||
| 935 | bool hp_taco_device::next_data(tape_track_t::iterator& it , tape_pos_t pos , bool inclusive) | |
| 936 | { | |
| 937 | tape_track_t& track = current_track(); | |
| 938 | it = track.lower_bound(pos); | |
| 939 | if (m_tape_fwd) { | |
| 940 | if (inclusive) { | |
| 941 | adjust_it(track, it, pos); | |
| 942 | } | |
| 943 | return it != track.end(); | |
| 944 | } else { | |
| 945 | // Never more than 2 iterations | |
| 946 | do { | |
| 947 | if (it == track.begin()) { | |
| 948 | it = track.end(); | |
| 949 | return false; | |
| 950 | } | |
| 951 | it--; | |
| 952 | } while (!inclusive && word_end_pos(it) > pos); | |
| 953 | return true; | |
| 954 | } | |
| 955 | } | |
| 956 | ||
| 957 | hp_taco_device::adv_res_t hp_taco_device::adv_it(tape_track_t::iterator& it) | |
| 958 | { | |
| 959 | tape_track_t& track = current_track(); | |
| 960 | if (m_tape_fwd) { | |
| 961 | tape_pos_t prev_pos = word_end_pos(it); | |
| 962 | it++; | |
| 963 | if (it == track.end()) { | |
| 964 | return ADV_NO_MORE_DATA; | |
| 965 | } else { | |
| 966 | adv_res_t res = prev_pos == it->first ? ADV_CONT_DATA : ADV_DISCONT_DATA; | |
| 967 | return res; | |
| 968 | } | |
| 969 | } else { | |
| 970 | if (it == track.begin()) { | |
| 971 | it = track.end(); | |
| 972 | return ADV_NO_MORE_DATA; | |
| 973 | } else { | |
| 974 | tape_pos_t prev_pos = it->first; | |
| 975 | it--; | |
| 976 | return prev_pos == word_end_pos(it) ? ADV_CONT_DATA : ADV_DISCONT_DATA; | |
| 977 | } | |
| 978 | } | |
| 979 | } | |
| 980 | ||
| 981 | attotime hp_taco_device::fetch_next_wr_word(void) | |
| 982 | { | |
| 983 | if (m_data_reg_full) { | |
| 984 | m_next_word = m_data_reg; | |
| 985 | m_data_reg_full = false; | |
| 986 | LOG_0(("next %04x (DR)\n" , m_next_word)); | |
| 987 | } else { | |
| 988 | // When data register is empty, write checksum word | |
| 989 | m_next_word = m_checksum_reg; | |
| 990 | LOG_0(("next %04x (CS)\n" , m_next_word)); | |
| 991 | } | |
| 992 | // Update checksum with new word | |
| 993 | m_checksum_reg += m_next_word; | |
| 994 | ||
| 995 | return time_to_distance(word_length(m_next_word)); | |
| 996 | } | |
| 997 | ||
| 998 | attotime hp_taco_device::time_to_rd_next_word(tape_pos_t& word_rd_pos) | |
| 999 | { | |
| 1000 | if (m_rd_it_valid) { | |
| 1001 | word_rd_pos = farthest_end(m_rd_it); | |
| 1002 | return time_to_target(word_rd_pos); | |
| 1003 | } else { | |
| 1004 | return attotime::never; | |
| 1005 | } | |
| 1006 | } | |
| 1007 | ||
| 1008 | /** | |
| 1009 | * Scan for next "n_gaps" gaps | |
| 1010 | * | |
| 1011 | * @param[in,out] pos Start position on input, start of gap on output | |
| 1012 | * @param it Pointer to data word where scan is to start | |
| 1013 | * @param n_gaps Number of gaps to scan | |
| 1014 | * @param min_gap Minimum gap size | |
| 1015 | * | |
| 1016 | * @return true if n_gaps gaps are found | |
| 1017 | */ | |
| 1018 | bool hp_taco_device::next_n_gap(tape_pos_t& pos , tape_track_t::iterator it , unsigned n_gaps , tape_pos_t min_gap) | |
| 1019 | { | |
| 1020 | tape_track_t& track = current_track(); | |
| 1021 | bool done = false; | |
| 1022 | tape_track_t::iterator prev_it; | |
| 1023 | ||
| 1024 | if (m_tape_fwd) { | |
| 1025 | tape_pos_t next_pos; | |
| 1026 | ||
| 1027 | while (1) { | |
| 1028 | if (it == track.end()) { | |
| 1029 | next_pos = TAPE_LENGTH; | |
| 1030 | done = true; | |
| 1031 | } else { | |
| 1032 | next_pos = it->first; | |
| 1033 | } | |
| 1034 | if (((next_pos - pos) >= min_gap && --n_gaps == 0) || done) { | |
| 1035 | break; | |
| 1036 | } | |
| 1037 | adv_res_t adv_res; | |
| 1038 | do { | |
| 1039 | prev_it = it; | |
| 1040 | adv_res = adv_it(it); | |
| 1041 | } while (adv_res == ADV_CONT_DATA); | |
| 1042 | pos = word_end_pos(prev_it); | |
| 1043 | } | |
| 1044 | } else { | |
| 1045 | tape_pos_t next_pos; | |
| 1046 | ||
| 1047 | while (1) { | |
| 1048 | if (it == track.end()) { | |
| 1049 | next_pos = 0; | |
| 1050 | done = true; | |
| 1051 | } else { | |
| 1052 | next_pos = word_end_pos(it); | |
| 1053 | } | |
| 1054 | if (((pos - next_pos) >= min_gap && --n_gaps == 0) || done) { | |
| 1055 | break; | |
| 1056 | } | |
| 1057 | adv_res_t adv_res; | |
| 1058 | do { | |
| 1059 | prev_it = it; | |
| 1060 | adv_res = adv_it(it); | |
| 1061 | } while (adv_res == ADV_CONT_DATA); | |
| 1062 | pos = prev_it->first; | |
| 1063 | } | |
| 1064 | } | |
| 1065 | ||
| 1066 | // Set "pos" where minimum gap size is met | |
| 1067 | pos_offset(pos , min_gap); | |
| 1068 | ||
| 1069 | return n_gaps == 0; | |
| 1070 | } | |
| 1071 | ||
| 1072 | bool hp_taco_device::next_n_gap(tape_pos_t& pos , unsigned n_gaps , tape_pos_t min_gap) | |
| 1073 | { | |
| 1074 | tape_track_t::iterator it; | |
| 1075 | // First align with next data | |
| 1076 | next_data(it, pos, true); | |
| 1077 | // Then scan for n_gaps | |
| 1078 | return next_n_gap(pos, it, n_gaps, min_gap); | |
| 1079 | } | |
| 1080 | ||
| 1081 | void hp_taco_device::clear_tape(void) | |
| 1082 | { | |
| 1083 | for (unsigned track_n = 0; track_n < 2; track_n++) { | |
| 1084 | m_tracks[ track_n ].clear(); | |
| 1085 | } | |
| 1086 | } | |
| 1087 | ||
| 1088 | void hp_taco_device::dump_sequence(tape_track_t::const_iterator it_start , unsigned n_words) | |
| 1089 | { | |
| 1090 | if (n_words) { | |
| 1091 | UINT32 tmp32; | |
| 1092 | UINT16 tmp16; | |
| 1093 | ||
| 1094 | tmp32 = n_words; | |
| 1095 | fwrite(&tmp32 , sizeof(tmp32)); | |
| 1096 | tmp32 = it_start->first; | |
| 1097 | fwrite(&tmp32 , sizeof(tmp32)); | |
| 1098 | ||
| 1099 | for (unsigned i = 0; i < n_words; i++) { | |
| 1100 | tmp16 = it_start->second; | |
| 1101 | fwrite(&tmp16 , sizeof(tmp16)); | |
| 1102 | it_start++; | |
| 1103 | } | |
| 1104 | } | |
| 1105 | } | |
| 1106 | ||
| 1107 | void hp_taco_device::save_tape(void) | |
| 1108 | { | |
| 1109 | UINT32 tmp32; | |
| 1110 | ||
| 1111 | fseek(0, SEEK_SET); | |
| 1112 | ||
| 1113 | tmp32 = FILE_MAGIC; | |
| 1114 | fwrite(&tmp32 , sizeof(tmp32)); | |
| 1115 | ||
| 1116 | for (unsigned track_n = 0; track_n < 2; track_n++) { | |
| 1117 | const tape_track_t& track = m_tracks[ track_n ]; | |
| 1118 | tape_pos_t next_pos = (tape_pos_t)-1; | |
| 1119 | unsigned n_words = 0; | |
| 1120 | tape_track_t::const_iterator it_start; | |
| 1121 | for (tape_track_t::const_iterator it = track.cbegin(); it != track.cend(); it++) { | |
| 1122 | if (it->first != next_pos) { | |
| 1123 | dump_sequence(it_start , n_words); | |
| 1124 | it_start = it; | |
| 1125 | n_words = 0; | |
| 1126 | } | |
| 1127 | next_pos = it->first + word_length(it->second); | |
| 1128 | n_words++; | |
| 1129 | } | |
| 1130 | dump_sequence(it_start , n_words); | |
| 1131 | // End of track | |
| 1132 | tmp32 = (UINT32)-1; | |
| 1133 | fwrite(&tmp32 , sizeof(tmp32)); | |
| 1134 | } | |
| 1135 | } | |
| 1136 | ||
| 1137 | bool hp_taco_device::load_track(tape_track_t& track) | |
| 1138 | { | |
| 1139 | UINT32 tmp32; | |
| 1140 | ||
| 1141 | track.clear(); | |
| 1142 | ||
| 1143 | while (1) { | |
| 1144 | if (fread(&tmp32 , sizeof(tmp32)) != sizeof(tmp32)) { | |
| 1145 | return false; | |
| 1146 | } | |
| 1147 | ||
| 1148 | if (tmp32 == (UINT32)-1) { | |
| 1149 | return true; | |
| 1150 | } | |
| 1151 | ||
| 1152 | unsigned n_words = tmp32; | |
| 1153 | ||
| 1154 | if (fread(&tmp32 , sizeof(tmp32)) != sizeof(tmp32)) { | |
| 1155 | return false; | |
| 1156 | } | |
| 1157 | ||
| 1158 | tape_pos_t pos = (tape_pos_t)tmp32; | |
| 1159 | ||
| 1160 | for (unsigned i = 0; i < n_words; i++) { | |
| 1161 | UINT16 tmp16; | |
| 1162 | ||
| 1163 | if (fread(&tmp16 , sizeof(tmp16)) != sizeof(tmp16)) { | |
| 1164 | return false; | |
| 1165 | } | |
| 1166 | ||
| 1167 | track.insert(std::make_pair(pos , tmp16)); | |
| 1168 | pos += word_length(tmp16); | |
| 1169 | } | |
| 1170 | } | |
| 1171 | } | |
| 1172 | ||
| 1173 | bool hp_taco_device::load_tape(void) | |
| 1174 | { | |
| 1175 | UINT32 magic; | |
| 1176 | ||
| 1177 | if (fread(&magic , sizeof(magic)) != sizeof(magic) || | |
| 1178 | magic != FILE_MAGIC) { | |
| 1179 | return false; | |
| 1180 | } | |
| 1181 | ||
| 1182 | for (unsigned track_n = 0; track_n < 2; track_n++) { | |
| 1183 | if (!load_track(m_tracks[ track_n ])) { | |
| 1184 | LOG(("load_tape failed")); | |
| 1185 | clear_tape(); | |
| 1186 | return false; | |
| 1187 | } | |
| 1188 | } | |
| 1189 | ||
| 1190 | LOG(("load_tape done\n")); | |
| 1191 | return true; | |
| 1192 | } | |
| 1193 | ||
| 1194 | void hp_taco_device::set_tape_present(bool present) | |
| 1195 | { | |
| 1196 | if (present) { | |
| 1197 | if (is_readonly()) { | |
| 1198 | BIT_SET(m_status_reg, STATUS_WPR_BIT); | |
| 1199 | } else { | |
| 1200 | BIT_CLR(m_status_reg, STATUS_WPR_BIT); | |
| 1201 | } | |
| 1202 | // STATUS_CART_OUT_BIT is reset by CMD_CLEAR | |
| 1203 | } else { | |
| 1204 | BIT_SET(m_status_reg, STATUS_CART_OUT_BIT); | |
| 1205 | BIT_SET(m_status_reg, STATUS_WPR_BIT); | |
| 1206 | } | |
| 1207 | } | |
| 1208 | ||
| 1209 | attotime hp_taco_device::time_to_next_hole(void) const | |
| 1210 | { | |
| 1211 | return time_to_target(next_hole()); | |
| 1212 | } | |
| 1213 | ||
| 1214 | attotime hp_taco_device::time_to_tach_pulses(void) const | |
| 1215 | { | |
| 1216 | return time_to_distance((tape_pos_t)(0x10000U - m_tach_reg) * TAPE_POS_FRACT); | |
| 1217 | } | |
| 1218 | ||
| 1219 | void hp_taco_device::start_cmd_exec(UINT16 new_cmd_reg) | |
| 1220 | { | |
| 1221 | LOG(("Cmd = %02x\n" , CMD_CODE(new_cmd_reg))); | |
| 1222 | ||
| 1223 | update_tape_pos(); | |
| 1224 | ||
| 1225 | attotime cmd_duration = attotime::never; | |
| 1226 | attotime time_to_hole = attotime::never; | |
| 1227 | ||
| 1228 | unsigned new_cmd_code = CMD_CODE(new_cmd_reg); | |
| 1229 | ||
| 1230 | if (new_cmd_code != CMD_START_READ && | |
| 1231 | new_cmd_code != CMD_END_READ && | |
| 1232 | new_cmd_code != CMD_CLEAR) { | |
| 1233 | m_rd_it_valid = false; | |
| 1234 | } | |
| 1235 | ||
| 1236 | switch (new_cmd_code) { | |
| 1237 | case CMD_INDTA_INGAP: | |
| 1238 | // Errors: CART OUT,FAST SPEED | |
| 1239 | if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) { | |
| 1240 | m_cmd_state = 0; | |
| 1241 | if (next_data(m_rd_it , m_tape_pos , true)) { | |
| 1242 | cmd_duration = time_to_target(farthest_end(m_rd_it)); | |
| 1243 | } | |
| 1244 | } | |
| 1245 | break; | |
| 1246 | ||
| 1247 | case CMD_FINAL_GAP: | |
| 1248 | // Errors: WP,CART OUT | |
| 1249 | if (start_tape_cmd(new_cmd_reg , 0 , STATUS_WPR_MASK)) { | |
| 1250 | m_rw_pos = m_tape_pos; | |
| 1251 | cmd_duration = time_to_distance(END_GAP_LENGTH); | |
| 1252 | time_to_hole = time_to_next_hole(); | |
| 1253 | } | |
| 1254 | break; | |
| 1255 | ||
| 1256 | case CMD_CLEAR: | |
| 1257 | set_error(false); | |
| 1258 | BIT_CLR(m_status_reg, STATUS_HOLE_BIT); | |
| 1259 | BIT_CLR(m_status_reg, STATUS_CART_OUT_BIT); | |
| 1260 | BIT_CLR(m_status_reg, STATUS_WPR_BIT); | |
| 1261 | set_tape_present(is_loaded()); | |
| 1262 | // This is a special command: it doesn't raise IRQ at completion and it | |
| 1263 | // doesn't replace current command | |
| 1264 | return; | |
| 1265 | ||
| 1266 | case CMD_NOT_INDTA: | |
| 1267 | // Errors: CART OUT,FAST SPEED | |
| 1268 | if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) { | |
| 1269 | tape_pos_t target = m_tape_pos; | |
| 1270 | if (next_n_gap(target, 1, NO_DATA_GAP)) { | |
| 1271 | LOG_0(("End of data @%d\n" , target)); | |
| 1272 | cmd_duration = time_to_target(target); | |
| 1273 | } | |
| 1274 | // Holes detected? | |
| 1275 | } | |
| 1276 | break; | |
| 1277 | ||
| 1278 | case CMD_INIT_WRITE: | |
| 1279 | // Errors: WP,CART OUT,fast speed,reverse | |
| 1280 | if (start_tape_cmd(new_cmd_reg , DIR_FWD_MASK , STATUS_WPR_MASK | SPEED_FAST_MASK)) { | |
| 1281 | m_next_word = PREAMBLE_WORD; | |
| 1282 | m_rw_pos = m_tape_pos; | |
| 1283 | cmd_duration = time_to_distance(word_length(m_next_word)); | |
| 1284 | } | |
| 1285 | break; | |
| 1286 | ||
| 1287 | case CMD_STOP: | |
| 1288 | if (CMD_CODE(m_cmd_reg) != CMD_STOP) { | |
| 1289 | if (m_start_time.is_never()) { | |
| 1290 | // Tape is already stopped | |
| 1291 | cmd_duration = attotime::from_usec(QUICK_CMD_USEC); | |
| 1292 | } else { | |
| 1293 | // Start braking timer | |
| 1294 | cmd_duration = attotime::from_msec(m_tape_fast ? FAST_BRAKE_MSEC : SLOW_BRAKE_MSEC); | |
| 1295 | } | |
| 1296 | m_cmd_reg = new_cmd_reg; | |
| 1297 | } else { | |
| 1298 | // TODO: check if ok | |
| 1299 | return; | |
| 1300 | } | |
| 1301 | break; | |
| 1302 | ||
| 1303 | case CMD_SET_TRACK: | |
| 1304 | // Don't know if this command really starts the tape or not (probably it doesn't) | |
| 1305 | if (start_tape_cmd(new_cmd_reg , 0 , 0)) { | |
| 1306 | // When b9 is 0, set track A/B | |
| 1307 | // When b9 is 1, ignore command (in TACO chip it has an unknown purpose) | |
| 1308 | if (!UNKNOWN_B9(new_cmd_reg)) { | |
| 1309 | if (CMD_OPT(new_cmd_reg)) { | |
| 1310 | BIT_SET(m_status_reg, STATUS_TRACKB_BIT); | |
| 1311 | } else { | |
| 1312 | BIT_CLR(m_status_reg, STATUS_TRACKB_BIT); | |
| 1313 | } | |
| 1314 | } | |
| 1315 | cmd_duration = attotime::from_usec(QUICK_CMD_USEC); | |
| 1316 | } | |
| 1317 | break; | |
| 1318 | ||
| 1319 | case CMD_MOVE: | |
| 1320 | if (start_tape_cmd(new_cmd_reg , 0 , 0)) { | |
| 1321 | time_to_hole = time_to_next_hole(); | |
| 1322 | } | |
| 1323 | break; | |
| 1324 | ||
| 1325 | case CMD_INGAP_MOVE: | |
| 1326 | // Errors: CART OUT,FAST SPEED | |
| 1327 | if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) { | |
| 1328 | m_cmd_state = 0; | |
| 1329 | tape_pos_t target = m_tape_pos; | |
| 1330 | if (next_n_gap(target, 1, MIN_IRG_LENGTH)) { | |
| 1331 | LOG_0(("IRG @%d\n" , target)); | |
| 1332 | cmd_duration = time_to_target(target); | |
| 1333 | } | |
| 1334 | // Holes detected? | |
| 1335 | } | |
| 1336 | break; | |
| 1337 | ||
| 1338 | case CMD_WRITE_IRG: | |
| 1339 | // Errors: WP,CART OUT | |
| 1340 | if (start_tape_cmd(new_cmd_reg , 0 , STATUS_WPR_MASK)) { | |
| 1341 | m_rw_pos = m_tape_pos; | |
| 1342 | cmd_duration = time_to_tach_pulses(); | |
| 1343 | time_to_hole = time_to_next_hole(); | |
| 1344 | } | |
| 1345 | break; | |
| 1346 | ||
| 1347 | case CMD_SCAN_RECORDS: | |
| 1348 | // Errors: CART OUT | |
| 1349 | if (start_tape_cmd(new_cmd_reg , 0 , 0)) { | |
| 1350 | m_cmd_state = 0; | |
| 1351 | if (next_data(m_rd_it , m_tape_pos , true)) { | |
| 1352 | cmd_duration = time_to_target(farthest_end(m_rd_it)); | |
| 1353 | } | |
| 1354 | time_to_hole = time_to_next_hole(); | |
| 1355 | } | |
| 1356 | break; | |
| 1357 | ||
| 1358 | case CMD_RECORD_WRITE: | |
| 1359 | // Errors: WP,CART OUT,fast speed,reverse | |
| 1360 | if (start_tape_cmd(new_cmd_reg , DIR_FWD_MASK , STATUS_WPR_MASK | SPEED_FAST_MASK)) { | |
| 1361 | // Search for preamble first | |
| 1362 | m_cmd_state = 0; | |
| 1363 | m_rd_it_valid = next_data(m_rd_it , m_tape_pos , false); | |
| 1364 | cmd_duration = time_to_rd_next_word(m_rw_pos); | |
| 1365 | // Holes detected? | |
| 1366 | } | |
| 1367 | break; | |
| 1368 | ||
| 1369 | case CMD_MOVE_INDTA: | |
| 1370 | // Errors: CART OUT,FAST SPEED | |
| 1371 | if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) { | |
| 1372 | m_cmd_state = 0; | |
| 1373 | cmd_duration = time_to_tach_pulses(); | |
| 1374 | // Holes detected? | |
| 1375 | } | |
| 1376 | break; | |
| 1377 | ||
| 1378 | case CMD_UNK_1b: | |
| 1379 | if (start_tape_cmd(new_cmd_reg , 0 , 0)) { | |
| 1380 | // Unknown purpose, but make it a NOP (it's used in "T" test of test ROM) | |
| 1381 | cmd_duration = attotime::from_usec(QUICK_CMD_USEC); | |
| 1382 | } | |
| 1383 | break; | |
| 1384 | ||
| 1385 | case CMD_DELTA_MOVE_HOLE: | |
| 1386 | case CMD_DELTA_MOVE_IRG: | |
| 1387 | if (start_tape_cmd(new_cmd_reg , 0 , 0)) { | |
| 1388 | cmd_duration = time_to_tach_pulses(); | |
| 1389 | time_to_hole = time_to_next_hole(); | |
| 1390 | } | |
| 1391 | break; | |
| 1392 | ||
| 1393 | case CMD_START_READ: | |
| 1394 | // Yes, you can read tape backwards: test "C" does that! | |
| 1395 | // Because of this DIR_FWD_MASK is not in the "must be 1" mask. | |
| 1396 | if (start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) { | |
| 1397 | // TODO: check anche m_rw_pos sforato | |
| 1398 | if (!m_rd_it_valid) { | |
| 1399 | // Search for preamble first | |
| 1400 | m_cmd_state = 0; | |
| 1401 | m_rd_it_valid = next_data(m_rd_it , m_tape_pos , false); | |
| 1402 | } | |
| 1403 | ||
| 1404 | cmd_duration = time_to_rd_next_word(m_rw_pos); | |
| 1405 | time_to_hole = time_to_next_hole(); | |
| 1406 | } | |
| 1407 | break; | |
| 1408 | ||
| 1409 | case CMD_END_READ: | |
| 1410 | // This command only makes sense after CMD_START_READ | |
| 1411 | if (CMD_CODE(m_cmd_reg) == CMD_START_READ && m_cmd_state == 1 && | |
| 1412 | start_tape_cmd(new_cmd_reg , 0 , SPEED_FAST_MASK)) { | |
| 1413 | LOG_0(("END_READ %d\n" , m_rd_it_valid)); | |
| 1414 | cmd_duration = time_to_rd_next_word(m_rw_pos); | |
| 1415 | time_to_hole = time_to_next_hole(); | |
| 1416 | } | |
| 1417 | break; | |
| 1418 | ||
| 1419 | default: | |
| 1420 | LOG(("Unrecognized command\n")); | |
| 1421 | break; | |
| 1422 | } | |
| 1423 | ||
| 1424 | m_tape_timer->adjust(cmd_duration); | |
| 1425 | m_hole_timer->adjust(time_to_hole); | |
| 1426 | } | |
| 1427 | ||
| 1428 | bool hp_taco_device::call_load() | |
| 1429 | { | |
| 1430 | LOG(("call_load %d\n" , has_been_created())); | |
| 1431 | if (has_been_created()) { | |
| 1432 | clear_tape(); | |
| 1433 | save_tape(); | |
| 1434 | } else if (!load_tape()) { | |
| 1435 | seterror(IMAGE_ERROR_INVALIDIMAGE , "Wrong format"); | |
| 1436 | set_tape_present(false); | |
| 1437 | return IMAGE_INIT_FAIL; | |
| 1438 | } | |
| 1439 | ||
| 1440 | m_image_dirty = false; | |
| 1441 | ||
| 1442 | set_tape_present(true); | |
| 1443 | return IMAGE_INIT_PASS; | |
| 1444 | } | |
| 1445 | ||
| 1446 | bool hp_taco_device::call_create(int format_type, option_resolution *format_options) | |
| 1447 | { | |
| 1448 | LOG(("call_create %d\n" , has_been_created())); | |
| 1449 | return call_load(); | |
| 1450 | } | |
| 1451 | ||
| 1452 | void hp_taco_device::call_unload() | |
| 1453 | { | |
| 1454 | LOG(("call_unload dirty=%d\n" , m_image_dirty)); | |
| 1455 | if (m_image_dirty) { | |
| 1456 | save_tape(); | |
| 1457 | m_image_dirty = false; | |
| 1458 | } | |
| 1459 | ||
| 1460 | clear_tape(); | |
| 1461 | set_tape_present(false); | |
| 1462 | } | |
| 1463 | ||
| 1464 | const char *hp_taco_device::file_extensions() const | |
| 1465 | { | |
| 1466 | return "hti"; | |
| 1467 | } |
| r253556 | r253557 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:F. Ulivi | |
| 3 | /********************************************************************* | |
| 4 | ||
| 5 | hp_taco.h | |
| 6 | ||
| 7 | HP TApe COntroller (5006-3012) | |
| 8 | ||
| 9 | *********************************************************************/ | |
| 10 | ||
| 11 | #ifndef __HP_TACO_H__ | |
| 12 | #define __HP_TACO_H__ | |
| 13 | ||
| 14 | #include <map> | |
| 15 | ||
| 16 | #define MCFG_TACO_IRQ_HANDLER(_devcb) \ | |
| 17 | devcb = &hp_taco_device::set_irq_handler(*device , DEVCB_##_devcb); | |
| 18 | ||
| 19 | #define MCFG_TACO_FLG_HANDLER(_devcb) \ | |
| 20 | devcb = &hp_taco_device::set_flg_handler(*device , DEVCB_##_devcb); | |
| 21 | ||
| 22 | #define MCFG_TACO_STS_HANDLER(_devcb) \ | |
| 23 | devcb = &hp_taco_device::set_sts_handler(*device , DEVCB_##_devcb); | |
| 24 | ||
| 25 | class hp_taco_device : public device_t , | |
| 26 | public device_image_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | // construction/destruction | |
| 30 | hp_taco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname); | |
| 31 | hp_taco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ||
| 33 | // static configuration helpers | |
| 34 | template<class _Object> static devcb_base &set_irq_handler(device_t &device, _Object object) { return downcast<hp_taco_device &>(device).m_irq_handler.set_callback(object); } | |
| 35 | template<class _Object> static devcb_base &set_flg_handler(device_t &device, _Object object) { return downcast<hp_taco_device &>(device).m_flg_handler.set_callback(object); } | |
| 36 | template<class _Object> static devcb_base &set_sts_handler(device_t &device, _Object object) { return downcast<hp_taco_device &>(device).m_sts_handler.set_callback(object); } | |
| 37 | ||
| 38 | // Register read/write | |
| 39 | DECLARE_WRITE16_MEMBER(reg_w); | |
| 40 | DECLARE_READ16_MEMBER(reg_r); | |
| 41 | ||
| 42 | // Flag & status read | |
| 43 | DECLARE_READ_LINE_MEMBER(flg_r); | |
| 44 | DECLARE_READ_LINE_MEMBER(sts_r); | |
| 45 | ||
| 46 | // device_image_interface overrides | |
| 47 | virtual bool call_load() override; | |
| 48 | virtual bool call_create(int format_type, option_resolution *format_options) override; | |
| 49 | virtual void call_unload() override; | |
| 50 | virtual iodevice_t image_type() const override { return IO_MAGTAPE; } | |
| 51 | virtual bool is_readable() const override { return true; } | |
| 52 | virtual bool is_writeable() const override { return true; } | |
| 53 | virtual bool is_creatable() const override { return true; } | |
| 54 | virtual bool must_be_loaded() const override { return false; } | |
| 55 | virtual bool is_reset_on_load() const override { return false; } | |
| 56 | virtual const char *file_extensions() const override; | |
| 57 | virtual const option_guide *create_option_guide() const override { return nullptr; } | |
| 58 | ||
| 59 | // Tape position, 1 unit = 1 inch / (968 * 1024) | |
| 60 | typedef INT32 tape_pos_t; | |
| 61 | ||
| 62 | // Words stored on tape | |
| 63 | typedef UINT16 tape_word_t; | |
| 64 | ||
| 65 | protected: | |
| 66 | // device-level overrides | |
| 67 | virtual void device_config_complete() override; | |
| 68 | virtual void device_start() override; | |
| 69 | virtual void device_stop() override; | |
| 70 | virtual void device_reset() override; | |
| 71 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override; | |
| 72 | ||
| 73 | private: | |
| 74 | // Storage of tracks: mapping from a tape position to word stored there | |
| 75 | typedef std::map<tape_pos_t , tape_word_t> tape_track_t; | |
| 76 | ||
| 77 | devcb_write_line m_irq_handler; | |
| 78 | devcb_write_line m_flg_handler; | |
| 79 | devcb_write_line m_sts_handler; | |
| 80 | ||
| 81 | // Registers | |
| 82 | UINT16 m_data_reg; | |
| 83 | bool m_data_reg_full; | |
| 84 | UINT16 m_cmd_reg; | |
| 85 | UINT16 m_status_reg; | |
| 86 | UINT16 m_tach_reg; | |
| 87 | UINT16 m_checksum_reg; | |
| 88 | UINT16 m_timing_reg; | |
| 89 | ||
| 90 | // State | |
| 91 | bool m_irq; | |
| 92 | bool m_flg; | |
| 93 | bool m_sts; | |
| 94 | UINT8 m_cmd_state; | |
| 95 | ||
| 96 | // Tape position & motion | |
| 97 | tape_pos_t m_tape_pos; | |
| 98 | attotime m_start_time; // Tape moving if != never | |
| 99 | bool m_tape_fwd; | |
| 100 | bool m_tape_fast; | |
| 101 | ||
| 102 | // Timers | |
| 103 | emu_timer *m_tape_timer; | |
| 104 | emu_timer *m_hole_timer; | |
| 105 | ||
| 106 | // Content of tape tracks | |
| 107 | tape_track_t m_tracks[ 2 ]; | |
| 108 | bool m_image_dirty; | |
| 109 | ||
| 110 | // Reading & writing | |
| 111 | bool m_tape_wr; | |
| 112 | tape_pos_t m_rw_pos; | |
| 113 | UINT16 m_next_word; | |
| 114 | tape_track_t::iterator m_rd_it; | |
| 115 | bool m_rd_it_valid; | |
| 116 | ||
| 117 | // Gap detection | |
| 118 | tape_pos_t m_gap_detect_start; | |
| 119 | ||
| 120 | typedef enum { | |
| 121 | ADV_NO_MORE_DATA, | |
| 122 | ADV_CONT_DATA, | |
| 123 | ADV_DISCONT_DATA | |
| 124 | } adv_res_t; | |
| 125 | ||
| 126 | void clear_state(void); | |
| 127 | void irq_w(bool state); | |
| 128 | void set_error(bool state); | |
| 129 | unsigned speed_to_tick_freq(void) const; | |
| 130 | bool pos_offset(tape_pos_t& pos , tape_pos_t offset) const; | |
| 131 | void move_tape_pos(tape_pos_t delta_pos); | |
| 132 | void update_tape_pos(void); | |
| 133 | static void ensure_a_lt_b(tape_pos_t& a , tape_pos_t& b); | |
| 134 | static bool any_hole(tape_pos_t tape_pos_a , tape_pos_t tape_pos_b); | |
| 135 | tape_pos_t next_hole(void) const; | |
| 136 | attotime time_to_distance(tape_pos_t distance) const; | |
| 137 | attotime time_to_target(tape_pos_t target) const; | |
| 138 | bool start_tape_cmd(UINT16 cmd_reg , UINT16 must_be_1 , UINT16 must_be_0); | |
| 139 | void start_tape(UINT16 cmd_reg); | |
| 140 | void stop_tape(void); | |
| 141 | tape_track_t& current_track(void); | |
| 142 | static tape_pos_t word_length(tape_word_t w); | |
| 143 | static tape_pos_t word_end_pos(const tape_track_t::iterator& it); | |
| 144 | static void adjust_it(tape_track_t& track , tape_track_t::iterator& it , tape_pos_t pos); | |
| 145 | void write_word(tape_pos_t start , tape_word_t word , tape_pos_t& length); | |
| 146 | void write_gap(tape_pos_t a , tape_pos_t b); | |
| 147 | bool just_gap(tape_pos_t a , tape_pos_t b); | |
| 148 | tape_pos_t farthest_end(const tape_track_t::iterator& it) const; | |
| 149 | bool next_data(tape_track_t::iterator& it , tape_pos_t pos , bool inclusive); | |
| 150 | adv_res_t adv_it(tape_track_t::iterator& it); | |
| 151 | attotime fetch_next_wr_word(void); | |
| 152 | attotime time_to_rd_next_word(tape_pos_t& word_rd_pos); | |
| 153 | bool next_n_gap(tape_pos_t& pos , tape_track_t::iterator it , unsigned n_gaps , tape_pos_t min_gap); | |
| 154 | bool next_n_gap(tape_pos_t& pos , unsigned n_gaps , tape_pos_t min_gap); | |
| 155 | void clear_tape(void); | |
| 156 | void dump_sequence(tape_track_t::const_iterator it_start , unsigned n_words); | |
| 157 | void save_tape(void); | |
| 158 | bool load_track(tape_track_t& track); | |
| 159 | bool load_tape(void); | |
| 160 | void set_tape_present(bool present); | |
| 161 | attotime time_to_next_hole(void) const; | |
| 162 | attotime time_to_tach_pulses(void) const; | |
| 163 | void start_cmd_exec(UINT16 new_cmd_reg); | |
| 164 | }; | |
| 165 | ||
| 166 | // device type definition | |
| 167 | extern const device_type HP_TACO; | |
| 168 | ||
| 169 | #endif /* __HP_TACO_H__ */ |
| r253556 | r253557 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | if (m_first) |
| 110 | 110 | { |
| 111 | machine().ui().draw_text_box(container, | |
| 111 | machine().ui().draw_text_box(container, "Audit in progress...", JUSTIFY_CENTER, 0.5f, 0.5f, UI_GREEN_COLOR); | |
| 112 | 112 | m_first = false; |
| 113 | 113 | return; |
| 114 | 114 | } |
| r253556 | r253557 | |
|---|---|---|
| 69 | 69 | new_barcode = m_barcode_buffer; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | item_append( | |
| 72 | item_append("New Barcode:", new_barcode, 0, ITEMREF_NEW_BARCODE); | |
| 73 | 73 | |
| 74 | 74 | // finish up the menu |
| 75 | 75 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 76 | item_append( | |
| 76 | item_append("Enter Code", nullptr, 0, ITEMREF_ENTER_BARCODE); | |
| 77 | 77 | |
| 78 | 78 | customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; |
| 79 | 79 | } |
| r253556 | r253557 | |
| 115 | 115 | std::string tmp_file(m_barcode_buffer); |
| 116 | 116 | //printf("code %s\n", m_barcode_buffer); |
| 117 | 117 | if (!current_device()->is_valid(tmp_file.length())) |
| 118 | machine().ui().popup_time(5, | |
| 118 | machine().ui().popup_time(5, "Barcode length invalid!"); | |
| 119 | 119 | else |
| 120 | 120 | { |
| 121 | 121 | current_device()->write_code(tmp_file.c_str(), tmp_file.length()); |
| r253556 | r253557 | |
|---|---|---|
| 75 | 75 | case IPT_UI_DOWN: |
| 76 | 76 | string = curcheat->comment(); |
| 77 | 77 | if (string != nullptr && string[0] != 0) |
| 78 | machine().popmessage( | |
| 78 | machine().popmessage("Cheat Comment:\n%s", string); | |
| 79 | 79 | break; |
| 80 | 80 | } |
| 81 | 81 | } |
| r253556 | r253557 | |
| 88 | 88 | |
| 89 | 89 | /* display the reloaded cheats */ |
| 90 | 90 | reset(UI_MENU_RESET_REMEMBER_REF); |
| 91 | machine().popmessage( | |
| 91 | machine().popmessage("All cheats reloaded"); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /* handle autofire menu */ |
| r253556 | r253557 | |
| 119 | 119 | std::string subtext; |
| 120 | 120 | |
| 121 | 121 | // add the autofire menu |
| 122 | item_append( | |
| 122 | item_append("Autofire Settings", nullptr, 0, (void *)ITEMREF_CHEATS_AUTOFIRE_SETTINGS); | |
| 123 | 123 | |
| 124 | 124 | /* add a separator */ |
| 125 | 125 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| r253556 | r253557 | |
| 137 | 137 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 138 | 138 | |
| 139 | 139 | /* add a reset all option */ |
| 140 | item_append( | |
| 140 | item_append("Reset All", nullptr, 0, (void *)ITEMREF_CHEATS_RESET_ALL); | |
| 141 | 141 | |
| 142 | 142 | /* add a reload all cheats option */ |
| 143 | item_append( | |
| 143 | item_append("Reload All", nullptr, 0, (void *)ITEMREF_CHEATS_RELOAD_ALL); | |
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
| r253556 | r253557 | |
| 256 | 256 | |
| 257 | 257 | /* add autofire toggle item */ |
| 258 | 258 | bool autofire_toggle = machine().ioport().get_autofire_toggle(); |
| 259 | item_append( | |
| 259 | item_append("Autofire Status", (autofire_toggle ? "Disabled" : "Enabled"), | |
| 260 | 260 | (autofire_toggle ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW), (void *)ITEMREF_AUTOFIRE_STATUS); |
| 261 | 261 | |
| 262 | 262 | /* iterate over the input ports and add autofire toggle items */ |
| r253556 | r253557 | |
| 282 | 282 | if (!autofire_toggle) |
| 283 | 283 | { |
| 284 | 284 | // item is enabled and can be switched to values on/off |
| 285 | item_append(field->name(), (settings.autofire ? | |
| 285 | item_append(field->name(), (settings.autofire ? "On" : "Off"), | |
| 286 | 286 | (settings.autofire ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW), (void *)field); |
| 287 | 287 | } |
| 288 | 288 | else |
| 289 | 289 | { |
| 290 | 290 | // item is disabled |
| 291 | item_append(field->name(), (settings.autofire ? | |
| 291 | item_append(field->name(), (settings.autofire ? "On" : "Off"), | |
| 292 | 292 | MENU_FLAG_DISABLE | MENU_FLAG_INVERT, nullptr); |
| 293 | 293 | } |
| 294 | 294 | } |
| r253556 | r253557 | |
| 299 | 299 | if (menu_items==0) |
| 300 | 300 | { |
| 301 | 301 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 302 | item_append( | |
| 302 | item_append("No buttons found on this machine!", nullptr, MENU_FLAG_DISABLE, nullptr); | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | /* add a separator */ |
| r253556 | r253557 | |
| 310 | 310 | snprintf(temp_text, ARRAY_LENGTH(temp_text), "%d = %.2f Hz", value, (float)refresh/value); |
| 311 | 311 | if (!autofire_toggle) |
| 312 | 312 | { |
| 313 | item_append( | |
| 313 | item_append("Autofire Delay", temp_text, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)ITEMREF_AUTOFIRE_DELAY); | |
| 314 | 314 | } |
| 315 | 315 | else |
| 316 | 316 | { |
| 317 | item_append( | |
| 317 | item_append("Autofire Delay", temp_text, MENU_FLAG_DISABLE | MENU_FLAG_INVERT, nullptr); | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | /* add a separator */ |
| r253556 | r253557 | |
|---|---|---|
| 103 | 103 | float width, maxwidth = origx2 - origx1; |
| 104 | 104 | ui_manager &mui = machine().ui(); |
| 105 | 105 | |
| 106 | mui.draw_text_full(container, | |
| 106 | mui.draw_text_full(container, "Device Mapping", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, | |
| 107 | 107 | DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); |
| 108 | 108 | width += 2 * UI_BOX_LR_BORDER; |
| 109 | 109 | maxwidth = MAX(maxwidth, width); |
| r253556 | r253557 | |
| 123 | 123 | y1 += UI_BOX_TB_BORDER; |
| 124 | 124 | |
| 125 | 125 | // draw the text within it |
| 126 | mui.draw_text_full(container, | |
| 126 | mui.draw_text_full(container, "Device Mapping", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE, | |
| 127 | 127 | DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); |
| 128 | 128 | |
| 129 | 129 | } |
| r253556 | r253557 | |
|---|---|---|
| 153 | 153 | { |
| 154 | 154 | // add main filter |
| 155 | 155 | UINT32 arrow_flags = get_arrow_flags((int)FILTER_ALL, (int)FILTER_UNAVAILABLE, custfltr::main); |
| 156 | item_append( | |
| 156 | item_append("Main filter", main_filters::text[custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER); | |
| 157 | 157 | |
| 158 | 158 | // add other filters |
| 159 | 159 | for (int x = 1; x <= custfltr::numother; x++) |
| r253556 | r253557 | |
| 162 | 162 | |
| 163 | 163 | // add filter items |
| 164 | 164 | arrow_flags = get_arrow_flags((int)FILTER_UNAVAILABLE + 1, (int)FILTER_LAST - 1, custfltr::other[x]); |
| 165 | item_append( | |
| 165 | item_append("Other filter", main_filters::text[custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x)); | |
| 166 | 166 | |
| 167 | 167 | if (m_added) |
| 168 | 168 | selected = item.size() - 2; |
| r253556 | r253557 | |
| 189 | 189 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 190 | 190 | |
| 191 | 191 | if (custfltr::numother > 0) |
| 192 | item_append( | |
| 192 | item_append("Remove last filter", nullptr, 0, (void *)(FPTR)REMOVE_FILTER); | |
| 193 | 193 | |
| 194 | 194 | if (custfltr::numother < MAX_CUST_FILTER - 2) |
| 195 | item_append( | |
| 195 | item_append("Add filter", nullptr, 0, (void *)(FPTR)ADD_FILTER); | |
| 196 | 196 | |
| 197 | 197 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 198 | 198 | customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; |
| r253556 | r253557 | |
| 207 | 207 | ui_manager &mui = machine().ui(); |
| 208 | 208 | |
| 209 | 209 | // get the size of the text |
| 210 | mui.draw_text_full(container, | |
| 210 | mui.draw_text_full(container, "Select custom filters:", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, | |
| 211 | 211 | DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); |
| 212 | 212 | width += (2.0f * UI_BOX_LR_BORDER) + 0.01f; |
| 213 | 213 | float maxwidth = MAX(width, origx2 - origx1); |
| r253556 | r253557 | |
| 227 | 227 | y1 += UI_BOX_TB_BORDER; |
| 228 | 228 | |
| 229 | 229 | // draw the text within it |
| 230 | mui.draw_text_full(container, | |
| 230 | mui.draw_text_full(container, "Select custom filters:", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, | |
| 231 | 231 | DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); |
| 232 | 232 | } |
| 233 | 233 | |
| r253556 | r253557 | |
| 438 | 438 | { |
| 439 | 439 | // add main filter |
| 440 | 440 | UINT32 arrow_flags = get_arrow_flags((int)UI_SW_ALL, (int)UI_SW_UNAVAILABLE, sw_custfltr::main); |
| 441 | item_append( | |
| 441 | item_append("Main filter", sw_filters::text[sw_custfltr::main], arrow_flags, (void *)(FPTR)MAIN_FILTER); | |
| 442 | 442 | |
| 443 | 443 | // add other filters |
| 444 | 444 | for (int x = 1; x <= sw_custfltr::numother; x++) |
| r253556 | r253557 | |
| 447 | 447 | |
| 448 | 448 | // add filter items |
| 449 | 449 | arrow_flags = get_arrow_flags((int)UI_SW_UNAVAILABLE + 1, (int)UI_SW_LAST - 1, sw_custfltr::other[x]); |
| 450 | item_append( | |
| 450 | item_append("Other filter", sw_filters::text[sw_custfltr::other[x]], arrow_flags, (void *)(FPTR)(OTHER_FILTER + x)); | |
| 451 | 451 | |
| 452 | 452 | if (m_added) |
| 453 | 453 | selected = item.size() - 2; |
| r253556 | r253557 | |
| 501 | 501 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 502 | 502 | |
| 503 | 503 | if (sw_custfltr::numother > 0) |
| 504 | item_append( | |
| 504 | item_append("Remove last filter", nullptr, 0, (void *)(FPTR)REMOVE_FILTER); | |
| 505 | 505 | |
| 506 | 506 | if (sw_custfltr::numother < MAX_CUST_FILTER - 2) |
| 507 | item_append( | |
| 507 | item_append("Add filter", nullptr, 0, (void *)(FPTR)ADD_FILTER); | |
| 508 | 508 | |
| 509 | 509 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 510 | 510 | |
| r253556 | r253557 | |
| 520 | 520 | ui_manager &mui = machine().ui(); |
| 521 | 521 | |
| 522 | 522 | // get the size of the text |
| 523 | mui.draw_text_full(container, | |
| 523 | mui.draw_text_full(container, "Select custom filters:", 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, | |
| 524 | 524 | DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr); |
| 525 | 525 | width += (2.0f * UI_BOX_LR_BORDER) + 0.01f; |
| 526 | 526 | float maxwidth = MAX(width, origx2 - origx1); |
| r253556 | r253557 | |
| 540 | 540 | y1 += UI_BOX_TB_BORDER; |
| 541 | 541 | |
| 542 | 542 | // draw the text within it |
| 543 | mui.draw_text_full(container, | |
| 543 | mui.draw_text_full(container, "Select custom filters:", x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, | |
| 544 | 544 | DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); |
| 545 | 545 | } |
| 546 | 546 |
| r253556 | r253557 | |
|---|---|---|
| 66 | 66 | m_change = _change; |
| 67 | 67 | m_search[0] = '\0'; |
| 68 | 68 | |
| 69 | // configure the starting path | |
| 69 | // configure the starting's path | |
| 70 | 70 | char *dst = nullptr; |
| 71 | 71 | osd_get_full_path(&dst, "."); |
| 72 | 72 | m_current_path = dst; |
| r253556 | r253557 | |
| 227 | 227 | } |
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | top_line = selected - (visible_lines / 2); | |
| 231 | 230 | } |
| 232 | 231 | } |
| 233 | 232 | else if (m_event->iptkey == IPT_UI_CANCEL) |
| r253556 | r253557 | |
|---|---|---|
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | if (selected_entry != nullptr && selected_entry != cur_selected) |
| 752 | { | |
| 753 | set_selection((void *)selected_entry); | |
| 754 | top_line = selected - (visible_lines / 2); | |
| 755 | } | |
| 752 | set_selection((void *) selected_entry); | |
| 756 | 753 | } |
| 757 | 754 | } |
| 758 | 755 | else if (event->iptkey == IPT_UI_CANCEL) |
| r253556 | r253557 | |
|---|---|---|
| 52 | 52 | std::string menu_text; |
| 53 | 53 | |
| 54 | 54 | /* add input menu items */ |
| 55 | item_append( | |
| 55 | item_append("Input (general)", nullptr, 0, (void *)INPUT_GROUPS); | |
| 56 | 56 | |
| 57 | strprintf(menu_text, | |
| 57 | strprintf(menu_text, "Input (this %s)", emulator_info::get_capstartgamenoun()); | |
| 58 | 58 | item_append(menu_text.c_str(), nullptr, 0, (void *)INPUT_SPECIFIC); |
| 59 | 59 | |
| 60 | 60 | /* add optional input-related menus */ |
| 61 | 61 | if (machine().ioport().has_analog()) |
| 62 | item_append( | |
| 62 | item_append("Analog Controls", nullptr, 0, (void *)ANALOG); | |
| 63 | 63 | if (machine().ioport().has_dips()) |
| 64 | item_append( | |
| 64 | item_append("Dip Switches", nullptr, 0, (void *)SETTINGS_DIP_SWITCHES); | |
| 65 | 65 | if (machine().ioport().has_configs()) |
| 66 | 66 | { |
| 67 | strprintf(menu_text, | |
| 67 | strprintf(menu_text, "%s Configuration", emulator_info::get_capstartgamenoun()); | |
| 68 | 68 | item_append(menu_text.c_str(), nullptr, 0, (void *)SETTINGS_DRIVER_CONFIG); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /* add bookkeeping menu */ |
| 72 | item_append( | |
| 72 | item_append("Bookkeeping Info", nullptr, 0, (void *)BOOKKEEPING); | |
| 73 | 73 | |
| 74 | 74 | /* add game info menu */ |
| 75 | strprintf(menu_text, | |
| 75 | strprintf(menu_text, "%s Information", emulator_info::get_capstartgamenoun()); | |
| 76 | 76 | item_append(menu_text.c_str(), nullptr, 0, (void *)GAME_INFO); |
| 77 | 77 | |
| 78 | 78 | image_interface_iterator imgiter(machine().root_device()); |
| 79 | 79 | if (imgiter.first() != nullptr) |
| 80 | 80 | { |
| 81 | 81 | /* add image info menu */ |
| 82 | item_append( | |
| 82 | item_append("Image Information", nullptr, 0, (void *)IMAGE_MENU_IMAGE_INFO); | |
| 83 | 83 | |
| 84 | 84 | /* add file manager menu */ |
| 85 | item_append( | |
| 85 | item_append("File Manager", nullptr, 0, (void *)IMAGE_MENU_FILE_MANAGER); | |
| 86 | 86 | |
| 87 | 87 | /* add tape control menu */ |
| 88 | 88 | cassette_device_iterator cassiter(machine().root_device()); |
| 89 | 89 | if (cassiter.first() != nullptr) |
| 90 | item_append( | |
| 90 | item_append("Tape Control", nullptr, 0, (void *)TAPE_CONTROL); | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | pty_interface_iterator ptyiter(machine().root_device()); |
| 94 | 94 | if (ptyiter.first() != nullptr) { |
| 95 | item_append( | |
| 95 | item_append("Pseudo terminals", nullptr, 0, (void *)PTY_INFO); | |
| 96 | 96 | } |
| 97 | 97 | if (machine().ioport().has_bioses()) |
| 98 | item_append( | |
| 98 | item_append("Bios Selection", nullptr, 0, (void *)BIOS_SELECTION); | |
| 99 | 99 | |
| 100 | 100 | slot_interface_iterator slotiter(machine().root_device()); |
| 101 | 101 | if (slotiter.first() != nullptr) |
| 102 | 102 | { |
| 103 | 103 | /* add slot info menu */ |
| 104 | item_append( | |
| 104 | item_append("Slot Devices", nullptr, 0, (void *)SLOT_DEVICES); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | barcode_reader_device_iterator bcriter(machine().root_device()); |
| 108 | 108 | if (bcriter.first() != nullptr) |
| 109 | 109 | { |
| 110 | 110 | /* add slot info menu */ |
| 111 | item_append( | |
| 111 | item_append("Barcode Reader", nullptr, 0, (void *)BARCODE_READ); | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | network_interface_iterator netiter(machine().root_device()); |
| 115 | 115 | if (netiter.first() != nullptr) |
| 116 | 116 | { |
| 117 | 117 | /* add image info menu */ |
| 118 | item_append( | |
| 118 | item_append("Network Devices", nullptr, 0, (void*)NETWORK_DEVICES); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | /* add keyboard mode menu */ |
| 122 | 122 | if (machine().ioport().has_keyboard() && machine().ioport().natkeyboard().can_post()) |
| 123 | item_append( | |
| 123 | item_append("Keyboard Mode", nullptr, 0, (void *)KEYBOARD_MODE); | |
| 124 | 124 | |
| 125 | 125 | /* add sliders menu */ |
| 126 | item_append( | |
| 126 | item_append("Slider Controls", nullptr, 0, (void *)SLIDERS); | |
| 127 | 127 | |
| 128 | 128 | /* add video options menu */ |
| 129 | item_append( | |
| 129 | item_append("Video Options", nullptr, 0, (machine().render().target_by_index(1) != nullptr) ? (void *)VIDEO_TARGETS : (void *)VIDEO_OPTIONS); | |
| 130 | 130 | |
| 131 | 131 | /* add crosshair options menu */ |
| 132 | 132 | if (machine().crosshair().get_usage()) |
| 133 | item_append( | |
| 133 | item_append("Crosshair Options", nullptr, 0, (void *)CROSSHAIR); | |
| 134 | 134 | |
| 135 | 135 | /* add cheat menu */ |
| 136 | 136 | if (machine().options().cheat()) |
| 137 | item_append( | |
| 137 | item_append("Cheat", nullptr, 0, (void *)CHEAT); | |
| 138 | 138 | |
| 139 | 139 | // add dats menu |
| 140 | 140 | if (machine().ui().options().enabled_dats() && machine().datfile().has_data(&machine().system())) |
| 141 | item_append( | |
| 141 | item_append("External DAT View", nullptr, 0, (void *)EXTERNAL_DATS); | |
| 142 | 142 | |
| 143 | 143 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 144 | 144 | |
| 145 | 145 | /* add favorite menu */ |
| 146 | 146 | if (!machine().favorite().isgame_favorite()) |
| 147 | item_append( | |
| 147 | item_append("Add To Favorites", nullptr, 0, (void *)ADD_FAVORITE); | |
| 148 | 148 | else |
| 149 | item_append( | |
| 149 | item_append("Remove From Favorites", nullptr, 0, (void *)REMOVE_FAVORITE); | |
| 150 | 150 | |
| 151 | 151 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 152 | 152 | |
| 153 | // menu_text.assign( | |
| 153 | // menu_text.assign("Quit from ").append(emulator_info::get_capstartgamenoun()); | |
| 154 | 154 | // item_append(menu_text.c_str(), nullptr, 0, (void *)QUIT_GAME); |
| 155 | 155 | |
| 156 | 156 | /* add reset and exit menus */ |
| 157 | strprintf(menu_text, | |
| 157 | strprintf(menu_text, "Select New %s", emulator_info::get_capstartgamenoun()); | |
| 158 | 158 | item_append(menu_text.c_str(), nullptr, 0, (void *)SELECT_GAME); |
| 159 | 159 | } |
| 160 | 160 |
| r253556 | r253557 | |
|---|---|---|
| 1309 | 1309 | star_texture = mrender.texture_alloc(); |
| 1310 | 1310 | star_texture->set_bitmap(*star_bitmap, star_bitmap->cliprect(), TEXFORMAT_ARGB32); |
| 1311 | 1311 | |
| 1312 | // allocate icons | |
| 1312 | // allocates icons bitmap and texture | |
| 1313 | 1313 | for (int i = 0; i < MAX_ICONS_RENDER; i++) |
| 1314 | 1314 | { |
| 1315 | 1315 | icons_bitmap[i] = auto_alloc(machine, bitmap_argb32); |
| r253556 | r253557 | |
| 1390 | 1390 | container->add_quad(0.0f, 0.0f, 1.0f, 1.0f, ARGB_WHITE, bgrnd_texture, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA)); |
| 1391 | 1391 | |
| 1392 | 1392 | hover = item.size() + 1; |
| 1393 | visible_items = (is_swlist) ? item.size() - 2 : item.size() - 2 - skip_main_items; | |
| 1394 | float extra_height = (is_swlist) ? 2.0f * line_height : (2.0f + skip_main_items) * line_height; | |
| 1393 | visible_items = (is_swlist) ? item.size() - 2 : item.size() - 5; | |
| 1394 | float extra_height = (is_swlist) ? 2.0f * line_height : 5.0f * line_height; | |
| 1395 | 1395 | float visible_extra_menu_height = customtop + custombottom + extra_height; |
| 1396 | 1396 | |
| 1397 | 1397 | // locate mouse |
| r253556 | r253557 | |
| 1518 | 1518 | int item_invert = pitem.flags & MENU_FLAG_INVERT; |
| 1519 | 1519 | float space = 0.0f; |
| 1520 | 1520 | |
| 1521 | if ( | |
| 1521 | if (!is_swlist) | |
| 1522 | 1522 | { |
| 1523 | 1523 | if (is_favorites) |
| 1524 | 1524 | { |
| r253556 | r253557 | |
| 2181 | 2181 | // if it fails, use the default image |
| 2182 | 2182 | if (!tmp_bitmap->valid()) |
| 2183 | 2183 | { |
| 2184 | //tmp_bitmap->reset(); | |
| 2184 | 2185 | tmp_bitmap->allocate(256, 256); |
| 2185 | 2186 | for (int x = 0; x < 256; x++) |
| 2186 | 2187 | for (int y = 0; y < 256; y++) |
| r253556 | r253557 | |
| 2225 | 2226 | } |
| 2226 | 2227 | |
| 2227 | 2228 | bitmap_argb32 *dest_bitmap; |
| 2229 | dest_bitmap = auto_alloc(machine(), bitmap_argb32); | |
| 2228 | 2230 | |
| 2229 | 2231 | // resample if necessary |
| 2230 | 2232 | if (dest_xPixel != tmp_bitmap->width() || dest_yPixel != tmp_bitmap->height()) |
| 2231 | 2233 | { |
| 2232 | dest_bitmap = auto_alloc(machine(), bitmap_argb32); | |
| 2233 | 2234 | dest_bitmap->allocate(dest_xPixel, dest_yPixel); |
| 2234 | 2235 | render_color color = { 1.0f, 1.0f, 1.0f, 1.0f }; |
| 2235 | 2236 | render_resample_argb_bitmap_hq(*dest_bitmap, *tmp_bitmap, color, true); |
| r253556 | r253557 | |
| 2237 | 2238 | else |
| 2238 | 2239 | dest_bitmap = tmp_bitmap; |
| 2239 | 2240 | |
| 2241 | //snapx_bitmap->reset(); | |
| 2240 | 2242 | snapx_bitmap->allocate(panel_width_pixel, panel_height_pixel); |
| 2241 | 2243 | int x1 = (0.5f * panel_width_pixel) - (0.5f * dest_xPixel); |
| 2242 | 2244 | int y1 = (0.5f * panel_height_pixel) - (0.5f * dest_yPixel); |
| r253556 | r253557 | |
| 2315 | 2317 | static const game_driver *olddriver[MAX_ICONS_RENDER] = { nullptr }; |
| 2316 | 2318 | float x1 = x0 + machine().ui().get_line_height() * container->manager().ui_aspect(container); |
| 2317 | 2319 | float y1 = y0 + machine().ui().get_line_height(); |
| 2318 | const game_driver *driver = (const game_driver *)selectedref; | |
| 2320 | const game_driver *driver = ((FPTR)selectedref > 2) ? (const game_driver *)selectedref : nullptr; | |
| 2319 | 2321 | |
| 2322 | if (driver == nullptr) | |
| 2323 | return; | |
| 2324 | ||
| 2320 | 2325 | if (olddriver[linenum] != driver || ui_globals::redraw_icon) |
| 2321 | 2326 | { |
| 2322 | 2327 | olddriver[linenum] = driver; |
| r253556 | r253557 | |
| 2397 | 2402 | |
| 2398 | 2403 | icons_texture[linenum]->set_bitmap(*icons_bitmap[linenum], icons_bitmap[linenum]->cliprect(), TEXFORMAT_ARGB32); |
| 2399 | 2404 | } |
| 2400 | else { | |
| 2401 | if (icons_bitmap[linenum] != nullptr) | |
| 2402 | { | |
| 2403 | icons_bitmap[linenum]->reset(); | |
| 2404 | } | |
| 2405 | } | |
| 2405 | else | |
| 2406 | icons_bitmap[linenum]->reset(); | |
| 2407 | ||
| 2406 | 2408 | auto_free(machine(), tmp); |
| 2407 | 2409 | } |
| 2408 | 2410 | |
| 2409 | if (icons_bitmap[linenum] | |
| 2411 | if (icons_bitmap[linenum]->valid()) | |
| 2410 | 2412 | container->add_quad(x0, y0, x1, y1, ARGB_WHITE, icons_texture[linenum], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_PACKABLE); |
| 2411 | 2413 | } |
| 2412 | 2414 |
| r253556 | r253557 | |
|---|---|---|
| 232 | 232 | int l_sw_hover; |
| 233 | 233 | int l_hover; |
| 234 | 234 | int totallines; |
| 235 | int skip_main_items; | |
| 236 | 235 | |
| 237 | 236 | // draw right box |
| 238 | 237 | float draw_right_box_title(float x1, float y1, float x2, float y2); |
| r253556 | r253557 | |
|---|---|---|
| 167 | 167 | // load drivers cache |
| 168 | 168 | init_sorted_list(); |
| 169 | 169 | |
| 170 | // check if there are available icons | |
| 171 | ui_globals::has_icons = false; | |
| 172 | file_enumerator path(moptions.icons_directory()); | |
| 173 | const osd_directory_entry *dir; | |
| 174 | while ((dir = path.next()) != nullptr) | |
| 175 | { | |
| 176 | std::string src(dir->name); | |
| 177 | if (src.find(".ico") != std::string::npos || src.find("icons") != std::string::npos) | |
| 178 | { | |
| 179 | ui_globals::has_icons = true; | |
| 180 | break; | |
| 181 | } | |
| 182 | } | |
| 183 | ||
| 184 | 170 | // build drivers list |
| 185 | 171 | if (!load_available_machines()) |
| 186 | 172 | build_available_list(); |
| r253556 | r253557 | |
| 615 | 601 | } |
| 616 | 602 | } |
| 617 | 603 | |
| 604 | // add special items | |
| 618 | 605 | item_append(MENU_SEPARATOR_ITEM, nullptr, MENU_FLAG_UI, nullptr); |
| 606 | item_append("Configure Options", nullptr, MENU_FLAG_UI, (void *)(FPTR)1); | |
| 607 | item_append("Configure Directories", nullptr, MENU_FLAG_UI, (void *)(FPTR)2); | |
| 608 | item_append("Save Configuration", nullptr, MENU_FLAG_UI, (void *)(FPTR)3); | |
| 619 | 609 | |
| 620 | // add special items | |
| 621 | if (ui_menu::stack_has_special_main_menu()) | |
| 622 | { | |
| 623 | item_append("Configure Options", nullptr, MENU_FLAG_UI, (void *)(FPTR)1); | |
| 624 | item_append("Configure Directories", nullptr, MENU_FLAG_UI, (void *)(FPTR)2); | |
| 625 | item_append("Save Configuration", nullptr, MENU_FLAG_UI, (void *)(FPTR)3); | |
| 626 | skip_main_items = 3; | |
| 627 | } | |
| 628 | else | |
| 629 | skip_main_items = 0; | |
| 630 | ||
| 631 | 610 | // configure the custom rendering |
| 632 | 611 | customtop = 3.0f * machine().ui().get_line_height() + 5.0f * UI_BOX_TB_BORDER; |
| 633 | 612 | custombottom = 5.0f * machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER; |
| r253556 | r253557 | |
| 778 | 757 | |
| 779 | 758 | // determine the text to render below |
| 780 | 759 | if (!isfavorite()) |
| 781 | driver = ((FPTR)selectedref > | |
| 760 | driver = ((FPTR)selectedref > 3) ? (const game_driver *)selectedref : nullptr; | |
| 782 | 761 | else |
| 783 | 762 | { |
| 784 | swinfo = ((FPTR)selectedref > | |
| 763 | swinfo = ((FPTR)selectedref > 3) ? (ui_software_info *)selectedref : nullptr; | |
| 785 | 764 | if (swinfo && swinfo->startempty == 1) |
| 786 | 765 | driver = swinfo->driver; |
| 787 | 766 | } |
| r253556 | r253557 | |
| 1866 | 1845 | |
| 1867 | 1846 | if (is_favorites) |
| 1868 | 1847 | { |
| 1869 | soft = ((FPTR)selectedref > | |
| 1848 | soft = ((FPTR)selectedref > 3) ? (ui_software_info *)selectedref : nullptr; | |
| 1870 | 1849 | if (soft && soft->startempty == 1) |
| 1871 | 1850 | { |
| 1872 | 1851 | driver = soft->driver; |
| r253556 | r253557 | |
| 1877 | 1856 | } |
| 1878 | 1857 | else |
| 1879 | 1858 | { |
| 1880 | driver = ((FPTR)selectedref > | |
| 1859 | driver = ((FPTR)selectedref > 3) ? (const game_driver *)selectedref : nullptr; | |
| 1881 | 1860 | oldsoft = nullptr; |
| 1882 | 1861 | } |
| 1883 | 1862 | |
| r253556 | r253557 | |
| 2186 | 2165 | |
| 2187 | 2166 | if (is_favorites) |
| 2188 | 2167 | { |
| 2189 | soft = ((FPTR)selectedref > | |
| 2168 | soft = ((FPTR)selectedref > 3) ? (ui_software_info *)selectedref : nullptr; | |
| 2190 | 2169 | if (soft && soft->startempty == 1) |
| 2191 | 2170 | { |
| 2192 | 2171 | driver = soft->driver; |
| r253556 | r253557 | |
| 2197 | 2176 | } |
| 2198 | 2177 | else |
| 2199 | 2178 | { |
| 2200 | driver = ((FPTR)selectedref > | |
| 2179 | driver = ((FPTR)selectedref > 3) ? (const game_driver *)selectedref : nullptr; | |
| 2201 | 2180 | oldsoft = nullptr; |
| 2202 | 2181 | } |
| 2203 | 2182 |
| r253556 | r253557 | |
|---|---|---|
| 603 | 603 | |
| 604 | 604 | void ui_menu_select_software::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2) |
| 605 | 605 | { |
| 606 | ui_software_info *swinfo = (ui_software_info *)selectedref; | |
| 606 | ui_software_info *swinfo = (FPTR)selectedref > 1 ? (ui_software_info *)selectedref : nullptr; | |
| 607 | 607 | const game_driver *driver = nullptr; |
| 608 | 608 | ui_manager &mui = machine().ui(); |
| 609 | 609 | float width; |
| r253556 | r253557 | |
| 1421 | 1421 | std::vector<int> xstart; |
| 1422 | 1422 | std::vector<int> xend; |
| 1423 | 1423 | float text_size = machine().ui().options().infos_size(); |
| 1424 | ui_software_info *soft = (ui_software_info *)selectedref; | |
| 1424 | ui_software_info *soft = ((FPTR)selectedref > 2) ? (ui_software_info *)selectedref : nullptr; | |
| 1425 | 1425 | static ui_software_info *oldsoft = nullptr; |
| 1426 | 1426 | static int old_sw_view = -1; |
| 1427 | 1427 | |
| r253556 | r253557 | |
| 1526 | 1526 | static ui_software_info *oldsoft = nullptr; |
| 1527 | 1527 | static const game_driver *olddriver = nullptr; |
| 1528 | 1528 | const game_driver *driver = nullptr; |
| 1529 | ui_software_info *soft = (ui_software_info *)selectedref; | |
| 1529 | ui_software_info *soft = ((FPTR)selectedref > 2) ? (ui_software_info *)selectedref : nullptr; | |
| 1530 | 1530 | |
| 1531 | 1531 | if (soft && soft->startempty == 1) |
| 1532 | 1532 | { |
| r253556 | r253557 | |
|---|---|---|
| 264 | 264 | item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr); |
| 265 | 265 | item_append("Configure Options", nullptr, 0, (void *)1); |
| 266 | 266 | item_append("Save Configuration", nullptr, 0, (void *)2); |
| 267 | skip_main_items = 2; | |
| 268 | 267 | } |
| 269 | 268 | |
| 270 | 269 | // configure the custom rendering |
| r253556 | r253557 | |
| 317 | 316 | DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr); |
| 318 | 317 | |
| 319 | 318 | // determine the text to render below |
| 320 | driver = ((FPTR)selectedref > skip_main_items) ? (const game_driver *)selectedref : nullptr; | |
| 321 | if (driver != nullptr) | |
| 319 | driver = ((FPTR)selectedref > 2) ? (const game_driver *)selectedref : nullptr; | |
| 320 | if ((FPTR)driver > 2) | |
| 322 | 321 | { |
| 323 | 322 | const char *gfxstat, *soundstat; |
| 324 | 323 |
| r253556 | r253557 | |
|---|---|---|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | if (selected_entry != nullptr && selected_entry != cur_selected) |
| 358 | { | |
| 359 | set_selection((void *)selected_entry); | |
| 360 | top_line = selected - (visible_lines / 2); | |
| 361 | } | |
| 358 | set_selection((void *) selected_entry); | |
| 362 | 359 | } |
| 363 | 360 | } |
| 364 | 361 | else if (event->iptkey == IPT_UI_CANCEL) |
| r253556 | r253557 | |
|---|---|---|
| 85 | 85 | |
| 86 | 86 | #define SLIDER_NOCHANGE 0x12345678 |
| 87 | 87 | |
| 88 | /*************************************************************************** | |
| 89 | FOR FUTURE LOCALIZATION | |
| 90 | ***************************************************************************/ | |
| 91 | #define _(param) param | |
| 92 | 88 | |
| 89 | ||
| 93 | 90 | /*************************************************************************** |
| 94 | 91 | TYPE DEFINITIONS |
| 95 | 92 | ***************************************************************************/ |
| r253556 | r253557 | |
|---|---|---|
| 48 | 48 | int ui_globals::visible_main_lines = 0; |
| 49 | 49 | int ui_globals::visible_sw_lines = 0; |
| 50 | 50 | UINT16 ui_globals::panels_status = 0; |
| 51 | bool ui_globals::has_icons = false; | |
| 52 | 51 | |
| 53 | 52 | // Custom filter |
| 54 | 53 | UINT16 custfltr::main = 0; |
| r253556 | r253557 | |
|---|---|---|
| 208 | 208 | static bool switch_image, redraw_icon, default_image, reset; |
| 209 | 209 | static int visible_main_lines, visible_sw_lines; |
| 210 | 210 | static UINT16 panels_status; |
| 211 | static bool has_icons; | |
| 212 | 211 | }; |
| 213 | 212 | |
| 214 | 213 | #define main_struct(name) \ |
| r253556 | r253557 | |
|---|---|---|
| 4186 | 4186 | qtono1 // 25/12/1990 (QUIZ 3) (c) 1991 Capcom (Japan) |
| 4187 | 4187 | // 4/1991 Ashita Tenki ni Naare (golf) |
| 4188 | 4188 | qsangoku // 07/06/1991 (QUIZ 4) (c) 1991 Capcom (Japan) |
| 4189 | block // 19/12/1991 (c) 1991 Capcom (World) (Joystick version) | |
| 4190 | blockr1 // 06/11/1991 (c) 1991 Capcom (World) (Joystick version) | |
| 4191 | blockr2 // 10/09/1991 (c) 1991 Capcom (World) | |
| 4189 | block // 10/09/1991 (c) 1991 Capcom (World) | |
| 4192 | 4190 | blockj // 10/09/1991 (c) 1991 Capcom (Japan) |
| 4191 | blockjoy // 06/11/1991 (c) 1991 Capcom (World) (Joystick version, bad dump?) | |
| 4193 | 4192 | blockbl // bootleg |
| 4194 | 4193 | |
| 4195 | 4194 | // Incredible Technologies games |
| r253556 | r253557 | |
| 10939 | 10938 | |
| 10940 | 10939 | // Success |
| 10941 | 10940 | tonton // (c) 199? Success / Taiyo Jidoki. |
| 10942 | kurukuru // (c) 199 | |
| 10941 | kurukuru // (c) 199? Success / Taiyo Jidoki. | |
| 10943 | 10942 | ppj // (c) 199? Success / Taiyo Jidoki. |
| 10944 | 10943 | othello // (c) 1984 Success. |
| 10945 | 10944 | sothello // (c) 1986 Success / Fujiwara. |
| r253556 | r253557 | |
|---|---|---|
| 825 | 825 | GAME( 1987, 1943ja, 1943, 1943, 1943, _1943_state, 1943, ROT270, "Capcom", "1943: Midway Kaisen (Japan)", MACHINE_SUPPORTS_SAVE ) |
| 826 | 826 | GAME( 1987, 1943b, 1943, 1943, 1943, _1943_state, 1943b,ROT270, "bootleg", "1943: Battle of Midway (bootleg, hack of Japan set)", MACHINE_SUPPORTS_SAVE ) |
| 827 | 827 | GAME( 1987, 1943bj, 1943, 1943, 1943, _1943_state, 1943b,ROT270, "bootleg", "1943: Midway Kaisen (bootleg)", MACHINE_SUPPORTS_SAVE ) |
| 828 | GAME( 1987, 1943kai, 0, 1943, 1943, _1943_state, 1943, ROT270, "Capcom", "1943 Kai: Midway Kaisen (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 828 | GAME( 1987, 1943kai, 0, 1943, 1943, _1943_state, 1943, ROT270, "Capcom", "1943 Kai: Midway Kaisen (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| No newline at end of file |
| r253556 | r253557 | |
|---|---|---|
| 4793 | 4793 | |
| 4794 | 4794 | GAME( 1980, spclaser, 0, invadpt2, spclaser, driver_device, 0, ROT270, "Taito", "Space Laser", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) |
| 4795 | 4795 | GAME( 1980, intruder, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "Taito (Game Plan license)", "Intruder", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) |
| 4796 | GAME( 1980, laser, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "bootleg (Leisure Time Electronics)", "Astro Laser (bootleg of Space Laser)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) | |
| 4796 | GAME( 1980, laser, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "bootleg (Leisure Time Electronics Inc.)", "Astro Laser (bootleg of Space Laser)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) | |
| 4797 | 4797 | GAME( 1979, spcewarl, spclaser, invadpt2, spclaser, driver_device, 0, ROT270, "Leijac Corporation", "Space War (Leijac Corporation)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // Taito's version is actually a spin-off of this? |
| 4798 | 4798 | |
| 4799 | 4799 | GAME( 1979, lrescue, 0, lrescue, lrescue, driver_device, 0, ROT270, "Taito", "Lunar Rescue", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_SOUND ) |
| r253556 | r253557 | |
|---|---|---|
| 17 | 17 | #include "softlist.h" |
| 18 | 18 | |
| 19 | 19 | static ADDRESS_MAP_START( at16_map, AS_PROGRAM, 16, at_state ) |
| 20 | ADDRESS_MAP_UNMAP_HIGH | |
| 21 | 20 | AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10") |
| 22 | 21 | AM_RANGE(0x0c0000, 0x0c7fff) AM_ROM |
| 23 | 22 | AM_RANGE(0x0c8000, 0x0cffff) AM_ROM |
| r253556 | r253557 | |
| 27 | 26 | ADDRESS_MAP_END |
| 28 | 27 | |
| 29 | 28 | static ADDRESS_MAP_START( ps2m30286_map, AS_PROGRAM, 16, at_state) |
| 30 | AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10") | |
| 29 | AM_RANGE(0x000000, 0x09ffff) AM_RAMBANK("bank10") | |
| 31 | 30 | AM_RANGE(0x0c0000, 0x0c7fff) AM_ROM |
| 32 | 31 | AM_RANGE(0x0c8000, 0x0cffff) AM_ROM |
| 33 | 32 | AM_RANGE(0x0d0000, 0x0dffff) AM_RAM |
| r253556 | r253557 | |
| 43 | 42 | ADDRESS_MAP_END |
| 44 | 43 | |
| 45 | 44 | static ADDRESS_MAP_START( at386_map, AS_PROGRAM, 32, at_state ) |
| 46 | ADDRESS_MAP_UNMAP_HIGH | |
| 47 | 45 | AM_RANGE(0x00000000, 0x0009ffff) AM_RAMBANK("bank10") |
| 48 | 46 | AM_RANGE(0x000a0000, 0x000bffff) AM_NOP |
| 49 | 47 | AM_RANGE(0x000c0000, 0x000c7fff) AM_ROM |
| r253556 | r253557 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | /* The top 64k of samples are banked (16 banks total) */ |
| 43 | 43 | |
| 44 | WRITE16_MEMBER(blmbycar_state::okibank_w) | |
| 44 | WRITE16_MEMBER(blmbycar_state::blmbycar_okibank_w) | |
| 45 | 45 | { |
| 46 | 46 | if (ACCESSING_BITS_0_7) |
| 47 | 47 | { |
| 48 | membank("okibank")->set_entry(data & 0x0f); | |
| 48 | UINT8 *RAM = memregion("oki")->base(); | |
| 49 | memcpy(&RAM[0x30000], &RAM[0x40000 + 0x10000 * (data & 0xf)], 0x10000); | |
| 49 | 50 | } |
| 50 | 51 | } |
| 51 | 52 | |
| r253556 | r253557 | |
| 97 | 98 | |
| 98 | 99 | ***************************************************************************/ |
| 99 | 100 | |
| 100 | static ADDRESS_MAP_START( | |
| 101 | static ADDRESS_MAP_START( blmbycar_map, AS_PROGRAM, 16, blmbycar_state ) | |
| 101 | 102 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 102 | 103 | AM_RANGE(0xfec000, 0xfeffff) AM_RAM |
| 103 | 104 | AM_RANGE(0x100000, 0x103fff) AM_WRITEONLY // ??? |
| 104 | AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(vram_1_w) AM_SHARE("vram_1") // Layer 1 | |
| 105 | AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(vram_0_w) AM_SHARE("vram_0") // Layer 0 | |
| 105 | AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_SHARE("vram_1") // Layer 1 | |
| 106 | AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_SHARE("vram_0") // Layer 0 | |
| 106 | 107 | AM_RANGE(0x108000, 0x10bfff) AM_WRITEONLY // ??? |
| 107 | 108 | AM_RANGE(0x10c000, 0x10c003) AM_WRITEONLY AM_SHARE("scroll_1") // Scroll 1 |
| 108 | 109 | AM_RANGE(0x10c004, 0x10c007) AM_WRITEONLY AM_SHARE("scroll_0") // Scroll 0 |
| r253556 | r253557 | |
| 112 | 113 | AM_RANGE(0x444000, 0x445fff) AM_WRITEONLY AM_SHARE("spriteram")// Sprites (size?) |
| 113 | 114 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW") |
| 114 | 115 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2") |
| 115 | AM_RANGE(0x70000c, 0x70000d) AM_WRITE(okibank_w) // Sound | |
| 116 | AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound | |
| 117 | ADDRESS_MAP_END | |
| 118 | ||
| 119 | static ADDRESS_MAP_START( blmbycar_map, AS_PROGRAM, 16, blmbycar_state ) | |
| 120 | AM_IMPORT_FROM(common_map) | |
| 121 | ||
| 122 | 116 | AM_RANGE(0x700004, 0x700005) AM_READ(blmbycar_opt_wheel_r) // Wheel (optical) |
| 123 | 117 | AM_RANGE(0x700006, 0x700007) AM_READ_PORT("UNK") |
| 124 | 118 | AM_RANGE(0x700008, 0x700009) AM_READ(blmbycar_pot_wheel_r) // Wheel (potentiometer) |
| 125 | 119 | AM_RANGE(0x70000a, 0x70000b) AM_WRITENOP // ? Wheel |
| 120 | AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w) // Sound | |
| 121 | AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // Sound | |
| 126 | 122 | AM_RANGE(0x70006a, 0x70006b) AM_WRITE(blmbycar_pot_wheel_reset_w) // Wheel (potentiometer) |
| 127 | 123 | AM_RANGE(0x70007a, 0x70007b) AM_WRITE(blmbycar_pot_wheel_shift_w) // |
| 128 | 124 | ADDRESS_MAP_END |
| r253556 | r253557 | |
| 134 | 130 | } |
| 135 | 131 | |
| 136 | 132 | static ADDRESS_MAP_START( watrball_map, AS_PROGRAM, 16, blmbycar_state ) |
| 137 | AM_IMPORT_FROM(common_map) | |
| 138 | ||
| 133 | AM_RANGE(0x000000, 0x0fffff) AM_ROM | |
| 134 | AM_RANGE(0xfec000, 0xfeffff) AM_RAM | |
| 135 | AM_RANGE(0x100000, 0x103fff) AM_WRITEONLY // ??? | |
| 136 | AM_RANGE(0x104000, 0x105fff) AM_RAM_WRITE(blmbycar_vram_1_w) AM_SHARE("vram_1") // Layer 1 | |
| 137 | AM_RANGE(0x106000, 0x107fff) AM_RAM_WRITE(blmbycar_vram_0_w) AM_SHARE("vram_0") // Layer 0 | |
| 138 | AM_RANGE(0x108000, 0x10bfff) AM_WRITEONLY // ??? | |
| 139 | AM_RANGE(0x10c000, 0x10c003) AM_WRITEONLY AM_SHARE("scroll_1") // Scroll 1 | |
| 140 | AM_RANGE(0x10c004, 0x10c007) AM_WRITEONLY AM_SHARE("scroll_0") // Scroll 0 | |
| 141 | AM_RANGE(0x200000, 0x2005ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_MIRROR(0x4000) // Palette | |
| 142 | AM_RANGE(0x200600, 0x203fff) AM_RAM AM_MIRROR(0x4000) | |
| 143 | AM_RANGE(0x440000, 0x441fff) AM_RAM | |
| 144 | AM_RANGE(0x444000, 0x445fff) AM_WRITEONLY AM_SHARE("spriteram")// Sprites (size?) | |
| 145 | AM_RANGE(0x700000, 0x700001) AM_READ_PORT("DSW") | |
| 146 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("P1_P2") | |
| 139 | 147 | AM_RANGE(0x700006, 0x700007) AM_READNOP // read |
| 140 | 148 | AM_RANGE(0x700008, 0x700009) AM_READ(waterball_unk_r) // 0x0008 must toggle |
| 141 | 149 | AM_RANGE(0x70000a, 0x70000b) AM_WRITEONLY // ?? busy |
| 150 | AM_RANGE(0x70000c, 0x70000d) AM_WRITE(blmbycar_okibank_w) // Sound | |
| 151 | AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) // | |
| 142 | 152 | ADDRESS_MAP_END |
| 143 | 153 | |
| 144 | static ADDRESS_MAP_START( blmbycar_oki_map, AS_0, 8, blmbycar_state ) | |
| 145 | AM_RANGE(0x00000, 0x2ffff) AM_ROM | |
| 146 | AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank") | |
| 147 | ADDRESS_MAP_END | |
| 148 | ||
| 149 | 154 | /*************************************************************************** |
| 150 | 155 | |
| 151 | 156 | |
| r253556 | r253557 | |
| 329 | 334 | { |
| 330 | 335 | save_item(NAME(m_pot_wheel)); |
| 331 | 336 | save_item(NAME(m_old_val)); |
| 332 | ||
| 333 | membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000); | |
| 334 | 337 | } |
| 335 | 338 | |
| 336 | 339 | MACHINE_RESET_MEMBER(blmbycar_state,blmbycar) |
| r253556 | r253557 | |
| 356 | 359 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 357 | 360 | MCFG_SCREEN_SIZE(0x180, 0x100) |
| 358 | 361 | MCFG_SCREEN_VISIBLE_AREA(0, 0x180-1, 0, 0x100-1) |
| 359 | MCFG_SCREEN_UPDATE_DRIVER(blmbycar_state, screen_update) | |
| 362 | MCFG_SCREEN_UPDATE_DRIVER(blmbycar_state, screen_update_blmbycar) | |
| 360 | 363 | MCFG_SCREEN_PALETTE("palette") |
| 361 | 364 | |
| 362 | 365 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", blmbycar) |
| r253556 | r253557 | |
| 368 | 371 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 369 | 372 | |
| 370 | 373 | MCFG_OKIM6295_ADD("oki", XTAL_1MHz, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified |
| 371 | MCFG_DEVICE_ADDRESS_MAP(AS_0, blmbycar_oki_map) | |
| 372 | 374 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) |
| 373 | 375 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) |
| 374 | 376 | MACHINE_CONFIG_END |
| r253556 | r253557 | |
| 377 | 379 | MACHINE_START_MEMBER(blmbycar_state,watrball) |
| 378 | 380 | { |
| 379 | 381 | save_item(NAME(m_retvalue)); |
| 380 | ||
| 381 | membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000); | |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | 384 | MACHINE_RESET_MEMBER(blmbycar_state,watrball) |
| r253556 | r253557 | |
| 386 | 386 | m_retvalue = 0; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | static MACHINE_CONFIG_ | |
| 389 | static MACHINE_CONFIG_START( watrball, blmbycar_state ) | |
| 390 | 390 | |
| 391 | 391 | /* basic machine hardware */ |
| 392 | MCFG_CPU_ | |
| 392 | MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) /* 12MHz */ | |
| 393 | 393 | MCFG_CPU_PROGRAM_MAP(watrball_map) |
| 394 | MCFG_CPU_VBLANK_INT_DRIVER("screen", blmbycar_state, irq1_line_hold) | |
| 394 | 395 | |
| 395 | 396 | MCFG_MACHINE_START_OVERRIDE(blmbycar_state,watrball) |
| 396 | 397 | MCFG_MACHINE_RESET_OVERRIDE(blmbycar_state,watrball) |
| 397 | 398 | |
| 398 | 399 | /* video hardware */ |
| 399 | MCFG_SCREEN_MODIFY("screen") | |
| 400 | MCFG_SCREEN_ADD("screen", RASTER) | |
| 401 | MCFG_SCREEN_REFRESH_RATE(60) | |
| 400 | 402 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 403 | MCFG_SCREEN_SIZE(0x180, 0x100) | |
| 401 | 404 | MCFG_SCREEN_VISIBLE_AREA(0, 0x180-1, 16, 0x100-1) |
| 405 | MCFG_SCREEN_UPDATE_DRIVER(blmbycar_state, screen_update_blmbycar) | |
| 406 | MCFG_SCREEN_PALETTE("palette") | |
| 407 | ||
| 408 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", blmbycar) | |
| 409 | MCFG_PALETTE_ADD("palette", 0x300) | |
| 410 | MCFG_PALETTE_FORMAT(xxxxBBBBRRRRGGGG) | |
| 411 | ||
| 412 | /* sound hardware */ | |
| 413 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") | |
| 414 | ||
| 415 | MCFG_OKIM6295_ADD("oki", XTAL_1MHz, OKIM6295_PIN7_HIGH) // clock frequency & pin 7 not verified | |
| 416 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0) | |
| 417 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0) | |
| 402 | 418 | MACHINE_CONFIG_END |
| 403 | 419 | |
| 404 | 420 | |
| r253556 | r253557 | |
| 434 | 450 | ROM_LOAD( "bc_rom9", 0x100000, 0x080000, CRC(0337ab3d) SHA1(18c72cd640c7b599390dffaeb670f5832202bf06) ) |
| 435 | 451 | ROM_LOAD( "bc_rom10", 0x180000, 0x080000, CRC(5458917e) SHA1(c8dd5a391cc20a573e27a140b185893a8c04859e) ) |
| 436 | 452 | |
| 437 | ROM_REGION( 0x100000, "oki", 0 ) /* 8 bit adpcm (banked) */ | |
| 438 | ROM_LOAD( "bc_rom1", 0x000000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) ) | |
| 439 | ROM_LOAD( "bc_rom2", 0x080000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) ) | |
| 453 | ROM_REGION( 0x140000, "oki", 0 ) /* 8 bit adpcm (banked) */ | |
| 454 | ROM_LOAD( "bc_rom1", 0x040000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) ) | |
| 455 | ROM_LOAD( "bc_rom2", 0x0c0000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) ) | |
| 456 | ROM_COPY( "oki", 0x040000, 0x000000, 0x040000 ) | |
| 440 | 457 | ROM_END |
| 441 | 458 | |
| 442 | 459 | ROM_START( blmbycaru ) |
| r253556 | r253557 | |
| 450 | 467 | ROM_LOAD( "bc_rom9", 0x100000, 0x080000, CRC(0337ab3d) SHA1(18c72cd640c7b599390dffaeb670f5832202bf06) ) |
| 451 | 468 | ROM_LOAD( "bc_rom10", 0x180000, 0x080000, CRC(5458917e) SHA1(c8dd5a391cc20a573e27a140b185893a8c04859e) ) |
| 452 | 469 | |
| 453 | ROM_REGION( 0x100000, "oki", 0 ) /* 8 bit adpcm (banked) */ | |
| 454 | ROM_LOAD( "bc_rom1", 0x000000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) ) | |
| 455 | ROM_LOAD( "bc_rom2", 0x080000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) ) | |
| 470 | ROM_REGION( 0x140000, "oki", 0 ) /* 8 bit adpcm (banked) */ | |
| 471 | ROM_LOAD( "bc_rom1", 0x040000, 0x080000, CRC(ac6f8ba1) SHA1(69d2d47cdd331bde5a8973d29659b3f8520452e7) ) | |
| 472 | ROM_LOAD( "bc_rom2", 0x0c0000, 0x080000, CRC(a4bc31bf) SHA1(f3d60141a91449a73f6cec9f4bc5d95ca7911e19) ) | |
| 473 | ROM_COPY( "oki", 0x040000, 0x000000, 0x040000 ) | |
| 456 | 474 | ROM_END |
| 457 | 475 | |
| 458 | 476 | /* |
| r253556 | r253557 | |
| 460 | 478 | Waterball by ABM (sticker on the pcb 12-3-96) |
| 461 | 479 | The pcb has some empty sockets, maybe it was used for other games since it has no markings. |
| 462 | 480 | |
| 463 | The game has fonts identical to World | |
| 481 | The game has fonts identical to World rally and obiviously Blomby car ;) | |
| 464 | 482 | |
| 465 | 483 | 1x 68k |
| 466 | 484 | 1x oki 6295 |
| r253556 | r253557 | |
| 482 | 500 | ROM_LOAD( "rom9.bin", 0x100000, 0x080000, CRC(122cc0ad) SHA1(27cdb19fa082089e47c5cdb44742cfd93aa23a00) ) |
| 483 | 501 | ROM_LOAD( "rom10.bin", 0x180000, 0x080000, CRC(22a2a706) SHA1(c7350a94a857e0007d7fc0076b44a3d62693cb6c) ) |
| 484 | 502 | |
| 485 | ROM_REGION( 0x100000, "oki", 0 ) /* 8 bit adpcm (banked) */ | |
| 486 | ROM_LOAD( "rom1.bin", 0x000000, 0x080000, CRC(7f88dee7) SHA1(d493b961fa4631185a33faee7f61786430707209)) | |
| 487 | // ROM_LOAD( "rom2.bin", 0x080000, 0x080000, /* not populated for this game */ ) | |
| 503 | ROM_REGION( 0x140000, "oki", 0 ) /* 8 bit adpcm (banked) */ | |
| 504 | ROM_LOAD( "rom1.bin", 0x040000, 0x080000, CRC(7f88dee7) SHA1(d493b961fa4631185a33faee7f61786430707209)) | |
| 505 | // ROM_LOAD( "rom2.bin", 0x0c0000, 0x080000, /* not populated for this game */ ) | |
| 506 | ROM_COPY( "oki", 0x040000, 0x000000, 0x040000 ) | |
| 488 | 507 | ROM_END |
| 489 | 508 | |
| 490 | 509 |
| r253556 | r253557 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | Marx Series 300 Electronic Bowling Game |
| 8 | 8 | Main board: |
| 9 | * TMS1100NLL MP3403 DBS 7836 SINGAPORE | |
| 9 | * TMS1100NLL MP3403 DBS 7836 SINGAPORE | |
| 10 | 10 | * 4*SN75492 quad segment driver, 2*SN74259 8-line demultiplexer, |
| 11 | 11 | 2*CD4043 quad r/s input latch |
| 12 | 12 | * 5 7seg LEDs, 15 lamps(10 lamps projected to bowling pins reflection), |
| r253556 | r253557 | |
| 161 | 161 | |
| 162 | 162 | ***************************************************************************/ |
| 163 | 163 | |
| 164 | // output PLA is not d | |
| 164 | // output PLA is not dumped | |
| 165 | 165 | static const UINT16 elecbowl_output_pla[0x20] = |
| 166 | 166 | { |
| 167 | 167 | lA+lB+lC+lD+lE+lF, // 0 |
| r253556 | r253557 | |
| 183 | 183 | static MACHINE_CONFIG_START( elecbowl, elecbowl_state ) |
| 184 | 184 | |
| 185 | 185 | /* basic machine hardware */ |
| 186 | MCFG_CPU_ADD("maincpu", TMS1100, 350000) // | |
| 186 | MCFG_CPU_ADD("maincpu", TMS1100, 350000) // RC osc. R=33K, C=100pf -> ~350kHz | |
| 187 | 187 | MCFG_TMS1XXX_OUTPUT_PLA(elecbowl_output_pla) |
| 188 | 188 | MCFG_TMS1XXX_READ_K_CB(READ8(elecbowl_state, read_k)) |
| 189 | 189 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(elecbowl_state, write_r)) |
| r253556 | r253557 | |
| 211 | 211 | ROM_LOAD( "mp3403.u9", 0x0000, 0x0800, CRC(9eabaa7d) SHA1(b1f54587ed7f2bbf3a5d49075c807296384c2b06) ) |
| 212 | 212 | |
| 213 | 213 | ROM_REGION( 867, "maincpu:mpla", 0 ) |
| 214 | ROM_LOAD( "tms1100_common | |
| 214 | ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, BAD_DUMP CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) // not verified | |
| 215 | 215 | ROM_REGION( 365, "maincpu:opla", 0 ) |
| 216 | 216 | ROM_LOAD( "tms1100_elecbowl_output.pla", 0, 365, NO_DUMP ) |
| 217 | 217 | ROM_END |
| r253556 | r253557 | |
|---|---|---|
| 389 | 389 | MCFG_CPU_PROGRAM_MAP(eag_map) |
| 390 | 390 | MCFG_CPU_PERIODIC_INT_DRIVER(fidel68k_state, irq2_line_hold, 600) // complete guess |
| 391 | 391 | |
| 392 | MCFG_NVRAM_ADD_ | |
| 392 | MCFG_NVRAM_ADD_0FILL("nvram") | |
| 393 | 393 | |
| 394 | 394 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", fidelz80base_state, display_decay_tick, attotime::from_msec(1)) |
| 395 | 395 | MCFG_DEFAULT_LAYOUT(layout_fidel_eag) |
| r253556 | r253557 | |
|---|---|---|
| 691 | 691 | } |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | void fidelz80base_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 694 | void fidelz80base_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) | |
| 695 | 695 | { |
| 696 | 696 | set_display_size(maxx, maxy); |
| 697 | 697 | |
| r253556 | r253557 | |
| 700 | 700 | for (int y = 0; y < maxy; y++) |
| 701 | 701 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
| 702 | 702 | |
| 703 | if (update) | |
| 704 | display_update(); | |
| 703 | display_update(); | |
| 705 | 704 | } |
| 706 | 705 | |
| 707 | 706 |
| r253556 | r253557 | |
|---|---|---|
| 255 | 255 | |
| 256 | 256 | ROM_START (galaxy) |
| 257 | 257 | ROM_REGION (0x10000, "maincpu", ROMREGION_ERASEFF) |
| 258 | ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC( | |
| 258 | ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC(365f3e24) SHA1(ffc6bf2ec09eabdad76604a63f5dd697c30c4358)) | |
| 259 | 259 | ROM_LOAD_OPTIONAL ("galrom2.bin", 0x1000, 0x1000, CRC(5dc5a100) SHA1(5d5ab4313a2d0effe7572bb129193b64cab002c1)) |
| 260 | 260 | ROM_REGION(0x0800, "gfx1",0) |
| 261 | 261 | ROM_LOAD ("galchr.bin", 0x0000, 0x0800, CRC(5c3b5bb5) SHA1(19429a61dc5e55ddec3242a8f695e06dd7961f88)) |
| r253556 | r253557 | |
| 263 | 263 | |
| 264 | 264 | ROM_START (galaxyp) |
| 265 | 265 | ROM_REGION (0x10000, "maincpu", ROMREGION_ERASEFF) |
| 266 | ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC( | |
| 266 | ROM_LOAD ("galrom1.bin", 0x0000, 0x1000, CRC(365f3e24) SHA1(ffc6bf2ec09eabdad76604a63f5dd697c30c4358)) | |
| 267 | 267 | ROM_LOAD ("galrom2.bin", 0x1000, 0x1000, CRC(5dc5a100) SHA1(5d5ab4313a2d0effe7572bb129193b64cab002c1)) |
| 268 | 268 | ROM_LOAD ("galplus.bin", 0xe000, 0x1000, CRC(d4cfab14) SHA1(b507b9026844eeb757547679907394aa42055eee)) |
| 269 | 269 | ROM_REGION(0x0800, "gfx1",0) |
| r253556 | r253557 | |
| 271 | 271 | ROM_END |
| 272 | 272 | |
| 273 | 273 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
| 274 | COMP(1983, galaxy, 0, 0, galaxy, galaxy, galaxy_state, galaxy, "Voja Antonic / Elektronika inzenjering", "Galaksija", 0) | |
| 275 | COMP(1985, galaxyp, galaxy, 0, galaxyp,galaxyp, galaxy_state,galaxyp,"Nenad Dunjic", "Galaksija plus", 0) | |
| 274 | COMP(1983, galaxy, 0, 0, galaxy, galaxy, galaxy_state, galaxy, "Elektronika inzenjering", "Galaksija", 0) | |
| 275 | COMP(1985, galaxyp, galaxy, 0, galaxyp,galaxyp, galaxy_state,galaxyp,"Elektronika inzenjering", "Galaksija plus", 0) |
| r253556 | r253557 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | Driver by Manuel Abadia <emumanu+mame@gmail.com> |
| 8 | 8 | |
| 9 | The DS5002FP has up to 128KB undumped gameplay code making the game unplayable, | |
| 10 | except for the Promat licensed Korean version which is unprotected. | |
| 9 | The DS5002FP has up to 128KB undumped gameplay code making the game unplayable :_( | |
| 11 | 10 | |
| 12 | 11 | ***************************************************************************/ |
| 13 | 12 | |
| r253556 | r253557 | |
| 21 | 20 | m_cause_interrupt = 1; |
| 22 | 21 | } |
| 23 | 22 | |
| 24 | INTERRUPT_GEN_MEMBER(glass_state::interrupt) | |
| 23 | INTERRUPT_GEN_MEMBER(glass_state::glass_interrupt) | |
| 25 | 24 | { |
| 26 | 25 | if (m_cause_interrupt) |
| 27 | 26 | { |
| r253556 | r253557 | |
| 55 | 54 | |
| 56 | 55 | WRITE16_MEMBER(glass_state::OKIM6295_bankswitch_w) |
| 57 | 56 | { |
| 57 | UINT8 *RAM = memregion("oki")->base(); | |
| 58 | ||
| 58 | 59 | if (ACCESSING_BITS_0_7) |
| 59 | mem | |
| 60 | memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f) * 0x10000], 0x10000); | |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | WRITE16_MEMBER(glass_state::coin_w) | |
| 63 | WRITE16_MEMBER(glass_state::glass_coin_w) | |
| 63 | 64 | { |
| 64 | 65 | switch (offset >> 3) |
| 65 | 66 | { |
| r253556 | r253557 | |
| 78 | 79 | |
| 79 | 80 | static ADDRESS_MAP_START( glass_map, AS_PROGRAM, 16, glass_state ) |
| 80 | 81 | AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ |
| 81 | AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(vram_w) AM_SHARE("videoram") /* Video RAM */ | |
| 82 | AM_RANGE(0x100000, 0x101fff) AM_RAM_WRITE(glass_vram_w) AM_SHARE("videoram") /* Video RAM */ | |
| 82 | 83 | AM_RANGE(0x102000, 0x102fff) AM_RAM /* Extra Video RAM */ |
| 83 | 84 | AM_RANGE(0x108000, 0x108007) AM_WRITEONLY AM_SHARE("vregs") /* Video Registers */ |
| 84 | 85 | AM_RANGE(0x108008, 0x108009) AM_WRITE(clr_int_w) /* CLR INT Video */ |
| r253556 | r253557 | |
| 88 | 89 | AM_RANGE(0x700002, 0x700003) AM_READ_PORT("DSW1") |
| 89 | 90 | AM_RANGE(0x700004, 0x700005) AM_READ_PORT("P1") |
| 90 | 91 | AM_RANGE(0x700006, 0x700007) AM_READ_PORT("P2") |
| 91 | AM_RANGE(0x700008, 0x700009) AM_WRITE(blitter_w) /* serial blitter */ | |
| 92 | AM_RANGE(0x700008, 0x700009) AM_WRITE(glass_blitter_w) /* serial blitter */ | |
| 92 | 93 | AM_RANGE(0x70000c, 0x70000d) AM_WRITE(OKIM6295_bankswitch_w) /* OKI6295 bankswitch */ |
| 93 | 94 | AM_RANGE(0x70000e, 0x70000f) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) /* OKI6295 status register */ |
| 94 | AM_RANGE(0x70000a, 0x70004b) AM_WRITE(coin_w) /* Coin Counters/Lockout */ | |
| 95 | AM_RANGE(0x70000a, 0x70004b) AM_WRITE(glass_coin_w) /* Coin Counters/Lockout */ | |
| 95 | 96 | AM_RANGE(0xfec000, 0xfeffff) AM_RAM AM_SHARE("mainram") /* Work RAM (partially shared with DS5002FP) */ |
| 96 | 97 | ADDRESS_MAP_END |
| 97 | 98 | |
| 98 | 99 | |
| 99 | static ADDRESS_MAP_START( oki_map, AS_0, 8, glass_state ) | |
| 100 | AM_RANGE(0x00000, 0x2ffff) AM_ROM | |
| 101 | AM_RANGE(0x30000, 0x3ffff) AM_ROMBANK("okibank") | |
| 102 | ADDRESS_MAP_END | |
| 103 | ||
| 104 | ||
| 105 | 100 | static INPUT_PORTS_START( glass ) |
| 106 | 101 | PORT_START("DSW1") |
| 107 | 102 | PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:6,7,8") |
| r253556 | r253557 | |
| 177 | 172 | |
| 178 | 173 | void glass_state::machine_start() |
| 179 | 174 | { |
| 180 | membank("okibank")->configure_entries(0, 16, memregion("oki")->base(), 0x10000); | |
| 181 | ||
| 182 | 175 | save_item(NAME(m_cause_interrupt)); |
| 183 | 176 | save_item(NAME(m_current_bit)); |
| 184 | 177 | save_item(NAME(m_current_command)); |
| r253556 | r253557 | |
| 187 | 180 | |
| 188 | 181 | void glass_state::machine_reset() |
| 189 | 182 | { |
| 183 | int i; | |
| 184 | ||
| 190 | 185 | m_cause_interrupt = 1; |
| 191 | 186 | m_current_bit = 0; |
| 192 | 187 | m_current_command = 0; |
| 193 | 188 | |
| 194 | for (i | |
| 189 | for (i = 0; i < 5; i++) | |
| 195 | 190 | m_blitter_serial_buffer[i] = 0; |
| 196 | 191 | } |
| 197 | 192 | |
| r253556 | r253557 | |
| 200 | 195 | /* basic machine hardware */ |
| 201 | 196 | MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2) /* 12 MHz verified on PCB */ |
| 202 | 197 | MCFG_CPU_PROGRAM_MAP(glass_map) |
| 203 | MCFG_CPU_VBLANK_INT_DRIVER("screen", glass_state, interrupt) | |
| 198 | MCFG_CPU_VBLANK_INT_DRIVER("screen", glass_state, glass_interrupt) | |
| 204 | 199 | |
| 205 | 200 | |
| 206 | 201 | /* video hardware */ |
| r253556 | r253557 | |
| 209 | 204 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 210 | 205 | MCFG_SCREEN_SIZE(32*16, 32*16) |
| 211 | 206 | MCFG_SCREEN_VISIBLE_AREA(0, 368-1, 16, 256-1) |
| 212 | MCFG_SCREEN_UPDATE_DRIVER(glass_state, screen_update) | |
| 207 | MCFG_SCREEN_UPDATE_DRIVER(glass_state, screen_update_glass) | |
| 213 | 208 | MCFG_SCREEN_PALETTE("palette") |
| 214 | 209 | |
| 215 | 210 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", glass) |
| r253556 | r253557 | |
| 220 | 215 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 221 | 216 | |
| 222 | 217 | MCFG_OKIM6295_ADD("oki", XTAL_1MHz, OKIM6295_PIN7_HIGH) /* 1MHz Resonator & pin 7 high verified on PCB */ |
| 223 | MCFG_DEVICE_ADDRESS_MAP(AS_0, oki_map) | |
| 224 | 218 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 225 | 219 | MACHINE_CONFIG_END |
| 226 | 220 | |
| r253556 | r253557 | |
| 242 | 236 | ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */ |
| 243 | 237 | ROM_LOAD( "h9.bin", 0x000000, 0x100000, CRC(b9492557) SHA1(3f5c0d696d65e1cd492763dfa749c813dd56a9bf) ) |
| 244 | 238 | |
| 245 | ROM_REGION( 0x1 | |
| 239 | ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */ | |
| 246 | 240 | ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) ) |
| 247 | 241 | /* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */ |
| 242 | ROM_RELOAD( 0x040000, 0x100000 ) | |
| 248 | 243 | ROM_END |
| 249 | 244 | |
| 250 | 245 | ROM_START( glass10 ) /* Version 1.0 */ |
| r253556 | r253557 | |
| 265 | 260 | ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */ |
| 266 | 261 | ROM_LOAD( "h9.bin", 0x000000, 0x100000, CRC(b9492557) SHA1(3f5c0d696d65e1cd492763dfa749c813dd56a9bf) ) |
| 267 | 262 | |
| 268 | ROM_REGION( 0x1 | |
| 263 | ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */ | |
| 269 | 264 | ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) ) |
| 270 | 265 | /* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */ |
| 266 | ROM_RELOAD( 0x040000, 0x100000 ) | |
| 271 | 267 | ROM_END |
| 272 | 268 | |
| 273 | 269 | ROM_START( glass10a ) /* Title screen shows "GLASS" and under that "Break Edition" on a real PCB */ |
| r253556 | r253557 | |
| 288 | 284 | ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */ |
| 289 | 285 | ROM_LOAD( "h9.bin", 0x000000, 0x100000, CRC(b9492557) SHA1(3f5c0d696d65e1cd492763dfa749c813dd56a9bf) ) |
| 290 | 286 | |
| 291 | ROM_REGION( 0x1 | |
| 287 | ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */ | |
| 292 | 288 | ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) ) |
| 293 | 289 | /* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */ |
| 290 | ROM_RELOAD( 0x040000, 0x100000 ) | |
| 294 | 291 | ROM_END |
| 295 | 292 | |
| 296 | 293 | ROM_START( glasskr ) |
| r253556 | r253557 | |
| 308 | 305 | ROM_REGION( 0x100000, "gfx3", 0 ) /* 16 bitmaps (320x200, indexed colors) */ |
| 309 | 306 | ROM_LOAD( "glassk.h9", 0x000000, 0x100000, CRC(d499be4c) SHA1(204f754813be687e8dc00bfe7b5dbc4857ac8738) ) |
| 310 | 307 | |
| 311 | ROM_REGION( 0x1 | |
| 308 | ROM_REGION( 0x140000, "oki", 0 ) /* ADPCM samples - sound chip is OKIM6295 */ | |
| 312 | 309 | ROM_LOAD( "c1.bin", 0x000000, 0x100000, CRC(d9f075a2) SHA1(31a7a677861f39d512e9d1f51925c689e481159a) ) |
| 313 | 310 | /* 0x00000-0x2ffff is fixed, 0x30000-0x3ffff is bank switched from all the ROMs */ |
| 311 | ROM_RELOAD( 0x040000, 0x100000 ) | |
| 314 | 312 | ROM_END |
| 315 | 313 | |
| 316 | 314 | /*************************************************************************** |
| r253556 | r253557 | |
| 319 | 317 | |
| 320 | 318 | ***************************************************************************/ |
| 321 | 319 | |
| 322 | void glass_state::ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 ) | |
| 320 | void glass_state::glass_ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 ) | |
| 323 | 321 | { |
| 324 | 322 | int i; |
| 325 | 323 | |
| r253556 | r253557 | |
| 344 | 342 | |
| 345 | 343 | */ |
| 346 | 344 | |
| 347 | READ16_MEMBER( glass_state::mainram_r ) | |
| 345 | READ16_MEMBER( glass_state::glass_mainram_r ) | |
| 348 | 346 | { |
| 349 | 347 | UINT16 ret = m_mainram[offset]; |
| 350 | 348 | int pc = space.device().safe_pc(); |
| 351 | 349 | |
| 352 | 350 | if (offset == (0xfede96 - 0xfec000)>>1) |
| 353 | 351 | { |
| 354 | // this address seems important, the game will abort with 'power failure' depending on some reads, presumably refer | |
| 352 | // this address seems important, the game will abort with 'power failure' depending on some reads, presumably refering to the power to the battery | |
| 355 | 353 | |
| 356 | 354 | // there are also various code segments like the one below |
| 357 | 355 | /* |
| r253556 | r253557 | |
| 378 | 376 | return ret; |
| 379 | 377 | } |
| 380 | 378 | |
| 381 | WRITE16_MEMBER( glass_state::mainram_w ) | |
| 379 | WRITE16_MEMBER( glass_state::glass_mainram_w ) | |
| 382 | 380 | { |
| 383 | 381 | int pc = space.device().safe_pc(); |
| 384 | 382 | |
| r253556 | r253557 | |
| 438 | 436 | */ |
| 439 | 437 | |
| 440 | 438 | /* split ROM H13 */ |
| 441 | ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0200000, 0x0000000, 0x0100000); | |
| 439 | glass_ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0200000, 0x0000000, 0x0100000); | |
| 442 | 440 | |
| 443 | 441 | /* split ROM H11 */ |
| 444 | ROM16_split_gfx("gfx2", "gfx1", 0x0200000, 0x0200000, 0x0200000, 0x0300000); | |
| 442 | glass_ROM16_split_gfx("gfx2", "gfx1", 0x0200000, 0x0200000, 0x0200000, 0x0300000); | |
| 445 | 443 | |
| 446 | 444 | } |
| 447 | 445 | |
| r253556 | r253557 | |
| 451 | 449 | DRIVER_INIT_CALL(glass); |
| 452 | 450 | |
| 453 | 451 | /* install custom handler over RAM for protection */ |
| 454 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfec000, 0xfeffff, read16_delegate(FUNC(glass_state::mainram_r), this), write16_delegate(FUNC(glass_state::mainram_w),this)); | |
| 452 | m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xfec000, 0xfeffff, read16_delegate(FUNC(glass_state::glass_mainram_r), this), write16_delegate(FUNC(glass_state::glass_mainram_w),this)); | |
| 455 | 453 | |
| 456 | 454 | } |
| 457 | 455 |
| r253556 | r253557 | |
|---|---|---|
| 6752 | 6752 | 128*8 /* every char takes 128 consecutive bytes */ |
| 6753 | 6753 | }; |
| 6754 | 6754 | |
| 6755 | static const gfx_layout super9_charlayout = | |
| 6756 | { | |
| 6757 | 8,8, /* 8*8 characters */ | |
| 6758 | 4096, /* 4096 characters */ | |
| 6759 | 3, /* 3 bits per pixel */ | |
| 6760 | { 2, 4, 6 }, /* the bitplanes are packed in one byte */ | |
| 6761 | { 0*8+0, 0*8+1, 1*8+0, 1*8+1, 2*8+0, 2*8+1, 3*8+0, 3*8+1 }, | |
| 6762 | { 0*32, 4*32, 2*32, 6*32, 1*32, 5*32, 3*32, 7*32 }, | |
| 6763 | 32*8 /* every char takes 32 consecutive bytes */ | |
| 6764 | }; | |
| 6765 | 6755 | |
| 6766 | static const gfx_layout super9_tilelayout = // Green is OK. Red needs normal goldstar order... | |
| 6767 | { | |
| 6768 | 8,32, /* 8*32 characters */ | |
| 6769 | 256, /* 256 tiles */ | |
| 6770 | 4, /* 4 bits per pixel */ | |
| 6771 | { 0, 2, 4, 6 }, | |
| 6772 | { 1, 0, 1*8+1, 1*8+0, 2*8+1, 2*8+0, 3*8+1, 3*8+0 }, | |
| 6773 | { 0*8, 4*8, 8*8, 12*8, 16*8, 20*8, 24*8, 28*8, | |
| 6774 | 32*8, 36*8, 40*8, 44*8, 48*8, 52*8, 56*8, 60*8, | |
| 6775 | 64*8, 68*8, 72*8, 76*8, 80*8, 84*8, 88*8, 92*8, | |
| 6776 | 96*8, 100*8, 104*8, 108*8, 112*8, 116*8, 120*8, 124*8 }, | |
| 6777 | 128*8 /* every char takes 128 consecutive bytes */ | |
| 6778 | }; | |
| 6779 | 6756 | |
| 6780 | ||
| 6781 | ||
| 6782 | 6757 | static GFXDECODE_START( goldstar ) |
| 6783 | 6758 | GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 ) |
| 6784 | 6759 | GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 128, 8 ) |
| r253556 | r253557 | |
| 6877 | 6852 | */ |
| 6878 | 6853 | GFXDECODE_END |
| 6879 | 6854 | |
| 6880 | static GFXDECODE_START( super9 ) | |
| 6881 | GFXDECODE_ENTRY( "gfx1", 0, super9_charlayout, 0, 16 ) | |
| 6882 | GFXDECODE_ENTRY( "gfx2", 0, super9_tilelayout, 128, 8 ) | |
| 6883 | GFXDECODE_END | |
| 6884 | 6855 | |
| 6885 | ||
| 6886 | 6856 | static const gfx_layout tiles8x32_4bpp_layout = |
| 6887 | 6857 | { |
| 6888 | 6858 | 8,32, |
| r253556 | r253557 | |
| 7183 | 7153 | MCFG_SCREEN_UPDATE_DRIVER(goldstar_state, screen_update_goldstar) |
| 7184 | 7154 | MCFG_SCREEN_PALETTE("palette") |
| 7185 | 7155 | |
| 7186 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", s | |
| 7156 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", goldstar) | |
| 7187 | 7157 | MCFG_PALETTE_ADD("palette", 256) |
| 7188 | 7158 | MCFG_PALETTE_FORMAT(BBGGGRRR) |
| 7189 | 7159 | MCFG_NVRAM_ADD_1FILL("nvram") |
| 7190 | 7160 | |
| 7191 | MCFG_VIDEO_START_OVERRIDE(goldstar_state, | |
| 7161 | MCFG_VIDEO_START_OVERRIDE(goldstar_state,goldstar) | |
| 7192 | 7162 | |
| 7193 | 7163 | /* sound hardware */ |
| 7194 | 7164 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r253556 | r253557 | |
| 12019 | 11989 | |
| 12020 | 11990 | |
| 12021 | 11991 | /* Super Cherry Master. |
| 12022 | Lacks of Dyna copyright. Maybe bootleg. | |
| 12023 | ||
| 12024 | Not reels stop options. | |
| 12025 | Tried any input on the real hardware without luck. | |
| 11992 | Dyna. | |
| 12026 | 11993 | */ |
| 12027 | 11994 | ROM_START( scmaster ) // all roms unique |
| 12028 | 11995 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| r253556 | r253557 | |
|---|---|---|
| 66 | 66 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 67 | 67 | void display_update(); |
| 68 | 68 | void set_display_size(int maxx, int maxy); |
| 69 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 69 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); | |
| 70 | 70 | |
| 71 | 71 | protected: |
| 72 | 72 | virtual void machine_start() override; |
| r253556 | r253557 | |
| 194 | 194 | m_display_maxy = maxy; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | void hh_cop400_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 197 | void hh_cop400_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) | |
| 198 | 198 | { |
| 199 | 199 | set_display_size(maxx, maxy); |
| 200 | 200 | |
| r253556 | r253557 | |
| 203 | 203 | for (int y = 0; y < maxy; y++) |
| 204 | 204 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
| 205 | 205 | |
| 206 | if (update) | |
| 207 | display_update(); | |
| 206 | display_update(); | |
| 208 | 207 | } |
| 209 | 208 | |
| 210 | 209 | |
| 211 | // generic input handlers | |
| 212 | ||
| 213 | 210 | UINT8 hh_cop400_state::read_inputs(int columns) |
| 214 | 211 | { |
| 215 | 212 | // active low |
| r253556 | r253557 | |
| 235 | 232 | |
| 236 | 233 | Castle Toy Einstein |
| 237 | 234 | * COP421 MCU labeled ~/927 COP421-NEZ/N |
| 238 | * 4 lamps, 1 | |
| 235 | * 4 lamps, 1bit sound | |
| 239 | 236 | |
| 240 | 237 | ***************************************************************************/ |
| 241 | 238 | |
| r253556 | r253557 | |
| 280 | 277 | |
| 281 | 278 | Entex Space Invader |
| 282 | 279 | * COP444L MCU labeled /B138 COPL444-HRZ/N INV II (die labeled HRZ COP 444L/A) |
| 283 | * 3 7seg LEDs, LED matrix and overlay mask, 1 | |
| 280 | * 3 7seg LEDs, LED matrix and overlay mask, 1bit sound | |
| 284 | 281 | |
| 285 | 282 | The first version was on TMS1100 (see hh_tms1k.c), this is the reprogrammed |
| 286 | 283 | second release with a gray case instead of black. |
| r253556 | r253557 | |
| 396 | 393 | |
| 397 | 394 | Mattel Funtronics Jacks |
| 398 | 395 | * COP410L MCU bonded directly to PCB (die labeled COP410L/B NGS) |
| 399 | * 8 LEDs, 1 | |
| 396 | * 8 LEDs, 1bit sound | |
| 400 | 397 | |
| 401 | 398 | ***************************************************************************/ |
| 402 | 399 | |
| r253556 | r253557 | |
| 503 | 500 | |
| 504 | 501 | Mattel Funtronics Red Light Green Light |
| 505 | 502 | * COP410L MCU bonded directly to PCB (die labeled COP410L/B NHZ) |
| 506 | * 14 LEDs, 1 | |
| 503 | * 14 LEDs, 1bit sound | |
| 507 | 504 | |
| 508 | 505 | known releases: |
| 509 | 506 | - USA: Funtronics Red Light Green Light |
| r253556 | r253557 | |
| 598 | 595 | |
| 599 | 596 | Milton Bradley Plus One |
| 600 | 597 | * COP410L MCU in 8-pin DIP, labeled ~/029 MM 57405 (die labeled COP410L/B NNE) |
| 601 | * 4 sensors(1 on each die side), 1 | |
| 598 | * 4 sensors(1 on each die side), 1bit sound | |
| 602 | 599 | |
| 603 | 600 | ***************************************************************************/ |
| 604 | 601 | |
| r253556 | r253557 | |
| 642 | 639 | |
| 643 | 640 | Milton Bradley (Electronic) Lightfight |
| 644 | 641 | * COP421L MCU labeled /B119 COP421L-HLA/N |
| 645 | * LED matrix, 1 | |
| 642 | * LED matrix, 1bit sound | |
| 646 | 643 | |
| 647 | 644 | Xbox-shaped electronic game for 2 or more players, with long diagonal buttons |
| 648 | 645 | next to each outer LED. The main object of the game is to pinpoint a light |
| r253556 | r253557 | |
|---|---|---|
| 138 | 138 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 139 | 139 | void display_update(); |
| 140 | 140 | void set_display_size(int maxx, int maxy); |
| 141 | void display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety | |
| 141 | void display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety); | |
| 142 | 142 | |
| 143 | 143 | protected: |
| 144 | 144 | virtual void machine_start() override; |
| r253556 | r253557 | |
| 267 | 267 | m_display_maxy = maxy; |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety | |
| 270 | void hh_hmcs40_state::display_matrix(int maxx, int maxy, UINT64 setx, UINT32 sety) | |
| 271 | 271 | { |
| 272 | 272 | set_display_size(maxx, maxy); |
| 273 | 273 | |
| r253556 | r253557 | |
| 276 | 276 | for (int y = 0; y < maxy; y++) |
| 277 | 277 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (U64(1) << maxx)) : 0; |
| 278 | 278 | |
| 279 | if (update) | |
| 280 | display_update(); | |
| 279 | display_update(); | |
| 281 | 280 | } |
| 282 | 281 | |
| 283 | 282 | |
| 284 | // generic input handlers | |
| 285 | ||
| 286 | 283 | UINT16 hh_hmcs40_state::read_inputs(int columns) |
| 287 | 284 | { |
| 288 | 285 | UINT16 ret = 0; |
| r253556 | r253557 | |
|---|---|---|
| 54 | 54 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 55 | 55 | void display_update(); |
| 56 | 56 | void set_display_size(int maxx, int maxy); |
| 57 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 57 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); | |
| 58 | 58 | |
| 59 | 59 | protected: |
| 60 | 60 | virtual void machine_start() override; |
| r253556 | r253557 | |
| 176 | 176 | m_display_maxy = maxy; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | void hh_melps4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 179 | void hh_melps4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) | |
| 180 | 180 | { |
| 181 | 181 | set_display_size(maxx, maxy); |
| 182 | 182 | |
| r253556 | r253557 | |
| 185 | 185 | for (int y = 0; y < maxy; y++) |
| 186 | 186 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
| 187 | 187 | |
| 188 | if (update) | |
| 189 | display_update(); | |
| 188 | display_update(); | |
| 190 | 189 | } |
| 191 | 190 | |
| 192 | 191 |
| r253556 | r253557 | |
|---|---|---|
| 66 | 66 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 67 | 67 | void display_update(); |
| 68 | 68 | void set_display_size(int maxx, int maxy); |
| 69 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 69 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); | |
| 70 | 70 | |
| 71 | 71 | protected: |
| 72 | 72 | virtual void machine_start() override; |
| r253556 | r253557 | |
| 186 | 186 | m_display_maxy = maxy; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 189 | void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) | |
| 190 | 190 | { |
| 191 | 191 | set_display_size(maxx, maxy); |
| 192 | 192 | |
| r253556 | r253557 | |
| 195 | 195 | for (int y = 0; y < maxy; y++) |
| 196 | 196 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
| 197 | 197 | |
| 198 | if (update) | |
| 199 | display_update(); | |
| 198 | display_update(); | |
| 200 | 199 | } |
| 201 | 200 | |
| 202 | 201 |
| r253556 | r253557 | |
|---|---|---|
| 22 | 22 | @MP1030 TMS1100 1980, APF Mathemagician |
| 23 | 23 | @MP1133 TMS1470 1979, Kosmos Astro |
| 24 | 24 | @MP1180 TMS1100 1980, Tomy Power House Pinball |
| 25 | | |
| 25 | *MP1181 TMS1100 1979, Conic Football 2 | |
| 26 | 26 | @MP1204 TMS1100 1980, Entex Baseball 3 (6007) |
| 27 | 27 | @MP1211 TMS1100 1980, Entex Space Invader |
| 28 | 28 | @MP1218 TMS1100 1980, Entex Basketball 2 (6010) |
| r253556 | r253557 | |
| 48 | 48 | @MP3404 TMS1100 1978, Parker Brothers Merlin |
| 49 | 49 | @MP3405 TMS1100 1979, Coleco Amaze-A-Tron |
| 50 | 50 | @MP3415 TMS1100 1978, Coleco Electronic Quarterback |
| 51 | @MP3435 TMS1100 1979, Coleco Zodiac | |
| 52 | 51 | @MP3438A TMS1100 1979, Kenner Star Wars Electronic Battle Command |
| 53 | 52 | MP3450A TMS1100 1979, MicroVision cartridge: Blockbuster |
| 54 | 53 | MP3454 TMS1100 1979, MicroVision cartridge: Star Trek Phaser Strike |
| r253556 | r253557 | |
| 66 | 65 | @M34012 TMS1100 1980, Mattel Dungeons & Dragons - Computer Labyrinth Game |
| 67 | 66 | *M34014 TMS1100 1981, Coleco Bowlatronic |
| 68 | 67 | M34017 TMS1100 1981, MicroVision cartridge: Cosmic Hunter |
| 69 | | |
| 68 | *M34038 TMS1100 1982, Parker Brothers Lost Treasure | |
| 70 | 69 | M34047 TMS1100 1982, MicroVision cartridge: Super Blockbuster |
| 71 | 70 | *M34078A TMS1100 1983, Milton Bradley Arcade Mania |
| 72 | 71 | @MP6100A TMS0980 1979, Ideal Electronic Detective |
| r253556 | r253557 | |
| 114 | 113 | #include "astro.lh" |
| 115 | 114 | #include "bankshot.lh" |
| 116 | 115 | #include "bigtrak.lh" |
| 117 | #include "cnfball2.lh" | |
| 118 | 116 | #include "cnsector.lh" |
| 119 | 117 | #include "comp4.lh" |
| 120 | 118 | #include "cqback.lh" |
| r253556 | r253557 | |
| 129 | 127 | #include "gpoker.lh" |
| 130 | 128 | #include "h2hbaseb.lh" |
| 131 | 129 | #include "h2hfootb.lh" |
| 132 | #include "lostreas.lh" | |
| 133 | 130 | #include "mathmagi.lh" |
| 134 | 131 | #include "merlin.lh" // clickable |
| 135 | 132 | #include "mmerlin.lh" // clickable |
| r253556 | r253557 | |
| 141 | 138 | #include "tandy12.lh" // clickable |
| 142 | 139 | #include "tbreakup.lh" |
| 143 | 140 | #include "tc4.lh" |
| 144 | #include "zodiac.lh" | |
| 145 | 141 | |
| 146 | 142 | #include "hh_tms1k_test.lh" // common test-layout - use external artwork |
| 147 | 143 | |
| r253556 | r253557 | |
| 287 | 283 | } |
| 288 | 284 | } |
| 289 | 285 | |
| 290 | void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 286 | void hh_tms1k_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) | |
| 291 | 287 | { |
| 292 | 288 | set_display_size(maxx, maxy); |
| 293 | 289 | |
| r253556 | r253557 | |
| 296 | 292 | for (int y = 0; y < maxy; y++) |
| 297 | 293 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
| 298 | 294 | |
| 299 | if (update) | |
| 300 | display_update(); | |
| 295 | display_update(); | |
| 301 | 296 | } |
| 302 | 297 | |
| 298 | void hh_tms1k_state::display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask) | |
| 299 | { | |
| 300 | // expects m_display_segmask to be not-0 | |
| 301 | for (int y = 0; y < maxy; y++) | |
| 302 | m_display_segmask[y] &= segmask; | |
| 303 | 303 | |
| 304 | // generic input handlers | |
| 304 | display_matrix(maxx, maxy, setx, sety); | |
| 305 | } | |
| 305 | 306 | |
| 307 | ||
| 306 | 308 | UINT8 hh_tms1k_state::read_inputs(int columns) |
| 307 | 309 | { |
| 308 | 310 | UINT8 ret = 0; |
| r253556 | r253557 | |
| 357 | 359 | /*************************************************************************** |
| 358 | 360 | |
| 359 | 361 | APF Mathemagician |
| 360 | * TMS1100 MCU, labeled MP1030 | |
| 362 | * TMS1100 MCU, labeled MP1030 | |
| 361 | 363 | * 2 x DS8870N - Hex LED Digit Driver |
| 362 | 364 | * 2 x DS8861N - MOS-to-LED 5-Segment Driver |
| 363 | 365 | * 10-digit 7seg LED display(2 custom ones) + 4 LEDs, no sound |
| r253556 | r253557 | |
| 394 | 396 | |
| 395 | 397 | void mathmagi_state::prepare_display() |
| 396 | 398 | { |
| 397 | set_display_segmask(0xff, 0x7f); | |
| 398 | display_matrix(7, 11, m_o, m_r); | |
| 399 | // R0-R7: 7seg leds | |
| 400 | for (int y = 0; y < 8; y++) | |
| 401 | { | |
| 402 | m_display_segmask[y] = 0x7f; | |
| 403 | m_display_state[y] = (m_r >> y & 1) ? (m_o >> 1) : 0; | |
| 404 | } | |
| 405 | ||
| 406 | // R8: custom math symbols digit | |
| 407 | // R9: custom equals digit | |
| 408 | // R10: misc lamps | |
| 409 | for (int y = 8; y < 11; y++) | |
| 410 | m_display_state[y] = (m_r >> y & 1) ? m_o : 0; | |
| 411 | ||
| 412 | set_display_size(8, 11); | |
| 413 | display_update(); | |
| 399 | 414 | } |
| 400 | 415 | |
| 401 | 416 | WRITE16_MEMBER(mathmagi_state::write_r) |
| r253556 | r253557 | |
| 403 | 418 | // R3,R5-R7,R9,R10: input mux |
| 404 | 419 | m_inp_mux = (data >> 3 & 1) | (data >> 4 & 0xe) | (data >> 5 & 0x30); |
| 405 | 420 | |
| 406 | // R0-R7: 7seg leds | |
| 407 | // R8: custom math symbols digit | |
| 408 | // R9: custom equals digit | |
| 409 | // R10: misc lamps | |
| 421 | // +others: | |
| 410 | 422 | m_r = data; |
| 411 | 423 | prepare_display(); |
| 412 | 424 | } |
| 413 | 425 | |
| 414 | 426 | WRITE16_MEMBER(mathmagi_state::write_o) |
| 415 | 427 | { |
| 416 | // O1-O7: | |
| 428 | // O1-O7: digit segments A-G | |
| 417 | 429 | // O0: N/C |
| 430 | data = (data << 1 & 0xfe) | (data >> 7 & 1); // because opla is unknown | |
| 418 | 431 | m_o = data; |
| 419 | prepare_display(); | |
| 420 | 432 | } |
| 421 | 433 | |
| 422 | 434 | READ8_MEMBER(mathmagi_state::read_k) |
| r253556 | r253557 | |
| 476 | 488 | INPUT_PORTS_END |
| 477 | 489 | |
| 478 | 490 | |
| 479 | // output PLA is not d | |
| 491 | // output PLA is not dumped | |
| 480 | 492 | static const UINT16 mathmagi_output_pla[0x20] = |
| 481 | 493 | { |
| 482 | 494 | lA+lB+lC+lD+lE+lF, // 0 |
| r253556 | r253557 | |
| 516 | 528 | static MACHINE_CONFIG_START( mathmagi, mathmagi_state ) |
| 517 | 529 | |
| 518 | 530 | /* basic machine hardware */ |
| 519 | MCFG_CPU_ADD("maincpu", TMS1100, 175000) // | |
| 531 | MCFG_CPU_ADD("maincpu", TMS1100, 175000) // RC osc. R=68K, C=82pf -> ~175kHz | |
| 520 | 532 | MCFG_TMS1XXX_OUTPUT_PLA(mathmagi_output_pla) |
| 521 | 533 | MCFG_TMS1XXX_READ_K_CB(READ8(mathmagi_state, read_k)) |
| 522 | 534 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mathmagi_state, write_r)) |
| r253556 | r253557 | |
| 536 | 548 | |
| 537 | 549 | Coleco Amaze-A-Tron, by Ralph Baer |
| 538 | 550 | * TMS1100 MCU, labeled MP3405(die label too) |
| 539 | * 2-digit 7seg LED display + 2 LEDs(one red, one green), 1 | |
| 551 | * 2-digit 7seg LED display + 2 LEDs(one red, one green), 1bit sound | |
| 540 | 552 | * 5x5 pressure-sensitive playing board |
| 541 | 553 | |
| 542 | 554 | This is an electronic board game with a selection of 8 maze games, |
| r253556 | r253557 | |
| 655 | 667 | static MACHINE_CONFIG_START( amaztron, amaztron_state ) |
| 656 | 668 | |
| 657 | 669 | /* basic machine hardware */ |
| 658 | MCFG_CPU_ADD("maincpu", TMS1100, 350000) // | |
| 670 | MCFG_CPU_ADD("maincpu", TMS1100, 350000) // RC osc. R=33K?, C=100pf -> ~350kHz | |
| 659 | 671 | MCFG_TMS1XXX_READ_K_CB(READ8(amaztron_state, read_k)) |
| 660 | 672 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(amaztron_state, write_r)) |
| 661 | 673 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(amaztron_state, write_o)) |
| r253556 | r253557 | |
| 675 | 687 | |
| 676 | 688 | /*************************************************************************** |
| 677 | 689 | |
| 678 | Coleco Zodiac - The Astrology Computer | |
| 679 | * TMS1100 MP3435 (no decap) | |
| 680 | * 8-digit 7seg display, 12 other LEDs, 1-bit sound | |
| 681 | ||
| 682 | As the name suggests, this is an astrologic calculator. Refer to the | |
| 683 | (very extensive) manual on how to use it. | |
| 684 | ||
| 685 | ***************************************************************************/ | |
| 686 | ||
| 687 | class zodiac_state : public hh_tms1k_state | |
| 688 | { | |
| 689 | public: | |
| 690 | zodiac_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 691 | : hh_tms1k_state(mconfig, type, tag) | |
| 692 | { } | |
| 693 | ||
| 694 | void prepare_display(); | |
| 695 | DECLARE_WRITE16_MEMBER(write_r); | |
| 696 | DECLARE_WRITE16_MEMBER(write_o); | |
| 697 | DECLARE_READ8_MEMBER(read_k); | |
| 698 | }; | |
| 699 | ||
| 700 | // handlers | |
| 701 | ||
| 702 | void zodiac_state::prepare_display() | |
| 703 | { | |
| 704 | set_display_segmask(0xff, 0x7f); | |
| 705 | display_matrix(8, 10, m_o, m_r); | |
| 706 | } | |
| 707 | ||
| 708 | WRITE16_MEMBER(zodiac_state::write_r) | |
| 709 | { | |
| 710 | // R10: speaker out | |
| 711 | m_speaker->level_w(data >> 10 & 1); | |
| 712 | ||
| 713 | // R0-R4,R8: input mux | |
| 714 | m_inp_mux = (data & 0x1f) | (data >> 3 & 0x20); | |
| 715 | ||
| 716 | // R0-R7: digit select | |
| 717 | // R8,R9: led select | |
| 718 | m_r = data & 0x3ff; | |
| 719 | prepare_display(); | |
| 720 | } | |
| 721 | ||
| 722 | WRITE16_MEMBER(zodiac_state::write_o) | |
| 723 | { | |
| 724 | // O0-O7: digit segment/led data | |
| 725 | m_o = data; | |
| 726 | prepare_display(); | |
| 727 | } | |
| 728 | ||
| 729 | READ8_MEMBER(zodiac_state::read_k) | |
| 730 | { | |
| 731 | // K: multiplexed inputs | |
| 732 | return read_inputs(6); | |
| 733 | } | |
| 734 | ||
| 735 | ||
| 736 | // config | |
| 737 | ||
| 738 | static INPUT_PORTS_START( zodiac ) | |
| 739 | PORT_START("IN.0") // R0 | |
| 740 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 741 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 742 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 743 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("0") | |
| 744 | ||
| 745 | PORT_START("IN.1") // R1 | |
| 746 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 747 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 748 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 749 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 750 | ||
| 751 | PORT_START("IN.2") // R2 | |
| 752 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("D") | |
| 753 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("A") | |
| 754 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 755 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 756 | ||
| 757 | PORT_START("IN.3") // R3 | |
| 758 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("P") | |
| 759 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("L") | |
| 760 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("J") | |
| 761 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("E") | |
| 762 | ||
| 763 | PORT_START("IN.4") // R4 | |
| 764 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_ENTER) PORT_CODE(KEYCODE_ENTER_PAD) PORT_NAME("Enter") | |
| 765 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 766 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 767 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") | |
| 768 | ||
| 769 | PORT_START("IN.5") // R8 | |
| 770 | PORT_CONFNAME( 0x03, 0x01, "Mode") | |
| 771 | PORT_CONFSETTING( 0x01, "H" ) // Horoscope | |
| 772 | PORT_CONFSETTING( 0x02, "P" ) // Preview | |
| 773 | PORT_CONFSETTING( 0x00, "A" ) // Answer | |
| 774 | PORT_BIT( 0x0c, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 775 | INPUT_PORTS_END | |
| 776 | ||
| 777 | ||
| 778 | // output PLA is not decapped | |
| 779 | static const UINT16 zodiac_output_pla[0x20] = | |
| 780 | { | |
| 781 | 0x80, // empty/led 1/7 | |
| 782 | lC, // i/led 2/8 | |
| 783 | lE+lG, // r/led 3/9 | |
| 784 | lC+lE+lG, // n | |
| 785 | lF, // seg F/led 4/10 | |
| 786 | 0, // ? | |
| 787 | 0, // ? | |
| 788 | lC+lE+lF+lG, // h | |
| 789 | lB, // seg B/led 5/11 | |
| 790 | lD, // seg D/led 6/12 | |
| 791 | 0, // ? | |
| 792 | 0, // ? | |
| 793 | 0, // ? | |
| 794 | 0, // ? | |
| 795 | lA+lB+lE+lF+lG, // P | |
| 796 | 0, // ? | |
| 797 | lA+lB+lC+lD+lE+lF, // 0 | |
| 798 | lB+lC, // 1 | |
| 799 | lA+lB+lD+lE+lG, // 2 | |
| 800 | lA+lB+lC+lD+lG, // 3 | |
| 801 | lB+lC+lF+lG, // 4 | |
| 802 | lA+lC+lD+lF+lG, // 5 | |
| 803 | lA+lC+lD+lE+lF+lG, // 6 | |
| 804 | lA+lB+lC, // 7 | |
| 805 | lA+lB+lC+lD+lE+lF+lG, // 8 | |
| 806 | lA+lB+lC+lD+lF+lG, // 9 | |
| 807 | lA+lB+lC+lE+lF+lG, // A | |
| 808 | lB+lC+lD+lE+lG, // d | |
| 809 | lA+lD+lE+lF+lG, // E | |
| 810 | lB+lC+lD+lE, // J | |
| 811 | lD+lE+lF, // L | |
| 812 | lB+lC+lD+lE+lF // U | |
| 813 | }; | |
| 814 | ||
| 815 | static MACHINE_CONFIG_START( zodiac, zodiac_state ) | |
| 816 | ||
| 817 | /* basic machine hardware */ | |
| 818 | MCFG_CPU_ADD("maincpu", TMS1100, 500000) // approximation - RC osc. R=18K, C=100pf | |
| 819 | MCFG_TMS1XXX_OUTPUT_PLA(zodiac_output_pla) | |
| 820 | MCFG_TMS1XXX_READ_K_CB(READ8(zodiac_state, read_k)) | |
| 821 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(zodiac_state, write_r)) | |
| 822 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(zodiac_state, write_o)) | |
| 823 | ||
| 824 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) | |
| 825 | MCFG_DEFAULT_LAYOUT(layout_zodiac) | |
| 826 | ||
| 827 | /* sound hardware */ | |
| 828 | MCFG_SPEAKER_STANDARD_MONO("mono") | |
| 829 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) | |
| 830 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) | |
| 831 | MACHINE_CONFIG_END | |
| 832 | ||
| 833 | ||
| 834 | ||
| 835 | ||
| 836 | ||
| 837 | /*************************************************************************** | |
| 838 | ||
| 839 | 690 | Coleco Electronic Quarterback |
| 840 | 691 | * TMS1100NLL MP3415 (die labeled MP3415) |
| 841 | * 9-digit LED grid, 1 | |
| 692 | * 9-digit LED grid, 1bit sound | |
| 842 | 693 | |
| 843 | 694 | known releases: |
| 844 | 695 | - USA(1): Electronic Quarterback |
| r253556 | r253557 | |
| 949 | 800 | |
| 950 | 801 | Coleco Head to Head Football |
| 951 | 802 | * TMS1100NLLE (rev. E!) MP3460 (die labeled MP3460) |
| 952 | * 2*SN75492N LED display drivers, 9-digit LED grid, 1 | |
| 803 | * 2*SN75492N LED display drivers, 9-digit LED grid, 1bit sound | |
| 953 | 804 | |
| 954 | 805 | known releases: |
| 955 | 806 | - USA(1): Head to Head Football |
| r253556 | r253557 | |
| 1041 | 892 | static MACHINE_CONFIG_START( h2hfootb, h2hfootb_state ) |
| 1042 | 893 | |
| 1043 | 894 | /* basic machine hardware */ |
| 1044 | MCFG_CPU_ADD("maincpu", TMS1100, 310000) // approximation - RC osc. R=39K, C=100pf | |
| 895 | MCFG_CPU_ADD("maincpu", TMS1100, 310000) // approximation - RC osc. R=39K, C=100pf, but unknown RC curve | |
| 1045 | 896 | MCFG_TMS1XXX_READ_K_CB(READ8(h2hfootb_state, read_k)) |
| 1046 | 897 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(h2hfootb_state, write_r)) |
| 1047 | 898 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(h2hfootb_state, write_o)) |
| r253556 | r253557 | |
| 1064 | 915 | Coleco Head to Head Baseball |
| 1065 | 916 | * PCB labels Coleco rev C 73891/2 |
| 1066 | 917 | * TMS1170NLN MP1525-N2 (die labeled MP1525) |
| 1067 | * 9-digit cyan VFD display, and other LEDs behind bezel, 1 | |
| 918 | * 9-digit cyan VFD display, and other LEDs behind bezel, 1bit sound | |
| 1068 | 919 | |
| 1069 | 920 | known releases: |
| 1070 | 921 | - USA: Head to Head Baseball |
| r253556 | r253557 | |
| 1203 | 1054 | |
| 1204 | 1055 | Coleco Total Control 4 |
| 1205 | 1056 | * TMS1400NLL MP7334-N2 (die labeled MP7334) |
| 1206 | * 2x2-digit 7seg LED display + 4 LEDs, LED grid display, 1 | |
| 1057 | * 2x2-digit 7seg LED display + 4 LEDs, LED grid display, 1bit sound | |
| 1207 | 1058 | |
| 1208 | 1059 | This is a head to head electronic tabletop LED-display sports console. |
| 1209 | 1060 | One cartridge(Football) was included with the console, the other three were |
| r253556 | r253557 | |
| 1337 | 1188 | static MACHINE_CONFIG_START( tc4, tc4_state ) |
| 1338 | 1189 | |
| 1339 | 1190 | /* basic machine hardware */ |
| 1340 | MCFG_CPU_ADD("maincpu", TMS1400, 450000) // approximation - RC osc. R=27.3K, C=100pf | |
| 1191 | MCFG_CPU_ADD("maincpu", TMS1400, 450000) // approximation - RC osc. R=27.3K, C=100pf, but unknown RC curve | |
| 1341 | 1192 | MCFG_TMS1XXX_READ_K_CB(READ8(tc4_state, read_k)) |
| 1342 | 1193 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tc4_state, write_r)) |
| 1343 | 1194 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tc4_state, write_o)) |
| r253556 | r253557 | |
| 1357 | 1208 | |
| 1358 | 1209 | /*************************************************************************** |
| 1359 | 1210 | |
| 1360 | Conic Electronic Football II | |
| 1361 | * TMS1100 MP1181 (no decap) | |
| 1362 | * 9-digit LED grid, 1-bit sound | |
| 1363 | ||
| 1364 | This is a clone of Coleco's Quarterback, similar at hardware-level too. | |
| 1365 | It was also sold by Tandy under the same title. | |
| 1366 | ||
| 1367 | ***************************************************************************/ | |
| 1368 | ||
| 1369 | class cnfball2_state : public hh_tms1k_state | |
| 1370 | { | |
| 1371 | public: | |
| 1372 | cnfball2_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 1373 | : hh_tms1k_state(mconfig, type, tag) | |
| 1374 | { } | |
| 1375 | ||
| 1376 | void prepare_display(); | |
| 1377 | DECLARE_WRITE16_MEMBER(write_r); | |
| 1378 | DECLARE_WRITE16_MEMBER(write_o); | |
| 1379 | DECLARE_READ8_MEMBER(read_k); | |
| 1380 | }; | |
| 1381 | ||
| 1382 | // handlers | |
| 1383 | ||
| 1384 | void cnfball2_state::prepare_display() | |
| 1385 | { | |
| 1386 | // R1 selects between segments B/C or A'/D' | |
| 1387 | UINT16 seg = m_o; | |
| 1388 | if (~m_r & 2) | |
| 1389 | seg = (m_o << 7 & 0x300) | (m_o & 0xf9); | |
| 1390 | ||
| 1391 | set_display_segmask(0x1ff, 0xff); | |
| 1392 | display_matrix(11, 9, seg, m_r >> 1 & 0x1ff); | |
| 1393 | } | |
| 1394 | ||
| 1395 | WRITE16_MEMBER(cnfball2_state::write_r) | |
| 1396 | { | |
| 1397 | // R0: speaker out | |
| 1398 | m_speaker->level_w(data & 1); | |
| 1399 | ||
| 1400 | // R8-R10: input mux | |
| 1401 | m_inp_mux = data >> 8 & 7; | |
| 1402 | ||
| 1403 | // R1-R10: select digit/segment | |
| 1404 | m_r = data; | |
| 1405 | prepare_display(); | |
| 1406 | } | |
| 1407 | ||
| 1408 | WRITE16_MEMBER(cnfball2_state::write_o) | |
| 1409 | { | |
| 1410 | // O0-O7: digit segments | |
| 1411 | m_o = data; | |
| 1412 | prepare_display(); | |
| 1413 | } | |
| 1414 | ||
| 1415 | READ8_MEMBER(cnfball2_state::read_k) | |
| 1416 | { | |
| 1417 | // K: multiplexed inputs | |
| 1418 | return read_inputs(3); | |
| 1419 | } | |
| 1420 | ||
| 1421 | ||
| 1422 | // config | |
| 1423 | ||
| 1424 | static INPUT_PORTS_START( cnfball2 ) | |
| 1425 | PORT_START("IN.0") // R8 | |
| 1426 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 1427 | PORT_CONFNAME( 0x02, 0x00, "Factory Test" ) | |
| 1428 | PORT_CONFSETTING( 0x00, DEF_STR( Off ) ) | |
| 1429 | PORT_CONFSETTING( 0x02, DEF_STR( On ) ) | |
| 1430 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SELECT ) PORT_TOGGLE PORT_NAME("Play Selector") // pass/run | |
| 1431 | PORT_CONFNAME( 0x08, 0x00, "Skill Level" ) | |
| 1432 | PORT_CONFSETTING( 0x00, "1" ) // college | |
| 1433 | PORT_CONFSETTING( 0x08, "2" ) // professional | |
| 1434 | ||
| 1435 | PORT_START("IN.1") // R9 | |
| 1436 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN ) PORT_16WAY | |
| 1437 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP ) PORT_16WAY | |
| 1438 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_16WAY | |
| 1439 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_16WAY | |
| 1440 | ||
| 1441 | PORT_START("IN.2") // R10 | |
| 1442 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Kick/Pass") | |
| 1443 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) PORT_NAME("Score") | |
| 1444 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Status") | |
| 1445 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) | |
| 1446 | INPUT_PORTS_END | |
| 1447 | ||
| 1448 | ||
| 1449 | // output PLA is not decapped | |
| 1450 | static const UINT16 cnfball2_output_pla[0x20] = | |
| 1451 | { | |
| 1452 | // first half was dumped electronically | |
| 1453 | 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x40, 0x01, 0x08, 0x02, 0x04, 0x00, | |
| 1454 | ||
| 1455 | // rest is unknown | |
| 1456 | 0, 0, 0, 0, 0, 0, 0, 0, | |
| 1457 | 0, 0, 0, 0, 0, 0, 0, 0 | |
| 1458 | }; | |
| 1459 | ||
| 1460 | static MACHINE_CONFIG_START( cnfball2, cnfball2_state ) | |
| 1461 | ||
| 1462 | /* basic machine hardware */ | |
| 1463 | MCFG_CPU_ADD("maincpu", TMS1100, 375000) // approximation - RC osc. R=47K, C=47pf | |
| 1464 | MCFG_TMS1XXX_OUTPUT_PLA(cnfball2_output_pla) | |
| 1465 | MCFG_TMS1XXX_READ_K_CB(READ8(cnfball2_state, read_k)) | |
| 1466 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(cnfball2_state, write_r)) | |
| 1467 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(cnfball2_state, write_o)) | |
| 1468 | ||
| 1469 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) | |
| 1470 | MCFG_DEFAULT_LAYOUT(layout_cnfball2) | |
| 1471 | ||
| 1472 | /* sound hardware */ | |
| 1473 | MCFG_SPEAKER_STANDARD_MONO("mono") | |
| 1474 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) | |
| 1475 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) | |
| 1476 | MACHINE_CONFIG_END | |
| 1477 | ||
| 1478 | ||
| 1479 | ||
| 1480 | ||
| 1481 | ||
| 1482 | /*************************************************************************** | |
| 1483 | ||
| 1484 | 1211 | Entex (Electronic) Baseball (1) |
| 1485 | 1212 | * TMS1000NLP MP0914 (die labeled MP0914A) |
| 1486 | * 1 7seg LED, and other LEDs behind bezel, 1 | |
| 1213 | * 1 7seg LED, and other LEDs behind bezel, 1bit sound | |
| 1487 | 1214 | |
| 1488 | 1215 | This is a handheld LED baseball game. One player controls the batter, the CPU |
| 1489 | 1216 | or other player controls the pitcher. Pitcher throw buttons are on a 'joypad' |
| r253556 | r253557 | |
| 1596 | 1323 | static MACHINE_CONFIG_START( ebball, ebball_state ) |
| 1597 | 1324 | |
| 1598 | 1325 | /* basic machine hardware */ |
| 1599 | MCFG_CPU_ADD("maincpu", TMS1000, 375000) // | |
| 1326 | MCFG_CPU_ADD("maincpu", TMS1000, 375000) // RC osc. R=43K, C=47pf -> ~375kHz | |
| 1600 | 1327 | MCFG_TMS1XXX_READ_K_CB(READ8(ebball_state, read_k)) |
| 1601 | 1328 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ebball_state, write_r)) |
| 1602 | 1329 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebball_state, write_o)) |
| r253556 | r253557 | |
| 1619 | 1346 | Entex (Electronic) Baseball 2 |
| 1620 | 1347 | * PCBs are labeled: ZENY |
| 1621 | 1348 | * TMS1000 MCU, MP0923 (die labeled MP0923) |
| 1622 | * 3 7seg LEDs, and other LEDs behind bezel, 1 | |
| 1349 | * 3 7seg LEDs, and other LEDs behind bezel, 1bit sound | |
| 1623 | 1350 | |
| 1624 | 1351 | The Japanese version was published by Gakken, black casing instead of white. |
| 1625 | 1352 | |
| r253556 | r253557 | |
| 1721 | 1448 | static MACHINE_CONFIG_START( ebball2, ebball2_state ) |
| 1722 | 1449 | |
| 1723 | 1450 | /* basic machine hardware */ |
| 1724 | MCFG_CPU_ADD("maincpu", TMS1000, 350000) // | |
| 1451 | MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=47K, C=47pf -> ~350kHz | |
| 1725 | 1452 | MCFG_TMS1XXX_READ_K_CB(READ8(ebball2_state, read_k)) |
| 1726 | 1453 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ebball2_state, write_r)) |
| 1727 | 1454 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebball2_state, write_o)) |
| r253556 | r253557 | |
| 1745 | 1472 | * PCBs are labeled: ZENY |
| 1746 | 1473 | * TMS1100NLL 6007 MP1204 (rev. E!) (die labeled MP1204) |
| 1747 | 1474 | * 2*SN75492N LED display driver |
| 1748 | * 4 7seg LEDs, and other LEDs behind bezel, 1 | |
| 1475 | * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound | |
| 1749 | 1476 | |
| 1750 | 1477 | This is another improvement over Entex Baseball, where gameplay is a bit more |
| 1751 | 1478 | varied. Like the others, the pitcher controls are on a separate joypad. |
| r253556 | r253557 | |
| 1924 | 1651 | |
| 1925 | 1652 | Entex Space Invader |
| 1926 | 1653 | * TMS1100 MP1211 (die labeled MP1211) |
| 1927 | * 3 7seg LEDs, LED matrix and overlay mask, 1 | |
| 1654 | * 3 7seg LEDs, LED matrix and overlay mask, 1bit sound | |
| 1928 | 1655 | |
| 1929 | 1656 | There are two versions of this game: the first release(this one) is on |
| 1930 | 1657 | TMS1100, the second more widespread release runs on a COP400. There are |
| r253556 | r253557 | |
| 2038 | 1765 | |
| 2039 | 1766 | Entex Color Football 4 |
| 2040 | 1767 | * TMS1670 6009 MP7551 (die also labeled MP7551) |
| 2041 | * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1 | |
| 1768 | * 9-digit cyan VFD display, 60 red and green LEDs behind bezel, 1bit sound | |
| 2042 | 1769 | |
| 2043 | 1770 | ***************************************************************************/ |
| 2044 | 1771 | |
| r253556 | r253557 | |
| 2133 | 1860 | static MACHINE_CONFIG_START( efootb4, efootb4_state ) |
| 2134 | 1861 | |
| 2135 | 1862 | /* basic machine hardware */ |
| 2136 | MCFG_CPU_ADD("maincpu", TMS1670, 475000) // approximation - RC osc. R=42K, C=47pf | |
| 1863 | MCFG_CPU_ADD("maincpu", TMS1670, 475000) // approximation - RC osc. R=42K, C=47pf, but unknown RC curve | |
| 2137 | 1864 | MCFG_TMS1XXX_READ_K_CB(READ8(efootb4_state, read_k)) |
| 2138 | 1865 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(efootb4_state, write_r)) |
| 2139 | 1866 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(efootb4_state, write_o)) |
| r253556 | r253557 | |
| 2155 | 1882 | |
| 2156 | 1883 | Entex (Electronic) Basketball 2 |
| 2157 | 1884 | * TMS1100 6010 MP1218 (die also labeled MP1218) |
| 2158 | * 4 7seg LEDs, and other LEDs behind bezel, 1 | |
| 1885 | * 4 7seg LEDs, and other LEDs behind bezel, 1bit sound | |
| 2159 | 1886 | |
| 2160 | 1887 | lamp translation table: led zz from game PCB = MAME lampyx: |
| 2161 | 1888 | |
| r253556 | r253557 | |
| 2256 | 1983 | static MACHINE_CONFIG_START( ebaskb2, ebaskb2_state ) |
| 2257 | 1984 | |
| 2258 | 1985 | /* basic machine hardware */ |
| 2259 | MCFG_CPU_ADD("maincpu", TMS1100, 360000) // | |
| 1986 | MCFG_CPU_ADD("maincpu", TMS1100, 360000) // RC osc. R=33K, C=82pf -> ~360kHz | |
| 2260 | 1987 | MCFG_TMS1XXX_READ_K_CB(READ8(ebaskb2_state, read_k)) |
| 2261 | 1988 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ebaskb2_state, write_r)) |
| 2262 | 1989 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ebaskb2_state, write_o)) |
| r253556 | r253557 | |
| 2278 | 2005 | |
| 2279 | 2006 | Entex Raise The Devil |
| 2280 | 2007 | * TMS1100 MP1221 (die labeled MP1221) |
| 2281 | * 4 7seg LEDs(rightmost one unused), and other LEDs behind bezel, 1 | |
| 2008 | * 4 7seg LEDs(rightmost one unused), and other LEDs behind bezel, 1bit sound | |
| 2282 | 2009 | |
| 2283 | 2010 | lamp translation table: led zz from game PCB = MAME lampyx: |
| 2284 | 2011 | |
| r253556 | r253557 | |
| 2452 | 2179 | |
| 2453 | 2180 | void gpoker_state::prepare_display() |
| 2454 | 2181 | { |
| 2455 | set_display_segmask(0x7ff, 0x7f); | |
| 2456 | display_matrix(12, 11, m_o | (m_r >> 3 & 0xf00), m_r & 0x7ff); | |
| 2182 | memset(m_display_segmask, ~0, sizeof(m_display_segmask)); | |
| 2183 | display_matrix_seg(12, 11, m_o | (m_r >> 3 & 0xf00), m_r & 0x7ff, 0x7f); | |
| 2457 | 2184 | } |
| 2458 | 2185 | |
| 2459 | 2186 | WRITE16_MEMBER(gpoker_state::write_r) |
| r253556 | r253557 | |
| 2543 | 2270 | static MACHINE_CONFIG_START( gpoker, gpoker_state ) |
| 2544 | 2271 | |
| 2545 | 2272 | /* basic machine hardware */ |
| 2546 | MCFG_CPU_ADD("maincpu", TMS1370, 350000) // | |
| 2273 | MCFG_CPU_ADD("maincpu", TMS1370, 350000) // RC osc. R=47K, C=47pf -> ~350kHz | |
| 2547 | 2274 | MCFG_TMS1XXX_READ_K_CB(READ8(gpoker_state, read_k)) |
| 2548 | 2275 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(gpoker_state, write_r)) |
| 2549 | 2276 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(gpoker_state, write_o)) |
| r253556 | r253557 | |
| 2656 | 2383 | static MACHINE_CONFIG_START( gjackpot, gjackpot_state ) |
| 2657 | 2384 | |
| 2658 | 2385 | /* basic machine hardware */ |
| 2659 | MCFG_CPU_ADD("maincpu", TMS1670, 450000) // approximation - RC osc. R=47K, C=47pf | |
| 2386 | MCFG_CPU_ADD("maincpu", TMS1670, 450000) // approximation - RC osc. R=47K, C=47pf, but unknown RC curve | |
| 2660 | 2387 | MCFG_TMS1XXX_READ_K_CB(READ8(gpoker_state, read_k)) |
| 2661 | 2388 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(gjackpot_state, write_r)) |
| 2662 | 2389 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(gpoker_state, write_o)) |
| r253556 | r253557 | |
| 2678 | 2405 | |
| 2679 | 2406 | Ideal Electronic Detective |
| 2680 | 2407 | * TMS0980NLL MP6100A (die labeled 0980B-00) |
| 2681 | * 10-digit 7seg LED display, | |
| 2408 | * 10-digit 7seg LED display, 1bit sound | |
| 2682 | 2409 | |
| 2683 | hardware (and concept) is very similar to Parker Bro | |
| 2410 | hardware (and concept) is very similar to Parker Bros Stop Thief | |
| 2684 | 2411 | |
| 2685 | 2412 | This is an electronic board game. It requires game cards with suspect info, |
| 2686 | 2413 | and good old pen and paper to record game progress. To start the game, enter |
| r253556 | r253557 | |
| 2705 | 2432 | |
| 2706 | 2433 | WRITE16_MEMBER(elecdet_state::write_r) |
| 2707 | 2434 | { |
| 2708 | // R7,R8: speaker out | |
| 2709 | m_speaker->level_w((m_o & 0x80) ? (data >> 7 & 3) : 0); | |
| 2435 | // R7,R8: speaker on | |
| 2436 | m_speaker->level_w((data & 0x180 && m_o & 0x80) ? 1 : 0); | |
| 2710 | 2437 | |
| 2711 | 2438 | // R0-R6: select digit |
| 2712 | set_display_segmask(0x7f, 0x7f); | |
| 2713 | display_matrix(7, 7, BITSWAP8(m_o,7,5,2,1,4,0,6,3), data); | |
| 2439 | memset(m_display_segmask, ~0, sizeof(m_display_segmask)); | |
| 2440 | display_matrix_seg(7, 7, BITSWAP8(m_o,7,5,2,1,4,0,6,3), data, 0x7f); | |
| 2714 | 2441 | } |
| 2715 | 2442 | |
| 2716 | 2443 | WRITE16_MEMBER(elecdet_state::write_o) |
| r253556 | r253557 | |
| 2719 | 2446 | m_inp_mux = (data & 3) | (data >> 2 & 4) | (data >> 3 & 8); |
| 2720 | 2447 | |
| 2721 | 2448 | // O0-O6: digit segments A-G |
| 2722 | // O7: speaker o | |
| 2449 | // O7: speaker out -> write_r | |
| 2723 | 2450 | m_o = data; |
| 2724 | 2451 | } |
| 2725 | 2452 | |
| r253556 | r253557 | |
| 2779 | 2506 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false) |
| 2780 | 2507 | INPUT_PORTS_END |
| 2781 | 2508 | |
| 2782 | ||
| 2783 | static const INT16 elecdet_speaker_levels[4] = { 0, 0x3fff, 0x3fff, 0x7fff }; | |
| 2784 | ||
| 2785 | 2509 | static MACHINE_CONFIG_START( elecdet, elecdet_state ) |
| 2786 | 2510 | |
| 2787 | 2511 | /* basic machine hardware */ |
| r253556 | r253557 | |
| 2797 | 2521 | /* sound hardware */ |
| 2798 | 2522 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 2799 | 2523 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 2800 | MCFG_SPEAKER_LEVELS(4, elecdet_speaker_levels) | |
| 2801 | 2524 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 2802 | 2525 | MACHINE_CONFIG_END |
| 2803 | 2526 | |
| r253556 | r253557 | |
| 2809 | 2532 | |
| 2810 | 2533 | Kenner Star Wars - Electronic Battle Command |
| 2811 | 2534 | * TMS1100 MCU, labeled MP3438A |
| 2812 | * 4x4 LED grid display + 2 separate LEDs and 2-digit 7segs, 1 | |
| 2535 | * 4x4 LED grid display + 2 separate LEDs and 2-digit 7segs, 1bit sound | |
| 2813 | 2536 | |
| 2814 | 2537 | This is a small tabletop space-dogfighting game. To start the game, |
| 2815 | 2538 | press BASIC/INTER/ADV and enter P#(number of players), then |
| r253556 | r253557 | |
| 2913 | 2636 | static MACHINE_CONFIG_START( starwbc, starwbc_state ) |
| 2914 | 2637 | |
| 2915 | 2638 | /* basic machine hardware */ |
| 2916 | MCFG_CPU_ADD("maincpu", TMS1100, 325000) // | |
| 2639 | MCFG_CPU_ADD("maincpu", TMS1100, 325000) // RC osc. R=51K, C=47pf -> ~325kHz | |
| 2917 | 2640 | MCFG_TMS1XXX_READ_K_CB(READ8(starwbc_state, read_k)) |
| 2918 | 2641 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(starwbc_state, write_r)) |
| 2919 | 2642 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(starwbc_state, write_o)) |
| r253556 | r253557 | |
| 2959 | 2682 | |
| 2960 | 2683 | void astro_state::prepare_display() |
| 2961 | 2684 | { |
| 2962 | set_display_segmask(0x3ff, 0xff); | |
| 2963 | display_matrix(8, 10, m_o, m_r); | |
| 2685 | memset(m_display_segmask, ~0, sizeof(m_display_segmask)); | |
| 2686 | display_matrix_seg(8, 10, m_o, m_r, 0xff); | |
| 2964 | 2687 | } |
| 2965 | 2688 | |
| 2966 | 2689 | WRITE16_MEMBER(astro_state::write_r) |
| r253556 | r253557 | |
| 3040 | 2763 | static MACHINE_CONFIG_START( astro, astro_state ) |
| 3041 | 2764 | |
| 3042 | 2765 | /* basic machine hardware */ |
| 3043 | MCFG_CPU_ADD("maincpu", TMS1470, 450000) // approximation - RC osc. R=4.7K, C=33pf | |
| 2766 | MCFG_CPU_ADD("maincpu", TMS1470, 450000) // approximation - RC osc. R=4.7K, C=33pf, but unknown RC curve | |
| 3044 | 2767 | MCFG_TMS1XXX_READ_K_CB(READ8(astro_state, read_k)) |
| 3045 | 2768 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(astro_state, write_r)) |
| 3046 | 2769 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(astro_state, write_o)) |
| r253556 | r253557 | |
| 3059 | 2782 | |
| 3060 | 2783 | Mattel Dungeons & Dragons - Computer Labyrinth Game |
| 3061 | 2784 | * TMS1100 M34012-N2LL (die labeled M34012) |
| 3062 | * 72 buttons, no LEDs, 1 | |
| 2785 | * 72 buttons, no LEDs, 1bit sound | |
| 3063 | 2786 | |
| 3064 | 2787 | This is an electronic board game. It requires markers and wall pieces to play. |
| 3065 | 2788 | Refer to the official manual for more information. |
| r253556 | r253557 | |
| 3228 | 2951 | static MACHINE_CONFIG_START( mdndclab, mdndclab_state ) |
| 3229 | 2952 | |
| 3230 | 2953 | /* basic machine hardware */ |
| 3231 | MCFG_CPU_ADD("maincpu", TMS1100, 500000) // approximation - RC osc. R=27K, C=100pf | |
| 2954 | MCFG_CPU_ADD("maincpu", TMS1100, 500000) // approximation - RC osc. R=27K, C=100pf, but unknown RC curve | |
| 3232 | 2955 | MCFG_TMS1XXX_READ_K_CB(READ8(mdndclab_state, read_k)) |
| 3233 | 2956 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mdndclab_state, write_r)) |
| 3234 | 2957 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mdndclab_state, write_o)) |
| r253556 | r253557 | |
| 3353 | 3076 | |
| 3354 | 3077 | Revision A hardware: |
| 3355 | 3078 | * TMS1000 (die labeled MP3226) |
| 3356 | * DS75494 Hex digit LED driver, 4 big lamps, 1 | |
| 3079 | * DS75494 Hex digit LED driver, 4 big lamps, 1bit sound | |
| 3357 | 3080 | |
| 3358 | 3081 | Newer revisions (also Pocket Simon) have a smaller 16-pin MB4850 chip |
| 3359 | 3082 | instead of the TMS1000. This one has been decapped too, but we couldn't |
| r253556 | r253557 | |
| 3433 | 3156 | static MACHINE_CONFIG_START( simon, simon_state ) |
| 3434 | 3157 | |
| 3435 | 3158 | /* basic machine hardware */ |
| 3436 | MCFG_CPU_ADD("maincpu", TMS1000, 350000) // | |
| 3159 | MCFG_CPU_ADD("maincpu", TMS1000, 350000) // RC osc. R=33K, C=100pf -> ~350kHz | |
| 3437 | 3160 | MCFG_TMS1XXX_READ_K_CB(READ8(simon_state, read_k)) |
| 3438 | 3161 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(simon_state, write_r)) |
| 3439 | 3162 | |
| r253556 | r253557 | |
| 3454 | 3177 | |
| 3455 | 3178 | Milton Bradley Super Simon |
| 3456 | 3179 | * TMS1100 MP3476NLL (die labeled MP3476) |
| 3457 | * 8 big lamps(2 turn on at same time), 1 | |
| 3180 | * 8 big lamps(2 turn on at same time), 1bit sound | |
| 3458 | 3181 | |
| 3459 | 3182 | The semi-squel to Simon, not as popular. It includes more game variations |
| 3460 | 3183 | and a 2-player head-to-head mode. |
| r253556 | r253557 | |
| 3751 | 3474 | save_item(NAME(m_gearbox_pos)); |
| 3752 | 3475 | } |
| 3753 | 3476 | |
| 3754 | static const INT16 bigtrak_speaker_levels[ | |
| 3477 | static const INT16 bigtrak_speaker_levels[] = { 0, 32767/3, 32767/3, 32767/3*2, 32767/3, 32767/3*2, 32767/3*2, 32767 }; | |
| 3755 | 3478 | |
| 3756 | 3479 | static MACHINE_CONFIG_START( bigtrak, bigtrak_state ) |
| 3757 | 3480 | |
| 3758 | 3481 | /* basic machine hardware */ |
| 3759 | MCFG_CPU_ADD("maincpu", TMS1000, 200000) // approximation - RC osc. R=83K, C=100pf | |
| 3482 | MCFG_CPU_ADD("maincpu", TMS1000, 200000) // approximation - RC osc. R=83K, C=100pf, but unknown RC curve | |
| 3760 | 3483 | MCFG_TMS1XXX_READ_K_CB(READ8(bigtrak_state, read_k)) |
| 3761 | 3484 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(bigtrak_state, write_r)) |
| 3762 | 3485 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(bigtrak_state, write_o)) |
| r253556 | r253557 | |
| 3804 | 3527 | |
| 3805 | 3528 | WRITE16_MEMBER(cnsector_state::write_r) |
| 3806 | 3529 | { |
| 3807 | // R0-R5: select digit | |
| 3808 | // R6-R9: direction leds | |
| 3809 | set_display_segmask(0x3f, 0xff); | |
| 3810 | display_matrix(8, 10, m_o, data); | |
| 3530 | // R0-R5: select digit (right-to-left) | |
| 3531 | for (int y = 0; y < 6; y++) | |
| 3532 | { | |
| 3533 | m_display_segmask[y] = 0xff; | |
| 3534 | m_display_state[y] = (data >> y & 1) ? m_o : 0; | |
| 3535 | } | |
| 3536 | ||
| 3537 | // R6-R9: direction leds (-> lamp60-63) | |
| 3538 | m_display_state[6] = data >> 6 & 0xf; | |
| 3539 | ||
| 3540 | set_display_size(8, 7); | |
| 3541 | display_update(); | |
| 3811 | 3542 | } |
| 3812 | 3543 | |
| 3813 | 3544 | WRITE16_MEMBER(cnsector_state::write_o) |
| r253556 | r253557 | |
| 3893 | 3624 | |
| 3894 | 3625 | /*************************************************************************** |
| 3895 | 3626 | |
| 3896 | Parker Bro | |
| 3627 | Parker Bros Merlin handheld game, by Bob Doyle | |
| 3897 | 3628 | * TMS1100NLL MP3404A-N2 |
| 3898 | 3629 | * 11 LEDs behind buttons, 3-level sound |
| 3899 | 3630 | |
| r253556 | r253557 | |
| 3986 | 3717 | INPUT_PORTS_END |
| 3987 | 3718 | |
| 3988 | 3719 | |
| 3989 | static const INT16 merlin_speaker_levels[ | |
| 3720 | static const INT16 merlin_speaker_levels[] = { 0, 32767/3, 32767/3, 32767/3*2, 32767/3, 32767/3*2, 32767/3*2, 32767 }; | |
| 3990 | 3721 | |
| 3991 | 3722 | static MACHINE_CONFIG_START( merlin, merlin_state ) |
| 3992 | 3723 | |
| 3993 | 3724 | /* basic machine hardware */ |
| 3994 | MCFG_CPU_ADD("maincpu", TMS1100, 350000) // | |
| 3725 | MCFG_CPU_ADD("maincpu", TMS1100, 350000) // RC osc. R=33K, C=100pf -> ~350kHz | |
| 3995 | 3726 | MCFG_TMS1XXX_READ_K_CB(READ8(merlin_state, read_k)) |
| 3996 | 3727 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(merlin_state, write_r)) |
| 3997 | 3728 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(merlin_state, write_o)) |
| r253556 | r253557 | |
| 4055 | 3786 | static MACHINE_CONFIG_START( mmerlin, mmerlin_state ) |
| 4056 | 3787 | |
| 4057 | 3788 | /* basic machine hardware */ |
| 4058 | MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=30K, C=100pf | |
| 3789 | MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=30K, C=100pf, but unknown RC curve | |
| 4059 | 3790 | MCFG_TMS1XXX_READ_K_CB(READ8(mmerlin_state, read_k)) |
| 4060 | 3791 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mmerlin_state, write_r)) |
| 4061 | 3792 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mmerlin_state, write_o)) |
| r253556 | r253557 | |
| 4078 | 3809 | |
| 4079 | 3810 | Parker Brothers Stop Thief, by Bob Doyle |
| 4080 | 3811 | * TMS0980NLL MP6101B (die labeled 0980B-01A) |
| 4081 | * 3-digit 7seg LED display, | |
| 3812 | * 3-digit 7seg LED display, 1bit sound | |
| 4082 | 3813 | |
| 4083 | 3814 | Stop Thief is actually a board game, the electronic device emulated here |
| 4084 | 3815 | (called Electronic Crime Scanner) is an accessory. To start a game, press |
| r253556 | r253557 | |
| 4103 | 3834 | WRITE16_MEMBER(stopthief_state::write_r) |
| 4104 | 3835 | { |
| 4105 | 3836 | // R0-R2: select digit |
| 4106 | set_display_segmask(7, 0x7f); | |
| 4107 | display_matrix(7, 3, BITSWAP8(m_o,3,5,2,1,4,0,6,7) & 0x7f, data & 7); | |
| 3837 | UINT8 o = BITSWAP8(m_o,3,5,2,1,4,0,6,7) & 0x7f; | |
| 3838 | for (int y = 0; y < 3; y++) | |
| 3839 | { | |
| 3840 | m_display_segmask[y] = 0x7f; | |
| 3841 | m_display_state[y] = (data >> y & 1) ? o : 0; | |
| 3842 | } | |
| 4108 | 3843 | |
| 4109 | // R3-R8(tied together): speaker out | |
| 4110 | int level = 0; | |
| 4111 | for (int i = 0; m_o & 8 && i < 6; i++) | |
| 4112 | level += (data >> (i+3) & 1); | |
| 4113 | m_speaker->level_w(level); | |
| 3844 | set_display_size(7, 3); | |
| 3845 | display_update(); | |
| 3846 | ||
| 3847 | // R3-R8: speaker on | |
| 3848 | m_speaker->level_w((data & 0x1f8 && m_o & 8) ? 1 : 0); | |
| 4114 | 3849 | } |
| 4115 | 3850 | |
| 4116 | 3851 | WRITE16_MEMBER(stopthief_state::write_o) |
| r253556 | r253557 | |
| 4118 | 3853 | // O0,O6: input mux |
| 4119 | 3854 | m_inp_mux = (data & 1) | (data >> 5 & 2); |
| 4120 | 3855 | |
| 4121 | // O3: speaker o | |
| 3856 | // O3: speaker out | |
| 4122 | 3857 | // O0-O2,O4-O7: led segments A-G |
| 4123 | 3858 | m_o = data; |
| 4124 | 3859 | } |
| r253556 | r253557 | |
| 4165 | 3900 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_CODE(KEYCODE_PGDN) PORT_NAME("Off") PORT_CHANGED_MEMBER(DEVICE_SELF, hh_tms1k_state, power_button, (void *)false) |
| 4166 | 3901 | INPUT_PORTS_END |
| 4167 | 3902 | |
| 4168 | ||
| 4169 | static const INT16 stopthief_speaker_levels[7] = { 0, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff }; | |
| 4170 | ||
| 4171 | 3903 | static MACHINE_CONFIG_START( stopthief, stopthief_state ) |
| 4172 | 3904 | |
| 4173 | 3905 | /* basic machine hardware */ |
| r253556 | r253557 | |
| 4183 | 3915 | /* sound hardware */ |
| 4184 | 3916 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 4185 | 3917 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) |
| 4186 | MCFG_SPEAKER_LEVELS(7, stopthief_speaker_levels) | |
| 4187 | 3918 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 4188 | 3919 | MACHINE_CONFIG_END |
| 4189 | 3920 | |
| r253556 | r253557 | |
| 4195 | 3926 | |
| 4196 | 3927 | Parker Brothers Bank Shot (known as Cue Ball in the UK), by Garry Kitchen |
| 4197 | 3928 | * TMS1400NLL MP7313-N2 (die labeled MP7313) |
| 4198 | * LED grid display, 1 | |
| 3929 | * LED grid display, 1bit sound | |
| 4199 | 3930 | |
| 4200 | 3931 | Bank Shot is an electronic pool game. To select a game, repeatedly press |
| 4201 | 3932 | the [SELECT] button, then press [CUE UP] to start. Refer to the official |
| r253556 | r253557 | |
| 4280 | 4011 | static MACHINE_CONFIG_START( bankshot, bankshot_state ) |
| 4281 | 4012 | |
| 4282 | 4013 | /* basic machine hardware */ |
| 4283 | MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf | |
| 4014 | MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf, but unknown RC curve | |
| 4284 | 4015 | MCFG_TMS1XXX_READ_K_CB(READ8(bankshot_state, read_k)) |
| 4285 | 4016 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(bankshot_state, write_r)) |
| 4286 | 4017 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(bankshot_state, write_o)) |
| r253556 | r253557 | |
| 4302 | 4033 | |
| 4303 | 4034 | Parker Brothers Split Second |
| 4304 | 4035 | * TMS1400NLL MP7314-N2 (die labeled MP7314) |
| 4305 | * LED grid display(default round LEDs, and rectangular shape ones), 1 | |
| 4036 | * LED grid display(default round LEDs, and rectangular shape ones), 1bit sound | |
| 4306 | 4037 | |
| 4307 | 4038 | This is an electronic handheld reflex gaming device, it's straightforward |
| 4308 | 4039 | to use. The included mini-games are: |
| r253556 | r253557 | |
| 4391 | 4122 | static MACHINE_CONFIG_START( splitsec, splitsec_state ) |
| 4392 | 4123 | |
| 4393 | 4124 | /* basic machine hardware */ |
| 4394 | MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf | |
| 4125 | MCFG_CPU_ADD("maincpu", TMS1400, 475000) // approximation - RC osc. R=24K, C=100pf, but unknown RC curve | |
| 4395 | 4126 | MCFG_TMS1XXX_READ_K_CB(READ8(splitsec_state, read_k)) |
| 4396 | 4127 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(splitsec_state, write_r)) |
| 4397 | 4128 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(splitsec_state, write_o)) |
| r253556 | r253557 | |
| 4411 | 4142 | |
| 4412 | 4143 | /*************************************************************************** |
| 4413 | 4144 | |
| 4414 | Parker Brothers Lost Treasure - The Electronic Deep-Sea Diving Game, | |
| 4415 | Featuring The Electronic Dive-Control Center | |
| 4416 | * TMS1100 M34038-NLL (die labeled 1100E, M34038) | |
| 4417 | * 11 LEDs, 4-bit sound | |
| 4418 | ||
| 4419 | This is a board game. The electronic accessory is the emulated part here. | |
| 4420 | ||
| 4421 | ***************************************************************************/ | |
| 4422 | ||
| 4423 | class lostreas_state : public hh_tms1k_state | |
| 4424 | { | |
| 4425 | public: | |
| 4426 | lostreas_state(const machine_config &mconfig, device_type type, const char *tag) | |
| 4427 | : hh_tms1k_state(mconfig, type, tag) | |
| 4428 | { } | |
| 4429 | ||
| 4430 | DECLARE_WRITE16_MEMBER(write_r); | |
| 4431 | DECLARE_WRITE16_MEMBER(write_o); | |
| 4432 | DECLARE_READ8_MEMBER(read_k); | |
| 4433 | }; | |
| 4434 | ||
| 4435 | // handlers | |
| 4436 | ||
| 4437 | WRITE16_MEMBER(lostreas_state::write_r) | |
| 4438 | { | |
| 4439 | // R0-R10: leds | |
| 4440 | display_matrix(11, 1, data, 1); | |
| 4441 | } | |
| 4442 | ||
| 4443 | WRITE16_MEMBER(lostreas_state::write_o) | |
| 4444 | { | |
| 4445 | // O0-O3: input mux | |
| 4446 | m_inp_mux = data & 0xf; | |
| 4447 | ||
| 4448 | // O4: 330 ohm resistor - speaker out | |
| 4449 | // O5: 220 ohm resistor - speaker out | |
| 4450 | // O6: 180 ohm resistor - speaker out | |
| 4451 | // O7: 68 ohm resistor - speaker out | |
| 4452 | m_speaker->level_w(data >> 4 & 0xf); | |
| 4453 | } | |
| 4454 | ||
| 4455 | READ8_MEMBER(lostreas_state::read_k) | |
| 4456 | { | |
| 4457 | // K: multiplexed inputs | |
| 4458 | return read_inputs(4); | |
| 4459 | } | |
| 4460 | ||
| 4461 | ||
| 4462 | // config | |
| 4463 | ||
| 4464 | /* physical button layout and labels is like this: | |
| 4465 | (note: Canadian version differs slightly to accomodoate dual-language) | |
| 4466 | ||
| 4467 | [N-S(gold)] [1] [2] [3] [AIR] | |
| 4468 | [E-W(gold)] [4] [5] [6] [UP] | |
| 4469 | [N-S(silv)] [7] [8] [9] [$ VALUE] | |
| 4470 | [E-W(silv)] [CLEAR] | |
| 4471 | */ | |
| 4472 | ||
| 4473 | static INPUT_PORTS_START( lostreas ) | |
| 4474 | PORT_START("IN.0") // O0 | |
| 4475 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_NAME("1") | |
| 4476 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_NAME("2") | |
| 4477 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_3) PORT_CODE(KEYCODE_3_PAD) PORT_NAME("3") | |
| 4478 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_4) PORT_CODE(KEYCODE_4_PAD) PORT_NAME("4") | |
| 4479 | ||
| 4480 | PORT_START("IN.1") // O1 | |
| 4481 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_5) PORT_CODE(KEYCODE_5_PAD) PORT_NAME("5") | |
| 4482 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_NAME("6") | |
| 4483 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_NAME("7") | |
| 4484 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("8") | |
| 4485 | ||
| 4486 | PORT_START("IN.2") // O2 | |
| 4487 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_NAME("9") | |
| 4488 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_DEL) PORT_NAME("Clear") | |
| 4489 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_A) PORT_CODE(KEYCODE_U) PORT_NAME("Air/Up") | |
| 4490 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_V) PORT_NAME("$ Value") | |
| 4491 | ||
| 4492 | PORT_START("IN.3") // O3 | |
| 4493 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_R) PORT_NAME("E-W (silver)") | |
| 4494 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_E) PORT_NAME("N-S (silver)") | |
| 4495 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_W) PORT_NAME("E-W (gold)") | |
| 4496 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_CODE(KEYCODE_Q) PORT_NAME("N-S (gold)") | |
| 4497 | INPUT_PORTS_END | |
| 4498 | ||
| 4499 | ||
| 4500 | static const INT16 lostreas_speaker_levels[16] = | |
| 4501 | { | |
| 4502 | 0, 0x7fff/15, 0x7fff/14, 0x7fff/13, 0x7fff/12, 0x7fff/11, 0x7fff/10, 0x7fff/9, | |
| 4503 | 0x7fff/8, 0x7fff/7, 0x7fff/6, 0x7fff/5, 0x7fff/4, 0x7fff/3, 0x7fff/2, 0x7fff/1 | |
| 4504 | }; | |
| 4505 | ||
| 4506 | static MACHINE_CONFIG_START( lostreas, lostreas_state ) | |
| 4507 | ||
| 4508 | /* basic machine hardware */ | |
| 4509 | MCFG_CPU_ADD("maincpu", TMS1100, 425000) // approximation - RC osc. R=39K, C=47pf | |
| 4510 | MCFG_TMS1XXX_READ_K_CB(READ8(lostreas_state, read_k)) | |
| 4511 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(lostreas_state, write_r)) | |
| 4512 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(lostreas_state, write_o)) | |
| 4513 | ||
| 4514 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_tms1k_state, display_decay_tick, attotime::from_msec(1)) | |
| 4515 | MCFG_DEFAULT_LAYOUT(layout_lostreas) | |
| 4516 | ||
| 4517 | /* sound hardware */ | |
| 4518 | MCFG_SPEAKER_STANDARD_MONO("mono") | |
| 4519 | MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) | |
| 4520 | MCFG_SPEAKER_LEVELS(16, lostreas_speaker_levels) | |
| 4521 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) | |
| 4522 | MACHINE_CONFIG_END | |
| 4523 | ||
| 4524 | ||
| 4525 | ||
| 4526 | ||
| 4527 | ||
| 4528 | /*************************************************************************** | |
| 4529 | ||
| 4530 | 4145 | Tandy Radio Shack Computerized Arcade (1981, 1982, 1995) |
| 4531 | 4146 | * TMS1100 MCU, labeled CD7282SL |
| 4532 | * 12 lamps behind buttons, 1 | |
| 4147 | * 12 lamps behind buttons, 1bit sound | |
| 4533 | 4148 | |
| 4534 | 4149 | This handheld contains 12 minigames. It looks and plays like "Fabulous Fred" |
| 4535 | 4150 | by the Japanese company Mego Corp. in 1980, which in turn is a mix of Merlin |
| r253556 | r253557 | |
| 4650 | 4265 | INPUT_PORTS_END |
| 4651 | 4266 | |
| 4652 | 4267 | |
| 4653 | // output PLA is not decapped | |
| 4654 | 4268 | static const UINT16 tandy12_output_pla[0x20] = |
| 4655 | 4269 | { |
| 4656 | 4270 | // these are certain |
| r253556 | r253557 | |
| 4666 | 4280 | static MACHINE_CONFIG_START( tandy12, tandy12_state ) |
| 4667 | 4281 | |
| 4668 | 4282 | /* basic machine hardware */ |
| 4669 | MCFG_CPU_ADD("maincpu", TMS1100, 400000) // | |
| 4283 | MCFG_CPU_ADD("maincpu", TMS1100, 400000) // RC osc. R=39K, C=47pf -> ~400kHz | |
| 4670 | 4284 | MCFG_TMS1XXX_OUTPUT_PLA(tandy12_output_pla) |
| 4671 | 4285 | MCFG_TMS1XXX_READ_K_CB(READ8(tandy12_state, read_k)) |
| 4672 | 4286 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tandy12_state, write_r)) |
| r253556 | r253557 | |
| 4691 | 4305 | * PCB label TOMY B.O. |
| 4692 | 4306 | * TMS1040 MP2726 TOMY WIPE (die labeled MP2726A) |
| 4693 | 4307 | * TMS1025N2LL I/O expander |
| 4694 | * 2-digit 7seg display, 46 other leds, 1 | |
| 4308 | * 2-digit 7seg display, 46 other leds, 1bit sound | |
| 4695 | 4309 | |
| 4696 | 4310 | known releases: |
| 4697 | 4311 | - USA: Break Up |
| r253556 | r253557 | |
| 4892 | 4506 | Tomy Power House Pinball |
| 4893 | 4507 | * PCB label TOMY P-B |
| 4894 | 4508 | * TMS1100 MP1180 TOMY PINB (die labeled MP1180) |
| 4895 | * 3 7seg LEDs, and other LEDs behind bezel, 1 | |
| 4509 | * 3 7seg LEDs, and other LEDs behind bezel, 1bit sound | |
| 4896 | 4510 | |
| 4897 | 4511 | known releases: |
| 4898 | 4512 | - USA: Power House Pinball |
| r253556 | r253557 | |
| 4935 | 4549 | |
| 4936 | 4550 | void phpball_state::prepare_display() |
| 4937 | 4551 | { |
| 4938 | set_display_segmask(7, 0x7f); | |
| 4552 | // R0-R2 are 7segs | |
| 4553 | for (int y = 0; y < 3; y++) | |
| 4554 | m_display_segmask[y] = 0x7f; | |
| 4555 | ||
| 4939 | 4556 | display_matrix(7, 9, m_o, m_r); |
| 4940 | 4557 | } |
| 4941 | 4558 | |
| r253556 | r253557 | |
| 4947 | 4564 | // R9: input mux |
| 4948 | 4565 | m_inp_mux = data >> 9 & 1; |
| 4949 | 4566 | |
| 4950 | // R0-R2: digit select | |
| 4951 | 4567 | // R0-R8: led select |
| 4952 | 4568 | m_r = data; |
| 4953 | 4569 | prepare_display(); |
| r253556 | r253557 | |
| 4955 | 4571 | |
| 4956 | 4572 | WRITE16_MEMBER(phpball_state::write_o) |
| 4957 | 4573 | { |
| 4958 | // O0-O6: | |
| 4574 | // O0-O6: led state | |
| 4959 | 4575 | // O7: N/C |
| 4960 | 4576 | m_o = data & 0x7f; |
| 4961 | 4577 | prepare_display(); |
| r253556 | r253557 | |
| 4992 | 4608 | static MACHINE_CONFIG_START( phpball, phpball_state ) |
| 4993 | 4609 | |
| 4994 | 4610 | /* basic machine hardware */ |
| 4995 | MCFG_CPU_ADD("maincpu", TMS1100, 375000) // | |
| 4611 | MCFG_CPU_ADD("maincpu", TMS1100, 375000) // RC osc. R=47K, C=47pf -> ~375kHz | |
| 4996 | 4612 | MCFG_TMS1XXX_READ_K_CB(READ8(phpball_state, read_k)) |
| 4997 | 4613 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(phpball_state, write_r)) |
| 4998 | 4614 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(phpball_state, write_o)) |
| r253556 | r253557 | |
| 5021 | 4637 | ROM_LOAD( "mp1030", 0x0000, 0x0800, CRC(a81d7ccb) SHA1(4756ce42f1ea28ce5fe6498312f8306f10370969) ) |
| 5022 | 4638 | |
| 5023 | 4639 | ROM_REGION( 867, "maincpu:mpla", 0 ) |
| 5024 | ROM_LOAD( "tms1100_common | |
| 4640 | ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, BAD_DUMP CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) // not verified | |
| 5025 | 4641 | ROM_REGION( 365, "maincpu:opla", 0 ) |
| 5026 | 4642 | ROM_LOAD( "tms1100_mathmagi_output.pla", 0, 365, NO_DUMP ) |
| 5027 | 4643 | ROM_END |
| r253556 | r253557 | |
| 5038 | 4654 | ROM_END |
| 5039 | 4655 | |
| 5040 | 4656 | |
| 5041 | ROM_START( zodiac ) | |
| 5042 | ROM_REGION( 0x0800, "maincpu", 0 ) | |
| 5043 | ROM_LOAD( "mp3435", 0x0000, 0x0800, CRC(ecdc3160) SHA1(a7e82d66314a039fcffeddf99919d9f9ad42d61d) ) | |
| 5044 | ||
| 5045 | ROM_REGION( 867, "maincpu:mpla", 0 ) | |
| 5046 | ROM_LOAD( "tms1100_common3_micro.pla", 0, 867, BAD_DUMP CRC(03574895) SHA1(04407cabfb3adee2ee5e4218612cb06c12c540f4) ) // not verified | |
| 5047 | ROM_REGION( 365, "maincpu:opla", 0 ) | |
| 5048 | ROM_LOAD( "tms1100_zodiac_output.pla", 0, 365, NO_DUMP ) | |
| 5049 | ROM_END | |
| 5050 | ||
| 5051 | ||
| 5052 | 4657 | ROM_START( cqback ) |
| 5053 | 4658 | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 5054 | 4659 | ROM_LOAD( "mp3415.u4", 0x0000, 0x0800, CRC(65ebdabf) SHA1(9b5cf5adaf9132ced87f611ae8c3148b9b62ba89) ) |
| r253556 | r253557 | |
| 5093 | 4698 | ROM_END |
| 5094 | 4699 | |
| 5095 | 4700 | |
| 5096 | ROM_START( cnfball2 ) | |
| 5097 | ROM_REGION( 0x0800, "maincpu", 0 ) | |
| 5098 | ROM_LOAD( "mp1181", 0x0000, 0x0800, CRC(4553a840) SHA1(2e1132c9bc51641f77ba7f2430b5a3b2766b3a3d) ) | |
| 5099 | ||
| 5100 | ROM_REGION( 867, "maincpu:mpla", 0 ) | |
| 5101 | ROM_LOAD( "tms1100_common2_micro.pla", 0, 867, BAD_DUMP CRC(7cc90264) SHA1(c6e1cf1ffb178061da9e31858514f7cd94e86990) ) // not verified | |
| 5102 | ROM_REGION( 365, "maincpu:opla", 0 ) | |
| 5103 | ROM_LOAD( "tms1100_cnfball2_output.pla", 0, 365, NO_DUMP ) | |
| 5104 | ROM_END | |
| 5105 | ||
| 5106 | ||
| 5107 | 4701 | ROM_START( ebball ) |
| 5108 | 4702 | ROM_REGION( 0x0400, "maincpu", 0 ) |
| 5109 | 4703 | ROM_LOAD( "mp0914", 0x0000, 0x0400, CRC(3c6fb05b) SHA1(b2fe4b3ca72d6b4c9bfa84d67f64afdc215e7178) ) |
| r253556 | r253557 | |
| 5397 | 4991 | ROM_END |
| 5398 | 4992 | |
| 5399 | 4993 | |
| 5400 | ROM_START( lostreas ) | |
| 5401 | ROM_REGION( 0x0800, "maincpu", 0 ) | |
| 5402 | ROM_LOAD( "m34038", 0x0000, 0x0800, CRC(4c996f63) SHA1(ebbaa8b2f909f4300887aa2dbdb7185eedc75d3f) ) | |
| 5403 | ||
| 5404 | ROM_REGION( 867, "maincpu:mpla", 0 ) | |
| 5405 | ROM_LOAD( "tms1100_common1_micro.pla", 0, 867, CRC(62445fc9) SHA1(d6297f2a4bc7a870b76cc498d19dbb0ce7d69fec) ) | |
| 5406 | ROM_REGION( 365, "maincpu:opla", 0 ) | |
| 5407 | ROM_LOAD( "tms1100_lostreas_output.pla", 0, 365, CRC(c62d850f) SHA1(d25974e6901eb10c52cdda12e6d4a13e26745e6f) ) | |
| 5408 | ROM_END | |
| 5409 | ||
| 5410 | ||
| 5411 | 4994 | ROM_START( tandy12 ) |
| 5412 | 4995 | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 5413 | 4996 | ROM_LOAD( "cd7282sl", 0x0000, 0x0800, CRC(a10013dd) SHA1(42ebd3de3449f371b99937f9df39c240d15ac686) ) |
| r253556 | r253557 | |
| 5446 | 5029 | COMP( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) |
| 5447 | 5030 | |
| 5448 | 5031 | CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", MACHINE_SUPPORTS_SAVE ) |
| 5449 | COMP( 1979, zodiac, 0, 0, zodiac, zodiac, driver_device, 0, "Coleco", "Zodiac - The Astrology Computer", MACHINE_SUPPORTS_SAVE ) | |
| 5450 | 5032 | CONS( 1978, cqback, 0, 0, cqback, cqback, driver_device, 0, "Coleco", "Electronic Quarterback", MACHINE_SUPPORTS_SAVE ) |
| 5451 | 5033 | CONS( 1980, h2hfootb, 0, 0, h2hfootb, h2hfootb, driver_device, 0, "Coleco", "Head to Head Football", MACHINE_SUPPORTS_SAVE ) |
| 5452 | 5034 | CONS( 1980, h2hbaseb, 0, 0, h2hbaseb, h2hbaseb, driver_device, 0, "Coleco", "Head to Head Baseball", MACHINE_SUPPORTS_SAVE ) |
| 5453 | 5035 | CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", MACHINE_SUPPORTS_SAVE ) |
| 5454 | 5036 | |
| 5455 | CONS( 1979, cnfball2, 0, 0, cnfball2, cnfball2, driver_device, 0, "Conic", "Electronic Football II (Conic)", MACHINE_SUPPORTS_SAVE ) | |
| 5456 | ||
| 5457 | 5037 | CONS( 1979, ebball, 0, 0, ebball, ebball, driver_device, 0, "Entex", "Electronic Baseball (Entex)", MACHINE_SUPPORTS_SAVE ) |
| 5458 | 5038 | CONS( 1979, ebball2, 0, 0, ebball2, ebball2, driver_device, 0, "Entex", "Electronic Baseball 2 (Entex)", MACHINE_SUPPORTS_SAVE ) |
| 5459 | 5039 | CONS( 1980, ebball3, 0, 0, ebball3, ebball3, driver_device, 0, "Entex", "Electronic Baseball 3 (Entex)", MACHINE_SUPPORTS_SAVE ) |
| r253556 | r253557 | |
| 5486 | 5066 | CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", MACHINE_SUPPORTS_SAVE ) |
| 5487 | 5067 | CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", MACHINE_SUPPORTS_SAVE ) |
| 5488 | 5068 | CONS( 1982, mmerlin, 0, 0, mmerlin, mmerlin, driver_device, 0, "Parker Brothers", "Master Merlin", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) |
| 5489 | CONS( 1982, lostreas, 0, 0, lostreas, lostreas, driver_device, 0, "Parker Brothers", "Lost Treasure - The Electronic Deep-Sea Diving Game (Electronic Dive-Control Center)", MACHINE_SUPPORTS_SAVE ) // *** | |
| 5490 | 5069 | |
| 5491 | 5070 | CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", MACHINE_SUPPORTS_SAVE | MACHINE_CLICKABLE_ARTWORK ) // some of the minigames: *** |
| 5492 | 5071 |
| r253556 | r253557 | |
|---|---|---|
| 188 | 188 | m_display_maxy = maxy; |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 191 | void hh_ucom4_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) | |
| 192 | 192 | { |
| 193 | 193 | set_display_size(maxx, maxy); |
| 194 | 194 | |
| r253556 | r253557 | |
| 197 | 197 | for (int y = 0; y < maxy; y++) |
| 198 | 198 | m_display_state[y] = (sety >> y & 1) ? ((setx & mask) | (1 << maxx)) : 0; |
| 199 | 199 | |
| 200 | if (update) | |
| 201 | display_update(); | |
| 200 | display_update(); | |
| 202 | 201 | } |
| 203 | 202 | |
| 204 | 203 | |
| 205 | // generic input handlers | |
| 206 | ||
| 207 | 204 | UINT8 hh_ucom4_state::read_inputs(int columns) |
| 208 | 205 | { |
| 209 | 206 | UINT8 ret = 0; |
| r253556 | r253557 | |
|---|---|---|
| 16 | 16 | // - LPU & PPU ROMs |
| 17 | 17 | // - LPU & PPU RAMs |
| 18 | 18 | // - Text mode screen |
| 19 | // - Keyboard | |
| 20 | // - T15 tape drive | |
| 19 | // - Keyboard (most of keys) | |
| 21 | 20 | // What's not yet in: |
| 22 | 21 | // - Beeper |
| 22 | // - Rest of keyboard | |
| 23 | 23 | // - Graphic screen |
| 24 | // - | |
| 24 | // - Tape drive (this needs some heavy RE of the TACO chip) | |
| 25 | 25 | // - Better documentation of this file |
| 26 | 26 | // - Software list to load optional ROMs |
| 27 | 27 | // What's wrong: |
| r253556 | r253557 | |
| 33 | 33 | #include "cpu/z80/z80.h" |
| 34 | 34 | #include "softlist.h" |
| 35 | 35 | #include "cpu/hphybrid/hphybrid.h" |
| 36 | #include "machine/hp_taco.h" | |
| 37 | 36 | |
| 38 | 37 | #define BIT_MASK(n) (1U << (n)) |
| 39 | 38 | |
| r253556 | r253557 | |
| 78 | 77 | m_io_key0(*this , "KEY0"), |
| 79 | 78 | m_io_key1(*this , "KEY1"), |
| 80 | 79 | m_io_key2(*this , "KEY2"), |
| 81 | m_io_key3(*this , "KEY3"), | |
| 82 | m_t15(*this , "t15") | |
| 80 | m_io_key3(*this , "KEY3") | |
| 83 | 81 | { } |
| 84 | 82 | |
| 85 | 83 | UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| r253556 | r253557 | |
| 92 | 90 | void vblank_w(screen_device &screen, bool state); |
| 93 | 91 | |
| 94 | 92 | IRQ_CALLBACK_MEMBER(irq_callback); |
| 95 | void update_ir | |
| 93 | void update_irl(void); | |
| 96 | 94 | |
| 97 | 95 | TIMER_DEVICE_CALLBACK_MEMBER(kb_scan); |
| 98 | 96 | DECLARE_READ16_MEMBER(kb_scancode_r); |
| r253556 | r253557 | |
| 101 | 99 | |
| 102 | 100 | DECLARE_WRITE8_MEMBER(pa_w); |
| 103 | 101 | |
| 104 | DECLARE_WRITE_LINE_MEMBER(t15_irq_w); | |
| 105 | DECLARE_WRITE_LINE_MEMBER(t15_flg_w); | |
| 106 | DECLARE_WRITE_LINE_MEMBER(t15_sts_w); | |
| 107 | ||
| 108 | 102 | private: |
| 109 | 103 | required_device<hp_5061_3001_cpu_device> m_lpu; |
| 110 | 104 | required_device<hp_5061_3001_cpu_device> m_ppu; |
| r253556 | r253557 | |
| 113 | 107 | required_ioport m_io_key1; |
| 114 | 108 | required_ioport m_io_key2; |
| 115 | 109 | required_ioport m_io_key3; |
| 116 | required_device<hp_taco_device> m_t15; | |
| 117 | 110 | |
| 118 | 111 | void set_video_mar(UINT16 mar); |
| 119 | 112 | void video_fill_buff(bool buff_idx); |
| r253556 | r253557 | |
| 143 | 136 | |
| 144 | 137 | // Interrupt handling |
| 145 | 138 | UINT8 m_irl_pending; |
| 146 | UINT8 m_irh_pending; | |
| 147 | 139 | |
| 148 | 140 | // State of keyboard |
| 149 | 141 | ioport_value m_kb_state[ 4 ]; |
| 150 | 142 | UINT8 m_kb_scancode; |
| 151 | 143 | UINT16 m_kb_status; |
| 152 | 144 | |
| 153 | // State of PPU I/O | |
| 154 | UINT8 m_ppu_pa; | |
| 155 | 145 | }; |
| 156 | 146 | |
| 157 | 147 | static INPUT_PORTS_START(hp9845b) |
| r253556 | r253557 | |
| 332 | 322 | m_video_frame = 0; |
| 333 | 323 | |
| 334 | 324 | m_irl_pending = 0; |
| 335 | m_irh_pending = 0; | |
| 336 | 325 | |
| 337 | 326 | memset(&m_kb_state[ 0 ] , 0 , sizeof(m_kb_state)); |
| 338 | 327 | m_kb_scancode = 0x7f; |
| 339 | 328 | m_kb_status = 0; |
| 340 | ||
| 341 | m_ppu_pa = 0; | |
| 342 | 329 | } |
| 343 | 330 | |
| 344 | 331 | void hp9845b_state::set_video_mar(UINT16 mar) |
| r253556 | r253557 | |
| 492 | 479 | if (irqline == HPHYBRID_IRL) { |
| 493 | 480 | return m_irl_pending; |
| 494 | 481 | } else { |
| 495 | return | |
| 482 | return 0; | |
| 496 | 483 | } |
| 497 | 484 | } |
| 498 | 485 | |
| 499 | void hp9845b_state::update_ir | |
| 486 | void hp9845b_state::update_irl(void) | |
| 500 | 487 | { |
| 501 | 488 | m_ppu->set_input_line(HPHYBRID_IRL , m_irl_pending != 0); |
| 502 | m_ppu->set_input_line(HPHYBRID_IRH , m_irh_pending != 0); | |
| 503 | 489 | } |
| 504 | 490 | |
| 505 | 491 | TIMER_DEVICE_CALLBACK_MEMBER(hp9845b_state::kb_scan) |
| r253556 | r253557 | |
| 560 | 546 | m_kb_scancode = i; |
| 561 | 547 | BIT_SET(m_irl_pending , 0); |
| 562 | 548 | BIT_SET(m_kb_status, 0); |
| 563 | update_ir | |
| 549 | update_irl(); | |
| 564 | 550 | |
| 565 | 551 | // Special case: pressing stop key sets LPU "status" flag |
| 566 | 552 | if (i == 0x47) { |
| r253556 | r253557 | |
| 586 | 572 | { |
| 587 | 573 | BIT_CLR(m_irl_pending , 0); |
| 588 | 574 | BIT_CLR(m_kb_status, 0); |
| 589 | update_ir | |
| 575 | update_irl(); | |
| 590 | 576 | m_lpu->status_w(0); |
| 591 | 577 | // TODO: beeper start |
| 592 | 578 | } |
| 593 | 579 | |
| 594 | 580 | WRITE8_MEMBER(hp9845b_state::pa_w) |
| 595 | 581 | { |
| 596 | m_ppu_pa = data; | |
| 597 | ||
| 598 | 582 | // TODO: handle sts & flg |
| 599 | if (data == 15) { | |
| 600 | // RHS tape drive (T15) | |
| 601 | m_ppu->status_w(m_t15->sts_r()); | |
| 602 | m_ppu->flag_w(m_t15->flg_r()); | |
| 583 | if (data == 0xf) { | |
| 584 | // RHS tape drive (T15) | |
| 585 | m_ppu->status_w(1); | |
| 586 | m_ppu->flag_w(1); | |
| 603 | 587 | } else { |
| 604 | 588 | m_ppu->status_w(0); |
| 605 | 589 | m_ppu->flag_w(0); |
| 606 | 590 | } |
| 607 | 591 | } |
| 608 | 592 | |
| 609 | WRITE_LINE_MEMBER(hp9845b_state::t15_irq_w) | |
| 610 | { | |
| 611 | if (state) { | |
| 612 | BIT_SET(m_irh_pending , 7); | |
| 613 | } else { | |
| 614 | BIT_CLR(m_irh_pending , 7); | |
| 615 | } | |
| 616 | update_irq(); | |
| 617 | } | |
| 618 | ||
| 619 | WRITE_LINE_MEMBER(hp9845b_state::t15_flg_w) | |
| 620 | { | |
| 621 | if (m_ppu_pa == 15) { | |
| 622 | m_ppu->flag_w(state); | |
| 623 | } | |
| 624 | } | |
| 625 | ||
| 626 | WRITE_LINE_MEMBER(hp9845b_state::t15_sts_w) | |
| 627 | { | |
| 628 | if (m_ppu_pa == 15) { | |
| 629 | m_ppu->status_w(state); | |
| 630 | } | |
| 631 | } | |
| 632 | ||
| 633 | 593 | static MACHINE_CONFIG_START( hp9845a, hp9845_state ) |
| 634 | 594 | //MCFG_CPU_ADD("lpu", HP_5061_3010, XTAL_11_4MHz) |
| 635 | 595 | //MCFG_CPU_ADD("ppu", HP_5061_3011, XTAL_11_4MHz) |
| r253556 | r253557 | |
| 678 | 638 | // PA = 0, IC = 3 |
| 679 | 639 | // Keyboard status input & keyboard interrupt clear |
| 680 | 640 | AM_RANGE(HP_MAKE_IOADDR(0 , 3) , HP_MAKE_IOADDR(0 , 3)) AM_READWRITE(kb_status_r , kb_irq_clear_w) |
| 681 | // PA = 15, IC = 0..3 | |
| 682 | // Right-hand side tape drive (T15) | |
| 683 | AM_RANGE(HP_MAKE_IOADDR(15 , 0) , HP_MAKE_IOADDR(15 , 3)) AM_DEVREADWRITE("t15" , hp_taco_device , reg_r , reg_w) | |
| 684 | 641 | ADDRESS_MAP_END |
| 685 | 642 | |
| 686 | 643 | static MACHINE_CONFIG_START( hp9845b, hp9845b_state ) |
| r253556 | r253557 | |
| 706 | 663 | // Actual keyboard refresh rate should be KEY_SCAN_OSCILLATOR / 128 (2560 Hz) |
| 707 | 664 | MCFG_TIMER_DRIVER_ADD_PERIODIC("kb_timer" , hp9845b_state , kb_scan , attotime::from_hz(100)) |
| 708 | 665 | |
| 709 | // Tape controller | |
| 710 | MCFG_DEVICE_ADD("t15" , HP_TACO , 4000000) | |
| 711 | MCFG_TACO_IRQ_HANDLER(WRITELINE(hp9845b_state , t15_irq_w)) | |
| 712 | MCFG_TACO_FLG_HANDLER(WRITELINE(hp9845b_state , t15_flg_w)) | |
| 713 | MCFG_TACO_STS_HANDLER(WRITELINE(hp9845b_state , t15_sts_w)) | |
| 714 | ||
| 715 | 666 | MCFG_SOFTWARE_LIST_ADD("optrom_list", "hp9845b_rom") |
| 716 | 667 | MACHINE_CONFIG_END |
| 717 | 668 |
| r253556 | r253557 | |
|---|---|---|
| 1 | 1 | // license:BSD-3-Clause |
| 2 | 2 | // copyright-holders:Roberto Fresca, hap |
| 3 | /****************************************************************************** | |
| 3 | /****************************************************************************** | |
| 4 | 4 | |
| 5 | 5 | KURU KURU PYON PYON |
| 6 | | |
| 6 | Taiyo Jidoki / Success | |
| 7 | 7 | |
| 8 | ||
| 8 | 9 | Driver by Roberto Fresca & hap. |
| 9 | 10 | |
| 10 | 11 | |
| r253556 | r253557 | |
| 15 | 16 | ports, descriptions and a lot of things... :) |
| 16 | 17 | |
| 17 | 18 | |
| 18 | ******************************************************************************* | |
| 19 | ******************************************************************************* | |
| 19 | 20 | |
| 20 | 21 | Technical Notes.... |
| 21 | 22 | |
| r253556 | r253557 | |
| 113 | 114 | AB = NEC C1663C 8926B. |
| 114 | 115 | |
| 115 | 116 | |
| 116 | ******************************************************************************* | |
| 117 | ******************************************************************************* | |
| 117 | 118 | |
| 118 | 119 | General Notes.... |
| 119 | 120 | |
| 120 | There are at least 4 games in the Pyon Pyon series... | |
| 121 | The game name could be translated as "Croak Croak Hop Hop" | |
| 122 | Kuru is the frog sound, and Pyon is the sound of jumps. | |
| 121 | 123 | |
| 122 | 1) Pyon Pyon (a marathon game with froggy characters). | |
| 123 | 2) Kuru Kuru Pyon Pyon (a kind of slots game with the same froggy characters). | |
| 124 | 3) Pyon Pyon Jyanpu (a contents where the same characters try to cross the river jumping on pads). | |
| 125 | 4) Sui Sui Pyon Pyon (a swimming competition where the same characters swim with different styles, even walking). | |
| 126 | ||
| 127 | 124 | Coin 1 (key 5) could be set either as Coin 1 or as Payout button, through |
| 128 | 125 | a DIP switch. |
| 129 | 126 | |
| r253556 | r253557 | |
| 132 | 129 | will be cleared). |
| 133 | 130 | |
| 134 | 131 | |
| 135 | ******************************************************************************* | |
| 132 | ******************************************************************************* | |
| 136 | 133 | |
| 137 | Games Notes: | |
| 138 | ------------ | |
| 134 | * How to play... | |
| 139 | 135 | |
| 140 | | |
| 136 | Insert tokens (medals)... | |
| 141 | 137 | |
| 142 | The game name could be translated as "Croak Croak Hop Hop" | |
| 143 | Kuru is the frog sound, and Pyon is the sound of jumps. | |
| 144 | ||
| 145 | How to play... | |
| 146 | ||
| 147 | Insert tokens (medals). | |
| 148 | 138 | You can bet to any (or all) of the following 5 characters: Bote, Oume, Pyoko, |
| 149 | 139 | Kunio, and Pyon Pyon. Press start, and the reels start to roll. You'll win if |
| 150 | 140 | you can get 3 of the choosen character(s) in a row, column or diagonal. |
| r253556 | r253557 | |
| 156 | 146 | Red tadpoles are a bonus. Once you get one, it will go to the right panel, |
| 157 | 147 | revealing a number. This number represents the extra credits you won. |
| 158 | 148 | |
| 159 | Bookkeeping... | |
| 160 | 149 | |
| 150 | * Bookkeeping... | |
| 151 | ||
| 161 | 152 | Pressing Bookkeeping key (key 9), you enter the Bookkeeping Mode. There are |
| 162 | 153 | 2 screens with all the game information like DIP switches and statistics... |
| 163 | 154 | |
| r253556 | r253557 | |
| 177 | 168 | |
| 178 | 169 | Pressing the Bookkeeping key once more, you exit the mode and go back to the game. |
| 179 | 170 | |
| 180 | ---------------------------------------------------------------------------------- | |
| 181 | 171 | |
| 182 | ||
| 172 | ******************************************************************************* | |
| 183 | 173 | |
| 184 | The game name could be translated as "Hop Hop Jump" | |
| 185 | Pyon is the sound of jumps. Jyanpu means jump. | |
| 186 | ||
| 187 | How to play... | |
| 188 | ||
| 189 | Insert tokens (medals). | |
| 190 | You can bet to any (or all) of the following 5 characters: Boketa, Kunio, Pyon-Pyon, | |
| 191 | Pyokorin and Botechin. Press start, and the river's pads start to roll. You'll win | |
| 192 | if your character gets the three pads to jump to the other side of the river. | |
| 193 | ||
| 194 | There is also a bonus game with a black tadpole rounding some pads with extra credits. | |
| 195 | you'll get the extra credits marked in the pad where the tadpole stopped. | |
| 196 | ||
| 197 | Bookkeeping... | |
| 198 | ||
| 199 | Pressing Bookkeeping key (key 9), you enter the Bookkeeping Mode. There are | |
| 200 | 2 screens with all the game information like DIP switches and statistics... | |
| 201 | ||
| 202 | 1st screen... | |
| 203 | ||
| 204 | - [Left panel]: All the DIP switches parameters. | |
| 205 | ||
| 206 | - [Right panel]: Bet and Win totals, 100Y/10Y/medal IN/OUT, total of games, | |
| 207 | won, loss, won by paid range, and 'omake' (extra/bonus). | |
| 208 | ||
| 209 | 2nd screen (press Bookkeeping key again)... | |
| 210 | ||
| 211 | - Win distribution by character | |
| 212 | (Boketa, Kunio, Pyon-Pyon, Pyokorin and Botechin). | |
| 213 | ||
| 214 | - Bet distribution (1, 2, 3, 4, 5~10) | |
| 215 | ||
| 216 | - Omake (bonus) distribution (games total, win games, loss games) | |
| 217 | ||
| 218 | Pressing the Bookkeeping key once more, you exit the mode and go back to the game. | |
| 219 | ||
| 220 | ||
| 221 | ************************************************************************************ | |
| 222 | ||
| 223 | 174 | ADPCM Samples.... |
| 224 | 175 | |
| 225 | There are 14 samples in | |
| 176 | There are 14 samples in the system. | |
| 226 | 177 | |
| 227 | 00: "Bote | |
| 178 | 00: "Boterin" | |
| 228 | 179 | 01: |
| 229 | 02: "Hakase" (professor) | |
| 180 | 02: "Hakase" ("professor") | |
| 230 | 181 | 03: "Pyokorin" |
| 231 | 182 | 04: "Kunio" |
| 232 | 05: "Pyon-Pyon" | |
| 233 | 06: "Boketa" | |
| 183 | 05: "Pyon Pyon" | |
| 184 | 06: | |
| 234 | 185 | 07: |
| 235 | 186 | 08: "Oume" |
| 236 | 09: "Haipaa" (hyper) | |
| 237 | 10: "Ichi ni tsuite" (on your marks) | |
| 238 | 11: "Youi" (get ready) | |
| 239 | 12: "Bang" (sound for the tadpoles landing in the right panel). | |
| 187 | 09: "Haipaa" ("hyper") | |
| 188 | 10: "Ichi ni tsuite" ("on your marks") | |
| 189 | 11: "Youi" ("get ready") | |
| 190 | 12: Bang sound for the tadpoles landing in the right panel. | |
| 240 | 191 | 13: Sound effect for reels when running. |
| 241 | 192 | |
| 242 | The fact that there are samples for "on your marks", "get ready", and "bang", | |
| 243 | make me think that these sounds could be shared with the other unemulated marathon | |
| 244 | game of the series called just "Pyon Pyon". | |
| 245 | 193 | |
| 246 | ****************************************************************************** | |
| 194 | ******************************************************************************/ | |
| 247 | 195 | |
| 248 | 196 | #include "emu.h" |
| 249 | 197 | #include "cpu/z80/z80.h" |
| r253556 | r253557 | |
| 543 | 491 | /* bits d0-d3 are JAMMA top side pins 20,21,22,23, bits d4-d7 are JAMMA bottom side pins 20,21,22,23 |
| 544 | 492 | so that's player 1 left/right/button1/button2 then player 2 left/right/button1/button2 |
| 545 | 493 | */ |
| 546 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("1st (Bote | |
| 494 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_CODE(KEYCODE_Z) PORT_NAME("1st (Bote)") | |
| 547 | 495 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_CODE(KEYCODE_X) PORT_NAME("2nd (Oume)") |
| 548 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("3rd (Pyoko | |
| 496 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_CODE(KEYCODE_C) PORT_NAME("3rd (Pyoko)") | |
| 549 | 497 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_CODE(KEYCODE_V) PORT_NAME("4th (Kunio)") |
| 550 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("5th (Pyon | |
| 498 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_CODE(KEYCODE_B) PORT_NAME("5th (Pyon Pyon)") | |
| 551 | 499 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_N) PORT_NAME("Unknown A0h - bit5") |
| 552 | 500 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_M) PORT_NAME("Unknown A0h - bit6") |
| 553 | 501 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) |
| r253556 | r253557 | |
| 781 | 729 | MACHINE_CONFIG_END |
| 782 | 730 | |
| 783 | 731 | |
| 784 | /************************************************* | |
| 785 | * ROMs Loading * | |
| 786 | *************************************************/ | |
| 732 | /*************************************************************************** | |
| 787 | 733 | |
| 734 | Game driver(s) | |
| 735 | ||
| 736 | ***************************************************************************/ | |
| 737 | ||
| 788 | 738 | /* Kuru Kuru Pyon Pyon. |
| 789 | 1990, Success / Taiyo Jidoki. | |
| 790 | 739 | */ |
| 791 | 740 | ROM_START( kurukuru ) |
| 792 | 741 | ROM_REGION( 0x08000, "maincpu", 0 ) |
| r253556 | r253557 | |
| 808 | 757 | ROM_LOAD( "7908b-4.ic32", 0x0600, 0x0034, CRC(bddf925e) SHA1(861cf5966444d0c0392241e5cfa08db475fb439a) ) |
| 809 | 758 | ROM_END |
| 810 | 759 | |
| 811 | /* Pyon Pyon J | |
| 760 | /* Pyon Pyon Jump. | |
| 812 | 761 | Ver 1.40. |
| 813 | 199?, Success / Taiyo Jidoki. | |
| 814 | 762 | */ |
| 815 | 763 | ROM_START( ppj ) |
| 816 | 764 | ROM_REGION( 0x08000, "maincpu", 0 ) |
| r253556 | r253557 | |
| 833 | 781 | ROM_END |
| 834 | 782 | |
| 835 | 783 | |
| 836 | /*************************************************************************** | |
| 837 | * Game Drivers * | |
| 838 | ***************************************************************************/ | |
| 839 | ||
| 840 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ | |
| 841 | GAME( 1990, kurukuru, 0, kurukuru, kurukuru, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Kuru Kuru Pyon Pyon (Japan)", 0 ) | |
| 842 | GAME( 199?, ppj, 0, ppj, ppj, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Pyon Pyon Jyanpu (V1.40, Japan)", 0 ) | |
| 843 | ||
| 844 | // unemulated.... | |
| 845 | ||
| 846 | // 199?, Success / Taiyo Jidoki, Pyon Pyon | |
| 847 | // 1990, Success / Taiyo Jidoki, Sui Sui Pyon Pyon | |
| 784 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ | |
| 785 | GAME( 199?, kurukuru, 0, kurukuru, kurukuru, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Kuru Kuru Pyon Pyon (Japan)", 0 ) | |
| 786 | GAME( 199?, ppj, 0, ppj, ppj, driver_device, 0, ROT0, "Success / Taiyo Jidoki", "Pyon Pyon Jump (V1.40, Japan)", 0 ) |
| r253556 | r253557 | |
|---|---|---|
| 62 | 62 | { |
| 63 | 63 | // declare display matrix size and the 2 7segs |
| 64 | 64 | set_display_size(7, 3); |
| 65 | se | |
| 65 | m_display_segmask[1] = m_display_segmask[2] = 0x7f; | |
| 66 | 66 | |
| 67 | 67 | // update current state |
| 68 | 68 | if (~m_r & 0x10) |
| r253556 | r253557 | |
| 246 | 246 | static MACHINE_CONFIG_START( mbdtower, mbdtower_state ) |
| 247 | 247 | |
| 248 | 248 | /* basic machine hardware */ |
| 249 | MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=43K, C=56pf | |
| 249 | MCFG_CPU_ADD("maincpu", TMS1400, 425000) // approximation - RC osc. R=43K, C=56pf, but unknown RC curve | |
| 250 | 250 | MCFG_TMS1XXX_READ_K_CB(READ8(mbdtower_state, read_k)) |
| 251 | 251 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(mbdtower_state, write_r)) |
| 252 | 252 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(mbdtower_state, write_o)) |
| r253556 | r253557 | |
|---|---|---|
| 2045 | 2045 | |
| 2046 | 2046 | ROM_START( block ) |
| 2047 | 2047 | ROM_REGION( 0x50000, "maincpu", 0 ) |
| 2048 | ROM_LOAD( "ble_05b.14f", 0x00000, 0x08000, CRC(fcdb7885) SHA1(500ee4b8344181e9ad348bd22344a1a942fe9fdc) ) | |
| 2049 | ROM_LOAD( "ble_06b.15f", 0x10000, 0x20000, CRC(e114ebde) SHA1(12362e809443644b43fbc72e7eead5f376fe11d3) ) | |
| 2050 | ROM_LOAD( "ble_07b.16f", 0x30000, 0x20000, CRC(61bef077) SHA1(92792f26305df1e5e66607bed391b84b4964ba3e) ) | |
| 2048 | ROM_LOAD( "ble_05.rom", 0x00000, 0x08000, CRC(c12e7f4c) SHA1(335f4eab2323b942d5feeb3bab6f7286fabfffb4) ) | |
| 2049 | ROM_LOAD( "ble_06.rom", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) ) | |
| 2050 | ROM_LOAD( "ble_07.rom", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) ) | |
| 2051 | 2051 | |
| 2052 | 2052 | ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF ) |
| 2053 | ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */ | |
| 2054 | ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) ) | |
| 2053 | ROM_LOAD( "bl_08.rom", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */ | |
| 2054 | ROM_LOAD( "bl_09.rom", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) ) | |
| 2055 | 2055 | /* 40000-7ffff empty */ |
| 2056 | ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) ) | |
| 2057 | ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) ) | |
| 2056 | ROM_LOAD( "bl_18.rom", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) ) | |
| 2057 | ROM_LOAD( "bl_19.rom", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) ) | |
| 2058 | 2058 | /* c0000-fffff empty */ |
| 2059 | 2059 | |
| 2060 | 2060 | ROM_REGION( 0x040000, "gfx2", 0 ) |
| 2061 | ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */ | |
| 2062 | ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) ) | |
| 2061 | ROM_LOAD( "bl_16.rom", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */ | |
| 2062 | ROM_LOAD( "bl_17.rom", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) ) | |
| 2063 | 2063 | |
| 2064 | 2064 | ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */ |
| 2065 | ROM_LOAD( "bl_01. | |
| 2065 | ROM_LOAD( "bl_01.rom", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) ) | |
| 2066 | 2066 | ROM_END |
| 2067 | 2067 | |
| 2068 | ROM_START( block | |
| 2068 | ROM_START( blockj ) | |
| 2069 | 2069 | ROM_REGION( 0x50000, "maincpu", 0 ) |
| 2070 | ROM_LOAD( "ble_05a.14f", 0x00000, 0x08000, CRC(fa2a4536) SHA1(8f584745116bd0ced4d66719cd80c0372b797134) ) | |
| 2071 | ROM_LOAD( "ble_06a.15f", 0x10000, 0x20000, CRC(e114ebde) SHA1(12362e809443644b43fbc72e7eead5f376fe11d3) ) | |
| 2072 | ROM_LOAD( "ble_07.16f", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) ) | |
| 2070 | ROM_LOAD( "blj_05.rom", 0x00000, 0x08000, CRC(3b55969a) SHA1(86de2f1f5878de380a8b1e3935cffa146863f07f) ) | |
| 2071 | ROM_LOAD( "ble_06.rom", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) ) | |
| 2072 | ROM_LOAD( "blj_07.rom", 0x30000, 0x20000, CRC(1723883c) SHA1(e6b7575a55c045b90fb41290a60306713121acfb) ) | |
| 2073 | 2073 | |
| 2074 | /* the highscore table specifies an unused tile number, so we need ROMREGION_ERASEFF to ensure it is blank */ | |
| 2075 | 2074 | ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF ) |
| 2076 | ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */ | |
| 2077 | ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) ) | |
| 2075 | ROM_LOAD( "bl_08.rom", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */ | |
| 2076 | ROM_LOAD( "bl_09.rom", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) ) | |
| 2078 | 2077 | /* 40000-7ffff empty */ |
| 2079 | ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) ) | |
| 2080 | ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) ) | |
| 2078 | ROM_LOAD( "bl_18.rom", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) ) | |
| 2079 | ROM_LOAD( "bl_19.rom", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) ) | |
| 2081 | 2080 | /* c0000-fffff empty */ |
| 2082 | 2081 | |
| 2083 | 2082 | ROM_REGION( 0x040000, "gfx2", 0 ) |
| 2084 | ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */ | |
| 2085 | ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) ) | |
| 2083 | ROM_LOAD( "bl_16.rom", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */ | |
| 2084 | ROM_LOAD( "bl_17.rom", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) ) | |
| 2086 | 2085 | |
| 2087 | 2086 | ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */ |
| 2088 | ROM_LOAD( "bl_01. | |
| 2087 | ROM_LOAD( "bl_01.rom", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) ) | |
| 2089 | 2088 | ROM_END |
| 2090 | 2089 | |
| 2091 | ROM_START( block | |
| 2090 | ROM_START( blockjoy ) | |
| 2092 | 2091 | ROM_REGION( 0x50000, "maincpu", 0 ) |
| 2093 | ROM_LOAD( "ble_05.14f", 0x00000, 0x08000, CRC(c12e7f4c) SHA1(335f4eab2323b942d5feeb3bab6f7286fabfffb4) ) | |
| 2094 | ROM_LOAD( "ble_06.15f", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) ) | |
| 2095 | ROM_LOAD( "ble_07.16f", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) ) | |
| 2092 | ROM_LOAD( "ble_05.bin", 0x00000, 0x08000, CRC(fa2a4536) SHA1(8f584745116bd0ced4d66719cd80c0372b797134) ) | |
| 2093 | ROM_LOAD( "blf_06.bin", 0x10000, 0x20000, CRC(e114ebde) SHA1(12362e809443644b43fbc72e7eead5f376fe11d3) ) | |
| 2094 | // a ble_06a labeled rom has been dumped and verified identical to blf_06.bin. | |
| 2096 | 2095 | |
| 2097 | ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF ) | |
| 2098 | ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */ | |
| 2099 | ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) ) | |
| 2100 | /* 40000-7ffff empty */ | |
| 2101 | ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) ) | |
| 2102 | ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) ) | |
| 2103 | /* c0000-fffff empty */ | |
| 2096 | // this seems to be a bad version of the above rom, although the rom code is different it is 99% the same, and level 6 | |
| 2097 | // is impossible to finish due to a missing block. Probably bitrot | |
| 2098 | // ROM_LOAD( "ble_06.bin", 0x10000, 0x20000, BAD_DUMP CRC(58a77402) SHA1(cb24b1edd53a0965c3a9a34fe764b5c1f8dd9733) ) | |
| 2104 | 2099 | |
| 2105 | ROM_REGION( 0x040000, "gfx2", 0 ) | |
| 2106 | ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */ | |
| 2107 | ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) ) | |
| 2100 | ROM_LOAD( "ble_07.rom", 0x30000, 0x20000, CRC(1d114f13) SHA1(ee3588e1752b3432fd611e2d7d4fb43f942de580) ) | |
| 2108 | 2101 | |
| 2109 | ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */ | |
| 2110 | ROM_LOAD( "bl_01.2d", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) ) | |
| 2111 | ROM_END | |
| 2112 | ||
| 2113 | ROM_START( blockj ) | |
| 2114 | ROM_REGION( 0x50000, "maincpu", 0 ) | |
| 2115 | ROM_LOAD( "blj_05.14f", 0x00000, 0x08000, CRC(3b55969a) SHA1(86de2f1f5878de380a8b1e3935cffa146863f07f) ) | |
| 2116 | ROM_LOAD( "ble_06.15f", 0x10000, 0x20000, CRC(cdb13d55) SHA1(2e4489d12a603b4c7dfb90d246ebff9176e88a0b) ) | |
| 2117 | ROM_LOAD( "blj_07.16f", 0x30000, 0x20000, CRC(1723883c) SHA1(e6b7575a55c045b90fb41290a60306713121acfb) ) | |
| 2118 | ||
| 2102 | /* the highscore table specifies an unused tile number, so we need ROMREGION_ERASEFF to ensure it is blank */ | |
| 2119 | 2103 | ROM_REGION( 0x100000, "gfx1", ROMREGION_ERASEFF ) |
| 2120 | ROM_LOAD( "bl_08.8h", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */ | |
| 2121 | ROM_LOAD( "bl_09.9h", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) ) | |
| 2104 | ROM_LOAD( "bl_08.rom", 0x000000, 0x20000, CRC(aa0f4ff1) SHA1(58f3c468f89d834caaf66d3c084ab87addbb75c0) ) /* chars */ | |
| 2105 | ROM_LOAD( "bl_09.rom", 0x020000, 0x20000, CRC(6fa8c186) SHA1(d4dd26d666f2accce871f70e7882e140d924dd07) ) | |
| 2122 | 2106 | /* 40000-7ffff empty */ |
| 2123 | ROM_LOAD( "bl_18.8j", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) ) | |
| 2124 | ROM_LOAD( "bl_19.9j", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) ) | |
| 2107 | ROM_LOAD( "bl_18.rom", 0x080000, 0x20000, CRC(c0acafaf) SHA1(7c44b2605da6a324d0c145202cb8bac7af7a9c68) ) | |
| 2108 | ROM_LOAD( "bl_19.rom", 0x0a0000, 0x20000, CRC(1ae942f5) SHA1(e9322790db0bf2a9e862b14e166ee3f36f9ea5ad) ) | |
| 2125 | 2109 | /* c0000-fffff empty */ |
| 2126 | 2110 | |
| 2127 | 2111 | ROM_REGION( 0x040000, "gfx2", 0 ) |
| 2128 | ROM_LOAD( "bl_16.2j", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */ | |
| 2129 | ROM_LOAD( "bl_17.3j", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) ) | |
| 2112 | ROM_LOAD( "bl_16.rom", 0x000000, 0x20000, CRC(fadcaff7) SHA1(f4bd8e375fe6b1e6a07b4ec4e58f5807dbd738f8) ) /* sprites */ | |
| 2113 | ROM_LOAD( "bl_17.rom", 0x020000, 0x20000, CRC(5f8cab42) SHA1(3a4c682a7938479e0be80c0494c2c8fc7303b663) ) | |
| 2130 | 2114 | |
| 2131 | 2115 | ROM_REGION( 0x80000, "oki", 0 ) /* OKIM */ |
| 2132 | ROM_LOAD( "bl_01. | |
| 2116 | ROM_LOAD( "bl_01.rom", 0x00000, 0x20000, CRC(c2ec2abb) SHA1(89981f2a887ace4c4580e2828cbdc962f89c215e) ) | |
| 2133 | 2117 | ROM_END |
| 2134 | 2118 | |
| 2135 | 2119 | ROM_START( blockbl ) |
| r253556 | r253557 | |
| 2341 | 2325 | * |
| 2342 | 2326 | *************************************/ |
| 2343 | 2327 | |
| 2344 | GAME( 1988, mgakuen, 0, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Mahjong Gakuen", MACHINE_SUPPORTS_SAVE ) | |
| 2345 | GAME( 1988, 7toitsu, mgakuen, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Chi-Toitsu", MACHINE_SUPPORTS_SAVE ) | |
| 2346 | GAME( 1989, mgakuen2, 0, marukin, marukin, mitchell_state, mgakuen2, ROT0, "Face", "Mahjong Gakuen 2 Gakuen-chou no Fukushuu", MACHINE_SUPPORTS_SAVE ) | |
| 2347 | GAME( 1989, pkladies, 0, marukin, pkladies, mitchell_state, pkladies, ROT0, "Mitchell", "Poker Ladies", MACHINE_SUPPORTS_SAVE ) | |
| 2348 | GAME( 1989, pkladiesl, pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 510)", MACHINE_SUPPORTS_SAVE ) | |
| 2349 | GAME( 1989, pkladiesla,pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 401)", MACHINE_SUPPORTS_SAVE ) | |
| 2350 | GAME( 1989, pkladiesbl,pkladies, pkladiesbl,pkladies, mitchell_state, pkladiesbl,ROT0, "bootleg", "Poker Ladies (Censored bootleg)", MACHINE_NOT_WORKING ) // by Playmark? need to figure out CPU 'decryption' / ordering | |
| 2351 | GAME( 1989, dokaben, 0, pang, pang, mitchell_state, dokaben, ROT0, "Capcom", "Dokaben (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2352 | GAME( 1989, pang, 0, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pang (World)", MACHINE_SUPPORTS_SAVE ) | |
| 2353 | GAME( 1989, bbros, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell (Capcom license)", "Buster Bros. (USA)", MACHINE_SUPPORTS_SAVE ) | |
| 2354 | GAME( 1989, pompingw, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pomping World (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2355 | GAME( 1989, pangb, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 1)", MACHINE_SUPPORTS_SAVE ) | |
| 2356 | GAME( 1989, pangbold, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 2)", MACHINE_SUPPORTS_SAVE ) | |
| 2357 | GAME( 1989, pangba, pang, spangbl, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 3)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) | |
| 2358 | GAME( 1989, pangb2, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 4)", MACHINE_SUPPORTS_SAVE ) | |
| 2359 | GAME( 1989, cworld, 0, pang, qtono1, mitchell_state, cworld, ROT0, "Capcom", "Capcom World (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2360 | GAME( 1990, hatena, 0, pang, qtono1, mitchell_state, hatena, ROT0, "Capcom", "Adventure Quiz 2 - Hatena? no Daibouken (Japan 900228)", MACHINE_SUPPORTS_SAVE ) | |
| 2361 | GAME( 1990, spang, 0, pangnv, pang, mitchell_state, spang, ROT0, "Mitchell", "Super Pang (World 900914)", MACHINE_SUPPORTS_SAVE ) | |
| 2362 | GAME( 1990, sbbros, spang, pangnv, pang, mitchell_state, sbbros, ROT0, "Mitchell (Capcom license)", "Super Buster Bros. (USA 901001)", MACHINE_SUPPORTS_SAVE ) | |
| 2363 | GAME( 1990, spangj, spang, pangnv, pang, mitchell_state, spangj, ROT0, "Mitchell", "Super Pang (Japan 901023)", MACHINE_SUPPORTS_SAVE ) | |
| 2364 | GAME( 1990, spangbl, spang, spangbl, spangbl, mitchell_state, spangbl, ROT0, "bootleg", "Super Pang (World 900914, bootleg)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // different sound hardware | |
| 2365 | GAME( 1994, mstworld, 0, mstworld, mstworld, mitchell_state, mstworld, ROT0, "bootleg (TCH)", "Monsters World (bootleg of Super Pang)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) | |
| 2366 | GAME( 1990, marukin, 0, marukin, marukin, mitchell_state, marukin, ROT0, "Yuga", "Super Marukin-Ban (Japan 901017)", MACHINE_SUPPORTS_SAVE ) | |
| 2367 | GAME( 1991, qtono1, 0, pang, qtono1, mitchell_state, qtono1, ROT0, "Capcom", "Quiz Tonosama no Yabou (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2368 | GAME( 1991, qsangoku, 0, pang, qtono1, mitchell_state, qsangoku, ROT0, "Capcom", "Quiz Sangokushi (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2369 | GAME( 1991, block, 0, pangnv, blockjoy, mitchell_state, block, ROT270, "Capcom", "Block Block (World 911219 Joystick)", MACHINE_SUPPORTS_SAVE ) | |
| 2370 | GAME( 1991, blockr1, block, pangnv, blockjoy, mitchell_state, block, ROT270, "Capcom", "Block Block (World 911106 Joystick)", MACHINE_SUPPORTS_SAVE ) | |
| 2371 | GAME( 1991, blockr2, block, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (World 910910)", MACHINE_SUPPORTS_SAVE ) | |
| 2372 | GAME( 1991, blockj, block, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (Japan 910910)", MACHINE_SUPPORTS_SAVE ) | |
| 2373 | GAME( 1991, blockbl, block, pangnv, block, mitchell_state, blockbl, ROT270, "bootleg", "Block Block (bootleg)", MACHINE_SUPPORTS_SAVE ) | |
| 2328 | GAME( 1988, mgakuen, 0, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Mahjong Gakuen", MACHINE_SUPPORTS_SAVE ) | |
| 2329 | GAME( 1988, 7toitsu, mgakuen, mgakuen, mgakuen, mitchell_state, mgakuen, ROT0, "Yuga", "Chi-Toitsu", MACHINE_SUPPORTS_SAVE ) | |
| 2330 | GAME( 1989, mgakuen2, 0, marukin, marukin, mitchell_state, mgakuen2, ROT0, "Face", "Mahjong Gakuen 2 Gakuen-chou no Fukushuu", MACHINE_SUPPORTS_SAVE ) | |
| 2331 | GAME( 1989, pkladies, 0, marukin, pkladies, mitchell_state, pkladies, ROT0, "Mitchell", "Poker Ladies", MACHINE_SUPPORTS_SAVE ) | |
| 2332 | GAME( 1989, pkladiesl, pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 510)", MACHINE_SUPPORTS_SAVE ) | |
| 2333 | GAME( 1989, pkladiesla,pkladies, marukin, pkladies, mitchell_state, pkladies, ROT0, "Leprechaun", "Poker Ladies (Leprechaun ver. 401)", MACHINE_SUPPORTS_SAVE ) | |
| 2334 | GAME( 1989, pkladiesbl,pkladies, pkladiesbl,pkladies, mitchell_state,pkladiesbl,ROT0, "bootleg", "Poker Ladies (Censored bootleg)", MACHINE_NOT_WORKING ) // by Playmark? need to figure out CPU 'decryption' / ordering | |
| 2335 | GAME( 1989, dokaben, 0, pang, pang, mitchell_state, dokaben, ROT0, "Capcom", "Dokaben (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2336 | GAME( 1989, pang, 0, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pang (World)", MACHINE_SUPPORTS_SAVE ) | |
| 2337 | GAME( 1989, bbros, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell (Capcom license)", "Buster Bros. (USA)", MACHINE_SUPPORTS_SAVE ) | |
| 2338 | GAME( 1989, pompingw, pang, pang, pang, mitchell_state, pang, ROT0, "Mitchell", "Pomping World (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2339 | GAME( 1989, pangb, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 1)", MACHINE_SUPPORTS_SAVE ) | |
| 2340 | GAME( 1989, pangbold, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 2)", MACHINE_SUPPORTS_SAVE ) | |
| 2341 | GAME( 1989, pangba, pang, spangbl, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 3)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) | |
| 2342 | GAME( 1989, pangb2, pang, pang, pang, mitchell_state, pangb, ROT0, "bootleg", "Pang (bootleg, set 4)", MACHINE_SUPPORTS_SAVE ) | |
| 2343 | GAME( 1989, cworld, 0, pang, qtono1, mitchell_state, cworld, ROT0, "Capcom", "Capcom World (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2344 | GAME( 1990, hatena, 0, pang, qtono1, mitchell_state, hatena, ROT0, "Capcom", "Adventure Quiz 2 - Hatena? no Daibouken (Japan 900228)", MACHINE_SUPPORTS_SAVE ) | |
| 2345 | GAME( 1990, spang, 0, pangnv, pang, mitchell_state, spang, ROT0, "Mitchell", "Super Pang (World 900914)", MACHINE_SUPPORTS_SAVE ) | |
| 2346 | GAME( 1990, sbbros, spang, pangnv, pang, mitchell_state, sbbros, ROT0, "Mitchell (Capcom license)", "Super Buster Bros. (USA 901001)", MACHINE_SUPPORTS_SAVE ) | |
| 2347 | GAME( 1990, spangj, spang, pangnv, pang, mitchell_state, spangj, ROT0, "Mitchell", "Super Pang (Japan 901023)", MACHINE_SUPPORTS_SAVE ) | |
| 2348 | GAME( 1990, spangbl, spang, spangbl, spangbl, mitchell_state, spangbl, ROT0, "bootleg", "Super Pang (World 900914, bootleg)", MACHINE_NO_SOUND | MACHINE_SUPPORTS_SAVE ) // different sound hardware | |
| 2349 | GAME( 1994, mstworld, 0, mstworld,mstworld, mitchell_state, mstworld, ROT0, "bootleg (TCH)", "Monsters World (bootleg of Super Pang)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) | |
| 2350 | GAME( 1990, marukin, 0, marukin, marukin, mitchell_state, marukin, ROT0, "Yuga", "Super Marukin-Ban (Japan 901017)", MACHINE_SUPPORTS_SAVE ) | |
| 2351 | GAME( 1991, qtono1, 0, pang, qtono1, mitchell_state, qtono1, ROT0, "Capcom", "Quiz Tonosama no Yabou (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2352 | GAME( 1991, qsangoku, 0, pang, qtono1, mitchell_state, qsangoku, ROT0, "Capcom", "Quiz Sangokushi (Japan)", MACHINE_SUPPORTS_SAVE ) | |
| 2353 | GAME( 1991, block, 0, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (World 910910)", MACHINE_SUPPORTS_SAVE ) | |
| 2354 | GAME( 1991, blockj, block, pangnv, block, mitchell_state, block, ROT270, "Capcom", "Block Block (Japan 910910)", MACHINE_SUPPORTS_SAVE ) | |
| 2355 | GAME( 1991, blockjoy, block, pangnv, blockjoy, mitchell_state, block, ROT270, "Capcom", "Block Block (World 911106 Joystick)", MACHINE_SUPPORTS_SAVE ) | |
| 2356 | GAME( 1991, blockbl, block, pangnv, block, mitchell_state, blockbl, ROT270, "bootleg", "Block Block (bootleg)", MACHINE_SUPPORTS_SAVE ) |
| r253556 | r253557 | |
|---|---|---|
| 513 | 513 | UINT8 *m_kanji_rom; |
| 514 | 514 | |
| 515 | 515 | UINT8 m_dma_offset[4]; |
| 516 | UINT8 m_dma_autoinc[4]; | |
| 517 | 516 | int m_dack; |
| 518 | 517 | |
| 519 | 518 | UINT8 m_video_ff[8],m_gfx_ff; |
| r253556 | r253557 | |
| 571 | 570 | UINT8 m_sys_type; |
| 572 | 571 | |
| 573 | 572 | DECLARE_WRITE_LINE_MEMBER( write_uart_clock ); |
| 574 | DECLARE_WRITE8_MEMBER(rtc_w); | |
| 575 | DECLARE_WRITE8_MEMBER(dmapg4_w); | |
| 576 | DECLARE_WRITE8_MEMBER(dmapg8_w); | |
| 573 | DECLARE_WRITE8_MEMBER(rtc_dmapg_w); | |
| 577 | 574 | DECLARE_WRITE8_MEMBER(nmi_ctrl_w); |
| 578 | 575 | DECLARE_WRITE8_MEMBER(vrtc_clear_w); |
| 579 | 576 | DECLARE_WRITE8_MEMBER(pc9801_video_ff_w); |
| r253556 | r253557 | |
| 978 | 975 | } |
| 979 | 976 | |
| 980 | 977 | |
| 981 | WRITE8_MEMBER(pc9801_state::rtc_w) | |
| 978 | WRITE8_MEMBER(pc9801_state::rtc_dmapg_w) | |
| 982 | 979 | { |
| 983 | m_rtc->c0_w((data & 0x01) >> 0); | |
| 984 | m_rtc->c1_w((data & 0x02) >> 1); | |
| 985 | m_rtc->c2_w((data & 0x04) >> 2); | |
| 986 | m_rtc->stb_w((data & 0x08) >> 3); | |
| 987 | m_rtc->clk_w((data & 0x10) >> 4); | |
| 988 | m_rtc->data_in_w(((data & 0x20) >> 5)); | |
| 989 | if(data & 0xc0) | |
| 990 | logerror("RTC write to undefined bits %02x\n",data & 0xc0); | |
| 980 | if((offset & 1) == 0) | |
| 981 | { | |
| 982 | if(offset == 0) | |
| 983 | { | |
| 984 | m_rtc->c0_w((data & 0x01) >> 0); | |
| 985 | m_rtc->c1_w((data & 0x02) >> 1); | |
| 986 | m_rtc->c2_w((data & 0x04) >> 2); | |
| 987 | m_rtc->stb_w((data & 0x08) >> 3); | |
| 988 | m_rtc->clk_w((data & 0x10) >> 4); | |
| 989 | m_rtc->data_in_w(((data & 0x20) >> 5)); | |
| 990 | if(data & 0xc0) | |
| 991 | logerror("RTC write to undefined bits %02x\n",data & 0xc0); | |
| 992 | } | |
| 993 | else | |
| 994 | logerror("Write to undefined port [%02x] <- %02x\n",offset+0x20,data); | |
| 995 | } | |
| 996 | else // odd | |
| 997 | { | |
| 998 | // logerror("Write to DMA bank register %d %02x\n",((offset >> 1)+1) & 3,data); | |
| 999 | m_dma_offset[((offset >> 1)+1) & 3] = data & 0x0f; | |
| 1000 | } | |
| 991 | 1001 | } |
| 992 | 1002 | |
| 993 | WRITE8_MEMBER(pc9801_state::dmapg4_w) | |
| 994 | { | |
| 995 | m_dma_offset[(offset+1) & 3] = data & 0x0f; | |
| 996 | } | |
| 997 | ||
| 998 | WRITE8_MEMBER(pc9801_state::dmapg8_w) | |
| 999 | { | |
| 1000 | if(offset == 4) | |
| 1001 | m_dma_autoinc[data & 3] = (data >> 2) & 3; | |
| 1002 | else if(offset < 4) | |
| 1003 | m_dma_offset[(offset+1) & 3] = data; | |
| 1004 | } | |
| 1005 | ||
| 1006 | 1003 | WRITE8_MEMBER(pc9801_state::nmi_ctrl_w) |
| 1007 | 1004 | { |
| 1008 | 1005 | m_nmi_ff = (offset & 2) >> 1; |
| r253556 | r253557 | |
| 1786 | 1783 | ADDRESS_MAP_UNMAP_HIGH |
| 1787 | 1784 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("i8237", am9517a_device, read, write, 0xff00) |
| 1788 | 1785 | AM_RANGE(0x0000, 0x000f) AM_READWRITE8(pic_r, pic_w, 0x00ff) // i8259 PIC (bit 3 ON slave / master) / i8237 DMA |
| 1789 | AM_RANGE(0x0020, 0x0021) AM_WRITE8(rtc_w,0x00ff) | |
| 1790 | AM_RANGE(0x0020, 0x0027) AM_WRITE8(dmapg4_w,0xff00) | |
| 1786 | AM_RANGE(0x0020, 0x0027) AM_WRITE8(rtc_dmapg_w,0xffff) // RTC / DMA registers (LS244) | |
| 1791 | 1787 | AM_RANGE(0x0030, 0x0037) AM_DEVREADWRITE8("ppi8255_sys", i8255_device, read, write, 0xff00) //i8251 RS232c / i8255 system port |
| 1792 | 1788 | AM_RANGE(0x0040, 0x0047) AM_DEVREADWRITE8("ppi8255_prn", i8255_device, read, write, 0x00ff) |
| 1793 | 1789 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("keyb", pc9801_kbd_device, rx_r, tx_w, 0xff00) //i8255 printer port / i8251 keyboard |
| r253556 | r253557 | |
| 2245 | 2241 | |
| 2246 | 2242 | static ADDRESS_MAP_START( pc9801ux_io, AS_IO, 16, pc9801_state ) |
| 2247 | 2243 | ADDRESS_MAP_UNMAP_HIGH |
| 2248 | AM_RANGE(0x0020, 0x002f) AM_WRITE8(dmapg8_w,0xff00) | |
| 2249 | 2244 | AM_RANGE(0x0050, 0x0057) AM_NOP // 2dd ppi? |
| 2250 | 2245 | AM_RANGE(0x005c, 0x005f) AM_READ(pc9821_timestamp_r) AM_WRITENOP // artic |
| 2251 | 2246 | AM_RANGE(0x0068, 0x006b) AM_WRITE8(pc9801rs_video_ff_w,0x00ff) //mode FF / <undefined> |
| r253556 | r253557 | |
| 2293 | 2288 | { |
| 2294 | 2289 | if(offset == 1) |
| 2295 | 2290 | { |
| 2296 | if(((data & 0xfe) == 4) && !m_ex_video_ff[3]) // TODO: many other settings are protected | |
| 2297 | return; | |
| 2298 | 2291 | m_ex_video_ff[(data & 0xfe) >> 1] = data & 1; |
| 2299 | 2292 | |
| 2300 | 2293 | //if((data & 0xfe) == 0x20) |
| r253556 | r253557 | |
| 2486 | 2479 | // ADDRESS_MAP_UNMAP_HIGH // TODO: a read to somewhere makes this to fail at POST |
| 2487 | 2480 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("i8237", am9517a_device, read, write, 0xff00ff00) |
| 2488 | 2481 | AM_RANGE(0x0000, 0x000f) AM_READWRITE8(pic_r, pic_w, 0x00ff00ff) // i8259 PIC (bit 3 ON slave / master) / i8237 DMA |
| 2489 | AM_RANGE(0x0020, 0x0023) AM_WRITE8(rtc_w,0x000000ff) | |
| 2490 | AM_RANGE(0x0020, 0x002f) AM_WRITE8(dmapg8_w,0xff00ff00) | |
| 2482 | AM_RANGE(0x0020, 0x0027) AM_WRITE8(rtc_dmapg_w, 0xffffffff) // RTC / DMA registers (LS244) | |
| 2491 | 2483 | AM_RANGE(0x0030, 0x0037) AM_DEVREADWRITE8("ppi8255_sys", i8255_device, read, write, 0xff00ff00) //i8251 RS232c / i8255 system port |
| 2492 | 2484 | AM_RANGE(0x0040, 0x0047) AM_DEVREADWRITE8("ppi8255_prn", i8255_device, read, write, 0x00ff00ff) |
| 2493 | 2485 | AM_RANGE(0x0040, 0x0043) AM_DEVREADWRITE8("keyb", pc9801_kbd_device, rx_r, tx_w, 0xff00ff00) //i8255 printer port / i8251 keyboard |
| r253556 | r253557 | |
| 2891 | 2883 | { |
| 2892 | 2884 | address_space &program = m_maincpu->space(AS_PROGRAM); |
| 2893 | 2885 | offs_t addr = (m_dma_offset[m_dack] << 16) | offset; |
| 2894 | if(offset == 0xffff) | |
| 2895 | { | |
| 2896 | switch(m_dma_autoinc[m_dack]) | |
| 2897 | { | |
| 2898 | case 1: | |
| 2899 | { | |
| 2900 | UINT8 page = m_dma_offset[m_dack]; | |
| 2901 | m_dma_offset[m_dack] = ((page + 1) & 0xf) | (page & 0xf0); | |
| 2902 | break; | |
| 2903 | } | |
| 2904 | case 3: | |
| 2905 | m_dma_offset[m_dack]++; | |
| 2906 | break; | |
| 2907 | } | |
| 2908 | } | |
| 2909 | 2886 | |
| 2910 | 2887 | // logerror("%08x\n",addr); |
| 2911 | 2888 | |
| r253556 | r253557 | |
| 2917 | 2894 | { |
| 2918 | 2895 | address_space &program = m_maincpu->space(AS_PROGRAM); |
| 2919 | 2896 | offs_t addr = (m_dma_offset[m_dack] << 16) | offset; |
| 2920 | if(offset == 0xffff) | |
| 2921 | { | |
| 2922 | switch(m_dma_autoinc[m_dack]) | |
| 2923 | { | |
| 2924 | case 1: | |
| 2925 | { | |
| 2926 | UINT8 page = m_dma_offset[m_dack]; | |
| 2927 | m_dma_offset[m_dack] = ((page + 1) & 0xf) | (page & 0xf0); | |
| 2928 | break; | |
| 2929 | } | |
| 2930 | case 3: | |
| 2931 | m_dma_offset[m_dack]++; | |
| 2932 | break; | |
| 2933 | } | |
| 2934 | } | |
| 2897 | ||
| 2935 | 2898 | // logerror("%08x %02x\n",addr,data); |
| 2936 | 2899 | |
| 2937 | 2900 | program.write_byte(addr, data); |
| r253556 | r253557 | |
| 3176 | 3139 | m_mouse.control = 0xff; |
| 3177 | 3140 | m_mouse.freq_reg = 0; |
| 3178 | 3141 | m_mouse.freq_index = 0; |
| 3179 | m_dma_autoinc[0] = m_dma_autoinc[1] = m_dma_autoinc[2] = m_dma_autoinc[3] = 0; | |
| 3180 | 3142 | memset(&m_egc, 0, sizeof(m_egc)); |
| 3181 | 3143 | } |
| 3182 | 3144 | |
| r253556 | r253557 | |
| 3468 | 3430 | |
| 3469 | 3431 | MCFG_RAM_ADD(RAM_TAG) |
| 3470 | 3432 | MCFG_RAM_DEFAULT_SIZE("1664K") |
| 3471 | MCFG_RAM_EXTRA_OPTIONS("640K,3712K,7808K | |
| 3433 | MCFG_RAM_EXTRA_OPTIONS("640K,3712K,7808K") | |
| 3472 | 3434 | |
| 3473 | 3435 | MCFG_DEVICE_MODIFY("upd7220_btm") |
| 3474 | 3436 | MCFG_DEVICE_ADDRESS_MAP(AS_0, upd7220_grcg_2_map) |
| r253556 | r253557 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | Games running on this hardware: |
| 12 | 12 | |
| 13 | * Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV), 199?, Sigma. | |
| 14 | * Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV, Harrah's GFX), 199?, Sigma. | |
| 15 | * Joker's Wild (B52 system, WP02001-054, Ver.031WM), 199?, Sigma. | |
| 16 | * Super 8 Ways FC (DB98103-011, Fruit combination), 1989, Sigma. | |
| 13 | * Joker's Wild (B52 system, set 1), 199?, Sigma. | |
| 14 | * Joker's Wild (B52 system, set 2), 199?, Sigma. | |
| 15 | * Joker's Wild (B52 system, Harrah's GFX), 199?, Sigma. | |
| 17 | 16 | |
| 18 | 17 | |
| 19 | 18 | The HD63484 ACRTC support is a bit hacky and incomplete, |
| r253556 | r253557 | |
| 619 | 618 | * Rom Load * |
| 620 | 619 | *************************/ |
| 621 | 620 | |
| 622 | /* Joker's Wild | |
| 623 | BP55114-V1104, Ver.054NMV | |
| 624 | Modern cards set. Normal cardsback. | |
| 625 | */ | |
| 626 | 621 | ROM_START( jwildb52 ) |
| 627 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 622 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 628 | 623 | ROM_LOAD( "poker.ic95", 0x00000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) ) |
| 629 | 624 | |
| 630 | 625 | ROM_REGION16_BE( 0x40000, "gfx1", 0 ) |
| r253556 | r253557 | |
| 641 | 636 | ROM_END |
| 642 | 637 | |
| 643 | 638 | |
| 644 | /* Joker's Wild | |
| 645 | BP55114-V1104, Ver.054NMV | |
| 646 | Modern cards set. Harrah's cardsback. | |
| 647 | */ | |
| 648 | ROM_START( jwildb52h ) | |
| 649 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 650 | ROM_LOAD( "jokers_wild_ver_xxx.ic95", 0x00000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) ) | |
| 651 | ||
| 652 | ROM_REGION16_BE( 0x40000, "gfx1", 0 ) | |
| 653 | ROM_LOAD32_BYTE( "2006-1_harrahs.ic45", 0x00003, 0x10000, CRC(6e6871dc) SHA1(5dfc99c808c06ec34838324181988d4550c1ed1a) ) | |
| 654 | ROM_LOAD32_BYTE( "2006-2_harrahs.ic46", 0x00001, 0x10000, CRC(1039c62d) SHA1(11f0dbcbbff5f6e9028a0305f7e16a0654be40d4) ) | |
| 655 | ROM_LOAD32_BYTE( "2006-3_harrahs.ic47", 0x00000, 0x10000, CRC(d66af95a) SHA1(70bba1aeea9221541b82642045ce8ecf26e1d08c) ) | |
| 656 | ROM_LOAD32_BYTE( "2006-4_harrahs.ic48", 0x00002, 0x10000, CRC(2bf196cb) SHA1(686ca0dd84c48f51efee5349ea3db65531dd4a52) ) | |
| 657 | ||
| 658 | ROM_REGION( 0x8000, "audiocpu", 0 ) | |
| 659 | ROM_LOAD( "poker-01-00.43", 0x0000, 0x8000, CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) ) | |
| 660 | ||
| 661 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 662 | ROM_LOAD( "mb7118.41", 0x0000, 0x0100, CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) ) | |
| 663 | ROM_END | |
| 664 | ||
| 665 | ||
| 666 | /* Joker's Wild | |
| 667 | WP02001-054, Ver.031WM | |
| 668 | Classic cards set. Normal cardsback. | |
| 669 | */ | |
| 670 | 639 | ROM_START( jwildb52a ) |
| 671 | 640 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 672 | 641 | ROM_LOAD( "sigm_wrk.bin", 0x00000, 0x10000, CRC(15c83c6c) SHA1(7a05bd94ea8b1ad051fbe6580a6550d4bb47dd15) ) |
| r253556 | r253557 | |
| 687 | 656 | ROM_END |
| 688 | 657 | |
| 689 | 658 | |
| 690 | /* Super 8 Ways FC | |
| 691 | Fruit combination. | |
| 692 | DB98103-011. | |
| 693 | */ | |
| 659 | ROM_START( jwildb52h ) | |
| 660 | ROM_REGION( 0x10000, "maincpu", 0 ) | |
| 661 | ROM_LOAD( "jokers_wild_ver_xxx.ic95", 0x00000, 0x10000, CRC(07eb9007) SHA1(ee814c40c6d8c9ea9e5246cae0cfa2c30f2976ed) ) | |
| 662 | ||
| 663 | ROM_REGION16_BE( 0x40000, "gfx1", 0 ) | |
| 664 | ROM_LOAD32_BYTE( "2006-1_harrahs.ic45", 0x00003, 0x10000, CRC(6e6871dc) SHA1(5dfc99c808c06ec34838324181988d4550c1ed1a) ) | |
| 665 | ROM_LOAD32_BYTE( "2006-2_harrahs.ic46", 0x00001, 0x10000, CRC(1039c62d) SHA1(11f0dbcbbff5f6e9028a0305f7e16a0654be40d4) ) | |
| 666 | ROM_LOAD32_BYTE( "2006-3_harrahs.ic47", 0x00000, 0x10000, CRC(d66af95a) SHA1(70bba1aeea9221541b82642045ce8ecf26e1d08c) ) | |
| 667 | ROM_LOAD32_BYTE( "2006-4_harrahs.ic48", 0x00002, 0x10000, CRC(2bf196cb) SHA1(686ca0dd84c48f51efee5349ea3db65531dd4a52) ) | |
| 668 | ||
| 669 | ROM_REGION( 0x8000, "audiocpu", 0 ) | |
| 670 | ROM_LOAD( "poker-01-00.43", 0x0000, 0x8000, CRC(2712d44c) SHA1(295526b27676cd97cbf111d47305d63c2b3ea50d) ) | |
| 671 | ||
| 672 | ROM_REGION( 0x0100, "proms", 0 ) | |
| 673 | ROM_LOAD( "mb7118.41", 0x0000, 0x0100, CRC(b362f9e2) SHA1(3963b40389ed6584e4cd96ab48849552857d99af) ) | |
| 674 | ROM_END | |
| 675 | ||
| 676 | ||
| 694 | 677 | ROM_START( s8waysfc ) |
| 695 | 678 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 696 | 679 | ROM_LOAD( "dv98103.011", 0x00000, 0x10000, CRC(416190a1) SHA1(e2738644efc6c2adcea2470b482f3f818ed9af8d) ) |
| r253556 | r253557 | |
| 715 | 698 | * Driver Init * |
| 716 | 699 | *************************/ |
| 717 | 700 | |
| 718 | DRIVER_INIT_MEMBER(sigmab52_state, | |
| 701 | DRIVER_INIT_MEMBER(sigmab52_state,jwildb52) | |
| 719 | 702 | { |
| 720 | 703 | } |
| 721 | 704 | |
| r253556 | r253557 | |
| 724 | 707 | * Game Drivers * |
| 725 | 708 | *************************/ |
| 726 | 709 | |
| 727 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ | |
| 728 | GAMEL( 199?, jwildb52, 0, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV)", MACHINE_NOT_WORKING, layout_sigmab52 ) | |
| 729 | GAMEL( 199?, jwildb52h, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, BP55114-V1104, Ver.054NMV, Harrah's GFX)", MACHINE_NOT_WORKING, layout_sigmab52 ) | |
| 730 | GAMEL( 199?, jwildb52a, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, WP02001-054, Ver.031WM)", MACHINE_NOT_WORKING, layout_sigmab52 ) | |
| 731 | GAME ( 1989, s8waysfc, 0, jwildb52, s8waysfc, sigmab52_state, jwildb52, ROT0, "Sigma", "Super 8 Ways FC (DB98103-011, Fruit combination)", MACHINE_NOT_WORKING ) | |
| 710 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS */ | |
| 711 | GAMEL( 199?, jwildb52, 0, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, set 1)", MACHINE_NOT_WORKING, layout_sigmab52 ) | |
| 712 | GAMEL( 199?, jwildb52a, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, set 2)", MACHINE_NOT_WORKING, layout_sigmab52 ) | |
| 713 | GAMEL( 199?, jwildb52h, jwildb52, jwildb52, jwildb52, sigmab52_state, jwildb52, ROT0, "Sigma", "Joker's Wild (B52 system, Harrah's GFX)", MACHINE_NOT_WORKING, layout_sigmab52 ) | |
| 714 | GAME ( 199?, s8waysfc, 0, jwildb52, s8waysfc, sigmab52_state, jwildb52, ROT0, "Sigma", "Super 8 Ways FC (Fruit combination)", MACHINE_NOT_WORKING ) |
| r253556 | r253557 | |
|---|---|---|
| 35 | 35 | ticalc1x_state(const machine_config &mconfig, device_type type, const char *tag) |
| 36 | 36 | : hh_tms1k_state(mconfig, type, tag) |
| 37 | 37 | { } |
| 38 | ||
| 39 | protected: | |
| 40 | virtual void machine_start() override; | |
| 38 | 41 | }; |
| 39 | 42 | |
| 40 | 43 | |
| 44 | void ticalc1x_state::machine_start() | |
| 45 | { | |
| 46 | hh_tms1k_state::machine_start(); | |
| 47 | memset(m_display_segmask, ~0, sizeof(m_display_segmask)); // ! | |
| 48 | } | |
| 41 | 49 | |
| 50 | ||
| 51 | ||
| 42 | 52 | /*************************************************************************** |
| 43 | 53 | |
| 44 | 54 | Minidrivers (subclass, I/O, Inputs, Machine Config) |
| r253556 | r253557 | |
| 75 | 85 | void tisr16_state::prepare_display() |
| 76 | 86 | { |
| 77 | 87 | // update leds state |
| 78 | set_display_segmask(0xfff, 0xff); | |
| 79 | display_matrix(8, 12, m_o, m_r, false); | |
| 88 | for (int y = 0; y < 11; y++) | |
| 89 | m_display_state[y] = (m_r >> y & 1) ? m_o : 0; | |
| 80 | 90 | |
| 81 | 91 | // exponent sign is from R10 O1, and R10 itself only uses segment G |
| 82 | 92 | m_display_state[11] = m_display_state[10] << 5 & 0x40; |
| 83 | 93 | m_display_state[10] &= 0x40; |
| 94 | ||
| 95 | set_display_size(8, 12); | |
| 84 | 96 | display_update(); |
| 85 | 97 | } |
| 86 | 98 | |
| 87 | 99 | WRITE16_MEMBER(tisr16_state::write_r) |
| 88 | 100 | { |
| 89 | // R0-R10: input mux, select digit | |
| 101 | // R0-R10: input mux | |
| 102 | // R0-R10: select digit (right-to-left) | |
| 90 | 103 | m_r = m_inp_mux = data; |
| 91 | 104 | prepare_display(); |
| 92 | 105 | } |
| r253556 | r253557 | |
| 246 | 259 | static MACHINE_CONFIG_START( tisr16, tisr16_state ) |
| 247 | 260 | |
| 248 | 261 | /* basic machine hardware */ |
| 249 | MCFG_CPU_ADD("maincpu", TMS1000, 300000) // | |
| 262 | MCFG_CPU_ADD("maincpu", TMS1000, 300000) // RC osc. R=43K, C=68pf -> ~300kHz (note: tisr16ii MCU RC osc. is different: R=30K, C=100pf -> also ~300kHz) | |
| 250 | 263 | MCFG_TMS1XXX_READ_K_CB(READ8(tisr16_state, read_k)) |
| 251 | 264 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(tisr16_state, write_o)) |
| 252 | 265 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(tisr16_state, write_r)) |
| r253556 | r253557 | |
| 302 | 315 | |
| 303 | 316 | WRITE16_MEMBER(ti1250_state::write_r) |
| 304 | 317 | { |
| 305 | // R0-R8: select digit | |
| 306 | set_display_segmask(0xff, 0xff); | |
| 307 | set_display_segmask(0x100, 0x40); // R8 only has segment G connected | |
| 308 | display_matrix(8, 9, m_o, data); | |
| 318 | // R8 only has segment G connected | |
| 319 | m_display_segmask[8] = 0x40; | |
| 320 | ||
| 321 | // R0-R7(,R8): select digit (right-to-left) | |
| 322 | display_matrix_seg(8, 9, m_o, data, 0xff); | |
| 309 | 323 | } |
| 310 | 324 | |
| 311 | 325 | WRITE16_MEMBER(ti1250_state::write_o) |
| r253556 | r253557 | |
| 384 | 398 | static MACHINE_CONFIG_START( ti1250, ti1250_state ) |
| 385 | 399 | |
| 386 | 400 | /* basic machine hardware */ |
| 387 | MCFG_CPU_ADD("maincpu", TMS0950, 200000) // | |
| 401 | MCFG_CPU_ADD("maincpu", TMS0950, 200000) // RC osc. R=68K, C=68pf -> ~200kHz | |
| 388 | 402 | MCFG_TMS1XXX_READ_K_CB(READ8(ti1250_state, read_k)) |
| 389 | 403 | MCFG_TMS1XXX_WRITE_O_CB(WRITE16(ti1250_state, write_o)) |
| 390 | 404 | MCFG_TMS1XXX_WRITE_R_CB(WRITE16(ti1250_state, write_r)) |
| r253556 | r253557 | |
| 437 | 451 | |
| 438 | 452 | WRITE16_MEMBER(ti1000_state::write_r) |
| 439 | 453 | { |
| 440 | // R0-R7: select digit | |
| 441 | set_display_segmask(0xff, 0xff); | |
| 442 | display_matrix(8, 8, m_o, data); | |
| 454 | // R0-R7: select digit (right-to-left) | |
| 455 | UINT8 o = BITSWAP8(m_o,7,4,3,2,1,0,6,5); | |
| 456 | display_matrix_seg(8, 8, o, data, 0xff); | |
| 443 | 457 | } |
| 444 | 458 | |
| 445 | 459 | WRITE16_MEMBER(ti1000_state::write_o) |
| r253556 | r253557 | |
| 447 | 461 | // O0-O3,O5(?): input mux |
| 448 | 462 | // O0-O7: digit segments |
| 449 | 463 | m_inp_mux = (data & 0xf) | (data >> 1 & 0x10); |
| 450 | m_o = | |
| 464 | m_o = data; | |
| 451 | 465 | } |
| 452 | 466 | |
| 453 | 467 | READ8_MEMBER(ti1000_state::read_k) |
| r253556 | r253557 | |
| 541 | 555 | |
| 542 | 556 | // 3rd digit only has A and G for =, though some newer hardware revisions |
| 543 | 557 | // (goes for both wizatron and lilprof) use a custom equals-sign digit here |
| 544 | | |
| 558 | m_display_segmask[3] = 0x41; | |
| 545 | 559 | |
| 546 | // R0-R8: select digit | |
| 547 | set_display_segmask(0x1ff^8, 0x7f); | |
| 548 | display_matrix(7, 9, m_o, data); | |
| 560 | // R0-R8: select digit (right-to-left) | |
| 561 | display_matrix_seg(7, 9, m_o, data, 0x7f); | |
| 549 | 562 | } |
| 550 | 563 | |
| 551 | 564 | WRITE16_MEMBER(wizatron_state::write_o) |
| r253556 | r253557 | |
| 712 | 725 | WRITE16_MEMBER(lilprof78_state::write_r) |
| 713 | 726 | { |
| 714 | 727 | // update leds state |
| 715 | UINT8 | |
| 728 | UINT8 o = BITSWAP8(m_o,7,4,3,2,1,0,6,5) & 0x7f; | |
| 716 | 729 | UINT16 r = (data & 7) | (data << 1 & 0x1f0); |
| 717 | set_display_segmask(0x1ff, 0x7f); | |
| 718 | display_matrix(7, 9, seg, r, false); | |
| 719 | ||
| 730 | ||
| 731 | for (int y = 0; y < 9; y++) | |
| 732 | m_display_state[y] = (r >> y & 1) ? o : 0; | |
| 733 | ||
| 720 | 734 | // 3rd digit A/G(equals sign) is from O7 |
| 721 | m_display_state[3] = (r | |
| 735 | m_display_state[3] = (r && m_o & 0x80) ? 0x41 : 0; | |
| 722 | 736 | |
| 723 | 737 | // 6th digit is a custom 7seg for math symbols (see wizatron_state write_r) |
| 724 | 738 | m_display_state[6] = BITSWAP8(m_display_state[6],7,6,1,4,2,3,5,0); |
| 739 | ||
| 740 | set_display_size(7, 9); | |
| 725 | 741 | display_update(); |
| 726 | 742 | } |
| 727 | 743 | |
| r253556 | r253557 | |
| 820 | 836 | void dataman_state::prepare_display() |
| 821 | 837 | { |
| 822 | 838 | // note the extra segment on R9 |
| 823 | set_display_segmask(0x1ff, 0x7f); | |
| 824 | display_matrix(8, 9, m_o | (m_r >> 2 & 0x80), m_r & 0x1ff); | |
| 839 | display_matrix_seg(8, 9, m_o | (m_r >> 2 & 0x80), m_r & 0x1ff, 0x7f); | |
| 825 | 840 | } |
| 826 | 841 | |
| 827 | 842 | WRITE16_MEMBER(dataman_state::write_r) |
| r253556 | r253557 | |
| 944 | 959 | |
| 945 | 960 | WRITE16_MEMBER(ti30_state::write_r) |
| 946 | 961 | { |
| 962 | // 1st digit only has segments B,F,G,DP | |
| 963 | m_display_segmask[0] = 0xe2; | |
| 964 | ||
| 947 | 965 | // R0-R8: select digit |
| 948 | set_display_segmask(0x1fe, 0xff); | |
| 949 | set_display_segmask(0x001, 0xe2); // 1st digit only has segments B,F,G,DP | |
| 950 | display_matrix(8, 9, m_o, data); | |
| 966 | UINT8 o = BITSWAP8(m_o,7,5,2,1,4,0,6,3); | |
| 967 | display_matrix_seg(8, 9, o, data, 0xff); | |
| 951 | 968 | } |
| 952 | 969 | |
| 953 | 970 | WRITE16_MEMBER(ti30_state::write_o) |
| r253556 | r253557 | |
| 955 | 972 | // O0-O2,O4-O7: input mux |
| 956 | 973 | // O0-O7: digit segments |
| 957 | 974 | m_inp_mux = (data & 7) | (data >> 1 & 0x78); |
| 958 | m_o = | |
| 975 | m_o = data; | |
| 959 | 976 | } |
| 960 | 977 | |
| 961 | 978 | READ8_MEMBER(ti30_state::read_k) |
| r253556 | r253557 | |
| 1367 | 1384 | |
| 1368 | 1385 | COMP( 1977, dataman, 0, 0, dataman, dataman, driver_device, 0, "Texas Instruments", "DataMan", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) |
| 1369 | 1386 | |
| 1370 | COMP( 1976, ti30, 0, 0, ti30, ti30, driver_device, 0, "Texas Instruments", "TI-30", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) | |
| 1371 | COMP( 1976, tibusan, 0, 0, ti30, tibusan, driver_device, 0, "Texas Instruments", "TI Business Analyst", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) | |
| 1372 | COMP( 1977, tiprog, 0, 0, ti30, tiprog, driver_device, 0, "Texas Instruments", "TI Programmer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) | |
| 1387 | COMP( 1976, ti30, 0, 0, ti30, ti30, driver_device, 0, "Texas Instruments", "TI-30", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) | |
| 1388 | COMP( 1976, tibusan, 0, 0, ti30, tibusan, driver_device, 0, "Texas Instruments", "TI Business Analyst", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) | |
| 1389 | COMP( 1977, tiprog, 0, 0, ti30, tiprog, driver_device, 0, "Texas Instruments", "TI Programmer", MACHINE_SUPPORTS_SAVE | MACHINE_NO_SOUND_HW ) |
| r253556 | r253557 | |
|---|---|---|
| 11 | 11 | public: |
| 12 | 12 | blmbycar_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 13 | : driver_device(mconfig, type, tag), |
| 14 | m_maincpu(*this, "maincpu"), | |
| 15 | m_gfxdecode(*this, "gfxdecode"), | |
| 16 | m_palette(*this, "palette"), | |
| 17 | 14 | m_vram_1(*this, "vram_1"), |
| 18 | 15 | m_vram_0(*this, "vram_0"), |
| 19 | 16 | m_scroll_1(*this, "scroll_1"), |
| 20 | 17 | m_scroll_0(*this, "scroll_0"), |
| 21 | m_spriteram(*this, "spriteram") { } | |
| 18 | m_spriteram(*this, "spriteram"), | |
| 19 | m_maincpu(*this, "maincpu"), | |
| 20 | m_gfxdecode(*this, "gfxdecode"), | |
| 21 | m_palette(*this, "palette") { } | |
| 22 | 22 | |
| 23 | /* devices */ | |
| 24 | required_device<cpu_device> m_maincpu; | |
| 25 | required_device<gfxdecode_device> m_gfxdecode; | |
| 26 | required_device<palette_device> m_palette; | |
| 27 | ||
| 28 | 23 | /* memory pointers */ |
| 29 | 24 | required_shared_ptr<UINT16> m_vram_1; |
| 30 | 25 | required_shared_ptr<UINT16> m_vram_0; |
| r253556 | r253557 | |
| 40 | 35 | UINT8 m_pot_wheel; // blmbycar |
| 41 | 36 | int m_old_val; // blmbycar |
| 42 | 37 | int m_retvalue; // waterball |
| 43 | ||
| 44 | // common | |
| 45 | DECLARE_WRITE16_MEMBER(okibank_w); | |
| 46 | DECLARE_WRITE16_MEMBER(vram_0_w); | |
| 47 | DECLARE_WRITE16_MEMBER(vram_1_w); | |
| 48 | ||
| 49 | // blmbycar | |
| 38 | DECLARE_WRITE16_MEMBER(blmbycar_okibank_w); | |
| 50 | 39 | DECLARE_WRITE16_MEMBER(blmbycar_pot_wheel_reset_w); |
| 51 | 40 | DECLARE_WRITE16_MEMBER(blmbycar_pot_wheel_shift_w); |
| 52 | 41 | DECLARE_READ16_MEMBER(blmbycar_pot_wheel_r); |
| 53 | 42 | DECLARE_READ16_MEMBER(blmbycar_opt_wheel_r); |
| 54 | ||
| 55 | // waterball | |
| 56 | 43 | DECLARE_READ16_MEMBER(waterball_unk_r); |
| 57 | ||
| 44 | DECLARE_WRITE16_MEMBER(blmbycar_vram_0_w); | |
| 45 | DECLARE_WRITE16_MEMBER(blmbycar_vram_1_w); | |
| 46 | DECLARE_DRIVER_INIT(blmbycar); | |
| 58 | 47 | TILE_GET_INFO_MEMBER(get_tile_info_0); |
| 59 | 48 | TILE_GET_INFO_MEMBER(get_tile_info_1); |
| 60 | ||
| 61 | DECLARE_DRIVER_INIT(blmbycar); | |
| 62 | 49 | virtual void video_start() override; |
| 63 | 50 | DECLARE_MACHINE_START(blmbycar); |
| 64 | 51 | DECLARE_MACHINE_RESET(blmbycar); |
| 65 | 52 | DECLARE_MACHINE_START(watrball); |
| 66 | 53 | DECLARE_MACHINE_RESET(watrball); |
| 67 | ||
| 68 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 54 | UINT32 screen_update_blmbycar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 69 | 55 | void draw_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 56 | required_device<cpu_device> m_maincpu; | |
| 57 | required_device<gfxdecode_device> m_gfxdecode; | |
| 58 | required_device<palette_device> m_palette; | |
| 70 | 59 | }; |
| r253556 | r253557 | |
|---|---|---|
| 62 | 62 | void display_update(); |
| 63 | 63 | void set_display_size(int maxx, int maxy); |
| 64 | 64 | void set_display_segmask(UINT32 digits, UINT32 mask); |
| 65 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 65 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); | |
| 66 | 66 | |
| 67 | 67 | protected: |
| 68 | 68 | virtual void machine_start() override; |
| r253556 | r253557 | |
|---|---|---|
| 11 | 11 | public: |
| 12 | 12 | glass_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 13 | : driver_device(mconfig, type, tag), |
| 14 | m_maincpu(*this, "maincpu"), | |
| 15 | m_gfxdecode(*this, "gfxdecode"), | |
| 16 | m_palette(*this, "palette"), | |
| 17 | 14 | m_videoram(*this, "videoram"), |
| 18 | 15 | m_vregs(*this, "vregs"), |
| 19 | 16 | m_spriteram(*this, "spriteram"), |
| 20 | m_mainram(*this, "mainram") { } | |
| 21 | ||
| 17 | m_mainram(*this, "mainram"), | |
| 18 | m_maincpu(*this, "maincpu"), | |
| 19 | m_gfxdecode(*this, "gfxdecode"), | |
| 20 | m_palette(*this, "palette") { } | |
| 22 | 21 | |
| 23 | /* devices */ | |
| 24 | required_device<cpu_device> m_maincpu; | |
| 25 | required_device<gfxdecode_device> m_gfxdecode; | |
| 26 | required_device<palette_device> m_palette; | |
| 27 | ||
| 28 | 22 | /* memory pointers */ |
| 29 | 23 | required_shared_ptr<UINT16> m_videoram; |
| 30 | 24 | required_shared_ptr<UINT16> m_vregs; |
| r253556 | r253557 | |
| 40 | 34 | int m_current_command; |
| 41 | 35 | int m_cause_interrupt; |
| 42 | 36 | int m_blitter_serial_buffer[5]; |
| 43 | ||
| 44 | 37 | DECLARE_WRITE16_MEMBER(clr_int_w); |
| 45 | 38 | DECLARE_WRITE16_MEMBER(OKIM6295_bankswitch_w); |
| 46 | DECLARE_WRITE16_MEMBER(coin_w); | |
| 47 | DECLARE_WRITE16_MEMBER(blitter_w); | |
| 48 | DECLARE_WRITE16_MEMBER(vram_w); | |
| 49 | DECLARE_READ16_MEMBER(mainram_r); | |
| 50 | DECLARE_WRITE16_MEMBER(mainram_w); | |
| 39 | DECLARE_WRITE16_MEMBER(glass_coin_w); | |
| 40 | DECLARE_WRITE16_MEMBER(glass_blitter_w); | |
| 41 | DECLARE_WRITE16_MEMBER(glass_vram_w); | |
| 51 | 42 | |
| 43 | DECLARE_READ16_MEMBER( glass_mainram_r ); | |
| 44 | DECLARE_WRITE16_MEMBER( glass_mainram_w ); | |
| 45 | ||
| 52 | 46 | DECLARE_DRIVER_INIT(glass); |
| 53 | 47 | DECLARE_DRIVER_INIT(glassp); |
| 48 | TILE_GET_INFO_MEMBER(get_tile_info_glass_screen0); | |
| 49 | TILE_GET_INFO_MEMBER(get_tile_info_glass_screen1); | |
| 54 | 50 | virtual void machine_start() override; |
| 55 | 51 | virtual void machine_reset() override; |
| 56 | 52 | virtual void video_start() override; |
| 57 | ||
| 58 | TILE_GET_INFO_MEMBER(get_tile_info_screen0); | |
| 59 | TILE_GET_INFO_MEMBER(get_tile_info_screen1); | |
| 60 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 61 | INTERRUPT_GEN_MEMBER(interrupt); | |
| 53 | UINT32 screen_update_glass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); | |
| 54 | INTERRUPT_GEN_MEMBER(glass_interrupt); | |
| 62 | 55 | void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); |
| 63 | void ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 ); | |
| 56 | void glass_ROM16_split_gfx( const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 ); | |
| 57 | required_device<cpu_device> m_maincpu; | |
| 58 | required_device<gfxdecode_device> m_gfxdecode; | |
| 59 | required_device<palette_device> m_palette; | |
| 64 | 60 | }; |
| r253556 | r253557 | |
|---|---|---|
| 62 | 62 | void display_update(); |
| 63 | 63 | void set_display_size(int maxx, int maxy); |
| 64 | 64 | void set_display_segmask(UINT32 digits, UINT32 mask); |
| 65 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety, bool update = true); | |
| 65 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); | |
| 66 | void display_matrix_seg(int maxx, int maxy, UINT32 setx, UINT32 sety, UINT16 segmask); | |
| 66 | 67 | |
| 67 | 68 | protected: |
| 68 | 69 | virtual void machine_start() override; |
| r253556 | r253557 | |
|---|---|---|
| 55 | 55 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 56 | 56 | void display_update(); |
| 57 | 57 | void set_display_size(int maxx, int maxy); |
| 58 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety | |
| 58 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); | |
| 59 | 59 | |
| 60 | 60 | protected: |
| 61 | 61 | virtual void machine_start() override; |
| r253556 | r253557 | |
|---|---|---|
| 188 | 188 | ENDPOINT=5 |
| 189 | 189 | }; |
| 190 | 190 | |
| 191 | enum USBRequestType | |
| 192 | { | |
| 193 | StandardType=0, | |
| 194 | ClassType, | |
| 195 | VendorType, | |
| 196 | ReservedType | |
| 197 | }; | |
| 198 | ||
| 199 | enum USBRequestRecipient | |
| 200 | { | |
| 201 | DeviceRecipient=0, | |
| 202 | InterfaceRecipient, | |
| 203 | EndpointRecipient, | |
| 204 | OtherRecipient | |
| 205 | }; | |
| 206 | ||
| 207 | enum USBDeviceState | |
| 208 | { | |
| 209 | DefaultState, | |
| 210 | AddressState, | |
| 211 | ConfiguredState | |
| 212 | }; | |
| 213 | ||
| 214 | 191 | class ohci_function_device { |
| 215 | 192 | public: |
| 216 | 193 | ohci_function_device(running_machine &machine); |
| r253556 | r253557 | |
| 221 | 198 | void add_configuration_descriptor(USBStandardConfigurationDescriptor &descriptor); |
| 222 | 199 | void add_interface_descriptor(USBStandardInterfaceDescriptor &descriptor); |
| 223 | 200 | void add_endpoint_descriptor(USBStandardEndpointDescriptor &descriptor); |
| 224 | int handle_nonstandard_request(USBSetupPacket *setup); | |
| 225 | int state; | |
| 226 | 201 | int address; |
| 227 | 202 | int newaddress; |
| 228 | 203 | int controldirection; |
| 229 | 204 | int controltype; |
| 230 | 205 | int controlrecipient; |
| 231 | int configurationvalue; | |
| 232 | 206 | bool settingaddress; |
| 233 | 207 | int remain; |
| 234 | 208 | UINT8 *position; |
| r253556 | r253557 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | ||
| 4 | <!-- define elements --> | |
| 5 | ||
| 6 | <element name="static_black"><rect><color red="0.0" green="0.0" blue="0.0" /></rect></element> | |
| 7 | <element name="static_white"><rect><color red="0.8" green="0.8" blue="0.8" /></rect></element> | |
| 8 | <element name="static_green"><rect><color red="0.1" green="0.5" blue="0.2" /></rect></element> | |
| 9 | ||
| 10 | <element name="text_down"> | |
| 11 | <rect><color red="0.1" green="0.5" blue="0.2" /></rect> | |
| 12 | <text string="DOWN"><color red="0.8" green="0.8" blue="0.8" /></text> | |
| 13 | </element> | |
| 14 | <element name="text_home"> | |
| 15 | <rect><color red="0.1" green="0.5" blue="0.2" /></rect> | |
| 16 | <text string="HOME"><color red="0.8" green="0.8" blue="0.8" /></text> | |
| 17 | </element> | |
| 18 | <element name="text_yards"> | |
| 19 | <rect><color red="0.1" green="0.5" blue="0.2" /></rect> | |
| 20 | <text string="YARDS TO GO"><color red="0.8" green="0.8" blue="0.8" /></text> | |
| 21 | </element> | |
| 22 | <element name="text_time"> | |
| 23 | <rect><color red="0.1" green="0.5" blue="0.2" /></rect> | |
| 24 | <text string="TIME REMAINING"><color red="0.8" green="0.8" blue="0.8" /></text> | |
| 25 | </element> | |
| 26 | <element name="text_field"> | |
| 27 | <rect><color red="0.1" green="0.5" blue="0.2" /></rect> | |
| 28 | <text string="FIELD POSITION"><color red="0.8" green="0.8" blue="0.8" /></text> | |
| 29 | </element> | |
| 30 | <element name="text_visitor"> | |
| 31 | <rect><color red="0.1" green="0.5" blue="0.2" /></rect> | |
| 32 | <text string="VISITOR"><color red="0.8" green="0.8" blue="0.8" /></text> | |
| 33 | </element> | |
| 34 | ||
| 35 | <element name="text_p1"> | |
| 36 | <rect><color red="0.06" green="0.3" blue="0.12" /></rect> | |
| 37 | <text string="PL SEL:"> | |
| 38 | <bounds x="0.0" y="0.17" width="1.0" height="0.6" /> | |
| 39 | <color red="0.7" green="0.7" blue="0.8" /> | |
| 40 | </text> | |
| 41 | </element> | |
| 42 | <element name="text_p2" defstate="0"> | |
| 43 | <rect><color red="0.06" green="0.3" blue="0.12" /></rect> | |
| 44 | <text state="0" string="RUN"> | |
| 45 | <bounds x="0.0" y="0.17" width="1.0" height="0.6" /> | |
| 46 | <color red="0.82" green="0.82" blue="0.82" /> | |
| 47 | </text> | |
| 48 | <text state="1" string="PASS"> | |
| 49 | <bounds x="0.0" y="0.17" width="1.0" height="0.6" /> | |
| 50 | <color red="0.82" green="0.82" blue="0.82" /> | |
| 51 | </text> | |
| 52 | </element> | |
| 53 | ||
| 54 | <element name="digit" defstate="0"> | |
| 55 | <led7seg><color red="1.0" green="0.25" blue="0.26" /></led7seg> | |
| 56 | </element> | |
| 57 | <element name="seg" defstate="0"> | |
| 58 | <rect state="0"><color red="0.13" green="0.0325" blue="0.0338" /></rect> | |
| 59 | <rect state="1"><color red="1.0" green="0.25" blue="0.26" /></rect> | |
| 60 | </element> | |
| 61 | ||
| 62 | ||
| 63 | <!-- build screen --> | |
| 64 | ||
| 65 | <view name="Internal Layout"> | |
| 66 | <bounds left="-9" right="393" top="-104" bottom="186" /> | |
| 67 | <bezel element="static_black"> | |
| 68 | <bounds left="-9" right="393" top="-104" bottom="186" /> | |
| 69 | </bezel> | |
| 70 | ||
| 71 | <!-- bezel --> | |
| 72 | ||
| 73 | <bezel element="static_green"><bounds left="-9" right="393" top="-110" bottom="-60" /></bezel> | |
| 74 | <bezel element="static_green"><bounds left="-9" right="393" top="111" bottom="200" /></bezel> | |
| 75 | ||
| 76 | <bezel element="static_white"><bounds x="-10" y="-84" width="404" height="3" /></bezel> | |
| 77 | <bezel element="text_down"><bounds x="5" y="-92" width="66" height="19" /></bezel> | |
| 78 | <bezel element="text_field"><bounds x="122" y="-92" width="140" height="19" /></bezel> | |
| 79 | <bezel element="text_yards"><bounds x="286" y="-92" width="111" height="19" /></bezel> | |
| 80 | ||
| 81 | <bezel element="static_white"><bounds x="-10" y="141" width="404" height="3" /></bezel> | |
| 82 | <bezel element="text_home"><bounds x="5" y="133" width="66" height="19" /></bezel> | |
| 83 | <bezel element="text_time"><bounds x="122" y="133" width="140" height="19" /></bezel> | |
| 84 | <bezel element="text_visitor"><bounds x="306" y="133" width="80" height="19" /></bezel> | |
| 85 | ||
| 86 | <bezel element="text_p1"><bounds x="316" y="161" width="40" height="16" /></bezel> | |
| 87 | <bezel element="text_p2" inputtag="IN.0" inputmask="0x04"> | |
| 88 | <bounds x="354" y="161" width="35" height="16" /> | |
| 89 | </bezel> | |
| 90 | ||
| 91 | <bezel element="static_white"><bounds left="-9" right="393" top="-61" bottom="-51" /></bezel> | |
| 92 | <bezel element="static_white"><bounds left="-9" right="393" top="110" bottom="120" /></bezel> | |
| 93 | ||
| 94 | <bezel element="static_white"><bounds x="-9" y="-52" width="4" height="163" /></bezel> | |
| 95 | <bezel element="static_white"><bounds x="37" y="-52" width="2" height="163" /></bezel> | |
| 96 | <bezel element="static_white"><bounds x="81" y="-52" width="2" height="163" /></bezel> | |
| 97 | <bezel element="static_white"><bounds x="125" y="-52" width="2" height="163" /></bezel> | |
| 98 | <bezel element="static_white"><bounds x="169" y="-52" width="2" height="163" /></bezel> | |
| 99 | <bezel element="static_white"><bounds x="213" y="-52" width="2" height="163" /></bezel> | |
| 100 | <bezel element="static_white"><bounds x="257" y="-52" width="2" height="163" /></bezel> | |
| 101 | <bezel element="static_white"><bounds x="301" y="-52" width="2" height="163" /></bezel> | |
| 102 | <bezel element="static_white"><bounds x="345" y="-52" width="2" height="163" /></bezel> | |
| 103 | <bezel element="static_white"><bounds x="389" y="-52" width="4" height="163" /></bezel> | |
| 104 | ||
| 105 | <bezel element="static_white"><bounds x="-8" y="2" width="4" height="1" /></bezel> | |
| 106 | <bezel element="static_white"><bounds x="-8" y="29" width="4" height="1" /></bezel> | |
| 107 | <bezel element="static_white"><bounds x="-8" y="56" width="4" height="1" /></bezel> | |
| 108 | ||
| 109 | <bezel element="static_white"><bounds x="36" y="2" width="4" height="1" /></bezel> | |
| 110 | <bezel element="static_white"><bounds x="36" y="29" width="4" height="1" /></bezel> | |
| 111 | <bezel element="static_white"><bounds x="36" y="56" width="4" height="1" /></bezel> | |
| 112 | ||
| 113 | <bezel element="static_white"><bounds x="80" y="2" width="4" height="1" /></bezel> | |
| 114 | <bezel element="static_white"><bounds x="80" y="29" width="4" height="1" /></bezel> | |
| 115 | <bezel element="static_white"><bounds x="80" y="56" width="4" height="1" /></bezel> | |
| 116 | ||
| 117 | <bezel element="static_white"><bounds x="124" y="2" width="4" height="1" /></bezel> | |
| 118 | <bezel element="static_white"><bounds x="124" y="29" width="4" height="1" /></bezel> | |
| 119 | <bezel element="static_white"><bounds x="124" y="56" width="4" height="1" /></bezel> | |
| 120 | ||
| 121 | <bezel element="static_white"><bounds x="168" y="2" width="4" height="1" /></bezel> | |
| 122 | <bezel element="static_white"><bounds x="168" y="29" width="4" height="1" /></bezel> | |
| 123 | <bezel element="static_white"><bounds x="168" y="56" width="4" height="1" /></bezel> | |
| 124 | ||
| 125 | <bezel element="static_white"><bounds x="212" y="2" width="4" height="1" /></bezel> | |
| 126 | <bezel element="static_white"><bounds x="212" y="29" width="4" height="1" /></bezel> | |
| 127 | <bezel element="static_white"><bounds x="212" y="56" width="4" height="1" /></bezel> | |
| 128 | ||
| 129 | <bezel element="static_white"><bounds x="256" y="2" width="4" height="1" /></bezel> | |
| 130 | <bezel element="static_white"><bounds x="256" y="29" width="4" height="1" /></bezel> | |
| 131 | <bezel element="static_white"><bounds x="256" y="56" width="4" height="1" /></bezel> | |
| 132 | ||
| 133 | <bezel element="static_white"><bounds x="300" y="2" width="4" height="1" /></bezel> | |
| 134 | <bezel element="static_white"><bounds x="300" y="29" width="4" height="1" /></bezel> | |
| 135 | <bezel element="static_white"><bounds x="300" y="56" width="4" height="1" /></bezel> | |
| 136 | ||
| 137 | <bezel element="static_white"><bounds x="344" y="2" width="4" height="1" /></bezel> | |
| 138 | <bezel element="static_white"><bounds x="344" y="29" width="4" height="1" /></bezel> | |
| 139 | <bezel element="static_white"><bounds x="344" y="56" width="4" height="1" /></bezel> | |
| 140 | ||
| 141 | <bezel element="static_white"><bounds x="388" y="2" width="4" height="1" /></bezel> | |
| 142 | <bezel element="static_white"><bounds x="388" y="29" width="4" height="1" /></bezel> | |
| 143 | <bezel element="static_white"><bounds x="388" y="56" width="4" height="1" /></bezel> | |
| 144 | ||
| 145 | <!-- leds --> | |
| 146 | ||
| 147 | <bezel name="digit8" element="digit"><bounds x="3" y="-15.5" width="24" height="32" /></bezel> | |
| 148 | <bezel name="8.8" element="seg"><bounds x="7" y="42.5" width="15" height="3" /></bezel> | |
| 149 | <bezel name="8.9" element="seg"><bounds x="7" y="71.5" width="15" height="3" /></bezel> | |
| 150 | ||
| 151 | <bezel name="digit7" element="digit"><bounds x="47" y="-15.5" width="24" height="32" /></bezel> | |
| 152 | <bezel name="7.8" element="seg"><bounds x="51" y="42.5" width="15" height="3" /></bezel> | |
| 153 | <bezel name="7.9" element="seg"><bounds x="51" y="71.5" width="15" height="3" /></bezel> | |
| 154 | ||
| 155 | <bezel name="digit6" element="digit"><bounds x="91" y="-15.5" width="24" height="32" /></bezel> | |
| 156 | <bezel name="6.8" element="seg"><bounds x="95" y="42.5" width="15" height="3" /></bezel> | |
| 157 | <bezel name="6.9" element="seg"><bounds x="95" y="71.5" width="15" height="3" /></bezel> | |
| 158 | ||
| 159 | <bezel name="digit5" element="digit"><bounds x="135" y="-15.5" width="24" height="32" /></bezel> | |
| 160 | <bezel name="5.8" element="seg"><bounds x="139" y="42.5" width="15" height="3" /></bezel> | |
| 161 | <bezel name="5.9" element="seg"><bounds x="139" y="71.5" width="15" height="3" /></bezel> | |
| 162 | ||
| 163 | <bezel name="digit4" element="digit"><bounds x="179" y="-15.5" width="24" height="32" /></bezel> | |
| 164 | <bezel name="4.8" element="seg"><bounds x="183" y="42.5" width="15" height="3" /></bezel> | |
| 165 | <bezel name="4.9" element="seg"><bounds x="183" y="71.5" width="15" height="3" /></bezel> | |
| 166 | ||
| 167 | <bezel name="digit3" element="digit"><bounds x="223" y="-15.5" width="24" height="32" /></bezel> | |
| 168 | <bezel name="3.8" element="seg"><bounds x="227" y="42.5" width="15" height="3" /></bezel> | |
| 169 | <bezel name="3.9" element="seg"><bounds x="227" y="71.5" width="15" height="3" /></bezel> | |
| 170 | ||
| 171 | <bezel name="digit2" element="digit"><bounds x="267" y="-15.5" width="24" height="32" /></bezel> | |
| 172 | <bezel name="2.8" element="seg"><bounds x="271" y="42.5" width="15" height="3" /></bezel> | |
| 173 | <bezel name="2.9" element="seg"><bounds x="271" y="71.5" width="15" height="3" /></bezel> | |
| 174 | ||
| 175 | <bezel name="digit1" element="digit"><bounds x="311" y="-15.5" width="24" height="32" /></bezel> | |
| 176 | <bezel name="1.8" element="seg"><bounds x="315" y="42.5" width="15" height="3" /></bezel> | |
| 177 | <bezel name="1.9" element="seg"><bounds x="315" y="71.5" width="15" height="3" /></bezel> | |
| 178 | ||
| 179 | <bezel name="digit0" element="digit"><bounds x="355" y="-15.5" width="24" height="32" /></bezel> | |
| 180 | <bezel name="0.8" element="seg"><bounds x="359" y="42.5" width="15" height="3" /></bezel> | |
| 181 | <bezel name="0.9" element="seg"><bounds x="359" y="71.5" width="15" height="3" /></bezel> | |
| 182 | ||
| 183 | ||
| 184 | </view> | |
| 185 | </mamelayout> |
| r253556 | r253557 | |
|---|---|---|
| 12 | 12 | <led7seg><color red="1.0" green="0.25" blue="0.20" /></led7seg> |
| 13 | 13 | </element> |
| 14 | 14 | |
| 15 | <element name="l | |
| 15 | <element name="lamp" defstate="0"> | |
| 16 | 16 | <disk state="1"><color red="1.0" green="0.25" blue="0.20" /></disk> |
| 17 | 17 | <disk state="0"><color red="0.2" green="0.0" blue="0.0" /></disk> |
| 18 | 18 | </element> |
| r253556 | r253557 | |
| 56 | 56 | </element> |
| 57 | 57 | |
| 58 | 58 | |
| 59 | ||
| 59 | 60 | <!-- build screen --> |
| 60 | 61 | |
| 61 | 62 | <view name="Internal Layout"> |
| r253556 | r253557 | |
| 86 | 87 | <bezel element="text_depth"><bounds x="21" y="37" width="20" height="7" /></bezel> |
| 87 | 88 | <bezel element="text_range"><bounds x="57" y="37" width="20" height="7" /></bezel> |
| 88 | 89 | |
| 90 | ||
| 89 | 91 | <bezel name="digit5" element="digit"> |
| 90 | 92 | <bounds x="5" y="17" width="10" height="15" /> |
| 91 | 93 | </bezel> |
| r253556 | r253557 | |
| 107 | 109 | <bounds x="77" y="17" width="10" height="15" /> |
| 108 | 110 | </bezel> |
| 109 | 111 | |
| 112 | ||
| 110 | 113 | <!-- compass --> |
| 111 | 114 | |
| 112 | 115 | <bezel element="static_gray"><bounds x="0" y="50" width="100" height="100" /></bezel> |
| 113 | 116 | <bezel element="static_red"><bounds x="0" y="55" width="100" height="86" /></bezel> |
| 114 | 117 | |
| 115 | <bezel name="6.a" element="led"><bounds x="42" y="62" width="8" height="8" /></bezel> | |
| 116 | <bezel name="7.a" element="led"><bounds x="42" y="126" width="8" height="8" /></bezel> | |
| 117 | <bezel name="8.a" element="led"><bounds x="74" y="94" width="8" height="8" /></bezel> | |
| 118 | <bezel name="9.a" element="led"><bounds x="10" y="94" width="8" height="8" /></bezel> | |
| 118 | <bezel name="lamp60" element="lamp"> | |
| 119 | <bounds x="42" y="62" width="8" height="8" /> | |
| 120 | </bezel> | |
| 121 | <bezel name="lamp61" element="lamp"> | |
| 122 | <bounds x="42" y="126" width="8" height="8" /> | |
| 123 | </bezel> | |
| 124 | <bezel name="lamp62" element="lamp"> | |
| 125 | <bounds x="74" y="94" width="8" height="8" /> | |
| 126 | </bezel> | |
| 127 | <bezel name="lamp63" element="lamp"> | |
| 128 | <bounds x="10" y="94" width="8" height="8" /> | |
| 129 | </bezel> | |
| 119 | 130 | |
| 120 | 131 | <bezel element="text_n"><bounds x="41" y="72" width="10" height="10" /></bezel> |
| 121 | 132 | <bezel element="text_s"><bounds x="41" y="114" width="10" height="10" /></bezel> |
| 122 | 133 | <bezel element="text_e"><bounds x="63" y="93" width="10" height="10" /></bezel> |
| 123 | 134 | <bezel element="text_w"><bounds x="21" y="93" width="10" height="10" /></bezel> |
| 124 | 135 | |
| 136 | ||
| 125 | 137 | <!-- crop borders --> |
| 126 | 138 | |
| 127 | 139 | <bezel element="static_black"><bounds x="92" y="0" width="10" height="160" /></bezel> |
| 128 | 140 | <bezel element="static_black"><bounds x="0" y="146" width="100" height="10" /></bezel> |
| 129 | 141 | |
| 130 | ||
| 131 | 142 | </view> |
| 132 | 143 | </mamelayout> |
| r253556 | r253557 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | ||
| 4 | <!-- define elements --> | |
| 5 | ||
| 6 | <element name="static_blue"><rect><color red="0.1" green="0.25" blue="0.5" /></rect></element> | |
| 7 | <element name="static_blue2"><rect><color red="0.04" green="0.1" blue="0.2" /></rect></element> | |
| 8 | <element name="disk_cyan"><disk><color red="0.0" green="0.75" blue="1.0" /></disk></element> | |
| 9 | <element name="disk_white"><disk><color red="0.8" green="0.9" blue="1.0" /></disk></element> | |
| 10 | ||
| 11 | <element name="led" defstate="0"> | |
| 12 | <disk state="0"><color red="0.2" green="0.04" blue="0.046" /></disk> | |
| 13 | <disk state="1"><color red="1.0" green="0.2" blue="0.23" /></disk> | |
| 14 | </element> | |
| 15 | ||
| 16 | <element name="text_1"> | |
| 17 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 18 | <text string="1"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 19 | </element> | |
| 20 | <element name="text_2"> | |
| 21 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 22 | <text string="2"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 23 | </element> | |
| 24 | <element name="text_3"> | |
| 25 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 26 | <text string="3"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 27 | </element> | |
| 28 | <element name="text_4"> | |
| 29 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 30 | <text string="4"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 31 | </element> | |
| 32 | <element name="text_5"> | |
| 33 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 34 | <text string="5"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 35 | </element> | |
| 36 | <element name="text_6"> | |
| 37 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 38 | <text string="6"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 39 | </element> | |
| 40 | <element name="text_7"> | |
| 41 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 42 | <text string="7"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 43 | </element> | |
| 44 | <element name="text_8"> | |
| 45 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 46 | <text string="8"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 47 | </element> | |
| 48 | <element name="text_9"> | |
| 49 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 50 | <text string="9"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 51 | </element> | |
| 52 | <element name="text_10"> | |
| 53 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 54 | <text string="10"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 55 | </element> | |
| 56 | <element name="text_11"> | |
| 57 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 58 | <text string="11"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 59 | </element> | |
| 60 | <element name="text_12"> | |
| 61 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 62 | <text string="12"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 63 | </element> | |
| 64 | ||
| 65 | <element name="text_100"> | |
| 66 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 67 | <text string="100"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 68 | </element> | |
| 69 | <element name="text_150"> | |
| 70 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 71 | <text string="150"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 72 | </element> | |
| 73 | <element name="text_200"> | |
| 74 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 75 | <text string="200"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 76 | </element> | |
| 77 | <element name="text_250"> | |
| 78 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 79 | <text string="250"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 80 | </element> | |
| 81 | <element name="text_300"> | |
| 82 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 83 | <text string="300"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 84 | </element> | |
| 85 | <element name="text_350"> | |
| 86 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 87 | <text string="350"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 88 | </element> | |
| 89 | ||
| 90 | <element name="text_air"> | |
| 91 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 92 | <text string="AIR"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 93 | </element> | |
| 94 | <element name="text_ss"> | |
| 95 | <rect><color red="0.1" green="0.25" blue="0.5" /></rect> | |
| 96 | <text string="$$"><color red="0.04" green="0.1" blue="0.2" /></text> | |
| 97 | </element> | |
| 98 | ||
| 99 | <element name="text_n"> | |
| 100 | <rect><color red="0.0" green="0.75" blue="1.0" /></rect> | |
| 101 | <text string="N"><color red="1" green="1" blue="1" /></text> | |
| 102 | </element> | |
| 103 | <element name="text_s"> | |
| 104 | <rect><color red="0.0" green="0.75" blue="1.0" /></rect> | |
| 105 | <text string="S"><color red="1" green="1" blue="1" /></text> | |
| 106 | </element> | |
| 107 | <element name="text_w"> | |
| 108 | <rect><color red="0.0" green="0.75" blue="1.0" /></rect> | |
| 109 | <text string="W"><color red="1" green="1" blue="1" /></text> | |
| 110 | </element> | |
| 111 | <element name="text_e"> | |
| 112 | <rect><color red="0.0" green="0.75" blue="1.0" /></rect> | |
| 113 | <text string="E"><color red="1" green="1" blue="1" /></text> | |
| 114 | </element> | |
| 115 | ||
| 116 | ||
| 117 | <!-- build screen --> | |
| 118 | ||
| 119 | <view name="Internal Layout"> | |
| 120 | <bounds left="2.2" right="18.5" top="1" bottom="17.3" /> | |
| 121 | <bezel element="static_blue"> | |
| 122 | <bounds left="0" right="20" top="0" bottom="20" /> | |
| 123 | </bezel> | |
| 124 | ||
| 125 | <!-- left side --> | |
| 126 | ||
| 127 | <bezel element="text_12"><bounds x="2.5" y="4" width="2" height="0.5" /></bezel> | |
| 128 | <bezel element="text_11"><bounds x="2.5" y="4.7" width="2" height="0.5" /></bezel> | |
| 129 | <bezel element="text_10"><bounds x="2.5" y="6" width="2" height="0.5" /></bezel> | |
| 130 | <bezel element="text_9"><bounds x="2.5" y="6.7" width="2" height="0.5" /></bezel> | |
| 131 | <bezel element="text_8"><bounds x="2.5" y="8" width="2" height="0.5" /></bezel> | |
| 132 | <bezel element="text_7"><bounds x="2.5" y="8.7" width="2" height="0.5" /></bezel> | |
| 133 | <bezel element="text_6"><bounds x="2.5" y="10" width="2" height="0.5" /></bezel> | |
| 134 | <bezel element="text_5"><bounds x="2.5" y="10.7" width="2" height="0.5" /></bezel> | |
| 135 | <bezel element="text_4"><bounds x="2.5" y="12" width="2" height="0.5" /></bezel> | |
| 136 | <bezel element="text_3"><bounds x="2.5" y="12.7" width="2" height="0.5" /></bezel> | |
| 137 | <bezel element="text_2"><bounds x="2.5" y="14" width="2" height="0.5" /></bezel> | |
| 138 | <bezel element="text_1"><bounds x="2.5" y="14.7" width="2" height="0.5" /></bezel> | |
| 139 | <bezel element="text_air"><bounds x="1.5" y="15.7" width="4" height="0.5" /></bezel> | |
| 140 | ||
| 141 | <bezel element="text_350"><bounds x="4.4" y="4.35" width="3" height="0.5" /></bezel> | |
| 142 | <bezel element="text_300"><bounds x="4.4" y="6.35" width="3" height="0.5" /></bezel> | |
| 143 | <bezel element="text_250"><bounds x="4.4" y="8.35" width="3" height="0.5" /></bezel> | |
| 144 | <bezel element="text_200"><bounds x="4.4" y="10.35" width="3" height="0.5" /></bezel> | |
| 145 | <bezel element="text_150"><bounds x="4.4" y="12.35" width="3" height="0.5" /></bezel> | |
| 146 | <bezel element="text_100"><bounds x="4.4" y="14.35" width="3" height="0.5" /></bezel> | |
| 147 | <bezel element="text_ss"><bounds x="4.4" y="15.7" width="3" height="0.5" /></bezel> | |
| 148 | ||
| 149 | <bezel element="static_blue2"><bounds x="3.1" y="4.57" width="0.77" height="0.06" /></bezel> | |
| 150 | <bezel element="static_blue2"><bounds x="3.1" y="6.57" width="0.77" height="0.06" /></bezel> | |
| 151 | <bezel element="static_blue2"><bounds x="3.1" y="8.57" width="0.77" height="0.06" /></bezel> | |
| 152 | <bezel element="static_blue2"><bounds x="3.1" y="10.57" width="0.77" height="0.06" /></bezel> | |
| 153 | <bezel element="static_blue2"><bounds x="3.1" y="12.57" width="0.77" height="0.06" /></bezel> | |
| 154 | <bezel element="static_blue2"><bounds x="3.1" y="14.57" width="0.77" height="0.06" /></bezel> | |
| 155 | <bezel element="static_blue2"><bounds x="7" y="0" width="0.3" height="20" /></bezel> | |
| 156 | ||
| 157 | <bezel name="0.5" element="led"><bounds x="4" y="4" width="1.2" height="1.2" /></bezel> | |
| 158 | <bezel name="0.4" element="led"><bounds x="4" y="6" width="1.2" height="1.2" /></bezel> | |
| 159 | <bezel name="0.3" element="led"><bounds x="4" y="8" width="1.2" height="1.2" /></bezel> | |
| 160 | <bezel name="0.2" element="led"><bounds x="4" y="10" width="1.2" height="1.2" /></bezel> | |
| 161 | <bezel name="0.1" element="led"><bounds x="4" y="12" width="1.2" height="1.2" /></bezel> | |
| 162 | <bezel name="0.0" element="led"><bounds x="4" y="14" width="1.2" height="1.2" /></bezel> | |
| 163 | ||
| 164 | <!-- compass --> | |
| 165 | ||
| 166 | <bezel element="disk_white"><bounds x="8.1" y="2.1" width="9" height="9" /></bezel> | |
| 167 | <bezel element="disk_cyan"><bounds x="8.5" y="2.5" width="8.2" height="8.2" /></bezel> | |
| 168 | ||
| 169 | <bezel element="text_n"><bounds x="12" y="2.7" width="1.2" height="1.2" /></bezel> | |
| 170 | <bezel element="text_s"><bounds x="12" y="9.3" width="1.2" height="1.2" /></bezel> | |
| 171 | <bezel element="text_w"><bounds x="8.8" y="6" width="1.2" height="1.2" /></bezel> | |
| 172 | <bezel element="text_e"><bounds x="15.2" y="6" width="1.2" height="1.2" /></bezel> | |
| 173 | ||
| 174 | <bezel name="0.6" element="led"><bounds x="12" y="4" width="1.2" height="1.2" /></bezel> | |
| 175 | <bezel name="0.7" element="led"><bounds x="12" y="8" width="1.2" height="1.2" /></bezel> | |
| 176 | <bezel name="0.8" element="led"><bounds x="10" y="6" width="1.2" height="1.2" /></bezel> | |
| 177 | <bezel name="0.9" element="led"><bounds x="14" y="6" width="1.2" height="1.2" /></bezel> | |
| 178 | <bezel name="0.10" element="led"><bounds x="12" y="6" width="1.2" height="1.2" /></bezel> | |
| 179 | ||
| 180 | </view> | |
| 181 | </mamelayout> |
| r253556 | r253557 | |
|---|---|---|
| 27 | 27 | </element> |
| 28 | 28 | |
| 29 | 29 | |
| 30 | ||
| 30 | 31 | <!-- build screen --> |
| 31 | 32 | |
| 32 | 33 | <view name="Internal Layout"> |
| r253556 | r253557 | |
| 61 | 62 | |
| 62 | 63 | <!-- math symbols custom digit --> |
| 63 | 64 | |
| 64 | <bezel name="8 | |
| 65 | <bezel name="lamp87" element="lamp_dash"><bounds x="21.5" y="17.25" width="7" height="0.5" /></bezel> | |
| 65 | 66 | |
| 66 | <bezel name="8.1" element="lamp_slash"><bounds x="24" y="9.5" width="5" height="7.5" /></bezel> | |
| 67 | <bezel name="8.1" element="lamp_slash"><bounds x="21" y="17" width="5" height="7.5" /></bezel> | |
| 67 | <bezel name="lamp82" element="lamp_slash"><bounds x="24" y="9.5" width="5" height="7.5" /></bezel> | |
| 68 | <bezel name="lamp82" element="lamp_slash"><bounds x="21" y="17" width="5" height="7.5" /></bezel> | |
| 68 | 69 | |
| 69 | <bezel name="8.2" element="lamp_backslash"><bounds x="21" y="9.5" width="5" height="7.5" /></bezel> | |
| 70 | <bezel name="8.2" element="lamp_backslash"><bounds x="24" y="17" width="5" height="7.5" /></bezel> | |
| 70 | <bezel name="lamp83" element="lamp_backslash"><bounds x="21" y="9.5" width="5" height="7.5" /></bezel> | |
| 71 | <bezel name="lamp83" element="lamp_backslash"><bounds x="24" y="17" width="5" height="7.5" /></bezel> | |
| 71 | 72 | |
| 72 | <bezel name="8.0" element="lamp_dot"><bounds x="24.25" y="12.25" width="1.5" height="1.5" /></bezel> | |
| 73 | <bezel name="8.0" element="lamp_dot"><bounds x="24.25" y="21.75" width="1.5" height="1.5" /></bezel> | |
| 73 | <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="12.25" width="1.5" height="1.5" /></bezel> | |
| 74 | <bezel name="lamp81" element="lamp_dot"><bounds x="24.25" y="21.75" width="1.5" height="1.5" /></bezel> | |
| 74 | 75 | |
| 75 | 76 | <!-- equals sign custom digit --> |
| 76 | 77 | |
| 77 | <bezel name="9.0" element="lamp_dash"><bounds x="51.5" y="14.5" width="7" height="0.5" /></bezel> | |
| 78 | <bezel name="9.3" element="lamp_dash"><bounds x="51.5" y="20.0" width="7" height="0.5" /></bezel> | |
| 78 | <bezel name="lamp91" element="lamp_dash"><bounds x="51.5" y="14.5" width="7" height="0.5" /></bezel> | |
| 79 | <bezel name="lamp94" element="lamp_dash"><bounds x="51.5" y="20.0" width="7" height="0.5" /></bezel> | |
| 79 | 80 | |
| 80 | 81 | <!-- other lamps --> |
| 81 | 82 | |
| 82 | <bezel name="10.0" element="lamp_dot"><bounds x="1" y="1" width="4" height="4" /></bezel> | |
| 83 | <bezel name="10.1" element="lamp_dot"><bounds x="26" y="1" width="4" height="4" /></bezel> | |
| 84 | <bezel name="10.3" element="lamp_dot"><bounds x="51" y="1" width="4" height="4" /></bezel> | |
| 85 | <bezel name="10.6" element="lamp_dot"><bounds x="76" y="1" width="4" height="4" /></bezel> | |
| 83 | <bezel name="lamp101" element="lamp_dot"><bounds x="1" y="1" width="4" height="4" /></bezel> | |
| 84 | <bezel name="lamp102" element="lamp_dot"><bounds x="26" y="1" width="4" height="4" /></bezel> | |
| 85 | <bezel name="lamp104" element="lamp_dot"><bounds x="51" y="1" width="4" height="4" /></bezel> | |
| 86 | <bezel name="lamp107" element="lamp_dot"><bounds x="76" y="1" width="4" height="4" /></bezel> | |
| 86 | 87 | |
| 87 | 88 | |
| 88 | 89 | </view> |
| r253556 | r253557 | |
|---|---|---|
| 1 | <?xml version="1.0"?> | |
| 2 | <mamelayout version="2"> | |
| 3 | ||
| 4 | <!-- define elements --> | |
| 5 | ||
| 6 | <element name="static_black"><rect><color red="0" green="0" blue="0" /></rect></element> | |
| 7 | <element name="disk_black"><disk><color red="0" green="0" blue="0" /></disk></element> | |
| 8 | <element name="disk_red"><disk><color red="0.25" green="0.05" blue="0.02" /></disk></element> | |
| 9 | ||
| 10 | <element name="led" defstate="0"> | |
| 11 | <disk state="0"><color red="0.2" green="0.04" blue="0.046" /></disk> | |
| 12 | <disk state="1"><color red="1.0" green="0.2" blue="0.23" /></disk> | |
| 13 | </element> | |
| 14 | ||
| 15 | <element name="digit" defstate="0"> | |
| 16 | <led7seg><color red="1.0" green="0.15" blue="0.08" /></led7seg> | |
| 17 | </element> | |
| 18 | ||
| 19 | <element name="text_1"><text string="1"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 20 | <element name="text_2"><text string="2"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 21 | <element name="text_3"><text string="3"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 22 | <element name="text_4"><text string="4"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 23 | <element name="text_5"><text string="5"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 24 | <element name="text_6"><text string="6"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 25 | <element name="text_7"><text string="7"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 26 | <element name="text_8"><text string="8"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 27 | <element name="text_9"><text string="9"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 28 | <element name="text_10"><text string="10"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 29 | <element name="text_11"><text string="11"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 30 | <element name="text_12"><text string="12"><color red="0.7" green="0.7" blue="0.7" /></text></element> | |
| 31 | ||
| 32 | ||
| 33 | <!-- build screen --> | |
| 34 | ||
| 35 | <view name="Internal Layout"> | |
| 36 | <bounds left="-35" right="158" top="5" bottom="198" /> | |
| 37 | <bezel element="static_black"> | |
| 38 | <bounds left="-35" right="158" top="5" bottom="198" /> | |
| 39 | </bezel> | |
| 40 | ||
| 41 | <bezel element="disk_red"><bounds x="-40" y="0" width="203" height="203" /></bezel> | |
| 42 | <bezel element="disk_black"><bounds x="-15" y="25" width="153" height="153" /></bezel> | |
| 43 | ||
| 44 | <bezel name="digit7" element="digit"><bounds x="20" y="70" width="10" height="15" /></bezel> | |
| 45 | <bezel name="digit6" element="digit"><bounds x="30" y="70" width="10" height="15" /></bezel> | |
| 46 | <bezel name="digit5" element="digit"><bounds x="40" y="70" width="10" height="15" /></bezel> | |
| 47 | <bezel name="digit4" element="digit"><bounds x="50" y="70" width="10" height="15" /></bezel> | |
| 48 | <bezel name="digit3" element="digit"><bounds x="60" y="70" width="10" height="15" /></bezel> | |
| 49 | <bezel name="digit2" element="digit"><bounds x="70" y="70" width="10" height="15" /></bezel> | |
| 50 | <bezel name="digit1" element="digit"><bounds x="80" y="70" width="10" height="15" /></bezel> | |
| 51 | <bezel name="digit0" element="digit"><bounds x="90" y="70" width="10" height="15" /></bezel> | |
| 52 | ||
| 53 | <bezel name="9.7" element="led"><bounds x="15" y="145" width="3" height="3" /></bezel> | |
| 54 | <bezel name="9.2" element="led"><bounds x="40" y="160" width="3" height="3" /></bezel> | |
| 55 | <bezel name="9.4" element="led"><bounds x="80" y="160" width="3" height="3" /></bezel> | |
| 56 | <bezel name="9.5" element="led"><bounds x="105" y="145" width="3" height="3" /></bezel> | |
| 57 | <bezel name="9.1" element="led"><bounds x="120" y="120" width="3" height="3" /></bezel> | |
| 58 | <bezel name="9.3" element="led"><bounds x="120" y="80" width="3" height="3" /></bezel> | |
| 59 | ||
| 60 | <bezel name="8.7" element="led"><bounds x="105" y="55" width="3" height="3" /></bezel> | |
| 61 | <bezel name="8.2" element="led"><bounds x="80" y="40" width="3" height="3" /></bezel> | |
| 62 | <bezel name="8.4" element="led"><bounds x="40" y="40" width="3" height="3" /></bezel> | |
| 63 | <bezel name="8.5" element="led"><bounds x="15" y="55" width="3" height="3" /></bezel> | |
| 64 | <bezel name="8.1" element="led"><bounds x="0" y="80" width="3" height="3" /></bezel> | |
| 65 | <bezel name="8.3" element="led"><bounds x="0" y="120" width="3" height="3" /></bezel> | |
| 66 | ||
| 67 | <bezel element="text_1"><bounds x="17" y="143" width="12" height="7" /></bezel> | |
| 68 | <bezel element="text_2"><bounds x="42" y="158" width="12" height="7" /></bezel> | |
| 69 | <bezel element="text_3"><bounds x="82" y="158" width="12" height="7" /></bezel> | |
| 70 | <bezel element="text_4"><bounds x="107" y="143" width="12" height="7" /></bezel> | |
| 71 | <bezel element="text_5"><bounds x="122" y="118" width="12" height="7" /></bezel> | |
| 72 | <bezel element="text_6"><bounds x="122" y="78" width="12" height="7" /></bezel> | |
| 73 | ||
| 74 | <bezel element="text_7"><bounds x="107" y="53" width="12" height="7" /></bezel> | |
| 75 | <bezel element="text_8"><bounds x="82" y="38" width="12" height="7" /></bezel> | |
| 76 | <bezel element="text_9"><bounds x="42" y="38" width="12" height="7" /></bezel> | |
| 77 | <bezel element="text_10"><bounds x="17" y="53" width="12" height="7" /></bezel> | |
| 78 | <bezel element="text_11"><bounds x="2" y="78" width="12" height="7" /></bezel> | |
| 79 | <bezel element="text_12"><bounds x="2" y="118" width="12" height="7" /></bezel> | |
| 80 | ||
| 81 | ||
| 82 | </view> | |
| 83 | </mamelayout> |
| r253556 | r253557 | |
|---|---|---|
| 841 | 841 | |
| 842 | 842 | ohci_function_device::ohci_function_device(running_machine &machine) |
| 843 | 843 | { |
| 844 | state = DefaultState; | |
| 845 | 844 | descriptors = auto_alloc_array(machine, UINT8, 1024); |
| 846 | 845 | descriptors_pos = 0; |
| 847 | 846 | address = 0; |
| r253556 | r253557 | |
| 849 | 848 | controldirection = 0; |
| 850 | 849 | controltype = 0; |
| 851 | 850 | controlrecipient = 0; |
| 852 | configurationvalue = 0; | |
| 853 | 851 | remain = 0; |
| 854 | 852 | position = nullptr; |
| 855 | 853 | settingaddress = false; |
| r253556 | r253557 | |
| 863 | 861 | void ohci_function_device::add_device_descriptor(USBStandardDeviceDescriptor &descriptor) |
| 864 | 862 | { |
| 865 | 863 | memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor)); |
| 866 | descriptors_pos += descriptor | |
| 864 | descriptors_pos += sizeof(descriptor); | |
| 867 | 865 | } |
| 868 | 866 | |
| 869 | 867 | void ohci_function_device::add_configuration_descriptor(USBStandardConfigurationDescriptor &descriptor) |
| 870 | 868 | { |
| 871 | 869 | memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor)); |
| 872 | descriptors_pos += descriptor | |
| 870 | descriptors_pos += sizeof(descriptor); | |
| 873 | 871 | } |
| 874 | 872 | |
| 875 | 873 | void ohci_function_device::add_interface_descriptor(USBStandardInterfaceDescriptor &descriptor) |
| 876 | 874 | { |
| 877 | 875 | memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor)); |
| 878 | descriptors_pos += descriptor | |
| 876 | descriptors_pos += sizeof(descriptor); | |
| 879 | 877 | } |
| 880 | 878 | |
| 881 | 879 | void ohci_function_device::add_endpoint_descriptor(USBStandardEndpointDescriptor &descriptor) |
| 882 | 880 | { |
| 883 | 881 | memcpy(descriptors + descriptors_pos, &descriptor, sizeof(descriptor)); |
| 884 | descriptors_pos += descriptor | |
| 882 | descriptors_pos += sizeof(descriptor); | |
| 885 | 883 | } |
| 886 | 884 | |
| 887 | 885 | void ohci_function_device::execute_reset() |
| r253556 | r253557 | |
| 892 | 890 | |
| 893 | 891 | int ohci_function_device::execute_transfer(int address, int endpoint, int pid, UINT8 *buffer, int size) |
| 894 | 892 | { |
| 895 | int descriptortype;// descriptorindex; | |
| 896 | ||
| 897 | 893 | if (endpoint == 0) { |
| 898 | 894 | if (pid == SetupPid) { |
| 899 | USBSetupPacket *p=(struct USBSetupPacket *)buffer; | |
| 895 | struct USBSetupPacket *p=(struct USBSetupPacket *)buffer; | |
| 900 | 896 | // define direction 0:host->device 1:device->host |
| 901 | 897 | controldirection = (p->bmRequestType & 128) >> 7; |
| 902 | 898 | // case ==1, IN data stage and OUT status stage |
| r253556 | r253557 | |
| 905 | 901 | controltype = (p->bmRequestType & 0x60) >> 5; |
| 906 | 902 | controlrecipient = p->bmRequestType & 0x1f; |
| 907 | 903 | position = nullptr; |
| 908 | // number of byte to transfer in data stage (0 no data stage) | |
| 909 | 904 | remain = p->wLength; |
| 910 | // if standard device request | |
| 911 | if ((controltype == StandardType) && (controlrecipient == DeviceRecipient)) { | |
| 905 | // if standard | |
| 906 | if (controltype == 0) { | |
| 912 | 907 | switch (p->bRequest) { |
| 913 | 908 | case GET_STATUS: |
| 914 | 909 | case CLEAR_FEATURE: |
| r253556 | r253557 | |
| 919 | 914 | settingaddress = true; |
| 920 | 915 | break; |
| 921 | 916 | case GET_DESCRIPTOR: |
| 922 | descriptortype = p->wValue >> 8; | |
| 923 | //descriptorindex = p->wValue & 255; | |
| 924 | if (descriptortype == DEVICE) { // device descriptor | |
| 917 | if ((p->wValue >> 8) == DEVICE) { // device descriptor | |
| 918 | //p->wValue & 255; | |
| 925 | 919 | position = descriptors; |
| 926 | 920 | remain = descriptors[0]; |
| 927 | 921 | } |
| 928 | else if ( | |
| 922 | else if ((p->wValue >> 8) == CONFIGURATION) { // configuration descriptor | |
| 929 | 923 | position = descriptors + 18; |
| 930 | 924 | remain = descriptors[18+2]; |
| 931 | 925 | } |
| 932 | else if ( | |
| 926 | else if ((p->wValue >> 8) == INTERFACE) { // interface descriptor | |
| 933 | 927 | position = descriptors + 18 + 9; |
| 934 | 928 | remain = descriptors[18 + 9]; |
| 935 | 929 | } |
| 936 | else if ( | |
| 930 | else if ((p->wValue >> 8) == ENDPOINT) { // endpoint descriptor | |
| 937 | 931 | position = descriptors + 18 + 9 + 9; |
| 938 | 932 | remain = descriptors[18 + 9 + 9]; |
| 939 | 933 | } |
| 940 | else | |
| 941 | remain = 0; | |
| 942 | 934 | if (remain > p->wLength) |
| 943 | 935 | remain = p->wLength; |
| 944 | 936 | break; |
| 945 | case SET_CONFIGURATION: | |
| 946 | if (p->wValue == 0) | |
| 947 | state = AddressState; | |
| 948 | else { | |
| 949 | configurationvalue = p->wValue; | |
| 950 | state = ConfiguredState; | |
| 951 | } | |
| 952 | break; | |
| 953 | 937 | case SET_DESCRIPTOR: |
| 954 | 938 | case GET_CONFIGURATION: |
| 939 | case SET_CONFIGURATION: | |
| 955 | 940 | case GET_INTERFACE: |
| 956 | 941 | case SET_INTERFACE: |
| 957 | 942 | case SYNCH_FRAME: |
| r253556 | r253557 | |
| 959 | 944 | break; |
| 960 | 945 | } |
| 961 | 946 | } |
| 962 | else | |
| 963 | return handle_nonstandard_request(p); | |
| 964 | 947 | size = 0; |
| 965 | 948 | } |
| 966 | 949 | else if (pid == InPid) { |
| 967 | 950 | // if no data has been transferred (except for the setup stage) |
| 968 | 951 | // and the lenght of this IN transaction is 0 |
| 969 | 952 | // assume this is the status stage |
| 970 | if ( | |
| 953 | if (size == 0) { | |
| 971 | 954 | if (settingaddress == true) |
| 972 | 955 | { |
| 973 | 956 | // set of address is active at end of status stage |
| 974 | 957 | address = newaddress; |
| 975 | 958 | settingaddress = false; |
| 976 | state = AddressState; | |
| 977 | 959 | } |
| 978 | 960 | return 0; |
| 979 | 961 | } |
| r253556 | r253557 | |
| 1005 | 987 | } |
| 1006 | 988 | } |
| 1007 | 989 | } |
| 1008 | else | |
| 1009 | return -1; | |
| 1010 | 990 | return size; |
| 1011 | 991 | } |
| 1012 | 992 | |
| 1013 | int ohci_function_device::handle_nonstandard_request(USBSetupPacket *setup) | |
| 1014 | { | |
| 1015 | if ((controltype == VendorType) && (controlrecipient == InterfaceRecipient)) | |
| 1016 | { | |
| 1017 | if (setup->bRequest == GET_DESCRIPTOR) | |
| 1018 | { | |
| 1019 | if (setup->wValue == 0x4200) | |
| 1020 | { | |
| 1021 | position = nullptr; | |
| 1022 | remain = 0; | |
| 1023 | } | |
| 1024 | } | |
| 1025 | } | |
| 1026 | return 0; | |
| 1027 | } | |
| 1028 | ||
| 1029 | 993 | void xbox_base_state::usb_ohci_interrupts() |
| 1030 | 994 | { |
| 1031 | 995 | if (((ohcist.hc_regs[HcInterruptStatus] & ohcist.hc_regs[HcInterruptEnable]) != 0) && ((ohcist.hc_regs[HcInterruptEnable] & MasterInterruptEnable) != 0)) |
| r253556 | r253557 | |
| 1425 | 1389 | IRQ_CALLBACK_MEMBER(xbox_base_state::irq_callback) |
| 1426 | 1390 | { |
| 1427 | 1391 | int r = 0; |
| 1428 | r = xbox_base_devs.pic8259_1->acknowledge(); | |
| 1392 | r = xbox_base_devs.pic8259_2->acknowledge(); | |
| 1393 | if (r == 0) | |
| 1394 | { | |
| 1395 | r = xbox_base_devs.pic8259_1->acknowledge(); | |
| 1396 | } | |
| 1429 | 1397 | if (debug_irq_active) |
| 1430 | 1398 | debug_generate_irq(debug_irq_number, false); |
| 1431 | 1399 | return r; |
| r253556 | r253557 | |
|---|---|---|
| 2286 | 2286 | // hh_tms1k |
| 2287 | 2287 | mathmagi // APF |
| 2288 | 2288 | amaztron // Coleco |
| 2289 | zodiac // Coleco | |
| 2290 | 2289 | cqback // Coleco |
| 2291 | 2290 | h2hbaseb // Coleco |
| 2292 | 2291 | h2hfootb // Coleco |
| 2293 | 2292 | tc4 // Coleco |
| 2294 | cnfball2 // Conic | |
| 2295 | 2293 | ebball // Entex |
| 2296 | 2294 | ebball2 // Entex |
| 2297 | 2295 | ebball3 // Entex |
| r253556 | r253557 | |
| 2317 | 2315 | bankshot // Parker Bros |
| 2318 | 2316 | splitsec // Parker Bros |
| 2319 | 2317 | mmerlin // Parker Bros |
| 2320 | lostreas // Parker Bros | |
| 2321 | 2318 | tandy12 // Tandy Radio Shack |
| 2322 | 2319 | tbreakup // Tomy |
| 2323 | 2320 | phpball // Tomy |
| r253556 | r253557 | |
|---|---|---|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| 81 | WRITE16_MEMBER(blmbycar_state::vram_0_w) | |
| 81 | WRITE16_MEMBER(blmbycar_state::blmbycar_vram_0_w) | |
| 82 | 82 | { |
| 83 | 83 | COMBINE_DATA(&m_vram_0[offset]); |
| 84 | 84 | m_tilemap_0->mark_tile_dirty(offset / 2); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | WRITE16_MEMBER(blmbycar_state::vram_1_w) | |
| 87 | WRITE16_MEMBER(blmbycar_state::blmbycar_vram_1_w) | |
| 88 | 88 | { |
| 89 | 89 | COMBINE_DATA(&m_vram_1[offset]); |
| 90 | 90 | m_tilemap_1->mark_tile_dirty(offset / 2); |
| r253556 | r253557 | |
| 192 | 192 | |
| 193 | 193 | ***************************************************************************/ |
| 194 | 194 | |
| 195 | UINT32 blmbycar_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 195 | UINT32 blmbycar_state::screen_update_blmbycar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 196 | 196 | { |
| 197 | 197 | int i, layers_ctrl = -1; |
| 198 | 198 |
| r253556 | r253557 | |
|---|---|---|
| 2593 | 2593 | printf("A:%08X MTHD:%08X D:%08X\n\r",address,maddress,data); |
| 2594 | 2594 | #endif |
| 2595 | 2595 | if (maddress == 0x17fc) { |
| 2596 | #if | |
| 2596 | #if 1 // useful while debugging to see what coordinates have been used | |
| 2597 | 2597 | static int debugvc = 0; |
| 2598 | 2598 | if (debugvc) |
| 2599 | 2599 | if (data == 0) |
| 2600 | 2600 | { |
| 2601 | printf("%d %d\n\r", | |
| 2601 | //printf("%d %d\n\r", primitive_type, vertex_first); | |
| 2602 | 2602 | for (int n = 0; n < vertex_first; n++) |
| 2603 | 2603 | printf("%d X:%f Y:%f Z:%f W:%f x:%f y:%f\n\r", n, vertex_software[n].attribute[0].fv[0], vertex_software[n].attribute[0].fv[1], vertex_software[n].attribute[0].fv[2], vertex_software[n].attribute[0].fv[3], vertex_xy[n].x, vertex_xy[n].y); |
| 2604 | 2604 | } |
| r253556 | r253557 | |
|---|---|---|
| 33 | 33 | 1 | xxxxxxxx -------- | not used |
| 34 | 34 | */ |
| 35 | 35 | |
| 36 | TILE_GET_INFO_MEMBER(glass_state::get_tile_info_screen0) | |
| 36 | TILE_GET_INFO_MEMBER(glass_state::get_tile_info_glass_screen0) | |
| 37 | 37 | { |
| 38 | 38 | int data = m_videoram[tile_index << 1]; |
| 39 | 39 | int data2 = m_videoram[(tile_index << 1) + 1]; |
| r253556 | r253557 | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | TILE_GET_INFO_MEMBER(glass_state::get_tile_info_screen1) | |
| 46 | TILE_GET_INFO_MEMBER(glass_state::get_tile_info_glass_screen1) | |
| 47 | 47 | { |
| 48 | 48 | int data = m_videoram[(0x1000 / 2) + (tile_index << 1)]; |
| 49 | 49 | int data2 = m_videoram[(0x1000 / 2) + (tile_index << 1) + 1]; |
| r253556 | r253557 | |
| 67 | 67 | B2B1B0 selects the picture (there are 8 pictures in each half of the ROM) |
| 68 | 68 | */ |
| 69 | 69 | |
| 70 | WRITE16_MEMBER(glass_state::blitter_w) | |
| 70 | WRITE16_MEMBER(glass_state::glass_blitter_w) | |
| 71 | 71 | { |
| 72 | 72 | m_blitter_serial_buffer[m_current_bit] = data & 0x01; |
| 73 | 73 | m_current_bit++; |
| r253556 | r253557 | |
| 112 | 112 | |
| 113 | 113 | ***************************************************************************/ |
| 114 | 114 | |
| 115 | WRITE16_MEMBER(glass_state::vram_w) | |
| 115 | WRITE16_MEMBER(glass_state::glass_vram_w) | |
| 116 | 116 | { |
| 117 | 117 | COMBINE_DATA(&m_videoram[offset]); |
| 118 | 118 | m_pant[offset >> 11]->mark_tile_dirty(((offset << 1) & 0x0fff) >> 2); |
| r253556 | r253557 | |
| 127 | 127 | |
| 128 | 128 | void glass_state::video_start() |
| 129 | 129 | { |
| 130 | m_pant[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); | |
| 131 | m_pant[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); | |
| 130 | m_pant[0] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen0),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); | |
| 131 | m_pant[1] = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(glass_state::get_tile_info_glass_screen1),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32); | |
| 132 | 132 | m_screen_bitmap = std::make_unique<bitmap_ind16>(320, 200); |
| 133 | 133 | |
| 134 | 134 | save_item(NAME(*m_screen_bitmap)); |
| r253556 | r253557 | |
| 191 | 191 | |
| 192 | 192 | ****************************************************************************/ |
| 193 | 193 | |
| 194 | UINT32 glass_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 194 | UINT32 glass_state::screen_update_glass(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) | |
| 195 | 195 | { |
| 196 | 196 | /* set scroll registers */ |
| 197 | 197 | m_pant[0]->set_scrolly(0, m_vregs[0]); |
| r253556 | r253557 | |
|---|---|---|
| 162 | 162 | m_s_texColor = bgfx::createUniform("s_texColor", bgfx::UniformType::Int1); |
| 163 | 163 | |
| 164 | 164 | uint32_t flags = BGFX_TEXTURE_U_CLAMP | BGFX_TEXTURE_V_CLAMP | BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT | BGFX_TEXTURE_MIP_POINT; |
| 165 | m_texture_cache = bgfx::createTexture2D(CACHE_SIZE, CACHE_SIZE, 1, bgfx::TextureFormat:: | |
| 165 | m_texture_cache = bgfx::createTexture2D(CACHE_SIZE, CACHE_SIZE, 1, bgfx::TextureFormat::BGRA8, flags); | |
| 166 | 166 | |
| 167 | 167 | const bgfx::Memory* memory = bgfx::alloc(sizeof(uint32_t) * CACHE_SIZE * CACHE_SIZE); |
| 168 | 168 | memset(memory->data, 0, sizeof(uint32_t) * CACHE_SIZE * CACHE_SIZE); |
| r253556 | r253557 | |
| 423 | 423 | const bgfx::Memory* mem = mame_texture_data_to_bgfx_texture_data(prim->flags & PRIMFLAG_TEXFORMAT_MASK, |
| 424 | 424 | prim->texture.width, prim->texture.height, prim->texture.rowpixels, prim->texture.palette, prim->texture.base); |
| 425 | 425 | |
| 426 | bgfx::TextureHandle texture = bgfx::createTexture2D((uint16_t)prim->texture.width, (uint16_t)prim->texture.height, 1, bgfx::TextureFormat:: | |
| 426 | bgfx::TextureHandle texture = bgfx::createTexture2D((uint16_t)prim->texture.width, (uint16_t)prim->texture.height, 1, bgfx::TextureFormat::BGRA8, texture_flags, mem); | |
| 427 | 427 | |
| 428 | 428 | bgfx::setTexture(0, m_s_texColor, texture); |
| 429 | 429 | |
| r253556 | r253557 | |
| 629 | 629 | static inline void copyline_palette16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette) |
| 630 | 630 | { |
| 631 | 631 | for (int x = 0; x < width; x++) |
| 632 | { | |
| 633 | rgb_t srcpixel = palette[*src++]; | |
| 634 | *dst++ = 0xff000000 | (srcpixel.b() << 16) | (srcpixel.g() << 8) | srcpixel.r(); | |
| 635 | } | |
| 632 | *dst++ = 0xff000000 | palette[*src++]; | |
| 636 | 633 | } |
| 637 | 634 | |
| 638 | 635 | |
| r253556 | r253557 | |
| 643 | 640 | static inline void copyline_palettea16(UINT32 *dst, const UINT16 *src, int width, const rgb_t *palette) |
| 644 | 641 | { |
| 645 | 642 | for (int x = 0; x < width; x++) |
| 646 | { | |
| 647 | rgb_t srcpixel = palette[*src++]; | |
| 648 | *dst++ = (srcpixel.a() << 24) | (srcpixel.b() << 16) | (srcpixel.g() << 8) | srcpixel.r(); | |
| 649 | } | |
| 643 | *dst++ = palette[*src++]; | |
| 650 | 644 | } |
| 651 | 645 | |
| 652 | 646 | |
| r253556 | r253557 | |
| 664 | 658 | for (x = 0; x < width; x++) |
| 665 | 659 | { |
| 666 | 660 | rgb_t srcpix = *src++; |
| 667 | *dst++ = 0xff000000 | palette[0x200 + srcpix. | |
| 661 | *dst++ = 0xff000000 | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()]; | |
| 668 | 662 | } |
| 669 | 663 | } |
| 670 | 664 | |
| r253556 | r253557 | |
| 672 | 666 | else |
| 673 | 667 | { |
| 674 | 668 | for (x = 0; x < width; x++) |
| 675 | { | |
| 676 | rgb_t srcpix = *src++; | |
| 677 | *dst++ = 0xff000000 | (srcpix.b() << 16) | (srcpix.g() << 8) | srcpix.r(); | |
| 678 | } | |
| 669 | *dst++ = 0xff000000 | *src++; | |
| 679 | 670 | } |
| 680 | 671 | } |
| 681 | 672 | |
| r253556 | r253557 | |
| 693 | 684 | for (x = 0; x < width; x++) |
| 694 | 685 | { |
| 695 | 686 | rgb_t srcpix = *src++; |
| 696 | *dst++ = (srcpix & 0xff000000) | palette[0x200 + srcpix. | |
| 687 | *dst++ = (srcpix & 0xff000000) | palette[0x200 + srcpix.r()] | palette[0x100 + srcpix.g()] | palette[srcpix.b()]; | |
| 697 | 688 | } |
| 698 | 689 | } |
| 699 | 690 | |
| r253556 | r253557 | |
| 701 | 692 | else |
| 702 | 693 | { |
| 703 | 694 | for (x = 0; x < width; x++) |
| 704 | { | |
| 705 | rgb_t srcpix = *src++; | |
| 706 | *dst++ = (srcpix.a() << 24) | (srcpix.b() << 16) | (srcpix.g() << 8) | srcpix.r(); | |
| 707 | } | |
| 695 | *dst++ = *src++; | |
| 708 | 696 | } |
| 709 | 697 | } |
| 710 | 698 | |
| r253556 | r253557 | |
| 746 | 734 | if (b < 0) b = 0; |
| 747 | 735 | else if (b > 255) b = 255; |
| 748 | 736 | |
| 749 | return 0xff | |
| 737 | return rgb_t(0xff, r, g, b); | |
| 750 | 738 | } |
| 751 | 739 | |
| 752 | 740 | //============================================================ |
| r253556 | r253557 | |
|---|---|---|
| 100 | 100 | rectangle_packer m_packer; |
| 101 | 101 | |
| 102 | 102 | uint32_t m_white[16*16]; |
| 103 | enum : uint16_t { CACHE_SIZE = 1024 }; | |
| 104 | enum : uint32_t { PACKABLE_SIZE = 128 }; | |
| 105 | enum : UINT32 { WHITE_HASH = 0x87654321 }; | |
| 103 | static const uint16_t CACHE_SIZE = 1024; | |
| 104 | static const uint32_t PACKABLE_SIZE = 128; | |
| 105 | static const UINT32 WHITE_HASH = 0x87654321; | |
| 106 | 106 | }; |
| 107 | 107 | |
| 108 | #endif | |
| 108 | #endif | |
| No newline at end of file |
| r0 | r253557 | |
|---|---|---|
| 1 | // license:BSD-3-Clause | |
| 2 | // copyright-holders:Aaron Giles | |
| 3 | //============================================================ | |
| 4 | // | |
| 5 | // drawdd.c - Win32 DirectDraw implementation | |
| 6 | // | |
| 7 | //============================================================ | |
| 8 | ||
| 9 | // standard windows headers | |
| 10 | #define WIN32_LEAN_AND_MEAN | |
| 11 | #include <windows.h> | |
| 12 | #include <mmsystem.h> | |
| 13 | #include <ddraw.h> | |
| 14 | #undef interface | |
| 15 | ||
| 16 | // MAME headers | |
| 17 | #include "emu.h" | |
| 18 | #include "render.h" | |
| 19 | #include "rendutil.h" | |
| 20 | #include "rendersw.inc" | |
| 21 | ||
| 22 | // MAMEOS headers | |
| 23 | #include "winmain.h" | |
| 24 | #include "window.h" | |
| 25 | ||
| 26 | ||
| 27 | ||
| 28 | //============================================================ | |
| 29 | // TYPE DEFINITIONS | |
| 30 | //============================================================ | |
| 31 | ||
| 32 | typedef HRESULT (WINAPI *directdrawcreateex_ptr)(GUID FAR *lpGuid, LPVOID *lplpDD, REFIID iid, IUnknown FAR *pUnkOuter); | |
| 33 | typedef HRESULT (WINAPI *directdrawenumerateex_ptr)(LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags); | |
| 34 | ||
| 35 | ||
| 36 | /* dd_info is the information about DirectDraw for the current screen */ | |
| 37 | class renderer_dd : public osd_renderer | |
| 38 | { | |
| 39 | public: | |
| 40 | renderer_dd(osd_window *window) | |
| 41 | : osd_renderer(window, FLAG_NONE), | |
| 42 | width(0), | |
| 43 | height(0), | |
| 44 | refresh(0), | |
| 45 | //adapter(0), | |
| 46 | adapter_ptr(NULL), | |
| 47 | clearouter(0), | |
| 48 | blitwidth(0), blitheight(0), | |
| 49 | //lastdest | |
| 50 | ddraw(NULL), | |
| 51 | primary(NULL), | |
| 52 | back(NULL), | |
| 53 | blit(NULL), | |
| 54 | clipper(NULL), | |
| 55 | gamma(NULL), | |
| 56 | //DDSURFACEDESC2 primarydesc; | |
| 57 | //DDSURFACEDESC2 blitdesc; | |
| 58 | //DDSURFACEDESC2 origmode; | |
| 59 | //ddcaps(0), | |
| 60 | //helcaps(0), | |
| 61 | membuffer(NULL), | |
| 62 | membuffersize(0) | |
| 63 | { } | |
| 64 | ||
| 65 | virtual ~renderer_dd() { } | |
| 66 | ||
| 67 | virtual int create() override; | |
| 68 | virtual render_primitive_list *get_primitives() override; | |
| 69 | virtual int draw(const int update) override; | |
| 70 | virtual void save() override {}; | |
| 71 | virtual void record() override {}; | |
| 72 | virtual void toggle_fsfx() override {}; | |
| 73 | virtual void destroy() override; | |
| 74 | ||
| 75 | int width, height; // current width, height | |
| 76 | int refresh; // current refresh rate | |
| 77 | ||
| 78 | private: | |
| 79 | ||
| 80 | inline void update_outer_rects(); | |
| 81 | ||
| 82 | // surface management | |
| 83 | int ddraw_create(); | |
| 84 | int ddraw_create_surfaces(); | |
| 85 | void ddraw_delete(); | |
| 86 | void ddraw_delete_surfaces(); | |
| 87 | int ddraw_verify_caps(); | |
| 88 | int ddraw_test_cooperative(); | |
| 89 | HRESULT create_surface(DDSURFACEDESC2 *desc, IDirectDrawSurface7 **surface, const char *type); | |
| 90 | int create_clipper(); | |
| 91 | ||
| 92 | // drawing helpers | |
| 93 | void compute_blit_surface_size(); | |
| 94 | void blit_to_primary(int srcwidth, int srcheight); | |
| 95 | ||
| 96 | // video modes | |
| 97 | int config_adapter_mode(); | |
| 98 | void get_adapter_for_monitor(osd_monitor_info *monitor); | |
| 99 | void pick_best_mode(); | |
| 100 | ||
| 101 | // various | |
| 102 | void calc_fullscreen_margins(DWORD desc_width, DWORD desc_height, RECT *margins); | |
| 103 | ||
| 104 | ||
| 105 | GUID adapter; // current display adapter | |
| 106 | GUID * adapter_ptr; // pointer to current display adapter | |
| 107 | int clearouter; // clear the outer areas? | |
| 108 | ||
| 109 | INT32 blitwidth, blitheight; // current blit width/height values | |
| 110 | RECT lastdest; // last destination rectangle | |
| 111 | ||
| 112 | IDirectDraw7 * ddraw; // pointer to the DirectDraw object | |
| 113 | IDirectDrawSurface7 * primary; // pointer to the primary surface object | |
| 114 | IDirectDrawSurface7 * back; // pointer to the back buffer surface object | |
| 115 | IDirectDrawSurface7 * blit; // pointer to the blit surface object | |
| 116 | IDirectDrawClipper * clipper; // pointer to the clipper object | |
| 117 | IDirectDrawGammaControl *gamma; // pointer to the gamma control object | |
| 118 | ||
| 119 | DDSURFACEDESC2 primarydesc; // description of the primary surface | |
| 120 | DDSURFACEDESC2 blitdesc; // description of the blitting surface | |
| 121 | DDSURFACEDESC2 origmode; // original video mode | |
| 122 | ||
| 123 | DDCAPS ddcaps; // capabilities of the device | |
| 124 | DDCAPS helcaps; // capabilities of the hardware | |
| 125 | ||
| 126 | UINT8 * membuffer; // memory buffer for complex rendering | |
| 127 | UINT32 membuffersize; // current size of the memory buffer | |
| 128 | }; | |
| 129 | ||
| 130 | ||
| 131 | /* monitor_enum_info holds information during a monitor enumeration */ | |
| 132 | struct monitor_enum_info | |
| 133 | { | |
| 134 | osd_monitor_info * monitor; // pointer to monitor we want | |
| 135 | GUID guid; // GUID of the one we found | |
| 136 | GUID * guid_ptr; // pointer to our GUID | |
| 137 | int foundit; // TRUE if we found what we wanted | |
| 138 | }; | |
| 139 | ||
| 140 | ||
| 141 | /* mode_enum_info holds information during a display mode enumeration */ | |
| 142 | struct mode_enum_info | |
| 143 | { | |
| 144 | renderer_dd * renderer; | |
| 145 | osd_window * window; | |
| 146 | INT32 minimum_width, minimum_height; | |
| 147 | INT32 target_width, target_height; | |
| 148 | double target_refresh; | |
| 149 | float best_score; | |
| 150 | }; | |
| 151 | ||
| 152 | ||
| 153 | ||
| 154 | //============================================================ | |
| 155 | // GLOBALS | |
| 156 | //============================================================ | |
| 157 | ||
| 158 | static HINSTANCE dllhandle; | |
| 159 | static directdrawcreateex_ptr directdrawcreateex; | |
| 160 | static directdrawenumerateex_ptr directdrawenumerateex; | |
| 161 | ||
| 162 | ||
| 163 | ||
| 164 | //============================================================ | |
| 165 | // INLINES | |
| 166 | //============================================================ | |
| 167 | ||
| 168 | inline void renderer_dd::update_outer_rects() | |
| 169 | { | |
| 170 | clearouter = (back != NULL) ? 3 : 1; | |
| 171 | } | |
| 172 | ||
| 173 | ||
| 174 | static inline int better_mode(int width0, int height0, int width1, int height1, float desired_aspect) | |
| 175 | { | |
| 176 | float aspect0 = (float)width0 / (float)height0; | |
| 177 | float aspect1 = (float)width1 / (float)height1; | |
| 178 | return (fabs(desired_aspect - aspect0) < fabs(desired_aspect - aspect1)) ? 0 : 1; | |
| 179 | } | |
| 180 | ||
| 181 | ||
| 182 | ||
| 183 | //============================================================ | |
| 184 | // PROTOTYPES | |
| 185 | //============================================================ | |
| 186 | ||
| 187 | // core functions | |
| 188 | static void drawdd_exit(void); | |
| 189 | ||
| 190 | ||
| 191 | ||
| 192 | //============================================================ | |
| 193 | // drawnone_create | |
| 194 | //============================================================ | |
| 195 | ||
| 196 | static osd_renderer *drawdd_create(osd_window *window) | |
| 197 | { | |
| 198 | return global_alloc(renderer_dd(window)); | |
| 199 | } | |
| 200 | ||
| 201 | ||
| 202 | //============================================================ | |
| 203 | // drawdd_init | |
| 204 | //============================================================ | |
| 205 | ||
| 206 | int drawdd_init(running_machine &machine, osd_draw_callbacks *callbacks) | |
| 207 | { | |
| 208 | // dynamically grab the create function from ddraw.dll | |
| 209 | dllhandle = LoadLibrary(TEXT("ddraw.dll")); | |
| 210 | if (dllhandle == NULL) | |
| 211 | { | |
| 212 | osd_printf_verbose("DirectDraw: Unable to access ddraw.dll\n"); | |
| 213 | return 1; | |
| 214 | } | |
| 215 | ||
| 216 | // import the create function | |
| 217 | directdrawcreateex = (directdrawcreateex_ptr)GetProcAddress(dllhandle, "DirectDrawCreateEx"); | |
| 218 | if (directdrawcreateex == NULL) | |
| 219 | { | |
| 220 | osd_printf_verbose("DirectDraw: Unable to find DirectDrawCreateEx\n"); | |
| 221 | FreeLibrary(dllhandle); | |
| 222 | dllhandle = NULL; | |
| 223 | return 1; | |
| 224 | } | |
| 225 | ||
| 226 | // import the enumerate function | |
| 227 | directdrawenumerateex = (directdrawenumerateex_ptr)GetProcAddress(dllhandle, "DirectDrawEnumerateExA"); | |
| 228 | if (directdrawenumerateex == NULL) | |
| 229 | { | |
| 230 | osd_printf_verbose("DirectDraw: Unable to find DirectDrawEnumerateExA\n"); | |
| 231 | FreeLibrary(dllhandle); | |
| 232 | dllhandle = NULL; | |
| 233 | return 1; | |
| 234 | } | |
| 235 | ||
| 236 | // fill in the callbacks | |
| 237 | memset(callbacks, 0, sizeof(*callbacks)); | |
| 238 | callbacks->exit = drawdd_exit; | |
| 239 | callbacks->create = drawdd_create; | |
| 240 | ||
| 241 | osd_printf_verbose("DirectDraw: Using DirectDraw 7\n"); | |
| 242 | return 0; | |
| 243 | } | |
| 244 | ||
| 245 | ||
| 246 | ||
| 247 | //============================================================ | |
| 248 | // drawdd_exit | |
| 249 | //============================================================ | |
| 250 | ||
| 251 | static void drawdd_exit(void) | |
| 252 | { | |
| 253 | if (dllhandle != NULL) | |
| 254 | FreeLibrary(dllhandle); | |
| 255 | } | |
| 256 | ||
| 257 | ||
| 258 | ||
| 259 | //============================================================ | |
| 260 | // drawdd_window_init | |
| 261 | //============================================================ | |
| 262 | ||
| 263 | int renderer_dd::create() | |
| 264 | { | |
| 265 | // configure the adapter for the mode we want | |
| 266 | if (config_adapter_mode()) | |
| 267 | { | |
| 268 | osd_printf_error("Unable to configure adapter.\n"); | |
| 269 | goto error; | |
| 270 | } | |
| 271 | ||
| 272 | // create the ddraw object | |
| 273 | if (ddraw_create()) | |
| 274 | { | |
| 275 | osd_printf_error("Unable to create ddraw object.\n"); | |
| 276 | goto error; | |
| 277 | } | |
| 278 | ||
| 279 | return 0; | |
| 280 | ||
| 281 | error: | |
| 282 | destroy(); | |
| 283 | osd_printf_error("Unable to initialize DirectDraw.\n"); | |
| 284 | return 1; | |
| 285 | } | |
| 286 | ||
| 287 | ||
| 288 | ||
| 289 | //============================================================ | |
| 290 | // drawdd_window_destroy | |
| 291 | //============================================================ | |
| 292 | ||
| 293 | void renderer_dd::destroy() | |
| 294 | { | |
| 295 | // delete the ddraw object | |
| 296 | ddraw_delete(); | |
| 297 | } | |
| 298 | ||
| 299 | ||
| 300 | ||
| 301 | //============================================================ | |
| 302 | // drawdd_window_get_primitives | |
| 303 | //============================================================ | |
| 304 | ||
| 305 | render_primitive_list *renderer_dd::get_primitives() | |
| 306 | { | |
| 307 | compute_blit_surface_size(); | |
| 308 | window().target()->set_bounds(blitwidth, blitheight, 0); | |
| 309 | window().target()->set_max_update_rate((refresh == 0) ? origmode.dwRefreshRate : refresh); | |
| 310 | ||
| 311 | return &window().target()->get_primitives(); | |
| 312 | } | |
| 313 | ||
| 314 | ||
| 315 | ||
| 316 | //============================================================ | |
| 317 | // drawdd_window_draw | |
| 318 | //============================================================ | |
| 319 | ||
| 320 | int renderer_dd::draw(const int update) | |
| 321 | { | |
| 322 | render_primitive *prim; | |
| 323 | int usemembuffer = FALSE; | |
| 324 | HRESULT result; | |
| 325 | ||
| 326 | // if we're updating, remember to erase the outer stuff | |
| 327 | if (update) | |
| 328 | update_outer_rects(); | |
| 329 | ||
| 330 | // if we have a ddraw object, check the cooperative level | |
| 331 | if (ddraw_test_cooperative()) | |
| 332 | return 1; | |
| 333 | ||
| 334 | // get the size; if we're too small, delete the existing surfaces | |
| 335 | if (blitwidth > blitdesc.dwWidth || blitheight > blitdesc.dwHeight) | |
| 336 | ddraw_delete_surfaces(); | |
| 337 | ||
| 338 | // if we need to create surfaces, do it now | |
| 339 | if (blit == NULL && ddraw_create_surfaces() != 0) | |
| 340 | return 1; | |
| 341 | ||
| 342 | // select our surface and lock it | |
| 343 | result = IDirectDrawSurface7_Lock(blit, NULL, &blitdesc, DDLOCK_WAIT, NULL); | |
| 344 | if (result == DDERR_SURFACELOST) | |
| 345 | { | |
| 346 | osd_printf_verbose("DirectDraw: Lost surfaces; deleting and retrying next frame\n"); | |
| 347 | ddraw_delete_surfaces(); | |
| 348 | return 1; | |
| 349 | } | |
| 350 | if (result != DD_OK) | |
| 351 | { | |
| 352 | osd_printf_verbose("DirectDraw: Error %08X locking blit surface\n", (int)result); | |
| 353 | return 1; | |
| 354 | } | |
| 355 | ||
| 356 | // render to it | |
| 357 | window().m_primlist->acquire_lock(); | |
| 358 | ||
| 359 | // scan the list of primitives for tricky stuff | |
| 360 | for (prim = window().m_primlist->first(); prim != NULL; prim = prim->next()) | |
| 361 | if (PRIMFLAG_GET_BLENDMODE(prim->flags) != BLENDMODE_NONE || | |
| 362 | (prim->texture.base != NULL && PRIMFLAG_GET_TEXFORMAT(prim->flags) == TEXFORMAT_ARGB32)) | |
| 363 | { | |
| 364 | usemembuffer = TRUE; | |
| 365 | break; | |
| 366 | } | |
| 367 | ||
| 368 | // if we're using the memory buffer, draw offscreen first and then copy | |
| 369 | if (usemembuffer) | |
| 370 | { | |
| 371 | int x, y; | |
| 372 | ||
| 373 | // based on the target format, use one of our standard renderers | |
| 374 | switch (blitdesc.ddpfPixelFormat.dwRBitMask) | |
| 375 | { | |
| 376 | case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break; | |
| 377 | case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break; | |
| 378 | case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break; | |
| 379 | case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0>::draw_primitives(*window().m_primlist, membuffer, blitwidth, blitheight, blitwidth); break; | |
| 380 | default: | |
| 381 | osd_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)blitdesc.ddpfPixelFormat.dwRBitMask, (int)blitdesc.ddpfPixelFormat.dwGBitMask, (int)blitdesc.ddpfPixelFormat.dwBBitMask); | |
| 382 | break; | |
| 383 | } | |
| 384 | ||
| 385 | // handle copying to both 16bpp and 32bpp destinations | |
| 386 | for (y = 0; y < blitheight; y++) | |
| 387 | { | |
| 388 | if (blitdesc.ddpfPixelFormat.dwRGBBitCount == 32) | |
| 389 | { | |
| 390 | UINT32 *src = (UINT32 *)membuffer + y * blitwidth; | |
| 391 | UINT32 *dst = (UINT32 *)((UINT8 *)blitdesc.lpSurface + y * blitdesc.lPitch); | |
| 392 | for (x = 0; x < blitwidth; x++) | |
| 393 | *dst++ = *src++; | |
| 394 | } | |
| 395 | else if (blitdesc.ddpfPixelFormat.dwRGBBitCount == 16) | |
| 396 | { | |
| 397 | UINT16 *src = (UINT16 *)membuffer + y * blitwidth; | |
| 398 | UINT16 *dst = (UINT16 *)((UINT8 *)blitdesc.lpSurface + y * blitdesc.lPitch); | |
| 399 | for (x = 0; x < blitwidth; x++) | |
| 400 | *dst++ = *src++; | |
| 401 | } | |
| 402 | } | |
| 403 | ||
| 404 | } | |
| 405 | ||
| 406 | // otherwise, draw directly | |
| 407 | else | |
| 408 | { | |
| 409 | // based on the target format, use one of our standard renderers | |
| 410 | switch (blitdesc.ddpfPixelFormat.dwRBitMask) | |
| 411 | { | |
| 412 | case 0x00ff0000: software_renderer<UINT32, 0,0,0, 16,8,0, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 4); break; | |
| 413 | case 0x000000ff: software_renderer<UINT32, 0,0,0, 0,8,16, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 4); break; | |
| 414 | case 0xf800: software_renderer<UINT16, 3,2,3, 11,5,0, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 2); break; | |
| 415 | case 0x7c00: software_renderer<UINT16, 3,3,3, 10,5,0, true>::draw_primitives(*window().m_primlist, blitdesc.lpSurface, blitwidth, blitheight, blitdesc.lPitch / 2); break; | |
| 416 | default: | |
| 417 | osd_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)blitdesc.ddpfPixelFormat.dwRBitMask, (int)blitdesc.ddpfPixelFormat.dwGBitMask, (int)blitdesc.ddpfPixelFormat.dwBBitMask); | |
| 418 | break; | |
| 419 | } | |
| 420 | } | |
| 421 | window().m_primlist->release_lock(); | |
| 422 | ||
| 423 | // unlock and blit | |
| 424 | result = IDirectDrawSurface7_Unlock(blit, NULL); | |
| 425 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X unlocking blit surface\n", (int)result); | |
| 426 | ||
| 427 | // sync to VBLANK | |
| 428 | if ((video_config.waitvsync || video_config.syncrefresh) && window().machine().video().throttled() && (!window().fullscreen() || back == NULL)) | |
| 429 | { | |
| 430 | result = IDirectDraw7_WaitForVerticalBlank(ddraw, DDWAITVB_BLOCKBEGIN, NULL); | |
| 431 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X waiting for VBLANK\n", (int)result); | |
| 432 | } | |
| 433 | ||
| 434 | // complete the blitting | |
| 435 | blit_to_primary(blitwidth, blitheight); | |
| 436 | return 0; | |
| 437 | } | |
| 438 | ||
| 439 | ||
| 440 | ||
| 441 | //============================================================ | |
| 442 | // ddraw_create | |
| 443 | //============================================================ | |
| 444 | ||
| 445 | int renderer_dd::ddraw_create() | |
| 446 | { | |
| 447 | HRESULT result; | |
| 448 | int verify; | |
| 449 | ||
| 450 | // if a device exists, free it | |
| 451 | if (ddraw != NULL) | |
| 452 | ddraw_delete(); | |
| 453 | ||
| 454 | // create the DirectDraw object | |
| 455 | result = (*directdrawcreateex)(adapter_ptr, (LPVOID *)&ddraw, WRAP_REFIID(IID_IDirectDraw7), NULL); | |
| 456 | if (result != DD_OK) | |
| 457 | { | |
| 458 | osd_printf_verbose("DirectDraw: Error %08X during DirectDrawCreateEx call\n", (int)result); | |
| 459 | goto error; | |
| 460 | } | |
| 461 | ||
| 462 | // verify the caps | |
| 463 | verify = ddraw_verify_caps(); | |
| 464 | if (verify == 2) | |
| 465 | { | |
| 466 | osd_printf_error("DirectDraw: Error - Device does not meet minimum requirements for DirectDraw rendering\n"); | |
| 467 | goto error; | |
| 468 | } | |
| 469 | if (verify == 1) | |
| 470 | osd_printf_verbose("DirectDraw: Warning - Device may not perform well for DirectDraw rendering\n"); | |
| 471 | ||
| 472 | // set the cooperative level | |
| 473 | // for non-window modes, we will use full screen here | |
| 474 | result = IDirectDraw7_SetCooperativeLevel(ddraw, win_window_list->m_hwnd, DDSCL_SETFOCUSWINDOW); | |
| 475 | if (result != DD_OK) | |
| 476 | { | |
| 477 | osd_printf_verbose("DirectDraw: Error %08X during IDirectDraw7_SetCooperativeLevel(FOCUSWINDOW) call\n", (int)result); | |
| 478 | goto error; | |
| 479 | } | |
| 480 | result = IDirectDraw7_SetCooperativeLevel(ddraw, window().m_hwnd, DDSCL_SETDEVICEWINDOW | (window().fullscreen() ? DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE : DDSCL_NORMAL)); | |
| 481 | if (result != DD_OK) | |
| 482 | { | |
| 483 | osd_printf_verbose("DirectDraw: Error %08X during IDirectDraw7_SetCooperativeLevel(DEVICEWINDOW) call\n", (int)result); | |
| 484 | goto error; | |
| 485 | } | |
| 486 | ||
| 487 | // full screen mode: set the resolution | |
| 488 | if (window().fullscreen() && video_config.switchres) | |
| 489 | { | |
| 490 | result = IDirectDraw7_SetDisplayMode(ddraw, width, height, 32, refresh, 0); | |
| 491 | if (result != DD_OK) | |
| 492 | { | |
| 493 | osd_printf_verbose("DirectDraw: Error %08X attempting to set video mode %dx%d@%d call\n", (int)result, width, height, refresh); | |
| 494 | goto error; | |
| 495 | } | |
| 496 | } | |
| 497 | ||
| 498 | return ddraw_create_surfaces(); | |
| 499 | ||
| 500 | error: | |
| 501 | ddraw_delete(); | |
| 502 | return 1; | |
| 503 | } | |
| 504 | ||
| 505 | ||
| 506 | ||
| 507 | //============================================================ | |
| 508 | // ddraw_create_surfaces | |
| 509 | //============================================================ | |
| 510 | ||
| 511 | int renderer_dd::ddraw_create_surfaces() | |
| 512 | { | |
| 513 | HRESULT result; | |
| 514 | ||
| 515 | // make a description of the primary surface | |
| 516 | memset(&primarydesc, 0, sizeof(primarydesc)); | |
| 517 | primarydesc.dwSize = sizeof(primarydesc); | |
| 518 | primarydesc.dwFlags = DDSD_CAPS; | |
| 519 | primarydesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; | |
| 520 | ||
| 521 | // for triple-buffered full screen mode, allocate flipping surfaces | |
| 522 | if (window().fullscreen() && video_config.triplebuf) | |
| 523 | { | |
| 524 | primarydesc.dwFlags |= DDSD_BACKBUFFERCOUNT; | |
| 525 | primarydesc.ddsCaps.dwCaps |= DDSCAPS_FLIP | DDSCAPS_COMPLEX; | |
| 526 | primarydesc.dwBackBufferCount = 2; | |
| 527 | } | |
| 528 | ||
| 529 | // create the primary surface and report errors | |
| 530 | result = create_surface(&primarydesc, &primary, "primary"); | |
| 531 | if (result != DD_OK) goto error; | |
| 532 | ||
| 533 | // full screen mode: get the back surface | |
| 534 | back = NULL; | |
| 535 | if (window().fullscreen() && video_config.triplebuf) | |
| 536 | { | |
| 537 | DDSCAPS2 caps = { DDSCAPS_BACKBUFFER }; | |
| 538 | result = IDirectDrawSurface7_GetAttachedSurface(primary, &caps, &back); | |
| 539 | if (result != DD_OK) | |
| 540 | { | |
| 541 | osd_printf_verbose("DirectDraw: Error %08X getting attached back surface\n", (int)result); | |
| 542 | goto error; | |
| 543 | } | |
| 544 | } | |
| 545 | ||
| 546 | // now make a description of our blit surface, based on the primary surface | |
| 547 | if (blitwidth == 0 || blitheight == 0) | |
| 548 | compute_blit_surface_size(); | |
| 549 | blitdesc = primarydesc; | |
| 550 | blitdesc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS; | |
| 551 | blitdesc.dwWidth = blitwidth; | |
| 552 | blitdesc.dwHeight = blitheight; | |
| 553 | blitdesc.ddsCaps.dwCaps = DDSCAPS_VIDEOMEMORY; | |
| 554 | ||
| 555 | // then create the blit surface, fall back to system memory if video mem doesn't work | |
| 556 | result = create_surface(&blitdesc, &blit, "blit"); | |
| 557 | if (result != DD_OK) | |
| 558 | { | |
| 559 | blitdesc.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY; | |
| 560 | result = create_surface(&blitdesc, &blit, "blit"); | |
| 561 | } | |
| 562 | if (result != DD_OK) goto error; | |
| 563 | ||
| 564 | // create a memory buffer for offscreen drawing | |
| 565 | if (membuffersize < blitwidth * blitheight * 4) | |
| 566 | { | |
| 567 | membuffersize = blitwidth * blitheight * 4; | |
| 568 | global_free_array(membuffer); | |
| 569 | membuffer = global_alloc_array_nothrow(UINT8, membuffersize); | |
| 570 | } | |
| 571 | if (membuffer == NULL) | |
| 572 | goto error; | |
| 573 | ||
| 574 | // create a clipper for windowed mode | |
| 575 | if (!window().fullscreen() && create_clipper()) | |
| 576 | goto error; | |
| 577 | ||
| 578 | // full screen mode: set the gamma | |
| 579 | if (window().fullscreen()) | |
| 580 | { | |
| 581 | // only set the gamma if it's not 1.0f | |
| 582 | windows_options &options = downcast<windows_options &>(window().machine().options()); | |
| 583 | float brightness = options.full_screen_brightness(); | |
| 584 | float contrast = options.full_screen_contrast(); | |
| 585 | float fgamma = options.full_screen_gamma(); | |
| 586 | if (brightness != 1.0f || contrast != 1.0f || fgamma != 1.0f) | |
| 587 | { | |
| 588 | // see if we can get a GammaControl object | |
| 589 | result = IDirectDrawSurface_QueryInterface(primary, WRAP_REFIID(IID_IDirectDrawGammaControl), (void **)&gamma); | |
| 590 | if (result != DD_OK) | |
| 591 | { | |
| 592 | osd_printf_warning("DirectDraw: Warning - device does not support full screen gamma correction.\n"); | |
| 593 | this->gamma = NULL; | |
| 594 | } | |
| 595 | ||
| 596 | // proceed if we can | |
| 597 | if (this->gamma != NULL) | |
| 598 | { | |
| 599 | DDGAMMARAMP ramp; | |
| 600 | int i; | |
| 601 | ||
| 602 | // create a standard ramp and set it | |
| 603 | for (i = 0; i < 256; i++) | |
| 604 | ramp.red[i] = ramp.green[i] = ramp.blue[i] = apply_brightness_contrast_gamma(i, brightness, contrast, fgamma) << 8; | |
| 605 | ||
| 606 | // attempt to set it | |
| 607 | result = IDirectDrawGammaControl_SetGammaRamp(this->gamma, 0, &ramp); | |
| 608 | if (result != DD_OK) | |
| 609 | osd_printf_verbose("DirectDraw: Error %08X attempting to set gamma correction.\n", (int)result); | |
| 610 | } | |
| 611 | } | |
| 612 | } | |
| 613 | ||
| 614 | // force some updates | |
| 615 | update_outer_rects(); | |
| 616 | return 0; | |
| 617 | ||
| 618 | error: | |
| 619 | ddraw_delete_surfaces(); | |
| 620 | return 1; | |
| 621 | } | |
| 622 | ||
| 623 | ||
| 624 | ||
| 625 | //============================================================ | |
| 626 | // ddraw_delete | |
| 627 | //============================================================ | |
| 628 | ||
| 629 | void renderer_dd::ddraw_delete() | |
| 630 | { | |
| 631 | // free surfaces | |
| 632 | ddraw_delete_surfaces(); | |
| 633 | ||
| 634 | // restore resolutions | |
| 635 | if (ddraw != NULL) | |
| 636 | IDirectDraw7_RestoreDisplayMode(ddraw); | |
| 637 | ||
| 638 | // reset cooperative level | |
| 639 | if (ddraw != NULL && window().m_hwnd != NULL) | |
| 640 | IDirectDraw7_SetCooperativeLevel(ddraw, window().m_hwnd, DDSCL_NORMAL); | |
| 641 | ||
| 642 | // release the DirectDraw object itself | |
| 643 | if (ddraw != NULL) | |
| 644 | IDirectDraw7_Release(ddraw); | |
| 645 | ddraw = NULL; | |
| 646 | } | |
| 647 | ||
| 648 | ||
| 649 | ||
| 650 | //============================================================ | |
| 651 | // ddraw_delete_surfaces | |
| 652 | //============================================================ | |
| 653 | ||
| 654 | void renderer_dd::ddraw_delete_surfaces() | |
| 655 | { | |
| 656 | // release the gamma control | |
| 657 | if (gamma != NULL) | |
| 658 | IDirectDrawGammaControl_Release(gamma); | |
| 659 | gamma = NULL; | |
| 660 | ||
| 661 | // release the clipper | |
| 662 | if (clipper != NULL) | |
| 663 | IDirectDrawClipper_Release(clipper); | |
| 664 | clipper = NULL; | |
| 665 | ||
| 666 | // free the memory buffer | |
| 667 | global_free_array(membuffer); | |
| 668 | membuffer = NULL; | |
| 669 | membuffersize = 0; | |
| 670 | ||
| 671 | // release the blit surface | |
| 672 | if (blit != NULL) | |
| 673 | IDirectDrawSurface7_Release(blit); | |
| 674 | blit = NULL; | |
| 675 | ||
| 676 | // release the back surface | |
| 677 | if (back != NULL) | |
| 678 | IDirectDrawSurface7_Release(back); | |
| 679 | back = NULL; | |
| 680 | ||
| 681 | // release the primary surface | |
| 682 | if (primary != NULL) | |
| 683 | IDirectDrawSurface7_Release(primary); | |
| 684 | primary = NULL; | |
| 685 | } | |
| 686 | ||
| 687 | ||
| 688 | ||
| 689 | //============================================================ | |
| 690 | // ddraw_verify_caps | |
| 691 | //============================================================ | |
| 692 | ||
| 693 | int renderer_dd::ddraw_verify_caps() | |
| 694 | { | |
| 695 | int retval = 0; | |
| 696 | HRESULT result; | |
| 697 | ||
| 698 | // get the capabilities | |
| 699 | ddcaps.dwSize = sizeof(ddcaps); | |
| 700 | helcaps.dwSize = sizeof(helcaps); | |
| 701 | result = IDirectDraw7_GetCaps(ddraw, &ddcaps, &helcaps); | |
| 702 | if (result != DD_OK) | |
| 703 | { | |
| 704 | osd_printf_verbose("DirectDraw: Error %08X during IDirectDraw7_GetCaps call\n", (int)result); | |
| 705 | return 1; | |
| 706 | } | |
| 707 | ||
| 708 | // determine if hardware stretching is available | |
| 709 | if ((ddcaps.dwCaps & DDCAPS_BLTSTRETCH) == 0) | |
| 710 | { | |
| 711 | osd_printf_verbose("DirectDraw: Warning - Device does not support hardware stretching\n"); | |
| 712 | retval = 1; | |
| 713 | } | |
| 714 | ||
| 715 | return retval; | |
| 716 | } | |
| 717 | ||
| 718 | ||
| 719 | ||
| 720 | //============================================================ | |
| 721 | // ddraw_test_cooperative | |
| 722 | //============================================================ | |
| 723 | ||
| 724 | int renderer_dd::ddraw_test_cooperative() | |
| 725 | { | |
| 726 | HRESULT result; | |
| 727 | ||
| 728 | // check our current status; if we lost the device, punt to GDI | |
| 729 | result = IDirectDraw7_TestCooperativeLevel(ddraw); | |
| 730 | switch (result) | |
| 731 | { | |
| 732 | // punt to GDI if someone else has exclusive mode | |
| 733 | case DDERR_NOEXCLUSIVEMODE: | |
| 734 | case DDERR_EXCLUSIVEMODEALREADYSET: | |
| 735 | ddraw_delete_surfaces(); | |
| 736 | return 1; | |
| 737 | ||
| 738 | // if we're ok, but we don't have a primary surface, create one | |
| 739 | default: | |
| 740 | case DD_OK: | |
| 741 | if (primary == NULL) | |
| 742 | return ddraw_create_surfaces(); | |
| 743 | return 0; | |
| 744 | } | |
| 745 | } | |
| 746 | ||
| 747 | ||
| 748 | ||
| 749 | //============================================================ | |
| 750 | // create_surface | |
| 751 | //============================================================ | |
| 752 | ||
| 753 | HRESULT renderer_dd::create_surface(DDSURFACEDESC2 *desc, IDirectDrawSurface7 **surface, const char *type) | |
| 754 | { | |
| 755 | HRESULT result; | |
| 756 | ||
| 757 | // create the surface as requested | |
| 758 | result = IDirectDraw7_CreateSurface(ddraw, desc, surface, NULL); | |
| 759 | if (result != DD_OK) | |
| 760 | { | |
| 761 | osd_printf_verbose("DirectDraw: Error %08X creating %s surface\n", (int)result, type); | |
| 762 | return result; | |
| 763 | } | |
| 764 | ||
| 765 | // get a description of the primary surface | |
| 766 | result = IDirectDrawSurface7_GetSurfaceDesc(*surface, desc); | |
| 767 | if (result != DD_OK) | |
| 768 | { | |
| 769 | osd_printf_verbose("DirectDraw: Error %08X getting %s surface desciption\n", (int)result, type); | |
| 770 | IDirectDrawSurface7_Release(*surface); | |
| 771 | *surface = NULL; | |
| 772 | return result; | |
| 773 | } | |
| 774 | ||
| 775 | // print out the good stuff | |
| 776 | osd_printf_verbose("DirectDraw: %s surface created: %dx%dx%d (R=%08X G=%08X B=%08X)\n", | |
| 777 | type, | |
| 778 | (int)desc->dwWidth, | |
| 779 | (int)desc->dwHeight, | |
| 780 | (int)desc->ddpfPixelFormat.dwRGBBitCount, | |
| 781 | (UINT32)desc->ddpfPixelFormat.dwRBitMask, | |
| 782 | (UINT32)desc->ddpfPixelFormat.dwGBitMask, | |
| 783 | (UINT32)desc->ddpfPixelFormat.dwBBitMask); | |
| 784 | return result; | |
| 785 | } | |
| 786 | ||
| 787 | ||
| 788 | ||
| 789 | //============================================================ | |
| 790 | // create_clipper | |
| 791 | //============================================================ | |
| 792 | ||
| 793 | int renderer_dd::create_clipper() | |
| 794 | { | |
| 795 | HRESULT result; | |
| 796 | ||
| 797 | // create a clipper for the primary surface | |
| 798 | result = IDirectDraw7_CreateClipper(ddraw, 0, &clipper, NULL); | |
| 799 | if (result != DD_OK) | |
| 800 | { | |
| 801 | osd_printf_verbose("DirectDraw: Error %08X creating clipper\n", (int)result); | |
| 802 | return 1; | |
| 803 | } | |
| 804 | ||
| 805 | // set the clipper's hwnd | |
| 806 | result = IDirectDrawClipper_SetHWnd(clipper, 0, window().m_hwnd); | |
| 807 | if (result != DD_OK) | |
| 808 | { | |
| 809 | osd_printf_verbose("DirectDraw: Error %08X setting clipper hwnd\n", (int)result); | |
| 810 | return 1; | |
| 811 | } | |
| 812 | ||
| 813 | // set the clipper on the primary surface | |
| 814 | result = IDirectDrawSurface7_SetClipper(primary, clipper); | |
| 815 | if (result != DD_OK) | |
| 816 | { | |
| 817 | osd_printf_verbose("DirectDraw: Error %08X setting clipper on primary surface\n", (int)result); | |
| 818 | return 1; | |
| 819 | } | |
| 820 | return 0; | |
| 821 | } | |
| 822 | ||
| 823 | ||
| 824 | ||
| 825 | //============================================================ | |
| 826 | // compute_blit_surface_size | |
| 827 | //============================================================ | |
| 828 | ||
| 829 | void renderer_dd::compute_blit_surface_size() | |
| 830 | { | |
| 831 | INT32 newwidth, newheight; | |
| 832 | int xscale, yscale; | |
| 833 | RECT client; | |
| 834 | ||
| 835 | // start with the minimum size | |
| 836 | window().target()->compute_minimum_size(newwidth, newheight); | |
| 837 | ||
| 838 | // get the window's client rectangle | |
| 839 | GetClientRect(window().m_hwnd, &client); | |
| 840 | ||
| 841 | // hardware stretch case: apply prescale | |
| 842 | if (video_config.hwstretch) | |
| 843 | { | |
| 844 | int prescale = (window().prescale() < 1) ? 1 : window().prescale(); | |
| 845 | ||
| 846 | // clamp the prescale to something smaller than the target bounds | |
| 847 | xscale = prescale; | |
| 848 | while (xscale > 1 && newwidth * xscale > rect_width(&client)) | |
| 849 | xscale--; | |
| 850 | yscale = prescale; | |
| 851 | while (yscale > 1 && newheight * yscale > rect_height(&client)) | |
| 852 | yscale--; | |
| 853 | } | |
| 854 | ||
| 855 | // non stretch case | |
| 856 | else | |
| 857 | { | |
| 858 | INT32 target_width = rect_width(&client); | |
| 859 | INT32 target_height = rect_height(&client); | |
| 860 | float desired_aspect = 1.0f; | |
| 861 | ||
| 862 | // compute the appropriate visible area if we're trying to keepaspect | |
| 863 | if (video_config.keepaspect) | |
| 864 | { | |
| 865 | osd_monitor_info *monitor = window().winwindow_video_window_monitor(NULL); | |
| 866 | window().target()->compute_visible_area(target_width, target_height, monitor->aspect(), window().target()->orientation(), target_width, target_height); | |
| 867 | desired_aspect = (float)target_width / (float)target_height; | |
| 868 | } | |
| 869 | ||
| 870 | // compute maximum integral scaling to fit the window | |
| 871 | xscale = (target_width + 2) / newwidth; | |
| 872 | yscale = (target_height + 2) / newheight; | |
| 873 | ||
| 874 | // try a little harder to keep the aspect ratio if desired | |
| 875 | if (video_config.keepaspect) | |
| 876 | { | |
| 877 | // if we could stretch more in the X direction, and that makes a better fit, bump the xscale | |
| 878 | while (newwidth * (xscale + 1) <= rect_width(&client) && | |
| 879 | better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale + 1), newheight * yscale, desired_aspect)) | |
| 880 | xscale++; | |
| 881 | ||
| 882 | // if we could stretch more in the Y direction, and that makes a better fit, bump the yscale | |
| 883 | while (newheight * (yscale + 1) <= rect_height(&client) && | |
| 884 | better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale + 1), desired_aspect)) | |
| 885 | yscale++; | |
| 886 | ||
| 887 | // now that we've maxed out, see if backing off the maximally stretched one makes a better fit | |
| 888 | if (rect_width(&client) - newwidth * xscale < rect_height(&client) - newheight * yscale) | |
| 889 | { | |
| 890 | while (xscale > 1 && better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale - 1), newheight * yscale, desired_aspect)) | |
| 891 | xscale--; | |
| 892 | } | |
| 893 | else | |
| 894 | { | |
| 895 | while (yscale > 1 && better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale - 1), desired_aspect)) | |
| 896 | yscale--; | |
| 897 | } | |
| 898 | } | |
| 899 | } | |
| 900 | ||
| 901 | // ensure at least a scale factor of 1 | |
| 902 | if (xscale == 0) xscale = 1; | |
| 903 | if (yscale == 0) yscale = 1; | |
| 904 | ||
| 905 | // apply the final scale | |
| 906 | newwidth *= xscale; | |
| 907 | newheight *= yscale; | |
| 908 | if (newwidth != blitwidth || newheight != blitheight) | |
| 909 | { | |
| 910 | // force some updates | |
| 911 | update_outer_rects(); | |
| 912 | osd_printf_verbose("DirectDraw: New blit size = %dx%d\n", newwidth, newheight); | |
| 913 | } | |
| 914 | blitwidth = newwidth; | |
| 915 | blitheight = newheight; | |
| 916 | } | |
| 917 | ||
| 918 | ||
| 919 | ||
| 920 | //============================================================ | |
| 921 | // calc_fullscreen_margins | |
| 922 | //============================================================ | |
| 923 | ||
| 924 | void renderer_dd::calc_fullscreen_margins(DWORD desc_width, DWORD desc_height, RECT *margins) | |
| 925 | { | |
| 926 | margins->left = 0; | |
| 927 | margins->top = 0; | |
| 928 | margins->right = desc_width; | |
| 929 | margins->bottom = desc_height; | |
| 930 | ||
| 931 | if (window().win_has_menu()) | |
| 932 | { | |
| 933 | static int height_with_menubar = 0; | |
| 934 | if (height_with_menubar == 0) | |
| 935 | { | |
| 936 | RECT with_menu = { 100, 100, 200, 200 }; | |
| 937 | RECT without_menu = { 100, 100, 200, 200 }; | |
| 938 | AdjustWindowRect(&with_menu, WS_OVERLAPPED, TRUE); | |
| 939 | AdjustWindowRect(&without_menu, WS_OVERLAPPED, FALSE); | |
| 940 | height_with_menubar = (with_menu.bottom - with_menu.top) - (without_menu.bottom - without_menu.top); | |
| 941 | } | |
| 942 | margins->top = height_with_menubar; | |
| 943 | } | |
| 944 | } | |
| 945 | ||
| 946 | ||
| 947 | ||
| 948 | //============================================================ | |
| 949 | // blit_to_primary | |
| 950 | //============================================================ | |
| 951 | ||
| 952 | void renderer_dd::blit_to_primary(int srcwidth, int srcheight) | |
| 953 | { | |
| 954 | IDirectDrawSurface7 *target = (back != NULL) ? back : primary; | |
| 955 | osd_monitor_info *monitor = window().winwindow_video_window_monitor(NULL); | |
| 956 | DDBLTFX blitfx = { sizeof(DDBLTFX) }; | |
| 957 | RECT clear, outer, dest, source; | |
| 958 | INT32 dstwidth, dstheight; | |
| 959 | HRESULT result; | |
| 960 | ||
| 961 | // compute source rect | |
| 962 | source.left = source.top = 0; | |
| 963 | source.right = srcwidth; | |
| 964 | source.bottom = srcheight; | |
| 965 | ||
| 966 | // compute outer rect -- windowed version | |
| 967 | if (!window().fullscreen()) | |
| 968 | { | |
| 969 | GetClientRect(window().m_hwnd, &outer); | |
| 970 | ClientToScreen(window().m_hwnd, &((LPPOINT)&outer)[0]); | |
| 971 | ClientToScreen(window().m_hwnd, &((LPPOINT)&outer)[1]); | |
| 972 | ||
| 973 | // adjust to be relative to the monitor | |
| 974 | osd_rect pos = monitor->position_size(); | |
| 975 | outer.left -= pos.left(); | |
| 976 | outer.right -= pos.left(); | |
| 977 | outer.top -= pos.top(); | |
| 978 | outer.bottom -= pos.top(); | |
| 979 | } | |
| 980 | ||
| 981 | // compute outer rect -- full screen version | |
| 982 | else | |
| 983 | { | |
| 984 | calc_fullscreen_margins(primarydesc.dwWidth, primarydesc.dwHeight, &outer); | |
| 985 | } | |
| 986 | ||
| 987 | // if we're respecting the aspect ratio, we need to adjust to fit | |
| 988 | dstwidth = rect_width(&outer); | |
| 989 | dstheight = rect_height(&outer); | |
| 990 | if (!video_config.hwstretch) | |
| 991 | { | |
| 992 | // trim the source if necessary | |
| 993 | if (rect_width(&outer) < srcwidth) | |
| 994 | { | |
| 995 | source.left += (srcwidth - rect_width(&outer)) / 2; | |
| 996 | source.right = source.left + rect_width(&outer); | |
| 997 | } | |
| 998 | if (rect_height(&outer) < srcheight) | |
| 999 | { | |
| 1000 | source.top += (srcheight - rect_height(&outer)) / 2; | |
| 1001 | source.bottom = source.top + rect_height(&outer); | |
| 1002 | } | |
| 1003 | ||
| 1004 | // match the destination and source sizes | |
| 1005 | dstwidth = srcwidth = source.right - source.left; | |
| 1006 | dstheight = srcheight = source.bottom - source.top; | |
| 1007 | } | |
| 1008 | else if (video_config.keepaspect) | |
| 1009 | { | |
| 1010 | // compute the appropriate visible area | |
| 1011 | window().target()->compute_visible_area(rect_width(&outer), rect_height(&outer), monitor->aspect(), window().target()->orientation(), dstwidth, dstheight); | |
| 1012 | } | |
| 1013 | ||
| 1014 | // center within | |
| 1015 | dest.left = outer.left + (rect_width(&outer) - dstwidth) / 2; | |
| 1016 | dest.right = dest.left + dstwidth; | |
| 1017 | dest.top = outer.top + (rect_height(&outer) - dstheight) / 2; | |
| 1018 | dest.bottom = dest.top + dstheight; | |
| 1019 | ||
| 1020 | // compare against last destination; if different, force a redraw | |
| 1021 | if (dest.left != lastdest.left || dest.right != lastdest.right || dest.top != lastdest.top || dest.bottom != lastdest.bottom) | |
| 1022 | { | |
| 1023 | lastdest = dest; | |
| 1024 | update_outer_rects(); | |
| 1025 | } | |
| 1026 | ||
| 1027 | // clear outer rects if we need to | |
| 1028 | if (clearouter != 0) | |
| 1029 | { | |
| 1030 | clearouter--; | |
| 1031 | ||
| 1032 | // clear the left edge | |
| 1033 | if (dest.left > outer.left) | |
| 1034 | { | |
| 1035 | clear = outer; | |
| 1036 | clear.right = dest.left; | |
| 1037 | result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx); | |
| 1038 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result); | |
| 1039 | } | |
| 1040 | ||
| 1041 | // clear the right edge | |
| 1042 | if (dest.right < outer.right) | |
| 1043 | { | |
| 1044 | clear = outer; | |
| 1045 | clear.left = dest.right; | |
| 1046 | result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx); | |
| 1047 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result); | |
| 1048 | } | |
| 1049 | ||
| 1050 | // clear the top edge | |
| 1051 | if (dest.top > outer.top) | |
| 1052 | { | |
| 1053 | clear = outer; | |
| 1054 | clear.bottom = dest.top; | |
| 1055 | result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx); | |
| 1056 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result); | |
| 1057 | } | |
| 1058 | ||
| 1059 | // clear the bottom edge | |
| 1060 | if (dest.bottom < outer.bottom) | |
| 1061 | { | |
| 1062 | clear = outer; | |
| 1063 | clear.top = dest.bottom; | |
| 1064 | result = IDirectDrawSurface_Blt(target, &clear, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &blitfx); | |
| 1065 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X clearing the screen\n", (int)result); | |
| 1066 | } | |
| 1067 | } | |
| 1068 | ||
| 1069 | // do the blit | |
| 1070 | result = IDirectDrawSurface7_Blt(target, &dest, blit, &source, DDBLT_WAIT, NULL); | |
| 1071 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X blitting to the screen\n", (int)result); | |
| 1072 | ||
| 1073 | // page flip if triple buffered | |
| 1074 | if (window().fullscreen() && back != NULL) | |
| 1075 | { | |
| 1076 | result = IDirectDrawSurface7_Flip(primary, NULL, DDFLIP_WAIT); | |
| 1077 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X waiting for VBLANK\n", (int)result); | |
| 1078 | } | |
| 1079 | } | |
| 1080 | ||
| 1081 | ||
| 1082 | ||
| 1083 | //============================================================ | |
| 1084 | // config_adapter_mode | |
| 1085 | //============================================================ | |
| 1086 | ||
| 1087 | int renderer_dd::config_adapter_mode() | |
| 1088 | { | |
| 1089 | DDDEVICEIDENTIFIER2 identifier; | |
| 1090 | HRESULT result; | |
| 1091 | ||
| 1092 | // choose the monitor number | |
| 1093 | get_adapter_for_monitor(window().monitor()); | |
| 1094 | ||
| 1095 | // create a temporary DirectDraw object | |
| 1096 | result = (*directdrawcreateex)(adapter_ptr, (LPVOID *)&ddraw, WRAP_REFIID(IID_IDirectDraw7), NULL); | |
| 1097 | if (result != DD_OK) | |
| 1098 | { | |
| 1099 | osd_printf_verbose("DirectDraw: Error %08X during DirectDrawCreateEx call\n", (int)result); | |
| 1100 | return 1; | |
| 1101 | } | |
| 1102 | ||
| 1103 | // get the identifier | |
| 1104 | result = IDirectDraw7_GetDeviceIdentifier(ddraw, &identifier, 0); | |
| 1105 | if (result != DD_OK) | |
| 1106 | { | |
| 1107 | osd_printf_error("Error getting identifier for device\n"); | |
| 1108 | return 1; | |
| 1109 | } | |
| 1110 | osd_printf_verbose("DirectDraw: Configuring device %s\n", identifier.szDescription); | |
| 1111 | ||
| 1112 | // get the current display mode | |
| 1113 | memset(&origmode, 0, sizeof(origmode)); | |
| 1114 | origmode.dwSize = sizeof(origmode); | |
| 1115 | result = IDirectDraw7_GetDisplayMode(ddraw, &origmode); | |
| 1116 | if (result != DD_OK) | |
| 1117 | { | |
| 1118 | osd_printf_verbose("DirectDraw: Error %08X getting current display mode\n", (int)result); | |
| 1119 | IDirectDraw7_Release(ddraw); | |
| 1120 | return 1; | |
| 1121 | } | |
| 1122 | ||
| 1123 | // choose a resolution: full screen mode case | |
| 1124 | if (window().fullscreen()) | |
| 1125 | { | |
| 1126 | // default to the current mode exactly | |
| 1127 | width = origmode.dwWidth; | |
| 1128 | height = origmode.dwHeight; | |
| 1129 | refresh = origmode.dwRefreshRate; | |
| 1130 | ||
| 1131 | // if we're allowed to switch resolutions, override with something better | |
| 1132 | if (video_config.switchres) | |
| 1133 | pick_best_mode(); | |
| 1134 | } | |
| 1135 | ||
| 1136 | // release the DirectDraw object | |
| 1137 | IDirectDraw7_Release(ddraw); | |
| 1138 | ddraw = NULL; | |
| 1139 | ||
| 1140 | // if we're not changing resolutions, make sure we have a resolution we can handle | |
| 1141 | if (!window().fullscreen() || !video_config.switchres) | |
| 1142 | { | |
| 1143 | switch (origmode.ddpfPixelFormat.dwRBitMask) | |
| 1144 | { | |
| 1145 | case 0x00ff0000: | |
| 1146 | case 0x000000ff: | |
| 1147 | case 0xf800: | |
| 1148 | case 0x7c00: | |
| 1149 | break; | |
| 1150 | ||
| 1151 | default: | |
| 1152 | osd_printf_verbose("DirectDraw: Unknown target mode: R=%08X G=%08X B=%08X\n", (int)origmode.ddpfPixelFormat.dwRBitMask, (int)origmode.ddpfPixelFormat.dwGBitMask, (int)origmode.ddpfPixelFormat.dwBBitMask); | |
| 1153 | return 1; | |
| 1154 | } | |
| 1155 | } | |
| 1156 | ||
| 1157 | return 0; | |
| 1158 | } | |
| 1159 | ||
| 1160 | ||
| 1161 | ||
| 1162 | //============================================================ | |
| 1163 | // monitor_enum_callback | |
| 1164 | //============================================================ | |
| 1165 | ||
| 1166 | static BOOL WINAPI monitor_enum_callback(GUID FAR *guid, LPSTR description, LPSTR name, LPVOID context, HMONITOR hmonitor) | |
| 1167 | { | |
| 1168 | monitor_enum_info *einfo = (monitor_enum_info *)context; | |
| 1169 | ||
| 1170 | // do we match the desired monitor? | |
| 1171 | if (hmonitor == *((HMONITOR *)einfo->monitor->oshandle()) || (hmonitor == NULL && einfo->monitor->is_primary())) | |
| 1172 | { | |
| 1173 | einfo->guid_ptr = (guid != NULL) ? &einfo->guid : NULL; | |
| 1174 | if (guid != NULL) | |
| 1175 | einfo->guid = *guid; | |
| 1176 | einfo->foundit = TRUE; | |
| 1177 | } | |
| 1178 | return 1; | |
| 1179 | } | |
| 1180 | ||
| 1181 | ||
| 1182 | ||
| 1183 | //============================================================ | |
| 1184 | // get_adapter_for_monitor | |
| 1185 | //============================================================ | |
| 1186 | ||
| 1187 | void renderer_dd::get_adapter_for_monitor(osd_monitor_info *monitor) | |
| 1188 | { | |
| 1189 | monitor_enum_info einfo; | |
| 1190 | HRESULT result; | |
| 1191 | ||
| 1192 | // try to find our monitor | |
| 1193 | memset(&einfo, 0, sizeof(einfo)); | |
| 1194 | einfo.monitor = monitor; | |
| 1195 | result = (*directdrawenumerateex)(monitor_enum_callback, &einfo, DDENUM_ATTACHEDSECONDARYDEVICES); | |
| 1196 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X during DirectDrawEnumerateEx call\n", (int)result); | |
| 1197 | ||
| 1198 | // set up the adapter | |
| 1199 | if (einfo.foundit && einfo.guid_ptr != NULL) | |
| 1200 | { | |
| 1201 | adapter = einfo.guid; | |
| 1202 | adapter_ptr = &adapter; | |
| 1203 | } | |
| 1204 | else | |
| 1205 | adapter_ptr = NULL; | |
| 1206 | } | |
| 1207 | ||
| 1208 | ||
| 1209 | ||
| 1210 | //============================================================ | |
| 1211 | // enum_modes_callback | |
| 1212 | //============================================================ | |
| 1213 | ||
| 1214 | static HRESULT WINAPI enum_modes_callback(LPDDSURFACEDESC2 desc, LPVOID context) | |
| 1215 | { | |
| 1216 | float size_score, refresh_score, final_score; | |
| 1217 | mode_enum_info *einfo = (mode_enum_info *)context; | |
| 1218 | renderer_dd *dd = einfo->renderer; | |
| 1219 | ||
| 1220 | // skip non-32 bit modes | |
| 1221 | if (desc->ddpfPixelFormat.dwRGBBitCount != 32) | |
| 1222 | return DDENUMRET_OK; | |
| 1223 | ||
| 1224 | // compute initial score based on difference between target and current | |
| 1225 | size_score = 1.0f / (1.0f + fabs((float)((INT32)desc->dwWidth - einfo->target_width)) + fabs((float)((INT32)desc->dwHeight - einfo->target_height))); | |
| 1226 | ||
| 1227 | // if the mode is too small, give a big penalty | |
| 1228 | if (desc->dwWidth < einfo->minimum_width || desc->dwHeight < einfo->minimum_height) | |
| 1229 | size_score *= 0.01f; | |
| 1230 | ||
| 1231 | // if mode is smaller than we'd like, it only scores up to 0.1 | |
| 1232 | if (desc->dwWidth < einfo->target_width || desc->dwHeight < einfo->target_height) | |
| 1233 | size_score *= 0.1f; | |
| 1234 | ||
| 1235 | // if we're looking for a particular mode, that's a winner | |
| 1236 | if (desc->dwWidth == einfo->window->m_win_config.width && desc->dwHeight == einfo->window->m_win_config.height) | |
| 1237 | size_score = 2.0f; | |
| 1238 | ||
| 1239 | // compute refresh score | |
| 1240 | refresh_score = 1.0f / (1.0f + fabs((double)desc->dwRefreshRate - einfo->target_refresh)); | |
| 1241 | ||
| 1242 | // if refresh is smaller than we'd like, it only scores up to 0.1 | |
| 1243 | if ((double)desc->dwRefreshRate < einfo->target_refresh) | |
| 1244 | refresh_score *= 0.1f; | |
| 1245 | ||
| 1246 | // if we're looking for a particular refresh, make sure it matches | |
| 1247 | if (desc->dwRefreshRate == einfo->window->m_win_config.refresh) | |
| 1248 | refresh_score = 2.0f; | |
| 1249 | ||
| 1250 | // weight size and refresh equally | |
| 1251 | final_score = size_score + refresh_score; | |
| 1252 | ||
| 1253 | // best so far? | |
| 1254 | osd_printf_verbose(" %4dx%4d@%3dHz -> %f\n", (int)desc->dwWidth, (int)desc->dwHeight, (int)desc->dwRefreshRate, final_score * 1000.0f); | |
| 1255 | if (final_score > einfo->best_score) | |
| 1256 | { | |
| 1257 | einfo->best_score = final_score; | |
| 1258 | dd->width = desc->dwWidth; | |
| 1259 | dd->height = desc->dwHeight; | |
| 1260 | dd->refresh = desc->dwRefreshRate; | |
| 1261 | } | |
| 1262 | return DDENUMRET_OK; | |
| 1263 | } | |
| 1264 | ||
| 1265 | ||
| 1266 | ||
| 1267 | //============================================================ | |
| 1268 | // pick_best_mode | |
| 1269 | //============================================================ | |
| 1270 | ||
| 1271 | void renderer_dd::pick_best_mode() | |
| 1272 | { | |
| 1273 | mode_enum_info einfo; | |
| 1274 | HRESULT result; | |
| 1275 | ||
| 1276 | // determine the minimum width/height for the selected target | |
| 1277 | // note: technically we should not be calling this from an alternate window | |
| 1278 | // thread; however, it is only done during init time, and the init code on | |
| 1279 | // the main thread is waiting for us to finish, so it is safe to do so here | |
| 1280 | window().target()->compute_minimum_size(einfo.minimum_width, einfo.minimum_height); | |
| 1281 | ||
| 1282 | // use those as the target for now | |
| 1283 | einfo.target_width = einfo.minimum_width * MAX(1, window().prescale()); | |
| 1284 | einfo.target_height = einfo.minimum_height * MAX(1, window().prescale()); | |
| 1285 | ||
| 1286 | // determine the refresh rate of the primary screen | |
| 1287 | einfo.target_refresh = 60.0; | |
| 1288 | const screen_device *primary_screen = window().machine().config().first_screen(); | |
| 1289 | if (primary_screen != NULL) | |
| 1290 | einfo.target_refresh = ATTOSECONDS_TO_HZ(primary_screen->refresh_attoseconds()); | |
| 1291 | printf("Target refresh = %f\n", einfo.target_refresh); | |
| 1292 | ||
| 1293 | // if we're not stretching, allow some slop on the minimum since we can handle it | |
| 1294 | if (!video_config.hwstretch) | |
| 1295 | { | |
| 1296 | einfo.minimum_width -= 4; | |
| 1297 | einfo.minimum_height -= 4; | |
| 1298 | } | |
| 1299 | ||
| 1300 | // if we are stretching, aim for a mode approximately 2x the game's resolution | |
| 1301 | else if (window().prescale() <= 1) | |
| 1302 | { | |
| 1303 | einfo.target_width *= 2; | |
| 1304 | einfo.target_height *= 2; | |
| 1305 | } | |
| 1306 | ||
| 1307 | // fill in the rest of the data | |
| 1308 | einfo.window = &window(); | |
| 1309 | einfo.renderer = this; | |
| 1310 | einfo.best_score = 0.0f; | |
| 1311 | ||
| 1312 | // enumerate the modes | |
| 1313 | osd_printf_verbose("DirectDraw: Selecting video mode...\n"); | |
| 1314 | result = IDirectDraw7_EnumDisplayModes(ddraw, DDEDM_REFRESHRATES, NULL, &einfo, enum_modes_callback); | |
| 1315 | if (result != DD_OK) osd_printf_verbose("DirectDraw: Error %08X during EnumDisplayModes call\n", (int)result); | |
| 1316 | osd_printf_verbose("DirectDraw: Mode selected = %4dx%4d@%3dHz\n", width, height, refresh); | |
| 1317 | } |
| r253556 | r253557 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | int fullstretch; // FXIME: implement in windows! |
| 183 | 183 | |
| 184 | // ddraw options | |
| 185 | int hwstretch; // stretch using the hardware | |
| 186 | ||
| 184 | 187 | // d3d, accel, opengl |
| 185 | 188 | int filter; // enable filtering |
| 186 | 189 | //int filter; // enable filtering, disabled if glsl_filter>0 |
| r253556 | r253557 | |
|---|---|---|
| 373 | 373 | video_config.mode = VIDEO_MODE_D3D; |
| 374 | 374 | else if (strcmp(stemp, "auto") == 0) |
| 375 | 375 | video_config.mode = VIDEO_MODE_D3D; |
| 376 | else if (strcmp(stemp, "ddraw") == 0) | |
| 377 | video_config.mode = VIDEO_MODE_DDRAW; | |
| 376 | 378 | else if (strcmp(stemp, "gdi") == 0) |
| 377 | 379 | video_config.mode = VIDEO_MODE_GDI; |
| 378 | 380 | else if (strcmp(stemp, "bgfx") == 0) |
| r253556 | r253557 | |
| 397 | 399 | video_config.triplebuf = options().triple_buffer(); |
| 398 | 400 | video_config.switchres = options().switch_res(); |
| 399 | 401 | |
| 402 | // ddraw options: extract the data | |
| 403 | video_config.hwstretch = options().hwstretch(); | |
| 404 | ||
| 400 | 405 | if (video_config.prescale < 1 || video_config.prescale > 3) |
| 401 | 406 | { |
| 402 | 407 | osd_printf_warning("Invalid prescale option, reverting to '1'\n"); |
| r253556 | r253557 | |
|---|---|---|
| 21 | 21 | enum { |
| 22 | 22 | VIDEO_MODE_NONE, |
| 23 | 23 | VIDEO_MODE_GDI, |
| 24 | VIDEO_MODE_DDRAW, | |
| 24 | 25 | VIDEO_MODE_BGFX, |
| 25 | 26 | #if (USE_OPENGL) |
| 26 | 27 | VIDEO_MODE_OPENGL, |
| r253556 | r253557 | |
| 177 | 178 | |
| 178 | 179 | int fullstretch; // FXIME: implement in windows! |
| 179 | 180 | |
| 181 | // ddraw options | |
| 182 | int hwstretch; // stretch using the hardware | |
| 183 | ||
| 180 | 184 | // d3d, accel, opengl |
| 181 | 185 | int filter; // enable filtering |
| 182 | 186 | //int filter; // enable filtering, disabled if glsl_filter>0 |
| r253556 | r253557 | |
|---|---|---|
| 36 | 36 | |
| 37 | 37 | extern int drawnone_init(running_machine &machine, osd_draw_callbacks *callbacks); |
| 38 | 38 | extern int drawgdi_init(running_machine &machine, osd_draw_callbacks *callbacks); |
| 39 | extern int drawdd_init(running_machine &machine, osd_draw_callbacks *callbacks); | |
| 39 | 40 | extern int drawd3d_init(running_machine &machine, osd_draw_callbacks *callbacks); |
| 40 | 41 | extern int drawbgfx_init(running_machine &machine, osd_draw_callbacks *callbacks); |
| 41 | 42 | #if (USE_OPENGL) |
| r253556 | r253557 | |
| 218 | 219 | if (drawd3d_init(machine(), &draw)) |
| 219 | 220 | video_config.mode = VIDEO_MODE_GDI; |
| 220 | 221 | } |
| 222 | if (video_config.mode == VIDEO_MODE_DDRAW) | |
| 223 | { | |
| 224 | if (drawdd_init(machine(), &draw)) | |
| 225 | video_config.mode = VIDEO_MODE_GDI; | |
| 226 | } | |
| 221 | 227 | if (video_config.mode == VIDEO_MODE_GDI) |
| 222 | 228 | drawgdi_init(machine(), &draw); |
| 223 | 229 | if (video_config.mode == VIDEO_MODE_BGFX) |
| r253556 | r253557 | |
|---|---|---|
| 526 | 526 | void windows_osd_interface::video_register() |
| 527 | 527 | { |
| 528 | 528 | video_options_add("gdi", NULL); |
| 529 | video_options_add("ddraw", NULL); | |
| 529 | 530 | video_options_add("d3d", NULL); |
| 530 | 531 | video_options_add("bgfx", NULL); |
| 531 | 532 | //video_options_add("auto", NULL); // making d3d video default one |
| https://github.com/mamedev/mame/commit/cb8d5e410c0384aab44e970b49e1fabf5aa1e209 |
| Previous | 199869 Revisions | Next |