Skip to content

Commit 6a8baad

Browse files
committed
Update to 0.81
- Updated to SWAT's new DreamShell-independent FatFs - Menu now loads faster - Remove extraneous source code and cleaned up files - Final size is reduced - Removed GDPlay asm
1 parent 934ac35 commit 6a8baad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2648
-10358
lines changed

Makefile

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,10 @@ endif
1313
HAVE_MKDCDISC := $(shell command -v mkdcdisc 2> /dev/null)
1414

1515
## Objects
16-
FATFS = src/ds/src/fs/fat
17-
DRIVERS = src/ds/src/drivers
18-
UTILS = src/ds/src/utils
19-
2016
OBJS = src/main.o src/menu.o src/disc.o src/log.o src/utility.o \
21-
src/bmfont.o src/descramble.o src/drawing.o src/input.o \
22-
$(DRIVERS)/rtc.o $(DRIVERS)/sd.o $(DRIVERS)/spi.o \
23-
$(FATFS)/../fs.o $(FATFS)/ff.o $(FATFS)/dc.o $(FATFS)/utils.o \
24-
$(FATFS)/option/ccsbcs.o $(FATFS)/option/syscall.o \
25-
$(UTILS)/../exec.o $(UTILS)/memcpy.o $(UTILS)/memset.o
17+
src/bmfont.o src/drawing.o src/input.o \
18+
src/fatfs/dc.o src/fatfs/dc_bdev.o src/fatfs/ff.o \
19+
src/fatfs/option/ccsbcs.o src/fatfs/option/syscall.o
2620

2721
## Resources
2822
RELEASE_DIR = release
@@ -34,7 +28,6 @@ ROMDISK_FILES = ebdragon.fnt ebdragon.tex $(WALLPAPER_FILE)
3428
GZ_ROMDISK_FILES = dcload-ip.bin dcload-serial.bin rungd.bin
3529

3630
## Flags
37-
KOS_CFLAGS += -Isrc -Isrc/ds/include -Isrc/ds/include/fatfs
3831
KOS_CFLAGS += -DWALLPAPER_FILE="$(WALLPAPER_FILE)" -DWALLPAPER_RES=$(WALLPAPER_RES)
3932
KOS_CFLAGS += -DDASH_VERSION="$(VERSION)"
4033
ifneq ($(AUTOBOOT),0)
@@ -83,7 +76,7 @@ $(TARGET).bin: release-dir $(TARGET).elf
8376

8477
$(TARGET).cdi: release-dir $(TARGET).elf
8578
ifneq ($(HAVE_MKDCDISC),)
86-
mkdcdisc --author $(TARGET) -e $(TARGET).elf --no-mr -n $(TARGET)-$(VERSION) -r 20240818 -o release/$(TARGET).cdi
79+
mkdcdisc --author $(TARGET) -e $(TARGET).elf --no-mr -n $(TARGET)-$(VERSION) -r 20250125 -o release/$(TARGET).cdi
8780
else
8881
$(info mkdcdisc utility not found in PATH. Skipping CDI generation.)
8982
endif

Makefile.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
TARGET = dreamdash
33

44
# Project version
5-
VERSION = 0.8
5+
VERSION = 0.81
66

77
# Autoboot applications if found
88
AUTOBOOT = 0

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ DreamDash is a replacement BIOS for Dreamcast power users and developers. It req
2525
## How to Use
2626
- [Set up KallistiOS on your computer](https://dreamcast.wiki/Getting_Started_with_Dreamcast_development).
2727
- Compile KOS and the `zlib`/`libpng` kos-ports with `-Os` and `-flto=auto` in your `KOS_CFLAGS` to keep code size small.
28-
- KOS master with commit ID `4346a85` is known to work properly.
28+
- KOS master with commit ID `03b51ef` is known to work properly.
2929
- Open a terminal and source your KOS environment, clone this repo, and change into this repo's directory.
3030
- Run `make` to build `dreamdash.elf`. Run `kos-strip dreamdash.elf` and check the filesize. If larger than 500KB, it may not work and can produce a non-working BIOS image, so check your `KOS_CFLAGS` and try again.
3131
- Run `make all` to build everything. Check the `release` directory for generated files:
@@ -37,6 +37,9 @@ DreamDash is a replacement BIOS for Dreamcast power users and developers. It req
3737
- BIOS files with `nogdrom` are used on consoles with no GD-ROM drive installed (**currently untested!**)
3838
- BIOS files with `32mb` are used on consoles with 32MB RAM modification
3939
- Use DreamShell's BIOS Flasher application to write the `.bios` file to a Dreamcast's writeable BIOS flashROM.
40+
41+
## Discussion
42+
A chat room is available on the [dreamcast.wiki Discord server](https://discord.gg/Bs6Fe4stzE). Join us!
4043

4144
## Acknowledgements
4245
- **KallistiOS** and **DreamShell** - kernel and drivers for the underlying operating system

src/bmfont.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdio.h>
22
#include <stdlib.h>
33
#include <string.h>
4+
45
#include "bmfont.h"
56

67
int bmf_parse(const char *fntPath, BMFont *bmFont) {

src/descramble.c

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/disc.c

Lines changed: 54 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,22 @@
1010
#include <kos.h>
1111
#include <stdlib.h>
1212
#include <zlib/zlib.h>
13+
1314
#include "disc.h"
1415
#include "log.h"
1516
#include "utility.h"
1617

18+
#define RUNGZ_FILE "/rd/rungd.bin.gz"
1719
#define RUNGZ_SIZE 65280
1820

1921
ip_meta_t *ip_info;
20-
static void *bios_patch;
2122
static int cmd_response;
2223
static int status;
2324
static int disc_type;
2425

2526
kthread_t *check_gdrom_thd;
2627
int kill_gdrom_thd = 0;
2728

28-
extern void gdplay_run_game(void *bios_patch);
29-
3029
static void set_info() {
3130
int lba = 45150;
3231
char pbuff[2048];
@@ -66,30 +65,38 @@ static void set_info() {
6665
return;
6766
}
6867

69-
printf("\nDisc header info:\n");
70-
printf(" Hardware ID:\t%.*s\n", 16, ip_info->hardware_ID);
71-
printf(" Maker ID:\t%.*s\n", 16, ip_info->maker_ID);
72-
printf(" Header CRC:\t%.*s\n", 5, ip_info->ks);
73-
printf(" Disc Number:\t%c of %c\n", ip_info->disk_num[0], ip_info->disk_num[2]);
74-
printf(" Region(s):\t%.*s\n", 3, ip_info->country_codes);
75-
printf(" Control:\t%.*s\n", 4, ip_info->ctrl);
76-
printf(" Devices:\t%.*s\n", 1, ip_info->dev);
77-
printf(" VGA support:\t%s\n", ip_info->VGA[0] == '1'? "Yes":"No");
78-
printf(" Windows CE:\t%s\n", ip_info->WinCE[0] == '1'? "Yes":"No");
79-
printf(" Product ID:\t%.*s\n", 10, ip_info->product_ID);
80-
printf(" Version:\t%.*s\n", 6, ip_info->product_version);
81-
printf(" Date:\t%c%c%c%c-%c%c-%c%c\n", ip_info->release_date[0],
82-
ip_info->release_date[1],
83-
ip_info->release_date[2],
84-
ip_info->release_date[3],
85-
ip_info->release_date[4],
86-
ip_info->release_date[5],
87-
ip_info->release_date[6],
88-
ip_info->release_date[7]);
89-
printf(" Boot file:\t%.*s\n", 16, ip_info->boot_file);
90-
printf(" Developer:\t%.*s\n", 16, ip_info->software_maker_info);
91-
printf(" Title:\t%.*s\n", 128, ip_info->title);
92-
68+
printf("\nDisc header info:\n"
69+
"\tHardware ID:\t%.*s\n"
70+
"\tMaker ID:\t%.*s\n"
71+
"\tHeader CRC:\t%.*s\n"
72+
"\tDisc Number:\t%c of %c\n"
73+
"\tRegion(s):\t%.*s\n"
74+
"\tControl:\t%.*s\n"
75+
"\tDevices:\t%.*s\n"
76+
"\tVGA support:\t%s\n"
77+
"\tWindows CE:\t%s\n"
78+
"\tProduct ID:\t%.*s\n"
79+
"\tVersion:\t%.*s\n"
80+
"\tDate:\t\t%c%c%c%c-%c%c-%c%c\n"
81+
"\tBoot file:\t%.*s\n"
82+
"\tDeveloper:\t%.*s\n"
83+
"\tTitle:\t\t%.*s\n",
84+
16, ip_info->hardware_ID,
85+
16, ip_info->maker_ID,
86+
5, ip_info->ks,
87+
ip_info->disk_num[0], ip_info->disk_num[2],
88+
3, ip_info->country_codes,
89+
4, ip_info->ctrl,
90+
1, ip_info->dev,
91+
ip_info->VGA[0] == '1' ? "Yes" : "No",
92+
ip_info->WinCE[0] == '1' ? "Yes" : "No",
93+
10, ip_info->product_ID,
94+
6, ip_info->product_version,
95+
ip_info->release_date[0], ip_info->release_date[1], ip_info->release_date[2], ip_info->release_date[3],
96+
ip_info->release_date[4], ip_info->release_date[5], ip_info->release_date[6], ip_info->release_date[7],
97+
16, ip_info->boot_file,
98+
16, ip_info->software_maker_info,
99+
128, ip_info->title);
93100
fflush(stdout);
94101
}
95102

@@ -124,26 +131,36 @@ static void *check_gdrom() {
124131

125132
void disc_launch(void) {
126133
printf("Shutting down KOS and lauching disc... have fun!\n\n");
127-
fflush(stdout);
128-
kill_gdrom_thd = 1;
129-
thd_join(check_gdrom_thd, NULL);
130134

131-
bios_patch = decompress_file_aligned("/rd/rungd.bin.gz", 32, RUNGZ_SIZE);
135+
/* Open syscalls patch */
136+
gzFile rungz = gzopen(RUNGZ_FILE, "rb");
137+
if(!rungz) {
138+
dash_log(DBG_ERROR, "Error opening %s!", RUNGZ_FILE);
139+
return;
140+
}
132141

133-
if(!bios_patch) {
134-
dash_log(DBG_ERROR, "Error with BIOS patch!");
142+
/* Decompress patched syscalls into place */
143+
if(gzread(rungz, (void *)0x8C000100, RUNGZ_SIZE) != RUNGZ_SIZE) {
144+
dash_log(DBG_ERROR, "Error decompressing %s!", RUNGZ_FILE);
135145
return;
136146
}
137147

138-
gdplay_run_game(bios_patch);
148+
/* Clean up */
149+
gzclose(rungz);
150+
disc_shutdown();
151+
fflush(stdout);
152+
153+
/* Disable and invalidate the cache */
154+
*(volatile unsigned long *)0xFF00001C = 0x0808;
155+
156+
/* Bye bye! */
157+
((void (*)(volatile unsigned short))0x8C000120)(0xFFF);
158+
__builtin_unreachable();
139159
}
140160

141161
void disc_shutdown(void) {
142162
kill_gdrom_thd = 1;
143163
thd_join(check_gdrom_thd, NULL);
144-
145-
if(bios_patch)
146-
free(bios_patch);
147164
}
148165

149166
int disc_init(void) {

src/drawing.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#include <png/png.h>
22
#include <string.h>
3-
#include "drawing.h"
3+
44
#include "bmfont.h"
5+
#include "drawing.h"
56

67
static BMFont bmf_font;
78
static pvr_ptr_t bmf_tex = NULL;

src/ds/include/drivers/g1_ide.h

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/ds/include/drivers/rtc.h

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)