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
(20) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: falcovorbis <fal...@us...> - 2024-09-23 04:40:42
|
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 93519b5546411b0d6a723f74884753056212ff97 (commit) from fe20ac49efbf6424aa6375e6dbd9c294b5f35bb4 (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 93519b5546411b0d6a723f74884753056212ff97 Author: Paul Cercueil <pa...@cr...> Date: Mon Sep 23 06:40:24 2024 +0200 Scoped IRQ disable (#765) * irq: Add irq_disable_scoped() This macro will disable interrupts, similarly to irq_disable(), with the difference that the interrupt state will automatically be restored once the execution exits the functional block in which the macro was called. Signed-off-by: Paul Cercueil <pa...@cr...> * thread: Use irq_disable_scoped() Factorize code by using the new irq_disable_scoped() macro. Signed-off-by: Paul Cercueil <pa...@cr...> * net: Use irq_disable_scoped() Factorize code by using the new irq_disable_scoped() macro. Signed-off-by: Paul Cercueil <pa...@cr...> * exports: Use irq_disable_scoped() Factorize code by using the new irq_disable_scoped() macro. Signed-off-by: Paul Cercueil <pa...@cr...> --------- Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/arch/irq.h | 19 ++++ kernel/exports/library.c | 9 +- kernel/net/net_dhcp.c | 5 +- kernel/net/net_tcp.c | 5 +- kernel/net/net_thd.c | 10 +-- kernel/thread/cond.c | 24 ++--- kernel/thread/genwait.c | 27 ++---- kernel/thread/mutex.c | 111 +++++++++++------------ kernel/thread/rwsem.c | 145 ++++++++++++------------------- kernel/thread/sem.c | 19 ++-- kernel/thread/thread.c | 27 ++---- kernel/thread/worker.c | 15 +--- 12 files changed, 164 insertions(+), 252 deletions(-) diff --git a/kernel/arch/dreamcast/include/arch/irq.h b/kernel/arch/dreamcast/include/arch/irq.h index f9bcdbf8..8b47a5e9 100644 --- a/kernel/arch/dreamcast/include/arch/irq.h +++ b/kernel/arch/dreamcast/include/arch/irq.h @@ -434,6 +434,25 @@ int irq_init(void); */ void irq_shutdown(void); +/** \cond */ +static inline void __irq_scoped_cleanup(int *state) { + irq_restore(*state); +} + +#define ___irq_disable_scoped(l) \ + int __scoped_irq_##l __attribute__((cleanup(__irq_scoped_cleanup))) = irq_disable() + +#define __irq_disable_scoped(l) ___irq_disable_scoped(l) +/** \endcond */ + +/** \brief Disable interrupts with scope management. + + This macro will disable interrupts, similarly to irq_disable(), with the + difference that the interrupt state will automatically be restored once the + execution exits the functional block in which the macro was called. +*/ +#define irq_disable_scoped() __irq_disable_scoped(__LINE__) + __END_DECLS #endif /* __ARCH_IRQ_H */ diff --git a/kernel/exports/library.c b/kernel/exports/library.c index 22db0a3c..0b602296 100644 --- a/kernel/exports/library.c +++ b/kernel/exports/library.c @@ -107,11 +107,10 @@ klibrary_t *library_by_libid(libid_t libid) { /* Library shell creation and deletion */ klibrary_t * library_create(int flags) { - int oldirq = 0; klibrary_t * np; libid_t libid; - oldirq = irq_disable(); + irq_disable_scoped(); np = NULL; /* Get a new library id */ @@ -135,7 +134,6 @@ klibrary_t * library_create(int flags) { } } - irq_restore(oldirq); return np; } @@ -200,18 +198,15 @@ uint32 library_get_version(klibrary_t * lib) { /*****************************************************************************/ klibrary_t * library_lookup(const char * name) { - int old; klibrary_t * lib; - old = irq_disable(); + irq_disable_scoped(); LIST_FOREACH(lib, &library_list, list) { if(!strcasecmp(lib->lib_get_name(), name)) break; } - irq_restore(old); - if(!lib) errno = ENOENT; diff --git a/kernel/net/net_dhcp.c b/kernel/net/net_dhcp.c index 572df741..064a8964 100644 --- a/kernel/net/net_dhcp.c +++ b/kernel/net/net_dhcp.c @@ -392,7 +392,8 @@ static void net_dhcp_renew(void) { static void net_dhcp_bind(dhcp_pkt_t *pkt, int len) { uint32 tmp = ntohl(pkt->yiaddr); - uint32 old = irq_disable(); + + irq_disable_scoped(); /* Bind the IP address first */ net_default_dev->ip_addr[0] = (tmp >> 24) & 0xFF; @@ -476,8 +477,6 @@ static void net_dhcp_bind(dhcp_pkt_t *pkt, int len) { } state = DHCP_STATE_BOUND; - - irq_restore(old); } static void net_dhcp_thd(void *obj) { diff --git a/kernel/net/net_tcp.c b/kernel/net/net_tcp.c index f4902d61..866aed78 100644 --- a/kernel/net/net_tcp.c +++ b/kernel/net/net_tcp.c @@ -2971,14 +2971,13 @@ int net_tcp_init(void) { void net_tcp_shutdown(void) { struct tcp_sock *i, *tmp; - int old; /* Kill the thread and make sure we can grab the lock */ if(thd_cb_id >= 0) net_thd_del_callback(thd_cb_id); /* Disable IRQs so we can kill the sockets in peace... */ - old = irq_disable(); + irq_disable_scoped(); /* Clean up existing sockets */ i = LIST_FIRST(&tcp_socks); @@ -3006,6 +3005,4 @@ void net_tcp_shutdown(void) { /* Remove us from fs_socket and clean up the semaphore */ fs_socket_proto_remove(&proto); - - irq_restore(old); } diff --git a/kernel/net/net_thd.c b/kernel/net/net_thd.c index a270a651..8e5f571e 100644 --- a/kernel/net/net_thd.c +++ b/kernel/net/net_thd.c @@ -55,7 +55,6 @@ static void *net_thd_thd(void *data) { } int net_thd_add_callback(void (*cb)(void *), void *data, uint64 timeout) { - int old; struct thd_cb *newcb; /* Allocate space for the new callback and set it up. */ @@ -73,33 +72,30 @@ int net_thd_add_callback(void (*cb)(void *), void *data, uint64 timeout) { newcb->nextrun = timer_ms_gettime64() + timeout; /* Disable interrupts, insert, and re-enable interrupts */ - old = irq_disable(); + irq_disable_scoped(); + TAILQ_INSERT_TAIL(&cbs, newcb, thds); - irq_restore(old); return newcb->cbid; } int net_thd_del_callback(int cbid) { - int old; struct thd_cb *cb; /* Disable interrupts so we can search without fear of anything changing underneath us. */ - old = irq_disable(); + irq_disable_scoped(); /* See if we can find the callback requested. */ TAILQ_FOREACH(cb, &cbs, thds) { if(cb->cbid == cbid) { TAILQ_REMOVE(&cbs, cb, thds); free(cb); - irq_restore(old); return 0; } } /* We didn't find it, punt. */ - irq_restore(old); return -1; } diff --git a/kernel/thread/cond.c b/kernel/thread/cond.c index 979b317f..dc8ffa01 100644 --- a/kernel/thread/cond.c +++ b/kernel/thread/cond.c @@ -58,7 +58,7 @@ int cond_destroy(condvar_t *cv) { } int cond_wait_timed(condvar_t *cv, mutex_t *m, int timeout) { - int old, rv; + int rv; if(irq_inside_int()) { dbglog(DBG_WARNING, "cond_wait: called inside interrupt\n"); @@ -66,12 +66,11 @@ int cond_wait_timed(condvar_t *cv, mutex_t *m, int timeout) { return -1; } - old = irq_disable(); + irq_disable_scoped(); if(m->type < MUTEX_TYPE_NORMAL || m->type > MUTEX_TYPE_RECURSIVE || !mutex_is_locked(m)) { errno = EINVAL; - irq_restore(old); return -1; } @@ -88,9 +87,6 @@ int cond_wait_timed(condvar_t *cv, mutex_t *m, int timeout) { /* Re-lock our mutex */ mutex_lock(m); - /* Ok, ready to return */ - irq_restore(old); - return rv; } @@ -99,27 +95,19 @@ int cond_wait(condvar_t *cv, mutex_t *m) { } int cond_signal(condvar_t *cv) { - int old, rv = 0; - - old = irq_disable(); + irq_disable_scoped(); /* Wake one thread who's waiting, if any */ genwait_wake_one(cv); - irq_restore(old); - - return rv; + return 0; } int cond_broadcast(condvar_t *cv) { - int old, rv = 0; - - old = irq_disable(); + irq_disable_scoped(); /* Wake all threads who are waiting */ genwait_wake_all(cv); - irq_restore(old); - - return rv; + return 0; } diff --git a/kernel/thread/genwait.c b/kernel/thread/genwait.c index da50dbb2..b5c8fa4f 100644 --- a/kernel/thread/genwait.c +++ b/kernel/thread/genwait.c @@ -68,7 +68,6 @@ static kthread_t * tq_next(void) { } int genwait_wait(void * obj, const char * mesg, int timeout, void (*callback)(void *)) { - int old, rv; kthread_t * me; /* Twiddle interrupt state */ @@ -77,7 +76,7 @@ int genwait_wait(void * obj, const char * mesg, int timeout, void (*callback)(vo return -1; } - old = irq_disable(); + irq_disable_scoped(); /* Prepare us for sleep */ me = thd_current; @@ -99,11 +98,7 @@ int genwait_wait(void * obj, const char * mesg, int timeout, void (*callback)(vo TAILQ_INSERT_TAIL(&slpque[LOOKUP(obj)], me, thdq); /* Block us until we're signaled */ - rv = thd_block_now(&me->context); - - irq_restore(old); - - return rv; + return thd_block_now(&me->context); } /* Removes a thread from its wait queue; assumes ints are disabled. */ @@ -131,10 +126,10 @@ static void genwait_unqueue(kthread_t * thd) { int genwait_wake_cnt(void * obj, int cntmax, int err) { kthread_t * t, * nt; struct slpquehead * qp; - int cnt, old; + int cnt; /* Twiddle interrupt state */ - old = irq_disable(); + irq_disable_scoped(); /* Find the queue */ qp = &slpque[LOOKUP(obj)]; @@ -168,9 +163,6 @@ int genwait_wake_cnt(void * obj, int cntmax, int err) { } } - /* Re-fix IRQs */ - irq_restore(old); - return cnt; } @@ -193,10 +185,9 @@ void genwait_wake_all_err(void *obj, int err) { int genwait_wake_thd(void *obj, kthread_t *thd, int err) { kthread_t *t, *nt; struct slpquehead *qp; - int old, rv = 0; /* Twiddle interrupt state */ - old = irq_disable(); + irq_disable_scoped(); /* Find the queue */ qp = &slpque[LOOKUP(obj)]; @@ -221,15 +212,11 @@ int genwait_wake_thd(void *obj, kthread_t *thd, int err) { } /* We found it, so we're done... */ - rv = 1; - break; + return 1; } } - /* Re-fix IRQs */ - irq_restore(old); - - return rv; + return 0; } void genwait_check_timeouts(uint64 tm) { diff --git a/kernel/thread/mutex.c b/kernel/thread/mutex.c index c8f84735..38abc2ed 100644 --- a/kernel/thread/mutex.c +++ b/kernel/thread/mutex.c @@ -52,31 +52,28 @@ int mutex_init(mutex_t *m, int mtype) { } int mutex_destroy(mutex_t *m) { - int rv = 0, old; - - old = irq_disable(); + irq_disable_scoped(); if(m->type < MUTEX_TYPE_NORMAL || m->type > MUTEX_TYPE_RECURSIVE) { errno = EINVAL; - rv = -1; + return -1; } - else if(m->count) { + + if(m->count) { /* Send an error if its busy */ errno = EBUSY; - rv = -1; - } - else { - /* Set it to an invalid type of mutex */ - m->type = -1; + return -1; } + /* Set it to an invalid type of mutex */ + m->type = -1; + /* If the mutex was created with the deprecated mutex_create(), free it. */ if(m->dynamic) { free(m); } - irq_restore(old); - return rv; + return 0; } int mutex_lock(mutex_t *m) { @@ -92,7 +89,7 @@ int mutex_lock_irqsafe(mutex_t *m) { int mutex_lock_timed(mutex_t *m, int timeout) { uint64_t deadline = 0; - int old, rv = 0; + int rv = 0; if((rv = irq_inside_int())) { dbglog(DBG_WARNING, "%s: called inside an interrupt with code: " @@ -108,7 +105,7 @@ int mutex_lock_timed(mutex_t *m, int timeout) { return -1; } - old = irq_disable(); + irq_disable_scoped(); if(m->type < MUTEX_TYPE_NORMAL || m->type > MUTEX_TYPE_RECURSIVE) { errno = EINVAL; @@ -160,7 +157,6 @@ int mutex_lock_timed(mutex_t *m, int timeout) { } } - irq_restore(old); return rv; } @@ -169,10 +165,9 @@ int mutex_is_locked(mutex_t *m) { } int mutex_trylock(mutex_t *m) { - int old, rv = 0; kthread_t *thd = thd_current; - old = irq_disable(); + irq_disable_scoped(); /* If we're inside of an interrupt, pick a special value for the thread that would otherwise be impossible... */ @@ -181,49 +176,46 @@ int mutex_trylock(mutex_t *m) { if(m->type < MUTEX_TYPE_NORMAL || m->type > MUTEX_TYPE_RECURSIVE) { errno = EINVAL; - rv = -1; + return -1; } + /* Check if the lock is held by some other thread already */ - else if(m->count && m->holder != thd) { + if(m->count && m->holder != thd) { errno = EAGAIN; - rv = -1; + return -1; } - else { - m->holder = thd; - - switch(m->type) { - case MUTEX_TYPE_NORMAL: - case MUTEX_TYPE_OLDNORMAL: - case MUTEX_TYPE_ERRORCHECK: - if(m->count) { - errno = EDEADLK; - rv = -1; - } - else { - m->count = 1; - } - break; - case MUTEX_TYPE_RECURSIVE: - if(m->count == INT_MAX) { - errno = EAGAIN; - rv = -1; - } - else { - ++m->count; - } - break; - } + m->holder = thd; + + switch(m->type) { + case MUTEX_TYPE_NORMAL: + case MUTEX_TYPE_OLDNORMAL: + case MUTEX_TYPE_ERRORCHECK: + if(m->count) { + errno = EDEADLK; + return -1; + } + + m->count = 1; + break; + + case MUTEX_TYPE_RECURSIVE: + if(m->count == INT_MAX) { + errno = EAGAIN; + return -1; + } + + ++m->count; + break; } - irq_restore(old); - return rv; + return 0; } static int mutex_unlock_common(mutex_t *m, kthread_t *thd) { - int old, rv = 0, wakeup = 0; + int wakeup = 0; - old = irq_disable(); + irq_disable_scoped(); switch(m->type) { case MUTEX_TYPE_NORMAL: @@ -236,21 +228,21 @@ static int mutex_unlock_common(mutex_t *m, kthread_t *thd) { case MUTEX_TYPE_ERRORCHECK: if(m->holder != thd) { errno = EPERM; - rv = -1; - } ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-09-23 01:39:36
|
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 fe20ac49efbf6424aa6375e6dbd9c294b5f35bb4 (commit) from 497bfca329e78bc8d8259e62a3e88415b8cc8390 (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 fe20ac49efbf6424aa6375e6dbd9c294b5f35bb4 Author: Paul Cercueil <pa...@cr...> Date: Mon Sep 23 03:38:04 2024 +0200 utils/pvrtex: fix and improve Makefile (#749) We must not add KOS specific include paths when compiling a *host* utility. This can cause the compilation to fail (as it did on my system). A lot of the rules are unnecesary, the default rules can be used as long as the proper variable names are used. The "all" rule is moved as the first rule, so that running "make" will be equivalent to running "make all". Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: utils/pvrtex/Makefile | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/utils/pvrtex/Makefile b/utils/pvrtex/Makefile index 1acf1204..a581f382 100644 --- a/utils/pvrtex/Makefile +++ b/utils/pvrtex/Makefile @@ -7,16 +7,16 @@ OBJS = elbg.o mem.o log.o bprint.o avstring.o lfg.o crc.o md5.o stb_image_impl.o dither.o tddither.o vqcompress.o mycommon.o file_common.o \ file_pvr.o file_tex.o file_dctex.o pvr_texture_encoder.o main.o +CPPFLAGS = -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0 +CXXFLAGS = -flto=auto -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare + ifdef $(DEBUGBUILD) - OPTMODE= -Og -pg -g + CXXFLAGS += -Og -pg -g else - OPTMODE= -O3 -flto + CXXFLAGS += -O3 -flto endif -MYFLAGS=-flto=auto -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0 -I${KOS_INC_PATHS} -MYCPPFLAGS=$(MYFLAGS) -MYCFLAGS=$(MYFLAGS) -Wno-pointer-sign - +CFLAGS := $(CXXFLAGS) -Wno-pointer-sign define textSegment2Header mkdir -p info @@ -27,18 +27,12 @@ endef .PHONY: all clean +all: $(TARGET) README + $(TARGET): $(OBJS) - gcc $(OPTMODE) -o $(TARGET) \ - $(OBJS) $(PROGMAIN) -lm -lstdc++ + $(CXX) $(CXXFLAGS) -o $@ $^ main.o: main.c info/options.h info/examples.h - gcc $(CFLAGS) $(MYCFLAGS) $(OPTMODE) -c $< -o $@ - -%.o: %.c - gcc $(CFLAGS) $(MYCFLAGS) $(OPTMODE) -c $< -o $@ - -%.o: %.cpp - gcc $(CFLAGS) $(MYCPPFLAGS) $(CXXFLAGS) $(OPTMODE) -c $< -o $@ clean: rm -f $(TARGET) $(OBJS) README @@ -46,8 +40,6 @@ clean: README: readme_unformatted.txt fmt -s readme_unformatted.txt > README -all: $(TARGET) README - install: all install -m 755 $(TARGET) $(DC_TOOLS_BASE)/ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-09-23 01:02:39
|
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 497bfca329e78bc8d8259e62a3e88415b8cc8390 (commit) from 7adf0ae6ae75675f6d1c05ee23342696f73c9bab (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 497bfca329e78bc8d8259e62a3e88415b8cc8390 Author: Andy Barajas <and...@gm...> Date: Sun Sep 22 18:02:18 2024 -0700 Update wav2adpcm (#755) Replaced encoding/decoding GPL code with public domain code. Added interleave(-i) option thanks to SKMP. ----------------------------------------------------------------------- Summary of changes: utils/wav2adpcm/wav2adpcm.c | 714 +++++++++++++++++++++++++++++--------------- 1 file changed, 480 insertions(+), 234 deletions(-) diff --git a/utils/wav2adpcm/wav2adpcm.c b/utils/wav2adpcm/wav2adpcm.c index 13adf7e5..d91e99b1 100644 --- a/utils/wav2adpcm/wav2adpcm.c +++ b/utils/wav2adpcm/wav2adpcm.c @@ -1,188 +1,232 @@ /* aica adpcm <-> wave converter; - (c) 2002 BERO <be...@ge...> - under GPL or notify me + Copyright (C) 2002 BERO <be...@ge...> + Copyright (C) 2024 Andress Barajas + Copyright (C) 2024 Stefanos Kornilios Mitsis Poiitidis - aica adpcm seems same as YMZ280B adpcm - adpcm->pcm algorithm can found MAME/src/sound/ymz280b.c by Aaron Giles + AICA adpcm seems same as YMZ280B adpcm. The only difference + between YMZ280B and AICA adpcm is that the nibbles are swapped. - this code is for little endian machine + The encode and decode algorithms for AICA adpcm - 2019 by superctr. - Modified by Megan Potter to read/write ADPCM WAV files, and to - handle stereo (though the stereo is very likely KOS specific - since we make no effort to interleave it). Please see README.GPL - in the KOS docs dir for more info on the GPL license. + This code is for little endian machine. + + Originally modified by Megan Potter to read/write ADPCM WAV files, + and to handle stereo (non-interleaved). + + Modified by Andress Barajas to replace the GPL MAME encoding/decoding + code with public domain code written by superctr. This version also + handles interleaved stereo thanks to SKMP and can output headerless + audio data. + + Public domain code source: + https://github.com/superctr/adpcm/blob/master/ymz_codec.c */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> +#include <math.h> + +/* WAV Header */ +typedef struct wavhdr { + uint8_t hdr1[4]; + uint32_t totalsize; + + uint8_t hdr2[8]; + uint32_t hdrsize; + uint16_t format; + uint16_t channels; + uint32_t freq; + uint32_t byte_per_sec; + uint16_t block_align; + uint16_t bits_per_sample; +} wavhdr_t; -static int diff_lookup[16] = { - 1, 3, 5, 7, 9, 11, 13, 15, - -1, -3, -5, -7, -9, -11, -13, -15, -}; - -static int index_scale[16] = { - 0x0e6, 0x0e6, 0x0e6, 0x0e6, 0x133, 0x199, 0x200, 0x266, - 0x0e6, 0x0e6, 0x0e6, 0x0e6, 0x133, 0x199, 0x200, 0x266 /* same value for speedup */ -}; - -static inline int limit(int val, int min, int max) { - if(val < min) return min; - else if(val > max) return max; - else return val; +/* Header chunk */ +typedef struct wavhdr_chunk { + char hdr3[4]; + uint32_t datasize; +} wavhdr_chunk_t; + +/* Holds flags */ +static int interleaved = 0; +static int no_header = 0; + +/* Output Formats */ +#define WAVE_FMT_PCM 0x01 /* PCM */ +#define WAVE_FMT_YAMAHA_ADPCM_ITU_G723 0x14 /* ITU G.723 Yamaha ADPCM (KallistiOS) */ +#define WAVE_FMT_YAMAHA_ADPCM 0x20 /* Yamaha ADPCM (interleaved) */ + +#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) + +static inline int16_t ymz_step(uint8_t step, int16_t *history, int16_t *step_size) { + static const int step_table[8] = { + 230, 230, 230, 230, 307, 409, 512, 614 + }; + + int sign = step & 8; + int delta = step & 7; + int diff = ((1 + (delta << 1)) * *step_size) >> 3; + int newval = *history; + int nstep = (step_table[delta] * *step_size) >> 8; + + /* Only found in the official AICA encoder + but it's possible all chips (including ADPCM-B) does this. */ + diff = CLAMP(diff, 0, 32767); + if(sign > 0) + newval -= diff; + else + newval += diff; + + *step_size = CLAMP(nstep, 127, 24576); + *history = newval = CLAMP(newval, -32768, 32767); + return newval; } -void pcm2adpcm(unsigned char *dst, const short *src, size_t length) { - int signal, step; - signal = 0; - step = 0x7f; - - /* length /= 4; */ - length = (length + 3) / 4; - - do { - int data, val, diff; - - /* hign nibble */ - diff = *src++ - signal; - diff = (diff * 8) / step; - - val = abs(diff) / 2; - - if(val > 7) val = 7; - - if(diff < 0) val += 8; - - signal += (step * diff_lookup[val]) / 8; - signal = limit(signal, -32768, 32767); - - step = (step * index_scale[val]) >> 8; - step = limit(step, 0x7f, 0x6000); - - data = val; - - /* low nibble */ - diff = *src++ - signal; - diff = (diff * 8) / step; - - val = (abs(diff)) / 2; - - if(val > 7) val = 7; - - if(diff < 0) val += 8; - - signal += (step * diff_lookup[val]) / 8; - signal = limit(signal, -32768, 32767); - - step = (step * index_scale[val]) >> 8; - step = limit(step, 0x7f, 0x6000); - - data |= val << 4; - - *dst++ = data; - +void adpcm2pcm(int16_t *outbuffer, uint8_t *buffer, size_t bytes) { + long i; + int16_t step_size = 127; + int16_t history = 0; + uint8_t nibble = 4; + size_t num_samples = bytes * 2; /* Each ADPCM byte contains two 4-bit samples */ + + for(i = 0; i < num_samples; i++) { + int8_t step = (*(int8_t *)buffer) << nibble; + step >>= 4; + if(!nibble) + buffer++; + nibble ^= 4; + history = history * 254 / 256; // High pass + *outbuffer++ = ymz_step(step, &history, &step_size); } - while(--length); } -void adpcm2pcm(short *dst, const unsigned char *src, size_t length) { - int signal, step; - signal = 0; - step = 0x7f; - - do { - int data, val; - - data = *src++; +void pcm2adpcm(uint8_t *outbuffer, int16_t *buffer, size_t bytes) { + long i; + int16_t step_size = 127; + int16_t history = 0; + uint8_t buf_sample = 0, nibble = 0; + uint32_t adpcm_sample; + size_t num_samples = bytes / 2; /* Divide by 2 to get the number of 16-bit samples */ + + for(i = 0;i < num_samples;i++) { + /* We remove a few bits_per_sample of accuracy to reduce some noise. */ + int step = ((*buffer++) & -8) - history; + adpcm_sample = (abs(step) << 16) / (step_size << 14); + adpcm_sample = CLAMP(adpcm_sample, 0, 7); + if(step < 0) + adpcm_sample |= 8; + if(!nibble) + *outbuffer++ = buf_sample | (adpcm_sample<<4); + else + buf_sample = (adpcm_sample & 15); + nibble ^= 1; + ymz_step(adpcm_sample, &history, &step_size); + } +} - /* low nibble */ - val = data & 15; +void deinterleave(void *buffer, size_t bytes) { + uint16_t *buf; + uint16_t *left, *right; + int i; - signal += (step * diff_lookup[val]) / 8; - signal = limit(signal, -32768, 32767); + buf = (uint16_t *)buffer; + left = malloc(bytes); + if(!left) { + fprintf(stderr, "deinterleave: Memory allocation failed.\n"); + exit(EXIT_FAILURE); + } + right = left + bytes / 4; - step = (step * index_scale[val & 7]) >> 8; - step = limit(step, 0x7f, 0x6000); + for(i = 0; i < bytes / 4; i++) { + left[i] = buf[i * 2 + 0]; + right[i] = buf[i * 2 + 1]; + } - *dst++ = signal; + memcpy(buf, left, bytes / 2); + memcpy(buf + bytes / 4, right, bytes / 2); - /* high nibble */ - val = (data >> 4) & 15; + free(left); +} - signal += (step * diff_lookup[val]) / 8; - signal = limit(signal, -32768, 32767); +void deinterleave_adpcm(void *buffer, size_t bytes) { + uint8_t *buf; + uint8_t *left, *right; + int i; - step = (step * index_scale[val & 7]) >> 8; - step = limit(step, 0x7f, 0x6000); + buf = (uint8_t *)buffer; + left = malloc(bytes); + if(!left) { + fprintf(stderr, "deinterleave_adpcm: Memory allocation failed.\n"); + exit(EXIT_FAILURE); + } + right = left + bytes / 2; + + for(i = 0; i < bytes; i++) { + if(i % 2 == 0) { /* Set high nibble */ + left[i / 2] = (buf[i] & 0xF0); + right[i / 2] = (buf[i] & 0x0F) << 4; + } else { /* Set low nibble to complete the byte */ + left[i / 2] |= ((buf[i] >> 4) & 0x0F); + right[i / 2] |= (buf[i] & 0x0F); + } + } - *dst++ = signal; + memcpy(buf, left, bytes); - } - while(--length); + free(left); } -void deinterleave(void *buffer, size_t size) { - short * buf; - short * buf1, * buf2; +void interleave(void *buffer, size_t bytes) { + uint16_t *buf; + uint16_t *left, *right; int i; - buf = (short *)buffer; - buf1 = malloc(size / 2); - buf2 = malloc(size / 2); + buf = malloc(bytes); + if(!buf) { + fprintf(stderr, "interleave: Memory allocation failed.\n"); + exit(EXIT_FAILURE); + } + left = (uint16_t *)buffer; + right = left + bytes / 4; - for(i = 0; i < size / 4; i++) { - buf1[i] = buf[i * 2 + 0]; - buf2[i] = buf[i * 2 + 1]; + for(i = 0; i < bytes / 4; i++) { + buf[i * 2 + 0] = left[i]; + buf[i * 2 + 1] = right[i]; } - memcpy(buf, buf1, size / 2); - memcpy(buf + size / 4, buf2, size / 2); + memcpy(buffer, buf, bytes); - free(buf1); - free(buf2); + free(buf); } -void interleave(void *buffer, size_t size) { - short * buf; - short * buf1, * buf2; +void interleave_adpcm(void *buffer, size_t bytes) { + uint8_t *buf; + uint8_t *left, *right; int i; - buf = malloc(size); - buf1 = (short *)buffer; - buf2 = buf1 + size / 4; + buf = malloc(bytes); + if(!buf) { + fprintf(stderr, "interleave_adpcm: Memory allocation failed.\n"); + exit(EXIT_FAILURE); + } + left = (uint8_t *)buffer; + right = left + bytes / 2; - for(i = 0; i < size / 4; i++) { - buf[i * 2 + 0] = buf1[i]; - buf[i * 2 + 1] = buf2[i]; + for(i = 0; i < bytes; i++) { + buf[i] = (right[i/2] >> (i%2*4)) & 0xF; + buf[i] |= ((left[i/2] >> (i%2*4)) & 0XF) << 4; } - memcpy(buffer, buf, size); + memcpy(buffer, buf, bytes); free(buf); } -typedef struct wavhdr_t { - char hdr1[4]; - int32_t totalsize; - - char hdr2[8]; - int32_t hdrsize; - short format; - short channels; - int32_t freq; - int32_t byte_per_sec; - short blocksize; - short bits; - - char hdr3[4]; - int32_t datasize; -} wavhdr_t; - -int validate_wav_header(wavhdr_t *wavhdr, int format, int bits, FILE *in) { +int validate_wav_header(wavhdr_t *wavhdr, wavhdr_chunk_t *wavhdr3, int format_mask, int bits_per_sample, FILE *in) { int result = 0; if(memcmp(wavhdr->hdr1, "RIFF", 4)) { @@ -195,68 +239,112 @@ int validate_wav_header(wavhdr_t *wavhdr, int format, int bits, FILE *in) { result = -1; } - if(wavhdr->hdrsize != 0x10) { - fprintf(stderr, "Invalid header size.\n"); + if(wavhdr->hdrsize < 0x10) { + fprintf(stderr, "Invalid header size, %d bytes\n", wavhdr->hdrsize); result = -1; + } else if(wavhdr->hdrsize > 0x10) { + /*fprintf(stderr, "Unique header size, %d bytes\n", wavhdr->hdrsize); */ + fseek(in, wavhdr->hdrsize - 0x10, SEEK_CUR); } - if(wavhdr->format != format) { - fprintf(stderr, "Unsupported format.\n"); + if(!(wavhdr->format & format_mask)) { + fprintf(stderr, "Unsupported format: %#x\n", wavhdr->format); result = -1; } if(wavhdr->channels != 1 && wavhdr->channels != 2) { - fprintf(stderr, "Unsupported number of channels.\n"); + fprintf(stderr, "Unsupported number of channels: %d\n", wavhdr->channels); result = -1; } - if(wavhdr->bits != bits) { - fprintf(stderr, "Unsupported bit depth.\n"); + if(wavhdr->bits_per_sample != bits_per_sample) { + fprintf(stderr, "Unsupported bit depth: %d\n", wavhdr->bits_per_sample); result = -1; } - if(memcmp(wavhdr->hdr3, "data", 4)) - { - /* File contains meta data that we want to skip. - Keep reading until we find the "data" header. */ - fseek(in, wavhdr->datasize, SEEK_CUR); + for(;;) { + /* Read the next chunk header */ + if(fread(wavhdr3->hdr3, 1, 4, in) != 4) { + fprintf(stderr, "Failed to read next chunk header!\n"); + result = -1; + break; + } - do - { - /* Read the next chunk header */ - if(fread(wavhdr->hdr3, 1, 4, in) != 4) { - fprintf(stderr, "Failed to read next chunk header!\n"); - result = -1; - break; - } + /* Read the chunk size */ + if(fread(&wavhdr3->datasize, 1, 4, in) != 4) { + fprintf(stderr, "Failed to read chunk size!\n"); + result = -1; + break; + } - /* Read the chunk size */ - if(fread(&wavhdr->datasize, 1, 4, in) != 4) { - fprintf(stderr, "Failed to read chunk size!\n"); - result = -1; - break; - } + /* Skip the chunk if it's not the "data" chunk. */ + if(memcmp(wavhdr3->hdr3, "data", 4)) + fseek(in, wavhdr3->datasize, SEEK_CUR); + else + break; + } + + return result; +} + +/* Do a straight copy of the input to output file */ +int straight_copy(FILE *in, const char *outfile) { + FILE *out = NULL; + size_t filesize; + char *buffer = NULL; + int result = 0; + + fseek(in, 0, SEEK_END); + filesize = ftell(in); + rewind(in); - /* Skip the chunk if it's not the "data" chunk. */ - if(memcmp(wavhdr->hdr3, "data", 4)) - fseek(in, wavhdr->datasize, SEEK_CUR); - } while(memcmp(wavhdr->hdr3, "data", 4)); + buffer = malloc(filesize); + if(!buffer) { + fprintf(stderr, "Memory allocation failed.\n"); + result = -1; + goto cleanup; + } + + if(fread(buffer, filesize, 1, in) != 1) { + fprintf(stderr, "Cannot read file.\n"); + free(buffer); + result = -1; + goto cleanup; } + out = fopen(outfile, "wb"); + if(!out) { + fprintf(stderr, "Cannot open %s for writing.\n", outfile); + result = -1; + goto cleanup; + } + + if(fwrite(buffer, filesize, 1, out) != 1) { + fprintf(stderr, "Cannot write to output file.\n"); + result = -1; + goto cleanup; + } + +cleanup: + if(in) fclose(in); + if(out) fclose(out); + if(buffer) free(buffer); + return result; } int wav2adpcm(const char *infile, const char *outfile) { wavhdr_t wavhdr; - FILE *in, *out; + wavhdr_chunk_t wavhdr_chunk; + FILE *in, *out = NULL; ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-09-22 23:50:21
|
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 tag, v2.0.0 has been updated to 137c2ca7ad704991c1cab991408cace63bf315f2 (commit) from 83165fa0d61a3318b0e1aafc58a6f55848e72e6e - Log ----------------------------------------------------------------- commit 137c2ca7ad704991c1cab991408cace63bf315f2 Author: Lawrence Sebald <ljs...@us...> Date: Mon May 20 19:30:45 2013 -0400 New banner code. This one also includes license and authors for easy access to display them in your programs. ----------------------------------------------------------------------- hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-09-22 21:41:35
|
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 7adf0ae6ae75675f6d1c05ee23342696f73c9bab (commit) via cd4e5db08b1987eea21e973df442ef44c797f975 (commit) via 8f3977b6eecdad5004e27444203cc870247f6bfb (commit) via 0233a297fbf9b49bb2114c3015f5671e4181c9ec (commit) via 80cb6f09e553f70efd184b40ad46fabde4bccd07 (commit) via 41c37da08d71af6ee29f3b5195897971ee718485 (commit) via ee50f748af060646ff9d9fddaf02690f596475b6 (commit) via 362768fbc1c7a8b7d0646608562fcda5b8ac5ec5 (commit) from fd9f323eeddea8970ec595ca49cb40e68b208520 (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 7adf0ae6ae75675f6d1c05ee23342696f73c9bab Author: Andy Barajas <and...@gm...> Date: Sun Sep 22 14:39:25 2024 -0700 Separated screen shot logic. (#766) Add functionality to retrieve a 24BPP screenshot data dump rather than forcing write to a PPM file. commit cd4e5db08b1987eea21e973df442ef44c797f975 Author: dfchil <dan...@gm...> Date: Sun Sep 22 21:47:29 2024 +0200 Added small approval test on binary output from pvrtex (#732) commit 8f3977b6eecdad5004e27444203cc870247f6bfb Author: Andy Barajas <and...@gm...> Date: Sun Sep 22 12:44:20 2024 -0700 Add . & .. to filesystems (#634) commit 0233a297fbf9b49bb2114c3015f5671e4181c9ec Author: Falco Girgis <gyr...@gm...> Date: Sat Sep 21 16:59:08 2024 -0500 Updated the version number for KOS 2.1.0. (#750) commit 80cb6f09e553f70efd184b40ad46fabde4bccd07 Author: Donald Haase <qu...@ya...> Date: Sat Sep 21 17:58:09 2024 -0400 Docs update (#747) * Huge update of docs primarily authored by darcagn. Mostly formatting, but a lot of minor fixups. * Significant content updates for license info to better coincide with current KOS (a lot no longer applied or made sense). * Updates to relnotes for v2.1.0 --------- Co-authored-by: darcagn <da...@pr...> commit 41c37da08d71af6ee29f3b5195897971ee718485 Author: Andy Barajas <and...@gm...> Date: Sat Sep 21 12:59:26 2024 -0700 Update position when playing (#764) This checks if a channel is playing before updating the channel position. commit ee50f748af060646ff9d9fddaf02690f596475b6 Author: Andy Barajas <and...@gm...> Date: Tue Sep 17 18:06:32 2024 -0700 Updated aica memcpy to copy four bytes at a time instead of one. (#748) * Updated aica memcpy to copy four bytes at a time instead of one. * Updated to do a check before assuming 4-byte alignment. I assumed if alignment was an issue like it was on the SH4 that the AICA would crash and I wouldnt because to run the sound examples. Turns out the AICA handles unaligned memory access by performing a rotate commit 362768fbc1c7a8b7d0646608562fcda5b8ac5ec5 Author: Falco Girgis <gyr...@gm...> Date: Tue Sep 17 19:59:17 2024 -0500 Modified PVR cxt compilation to be write-only. (#751) Modified the following PVR API routines to be WRITE-ONLY to their destination vertex header pointers: - pvr_poly_compile() - pvr_sprite_compile() - pvr_mod_compile() This will allow us to compile headers "in-place" within the SQ-mapped pointers returned by pvr_dr_target(), for better gainz using the direct rendering API... This is required since according to some docs, the SQs are write-only while others claim only 32-bit reads are valid... Either way, this was necessary to be safe. ----------------------------------------------------------------------- Summary of changes: README.md | 60 +- addons/readme.md | 16 + doc/CHANGELOG | 1128 -------------------- doc/CHANGELOG.md | 950 +++++++++++++++++ doc/{FAQ => FAQ.md} | 247 ++--- doc/LICENSE | 83 -- doc/LICENSE.md | 52 + doc/{README => README.md} | 241 ++--- doc/{RELNOTES => RELNOTES.md} | 48 + doc/{goals.txt => goals.md} | 7 +- doc/{README.BSD => license/LICENSE.BSD} | 2 +- doc/{README.GPL => license/LICENSE.GPL} | 16 +- doc/{README.KOS => license/LICENSE.KOS} | 0 doc/{README.LGPL => license/LICENSE.LGPL} | 11 +- doc/{dreamcast => }/modem.txt | 56 - doc/{coding_style.txt => style.md} | 0 examples/dreamcast/filesystem/browse/Makefile | 29 + examples/dreamcast/filesystem/browse/browse.c | 371 +++++++ examples/dreamcast/filesystem/browse/browse.h | 28 + .../dreamcast/filesystem/browse/romdisk/file.txt | 1 + .../filesystem/browse/romdisk/test/file2.txt | 1 + examples/dreamcast/{ => filesystem}/sd/Makefile | 0 .../dreamcast/{ => filesystem}/sd/ext2fs/Makefile | 0 .../{ => filesystem}/sd/ext2fs/sd-ext2fs.c | 0 .../dreamcast/{ => filesystem}/sd/mke2fs/Makefile | 0 .../{ => filesystem}/sd/mke2fs/Makefile.nonkos | 0 .../dreamcast/{ => filesystem}/sd/mke2fs/mke2fs.c | 0 .../{ => filesystem}/sd/speedtest/Makefile | 0 .../{ => filesystem}/sd/speedtest/sd-speedtest.c | 0 examples/dreamcast/readme.md | 123 +++ include/kos/nmmgr.h | 2 +- include/kos/version.h | 2 +- kernel/arch/dreamcast/exports-naomi.txt | 1 + kernel/arch/dreamcast/exports-pristine.txt | 1 + kernel/arch/dreamcast/hardware/pvr/pvr_prim.c | 288 ++--- kernel/arch/dreamcast/include/dc/video.h | 15 +- kernel/arch/dreamcast/sound/arm/main.c | 37 +- .../arch/dreamcast/sound/arm/stream.drv.prebuilt | Bin 3228 -> 3312 bytes kernel/arch/dreamcast/util/screenshot.c | 158 +-- kernel/fs/fs.c | 68 +- utils/pvrtex/approvaltest/.gitignore | 1 + utils/pvrtex/approvaltest/Makefile | 62 ++ utils/pvrtex/approvaltest/crate.png | Bin 0 -> 13777 bytes .../texture.dt | Bin 0 -> 32800 bytes .../texture.dt | Bin 0 -> 6016 bytes .../texture.dt | Bin 0 -> 43744 bytes .../preview.png | Bin 0 -> 20986 bytes .../texture.dt | Bin 0 -> 8224 bytes .../texture.dt.pal | Bin 0 -> 72 bytes .../texture.dt | Bin 0 -> 16416 bytes .../texture.dt.pal | Bin 0 -> 264 bytes .../texture.dt | Bin 0 -> 32800 bytes .../texture.tex | Bin 0 -> 32784 bytes .../texture.vq | Bin 0 -> 32784 bytes utils/readme.md | 28 + 55 files changed, 2270 insertions(+), 1863 deletions(-) create mode 100644 addons/readme.md delete mode 100644 doc/CHANGELOG create mode 100644 doc/CHANGELOG.md rename doc/{FAQ => FAQ.md} (68%) delete mode 100644 doc/LICENSE create mode 100644 doc/LICENSE.md rename doc/{README => README.md} (54%) rename doc/{RELNOTES => RELNOTES.md} (91%) rename doc/{goals.txt => goals.md} (97%) rename doc/{README.BSD => license/LICENSE.BSD} (98%) rename doc/{README.GPL => license/LICENSE.GPL} (95%) rename doc/{README.KOS => license/LICENSE.KOS} (100%) rename doc/{README.LGPL => license/LICENSE.LGPL} (97%) rename doc/{dreamcast => }/modem.txt (62%) rename doc/{coding_style.txt => style.md} (100%) create mode 100644 examples/dreamcast/filesystem/browse/Makefile create mode 100644 examples/dreamcast/filesystem/browse/browse.c create mode 100644 examples/dreamcast/filesystem/browse/browse.h create mode 100644 examples/dreamcast/filesystem/browse/romdisk/file.txt create mode 100644 examples/dreamcast/filesystem/browse/romdisk/test/file2.txt rename examples/dreamcast/{ => filesystem}/sd/Makefile (100%) rename examples/dreamcast/{ => filesystem}/sd/ext2fs/Makefile (100%) rename examples/dreamcast/{ => filesystem}/sd/ext2fs/sd-ext2fs.c (100%) rename examples/dreamcast/{ => filesystem}/sd/mke2fs/Makefile (100%) rename examples/dreamcast/{ => filesystem}/sd/mke2fs/Makefile.nonkos (100%) rename examples/dreamcast/{ => filesystem}/sd/mke2fs/mke2fs.c (100%) rename examples/dreamcast/{ => filesystem}/sd/speedtest/Makefile (100%) rename examples/dreamcast/{ => filesystem}/sd/speedtest/sd-speedtest.c (100%) create mode 100644 examples/dreamcast/readme.md create mode 100644 utils/pvrtex/approvaltest/.gitignore create mode 100644 utils/pvrtex/approvaltest/Makefile create mode 100644 utils/pvrtex/approvaltest/crate.png create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt/texture.dt create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_argb4444_-d_-c_64_-m_quality_-r_-R/texture.dt create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_normal_-m/texture.dt create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_pal4bpp_-d_-p_tests_run_preview_png/preview.png create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_pal4bpp_-d_-p_tests_run_preview_png/texture.dt create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_pal4bpp_-d_-p_tests_run_preview_png/texture.dt.pal create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_pal8bpp_-C_64_-d/texture.dt create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-f_pal8bpp_-C_64_-d/texture.dt.pal create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_dt_-s/texture.dt create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_tex/texture.tex create mode 100644 utils/pvrtex/approvaltest/tests/approved/-i_crate_png_-o_tests_run_texture_vq/texture.vq create mode 100644 utils/readme.md diff --git a/README.md b/README.md index 021455fd..c0f154f5 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ - <!-- PROJECT LOGO --> -<br /> <div align="center"> <h1 align="center"><strong>KallistiOS</strong></h1> - <p align="center"> Independent SDK for the Sega Dreamcast <br /> @@ -13,61 +10,50 @@ # Overview -KOS is an unofficial development kit for the SEGA Dreamcast game console with some support for the NAOMI and NAOMI 2 arcade boards. +KallistiOS is a development library and operating system for the Sega Dreamcast game console, developed independently from Sega entirely by free software developers. Its flexible permissive license allows both homebrew and commercial use with little restrictions besides proper attribution. As a result, it powers most homebrew and commercial indie releases for the platform. Interfaces and drivers are included for a significant portion of the Dreamcast's hardware capabilities and accessories, including modifications created by hobbyists. -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. +KallistiOS offers a modern, programmer friendly environment for the vintage Dreamcast system. The distribution includes [scripts for building and installing a cross-compiling toolchain](utils/dc-chain/README.md) using the latest GCC, Binutils, and Newlib. This allows for full support for C17 and C++20 standards and libraries, as well as various POSIX APIs. Preliminary support exists for C23, C++23, and Objective-C. -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. +KallistiOS also features a package manager called [**_kos-ports_**](https://github.com/KallistiOS/kos-ports) which gives developers the power to build and include a rich set of add-on libraries for various common audiovisual formats (jpg, png, mp3, ogg, mpeg), compression formats (libbz2, zlib), scripting languages (Lua, Tcl, MicroPython), gaming APIs (OpenGL, OpenAL, SDL), and many more. -# Features -## Core Functionality +### Core Functionality * Concurrency with Kernel Threads, C11 Threads, C++11 `std::thread`, POSIX threads * Virtual Filesystem Abstraction * IPv4/IPv6 Network Stack * Dynamically Loaded Libraries and Modules * GDB Debugger Support -## Dreamcast Hardware Support -* GD-ROM Optical Drive +### Dreamcast Hardware Support +* Optical Disc Drive * Low-level 3D PowerVR Graphics * SH4 ASM-Optimized Math Routines * SH4 SCIF Serial I/O * DMA Controller -* Flashrom Filesystem +* FlashROM Filesystem * AICA SPU Sound Processor Driver * Cache and Store Queue Management * Timer Peripherals, Real-Time Clock, Watchdog Timer * Performance Counters * MMU Management -* BIOS Font Rendering -## Peripherals and Accessory Support -* Controller, ASCII Pad -* Arcade Stick, Twin Stick, Mission Stick -* Keyboard -* Mouse -* Visual Memory Unit -* Puru Puru Vibration Pack -* Seaman Microphone -* Dreameye Webcam -* Lightgun -* Racing Wheel -* Fishing Rod -* Samba De Amigo Maracas -* Dance Mat -* Dial-up Modem -* Broadband Adapter -* LAN Adapter -* VGA Adapter -* SD Card Reader +### Peripherals and Accessory Support +* Standard controllers, expanded controllers with additional buttons and dual analog sticks +* Arcade Sticks and Twin Sticks +* Lightguns, Racing Wheels, Fishing Rods, Samba Maracas, Dance Mat +* Visual Memory Unit, Memory Cards, Puru Puru/Jump Vibration Pack, Microphone, Dreameye Webcam +* 33.6K and 56K Dial-up Modems, 100/10Mbps "Broadband Adapter", 10Mbps "LAN Adapter" +* RCA, S-video, RGB, and VGA output +* Serial-based SD card readers -## Hardware Modification Support -* IDE Hard Drive -* 32MB RAM Upgrade -* Custom BIOS Flashroms +### Hardware Modification Support +* IDE hard drive, 32MB RAM upgrade, custom BIOS flashROMs # Getting Started -A beginner's guide to development for the Sega Dreamcast along with detailed instructions for installing KOS and the required toolchains can be found on the [Dreamcast Wiki](https://dreamcast.wiki/Getting_Started_with_Dreamcast_development). Additional documentation can be found in the docs folder. +A beginner's guide to development for the Sega Dreamcast along with detailed instructions for installing KOS and the required toolchains can be found on [dreamcast.wiki](https://dreamcast.wiki/Getting_Started_with_Dreamcast_development). Additional documentation can be found in the docs folder. + +# Licensing +KallistiOS itself is licensed under the BSD-like **KOS License**. **Attribution is not optional**. Additionally, this distribution contains code licensed under various free software licenses. +See [LICENSE.md](doc/LICENSE.md) for more information on licensing, as well as [LICENSE.KOS](doc/LICENSE.KOS) for the actual **KOS License** text. # Examples Once you've set up the environment and are ready to begin developing, a good place to start learning is the examples directory, which provides demos for the various KOS APIs and for interacting with the Dreamcast's hardware. Examples include: @@ -96,7 +82,7 @@ Once you've set up the environment and are ready to begin developing, a good pla - Interactive Lua interpreter terminal # Resources -[Dreamcast Wiki](http://dreamcast.wiki): Large collection of tutorials and articles for beginners +[dreamcast.wiki](http://dreamcast.wiki): Large collection of tutorials and articles for beginners [Simulant Discord Chat](https://discord.gg/bpDZHT78PA): Home to the official Discord channel of KOS [DCEmulation Forums](http://dcemulation.org/phpBB/viewforum.php?f=29): Goldmine of Dreamcast development information and history IRC Channel: irc.libera.chat `#dreamcastdev` diff --git a/addons/readme.md b/addons/readme.md new file mode 100644 index 00000000..2d064f36 --- /dev/null +++ b/addons/readme.md @@ -0,0 +1,16 @@ +# KallistiOS Addons + +The Addons system allows the creation of standalone addon packages, similar to the ports in the kos-ports system. + +## Installing addons +To install an add-on, simply place the addon directory inside this directory. Addons in this directory are automatically built when KallistiOS is built. Once built, the addon's headers will be available in `addons/include` and the built libraries in `addons/lib`. These paths are automatically included in your build flags if you are using the KOS Makefile system. You may disable an addon by creating an `unused` directory and moving the addons within, or you may uninstall an addon outright by simply deleting its directory. + +A few addons are supplied with KallistiOS. These include: +- [**libkosext2fs**](libkosext2fs/): A filesystem driver for the ext2 filesystem +- [**libkosfat**](libkosfat/): A filesystem driver for FAT12, FAT16, and FAT32 filesystems, with long name support +- [**libkosutils**](libkosutils/): Utilities: Functions for B-spline curve generation, MD5 checksum handling, image handling, network configuration management, and PCX images +- [**libnavi**](libnavi/): A flashROM driver and G2 ATA driver, historically used with Megan Potter's Navi Dreamcast hacking project +- [**libppp**](libppp/): Point-to-Point Protocol support for modem devices + +## Creating addons +Although KallistiOS currently only supports the Sega Dreamcast platform, the system is designed to support build quirks for various platforms. Each addon contains a `kos` directory, which would contain `$(KOS_ARCH).cnf` files (so, as of now, just `dreamcast.cnf`). The addon's `Makefile` contains build instructions to build the addon for KallistiOS, while the `dreamcast.cnf` contains quirks specific to building for the Dreamcast. If there are no platform-specific build quirks, an empty file named `dreamcast.cnf` still needs to exist for the build system to recognize that Dreamcast is a valid target platform for the addon. diff --git a/doc/CHANGELOG b/doc/CHANGELOG deleted file mode 100644 index d8f3a52a..00000000 --- a/doc/CHANGELOG +++ /dev/null @@ -1,1128 +0,0 @@ -Platform independent changes are marked with '***', otherwise the -applicable platform is listed. The name/initials of the person who -is responsible for the change are listed in [square brackets] for most -versions (where they are missing from early versions, assume that they -should be attributed to Megan Potter). - -KallistiOS version 2.1.0 ----------------------------------------------- -- *** Cleaned up generated stubs files on a make clean [Lawrence Sebald == LS] -- DC Added a function to detect if the program is being run on a retail - Dreamcast or a Set5.xx device [LS] -- DC Fixed an issue with the SIP driver that would cause programs to freeze - if a microphone was connected at program startup [LS] -- DC Rearranged the SIP driver to get rid of the internal buffer [LS] -- *** Removed the GBA, ia32, and ps2 ports. If someone really wants them back - and wants to maintain them, let me know. [LS] -- DC Fixed fmath functions so they compile in C99 mode [LS] -- *** Cleaned up warnings with -std=gnu99 for C code [LS] -- *** Cleaned up warnings with -std=c99 for C code [LS] -- DC Changed the PVR render-to-texture support to allow for two render-to- - texture passes without an intervening render-to-screen pass [LS] -- *** Fixed an issue in fs_ext2 that would allow you to rename a directory to - be a child of itself, thus chopping it off from the rest of the - directory tree [LS] -- *** Added a fs_readlink() function to resolve symlinks [LS] -- *** Fixed the vqenc and kmgenc utilities for compilation on a 64-bit OS [LS] -- DC Corrected an issue with video cable detection with GCC 4.8.x [LS] -- DC Added support for ATA devices on the G1 bus [LS] -- DC Fixed an infinite loop in ATA initialization if nothing except the - GD-ROM drive is connected [LS] -- *** Added documentation for the addons tree [LS] -- DC Made the hardware auto-initialization/shutdown functions weakly linked so - that they can be overridden without modifying KOS [LS] -- DC Corrected render-to-texture mode so that you don't have to wait for a - vblank to actually render to the texture [LS] -- *** Modified fs_stat to conform (mostly) to the POSIX standard for the stat - function [LS] -- DC Modified the cdrom driver so that it will set itself as the active ATA - device before trying to do any CD related reading [LS] -- DC Fixed potential race conditions between the cdrom code and g1ata [LS] -- DC Fixed full sector reading of non-data CDs (thanks to SWAT for pointing - out that it needed fixing) [LS] -- DC Added many new matrix/vector math-related macros [Josh Pearson == JP] -- *** Added libppp for dialup internet access to the addons tree [LS] -- *** Added DNS resolver functions getaddrinfo() and gethostbyname() [LS] -- *** Fixed a problem where poll() would deadlock if the timeout expired [LS] -- *** Modified getaddrinfo() so that it would try multiple times to contact - the DNS server with a timeout between messages [LS] -- DC Various cleanups and modifications to the cdrom code, including subcode - reading functionality, DMA-based sector reads, and using a recursive - mutex for the G1 lock [Donald Haase == DH] -- DC Fixed pvr_mem_available() to report all available texture memory, not - just what was available in the pvr_malloc() arena [LS] -- DC Added a utility function to the PVR code for controlling the cheap shadow - scale register [LS] -- DC Added an example of the PVR's cheap shadow functionality [LS] -- DC Added a tool for generation of bumpmaps that was sent to the mailing list - 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 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] -- DC Retrieve the IP address from dcload-ip when we can [LS] -- *** Added the mutex_unlock_as_thread() function to allow an IRQ handler to - unlock a mutex as if it were a specified thread [LS] -- DC Fixed a deadlock issue in the G1ATA code related to the use of a recursive - mutex for locking -- Thanks to SWAT for noticing the issue [LS] -- DC Added support for German (DE) and UK keyboards [Christian Groessler == CG] -- DC Minor cleanups to the flashrom code [DH && LS] -- DC Added light gun support roughly based on how it is done in libronin [LS] -- DC Added a very simple light gun example [LS] -- DC Added support for Spanish keyboards [Xavier Vallejo == XV] -- DC Added rudimentary support for OCRAM in linker script [CG] -- *** Added the C11 aligned_alloc() function [LS] -- *** Added fs_fstat and modified the fstat function in the newlib handlers to - use that or fake it for filesystems that don't support fstat [LS] -- DC Added fstat support to fs_iso9660 and fs_vmu [LS] -- *** Added fstat support to fs_ext2, fs_ramdisk, fs_romdisk, and fs_pty [LS] -- *** Changed libc/koslib/byteorder.c functions to use the <arch/byteorder.h> - macros, instead of being hard-coded as little-endian [LS] -- DC Added Opus decoding example using libopusplay [LS] -- *** Removed jiffy "counter" that wasn't actually counting anything [LS] -- *** Added the thd_create_ex() function to create a thread with a given set of - attributes set at thread creation (allowing us to expand that list of - attributes a bit more easily than what we would have to do otherwise) [LS] -- *** Made thd_mode local to the threading code (if you need to get the mode at - runtime, for some reason, use the new thd_get_mode() function) [LS] -- DC Patched the GCC patch so that GCC 4.7.x compiles cleanly with a newer host - GCC version [Luke Benstead == LB] -- *** Fixed GCC version detection in the environ script for some locales [LS] -- DC Made it so that PVR register access is done through a volatile pointer, - as it should be to ensure GCC doesn't mess with it any [LS] -- DC Copy function data from maple device during hot-swap poll if already - attached [Joe Fenton == JF] -- DC Fixed the clobber list of several matrix-related assembly blobs. Thanks - to kazade at DCEmulation for pointing out the issue [LS] -- *** Added the uname() function to retrieve the current kernel version [LS] -- *** Added fs_fat for SD cards and g1ata devices [LS] -- *** Added thd_each() function to iterate over all current threads [LB] -- *** Added dirname() and basename() functions to koslib [LS] -- DC Clean up strict aliasing rule violations and remove -fno-strict-aliasing - from the KOS_CFLAGS [mrneo240 && LS] -- NAO Added preliminary support for compiling to target the NAOMI and NAOMI 2 - arcade systems with a NetDIMM board attached [LS] -- NAO Added a simple utility to parse NetDIMM binary header data [LS] -- DC Fixed AICA crash when volume is set to 255 [Andress Barajas == AB] -- DC Placed a cap on the amount of samples requested by AICA so we don't get - a Buffer overflow [AB] -- DC Added a very simple minifont and an example of its use [LS] -- NAO Added a NAOMI-specific version of fb_console using minifont [LS] -- NAO Cleaned up the build process to not build certain parts of the DC - hardware support that are either not useful or not (yet?) functional on - NAOMI [LS] -- DC Fixed fs_path_append unsafe pointer arithmetic and made it smarter [AB] -- DC Fixed fs_ramdisk_attach so it does not cut off the first character of - filename when attaching [AB] -- DC Moved max open file constants for CD, Ramdisk, Romdisk to opts.h [AB] -- DC Removed stale lwIP examples [LS] -- DC Removed fs_dclnative declarations from opts.h [LS] -- DC Ported lwIP/httpd example to the built-in network stack [LS] -- DC Added functions to set the icon and color of a VMU that is shown in - the BIOS menu, as well as functionality to read the VMU icons from the - BIOS font [AB] -- DC Added a function to draw an XBM image on a single VMU screen [AB] -- *** Fixed issues with erasing long file name entries and empty files in - libkosfat [Thomas Sowell == TS] -- *** Updated time_t to be 64-bits on Newlib 3.0 and later and fixed Newlib's - type for ino_t to be sensible in Newlib 3.3.0 patch [TS, LS] -- *** Fixed argument check in sem_init. Thanks to TapamN at DCEmulation for - noticing the issue and proposing the fix [LS] -- NAO Updated the NAOMI header parsing tool to also support creating NAOMI - binaries and renamed it to naomibintool [LS] -- NAO Added naominetboot - a tool to upload NAOMI formatted binaries to a - NetDIMM board for executing on the NAOMI [LS] -- DC Prevent double-initialization of Maple devices from breaking things [LS] -- DC Added a user data pointer to snd_stream [LS] -- DC Added support for -fstack-protector to Newlib 3.3 patch [LS] -- DC Fixed wasted PVR ram in buffer allocation code [LB] -- *** Added getsockopt to TCP and UDP [LB] -- DC Corrected sizeof in fs_dclsocket that referenced wrong struct [LB] -- *** Fixed spinlock that was left locked on key error in the - kthread_getspecific function [LS] -- DC Added a modem PPP example [LB] -- DC Fixed register usage and counter in modem driver [LB] -- *** Fixed invalid read when closing UDP socket [LB] -- *** Fixed sending packets with an IP address of 0.0.0.0 [LB] -- *** Added code to attempt to lease the specified address via DHCP, if set [LB] -- DC Fixed controller capability masks [Artemio Urbina == AU] -- *** Added simple _times_r syscall for Newlib [LS] -- *** Fixed length of DHCP options area to always be at least 64 [LB] -- *** Fixed DHCP retransmit timeout to 4 seconds, per spec [LB] -- DC Added code to (partially) read DreamKey ISP information [LB] -- DC Fixed G1 reactivation code for modified BIOSes [Eric Fradella == EF] -- DC Added support for consoles modded with 32MiB of RAM [TS && EF] -- DC Fixed wildly out of range start for pvrmark benchmark [Falco Girgis == FG] -- DC Removed "navi" subarch, moved code to addons/libnavi [LS] -- *** Removed (completely unsupported) support for GCC 3.x and older [LS] -- *** Add timespec_get C11 function to koslib's libc [LS] -- DC Added timer_ns_gettime64() and performance counters [AB] -- *** Added check to allow strict C++17+ to use timespec_get [FG] -- *** Cleaned up all compiler warnings for all toolchains for KOS [FG] -- *** Add support for compiling with LTO [Paul Cercueil == PC] -- DC Fixed calling newlib's exit after returning from main so functions - registered with atexit() are called [Colton Pawielski == CP] -- *** Cleaned up + documented RTC driver, added support for setting time [FG] -- DC Cleaned up the register access in video to match pvr [DH] -- DC Fixed various shutdown functions to be safer to call in an interrupt [DH] -- DC Cleaned up asic functions and corrected potential bugs [DH] -- DC Removed cooperative threading mode -- threading is always preemptive [DH] -- DC Added early user init function [PC] -- *** Added Objective-C example testing/demonstrating C Runtime [FG] -- *** Updated Objective-C examples to include more thorough testing of the - runtime aspects of the language [Andrew Apperley == AA] -- DC Improve fipr() and fipr_magnitude_sqr() functions [PC] -- DC Add optimized bit-reverse function && vmu_draw_lcd_rotated() [PC] -- DC Update bfont example for Dreamcast-specific characters [DH] -- DC Add example for VMU speaker use [DH && FG] -- DC Add example for rumble accessory use [DH] -- *** Split init flags from <arch/arch.h> into <kos/init.h> [LS] -- *** Implemented posix_memalign() from stdlib.h [FG] -- *** Added clock_gettime(), clock_settime(), clock_getres() [FG] -- DC Refactored controller API, added capability groups and types [FG] -- DC VMU driver update for date/time, buttons, buzzer, and docs [FG] -- DC Add spinlock_trylock macro [LS] -- *** Simplify kthread_once_t into a simple variable rather than a struct [LS] -- *** Simplify sync primitive structures to remove initialized member [LS] -- *** Move definition of __RESTRICT from <sys/_types.h> to <kos/cdefs.h> [LS] -- DC Added DMA YUV converter path. Adjust some name of related #defines. - Added yuv examples [AB] -- *** Added GCC builtin functions for supporting all of C11 atomics [FG] -- *** Added toolchain and KOS support for C/C++ compiler-level TLS [CP && FG] -- DC Added vmu functions to check/enable/disable the extra 41 blocks [AB] -- *** Added driver for the SH4's Watchdog Timer peripheral [FG] -- DC Added Moop powered fast path to sq_cpy, added TapamN pvr related sq - functions [AB] -- DC Garbage-collect network stack [PC] -- 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 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] -- DC Refactored sfx and streaming to add SQ fast path [RR] -- DC Added 4/8-bit wav support to sfx and streaming [RR] -- *** Added <netinet/tcp.h> header file and required option [LS] -- *** Added <netinet/udp.h> and <netinet/udplite.h> headers and move the related - content from <netinet/in.h> [LS] -- *** 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] -- DC Increased resolution of TMU timers + date/time functions [FG && PC] -- *** Increased resolution of clock() and CLOCKS_PER_SEC to microseconds [FG] -- DC Added centralized header for Dreamcast Memory map (arch/memory.h) [DH] -- DC Refactored multibuffer video modes and added example of their use [DH] -- DC Created separate performance counter driver and enhanced API [FG] -- *** Implemented _POSIX_CPUTIME in clock_gettime() using perf counter timer [FG] -- *** Implemented scandir() and alphasort() POSIX functions from dirent.h [FG] -- DC Added new driver for the SH4's UBC + high-level breakpoint API [FG] -- DC Add support for French AZERTY keyboards [PC] -- DC Increased the resolution of pvr_stats_t from milli to nanoseconds [FG] -- *** Added support for modifying scheduler frequency at runtime [FG] -- *** Add support for worker threads [PC] -- DC Added new System Calls module [AB] -- DC Add timer_spin_delay_{us,ns} and use them in scif-spi [PC] -- *** Added thread support for tracking CPU time + updated clock_gettime() [FG] -- *** Added support for one-shot timers [PC] -- DC Use one-shot timers for timeout and a proper polling mechanism in modem [PC] -- *** Added pvrtex utility by TapamN to utils [DF == Daniel Fairchild] -- DC Added a set of known working purupuru bit patterns and a browsing mechanism to the rumble example [DF] -- *** Added full support for <time.h> additions from C23 standard. [FG] -- *** Fixes mutexes not working properly [PC] -- DC fs_dcload: Set errno on error in dcload_stat() [PC] -- *** Create romdisks with bin2c instead of bin2o [PC] -- *** Implemented versioning scheme for KOS API [FG && DH && LB] - -KallistiOS version 2.0.0 ----------------------------------------------- -- DC Broadband Adapter driver fixes [Megan Potter == MP] -- *** Imported a new version of lwIP, with proper sockets lib [MP] -- DC Added new httpd example for lwIP [MP] -- x86 Added incomplete ia32 port [MP] -- DC Added new DC examples for Parallax (raster_melt, sinus, delay_cube, - rotocube) [MP] -- *** Added svnpush.py script for pushing repositories on the web [MP] -- DC Added genmenu module and example in Tsunami [Megan Potter == MP] -- DC Added hello-mp3 example [MP] -- DC 320x240 PAL mode [mekanaizer == MK] -- *** Fixed vqenc and kmgenc headers to be ANSI compliant [MP] -- *** New addons/ports build system [MP] -- *** Moved most addons/ports into their own tree/distribution [MP] -- *** Moved several incorrectly placed pieces into libkosutils [MP] -- *** Imported port of Lua 5.0 [MP] -- DC Added Tsunami Matrix class [MP] -- DC Various improvements to Tsunami classes [MP] -- *** Major build system overhaul (see RELNOTES) [MP] -- DC Improved MII/link status handling for BBA driver [MP] -- *** Added NONE thread mode [MP] -- *** lwIP select fixes [Walter van Niftrik == WvN] -- DC GDB stub fixes [Richard Moats == RM] -- *** New bin2c [Gil Megidish == GM] -- *** Updated genromfs [MP] -- DC Fixed and re-enabled SPU DMA module [MP] -- DC Cleaned up PVR DMA functions, adding support for different DMA targets [MP] -- DC Floating point register support for the GDB stub [RM] -- DC Added G2 DMA pausing for G2 bus read/write calls [MP] -- *** Added UDP sendto/recvfrom calls in lwIP [MP] -- DC Added DNS client lwIP example [MP] -- DC Added ISP settings code to flashrom module [Sam Steele == SS, DP] -- DC Added ISP settings example [MP] -- *** Added gethostbyname support to lwIP port [MP] -- DC Updated netcfg to load settings from flashrom [MP] -- DC Cleaned up DC modem code and added new dialing functions [MP] -- DC Store Queue and Matrix translation speed ups [Jim Ursetto = JU] -- DC Support for DMAed vertex buffers in PVR [MP] ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-09-21 23:09: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 annotated tag, v2.1.0 has been created at 0fb74d847723fd41068062d7171d825b5dfd344c (tag) tagging 52140509f51a9d262ea75353f2eb0f7e18c2ec6b (commit) replaces v2.0.0 tagged by QuzarDC on Sat Sep 21 18:31:37 2024 -0400 - Log ----------------------------------------------------------------- Release 2.1.0 7dog123 (1): Binutils arm will now properly be downloaded. Aaron Glazer (1): Add basic micropython example. (#382) Accelerator (1): Formatting Fixes and Markdown Normalization in dc-chain Directory (#253) Andress Barajas (82): Cap needed_samples so req isnt greather than buffer_size Fixed sfx vol 255 crash Remove unused variable Picky stuff Update CHANGELOG Update CHANGELOG again Update CHANGELOG Make fs_path_append smarter Merge remote-tracking branch 'upstream/master' Updated changelog Minor ramdisk romdisk edits Properly label return value Fix fs_ramdisk_attach so it does not cut off the first character of filename when attaching Forgot initials Move max file constants to opts.h Moved iso max files to opts as well Added entry for moving constants Fix comments Added maple attach/detach callbacks Missed newline at end of file Added vmu functionality Remove unneeded string.h Added more clarification about icon data Fix comment for vmu_set_custom_color() Use already existing vmu root functions Merge remote-tracking branch 'upstream/master' into vmu_icons Preface with BFONT Merge branch 'KallistiOS:master' into controller_cbs Fix Conio adventure example Updated speed test to calculate the average (#105) Merge branch 'KallistiOS:master' into controller_cbs Fix out of memory example compiling for gcc 4.7.4 Fixed bubbles example (#123) Added timer_ns_gettime64() Merge branch 'KallistiOS:master' into master Fix comment typo Updated Changelog Added inline to speed things up Updated entry position in Changelog. Return a value using micro seconds timer to generate a nanoseconds value instead of returning 0 Make sure clearing a counter stops it first. Updated read me to include performance counters. Fixed a comment Added documentation inside the comments Added better doxygen documentation for performance counters Fix overflow warning Merge branch 'KallistiOS:master' into controller_cbs Fix appending to files through dcload and ram Updated example makefiles so they follow the same pattern (#181) Fix example warnings (#182) Clean up Makefiles (#220) Fix some warnings (#225) Fix two examples Merge branch 'KallistiOS:master' into BuiltInExampleWarnings Fix warnings and use cont_btn_callback_t instead Merge branch 'KallistiOS:master' into BuiltInExampleWarnings Fix wav2adpcm (#296) PVR YUV Converter Support, Cleanup, and Examples Add functionality to enable/disable extra 41 unused blocks on VMU (#307) Examples refresh (#328) Store Queue Refresh (#320) Use uint32_t and size_t in store queues (#337) Cache Refresh (#342) Add sound effects example (#343) G2 refresh (#321) Update romdisk examples to use new romdisk approach (#350) SfxMgr clean update (#348) Add multi-streaming example (#351) Fix accidental double free of stream and cleaning code Remove printf Sound effect number of samples warning (#354) Fixed typo and updated function name (#359) SPU Clean (#356) ARM AICA Clean up types and spacing (#357) Fix KOS compile error and warning Fix kos-ports compile error Use pair single precision data transfer Removed unused global Fixed bug in thdswitch. Added commented out sections Fix unused variable warning. Fixed spacing and address feedback Removed extra add Fix spacing Fix copyright Fix example warnings and docs in SQ Andy (2): Fixed ability to save VMU game to VMU and be playable. Also included example to show functionality. Added documentation to example Andy Barajas (35): Merge branch 'KallistiOS:master' into thdswitch_speed Merge branch 'KallistiOS:master' into thdswitch_speed Comment out line that was cause no video on non vga setups (#402) Fix rotocube example (#410) Handle double promotion (#407) Fixed misspelled words (#424) Add some gldc examples (#435) Fix serpent_dma example (#448) Pull out sq fast path assembly to its own file (#475) Update KOS_PORTS path so its prettier in error messages (#556) Update gitignore (#557) Add Syscalls module (#536) examples/dreamcast/makefile rework (#538) Make docs_open depends on docs. We rebuild everytime but it only takes a few secs and we always want to look at the latest right? (#578) Improve Screenshot (#575) Fix Cache functions (#570) Add KOS_OBJDUMP (#582) Headers (#593) Diagnose help on reg dumps (#600) Fix texturing and closing opened files (#607) Update startup (#621) /sd directories viewed as files (#647) /rd . & .. are now recognized as directories (#646) /dev rewinddir on close (#645) Fix pty (#636) Replace redefined regs with dmac.h definitions (#655) Fix pty compile errors and warnings (#657) Returned to some old ways of checking ref counts (#660) Made temp_tex static (#667) Using dcache_inval_range instead should work now since zcrc fixed it (#668) Fix PVR_PACK_COLOR macro (#683) Fix ramdisk_find (#687) Update minimum macOS version for toolchain build (#685) Fix -Wmaybe-uninitialize warning (#701) Remove g1ata mutex use in biosfont (#700) Artemio Urbina (1): - Fixed controller capability Masks. Confirmed with a several official controllers in hardware using the 240p Test Suite Controller Test Bemo (1): Add Apple silicon build support Ben Baron (4): Fixed building GCC 9.3 toolchain with deps Changed GCC to install-strip to save 100s of MB Updated threading comment to mention newer GCC Prefer curl over wget in dc-chain download script Bhaal22 (1): Updated Makefiles Charlotte Koch (1): Explicitly use GNU extension to allow flexible array member in struct dirent (#499) Christian Groessler (7): dc-chain: Adapt to system where the GNU make executable isn't called 'make' (but 'gmake' for example). Don't hardcode bash location. add support for German keyboards (the UK keyboard table will be revisited soon...) add support for UK keyboards fix a copy-n-paste error fix a comment Add rudimentary support in the linker script to use OCRAM. Only uninitialized Colton Pawielski (41): Use newlib arc4random_buf for random fs device Add CMake helper functions Seperate Pass 1 and Pass 2 GCC folders Seperate build variable assign for build_gcc_pass1 Add C99 flag to Random Example Make spacing uniform across CMake files Fix errors in CMake ENV Var Checks Disable dev filesystem when newlib < 2.4.0 Change CFLAGS to KOS_CFLAGS in random example Change warning text to clarify limitation with newlib Add use_kos_patches option to dc-chain config Add CPATH & LIBRARY_PATH exports to MacOS GDB Build dc-chain: Fix failure when gdb build folder non existent dc-chain: Fixup gdb job deps and add codesign step for MacOS Changes for properly calling newlib exit() Cast callback function in font.c Fix empty arg lists and remove __noreturn from function implementations Removed unused return and cleanup whitespace Update CHANGELOG Rename "arch_newlib_exit" to "arch_exit_handler" Add ability to specify git repos for dc-chain sources Make download_type default with fallback to tarball_type Add exit code as argument to dcload exit syscall Only build arm code if compiler is present Update gitignore Fix dist target for examples Remove insight from dc-chain Update GDB to use _download_type config (#193) Implement dc-chain download and unpack in Makefiles Remove dc-chain bash scripts Update dc-chain docs Fix underscores missed in last dc-chain commit Fix Addons Makefile Deps Fix CMake Toolchain Typo Properly clean dc-chain builds from SH4 Pass1 & GDB (#433) Fix dc-chain host-detect include order (#432) Copy GNU configs into toolchain sources (#323) Return error code on example build failure (#606) Fix libstunami Examples (#615) Fix cpp/clock example (#616) Avoid returning error code when examples are too old for toolchain version (#631) DC-SWAT (9): Fixes and improvements for G1 ATA devices. Added 8-bit PCM and interleaved ADPCM support for SFX Added support for 8-bit PCM stream Thread-safe audio fixes Fixed ATA device selection and mutex. Fixed GD-ROM init for BIOS mod without CD inserted. Added check disc change status for cdrom_reinit_ex Removed GD drive status checks at startup. Fixed typos in PVR code. Donald Haase (56): Updated functionality for the CDROM. Includes subcode reading, DMA sector reading, and more accessible parameters for initializing the drive. Now that the g1ata mutex is recursive, lock in the command executer. Add recursive locks to the gd command execution command. Now is thread-safe even if a user calls it manually. Mutex lock within the gdc command execution wrapper. This allows for it to be called by users without concern for the mutex. Update to BIOS font code: Update to Keyboard driver: Fix missing parens in fs_dclsocket SBIN. Minor cleanup to snd_sfxmgr. Now uses appropriate error defines. Minor cleanup of flashrom stuff. Improved some error returns. Update debug message to properly print VGA usage. - Thanks Chilly Willy. Cleanups in BBA/SLA code. Add Rumble Example (#227) Various corrections from static analysis (#204) Merge pull request #235 from KallistiOS/init-flags-header Merge pull request #239 from Dreamcast-Projects/BuiltInExampleWarnings Cleanup romdisk creation and utilization in examples (#241) Newlib lock.h fix (#242) Adding a header for defines related to memory regions, then applying them A few more mem defines I'd missed kos/thd WAS being used Update kernel/arch/dreamcast/include/dc/memmap.h Update kernel/arch/dreamcast/include/dc/memmap.h Update kernel/arch/dreamcast/include/dc/memmap.h Update kernel/arch/dreamcast/include/dc/memmap.h Move and rename memory header, adjust names, and expand contents. Update define name to the more descriptive SQ_BASE Add changes to the maple file defines Update kernel/arch/dreamcast/include/arch/memory.h Apply suggestions from code review Final cleanup Merge pull request #265 from KallistiOS/fix-p4-macro Update memory with MMU and UBC registers Update mmu.c to use new defines Update ubc.h to use new defines Make sure to include memory.h in ubc.h for defines Refactor Multibuffered video modes (#419) Small Fixes from DCPlaya's KOS branch (#476) BBA Driver Cleanup (#278) Merge branch 'master' into No_u_dev Clean up formatting Patch newlib headers to expose lstat (#530) Fanalyzer ffixes (#544) Cleaning up filename function to simplify and correct buffer overflow (#590) Add missing __END_DECLS (#596) Correct bitmasks in fpu_exc stringify (#601) Better error/warning handling in some examples (#589) Avoid infinite loop. (#604) Malloc leak and debug fixes (#599) Some cleanups in Maple (#551) Revert "Update KOS_PORTS path so its prettier in error messages (#556)" (#627) Properly free assets at exit. (#633) Clean up after the allocation of the sphere texture data and font data. (#630) Threaded Controller Callbacks v2 (#608) Ensure thd_current does not get set to null (#674) Replace duplicated define for the size of the PVR RAM (#688) Docs update (#747) Ellen Marie Dash (1): [utils/dc-chain/download.sh] prefer HTTPS over FTP Falco Girgis (149): Readme (#83) GCC12 Toolchain Support (#90) Merge pull request #95 from gyrovorbis/master Merge pull request #97 from gyrovorbis/master Updated GCC dependencies for testing config.mk (#108) Merge branch 'master' into cpp_time Authors update (#142) Clean up Compiler Warnings (#135) Fixed tsnunami font example with GCC12 LTO Fixed building with GCC-4.7.4 after LTO changes (#159) Fixed libdream video mode examples Added support for additional Newlib config options RTC cleanup, documentation, setting date/time (#167) Fixed missing header from rtc.c Set Doxygen main page to updated README.md Updated Doxygen for Threading API Fixed Objective-C + added C runtime example (#202) Added Quzar's VMUBeep as an Example (#214) Added fast math CFlags to environ.sh.sample Added -fno-builtin to environ.sh.sample Update AUTHORS (#221) Added VMU LCD example using virtual framebuffer (#228) Made vmu_fb_present() honor connector_direction (#230) Moved Noreturn_ attribute to front of thrd_exit(). Implemented posix_memalign() addition to stdlib.h (#268) Implement POSIX clock_gettime() and friends (#266) Removing NULL check warning from posix_memalign (#270) Fixing opusfile build issues after clock_gettime() Merge pull request #271 from KallistiOS/clock_gettime_fix Controller refactor, documentation, capability queries (#212) VMU driver support for date/time and buttons + documentation update (#207) Updated CHANGELOG to reflect VMU driver update Merge pull request #274 from KallistiOS/spinlock-trylock Merge pull request #276 from KallistiOS/simple-once Added Spinlock Example/Test (#275) Added KOS wrapper bash script for cmake Fixing missing vmu_beep_waveform() symbol Kazade's authorship should include 2022 and 2023 environ.sh.sample cleanup + documentation + optimizations (#288) Enabled atomics support in environ_dreamcast.h Modified thd_each() to support early exit + retval wav2adpcm: Fixed 2 warnings, error logs to stderr Added Makefile for YUV PVR demos (#299) Merge pull request #304 from KallistiOS/doxyupdate Added posix/sysconf.c to implement sysconf() (#306) Initial C11 libatomic GCC builtin implementation (#301) Enable TLS Support for C/C++ (#111) CMake toolchain support for C11/C++11 atomics Merge pull request #313 from KallistiOS/once-again Extended once_test to repro/verify deadlock issue (#312) Enforced matrix alignment, matrix ASM cleanup Doxygen Cleanup/Centralization for Threading APIs (#319) Watchdog Timer Driver (#324) Fixed broken KGL examples Added include for maple.h to fix KGL examples Merge pull request #352 from Dreamcast-Projects/snd_free_fix_clean Removed INIT_THD_PREEMPT startup warning Dc-chain configs enable c99 formatters by default Merge pull request #370 from cepawiel/cmake_naomi_fix C++20 Concurrency Test/Example (#315) Merge pull request #372 from KallistiOS/netinet-tcp-h Merge pull request #373 from KallistiOS/netinet-udp-h Updated main repo and documentation README Updated and improved Doxygen docs for WDT. Fixed two thread-related Doxygen warnings Revert "Thread Switch copy speed up" (#398) Added link to Source Code to Doxygen Navigator Bar (#395) Changed Doxygen to use $(KOS_BASE) for Navigator Layout Path (#403) Doxygen GitHub link (#404) Updated out_of_memory KOS example RTC Date/Time Fix for Negative Unix Timestamps (#394) Updated DoxygenLayout.xml for Doxygen v1.9.8 (#411) Timer Cleanup, Precision Enhancement (#345) Renamed likely() and unlikely() macros Doxygen Topics Cleanup (#412) Increased clock() and CLOCKS_PER_SEC to microsecs Update doc/CHANGELOG Added and improved BBA doxygen documentation Added disclaimer to 800x608 resolution example Added option for enabling Newlib multibyte support Fixed INIT_MALLOCSTATS KOS init flag Merge branch 'master' into init_mallocstats_fix Disabling Watchdog Timer on KOS exit and init (#439) Separate Performance Counter Driver (#425) Fix KGL Nehe26 Example build failure Fixed GLdc Nehe26 Example Build Failure (#443) Changed abort() to call arch_abort() CMake Toolchain Update Hello Example Cleanup and Update (#459) Fixed build issue with -Og for inode.c (#454) Added CLOCK_PROCESS_CPUTIME_ID + clock_getcpuclockid() (#427) Fixed romdisks and bin2o in Cmake toolchain CMake Toolchain fixes for library link order Added newlines around main() console output Added <dc/vmu_fb.h> to <kos.h> (#464) Added Toolchain Config Variable for Disabling NLS. (#461) Merge branch 'master' into console_newlines Added --disable-nls support to binutils as well Added doxygen category for assertion handlers Implement POSIX scandir() + alphasort() for dirent.h (#453) UBC Driver Upgrade (#416) Fixed libparallax bubbles and rotocube examples (#474) Fixed Newlib's getpid() and Implemented kill() (#457) Merge branch 'master' into fix/fix-kos-add-romdisk-func-retrieving-kos-base-from-env Fixed declarations for clock_xx() POSIX API Added debug/assertion option to environ.sh.sample (#473) Updated dc-chain for DLang + m4-single support Fixed release build warnings from defining NDEBUG. Fixed (lying) overflow warning from readdir(). Fixed all Doxygen warnings. Updated copyright date for KOS's license. Updated the AUTHORS file to add 2024 dates Updated dc-chain changelog.txt. Fixed kbd build issues due to <stdatomic> in C++. Addressing review feedback. Increased Timing Resolution of pvr_stats_t (#471) Update utils/dc-chain/config/config.mk.13.2.1-dev.sample Dynamically Modify Scheduler Frequency HZ at Runtime (#520) Minor Floating-Point Precision Fixes (#504) Add Newlib Configuration Parameter for Enabling iconv() (#532) Forgot a closing brace in previous commit! Teensy Doxygen fix for worker_thread.h. (#563) Fixed directory reading using FAM to conserve RAM (#546) Fix mke2fs example with Raylib Installed (#562) Added Makefile Rules for Doxygen Documentation (#571) Updated the FPU exception example. (#572) Added dc-chain Configuration Option for C++'s Timezone Database (#554) Linking to libm by Default in environ_base.sh. (#569) Per-thread CPU time implementation (#506) Bumped KOS's Default C and C++ Versions to 11 (#561) Stack Protector environ.sh Option + Example Tweak (#580) Added a bunch of GCC version checks to examples. Fixed warnings from realpath signature mismatches. (#588) Updated OS-Level TLS Example (#603) Fixed warnings when compiling with builtins. (#610) Fixed false failure in once_test on 16MB RAM. (#605) Resolved symbols when using LTO w/o -fno-builtins (#560) Fixed broken build. (#612) Implemented C23 stdlib features for <time.h> (#550) Fixed a MASSIVE screw-up with enabling OCRAM. (#620) Thread bugfixes: Stack ownership, Genwait object release upon death (#622) Added Versioning to KOS (#565) Fixed vmu_beep example to gracefully exit (#650) Added Reentrant Mutex Example (#644) Fixed GCC9+10 build failures: pthread_atfork() (#663) Added utime h POSIX header file (#658) Added declaration for nanosleep to time.h. (#691) Manually aligned PVR primitives to 32-bytes (#678) Updated the version number for KOS 2.1.0. (#750) Gerrit Pannek (1): Fix: make_banner.sh - fallback if 'git describe' fails Harley Laue (2): Fix C++ compilation with missing __END_DECLS Use /bin/sh instead of bash HaydenKow (2): feat: support basic version of genromfs on windows chore: clean warnings and missing includes Heel (2): getsockopt(): add no-op handling for SO_ERROR Ensure getaddrinfo() handles IP adddress inputs without using DNS (#358) James Peach (5): dc-chain: download source archives from mirrors Make bin2o a little more robust. Move vector.h from addons to core. (#218) Make the bfont string argument const. doc: improve the doc comment for cont_btn_callback Jason Rost (3): 1-20-24 - Fixed depth test issues and added color buffer clear to actually set the background color in the Gltest Example for GLDC. Fix for examples/dreamcast/video/multibuffer Makefile (#479) 1-31-24 - Modified Makefile to remove redundant -x in Make Run target. Cleaned up main.cpp unused var (#480) Josh Pearson (6): First major update to the GL API 9-28-14 Fixed Open GL examples Modified sq_cpy to use const src pointer. Updated kgl examples to use glCompressedTexImage2D for loading vq compressed textures. Added multi-texture examples. Added multi-texture examples for kgl. Added multi-texture examples to kgl Kayateia (4): Update copyrights to reflect name changes Apparently CHANGELOG needed a bit more attention Update the title string spacing to match A few more renames/replaces! Lawrence Sebald (600): Clean up the generated stubs files on a make clean. Add a function that effectively is only there to detect whether you're on a retail Dreamcast or a Set5.xx devkit. A few minor changes to dc-chain. Fix a major bug in the mic driver and change how it works internally. Begone ports that are no longer maintained. libkosext2fs compiles cleanly with -std=c99, so go with that. Fix the Dreamcast fmath functions so they compile as C99 (while still allowing them to compile as C89). Use -std=gnu99 for compiling C and -std=gnu++98 for C++. Clean up warnings with -std=gnu99. Did someone ask for all warnings with -Wunused-parameters to be cleaned up? No? Oh well, I did it anyway. Get rid of all warnings about initializers that appear with -Wextra. Begone pointless unsigned comparisons against 0 (namely >= 0 and < 0 tests). strnicmp -> strcasecmp. asm -> __asm__ strnicmp -> strncasecmp (not strcasecmp)... Fix signed/unsigned comparison in inet_ntop. Warning cleanup in the network code. More warning cleanup, this time in kernel/arch/dreamcast. Clean up the last of the warnings with -Wextra -std=gnu99. strcasecmp/strncasecmp are in <strings.h> not <string.h> (in C99). Deal with strlcat, strlcpy, and strdup in the code. This finishes cleaning up all -std=c99 warnings. Made the PVR render-to-texture code work with two render-to-texture passes with no intervening render-to-screen pass. Add automatic Makefile dependency generation if you define the KOS_DEPDIR variable in your Makefile. Add ext2_inode_retain() to increment the reference count on an inode without looking it up again. Fix a few small things in a couple of headers. Make sure nobody tries to rename a directory so that it would be its own child. Add readlink to the VFS. Fix a stupid mistake in fs_readlink... Fix two unused parameter warnings when compiling without frame pointers. Fix a bit of an issue in the documentation of the basic threading example. Clang won't build binutils because of some warnings. Make them not be errors. A few changes/updates to dc-chain: Rolling back to GCC 4.7.3 for the moment, as someone has reported problems with 4.8.2. Fix vqenc and kmgenc on a 64-bit host. Make the pointers volatile when reading the video cable type. Revert "Rolling back to GCC 4.7.3 for the moment, as someone has reported problems with 4.8.2." Add a function to the kos_blockdev_t type to flush any write caches on the block device. Change the type of block numbers in the block device code to uint64_t. Fix a bug in the mke2fs example. Add G1 ATA device support. Might help if I checked in the Makefile too. Use F_PI instead of M_PI in the kgl bubbles example. Fix an infinite loop if you call g1_ata_init() without a device attached. dc-chain: Rolling back, once again, to GCC 4.7.3 due to some performance regressions in 4.8.x. Also, added a flag to the download.sh and unpack.sh scripts to not download/set up the GCC dependencies (in case you install them separately). Add documentation for the addons tree, and adjust the Doxyfile so it will generate said documentation. Add a few constants that Newlib fails to define for any platforms other than Cygwin. Define arch_auto_init() and arch_auto_shutdown() to be weak symbols, so that you can replace them in your own program, if you see fit to do so. No need to wait for a vblank when doing render-to-texture. Add Multi-Word DMA support to g1ata. Add DMA write support to g1ata. Add missing atab_write_blocks_dma() function. Attempt to use the _EXT read/write dma commands when asked to transfer > 256 sectors, unless they aren't available. Change the texture render sample to be a bit more... interesting of an example. Remove libk++. Remove use of libk++ by the modplug_test example. Make fs_stat() act more like stat (and support the normal stat() function in a mostly sane way). Adding generated/downloaded stuff from dc-chain to the .gitignore. Update the README to remove some stuff about old ports and update the formatting section. Update the FAQ to remove some irrelevant stuff and add a note about the modem to the network portion of the document. Fix a bit of nonsensical commenting. Update the release notes a bit for the current state of things. Make the cdrom code aware of the g1ata stuff. Remove stat_t from fs.h. Add a few notes to the documentation for the pvr function for loading a kimg. Don't change the ata device at the end of a g1ata operation, since the cdrom code will change it if needed now. Use the versions of GMP, MPC, and MPFR that the GCC developers host and apparently recommend (as their download prereqs script will grab them). Fixed raw sector reading of non-data CDs. Update the CHANGELOG for recent commits. Invalidate the operand cache on dma reads in g1ata. Add basic g1ata example. Add a convenience function to the MD5 code. Fix |darc|'s broken cable bug. Add a bunch of new/useful matrix/vector math macros. Add g1ata to the examples Makefile. Add Marcus Comstedt's 1ST_READ.BIN scrambler to the utils directory. Add scramble to the utils Makefile. Add a few more things to the .gitignore. Fix the make_authors.awk script to handle quotes in names. Update the environ.sh.sample to match what dc-chain assumes. Add some support code for network devices that might not use ethernet to net_ipv4 and net_ipv6. Fix some things in IPv4 to be const-correct. Add libppp for PPP support in the network stack. Correctly request the DNS from the other side of the link. Add support for using the modem with libppp. Add AF_UNSPEC and PF_UNSPEC to <sys/socket.h>. Fix another const-related thing in net_ipv4_frag. Add getaddrinfo(), freeaddrinfo(), gethostbyname(), and gethosbyname2() functions. Fix formatting on getaddrinfo.c and update the CHANGELOG. Fix a deadlock issue with poll() when timeouts expired. Have getaddrinfo() make multiple attempts to contact the server and time out after failing a few times. Move the lwIP examples out of the network examples directory and into their own. Add new dns-client network example that uses the getaddrinfo() function. A few updates to the SH4 math functions by Josh Pearson. Remove Josh Pearson's nickname from the AUTHORS list. Merge branch 'master' of ssh://git.code.sf.net/p/cadcdev/kallistios Fix the header guard on vq_internal.h in utils/vqenc. Clean up the flashrom syscall definitions to match the way the other bios syscalls in init.c are handled. Add a parameter to the pvr_init_params_t structure to disable translucent autosort, as well as a function to do on a frame-by-frame basis. Remove the ENABLE_WRITES macro from flashrom.c. Add a new header file with compile-time options and rename several of the debugging related options in the code. Fix a minor issue with something being declared as static that shouldn't have been in that last commit. Add ARGB1555 to vqenc. Merge branch 'master' of ssh://git.code.sf.net/p/cadcdev/kallistios Remove old stuff from the utils tree that's not really useful anymore. Fix pvr_mem_available() to return all available texture memory. Update copyright date in banner.c for 2014. Clean up some of the dirent.h documentation and add a dirfd() function. Use the proper header file for the memcpy2() and memset2() functions. Align readdir() a bit more with POSIX. Add in some code related to PVR cheap shadows. Add Fredrik Ehnbom's dcbumpgen program. Add support for offset color values (aka specular values). Add dcbumpgen to the .gitignore Add dcbumpgen to the utils that are built by default. Merge branch 'bogglez-master' Sprites can have specular values too. Add a function for calculating bumpmap parameters. Add a small bumpmapping example. Add in a function to concatenate path components. Add nanosleep. We need to define _POSIX_TIMERS to get the prototype for nanosleep in <time.h>. Add rewinddir(). Add an initializer for rewinddir for fs_socket. Fix stupid spacing in tls.c. Fix a small typo in a doxygen comment. Add in C11 threading support. Dern typo. Add doxygen comment for rewinddir(). Update a bit of stuff in the documentation directory. The UDP checksum is required for IPv6 and optional for IPv4. Add an option to not compute UDP checksums on packets sent with a socket. Make net_arp_gc() a static function, not a public one, also change the way it works a little bit. Fix ugly indentation... Add support for UDP Lite to the network stack. make_banner.sh requires bash. New version of make_banner.sh that doesn't require bash. Get our IP address from dcload-ip when it matters. Add a new mutex function to unlock a mutex on behalf of a thread. Update the CHANGELOG. Update the AUTHORS and license files. Add simple PAL 50/60hz menu example. Clean up all the warnings I care to clean up that are reported with -pedantic. Also, clean up a few other warnings that somehow snuck their way past the last warning cleanup pass. Rename panic() -> arch_panic(). Update one more reference to panic. Fix modplug_test example. Add KOS_PORTS variable to environ.sh. Add an automatic default for the KOS_PORTS env var if it isn't set. Update the vorbis examples to work with new kos-ports. Add a bit about the new kos-ports to the release notes. Update Lua example to work with the new version in kos-ports. Move changelog entry to keep it in (relatively) chronological order. Update the FAQs a bit. Remove fs_dclnative. Add missing __END_DECLS to <dc/g1ata.h>. Add some missing headers to <kos.h>. Fix network/isp-settings example. Mostly apply Harley Laue's flashrom cleanup patch. Oops, I meant Donald Haase there, not Harley Laue. That is not the mouse driver. Fix the comment in it. Add in lightgun support. A few minor documentation updates... Add a very basic light gun example. Update copyright date in banner. Add support for Spanish keyboards. Remove stray binary file... Remove another stray binary. Add explanation of the flip/clamping modes on the PVR U/V coordinates. Fix formatting on AUTHORS file. Merge branch 'master' of ssh://git.code.sf.net/p/cadcdev/kallistios Add C11 aligned_alloc() function and clean up malloc.h documentation. Update the CHANGELOG for the last commit... Add <arch/byteorder.h>. Initial work on adding fs_fstat() and making fstat() do something useful. Add fstat() support to fs_ext2. Add fstat() support to fs_vmu. Add fstat() support to fs_iso9660. A bit better of a fake fstat, for the filesystems that don't support it. Update CHANGELOG. Add fstat support to fs_pty, fs_ramdisk, and fs_romdisk. Also, make sure the stat structure is not a NULL pointer in fs_fstat(). Use <arch/byteorder.h> for ntohs/ntohl/htons/htonl. Update RELNOTES. Add a simple SDL-based audio example (more of a regression test than anything)... Add Opus example. Update a few pieces of documentation... Don't use jiffies in the ARP code. Remove jiffies from thread.h. Remove jiffies from thread.c. Add new thd_create_ex() function. Make thd_mode a static variable and add a thd_get_mode() function. Define a __RESTRICT macro to deal with non C99/C11 compilation. Fix GCC version detection in the environ script for German locales (and any other locales that don't follow the same format for gcc --version. Fix GL library linking in all examples... Remove +x permission bits on lots of GL example stuff... Update the GDB and Insight versions for dc-chain. Clean up some more files related to GDB/Insight in the make clean target. Add GDB/Insight related stuff to the .gitignore. Update github repo address. Make it so PVR registers are accessed through a volatile pointer. Fix ordering of CHANGELOG. Add cleanup script to dc-chain. Update dc-chain to use Binutils 2.27. Add a bit to the GCC patch to make it work with newer makeinfo versions. Merge relevant part of pull request #2 from Bhaal22/master Keeping up the theme of part of the last commit, fixing the kos-ports_clean target and adding a kos-ports_distclean one. Move <kos/iovec.h> to <sys/uio.h>, as specified by POSIX. Include <sys/uio.h> from <sys/socket.h>. Fix header comment for socket.h. Oops, forgot these two with the <sys/uio.h> commit... Sorry about that. Provide a compatibility typedef in case anyone was using the old iovec_t type. Fix compilation of C++ stuff that manages to #include <sys/uio.h>. Fix typo. Make dc-chain not fail if patches have already been applied (i.e, you're trying to correct a failed build). Use binary mode on fopen so these tools work on MinGW and the like. Add -Wno-deprecated to the kernel's compiler flags. Add two attributes to kos/cdefs.h for marking things as deprecated. Remove the old (non-updated) LaTeX manuals. Give deprecation errors for old sync primitive functions better warnings. Remove iso_ioctl. Make fs_ioctl have the "correct" prototype for the standard UNIXy ioctl(). Fix a typo... Merge branch 'master' of ssh://git.code.sf.net/p/cadcdev/kallistios Fix bin2o's use of an incorrect environment variable. Update the ARM driver. Remove unneeded instruction from _arch_exec_template that probably screwed up the CCR setting a bit. Update some comments in the <dc/flashrom.h> Fix the clobber list of several of the matrix math macros. Add uname function to query the current version string. Need to clean these two files up each build to ensure they're always re-built. Remove --broken flag from the banner generation for git revisions. Fix the banner generation script. Update binutils version to 2.31.1 in dc-chain. Clean up the environ script and some definitions within the code that may break with potential updated toolchain tools. Merge pull request #11 from sizious/git-ignore-updating The __depr macro is in <kos/cdefs.h>, so we need that version here instead of <sys/cdefs.h>. Merge branch 'master' of ssh://git.code.sf.net/p/cadcdev/kallistios Clean up some comments. Clean up some comments a bit for cleaner documentation. Update copyright. Add initial (probably still buggy) verison of libkosfat. Add function to allocate a FAT cluster. libkosfat: Merge root/non-root directory searching code and add a function to search for a child of a given directory entry. libkosfat: Begone useless debug functions. libkosfat: Update fsinfo on unmount of a rw filesystem. libkosfat: Add function for deleting a FAT chain. libkosfat: Keep track of the start of the longname entry when we keep track of dentry starting points. libkosfat: Implement unlink and rmdir. libkosfat: Add initial implementation of mkdir. libkosfat: fix empty directory detection to properly handle . and .. entries. libkosfat: Add "." and ".." entries to new directories. libkosfat: Fill in timestamps for newly created directory entries. libkosfat: Untested file creation/truncation code. libkosfat: SEEK_END can have an offset. Respect it. libkosfat: Keep track of the cluster order in file descriptors. libkosfat: Add a function to update a dentry on the disk and one to update the modification time of a dentry structure. libkosfat: Add implementation of write. libkosfat: Fix a bug with reads failing after seeks. libkosfat: Don't add a dot to short names that don't have an extension. libkosfat: Make sure long file names completely match, not just mostly match. libkosfat: It would help if we could actually create files/directories in the root of a FAT fs... libkosfat: Fix timestamps to they aren't 70 years in the future. libkosfat: Fix dentry cluster number for files in root directory and write dentries immediately on write. libkosfat: Update the dentry on open if opened with O_TRUNC. libkosfat: When searching for a child entry by short name, it helps if we pass the normalized short name, not the original string. libkosfat: Make mkdir return -1 properly on error, not some positive errno value. libkosfat: Enable read/write support. Support creating files with long names. libkosfat: Properly point to the short entry on a long lookup. libkosfat: Fix longname searches that span a block/cluster. libkosfat: Fix yet more issues with handling cross-block/cluster longname entries. Merge pull request #16 from duckinator/patch-1 Merge pull request #20 from Kazade/thd-each Add dirname() and basename() functions. Update copyrights for 2020. Goodbye -fno-strict-aliasing. Merge pull request #21 from andressbarajas/master Rename st_*time members in fs_dcload's stat structure. Get rid of the use of _EXFUN. Add __assert_func function. Add types to sys/_types.h that newer versions of Newlib expect. Add fd_set and friends to sys/select.h, as it is no longer defined in sys/types.h in Newlib. Don't use __FUNCTION__ in assert in standard-compliant mode. Remove -Werror from addons. Don't cause circular includes to break things badly. Apparently init and fini got renamed at some point. Only build crtend/crtbegin on GCC 3... Not everything except GCC 4. Add experimental dc-chain patches for GCC 9.2.0 and Newlib 3.3.0. Add sched_yield function to libc/koslib. Fix init.c for GCC 4.x again. Fix redefinition of BYTE_ORDER between <arch/types.h> and <arch/byteorder.h>. Add a __fallthrough attribute to the <kos/cdefs.h> file. Tag all fall-throughs in libppp switch statements explicitly. Clean up implicit fallthroughs in the kernel tree. Fix a few more fall-through cases that GCC didn't complain about. Add initial support for the NAOMI and NAOMI 2 arcade systems with a NetDIMM board attached. Init a few more things normally for NAOMI. Add pvr_set_zclip() function. More work on NAOMI support. Add simple util to parse NAOMI NetDIMM binaries and print out some header information from them. Update changelog. Updates to dc-chain. This update is a big one. Cut out useless stuff from dc-chain's gcc 9.3.0 patch. Merge pull request #24 from einsteinx2/gcc9-fix Merge pull request #25 from einsteinx2/dc-chain-prefer-curl Fix a comment. Add C++ guards around <sys/dirent.h>. Add __va_list definition to sys/_types.h. Merge pull request #29 from andressbarajas/master Merge pull request #30 from andressbarajas/master Merge pull request #31 from andressbarajas/master Add mini font for use when you really don't want the biosfont for some reason. Fix drawing with minifont. Don't build things on naomi that we don't need and fix the exports to not cause naomi compile errors. Add public header for minifont. Add fb_console_naomi, which uses minifont to draw dbgio to the framebuffer. Remove reference to lwIP from hello example. Add simple minifont example. Add minifont to the examples to be built in video. Update CHANGELOG. Remove comment about dma not being supported in g1ata, since it hasn't been true for a long time... Add weird DMA shenanigans to startup on the NAOMI. Ensure the maple DMA buffer can be anywhere in ram on the NAOMI. Merge pull request #33 from andressbarajas/master Merge pull request #36 from sizious/master Merge pull request #38 from andressbarajas/snd_stream Merge pull request #37 from andressbarajas/filesystem Merge pull request #39 from andressbarajas/master Remove lwip/dcload-ip-lwip-test and lwip/dns-client examples. Remove fs_dclnative stuff from kos/opts.h. Move lwip/http example to the network examples directory. Fix network/httpd example to compile against the built-in network stack. Merge pull request #44 from tsowell/libkosfat-fixes Merge pull request #42 from andressbarajas/vmu_icons Clean up formatting, rename BFONT_VICON_* -> BFONT_ICON_*, and fix NAOMI compilation of the vmu.c file. Make time_t 64-bits on Newlib 3.0 and newer. Fix Newlib 3.3.0 patch to use a sensible type for ino_t. Fix sem_init argument checking issue. Merge pull request #45 from sizious/makeip-auto-build Rename naomibin -> naomibintool. Rewrite of naomibintool based on DragonMinded's documentation. Add binary building to the naomi bin tool. Build naomibintool with the rest of utils. Add built naomibintool to the .gitignore. Add elf parsing to naomibintool for building binaries. Make getopt() return ':' on an option being passed without its argument. Add naominetboot tool. Bring the AICA communication structs out to a public header. Merge branch 'master' into adventure-example-update Merge pull request #48 from sizious/adventure-example-update Merge pull request #47 from mrneo240/genromfs_mingw Fix repository location in bsd/README.md Update cygwin/README.md Update linux/alpine.md Update linux/debian.md Update macos/README.md Update mingw/mingw-w64.md Update mingw/mingw.md Merge pull request #46 from sizious/dc-chain-upgrade Don't build naomibintool or naominetboot when not building for NAOMI. Document the libelf requirement for NAOMI. Fix Sega corporate name in disclaimers. Don't try to use <sys/sysmacros.h> on BSD, Cygwin, or mac. Merge pull request #49 from sizious/dc-chain-config-mk-update Fix kern_version generation on git revisions. Add banner.h to the .gitignore. Fix crash caused by double-initting maple devices. Add user data to the sound stream structure and an accessor/mutator for it. Add stack protector stuff to newlib 3.3.0 patch. Add GCC -fstack-protector example. Merge pull request #50 from KallistiOS/pvr-buffers-fix Merge pull request #51 from KallistiOS/pvr-buffer-bugfix Merge pull request #52 from 7dog123/master Merge pull request #56 from Tchan0/NaomiNetBootUsage Merge pull request #55 from Tchan0/DynamicSubArch Update IRC channel location. Update license banner copyright year. Update AUTHORS and banner year (again). Merge pull request #59 from Tchan0/Rename_Main_c_files_in_Examples Merge pull request #60 from Tchan0/Add_Missing_Examples_In_Make_All Merge pull request #58 from Tchan0/Add_Missing_Utils_In_Make Merge pull request #61 from Tchan0/Improve_Consistency_Of_PVR_Texture_Render_Example Merge pull request #62 from Tchan0/Clean_SDL_Sound_Example Merge pull request #63 from Tchan0/Add_DC_ARM_Wrappers Merge pull request #65 from gameblabla/fix_adpcm_tool Merge pull request #66 from sizious/utils-update Merge pull request #67 from gameblabla/spu_dma_fix_megavolt85 Merge pull request #64 from Tchan0/add_missing_start_to_kgl_examples Unlock TLS spinlock on key error in kthread_setspecific. A bit of warning cleanup (mostly implicit function definitions). Add simple implementation of _times_r. Merge pull request #76 from ArtemioUrbina/master Remove '-J' flag from cURL command in dc-chain. Update dc-chain readme to mention pitfalls of using older versions... dc-chain: Document that bash is required for the download/unpack scripts. Add note about unsignedness of returns from fs_total and fs_total64. Merge pull request #79 from extremobemo/master Merge pull request #80 from darcagn/biosfix Merge pull request #82 from darcagn/32mb-mk4 Merge pull request #84 from gyrovorbis/pvrmark Remove 'navi' subarch and move all code for it to addons/libnavi. Move historical versions of dc-chain patches out of the way. Update CHANGELOG for the past two years or so... Remove vestiges of ancient GCC versions. Update CHANGELOG, FAQ, and RELNOTES. Merge pull request #86 from darcagn/master Add missing directory to libnavi Merge branch 'master' of github.com:KallistiOS/KallistiOS Merge pull request #87 from darcagn/master Merge pull request #92 from gyrovorbis/gcc-version Merge pull request #99 from cepawiel/stackprotector_example Merge pull request #100 from Dreamcast-Projects/master Merge pull request #101 from DC-SWAT/master Merge pull request #88 from KallistiOS/dont-panic-on-oom Merge pull request #104 from DC-SWAT/spi-sd Style fixes and such. Merge pull request #114 from Dreamcast-Projects/master Merge pull request #112 from sizious/dc-chain-mingw-w64-patches Merge pull request #109 from KallistiOS/implement-dev-urandom Merge pull request #131 from KallistiOS/cpp_enable_rtti_exceptions Merge pull request #132 from KallistiOS/modem_inline_static Add <stdint.h> to newlib_getentropy.c. Merge pull request #128 from cepawiel/seperate-build-folders Merge pull request #136 from cepawiel/random-gcc4 Call fs_dev_shutdown() and make sure no linker errors come up later. Merge pull request #137 from cepawiel/dcchain-disable-patching Merge pull request #138 from KallistiOS/authors-change Add timespec_get to libc/c11. timespec_get: add back in missing return. Move <kos/time.h> include to ensure it always can be accessed from <time.h> Merge pull request #139 from Dreamcast-Projects/master Merge pull request #91 from gyrovorbis/cmake Merge pull request #141 from KallistiOS/cpp_time Merge pull request #140 from Dreamcast-Projects/master Merge pull request #110 from DC-SWAT/g1ata Merge branch 'master' into lto Merge pull request #134 from pcercuei/lto Merge pull request #147 from Dreamcast-Projects/master Merge pull request #148 from cepawiel/macos-gdb Merge pull request #152 from Dreamcast-Projects/fix_append Merge pull request #122 from cepawiel/exit-with-dtors Merge pull request #160 from KallistiOS/patches-copyright-update Merge pull request #166 from KallistiOS/newlib_config_options Merge pull request #161 from KallistiOS/libdream_examples_fix Merge pull request #155 from cepawiel/dc-chain-sources-from-git Merge branch 'master' into quzar_video_cleanup Merge pull request #150 from KallistiOS/quzar_video_cleanup Merge pull request #40 from Dreamcast-Projects/controller_cbs Merge pull request #168 from KallistiOS/enter_the_void Merge branch 'master' into dcload-exit-return-code Merge pull request #170 from cepawiel/dcload-exit-return-code Merge pull request #171 from KallistiOS/outer_space Merge pull request #174 from cepawiel/arm-toolchain-optional Merge pull request #175 from KallistiOS/try_hard Merge pull request #180 from KallistiOS/suppressor Merge pull request #178 from KallistiOS/ack_to_asics Merge pull request #176 from KallistiOS/hostile_threads Merge pull request #183 from sizious/dc-chain-mingw-binutils-2.34-lto-bugfix-patches Merge pull request #190 from pcercuei/fix-kos-objcopy Merge pull request #186 from KallistiOS/dont_call_me_null Merge pull request #187 from KallistiOS/ifn_bba Merge pull request #188 from KallistiOS/safer_methods Merge pull request #191 from KallistiOS/trout_parens Update .S rule in Makefile.rules to go through kos-cc, not kos-as. Merge pull request #189 from pcercuei/stack-size-and-init Formatting cleanup and adding to CHANGELOG. Merge pull request #192 from cepawiel/remove-insight Merge pull request #194 from jpeach/dc-chain-use-mirrors Merge pull request #196 from kouta-kun/patch-1 Merge pull request #197 from KallistiOS/newline Merge pull request #198 from KallistiOS/objc-chain-fix Merge pull request #199 from pcercuei/fix-pcercuei-mess Remove g1ata stuff from naomi exports. Merge pull request #203 from KallistiOS/filling_GAPS Merge pull request #206 from KallistiOS/threads_doxygen Merge pull request #210 from KallistiOS/petty-locks Merge pull request #211 from jpeach/bin2o-robust Update copyright years in banner.c Merge pull request #219 from pcercuei/better-fipr Merge pull request #222 from KallistiOS/fast_math_flags Merge pull request #223 from pcercuei/vmu-draw-lcd-rotated Merge pull request #226 from pcercuei/vmufb Merge pull request #231 from KallistiOS/Draw_Button Merge pull request #217 from KallistiOS/safe_arches Merge pull request #233 from cepawiel/dc-chain-download Add new init flags headers. Update examples to account for <kos/init.h> header. Update changelog for init flags header change Fix examples that fail to compile due to missing headers. Take two with more missing headers. Merge pull request #237 from KallistiOS/bfont-example-fix Merge pull request #240 from KallistiOS/split-patch Merge pull request #247 from KallistiOS/cpp17_attributes_in_decl_specifiers Merge pull request #249 from jpeach/doc-cont_btn_callback Merge pull request #248 from jpeach/bfont-str-const Merge pull request #245 from KallistiOS/missed_the_void Merge pull request #251 from KallistiOS/arpfix Merge pull request #250 from KallistiOS/maxfnlen Merge pull request #252 from KallistiOS/make_clean Merge pull request #254 from KallistiOS/gdb-13.2 Merge pull request #257 from KallistiOS/newstable Merge pull request #246 from KallistiOS/non-magical_map Merge pull request #269 from KallistiOS/timer-macro-comments Merge pull request #258 from KallistiOS/matching_prereqs Merge pull request #272 from sizious/dc-chain-mingw-gdb-10.2 Add spinlock_trylock macro. Simplify kthread_once_t into a simple variable rather than a struct. Small cleanups to thread.h and thread.c. Add missing #include <kos/thread.h> to libppp/ppp_modem.c Merge pull request #279 from KallistiOS/libppp-missing-include Merge pull request #277 from KallistiOS/tiny-thread-cleanups Add missing includes to a few more more files. Merge pull request #280 from KallistiOS/add-more-missing-includes Add definition of restrict to <kos/cdefs.h> for C++. Update CHANGELOG Might as well make this work if you ask for c89/c90/ansi-c as well... Oops... We already have __RESTRICT. Move it to a more appropriate place and use it. Update CHANGELOG again Merge pull request #282 from KallistiOS/cplusplus-apparently-hates-optimizations-based-on-pointers Simplify the structures of some sync primitives. (#281) Formatting cleanup of store queue code. Merge pull request #285 from KallistiOS/sq-formatting Merge pull request #289 from snickerbockers/master Merge pull request #286 from KallistiOS/kos_cmake Merge pull request #303 from pcercuei/update-libtsunami-examples Merge pull request #302 from KallistiOS/wav_warnings Merge pull request #300 from KallistiOS/thd_each_retval Merge pull request #298 from KallistiOS/c99_atomics Merge pull request #310 from KallistiOS/cmake_atomics Merge pull request #309 from KallistiOS/kos-w-9.5.0 Merge pull request #311 from cepawiel/make_fix Rework once controls, once again. Merge pull request #318 from Tchan0/LAN_adapter_dont_register_if_not_present Merge pull request #322 from KallistiOS/matrix_alignment Merge pull request #339 from KallistiOS/abortused Merge pull request #338 from KallistiOS/timerfix Merge pull request #340 from DC-SWAT/snd_sfx_fmt Merge pull request #349 from pcercuei/romdisks Merge pull request #361 from has207/getsockopt Fix comment to C89/C90 style. Merge pull request #362 from Dreamcast-Projects/fix_compile Merge pull request #365 from KallistiOS/thread_mode_warning Merge pull request #371 from KallistiOS/setsockopt Merge pull request #364 from DC-SWAT/snd_thread_safe Add netinet/tcp.h file and update documentation to reflect it. Add TCP_NODELAY into setsockopt/getsockopt. Update CHANGELOG Add <netinet/udp.h> and <netinet/udplite.h> headers. Merge pull request #375 from DC-SWAT/g1_ata_select Merge pull request #376 from sizious/elf2bin Merge pull request #377 from DC-SWAT/gd_init Merge pull request #380 from KallistiOS/readme_update Merge pull request #381 from pcercuei/kos_init_flags_cpp Merge pull request #387 from sizious/utils-update Merge pull request #383 from KallistiOS/wdt_doxygen_update Update examples/dreamcast/network/ntp/ntp.c Merge pull request #392 from KallistiOS/ntp_example Merge pull request #374 from Dreamcast-Projects/thdswitch_speed Merge pull request #405 from KallistiOS/out_of_memory_update Merge pull request #409 from kilgariff/master Merge pull request #417 from KallistiOS/expanded_map Merge pull request #421 from KallistiOS/likely_unlikely_rename Merge pull request #428 from KallistiOS/bba_doxygen_topics Merge pull request #423 from KallistiOS/clock_CLOCKS_PER_SEC_upgrade Merge pull request #429 from KallistiOS/800x600_notice Merge pull request #431 from KallistiOS/multibyte_iconv Merge pull request #440 from KallistiOS/init_mallocstats_fix Merge pull request #442 from KallistiOS/over_600 Merge pull request #444 from KallistiOS/kgl_nehe_fix Merge pull request #449 from KallistiOS/newnewlib Merge pull request #455 from KallistiOS/abort_retval Merge pull request #458 from KallistiOS/cmake_update Merge pull request #451 from KallistiOS/chain-upgrades Merge pull request #463 from KallistiOS/more_cmake Merge pull request #468 from KallistiOS/binutils_disable_nls Merge pull request #469 from OniEnzeru/master Merge pull request #465 from KallistiOS/console_newlines Merge pull request #472 from KallistiOS/assert_doxygen Merge pull request #477 from KallistiOS/new_binutils Merge pull request #478 from KallistiOS/hostshared Merge pull request #481 from KallistiOS/define_safe Merge pull request #482 from Tchan0/Naomi_Allow_dcload Merge pull request #485 from Tchan0/dockerfile_add_alternate_github_url Merge pull request #487 from KallistiOS/m4-single-only-fix Merge pull request #486 from KallistiOS/libpng_bug_note Merge pull request #489 from dkm/dkm/tune_gcc_config Merge pull request #488 from DC-SWAT/pvr_typos_fix Merge pull request #492 from KallistiOS/mb_cleanup Merge pull request #491 from KallistiOS/gdb142 Merge pull request #495 from KallistiOS/posix_clock_declarations Merge branch 'master' into cmake_sysroot Merge pull request #496 from KallistiOS/cmake_sysroot Merge pull request #497 from pcercuei/gcc-disable-doc Merge pull request #500 from KallistiOS/gcc14cppfix Merge pull request #524 from KallistiOS/kbd_atomics_fix Merge pull request #519 from KallistiOS/warnings_fixes Merge pull request #493 from KallistiOS/No_u_dev Merge pull request #527 from Dreamcast-Projects/fix_example_warns Merge pull request #525 from KallistiOS/treeless-clone Merge pull request #528 from pcercuei/bin-rule Merge pull request #591 from KallistiOS/mingccver Merge pull request #643 from pcercuei/fix-mutexes Luke Benstead (40): Add a patch to allow compiling GCC 4.7.3 with GCC 5+ Add a thd_each function for iterating the current threads Add gcc 4.7.4 patch with concurrence error fix, and update versions Remove broken 4.7.3 patch Merge pull request #23 from Kazade/concurrence_lock_error Fix vram wastage in pvr buffer alloc code due to an error in the tile matrix setup Correctly set addresses for all lists Clean up Implement getsockopt for TCP and UDP Merge pull request #68 from Kazade/master Fix an incorrect sizeof() statement that caused corruption Merge pull request #69 from KallistiOS/fix-sizeof-issue-in-fs-dclsocket Add a modem PPP example Reset mintCounter when we reset the timeout Add a FIXME Fix incorrect TXFNF register Merge pull request #74 from KallistiOS/modem-tx-fixes Fix invalid read issue when clearing packets Allow sending packets if the IP address is 0.0.0.0 Attempt to lease any specified IP address via DHCP Clean up the passing of required_address to use 0 as a non value Ensure the DHCP options area is at least 64 bytes as per BOOTP RFC If ISP settings are static, populate whatever we can Supply a default broadcast of 255.255.255.255 if it's not available Small cleanup Change first retransmission to 4 seconds (as per spec) Fix reading network method from block 0xE0 Partially read block 0xC6-C9 Merge pull request #70 from KallistiOS/fix-dhcp-issues Return -1 and set ENO... [truncated message content] |
From: quzar <qu...@us...> - 2024-09-21 23:09:02
|
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, v2.1.0 has been created at 52140509f51a9d262ea75353f2eb0f7e18c2ec6b (commit) - Log ----------------------------------------------------------------- commit 52140509f51a9d262ea75353f2eb0f7e18c2ec6b Author: Falco Girgis <gyr...@gm...> Date: Sat Sep 21 16:59:08 2024 -0500 Updated the version number for KOS 2.1.0. (#750) commit ee1a623246106ce265e22d20b990b6774b082eec Author: QuzarDC <qu...@co...> Date: Sat Sep 21 18:04:48 2024 -0400 Truncate changelog to match v2.1.0 commit 6a2b5cda888b1363a567a238424dd0cec4dedc3e Author: Donald Haase <qu...@ya...> Date: Sat Sep 21 17:58:09 2024 -0400 Docs update (#747) * Huge update of docs primarily authored by darcagn. Mostly formatting, but a lot of minor fixups. * Significant content updates for license info to better coincide with current KOS (a lot no longer applied or made sense). * Updates to relnotes for v2.1.0 --------- Co-authored-by: darcagn <da...@pr...> commit 3498070b78578abcf48fb9983c787e8b5235e6d4 Author: darcagn <da...@pr...> Date: Tue Sep 3 22:23:30 2024 -0500 Fix typos in environ.sh (#733) Just changing -0* typos to -O. commit 38b0e140c05a4496cefe69dac5a19d97dcc23f1f Author: Paul Cercueil <pa...@cr...> Date: Thu Aug 8 16:08:00 2024 +0200 thread: Mark thd_pass() as __used This fixes atomics when building with LTO. Signed-off-by: Paul Cercueil <pa...@cr...> commit 3928de06b9024432c352129738246daef2c59137 Author: Paul Cercueil <pa...@cr...> Date: Thu Aug 8 16:06:13 2024 +0200 init: Mark arch_init() as __used And add the __noreturn that was missing to the implementation. Without the __used and when using LTO, some programs may have undefined references to arch_init(). Signed-off-by: Paul Cercueil <pa...@cr...> commit cd959f642c6bd6eb5a1199b1dbf4c354f3fc5a7f Author: darcagn <da...@pr...> Date: Mon Aug 12 07:17:13 2024 -0500 dc-chain: Fix ARM toolchain build error when JIT is enabled for SH toolchain (#709) commit 07087babf0fab5f22970eb0324e6ca96e9b02bc6 Author: Andy Barajas <and...@gm...> Date: Fri Aug 9 21:29:25 2024 -0700 Remove g1ata mutex use in biosfont (#700) Removed mutex from biosfont because it causes an issue in DS bootloader as well as give the ability to use biofonts inside of an IRQ context commit 06f5fc87c1696560b1e7e252c0cad7e03c7fa3dc Author: Falco Girgis <gyr...@gm...> Date: Thu Aug 8 06:19:46 2024 -0500 Manually aligned PVR primitives to 32-bytes (#678) This is necessary to leverage the "fast" store-queue path for pvr_prim(), and everyone doing any level of performance work is having to manually align every single vertex at the time of declaration... time to fix this in KOS itself like we did for matrix_t.` 1) Aligned all PVR vertex types to 32-bytes. 2) Aligned all PVR header types to 32-bytes. commit b825d67c2d2a3a573b9894974b5ad3d41d33cfac Author: Andy Barajas <and...@gm...> Date: Fri Aug 9 20:48:21 2024 -0700 Fix -Wmaybe-uninitialize warning (#701) commit fd7b4e43c81993270508e3a945fd61be88a7048c Author: darcagn <da...@pr...> Date: Wed Aug 7 16:39:30 2024 -0500 dc-chain: Updates to profiles and patches (#695) - GCC 11.x profile updated to 11.5.0 - Binutils updated to 2.43 for all non-legacy toolchains - Patch offsets updated to cleanly patch GCC 15.0.0-dev toolchain ----------------------------------------------------------------------- hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-09-21 21:59: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, no_c_std_for_cpp has been created at 66112d10551107a433fe2442a4b63957c1250034 (commit) - Log ----------------------------------------------------------------- commit 66112d10551107a433fe2442a4b63957c1250034 Author: Falco Girgis <gyr...@gm...> Date: Tue Sep 10 23:39:48 2024 -0500 Fixed KOS's Makefile.rules. They were incorrect and were causing really annoying warnings on other projects, such as GTA3, where C++ was warning that "-std=gnu17" is only available in C++. How does this happen? Because our Makefile.rules file was INCORRECTLY concatenating CFLAGS and CXXFLAGS and sending them to the C++ compiler. This is incorrect. Those two are separate and should go to their respective compilers only; however, CPPFLAGS is supposed to be common, shared, preprocessor flags that go to both. - Removed CFLAGS from C++ rules - Added CPPFLAGS to C, C++, ObjC, and ObjC++ rules ----------------------------------------------------------------------- hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-09-18 00:54: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 fd9f323eeddea8970ec595ca49cb40e68b208520 (commit) from 8e783b8ae5c54b510efa7f958aa37fa6fb17041b (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 fd9f323eeddea8970ec595ca49cb40e68b208520 Author: Andy Barajas <and...@gm...> Date: Tue Sep 17 17:46:30 2024 -0700 Add getpeername() (#718) Added getpeername to sockets to help with cURL kos-port ----------------------------------------------------------------------- Summary of changes: include/kos/fs_socket.h | 33 ++++++++++++++----- include/sys/socket.h | 32 ++++++++++++++++++ kernel/fs/fs_socket.c | 24 ++++++++++++++ kernel/net/net_tcp.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ kernel/net/net_udp.c | 76 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 244 insertions(+), 8 deletions(-) diff --git a/include/kos/fs_socket.h b/include/kos/fs_socket.h index 46285cfc..bd58ea2d 100644 --- a/include/kos/fs_socket.h +++ b/include/kos/fs_socket.h @@ -325,17 +325,34 @@ typedef struct fs_socket_proto { Currently all options (regardless of level) are passed onto the protocol handler. - \param s The socket to get the name of. - \param name Pointer to a sockaddr structure which will hold - the resulting address information. - \param name_len The amount of space pointed to by name, in - bytes. On return, this is set to the actual size - of the returned address information. - \retval -1 On error (set errno appropriately). - \retval 0 On success. + \param s The socket to get the name of. + \param name Pointer to a sockaddr structure which will hold + the resulting address information. + \param name_len The amount of space pointed to by name, in + bytes. On return, this is set to the actual size + of the returned address information. + \retval -1 On error (with errno set appropriately). + \retval 0 On success. */ int (*getsockname)(net_socket_t *s, struct sockaddr *name, socklen_t *name_len); + /** \brief Get the name of the peer connected to a socket created with the + protocol. + + This function should implement the ::getpeername() system call for the + protocol. The semantics are exactly as expected for that function. + + \param s The socket from which to get the peer address. + \param name Pointer to a sockaddr structure which will hold + the resulting address information. + \param name_len The amount of space pointed to by name, in + bytes. On return, this is set to the actual size + of the returned address information. + \retval -1 On error (with errno set appropriately). + \retval 0 On success. + */ + int (*getpeername)(net_socket_t *s, struct sockaddr *name, socklen_t *name_len); + /** \brief Manipulate file options. This function should implement the fcntl() system call for the given diff --git a/include/sys/socket.h b/include/sys/socket.h index 40744199..da174d27 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -387,6 +387,38 @@ int socket(int domain, int type, int protocol); */ int getsockname(int socket, struct sockaddr *name, socklen_t *name_len); +/** + \brief Get the name of the connected peer socket. + + This function retrieves the address of the peer connected to the socket + specified by the socket descriptor. The address is returned in the buffer + pointed to by the name parameter, and the actual length of the address is + returned in the name_len parameter. + + \param socket A socket that is already connected to a peer. + \param name A pointer to a sockaddr structure where the peer + address will be stored. + \param name_len A pointer to a socklen_t variable that specifies the + length of the address structure. + On return, it will contain the actual size of the + address returned. + + \retval 0 On success. + \retval -1 On error, sets errno as appropriate, such as: + - EBADF: The socket argument is not a valid file + descriptor. + - EFAULT: The addr argument points to memory not in a + valid part of the process address space. + - ENOBUFS: Insufficient resources were available in the + system to perform the operation. + - ENOTCONN: The socket is not connected. + - ENOTSOCK: The socket argument does not refer to a + socket. + - EOPNOTSUPP: The socket does not support getpeername. +*/ +int getpeername(int socket, struct sockaddr *__RESTRICT name, + socklen_t *__RESTRICT name_len); + /** \brief Get socket options. This function retrieves options associated with a socket. This function diff --git a/kernel/fs/fs_socket.c b/kernel/fs/fs_socket.c index 7465e890..8f766811 100644 --- a/kernel/fs/fs_socket.c +++ b/kernel/fs/fs_socket.c @@ -542,6 +542,30 @@ int getsockname(int sock, struct sockaddr *name, socklen_t *name_len) { return hnd->protocol->getsockname(hnd, name, name_len); } +int getpeername(int sock, struct sockaddr *__RESTRICT name, socklen_t *__RESTRICT name_len) { + net_socket_t *hnd; + + hnd = (net_socket_t *)fs_get_handle(sock); + + if(hnd == NULL) { + errno = EBADF; + return -1; + } + + /* Make sure this is actually a socket. */ + if(fs_get_handler(sock) != &vh) { + errno = ENOTSOCK; + return -1; + } + + if(!hnd->protocol->getpeername) { + errno = EOPNOTSUPP; + return -1; + } + + return hnd->protocol->getpeername(hnd, name, name_len); +} + int getsockopt(int sock, int level, int option_name, void *option_value, socklen_t *option_len) { net_socket_t *hnd; diff --git a/kernel/net/net_tcp.c b/kernel/net/net_tcp.c index 9e0fe06b..f4902d61 100644 --- a/kernel/net/net_tcp.c +++ b/kernel/net/net_tcp.c @@ -1797,6 +1797,92 @@ ret_success: return 0; } +static int net_tcp_getpeername(net_socket_t *hnd, struct sockaddr *name, socklen_t *name_len) { + struct tcp_sock *sock; + struct sockaddr_in realaddr; + struct sockaddr_in6 realaddr6; + + if(!name || !name_len) { + errno = EFAULT; + return -1; + } + + if(irq_inside_int()) { + if(rwsem_read_trylock(&tcp_sem)) { + errno = EWOULDBLOCK; + return -1; + } + } else { + rwsem_read_lock(&tcp_sem); + } + + if(!(sock = (struct tcp_sock *)hnd->data)) { + rwsem_read_unlock(&tcp_sem); + errno = EBADF; + return -1; + } + + if(irq_inside_int()) { + if(mutex_trylock(&sock->mutex)) { + rwsem_read_unlock(&tcp_sem); + errno = EWOULDBLOCK; + return -1; + } + } else { + mutex_lock(&sock->mutex); + } + + if(sock->state == TCP_STATE_CLOSED) { + mutex_unlock(&sock->mutex); + rwsem_read_unlock(&tcp_sem); + errno = ENOTCONN; + return -1; + } + + if(sock->domain == AF_INET) { + memset(&realaddr, 0, sizeof(struct sockaddr_in)); + realaddr.sin_family = AF_INET; + realaddr.sin_addr.s_addr = + sock->remote_addr.sin6_addr.__s6_addr.__s6_addr32[3]; + realaddr.sin_port = sock->remote_addr.sin6_port; + + if(*name_len <= sizeof(struct sockaddr_in)) { + /* Passed in a structure not big enough so truncate*/ + memcpy(name, &realaddr, *name_len); + errno = ENOBUFS; + } else { + memcpy(name, &realaddr, sizeof(struct sockaddr_in)); + *name_len = sizeof(struct sockaddr_in); + goto ret_success; + } + } else if(sock->domain == AF_INET6) { + memset(&realaddr6, 0, sizeof(struct sockaddr_in6)); + realaddr6.sin6_family = AF_INET6; + realaddr6.sin6_addr = sock->remote_addr.sin6_addr; + realaddr6.sin6_port = sock->remote_addr.sin6_port; + + if(*name_len <= sizeof(struct sockaddr_in6)) { + /* Passed in a structure not big enough */ + memcpy(name, &realaddr6, *name_len); + errno = ENOBUFS; + } else { + memcpy(name, &realaddr6, sizeof(struct sockaddr_in6)); + *name_len = sizeof(struct sockaddr_in6); + goto ret_success; + } + } + + mutex_unlock(&sock->mutex); + rwsem_read_unlock(&tcp_sem); + errno = ENOTSOCK; + return -1; + +ret_success: + mutex_unlock(&sock->mutex); + rwsem_read_unlock(&tcp_sem); + return 0; +} + static int net_tcp_fcntl(net_socket_t *hnd, int cmd, va_list ap) { struct tcp_sock *sock; @@ -2871,6 +2957,7 @@ static fs_socket_proto_t proto = { net_tcp_getsockopt, /* getsockopt */ net_tcp_setsockopt, /* setsockopt */ net_tcp_getsockname, /* getsockname */ + net_tcp_getpeername, /* getpeername */ net_tcp_fcntl, /* fcntl */ net_tcp_poll /* poll */ }; diff --git a/kernel/net/net_udp.c b/kernel/net/net_udp.c index 9a7e5fc8..6e812680 100644 --- a/kernel/net/net_udp.c +++ b/kernel/net/net_udp.c @@ -960,6 +960,80 @@ ret_success: return 0; } +static int net_udp_getpeername(net_socket_t *hnd, struct sockaddr *name, socklen_t *name_len) { + struct udp_sock *sock; + struct sockaddr_in realaddr; + struct sockaddr_in6 realaddr6; + + if(!name || !name_len) { + errno = EFAULT; + return -1; + } + + if(irq_inside_int()) { + if(mutex_trylock(&udp_mutex) == -1) { + errno = EWOULDBLOCK; + return -1; + } + } else { + mutex_lock(&udp_mutex); + } + + if(!(sock = (struct udp_sock *)hnd->data)) { + mutex_unlock(&udp_mutex); + errno = EBADF; + return -1; + } + + /* If the socket is not connected, return an error */ + if(IN6_IS_ADDR_UNSPECIFIED(&sock->remote_addr.sin6_addr) || sock->remote_addr.sin6_port == 0) { + mutex_unlock(&udp_mutex); + errno = ENOTCONN; + return -1; + } + + /* Depending on the socket domain, return the appropriate address structure */ + if(sock->domain == AF_INET) { + memset(&realaddr, 0, sizeof(struct sockaddr_in)); + realaddr.sin_family = AF_INET; + realaddr.sin_addr.s_addr = sock->remote_addr.sin6_addr.__s6_addr.__s6_addr32[3]; + realaddr.sin_port = sock->remote_addr.sin6_port; + + if(*name_len <= sizeof(struct sockaddr_in)) { + /* Passed in a structure not big enough so truncate*/ + memcpy(name, &realaddr, *name_len); + errno = ENOBUFS; + } else { + memcpy(name, &realaddr, sizeof(struct sockaddr_in)); + *name_len = sizeof(struct sockaddr_in); + goto ret_success; + } + } else if(sock->domain == AF_INET6) { + memset(&realaddr6, 0, sizeof(struct sockaddr_in6)); + realaddr6.sin6_family = AF_INET6; + realaddr6.sin6_addr = sock->remote_addr.sin6_addr; + realaddr6.sin6_port = sock->remote_addr.sin6_port; + + if(*name_len <= sizeof(struct sockaddr_in6)) { + /* Passed in a structure not big enough */ + memcpy(name, &realaddr6, *name_len); + errno = ENOBUFS; + } else { + memcpy(name, &realaddr6, sizeof(struct sockaddr_in6)); + *name_len = sizeof(struct sockaddr_in6); + goto ret_success; + } + } + + mutex_unlock(&udp_mutex); + errno = ENOTSOCK; + return -1; + +ret_success: + mutex_unlock(&udp_mutex); + return 0; +} + static int net_udp_fcntl(net_socket_t *hnd, int cmd, va_list ap) { struct udp_sock *sock; long val; @@ -1433,6 +1507,7 @@ static fs_socket_proto_t proto = { net_udp_getsockopt, net_udp_setsockopt, net_udp_getsockname, + net_udp_getpeername, net_udp_fcntl, net_udp_poll }; @@ -1455,6 +1530,7 @@ static fs_socket_proto_t proto_lite = { net_udp_getsockopt, net_udp_setsockopt, net_udp_getsockname, + net_udp_getpeername, net_udp_fcntl, net_udp_poll }; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-09-17 02:51: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 8e783b8ae5c54b510efa7f958aa37fa6fb17041b (commit) from b14b8d0a8f9d9949277637894be77958c4126f0a (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 8e783b8ae5c54b510efa7f958aa37fa6fb17041b Author: darcagn <da...@pr...> Date: Mon Sep 16 21:43:27 2024 -0500 Prevent thd_shutdown() from destroying kernel thread (#757) ----------------------------------------------------------------------- Summary of changes: kernel/thread/thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index 319149de..017279fd 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -1131,7 +1131,8 @@ void thd_shutdown(void) { /* Kill remaining live threads */ LIST_FOREACH_SAFE(cur, &thd_list, t_list, tmp) { - thd_destroy(cur); + if(cur->tid != 1) + thd_destroy(cur); } sem_destroy(&thd_reap_sem); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-09-17 02:19: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 b14b8d0a8f9d9949277637894be77958c4126f0a (commit) via 35e5abd1dc778fb45364275d9d629a71a2b1c856 (commit) via 63b9b9637bd67af8702b40eb0c5389d4f9c21e50 (commit) via 73f9d0ee9faad816bceb2d76fad185808f53cbb2 (commit) via 51e5ffb2a4cdeaf04c119bd133124b26c716f172 (commit) via 2a32b2151a48e051ad091923145f001f4d411c8b (commit) via 30fc866daabd75ed216220a223bb9c0ae9ab9365 (commit) via d8417b4a9a2d3a130f023a8b321190f474436078 (commit) via 86165fbb8d94f083d23437bf86abb697948f119b (commit) via ce249f9a3d72a38b999550065e1c22a00366a74d (commit) via 8a240ed9d9066088a7216ccc11e27425ce141b14 (commit) via 089b5b315e35e9df84ad04f783913d57f4485797 (commit) via bab7e8890ada902608afd34613b988bb34cfed17 (commit) via 06011e1bf40adda17f271741eab65d606a923f95 (commit) via bf189670e954d9036b772d66c823a9f4b6c93c6f (commit) via bab4b3c363b4dc8e84ccb120467f0026df64062b (commit) via e8a3a8539e6fed103cc65e7dd46671e865e25a44 (commit) via 3acda030702cf823712851b296b7591899d8faee (commit) via dccd296d9cfa6fdc396f6c1472518e87216b68cb (commit) via 161ab3fcd7608fb9ff5a0f695c9ed19bc8534122 (commit) from 01555798061d1fbb552dfef251989b2e0555c472 (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 b14b8d0a8f9d9949277637894be77958c4126f0a Merge: 63b9b963 35e5abd1 Author: Donald Haase <qu...@ya...> Date: Mon Sep 16 22:18:48 2024 -0400 Merge pull request #637 from pcercuei/irqsafe Add IRQ-safe mutex / rwsem functions, and scoped mutexes commit 35e5abd1dc778fb45364275d9d629a71a2b1c856 Merge: ce249f9a 63b9b963 Author: Donald Haase <qu...@ya...> Date: Mon Sep 16 22:16:15 2024 -0400 Merge branch 'master' into irqsafe commit 63b9b9637bd67af8702b40eb0c5389d4f9c21e50 Merge: 73f9d0ee 2a32b215 Author: Luke Benstead <ka...@gm...> Date: Sat Sep 7 18:23:00 2024 +0100 Merge pull request #741 from skmp/fixed_aica_lut aica: Fix the volume LUT commit 73f9d0ee9faad816bceb2d76fad185808f53cbb2 Merge: 01555798 51e5ffb2 Author: Luke Benstead <ka...@gm...> Date: Sat Sep 7 18:15:47 2024 +0100 Merge pull request #742 from skmp/aica_channel_shifts aica: Channel masks are 64 bits, use ULL consts commit 51e5ffb2a4cdeaf04c119bd133124b26c716f172 Author: Stefanos Kornilios Mitsis Poiitidis <sk...@ni...> Date: Sat Sep 7 19:25:08 2024 +0300 aica: Channel masks are 64 bits, use ULL consts commit 2a32b2151a48e051ad091923145f001f4d411c8b Author: Stefanos Kornilios Mitsis Poiitidis <sk...@ni...> Date: Sat Sep 7 10:57:23 2024 +0300 aica: remove not required masking from log lookup commit 30fc866daabd75ed216220a223bb9c0ae9ab9365 Author: Stefanos Kornilios Mitsis Poiitidis <sk...@ni...> Date: Sat Sep 7 10:35:17 2024 +0300 Add prebuilt driver commit d8417b4a9a2d3a130f023a8b321190f474436078 Author: Stefanos Kornilios Mitsis Poiitidis <st...@sk...v> Date: Sat Sep 7 10:25:42 2024 +0300 Apply suggestions from code review Co-authored-by: Andy Barajas <and...@gm...> commit 86165fbb8d94f083d23437bf86abb697948f119b Author: Stefanos Kornilios Mitsis Poiitidis <sk...@ni...> Date: Fri Sep 6 18:35:12 2024 +0300 aica: Fix the volume LUT commit ce249f9a3d72a38b999550065e1c22a00366a74d Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 20:30:48 2024 +0200 fs: socket: Use mutex_lock_irqsafe() / mutex_lock_scoped() Factorize code by using the new mutex functions and macros. Signed-off-by: Paul Cercueil <pa...@cr...> commit 8a240ed9d9066088a7216ccc11e27425ce141b14 Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 20:28:32 2024 +0200 fs: pty: Use mutex_lock_scoped() / mutex_lock_irqsafe() Factorize code by using the new mutex functions and macros. Signed-off-by: Paul Cercueil <pa...@cr...> commit 089b5b315e35e9df84ad04f783913d57f4485797 Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 16:31:04 2024 +0200 fs: ramdisk: Use mutex_lock_scoped() Use mutex_lock_scoped() instead of mutex_lock() + mutex_unlock(). Signed-off-by: Paul Cercueil <pa...@cr...> commit bab7e8890ada902608afd34613b988bb34cfed17 Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 19:29:19 2024 +0200 fs: dclsocket: Use mutex_lock_irqsafe() Factorize code by using the new mutex function. Signed-off-by: Paul Cercueil <pa...@cr...> commit 06011e1bf40adda17f271741eab65d606a923f95 Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 20:32:20 2024 +0200 libc: poll: Use mutex_lock_irqsafe() Factorize code by using the new mutex function. Signed-off-by: Paul Cercueil <pa...@cr...> commit bf189670e954d9036b772d66c823a9f4b6c93c6f Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 20:31:29 2024 +0200 exports: Use mutex_lock_irqsafe_scoped() Factorize code by using the new mutex macros. Signed-off-by: Paul Cercueil <pa...@cr...> commit bab4b3c363b4dc8e84ccb120467f0026df64062b Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 20:25:36 2024 +0200 cdrom: Use mutex_lock_scoped() / mutex_lock_irqsafe() Factorize code by using the new mutex functions and macros. Signed-off-by: Paul Cercueil <pa...@cr...> commit e8a3a8539e6fed103cc65e7dd46671e865e25a44 Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 15:45:24 2024 +0200 net: Use irqsafe mutex/rwmem variants and factorize code - Use irqsafe variants for locking mutexes and semaphores, which translates to the exact same code - Factorize the "lock rwsem, get socket structure, lock socket structure" code Signed-off-by: Paul Cercueil <pa...@cr...> commit 3acda030702cf823712851b296b7591899d8faee Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 15:41:41 2024 +0200 rwsem: Add rwsem_write_lock_irqsafe() / rwsem_read_lock_irqsafe() These functions can be from within an interrupt context. In that case, if the semaphore is already locked, an error will be returned. Signed-off-by: Paul Cercueil <pa...@cr...> commit dccd296d9cfa6fdc396f6c1472518e87216b68cb Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 16:29:27 2024 +0200 mutex: Add mutex_lock_scoped() This macro will lock a mutex, similarly to mutex_lock, with the difference being that the mutex will automatically be unlocked once the execution exits the functional block in which this macro was called. Signed-off-by: Paul Cercueil <pa...@cr...> commit 161ab3fcd7608fb9ff5a0f695c9ed19bc8534122 Author: Paul Cercueil <pa...@cr...> Date: Wed Jun 19 15:39:24 2024 +0200 mutex: Add mutex_lock_irqsafe() This function can be from within an interrupt context. In that case, if the mutex is already locked, an error will be returned. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: include/kos/mutex.h | 45 ++ include/kos/rwsem.h | 42 +- kernel/arch/dreamcast/fs/fs_dclsocket.c | 107 +---- kernel/arch/dreamcast/hardware/cdrom.c | 27 +- kernel/arch/dreamcast/sound/arm/aica.c | 52 +-- .../arch/dreamcast/sound/arm/stream.drv.prebuilt | Bin 3244 -> 3228 bytes kernel/arch/dreamcast/sound/snd_sfxmgr.c | 11 +- kernel/arch/dreamcast/sound/snd_stream.c | 7 +- kernel/exports/nmmgr.c | 6 +- kernel/fs/fs_pty.c | 26 +- kernel/fs/fs_ramdisk.c | 109 ++--- kernel/fs/fs_socket.c | 76 +--- kernel/libc/koslib/poll.c | 22 +- kernel/net/net_dhcp.c | 14 +- kernel/net/net_ipv4_frag.c | 15 +- kernel/net/net_multicast.c | 31 +- kernel/net/net_tcp.c | 459 ++++----------------- kernel/net/net_udp.c | 141 ++----- kernel/thread/mutex.c | 7 + kernel/thread/rwsem.c | 14 + 20 files changed, 353 insertions(+), 858 deletions(-) diff --git a/include/kos/mutex.h b/include/kos/mutex.h index 34094d09..67729b65 100644 --- a/include/kos/mutex.h +++ b/include/kos/mutex.h @@ -167,6 +167,29 @@ int mutex_destroy(mutex_t *m); */ int mutex_lock(mutex_t *m); +/** \brief Lock a mutex. + + This function will lock a mutex, if it is not already locked by another + thread. If it is locked by another thread already, this function will block + until the mutex has been acquired for the calling thread. + This function can be called from within an interrupt context. In that case, + if the mutex is already locked, an error will be returned. + + The semantics of this function depend on the type of mutex that is used. + + \param m The mutex to acquire + \retval 0 On success + \retval -1 On error, sets errno as appropriate + + \par Error Conditions: + \em EINVAL - the mutex has not been initialized properly \n + \em EAGAIN - lock has been acquired too many times (recursive), or the + function was called inside an interrupt and the mutex was + already locked \n + \em EDEADLK - would deadlock (error-checking) +*/ +int mutex_lock_irqsafe(mutex_t *m); + /** \brief Lock a mutex (with a timeout). This function will attempt to lock a mutex. If the lock can be acquired @@ -255,6 +278,28 @@ int mutex_unlock(mutex_t *m); */ int mutex_unlock_as_thread(mutex_t *m, kthread_t *thd); +/** \cond */ +static inline void __mutex_scoped_cleanup(mutex_t **m) { + if(*m) + mutex_unlock(*m); +} + +#define ___mutex_lock_scoped(m, l) \ + mutex_t *__scoped_mutex_##l __attribute__((cleanup(__mutex_scoped_cleanup))) = mutex_lock(m) ? NULL : (m) + +#define __mutex_lock_scoped(m, l) ___mutex_lock_scoped(m, l) +/** \endcond */ + +/** \brief Lock a mutex with scope management + + This macro will lock a mutex, similarly to mutex_lock, with the difference + that the mutex will automatically be unlocked once the execution exits the + functional block in which the macro was called. + + \param m The mutex to acquire +*/ +#define mutex_lock_scoped(m) __mutex_lock_scoped((m), __LINE__) + __END_DECLS #endif /* __KOS_MUTEX_H */ diff --git a/include/kos/rwsem.h b/include/kos/rwsem.h index ed3a1945..ad2a05d2 100644 --- a/include/kos/rwsem.h +++ b/include/kos/rwsem.h @@ -121,7 +121,7 @@ int rwsem_read_lock_timed(rw_semaphore_t *s, int timeout); This function attempts to lock the r/w semaphore for reading. If the semaphore is locked for writing, this function will block until it is possible to obtain the lock for reading. This function is <b>NOT</b> safe to - call inside of an interrupt. + call inside of an interrupt; use rwsem_read_lock_irqsafe instead. \param s The r/w semaphore to lock. \retval 0 On success @@ -133,6 +133,25 @@ int rwsem_read_lock_timed(rw_semaphore_t *s, int timeout); */ int rwsem_read_lock(rw_semaphore_t *s); +/** \brief Lock a reader/writer semaphore for reading. + + This function attempts to lock the r/w semaphore for reading. If the + semaphore is locked for writing, this function will block until it is + possible to obtain the lock for reading. + If called within an interrupt context, and the semaphore is already locked, + this function will return an error. + + \param s The r/w semaphore to lock. + \retval 0 On success + \retval -1 On error, errno will be set as appropriate. + + \par Error Conditions: + \em EINVAL - the semaphore is not initialized \n + \em EWOULDBLOCK - called inside an interrupt and the semaphore was + already locked +*/ +int rwsem_read_lock_irqsafe(rw_semaphore_t *s); + /** \brief Lock a reader/writer semaphore for writing (with a timeout). This function attempts to lock the r/w semaphore for writing. If the @@ -158,7 +177,7 @@ int rwsem_write_lock_timed(rw_semaphore_t *s, int timeout); This function attempts to lock the r/w semaphore for writing. If the semaphore is locked for reading or writing, this function will block until it is possible to obtain the lock for writing. This function is <b>NOT</b> - safe to call inside of an interrupt. + safe to call inside of an interrupt; use rwsem_write_lock_irqsafe instead. \param s The r/w semaphore to lock. \retval 0 On success. @@ -170,6 +189,25 @@ int rwsem_write_lock_timed(rw_semaphore_t *s, int timeout); */ int rwsem_write_lock(rw_semaphore_t *s); +/** \brief Lock a reader/writer semaphore for writing. + + This function attempts to lock the r/w semaphore for writing. If the + semaphore is locked for reading or writing, this function will block until + it is possible to obtain the lock for writing. + If called within an interrupt context, and the semaphore is already locked, + this function will return an error. + + \param s The r/w semaphore to lock. + \retval 0 On success. + \retval -1 On error, errno will be set as appropriate. + + \par Error conditions: + \em EINVAL - the semaphore is not initialized \n + \em EWOULDBLOCK - called inside an interrupt and the semaphore was + already locked +*/ +int rwsem_write_lock_irqsafe(rw_semaphore_t *s); + /** \brief Unlock a reader/writer semaphore from a read lock. This function releases one instance of the read lock on the r/w semaphore. diff --git a/kernel/arch/dreamcast/fs/fs_dclsocket.c b/kernel/arch/dreamcast/fs/fs_dclsocket.c index a965d39c..e3365424 100644 --- a/kernel/arch/dreamcast/fs/fs_dclsocket.c +++ b/kernel/arch/dreamcast/fs/fs_dclsocket.c @@ -206,22 +206,14 @@ static void dcls_recv_loop(void) { } static void *dcls_open(struct vfs_handler *vfs, const char *fn, int mode) { - int hnd, locked; - int dcload_mode = 0; + int hnd, dcload_mode = 0; int mm = (mode & O_MODE_MASK); command_t *cmd = (command_t *)pktbuf; (void)vfs; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; - return 0; - } - else if(locked == -1) { - mutex_lock(&mutex); - } + if(mutex_lock_irqsafe(&mutex)) + return NULL; if(mode & O_DIR) { char realfn[fn[0] ? strlen(fn) + 1 : 2]; @@ -286,18 +278,11 @@ static void *dcls_open(struct vfs_handler *vfs, const char *fn, int mode) { } static int dcls_close(void *hnd) { - int fd = (int) hnd, locked; + int fd = (int) hnd; command_int_t *cmd = (command_int_t *)pktbuf; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } if(fd > 100) { memcpy(cmd->id, "DC17", 4); @@ -322,21 +307,13 @@ static int dcls_close(void *hnd) { static ssize_t dcls_read(void *hnd, void *buf, size_t cnt) { uint32 fd = (uint32) hnd; - int locked; command_3int_t *cmd = (command_3int_t *)pktbuf; if(!fd) return -1; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } --fd; @@ -355,21 +332,13 @@ static ssize_t dcls_read(void *hnd, void *buf, size_t cnt) { static ssize_t dcls_write(void *hnd, const void *buf, size_t cnt) { uint32 fd = (uint32) hnd; - int locked; command_3int_t *cmd = (command_3int_t *)pktbuf; if(!fd) return -1; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } --fd; @@ -388,21 +357,13 @@ static ssize_t dcls_write(void *hnd, const void *buf, size_t cnt) { static off_t dcls_seek(void *hnd, off_t offset, int whence) { uint32 fd = (uint32)hnd; - int locked; command_3int_t *command = (command_3int_t *)pktbuf; if(!hnd) return -1; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } --fd; @@ -437,7 +398,6 @@ static dirent_t their_dir; static dcload_dirent_t our_dir; static dirent_t *dcls_readdir(void *hnd) { - int locked; uint32 fd = (uint32) hnd; command_3int_t *cmd = (command_3int_t *)pktbuf; @@ -446,15 +406,8 @@ static dirent_t *dcls_readdir(void *hnd) { return NULL; } - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return NULL; - } - else if(locked == -1) { - mutex_lock(&mutex); - } memcpy(cmd->id, "DC18", 4); cmd->value0 = htonl(fd); @@ -507,19 +460,12 @@ static dirent_t *dcls_readdir(void *hnd) { } static int dcls_rename(vfs_handler_t *vfs, const char *fn1, const char *fn2) { - int len1 = strlen(fn1), len2 = strlen(fn2), locked; + int len1 = strlen(fn1), len2 = strlen(fn2); (void)vfs; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } memcpy(pktbuf, "DC07", 4); strcpy((char *)(pktbuf + 4), fn1); @@ -544,19 +490,12 @@ static int dcls_rename(vfs_handler_t *vfs, const char *fn1, const char *fn2) { } static int dcls_unlink(vfs_handler_t *vfs, const char *fn) { - int len = strlen(fn) + 5, locked; + int len = strlen(fn) + 5; (void)vfs; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } memcpy(pktbuf, "DC08", 4); strcpy((char *)(pktbuf + 4), fn); @@ -574,19 +513,11 @@ static int dcls_stat(vfs_handler_t *vfs, const char *fn, struct stat *rv, int flag) { command_t *cmd = (command_t *)pktbuf; dcload_stat_t filestat; - int locked; (void)flag; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } memcpy(cmd->id, "DC13", 4); cmd->address = htonl((uint32) &filestat); @@ -635,7 +566,6 @@ static int dcls_fake_shutdown(void) { } static int dcls_writebuf(const uint8 *buf, int len, int xlat) { - int locked; command_3int_t cmd; (void)xlat; @@ -643,15 +573,8 @@ static int dcls_writebuf(const uint8 *buf, int len, int xlat) { if(initted < 2) return -1; - locked = mutex_trylock(&mutex); - - if(locked == -1 && irq_inside_int()) { - errno = EAGAIN; + if(mutex_lock_irqsafe(&mutex)) return -1; - } - else if(locked == -1) { - mutex_lock(&mutex); - } memcpy(cmd.id, "DD02", 4); cmd.value0 = htonl(1); diff --git a/kernel/arch/dreamcast/hardware/cdrom.c b/kernel/arch/dreamcast/hardware/cdrom.c index e842e336..09ec0ca6 100644 --- a/kernel/arch/dreamcast/hardware/cdrom.c +++ b/kernel/arch/dreamcast/hardware/cdrom.c @@ -77,7 +77,7 @@ int cdrom_exec_cmd_timed(int cmd, void *param, int timeout) { uint64_t begin; assert(cmd > 0 && cmd < CMD_MAX); - mutex_lock(&_g1_ata_mutex); + mutex_lock_scoped(&_g1_ata_mutex); /* Submit the command */ for(n = 0; n < 10; ++n) { @@ -89,10 +89,8 @@ int cdrom_exec_cmd_timed(int cmd, void *param, int timeout) { thd_pass(); } - if(hnd <= 0) { - mutex_unlock(&_g1_ata_mutex); + if(hnd <= 0) return ERR_SYS; - } /* Wait command to finish */ if(timeout) { @@ -117,8 +115,6 @@ int cdrom_exec_cmd_timed(int cmd, void *param, int timeout) { thd_pass(); } while(1); - mutex_unlock(&_g1_ata_mutex); - if(rv != ERR_OK) return rv; else if(n == COMPLETED || n == STREAMING) @@ -147,14 +143,9 @@ int cdrom_get_status(int *status, int *disc_type) { /* We might be called in an interrupt to check for ISO cache flushing, so make sure we're not interrupting something already in progress. */ - if(irq_inside_int()) { - if(mutex_trylock(&_g1_ata_mutex)) - /* DH: Figure out a better return to signal error */ - return -1; - } - else { - mutex_lock(&_g1_ata_mutex); - } + if(mutex_lock_irqsafe(&_g1_ata_mutex)) + /* DH: Figure out a better return to signal error */ + return -1; do { rv = syscall_gdrom_check_drive(params); @@ -192,10 +183,9 @@ int cdrom_change_dataype(int sector_part, int cdxa, int sector_size) { /* Wrapper for the change datatype syscall */ int cdrom_change_datatype(int sector_part, int cdxa, int sector_size) { - int rv = ERR_OK; uint32_t params[4]; - mutex_lock(&_g1_ata_mutex); + mutex_lock_scoped(&_g1_ata_mutex); /* Check if we are using default params */ if(sector_size == 2352) { @@ -224,9 +214,8 @@ int cdrom_change_datatype(int sector_part, int cdxa, int sector_size) { params[1] = sector_part; /* Get Data or Full Sector */ params[2] = cdxa; /* CD-XA mode 1/2 */ params[3] = sector_size; /* sector size */ - rv = syscall_gdrom_sector_mode(params); - mutex_unlock(&_g1_ata_mutex); - return rv; + + return syscall_gdrom_sector_mode(params); } /* Re-init the drive, e.g., after a disc change, etc */ diff --git a/kernel/arch/dreamcast/sound/arm/aica.c b/kernel/arch/dreamcast/sound/arm/aica.c index e116355f..74f30539 100644 --- a/kernel/arch/dreamcast/sound/arm/aica.c +++ b/kernel/arch/dreamcast/sound/arm/aica.c @@ -2,6 +2,7 @@ aica.c (c)2000-2002 Megan Potter + (c)2024 Stefanos Kornilios Mitsis Poiitidis ARM support routines for using the wavetable channels */ @@ -30,31 +31,36 @@ void aica_init(void) { } /* Translates a volume from linear form to logarithmic form (required by - the AICA chip */ -static int logs[] = { - 0, 15, 22, 27, 31, 35, 39, 42, 45, 47, 50, 52, 55, 57, 59, 61, - 63, 65, 67, 69, 71, 73, 74, 76, 78, 79, 81, 82, 84, 85, 87, 88, - 90, 91, 92, 94, 95, 96, 98, 99, 100, 102, 103, 104, 105, 106, - 108, 109, 110, 111, 112, 113, 114, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 146, 147, 148, 149, 150, 151, 152, 152, 153, 154, 155, 156, 156, - 157, 158, 159, 160, 160, 161, 162, 163, 164, 164, 165, 166, 167, - 167, 168, 169, 170, 170, 171, 172, 173, 173, 174, 175, 176, 176, - 177, 178, 178, 179, 180, 181, 181, 182, 183, 183, 184, 185, 185, - 186, 187, 187, 188, 189, 189, 190, 191, 191, 192, 193, 193, 194, - 195, 195, 196, 197, 197, 198, 199, 199, 200, 200, 201, 202, 202, - 203, 204, 204, 205, 205, 206, 207, 207, 208, 209, 209, 210, 210, - 211, 212, 212, 213, 213, 214, 215, 215, 216, 216, 217, 217, 218, - 219, 219, 220, 220, 221, 221, 222, 223, 223, 224, 224, 225, 225, - 226, 227, 227, 228, 228, 229, 229, 230, 230, 231, 232, 232, 233, - 233, 234, 234, 235, 235, 236, 236, 237, 237, 238, 239, 239, 240, - 240, 241, 241, 242, 242, 243, 243, 244, 244, 245, 245, 246, 246, - 247, 247, 248, 248, 249, 249, 250, 250, 251, 251, 252, 252, 253, 254, 255 + the AICA chip + + Calculated by + for (int i = 0; i < 256; i++) + if (i == 0) ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-09-06 06:36: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 01555798061d1fbb552dfef251989b2e0555c472 (commit) from 892b8149ca90bb77c3452c4edeecbb0082b89dba (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 01555798061d1fbb552dfef251989b2e0555c472 Author: dfchil <dan...@gm...> Date: Fri Sep 6 08:36:05 2024 +0200 Added a set of known working purupuru bit patterns to the rumble example (#682) * Added a set of known working purupuru bit patterns to the rumble example * Added a myself to the changelog * Added a myself to the changelog * added a bit-field pattern describing effects and a print function for it * fixed indentation error * field print layout indentation * I had unintentially and very regretably angered the Endians, fixed now and tested for correctness against the rumble_fields_t related macros * reverted print_rumble_fields to only showing numbers * print is directly usable as code * added my name and year to the rumble.c example file --------- Co-authored-by: drxl <da...@vm...> Co-authored-by: Daniel Fairchild <da...@vi...> ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 3 +- examples/dreamcast/rumble/rumble.c | 156 ++++++++++++++++++++++++++++++++++++- 2 files changed, 157 insertions(+), 2 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index f3da1509..d8f3a52a 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -228,7 +228,8 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Added thread support for tracking CPU time + updated clock_gettime() [FG] - *** Added support for one-shot timers [PC] - DC Use one-shot timers for timeout and a proper polling mechanism in modem [PC] -- *** Added pvrtex utility by TapamN to utils [DF == Daniel Fairchild] +- *** Added pvrtex utility by TapamN to utils [DF == Daniel Fairchild] +- DC Added a set of known working purupuru bit patterns and a browsing mechanism to the rumble example [DF] - *** Added full support for <time.h> additions from C23 standard. [FG] - *** Fixes mutexes not working properly [PC] - DC fs_dcload: Set errno on error in dcload_stat() [PC] diff --git a/examples/dreamcast/rumble/rumble.c b/examples/dreamcast/rumble/rumble.c index 74d6aa32..fd63424b 100644 --- a/examples/dreamcast/rumble/rumble.c +++ b/examples/dreamcast/rumble/rumble.c @@ -3,6 +3,7 @@ rumble.c Copyright (C) 2004 SinisterTengu Copyright (C) 2008, 2023 Donald Haase + Copyright (C) 2024 Daniel Fairchild */ @@ -35,6 +36,121 @@ KOS_INIT_FLAGS(INIT_DEFAULT); plx_fcxt_t *cxt; + +typedef union rumble_fields { + uint32_t raw; + struct { + /* Special Effects and motor select. The normal purupuru packs will +only have one motor. Selecting MOTOR2 for these is probably not +a good idea. The PULSE setting here supposably creates a sharp +pulse effect, when ORed with the special field. */ + + /** \brief Yet another pulse effect. + This supposedly creates a sharp pulse effect. + */ + uint32_t special_pulse : 1; + uint32_t : 3; // unused + + /** \brief Select motor #1. + + Most jump packs only have one motor, but on things that do have more + than one motor (like PS1->Dreamcast controller adapters that support + rumble), this selects the first motor. + */ + uint32_t special_motor1 : 1; + uint32_t : 2; // unused + + /** \brief Select motor #2. + + Most jump packs only have one motor, but on things that do have more + than one motor (like PS1->Dreamcast controller adapters that support + rumble), this selects the second motor. + */ + uint32_t special_motor2 : 1; + + /** \brief Ignore this command. + + Valid value 15 (0xF). + + Most jump packs will ignore commands with this set in effect1, + apparently. + */ + uint32_t fx1_powersave : 4; + + /** \brief Upper nibble of effect1. + + This value works with the lower nibble of the effect2 field to + increase the intensity of the rumble effect. + Valid values are 0-7. + + \see rumble_fields_t.fx2_lintensity + */ + uint32_t fx1_intensity : 3; + + /** \brief Give a pulse effect to the rumble. + + This probably should be used with rumble_fields_t.fx1_pulse as well. + + \see rumble_fields_t.fx2_pulse + */ + uint32_t fx1_pulse : 1; + + /** \brief Lower-nibble of effect2. + + This value works with the upper nibble of the effect1 + field to increase the intensity of the rumble effect. + Valid values are 0-7. + + \see rumble_fields_t.fx1_intensity + */ + uint32_t fx2_lintensity : 3; + + /** \brief Give a pulse effect to the rumble. + + This probably should be used with rumble_fields_t.fx1_pulse as well. + + \see rumble_fields_t.fx1_intensity + */ + uint32_t fx2_pulse : 1; + + /** \brief Upper-nibble of effect2. + + This apparently lowers the rumble's intensity somewhat. + Valid values are 0-7. + */ + uint32_t fx2_uintensity : 3; + + /* OR these in with your effect2 value if you feel so inclined. + if you or the PULSE effect in here, you probably should also + do so with the effect1 one below. */ + + /** \brief Give a decay effect to the rumble on some packs. */ + uint32_t fx2_decay : 1; + + /** \brief The duration of the effect. No idea on units... */ + uint32_t duration : 8; + }; +} rumble_fields_t; + + +void print_rumble_fields(uint32_t raw) { + rumble_fields_t fields = {.raw = raw}; + printf("Rumble Fields:\n"); + printf(" .special_pulse = %u,\n", fields.special_pulse); + printf(" .special_motor1 = %u,\n", fields.special_motor1); + printf(" .special_motor2 = %u,\n", fields.special_motor2); + + printf(" .fx1_pulse = %u,\n", fields.fx1_pulse); + printf(" .fx1_powersave = %u,\n", fields.fx1_powersave); + printf(" .fx1_intensity = %u,\n", fields.fx1_intensity); + + printf(" .fx2_lintensity = %u,\n", fields.fx2_lintensity); + printf(" .fx2_pulse = %u,\n", fields.fx2_pulse); + printf(" .fx2_uintensity = %u,\n", fields.fx2_uintensity); + printf(" .fx2_decay = %u,\n", fields.fx2_decay); + + printf(" .duration = %u,\n", fields.duration); +} /* This blocks waiting for a specified device to be present and valid */ void wait_for_dev_attach(maple_device_t **dev_ptr, unsigned int func) { maple_device_t *dev = *dev_ptr; @@ -69,6 +185,28 @@ void wait_for_dev_attach(maple_device_t **dev_ptr, unsigned int func) { } } + +typedef struct { + uint32_t pattern; + const char *description; +} baked_pattern_t; + +static size_t catalog_index = 0; +static const baked_pattern_t catalog[] = { + {.pattern = 0x011A7010, .description = "Basic Thud (simple .5s jolt)"}, + {.pattern = 0x31071011, .description = "Car Idle (69 Mustang)"}, + {.pattern = 0x2615F010, .description = "Car Idle (VW beetle)"}, + {.pattern = 0x3339F010, .description = "Eathquake (Vibrate, and fade out)"}, + {.pattern = 0x05281011, .description = "Helicopter"}, + {.pattern = 0x00072010, .description = "Ship's Thrust (as in AAC)"}, +}; + +static inline void word2hexbytes(uint32_t word, uint8_t *bytes) { + for (int i = 0; i < 8; i++) { + bytes[i] = (word >> (28 - (i * 4))) & 0xf; + } +} + int main(int argc, char *argv[]) { cont_state_t *state; @@ -79,8 +217,9 @@ int main(int argc, char *argv[]) { int i = 0, count = 0; uint16_t old_buttons = 0, rel_buttons = 0; uint32_t effect = 0; - uint8_t n[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; //nibbles + uint8_t n[8]; char s[8][2] = { "", "", "", "", "", "", "", "" }; + word2hexbytes(0, n); pvr_init_defaults(); @@ -148,6 +287,16 @@ int main(int argc, char *argv[]) { if(n[i] > 0) n[i]--; } + if ((state->buttons & CONT_X) && (rel_buttons & CONT_X)) { + printf("Setting baked pattern:\n\t'%s'\n", catalog[catalog_index].description); + word2hexbytes(catalog[catalog_index].pattern, n); + catalog_index++; + if (catalog_index >= sizeof(catalog) / sizeof(baked_pattern_t)) { + catalog_index = 0; + } + } + + if((state->buttons & CONT_A) && (rel_buttons & CONT_A)) { effect = (n[0] << 28) + (n[1] << 24) + (n[2] << 20) + (n[3] << 16) + (n[4] << 12) + (n[5] << 8) + (n[6] << 4) + (n[7] << 0); @@ -155,6 +304,7 @@ int main(int argc, char *argv[]) { purupuru_rumble_raw(purudev, effect); /* We print these out to make it easier to track the options chosen */ printf("Rumble: 0x%lx!\n", effect); + print_rumble_fields(effect); } if((state->buttons & CONT_B) && (rel_buttons & CONT_B)) { @@ -185,6 +335,10 @@ int main(int argc, char *argv[]) { plx_fcxt_draw(cxt, "Press B to stop rumblin."); w.y += 25.0f; + plx_fcxt_setpos_pnt(cxt, &w); + plx_fcxt_draw(cxt, "Press X for next baked pattern"); + w.y += 25.0f; + plx_fcxt_setpos_pnt(cxt, &w); plx_fcxt_draw(cxt, "Press Start to quit."); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-09-06 02:31: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 892b8149ca90bb77c3452c4edeecbb0082b89dba (commit) from c1104515865a09ffa6ccfc05dcd6f991c524f951 (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 892b8149ca90bb77c3452c4edeecbb0082b89dba Author: Andy Barajas <and...@gm...> Date: Thu Sep 5 19:30:42 2024 -0700 Refactor sysinfo_icon/id (#734) * Refactor sysinfo_icon/id Made syscall_sysinfo_init() public and call it in arch_auto_init() to prepare for future calls to syscalls for info_icon and info_id. * Update kernel/arch/dreamcast/include/dc/syscalls.h Added not that KOS automatically calls this during initialization Co-authored-by: Falco Girgis <gyr...@gm...> --------- Co-authored-by: Falco Girgis <gyr...@gm...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/syscalls.c | 9 +-------- kernel/arch/dreamcast/include/dc/syscalls.h | 8 ++++++++ kernel/arch/dreamcast/kernel/init.c | 2 ++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/syscalls.c b/kernel/arch/dreamcast/hardware/syscalls.c index 60d7cf07..a2bc5d66 100644 --- a/kernel/arch/dreamcast/hardware/syscalls.c +++ b/kernel/arch/dreamcast/hardware/syscalls.c @@ -116,18 +116,12 @@ syscall((r4), (r5), (r6), (func)); \ } while(0) -/* - Prepares FUNC_SYSINFO_ICON and FUNC_SYSINFO_ID calls for use by - copying the relevant data from the system flashrom into - 8C000068-8C00007F. No point in making this public. -*/ -static void syscall_sysinfo_init(void) { +void syscall_sysinfo_init(void) { MAKE_SYSCALL_VOID(VEC_SYSINFO, FUNC_SYSINFO_INIT, PARAM_NA, PARAM_NA, PARAM_NA); } int syscall_sysinfo_icon(uint32_t icon, uint8_t *dest) { - syscall_sysinfo_init(); MAKE_SYSCALL_INT(VEC_SYSINFO, FUNC_SYSINFO_ICON, icon, dest, PARAM_NA); } @@ -135,7 +129,6 @@ int syscall_sysinfo_icon(uint32_t icon, uint8_t *dest) { uint64_t syscall_sysinfo_id(void) { uint64_t *id = NULL; - syscall_sysinfo_init(); MAKE_SYSCALL_SET(VEC_SYSINFO, FUNC_SYSINFO_ID, PARAM_NA, PARAM_NA, PARAM_NA, id, uint64_t *); diff --git a/kernel/arch/dreamcast/include/dc/syscalls.h b/kernel/arch/dreamcast/include/dc/syscalls.h index 0f705ea4..71c21852 100644 --- a/kernel/arch/dreamcast/include/dc/syscalls.h +++ b/kernel/arch/dreamcast/include/dc/syscalls.h @@ -38,6 +38,14 @@ __BEGIN_DECLS #include <stdint.h> #include <sys/types.h> +/** \brief Inits data needed by sysinfo id/icon + \note This is called automatically by KOS during initialization. + This function prepares syscall_sysinfo_icon and syscall_sysinfo_id + calls for use by copying the relevant data from the system flashrom + into 8C000068-8C00007F. +*/ +void syscall_sysinfo_init(void); + /** \brief Reads an icon from the flashrom. This function reads an icon from the flashrom into a destination diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index ed90b7f1..f2c222b1 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -172,6 +172,8 @@ int __weak arch_auto_init(void) { timer_init(); /* Timers */ hardware_sys_init(); /* DC low-level hardware init */ + syscall_sysinfo_init(); + /* Initialize our timer */ perf_cntr_timer_enable(); timer_ms_enable(); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-09-04 03:23:47
|
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 c1104515865a09ffa6ccfc05dcd6f991c524f951 (commit) from 688c85db2fb0255ce4aff8cdabbeb2c4c099d65b (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 c1104515865a09ffa6ccfc05dcd6f991c524f951 Author: darcagn <da...@pr...> Date: Tue Sep 3 22:23:30 2024 -0500 Fix typos in environ.sh (#733) Just changing -0* typos to -O. ----------------------------------------------------------------------- Summary of changes: doc/environ.sh.sample | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/environ.sh.sample b/doc/environ.sh.sample index f1a0989d..14db9945 100644 --- a/doc/environ.sh.sample +++ b/doc/environ.sh.sample @@ -129,7 +129,7 @@ export DC_ARM_LDFLAGS="" # Optimization Level # # Controls the baseline optimization level to use when building. -# Typically this is -Og (debugging), -O0, -01, -02, or -03. +# Typically this is -Og (debugging), -O0, -O1, -O2, or -O3. # NOTE: For our target, -O4 is a valid optimization level that has # been seen to have some performance impact as well. # hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-09-01 04:28:47
|
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 688c85db2fb0255ce4aff8cdabbeb2c4c099d65b (commit) from 8f4089dac331d7d2ca85701453b98f66baf1532e (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 688c85db2fb0255ce4aff8cdabbeb2c4c099d65b Author: darcagn <da...@pr...> Date: Sat Aug 31 23:28:31 2024 -0500 Remove FD_SETSIZE setting from environ.sh (#719) ----------------------------------------------------------------------- Summary of changes: doc/environ.sh.sample | 15 --------------- include/kos/opts.h | 5 +++-- kernel/fs/fs.c | 7 +++---- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/doc/environ.sh.sample b/doc/environ.sh.sample index ad12f47e..f1a0989d 100644 --- a/doc/environ.sh.sample +++ b/doc/environ.sh.sample @@ -144,21 +144,6 @@ export KOS_CFLAGS="${KOS_CFLAGS} -O2" # #export KOS_CFLAGS="${KOS_CFLAGS} -freorder-blocks-algorithm=simple -flto=auto" -# RAM-Saving Optimization -# -# Uncomment the line below to reduce the default size of FD_SETSIZE from the -# default value of 1024 to 64. FD_SETSIZE defines the maximum number of files -# that can be opened simultaneously, including files on the ramdisk, romdisk, -# CD, VMU, network sockets, etc. The default setting allows 1024 files to be -# opened at once, which is typically more than most use cases require. -# -# By reducing this value, you can save approximately ~11.25 KB of RAM, which -# can be particularly useful when porting large games to the Dreamcast that -# are strapped for memory. However, be cautious not to set it too low, as this -# may limit the number of files and sockets that can be opened simultaneously. -# -# export KOS_CFLAGS="${KOS_CFLAGS} -DFD_SETSIZE=64" - # Frame Pointers # # Controls whether frame pointers are emitted or not. Disabled by diff --git a/include/kos/opts.h b/include/kos/opts.h index fe005278..66eedea2 100644 --- a/include/kos/opts.h +++ b/include/kos/opts.h @@ -129,8 +129,9 @@ __BEGIN_DECLS #define FS_RAMDISK_MAX_FILES 8 #endif -/** \brief The number of distinct file descriptors that can be in use at a - time. This value can be overwritten in environ.sh */ +/** \brief The number of distinct file descriptors, including files and + network sockets, that can be in use at a time. Decreasing this + value can reduce memory usage. */ #ifndef FD_SETSIZE #define FD_SETSIZE 1024 #endif diff --git a/kernel/fs/fs.c b/kernel/fs/fs.c index d1efca3a..e0e0339c 100644 --- a/kernel/fs/fs.c +++ b/kernel/fs/fs.c @@ -197,10 +197,9 @@ static int fs_hnd_assign(fs_hnd_t *hnd) { break; if(i >= FD_SETSIZE) { - if(FD_SETSIZE != 1024) - dbglog(DBG_ERROR, "fs_hnd_assign: Update -DFD_SETSIZE flag in \ - environ.sh to support additional files being opened. Current \ - limit is %d\n", FD_SETSIZE); + dbglog(DBG_ERROR, "fs_hnd_assign: Update FD_SETSIZE definition in \ + opts.h to support additional files being opened. Current \ + limit is %d\n", FD_SETSIZE); fs_hnd_unref(hnd); errno = EMFILE; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-09-01 04:24: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 pseudo Operating System for the Dreamcast.". The branch, master has been updated via 8f4089dac331d7d2ca85701453b98f66baf1532e (commit) from 698c12cc65d16dee55ed5b6106767bdea2e1056c (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 8f4089dac331d7d2ca85701453b98f66baf1532e Author: darcagn <da...@pr...> Date: Sat Aug 31 23:24:15 2024 -0500 Update pvrtex/stb_image.h from v2.27 to v2.30 to fix compilation warning (#731) ----------------------------------------------------------------------- Summary of changes: utils/pvrtex/stb_image.h | 487 ++++++++++++++++++++++++++++------------------- 1 file changed, 289 insertions(+), 198 deletions(-) diff --git a/utils/pvrtex/stb_image.h b/utils/pvrtex/stb_image.h index d60371b9..9eedabed 100644 --- a/utils/pvrtex/stb_image.h +++ b/utils/pvrtex/stb_image.h @@ -1,4 +1,4 @@ -/* stb_image - v2.27 - public domain image loader - http://nothings.org/stb +/* stb_image - v2.30 - public domain image loader - http://nothings.org/stb no warranty implied; use at your own risk Do this: @@ -48,6 +48,9 @@ LICENSE RECENT REVISION HISTORY: + 2.30 (2024-05-31) avoid erroneous gcc warning + 2.29 (2023-05-xx) optimizations + 2.28 (2023-01-29) many error fixes, security errors, just tons of stuff 2.27 (2021-07-11) document stbi_info better, 16-bit PNM support, bug fixes 2.26 (2020-07-13) many minor fixes 2.25 (2020-02-02) fix warnings @@ -108,7 +111,7 @@ RECENT REVISION HISTORY: Cass Everitt Ryamond Barbiero github:grim210 Paul Du Bois Engin Manap Aldo Culquicondor github:sammyhw Philipp Wiesemann Dale Weiler Oriol Ferrer Mesia github:phprus - Josh Tobin Matthew Gregan github:poppolopoppo + Josh Tobin Neil Bickford Matthew Gregan github:poppolopoppo Julian Raschke Gregory Mullen Christian Floisand github:darealshinji Baldur Karlsson Kevin Schmidt JR Smith github:Michaelangel007 Brad Weinberger Matvey Cherevko github:mosra @@ -140,7 +143,7 @@ RECENT REVISION HISTORY: // // ... x = width, y = height, n = # 8-bit components per pixel ... // // ... replace '0' with '1'..'4' to force that many components per pixel // // ... but 'n' will always be the number that it would have been if you said 0 -// stbi_image_free(data) +// stbi_image_free(data); // // Standard parameters: // int *x -- outputs image width in pixels @@ -635,7 +638,7 @@ STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const ch #endif #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__SYMBIAN32__) typedef unsigned short stbi__uint16; typedef signed short stbi__int16; typedef unsigned int stbi__uint32; @@ -1063,6 +1066,23 @@ static void *stbi__malloc_mad4(int a, int b, int c, int d, int add) } #endif +// returns 1 if the sum of two signed ints is valid (between -2^31 and 2^31-1 inclusive), 0 on overflow. +static int stbi__addints_valid(int a, int b) +{ + if ((a >= 0) != (b >= 0)) return 1; // a and b have different signs, so no overflow + if (a < 0 && b < 0) return a >= INT_MIN - b; // same as a + b >= INT_MIN; INT_MIN - b cannot overflow since b < 0. + return a <= INT_MAX - b; +} + +// returns 1 if the product of two ints fits in a signed short, 0 on overflow. +static int stbi__mul2shorts_valid(int a, int b) +{ + if (b == 0 || b == -1) return 1; // multiplication by 0 is always 0; check for -1 so SHRT_MIN/b doesn't overflow + if ((a >= 0) == (b >= 0)) return a <= SHRT_MAX/b; // product is positive, so similar to mul2sizes_valid + if (b < 0) return a <= SHRT_MIN / b; // same as a * b >= SHRT_MIN + return a >= SHRT_MIN / b; +} + // stbi__err - error // stbi__errpf - error returning pointer to float // stbi__errpuc - error returning pointer to unsigned char @@ -1985,9 +2005,12 @@ static int stbi__build_huffman(stbi__huffman *h, int *count) int i,j,k=0; unsigned int code; // build size list for each symbol (from JPEG spec) - for (i=0; i < 16; ++i) - for (j=0; j < count[i]; ++j) + for (i=0; i < 16; ++i) { + for (j=0; j < count[i]; ++j) { h->size[k++] = (stbi_uc) (i+1); + if(k >= 257) return stbi__err("bad size list","Corrupt JPEG"); + } + } h->size[k] = 0; // compute actual symbols (from jpeg spec) @@ -2112,6 +2135,8 @@ stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h) // convert the huffman code to the symbol id c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k]; + if(c < 0 || c >= 256) // symbol id out of bounds! + return -1; STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]); // convert the id to a symbol @@ -2130,6 +2155,7 @@ stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n) unsigned int k; int sgn; if (j->code_bits < n) stbi__grow_buffer_unsafe(j); + if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing sgn = j->code_buffer >> 31; // sign bit always in MSB; 0 if MSB clear (positive), 1 if MSB set (negative) k = stbi_lrot(j->code_buffer, n); @@ -2144,6 +2170,7 @@ stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n) { unsigned int k; if (j->code_bits < n) stbi__grow_buffer_unsafe(j); + if (j->code_bits < n) return 0; // ran out of bits from stream, return 0s intead of continuing k = stbi_lrot(j->code_buffer, n); j->code_buffer = k & ~stbi__bmask[n]; k &= stbi__bmask[n]; @@ -2155,6 +2182,7 @@ stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j) { unsigned int k; if (j->code_bits < 1) stbi__grow_buffer_unsafe(j); + if (j->code_bits < 1) return 0; // ran out of bits from stream, return 0s intead of continuing k = j->code_buffer; j->code_buffer <<= 1; --j->code_bits; @@ -2192,8 +2220,10 @@ static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman memset(data,0,64*sizeof(data[0])); diff = t ? stbi__extend_receive(j, t) : 0; + if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta","Corrupt JPEG"); dc = j->img_comp[b].dc_pred + diff; j->img_comp[b].dc_pred = dc; + if (!stbi__mul2shorts_valid(dc, dequant[0])) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); data[0] = (short) (dc * dequant[0]); // decode AC components, see JPEG spec @@ -2207,6 +2237,7 @@ static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman if (r) { // fast-AC path k += (r >> 4) & 15; // run s = r & 15; // combined length + if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available"); j->code_buffer <<= s; j->code_bits -= s; // decode into unzigzag'd location @@ -2246,8 +2277,10 @@ static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__ if (t < 0 || t > 15) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); diff = t ? stbi__extend_receive(j, t) : 0; + if (!stbi__addints_valid(j->img_comp[b].dc_pred, diff)) return stbi__err("bad delta", "Corrupt JPEG"); dc = j->img_comp[b].dc_pred + diff; j->img_comp[b].dc_pred = dc; + if (!stbi__mul2shorts_valid(dc, 1 << j->succ_low)) return stbi__err("can't merge dc and ac", "Corrupt JPEG"); data[0] = (short) (dc * (1 << j->succ_low)); } else { // refinement scan for DC coefficient @@ -2282,6 +2315,7 @@ static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__ if (r) { // fast-AC path k += (r >> 4) & 15; // run s = r & 15; // combined length + if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available"); j->code_buffer <<= s; j->code_bits -= s; zig = stbi__jpeg_dezigzag[k++]; @@ -3102,6 +3136,7 @@ static int stbi__process_marker(stbi__jpeg *z, int m) sizes[i] = stbi__get8(z->s); n += sizes[i]; } + if(n > 256) return stbi__err("bad DHT header","Corrupt JPEG"); // Loop over i < n would write past end of values! L -= 17; if (tc == 0) { if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0; @@ -3351,6 +3386,28 @@ static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan) return 1; } +static stbi_uc stbi__skip_jpeg_junk_at_end(stbi__jpeg *j) +{ + // some JPEGs have junk at end, skip over it but if we find what looks + // like a valid marker, resume there + while (!stbi__at_eof(j->s)) { + stbi_uc x = stbi__get8(j->s); + while (x == 0xff) { // might be a marker + if (stbi__at_eof(j->s)) return STBI__MARKER_none; + x = stbi__get8(j->s); + if (x != 0x00 && x != 0xff) { + // not a stuffed zero or lead-in to another marker, looks + // like an actual marker, return it + return x; + } + // stuffed zero has x=0 now which ends the loop, meaning we go + // back to regular scan loop. + // repeated 0xff keeps trying to read the next byte of the marker. + } + } + return STBI__MARKER_none; +} + // decode image to YCbCr format static int stbi__decode_jpeg_image(stbi__jpeg *j) { @@ -3367,25 +3424,22 @@ static int stbi__decode_jpeg_image(stbi__jpeg *j) if (!stbi__process_scan_header(j)) return 0; if (!stbi__parse_entropy_coded_data(j)) return 0; if (j->marker == STBI__MARKER_none ) { - // handle 0s at the end of image data from IP Kamera 9060 - while (!stbi__at_eof(j->s)) { - int x = stbi__get8(j->s); - if (x == 255) { - j->marker = stbi__get8(j->s); - break; - } - } + j->marker = stbi__skip_jpeg_junk_at_end(j); // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0 } + m = stbi__get_marker(j); + if (STBI__RESTART(m)) + m = stbi__get_marker(j); } else if (stbi__DNL(m)) { int Ld = stbi__get16be(j->s); stbi__uint32 NL = stbi__get16be(j->s); if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG"); if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG"); + m = stbi__get_marker(j); } else { - if (!stbi__process_marker(j, m)) return 0; + if (!stbi__process_marker(j, m)) return 1; + m = stbi__get_marker(j); } - m = stbi__get_marker(j); } if (j->progressive) stbi__jpeg_finish(j); @@ -3976,6 +4030,7 @@ static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int re unsigned char* result; stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg)); if (!j) return stbi__errpuc("outofmem", "Out of memory"); + memset(j, 0, sizeof(stbi__jpeg)); STBI_NOTUSED(ri); j->s = s; stbi__setup_jpeg(j); @@ -3989,6 +4044,7 @@ static int stbi__jpeg_test(stbi__context *s) int r; stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg)); if (!j) return stbi__err("outofmem", "Out of memory"); + memset(j, 0, sizeof(stbi__jpeg)); j->s = s; stbi__setup_jpeg(j); r = stbi__decode_jpeg_header(j, STBI__SCAN_type); @@ -4014,6 +4070,7 @@ static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp) int result; stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg))); if (!j) return stbi__err("outofmem", "Out of memory"); + memset(j, 0, sizeof(stbi__jpeg)); j->s = s; result = stbi__jpeg_info_raw(j, x, y, comp); STBI_FREE(j); @@ -4121,6 +4178,7 @@ typedef struct { stbi_uc *zbuffer, *zbuffer_end; int num_bits; + int hit_zeof_once; stbi__uint32 code_buffer; char *zout; @@ -4187,9 +4245,20 @@ stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z) int b,s; if (a->num_bits < 16) { if (stbi__zeof(a)) { - return -1; /* report error for unexpected end of data. */ + if (!a->hit_zeof_once) { + // This is the first time we hit eof, insert 16 extra padding btis + // to allow us to keep going; if we actually consume any of them + // though, that is invalid data. This is caught later. + a->hit_zeof_once = 1; + a->num_bits += 16; // add 16 implicit zero bits + } else { + // We already inserted our extra 16 padding bits and are again + // out, this stream is actually prematurely terminated. + return -1; + } + } else { + stbi__fill_bits(a); } - stbi__fill_bits(a); } b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; if (b) { @@ -4254,17 +4323,25 @@ static int stbi__parse_huffman_block(stbi__zbuf *a) int len,dist; if (z == 256) { a->zout = zout; + if (a->hit_zeof_once && a->num_bits < 16) { + // The first time we hit zeof, we inserted 16 extra zero bits into our bit + // buffer so the decoder can just do its speculative decoding. But if we + // actually consumed any of those bits (which is the case when num_bits < 16), + // the stream actually read past the end so it is malformed. + return stbi__err("unexpected end","Corrupt PNG"); + } return 1; } + if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data z -= 257; len = stbi__zlength_base[z]; if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]); z = stbi__zhuffman_decode(a, &a->z_distance); - if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); + if (z < 0 || z >= 30) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, distance codes 30 and 31 must not appear in compressed data dist = stbi__zdist_base[z]; if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]); if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG"); - if (zout + len > a->zout_end) { + if (len > a->zout_end - zout) { if (!stbi__zexpand(a, zout, len)) return 0; zout = a->zout; } @@ -4408,6 +4485,7 @@ static int stbi__parse_zlib(stbi__zbuf *a, int parse_header) if (!stbi__parse_zlib_header(a)) return 0; a->num_bits = 0; a->code_buffer = 0; + a->hit_zeof_once = 0; do { final = stbi__zreceive(a,1); type = stbi__zreceive(a,2); @@ -4563,9 +4641,8 @@ enum { STBI__F_up=2, STBI__F_avg=3, STBI__F_paeth=4, - // synthetic filters used for first scanline to avoid needing a dummy row of 0s - STBI__F_avg_first, - STBI__F_paeth_first + // synthetic filter used for first scanline to avoid needing a dummy row of 0s + STBI__F_avg_first }; static stbi_uc first_row_filter[5] = @@ -4574,29 +4651,56 @@ static stbi_uc first_row_filter[5] = STBI__F_sub, STBI__F_none, STBI__F_avg_first, - STBI__F_paeth_first + STBI__F_sub // Paeth with b=c=0 turns out to be equivalent to sub }; static int stbi__paeth(int a, int b, int c) { - int p = a + b - c; - int pa = abs(p-a); - int pb = abs(p-b); - int pc = abs(p-c); - if (pa <= pb && pa <= pc) return a; - if (pb <= pc) return b; - return c; + // This formulation looks very different from the reference in the PNG spec, but is + // actually equivalent and has favorable data dependencies and admits straightforward + // generation of branch-free code, which helps performance significantly. + int thresh = c*3 - (a + b); + int lo = a < b ? a : b; + int hi = a < b ? b : a; + int t0 = (hi <= thresh) ? lo : c; + int t1 = (thresh <= lo) ? hi : t0; + return t1; } static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 }; +// adds an extra all-255 alpha channel +// dest == src is legal +// img_n must be 1 or 3 +static void stbi__create_png_alpha_expand8(stbi_uc *dest, stbi_uc *src, stbi__uint32 x, int img_n) +{ + int i; + // must process data backwards since we allow dest==src + if (img_n == 1) { + for (i=x-1; i >= 0; --i) { + dest[i*2+1] = 255; + dest[i*2+0] = src[i]; + } + } else { + STBI_ASSERT(img_n == 3); + for (i=x-1; i >= 0; --i) { + dest[i*4+3] = 255; + dest[i*4+2] = src[i*3+2]; + dest[i*4+1] = src[i*3+1]; + dest[i*4+0] = src[i*3+0]; + } + } +} + // create the png data from post-deflated data static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color) { - int bytes = (depth == 16? 2 : 1); + int bytes = (depth == 16 ? 2 : 1); stbi__context *s = a->s; stbi__uint32 i,j,stride = x*out_n*bytes; stbi__uint32 img_len, img_width_bytes; + stbi_uc *filter_buf; + int all_ok = 1; int k; int img_n = s->img_n; // copy it into a local for later @@ -4608,8 +4712,11 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into if (!a->out) return stbi__err("outofmem", "Out of memory"); + // note: error exits here don't need to clean up a->out individually, + // stbi__do_png always does on error. if (!stbi__mad3sizes_valid(img_n, x, depth, 7)) return stbi__err("too large", "Corrupt PNG"); img_width_bytes = (((img_n * x * depth) + 7) >> 3); + if (!stbi__mad2sizes_valid(img_width_bytes, y, img_width_bytes)) return stbi__err("too large", "Corrupt PNG"); img_len = (img_width_bytes + 1) * y; // we used to check for exact match between raw_len and img_len on non-interlaced PNGs, @@ -4617,189 +4724,137 @@ static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 r // so just check for raw_len < img_len always. if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG"); + // Allocate two scan lines worth of filter workspace buffer. + filter_buf = (stbi_uc *) stbi__malloc_mad2(img_width_bytes, 2, 0); + if (!filter_buf) return stbi__err("outofmem", "Out of memory"); + + // Filtering for low-bit-depth images + if (depth < 8) { + filter_bytes = 1; + width = img_width_bytes; + } + for (j=0; j < y; ++j) { - stbi_uc *cur = a->out + stride*j; - stbi_uc *prior; + // cur/prior filter buffers alternate + stbi_uc *cur = filter_buf + (j & 1)*img_width_bytes; + stbi_uc *prior = filter_buf + (~j & 1)*img_width_bytes; + stbi_uc *dest = a->out + stride*j; + int nk = width * filter_bytes; int filter = *raw++; - if (filter > 4) - return stbi__err("invalid filter","Corrupt PNG"); - - if (depth < 8) { - if (img_width_bytes > x) return stbi__err("invalid width","Corrupt PNG"); - cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place - filter_bytes = 1; - width = img_width_bytes; + // check filter type + if (filter > 4) { + all_ok = stbi__err("invalid filter","Corrupt PNG"); + break; } - prior = cur - stride; // bugfix: need to compute this after 'cur +=' computation above // if first row, use special filter that doesn't sample previous row if (j == 0) filter = first_row_filter[filter]; - // handle first byte explicitly - for (k=0; k < filter_bytes; ++k) { - switch (filter) { - case STBI__F_none : cur[k] = raw[k]; break; - case STBI__F_sub : cur[k] = raw[k]; break; - case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break; - case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break; - case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break; - case STBI__F_avg_first : cur[k] = raw[k]; break; - case STBI__F_paeth_first: cur[k] = raw[k]; break; - } - } - - if (depth == 8) { - if (img_n != out_n) - cur[img_n] = 255; // first pixel - raw += img_n; - cur += out_n; - prior += out_n; - } else if (depth == 16) { - if (img_n != out_n) { - cur[filter_bytes] = 255; // first pixel top byte - cur[filter_bytes+1] = 255; // first pixel bottom byte - } - raw += filter_bytes; - cur += output_bytes; - prior += output_bytes; - } else { - raw += 1; - cur += 1; - prior += 1; + // perform actual filtering + switch (filter) { + case STBI__F_none: + memcpy(cur, raw, nk); + break; + case STBI__F_sub: + memcpy(cur, raw, filter_bytes); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); + break; + case STBI__F_up: + for (k = 0; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); + break; + case STBI__F_avg: + for (k = 0; k < filter_bytes; ++k) + cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); + break; + case STBI__F_paeth: + for (k = 0; k < filter_bytes; ++k) + cur[k] = STBI__BYTECAST(raw[k] + prior[k]); // prior[k] == stbi__paeth(0,prior[k],0) + for (k = filter_bytes; k < nk; ++k) + cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes], prior[k], prior[k-filter_bytes])); + break; + case STBI__F_avg_first: + memcpy(cur, raw, filter_bytes); ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-08-28 01:05:11
|
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 698c12cc65d16dee55ed5b6106767bdea2e1056c (commit) via bedf52662a10f267a422d1227d178e8972cd38e4 (commit) from 715eb80e6e0ca1edf343b0fecee3275a67a5fab3 (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 698c12cc65d16dee55ed5b6106767bdea2e1056c Author: Andy Barajas <and...@gm...> Date: Tue Aug 27 18:04:21 2024 -0700 Fix incorrect file handle checks (#730) commit bedf52662a10f267a422d1227d178e8972cd38e4 Author: Falco Girgis <gyr...@gm...> Date: Tue Aug 27 11:43:10 2024 -0500 Added POSIX settimeofday() (#661) * Added settimeofday() POSIX funtion from sys/time.h - Newlib declares this function for us but never bothers to defined it for our target. - It can be defined trivially by just forwarding the call to clock_settime() and converting usecs to nsecs. - Made rtc_set_unix_sets() return standard POSIX codes, so that clock_settime() and settimeofday() can simply forward the call and have errno set automatically from the RTC driver (which now has errno support) * updated documentation. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/libdream/cdfs/cdfs.c | 4 ++-- kernel/arch/dreamcast/include/arch/rtc.h | 34 +++++++++++++++++++------------- kernel/arch/dreamcast/kernel/rtc.c | 10 ++++++++-- kernel/libc/posix/Makefile | 2 +- kernel/libc/posix/settimeofday.c | 24 ++++++++++++++++++++++ 5 files changed, 55 insertions(+), 19 deletions(-) create mode 100644 kernel/libc/posix/settimeofday.c diff --git a/examples/dreamcast/libdream/cdfs/cdfs.c b/examples/dreamcast/libdream/cdfs/cdfs.c index a482a286..33e3b43c 100644 --- a/examples/dreamcast/libdream/cdfs/cdfs.c +++ b/examples/dreamcast/libdream/cdfs/cdfs.c @@ -16,7 +16,7 @@ void cdfs_test(void) { /* Read and print the root directory */ d = fs_open("/cd", O_RDONLY | O_DIR); - if(d == 0) { + if(d < 0) { printf("Can't open root!\r\n"); return; } @@ -37,7 +37,7 @@ void cdfs_test(void) { /* Read and print a file called README.TXT (if any) */ fd = fs_open("/cd/readme.txt", O_RDONLY); - if(fd == 0) { + if(fd < 0) { printf("Can't open file README.TXT for reading.\r\n"); return; } diff --git a/kernel/arch/dreamcast/include/arch/rtc.h b/kernel/arch/dreamcast/include/arch/rtc.h index 4042a08a..ccbe294d 100644 --- a/kernel/arch/dreamcast/include/arch/rtc.h +++ b/kernel/arch/dreamcast/include/arch/rtc.h @@ -1,8 +1,8 @@ /* KallistiOS ##version## arch/dreamcast/include/rtc.h - Copyright (C) 2000-2001 Megan Potter - Copyright (C) 2023 Falco Girgis + Copyright (C) 2000, 2001 Megan Potter + Copyright (C) 2023, 2024 Falco Girgis */ @@ -57,11 +57,12 @@ __BEGIN_DECLS Y2K and the last timestamp it can represent before rolling over is February 06 2086 06:28:15. - \sa wdt + \sa wdt, timers, perf_counters + + @{ */ /** \brief Get the current date/time. - \ingroup rtc This function retrieves the current RTC value as a standard UNIX timestamp (with an epoch of January 1, 1970 00:00). This is assumed to be in the @@ -69,12 +70,11 @@ __BEGIN_DECLS \return The current UNIX-style timestamp (local time). - \sa rtc_set_unix_secs(), rtc_boot_time() + \sa rtc_set_unix_secs() */ time_t rtc_unix_secs(void); /** \brief Set the current date/time. - \ingroup rtc This function sets the current RTC value as a standard UNIX timestamp (with an epoch of January 1, 1970 00:00). This is assumed to be in the @@ -85,32 +85,38 @@ time_t rtc_unix_secs(void); uses a 32-bit timestamp (which also has a different epoch), not all `time_t` values can be represented within the RTC! - \param time Unix timestamp to set the current time to + \param time Unix timestamp to set the current time to + + \return 0 for success or -1 for failure (with errno set + appropriately). - \return 0 for success or -1 for failure + \exception EINVAL \p time was an invalid timestamp or could not be + represented on the AICA's RTC. + \exception EPERM Failed to set and successfully read back \p time + from the RTC. \sa rtc_unix_secs() */ int rtc_set_unix_secs(time_t time); /** \brief Get the time since the system was booted. - \ingroup rtc - This function retrieves the cached RTC value from when KallistiOS was started. As - with rtc_unix_secs(), this is a UNIX-style timestamp in local time. + This function retrieves the cached RTC value from when KallistiOS was + started. As with rtc_unix_secs(), this is a UNIX-style timestamp in + local time. \return The boot time as a UNIX-style timestamp. - - \sa rtc_unix_secs() */ time_t rtc_boot_time(void); -/* \cond */ +/* \cond INTERNAL */ /* Internally called Init / Shutdown */ int rtc_init(void); void rtc_shutdown(void); /* \endcond */ +/** @} */ + __END_DECLS #endif /* __ARCH_RTC_H */ diff --git a/kernel/arch/dreamcast/kernel/rtc.c b/kernel/arch/dreamcast/kernel/rtc.c index d18c8f18..d6d71d18 100644 --- a/kernel/arch/dreamcast/kernel/rtc.c +++ b/kernel/arch/dreamcast/kernel/rtc.c @@ -28,8 +28,10 @@ #include <arch/rtc.h> #include <arch/timer.h> #include <dc/g2bus.h> + #include <stdint.h> #include <assert.h> +#include <errno.h> /* High 16-bit Timestamp Value @@ -125,8 +127,10 @@ int rtc_set_unix_secs(time_t secs) { const uint32_t adjusted = (const uint32_t)adjusted_time; /* Protect against underflowing or overflowing our 32-bit timestamp. */ - if(adjusted_time < 0 || adjusted_time > UINT32_MAX) + if(adjusted_time < 0 || adjusted_time > UINT32_MAX) { + errno = EINVAL; return -1; + } /* Enable writing by setting LSB of control */ g2_write_32(RTC_CTRL_ADDR, RTC_CTRL_WRITE_EN); @@ -151,8 +155,10 @@ int rtc_set_unix_secs(time_t secs) { /* Signify failure if the fetched time never matched the time we attempted to set. */ - if(i == RTC_RETRY_COUNT) + if(i == RTC_RETRY_COUNT) { + errno = EPERM; result = -1; + } /* We have to update the boot time now as well, subtracting the amount of time that has elapsed since boot from the diff --git a/kernel/libc/posix/Makefile b/kernel/libc/posix/Makefile index b38f6502..3b495f6a 100644 --- a/kernel/libc/posix/Makefile +++ b/kernel/libc/posix/Makefile @@ -11,6 +11,6 @@ # CFLAGS += -std=gnu11 -OBJS = posix_memalign.o clock_gettime.o sysconf.o +OBJS = posix_memalign.o clock_gettime.o settimeofday.o sysconf.o include $(KOS_BASE)/Makefile.prefab diff --git a/kernel/libc/posix/settimeofday.c b/kernel/libc/posix/settimeofday.c new file mode 100644 index 00000000..da4f5aa9 --- /dev/null +++ b/kernel/libc/posix/settimeofday.c @@ -0,0 +1,24 @@ +/* KallistiOS ##version## + + settimeofday.c + Copyright (C) 2024 Falco Girgis +*/ + +#include <time.h> +#include <sys/time.h> +#include <errno.h> + +int settimeofday(const struct timeval *tv, const struct timezone *tz) { + struct timespec tspec; + (void)tz; + + if(!tv) { + errno = EFAULT; + return -1; + } + + tspec.tv_sec = tv->tv_sec; + tspec.tv_nsec = tv->tv_usec * 1000; + + return clock_settime(CLOCK_REALTIME, &tspec); +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-08-27 16:19:15
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 715eb80e6e0ca1edf343b0fecee3275a67a5fab3 (commit) via 0ba2d733dbcda4e735adfd876c501720a2ab1e50 (commit) via d6260e268f41f22065001508d041ff7f864beeb8 (commit) from d2ace52770a1f001847db31f829c3a572c9b8730 (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 715eb80e6e0ca1edf343b0fecee3275a67a5fab3 Merge: d2ace527 0ba2d733 Author: darcagn <da...@pr...> Date: Tue Aug 27 11:18:13 2024 -0500 Merge pull request #729 from DC-SWAT/g1_dma_unlock Unlock all memory for G1 ATA DMA. commit 0ba2d733dbcda4e735adfd876c501720a2ab1e50 Author: DC-SWAT <sw...@21...> Date: Tue Aug 27 20:34:20 2024 +0700 Manage cache only on system RAM. commit d6260e268f41f22065001508d041ff7f864beeb8 Author: DC-SWAT <sw...@21...> Date: Tue Aug 27 15:59:15 2024 +0700 Unlock all memory for G1 ATA DMA. This allows data to be loaded directly into video and audio memory. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/g1ata.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/g1ata.c b/kernel/arch/dreamcast/hardware/g1ata.c index 777c8b52..badc9ebc 100644 --- a/kernel/arch/dreamcast/hardware/g1ata.c +++ b/kernel/arch/dreamcast/hardware/g1ata.c @@ -2,7 +2,7 @@ hardware/g1ata.c Copyright (C) 2013, 2014, 2015 Lawrence Sebald - Copyright (C) 2015, 2023 Ruslan Rostovtsev + Copyright (C) 2015, 2023, 2024 Ruslan Rostovtsev */ #include <errno.h> @@ -109,8 +109,12 @@ typedef struct ata_devdata { #define G1_ATA_DMA_STATUS 0xA05F7418 /* Read/Write */ #define G1_ATA_DMA_PROTECTION 0xA05F74B8 /* Write-only */ +/* Protection register code. */ +#define G1_DMA_UNLOCK_CODE 0x8843 /* System memory protection unlock value. */ -#define G1_DMA_UNLOCK_SYSMEM 0x8843407F +#define G1_DMA_UNLOCK_SYSMEM (G1_DMA_UNLOCK_CODE << 16 | 0x407F) +/* All memory protection unlock value. */ +#define G1_DMA_UNLOCK_ALLMEM (G1_DMA_UNLOCK_CODE << 16 | 0x007F) /* Bitmasks for the STATUS_REG/ALT_STATUS registers. */ #define G1_ATA_SR_ERR 0x01 @@ -665,8 +669,10 @@ int g1_ata_read_lba_dma(uint64_t sector, size_t count, void *buf, return -1; } - /* Invalidate the dcache over the range of the data. */ - dcache_inval_range((uint32)buf, count * 512); + if((addr >> 24) == 0x0C) { + /* Invalidate the dcache over the range of the data. */ + dcache_inval_range((uint32)buf, count * 512); + } /* Lock the mutex. It will be unlocked later in the IRQ handler. */ if(g1_ata_mutex_lock()) @@ -845,8 +851,10 @@ int g1_ata_write_lba_dma(uint64_t sector, size_t count, const void *buf, return -1; } - /* Flush the dcache over the range of the data. */ - dcache_flush_range((uint32)buf, count * 512); + if((addr >> 24) == 0x0C) { + /* Flush the dcache over the range of the data. */ + dcache_flush_range((uint32)buf, count * 512); + } /* Lock the mutex. It will be unlocked in the IRQ handler later. */ if(g1_ata_mutex_lock()) @@ -1057,7 +1065,7 @@ static int g1_ata_scan(void) { if(!g1_ata_set_transfer_mode(ATA_TRANSFER_WDMA(2))) { OUT32(G1_ATA_DMA_RACCESS_WAIT, G1_ACCESS_WDMA_MODE2); OUT32(G1_ATA_DMA_WACCESS_WAIT, G1_ACCESS_WDMA_MODE2); - OUT32(G1_ATA_DMA_PROTECTION, G1_DMA_UNLOCK_SYSMEM); + OUT32(G1_ATA_DMA_PROTECTION, G1_DMA_UNLOCK_ALLMEM); } else { device.wdma_modes = 0; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: quzar <qu...@us...> - 2024-08-24 19:58:05
|
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 d2ace52770a1f001847db31f829c3a572c9b8730 (commit) from 6e3584b4874fef191384ec50ff1ffae25e0e1882 (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 d2ace52770a1f001847db31f829c3a572c9b8730 Author: Falco Girgis <gyr...@gm...> Date: Sat Aug 24 14:57:30 2024 -0500 Fixed Overflow with Writing PVR BG Plane (#694) * Fixed overflow with writing pvr bg plane. - skmp (correctly) reported that our little loop to copy the internally populated pvr_bkg_poly_t polygon (which gets color info from pvr_set_bg_color()) was looping too far. * structure is only 60 bytes, we looped for 64 and then wrote another word even beyond that. - swapped implementation to use memcpy() based on sizeof(pvr_bkg_poly_t) which is safer, and is smart enough to do per-word operations when they are valid (not here, lolz). - removed final vrl[0x11] = 0 assignment, as it clearly wasn't necessary and doesn't appear to even be doing anything useful at-all. The BG polygon types are special and don't need end-of-list flags, and interpolate the 4th vertex, more like PVR sprites. * Fixed PVR BG clear color code - VRAM writes need to be word-sized, and while mempcy() was doing the right thing internally, that's sketchy... explicitly using mempcy4() now. * Adjusted PVR BG plane size based on FB resolution. - Also cleaned up the code a bit. - Changed Z coord to FLT_EPSILON instead of 0.2f. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/pvr/pvr_misc.c | 43 +++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c index 061b9c33..b484dc99 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_misc.c @@ -8,9 +8,13 @@ #include <assert.h> #include <string.h> +#include <float.h> + #include <arch/timer.h> #include <dc/pvr.h> #include <dc/video.h> +#include <kos/string.h> + #include "pvr_internal.h" /* @@ -174,9 +178,8 @@ void pvr_begin_queued_render(void) { volatile pvr_ta_buffers_t * tbuf; volatile pvr_frame_buffers_t * rbuf; pvr_bkg_poly_t bkg; - uint32 *vrl, *bkgdata; + uint32_t *vrl; uint32 vert_end; - int i; int bufn = pvr_state.view_target; union { float f; @@ -197,26 +200,22 @@ void pvr_begin_queued_render(void) { /* Throw the background data on the end of the TA's list */ bkg.flags1 = 0x90800000; /* These are from libdream.. ought to figure out */ bkg.flags2 = 0x20800440; /* what they mean for sure... heh =) */ - bkg.dummy = 0; - bkg.x1 = 0.0f; - bkg.y1 = 480.0f; - bkg.z1 = 0.2f; - bkg.argb1 = pvr_state.bg_color; - bkg.x2 = 0.0f; - bkg.y2 = 0.0f; - bkg.z2 = 0.2f; - bkg.argb2 = pvr_state.bg_color; - bkg.x3 = 640.0f; - bkg.y3 = 480.0f; - bkg.z3 = 0.2f; - bkg.argb3 = pvr_state.bg_color; - bkgdata = (uint32 *)&bkg; - vrl = (uint32*)(PVR_RAM_BASE | PVR_GET(PVR_TA_VERTBUF_POS)); - - for(i = 0; i < 0x10; i++) - vrl[i] = bkgdata[i]; - - vrl[0x11] = 0; + bkg.dummy = 0; + bkg.x1 = 0.0f; + bkg.y1 = pvr_state.h; + bkg.z1 = FLT_EPSILON; + bkg.argb1 = pvr_state.bg_color; + bkg.x2 = 0.0f; + bkg.y2 = 0.0f; + bkg.z2 = FLT_EPSILON; + bkg.argb2 = pvr_state.bg_color; + bkg.x3 = pvr_state.w; + bkg.y3 = pvr_state.h; + bkg.z3 = FLT_EPSILON; + bkg.argb3 = pvr_state.bg_color; + vrl = (uint32_t *)(PVR_RAM_BASE | PVR_GET(PVR_TA_VERTBUF_POS)); + + memcpy4(vrl, &bkg, sizeof(bkg)); /* Reset the ISP/TSP, just in case */ //PVR_SET(PVR_RESET, PVR_RESET_ISPTSP); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-08-23 02:20:02
|
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 6e3584b4874fef191384ec50ff1ffae25e0e1882 (commit) from 4346a85740d341587fd151cf47475b74fff9eeb4 (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 6e3584b4874fef191384ec50ff1ffae25e0e1882 Author: Andy Barajas <and...@gm...> Date: Thu Aug 22 19:19:21 2024 -0700 Fix KOS warning when compiling SDL2 using m4-single (#724) * Fix warning when compiling SDL2 using m4-single * Update kernel/arch/dreamcast/include/arch/args.h ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/arch/args.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/arch/dreamcast/include/arch/args.h b/kernel/arch/dreamcast/include/arch/args.h index 63a2c4ec..56f3ffe8 100644 --- a/kernel/arch/dreamcast/include/arch/args.h +++ b/kernel/arch/dreamcast/include/arch/args.h @@ -14,7 +14,7 @@ \author Paul Cercueil */ -#if __SH4_SINGLE_ONLY__ +#ifdef __SH4_SINGLE_ONLY__ #define KOS_SH4_SINGLE_ONLY 1 #else #define KOS_SH4_SINGLE_ONLY 0 hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-08-21 20:10: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 4346a85740d341587fd151cf47475b74fff9eeb4 (commit) via 9d759bc67d15f8faaecaa89d4fe91c147fbb7155 (commit) via 08c583f3fa1b44aac6a032be12a8ff9c334d7acf (commit) from cdff9466a32a5f59d9139513786adc6184c3adce (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 4346a85740d341587fd151cf47475b74fff9eeb4 Merge: 08c583f3 9d759bc6 Author: darcagn <da...@pr...> Date: Wed Aug 21 12:11:26 2024 -0500 Merge pull request #723 from pcercuei/fix-lba48 g1ata: Restore LBA48 support commit 9d759bc67d15f8faaecaa89d4fe91c147fbb7155 Author: Paul Cercueil <pa...@cr...> Date: Wed Aug 21 19:02:57 2024 +0200 g1ata: Restore LBA48 support The introduction of chained LBA28 DMA transfers accidentally broke LBA48 support. Restore LBA48 support by checking that we're actually using a non-LBA48 drive before trying to chain DMA descriptors. Signed-off-by: Paul Cercueil <pa...@cr...> commit 08c583f3fa1b44aac6a032be12a8ff9c334d7acf Author: darcagn <da...@pr...> Date: Wed Aug 21 10:51:42 2024 -0500 Adjust pvrtex .gitignore and Makefile (#721) -Create info folder as needed rather than forcing it to always exist. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/g1ata.c | 3 ++- utils/pvrtex/.gitignore | 1 + utils/pvrtex/Makefile | 3 ++- utils/pvrtex/info/.gitkeep | 0 4 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 utils/pvrtex/info/.gitkeep diff --git a/kernel/arch/dreamcast/hardware/g1ata.c b/kernel/arch/dreamcast/hardware/g1ata.c index 7faa8c0a..777c8b52 100644 --- a/kernel/arch/dreamcast/hardware/g1ata.c +++ b/kernel/arch/dreamcast/hardware/g1ata.c @@ -232,13 +232,14 @@ static void g1_ata_set_sector_and_count(uint64_t sector, uint32_t count, int lba } static void g1_dma_irq_hnd(uint32 code, void *data) { + int can_lba48 = CAN_USE_LBA48(); unsigned int nb_sectors; /* XXXX: Probably should look at the code to make sure it isn't an error. */ (void)code; (void)data; - if(dma_in_progress && dma_nb_sectors > 256) { + if(dma_in_progress && !can_lba48 && dma_nb_sectors > 256) { dma_sector += 256; dma_nb_sectors -= 256; nb_sectors = dma_nb_sectors <= 256 ? dma_nb_sectors : 256; diff --git a/utils/pvrtex/.gitignore b/utils/pvrtex/.gitignore index 1d3690fa..e1fdd06b 100644 --- a/utils/pvrtex/.gitignore +++ b/utils/pvrtex/.gitignore @@ -1,2 +1,3 @@ +info/ pvrtex README diff --git a/utils/pvrtex/Makefile b/utils/pvrtex/Makefile index d736110b..1acf1204 100644 --- a/utils/pvrtex/Makefile +++ b/utils/pvrtex/Makefile @@ -19,6 +19,7 @@ MYCFLAGS=$(MYFLAGS) -Wno-pointer-sign define textSegment2Header + mkdir -p info awk '/$1/,/--------------------------------------------------------------------------/' README > $2/$3.txt $(KOS_BASE)/utils/bin2c/bin2c $2/$3.txt $2/$3.h $(3)_txt rm $2/$3.txt @@ -47,7 +48,7 @@ README: readme_unformatted.txt all: $(TARGET) README -install: all +install: all install -m 755 $(TARGET) $(DC_TOOLS_BASE)/ info/options.h: README Makefile diff --git a/utils/pvrtex/info/.gitkeep b/utils/pvrtex/info/.gitkeep deleted file mode 100644 index e69de29b..00000000 hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: darcagn <da...@us...> - 2024-08-20 15:30:55
|
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 cdff9466a32a5f59d9139513786adc6184c3adce (commit) from c2d45545e439c0624865b792a23653bb3dfd956b (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 cdff9466a32a5f59d9139513786adc6184c3adce Author: dfchil <dan...@gm...> Date: Tue Aug 20 17:29:43 2024 +0200 Pvrtex minor fixes (#720) * removed dependency on xxd, used the standarized install path in $DC_TOOLS_BASE * removed the autogenerated info/*.h files --------- Co-authored-by: Daniel Fairchild <da...@vi...> ----------------------------------------------------------------------- Summary of changes: utils/pvrtex/Makefile | 14 +- utils/pvrtex/info/examples.h | 175 ------- utils/pvrtex/info/options.h | 1030 ------------------------------------------ utils/pvrtex/main.c | 4 +- 4 files changed, 8 insertions(+), 1215 deletions(-) delete mode 100644 utils/pvrtex/info/examples.h delete mode 100644 utils/pvrtex/info/options.h diff --git a/utils/pvrtex/Makefile b/utils/pvrtex/Makefile index 40e17a3e..d736110b 100644 --- a/utils/pvrtex/Makefile +++ b/utils/pvrtex/Makefile @@ -19,15 +19,13 @@ MYCFLAGS=$(MYFLAGS) -Wno-pointer-sign define textSegment2Header - awk '/$1/,/--------------------------------------------------------------------------/' README|xxd -i -n $2_$3 > $2/$3.h + awk '/$1/,/--------------------------------------------------------------------------/' README > $2/$3.txt + $(KOS_BASE)/utils/bin2c/bin2c $2/$3.txt $2/$3.h $(3)_txt + rm $2/$3.txt endef - -TOOLINSTALLDIR=$(KOS_BASE)/../bin - .PHONY: all clean - $(TARGET): $(OBJS) gcc $(OPTMODE) -o $(TARGET) \ $(OBJS) $(PROGMAIN) -lm -lstdc++ @@ -50,10 +48,10 @@ README: readme_unformatted.txt all: $(TARGET) README install: all - install -m 755 $(TARGET) $(TOOLINSTALLDIR)/ + install -m 755 $(TARGET) $(DC_TOOLS_BASE)/ -info/options.h: README +info/options.h: README Makefile $(call textSegment2Header,Command Line Options:,info,options) -info/examples.h: README +info/examples.h: README Makefile $(call textSegment2Header,Usage Examples:,info,examples) diff --git a/utils/pvrtex/info/examples.h b/utils/pvrtex/info/examples.h deleted file mode 100644 index 1888d1e8..00000000 --- a/utils/pvrtex/info/examples.h +++ /dev/null @@ -1,175 +0,0 @@ -unsigned char info_examples[] = { - 0x55, 0x73, 0x61, 0x67, 0x65, 0x20, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, - 0x65, 0x73, 0x3a, 0x0a, 0x0a, 0x70, 0x76, 0x72, 0x74, 0x65, 0x78, 0x20, - 0x2d, 0x69, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x6e, - 0x67, 0x20, 0x2d, 0x6f, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, - 0x2e, 0x64, 0x74, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, - 0x73, 0x20, 0x61, 0x20, 0x50, 0x4e, 0x47, 0x20, 0x66, 0x69, 0x6c, 0x65, - 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x44, 0x54, 0x20, 0x66, 0x69, 0x6c, - 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, 0x77, - 0x69, 0x64, 0x64, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x75, 0x6e, 0x63, 0x6f, - 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x0a, 0x09, 0x74, 0x65, - 0x78, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, - 0x75, 0x74, 0x20, 0x6d, 0x69, 0x70, 0x6d, 0x61, 0x70, 0x73, 0x2e, 0x20, - 0x54, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x69, - 0x73, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x61, - 0x6c, 0x6c, 0x79, 0x20, 0x63, 0x68, 0x6f, 0x73, 0x65, 0x6e, 0x0a, 0x09, - 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, - 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, - 0x6e, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x28, 0x53, 0x65, 0x65, 0x20, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, - 0x72, 0x0a, 0x09, 0x41, 0x55, 0x54, 0x4f, 0x20, 0x74, 0x65, 0x78, 0x74, - 0x75, 0x72, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x69, - 0x6e, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x6f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x69, 0x6e, 0x67, - 0x29, 0x2e, 0x0a, 0x0a, 0x70, 0x76, 0x72, 0x74, 0x65, 0x78, 0x20, 0x2d, - 0x69, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x6e, 0x67, - 0x20, 0x2d, 0x6f, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e, - 0x64, 0x74, 0x20, 0x2d, 0x66, 0x20, 0x61, 0x72, 0x67, 0x62, 0x34, 0x34, - 0x34, 0x34, 0x20, 0x2d, 0x64, 0x20, 0x2d, 0x63, 0x20, 0x36, 0x34, 0x20, - 0x2d, 0x6d, 0x20, 0x71, 0x75, 0x61, 0x6c, 0x69, 0x74, 0x79, 0x20, 0x2d, - 0x72, 0x20, 0x2d, 0x52, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x74, 0x73, 0x20, 0x61, 0x20, 0x50, 0x4e, 0x47, 0x20, 0x66, 0x69, 0x6c, - 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x44, 0x54, 0x20, 0x66, 0x69, - 0x6c, 0x65, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, 0x20, 0x74, - 0x77, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x64, 0x2c, 0x20, 0x63, 0x6f, 0x6d, - 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x0a, 0x09, 0x74, 0x65, 0x78, - 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6d, - 0x69, 0x70, 0x6d, 0x61, 0x70, 0x73, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, - 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x77, 0x69, 0x6c, 0x6c, - 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x41, 0x52, 0x47, - 0x42, 0x34, 0x34, 0x34, 0x34, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x0a, - 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2c, 0x20, 0x61, 0x6e, 0x64, - 0x20, 0x64, 0x69, 0x74, 0x68, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x20, 0x49, - 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x61, 0x0a, - 0x09, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x20, 0x70, 0x6f, 0x77, 0x65, - 0x72, 0x2d, 0x6f, 0x66, 0x2d, 0x74, 0x77, 0x6f, 0x2c, 0x20, 0x69, 0x74, - 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x73, - 0x69, 0x7a, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x6e, 0x65, 0x61, 0x72, 0x65, 0x73, 0x74, 0x20, 0x73, - 0x71, 0x75, 0x61, 0x72, 0x65, 0x0a, 0x09, 0x70, 0x6f, 0x77, 0x65, 0x72, - 0x2d, 0x6f, 0x66, 0x2d, 0x74, 0x77, 0x6f, 0x2e, 0x20, 0x54, 0x68, 0x65, - 0x20, 0x63, 0x6f, 0x64, 0x65, 0x62, 0x6f, 0x6f, 0x6b, 0x20, 0x75, 0x73, - 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, - 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x69, - 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, - 0x64, 0x0a, 0x09, 0x74, 0x6f, 0x20, 0x36, 0x34, 0x20, 0x65, 0x6e, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x66, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x61, - 0x6c, 0x20, 0x32, 0x35, 0x36, 0x3b, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, - 0x72, 0x65, 0x64, 0x75, 0x63, 0x65, 0x73, 0x20, 0x71, 0x75, 0x61, 0x6c, - 0x69, 0x74, 0x79, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x09, 0x72, 0x65, - 0x64, 0x75, 0x63, 0x65, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x69, - 0x7a, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, - 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x62, 0x79, 0x20, 0x31, 0x2e, 0x35, - 0x20, 0x4b, 0x42, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x6d, 0x70, - 0x72, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x66, 0x69, 0x6c, 0x6c, 0x72, 0x61, - 0x74, 0x65, 0x2e, 0x0a, 0x0a, 0x70, 0x76, 0x72, 0x74, 0x65, 0x78, 0x20, - 0x2d, 0x69, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x70, 0x6e, - 0x67, 0x20, 0x2d, 0x6f, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, - 0x2e, 0x64, 0x74, 0x20, 0x2d, 0x66, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, - 0x6c, 0x20, 0x2d, 0x6d, 0x0a, 0x09, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, - 0x74, 0x73, 0x20, 0x61, 0x20, 0x50, 0x4e, 0x47, 0x20, 0x66, 0x69, 0x6c, - 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, - 0x20, 0x61, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x6d, 0x61, - 0x70, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x44, 0x54, 0x20, 0x66, 0x69, - 0x6c, 0x65, 0x2c, 0x0a, 0x09, 0x77, 0x69, 0x74, 0x68, 0x20, 0x6d, 0x69, - 0x70, 0x6d, 0x61, 0x70, 0x73, 0x2e, 0x0a, 0x0a, 0x70, 0x76, 0x72, 0x74, - 0x65, 0x78, 0x20, 0x2d, 0x69, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x2d, 0x6f, 0x20, 0x74, 0x65, 0x78, 0x74, - 0x75, 0x72, 0x65, 0x2e, 0x64, 0x74, 0x20, 0x2d, 0x73, 0x0a, 0x09, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x73, 0x20, 0x61, 0x20, 0x50, 0x4e, - 0x47, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, - 0x6e, 0x6f, 0x6e, 0x74, 0x77, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x64, 0x20, - 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x20, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x69, 0x73, 0x20, 0x6e, - 0x6f, 0x74, 0x0a, 0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, - 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x70, 0x6f, 0x77, - 0x65, 0x72, 0x2d, 0x6f, 0x66, 0x2d, 0x74, 0x77, 0x6f, 0x20, 0x77, 0x69, - 0x64, 0x74, 0x68, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x61, 0x6e, - 0x20, 0x61, 0x6c, 0x73, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x61, 0x6e, 0x79, - 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x0a, 0x09, 0x6f, - 0x66, 0x20, 0x33, 0x32, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x69, 0x73, - 0x20, 0x3c, 0x3d, 0x20, 0x31, 0x30, 0x32, 0x34, 0x2e, 0x0a, 0x0a, 0x70, - 0x76, 0x72, 0x74, 0x65, 0x78, 0x20, 0x2d, 0x69, 0x20, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x2d, 0x6f, 0x20, 0x74, - 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x64, 0x74, 0x20, 0x2d, 0x66, - 0x20, 0x70, 0x61, 0x6c, 0x38, 0x62, 0x70, 0x70, 0x20, 0x2d, 0x43, 0x20, - 0x36, 0x34, 0x20, 0x2d, 0x64, 0x20, 0x2d, 0x70, 0x20, 0x70, 0x72, 0x65, - 0x76, 0x69, 0x65, 0x77, 0x2e, 0x70, 0x6e, 0x67, 0x0a, 0x09, 0x43, 0x6f, - 0x6e, 0x76, 0x65, 0x72, 0x74, 0x73, 0x20, 0x61, 0x20, 0x50, 0x4e, 0x47, - 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x20, 0x44, - 0x54, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, - 0x38, 0x2d, 0x62, 0x69, 0x74, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, - 0x20, 0x54, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, - 0x6e, 0x67, 0x0a, 0x09, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x77, 0x69, - 0x6c, 0x6c, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6d, - 0x6f, 0x72, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x36, 0x34, 0x20, - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6f, - 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x20, 0x32, 0x35, 0x36, 0x2c, 0x0a, 0x09, 0x61, 0x6e, - 0x64, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x64, 0x69, - 0x74, 0x68, 0x65, 0x72, 0x65, 0x64, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, - 0x70, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x20, - 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, - 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x20, 0x77, 0x72, 0x69, 0x74, - 0x74, 0x65, 0x6e, 0x0a, 0x09, 0x74, 0x6f, 0x20, 0x74, 0x65, 0x78, 0x74, - 0x75, 0x72, 0x65, 0x2e, 0x64, 0x74, 0x2e, 0x70, 0x61, 0x6c, 0x2e, 0x20, - 0x41, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x6f, 0x66, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, - 0x6e, 0x67, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x77, - 0x69, 0x6c, 0x6c, 0x20, 0x62, 0x65, 0x0a, 0x09, 0x77, 0x72, 0x69, 0x74, - 0x74, 0x65, 0x6e, 0x20, 0x74, 0x6f, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, - 0x65, 0x77, 0x2e, 0x70, 0x6e, 0x67, 0x2e, 0x0a, 0x0a, 0x70, 0x76, 0x72, - 0x74, 0x65, 0x78, 0x20, 0x2d, 0x69, 0x20, 0x6d, 0x69, 0x70, 0x32, 0x35, - 0x36, 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x2d, 0x69, 0x20, 0x6d, 0x69, 0x70, - 0x31, 0x32, 0x38, 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x2d, 0x69, 0x20, 0x6d, - 0x69, 0x70, 0x36, 0x34, 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x2d, 0x69, 0x20, - 0x6d, 0x69, 0x70, 0x33, 0x32, 0x2e, 0x70, 0x6e, 0x67, 0x20, 0x2d, 0x69, - 0x20, 0x6d, 0x69, 0x70, 0x31, 0x36, 0x2e, 0x70, 0x6e, 0x67, 0x0a, 0x2d, - 0x6f, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x64, 0x74, - 0x20, 0x2d, 0x6d, 0x0a, 0x09, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x73, 0x20, 0x61, 0x20, 0x6d, 0x69, 0x70, 0x6d, 0x61, 0x70, 0x70, - 0x65, 0x64, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, - 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, - 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x0a, 0x09, 0x61, 0x73, - 0x20, 0x75, 0x73, 0x65, 0x72, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, - 0x64, 0x20, 0x6d, 0x69, 0x70, 0x6d, 0x61, 0x70, 0x20, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x73, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x20, - 0x6f, 0x66, 0x20, 0x61, 0x75, 0x74, 0x6f, 0x6d, 0x61, 0x74, 0x69, 0x63, - 0x61, 0x6c, 0x6c, 0x79, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x69, 0x6e, 0x67, 0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x20, 0x6f, 0x66, 0x20, - 0x74, 0x68, 0x65, 0x6d, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x61, 0x20, 0x6d, - 0x69, 0x70, 0x6d, 0x61, 0x70, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x20, - 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, - 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75, 0x73, - 0x65, 0x72, 0x2c, 0x20, 0x69, 0x74, 0x0a, 0x09, 0x77, 0x69, 0x6c, 0x6c, - 0x20, 0x62, 0x65, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x20, 0x68, 0x69, 0x67, - 0x68, 0x65, 0x72, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x2e, 0x20, 0x42, - 0x79, 0x20, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x2c, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x65, 0x72, 0x0a, 0x09, 0x6c, - 0x65, 0x76, 0x65, 0x6c, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x6e, 0x6f, - 0x74, 0x20, 0x62, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2c, 0x20, 0x62, 0x75, - 0x74, 0x20, 0x74, 0x68, 0x72, 0x65, 0x65, 0x20, 0x6c, 0x65, 0x76, 0x65, - 0x6c, 0x73, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x3b, 0x20, 0x69, 0x66, - 0x20, 0x79, 0x6f, 0x75, 0x0a, 0x09, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x74, - 0x6f, 0x20, 0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x65, - 0x76, 0x65, 0x6c, 0x20, 0x61, 0x62, 0x6f, 0x76, 0x65, 0x2c, 0x20, 0x75, - 0x73, 0x65, 0x20, 0x66, 0x61, 0x73, 0x74, 0x20, 0x6d, 0x69, 0x70, 0x6d, - 0x61, 0x70, 0x73, 0x20, 0x28, 0x2d, 0x6d, 0x20, 0x66, 0x61, 0x73, 0x74, - 0x29, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x65, 0x61, 0x64, 0x2e, 0x0a, 0x0a, - 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, - 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, - 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, - 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, - 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, - 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, - 0x2d, 0x2d, 0x0a -}; -unsigned int info_examples_len = 2055; diff --git a/utils/pvrtex/info/options.h b/utils/pvrtex/info/options.h deleted file mode 100644 index 6e437e86..00000000 --- a/utils/pvrtex/info/options.h +++ /dev/null @@ -1,1030 +0,0 @@ -unsigned char info_options[] = { - 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x20, 0x4c, 0x69, 0x6e, 0x65, - 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x2d, - 0x2d, 0x68, 0x65, 0x6c, 0x70, 0x2c, 0x20, 0x2d, 0x68, 0x0a, 0x09, 0x44, - 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x20, 0x63, 0x6f, 0x6d, 0x6d, - 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x69, 0x6e, 0x65, 0x20, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x0a, 0x0a, 0x2d, 0x2d, 0x65, 0x78, 0x61, 0x6d, - 0x70, 0x6c, 0x65, 0x73, 0x20, 0x2d, 0x45, 0x0a, 0x09, 0x44, 0x69, 0x73, - 0x70, 0x6c, 0x61, 0x79, 0x73, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, 0x20, - 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x73, 0x0a, 0x0a, 0x2d, 0x2d, - 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x2d, 0x56, 0x0a, - 0x09, 0x44, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x73, 0x20, 0x76, 0x65, - 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x0a, 0x0a, 0x2d, 0x2d, 0x69, 0x6e, 0x20, - 0x5b, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x5d, 0x2c, 0x20, - 0x2d, 0x69, 0x20, 0x5b, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x5d, 0x0a, 0x09, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x69, 0x6d, 0x61, - 0x67, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x69, - 0x73, 0x20, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, - 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0a, 0x0a, 0x09, - 0x49, 0x66, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, - 0x20, 0x61, 0x72, 0x65, 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, - 0x65, 0x64, 0x2c, 0x20, 0x74, 0x68, 0x65, 0x79, 0x20, 0x61, 0x72, 0x65, - 0x20, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x6c, 0x79, 0x0a, 0x09, - 0x61, 0x73, 0x73, 0x75, 0x6d, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, - 0x65, 0x20, 0x64, 0x69, 0x66, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x74, 0x20, - 0x6d, 0x69, 0x70, 0x6d, 0x61, 0x70, 0x20, 0x6c, 0x65, 0x76, 0x65, 0x6c, - 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, - 0x6c, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x20, - 0x52, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x0a, 0x09, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x6e, 0x6f, 0x74, 0x20, - 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x20, 0x6d, 0x69, 0x70, 0x6d, 0x61, - 0x70, 0x73, 0x2c, 0x20, 0x73, 0x6f, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x69, - 0x6d, 0x61, 0x67, 0x65, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x0a, 0x09, - 0x62, 0x65, 0x20, 0x61, 0x20, 0x73, 0x71, 0x75, 0x61, 0x72, 0x65, 0x20, - 0x70, 0x6f, 0x77, 0x65, 0x72, 0x2d, 0x6f, 0x66, 0x2d, 0x74, 0x77, 0x6f, - 0x2e, 0x0a, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x73, 0x20, 0x73, 0x74, 0x62, - 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x6c, 0x69, 0x62, 0x72, 0x61, - 0x72, 0x79, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x61, 0x64, 0x69, - 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, - 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, - 0x74, 0x65, 0x64, 0x0a, 0x09, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, - 0x20, 0x61, 0x72, 0x65, 0x3a, 0x0a, 0x09, 0x09, 0x4a, 0x50, 0x45, 0x47, - 0x2c, 0x20, 0x50, 0x4e, 0x47, 0x2c, 0x20, 0x54, 0x47, 0x41, 0x2c, 0x20, - 0x42, 0x4d, 0x50, 0x2c, 0x20, 0x50, 0x53, 0x44, 0x2c, 0x20, 0x47, 0x49, - 0x46, 0x2c, 0x20, 0x48, 0x44, 0x52, 0x2c, 0x20, 0x50, 0x49, 0x43, 0x2c, - 0x20, 0x50, 0x4d, 0x4e, 0x0a, 0x0a, 0x2d, 0x2d, 0x6f, 0x75, 0x74, 0x20, - 0x5b, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x5d, 0x2c, 0x20, - 0x2d, 0x6f, 0x20, 0x5b, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, - 0x5d, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, - 0x66, 0x69, 0x6c, 0x65, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x6f, 0x66, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, - 0x65, 0x64, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2e, 0x20, - 0x54, 0x68, 0x65, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x20, 0x6f, 0x66, 0x0a, 0x09, 0x74, 0x68, 0x69, 0x73, 0x20, 0x66, - 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, - 0x72, 0x6f, 0x6c, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, - 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x2e, 0x0a, 0x0a, 0x09, - 0x54, 0x68, 0x65, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, - 0x64, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x20, 0x61, 0x72, - 0x65, 0x3a, 0x0a, 0x0a, 0x09, 0x2e, 0x50, 0x56, 0x52, 0x0a, 0x09, 0x09, - 0x4f, 0x66, 0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x50, 0x6f, 0x77, - 0x65, 0x72, 0x56, 0x52, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, - 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x69, 0x6e, - 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x20, 0x61, 0x73, 0x20, - 0x77, 0x61, 0x73, 0x0a, 0x09, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x20, 0x74, 0x6f, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x20, 0x74, 0x65, - 0x73, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x74, 0x65, 0x72, 0x2c, 0x20, 0x62, 0x79, 0x0a, 0x09, - 0x09, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x50, 0x43, 0x20, 0x50, 0x56, - 0x52, 0x20, 0x76, 0x69, 0x65, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x70, 0x72, - 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x63, 0x68, - 0x65, 0x63, 0x6b, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x69, 0x6e, 0x67, 0x0a, 0x09, 0x09, 0x74, 0x65, 0x78, 0x74, - 0x75, 0x72, 0x65, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x72, 0x65, 0x20, 0x61, - 0x72, 0x65, 0x20, 0x6c, 0x69, 0x6b, 0x65, 0x6c, 0x79, 0x20, 0x69, 0x6e, - 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x69, 0x74, 0x69, - 0x65, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x2e, 0x50, 0x56, 0x52, - 0x0a, 0x09, 0x09, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x69, 0x6e, 0x67, 0x20, - 0x6f, 0x66, 0x20, 0x6f, 0x66, 0x66, 0x69, 0x63, 0x69, 0x61, 0x6c, 0x20, - 0x67, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x28, 0x66, 0x6f, 0x72, 0x20, 0x65, - 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2c, 0x20, 0x70, 0x76, 0x72, 0x74, - 0x65, 0x78, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x0a, 0x09, 0x09, 0x6e, 0x6f, - 0x74, 0x20, 0x61, 0x64, 0x64, 0x20, 0x61, 0x20, 0x47, 0x42, 0x49, 0x58, - 0x20, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x29, 0x2e, 0x0a, 0x09, 0x2e, 0x54, - 0x45, 0x58, 0x0a, 0x09, 0x09, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, - 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, 0x76, 0x73, 0x70, - 0x65, 0x6c, 0x73, 0x66, 0x72, 0x65, 0x61, 0x6b, 0x27, 0x73, 0x20, 0x74, - 0x65, 0x78, 0x63, 0x6f, 0x6e, 0x76, 0x2e, 0x20, 0x70, 0x76, 0x72, 0x74, - 0x65, 0x78, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x0a, 0x09, 0x09, 0x67, 0x65, - 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x63, 0x65, 0x72, 0x74, 0x61, - 0x69, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x20, 0x6e, - 0x6f, 0x74, 0x20, 0x73, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, - 0x20, 0x62, 0x79, 0x20, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6e, 0x76, 0x20, - 0x62, 0x75, 0x74, 0x0a, 0x09, 0x09, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, - 0x65, 0x6e, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x20, 0x28, 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x63, 0x6f, 0x6d, - 0x70, 0x72, 0x65, 0x73, 0x73, 0x65, 0x64, 0x20, 0x73, 0x74, 0x72, 0x69, - 0x64, 0x65, 0x0a, 0x09, 0x09, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, - 0x73, 0x29, 0x2e, 0x0a, 0x09, 0x2e, 0x44, 0x54, 0x0a, 0x09, 0x09, 0x4e, - 0x65, 0x77, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x66, 0x6f, 0x72, 0x6d, - 0x61, 0x74, 0x20, 0x75, 0x73, 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x74, - 0x68, 0x69, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x2e, - 0x20, 0x53, 0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x20, 0x73, 0x6d, - 0x61, 0x6c, 0x6c, 0x0a, 0x09, 0x09, 0x63, 0x6f, 0x64, 0x65, 0x62, 0x6f, - 0x6f, 0x6b, 0x20, 0x56, 0x51, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, - 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, - 0x69, 0x73, 0x20, 0x61, 0x6c, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x20, 0x74, - 0x6f, 0x20, 0x61, 0x20, 0x33, 0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x0a, - 0x09, 0x09, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x72, 0x79, 0x20, 0x74, 0x6f, - 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x44, 0x4d, 0x41, 0x20, 0x65, 0x61, - 0x73, 0x69, 0x65, 0x72, 0x2e, 0x0a, 0x0a, 0x09, 0x49, 0x74, 0x27, 0x73, - 0x20, 0x70, 0x6f, 0x73, 0x73, 0x69, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x6f, - 0x20, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x79, 0x20, 0x6e, 0x6f, 0x20, - 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, - 0x69, 0x66, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x20, 0x61, 0x20, 0x70, 0x72, - 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x0a, - 0x09, 0x69, 0x73, 0x20, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x2e, - 0x0a, 0x0a, 0x2d, 0x2d, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x20, 0x5b, - 0x74, 0x79, 0x70, 0x65, 0x5d, 0x2c, 0x20, 0x2d, 0x66, 0x20, 0x5b, 0x74, - 0x79, 0x70, 0x65, 0x5d, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x73, 0x20, 0x74, - 0x68, 0x65, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x20, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x65, 0x78, - 0x74, 0x75, 0x72, 0x65, 0x2e, 0x0a, 0x0a, 0x09, 0x5b, 0x74, 0x79, 0x70, - 0x65, 0x5d, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x6f, 0x6e, - 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, - 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x3a, 0x0a, 0x0a, 0x09, 0x52, 0x47, - 0x42, 0x35, 0x36, 0x35, 0x0a, 0x09, 0x09, 0x42, 0x65, 0x73, 0x74, 0x20, - 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x6f, 0x75, 0x74, 0x20, 0x6f, 0x66, - 0x20, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x20, 0x66, 0x6f, - 0x72, 0x6d, 0x61, 0x74, 0x73, 0x20, 0x77, 0x69, 0x74, 0x68, 0x6f, 0x75, - 0x74, 0x20, 0x73, 0x61, 0x63, 0x72, 0x69, 0x66, 0x69, 0x63, 0x69, 0x6e, - 0x67, 0x0a, 0x09, 0x09, 0x73, 0x70, 0x65, 0x65, 0x64, 0x2c, 0x20, 0x62, - 0x75, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, - 0x72, 0x61, 0x69, 0x6e, 0x62, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x6f, - 0x6e, 0x20, 0x67, 0x72, 0x61, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x20, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x0a, 0x09, 0x41, 0x52, 0x47, - 0x42, 0x31, 0x35, 0x35, 0x35, 0x0a, 0x09, 0x09, 0x41, 0x6c, 0x6c, 0x6f, - 0x77, 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, - 0x20, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x20, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x73, 0x2e, 0x20, 0x42, 0x65, 0x74, - 0x74, 0x65, 0x72, 0x20, 0x63, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x20, 0x66, - 0x6f, 0x72, 0x0a, 0x09, 0x09, 0x67, 0x72, 0x61, 0x79, 0x73, 0x63, 0x61, - 0x6c, 0x65, 0x20, 0x74, 0x68, 0x61, 0x6e, 0x20, 0x52, 0x47, 0x42, 0x35, - 0x36, 0x35, 0x2c, 0x20, 0x77, 0x68, 0x69, 0x63, 0x68, 0x20, 0x63, 0x61, - 0x6e, 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x72, 0x61, 0x69, 0x6e, 0x62, - 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x2e, 0x0a, 0x09, 0x41, 0x52, 0x47, 0x42, - 0x34, 0x34, 0x34, 0x34, 0x0a, 0x09, 0x09, 0x41, 0x6c, 0x6c, 0x6f, 0x77, - 0x73, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x20, - 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, 0x73, 0x2c, 0x20, 0x62, - 0x75, 0x74, 0x20, 0x70, 0x6f, 0x6f, 0x72, 0x65, 0x73, 0x74, 0x20, 0x63, - 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x70, 0x74, 0x68, 0x20, 0x77, - 0x69, 0x74, 0x68, 0x0a, 0x09, 0x09, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x61, - 0x62, 0x6c, 0x65, 0x20, 0x62, 0x61, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x2e, - 0x0a, 0x09, 0x59, 0x55, 0x56, 0x34, 0x32, 0x32, 0x20, 0x2f, 0x20, 0x59, - 0x55, 0x56, 0x0a, 0x09, 0x09, 0x42, 0x65, 0x74, 0x74, 0x65, 0x72, 0x20, - 0x74, 0x68, 0x61, 0x6e, 0x20, 0x52, 0x47, 0x42, 0x35, 0x36, 0x35, 0x20, - 0x6f, 0x72, 0x20, 0x41, 0x52, 0x47, 0x42, 0x31, 0x35, 0x35, 0x35, 0x20, - 0x66, 0x6f, 0x72, 0x20, 0x67, 0x72, 0x61, 0x64, 0x69, 0x65, 0x6e, 0x74, - 0x73, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x0a, 0x09, 0x09, 0x62, 0x69, 0x2f, - 0x74, 0x72, 0x69, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x20, 0x66, 0x69, - 0x6c, 0x74, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x61, 0x73, 0x20, - 0x77, 0x6f, 0x72, 0x73, 0x65, 0x20, 0x70, 0x65, 0x72, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x0a, 0x09, 0x50, 0x41, 0x4c, 0x38, - 0x42, 0x50, 0x50, 0x0a, 0x09, 0x09, 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, - 0x6d, 0x20, 0x6f, 0x66, 0x20, 0x32, 0x35, 0x36, 0x20, 0x63, 0x6f, 0x6c, - 0x6f, 0x72, 0x73, 0x2e, 0x20, 0x50, 0x61, 0x6c, 0x65, 0x74, 0x74, 0x65, - 0x20, 0x69, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x73, 0x65, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x0a, 0x09, 0x09, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x20, - 0x4d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x74, 0x77, 0x69, 0x64, - 0x64, 0x6c, 0x65, 0x64, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x63, 0x6f, 0x6d, - 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x6d, 0x69, - 0x70, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2c, 0x0a, 0x09, 0x09, - 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x2f, 0x74, 0x72, 0x69, 0x6c, 0x69, - 0x6e, 0x65, 0x61, 0x72, 0x20, 0x61, 0x72, 0x65, 0x20, 0x75, 0x73, 0x65, - 0x64, 0x2c, 0x20, 0x61, 0x20, 0x68, 0x61, 0x72, 0x64, 0x77, 0x61, 0x72, - 0x65, 0x20, 0x62, 0x75, 0x67, 0x20, 0x63, 0x61, 0x75, 0x73, 0x65, 0x73, - 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x0a, 0x09, 0x09, 0x74, 0x65, 0x78, 0x65, - 0x6c, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x66, 0x69, 0x6c, - 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x72, - 0x65, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x6f, 0x6e, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x74, 0x6f, 0x70, 0x20, 0x6c, 0x65, 0x66, 0x74, 0x2f, 0x62, 0x6f, - 0x74, 0x74, 0x6f, 0x6d, 0x0a, 0x09, 0x09, 0x72, 0x69, 0x67, 0x68, 0x74, - 0x20, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, - 0x61, 0x20, 0x34, 0x78, 0x32, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x0a, 0x09, 0x50, 0x41, 0x4c, 0x34, 0x42, 0x50, 0x50, 0x0a, 0x09, 0x09, - 0x4d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x6f, 0x66, 0x20, 0x31, - 0x36, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x73, 0x2e, 0x20, 0x50, 0x61, - 0x6c, 0x65, 0x74, 0x74, 0x65, 0x20, 0x69, 0x73, 0x20, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, - 0x73, 0x65, 0x70, 0x65, 0x72, 0x61, 0x74, 0x65, 0x0a, 0x09, 0x09, 0x66, - 0x69, 0x6c, 0x65, 0x2e, 0x20, 0x4d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, - 0x20, 0x74, 0x77, 0x69, 0x64, 0x64, 0x6c, 0x65, 0x64, 0x2e, 0x20, 0x49, - 0x66, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x72, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x2c, 0x20, 0x6d, 0x69, 0x70, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, - 0x67, 0x2c, 0x0a, 0x09, 0x09, 0x61, 0x6e, 0x64, 0x20, 0x62, 0x69, 0x2f, - 0x74, 0x72, 0x69, 0x6c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x20, 0x61, 0x72, - 0x65, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2c, 0x20, 0x61, 0x20, 0x68, 0x61, - 0x72, 0x64, 0x77, 0x61, 0x72, 0x65, 0x20, 0x62, 0x75, 0x67, 0x20, 0x63, - 0x61, 0x75, 0x73, 0x65, 0x73, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x0a, 0x09, - 0x09, 0x74, 0x65, 0x78, 0x65, 0x6c, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x62, - 0x65, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x69, - 0x6e, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x6c, 0x79, 0x20, 0x6f, - 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x6f, 0x70, 0x20, 0x6c, 0x65, - 0x66, 0x74, 0x2f, 0x62, 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x0a, 0x09, 0x09, - 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x63, 0x6f, 0x72, 0x6e, 0x65, 0x72, - 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x20, 0x34, 0x78, 0x34, 0x20, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x0a, 0x09, 0x42, 0x55, 0x4d, 0x50, 0x4d, 0x41, - 0x50, 0x0a, 0x09, 0x09, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x73, 0x20, 0x50, 0x56, 0x52, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, - 0x20, 0x6d, 0x61, 0x70, 0x2e, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x20, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x61, 0x0a, 0x09, - 0x09, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6d, 0x61, 0x70, 0x2e, - 0x0a, 0x09, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x0a, 0x09, 0x09, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, 0x50, 0x56, 0x52, - 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x70, 0x2e, - 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x20, 0x69, 0x73, 0x20, 0x74, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x20, 0x61, 0x73, 0x20, 0x61, 0x0a, 0x09, 0x09, 0x44, 0x4f, 0x54, 0x33, - 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x70, 0x2c, - 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x52, 0x47, 0x42, 0x20, 0x63, 0x68, - 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, - 0x74, 0x68, 0x65, 0x0a, 0x09, 0x09, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, - 0x27, 0x73, 0x20, 0x58, 0x59, 0x5a, 0x2e, 0x0a, 0x09, 0x41, 0x55, 0x54, - 0x4f, 0x0a, 0x09, 0x09, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x73, 0x20, - 0x52, 0x47, 0x42, 0x35, 0x36, 0x35, 0x2c, 0x20, 0x41, 0x52, 0x47, 0x42, - 0x31, 0x35, 0x35, 0x35, 0x2c, 0x20, 0x6f, 0x72, 0x20, 0x41, 0x52, 0x47, - 0x42, 0x34, 0x34, 0x34, 0x34, 0x20, 0x64, 0x65, 0x70, 0x65, 0x6e, 0x64, - 0x69, 0x6e, 0x67, 0x20, 0x6f, 0x6e, 0x20, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x0a, 0x09, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x6f, - 0x66, 0x20, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, - 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x2c, 0x20, 0x52, 0x47, 0x42, 0x35, - 0x36, 0x35, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, 0x2c, 0x0a, - 0x09, 0x09, 0x61, 0x6c, 0x6c, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, - 0x20, 0x68, 0x61, 0x76, 0x65, 0x20, 0x65, 0x69, 0x74, 0x68, 0x65, 0x72, - 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x6f, 0x70, 0x61, 0x71, 0x75, - 0x65, 0x20, 0x6f, 0x72, 0x20, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x20, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x0a, 0x09, - 0x09, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2c, 0x20, 0x41, 0x52, 0x47, 0x42, - 0x31, 0x35, 0x35, 0x35, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, - 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x69, 0x66, 0x20, 0x73, 0x6f, 0x6d, - 0x65, 0x20, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x20, 0x68, 0x61, 0x76, - 0x65, 0x20, 0x6e, 0x6f, 0x6e, 0x2d, 0x66, 0x75, 0x6c, 0x6c, 0x79, 0x0a, - 0x09, 0x09, 0x6f, 0x70, 0x61, 0x71, 0x75, 0x65, 0x20, 0x6f, 0x72, 0x20, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x20, - 0x70, 0x69, 0x78, 0x65, 0x6c, 0x73, 0x2c, 0x20, 0x41, 0x52, 0x47, 0x42, - 0x34, 0x34, 0x34, 0x34, 0x20, 0x69, 0x73, 0x20, 0x75, 0x73, 0x65, 0x64, - 0x2e, 0x0a, 0x09, 0x41, 0x55, 0x54, 0x4f, 0x59, 0x55, 0x56, 0x0a, 0x09, - 0x09, 0x53, 0x61, 0x6d, 0x65, 0x20, 0x61, 0x73, 0x20, 0x41, 0x55, 0x54, - 0x4f, 0x2c, 0x20, 0x62, 0x75, 0x74, 0x20, 0x75, 0x73, 0x61, 0x67, 0x65, - 0x20, 0x6f, 0x66, 0x20, 0x52, 0x47, 0x42, 0x35, 0x36, 0x35, 0x20, 0x69, - 0x73, 0x20, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x64, 0x20, 0x77, - 0x69, 0x74, 0x68, 0x20, 0x59, 0x55, 0x56, 0x34, 0x32, 0x32, 0x2e, 0x0a, - 0x0a, 0x2d, 0x2d, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x5b, - 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x5d, 0x2c, 0x20, 0x2d, - 0x70, 0x20, 0x5b, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x5d, - 0x0a, 0x09, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x73, 0x20, - 0x61, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x6f, 0x66, - 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x69, - 0x6e, 0x67, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x20, 0x66, - 0x69, 0x6c, 0x65, 0x2e, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, - 0x0a, 0x09, 0x73, 0x65, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x62, 0x69, 0x74, - 0x20, 0x64, 0x65, 0x70, 0x74, 0x68, 0x20, 0x72, 0x65, 0x64, 0x75, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x64, 0x69, 0x74, 0x68, 0x65, 0x72, - 0x69, 0x6e, 0x67, 0x2c, 0x20, 0x6d, 0x69, 0x70, 0x6d, 0x61, 0x70, 0x73, - 0x2c, 0x0a, 0x09, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x70, 0x72, - 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x0a, 0x0a, 0x09, 0x54, 0x68, - 0x65, 0x20, 0x70, 0x72, 0x65, 0x76, 0x69, 0x65, 0x77, 0x20, 0x69, 0x73, - 0x20, 0x63, 0x61, 0x6e, 0x20, 0x62, 0x65, 0x20, 0x61, 0x20, 0x50, 0x4e, - 0x47, 0x2c, 0x20, 0x4a, 0x50, 0x47, 0x2c, 0x20, 0x42, 0x4d, 0x50, 0x2c, - 0x20, 0x6f, 0x72, 0x20, 0x54, 0x47, 0x41, 0x20, 0x66, 0x69, 0x6c, 0x65, ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-08-19 06:00: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 c2d45545e439c0624865b792a23653bb3dfd956b (commit) via 76326ab61332ac7f7257447b88f4ff2bbcbaa712 (commit) from fff864a476bc3096afc0de1b515f1a4453a6caa5 (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 c2d45545e439c0624865b792a23653bb3dfd956b Author: SiZiOUS <si...@gm...> Date: Mon Aug 19 06:59:56 2024 +0100 `utils`: adding `font2txf`, a tool to make TXF from TrueType/OpenType fonts (#704) * `utils`: adding `font2txf`, a tool to make TXF from TrueType/OpenType fonts. This tool is an updated version of the ttf2txf tool created by Chris Laurel for the Celestia project. TXF font format was created in 1997 by Mark J. Kilgard for the OpenGL Utility Toolkit (GLUT). TXF is supported using the `libdcplib` kos-port via the PLIB FNT component. * `utils`: don't build `font2txf` by default (at least for now) commit 76326ab61332ac7f7257447b88f4ff2bbcbaa712 Author: SiZiOUS <si...@gm...> Date: Mon Aug 19 06:25:26 2024 +0100 `LibADX`: adding an example for ADX playback (#715) This example was written by Josh 'PH3NOM' Pearson <ph3...@gm...> (@PH3NOM-PRO). ----------------------------------------------------------------------- Summary of changes: .../dreamcast/{2ndmix => sound/hello-adx}/Makefile | 12 +- examples/dreamcast/sound/hello-adx/libADXplay.c | 121 +++++++ examples/dreamcast/sound/hello-adx/readme.txt | 3 + .../dreamcast/sound/hello-adx/romdisk}/.keepme | 0 utils/font2txf/.gitignore | 40 +++ utils/font2txf/CHANGELOG.md | 35 ++ utils/font2txf/CREDITS | 6 + utils/{genromfs/COPYING => font2txf/LICENSE} | 64 +--- utils/{makeip => font2txf}/Makefile | 0 utils/font2txf/README.md | 169 ++++++++++ utils/font2txf/TODO.md | 10 + utils/font2txf/img/arial.png | Bin 0 -> 76428 bytes utils/font2txf/src/Makefile | 98 ++++++ utils/font2txf/src/Makefile.cfg | 46 +++ utils/font2txf/src/Makefile.hostdetect | 43 +++ utils/font2txf/src/charset.cpp | 32 ++ utils/font2txf/src/charset.h | 19 ++ utils/font2txf/src/global.cpp | 49 +++ utils/font2txf/src/global.h | 83 +++++ utils/font2txf/src/main.cpp | 360 +++++++++++++++++++++ utils/font2txf/src/preview.cpp | 186 +++++++++++ utils/font2txf/src/preview.h | 26 ++ utils/font2txf/src/txfbuild.cpp | 286 ++++++++++++++++ utils/font2txf/src/txfbuild.h | 27 ++ utils/font2txf/src/txfwrite.cpp | 148 +++++++++ utils/font2txf/src/txfwrite.h | 77 +++++ utils/font2txf/src/utils.cpp | 64 ++++ utils/font2txf/src/utils.h | 160 +++++++++ utils/gentexfont/readme.txt | 6 + 29 files changed, 2101 insertions(+), 69 deletions(-) copy examples/dreamcast/{2ndmix => sound/hello-adx}/Makefile (56%) create mode 100644 examples/dreamcast/sound/hello-adx/libADXplay.c create mode 100644 examples/dreamcast/sound/hello-adx/readme.txt copy {addons/lib => examples/dreamcast/sound/hello-adx/romdisk}/.keepme (100%) create mode 100644 utils/font2txf/.gitignore create mode 100644 utils/font2txf/CHANGELOG.md create mode 100644 utils/font2txf/CREDITS copy utils/{genromfs/COPYING => font2txf/LICENSE} (83%) copy utils/{makeip => font2txf}/Makefile (100%) create mode 100644 utils/font2txf/README.md create mode 100644 utils/font2txf/TODO.md create mode 100644 utils/font2txf/img/arial.png create mode 100644 utils/font2txf/src/Makefile create mode 100644 utils/font2txf/src/Makefile.cfg create mode 100644 utils/font2txf/src/Makefile.hostdetect create mode 100644 utils/font2txf/src/charset.cpp create mode 100644 utils/font2txf/src/charset.h create mode 100644 utils/font2txf/src/global.cpp create mode 100644 utils/font2txf/src/global.h create mode 100644 utils/font2txf/src/main.cpp create mode 100644 utils/font2txf/src/preview.cpp create mode 100644 utils/font2txf/src/preview.h create mode 100644 utils/font2txf/src/txfbuild.cpp create mode 100644 utils/font2txf/src/txfbuild.h create mode 100644 utils/font2txf/src/txfwrite.cpp create mode 100644 utils/font2txf/src/txfwrite.h create mode 100644 utils/font2txf/src/utils.cpp create mode 100644 utils/font2txf/src/utils.h diff --git a/examples/dreamcast/2ndmix/Makefile b/examples/dreamcast/sound/hello-adx/Makefile similarity index 56% copy from examples/dreamcast/2ndmix/Makefile copy to examples/dreamcast/sound/hello-adx/Makefile index 0e3b214d..218ef865 100644 --- a/examples/dreamcast/2ndmix/Makefile +++ b/examples/dreamcast/sound/hello-adx/Makefile @@ -1,11 +1,11 @@ -# KallistiOS ##version## # -# 2ndmix/Makefile -# Copyright (C)2003 Megan Potter +# LibADX Test +# Copyright (C) 2011-2013 Josh 'PH3NOM' Pearson <ph3...@gm...> +# Copyright (C) 2024 The KOS Team and contributors # -TARGET = 2ndmix.elf -OBJS = 2ndmix.o romdisk.o +TARGET = libADXplay.elf +OBJS = libADXplay.o romdisk.o KOS_ROMDISK_DIR = romdisk all: rm-elf $(TARGET) @@ -19,7 +19,7 @@ rm-elf: -rm -f $(TARGET) romdisk.* $(TARGET): $(OBJS) - kos-cc -o $(TARGET) $(OBJS) + kos-cc -o $(TARGET) $(OBJS) -lADX run: $(TARGET) $(KOS_LOADER) $(TARGET) diff --git a/examples/dreamcast/sound/hello-adx/libADXplay.c b/examples/dreamcast/sound/hello-adx/libADXplay.c new file mode 100644 index 00000000..8e220511 --- /dev/null +++ b/examples/dreamcast/sound/hello-adx/libADXplay.c @@ -0,0 +1,121 @@ +/* LibADX for KallistiOS ##version## + + libADXPlay.c + Simple "Hello World" style example of ADX playback. + + Copyright (C) 2012 Josh 'PH3NOM' Pearson <ph3...@gm...> + Copyright (C) 2024 The KOS Team and contributors +*/ + +#include <stdio.h> + +#include <kos/dbgio.h> + +#include <dc/maple.h> +#include <dc/maple/controller.h> +#include <dc/sound/stream.h> + +#include <kos/init.h> +#include <kos.h> + +#include <adx/adx.h> /* ADX Decoder Library */ +#include <adx/snddrv.h> /* Direct Access to Sound Driver */ + +#define CONT_RESUME 0x01 +#define CONT_PAUSE 0x02 +#define CONT_RESTART 0x03 +#define CONT_STOP 0x04 +#define CONT_VOLUP 0x05 +#define CONT_VOLDN 0x06 + +int check_cont() +{ + int ret=0; + maple_device_t *cont; + cont_state_t *state; + cont = maple_enum_type(0, MAPLE_FUNC_CONTROLLER); + + if(cont) + { + state = (cont_state_t *)maple_dev_status(cont); + if (!state) + ret = 0; + if (state->buttons & CONT_START) + ret = CONT_STOP; + if (state->buttons & CONT_X) + ret = CONT_RESTART; + if (state->buttons & CONT_A) + ret = CONT_PAUSE; + if (state->buttons & CONT_B) + ret = CONT_RESUME; + if (state->buttons & CONT_DPAD_UP) + ret = CONT_VOLUP; + if (state->buttons & CONT_DPAD_DOWN) + ret = CONT_VOLDN; + } + return ret; +} + +int main() +{ + /* Print some text to the screen */ + int o = 20*640+20; + bfont_set_encoding(BFONT_CODE_ISO8859_1); + bfont_draw_str(vram_s+o,640,1,"LibADX (C) PH3NOM 2012"); o+=640*48; + printf("LibADX (C) PH3NOM 2012\n"); + + /* Start the ADX stream, with looping enabled */ + if( adx_dec( "/rd/test.adx", 1 ) < 1 ) + { + printf("Invalid ADX file\n"); + return 0; + } + + /* Wait for the stream to start */ + while( snddrv.drv_status == SNDDRV_STATUS_NULL ) + thd_pass(); + + bfont_draw_str(vram_s+o,640,1,"Press Start to stop, press X to restart"); + o+=640*48; + bfont_draw_str(vram_s+o,640,1,"Press A to pause, press B to resume"); + o+=640*48; + bfont_draw_str(vram_s+o,640,1,"Press UP or Down to increase/decrease volume"); + + /* Check for user input and eof */ + while( snddrv.drv_status != SNDDRV_STATUS_NULL ) { + int vol; + switch (check_cont()) { + case CONT_RESTART: + if(adx_restart()) + printf("ADX streaming restarted\n"); + break; + case CONT_STOP: + if(adx_stop()) + printf("ADX streaming stopped\n"); + break; + case CONT_PAUSE: + if(adx_pause()) + printf("ADX streaming paused\n"); + break; + case CONT_RESUME: + if(adx_resume()) + printf("ADX streaming resumed\n"); + break; + case CONT_VOLUP: + vol = snddrv_volume_up(); + printf("SNDDRV: Volume set to %i%s\n", ((vol*100)/255), "%"); + break; + case CONT_VOLDN: + vol = snddrv_volume_down(); + printf("SNDDRV: Volume set to %i%s\n", ((vol*100)/255), "%"); + break; + default: + break; + } + thd_sleep(50); + } /* when (snddrv.drv_status == SNDDRV_STATUS_NULL) the stream is finished*/ + + printf( "LibADX Example Finished\n"); + + return 0; +} diff --git a/examples/dreamcast/sound/hello-adx/readme.txt b/examples/dreamcast/sound/hello-adx/readme.txt new file mode 100644 index 00000000..e08dcc08 --- /dev/null +++ b/examples/dreamcast/sound/hello-adx/readme.txt @@ -0,0 +1,3 @@ +This example expects a file called "test.adx" to exist in the root of the +romdisk. Put a relatively small adx file with the correct filename in the +romdisk directory before compiling if you want the example to work. ;) diff --git a/addons/lib/.keepme b/examples/dreamcast/sound/hello-adx/romdisk/.keepme similarity index 100% copy from addons/lib/.keepme copy to examples/dreamcast/sound/hello-adx/romdisk/.keepme diff --git a/utils/font2txf/.gitignore b/utils/font2txf/.gitignore new file mode 100644 index 00000000..5bcd548d --- /dev/null +++ b/utils/font2txf/.gitignore @@ -0,0 +1,40 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Fonts +*.ttf +*.otf +*.txf + +# Other types +*.log diff --git a/utils/font2txf/CHANGELOG.md b/utils/font2txf/CHANGELOG.md new file mode 100644 index 00000000..1b2474ef --- /dev/null +++ b/utils/font2txf/CHANGELOG.md @@ -0,0 +1,35 @@ +# font2txf: Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.12.0] - 2024-08-xx + +### Added + +- Preview option (`-p`), used for displaying the generated TXF file at the + end of the process. This requires [Freeglut](https://freeglut.sourceforge.net/), + but it can be disabled if needed at compile time. +- Verbose option (`-v`), that display the original output from `ttf2txf`. + +### Changed + +- Complete redesign/refactoring of the whole code. Splitting code into many + small source files instead of a single `ttf2txf.cpp` file. +- Command-line options were updated a bit (exclusion between `-c` and `-f`, + `-q` is really quiet now, `-h` stands for help now but can be mapped to + height as originally if used with `-w`, etc.). +- Program is now licensed under the **GNU GPL 2 License** like the + [Celestia](https://celestiaproject.space/) project (previously this tool + wasn't clearly licensed). + +### Fixed + +- Some memory leaks while building the TXF font when an error occured. + +## [1.11.0] - 2001-10-20 + +### Added +- Initial release used for the [Celestia](https://celestiaproject.space/) project. diff --git a/utils/font2txf/CREDITS b/utils/font2txf/CREDITS new file mode 100644 index 00000000..9caa9721 --- /dev/null +++ b/utils/font2txf/CREDITS @@ -0,0 +1,6 @@ +font2txf: Credits + +- Mark J. Kilgard: Creator of the Texture Mapped Font (TXF) format. +- Chris Laurel and the Celestia project team: The initial authors of the original "ttf2txf" utility. + https://web.archive.org/web/20051104023112/http://www.shatters.net/~claurel/celestia/fonts/tt2txf/ +- Mickaël Cardoso (SiZiOUS): Complete refactoring of the project. diff --git a/utils/genromfs/COPYING b/utils/font2txf/LICENSE similarity index 83% copy from utils/genromfs/COPYING copy to utils/font2txf/LICENSE index dc63aaca..5ec43ee1 100644 --- a/utils/genromfs/COPYING +++ b/utils/font2txf/LICENSE @@ -1,9 +1,8 @@ - GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -277,64 +276,3 @@ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - Appendix: How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - <one line to give the program's name and a brief idea of what it does.> - Copyright (C) 19yy <name of author> - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) 19yy name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - <signature of Ty Coon>, 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/utils/makeip/Makefile b/utils/font2txf/Makefile similarity index 100% copy from utils/makeip/Makefile copy to utils/font2txf/Makefile diff --git a/utils/font2txf/README.md b/utils/font2txf/README.md new file mode 100644 index 00000000..29ce2581 --- /dev/null +++ b/utils/font2txf/README.md @@ -0,0 +1,169 @@ +# font2txf + +**font2txf** is an utility used for generating texture mapped font files, +also known as the `TXF` format, from a **TrueType** (`TTF`) or **OpenType** +(`OTF`) font file. + +`TXF` is a texture font which can be used in the context of **GLUT** (OpenGL +Utility Toolkit), created by [Mark J. Kilgard](https://en.wikipedia.org/wiki/Mark_Kilgard). +For the **Sega Dreamcast**, the `TXF` format is supported using the `libdcplib` +KallistiOS Port, using the `PLIB FNT` component. An example of source code, +including sample `TXF` fonts, is available here: + + $KOS_BASE/examples/dreamcast/cpp/dcplib + +For generating `TXF` files, you can use the provided `gentexfont` (originally +written by Mark himself), `ttf2txf` (from the [Celestia](https://celestiaproject.space/) +project) or this `font2txf` utility. + +Below you'll find an example of a `TXF` generated font, from the `Arial` +TrueType font: + + + +## Building + +This program is a standard C program which may be compiled with **GNU Make**. +It requires `FreeType` installed. +[Learn more about FreeType here](http://freetype.org/). + +1. Edit the `Makefile.cfg` and check if everything is OK for you; +2. Enter `make` (`gmake` on BSD systems). + +If you want to enable the **Preview** feature (as displayed in this +`README` file), you will have to install `freeglut`. +[Learn more about freeglut here](https://freeglut.sourceforge.net/). + +Please note that you can indeed make a static binary by setting up +the `STANDALONE_BINARY` flag to `1`. This was created with Microsoft +Windows in mind, but could work on other OS as well. + +## Usage + +To use this tool, the usage is nearly identical as the original `ttf2txf` +utility. The minimal command-line is: + + ./font2txf <fontfile.ttf> + +This will convert `fontfile.ttf` to the corresponding `fontfile.txf`, +using the defaults, which are a `256x256` texture size, using a `20pt` font +size and the default charset, which is: + + (space)(A..Z)1234567890(a..z)?.;,!*:"/+-|'@#$%^&<>()[]{}_ + +Of course, `(space)` means a blank space character (` `) and `(A..Z)` means +every characters, from `A` to `Z` (same for `(a..z)`). + +Example of a more complete command-line: + + ./ttf2txf -o revenant.txf -s 22 -w 256 -h 256 -c "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-_=+[]{}|;:,.<>~ ?/" revenant.ttf + +The `revenant.txf` file will be generated from the `revenant.ttf` font, +in a `256x256` texture, using the charset passed with the `-c` switch, +and using the `22pt` size. + +### Available Options + +Available options are (displayed with the `-h` switch): + + -w <width> Texture width (default: 256) + -e <height> Texture height (default: 256); also `-h` for compatibility + -c <string> Override charset to convert; read from command-line + Cannot be mixed with `-f` + -f <filename.txt> Override charset to convert; read from a text file + Cannot be mixed with `-c` + -g <gap> Space between glyphs (default: 1) + -s <size> Font point size (default: 20) + -o <filename.txf> Output file for textured font (default: <fontfile>.txf) + -q Quiet; except error messages, cannot be mixed with `-v` + -v Verbose; display more info, cannot be mixed with `-q` + -p Preview; display the txf output at the end of the process + -h Usage information (you're looking at it); if `-w` not set + +### Altering the generated texture + +The `-w` (width) and `-e` (height) options are used for altering the size of the +generated texture. For compatibility reasons, `-e` can be replaced by `-h`, if +used with `-w`. Indeed in the original `ttf2txf` tool, `-h` was mapped to texture +height, but now it means displaying help. ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-08-19 05:00:49
|
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 fff864a476bc3096afc0de1b515f1a4453a6caa5 (commit) from 9d115023ffc10996601a8e12fdb809cff2c5804f (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 fff864a476bc3096afc0de1b515f1a4453a6caa5 Author: jnmartin84 <jnm...@gm...> Date: Mon Aug 19 00:55:22 2024 -0400 Add an example of how to render lines with the PVR. (#714) * Add PVR-accelerated line-rendering example. * turns out the endpoint order condition check is simple * cleanup vert swapping * formatting and comments * one missed spaces-to-tab * remove copyright header until I figure out what is wanted * fix remaining stray tab issues * update comments and long lines ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/pvr/Makefile | 3 + .../{network/dns-client => pvr/pvrline}/Makefile | 7 +- examples/dreamcast/pvr/pvrline/pvrline.c | 264 +++++++++++++++++++++ 3 files changed, 271 insertions(+), 3 deletions(-) copy examples/dreamcast/{network/dns-client => pvr/pvrline}/Makefile (82%) create mode 100644 examples/dreamcast/pvr/pvrline/pvrline.c diff --git a/examples/dreamcast/pvr/Makefile b/examples/dreamcast/pvr/Makefile index 24812cfe..3cb67d66 100644 --- a/examples/dreamcast/pvr/Makefile +++ b/examples/dreamcast/pvr/Makefile @@ -6,6 +6,7 @@ all: $(KOS_MAKE) -C plasma + $(KOS_MAKE) -C pvrline $(KOS_MAKE) -C pvrmark $(KOS_MAKE) -C pvrmark_strips $(KOS_MAKE) -C pvrmark_strips_direct @@ -18,6 +19,7 @@ all: clean: $(KOS_MAKE) -C plasma clean + $(KOS_MAKE) -C pvrline clean $(KOS_MAKE) -C pvrmark clean $(KOS_MAKE) -C pvrmark_strips clean $(KOS_MAKE) -C pvrmark_strips_direct clean @@ -30,6 +32,7 @@ clean: dist: $(KOS_MAKE) -C plasma dist + $(KOS_MAKE) -C pvrline dist $(KOS_MAKE) -C pvrmark dist $(KOS_MAKE) -C pvrmark_strips dist $(KOS_MAKE) -C pvrmark_strips_direct dist diff --git a/examples/dreamcast/network/dns-client/Makefile b/examples/dreamcast/pvr/pvrline/Makefile similarity index 82% copy from examples/dreamcast/network/dns-client/Makefile copy to examples/dreamcast/pvr/pvrline/Makefile index 0e010c5a..a834749b 100644 --- a/examples/dreamcast/network/dns-client/Makefile +++ b/examples/dreamcast/pvr/pvrline/Makefile @@ -1,8 +1,8 @@ # Put the filename of the output binary here -TARGET = dns-client.elf +TARGET = pvrline.elf # List all of your C files here, but change the extension to ".o" -OBJS = dns-client.o +OBJS = pvrline.o all: rm-elf $(TARGET) @@ -18,8 +18,9 @@ $(TARGET): $(OBJS) kos-cc -o $(TARGET) $(OBJS) run: $(TARGET) - $(KOS_LOADER) $(TARGET) -n + $(KOS_LOADER) $(TARGET) dist: $(TARGET) -rm -f $(OBJS) $(KOS_STRIP) $(TARGET) + diff --git a/examples/dreamcast/pvr/pvrline/pvrline.c b/examples/dreamcast/pvr/pvrline/pvrline.c new file mode 100644 index 00000000..ee6632fb --- /dev/null +++ b/examples/dreamcast/pvr/pvrline/pvrline.c @@ -0,0 +1,264 @@ +/* + * KallistiOS ##version## + * + * examples/dreamcast/pvr/pvrline/pvrline.c + * Copyright (C) 2024 Jason Martin + * + * This example demonstrates the use of the PVR to draw lines with quads + * (as triangle strips). + * It also demonstrates the use of pvr_list_prim, interleaving the drawing of + * OPAQUE and TRANSPARENT polygons. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <time.h> + +#include <kos.h> + +/* 512 kb vertex buffer size */ +#define VERTBUF_SIZE (512*1024) + +KOS_INIT_FLAGS(INIT_DEFAULT); + +/* enable OP and TR lists */ +pvr_init_params_t pvr_params = { +{ PVR_BINSIZE_16, 0, PVR_BINSIZE_16, 0, 0 }, VERTBUF_SIZE, 1, 0, 0, 3 +}; + +uint8_t __attribute__((aligned(32))) op_buf[VERTBUF_SIZE]; +uint8_t __attribute__((aligned(32))) tr_buf[VERTBUF_SIZE]; + +/* + * given a vec3f_t representing the screen-space start of a line (x,y,z), + * a vec3f_t representing the screen-space end of a line (x,y,z), + * a color, a width, a pvr polygon list type and a pvr polygon header + * uses the PVR to draw a line with a triangle strip consisting of 4 vertices + * representing a quad +*/ +void draw_pvr_line(vec3f_t *v1, vec3f_t *v2, float width, int color, + int which_list, pvr_poly_hdr_t *which_hdr); + +int main(int argc, char **argv) +{ + pvr_poly_hdr_t op_hdr, tr_hdr; + pvr_poly_cxt_t op_cxt, tr_cxt; + + /* start and end points of a line in screen-space */ + vec3f_t v1, v2; + /* red, green, blue and alpha color components */ + int r, g, b, a; + /* packed color */ + int color; + /* line width */ + int width; + /* moving offset added or subtracted to x and y components of endpoints */ + int offset; + /* number of lines to draw per frame */ + int linecount = 1; + + maple_device_t *controller; + cont_state_t *cont; + + printf("---KallistiOS PVR Line-drawing Example---\n"); + printf("Press DPAD UP to increase line count\n\t(up to a maximum of 1536" + " lines).\n"); + printf("Press DPAD DOWN to decrease line count\n\t(down to a minimum of 1" + " line).\n"); + printf("Press A to reset line count to 1.\n"); + printf("Press Start to exit.\n"); + + srand(time(NULL)); + + vid_set_enabled(0); + vid_set_mode(DM_640x480, PM_RGB565); + pvr_init(&pvr_params); + vid_set_enabled(1); + + /* polygon header setup, OP lines */ + pvr_poly_cxt_col(&op_cxt, PVR_LIST_OP_POLY); + pvr_poly_compile(&op_hdr, &op_cxt); + + /* polygon header setup, TR lines */ + pvr_poly_cxt_col(&tr_cxt, PVR_LIST_TR_POLY); + pvr_poly_compile(&tr_hdr, &tr_cxt); + + offset = 0; + + while (true) { + controller = maple_enum_type(0, MAPLE_FUNC_CONTROLLER); + if (controller) { + cont = maple_dev_status(controller); + if (cont->buttons & CONT_DPAD_UP) { + if (linecount < 1536) { + linecount += 1; + } + } else if (cont->buttons & CONT_DPAD_DOWN) { + if (linecount > 1) { + linecount -= 1; + } + } else if (cont->buttons & CONT_A) { + linecount = 1; + } else if (cont->buttons & CONT_START) { + break; + } + } + + pvr_wait_ready(); + pvr_scene_begin(); + + /* set vertex buffers for pvr_list_prim use */ + pvr_set_vertbuf(PVR_LIST_OP_POLY, op_buf, VERTBUF_SIZE); + pvr_set_vertbuf(PVR_LIST_TR_POLY, tr_buf, VERTBUF_SIZE); + + /* + * incrementing offset added to endpoints + * make endpoints occasionally move to other side of screen + * from where they start + * force swaps in the line drawing routine + */ + offset = (offset + 5) % 360; + + for (int i = 0; i < linecount; i++) { + v1.x = rand() % 128; + v1.y = rand() % 64; + v1.z = 5; + + v2.x = 500 + (rand() % 96); + v2.y = 400 + (rand() % 48); + v2.z = 5; + + /* + * add an offset in the range [0,359] to v1 x and y + * x stays within [0,487] + * y stays within [0,422] + */ + v1.x += offset; + v1.y += offset; + + /* + * subtract an offset in the range [0,359] from v2 x and y + * x stays within [141,595] + * y stays within [40,447] + */ + v2.x -= offset; + v2.y -= offset; + + /* + * the above offset can move v2 to the left of v1 + * this demonstrates that lines will always render correctly + * regardless of vertex order + */ + + /* generate a random RGBA color */ + r = rand() % 256; + g = rand() % 256; + b = rand() % 256; + a = rand() % 256; + + color = PVR_PACK_COLOR((float)a / 255.0f, + (float)r / 255.0f, + (float)g / 255.0f, + (float)b / 255.0f); + + width = (rand() % 5) + 1; + + /* interleaved use of PVR polygon list types */ + if (a == 255) { + /* + * when alpha is fully opaque + * use the OP list + */ + draw_pvr_line(&v1, &v2, width, color, + PVR_LIST_OP_POLY, &op_hdr); + } else { + /* + * when alpha is transparent at all + * use the TR list + */ + draw_pvr_line(&v1, &v2, width, color, + PVR_LIST_TR_POLY, &tr_hdr); + } + } + + pvr_scene_finish(); + } +} + +void draw_pvr_line(vec3f_t *v1, vec3f_t *v2, float width, int color, + int which_list, pvr_poly_hdr_t *which_hdr) +{ + pvr_vertex_t __attribute__((aligned(32))) line_verts[4]; + pvr_vertex_t *vert = line_verts; + + vec3f_t *ov1; + vec3f_t *ov2; + + for (int i=0;i<4;i++) { + line_verts[i].flags = PVR_CMD_VERTEX; + line_verts[i].argb = color; + line_verts[i].oargb = 0; + } + line_verts[3].flags = PVR_CMD_VERTEX_EOL; + + /* + * when first vertex is to the left of or vertical with second vertex + * they are already ordered + * otherwise + * swap endpoints + */ + if(v1->x <= v2->x) { + ov1 = v1; + ov2 = v2; + } else { + ov1 = v2; + ov2 = v1; + } + + /* + * https://devcry.heiho.net/html/2017/20170820-opengl-line-drawing.html + * + * get the normal to the line segment running from v1 to v2 + * use normal to draw a quad covering the actual line segment + */ + float dx = ov2->x - ov1->x; + float dy = ov2->y - ov1->y; + + /* + * use the fast reciprocal square root function provided by KOS + * to get inverse of the magnitude of the normal + * multiply by half of the line width + * this scales the normal, making a quad with the requested line width + */ + float inverse_magnitude = frsqrt((dx*dx) + (dy*dy)) * + ((float)width*0.5f); + float nx = -dy * inverse_magnitude; + float ny = dx * inverse_magnitude; + + /* normal offset "down" from the first endpoint */ + vert->x = ov1->x + nx; + vert->y = ov1->y + ny; + vert->z = ov1->z; + vert++; + + /* normal offset "up" from the first endpoint */ + vert->x = ov1->x - nx; + vert->y = ov1->y - ny; + vert->z = ov2->z; + vert++; + + /* normal offset "down" from the second endpoint */ + vert->x = ov2->x + nx; + vert->y = ov2->y + ny; + vert->z = ov1->z; + vert++; + + /* normal offset "up" from the second endpoint */ + vert->x = ov2->x - nx; + vert->y = ov2->y - ny; + vert->z = ov2->z; + + /* submit the poly header and vertices to requested list */ + pvr_list_prim(which_list, which_hdr, sizeof(pvr_poly_hdr_t)); + pvr_list_prim(which_list, &line_verts, 4 * sizeof(pvr_vertex_t)); +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: falcovorbis <fal...@us...> - 2024-08-19 04:27:20
|
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 9d115023ffc10996601a8e12fdb809cff2c5804f (commit) via 51b5cd64678d5c6e8446bed3f6ccf7365d06538b (commit) from 8f1db16e84dbbc968567f5bda8c6f96b012b74b1 (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 9d115023ffc10996601a8e12fdb809cff2c5804f Author: dfchil <dan...@gm...> Date: Mon Aug 19 06:26:56 2024 +0200 Add pvrtex utility (#602) * added pvrtex source files * handled compilation warnings added install target in makefile some minor formatting cleanup * bugfix makefile * fixed install target, further cleanup in nvmath.h for arm64 compilation * Added install target in Makefile Removed some dead code in nvmath.h that prevented compilation on ARM64 targets Added targets for generating header files from selected sections in the README file Added command line option --examples/-E which outputs the "Usage Examples" section of the README file Changed -h/--help option to output the "Command Line Options:" section of the README file Added this CHANGELOG file * Fixed bug with printing of non zero terminated char arrays from info/*.h files * Updated doc/CHANGELOG * Added pvrtex folder as a dependency in utils/Makefile * removed two unused variables * fixed make depency error improved error output * Added missing symbols in file_dctex.h by including <dc/pvr.h> * fixed header compile issues after upgrading gcc to 14.1.1-dev and kos to latest stable * allowed myself the liberty of patching init.mk in this PR as well, for my own convienience * removed dependency on kos/pvr.h, added generated info/*.h files --------- Co-authored-by: drxl <da...@vm...> Co-authored-by: Daniel Fairchild <da...@vi...> commit 51b5cd64678d5c6e8446bed3f6ccf7365d06538b Author: Paul Cercueil <pa...@cr...> Date: Mon Aug 19 06:20:37 2024 +0200 Iso9660: Read CD-ROM sectors using DMA (#659) * iso9660: Reduce number of allocations Reduce the number of allocations for the cache from 32 (16 icache/dcache buffers) to just 2: one for the icache/dcache structures, and one for the data buffers. This will later allow to allocate the data arrays all at once with a specific alignment. Signed-off-by: Paul Cercueil <pa...@cr...> * iso9660: Use DMA to read sectors from CD-ROM Use the DMA to read sectors from the CD-ROM instead of reading them using PIO. This frees the CPU to work on other tasks while the data transfer is ongoing. Signed-off-by: Paul Cercueil <pa...@cr...> --------- Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + kernel/arch/dreamcast/fs/fs_iso9660.c | 26 +- utils/Makefile | 2 +- utils/pvrtex/.gitignore | 2 + utils/pvrtex/CHANGELOG | 29 + utils/pvrtex/Makefile | 59 + utils/pvrtex/avstring.c | 462 ++ utils/pvrtex/bprint.c | 332 + utils/pvrtex/compat/va_copy.h | 34 + utils/pvrtex/crc.c | 413 ++ utils/pvrtex/dither.cpp | 478 ++ utils/pvrtex/elbg.c | 530 ++ utils/pvrtex/elbg.h | 59 + utils/pvrtex/file_common.c | 74 + utils/pvrtex/file_common.h | 22 + utils/pvrtex/file_dctex.c | 88 + utils/pvrtex/file_dctex.h | 565 ++ utils/pvrtex/file_pvr.c | 82 + utils/pvrtex/file_pvr.h | 21 + utils/pvrtex/file_tex.c | 76 + utils/pvrtex/file_tex.h | 8 + addons/lib/.keepme => utils/pvrtex/info/.gitkeep | 0 utils/pvrtex/info/examples.h | 175 + utils/pvrtex/info/options.h | 1030 +++ utils/pvrtex/lfg.c | 87 + utils/pvrtex/libavcodec/elbg.h | 59 + utils/pvrtex/libavutil/attributes.h | 173 + utils/pvrtex/libavutil/attributes_internal.h | 34 + utils/pvrtex/libavutil/avassert.h | 75 + utils/pvrtex/libavutil/avconfig.h | 6 + utils/pvrtex/libavutil/avstring.h | 429 ++ utils/pvrtex/libavutil/avutil.h | 371 + utils/pvrtex/libavutil/bprint.h | 251 + utils/pvrtex/libavutil/bswap.h | 111 + utils/pvrtex/libavutil/common.h | 578 ++ utils/pvrtex/libavutil/crc.h | 102 + utils/pvrtex/libavutil/dynarray.h | 70 + utils/pvrtex/libavutil/error.h | 128 + utils/pvrtex/libavutil/internal.h | 188 + utils/pvrtex/libavutil/intfloat.h | 77 + utils/pvrtex/libavutil/intreadwrite.h | 644 ++ utils/pvrtex/libavutil/lfg.c | 87 + utils/pvrtex/libavutil/lfg.h | 81 + utils/pvrtex/libavutil/libm.h | 472 ++ utils/pvrtex/libavutil/log.h | 387 ++ utils/pvrtex/libavutil/macros.h | 80 + utils/pvrtex/libavutil/mathematics.c | 319 + utils/pvrtex/libavutil/mathematics.h | 300 + utils/pvrtex/libavutil/md5.h | 89 + utils/pvrtex/libavutil/mem.c | 568 ++ utils/pvrtex/libavutil/mem.h | 609 ++ utils/pvrtex/libavutil/pixfmt.h | 699 ++ utils/pvrtex/libavutil/rational.c | 193 + utils/pvrtex/libavutil/rational.h | 221 + utils/pvrtex/libavutil/thread.h | 202 + utils/pvrtex/libavutil/version.h | 128 + utils/pvrtex/log.c | 490 ++ utils/pvrtex/main.c | 455 ++ utils/pvrtex/md5.c | 208 + utils/pvrtex/mem.c | 566 ++ utils/pvrtex/mycommon.c | 32 + utils/pvrtex/mycommon.h | 40 + utils/pvrtex/nvmath.h | 722 ++ utils/pvrtex/optparse.h | 403 ++ utils/pvrtex/optparse_impl.c | 2 + utils/pvrtex/pixel.h | 492 ++ utils/pvrtex/pvr_texture.c | 476 ++ utils/pvrtex/pvr_texture.h | 115 + utils/pvrtex/pvr_texture_encoder.c | 932 +++ utils/pvrtex/pvr_texture_encoder.h | 226 + utils/pvrtex/readme_unformatted.txt | 309 + utils/pvrtex/stb_image.h | 7897 ++++++++++++++++++++++ utils/pvrtex/stb_image_impl.c | 3 + utils/pvrtex/stb_image_resize.h | 2634 ++++++++ utils/pvrtex/stb_image_resize_impl.c | 3 + utils/pvrtex/stb_image_write.h | 1724 +++++ utils/pvrtex/stb_image_write_impl.c | 3 + utils/pvrtex/tddither.c | 231 + utils/pvrtex/tddither.h | 13 + utils/pvrtex/vqcompress.c | 154 + utils/pvrtex/vqcompress.h | 38 + 81 files changed, 30542 insertions(+), 12 deletions(-) create mode 100644 utils/pvrtex/.gitignore create mode 100644 utils/pvrtex/CHANGELOG create mode 100644 utils/pvrtex/Makefile create mode 100644 utils/pvrtex/avstring.c create mode 100644 utils/pvrtex/bprint.c create mode 100644 utils/pvrtex/compat/va_copy.h create mode 100644 utils/pvrtex/crc.c create mode 100644 utils/pvrtex/dither.cpp create mode 100644 utils/pvrtex/elbg.c create mode 100644 utils/pvrtex/elbg.h create mode 100644 utils/pvrtex/file_common.c create mode 100644 utils/pvrtex/file_common.h create mode 100644 utils/pvrtex/file_dctex.c create mode 100644 utils/pvrtex/file_dctex.h create mode 100644 utils/pvrtex/file_pvr.c create mode 100644 utils/pvrtex/file_pvr.h create mode 100644 utils/pvrtex/file_tex.c create mode 100644 utils/pvrtex/file_tex.h copy addons/lib/.keepme => utils/pvrtex/info/.gitkeep (100%) create mode 100644 utils/pvrtex/info/examples.h create mode 100644 utils/pvrtex/info/options.h create mode 100644 utils/pvrtex/lfg.c create mode 100644 utils/pvrtex/libavcodec/elbg.h create mode 100644 utils/pvrtex/libavutil/attributes.h create mode 100644 utils/pvrtex/libavutil/attributes_internal.h create mode 100644 utils/pvrtex/libavutil/avassert.h create mode 100644 utils/pvrtex/libavutil/avconfig.h create mode 100644 utils/pvrtex/libavutil/avstring.h create mode 100644 utils/pvrtex/libavutil/avutil.h create mode 100644 utils/pvrtex/libavutil/bprint.h create mode 100644 utils/pvrtex/libavutil/bswap.h create mode 100644 utils/pvrtex/libavutil/common.h create mode 100644 utils/pvrtex/libavutil/crc.h create mode 100644 utils/pvrtex/libavutil/dynarray.h create mode 100644 utils/pvrtex/libavutil/error.h create mode 100644 utils/pvrtex/libavutil/internal.h create mode 100644 utils/pvrtex/libavutil/intfloat.h create mode 100644 utils/pvrtex/libavutil/intreadwrite.h create mode 100644 utils/pvrtex/libavutil/lfg.c create mode 100644 utils/pvrtex/libavutil/lfg.h create mode 100644 utils/pvrtex/libavutil/libm.h create mode 100644 utils/pvrtex/libavutil/log.h create mode 100644 utils/pvrtex/libavutil/macros.h create mode 100644 utils/pvrtex/libavutil/mathematics.c create mode 100644 utils/pvrtex/libavutil/mathematics.h create mode 100644 utils/pvrtex/libavutil/md5.h create mode 100644 utils/pvrtex/libavutil/mem.c create mode 100644 utils/pvrtex/libavutil/mem.h create mode 100644 utils/pvrtex/libavutil/pixfmt.h create mode 100644 utils/pvrtex/libavutil/rational.c create mode 100644 utils/pvrtex/libavutil/rational.h create mode 100644 utils/pvrtex/libavutil/thread.h create mode 100644 utils/pvrtex/libavutil/version.h create mode 100644 utils/pvrtex/log.c create mode 100644 utils/pvrtex/main.c create mode 100644 utils/pvrtex/md5.c create mode 100644 utils/pvrtex/mem.c create mode 100644 utils/pvrtex/mycommon.c create mode 100644 utils/pvrtex/mycommon.h create mode 100644 utils/pvrtex/nvmath.h create mode 100644 utils/pvrtex/optparse.h create mode 100644 utils/pvrtex/optparse_impl.c create mode 100644 utils/pvrtex/pixel.h create mode 100644 utils/pvrtex/pvr_texture.c create mode 100644 utils/pvrtex/pvr_texture.h create mode 100644 utils/pvrtex/pvr_texture_encoder.c create mode 100644 utils/pvrtex/pvr_texture_encoder.h create mode 100644 utils/pvrtex/readme_unformatted.txt create mode 100644 utils/pvrtex/stb_image.h create mode 100644 utils/pvrtex/stb_image_impl.c create mode 100644 utils/pvrtex/stb_image_resize.h create mode 100644 utils/pvrtex/stb_image_resize_impl.c create mode 100644 utils/pvrtex/stb_image_write.h create mode 100644 utils/pvrtex/stb_image_write_impl.c create mode 100644 utils/pvrtex/tddither.c create mode 100644 utils/pvrtex/tddither.h create mode 100644 utils/pvrtex/vqcompress.c create mode 100644 utils/pvrtex/vqcompress.h diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 251ed0bf..f3da1509 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -228,6 +228,7 @@ KallistiOS version 2.1.0 ----------------------------------------------- - *** Added thread support for tracking CPU time + updated clock_gettime() [FG] - *** Added support for one-shot timers [PC] - DC Use one-shot timers for timeout and a proper polling mechanism in modem [PC] +- *** Added pvrtex utility by TapamN to utils [DF == Daniel Fairchild] - *** Added full support for <time.h> additions from C23 standard. [FG] - *** Fixes mutexes not working properly [PC] - DC fs_dcload: Set errno on error in dcload_stat() [PC] diff --git a/kernel/arch/dreamcast/fs/fs_iso9660.c b/kernel/arch/dreamcast/fs/fs_iso9660.c index f8445cad..6f3f5273 100644 --- a/kernel/arch/dreamcast/fs/fs_iso9660.c +++ b/kernel/arch/dreamcast/fs/fs_iso9660.c @@ -197,8 +197,8 @@ static uint32 iso_733(const uint8 *from) { this cache. As the cache fills up, sectors are removed from the end of it. */ typedef struct { + uint8 *data; /* Sector data */ uint32 sector; /* CD sector */ - uint8 data[2048]; /* Sector data */ } cache_block_t; /* List of cache blocks (ordered least recently used to most recently) */ @@ -206,6 +206,9 @@ typedef struct { static cache_block_t *icache[NUM_CACHE_BLOCKS]; /* inode cache */ static cache_block_t *dcache[NUM_CACHE_BLOCKS]; /* data cache */ +static unsigned char *cache_data; +static cache_block_t *caches; + /* Cache modification mutex */ static mutex_t cache_mutex; @@ -268,7 +271,7 @@ static int bread_cache(cache_block_t **cache, uint32 sector) { } /* Load the requested block */ - j = cdrom_read_sectors(cache[i]->data, sector + 150, 1); + j = cdrom_read_sectors_ex(cache[i]->data, sector + 150, 1, CDROM_READ_DMA); if(j < 0) { //dbglog(DBG_ERROR, "fs_iso9660: can't read_sectors for %d: %d\n", @@ -1084,11 +1087,16 @@ void fs_iso9660_init(void) { mutex_init(&cache_mutex, MUTEX_TYPE_NORMAL); mutex_init(&fh_mutex, MUTEX_TYPE_NORMAL); - /* Allocate cache block space */ + /* Allocate cache block space, properly aligned for DMA access */ + cache_data = memalign(32, 2 * NUM_CACHE_BLOCKS * 2048); + caches = malloc(2 * NUM_CACHE_BLOCKS * sizeof(cache_block_t)); + for(i = 0; i < NUM_CACHE_BLOCKS; i++) { - icache[i] = malloc(sizeof(cache_block_t)); + icache[i] = &caches[i * 2]; + icache[i]->data = &cache_data[i * 2 * 2048]; icache[i]->sector = -1; - dcache[i] = malloc(sizeof(cache_block_t)); + dcache[i] = &caches[i * 2 + 1]; + dcache[i]->data = &cache_data[i * 2 * 2048 + 2048]; dcache[i]->sector = -1; } @@ -1104,16 +1112,12 @@ void fs_iso9660_init(void) { /* De-init the file system */ void fs_iso9660_shutdown(void) { - int i; - /* De-register with vblank */ vblank_handler_remove(iso_vblank_hnd); /* Dealloc cache block space */ - for(i = 0; i < NUM_CACHE_BLOCKS; i++) { - free(icache[i]); - free(dcache[i]); - } + free(cache_data); + free(caches); /* Free muteces */ mutex_destroy(&cache_mutex); diff --git a/utils/Makefile b/utils/Makefile index f3045bd7..19988ecb 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -4,7 +4,7 @@ # Copyright (C) 2001 Megan Potter # -DIRS = bin2c bincnv dcbumpgen genromfs kmgenc makeip scramble vqenc wav2adpcm +DIRS = bin2c bincnv dcbumpgen genromfs kmgenc makeip scramble vqenc wav2adpcm pvrtex ifeq ($(KOS_SUBARCH), naomi) DIRS += naomibintool naominetboot diff --git a/utils/pvrtex/.gitignore b/utils/pvrtex/.gitignore new file mode 100644 index 00000000..1d3690fa --- /dev/null +++ b/utils/pvrtex/.gitignore @@ -0,0 +1,2 @@ +pvrtex +README diff --git a/utils/pvrtex/CHANGELOG b/utils/pvrtex/CHANGELOG new file mode 100644 index 00000000..7c51f43c --- /dev/null +++ b/utils/pvrtex/CHANGELOG @@ -0,0 +1,29 @@ +Based on code by TapamN +Source released here: https://dcemulation.org/phpBB/viewtopic.php?t=106138 + + Version 1.0 + Initial release + + Version 1.01 + Program now displays error message when an error occurs loading a source image. Previously, the program would hit an assertion. + + Fixed "--resize down" option. Previously, the program would round down sizes that were already a power-of-two, now sizes that are already POT are left unchanged. + + Included a missing FFmpeg header file. + +--------------------------- + +Adaption into KOS by Daniel Fairchild, 2024 + +Version 1.0.2 + Added install target in Makefile + + Removed some dead code in nvmath.h that prevented compilation on ARM64 targets + + Added targets for generating header files from selected sections in the README file + + Added command line option --examples/-E which outputs the "Usage Examples" section of the README file + + Changed -h/--help option to output the "Command Line Options:" section of the README file + + Added this CHANGELOG file diff --git a/utils/pvrtex/Makefile b/utils/pvrtex/Makefile new file mode 100644 index 00000000..40e17a3e --- /dev/null +++ b/utils/pvrtex/Makefile @@ -0,0 +1,59 @@ +#Uncomment when debugging +#DEBUGBUILD = true + +TARGET = pvrtex +OBJS = elbg.o mem.o log.o bprint.o avstring.o lfg.o crc.o md5.o stb_image_impl.o \ + stb_image_write_impl.o stb_image_resize_impl.o optparse_impl.o pvr_texture.o \ + dither.o tddither.o vqcompress.o mycommon.o file_common.o \ + file_pvr.o file_tex.o file_dctex.o pvr_texture_encoder.o main.o + +ifdef $(DEBUGBUILD) + OPTMODE= -Og -pg -g +else + OPTMODE= -O3 -flto +endif + +MYFLAGS=-flto=auto -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Ilibavutil -I. -DCONFIG_MEMORY_POISONING=0 -DHAVE_FAST_UNALIGNED=0 -I${KOS_INC_PATHS} +MYCPPFLAGS=$(MYFLAGS) +MYCFLAGS=$(MYFLAGS) -Wno-pointer-sign + + +define textSegment2Header + awk '/$1/,/--------------------------------------------------------------------------/' README|xxd -i -n $2_$3 > $2/$3.h +endef + + +TOOLINSTALLDIR=$(KOS_BASE)/../bin + +.PHONY: all clean + + +$(TARGET): $(OBJS) + gcc $(OPTMODE) -o $(TARGET) \ + $(OBJS) $(PROGMAIN) -lm -lstdc++ + +main.o: main.c info/options.h info/examples.h + gcc $(CFLAGS) $(MYCFLAGS) $(OPTMODE) -c $< -o $@ + +%.o: %.c + gcc $(CFLAGS) $(MYCFLAGS) $(OPTMODE) -c $< -o $@ + +%.o: %.cpp + gcc $(CFLAGS) $(MYCPPFLAGS) $(CXXFLAGS) $(OPTMODE) -c $< -o $@ + +clean: + rm -f $(TARGET) $(OBJS) README + +README: readme_unformatted.txt + fmt -s readme_unformatted.txt > README + +all: $(TARGET) README + +install: all + install -m 755 $(TARGET) $(TOOLINSTALLDIR)/ + +info/options.h: README + $(call textSegment2Header,Command Line Options:,info,options) + +info/examples.h: README + $(call textSegment2Header,Usage Examples:,info,examples) diff --git a/utils/pvrtex/avstring.c b/utils/pvrtex/avstring.c new file mode 100644 index 00000000..99f06690 --- /dev/null +++ b/utils/pvrtex/avstring.c @@ -0,0 +1,462 @@ +/* + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2007 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <limits.h> +#include <stdarg.h> +#include <stdint.h> +#include <stdio.h> +#include <string.h> + +#include "mem.h" +#include "avassert.h" +#include "avstring.h" +#include "bprint.h" +#include "error.h" +#include "macros.h" +#include "version.h" + +int av_strstart(const char *str, const char *pfx, const char **ptr) +{ + while (*pfx && *pfx == *str) { + pfx++; + str++; + } + if (!*pfx && ptr) + *ptr = str; + return !*pfx; +} + +int av_stristart(const char *str, const char *pfx, const char **ptr) +{ + while (*pfx && av_toupper((unsigned)*pfx) == av_toupper((unsigned)*str)) { + pfx++; + str++; + } + if (!*pfx && ptr) + *ptr = str; + return !*pfx; +} + +char *av_stristr(const char *s1, const char *s2) +{ + if (!*s2) + return (char*)(intptr_t)s1; + + do + if (av_stristart(s1, s2, NULL)) + return (char*)(intptr_t)s1; + while (*s1++); + + return NULL; +} + +char *av_strnstr(const char *haystack, const char *needle, size_t hay_length) +{ + size_t needle_len = strlen(needle); + if (!needle_len) + return (char*)haystack; + while (hay_length >= needle_len) { + hay_length--; + if (!memcmp(haystack, needle, needle_len)) + return (char*)haystack; + haystack++; + } + return NULL; +} + +size_t av_strlcpy(char *dst, const char *src, size_t size) +{ + size_t len = 0; + while (++len < size && *src) + *dst++ = *src++; + if (len <= size) + *dst = 0; + return len + strlen(src) - 1; +} + +size_t av_strlcat(char *dst, const char *src, size_t size) +{ + size_t len = strlen(dst); + if (size <= len + 1) + return len + strlen(src); + return len + av_strlcpy(dst + len, src, size - len); +} + +size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) +{ + size_t len = strlen(dst); + va_list vl; + + va_start(vl, fmt); + len += vsnprintf(dst + len, size > len ? size - len : 0, fmt, vl); + va_end(vl); + + return len; +} + +char *av_asprintf(const char *fmt, ...) +{ + char *p = NULL; + va_list va; + int len; + + va_start(va, fmt); + len = vsnprintf(NULL, 0, fmt, va); + va_end(va); + if (len < 0) + goto end; + + p = av_malloc(len + 1); + if (!p) + goto end; + + va_start(va, fmt); + len = vsnprintf(p, len + 1, fmt, va); + va_end(va); + if (len < 0) + av_freep(&p); + +end: + return p; +} + ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |