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

alpha68k_palette.cpp: Implement Neo Geo palette hardware features, Minor adjust #7239

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cam900
Copy link
Contributor

@cam900 cam900 commented Sep 15, 2020

Fix initialization, Add notes
neogeo.cpp: Convert palette handling into alpha68k_palette.cpp

Fix reference color behavior
neogeo.cpp: Convert palette handling into alpha68k_palette.cpp
if (entry == 0)
{
// TODO: actual behaviour, needs HW tests.
bool is_sync_color = (m_paletteram[offset] & 0x7fff) == 0;
Copy link
Member

Choose a reason for hiding this comment

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

This repeats what's in alpha68k_palette_device::update_color, violating DRY.
It is also untested for NeoGeo games (anything really using it?) plus no idea if it really desyncs on bank change if the reference color diverges or it just derive the other bank setting.

std::vector<uint16_t> m_paletteram;
int m_sync_color_shift[2]; // 2 banks
Copy link
Member

Choose a reason for hiding this comment

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

This is not supposed to be initialized as "2 banks" for alpha68k_palette_device

update_color(entry, offset);
}

inline void neogeo_palette_device::update_color(u16 entry, u16 offset)
Copy link
Member

Choose a reason for hiding this comment

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

This is a poor signature:

  • entry sounds like an alias for offset, which is not.
  • is it really necessary to pass offset, offset in alpha68k device?


inline void neogeo_palette_device::set_color_entry(u16 offset)
{
const u16 pal_data = m_paletteram[offset];
Copy link
Member

Choose a reason for hiding this comment

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

I'm not convinced over writing then reading the very same palette data performance-wise, unless you have a profiler output that proves otherwise.

neogeo_palette_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

// setters
void set_bank(bool bank) { if (m_bank != bank) { m_bank = bank; m_bankaddr = bank ? m_entries : 0; } }
Copy link
Member

Choose a reason for hiding this comment

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

Is this properly refreshing the actual palette data on bank change?

@angelosa
Copy link
Member

btw you haven't fixed "reference color behavior" at all, the actual behaviour is unknown and prolly diverges too between implementations.

Add configuration for neogeo features, Add notes, Fix initialization
neogeo.cpp: Convert palette behavior into alpha68k_palette.cpp
@cam900 cam900 changed the title alpha68k_palette.cpp: Implement Neo Geo palette hardware, Minor adjust alpha68k_palette.cpp: Implement Neo Geo palette hardware features, Minor adjust Sep 16, 2020
@ghost
Copy link

ghost commented Sep 17, 2020

Charles MacDonald did observe this behaviour on the NeoGeo, but I think like the CPS stuff where it causes many problems on certain games, it's down to the monitor if it uses it or not.

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

2 participants