dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

Split 'IsRAMAddress' method into 'IsEffectiveRAMAddress' and 'IsPhysicalRAMAddress' methods

Open tygyh opened this issue 1 year ago • 7 comments

Simple refactor to remove a bool argument. The PR also simplifies the branching returns.

tygyh avatar Jul 16 '24 10:07 tygyh

Failed lint check

dreamsyntax avatar Jul 16 '24 15:07 dreamsyntax

Failed lint check

I can't see what is wrong.

tygyh avatar Jul 16 '24 16:07 tygyh

Click the ❌ next to the commit, find lint, then click details to see the build log. You may have to click on "view all ### lines" if the log is long.

image

Alternatively, you can try running Tools/lint.sh locally. It requires a specific clang-format version, though.

OatmealDome avatar Jul 16 '24 17:07 OatmealDome

You can also just use the autoformatter if using Visual Studio

dreamsyntax avatar Jul 16 '24 17:07 dreamsyntax

Please squash the commits into one.

JosJuice avatar Jul 20 '24 19:07 JosJuice

@dolphin-emu-bot rebuild

mitaclaw avatar Aug 20 '24 15:08 mitaclaw

The only thing I might suggest is moving the definition for MMU::IsPhysicalRAMAddress before the definition for MMU::IsEffectiveRAMAddress in MMU.cpp (also reorder the declarations in MMU.h for consistency). When compiling from top to bottom, if the compiler knows the definition for a function it is calling, then it may decide to inline it if that would be more optimal than calling it. Whether or not this example would result in inlining is another story, but it's a good coding habit I usually try to follow.

Oh, and auto translate_address in MMU::IsEffectiveRAMAddress can be made const. It's a shame MMU::IsEffectiveRAMAddress itself isn't a const member function, but fixing that is a little out of scope for this PR / I haven't fully explored if there's a deeply hidden reason why it isn't.

mitaclaw avatar Sep 20 '24 20:09 mitaclaw

@JosJuice Anything to add?

tygyh avatar May 04 '25 17:05 tygyh

@jordan-woyak Merge?

tygyh avatar May 15 '25 10:05 tygyh

@jordan-woyak Reminder

tygyh avatar May 31 '25 09:05 tygyh

Can you put Core/PowerPC: in the commit message, please?

jordan-woyak avatar Jun 14 '25 21:06 jordan-woyak