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

shared/decospr.cpp: Use device_gfx_interface for gfx decode functions, Cleanups: #12379

Merged
merged 14 commits into from
May 17, 2024

Conversation

cam900
Copy link
Contributor

@cam900 cam900 commented May 17, 2024

  • Reduce unnecessary lines
  • Constantize variables
  • Use Bit macros for bitfields
  • Use C++ style comment for single line comments
  • Fix spacing
  • Move sprite configuration related stuff into machine config
  • Fix file directory, Sort to Alphabetical order

dataeast/minor cleanups for various drivers

  • Constantize values
  • Reduce literal tags and runtime tag lookups
  • Fix ROM region namings
  • Suppress side effects for debugger read
  • Simplify deco146/104 related function namings
  • Reduce duplicates
  • Reduce unnecessary lines
  • Fix sound routing if chip and/or PCB supports mono sound only
  • Fix palette entries

dataeast/backfire.cpp, deco156.cpp, simpl156.cpp:

  • Use memory_share_creator instead unique_ptr/array

dataeast/boogwing.cpp:

  • Reduce preprocessor defines

dataeast/pktgaldx.cpp:

  • Simplify gfxdecode layout
  • Fix metadata for bootleg set (title screen says (c)1993 Data West)

f32/silvmil.cpp:

  • Fix ROM region namings
  • Reduce literal tag usage

misc/esd16.cpp:

  • Constantize variables

misc/gotcha.cpp:

  • Simplify gfx decode layout

yunsung/nmg5.cpp:

  • Fix ROM region naming
  • Simplify gfx decode layout

cam900 and others added 14 commits May 17, 2024 17:43
…, Cleanups:

- Reduce unnecessary lines
- Constantize variables
- Use Bit macros for bitfields
- Use C++ style comment for single line comments
- Fix spacing
- Move sprite configuration related stuff into machine config

dataeast/minor cleanups for various drivers
- Constantize values
- Reduce literal tags and runtime tag lookups
- Fix ROM region namings
- Suppress side effects for debugger read
- Simplify deco146/104 related function namings
- Reduce duplicates
- Reduce unnecessary lines
- Fix sound routing if chip and/or PCB supports mono sound only
- Fix palette entries

dataeast/backfire.cpp, deco156.cpp, simpl156.cpp:
- Use memory_share_creator instead unique_ptr/array

dataeast/boogwing.cpp:
- Reduce preprocessor defines

dataeast/pktgaldx.cpp:
- Simplify gfxdecode layout
- Fix metadata for bootleg set (title screen says (c)1993 Data West)

f32/silvmil.cpp:
- Fix ROM region namings
- Reduce literal tag usage

misc/esd16.cpp:
- Constantize variables

misc/gotcha.cpp:
- Simplify gfx decode layout

yunsung/nmg5.cpp:
- Fix ROM region naming
- Simplify gfx decode layout
Comment on lines -23 to +29
m_okimusic(*this, "okimusic") ,
m_mainram(*this, "mainram"),
m_systemram(*this, "systemram"),
m_okimusic(*this, "okimusic"),
m_sprgen(*this, "spritegen"),
m_palette(*this, "palette") { }
m_palette(*this, "palette"),
m_rowscroll(*this, "rowscroll_%u", 1U, 0x800U, ENDIANNESS_LITTLE),
m_mainram(*this, "mainram", 0x4000U, ENDIANNESS_LITTLE),
m_systemram(*this, "systemram"),
m_spriteram(*this, "spriteram", 0x1000U, ENDIANNESS_LITTLE)
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 sure what size m_rowscroll is supposed to be. Before this PR, it was allocating 0x800/2 16-bit words, i.e. 0x400 16-bit words or 0x800 bytes. I’ve made it not reduce that.

However, if you look at dataeast/simpl156.cpp, it maps the handlers across a range of 0x2000 byte addresses, or 0x800 32-bit word addresses. There’s one 16-bit row scroll word at each 32-bit CPU word address, so to avoid buffer overruns, it needs to be 0x800 16-bit words rather than bytes.

Currently, accessing the second half of either row scroll area causes a buffer overrun (e.g. 0x161000-0x161fff and 0x165000-0x165fff in Joe and Mac Returns, or 0x3e1000-0x3e1fff and 0x3e5000-0x3e5fff in Magical Drop).

The solution is probably one of:

  • Double the row scroll RAM size
  • Mirror the second half of each row scroll area
  • Halve the length of each row scroll area

@cuavas cuavas merged commit 09ff994 into mamedev:master May 17, 2024
5 checks passed
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