Permalink
Browse files

added initial cdi support

added support for SPI_REQ_ERROR
fixed SPI_REQ_SES response format
  • Loading branch information...
inolen committed Jun 7, 2017
1 parent 5a8eea2 commit 78cf487c1913a7fa5ac4e00a59c25e61817da9e7
@@ -162,7 +162,9 @@ set(REDREAM_SOURCES
src/core/string.c
src/hw/aica/aica.c
src/hw/arm7/arm7.c
src/hw/gdrom/cdi.c
src/hw/gdrom/disc.c
src/hw/gdrom/gdi.c
src/hw/gdrom/gdrom.c
src/hw/holly/holly.c
src/hw/maple/controller.c
@@ -3,7 +3,7 @@ title: Running
---
```
redream --bios=path/to/dc_boot.bin --flash=path/to/dc_flash.bin <bin or gdi file>
redream --bios=path/to/dc_boot.bin --flash=path/to/dc_flash.bin <cdi, gdi or bin file>
```
Command line flags are loaded from and saved to `$HOME/.redream/flags` each run. This means that bios and flash path, etc. only need to be set on the first run.
@@ -77,20 +77,6 @@ void dc_suspend(struct dreamcast *dc) {
dc->running = 0;
}
static int dc_load_gdi(struct dreamcast *dc, const char *path) {
struct disc *disc = disc_create_gdi(path);
if (!disc) {
return 0;
}
gdrom_set_disc(dc->gdrom, disc);
sh4_reset(dc->sh4, 0xa0000000);
dc_resume(dc);
return 1;
}
static int dc_load_bin(struct dreamcast *dc, const char *path) {
FILE *fp = fopen(path, "rb");
if (!fp) {
@@ -107,7 +93,7 @@ static int dc_load_bin(struct dreamcast *dc, const char *path) {
fclose(fp);
if (n != size) {
LOG_WARNING("BIN read failed");
LOG_WARNING("failed to read %s", path);
return 0;
}
@@ -117,6 +103,20 @@ static int dc_load_bin(struct dreamcast *dc, const char *path) {
return 1;
}
static int dc_load_disc(struct dreamcast *dc, const char *path) {
struct disc *disc = disc_create(path);
if (!disc) {
return 0;
}
gdrom_set_disc(dc->gdrom, disc);
sh4_reset(dc->sh4, 0xa0000000);
dc_resume(dc);
return 1;
}
int dc_load(struct dreamcast *dc, const char *path) {
if (!path) {
/* boot to main menu of no path specified */
@@ -125,14 +125,14 @@ int dc_load(struct dreamcast *dc, const char *path) {
return 1;
}
LOG_INFO("Loading %s", path);
LOG_INFO("loading %s", path);
if ((strstr(path, ".bin") && dc_load_bin(dc, path)) ||
(strstr(path, ".gdi") && dc_load_gdi(dc, path))) {
if (dc_load_disc(dc, path) || dc_load_bin(dc, path)) {
return 1;
}
LOG_WARNING("Failed to load %s", path);
LOG_WARNING("failed to load %s", path);
return 0;
}
Oops, something went wrong.

0 comments on commit 78cf487

Please sign in to comment.