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

heathkit/tlb.cpp: Various file cleanup #12275

Merged
merged 3 commits into from May 5, 2024
Merged

Conversation

mgarlanger
Copy link
Contributor

General cleanup including

  • Removed method declarations that were not used/implemented.
  • Changed to use u8/u16/u32.
  • Add consistent horizontal spacing for readability.
  • Removed some duplicate comments.

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.

Personally, I’m not a fan of tabulating initialisations, assignments and inline functions where it isn’t naturally tabular data involved. It either ends up ragged again quickly, or requires large numbers of lines to change for relatively small real changes.

I’m fine with tabulating stuff that’s naturally somewhat tabular, like I/O ports, ROM load commands, device type declarations and large blocks of variable declarations. It’s just that tabulating other things tends to lead to churn for minimal improvements in readability at best.

I’ll let other people take a look and chime in on this.

Comment on lines 152 to 171
m_maincpu(*this, "maincpu"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_crtc(*this, "crtc"),
m_p_videoram(*this, "videoram"),
m_p_chargen(*this, "chargen"),
m_config(*this, "CONFIG"),
m_ace(*this, "ins8250"),
m_beep(*this, "beeper"),
m_mm5740(*this, "mm5740"),
m_kbdrom(*this, "keyboard"),
m_kbspecial(*this, "MODIFIERS"),
m_maincpu(*this, "maincpu"),
m_screen(*this, "screen"),
m_palette(*this, "palette"),
m_crtc(*this, "crtc"),
m_p_videoram(*this, "videoram"),
m_p_chargen(*this, "chargen"),
m_config(*this, "CONFIG"),
m_ace(*this, "ins8250"),
m_beep(*this, "beeper"),
m_mm5740(*this, "mm5740"),
m_kbdrom(*this, "keyboard"),
m_kbspecial(*this, "MODIFIERS"),
m_repeat_clock(*this, "repeatclock")
Copy link
Member

Choose a reason for hiding this comment

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

The trouble with tabulating everything like this is that if you introduce a data member with a longer name or remove the data member with the longest name, every line in the block needs to change.

Also, in this case you’ve tabulted the tags, but not the *this references.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I undid these changes and the other ones you pointed out.

Comment on lines 35 to 48
// optional operations
virtual void rlsd_in_w(int state) {}
virtual void dsr_in_w(int state) {}
virtual void cts_in_w(int state) {}
virtual void rlsd_in_w(int state) {}
virtual void dsr_in_w(int state) {}
virtual void cts_in_w(int state) {}

// optional SigmaSet operations
virtual void sigma_ctrl_w(uint8_t data) {}
virtual uint8_t sigma_ctrl_r() { return 0x00; }
virtual uint8_t sigma_video_mem_r() { return 0x00; }
virtual void sigma_video_mem_w(uint8_t val) {}
virtual void sigma_io_lo_addr_w(uint8_t val) {}
virtual void sigma_io_hi_addr_w(uint8_t val) {}
virtual void sigma_window_lo_addr_w(uint8_t val) {}
virtual void sigma_window_hi_addr_w(uint8_t val) {}
virtual void sigma_ctrl_w(u8 data) {}
virtual u8 sigma_ctrl_r() { return 0x00; }
virtual u8 sigma_video_mem_r() { return 0x00; }
virtual void sigma_video_mem_w(u8 val) {}
virtual void sigma_io_lo_addr_w(u8 val) {}
virtual void sigma_io_hi_addr_w(u8 val) {}
virtual void sigma_window_lo_addr_w(u8 val) {}
virtual void sigma_window_hi_addr_w(u8 val) {}
Copy link
Member

Choose a reason for hiding this comment

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

It’s the same with these – it’s prone to either ending up looking ragged again, or requiring all the lines in the block to change for a small functional change.

Comment on lines 221 to 225
virtual const tiny_rom_entry *device_rom_region() const override;
virtual ioport_constructor device_input_ports() const override;
virtual void device_add_mconfig(machine_config &config) override;

void mem_map(address_map &map);
void mem_map(address_map &map);
Copy link
Member

Choose a reason for hiding this comment

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

See here’s an example where you’ve arbitrarily lined up device_add_mconfig and mem_map, but you haven’t lined up device_rom_region and device_input_ports with them. It’s a bit concerning if even the initial tabulation is inconsistent.

@mgarlanger mgarlanger requested a review from cuavas May 4, 2024 15:38
@rb6502 rb6502 merged commit 513c129 into mamedev:master May 5, 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

3 participants