~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to mess/src/ldplayer/ldplayer.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Jordi Mallach, Emmanuel Kasper
  • Date: 2011-12-19 22:56:27 UTC
  • mfrom: (0.1.2)
  • Revision ID: package-import@ubuntu.com-20111219225627-ub5oga1oys4ogqzm
Tags: 0.144-1
[ Jordi Mallach ]
* Fix syntax errors in DEP5 copyright file (lintian).
* Use a versioned copyright Format specification field.
* Update Vcs-* URLs.
* Move transitional packages to the new metapackages section, and make
  them priority extra.
* Remove references to GNU/Linux and MESS sources from copyright.
* Add build variables for s390x.
* Use .xz tarballs as it cuts 4MB for the upstream sources.
* Add nplayers.ini as a patch. Update copyright file to add CC-BY-SA-3.0.

[ Emmanuel Kasper ]
* New upstream release. Closes: #651538.
* Add Free Desktop compliant png icons of various sizes taken from
  the hydroxygen iconset
* Mess is now built from a new source package, to avoid possible source
  incompatibilities between mame and the mess overlay.
* Mame-tools are not built from the mame source package anymore, but
  from the mess source package

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*************************************************************************
2
 
 
3
 
    ldplayer.c
4
 
 
5
 
    Laserdisc player driver.
6
 
 
7
 
    Copyright Nicola Salmoria and the MAME Team.
8
 
    Visit http://mamedev.org for licensing and usage restrictions.
9
 
 
10
 
**************************************************************************/
11
 
 
12
 
#include "emu.h"
13
 
#include "emuopts.h"
14
 
#include "uimenu.h"
15
 
#include "cpu/mcs48/mcs48.h"
16
 
#include "machine/laserdsc.h"
17
 
#include <ctype.h>
18
 
 
19
 
#include "pr8210.lh"
20
 
 
21
 
 
22
 
 
23
 
/*************************************
24
 
 *
25
 
 *  Constants
26
 
 *
27
 
 *************************************/
28
 
 
29
 
/*************************************
30
 
 *
31
 
 *  Globals
32
 
 *
33
 
 *************************************/
34
 
 
35
 
class ldplayer_state : public driver_device
36
 
{
37
 
public:
38
 
        // construction/destruction
39
 
        ldplayer_state(const machine_config &mconfig, device_type type, const char *tag)
40
 
                : driver_device(mconfig, type, tag),
41
 
                  m_last_controls(0),
42
 
                  m_playing(false),
43
 
                  m_laserdisc(*this, "laserdisc") { }
44
 
 
45
 
        // callback hook
46
 
        static chd_file *get_disc_static(device_t *device) { return device->machine().driver_data<ldplayer_state>()->get_disc(); }
47
 
 
48
 
protected:
49
 
        // device overrides
50
 
        virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
51
 
        virtual void machine_start();
52
 
        virtual void machine_reset();
53
 
 
54
 
        // internal helpers
55
 
        chd_file *get_disc();
56
 
        void process_commands();
57
 
 
58
 
        // derived classes
59
 
        virtual void execute_command(int command) { assert(false); }
60
 
 
61
 
        // timer IDs
62
 
        enum
63
 
        {
64
 
                TIMER_ID_AUTOPLAY,
65
 
                TIMER_ID_VSYNC_UPDATE
66
 
        };
67
 
 
68
 
        // commands
69
 
        enum
70
 
        {
71
 
                CMD_SCAN_REVERSE,
72
 
                CMD_STEP_REVERSE,
73
 
                CMD_SLOW_REVERSE,
74
 
                CMD_FAST_REVERSE,
75
 
                CMD_SCAN_FORWARD,
76
 
                CMD_STEP_FORWARD,
77
 
                CMD_SLOW_FORWARD,
78
 
                CMD_FAST_FORWARD,
79
 
                CMD_PLAY,
80
 
                CMD_PAUSE,
81
 
                CMD_FRAME_TOGGLE,
82
 
                CMD_CHAPTER_TOGGLE,
83
 
                CMD_CH1_TOGGLE,
84
 
                CMD_CH2_TOGGLE,
85
 
                CMD_0,
86
 
                CMD_1,
87
 
                CMD_2,
88
 
                CMD_3,
89
 
                CMD_4,
90
 
                CMD_5,
91
 
                CMD_6,
92
 
                CMD_7,
93
 
                CMD_8,
94
 
                CMD_9,
95
 
                CMD_SEARCH
96
 
        };
97
 
 
98
 
        // internal state
99
 
        astring m_filename;
100
 
        input_port_value m_last_controls;
101
 
        bool m_playing;
102
 
        required_device<laserdisc_device> m_laserdisc;
103
 
};
104
 
 
105
 
 
106
 
class pr8210_state : public ldplayer_state
107
 
{
108
 
public:
109
 
        // construction/destruction
110
 
        pr8210_state(const machine_config &mconfig, device_type type, const char *tag)
111
 
                : ldplayer_state(machine, config),
112
 
                  m_bit_timer(timer_alloc(TIMER_ID_BIT)),
113
 
                  m_command_buffer_in(0),
114
 
                  m_command_buffer_out(0) { }
115
 
 
116
 
protected:
117
 
        // device overrides
118
 
        virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
119
 
        virtual void machine_reset();
120
 
 
121
 
        // command execution hook
122
 
        virtual void execute_command(int command);
123
 
 
124
 
        // internal helpers
125
 
        inline void add_command(UINT8 command);
126
 
 
127
 
        // timer IDs
128
 
        enum
129
 
        {
130
 
                TIMER_ID_BIT = 100,
131
 
                TIMER_ID_BIT_OFF
132
 
        };
133
 
 
134
 
        // internal state
135
 
        emu_timer *m_bit_timer;
136
 
        UINT32 m_command_buffer_in;
137
 
        UINT32 m_command_buffer_out;
138
 
        UINT8 m_command_buffer[10];
139
 
};
140
 
 
141
 
 
142
 
class ldv1000_state : public ldplayer_state
143
 
{
144
 
public:
145
 
        // construction/destruction
146
 
        ldv1000_state(const machine_config &mconfig, device_type type, const char *tag)
147
 
                : ldplayer_state(machine, config) { }
148
 
 
149
 
protected:
150
 
        // command execution hook
151
 
        virtual void execute_command(int command);
152
 
};
153
 
 
154
 
 
155
 
 
156
 
/*************************************
157
 
 *
158
 
 *  Disc location
159
 
 *
160
 
 *************************************/
161
 
 
162
 
chd_file *ldplayer_state::get_disc()
163
 
{
164
 
        // open a path to the ROMs and find the first CHD file
165
 
        file_enumerator path(machine().options().media_path());
166
 
 
167
 
        // iterate while we get new objects
168
 
        const osd_directory_entry *dir;
169
 
        emu_file *image_file = NULL;
170
 
        chd_file *image_chd = NULL;
171
 
        while ((dir = path.next()) != NULL)
172
 
        {
173
 
                int length = strlen(dir->name);
174
 
 
175
 
                // look for files ending in .chd
176
 
                if (length > 4 &&
177
 
                        dir->name[length - 4] == '.' &&
178
 
                        tolower(dir->name[length - 3]) == 'c' &&
179
 
                        tolower(dir->name[length - 2]) == 'h' &&
180
 
                        tolower(dir->name[length - 1]) == 'd')
181
 
                {
182
 
                        // open the file itself via our search path
183
 
                        image_file = auto_alloc(machine(), emu_file(machine().options().media_path(), OPEN_FLAG_READ));
184
 
                        file_error filerr = image_file->open(dir->name);
185
 
                        if (filerr == FILERR_NONE)
186
 
                        {
187
 
                                // try to open the CHD
188
 
                                chd_error chderr = chd_open_file(*image_file, CHD_OPEN_READ, NULL, &image_chd);
189
 
                                if (chderr == CHDERR_NONE)
190
 
                                {
191
 
                                        set_disk_handle(machine(), "laserdisc", *image_file, *image_chd);
192
 
                                        m_filename.cpy(dir->name);
193
 
                                        break;
194
 
                                }
195
 
                        }
196
 
 
197
 
                        // close the file on failure
198
 
                        auto_free(machine(), image_file);
199
 
                        image_file = NULL;
200
 
                }
201
 
        }
202
 
 
203
 
        // if we failed, pop a message and exit
204
 
        if (image_file == NULL)
205
 
                throw emu_fatalerror("No valid image file found!\n");
206
 
 
207
 
        return get_disk_handle(machine(), "laserdisc");
208
 
}
209
 
 
210
 
 
211
 
 
212
 
/*************************************
213
 
 *
214
 
 *  Timers and sync
215
 
 *
216
 
 *************************************/
217
 
 
218
 
void ldplayer_state::process_commands()
219
 
{
220
 
        input_port_value controls = input_port_read(machine(), "controls");
221
 
        int number;
222
 
 
223
 
        // step backwards
224
 
        if (!(m_last_controls & 0x01) && (controls & 0x01))
225
 
                execute_command(CMD_STEP_REVERSE);
226
 
 
227
 
        // step forwards
228
 
        if (!(m_last_controls & 0x02) && (controls & 0x02))
229
 
                execute_command(CMD_STEP_FORWARD);
230
 
 
231
 
        // scan backwards
232
 
        if (controls & 0x04)
233
 
                execute_command(CMD_SCAN_REVERSE);
234
 
 
235
 
        // scan forwards
236
 
        if (controls & 0x08)
237
 
                execute_command(CMD_SCAN_FORWARD);
238
 
 
239
 
        // slow backwards
240
 
        if (!(m_last_controls & 0x10) && (controls & 0x10))
241
 
                execute_command(CMD_SLOW_REVERSE);
242
 
 
243
 
        // slow forwards
244
 
        if (!(m_last_controls & 0x20) && (controls & 0x20))
245
 
                execute_command(CMD_SLOW_FORWARD);
246
 
 
247
 
        // fast backwards
248
 
        if (controls & 0x40)
249
 
                execute_command(CMD_FAST_REVERSE);
250
 
 
251
 
        // fast forwards
252
 
        if (controls & 0x80)
253
 
                execute_command(CMD_FAST_FORWARD);
254
 
 
255
 
        // play/pause
256
 
        if (!(m_last_controls & 0x100) && (controls & 0x100))
257
 
        {
258
 
                m_playing = !m_playing;
259
 
                execute_command(m_playing ? CMD_PLAY : CMD_PAUSE);
260
 
        }
261
 
 
262
 
        // toggle frame display
263
 
        if (!(m_last_controls & 0x200) && (controls & 0x200))
264
 
                execute_command(CMD_FRAME_TOGGLE);
265
 
 
266
 
        // toggle chapter display
267
 
        if (!(m_last_controls & 0x400) && (controls & 0x400))
268
 
                execute_command(CMD_CHAPTER_TOGGLE);
269
 
 
270
 
        // toggle left channel
271
 
        if (!(m_last_controls & 0x800) && (controls & 0x800))
272
 
                execute_command(CMD_CH1_TOGGLE);
273
 
 
274
 
        // toggle right channel
275
 
        if (!(m_last_controls & 0x1000) && (controls & 0x1000))
276
 
                execute_command(CMD_CH2_TOGGLE);
277
 
 
278
 
        // numbers
279
 
        for (number = 0; number < 10; number++)
280
 
                if (!(m_last_controls & (0x10000 << number)) && (controls & (0x10000 << number)))
281
 
                        execute_command(CMD_0 + number);
282
 
 
283
 
        // enter
284
 
        if (!(m_last_controls & 0x4000000) && (controls & 0x4000000))
285
 
                execute_command(CMD_SEARCH);
286
 
 
287
 
        m_last_controls = controls;
288
 
}
289
 
 
290
 
 
291
 
void ldplayer_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
292
 
{
293
 
        switch (id)
294
 
        {
295
 
                case TIMER_ID_VSYNC_UPDATE:
296
 
                {
297
 
                        // handle commands
298
 
                        if (param == 0)
299
 
                                process_commands();
300
 
 
301
 
                        // set a timer to go off on the next VBLANK
302
 
                        int vblank_scanline = machine().primary_screen->visible_area().max_y + 1;
303
 
                        attotime target = machine().primary_screen->time_until_pos(vblank_scanline);
304
 
                        timer_set(target, TIMER_ID_VSYNC_UPDATE);
305
 
                        break;
306
 
                }
307
 
 
308
 
                case TIMER_ID_AUTOPLAY:
309
 
                        // start playing
310
 
                        execute_command(CMD_PLAY);
311
 
                        m_playing = true;
312
 
                        break;
313
 
        }
314
 
}
315
 
 
316
 
 
317
 
void ldplayer_state::machine_start()
318
 
{
319
 
        // start the vsync timer going
320
 
        timer_set(attotime::zero, TIMER_ID_VSYNC_UPDATE, 1);
321
 
}
322
 
 
323
 
 
324
 
void ldplayer_state::machine_reset()
325
 
{
326
 
        // set up a timer to start playing immediately
327
 
        timer_set(attotime::zero, TIMER_ID_AUTOPLAY);
328
 
 
329
 
        // indicate the name of the file we opened
330
 
        popmessage("Opened %s\n", m_filename.cstr());
331
 
}
332
 
 
333
 
 
334
 
 
335
 
/*************************************
336
 
 *
337
 
 *  PR-8210 implementation
338
 
 *
339
 
 *************************************/
340
 
 
341
 
void pr8210_state::add_command(UINT8 command)
342
 
{
343
 
        m_command_buffer[m_command_buffer_in++ % ARRAY_LENGTH(m_command_buffer)] = (command & 0x1f) | 0x20;
344
 
        m_command_buffer[m_command_buffer_in++ % ARRAY_LENGTH(m_command_buffer)] = 0x00 | 0x20;
345
 
}
346
 
 
347
 
 
348
 
void pr8210_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
349
 
{
350
 
        switch (id)
351
 
        {
352
 
                case TIMER_ID_BIT:
353
 
                {
354
 
                        attotime duration = attotime::from_msec(30);
355
 
                        UINT8 bitsleft = param >> 16;
356
 
                        UINT8 data = param;
357
 
 
358
 
                        // if we have bits, process
359
 
                        if (bitsleft != 0)
360
 
                        {
361
 
                                // assert the line and set a timer for deassertion
362
 
                                laserdisc_line_w(m_laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
363
 
                                timer_set(attotime::from_usec(250), TIMER_ID_BIT_OFF);
364
 
 
365
 
                                // space 0 bits apart by 1msec, and 1 bits by 2msec
366
 
                                duration = attotime::from_msec((data & 0x80) ? 2 : 1);
367
 
                                data <<= 1;
368
 
                                bitsleft--;
369
 
                        }
370
 
 
371
 
                        // if we're out of bits, queue up the next command
372
 
                        else if (bitsleft == 0 && m_command_buffer_in != m_command_buffer_out)
373
 
                        {
374
 
                                data = m_command_buffer[m_command_buffer_out++ % ARRAY_LENGTH(m_command_buffer)];
375
 
                                bitsleft = 12;
376
 
                        }
377
 
                        m_bit_timer->adjust(duration, (bitsleft << 16) | data);
378
 
                        break;
379
 
                }
380
 
 
381
 
                // deassert the control line
382
 
                case TIMER_ID_BIT_OFF:
383
 
                        laserdisc_line_w(m_laserdisc, LASERDISC_LINE_CONTROL, CLEAR_LINE);
384
 
                        break;
385
 
 
386
 
                // others to the parent class
387
 
                default:
388
 
                        ldplayer_state::device_timer(timer, id, param, ptr);
389
 
                        break;
390
 
        }
391
 
}
392
 
 
393
 
 
394
 
void pr8210_state::machine_reset()
395
 
{
396
 
        ldplayer_state::machine_reset();
397
 
        m_bit_timer->adjust(attotime::zero);
398
 
}
399
 
 
400
 
 
401
 
void pr8210_state::execute_command(int command)
402
 
{
403
 
        static const UINT8 digits[10] = { 0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0d, 0x1d, 0x03, 0x13 };
404
 
 
405
 
        switch (command)
406
 
        {
407
 
                case CMD_SCAN_REVERSE:
408
 
                        if (m_command_buffer_in == m_command_buffer_out ||
409
 
                                m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
410
 
                        {
411
 
                                add_command(0x1c);
412
 
                                m_playing = true;
413
 
                        }
414
 
                        break;
415
 
 
416
 
                case CMD_STEP_REVERSE:
417
 
                        add_command(0x12);
418
 
                        m_playing = false;
419
 
                        break;
420
 
 
421
 
                case CMD_SLOW_REVERSE:
422
 
                        add_command(0x02);
423
 
                        m_playing = true;
424
 
                        break;
425
 
 
426
 
                case CMD_FAST_REVERSE:
427
 
                        if (m_command_buffer_in == m_command_buffer_out ||
428
 
                                m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
429
 
                        {
430
 
                                add_command(0x0c);
431
 
                                m_playing = true;
432
 
                        }
433
 
                        break;
434
 
 
435
 
                case CMD_SCAN_FORWARD:
436
 
                        if (m_command_buffer_in == m_command_buffer_out ||
437
 
                                m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
438
 
                        {
439
 
                                add_command(0x08);
440
 
                                m_playing = true;
441
 
                        }
442
 
                        break;
443
 
 
444
 
                case CMD_STEP_FORWARD:
445
 
                        add_command(0x04);
446
 
                        m_playing = false;
447
 
                        break;
448
 
 
449
 
                case CMD_SLOW_FORWARD:
450
 
                        add_command(0x18);
451
 
                        m_playing = true;
452
 
                        break;
453
 
 
454
 
                case CMD_FAST_FORWARD:
455
 
                        if (m_command_buffer_in == m_command_buffer_out ||
456
 
                                m_command_buffer_in == (m_command_buffer_out + 1) % ARRAY_LENGTH(m_command_buffer))
457
 
                        {
458
 
                                add_command(0x10);
459
 
                                m_playing = true;
460
 
                        }
461
 
                        break;
462
 
 
463
 
                case CMD_PLAY:
464
 
                        add_command(0x14);
465
 
                        m_playing = true;
466
 
                        break;
467
 
 
468
 
                case CMD_PAUSE:
469
 
                        add_command(0x0a);
470
 
                        m_playing = false;
471
 
                        break;
472
 
 
473
 
                case CMD_FRAME_TOGGLE:
474
 
                        add_command(0x0b);
475
 
                        break;
476
 
 
477
 
                case CMD_CHAPTER_TOGGLE:
478
 
                        add_command(0x06);
479
 
                        break;
480
 
 
481
 
                case CMD_CH1_TOGGLE:
482
 
                        add_command(0x0e);
483
 
                        break;
484
 
 
485
 
                case CMD_CH2_TOGGLE:
486
 
                        add_command(0x16);
487
 
                        break;
488
 
 
489
 
                case CMD_0:
490
 
                case CMD_1:
491
 
                case CMD_2:
492
 
                case CMD_3:
493
 
                case CMD_4:
494
 
                case CMD_5:
495
 
                case CMD_6:
496
 
                case CMD_7:
497
 
                case CMD_8:
498
 
                case CMD_9:
499
 
                        add_command(digits[command - CMD_0]);
500
 
                        break;
501
 
 
502
 
                case CMD_SEARCH:
503
 
                        add_command(0x1a);
504
 
                        m_playing = false;
505
 
                        break;
506
 
        }
507
 
}
508
 
 
509
 
 
510
 
 
511
 
/*************************************
512
 
 *
513
 
 *  LD-V1000 implementation
514
 
 *
515
 
 *************************************/
516
 
 
517
 
void ldv1000_state::execute_command(int command)
518
 
{
519
 
        static const UINT8 digits[10] = { 0x3f, 0x0f, 0x8f, 0x4f, 0x2f, 0xaf, 0x6f, 0x1f, 0x9f, 0x5f };
520
 
        switch (command)
521
 
        {
522
 
                case CMD_SCAN_REVERSE:
523
 
                        laserdisc_data_w(m_laserdisc, 0xf8);
524
 
                        m_playing = true;
525
 
                        break;
526
 
 
527
 
                case CMD_STEP_REVERSE:
528
 
                        laserdisc_data_w(m_laserdisc, 0xfe);
529
 
                        m_playing = false;
530
 
                        break;
531
 
 
532
 
                case CMD_SCAN_FORWARD:
533
 
                        laserdisc_data_w(m_laserdisc, 0xf0);
534
 
                        m_playing = true;
535
 
                        break;
536
 
 
537
 
                case CMD_STEP_FORWARD:
538
 
                        laserdisc_data_w(m_laserdisc, 0xf6);
539
 
                        m_playing = false;
540
 
                        break;
541
 
 
542
 
                case CMD_PLAY:
543
 
                        laserdisc_data_w(m_laserdisc, 0xfd);
544
 
                        m_playing = true;
545
 
                        break;
546
 
 
547
 
                case CMD_PAUSE:
548
 
                        laserdisc_data_w(m_laserdisc, 0xa0);
549
 
                        m_playing = false;
550
 
                        break;
551
 
 
552
 
                case CMD_FRAME_TOGGLE:
553
 
                        laserdisc_data_w(m_laserdisc, 0xf1);
554
 
                        break;
555
 
 
556
 
                case CMD_0:
557
 
                case CMD_1:
558
 
                case CMD_2:
559
 
                case CMD_3:
560
 
                case CMD_4:
561
 
                case CMD_5:
562
 
                case CMD_6:
563
 
                case CMD_7:
564
 
                case CMD_8:
565
 
                case CMD_9:
566
 
                        laserdisc_data_w(m_laserdisc, digits[command - CMD_0]);
567
 
                        break;
568
 
 
569
 
                case CMD_SEARCH:
570
 
                        laserdisc_data_w(m_laserdisc, 0xf7);
571
 
                        m_playing = false;
572
 
                        break;
573
 
        }
574
 
}
575
 
 
576
 
 
577
 
 
578
 
/*************************************
579
 
 *
580
 
 *  Port definitions
581
 
 *
582
 
 *************************************/
583
 
 
584
 
static INPUT_PORTS_START( ldplayer )
585
 
        PORT_START("controls")
586
 
        PORT_BIT( 0x0000001, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Step reverse") PORT_CODE(KEYCODE_LEFT)
587
 
        PORT_BIT( 0x0000002, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Step forward") PORT_CODE(KEYCODE_RIGHT)
588
 
        PORT_BIT( 0x0000004, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Scan reverse") PORT_CODE(KEYCODE_UP)
589
 
        PORT_BIT( 0x0000008, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Scan forward") PORT_CODE(KEYCODE_DOWN)
590
 
        PORT_BIT( 0x0000010, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Slow reverse") PORT_CODE(KEYCODE_OPENBRACE)
591
 
        PORT_BIT( 0x0000020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Slow forward") PORT_CODE(KEYCODE_CLOSEBRACE)
592
 
        PORT_BIT( 0x0000040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Fast reverse") PORT_CODE(KEYCODE_COMMA)
593
 
        PORT_BIT( 0x0000080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Fast forward") PORT_CODE(KEYCODE_STOP)
594
 
        PORT_BIT( 0x0000100, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Play/Pause") PORT_CODE(KEYCODE_SPACE)
595
 
        PORT_BIT( 0x0000200, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Toggle frame display") PORT_CODE(KEYCODE_F)
596
 
        PORT_BIT( 0x0000400, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Toggle chapter display") PORT_CODE(KEYCODE_C)
597
 
        PORT_BIT( 0x0000800, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Toggle left channel") PORT_CODE(KEYCODE_L)
598
 
        PORT_BIT( 0x0001000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("Toggle right channel") PORT_CODE(KEYCODE_R)
599
 
        PORT_BIT( 0x0010000, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("0") PORT_PLAYER(2) PORT_CODE(KEYCODE_0_PAD) PORT_CODE(KEYCODE_0)
600
 
        PORT_BIT( 0x0020000, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("1") PORT_PLAYER(2) PORT_CODE(KEYCODE_1_PAD) PORT_CODE(KEYCODE_1)
601
 
        PORT_BIT( 0x0040000, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_NAME("2") PORT_PLAYER(2) PORT_CODE(KEYCODE_2_PAD) PORT_CODE(KEYCODE_2)
602
 
        PORT_BIT( 0x0080000, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("3") PORT_PLAYER(2) PORT_CODE(KEYCODE_3_PAD) PORT_CODE(KEYCODE_3)
603
 
        PORT_BIT( 0x0100000, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("4") PORT_PLAYER(2) PORT_CODE(KEYCODE_4_PAD) PORT_CODE(KEYCODE_4)
604
 
        PORT_BIT( 0x0200000, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("5") PORT_PLAYER(2) PORT_CODE(KEYCODE_5_PAD) PORT_CODE(KEYCODE_5)
605
 
        PORT_BIT( 0x0400000, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("6") PORT_PLAYER(2) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(KEYCODE_6)
606
 
        PORT_BIT( 0x0800000, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("7") PORT_PLAYER(2) PORT_CODE(KEYCODE_7_PAD) PORT_CODE(KEYCODE_7)
607
 
        PORT_BIT( 0x1000000, IP_ACTIVE_HIGH, IPT_BUTTON9 ) PORT_NAME("8") PORT_PLAYER(2) PORT_CODE(KEYCODE_8_PAD) PORT_CODE(KEYCODE_8)
608
 
        PORT_BIT( 0x2000000, IP_ACTIVE_HIGH, IPT_BUTTON10 ) PORT_NAME("9") PORT_PLAYER(2) PORT_CODE(KEYCODE_9_PAD) PORT_CODE(KEYCODE_9)
609
 
        PORT_BIT( 0x4000000, IP_ACTIVE_HIGH, IPT_BUTTON11 ) PORT_NAME("Enter") PORT_PLAYER(2) PORT_CODE(KEYCODE_ENTER_PAD) PORT_CODE(KEYCODE_ENTER)
610
 
INPUT_PORTS_END
611
 
 
612
 
 
613
 
 
614
 
/*************************************
615
 
 *
616
 
 *  Machine drivers
617
 
 *
618
 
 *************************************/
619
 
 
620
 
static MACHINE_CONFIG_START( ldplayer_core, ldplayer_state )
621
 
 
622
 
        // audio hardware
623
 
        MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
624
 
 
625
 
        MCFG_SOUND_ADD("ldsound", LASERDISC_SOUND, 0)
626
 
        MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
627
 
        MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
628
 
MACHINE_CONFIG_END
629
 
 
630
 
 
631
 
static MACHINE_CONFIG_DERIVED( ldplayer_ntsc, ldplayer_core )
632
 
        MCFG_LASERDISC_SCREEN_ADD_NTSC("screen", BITMAP_FORMAT_RGB32)
633
 
MACHINE_CONFIG_END
634
 
 
635
 
 
636
 
static MACHINE_CONFIG_DERIVED_CLASS( ldv1000, ldplayer_ntsc, ldv1000_state )
637
 
        MCFG_LASERDISC_ADD("laserdisc", PIONEER_LDV1000, "screen", "ldsound")
638
 
        MCFG_LASERDISC_GET_DISC(ldplayer_state::get_disc_static)
639
 
MACHINE_CONFIG_END
640
 
 
641
 
 
642
 
static MACHINE_CONFIG_DERIVED_CLASS( pr8210, ldplayer_ntsc, pr8210_state )
643
 
        MCFG_LASERDISC_ADD("laserdisc", PIONEER_PR8210, "screen", "ldsound")
644
 
        MCFG_LASERDISC_GET_DISC(ldplayer_state::get_disc_static)
645
 
MACHINE_CONFIG_END
646
 
 
647
 
 
648
 
 
649
 
/*************************************
650
 
 *
651
 
 *  ROM definitions
652
 
 *
653
 
 *************************************/
654
 
 
655
 
ROM_START( ldv1000 )
656
 
        DISK_REGION( "laserdisc" )
657
 
ROM_END
658
 
 
659
 
 
660
 
ROM_START( pr8210 )
661
 
        DISK_REGION( "laserdisc" )
662
 
ROM_END
663
 
 
664
 
 
665
 
 
666
 
/*************************************
667
 
 *
668
 
 *  Game drivers
669
 
 *
670
 
 *************************************/
671
 
 
672
 
GAME( 2008, ldv1000, 0, ldv1000, ldplayer, 0, ROT0, "MAME", "Pioneer LDV-1000 Simulator", 0 )
673
 
GAMEL(2008, pr8210,  0, pr8210,  ldplayer, 0, ROT0, "MAME", "Pioneer PR-8210 Simulator", 0, layout_pr8210 )