Skip to content

Commit

Permalink
Merge pull request #54 from n64brew/menu
Browse files Browse the repository at this point in the history
It's time
  • Loading branch information
buu342 authored Dec 31, 2024
2 parents ec6ce8d + 639cfdb commit fccc1a5
Show file tree
Hide file tree
Showing 81 changed files with 3,747 additions and 343 deletions.
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,34 @@ MINIGAME_DIR = code
FILESYSTEM_DIR = filesystem
MINIGAMEDSO_DIR = $(FILESYSTEM_DIR)/minigames

SRC = main.c core.c minigame.c menu.c
SRC = main.c core.c minigame.c menu.c logo.c savestate.c results.c setup.c title.c

filesystem/squarewave.font64: MKFONT_FLAGS += --outline 1 --range all
filesystem/squarewave_l.font64: MKFONT_FLAGS += --outline 1 --range all --size 20
filesystem/squarewave_xl.font64: MKFONT_FLAGS += --outline 1 --range all --size 30
filesystem/core/brewlogo.sprite: MKFONT_FLAGS += --format CI4 -c 2
filesystem/core/dragon1.sprite: MKSPRITE_FLAGS += --format I4 -c 2
filesystem/core/dragon2.sprite: MKSPRITE_FLAGS += --format I4 -c 2
filesystem/core/dragon3.sprite: MKSPRITE_FLAGS += --format I4 -c 2
filesystem/core/dragon4.sprite: MKSPRITE_FLAGS += --format I4 -c 2
filesystem/core/dragon.wav64: AUDIOCONV_FLAGS += --wav-resample 32000 --wav-mono --wav-compress 3

###

include $(N64_INST)/include/n64.mk
include $(N64_INST)/include/t3d.mk

N64_ROM_SAVETYPE = eeprom4k

MINIGAMES_LIST = $(notdir $(wildcard $(MINIGAME_DIR)/*))
DSO_LIST = $(addprefix $(MINIGAMEDSO_DIR)/, $(addsuffix .dso, $(MINIGAMES_LIST)))

IMAGE_LIST = $(wildcard $(ASSETS_DIR)/*.png) $(wildcard $(ASSETS_DIR)/core/*.png)
FONT_LIST = $(wildcard $(ASSETS_DIR)/*.ttf)
MODEL_LIST = $(wildcard $(ASSETS_DIR)/*.glb)
MODEL_LIST = $(wildcard $(ASSETS_DIR)/*.glb) $(wildcard $(ASSETS_DIR)/core/*.glb)
SOUND_LIST = $(wildcard $(ASSETS_DIR)/*.wav) $(wildcard $(ASSETS_DIR)/core/*.wav)
SOUND2_LIST = $(wildcard $(ASSETS_DIR)/*.mp3) $(wildcard $(ASSETS_DIR)/core/*.mp3)
MUSIC_LIST = $(wildcard $(ASSETS_DIR)/*.xm)
MUSIC_LIST = $(wildcard $(ASSETS_DIR)/*.xm) $(wildcard $(ASSETS_DIR)/core/*.xm)
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(IMAGE_LIST:%.png=%.sprite))
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(FONT_LIST:%.ttf=%.font64))
ASSETS_LIST += $(subst $(ASSETS_DIR),$(FILESYSTEM_DIR),$(MODEL_LIST:%.glb=%.t3dm))
Expand Down Expand Up @@ -99,4 +109,4 @@ clean:

-include $(wildcard $(BUILD_DIR)/*.d) $(wildcard $(BUILD_DIR)/*/*.d) $(wildcard $(BUILD_DIR)/*/*/*.d) $(wildcard $(BUILD_DIR)/*/*/*/*.d)

.PHONY: all clean
.PHONY: all clean
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ Welcome to this year's N64brew game jam. This year, we are creating a large coll

Please ensure that you are using the **latest** `preview` branch of Libdragon, that you have [Tiny3D](https://github.com/HailToDodongo/tiny3d) installed, and that you are able to compile this ROM without issues. This template has both an OpenGL and [Tiny3D](https://github.com/HailToDodongo/tiny3d) example game. We also recommend that you fork this repository so that you can then perform a pull request for your final project (although you will lose the ability to make your repository private).

Please note that the menu provided by the template **is not final** and will be changed in the final ROM.


### Starting a new minigame

Expand Down
Binary file added assets/btnGame.i4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/btnGame.ia8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/btnRound.ia8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/btnWide.ia8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Box2_Corner.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Box2_Edge.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Box_Back.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Box_Corner.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Box_Edge.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/CircleMask.i8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/CircleProgress.i8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Controller.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Crash.wav
Binary file not shown.
Binary file added assets/core/Cross.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/DrumRoll.wav
Binary file not shown.
Binary file added assets/core/Menus.xm
Binary file not shown.
Binary file added assets/core/Point.wav
Binary file not shown.
Binary file added assets/core/Pointer.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/ResultsWinner.wav
Binary file not shown.
Binary file added assets/core/Robot.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/RouletteDone.wav
Binary file not shown.
Binary file added assets/core/RoulettePlayer.wav
Binary file not shown.
Binary file added assets/core/Tick.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/ToyBox.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/Trophy.rgba32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/beer.rgba16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/brew_logo.glb
Binary file not shown.
Binary file added assets/core/brew_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/cursor.wav
Binary file not shown.
Binary file added assets/core/dragon.mp3
Binary file not shown.
Binary file added assets/core/dragon1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/dragon2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/dragon3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/dragon4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/foam_ref.ci8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/core/glass_back_1.rgba16.png
Binary file added assets/core/glass_reflection_a.i8.png
Binary file added assets/core/logo_env.i8.png
Binary file added assets/core/menu_back.wav
Binary file not shown.
Binary file added assets/core/menu_confirm.wav
Binary file not shown.
Binary file added assets/core/player_join.wav
Binary file not shown.
Binary file added assets/core/player_leave.wav
Binary file not shown.
Binary file added assets/core/title_confirm.wav
Binary file not shown.
Binary file added assets/gradient.i8.png
Binary file added assets/iconPly.ia8.png
Binary file added assets/iconPlySelected.rgba32.png
Binary file added assets/iconStar.ia8.png
Binary file modified assets/n64brew.ia8.png
Binary file added assets/pattern.i8.png
Binary file added assets/preview/boss_fight.m1v
Binary file not shown.
Binary file added assets/slider.i8.png
Binary file added assets/slider.ia4.png
Binary file added assets/squarewave_l.ttf
Binary file not shown.
Binary file added assets/squarewave_xl.ttf
Binary file not shown.
8 changes: 4 additions & 4 deletions code/avanto/avanto.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ $(FILESYSTEM_DIR)/avanto/%.sprite: $(ASSETS_DIR)/avanto/%.png
@echo " [AVANTO SPRITE] $@"
$(N64_MKSPRITE) $(AVANTO MKSPRITE_FLAGS) -o $(dir $@) "$<"

$(FILESYSTEM_DIR)/avanto/banner.font64: $(ASSETS_DIR)/squarewave.ttf
# Generate both fonts at the same time form the same source.
# Usage of pattern rules here is a trick:
# https://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file
$(FILESYSTEM_DIR)/avanto/banner%font64 $(FILESYSTEM_DIR)/avanto/timer%font64: $(ASSETS_DIR)/squarewave.ttf
@mkdir -p $(dir $@)
@echo " [AVANTO FONT] $@"
$(N64_MKFONT) --outline 2 --range 20-5A -s 100 -o $(dir $@) "$<"
mv "$(dir $@)/squarewave.font64" "$@"

$(FILESYSTEM_DIR)/avanto/timer.font64: $(ASSETS_DIR)/squarewave.ttf
@mkdir -p $(dir $@)
@echo " [AVANTO FONT] $@"
$(N64_MKFONT) --outline 1 --range 30-39 -s 48 --ellipsis 30,3 -o $(dir $@) "$<"
mv "$(dir $@)/squarewave.font64" "$@"
25 changes: 13 additions & 12 deletions code/old_gods/AF_Input.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Input contains everything needed to collect input from the system from Libdragon
=================*/
#include <libdragon.h>
#include "AF_Input.h"
#include "../../core.h"
#include "ECS/Entities/AF_ECS.h"

// Key mappings for n64 controller to joypad_button struct, polled from libdragon
Expand Down Expand Up @@ -36,25 +37,25 @@ void AF_Input_Update(AF_Input* _input){
joypad_poll();

// Player 1
joypad_inputs_t inputs = joypad_get_inputs(JOYPAD_PORT_1);
joypad_buttons_t pressed1 = joypad_get_buttons_pressed(JOYPAD_PORT_1);
joypad_buttons_t held1 = joypad_get_buttons_held(JOYPAD_PORT_1);
joypad_inputs_t inputs = joypad_get_inputs(core_get_playercontroller(PLAYER_1));
joypad_buttons_t pressed1 = joypad_get_buttons_pressed(core_get_playercontroller(PLAYER_1));
joypad_buttons_t held1 = joypad_get_buttons_held(core_get_playercontroller(PLAYER_1));

// Player 2
joypad_inputs_t inputs2 = joypad_get_inputs(JOYPAD_PORT_2);
joypad_buttons_t pressed2 = joypad_get_buttons_pressed(JOYPAD_PORT_2);
joypad_buttons_t held2 = joypad_get_buttons_held(JOYPAD_PORT_2);
joypad_inputs_t inputs2 = joypad_get_inputs(core_get_playercontroller(PLAYER_2));
joypad_buttons_t pressed2 = joypad_get_buttons_pressed(core_get_playercontroller(PLAYER_2));
joypad_buttons_t held2 = joypad_get_buttons_held(core_get_playercontroller(PLAYER_2));


// Player 3
joypad_inputs_t inputs3 = joypad_get_inputs(JOYPAD_PORT_3);
joypad_buttons_t pressed3 = joypad_get_buttons_pressed(JOYPAD_PORT_3);
joypad_buttons_t held3 = joypad_get_buttons_held(JOYPAD_PORT_3);
joypad_inputs_t inputs3 = joypad_get_inputs(core_get_playercontroller(PLAYER_3));
joypad_buttons_t pressed3 = joypad_get_buttons_pressed(core_get_playercontroller(PLAYER_3));
joypad_buttons_t held3 = joypad_get_buttons_held(core_get_playercontroller(PLAYER_3));

// Player 4
joypad_inputs_t inputs4 = joypad_get_inputs(JOYPAD_PORT_4);
joypad_buttons_t pressed4 = joypad_get_buttons_pressed(JOYPAD_PORT_4);
joypad_buttons_t held4 = joypad_get_buttons_held(JOYPAD_PORT_4);
joypad_inputs_t inputs4 = joypad_get_inputs(core_get_playercontroller(PLAYER_4));
joypad_buttons_t pressed4 = joypad_get_buttons_pressed(core_get_playercontroller(PLAYER_4));
joypad_buttons_t held4 = joypad_get_buttons_held(core_get_playercontroller(PLAYER_4));

// flush the keys
for(int i = 0; i < AF_INPUT_KEYS_MAPPED; ++i){
Expand Down
6 changes: 3 additions & 3 deletions code/paintball/src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ void Player::render(uint32_t id, T3DViewport &viewport, float deltaTime, MapRend

t3d_mat4fp_from_srt_euler(
matFP.get(),
(float[3]){0.12f+displayTemperature, 0.12f+displayTemperature, 0.12f+displayTemperature},
(float[3]){0.0f, direction, 0},
currentPos.v
T3DVec3{0.12f+displayTemperature, 0.12f+displayTemperature, 0.12f+displayTemperature},
T3DVec3{0.0f, direction, 0},
currentPos
);

rdpq_sync_pipe();
Expand Down
20 changes: 10 additions & 10 deletions code/sb_halcyon/control/controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ void controllerData_rumbleFrames(ControllerData *data, uint8_t port, uint8_t fra

void controllerData_getInputs(ControllerData *data, uint8_t port)
{
data->pressed = joypad_get_buttons_pressed(port);
data->held = joypad_get_buttons_held(port);
data->released = joypad_get_buttons_released(port);
data->input = joypad_get_inputs(port);
data->pressed = joypad_get_buttons_pressed(core_get_playercontroller(port));
data->held = joypad_get_buttons_held(core_get_playercontroller(port));
data->released = joypad_get_buttons_released(core_get_playercontroller(port));
data->input = joypad_get_inputs(core_get_playercontroller(port));

// Check if the rumble pak has been unplugged
if (!joypad_get_rumble_supported(port))
controllerData_rumbleStop(data, port);
if (!joypad_get_rumble_supported(core_get_playercontroller(port)))
controllerData_rumbleStop(data, core_get_playercontroller(port));
}

/* RUMBLE */

// Set rumble to active state
void controllerData_rumbleStart(ControllerData *data, uint8_t port)
{
joypad_set_rumble_active(port, true);
joypad_set_rumble_active(core_get_playercontroller(port), true);
data->rumble_time = 0;
data->rumble_active = true;
}

// Reset rumble to idle state
void controllerData_rumbleStop(ControllerData *data, uint8_t port)
{
joypad_set_rumble_active(port, false);
joypad_set_rumble_active(core_get_playercontroller(port), false);
data->rumble_time = 0;
data->rumble_active = false;
}
Expand All @@ -57,13 +57,13 @@ void controllerData_rumbleFrames(ControllerData *data, uint8_t port, uint8_t fra

if (data->rumble_active == false)
{
controllerData_rumbleStart(data, port);
controllerData_rumbleStart(data, core_get_playercontroller(port));
}

data->rumble_time++;

if (data->rumble_time >= frames)
controllerData_rumbleStop(data, port);
controllerData_rumbleStop(data, core_get_playercontroller(port));
}

///// 8 WAY /////
Expand Down
12 changes: 6 additions & 6 deletions code/sb_holes/render.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ void render_scene(game_data *game, scene_data *scene)
if (game->scene == INTRO)
{

players[0].btn.pressed = joypad_get_buttons_pressed(PLAYER_1);
players[0].btn.held = joypad_get_buttons_held(PLAYER_1);
players[0].btn.released = joypad_get_buttons_released(PLAYER_1);
players[0].btn.pressed = joypad_get_buttons_pressed(core_get_playercontroller(PLAYER_1));
players[0].btn.held = joypad_get_buttons_held(core_get_playercontroller(PLAYER_1));
players[0].btn.released = joypad_get_buttons_released(core_get_playercontroller(PLAYER_1));
ui_intro(&players[0].btn);
if (players[0].btn.pressed.start)
{
Expand Down Expand Up @@ -121,9 +121,9 @@ void render_scene(game_data *game, scene_data *scene)
}
else if (game->scene == PAUSE)
{
players[0].btn.pressed = joypad_get_buttons_pressed(PLAYER_1);
players[0].btn.held = joypad_get_buttons_held(PLAYER_1);
players[0].btn.released = joypad_get_buttons_released(PLAYER_1);
players[0].btn.pressed = joypad_get_buttons_pressed(core_get_playercontroller(PLAYER_1));
players[0].btn.held = joypad_get_buttons_held(core_get_playercontroller(PLAYER_1));
players[0].btn.released = joypad_get_buttons_released(core_get_playercontroller(PLAYER_1));
ui_pause(&players[0].btn);
if (players[0].btn.pressed.start)
game->scene = GAMEPLAY;
Expand Down
2 changes: 1 addition & 1 deletion code/sb_holes/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ void ui_intro(control_data *control)
ui_spriteDraw(TILE3, sprite_faceButtons0, 0, 152, 66);
}

joypad_inputs_t joypad = joypad_get_inputs(PLAYER_1);
joypad_inputs_t joypad = joypad_get_inputs(core_get_playercontroller(PLAYER_1));

ui_spriteDraw(TILE5, sprite_controlStick, 0, 134, 86);
int stickX = 134 + (joypad.stick_x / 15);
Expand Down
20 changes: 10 additions & 10 deletions code/sb_hot/control/controls.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ void controllerData_rumbleFrames(ControllerData *data, uint8_t port, uint8_t fra

void controllerData_getInputs(ControllerData *data, uint8_t port)
{
data->pressed = joypad_get_buttons_pressed(port);
data->held = joypad_get_buttons_held(port);
data->released = joypad_get_buttons_released(port);
data->input = joypad_get_inputs(port);
data->pressed = joypad_get_buttons_pressed(core_get_playercontroller(port));
data->held = joypad_get_buttons_held(core_get_playercontroller(port));
data->released = joypad_get_buttons_released(core_get_playercontroller(port));
data->input = joypad_get_inputs(core_get_playercontroller(port));

// Check if the rumble pak has been unplugged
if (!joypad_get_rumble_supported(port))
controllerData_rumbleStop(data, port);
if (!joypad_get_rumble_supported(core_get_playercontroller(port)))
controllerData_rumbleStop(data, core_get_playercontroller(port));
}

/* RUMBLE */

// Set rumble to active state
void controllerData_rumbleStart(ControllerData *data, uint8_t port)
{
joypad_set_rumble_active(port, true);
joypad_set_rumble_active(core_get_playercontroller(port), true);
data->rumble_time = 0;
data->rumble_active = true;
}

// Reset rumble to idle state
void controllerData_rumbleStop(ControllerData *data, uint8_t port)
{
joypad_set_rumble_active(port, false);
joypad_set_rumble_active(core_get_playercontroller(port), false);
data->rumble_time = 0;
data->rumble_active = false;
}
Expand All @@ -57,13 +57,13 @@ void controllerData_rumbleFrames(ControllerData *data, uint8_t port, uint8_t fra

if (data->rumble_active == false)
{
controllerData_rumbleStart(data, port);
controllerData_rumbleStart(data, core_get_playercontroller(port));
}

data->rumble_time++;

if (data->rumble_time >= frames)
controllerData_rumbleStop(data, port);
controllerData_rumbleStop(data, core_get_playercontroller(port));
}

///// 8 WAY /////
Expand Down
Loading

0 comments on commit fccc1a5

Please sign in to comment.