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
(26) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Lawrence S. <ljs...@us...> - 2015-05-09 02:57: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 "KOS image format loader library.". The branch, master has been updated via 8081ea4c00b4e98e534f10622de76c7cc08f0269 (commit) from 8d320b133de976606f2fd738eba4640d40d811a4 (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 8081ea4c00b4e98e534f10622de76c7cc08f0269 Author: Lawrence Sebald <ljs...@us...> Date: Fri May 8 22:57:29 2015 -0400 Fix compilation in new kos-ports. ----------------------------------------------------------------------- Summary of changes: Makefile | 2 +- kmg.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5ae71e1..59ef95f 100755 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ TARGET = libkmg.a OBJS = kmg.o +KOS_CFLAGS += -Iinclude defaultall: create_kos_link $(OBJS) subdirs linklib @@ -14,4 +15,3 @@ include $(KOS_BASE)/addons/Makefile.prefab create_kos_link: rm -f ../include/kmg ln -s ../libkmg/include ../include/kmg - diff --git a/kmg.c b/kmg.c index 38d7759..b986a1f 100644 --- a/kmg.c +++ b/kmg.c @@ -8,8 +8,8 @@ */ #include <kos.h> -#include <kmg/kmg.h> #include <assert.h> +#include "kmg.h" /* This (tiny) library implements a "KMG" format loader. This format is intended to be a KOS-specific format for loading platform specific @@ -101,7 +101,7 @@ int kmg_to_img(const char * fn, kos_img_t * rv) { free(rv->data); return -5; } - + rv->byte_count = hdr.byte_count; /* And load the rest of it if necessary */ @@ -131,7 +131,6 @@ int kmg_to_img(const char * fn, kos_img_t * rv) { /* If the byte count is not a multiple of 32, bump it up as well. This is for DMA/SQ usage. */ rv->byte_count = (rv->byte_count + 31) & ~31; - + return 0; } - hooks/post-receive -- KOS image format loader library. |
From: Lawrence S. <ljs...@us...> - 2015-05-09 02:52:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The KallistiOS port of PLIB.". The branch, master has been updated via 42d6f0596079c818e156feff7f77adb11a640302 (commit) from a58ffdf5f4032f23c79d29667da27dc43c68a539 (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 42d6f0596079c818e156feff7f77adb11a640302 Author: Lawrence Sebald <ljs...@us...> Date: Fri May 8 22:52:33 2015 -0400 Fix compilation in new kos-ports. ----------------------------------------------------------------------- Summary of changes: Makefile | 1 + fnt.cc | 16 +++--- fntLocal.h | 26 +++++------ sg.cc | 151 +++++++++++++++++++++++++++++------------------------------ sgIsect.cc | 22 ++++----- sgd.cc | 96 +++++++++++++++++++------------------- ulError.cc | 22 ++++---- 7 files changed, 163 insertions(+), 171 deletions(-) diff --git a/Makefile b/Makefile index bde3f25..b13c337 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ OBJS = ulError.o sg.o fnt.o fntTXF.o # Comment the next line out if you don't want sgd (SG stuff using doubles instead of floats) or sgIsect (I haven't checked, but FNT doesn't need it). OBJS += sgd.o sgIsect.o SUBDIRS = +KOS_CFLAGS += -Iinclude defaultall: create_kos_link $(OBJS) subdirs linklib diff --git a/fnt.cc b/fnt.cc index 55c2bb9..54e25f5 100644 --- a/fnt.cc +++ b/fnt.cc @@ -1,27 +1,27 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 Steve Baker - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library 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 Library General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + For further information visit http://plib.sourceforge.net */ // Modified for Dreamcast/KOS by Peter Hatch -#include <dcplib/fnt.h> +#include "fnt.h" fntFont::fntFont () {} fntFont::~fntFont () {} @@ -131,7 +131,7 @@ float fntTexFont::low_putch (sgVec3 curpos, float pointsize, float italic, char //ta_commit_vertex (&vert, sizeof (vert) ); //pvr_list_prim (PVR_LIST_PT_POLY, &vert, sizeof (vert) ); // Not implemented yet pvr_prim (&vert, sizeof (vert) ); - + float ww = (gap + (fixed_pitch ? width : v_right[cc]) ) * pointsize; curpos[0] += ww; return ww; @@ -213,7 +213,7 @@ void fntTexFont::getBBox ( const char *s, float pointsize, float italic, float * else if (cc >= 'a' && cc <= 'z') cc = cc - 'a' + 'A'; - + if (cc == ' ') { r += 0.5f; @@ -271,7 +271,7 @@ void fntTexFont::getBBox ( const char *s, float pointsize, float italic, float * void fntTexFont::puts (sgVec3 curpos, float pointsize, float italic, const char *s, float red, float green, float blue, float alpha) { SGfloat origx = curpos[0]; - + if (!bound) bind_texture (PVR_FILTER_NONE); diff --git a/fntLocal.h b/fntLocal.h index 18dc989..3c43aa1 100644 --- a/fntLocal.h +++ b/fntLocal.h @@ -1,27 +1,27 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 Steve Baker - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library 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 Library General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + For further information visit http://plib.sourceforge.net */ // Modified for Dreamcast/KOS by Peter Hatch -#include <dcplib/fnt.h> +#include "fnt.h" extern int isSwapped; extern FILE *curr_image_fd; @@ -29,7 +29,7 @@ extern FILE *curr_image_fd; inline void _fnt_swab_short (unsigned short *x) { if (isSwapped) - *x = ((*x >> 8) & 0x00FF) | + *x = ((*x >> 8) & 0x00FF) | ((*x << 8) & 0xFF00); } @@ -37,9 +37,9 @@ inline void _fnt_swab_short (unsigned short *x) inline void _fnt_swab_int (unsigned int *x) { if (isSwapped) - *x = ((*x >> 24) & 0x000000FF) | - ((*x >> 8) & 0x0000FF00) | - ((*x << 8) & 0x00FF0000) | + *x = ((*x >> 24) & 0x000000FF) | + ((*x >> 8) & 0x0000FF00) | + ((*x << 8) & 0x00FF0000) | ((*x << 24) & 0xFF000000); } @@ -51,9 +51,9 @@ inline void _fnt_swab_int_array (int *x, int leng) for (int i = 0; i < leng; i++) { - *x = ((*x >> 24) & 0x000000FF) | - ((*x >> 8) & 0x0000FF00) | - ((*x << 8) & 0x00FF0000) | + *x = ((*x >> 24) & 0x000000FF) | + ((*x >> 8) & 0x0000FF00) | + ((*x << 8) & 0x00FF0000) | ((*x << 24) & 0xFF000000); x++; } @@ -107,5 +107,3 @@ struct TXF_Glyph sgVec2 tx3; sgVec2 vx3; }; - - diff --git a/sg.cc b/sg.cc index 63bc441..ab6b339 100644 --- a/sg.cc +++ b/sg.cc @@ -1,26 +1,26 @@ /* PLIB - A Suite of Portable Game Libraries Copyright (C) 2001 Steve Baker - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This library 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 Library General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - + For further information visit http://plib.sourceforge.net */ -#include <dcplib/sg.h> +#include "sg.h" void sgVectorProductVec3 ( sgVec3 dst, const sgVec3 a, const sgVec3 b ) { @@ -52,13 +52,13 @@ int sgCompare3DSqdDist( const sgVec3 v1, const sgVec3 v2, const SGfloat sqd_dist void sgMakeRotMat4( sgMat4 mat, const SGfloat angle, const sgVec3 axis ) { sgVec3 ax ; - sgNormalizeVec3 ( ax, axis ) ; + sgNormalizeVec3 ( ax, axis ) ; SGfloat temp_angle = angle * SG_DEGREES_TO_RADIANS ; SGfloat s = (SGfloat) sin ( temp_angle ) ; SGfloat c = (SGfloat) cos ( temp_angle ) ; SGfloat t = SG_ONE - c ; - + mat[0][0] = t * ax[0] * ax[0] + c ; mat[0][1] = t * ax[0] * ax[1] + s * ax[2] ; mat[0][2] = t * ax[0] * ax[2] - s * ax[1] ; @@ -82,7 +82,7 @@ void sgMakeRotMat4( sgMat4 mat, const SGfloat angle, const sgVec3 axis ) - + void sgMakePickMatrix( sgMat4 mat, sgFloat x, sgFloat y, sgFloat width, sgFloat height, sgVec4 viewport ) { @@ -90,7 +90,7 @@ void sgMakePickMatrix( sgMat4 mat, sgFloat x, sgFloat y, sgFloat sy = viewport[3] / height ; sgFloat tx = ( viewport[2] + SG_TWO * (viewport[0] - x) ) / width ; sgFloat ty = ( viewport[3] + SG_TWO * (viewport[1] - y) ) / height ; - + mat[0][0] = sx ; mat[0][1] = SG_ZERO ; mat[0][2] = SG_ZERO ; @@ -110,7 +110,7 @@ void sgMakePickMatrix( sgMat4 mat, sgFloat x, sgFloat y, mat[3][1] = ty ; mat[3][2] = SG_ZERO ; mat[3][3] = SG_ONE ; -} +} @@ -154,7 +154,7 @@ void sgMakeLookAtMat4 ( sgMat4 dst, const sgVec3 eye, // -dw- inconsistent linkage! float sgTriArea( sgVec3 p0, sgVec3 p1, sgVec3 p2 ) { - /* + /* From comp.graph.algorithms FAQ 2A(P) = abs(N.(sum_{i=0}^{n-1}(v_i x v_{i+1}))) This is an optimized version for a triangle @@ -201,7 +201,7 @@ SGfloat sgAngleBetweenVec3 ( sgVec3 v1, sgVec3 v2 ) return sgAngleBetweenNormalizedVec3 ( nv1, nv2 ) ; } -SGfloat sgAngleBetweenNormalizedVec3 (sgVec3 first, sgVec3 second, sgVec3 normal) { +SGfloat sgAngleBetweenNormalizedVec3 (sgVec3 first, sgVec3 second, sgVec3 normal) { // result is in the range 0..2*pi // Attention: first and second have to be normalized // the normal is needed to decide between for example 0.123 looking "from one side" @@ -219,9 +219,9 @@ SGfloat sgAngleBetweenNormalizedVec3 (sgVec3 first, sgVec3 second, sgVec3 normal //assert(tfB>0.99); //assert(tfB<1.01); //#endif - + if((normal[0]==0) && (normal[1]==0) && (normal[2]==0)) - { + { ulSetError ( UL_WARNING, "sgGetAngleBetweenVectors: Normal is zero."); return 0.0; } @@ -244,27 +244,27 @@ SGfloat sgAngleBetweenNormalizedVec3 (sgVec3 first, sgVec3 second, sgVec3 normal } } // deltaAngle is in the range -SG_PI*0.5 to +SG_PI*0.5 here - // However, the correct result could also be + // However, the correct result could also be // deltaAngleS := pi - deltaAngle // Please note that: // cos(deltaAngleS)=cos(pi-deltaAngle)=-cos(deltaAngle) // So, the question is whether + or - cos(deltaAngle) // is sgScalarProductVec3(first, second) - - if ( deltaAngle < 0 ) + + if ( deltaAngle < 0 ) deltaAngle = deltaAngle + 2*SG_PI; // unnessecary? - + SProduct = sgScalarProductVec3(first, second); myCos = (SGfloat) cos(deltaAngle); - + abs1 = SProduct - myCos; - if ( abs1 < 0 ) + if ( abs1 < 0 ) abs1 = -abs1; - + abs2 = SProduct + myCos; - if ( abs2 < 0 ) + if ( abs2 < 0 ) abs2 = -abs2; - + //assert( (abs1 < 0.1) || (abs2 < 0.1) ); if ( abs2 < abs1 ) { // deltaAngleS is the correct result if ( deltaAngle <= SG_PI ) { @@ -333,7 +333,7 @@ void sgBox::extend ( const sgBox *b ) void sgBox::extend ( const sgSphere *s ) { - if ( s -> isEmpty () ) + if ( s -> isEmpty () ) return ; /* @@ -355,7 +355,7 @@ void sgBox::extend ( const sgSphere *s ) } -int sgBox::intersects ( const sgVec4 plane ) const +int sgBox::intersects ( const sgVec4 plane ) const { /* Save multiplies by not redoing Ax+By+Cz+D for each point. @@ -386,7 +386,7 @@ int sgBox::intersects ( const sgVec4 plane ) const The plane intersects the box unless all 8 are positive or none of them are positive. */ - + return count != 0 && count != 8 ; } @@ -489,7 +489,7 @@ void sgSphere::extend ( const sgSphere *s ) return ; } - /* + /* d == The distance between the sphere centers */ @@ -503,7 +503,7 @@ void sgSphere::extend ( const sgSphere *s ) sgCopyVec3 ( center, s->getCenter() ) ; radius = s->getRadius() ; return ; - } + } /* Build a new sphere that completely contains the other two: @@ -525,7 +525,7 @@ void sgSphere::extend ( const sgSphere *s ) } -int sgSphere::intersects ( const sgBox *b ) const +int sgSphere::intersects ( const sgBox *b ) const { sgVec3 closest ; @@ -566,7 +566,7 @@ void sgFrustum::update () } /* Corners of screen relative to eye... */ - + right = nnear * (SGfloat) tan ( hfov * SG_DEGREES_TO_RADIANS / SG_TWO ) ; top = nnear * (SGfloat) tan ( vfov * SG_DEGREES_TO_RADIANS / SG_TWO ) ; left = -right ; @@ -607,7 +607,7 @@ void sgFrustum::update () sgVectorProductVec3 ( bot_plane, v4, v3 ) ; sgVectorProductVec3 ( left_plane, v3, v1 ) ; - /* + /* At this point, you could call glMatrixMode ( GL_PROJECTION ) ; @@ -663,7 +663,7 @@ void sgFrustum::update () #define OC_OFF_TRF ((1<<OC_TOP_SHIFT)|(1<<OC_RIGHT_SHIFT)|(1<<OC_FAR_SHIFT)) #define OC_OFF_BLN ((1<<OC_BOT_SHIFT)|(1<<OC_LEFT_SHIFT)|(1<<OC_NEAR_SHIFT)) -int sgFrustum::getOutcode ( const sgVec3 pt ) const +int sgFrustum::getOutcode ( const sgVec3 pt ) const { /* Transform the point by the Frustum's transform. */ @@ -689,13 +689,13 @@ int sgFrustum::getOutcode ( const sgVec3 pt ) const (( tmp[2] >= -tmp[3] ) << OC_NEAR_SHIFT ) ; } -int sgFrustum::contains ( const sgVec3 pt ) const +int sgFrustum::contains ( const sgVec3 pt ) const { return getOutcode ( pt ) == OC_ALL_ON_SCREEN ; } -int sgFrustum::contains ( const sgSphere *s ) const +int sgFrustum::contains ( const sgSphere *s ) const { /* Lop off half the database (roughly) with a quick near-plane test - and @@ -726,7 +726,7 @@ int sgFrustum::contains ( const sgSphere *s ) const if ( -sp1 >= s->getRadius() || -sp2 >= s->getRadius() || -sp3 >= s->getRadius() || -sp4 >= s->getRadius() ) return SG_OUTSIDE ; - + /* If it's inside by more than the radius then it's *completely* inside and we can save time elsewhere if we know that for sure. @@ -746,7 +746,7 @@ int sgFrustum::contains ( const sgSphere *s ) const SGfloat sgDistSquaredToLineVec3 ( const sgLine3 line, const sgVec3 pnt ) { sgVec3 r ; sgSubVec3 ( r, pnt, line.point_on_line ) ; - + return sgScalarProductVec3 ( r, r ) - sgScalarProductVec3 ( r, line.direction_vector ) ; } @@ -757,24 +757,24 @@ SGfloat sgDistSquaredToLineSegmentVec3 ( const sgLineSegment3 line, const sgVec3 pnt ) { sgLine3 l ; sgLineSegment3ToLine3 ( & l, line ) ; - + sgVec3 v ; sgSubVec3 ( v, line.b, line.a ) ; sgVec3 r1 ; sgSubVec3 ( r1, pnt, line.a ) ; - + SGfloat r1_dot_v = sgScalarProductVec3 ( r1, v /*l.direction_vector*/ ) ; - + if ( r1_dot_v <= 0 ) /* Off the "A" end */ return sgScalarProductVec3 ( r1, r1 ) ; - + sgVec3 r2 ; sgSubVec3 ( r2, pnt, line.b ) ; SGfloat r2_dot_v = sgScalarProductVec3 ( r2, v /*l.direction_vector*/ ) ; - + if ( r2_dot_v >= 0 ) /* Off the "B" end */ return sgScalarProductVec3 ( r2, r2 ) ; - + /* Closest point on line is on the line segment */ - + return sgScalarProductVec3 ( r1, r1 ) - r1_dot_v ; } @@ -868,7 +868,7 @@ void sgMakeTransMat4 ( sgMat4 m, const SGfloat x, const SGfloat y, const SGfloat void sgSetCoord ( sgCoord *dst, const sgMat4 src ) { sgCopyVec3 ( dst->xyz, src[3] ) ; - + sgMat4 mat ; SGfloat s = sgLengthVec3 ( src[0] ) ; @@ -881,16 +881,16 @@ void sgSetCoord ( sgCoord *dst, const sgMat4 src ) } sgScaleMat4 ( mat, src, SG_ONE / s ) ; - + dst->hpr[1] = (SGfloat) asin ( _sgClampToUnity ( mat[1][2] ) ) ; SGfloat cp = (SGfloat) cos ( dst->hpr[1] ) ; - + /* If pointing nearly vertically up - then heading is ill-defined */ if ( cp > -0.00001 && cp < 0.00001 ) { - SGfloat cr = _sgClampToUnity ( mat[0][1] ) ; + SGfloat cr = _sgClampToUnity ( mat[0][1] ) ; SGfloat sr = _sgClampToUnity (-mat[2][1] ) ; dst->hpr[0] = SG_ZERO ; @@ -902,7 +902,7 @@ void sgSetCoord ( sgCoord *dst, const sgMat4 src ) SGfloat cr = _sgClampToUnity ( mat[2][2] / cp ) ; SGfloat sh = _sgClampToUnity ( -mat[1][0] / cp ) ; SGfloat ch = _sgClampToUnity ( mat[1][1] / cp ) ; - + if ( (sh == SG_ZERO && ch == SG_ZERO) || (sr == SG_ZERO && cr == SG_ZERO) ) { cr = _sgClampToUnity ( mat[0][1] ) ; @@ -982,15 +982,15 @@ void sgTransposeNegateMat4 ( sgMat4 dst, const sgMat4 src ) dst[1][1] = src[1][1] ; dst[2][1] = src[1][2] ; dst[3][1] = - sgScalarProductVec3 ( src[3], src[1] ) ; - - dst[0][2] = src[2][0] ; - dst[1][2] = src[2][1] ; - dst[2][2] = src[2][2] ; + + dst[0][2] = src[2][0] ; + dst[1][2] = src[2][1] ; + dst[2][2] = src[2][2] ; dst[3][2] = - sgScalarProductVec3 ( src[3], src[2] ) ; - + dst[0][3] = SG_ZERO ; - dst[1][3] = SG_ZERO ; - dst[2][3] = SG_ZERO ; ...<truncated>... hooks/post-receive -- The KallistiOS port of PLIB. |
From: Lawrence S. <ljs...@us...> - 2015-05-09 02:45:32
|
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 KallistiOS implementation of conio. ". The branch, master has been updated via 5b9180ee3f0be2f58ce3ac3b5f29ae91d39df4e1 (commit) from bd9d7c5c27342c6464b309a680cc088a04d8ae6d (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 5b9180ee3f0be2f58ce3ac3b5f29ae91d39df4e1 Author: Lawrence Sebald <ljs...@us...> Date: Fri May 8 22:43:43 2015 -0400 Fix compilation in new kos-ports. ----------------------------------------------------------------------- Summary of changes: Makefile | 1 + conio.c | 16 +++++++--------- draw.c | 10 ++++------ include/conio.h | 5 +++++ input.c | 14 ++++++-------- 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index e2d3c77..a170ecc 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,7 @@ TARGET = libconio.a OBJS = conio.o input.o draw.o +KOS_CFLAGS += -Iinclude -DBUILD_LIBCONIO all: create_kos_link defaultall diff --git a/conio.c b/conio.c index a92d132..e19fca8 100644 --- a/conio.c +++ b/conio.c @@ -14,9 +14,7 @@ #include <kos/sem.h> #include <dc/maple/keyboard.h> #include <dc/scif.h> -#include <conio/conio.h> -#include <conio/draw.h> -#include <conio/input.h> +#include "conio.h" /* the cursor */ conio_cursor_t conio_cursor; @@ -155,7 +153,7 @@ int conio_getch() { if (key == 3) arch_exit(); - + break; } case CONIO_TTY_STDIO: { @@ -175,7 +173,7 @@ int conio_getch() { if (key == 3) arch_exit(); - + break; } } @@ -199,7 +197,7 @@ int conio_check_getch() { if (key == 3) arch_exit(); - + break; } case CONIO_TTY_STDIO: @@ -215,7 +213,7 @@ int conio_check_getch() { if (key == 3) arch_exit(); - + break; } } @@ -413,7 +411,7 @@ int conio_init(int ttymode, int inputmode) { /* Wait for it to actually start */ while (!conio_entered) thd_pass(); - + return 0; } @@ -435,6 +433,6 @@ int conio_shutdown() { conio_ttymode = CONIO_TTY_NONE; conio_inputmode = CONIO_INPUT_NONE; - + return 0; } diff --git a/draw.c b/draw.c index 5225ddc..c7eb38c 100644 --- a/draw.c +++ b/draw.c @@ -11,7 +11,7 @@ #include <assert.h> #include <dc/pvr.h> #include <dc/biosfont.h> -#include <conio/conio.h> +#include "conio.h" /* the font texture */ static pvr_ptr_t font_texture = NULL; @@ -51,7 +51,7 @@ static void draw_char(float x1, float y1, float z1, float a, float r, // assert( c > ' ' && c < 127 ); if (!( c > ' ' && c < 127 )) return; - + ix = (c % 16) * 16; iy = (c / 16) * 24; u1 = ix * 1.0f / 256.0f; @@ -68,13 +68,13 @@ static void draw_char(float x1, float y1, float z1, float a, float r, vert.argb = PVR_PACK_COLOR(a, r, g, b); vert.oargb = 0; pvr_prim(&vert, sizeof(vert)); - + vert.x = x1; vert.y = y1; vert.u = u1; vert.v = v1; pvr_prim(&vert, sizeof(vert)); - + vert.x = x1 + CONIO_FONT_WIDTH; vert.y = y1 + CONIO_FONT_HEIGHT; vert.u = u2; @@ -200,5 +200,3 @@ void conio_draw_frame() { pvr_list_finish(); pvr_scene_finish(); } - - diff --git a/include/conio.h b/include/conio.h index c46a4b2..95d4f35 100644 --- a/include/conio.h +++ b/include/conio.h @@ -24,8 +24,13 @@ extern conio_cursor_t conio_cursor; /* the virtual screen */ extern char conio_virtscr[CONIO_NUM_ROWS][CONIO_NUM_COLS]; +#ifndef BUILD_LIBCONIO #include <conio/input.h> #include <conio/draw.h> +#else +#include "input.h" +#include "draw.h" +#endif /* functions */ void conio_scroll(); diff --git a/input.c b/input.c index 96ad36f..497c723 100644 --- a/input.c +++ b/input.c @@ -15,7 +15,7 @@ #include <kos/limits.h> #include <kos/sem.h> #include <dc/maple/keyboard.h> -#include <conio/conio.h> +#include "conio.h" /* This module defines a conio input system, if you want to use it. */ @@ -148,14 +148,14 @@ static void input_insertbuff(int ch) { return; /* our str */ - memmove(&input_buffer.text[input_buffer.pos + 1], &input_buffer.text[input_buffer.pos], + memmove(&input_buffer.text[input_buffer.pos + 1], &input_buffer.text[input_buffer.pos], len - input_buffer.pos + 1); /* the virtscr */ - if (conio_cursor.row * CONIO_NUM_COLS + conio_cursor.col + len - input_buffer.pos + 1 + if (conio_cursor.row * CONIO_NUM_COLS + conio_cursor.col + len - input_buffer.pos + 1 >= CONIO_NUM_COLS * CONIO_NUM_ROWS) conio_scroll(); memmove(&conio_virtscr[conio_cursor.row][conio_cursor.col + 1], - &conio_virtscr[conio_cursor.row][conio_cursor.col], + &conio_virtscr[conio_cursor.row][conio_cursor.col], len - input_buffer.pos + 1); input_buffer.text[input_buffer.pos] = ch; input_buffer.pos++; @@ -176,12 +176,12 @@ static void input_delchar_buff() { return; /* our str */ - memmove(&input_buffer.text[input_buffer.pos], &input_buffer.text[input_buffer.pos + 1], + memmove(&input_buffer.text[input_buffer.pos], &input_buffer.text[input_buffer.pos + 1], len - input_buffer.pos + 1); input_buffer.text[len] = '\0'; /* the virtscr */ memmove(&conio_virtscr[conio_cursor.row][conio_cursor.col], - &conio_virtscr[conio_cursor.row][conio_cursor.col + 1], + &conio_virtscr[conio_cursor.row][conio_cursor.col + 1], len - input_buffer.pos + 1); } @@ -268,5 +268,3 @@ void conio_input_frame() { case INPUT_COMMAND: input_command(); break; } } - - hooks/post-receive -- A KallistiOS implementation of conio. |
From: Lawrence S. <ljs...@us...> - 2015-05-09 02:35: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 "The KallistiOS port of OpenGL.". The branch, master has been updated via 25ba67b9b1a02ee95633fbbc70c494917283a71b (commit) from 763ec9948364538cacef45526e1e1ce785c11f18 (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 25ba67b9b1a02ee95633fbbc70c494917283a71b Author: Lawrence Sebald <ljs...@us...> Date: Fri May 8 22:35:16 2015 -0400 Fix compilation inside the new kos-ports tree. ----------------------------------------------------------------------- Summary of changes: include/glu.h | 6 ++++-- include/glut.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/glu.h b/include/glu.h index 29ba7f4..dcb89f2 100755 --- a/include/glu.h +++ b/include/glu.h @@ -15,10 +15,12 @@ #include <sys/cdefs.h> __BEGIN_DECLS +#ifndef BUILD_LIBGL #include <GL/gl.h> +#endif -#define GLU_FALSE GL_FALSE -#define GLU_TRUE GL_TRUE +#define GLU_FALSE 0 +#define GLU_TRUE 1 /* Mip-Mapped Textures MUST be square or rectangle */ GLAPI GLint APIENTRY gluBuild2DMipmaps(GLenum target, GLint internalFormat, diff --git a/include/glut.h b/include/glut.h index 406f867..91e4b04 100755 --- a/include/glut.h +++ b/include/glut.h @@ -12,7 +12,9 @@ #include <sys/cdefs.h> __BEGIN_DECLS +#ifndef BUILD_LIBGL #include <GL/gl.h> +#endif /* Flush the Submitted Primitive Data to the GPU for render */ GLAPI void APIENTRY glutSwapBuffers(); hooks/post-receive -- The KallistiOS port of OpenGL. |
From: Lawrence S. <ljs...@us...> - 2015-05-03 21:10:25
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 44d01d6c47277454d4eb1e139fa04093f5d23082 (commit) from e937d2fe16dcbcaf6b3f38f8ae18b52c922df298 (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 44d01d6c47277454d4eb1e139fa04093f5d23082 Author: Lawrence Sebald <ljs...@us...> Date: Sun May 3 17:09:55 2015 -0400 Add an automatic default for the KOS_PORTS env var if it isn't set. ----------------------------------------------------------------------- Summary of changes: doc/environ.sh.sample | 3 --- environ_base.sh | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/environ.sh.sample b/doc/environ.sh.sample index 77beb8d..258ae1a 100644 --- a/doc/environ.sh.sample +++ b/doc/environ.sh.sample @@ -58,9 +58,6 @@ export DC_ARM_PREFIX="arm-eabi" # Expand PATH (comment out if you don't want this done here) export PATH="${PATH}:${KOS_CC_BASE}/bin:/opt/toolchains/dc/bin" -# Manually add our second addons tree -export KOS_INC_PATHS="-I${KOS_BASE}/../kos-ports/include" - # reset some options because there's no reason for them to persist across # multiple sourcing of this export KOS_CFLAGS="" diff --git a/environ_base.sh b/environ_base.sh index 6142363..29ce451 100644 --- a/environ_base.sh +++ b/environ_base.sh @@ -1,6 +1,11 @@ # KallistiOS environment variable settings. These are the shared pieces # that are generated from the user config. Configure if you like. +# Default the kos-ports path if it isn't already set. +if [ -z "${KOS_PORTS}" ] ; then + export KOS_PORTS="${KOS_BASE}/../kos-ports" +fi + # Pull in the arch environ file . ${KOS_BASE}/environ_${KOS_ARCH}.sh @@ -9,7 +14,8 @@ export PATH="${PATH}:${KOS_BASE}/utils/gnu_wrappers" # Our includes export KOS_INC_PATHS="${KOS_INC_PATHS} -I${KOS_BASE}/include \ --I${KOS_BASE}/kernel/arch/${KOS_ARCH}/include -I${KOS_BASE}/addons/include" +-I${KOS_BASE}/kernel/arch/${KOS_ARCH}/include -I${KOS_BASE}/addons/include \ +-I${KOS_PORTS}/include" # "System" libraries export KOS_LIB_PATHS="-L${KOS_BASE}/lib/${KOS_ARCH} -L${KOS_BASE}/addons/lib/${KOS_ARCH} -L${KOS_PORTS}/lib" hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-05-03 21:02: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 e937d2fe16dcbcaf6b3f38f8ae18b52c922df298 (commit) from 9a4a39502e7156e12c98ae8b0b86120ae4991caa (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 e937d2fe16dcbcaf6b3f38f8ae18b52c922df298 Author: Lawrence Sebald <ljs...@us...> Date: Sun May 3 17:01:38 2015 -0400 Add KOS_PORTS variable to environ.sh. Please update your environ.sh file to add the location to the ports tree to your script! ----------------------------------------------------------------------- Summary of changes: doc/environ.sh.sample | 1 + environ_base.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/doc/environ.sh.sample b/doc/environ.sh.sample index 357aa12..77beb8d 100644 --- a/doc/environ.sh.sample +++ b/doc/environ.sh.sample @@ -21,6 +21,7 @@ export KOS_SUBARCH="pristine" # KOS main base path export KOS_BASE="/opt/toolchains/dc/kos" +export KOS_PORTS="${KOS_BASE}/../kos-ports" # Make utility export KOS_MAKE="make" diff --git a/environ_base.sh b/environ_base.sh index b76b6a8..6142363 100644 --- a/environ_base.sh +++ b/environ_base.sh @@ -12,7 +12,7 @@ export KOS_INC_PATHS="${KOS_INC_PATHS} -I${KOS_BASE}/include \ -I${KOS_BASE}/kernel/arch/${KOS_ARCH}/include -I${KOS_BASE}/addons/include" # "System" libraries -export KOS_LIB_PATHS="-L${KOS_BASE}/lib/${KOS_ARCH} -L${KOS_BASE}/addons/lib/${KOS_ARCH}" +export KOS_LIB_PATHS="-L${KOS_BASE}/lib/${KOS_ARCH} -L${KOS_BASE}/addons/lib/${KOS_ARCH} -L${KOS_PORTS}/lib" export KOS_LIBS="-Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group" # Main arch compiler paths hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-05-03 01:21:16
|
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 9a4a39502e7156e12c98ae8b0b86120ae4991caa (commit) from e636b2486e47861680cd59d4f6134a90617a7ba0 (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 9a4a39502e7156e12c98ae8b0b86120ae4991caa Author: Lawrence Sebald <ljs...@us...> Date: Sat May 2 21:21:05 2015 -0400 Fix modplug_test example. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/cpp/modplug_test/Makefile | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/examples/dreamcast/cpp/modplug_test/Makefile b/examples/dreamcast/cpp/modplug_test/Makefile index 8792059..58124e4 100644 --- a/examples/dreamcast/cpp/modplug_test/Makefile +++ b/examples/dreamcast/cpp/modplug_test/Makefile @@ -12,8 +12,7 @@ rm-elf: -rm -f $(TARGET) romdisk.* $(TARGET): $(OBJS) romdisk.o - $(KOS_CCPLUS) $(KOS_CFLAGS) $(KOS_CPPFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) romdisk.o $(OBJEXTRA) -lmodplug -lm $(KOS_LIBS) + kos-c++ -o $(TARGET) $(OBJS) romdisk.o $(OBJEXTRA) -lmodplug -lm romdisk.img: $(KOS_GENROMFS) -f romdisk.img -d romdisk -v hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-05-03 01:15: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 e636b2486e47861680cd59d4f6134a90617a7ba0 (commit) from 41615a930bf620d4adc27c3e0494194eda25c67e (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 e636b2486e47861680cd59d4f6134a90617a7ba0 Author: Lawrence Sebald <ljs...@us...> Date: Sat May 2 21:15:25 2015 -0400 Update one more reference to panic. ----------------------------------------------------------------------- Summary of changes: kernel/exports.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/exports.txt b/kernel/exports.txt index dddf225..4c3f8f4 100644 --- a/kernel/exports.txt +++ b/kernel/exports.txt @@ -218,7 +218,7 @@ mmu_init mmu_shutdown # Panic! -panic +arch_panic # Real-time clock rtc_unix_secs hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-05-02 22:18: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 41615a930bf620d4adc27c3e0494194eda25c67e (commit) from 9b7049b3c8b394210eec99e1f44c0e8d1ef39c7d (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 41615a930bf620d4adc27c3e0494194eda25c67e Author: Lawrence Sebald <ljs...@us...> Date: Sat May 2 18:18:15 2015 -0400 Rename panic() -> arch_panic(). Cleaning up the global namespace a bit... ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/arch/arch.h | 3 +-- kernel/arch/dreamcast/kernel/irq.c | 6 +++--- kernel/arch/dreamcast/kernel/mm.c | 2 +- kernel/arch/dreamcast/kernel/mmu.c | 19 +++++++++---------- kernel/arch/dreamcast/kernel/panic.c | 3 +-- kernel/thread/thread.c | 2 +- 6 files changed, 16 insertions(+), 19 deletions(-) diff --git a/kernel/arch/dreamcast/include/arch/arch.h b/kernel/arch/dreamcast/include/arch/arch.h index 184889b..847d53c 100644 --- a/kernel/arch/dreamcast/include/arch/arch.h +++ b/kernel/arch/dreamcast/include/arch/arch.h @@ -66,7 +66,7 @@ __BEGIN_DECLS \param str The error message to print. \note This function will never return! */ -void panic(const char *str) __noreturn; +void arch_panic(const char *str) __noreturn; /** \brief Kernel C-level entry point. \return The program's return value. @@ -361,4 +361,3 @@ const char *kos_get_authors(void); __END_DECLS #endif /* __ARCH_ARCH_H */ - diff --git a/kernel/arch/dreamcast/kernel/irq.c b/kernel/arch/dreamcast/kernel/irq.c index d683202..bbabdb2 100644 --- a/kernel/arch/dreamcast/kernel/irq.c +++ b/kernel/arch/dreamcast/kernel/irq.c @@ -107,7 +107,7 @@ void irq_handle_exception(int code) { int handled = 0; /* If it's a code 0, well, we shouldn't be here. */ - if(code == 0) panic("spurious RESET exception"); + if(code == 0) arch_panic("spurious RESET exception"); /* If it's a code 1 or 2, grab the event from expevt. */ if(code == 1 || code == 2) evt = *expevt; @@ -126,7 +126,7 @@ void irq_handle_exception(int code) { thd_pslist(dbgio_printf); // library_print_list(dbgio_printf); - panic("double fault"); + arch_panic("double fault"); } inside_int = 1; @@ -173,7 +173,7 @@ void irq_handle_exception(int code) { else irq_dump_regs(code, evt); - panic("unhandled IRQ/Exception"); + arch_panic("unhandled IRQ/Exception"); } /* dbgio_printf("returning from int\n"); */ diff --git a/kernel/arch/dreamcast/kernel/mm.c b/kernel/arch/dreamcast/kernel/mm.c index ad10ecb..c07ad90 100644 --- a/kernel/arch/dreamcast/kernel/mm.c +++ b/kernel/arch/dreamcast/kernel/mm.c @@ -49,7 +49,7 @@ void* mm_sbrk(unsigned long increment) { if(((uint32)sbrk_base) >= (0x8d000000 - 65536)) { dbglog(DBG_DEAD, "Requested sbrk_base %p, was %p, diff %lu\n", sbrk_base, base, increment); - panic("out of memory; about to run over kernel stack"); + arch_panic("out of memory; about to run over kernel stack"); } irq_restore(old); diff --git a/kernel/arch/dreamcast/kernel/mmu.c b/kernel/arch/dreamcast/kernel/mmu.c index a94ef79..425ce25 100644 --- a/kernel/arch/dreamcast/kernel/mmu.c +++ b/kernel/arch/dreamcast/kernel/mmu.c @@ -344,7 +344,7 @@ int mmu_copyin(mmucontext_t *context, uint32 srcaddr, uint32 srccnt, void *buffe srcpage = map_virt(context, srcptr >> PAGESIZE_BITS); if(srcpage == NULL) - panic("mmu_copyv with invalid source page"); + arch_panic("mmu_copyv with invalid source page"); src = (srcpage->physical << PAGESIZE_BITS) | (srcptr & PAGEMASK); srckrn = 0; @@ -385,7 +385,7 @@ int mmu_copyin(mmucontext_t *context, uint32 srcaddr, uint32 srccnt, void *buffe srcpage = map_virt(context, srcptr >> PAGESIZE_BITS); if(srcpage == NULL) - panic("mmu_copyv with invalid source page (in loop)"); + arch_panic("mmu_copyv with invalid source page (in loop)"); src = (srcpage->physical << PAGESIZE_BITS) | (srcptr - (srcptr & ~PAGEMASK)); @@ -426,7 +426,7 @@ int mmu_copyv(mmucontext_t *context1, iovec_t *iov1, int iovcnt1, srcpage = map_virt(context1, srcptr >> PAGESIZE_BITS); if(srcpage == NULL) - panic("mmu_copyv with invalid source page"); + arch_panic("mmu_copyv with invalid source page"); src = (srcpage->physical << PAGESIZE_BITS) | (srcptr & PAGEMASK); srckrn = 0; @@ -445,7 +445,7 @@ int mmu_copyv(mmucontext_t *context1, iovec_t *iov1, int iovcnt1, dstpage = map_virt(context2, dstptr >> PAGESIZE_BITS); if(dstpage == NULL) - panic("mmu_copyv with invalid destination page"); + arch_panic("mmu_copyv with invalid destination page"); dst = (dstpage->physical << PAGESIZE_BITS) | (dstptr & PAGEMASK); dstkrn = 0; @@ -514,7 +514,7 @@ int mmu_copyv(mmucontext_t *context1, iovec_t *iov1, int iovcnt1, srcpage = map_virt(context1, srcptr >> PAGESIZE_BITS); if(srcpage == NULL) - panic("mmu_copyv with invalid source page (in loop)"); + arch_panic("mmu_copyv with invalid source page (in loop)"); src = (srcpage->physical << PAGESIZE_BITS) | (srcptr & PAGEMASK); } @@ -527,7 +527,7 @@ int mmu_copyv(mmucontext_t *context1, iovec_t *iov1, int iovcnt1, srcpage = map_virt(context1, srcptr >> PAGESIZE_BITS); if(srcpage == NULL) - panic("mmu_copyv with invalid source page (in loop)"); + arch_panic("mmu_copyv with invalid source page (in loop)"); src = (srcpage->physical << PAGESIZE_BITS) | (srcptr - (srcptr & ~PAGEMASK)); @@ -548,7 +548,7 @@ int mmu_copyv(mmucontext_t *context1, iovec_t *iov1, int iovcnt1, dstpage = map_virt(context2, dstptr >> PAGESIZE_BITS); if(dstpage == NULL) - panic("mmu_copyv with invalid destination page (in loop)"); + arch_panic("mmu_copyv with invalid destination page (in loop)"); dst = (dstpage->physical << PAGESIZE_BITS) | (dstptr & PAGEMASK); } @@ -561,7 +561,7 @@ int mmu_copyv(mmucontext_t *context1, iovec_t *iov1, int iovcnt1, dstpage = map_virt(context2, dstptr >> PAGESIZE_BITS); if(dstpage == NULL) - panic("mmu_copyv with invalid destination page (in loop)"); + arch_panic("mmu_copyv with invalid destination page (in loop)"); dst = (dstpage->physical << PAGESIZE_BITS) | (dstptr - (dstptr & ~PAGEMASK)); @@ -607,7 +607,7 @@ static void unhandled_mmu(irq_t source, irq_context_t *context) { for(i = 0; i < 512; i++) dbgio_flush(); - panic("unhandled MMU exception"); + arch_panic("unhandled MMU exception"); } /* Generic handler that takes a missed TLB exception and loads the @@ -754,4 +754,3 @@ void mmu_shutdown() { irq_set_handler(EXC_DTLB_PV_WRITE, NULL); irq_set_handler(EXC_INITIAL_PAGE_WRITE, NULL); } - diff --git a/kernel/arch/dreamcast/kernel/panic.c b/kernel/arch/dreamcast/kernel/panic.c index 9092d0f..f9b08fb 100644 --- a/kernel/arch/dreamcast/kernel/panic.c +++ b/kernel/arch/dreamcast/kernel/panic.c @@ -11,8 +11,7 @@ /* If something goes badly wrong in the kernel and you don't think you can recover, call this. This is a pretty standard tactic from *nixy kernels which ought to be avoided if at all possible. */ -void panic(const char *msg) { +void arch_panic(const char *msg) { printf("kernel panic: %s\r\n", msg); arch_abort(); } - diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index d65af39..c8408a1 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -526,7 +526,7 @@ void thd_schedule(int front_of_line, uint64 now) { /* Didn't find one? Big problem here... */ if(thd == NULL) { thd_pslist(printf); - panic("couldn't find a runnable thread"); + arch_panic("couldn't find a runnable thread"); } /* We should now have a runnable thread, so remove it from the hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Christian G. <sa...@us...> - 2015-04-24 13:38:10
|
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 9b7049b3c8b394210eec99e1f44c0e8d1ef39c7d (commit) from 623a4b323af36e8ad1243a60c38935de244c4ebd (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 9b7049b3c8b394210eec99e1f44c0e8d1ef39c7d Author: Christian Groessler <ch...@gr...> Date: Fri Apr 24 15:37:54 2015 +0200 fix a comment ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/include/dc/maple/keyboard.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/arch/dreamcast/include/dc/maple/keyboard.h b/kernel/arch/dreamcast/include/dc/maple/keyboard.h index 0f61e0d..3c66af2 100644 --- a/kernel/arch/dreamcast/include/dc/maple/keyboard.h +++ b/kernel/arch/dreamcast/include/dc/maple/keyboard.h @@ -169,7 +169,7 @@ __BEGIN_DECLS */ #define KBD_REGION_JP 1 /**< \brief Japanese keyboard */ #define KBD_REGION_US 2 /**< \brief US keyboard */ -#define KBD_REGION_UK 3 /**< \brief (maybe?) UK keyboard */ +#define KBD_REGION_UK 3 /**< \brief UK keyboard */ #define KBD_REGION_DE 4 /**< \brief German keyboard */ /** @} */ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Christian G. <sa...@us...> - 2015-04-24 13:35:31
|
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 623a4b323af36e8ad1243a60c38935de244c4ebd (commit) from 5f37d4081066335bbdd7e87ce07c299644b6d65a (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 623a4b323af36e8ad1243a60c38935de244c4ebd Author: Christian Groessler <ch...@gr...> Date: Fri Apr 24 15:35:00 2015 +0200 fix a copy-n-paste error ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/maple/keyboard.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index e73f384..9aa2bed 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -163,7 +163,7 @@ static kbd_keymap_t keymaps[KBD_NUM_KEYMAPS] = { 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x57 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5F */ - 0, 0, 0, 0, '|', 0, 0, 0, /* 0x60 - 0x65 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x65 */ /* All the rest are unused, and will be 0. */ } }, hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Christian G. <sa...@us...> - 2015-04-24 13:26:29
|
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 5f37d4081066335bbdd7e87ce07c299644b6d65a (commit) from 9f832a900ccb4f150f0264da806bb6b072de01ce (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 5f37d4081066335bbdd7e87ce07c299644b6d65a Author: Christian Groessler <ch...@gr...> Date: Fri Apr 24 15:25:52 2015 +0200 add support for UK keyboards ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 2 +- kernel/arch/dreamcast/hardware/maple/keyboard.c | 48 +++++++++++++++-------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index ff87cd9..31028b3 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -5,7 +5,7 @@ versions (where they are missing from early versions, assume that they should be attributed to Dan Potter). KallistiOS version 2.0.1 ----------------------------------------------- -- DC Add support for German keyboards [CG] +- DC Add support for German (DE) and UK keyboards [Christian Groessler == CG] - *** 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] diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index c98ea51..e73f384 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -114,43 +114,57 @@ static kbd_keymap_t keymaps[KBD_NUM_KEYMAPS] = { } }, { - /* probably UK keyboard (empty entry, will return scan codes for now ...) */ + /* UK/QWERTY keyboard */ { /* Base values */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x07 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x08 - 0x0F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x17 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x18 - 0x1F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x27 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x28 - 0x2F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x37 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 'a', 'b', 'c', 'd', /* 0x00 - 0x07 */ + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', /* 0x08 - 0x0F */ + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ + 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', /* 0x18 - 0x1F */ + '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ + 10, 27, 8, 9, ' ', '-', '=', '[', /* 0x28 - 0x2F */ + ']', '\\', '#', ';', '\'', '`', ',', '.', /* 0x30 - 0x37 */ + '/', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x57 */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x65 */ + 0, 0, 0, 0, '/', '*', '-', '+', /* 0x50 - 0x57 */ + 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ + '8', '9', '0', '.', '\\', 0 /* 0x60 - 0x65 */ /* All the rest are unused, and will be 0. */ }, { /* Shifted values */ + 0, 0, 0, 0, 'A', 'B', 'C', 'D', /* 0x00 - 0x07 */ + 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', /* 0x08 - 0x0F */ + 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', /* 0x10 - 0x17 */ + 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '"', /* 0x18 - 0x1F */ + 0xa3, '$', '%', '^', '&', '*', '(', ')', /* 0x20 - 0x27 */ + 10, 27, 8, 9, ' ', '_', '+', '{', /* 0x28 - 0x2F */ + '}', '|', '~', ':', '@', '|', '<', '>', /* 0x30 - 0x37 */ + '?', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, '/', '*', '-', '+', /* 0x50 - 0x57 */ + 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ + '8', '9', '0', '.', '|', 0 /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + }, + { + /* "Alt" shifted values */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x07 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x08 - 0x0F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x17 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x18 - 0x1F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x27 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x28 - 0x2F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x37 */ + 0, 0, 0, 0, 0, '|', 0, 0, /* 0x30 - 0x37 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x57 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5F */ - 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x65 */ + 0, 0, 0, 0, '|', 0, 0, 0, /* 0x60 - 0x65 */ /* All the rest are unused, and will be 0. */ - }, - { - /* no "Alt" shifted values */ } }, { hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Christian G. <sa...@us...> - 2015-04-16 21:47:18
|
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 9f832a900ccb4f150f0264da806bb6b072de01ce (commit) from f6fff5b01226552134fdb0d942fa8ec7459427b0 (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 9f832a900ccb4f150f0264da806bb6b072de01ce Author: Christian Groessler <ch...@gr...> Date: Thu Apr 16 23:44:26 2015 +0200 add support for German keyboards (the UK keyboard table will be revisited soon...) ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 1 + kernel/arch/dreamcast/hardware/maple/keyboard.c | 115 ++++++++++++++++++++- kernel/arch/dreamcast/include/dc/maple/keyboard.h | 6 +- 3 files changed, 118 insertions(+), 4 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index fb7bf69..ff87cd9 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -5,6 +5,7 @@ versions (where they are missing from early versions, assume that they should be attributed to Dan Potter). KallistiOS version 2.0.1 ----------------------------------------------- +- DC Add support for German keyboards [CG] - *** 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] diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index c391af5..c98ea51 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -21,7 +21,7 @@ repeat handling. */ /* Built-in keymaps. */ -#define KBD_NUM_KEYMAPS 2 +#define KBD_NUM_KEYMAPS 4 static kbd_keymap_t keymaps[KBD_NUM_KEYMAPS] = { { /* Japanese keyboard */ @@ -68,11 +68,15 @@ static kbd_keymap_t keymaps[KBD_NUM_KEYMAPS] = { 0, 0, 0, 0, 0, 0, 0, '_', /* 0x80 - 0x87 */ 0, '|', 0, 0 /* 0x88 - 0x8A */ /* All the rest are unused, and will be 0. */ + }, + { + /* no "Alt" shifted values */ } }, { /* US/QWERTY keyboard */ { + /* Base values */ 0, 0, 0, 0, 'a', 'b', 'c', 'd', /* 0x00 - 0x07 */ 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', /* 0x08 - 0x0F */ 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ @@ -89,6 +93,7 @@ static kbd_keymap_t keymaps[KBD_NUM_KEYMAPS] = { /* All the rest are unused, and will be 0. */ }, { + /* Shifted values */ 0, 0, 0, 0, 'A', 'B', 'C', 'D', /* 0x00 - 0x07 */ 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', /* 0x08 - 0x0F */ 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', /* 0x10 - 0x17 */ @@ -103,8 +108,106 @@ static kbd_keymap_t keymaps[KBD_NUM_KEYMAPS] = { 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ '8', '9', '0', '.', 0, 0 /* 0x60 - 0x65 */ /* All the rest are unused, and will be 0. */ + }, + { + /* no "Alt" shifted values */ } - } + }, + { + /* probably UK keyboard (empty entry, will return scan codes for now ...) */ + { + /* Base values */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x07 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x08 - 0x0F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x17 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x18 - 0x1F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x27 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x28 - 0x2F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x37 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x57 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + }, + { + /* Shifted values */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x07 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x08 - 0x0F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x17 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x18 - 0x1F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x20 - 0x27 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x28 - 0x2F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x37 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x57 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + }, + { + /* no "Alt" shifted values */ + } + }, + { + /* German/QWERTZ keyboard */ + /* The hex values in the tables are the ISO8859-1 represention of the German special chars. */ + { + /* Base values */ + 0, 0, 0, 0, 'a', 'b', 'c', 'd', /* 0x00 - 0x07 */ + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', /* 0x08 - 0x0F */ + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', /* 0x10 - 0x17 */ + 'u', 'v', 'w', 'x', 'z', 'y', '1', '2', /* 0x18 - 0x1F */ + '3', '4', '5', '6', '7', '8', '9', '0', /* 0x20 - 0x27 */ + 10, 27, 8, 9, ' ', 0xdf, '\'', 0xfc, /* 0x28 - 0x2F */ + '+', '\\', '#', 0xf6, 0xe4, '^', ',', '.', /* 0x30 - 0x37 */ + '-', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, '/', '*', '-', '+', /* 0x50 - 0x57 */ + 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ + '8', '9', '0', '.', '<', 0 /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + }, + { + /* Shifted values */ + 0, 0, 0, 0, 'A', 'B', 'C', 'D', /* 0x00 - 0x07 */ + 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', /* 0x08 - 0x0F */ + 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', /* 0x10 - 0x17 */ + 'U', 'V', 'W', 'X', 'Z', 'Y', '!', '"', /* 0x18 - 0x1F */ + 0xa7, '$', '%', '&', '/', '(', ')', '=', /* 0x20 - 0x27 */ + 10, 27, 8, 9, ' ', '?', '`', 0xdc, /* 0x28 - 0x2F */ + '*', '|', '\'', 0xd6, 0xc4, 0xb0, ';', ':', /* 0x30 - 0x37 */ + '_', 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, '/', '*', '-', '+', /* 0x50 - 0x57 */ + 13, '1', '2', '3', '4', '5', '6', '7', /* 0x58 - 0x5F */ + '8', '9', '0', '.', '>', 0 /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + }, + { + /* "Alt" shifted values */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 - 0x07 */ + 0xa4, 0, 0, 0, 0, 0, 0, 0, /* 0x08 - 0x0F */ + 0xb5, 0, 0, 0, 0, 0, 0, 0, /* 0x10 - 0x17 */ + 0, 0, 0, 0, 0, 0, 0, 0xb2, /* 0x18 - 0x1F */ + 0xb3, 0, 0, 0, '{', '[', ']', '}', /* 0x20 - 0x27 */ + 0, 0, 0, 0, 0, '\\', 0, 0, /* 0x28 - 0x2F */ + '~', 0, 0, 0, 0, 0, 0, 0, /* 0x30 - 0x37 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x38 - 0x3F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x40 - 0x47 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x48 - 0x4F */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x50 - 0x57 */ + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x58 - 0x5F */ + 0, 0, 0, 0, '|', 0, 0, 0, /* 0x60 - 0x65 */ + /* All the rest are unused, and will be 0. */ + } + }, }; @@ -225,7 +328,9 @@ int kbd_queue_pop(maple_device_t *dev, int xlat) { mods = rv >> 8; - if(mods & (KBD_MOD_LSHIFT | KBD_MOD_RSHIFT | (1 << 9))) + if(mods & KBD_MOD_RALT || (mods & (KBD_MOD_LCTRL | KBD_MOD_LALT)) == (KBD_MOD_LCTRL | KBD_MOD_LALT)) + ascii = keymaps[state->region - 1].alt[(uint8)rv]; + else if(mods & (KBD_MOD_LSHIFT | KBD_MOD_RSHIFT | (1 << 9))) ascii = keymaps[state->region - 1].shifted[(uint8)rv]; else ascii = keymaps[state->region - 1].base[(uint8)rv]; @@ -354,6 +459,10 @@ static int kbd_attach(maple_driver_t *drv, maple_device_t *dev) { else state->region = dev->info.function_data[d] & 0xFF; + if (state->region > KBD_NUM_KEYMAPS) + /* Unrecognized keyboards will appear as US keyboards... */ + state->region = KBD_REGION_US; + /* Make sure all the queue variables are set up properly... */ state->queue_tail = state->queue_head = state->queue_len = 0; diff --git a/kernel/arch/dreamcast/include/dc/maple/keyboard.h b/kernel/arch/dreamcast/include/dc/maple/keyboard.h index d8c9687..0f61e0d 100644 --- a/kernel/arch/dreamcast/include/dc/maple/keyboard.h +++ b/kernel/arch/dreamcast/include/dc/maple/keyboard.h @@ -169,6 +169,8 @@ __BEGIN_DECLS */ #define KBD_REGION_JP 1 /**< \brief Japanese keyboard */ #define KBD_REGION_US 2 /**< \brief US keyboard */ +#define KBD_REGION_UK 3 /**< \brief (maybe?) UK keyboard */ +#define KBD_REGION_DE 4 /**< \brief German keyboard */ /** @} */ /** \brief Size of a keyboard queue. @@ -184,13 +186,15 @@ __BEGIN_DECLS /** \brief Keyboard keymap. This structure represents a mapping from raw key values to ASCII values, if - appropriate. This handles base values as well as shifted values. + appropriate. This handles base values as well as shifted ("shift" and "Alt" + keys) values. \headerfile dc/maple/keyboard.h */ typedef struct kbd_keymap { uint8 base[256]; uint8 shifted[256]; + uint8 alt[256]; } kbd_keymap_t; /** \brief Keyboard raw condition structure. hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-03-22 01:00: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 f6fff5b01226552134fdb0d942fa8ec7459427b0 (commit) from 32dda8aef0bccf0fab879eb8975139a492433874 (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 f6fff5b01226552134fdb0d942fa8ec7459427b0 Author: Lawrence Sebald <ljs...@us...> Date: Sat Mar 21 20:54:15 2015 -0400 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. The rest of the warnings currently reported with -pedantic either would require a lot of work to clean up or would just make the code needlessly ugly. This commit cleans up warnings like the following: warning: ISO C forbids an empty translation unit [-pedantic] warning: ISO C does not permit named variadic macros [-Wvariadic-macros] warning: format â%pâ expects argument of type âvoid *â, but argument 3 has type âstruct kthread_t *â [-Wformat] warning: ISO C forbids zero-size array âdataâ [-pedantic] warning: pointer of type âvoid *â used in arithmetic [-pedantic] warning: obsolete use of designated initializer with â:â [-pedantic] warning: initialization discards âconstâ qualifier from pointer target type [enabled by default] It does *not* clean up warnings like these: warning: type of bit-field âblankâ is a GCC extension [-pedantic] warning: ISO C forbids braced-groups within expressions [-pedantic] warning: ISO C forbids conversion of object pointer to function pointer type [-pedantic] ----------------------------------------------------------------------- Summary of changes: addons/libkosutils/netcfg.c | 2 +- environ_base.sh | 6 +- kernel/arch/dreamcast/fs/fs_dclsocket.c | 7 ++- kernel/arch/dreamcast/hardware/maple/controller.c | 16 ++----- kernel/arch/dreamcast/hardware/maple/dreameye.c | 15 ++----- kernel/arch/dreamcast/hardware/maple/keyboard.c | 12 +++--- kernel/arch/dreamcast/hardware/maple/mouse.c | 16 ++----- kernel/arch/dreamcast/hardware/maple/purupuru.c | 16 ++----- kernel/arch/dreamcast/hardware/maple/sip.c | 15 ++----- kernel/arch/dreamcast/hardware/maple/vmu.c | 15 ++----- kernel/arch/dreamcast/hardware/sq.c | 2 +- kernel/arch/dreamcast/include/dc/maple.h | 2 +- kernel/arch/dreamcast/kernel/mm.c | 4 +- kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h | 44 ++++++++++---------- kernel/libc/koslib/Makefile | 9 ++++- kernel/thread/thread.c | 3 +- 16 files changed, 79 insertions(+), 105 deletions(-) diff --git a/addons/libkosutils/netcfg.c b/addons/libkosutils/netcfg.c index 5c3371a..8a94fab 100644 --- a/addons/libkosutils/netcfg.c +++ b/addons/libkosutils/netcfg.c @@ -18,7 +18,7 @@ #if 0 #define dbgp printf #else -#define dbgp(x...) +#define dbgp(...) #endif void netcfg_vmuify(const char *filename_in, const char *filename_out) { diff --git a/environ_base.sh b/environ_base.sh index c588887..b76b6a8 100644 --- a/environ_base.sh +++ b/environ_base.sh @@ -33,9 +33,9 @@ export KOS_CPPFLAGS="${KOS_CPPFLAGS} ${KOS_INC_PATHS_CPP} -fno-operator-names -f export KOS_CSTD="-std=c99" export KOS_CPPSTD="-std=gnu++98" -GCCVER="`kos-cc -v 2>&1 | tail -1 | awk '{print $3}'`" +export KOS_GCCVER="`kos-cc -v 2>&1 | tail -1 | awk '{print $3}'`" -case $GCCVER in +case $KOS_GCCVER in 4*) export KOS_LDFLAGS="${KOS_LDFLAGS} ${KOS_LD_SCRIPT} -nodefaultlibs ${KOS_LIB_PATHS}" ;; *) @@ -45,7 +45,7 @@ esac # Some extra vars based on architecture export KOS_ARCH_DIR="${KOS_BASE}/kernel/arch/${KOS_ARCH}" -case $GCCVER in +case $KOS_GCCVER in 4*) export KOS_START="" ;; *) diff --git a/kernel/arch/dreamcast/fs/fs_dclsocket.c b/kernel/arch/dreamcast/fs/fs_dclsocket.c index d4c94f5..5f428f8 100644 --- a/kernel/arch/dreamcast/fs/fs_dclsocket.c +++ b/kernel/arch/dreamcast/fs/fs_dclsocket.c @@ -44,7 +44,7 @@ typedef struct { unsigned char id[4]; unsigned int address; unsigned int size; - unsigned char data[0]; + unsigned char data[]; } PACKED command_t; typedef struct { @@ -385,6 +385,7 @@ 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; @@ -401,10 +402,10 @@ static off_t dcls_seek(void *hnd, off_t offset, int whence) { mutex_lock(&mutex); } - --hnd; + --fd; memcpy(command->id, "DC11", 4); - command->value0 = htonl((uint32)hnd); + command->value0 = htonl(fd); command->value1 = htonl((uint32)offset); command->value2 = htonl((uint32)whence); diff --git a/kernel/arch/dreamcast/hardware/maple/controller.c b/kernel/arch/dreamcast/hardware/maple/controller.c index a1830be..4fc7cc7 100644 --- a/kernel/arch/dreamcast/hardware/maple/controller.c +++ b/kernel/arch/dreamcast/hardware/maple/controller.c @@ -99,16 +99,11 @@ static void cont_periodic(maple_driver_t *drv) { /* Device Driver Struct */ static maple_driver_t controller_drv = { -functions: - MAPLE_FUNC_CONTROLLER, -name: "Controller Driver" - , -periodic: - cont_periodic, -attach: - NULL, -detach: - NULL + .functions = MAPLE_FUNC_CONTROLLER, + .name = "Controller Driver", + .periodic = cont_periodic, + .attach = NULL, + .detach = NULL }; /* Add the controller to the driver chain */ @@ -119,4 +114,3 @@ int cont_init() { void cont_shutdown() { maple_driver_unreg(&controller_drv); } - diff --git a/kernel/arch/dreamcast/hardware/maple/dreameye.c b/kernel/arch/dreamcast/hardware/maple/dreameye.c index ef48079..d76cd90 100644 --- a/kernel/arch/dreamcast/hardware/maple/dreameye.c +++ b/kernel/arch/dreamcast/hardware/maple/dreameye.c @@ -422,16 +422,11 @@ static int dreameye_attach(maple_driver_t *drv, maple_device_t *dev) { /* Device Driver Struct */ static maple_driver_t dreameye_drv = { -functions: - MAPLE_FUNC_CAMERA, -name: "Dreameye (Camera)" - , -periodic: - dreameye_periodic, -attach: - dreameye_attach, -detach: - NULL + .functions = MAPLE_FUNC_CAMERA, + .name = "Dreameye (Camera)", + .periodic = dreameye_periodic, + .attach = dreameye_attach, + .detach = NULL }; /* Add the Dreameye to the driver chain */ diff --git a/kernel/arch/dreamcast/hardware/maple/keyboard.c b/kernel/arch/dreamcast/hardware/maple/keyboard.c index 5c9f674..c391af5 100644 --- a/kernel/arch/dreamcast/hardware/maple/keyboard.c +++ b/kernel/arch/dreamcast/hardware/maple/keyboard.c @@ -343,7 +343,7 @@ static int kbd_attach(maple_driver_t *drv, maple_device_t *dev) { if(f & 0x80000000) { ++d; } - + f <<= 1; tmp <<= 1; } @@ -362,11 +362,11 @@ static int kbd_attach(maple_driver_t *drv, maple_device_t *dev) { /* Device driver struct */ static maple_driver_t kbd_drv = { - functions: MAPLE_FUNC_KEYBOARD, - name: "Keyboard Driver", - periodic: kbd_periodic, - attach: kbd_attach, - detach: NULL + .functions = MAPLE_FUNC_KEYBOARD, + .name = "Keyboard Driver", + .periodic = kbd_periodic, + .attach = kbd_attach, + .detach = NULL }; /* Add the keyboard to the driver chain */ diff --git a/kernel/arch/dreamcast/hardware/maple/mouse.c b/kernel/arch/dreamcast/hardware/maple/mouse.c index bee7706..9a4bea4 100644 --- a/kernel/arch/dreamcast/hardware/maple/mouse.c +++ b/kernel/arch/dreamcast/hardware/maple/mouse.c @@ -71,16 +71,11 @@ static void mouse_periodic(maple_driver_t *drv) { /* Device Driver Struct */ static maple_driver_t mouse_drv = { -functions: - MAPLE_FUNC_MOUSE, -name: "Mouse Driver" - , -periodic: - mouse_periodic, -attach: - NULL, -detach: - NULL + .functions = MAPLE_FUNC_MOUSE, + .name = "Mouse Driver", + .periodic = mouse_periodic, + .attach = NULL, + .detach = NULL }; /* Add the mouse to the driver chain */ @@ -91,4 +86,3 @@ int mouse_init() { void mouse_shutdown() { maple_driver_unreg(&mouse_drv); } - diff --git a/kernel/arch/dreamcast/hardware/maple/purupuru.c b/kernel/arch/dreamcast/hardware/maple/purupuru.c index 70647a5..6aaa590 100644 --- a/kernel/arch/dreamcast/hardware/maple/purupuru.c +++ b/kernel/arch/dreamcast/hardware/maple/purupuru.c @@ -112,16 +112,11 @@ static int purupuru_attach(maple_driver_t *drv, maple_device_t *dev) { /* Device Driver Struct */ static maple_driver_t purupuru_drv = { -functions: - MAPLE_FUNC_PURUPURU, -name: "PuruPuru (Vibration) Pack" - , -periodic: - purupuru_periodic, -attach: - purupuru_attach, -detach: - NULL + .functions = MAPLE_FUNC_PURUPURU, + .name = "PuruPuru (Vibration) Pack", + .periodic = purupuru_periodic, + .attach = purupuru_attach, + .detach = NULL }; /* Add the mouse to the driver chain */ @@ -132,4 +127,3 @@ int purupuru_init() { void purupuru_shutdown() { maple_driver_unreg(&purupuru_drv); } - diff --git a/kernel/arch/dreamcast/hardware/maple/sip.c b/kernel/arch/dreamcast/hardware/maple/sip.c index 80897eb..7bcab0d 100644 --- a/kernel/arch/dreamcast/hardware/maple/sip.c +++ b/kernel/arch/dreamcast/hardware/maple/sip.c @@ -289,16 +289,11 @@ static int sip_attach(maple_driver_t *drv, maple_device_t *dev) { /* Device Driver Struct */ static maple_driver_t sip_drv = { -functions: - MAPLE_FUNC_MICROPHONE, -name: "Sound Input Peripheral" - , -periodic: - sip_periodic, -attach: - sip_attach, -detach: - NULL + .functions = MAPLE_FUNC_MICROPHONE, + .name = "Sound Input Peripheral", + .periodic = sip_periodic, + .attach = sip_attach, + .detach = NULL }; /* Add the SIP to the driver chain */ diff --git a/kernel/arch/dreamcast/hardware/maple/vmu.c b/kernel/arch/dreamcast/hardware/maple/vmu.c index 2a02901..c916ab7 100644 --- a/kernel/arch/dreamcast/hardware/maple/vmu.c +++ b/kernel/arch/dreamcast/hardware/maple/vmu.c @@ -29,16 +29,11 @@ static int vmu_attach(maple_driver_t *drv, maple_device_t *dev) { /* Device Driver Struct */ static maple_driver_t vmu_drv = { -functions: - MAPLE_FUNC_MEMCARD | MAPLE_FUNC_LCD | MAPLE_FUNC_CLOCK, -name: "VMU Driver" - , -periodic: - NULL, -attach: - vmu_attach, -detach: - NULL + .functions = MAPLE_FUNC_MEMCARD | MAPLE_FUNC_LCD | MAPLE_FUNC_CLOCK, + .name = "VMU Driver", + .periodic = NULL, + .attach = vmu_attach, + .detach = NULL }; /* Add the VMU to the driver chain */ diff --git a/kernel/arch/dreamcast/hardware/sq.c b/kernel/arch/dreamcast/hardware/sq.c index e1cc8e0..c6c89d4 100644 --- a/kernel/arch/dreamcast/hardware/sq.c +++ b/kernel/arch/dreamcast/hardware/sq.c @@ -42,7 +42,7 @@ void sq_clr(void *dest, int n) { void * sq_cpy(void *dest, const void *src, int n) { unsigned int *d = (unsigned int *)(void *) (0xe0000000 | (((unsigned long)dest) & 0x03ffffe0)); - unsigned int *s = src; + const unsigned int *s = src; /* Set store queue memory area as desired */ QACR0 = ((((unsigned int)dest) >> 26) << 2) & 0x1c; diff --git a/kernel/arch/dreamcast/include/dc/maple.h b/kernel/arch/dreamcast/include/dc/maple.h index df38519..b8d0ec9 100644 --- a/kernel/arch/dreamcast/include/dc/maple.h +++ b/kernel/arch/dreamcast/include/dc/maple.h @@ -224,7 +224,7 @@ typedef struct maple_response { uint8 dst_addr; /**< \brief Destination address */ uint8 src_addr; /**< \brief Source address */ uint8 data_len; /**< \brief Data length (in 32-bit words) */ - uint8 data[0]; /**< \brief Data (if any) */ + uint8 data[]; /**< \brief Data (if any) */ } maple_response_t; /** \brief One maple device. diff --git a/kernel/arch/dreamcast/kernel/mm.c b/kernel/arch/dreamcast/kernel/mm.c index 8562e9e..ad10ecb 100644 --- a/kernel/arch/dreamcast/kernel/mm.c +++ b/kernel/arch/dreamcast/kernel/mm.c @@ -44,7 +44,7 @@ void* mm_sbrk(unsigned long increment) { if(increment & 3) increment = (increment + 4) & ~3; - sbrk_base += increment; + sbrk_base = (void *)(increment + (unsigned long)sbrk_base); if(((uint32)sbrk_base) >= (0x8d000000 - 65536)) { dbglog(DBG_DEAD, "Requested sbrk_base %p, was %p, diff %lu\n", @@ -56,5 +56,3 @@ void* mm_sbrk(unsigned long increment) { return base; } - - diff --git a/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h b/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h index d4c2d61..aba0a51 100644 --- a/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h +++ b/kernel/arch/dreamcast/sound/arm/aica_cmd_iface.h @@ -21,22 +21,22 @@ typedef unsigned long uint32; head point and the queue size, the command will wrap around to the beginning (i.e., queue commands _can_ be split up). */ typedef struct aica_queue { - uint32 head; /* Insertion point offset (in bytes) */ - uint32 tail; /* Removal point offset (in bytes) */ - uint32 size; /* Queue size (in bytes) */ + uint32 head; /* Insertion point offset (in bytes) */ + uint32 tail; /* Removal point offset (in bytes) */ + uint32 size; /* Queue size (in bytes) */ uint32 valid; /* 1 if the queue structs are valid */ uint32 process_ok; /* 1 if it's ok to process the data */ - uint32 data; /* Pointer to queue data buffer */ + uint32 data; /* Pointer to queue data buffer */ } aica_queue_t; /* Command queue struct for commanding the AICA from the SH-4 */ typedef struct aica_cmd { - uint32 size; /* Command data size in dwords */ - uint32 cmd; /* Command ID */ - uint32 timestamp; /* When to execute the command (0 == now) */ - uint32 cmd_id; /* Command ID, for cmd/response pairs, or channel id */ - uint32 misc[4]; /* Misc Parameters / Padding */ - uint8 cmd_data[0]; /* Command data */ + uint32 size; /* Command data size in dwords */ + uint32 cmd; /* Command ID */ + uint32 timestamp; /* When to execute the command (0 == now) */ + uint32 cmd_id; /* Command ID, for cmd/response pairs, or channel id */ + uint32 misc[4]; /* Misc Parameters / Padding */ + uint8 cmd_data[]; /* Command data */ } aica_cmd_t; /* Maximum command size -- 256 dwords */ @@ -45,18 +45,18 @@ typedef struct aica_cmd { /* This is the cmd_data for AICA_CMD_CHAN. Make this 16 dwords long for two aica bus queues. */ typedef struct aica_channel { - uint32 cmd; /* Command ID */ - uint32 base; /* Sample base in RAM */ - uint32 type; /* (8/16bit/ADPCM) */ - uint32 length; /* Sample length */ - uint32 loop; /* Sample looping */ - uint32 loopstart; /* Sample loop start */ - uint32 loopend; /* Sample loop end */ - uint32 freq; /* Frequency */ - uint32 vol; /* Volume 0-255 */ - uint32 pan; /* Pan 0-255 */ - uint32 pos; /* Sample playback pos */ - uint32 pad[5]; /* Padding */ + uint32 cmd; /* Command ID */ + uint32 base; /* Sample base in RAM */ + uint32 type; /* (8/16bit/ADPCM) */ + uint32 length; /* Sample length */ + uint32 loop; /* Sample looping */ + uint32 loopstart; /* Sample loop start */ + uint32 loopend; /* Sample loop end */ + uint32 freq; /* Frequency */ + uint32 vol; /* Volume 0-255 */ + uint32 pan; /* Pan 0-255 */ + uint32 pos; /* Sample playback pos */ + uint32 pad[5]; /* Padding */ } aica_channel_t; /* Declare an aica_cmd_t big enough to hold an aica_channel_t diff --git a/kernel/libc/koslib/Makefile b/kernel/libc/koslib/Makefile index d7c9878..6fdc05f 100644 --- a/kernel/libc/koslib/Makefile +++ b/kernel/libc/koslib/Makefile @@ -8,11 +8,18 @@ # useful in the context of KOS to go with the Newlib defaults. OBJS = abort.o byteorder.o memset2.o memset4.o memcpy2.o memcpy4.o \ - assert.o dbglog.o malloc.o crtbegin.o crtend.o atexit.o \ + assert.o dbglog.o malloc.o atexit.o \ opendir.o readdir.o closedir.o rewinddir.o scandir.o seekdir.o \ telldir.o usleep.o inet_addr.o realpath.o getcwd.o chdir.o mkdir.o \ creat.o sleep.o rmdir.o rename.o inet_pton.o inet_ntop.o \ inet_ntoa.o inet_aton.o poll.o select.o symlink.o readlink.o \ gethostbyname.o getaddrinfo.o dirfd.o nanosleep.o +GCC_MAJORMINOR = $(basename $(KOS_GCCVER)) +GCC_MAJOR = $(basename $(GCC_MAJORMINOR)) + +ifneq ($(strip $(GCC_MAJOR)), 4) +OBJS += crtbegin.o crtend.o +endif + include $(KOS_BASE)/Makefile.prefab diff --git a/kernel/thread/thread.c b/kernel/thread/thread.c index c3ba166..d65af39 100644 --- a/kernel/thread/thread.c +++ b/kernel/thread/thread.c @@ -654,7 +654,8 @@ int thd_join(kthread_t * thd, void **value_ptr) { return -1; if(irq_inside_int()) { - dbglog(DBG_WARNING, "thd_join(%p) called inside an interrupt!\n", thd); + dbglog(DBG_WARNING, "thd_join(%p) called inside an interrupt!\n", + (void *)thd); return -1; } hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-03-15 18:07: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 32dda8aef0bccf0fab879eb8975139a492433874 (commit) from b45d6c1abb03d49284a2ab583c79162f6dfef97f (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 32dda8aef0bccf0fab879eb8975139a492433874 Author: Lawrence Sebald <ljs...@us...> Date: Sun Mar 15 14:07:23 2015 -0400 Add simple PAL 50/60hz menu example. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/video/Makefile | 8 +- .../{network/dns-client => video/palmenu}/Makefile | 4 +- examples/dreamcast/video/palmenu/palmenu.c | 106 ++++++++++++++++++++ 3 files changed, 113 insertions(+), 5 deletions(-) copy examples/dreamcast/{network/dns-client => video/palmenu}/Makefile (89%) create mode 100644 examples/dreamcast/video/palmenu/palmenu.c diff --git a/examples/dreamcast/video/Makefile b/examples/dreamcast/video/Makefile index c4f105d..a0d8fcf 100644 --- a/examples/dreamcast/video/Makefile +++ b/examples/dreamcast/video/Makefile @@ -1,16 +1,18 @@ # KallistiOS ##version## # # examples/dreamcast/video/Makefile -# (c)2002 Dan Potter +# Copyright (C) 2002 Dan Potter # all: $(KOS_MAKE) -C bfont + $(KOS_MAKE) -C palmenu clean: $(KOS_MAKE) -C bfont clean - + $(KOS_MAKE) -C palmenu clean + dist: $(KOS_MAKE) -C bfont dist - + $(KOS_MAKE) -C palmenu dist diff --git a/examples/dreamcast/network/dns-client/Makefile b/examples/dreamcast/video/palmenu/Makefile similarity index 89% copy from examples/dreamcast/network/dns-client/Makefile copy to examples/dreamcast/video/palmenu/Makefile index adfe504..f6b74b9 100644 --- a/examples/dreamcast/network/dns-client/Makefile +++ b/examples/dreamcast/video/palmenu/Makefile @@ -1,8 +1,8 @@ # Put the filename of the output binary here -TARGET = dns-client.elf +TARGET = palmenu.elf # List all of your C files here, but change the extension to ".o" -OBJS = dns-client.o +OBJS = palmenu.o all: rm-elf $(TARGET) diff --git a/examples/dreamcast/video/palmenu/palmenu.c b/examples/dreamcast/video/palmenu/palmenu.c new file mode 100644 index 0000000..ac12f85 --- /dev/null +++ b/examples/dreamcast/video/palmenu/palmenu.c @@ -0,0 +1,106 @@ +/* KallistiOS ##version## + + palmenu.c + Copyright (C) 2015 Lawrence Sebald + + Every once in a while, a question pops up on one of the various Dreamcast- + related forums of how to deal with 50Hz TVs. Well, the standard tactic is to + detect if the console is European and display a simple menu if so. That's + exactly what this example does. + + For those on a US or Japanese console, this example is pretty boring. +*/ + +#include <kos/thread.h> + +#include <dc/biosfont.h> +#include <dc/flashrom.h> +#include <dc/maple.h> +#include <dc/video.h> +#include <dc/maple/controller.h> + +#define USE_50HZ 0 +#define USE_60HZ 1 + +/* Draw a very simple "menu" on the screen to pick between 50Hz and 60Hz mode... + This could obviously be spruced up a bit with a real menu, but this will do + for an example. */ +static int pal_menu(void) { + maple_device_t *cont1; + cont_state_t *state; + + /* Re-init to a 50Hz mode to display the menu. */ + vid_set_mode(DM_640x480_PAL_IL, PM_RGB565); + + /* Draw the "menu" on the screen. */ + bfont_draw_str(vram_s + 640 * 200 + 64, 640, 1, "Press A to run at 60Hz"); + bfont_draw_str(vram_s + 640 * 240 + 64, 640, 1, "or B to run at 50Hz"); + + /* Wait for the user to press either A or B to pick which mode to use.*/ + for(;;) { + if((cont1 = maple_enum_type(0, MAPLE_FUNC_CONTROLLER))) { + if((state = (cont_state_t *)maple_dev_status(cont1))) { + if(state->buttons & CONT_A) + return USE_60HZ; + else if(state->buttons & CONT_B) + return USE_50HZ; + } + } + + /* Sleep for a bit. */ + thd_sleep(20); + } +} + +static void wait_for_start(void) { + maple_device_t *cont1; + cont_state_t *state; + + for(;;) { + if((cont1 = maple_enum_type(0, MAPLE_FUNC_CONTROLLER))) { + if((state = (cont_state_t *)maple_dev_status(cont1))) { + if(state->buttons & CONT_START) + return; + } + } + + /* Sleep for a bit. */ + thd_sleep(20); + } +} + +int main(int argc, char *argv[]) { + int region, cable, mode; + int x, y, c; + + /* KOS normally initializes the video hardware to run at 60Hz, so on NTSC + consoles, or those with VGA connections, we don't have to do anything + else here... */ + region = flashrom_get_region(); + cable = vid_check_cable(); + + /* So, if we detect a European console that isn't using VGA, prompt the user + whether they want 50Hz mode or 60Hz mode. */ + if(region == FLASHROM_REGION_EUROPE && cable != CT_VGA) { + mode = pal_menu(); + + if(mode == USE_60HZ) + vid_set_mode(DM_640x480_NTSC_IL, PM_RGB565); + else /* if(mode == USE_50HZ) */ + vid_set_mode(DM_640x480_PAL_IL, PM_RGB565); + } + + /* Draw a pattern on the screen, like the libdream/640x480 example. */ + for(y = 0; y < 480; y++) { + for(x = 0; x < 640; x++) { + c = (x ^ y) & 255; + vram_s[y * 640 + x] = ((c >> 3) << 12) | ((c >> 2) << 5) | + ((c >> 3) << 0); + } + } + + /* Wait for the user to press start. */ + wait_for_start(); + + return 0; +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-03-06 02:43:29
|
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 b45d6c1abb03d49284a2ab583c79162f6dfef97f (commit) from 23c737b7732551a4c00587a2ba3398e776471fc6 (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 b45d6c1abb03d49284a2ab583c79162f6dfef97f Author: Lawrence Sebald <ljs...@us...> Date: Thu Mar 5 21:43:05 2015 -0500 Update the AUTHORS and license files. ----------------------------------------------------------------------- Summary of changes: AUTHORS | 5 +++-- doc/README.KOS | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 01d6036..36ccd30 100644 --- a/AUTHORS +++ b/AUTHORS @@ -22,12 +22,13 @@ please see the README.KOS file in the doc directory. Contributors list (under the normal KOS license): ------------------------------------------------- Dan Potter: 1997, 2000, 2001, 2002, 2003, 2004 -Lawrence Sebald: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 +Lawrence Sebald: 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, + 2015 Sam Steele: 2004 Gil Megidish: 2002 Florian Schulze: 2002 Walter van Niftrik: 2005 -Donald Haase: 2008 +Donald Haase: 2008, 2014 Andrew Kieschnick: 2000, 2001, 2002, 2003 Jordan DeLong: 2000, 2001, 2002 Bero: 2002 diff --git a/doc/README.KOS b/doc/README.KOS index 257c0d1..268e9f4 100644 --- a/doc/README.KOS +++ b/doc/README.KOS @@ -10,7 +10,7 @@ the header: * it under the terms of the KOS License. * * This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANY; without even the implied warranty of +* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * KOS License (README.KOS) for more details. * @@ -27,11 +27,23 @@ documentation is ok) and there is no warranty. Dan Potter + +Giving credit means giving credit to everyone involved. The AUTHORS file in +the root directory of the KOS source tree is there to help. It should note all +of the named contributors (those who have provided copyright notices in any +files) to the KOS codebase, along with the years of their contributions. It's +there to make it pretty easy to give credit where credit is due. :) + + Lawrence Sebald + +The actual license terms begin below this line: +-------------------------------------------------------------------------------- + All of the documentation and software included in the KallistiOS Releases -is copyrighted (C) 2000-2014 by Dan Potter, Lawrence Sebald, and others (as +is copyrighted (C) 1997-2015 by Dan Potter, Lawrence Sebald, and others (as noted in each file). -Copyright (C) 1997-2014 KallistiOS Contributors. All rights reserved. +Copyright (C) 1997-2015 KallistiOS Contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-03-06 02:26: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 23c737b7732551a4c00587a2ba3398e776471fc6 (commit) from cbb8b3e7098787fce72c667cf2096fbb821c76f3 (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 23c737b7732551a4c00587a2ba3398e776471fc6 Author: Lawrence Sebald <ljs...@us...> Date: Thu Mar 5 21:26:19 2015 -0500 Update the CHANGELOG. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 6ac3262..fb7bf69 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -45,6 +45,9 @@ KallistiOS version 2.0.1 ----------------------------------------------- - *** 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 @@ -52,7 +55,17 @@ KallistiOS version 2.0.1 ----------------------------------------------- - 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 serveral 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] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-03-05 22:55:51
|
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 cbb8b3e7098787fce72c667cf2096fbb821c76f3 (commit) from 37efbd3d3ae01027d580fc4cded94ccb2132bb0c (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 cbb8b3e7098787fce72c667cf2096fbb821c76f3 Author: Lawrence Sebald <ljs...@us...> Date: Thu Mar 5 17:54:28 2015 -0500 Add a new mutex function to unlock a mutex on behalf of a thread. This function is only usable inside an IRQ handler, and was added in response to a bug report from SWAT in the g1ata code. ----------------------------------------------------------------------- Summary of changes: include/kos/mutex.h | 19 ++++++++++++- kernel/arch/dreamcast/hardware/g1ata.c | 13 ++++++++- kernel/thread/mutex.c | 45 +++++++++++++++++++++++++------ 3 files changed, 64 insertions(+), 13 deletions(-) diff --git a/include/kos/mutex.h b/include/kos/mutex.h index 3bc1a8e..1aba923 100644 --- a/include/kos/mutex.h +++ b/include/kos/mutex.h @@ -2,7 +2,7 @@ include/kos/mutex.h Copyright (C) 2001, 2003 Dan Potter - Copyright (C) 2012 Lawrence Sebald + Copyright (C) 2012, 2015 Lawrence Sebald */ @@ -237,7 +237,22 @@ int mutex_trylock(mutex_t *m); */ int mutex_unlock(mutex_t *m); +/** \brief Unlock a mutex under another thread's authority. + + This function allows an IRQ handler to unlock a mutex that was locked by a + normal kernel thread. This function is only for use in IRQ handlers, so it + will generally not be of much use outside of the kernel itself. + + \param m The mutex to unlock + \retval 0 On success + \retval -1 On error, errno will be set as appropriate. + + \par Error Conditions: + \em EPERM - the specified thread does not own the mutex \n + \em EACCES - called outside an IRQ handler +*/ +int mutex_unlock_as_thread(mutex_t *m, kthread_t *thd); + __END_DECLS #endif /* __KOS_MUTEX_H */ - diff --git a/kernel/arch/dreamcast/hardware/g1ata.c b/kernel/arch/dreamcast/hardware/g1ata.c index 5874bab..331bcbe 100644 --- a/kernel/arch/dreamcast/hardware/g1ata.c +++ b/kernel/arch/dreamcast/hardware/g1ata.c @@ -1,7 +1,7 @@ /* KallistiOS ##version## hardware/g1ata.c - Copyright (C) 2013, 2014 Lawrence Sebald + Copyright (C) 2013, 2014, 2015 Lawrence Sebald */ #include <errno.h> @@ -14,9 +14,11 @@ #include <kos/dbglog.h> #include <kos/sem.h> #include <kos/mutex.h> +#include <kos/thread.h> #include <arch/timer.h> #include <arch/cache.h> +#include <arch/irq.h> /* This file implements support for accessing devices over the G1 bus by the @@ -160,6 +162,7 @@ static uint8_t orig_dev = 0x00; static int dma_in_progress = 0; static int dma_blocking = 0; static semaphore_t dma_done = SEM_INITIALIZER(0); +static kthread_t *dma_thd = NULL; /* From cdrom.c */ extern mutex_t _g1_ata_mutex; @@ -210,7 +213,7 @@ static void g1_dma_irq_hnd(uint32 code) { } dma_in_progress = 0; - g1_ata_mutex_unlock(); + mutex_unlock_as_thread(&_g1_ata_mutex, dma_thd); } } @@ -265,6 +268,12 @@ static int dma_common(uint8_t cmd, size_t nsects, uint32_t addr, int dir, int block) { uint8_t status; + /* Set the thread ID that initiated this DMA. */ + dma_thd = thd_current; + + if(irq_inside_int()) + dma_thd = (kthread_t *)0xFFFFFFFF; + /* Set the DMA parameters up. */ OUT32(G1_ATA_DMA_ADDRESS, addr); OUT32(G1_ATA_DMA_LENGTH, nsects * 512); diff --git a/kernel/thread/mutex.c b/kernel/thread/mutex.c index 15489ce..5d4c4db 100644 --- a/kernel/thread/mutex.c +++ b/kernel/thread/mutex.c @@ -1,7 +1,7 @@ /* KallistiOS ##version## mutex.c - Copyright (C) 2012 Lawrence Sebald + Copyright (C) 2012, 2015 Lawrence Sebald */ @@ -86,7 +86,8 @@ int mutex_lock_timed(mutex_t *m, int timeout) { int old, rv = 0; if(irq_inside_int()) { - dbglog(DBG_WARNING, "mutex_lock_timed: called inside interrupt\n"); + dbglog(DBG_WARNING, "%s: called inside interrupt\n", + timeout ? "mutex_lock_timed" : "mutex_lock"); errno = EPERM; return -1; } @@ -141,20 +142,26 @@ 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(); + /* If we're inside of an interrupt, pick a special value for the thread that + would otherwise be impossible... */ + if(irq_inside_int()) + thd = (kthread_t *)0xFFFFFFFF; + if(m->type < MUTEX_TYPE_NORMAL || m->type > MUTEX_TYPE_RECURSIVE) { errno = EINVAL; rv = -1; } /* Check if the lock is held by some other thread already */ - else if(m->holder && m->holder != thd_current) { + else if(m->count && m->holder != thd) { errno = EAGAIN; rv = -1; } else { - m->holder = thd_current; + m->holder = thd; switch(m->type) { case MUTEX_TYPE_NORMAL: @@ -184,7 +191,7 @@ int mutex_trylock(mutex_t *m) { return rv; } -int mutex_unlock(mutex_t *m) { +static int mutex_unlock_common(mutex_t *m, kthread_t *thd) { int old, rv = 0, wakeup = 0; old = irq_disable(); @@ -197,7 +204,7 @@ int mutex_unlock(mutex_t *m) { break; case MUTEX_TYPE_ERRORCHECK: - if(m->holder != thd_current) { + if(m->holder != thd) { errno = EPERM; rv = -1; } @@ -209,7 +216,7 @@ int mutex_unlock(mutex_t *m) { break; case MUTEX_TYPE_RECURSIVE: - if(m->holder != thd_current) { + if(m->holder != thd) { errno = EPERM; rv = -1; } @@ -225,10 +232,30 @@ int mutex_unlock(mutex_t *m) { } /* If we need to wake up a thread, do so. */ - if(wakeup) { + if(wakeup) genwait_wake_one(m); - } irq_restore(old); return rv; } + +int mutex_unlock(mutex_t *m) { + kthread_t *thd = thd_current; + + /* If we're inside of an interrupt, use the special value for the thread + from mutex_trylock(). */ + if(irq_inside_int()) + thd = (kthread_t *)0xFFFFFFFF; + + return mutex_unlock_common(m, thd); +} + +int mutex_unlock_as_thread(mutex_t *m, kthread_t *thd) { + /* Make sure we're in an IRQ handler */ + if(!irq_inside_int()) { + errno = EACCES; + return -1; + } + + return mutex_unlock_common(m, thd); +} hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2015-02-08 21:23: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 37efbd3d3ae01027d580fc4cded94ccb2132bb0c (commit) from 0fbcec655e5aaa5a9823f34c1f8f9abb6fe023ec (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 37efbd3d3ae01027d580fc4cded94ccb2132bb0c Author: Lawrence Sebald <ljs...@us...> Date: Sun Feb 8 16:22:53 2015 -0500 Get our IP address from dcload-ip when it matters. ----------------------------------------------------------------------- Summary of changes: include/kos/net.h | 8 +++++++- kernel/arch/dreamcast/fs/fs_dclsocket.c | 8 +++++++- kernel/arch/dreamcast/kernel/init.c | 18 +++++++++++++++--- kernel/net/net_core.c | 13 ++++++++++--- 4 files changed, 39 insertions(+), 8 deletions(-) diff --git a/include/kos/net.h b/include/kos/net.h index cfb7428..bb42f1f 100644 --- a/include/kos/net.h +++ b/include/kos/net.h @@ -745,9 +745,15 @@ int net_reg_device(netif_t *device); int net_unreg_device(netif_t *device); /** \brief Init network support. + \param ip The IPv4 address to set on the default device, in + host byte order. + \return 0 on success, <0 on failure. + \note To auto-detect the IP address to assign to the + default device (i.e, over DHCP or from the flashrom + on the Dreamcast), pass 0 as the IP parameter. */ -int net_init(void); +int net_init(uint32 ip); /** \brief Shutdown network support. */ void net_shutdown(void); diff --git a/kernel/arch/dreamcast/fs/fs_dclsocket.c b/kernel/arch/dreamcast/fs/fs_dclsocket.c index 70d9bb1..d4c94f5 100644 --- a/kernel/arch/dreamcast/fs/fs_dclsocket.c +++ b/kernel/arch/dreamcast/fs/fs_dclsocket.c @@ -1,7 +1,7 @@ /* KallistiOS ##version## kernel/arch/dreamcast/fs/fs_dclsocket.c - Copyright (C) 2007, 2008, 2012, 2013 Lawrence Sebald + Copyright (C) 2007, 2008, 2012, 2013, 2015 Lawrence Sebald Based on fs_dclnative.c and related files Copyright (C) 2003 Dan Potter @@ -760,6 +760,12 @@ void fs_dclsocket_init_console() { initted = 1; } +uint32 _fs_dclsocket_get_ip(void) { + uint32 ip, port; + + return dcloadsyscall(DCLOAD_GETHOSTINFO, &ip, &port); +} + int fs_dclsocket_init() { struct sockaddr_in addr; int err; diff --git a/kernel/arch/dreamcast/kernel/init.c b/kernel/arch/dreamcast/kernel/init.c index 9f0c5d8..85369cf 100644 --- a/kernel/arch/dreamcast/kernel/init.c +++ b/kernel/arch/dreamcast/kernel/init.c @@ -1,7 +1,8 @@ /* KallistiOS ##version## init.c - Copyright (C)2003 Dan Potter + Copyright (C) 2003 Dan Potter + Copyright (C) 2015 Lawrence Sebald */ #include <stdio.h> @@ -29,8 +30,8 @@ void fini(void); void __verify_newlib_patch(); #endif -/* Ditto */ int main(int argc, char **argv); +uint32 _fs_dclsocket_get_ip(void); /* We have to put this here so we can include plat-specific devices */ dbgio_handler_t * dbgio_handlers[] = { @@ -46,6 +47,11 @@ int dbgio_handler_cnt = sizeof(dbgio_handlers) / sizeof(dbgio_handler_t *); to be running in your build, and also below in arch_main() */ /* #if 0 */ int __attribute__((weak)) arch_auto_init() { + union { + uint32 ipl; + uint8 ipb[4]; + } ip; + /* Initialize memory management */ mm_init(); @@ -117,13 +123,19 @@ int __attribute__((weak)) arch_auto_init() { } if(__kos_init_flags & INIT_NET) { + ip.ipl = 0; + /* Check if the dcload-ip console is up, and if so, disable it, otherwise we'll crash when we attempt to bring up the BBA */ if(!(__kos_init_flags & INIT_NO_DCLOAD) && dcload_type == DCLOAD_TYPE_IP) { + /* Grab the IP address from dcload before we disable dbgio... */ + ip.ipl = _fs_dclsocket_get_ip(); + dbglog(DBG_INFO, "dc-load says our IP is %d.%d.%d.%d\n", ip.ipb[3], + ip.ipb[2], ip.ipb[1], ip.ipb[0]); dbgio_disable(); } - net_init(); /* Enable networking (and drivers) */ + net_init(ip.ipl); /* Enable networking (and drivers) */ if(!(__kos_init_flags & INIT_NO_DCLOAD) && dcload_type == DCLOAD_TYPE_IP) { fs_dclsocket_init_console(); diff --git a/kernel/net/net_core.c b/kernel/net/net_core.c index 73c8575..c453b92 100644 --- a/kernel/net/net_core.c +++ b/kernel/net/net_core.c @@ -140,7 +140,7 @@ int net_dev_init(void) { } /* Init */ -int net_init(void) { +int net_init(uint32 ip) { int rv = 0; /* Make sure we haven't already done this */ @@ -179,8 +179,15 @@ int net_init(void) { /* Initialize the DHCP system */ net_dhcp_init(); - if(net_default_dev && !net_default_dev->ip_addr[0]) { - rv = net_dhcp_request(); + if(net_default_dev) { + /* Did we get a requested IP address? If so, set it. */ + if(ip) + net_ipv4_parse_address(ip, net_default_dev->ip_addr); + + /* We didn't get a requested IP address, if we don't already have one + set, then do so via DHCP. */ + else if(!net_default_dev->ip_addr[0]) + rv = net_dhcp_request(); } net_initted = 1; hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: PH3NOM <ph...@us...> - 2015-01-04 22:14:28
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The collection of ports that can be used in KallistiOS programs.". The branch, master has been updated via cadaed06f2c4d5125d7641ac809e602592f61148 (commit) from fd78ac5f956321de5273d445bfe72cab6f5ae12a (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 cadaed06f2c4d5125d7641ac809e602592f61148 Author: Josh Pearson <ph...@us...> Date: Sun Jan 4 15:09:19 2015 -0800 libgl updated 1-4-15 ----------------------------------------------------------------------- Summary of changes: libgl | 2 +- libgl.rar | Bin 0 -> 45759 bytes 2 files changed, 1 insertions(+), 1 deletions(-) create mode 100755 libgl.rar diff --git a/libgl b/libgl index 4af2c8a..763ec99 160000 --- a/libgl +++ b/libgl @@ -1 +1 @@ -Subproject commit 4af2c8aacc9d59b3314767f16acddf9cb25ee73a +Subproject commit 763ec9948364538cacef45526e1e1ce785c11f18 diff --git a/libgl.rar b/libgl.rar new file mode 100755 index 0000000..cab7666 Binary files /dev/null and b/libgl.rar differ hooks/post-receive -- The collection of ports that can be used in KallistiOS programs. |
From: PH3NOM <ph...@us...> - 2015-01-04 22:13: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 "The KallistiOS port of OpenGL.". The branch, master has been updated via 763ec9948364538cacef45526e1e1ce785c11f18 (commit) from 4af2c8aacc9d59b3314767f16acddf9cb25ee73a (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 763ec9948364538cacef45526e1e1ce785c11f18 Author: Josh Pearson <ph...@us...> Date: Sun Jan 4 15:07:57 2015 -0800 Added multi-texture support and glCompressedTexImage2D to the GL API ----------------------------------------------------------------------- Summary of changes: Makefile | 4 +- gl-api.c | 91 +++++-- gl-api.h | 54 ++++- gl-arrays.c | 732 ++++++++++++++++++++++++++++++++++-------------------- gl-arrays.h | 35 +--- gl-cap.c | 4 +- gl-clip-arrays.c | 418 +++++++++++++++++++++++++++++++ gl-clip.c | 621 +++++++--------------------------------------- gl-clip.h | 10 +- gl-light.c | 8 +- gl-matrix.c | 3 +- gl-pvr.c | 121 +++++++--- gl-pvr.h | 10 +- gl-texture.c | 146 ++++++++--- include/gl.h | 75 ++++-- include/glext.h | 78 ++++++- include/glu.h | 2 +- include/glut.h | 4 +- 18 files changed, 1428 insertions(+), 988 deletions(-) create mode 100755 gl-clip-arrays.c diff --git a/Makefile b/Makefile index 246c828..53b3f5d 100755 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ # Copyright (C) 2014 Lawrence Sebald TARGET = libgl.a -OBJS = gl-rgb.o gl-fog.o gl-sh4-light.o gl-light.o gl-clip.o gl-pvr.o -OBJS += gl-arrays.o gl-matrix.o gl-api.o gl-texture.o glu-texture.o +OBJS = gl-rgb.o gl-fog.o gl-sh4-light.o gl-light.o gl-clip.o gl-clip-arrays.o +OBJS += gl-arrays.o gl-pvr.o gl-matrix.o gl-api.o gl-texture.o glu-texture.o OBJS += gl-framebuffer.o gl-cap.o gl-error.o SUBDIRS = diff --git a/gl-api.c b/gl-api.c index 31ddbd7..b9fae8c 100755 --- a/gl-api.c +++ b/gl-api.c @@ -290,25 +290,25 @@ void APIENTRY glVertex2fv(const GLfloat *xy) { } void APIENTRY glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) { - pvr_vertex_t * v = _glKosVertexBufPointer(); - + pvr_vertex_t *v = _glKosVertexBufPointer(); + v[0].z = v[3].z = 0; - + mat_trans_single3_nomod(x1, y1, v[0].z, v[0].x, v[0].y, v[0].z); mat_trans_single3_nomod(x2, y2, v[3].z, v[3].x, v[3].y, v[3].z); - - _glKosFinishRect(); + + _glKosFinishRect(); } void APIENTRY glRectfv(const GLfloat *v1, const GLfloat *v2) { - pvr_vertex_t * v = _glKosVertexBufPointer(); - + pvr_vertex_t *v = _glKosVertexBufPointer(); + v[0].z = v[3].z = 0; - + mat_trans_single3_nomod(v1[0], v1[1], v[0].z, v[0].x, v[0].y, v[0].z); mat_trans_single3_nomod(v2[0], v2[1], v[3].z, v[3].x, v[3].y, v[3].z); - - _glKosFinishRect(); + + _glKosFinishRect(); } void APIENTRY glRecti(GLint x1, GLint y1, GLint x2, GLint y2) { @@ -582,46 +582,46 @@ void _glKosVertex3fcv(const GLfloat *xyz) { /* GL_POINTS */ GLvoid _glKosVertex3fp(GLfloat x, GLfloat y, GLfloat z) { - pvr_vertex_t * v = _glKosVertexBufPointer(); + pvr_vertex_t *v = _glKosVertexBufPointer(); mat_trans_single3_nomod(x - GL_KOS_POINT_SIZE, y + GL_KOS_POINT_SIZE, z, v[0].x, v[0].y, v[0].z); mat_trans_single3_nomod(x + GL_KOS_POINT_SIZE, y - GL_KOS_POINT_SIZE, z, v[3].x, v[3].y, v[3].z); - - _glKosFinishRect(); + + _glKosFinishRect(); } GLvoid _glKosVertex3fpv(const GLfloat *xyz) { - pvr_vertex_t * v = _glKosVertexBufPointer(); + pvr_vertex_t *v = _glKosVertexBufPointer(); mat_trans_single3_nomod(xyz[0] - GL_KOS_POINT_SIZE, xyz[1] + GL_KOS_POINT_SIZE, xyz[2], v[0].x, v[0].y, v[0].z); mat_trans_single3_nomod(xyz[0] + GL_KOS_POINT_SIZE, xyz[1] - GL_KOS_POINT_SIZE, xyz[2], v[3].x, v[3].y, v[3].z); - - _glKosFinishRect(); + + _glKosFinishRect(); } static inline void _glKosFinishRect() { - pvr_vertex_t * v = _glKosVertexBufPointer(); - + pvr_vertex_t *v = _glKosVertexBufPointer(); + v[0].argb = v[1].argb = v[2].argb = v[3].argb = GL_KOS_VERTEX_COLOR; - + v[0].flags = v[1].flags = v[2].flags = PVR_CMD_VERTEX; v[3].flags = PVR_CMD_VERTEX_EOL; v[1].x = v[0].x; v[1].y = v[3].y; v[1].z = v[3].z; - + v[2].x = v[3].x; v[2].y = v[0].y; - v[2].z = v[0].z; - - _glKosVertexBufAdd( 4 ); - - GL_KOS_VERTEX_COUNT += 4; + v[2].z = v[0].z; + + _glKosVertexBufAdd(4); + + GL_KOS_VERTEX_COUNT += 4; } void _glKosTransformClipBuf(pvr_vertex_t *v, GLuint verts) { @@ -732,6 +732,12 @@ static inline void _glKosApplyBlendFunc() { } } +static inline void _glKosApplyTextureFunc(GL_TEXTURE_OBJECT *tex) { + GL_KOS_POLY_CXT.txr.uv_clamp = tex->uv_clamp; + GL_KOS_POLY_CXT.txr.mipmap = tex->mip_map ? 1 : 0; + GL_KOS_POLY_CXT.txr.mipmap_bias = PVR_MIPBIAS_NORMAL; +} + void _glKosCompileHdr() { pvr_poly_hdr_t *hdr = _glKosVertexBufPointer(); @@ -777,9 +783,7 @@ void _glKosCompileHdrT(GL_TEXTURE_OBJECT *tex) { _glKosApplyBlendFunc(); - GL_KOS_POLY_CXT.txr.uv_clamp = tex->uv_clamp; - GL_KOS_POLY_CXT.txr.mipmap = tex->mip_map ? 1 : 0; - GL_KOS_POLY_CXT.txr.mipmap_bias = PVR_MIPBIAS_NORMAL; + _glKosApplyTextureFunc(tex); if(_glKosEnabledBlend()) GL_KOS_POLY_CXT.txr.env = tex->env; @@ -792,6 +796,37 @@ void _glKosCompileHdrT(GL_TEXTURE_OBJECT *tex) { _glKosVertexBufIncrement(); } +void _glKosCompileHdrMT(pvr_poly_hdr_t *dst, GL_TEXTURE_OBJECT *tex) { + pvr_poly_cxt_txr(&GL_KOS_POLY_CXT, + PVR_LIST_TR_POLY, + tex->color, + tex->width, + tex->height, + tex->data, + tex->filter); + + GL_KOS_POLY_CXT.gen.shading = GL_KOS_SHADE_FUNC; + + _glKosApplyDepthFunc(); + + _glKosApplyScissorFunc(); + + _glKosApplyFogFunc(); + + _glKosApplyCullingFunc(); + + _glKosApplyTextureFunc(tex); + + GL_KOS_POLY_CXT.blend.src = (GL_KOS_BLEND_FUNC & 0xF0) >> 4; + GL_KOS_POLY_CXT.blend.dst = (GL_KOS_BLEND_FUNC & 0x0F); + GL_KOS_POLY_CXT.txr.env = tex->env; + + pvr_poly_compile(dst, &GL_KOS_POLY_CXT); + + if(GL_KOS_SUPERSAMPLE) + dst->mode2 |= GL_PVR_SAMPLE_SUPER << PVR_TA_SUPER_SAMPLE_SHIFT; +} + //====================================================================================================// //== Internal GL KOS API State Functions ==// diff --git a/gl-api.h b/gl-api.h index b505649..9f3082f 100755 --- a/gl-api.h +++ b/gl-api.h @@ -10,12 +10,18 @@ #ifndef GL_API_H #define GL_API_H +#include "gl.h" + typedef struct { - float pos[3]; - float norm[3]; + GLfloat pos[3]; + GLfloat norm[3]; } glVertex; /* Simple Vertex used for Dynamic Vertex Lighting */ typedef struct { + GLfloat u, v; +} glTexCoord; /* Simple Texture Coordinate used for Multi-Texturing */ + +typedef struct { GLushort width; GLushort height; GLuint color; @@ -35,8 +41,14 @@ typedef struct { GLvoid *link; } GL_FRAMEBUFFER_OBJECT; /* KOS Open GL Frame Buffer Object */ -typedef unsigned short uint16; -typedef unsigned char uint8; +typedef struct { + pvr_poly_hdr_t hdr; + pvr_vertex_t *src; + GLuint count; +} GL_MULTITEX_OBJECT; + +typedef GLushort uint16; +typedef GLubyte uint8; /* Vertex Main Buffer Internal Functions */ inline void _glKosVertexBufSwitchOP(); @@ -54,6 +66,11 @@ inline unsigned int _glKosVertexBufCount(unsigned char list); unsigned char _glKosList(); inline void _glKosVertexBufCopy(void *src, void *dst, GLuint count); inline void _glKosResetEnabledTex(); +inline void *_glKosMultiUVBufAddress(); +inline void *_glKosMultiUVBufPointer(); +inline void _glKosMultiUVBufIncrement(); +inline void _glKosMultiUVBufAdd(GLuint count); +inline void _glKosMultiUVBufReset(); /* Vertex Clip Buffer Internal Functions */ inline void *_glKosClipBufAddress(); @@ -69,13 +86,14 @@ inline glVertex *_glKosArrayBufPtr(); /* Initialize the OpenGL PVR Pipeline */ int _glKosInitPVR(); -GLubyte _glKosInitTextures(); +unsigned char _glKosInitTextures(); /* Compile the current Polygon Header for the PVR */ void _glKosCompileHdr(); void _glKosCompileHdrTx(); -void _glKosCompileHdrTx2(); +void _glKosCompileHdrMTx(); void _glKosCompileHdrT(GL_TEXTURE_OBJECT *tex); +void _glKosCompileHdrMT(pvr_poly_hdr_t *dst, GL_TEXTURE_OBJECT *tex); /* Clipping Internal Functions */ void _glKosTransformClipBuf(pvr_vertex_t *v, GLuint verts); @@ -84,10 +102,17 @@ unsigned int _glKosClipTriangles(pvr_vertex_t *vin, pvr_vertex_t *vout, unsigned unsigned int _glKosClipQuads(pvr_vertex_t *vin, pvr_vertex_t *vout, unsigned int vertices); unsigned int _glKosClipTrianglesTransformed(pvr_vertex_t *src, float *w, pvr_vertex_t *dst, GLuint count); -unsigned char _glKosClipTriTransformed(pvr_vertex_t *vin, float *w, pvr_vertex_t *vout); unsigned int _glKosClipQuadsTransformed(pvr_vertex_t *vin, float *w, pvr_vertex_t *vout, unsigned int vertices); unsigned int _glKosClipTriangleStripTransformed(pvr_vertex_t *src, float *w, pvr_vertex_t *dst, GLuint count); +unsigned int _glKosClipTrianglesTransformedMT(pvr_vertex_t *src, float *w, pvr_vertex_t *dst, + GLfloat *uvsrc, glTexCoord *uvdst, GLuint uv_src_stride, GLuint count); +unsigned int _glKosClipTriangleStripTransformedMT(pvr_vertex_t *src, float *w, pvr_vertex_t *dst, + GLfloat *uvsrc, glTexCoord *uvdst, GLuint uv_src_stride, GLuint count); +unsigned int _glKosClipQuadsTransformedMT(pvr_vertex_t *src, float *w, pvr_vertex_t *dst, + GLfloat *uvsrc, glTexCoord *uvdst, GLuint uv_src_stride, GLuint count); + + /* Lighting Internal Functions */ void _glKosInitLighting(); void _glKosEnableLight(const GLuint light); @@ -176,5 +201,20 @@ GLubyte _glKosIsLightEnabled(GLubyte light); GLubyte _glKosGetMaxLights(); GLuint _glKosBoundTexID(); GLuint _glKosVertexColor(); +GLubyte _glKosMaxTextureUnits(); + +GL_TEXTURE_OBJECT *_glKosBoundMultiTexID(); + +inline void _glKosPushMultiTexObject(GL_TEXTURE_OBJECT *tex, + pvr_vertex_t *src, + GLuint count); + +static inline void _glKosVertexCopyPVR(const pvr_vertex_t *src, pvr_vertex_t *dst) { + *dst = *src; +} + +static inline void _glKosTexCoordCopy(const glTexCoord *src, glTexCoord *dst) { + *dst = *src; +} #endif diff --git a/gl-arrays.c b/gl-arrays.c index 248fbde..efdc366 100755 --- a/gl-arrays.c +++ b/gl-arrays.c @@ -19,21 +19,44 @@ #include <stdlib.h> #include "gl.h" +#include "glext.h" #include "gl-api.h" #include "gl-arrays.h" +#include "gl-pvr.h" #include "gl-rgb.h" #include "gl-sh4.h" //========================================================================================// //== Local Variables ==// -#define GL_MAX_ARRAY_VERTICES 1024*32 /* Maximum Number of Vertices in the Array Buffer */ -static glVertex GL_ARRAY_BUF[GL_MAX_ARRAY_VERTICES]; -static GLfloat GL_ARRAY_BUFW[GL_MAX_ARRAY_VERTICES]; -static GLfloat GL_ARRAY_DSTW[GL_MAX_ARRAY_VERTICES]; -static glVertex *GL_ARRAY_BUF_PTR; -static GLuint GL_VERTEX_PTR_MODE = 0; +static glVertex GL_KOS_ARRAY_BUF[GL_KOS_MAX_VERTS]; +static glVertex *GL_KOS_ARRAY_BUF_PTR; + +static GLfloat GL_KOS_ARRAY_BUFW[GL_KOS_MAX_VERTS]; +static GLfloat GL_KOS_ARRAY_DSTW[GL_KOS_MAX_VERTS]; + +static GLfloat GL_KOS_ARRAY_BUFUV[GL_KOS_MAX_VERTS]; + +static GLubyte GL_KOS_CLIENT_ACTIVE_TEXTURE = GL_TEXTURE0_ARB & 0xF; + +static GLfloat *GL_KOS_VERTEX_POINTER = NULL; +static GLfloat *GL_KOS_NORMAL_POINTER = NULL; +static GLfloat *GL_KOS_TEXCOORD0_POINTER = NULL; +static GLfloat *GL_KOS_TEXCOORD1_POINTER = NULL; +static GLfloat *GL_KOS_COLOR_POINTER = NULL; +static GLubyte *GL_KOS_INDEX_POINTER_U8 = NULL; +static GLushort *GL_KOS_INDEX_POINTER_U16 = NULL; + +static GLushort GL_KOS_VERTEX_STRIDE = 0; +static GLushort GL_KOS_NORMAL_STRIDE = 0; +static GLushort GL_KOS_TEXCOORD0_STRIDE = 0; +static GLushort GL_KOS_TEXCOORD1_STRIDE = 0; +static GLushort GL_KOS_COLOR_STRIDE = 0; + +static GLuint GL_KOS_VERTEX_PTR_MODE = 0; static GLubyte GL_KOS_VERTEX_SIZE = 0; +static GLubyte GL_KOS_COLOR_COMPONENTS = 0; +static GLenum GL_KOS_COLOR_TYPE = 0; //========================================================================================// //== Local Function Definitions ==// @@ -41,6 +64,12 @@ static GLubyte GL_KOS_VERTEX_SIZE = 0; static inline void _glKosArraysTransformNormals(GLfloat *normal, GLuint count); static inline void _glKosArraysTransformPositions(GLfloat *position, GLuint count); +void (*_glKosArrayTexCoordFunc)(pvr_vertex_t *); +void (*_glKosArrayColorFunc)(pvr_vertex_t *); + +void (*_glKosElementTexCoordFunc)(pvr_vertex_t *, GLuint); +void (*_glKosElementColorFunc)(pvr_vertex_t *, GLuint); + //========================================================================================// //== Open GL API Public Functions ==// @@ -61,14 +90,14 @@ GLAPI void APIENTRY glVertexPointer(GLint size, GLenum type, _glKosPrintError(); return; } - + GL_KOS_VERTEX_SIZE = size; - - (stride) ? (GL_VERTEX_STRIDE = stride / 4) : (GL_VERTEX_STRIDE = 3); - - GL_VERTEX_POINTER = (float *)pointer; - GL_VERTEX_PTR_MODE |= GL_USE_ARRAY; + (stride) ? (GL_KOS_VERTEX_STRIDE = stride / 4) : (GL_KOS_VERTEX_STRIDE = 3); + + GL_KOS_VERTEX_POINTER = (float *)pointer; + + GL_KOS_VERTEX_PTR_MODE |= GL_KOS_USE_ARRAY; } /* Submit a Vertex Normal Pointer */ @@ -84,11 +113,11 @@ GLAPI void APIENTRY glNormalPointer(GLenum type, GLsizei stride, const GLvoid *p return; } - (stride) ? (GL_NORMAL_STRIDE = stride / 4) : (GL_NORMAL_STRIDE = 3); + (stride) ? (GL_KOS_NORMAL_STRIDE = stride / 4) : (GL_KOS_NORMAL_STRIDE = 3); - GL_NORMAL_POINTER = (float *)pointer; + GL_KOS_NORMAL_POINTER = (float *)pointer; - GL_VERTEX_PTR_MODE |= GL_USE_NORMAL; + GL_KOS_VERTEX_PTR_MODE |= GL_KOS_USE_NORMAL; } /* Submit a Texture Coordinate Pointer */ @@ -108,35 +137,44 @@ GLAPI void APIENTRY glTexCoordPointer(GLint size, GLenum type, return; } - (stride) ? (GL_TEXCOORD_STRIDE = stride / 4) : (GL_TEXCOORD_STRIDE = 2); + if(GL_KOS_CLIENT_ACTIVE_TEXTURE) { + (stride) ? (GL_KOS_TEXCOORD1_STRIDE = stride / 4) : (GL_KOS_TEXCOORD1_STRIDE = 2); + + GL_KOS_TEXCOORD1_POINTER = (float *)pointer; + + GL_KOS_VERTEX_PTR_MODE |= GL_KOS_USE_TEXTURE1; + } + else { + (stride) ? (GL_KOS_TEXCOORD0_STRIDE = stride / 4) : (GL_KOS_TEXCOORD0_STRIDE = 2); - GL_TEXCOORD_POINTER = (float *)pointer; + GL_KOS_TEXCOORD0_POINTER = (float *)pointer; - GL_VERTEX_PTR_MODE |= GL_USE_TEXTURE; + GL_KOS_VERTEX_PTR_MODE |= GL_KOS_USE_TEXTURE0; + } } /* Submit a Color Pointer */ GLAPI void APIENTRY glColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer) { if((type == GL_UNSIGNED_INT) && (size == 1)) { - GL_COLOR_COMPONENTS = 1; - GL_COLOR_POINTER = (GLvoid *)pointer; - GL_COLOR_TYPE = type; + GL_KOS_COLOR_COMPONENTS = 1; + GL_KOS_COLOR_POINTER = (GLvoid *)pointer; + GL_KOS_COLOR_TYPE = type; } else if((type == GL_UNSIGNED_BYTE) && (size == 4)) { - GL_COLOR_COMPONENTS = 4; - GL_COLOR_POINTER = (GLvoid *)pointer; - GL_COLOR_TYPE = type; + GL_KOS_COLOR_COMPONENTS = 4; + GL_KOS_COLOR_POINTER = (GLvoid *)pointer; + GL_KOS_COLOR_TYPE = type; } else if((type == GL_FLOAT) && (size == 3)) { - GL_COLOR_COMPONENTS = 3; - GL_COLOR_POINTER = (GLfloat *)pointer; - GL_COLOR_TYPE = type; + GL_KOS_COLOR_COMPONENTS = 3; + GL_KOS_COLOR_POINTER = (GLfloat *)pointer; + GL_KOS_COLOR_TYPE = type; } else if((type == GL_FLOAT) && (size == 4)) { - GL_COLOR_COMPONENTS = 4; - GL_COLOR_POINTER = (GLfloat *)pointer; - GL_COLOR_TYPE = type; + GL_KOS_COLOR_COMPONENTS = 4; + GL_KOS_COLOR_POINTER = (GLfloat *)pointer; + GL_KOS_COLOR_TYPE = type; } else { _glKosThrowError(GL_INVALID_ENUM, "glColorPointer"); @@ -144,31 +182,31 @@ GLAPI void APIENTRY glColorPointer(GLint size, GLenum type, return; } - (stride) ? (GL_COLOR_STRIDE = stride / 4) : (GL_COLOR_STRIDE = size); + (stride) ? (GL_KOS_COLOR_STRIDE = stride / 4) : (GL_KOS_COLOR_STRIDE = size); - GL_VERTEX_PTR_MODE |= GL_USE_COLOR; + GL_KOS_VERTEX_PTR_MODE |= GL_KOS_USE_COLOR; } //========================================================================================// //== Vertex Pointer Internal API ==// inline void _glKosArrayBufIncrement() { - ++GL_ARRAY_BUF_PTR; + ++GL_KOS_ARRAY_BUF_PTR; } inline void _glKosArrayBufReset() { - GL_ARRAY_BUF_PTR = &GL_ARRAY_BUF[0]; + GL_KOS_ARRAY_BUF_PTR = &GL_KOS_ARRAY_BUF[0]; } inline glVertex *_glKosArrayBufAddr() { - return &GL_ARRAY_BUF[0]; + return &GL_KOS_ARRAY_BUF[0]; } inline glVertex *_glKosArrayBufPtr() { - return GL_ARRAY_BUF_PTR; + return GL_KOS_ARRAY_BUF_PTR; } static inline void _glKosArraysTransformNormals(GLfloat *normal, GLuint count) { - glVertex *v = &GL_ARRAY_BUF[0]; + glVertex *v = &GL_KOS_ARRAY_BUF[0]; GLfloat *N = normal; ...<truncated>... hooks/post-receive -- The KallistiOS port of OpenGL. |
From: PH3NOM <ph...@us...> - 2015-01-04 22:03:14
|
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 0fbcec655e5aaa5a9823f34c1f8f9abb6fe023ec (commit) via 4784f7fa49056f29acd01ab6936820e023b00eec (commit) from 23d51d622657b1a24e9e838ed906798d62ecdfc3 (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 0fbcec655e5aaa5a9823f34c1f8f9abb6fe023ec Author: Josh Pearson <ph...@us...> Date: Sun Jan 4 14:57:53 2015 -0800 Added multi-texture examples to kgl commit 4784f7fa49056f29acd01ab6936820e023b00eec Author: Josh Pearson <ph...@us...> Date: Sun Jan 4 14:56:02 2015 -0800 Added multi-texture examples for kgl. ----------------------------------------------------------------------- Summary of changes: .../kgl/basic/{elements => gl}/pvr-texture.c | 0 .../kgl/basic/{elements => scissor}/pvr-texture.c | 0 .../kgl/basic/{elements => txrenv}/pvr-texture.c | 0 .../demos/{blur => multitexture-arrays}/Makefile | 8 +- .../dreamcast/kgl/demos/multitexture-arrays/main.c | 120 +++++++++++++++++++ .../{blur => multitexture-arrays}/pvr-texture.c | 0 .../multitexture-arrays}/romdisk/FlareWS_256.pvr | Bin 131104 -> 131104 bytes .../multitexture-arrays}/romdisk/wp001vq.pvr | Bin 67616 -> 67616 bytes .../{mipmap => multitexture-elements}/Makefile | 76 ++++++------ .../kgl/demos/multitexture-elements/main.c | 123 ++++++++++++++++++++ .../{blur => multitexture-elements}/pvr-texture.c | 0 .../multitexture-elements}/romdisk/FlareWS_256.pvr | Bin 131104 -> 131104 bytes .../multitexture-elements}/romdisk/wp001vq.pvr | Bin 67616 -> 67616 bytes .../elements => demos/specular}/pvr-texture.c | 0 .../{basic/elements => nehe/nehe06}/pvr-texture.c | 0 .../{basic/elements => nehe/nehe08}/pvr-texture.c | 0 .../{basic/elements => nehe/nehe09}/pvr-texture.c | 0 .../{basic/elements => nehe/nehe16}/pvr-texture.c | 0 utils/genromfs/genromfs.exe | Bin 0 -> 75591 bytes utils/scramble/scramble.exe | Bin 0 -> 64155 bytes 20 files changed, 285 insertions(+), 42 deletions(-) copy examples/dreamcast/kgl/basic/{elements => gl}/pvr-texture.c (100%) copy examples/dreamcast/kgl/basic/{elements => scissor}/pvr-texture.c (100%) copy examples/dreamcast/kgl/basic/{elements => txrenv}/pvr-texture.c (100%) copy examples/dreamcast/kgl/demos/{blur => multitexture-arrays}/Makefile (83%) create mode 100755 examples/dreamcast/kgl/demos/multitexture-arrays/main.c copy examples/dreamcast/kgl/demos/{blur => multitexture-arrays}/pvr-texture.c (100%) copy examples/dreamcast/kgl/{basic/txrenv => demos/multitexture-arrays}/romdisk/FlareWS_256.pvr (100%) copy examples/dreamcast/kgl/{basic/elements => demos/multitexture-arrays}/romdisk/wp001vq.pvr (100%) copy examples/dreamcast/kgl/demos/{mipmap => multitexture-elements}/Makefile (85%) create mode 100755 examples/dreamcast/kgl/demos/multitexture-elements/main.c copy examples/dreamcast/kgl/demos/{blur => multitexture-elements}/pvr-texture.c (100%) copy examples/dreamcast/kgl/{basic/txrenv => demos/multitexture-elements}/romdisk/FlareWS_256.pvr (100%) copy examples/dreamcast/kgl/{basic/elements => demos/multitexture-elements}/romdisk/wp001vq.pvr (100%) copy examples/dreamcast/kgl/{basic/elements => demos/specular}/pvr-texture.c (100%) copy examples/dreamcast/kgl/{basic/elements => nehe/nehe06}/pvr-texture.c (100%) copy examples/dreamcast/kgl/{basic/elements => nehe/nehe08}/pvr-texture.c (100%) copy examples/dreamcast/kgl/{basic/elements => nehe/nehe09}/pvr-texture.c (100%) copy examples/dreamcast/kgl/{basic/elements => nehe/nehe16}/pvr-texture.c (100%) create mode 100755 utils/genromfs/genromfs.exe create mode 100755 utils/scramble/scramble.exe diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/basic/gl/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/basic/gl/pvr-texture.c diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/basic/scissor/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/basic/scissor/pvr-texture.c diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/basic/txrenv/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/basic/txrenv/pvr-texture.c diff --git a/examples/dreamcast/kgl/demos/blur/Makefile b/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile similarity index 83% copy from examples/dreamcast/kgl/demos/blur/Makefile copy to examples/dreamcast/kgl/demos/multitexture-arrays/Makefile index dbcdd4b..8d84f9e 100755 --- a/examples/dreamcast/kgl/demos/blur/Makefile +++ b/examples/dreamcast/kgl/demos/multitexture-arrays/Makefile @@ -1,9 +1,9 @@ -# -# KallistiGL Radial Blur test program -# (c)2014 Josh Pearson +# +# OpenGL Dreamcast Multi-Texture Example +# (c)2014 Josh Pearson # -TARGET = radial_blur.elf +TARGET = gl-multitex-arrays.elf OBJS = main.o pvr-texture.o diff --git a/examples/dreamcast/kgl/demos/multitexture-arrays/main.c b/examples/dreamcast/kgl/demos/multitexture-arrays/main.c new file mode 100755 index 0000000..64a61ab --- /dev/null +++ b/examples/dreamcast/kgl/demos/multitexture-arrays/main.c @@ -0,0 +1,120 @@ +/* + KallistiOS 2.0.0 + + main.c + (c)2014 Josh Pearson + + Open GL Multi-Texture example using Vertex Array Submission. +*/ + +#include <kos.h> +#include <GL/gl.h> +#include <GL/glext.h> +#include <GL/glu.h> +#include <GL/glut.h> + +/* Load a PVR texture - located in pvr-texture.c */ +extern GLuint glTextureLoadPVR(char *fname, unsigned char isMipMapped, unsigned char glMipMap); + +GLfloat VERTEX_ARRAY[4 * 3] = { -1.0f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.0f, + 1.0f, -1.0f, 0.0f, + -1.0f, -1.0f, 0.0f + }; + +GLfloat TEXCOORD_ARRAY[4 * 2] = { 0, 0, + 1, 0, + 1, 1, + 0, 1 + }; + +GLuint ARGB_ARRAY[4 * 1] = { 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFFFF00 }; + + +/* Multi-Texture Example using Open GL Vertex Buffer Submission. */ +void RenderCallback(GLuint texID0, GLuint texID1) { + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -3.0f); + + /* Enable Client States for OpenGL Arrays Submission */ + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + + /* Bind texture to GL_TEXTURE0_ARB and set texture parameters */ + glActiveTextureARB(GL_TEXTURE0_ARB); + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, texID0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_LINEAR); + + /* Bind multi-texture to GL_TEXTURE1_ARB and set texture parameters */ + glActiveTextureARB(GL_TEXTURE1_ARB); + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, texID1); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_LINEAR); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + /* Set Blending Mode */ + glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); + + /* Bind texture coordinates to GL_TEXTURE0_ARB */ + glTexCoordPointer(2, GL_FLOAT, 0, TEXCOORD_ARRAY); + + /* Bind texture coordinates to GL_TEXTURE1_ARB */ + glClientActiveTextureARB(GL_TEXTURE1_ARB); + glTexCoordPointer(2, GL_FLOAT, 0, TEXCOORD_ARRAY); + glClientActiveTextureARB(GL_TEXTURE0_ARB); + + /* Bind the Color Array */ + glColorPointer(1, GL_UNSIGNED_INT, 0, ARGB_ARRAY); + + /* Bind the Vertex Array */ + glVertexPointer(3, GL_FLOAT, 0, VERTEX_ARRAY); + + /* Render the Vertices as Indexed Arrays using glDrawArrays */ + glDrawArrays(GL_QUADS, 0, 4); + + /* Disable GL_TEXTURE1 */ + glActiveTextureARB(GL_TEXTURE1_ARB); + glBindTexture(GL_TEXTURE_2D, 0); + glDisable(GL_TEXTURE_2D); + + /* Make sure to set glActiveTexture back to GL_TEXTURE0_ARB when finished */ + glActiveTextureARB(GL_TEXTURE0_ARB); + glBindTexture(GL_TEXTURE_2D, 0); + glDisable(GL_TEXTURE_2D); + + /* Disable Vertex, Color and Texture Coord Arrays */ + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); +} + +extern uint8 romdisk[]; +KOS_INIT_ROMDISK(romdisk); + +int main(int argc, char **argv) { + /* Notice we do not init the PVR here, that is handled by Open GL */ + glKosInit(); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + /* Load two PVR textures to OpenGL */ + GLuint texID0 = glTextureLoadPVR("/rd/wp001vq.pvr", 0, 0); + GLuint texID1 = glTextureLoadPVR("/rd/FlareWS_256.pvr", 0, 0); + + while(1) { + /* Draw the "scene" */ + RenderCallback(texID0, texID1); + + /* Finish the frame - Notice there is no glKosBegin/FinshFrame */ + glutSwapBuffers(); + } + + return 0; +} + diff --git a/examples/dreamcast/kgl/demos/blur/pvr-texture.c b/examples/dreamcast/kgl/demos/multitexture-arrays/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/demos/blur/pvr-texture.c copy to examples/dreamcast/kgl/demos/multitexture-arrays/pvr-texture.c diff --git a/examples/dreamcast/kgl/demos/mipmap/Makefile b/examples/dreamcast/kgl/demos/multitexture-elements/Makefile similarity index 85% copy from examples/dreamcast/kgl/demos/mipmap/Makefile copy to examples/dreamcast/kgl/demos/multitexture-elements/Makefile index ce49acf..3a2837c 100755 --- a/examples/dreamcast/kgl/demos/mipmap/Makefile +++ b/examples/dreamcast/kgl/demos/multitexture-elements/Makefile @@ -1,38 +1,38 @@ -# -# OpenGL Dreamcast MipMap Example -# (c)2014 Josh Pearson -# - -TARGET = gl-mipmap.elf - -OBJS = main.o pvr-texture.o - -OBJS += romdisk.o - -all: rm-elf $(TARGET) - -include $(KOS_BASE)/Makefile.rules - -clean: - -rm -f $(TARGET) $(OBJS) - -rm-elf: - -rm -f $(TARGET) - -$(TARGET): $(OBJS) - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) - -romdisk.img: - $(KOS_GENROMFS) -f romdisk.img -d romdisk -v - -romdisk.o: romdisk.img - $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o - -run: $(TARGET) - $(KOS_LOADER) $(TARGET) - -dist: - rm -f $(OBJS) - $(KOS_STRIP) $(TARGET) - +# +# OpenGL Dreamcast Multi-Texture Example +# (c)2014 Josh Pearson +# + +TARGET = gl-multitex-elements.elf + +OBJS = main.o pvr-texture.o + +OBJS += romdisk.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) + +rm-elf: + -rm -f $(TARGET) + +$(TARGET): $(OBJS) + $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ + $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) + $(KOS_STRIP) $(TARGET) + diff --git a/examples/dreamcast/kgl/demos/multitexture-elements/main.c b/examples/dreamcast/kgl/demos/multitexture-elements/main.c new file mode 100755 index 0000000..80d3669 --- /dev/null +++ b/examples/dreamcast/kgl/demos/multitexture-elements/main.c @@ -0,0 +1,123 @@ +/* + KallistiOS 2.0.0 + + main.c + (c)2014 Josh Pearson + + Open GL Multi-Texture example using Vertex Array Submission. +*/ + +#include <kos.h> +#include <GL/gl.h> +#include <GL/glext.h> +#include <GL/glu.h> +#include <GL/glut.h> + +/* Load a PVR texture - located in pvr-texture.c */ +extern GLuint glTextureLoadPVR(char *fname, unsigned char isMipMapped, unsigned char glMipMap); + +GLfloat VERTEX_ARRAY[4 * 3] = { -1.0f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.0f, + 1.0f, -1.0f, 0.0f, + -1.0f, -1.0f, 0.0f + }; + +GLfloat TEXCOORD_ARRAY[4 * 2] = { 0, 0, + 1, 0, + 1, 1, + 0, 1 + }; + +GLuint ARGB_ARRAY[4 * 1] = { 0xFFFF0000, 0xFF0000FF, 0xFF00FF00, 0xFFFFFF00 }; + +GLubyte INDEX_ARRAY[4 * 1] = { 0, 1, 3, 2 }; + +/* Multi-Texture Example using Open GL Vertex Buffer Submission. */ +void RenderCallback(GLuint texID0, GLuint texID1) { + glLoadIdentity(); + glTranslatef(0.0f, 0.0f, -3.0f); + + /* Enable Client States for OpenGL Arrays Submission */ + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + glEnableClientState(GL_INDEX_ARRAY); + + /* Bind texture to GL_TEXTURE0_ARB and set texture parameters */ + glActiveTextureARB(GL_TEXTURE0_ARB); + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, texID0); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_LINEAR); + + /* Bind multi-texture to GL_TEXTURE1_ARB and set texture parameters */ + glActiveTextureARB(GL_TEXTURE1_ARB); + glEnable(GL_TEXTURE_2D); + glBindTexture(GL_TEXTURE_2D, texID1); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_LINEAR); + glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + + /* Set Blending Mode */ + glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); + + /* Bind texture coordinates to GL_TEXTURE0_ARB */ + glTexCoordPointer(2, GL_FLOAT, 0, TEXCOORD_ARRAY); + + /* Bind texture coordinates to GL_TEXTURE1_ARB */ + glClientActiveTextureARB(GL_TEXTURE1_ARB); + glTexCoordPointer(2, GL_FLOAT, 0, TEXCOORD_ARRAY); + glClientActiveTextureARB(GL_TEXTURE0_ARB); + + /* Bind the Color Array */ + glColorPointer(1, GL_UNSIGNED_INT, 0, ARGB_ARRAY); + + /* Bind the Vertex Array */ + glVertexPointer(3, GL_FLOAT, 0, VERTEX_ARRAY); + + /* Render the Vertices as Indexed Arrays using glDrawElements */ + glDrawElements(GL_TRIANGLE_STRIP, 4 * 1, GL_UNSIGNED_BYTE, INDEX_ARRAY); + + /* Disable GL_TEXTURE1 */ + glActiveTextureARB(GL_TEXTURE1_ARB); + glBindTexture(GL_TEXTURE_2D, 0); + glDisable(GL_TEXTURE_2D); + + /* Make sure to set glActiveTexture back to GL_TEXTURE0_ARB when finished */ + glActiveTextureARB(GL_TEXTURE0_ARB); + glBindTexture(GL_TEXTURE_2D, 0); + glDisable(GL_TEXTURE_2D); + + /* Disable Vertex, Color and Texture Coord Arrays */ + glDisableClientState(GL_INDEX_ARRAY); + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); +} + +extern uint8 romdisk[]; +KOS_INIT_ROMDISK(romdisk); + +int main(int argc, char **argv) { + /* Notice we do not init the PVR here, that is handled by Open GL */ + glKosInit(); + + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(45.0f, 640.0f / 480.0f, 0.1f, 100.0f); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + /* Load two PVR textures to OpenGL */ + GLuint texID0 = glTextureLoadPVR("/rd/wp001vq.pvr", 0, 0); + GLuint texID1 = glTextureLoadPVR("/rd/FlareWS_256.pvr", 0, 0); + + while(1) { + /* Draw the "scene" */ + RenderCallback(texID0, texID1); + + /* Finish the frame */ + glutSwapBuffers(); + } + + return 0; +} + diff --git a/examples/dreamcast/kgl/demos/blur/pvr-texture.c b/examples/dreamcast/kgl/demos/multitexture-elements/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/demos/blur/pvr-texture.c copy to examples/dreamcast/kgl/demos/multitexture-elements/pvr-texture.c diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/demos/specular/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/demos/specular/pvr-texture.c diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe06/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/nehe/nehe06/pvr-texture.c diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe08/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/nehe/nehe08/pvr-texture.c diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe09/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/nehe/nehe09/pvr-texture.c diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/nehe/nehe16/pvr-texture.c similarity index 100% copy from examples/dreamcast/kgl/basic/elements/pvr-texture.c copy to examples/dreamcast/kgl/nehe/nehe16/pvr-texture.c diff --git a/utils/genromfs/genromfs.exe b/utils/genromfs/genromfs.exe new file mode 100755 index 0000000..051a1f3 Binary files /dev/null and b/utils/genromfs/genromfs.exe differ diff --git a/utils/scramble/scramble.exe b/utils/scramble/scramble.exe new file mode 100755 index 0000000..a12cfe0 Binary files /dev/null and b/utils/scramble/scramble.exe differ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: PH3NOM <ph...@us...> - 2015-01-04 21:57: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 23d51d622657b1a24e9e838ed906798d62ecdfc3 (commit) from 813dfc0ab51d0f1aa5ceb458a593d788d9775fcc (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 23d51d622657b1a24e9e838ed906798d62ecdfc3 Author: Josh Pearson <ph...@us...> Date: Sun Jan 4 14:51:52 2015 -0800 Updated kgl examples to use glCompressedTexImage2D for loading vq compressed textures. Added multi-texture examples. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/cpp/gltest/gltest.cpp | 24 ++++++++++++++++++++---- kernel/arch/dreamcast/sound/arm/stream.drv | Bin 3620 -> 3336 bytes 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/examples/dreamcast/cpp/gltest/gltest.cpp b/examples/dreamcast/cpp/gltest/gltest.cpp index 67ae851..deb11e1 100644 --- a/examples/dreamcast/cpp/gltest/gltest.cpp +++ b/examples/dreamcast/cpp/gltest/gltest.cpp @@ -249,9 +249,25 @@ void loadtxr(const char *fname, GLuint *txr) { glGenTextures(1, txr); glBindTexture(GL_TEXTURE_2D, *txr); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, - texW, texH, 0, - texFormat, texColor, texBuf + PVR_HDR_SIZE); + + if(texFormat & PVR_TXRFMT_VQ_ENABLE) + glCompressedTexImage2D(GL_TEXTURE_2D, + 0, + texFormat | texColor, + texW, + texH, + 0, + texSize, + texBuf); + else + glTexImage2D(GL_TEXTURE_2D, + 0, + GL_RGB, + texW, texH, + 0, + GL_RGB, + texFormat | texColor, + texBuf); } extern uint8 romdisk[]; KOS_INIT_ROMDISK(romdisk); @@ -389,7 +405,7 @@ int main(int argc, char **argv) { for(int i = 0; i < 4; i++) delete cubes[i]; - glDelTextures(1, &texture); + glDeleteTextures(1, &texture); return 0; } diff --git a/kernel/arch/dreamcast/sound/arm/stream.drv b/kernel/arch/dreamcast/sound/arm/stream.drv index 0c8dc0c..d5c91b5 100755 Binary files a/kernel/arch/dreamcast/sound/arm/stream.drv and b/kernel/arch/dreamcast/sound/arm/stream.drv differ hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: PH3NOM <ph...@us...> - 2015-01-04 21:28:29
|
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 813dfc0ab51d0f1aa5ceb458a593d788d9775fcc (commit) from a1805afad1e8266f93797a9fd8353bfa1fa31501 (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 813dfc0ab51d0f1aa5ceb458a593d788d9775fcc Author: Josh Pearson <ph...@us...> Date: Sun Jan 4 14:23:01 2015 -0800 Modified sq_cpy to use const src pointer. ----------------------------------------------------------------------- Summary of changes: .../dreamcast/kgl/basic/elements/pvr-texture.c | 22 +++- examples/dreamcast/kgl/basic/gl/Makefile | 72 ++++++------ examples/dreamcast/kgl/basic/gl/gltest.c | 108 +----------------- examples/dreamcast/kgl/basic/scissor/Makefile | 74 ++++++------ examples/dreamcast/kgl/basic/scissor/scissor.c | 103 +----------------- examples/dreamcast/kgl/basic/txrenv/Makefile | 76 +++++++------- examples/dreamcast/kgl/basic/txrenv/main.c | 106 +----------------- examples/dreamcast/kgl/basic/vq/vq-example.c | 24 ++-- .../dreamcast/kgl/basic/zclip_arrays/pvr-texture.c | 22 +++- examples/dreamcast/kgl/demos/Makefile | 2 +- examples/dreamcast/kgl/demos/blur/pvr-texture.c | 24 +++- examples/dreamcast/kgl/demos/mipmap/pvr-texture.c | 24 +++- examples/dreamcast/kgl/demos/specular/Makefile | 74 ++++++------ examples/dreamcast/kgl/demos/specular/main.c | 4 +- examples/dreamcast/kgl/demos/specular/texture.h | 2 +- examples/dreamcast/kgl/nehe/nehe06/Makefile | 78 +++++++------- examples/dreamcast/kgl/nehe/nehe06/main.c | 116 +------------------- examples/dreamcast/kgl/nehe/nehe08/Makefile | 78 +++++++------- examples/dreamcast/kgl/nehe/nehe08/main.c | 106 +----------------- examples/dreamcast/kgl/nehe/nehe09/Makefile | 78 +++++++------- examples/dreamcast/kgl/nehe/nehe09/main.c | 104 +----------------- examples/dreamcast/kgl/nehe/nehe16/Makefile | 72 ++++++------ examples/dreamcast/kgl/nehe/nehe16/nehe16.c | 104 +----------------- kernel/arch/dreamcast/hardware/sq.c | 2 +- kernel/arch/dreamcast/include/dc/sq.h | 2 +- 25 files changed, 412 insertions(+), 1065 deletions(-) diff --git a/examples/dreamcast/kgl/basic/elements/pvr-texture.c b/examples/dreamcast/kgl/basic/elements/pvr-texture.c index 4e2a009..ee186a1 100755 --- a/examples/dreamcast/kgl/basic/elements/pvr-texture.c +++ b/examples/dreamcast/kgl/basic/elements/pvr-texture.c @@ -70,12 +70,24 @@ GLuint glTextureLoadPVR(char *fname, unsigned char isMipMapped, unsigned char gl glGenTextures(1, &texID); glBindTexture(GL_TEXTURE_2D, texID); - /* If the texture is MipMapped, tell Open GL to use the MipMap levels of the texture */ - if(isMipMapped || glMipMap) - glTexImage2D(GL_TEXTURE_2D, 1, GL_RGB, texW, texH, 0, GL_RGB, texFormat | texColor, TEX0); - /* If the texture is not MipMapped, tell Open GL to use the base level of the texture */ + if(texFormat & PVR_TXRFMT_VQ_ENABLE) + glCompressedTexImage2D(GL_TEXTURE_2D, + (isMipMapped || glMipMap) ? 1 : 0, + texFormat | texColor, + texW, + texH, + 0, + texSize, + TEX0); else - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texW, texH, 0, GL_RGB, texFormat | texColor, TEX0); + glTexImage2D(GL_TEXTURE_2D, + (isMipMapped || glMipMap) ? 1 : 0, + GL_RGB, + texW, texH, + 0, + GL_RGB, + texFormat | texColor, + TEX0); free(TEX0); diff --git a/examples/dreamcast/kgl/basic/gl/Makefile b/examples/dreamcast/kgl/basic/gl/Makefile index 7e0c5ea..28fea6a 100755 --- a/examples/dreamcast/kgl/basic/gl/Makefile +++ b/examples/dreamcast/kgl/basic/gl/Makefile @@ -1,36 +1,36 @@ -# -# KallistiGL test program -# (c)2013-2014 Josh PH3NOM Pearson -# (c)2001 Dan Potter -# - -TARGET = gltest.elf -OBJS = gltest.o - -all: rm-elf $(TARGET) - -include $(KOS_BASE)/Makefile.rules - -clean: - -rm -f $(TARGET) $(OBJS) romdisk.* - -rm-elf: - -rm -f $(TARGET) romdisk.* - -$(TARGET): $(OBJS) romdisk.o - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) romdisk.o $(OBJEXTRA) -lgl -lpcx -lkosutils $(KOS_LIBS) - -romdisk.img: - $(KOS_GENROMFS) -f romdisk.img -d romdisk -v - -romdisk.o: romdisk.img - $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o - -run: $(TARGET) - $(KOS_LOADER) $(TARGET) - -dist: - rm -f $(OBJS) romdisk.o romdisk.img - $(KOS_STRIP) $(TARGET) - +# +# KallistiGL test program +# (c)2013-2014 Josh PH3NOM Pearson +# (c)2001 Dan Potter +# + +TARGET = gltest.elf +OBJS = gltest.o pvr-texture.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* + +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ + $(OBJS) romdisk.o $(OBJEXTRA) -lgl -lpcx -lkosutils $(KOS_LIBS) + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) + diff --git a/examples/dreamcast/kgl/basic/gl/gltest.c b/examples/dreamcast/kgl/basic/gl/gltest.c index de6ad4b..2eed387 100755 --- a/examples/dreamcast/kgl/basic/gl/gltest.c +++ b/examples/dreamcast/kgl/basic/gl/gltest.c @@ -39,6 +39,8 @@ OpenGL is initialized with glKosInit(). */ +extern GLuint glTextureLoadPVR(char *fname, unsigned char isMipMapped, unsigned char glMipMap); + /* Draw a cube centered around 0,0,0. Note the total lack of glTexCoord2f(), even though the cube is in fact getting textured! This is KGL's AUTO_UV feature: turn it on and it assumes you're putting on the texture on @@ -110,106 +112,6 @@ void cube(float r) { glEnd(); } -/* Load a PVR texture using glTexImage2D */ -void loadtxr(const char *fname, GLuint *txr) { -#define PVR_HDR_SIZE 0x20 - FILE *tex = NULL; - unsigned char *texBuf; - unsigned int texSize; - - tex = fopen(fname, "rb"); - - if(tex == NULL) { - printf("FILE READ ERROR: %s\n", fname); - - while(1); - } - - fseek(tex, 0, SEEK_END); - texSize = ftell(tex); - - texBuf = malloc(texSize); - fseek(tex, 0, SEEK_SET); - fread(texBuf, 1, texSize, tex); - fclose(tex); - - int texW = texBuf[PVR_HDR_SIZE - 4] | texBuf[PVR_HDR_SIZE - 3] << 8; - int texH = texBuf[PVR_HDR_SIZE - 2] | texBuf[PVR_HDR_SIZE - 1] << 8; - int texFormat, texColor; - - switch((unsigned int)texBuf[PVR_HDR_SIZE - 8]) { - case 0x00: - texColor = PVR_TXRFMT_ARGB1555; - break; //(bilevel translucent alpha 0,255) - - case 0x01: - texColor = PVR_TXRFMT_RGB565; - break; //(non translucent RGB565 ) - - case 0x02: - texColor = PVR_TXRFMT_ARGB4444; - break; //(translucent alpha 0-255) - - case 0x03: - texColor = PVR_TXRFMT_YUV422; - break; //(non translucent UYVY ) - - case 0x04: - texColor = PVR_TXRFMT_BUMP; - break; //(special bump-mapping format) - - case 0x05: - texColor = PVR_TXRFMT_PAL4BPP; - break; //(4-bit palleted texture) - - case 0x06: - texColor = PVR_TXRFMT_PAL8BPP; - break; //(8-bit palleted texture) - - default: - texColor = PVR_TXRFMT_RGB565; - break; - } - - switch((unsigned int)texBuf[PVR_HDR_SIZE - 7]) { - case 0x01: - texFormat = PVR_TXRFMT_TWIDDLED; - break;//SQUARE TWIDDLED - - case 0x03: - texFormat = PVR_TXRFMT_VQ_ENABLE; - break;//VQ TWIDDLED - - case 0x09: - texFormat = PVR_TXRFMT_NONTWIDDLED; - break;//RECTANGLE - - case 0x0B: - texFormat = PVR_TXRFMT_STRIDE | PVR_TXRFMT_NONTWIDDLED; - break;//RECTANGULAR STRIDE - - case 0x0D: - texFormat = PVR_TXRFMT_TWIDDLED; - break;//RECTANGULAR TWIDDLED - - case 0x10: - texFormat = PVR_TXRFMT_VQ_ENABLE | PVR_TXRFMT_NONTWIDDLED; - break;//SMALL VQ - - default: - texFormat = PVR_TXRFMT_NONE; - break; - } - - printf("TEXTURE Resolution: %ix%i\n", texW, texH); - - glGenTextures(1, txr); - glBindTexture(GL_TEXTURE_2D, *txr); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, - texW, texH, 0, - GL_RGB, texFormat | texColor, texBuf + PVR_HDR_SIZE); -} - extern uint8 romdisk[]; KOS_INIT_ROMDISK(romdisk); @@ -236,11 +138,11 @@ int main(int argc, char **argv) { /* Expect CW verts */ glFrontFace(GL_CW); - /* Enable Transparancy */ + /* Set Blend Mode */ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - /* Load a texture and make to look nice */ - loadtxr("/rd/glass.pvr", &texture); + /* Load a texture */ + texture = glTextureLoadPVR("/rd/glass.pvr", 0, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_FILTER, GL_FILTER_BILINEAR); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATEALPHA); diff --git a/examples/dreamcast/kgl/basic/scissor/Makefile b/examples/dreamcast/kgl/basic/scissor/Makefile index 5ecd64f..d65aa5a 100755 --- a/examples/dreamcast/kgl/basic/scissor/Makefile +++ b/examples/dreamcast/kgl/basic/scissor/Makefile @@ -1,37 +1,37 @@ -# -# OpenGL (c)2013-2014 Josh PH3NOM Pearson -# -# scissor test -# (c)2002 Paul Boese -# - -TARGET = scissor.elf -OBJS = scissor.o - -all: rm-elf $(TARGET) - -include $(KOS_BASE)/Makefile.rules - -clean: - -rm -f $(TARGET) $(OBJS) romdisk.* - -rm-elf: - -rm -f $(TARGET) romdisk.* - -$(TARGET): $(OBJS) romdisk.o - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lpcx -lkosutils $(KOS_LIBS) - -romdisk.img: - $(KOS_GENROMFS) -f romdisk.img -d romdisk -v - -romdisk.o: romdisk.img - $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o - -run: $(TARGET) - $(KOS_LOADER) $(TARGET) - -dist: - rm -f $(OBJS) romdisk.o romdisk.img - $(KOS_STRIP) $(TARGET) - +# +# OpenGL (c)2013-2014 Josh PH3NOM Pearson +# +# scissor test +# (c)2002 Paul Boese +# + +TARGET = scissor.elf +OBJS = scissor.o pvr-texture.o + +all: rm-elf $(TARGET) + +include $(KOS_BASE)/Makefile.rules + +clean: + -rm -f $(TARGET) $(OBJS) romdisk.* + +rm-elf: + -rm -f $(TARGET) romdisk.* + +$(TARGET): $(OBJS) romdisk.o + $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ + $(OBJS) romdisk.o $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lpcx -lkosutils $(KOS_LIBS) + +romdisk.img: + $(KOS_GENROMFS) -f romdisk.img -d romdisk -v + +romdisk.o: romdisk.img + $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o + +run: $(TARGET) + $(KOS_LOADER) $(TARGET) + +dist: + rm -f $(OBJS) romdisk.o romdisk.img + $(KOS_STRIP) $(TARGET) + diff --git a/examples/dreamcast/kgl/basic/scissor/scissor.c b/examples/dreamcast/kgl/basic/scissor/scissor.c index 9157e48..d2ffc77 100755 --- a/examples/dreamcast/kgl/basic/scissor/scissor.c +++ b/examples/dreamcast/kgl/basic/scissor/scissor.c @@ -40,104 +40,7 @@ static GLfloat rot = 0.0f; static GLfloat rtri = 0.0f, rquad = 0.0f; static GLuint texture; -/* Load a texture */ -void loadtxr(const char *fname, GLuint *txr) { -#define PVR_HDR_SIZE 0x20 - FILE *tex = NULL; - unsigned char *texBuf; - unsigned int texSize; - - tex = fopen(fname, "rb"); - - if(tex == NULL) { - printf("FILE READ ERROR: %s\n", fname); - - while(1); - } - - fseek(tex, 0, SEEK_END); - texSize = ftell(tex); - - texBuf = malloc(texSize); - fseek(tex, 0, SEEK_SET); - fread(texBuf, 1, texSize, tex); - fclose(tex); - - int texW = texBuf[PVR_HDR_SIZE - 4] | texBuf[PVR_HDR_SIZE - 3] << 8; - int texH = texBuf[PVR_HDR_SIZE - 2] | texBuf[PVR_HDR_SIZE - 1] << 8; - int texFormat, texColor; - - switch((unsigned int)texBuf[PVR_HDR_SIZE - 8]) { - case 0x00: - texColor = PVR_TXRFMT_ARGB1555; - break; //(bilevel translucent alpha 0,255) - - case 0x01: - texColor = PVR_TXRFMT_RGB565; - break; //(non translucent RGB565 ) - - case 0x02: - texColor = PVR_TXRFMT_ARGB4444; - break; //(translucent alpha 0-255) - - case 0x03: - texColor = PVR_TXRFMT_YUV422; - break; //(non translucent UYVY ) - - case 0x04: - texColor = PVR_TXRFMT_BUMP; - break; //(special bump-mapping format) - - case 0x05: - texColor = PVR_TXRFMT_PAL4BPP; - break; //(4-bit palleted texture) - - case 0x06: - texColor = PVR_TXRFMT_PAL8BPP; - break; //(8-bit palleted texture) - - default: - break; - } - - switch((unsigned int)texBuf[PVR_HDR_SIZE - 7]) { - case 0x01: - texFormat = PVR_TXRFMT_TWIDDLED; - break;//SQUARE TWIDDLED - - case 0x03: - texFormat = PVR_TXRFMT_VQ_ENABLE; - break;//VQ TWIDDLED - - case 0x09: - texFormat = PVR_TXRFMT_NONTWIDDLED; - break;//RECTANGLE - - case 0x0B: - texFormat = PVR_TXRFMT_STRIDE | PVR_TXRFMT_NONTWIDDLED; - break;//RECTANGULAR STRIDE - - case 0x0D: - texFormat = PVR_TXRFMT_TWIDDLED; - break;//RECTANGULAR TWIDDLED - - case 0x10: - texFormat = PVR_TXRFMT_VQ_ENABLE | PVR_TXRFMT_NONTWIDDLED; - break;//SMALL VQ - - default: - texFormat = PVR_TXRFMT_NONE; - break; - } - - printf("TEXTURE Resolution: %ix%i\n", texW, texH); - - glGenTextures(1, txr); - glBindTexture(GL_TEXTURE_2D, *txr); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, - texW, texH, 0, - GL_RGB, texFormat | texColor, texBuf + PVR_HDR_SIZE); -} +extern GLuint glTextureLoadPVR(char *fname, unsigned char isMipMapped, unsigned char glMipMap); void quad(int x, int y) { glBegin(GL_QUADS); @@ -321,8 +224,8 @@ int main(int argc, char **argv) { glKosInit(); /* Set up the texture */ - loadtxr("/rd/glass.pvr", &texture); - + texture = glTextureLoadPVR("/rd/glass.pvr", 0, 0); + printf("\n[glScissor Demo]\n"); printf("DPAD moves glScissor( ) defined rectangle.\n"); printf("A button selects demo.\n"); diff --git a/examples/dreamcast/kgl/basic/txrenv/Makefile b/examples/dreamcast/kgl/basic/txrenv/Makefile index cd0d5f6..d52a0ab 100755 --- a/examples/dreamcast/kgl/basic/txrenv/Makefile +++ b/examples/dreamcast/kgl/basic/txrenv/Makefile @@ -1,38 +1,38 @@ -# -# OpenGL Dreamcast Example -# (c)2014 Josh PH3NOM Pearson -# - -TARGET = gltest.elf - -OBJS = main.o - -OBJS += romdisk.o - -all: rm-elf $(TARGET) - -include $(KOS_BASE)/Makefile.rules - -clean: - -rm -f $(TARGET) $(OBJS) - -rm-elf: - -rm -f $(TARGET) - -$(TARGET): $(OBJS) - $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \ - $(OBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lgl -lm $(KOS_LIBS) - -romdisk.img: - $(KOS_GENROMFS) -f romdisk.img -d romdisk -v - -romdisk.o: romdisk.img - $(KOS_BASE)/utils/bin2o/bin2o romdisk.img romdisk romdisk.o - -run: $(TARGET) - $(KOS_LOADER) $(TARGET) - ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast. |
From: Lawrence S. <ljs...@us...> - 2014-12-24 02:06:50
|
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 a1805afad1e8266f93797a9fd8353bfa1fa31501 (commit) from 65fe5ec8bde7fe4e0e568a41036bd233af2ad2fe (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 a1805afad1e8266f93797a9fd8353bfa1fa31501 Author: Lawrence Sebald <ljs...@us...> Date: Tue Dec 23 21:06:21 2014 -0500 New version of make_banner.sh that doesn't require bash. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/make_banner.sh | 42 +++++++++++++++----------- 1 files changed, 24 insertions(+), 18 deletions(-) diff --git a/kernel/arch/dreamcast/kernel/make_banner.sh b/kernel/arch/dreamcast/kernel/make_banner.sh index f824e20..35dd72d 100755 --- a/kernel/arch/dreamcast/kernel/make_banner.sh +++ b/kernel/arch/dreamcast/kernel/make_banner.sh @@ -1,31 +1,37 @@ -#!/usr/bin/env bash +#!/bin/sh # Re-creates the banner.h file for each compilation run -echo 'static const char banner[] = ' > banner.h +printf 'static const char banner[] = \n' > banner.h -echo -n '"KallistiOS ' >> banner.h +printf '"KallistiOS ' >> banner.h if [ -d "$KOS_BASE/.git" ]; then - echo -n 'Git revision ' >> banner.h - echo -n `git rev-list --full-history --all --abbrev-commit | head -1` >> banner.h - echo -n ': ' >> banner.h + printf 'Git revision ' >> banner.h + printf `git rev-list --full-history --all --abbrev-commit | head -1` >> banner.h + printf ': ' >> banner.h else - echo -n '##version##: ' >> banner.h + printf '##version##: ' >> banner.h fi -echo -n `date` >> banner.h -echo '\n"' >> banner.h -echo -n '" ' >> banner.h -echo -n `whoami` >> banner.h -echo -n '@' >> banner.h +tmp=`date` +printf "$tmp" >> banner.h +printf '\\n"\n' >> banner.h + +printf '" ' >> banner.h +tmp=`whoami` +printf "$tmp" >> banner.h +printf '@' >> banner.h + if [ `uname` = Linux ]; then - echo -n `hostname -f` >> banner.h + tmp=`hostname -f` else - echo -n `hostname` >> banner.h + tmp=`hostname` fi -echo -n ':' >> banner.h -echo -n $KOS_BASE >> banner.h -echo '\n"' >> banner.h -echo ';' >> banner.h +printf "$tmp" >> banner.h + +printf ':' >> banner.h +printf "$KOS_BASE" >> banner.h +printf '\\n"\n' >> banner.h +printf ';\n' >> banner.h hooks/post-receive -- A pseudo Operating System for the Dreamcast. |