pcsx-redux icon indicating copy to clipboard operation
pcsx-redux copied to clipboard

New CD-Rom code.

Open nicolasnoble opened this issue 2 years ago • 3 comments

nicolasnoble avatar Dec 06 '22 06:12 nicolasnoble

Codecov Report

Attention: Patch coverage is 55.26316% with 136 lines in your changes missing coverage. Please review.

Project coverage is 20.46%. Comparing base (1e635d0) to head (32e74e5). Report is 4 commits behind head on main.

:exclamation: Current head 32e74e5 differs from pull request most recent head c25e5c3

Please upload reports for the commit c25e5c3 to get more accurate results.

Files Patch % Lines
src/core/sstate.cc 0.00% 65 Missing :warning:
src/core/cdrom.h 68.75% 15 Missing :warning:
src/gui/gui.cc 0.00% 9 Missing :warning:
src/supportpsx/iec-60908b.h 64.00% 9 Missing :warning:
src/core/psxinterpreter.cc 81.81% 6 Missing :warning:
src/core/mdec.cc 0.00% 5 Missing :warning:
src/core/luaiso.cc 33.33% 4 Missing :warning:
src/core/psxdma.h 20.00% 4 Missing :warning:
src/core/gte.cc 0.00% 2 Missing :warning:
src/core/isoffi.lua 0.00% 2 Missing :warning:
... and 10 more
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1129       +/-   ##
===========================================
+ Coverage    9.94%   20.46%   +10.52%     
===========================================
  Files         448      449        +1     
  Lines      132699   132249      -450     
===========================================
+ Hits        13200    27069    +13869     
+ Misses     119499   105180    -14319     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Dec 06 '22 06:12 codecov[bot]

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

ghost avatar Jul 26 '23 04:07 ghost

Walkthrough

This pull request makes extensive changes across build workflows, core modules, GUI components, and test suites. New steps in GitHub Actions now download and extract a UNIROM boot disc for building and testing. The CD-ROM handling has been enhanced with new methods, scheduling callbacks, and operator overloads for time (MSF) operations. Several interrupt and scheduling routines have been refactored to use a unified Schedule enum. The GUI now calls the updated parseIso() for ISO processing, and numerous new tests and Makefile simplifications for MIPS targets have been added.

Changes

Files Change Summary
.github/workflows/linux-build.yml, .github/workflows/linux-coverage.yml Added steps to download/unzip the UNIROM boot disc, build OpenBIOS, copy openbios.bin, and run pcsx-redux in test mode using Lua scripts.
.gitignore, .vscode/c_cpp_properties.json Updated ignore patterns (added *.cue, *.bak) and a new VS Code configuration property (configurationProvider).
src/cdrom/cdriso.cc, src/cdrom/cdriso.h Added methods getLocP and getTrack; reintroduced failed(); changed m_numtracks to unsigned; updated getTN() signature.
src/core/DynaRec_aa64/recompiler.cc, src/core/DynaRec_x64/recompiler.cc Introduced new variable extra for tracking ROM instructions and updated cycle accounting logic accordingly.
src/core/cdrom.h, src/core/gdb-server.cc, src/main/main.cc, src/gui/widgets/isobrowser.cc, src/gui/gui.cc Replaced calls to check() with parseIso(); added lid control methods (openLid(), closeLid(), scheduleCloseLid()); restructured interrupt handling to use scheduling callbacks.
src/core/psxemulator.h, src/core/r3000a.h, src/core/psxdma.h, src/core/psxinterpreter.cc Refactored interrupt scheduling using a new Schedule enum and scheduling/unscheduling methods; removed redundant type conversions in interpreter.
src/core/sstate.cc, src/core/sstate.h Updated save state fields from interrupt-based to schedule-based (ScheduleMask, ScheduleTargetsField); simplified CD-ROM save state data.
src/core/mdec.cc, src/core/mdec.h Renamed interrupt methods to scheduled callbacks (mdec0InterruptscheduledCallback0, mdec1InterruptscheduledCallback1).
src/core/sio.cc, src/core/sio.h, src/core/sio1.cc, src/core/sio1.h Renamed interrupt methods to scheduled callbacks; replaced direct interrupt register manipulation with scheduling/unscheduling calls.
src/gui/widgets/log.cc, src/gui/widgets/registers.cc, src/lua/fileffimeta.lua Added menu item for logging CD-ROM hardware access; updated GUI to display schedule mask instead of interrupt; added Lua FFI casting function.
src/mips/tests/* Added numerous new CD-ROM test files with Cester framework; created new Makefiles for CD-ROM tests; simplified existing Makefiles by removing redundant sources and flags.
src/supportpsx/iec-60908b.h Added operator overloads (--, +, -, +=, -=) to MSF struct; introduced new SubHeaders struct with flag methods.
src/supportpsx/iso9660-builder.cc Added calls to compute_edcecc() in writeSectorAt to compute error detection/correction codes.
third_party/cueparser/cueparser.c, third_party/cueparser/cueparser.h Added new cutting variable to adjust sector number calculations during cue parsing.
tests/pcsxrunner/cdrom.cc, vsprojects/tests/pcsxrunner/pcsxrunner.vcxproj* Added new test source file cdrom.cc with tests for interpreter and dynarec modes; included it in project files.

Sequence Diagram(s)

sequenceDiagram
    participant Main
    participant CDROM
    participant GUI
    Main->>CDROM: setIso(file)
    CDROM-->>Main: parseIso()
    Main->>GUI: Update display (show scheduleMask)
sequenceDiagram
    participant CPU
    participant Peripheral
    CPU->>Peripheral: schedule(Schedule::XYZ, cycle)
    Peripheral-->>CPU: scheduledCallback() triggered
    CPU->>CPU: unschedule(Schedule::XYZ) after handling

Possibly related PRs

  • grumpycoders/pcsx-redux#1898: Modifies calls to check() in the GUI for CD-ROM handling, directly relating to the updated use of parseIso() in this PR.

Poem

Hopping through code with a bounce and a skip,
I’ve found new paths for CD-ROM’s trip.
Scheduling magic with each tiny cue,
Parsing ISO, fresh as morning dew.
My floppy ears celebrate changes so grand—
A rabbit’s cheer in our emu land!
🐇🌟

✨ Finishing Touches
  • [ ] 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Mar 22 '25 06:03 coderabbitai[bot]