diff --git a/src/build/file2str.py b/src/build/file2str.py index 6dace489050..ee5ce21541d 100644 --- a/src/build/file2str.py +++ b/src/build/file2str.py @@ -2,7 +2,6 @@ from __future__ import with_statement -import string import sys import os diff --git a/src/build/png.py b/src/build/png.py index 1e0b31fb316..f10210ed08d 100644 --- a/src/build/png.py +++ b/src/build/png.py @@ -2660,7 +2660,6 @@ def _main(argv): # Parse command line arguments from optparse import OptionParser - import re version = '%prog ' + __version__ parser = OptionParser(version=version) parser.set_usage("%prog [options] [imagefile]") diff --git a/src/emu/cpu/arcompact/arcompact_make.py b/src/emu/cpu/arcompact/arcompact_make.py index 9e8eef9bf10..adc7e98fc4d 100644 --- a/src/emu/cpu/arcompact/arcompact_make.py +++ b/src/emu/cpu/arcompact/arcompact_make.py @@ -1,7 +1,6 @@ #!/usr/bin/python import sys -import re def EmitGroup04_Handle_NZ_Flags(f, funcname, opname): print >>f, " if (result & 0x80000000) { STATUS32_SET_N; }" diff --git a/src/emu/cpu/m6809/m6809make.py b/src/emu/cpu/m6809/m6809make.py index b09a82e3a01..04025fc3bbb 100644 --- a/src/emu/cpu/m6809/m6809make.py +++ b/src/emu/cpu/m6809/m6809make.py @@ -1,8 +1,6 @@ #!/usr/bin/python import sys -import logging -import fileinput import re # Initial state diff --git a/src/emu/machine/bcreader.c b/src/emu/machine/bcreader.c index e9589c05a00..954adfd5448 100644 --- a/src/emu/machine/bcreader.c +++ b/src/emu/machine/bcreader.c @@ -269,7 +269,7 @@ UINT8 barcode_reader_device::read_code() { if (m_byte_count < m_byte_length) { - UINT8 val = m_pixel_data[m_byte_count]; + UINT8 val = m_byte_data[m_byte_count]; m_byte_count++; return val; } diff --git a/src/emu/machine/bcreader.h b/src/emu/machine/bcreader.h index 4cb25404bc2..33ddfd5adbe 100644 --- a/src/emu/machine/bcreader.h +++ b/src/emu/machine/bcreader.h @@ -25,6 +25,8 @@ public: barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); void write_code(const char *barcode, int len); + int get_pending_code() { return m_new_code; } + int get_byte_length() { return m_byte_length; } UINT8 read_code(); int read_pixel(); diff --git a/src/emu/ui/inputmap.c b/src/emu/ui/inputmap.c index 42e723eba2d..7f3b7942691 100644 --- a/src/emu/ui/inputmap.c +++ b/src/emu/ui/inputmap.c @@ -154,10 +154,9 @@ ui_menu_input_specific::ui_menu_input_specific(running_machine &machine, render_ void ui_menu_input_specific::populate() { input_item_data *itemlist = NULL; - ioport_field *field; - ioport_port *port; int suborder[SEQ_TYPE_TOTAL]; astring tempstring; + int port_count = 0; /* create a mini lookup table for sort order based on sequence type */ suborder[SEQ_TYPE_STANDARD] = 0; @@ -165,8 +164,10 @@ void ui_menu_input_specific::populate() suborder[SEQ_TYPE_INCREMENT] = 2; /* iterate over the input ports and add menu items */ - for (port = machine().ioport().first_port(); port != NULL; port = port->next()) - for (field = port->first_field(); field != NULL; field = field->next()) + for (ioport_port *port = machine().ioport().first_port(); port != NULL; port = port->next()) + { + port_count++; + for (ioport_field *field = port->first_field(); field != NULL; field = field->next()) { const char *name = field->name(); @@ -182,7 +183,7 @@ void ui_menu_input_specific::populate() { sortorder = (field->type() << 2) | (field->player() << 12); if (strcmp(field->device().tag(), ":")) - sortorder |= 0x10000; + sortorder |= (port_count & 0xfff) * 0x10000; } else sortorder = field->type() | 0xf000; @@ -212,6 +213,7 @@ void ui_menu_input_specific::populate() } } } + } /* sort and populate the menu in a standard fashion */ populate_and_sort(itemlist); diff --git a/src/emu/ui/sliders.c b/src/emu/ui/sliders.c index c9db7b247eb..db2d7c28fb5 100644 --- a/src/emu/ui/sliders.c +++ b/src/emu/ui/sliders.c @@ -130,11 +130,10 @@ void ui_menu_sliders::handle() void ui_menu_sliders::populate() { - const slider_state *curslider; astring tempstring; - /* add all sliders */ - for (curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next) + /* add UI sliders */ + for (const slider_state *curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next) { INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); UINT32 flags = 0; @@ -148,8 +147,8 @@ void ui_menu_sliders::populate() break; } - /* add all sliders */ - for (curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next) + /* add OSD sliders */ + for (const slider_state *curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next) { INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); UINT32 flags = 0; diff --git a/src/mess/drivers/gamate.c b/src/mess/drivers/gamate.c index c246c790ea7..cc18fa3ba98 100644 --- a/src/mess/drivers/gamate.c +++ b/src/mess/drivers/gamate.c @@ -85,6 +85,7 @@ private: emu_timer *timer1; emu_timer *timer2; UINT8 bank_multi; + UINT8 *m_cart_ptr; }; WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) @@ -96,7 +97,7 @@ WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) card_protection.failed= card_protection.failed || ((card_protection.cartridge_byte&0x80)!=0) != ((data&4)!=0); card_protection.bit_shifter++; if (card_protection.bit_shifter>=8) { - card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++]; + card_protection.cartridge_byte=m_cart_ptr[card_protection.address++]; card_protection.bit_shifter=0; } break; @@ -107,7 +108,7 @@ READ8_MEMBER( gamate_state::gamate_cart_protection_r ) UINT8 ret=1; if (card_protection.bit_shifter==7 && card_protection.unprotected) { - ret=m_cart->get_rom_base()[bank_multi*0x4000]; + ret=m_cart_ptr[bank_multi*0x4000]; } else { card_protection.bit_shifter++; if (card_protection.bit_shifter==8) { @@ -132,7 +133,7 @@ WRITE8_MEMBER( gamate_state::protection_reset ) // writes 0x20 card_protection.address=0x6005-0x6001; card_protection.bit_shifter=0; - card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++];//m_cart_rom[card_protection.address++]; + card_protection.cartridge_byte=m_cart_ptr[card_protection.address++];//m_cart_rom[card_protection.address++]; card_protection.failed=false; card_protection.unprotected=false; } @@ -172,12 +173,12 @@ WRITE8_MEMBER( gamate_state::gamate_video_w ) WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w ) { bank_multi=data; - membank("bankmulti")->set_base(m_cart->get_rom_base()+0x4000*data+1); + membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1); } WRITE8_MEMBER( gamate_state::cart_bankswitch_w ) { - membank("bank")->set_base(m_cart->get_rom_base()+0x4000*data); + membank("bank")->set_base(m_cart_ptr+0x4000*data); } READ8_MEMBER( gamate_state::gamate_video_r ) @@ -329,8 +330,10 @@ DRIVER_INIT_MEMBER(gamate_state,gamate) void gamate_state::machine_start() { + m_cart_ptr = memregion("maincpu")->base() + 0x6000; if (m_cart->exists()) { // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); + m_cart_ptr = m_cart->get_rom_base(); membank("bankmulti")->set_base(m_cart->get_rom_base()+1); membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset }