Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
Initial Commit II
Browse files Browse the repository at this point in the history
Initial Commit but with the useful files.
  • Loading branch information
TheWindowsPro98 committed Aug 21, 2023
1 parent e62a9aa commit e586c9c
Show file tree
Hide file tree
Showing 39 changed files with 1,276 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export GDK ?= /opt/toolchains/mars/m68k-elf
MMLNK = $(CTRMML_DIR)/mdslink
MMLNK_ARGS = -o ./res/mdsseq.bin ./res/mdsbin.bin -h ./res/mdsseq.h
mdsdrv:
ifndef CTRMML_DIR
$(error "Can not find MDSDRV music linker! Please set the CTRMML_DIR environment variable to its path.")
else
$(MMLNK) $(MMLNK_ARGS) res/mus/*.mds
endif
include $(GDK)/makefile.gen
2 changes: 2 additions & 0 deletions build.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/fish
make mdsdrv && make release && blastem ./out/rom.bin
10 changes: 10 additions & 0 deletions inc/bsod.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

#include "includes.h"

enum stopCodes {genericErr,featureNotFound,regionInvalid,menuIndexInvalid};


/// @brief Shows a BSOD.
/// @param stopcode The error code.
void killExec(u32 stopcode);
11 changes: 11 additions & 0 deletions inc/includes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once

#include <genesis.h>
#include "palettes.h"
#include "image.h"
#include "tiles.h"
#include "spr.h"
#include "mdsdat.h"
#include "mdsdrv.h"
#include "main.h"
#include "bsod.h"
24 changes: 24 additions & 0 deletions inc/main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once

#include "includes.h"

enum consoleRegions {ntscJPN = 0x20, ntscUSA = 0xA0, palEUR = 0xE0, palJPN = 0x60};

typedef struct
{
u8 x;
u8 y;
char* label;
}Option;

extern u8 palFadeTime;
extern u8 vblankRate;
extern const u8* region;
extern u8* currentIndex;

#define MUSIC_FADE MDS_fade(127,7,TRUE)
#define PAL_FADE_OUT PAL_fadeOutAll(palFadeTime,TRUE);
#define CLEAR_BG1 VDP_clearPlane(BG_A,TRUE);
#define CLEAR_BG2 VDP_clearPlane(BG_B,TRUE);
#define TILE_TO_PIXEL(tile) (tile << 3)
#define SELECTION_SFX MDS_request(MDS_SE1,BGM_SFX_S1SELECT)
8 changes: 8 additions & 0 deletions inc/palettes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

#include "includes.h"

extern const u16 segaPalette[32];
extern const u16 titlePalette[32];
extern const u16 playerPalettes[4][16];
extern const u16 bsodPalette[16];
19 changes: 19 additions & 0 deletions res/aseprite/pal/stephanie.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
JASC-PAL
0100
16
238 0 238
0 0 0
68 68 136
102 102 170
136 136 204
170 170 238
238 238 238
0 204 102
0 136 68
0 102 68
0 68 68
136 68 34
170 102 68
204 136 102
0 0 0
0 0 0
Binary file added res/aseprite/stephanie.aseprite
Binary file not shown.
9 changes: 9 additions & 0 deletions res/image.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifndef _RES_IMAGE_H_
#define _RES_IMAGE_H_

extern const Image sega_fg;
extern const Image sega_bg;
extern const Image title_logo;
extern const Image title_bg;

#endif // _RES_IMAGE_H_
4 changes: 4 additions & 0 deletions res/image.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
IMAGE sega_fg "image/sega.png" BEST ALL
IMAGE sega_bg "image/sega_clr.png" BEST ALL
IMAGE title_logo "image/title.png" BEST ALL
IMAGE title_bg "image/title_bg.png" BEST ALL
Binary file added res/image/sega.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 res/image/sega_clr.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 res/image/title.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 res/image/title_bg.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 res/mdsbin.bin
Binary file not shown.
8 changes: 8 additions & 0 deletions res/mdsdat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#ifndef _RES_MDSDAT_H_
#define _RES_MDSDAT_H_

extern const u8 mdsdrvdat[8202];
extern const u8 mdsseqdat[2176];
extern const u8 mdspcmdat[61516];

#endif // _RES_MDSDAT_H_
3 changes: 3 additions & 0 deletions res/mdsdat.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BIN mdsdrvdat "mdsdrv.bin" 2 2 0 NONE FALSE
BIN mdsseqdat "mdsseq.bin" 2 2 0 NONE FALSE
BIN mdspcmdat "mdsbin.bin" 32768 2 0 NONE FALSE
Binary file added res/mdsdrv.bin
Binary file not shown.
Binary file added res/mdsseq.bin
Binary file not shown.
7 changes: 7 additions & 0 deletions res/mdsseq.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#define BGM_MIN 1
#define BGM_MUS_CLI2 1
#define BGM_MUS_S2BLVS 2
#define BGM_MUS_S3CLEAR 3
#define BGM_SFX_S1SELECT 4
#define BGM_SFX_SEGA 5
#define BGM_MAX 5
Binary file added res/mus/mus_cli2.mds
Binary file not shown.
Binary file added res/mus/mus_s2blvs.mds
Binary file not shown.
Binary file added res/mus/mus_s3clear.mds
Binary file not shown.
Binary file added res/mus/sfx_s1-select.mds
Binary file not shown.
Binary file added res/mus/sfx_sega.mds
Binary file not shown.
6 changes: 6 additions & 0 deletions res/spr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _RES_SPR_H_
#define _RES_SPR_H_

extern const SpriteDefinition cursor;

#endif // _RES_SPR_H_
1 change: 1 addition & 0 deletions res/spr.res
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPRITE cursor "spr/cursor.png" 1 1 BEST 0
Binary file added res/spr/cursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions res/tiles.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef _RES_TILES_H_
#define _RES_TILES_H_

extern const TileSet main_font;
extern const TileSet bsodFont;

#endif // _RES_TILES_H_
2 changes: 2 additions & 0 deletions res/tiles.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
TILESET main_font "tiles/font_menu.png" BEST NONE
TILESET bsodFont "tiles/font_lc.png" BEST NONE
Binary file added res/tiles/font_lc.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 res/tiles/font_menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions src/boot/rom_head.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include "genesis.h"

__attribute__((externally_visible))
const ROMHeader rom_header = {
#if (ENABLE_BANK_SWITCH != 0)
"SEGA SSF ",
#elif (MODULE_MEGAWIFI != 0)
"SEGA MEGAWIFI ",
#else
"SEGA MEGA DRIVE ",
#endif
"(C)RD23 2023.AUG",
"PROJECT DAISY MEGADRIVE BUILD 20230820",
"PROJECT DAISY GENESIS BUILD 20230820",
"GM 88688463-00",
0x000,
"JD ",
0x00000000,
#if (ENABLE_BANK_SWITCH != 0)
0x003FFFFF,
#else
0x000FFFFF,
#endif
0xE0FF0000,
0xE0FFFFFF,
"RA",
0xF820,
0x00200000,
0x0020FFFF,
" ",
"193 days remaining; it's a new day ",
"JUE "
};
Loading

0 comments on commit e586c9c

Please # to comment.