trunk/src/emu/ui/inputmap.c
| r243129 | r243130 | |
| 154 | 154 | void ui_menu_input_specific::populate() |
| 155 | 155 | { |
| 156 | 156 | input_item_data *itemlist = NULL; |
| 157 | | ioport_field *field; |
| 158 | | ioport_port *port; |
| 159 | 157 | int suborder[SEQ_TYPE_TOTAL]; |
| 160 | 158 | astring tempstring; |
| 159 | int port_count = 0; |
| 161 | 160 | |
| 162 | 161 | /* create a mini lookup table for sort order based on sequence type */ |
| 163 | 162 | suborder[SEQ_TYPE_STANDARD] = 0; |
| r243129 | r243130 | |
| 165 | 164 | suborder[SEQ_TYPE_INCREMENT] = 2; |
| 166 | 165 | |
| 167 | 166 | /* iterate over the input ports and add menu items */ |
| 168 | | for (port = machine().ioport().first_port(); port != NULL; port = port->next()) |
| 169 | | for (field = port->first_field(); field != NULL; field = field->next()) |
| 167 | for (ioport_port *port = machine().ioport().first_port(); port != NULL; port = port->next()) |
| 168 | { |
| 169 | port_count++; |
| 170 | for (ioport_field *field = port->first_field(); field != NULL; field = field->next()) |
| 170 | 171 | { |
| 171 | 172 | const char *name = field->name(); |
| 172 | 173 | |
| r243129 | r243130 | |
| 182 | 183 | { |
| 183 | 184 | sortorder = (field->type() << 2) | (field->player() << 12); |
| 184 | 185 | if (strcmp(field->device().tag(), ":")) |
| 185 | | sortorder |= 0x10000; |
| 186 | sortorder |= (port_count & 0xfff) * 0x10000; |
| 186 | 187 | } |
| 187 | 188 | else |
| 188 | 189 | sortorder = field->type() | 0xf000; |
| r243129 | r243130 | |
| 212 | 213 | } |
| 213 | 214 | } |
| 214 | 215 | } |
| 216 | } |
| 215 | 217 | |
| 216 | 218 | /* sort and populate the menu in a standard fashion */ |
| 217 | 219 | populate_and_sort(itemlist); |
trunk/src/emu/ui/sliders.c
| r243129 | r243130 | |
| 130 | 130 | |
| 131 | 131 | void ui_menu_sliders::populate() |
| 132 | 132 | { |
| 133 | | const slider_state *curslider; |
| 134 | 133 | astring tempstring; |
| 135 | 134 | |
| 136 | | /* add all sliders */ |
| 137 | | for (curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next) |
| 135 | /* add UI sliders */ |
| 136 | for (const slider_state *curslider = machine().ui().get_slider_list(); curslider != NULL; curslider = curslider->next) |
| 138 | 137 | { |
| 139 | 138 | INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); |
| 140 | 139 | UINT32 flags = 0; |
| r243129 | r243130 | |
| 148 | 147 | break; |
| 149 | 148 | } |
| 150 | 149 | |
| 151 | | /* add all sliders */ |
| 152 | | for (curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next) |
| 150 | /* add OSD sliders */ |
| 151 | for (const slider_state *curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next) |
| 153 | 152 | { |
| 154 | 153 | INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); |
| 155 | 154 | UINT32 flags = 0; |
trunk/src/mess/drivers/gamate.c
| r243129 | r243130 | |
| 85 | 85 | emu_timer *timer1; |
| 86 | 86 | emu_timer *timer2; |
| 87 | 87 | UINT8 bank_multi; |
| 88 | UINT8 *m_cart_ptr; |
| 88 | 89 | }; |
| 89 | 90 | |
| 90 | 91 | WRITE8_MEMBER( gamate_state::gamate_cart_protection_w ) |
| r243129 | r243130 | |
| 96 | 97 | card_protection.failed= card_protection.failed || ((card_protection.cartridge_byte&0x80)!=0) != ((data&4)!=0); |
| 97 | 98 | card_protection.bit_shifter++; |
| 98 | 99 | if (card_protection.bit_shifter>=8) { |
| 99 | | card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++]; |
| 100 | card_protection.cartridge_byte=m_cart_ptr[card_protection.address++]; |
| 100 | 101 | card_protection.bit_shifter=0; |
| 101 | 102 | } |
| 102 | 103 | break; |
| r243129 | r243130 | |
| 107 | 108 | |
| 108 | 109 | UINT8 ret=1; |
| 109 | 110 | if (card_protection.bit_shifter==7 && card_protection.unprotected) { |
| 110 | | ret=m_cart->get_rom_base()[bank_multi*0x4000]; |
| 111 | ret=m_cart_ptr[bank_multi*0x4000]; |
| 111 | 112 | } else { |
| 112 | 113 | card_protection.bit_shifter++; |
| 113 | 114 | if (card_protection.bit_shifter==8) { |
| r243129 | r243130 | |
| 132 | 133 | // writes 0x20 |
| 133 | 134 | card_protection.address=0x6005-0x6001; |
| 134 | 135 | card_protection.bit_shifter=0; |
| 135 | | card_protection.cartridge_byte=m_cart->get_rom_base()[card_protection.address++];//m_cart_rom[card_protection.address++]; |
| 136 | card_protection.cartridge_byte=m_cart_ptr[card_protection.address++];//m_cart_rom[card_protection.address++]; |
| 136 | 137 | card_protection.failed=false; |
| 137 | 138 | card_protection.unprotected=false; |
| 138 | 139 | } |
| r243129 | r243130 | |
| 172 | 173 | WRITE8_MEMBER( gamate_state::cart_bankswitchmulti_w ) |
| 173 | 174 | { |
| 174 | 175 | bank_multi=data; |
| 175 | | membank("bankmulti")->set_base(m_cart->get_rom_base()+0x4000*data+1); |
| 176 | membank("bankmulti")->set_base(m_cart_ptr+0x4000*data+1); |
| 176 | 177 | } |
| 177 | 178 | |
| 178 | 179 | WRITE8_MEMBER( gamate_state::cart_bankswitch_w ) |
| 179 | 180 | { |
| 180 | | membank("bank")->set_base(m_cart->get_rom_base()+0x4000*data); |
| 181 | membank("bank")->set_base(m_cart_ptr+0x4000*data); |
| 181 | 182 | } |
| 182 | 183 | |
| 183 | 184 | READ8_MEMBER( gamate_state::gamate_video_r ) |
| r243129 | r243130 | |
| 329 | 330 | |
| 330 | 331 | void gamate_state::machine_start() |
| 331 | 332 | { |
| 333 | m_cart_ptr = memregion("maincpu")->base() + 0x6000; |
| 332 | 334 | if (m_cart->exists()) { |
| 333 | 335 | // m_maincpu->space(AS_PROGRAM).install_read_handler(0x6000, 0x6000, READ8_DELEGATE(gamate_state, gamate_cart_protection_r)); |
| 336 | m_cart_ptr = m_cart->get_rom_base(); |
| 334 | 337 | membank("bankmulti")->set_base(m_cart->get_rom_base()+1); |
| 335 | 338 | membank("bank")->set_base(m_cart->get_rom_base()+0x4000); // bankswitched games in reality no offset |
| 336 | 339 | } |