Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
randomouscrap98 committed Jul 15, 2024
1 parent 1a1ce67 commit e6766d6
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,26 @@ ardugotools flashcart generate helpers/applysaves.lua myflashcart.bin newflashca
```

Then you can flash `outflashcart.bin` to your Arduboy.

#### Make Cart from folder

If you don't want to write a script yourself to create a custom flashcart, you can instead
set up a folder with all the categories and games and use `helpers/makecart.lua` to generate
it for you. The folder must be setup in a certain way; see the comments in
[makecart.lua](helpers/makecart.lua) to get started. In general, you simply setup a folder
where:
- Each folder inside is a category
- Each `.arduboy` package within the category folders are games in that category
- You need a `title.png` at the root of the folder for the "bootloader" image
- You need a `title.png` at the root of each category for the category image
- Each package must have some image inside it to use as a title image. If it's missing
or if you want to override it, simply place a png file with the same name as the package
in the category directory next to the package.

The arguments to pass in are the folder to read from, the devices to choose inside the
packages, and the path to save the flashcart binary to. An optional fourth parameter lets
you indicate ignored folders by name, comma separated. Example:

```
ardugotools flashcart generate helpers/makecart mycart "Arduboy,ArduboyFX" flashcart.bin "ignore,trash"
```
11 changes: 6 additions & 5 deletions helpers/makecart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ for _, catinfo in ipairs(maindirlist) do
elseif string.sub(catfile.name, -8) == ".arduboy" then
-- This is a normal arduboy package
slot = packageany(catfile.path, devices)
if slot.image == nil then
-- Try to find an image with the same name as the package.
testimage = string.sub(catfile.name, 0, -8) .. "png"
log("Looking for alternate image in " .. testimage)
slot.image = load_title(catlist, testimage)
-- Try to find an image with the same name as the package.
local testimage = string.sub(catfile.name, 0, -8) .. "png"
local image = load_title(catlist, testimage)
if image ~= nil then
slot.image = image
log("Loaded alternate image in " .. testimage)
end
add_slot(slot)
elseif catfile.name ~= "title.png" then
Expand Down

0 comments on commit e6766d6

Please sign in to comment.