From: falcovorbis <fal...@us...> - 2024-02-01 05:18:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 489035c46024c93aa8a4daa4efa1eaa56fde29f0 (commit) via c1ce7faf29100891e49d98fe2b760ec793fe6256 (commit) via 6220f330c91a02f4def0126aa27c2abc972f73eb (commit) from 4db9950241c058af8b638506624976dd03a3dc13 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 489035c46024c93aa8a4daa4efa1eaa56fde29f0 Author: Jason Rost <152...@us...> Date: Wed Jan 31 22:17:51 2024 -0700 1-31-24 - Modified Makefile to remove redundant -x in Make Run target. Cleaned up main.cpp unused var (#480) commit c1ce7faf29100891e49d98fe2b760ec793fe6256 Author: Jason Rost <152...@us...> Date: Wed Jan 31 09:35:22 2024 -0700 Fix for examples/dreamcast/video/multibuffer Makefile (#479) Fixed Makefile issue using spaces instead of tabs in for multibuffer in dreamcast/video commit 6220f330c91a02f4def0126aa27c2abc972f73eb Author: Donald Haase <qu...@ya...> Date: Mon Jan 29 17:59:16 2024 -0500 Small Fixes from DCPlaya's KOS branch (#476) * Prevent loading multiple drivers for one function * Prevent double init or uninitted shutdown of ramdisk * Shortcut boosting the currently running thread ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/gldc/2D_tex_quad/Makefile | 2 +- examples/dreamcast/gldc/2D_tex_quad/main.cpp | 3 --- examples/dreamcast/video/multibuffer/Makefile | 12 ++++++------ kernel/arch/dreamcast/hardware/maple/maple_driver.c | 6 ++++++ kernel/fs/fs_ramdisk.c | 9 +++++++++ kernel/thread/thread.c | 4 ++++ 6 files changed, 26 insertions(+), 10 deletions(-) diff --git a/examples/dreamcast/gldc/2D_tex_quad/Makefile b/examples/dreamcast/gldc/2D_tex_quad/Makefile index 0d0fd51b..d2d0f908 100644 --- a/examples/dreamcast/gldc/2D_tex_quad/Makefile +++ b/examples/dreamcast/gldc/2D_tex_quad/Makefile @@ -38,4 +38,4 @@ rm-elf: -rm -f $(TARGET) run: $(TARGET) - $(KOS_LOADER) -x $(TARGET) + $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/gldc/2D_tex_quad/main.cpp b/examples/dreamcast/gldc/2D_tex_quad/main.cpp index 33c012bf..780a9113 100644 --- a/examples/dreamcast/gldc/2D_tex_quad/main.cpp +++ b/examples/dreamcast/gldc/2D_tex_quad/main.cpp @@ -162,9 +162,6 @@ int main(int argc, char **argv) { if(state->start) break; - int16_t x_axis = state->joyx; - int16_t y_axis = state->joyy; - //..:: Rotation on Triggers // Rotate CCW if(state->ltrig >= 255) { diff --git a/examples/dreamcast/video/multibuffer/Makefile b/examples/dreamcast/video/multibuffer/Makefile index 30b6b663..f1946edf 100644 --- a/examples/dreamcast/video/multibuffer/Makefile +++ b/examples/dreamcast/video/multibuffer/Makefile @@ -12,17 +12,17 @@ all: rm-elf $(TARGET) include $(KOS_BASE)/Makefile.rules clean: rm-elf - -rm -f $(OBJS) + -rm -f $(OBJS) rm-elf: - -rm -f $(TARGET) + -rm -f $(TARGET) $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) + kos-cc -o $(TARGET) $(OBJS) run: $(TARGET) - $(KOS_LOADER) $(TARGET) + $(KOS_LOADER) $(TARGET) dist: $(TARGET) - -rm -f $(OBJS) - $(KOS_STRIP) $(TARGET) + -rm -f $(OBJS) + $(KOS_STRIP) $(TARGET) diff --git a/kernel/arch/dreamcast/hardware/maple/maple_driver.c b/kernel/arch/dreamcast/hardware/maple/maple_driver.c index 4bb44067..c91d3dbb 100644 --- a/kernel/arch/dreamcast/hardware/maple/maple_driver.c +++ b/kernel/arch/dreamcast/hardware/maple/maple_driver.c @@ -26,6 +26,12 @@ void maple_detach_callback(uint32 functions, maple_detach_callback_t cb) { /* Register a maple device driver; do this before maple_init() */ int maple_driver_reg(maple_driver_t *driver) { + /* Don't add two drivers for the same function */ + maple_driver_t *i; + LIST_FOREACH(i, &maple_state.driver_list, drv_list) + if(i->functions & driver->functions) + return -1; + /* Insert it into the device list */ LIST_INSERT_HEAD(&maple_state.driver_list, driver, drv_list); return 0; diff --git a/kernel/fs/fs_ramdisk.c b/kernel/fs/fs_ramdisk.c index c3cccefa..0628ec73 100644 --- a/kernel/fs/fs_ramdisk.c +++ b/kernel/fs/fs_ramdisk.c @@ -846,6 +846,10 @@ int fs_ramdisk_detach(const char * fn, void ** obj, size_t * size) { /* Initialize the file system */ int fs_ramdisk_init(void) { + /* Test if initted */ + if(rootdir != NULL) + return -1; + /* Create an empty root dir */ if(!(rootdir = (rd_dir_t *)malloc(sizeof(rd_dir_t)))) return -1; @@ -885,6 +889,11 @@ int fs_ramdisk_init(void) { /* De-init the file system */ int fs_ramdisk_shutdown(void) { rd_file_t *f1, *f2; + + /* Test if initted */ + if(rootdir == NULL) + return -1; + /* For now assume there's only the root dir, since mkdir and rmdir aren't even implemented... */ f1 = LIST_FIRST(rootdir); diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index 1b38f876..6addff22 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -708,6 +708,10 @@ void thd_schedule_next(kthread_t *thd) { if(!irq_inside_int()) return; + /* We're already running now! */ + if(thd == thd_current) + return; + /* Can't boost a blocked thread */ if(thd->state != STATE_READY) return; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |