Conversation
📝 WalkthroughWalkthroughAdds a new public predicate Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
dvd/dvd_dump.ixx (1)
854-859: Buffer allocation precedessectors_at_onceadjustment.
file_dataandfile_stateare allocated at lines 830–831 using the originalsectors_at_oncevalue, but the adjustment to 16 happens here. The buffers end up oversized but never undersized, so there's no correctness issue — just a minor inefficiency.Consider moving the slim drive adjustment before the buffer allocation for clarity and to avoid the over-allocation.
♻️ Suggested reordering
+ // TODO: can be implemented later + if(raw) + { + rom_update = false; + fs_ctx.search = false; + + if(is_omnidrive_slim(ctx.drive_config) && sectors_at_once >= 32) + { + LOG("warning: setting dump read size to 16 for raw dumping"); + sectors_at_once = 16; + } + } + std::vector<uint8_t> file_data(sectors_at_once * cfg.sector_size); std::vector<State> file_state(sectors_at_once); - ... - // TODO: can be implemented later - if(raw) - { - rom_update = false; - fs_ctx.search = false; - - if(is_omnidrive_slim(ctx.drive_config) && sectors_at_once >= 32) - { - LOG("warning: setting dump read size to 16 for raw dumping"); - sectors_at_once = 16; - } - }
There was a problem hiding this comment.
🧹 Nitpick comments (1)
dvd/dvd_dump.ixx (1)
936-938: Signed/unsigned comparison is correct in practice but fragile.
lbaisint32_twhilesectors_countandsectors_to_readareuint32_t. Whenlbais negative (raw DVD pre-data area), implicit conversion to unsigned makeslba < sectors_countevaluate tofalse, which happens to be the desired behavior — but only by accident of two's complement wrapping.An explicit cast or guard makes the intent clearer and future-proof:
Suggested clarification
- // ensure requested sectors don't cross lead-out boundary - if(lba < sectors_count && lba + sectors_to_read > sectors_count) - sectors_to_read = sectors_count - lba; + // ensure requested sectors don't cross lead-out boundary + if(lba >= 0 && static_cast<uint32_t>(lba) < sectors_count && static_cast<uint32_t>(lba) + sectors_to_read > sectors_count) + sectors_to_read = sectors_count - static_cast<uint32_t>(lba);
Summary by CodeRabbit
Release Notes
New Features
Improvements