~ubuntu-branches/ubuntu/lucid/sdlmame/lucid

« back to all changes in this revision

Viewing changes to src/emu/inptport.h

  • Committer: Bazaar Package Importer
  • Author(s): Cesare Falco
  • Date: 2009-11-03 17:10:15 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091103171015-6hop4ory5lxnumpn
Tags: 0.135-0ubuntu1
* New upstream release - Closes (LP: #403212)
* debian/watch: unstable releases are no longer detected
* mame.ini: added the cheat subdirectories to cheatpath so zipped
  cheatfiles will be searched too
* renamed crsshair subdirectory to crosshair to reflect upstream change
* mame.ini: renamed references to crosshair subdirectory (see above)

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
        IPT_MAHJONG_BIG,
221
221
        IPT_MAHJONG_SMALL,
222
222
 
 
223
        /* hanafuda inputs */
 
224
        IPT_HANAFUDA_A,
 
225
        IPT_HANAFUDA_B,
 
226
        IPT_HANAFUDA_C,
 
227
        IPT_HANAFUDA_D,
 
228
        IPT_HANAFUDA_E,
 
229
        IPT_HANAFUDA_F,
 
230
        IPT_HANAFUDA_G,
 
231
        IPT_HANAFUDA_H,
 
232
        IPT_HANAFUDA_YES,
 
233
        IPT_HANAFUDA_NO,
 
234
 
 
235
        /* gambling inputs */
 
236
        IPT_GAMBLE_HIGH,
 
237
        IPT_GAMBLE_LOW,
 
238
        IPT_GAMBLE_HALF,
 
239
        IPT_GAMBLE_DEAL,
 
240
        IPT_GAMBLE_D_UP,
 
241
        IPT_GAMBLE_TAKE,
 
242
        IPT_GAMBLE_STAND,
 
243
        IPT_GAMBLE_BET,
 
244
        IPT_GAMBLE_KEYIN,
 
245
        IPT_GAMBLE_KEYOUT,
 
246
        IPT_GAMBLE_PAYOUT,
 
247
        IPT_GAMBLE_DOOR,
 
248
        IPT_GAMBLE_SERVICE,
 
249
        IPT_GAMBLE_BOOK,
 
250
 
 
251
        /* poker-specific inputs */
 
252
        IPT_POKER_HOLD1,
 
253
        IPT_POKER_HOLD2,
 
254
        IPT_POKER_HOLD3,
 
255
        IPT_POKER_HOLD4,
 
256
        IPT_POKER_HOLD5,
 
257
        IPT_POKER_CANCEL,
 
258
        IPT_POKER_BET,
 
259
 
 
260
        /* slot-specific inputs */
 
261
        IPT_SLOT_STOP1,
 
262
        IPT_SLOT_STOP2,
 
263
        IPT_SLOT_STOP3,
 
264
        IPT_SLOT_STOP4,
 
265
        IPT_SLOT_STOP_ALL,
 
266
 
223
267
        /* analog inputs */
224
268
#define __ipt_analog_start IPT_PADDLE
225
269
#define __ipt_analog_absolute_start IPT_PADDLE
275
319
        IPT_UI_PAGE_DOWN,
276
320
        IPT_UI_SELECT,
277
321
        IPT_UI_CANCEL,
 
322
        IPT_UI_DISPLAY_COMMENT,
278
323
        IPT_UI_CLEAR,
279
324
        IPT_UI_ZOOM_IN,
280
325
        IPT_UI_ZOOM_OUT,
354
399
        INPUT_TOKEN_KEYDELTA,
355
400
        INPUT_TOKEN_CENTERDELTA,
356
401
        INPUT_TOKEN_CROSSHAIR,
 
402
        INPUT_TOKEN_CROSSHAIR_MAPPER,
357
403
        INPUT_TOKEN_FULL_TURN_COUNT,
358
404
        INPUT_TOKEN_POSITIONS,
359
405
        INPUT_TOKEN_WRAPS,
524
570
/* input port changed callback function */
525
571
typedef void (*input_field_changed_func)(const input_field_config *field, void *param, UINT32 oldval, UINT32 newval);
526
572
 
 
573
/* crosshair mapping function */
 
574
typedef float (*input_field_crossmap_func)(const input_field_config *field, float linear_value);
 
575
 
527
576
 
528
577
/* this type is used to encode input port definitions */
529
578
typedef union _input_port_token input_port_token;
533
582
        const input_port_token *        tokenptr;
534
583
        input_field_custom_func         customptr;
535
584
        input_field_changed_func        changedptr;
 
585
        input_field_crossmap_func       crossmapptr;
536
586
};
537
587
 
538
588
 
602
652
        float                                           crossscale;             /* crosshair scale */
603
653
        float                                           crossoffset;    /* crosshair offset */
604
654
        float                                           crossaltaxis;   /* crosshair alternate axis value */
 
655
        input_field_crossmap_func       crossmapper;    /* crosshair mapping function */
605
656
        UINT16                                          full_turn_count;/* number of optical counts for 1 full turn of the original control */
606
657
        const input_port_value *        remap_table;    /* pointer to an array that remaps the port value */
607
658
 
681
732
/* macro for port changed callback functions (PORT_CHANGED) */
682
733
#define INPUT_CHANGED(name)     void name(const input_field_config *field, void *param, UINT32 oldval, UINT32 newval)
683
734
 
 
735
/* macro for port changed callback functions (PORT_CROSSHAIR_MAPPER) */
 
736
#define CROSSHAIR_MAPPER(name)  float name(const input_field_config *field, float linear_value)
 
737
 
684
738
/* macro for wrapping a default string */
685
739
#define DEF_STR(str_num) ((const char *)INPUT_STRING_##str_num)
686
740
 
690
744
    MACROS FOR BUILDING INPUT PORTS
691
745
***************************************************************************/
692
746
 
 
747
/* so that "0" can be used for unneeded input ports */
 
748
#define ipt_0 NULL
 
749
 
 
750
/* name of table */
 
751
#define INPUT_PORTS_NAME(_name) ipt_##_name
 
752
 
693
753
/* start of table */
694
754
#define INPUT_PORTS_START(_name) \
695
 
        const input_port_token ipt_##_name[] = {
 
755
        const input_port_token INPUT_PORTS_NAME(_name)[] = {
696
756
 
697
757
/* end of table */
698
758
#define INPUT_PORTS_END \
700
760
 
701
761
/* aliasing */
702
762
#define INPUT_PORTS_EXTERN(_name) \
703
 
        extern const input_port_token ipt_##_name[]
 
763
        extern const input_port_token INPUT_PORTS_NAME(_name)[]
704
764
 
705
765
/* including */
706
766
#define PORT_INCLUDE(_name) \
707
767
        TOKEN_UINT32_PACK1(INPUT_TOKEN_INCLUDE, 8), \
708
 
        TOKEN_PTR(tokenptr, &ipt_##_name[0]),
 
768
        TOKEN_PTR(tokenptr, &INPUT_PORTS_NAME(_name)[0]),
709
769
 
710
770
/* start of a new input port (with included tag) */
711
771
#define PORT_START(_tag) \
803
863
        TOKEN_UINT32_PACK3(INPUT_TOKEN_CROSSHAIR, 8, CROSSHAIR_AXIS_##axis, 4, (INT32)((altaxis) * 65536.0f), 20), \
804
864
        TOKEN_UINT64_PACK2((INT32)((scale) * 65536.0f), 32, (INT32)((offset) * 65536.0f), 32),
805
865
 
 
866
#define PORT_CROSSHAIR_MAPPER(_callback) \
 
867
        TOKEN_UINT32_PACK1(INPUT_TOKEN_CROSSHAIR_MAPPER, 8), \
 
868
        TOKEN_PTR(crossmapptr, _callback),
 
869
 
806
870
/* how many optical counts for 1 full turn of the control */
807
871
#define PORT_FULL_TURN_COUNT(_count) \
808
872
        TOKEN_UINT32_PACK2(INPUT_TOKEN_FULL_TURN_COUNT, 8, _count, 24),