trunk/src/build/verinfo.py
| r243680 | r243681 | |
| 2 | 2 | |
| 3 | 3 | from __future__ import with_statement |
| 4 | 4 | |
| 5 | import os |
| 6 | import re |
| 5 | 7 | import sys |
| 6 | | import os |
| 7 | 8 | |
| 8 | | def usage(): |
| 9 | | sys.stderr.write('Usage: verinfo.py [-b mame|mess|ume] <filename>\n') |
| 10 | | return 0 |
| 11 | | |
| 12 | | build = "mame" |
| 13 | 9 | |
| 14 | | if (len(sys.argv)==1): |
| 15 | | usage() |
| 16 | | sys.exit(1) |
| 10 | def parse_args(): |
| 11 | def usage(): |
| 12 | sys.stderr.write('Usage: verinfo.py [-b mame|mess|ume] [-r|-p] <filename>\n') |
| 13 | sys.exit(1) |
| 17 | 14 | |
| 18 | | if (sys.argv[1]=='-b'): |
| 19 | | if (sys.argv[2]=='mame'): |
| 20 | | build = "mame" |
| 21 | | elif (sys.argv[2]=='mess'): |
| 22 | | build = "mess" |
| 23 | | elif (sys.argv[2]=='ume'): |
| 24 | | build = "ume" |
| 25 | | else : |
| 26 | | usage() |
| 27 | | sys.exit(1) |
| 15 | flags = True |
| 16 | target = 'mame' |
| 17 | input = None |
| 18 | output = 'rc' |
| 19 | i = 1 |
| 20 | while i < len(sys.argv): |
| 21 | if flags and (sys.argv[i] == '-r'): |
| 22 | output = 'rc' |
| 23 | elif flags and (sys.argv[i] == '-p'): |
| 24 | output = 'plist' |
| 25 | elif flags and (sys.argv[i] == '-b'): |
| 26 | i += 1; |
| 27 | if (i >= len(sys.argv)) or (sys.argv[i] not in ('mame', 'mess', 'ume')): |
| 28 | usage() |
| 29 | else: |
| 30 | target = sys.argv[i] |
| 31 | elif flags and (sys.argv[i] == '--'): |
| 32 | flags = False |
| 33 | elif flags and sys.argv[i].startswith('-'): |
| 34 | usage() |
| 35 | elif input is not None: |
| 36 | usage() |
| 37 | else: |
| 38 | input = sys.argv[i] |
| 39 | i += 1 |
| 40 | if input is None: |
| 41 | usage() |
| 42 | return target, input, output |
| 28 | 43 | |
| 29 | | srcfile = sys.argv[len(sys.argv)-1] |
| 44 | |
| 45 | def extract_version(input): |
| 46 | pattern = re.compile('\s+BARE_BUILD_VERSION\s+"(([^."]+)\.([^."]+))"') |
| 47 | for line in input.readlines(): |
| 48 | match = pattern.search(line) |
| 49 | if match: |
| 50 | return match.group(1), match.group(2), match.group(3) |
| 51 | return None, None, None |
| 52 | |
| 53 | |
| 54 | build, srcfile, outfmt = parse_args() |
| 55 | |
| 30 | 56 | try: |
| 31 | | fp = open(srcfile, 'rb') |
| 57 | fp = open(srcfile, 'rb') |
| 32 | 58 | except IOError: |
| 33 | | sys.stderr.write("Unable to open source file '%s'" % srcfile) |
| 34 | | sys.exit(1) |
| 59 | sys.stderr.write("Unable to open source file '%s'\n" % srcfile) |
| 60 | sys.exit(1) |
| 35 | 61 | |
| 36 | | for line in fp.readlines(): |
| 37 | | if line.find("BARE_BUILD_VERSION")!=-1 and line.find('"')!=-1 and line.find('.')!=-1: |
| 38 | | version_string = line[line.find('"')+1:] |
| 39 | | version_string = version_string[0:version_string.find('"')] |
| 40 | | break |
| 41 | | |
| 42 | | version_major = version_string[0:version_string.find('.')] |
| 43 | | version_minor = version_string[version_string.find('.')+1:] |
| 62 | version_string, version_major, version_minor = extract_version(fp) |
| 44 | 63 | version_build = "0" |
| 45 | 64 | version_subbuild = "0" |
| 46 | | if (build == "mess") : |
| 65 | if not version_string: |
| 66 | sys.stderr.write("Unable to extract version from source file '%s'\n" % srcfile) |
| 67 | sys.exit(1) |
| 68 | |
| 69 | if build == "mess": |
| 47 | 70 | # MESS |
| 48 | 71 | author = "MESS Team"; |
| 49 | 72 | comments = "Multi Emulation Super System"; |
| r243680 | r243681 | |
| 52 | 75 | internal_name = "MESS"; |
| 53 | 76 | original_filename = "MESS"; |
| 54 | 77 | product_name = "MESS"; |
| 55 | | elif (build == "ume") : |
| 78 | bundle_identifier = "org.mamedev.mess" |
| 79 | elif build == "ume": |
| 56 | 80 | # UME |
| 57 | 81 | author = "MAME and MESS Team" |
| 58 | 82 | comments = "Universal Machine Emulator" |
| r243680 | r243681 | |
| 61 | 85 | internal_name = "UME" |
| 62 | 86 | original_filename = "UME" |
| 63 | 87 | product_name = "UME" |
| 64 | | else : |
| 88 | bundle_identifier = "org.mamedev.ume" |
| 89 | else: |
| 65 | 90 | # MAME |
| 66 | 91 | author = "Nicola Salmoria and the MAME Team" |
| 67 | 92 | comments = "Multiple Arcade Machine Emulator" |
| r243680 | r243681 | |
| 70 | 95 | internal_name = "MAME" |
| 71 | 96 | original_filename = "MAME" |
| 72 | 97 | product_name = "MAME" |
| 98 | bundle_identifier = "org.mamedev.mame" |
| 73 | 99 | |
| 74 | 100 | legal_copyright = "Copyright Nicola Salmoria and the MAME team" |
| 75 | 101 | |
| 76 | | print("VS_VERSION_INFO VERSIONINFO") |
| 77 | | print("\tFILEVERSION %s,%s,%s,%s" % (version_major, version_minor, version_build, version_subbuild)) |
| 78 | | print("\tPRODUCTVERSION %s,%s,%s,%s" % (version_major, version_minor, version_build, version_subbuild)) |
| 79 | | print("\tFILEFLAGSMASK 0x3fL") |
| 80 | | if (version_build == 0) : |
| 81 | | print("\tFILEFLAGS 0x0L") |
| 82 | | else : |
| 83 | | print("\tFILEFLAGS VS_FF_PRERELEASE") |
| 84 | | print("\tFILEOS VOS_NT_WINDOWS32") |
| 85 | | print("\tFILETYPE VFT_APP") |
| 86 | | print("\tFILESUBTYPE VFT2_UNKNOWN") |
| 87 | | print("BEGIN") |
| 88 | | print("\tBLOCK \"StringFileInfo\"") |
| 89 | | print("\tBEGIN") |
| 90 | | print("#ifdef UNICODE") |
| 91 | | print("\t\tBLOCK \"040904b0\"") |
| 92 | | print("#else") |
| 93 | | print("\t\tBLOCK \"040904E4\"") |
| 94 | | print("#endif") |
| 95 | | print("\t\tBEGIN") |
| 96 | | print("\t\t\tVALUE \"Author\", \"%s\\0\"" % author) |
| 97 | | print("\t\t\tVALUE \"Comments\", \"%s\\0\"" % comments) |
| 98 | | print("\t\t\tVALUE \"CompanyName\", \"%s\\0\"" % company_name) |
| 99 | | print("\t\t\tVALUE \"FileDescription\", \"%s\\0\"" % file_description) |
| 100 | | print("\t\t\tVALUE \"FileVersion\", \"%s, %s, %s, %s\\0\"" % (version_major, version_minor, version_build, version_subbuild)) |
| 101 | | print("\t\t\tVALUE \"InternalName\", \"%s\\0\"" % internal_name) |
| 102 | | print("\t\t\tVALUE \"LegalCopyright\", \"%s\\0\"" % legal_copyright) |
| 103 | | print("\t\t\tVALUE \"OriginalFilename\", \"%s\\0\"" % original_filename) |
| 104 | | print("\t\t\tVALUE \"ProductName\", \"%s\\0\"" % product_name) |
| 105 | | print("\t\t\tVALUE \"ProductVersion\", \"%s\\0\"" % version_string) |
| 106 | | print("\t\tEND") |
| 107 | | print("\tEND") |
| 108 | | print("\tBLOCK \"VarFileInfo\"") |
| 109 | | print("\tBEGIN") |
| 110 | | print("#ifdef UNICODE") |
| 111 | | print("\t\tVALUE \"Translation\", 0x409, 1200") |
| 112 | | print("#else") |
| 113 | | print("\t\tVALUE \"Translation\", 0x409, 1252") |
| 114 | | print("#endif") |
| 115 | | print("\tEND") |
| 116 | | print("END") |
| | No newline at end of file |
| 102 | if outfmt == 'rc': |
| 103 | print("VS_VERSION_INFO VERSIONINFO") |
| 104 | print("\tFILEVERSION %s,%s,%s,%s" % (version_major, version_minor, version_build, version_subbuild)) |
| 105 | print("\tPRODUCTVERSION %s,%s,%s,%s" % (version_major, version_minor, version_build, version_subbuild)) |
| 106 | print("\tFILEFLAGSMASK 0x3fL") |
| 107 | if (version_build == 0) : |
| 108 | print("\tFILEFLAGS 0x0L") |
| 109 | else : |
| 110 | print("\tFILEFLAGS VS_FF_PRERELEASE") |
| 111 | print("\tFILEOS VOS_NT_WINDOWS32") |
| 112 | print("\tFILETYPE VFT_APP") |
| 113 | print("\tFILESUBTYPE VFT2_UNKNOWN") |
| 114 | print("BEGIN") |
| 115 | print("\tBLOCK \"StringFileInfo\"") |
| 116 | print("\tBEGIN") |
| 117 | print("#ifdef UNICODE") |
| 118 | print("\t\tBLOCK \"040904b0\"") |
| 119 | print("#else") |
| 120 | print("\t\tBLOCK \"040904E4\"") |
| 121 | print("#endif") |
| 122 | print("\t\tBEGIN") |
| 123 | print("\t\t\tVALUE \"Author\", \"%s\\0\"" % author) |
| 124 | print("\t\t\tVALUE \"Comments\", \"%s\\0\"" % comments) |
| 125 | print("\t\t\tVALUE \"CompanyName\", \"%s\\0\"" % company_name) |
| 126 | print("\t\t\tVALUE \"FileDescription\", \"%s\\0\"" % file_description) |
| 127 | print("\t\t\tVALUE \"FileVersion\", \"%s, %s, %s, %s\\0\"" % (version_major, version_minor, version_build, version_subbuild)) |
| 128 | print("\t\t\tVALUE \"InternalName\", \"%s\\0\"" % internal_name) |
| 129 | print("\t\t\tVALUE \"LegalCopyright\", \"%s\\0\"" % legal_copyright) |
| 130 | print("\t\t\tVALUE \"OriginalFilename\", \"%s\\0\"" % original_filename) |
| 131 | print("\t\t\tVALUE \"ProductName\", \"%s\\0\"" % product_name) |
| 132 | print("\t\t\tVALUE \"ProductVersion\", \"%s\\0\"" % version_string) |
| 133 | print("\t\tEND") |
| 134 | print("\tEND") |
| 135 | print("\tBLOCK \"VarFileInfo\"") |
| 136 | print("\tBEGIN") |
| 137 | print("#ifdef UNICODE") |
| 138 | print("\t\tVALUE \"Translation\", 0x409, 1200") |
| 139 | print("#else") |
| 140 | print("\t\tVALUE \"Translation\", 0x409, 1252") |
| 141 | print("#endif") |
| 142 | print("\tEND") |
| 143 | print("END") |
| 144 | elif outfmt == 'plist': |
| 145 | print('<?xml version="1.0" encoding="UTF-8"?>') |
| 146 | print('<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">') |
| 147 | print('<plist version="1.0">') |
| 148 | print('<dict>') |
| 149 | print('\t<key>CFBundleDisplayName</key>') |
| 150 | print('\t<string>%s</string>' % product_name) |
| 151 | print('\t<key>CFBundleIdentifier</key>') |
| 152 | print('\t<string>%s</string>' % bundle_identifier) |
| 153 | print('\t<key>CFBundleInfoDictionaryVersion</key>') |
| 154 | print('\t<string>6.0</string>') |
| 155 | print('\t<key>CFBundleName</key>') |
| 156 | print('\t<string>%s</string>' % product_name) |
| 157 | print('\t<key>CFBundleShortVersionString</key>') |
| 158 | print('\t<string>%s.%s.%s</string>' % (version_major, version_minor, version_build)) |
| 159 | print('</dict>') |
| 160 | print('</plist>') |
trunk/src/mame/drivers/tecmosys.c
| r243680 | r243681 | |
| 309 | 309 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE(eeprom_w ) |
| 310 | 310 | AM_RANGE(0xa80000, 0xa80005) AM_WRITEONLY AM_SHARE("a80000regs") // a80000-3 scroll? a80004 inverted ? 3 : 0 |
| 311 | 311 | AM_RANGE(0xb00000, 0xb00005) AM_WRITEONLY AM_SHARE("b00000regs") // b00000-3 scrool?, b00004 inverted ? 3 : 0 |
| 312 | | AM_RANGE(0xb80000, 0xb80001) AM_READWRITE(prot_status_r, prot_status_w) |
| 312 | AM_RANGE(0xb80000, 0xb80001) AM_READWRITE(tecmosys_prot_status_r, tecmosys_prot_status_w) |
| 313 | 313 | AM_RANGE(0xc00000, 0xc00005) AM_WRITEONLY AM_SHARE("c00000regs") // c00000-3 scroll? c00004 inverted ? 13 : 10 |
| 314 | 314 | AM_RANGE(0xc80000, 0xc80005) AM_WRITEONLY AM_SHARE("c80000regs") // c80000-3 scrool? c80004 inverted ? 3 : 0 |
| 315 | 315 | AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("P1") |
| 316 | 316 | AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("P2") |
| 317 | 317 | AM_RANGE(0xd80000, 0xd80001) AM_READ(eeprom_r) |
| 318 | 318 | AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_w ) |
| 319 | | AM_RANGE(0xe80000, 0xe80001) AM_WRITE(prot_data_w) |
| 319 | AM_RANGE(0xe80000, 0xe80001) AM_WRITE(tecmosys_prot_data_w) |
| 320 | 320 | AM_RANGE(0xf00000, 0xf00001) AM_READ(sound_r) |
| 321 | | AM_RANGE(0xf80000, 0xf80001) AM_READ(prot_data_r) |
| 321 | AM_RANGE(0xf80000, 0xf80001) AM_READ(tecmosys_prot_data_r) |
| 322 | 322 | ADDRESS_MAP_END |
| 323 | 323 | |
| 324 | 324 | |
| 325 | | WRITE8_MEMBER(tecmosys_state::z80_bank_w) |
| 325 | WRITE8_MEMBER(tecmosys_state::tecmosys_z80_bank_w) |
| 326 | 326 | { |
| 327 | 327 | membank("bank1")->set_entry(data); |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | | WRITE8_MEMBER(tecmosys_state::oki_bank_w) |
| 330 | WRITE8_MEMBER(tecmosys_state::tecmosys_oki_bank_w) |
| 331 | 331 | { |
| 332 | 332 | UINT8 upperbank = (data & 0x30) >> 4; |
| 333 | 333 | UINT8 lowerbank = (data & 0x03) >> 0; |
| r243680 | r243681 | |
| 347 | 347 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 348 | 348 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymf", ymf262_device, read, write) |
| 349 | 349 | AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 350 | | AM_RANGE(0x20, 0x20) AM_WRITE(oki_bank_w) |
| 351 | | AM_RANGE(0x30, 0x30) AM_WRITE(z80_bank_w) |
| 350 | AM_RANGE(0x20, 0x20) AM_WRITE(tecmosys_oki_bank_w) |
| 351 | AM_RANGE(0x30, 0x30) AM_WRITE(tecmosys_z80_bank_w) |
| 352 | 352 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r) |
| 353 | 353 | AM_RANGE(0x50, 0x50) AM_WRITE(soundlatch2_byte_w) |
| 354 | 354 | AM_RANGE(0x60, 0x61) AM_DEVREADWRITE("ymz", ymz280b_device, read, write) |
| r243680 | r243681 | |
| 441 | 441 | void tecmosys_state::machine_start() |
| 442 | 442 | { |
| 443 | 443 | membank("bank1")->configure_entries(0, 16, memregion("audiocpu")->base(), 0x4000); |
| 444 | | |
| 445 | | save_item(NAME(m_device_read_ptr)); |
| 446 | | save_item(NAME(m_device_status)); |
| 447 | | save_item(NAME(m_device_value)); |
| 448 | 444 | } |
| 449 | 445 | |
| 450 | 446 | static MACHINE_CONFIG_START( deroon, tecmosys_state ) |
| r243680 | r243681 | |
| 469 | 465 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3000)) |
| 470 | 466 | MCFG_SCREEN_SIZE(64*8, 64*8) |
| 471 | 467 | MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) |
| 472 | | MCFG_SCREEN_UPDATE_DRIVER(tecmosys_state, screen_update) |
| 468 | MCFG_SCREEN_UPDATE_DRIVER(tecmosys_state, screen_update_tecmosys) |
| 473 | 469 | |
| 474 | 470 | MCFG_PALETTE_ADD("palette", 0x4000+0x800) |
| 475 | 471 | MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB) |
| r243680 | r243681 | |
| 624 | 620 | ROM_LOAD( "ae500w07.ad1", 0x080000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) ) |
| 625 | 621 | ROM_END |
| 626 | 622 | |
| 627 | | void tecmosys_state::descramble() |
| 623 | void tecmosys_state::tecmosys_descramble() |
| 628 | 624 | { |
| 629 | 625 | UINT8 *gfxsrc = memregion( "gfx1" )->base(); |
| 630 | 626 | size_t srcsize = memregion( "gfx1" )->bytes(); |
| r243680 | r243681 | |
| 648 | 644 | |
| 649 | 645 | DRIVER_INIT_MEMBER(tecmosys_state,deroon) |
| 650 | 646 | { |
| 651 | | descramble(); |
| 652 | | prot_init(0); // machine/tecmosys.c |
| 647 | tecmosys_descramble(); |
| 648 | tecmosys_prot_init(0); // machine/tecmosys.c |
| 653 | 649 | } |
| 654 | 650 | |
| 655 | 651 | DRIVER_INIT_MEMBER(tecmosys_state,tkdensho) |
| 656 | 652 | { |
| 657 | | descramble(); |
| 658 | | prot_init(1); |
| 653 | tecmosys_descramble(); |
| 654 | tecmosys_prot_init(1); |
| 659 | 655 | } |
| 660 | 656 | |
| 661 | 657 | DRIVER_INIT_MEMBER(tecmosys_state,tkdensha) |
| 662 | 658 | { |
| 663 | | descramble(); |
| 664 | | prot_init(2); |
| 659 | tecmosys_descramble(); |
| 660 | tecmosys_prot_init(2); |
| 665 | 661 | } |
| 666 | 662 | |
| 667 | | GAME( 1995, deroon, 0, deroon, deroon, tecmosys_state, deroon, ROT0, "Tecmo", "Deroon DeroDero", GAME_SUPPORTS_SAVE ) |
| 668 | | GAME( 1996, tkdensho, 0, deroon, deroon, tecmosys_state, tkdensho, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", GAME_SUPPORTS_SAVE ) |
| 669 | | GAME( 1996, tkdenshoa, tkdensho, deroon, deroon, tecmosys_state, tkdensha, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", GAME_SUPPORTS_SAVE ) |
| 663 | GAME( 1995, deroon, 0, deroon, deroon, tecmosys_state, deroon, ROT0, "Tecmo", "Deroon DeroDero", 0 ) |
| 664 | GAME( 1996, tkdensho, 0, deroon, deroon, tecmosys_state, tkdensho, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", 0 ) |
| 665 | GAME( 1996, tkdenshoa, tkdensho, deroon, deroon, tecmosys_state, tkdensha, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", 0 ) |
trunk/src/mame/drivers/tehkanwc.c
| r243680 | r243681 | |
| 91 | 91 | #include "emu.h" |
| 92 | 92 | #include "cpu/z80/z80.h" |
| 93 | 93 | #include "sound/ay8910.h" |
| 94 | #include "sound/msm5205.h" |
| 94 | 95 | #include "gridiron.lh" |
| 95 | 96 | #include "includes/tehkanwc.h" |
| 96 | 97 | |
| 97 | | |
| 98 | | void tehkanwc_state::machine_start() |
| 99 | | { |
| 100 | | save_item(NAME(m_track0)); |
| 101 | | save_item(NAME(m_track1)); |
| 102 | | save_item(NAME(m_msm_data_offs)); |
| 103 | | save_item(NAME(m_toggle)); |
| 104 | | } |
| 105 | | |
| 106 | 98 | WRITE8_MEMBER(tehkanwc_state::sub_cpu_halt_w) |
| 107 | 99 | { |
| 108 | 100 | if (data) |
| r243680 | r243681 | |
| 112 | 104 | } |
| 113 | 105 | |
| 114 | 106 | |
| 115 | | READ8_MEMBER(tehkanwc_state::track_0_r) |
| 107 | READ8_MEMBER(tehkanwc_state::tehkanwc_track_0_r) |
| 116 | 108 | { |
| 117 | 109 | int joy; |
| 118 | 110 | |
| r243680 | r243681 | |
| 122 | 114 | return ioport(offset ? "P1Y" : "P1X")->read() - m_track0[offset]; |
| 123 | 115 | } |
| 124 | 116 | |
| 125 | | READ8_MEMBER(tehkanwc_state::track_1_r) |
| 117 | READ8_MEMBER(tehkanwc_state::tehkanwc_track_1_r) |
| 126 | 118 | { |
| 127 | 119 | int joy; |
| 128 | 120 | |
| r243680 | r243681 | |
| 132 | 124 | return ioport(offset ? "P2Y" : "P2X")->read() - m_track1[offset]; |
| 133 | 125 | } |
| 134 | 126 | |
| 135 | | WRITE8_MEMBER(tehkanwc_state::track_0_reset_w) |
| 127 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_0_reset_w) |
| 136 | 128 | { |
| 137 | 129 | /* reset the trackball counters */ |
| 138 | 130 | m_track0[offset] = ioport(offset ? "P1Y" : "P1X")->read() + data; |
| 139 | 131 | } |
| 140 | 132 | |
| 141 | | WRITE8_MEMBER(tehkanwc_state::track_1_reset_w) |
| 133 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_track_1_reset_w) |
| 142 | 134 | { |
| 143 | 135 | /* reset the trackball counters */ |
| 144 | 136 | m_track1[offset] = ioport(offset ? "P2Y" : "P2X")->read() + data; |
| r243680 | r243681 | |
| 177 | 169 | /* Emulate MSM sound samples with counters */ |
| 178 | 170 | |
| 179 | 171 | |
| 180 | | READ8_MEMBER(tehkanwc_state::portA_r) |
| 172 | READ8_MEMBER(tehkanwc_state::tehkanwc_portA_r) |
| 181 | 173 | { |
| 182 | 174 | return m_msm_data_offs & 0xff; |
| 183 | 175 | } |
| 184 | 176 | |
| 185 | | READ8_MEMBER(tehkanwc_state::portB_r) |
| 177 | READ8_MEMBER(tehkanwc_state::tehkanwc_portB_r) |
| 186 | 178 | { |
| 187 | 179 | return (m_msm_data_offs >> 8) & 0xff; |
| 188 | 180 | } |
| 189 | 181 | |
| 190 | | WRITE8_MEMBER(tehkanwc_state::portA_w) |
| 182 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_portA_w) |
| 191 | 183 | { |
| 192 | 184 | m_msm_data_offs = (m_msm_data_offs & 0xff00) | data; |
| 193 | 185 | } |
| 194 | 186 | |
| 195 | | WRITE8_MEMBER(tehkanwc_state::portB_w) |
| 187 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_portB_w) |
| 196 | 188 | { |
| 197 | 189 | m_msm_data_offs = (m_msm_data_offs & 0x00ff) | (data << 8); |
| 198 | 190 | } |
| r243680 | r243681 | |
| 202 | 194 | m_msm->reset_w(data ? 0 : 1); |
| 203 | 195 | } |
| 204 | 196 | |
| 205 | | WRITE_LINE_MEMBER(tehkanwc_state::adpcm_int) |
| 197 | WRITE_LINE_MEMBER(tehkanwc_state::tehkanwc_adpcm_int) |
| 206 | 198 | { |
| 207 | 199 | UINT8 *SAMPLES = memregion("adpcm")->base(); |
| 208 | 200 | int msm_data = SAMPLES[m_msm_data_offs & 0x7fff]; |
| r243680 | r243681 | |
| 226 | 218 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 227 | 219 | AM_RANGE(0xc000, 0xc7ff) AM_RAM |
| 228 | 220 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1") |
| 229 | | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 230 | | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") |
| 221 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("videoram") |
| 222 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("colorram") |
| 231 | 223 | AM_RANGE(0xd800, 0xddff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 232 | 224 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */ |
| 233 | | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") |
| 225 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("videoram2") |
| 234 | 226 | AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("spriteram") /* sprites */ |
| 235 | | AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(scroll_x_w) |
| 236 | | AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(scroll_y_w) |
| 237 | | AM_RANGE(0xf800, 0xf801) AM_READWRITE(track_0_r, track_0_reset_w) /* track 0 x/y */ |
| 227 | AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(tehkanwc_scroll_x_w) |
| 228 | AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(tehkanwc_scroll_y_w) |
| 229 | AM_RANGE(0xf800, 0xf801) AM_READWRITE(tehkanwc_track_0_r, tehkanwc_track_0_reset_w) /* track 0 x/y */ |
| 238 | 230 | AM_RANGE(0xf802, 0xf802) AM_READ_PORT("SYSTEM") AM_WRITE(gridiron_led0_w) |
| 239 | 231 | AM_RANGE(0xf803, 0xf803) AM_READ_PORT("P1BUT") |
| 240 | 232 | AM_RANGE(0xf806, 0xf806) AM_READ_PORT("SYSTEM") |
| 241 | | AM_RANGE(0xf810, 0xf811) AM_READWRITE(track_1_r, track_1_reset_w) /* track 1 x/y */ |
| 233 | AM_RANGE(0xf810, 0xf811) AM_READWRITE(tehkanwc_track_1_r, tehkanwc_track_1_reset_w) /* track 1 x/y */ |
| 242 | 234 | AM_RANGE(0xf812, 0xf812) AM_WRITE(gridiron_led1_w) |
| 243 | 235 | AM_RANGE(0xf813, 0xf813) AM_READ_PORT("P2BUT") |
| 244 | 236 | AM_RANGE(0xf820, 0xf820) AM_READ(soundlatch2_byte_r) AM_WRITE(sound_command_w) /* answer from the sound CPU */ |
| 245 | 237 | AM_RANGE(0xf840, 0xf840) AM_READ_PORT("DSW1") AM_WRITE(sub_cpu_halt_w) |
| 246 | 238 | AM_RANGE(0xf850, 0xf850) AM_READ_PORT("DSW2") AM_WRITENOP /* ?? writes 0x00 or 0xff */ |
| 247 | | AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r) AM_WRITE(flipscreen_x_w) |
| 248 | | AM_RANGE(0xf870, 0xf870) AM_READ_PORT("DSW3") AM_WRITE(flipscreen_y_w) |
| 239 | AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r) AM_WRITE(tehkanwc_flipscreen_x_w) |
| 240 | AM_RANGE(0xf870, 0xf870) AM_READ_PORT("DSW3") AM_WRITE(tehkanwc_flipscreen_y_w) |
| 249 | 241 | ADDRESS_MAP_END |
| 250 | 242 | |
| 251 | 243 | static ADDRESS_MAP_START( sub_mem, AS_PROGRAM, 8, tehkanwc_state ) |
| 252 | 244 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 253 | 245 | AM_RANGE(0x8000, 0xc7ff) AM_RAM |
| 254 | 246 | AM_RANGE(0xc800, 0xcfff) AM_RAM AM_SHARE("share1") |
| 255 | | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 256 | | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(colorram_w) AM_SHARE("colorram") |
| 247 | AM_RANGE(0xd000, 0xd3ff) AM_RAM_WRITE(tehkanwc_videoram_w) AM_SHARE("videoram") |
| 248 | AM_RANGE(0xd400, 0xd7ff) AM_RAM_WRITE(tehkanwc_colorram_w) AM_SHARE("colorram") |
| 257 | 249 | AM_RANGE(0xd800, 0xddff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 258 | 250 | AM_RANGE(0xde00, 0xdfff) AM_RAM AM_SHARE("share5") /* unused part of the palette RAM, I think? Gridiron uses it */ |
| 259 | | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(videoram2_w) AM_SHARE("videoram2") |
| 251 | AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(tehkanwc_videoram2_w) AM_SHARE("videoram2") |
| 260 | 252 | AM_RANGE(0xe800, 0xebff) AM_RAM AM_SHARE("spriteram") /* sprites */ |
| 261 | | AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(scroll_x_w) |
| 262 | | AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(scroll_y_w) |
| 253 | AM_RANGE(0xec00, 0xec01) AM_RAM_WRITE(tehkanwc_scroll_x_w) |
| 254 | AM_RANGE(0xec02, 0xec02) AM_RAM_WRITE(tehkanwc_scroll_y_w) |
| 263 | 255 | AM_RANGE(0xf860, 0xf860) AM_READ(watchdog_reset_r) |
| 264 | 256 | ADDRESS_MAP_END |
| 265 | 257 | |
| r243680 | r243681 | |
| 646 | 638 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) |
| 647 | 639 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 648 | 640 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) |
| 649 | | MCFG_SCREEN_UPDATE_DRIVER(tehkanwc_state, screen_update) |
| 641 | MCFG_SCREEN_UPDATE_DRIVER(tehkanwc_state, screen_update_tehkanwc) |
| 650 | 642 | MCFG_SCREEN_PALETTE("palette") |
| 651 | 643 | |
| 652 | 644 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", tehkanwc) |
| r243680 | r243681 | |
| 658 | 650 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 659 | 651 | |
| 660 | 652 | MCFG_SOUND_ADD("ay1", AY8910, 1536000) |
| 661 | | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(tehkanwc_state, portA_w)) |
| 662 | | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tehkanwc_state, portB_w)) |
| 653 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(tehkanwc_state, tehkanwc_portA_w)) |
| 654 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(tehkanwc_state, tehkanwc_portB_w)) |
| 663 | 655 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 664 | 656 | |
| 665 | 657 | MCFG_SOUND_ADD("ay2", AY8910, 1536000) |
| 666 | | MCFG_AY8910_PORT_A_READ_CB(READ8(tehkanwc_state, portA_r)) |
| 667 | | MCFG_AY8910_PORT_B_READ_CB(READ8(tehkanwc_state, portB_r)) |
| 658 | MCFG_AY8910_PORT_A_READ_CB(READ8(tehkanwc_state, tehkanwc_portA_r)) |
| 659 | MCFG_AY8910_PORT_B_READ_CB(READ8(tehkanwc_state, tehkanwc_portB_r)) |
| 668 | 660 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 669 | 661 | |
| 670 | 662 | MCFG_SOUND_ADD("msm", MSM5205, 384000) |
| 671 | | MCFG_MSM5205_VCLK_CB(WRITELINE(tehkanwc_state, adpcm_int)) /* interrupt function */ |
| 663 | MCFG_MSM5205_VCLK_CB(WRITELINE(tehkanwc_state, tehkanwc_adpcm_int)) /* interrupt function */ |
| 672 | 664 | MCFG_MSM5205_PRESCALER_SELECTOR(MSM5205_S48_4B) /* 8KHz */ |
| 673 | 665 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.45) |
| 674 | 666 | MACHINE_CONFIG_END |
| r243680 | r243681 | |
| 890 | 882 | |
| 891 | 883 | |
| 892 | 884 | |
| 893 | | GAME( 1985, tehkanwc, 0, tehkanwc, tehkanwc, driver_device, 0, ROT0, "Tehkan", "Tehkan World Cup (set 1)", GAME_SUPPORTS_SAVE ) |
| 894 | | GAME( 1985, tehkanwcb, tehkanwc, tehkanwc, tehkanwc, driver_device, 0, ROT0, "Tehkan", "Tehkan World Cup (set 2, bootleg?)", GAME_SUPPORTS_SAVE ) |
| 895 | | GAME( 1985, tehkanwcc, tehkanwc, tehkanwc, tehkanwc, driver_device, 0, ROT0, "bootleg", "Tehkan World Cup (set 3, bootleg)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) // aka 'World Cup 85', different inputs? |
| 896 | | GAMEL(1985, gridiron, 0, tehkanwc, gridiron, driver_device, 0, ROT0, "Tehkan", "Gridiron Fight", GAME_SUPPORTS_SAVE, layout_gridiron ) |
| 897 | | GAME( 1986, teedoff, 0, tehkanwc, teedoff, tehkanwc_state, teedoff, ROT90, "Tecmo", "Tee'd Off (Japan)", GAME_SUPPORTS_SAVE ) |
| 885 | GAME( 1985, tehkanwc, 0, tehkanwc, tehkanwc, driver_device, 0, ROT0, "Tehkan", "Tehkan World Cup (set 1)", 0 ) |
| 886 | GAME( 1985, tehkanwcb, tehkanwc, tehkanwc, tehkanwc, driver_device, 0, ROT0, "Tehkan", "Tehkan World Cup (set 2, bootleg?)", 0 ) |
| 887 | GAME( 1985, tehkanwcc, tehkanwc, tehkanwc, tehkanwc, driver_device, 0, ROT0, "bootleg", "Tehkan World Cup (set 3, bootleg)", GAME_NOT_WORKING ) // aka 'World Cup 85', different inputs? |
| 888 | GAMEL(1985, gridiron, 0, tehkanwc, gridiron, driver_device, 0, ROT0, "Tehkan", "Gridiron Fight", 0, layout_gridiron ) |
| 889 | GAME( 1986, teedoff, 0, tehkanwc, teedoff, tehkanwc_state, teedoff, ROT90, "Tecmo", "Tee'd Off (Japan)", 0 ) |
trunk/src/mame/includes/tecmosys.h
| r243680 | r243681 | |
| 10 | 10 | public: |
| 11 | 11 | tecmosys_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | 12 | : driver_device(mconfig, type, tag), |
| 13 | | m_maincpu(*this, "maincpu"), |
| 14 | | m_audiocpu(*this, "audiocpu"), |
| 15 | | m_eeprom(*this, "eeprom"), |
| 16 | | m_gfxdecode(*this, "gfxdecode"), |
| 17 | | m_screen(*this, "screen"), |
| 18 | | m_palette(*this, "palette"), |
| 19 | 13 | m_spriteram(*this, "spriteram"), |
| 20 | 14 | m_tilemap_paletteram16(*this, "tmap_palette"), |
| 21 | 15 | m_bg2tilemap_ram(*this, "bg2tilemap_ram"), |
| r243680 | r243681 | |
| 29 | 23 | m_b00000regs(*this, "b00000regs"), |
| 30 | 24 | m_c00000regs(*this, "c00000regs"), |
| 31 | 25 | m_c80000regs(*this, "c80000regs"), |
| 32 | | m_880000regs(*this, "880000regs") { } |
| 26 | m_880000regs(*this, "880000regs"), |
| 27 | m_maincpu(*this, "maincpu"), |
| 28 | m_audiocpu(*this, "audiocpu"), |
| 29 | m_eeprom(*this, "eeprom"), |
| 30 | m_gfxdecode(*this, "gfxdecode"), |
| 31 | m_screen(*this, "screen"), |
| 32 | m_palette(*this, "palette") { } |
| 33 | 33 | |
| 34 | | required_device<cpu_device> m_maincpu; |
| 35 | | required_device<cpu_device> m_audiocpu; |
| 36 | | required_device<eeprom_serial_93cxx_device> m_eeprom; |
| 37 | | required_device<gfxdecode_device> m_gfxdecode; |
| 38 | | required_device<screen_device> m_screen; |
| 39 | | required_device<palette_device> m_palette; |
| 40 | | |
| 41 | 34 | required_shared_ptr<UINT16> m_spriteram; |
| 42 | 35 | required_shared_ptr<UINT16> m_tilemap_paletteram16; |
| 43 | 36 | required_shared_ptr<UINT16> m_bg2tilemap_ram; |
| r243680 | r243681 | |
| 52 | 45 | required_shared_ptr<UINT16> m_c00000regs; |
| 53 | 46 | required_shared_ptr<UINT16> m_c80000regs; |
| 54 | 47 | required_shared_ptr<UINT16> m_880000regs; |
| 55 | | |
| 56 | 48 | int m_spritelist; |
| 57 | 49 | bitmap_ind16 m_sprite_bitmap; |
| 58 | 50 | bitmap_ind16 m_tmp_tilemap_composebitmap; |
| r243680 | r243681 | |
| 65 | 57 | UINT8 m_device_status; |
| 66 | 58 | const struct prot_data* m_device_data; |
| 67 | 59 | UINT8 m_device_value; |
| 68 | | |
| 69 | 60 | DECLARE_READ16_MEMBER(sound_r); |
| 70 | 61 | DECLARE_WRITE16_MEMBER(sound_w); |
| 71 | 62 | DECLARE_WRITE16_MEMBER(unk880000_w); |
| 72 | 63 | DECLARE_READ16_MEMBER(unk880000_r); |
| 73 | | DECLARE_WRITE8_MEMBER(z80_bank_w); |
| 74 | | DECLARE_WRITE8_MEMBER(oki_bank_w); |
| 75 | | DECLARE_READ16_MEMBER(prot_status_r); |
| 76 | | DECLARE_WRITE16_MEMBER(prot_status_w); |
| 77 | | DECLARE_READ16_MEMBER(prot_data_r); |
| 78 | | DECLARE_WRITE16_MEMBER(prot_data_w); |
| 64 | DECLARE_WRITE8_MEMBER(tecmosys_z80_bank_w); |
| 65 | DECLARE_WRITE8_MEMBER(tecmosys_oki_bank_w); |
| 66 | DECLARE_READ16_MEMBER(tecmosys_prot_status_r); |
| 67 | DECLARE_WRITE16_MEMBER(tecmosys_prot_status_w); |
| 68 | DECLARE_READ16_MEMBER(tecmosys_prot_data_r); |
| 69 | DECLARE_WRITE16_MEMBER(tecmosys_prot_data_w); |
| 79 | 70 | DECLARE_WRITE16_MEMBER(bg0_tilemap_w); |
| 80 | 71 | DECLARE_WRITE16_MEMBER(bg1_tilemap_w); |
| 81 | 72 | DECLARE_WRITE16_MEMBER(bg2_tilemap_w); |
| r243680 | r243681 | |
| 86 | 77 | DECLARE_WRITE16_MEMBER(bg2_tilemap_lineram_w); |
| 87 | 78 | DECLARE_READ16_MEMBER(eeprom_r); |
| 88 | 79 | DECLARE_WRITE16_MEMBER(eeprom_w); |
| 89 | | DECLARE_WRITE_LINE_MEMBER(sound_irq); |
| 90 | | |
| 91 | 80 | DECLARE_DRIVER_INIT(tkdensha); |
| 92 | 81 | DECLARE_DRIVER_INIT(deroon); |
| 93 | 82 | DECLARE_DRIVER_INIT(tkdensho); |
| 94 | | virtual void machine_start(); |
| 95 | | virtual void video_start(); |
| 96 | | |
| 97 | 83 | TILE_GET_INFO_MEMBER(get_bg0tile_info); |
| 98 | 84 | TILE_GET_INFO_MEMBER(get_bg1tile_info); |
| 99 | 85 | TILE_GET_INFO_MEMBER(get_bg2tile_info); |
| 100 | 86 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 101 | | |
| 102 | | UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 103 | | void prot_init(int which); |
| 104 | | void prot_reset(); |
| 105 | | inline void set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT16 data); |
| 106 | | void render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ); |
| 107 | | void tilemap_copy_to_compose(UINT16 pri); |
| 108 | | void do_final_mix(bitmap_rgb32 &bitmap); |
| 109 | | void descramble(); |
| 87 | virtual void machine_start(); |
| 88 | virtual void video_start(); |
| 89 | UINT32 screen_update_tecmosys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 90 | void tecmosys_prot_init(int which); |
| 91 | void tecmosys_prot_reset(); |
| 92 | inline void set_color_555_tecmo(pen_t color, int rshift, int gshift, int bshift, UINT16 data); |
| 93 | void tecmosys_render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ); |
| 94 | void tecmosys_tilemap_copy_to_compose(UINT16 pri); |
| 95 | void tecmosys_do_final_mix(bitmap_rgb32 &bitmap); |
| 96 | void tecmosys_descramble(); |
| 97 | DECLARE_WRITE_LINE_MEMBER(sound_irq); |
| 98 | required_device<cpu_device> m_maincpu; |
| 99 | required_device<cpu_device> m_audiocpu; |
| 100 | required_device<eeprom_serial_93cxx_device> m_eeprom; |
| 101 | required_device<gfxdecode_device> m_gfxdecode; |
| 102 | required_device<screen_device> m_screen; |
| 103 | required_device<palette_device> m_palette; |
| 110 | 104 | }; |
trunk/src/mame/includes/tehkanwc.h
| r243680 | r243681 | |
| 10 | 10 | |
| 11 | 11 | tehkanwc_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | 12 | : driver_device(mconfig, type, tag), |
| 13 | m_videoram(*this, "videoram"), |
| 14 | m_colorram(*this, "colorram"), |
| 15 | m_videoram2(*this, "videoram2"), |
| 16 | m_spriteram(*this, "spriteram"), |
| 13 | 17 | m_maincpu(*this, "maincpu"), |
| 14 | 18 | m_audiocpu(*this, "audiocpu"), |
| 15 | 19 | m_subcpu(*this, "sub"), |
| 16 | 20 | m_msm(*this, "msm"), |
| 17 | 21 | m_gfxdecode(*this, "gfxdecode"), |
| 18 | | m_palette(*this, "palette"), |
| 19 | | m_videoram(*this, "videoram"), |
| 20 | | m_colorram(*this, "colorram"), |
| 21 | | m_videoram2(*this, "videoram2"), |
| 22 | | m_spriteram(*this, "spriteram") { } |
| 22 | m_palette(*this, "palette") { } |
| 23 | 23 | |
| 24 | | required_device<cpu_device> m_maincpu; |
| 25 | | required_device<cpu_device> m_audiocpu; |
| 26 | | required_device<cpu_device> m_subcpu; |
| 27 | | required_device<msm5205_device> m_msm; |
| 28 | | required_device<gfxdecode_device> m_gfxdecode; |
| 29 | | required_device<palette_device> m_palette; |
| 30 | | |
| 31 | | required_shared_ptr<UINT8> m_videoram; |
| 32 | | required_shared_ptr<UINT8> m_colorram; |
| 33 | | required_shared_ptr<UINT8> m_videoram2; |
| 34 | | required_shared_ptr<UINT8> m_spriteram; |
| 35 | | |
| 36 | 24 | int m_track0[2]; |
| 37 | 25 | int m_track1[2]; |
| 38 | 26 | int m_msm_data_offs; |
| 39 | 27 | int m_toggle; |
| 28 | required_shared_ptr<UINT8> m_videoram; |
| 29 | required_shared_ptr<UINT8> m_colorram; |
| 30 | required_shared_ptr<UINT8> m_videoram2; |
| 40 | 31 | UINT8 m_scroll_x[2]; |
| 41 | 32 | UINT8 m_led0; |
| 42 | 33 | UINT8 m_led1; |
| 43 | 34 | tilemap_t *m_bg_tilemap; |
| 44 | 35 | tilemap_t *m_fg_tilemap; |
| 45 | | |
| 36 | required_shared_ptr<UINT8> m_spriteram; |
| 46 | 37 | DECLARE_WRITE8_MEMBER(sub_cpu_halt_w); |
| 47 | | DECLARE_READ8_MEMBER(track_0_r); |
| 48 | | DECLARE_READ8_MEMBER(track_1_r); |
| 49 | | DECLARE_WRITE8_MEMBER(track_0_reset_w); |
| 50 | | DECLARE_WRITE8_MEMBER(track_1_reset_w); |
| 38 | DECLARE_READ8_MEMBER(tehkanwc_track_0_r); |
| 39 | DECLARE_READ8_MEMBER(tehkanwc_track_1_r); |
| 40 | DECLARE_WRITE8_MEMBER(tehkanwc_track_0_reset_w); |
| 41 | DECLARE_WRITE8_MEMBER(tehkanwc_track_1_reset_w); |
| 51 | 42 | DECLARE_WRITE8_MEMBER(sound_command_w); |
| 52 | 43 | DECLARE_WRITE8_MEMBER(sound_answer_w); |
| 53 | | DECLARE_WRITE8_MEMBER(videoram_w); |
| 54 | | DECLARE_WRITE8_MEMBER(colorram_w); |
| 55 | | DECLARE_WRITE8_MEMBER(videoram2_w); |
| 56 | | DECLARE_WRITE8_MEMBER(scroll_x_w); |
| 57 | | DECLARE_WRITE8_MEMBER(scroll_y_w); |
| 58 | | DECLARE_WRITE8_MEMBER(flipscreen_x_w); |
| 59 | | DECLARE_WRITE8_MEMBER(flipscreen_y_w); |
| 44 | DECLARE_WRITE8_MEMBER(tehkanwc_videoram_w); |
| 45 | DECLARE_WRITE8_MEMBER(tehkanwc_colorram_w); |
| 46 | DECLARE_WRITE8_MEMBER(tehkanwc_videoram2_w); |
| 47 | DECLARE_WRITE8_MEMBER(tehkanwc_scroll_x_w); |
| 48 | DECLARE_WRITE8_MEMBER(tehkanwc_scroll_y_w); |
| 49 | DECLARE_WRITE8_MEMBER(tehkanwc_flipscreen_x_w); |
| 50 | DECLARE_WRITE8_MEMBER(tehkanwc_flipscreen_y_w); |
| 60 | 51 | DECLARE_WRITE8_MEMBER(gridiron_led0_w); |
| 61 | 52 | DECLARE_WRITE8_MEMBER(gridiron_led1_w); |
| 62 | | DECLARE_READ8_MEMBER(portA_r); |
| 63 | | DECLARE_READ8_MEMBER(portB_r); |
| 64 | | DECLARE_WRITE8_MEMBER(portA_w); |
| 65 | | DECLARE_WRITE8_MEMBER(portB_w); |
| 53 | DECLARE_READ8_MEMBER(tehkanwc_portA_r); |
| 54 | DECLARE_READ8_MEMBER(tehkanwc_portB_r); |
| 55 | DECLARE_WRITE8_MEMBER(tehkanwc_portA_w); |
| 56 | DECLARE_WRITE8_MEMBER(tehkanwc_portB_w); |
| 66 | 57 | DECLARE_WRITE8_MEMBER(msm_reset_w); |
| 67 | | DECLARE_WRITE_LINE_MEMBER(adpcm_int); |
| 68 | | |
| 58 | DECLARE_DRIVER_INIT(teedoff); |
| 69 | 59 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 70 | 60 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 71 | | |
| 72 | | DECLARE_DRIVER_INIT(teedoff); |
| 73 | | virtual void machine_start(); |
| 74 | 61 | virtual void video_start(); |
| 75 | | |
| 76 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 77 | | void draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player); |
| 62 | UINT32 screen_update_tehkanwc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 63 | void gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player); |
| 78 | 64 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 79 | | |
| 65 | DECLARE_WRITE_LINE_MEMBER(tehkanwc_adpcm_int); |
| 66 | required_device<cpu_device> m_maincpu; |
| 67 | required_device<cpu_device> m_audiocpu; |
| 68 | required_device<cpu_device> m_subcpu; |
| 69 | required_device<msm5205_device> m_msm; |
| 70 | required_device<gfxdecode_device> m_gfxdecode; |
| 71 | required_device<palette_device> m_palette; |
| 80 | 72 | protected: |
| 81 | 73 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 82 | 74 | }; |
trunk/src/mame/video/tecmosys.c
| r243680 | r243681 | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | | inline void tecmosys_state::set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT16 data) |
| 69 | inline void tecmosys_state::set_color_555_tecmo(pen_t color, int rshift, int gshift, int bshift, UINT16 data) |
| 70 | 70 | { |
| 71 | 71 | m_palette->set_pen_color(color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift)); |
| 72 | 72 | } |
| r243680 | r243681 | |
| 74 | 74 | WRITE16_MEMBER(tecmosys_state::tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w) |
| 75 | 75 | { |
| 76 | 76 | COMBINE_DATA(&m_tilemap_paletteram16[offset]); |
| 77 | | set_color_555(offset+0x4000, 5, 10, 0, m_tilemap_paletteram16[offset]); |
| 77 | set_color_555_tecmo(offset+0x4000, 5, 10, 0, m_tilemap_paletteram16[offset]); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | WRITE16_MEMBER(tecmosys_state::bg0_tilemap_lineram_w) |
| r243680 | r243681 | |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | | void tecmosys_state::render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ) |
| 100 | void tecmosys_state::tecmosys_render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ) |
| 101 | 101 | { |
| 102 | 102 | UINT8 *gfxsrc = memregion ( "gfx1" )->base(); |
| 103 | 103 | int i; |
| r243680 | r243681 | |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | | void tecmosys_state::tilemap_copy_to_compose(UINT16 pri) |
| 191 | void tecmosys_state::tecmosys_tilemap_copy_to_compose(UINT16 pri) |
| 192 | 192 | { |
| 193 | 193 | int y,x; |
| 194 | 194 | UINT16 *srcptr; |
| r243680 | r243681 | |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | | void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap) |
| 208 | void tecmosys_state::tecmosys_do_final_mix(bitmap_rgb32 &bitmap) |
| 209 | 209 | { |
| 210 | 210 | const pen_t *paldata = m_palette->pens(); |
| 211 | 211 | int y,x; |
| r243680 | r243681 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | | UINT32 tecmosys_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 278 | UINT32 tecmosys_state::screen_update_tecmosys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 279 | 279 | { |
| 280 | 280 | bitmap.fill(m_palette->pen(0x4000), cliprect); |
| 281 | 281 | |
| r243680 | r243681 | |
| 293 | 293 | |
| 294 | 294 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 295 | 295 | m_bg0tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 296 | | tilemap_copy_to_compose(0x0000); |
| 296 | tecmosys_tilemap_copy_to_compose(0x0000); |
| 297 | 297 | |
| 298 | 298 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 299 | 299 | m_bg1tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 300 | | tilemap_copy_to_compose(0x4000); |
| 300 | tecmosys_tilemap_copy_to_compose(0x4000); |
| 301 | 301 | |
| 302 | 302 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 303 | 303 | m_bg2tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 304 | | tilemap_copy_to_compose(0x8000); |
| 304 | tecmosys_tilemap_copy_to_compose(0x8000); |
| 305 | 305 | |
| 306 | 306 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 307 | 307 | m_txt_tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 308 | | tilemap_copy_to_compose(0xc000); |
| 308 | tecmosys_tilemap_copy_to_compose(0xc000); |
| 309 | 309 | |
| 310 | 310 | |
| 311 | | do_final_mix(bitmap); |
| 311 | tecmosys_do_final_mix(bitmap); |
| 312 | 312 | |
| 313 | 313 | // prepare sprites for NEXT frame - causes 1 frame palette errors, but prevents sprite lag in tkdensho, which is correct? |
| 314 | | render_sprites_to_bitmap(bitmap, m_880000regs[0x0], m_880000regs[0x1]); |
| 314 | tecmosys_render_sprites_to_bitmap(bitmap, m_880000regs[0x0], m_880000regs[0x1]); |
| 315 | 315 | |
| 316 | 316 | return 0; |
| 317 | 317 | } |
| r243680 | r243681 | |
| 339 | 339 | |
| 340 | 340 | m_bg2tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg2tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32); |
| 341 | 341 | m_bg2tilemap->set_transparent_pen(0); |
| 342 | | |
| 343 | | save_item(NAME(m_spritelist)); |
| 344 | 342 | } |
trunk/src/mame/video/tehkanwc.c
| r243680 | r243681 | |
| 15 | 15 | #include "includes/tehkanwc.h" |
| 16 | 16 | |
| 17 | 17 | |
| 18 | | WRITE8_MEMBER(tehkanwc_state::videoram_w) |
| 18 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_videoram_w) |
| 19 | 19 | { |
| 20 | 20 | m_videoram[offset] = data; |
| 21 | 21 | m_fg_tilemap->mark_tile_dirty(offset); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | | WRITE8_MEMBER(tehkanwc_state::colorram_w) |
| 24 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_colorram_w) |
| 25 | 25 | { |
| 26 | 26 | m_colorram[offset] = data; |
| 27 | 27 | m_fg_tilemap->mark_tile_dirty(offset); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | | WRITE8_MEMBER(tehkanwc_state::videoram2_w) |
| 30 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_videoram2_w) |
| 31 | 31 | { |
| 32 | 32 | m_videoram2[offset] = data; |
| 33 | 33 | m_bg_tilemap->mark_tile_dirty(offset / 2); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | | WRITE8_MEMBER(tehkanwc_state::scroll_x_w) |
| 36 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_scroll_x_w) |
| 37 | 37 | { |
| 38 | 38 | m_scroll_x[offset] = data; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | | WRITE8_MEMBER(tehkanwc_state::scroll_y_w) |
| 41 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_scroll_y_w) |
| 42 | 42 | { |
| 43 | 43 | m_bg_tilemap->set_scrolly(0, data); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | | WRITE8_MEMBER(tehkanwc_state::flipscreen_x_w) |
| 46 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_x_w) |
| 47 | 47 | { |
| 48 | 48 | flip_screen_x_set(data & 0x40); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | | WRITE8_MEMBER(tehkanwc_state::flipscreen_y_w) |
| 51 | WRITE8_MEMBER(tehkanwc_state::tehkanwc_flipscreen_y_w) |
| 52 | 52 | { |
| 53 | 53 | flip_screen_y_set(data & 0x40); |
| 54 | 54 | } |
| r243680 | r243681 | |
| 94 | 94 | 8, 8, 32, 32); |
| 95 | 95 | |
| 96 | 96 | m_fg_tilemap->set_transparent_pen(0); |
| 97 | | |
| 98 | | save_item(NAME(m_scroll_x)); |
| 99 | | save_item(NAME(m_led0)); |
| 100 | | save_item(NAME(m_led1)); |
| 101 | 97 | } |
| 102 | 98 | |
| 103 | 99 | /* |
| r243680 | r243681 | |
| 117 | 113 | bit 7 = enable (0 = display off) |
| 118 | 114 | */ |
| 119 | 115 | |
| 120 | | void tehkanwc_state::draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player) |
| 116 | void tehkanwc_state::gridiron_draw_led(bitmap_ind16 &bitmap, const rectangle &cliprect, UINT8 led,int player) |
| 121 | 117 | { |
| 122 | 118 | if (led&0x80) |
| 123 | 119 | output_set_digit_value(player, led&0x7f); |
| r243680 | r243681 | |
| 127 | 123 | |
| 128 | 124 | void tehkanwc_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 129 | 125 | { |
| 130 | | for (int offs = 0;offs < m_spriteram.bytes();offs += 4) |
| 126 | UINT8 *spriteram = m_spriteram; |
| 127 | int offs; |
| 128 | |
| 129 | for (offs = 0;offs < m_spriteram.bytes();offs += 4) |
| 131 | 130 | { |
| 132 | | int attr = m_spriteram[offs + 1]; |
| 133 | | int code = m_spriteram[offs] + ((attr & 0x08) << 5); |
| 131 | int attr = spriteram[offs + 1]; |
| 132 | int code = spriteram[offs] + ((attr & 0x08) << 5); |
| 134 | 133 | int color = attr & 0x07; |
| 135 | 134 | int flipx = attr & 0x40; |
| 136 | 135 | int flipy = attr & 0x80; |
| 137 | | int sx = m_spriteram[offs + 2] + ((attr & 0x20) << 3) - 128; |
| 138 | | int sy = m_spriteram[offs + 3]; |
| 136 | int sx = spriteram[offs + 2] + ((attr & 0x20) << 3) - 128; |
| 137 | int sy = spriteram[offs + 3]; |
| 139 | 138 | |
| 140 | 139 | if (flip_screen_x()) |
| 141 | 140 | { |
| r243680 | r243681 | |
| 154 | 153 | } |
| 155 | 154 | } |
| 156 | 155 | |
| 157 | | UINT32 tehkanwc_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 156 | UINT32 tehkanwc_state::screen_update_tehkanwc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 158 | 157 | { |
| 159 | 158 | m_bg_tilemap->set_scrollx(0, m_scroll_x[0] + 256 * m_scroll_x[1]); |
| 160 | 159 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 161 | 160 | m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 162 | 161 | draw_sprites(bitmap, cliprect); |
| 163 | 162 | m_fg_tilemap->draw(screen, bitmap, cliprect, 1, 0); |
| 164 | | draw_led(bitmap, cliprect, m_led0, 0); |
| 165 | | draw_led(bitmap, cliprect, m_led1, 1); |
| 163 | gridiron_draw_led(bitmap, cliprect, m_led0, 0); |
| 164 | gridiron_draw_led(bitmap, cliprect, m_led1, 1); |
| 166 | 165 | return 0; |
| 167 | 166 | } |