Skip to content

Commit

Permalink
just unify formatting, NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
toxieainc committed Jan 15, 2024
1 parent 91d271b commit 5ab6878
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
22 changes: 11 additions & 11 deletions src/wpc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,13 +1131,13 @@ static void updateDisplay(struct mame_bitmap *bitmap, const struct rectangle *cl
UINT16 tmpSeg = *seg;
UINT8 tmpSegDim = 0;
int tmpType = layout->type & CORE_SEGMASK;

if (options.usemodsol & (CORE_MODOUT_FORCE_ON | CORE_MODOUT_ENABLE_PHYSOUT)) {
// TODO this evaluates dimming as a whole for the alpha numeric display character while it should be per segment
/*for (int kk = 0; kk < 16; kk++) {
UINT8 v = saturatedByte(coreGlobals.physicOutputState[CORE_MODOUT_SEG0 + (layout->start + layout->length - 1 - ii) * 16 + kk].value);
if (v > tmpSegDim) tmpSegDim = v;
}*/
/*for (int kk = 0; kk < 16; kk++) {
UINT8 v = saturatedByte(coreGlobals.physicOutputState[CORE_MODOUT_SEG0 + (layout->start + layout->length - 1 - ii) * 16 + kk].value);
if (v > tmpSegDim) tmpSegDim = v;
}*/
int bits = tmpSeg;
for (int kk = 0; bits; kk++, bits >>= 1) {
if (bits & 0x01) {
Expand All @@ -1156,7 +1156,7 @@ static void updateDisplay(struct mame_bitmap *bitmap, const struct rectangle *cl
inRect(cliprect,left,top,locals.segData[layout->type & CORE_SEGALL].cols,locals.segData[layout->type & CORE_SEGALL].rows)) {
#endif
tmpSeg >>= (layout->type & CORE_SEGHIBIT) ? 8 : 0;

*lastSegDim = tmpSegDim;

switch (tmpType) {
Expand Down Expand Up @@ -1185,7 +1185,7 @@ static void updateDisplay(struct mame_bitmap *bitmap, const struct rectangle *cl
seg_data[seg_idx++] = tmpSeg;
#endif
if (!pmoptions.dmd_only || !(layout->fptr || layout->lptr)) {
drawChar(bitmap, top, left, tmpSeg, tmpType, tmpSegDim >> 4);
drawChar(bitmap, top, left, tmpSeg, tmpType, tmpSegDim >> 4);
#ifdef PROC_SUPPORT
if (coreGlobals.p_rocEn) {
if ((core_gameData->gen & (GEN_WPCALPHA_1 | GEN_WPCALPHA_2 | GEN_ALLS11)) &&
Expand Down Expand Up @@ -2227,8 +2227,8 @@ static MACHINE_INIT(core) {
/*-- init PWM integration (needs to be done after coreData->init() which defines the number of outputs and the physical model to be used on each output) --*/
//options.usemodsol = CORE_MODOUT_ENABLE_PHYSOUT; // Uncomment for testing
#ifdef VPINMAME
// If physic output is enabled and supported, we add a 1ms timer that will service physic outputs requests from other threads, that is to say the VPinMame client thread
// Note that physic outputs are also updated once per frame by the core machine driver video update callback.
// If physical output is enabled and supported, we add a 1ms timer that will service physical outputs requests from other threads, that is to say the VPinMAME client thread
// Note that physical outputs are also updated once per frame by the core machine driver video update callback.
if (((options.usemodsol & CORE_MODOUT_ENABLE_MODSOL) && coreGlobals.nSolenoids)
|| ((options.usemodsol & CORE_MODOUT_ENABLE_PHYSOUT) && (coreGlobals.nSolenoids || coreGlobals.nLamps || coreGlobals.nGI || coreGlobals.nAlphaSegs))
|| (options.usemodsol & CORE_MODOUT_FORCE_ON))
Expand Down Expand Up @@ -2561,7 +2561,7 @@ void core_update_pwm_output(float now, int index, int isFlip)
printf("Out. #%d t=%8.5f Flip from %s to %s (elapsed since last flip: %8.5f)\n", index, now, state ? "x" : "-", (1-state) ? "x" : "-", elapsedSinceLastFlip);
#endif
output->lastFlipTimestamp = now;
// TODO Most integrators do not uses the sub integration feature: this should be moved to the only ones using it for cleaner/better performance
// TODO Most integrators do not uses the sub integration feature: this should be moved to the only ones using it for cleaner/better performance
if (integrationLength < pwmIntegrationPeriod && elapsedSinceLastFlip < coreOutputinfos[output->type].pwmSubIntegrationPeriod)
return;
pwmDutyCycle = output->elapsedInStateTime[1] / integrationLength;
Expand Down Expand Up @@ -2737,7 +2737,7 @@ void core_update_pwm_output(float now, int index, int isFlip)
printf("LED #%d t=%8.5f d=%8.5f r=%.2f => V=%0.3f S=%s\n", index, initialNow, initialIntegrationLength, pwmDutyCycle, output->value, state ? "x" : "-");
#endif
}
break;
break;
case CORE_MODOUT_LED_STROBE_1_10MS:
case CORE_MODOUT_LED: {
// LED reacts almost instantly (<1us), the integration is based on the human eye perception, with some
Expand Down
30 changes: 15 additions & 15 deletions src/wpc/gts3.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static WRITE_HANDLER( xvia_0_a_w )
static WRITE_HANDLER( xvia_0_b_w ) {
// From schematics:
// - Rows are a simple latch (74HC273) with overcurrent comparators
// - Columns use two 74HS164 (8 bit shit register), when LSTRB is raised (low to high edge), column output are shifted (<<) and LDATA is used for lowest bit (forming a 12 bit shift sequence)
// - Columns use two 74HS164 (8 bit shift register), when LSTRB is raised (low to high edge), column output are shifted (<<) and LDATA is used for lowest bit (forming a 12 bit shift sequence)
// - LCLR creates a short pulse (through a 555, with R=4.7k and C=0.1uF so 50us pulse) that will reset the overcurrent comparators on the row outputs (likely to cover the latching between row & column and avoid ghosting)
// This results in the following write sequence for strobing (observed on Cue Ball Wizard):
// - Set lampRow to 0 (turn off all lamps)
Expand All @@ -203,8 +203,8 @@ static WRITE_HANDLER( xvia_0_b_w ) {
const UINT8 lampRow = GTS3locals.lampRow; // data & LCLR ? 0 : GTS3locals.lampRow; // Not emulated as it does not gives any benefit
core_write_pwm_output_lamp_matrix(CORE_MODOUT_LAMP0 , GTS3locals.lampColumn & 0xFF, lampRow, 8);
core_write_pwm_output_lamp_matrix(CORE_MODOUT_LAMP0 + 64, (GTS3locals.lampColumn >> 8) & 0x0F, lampRow, 4);


if (GTS3locals.alphagen)
{ // Alpha generation
//printf("%8.5f Alpha Strobe %02x %05x\n", timer_get_time(), data, GTS3locals.alphaNumColShitRegister);
Expand Down Expand Up @@ -265,7 +265,7 @@ static WRITE_HANDLER( xvia_0_b_w ) {
GTS3locals.bitSet = 0;
}
}

GTS3locals.u4pb = data;
}

Expand Down Expand Up @@ -352,10 +352,10 @@ static WRITE_HANDLER( xvia_1_b_w ) {
// TODO implement full aux board logic
if (data > 0 && data < 4 && GTS3locals.ax[4] == GTS3locals.ax[6])
coreGlobals.segments[39 + data].w = (GTS3locals.ax[6] & 0x3f)
| ((GTS3locals.ax[6] & 0xc0) << 3)
| ((GTS3locals.ax[5] & 0x0f) << 11)
| ((GTS3locals.ax[5] & 0x10) << 2)
| ((GTS3locals.ax[5] & 0x20) << 3);
| ((GTS3locals.ax[6] & 0xc0) << 3)
| ((GTS3locals.ax[5] & 0x0f) << 11)
| ((GTS3locals.ax[5] & 0x10) << 2)
| ((GTS3locals.ax[5] & 0x20) << 3);
} else if (core_gameData->hw.lampCol > 4) { // flashers drived by auxiliary board (for example backbox lights in SF2)
// FIXME From the schematics, I would say that the latch only happens if ax[4] is raised up (not checked here)
coreGlobals.lampMatrix[12] = coreGlobals.tmpLampMatrix[12] = data;
Expand Down Expand Up @@ -471,7 +471,7 @@ static INTERRUPT_GEN(GTS3_vblank) {
}*/
GTS3locals.solenoids = coreGlobals.pulsedSolState;
}

/*-- diagnostic leds --*/
if ((GTS3locals.vblankCount % GTS3_DISPLAYSMOOTH) == 0) { // TODO it seems that diag LEDs are PWMed => move to a lamp
if (GTS3_dmdlocals[0].version == 2) { //Strikes N Spares has 2 DMD LED, but no Sound Board LED
Expand All @@ -485,7 +485,7 @@ static INTERRUPT_GEN(GTS3_vblank) {
GTS3locals.diagnosticLed;
}
}

core_updateSw(GTS3locals.solenoids & 0x80000000); // GameOn is solenoid #31 for all tables
}

Expand Down Expand Up @@ -770,16 +770,16 @@ static WRITE_HANDLER(alpha_display){
{
GTS3locals.activeSegments[offset >> 1].w &= 0x063F; // Remove bits 6..8 and 11..15
GTS3locals.activeSegments[offset >> 1].w |= ((data & 0x0F) << 11) /* 8..11 => 11..14 */
| ((data & 0x10) << 2) /* 12 => 6 */
| ((data & 0x20) << 3) /* 13 => 8 */
| ((data & 0x40) << 9) /* 14 => 15 */
| ((data & 0x80) ); /* 15 => 7 */
| ((data & 0x10) << 2) /* 12 => 6 */
| ((data & 0x20) << 3) /* 13 => 8 */
| ((data & 0x40) << 9) /* 14 => 15 */
| ((data & 0x80) ); /* 15 => 7 */
}
else // Lo byte (0..7)
{
GTS3locals.activeSegments[offset >> 1].w &= 0xF9C0; // Remove bits 0..5 and 9..10
GTS3locals.activeSegments[offset >> 1].w |= ((data & 0x3F) ) /* 0.. 5 => 0.. 5 */
| ((data & 0xC0) << 3); /* 6.. 7 => 9..10 */
| ((data & 0xC0) << 3); /* 6.. 7 => 9..10 */
}
if (((GTS3locals.u4pb & DBLNK) == 0) && (GTS3locals.alphaNumCol < 20)) { // This should never happen since character pattern is loaded to the latch registers while DBLNK is raised
core_write_pwm_output_8b(CORE_MODOUT_SEG0 + (GTS3locals.alphaNumCol + 20) * 16 , GTS3locals.activeSegments[0].b.lo);
Expand Down

0 comments on commit 5ab6878

Please sign in to comment.