From: falcovorbis <fal...@us...> - 2024-08-19 03:52:45
|
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 3c99eb588dd1ae664b0e42481b15ba8c57381cf3 (commit) via 253b193654d8b0d794c56f4520e97ec9d4364957 (commit) from 63c8b0c0b174af2762fa7f00cb34048bfaa5235b (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 3c99eb588dd1ae664b0e42481b15ba8c57381cf3 Author: Paul Cercueil <pa...@cr...> Date: Mon Aug 19 05:51:39 2024 +0200 vmu: Add function vmu_printf() (#699) This function can be used to print a string to every connect VMU, using the built-in VMU font. Signed-off-by: Paul Cercueil <pa...@cr...> commit 253b193654d8b0d794c56f4520e97ec9d4364957 Author: Andy Barajas <and...@gm...> Date: Sun Aug 18 20:47:59 2024 -0700 Fix kos doxygen warnings (#711) ----------------------------------------------------------------------- Summary of changes: include/netinet/in.h | 2 +- include/poll.h | 6 +- kernel/arch/dreamcast/include/arch/byteorder.h | 5 +- kernel/arch/dreamcast/include/dc/video.h | 2 +- kernel/arch/dreamcast/include/dc/vmu_fb.h | 11 ++ kernel/arch/dreamcast/util/Makefile | 2 +- kernel/arch/dreamcast/util/vmu_printf.c | 147 +++++++++++++++++++++++++ 7 files changed, 169 insertions(+), 6 deletions(-) create mode 100644 kernel/arch/dreamcast/util/vmu_printf.c diff --git a/include/netinet/in.h b/include/netinet/in.h index ad614083..5fb23321 100644 --- a/include/netinet/in.h +++ b/include/netinet/in.h @@ -208,7 +208,7 @@ extern const struct in6_addr in6addr_loopback; #define IPPROTO_UDP 17 /** \brief Internet Protocol Version 6. - \ingroup networking_ipv + \ingroup networking_ip */ #define IPPROTO_IPV6 41 diff --git a/include/poll.h b/include/poll.h index aa7acf3f..bdf6e83d 100644 --- a/include/poll.h +++ b/include/poll.h @@ -6,7 +6,7 @@ /** \file poll.h \brief Definitions for the poll() function. - \ingroup threading_posix + \ingroup threading_polling This file contains the definitions needed for using the poll() function, as directed by the POSIX 2008 standard (aka The Open Group Base Specifications @@ -27,7 +27,9 @@ __BEGIN_DECLS -/** \addtogroup threading_posix +/** \defgroup threading_polling Polling + \brief Implementation of POSIX polling. + \ingroup threading_posix @{ */ diff --git a/kernel/arch/dreamcast/include/arch/byteorder.h b/kernel/arch/dreamcast/include/arch/byteorder.h index aae54433..2585f247 100644 --- a/kernel/arch/dreamcast/include/arch/byteorder.h +++ b/kernel/arch/dreamcast/include/arch/byteorder.h @@ -32,7 +32,10 @@ __BEGIN_DECLS #undef BYTE_ORDER #endif -/** \addtogroup arch +/** \defgroup system_arch Byte Order + \brief Byte-order management for the SH4 architecture + \ingroup arch + @{ */ diff --git a/kernel/arch/dreamcast/include/dc/video.h b/kernel/arch/dreamcast/include/dc/video.h index de8dc1b0..04b59984 100644 --- a/kernel/arch/dreamcast/include/dc/video.h +++ b/kernel/arch/dreamcast/include/dc/video.h @@ -318,7 +318,7 @@ uint32_t vid_border_color(uint8_t r, uint8_t g, uint8_t b); void vid_clear(uint8_t r, uint8_t g, uint8_t b); /** \brief Clear VRAM. - \ingroup video_vram + \ingroup video_fb This function is essentially a memset() for the whole of VRAM that will clear it all to 0 bytes. diff --git a/kernel/arch/dreamcast/include/dc/vmu_fb.h b/kernel/arch/dreamcast/include/dc/vmu_fb.h index 8f440ca7..ae38a21d 100644 --- a/kernel/arch/dreamcast/include/dc/vmu_fb.h +++ b/kernel/arch/dreamcast/include/dc/vmu_fb.h @@ -136,4 +136,15 @@ vmufb_print_string(vmufb_t *fb, const vmufb_font_t *font, const char *str) { vmufb_print_string_into(fb, font, 0, 0, 48, 32, 0, str); } +/** \brief Render a string to attached VMUs using the built-in font + + Uses the built-in VMU font to render a string to all VMUs connected to the + system. + + \param fmt The format string, optionally followed by extra + arguments. + */ +__attribute__ ((format (printf, 1, 2))) +void vmu_printf(const char *fmt, ...); + #endif /* __DC_VMU_FB_H */ diff --git a/kernel/arch/dreamcast/util/Makefile b/kernel/arch/dreamcast/util/Makefile index 3bcc7111..37d94f7b 100644 --- a/kernel/arch/dreamcast/util/Makefile +++ b/kernel/arch/dreamcast/util/Makefile @@ -4,7 +4,7 @@ # Copyright (C) 2001 Megan Potter # -OBJS = vmu_fb.o vmu_pkg.o screenshot.o minifont.o +OBJS = vmu_fb.o vmu_pkg.o vmu_printf.o screenshot.o minifont.o SUBDIRS = ifneq ($(KOS_SUBARCH), naomi) diff --git a/kernel/arch/dreamcast/util/vmu_printf.c b/kernel/arch/dreamcast/util/vmu_printf.c new file mode 100644 index 00000000..6024415c --- /dev/null +++ b/kernel/arch/dreamcast/util/vmu_printf.c @@ -0,0 +1,147 @@ +/* KallistiOS ##version## + + util/vmu_fb.c + Copyright (C) 2024 Paul Cercueil +*/ + +#include <stdarg.h> +#include <stdio.h> + +#include <dc/vmu_fb.h> + +static vmufb_t vmufb; + +/* Linux 4x6 font: lib/fonts/font_mini_4x6.c + * + * Created by Kenneth Albanowski. + * No rights reserved, released to the public domain. + */ +static const char fontdata_4x6[] = { + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0x00, 0x00, 0x00, 0x44, 0x40, 0x40, 0xaa, 0x00, + 0x00, 0xaf, 0xfa, 0x00, 0x46, 0xec, 0x40, 0xa2, + 0x48, 0xa0, 0x69, 0x6a, 0xd0, 0x24, 0x00, 0x00, + 0x24, 0x44, 0x20, 0x42, 0x22, 0x40, 0x0e, 0xee, + 0x00, 0x04, 0xe4, 0x00, 0x00, 0x04, 0x80, 0x00, + 0xe0, 0x00, 0x00, 0x00, 0x40, 0x02, 0x48, 0x00, + 0x4a, 0xaa, 0x40, 0x4c, 0x44, 0xe0, 0xc2, 0x48, + 0xe0, 0xe2, 0x62, 0xe0, 0xaa, 0xe2, 0x20, 0xe8, + 0xe2, 0xe0, 0xe8, 0xea, 0xe0, 0xe2, 0x22, 0x20, + 0xea, 0xea, 0xe0, 0xea, 0xe2, 0x20, 0x00, 0x40, + 0x40, 0x00, 0x40, 0x48, 0x24, 0x84, 0x20, 0x0e, + 0x0e, 0x00, 0x84, 0x24, 0x80, 0xe2, 0x60, 0x40, + 0x4e, 0xe8, 0x40, 0x4a, 0xea, 0xa0, 0xca, 0xca, + 0xc0, 0x68, 0x88, 0x60, 0xca, 0xaa, 0xc0, 0xe8, + 0xe8, 0xe0, 0xe8, 0xe8, 0x80, 0x68, 0xea, 0x60, + 0xaa, 0xea, 0xa0, 0xe4, 0x44, 0xe0, 0x22, 0x2a, + 0x40, 0xaa, 0xca, 0xa0, 0x88, 0x88, 0xe0, 0xae, + 0xea, 0xa0, 0xae, 0xee, 0xa0, 0x4a, 0xaa, 0x40, + 0xca, 0xc8, 0x80, 0x4a, 0xae, 0x60, 0xca, 0xec, + 0xa0, 0x68, 0x42, 0xc0, 0xe4, 0x44, 0x40, 0xaa, + 0xaa, 0x60, 0xaa, 0xa4, 0x40, 0xaa, 0xee, 0xa0, + 0xaa, 0x4a, 0xa0, 0xaa, 0x44, 0x40, 0xe2, 0x48, + 0xe0, 0x64, 0x44, 0x60, 0x08, 0x42, 0x00, 0x62, + 0x22, 0x60, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x0f, + 0x84, 0x00, 0x00, 0x00, 0x6a, 0xe0, 0x88, 0xca, + 0xc0, 0x00, 0x68, 0x60, 0x22, 0x6a, 0x60, 0x0e, + 0xe8, 0x60, 0x24, 0xe4, 0x40, 0x06, 0xa6, 0xe0, + 0x88, 0xca, 0xa0, 0x40, 0x44, 0x40, 0x40, 0x44, + 0x80, 0x08, 0xac, 0xa0, 0x0c, 0x44, 0xe0, 0x00, + 0xee, 0xa0, 0x00, 0xca, 0xa0, 0x04, 0xaa, 0x40, + 0x00, 0xca, 0xc8, 0x00, 0x6a, 0x62, 0x0c, 0xa8, + 0x80, 0x06, 0xc2, 0xc0, 0x04, 0xe4, 0x40, 0x00, + 0xaa, 0x60, 0x00, 0xae, 0x40, 0x00, 0xae, 0xe0, + 0x00, 0xa4, 0xa0, 0x00, 0xae, 0x2c, 0x0e, 0x6c, + 0xe0, 0x24, 0xc4, 0x20, 0x44, 0x44, 0x40, 0x84, + 0x64, 0x80, 0x5a, 0x00, 0x00, 0x4a, 0xae, 0x00, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0x06, 0xc6, 0x00, 0x0c, 0x6c, 0x00, + 0x82, 0x82, 0x82, 0xa5, 0xa5, 0xa5, 0xdb, 0xdb, + 0xdb, 0x44, 0x44, 0x44, 0x44, 0xc4, 0x44, 0x44, + 0xcc, 0x44, 0x66, 0xe6, 0x66, 0x00, 0xe6, 0x66, + 0x00, 0xcc, 0x44, 0x66, 0xee, 0x66, 0x66, 0x66, + 0x66, 0x00, 0xee, 0x66, 0x66, 0xee, 0x00, 0x66, + 0xe0, 0x00, 0x44, 0xcc, 0x00, 0x00, 0xc4, 0x44, + 0x44, 0x70, 0x00, 0x44, 0xf0, 0x00, 0x00, 0xf4, + 0x44, 0x44, 0x74, 0x44, 0x00, 0xf0, 0x00, 0x44, + 0xf4, 0x44, 0x44, 0x77, 0x44, 0x66, 0x76, 0x66, + 0x66, 0x77, 0x00, 0x00, 0x77, 0x66, 0x66, 0xff, + 0x00, 0x00, 0xff, 0x66, 0x66, 0x77, 0x66, 0x00, + 0xff, 0x00, 0x66, 0xff, 0x66, 0x44, 0xff, 0x00, + 0x66, 0xf0, 0x00, 0x00, 0xff, 0x44, 0x00, 0xf6, + 0x66, 0x66, 0x70, 0x00, 0x44, 0x77, 0x00, 0x00, + 0x77, 0x44, 0x00, 0x76, 0x66, 0x66, 0xf6, 0x66, + 0x44, 0xff, 0x44, 0x44, 0xc0, 0x00, 0x00, 0x74, + 0x44, 0xff, 0xff, 0xff, 0x00, 0x0f, 0xff, 0xcc, + 0xcc, 0xcc, 0x33, 0x33, 0x33, 0xff, 0xf0, 0x00, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, + 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, + 0xe0, 0xee, 0xee, 0xe0, 0xee, 0xee, 0xe0, 0xee, + 0xee, 0xe0, 0x00, 0x66, 0x00, 0xee, 0xee, 0xe0, +}; + +static const vmufb_font_t vmufb_font4x6 = { + .w = 4, + .h = 6, + .stride = 3, + .fontdata = fontdata_4x6, +}; + +void vmu_printf(const char *fmt, ...) +{ + maple_device_t *dev; + unsigned int vmu; + char buf[256]; + va_list va; + + buf[sizeof(buf) - 1] = '\0'; + + va_start(va, fmt); + vsnprintf(buf, sizeof(buf), fmt, va); + va_end(va); + + vmufb_print_string(&vmufb, &vmufb_font4x6, buf); + + for (vmu = 0; ; vmu++) { + dev = maple_enum_type(vmu, MAPLE_FUNC_LCD); + if (!dev) + break; + + vmufb_present(&vmufb, dev); + } +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |