Skip to content

Commit

Permalink
Merge pull request #1655 from grumpycoders/chores-code-format
Browse files Browse the repository at this point in the history
[Chores] Format code
  • Loading branch information
nicolasnoble committed Jun 21, 2024
2 parents c760b6f + 4ff91ef commit ded898f
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 150 deletions.
1 change: 0 additions & 1 deletion src/mips/openbios/main/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ SOFTWARE.
#pragma once

#include "common/hardware/hwregs.h"

#include "common/psxlibc/setjmp.h"

// The original 700B01 kernel clears the watchdog using inline code in some
Expand Down
38 changes: 12 additions & 26 deletions src/mips/openbios/main/splash.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,10 @@ SOFTWARE.
#include "common/hardware/gpu.h"
#include "common/hardware/hwregs.h"

static const union Color s_colors[] = {
{ .r = 255, .g = 255, .b = 255 },
{ .r = 255, .g = 255, .b = 0 },
{ .r = 0, .g = 255, .b = 255 },
{ .r = 0, .g = 255, .b = 0 },
{ .r = 255, .g = 0, .b = 255 },
{ .r = 255, .g = 0, .b = 0 },
{ .r = 0, .g = 0, .b = 255 },
{ .r = 0, .g = 0, .b = 0 }
};
static const union Color s_colors[] = {{.r = 255, .g = 255, .b = 255}, {.r = 255, .g = 255, .b = 0},
{.r = 0, .g = 255, .b = 255}, {.r = 0, .g = 255, .b = 0},
{.r = 255, .g = 0, .b = 255}, {.r = 255, .g = 0, .b = 0},
{.r = 0, .g = 0, .b = 255}, {.r = 0, .g = 0, .b = 0}};

// The original version of this function (as found in the 573 BIOS) invokes a
// subroutine repeatedly in order to draw each color bar, rather than using an
Expand All @@ -49,29 +43,21 @@ static const union Color s_colors[] = {
// implementation.
void drawSplashScreen() {
#ifdef OPENBIOS_SHOW_SPLASH_SCREEN
struct DisplayModeConfig config = {
.hResolution = HR_256,
.vResolution = VR_240,
.videoMode = VM_NTSC,
.colorDepth = CD_15BITS,
.videoInterlace = VI_OFF,
.hResolutionExtended = HRE_NORMAL
};
struct DisplayModeConfig config = {.hResolution = HR_256,
.vResolution = VR_240,
.videoMode = VM_NTSC,
.colorDepth = CD_15BITS,
.videoInterlace = VI_OFF,
.hResolutionExtended = HRE_NORMAL};

GPU_STATUS = 0x00000000; // Reset
GPU_STATUS = 0x00000000; // Reset
setDisplayArea(0, 0);
setHorizontalRange(0, 256 * 10);
setVerticalRange(16, 255);
setDisplayMode(&config);

const int barCount = sizeof(s_colors) / sizeof(union Color);
struct FastFill ff = {
.c = 0,
.x = 0,
.y = 0,
.w = 256 / barCount,
.h = 240
};
struct FastFill ff = {.c = 0, .x = 0, .y = 0, .w = 256 / barCount, .h = 240};

for (int i = 0; i < barCount; i++, ff.x += ff.w) {
ff.c.packed = s_colors[i].packed;
Expand Down
6 changes: 2 additions & 4 deletions src/mips/openbios/pio/pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ static const char *const licenseText = "Licensed by Sony Computer Entertainment

void runExp1PreHook() {
#ifndef OPENBIOS_BOARD_SYS573
if (is_running_from_rom() && (strcmp(preHookInfo->signature, licenseText) == 0))
preHookInfo->vector();
if (is_running_from_rom() && (strcmp(preHookInfo->signature, licenseText) == 0)) preHookInfo->vector();
#endif
}

void runExp1PostHook() {
#ifndef OPENBIOS_BOARD_SYS573
if (is_running_from_rom() && (strcmp(postHookInfo->signature, licenseText) == 0))
postHookInfo->vector();
if (is_running_from_rom() && (strcmp(postHookInfo->signature, licenseText) == 0)) postHookInfo->vector();
#endif
}
2 changes: 1 addition & 1 deletion src/mips/openbios/shell/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ SOFTWARE.
*/

#include "openbios/main/main.h"
#include "openbios/shell/shell.h"

#include <memory.h>
Expand All @@ -33,6 +32,7 @@ SOFTWARE.
#include <string.h>

#include "openbios/kernel/flushcache.h"
#include "openbios/main/main.h"

extern const uint8_t _binary_shell_bin_start[];
extern const uint8_t _binary_shell_bin_end[];
Expand Down
Loading

0 comments on commit ded898f

Please sign in to comment.