Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmc/koftball: decode bitmap layer #12255

Merged
merged 3 commits into from
Apr 16, 2024
Merged

bmc/koftball: decode bitmap layer #12255

merged 3 commits into from
Apr 16, 2024

Conversation

angelosa
Copy link
Member

No description provided.

src/mame/bmc/koftball.cpp Outdated Show resolved Hide resolved
Comment on lines -148 to -168
void koftball_state::pixram_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
COMBINE_DATA(&m_pixram[offset]);

int const x = (offset & 0xff) << 2;
int const y = (offset >> 8);

uint16_t const pixpal = (m_pixpal & 0xf) << 4;

uint16_t pen;
if (ACCESSING_BITS_8_15)
{
pen = (data >> 12) & 0xf; m_pixbitmap->pix(y, x + 0) = pen ? pixpal + pen : 0;
pen = (data >> 8) & 0xf; m_pixbitmap->pix(y, x + 1) = pen ? pixpal + pen : 0;
}
if (ACCESSING_BITS_0_7)
{
pen = (data >> 4) & 0xf; m_pixbitmap->pix(y, x + 2) = pen ? pixpal + pen : 0;
pen = (data >> 0) & 0xf; m_pixbitmap->pix(y, x + 3) = pen ? pixpal + pen : 0;
}
}
Copy link
Member Author

@angelosa angelosa Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got rid of this because it's hardly adaptable, and the performance penalty for drawing 512x256 in screen_update rather than the handler isn't all that noticeable in a stock 68k game.
It's also imho the wrong way of doing it, if anybody really bothers the better approach is to just use a is_dirty boolean flag attached to the handlers.

@angelosa angelosa requested a review from Osso13 April 16, 2024 11:20
@Osso13
Copy link
Member

Osso13 commented Apr 16, 2024

Thanks, now jxzh test mode and bookkeeping screens look way better.
However, if you let the attract run you'll see this causes a black screen after the 'demon' screen and until the attract cycle restarts (so the blacked out screens are 'slot with road signs', 'Chinese lanterns', 'slot with numbers', 'pirates' and 'tile race'). Guess it may be due to me failing at some priority / transparency stuff.

@angelosa
Copy link
Member Author

Thanks, now jxzh test mode and bookkeeping screens look way better. However, if you let the attract run you'll see this causes a black screen after the 'demon' screen and until the attract cycle restarts (so the blacked out screens are 'slot with road signs', 'Chinese lanterns', 'slot with numbers', 'pirates' and 'tile race'). Guess it may be due to me failing at some priority / transparency stuff.

Fixed in a bit.
0002

Comment on lines +189 to +190
if (nibble)
bitmap.pix(y, (x << 2) + xi) = pix_bank | nibble;
Copy link
Member Author

@angelosa angelosa Apr 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: needs this if check because copyscrollbitmap_trans on its own is unable to break on a pal base. It's likely doable with prio* / primask* methods but I've forgot/don't know the incantation off the bat ...

Copy link
Member

@Osso13 Osso13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, the screens now look just like the original references. Thanks!

@Osso13 Osso13 merged commit e370f54 into master Apr 16, 2024
10 checks passed
m_tilemap[1]->set_transparent_pen(0);
m_tilemap[3]->set_transparent_pen(0);

m_pixbitmap = std::make_unique<bitmap_ind16>(512, 256);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for dynamically allocating the bitmap object itself? The bitmap classes don’t allocate storage until you call resize or allocate – this adds an extra layer of indirection.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reused what was already available in the driver for convenience, and didn't made great efforts in testing this beyond a couple service mode items (i.e. if there's a video register that controls pitch width or if it uses this as priority mask).

@cuavas cuavas deleted the koftball_jxzh branch April 16, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants