Skip to content

Commit

Permalink
also output alpha segments to virtual/export DMD (e.g. get_RawDmdPixels)
Browse files Browse the repository at this point in the history
  • Loading branch information
toxieainc committed Nov 25, 2023
1 parent 4212892 commit 3546d5a
Show file tree
Hide file tree
Showing 8 changed files with 218 additions and 101 deletions.
44 changes: 22 additions & 22 deletions ext/dmddevice/usbalphanumeric.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UINT8 AlphaNumericFrameBuffer[2048] = {};
static UINT8 AlphaNumericFrameBuffer[2048] = {0};

static const UINT8 segSizes[8][16] = {
{5,5,5,5,5,5,2,2,5,5,5,2,5,5,5,1},
Expand Down Expand Up @@ -166,7 +166,7 @@ static const UINT8 segs[8][17][5][2] = {
//* In:
//* Out:
//*****************************************************
UINT8 getPixel(const int x, const int y)
static UINT8 getPixel(const int x, const int y)
{
const int v = (y*16)+(x/8);
const int z = 1<<(x%8);
Expand All @@ -181,7 +181,7 @@ UINT8 getPixel(const int x, const int y)
//* In:
//* Out:
//*****************************************************
void drawPixel(const int x, const int y, const UINT8 colour)
static void drawPixel(const int x, const int y, const UINT8 colour)
{
const int v = (y*16)+(x/8);
const int z = 1<<(x%8);
Expand Down Expand Up @@ -220,7 +220,7 @@ void drawPixel(const int x, const int y, const UINT8 colour)
//* In:
//* Out:
//*****************************************************
void drawSegment(const int x, const int y, const UINT8 type, const UINT16 seg, const UINT8 colour)
static void drawSegment(const int x, const int y, const UINT8 type, const UINT16 seg, const UINT8 colour)
{
for (int i = 0; i<segSizes[type][seg]; i++)
drawPixel(segs[type][seg][i][0] + x, segs[type][seg][i][1] + y, colour);
Expand All @@ -232,7 +232,7 @@ void drawSegment(const int x, const int y, const UINT8 type, const UINT16 seg, c
//* In:
//* Out:
//*****************************************************
void smoothDigitCorners(const int x, const int y) {
static void smoothDigitCorners(const int x, const int y) {
// remove corner pixel (round font corners)
if(getPixel(x,1+y) && getPixel(1+x,y))
drawPixel(0+x,y,0);
Expand All @@ -244,7 +244,7 @@ void smoothDigitCorners(const int x, const int y) {
drawPixel(6+x,10+y,0);
}

void smoothDigitCorners6Px(const int x, const int y) {
static void smoothDigitCorners6Px(const int x, const int y) {
if (getPixel(x,1+y) && getPixel(1+x,y))
drawPixel(0+x,y,0);
if (getPixel(x+4,1+y) && getPixel(3+x,y))
Expand All @@ -261,7 +261,7 @@ void smoothDigitCorners6Px(const int x, const int y) {
//* In:
//* Out:
//*****************************************************
void _2x16Alpha(const UINT16 *const seg_data)
static void _2x16Alpha(const UINT16 *const seg_data)
{
for (int i=0; i<16; i++) {
for (int j=0; j<16; j++) {
Expand All @@ -281,7 +281,7 @@ void _2x16Alpha(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x20Alpha(const UINT16 *const seg_data)
static void _2x20Alpha(const UINT16 *const seg_data)
{
for (int i=0; i<20; i++) {
for (int j=0; j<16; j++) {
Expand All @@ -302,7 +302,7 @@ void _2x20Alpha(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x7Alpha_2x7Num(const UINT16 *const seg_data)
static void _2x7Alpha_2x7Num(const UINT16 *const seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand All @@ -326,7 +326,7 @@ void _2x7Alpha_2x7Num(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x7Alpha_2x7Num_4x1Num(const UINT16 *const seg_data)
static void _2x7Alpha_2x7Num_4x1Num(const UINT16 *const seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -361,7 +361,7 @@ void _2x7Alpha_2x7Num_4x1Num(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x6Num_2x6Num_4x1Num(const UINT16 *const seg_data)
static void _2x6Num_2x6Num_4x1Num(const UINT16 *const seg_data)
{
for (int i=0; i<12; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -396,7 +396,7 @@ void _2x6Num_2x6Num_4x1Num(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x6Num10_2x6Num10_4x1Num(const UINT16 *const seg_data)
static void _2x6Num10_2x6Num10_4x1Num(const UINT16 *const seg_data)
{
for (int i=0; i<12; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -431,7 +431,7 @@ void _2x6Num10_2x6Num10_4x1Num(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x7Num_2x7Num_4x1Num(const UINT16 *const seg_data)
static void _2x7Num_2x7Num_4x1Num(const UINT16 *const seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -466,7 +466,7 @@ void _2x7Num_2x7Num_4x1Num(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x7Num_2x7Num_10x1Num(const UINT16 *const seg_data, const UINT16 *const extra_seg_data)
static void _2x7Num_2x7Num_10x1Num(const UINT16 *const seg_data, const UINT16 *const extra_seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -513,7 +513,7 @@ void _2x7Num_2x7Num_10x1Num(const UINT16 *const seg_data, const UINT16 *const ex
//* In:
//* Out:
//*****************************************************
void _2x7Num_2x7Num_4x1Num_gen7(const UINT16 *const seg_data)
static void _2x7Num_2x7Num_4x1Num_gen7(const UINT16 *const seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -548,7 +548,7 @@ void _2x7Num_2x7Num_4x1Num_gen7(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x7Num10_2x7Num10_4x1Num(const UINT16 *const seg_data)
static void _2x7Num10_2x7Num10_4x1Num(const UINT16 *const seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -581,7 +581,7 @@ void _2x7Num10_2x7Num10_4x1Num(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _4x7Num10(const UINT16 *const seg_data)
static void _4x7Num10(const UINT16 *const seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand All @@ -604,7 +604,7 @@ void _4x7Num10(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _6x4Num_4x1Num(const UINT16 *const seg_data)
static void _6x4Num_4x1Num(const UINT16 *const seg_data)
{
for (int i=0; i<8; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -643,7 +643,7 @@ void _6x4Num_4x1Num(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _2x7Num_4x1Num_1x16Alpha(const UINT16 *const seg_data)
static void _2x7Num_4x1Num_1x16Alpha(const UINT16 *const seg_data)
{
for (int i=0; i<14; i++) {
for (int j=0; j<16; j++) {
Expand Down Expand Up @@ -682,7 +682,7 @@ void _2x7Num_4x1Num_1x16Alpha(const UINT16 *const seg_data)
//* In:
//* Out:
//*****************************************************
void _1x16Alpha_1x16Num_1x7Num(const UINT16 * const seg_data)
static void _1x16Alpha_1x16Num_1x7Num(const UINT16 * const seg_data)
{
// 1x16 alphanumeric
for (int i=0; i<16; i++) {
Expand Down Expand Up @@ -717,7 +717,7 @@ void _1x16Alpha_1x16Num_1x7Num(const UINT16 * const seg_data)
//* In:
//* Out:
//*****************************************************
void _1x7Num_1x16Alpha_1x16Num(const UINT16 * const seg_data)
static void _1x7Num_1x16Alpha_1x16Num(const UINT16 * const seg_data)
{
// 1x16 alphanumeric
for (int i=0; i<16; i++) {
Expand Down Expand Up @@ -753,7 +753,7 @@ void _1x7Num_1x16Alpha_1x16Num(const UINT16 * const seg_data)
//* In:
//* Out:
//*****************************************************
void _1x16Alpha_1x16Num_1x7Num_1x4Num(const UINT16 * const seg_data)
static void _1x16Alpha_1x16Num_1x7Num_1x4Num(const UINT16 * const seg_data)
{
// 1x16 alphanumeric
for (int i=0; i<16; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/win32com/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern UINT8 g_raw_dmdbuffer[DMD_MAXY*DMD_MAXX];
extern UINT32 g_raw_colordmdbuffer[DMD_MAXY*DMD_MAXX];
extern UINT32 g_raw_dmdx;
extern UINT32 g_raw_dmdy;
extern UINT32 g_needs_DMD_update;
extern UINT8 g_needs_DMD_update;
extern int g_cpu_affinity_mask;

extern char g_fShowWinDMD;
Expand Down
8 changes: 4 additions & 4 deletions src/wpc/alvgdmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
static UINT8 *dmd32RAM;
static UINT8 level[5] = { 0, 3, 7, 11, 15 }; // brightness mapping 0,25,50,75,100%

#ifdef VPINMAME
#if defined(VPINMAME) || defined(LIBPINMAME)
extern UINT8 g_raw_gtswpc_dmd[];
extern UINT32 g_raw_gtswpc_dmdframes;
#endif
Expand Down Expand Up @@ -356,7 +356,7 @@ static void pistol_poker__mystery_castle_dmd(void) {
UINT8 *RAM = ((UINT8 *)dmd32RAM);
int ii,jj;

#ifdef VPINMAME
#if defined(VPINMAME) || defined(LIBPINMAME)
int i = 0;
g_raw_gtswpc_dmdframes = 4;
#endif
Expand All @@ -376,7 +376,7 @@ static void pistol_poker__mystery_castle_dmd(void) {
*line++ = level[((RAM[0] >> 2 & 0x01) + (RAM[0x200] >> 2 & 0x01) + (RAM[0x400] >> 2 & 0x01) + (RAM[0x600] >> 2 & 0x01))];
*line++ = level[((RAM[0] >> 1 & 0x01) + (RAM[0x200] >> 1 & 0x01) + (RAM[0x400] >> 1 & 0x01) + (RAM[0x600] >> 1 & 0x01))];
*line++ = level[((RAM[0]/*>>0*/&0x01) + (RAM[0x200]/*>>0*/&0x01) + (RAM[0x400]/*>>0*/&0x01) + (RAM[0x600]/*>>0*/&0x01))];
#ifdef VPINMAME
#if defined(VPINMAME) || defined(LIBPINMAME)
g_raw_gtswpc_dmd[ i] = reverse(RAM[0]);
g_raw_gtswpc_dmd[0x200 + i] = reverse(RAM[0x200]);
g_raw_gtswpc_dmd[0x400 + i] = reverse(RAM[0x400]);
Expand All @@ -399,7 +399,7 @@ static void pistol_poker__mystery_castle_dmd(void) {
*line++ = level[(RAM[0]/*>>0*/&0x04)];
*line++ = level[(RAM[0] << 1 & 0x04)];
*line++ = level[(RAM[0] << 2 & 0x04)];
#ifdef VPINMAME
#if defined(VPINMAME) || defined(LIBPINMAME)
g_raw_gtswpc_dmd[ i] =
g_raw_gtswpc_dmd[0x200 + i] =
g_raw_gtswpc_dmd[0x400 + i] =
Expand Down
Loading

0 comments on commit 3546d5a

Please sign in to comment.