Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #117201
    Anonymous
    Inactive

    I am very new to Linux, but I have really enjoyed learning. I am currently trying to learn how to build software from source to try and experiment with a couple different game ports on the Raspberry Pi. I have also been reading through different parts of the RetroPie scripts to learn how it is written, and that is where I’ve got a few questions that I just can’t seem to figure out:

    1. How do I find where variables are defined when there is no definition in the script file I’m reading? Examples I see are “$md_build” “$md_inst” “$md_id” variables I see in the build/install scripts for different emulators.

    2. How do I find functions that are called but don’t exist in the script file I’m reading? Examples I see are getDepends, gitPullOrClone, mkRomDir, and addSystem

    Those are just a couple examples I’ve found in my attempt to try and figure out how to make a new script module if I am able to get a new ported game to work. Its been 20 years since I took a couple semesters of Pascal in high school, so I don’t remember much about programming, but some of the concepts are coming back. It would really help if I could learn better how to navigate the script and understand definitions.

    Thanks for any help!

    #117202
    herbfargus
    Member

    These are the two main scripts that define those for the modules:

    https://github.com/RetroPie/RetroPie-Setup/blob/7545b4c359a03f34e2547f6771c211138a5a79ff/scriptmodules/packages.sh

    https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/helpers.sh

    Those are very good questions. I do think scripting is somewhat lacking in the documentation though there is some documentation here:

    https://github.com/retropie/RetroPie-Setup/wiki/Shell-Style-Guide

    I may be able to come up with more detailed explanations when I have more time, but a good way to figure out the scripts is to do what you’ve been doing, see how the current scripts work and then adapt them to your needs.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Everything else related to the RetroPie Project’ is closed to new topics and replies.