You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(35) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(37) |
Feb
(10) |
Mar
|
Apr
(2) |
May
(17) |
Jun
(1) |
Jul
(14) |
Aug
(14) |
Sep
(4) |
Oct
|
Nov
(14) |
Dec
(4) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(6) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(92) |
Dec
(12) |
2006 |
Jan
(3) |
Feb
(4) |
Mar
|
Apr
(5) |
May
(3) |
Jun
(15) |
Jul
(3) |
Aug
(1) |
Sep
(29) |
Oct
(1) |
Nov
(6) |
Dec
(5) |
2007 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
(3) |
May
(14) |
Jun
(2) |
Jul
(16) |
Aug
(73) |
Sep
(12) |
Oct
(9) |
Nov
(27) |
Dec
(3) |
2008 |
Jan
(4) |
Feb
(4) |
Mar
(3) |
Apr
(8) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(7) |
Oct
(5) |
Nov
(1) |
Dec
(1) |
2009 |
Jan
|
Feb
(10) |
Mar
|
Apr
(4) |
May
(4) |
Jun
(10) |
Jul
|
Aug
(1) |
Sep
|
Oct
(7) |
Nov
|
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
|
Apr
(6) |
May
|
Jun
(3) |
Jul
(11) |
Aug
(1) |
Sep
|
Oct
(15) |
Nov
(1) |
Dec
(5) |
2011 |
Jan
(4) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(22) |
Jun
|
Jul
(8) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2012 |
Jan
|
Feb
(10) |
Mar
(1) |
Apr
(6) |
May
(27) |
Jun
(48) |
Jul
(30) |
Aug
(4) |
Sep
|
Oct
(3) |
Nov
(1) |
Dec
(11) |
2013 |
Jan
(4) |
Feb
(7) |
Mar
(6) |
Apr
(18) |
May
(28) |
Jun
(20) |
Jul
|
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(7) |
2014 |
Jan
(3) |
Feb
(2) |
Mar
(4) |
Apr
(9) |
May
(11) |
Jun
(10) |
Jul
|
Aug
(18) |
Sep
(12) |
Oct
(17) |
Nov
(10) |
Dec
(16) |
2015 |
Jan
(5) |
Feb
(1) |
Mar
(5) |
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(6) |
Oct
|
Nov
(2) |
Dec
(1) |
2016 |
Jan
(14) |
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
(3) |
Jul
(4) |
Aug
(4) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(1) |
2017 |
Jan
(11) |
Feb
|
Mar
(21) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(2) |
Sep
(4) |
Oct
(4) |
Nov
|
Dec
(1) |
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(13) |
Sep
(4) |
Oct
|
Nov
|
Dec
|
2020 |
Jan
(10) |
Feb
(9) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(18) |
Jul
(4) |
Aug
(2) |
Sep
(20) |
Oct
(2) |
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
2022 |
Jan
(1) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(5) |
Sep
|
Oct
(1) |
Nov
|
Dec
(1) |
2023 |
Jan
(10) |
Feb
(7) |
Mar
(29) |
Apr
(31) |
May
(29) |
Jun
(34) |
Jul
(3) |
Aug
(24) |
Sep
(22) |
Oct
(10) |
Nov
(38) |
Dec
(27) |
2024 |
Jan
(15) |
Feb
(8) |
Mar
(4) |
Apr
(20) |
May
(33) |
Jun
(18) |
Jul
(15) |
Aug
(23) |
Sep
(26) |
Oct
(32) |
Nov
(6) |
Dec
(4) |
2025 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
(4) |
May
(46) |
Jun
(19) |
Jul
(21) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: ljsebald <ljs...@us...> - 2024-01-11 04:41:58
|
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 1d95eff07fa77034e006d5eb4cc6c26925ce8ef8 (commit) via 87460c89342c52c567c45304c19356407321462f (commit) via b5370b75ec8d7cf7c90b5f9f7ee99414f064e64c (commit) via f9e296e6071e9cf63dbb25abc682d4e8bf18b2d5 (commit) via fc3392e7e26e987670f2309b9e815d2348dd567b (commit) via 37072da716aefcbe89bbf26985c71cfffd0068bb (commit) via 0018443b3dfd30ce451130bca0ad17a382797637 (commit) via f3e3e213ca0cbecc01875340b5cd72b244c93dc2 (commit) via 9e47264c7fe2f34f81945c58ea6e2d1ec6d9ee6d (commit) from 95a16abc543b202cdbe3597883df441e93c06ab4 (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 1d95eff07fa77034e006d5eb4cc6c26925ce8ef8 Merge: 87460c8 f3e3e21 Author: Lawrence Sebald <ljs...@us...> Date: Wed Jan 10 23:40:59 2024 -0500 Merge pull request #451 from KallistiOS/chain-upgrades dc-chain: Allow fp precision adjustments; update configurations commit 87460c89342c52c567c45304c19356407321462f Merge: b5370b7 37072da Author: Lawrence Sebald <ljs...@us...> Date: Wed Jan 10 23:39:43 2024 -0500 Merge pull request #458 from KallistiOS/cmake_update Fixed Romdisks and Added Bin2Object Support to CMake Toolchain commit b5370b75ec8d7cf7c90b5f9f7ee99414f064e64c Merge: f9e296e 0018443 Author: Lawrence Sebald <ljs...@us...> Date: Wed Jan 10 23:38:35 2024 -0500 Merge pull request #455 from KallistiOS/abort_retval Changed abort() to call arch_abort() commit f9e296e6071e9cf63dbb25abc682d4e8bf18b2d5 Merge: fc3392e 9e47264 Author: Lawrence Sebald <ljs...@us...> Date: Wed Jan 10 23:37:45 2024 -0500 Merge pull request #449 from KallistiOS/newnewlib Add support for Newlib 4.4.0 commit fc3392e7e26e987670f2309b9e815d2348dd567b Author: Andy Barajas <and...@gm...> Date: Wed Jan 10 20:36:30 2024 -0800 Fix serpent_dma example (#448) * Update sq usage in example commit 37072da716aefcbe89bbf26985c71cfffd0068bb Author: Falco Girgis <gyr...@gm...> Date: Wed Jan 10 15:50:53 2024 -0600 CMake Toolchain Update - Toolchain now supports the new romdisk model - Toolchain automatically includes the CMake utility file containing other functions - All functions are namespace scoped by kos_ - genromfs is no longer accessed via the environment variable, so only KOS_BASE needs to be set in the toolchain as an external env variable - kos_add_binary() was added as a wrapper around bin2o which adds the resulting object file to the target automatically commit 0018443b3dfd30ce451130bca0ad17a382797637 Author: Falco Girgis <gyr...@gm...> Date: Tue Jan 9 01:35:11 2024 -0600 Changed abort() to call arch_abort() - abort() should 1) not return a successful result code 2) should not invoke the atexit() finalizers upon being called, both of which were happening - Changed abort() to call arch_abort(), which is a hasty shutdown without calling atexit() finalizers that will also return EXIT_FAILURE. commit f3e3e213ca0cbecc01875340b5cd72b244c93dc2 Author: darc <da...@pr...> Date: Thu Jan 4 15:47:41 2024 -0600 dc-chain: Allow fp precision adjustments; update configurations commit 9e47264c7fe2f34f81945c58ea6e2d1ec6d9ee6d Author: darc <da...@pr...> Date: Wed Jan 3 22:44:06 2024 -0600 Add support for Newlib 4.4.0 ----------------------------------------------------------------------- Summary of changes: AUTHORS | 4 +- examples/dreamcast/parallax/serpent_dma/serpent.c | 7 ++- kernel/libc/koslib/abort.c | 10 ++-- kernel/libc/newlib/newlib_getentropy.c | 8 +++ utils/cmake/dreamcast.cmake | 58 +++++++++++++++++----- utils/cmake/dreamcast.toolchain.cmake | 20 +++----- utils/dc-chain/config/README.md | 14 +++--- utils/dc-chain/config/config.mk.10.5.0.sample | 23 +++++++-- utils/dc-chain/config/config.mk.11.4.0.sample | 23 +++++++-- utils/dc-chain/config/config.mk.12.3.0.sample | 23 +++++++-- ...mk.devel.sample => config.mk.13.2.1-dev.sample} | 42 ++++++++++------ ...mk.devel.sample => config.mk.14.0.1-dev.sample} | 31 +++++++++--- ...legacy.sample => config.mk.4.7.4-legacy.sample} | 23 +++++++-- ....9.3.0.sample => config.mk.9.3.0-legacy.sample} | 23 +++++++-- ...-latest.sample => config.mk.9.5.0-winxp.sample} | 23 +++++++-- utils/dc-chain/config/config.mk.stable.sample | 23 +++++++-- utils/dc-chain/docker/Dockerfile | 2 +- .../{gcc-devel-kos.diff => gcc-13.2.1-kos.diff} | 50 +++++++++---------- .../{gcc-devel-kos.diff => gcc-14.0.1-kos.diff} | 56 ++++++++++----------- ...120-kos.diff => newlib-4.4.0.20231231-kos.diff} | 42 ++++++++-------- utils/dc-chain/scripts/build.mk | 2 +- 21 files changed, 332 insertions(+), 175 deletions(-) copy utils/dc-chain/config/{config.mk.devel.sample => config.mk.13.2.1-dev.sample} (84%) rename utils/dc-chain/config/{config.mk.devel.sample => config.mk.14.0.1-dev.sample} (86%) rename utils/dc-chain/config/{config.mk.legacy.sample => config.mk.4.7.4-legacy.sample} (89%) rename utils/dc-chain/config/{config.mk.9.3.0.sample => config.mk.9.3.0-legacy.sample} (89%) rename utils/dc-chain/config/{config.mk.winxp-latest.sample => config.mk.9.5.0-winxp.sample} (89%) copy utils/dc-chain/patches/{gcc-devel-kos.diff => gcc-13.2.1-kos.diff} (70%) rename utils/dc-chain/patches/{gcc-devel-kos.diff => gcc-14.0.1-kos.diff} (69%) copy utils/dc-chain/patches/{newlib-4.3.0.20230120-kos.diff => newlib-4.4.0.20231231-kos.diff} (80%) diff --git a/AUTHORS b/AUTHORS index 8e8923d..0110f61 100644 --- a/AUTHORS +++ b/AUTHORS @@ -42,11 +42,11 @@ Josh Pearson: 2013, 2014, 2015, 2016 Joe Fenton: 2016 Stefan Galowicz: 2016, 2017 Luke Benstead: 2020, 2021, 2022, 2023 -Eric Fradella: 2023 +Eric Fradella: 2023, 2024 Falco Girgis: 2023 Ruslan Rostovtsev: 2014, 2016, 2023 Colton Pawielski: 2023 -Andy Barajas: 2023 +Andy Barajas: 2023, 2024 Paul Cercueil: 2023 Files with Specific licenses: diff --git a/examples/dreamcast/parallax/serpent_dma/serpent.c b/examples/dreamcast/parallax/serpent_dma/serpent.c index 0a2736d..741513f 100644 --- a/examples/dreamcast/parallax/serpent_dma/serpent.c +++ b/examples/dreamcast/parallax/serpent_dma/serpent.c @@ -129,10 +129,8 @@ static void draw_sphere(sphere_t *s, int list) { /* Transform and write vertices to the TA via the store queues */ vd = (pvr_vertex_t *)pvr_vertbuf_tail(list); - QACR0 = ((((uint32)vd) >> 26) << 2) & 0x1c; - QACR1 = ((((uint32)vd) >> 26) << 2) & 0x1c; - sqd = (void *) - (0xe0000000 | (((uint32)vd) & 0x03ffffe0)); + sq_lock(vd); + sqd = (void *) SQ_MASK_DEST_ADDR(vd); /* { int o = irq_disable(); printf("transforming to %p, len %d\n", @@ -141,6 +139,7 @@ static void draw_sphere(sphere_t *s, int list) { } */ mat_transform_sq(v, sqd, s->stacks * (s->slices + 2)); + sq_unlock(); pvr_vertbuf_written(list, 32 * s->stacks * (s->slices + 2)); diff --git a/kernel/libc/koslib/abort.c b/kernel/libc/koslib/abort.c index d7cab16..da46bfd 100644 --- a/kernel/libc/koslib/abort.c +++ b/kernel/libc/koslib/abort.c @@ -1,15 +1,17 @@ /* KallistiOS ##version## abort.c - (c)2001 Megan Potter - + Copyright (C) 2001 Megan Potter + Copyright (C) 2024 Falco Girgis */ #include <stdlib.h> #include <arch/arch.h> -/* This is probably the closest mapping we've got for abort() */ +/* abort() causes abnormal/erroneous program termination + WITHOUT calling the atexit() handlers. This will eventually + return EXIT_FAILURE as the program's return code. */ __used void abort(void) { - arch_exit(); + arch_abort(); } diff --git a/kernel/libc/newlib/newlib_getentropy.c b/kernel/libc/newlib/newlib_getentropy.c index 5345182..add21b4 100644 --- a/kernel/libc/newlib/newlib_getentropy.c +++ b/kernel/libc/newlib/newlib_getentropy.c @@ -12,7 +12,15 @@ #include <arch/arch.h> +/* We provide getentropy() if using Newlib < 4.4.0 */ +#if __NEWLIB__ < 4 || (__NEWLIB__ == 4 && __NEWLIB_MINOR__ < 4) int getentropy(void *ptr, size_t len) { +#else +/* getentropy() is provided by Newlib >= 4.4.0, + but we must provide _getentropy_r() */ +int _getentropy_r(void *re, void *ptr, size_t len) { + (void)re; +#endif const int block_size = 128; struct timeval tv; uint8_t *src = ((uint8_t *)_arch_mem_top); diff --git a/utils/cmake/dreamcast.cmake b/utils/cmake/dreamcast.cmake index 8095511..97d8ffd 100644 --- a/utils/cmake/dreamcast.cmake +++ b/utils/cmake/dreamcast.cmake @@ -1,9 +1,40 @@ cmake_minimum_required(VERSION 3.23) +### Helper Function for Bin2Object ### +function(kos_bin2o inFile symbol) + # outFile is optional and defaults to the symbol name in the build directory + if(NOT ${ARGC} EQUAL 3) + set(outFile ${CMAKE_CURRENT_BINARY_DIR}/${symbol}.o) + else() + set(outFile ${ARGN}) + endif() + + # Custom Command to generate romdisk object file from image + add_custom_command( + OUTPUT ${outFile} + DEPENDS ${inFile} + COMMAND $ENV{KOS_BASE}/utils/bin2o/bin2o ${inFile} ${symbol} ${outFile} + ) +endfunction() + +function(kos_add_binary target inFile symbol) + set(outFile ${CMAKE_BINARY_DIR}/${symbol}.o) + kos_bin2o(${inFile} ${symbol} ${outFile}) + target_sources(${target} PRIVATE ${outFile}) +endfunction() + ### Helper Function for Generating Romdisk ### -function(generate_romdisk target romdiskName romdiskPath) - set(obj ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}.o) - set(img ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}.img) +function(kos_add_romdisk target romdiskPath) + # Name is optional and defaults to "romdisk" + if(NOT ${ARGC} EQUAL 3) + set(romdiskName romdisk) + else() + set(romdiskName ${ARGN}) + endif() + + set(obj ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}.o) + set(obj_tmp ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}_tmp.o) + set(img ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}.img) # Variable holding all files in the romdiskPath folder # CONFIGURE_DEPENDS causes the folder to always be rechecked @@ -16,16 +47,19 @@ function(generate_romdisk target romdiskName romdiskPath) # Only run when folder contents have changed by depending on # the romdiskFiles variable add_custom_command( - OUTPUT ${img} - COMMAND $ENV{KOS_GENROMFS} -f ${img} -d ${romdiskPath} -v + OUTPUT ${img} DEPENDS ${romdiskFiles} -) + COMMAND $ENV{KOS_BASE}/utils/genromfs/genromfs -f ${img} -d ${romdiskPath} -v + ) + + kos_bin2o(${img} ${romdiskName} ${obj_tmp}) - # Custom Command to generate romdisk object file from image -add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${romdiskName}.o - COMMAND $ENV{KOS_BASE}/utils/bin2o/bin2o ${img} ${romdiskName} ${obj} - DEPENDS ${img} + # Custom Command to generate romdisk object file from image + add_custom_command( + OUTPUT ${obj} + DEPENDS ${obj_tmp} + COMMAND ${CMAKE_C_COMPILER} -o ${obj} -r ${obj_tmp} -L${KOS_BASE}/lib/dreamcast -Wl,--whole-archive -lromdiskbase + COMMAND rm ${obj_tmp} ) # Append romdisk object to target @@ -33,7 +67,7 @@ add_custom_command( endfunction() ### Function to Enable SH4 Math Optimizations ### -function(enable_sh4_math) +function(kos_enable_sh4_math) if(NOT ${PLATFORM_DREAMCAST}) message(WARN " PLATFORM_DREAMCAST not set, skipping SH4 Math flags") return() diff --git a/utils/cmake/dreamcast.toolchain.cmake b/utils/cmake/dreamcast.toolchain.cmake index 08fbb0c..ea1e27b 100644 --- a/utils/cmake/dreamcast.toolchain.cmake +++ b/utils/cmake/dreamcast.toolchain.cmake @@ -68,18 +68,12 @@ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) ##### Add Platform-Specific #defines ##### -ADD_DEFINITIONS( - -D__DREAMCAST__ - -D_arch_dreamcast -) +add_compile_definitions(__DREAMCAST__ _arch_dreamcast) if(${KOS_SUBARCH} MATCHES naomi) - ADD_DEFINITIONS( - -D__NAOMI__ - -D_arch_sub_naomi - ) + add_compile_definitions(__NAOMI__ _arch_sub_naomi) else() - ADD_DEFINITIONS(-D_arch_sub_pristine) + add_compile_definitions(_arch_sub_pristine) endif() ##### Configure Build Flags ##### @@ -99,7 +93,7 @@ set(CMAKE_ASM_FLAGS_RELEASE "") ##### Configure Include Directories ##### set(CMAKE_SYSTEM_INCLUDE_PATH "${CMAKE_SYSTEM_INCLUDE_PATH} ${KOS_BASE}/include ${KOS_BASE}/kernel/arch/dreamcast/include ${KOS_BASE}/addons/include ${KOS_PORTS}/include") -INCLUDE_DIRECTORIES( +include_directories( $ENV{KOS_BASE}/include $ENV{KOS_BASE}/kernel/arch/dreamcast/include $ENV{KOS_BASE}/addons/include @@ -117,11 +111,13 @@ endif() add_link_options(-ml -m4-single-only -Wl,--gc-sections -nodefaultlibs) -LINK_DIRECTORIES( +link_directories( ${KOS_BASE}/lib/dreamcast ${KOS_BASE}/addons/lib/dreamcast ${KOS_PORTS}/lib ) add_link_options(-L${KOS_BASE}/lib/dreamcast -L${KOS_BASE}/addons/lib/dreamcast -L${KOS_PORTS}/lib) -LINK_LIBRARIES(-Wl,--start-group -lstdc++ -lkallisti -lc -lgcc -Wl,--end-group m) +link_libraries(-Wl,--start-group -lstdc++ -lkallisti -lc -lgcc -Wl,--end-group -lm) + +include("${KOS_BASE}/utils/cmake/dreamcast.cmake") diff --git a/utils/dc-chain/config/README.md b/utils/dc-chain/config/README.md index 8674b15..14356e7 100644 --- a/utils/dc-chain/config/README.md +++ b/utils/dc-chain/config/README.md @@ -2,16 +2,16 @@ The available templates include the following configurations: | filename | sh4 gcc | newlib | sh4 binutils | arm gcc | arm binutils | notes | |---------:|:-------:|:----------:|:------------:|:-------:|:----------------:|:------| -| config.mk.legacy.sample | 4.7.4 | 2.0.0 | 2.34 | 4.7.4 | 2.34 | older toolchain based on GCC 4<br />former "stable" / "legacy" configuration<br /> [some issues may happen in C++](https://dcemulation.org/phpBB/viewtopic.php?f=29&t=104724) | -| config.mk.9.3.0.sample | 9.3.0 | 3.3.0 | 2.34 | 8.4.0 | 2.34 | older toolchain based on GCC 9<br />former "stable" configuration | -| config.mk.winxp-latest.sample | 9.5.0 | 4.3.0 | 2.34 | 8.5.0 | 2.34 | latest WinXP-compatible toolchain with GCC 9 | +| config.mk.4.7.4-legacy.sample | 4.7.4 | 2.0.0 | 2.34 | 4.7.4 | 2.34 | older toolchain based on GCC 4<br />former "stable" / "legacy" configuration<br /> [some issues may happen in C++](https://dcemulation.org/phpBB/viewtopic.php?f=29&t=104724) | +| config.mk.9.3.0-legacy.sample | 9.3.0 | 3.3.0 | 2.34 | 8.4.0 | 2.34 | older toolchain based on GCC 9<br />former "stable" configuration | +| config.mk.9.5.0-winxp.sample | 9.5.0 | 4.3.0 | 2.34 | 8.5.0 | 2.34 | latest WinXP-compatible toolchain with GCC 9 | | config.mk.10.5.0.sample | 10.5.0 | 4.3.0 | 2.41 | 8.5.0 | 2.41 | modern toolchain with GCC 10 | | config.mk.11.4.0.sample | 11.4.0 | 4.3.0 | 2.41 | 8.5.0 | 2.41 | modern toolchain with GCC 11 | | config.mk.12.3.0.sample | 12.3.0 | 4.3.0 | 2.41 | 8.5.0 | 2.41 | modern toolchain with GCC 12 | -| **config.mk.stable.sample** | **13.2.0** | **4.3.0** | **2.41** | **8.5.0** | **2.41** | **modern toolchain with GCC 13**<br />**current "stable" configuration** | -| config.mk.testing.sample | X | X | X | X | X | most recent GCC release<br />currently none in testing | -| config.mk.devel.sample | git | 4.3.0 | 2.41 | 8.5.0 | 2.41 | latest dev version from git<br />builds as of 2023-07-30 | +| **config.mk.stable.sample** | **13.2.0** | **4.3.0** | **2.41** | **8.5.0** | **2.41** | **modern toolchain with GCC 13.2.0 release**<br />**current "stable" configuration** | +| config.mk.13.2.1-dev.sample | 13.2.1 (git) | 4.4.0 | 2.41 | 8.5.0 | 2.41 | latest GCC 13 development version from git<br />known to build without issues | +| config.mk.14.0.1-dev.sample | 14.0.1 (git) | 4.4.0 | 2.41 | 8.5.0 | 2.41 | latest GCC 14 development version from git<br />builds with caveats, see sample file for more info | -The **stable** configuration is the primary, widely tested target for KallistiOS, and is the most recent toolchain configuration known to work with all example programs. The **testing** configuration contains the most recent release of GCC that builds KallistiOS and the 2ndmix example, and is without any known major issues. The **legacy** configuration contains an older version of the toolchain that may be useful in compiling older software. The alternative configurations are maintained at a low priority and are not guaranteed to build, but feel free to open a bug report if issues are encountered building one of these configurations. +The **stable** configuration is the primary, widely tested target for KallistiOS, and is the most recent toolchain configuration known to work with all example programs. The **legacy** configurations contain an older versions of the toolchain that may be useful in compiling older software. The non-"stable" alternative configurations are maintained at a lower priority and are not guaranteed to build, but feel free to open a bug report if issues are encountered building one of these configurations. Please note that if you choose to install an older version of the GCC compiler, you may be required to use older versions of some of the prerequisites in certain configurations. For instance, building GCC `4.7.4` may require an older version of the `flex` tool be installed. If you receive errors about tools you have installed, check your system's package manager for an older version of that tool. Depending on availability, it may not be possible to build older versions of the toolchain on your platform. diff --git a/utils/dc-chain/config/config.mk.10.5.0.sample b/utils/dc-chain/config/config.mk.10.5.0.sample index c5805b8..937f35b 100644 --- a/utils/dc-chain/config/config.mk.10.5.0.sample +++ b/utils/dc-chain/config/config.mk.10.5.0.sample @@ -112,17 +112,30 @@ makejobs=-j2 # hard drive space. pass2_languages=c,c++,objc,obj-c++ +# Floating point precision support (m4|m4-single|m4-single-only) +# Build support for various SH4 floating-point operation ABIs. KallistiOS only +# officially supports single-precision-only mode. Add m4 (double precision) or +# m4-single (single precision) to build experimental support for those ABIs. +precision_modes=m4-single-only +#precision_modes=m4,m4-single,m4-single-only + +# Default floating point mode (m4|m4-single|m4-single-only) +# Choose the default floating point precision ABI used when GCC is invoked. This +# can be overridden by using passing -m4, -m4-single, or -m4-single-only to GCC. +# KallistiOS currently only supports m4-single-only, so that is the default. +default_precision=m4-single-only + # GCC threading model (single|kos|posix*) -# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you -# should use it. If you really don't want threading support for C++ (or -# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you +# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you +# should use it. If you really don't want threading support for C++ (or +# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you # probably want 'posix' here; but this mode is deprecated as the GCC 3.x branch # is not anymore supported. thread_model=kos # Automatic patching for KOS (1|0) -# Uncomment this if you want to disable applying KOS patches to the toolchain -# source files before building. This will disable usage of the 'kos' thread model. +# Uncomment this if you want to disable applying KOS patches to the toolchain +# source files before building. This will disable usage of the 'kos' thread model. #use_kos_patches=0 # Automatic fixup SH-4 Newlib (1|0) diff --git a/utils/dc-chain/config/config.mk.11.4.0.sample b/utils/dc-chain/config/config.mk.11.4.0.sample index b3d2892..949e718 100644 --- a/utils/dc-chain/config/config.mk.11.4.0.sample +++ b/utils/dc-chain/config/config.mk.11.4.0.sample @@ -112,17 +112,30 @@ makejobs=-j2 # hard drive space. pass2_languages=c,c++,objc,obj-c++ +# Floating point precision support (m4|m4-single|m4-single-only) +# Build support for various SH4 floating-point operation ABIs. KallistiOS only +# officially supports single-precision-only mode. Add m4 (double precision) or +# m4-single (single precision) to build experimental support for those ABIs. +precision_modes=m4-single-only +#precision_modes=m4,m4-single,m4-single-only + +# Default floating point mode (m4|m4-single|m4-single-only) +# Choose the default floating point precision ABI used when GCC is invoked. This +# can be overridden by using passing -m4, -m4-single, or -m4-single-only to GCC. +# KallistiOS currently only supports m4-single-only, so that is the default. +default_precision=m4-single-only + # GCC threading model (single|kos|posix*) -# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you -# should use it. If you really don't want threading support for C++ (or -# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you +# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you +# should use it. If you really don't want threading support for C++ (or +# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you # probably want 'posix' here; but this mode is deprecated as the GCC 3.x branch # is not anymore supported. thread_model=kos # Automatic patching for KOS (1|0) -# Uncomment this if you want to disable applying KOS patches to the toolchain -# source files before building. This will disable usage of the 'kos' thread model. +# Uncomment this if you want to disable applying KOS patches to the toolchain +# source files before building. This will disable usage of the 'kos' thread model. #use_kos_patches=0 # Automatic fixup SH-4 Newlib (1|0) diff --git a/utils/dc-chain/config/config.mk.12.3.0.sample b/utils/dc-chain/config/config.mk.12.3.0.sample index ef590d2..1e1560e 100644 --- a/utils/dc-chain/config/config.mk.12.3.0.sample +++ b/utils/dc-chain/config/config.mk.12.3.0.sample @@ -112,17 +112,30 @@ makejobs=-j2 # hard drive space. pass2_languages=c,c++,objc,obj-c++ +# Floating point precision support (m4|m4-single|m4-single-only) +# Build support for various SH4 floating-point operation ABIs. KallistiOS only +# officially supports single-precision-only mode. Add m4 (double precision) or +# m4-single (single precision) to build experimental support for those ABIs. +precision_modes=m4-single-only +#precision_modes=m4,m4-single,m4-single-only + +# Default floating point mode (m4|m4-single|m4-single-only) +# Choose the default floating point precision ABI used when GCC is invoked. This +# can be overridden by using passing -m4, -m4-single, or -m4-single-only to GCC. +# KallistiOS currently only supports m4-single-only, so that is the default. +default_precision=m4-single-only + # GCC threading model (single|kos|posix*) -# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you -# should use it. If you really don't want threading support for C++ (or -# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you +# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you +# should use it. If you really don't want threading support for C++ (or +# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you # probably want 'posix' here; but this mode is deprecated as the GCC 3.x branch # is not anymore supported. thread_model=kos # Automatic patching for KOS (1|0) -# Uncomment this if you want to disable applying KOS patches to the toolchain -# source files before building. This will disable usage of the 'kos' thread model. +# Uncomment this if you want to disable applying KOS patches to the toolchain +# source files before building. This will disable usage of the 'kos' thread model. #use_kos_patches=0 # Automatic fixup SH-4 Newlib (1|0) diff --git a/utils/dc-chain/config/config.mk.devel.sample b/utils/dc-chain/config/config.mk.13.2.1-dev.sample similarity index 84% copy from utils/dc-chain/config/config.mk.devel.sample copy to utils/dc-chain/config/config.mk.13.2.1-dev.sample index 6ca25e9..8bb10ba 100644 --- a/utils/dc-chain/config/config.mk.devel.sample +++ b/utils/dc-chain/config/config.mk.13.2.1-dev.sample @@ -8,21 +8,21 @@ ############################################################################### ############################################################################### ### THIS CONFIG IS FOR AN EXPERIMENTAL VERSION OF GCC! -## THERE ARE NO KNOWN ISSUES BUILDING THIS VERSION as of 2023-07-30. +## THERE ARE NO KNOWN ISSUES BUILDING THIS VERSION as of 2024-01-04. ############################################################################### ############################################################################### # Toolchain versions for SH sh_binutils_ver=2.41 -sh_gcc_ver=devel -newlib_ver=4.3.0.20230120 +sh_gcc_ver=13.2.1 +newlib_ver=4.4.0.20231231 gdb_ver=14.1 # Tarball extensions to download for SH sh_binutils_download_type=xz sh_gcc_download_type=git sh_gcc_git_repo=git://gcc.gnu.org/git/gcc.git -sh_gcc_git_branch=master +sh_gcc_git_branch=releases/gcc-13 newlib_download_type=gz gdb_download_type=xz @@ -114,25 +114,37 @@ install_mode=install-strip # detected on some OS. makejobs=-j2 -# Languages (c|c++|objc|obj-c++|rust) +# Languages (c|c++|objc|obj-c++) # Set the languages to build for pass 2 of building gcc for sh-elf. The default -# here is to build C, C++, Objective-C, Objective-C++, and Rust. You may want -# to take out some languages if you're not worried about them and/or you're -# short on hard drive space. Only C is required to build KallistiOS, but some -# included examples use other languages. -pass2_languages=c,c++,objc,obj-c++,rust +# here is to build C, C++, Objective C, and Objective C++. You may want to take +# out the latter two if you're not worried about them and/or you're short on +# hard drive space. +pass2_languages=c,c++,objc,obj-c++ + +# Floating point precision support (m4|m4-single|m4-single-only) +# Build support for various SH4 floating-point operation ABIs. KallistiOS only +# officially supports single-precision-only mode. Add m4 (double precision) or +# m4-single (single precision) to build experimental support for those ABIs. +precision_modes=m4-single-only +#precision_modes=m4,m4-single,m4-single-only + +# Default floating point mode (m4|m4-single|m4-single-only) +# Choose the default floating point precision ABI used when GCC is invoked. This +# can be overridden by using passing -m4, -m4-single, or -m4-single-only to GCC. +# KallistiOS currently only supports m4-single-only, so that is the default. +default_precision=m4-single-only # GCC threading model (single|kos|posix*) -# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you -# should use it. If you really don't want threading support for C++ (or -# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you +# With GCC 4.x versions and up, the patches provide a 'kos' thread model, so you +# should use it. If you really don't want threading support for C++ (or +# Objective C/Objective C++), you can set this to 'single'. With GCC 3.x, you # probably want 'posix' here; but this mode is deprecated as the GCC 3.x branch # is not anymore supported. thread_model=kos # Automatic patching for KOS (1|0) -# Uncomment this if you want to disable applying KOS patches to the toolchain -# source files before building. This will disable usage of the 'kos' thread model. +# Uncomment this if you want to disable applying KOS patches to the toolchain +# source files before building. This will disable usage of the 'kos' thread model. #use_kos_patches=0 # Automatic fixup SH-4 Newlib (1|0) diff --git a/utils/dc-chain/config/config.mk.devel.sample b/utils/dc-chain/config/config.mk.14.0.1-dev.sample similarity index 86% rename from utils/dc-chain/config/config.mk.devel.sample rename to utils/dc-chain/config/config.mk.14.0.1-dev.sample index 6ca25e9..1d11597 100644 --- a/utils/dc-chain/config/config.mk.devel.sample +++ b/utils/dc-chain/config/config.mk.14.0.1-dev.sample @@ -8,14 +8,16 @@ ############################################################################### ############################################################################### ### THIS CONFIG IS FOR AN EXPERIMENTAL VERSION OF GCC! -## THERE ARE NO KNOWN ISSUES BUILDING THIS VERSION as of 2023-07-30. +## THERE IS ONE KNOWN ISSUE BUILDING THIS VERSION as of 2024-01-04: +## 1. GCC 14.0.1 currently does not build with m4-single-only precision, which +## is the only officially supported KOS mode for floating-point precision. ############################################################################### ############################################################################### # Toolchain versions for SH sh_binutils_ver=2.41 -sh_gcc_ver=devel -newlib_ver=4.3.0.20230120 +sh_gcc_ver=14.0.1 +newlib_ver=4.4.0.20231231 gdb_ver=14.1 ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-01-07 01:56:13
|
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 95a16abc543b202cdbe3597883df441e93c06ab4 (commit) from 2be7c00f24efd14c7d7d516e7657f047e627272c (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 95a16abc543b202cdbe3597883df441e93c06ab4 Author: SiZiOUS <si...@gm...> Date: Sun Jan 7 02:55:44 2024 +0100 `dc-chain`: Updating documentation (#452) * `dc-chain`: updating macOS documentation for macOS Sonoma * `dc-chain`: updating BSD documentation * `dc-chain`: updating Cygwin documentation * `dc-chain`: updating Alpine documentation * `dc-chain`: updating Debian documentation * `dc-chain`: updating MinGW/MSYS documentation * `dc-chain`: updating MinGW-w64/MSYS2 documentation * `dc-chain`: Update changelog.txt * `dc-chain`: Update CONTRIBUTORS.md * `dc-chain`: Update README.md ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/doc/CONTRIBUTORS.md | 2 +- utils/dc-chain/doc/README.md | 2 +- utils/dc-chain/doc/bsd/README.md | 9 ++++--- utils/dc-chain/doc/changelog.txt | 1 + utils/dc-chain/doc/cygwin/README.md | 7 ++++- utils/dc-chain/doc/linux/alpine.md | 7 ++++- utils/dc-chain/doc/linux/debian.md | 7 ++++- utils/dc-chain/doc/macos/README.md | 50 ++++++++++++++++++++--------------- utils/dc-chain/doc/mingw/mingw-w64.md | 8 +++++- utils/dc-chain/doc/mingw/mingw.md | 8 +++++- 10 files changed, 69 insertions(+), 32 deletions(-) diff --git a/utils/dc-chain/doc/CONTRIBUTORS.md b/utils/dc-chain/doc/CONTRIBUTORS.md index ee5f2f7..bbc6ce3 100644 --- a/utils/dc-chain/doc/CONTRIBUTORS.md +++ b/utils/dc-chain/doc/CONTRIBUTORS.md @@ -13,7 +13,7 @@ * 2012 [Donald Haase](https://github.com/QuzarDC) * 2014 [Christian Groessler](https://github.com/groessler) * 2016, 2017, 2018, 2019, 2020 [Luke Benstead](https://simulant.dev/) -* 2018, 2019, 2020 [SiZiOUS](http://sizious.com/) +* 2018, 2019, 2020, 2021, 2022, 2023, 2024 [Mickaël Cardoso](http://sizious.com/) * 2019 [Ellen Marie Dash](https://gitlab.com/duckinator) * 2020 [Ben Baron](https://github.com/einsteinx2) * 2020 [Jon Daniel](https://github.com/jopadan) diff --git a/utils/dc-chain/doc/README.md b/utils/dc-chain/doc/README.md index 3b05c05..b4531c8 100644 --- a/utils/dc-chain/doc/README.md +++ b/utils/dc-chain/doc/README.md @@ -9,7 +9,7 @@ Tested environments are: - **BSD** (`FreeBSD 11.2`) - **Cygwin** - **GNU/Linux** (`Lubuntu 18.04`, `Alpine Linux 3.11`, `Debian 10.3`) -- **macOS** (`High Sierra 10.13`, `Mojave 10.14`, `Catalina 10.15`); +- **macOS** (`High Sierra 10.13`, `Mojave 10.14`, `Catalina 10.15`, `Sonoma 14.2.1`); - **MinGW/MSYS** - **MinGW-w64/MSYS2** - **Windows Subsystem for Linux (WSL)** (with `Alpine Linux`, `Ubuntu`); regular diff --git a/utils/dc-chain/doc/bsd/README.md b/utils/dc-chain/doc/bsd/README.md index ffbc996..c923496 100644 --- a/utils/dc-chain/doc/bsd/README.md +++ b/utils/dc-chain/doc/bsd/README.md @@ -90,10 +90,13 @@ To make the toolchains, do the following: bash ``` 2. Navigate to the `dc-chain` directory by entering: + ``` + cd /opt/toolchains/dc/kos/utils/dc-chain/ + ``` +3. Provide your own `config.mk`. If you don't know which version + to choose, you may probably use `config.mk.stable.sample` as a template. - cd /opt/toolchains/dc/kos/utils/dc-chain/ - -3. Enter the following to start downloading and building toolchain: +4. Enter the following to start downloading and building toolchain: ``` gmake ``` diff --git a/utils/dc-chain/doc/changelog.txt b/utils/dc-chain/doc/changelog.txt index cd82542..aa685d8 100644 --- a/utils/dc-chain/doc/changelog.txt +++ b/utils/dc-chain/doc/changelog.txt @@ -1,3 +1,4 @@ +2024-01-06: Update documentations (Mickaël Cardoso) 2023-07-31: Update Binutils to 2.41. Verified no regressions in KOS examples compared to current stable GCC 9.3.0, so promoting GCC 13.2.0 configuration to stable. New config directory created to store alternative configurations, currently diff --git a/utils/dc-chain/doc/cygwin/README.md b/utils/dc-chain/doc/cygwin/README.md index fa32c51..ddd2349 100644 --- a/utils/dc-chain/doc/cygwin/README.md +++ b/utils/dc-chain/doc/cygwin/README.md @@ -109,10 +109,15 @@ To make the toolchains, do the following: ``` cd /opt/toolchains/dc/kos/utils/dc-chain/ ``` -3. Enter the following to start downloading and building toolchain: + +3. Provide your own `config.mk`. If you don't know which version + to choose, you may probably use `config.mk.stable.sample` as a template. + +4. Enter the following to start downloading and building toolchain: ``` make ``` + Now it's time to take a coffee as this process is really long: several hours will be needed to make the full toolchains! diff --git a/utils/dc-chain/doc/linux/alpine.md b/utils/dc-chain/doc/linux/alpine.md index 2e9d14b..420122f 100644 --- a/utils/dc-chain/doc/linux/alpine.md +++ b/utils/dc-chain/doc/linux/alpine.md @@ -79,10 +79,15 @@ To make the toolchains, do the following: ``` cd /opt/toolchains/dc/kos/utils/dc-chain/ ``` -2. Enter the following to start downloading and building toolchain: + +2. Provide your own `config.mk`. If you don't know which version + to choose, you may probably use `config.mk.stable.sample` as a template. + +3. Enter the following to start downloading and building toolchain: ``` make ``` + Now it's time to take a coffee as this process is really long: several hours will be needed to make the full toolchains! diff --git a/utils/dc-chain/doc/linux/debian.md b/utils/dc-chain/doc/linux/debian.md index 2dc95ce..e69fc18 100644 --- a/utils/dc-chain/doc/linux/debian.md +++ b/utils/dc-chain/doc/linux/debian.md @@ -80,10 +80,15 @@ To make the toolchains, do the following: ``` cd /opt/toolchains/dc/kos/utils/dc-chain/ ``` -2. Enter the following to start downloading and building toolchain: + +2. Provide your own `config.mk`. If you don't know which version + to choose, you may probably use `config.mk.stable.sample` as a template. + +3. Enter the following to start downloading and building toolchain: ``` make ``` + Now it's time to take a coffee as this process is really long: several hours will be needed to make the full toolchains! diff --git a/utils/dc-chain/doc/macos/README.md b/utils/dc-chain/doc/macos/README.md index abdb542..393e426 100644 --- a/utils/dc-chain/doc/macos/README.md +++ b/utils/dc-chain/doc/macos/README.md @@ -3,27 +3,31 @@ This document contains all the instructions to create a fully working toolchains targeting the **Sega Dreamcast** system under **macOS**. -This document was written when using **macOS** (`10.14 Mojave`) but it should be -applicable on all **macOS** systems. Note that Apple introduced some breaking -changes in `10.14 Mojave`; so starting from that version, some header files have -moved. They have been removed in `10.15 Catalina` and later versions. +This document was initially written while using **macOS** (`10.14 Mojave`) but +it should be applicable on all **macOS** systems. Note that Apple introduced some +breaking changes in `10.14 Mojave`; so starting from that version, some header +files have moved. They have been removed in `10.15 Catalina` and later versions. **dc-chain** supports all modern macOS versions, including `pre-Mojave` releases. +This document has been refreshed using `14.2.1 Sonoma`. + ## Introduction ## On **macOS** system, the package manager is the `brew` tool, which is provided by the [Homebrew project](https://brew.sh). -If you never used the `brew` tool before, you will need to install it. The -procedure to do that is given below. - -All the operations in this document should be executed with the `root` user. To -do that, from a **Terminal** window, input: +If you never used the `brew` tool before, you will need to install it, using +your user session. +All the operations in this document (excepting the `brew` installation and +usage) should be executed with the `root` user. To do that, from a +**Terminal** window, input: + ``` sudo -s - -If you don't want to use the `root` user, another option is to use the `sudo` + ``` + +If you don't want to use the `root` user directly, another option is to use the `sudo` command. In that case, you will need to add the `sudo` command before entering all the commands specified below. @@ -59,24 +63,21 @@ project. This is normal and doesn't affect the **dc-chain** process. As already said in the introduction, the **macOS** system doesn't come with a package manager, but fortunately, the [Homebrew project](https://brew.sh) is -here to fill this gap: +here to fill this gap. -1. Open a **Terminal** window. +Click [here](https://brew.sh) and follow the instructions. Please note, +all operations done using **Homebrew** should be done under your user account, +`root` is not allowed while using `brew`. -2. Execute the following: - ``` - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ``` -**Homebrew** is now installed. You can check if it's working by entering -`brew --version`. +You can check later if `brew` is working by entering `brew --version`. ### Installation of required packages ### The packages below need to be installed: ``` -brew install libjpeg libpng libelf +brew install libjpeg-turbo libpng libelf texinfo ``` -All the other required packages have already been installed, i.e. `git`, `svn` +All the other required packages have already been installed, e.g., `git` or `python`. ## Preparing the environment installation ## @@ -107,10 +108,15 @@ To make the toolchains, do the following: ``` cd /opt/toolchains/dc/kos/utils/dc-chain/ ``` -2. Enter the following to start downloading and building toolchain: + +2. Provide your own `config.mk`. If you don't know which version to choose, + you may probably use `config.mk.stable.sample` as a template. + +3. Enter the following to start downloading and building toolchain: ``` make ``` + Now it's time to take a coffee as this process is really long: several hours will be needed to make the full toolchains! diff --git a/utils/dc-chain/doc/mingw/mingw-w64.md b/utils/dc-chain/doc/mingw/mingw-w64.md index fec7e11..0ba981a 100644 --- a/utils/dc-chain/doc/mingw/mingw-w64.md +++ b/utils/dc-chain/doc/mingw/mingw-w64.md @@ -114,14 +114,20 @@ the main `README.md` file at the root for more information. To make the toolchains, do the following: 1. Start the **MSYS2 Shell** if not already done. + 2. Navigate to the `dc-chain` directory by entering: ``` cd /opt/toolchains/dc/kos/utils/dc-chain/ ``` -3. Enter the following to start downloading and building toolchain: + +3. Provide your own `config.mk`. If you don't know which version + to choose, you may probably use `config.mk.stable.sample` as a template. + +4. Enter the following to start downloading and building toolchain: ``` make ``` + Now it's time to take a coffee as this process is really long: several hours will be needed to make the full toolchains! diff --git a/utils/dc-chain/doc/mingw/mingw.md b/utils/dc-chain/doc/mingw/mingw.md index 455d9e8..01e8831 100644 --- a/utils/dc-chain/doc/mingw/mingw.md +++ b/utils/dc-chain/doc/mingw/mingw.md @@ -179,14 +179,20 @@ the main `README.md` file at the root for more information. To make the toolchains, do the following: 1. Start the **MSYS Shell** if not already done. + 2. Navigate to the `dc-chain` directory by entering: ``` cd /opt/toolchains/dc/kos/utils/dc-chain/ ``` -3. Enter the following to start downloading and building toolchain: + +3. Provide your own `config.mk`. If you don't know which version + to choose, you may probably use `config.mk.stable.sample` as a template. + +4. Enter the following to start downloading and building toolchain: ``` make ``` + Now it's time to take a coffee as this process is really long: several hours will be needed to make the full toolchains! hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2024-01-02 04:19:00
|
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 2be7c00f24efd14c7d7d516e7657f047e627272c (commit) via 351f23c3dd39496dbfe323f368db4f157b762c29 (commit) via 84fdfd89ba0ad6ef52b1c334473ead877b619783 (commit) from 72590d1643c42950485ede92db461964c3e3a0bc (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 2be7c00f24efd14c7d7d516e7657f047e627272c Author: Falco Girgis <gyr...@gm...> Date: Mon Jan 1 22:18:27 2024 -0600 Fixed GLdc Nehe26 Example Build Failure (#443) * Fixed GLdc Nehe26 example build failure - It was definining its "bool" type which was conflicting with a header within kos using <stdbool.h> - Converted the example to use standard C booleans. This is C99/GNU99, after all, shouldn't be doing that in example code that's building with this standard. * Fix comments in gldc/nehe26 commit 351f23c3dd39496dbfe323f368db4f157b762c29 Merge: 72590d1 84fdfd8 Author: Lawrence Sebald <ljs...@us...> Date: Mon Jan 1 23:17:27 2024 -0500 Merge pull request #444 from KallistiOS/kgl_nehe_fix Fix KGL Nehe26 Example Build Failure commit 84fdfd89ba0ad6ef52b1c334473ead877b619783 Author: Falco Girgis <gyr...@gm...> Date: Sat Dec 30 23:49:59 2023 -0600 Fix KGL Nehe26 Example build failure - Also defining its own "bool" type, which conflicts with KOS including <stdbool.h> in a public header file... - Swapping to use <stdbool.h> within the example - While find + replacing "TRUE" and "FALSE," it was pointed out that suddenly comments looked weird, given they're all camel-cased for some reason... It was pointed out that these should really just be translated to real english with this change while I was at it... ;) ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/gldc/nehe/nehe26/nehe26.c | 172 +++++++++++++-------------- examples/dreamcast/kgl/nehe/nehe26/nehe26.c | 152 ++++++++++++----------- 2 files changed, 158 insertions(+), 166 deletions(-) diff --git a/examples/dreamcast/gldc/nehe/nehe26/nehe26.c b/examples/dreamcast/gldc/nehe/nehe26/nehe26.c index 0f4d432..f519516 100644 --- a/examples/dreamcast/gldc/nehe/nehe26/nehe26.c +++ b/examples/dreamcast/gldc/nehe/nehe26/nehe26.c @@ -2,14 +2,15 @@ KallistiOS 2.0.0 nehe26.c - (c)2014 Josh Pearson - (c)2001 Benoit Miller - (c)2000 Jeff Molofee + Copyright (c) 2014 Josh Pearson + Copyright (c) 2001 Benoit Miller + Copyright (c) 2000 Jeff Molofee */ #include <kos.h> #include <stdlib.h> +#include <stdbool.h> #include <GL/gl.h> #include <GL/glu.h> @@ -25,58 +26,53 @@ rotation. */ -/* screen width, height, and bit depth */ +/* Screen width, height, and bit depth */ #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 400 -/* Set up some booleans */ -#define TRUE 1 -#define FALSE 0 -typedef unsigned int bool; - -/* Build Our Vertex Structure */ +/* Build our vertex structure */ typedef struct { - float x, y, z; /* 3D Coordinates */ + float x, y, z; /* 3D coordinates */ } vertex; -/* Build Our Object Structure */ +/* Build our object structure */ typedef struct { - int verts; /* Number Of Vertices For The Object */ - vertex *points; /* One Vertice (Vertex x,y & z) */ + int verts; /* Number of vertices for the object */ + vertex *points; /* One Vertex (Vertex x,y & z) */ } object; GLfloat xrot, yrot, zrot; /* Camera rotation variables */ GLfloat cx, cy, cz = -15; /* Camera pos variable */ -GLfloat xspeed, yspeed, zspeed; /* Spin Speed */ +GLfloat xspeed, yspeed, zspeed; /* Spin speed */ -int key = 1; /* Make Sure Same Morph Key Not Pressed */ -int step = 0, steps = 200; /* Step Counter And Maximum Number Of Steps */ -bool morph = FALSE; /* Default morph To False (Not Morphing) */ +int key = 1; /* Make sure same morph key not pressed */ +int step = 0, steps = 200; /* Step counter and maximum number of steps */ +bool morph = false; /* Default morph to false (not morphing) */ -int maxver; /* Holds The Max Number Of Vertices */ -object morph1, morph2, morph3, morph4, /* Our 4 Morphable Objects */ - helper, *sour, *dest; /* Helper, Source, Destination Object */ +int maxver; /* Holds the max number of vertices */ +object morph1, morph2, morph3, morph4, /* Our 4 morphable objects */ + helper, *sour, *dest; /* Helper, source, destination object */ #define MORPHS 4 -/* function to allocate memory for an object */ +/* Function to allocate memory for an object */ void objallocate(object *k, int n) { - /* Sets points Equal To VERTEX * Number Of Vertices */ + /* Sets points equal to vertex * number of vertices */ k->points = (vertex *)malloc(sizeof(vertex) * n); } -/* function deallocate memory for an object */ +/* Function deallocate memory for an object */ void objfree(object *k) { free(k->points); } -/* function to release/destroy our resources and restoring the old desktop */ +/* Function to release/destroy our resources and restoring the old desktop */ void Quit(int returnCode) { - /* deallocate the objects' memory */ + /* Deallocate the objects' memory */ objfree(&morph1); objfree(&morph2); objfree(&morph3); @@ -87,23 +83,23 @@ void Quit(int returnCode) { /* function Loads Object From File (name) */ void objload(char *name, object *k) { - int ver; /* Will Hold Vertice Count */ - float rx, ry, rz; /* Hold Vertex X, Y & Z Position */ - FILE *filein; /* Filename To Open */ + int ver; /* Will hold vertex count */ + float rx, ry, rz; /* Hold vertex X, Y & Z position */ + FILE *filein; /* Filename to open */ int i; /* Simple loop variable */ printf(" [objload] file: %s\n", name); - /* Opens The File For Reading */ + /* Opens the file for reading */ filein = fopen(name, "r"); /* Reads the number of verts in the file */ fread(&ver, sizeof(int), 1, filein); - /* Sets Objects verts Variable To Equal The Value Of ver */ + /* Sets objects verts variable to equal the value of ver */ k->verts = ver; - /* Jumps To Code That Allocates Ram To Hold The Object */ + /* Jumps to code that allocates RAM to hold the object */ objallocate(k, ver); - /* Loops Through The Vertices */ + /* Loops through the vertices */ for(i = 0; i < ver; i++) { /* Reads the next three verts */ fread(&rx, sizeof(float), 1, filein); @@ -115,18 +111,18 @@ void objload(char *name, object *k) { k->points[i].z = rz; } - /* Close The File */ + /* Close the file */ fclose(filein); - /* If ver Is Greater Than maxver Set maxver Equal To ver */ + /* If ver is greater than maxver set maxver equal to ver */ if(ver > maxver) maxver = ver; } -/* function to calculate Movement Of Points During Morphing */ +/* Function to calculate movement of points during morphing */ vertex calculate(int i) { - vertex a; /* Temporary Vertex Called a */ + vertex a; /* Temporary vertex called 'a' */ /* Calculate x, y, and z movement */ a.x = (sour->points[i].x - dest->points[i].x) / steps; @@ -136,17 +132,17 @@ vertex calculate(int i) { return a; } -/* general OpenGL initialization function */ +/* General OpenGL initialization function */ int initGL(GLvoid) { - int i; /* Simple Looping variable */ + int i; /* Simple looping variable */ - /* Height / width ration */ + /* Height / width ratio */ GLfloat ratio; ratio = SCREEN_WIDTH / SCREEN_HEIGHT; - /* change to the projection matrix and set our viewing volume. */ + /* Change to the projection matrix and set our viewing volume */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -156,40 +152,40 @@ int initGL(GLvoid) { /* Make sure we're changing the model view and not the projection */ glMatrixMode(GL_MODELVIEW); - /* Reset The View */ + /* Reset the view */ glLoadIdentity(); - /* Set The Blending Function For Translucency */ + /* Set the blending function for translucency */ glBlendFunc(GL_SRC_ALPHA, GL_ONE); - /* This Will Clear The Background Color To Black */ + /* This will clear the background color to black */ glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - /* Enables Clearing Of The Depth Buffer */ + /* Enables clearing of the depth buffer */ glClearDepth(1.0); - /* The Type Of Depth Test To Do */ + /* The type of depth test to do */ glDepthFunc(GL_LESS); - /* Enables Depth Testing */ + /* Enables depth testing */ glEnable(GL_DEPTH_TEST); - /* Enables Smooth Color Shading */ + /* Enables smooth color shading */ glShadeModel(GL_SMOOTH); - /* Sets Max Vertices To 0 By Default */ + /* Sets max vertices to 0 by default */ maxver = 0; - /* Load The First Object Into morph1 From File sphere.txt */ + /* Load the first object into morph1 From file sphere.txt */ objload("/rd/sphere.bin", &morph1); - /* Load The Second Object Into morph2 From File torus.txt */ + /* Load the second object into morph2 from file torus.txt */ objload("/rd/torus.bin", &morph2); - /* Load The Third Object Into morph3 From File tube.txt */ + /* Load the third object into morph3 from file tube.txt */ objload("/rd/tube.bin", &morph3); - /* Manually Reserve Ram For A 4th 486 Vertice Object (morph4) */ + /* Manually reserve RAM for a 4th 486 vertex object (morph4) */ objallocate(&morph4, 486); - /* Loop Through All 468 Vertices */ + /* Loop through all 468 vertices */ for(i = 0; i < 486; i++) { /* Generate a random point in xyz space for each vertex */ /* Values range from -7 to 7 */ @@ -198,47 +194,47 @@ int initGL(GLvoid) { morph4.points[i].z = ((float)(rand() % 14000) / 1000) - 7; } - /* Load sphere.txt Object Into Helper (Used As Starting Point) */ + /* Load sphere.txt object into helper (used as starting point) */ objload("/rd/sphere.bin", &helper); - /* Source & Destination Are Set To Equal First Object (morph1) */ + /* Source & destination are set to equal first object (morph1) */ sour = dest = &morph1; - return(TRUE); + return(true); } void draw_gl(void) { - GLfloat tx, ty, tz; /* Temp X, Y & Z Variables */ - vertex q; /* Holds Returned Calculated Values For One Vertex */ - int i; /* Simple Looping Variable */ + GLfloat tx, ty, tz; /* Temp X, Y & Z variables */ + vertex q; /* Holds returned calculated values for one vertex */ + int i; /* Simple looping variable */ - /* Clear The Screen And The Depth Buffer */ + /* Clear the screen and the depth buffer */ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - /* Reset The View */ + /* Reset the view */ glLoadIdentity(); - /* Translate The The Current Position To Start Drawing */ + /* Translate the current position to start drawing */ glTranslatef(cx, cy, cz); - /* Rotate On The X Axis By xrot */ + /* Rotate on the X axis by xrot */ glRotatef(xrot, 1.0f, 0.0f, 0.0f); - /* Rotate On The Y Axis By yrot */ + /* Rotate on the Y axis by yrot */ glRotatef(yrot, 0.0f, 1.0f, 0.0f); - /* Rotate On The Z Axis By zrot */ + /* Rotate on the Z axis by zrot */ glRotatef(zrot, 0.0f, 0.0f, 1.0f); - /* Increase xrot,yrot & zrot by xspeed, yspeed & zspeed */ + /* Increase xrot, yrot & zrot by xspeed, yspeed & zspeed */ xrot += xspeed; yrot += yspeed; zrot += zspeed; - /* Begin Drawing Points -- GLdc does not implement GL_POINTS, + /* Begin drawing points -- GLdc does not implement GL_POINTS, so we will make an approximation using GL_TRIANGLES */ glBegin(GL_TRIANGLES); - /* Loop Through All The Verts Of morph1 (All Objects Have - * * The Same Amount Of Verts For Simplicity, Could Use maxver Also) + /* Loop through all the verts of morph1 (all objects have + * * The same amount of verts for simplicity, could use maxver also) * */ for(i = 0; i < morph1.verts; i++) { - /* If morph Is True Calculate Movement Otherwise Movement=0 */ + /* If morph is true, calculate movement otherwise movement=0 */ if(morph) q = calculate(i); else @@ -254,36 +250,36 @@ void draw_gl(void) { ty = helper.points[i].y; tz = helper.points[i].z; - /* Set Color To A Bright Shade Of Off Blue */ + /* Set color to a bright shade of off blue */ glColor3f(0.0f, 1.0f, 1.0f); - /* Draw A Point At The Current Temp Values (Vertex) */ + /* Draw a point at the current temp values (vertex) */ glVertex3f(tx, ty, tz); glVertex3f(tx+0.05f, ty+0.05f, tz); glVertex3f(tx, ty+0.05f, tz+0.05f); - /* Darken Color A Bit */ + /* Darken color a bit */ glColor3f(0.0f, 0.5f, 1.0f); - /* Calculate Two Positions Ahead */ + /* Calculate two positions ahead */ tx -= 2.0f * q.x; ty -= 2.0f * q.y; tz -= 2.0f * q.z; - /* Draw A Second Point At The Newly Calculate Position */ + /* Draw a second point at the newly calculate position */ glVertex3f(tx, ty, tz); glVertex3f(tx+0.05f, ty+0.05f, tz); glVertex3f(tx, ty+0.05f, tz+0.05f); - /* Set Color To A Very Dark Blue */ + /* Set color to a very dark blue */ glColor3f(0.0f, 0.0f, 1.0f); - /* Calculate Two More Positions Ahead */ + /* Calculate two more positions ahead */ tx -= 2.0f * q.x; ty -= 2.0f * q.y; tz -= 2.0f * q.z; - /* Draw A Third Point At The Second New Position */ + /* Draw a third point at the second new position */ glVertex3f(tx, ty, tz); glVertex3f(tx+0.05f, ty+0.05f, tz); glVertex3f(tx, ty+0.05f, tz+0.05f); @@ -291,17 +287,17 @@ void draw_gl(void) { glEnd(); - /* If We're Morphing And We Haven't Gone Through All 200 Steps - * Increase Our Step Counter - * Otherwise Set Morphing To False, Make Source=Destination And - * Set The Step Counter Back To Zero. + /* If we're morphing and we haven't gone through all 200 steps, + * increase our step counter + * Otherwise set morphing to false, make source=destination and + * Set the step counter back to zero. */ if(morph && step <= steps) { step++; } else { - morph = FALSE; + morph = false; sour = dest; step = 0; } @@ -340,25 +336,25 @@ int main(int argc, char **argv) { break; if((state->buttons & CONT_A) && !morph && NOT_LAST) { - morph = TRUE; + morph = true; dest = &morph1; last = CONT_A; } if((state->buttons & CONT_X) && !morph && NOT_LAST) { - morph = TRUE; + morph = true; dest = &morph2; last = CONT_X; } if((state->buttons & CONT_Y) && !morph && NOT_LAST) { - morph = TRUE; + morph = true; dest = &morph3; last = CONT_Y; } if((state->buttons & CONT_B) && !morph && NOT_LAST) { - morph = TRUE; + morph = true; dest = &morph4; last = CONT_B; } diff --git a/examples/dreamcast/kgl/nehe/nehe26/nehe26.c b/examples/dreamcast/kgl/nehe/nehe26/nehe26.c index 24b158d..10dac9a 100644 --- a/examples/dreamcast/kgl/nehe/nehe26/nehe26.c +++ b/examples/dreamcast/kgl/nehe/nehe26/nehe26.c @@ -2,14 +2,15 @@ KallistiOS 2.0.0 nehe26.c - (c)2014 Josh Pearson - (c)2001 Benoit Miller - (c)2000 Jeff Molofee + Copyright (c) 2014 Josh Pearson + Copyright (c) 2001 Benoit Miller + Copyright (c) 2000 Jeff Molofee */ #include <kos.h> #include <stdlib.h> +#include <stdbool.h> #include <KGL/gl.h> #include <KGL/glu.h> @@ -25,55 +26,50 @@ rotation. */ -/* screen width, height, and bit depth */ +/* Screen width, height, and bit depth */ #define SCREEN_WIDTH 640 #define SCREEN_HEIGHT 400 -/* Set up some booleans */ -#define TRUE 1 -#define FALSE 0 -typedef unsigned int bool; - -/* Build Our Vertex Structure */ +/* Build our vertex structure. */ typedef struct { - float x, y, z; /* 3D Coordinates */ + float x, y, z; /* 3D coordinates */ } vertex; -/* Build Our Object Structure */ +/* Build our object structure. */ typedef struct { - int verts; /* Number Of Vertices For The Object */ - vertex *points; /* One Vertice (Vertex x,y & z) */ + int verts; /* Number of vertices for the object */ + vertex *points; /* One Vertex (Vertex x,y & z) */ } object; GLfloat xrot, yrot, zrot; /* Camera rotation variables */ GLfloat cx, cy, cz = -15; /* Camera pos variable */ -GLfloat xspeed, yspeed, zspeed; /* Spin Speed */ +GLfloat xspeed, yspeed, zspeed; /* Spin speed */ -int key = 1; /* Make Sure Same Morph Key Not Pressed */ -int step = 0, steps = 200; /* Step Counter And Maximum Number Of Steps */ -bool morph = FALSE; /* Default morph To False (Not Morphing) */ +int key = 1; /* Make sure same morph key not pressed */ +int step = 0, steps = 200; /* Step counter and maximum number of steps */ +bool morph = false; /* Default morph to false (not morphing) */ -int maxver; /* Holds The Max Number Of Vertices */ -object morph1, morph2, morph3, morph4, /* Our 4 Morphable Objects */ - helper, *sour, *dest; /* Helper, Source, Destination Object */ +int maxver; /* Holds the max number of vertices */ +object morph1, morph2, morph3, morph4, /* Our 4 morphable objects */ + helper, *sour, *dest; /* Helper, source, destination object */ #define MORPHS 4 -/* function to allocate memory for an object */ +/* Function to allocate memory for an object */ void objallocate(object *k, int n) { - /* Sets points Equal To VERTEX * Number Of Vertices */ + /* Sets points equal to vertex * number of vertices */ k->points = (vertex *)malloc(sizeof(vertex) * n); } -/* function deallocate memory for an object */ +/* Function deallocate memory for an object */ void objfree(object *k) { free(k->points); } -/* function to release/destroy our resources and restoring the old desktop */ +/* Function to release/destroy our resources and restoring the old desktop */ void Quit(int returnCode) { /* deallocate the objects' memory */ @@ -87,46 +83,46 @@ void Quit(int returnCode) { /* function Loads Object From File (name) */ void objload(char *name, object *k) { - int ver; /* Will Hold Vertice Count */ - float rx, ry, rz; /* Hold Vertex X, Y & Z Position */ - FILE *filein; /* Filename To Open */ + int ver; /* Will hold vertex count */ + float rx, ry, rz; /* Hold vertex X, Y & Z position */ + FILE *filein; /* Filename to open */ int i; /* Simple loop variable */ printf(" [objload] file: %s\n", name); - /* Opens The File For Reading */ + /* Opens the file for reading. */ filein = fopen(name, "r"); - /* Reads the number of verts in the file */ + /* Reads the number of verts in the file. */ ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-30 00:05:07
|
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 "The KallistiOS port of OpenGL.". The tag, v2.1.0 has been deleted was 4c8c082e0675162a1482a810210dec6d4202dc3e ----------------------------------------------------------------------- 4c8c082e0675162a1482a810210dec6d4202dc3e Fix SQ code for changes to KOS. ----------------------------------------------------------------------- hooks/post-receive -- The KallistiOS port of OpenGL. |
From: ljsebald <ljs...@us...> - 2023-12-30 00:03:13
|
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 "The KallistiOS port of OpenGL.". The tag, v2.1.0 has been created at 4c8c082e0675162a1482a810210dec6d4202dc3e (commit) - Log ----------------------------------------------------------------- commit 4c8c082e0675162a1482a810210dec6d4202dc3e Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 29 17:53:04 2023 -0500 Fix SQ code for changes to KOS. ----------------------------------------------------------------------- hooks/post-receive -- The KallistiOS port of OpenGL. |
From: ljsebald <ljs...@us...> - 2023-12-29 22:53:26
|
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 "The KallistiOS port of OpenGL.". The branch, master has been updated via 4c8c082e0675162a1482a810210dec6d4202dc3e (commit) from 07f346a758576af2b58e18bd0c139c2f5249407e (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 4c8c082e0675162a1482a810210dec6d4202dc3e Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 29 17:53:04 2023 -0500 Fix SQ code for changes to KOS. ----------------------------------------------------------------------- Summary of changes: gl-pvr.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gl-pvr.c b/gl-pvr.c index 2898b34..1d13460 100644 --- a/gl-pvr.c +++ b/gl-pvr.c @@ -2,7 +2,7 @@ libgl/gl-pvr.c Copyright (C) 2013-2014 Josh Pearson - Copyright (C) 2016 Lawrence Sebald + Copyright (C) 2016, 2023 Lawrence Sebald Vertex Buffer Routines for interfacing the Dreamcast's SH4 CPU and PowerVR GPU. @@ -53,6 +53,7 @@ static GLuint GL_VERTS[2] = {0, 0}, static GL_MULTITEX_OBJECT GL_MTOBJS[GL_KOS_MAX_MULTITEXTURE_OBJECTS]; static GLuint GL_MTOBJECTS = 0; +#if 0 /* Custom version of sq_cpy from KOS for copying vertex data to the PVR */ static inline void pvr_list_submit(void *src, int n) { GLuint *d = TA_SQ_ADDR; @@ -93,6 +94,12 @@ static inline void pvr_hdr_submit(const GLuint *src) { asm("pref @%0" : : "r"(d)); } +#else + +#define pvr_list_submit(src, n) sq_cpy(TA_SQ_ADDR, (src), ((n) << 5)) +#define pvr_hdr_submit(src) sq_cpy(TA_SQ_ADDR, (src), 32) + +#endif inline void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex, pvr_vertex_t *src, @@ -205,8 +212,10 @@ inline void _glKosVertexBufCopy(void *dst, void *src, GLuint count) { static inline void glutSwapBuffer() { #ifndef GL_KOS_USE_DMA +#if 0 QACR0 = QACRTA; QACR1 = QACRTA; +#endif #endif pvr_list_begin(PVR_LIST_OP_POLY); hooks/post-receive -- The KallistiOS port of OpenGL. |
From: ljsebald <ljs...@us...> - 2023-12-29 20:36:04
|
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 72590d1643c42950485ede92db461964c3e3a0bc (commit) from 7094ca6e7f15a31e0aefc111ce3c16c8b784bd38 (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 72590d1643c42950485ede92db461964c3e3a0bc Author: Andy Barajas <and...@gm...> Date: Fri Dec 29 12:35:35 2023 -0800 Add some gldc examples (#435) ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/gldc/basic/Makefile | 2 +- examples/dreamcast/{kgl => gldc}/basic/gl/Makefile | 2 +- examples/dreamcast/{kgl => gldc}/basic/gl/gltest.c | 21 ++- examples/dreamcast/gldc/basic/gl/pvr-texture.c | 176 +++++++++++++++++++++ .../gltest => gldc/basic/gl}/romdisk/glass.pvr | Bin examples/dreamcast/gldc/nehe/Makefile | 2 +- .../dreamcast/{kgl => gldc}/nehe/nehe06/Makefile | 4 +- .../dreamcast/{kgl => gldc}/nehe/nehe06/nehe06.c | 8 +- examples/dreamcast/gldc/nehe/nehe06/pvr-texture.c | 176 +++++++++++++++++++++ .../gltest => gldc/nehe/nehe06}/romdisk/glass.pvr | Bin .../dreamcast/{kgl => gldc}/nehe/nehe08/Makefile | 2 +- .../dreamcast/{kgl => gldc}/nehe/nehe08/nehe08.c | 14 +- examples/dreamcast/gldc/nehe/nehe08/pvr-texture.c | 176 +++++++++++++++++++++ .../gltest => gldc/nehe/nehe08}/romdisk/glass.pvr | Bin .../dreamcast/{kgl => gldc}/nehe/nehe09/Makefile | 2 +- .../dreamcast/{kgl => gldc}/nehe/nehe09/nehe09.c | 8 +- examples/dreamcast/gldc/nehe/nehe09/pvr-texture.c | 176 +++++++++++++++++++++ .../{kgl => gldc}/nehe/nehe09/romdisk/star.pvr | Bin .../dreamcast/{kgl => gldc}/nehe/nehe16/Makefile | 2 +- .../dreamcast/{kgl => gldc}/nehe/nehe16/nehe16.c | 11 +- examples/dreamcast/gldc/nehe/nehe16/pvr-texture.c | 176 +++++++++++++++++++++ .../gltest => gldc/nehe/nehe16}/romdisk/glass.pvr | Bin 22 files changed, 923 insertions(+), 35 deletions(-) copy examples/dreamcast/{kgl => gldc}/basic/gl/Makefile (88%) copy examples/dreamcast/{kgl => gldc}/basic/gl/gltest.c (91%) create mode 100644 examples/dreamcast/gldc/basic/gl/pvr-texture.c copy examples/dreamcast/{cpp/gltest => gldc/basic/gl}/romdisk/glass.pvr (100%) mode change 100755 => 100644 copy examples/dreamcast/{kgl => gldc}/nehe/nehe06/Makefile (87%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe06/nehe06.c (97%) create mode 100644 examples/dreamcast/gldc/nehe/nehe06/pvr-texture.c copy examples/dreamcast/{cpp/gltest => gldc/nehe/nehe06}/romdisk/glass.pvr (100%) mode change 100755 => 100644 copy examples/dreamcast/{kgl => gldc}/nehe/nehe08/Makefile (88%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe08/nehe08.c (93%) create mode 100644 examples/dreamcast/gldc/nehe/nehe08/pvr-texture.c copy examples/dreamcast/{cpp/gltest => gldc/nehe/nehe08}/romdisk/glass.pvr (100%) mode change 100755 => 100644 copy examples/dreamcast/{kgl => gldc}/nehe/nehe09/Makefile (88%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe09/nehe09.c (98%) create mode 100644 examples/dreamcast/gldc/nehe/nehe09/pvr-texture.c copy examples/dreamcast/{kgl => gldc}/nehe/nehe09/romdisk/star.pvr (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe16/Makefile (88%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe16/nehe16.c (96%) create mode 100644 examples/dreamcast/gldc/nehe/nehe16/pvr-texture.c copy examples/dreamcast/{cpp/gltest => gldc/nehe/nehe16}/romdisk/glass.pvr (100%) mode change 100755 => 100644 diff --git a/examples/dreamcast/gldc/basic/Makefile b/examples/dreamcast/gldc/basic/Makefile index 5e6a058..dc91493 100644 --- a/examples/dreamcast/gldc/basic/Makefile +++ b/examples/dreamcast/gldc/basic/Makefile @@ -8,7 +8,7 @@ # This will make all the examples, leaving only the elf files. # If you want to clean everything, use 'clean'. -SUBDIRS = vq +SUBDIRS = vq gl all: $(patsubst %, _dir_%, $(SUBDIRS)) diff --git a/examples/dreamcast/kgl/basic/gl/Makefile b/examples/dreamcast/gldc/basic/gl/Makefile similarity index 88% copy from examples/dreamcast/kgl/basic/gl/Makefile copy to examples/dreamcast/gldc/basic/gl/Makefile index 5ffcfa1..c223d07 100644 --- a/examples/dreamcast/kgl/basic/gl/Makefile +++ b/examples/dreamcast/gldc/basic/gl/Makefile @@ -19,7 +19,7 @@ rm-elf: -rm -f $(TARGET) romdisk.* $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -lKGL -lpcx -lkosutils + kos-cc -o $(TARGET) $(OBJS) -lGL -lm -lpcx -lkosutils run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/basic/gl/gltest.c b/examples/dreamcast/gldc/basic/gl/gltest.c similarity index 91% copy from examples/dreamcast/kgl/basic/gl/gltest.c copy to examples/dreamcast/gldc/basic/gl/gltest.c index 17f9bdc..7585f3c 100644 --- a/examples/dreamcast/kgl/basic/gl/gltest.c +++ b/examples/dreamcast/gldc/basic/gl/gltest.c @@ -8,9 +8,9 @@ #include <kos.h> -#include <KGL/gl.h> -#include <KGL/glu.h> -#include <KGL/glut.h> +#include <GL/gl.h> +#include <GL/glu.h> +#include <GL/glkos.h> /* @@ -26,7 +26,7 @@ Thanks to NeHe's tutorials for the texture. This example demonstrates some of the differences between KGL and OpenGL. Notice how we actually call glEnable(GL_BLEND) to enable transparency. -This remains in effect until we call glDisable(GL_BLEND). +This remains in effect untill we call glDisable(GL_BLEND). In OpenGL, there is no glKosFinishList() like in KGL. Also, in OpenGL we call glutSwapBuffers() to flush the vertices to the GPU. @@ -139,8 +139,9 @@ int main(int argc, char **argv) { /* Load a texture */ glTextureLoadPVR("/rd/glass.pvr", 0, 0); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_FILTER_BILINEAR); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATEALPHA); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glClearColor(0.3f, 0.4f, 0.5f, 1.0f); @@ -200,6 +201,10 @@ int main(int argc, char **argv) { glRotatef(r, 0.0f, 1.0f, 0.5f); glPushMatrix(); + /* Always draw 2 cubes as solids */ + glEnable(GL_CULL_FACE); + glDisable(GL_BLEND); + glTranslatef(-5.0f, 0.0f, 0.0f); cube(r); @@ -231,12 +236,12 @@ int main(int argc, char **argv) { } /* Finish the frame */ - glutSwapBuffers(); + glKosSwapBuffers(); } pvr_get_stats(&stats); printf("VBL Count: %ld, last_time: %d, frame rate: %f fps\n", - stats.vbl_count, stats.frame_last_time, (double)stats.frame_rate); + stats.vbl_count, stats.frame_last_time, stats.frame_rate); return 0; } diff --git a/examples/dreamcast/gldc/basic/gl/pvr-texture.c b/examples/dreamcast/gldc/basic/gl/pvr-texture.c new file mode 100644 index 0000000..00592c3 --- /dev/null +++ b/examples/dreamcast/gldc/basic/gl/pvr-texture.c @@ -0,0 +1,176 @@ +/* + KallistiOS 2.0.0 + + pvr-texture.c + (c)2014 Josh PH3NOM Pearson + + Load A PVR Texture to the PVR using Open GL +*/ +#include <stdlib.h> +#include <stdio.h> +#include <stdint.h> + +#include <GL/gl.h> +#include <GL/glu.h> +#include <GL/glkos.h> +#include <GL/glext.h> + +#define PVR_HDR_SIZE 0x20 +#define MAX(x, y) ((x > y) ? x : y) + +static GLuint PVR_TextureHeight(unsigned char *HDR); +static GLuint PVR_TextureWidth(unsigned char *HDR); +static GLuint PVR_TextureFormat(unsigned char *HDR); + +static GLuint _glGetMipmapLevelCount(GLuint width, GLuint height) { + return 1 + floor(log2(MAX(width, height))); +} + +static GLuint _glGetMipmapDataSize(GLuint width, GLuint height) { + GLuint size = 0; + + GLuint i = 0; + + for(; i < _glGetMipmapLevelCount(width, height); ++i) { + size += (width * height * 2); + + if(width > 1) { + width /= 2; + } + + if(height > 1) { + height /= 2; + } + } + + return size; +} + +/* Load a PVR texture file into memory, and then bind the texture to Open GL. + fname is the name of the PVR texture file to be opened and read. + isMipMapped should be passed as 1 if the texture contains MipMap levels, 0 otherwise. + glMipMap should be passed as 1 if Open GL should calculate the Mipmap levels, 0 otherwise */ +GLuint glTextureLoadPVR(char *fname, unsigned char isMipMapped, unsigned char glMipMap) { + FILE *tex = NULL; + uint16_t *TEX0 = NULL; + uint8_t HDR[PVR_HDR_SIZE]; + GLuint texID, texSize, texW, texH, texFormat; + + /* Open the PVR texture file, and get its file size */ + tex = fopen(fname, "rb"); + + if(tex == NULL) { + printf("FILE READ ERROR: %s\n", fname); + + while(1); + } + + fseek(tex, 0, SEEK_END); + texSize = ftell(tex) - PVR_HDR_SIZE; + fseek(tex, 0, SEEK_SET); + + /* Read in the PVR texture file header */ + fread(HDR, 1, PVR_HDR_SIZE, tex); + + /* Extract some information from the PVR texture file header */ + texW = PVR_TextureWidth(HDR); + texH = PVR_TextureHeight(HDR); + texFormat = PVR_TextureFormat(HDR); + + /* Allocate Some Memory for the texture. If we are using Open GL to build the MipMap, + we need to allocate enough space to hold the MipMap texture levels. */ + if(!isMipMapped && glMipMap) + TEX0 = malloc(_glGetMipmapDataSize(texW, texH)); + else + TEX0 = malloc(texSize); + + fread(TEX0, 1, texSize, tex); /* Read in the PVR texture data */ + + /* Generate and bind a texture as normal for Open GL */ + glGenTextures(1, &texID); + glBindTexture(GL_TEXTURE_2D, texID); + + if(texFormat != GL_UNSIGNED_SHORT_5_6_5) + glCompressedTexImage2D(GL_TEXTURE_2D, + 0, + texFormat, + texW, + texH, + 0, + texSize, + TEX0); + else { + //fprintf(stderr, "%x\n", texFormat); + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGB, + texW, texH, + 0, + GL_RGB, + texFormat, + TEX0); + if(!isMipMapped && glMipMap) + glGenerateMipmapEXT(GL_TEXTURE_2D); + } + + free(TEX0); + + return texID; +} + +static GLuint PVR_TextureFormat(unsigned char *HDR) { + GLuint color = (GLuint)HDR[PVR_HDR_SIZE - 8]; + GLuint format = (GLuint)HDR[PVR_HDR_SIZE - 7]; + + GLboolean twiddled = format == 0x01; + GLboolean compressed = (format == 0x10 || format == 0x03); + + if(compressed) { + if(twiddled) { + switch(color) { + case 0x0: { + return GL_COMPRESSED_ARGB_1555_VQ_TWID_KOS; + } break; + case 0x01: { + return GL_COMPRESSED_RGB_565_VQ_TWID_KOS; + } break; + case 0x02: { + return GL_COMPRESSED_ARGB_4444_VQ_TWID_KOS; + } + break; + default: + fprintf(stderr, "Invalid texture format"); + return 0; + } + } else { + switch(color) { + case 0: { + return GL_COMPRESSED_ARGB_1555_VQ_KOS; + } break; + case 1: { + return GL_COMPRESSED_RGB_565_VQ_KOS; + } break; + case 2: { + return GL_COMPRESSED_ARGB_4444_VQ_KOS; + } + break; + default: + fprintf(stderr, "Invalid texture format"); + return 0; + } + } + } else { + if(color == 1) { + return GL_UNSIGNED_SHORT_5_6_5; + } + return 0; + } +} + +static GLuint PVR_TextureWidth(unsigned char *HDR) { + return (GLuint)HDR[PVR_HDR_SIZE - 4] | HDR[PVR_HDR_SIZE - 3] << 8; +} + +static GLuint PVR_TextureHeight(unsigned char *HDR) { + return (GLuint)HDR[PVR_HDR_SIZE - 2] | HDR[PVR_HDR_SIZE - 1] << 8; +} diff --git a/examples/dreamcast/cpp/gltest/romdisk/glass.pvr b/examples/dreamcast/gldc/basic/gl/romdisk/glass.pvr old mode 100755 new mode 100644 similarity index 100% copy from examples/dreamcast/cpp/gltest/romdisk/glass.pvr copy to examples/dreamcast/gldc/basic/gl/romdisk/glass.pvr diff --git a/examples/dreamcast/gldc/nehe/Makefile b/examples/dreamcast/gldc/nehe/Makefile index 0f339ab..7722443 100644 --- a/examples/dreamcast/gldc/nehe/Makefile +++ b/examples/dreamcast/gldc/nehe/Makefile @@ -6,7 +6,7 @@ # This will make all the examples, leaving only the elf files. # If you want to clean everything, use 'clean'. -SUBDIRS = nehe02 nehe05 nehe26 +SUBDIRS = nehe02 nehe05 nehe06 nehe08 nehe09 nehe16 nehe26 all: $(patsubst %, _dir_%, $(SUBDIRS)) diff --git a/examples/dreamcast/kgl/nehe/nehe06/Makefile b/examples/dreamcast/gldc/nehe/nehe06/Makefile similarity index 87% copy from examples/dreamcast/kgl/nehe/nehe06/Makefile copy to examples/dreamcast/gldc/nehe/nehe06/Makefile index 9dc0dc5..a4802cc 100644 --- a/examples/dreamcast/kgl/nehe/nehe06/Makefile +++ b/examples/dreamcast/gldc/nehe/nehe06/Makefile @@ -2,7 +2,7 @@ # Nehe06 example adapted from KGL # (c)2013-2014 Josh Pearson # (c)2001 Benoit Miller -# +# TARGET = nehe06.elf OBJS = nehe06.o pvr-texture.o romdisk.o @@ -19,7 +19,7 @@ rm-elf: -rm -f $(TARGET) romdisk.* $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -L$(KOS_BASE)/lib -lKGL -lm + kos-cc -o $(TARGET) $(OBJS) -L$(KOS_BASE)/lib -lGL -lm run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/nehe/nehe06/nehe06.c b/examples/dreamcast/gldc/nehe/nehe06/nehe06.c similarity index 97% copy from examples/dreamcast/kgl/nehe/nehe06/nehe06.c copy to examples/dreamcast/gldc/nehe/nehe06/nehe06.c index f1b048e..5f5cf56 100644 --- a/examples/dreamcast/kgl/nehe/nehe06/nehe06.c +++ b/examples/dreamcast/gldc/nehe/nehe06/nehe06.c @@ -9,9 +9,9 @@ #include <kos.h> -#include <KGL/gl.h> -#include <KGL/glu.h> -#include <KGL/glut.h> +#include <GL/gl.h> +#include <GL/glu.h> +#include <GL/glkos.h> /* Simple KGL example to demonstrate texturing. @@ -144,7 +144,7 @@ int main(int argc, char **argv) { draw_gl(); /* Finish the frame */ - glutSwapBuffers(); + glKosSwapBuffers(); } return 0; diff --git a/examples/dreamcast/gldc/nehe/nehe06/pvr-texture.c b/examples/dreamcast/gldc/nehe/nehe06/pvr-texture.c new file mode 100644 index 0000000..00592c3 --- /dev/null +++ b/examples/dreamcast/gldc/nehe/nehe06/pvr-texture.c @@ -0,0 +1,176 @@ +/* + KallistiOS 2.0.0 + + pvr-texture.c + (c)2014 Josh PH3NOM Pearson + + Load A PVR Texture to the PVR using Open GL +*/ +#include <stdlib.h> +#include <stdio.h> +#include <stdint.h> + +#include <GL/gl.h> +#include <GL/glu.h> +#include <GL/glkos.h> +#include <GL/glext.h> + +#define PVR_HDR_SIZE 0x20 +#define MAX(x, y) ((x > y) ? x : y) + +static GLuint PVR_TextureHeight(unsigned char *HDR); +static GLuint PVR_TextureWidth(unsigned char *HDR); +static GLuint PVR_TextureFormat(unsigned char *HDR); + +static GLuint _glGetMipmapLevelCount(GLuint width, GLuint height) { + return 1 + floor(log2(MAX(width, height))); +} + +static GLuint _glGetMipmapDataSize(GLuint width, GLuint height) { + GLuint size = 0; + + GLuint i = 0; + + for(; i < _glGetMipmapLevelCount(width, height); ++i) { + size += (width * height * 2); + + if(width > 1) { + width /= 2; + } + + if(height > 1) { + height /= 2; + } + } + + return size; +} + +/* Load a PVR texture file into memory, and then bind the texture to Open GL. + fname is the name of the PVR texture file to be opened and read. + isMipMapped should be passed as 1 if the texture contains MipMap levels, 0 otherwise. + glMipMap should be passed as 1 if Open GL should calculate the Mipmap levels, 0 otherwise */ +GLuint glTextureLoadPVR(char *fname, unsigned char isMipMapped, unsigned char glMipMap) { + FILE *tex = NULL; + uint16_t *TEX0 = NULL; + uint8_t HDR[PVR_HDR_SIZE]; + GLuint texID, texSize, texW, texH, texFormat; + + /* Open the PVR texture file, and get its file size */ + tex = fopen(fname, "rb"); + + if(tex == NULL) { + printf("FILE READ ERROR: %s\n", fname); + + while(1); + } + + fseek(tex, 0, SEEK_END); + texSize = ftell(tex) - PVR_HDR_SIZE; + fseek(tex, 0, SEEK_SET); + + /* Read in the PVR texture file header */ + fread(HDR, 1, PVR_HDR_SIZE, tex); + + /* Extract some information from the PVR texture file header */ + texW = PVR_TextureWidth(HDR); + texH = PVR_TextureHeight(HDR); + texFormat = PVR_TextureFormat(HDR); + + /* Allocate Some Memory for the texture. If we are using Open GL to build the MipMap, + we need to allocate enough space to hold the MipMap texture levels. */ + if(!isMipMapped && glMipMap) + TEX0 = malloc(_glGetMipmapDataSize(texW, texH)); + else + TEX0 = malloc(texSize); + + fread(TEX0, 1, texSize, tex); /* Read in the PVR texture data */ + + /* Generate and bind a texture as normal for Open GL */ + glGenTextures(1, &texID); + glBindTexture(GL_TEXTURE_2D, texID); + + if(texFormat != GL_UNSIGNED_SHORT_5_6_5) + glCompressedTexImage2D(GL_TEXTURE_2D, + 0, + texFormat, + texW, + texH, + 0, + texSize, + TEX0); + else { + //fprintf(stderr, "%x\n", texFormat); + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGB, + texW, texH, ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-29 20:32:30
|
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 7094ca6e7f15a31e0aefc111ce3c16c8b784bd38 (commit) from e1c2a4a3124fb40019c1dd4857e0f4a5d1641339 (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 7094ca6e7f15a31e0aefc111ce3c16c8b784bd38 Author: SiZiOUS <si...@gm...> Date: Fri Dec 29 20:30:25 2023 +0000 Adding examples for `mruby` KallistiOS Port (#436) * `mruby`: Adding dreampresent! Source: https://github.com/yujiyokoo/dreampresent * `dreampresent`: minor changes before committing the sample to KOS * `mrbtris`: initial commit of the sample Source: https://github.com/yujiyokoo/mrbtris-dreamcast * `mruby`: updating readme file * `mruby` examples: small final updates * `dreampresent`: updating headers/license * `mrbtris`: adding license * `dreampresent` - updating all headers * `mruby` examples: final update on license * `mrbtris`: updating README ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/mruby/Makefile | 17 + examples/dreamcast/mruby/dreampresent/.gitignore | 1 + examples/dreamcast/mruby/dreampresent/LICENSE | 22 + examples/dreamcast/mruby/dreampresent/Makefile | 57 ++ examples/dreamcast/mruby/dreampresent/README.md | 39 ++ examples/dreamcast/mruby/dreampresent/dc_kos_rb.rb | 166 +++++ examples/dreamcast/mruby/dreampresent/dckos.c | 349 ++++++++++ examples/dreamcast/mruby/dreampresent/dckos.h | 35 + .../dreamcast/mruby/dreampresent/dreampresent.rb | 40 ++ examples/dreamcast/mruby/dreampresent/main.c | 69 ++ examples/dreamcast/mruby/dreampresent/page_data.rb | 530 ++++++++++++++++ .../dreamcast/mruby/dreampresent/presentation.rb | 68 ++ .../dreampresent/romdisk/DCSerialConnector.png | Bin 0 -> 268873 bytes .../mruby/dreampresent/romdisk/DCToSerial.png | Bin 0 -> 165933 bytes .../mruby/dreampresent/romdisk/bg_dark.png | Bin 0 -> 40364 bytes .../dreampresent/romdisk/content.dreampresent | 404 ++++++++++++ .../mruby/dreampresent/romdisk/dreamcast_photo.png | Bin 0 -> 366961 bytes .../dreampresent/romdisk/emulator_console.png | Bin 0 -> 53811 bytes .../dreampresent/romdisk/mruby_logo_32x35.png | Bin 0 -> 13655 bytes .../dreampresent/romdisk/soldered_connector.png | Bin 0 -> 284943 bytes .../dreampresent/romdisk/swirl_blue_32x28.png | Bin 0 -> 1638 bytes .../mruby/dreampresent/romdisk/yuji_avatar.png | Bin 0 -> 57460 bytes .../dreamcast/mruby/dreampresent/rsrc/mruby.gif | Bin 0 -> 5826 bytes .../dreamcast/mruby/dreampresent/rsrc}/mruby.mr | Bin examples/dreamcast/mruby/dreampresent/start.rb | 36 ++ examples/dreamcast/mruby/mrbtris/.gitignore | 1 + examples/dreamcast/mruby/mrbtris/LICENSE | 22 + examples/dreamcast/mruby/mrbtris/Makefile | 57 ++ examples/dreamcast/mruby/mrbtris/README.md | 33 + examples/dreamcast/mruby/mrbtris/block_shapes.rb | 116 ++++ examples/dreamcast/mruby/mrbtris/dckos.c | 361 +++++++++++ examples/dreamcast/mruby/mrbtris/dckos.h | 35 + examples/dreamcast/mruby/mrbtris/main.c | 68 ++ examples/dreamcast/mruby/mrbtris/mrbtris.rb | 701 +++++++++++++++++++++ .../dreamcast/mruby/mrbtris/romdisk/.keep | 0 examples/dreamcast/mruby/mrbtris/start.rb | 36 ++ 36 files changed, 3263 insertions(+) create mode 100644 examples/dreamcast/mruby/Makefile create mode 100644 examples/dreamcast/mruby/dreampresent/.gitignore create mode 100644 examples/dreamcast/mruby/dreampresent/LICENSE create mode 100644 examples/dreamcast/mruby/dreampresent/Makefile create mode 100644 examples/dreamcast/mruby/dreampresent/README.md create mode 100644 examples/dreamcast/mruby/dreampresent/dc_kos_rb.rb create mode 100644 examples/dreamcast/mruby/dreampresent/dckos.c create mode 100644 examples/dreamcast/mruby/dreampresent/dckos.h create mode 100644 examples/dreamcast/mruby/dreampresent/dreampresent.rb create mode 100644 examples/dreamcast/mruby/dreampresent/main.c create mode 100644 examples/dreamcast/mruby/dreampresent/page_data.rb create mode 100644 examples/dreamcast/mruby/dreampresent/presentation.rb create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/DCSerialConnector.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/DCToSerial.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/bg_dark.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/content.dreampresent create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/dreamcast_photo.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/emulator_console.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/mruby_logo_32x35.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/soldered_connector.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/swirl_blue_32x28.png create mode 100644 examples/dreamcast/mruby/dreampresent/romdisk/yuji_avatar.png create mode 100644 examples/dreamcast/mruby/dreampresent/rsrc/mruby.gif copy {utils/makeip/rsrc/iplogos => examples/dreamcast/mruby/dreampresent/rsrc}/mruby.mr (100%) create mode 100644 examples/dreamcast/mruby/dreampresent/start.rb create mode 100644 examples/dreamcast/mruby/mrbtris/.gitignore create mode 100644 examples/dreamcast/mruby/mrbtris/LICENSE create mode 100644 examples/dreamcast/mruby/mrbtris/Makefile create mode 100644 examples/dreamcast/mruby/mrbtris/README.md create mode 100644 examples/dreamcast/mruby/mrbtris/block_shapes.rb create mode 100644 examples/dreamcast/mruby/mrbtris/dckos.c create mode 100644 examples/dreamcast/mruby/mrbtris/dckos.h create mode 100644 examples/dreamcast/mruby/mrbtris/main.c create mode 100644 examples/dreamcast/mruby/mrbtris/mrbtris.rb copy addons/lib/.keepme => examples/dreamcast/mruby/mrbtris/romdisk/.keep (100%) create mode 100644 examples/dreamcast/mruby/mrbtris/start.rb diff --git a/examples/dreamcast/mruby/Makefile b/examples/dreamcast/mruby/Makefile new file mode 100644 index 0000000..3b846bd --- /dev/null +++ b/examples/dreamcast/mruby/Makefile @@ -0,0 +1,17 @@ +# KallistiOS ##version## +# +# examples/dreamcast/mruby/Makefile +# + +all: + $(KOS_MAKE) -C dreampresent + $(KOS_MAKE) -C mrbtris + +clean: + $(KOS_MAKE) -C dreampresent clean + $(KOS_MAKE) -C mrbtris clean + +dist: + $(KOS_MAKE) -C dreampresent dist + $(KOS_MAKE) -C mrbtris dist + diff --git a/examples/dreamcast/mruby/dreampresent/.gitignore b/examples/dreamcast/mruby/dreampresent/.gitignore new file mode 100644 index 0000000..30bea79 --- /dev/null +++ b/examples/dreamcast/mruby/dreampresent/.gitignore @@ -0,0 +1 @@ +dreampresent.c diff --git a/examples/dreamcast/mruby/dreampresent/LICENSE b/examples/dreamcast/mruby/dreampresent/LICENSE new file mode 100644 index 0000000..70b32ce --- /dev/null +++ b/examples/dreamcast/mruby/dreampresent/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2019-2024 Yuji Yokoo +Copyright (C) 2020-2024 Mickaël "SiZiOUS" Cardoso + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/examples/dreamcast/mruby/dreampresent/Makefile b/examples/dreamcast/mruby/dreampresent/Makefile new file mode 100644 index 0000000..ef35245 --- /dev/null +++ b/examples/dreamcast/mruby/dreampresent/Makefile @@ -0,0 +1,57 @@ +# Dreampresent +# A simple presentation tool for Sega Dreamcast written in Ruby +# Copyright (C) 2019-2024 Yuji Yokoo +# Copyright (C) 2020-2024 Mickaël "SiZiOUS" Cardoso + +# Project Name +PROJECT = dreampresent + +# Generated Programs +TARGET = $(PROJECT).elf +BINARY = $(PROJECT).bin +BOOTFILE = 1ST_READ.BIN + +# Objects used in this project +# "$(PROJECT).o" is a transpiled C source file generated using MRB_BYTECODE +OBJS = $(PROJECT).o main.o dckos.o romdisk.o + +# Libraries used by the project +LIBS = -lmruby -lm -lpng -lkosutils -lz + +# ROM Disk directory used for resources +KOS_ROMDISK_DIR = romdisk + +# Ruby sources +# The order here is important! +MRB_SOURCES = dc_kos_rb.rb page_data.rb presentation.rb $(PROJECT).rb start.rb + +# mruby script output (transpiled source from MRB_SOURCES) +MRB_BYTECODE = $(PROJECT).c + +# Name of the compiled mruby script +# This should match the definition in "main.c" +MRB_BYTECODE_IREP_NAME = $(PROJECT)_bytecode + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: rm-elf + -rm -f $(OBJS) + +rm-elf: + -rm -f $(TARGET) $(BINARY) $(BOOTFILE) $(MRB_BYTECODE) romdisk.* + +$(TARGET): $(OBJS) + kos-cc -o $(TARGET) $(OBJS) $(LIBS) + +$(MRB_BYTECODE): $(MRB_SOURCES) + mrbc -g -B $(MRB_BYTECODE_IREP_NAME) -o $(MRB_BYTECODE) $(MRB_SOURCES) + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: $(TARGET) + -rm -f $(OBJS) romdisk.img + $(KOS_BASE)/utils/elf2bin/elf2bin $(TARGET) $(BINARY) -f + $(KOS_BASE)/utils/scramble/scramble $(BINARY) $(BOOTFILE) diff --git a/examples/dreamcast/mruby/dreampresent/README.md b/examples/dreamcast/mruby/dreampresent/README.md new file mode 100644 index 0000000..b6450c6 --- /dev/null +++ b/examples/dreamcast/mruby/dreampresent/README.md @@ -0,0 +1,39 @@ +# Dreampresent: The Dreamcast Presentation Tool + +This is a presentation tool that runs on **Sega Dreamcast**. It's written in +**Ruby** and uses [mruby](https://mruby.org/). + +This tool was initially developed by [Yuji Yokoo](https://github.com/yujiyokoo) +for the **RubyConf TW 2019** event; then it was later updated for the +**RubyConf AU 2020** event. This project has been refactored by [Mickaël +"SiZiOUS" Cardoso](https://github.com/sizious). + +## Compiling + +To compile this, you need to install the `mruby`, `libpng` and `zlib` KallistiOS +Port, using the `kos-ports` repository. + +## Usage + +You can use `A` or `START` to move forward, and use `B` to go back to the +previous page. + +Hold `A + B + Start` to quit. + +The bottom of the screen shows the page progress and time progress (blue +dreamcast swirl for page, red mruby for time). + +The time is currently hardcoded to `35` minutes. + +If you press `Right` on the D-pad, you move the time forward by 5 minutes, +and back by 5 minutes if you press `Left`. + +## License + +This example is under the MIT License. See `LICENSE` for details. + +## Final note + +The initial source is available [here](https://github.com/yujiyokoo/dreampresent). +This version of the source code is almost the same but adapted to be included as +an example in KallistiOS, with Yuji Yokoo approval, the original author. diff --git a/examples/dreamcast/mruby/dreampresent/dc_kos_rb.rb b/examples/dreamcast/mruby/dreampresent/dc_kos_rb.rb new file mode 100644 index 0000000..5b78045 --- /dev/null +++ b/examples/dreamcast/mruby/dreampresent/dc_kos_rb.rb @@ -0,0 +1,166 @@ +# KallistiOS ##version## +# +# dc_kos_rb.rb - Ruby-level wrapper to KallistiOS +# Copyright (C) 2019-2024 Yuji Yokoo +# Copyright (C) 2020-2024 Mickaël "SiZiOUS" Cardoso +# +# Dreampresent +# A simple presentation tool for Sega Dreamcast written in Ruby +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +module Commands + NEXT_PAGE = 1 + PREVIOUS_PAGE = -1 + QUIT = -2 + FWD = -3 + REW = -4 + SWITCH_VIDEO_MODE = -5 + RESET_TIMER = -6 +end + +# Ruby-level wrapper to DcKos +class DcKosRb + include Commands + + def initialize(dc_kos) + @dc_kos = dc_kos + end + + LINE_HEIGHT = 30 + # this understands '\n' as linebreak + def draw_str(str, x, y, line_height = LINE_HEIGHT, colour, show_bg) + # TODO: let's make a colour lookup class... See LineContent + rgb = + case colour + when 'red' + [255, 0, 0] + when 'magenta' + [255, 0, 255] + when 'ltblue' + [135, 206, 250] + when 'yellow' + [255, 255, 0] + when 'ltgreen' + [144, 238, 144] + when 'cyan' + [0, 255, 255] + else # unknown colours default to white + [255, 255, 255] + end + + bg_on = + if ['true', 'yes'].include? show_bg + 1 + else + 0 + end + + str.split("\n").each_with_index { |line, idx| + @dc_kos.draw_str(line, x, y + (line_height * idx+1), *rgb, bg_on) + } + end + + # this is for 512x512 images + def load_fullscreen_png(filepath) + load_png(filepath, 1, 1, 640, 640) + end + + # This and method_missing are for delegating functions not defined here to @dc_kos + def respond_to?(method) + if method == :respond_to? + true + else + self.respond_to?(method) || @dc_kos.respond_to?(method) + end + end + + # This and respond_to? are for delegating functions not defined here to @dc_kos + def method_missing(method, *args, &block) + if @dc_kos.respond_to?(method) + @dc_kos.send(method, *args, &block) + else + fail NoMethodError, "undefined method '#{method}'" + end + end + + def next_or_back + previous_state = @dc_kos::get_button_state + while true do + button_state = @dc_kos::get_button_state + + # NOTE order is important here. + + return QUIT if quit_combination?(previous_state, button_state) + + return SWITCH_VIDEO_MODE if switch_video_mode_combination?(previous_state, button_state) + + # press STRAT or A to go forward + return NEXT_PAGE if start_or_a_pressed?(previous_state, button_state) + + # press B to go back + return PREVIOUS_PAGE if b_pressed?(previous_state, button_state) + + # left and right on dpad for skipping or rewinding the time indicator + return FWD if right_pressed?(previous_state, button_state) + return REW if left_pressed?(previous_state, button_state) + + previous_state = button_state + end + end + + # NOTE: This requires the source to be 512x512 png! + # x, y are zero-based but note the pvr uses 1-based coordinates (hence the '+ 1') + # NOTE: Before calling this, you need to initialise PVR like: dc_kos.pvr_initialise() + # @dc_kos.show_512x512_png('/rd/dc_controller_orig400x362.png', 0, 0, 640, 480) + def show_512x512_png(path, x, y, w, h) + @dc_kos::load_png(path, x+1, y+1, x+w, y+h) + end + + # press A + B + Start + def quit_combination?(previous, current) + (@dc_kos::btn_a?(current) && @dc_kos::btn_b?(current) && @dc_kos::btn_start?(current)) + end + + def switch_video_mode_combination?(previous, current) + !(@dc_kos::dpad_down?(previous) && @dc_kos::btn_a?(previous)) && + (@dc_kos::dpad_down?(current) && @dc_kos::btn_a?(current)) + end + + def start_or_a_pressed?(previous, current) + (!@dc_kos::btn_start?(previous) && @dc_kos::btn_start?(current)) || + (!@dc_kos::btn_a?(previous) && @dc_kos::btn_a?(current)) + end + + def b_pressed?(previous, current) + !@dc_kos::btn_b?(previous) && @dc_kos::btn_b?(current) + end + + def b_pressed?(previous, current) + !@dc_kos::btn_b?(previous) && @dc_kos::btn_b?(current) + end + + def right_pressed?(previous, current) + !@dc_kos::dpad_right?(previous) && @dc_kos::dpad_right?(current) + end + + def left_pressed?(previous, current) + !@dc_kos::dpad_left?(previous) && @dc_kos::dpad_left?(current) + end +end diff --git a/examples/dreamcast/mruby/dreampresent/dckos.c b/examples/dreamcast/mruby/dreampresent/dckos.c new file mode 100644 index 0000000..e34c1e8 --- /dev/null +++ b/examples/dreamcast/mruby/dreampresent/dckos.c @@ -0,0 +1,349 @@ +/* KallistiOS ##version## + + dckos.c - Exposed functions for mruby: using KOS features (implementation) + Copyright (C) 2019-2024 Yuji Yokoo + Copyright (C) 2020-2024 Mickaël "SiZiOUS" Cardoso + + Dreampresent + A simple presentation tool for Sega Dreamcast written in Ruby + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +#include <assert.h> +#include <kos.h> +#include <kos/img.h> +#include <mruby/mruby.h> +#include <mruby/mruby/internal.h> +#include <mruby/mruby/data.h> +#include <mruby/mruby/string.h> +#include <mruby/mruby/error.h> +#include <stdio.h> +#include <inttypes.h> +#include <png/png.h> + +// Convert ARGB1555 to RGB565 - drops the A bit and G is exapanded to 6 bits +#define CONV1555TO565(colour) ( (((colour) & 0x7C00) << 1) | (((colour) & 0x03E0) << 1) | ((colour) & 0x001F) ) + +// CONVERT R, G, B to RGB565 +#define PACK_PIXEL(r, g, b) ( ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3) ) + +int PX_PER_LINE = 640; + +int _is_in_screen(int x, int y) { + return x >= 0 && x < PX_PER_LINE && y >= 0 && y < 480; +} + +// Be careful with this function. It'll attempt to read the entire file. +static mrb_value read_whole_txt_file(mrb_state *mrb, mrb_value self) { + char buffer[2048]; + int length; + file_t f; + mrb_value m_path; + char *path; + + char *result = NULL; + result = mrb_malloc(mrb, sizeof(char)); + *result = '\0'; + + mrb_get_args(mrb, "S", &m_path); + path = mrb_str_to_cstr(mrb, m_path); + f = fs_open(path, O_RDONLY); + + if(f < 0) { + printf("Failed to open %s.\n", path); + return mrb_nil_value(); + } + + while((length = fs_read(f, buffer, 2048))) { + printf("read %i chars into buf.\n", length); + result = mrb_realloc(mrb, result, strlen(result) + length + 1); // 1 for '\0' + strncat(result, buffer, length); + } + + fs_close(f); + mrb_value whole_str_mrb = mrb_str_new_cstr(mrb, result); + mrb_free(mrb, result); + + return whole_str_mrb; +} + +mrb_value get_button_state(mrb_state *mrb, mrb_value self) { + maple_device_t *cont1; + cont_state_t *state; + if((cont1 = maple_enum_type(0, MAPLE_FUNC_CONTROLLER))){ + state = (cont_state_t *)maple_dev_status(cont1); + return mrb_fixnum_value(state->buttons); + } + return mrb_nil_value(); ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-29 02:17:17
|
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 e1c2a4a3124fb40019c1dd4857e0f4a5d1641339 (commit) from b8a7ada874b94303dca9288ecb0457ef1083051b (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 e1c2a4a3124fb40019c1dd4857e0f4a5d1641339 Author: Ruslan Rostovtsev <sw...@21...> Date: Fri Dec 29 09:16:54 2023 +0700 Fixes and improvements for Store Queues, Sound and PVR. (#385) * Fixed snd_pcm16_split_sq(). Also few minor fixes for streams. * Minor fixes for SPU memload, memread and memset. * Added dcache_wback_sq() and fix sq_set32(). * Apply suggestions from code review * Updated authors and remove unused declaration. Also fix suggestions. * Re-design Store Queues i/f, improved PVR SQ, ... - Fixed PVR DMA bus selection. - Do not disable IRQ due SQ transfer over G2 bus. * Manage Store Queues for PVR Direct Rendering. * Added sq_flush() and hide QACR0/1 regs. * Re-organize PVR memory destination. Add DMA over Root bus. * Added pvr_sq_set32() and some fixes. * Fixed PVR examples with Direct Render. * Fixed SET_QACR_REGS for TA bus. * Get back single destination for SQ. Also don't wait SQ on lock. * Added spu_memset_sq() and minor fixes. * Updated YUV examples. * Improved bus selection for TA->VRAM. * Updated description of PVR and TA memory addresses. Also remove rootbus/sysbus because need implement CH0 PVR i/f DMA first. * Use pvr_sq_load() for pvr textures. Also minor fixes. * Updated yuv420 example to use SQ better. * Fixed PVR Direct Rendering. And removed unused param from PVR state. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/parallax/bubbles/bubbles.c | 2 +- .../pvrmark_strips_direct/pvrmark_strips_direct.c | 2 +- .../dreamcast/pvr/yuv_converter/YUV420/yuv420.c | 45 +++---- .../dreamcast/pvr/yuv_converter/YUV422/yuv422.c | 18 +-- kernel/arch/dreamcast/exports-naomi.txt | 5 + kernel/arch/dreamcast/exports-pristine.txt | 5 + kernel/arch/dreamcast/hardware/pvr/pvr_dma.c | 106 +++++++++++++--- .../dreamcast/hardware/pvr/pvr_init_shutdown.c | 1 + kernel/arch/dreamcast/hardware/pvr/pvr_internal.h | 3 +- kernel/arch/dreamcast/hardware/pvr/pvr_scene.c | 25 +++- kernel/arch/dreamcast/hardware/pvr/pvr_texture.c | 13 +- kernel/arch/dreamcast/hardware/spu.c | 52 +++++--- kernel/arch/dreamcast/hardware/sq.c | 100 ++++++---------- kernel/arch/dreamcast/include/arch/cache.h | 8 ++ kernel/arch/dreamcast/include/dc/pvr.h | 133 +++++++++++++++++---- kernel/arch/dreamcast/include/dc/sound/sfxmgr.h | 3 + kernel/arch/dreamcast/include/dc/sound/sound.h | 1 + kernel/arch/dreamcast/include/dc/spu.h | 16 ++- kernel/arch/dreamcast/include/dc/sq.h | 109 ++++++----------- kernel/arch/dreamcast/sound/snd_iface.c | 4 +- kernel/arch/dreamcast/sound/snd_pcm_split.s | 58 +-------- kernel/arch/dreamcast/sound/snd_sfxmgr.c | 1 + kernel/arch/dreamcast/sound/snd_stream.c | 86 ++++++++++--- 23 files changed, 484 insertions(+), 312 deletions(-) diff --git a/examples/dreamcast/parallax/bubbles/bubbles.c b/examples/dreamcast/parallax/bubbles/bubbles.c index 0290b64..303ad90 100644 --- a/examples/dreamcast/parallax/bubbles/bubbles.c +++ b/examples/dreamcast/parallax/bubbles/bubbles.c @@ -99,7 +99,7 @@ static void sphere_frame_opaque(void) { pvr_list_begin(PVR_LIST_OP_POLY); /* Setup our Direct Render state: pick a store queue and setup QACR0/1 */ - pvr_dr_init(dr_state); + pvr_dr_init(&dr_state); plx_mat3d_identity(); plx_mat3d_translate(0.0f, 0.0f, -12.0f); diff --git a/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c b/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c index c9c3eda..62af9a2 100644 --- a/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c +++ b/examples/dreamcast/pvr/pvrmark_strips_direct/pvrmark_strips_direct.c @@ -87,7 +87,7 @@ void do_frame(void) { pvr_list_begin(PVR_LIST_OP_POLY); pvr_prim(&hdr, sizeof(hdr)); - pvr_dr_init(dr_state); + pvr_dr_init(&dr_state); x = getnum(1024); nextnum(); diff --git a/examples/dreamcast/pvr/yuv_converter/YUV420/yuv420.c b/examples/dreamcast/pvr/yuv_converter/YUV420/yuv420.c index 970c72f..da41464 100644 --- a/examples/dreamcast/pvr/yuv_converter/YUV420/yuv420.c +++ b/examples/dreamcast/pvr/yuv_converter/YUV420/yuv420.c @@ -1,6 +1,7 @@ /* KallistiOS ##version## examples/dreamcast/pvr/yuv_converter/YUV420/yuv420.c Copyright (C) 2023 Andy Barajas + Copyright (C) 2023 Ruslan Rostovtsev This example shows how to use TA's YUV converter for YUV420p format. A sample YUV420p image in the romdisk was made via ffmpeg: @@ -181,19 +182,26 @@ static int setup_pvr(void) { static void convert_YUV420_to_YUV422_texture(void) { int i, j, index, x_blk, y_blk; + size_t dummies = (BYTE_SIZE_FOR_16x16_BLOCK * + ((PVR_TEXTURE_WIDTH >> 4) - (FRAME_TEXTURE_WIDTH >> 4))) >> 5; + uint32_t *db = (uint32_t *)SQ_MASK_DEST_ADDR(PVR_TA_YUV_CONV); + uint8_t *u_block = (uint8_t *)SQ_MASK_DEST_ADDR(PVR_TA_YUV_CONV); + uint8_t *v_block = (uint8_t *)SQ_MASK_DEST_ADDR(PVR_TA_YUV_CONV + 64); + uint8_t *y_block = (uint8_t *)SQ_MASK_DEST_ADDR(PVR_TA_YUV_CONV + 128); - unsigned char u_block[64] __attribute__((aligned(32))); - unsigned char v_block[64] __attribute__((aligned(32))); - unsigned char y_block[256] __attribute__((aligned(32))); + sq_lock((void *)PVR_TA_YUV_CONV); for(y_blk = 0; y_blk < FRAME_TEXTURE_HEIGHT; y_blk += 16) { for(x_blk = 0; x_blk < FRAME_TEXTURE_WIDTH; x_blk += 16) { - + /* U data for 16x16 pixels */ for(i = 0; i < 8; ++i) { index = (y_blk / 2 + i) * (FRAME_TEXTURE_WIDTH / 2) + (x_blk / 2); *((uint64_t*)&u_block[i * 8]) = *((uint64_t*)&u_plane[index]); + if(!((i + 1) & 3)) { + sq_flush(&u_block[i * 8]); + } } /* V data for 16x16 pixels */ @@ -201,6 +209,9 @@ static void convert_YUV420_to_YUV422_texture(void) { index = (y_blk / 2 + i) * (FRAME_TEXTURE_WIDTH / 2) + (x_blk / 2); *((uint64_t*)&v_block[i * 8]) = *((uint64_t*)&v_plane[index]); + if(!((i + 1) & 3)) { + sq_flush(&v_block[i * 8]); + } } /* Y data for 4 (8x8 pixels) */ @@ -210,27 +221,21 @@ static void convert_YUV420_to_YUV422_texture(void) { x_blk + (i % 2 * 8); *((uint64_t*)&y_block[i * 64 + j * 8]) = *((uint64_t*)&y_plane[index]); + if(!((j + 1) & 3)) { + sq_flush(&y_block[i * 64 + j * 8]); + } } } - - // dcache_flush_range((uint32_t)u_block, 64); - // pvr_dma_yuv_conv( (void*)u_block, 64, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)u_block, 64); - - // dcache_flush_range((uint32_t)v_block, 64); - // pvr_dma_yuv_conv( (void*)v_block, 64, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)v_block, 64); - - // dcache_flush_range((uint32_t)y_block, 256); - // pvr_dma_yuv_conv( (void*)y_block, 256, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)y_block, 256); } - /* Send dummies if frame texture width doesn't match pvr texture width */ - sq_set((void *)PVR_TA_YUV_CONV, 0, - BYTE_SIZE_FOR_16x16_BLOCK * - ((PVR_TEXTURE_WIDTH >> 4) - (FRAME_TEXTURE_WIDTH >> 4))); + for(i = 0; i < dummies; ++i) { + db[i] = db[i + 1] = db[i + 2] = db[i + 3] = + db[i + 4] = db[i + 5] = db[i + 6] = db[i + 7] = 0; + sq_flush(&db[i]); + } } + + sq_unlock(); } static void show_image(void) { diff --git a/examples/dreamcast/pvr/yuv_converter/YUV422/yuv422.c b/examples/dreamcast/pvr/yuv_converter/YUV422/yuv422.c index 9d8fb48..a1bd803 100644 --- a/examples/dreamcast/pvr/yuv_converter/YUV422/yuv422.c +++ b/examples/dreamcast/pvr/yuv_converter/YUV422/yuv422.c @@ -213,33 +213,33 @@ static void convert_YUV422_to_YUV422_texture(void) { // dcache_flush_range((uint32_t)u_block, 64); // pvr_dma_yuv_conv( (void*)u_block, 64, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)u_block, 64); + pvr_sq_load((void *)0, (void *)u_block, 64, PVR_DMA_YUV); // dcache_flush_range((uint32_t)v_block, 64); // pvr_dma_yuv_conv( (void*)v_block, 64, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)v_block, 64); + pvr_sq_load((void *)0, (void *)v_block, 64, PVR_DMA_YUV); // dcache_flush_range((uint32_t)y_block, 128); // pvr_dma_yuv_conv( (void*)y_block, 128, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)y_block, 128); + pvr_sq_load((void *)0, (void *)y_block, 128, PVR_DMA_YUV); // dcache_flush_range((uint32_t)(u_block+64), 64); // pvr_dma_yuv_conv( (void*)(u_block+64), 64, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)(u_block+64), 64); + pvr_sq_load((void *)0, (void *)(u_block+64), 64, PVR_DMA_YUV); // dcache_flush_range((uint32_t)(v_block+64), 64); // pvr_dma_yuv_conv( (void*)(v_block+64), 64, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)(v_block+64), 64); + pvr_sq_load((void *)0, (void *)(v_block+64), 64, PVR_DMA_YUV); // dcache_flush_range((uint32_t)(y_block+128), 128); // pvr_dma_yuv_conv( (void*)(y_block+128), 128, 1, NULL, 0); - sq_cpy((void *)PVR_TA_YUV_CONV, (void *)(y_block+128), 128); + pvr_sq_load((void *)0, (void *)(y_block+128), 128, PVR_DMA_YUV); } /* Send dummies if frame texture width doesn't match pvr texture width */ - sq_set((void *)PVR_TA_YUV_CONV, 0, - BYTE_SIZE_FOR_16x16_BLOCK * - ((PVR_TEXTURE_WIDTH >> 4) - (FRAME_TEXTURE_WIDTH >> 4))); + pvr_sq_set32((void *)PVR_TA_YUV_CONV, 0, + BYTE_SIZE_FOR_16x16_BLOCK * + ((PVR_TEXTURE_WIDTH >> 4) - (FRAME_TEXTURE_WIDTH >> 4)), PVR_DMA_YUV); } } diff --git a/kernel/arch/dreamcast/exports-naomi.txt b/kernel/arch/dreamcast/exports-naomi.txt index 7f7a5c3..181b33c 100644 --- a/kernel/arch/dreamcast/exports-naomi.txt +++ b/kernel/arch/dreamcast/exports-naomi.txt @@ -78,6 +78,7 @@ spu_memload spu_memload_sq spu_memread spu_memset +spu_memset_sq spu_dma_transfer spu_reset_chans spu_enable @@ -92,6 +93,7 @@ sq_set16 sq_set32 sq_lock sq_unlock +sq_wait # Sound snd_mem_init @@ -185,6 +187,9 @@ pvr_txr_load_dma pvr_dma_ready pvr_dma_load_ta pvr_dma_yuv_conv +pvr_sq_load +pvr_sq_set16 +pvr_sq_set32 pvr_fog_table_color pvr_fog_vertex_color pvr_fog_far_depth diff --git a/kernel/arch/dreamcast/exports-pristine.txt b/kernel/arch/dreamcast/exports-pristine.txt index e655d0f..6b88062 100644 --- a/kernel/arch/dreamcast/exports-pristine.txt +++ b/kernel/arch/dreamcast/exports-pristine.txt @@ -121,6 +121,7 @@ spu_memload spu_memload_sq spu_memread spu_memset +spu_memset_sq spu_dma_transfer spu_reset_chans spu_enable @@ -135,6 +136,7 @@ sq_set16 sq_set32 sq_lock sq_unlock +sq_wait # Sound snd_mem_init @@ -228,6 +230,9 @@ pvr_txr_load_dma pvr_dma_ready pvr_dma_load_ta pvr_dma_yuv_conv +pvr_sq_load +pvr_sq_set16 +pvr_sq_set32 pvr_fog_table_color pvr_fog_vertex_color pvr_fog_far_depth diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_dma.c b/kernel/arch/dreamcast/hardware/pvr/pvr_dma.c index 716dfc5..639e492 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_dma.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_dma.c @@ -1,9 +1,11 @@ /* KallistiOS ##version## pvr_dma.c - Copyright (C)2002 Roger Cattermole - Copyright (C)2004 Megan Potter - Copyright (C)2023 Andy Barajas + Copyright (C) 2002 Roger Cattermole + Copyright (C) 2004 Megan Potter + Copyright (C) 2023 Andy Barajas + Copyright (C) 2023 Ruslan Rostovtsev + http://www.boob.co.uk */ @@ -12,6 +14,7 @@ #include <dc/pvr.h> #include <dc/asic.h> #include <dc/dmac.h> +#include <dc/sq.h> #include <kos/thread.h> #include <kos/sem.h> @@ -62,18 +65,38 @@ static void pvr_dma_irq_hnd(uint32_t code) { } } -int pvr_dma_transfer(void *src, uintptr_t dest, size_t count, int type, - int block, pvr_dma_callback_t callback, void *cbdata) { - uint32_t src_addr = ((uint32_t)src); - uint32_t dest_addr; +static uintptr_t pvr_dest_addr(uintptr_t dest, int type) { + uintptr_t dest_addr; /* Send the data to the right place */ - if(type == PVR_DMA_TA) - dest_addr = (dest & 0xFFFFFF) | PVR_TA_INPUT; - else if(type == PVR_DMA_YUV) - dest_addr = (dest & 0xFFFFFF) | PVR_TA_YUV_CONV; - else - dest_addr = (dest & 0xFFFFFF) | PVR_TA_TEX_MEM; + if(type == PVR_DMA_TA) { + dest_addr = ((uintptr_t)dest & 0xffffff) | PVR_TA_INPUT; + } + else if(type == PVR_DMA_YUV) { + dest_addr = ((uintptr_t)dest & 0xffffff) | PVR_TA_YUV_CONV; + } + else if(type == PVR_DMA_VRAM64) { + dest_addr = ((uintptr_t)dest & 0xffffff) | PVR_TA_TEX_MEM; + } + else if(type == PVR_DMA_VRAM32) { + dest_addr = ((uintptr_t)dest & 0xffffff) | PVR_TA_TEX_MEM_32; + } + else if(type == PVR_DMA_VRAM64_SB) { + dest_addr = ((uintptr_t)dest & 0xffffff) | PVR_RAM_BASE_64_P0; + } + else if(type == PVR_DMA_VRAM32_SB) { + dest_addr = ((uintptr_t)dest & 0xffffff) | PVR_RAM_BASE_32_P0; + } + else { + dest_addr = dest; + } + + return dest_addr; +} + +int pvr_dma_transfer(void *src, uintptr_t dest, size_t count, int type, + int block, pvr_dma_callback_t callback, void *cbdata) { + uintptr_t src_addr = ((uintptr_t)src); /* Check for 32-byte alignment */ if(src_addr & 0x1F) { @@ -109,8 +132,7 @@ int pvr_dma_transfer(void *src, uintptr_t dest, size_t count, int type, return -1; } - pvr_dma[PVR_LMMODE0] = type == PVR_DMA_VRAM64 ? 0 : 1; - pvr_dma[PVR_STATE] = dest_addr; + pvr_dma[PVR_STATE] = pvr_dest_addr(dest, type); pvr_dma[PVR_LEN] = count; pvr_dma[PVR_DST] = 0x1; @@ -149,6 +171,12 @@ void pvr_dma_init(void) { dma_callback = NULL; dma_cbdata = 0; + /* Use 2x32-bit TA->VRAM buses for PVR_TA_TEX_MEM */ + pvr_dma[PVR_LMMODE0] = 0; + + /* Use single 32-bit TA->VRAM bus for PVR_TA_TEX_MEM_32 */ + pvr_dma[PVR_LMMODE1] = 1; + /* Hook the necessary interrupts */ asic_evt_set_handler(ASIC_EVT_PVR_DMA, pvr_dma_irq_hnd); asic_evt_enable(ASIC_EVT_PVR_DMA, ASIC_IRQ_DEFAULT); @@ -165,3 +193,51 @@ void pvr_dma_shutdown(void) { asic_evt_set_handler(ASIC_EVT_PVR_DMA, NULL); sem_destroy(&dma_done); } + +/* Copies n bytes from src to PVR dest, dest must be 32-byte aligned */ +void *pvr_sq_load(void *dest, const void *src, size_t n, int type) { + void *dma_area_ptr; + + if(pvr_dma[PVR_DST] != 0) { + dbglog(DBG_ERROR, "pvr_sq_load: PVR DMA has not finished\n"); + errno = EINPROGRESS; + return NULL; + } + + dma_area_ptr = (void *)pvr_dest_addr((uintptr_t)dest, type); + sq_cpy(dma_area_ptr, src, n); + + return dest; +} + +/* Fills n bytes at PVR dest with 16-bit c, dest must be 32-byte aligned */ +void *pvr_sq_set16(void *dest, uint32_t c, size_t n, int type) { + void *dma_area_ptr; + + if(pvr_dma[PVR_DST] != 0) { + dbglog(DBG_ERROR, "pvr_sq_set16: PVR DMA has not finished\n"); + errno = EINPROGRESS; + return NULL; + } + + dma_area_ptr = (void *)pvr_dest_addr((uintptr_t)dest, type); + sq_set16(dma_area_ptr, c, n); + + return dest; +} + +/* Fills n bytes at PVR dest with 32-bit c, dest must be 32-byte aligned */ +void *pvr_sq_set32(void *dest, uint32_t c, size_t n, int type) { + void *dma_area_ptr; + + if(pvr_dma[PVR_DST] != 0) { + dbglog(DBG_ERROR, "pvr_sq_set32: PVR DMA has not finished\n"); + errno = EINPROGRESS; + return NULL; + } + + dma_area_ptr = (void *)pvr_dest_addr((uintptr_t)dest, type); + sq_set32(dma_area_ptr, c, n); + + return dest; +} diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c b/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c index 06c0596..317568d 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_init_shutdown.c @@ -119,6 +119,7 @@ int pvr_init(pvr_init_params_t *params) { pvr_state.rnd_last_len = -1; pvr_state.vtx_buf_used = 0; pvr_state.vtx_buf_used_max = 0; + pvr_state.dr_used = 0; /* If we're on a VGA box, disable vertical smoothing */ if(vid_mode->cable_type == CT_VGA) { diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_internal.h b/kernel/arch/dreamcast/hardware/pvr/pvr_internal.h index 85ec9c7..9cfba93 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_internal.h +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_internal.h @@ -223,8 +223,7 @@ typedef struct { // Output address for to-texture mode uint32 to_txr_addr[2]; - // Number of additional OPBs to allocate, allowing more geometry per tile. - uint32 opb_overflow_count; + uint32 dr_used; } pvr_state_t; /* There will be exactly one of these in KOS (in pvr_globals.c) */ diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_scene.c b/kernel/arch/dreamcast/hardware/pvr/pvr_scene.c index e4135da..0b897ba 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_scene.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_scene.c @@ -176,6 +176,11 @@ int pvr_list_finish(void) { #endif /* !NDEBUG */ if(!pvr_state.dma_mode) { + /* Release Store Queues if they are used */ + if(pvr_state.dr_used) { + pvr_dr_finish(); + } + /* In case we haven't sent anything in this list, send a dummy */ pvr_blank_polyhdr(pvr_state.list_reg_open); @@ -183,7 +188,7 @@ int pvr_list_finish(void) { pvr_state.lists_closed |= (1 << pvr_state.list_reg_open); /* Send an EOL marker */ - sq_set32((void *)PVR_TA_INPUT, 0, 32); + pvr_sq_set32((void *)0, 0, 32, PVR_DMA_TA); } pvr_state.list_reg_open = -1; @@ -203,7 +208,7 @@ int pvr_prim(void * data, int size) { if(!pvr_state.dma_mode) { /* Send the data */ - sq_cpy((void *)PVR_TA_INPUT, data, size); + pvr_sq_load((void *)0, data, size, PVR_DMA_TA); } else { return pvr_list_prim(pvr_state.list_reg_open, data, size); @@ -227,6 +232,17 @@ int pvr_list_prim(pvr_list_t list, void * data, int size) { return 0; } +void pvr_dr_init(pvr_dr_state_t *vtx_buf_ptr) { + *vtx_buf_ptr = 0; + sq_lock((void *)PVR_TA_INPUT); + pvr_state.dr_used = 1; +} + +void pvr_dr_finish(void) { + pvr_state.dr_used = 0; + sq_unlock(); +} + int pvr_list_flush(pvr_list_t list) { (void)list; @@ -242,6 +258,11 @@ int pvr_scene_finish(void) { int i, o; volatile pvr_dma_buffers_t * b; + /* Release Store Queues if they are used */ + if(pvr_state.dr_used) { + pvr_dr_finish(); + } + // If we're in DMA mode, then this works a little differently... if(pvr_state.dma_mode) { // DBG(("pvr_scene_finish(dma -> %d)\n", pvr_state.ram_target)); diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_texture.c b/kernel/arch/dreamcast/hardware/pvr/pvr_texture.c index c2dad74..8fb435f 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_texture.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_texture.c @@ -21,10 +21,11 @@ /* Load raw texture data from an SH-4 buffer into PVR RAM */ void pvr_txr_load(void * src, pvr_ptr_t dst, uint32 count) { - if(count % 4) - count = (count & 0xfffffffc) + 4; + if(count & 3) { + count = (count + 4) & ~3; + } - sq_cpy((uint32 *)dst, (uint32 *)src, count); + pvr_sq_load((uint32 *)dst, (uint32 *)src, count, PVR_DMA_VRAM64); } /* Linear/iterative twiddling algorithm from Marcus' tatest */ @@ -194,14 +195,10 @@ void pvr_txr_load_kimg(kos_img_t *img, pvr_ptr_t dst, uint32 flags) { mutex_unlock((mutex_t *)&pvr_state.dma_lock); } ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-29 01:17:08
|
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 b8a7ada874b94303dca9288ecb0457ef1083051b (commit) via b70501e99cc7e2d1a62b343c93926a3ec26ea71a (commit) via c6ce6113bdbaf274c5ea1fcd000fd626a90fc6ec (commit) from d59f16e00557ccd548aa58b634d6c3604fd4cc11 (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 b8a7ada874b94303dca9288ecb0457ef1083051b Author: Falco Girgis <gyr...@gm...> Date: Thu Dec 28 19:16:30 2023 -0600 Separate Performance Counter Driver (#425) * Created separate performance counter driver - Moved the performance counter API out of the timer API and into its own files: arch/perfctr.h + kernel/perfctr.c - Implemented timer_ns_gettime64() function which previously had a name conflict with the performance counter version - Revamped the performance counter API by making it all strongly-typed, adding a few functions, and fleshing out the doxygen further - Performance counter timer falls back to timer_ns_gettime64() gracefull now when it has been disabled * Renamed API function + fixed Doxygen warnings * Addressing review feedback (typo). * Added arch/perfctr.h to main kos.h include * Added disclaimer to perf_ctr_timer_enable() docs - Explicitly mentioning it's only counting active CPU cycles, not during SLEEP. * Added a disclaimer to perf_cntr_timer_ns() as well * Doxygen update - Apparently \note and \warning do not work when used within the descriptions for enumeration values. commit b70501e99cc7e2d1a62b343c93926a3ec26ea71a Merge: d59f16e c6ce611 Author: Lawrence Sebald <ljs...@us...> Date: Thu Dec 28 17:15:22 2023 -0500 Merge pull request #442 from KallistiOS/over_600 Remove non-functional 800x608 mode commit c6ce6113bdbaf274c5ea1fcd000fd626a90fc6ec Author: QuzarDC <qu...@co...> Date: Thu Dec 28 15:04:55 2023 -0500 Remove non-functional 800x600 mode ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + examples/dreamcast/libdream/800x608/800x608.c | 54 ----- examples/dreamcast/libdream/800x608/Makefile | 4 - examples/dreamcast/libdream/Makefile | 2 +- examples/dreamcast/libdream/README | 2 - include/kos.h | 1 + kernel/arch/dreamcast/hardware/video.c | 34 ---- kernel/arch/dreamcast/include/arch/timer.h | 197 ++---------------- kernel/arch/dreamcast/include/dc/perfctr.h | 278 ++++++++++++++++++++++++++ kernel/arch/dreamcast/include/dc/video.h | 3 - kernel/arch/dreamcast/kernel/Makefile | 2 +- kernel/arch/dreamcast/kernel/init.c | 3 +- kernel/arch/dreamcast/kernel/perfctr.c | 101 ++++++++++ kernel/arch/dreamcast/kernel/timer.c | 86 +------- 14 files changed, 412 insertions(+), 356 deletions(-) delete mode 100644 examples/dreamcast/libdream/800x608/800x608.c delete mode 100644 examples/dreamcast/libdream/800x608/Makefile create mode 100644 kernel/arch/dreamcast/include/dc/perfctr.h create mode 100644 kernel/arch/dreamcast/kernel/perfctr.c diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 87b849a..4597f56 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -213,6 +213,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Improved performance of IRQ context save / restore [PC] - DC Increased resolution of TMU timers + date/time functions [FG && PC] - *** Increased resolution of clock() and CLOCKS_PER_SEC to microseconds [FG] +- DC Created separate performance counter driver and enhanced API [FG] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/examples/dreamcast/libdream/800x608/800x608.c b/examples/dreamcast/libdream/800x608/800x608.c deleted file mode 100644 index 15da9b1..0000000 --- a/examples/dreamcast/libdream/800x608/800x608.c +++ /dev/null @@ -1,54 +0,0 @@ -/* This sample program shows off 800x608, the mythical "unsupported" video - mode that Sega will probably complain doesn't work (like they did for - our 320x240 modes earlier on ;-). This will probably only work on a VGA - monitor and I highly recommend that you don't try it on a non-multisync. - Still needs some tweaking. - - In here I also demonstrate how to use the bfont BIOS font routines, and - how to initialize only selected parts of KOS (resulting in a much - smaller and less polluted binary). - - */ - -#include <kos.h> - -#define W 800 -#define H 608 - -int main(int argc, char **argv) { - int x, y; - - /* Press all buttons to exit */ - cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y, - (cont_btn_callback_t)arch_exit); - - printf("\n\n*** NOTE: This example is still a work in progress\n"); - printf(" as this resolution is not fully supported! ***\n\n"); - - /* Set video mode */ - vid_set_mode(DM_800x608, PM_RGB565); - - for(y = 0; y < H; y++) - for(x = 0; x < W; x++) { - int c = (x ^ y) & 255; - vram_s[y * W + x] = ((c >> 3) << 0); - } - - for(y = 0; y < H; y += 24) { - char tmp[16]; - sprintf(tmp, "%d", y); - bfont_draw_str(vram_s + y * W + 10, W, 0, tmp); - } - - for(x = 0; x < W; x += 100) { - char tmp[16]; - sprintf(tmp, "%d", x / 10); - bfont_draw_str(vram_s + 10 * W + x, W, 0, tmp); - } - - printf("\n\nPress all buttons simultaneously to exit.\n"); - fflush(stdout); - while(1); - - return 0; -} diff --git a/examples/dreamcast/libdream/800x608/Makefile b/examples/dreamcast/libdream/800x608/Makefile deleted file mode 100644 index 1030dd0..0000000 --- a/examples/dreamcast/libdream/800x608/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BIN = 800x608 -OBJS = 800x608.o - -include ../Makefile.prefab diff --git a/examples/dreamcast/libdream/Makefile b/examples/dreamcast/libdream/Makefile index b2224ad..b32976d 100644 --- a/examples/dreamcast/libdream/Makefile +++ b/examples/dreamcast/libdream/Makefile @@ -1,7 +1,7 @@ # This will make all the examples, leaving only the elf files. # If you want to clean everything, use 'clean'. -SUBDIRS = 320x240 640x480 800x608 rgb888 ta +SUBDIRS = 320x240 640x480 rgb888 ta SUBDIRS += cdfs SUBDIRS += spu SUBDIRS += keyboard mouse lcd vmu diff --git a/examples/dreamcast/libdream/README b/examples/dreamcast/libdream/README index b5727b3..ad8f3cc 100644 --- a/examples/dreamcast/libdream/README +++ b/examples/dreamcast/libdream/README @@ -8,8 +8,6 @@ hello -- Serial output, partial initialization cdfs -- Reading from a CD-Rom, quiet console output 320x240 -- 320x240x565 mode, full init plus de-init of TA 640x480 -- 640x480x565 mode, quiet console output -800x608 -- 800x608x565 experimental mode; partial init; - please see notes in C file rgb888 -- 640x480x888 mode ta -- Tile accelerator; full init, sans threads and romdisk keyboard -- Keyboard support, BIOS font; lowlevel only init diff --git a/include/kos.h b/include/kos.h index 563207f..d5d838f 100644 --- a/include/kos.h +++ b/include/kos.h @@ -100,6 +100,7 @@ __BEGIN_DECLS # include <dc/modem/modem.h> # include <dc/net/broadband_adapter.h> # include <dc/net/lan_adapter.h> +# include <dc/perfctr.h> # include <dc/pvr.h> # include <dc/scif.h> # include <dc/sd.h> diff --git a/kernel/arch/dreamcast/hardware/video.c b/kernel/arch/dreamcast/hardware/video.c index a655f1b..af1e608 100644 --- a/kernel/arch/dreamcast/hardware/video.c +++ b/kernel/arch/dreamcast/hardware/video.c @@ -89,23 +89,6 @@ vid_mode_t vid_builtin[DM_MODE_COUNT] = { { 0, 0, 0, 0 } }, - /* 800x608 NTSC 60Hz (VGA) [BROKEN!] */ - /* DM_800x608_VGA */ - { - DM_800x608, - 320, 240, - VID_INTERLACE, - 1/*CT_ANY*/, /* This will block the mode from being set. */ - 0, - 262, 857, - 164, 24, - 21, 82, - 141, 843, - 24, 264, - 0, 1, - { 0, 0, 0, 0 } - }, - /* 640x480 PAL 50Hz IL */ /* DM_640x480_PAL_IL */ { @@ -281,23 +264,6 @@ vid_mode_t vid_builtin[DM_MODE_COUNT] = { { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } }, - /* 800x608 NTSC 60Hz (VGA) [BROKEN!] */ - /* DM_800x608_VGA_MB */ - { - DM_800x608 | DM_MULTIBUFFER, - 320, 240, - VID_INTERLACE, - 1/*CT_ANY*/, /* This will block the mode from being set. */ - 0, - 262, 857, - 164, 24, - 21, 82, - 141, 843, - 24, 264, - 0, VID_MAX_FB, - { FBPOS(0), FBPOS(1), FBPOS(2), FBPOS(3) } - }, - /* 640x480 PAL 50Hz IL */ /* DM_640x480_PAL_IL_MB */ { diff --git a/kernel/arch/dreamcast/include/arch/timer.h b/kernel/arch/dreamcast/include/arch/timer.h index bc59e14..3072448 100644 --- a/kernel/arch/dreamcast/include/arch/timer.h +++ b/kernel/arch/dreamcast/include/arch/timer.h @@ -280,22 +280,21 @@ uint64_t timer_ms_gettime64(void); This function retrieves the number of seconds and microseconds since KOS was started. + \note To get the total number of microseconds since boot, + calculate (*secs * 1000000) + *usecs, or use the + timer_us_gettime64() function. + \param secs A pointer to store the number of seconds since boot into. \param usecs A pointer to store the number of microseconds past a second since boot. - \note To get the total number of microseconds since boot, - calculate (*secs * 1000000) + *usecs, or use the - timer_us_gettime64() function. */ void timer_us_gettime(uint32_t *secs, uint32_t *usecs); /** \brief Get the current uptime of the system (in microseconds). \ingroup tmu_uptime - This function retrieves the number of microseconds since KOS was started. It - should be more precise, in theory, than timer_ms_gettime64(), but the exact - amount of preciseness is undetermined. + This function retrieves the number of microseconds since KOS was started. \return The number of microseconds since KOS started. */ @@ -307,16 +306,26 @@ uint64_t timer_us_gettime64(void); This function retrieves the number of seconds and nanoseconds since KOS was started. + \note To get the total number of nanoseconds since boot, + calculate (*secs * 1000000000) + *nsecs, or use the + timer_ns_gettime64() function. + \param secs A pointer to store the number of seconds since boot into. \param nsecs A pointer to store the number of nanoseconds past a second since boot. - \note To get the total number of nanoseconds since boot, - calculate (*secs * 1000000000) + *nsecs, or use the - timer_ns_gettime64() function. */ void timer_ns_gettime(uint32_t *secs, uint32_t *nsecs); +/** \brief Get the current uptime of the system (in nanoseconds). + \ingroup tmu_uptime + + This function retrieves the number of nanoseconds since KOS was started. + + \return The number of nanoseconds since KOS started. +*/ +uint64_t timer_ns_gettime64(void); + /** \defgroup tmu_sleep Sleeping \brief Low-level thread sleeping \ingroup timers @@ -396,176 +405,6 @@ int timer_init(void); void timer_shutdown(void); /** \endcond */ -/** \defgroup perf_counters Performance Counters - \brief SH4 CPU Performance Counter Driver - \ingroup debugging - - The performance counter API exposes the SH4's hardware profiling registers, - which consist of two different sets of independently operable 64-bit - counters. -*/ - -/** \brief SH4 Performance Counter. - \ingroup perf_counters - - This counter is used by the ns_gettime function in this header. -*/ -#define PRFC0 0 - -/** \brief SH4 Performance Counter. - \ingroup perf_counters - - A counter that is not used by KOS. -*/ -#define PRFC1 1 - -/** \brief CPU Cycles Count Type. - \ingroup perf_counters - - Count cycles. At 5 ns increments, a 48-bit cycle counter can - run continuously for 16.33 days. -*/ -#define PMCR_COUNT_CPU_CYCLES 0 - -/** \brief Ratio Cycles Count Type. - \ingroup perf_counters - - CPU/bus ratio mode where cycles (where T = C x B / 24 and T is time, - C is count, and B is time of one bus cycle). -*/ -#define PMCR_COUNT_RATIO_CYCLES 1 - -/** \defgroup perf_counters_modes Modes - \brief Performance Counter Modes - \ingroup perf_counters - - This is the list of modes that are allowed to be passed into the perf_cntr_start() - function, representing different things you want to count. - - @{ -*/ -/* MODE DEFINITION VALUE MEASUREMENT TYPE & NOTES */ -#define PMCR_INIT_NO_MODE 0x00 /**< \brief None; Just here to be complete */ -#define PMCR_OPERAND_READ_ACCESS_MODE 0x01 /**< \brief Quantity; With cache */ -#define PMCR_OPERAND_WRITE_ACCESS_MODE 0x02 /**< \brief Quantity; With cache */ -#define PMCR_UTLB_MISS_MODE 0x03 /**< \brief Quantity */ -#define PMCR_OPERAND_CACHE_READ_MISS_MODE 0x04 /**< \brief Quantity */ -#define PMCR_OPERAND_CACHE_WRITE_MISS_MODE 0x05 /**< \brief Quantity */ -#define PMCR_INSTRUCTION_FETCH_MODE 0x06 /**< \brief Quantity; With cache */ -#define PMCR_INSTRUCTION_TLB_MISS_MODE 0x07 /**< \brief Quantity */ -#define PMCR_INSTRUCTION_CACHE_MISS_MODE 0x08 /**< \brief Quantity */ -#define PMCR_ALL_OPERAND_ACCESS_MODE 0x09 /**< \brief Quantity */ -#define PMCR_ALL_INSTRUCTION_FETCH_MODE 0x0a /**< \brief Quantity */ -#define PMCR_ON_CHIP_RAM_OPERAND_ACCESS_MODE 0x0b /**< \brief Quantity */ -/* No 0x0c */ -#define PMCR_ON_CHIP_IO_ACCESS_MODE 0x0d /**< \brief Quantity */ -#define PMCR_OPERAND_ACCESS_MODE 0x0e /**< \brief Quantity; With cache, counts both reads and writes */ -#define PMCR_OPERAND_CACHE_MISS_MODE 0x0f /**< \brief Quantity */ -#define PMCR_BRANCH_ISSUED_MODE 0x10 /**< \brief Quantity; Not the same as branch taken! */ -#define PMCR_BRANCH_TAKEN_MODE 0x11 /**< \brief Quantity */ -#define PMCR_SUBROUTINE_ISSUED_MODE 0x12 /**< \brief Quantity; Issued a BSR, BSRF, JSR, JSR/N */ -#define PMCR_INSTRUCTION_ISSUED_MODE 0x13 /**< \brief Quantity */ -#define PMCR_PARALLEL_INSTRUCTION_ISSUED_MODE 0x14 /**< \brief Quantity */ -#define PMCR_FPU_INSTRUCTION_ISSUED_MODE 0x15 /**< \brief Quantity */ -#define PMCR_INTERRUPT_COUNTER_MODE 0x16 /**< \brief Quantity */ -#define PMCR_NMI_COUNTER_MODE 0x17 /**< \brief Quantity */ -#define PMCR_TRAPA_INSTRUCTION_COUNTER_MODE 0x18 /**< \brief Quantity */ -#define PMCR_UBC_A_MATCH_MODE 0x19 /**< \brief Quantity */ -#define PMCR_UBC_B_MATCH_MODE 0x1a /**< \brief Quantity */ -/* No 0x1b-0x20 */ -#define PMCR_INSTRUCTION_CACHE_FILL_MODE 0x21 /**< \brief Cycles */ -#define PMCR_OPERAND_CACHE_FILL_MODE 0x22 /**< \brief Cycles */ -#define PMCR_ELAPSED_TIME_MODE 0x23 /**< \brief Cycles; For 200MHz CPU: 5ns per count in 1 cycle = 1 count mode, or around 417.715ps per count (increments by 12) in CPU/bus ratio mode */ -#define PMCR_PIPELINE_FREEZE_BY_ICACHE_MISS_MODE 0x24 /**< \brief Cycles */ -#define PMCR_PIPELINE_FREEZE_BY_DCACHE_MISS_MODE 0x25 /**< \brief Cycles */ -/* No 0x26 */ -#define PMCR_PIPELINE_FREEZE_BY_BRANCH_MODE 0x27 /**< \brief Cycles */ -#define PMCR_PIPELINE_FREEZE_BY_CPU_REGISTER_MODE 0x28 /**< \brief Cycles */ -#define PMCR_PIPELINE_FREEZE_BY_FPU_MODE 0x29 /**< \brief Cycles */ -/** @} */ - - -/** \brief Get a performance counter's settings. - \ingroup perf_counters - - This function returns a performance counter's settings. - - \param which The performance counter (i.e, \ref PRFC0 or PRFC1). - \retval 0 On success. -*/ -uint16 perf_cntr_get_config(int which); - -/** \brief Start a performance counter. - \ingroup perf_counters - - This function starts a performance counter - - \param which The counter to start (i.e, \ref PRFC0 or PRFC1). - \param mode Use one of the 33 modes listed above. - \param count_type PMCR_COUNT_CPU_CYCLES or PMCR_COUNT_RATIO_CYCLES. - \retval 0 On success. -*/ -int perf_cntr_start(int which, int mode, int count_type); - -/** \brief Stop a performance counter. - \ingroup perf_counters - - This function stops a performance counter that was started with perf_cntr_start(). - Stopping a counter retains its count. To clear the count use perf_cntr_clear(). - - \param which The counter to stop (i.e, \ref PRFC0 or PRFC1). - \retval 0 On success. -*/ -int perf_cntr_stop(int which); - -/** \brief Clear a performance counter. - \ingroup perf_counters - - This function clears a performance counter. It resets its count to zero. - This function stops the counter before clearing it because you can't clear - a running counter. - - \param which The counter to clear (i.e, \ref PRFC0 or PRFC1). - \retval 0 On success. -*/ -int perf_cntr_clear(int which); - -/** \brief Obtain the count of a performance counter. - \ingroup perf_counters - - This function simply returns the count of the counter. - - \param which The counter to read (i.e, \ref PRFC0 or PRFC1). - \return The counter's count. -*/ -uint64 perf_cntr_count(int which); - -/** \brief Enable the nanosecond timer. - \ingroup perf_counters - - This function enables the performance counter used for the timer_ns_gettime64() - function. This is on by default. The function uses \ref PRFC0 to do the work. -*/ -void timer_ns_enable(void); - -/** \brief Disable the nanosecond timer. - \ingroup perf_counters - - This function disables the performance counter used for the timer_ns_gettime64() - function. Generally, you will not want to do this, unless you have some need to use - the counter \ref PRFC0 for something else. -*/ -void timer_ns_disable(void); - -/** \brief Get the current uptime of the system (in nanoseconds). - \ingroup perf_counters - - This function retrieves the number of nanoseconds since KOS was started. - - \return The number of nanoseconds since KOS started. -*/ -uint64 timer_ns_gettime64(void); - __END_DECLS #endif /* __ARCH_TIMER_H */ diff --git a/kernel/arch/dreamcast/include/dc/perfctr.h b/kernel/arch/dreamcast/include/dc/perfctr.h new file mode 100644 index 0000000..a253b7b --- /dev/null +++ b/kernel/arch/dreamcast/include/dc/perfctr.h @@ -0,0 +1,278 @@ +/* KallistiOS ##version## + + arch/dreamcast/include/dc/perfctr.h + Copyright (C) 2023 Andy Barajas + Copyright (C) 2023 Falco Girgis + +*/ + +/** \file dc/perfctr.h + \brief Low-level performance counter API + \ingroup perf_counters + + This file contains the low-level driver for interacting with and + utilizing the SH4's two Performance Counters, which are primarily + used for profiling and performance tuning. + + \author MoopTheHedgehog + \author Andy Barajas + \author Falco Girgis +*/ + +#ifndef __DC_PERFCTR_H +#define __DC_PERFCTR_H + +#include <stdint.h> +#include <stdbool.h> + +#include <sys/cdefs.h> +__BEGIN_DECLS + +/** \defgroup perf_counters Performance Counters + \brief SH4 CPU Performance Counter Driver + \ingroup debugging + + The performance counter API exposes the SH4's hardware profiling registers, + which consist of two different sets of independently operable 48-bit + counters. + + @{ +*/ + +/** \brief Identifiers for the two SH4 performance counters */ +typedef enum perf_cntr { + /** \brief SH4 Performance Counter 0 + + The first performance counter ID. + + This counter is used by KOS by default to implement the \ref + perf_counters_timer API. Reference it for details on how to + reconfigure it if necessary. + */ + PRFC0, + + /** \brief SH4 Performance Counter 1 + + The second performance counter ID. + + This counter is not used anywhere internally by KOS. + */ + PRFC1 +} perf_cntr_t; + +/** \brief Count clock types for the SH4 performance counters */ +typedef enum perf_cntr_clock { + /** \brief CPU Cycles + + Count CPU cycles. At 5 ns increments (for 200Mhz CPU clock), a 48-bit + cycle counter can run continuously for 16.33 days. + */ + PMCR_COUNT_CPU_CYCLES, + + /** \brief Ratio Cycles + + Count CPU/bus ratio mode cycles (where `T = C x B / 24` and `T` is + time, `C` is count, and `B` is time of one bus cycle). ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-28 22:07:57
|
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 d59f16e00557ccd548aa58b634d6c3604fd4cc11 (commit) via 48c5a84d606f97c4f6b0badd82842472dd1cb640 (commit) via 092811a12fd2675a362bbd138cc58ac60c68c45f (commit) via dc35443b01ee39b172d57401185475b9be7e2441 (commit) via 0f1c2b17a9a71bb3c40c756404c737f7d53bb245 (commit) from a8f88c8315632fe0c7defc76a561f7442ce3f1eb (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 d59f16e00557ccd548aa58b634d6c3604fd4cc11 Author: Paul Cercueil <pa...@cr...> Date: Thu Dec 28 23:06:36 2023 +0100 dc: Fix parameter passing to fipr() and fipr_magnitude_sqr() (#438) The registers used for parameter passing is different whether the code was compiled with -m4-single-only, or just -m4 / -m4-single. Signed-off-by: Paul Cercueil <pa...@cr...> commit 48c5a84d606f97c4f6b0badd82842472dd1cb640 Author: Falco Girgis <gyr...@gm...> Date: Thu Dec 28 16:05:17 2023 -0600 Disabling Watchdog Timer on KOS exit and init (#439) * Disabling WDT on KOS exit and init now by default. - Kept running into issues where nongraceful exit would not call atexit(wdt_disable) - The only foolproof way to ensure graceful WDT behavior is to disable it within KOS itself for deinit/init paths - Updated examples to reflect this change * Removed warning from WDT documentation - Disabling it is no longer something the user has to worry about, if they intended for its lifetime to be that of the application commit 092811a12fd2675a362bbd138cc58ac60c68c45f Merge: a8f88c8 dc35443 Author: Lawrence Sebald <ljs...@us...> Date: Thu Dec 28 17:03:53 2023 -0500 Merge pull request #440 from KallistiOS/init_mallocstats_fix Fixed INIT_MALLOCSTATS KOS init flag commit dc35443b01ee39b172d57401185475b9be7e2441 Merge: 0f1c2b1 a8f88c8 Author: Falco Girgis <gyr...@gm...> Date: Thu Dec 28 13:27:22 2023 -0600 Merge branch 'master' into init_mallocstats_fix commit 0f1c2b17a9a71bb3c40c756404c737f7d53bb245 Author: Falco Girgis <gyr...@gm...> Date: Thu Dec 28 05:45:11 2023 -0600 Fixed INIT_MALLOCSTATS KOS init flag - It was not displaying properly previously when used - Apparently newlib had already shutdown standard I/O handling code when this code was called - Moved to KOS's logging mechanism to bypass newlib ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/basic/watchdog/watchdog.c | 13 ++---- examples/dreamcast/cpp/concurrency/concurrency.cpp | 3 -- kernel/arch/dreamcast/include/arch/args.h | 48 ++++++++++++++++++++++ kernel/arch/dreamcast/include/arch/wdt.h | 7 ---- kernel/arch/dreamcast/include/dc/fmath_base.h | 26 ++++++------ kernel/arch/dreamcast/kernel/init.c | 10 +++++ kernel/libc/koslib/malloc.c | 6 +-- 7 files changed, 78 insertions(+), 35 deletions(-) create mode 100644 kernel/arch/dreamcast/include/arch/args.h diff --git a/examples/dreamcast/basic/watchdog/watchdog.c b/examples/dreamcast/basic/watchdog/watchdog.c index 9a72812..79987e8 100644 --- a/examples/dreamcast/basic/watchdog/watchdog.c +++ b/examples/dreamcast/basic/watchdog/watchdog.c @@ -30,7 +30,7 @@ #define SEC (1000 * MSEC) /* Test configuration constants */ -#define WDT_PET_COUNT 2000 +#define WDT_PET_COUNT 4000 #define WDT_INTERVAL (500 * MSEC) #define WDT_SECONDS 10 #define WDT_COUNT_MAX ((WDT_SECONDS * SEC) / WDT_INTERVAL) @@ -56,14 +56,6 @@ int main(int argc, char *argv[]) { cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y, (cont_btn_callback_t)exit); - /* Note that is EXTREMELY important that the WDT gets disabled - when it is done being used, otherwise it can continue running - after the application exits and can interfere with DC-Load - operation. Since we have multiple exit points (one from returning - from main and one from the button callback), the safest thing to do - is to register wdt_disable() to be called automatically upon exit. */ - atexit(wdt_disable); - printf("\nEnabling WDT in watchdog mode!\n"); /* Enable watchdog mode with a period of 5.25ms, causing a manual @@ -81,7 +73,8 @@ int main(int argc, char *argv[]) { if(current_count > max_count) max_count = current_count; - wdt_pet(); + if(current_count) + wdt_pet(); } /* Immediately disable the WDT once we're done with it. */ diff --git a/examples/dreamcast/cpp/concurrency/concurrency.cpp b/examples/dreamcast/cpp/concurrency/concurrency.cpp index e4892ae..b623f30 100644 --- a/examples/dreamcast/cpp/concurrency/concurrency.cpp +++ b/examples/dreamcast/cpp/concurrency/concurrency.cpp @@ -706,9 +706,6 @@ int main(int argc, char* argv[]) { exit(EXIT_FAILURE); }, nullptr); - // Ensure that we disable the watchdog timer no matter how we exit - atexit(wdt_disable); - /* Spawn N automatically joined threads which will each spawn threads for each test case and asynchronously wait upon their results... Basically making each thread execute its own instances of every test case concurrently diff --git a/kernel/arch/dreamcast/include/arch/args.h b/kernel/arch/dreamcast/include/arch/args.h new file mode 100644 index 0000000..63a2c4e --- /dev/null +++ b/kernel/arch/dreamcast/include/arch/args.h @@ -0,0 +1,48 @@ +/* KallistiOS ##version## + + arch/dreamcast/include/arch/args.h + Copyright (C) 2023 Paul Cercueil <pa...@cr...> + +*/ + +/** \file arch/args.h + \brief Macros for getting argument registers in inline assembly + + This file contains the KOS_FPARG(n) macro, which resolves to the register + name that corresponds to the nth floating-point argument of a function. + + \author Paul Cercueil +*/ + +#if __SH4_SINGLE_ONLY__ +#define KOS_SH4_SINGLE_ONLY 1 +#else +#define KOS_SH4_SINGLE_ONLY 0 +#endif + +#define __KOS_FPARG_0_1 "fr4" +#define __KOS_FPARG_0_0 "fr5" +#define __KOS_FPARG_1_1 "fr5" +#define __KOS_FPARG_1_0 "fr4" +#define __KOS_FPARG_2_1 "fr6" +#define __KOS_FPARG_2_0 "fr7" +#define __KOS_FPARG_3_1 "fr7" +#define __KOS_FPARG_3_0 "fr6" +#define __KOS_FPARG_4_1 "fr8" +#define __KOS_FPARG_4_0 "fr9" +#define __KOS_FPARG_5_1 "fr9" +#define __KOS_FPARG_5_0 "fr8" +#define __KOS_FPARG_6_1 "fr10" +#define __KOS_FPARG_6_0 "fr11" +#define __KOS_FPARG_7_1 "fr11" +#define __KOS_FPARG_7_0 "fr10" + +#define __KOS_FPARG(n,single) __KOS_FPARG_##n##_##single +#define _KOS_FPARG(n,single) __KOS_FPARG(n,single) + +/** \brief Get the name of the nth floating-point argument register + * + * This macro resolves to the register name that corresponds to the nth + * floating-point argument of a function (starting from n=0). + */ +#define KOS_FPARG(n) _KOS_FPARG(n, KOS_SH4_SINGLE_ONLY) diff --git a/kernel/arch/dreamcast/include/arch/wdt.h b/kernel/arch/dreamcast/include/arch/wdt.h index b782507..f3e66e4 100644 --- a/kernel/arch/dreamcast/include/arch/wdt.h +++ b/kernel/arch/dreamcast/include/arch/wdt.h @@ -47,13 +47,6 @@ __BEGIN_DECLS The timer can be stopped in either mode by calling wdt_disable(). - \warning - Once the WDT has been enabled, special care must be taken to disable it - when exiting from the application. If left enabled, the WDT will continue - running beyond the lifetime of the application, causing either a reset or - an unhandled exception (depending on which mode was used), preventing you - from gracefully returning to a DC-Load session when testing. - \sa rtc */ diff --git a/kernel/arch/dreamcast/include/dc/fmath_base.h b/kernel/arch/dreamcast/include/dc/fmath_base.h index 02aaa2c..a08501d 100644 --- a/kernel/arch/dreamcast/include/dc/fmath_base.h +++ b/kernel/arch/dreamcast/include/dc/fmath_base.h @@ -18,6 +18,8 @@ #ifndef __DC_FMATH_BASE_H #define __DC_FMATH_BASE_H +#include <arch/args.h> + #include <sys/cdefs.h> __BEGIN_DECLS @@ -132,14 +134,14 @@ __BEGIN_DECLS /* Floating point inner product (dot product) */ #define __fipr(x, y, z, w, a, b, c, d) ({ \ - register float __x __asm__("fr5") = (x); \ - register float __y __asm__("fr4") = (y); \ - register float __z __asm__("fr7") = (z); \ - register float __w __asm__("fr6") = (w); \ - register float __a __asm__("fr9") = (a); \ - register float __b __asm__("fr8") = (b); \ - register float __c __asm__("fr11") = (c); \ - register float __d __asm__("fr10") = (d); \ + register float __x __asm__(KOS_FPARG(0)) = (x); \ + register float __y __asm__(KOS_FPARG(1)) = (y); \ + register float __z __asm__(KOS_FPARG(2)) = (z); \ + register float __w __asm__(KOS_FPARG(3)) = (w); \ + register float __a __asm__(KOS_FPARG(4)) = (a); \ + register float __b __asm__(KOS_FPARG(5)) = (b); \ + register float __c __asm__(KOS_FPARG(6)) = (c); \ + register float __d __asm__(KOS_FPARG(7)) = (d); \ __asm__ __volatile__( \ "fipr fv8,fv4" \ : "+f" (__z) \ @@ -150,10 +152,10 @@ __BEGIN_DECLS /* Floating point inner product w/self (square of vector magnitude) */ #define __fipr_magnitude_sqr(x, y, z, w) ({ \ - register float __x __asm__("fr5") = (x); \ - register float __y __asm__("fr4") = (y); \ - register float __z __asm__("fr7") = (z); \ - register float __w __asm__("fr6") = (w); \ + register float __x __asm__(KOS_FPARG(0)) = (x); \ + register float __y __asm__(KOS_FPARG(1)) = (y); \ + register float __z __asm__(KOS_FPARG(2)) = (z); \ + register float __w __asm__(KOS_FPARG(3)) = (w); \ __asm__ __volatile__( \ "fipr fv4,fv4" \ : "+f" (__z) \ diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index b224ab7..2342d94 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -17,6 +17,7 @@ #include <arch/memory.h> #include <arch/rtc.h> #include <arch/timer.h> +#include <arch/wdt.h> #include <dc/ubc.h> #include <dc/pvr.h> #include <dc/vmufs.h> @@ -250,6 +251,9 @@ void arch_main(void) { *DMAOR = 0x8201; #endif /* _arch_sub_naomi */ + /* Ensure the WDT is not enabled from a previous session */ + wdt_disable(); + /* Ensure that UBC is not enabled from a previous session */ ubc_disable_all(); @@ -289,6 +293,9 @@ void arch_shutdown(void) { dbglog(DBG_CRITICAL, "arch: shutting down kernel\n"); + /* Disable the WDT, if active */ + wdt_disable(); + /* Turn off UBC breakpoints, if any */ ubc_disable_all(); @@ -366,6 +373,9 @@ void arch_menu(void) { /* Called to shut down non-gracefully; assume the system is in peril and don't try to call the dtors */ void arch_abort(void) { + /* Disable the WDT, if active */ + wdt_disable(); + /* Turn off UBC breakpoints, if any */ ubc_disable_all(); diff --git a/kernel/libc/koslib/malloc.c b/kernel/libc/koslib/malloc.c index 2d7ea40..1dc1770 100644 --- a/kernel/libc/koslib/malloc.c +++ b/kernel/libc/koslib/malloc.c @@ -5280,11 +5280,11 @@ void mSTATs(void) { #endif - fprintf(stderr, "max system bytes = %10lu\n", + dbglog(DBG_CRITICAL, "max system bytes = %10lu\n", (CHUNK_SIZE_T)(mi.usmblks)); - fprintf(stderr, "system bytes = %10lu\n", + dbglog(DBG_CRITICAL, "system bytes = %10lu\n", (CHUNK_SIZE_T)(mi.arena + mi.hblkhd)); - fprintf(stderr, "in use bytes = %10lu\n", + dbglog(DBG_CRITICAL, "in use bytes = %10lu\n", (CHUNK_SIZE_T)(mi.uordblks + mi.hblkhd)); #ifdef WIN32 hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2023-12-28 18:14:08
|
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 a8f88c8315632fe0c7defc76a561f7442ce3f1eb (commit) from 30fa3aaa648db8f6ffaa6e85465663cdd0d2567c (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 a8f88c8315632fe0c7defc76a561f7442ce3f1eb Author: Colton Pawielski <cep...@us...> Date: Thu Dec 28 12:13:32 2023 -0600 Fix dc-chain host-detect include order (#432) Reverting a change in the include file order made in a9ac6f8. This caused issues with host detection that was required in init.mk ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/Makefile | 7 +++++-- utils/dc-chain/scripts/init.mk | 29 ----------------------------- utils/dc-chain/scripts/utils.mk | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 31 deletions(-) create mode 100644 utils/dc-chain/scripts/utils.mk diff --git a/utils/dc-chain/Makefile b/utils/dc-chain/Makefile index 1f79728..2d52f9c 100644 --- a/utils/dc-chain/Makefile +++ b/utils/dc-chain/Makefile @@ -20,12 +20,15 @@ else $(error The required $(config_file) file is missing) endif -# Initialization rules -include scripts/init.mk +# Download Functions +include scripts/utils.mk # Detect host machine include scripts/host-detect.mk +# Initialization rules +include scripts/init.mk + # Makefile variables include scripts/variables.mk diff --git a/utils/dc-chain/scripts/init.mk b/utils/dc-chain/scripts/init.mk index 49f12d9..d414586 100644 --- a/utils/dc-chain/scripts/init.mk +++ b/utils/dc-chain/scripts/init.mk @@ -171,32 +171,3 @@ warn_and_fallback = $(if $($(1)),, \ # Fallback to _tarball_type config options if _download_type was not provided packages = gdb $(foreach package, $(packages), $(eval $(call warn_and_fallback,$(package)_download_type,$(package)_tarball_type))) - -# Web downloaders command-lines -downloaders = curl wget -wget_cmd = wget -c $(if $(2),-O $(2)) '$(1)' -curl_cmd = curl --fail --location -C - $(if $(2),-o $(2),-O) '$(1)' - -ifneq ($(force_downloader),) -# Check if specified downloader is in supported list - web_downloader = $(if $(filter $(downloaders),$(force_downloader)),$(force_downloader)) -else -# If no downloader specified, check to see if any are detected - web_downloader = $(if $(shell command -v curl),curl,$(if $(shell command -v wget),wget)) -endif - -# Make sure valid downloader was found -ifeq ($(web_downloader),) - ifeq ($(force_downloader),) - $(error No supported downloader was found ($(downloaders))) - else - $(error Unsupported downloader ($(force_downloader)), select from ($(downloaders))) - endif -endif - -$(info Using $(web_downloader) as download tool) -# Function to call downloader -# Args: -# 1 - URL -# 2 - Output File (Optional) -web_download = $(call $(web_downloader)_cmd,$(1),$(2)) diff --git a/utils/dc-chain/scripts/utils.mk b/utils/dc-chain/scripts/utils.mk new file mode 100644 index 0000000..0c2fa4c --- /dev/null +++ b/utils/dc-chain/scripts/utils.mk @@ -0,0 +1,34 @@ +# Sega Dreamcast Toolchains Maker (dc-chain) +# This file is part of KallistiOS. +# +# Added by Colton Pawielski (2023) +# + +# Web downloaders command-lines +downloaders = curl wget +wget_cmd = wget -c $(if $(2),-O $(2)) '$(1)' +curl_cmd = curl --fail --location -C - $(if $(2),-o $(2),-O) '$(1)' + +ifneq ($(force_downloader),) +# Check if specified downloader is in supported list + web_downloader = $(if $(filter $(downloaders),$(force_downloader)),$(force_downloader)) +else +# If no downloader specified, check to see if any are detected + web_downloader = $(if $(shell command -v curl),curl,$(if $(shell command -v wget),wget)) +endif + +# Make sure valid downloader was found +ifeq ($(web_downloader),) + ifeq ($(force_downloader),) + $(error No supported downloader was found ($(downloaders))) + else + $(error Unsupported downloader ($(force_downloader)), select from ($(downloaders))) + endif +endif + +$(info Using $(web_downloader) as download tool) +# Function to call downloader +# Args: +# 1 - URL +# 2 - Output File (Optional) +web_download = $(call $(web_downloader)_cmd,$(1),$(2)) hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-24 18:52:59
|
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 30fa3aaa648db8f6ffaa6e85465663cdd0d2567c (commit) via cdd68d6f9a7a8d9c462c472f18b180ec64d7185d (commit) via 99a01bc4d08a34df220359dbe780e79ab3a1e243 (commit) from d21d9443bddf8bc311b5f3d755bdc083ab31ec8e (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 30fa3aaa648db8f6ffaa6e85465663cdd0d2567c Merge: d21d944 cdd68d6 Author: Lawrence Sebald <ljs...@us...> Date: Sun Dec 24 13:49:01 2023 -0500 Merge pull request #431 from KallistiOS/multibyte_iconv Added Toolchain Option to Enable Newlib's Multibyte/Wide Character Support commit cdd68d6f9a7a8d9c462c472f18b180ec64d7185d Author: darc <da...@pr...> Date: Sat Dec 23 14:50:30 2023 -0600 Update other dc-chain configurations with wide char support commit 99a01bc4d08a34df220359dbe780e79ab3a1e243 Author: Falco Girgis <gyr...@gm...> Date: Thu Dec 21 23:55:24 2023 -0600 Added option for enabling Newlib multibyte support - Added check for variable and application of flag to Newlib in init.mk - Added a (default disabled) flag for enabling it with a description in config.mk.stable.sample ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/config/config.mk.10.5.0.sample | 7 +++++++ utils/dc-chain/config/config.mk.11.4.0.sample | 7 +++++++ utils/dc-chain/config/config.mk.12.3.0.sample | 7 +++++++ utils/dc-chain/config/config.mk.9.3.0.sample | 7 +++++++ utils/dc-chain/config/config.mk.devel.sample | 7 +++++++ utils/dc-chain/config/config.mk.legacy.sample | 7 +++++++ utils/dc-chain/config/config.mk.stable.sample | 7 +++++++ utils/dc-chain/config/config.mk.winxp-latest.sample | 7 +++++++ utils/dc-chain/scripts/init.mk | 6 ++++++ 9 files changed, 62 insertions(+) diff --git a/utils/dc-chain/config/config.mk.10.5.0.sample b/utils/dc-chain/config/config.mk.10.5.0.sample index 824e44e..c5805b8 100644 --- a/utils/dc-chain/config/config.mk.10.5.0.sample +++ b/utils/dc-chain/config/config.mk.10.5.0.sample @@ -138,6 +138,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/config/config.mk.11.4.0.sample b/utils/dc-chain/config/config.mk.11.4.0.sample index 818341e..b3d2892 100644 --- a/utils/dc-chain/config/config.mk.11.4.0.sample +++ b/utils/dc-chain/config/config.mk.11.4.0.sample @@ -138,6 +138,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/config/config.mk.12.3.0.sample b/utils/dc-chain/config/config.mk.12.3.0.sample index 620d224..ef590d2 100644 --- a/utils/dc-chain/config/config.mk.12.3.0.sample +++ b/utils/dc-chain/config/config.mk.12.3.0.sample @@ -138,6 +138,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/config/config.mk.9.3.0.sample b/utils/dc-chain/config/config.mk.9.3.0.sample index c1345be..4118fa1 100644 --- a/utils/dc-chain/config/config.mk.9.3.0.sample +++ b/utils/dc-chain/config/config.mk.9.3.0.sample @@ -138,6 +138,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/config/config.mk.devel.sample b/utils/dc-chain/config/config.mk.devel.sample index 6ab895a..6ca25e9 100644 --- a/utils/dc-chain/config/config.mk.devel.sample +++ b/utils/dc-chain/config/config.mk.devel.sample @@ -148,6 +148,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/config/config.mk.legacy.sample b/utils/dc-chain/config/config.mk.legacy.sample index 6d93450..8fdeaee 100644 --- a/utils/dc-chain/config/config.mk.legacy.sample +++ b/utils/dc-chain/config/config.mk.legacy.sample @@ -138,6 +138,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/config/config.mk.stable.sample b/utils/dc-chain/config/config.mk.stable.sample index ff1efd8..86fce76 100644 --- a/utils/dc-chain/config/config.mk.stable.sample +++ b/utils/dc-chain/config/config.mk.stable.sample @@ -138,6 +138,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/config/config.mk.winxp-latest.sample b/utils/dc-chain/config/config.mk.winxp-latest.sample index 97ac784..1d380e5 100644 --- a/utils/dc-chain/config/config.mk.winxp-latest.sample +++ b/utils/dc-chain/config/config.mk.winxp-latest.sample @@ -138,6 +138,13 @@ thread_model=kos # ptrdiff_t, intmax_t, and sized integral types. newlib_c99_formats=1 +# Multibyte Character Set Support (1|0) +# Define this to build Newlib with additional multibyte support. This enables +# three special locales: "C-JIS", "C-SJIS", and "C-EUCJP". The multibyte +# support extends to the mb and wc functions in stdlib as well as format +# characters for the printf and scanf family of routines. +#newlib_multibyte=1 + # Optimize Newlib for Space (1|0) # Define this to enable optimizing for space when building Newlib. This will # build Newlib with compiler flags which favor smaller code sizes over faster diff --git a/utils/dc-chain/scripts/init.mk b/utils/dc-chain/scripts/init.mk index e59936b..49f12d9 100644 --- a/utils/dc-chain/scripts/init.mk +++ b/utils/dc-chain/scripts/init.mk @@ -146,6 +146,12 @@ ifdef newlib_opt_space endif endif +ifdef newlib_multibyte + ifneq (0,$(newlib_multibyte)) + newlib_extra_configure_args += --enable-newlib-mb + endif +endif + # Function to verify variable is not empty # Args: # 1 - Variable Name hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2023-12-24 17:57:54
|
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 d21d9443bddf8bc311b5f3d755bdc083ab31ec8e (commit) from e52b269ed800f2bcc18271c27a54bcd7c1a3a76f (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 d21d9443bddf8bc311b5f3d755bdc083ab31ec8e Author: Colton Pawielski <cep...@us...> Date: Sun Dec 24 11:57:09 2023 -0600 Properly clean dc-chain builds from SH4 Pass1 & GDB (#433) * Fix Clean of dc-chain Pass1 Due to splitting Pass 1 & 2 build folders, both ARM & SH4 Pass 1 folders need to be removed if clean=1 is specified in the configuration. This allows the removal of a "hack" for removing the ARM Pass 1 build folder. * Clean GDB build folder if clean=1 ----------------------------------------------------------------------- Summary of changes: utils/dc-chain/scripts/build.mk | 1 - utils/dc-chain/scripts/gcc-pass1.mk | 1 + utils/dc-chain/scripts/gdb.mk | 15 +++++++++------ utils/dc-chain/scripts/options.mk | 5 ----- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/utils/dc-chain/scripts/build.mk b/utils/dc-chain/scripts/build.mk index ec3ed2b..e183ebb 100644 --- a/utils/dc-chain/scripts/build.mk +++ b/utils/dc-chain/scripts/build.mk @@ -10,7 +10,6 @@ build-sh4: build-sh4-gcc build-arm: build-arm-gcc build-sh4-gcc: build-sh4-gcc-pass2 build-arm-gcc: build-arm-gcc-pass1 - $(clean_arm_hack) build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib fixup_sh4_newlib_stamp = fixup-sh4-newlib.stamp diff --git a/utils/dc-chain/scripts/gcc-pass1.mk b/utils/dc-chain/scripts/gcc-pass1.mk index ab4c0cb..20c71c5 100644 --- a/utils/dc-chain/scripts/gcc-pass1.mk +++ b/utils/dc-chain/scripts/gcc-pass1.mk @@ -30,3 +30,4 @@ $(build_gcc_pass1): logdir $(to_log) $(MAKE) $(makejobs) -C $(build) DESTDIR=$(DESTDIR) $(to_log) $(MAKE) -C $(build) $(install_mode) DESTDIR=$(DESTDIR) $(to_log) + $(clean_up) diff --git a/utils/dc-chain/scripts/gdb.mk b/utils/dc-chain/scripts/gdb.mk index 610feea..42c72fa 100644 --- a/utils/dc-chain/scripts/gdb.mk +++ b/utils/dc-chain/scripts/gdb.mk @@ -43,9 +43,9 @@ $(stamp_gdb_build): patch_gdb @echo "+++ Building GDB..." rm -f $@ > $(log) - -rm -rf build-$(gdb_name) - mkdir build-$(gdb_name) - cd build-$(gdb_name); \ + -rm -rf $(build) + mkdir $(build) + cd $(build); \ ../$(gdb_name)/configure \ --disable-werror \ --prefix=$(sh_prefix) \ @@ -55,7 +55,7 @@ $(stamp_gdb_build): patch_gdb $(macos_gdb_configure_args) \ $(static_flag) \ $(to_log) - $(MAKE) $(makejobs) -C build-$(gdb_name) $(to_log) + $(MAKE) $(makejobs) -C $(build) $(to_log) touch $@ # This step runs post install to sign the sh-elf-gdb binary on MacOS @@ -77,17 +77,20 @@ install_gdb: $(GDB_INSTALL_TARGET) # The 'install-strip' mode support is partial in GDB so there is a little hack # below to remove useless debug symbols # See: https://sourceware.org/legacy-ml/gdb-patches/2012-01/msg00335.html + $(stamp_gdb_install): build_gdb @echo "+++ Installing GDB..." rm -f $@ - $(MAKE) -C build-$(gdb_name) install DESTDIR=$(DESTDIR) $(to_log) + $(MAKE) -C $(build) install DESTDIR=$(DESTDIR) $(to_log) @if test "$(install_mode)" = "install-strip"; then \ - $(MAKE) -C build-$(gdb_name)/gdb $(install_mode) DESTDIR=$(DESTDIR) $(to_log); \ + $(MAKE) -C $(build)/gdb $(install_mode) DESTDIR=$(DESTDIR) $(to_log); \ gdb_run=$(sh_prefix)/bin/$(sh_target)-run$(executable_extension); \ if test -f $${gdb_run}; then \ strip $${gdb_run}; \ fi; \ fi; touch $@ + $(clean_up) +gdb: build = build-$(gdb_name) gdb: install_gdb diff --git a/utils/dc-chain/scripts/options.mk b/utils/dc-chain/scripts/options.mk index 986bc57..6f85049 100644 --- a/utils/dc-chain/scripts/options.mk +++ b/utils/dc-chain/scripts/options.mk @@ -11,11 +11,6 @@ ifeq (1,$(erase)) @echo "+++ Cleaning up $(build)..." -rm -rf $(build) endef - # Hack to clean up ARM gcc pass 1 - define clean_arm_hack - @echo "+++ Cleaning up build-gcc-$(arm_target)-$(gcc_ver)..." - -rm -rf build-gcc-$(arm_target)-$(gcc_ver) - endef endif # If verbose=1, display output to screen as well as log files hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2023-12-23 20:43:27
|
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 e52b269ed800f2bcc18271c27a54bcd7c1a3a76f (commit) from c6bd4112b76ef25edb63bde4352dc89e7f41a805 (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 e52b269ed800f2bcc18271c27a54bcd7c1a3a76f Author: Andy Barajas <and...@gm...> Date: Sat Dec 23 12:42:36 2023 -0800 Fixed misspelled words (#424) * Use codespell to find misspelled words. Fix them. * Apply suggestions from code review * Update kernel/libc/koslib/malloc.c * Apply suggestions from code review ----------------------------------------------------------------------- Summary of changes: README.md | 2 +- addons/include/ext2/fs_ext2.h | 2 +- addons/include/kos/netcfg.h | 4 ++-- addons/include/kos/pcx.h | 6 +++--- addons/libkosext2fs/fs_ext2.c | 4 ++-- addons/libkosext2fs/inode.c | 2 +- addons/libkosfat/Makefile | 2 +- addons/libkosfat/fs_fat.c | 2 +- addons/libkosutils/pcx_small.c | 2 +- addons/libnavi/navi_ide.c | 2 +- doc/CHANGELOG | 22 +++++++++++----------- doc/FAQ | 2 +- doc/LICENSE | 2 +- doc/README | 2 +- doc/RELNOTES | 12 ++++++------ doc/coding_style.txt | 4 ++-- doc/dreamcast/modem.txt | 12 ++++++------ doc/environ.sh.sample | 2 +- examples/dreamcast/2ndmix/2ndmix.c | 2 +- .../dreamcast/basic/threading/atomics/atomics.c | 2 +- examples/dreamcast/cpp/gltest/gltest.cpp | 2 +- examples/dreamcast/gldc/nehe/nehe26/data/txt2bin.c | 2 +- examples/dreamcast/gldc/nehe/nehe26/nehe26.c | 2 +- examples/dreamcast/kgl/basic/gl/gltest.c | 2 +- examples/dreamcast/kgl/demos/blur/radial_blur.c | 2 +- examples/dreamcast/kgl/demos/specular/specular.c | 2 +- examples/dreamcast/kgl/nehe/nehe26/nehe26.c | 2 +- examples/dreamcast/libdream/lcd/lcd.c | 2 +- examples/dreamcast/libdream/ta/ta.c | 2 +- .../dreamcast/pvr/texture_render/texture_render.c | 2 +- .../dreamcast/pvr/yuv_converter/YUV420/yuv420.c | 2 +- .../dreamcast/pvr/yuv_converter/YUV422/yuv422.c | 2 +- examples/dreamcast/rumble/rumble.c | 4 ++-- .../dreamcast/sound/ghettoplay-vorbis/songmenu.c | 2 +- examples/dreamcast/sound/multi-stream/main.c | 2 +- examples/dreamcast/vmu/vmu_beep/beep.c | 2 +- examples/dreamcast/vmu/vmu_game/tetris.s | 2 +- include/arpa/inet.h | 2 +- include/kos/cdefs.h | 2 +- include/kos/cond.h | 4 ++-- include/kos/dbgio.h | 2 +- include/kos/elf.h | 2 +- include/kos/exports.h | 2 +- include/kos/fs.h | 4 ++-- include/kos/fs_pty.h | 2 +- include/kos/fs_ramdisk.h | 2 +- include/kos/fs_socket.h | 6 +++--- include/kos/genwait.h | 6 +++--- include/kos/init.h | 4 ++-- include/kos/mutex.h | 6 +++--- include/kos/net.h | 6 +++--- include/kos/recursive_lock.h | 2 +- include/kos/rwsem.h | 2 +- include/kos/sem.h | 2 +- include/kos/thread.h | 6 +++--- include/libgen.h | 2 +- include/malloc.h | 2 +- include/netdb.h | 2 +- include/netinet/in.h | 4 ++-- include/netinet/tcp.h | 4 ++-- include/pthread.h | 2 +- include/sys/_types.h | 2 +- include/sys/select.h | 4 ++-- include/sys/stdio.h | 2 +- include/threads.h | 4 ++-- kernel/arch/dreamcast/fs/fs_iso9660.c | 6 +++--- kernel/arch/dreamcast/fs/fs_vmu.c | 2 +- kernel/arch/dreamcast/hardware/cdrom.c | 2 +- kernel/arch/dreamcast/hardware/g1ata.c | 4 ++-- kernel/arch/dreamcast/hardware/maple/controller.c | 2 +- kernel/arch/dreamcast/hardware/maple/keyboard.c | 4 ++-- .../dreamcast/hardware/maple/maple_init_shutdown.c | 2 +- kernel/arch/dreamcast/hardware/maple/vmu.c | 4 ++-- kernel/arch/dreamcast/hardware/modem/mdata.c | 4 ++-- kernel/arch/dreamcast/hardware/modem/mintr.c | 6 +++--- .../dreamcast/hardware/network/broadband_adapter.c | 8 ++++---- .../arch/dreamcast/hardware/network/lan_adapter.c | 4 ++-- kernel/arch/dreamcast/hardware/pvr/pvr_dma.c | 2 +- kernel/arch/dreamcast/hardware/pvr/pvr_fog.c | 6 +++--- .../arch/dreamcast/hardware/pvr/pvr_fog_tables.h | 8 ++++---- kernel/arch/dreamcast/hardware/pvr/pvr_internal.h | 2 +- kernel/arch/dreamcast/hardware/pvr/pvr_mem.c | 2 +- kernel/arch/dreamcast/hardware/pvr/pvr_mem_core.c | 10 +++++----- kernel/arch/dreamcast/hardware/pvr/pvr_mem_core.h | 6 +++--- kernel/arch/dreamcast/hardware/spu.c | 2 +- kernel/arch/dreamcast/include/arch/irq.h | 2 +- kernel/arch/dreamcast/include/arch/memory.h | 16 ++++++++-------- kernel/arch/dreamcast/include/arch/mmu.h | 12 ++++++------ kernel/arch/dreamcast/include/arch/rtc.h | 2 +- kernel/arch/dreamcast/include/arch/timer.h | 4 ++-- kernel/arch/dreamcast/include/arch/wdt.h | 2 +- kernel/arch/dreamcast/include/dc/asic.h | 2 +- kernel/arch/dreamcast/include/dc/biosfont.h | 2 +- kernel/arch/dreamcast/include/dc/maple.h | 10 +++++----- .../arch/dreamcast/include/dc/maple/controller.h | 8 ++++---- kernel/arch/dreamcast/include/dc/maple/keyboard.h | 2 +- kernel/arch/dreamcast/include/dc/maple/vmu.h | 8 ++++---- kernel/arch/dreamcast/include/dc/matrix.h | 2 +- kernel/arch/dreamcast/include/dc/minifont.h | 2 +- kernel/arch/dreamcast/include/dc/modem/modem.h | 2 +- kernel/arch/dreamcast/include/dc/pvr.h | 6 +++--- kernel/arch/dreamcast/include/dc/sd.h | 2 +- kernel/arch/dreamcast/include/dc/sound/aica_comm.h | 2 +- kernel/arch/dreamcast/include/dc/sound/stream.h | 2 +- kernel/arch/dreamcast/include/dc/video.h | 2 +- kernel/arch/dreamcast/kernel/entry.s | 4 ++-- kernel/arch/dreamcast/kernel/gdb_stub.c | 4 ++-- kernel/arch/dreamcast/kernel/irq.c | 2 +- kernel/arch/dreamcast/kernel/mm.c | 2 +- kernel/arch/dreamcast/kernel/mmu.c | 8 ++++---- kernel/arch/dreamcast/kernel/stack.c | 2 +- kernel/arch/dreamcast/sound/arm/aica.h | 2 +- kernel/arch/dreamcast/sound/arm/crt0.s | 2 +- kernel/arch/dreamcast/sound/snd_iface.c | 2 +- kernel/arch/dreamcast/sound/snd_mem.c | 2 +- kernel/arch/dreamcast/sound/snd_stream.c | 2 +- kernel/arch/dreamcast/util/vmu_fb.c | 2 +- kernel/exports/nmmgr.c | 2 +- kernel/fs/fs_pty.c | 4 ++-- kernel/fs/fs_ramdisk.c | 2 +- kernel/fs/fs_romdisk.c | 2 +- kernel/libc/c11/atomics.c | 4 ++-- kernel/libc/koslib/getaddrinfo.c | 2 +- kernel/libc/koslib/malloc.c | 14 +++++++------- kernel/net/net_arp.c | 2 +- kernel/net/net_core.c | 2 +- kernel/net/net_ipv4_frag.c | 2 +- kernel/net/net_tcp.c | 4 ++-- kernel/net/net_thd.c | 2 +- kernel/thread/thread.c | 6 +++--- utils/bincnv/bincnv.c | 2 +- utils/dc-chain/README.md | 6 +++--- utils/dc-chain/config/config.mk.10.5.0.sample | 4 ++-- utils/dc-chain/config/config.mk.11.4.0.sample | 4 ++-- utils/dc-chain/config/config.mk.12.3.0.sample | 4 ++-- utils/dc-chain/config/config.mk.9.3.0.sample | 4 ++-- utils/dc-chain/config/config.mk.devel.sample | 4 ++-- utils/dc-chain/config/config.mk.legacy.sample | 4 ++-- utils/dc-chain/config/config.mk.stable.sample | 4 ++-- .../dc-chain/config/config.mk.winxp-latest.sample | 4 ++-- utils/dc-chain/doc/changelog.txt | 2 +- utils/dc-chain/patches/gcc/gthr-kos.h | 2 +- utils/dc-chain/scripts/download.mk | 2 +- utils/dc-chain/scripts/host-detect.mk | 2 +- utils/dcbumpgen/readpng.h | 2 +- utils/gentexfont/gentexfont.c | 2 +- utils/gentexfont/readme.txt | 2 +- utils/isotest/isotest.c | 6 +++--- utils/kmgenc/readpng.h | 2 +- utils/makeip/README.md | 4 ++-- utils/makeip/gimp/file-mr.py | 6 +++--- utils/rdtest/rdtest.c | 4 ++-- utils/vqenc/readpng.h | 2 +- utils/vqenc/vqenc.c | 4 ++-- 154 files changed, 278 insertions(+), 278 deletions(-) diff --git a/README.md b/README.md index 2eeac26..021455f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ KOS is an unofficial development kit for the SEGA Dreamcast game console with some support for the NAOMI and NAOMI 2 arcade boards. -KOS was developed from scratch over the internet by a group of free software developers and has no relation to the official Sega Katana or Microsoft Windows CE Dreamcast development kits. This has allowed it to fuel a thriving Dreamcast homebrew scene, powering many commercial releases for the platform over the years. It supports a signficiant portion of the Dreamcast's hardware capabilities and a wide variety of peripherals, accessories, and add-ons for the console, including custom hardware modifications that have been created by the scene. +KOS was developed from scratch over the internet by a group of free software developers and has no relation to the official Sega Katana or Microsoft Windows CE Dreamcast development kits. This has allowed it to fuel a thriving Dreamcast homebrew scene, powering many commercial releases for the platform over the years. It supports a significant portion of the Dreamcast's hardware capabilities and a wide variety of peripherals, accessories, and add-ons for the console, including custom hardware modifications that have been created by the scene. Despite the console's age, KOS offers an extremely modern, programmer-friendly development environment. Using the latest GCC toolchain, it supports the entirety of C17 and C++20 including their standard libraries, along with support for portions of C23, C++23, Objective-C, and various POSIX APIs. Additionally, KOS-ports offers a rich set of add-on libraries such as SDL, OpenGL, OpenAL, and Lua for the platform. diff --git a/addons/include/ext2/fs_ext2.h b/addons/include/ext2/fs_ext2.h index 715f9ab..95f66a9 100644 --- a/addons/include/ext2/fs_ext2.h +++ b/addons/include/ext2/fs_ext2.h @@ -21,7 +21,7 @@ of ext2 and the availability of programs/drivers to read ext2 on most major OSes available for PCs today. The second purpose of this filesystem driver is to provide an alternative for fs_romdisk when swapping out disk images at - runtime. Basically, if a disk image is useful to you, but cacheing it fully + runtime. Basically, if a disk image is useful to you, but caching it fully in memory is not important, then you could rig up a relatively simple interface with this filesystem driver. diff --git a/addons/include/kos/netcfg.h b/addons/include/kos/netcfg.h index 3348b16..5ea1036 100644 --- a/addons/include/kos/netcfg.h +++ b/addons/include/kos/netcfg.h @@ -135,12 +135,12 @@ int netcfg_load_flash(netcfg_t * out); \ingroup netcfg This function loads the network configuration data, searching in multiple - locations to attempt to find a file with a stored configurtion. This + locations to attempt to find a file with a stored configuration. This function will attempt to read the configuration from each VMU first (from a file named net.cfg), then it will try the flashrom, followed by the current working directory, and lastly the root of the CD. - \param out Buffer to store the parsed configuraiton. + \param out Buffer to store the parsed configuration. \return 0 on success, <0 on failure. */ diff --git a/addons/include/kos/pcx.h b/addons/include/kos/pcx.h index 76efb05..bb1739a 100644 --- a/addons/include/kos/pcx.h +++ b/addons/include/kos/pcx.h @@ -12,7 +12,7 @@ \brief Small PCX Loader. This module provides a few functions used for loading PCX files. These - funcions were mainly for use on the GBA port of KallistiOS (which has been + functions were mainly for use on the GBA port of KallistiOS (which has been removed from the tree), although they can be used pretty much anywhere. That said, libpcx is generally more useful than these functions for use on the Dreamcast. @@ -39,7 +39,7 @@ __BEGIN_DECLS \param w_out Buffer to return the width of the image in. \param h_out Buffer to return the height of the image in. \param pic_out Buffer to store image data in. - \return 0 on succes, < 0 on failure. + \return 0 on success, < 0 on failure. */ int pcx_load_flat(const char *fn, int *w_out, int *h_out, void *pic_out); @@ -58,7 +58,7 @@ int pcx_load_flat(const char *fn, int *w_out, int *h_out, void *pic_out); height bytes in size. \param pal_out Buffer to store the palette data in. This should be allocated to hold 256 uint16_t values. - \return 0 on succes, < 0 on failure. + \return 0 on success, < 0 on failure. */ int pcx_load_palette(const char *fn, int *w_out, int *h_out, void *pic_out, void *pal_out); diff --git a/addons/libkosext2fs/fs_ext2.c b/addons/libkosext2fs/fs_ext2.c index d2365bc..e3d004f 100644 --- a/addons/libkosext2fs/fs_ext2.c +++ b/addons/libkosext2fs/fs_ext2.c @@ -723,7 +723,7 @@ static int int_rename(fs_ext2_fs_t *fs, const char *fn1, const char *fn2, /* Make sure the user isn't trying to do something really stupid, like moving a directory such that it would be an ancestor of itself... Note - that this is really inefficient, but without cacheing the entire + that this is really inefficient, but without caching the entire directory structure as we work down it, I'm not sure how I could make it much better... */ if(!isfile && dpinode != pinode) { @@ -1882,7 +1882,7 @@ static vfs_handler_t vh = { NMMGR_LIST_INIT /* list */ }, - 0, NULL, /* no cacheing, privdata */ + 0, NULL, /* no caching, privdata */ fs_ext2_open, /* open */ fs_ext2_close, /* close */ diff --git a/addons/libkosext2fs/inode.c b/addons/libkosext2fs/inode.c index 9963831..72193cd 100644 --- a/addons/libkosext2fs/inode.c +++ b/addons/libkosext2fs/inode.c @@ -35,7 +35,7 @@ char *strdup(const char *); #define INODE_FLAG_DIRTY 0x00000001 -/* Internal inode storage structure. This is used for cacheing used inodes. */ +/* Internal inode storage structure. This is used for caching used inodes. */ static struct int_inode { /* Start with the on-disk inode itself to make the put() function easier. DO NOT MOVE THIS FROM THE BEGINNING OF THE STRUCTURE. */ diff --git a/addons/libkosfat/Makefile b/addons/libkosfat/Makefile index de4d0ae..80f19ca 100644 --- a/addons/libkosfat/Makefile +++ b/addons/libkosfat/Makefile @@ -4,7 +4,7 @@ TARGET = libkosfat.a OBJS = fat.o bpb.o fatfs.o directory.o ucs.o fs_fat.o -# Make sure everything comiles nice and cleanly (or not at all). +# Make sure everything compiles nice and cleanly (or not at all). KOS_CFLAGS += -W -Wextra -pedantic -std=c99 include $(KOS_BASE)/addons/Makefile.prefab diff --git a/addons/libkosfat/fs_fat.c b/addons/libkosfat/fs_fat.c index 35510c2..7c25bd4 100644 --- a/addons/libkosfat/fs_fat.c +++ b/addons/libkosfat/fs_fat.c @@ -1307,7 +1307,7 @@ static vfs_handler_t vh = { NMMGR_LIST_INIT /* list */ }, - 0, NULL, /* no cacheing, privdata */ + 0, NULL, /* no caching, privdata */ fs_fat_open, /* open */ fs_fat_close, /* close */ diff --git a/addons/libkosutils/pcx_small.c b/addons/libkosutils/pcx_small.c index 7caf142..7f8ce79 100644 --- a/addons/libkosutils/pcx_small.c +++ b/addons/libkosutils/pcx_small.c @@ -113,7 +113,7 @@ int pcx_load_flat(const char *fn, int *w_out, int *h_out, void *pic_out) { return 0; } -/* This version writes out a seperate 15-bit BGR palette and decodes the paletted data +/* This version writes out a separate 15-bit BGR palette and decodes the paletted data into another buffer 16 bits at a time. */ int pcx_load_palette(const char *fn, int *w_out, int *h_out, void *pic_out, void *pal_out) { pcx_hdr *pcxh; diff --git a/addons/libnavi/navi_ide.c b/addons/libnavi/navi_ide.c index cd09fbb..e540754 100644 --- a/addons/libnavi/navi_ide.c +++ b/addons/libnavi/navi_ide.c @@ -100,7 +100,7 @@ static void wait_data(void) { } } -/* Reads a chunk of ascii out of the hd parms table */ +/* Reads a chunk of ascii out of the hd params table */ static char *get_ascii(uint16 *in_data, uint32 off_start, uint32 off_end) { static char ret_val [255]; unsigned loop; diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 5f6f731..87b849a 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -57,7 +57,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- all the way back in 2005 [Fredrik Ehnbom == FE] - *** Added the fs_path_append() function to append path components [LS] - *** Added a nanosleep() function to koslib by request [LS] -- *** Added rewinddir() support to the VFS and serveral filesystems [LS] +- *** Added rewinddir() support to the VFS and several filesystems [LS] - *** Added in C11 threading support [LS] - *** Added UDP Lite support to the network stack [LS] - DC Adjust sq_cpy() to use a const pointer for the source [JP] @@ -198,7 +198,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Rework romdisks [PC] - DC Refactored g2bus API, converted magic values to macros, added dc/fifo.h, dc/dmac.h file [AB] -- DC Fixes and improvments for G1 ATA devices [Ruslan Rostovtsev == RR] +- DC Fixes and improvements for G1 ATA devices [Ruslan Rostovtsev == RR] - DC Fixed and improved SCIF SPI reading for use with SD [RR] - DC SH4 cache improvements [RR] - DC Optimized separating stereo PCM [RR] @@ -308,7 +308,7 @@ KallistiOS version 2.0.0 ----------------------------------------------- - *** Adjusted makejitter makefile to use kos-ports headers [SS] - DC Fill in dirent.attr for directories in is9660 [SS] - DC Applied patch for opening correct iso9660 filenames [Christian Groessler == CG] -- DC Fixed bitmask for mouse buttons (makes 3rd button useable) [Fragger] +- DC Fixed bitmask for mouse buttons (makes 3rd button usable) [Fragger] - DC Added experimental (read: partially working) render to texture support in the PVR module [LS] - DC Added example program for render-to-texture [LS] @@ -533,7 +533,7 @@ KallistiOS version 1.1.9 ------------------------------------------------ - *** Changed fs_romdisk to allow multiple romdisk mounts [MP] - *** Added fs_copy and fs_load util functions [MP] - *** Changed sem_wait() and sem_wait_timed() so it doesn't assert() if - called from an interupt [MP] + called from an interrupt [MP] - *** Added the dlmalloc debugger [MP] - DC Fixed bug with samples >64k looping accidentally [MP] - DC Added stereo sample support [MP] @@ -604,7 +604,7 @@ KallistiOS version 1.1.8 ------------------------------------------------ glmisc.c [PB] - DC Added "navi" subarch for my hardware experimenting work [MP] - DC Fixed a bug in the cdrom drive which caused a lockup if the tray - was open during startup, and fixes compatability with navi [MP] + was open during startup, and fixes compatibility with navi [MP] - DC Added GL_POLYGON and GL_QUAD_STRIP to gldraw.c. Thanks to Jesse Ruffin :) [Jesse Ruffin == JR] - DC Various fs_vmu fixes: properly zero out directory entries on unlink, @@ -641,7 +641,7 @@ KallistiOS version 1.1.8 ------------------------------------------------ - *** Fix for BMP loader in libimageload [JBM] - DC Japanese support for biosfont [Kazuaki Matsumoto == KM] [MP] - DC Fix a NEARZ clipper bug in KGL. Misc Fixes. Added storage for - frustum atttributes [PB] + frustum attributes [PB] - DC Change for fs_dcload that lets console output keep going out over dcload-ip up to the last second [MP] - DC Removed some assert_msg's in KGL to make threaded programming with @@ -699,7 +699,7 @@ KallistiOS version 1.1.7 ------------------------------------------------ - *** Port of libbz2 [Sven Oliver Moll == SOM] - *** Changed around build process a bit check the README for more info [MP] -- *** Libc split into seperate directory [MP] +- *** Libc split into separate directory [MP] - DC Renamed current g2_* stuff to asic_* [MP] - DC Added new "g2bus" module to handle writing to the G2 bus [MP] - DC Fixed default AICA program [RC] @@ -710,7 +710,7 @@ KallistiOS version 1.1.7 ------------------------------------------------ - DC Rockridge fix for iso9660 [Takayama Fumihiko == TF] - DC Port of XMMS' modplug [FS] - DC Fix for store queue alignment [Andrew Kieschnick == ADK] -- DC Fix for stricmp/strnicmp problem with differnet length strings [ADK] +- DC Fix for stricmp/strnicmp problem with different length strings [ADK] - DC More complete AICA driver [FS] - DC atexit() support [FS] - DC Circular buffering support for sndstream [FS] @@ -900,7 +900,7 @@ KallistiOS version 1.1.2 ------------------------------------------------ - DC Fixed some dc-load init/shutdown bugs (adk) - *** Fixed a bug in the global Makefiles that made it not process the "SUBDIRS" entries normally -- DC PVR functionality ("ta" module) has been seperated into its own +- DC PVR functionality ("ta" module) has been separated into its own subdir, where it will eventually gain more functionality and be reorganized. - DC As part of the above reorganization, TA initialization is no longer @@ -972,7 +972,7 @@ KallistiOS version 1.0.0 ------------------------------------------------ - fs_romdisk is now case-insensitive - init.klf now takes an optional command line parameter of the rc.boot name - Added serial ABI (thanks Brian Peek) -- fs_iso9660 has improved cacheing now; a seperate data and inode cache is +- fs_iso9660 has improved caching now; a separate data and inode cache is kept so that directory info doesn't have to be re-fetched after loading a large file. Also increased the number of cache buffers and got rid of the moronic init_percd() on every file open behavior. @@ -1074,7 +1074,7 @@ KallistiOS version 0.7 - Added some "const" keywords here and there, and made an effort to remove most of the in-block stack variables and in-var initializations. There are still a few in userland programs (jam notably). -- Most things now work with default optimiztions (-O1 plus some other things). +- Most things now work with default optimizations (-O1 plus some other things). -O2 seems to work for that matter, but I'm not pushing it yet =) - Increased max simultaneous open files on /bi to 8 - Fixed iso_seek() for /cd diff --git a/doc/FAQ b/doc/FAQ index 3c0c2b2..aff1af9 100644 --- a/doc/FAQ +++ b/doc/FAQ @@ -282,7 +282,7 @@ genromfs that does this for you. Here is a URL: ftp://sunsite.unc.edu/pub/Linux/system/recovery/genromfs-0.3.tar.gz -Additionally, I have provided a copy of this program for your convienence. +Additionally, I have provided a copy of this program for your convenience. You will need to edit your environ.sh/tcsh to change the paths if you want it to work "out of the box". If you are using Cygwin you will also need to make sure there's a /tmp path mount for bin2o's usage. diff --git a/doc/LICENSE b/doc/LICENSE index 5e77151..9139ea4 100644 --- a/doc/LICENSE +++ b/doc/LICENSE @@ -27,7 +27,7 @@ package like newlib), you can assume that this text is attached to them: Please read "README.KOS" for the full details. If there is ever a question or you want to ask permission to do something -else with it, please contact the authors and we'll see how we can accomodate +else with it, please contact the authors and we'll see how we can accommodate you. The Free Software Foundation has a very good source of information on diff --git a/doc/README b/doc/README index 3e12327..826372f 100644 --- a/doc/README +++ b/doc/README @@ -32,7 +32,7 @@ means that there is a kernel library which you link with your own code. This library (libkallisti.a) contains the whole core OS functionality. You may also enable dynamically loaded modules which will link into your program at runtime and add extra functionality like new VFS modules, -new peripheral device support, image loader plugins, etc. The possiblities +new peripheral device support, image loader plugins, etc. The possibilities are limited only by your patience with adding enough exports to support the modules. ;) diff --git a/doc/RELNOTES b/doc/RELNOTES index 7479d70..3f9cc22 100644 --- a/doc/RELNOTES +++ b/doc/RELNOTES @@ -161,7 +161,7 @@ need to add -lkosutils to your link line somewhere. KOS now has a built-in network stack in the kernel/net directory. This is only usable at the moment with the Broadband Adapter or the Lan Adapter for the -Dreamcast. It suports UDP and TCP over both IPv4 and IPv6. You also have an +Dreamcast. It supports UDP and TCP over both IPv4 and IPv6. You also have an almost complete set of sockets functions so that you can use the networking support just like you would on any other OS. Add INIT_NET to your KOS_INIT_FLAGS to initialize the network support on startup. @@ -216,7 +216,7 @@ but its been so long since anyone has updated this document... RELEASE NOTES for 1.2.0 ----------------------- The PVR API's performance/statistics measuring facility has changed. -Rather than try to keep backwards compatability, the new structs have +Rather than try to keep backwards compatibility, the new structs have been changed so that the names are more accurate. The main change that will be user-noticable is that "frame_count" has become "vbl_count", counting the number of VBlanks, which is a much more useful measurement @@ -362,10 +362,10 @@ between the main program and an IRQ, etc. However, the timer is not hooked and no pre-emption will occur. If you enable pre-emptive mode, then this is basically like the old threads-enabled mode. -Note that kos_init_defaults() is now a compatability shim which will +Note that kos_init_defaults() is now a compatibility shim which will correct any implicit defaults. However, if you want better control over this situation, please change your program to use the macros. Also note -that this and other compatability shims will be removed by the next +that this and other compatibility shims will be removed by the next release version (i.e., removed in CVS after the tagging). The build process has changed slightly. The main change is that libc is @@ -389,7 +389,7 @@ are still combined into libkallisti.a (easier linking until we have the installation mode available...) Libm from Newlib has been integrated into the source tree so that you -no longer have to pull in a seperate Newlib binary. This also ensures that +no longer have to pull in a separate Newlib binary. This also ensures that it's compiled with the same compiler flags as the rest of KOS. The new "PVR" API has completely replaced the old "TA" API. For the near @@ -437,7 +437,7 @@ check to see what changed there. Paul has helpfully created a KGL manual as well, if you are looking for docs. Image loaders now use the kos_img_t system so that they can be platform -independent and still pass around the data in a convienent format. This +independent and still pass around the data in a convenient format. This also makes it easier to flip the data when loading it into the PVR RAM ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-23 04:20:54
|
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 c6bd4112b76ef25edb63bde4352dc89e7f41a805 (commit) via 1ba7a22d7623218d10c68bceecbad3c70aa80682 (commit) via 60b135a8a220a5be9de903093d31e4e486917ab1 (commit) via af7b6787c133ee37c5325bb342dae4825204a078 (commit) via 739ed6debee1e13b69f9c95616fa97209a46bc1e (commit) via 3b1dc582c5ad2db8949edbf049eda788ba5e5408 (commit) via a749689b51e7c078a7e32b1953f6a50f24e821f7 (commit) from b316401ae52b611dc9a646da5781019cb45ef33a (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 c6bd4112b76ef25edb63bde4352dc89e7f41a805 Merge: 1ba7a22 af7b678 Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 22 23:20:19 2023 -0500 Merge pull request #429 from KallistiOS/800x600_notice Added Disclaimer to 800x608 Resolution Example commit 1ba7a22d7623218d10c68bceecbad3c70aa80682 Merge: 60b135a 3b1dc58 Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 22 23:19:37 2023 -0500 Merge pull request #423 from KallistiOS/clock_CLOCKS_PER_SEC_upgrade Increased Resolution of C's clock() to Microseconds commit 60b135a8a220a5be9de903093d31e4e486917ab1 Merge: b316401 739ed6d Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 22 23:18:31 2023 -0500 Merge pull request #428 from KallistiOS/bba_doxygen_topics Added and Improved BBA Doxygen Documentation commit af7b6787c133ee37c5325bb342dae4825204a078 Author: Falco Girgis <gyr...@gm...> Date: Wed Dec 20 23:30:45 2023 -0600 Added disclaimer to 800x608 resolution example - Because users, including our own developers, are continually being confused by the garbled output. :) commit 739ed6debee1e13b69f9c95616fa97209a46bc1e Author: Falco Girgis <gyr...@gm...> Date: Wed Dec 20 23:12:12 2023 -0600 Added and improved BBA doxygen documentation - I went back through and noticed somehow the BBA was the only set of doxygen topics in the whole codebase still missing \brief info, added. - Reorganized topics for improved discoverablity and grouping commit 3b1dc582c5ad2db8949edbf049eda788ba5e5408 Author: Falco Girgis <gyr...@gm...> Date: Wed Dec 20 16:03:34 2023 -0600 Update doc/CHANGELOG Co-authored-by: Lawrence Sebald <ljs...@us...> commit a749689b51e7c078a7e32b1953f6a50f24e821f7 Author: Falco Girgis <gyr...@gm...> Date: Tue Dec 19 17:11:59 2023 -0600 Increased clock() and CLOCKS_PER_SEC to microsecs - Added #define to kos/time.h to provide newlib with an initial value for CLOCKS_PER_SEC - Modified newlib_times.c to use the microsecond timer, which is what backs the clock() C stdlib function - Updated CHANGELOG ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + examples/dreamcast/libdream/800x608/800x608.c | 3 + include/kos/time.h | 1 + .../dreamcast/include/dc/net/broadband_adapter.h | 76 ++++++++++++++-------- kernel/libc/newlib/newlib_times.c | 9 +-- 5 files changed, 60 insertions(+), 30 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d0d59b3..5f6f731 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -212,6 +212,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Added basic example for micropython KOS port [Aaron Glazer == AG] - DC Improved performance of IRQ context save / restore [PC] - DC Increased resolution of TMU timers + date/time functions [FG && PC] +- *** Increased resolution of clock() and CLOCKS_PER_SEC to microseconds [FG] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/examples/dreamcast/libdream/800x608/800x608.c b/examples/dreamcast/libdream/800x608/800x608.c index 40fc6ea..15da9b1 100644 --- a/examples/dreamcast/libdream/800x608/800x608.c +++ b/examples/dreamcast/libdream/800x608/800x608.c @@ -22,6 +22,9 @@ int main(int argc, char **argv) { cont_btn_callback(0, CONT_START | CONT_A | CONT_B | CONT_X | CONT_Y, (cont_btn_callback_t)arch_exit); + printf("\n\n*** NOTE: This example is still a work in progress\n"); + printf(" as this resolution is not fully supported! ***\n\n"); + /* Set video mode */ vid_set_mode(DM_800x608, PM_RGB565); diff --git a/include/kos/time.h b/include/kos/time.h index 18236ea..5ebc30a 100644 --- a/include/kos/time.h +++ b/include/kos/time.h @@ -34,6 +34,7 @@ __BEGIN_DECLS struct timespec; #define TIME_UTC 1 +#define CLOCKS_PER_SEC 1000000 extern int timespec_get(struct timespec *ts, int base); diff --git a/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h b/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h index 5fdf63c..d271022 100644 --- a/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h +++ b/kernel/arch/dreamcast/include/dc/net/broadband_adapter.h @@ -23,12 +23,18 @@ __BEGIN_DECLS /** \defgroup bba Broadband Adapter - \brief Driver for the Dreamcast's BBA (RTL8139C). - \ingroup networking_drivers + \brief Driver for the Dreamcast's BBA (RTL8139C). + \ingroup networking_drivers + @{ +*/ + +/** \defgroup bba_regs Registers + \brief Registers and related info for the broadband adapter + @{ */ -/** \defgroup bba_regs Register Definitions - \ingroup bba +/** \defgroup bba_regs_locs Locations + \brief Locations for various broadband adapter registers. The default assumption is that these are all RW at any aligned size unless otherwise noted. ex (RW 32bit, RO 16/8) indicates read/write at 32bit and @@ -94,9 +100,13 @@ __BEGIN_DECLS #define RT_CONFIG5 0xD8 /**< \brief Config register 5 */ /** @} */ +/** \defgroup bba_regs_fields Fields + \brief Register fields for the broadband adapter + @{ +*/ + /** \defgroup bba_miicb MII Control Bits - \brief Control bits for the Media Independent Interface of the BBA - \ingroup bba + \brief BBA media independent interface control register fields @{ */ #define RT_MII_RESET 0x8000 /**< \brief Reset the MII chip */ @@ -107,12 +117,10 @@ __BEGIN_DECLS #define RT_MII_RES0400 0x0400 /**< \brief Reserved */ #define RT_MII_AN_START 0x0200 /**< \brief Start auto-negotiation */ #define RT_MII_DUPLEX 0x0100 /**< \brief 1 for full 0 for half. Ignored if AN enabled. */ - /** @} */ /** \defgroup bba_miisb MII Status Bits - \brief Status bits for the Media Independent Interface of the BBA - \ingroup bba + \brief BBA media independent interface status register fields @{ */ #define RT_MII_LINK 0x0004 /**< \brief Link is present */ @@ -125,7 +133,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_cbits Command Bits - \ingroup bba + \brief BBA command register fields OR appropriate bit values together and write into the RT_CHIPCMD register to execute the command. @@ -139,7 +147,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_ibits Interrupt Status Bits - \ingroup bba + \brief BBA interrupt status fields @{ */ #define RT_INT_PCIERR 0x8000 /**< \brief PCI Bus error */ @@ -153,14 +161,12 @@ __BEGIN_DECLS #define RT_INT_RX_ERR 0x0002 /**< \brief Rx error */ #define RT_INT_RX_OK 0x0001 /**< \brief Rx OK */ -/** \brief Composite RX bits we check for while doing an RX interrupt. - \ingroup bba - */ +/** \brief Composite RX bits we check for while doing an RX interrupt. */ #define RT_INT_RX_ACK (RT_INT_RXFIFO_OVERFLOW | RT_INT_RXBUF_OVERFLOW | RT_INT_RX_OK) /** @} */ /** \defgroup bba_tbits Transmit Status Bits - \ingroup bba + \brief BBA transmit status register fields @{ */ #define RT_TX_CARRIER_LOST 0x80000000 /**< \brief Carrier sense lost */ @@ -173,7 +179,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_rbits Receive Status Bits - \ingroup bba + \brief BBA receive status register fields @{ */ #define RT_RX_MULTICAST 0x00008000 /**< \brief Multicast packet */ @@ -188,7 +194,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_config1bits Config Register 1 Bits - \ingroup bba + \brief BBA config register 1 fields From RTL8139C(L) datasheet v1.4 @@ -205,7 +211,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_config4bits Config Register 4 Bits - \ingroup bba + \brief BBA config register 4 fields From RTL8139C(L) datasheet v1.4. Only RT_CONFIG4_RxFIFIOAC is used. @@ -222,7 +228,7 @@ __BEGIN_DECLS /** @} */ /** \defgroup bba_config5bits Config Register 5 Bits - \ingroup bba + \brief BBA config register 5 fields From RTL8139C(L) datasheet v1.4. Only RT_CONFIG5_LDPS is used. @@ -238,8 +244,11 @@ __BEGIN_DECLS #define RT_CONFIG5_PME_STS 0x01 /**< \brief Allow PCI reset to set PME_Status bit. */ /** @} */ +/** @} */ + +/** @} */ + /** \brief Retrieve the MAC Address of the attached BBA. - \ingroup bba This function reads the MAC Address of the BBA and places it in the buffer passed in. The resulting data is undefined if no BBA is connected. @@ -248,8 +257,12 @@ __BEGIN_DECLS */ void bba_get_mac(uint8 *arr); +/** \defgroup bba_rx RX + \brief Receive packet API for the BBA + @{ +*/ + /** \brief Receive packet callback function type. - \ingroup bba When a packet is received by the BBA, the callback function will be called to handle it. @@ -260,7 +273,6 @@ void bba_get_mac(uint8 *arr); typedef void (*eth_rx_callback_t)(uint8 *pkt, int len); /** \brief Set the ethernet packet receive callback. - \ingroup bba This function sets the function called when a packet is received by the BBA. Generally, this inputs into the network layer. @@ -269,8 +281,15 @@ typedef void (*eth_rx_callback_t)(uint8 *pkt, int len); */ void bba_set_rx_callback(eth_rx_callback_t cb); -/** \defgroup bba_txrv bba_tx() Return Values - \ingroup bba +/** @} */ + +/** \defgroup bba_tx TX + \brief Transmit packet API for the BBA + @{ +*/ + +/** \defgroup bba_txrv Return Values + \brief Return values for bba_tx() @{ */ #define BBA_TX_OK 0 /**< \brief Transmit success */ @@ -279,13 +298,14 @@ void bba_set_rx_callback(eth_rx_callback_t cb); /** @} */ /** \defgroup bba_wait Wait Modes - \ingroup bba + \brief Wait modes for bba_tx() + @{ */ #define BBA_TX_NOWAIT 0 /**< \brief Don't block waiting for the transfer. */ #define BBA_TX_WAIT 1 /**< \brief Wait, if needed on transfer. */ +/** @} */ /** \brief Transmit a single packet. - \ingroup bba This function transmits a single packet on the bba, waiting for the link to become stable, if requested. @@ -302,6 +322,8 @@ void bba_set_rx_callback(eth_rx_callback_t cb); */ int bba_tx(const uint8 *pkt, int len, int wait); +/** @} */ + /* \cond */ /* Initialize */ int bba_init(void); @@ -310,6 +332,8 @@ int bba_init(void); int bba_shutdown(void); /* \endcond */ +/** @} */ + __END_DECLS #endif /* __DC_NET_BROADBAND_ADAPTER_H */ diff --git a/kernel/libc/newlib/newlib_times.c b/kernel/libc/newlib/newlib_times.c index eb84536..fd56d1c 100644 --- a/kernel/libc/newlib/newlib_times.c +++ b/kernel/libc/newlib/newlib_times.c @@ -3,6 +3,7 @@ newlib_times.c Copyright (C) 2004 Megan Potter Copyright (C) 2022 Lawrence Sebald + Copyright (C) 2023 Falco Girgis */ @@ -11,13 +12,13 @@ #include <sys/times.h> #include <arch/timer.h> -int _times_r(struct _reent * re, struct tms * tmsbuf) { +int _times_r(struct _reent *re, struct tms *tmsbuf) { (void)re; if(tmsbuf) { - /* Conveniently, CLOCKS_PER_SEC is 1000, so we can just use the - millisecond timer. */ - tmsbuf->tms_utime = (clock_t)timer_ms_gettime64(); + /* Conveniently, CLOCKS_PER_SEC is 1000000, so we can just use the + microsecond timer. */ + tmsbuf->tms_utime = (clock_t)timer_us_gettime64(); tmsbuf->tms_stime = 0; tmsbuf->tms_cutime = 0; tmsbuf->tms_cstime = 0; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-19 16:30:26
|
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 b316401ae52b611dc9a646da5781019cb45ef33a (commit) from 7624991cf3910bfdb45a53d29d06961c23e3888f (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 b316401ae52b611dc9a646da5781019cb45ef33a Author: Falco Girgis <gyr...@gm...> Date: Tue Dec 19 10:30:01 2023 -0600 Doxygen Topics Cleanup (#412) * Updated DoxygenLayout.xml for Doxygen v1.9.8 * LOTS clean-up for top-level Doxygen topics 1) MMU 2) ASIC 3) GD-ROM 4) Maple 5) Controller 6) Keyboard 7) Mouse 8) Modem 9) Broadband Adapter 10) PVR * Continued work on top-level Doxygen topics. * More top-level Doxygen topic cleanup * First pass at top-level doxygen Topics done! * Little cleanup for stream.h - Had a global comment that was explaining how snd_stream_filter_add(), which should've been added to the Doxygen for the function. * Top-level Doxygen Topics Pass 2 Complete - Everything looks good at the top-level now, reasonably organized - Most of the high-level topics still need descriptions and examples, though - Still have inconsistencies with some concepts getting a group versus others just being within their respective header * All of KallistiOS is PRISTINE minus Video!! Got everything 100% done and categorized by topic other than video. This is a good place to commit. * Display Doxygen topics complete, PVR still WIP. * Done with new Doxygen Topics!!! - Completed documentation for the PowerVR API, finishing up the remainder of the topics-level documentation refactor - Went back and filled in missing \brief fields for every topic or group - Fixed various random "bugs" * Documented AICA driver, missing structs + headers 1) Had to go through and document the common AICA/SH4 interface, because it's all getting indexed by Doxygen... and because it needed it. 2) Went through and documented any structures missing a \brief comment 3) Went through and documented any headers missing a \brief comment * Documentation fixes for memory.h * Fixed doxygen return values for attribution API ----------------------------------------------------------------------- Summary of changes: addons/include/ext2/fs_ext2.h | 56 +- addons/include/fat/fs_fat.h | 56 +- addons/include/kos/img.h | 32 +- addons/include/kos/netcfg.h | 46 +- addons/include/ppp/ppp.h | 117 ++-- doc/Doxyfile | 5 +- doc/pages/attribution.dox | 10 + doc/pages/audio.dox | 3 + doc/pages/debugging.dox | 6 + doc/pages/filesystem.dox | 13 + doc/pages/math.dox | 3 + doc/pages/networking.dox | 7 + doc/pages/peripherals.dox | 3 + doc/pages/system.dox | 13 + doc/pages/threading.dox | 4 + doc/pages/timing.dox | 6 + doc/pages/video.dox | 8 + include/arpa/inet.h | 14 +- include/kos/blockdev.h | 32 +- include/kos/cdefs.h | 14 +- include/kos/dbgio.h | 86 ++- include/kos/dbglog.h | 20 +- include/kos/elf.h | 80 ++- include/kos/exports.h | 11 +- include/kos/fs.h | 224 +++--- include/kos/fs_dev.h | 14 +- include/kos/fs_pty.h | 14 +- include/kos/fs_ramdisk.h | 14 +- include/kos/fs_romdisk.h | 14 +- include/kos/fs_socket.h | 52 +- include/kos/init.h | 42 +- include/kos/init_base.h | 11 +- include/kos/library.h | 14 +- include/kos/limits.h | 11 +- include/kos/net.h | 370 ++++++++-- include/kos/nmmgr.h | 45 +- include/kos/opts.h | 30 +- include/kos/recursive_lock.h | 4 +- include/kos/rwsem.h | 4 +- include/kos/sem.h | 4 +- include/kos/stdlib.h | 10 +- include/kos/string.h | 11 +- include/kos/thread.h | 36 +- include/kos/time.h | 14 +- include/libgen.h | 11 +- include/malloc.h | 14 +- include/netdb.h | 45 +- include/netinet/in.h | 130 +++- include/netinet/tcp.h | 9 +- include/netinet/udp.h | 9 +- include/netinet/udplite.h | 9 +- include/poll.h | 25 +- include/pthread.h | 2 +- include/sys/_types.h | 11 +- include/sys/dirent.h | 11 +- include/sys/lock.h | 14 +- include/sys/select.h | 6 +- include/sys/socket.h | 43 +- include/sys/uio.h | 11 +- include/sys/utsname.h | 11 +- include/threads.h | 11 +- kernel/arch/dreamcast/include/arch/arch.h | 136 ++-- kernel/arch/dreamcast/include/arch/byteorder.h | 11 +- kernel/arch/dreamcast/include/arch/cache.h | 13 +- kernel/arch/dreamcast/include/arch/exec.h | 14 +- kernel/arch/dreamcast/include/arch/gdb.h | 14 +- kernel/arch/dreamcast/include/arch/init_flags.h | 15 +- kernel/arch/dreamcast/include/arch/irq.h | 140 ++-- kernel/arch/dreamcast/include/arch/memory.h | 40 +- kernel/arch/dreamcast/include/arch/mmu.h | 145 ++-- kernel/arch/dreamcast/include/arch/rtc.h | 3 +- kernel/arch/dreamcast/include/arch/spinlock.h | 5 +- kernel/arch/dreamcast/include/arch/stack.h | 14 +- kernel/arch/dreamcast/include/arch/timer.h | 13 +- kernel/arch/dreamcast/include/arch/types.h | 11 +- kernel/arch/dreamcast/include/arch/wdt.h | 4 +- kernel/arch/dreamcast/include/dc/asic.h | 71 +- kernel/arch/dreamcast/include/dc/biosfont.h | 63 +- kernel/arch/dreamcast/include/dc/cdrom.h | 111 ++- kernel/arch/dreamcast/include/dc/dmac.h | 16 +- kernel/arch/dreamcast/include/dc/fb_console.h | 5 +- kernel/arch/dreamcast/include/dc/fifo.h | 15 +- kernel/arch/dreamcast/include/dc/flashrom.h | 73 +- kernel/arch/dreamcast/include/dc/fmath.h | 21 +- kernel/arch/dreamcast/include/dc/fmath_base.h | 22 +- kernel/arch/dreamcast/include/dc/fs_dcload.h | 15 +- kernel/arch/dreamcast/include/dc/fs_dclsocket.h | 11 +- kernel/arch/dreamcast/include/dc/fs_iso9660.h | 11 +- kernel/arch/dreamcast/include/dc/fs_vmu.h | 15 +- kernel/arch/dreamcast/include/dc/g1ata.h | 74 +- kernel/arch/dreamcast/include/dc/g2bus.h | 14 +- kernel/arch/dreamcast/include/dc/maple.h | 232 +++++-- .../arch/dreamcast/include/dc/maple/controller.h | 2 +- kernel/arch/dreamcast/include/dc/maple/dreameye.h | 14 +- kernel/arch/dreamcast/include/dc/maple/keyboard.h | 59 +- kernel/arch/dreamcast/include/dc/maple/lightgun.h | 14 +- kernel/arch/dreamcast/include/dc/maple/mouse.h | 24 +- kernel/arch/dreamcast/include/dc/maple/purupuru.h | 14 +- kernel/arch/dreamcast/include/dc/maple/sip.h | 14 +- kernel/arch/dreamcast/include/dc/maple/vmu.h | 1 + kernel/arch/dreamcast/include/dc/math.h | 19 +- kernel/arch/dreamcast/include/dc/matrix.h | 16 +- kernel/arch/dreamcast/include/dc/matrix3d.h | 11 +- kernel/arch/dreamcast/include/dc/minifont.h | 17 +- kernel/arch/dreamcast/include/dc/modem/mconst.h | 31 +- kernel/arch/dreamcast/include/dc/modem/modem.h | 89 ++- .../dreamcast/include/dc/net/broadband_adapter.h | 64 +- kernel/arch/dreamcast/include/dc/net/lan_adapter.h | 10 +- kernel/arch/dreamcast/include/dc/pvr.h | 752 +++++++++++++++------ kernel/arch/dreamcast/include/dc/scif.h | 14 +- kernel/arch/dreamcast/include/dc/sd.h | 32 +- kernel/arch/dreamcast/include/dc/sound/aica_comm.h | 183 +++-- kernel/arch/dreamcast/include/dc/sound/sfxmgr.h | 14 +- kernel/arch/dreamcast/include/dc/sound/sound.h | 15 +- kernel/arch/dreamcast/include/dc/sound/stream.h | 26 +- kernel/arch/dreamcast/include/dc/spu.h | 11 +- kernel/arch/dreamcast/include/dc/sq.h | 3 +- kernel/arch/dreamcast/include/dc/ubc.h | 14 +- kernel/arch/dreamcast/include/dc/vblank.h | 18 +- kernel/arch/dreamcast/include/dc/vec3f.h | 14 +- kernel/arch/dreamcast/include/dc/vector.h | 11 +- kernel/arch/dreamcast/include/dc/video.h | 154 ++++- kernel/arch/dreamcast/include/dc/vmu_fb.h | 5 +- kernel/arch/dreamcast/include/dc/vmu_pkg.h | 30 +- kernel/arch/dreamcast/include/dc/vmufs.h | 11 +- 125 files changed, 3664 insertions(+), 1344 deletions(-) create mode 100644 doc/pages/attribution.dox create mode 100644 doc/pages/audio.dox create mode 100644 doc/pages/debugging.dox create mode 100644 doc/pages/filesystem.dox create mode 100644 doc/pages/math.dox create mode 100644 doc/pages/networking.dox create mode 100644 doc/pages/peripherals.dox create mode 100644 doc/pages/system.dox create mode 100644 doc/pages/timing.dox create mode 100644 doc/pages/video.dox diff --git a/addons/include/ext2/fs_ext2.h b/addons/include/ext2/fs_ext2.h index 39932aa..715f9ab 100644 --- a/addons/include/ext2/fs_ext2.h +++ b/addons/include/ext2/fs_ext2.h @@ -4,17 +4,9 @@ Copyright (C) 2012, 2013 Lawrence Sebald */ -#ifndef __EXT2_FS_EXT2_H -#define __EXT2_FS_EXT2_H - -#include <sys/cdefs.h> -__BEGIN_DECLS - -#include <stdint.h> -#include <kos/blockdev.h> - -/** \file ext2/fs_ext2.h - \brief VFS interface for an ext2 filesystem. +/** \file ext2/fs_ext2.h + \brief VFS interface for an ext2 filesystem. + \ingroup vfs_ext2 This file defines the public interface to add support for the Second Extended Filesystem (ext2) to KOS' VFS. ext2 is one of the many filesystems @@ -51,7 +43,22 @@ __BEGIN_DECLS \author Lawrence Sebald */ -/** \brief Initialize fs_ext2. +#ifndef __EXT2_FS_EXT2_H +#define __EXT2_FS_EXT2_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <stdint.h> +#include <kos/blockdev.h> + +/** \defgroup vfs_ext2 EXT2 + \brief KOS VFS support for the Second Extended Filesystem + \ingroup vfs_drivers +*/ + +/** \brief Initialize fs_ext2. + \ingroup vfs_ext2 This function initializes fs_ext2, preparing various internal structures for use. @@ -60,7 +67,8 @@ __BEGIN_DECLS */ int fs_ext2_init(void); -/** \brief Shut down fs_ext2. +/** \brief Shut down fs_ext2. + \ingroup vfs_ext2 This function shuts down fs_ext2, basically undoing what fs_ext2_init() did. @@ -68,7 +76,9 @@ int fs_ext2_init(void); */ int fs_ext2_shutdown(void); -/** \defgroup ext2_mount_flags Mount flags for fs_ext2 +/** \defgroup ext2_mount_flags Mount Flags + \brief Mount flags for fs_ext2 + \ingroup vfs_ext2 These values are the valid flags that can be passed for the flags parameter to the fs_ext2_mount() function. Note that these can be combined, except for @@ -88,7 +98,8 @@ int fs_ext2_shutdown(void); #define FS_EXT2_MOUNT_READWRITE 0x00000001 /**< \brief Mount read-write */ /** @} */ -/** \brief Mount an ext2 filesystem in the VFS. +/** \brief Mount an ext2 filesystem in the VFS. + \ingroup vfs_ext2 This function mounts an ext2 filesystem to the specified mount point on the VFS. This function will detect whether or not an ext2 filesystem exists on @@ -98,24 +109,28 @@ int fs_ext2_shutdown(void); \param mp The path to mount the filesystem at. \param dev The block device containing the filesystem. \param flags Mount flags. Bitwise OR of values from ext2_mount_flags + \retval 0 On success. \retval -1 On error. */ int fs_ext2_mount(const char *mp, kos_blockdev_t *dev, uint32_t flags); -/** \brief Unmount an ext2 filesystem from the VFS. +/** \brief Unmount an ext2 filesystem from the VFS. + \ingroup vfs_ext2 This function unmoutns an ext2 filesystem that was previously mounted by the fs_ext2_mount() function. \param mp The mount point of the filesystem to be unmounted. + \retval 0 On success. \retval -1 On error. */ int fs_ext2_unmount(const char *mp); -/** \brief Sync an ext2 filesystem, flushing all pending writes to the block - device. +/** \brief Sync an ext2 filesystem, flushing all pending writes to the block + device. + \ingroup vfs_ext2 This function completes all pending writes on the filesystem, making sure all data and metadata are in a consistent state on the block device. As both @@ -124,11 +139,12 @@ int fs_ext2_unmount(const char *mp); be a good idea if there is a chance that the filesystem will not be unmounted cleanly. + \note This function has no effect if the filesystem was mounted read-only. + \param mp The mount point of the filesystem to be synced. + \retval 0 On success. \retval -1 On error. - - \note This function has no effect if the filesystem was mounted read-only. */ int fs_ext2_sync(const char *mp); diff --git a/addons/include/fat/fs_fat.h b/addons/include/fat/fs_fat.h index e4b515c..f346526 100644 --- a/addons/include/fat/fs_fat.h +++ b/addons/include/fat/fs_fat.h @@ -4,17 +4,9 @@ Copyright (C) 2012, 2013, 2019 Lawrence Sebald */ -#ifndef __FAT_FS_FAT_H -#define __FAT_FS_FAT_H - -#include <sys/cdefs.h> -__BEGIN_DECLS - -#include <stdint.h> -#include <kos/blockdev.h> - -/** \file fat/fs_fat.h - \brief VFS interface for a FAT filesystem. +/** \file fat/fs_fat.h + \brief VFS interface for a FAT filesystem. + \ingroup vfs_fat This file defines the public interface to add support for the FAT filesystem, as in common use on all kinds of systems and popularized by @@ -34,7 +26,22 @@ __BEGIN_DECLS \author Lawrence Sebald */ -/** \brief Initialize fs_fat. +#ifndef __FAT_FS_FAT_H +#define __FAT_FS_FAT_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <stdint.h> +#include <kos/blockdev.h> + +/** \defgroup vfs_fat FAT + \brief FAT 12, 16, and 32-bit support for KOS's VFS + \ingroup vfs_drivers +*/ + +/** \brief Initialize fs_fat. + \ingroup vfs_fat This function initializes fs_fat, preparing various internal structures for use. @@ -43,7 +50,8 @@ __BEGIN_DECLS */ int fs_fat_init(void); -/** \brief Shut down fs_fat. +/** \brief Shut down fs_fat. + \ingroup vfs_fat This function shuts down fs_fat, basically undoing what fs_fat_init() did. @@ -51,7 +59,9 @@ int fs_fat_init(void); */ int fs_fat_shutdown(void); -/** \defgroup fat_mount_flags Mount flags for fs_fat +/** \defgroup fat_mount_flags Mount Flags + \brief Mount flags for fs_fat + \ingroup vfs_fat These values are the valid flags that can be passed for the flags parameter to the fs_fat_mount() function. Note that these can be combined, except for @@ -71,7 +81,8 @@ int fs_fat_shutdown(void); #define FS_FAT_MOUNT_READWRITE 0x00000001 /**< \brief Mount read-write */ /** @} */ -/** \brief Mount a FAT filesystem in the VFS. +/** \brief Mount a FAT filesystem in the VFS. + \ingroup vfs_fat This function mounts an fat filesystem to the specified mount point on the VFS. This function will detect whether or not an FAT filesystem exists on @@ -81,24 +92,28 @@ int fs_fat_shutdown(void); \param mp The path to mount the filesystem at. \param dev The block device containing the filesystem. \param flags Mount flags. Bitwise OR of values from fat_mount_flags + \retval 0 On success. \retval -1 On error. */ int fs_fat_mount(const char *mp, kos_blockdev_t *dev, uint32_t flags); -/** \brief Unmount a FAT filesystem from the VFS. +/** \brief Unmount a FAT filesystem from the VFS. + \ingroup vfs_fat This function unmoutns an FAT filesystem that was previously mounted by the fs_fat_mount() function. \param mp The mount point of the filesystem to be unmounted. + \retval 0 On success. \retval -1 On error. */ int fs_fat_unmount(const char *mp); -/** \brief Sync a FAT filesystem, flushing all pending writes to the block - device. +/** \brief Sync a FAT filesystem, flushing all pending writes to the block + device. + \ingroup vfs_fat This function completes all pending writes on the filesystem, making sure all data and metadata are in a consistent state on the block device. As both @@ -107,11 +122,12 @@ int fs_fat_unmount(const char *mp); be a good idea if there is a chance that the filesystem will not be unmounted cleanly. + \note This function has no effect if the filesystem was mounted read-only. + \param mp The mount point of the filesystem to be synced. + \retval 0 On success. \retval -1 On error. - - \note This function has no effect if the filesystem was mounted read-only. */ int fs_fat_sync(const char *mp); diff --git a/addons/include/kos/img.h b/addons/include/kos/img.h index c3a39b8..ea13cbc 100644 --- a/addons/include/kos/img.h +++ b/addons/include/kos/img.h @@ -8,8 +8,9 @@ #ifndef __KOS_IMG_H #define __KOS_IMG_H -/** \file kos/img.h - \brief Platform-independent image type. +/** \file kos/img.h + \brief Platform-independent image type. + \ingroup video_img This file provides a platform-independent image type that is designed to hold any sort of textures or other image data. This type contains a very @@ -27,7 +28,13 @@ __BEGIN_DECLS #include <arch/types.h> -/** \brief Platform-indpendent image type. +/** \defgroup video_img Images + \brief Platform-independent image representation + \ingroup video +*/ + +/** \brief Platform-indpendent image type. + \ingroup video_img You can use this type for textures or whatever you feel it's appropriate for. "width" and "height" are as you would expect. "format" has a lower-half @@ -51,7 +58,14 @@ typedef struct kos_img { uint32 byte_count; /**< \brief Length of the image data, in bytes. */ } kos_img_t; -/** \defgroup kos_img_fmt_macros Macros for accessing the format of an image +/** \defgroup video_img_fmt Format + \brief Video image formats + \ingroup video_img +*/ + +/** \defgroup kos_img_fmt_macros Accessors + \brief Macros for accessing kos_image_t::fmt + \ingroup video_img_fmt These macros provide easy access to the fmt field of a kos_img_t object. @@ -63,6 +77,7 @@ typedef struct kos_img { of the value, which contains the platform-independent half of the format. \param x An image format (fmt field of a kos_img_t). + \return The platform-independent half of the format. */ #define KOS_IMG_FMT_I(x) ((x) & 0xffff) @@ -73,6 +88,7 @@ typedef struct kos_img { of the value, which contains the platform-specific half of the format. \param x An image format (fmt field of a kos_img_t). + \return The platform-specific half of the format. */ #define KOS_IMG_FMT_D(x) (((x) >> 16) & 0xffff) @@ -87,6 +103,7 @@ typedef struct kos_img { \param i The platform-independent half of the format. \param d The platform-specific half of the format. This should not be pre-shifted. + \return A complete image format value, suitable for placing in the fmt variable of a kos_img_t. */ @@ -94,7 +111,9 @@ typedef struct kos_img { /** @} */ -/** \defgroup kos_img_fmts Image format types +/** \defgroup kos_img_fmts Types + \brief Video image format types + \ingroup video_img_fmt This is the list of platform-independent image types that can be used as the lower-half of the fmt value for a kos_img_t. @@ -153,7 +172,8 @@ typedef struct kos_img { /** @} */ -/** \brief Free a kos_img_t object. +/** \brief Free a kos_img_t object. + \ingroup video_img This function frees the data in a kos_img_t object, returning any memory to the heap as appropriate. Optionally, this can also free the object itself, diff --git a/addons/include/kos/netcfg.h b/addons/include/kos/netcfg.h index de77b1c..3348b16 100644 --- a/addons/include/kos/netcfg.h +++ b/addons/include/kos/netcfg.h @@ -8,8 +8,9 @@ #ifndef __KOS_NETCFG_H #define __KOS_NETCFG_H -/** \file kos/netcfg.h - \brief Network configuration interface. +/** \file kos/netcfg.h + \brief Network configuration interface. + \ingroup netcfg This file provides a common interface for reading and writing the network configuration on KOS. The interface can read from the flashrom on the @@ -27,7 +28,14 @@ __BEGIN_DECLS #include <arch/types.h> -/** \defgroup netcfg_methods Network connection methods +/** \defgroup netcfg Configuration + \brief KOS Network Configuration Management + \ingroup networking +*/ + +/** \defgroup netcfg_methods Methods + \brief Network connection methods + \ingroup netcfg ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-19 16:16:24
|
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 7624991cf3910bfdb45a53d29d06961c23e3888f (commit) via 5ddd0c5b098da9a8ce727a49c15b54fed23da7eb (commit) from 7a141df18e715535f297503d8e75164b37659de4 (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 7624991cf3910bfdb45a53d29d06961c23e3888f Merge: 7a141df 5ddd0c5 Author: Lawrence Sebald <ljs...@us...> Date: Tue Dec 19 11:16:02 2023 -0500 Merge pull request #421 from KallistiOS/likely_unlikely_rename Renamed likely() and unlikely() Macros commit 5ddd0c5b098da9a8ce727a49c15b54fed23da7eb Author: Falco Girgis <gyr...@gm...> Date: Tue Dec 19 08:34:52 2023 -0600 Renamed likely() and unlikely() macros - Both macros were causing all sorts of name collisions with other codebases, such as GLdc and other Linux kernel-y kinds of code. - Prefixed them both with "__" which is consistent with the rest of the KOS macros in cdefs.h anyway. ----------------------------------------------------------------------- Summary of changes: include/kos/cdefs.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kos/cdefs.h b/include/kos/cdefs.h index 439ba1c..aa5e09a 100644 --- a/include/kos/cdefs.h +++ b/include/kos/cdefs.h @@ -68,7 +68,7 @@ #define __pure2 __pure /* ditto */ #endif -#ifndef likely +#ifndef __likely /** \brief Directive to inform the compiler the condition is in the likely path. This can be used around conditionals or loops to help inform the @@ -76,12 +76,12 @@ \param exp Boolean expression which expected to be true. - \sa unlikely() + \sa __unlikely() */ -#define likely(exp) __builtin_expect(!!(exp), 1) +#define __likely(exp) __builtin_expect(!!(exp), 1) #endif -#ifndef unlikely +#ifndef __unlikely /** \brief Directive to inform the compiler the condition is in the unlikely path. This can be used around conditionals or loops to help inform the @@ -89,9 +89,9 @@ \param exp Boolean expression which is expected to be false. - \sa likely() + \sa __likely() */ -#define unlikely(exp) __builtin_expect(!!(exp), 0) +#define __unlikely(exp) __builtin_expect(!!(exp), 0) #endif #ifndef __deprecated hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-17 22:15:48
|
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 7a141df18e715535f297503d8e75164b37659de4 (commit) via f12721f0bcaa2e0a852ec7b8a3f3d164a3ba8248 (commit) via 0c3d454fa118f0e649e0ea3e8c9fed5746a7cc5a (commit) via 3303c4317c37d8370f2fdc99770448bea2732df9 (commit) via f884be8cdaa2b390eff84af2743c87a1e51e367d (commit) from 42e36042a63aec317c38dacb7683db4f28c4b802 (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 7a141df18e715535f297503d8e75164b37659de4 Merge: 42e3604 f12721f Author: Lawrence Sebald <ljs...@us...> Date: Sun Dec 17 17:15:26 2023 -0500 Merge pull request #417 from KallistiOS/expanded_map Update memory.h with MMU and UBC registers commit f12721f0bcaa2e0a852ec7b8a3f3d164a3ba8248 Author: Donald Haase <qu...@co...> Date: Sun Dec 17 17:10:35 2023 -0500 Make sure to include memory.h in ubc.h for defines commit 0c3d454fa118f0e649e0ea3e8c9fed5746a7cc5a Author: Donald Haase <qu...@co...> Date: Sun Dec 17 17:01:26 2023 -0500 Update ubc.h to use new defines commit 3303c4317c37d8370f2fdc99770448bea2732df9 Author: Donald Haase <qu...@co...> Date: Sun Dec 17 16:57:55 2023 -0500 Update mmu.c to use new defines commit f884be8cdaa2b390eff84af2743c87a1e51e367d Author: Donald Haase <qu...@co...> Date: Sun Dec 17 16:50:47 2023 -0500 Update memory with MMU and UBC registers ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/arch/memory.h | 149 ++++++++++++++++++++++++++++ kernel/arch/dreamcast/include/dc/ubc.h | 19 ++-- kernel/arch/dreamcast/kernel/mmu.c | 13 +-- 3 files changed, 166 insertions(+), 15 deletions(-) diff --git a/kernel/arch/dreamcast/include/arch/memory.h b/kernel/arch/dreamcast/include/arch/memory.h index 5b1d82b..bc47b30 100644 --- a/kernel/arch/dreamcast/include/arch/memory.h +++ b/kernel/arch/dreamcast/include/arch/memory.h @@ -201,6 +201,155 @@ __BEGIN_DECLS */ #define MEM_AREA_CTRL_REG_BASE 0xff000000 +/** \brief MMU Control Registers + \defgroup sh4_mmu_regs + \ingroup sh4_cr_regs + + \see arch\mmu.h + + These are registers for controlling the MMU as defined in table 3.1 + of Hitatchi SH7750 Series Hardware Manual rev 6.0, titled "MMU Registers". + All are accessed as 32-bit values. + +*/ + +/** \brief MMU Page table entry high. + \ingroup sh4_mmu_regs + + When an MMU exception or address error exception occurs, the virtual page number (VPN) + (the upper 22-bits of the virtual address causing the exception) is written + to the register. The bottom 8 bits of the register are software-fillable as + an 8 bit ID (ASID) of the process causing the exception. +*/ +#define SH4_REG_MMU_PTEH 0xff000000 + +/** \brief MMU Page table entry low. + \ingroup sh4_mmu_regs + + Holds the physical page number (PPN) in bits 10-28 and page management flags in 0-8. +*/ +#define SH4_REG_MMU_PTEL 0xff000004 + +/** \brief MMU Translation table base. + \ingroup sh4_mmu_regs + + Holds the base address of the currently used page table. +*/ +#define SH4_REG_MMU_TTB 0xff000008 + +/** \brief MMU TLB Exception address. + \ingroup sh4_mmu_regs + + After an MMU exception or address error exception occurs, the virtual address where the + exception occurred is stored here. +*/ +#define SH4_REG_MMU_TEA 0xff00000c + +/** \brief MMU Control Register. + \ingroup sh4_mmu_regs + + Holds configuration values including enable/disable of MMU Address Translation (at bit 0) +*/ +#define SH4_REG_MMU_CR 0xff000010 + +/** \brief MMU Page table entry assistance. + \ingroup sh4_mmu_regs + + Stores assistance bits for PCMCIA access to the UTLB via LDTLB. This is currently unused by KOS. +*/ +#define SH4_REG_MMU_PTEA 0xff000034 + +/** \brief UBC Control Registers + \defgroup sh4_ubc_regs + \ingroup sh4_cr_regs + + \see dc\ubc.h + + These are registers for controlling the UBC as defined in table 20.1 + of Hitatchi SH7750 Series Hardware Manual rev 6.0, titled "UBC Registers" + +*/ + +/** \brief UBC Break ASID register A + \ingroup sh4_ubc_regs + + Specifies the ASID used in the channel A break condition. 8-bit RW. +*/ +#define SH4_REG_UBC_BASRA 0xff000014 + +/** \brief UBC Break ASID register B + \ingroup sh4_ubc_regs + + Specifies the ASID used in the channel B break condition. 8-bit RW. +*/ +#define SH4_REG_UBC_BASRB 0xff000018 + +/** \brief UBC Break address register A + \ingroup sh4_ubc_regs + + Specifies the virtual address used in the channel A break conditions. 32-bit RW. +*/ +#define SH4_REG_UBC_BARA 0xff200000 + +/** \brief UBC Break address mask register A + \ingroup sh4_ubc_regs + + Specifies the settings for masking the ASID in channel A. 8-bit RW. +*/ +#define SH4_REG_UBC_BAMRA 0xff200004 + +/** \brief UBC Break bus cycle register A + \ingroup sh4_ubc_regs + + Sets three conditions: 1) instruction/operand access 2) RW 3) Operand size. 16-bit RW. +*/ +#define SH4_REG_UBC_BBRA 0xff200008 + +/** \brief UBC Break address register B + \ingroup sh4_ubc_regs + + Specifies the virtual address used in the channel B break conditions. 32-bit RW. +*/ +#define SH4_REG_UBC_BARB 0xff20000c + +/** \brief UBC Break address mask register B + \ingroup sh4_ubc_regs + + Specifies the settings for masking the ASID in channel B. 8-bit RW. +*/ +#define SH4_REG_UBC_BAMRB 0xff200010 + +/** \brief UBC Break bus cycle register B + \ingroup sh4_ubc_regs + + Sets three conditions: 1) instruction/operand access 2) RW 3) Operand size. 16-bit RW. +*/ +#define SH4_REG_UBC_BBRB 0xff200014 + + +/** \brief UBC Break data register B + \ingroup sh4_ubc_regs + + Specifies the data to be used in the channel B break conditions. 32-bit RW. + Currently unused by KOS +*/ +#define SH4_REG_UBC_BDRB 0xff200018 + +/** \brief UBC Break mask register B + \ingroup sh4_ubc_regs + + Specifies which bits of the break data set in SH4_REG_UBC_BDRB are to be masked. 32-bit RW. + Currently unused by KOS +*/ +#define SH4_REG_UBC_BDMRB 0xff20001c + +/** \brief UBC Break control register + \ingroup sh4_ubc_regs + + Specifies various settings for UBC as well as condition match flags. 16-bit RW. +*/ +#define SH4_REG_UBC_BRCR 0xff200020 + __END_DECLS #endif /* __ARCH_MEMORY_H */ diff --git a/kernel/arch/dreamcast/include/dc/ubc.h b/kernel/arch/dreamcast/include/dc/ubc.h index 0ec5995..d64ebab 100644 --- a/kernel/arch/dreamcast/include/dc/ubc.h +++ b/kernel/arch/dreamcast/include/dc/ubc.h @@ -20,6 +20,7 @@ __BEGIN_DECLS #include <arch/types.h> +#include <arch/memory.h> /* From the SH-4 PDF */ /** \defgroup ubc_regs UBC Registers @@ -29,15 +30,15 @@ __BEGIN_DECLS @{ */ -#define BARA (*((vuint32*)0xFF200000)) /**< \brief BARA register. */ -#define BASRA (*((vuint8*)0xFF000014)) /**< \brief BASRA register. */ -#define BAMRA (*((vuint8*)0xFF200004)) /**< \brief BAMRA register. */ -#define BBRA (*((vuint16*)0xFF200008)) /**< \brief BBRA register. */ -#define BARB (*((vuint32*)0xFF20000C)) /**< \brief BARB register. */ -#define BASRB (*((vuint8*)0xFF000018)) /**< \brief BASRB register. */ -#define BAMRB (*((vuint8*)0xFF200010)) /**< \brief BAMRB register. */ -#define BBRB (*((vuint16*)0xFF200014)) /**< \brief BBRB register. */ -#define BRCR (*((vuint16*)0xFF200020)) /**< \brief BRCR register. */ +#define BARA (*((vuint32*)SH4_REG_UBC_BARA)) /**< \brief BARA register. */ +#define BASRA (*((vuint8*)SH4_REG_UBC_BASRA)) /**< \brief BASRA register. */ +#define BAMRA (*((vuint8*)SH4_REG_UBC_BAMRA)) /**< \brief BAMRA register. */ +#define BBRA (*((vuint16*)SH4_REG_UBC_BBRA)) /**< \brief BBRA register. */ +#define BARB (*((vuint32*)SH4_REG_UBC_BARB)) /**< \brief BARB register. */ +#define BASRB (*((vuint8*)SH4_REG_UBC_BDRB)) /**< \brief BASRB register. */ +#define BAMRB (*((vuint8*)SH4_REG_UBC_BAMRB)) /**< \brief BAMRB register. */ +#define BBRB (*((vuint16*)SH4_REG_UBC_BBRB)) /**< \brief BBRB register. */ +#define BRCR (*((vuint16*)SH4_REG_UBC_BRCR)) /**< \brief BRCR register. */ /** @} */ /* These are inlined to avoid complications with using them */ diff --git a/kernel/arch/dreamcast/kernel/mmu.c b/kernel/arch/dreamcast/kernel/mmu.c index 81506de..32c1741 100644 --- a/kernel/arch/dreamcast/kernel/mmu.c +++ b/kernel/arch/dreamcast/kernel/mmu.c @@ -13,6 +13,7 @@ #include <arch/arch.h> #include <arch/types.h> #include <arch/irq.h> +#include <arch/memory.h> #include <arch/mmu.h> #include <kos/dbgio.h> #include <arch/cache.h> @@ -20,12 +21,12 @@ /********************************************************************************/ /* Register definitions */ -static volatile uint32 * const pteh = (uint32 *)(0xff000000); -static volatile uint32 * const ptel = (uint32 *)(0xff000004); -//static volatile uint32 * const ptea = (uint32 *)(0xff000034); -static volatile uint32 * const ttb = (uint32 *)(0xff000008); -static volatile uint32 * const tea = (uint32 *)(0xff00000c); -static volatile uint32 * const mmucr = (uint32 *)(0xff000010); +static volatile uint32 * const pteh = (uint32 *)(SH4_REG_MMU_PTEH); +static volatile uint32 * const ptel = (uint32 *)(SH4_REG_MMU_PTEL); +//static volatile uint32 * const ptea = (uint32 *)(SH4_REG_MMU_PTEA); +static volatile uint32 * const ttb = (uint32 *)(SH4_REG_MMU_TTB); +static volatile uint32 * const tea = (uint32 *)(SH4_REG_MMU_TEA); +static volatile uint32 * const mmucr = (uint32 *)(SH4_REG_MMU_CR); #define SET_PTEH(VA, ASID) \ do { *pteh = ((VA) & 0xfffffc00) | ((ASID) & 0xff); } while(0) hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-15 23:10:33
|
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 42e36042a63aec317c38dacb7683db4f28c4b802 (commit) from 92ef58e0127d75b08ee8cde28166c4c71460cb72 (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 42e36042a63aec317c38dacb7683db4f28c4b802 Author: darcagn <da...@pr...> Date: Fri Dec 15 17:09:59 2023 -0600 Replace KallistiGL examples with GLdc (#353) * Remove -lGL from Parallax Bubbles demo Makefile as it does not use GL * Modify kgl examples to link against "libKGL" in preparation for deprecation * Add initial working GLdc examples ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/cpp/gltest/Makefile | 2 +- examples/dreamcast/cpp/gltest/gltest.cpp | 13 +++++++------ examples/dreamcast/{kgl => gldc}/Makefile | 9 +++------ examples/dreamcast/{kgl => gldc}/basic/Makefile | 6 +++--- examples/dreamcast/{kgl => gldc}/basic/vq/Makefile | 8 ++++---- examples/dreamcast/{kgl => gldc}/basic/vq/fruit.jpg | Bin .../dreamcast/{kgl => gldc}/basic/vq/vq-example.c | 9 +++++---- examples/dreamcast/{kgl => gldc}/benchmarks/Makefile | 0 .../{kgl => gldc}/benchmarks/quadmark/Makefile | 2 +- .../{kgl => gldc}/benchmarks/quadmark/quadmark.c | 8 ++++---- .../{kgl => gldc}/benchmarks/trimark/Makefile | 2 +- .../{kgl => gldc}/benchmarks/trimark/trimark.c | 11 ++++------- .../{kgl => gldc}/benchmarks/tristripmark/Makefile | 2 +- .../benchmarks/tristripmark/tristripmark.c | 8 ++++---- examples/dreamcast/{kgl => gldc}/nehe/Makefile | 4 ++-- .../dreamcast/{kgl => gldc}/nehe/nehe02/Makefile | 0 .../dreamcast/{kgl => gldc}/nehe/nehe02/nehe02.c | 4 ++-- .../dreamcast/{kgl => gldc}/nehe/nehe05/Makefile | 0 .../dreamcast/{kgl => gldc}/nehe/nehe05/nehe05.c | 4 ++-- .../dreamcast/{kgl => gldc}/nehe/nehe26/Makefile | 0 .../{kgl => gldc}/nehe/nehe26/data/Makefile | 0 .../{kgl => gldc}/nehe/nehe26/data/sphere.txt | 0 .../{kgl => gldc}/nehe/nehe26/data/torus.txt | 0 .../{kgl => gldc}/nehe/nehe26/data/tube.txt | 0 .../{kgl => gldc}/nehe/nehe26/data/txt2bin.c | 0 .../dreamcast/{kgl => gldc}/nehe/nehe26/nehe26.c | 19 +++++++++++++++---- .../{kgl => gldc}/nehe/nehe26/romdisk/sphere.bin | Bin .../{kgl => gldc}/nehe/nehe26/romdisk/torus.bin | Bin .../{kgl => gldc}/nehe/nehe26/romdisk/tube.bin | Bin examples/dreamcast/kgl/basic/elements/Makefile | 2 +- examples/dreamcast/kgl/basic/elements/gl-elements.c | 6 +++--- examples/dreamcast/kgl/basic/elements/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/basic/gl/Makefile | 2 +- examples/dreamcast/kgl/basic/gl/gltest.c | 6 +++--- examples/dreamcast/kgl/basic/gl/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/basic/scissor/Makefile | 2 +- examples/dreamcast/kgl/basic/scissor/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/basic/scissor/scissor.c | 6 +++--- examples/dreamcast/kgl/basic/txrenv/Makefile | 2 +- examples/dreamcast/kgl/basic/txrenv/gltest.c | 6 +++--- examples/dreamcast/kgl/basic/txrenv/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/basic/vq/Makefile | 2 +- examples/dreamcast/kgl/basic/vq/vq-example.c | 6 +++--- examples/dreamcast/kgl/basic/zclip_arrays/Makefile | 2 +- .../dreamcast/kgl/basic/zclip_arrays/gl-arrays.c | 6 +++--- .../dreamcast/kgl/basic/zclip_arrays/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/benchmarks/quadmark/Makefile | 2 +- .../dreamcast/kgl/benchmarks/quadmark/quadmark.c | 4 ++-- examples/dreamcast/kgl/benchmarks/trimark/Makefile | 2 +- examples/dreamcast/kgl/benchmarks/trimark/trimark.c | 4 ++-- .../dreamcast/kgl/benchmarks/tristripmark/Makefile | 2 +- .../kgl/benchmarks/tristripmark/tristripmark.c | 4 ++-- examples/dreamcast/kgl/demos/blur/Makefile | 2 +- examples/dreamcast/kgl/demos/blur/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/demos/blur/radial_blur.c | 8 ++++---- examples/dreamcast/kgl/demos/mipmap/Makefile | 2 +- examples/dreamcast/kgl/demos/mipmap/gl-mipmap.c | 6 +++--- examples/dreamcast/kgl/demos/mipmap/pvr-texture.c | 4 ++-- .../dreamcast/kgl/demos/multitexture-arrays/Makefile | 2 +- .../demos/multitexture-arrays/gl-multitex-arrays.c | 8 ++++---- .../kgl/demos/multitexture-arrays/pvr-texture.c | 4 ++-- .../kgl/demos/multitexture-elements/Makefile | 2 +- .../multitexture-elements/gl-multitex-elements.c | 8 ++++---- .../kgl/demos/multitexture-elements/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/demos/specular/Makefile | 2 +- examples/dreamcast/kgl/demos/specular/font.c | 2 +- examples/dreamcast/kgl/demos/specular/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/demos/specular/specular.c | 6 +++--- examples/dreamcast/kgl/demos/specular/texture.h | 2 +- examples/dreamcast/kgl/demos/specular/vector.h | 2 +- examples/dreamcast/kgl/nehe/nehe02/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe02/nehe02.c | 6 +++--- examples/dreamcast/kgl/nehe/nehe05/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe05/nehe05.c | 6 +++--- examples/dreamcast/kgl/nehe/nehe06/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe06/nehe06.c | 6 +++--- examples/dreamcast/kgl/nehe/nehe06/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/nehe/nehe08/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe08/nehe08.c | 6 +++--- examples/dreamcast/kgl/nehe/nehe08/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/nehe/nehe09/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe09/nehe09.c | 6 +++--- examples/dreamcast/kgl/nehe/nehe09/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/nehe/nehe16/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe16/nehe16.c | 6 +++--- examples/dreamcast/kgl/nehe/nehe16/pvr-texture.c | 4 ++-- examples/dreamcast/kgl/nehe/nehe26/Makefile | 2 +- examples/dreamcast/kgl/nehe/nehe26/nehe26.c | 6 +++--- examples/dreamcast/parallax/bubbles/bubbles.c | 2 +- 89 files changed, 175 insertions(+), 168 deletions(-) copy examples/dreamcast/{kgl => gldc}/Makefile (68%) copy examples/dreamcast/{kgl => gldc}/basic/Makefile (85%) copy examples/dreamcast/{kgl => gldc}/basic/vq/Makefile (84%) copy examples/dreamcast/{kgl => gldc}/basic/vq/fruit.jpg (100%) copy examples/dreamcast/{kgl => gldc}/basic/vq/vq-example.c (96%) copy examples/dreamcast/{kgl => gldc}/benchmarks/Makefile (100%) copy examples/dreamcast/{kgl => gldc}/benchmarks/quadmark/Makefile (92%) copy examples/dreamcast/{kgl => gldc}/benchmarks/quadmark/quadmark.c (94%) copy examples/dreamcast/{kgl => gldc}/benchmarks/trimark/Makefile (91%) copy examples/dreamcast/{kgl => gldc}/benchmarks/trimark/trimark.c (94%) copy examples/dreamcast/{kgl => gldc}/benchmarks/tristripmark/Makefile (92%) copy examples/dreamcast/{kgl => gldc}/benchmarks/tristripmark/tristripmark.c (94%) copy examples/dreamcast/{kgl => gldc}/nehe/Makefile (90%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe02/Makefile (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe02/nehe02.c (97%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe05/Makefile (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe05/nehe05.c (98%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/Makefile (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/data/Makefile (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/data/sphere.txt (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/data/torus.txt (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/data/tube.txt (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/data/txt2bin.c (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/nehe26.c (95%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/romdisk/sphere.bin (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/romdisk/torus.bin (100%) copy examples/dreamcast/{kgl => gldc}/nehe/nehe26/romdisk/tube.bin (100%) diff --git a/examples/dreamcast/cpp/gltest/Makefile b/examples/dreamcast/cpp/gltest/Makefile index 03c50d3..7815633 100644 --- a/examples/dreamcast/cpp/gltest/Makefile +++ b/examples/dreamcast/cpp/gltest/Makefile @@ -18,7 +18,7 @@ rm-elf: -rm -f $(TARGET) romdisk.* $(TARGET): $(OBJS) - kos-c++ -o $(TARGET) $(OBJS) -lGL -lkosutils + kos-c++ -o $(TARGET) $(OBJS) -lGL -lm -lkosutils run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/cpp/gltest/gltest.cpp b/examples/dreamcast/cpp/gltest/gltest.cpp index 01dd49d..fd82462 100644 --- a/examples/dreamcast/cpp/gltest/gltest.cpp +++ b/examples/dreamcast/cpp/gltest/gltest.cpp @@ -8,7 +8,8 @@ #include <kos.h> #include <GL/gl.h> #include <GL/glu.h> -#include <GL/glut.h> +#include <GL/glext.h> +#include <GL/glkos.h> /* @@ -267,7 +268,7 @@ void loadtxr(const char *fname, GLuint *txr) { 0, GL_RGB, texFormat | texColor, - texBuf); + texBuf); } int main(int argc, char **argv) { @@ -300,9 +301,9 @@ int main(int argc, char **argv) { /* Load a texture and make it look nice */ loadtxr("/rd/glass.pvr", &texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_FILTER_BILINEAR); - glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATEALPHA); - + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); printf("texture is %08x\n", texture); @@ -394,7 +395,7 @@ int main(int argc, char **argv) { cubes[3]->draw(); /* Finish the frame */ - glutSwapBuffers(); + glKosSwapBuffers(); } for(int i = 0; i < 4; i++) { diff --git a/examples/dreamcast/kgl/Makefile b/examples/dreamcast/gldc/Makefile similarity index 68% copy from examples/dreamcast/kgl/Makefile copy to examples/dreamcast/gldc/Makefile index cbda21e..be486d7 100644 --- a/examples/dreamcast/kgl/Makefile +++ b/examples/dreamcast/gldc/Makefile @@ -1,25 +1,22 @@ # KallistiOS ##version## # -# examples/dreamcast/kgl/Makefile -# (c)2002 Megan Potter +# examples/dreamcast/gldc/Makefile +# (c)2002 Megan Potter # all: $(KOS_MAKE) -C basic $(KOS_MAKE) -C benchmarks - $(KOS_MAKE) -C demos $(KOS_MAKE) -C nehe clean: $(KOS_MAKE) -C basic clean $(KOS_MAKE) -C benchmarks clean - $(KOS_MAKE) -C demos clean $(KOS_MAKE) -C nehe clean - + dist: $(KOS_MAKE) -C basic dist $(KOS_MAKE) -C benchmarks dist - $(KOS_MAKE) -C demos dist $(KOS_MAKE) -C nehe dist diff --git a/examples/dreamcast/kgl/basic/Makefile b/examples/dreamcast/gldc/basic/Makefile similarity index 85% copy from examples/dreamcast/kgl/basic/Makefile copy to examples/dreamcast/gldc/basic/Makefile index 50bd83b..5e6a058 100644 --- a/examples/dreamcast/kgl/basic/Makefile +++ b/examples/dreamcast/gldc/basic/Makefile @@ -1,14 +1,14 @@ # KallistiOS ##version## # -# examples/dreamcast/kgl/basic/Makefile -# +# examples/dreamcast/gldc/basic/Makefile +# # (c)2014 Josh Pearson # (c)2002 Paul Boese # # This will make all the examples, leaving only the elf files. # If you want to clean everything, use 'clean'. -SUBDIRS = elements gl scissor txrenv vq zclip_arrays +SUBDIRS = vq all: $(patsubst %, _dir_%, $(SUBDIRS)) diff --git a/examples/dreamcast/kgl/basic/vq/Makefile b/examples/dreamcast/gldc/basic/vq/Makefile similarity index 84% copy from examples/dreamcast/kgl/basic/vq/Makefile copy to examples/dreamcast/gldc/basic/vq/Makefile index 4baa290..1069bd3 100644 --- a/examples/dreamcast/kgl/basic/vq/Makefile +++ b/examples/dreamcast/gldc/basic/vq/Makefile @@ -1,7 +1,7 @@ # OpenGL (c)2013-2014 Josh PH3NOM Pearson TARGET = vq-example.elf -OBJS = vq-example.o fruit.o +OBJS = vq-example.o fruit.o all: rm-elf $(TARGET) @@ -11,9 +11,9 @@ clean: rm-elf -rm -f $(OBJS) fruit.vq rm-elf: - -rm -f $(TARGET) + -rm -f $(TARGET) -$(TARGET): $(OBJS) +$(TARGET): $(OBJS) kos-cc -o $(TARGET) $(OBJS) -L$(KOS_BASE)/lib -lGL -lm fruit.o: fruit.vq @@ -26,6 +26,6 @@ run: $(TARGET) $(KOS_LOADER) $(TARGET) dist: $(TARGET) - -rm -f $(OBJS) + -rm -f $(OBJS) $(KOS_STRIP) $(TARGET) diff --git a/examples/dreamcast/kgl/basic/vq/fruit.jpg b/examples/dreamcast/gldc/basic/vq/fruit.jpg similarity index 100% copy from examples/dreamcast/kgl/basic/vq/fruit.jpg copy to examples/dreamcast/gldc/basic/vq/fruit.jpg diff --git a/examples/dreamcast/kgl/basic/vq/vq-example.c b/examples/dreamcast/gldc/basic/vq/vq-example.c similarity index 96% copy from examples/dreamcast/kgl/basic/vq/vq-example.c copy to examples/dreamcast/gldc/basic/vq/vq-example.c index 238613a..86b95ad 100644 --- a/examples/dreamcast/kgl/basic/vq/vq-example.c +++ b/examples/dreamcast/gldc/basic/vq/vq-example.c @@ -1,4 +1,4 @@ -/* +/* KallistiOS 2.0.0 vq-example.c @@ -17,7 +17,8 @@ #include <GL/gl.h> #include <GL/glu.h> -#include <GL/glut.h> +#include <GL/glext.h> +#include <GL/glkos.h> GLfloat xrot; /* X Rotation */ GLfloat yrot; /* Y Rotation */ @@ -37,7 +38,7 @@ static int loadtxr(void) { glCompressedTexImage2D(GL_TEXTURE_2D, /* This must be GL_TEXTURE_2D */ 0, /* 0 = Texture does not contain Mip-Maps */ - GL_UNSIGNED_SHORT_5_6_5_VQ_TWID, /* GL Compressed Color Format */ + GL_COMPRESSED_RGB_565_VQ_TWID_KOS, /* GL Compressed Color Format */ 512, /* Texture Width */ 512, /* Texture Height */ 0, /* This bit must be set to 0 */ @@ -190,7 +191,7 @@ int main(int argc, char **argv) { draw_gl(); /* Finish the frame */ - glutSwapBuffers(); + glKosSwapBuffers(); } glDeleteTextures(1, texture); diff --git a/examples/dreamcast/kgl/benchmarks/Makefile b/examples/dreamcast/gldc/benchmarks/Makefile similarity index 100% copy from examples/dreamcast/kgl/benchmarks/Makefile copy to examples/dreamcast/gldc/benchmarks/Makefile diff --git a/examples/dreamcast/kgl/benchmarks/quadmark/Makefile b/examples/dreamcast/gldc/benchmarks/quadmark/Makefile similarity index 92% copy from examples/dreamcast/kgl/benchmarks/quadmark/Makefile copy to examples/dreamcast/gldc/benchmarks/quadmark/Makefile index ad4f9fb..951b2f8 100644 --- a/examples/dreamcast/kgl/benchmarks/quadmark/Makefile +++ b/examples/dreamcast/gldc/benchmarks/quadmark/Makefile @@ -19,7 +19,7 @@ rm-elf: -rm -f $(TARGET) $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -lGL + kos-cc -o $(TARGET) $(OBJS) -lGL -lm run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c b/examples/dreamcast/gldc/benchmarks/quadmark/quadmark.c similarity index 94% copy from examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c copy to examples/dreamcast/gldc/benchmarks/quadmark/quadmark.c index 0a6e380..e695aac 100644 --- a/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c +++ b/examples/dreamcast/gldc/benchmarks/quadmark/quadmark.c @@ -9,7 +9,7 @@ #include <kos.h> #include <GL/gl.h> -#include <GL/glut.h> +#include <GL/glkos.h> #include <stdlib.h> #include <time.h> @@ -40,7 +40,7 @@ void stats(void) { pvr_get_stats(&stats); dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", - stats.vbl_count, (double)stats.frame_rate); + stats.vbl_count, stats.frame_rate); } @@ -95,7 +95,7 @@ void do_frame(void) { glEnd(); - glutSwapBuffers(); + glKosSwapBuffers(); } time_t begin; @@ -113,7 +113,7 @@ void check_switch(void) { if(now >= (begin + 5)) { begin = time(NULL); - printf(" Average Frame Rate: ~%f fps (%d pps)\n", (double)avgfps, (int)(polycnt * avgfps * 2)); + printf(" Average Frame Rate: ~%f fps (%d pps)\n", avgfps, (int)(polycnt * avgfps * 2)); switch(phase) { case PHASE_HALVE: diff --git a/examples/dreamcast/kgl/benchmarks/trimark/Makefile b/examples/dreamcast/gldc/benchmarks/trimark/Makefile similarity index 91% copy from examples/dreamcast/kgl/benchmarks/trimark/Makefile copy to examples/dreamcast/gldc/benchmarks/trimark/Makefile index 397b065..4c14f6a 100644 --- a/examples/dreamcast/kgl/benchmarks/trimark/Makefile +++ b/examples/dreamcast/gldc/benchmarks/trimark/Makefile @@ -18,7 +18,7 @@ rm-elf: -rm -f $(TARGET) $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -lGL + kos-cc -o $(TARGET) $(OBJS) -lGL -lm run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/benchmarks/trimark/trimark.c b/examples/dreamcast/gldc/benchmarks/trimark/trimark.c similarity index 94% copy from examples/dreamcast/kgl/benchmarks/trimark/trimark.c copy to examples/dreamcast/gldc/benchmarks/trimark/trimark.c index 38866c4..a6e874e 100644 --- a/examples/dreamcast/kgl/benchmarks/trimark/trimark.c +++ b/examples/dreamcast/gldc/benchmarks/trimark/trimark.c @@ -9,7 +9,7 @@ #include <kos.h> #include <GL/gl.h> -#include <GL/glut.h> +#include <GL/glkos.h> #include <stdlib.h> #include <time.h> @@ -40,7 +40,7 @@ void stats(void) { pvr_get_stats(&stats); dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", - stats.vbl_count, (double)stats.frame_rate); + stats.vbl_count, stats.frame_rate); } @@ -94,7 +94,7 @@ void do_frame(void) { glEnd(); - glutSwapBuffers(); + glKosSwapBuffers(); } time_t begin; @@ -112,7 +112,7 @@ void check_switch(void) { if(now >= (begin + 5)) { begin = time(NULL); - printf(" Average Frame Rate: ~%f fps (%d pps)\n", (double)avgfps, (int)(polycnt * avgfps * 2)); + printf(" Average Frame Rate: ~%f fps (%d pps)\n", avgfps, (int)(polycnt * avgfps * 2)); switch(phase) { case PHASE_HALVE: @@ -175,6 +175,3 @@ int main(int argc, char **argv) { return 0; } - - - diff --git a/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile b/examples/dreamcast/gldc/benchmarks/tristripmark/Makefile similarity index 92% copy from examples/dreamcast/kgl/benchmarks/tristripmark/Makefile copy to examples/dreamcast/gldc/benchmarks/tristripmark/Makefile index f6c4074..2a9592c 100644 --- a/examples/dreamcast/kgl/benchmarks/tristripmark/Makefile +++ b/examples/dreamcast/gldc/benchmarks/tristripmark/Makefile @@ -19,7 +19,7 @@ rm-elf: -rm -f $(TARGET) $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -lGL + kos-cc -o $(TARGET) $(OBJS) -lGL -lm run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c b/examples/dreamcast/gldc/benchmarks/tristripmark/tristripmark.c similarity index 94% copy from examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c copy to examples/dreamcast/gldc/benchmarks/tristripmark/tristripmark.c index 8cb6735..12f2690 100644 --- a/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c +++ b/examples/dreamcast/gldc/benchmarks/tristripmark/tristripmark.c @@ -9,7 +9,7 @@ #include <kos.h> #include <GL/gl.h> -#include <GL/glut.h> +#include <GL/glkos.h> #include <stdlib.h> #include <time.h> @@ -40,7 +40,7 @@ void stats(void) { pvr_get_stats(&stats); dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", - stats.vbl_count, (double)stats.frame_rate); + stats.vbl_count, stats.frame_rate); } @@ -97,7 +97,7 @@ void do_frame(void) { - glutSwapBuffers(); + glKosSwapBuffers(); } time_t begin; @@ -115,7 +115,7 @@ void check_switch(void) { if(now >= (begin + 5)) { begin = time(NULL); - printf(" Average Frame Rate: ~%f fps (%d pps)\n", (double)avgfps, (int)(polycnt * avgfps * 2)); + printf(" Average Frame Rate: ~%f fps (%d pps)\n", avgfps, (int)(polycnt * avgfps * 2)); switch(phase) { case PHASE_HALVE: diff --git a/examples/dreamcast/kgl/nehe/Makefile b/examples/dreamcast/gldc/nehe/Makefile similarity index 90% copy from examples/dreamcast/kgl/nehe/Makefile copy to examples/dreamcast/gldc/nehe/Makefile index ffd485a..0f339ab 100644 --- a/examples/dreamcast/kgl/nehe/Makefile ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-15 20:08:37
|
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 serial program loader for the Dreamcast.". The branch, master has been updated via cd5e409584bf390cfeb8e88430cb05bd1a76823b (commit) via dce9e9a9b05613d410b74dbdd713f68279640f3f (commit) via 04348321e3dbd19177487e4e0392c6cb1c9ad2aa (commit) from da35b5992eda1330497aec78192bdd0400c239f9 (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 cd5e409584bf390cfeb8e88430cb05bd1a76823b Merge: da35b59 dce9e9a Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 15 15:08:11 2023 -0500 Merge pull request #23 from KallistiOS/dcload_ip_fix_ports Ported 2 Bugfixes/Enhancements from DCLoad-IP commit dce9e9a9b05613d410b74dbdd713f68279640f3f Author: Falco Girgis <gyr...@gm...> Date: Thu Nov 16 12:29:46 2023 -0600 Fixed build issue + preexisting warning - log_error() is only defined in dc-load-ip, switched to perror() - included <time.h> to remove undeclared function warnings for time() commit 04348321e3dbd19177487e4e0392c6cb1c9ad2aa Author: Falco Girgis <gyr...@gm...> Date: Thu Nov 16 12:16:49 2023 -0600 Ported two bugfixes from dcload/tool IP 1) dcload-ip commit ID 6522d8089593690852b3685be2b5f5d9222ad796: - Previously, if you had completed a debugging session and had started a new one too quickly, you could very frequently get the error "error binding gdb server socket" which would also freeze the DC, making it need a hard reboot - This is because the OS hadn't had a chance to terminate the existing socket bound to the existing address - This commit sets the socket to allow for reuse of local addresses 2) dcload-ip commit ID 871419616992ce86d0437b5b3a80fc3925ebdab7: - Fixed crash on GDB disconnect. - We were getting a -1 from recv(), which we were then passing on to send_command(), which was causing a buffer overflow and crash. It seems as though MinGW might be protected from this. ----------------------------------------------------------------------- Summary of changes: host-src/tool/dc-tool.c | 11 +++++++++++ host-src/tool/syscalls.c | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/host-src/tool/dc-tool.c b/host-src/tool/dc-tool.c index 2f6c416..992ccb5 100644 --- a/host-src/tool/dc-tool.c +++ b/host-src/tool/dc-tool.c @@ -784,6 +784,17 @@ int open_gdb_socket(int port) { perror("error creating gdb server socket"); return -1; } + + const int enable_reuse_addr = 1; + int checkopt = setsockopt(gdb_server_socket, SOL_SOCKET, SO_REUSEADDR, + &enable_reuse_addr, sizeof(enable_reuse_addr)); +#ifdef __MINGW32__ + if( checkopt == SOCKET_ERROR ) { +#else + if( checkopt < 0 ) { +#endif + perror( "warning: failed to set gdb socket options" ); + } int checkbind = bind(gdb_server_socket, (struct sockaddr*)&server_addr, sizeof(server_addr)); #ifdef __MINGW32__ diff --git a/host-src/tool/syscalls.c b/host-src/tool/syscalls.c index 2632a18..ada7aa6 100644 --- a/host-src/tool/syscalls.c +++ b/host-src/tool/syscalls.c @@ -25,7 +25,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <errno.h> #include <sys/time.h> +#include <time.h> #include <unistd.h> #include <utime.h> #include <dirent.h> @@ -507,6 +509,11 @@ void dc_gdbpacket(void) { fprintf(stderr, "Got socket error: %d\n", WSAGetLastError()); return; } +#else + if(retval == -1) { + fprintf(stderr, "Got socket error: %s\n", strerror(errno)); + return; + } #endif send_uint(retval); if(retval > 0) hooks/post-receive -- A serial program loader for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-15 19:39:25
|
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 92ef58e0127d75b08ee8cde28166c4c71460cb72 (commit) from a7789e6439b2b1028b5daea78ed33ef93f848752 (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 92ef58e0127d75b08ee8cde28166c4c71460cb72 Author: Falco Girgis <gyr...@gm...> Date: Fri Dec 15 13:38:37 2023 -0600 Timer Cleanup, Precision Enhancement (#345) * Added defines for all timer registers * More timer cleanup * Refactor complete, tests working. * TMUs successfully running at 80ns resolution! 1) added timer_us_gettime() as a mirror of timer_ms_gettime() which is to be used by C and POSIX date/time implementations 2) added timer_ns_gettime() is a mirror of timer_ms_gettime() which is to be used by C and POSIX date/time implementations 3) Added single #define for TIMER_TPSC value to support changing the clock divider used by all timers by changing a single line 4) Added LUTs for timer division ratio and nanoseconds per timer counter tick, indexed by TPSC value 5) Addd a #define for TIMER_PRIO to centralize/allow for changing of timer interrupt priority level (defaulted to 15, or highest level) 6) Renamed the HORRIBLE "timer_ms_counter" to "timer_ms_sec_counter" to make it known that it counts SECONDS, not milliseconds 7) Created static timer_gettime() internal function to unify reading the time into 2 uint32_t pointers for msec, usec, and nsec APIs 8) Modified newlib's _gettimeofday_r() to use the microsecond-resolution timer API, which should beef up gettimeofday(), clock_gettime(), time(), and std::chrono. 9) Modified C11's timespec_get() to use the nanosecond timing API to beef up C11's timer resolution * Formatting + extra comments in sketchy parts * Addressed review feedback + fixed compile issue - Apparently "timer_gettime()" is a reserved POSIX or system symbol... * Addressing review feedback * Fixed incorrect mask in timer_getticks() - Was OR-ing the individual bit positions for TPSC fields to create a mask, which would've missed the high bit. Made a dedicated #define for the mask. * Addressed zcrc's review feedback - Fixed a bug with how the overflow was being checked in timer_ms_gettime64() - Lots of aesthetic changes, including new BIT() macro - New comments to detail the crap out of everything - Modified the classic cpp "simple clock" example to demo increased resolution Removed unneeded include. * Optimization + protection from race condition - zcrc is now in on the PR, and he's helped to optimize timer_ms_getticks(), using some 1337 bitshifting math to replace a slow division - spotted another potential race condition scenario, which requires making multiple counter and underflow flag reads to ensure coherency - race condition fix has allowed us to no longer disable interrupts when querying TMU2 for ms/us/ns time. * Adding zcrc's initials to CHANGELOG update * Addressed Quzar's styling comments - Made the TMU register field defines bit masks instead of bit positions to be consitent with the rest of the drivers. * Began work on updated TMU Doxygen group * Fixed race condition, revamped Doxygen. - Fixed race condition between reading the TMU2 counter and checking its underflow flag which could cause a horrible intermittent mismatch between the seconds and ticks. - Tested for two hours straight using TapamN's timer_test from the DCEmulation forums to ensure we're race-free (we are). - Revamped the Doxygen to clean up grouping and add subgrouping. - Added one more API function for checking whether a timer is currently running or not. - The newfangled/better way to do POSIX date/time, which deprecates gettimeofday() is now at nanosecond resolution. * Move variable declaration before code. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + examples/dreamcast/cpp/clock/clock.cc | 17 +- kernel/arch/dreamcast/include/arch/timer.h | 316 +++++++++++++++++++++------ kernel/arch/dreamcast/kernel/timer.c | 340 +++++++++++++++++++---------- kernel/libc/c11/timespec_get.c | 7 +- kernel/libc/newlib/newlib_gettimeofday.c | 10 +- kernel/libc/posix/clock_gettime.c | 8 +- 7 files changed, 491 insertions(+), 208 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index fbbaa7b..d0d59b3 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -211,6 +211,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - DC Added Maple-specific KOS_INIT_FLAGS() which allow for GC-ing unused drivers [FG] - DC Added basic example for micropython KOS port [Aaron Glazer == AG] - DC Improved performance of IRQ context save / restore [PC] +- DC Increased resolution of TMU timers + date/time functions [FG && PC] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/examples/dreamcast/cpp/clock/clock.cc b/examples/dreamcast/cpp/clock/clock.cc index 1fc6bb8..c403ca0 100644 --- a/examples/dreamcast/cpp/clock/clock.cc +++ b/examples/dreamcast/cpp/clock/clock.cc @@ -2,6 +2,7 @@ // Ported to Dreamcast/KOS by Peter Hatch // read_input () code from KOS examples // Converted to a clock by Megan Potter +// Resolution enhanced by Falco Girgis #include <kos.h> #include <time.h> @@ -17,7 +18,7 @@ const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -float bg[3]; /* Current bg */ +float bg[3]; /* Current bg */ float bg_delta[3] = { 0.01f }; /* bg per-frame delta */ int bg_cur = 1; float bgarray[][3] = { @@ -55,15 +56,15 @@ void bgframe() { } void drawFrame() { - time_t t; + struct timespec spec; struct tm tm; char tmpbuf[256]; int y = 50; bgframe(); - t = time(NULL); - localtime_r(&t, &tm); + timespec_get(&spec, TIME_UTC); + localtime_r(&spec.tv_sec, &tm); pvr_wait_ready(); pvr_scene_begin(); @@ -77,11 +78,11 @@ void drawFrame() { text->begin(); text->setColor(1, 1, 1); text->start2f(20, y); - text->puts("Simple DC Clock"); + text->puts("(High Res) Simple DC Clock"); text->end(); y += 50; - sprintf(tmpbuf, "Unix Time: %lld", t); + sprintf(tmpbuf, "Unix: %lld", spec.tv_sec); text->begin(); text->setColor(1, 1, 1); @@ -100,8 +101,8 @@ void drawFrame() { text->end(); y += 50; - sprintf(tmpbuf, "%02d:%02d:%02d", - tm.tm_hour, tm.tm_min, tm.tm_sec); + sprintf(tmpbuf, "%02d:%02d:%02d.%lu", + tm.tm_hour, tm.tm_min, tm.tm_sec, spec.tv_nsec); text->begin(); text->setColor(1, 1, 1); diff --git a/kernel/arch/dreamcast/include/arch/timer.h b/kernel/arch/dreamcast/include/arch/timer.h index 683c54c..598cee4 100644 --- a/kernel/arch/dreamcast/include/arch/timer.h +++ b/kernel/arch/dreamcast/include/arch/timer.h @@ -1,12 +1,14 @@ /* KallistiOS ##version## arch/dreamcast/include/timer.h - (c)2000-2001 Megan Potter - + Copyright (c) 2000, 2001 Megan Potter + Copyright (c) 2023 Falco Girgis + */ -/** \file arch/timer.h - \brief Low-level timer functionality. +/** \file arch/timer.h + \brief Low-level timer functionality. + \ingroup timers This file contains functions for interacting with the timer sources on the SH4. Many of these functions may interfere with thread operation or other @@ -14,136 +16,229 @@ functionality that you might use in practice in here in normal programs is the gettime functions. + \sa arch/timer.h + \sa arch/wdt.h + \author Megan Potter + \author Falco Girgis */ #ifndef __ARCH_TIMER_H #define __ARCH_TIMER_H + +#include <stdint.h> #include <sys/cdefs.h> __BEGIN_DECLS -#include <arch/types.h> #include <arch/irq.h> -/* Timer sources -- we get four on the SH4 */ +/** \defgroup timers Timer Unit + \brief SH4 CPU peripheral providing timers and counters + + The Dreamcast's SH4 includes an on-chip Timer Unit (TMU) containing 3 + independent 32-bit channels (TMU0-TMU2). Each channel provides a + down-counter with automatic reload and can be configured to use 1 of + 7 divider circuits for its input clock. By default, KOS uses the fastest + input clock for each TMU channel, providing a maximum internal resolution + of 80ns ticks. + + \warning + Under normal circumstances, all 3 TMU channels are reserved by KOS for + various OS-related purposes. If you need a free general-purpose interval + timer, consider using the Watchdog Timer. + + \note + 90% of the time, you will never have a need to directly interact with this + API, as it's mostly used as a kernel-level driver which backs other APIs. + For example, querying for ticks, fetching the current timestamp, or putting + a thread to sleep is typically done via the standard C, C++, or POSIX APIs. + +*/ + +/** \defgroup tmus Channels + \brief TMU channel constants + \ingroup timers -/** \brief SH4 Timer 0. + The following are the constant `#define` identifiers for the 3 TMU channels. - This timer is used for thread operation, and thus is off limits if you want - that to work properly. + \warning + All three of these channels are typically reserved and are by KOS for + OS-related tasks. + + @{ +*/ + +/** \brief SH4 Timer Channel 0. + + \warning + This timer is used by the kernel's scheduler for thread operation, and thus + is off limits if you want that to work properly. */ #define TMU0 0 -/** \brief SH4 Timer 1. +/** \brief SH4 Timer Channel 1. - This timer is used for the timer_spin_sleep() function. + \warning + This timer channel is used for the timer_spin_sleep() function, which also + backs the kthread, C, C++, and POSIX sleep functions. */ #define TMU1 1 -/** \brief SH4 Timer 2. +/** \brief SH4 Timer Channel 2. - This timer is used by the various gettime functions in this header. + \warning + This timer channel is used by the various gettime functions in this header. + It also backs the standard C, C++, and POSIX date/time and clock functions. */ #define TMU2 2 -/** \brief Which timer does the thread system use? */ +/** @} */ + +/** \cond Which timer does the thread system use? */ #define TIMER_ID TMU0 +/** \endcond */ + +/** \defgroup tmu_direct Direct-Access + \brief Low-level timer driver + \ingroup timers + + This API provides a low-level driver abstraction around the TMU peripheral + and the control, counter, and reload registers of its 3 channels. + + \note + You typically want to use the higher-level APIs associated with the + functionality implemented by each timer channel. +*/ -/** \brief Pre-initialize a timer, but do not start it. +/** \brief Pre-initialize a timer channel, but do not start it. + \ingroup tmu_direct - This function sets up a timer for use, but does not start it. + This function sets up a timer channel for use, but does not start it. - \param which The timer to set up (i.e, \ref TMU0). + \param channel The timer channel to set up (\ref tmus). \param speed The number of ticks per second. \param interrupts Set to 1 to receive interrupts when the timer ticks. \retval 0 On success. */ -int timer_prime(int which, uint32 speed, int interrupts); +int timer_prime(int channel, uint32_t speed, int interrupts); -/** \brief Start a timer. +/** \brief Start a timer channel. + \ingroup tmu_direct - This function starts a timer that has been initialized with timer_prime(), - starting raising interrupts if applicable. + This function starts a timer channel that has been initialized with + timer_prime(), starting raising interrupts if applicable. - \param which The timer to start (i.e, \ref TMU0). + \param channel The timer channel to start (\ref tmus). \retval 0 On success. */ -int timer_start(int which); +int timer_start(int channel); -/** \brief Stop a timer. +/** \brief Stop a timer channel. + \ingroup tmu_direct - This function stops a timer that was started with timer_start(), and as a - result stops interrupts coming in from the timer. + This function stops a timer channel that was started with timer_start(), + and as a result stops interrupts coming in from the timer. - \param which The timer to stop (i.e, \ref TMU0). + \param channel The timer channel to stop (\ref tmus). \retval 0 On success. */ -int timer_stop(int which); +int timer_stop(int channel); -/** \brief Obtain the count of a timer. +/** \brief Checks whether a timer channel is running. + \ingroup tmu_direct - This function simply returns the count of the timer. + This function checks whether the given timer channel is actively counting. - \param which The timer to inspect (i.e, \ref TMU0). - \return The timer's count. + \param channel The timer channel to check (\ref tmus). + \retval 0 The timer channel is stopped. + \retval 1 The timer channel is running. */ -uint32 timer_count(int which); +int timer_running(int channel); -/** \brief Clear the underflow bit of a timer. +/** \brief Obtain the count of a timer channel. + \ingroup tmu_direct - This function clears the underflow bit of a timer if it was set. + This function simply returns the count of the timer channel. - \param which The timer to inspect (i.e, \ref TMU0). - \retval 0 If the underflow bit was clear (prior to calling). - \retval 1 If the underflow bit was set (prior to calling). + \param channel The timer channel to inspect (\ref tmus). + \return The timer's count. */ -int timer_clear(int which); +uint32_t timer_count(int channel); -/** \brief Spin-loop sleep function. +/** \brief Clear the underflow bit of a timer channel. + \ingroup tmu_direct - This function is meant as a very accurate delay function, even if threading - and interrupts are disabled. It uses \ref TMU1 to sleep. + This function clears the underflow bit of a timer channel if it was set. - \param ms The number of milliseconds to sleep. + \param channel The timer channel to clear (\ref tmus). + \retval 0 If the underflow bit was clear (prior to calling). + \retval 1 If the underflow bit was set (prior to calling). */ -void timer_spin_sleep(int ms); +int timer_clear(int channel); -/** \brief Enable high-priority timer interrupts. +/** \brief Enable high-priority timer interrupts. + \ingroup tmu_direct This function enables interrupts on the specified timer. - \param which The timer to enable interrupts on (i.e, \ref TMU0). + \param channel The timer channel to enable interrupts on (\ref tmus). */ -void timer_enable_ints(int which); +void timer_enable_ints(int channel); -/** \brief Disable timer interrupts. +/** \brief Disable timer interrupts. + \ingroup tmu_direct - This function disables interrupts on the specified timer. + This function disables interrupts on the specified timer channel. - \param which The timer to disable interrupts on (i.e, \ref TMU0). + \param channel The timer channel to disable interrupts on + (\ref tmus). */ -void timer_disable_ints(int which); +void timer_disable_ints(int channel); -/** \brief Check whether interrupts are enabled on a timer. +/** \brief Check whether interrupts are enabled on a timer channel. + \ingroup tmu_direct This function checks whether or not interrupts are enabled on the specified - timer. + timer channel. - \param which The timer to inspect (i.e, \ref TMU0). + \param channel The timer channel to inspect (\ref tmus). \retval 0 If interrupts are disabled on the timer. \retval 1 If interrupts are enabled on the timer. */ -int timer_ints_enabled(int which); +int timer_ints_enabled(int channel); + +/** \defgroup tmu_uptime Uptime + \brief Maintaining time since system boot. + \ingroup timers + + This API provides methods for querying the current system boot time or + uptime since KOS started at various resolutions. You can use this timing + for ticks, delta time, or frame deltas for games, profilers, or media + decoding. + + \note + This API is used to back the C, C++, and POSIX standard date/time + APIs. You may wish to favor these for platform independence. + + \warning + This API and its underlying functionality are using \ref TMU2, so any + direct manipulation of it will interfere with the API's proper functioning. + + \note + The highest actual tick resolution of \ref TMU2 is 80ns. +*/ -/** \brief Enable the millisecond timer. +/** \brief Enable the millisecond timer. + \ingroup tmu_uptime This function enables the timer used for the gettime functions. This is on by default. These functions use \ref TMU2 to do their work. */ void timer_ms_enable(void); -/** \brief Disable the millisecond timer. +/** \brief Disable the millisecond timer. + \ingroup tmu_uptime This function disables the timer used for the gettime functions. Generally, you will not want to do this, unless you have some need to use the timer @@ -151,7 +246,8 @@ void timer_ms_enable(void); */ void timer_ms_disable(void); -/** \brief Get the current uptime of the system. +/** \brief Get the current uptime of the system (in secs and millisecs). + \ingroup tmu_uptime This function retrieves the number of seconds and milliseconds since KOS was started. @@ -164,9 +260,10 @@ void timer_ms_disable(void); calculate (*secs * 1000) + *msecs, or use the timer_ms_gettime64() function. */ -void timer_ms_gettime(uint32 *secs, uint32 *msecs); +void timer_ms_gettime(uint32_t *secs, uint32_t *msecs); -/** \brief Get the current uptime of the system (in milliseconds). +/** \brief Get the current uptime of the system (in milliseconds). + \ingroup tmu_uptime This function retrieves the number of milliseconds since KOS was started. It is equivalent to calling timer_ms_gettime() and combining the number of @@ -174,9 +271,26 @@ void timer_ms_gettime(uint32 *secs, uint32 *msecs); \return The number of milliseconds since KOS started. */ -uint64 timer_ms_gettime64(void); +uint64_t timer_ms_gettime64(void); -/** \brief Get the current uptime of the system (in microseconds). +/** \brief Get the current uptime of the system (in secs and microsecs). + \ingroup tmu_uptime + + This function retrieves the number of seconds and microseconds since KOS was + started. + + \param secs A pointer to store the number of seconds since boot + into. + \param usecs A pointer to store the number of microseconds past + a second since boot. + \note To get the total number of microseconds since boot, + calculate (*secs * 1000000) + *usecs, or use the + timer_us_gettime64() function. +*/ +void timer_us_gettime(uint32_t *secs, uint32_t *usecs); + +/** \brief Get the current uptime of the system (in microseconds). + \ingroup tmu_uptime This function retrieves the number of microseconds since KOS was started. It should be more precise, in theory, than timer_ms_gettime64(), but the exact @@ -184,15 +298,76 @@ uint64 timer_ms_gettime64(void); \return The number of microseconds since KOS started. */ -uint64 timer_us_gettime64(void); +uint64_t timer_us_gettime64(void); + +/** \brief Get the current uptime of the system (in secs and nanosecs). + \ingroup tmu_uptime + + This function retrieves the number of seconds and nanoseconds since KOS was + started. + + \param secs A pointer to store the number of seconds since boot + into. + \param nsecs A pointer to store the number of nanoseconds past + a second since boot. + \note To get the total number of nanoseconds since boot, + calculate (*secs * 1000000000) + *nsecs, or use the + timer_ns_gettime64() function. +*/ +void timer_ns_gettime(uint32_t *secs, uint32_t *nsecs); + +/** \defgroup tmu_sleep Sleeping + \brief Low-level thread sleeping + \ingroup timers + + This API provides the low-level functionality used to implement thread + sleeping, used by the KOS, C, C++, and POSIX threading APIs. + + \warning + This API and its underlying functionality are using \ref TMU1, so any + direct manipulation of it will interfere with the API's proper functioning. +*/ + +/** \brief Spin-loop sleep function. + \ingroup tmu_sleep + + This function is meant as a very accurate delay function, even if threading + and interrupts are disabled. It uses \ref TMU1 to sleep. + + \param ms The number of milliseconds to sleep. +*/ +void timer_spin_sleep(int ms); + +/** \defgroup tmu_primary Primary Timer + \brief Primary timer used by the kernel. + \ingroup timers -/** \brief Primary timer callback type. */ + This API provides a callback notification mechanism that can be hooked into + the primary timer (TMU0). It is used by the KOS kernel for threading and + scheduling. + + \warning + This API and its underlying functionality are using \ref TMU0, so any + direct manipulation of it will interfere with the API's proper functioning. +*/ + +/** \brief Primary timer callback type. + \ingroup tmu_primary + + This is the type of function which may be passed to + timer_primary_set_callback() as the function that gets invoked + upon interrupt. +*/ typedef void (*timer_primary_callback_t)(irq_context_t *); ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-15 18:14:54
|
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 a7789e6439b2b1028b5daea78ed33ef93f848752 (commit) via fa318b8bf587f4dfbf4944a7808bc390a6838f2d (commit) via 2e346c244254f9601fe28ad925c1bec4e6982c82 (commit) via 2cfe5e5f94edf103820183be0cd11c5cd18fe9ac (commit) via f975b3a3d6bdf47088123edd03112353474ac338 (commit) via 795ea8bc79d4da2dcbe3e733ae780b4d8130230a (commit) from 1cf3ac01456a7c8625dcd630ab03e910cd6a3746 (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 a7789e6439b2b1028b5daea78ed33ef93f848752 Author: Paul Cercueil <pa...@cr...> Date: Fri Dec 15 19:14:13 2023 +0100 Faster IRQ context saving / restore (#406) * irq: Optimize save/restore of IRQ contexts Reorder the fields of the irq_context structure, so that they can be saved and restored sequentially and in the fastest way possible. Signed-off-by: Paul Cercueil <pa...@cr...> * irq: Make sure IRQ context is always aligned to 32 bytes - To make sure that the irq_context structure within a kthread_t is properly aligned, move it to the beginning of the structure, and change the memory allocation for kthreads to memalign(). - Add alignment specifier to kthread and irq_context structures. Signed-off-by: Paul Cercueil <pa...@cr...> * irq: Use 64-bit I/O to save/restore FPU registers Now that the irq_context_t is guaranteed to be aligned to 8 bytes, and our FPU register fields within the structure are themselves aligned to 8 bytes, we can load / restore all FPU registers using 64-bit I/O in much fewer instructions. Signed-off-by: Paul Cercueil <pa...@cr...> * irq: Speed up saving IRQ context by pre-allocating cache lines Use a tiny loop before the IRQ context is saved that will pre-allocate cache lines covering the IRQ context structure. This speeds up saving the IRQ context, as each subsequent memory store will execute without any additional latency. Signed-off-by: Paul Cercueil <pa...@cr...> * doc: Update CHANGELOG Add an entry for my change which improved performance of IRQ context save / restore. Signed-off-by: Paul Cercueil <pa...@cr...> --------- Signed-off-by: Paul Cercueil <pa...@cr...> commit fa318b8bf587f4dfbf4944a7808bc390a6838f2d Author: Andy Barajas <and...@gm...> Date: Fri Dec 15 10:13:23 2023 -0800 Handle double promotion (#407) * Replace M_PI which is a double value with F_PI. Remove unwanted double promotion * Remove unwanted double promotion inside KOS * Addressed discord input * More explicit float types * Fixed mistake removal of f * Avoid it being inlined into potentially another FPU context * Hande printf related double premotions * Clarify floating values in fmath_base commit 2e346c244254f9601fe28ad925c1bec4e6982c82 Author: OniEnzeru <152...@us...> Date: Fri Dec 15 11:11:00 2023 -0700 Fix face culling bug in CPP GL example and GL_INVALID_ENUM (#399) * Fix face culling bug in CPP GL example. fix GL_INAVLID_ENUM and double PVR_INIT commit 2cfe5e5f94edf103820183be0cd11c5cd18fe9ac Merge: f975b3a 795ea8b Author: Lawrence Sebald <ljs...@us...> Date: Fri Dec 15 13:08:11 2023 -0500 Merge pull request #409 from kilgariff/master Fix bubbles and serpent examples and remove HBlank settings from PVR init. commit f975b3a3d6bdf47088123edd03112353474ac338 Author: Andy Barajas <and...@gm...> Date: Fri Dec 15 10:07:12 2023 -0800 Fix rotocube example (#410) * Fix rotocube example * Removed unneeded -lm from Makefile commit 795ea8bc79d4da2dcbe3e733ae780b4d8130230a Author: Ross Kilgariff <ros...@gm...> Date: Thu Dec 7 21:59:44 2023 +0000 Remove all VPOS_IRQ and HPOS_IRQ settings from pvr_init as all video settings are done in video.c instead ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + examples/dreamcast/2ndmix/2ndmix.c | 4 +- examples/dreamcast/cpp/gltest/gltest.cpp | 15 +- examples/dreamcast/kgl/basic/gl/gltest.c | 2 +- .../dreamcast/kgl/benchmarks/quadmark/quadmark.c | 4 +- .../dreamcast/kgl/benchmarks/trimark/trimark.c | 4 +- .../kgl/benchmarks/tristripmark/tristripmark.c | 4 +- examples/dreamcast/kgl/demos/mipmap/gl-mipmap.c | 4 +- examples/dreamcast/kgl/demos/specular/input.c | 2 +- examples/dreamcast/kgl/demos/specular/specular.c | 34 +-- examples/dreamcast/kgl/demos/specular/vector.h | 4 +- examples/dreamcast/parallax/bubbles/Makefile | 2 +- examples/dreamcast/parallax/bubbles/bubbles.c | 30 ++- examples/dreamcast/parallax/rotocube/Makefile | 2 +- examples/dreamcast/parallax/rotocube/rotocube.c | 32 +-- examples/dreamcast/parallax/serpent_dma/Makefile | 2 +- .../dreamcast/parallax/serpent_dma/perfmeter.c | 6 +- examples/dreamcast/parallax/serpent_dma/serpent.c | 23 ++- examples/dreamcast/parallax/sinus/sinus.c | 6 +- examples/dreamcast/png/example.c | 40 ++-- examples/dreamcast/pvr/plasma/plasma.c | 4 +- examples/dreamcast/pvr/pvrmark/pvrmark.c | 4 +- .../dreamcast/pvr/pvrmark_strips/pvrmark_strips.c | 4 +- .../pvrmark_strips_direct/pvrmark_strips_direct.c | 4 +- .../dreamcast/pvr/texture_render/texture_render.c | 2 +- .../dreamcast/pvr/yuv_converter/YUV420/yuv420.c | 24 +-- .../dreamcast/pvr/yuv_converter/YUV422/yuv422.c | 24 +-- examples/dreamcast/sound/ghettoplay-vorbis/gp.h | 4 +- examples/dreamcast/tsunami/banner/banner.cpp | 4 +- examples/dreamcast/vmu/vmu_lcd/lcd.c | 3 +- include/kos/thread.h | 8 +- kernel/arch/dreamcast/hardware/pvr/pvr_fog.c | 6 +- .../dreamcast/hardware/pvr/pvr_init_shutdown.c | 2 - kernel/arch/dreamcast/hardware/sq.c | 2 +- kernel/arch/dreamcast/include/arch/irq.h | 8 +- kernel/arch/dreamcast/include/dc/fmath_base.h | 10 +- kernel/arch/dreamcast/kernel/entry.s | 229 ++++++++++----------- kernel/arch/dreamcast/kernel/thdswitch.s | 125 +++++------ kernel/thread/thread.c | 2 +- 39 files changed, 338 insertions(+), 352 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d3961eb..fbbaa7b 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -210,6 +210,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Added __weak, __used, likely() and unlikely() [FG] - DC Added Maple-specific KOS_INIT_FLAGS() which allow for GC-ing unused drivers [FG] - DC Added basic example for micropython KOS port [Aaron Glazer == AG] +- DC Improved performance of IRQ context save / restore [PC] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Megan Potter == MP] diff --git a/examples/dreamcast/2ndmix/2ndmix.c b/examples/dreamcast/2ndmix/2ndmix.c index d59e8de..d94aa4c 100644 --- a/examples/dreamcast/2ndmix/2ndmix.c +++ b/examples/dreamcast/2ndmix/2ndmix.c @@ -237,7 +237,7 @@ void draw_cube(int which) { then try setting *32 on ytrans to something higher =) */ xtrans = mcos(ra) * 220; ytrans = msin((ra * 3) % 256) * 32; - ztrans = msin(ra) * 256 + 256.0; + ztrans = msin(ra) * 256 + 256.0f; for(cp = 0; cp < (NUM_FACES * 4 * 3); cp += 3) { x = cube_points[cp + 0] * mult * cubesizes[which]; @@ -274,7 +274,7 @@ void draw_cube(int which) { vert.x = xt + 320.0f; vert.y = yt + 240.0f; - vert.z = 128.0 - (z / 64.0); + vert.z = 128.0f - (z / 64.0f); a = 0.8f; if(ztrans == 0) ztrans++; diff --git a/examples/dreamcast/cpp/gltest/gltest.cpp b/examples/dreamcast/cpp/gltest/gltest.cpp index a2a9b7d..01dd49d 100644 --- a/examples/dreamcast/cpp/gltest/gltest.cpp +++ b/examples/dreamcast/cpp/gltest/gltest.cpp @@ -281,7 +281,6 @@ int main(int argc, char **argv) { /* Initialize KOS */ dbglog_set_level(DBG_WARNING); - pvr_init_defaults(); printf("gltest beginning\n"); @@ -302,7 +301,7 @@ int main(int argc, char **argv) { /* Load a texture and make it look nice */ loadtxr("/rd/glass.pvr", &texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_FILTER_BILINEAR); - glTexEnvi(GL_TEXTURE_2D, GL_TEXTURE_ENV_MODE, GL_MODULATEALPHA); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATEALPHA); printf("texture is %08x\n", texture); @@ -378,9 +377,12 @@ int main(int argc, char **argv) { glTranslatef(0.0f, 0.0f, z); glRotatef(r, 0.0f, 1.0f, 0.5f); - cubes[0]->draw(); + /* Always draw 2 cubes as solids */ + glEnable(GL_CULL_FACE); + glDisable(GL_BLEND); + + cubes[0]->draw(); cubes[1]->draw(); - /* Potentially do two as translucent */ if(trans & 1) { glEnable(GL_BLEND); @@ -391,11 +393,6 @@ int main(int argc, char **argv) { cubes[2]->draw(); cubes[3]->draw(); - if(trans & 1) { - glEnable(GL_CULL_FACE); - glDisable(GL_BLEND); - } - /* Finish the frame */ glutSwapBuffers(); } diff --git a/examples/dreamcast/kgl/basic/gl/gltest.c b/examples/dreamcast/kgl/basic/gl/gltest.c index 3224226..4d4e181 100644 --- a/examples/dreamcast/kgl/basic/gl/gltest.c +++ b/examples/dreamcast/kgl/basic/gl/gltest.c @@ -236,7 +236,7 @@ int main(int argc, char **argv) { pvr_get_stats(&stats); printf("VBL Count: %ld, last_time: %d, frame rate: %f fps\n", - stats.vbl_count, stats.frame_last_time, stats.frame_rate); + stats.vbl_count, stats.frame_last_time, (double)stats.frame_rate); return 0; } diff --git a/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c b/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c index ea0a240..0a6e380 100644 --- a/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c +++ b/examples/dreamcast/kgl/benchmarks/quadmark/quadmark.c @@ -40,7 +40,7 @@ void stats(void) { pvr_get_stats(&stats); dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", - stats.vbl_count, stats.frame_rate); + stats.vbl_count, (double)stats.frame_rate); } @@ -113,7 +113,7 @@ void check_switch(void) { if(now >= (begin + 5)) { begin = time(NULL); - printf(" Average Frame Rate: ~%f fps (%d pps)\n", avgfps, (int)(polycnt * avgfps * 2)); + printf(" Average Frame Rate: ~%f fps (%d pps)\n", (double)avgfps, (int)(polycnt * avgfps * 2)); switch(phase) { case PHASE_HALVE: diff --git a/examples/dreamcast/kgl/benchmarks/trimark/trimark.c b/examples/dreamcast/kgl/benchmarks/trimark/trimark.c index 1973bd2..38866c4 100644 --- a/examples/dreamcast/kgl/benchmarks/trimark/trimark.c +++ b/examples/dreamcast/kgl/benchmarks/trimark/trimark.c @@ -40,7 +40,7 @@ void stats(void) { pvr_get_stats(&stats); dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", - stats.vbl_count, stats.frame_rate); + stats.vbl_count, (double)stats.frame_rate); } @@ -112,7 +112,7 @@ void check_switch(void) { if(now >= (begin + 5)) { begin = time(NULL); - printf(" Average Frame Rate: ~%f fps (%d pps)\n", avgfps, (int)(polycnt * avgfps * 2)); + printf(" Average Frame Rate: ~%f fps (%d pps)\n", (double)avgfps, (int)(polycnt * avgfps * 2)); switch(phase) { case PHASE_HALVE: diff --git a/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c b/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c index 9ee44da..8cb6735 100644 --- a/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c +++ b/examples/dreamcast/kgl/benchmarks/tristripmark/tristripmark.c @@ -40,7 +40,7 @@ void stats(void) { pvr_get_stats(&stats); dbglog(DBG_DEBUG, "3D Stats: %ld VBLs, frame rate ~%f fps\n", - stats.vbl_count, stats.frame_rate); + stats.vbl_count, (double)stats.frame_rate); } @@ -115,7 +115,7 @@ void check_switch(void) { if(now >= (begin + 5)) { begin = time(NULL); - printf(" Average Frame Rate: ~%f fps (%d pps)\n", avgfps, (int)(polycnt * avgfps * 2)); + printf(" Average Frame Rate: ~%f fps (%d pps)\n", (double)avgfps, (int)(polycnt * avgfps * 2)); switch(phase) { case PHASE_HALVE: diff --git a/examples/dreamcast/kgl/demos/mipmap/gl-mipmap.c b/examples/dreamcast/kgl/demos/mipmap/gl-mipmap.c index 53b75b1..ffcf93b 100644 --- a/examples/dreamcast/kgl/demos/mipmap/gl-mipmap.c +++ b/examples/dreamcast/kgl/demos/mipmap/gl-mipmap.c @@ -69,9 +69,9 @@ void RenderInit(void) { /* Render a Textured Quad of given texture ID, width, and height */ void RenderTexturedQuadCentered(GLuint texID, GLfloat width, GLfloat height) { - GLfloat x1 = (vid_mode->width - width) / 2.0; + GLfloat x1 = (vid_mode->width - width) / 2.0f; GLfloat x2 = x1 + width; - GLfloat y1 = (vid_mode->height - height) / 2.0; + GLfloat y1 = (vid_mode->height - height) / 2.0f; GLfloat y2 = y1 + height; glBindTexture(GL_TEXTURE_2D, texID); diff --git a/examples/dreamcast/kgl/demos/specular/input.c b/examples/dreamcast/kgl/demos/specular/input.c index 939a53a..f522e03 100644 --- a/examples/dreamcast/kgl/demos/specular/input.c +++ b/examples/dreamcast/kgl/demos/specular/input.c @@ -16,7 +16,7 @@ #define SHIFT_X 0.01f #define SHIFT_Z 0.01f #define SHIFT_Y 0.2f -#define ROT_XZ ROTATION/5.0 +#define ROT_XZ ROTATION/5.0f void InputCallback(vector3f campos, vector3f camdst) { diff --git a/examples/dreamcast/kgl/demos/specular/specular.c b/examples/dreamcast/kgl/demos/specular/specular.c index 5b65b0f..bbecc47 100644 --- a/examples/dreamcast/kgl/demos/specular/specular.c +++ b/examples/dreamcast/kgl/demos/specular/specular.c @@ -39,9 +39,9 @@ static GLfloat z = -5.0f; /* Depth Into The Screen */ static GLuint texture[2]; /* Storage For Two Textures */ -static vector3f up = { 0, 1, 0 }, - camFrom = { -74, 10, 0.0 }, - camTo = { -74, 10, 10.0 }; +static vector3f up = { 0.0f, 1.0f, 0.0f }, + camFrom = { -74.0f, 10.0f, 0.0f }, + camTo = { -74.0f, 10.0f, 10.0f }; typedef struct { float min, @@ -946,7 +946,7 @@ void GPU_Stats(void) { if(fps.frame % 60 == 0) { printf("PVR FPS MIN: %.2f | MAX: %.2f | LAST: %.2f | AVG: %.2f\n", - (double)fps.min, (double)fps.max, (double)fps.last, (double)fps.avg / fps.frame); + (double)fps.min, (double)fps.max, (double)fps.last, (double)(fps.avg / fps.frame)); } } else @@ -1021,9 +1021,9 @@ int main() { glEnable(GL_LIGHT0); /* Set Light and Material Parameters */ - float lp[4] = { 0.0, 10.0, 0.0, 0.0 }; - float lp2[4] = { 0.0, 10.0, 0.0, 0.0 }; - float lc[4] = { -50.0, 10.0, 0.0, 0.0 }; + float lp[4] = { 0.0f, 10.0f, 0.0f, 0.0f }; + float lp2[4] = { 0.0f, 10.0f, 0.0f, 0.0f }; + float lc[4] = { -50, 10.0f, 0.0f, 0.0f }; float lcolor[3] = { 0.8f, 0.0f, 0.0f }; float lcolor2[3] = { 0.0f, 0.0f, 0.8f }; float lcolors[3] = { 0.6f, 0.6f, 0.6f }; @@ -1034,30 +1034,30 @@ int main() { glLightfv(GL_LIGHT1, GL_DIFFUSE, lcolor2); glLightfv(GL_LIGHT1, GL_SPECULAR, lcolors); - float l3c[3] = { 0.5, 0.5, 0.0 }; - float l3p[4] = { 0, -10, 0, 0 }; - float l3d[3] = { 0, 1, 0 }; + float l3c[3] = { 0.5f, 0.5f, 0.0f }; + float l3p[4] = { 0.0f, -10.0f, 0.0f, 0.0f }; + float l3d[3] = { 0.0f, 1.0f, 0.0f }; glLightfv(GL_LIGHT2, GL_POSITION, l3p); glLightfv(GL_LIGHT2, GL_DIFFUSE, l3c); glLightfv(GL_LIGHT2, GL_SPOT_DIRECTION, l3d); - float l4c[3] = { 0.0, 0.5, 0.5 }; - float l4p[4] = { -50, -10, 0, 0 }; - float l4d[3] = { 0, 1, 0 }; + float l4c[3] = { 0.0f, 0.5f, 0.5f }; + float l4p[4] = { -50, -10.0f, 0.0f, 0.0f }; + float l4d[3] = { 0.0f, 1.0f, 0.0f }; glLightfv(GL_LIGHT3, GL_POSITION, l4p); glLightfv(GL_LIGHT3, GL_DIFFUSE, l4c); glLightfv(GL_LIGHT3, GL_SPOT_DIRECTION, l4d); - float l5c[3] = { 0.0, 0.8, 0.0 }; - float l5p[4] = { -50, -10, 50, 0 }; - float l5d[3] = { 0, 1, 0 }; + float l5c[3] = { 0.0f, 0.8f, 0.0f }; + float l5p[4] = { -50.0f, -10.0f, 50.0f, 0.0f}; + float l5d[3] = { 0.0f, 1.0f, 0.0f }; glLightfv(GL_LIGHT4, GL_POSITION, l5p); glLightfv(GL_LIGHT4, GL_DIFFUSE, l5c); glLightfv(GL_LIGHT4, GL_SPOT_DIRECTION, l5d); /* Set Material Parameters */ - float Mat_Specular[3] = { 0.6, 0.6, 0.6 }; + float Mat_Specular[3] = { 0.6f, 0.6f, 0.6f }; glLightfv(GL_LIGHT0, GL_SPECULAR, Mat_Specular); glMaterialfv(GL_FRONT, GL_SPECULAR, Mat_Specular); glMaterialf(GL_FRONT, GL_SHININESS, 10.0f); diff --git a/examples/dreamcast/kgl/demos/specular/vector.h b/examples/dreamcast/kgl/demos/specular/vector.h index f4d79af..f7ee18e 100644 --- a/examples/dreamcast/kgl/demos/specular/vector.h +++ b/examples/dreamcast/kgl/demos/specular/vector.h @@ -15,8 +15,8 @@ typedef float vector4f[4]; #define DEG2RAD (F_PI / 180.0f) #define RAD2DEG (180.0f / F_PI) -#define RADIAN 0.0174532925 // Convert Degrees to Radians -#define CIRCLE 6.2831853 // RADIAN * 360.0f +#define RADIAN 0.0174532925f // Convert Degrees to Radians +#define CIRCLE 6.2831853f // RADIAN * 360.0f void VectorShift(vector3f p, vector3f c, float mag); diff --git a/examples/dreamcast/parallax/bubbles/Makefile b/examples/dreamcast/parallax/bubbles/Makefile index fe8c888..8c71e29 100644 --- a/examples/dreamcast/parallax/bubbles/Makefile +++ b/examples/dreamcast/parallax/bubbles/Makefile @@ -17,7 +17,7 @@ rm-elf: -rm -f $(TARGET) $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -lparallax -lGL + kos-cc -o $(TARGET) $(OBJS) -lparallax run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/parallax/bubbles/bubbles.c b/examples/dreamcast/parallax/bubbles/bubbles.c index 0accb63..3575ddd 100644 --- a/examples/dreamcast/parallax/bubbles/bubbles.c +++ b/examples/dreamcast/parallax/bubbles/bubbles.c @@ -45,13 +45,13 @@ static void sphere(float radius, int slices, int stacks) { /* Iterate over stacks */ for(i = 0; i < stacks; i++) { - pitch = 2 * M_PI * ((float)i / (float)stacks); - pitch2 = 2 * M_PI * ((float)(i + 1) / (float)stacks); + pitch = 2 * F_PI * ((float)i / (float)stacks); + pitch2 = 2 * F_PI * ((float)(i + 1) / (float)stacks); /* Iterate over slices: each entire stack will be one long triangle strip. */ for(j = 0; j <= slices / 2; j++) { - yaw = 2 * M_PI * ((float)j / (float)slices); + yaw = 2 * F_PI * ((float)j / (float)slices); /* x, y+1 */ x = radius * fcos(yaw) * fcos(pitch2); @@ -107,7 +107,7 @@ static void sphere_frame_opaque(void) { plx_mat3d_push(); for(i = 0; i < SPHERE_CNT; i++) { - plx_mat3d_translate(6.0f * fcos(i * 2 * M_PI / SPHERE_CNT), 0.0f, 6.0f * fsin(i * 2 * M_PI / SPHERE_CNT)); + plx_mat3d_translate(6.0f * fcos(i * 2 * F_PI / SPHERE_CNT), 0.0f, 6.0f * fsin(i * 2 * F_PI / SPHERE_CNT)); plx_mat3d_rotate(r, 1.0f, 1.0f, 1.0f); sphere(1.2f, 20, 20); @@ -123,7 +123,7 @@ static void sphere_frame_opaque(void) { plx_mat3d_push(); for(i = 0; i < SPHERE_CNT; i++) { - plx_mat3d_translate(3.0f * fcos(i * 2 * M_PI / SPHERE_CNT), 0.0f, 3.0f * fsin(i * 2 * M_PI / SPHERE_CNT)); + plx_mat3d_translate(3.0f * fcos(i * 2 * F_PI / SPHERE_CNT), 0.0f, 3.0f * fsin(i * 2 * F_PI / SPHERE_CNT)); plx_mat3d_rotate(r, 1.0f, 1.0f, 1.0f); sphere(0.8f, 20, 20); @@ -137,7 +137,7 @@ static void sphere_frame_opaque(void) { pvr_scene_finish(); r++; - phase += 2 * M_PI / 240.0f; + phase += 2 * F_PI / 240.0f; } static void sphere_frame_trans(void) { @@ -156,7 +156,7 @@ static void sphere_frame_trans(void) { plx_mat3d_push(); for(i = 0; i < SPHERE_CNT; i++) { - plx_mat3d_translate(4.0f * fcos(i * 2 * M_PI / SPHERE_CNT), 0.0f, 4.0f * fsin(i * 2 * M_PI / SPHERE_CNT)); + plx_mat3d_translate(4.0f * fcos(i * 2 * F_PI / SPHERE_CNT), 0.0f, 4.0f * fsin(i * 2 * F_PI / SPHERE_CNT)); plx_mat3d_rotate(r, 1.0f, 1.0f, 1.0f); sphere(1.0f, 20, 20); @@ -170,7 +170,7 @@ static void sphere_frame_trans(void) { pvr_scene_finish(); r++; - phase += 2 * M_PI / 240.0f; + phase += 2 * F_PI / 240.0f; } void do_sphere_test(void) { @@ -235,7 +235,19 @@ pvr_init_params_t params = { { PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_16, PVR_BINSIZE_0, PVR_BINSIZE_0 }, /* Vertex buffer size 512K */ - 512 * 1024 + 512 * 1024, + + /* No DMA */ + 0, + + /* No FSAA */ + 0, + + /* Translucent Autosort enabled. */ + 0, + + /* Extra OPBs */ + 3 }; int main(int argc, char **argv) { diff --git a/examples/dreamcast/parallax/rotocube/Makefile b/examples/dreamcast/parallax/rotocube/Makefile index c8bd970..736e080 100644 --- a/examples/dreamcast/parallax/rotocube/Makefile +++ b/examples/dreamcast/parallax/rotocube/Makefile @@ -12,7 +12,7 @@ rm-elf: -rm -f $(TARGET) $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -lparallax -lm + kos-cc -o $(TARGET) $(OBJS) -lparallax run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/parallax/rotocube/rotocube.c b/examples/dreamcast/parallax/rotocube/rotocube.c index 319c7cc..35427f4 100644 --- a/examples/dreamcast/parallax/rotocube/rotocube.c +++ b/examples/dreamcast/parallax/rotocube/rotocube.c @@ -35,26 +35,11 @@ to a translucent poly to interfere with the cube. */ -// Draw a single point in 3D space. Uses the currently loaded matrix. -void drawpnt(float x, float y, float z, float a, float r, float g, float b) { - uint32 col = plx_pack_color(a, r, g, b); - - // Transform the point, clip the Z plane to avoid artifacts. - plx_mat_tfip_3d(x, y, z); - - if(z <= 0.00001f) z = 0.00001f; - - // Draw it. - plx_vert_inp(PLX_VERT, x, y + 1.0f, z, col); - plx_vert_inp(PLX_VERT, x, y, z, col); - plx_vert_inp(PLX_VERT, x + 1.0f, y + 1.0f, z, col); - plx_vert_inp(PLX_VERT_EOS, x + 1.0f, y, z, col); -} +static plx_dr_state_t dr; // Draws the full cube at the current position. void drawcube(void) { uint32 color = 0xff808080; - plx_dr_state_t dr; plx_dr_init(&dr); @@ -100,24 +85,21 @@ void drawwave(int theta) { uint32 color = 0xffa0a0a0; int i, divs = 320; float x, y, t; - plx_dr_state_t dr; - - plx_dr_init(&dr); // Convert to radians for sin/cos - t = theta * 2 * M_PI / 360.0f; + t = theta * 2 * F_PI / 360.0f; for(i = 0; i <= divs; i++) { x = i * 640.0f / divs; // These are more or less magic numbers I played with until // it looked neat. - y = 240.0f + fsin(t + i * M_PI / 64.0f) * 30.0f * fsin(t * 4); - y += fcos(t + i * M_PI / 36.0f) * 40.0f * fcos(t * 6); - y += fcos(t + i * M_PI / 30.0f) * 24.0f * fcos(t * 8); + y = 240.0f + fsin(t + i * F_PI / 64.0f) * 30.0f * fsin(t * 4); + y += fcos(t + i * F_PI / 36.0f) * 40.0f * fcos(t * 6); + y += fcos(t + i * F_PI / 30.0f) * 24.0f * fcos(t * 8); - plx_vert_ind(&dr, PLX_VERT, x, y, 0.0001f, color); - plx_vert_ind(&dr, i == divs ? PLX_VERT_EOS : PLX_VERT, x, 480.0f, 0.0001f, color); + plx_vert_inp(PLX_VERT, x, y, 0.0001f, color); + plx_vert_inp(i == divs ? PLX_VERT_EOS : PLX_VERT, x, 480.0f, 0.0001f, color); } } diff --git a/examples/dreamcast/parallax/serpent_dma/Makefile b/examples/dreamcast/parallax/serpent_dma/Makefile index c77576f..ac60e1c 100644 --- a/examples/dreamcast/parallax/serpent_dma/Makefile +++ b/examples/dreamcast/parallax/serpent_dma/Makefile @@ -17,7 +17,7 @@ rm-elf: -rm -f $(TARGET) $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) -lparallax -lkosutils -lpng -ljpeg -lkmg -lz -lm + kos-cc -o $(TARGET) $(OBJS) -lparallax -lkosutils -lm ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2023-12-14 03:48:22
|
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 1cf3ac01456a7c8625dcd630ab03e910cd6a3746 (commit) from 4ea251487dfe5dcbe2fa47cbd434fea4d209703d (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 1cf3ac01456a7c8625dcd630ab03e910cd6a3746 Author: Falco Girgis <gyr...@gm...> Date: Wed Dec 13 21:46:56 2023 -0600 Updated DoxygenLayout.xml for Doxygen v1.9.8 (#411) ----------------------------------------------------------------------- Summary of changes: doc/pages/DoxygenLayout.xml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/doc/pages/DoxygenLayout.xml b/doc/pages/DoxygenLayout.xml index 5421b63..464fe33 100644 --- a/doc/pages/DoxygenLayout.xml +++ b/doc/pages/DoxygenLayout.xml @@ -1,11 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> <doxygenlayout version="1.0"> - <!-- Generated by doxygen 1.9.7 --> + <!-- Generated by doxygen 1.9.8 --> <!-- Navigation index tabs for HTML output --> <navindex> <tab type="mainpage" visible="yes" title=""/> <tab type="user" url="https://github.com/KallistiOS/KallistiOS" title="Source Code"/> <tab type="pages" visible="yes" title="" intro=""/> - <tab type="modules" visible="yes" title="Topics" intro=""/> + <tab type="topics" visible="yes" title="" intro=""/> + <tab type="modules" visible="yes" title="" intro=""> + <tab type="modulelist" visible="yes" title="" intro=""/> + <tab type="modulemembers" visible="yes" title="" intro=""/> + </tab> <tab type="namespaces" visible="yes" title=""> <tab type="namespacelist" visible="yes" title="" intro=""/> <tab type="namespacemembers" visible="yes" title="" intro=""/> @@ -44,7 +49,7 @@ <briefdescription visible="yes"/> <includes visible="$SHOW_HEADERFILE"/> <inheritancegraph visible="$CLASS_GRAPH"/> - <collaborationgraph visible="$COLLABORATION_GRAPH"/> + <collaborationgraph visible="yes"/> <memberdecl> <nestedclasses visible="yes" title=""/> <publictypes title=""/> @@ -143,8 +148,8 @@ <file> <briefdescription visible="yes"/> <includes visible="$SHOW_INCLUDE_FILES"/> - <includegraph visible="$INCLUDE_GRAPH"/> - <includedbygraph visible="$INCLUDED_BY_GRAPH"/> + <includegraph visible="yes"/> + <includedbygraph visible="yes"/> <sourcelink visible="yes"/> <memberdecl> <interfaces visible="yes" title=""/> @@ -180,9 +185,10 @@ <!-- Layout definition for a group page --> <group> <briefdescription visible="yes"/> - <groupgraph visible="$GROUP_GRAPHS"/> + <groupgraph visible="yes"/> <memberdecl> <nestedgroups visible="yes" title=""/> + <modules visible="yes" title=""/> <dirs visible="yes" title=""/> <files visible="yes" title=""/> <namespaces visible="yes" title=""/> @@ -228,6 +234,25 @@ <authorsection visible="yes"/> </group> + <!-- Layout definition for a C++20 module page --> + <module> + <briefdescription visible="yes"/> + <exportedmodules visible="yes"/> + <memberdecl> + <concepts visible="yes" title=""/> + <classes visible="yes" title=""/> + <enums title=""/> + <typedefs title=""/> + <functions title=""/> + <variables title=""/> + <membergroups title=""/> + </memberdecl> + <detaileddescription title=""/> + <memberdecl> + <files visible="yes"/> + </memberdecl> + </module> + <!-- Layout definition for a directory page --> <directory> <briefdescription visible="yes"/> hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: ljsebald <ljs...@us...> - 2023-12-04 12:38:00
|
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 4ea251487dfe5dcbe2fa47cbd434fea4d209703d (commit) via 5b76dda7c21805b6e4b2f030ceb8f9c57133ef35 (commit) from 8d98948f2b6dfc9aedd8a1edd6fb209f300403ff (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 4ea251487dfe5dcbe2fa47cbd434fea4d209703d Merge: 8d98948 5b76dda Author: Lawrence Sebald <ljs...@us...> Date: Mon Dec 4 07:37:37 2023 -0500 Merge pull request #405 from KallistiOS/out_of_memory_update Updated out_of_memory KOS example commit 5b76dda7c21805b6e4b2f030ceb8f9c57133ef35 Author: Falco Girgis <gyr...@gm...> Date: Mon Dec 4 00:35:43 2023 -0600 Updated out_of_memory KOS example - Using standard return values - Printing success/error properly now at the end - Added copyright information + description ----------------------------------------------------------------------- Summary of changes: .../dreamcast/cpp/out_of_memory/out_of_memory.cc | 31 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/examples/dreamcast/cpp/out_of_memory/out_of_memory.cc b/examples/dreamcast/cpp/out_of_memory/out_of_memory.cc index 14974dd..f0e9593 100644 --- a/examples/dreamcast/cpp/out_of_memory/out_of_memory.cc +++ b/examples/dreamcast/cpp/out_of_memory/out_of_memory.cc @@ -1,3 +1,16 @@ +/* KallistiOS ##version## + + out_of_memory.cc + Copyright (C) 2023 Falco Girgis + +*/ + +/* + This is a simple example of how to gracefully handle running + out of memory in C++ with both a static handler and exceptions. + The same applies for C, except that malloc() will return NULL. +*/ + #include <vector> #include <iostream> #include <cstdint> @@ -7,7 +20,11 @@ KOS_INIT_FLAGS(INIT_MALLOCSTATS); -void new_handler_cb() { +static unsigned new_handler_counter = 0; + +static void new_handler_cb() { + ++new_handler_counter; + std::cout << "new_handler callback invoked!" << std::endl; malloc_stats(); @@ -60,7 +77,15 @@ int main(int argc, char **argv) { } } - std::cout << "All done. Thank you for the RAM!" << std::endl; + const bool success = failed_once && (new_handler_counter == 1); + + if(success) { + std::cout << "\n\nTEST SUCCESS! Thank you for the RAM!\n\n" << std::endl; + return EXIT_SUCCESS; + } + else { + std::cerr << "\n\nTEST FAILURE!\n\n"; + return EXIT_FAILURE; + } - return !failed_once; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |