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

tatsumi - begin some refactoring #13418

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

Conversation

mamehaze
Copy link
Contributor

@mamehaze mamehaze commented Feb 25, 2025

  • split rotating sprites into a device
  • split into 3 drivers (apache3, roundup5, cyclwarr) as apart from sprites they have little actually in common
  • a few small cleanups

@mamehaze mamehaze marked this pull request as ready for review February 25, 2025 19:58
@mamehaze
Copy link
Contributor Author

mamehaze commented Feb 25, 2025

note, a lot of the code here still isn't very good, this is mostly a restructuring to make future work easier / more manageable, it isn't a code clean-up pass as such so you're going to see a lot of ugly code moved around.

I do plan on looking at things like the sprite rotation again at some point, I did have some old progress but appear to have lost it, as I tried to take on too much at once without committing anything, rather than submit a smaller part as I'm doing here.

Copy link
Member

@cuavas cuavas left a comment

Choose a reason for hiding this comment

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

Please use anonymous namespaces in self-contained driver source files to help keep linking time down, avoid symbol conflicts, etc.

Comment on lines +16 to +23
- (fixed) Cycle Warriors: transparent road layer on sidelines, wrong mask_data?
- (fixed) Missing BG layer (Round Up 5) - banked VRAM data from somewhere!?
- (fixed?) Cycle Warriors: test mode text does not appear as it needs a -256 Y
scroll offset from somewhere.
- (fixed) Cycle Warriors: sometimes it draws garbage on character select or even hangs
depending on where player coins up, most likely caused by miscommunication with sub CPU?
- (fixed) Cycle Warriors: ranking screen is completely wrong;
- (fixed) Cycle Warriors: ugly orange color on character select and briefing screens, layer disable?
Copy link
Member

Choose a reason for hiding this comment

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

There’s no point keeping the stuff that’s done in the TODO list…

Choose a reason for hiding this comment

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

do keep the (fixed?) comment though, you never know when that'll turn out to be a massive oversight.

Copy link
Member

Choose a reason for hiding this comment

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

iirc text layer should come from 6845 so it's something that needs doing anyway, the note is safe to remove imo.

Copy link
Member

Choose a reason for hiding this comment

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

Actually nm: this is tatsumi/cyclwarr.cpp not roundup5.cpp, don't remember what's that for then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

once again, this is just from the existing files, the goal here was to preserve what was there, if a decision is made to not want that information it's really something entirely separate from this PR which you just seem to be piling additional requests onto outside the scope of what's being done.

Comment on lines +264 to +267
tileinfo.set(0,
tileno,
color,
opaque ? TILE_FORCE_LAYER0 : 0);
Copy link
Member

Choose a reason for hiding this comment

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

Indentation is all over the place here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

again this hasn't actually changed from MAME, please keep the scope of the feedback to things I've actually changed.

Comment on lines +287 to +290
tileinfo.set(0,
tileno,
color | m_road_color_bank,
opaque ? TILE_FORCE_LAYER0 : 0);
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

again this hasn't actually changed from MAME, please keep the scope of the feedback to things I've actually changed.

Comment on lines +61 to +62
DECLARE_VIDEO_START(roundup5);
uint32_t screen_update_roundup5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
Copy link
Member

Choose a reason for hiding this comment

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

You should just override video_start() for this derived class rather than using the legacy VIDEO_START stuff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This hasn't changed from what's already in MAME, again not really eligible for PR review here. I may change it anyway, but again please concentrate on what I have changed, picking up on things I haven't changed at all is not helpful.

Comment on lines +24 to +25

DECLARE_GFXDECODE_MEMBER(gfxinfo);
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be public?

Comment on lines +44 to +64
std::unique_ptr<uint8_t[]> m_shadow_pen_array;

bitmap_rgb32 m_temp_bitmap;

int m_sprite_palette_base;

void mycopyrozbitmap_core(bitmap_ind8 &bitmap, const bitmap_rgb32 &srcbitmap,
int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy,
const rectangle &clip, int transparent_color);
void mycopyrozbitmap_core(bitmap_rgb32 &bitmap, const bitmap_rgb32 &srcbitmap,
int dstx, int dsty, int srcwidth, int srcheight, int incxx, int incxy, int incyx, int incyy,
const rectangle &clip, int transparent_color);

template<class BitmapClass> void draw_sprites_main(BitmapClass &bitmap, const rectangle &cliprect, int write_priority_only, int rambank);
template<class BitmapClass> inline void roundupt_drawgfxzoomrotate( BitmapClass &dest_bmp, const rectangle &clip,
gfx_element *gfx, uint32_t code,uint32_t color,int flipx,int flipy,uint32_t ssx,uint32_t ssy,
int scalex, int scaley, int rotate, int write_priority_only );

required_shared_ptr<uint16_t> m_spriteram;
required_region_ptr<uint8_t> m_sprites_l_rom;
required_region_ptr<uint8_t> m_sprites_h_rom;
Copy link
Member

Choose a reason for hiding this comment

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

Please keep the data members together and the member functions together.

Comment on lines +80 to +88
void tatsumi_rotating_sprites_device::device_add_mconfig(machine_config &config)
{
PALETTE(config, m_fakepalette).set_format(palette_device::xRGB_555, 4096); // 4096 arranged as series of CLUTs
}

void tatsumi_rotating_sprites_bigpal_device::device_add_mconfig(machine_config &config)
{
PALETTE(config, m_fakepalette).set_format(palette_device::xRGB_555, 8192); // 8192 arranged as series of CLUTs
}
Copy link
Member

Choose a reason for hiding this comment

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

You don’t need to override this in the derived class, you can just use m_rom_clut_size * 2 for the number of entries.

virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;

void common_init();
Copy link
Member

Choose a reason for hiding this comment

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

If this is only used at start time, it should be marked cold, too.

@mamehaze
Copy link
Contributor Author

mamehaze commented Feb 28, 2025 via email

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.

4 participants