Sweep out devices and generated files with no path to the CD-i machines

Removed, each verified to have no remaining reference:

 - gen/has_*.h (all six): generated capability defines that nothing
   includes -- HAS_MACHINES_TIMEKPR and friends gated nothing.  The
   timekeeper *device* stays: cdi.cpp instantiates an MK48T08 in every
   machine config.
 - the dual/triple/quad screen fallback layouts (.lay sources, .lh
   headers, the rendlay.cpp includes and the generic.h externs):
   render_target builds multi-screen default views programmatically at
   run time, so only layout_noscreens is referenced; the cdimono1/2
   two-screen configs use the driver's own layout_cdi.  Also the six
   stray device .lay files (ex800, exorterm155, hp9122c, ie15, lx800,
   smartboard) for devices this core has never carried.
 - machine/bcreader + ui/barcode + the main-menu hook: no CD-i machine
   has a barcode reader, and the UI menu was its only consumer.
 - machine/ram + infoxml's <ramoption> output: no machine here uses
   ram_device; the -ramsize option remains declared in emuopts and is
   now inert, as it already was in practice.
 - util/vbiparse: laserdisc VBI parsing, orphaned when laserdsc was
   removed.
 - vestigial includes: sound/cdda.h in cdi.cpp/cdicdic (the CDIC plays
   CD audio through its own DMADAC path; cdda_device was never even
   compiled) and cpu/mcs51/mcs51.h in includes/cdi.h (the servo MCU is
   an M68HC05, not an 8051).

Per-frame video and audio CRC traces for the .zip, .7z and CHD harness
runs are bit-identical to the previous build.
This commit is contained in:
LibretroAdmin authored and libretroadmin committed 2026-08-05 11:48:10 +02:00
1 parent 33e72ac405
commit 69c7a2ee61
39 files changed
-2621

No files matched your search

-4
View File
@@ -118,7 +118,6 @@ FRONTEND_SRC_CXX := \
$(CORE_DIR)/src/frontend/mame/ui/about.cpp \
$(CORE_DIR)/src/frontend/mame/ui/analogipt.cpp \
$(CORE_DIR)/src/frontend/mame/ui/auditmenu.cpp \
$(CORE_DIR)/src/frontend/mame/ui/barcode.cpp \
$(CORE_DIR)/src/frontend/mame/ui/cheatopt.cpp \
$(CORE_DIR)/src/frontend/mame/ui/confswitch.cpp \
$(CORE_DIR)/src/frontend/mame/ui/custui.cpp \
@@ -273,8 +272,6 @@ OPTIONAL_SRC_CXX := \
$(CORE_DIR)/src/devices/imagedev/cassette.cpp \
$(CORE_DIR)/src/devices/imagedev/chd_cd.cpp \
$(CORE_DIR)/src/devices/imagedev/floppy.cpp \
$(CORE_DIR)/src/devices/machine/bcreader.cpp \
$(CORE_DIR)/src/devices/machine/ram.cpp \
$(CORE_DIR)/src/devices/machine/scc68070.cpp \
$(CORE_DIR)/src/devices/machine/timekpr.cpp \
$(CORE_DIR)/src/devices/sound/dmadac.cpp \
@@ -358,7 +355,6 @@ UTILS_SRC_CXX := \
$(CORE_DIR)/src/lib/util/un7z.cpp \
$(CORE_DIR)/src/lib/util/unicode.cpp \
$(CORE_DIR)/src/lib/util/unzip.cpp \
$(CORE_DIR)/src/lib/util/vbiparse.cpp \
$(CORE_DIR)/src/lib/util/vecstream.cpp \
$(CORE_DIR)/src/lib/util/wavwrite.cpp \
$(CORE_DIR)/src/lib/util/xmlfile.cpp \
-14
View File
@@ -1,14 +0,0 @@
static const unsigned char layout_dualhovu_data[] = {
120, 156, 197, 147, 193, 110, 194, 48, 12, 134, 239, 123, 10, 203, 39, 56, 148, 166, 148, 195, 14, 77, 57, 128, 196, 145, 3, 218, 3, 4, 106, 173,
209, 210, 4, 37, 41, 180, 111, 79, 218, 77, 170, 180, 161, 174, 99, 147, 118, 74, 236, 95, 250, 243, 217, 142, 179, 117, 83, 41, 184, 144, 117, 210,
104, 142, 201, 130, 225, 58, 207, 42, 81, 145, 18, 173, 169, 253, 32, 45, 49, 207, 46, 146, 174, 160, 131, 200, 113, 91, 11, 5, 251, 160, 70, 47,
186, 32, 27, 68, 119, 178, 68, 26, 100, 8, 27, 142, 44, 100, 142, 166, 214, 133, 131, 62, 130, 150, 99, 148, 46, 88, 138, 112, 149, 133, 47, 57,
174, 16, 74, 146, 175, 165, 231, 152, 98, 156, 103, 241, 187, 193, 103, 163, 228, 142, 17, 251, 222, 36, 238, 88, 199, 136, 97, 182, 19, 103, 69, 206,
205, 39, 178, 255, 47, 248, 65, 22, 20, 29, 219, 168, 59, 39, 1, 79, 120, 106, 140, 119, 213, 143, 234, 207, 144, 127, 216, 237, 223, 194, 63, 78,
190, 49, 167, 55, 47, 164, 250, 130, 121, 111, 156, 227, 31, 218, 88, 73, 218, 11, 31, 214, 7, 172, 9, 151, 96, 159, 60, 179, 145, 42, 30, 108,
197, 71, 21, 241, 176, 182, 249, 211, 13, 159, 23, 52, 230
};
const internal_layout layout_dualhovu = {
985, sizeof(layout_dualhovu_data), internal_layout::compression::ZLIB, layout_dualhovu_data
};
-14
View File
@@ -1,14 +0,0 @@
static const unsigned char layout_dualhsxs_data[] = {
120, 156, 189, 147, 191, 10, 194, 48, 16, 198, 119, 159, 226, 184, 73, 135, 218, 214, 58, 56, 52, 117, 80, 112, 116, 16, 31, 32, 218, 195, 6, 211,
68, 146, 84, 237, 219, 27, 171, 34, 42, 136, 127, 160, 75, 146, 203, 71, 62, 126, 247, 133, 75, 199, 199, 82, 194, 158, 140, 21, 90, 49, 140, 251,
17, 142, 179, 180, 228, 37, 73, 94, 235, 202, 221, 165, 1, 102, 233, 94, 208, 1, 148, 23, 25, 78, 43, 46, 97, 33, 114, 10, 86, 117, 112, 222,
189, 108, 215, 134, 72, 129, 80, 57, 29, 25, 70, 254, 102, 165, 43, 149, 91, 104, 42, 168, 155, 245, 32, 114, 87, 48, 28, 34, 20, 36, 54, 133,
99, 152, 96, 152, 165, 225, 229, 241, 179, 73, 252, 96, 50, 236, 71, 201, 167, 62, 225, 25, 246, 61, 50, 116, 103, 124, 39, 201, 218, 94, 43, 240,
127, 146, 207, 253, 87, 4, 75, 239, 108, 218, 160, 189, 152, 4, 73, 147, 248, 223, 196, 237, 38, 125, 99, 255, 5, 124, 162, 215, 91, 199, 133, 124,
225, 252, 62, 30, 109, 4, 41, 199, 157, 31, 31, 48, 218, 31, 188, 125, 60, 138, 222, 180, 241, 99, 22, 215, 46, 194, 251, 216, 102, 157, 19, 188,
234, 52, 230
};
const internal_layout layout_dualhsxs = {
985, sizeof(layout_dualhsxs_data), internal_layout::compression::ZLIB, layout_dualhsxs_data
};
-14
View File
@@ -1,14 +0,0 @@
static const unsigned char layout_dualhuov_data[] = {
120, 156, 197, 147, 193, 110, 194, 48, 12, 134, 239, 60, 133, 229, 19, 59, 148, 6, 202, 129, 67, 83, 14, 32, 113, 220, 1, 237, 1, 2, 181, 214,
104, 105, 50, 37, 41, 208, 183, 159, 129, 73, 72, 27, 234, 10, 67, 226, 148, 196, 127, 244, 231, 179, 29, 231, 243, 67, 109, 96, 71, 62, 104, 103,
37, 142, 71, 2, 231, 69, 94, 171, 154, 140, 106, 93, 19, 47, 210, 4, 139, 124, 167, 105, 15, 150, 69, 137, 203, 70, 25, 120, 179, 37, 249, 228,
149, 239, 176, 24, 182, 158, 200, 130, 230, 216, 129, 157, 56, 178, 113, 141, 45, 3, 240, 73, 32, 180, 18, 147, 108, 36, 50, 132, 189, 46, 99, 37,
113, 138, 80, 145, 126, 175, 162, 196, 12, 211, 34, 79, 207, 6, 63, 141, 196, 21, 35, 241, 183, 73, 122, 100, 237, 34, 134, 225, 74, 125, 26, 10,
225, 165, 39, 251, 115, 193, 215, 186, 164, 100, 211, 38, 199, 181, 23, 112, 143, 167, 186, 120, 167, 167, 86, 61, 12, 249, 198, 106, 255, 23, 254, 126,
242, 133, 219, 126, 68, 165, 205, 47, 204, 107, 237, 236, 254, 208, 206, 107, 178, 81, 69, 30, 31, 240, 142, 55, 108, 63, 158, 137, 142, 44, 238, 44,
197, 119, 22, 233, 101, 108, 139, 193, 23, 160, 14, 52, 230
};
const internal_layout layout_dualhuov = {
985, sizeof(layout_dualhuov_data), internal_layout::compression::ZLIB, layout_dualhuov_data
};
-13
View File
@@ -1,13 +0,0 @@
static const unsigned char layout_quadhsxs_data[] = {
120, 156, 213, 148, 207, 10, 130, 64, 16, 135, 239, 61, 197, 48, 167, 58, 164, 235, 26, 81, 224, 218, 177, 115, 244, 4, 218, 14, 185, 160, 107, 184,
90, 249, 246, 249, 39, 10, 59, 132, 164, 4, 94, 118, 217, 249, 177, 31, 195, 199, 48, 222, 238, 158, 196, 112, 165, 204, 168, 84, 11, 116, 44, 134,
59, 223, 75, 130, 132, 226, 160, 76, 139, 252, 29, 113, 244, 189, 171, 162, 27, 232, 42, 20, 120, 40, 2, 9, 71, 37, 105, 25, 150, 203, 250, 174,
98, 115, 202, 136, 52, 40, 45, 233, 46, 144, 85, 149, 48, 45, 180, 52, 208, 188, 160, 108, 206, 155, 146, 121, 36, 112, 133, 16, 145, 58, 71, 185,
64, 23, 109, 223, 179, 219, 207, 159, 16, 167, 3, 89, 89, 204, 253, 141, 195, 59, 156, 141, 197, 214, 191, 113, 220, 14, 199, 225, 22, 219, 246, 5,
217, 181, 189, 239, 14, 97, 190, 15, 46, 49, 25, 179, 248, 139, 205, 81, 84, 142, 227, 113, 160, 68, 14, 97, 9, 124, 74, 35, 216, 54, 227, 54,
180, 33, 234, 94, 253, 244, 67, 125, 245, 55, 193, 241, 123, 106, 28, 232, 176, 47, 228, 105, 207, 126, 239, 71, 127, 246, 0, 89, 128, 158, 39
};
const internal_layout layout_quadhsxs = {
1346, sizeof(layout_quadhsxs_data), internal_layout::compression::ZLIB, layout_quadhsxs_data
};
-12
View File
@@ -1,12 +0,0 @@
static const unsigned char layout_triphsxs_data[] = {
120, 156, 189, 146, 59, 14, 194, 48, 12, 134, 119, 78, 17, 121, 130, 161, 77, 250, 16, 98, 72, 210, 145, 3, 192, 5, 90, 98, 209, 72, 109, 138,
154, 62, 111, 79, 90, 134, 170, 44, 60, 132, 88, 108, 249, 183, 253, 73, 254, 101, 158, 12, 101, 65, 58, 172, 173, 174, 140, 128, 192, 103, 144, 72,
94, 166, 37, 22, 233, 88, 181, 205, 210, 10, 65, 242, 78, 99, 79, 140, 107, 10, 56, 215, 250, 86, 32, 57, 105, 133, 94, 54, 122, 83, 118, 3,
246, 82, 35, 26, 162, 141, 194, 65, 0, 115, 74, 86, 181, 70, 89, 50, 87, 100, 156, 99, 175, 85, 147, 11, 136, 129, 228, 168, 175, 121, 35, 32,
2, 42, 57, 125, 44, 63, 67, 130, 21, 36, 246, 89, 244, 29, 39, 92, 113, 14, 62, 219, 191, 203, 161, 211, 217, 175, 142, 39, 219, 99, 234, 52,
107, 119, 127, 177, 225, 39, 30, 124, 104, 0, 93, 222, 66, 110, 238, 14, 99, 178, 87
};
const internal_layout layout_triphsxs = {
569, sizeof(layout_triphsxs_data), internal_layout::compression::ZLIB, layout_triphsxs_data
};
-7
View File
@@ -1,7 +0,0 @@
// Generated file, edition is futile
#ifndef GENERATED_HAS_BUSES_H
#define GENERATED_HAS_BUSES_H
#endif
-10
View File
@@ -1,10 +0,0 @@
// Generated file, edition is futile
#ifndef GENERATED_HAS_CPUS_H
#define GENERATED_HAS_CPUS_H
#define HAS_CPUS_MCS51
#define HAS_CPUS_M6805
#define HAS_CPUS_M680X0
#endif
-7
View File
@@ -1,7 +0,0 @@
// Generated file, edition is futile
#ifndef GENERATED_HAS_FORMATS_H
#define GENERATED_HAS_FORMATS_H
#endif
-9
View File
@@ -1,9 +0,0 @@
// Generated file, edition is futile
#ifndef GENERATED_HAS_MACHINES_H
#define GENERATED_HAS_MACHINES_H
#define HAS_MACHINES_TIMEKPR
#define HAS_MACHINES_SCC68070
#endif
-9
View File
@@ -1,9 +0,0 @@
// Generated file, edition is futile
#ifndef GENERATED_HAS_SOUNDS_H
#define GENERATED_HAS_SOUNDS_H
#define HAS_SOUNDS_DMADAC
#define HAS_SOUNDS_CDDA
#endif
-7
View File
@@ -1,7 +0,0 @@
// Generated file, edition is futile
#ifndef GENERATED_HAS_VIDEOS_H
#define GENERATED_HAS_VIDEOS_H
#endif
-326
View File
@@ -1,326 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***************************************************************************
bcreader.c
Generic barcode reader emulation.
This device only provides the storage of the actual barcode, entered
by the user via Internal UI, both as a raw strip of pixels (up to 95,
for an EAN-13 barcode) and as an array of 0-9 digits.
It is up to the driver to handle the serial transfer of the data to
the emulated machine, depending on the used protocol
E.g. Bandai Datach games directly read the raw pixel sequence of
black/white bars;
OTOH Barcode Battle (used by Barcode World for NES and a few SNES
titles) sends the digits as sequences of 20 bytes (13 for the code,
suitably padded for shorted codes, followed by a signature) and the
actual serial transmission to the console is up to the slot device
connected to the NES/SNES controller port (yet to be emulated, in this
case)
Note: we currently support the following barcode formats
* UPC-A: 12 digits
* EAN-13: 13 digits (extension of the former)
* EAN-8: 8 digits (same encoding as UPC-A, but 4-digits blocks instead
of 6-digits blocks)
Notice that since EAN-13 is an extension of UPC-A, we just treat UPC-A
as an EAN-13 code with leading '0'. If any barcode reader shall be found
which supports the older format only, this shall be changed
TODO: add support for UPC-E barcodes? these are 8 digits barcodes with 17
black stripes (they are compressed UPC-A codes). Datach reader does not
support these, so it is low priority
TODO 2: verify barcode checksum in is_valid() and not only length, so
that we can then use the actual last digit in the decode function below,
rather than replacing it with the checksum value
TODO 3: possibly the white spaces before the actual barcode (see the
61 white pixels sent by read_pixel() before and after the code), shall
be moved to the specific implementations to emulate different "sensitivity"
of the readers? Bandai Datach seems to need at least 32 pixels...
***************************************************************************/
#include "emu.h"
#include "bcreader.h"
// device type definition
DEFINE_DEVICE_TYPE(BARCODE_READER, barcode_reader_device, "bcreader", "Barcode Reader")
//-------------------------------------------------
// barcode_reader_device - constructor
//-------------------------------------------------
barcode_reader_device::barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, BARCODE_READER, tag, owner, clock)
, m_byte_length(0)
, m_pixel_length(0)
, m_byte_count(0)
, m_pixel_count(0)
, m_new_code(0)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void barcode_reader_device::device_start()
{
save_item(m_byte_data, "DATACH/m_byte_data");
save_item(m_pixel_data, "DATACH/m_pixel_data");
save_item(m_byte_length, "DATACH/m_byte_length");
save_item(m_pixel_length, "DATACH/m_pixel_length");
save_item(m_byte_count, "DATACH/m_byte_count");
save_item(m_pixel_count, "DATACH/m_pixel_count");
save_item(m_new_code, "DATACH/m_new_code");
}
//-------------------------------------------------
// Barcode Decoding - convert the entered sequence
// of digits into a sequence of B/W pixels (the
// actual bars) - each digit corresponds to 7 pixels
// 0 is black, 1 is white
//-------------------------------------------------
// Left Odd
static const uint8_t bcread_data_LO[10][7] =
{
{1, 1, 1, 0, 0, 1, 0}, {1, 1, 0, 0, 1, 1, 0},
{1, 1, 0, 1, 1, 0, 0}, {1, 0, 0, 0, 0, 1, 0},
{1, 0, 1, 1, 1, 0, 0}, {1, 0, 0, 1, 1, 1, 0},
{1, 0, 1, 0, 0, 0, 0}, {1, 0, 0, 0, 1, 0, 0},
{1, 0, 0, 1, 0, 0, 0}, {1, 1, 1, 0, 1, 0, 0}
};
// Left Even
static const uint8_t bcread_data_LE[10][7] =
{
{1, 0, 1, 1, 0, 0, 0}, {1, 0, 0, 1, 1, 0, 0},
{1, 1, 0, 0, 1, 0, 0}, {1, 0, 1, 1, 1, 1, 0},
{1, 1, 0, 0, 0, 1, 0}, {1, 0, 0, 0, 1, 1, 0},
{1, 1, 1, 1, 0, 1, 0}, {1, 1, 0, 1, 1, 1, 0},
{1, 1, 1, 0, 1, 1, 0}, {1, 1, 0, 1, 0, 0, 0}
};
// Right Even
static const uint8_t bcread_data_RE[10][7] =
{
{0, 0, 0, 1, 1, 0, 1}, {0, 0, 1, 1, 0, 0, 1},
{0, 0, 1, 0, 0, 1, 1}, {0, 1, 1, 1, 1, 0, 1},
{0, 1, 0, 0, 0, 1, 1}, {0, 1, 1, 0, 0, 0, 1},
{0, 1, 0, 1, 1, 1, 1}, {0, 1, 1, 1, 0, 1, 1},
{0, 1, 1, 0, 1, 1, 1}, {0, 0, 0, 1, 0, 1, 1}
};
// EAN-13 added an extra digit to determine
// the parity type of the first digits block
static const uint8_t bcread_parity_type[10][6] =
{
{1, 1, 1, 1, 1, 1}, {1, 1, 0, 1, 0, 0},
{1, 1, 0, 0, 1, 0}, {1, 1, 0, 0, 0, 1},
{1, 0, 1, 1, 0, 0}, {1, 0, 0, 1, 1, 0},
{1, 0, 0, 0, 1, 1}, {1, 0, 1, 0, 1, 0},
{1, 0, 1, 0, 0, 1}, {1, 0, 0, 1, 0, 1}
};
void barcode_reader_device::decode(int len)
{
int output = 0;
int sum = 0;
if (len == 13)
{
// UPC-A and EAN-13
m_pixel_data[output++] = 0;
m_pixel_data[output++] = 1;
m_pixel_data[output++] = 0;
for (int i = 1; i < 7; i++)
{
if (bcread_parity_type[m_byte_data[0]][i - 1])
{
for (int j = 0; j < 7; j++)
m_pixel_data[output++] = bcread_data_LO[m_byte_data[i]][j];
}
else
{
for (int j = 0; j < 7; j++)
m_pixel_data[output++] = bcread_data_LE[m_byte_data[i]][j];
}
}
m_pixel_data[output++] = 1;
m_pixel_data[output++] = 0;
m_pixel_data[output++] = 1;
m_pixel_data[output++] = 0;
m_pixel_data[output++] = 1;
for (int i = 7; i < 12; i++)
{
for (int j = 0; j < 7; j++)
m_pixel_data[output++] = bcread_data_RE[m_byte_data[i]][j];
}
// ignore the last digit and compute it as checksum of the first 12
for (int i = 0; i < 12; i++)
sum += (i & 1) ? (m_byte_data[i] * 3) : (m_byte_data[i] * 1);
}
else if (len == 8)
{
// EAN-8 (same encoding as UPC-A, but only 4+4 digits, instead of 6+6)
m_pixel_data[output++] = 0;
m_pixel_data[output++] = 1;
m_pixel_data[output++] = 0;
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 7; j++)
m_pixel_data[output++] = bcread_data_LO[m_byte_data[i]][j];
}
m_pixel_data[output++] = 1;
m_pixel_data[output++] = 0;
m_pixel_data[output++] = 1;
m_pixel_data[output++] = 0;
m_pixel_data[output++] = 1;
for (int i = 4; i < 7; i++)
{
for (int j = 0; j < 7; j++)
m_pixel_data[output++] = bcread_data_RE[m_byte_data[i]][j];
}
// ignore the last digit and compute it as checksum of the first 12
for (int i = 0; i < 7; i++)
sum += (i & 1) ? (m_byte_data[i] * 1) : (m_byte_data[i] * 3);
}
{
sum = (10 - (sum % 10)) % 10;
for (int i = 0; i < 7; i++)
m_pixel_data[output++] = bcread_data_RE[sum][i];
m_pixel_data[output++] = 0;
m_pixel_data[output++] = 1;
m_pixel_data[output++] = 0;
}
m_byte_length = len;
m_pixel_length = output;
// printf("byte len %d - pixel len\n", m_byte_length, m_pixel_length);
}
//-------------------------------------------------
// write_code - invoked by UI, stores the barcode
// both as an array of digits and as a sequence
// of B/W pixels (the actual bars)
//-------------------------------------------------
void barcode_reader_device::write_code(const char *barcode, int len)
{
int shift = 0;
int deconde_len = len;
// len has already been checked to be one of the following: 8, 12 or 13
if (deconde_len == 12)
{
// convert UPC-A to EAN-13
shift = 1;
deconde_len = 13;
m_byte_data[0] = 0;
}
for (int i = 0; i < len; i++)
m_byte_data[i+shift] = barcode[i] - '0';
decode(deconde_len);
m_new_code = 1;
}
//-------------------------------------------------
// read_code - accessor for drivers which read
// the codes by bytes
//-------------------------------------------------
uint8_t barcode_reader_device::read_code()
{
if (m_new_code)
{
if (m_byte_count < m_byte_length)
{
uint8_t val = m_byte_data[m_byte_count];
m_byte_count++;
return val;
}
else
{
m_byte_count = 0;
m_new_code = 0;
return 0;
}
}
// no pending transfer
return 0;
}
//-------------------------------------------------
// read_pixel - accessor for drivers which read
// the codes by pixels
//-------------------------------------------------
int barcode_reader_device::read_pixel()
{
if (m_new_code)
{
// start of card: 61 white pixels
if (m_pixel_count < 61)
{
m_pixel_count++;
return 1;
}
// barcode: approx 95 pixels for B/W bars
else if (m_pixel_count < 61 + m_pixel_length)
{
// actual barcode starts here
int val = m_pixel_data[m_pixel_count - 61];
m_pixel_count++;
return val;
}
// end of card: 61 white pixels
else if (m_pixel_count < 61 + m_pixel_length + 61)
{
m_pixel_count++;
return 1;
}
// finished scan, erase code
else
{
m_pixel_count = 0;
m_new_code = 0;
return 0;
}
}
// no pending transfer = black pixel = 0
return 0;
}
-52
View File
@@ -1,52 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/*********************************************************************
bcreader.h
Generic barcode reader emulation.
*********************************************************************/
#ifndef MAME_DEVICES_MACHINE_BCREADER_H
#define MAME_DEVICES_MACHINE_BCREADER_H
#pragma once
class barcode_reader_device : public device_t
{
public:
// construction/destruction
barcode_reader_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t 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_t read_code();
int read_pixel();
// TODO: add checksum validation!
bool is_valid(int len) { return (len != 12 && len != 13 && len != 8) ? false : true; }
void decode(int len);
protected:
// device-level overrides
virtual void device_start() override;
uint8_t m_byte_data[13];
uint8_t m_pixel_data[100];
int m_byte_length;
int m_pixel_length;
int m_byte_count;
int m_pixel_count;
int m_new_code;
};
// device type definition
DECLARE_DEVICE_TYPE(BARCODE_READER, barcode_reader_device)
// device type iterator
typedef device_type_enumerator<barcode_reader_device> barcode_reader_device_enumerator;
#endif // MAME_DEVICES_MACHINE_BCREADER_H
-247
View File
@@ -1,247 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Dirk Best
/*************************************************************************
RAM device
Provides a configurable amount of RAM to drivers
TODO:
- add RAM size options to UI, eg. under Machine Configuration
- remove limitations due to hardcoded RAM_TAG:
+ *configurable* RAM device can only be added to root device
(that is the driver device)
+ can only have one *configurable* RAM device per machine driver
**************************************************************************/
#include "emu.h"
#include "ram.h"
#include "corestr.h"
#include "emuopts.h"
#include <cstdio>
#include <cctype>
#include <algorithm>
#include <functional>
#include <set>
namespace {
//-------------------------------------------------
// parse_string - convert a ram string to an
// integer value
//-------------------------------------------------
u32 parse_string(const char *s)
{
static constexpr struct
{
const char *suffix;
unsigned multiple;
} s_suffixes[] =
{
{ "", 1 },
{ "k", 1024 },
{ "kb", 1024 },
{ "kib", 1024 },
{ "m", 1024 * 1024 },
{ "mb", 1024 * 1024 },
{ "mib", 1024 * 1024 }
};
// parse the string
unsigned ram = 0;
char suffix[8] = { 0, };
sscanf(s, "%u%7s", &ram, suffix);
// perform the lookup
auto const iter(std::find_if(
std::begin(s_suffixes),
std::end(s_suffixes),
[&suffix](const auto &potential_suffix) { return !core_stricmp(suffix, potential_suffix.suffix); }));
// identify the multiplier (or 0 if not recognized, signalling a parse failure)
unsigned const multiplier((iter != std::end(s_suffixes)) ? iter->multiple : 0);
// return the result
return ram * multiplier;
}
//-------------------------------------------------
// calculate_extra_options
//-------------------------------------------------
ram_device::extra_option_vector calculate_extra_options(const char *extra_options_string, std::string *bad_option)
{
ram_device::extra_option_vector result;
std::string const options(extra_options_string);
bool done(false);
for (std::string::size_type start = 0, end = options.find_first_of(','); !done; start = end + 1, end = options.find_first_of(',', start))
{
// ignore spaces
while ((end > start) && (options.length() > start) && ((' ' == options[start]) || ('\t' == options[start])))
++start;
// parse the option
std::string ram_option_string(options.substr(start, (end == -1) ? -1 : end - start));
u32 const ram_option = parse_string(ram_option_string.c_str());
if (ram_option == 0)
{
if (bad_option)
*bad_option = std::move(ram_option_string);
return result;
}
// and add it to the results
result.emplace_back(std::move(ram_option_string), ram_option);
done = std::string::npos == end;
}
return result;
}
};
/*****************************************************************************
LIVE DEVICE
*****************************************************************************/
// device type definition
DEFINE_DEVICE_TYPE(RAM, ram_device, "ram", "RAM")
//-------------------------------------------------
// ram_device - constructor
//-------------------------------------------------
ram_device::ram_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, RAM, tag, owner, clock)
, m_size(0)
, m_default_size(0)
, m_default_value(0xff)
, m_extra_options_string(nullptr)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void ram_device::device_start()
{
// the device named 'ram' can get ram options from command line
u32 const defsize(default_size());
m_size = 0;
if (strcmp(tag(), ":" RAM_TAG) == 0)
{
char const *const ramsize_string(machine().options().ram_size());
if (ramsize_string && *ramsize_string)
{
m_size = parse_string(ramsize_string);
if (!is_valid_size(m_size))
{
extra_option_vector::const_iterator found(std::find_if(m_extra_options.begin(), m_extra_options.end(), [defsize] (extra_option const &opt) { return opt.second == defsize; }));
std::ostringstream output;
util::stream_format(output, "Cannot recognize the RAM option %s (valid options are ", ramsize_string);
if (!m_extra_options_string)
util::stream_format(output, "%s).\n", m_default_size);
else if (m_extra_options.end() != found)
util::stream_format(output, "%s).\n", m_extra_options_string);
else
util::stream_format(output, "%s,%s).\n", m_default_size, m_extra_options_string);
osd_printf_error("%s", output.str());
osd_printf_warning("Setting value to default %s\n", m_default_size);
m_size = 0;
}
}
}
// if we didn't get a size yet, use the default
if (m_size == 0)
m_size = defsize;
// allocate space for the ram
m_pointer = std::make_unique<u8 []>(m_size);
std::fill_n(m_pointer.get(), m_size, m_default_value);
// register for state saving
save_item(NAME(m_size));
save_pointer(NAME(m_pointer), m_size);
}
//-------------------------------------------------
// device_validity_check - device-specific validity
// checks
//-------------------------------------------------
void ram_device::device_validity_check(validity_checker &valid) const
{
// verify default ram value
if (default_size() == 0)
osd_printf_error("Invalid default RAM option: %s\n", m_default_size);
// calculate any extra options
if (m_extra_options_string)
{
std::string bad_option;
extra_option_vector const extras(calculate_extra_options(m_extra_options_string, &bad_option));
// report any errors
if (!bad_option.empty())
osd_printf_error("Invalid RAM option: %s\n", bad_option);
// report duplicates
using extra_option_ref_set = std::set<std::reference_wrapper<extra_option const>, bool (*)(extra_option const &, extra_option const &)>;
extra_option_ref_set sorted([] (extra_option const &a, extra_option const &b) { return a.second < b.second; });
for (extra_option const &opt : extras)
{
auto const ins(sorted.emplace(opt));
if (!ins.second)
osd_printf_error("Duplicate RAM options: %s == %s (%u)\n", ins.first->get().first, opt.first, opt.second);
}
}
}
//-------------------------------------------------
// is_valid_size
//-------------------------------------------------
bool ram_device::is_valid_size(u32 size) const
{
return size == default_size()
|| std::find_if(extra_options().begin(), extra_options().end(), [size] (extra_option const &opt) { return opt.second == size; }) != extra_options().end();
}
//-------------------------------------------------
// default_size
//-------------------------------------------------
u32 ram_device::default_size() const
{
return parse_string(m_default_size);
}
//-------------------------------------------------
// extra_options
//-------------------------------------------------
const ram_device::extra_option_vector &ram_device::extra_options() const
{
if (m_extra_options_string && m_extra_options.empty())
m_extra_options = calculate_extra_options(m_extra_options_string, nullptr);
return m_extra_options;
}
-88
View File
@@ -1,88 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Nathan Woods, Dirk Best
/*************************************************************************
RAM device
Provides a configurable amount of RAM to drivers
**************************************************************************/
#ifndef MAME_MACHINE_RAM_H
#define MAME_MACHINE_RAM_H
#pragma once
#include <memory>
#include <utility>
#include <vector>
/***************************************************************************
CONSTANTS
***************************************************************************/
#define RAM_TAG "ram"
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
class ram_device : public device_t
{
public:
using extra_option = std::pair<std::string, u32>;
using extra_option_vector = std::vector<extra_option>;
// construction/destruction
ram_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock = 0);
// accessors
u32 size() const { return m_size; }
u32 mask() const { return m_size - 1; }
u8 *pointer() { return &m_pointer[0]; }
char const *default_size_string() const { return m_default_size; };
u32 default_size() const;
extra_option_vector const &extra_options() const;
// read/write
u8 read(offs_t offset) { return m_pointer[offset % m_size]; }
void write(offs_t offset, u8 data) { m_pointer[offset % m_size] = data; }
// inline configuration helpers
ram_device &set_default_size(char const *default_size) { m_default_size = default_size; return *this; }
ram_device &set_extra_options(char const *extra_options)
{
m_extra_options_string = extra_options && extra_options[0] ? extra_options : nullptr;
m_extra_options.clear();
return *this;
}
ram_device &set_default_value(u8 default_value) { m_default_value = default_value; return *this; }
protected:
virtual void device_start() override;
virtual void device_validity_check(validity_checker &valid) const override;
private:
bool is_valid_size(u32 size) const;
// device state
u32 m_size;
std::unique_ptr<u8 []> m_pointer;
// device config
char const * m_default_size;
u8 m_default_value;
mutable extra_option_vector m_extra_options;
char const * m_extra_options_string;
};
// device type definition
DECLARE_DEVICE_TYPE(RAM, ram_device)
// device iterator
typedef device_type_enumerator<ram_device> ram_device_enumerator;
#endif // MAME_MACHINE_RAM_H
-51
View File
@@ -1,51 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<view name="Dual Over-Under">
<screen index="0">
<bounds x="0" y="-3.03" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="0" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Over-Under (Gapless)">
<screen index="0">
<bounds x="0" y="-3" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="0" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Side-by-Side">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4.03" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Side-by-Side (Gapless)">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4" y="0" width="4" height="3" />
</screen>
</view>
<view name="Cocktail">
<screen index="1">
<bounds x="0" y="-3.03" width="4" height="3" />
<orientation rotate="180" />
</screen>
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
</view>
</mamelayout>
-51
View File
@@ -1,51 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<view name="Dual Side-by-Side">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4.03" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Side-by-Side (Gapless)">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Over-Under">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="0" y="-3.03" width="4" height="3" />
</screen>
</view>
<view name="Dual Over-Under (Gapless)">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="0" y="-3" width="4" height="3" />
</screen>
</view>
<view name="Cocktail">
<screen index="1">
<bounds x="0" y="-3.03" width="4" height="3" />
<orientation rotate="180" />
</screen>
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
</view>
</mamelayout>
-51
View File
@@ -1,51 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<view name="Dual Under-Over">
<screen index="1">
<bounds x="0" y="-3.03" width="4" height="3" />
</screen>
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Under-Over (Gapless)">
<screen index="1">
<bounds x="0" y="-3" width="4" height="3" />
</screen>
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Side-by-Side">
<screen index="1">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="0">
<bounds x="4.03" y="0" width="4" height="3" />
</screen>
</view>
<view name="Dual Side-by-Side (Gapless)">
<screen index="1">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="0">
<bounds x="4" y="0" width="4" height="3" />
</screen>
</view>
<view name="Cocktail">
<screen index="0">
<bounds x="0" y="-3.03" width="4" height="3" />
<orientation rotate="180" />
</screen>
<screen index="1">
<bounds x="0" y="0" width="4" height="3" />
</screen>
</view>
</mamelayout>
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
copyright-holders:Dirk Best
-->
<mamelayout version="2">
<view name="Default Layout">
<bounds left="0" top="0" right="1" bottom="1" />
</view>
</mamelayout>
-77
View File
@@ -1,77 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
LEDs for the Motorola EXORterm 155
-->
<mamelayout version="2">
<element name="red_led">
<disk state="0">
<color red="1.0" green="0.0" blue="0.0" />
</disk>
</element>
<element name="ON_LINE">
<text string="ON LINE">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="AUTO_LF">
<text string="AUTO LF">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="PAGE_MODE">
<text string="PAGE MODE">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="INS_CHAR">
<text string="INS CHAR">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="background">
<rect>
<color red="0.0" green="0.0" blue="0.0" />
</rect>
</element>
<view name="Keyboard LEDs">
<bounds left="0" top="0" right="720" bottom="544" />
<screen index="0">
<bounds x="0" y="0" width="720" height="512" />
</screen>
<element name="auto_lf_txt" ref="AUTO_LF">
<bounds left="0" right="70" top="520" bottom="528" />
</element>
<element name="auto_lf_led" ref="red_led">
<bounds left="31" right="39" top="532" bottom="540" />
</element>
<element name="online_txt" ref="ON_LINE">
<bounds left="70" right="140" top="520" bottom="528" />
</element>
<element name="online_led" ref="red_led">
<bounds left="101" right="109" top="532" bottom="540" />
</element>
<element name="page_mode_txt" ref="PAGE_MODE">
<bounds left="140" right="210" top="520" bottom="528" />
</element>
<element name="page_mode_led" ref="red_led">
<bounds left="171" right="179" top="532" bottom="540" />
</element>
<element name="insert_char_txt" ref="INS_CHAR">
<bounds left="281" right="351" top="520" bottom="528" />
</element>
<element name="insert_char_led" ref="red_led">
<bounds left="312" right="320" top="532" bottom="540" />
</element>
</view>
</mamelayout>
-5
View File
@@ -22,14 +22,9 @@
extern const internal_layout layout_noscreens; // for screenless systems
// dual screen layouts
extern const internal_layout layout_dualhsxs; // dual 4:3 screens side-by-side
extern const internal_layout layout_dualhovu; // dual 4:3 screens above and below
extern const internal_layout layout_dualhuov; // dual 4:3 screens below and above
// triple screen layouts
extern const internal_layout layout_triphsxs; // triple 4:3 screens side-by-side
// quad screen layouts
extern const internal_layout layout_quadhsxs; // quad 4:3 screens side-by-side
#endif // MAME_EMU_LAYOUT_GENERIC_H
-33
View File
@@ -1,33 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
copyright-holders:Sven Schnelle
Hewlett-Packard HP 9122C floppy drive Layout
-->
<mamelayout version="2">
<element name="background"><rect><color red="0.30" green="0.30" blue="0.30"/></rect></element>
<element name="ledr" defstate="0">
<disk state="1"><color red="1.0" green="0.0" blue="0.0"/></disk>
<disk state="0"><color red="0.2" green="0.2" blue="0.2"/></disk>
</element>
<element name="led0_s"> <text string="0"> <color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="led1_s"> <text string="1"> <color red="1.0" green="1.0" blue="1.0" /></text></element>
<element name="led2_s"> <text string="E"> <color red="1.0" green="1.0" blue="1.0" /></text></element>
<group name="panel">
<element ref="background"><bounds x="0" y="0" width="~scr0width~" height="64"/></element>
<repeat count="3">
<param name="left" start="20" increment="20" />
<param name="right" start="36" increment="20" />
<param name="num" start="0" increment="1" />
<element name="led~num~_s" ref="led~num~_s"><bounds left="~left~" right="~right~" top="8" bottom="24"/></element>
<element name="led~num~" ref="ledr"><bounds left="~left~" right="~right~" top="32" bottom="48"/></element>
</repeat>
</group>
<view name="HP9122C">
<screen index="0"><bounds x="0" y="0" width="~scr0width~" height="~scr0height~"/></screen>
<group ref="panel"><bounds x="0" y="~scr0height~" width="~scr0width~" height="64"/></group>
</view>
</mamelayout>
-129
View File
@@ -1,129 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<element name="e_led">
<disk state="0">
<color red="1.0" green="0.0" blue="0.0" />
</disk>
</element>
<element name="e_LAT">
<text string="LAT">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_NR">
<text string="NR">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_PCH">
<text string="PCH">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_DUP">
<text string="DUP">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_LIN">
<text string="LIN">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_RED">
<text string="RED">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_SDV">
<text string="SDV">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_PRD">
<text string="PRD">
<color red="1.0" green="1.0" blue="1.0" />
</text>
</element>
<element name="e_background">
<rect>
<bounds left="0" top="0" right="1" bottom="1" />
<color red="0.0" green="0.0" blue="0.5" />
</rect>
</element>
<view name="Keyboard LEDs">
<screen tag="screen">
<bounds x="0" y="0" width="800" height="550" />
</screen>
<!--
<element ref="e_background">
<bounds left="0" right="800" top="550" bottom="600" />
</element>
-->
<element name="lat_txt" ref="e_LAT">
<bounds left="0" right="100" top="550" bottom="570" />
</element>
<element name="lat_led" ref="e_led">
<bounds left="40" right="60" top="580" bottom="600" />
</element>
<element name="nr_txt" ref="e_NR">
<bounds left="100" right="200" top="550" bottom="570" />
</element>
<element name="nr_led" ref="e_led">
<bounds left="140" right="160" top="580" bottom="600" />
</element>
<element name="pch_txt" ref="e_PCH">
<bounds left="200" right="300" top="550" bottom="570" />
</element>
<element name="pch_led" ref="e_led">
<bounds left="240" right="260" top="580" bottom="600" />
</element>
<element name="dup_txt" ref="e_DUP">
<bounds left="300" right="400" top="550" bottom="570" />
</element>
<element name="dup_led" ref="e_led">
<bounds left="340" right="360" top="580" bottom="600" />
</element>
<element name="lin_txt" ref="e_LIN">
<bounds left="400" right="500" top="550" bottom="570" />
</element>
<element name="lin_led" ref="e_led">
<bounds left="440" right="460" top="580" bottom="600" />
</element>
<element name="red_txt" ref="e_RED">
<bounds left="500" right="600" top="550" bottom="570" />
</element>
<element name="red_led" ref="e_led">
<bounds left="540" right="560" top="580" bottom="600" />
</element>
<element name="sdv_txt" ref="e_SDV">
<bounds left="600" right="700" top="550" bottom="570" />
</element>
<element name="sdv_led" ref="e_led">
<bounds left="640" right="660" top="580" bottom="600" />
</element>
<element name="prd_txt" ref="e_PRD">
<bounds left="700" right="800" top="550" bottom="570" />
</element>
<element name="prd_led" ref="e_led">
<bounds left="740" right="760" top="580" bottom="600" />
</element>
</view>
</mamelayout>
-92
View File
@@ -1,92 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
copyright-holders:Dirk Best
-->
<mamelayout version="2">
<element name="background">
<rect>
<color red="0.1" green="0.1" blue="0.1" />
</rect>
</element>
<element name="power_led" defstate="1">
<rect state="0">
<color red="0" green="0.2" blue="0" />
</rect>
<rect state="1">
<color red="0" green="0.8" blue="0" />
</rect>
</element>
<element name="green_led" defstate="0">
<rect state="0">
<color red="0" green="0.2" blue="0" />
</rect>
<rect state="1">
<color red="0" green="0.8" blue="0" />
</rect>
</element>
<element name="red_led" defstate="0">
<rect state="0">
<color red="0.2" green="0" blue="0" />
</rect>
<rect state="1">
<color red="0.8" green="0" blue="0" />
</rect>
</element>
<element name="power_str" defstate="0">
<text string="POWER">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="25" height="4" />
</text>
</element>
<element name="ready_str" defstate="0">
<text string="READY">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="25" height="4" />
</text>
</element>
<element name="paperout_str" defstate="0">
<text string="PAPER OUT">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="35" height="4" />
</text>
</element>
<element name="online_str" defstate="0">
<text string="ONLINE">
<color red="1.0" green="1.0" blue="1.0" />
<bounds x="0" y="0" width="35" height="4" />
</text>
</element>
<view name="Control panel">
<element ref="background">
<bounds x="0" y="0" width="67" height="52" />
</element>
<element name="power_led" ref="power_led">
<bounds x="8" y="9" width="8" height="4" />
</element>
<element name="power_str" ref="power_str">
<bounds x="18" y="9" width="17" height="4" />
</element>
<element name="ready_led" ref="green_led">
<bounds x="8" y="20" width="8" height="4" />
</element>
<element name="ready_str" ref="ready_str">
<bounds x="18" y="20" width="17" height="4" />
</element>
<element name="paperout_led" ref="red_led">
<bounds x="8" y="31" width="8" height="4" />
</element>
<element name="paperout_str" ref="paperout_str">
<bounds x="18" y="31" width="25" height="4" />
</element>
<element name="online_led" ref="green_led">
<bounds x="8" y="42" width="8" height="4" />
</element>
<element name="online_str" ref="online_str">
<bounds x="18" y="42" width="18" height="4" />
</element>
</view>
</mamelayout>
-65
View File
@@ -1,65 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<view name="Quad Side-by-Side">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4.03" y="0" width="4" height="3" />
</screen>
<screen index="2">
<bounds x="8.06" y="0" width="4" height="3" />
</screen>
<screen index="3">
<bounds x="12.09" y="0" width="4" height="3" />
</screen>
</view>
<view name="Quad Side-by-Side (Gapless)">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4" y="0" width="4" height="3" />
</screen>
<screen index="2">
<bounds x="8" y="0" width="4" height="3" />
</screen>
<screen index="3">
<bounds x="12" y="0" width="4" height="3" />
</screen>
</view>
<view name="Quad 2 by 2">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4.03" y="0" width="4" height="3" />
</screen>
<screen index="2">
<bounds x="0" y="3.03" width="4" height="3" />
</screen>
<screen index="3">
<bounds x="4.03" y="3.03" width="4" height="3" />
</screen>
</view>
<view name="Quad 2 by 2 (Gapless)">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4" y="0" width="4" height="3" />
</screen>
<screen index="2">
<bounds x="0" y="3" width="4" height="3" />
</screen>
<screen index="3">
<bounds x="4" y="3" width="4" height="3" />
</screen>
</view>
</mamelayout>
-453
View File
@@ -1,453 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<!-- define elements -->
<element name="black2b"><rect><color red="0.12" green="0.11" blue="0.10" /></rect></element>
<element name="ledo">
<disk><color red="0.1" green="0.05" blue="0.07" /></disk>
</element>
<element name="ledr" defstate="0">
<disk state="1"> <color red="1" green="0" blue="0" /> </disk>
</element>
<element name="piece" defstate="0">
<image file="chess/wn.svg" state="1"/>
<image file="chess/wn.svg" state="2"/>
<image file="chess/bk.svg" state="3"/>
<image file="chess/wk.svg" state="4"/>
<image file="chess/bq.svg" state="5"/>
<image file="chess/wq.svg" state="6"/>
<image file="chess/br.svg" state="7"/>
<image file="chess/br.svg" state="8"/>
<image file="chess/wr.svg" state="9"/>
<image file="chess/wr.svg" state="10"/>
<image file="chess/bb.svg" state="11"/>
<image file="chess/bb.svg" state="12"/>
<image file="chess/wb.svg" state="13"/>
<image file="chess/wb.svg" state="14"/>
<image file="chess/bn.svg" state="15"/>
<image file="chess/bn.svg" state="16"/>
<image file="chess/wp.svg" state="17"/>
<image file="chess/wp.svg" state="18"/>
<image file="chess/wp.svg" state="19"/>
<image file="chess/wp.svg" state="20"/>
<image file="chess/wp.svg" state="21"/>
<image file="chess/wp.svg" state="22"/>
<image file="chess/wp.svg" state="23"/>
<image file="chess/wp.svg" state="24"/>
<image file="chess/bp.svg" state="25"/>
<image file="chess/bp.svg" state="26"/>
<image file="chess/bp.svg" state="27"/>
<image file="chess/bp.svg" state="28"/>
<image file="chess/bp.svg" state="29"/>
<image file="chess/bp.svg" state="30"/>
<image file="chess/bp.svg" state="31"/>
<image file="chess/bp.svg" state="32"/>
<!-- selected pieces -->
<image file="chess/wn.svg" state="33"><color alpha="0.5" /></image>
<image file="chess/wn.svg" state="34"><color alpha="0.5" /></image>
<image file="chess/bk.svg" state="35"><color alpha="0.5" /></image>
<image file="chess/wk.svg" state="36"><color alpha="0.5" /></image>
<image file="chess/bq.svg" state="37"><color alpha="0.5" /></image>
<image file="chess/wq.svg" state="38"><color alpha="0.5" /></image>
<image file="chess/br.svg" state="39"><color alpha="0.5" /></image>
<image file="chess/br.svg" state="40"><color alpha="0.5" /></image>
<image file="chess/wr.svg" state="41"><color alpha="0.5" /></image>
<image file="chess/wr.svg" state="42"><color alpha="0.5" /></image>
<image file="chess/bb.svg" state="43"><color alpha="0.5" /></image>
<image file="chess/bb.svg" state="44"><color alpha="0.5" /></image>
<image file="chess/wb.svg" state="45"><color alpha="0.5" /></image>
<image file="chess/wb.svg" state="46"><color alpha="0.5" /></image>
<image file="chess/bn.svg" state="47"><color alpha="0.5" /></image>
<image file="chess/bn.svg" state="48"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="49"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="50"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="51"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="52"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="53"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="54"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="55"><color alpha="0.5" /></image>
<image file="chess/wp.svg" state="56"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="57"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="58"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="59"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="60"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="61"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="62"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="63"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="64"><color alpha="0.5" /></image>
</element>
<element name="text_1"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="1"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_2"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="2"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_3"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="3"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_4"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="4"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_5"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="5"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_6"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="6"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_7"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="7"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_8"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="8"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_a"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="A"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_b"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="B"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_c"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="C"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_d"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="D"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_e"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="E"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_f"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="F"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_g"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="G"> <color red="1" green="1" blue="1" /></text> </element>
<element name="text_h"> <rect><color red="0.56" green="0.33" blue="0.12" /></rect> <text string="H"> <color red="1" green="1" blue="1" /></text> </element>
<!-- sb board -->
<element name="cblack"><rect><color red="0.56" green="0.33" blue="0.12" /></rect></element>
<element name="cwhite"><rect><color red="0.84" green="0.75" blue="0.50" /></rect></element>
<element name="hlbb" defstate="0">
<text string=" "><bounds x="0" y="0" width="1" height="1" /></text>
<disk state="1">
<bounds x="0.12" y="0.12" width="0.76" height="0.76" />
<color red="0" green="0" blue="0" />
</disk>
</element>
<group name="sb_board">
<bounds x="-3.5" y="-3.5" width="89" height="89" />
<element ref="cblack"><bounds x="-3.5" y="-3.5" width="89" height="89" /></element>
<element ref="black2b"><bounds x="0.5" y="0.5" width="81" height="81" /></element>
<!-- chessboard coords -->
<element ref="text_8"><bounds x="-2.3" y="5" width="2" height="2" /></element>
<element ref="text_7"><bounds x="-2.3" y="15" width="2" height="2" /></element>
<element ref="text_6"><bounds x="-2.3" y="25" width="2" height="2" /></element>
<element ref="text_5"><bounds x="-2.3" y="35" width="2" height="2" /></element>
<element ref="text_4"><bounds x="-2.3" y="45" width="2" height="2" /></element>
<element ref="text_3"><bounds x="-2.3" y="55" width="2" height="2" /></element>
<element ref="text_2"><bounds x="-2.3" y="65" width="2" height="2" /></element>
<element ref="text_1"><bounds x="-2.3" y="75" width="2" height="2" /></element>
<element ref="text_a"><bounds x="5" y="82.5" width="2" height="2" /></element>
<element ref="text_b"><bounds x="15" y="82.5" width="2" height="2" /></element>
<element ref="text_c"><bounds x="25" y="82.5" width="2" height="2" /></element>
<element ref="text_d"><bounds x="35" y="82.5" width="2" height="2" /></element>
<element ref="text_e"><bounds x="45" y="82.5" width="2" height="2" /></element>
<element ref="text_f"><bounds x="55" y="82.5" width="2" height="2" /></element>
<element ref="text_g"><bounds x="65" y="82.5" width="2" height="2" /></element>
<element ref="text_h"><bounds x="75" y="82.5" width="2" height="2" /></element>
<!-- squares (avoid seams) -->
<element ref="cwhite"><bounds x="1" y="1" width="11" height="11" /></element>
<element ref="cblack"><bounds x="11" y="1" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="21" y="1" width="11" height="11" /></element>
<element ref="cblack"><bounds x="31" y="1" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="41" y="1" width="11" height="11" /></element>
<element ref="cblack"><bounds x="51" y="1" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="61" y="1" width="11" height="11" /></element>
<element ref="cblack"><bounds x="71" y="1" width="10" height="11" /></element>
<element ref="cblack"><bounds x="1" y="11" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="11" y="11" width="11" height="11" /></element>
<element ref="cblack"><bounds x="21" y="11" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="31" y="11" width="11" height="11" /></element>
<element ref="cblack"><bounds x="41" y="11" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="51" y="11" width="11" height="11" /></element>
<element ref="cblack"><bounds x="61" y="11" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="71" y="11" width="10" height="11" /></element>
<element ref="cwhite"><bounds x="1" y="21" width="11" height="11" /></element>
<element ref="cblack"><bounds x="11" y="21" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="21" y="21" width="11" height="11" /></element>
<element ref="cblack"><bounds x="31" y="21" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="41" y="21" width="11" height="11" /></element>
<element ref="cblack"><bounds x="51" y="21" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="61" y="21" width="11" height="11" /></element>
<element ref="cblack"><bounds x="71" y="21" width="10" height="11" /></element>
<element ref="cblack"><bounds x="1" y="31" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="11" y="31" width="11" height="11" /></element>
<element ref="cblack"><bounds x="21" y="31" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="31" y="31" width="11" height="11" /></element>
<element ref="cblack"><bounds x="41" y="31" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="51" y="31" width="11" height="11" /></element>
<element ref="cblack"><bounds x="61" y="31" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="71" y="31" width="10" height="11" /></element>
<element ref="cwhite"><bounds x="1" y="41" width="11" height="11" /></element>
<element ref="cblack"><bounds x="11" y="41" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="21" y="41" width="11" height="11" /></element>
<element ref="cblack"><bounds x="31" y="41" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="41" y="41" width="11" height="11" /></element>
<element ref="cblack"><bounds x="51" y="41" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="61" y="41" width="11" height="11" /></element>
<element ref="cblack"><bounds x="71" y="41" width="10" height="11" /></element>
<element ref="cblack"><bounds x="1" y="51" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="11" y="51" width="11" height="11" /></element>
<element ref="cblack"><bounds x="21" y="51" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="31" y="51" width="11" height="11" /></element>
<element ref="cblack"><bounds x="41" y="51" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="51" y="51" width="11" height="11" /></element>
<element ref="cblack"><bounds x="61" y="51" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="71" y="51" width="10" height="11" /></element>
<element ref="cwhite"><bounds x="1" y="61" width="11" height="11" /></element>
<element ref="cblack"><bounds x="11" y="61" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="21" y="61" width="11" height="11" /></element>
<element ref="cblack"><bounds x="31" y="61" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="41" y="61" width="11" height="11" /></element>
<element ref="cblack"><bounds x="51" y="61" width="11" height="11" /></element>
<element ref="cwhite"><bounds x="61" y="61" width="11" height="11" /></element>
<element ref="cblack"><bounds x="71" y="61" width="10" height="11" /></element>
<element ref="cblack"><bounds x="1" y="71" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="11" y="71" width="11" height="10" /></element>
<element ref="cblack"><bounds x="21" y="71" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="31" y="71" width="11" height="10" /></element>
<element ref="cblack"><bounds x="41" y="71" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="51" y="71" width="11" height="10" /></element>
<element ref="cblack"><bounds x="61" y="71" width="11" height="10" /></element>
<element ref="cwhite"><bounds x="71" y="71" width="10" height="10" /></element>
<!-- sensors, pieces -->
<repeat count="8">
<param name="y" start="1" increment="10" />
<param name="i" start="8" increment="-1" />
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x01"><bounds x="1" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x02"><bounds x="11" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x04"><bounds x="21" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x08"><bounds x="31" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x10"><bounds x="41" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x20"><bounds x="51" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x40"><bounds x="61" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element ref="hlbb" inputtag="smartboard:board:RANK.~i~" inputmask="0x80"><bounds x="71" y="~y~" width="10" height="10" /><color alpha="0.04" /></element>
<element name="piece_a~i~" ref="piece"><bounds x="1" y="~y~" width="10" height="10" /></element>
<element name="piece_b~i~" ref="piece"><bounds x="11" y="~y~" width="10" height="10" /></element>
<element name="piece_c~i~" ref="piece"><bounds x="21" y="~y~" width="10" height="10" /></element>
<element name="piece_d~i~" ref="piece"><bounds x="31" y="~y~" width="10" height="10" /></element>
<element name="piece_e~i~" ref="piece"><bounds x="41" y="~y~" width="10" height="10" /></element>
<element name="piece_f~i~" ref="piece"><bounds x="51" y="~y~" width="10" height="10" /></element>
<element name="piece_g~i~" ref="piece"><bounds x="61" y="~y~" width="10" height="10" /></element>
<element name="piece_h~i~" ref="piece"><bounds x="71" y="~y~" width="10" height="10" /></element>
</repeat>
<!-- 81 LEDs from 64 outputs -->
<repeat count="9">
<param name="x" start="0.5" increment="10" />
<repeat count="9">
<param name="y" start="0.5" increment="10" />
<element ref="ledo"><bounds x="~x~" y="~y~" width="1" height="1" /></element>
</repeat>
</repeat>
<repeat count="8">
<param name="x" start="80.5" increment="-10" />
<param name="i" start="0" increment="1" />
<repeat count="8">
<param name="y" start="0.5" increment="10" />
<param name="j" start="0" increment="1" />
<element name="sb30_led_~j~.~i~" ref="ledr" blend="add"><bounds x="~x~" y="~y~" width="1" height="1" /></element>
</repeat>
<repeat count="8">
<param name="y" start="10.5" increment="10" />
<param name="j" start="0" increment="1" />
<element name="sb30_led_~j~.~i~" ref="ledr" blend="add"><bounds x="~x~" y="~y~" width="1" height="1" /></element>
</repeat>
</repeat>
<repeat count="8">
<param name="x" start="70.5" increment="-10" />
<param name="i" start="0" increment="1" />
<repeat count="8">
<param name="y" start="0.5" increment="10" />
<param name="j" start="0" increment="1" />
<element name="sb30_led_~j~.~i~" ref="ledr" blend="add"><bounds x="~x~" y="~y~" width="1" height="1" /></element>
</repeat>
<repeat count="8">
<param name="y" start="10.5" increment="10" />
<param name="j" start="0" increment="1" />
<element name="sb30_led_~j~.~i~" ref="ledr" blend="add"><bounds x="~x~" y="~y~" width="1" height="1" /></element>
</repeat>
</repeat>
</group>
<!-- sb ui -->
<element name="piece_ui" defstate="0">
<image file="chess/wp.svg" state="1"/>
<image file="chess/wn.svg" state="2"/>
<image file="chess/wb.svg" state="3"/>
<image file="chess/wr.svg" state="4"/>
<image file="chess/wq.svg" state="5"/>
<image file="chess/wk.svg" state="6"/>
<image file="chess/bp.svg" state="7"/>
<image file="chess/bn.svg" state="8"/>
<image file="chess/bb.svg" state="9"/>
<image file="chess/br.svg" state="10"/>
<image file="chess/bq.svg" state="11"/>
<image file="chess/bk.svg" state="12"/>
<!-- selected pieces -->
<image file="chess/wp.svg" state="13"><color alpha="0.5" /></image>
<image file="chess/wn.svg" state="14"><color alpha="0.5" /></image>
<image file="chess/wb.svg" state="15"><color alpha="0.5" /></image>
<image file="chess/wr.svg" state="16"><color alpha="0.5" /></image>
<image file="chess/wq.svg" state="17"><color alpha="0.5" /></image>
<image file="chess/wk.svg" state="18"><color alpha="0.5" /></image>
<image file="chess/bp.svg" state="19"><color alpha="0.5" /></image>
<image file="chess/bn.svg" state="20"><color alpha="0.5" /></image>
<image file="chess/bb.svg" state="21"><color alpha="0.5" /></image>
<image file="chess/br.svg" state="22"><color alpha="0.5" /></image>
<image file="chess/bq.svg" state="23"><color alpha="0.5" /></image>
<image file="chess/bk.svg" state="24"><color alpha="0.5" /></image>
</element>
<element name="hlub" defstate="0">
<rect state="1"><color red="0" green="0" blue="0" /></rect>
</element>
<element name="text_uit1"><text string="S.BOARD"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uit2"><text string="INTERFACE"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uib1"><text string="BOARD:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uib2">
<rect><color red="0.84" green="0.75" blue="0.50" /></rect>
<text string="RESET"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uib3">
<rect><color red="0.84" green="0.75" blue="0.50" /></rect>
<text string="CLEAR"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uis1"><text string="SPAWN:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uih1"><text string="HAND:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uih2">
<rect><color red="0.84" green="0.75" blue="0.50" /></rect>
<text string="REMOVE"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu1"><text string="UNDO:"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uiu2a">
<rect><color red="0.84" green="0.75" blue="0.50" /></rect>
<text string=" &lt;&lt;"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu2b">
<rect><color red="0.84" green="0.75" blue="0.50" /></rect>
<text string=" &lt; "><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu2c">
<rect><color red="0.84" green="0.75" blue="0.50" /></rect>
<text string=" &gt;"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu2d">
<rect><color red="0.84" green="0.75" blue="0.50" /></rect>
<text string=" &gt;&gt;"><color red="0.01" green="0.01" blue="0.01" /></text>
</element>
<element name="text_uiu3a" defstate="0">
<simplecounter maxstate="999" digits="1" align="2">
<color red="0.81" green="0.8" blue="0.79" />
</simplecounter>
</element>
<element name="text_uiu3b"><text string="/"><color red="0.81" green="0.8" blue="0.79" /></text></element>
<element name="text_uiu3c" defstate="0">
<simplecounter maxstate="999" digits="1" align="1">
<color red="0.81" green="0.8" blue="0.79" />
</simplecounter>
</element>
<group name="sb_ui">
<bounds x="0" y="0" width="10" height="80" />
<element ref="cblack"><bounds x="0" y="0" width="10" height="1" /></element>
<element ref="cblack"><bounds x="0" y="7" width="10" height="1" /></element>
<element ref="cblack"><bounds x="0" y="79" width="10" height="1" /></element>
<element ref="text_uit1"><bounds x="0" y="2" width="10" height="2" /></element>
<element ref="text_uit2"><bounds x="0" y="4" width="10" height="2" /></element>
<!-- board -->
<element ref="text_uib1"><bounds x="0" y="9" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="11.5" width="8" height="2.5" /></element>
<element ref="cwhite"><bounds x="1" y="15" width="8" height="2.5" /></element>
<element ref="text_uib2"><bounds x="1.5" y="11.75" width="7" height="2" /></element>
<element ref="text_uib3"><bounds x="1.5" y="15.25" width="7" height="2" /></element>
<element ref="hlub" inputtag="smartboard:board:UI" inputmask="0x200"><bounds x="1" y="11.5" width="8" height="2.5" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:UI" inputmask="0x100"><bounds x="1" y="15" width="8" height="2.5" /><color alpha="0.25" /></element>
<!-- spawn -->
<element ref="text_uis1"><bounds x="0" y="20.5" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="23" width="8" height="12" /></element>
<element ref="cwhite"><bounds x="1" y="36" width="8" height="12" /></element>
<element name="piece_ui1" ref="piece_ui"><bounds x="1" y="23" width="4" height="4" /></element>
<element name="piece_ui2" ref="piece_ui"><bounds x="1" y="27" width="4" height="4" /></element>
<element name="piece_ui3" ref="piece_ui"><bounds x="1" y="31" width="4" height="4" /></element>
<element name="piece_ui4" ref="piece_ui"><bounds x="5" y="23" width="4" height="4" /></element>
<element name="piece_ui5" ref="piece_ui"><bounds x="5" y="27" width="4" height="4" /></element>
<element name="piece_ui6" ref="piece_ui"><bounds x="5" y="31" width="4" height="4" /></element>
<element name="piece_ui7" ref="piece_ui"><bounds x="1" y="36" width="4" height="4" /></element>
<element name="piece_ui8" ref="piece_ui"><bounds x="1" y="40" width="4" height="4" /></element>
<element name="piece_ui9" ref="piece_ui"><bounds x="1" y="44" width="4" height="4" /></element>
<element name="piece_ui10" ref="piece_ui"><bounds x="5" y="36" width="4" height="4" /></element>
<element name="piece_ui11" ref="piece_ui"><bounds x="5" y="40" width="4" height="4" /></element>
<element name="piece_ui12" ref="piece_ui"><bounds x="5" y="44" width="4" height="4" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0001"><bounds x="1" y="23" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0002"><bounds x="1" y="27" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0004"><bounds x="1" y="31" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0008"><bounds x="5" y="23" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0010"><bounds x="5" y="27" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0020"><bounds x="5" y="31" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0040"><bounds x="1" y="36" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0080"><bounds x="1" y="40" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0100"><bounds x="1" y="44" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0200"><bounds x="5" y="36" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0400"><bounds x="5" y="40" width="4" height="4" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:SPAWN" inputmask="0x0800"><bounds x="5" y="44" width="4" height="4" /><color alpha="0.25" /></element>
<!-- hand -->
<element ref="text_uih1"><bounds x="0" y="51" width="10" height="2" /></element>
<element ref="cblack"><bounds x="1" y="53.5" width="8" height="6" /></element>
<element name="piece_ui0" ref="piece"><bounds x="2" y="53.5" width="6" height="6" /></element>
<element ref="cwhite"><bounds x="1" y="60.5" width="8" height="2.5" /></element>
<element ref="text_uih2"><bounds x="1.5" y="60.75" width="7" height="2" /></element>
<element ref="hlub" inputtag="smartboard:board:UI" inputmask="0x08"><bounds x="1" y="60.5" width="8" height="2.5" /><color alpha="0.25" /></element>
<!-- undo -->
<element ref="text_uiu1"><bounds x="0" y="66" width="10" height="2" /></element>
<element ref="cwhite"><bounds x="1" y="68.5" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="3.1" y="68.5" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="5.2" y="68.5" width="1.7" height="6" /></element>
<element ref="cwhite"><bounds x="7.3" y="68.5" width="1.7" height="6" /></element>
<element ref="text_uiu2a"><bounds x="1" y="69.5" width="1.7" height="4" /></element>
<element ref="text_uiu2b"><bounds x="3.1" y="69.5" width="1.7" height="4" /></element>
<element ref="text_uiu2c"><bounds x="5.2" y="69.5" width="1.7" height="4" /></element>
<element ref="text_uiu2d"><bounds x="7.3" y="69.5" width="1.7" height="4" /></element>
<element ref="hlub" inputtag="smartboard:board:UI" inputmask="0x10"><bounds x="1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:UI" inputmask="0x20"><bounds x="3.1" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:UI" inputmask="0x40"><bounds x="5.2" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element ref="hlub" inputtag="smartboard:board:UI" inputmask="0x80"><bounds x="7.3" y="68.5" width="1.7" height="6" /><color alpha="0.25" /></element>
<element name="count_ui0" ref="text_uiu3a"><bounds x="0" y="75" width="4" height="2" /></element>
<element name="count_ui1" ref="text_uiu3c"><bounds x="6" y="75" width="4" height="2" /></element>
<element ref="text_uiu3b"><bounds x="4" y="75" width="2" height="2" /></element>
</group>
<!-- build screen -->
<view name="Internal Layout">
<bounds left="0" right="100.8" top="0" bottom="88.8" />
<group ref="sb_board"><bounds x="12" y="0" width="88.8" height="88.8" /></group>
<group ref="sb_ui"><bounds x="1" y="4.4" width="10" height="80" /></group>
</view>
</mamelayout>
-29
View File
@@ -1,29 +0,0 @@
<?xml version="1.0"?>
<!--
license:CC0
-->
<mamelayout version="2">
<view name="Triple Side-by-Side">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4.03" y="0" width="4" height="3" />
</screen>
<screen index="2">
<bounds x="8.06" y="0" width="4" height="3" />
</screen>
</view>
<view name="Triple Side-by-Side (Gapless)">
<screen index="0">
<bounds x="0" y="0" width="4" height="3" />
</screen>
<screen index="1">
<bounds x="4" y="0" width="4" height="3" />
</screen>
<screen index="2">
<bounds x="8" y="0" width="4" height="3" />
</screen>
</view>
</mamelayout>
-11
View File
@@ -58,17 +58,6 @@
// screenless layouts
#include "noscreens.lh"
// dual screen layouts
#include "dualhsxs.lh"
#include "dualhovu.lh"
#include "dualhuov.lh"
// triple screen layouts
#include "triphsxs.lh"
// quad screen layouts
#include "quadhsxs.lh"
namespace {
-35
View File
@@ -13,7 +13,6 @@
#include "mameopts.h"
#include "machine/ram.h"
#include "sound/samples.h"
#include "config.h"
@@ -126,7 +125,6 @@ void output_features(std::ostream &out, device_type type, device_t::feature_type
void output_images(std::ostream &out, device_t &device, const char *root_tag);
void output_slots(std::ostream &out, machine_config &config, device_t &device, const char *root_tag, device_type_set *devtypes);
void output_software_lists(std::ostream &out, device_t &root, const char *root_tag);
void output_ramoptions(std::ostream &out, device_t &root);
void output_one_device(std::ostream &out, machine_config &config, device_t &device, const char *devtag);
void output_devices(std::ostream &out, emu_options &lookup_options, device_type_set const *filter);
@@ -795,7 +793,6 @@ void output_one(std::ostream &out, driver_enumerator &drivlist, const game_drive
output_images(out, config.root_device(), "");
output_slots(out, config, config.root_device(), "", devtypes);
output_software_lists(out, config.root_device(), "");
output_ramoptions(out, config.root_device());
// close the topmost tag
util::stream_format(out, "\t</%s>\n", XML_TOP);
@@ -2130,38 +2127,6 @@ void output_software_lists(std::ostream &out, device_t &root, const char *root_t
//-------------------------------------------------
// output_ramoptions - prints m_output all RAM
// options for this system
//-------------------------------------------------
void output_ramoptions(std::ostream &out, device_t &root)
{
for (const ram_device &ram : ram_device_enumerator(root, 1))
{
if (!std::strcmp(ram.tag(), ":" RAM_TAG))
{
uint32_t const defsize(ram.default_size());
bool havedefault(false);
for (ram_device::extra_option const &option : ram.extra_options())
{
if (defsize == option.second)
{
assert(!havedefault);
havedefault = true;
util::stream_format(out, "\t\t<ramoption name=\"%s\" default=\"yes\">%u</ramoption>\n", normalize_string(option.first), option.second);
}
else
{
util::stream_format(out, "\t\t<ramoption name=\"%s\">%u</ramoption>\n", normalize_string(option.first), option.second);
}
}
if (!havedefault)
util::stream_format(out, "\t\t<ramoption name=\"%s\" default=\"yes\">%u</ramoption>\n", ram.default_size_string(), defsize);
break;
}
}
}
//-------------------------------------------------
-146
View File
@@ -1,146 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***************************************************************************
ui/barcode.cpp
"Barcode Reader" control
***************************************************************************/
#include "emu.h"
#include "ui/barcode.h"
#include "ui/ui.h"
#include "ui/utils.h"
namespace ui {
// itemrefs for key menu items
#define ITEMREF_NEW_BARCODE ((void *) 0x0001)
#define ITEMREF_ENTER_BARCODE ((void *) 0x0002)
#define ITEMREF_SELECT_READER ((void *) 0x0003)
/**************************************************
BARCODE READER MENU
**************************************************/
//-------------------------------------------------
// ctor
//-------------------------------------------------
menu_barcode_reader::menu_barcode_reader(mame_ui_manager &mui, render_container &container, barcode_reader_device *device)
: menu_device_control<barcode_reader_device>(mui, container, device)
{
set_process_flags(PROCESS_LR_REPEAT);
}
//-------------------------------------------------
// dtor
//-------------------------------------------------
menu_barcode_reader::~menu_barcode_reader()
{
}
//-------------------------------------------------
// populate - populates the barcode input menu
//-------------------------------------------------
void menu_barcode_reader::populate(float &customtop, float &custombottom)
{
if (current_device())
{
std::string buffer;
const char *new_barcode;
// selected device
item_append(current_display_name(), current_display_flags(), ITEMREF_SELECT_READER);
// append the "New Barcode" item
if (get_selection_ref() == ITEMREF_NEW_BARCODE)
{
buffer.append(m_barcode_buffer);
new_barcode = buffer.c_str();
}
else
{
new_barcode = m_barcode_buffer.c_str();
}
item_append(_("New Barcode:"), new_barcode, 0, ITEMREF_NEW_BARCODE);
// finish up the menu
item_append(_("Enter Code"), 0, ITEMREF_ENTER_BARCODE);
item_append(menu_item_type::SEPARATOR);
customtop = ui().get_line_height() + 3.0f * ui().box_tb_border();
}
}
//-------------------------------------------------
// handle - manages inputs in the barcode input menu
//-------------------------------------------------
void menu_barcode_reader::handle(event const *ev)
{
// process the event
if (ev)
{
// handle selections
switch (ev->iptkey)
{
case IPT_UI_LEFT:
if (ev->itemref == ITEMREF_SELECT_READER)
previous();
break;
case IPT_UI_RIGHT:
if (ev->itemref == ITEMREF_SELECT_READER)
next();
break;
case IPT_UI_SELECT:
if (ev->itemref == ITEMREF_ENTER_BARCODE)
{
std::string tmp_file(m_barcode_buffer);
//printf("code %s\n", m_barcode_buffer);
if (!current_device()->is_valid(tmp_file.length()))
ui().popup_time(5, "%s", _("Barcode length invalid!"));
else
{
current_device()->write_code(tmp_file.c_str(), tmp_file.length());
// if sending was successful, reset char buffer
m_barcode_buffer.clear();
reset(reset_options::REMEMBER_POSITION);
}
}
break;
case IPT_UI_CLEAR:
if (get_selection_ref() == ITEMREF_NEW_BARCODE)
{
m_barcode_buffer.clear();
reset(reset_options::REMEMBER_POSITION);
}
break;
case IPT_SPECIAL:
if (get_selection_ref() == ITEMREF_NEW_BARCODE)
{
if (input_character(m_barcode_buffer, ev->unichar, uchar_is_digit))
reset(reset_options::REMEMBER_POSITION);
}
break;
}
}
}
} // namespace ui
-35
View File
@@ -1,35 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
/***************************************************************************
ui/barcode.h
"Barcode Reader" control
***************************************************************************/
#ifndef MAME_FRONTEND_UI_BARCODE_H
#define MAME_FRONTEND_UI_BARCODE_H
#pragma once
#include "machine/bcreader.h"
#include "ui/devctrl.h"
namespace ui {
class menu_barcode_reader : public menu_device_control<barcode_reader_device> {
public:
menu_barcode_reader(mame_ui_manager &mui, render_container &container, barcode_reader_device *device);
virtual ~menu_barcode_reader() override;
private:
virtual void populate(float &customtop, float &custombottom) override;
virtual void handle(event const *ev) override;
std::string m_barcode_buffer;
};
} // namespace ui
#endif // MAME_FRONTEND_UI_BARCODE_H
-9
View File
@@ -13,7 +13,6 @@
#include "ui/about.h"
#include "ui/analogipt.h"
#include "ui/barcode.h"
#include "ui/cheatopt.h"
#include "ui/confswitch.h"
#include "ui/datmenu.h"
@@ -34,7 +33,6 @@
#include "mame.h"
#include "luaengine.h"
#include "machine/bcreader.h"
#include "crsshair.h"
#include "dipty.h"
@@ -66,7 +64,6 @@ enum : unsigned {
CHEAT,
PLUGINS,
BIOS_SELECTION,
BARCODE_READ,
PTY_INFO,
EXTERNAL_DATS,
ADD_FAVORITE,
@@ -155,8 +152,6 @@ void menu_main::populate(float &customtop, float &custombottom)
if (slot_interface_enumerator(machine().root_device()).first() != nullptr)
item_append(_("Slot Devices"), 0, (void *)SLOT_DEVICES);
if (barcode_reader_device_enumerator(machine().root_device()).first() != nullptr)
item_append(_("Barcode Reader"), 0, (void *)BARCODE_READ);
if (network_interface_enumerator(machine().root_device()).first() != nullptr)
item_append(_("Network Devices"), 0, (void*)NETWORK_DEVICES);
@@ -316,10 +311,6 @@ void menu_main::handle(event const *ev)
menu::stack_push<menu_bios_selection>(ui(), container());
break;
case BARCODE_READ:
menu::stack_push<menu_barcode_reader>(ui(), container(), nullptr);
break;
case EXTERNAL_DATS:
menu::stack_push<menu_dats_view>(ui(), container());
break;
-409
View File
@@ -1,409 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
vbiparse.c
Parse Philips codes and other data from VBI lines.
***************************************************************************/
#include "vbiparse.h"
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
/***************************************************************************
DEBUGGING
***************************************************************************/
#define PRINTF_WHITE_FLAG 0
/***************************************************************************
CONSTANTS
***************************************************************************/
#define MAX_SOURCE_WIDTH 1024
#define MAX_CLOCK_DIFF 3
/***************************************************************************
IMPLEMENTATION
***************************************************************************/
/*-------------------------------------------------
vbi_parse_manchester_code - parse a Manchester
code from a line of video data
-------------------------------------------------*/
int vbi_parse_manchester_code(const uint16_t *source, int sourcewidth, int sourceshift, int expectedbits, uint32_t *result)
{
uint8_t srcabs[MAX_SOURCE_WIDTH];
uint8_t min, max, mid, srcabsval;
double clock, bestclock;
int x, firstedge;
int besterr;
/* fail if the width is too large */
if (sourcewidth > MAX_SOURCE_WIDTH)
return 0;
/* find highs and lows in the line */
min = 0xff;
max = 0x00;
for (x = 0; x < sourcewidth; x++)
{
uint8_t rawsrc = source[x] >> sourceshift;
min = std::min(min, rawsrc);
max = std::max(max, rawsrc);
}
/* bail if the line is all black or all white */
if (max < 0x80 || min > 0x80)
return 0;
/* determine the midpoint and then set the thresholds to be halfway */
mid = (min + max) / 2;
min = mid - (mid - min) / 2;
max = mid + (max - mid) / 2;
/* convert the source into absolute high/low */
srcabsval = (source[0] > mid);
for (x = 0; x < sourcewidth; x++)
{
uint8_t rawsrc = source[x] >> sourceshift;
if (rawsrc >= max)
srcabsval = 1;
else if (rawsrc <= min)
srcabsval = 0;
srcabs[x] = srcabsval;
}
/* find the first transition; this is assumed to be the middle of the first bit */
for (x = 0; x < sourcewidth - 1; x++)
if (srcabs[x] != srcabs[x + 1])
break;
if (x == sourcewidth - 1)
return 0;
firstedge = x;
/* now scan to find a clock that has a nearby transition on each beat */
bestclock = 0;
besterr = 1000;
for (clock = (double)sourcewidth / (double)expectedbits; clock >= 2.0; clock -= 1.0 / (double)expectedbits)
{
int error = 0;
/* scan for all the expected bits */
for (x = 1; x < expectedbits; x++)
{
int curbit = firstedge + (double)x * clock;
int offby;
/* look for a match that is off by an amount up to the maximum */
for (offby = 0; offby <= MAX_CLOCK_DIFF; offby++)
if (srcabs[curbit + offby + 0] != srcabs[curbit + offby + 1] || srcabs[curbit - offby + 0] != srcabs[curbit - offby + 1])
break;
/* if we never found the edge, fail immediately */
if (offby > MAX_CLOCK_DIFF)
break;
/* only continue if we're still in the running */
error += offby;
if (error >= besterr)
break;
}
/* if we got to the end, this is the best candidate so far */
if (x == expectedbits)
{
besterr = error;
bestclock = clock;
}
}
/* if nobody matched, fail */
if (bestclock == 0)
return 0;
/* now extract the bits */
for (x = 0; x < expectedbits; x++)
{
int leftstart = firstedge + ceil(((double)x - 0.5) * bestclock);
// int leftmid = firstedge + ((double)x - 0.25) * bestclock;
int leftend = firstedge + floor(((double)x - 0.0) * bestclock);
int rightstart = firstedge + ceil(((double)x + 0.0) * bestclock);
// int rightmid = firstedge + ((double)x + 0.25) * bestclock;
int rightend = firstedge + floor(((double)x + 0.5) * bestclock);
int leftavg, rightavg, leftabs, rightabs;
int confidence = 0;
int tx;
/* compute left and right average values */
leftavg = 0;
for (tx = leftstart; tx <= leftend; tx++)
leftavg += (uint8_t)(source[tx] >> sourceshift) - mid;
leftabs = (leftavg >= 0);
leftavg = (leftavg < 0) ? -leftavg : leftavg;
rightavg = 0;
for (tx = rightstart; tx <= rightend; tx++)
rightavg += (uint8_t)(source[tx] >> sourceshift) - mid;
rightabs = (rightavg >= 0);
rightavg = (rightavg < 0) ? -rightavg : rightavg;
/* all bits should be marked by transitions; fail if we don't get one */
if (leftabs == rightabs)
return 0;
/* store the bit and its confidence level */
confidence = leftavg + rightavg;
result[x] = (leftabs < rightabs) | (confidence << 1);
}
return expectedbits;
}
/*-------------------------------------------------
vbi_parse_white_flag - compute the "white
flag" from a line of video data
-------------------------------------------------*/
bool vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift)
{
int histo[256] = { 0 };
int minval = 0xff;
int maxval = 0x00;
int subtract;
int peakval;
int result;
int x;
/* compute a histogram of values */
for (x = 0; x < sourcewidth; x++)
{
uint8_t yval = source[x] >> sourceshift;
histo[yval]++;
}
/* remove the lowest 1% of the values to account for noise and determine the minimum */
subtract = sourcewidth / 100;
for (minval = 0; minval < 255; minval++)
if ((subtract -= histo[minval]) < 0)
break;
/* remove the highest 1% of the values to account for noise and determine the maximum */
subtract = sourcewidth / 100;
for (maxval = 255; maxval > 0; maxval--)
if ((subtract -= histo[maxval]) < 0)
break;
/* this is useful for debugging issues with white flag detection */
if (PRINTF_WHITE_FLAG)
{
printf("Histo: min=%02X max=%02X\n", minval, maxval);
for (x = 0; x < 256; x++)
if (histo[x] != 0) printf("%dx%02X\n", histo[x], x);
}
/* ignore if we have no dynamic range */
if (maxval - minval < 10)
{
if (PRINTF_WHITE_FLAG)
printf("White flag NOT detected; threshold too low\n");
return false;
}
/*
At this point, there are two approaches that have been tried:
1. Find the peak value and call it white if the peak is above
the 90% line
2. Ignore the first and last 20% of the line and count how
many pixels are above some threshold (75% line was used).
Call it white if at least 80% of the pixels are above
the threshold.
Both approaches agree 99% of the time, but the first tends to
be more correct when there is a discrepancy.
*/
/* determine where the peak is */
peakval = 0;
for (x = 1; x < 256; x++)
if (histo[x] > histo[peakval])
peakval = x;
/* return true if it is above the 90% mark */
result = (peakval > minval + 9 * (maxval - minval) / 10);
if (PRINTF_WHITE_FLAG)
printf("White flag %s: peak=%02X thresh=%02X\n", result ? "detected" : "NOT detected", peakval, minval + 9 * (maxval - minval) / 10);
return result;
#ifdef UNUSED_CODE
{
int above = 0;
int thresh;
/* alternate approach: */
/* ignore the first 1/5 and last 1/5 of the line for the remaining computations */
source += sourcewidth / 5;
sourcewidth -= 2 * (sourcewidth / 5);
/* count how many values were above the 75% mark of the range */
thresh = minval + 3 * (maxval - minval) / 4;
for (x = 0; x < sourcewidth; x++)
{
uint8_t yval = source[x] >> sourceshift;
above += (yval >= thresh);
}
/* if at least 80% of the pixels are above the threshold, we'll call it white */
return ((above * 100) / sourcewidth >= 80);
}
#endif
}
/*-------------------------------------------------
vbi_parse_all - parse everything from a video
frame
-------------------------------------------------*/
/**
* @fn void vbi_parse_all(const uint16_t *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi)
*
* @brief Vbi parse all.
*
* @param source Source for the.
* @param sourcerowpixels The sourcerowpixels.
* @param sourcewidth The sourcewidth.
* @param sourceshift The sourceshift.
* @param [in,out] vbi If non-null, the vbi.
*/
void vbi_parse_all(const uint16_t *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi)
{
uint32_t bits[2][24];
uint8_t bitnum;
/* first reset it all */
memset(vbi, 0, sizeof(*vbi));
/* get the white flag */
vbi->white = vbi_parse_white_flag(source + 11 * sourcerowpixels, sourcewidth, sourceshift);
/* parse line 16 */
if (vbi_parse_manchester_code(source + 16 * sourcerowpixels, sourcewidth, sourceshift, 24, bits[0]) == 24)
for (bitnum = 0; bitnum < 24; bitnum++)
vbi->line16 = (vbi->line16 << 1) | (bits[0][bitnum] & 1);
/* parse line 17 */
if (vbi_parse_manchester_code(source + 17 * sourcerowpixels, sourcewidth, sourceshift, 24, bits[0]) == 24)
for (bitnum = 0; bitnum < 24; bitnum++)
vbi->line17 = (vbi->line17 << 1) | (bits[0][bitnum] & 1);
/* parse line 18 */
if (vbi_parse_manchester_code(source + 18 * sourcerowpixels, sourcewidth, sourceshift, 24, bits[1]) == 24)
for (bitnum = 0; bitnum < 24; bitnum++)
vbi->line18 = (vbi->line18 << 1) | (bits[1][bitnum] & 1);
/* pick the best out of lines 17/18 */
/* if we only got one or the other, that's all we have */
if (vbi->line17 == 0)
vbi->line1718 = vbi->line18;
else if (vbi->line18 == 0)
vbi->line1718 = vbi->line17;
/* if they agree, we're golden */
else if (vbi->line17 == vbi->line18)
vbi->line1718 = vbi->line17;
/* if they don't agree, we have to pick one */
else
{
/* if both are frame numbers, and one is not valid BCD, pick the other */
if ((vbi->line17 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE && (vbi->line18 & VBI_MASK_CAV_PICTURE) == VBI_CODE_CAV_PICTURE)
{
if ((vbi->line17 & 0xf000) > 0x9000 || (vbi->line17 & 0xf00) > 0x900 || (vbi->line17 & 0xf0) > 0x90 || (vbi->line17 & 0xf) > 0x9)
vbi->line1718 = vbi->line18;
else if ((vbi->line18 & 0xf000) > 0x9000 || (vbi->line18 & 0xf00) > 0x900 || (vbi->line18 & 0xf0) > 0x90 || (vbi->line18 & 0xf) > 0x9)
vbi->line1718 = vbi->line17;
}
/* if still nothing, then scan through the bits and pick the ones with the most confidence */
if (vbi->line1718 == 0)
for (bitnum = 0; bitnum < 24; bitnum++)
vbi->line1718 = (vbi->line1718 << 1) | ((bits[0][bitnum] > bits[1][bitnum]) ? (bits[0][bitnum] & 1) : (bits[1][bitnum] & 1));
}
}
/*-------------------------------------------------
vbi_metadata_pack - pack the VBI data down
into a smaller form for storage
-------------------------------------------------*/
/**
* @fn void vbi_metadata_pack(uint8_t *dest, uint32_t framenum, const vbi_metadata *vbi)
*
* @brief Vbi metadata pack.
*
* @param [in,out] dest If non-null, destination for the.
* @param framenum The framenum.
* @param vbi The vbi.
*/
void vbi_metadata_pack(uint8_t *dest, uint32_t framenum, const vbi_metadata *vbi)
{
dest[0] = framenum >> 16;
dest[1] = framenum >> 8;
dest[2] = framenum >> 0;
dest[3] = vbi->white;
dest[4] = vbi->line16 >> 16;
dest[5] = vbi->line16 >> 8;
dest[6] = vbi->line16 >> 0;
dest[7] = vbi->line17 >> 16;
dest[8] = vbi->line17 >> 8;
dest[9] = vbi->line17 >> 0;
dest[10] = vbi->line18 >> 16;
dest[11] = vbi->line18 >> 8;
dest[12] = vbi->line18 >> 0;
dest[13] = vbi->line1718 >> 16;
dest[14] = vbi->line1718 >> 8;
dest[15] = vbi->line1718 >> 0;
}
/*-------------------------------------------------
vbi_metadata_unpack - unpack the VBI data
from a smaller form into the full structure
-------------------------------------------------*/
/**
* @fn void vbi_metadata_unpack(vbi_metadata *vbi, uint32_t *framenum, const uint8_t *source)
*
* @brief Vbi metadata unpack.
*
* @param [in,out] vbi If non-null, the vbi.
* @param [in,out] framenum If non-null, the framenum.
* @param source Source for the.
*/
void vbi_metadata_unpack(vbi_metadata *vbi, uint32_t *framenum, const uint8_t *source)
{
if (framenum != nullptr)
*framenum = (source[0] << 16) | (source[1] << 8) | source[2];
vbi->white = source[3];
vbi->line16 = (source[4] << 16) | (source[5] << 8) | source[6];
vbi->line17 = (source[7] << 16) | (source[8] << 8) | source[9];
vbi->line18 = (source[10] << 16) | (source[11] << 8) | source[12];
vbi->line1718 = (source[13] << 16) | (source[14] << 8) | source[15];
}
-93
View File
@@ -1,93 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
vbiparse.h
Parse Philips codes and other data from VBI lines.
***************************************************************************/
#ifndef MAME_UTIL_VBIPARSE_H
#define MAME_UTIL_VBIPARSE_H
#pragma once
#include <cstdint>
/***************************************************************************
CONSTANTS
***************************************************************************/
/* size of packed VBI data */
#define VBI_PACKED_BYTES 16
/* these codes are full 24-bit codes with no parameter data */
#define VBI_CODE_LEADIN 0x88ffff
#define VBI_CODE_LEADOUT 0x80eeee
#define VBI_CODE_STOP 0x82cfff
#define VBI_CODE_CLV 0x87ffff
/* these codes require a mask because some bits are parameters */
#define VBI_MASK_CAV_PICTURE 0xf00000
#define VBI_CODE_CAV_PICTURE 0xf00000
#define VBI_MASK_CHAPTER 0xf00fff
#define VBI_CODE_CHAPTER 0x800ddd
#define VBI_MASK_CLV_TIME 0xf0ff00
#define VBI_CODE_CLV_TIME 0xf0dd00
#define VBI_MASK_STATUS_CX_ON 0xfff000
#define VBI_CODE_STATUS_CX_ON 0x8dc000
#define VBI_MASK_STATUS_CX_OFF 0xfff000
#define VBI_CODE_STATUS_CX_OFF 0x8bc000
#define VBI_MASK_USER 0xf0f000
#define VBI_CODE_USER 0x80d000
#define VBI_MASK_CLV_PICTURE 0xf0f000
#define VBI_CODE_CLV_PICTURE 0x80e000
/***************************************************************************
MACROS
***************************************************************************/
#define VBI_CAV_PICTURE(x) (((((x) >> 16) & 0x07) * 10000) + ((((x) >> 12) & 0x0f) * 1000) + ((((x) >> 8) & 0x0f) * 100) + ((((x) >> 4) & 0x0f) * 10) + ((((x) >> 0) & 0x0f) * 1))
#define VBI_CHAPTER(x) (((((x) >> 16) & 0x07) * 10) + ((((x) >> 12) & 0x0f) * 1))
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
struct vbi_metadata
{
uint8_t white; /* white flag: on or off */
uint32_t line16; /* line 16 code */
uint32_t line17; /* line 17 code */
uint32_t line18; /* line 18 code */
uint32_t line1718; /* most plausible value from lines 17/18 */
};
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
/* parse a Manchester code from a line of video data */
int vbi_parse_manchester_code(const uint16_t *source, int sourcewidth, int sourceshift, int expectedbits, uint32_t *result);
/* compute the "white flag" from a line of video data */
bool vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift);
/* parse everything from a video frame */
void vbi_parse_all(const uint16_t *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi);
/* pack the VBI data down into a smaller form for storage */
void vbi_metadata_pack(uint8_t *dest, uint32_t framenum, const vbi_metadata *vbi);
/* unpack the VBI data from a smaller form into the full structure */
void vbi_metadata_unpack(vbi_metadata *vbi, uint32_t *framenum, const uint8_t *source);
#endif // MAME_UTIL_VBIPARSE_H
-1
View File
@@ -53,7 +53,6 @@ TODO:
#include "cpu/m6805/m6805.h"
#include "imagedev/chd_cd.h"
#include "machine/timekpr.h"
#include "sound/cdda.h"
#include "emupal.h"
#include "screen.h"
-1
View File
@@ -9,7 +9,6 @@
#include "machine/cdicdic.h"
#include "sound/dmadac.h"
#include "video/mcd212.h"
#include "cpu/mcs51/mcs51.h"
#include "cpu/m6805/m68hc05.h"
#include "diserial.h"
#include "screen.h"
-1
View File
@@ -26,7 +26,6 @@ TODO:
#include "cdrom.h"
#include "romload.h"
#include "sound/cdda.h"
#define LOG_DECODES (1 << 1)
#define LOG_SAMPLES (1 << 2)
-1
View File
@@ -28,7 +28,6 @@ TODO:
#include "imagedev/chd_cd.h"
#include "machine/scc68070.h"
#include "sound/cdda.h"
#include "sound/dmadac.h"
#include "cdrom.h"