Skip to content

Commit

Permalink
Merge pull request #15 from OffBroadway/update-v014
Browse files Browse the repository at this point in the history
Update v0.1.4
  • Loading branch information
trevor403 authored Dec 6, 2022
2 parents c323967 + 2090d3b commit 451e442
Show file tree
Hide file tree
Showing 36 changed files with 1,127 additions and 83 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI
on: push
jobs:
build:
runs-on: ubuntu-latest
container: devkitpro/devkitppc:20220821
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup
run: |
apt-get update && apt-get install -y genisoimage nodejs build-essential gcc-arm-none-eabi python3-distutils python3-setuptools
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py
pip3 install -r patches/scripts/requirements.txt
- name: Build cubeboot
run: cd entry; make clean && make
- name: Build apploader
run: |
git clone -b force-early-boot --single-branch https://github.com/OffBroadway/gc-boot-tools.git
cd gc-boot-tools
(cd ppc/apploader; make)
(cd mkgbi; make)
ls mkgbi/gbi.hdr
- name: Build GCLoader
run: |
mkdir boot-dir && cp cubeboot/cubeboot.dol boot-dir
genisoimage -R -J -G gc-boot-tools/mkgbi/gbi.hdr -no-emul-boot -b cubeboot.dol -o boot.iso boot-dir
- name: Build PicoBoot
run: |
git clone https://github.com/webhdx/PicoBoot.git
cd PicoBoot; env PICO_SDK_FETCH_FROM_GIT=1 cmake .
./process_ipl.py ../entry/entry.dol src/ipl.h
make
- name: Rename Artifacts
run: |
mkdir -p dist/next
mv ./boot.iso dist/next/boot.iso
mv ./cubeboot/cubeboot.dol dist/next/cubeboot.dol
mv ./PicoBoot/picoboot.uf2 dist/next/cubeboot.uf2
- name: Archive
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/next/
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.4] - Boot Held Button Programs

### Details
This build includes custom program loading, PAL 480p and optional boot delays.

Custom program loading by be of use if you boot homebrew from one of the existing defaults and need to specify an alternative. It can also be helpful if you prefer to use your cube exclusively for GBI without needing a loader.

Boot Delays are a new optional feature that can delay cubeboot before the animation begins or after it finishes (and leave it on screen for an extended period). You may want to use preboot delay to wait for your TV to detect the video source. Additionally you may be interested in a postboot delay to emulate the load times you would usually see when booting a disc.

Usage:
- Held button with standard names like `B.dol` and `START.dol`
- Held buttons with custom names like `button_x = test.dol` set in `cubeboot.ini`
- Set delays before the boot logo using `preboot_delay_ms = 500` (time in milliseconds)
- Set delays after the boot logo using `postboot_delay_ms = 3000` (time in milliseconds)
- PAL IPL 1.0 (DOL-001 PAL consoles) Force Progressive with `force_progressive = 1` set in `cubeboot.ini`
- Specify a custom default DOL file to boot into with `default_program = swiss.dol` set in `cubeboot.ini`

Use-cases:
- Hold button to load alternative DOL files (this also loads associated `.cli` files)
- Set custom program per-button with `button_name = something.dol`
- When using GCVideo, you can set `preboot_delay_ms` to wait for your TV to sync to the input source
- The `postboot_delay_ms` setting exists exclusively for flair. It can help recover the feeling of waiting for a game to load
- If you do not want cubeboot to enumerate through names like `boot.dol` and `autoexec.dol` you can set your own default with the `default_program` setting

Expected behavior:
- When you have both `Y.dol` and `test.dol` on the SD with `button_y = test.dol` in `cubeboot.ini`, this should boot `test.dol`
- The GCLoader SD card will only be used when booting directly from GCLoader (please submit an **Issue** if you have trouble using GCLoader with PicoBoot)

This release includes the following enhancements:
- https://github.com/OffBroadway/flippyboot-ipl/issues/13
- https://github.com/OffBroadway/flippyboot-ipl/issues/7
- https://github.com/OffBroadway/flippyboot-ipl/issues/2
- https://github.com/OffBroadway/flippyboot-ipl/issues/3

It also fixes the following bugs:
- https://github.com/OffBroadway/flippyboot-ipl/issues/5

## [0.1.3] - PAL Progressive Scan hotfix
### Details

Expand Down
10 changes: 10 additions & 0 deletions CREDIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
`patches/source/usbgecko.c`: credit to swiss-gc <br/>
`patches/source/picolibc`: credit to picolibc and newlib <br/>
`patches/source/tinyprintf`: credit to tinyprintf <br/>
`patches/source/time.c` credit to libogc <br/>
`patches/source/arith64.c` credit to github.com/glitchub/arith64 <br/>

<hr/>

Expand All @@ -27,3 +29,11 @@
`cubeboot/source/pcg_basic.h` credit to pcg-random.org <br/>
`cubeboot/source/ini.c` credit to github.com/rxi/ini <br/>
`cubeboot/source/ini.h` credit to github.com/rxi/ini <br/>

`cubeboot/include/elf_abi.h` credit to swiss-gc <br/>
`cubeboot/include/gcm.h` credit to gc-boot-tools <br/>

<hr/>

`NTSC 480p on PAL IPLs` credit to Nintendont (terrible workaround I know) <br/>
`NTSC 480p on PAL IPLs` credit to swiss-gc (Fix logo animation speed) <br/>
1 change: 1 addition & 0 deletions cubeboot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ $(BUILD): $(PATCHES)

#---------------------------------------------------------------------------------
$(PATCHES):
@[ -d $(DATA) ] || mkdir -p $(DATA)
@$(MAKE) --no-print-directory -C $(dir $(PROJDIR))/$(basename $(notdir $@))
@cp $(dir $(PROJDIR))/$(basename $(notdir $@))/$(notdir $@) $@
@$(OBJCOPY) --remove-section .comment --remove-section .gnu.attributes $@
Expand Down
129 changes: 129 additions & 0 deletions cubeboot/include/gcm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
/*
* gcm.h
*
* GameCube Master
* Copyright (C) 2005-2006 The GameCube Linux Team
* Copyright (C) 2005,2006 Albert Herranz
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*/

#ifndef __GCM_H
#define __GCM_H

#include <stdint.h>

#define GCM_MAGIC 0xc2339f3d

#define GCM_OPENING_BNR "opening.bnr"

struct gcm_disk_info {
char game_code[4];
char maker_code[2];
char disk_id;
char version;
char audio_streaming;
char stream_buffer_size;
char unused_1[18];
uint32_t magic; /* 0xc2339f3d */
} __attribute__ ((__packed__));

struct gcm_disk_layout {
uint32_t dol_offset;
uint32_t fst_offset;
uint32_t fst_size;
uint32_t fst_max_size;
uint32_t user_offset;
uint32_t user_size;
uint32_t disk_size;
char unused_3[4];
} __attribute__ ((__packed__));

/* "boot.bin" */
struct gcm_disk_header {
struct gcm_disk_info info;
char game_name[992];
uint32_t debug_monitor_offset;
uint32_t debug_monitor_address;
char unused_2[24];
struct gcm_disk_layout layout;
} __attribute__ ((__packed__));

/* "bi2.bin" */
struct gcm_disk_header_info {
uint32_t debug_monitor_size;
uint32_t simulated_memory_size;
uint32_t argument_offset;
uint32_t debug_flag;
uint32_t track_location;
uint32_t track_size;
uint32_t country_code;
uint32_t unknown_1;
} __attribute__ ((__packed__));

/* "appldr.bin" */
struct gcm_apploader_header {
char date[10];
char padding_1[6];
uint32_t entry_point;
uint32_t size;
uint32_t trailer_size;
uint32_t unknown_1;
} __attribute__ ((__packed__));

struct gcm_file_entry {
union {
uint8_t flags;
struct {
uint32_t fname_offset;
uint32_t file_offset;
uint32_t file_length;
} file;
struct {
uint32_t fname_offset;
uint32_t parent_directory_offset;
uint32_t this_directory_offset;
} dir;
struct {
uint32_t zeroed_1;
uint32_t zeroed_2;
uint32_t num_entries;
} root_dir;
};
} __attribute__ ((__packed__));

struct gcm_system_area {
struct gcm_disk_header dh;
struct gcm_disk_header_info dhi;

struct gcm_apploader_header al_header;
void *al_image;
off_t al_size; /* aligned to 32 bytes */

void *fst_image;
off_t fst_size; /* aligned to 32 bytes */

void *bnr_image;
off_t bnr_size; /* aligned to 32 bytes */
};


#define DI_SECTOR_SIZE 2048
#define DI_ALIGN 31

#define SYSTEM_AREA_SIZE (16*DI_SECTOR_SIZE)

/*
*
*/
static inline int di_align_size(int size)
{
return ((size + 31) & ~31);
}

#endif /* __GCM_H */

1 change: 1 addition & 0 deletions cubeboot/source/const.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define MAX_BUTTONS 13
1 change: 1 addition & 0 deletions cubeboot/source/halt.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void prog_halt(char *msg) {
console_init(exception_xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
// CON_EnableGecko(EXI_CHANNEL_1, false);
#endif
printf("\n====\nHALT\n====\n");
printf(msg);
#ifdef VIDEO_ENABLE
VIDEO_WaitVSync();
Expand Down
Loading

0 comments on commit 451e442

Please sign in to comment.