Previous 15994 Revisions Next

r2867 Wednesday 18th June, 2008 at 11:24:07 UTC by Nathan Woods
Less strict input port assert from Mamedev; the previous one was deemed to be
too strict
[src/emu]inptport.c

src/emu/inptport.c
r2866r2867
240240/* private input port state */
241241struct _input_port_private
242242{
243   /* global state */
244   UINT8                  safe_to_read;      /* clear at start; set after state is loaded */
245
243246   /* types */
244247   input_type_state *         typestatelist;      /* list of live type states */
245248   input_type_state *         type_to_typestate[__ipt_max][MAX_PLAYERS]; /* map from type/player to type state */
r2866r2867
12101213   callback_field_info *custom;
12111214   input_port_value result;
12121215
1216   assert_always(portdata->safe_to_read, "Input ports cannot be read at init time!");
1217
12131218   /* start with the digital */
12141219   result = port->state->digital;
12151220
r2866r2867
12751280input_port_value input_port_read(running_machine *machine, const char *tag)
12761281{
12771282   const input_port_config *port = input_port_by_tag(machine->portconfig, tag);
1278   assert_always(mame_get_phase(machine) != MAME_PHASE_INIT, "Input ports cannot be read at init time!");
12791283   if (port == NULL)
12801284      fatalerror("Unable to locate input port '%s'", tag);
12811285   return input_port_read_direct(port);
r2866r2867
12911295input_port_value input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue)
12921296{
12931297   const input_port_config *port = input_port_by_tag(machine->portconfig, tag);
1294   assert_always(mame_get_phase(machine) != MAME_PHASE_INIT, "Input ports cannot be read at init time!");
12951298   return (port == NULL) ? defvalue : input_port_read_direct(port);
12961299}
12971300
r2866r2867
13041307input_port_value input_port_read_indexed(running_machine *machine, int portnum)
13051308{
13061309   const input_port_config *port = input_port_by_index(machine->portconfig, portnum);
1307   assert_always(mame_get_phase(machine) != MAME_PHASE_INIT, "Input ports cannot be read at init time!");
13081310   return (port == NULL) ? 0 : input_port_read_direct(port);
13091311}
13101312
r2866r2867
33813383
33823384   /* in the completion phase, we finish the initialization with the final ports */
33833385   if (config_type == CONFIG_TYPE_FINAL)
3386   {
3387      portdata->safe_to_read = TRUE;
33843388      frame_update(machine);
3389   }
33853390
33863391   /* early exit if no data to parse */
33873392   if (parentnode == NULL)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team