Skip to content

Commit

Permalink
== N64 ==
Browse files Browse the repository at this point in the history
- Fixed splash screens thanks to Neko Milkshake
-- MCS Fonts and placement
-- libDragon & tiny3d, fixed proportions
- Fixed typo
  • Loading branch information
ArtemioUrbina committed Dec 19, 2024
1 parent 5551da3 commit 1e75282
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 22 deletions.
3 changes: 2 additions & 1 deletion 240psuite/N64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ $(FILESYSTEM_DIR)/convergence-05-colorsbl.sprite: MKSPRITE_FLAGS=$(MKSPRITE_EXTR
$(FILESYSTEM_DIR)/rectangle_short.sprite: MKSPRITE_FLAGS=$(MKSPRITE_EXTRA_FLAGS) --format CI4
$(FILESYSTEM_DIR)/rectangle_long.sprite: MKSPRITE_FLAGS=$(MKSPRITE_EXTRA_FLAGS) --format CI4

$(FILESYSTEM_DIR)/BebasNeue-Regular.font64: MKFONT_FLAGS+=--size 19
$(FILESYSTEM_DIR)/BebasNeue-Regular.font64: MKFONT_FLAGS+=--size 41
$(FILESYSTEM_DIR)/BebasNeue-Small.font64: MKFONT_FLAGS+=--size 15

$(BUILD_DIR)/$(PROJECT_NAME).dfs: $(ASSETS_PNG_CONV) $(ASSETS_WAV_CONV) $(ASSETS_HELP) $(ASSETS_GLTF_CONV) $(ASSETS_TTF_CONV)
$(BUILD_DIR)/$(PROJECT_NAME).elf: $(src:%.c=$(BUILD_DIR)/%.o)
Expand Down
Binary file modified 240psuite/N64/assets/libdragon.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 modified 240psuite/N64/assets/tiny3d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion 240psuite/N64/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void freeUpscaleFB();
void executeUpscaleFB();

/* Palette functions */
#define LOGO_HOLD 60
#define LOGO_HOLD 30

void swapPaletteColors(image *data, unsigned int color1, unsigned int color2);
void swapPalette100to75(image *data);
Expand Down
62 changes: 43 additions & 19 deletions 240psuite/N64/mcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "video.h"

#define AMBIENT 135
#define BGCOLOR 0xbb
#define BGCOLOR 0xee
#define FADE_FRAMES 30
#define DISTANCE 300.0f

Expand All @@ -45,7 +45,8 @@
#define HOLD_3D 2
#define FADE_3D 3

#define MCS_FONT 1
#define MCS_FONT_REGULAR 1
#define MCS_FONT_SMALL 2

// #8969FF
#define FONT_R 0x89
Expand All @@ -64,7 +65,8 @@ typedef struct scenaData_st {
uint8_t colorBG;
T3DVec3 lightDirVec;
T3DModel *modelMCS;
rdpq_font_t *font;
rdpq_font_t *fontRegular;
rdpq_font_t *fontSmall;
uint8_t colorFont[4];
float rotAngle;
} SceneData;
Expand All @@ -83,14 +85,20 @@ void freeSceneData(SceneData *scene) {
scene->modelMCS = NULL;
}

if(scene->font) {
rdpq_text_unregister_font(MCS_FONT);
rdpq_font_free(scene->font);
scene->font = NULL;
if(scene->fontRegular) {
rdpq_text_unregister_font(MCS_FONT_REGULAR);
rdpq_font_free(scene->fontRegular);
scene->fontRegular = NULL;
}

if(scene->fontSmall) {
rdpq_text_unregister_font(MCS_FONT_SMALL);
rdpq_font_free(scene->fontSmall);
scene->fontSmall = NULL;
}
}

int load3DScene(SceneData *scene) {
int load3DScene(SceneData *scene, int controls) {
memset(scene, 0, sizeof(SceneData));

scene->depthBuffer = surface_alloc(FMT_RGBA16, getHardWidth(), getHardHeight());
Expand All @@ -109,10 +117,10 @@ int load3DScene(SceneData *scene) {

scene->camPos.v[0] = 0.0f;
scene->camPos.v[1] = 4.0f;
scene->camPos.v[2] = 50.0f;
scene->camPos.v[2] = controls ? 50.0f : 60.0f;

scene->camTarget.v[0] = 0.0f;
scene->camTarget.v[1] = 0.0f;
scene->camTarget.v[1] = controls ? 0.0f : -10.0f;
scene->camTarget.v[2] = 0.0f;

scene->colorAmbient[0] = 0;
Expand Down Expand Up @@ -140,8 +148,16 @@ int load3DScene(SceneData *scene) {
return 0;
}

scene->font = rdpq_font_load("rom:/BebasNeue-Regular.font64");
if(!scene->font) {
scene->fontRegular = rdpq_font_load("rom:/BebasNeue-Regular.font64");
if(!scene->fontRegular) {
freeSceneData(scene);
return 0;
}

rdpq_text_register_font(MCS_FONT_REGULAR, scene->fontRegular);

scene->fontSmall = rdpq_font_load("rom:/BebasNeue-Small.font64");
if(!scene->fontSmall) {
freeSceneData(scene);
return 0;
}
Expand All @@ -151,9 +167,13 @@ int load3DScene(SceneData *scene) {
scene->colorFont[2] = FONT_B;
scene->colorFont[3] = 0;

rdpq_text_register_font(MCS_FONT, scene->font);
rdpq_text_register_font(MCS_FONT_SMALL, scene->fontSmall);

rdpq_font_style(scene->font, 0, &(rdpq_fontstyle_t){
rdpq_font_style(scene->fontRegular, 0, &(rdpq_fontstyle_t){
.color = RGBA32(scene->colorFont[0], scene->colorFont[1], scene->colorFont[2], scene->colorFont[3]),
});

rdpq_font_style(scene->fontSmall, 0, &(rdpq_fontstyle_t){
.color = RGBA32(scene->colorFont[0], scene->colorFont[1], scene->colorFont[2], scene->colorFont[3]),
});

Expand Down Expand Up @@ -247,19 +267,22 @@ int draw3DScene(SceneData *scene, int frames, int type, int controls) {
t3d_matrix_pop(1);

if(!controls) {
rdpq_font_style(scene->font, 0, &(rdpq_fontstyle_t){
rdpq_font_style(scene->fontRegular, 0, &(rdpq_fontstyle_t){
.color = RGBA32(scene->colorFont[0], scene->colorFont[1], scene->colorFont[2], scene->colorFont[3]),
});
rdpq_font_style(scene->fontSmall, 0, &(rdpq_fontstyle_t){
.color = RGBA32(scene->colorFont[0], scene->colorFont[1], scene->colorFont[2], scene->colorFont[3]),
});
rdpq_text_printf(&(rdpq_textparms_t){
.width = 300,
.height = 100,
.align = ALIGN_CENTER,
}, MCS_FONT, 10, 10, "Mega Cat Studios");
}, MCS_FONT_REGULAR, 10, 170, "Mega Cat Studios");
rdpq_text_printf(&(rdpq_textparms_t){
.width = 300,
.height = 100,
.align = ALIGN_CENTER,
}, MCS_FONT, 10, 210, "Proud to contribute to the community we love");
}, MCS_FONT_SMALL, 10, 210, "Proud to contribute to the community we love");
}

rdpq_detach_show();
Expand Down Expand Up @@ -326,9 +349,10 @@ int draw3DScene(SceneData *scene, int frames, int type, int controls) {

int drawMCSScreen(int frames, int controls) {
int cancel = 0;

SceneData scene;

if(!load3DScene(&scene))
if(!load3DScene(&scene, controls))
return 0;

t3d_init((T3DInitParams){});
Expand All @@ -338,7 +362,7 @@ int drawMCSScreen(int frames, int controls) {
// Regular scene
if(!cancel)
cancel = draw3DScene(&scene, frames+4, ROTATE_3D, controls);
if(draw3DScene(&scene, !cancel ? ceil(frames/2) : ceil(frames/8), HOLD_3D, controls))
if(draw3DScene(&scene, !cancel ? ceil(frames/2) : ceil(frames/12), HOLD_3D, controls))
cancel = true;
// Fade and zoom out
(void)draw3DScene(&scene, FADE_FRAMES, FADE_3D, controls);
Expand Down
2 changes: 1 addition & 1 deletion 240psuite/N64/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void drawCredits(int usebuffer) {
drawStringS(x+5, y, 0xff, 0xff, 0xff, "Jose Salot\n(@pepe_salot)"); y += 2*fh;
drawStringS(x2, y2, 0x00, 0xff, 0x00, "Menu Pixel Art:"); y2 += fh;
drawStringS(x2+5, y2, 0xff, 0xff, 0xff, "Asher"); y2 += fh;
drawStringS(x, y, 0x00, 0xff, 0x00, "Puiblished by:"); y += fh;
drawStringS(x, y, 0x00, 0xff, 0x00, "Published by:"); y += fh;
drawStringS(x+5, y, 0xff, 0xff, 0xff, "Mega Cat Studios"); y += fh;
drawStringS(x, y, 0x00, 0xff, 0x00, "Advisor:"); y += fh;
drawStringS(x+5, y, 0xff, 0xff, 0xff, "Fudoh"); y += fh;
Expand Down

0 comments on commit 1e75282

Please sign in to comment.