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
(48) |
Sep
(30) |
Oct
(6) |
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
1
(2) |
2
|
3
(1) |
4
|
5
|
6
(2) |
7
|
8
|
9
|
10
|
11
(1) |
12
|
13
|
14
|
15
|
16
(2) |
17
(3) |
18
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
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 0103890eb416dabf173909cc14a356fdf2927218 (commit) from 03e4620053aaa3f22ca37023b98991a4fdc04d4b (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 0103890eb416dabf173909cc14a356fdf2927218 Author: Lawrence Sebald <ljs...@us...> Date: Sat May 17 17:24:10 2014 -0400 Fix the make_authors.awk script to handle quotes in names. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/make_authors.awk | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kernel/arch/dreamcast/kernel/make_authors.awk b/kernel/arch/dreamcast/kernel/make_authors.awk index 8306288..4ee8981 100644 --- a/kernel/arch/dreamcast/kernel/make_authors.awk +++ b/kernel/arch/dreamcast/kernel/make_authors.awk @@ -1,7 +1,7 @@ # KallistiOS ##version## # # arch/dreamcast/kernel/make_authors.awk -# Copyright (C) 2013 Lawrence Sebald +# Copyright (C) 2013, 2014 Lawrence Sebald # This script processes the AUTHORS file in the root directory of the source # distribution to create the authors.h file that is needed in banner.c. This @@ -28,6 +28,7 @@ BEGIN { exit; } else if(phase == 2 && 0ドル != "") { + gsub(/"/, "\\\"", 1ドル) print "\"Copyright (C)" 2,ドル 1ドル "\\n\""; } } hooks/post-receive -- A pseudo Operating System for the Dreamcast.
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 03e4620053aaa3f22ca37023b98991a4fdc04d4b (commit) via af627976b251f1faa22e7d09bf93d11d701bfd7f (commit) via 5114c558fbe48c5387d8b61a67fee0be6dc671e0 (commit) via bcf99a6973f3a91ac87c377346ff9e0f0b5fecd5 (commit) via 9ddb4d0b70bd1df79944410f397622329e5b0dfe (commit) from 030b1025feaa725200e3f1254fd49c1259664836 (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 03e4620053aaa3f22ca37023b98991a4fdc04d4b Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 23:51:42 2014 -0400 Add a few more things to the .gitignore. commit af627976b251f1faa22e7d09bf93d11d701bfd7f Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 23:50:07 2014 -0400 Add scramble to the utils Makefile. commit 5114c558fbe48c5387d8b61a67fee0be6dc671e0 Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 23:48:45 2014 -0400 Add Marcus Comstedt's 1ST_READ.BIN scrambler to the utils directory. commit bcf99a6973f3a91ac87c377346ff9e0f0b5fecd5 Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 23:43:56 2014 -0400 Add g1ata to the examples Makefile. commit 9ddb4d0b70bd1df79944410f397622329e5b0dfe Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 23:42:50 2014 -0400 Add a bunch of new/useful matrix/vector math macros. Thanks to Josh "PH3NOM" Pearson for these. ----------------------------------------------------------------------- Summary of changes: .gitignore | 4 + AUTHORS | 1 + doc/CHANGELOG | 7 +- doc/README.KOS | 10 +- examples/dreamcast/Makefile | 2 +- kernel/arch/dreamcast/include/dc/matrix.h | 227 ++++++++++++++++++++++++- kernel/arch/dreamcast/include/dc/vec3f.h | 180 ++++++++++++++++++++ utils/Makefile | 2 +- utils/scramble/Makefile | 10 + utils/scramble/README | 2 + utils/scramble/scramble.c | 260 +++++++++++++++++++++++++++++ 11 files changed, 687 insertions(+), 18 deletions(-) create mode 100644 kernel/arch/dreamcast/include/dc/vec3f.h create mode 100644 utils/scramble/Makefile create mode 100644 utils/scramble/README create mode 100644 utils/scramble/scramble.c diff --git a/.gitignore b/.gitignore index 979f5c3..5a2d891 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,7 @@ examples/dreamcast/pvr/texture_render/texture_render.bin utils/dc-chain/logs utils/dc-chain/*.tar.bz2 utils/dc-chain/*.tar.gz +utils/dc-chain/binutils-* +utils/dc-chain/gcc-* +utils/dc-chain/newlib-* +utils/scramble/scramble diff --git a/AUTHORS b/AUTHORS index dcf916d..ee8140c 100644 --- a/AUTHORS +++ b/AUTHORS @@ -38,6 +38,7 @@ Vincent Penne: 2004 Roger Cattermole: 2002 Paul Boese: 2002 Brian Paul: 1999, 2000, 2001 +Josh "PH3NOM" Pearson: 2013, 2014 Files with Specific licenses: ----------------------------- diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 23ab722..cc449f3 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,6 +1,8 @@ Platform independent changes are marked with '***', otherwise the -applicable platform is listed. If someone besides me found the bug or -suggested the fix, I'll put their name in [ ]. +applicable platform is listed. The name/initials of the person who +is responsible for the change are listed in [square brackets] for most +versions (where they are missing from early versions, assume that they +should be attributed to Dan Potter). KallistiOS version 2.0.1 ----------------------------------------------- - *** Cleaned up generated stubs files on a make clean [Lawrence Sebald = LS] @@ -37,6 +39,7 @@ KallistiOS version 2.0.1 ----------------------------------------------- - DC Fixed potential race conditions between the cdrom code and g1ata [LS] - DC Fixed full sector reading of non-data CDs (thanks to SWAT for pointing out that it needed fixing) [LS] +- DC Added many new matrix/vector math-related macros [Josh Pearson = JP] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/doc/README.KOS b/doc/README.KOS index ab4e99d..257c0d1 100644 --- a/doc/README.KOS +++ b/doc/README.KOS @@ -15,9 +15,9 @@ the header: * KOS License (README.KOS) for more details. * * You should have received a copy of the KOS License along with this -* program; if not, please visit Cryptic Allusion DCDev at: +* program; if not, please visit Cryptic Allusion Game Dev at: * -* http://dcdev.allusion.net/ +* http://gamedev.allusion.net/ * The text of that license follows. In layman's terms, all it really @@ -28,9 +28,10 @@ documentation is ok) and there is no warranty. Dan Potter All of the documentation and software included in the KallistiOS Releases -is copyrighted (C) 2000-2013 by Dan Potter and others (as noted in each file). +is copyrighted (C) 2000-2014 by Dan Potter, Lawrence Sebald, and others (as +noted in each file). -Copyright (C) 1997-2013 KallistiOS Contributors. All rights reserved. +Copyright (C) 1997-2014 KallistiOS Contributors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -55,4 +56,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/examples/dreamcast/Makefile b/examples/dreamcast/Makefile index dbecb4d..020b437 100644 --- a/examples/dreamcast/Makefile +++ b/examples/dreamcast/Makefile @@ -5,7 +5,7 @@ # DIRS = 2ndmix basic libdream kgl hello sound png network vmu conio pvr video \ - lua parallax modem dreameye sd + lua parallax modem dreameye sd g1ata ifdef KOS_CCPLUS DIRS += cpp tsunami endif diff --git a/kernel/arch/dreamcast/include/dc/matrix.h b/kernel/arch/dreamcast/include/dc/matrix.h index 5da69ba..4abba47 100644 --- a/kernel/arch/dreamcast/include/dc/matrix.h +++ b/kernel/arch/dreamcast/include/dc/matrix.h @@ -1,7 +1,8 @@ /* KallistiOS ##version## - matrix.h - (c)2000 Dan Potter + dc/matrix.h + Copyright (C) 2000 Dan Potter + Copyright (C) 2013, 2014 Josh "PH3NOM" Pearson */ @@ -13,6 +14,7 @@ functionality is built off of these operations. \author Dan Potter + \author Josh "PH3NOM" Pearson \see dc/matrix3d.h */ @@ -117,8 +119,8 @@ void mat_transform_sq(void * input, void * output, int veccnt); This macro is an inline assembly operation to transform a single vertex. It works most efficiently if the x value is in fr0, y is in fr1, z is in fr2, and w is in fr3 before using the macro. This macro is similar to - mat_trans_single(), but this one allows an input to and preserves the Z/W - value. + \ref mat_trans_single(), but this one allows an input to and preserves the + Z/W value. \param x The X coordinate to transform. \param y The Y coordinate to transform. @@ -148,8 +150,9 @@ void mat_transform_sq(void * input, void * output, int veccnt); This macro is an inline assembly operation to transform a single vertex. It works most efficiently if the x value is in fr0, y is in fr1, and z is in - fr2 before using the macro. This macro is similar to mat_trans_single(), but - this one leaves z/w instead of 1/w for the z component. + fr2 before using the macro. This macro is similar to + \ref mat_trans_single(), but this one leaves z/w instead of 1/w for the z + component. \param x The X coordinate to transform. \param y The Y coordinate to transform. @@ -177,7 +180,7 @@ void mat_transform_sq(void * input, void * output, int veccnt); This macro is an inline assembly operation to transform a single vertex. It works most efficiently if the x value is in fr0, y is in fr1, z is in fr2, and w is in fr3 before using the macro. This macro is similar to - mat_trans_single(), but this one does not do any perspective division. + \ref mat_trans_single(), but this one does not do any perspective division. \param x The X coordinate to transform. \param y The Y coordinate to transform. @@ -196,8 +199,214 @@ void mat_transform_sq(void * input, void * output, int veccnt); x = __x; y = __y; z = __z; w = __w; \ } +/** \brief Macro to transform a single 3d vertex coordinate by the internal + matrix with no perspective division. -__END_DECLS + This macro is an inline assembly operation to transform a 3 float vertex + coordinate. It works most efficiently if the x value is in fr12, y is in + fr13, and z is in fr14 before using the macro. This macro is similar to + \ref mat_trans_nodiv(), but this one sets the W component to 1 for use with + a 3d vector. + + \param x The X coordinate to transform. + \param y The Y coordinate to transform. + \param z The Z coordinate to transform. +*/ +#define mat_trans_single3_nodiv(x, y, z) { \ + register float __x __asm__("fr12") = (x); \ + register float __y __asm__("fr13") = (y); \ + register float __z __asm__("fr14") = (z); \ + __asm__ __volatile__( \ + "fldi1 fr15\n" \ + "ftrv xmtrx, fv12\n" \ + : "=f" (__x), "=f" (__y), "=f" (__z) \ + : "0" (__x), "1" (__y), "2" (__z) ); \ + x = __x; y = __y; z = __z; \ + } + +/** \brief Macro to transform a single 3d vertex coordinate by the internal + matrix with perspective division. + + This macro is an inline assembly operation to transform a 3 float vertex + coordinate. It works most efficiently if the x value is in fr12, y is in + fr13, and z is in fr14 before using the macro. This macro is similar to + \ref mat_trans_single(), but this one does not modify the input operands, + instead storing the transformed vector to the output operands. + + \param x The X coordinate to input transform. + \param y The Y coordinate to input transform. + \param z The Z coordinate to input transform. + \param x2 The X coordinate to output transform. + \param y2 The Y coordinate to output transform. + \param z2 The Z coordinate to output transform. +*/ +#define mat_trans_single3_nomod(x, y, z, x2, y2, z2) { \ + register float __x __asm__("fr12") = (x); \ + register float __y __asm__("fr13") = (y); \ + register float __z __asm__("fr14") = (z); \ + __asm__ __volatile__( \ + "fldi1 fr15\n" \ + "ftrv xmtrx, fv12\n" \ + "fldi1 fr14\n" \ + "fdiv fr15, fr14\n" \ + "fmul fr14, fr12\n" \ + "fmul fr14, fr13\n" \ + : "=f" (__x), "=f" (__y), "=f" (__z) \ + : "0" (__x), "1" (__y), "2" (__z) \ + : "fr15" ); \ + x2 = __x; y2 = __y; z2 = __z; \ + } + +/** \brief Macro to transform a single 3d vertex coordinate by the internal + matrix. + + This macro is an inline assembly operation to transform a 3 float vertex + coordinate. It works most efficiently if the x value is in fr12, y is in + fr13, and z is in fr14 before using the macro. This macro is similar to + \ref mat_trans_single3_nodiv(), but this one does not modify the input + operands, instead storing the transformed vector to the output operands. + + \param x The X coordinate to input transform. + \param y The Y coordinate to input transform. + \param z The Z coordinate to input transform. + \param x2 The X coordinate to output transform. + \param y2 The Y coordinate to output transform. + \param z2 The Z coordinate to output transform. +*/ +#define mat_trans_single3_nodiv_nomod(x, y, z, x2, y2, z2) { \ + register float __x __asm__("fr12") = (x); \ + register float __y __asm__("fr13") = (y); \ + register float __z __asm__("fr14") = (z); \ + __asm__ __volatile__( \ + "fldi1 fr15\n" \ + "ftrv xmtrx, fv12\n" \ + : "=f" (__x), "=f" (__y), "=f" (__z) \ + : "0" (__x), "1" (__y), "2" (__z) ); \ + x2 = __x; y2 = __y; z2 = __z; \ + } + +/** \brief Macro to transform a single 3d vertex coordinate by the internal + matrix. + + This macro is an inline assembly operation to transform a 3 float vertex + coordinate. It works most efficiently if the x value is in fr12, y is in + fr13, and z is in fr14 before using the macro. This macro is similar to + \ref mat_trans_single3_nodiv(), but this one stores the W component of + transform for later perspective divide. + + \param x The X coordinate to transform. + \param y The Y coordinate to transform. + \param z The Z coordinate to transform. + \param w The W coordinate output of transform. +*/ +#define mat_trans_single3_nodivw(x, y, z, w) { \ + register float __x __asm__("fr12") = (x); \ + register float __y __asm__("fr13") = (y); \ + register float __z __asm__("fr14") = (z); \ + register float __w __asm__("fr15"); \ + __asm__ __volatile__( \ + "fldi1 fr15\n" \ + "ftrv xmtrx, fv12\n" \ + : "=f" (__x), "=f" (__y), "=f" (__z) \ + : "0" (__x), "1" (__y), "2" (__z) ); \ + x = __x; y = __y; z = __z; w = __w; \ + } + +/** \brief Macro to transform a single 3d vertex coordinate by the internal + matrix both with and without perspective division. + + This macro is an inline assembly operation to transform a 3 float vertex + coordinate. It works most efficiently if the x value is in fr0, y is in fr1, + and z is in fr2 before using the macro. This macro is similar to + \ref mat_trans_single(), but this one is used for transforming input vertex + with and without perspective division. + + \param x The X coordinate to transform without perspective + divide. + \param y The Y coordinate to transform without perspective + divide. + \param z The Z coordinate to transform without perspective + divide. + \param xd The X coordinate to output transform with + perspective divide. + \param yd The Y coordinate to output transform with + perspective divide. + \param zd The Z coordinate to output transform with + perspective divide. +*/ +#define mat_trans_single3_nodiv_div(x, y, z, xd, yd, zd) { \ + register float __x __asm__("fr0") = (x); \ + register float __y __asm__("fr1") = (y); \ + register float __z __asm__("fr2") = (z); \ + register float __xd __asm__("fr4"); \ + register float __yd __asm__("fr5"); \ + register float __zd __asm__("fr6"); \ + __asm__ __volatile__( \ + "fldi1 fr3\n" \ + "ftrv xmtrx, fv0\n" \ + "fmov fr0, fr4\n" \ + "fmov fr1, fr5\n" \ + "fmov fr3, fr7\n" \ + "fldi1 fr6\n" \ + "fdiv fr7, fr6\n" \ + "fmul fr6, fr4\n" \ + "fmul fr6, fr5\n" \ + : "=f" (__x), "=f" (__y), "=f" (__z) \ + : "0" (__x), "1" (__y), "2" (__z) ); \ + x = __x; y = __y; z = __z; xd = __xd; yd = __yd; zd = __zd; \ + } + +/** \brief Macro to transform a single vertex normal by the internal matrix. + + This macro is an inline assembly operation to transform a 3 float vertex + normal. It works most efficiently if the x value is in fr8, y is in fr9, + and z is in fr10 before using the macro. This macro is similar to + \ref mat_trans_nodiv(), but this one sets the W component to 0 in order to + transform a vertex normal, rather than 1 for a vertex position. -#endif /* __DC_MATRIX_H */ + \param x The X normal to transform. + \param y The Y normal to transform. + \param z The Z normal to transform. +*/ +#define mat_trans_normal3(x, y, z) { \ + register float __x __asm__("fr8") = (x); \ + register float __y __asm__("fr9") = (y); \ + register float __z __asm__("fr10") = (z); \ + __asm__ __volatile__( \ + "fldi0 fr11\n" \ + "ftrv xmtrx, fv8\n" \ + : "=f" (__x), "=f" (__y), "=f" (__z) \ + : "0" (__x), "1" (__y), "2" (__z) ); \ + x = __x; y = __y; z = __z; \ + } + +/** \brief Macro to transform a single vertex normal by the internal matrix. + + This macro is an inline assembly operation to transform a 3 float vertex + normal. It works most efficiently if the x value is in fr8, y is in fr9, + and z is in fr10 before using the macro. This macro is similar to + \ref mat_trans_normal3(), but this one does not modify the input operands, + instead storing the transformed vector to the output operands. + + \param x The X normal to input transform. + \param y The Y normal to input transform. + \param z The Z normal to input transform. + \param x2 The X normal to output transform. + \param y2 The Y normal to output transform. + \param z2 The Z normal to output transform. +*/ +#define mat_trans_normal3_nomod(x, y, z, x2, y2, z2) { \ + register float __x __asm__("fr8") = (x); \ + register float __y __asm__("fr9") = (y); \ + register float __z __asm__("fr10") = (z); \ + __asm__ __volatile__( \ + "fldi0 fr11\n" \ + "ftrv xmtrx, fv8\n" \ + : "=f" (__x), "=f" (__y), "=f" (__z) \ + : "0" (__x), "1" (__y), "2" (__z) ); \ + x2 = __x; y2 = __y; z2 = __z; \ + } + +__END_DECLS +#endif /* !__DC_MATRIX_H */ diff --git a/kernel/arch/dreamcast/include/dc/vec3f.h b/kernel/arch/dreamcast/include/dc/vec3f.h new file mode 100644 index 0000000..dc84b21 --- /dev/null +++ b/kernel/arch/dreamcast/include/dc/vec3f.h @@ -0,0 +1,180 @@ +/* KallistiOS ##version## + + dc/vec3f.h + Copyright (C) 2013, 2014 Josh "PH3NOM" Pearson + +*/ + +/** \file dc/vec3f.h + \brief Basic matrix operations. + + This file contains various basic vector math functionality for using the + SH4's vector instructions. Higher level functionality in KGL is built off + of these. + + \author Josh "PH3NOM" Pearson + \see dc/matrix.h +*/ + +#ifndef __DC_VEC3F_H +#define __DC_VEC3F_H + +#include <sys/cdefs.h> +__BEGIN_DECLS + +#include <kos/vector.h> + +/** \brief Macro to return the scalar dot product of two 3d vectors. + + This macro is an inline assembly operation using the SH4's fast + (approximate) math instructions, and returns a single-precision + floating-point value. + + \param x1 The X coordinate of first vector. + \param y1 The Y coordinate of first vector. + \param z1 The Z coordinate of first vector. + \param x2 The X coordinate of second vector. + \param y2 The Y coordinate of second vector. + \param z2 The Z coordinate of second vector. + \param w The result of the calculation. +*/ +#define vec3f_dot(x1, y1, z1, x2, y2, z2, w) { \ + register float __x __asm__("fr0") = (x1); \ + register float __y __asm__("fr1") = (y1); \ + register float __z __asm__("fr2") = (z1); \ + register float __w __asm__("fr3"); \ + register float __a __asm__("fr4") = (x2); \ + register float __b __asm__("fr5") = (y2); \ + register float __c __asm__("fr6") = (z2); \ + register float __d __asm__("fr7"); \ + __asm__ __volatile__( \ + "fldi0 fr3\n" \ + "fldi0 fr7\n" \ + "fipr fv4,fv0" \ + : "+f" (__w) \ + : "f" (__x), "f" (__y), "f" (__z), "f" (__w), \ + "f" (__a), "f" (__b), "f" (__c), "f" (__d) \ + ); \ + w = __w; \ + } + +/** \brief Macro to return scalar Euclidean length of a 3d vector. + + This macro is an inline assembly operation using the SH4's fast + (approximate) math instructions, and returns a single-precision + floating-point value. + + \param x The X coordinate of vector. + \param y The Y coordinate of vector. + \param z The Z coordinate of vector. + \param w The result of the calculation. +*/ +#define vec3f_length(x, y, z, w) { \ + register float __x __asm__("fr0") = (x); \ + register float __y __asm__("fr1") = (y); \ + register float __z __asm__("fr2") = (z); \ + register float __w __asm__("fr3"); \ + __asm__ __volatile__( \ + "fldi0 fr3\n" \ + "fipr fv0,fv0\n" \ + "fsqrt fr3\n" \ + : "+f" (__w) \ + : "f" (__x), "f" (__y), "f" (__z), "f" (__w) \ + ); \ + w = __w; \ + } + +/** \brief Macro to return the Euclidean distance between two 3d vectors. + + This macro is an inline assembly operation using the SH4's fast + (approximate) math instructions, and returns a single-precision + floating-point value. + + \param x1 The X coordinate of first vector. + \param y1 The Y coordinate of first vector. + \param z1 The Z coordinate of first vector. + \param x2 The X coordinate of second vector. + \param y2 The Y coordinate of second vector. + \param z2 The Z coordinate of second vector. + \param w The result of the calculation. +*/ +#define vec3f_distance(x1, y1, z1, x2, y2, z2, w) { \ + register float __x __asm__("fr0") = (x2-x1); \ + register float __y __asm__("fr1") = (y2-y1); \ + register float __z __asm__("fr2") = (z2-z1); \ + register float __w __asm__("fr3"); \ + __asm__ __volatile__( \ + "fldi0 fr3\n" \ + "fipr fv0,fv0\n" \ + "fsqrt fr3\n" \ + : "+f" (__w) \ + : "f" (__x), "f" (__y), "f" (__z), "f" (__w) \ + ); \ + w = __w; \ + } + +/** \brief Macro to return the normalized version of a vector. + + This macro is an inline assembly operation using the SH4's fast + (approximate) math instructions to calculate a vector that is in the same + direction as the input vector but with a Euclidean length of one. The input + vector is modified by the operation as the resulting values. + + \param x The X coordinate of vector. ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast.
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A serial program loader for the Dreamcast.". The branch, master has been updated via 697d5d41eb701345f9d1f9f8c274f338a14c356d (commit) from 5d88a59d62033a6dcffce8221370675d3601676b (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 697d5d41eb701345f9d1f9f8c274f338a14c356d Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 21:53:01 2014 -0400 Fix |darc|'s broken cable bug in dcload-serial. ----------------------------------------------------------------------- Summary of changes: target-src/dcload/video.s | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target-src/dcload/video.s b/target-src/dcload/video.s index 8715844..8ba049d 100644 --- a/target-src/dcload/video.s +++ b/target-src/dcload/video.s @@ -275,11 +275,13 @@ nonlace: ! Select RGB/CVBS mov.l cvbsbase,r1 - rotr r4 - bf/s rgbmode - mov #0,r0 - mov #3,r0 -rgbmode: + mov r4,r0 + and #3,r0 + !rotr r4 + !bf/s rgbmode + !mov #0,r0 + !mov #3,r0 +!rgbmode: shll8 r0 mov.l r0,@r1 hooks/post-receive -- A serial program loader for the Dreamcast.
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 "An ethernet program loader for the Dreamcast.". The branch, master has been updated via c49476cae2a18c6f577f7135cc13836de04c8232 (commit) from 589baf9fd567a9b97881f1ecaf1f5989afdbef69 (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 c49476cae2a18c6f577f7135cc13836de04c8232 Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 18:39:00 2014 -0400 Apply |darc|'s broken cable fix to dcload-ip too. ----------------------------------------------------------------------- Summary of changes: target-src/dcload/video.s | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/target-src/dcload/video.s b/target-src/dcload/video.s index 787df0c..6ebb6a1 100644 --- a/target-src/dcload/video.s +++ b/target-src/dcload/video.s @@ -275,11 +275,13 @@ nonlace: ! Select RGB/CVBS mov.l cvbsbase,r1 - rotr r4 - bf/s rgbmode - mov #0,r0 - mov #3,r0 -rgbmode: + mov r4,r0 + and #3,r0 + !rotr r4 + !bf/s rgbmode + !mov #0,r0 + !mov #3,r0 +!rgbmode: shll8 r0 mov.l r0,@r1 hooks/post-receive -- An ethernet program loader for the Dreamcast.
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 030b1025feaa725200e3f1254fd49c1259664836 (commit) from bdf3aa24bf8141191cb6b666a31313a2fa465242 (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 030b1025feaa725200e3f1254fd49c1259664836 Author: Lawrence Sebald <ljs...@us...> Date: Fri May 16 17:47:45 2014 -0400 Fix |darc|'s broken cable bug. Basically, |darc| made a VGA cable incorrectly and found that KOS' behavior with it differed from that in the BIOS. This corrects that "problem". See http://dcemulation.org/phpBB/viewtopic.php?f=29&t=103090 for a better description of what this actually means... ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/video.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/video.c b/kernel/arch/dreamcast/hardware/video.c index b480bac..d7c6a4d 100644 --- a/kernel/arch/dreamcast/hardware/video.c +++ b/kernel/arch/dreamcast/hardware/video.c @@ -617,12 +617,8 @@ void vid_set_mode_ex(vid_mode_t *mode) { vid_flip(0); /* Set cable type */ - if(mode->cable_type & 1) { - *((vuint32*)0xa0702c00) |= 0x300; - } - else { - *((vuint32*)0xa0702c00) &= ~0x300; - } + *((vuint32*)0xa0702c00) = (*((vuint32*)0xa0702c00) & 0xfffffcff) | + ((ct & 3) << 8); /* Re-enable the display */ regs[0x3A] &= ~8; @@ -756,5 +752,3 @@ void vid_shutdown() { /* Play nice with loaders, like KOS used to do. */ vid_init(DM_640x480, PM_RGB565); } - - hooks/post-receive -- A pseudo Operating System for the Dreamcast.
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 SDL.". The branch, master has been updated via 10b82d38e762d9e706ebbb0a0d6b43c5d51b076a (commit) from dd770d5a611fcc80d9579b651b7476b851851b3f (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 10b82d38e762d9e706ebbb0a0d6b43c5d51b076a Author: Lawrence Sebald <ljs...@us...> Date: Sun May 11 19:34:13 2014 -0400 Remove use of deprecated semaphore functions from SDL. Thanks to Indiket for pointing out that they were still in use. ----------------------------------------------------------------------- Summary of changes: base/src/thread/dc/SDL_syssem.c | 122 +++++++++++++++++++++------------------ 1 files changed, 65 insertions(+), 57 deletions(-) diff --git a/base/src/thread/dc/SDL_syssem.c b/base/src/thread/dc/SDL_syssem.c index b9bb6cd..da0ebf8 100644 --- a/base/src/thread/dc/SDL_syssem.c +++ b/base/src/thread/dc/SDL_syssem.c @@ -39,42 +39,42 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { - SDL_SetError("SDL not configured with thread support"); - return (SDL_sem *)0; + SDL_SetError("SDL not configured with thread support"); + return (SDL_sem *)0; } void SDL_DestroySemaphore(SDL_sem *sem) { - return; + return; } int SDL_SemTryWait(SDL_sem *sem) { - SDL_SetError("SDL not configured with thread support"); - return -1; + SDL_SetError("SDL not configured with thread support"); + return -1; } int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { - SDL_SetError("SDL not configured with thread support"); - return -1; + SDL_SetError("SDL not configured with thread support"); + return -1; } int SDL_SemWait(SDL_sem *sem) { - SDL_SetError("SDL not configured with thread support"); - return -1; + SDL_SetError("SDL not configured with thread support"); + return -1; } Uint32 SDL_SemValue(SDL_sem *sem) { - return 0; + return 0; } int SDL_SemPost(SDL_sem *sem) { - SDL_SetError("SDL not configured with thread support"); - return -1; + SDL_SetError("SDL not configured with thread support"); + return -1; } #else @@ -83,12 +83,19 @@ int SDL_SemPost(SDL_sem *sem) struct SDL_semaphore { - semaphore_t sem; + semaphore_t sem; }; SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) { - return (SDL_sem *)sem_create(initial_value); + SDL_sem *rv; + + if((rv = (SDL_sem *)malloc(sizeof(SDL_sem)))) + sem_init(&rv->sem, initial_value); + else + SDL_OutOfMemory(); + + return rv; } /* WARNING: @@ -96,80 +103,81 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value) */ void SDL_DestroySemaphore(SDL_sem *sem) { - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return; - } + if(!sem) { + SDL_SetError("Passed a NULL semaphore"); + return; + } - sem_destroy(&sem->sem); + sem_destroy(&sem->sem); + free(sem); } int SDL_SemTryWait(SDL_sem *sem) { - int retval; + int retval; - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } + if(!sem) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } - retval = sem_trywait(&sem->sem); - if (retval==0) return 0; - else return SDL_MUTEX_TIMEDOUT; + retval = sem_trywait(&sem->sem); + if (retval==0) return 0; + else return SDL_MUTEX_TIMEDOUT; - return retval; + return retval; } int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout) { - int retval; + int retval; - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } + if(!sem) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } - /* A timeout of 0 is an easy case */ - if ( timeout == 0 ) { - return SDL_SemTryWait(sem); - } + /* A timeout of 0 is an easy case */ + if(timeout == 0) { + return SDL_SemTryWait(sem); + } - retval = sem_wait_timed(&sem->sem,timeout); - if (retval==-1) retval= SDL_MUTEX_TIMEDOUT; + retval = sem_wait_timed(&sem->sem,timeout); + if(retval==-1) retval= SDL_MUTEX_TIMEDOUT; - return retval; + return retval; } int SDL_SemWait(SDL_sem *sem) { - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } + if(!sem) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } - sem_wait(&sem->sem); - return 0; + sem_wait(&sem->sem); + return 0; } Uint32 SDL_SemValue(SDL_sem *sem) { - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } + if(!sem) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } - return sem_count(&sem->sem); + return sem_count(&sem->sem); } int SDL_SemPost(SDL_sem *sem) { - if ( ! sem ) { - SDL_SetError("Passed a NULL semaphore"); - return -1; - } + if(!sem) { + SDL_SetError("Passed a NULL semaphore"); + return -1; + } - sem_signal(&sem->sem); - return 0; + sem_signal(&sem->sem); + return 0; } #endif /* DISABLE_THREADS */ hooks/post-receive -- The KallistiOS port of SDL.
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 bdf3aa24bf8141191cb6b666a31313a2fa465242 (commit) from 049709b05651278562daf47629ea4161e56ac230 (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 bdf3aa24bf8141191cb6b666a31313a2fa465242 Author: Lawrence Sebald <ljs...@us...> Date: Tue May 6 12:31:47 2014 -0400 Add a convenience function to the MD5 code. ----------------------------------------------------------------------- Summary of changes: addons/include/kos/md5.h | 13 +++++++++++++ addons/libkosutils/md5.c | 9 +++++++++ 2 files changed, 22 insertions(+), 0 deletions(-) diff --git a/addons/include/kos/md5.h b/addons/include/kos/md5.h index 8901cc1..aecd5e4 100644 --- a/addons/include/kos/md5.h +++ b/addons/include/kos/md5.h @@ -70,6 +70,19 @@ void kos_md5_hash_block(kos_md5_cxt_t *cxt, const uint8 *input, uint32 size); */ void kos_md5_finish(kos_md5_cxt_t *cxt, uint8 output[16]); +/** \brief Compute the hash of a block of data with MD5. + + This function is used to hash a full block of data without messing around + with any contexts or anything else of the sort. This is appropriate if you + have all the data you want to hash readily available. It takes care of all + of the context setup and teardown for you. + + \param input The data to hash. + \param size The number of bytes of input data passed in. + \param output Where to store the final message digest. +*/ +void kos_md5(const uint8 *input, uint32 size, uint8 output[16]); + __END_DECLS #endif /* !__KOS_MD5_H */ diff --git a/addons/libkosutils/md5.c b/addons/libkosutils/md5.c index f2528ba..87667f2 100644 --- a/addons/libkosutils/md5.c +++ b/addons/libkosutils/md5.c @@ -272,3 +272,12 @@ void kos_md5_finish(kos_md5_cxt_t *cxt, uint8 output[16]) { output[i] = (uint8)(cxt->hash[i >> 2] >> ((i & 0x03) << 3)); } } + +/* Convenience function for computing an MD5 of a complete block. */ +void kos_md5(const uint8 *input, uint32 size, uint8 output[16]) { + kos_md5_cxt_t cxt; + + kos_md5_start(&cxt); + kos_md5_hash_block(&cxt, input, size); + kos_md5_finish(&cxt, output); +} hooks/post-receive -- A pseudo Operating System for the Dreamcast.
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A serial program loader for the Dreamcast.". The branch, master has been updated via 5d88a59d62033a6dcffce8221370675d3601676b (commit) from 21fb648175fa4b4146db2d8568a31e8f7fc0eb16 (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 5d88a59d62033a6dcffce8221370675d3601676b Author: Lawrence Sebald <ljs...@us...> Date: Mon May 5 20:36:48 2014 -0400 Add support for speeds > 115200 on OS X and clean up warnings. ----------------------------------------------------------------------- Summary of changes: Makefile.cfg | 8 ++-- host-src/tool/Makefile | 4 +- host-src/tool/dc-tool.c | 99 ++++++++++++++++++++++++++++++----------------- 3 files changed, 69 insertions(+), 42 deletions(-) diff --git a/Makefile.cfg b/Makefile.cfg index ddcffd8..349b217 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -1,7 +1,7 @@ # host compiler and flags HOSTCC = gcc -HOSTCFLAGS = -O2 # -Wall -HOSTLDFLAGS = +HOSTCFLAGS = -O2 -I/usr/local/include # -Wall +HOSTLDFLAGS = -L/usr/local/lib # cygwin probably needs this #HOSTCFLAGS = -O2 -D_WIN32 @@ -13,8 +13,8 @@ TARGETPREFIX = /opt/toolchains/dc/sh-elf # the correct ones for your system # these must point to your sh-elf bfd, not the system one -BFDLIB = -L$(TARGETPREFIX)/lib -lbfd -liberty -BFDINCLUDE = $(TARGETPREFIX)/include +#BFDLIB = -L$(TARGETPREFIX)/lib -lbfd -liberty +#BFDINCLUDE = $(TARGETPREFIX)/include # mac osx # these must point to your sh-elf bfd, not the system one diff --git a/host-src/tool/Makefile b/host-src/tool/Makefile index 072865c..a56c5f0 100644 --- a/host-src/tool/Makefile +++ b/host-src/tool/Makefile @@ -4,10 +4,10 @@ LZOPATH = ../../minilzo.106 CC = $(HOSTCC) CFLAGS = $(HOSTCFLAGS) -DBAUD_RATE=$(SERIALSPEED) -DSERIALDEVICE="\"$(SERIALDEVICE)\"" -DHAVE_GETOPT -DB1500000 -DB500000 -INCLUDE = -I$(LZOPATH) -I$(BFDINCLUDE) +INCLUDE = -I$(LZOPATH) -I/usr/local/include ifdef WITH_BFD - CFLAGS += -DWITH_BFD + CFLAGS += -DWITH_BFD -I$(BFDINCLUDE) LDFLAGS = $(HOSTLDFLAGS) $(BFDLIB) else LDFLAGS = $(HOSTLDFLAGS) -lelf diff --git a/host-src/tool/dc-tool.c b/host-src/tool/dc-tool.c index 4f2eb67..c118abe 100644 --- a/host-src/tool/dc-tool.c +++ b/host-src/tool/dc-tool.c @@ -45,6 +45,10 @@ #include <arpa/inet.h> #include <sys/socket.h> #endif +#ifdef __APPLE__ +#include <IOKit/serial/ioss.h> +#include <sys/ioctl.h> +#endif #include "minilzo.h" #include "syscalls.h" #include "dc-io.h" @@ -527,9 +531,19 @@ int open_serial(char *devicename, unsigned int speed, unsigned int *speedtest) break; } } - - cfsetispeed(&newtio, speedsel); - cfsetospeed(&newtio, speedsel); + +#ifdef __APPLE__ + if(speed > 115200) { + cfsetispeed(&newtio, B115200); + cfsetospeed(&newtio, B115200); + } + else { +#endif + cfsetispeed(&newtio, speedsel); + cfsetospeed(&newtio, speedsel); +#ifdef __APPLE__ + } +#endif // we don't error on these because it *may* still work if (tcflush(dcfd, TCIFLUSH) < 0) { @@ -540,6 +554,16 @@ int open_serial(char *devicename, unsigned int speed, unsigned int *speedtest) printf("warning: your baud rate is likely set incorrectly\n"); } +#ifdef __APPLE__ + if(speed > 115200) { + speed_t s = speed; // Set 14400 baud + if (ioctl(dcfd, IOSSIOSPEED, &speed) < 0) { + perror("IOSSIOSPEED"); + printf("warning: your baud rate is likely set incorrectly\n"); + } + } +#endif + #else BOOL fSuccess; COMMTIMEOUTS ctmoCommPort; @@ -637,30 +661,33 @@ int change_speed(char *device_name, unsigned int speed) send_uint(rv); rv = recv_uint(); printf("done\n"); + return 0; } int open_gdb_socket(int port) { - struct sockaddr_in server_addr; + struct sockaddr_in server_addr; - server_addr.sin_family = AF_INET; - server_addr.sin_port = htons( port ); - server_addr.sin_addr.s_addr = htonl( INADDR_LOOPBACK ); + server_addr.sin_family = AF_INET; + server_addr.sin_port = htons(port); + server_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - if ( (gdb_server_socket = socket( PF_INET, SOCK_STREAM, IPPROTO_TCP )) < 0 ) { - perror( "error creating gdb server socket" ); - return -1; - } + if((gdb_server_socket = socket(PF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0) { + perror("error creating gdb server socket"); + return -1; + } - if ( bind( gdb_server_socket, (struct sockaddr*)&server_addr, sizeof( server_addr ) ) < 0 ) { - perror( "error binding gdb server socket" ); - return -1; - } + if(bind(gdb_server_socket, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0) { + perror("error binding gdb server socket"); + return -1; + } - if ( listen( gdb_server_socket, 0 ) < 0 ) { - perror( "error listening to gdb server socket" ); - return -1; - } + if(listen(gdb_server_socket, 0) < 0) { + perror("error listening to gdb server socket"); + return -1; + } + + return 0; } void usage(void) @@ -758,8 +785,8 @@ unsigned int upload(unsigned char *filename, unsigned int address) exit(-1); } - if((inputfd = open(filename, O_RDONLY)) < 0) { - perror(filename); + if((inputfd = open((char *)filename, O_RDONLY)) < 0) { + perror((char *)filename); exit(-1); } @@ -830,10 +857,10 @@ unsigned int upload(unsigned char *filename, unsigned int address) #endif /* if all else fails, send raw bin */ printf("File format is raw binary, start address is 0x%x\n", address); - inputfd = open(filename, O_RDONLY | O_BINARY); + inputfd = open((char *)filename, O_RDONLY | O_BINARY); if(inputfd < 0) { - perror(filename); + perror((char *)filename); exit(-1); } @@ -881,10 +908,10 @@ void download(unsigned char *filename, unsigned int address, struct timeval starttime, endtime; double stime, etime; - outputfd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); + outputfd = open((char *)filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644); if (outputfd < 0) { - perror(filename); + perror((char *)filename); exit(-1); } @@ -944,15 +971,15 @@ void do_console(unsigned char *path, unsigned char *isofile) int isofd; if (isofile) { - isofd = open(isofile, O_RDONLY | O_BINARY); + isofd = open((char *)isofile, O_RDONLY | O_BINARY); if (isofd < 0) - perror(isofile); + perror((char *)isofile); } #ifndef __MINGW32__ if (path) - if (chroot(path)) - perror(path); + if (chroot((char *)path)) + perror((char *)path); #endif while (1) { @@ -1090,7 +1117,7 @@ int main(int argc, char *argv[]) } command = 'x'; filename = malloc(strlen(optarg) + 1); - strcpy(filename, optarg); + strcpy((char *)filename, optarg); break; case 'u': if (command) { @@ -1099,7 +1126,7 @@ int main(int argc, char *argv[]) } command = 'u'; filename = malloc(strlen(optarg) + 1); - strcpy(filename, optarg); + strcpy((char *)filename, optarg); break; case 'd': if (command) { @@ -1108,18 +1135,18 @@ int main(int argc, char *argv[]) } command = 'd'; filename = malloc(strlen(optarg) + 1); - strcpy(filename, optarg); + strcpy((char *)filename, optarg); break; #ifndef __MINGW32__ case 'c': path = malloc(strlen(optarg) + 1); - strcpy(path, optarg); + strcpy((char *)path, optarg); break; #endif case 'i': cdfs_redir = 1; isofile = malloc(strlen(optarg) + 1); - strcpy(isofile, optarg); + strcpy((char *)isofile, optarg); break; case 'a': address = strtoul(optarg, NULL, 0); @@ -1169,8 +1196,8 @@ int main(int argc, char *argv[]) if ((command == 'x') || (command == 'u')) { struct stat statbuf; - if(stat(filename, &statbuf)) { - perror(filename); + if(stat((char *)filename, &statbuf)) { + perror((char *)filename); exit(1); } } hooks/post-receive -- A serial program loader for the Dreamcast.
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 049709b05651278562daf47629ea4161e56ac230 (commit) from 89487109972dec695af7b43c863a4373ab127948 (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 049709b05651278562daf47629ea4161e56ac230 Author: Lawrence Sebald <ljs...@us...> Date: Sat May 3 17:21:56 2014 -0400 Add basic g1ata example. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/g1ata/Makefile | 14 +++ .../{modem/basic => g1ata/atatest}/Makefile | 14 ++-- examples/dreamcast/g1ata/atatest/atatest.c | 96 ++++++++++++++++++++ 3 files changed, 116 insertions(+), 8 deletions(-) create mode 100644 examples/dreamcast/g1ata/Makefile copy examples/dreamcast/{modem/basic => g1ata/atatest}/Makefile (64%) create mode 100644 examples/dreamcast/g1ata/atatest/atatest.c diff --git a/examples/dreamcast/g1ata/Makefile b/examples/dreamcast/g1ata/Makefile new file mode 100644 index 0000000..822eba0 --- /dev/null +++ b/examples/dreamcast/g1ata/Makefile @@ -0,0 +1,14 @@ +# KallistiOS ##version## +# +# examples/dreamcast/g1ata/Makefile +# + +all: + $(KOS_MAKE) -C atatest + +clean: + $(KOS_MAKE) -C atatest clean + +dist: + $(KOS_MAKE) -C atatest dist + diff --git a/examples/dreamcast/modem/basic/Makefile b/examples/dreamcast/g1ata/atatest/Makefile similarity index 64% copy from examples/dreamcast/modem/basic/Makefile copy to examples/dreamcast/g1ata/atatest/Makefile index 8d2e9f2..26e7776 100644 --- a/examples/dreamcast/modem/basic/Makefile +++ b/examples/dreamcast/g1ata/atatest/Makefile @@ -1,11 +1,10 @@ +# KallistiOS ##version## +# +# examples/dreamcast/g1ata/atatest/Makefile # -# Basic modem test program -# Copyright (C)2003 Nick Kochakian -# - -TARGET = example1.elf -OBJS = example1.o +TARGET = atatest.elf +OBJS = atatest.o all: rm-elf $(TARGET) @@ -24,6 +23,5 @@ run: $(TARGET) $(KOS_LOADER) $(TARGET) dist: - rm -f $(OBJS) + rm -f $(OBJS) romdisk.o romdisk.img $(KOS_STRIP) $(TARGET) - diff --git a/examples/dreamcast/g1ata/atatest/atatest.c b/examples/dreamcast/g1ata/atatest/atatest.c new file mode 100644 index 0000000..07e2042 --- /dev/null +++ b/examples/dreamcast/g1ata/atatest/atatest.c @@ -0,0 +1,96 @@ +/* KallistiOS ##version## + + atatest.c + Copyright (C) 2014 Lawrence Sebald + + This example program simply attempts to read some sectors from the first + partition of an ATA device attached to G1, both over PIO and DMA and then + compares the timing information from both. PIO reads seem to run at about + 3.5 MB/sec, whereas DMA gets around 12.5 MB/sec (quite the improvement). +*/ + +#include <string.h> +#include <stdint.h> +#include <errno.h> + +#include <dc/g1ata.h> + +#include <arch/timer.h> +#include <arch/types.h> + +#include <kos/dbglog.h> +#include <kos/blockdev.h> + +static unsigned char dmabuf[1024 * 512] __attribute__((aligned(32))); +static unsigned char piobuf[1024 * 512] __attribute__((aligned(32))); +static unsigned char tmp[512] __attribute__((aligned(32))); + +int main(int argc, char *argv[]) { + kos_blockdev_t bd_pio, bd_dma; + uint64 spio, epio, sdma, edma, timer; + uint8_t pt; + + dbglog(DBG_DEBUG, "Starting G1 ATA test program...\n"); + g1_ata_init(); + + /* Grab the blockdevs that we'll use to access the partitions. */ + dbglog(DBG_DEBUG, "Looking for first partition...\n"); + if(g1_ata_blockdev_for_partition(0, 0, &bd_pio, &pt)) { + dbglog(DBG_DEBUG, "Couldn't get PIO blockdev for partition!\n"); + return -1; + } + + if(g1_ata_blockdev_for_partition(0, 1, &bd_dma, &pt)) { + dbglog(DBG_DEBUG, "Couldn't get DMA blockdev for partition!\n"); + return -1; + } + + /* For some reason, the first DMA read takes a while... So, read one sector + and discard it so to not mess up the timing stuff below. */ + if(bd_dma.read_blocks(&bd_dma, 1024, 1, tmp)) { + dbglog(DBG_DEBUG, "Couldn't read block 1024 by dma: %s\n", + strerror(errno)); + return -1; + } + + /* Read blocks 0 - 1023 by DMA and print out timing information. */ + dbglog(DBG_DEBUG, "Reading 1024 blocks by DMA!\n"); + + sdma = timer_ms_gettime64(); + if(bd_dma.read_blocks(&bd_dma, 0, 1024, dmabuf)) { + dbglog(DBG_DEBUG, "couldn't read block by DMA: %s\n", strerror(errno)); + return -1; + } + edma = timer_ms_gettime64(); + timer = edma - sdma; + + dbglog(DBG_DEBUG, "DMA read took %llu ms (%f MB/sec)\n", timer, + (512 * 1024) / ((double)timer) / 1000.0); + + /* Read blocks 0 - 1023 by PIO and print out timing information. */ + dbglog(DBG_DEBUG, "Reading 1024 blocks by PIO!\n"); + + spio = timer_ms_gettime64(); + if(bd_pio.read_blocks(&bd_pio, 0, 1024, piobuf)) { + dbglog(DBG_DEBUG, "couldn't read block by PIO: %s\n", strerror(errno)); + return -1; + } + epio = timer_ms_gettime64(); + timer = epio - spio; + + dbglog(DBG_DEBUG, "PIO read took %llu ms (%f MB/sec)\n", timer, + (512 * 1024) / ((double)timer) / 1000.0); + + /* Check the buffers for consistency... */ + if(memcmp(piobuf, dmabuf, 1024 * 512)) { + dbglog(DBG_DEBUG, "Buffers do not match?!\n"); + } + else { + dbglog(DBG_DEBUG, "Both buffers matched!\n"); + } + + /* Clean up... */ + g1_ata_shutdown(); + + return 0; +} hooks/post-receive -- A pseudo Operating System for the Dreamcast.
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 89487109972dec695af7b43c863a4373ab127948 (commit) from e69f473ee66b91d8f06589967b5e0ad3c11c520e (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 89487109972dec695af7b43c863a4373ab127948 Author: Lawrence Sebald <ljs...@us...> Date: Wed Apr 30 21:47:29 2014 -0400 Invalidate the operand cache on dma reads in g1ata. ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/hardware/g1ata.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/kernel/arch/dreamcast/hardware/g1ata.c b/kernel/arch/dreamcast/hardware/g1ata.c index 487a03d..5874bab 100644 --- a/kernel/arch/dreamcast/hardware/g1ata.c +++ b/kernel/arch/dreamcast/hardware/g1ata.c @@ -603,6 +603,9 @@ int g1_ata_read_lba_dma(uint64_t sector, size_t count, uint16_t *buf, return -1; } + /* Invalidate the dcache over the range of the data. */ + dcache_inval_range((uint32)buf, count * 512); + /* Lock the mutex. It will be unlocked later in the IRQ handler. */ if(g1_ata_mutex_lock()) return -1; hooks/post-receive -- A pseudo Operating System for the Dreamcast.
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 e69f473ee66b91d8f06589967b5e0ad3c11c520e (commit) via 728478b3e6874844fd830a26cca469a03a0e4057 (commit) via de6622ee107a577a2d605ec8ef35897b5062e49f (commit) via 45f52f5c60be31be570629e13652a5af7b83c57b (commit) via 934b0206acb04f7568dc0eb17c63c928e90b7a00 (commit) from 0dcf2466b32808a6e5f602654b3c285ed3327336 (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 e69f473ee66b91d8f06589967b5e0ad3c11c520e Author: Lawrence Sebald <ljs...@us...> Date: Wed Apr 30 21:33:33 2014 -0400 Update the CHANGELOG for recent commits. commit 728478b3e6874844fd830a26cca469a03a0e4057 Author: Lawrence Sebald <ljs...@us...> Date: Wed Apr 30 21:32:38 2014 -0400 Fixed raw sector reading of non-data CDs. Thanks to SWAT for pointing out that it needed fixing and pushing me until I fixed it. commit de6622ee107a577a2d605ec8ef35897b5062e49f Author: Lawrence Sebald <ljs...@us...> Date: Wed Apr 30 21:12:51 2014 -0400 Use the versions of GMP, MPC, and MPFR that the GCC developers host and apparently recommend (as their download prereqs script will grab them). This actually fixes an issue I ran into when trying to build a Canadian Cross-compiler. Not that anyone probably will need to worry about that... commit 45f52f5c60be31be570629e13652a5af7b83c57b Author: Lawrence Sebald <ljs...@us...> Date: Wed Apr 30 21:11:57 2014 -0400 Don't change the ata device at the end of a g1ata operation, since the cdrom code will change it if needed now. commit 934b0206acb04f7568dc0eb17c63c928e90b7a00 Author: Lawrence Sebald <ljs...@us...> Date: Wed Apr 30 21:10:41 2014 -0400 Add a few notes to the documentation for the pvr function for loading a kimg. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 5 + kernel/arch/dreamcast/hardware/cdrom.c | 17 +++-- kernel/arch/dreamcast/hardware/g1ata.c | 128 +++++++++++-------------------- kernel/arch/dreamcast/include/dc/pvr.h | 15 ++++- utils/dc-chain/download.sh | 18 ++-- utils/dc-chain/unpack.sh | 6 +- 6 files changed, 88 insertions(+), 101 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 3be8523..23ab722 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -32,6 +32,11 @@ KallistiOS version 2.0.1 ----------------------------------------------- vblank to actually render to the texture [LS] - *** Modified fs_stat to conform (mostly) to the POSIX standard for the stat function [LS] +- DC Modified the cdrom driver so that it will set itself as the active ATA + device before trying to do any CD related reading [LS] +- DC Fixed potential race conditions between the cdrom code and g1ata [LS] +- DC Fixed full sector reading of non-data CDs (thanks to SWAT for pointing out + that it needed fixing) [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/kernel/arch/dreamcast/hardware/cdrom.c b/kernel/arch/dreamcast/hardware/cdrom.c index 7efde54..09e613e 100644 --- a/kernel/arch/dreamcast/hardware/cdrom.c +++ b/kernel/arch/dreamcast/hardware/cdrom.c @@ -34,6 +34,11 @@ output and look to make sure. */ +/* Parts of the a CD-ROM sector to read. These are possible values for the + third parameter word sent with the change data type syscall. */ +#define CDROM_READ_WHOLE_SECTOR 0x1000 +#define CDROM_READ_DATA_AREA 0x2000 + /* GD-Rom BIOS calls... named mostly after Marcus' code. None have more than two parameters; R7 (fourth parameter) needs to describe @@ -221,15 +226,15 @@ int cdrom_reinit() { gdc_get_drv_stat(params); if(sector_size != 2352) { cdxa = params[1] == 32; - params[0] = 0; /* 0 = set, 1 = get */ - params[1] = 8192; /* ? */ - params[2] = cdxa ? 2048 : 1024; /* CD-XA mode 1/2 */ - params[3] = sector_size; /* sector size */ + params[0] = 0; /* 0 = set, 1 = get */ + params[1] = CDROM_READ_DATA_AREA; /* Part of the sector to read */ + params[2] = cdxa ? 2048 : 1024; /* Sector type */ + params[3] = sector_size; /* Sector size */ } else { params[0] = 0; - params[1] = 4096; - params[2] = 1024; + params[1] = CDROM_READ_WHOLE_SECTOR; + params[2] = 0; params[3] = 2352; } diff --git a/kernel/arch/dreamcast/hardware/g1ata.c b/kernel/arch/dreamcast/hardware/g1ata.c index 7f2b4f8..487a03d 100644 --- a/kernel/arch/dreamcast/hardware/g1ata.c +++ b/kernel/arch/dreamcast/hardware/g1ata.c @@ -180,20 +180,6 @@ static inline int use_lba28(uint64_t sector, size_t count) { #define CAN_USE_LBA48() ((device.command_sets & (1 << 26))) -static void g1_dma_irq_hnd(uint32 code) { - /* XXXX: Probably should look at the code to make sure it isn't an error. */ - (void)code; - - /* Signal the calling thread to continue, if it is blocking. */ - if(dma_blocking) { - sem_signal(&dma_done); - thd_schedule(1, 0); - dma_blocking = 0; - } - - dma_in_progress = 0; -} - /* Is a G1 DMA in progress? */ int g1_dma_in_progress(void) { return IN32(G1_ATA_DMA_STATUS); @@ -211,6 +197,23 @@ inline int g1_ata_mutex_unlock(void) { return mutex_unlock(&_g1_ata_mutex); } +static void g1_dma_irq_hnd(uint32 code) { + /* XXXX: Probably should look at the code to make sure it isn't an error. */ + (void)code; + + if(dma_in_progress) { + /* Signal the calling thread to continue, if it is blocking. */ + if(dma_blocking) { + sem_signal(&dma_done); + thd_schedule(1, 0); + dma_blocking = 0; + } + + dma_in_progress = 0; + g1_ata_mutex_unlock(); + } +} + /* Set the device select register to select a particular device. */ uint8_t g1_ata_select_device(uint8_t dev) { uint8_t old = IN8(G1_ATA_DEVICE_SELECT); @@ -291,6 +294,9 @@ static int dma_common(uint8_t cmd, size_t nsects, uint32_t addr, int dir, errno = EIO; return -1; } + + /* Since we're blocking, make sure the drive is completely done. */ + g1_ata_wait_bsydrq(); } return 0; @@ -301,7 +307,6 @@ int g1_ata_read_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, int rv = 0; unsigned int i, j; uint8_t nsects = (uint8_t)count; - uint8_t dsel; /* Make sure that we've been initialized and there's a disk attached. */ if(!devices) { @@ -314,17 +319,13 @@ int g1_ata_read_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, return -1; /* Wait for the device to signal it is ready. */ - g1_ata_wait_nbsy(); - - /* For now, just assume we're accessing the slave device. We don't care - about the primary device, since it should always be the GD-ROM drive. */ - dsel = IN8(G1_ATA_DEVICE_SELECT); + g1_ata_wait_bsydrq(); while(count) { nsects = count > 255 ? 255 : (uint8_t)count; count -= nsects; - OUT8(G1_ATA_DEVICE_SELECT, 0xB0 | (h & 0x0F)); + g1_ata_select_device(G1_ATA_SLAVE | (h & 0x0F)); /* Write out the number of sectors we want as well as the cylinder and sector. */ @@ -372,7 +373,6 @@ int g1_ata_read_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, rv = 0; out: - OUT8(G1_ATA_DEVICE_SELECT, dsel); g1_ata_mutex_unlock(); return rv; @@ -383,7 +383,6 @@ int g1_ata_write_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, int rv = 0; unsigned int i, j; uint8_t nsects = (uint8_t)count; - uint8_t dsel; /* Make sure that we've been initialized and there's a disk attached. */ if(!devices) { @@ -396,17 +395,13 @@ int g1_ata_write_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, return -1; /* Wait for the device to signal it is ready. */ - g1_ata_wait_nbsy(); - - /* For now, just assume we're accessing the slave device. We don't care - about the primary device, since it should always be the GD-ROM drive. */ - dsel = IN8(G1_ATA_DEVICE_SELECT); + g1_ata_wait_bsydrq(); while(count) { nsects = count > 255 ? 255 : (uint8_t)count; count -= nsects; - OUT8(G1_ATA_DEVICE_SELECT, 0xB0 | (h & 0x0F)); + g1_ata_select_device(G1_ATA_SLAVE | (h & 0x0F)); /* Write out the number of sectors we want as well as the cylinder and sector. */ @@ -446,11 +441,10 @@ int g1_ata_write_chs(uint16_t c, uint8_t h, uint8_t s, size_t count, } /* Wait for the device to signal that it has finished writing the data. */ - g1_ata_wait_nbsy(); + g1_ata_wait_bsydrq(); rv = 0; - OUT8(G1_ATA_DEVICE_SELECT, dsel); g1_ata_mutex_unlock(); return rv; @@ -460,7 +454,6 @@ int g1_ata_read_lba(uint64_t sector, size_t count, uint16_t *buf) { int rv = 0; unsigned int i, j; uint8_t nsects = (uint8_t)count; - uint8_t dsel; /* Make sure that we've been initialized and there's a disk attached. */ if(!devices) { @@ -485,11 +478,7 @@ int g1_ata_read_lba(uint64_t sector, size_t count, uint16_t *buf) { return -1; /* Wait for the device to signal it is ready. */ - g1_ata_wait_nbsy(); - - /* For now, just assume we're accessing the slave device. We don't care - about the primary device, since it should always be the GD-ROM drive. */ - dsel = IN8(G1_ATA_DEVICE_SELECT); + g1_ata_wait_bsydrq(); while(count) { nsects = count > 255 ? 255 : (uint8_t)count; @@ -497,7 +486,8 @@ int g1_ata_read_lba(uint64_t sector, size_t count, uint16_t *buf) { /* Which mode are we using: LBA28 or LBA48? */ if((sector + nsects) <= 0x0FFFFFFF) { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0 | ((sector >> 24) & 0x0F)); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE | + ((sector >> 24) & 0x0F)); /* Write out the number of sectors we want and the lower 24-bits of the LBA we're looking for. */ @@ -514,7 +504,7 @@ int g1_ata_read_lba(uint64_t sector, size_t count, uint16_t *buf) { OUT8(G1_ATA_COMMAND_REG, ATA_CMD_READ_SECTORS); } else { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE); /* Write out the number of sectors we want and the LBA. */ OUT8(G1_ATA_SECTOR_COUNT, 0); @@ -554,7 +544,6 @@ int g1_ata_read_lba(uint64_t sector, size_t count, uint16_t *buf) { rv = 0; out: - OUT8(G1_ATA_DEVICE_SELECT, dsel); g1_ata_mutex_unlock(); return rv; @@ -563,7 +552,6 @@ out: int g1_ata_read_lba_dma(uint64_t sector, size_t count, uint16_t *buf, int block) { int rv = 0; - uint8_t dsel; uint32_t addr; int old, can_lba48 = CAN_USE_LBA48(); @@ -615,7 +603,7 @@ int g1_ata_read_lba_dma(uint64_t sector, size_t count, uint16_t *buf, return -1; } - /* Lock the mutex. */ + /* Lock the mutex. It will be unlocked later in the IRQ handler. */ if(g1_ata_mutex_lock()) return -1; @@ -637,15 +625,12 @@ int g1_ata_read_lba_dma(uint64_t sector, size_t count, uint16_t *buf, irq_restore(old); /* Wait for the device to signal it is ready. */ - g1_ata_wait_nbsy(); - - /* For now, just assume we're accessing the slave device. We don't care - about the primary device, since it should always be the GD-ROM drive. */ - dsel = IN8(G1_ATA_DEVICE_SELECT); + g1_ata_wait_bsydrq(); /* Which mode are we using: LBA28 or LBA48? */ if(!can_lba48 || use_lba28(sector, count)) { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0 | ((sector >> 24) & 0x0F)); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE | + ((sector >> 24) & 0x0F)); /* Write out the number of sectors we want and the lower 24-bits of the LBA we're looking for. Note that putting 0 into the sector count @@ -659,7 +644,7 @@ int g1_ata_read_lba_dma(uint64_t sector, size_t count, uint16_t *buf, rv = dma_common(ATA_CMD_READ_DMA, count, addr, G1_DMA_TO_MEMORY, block); } else { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE); /* Write out the number of sectors we want and the LBA. Note that in LBA48 mode, putting 0 into the sector count register returns 65536 @@ -678,9 +663,6 @@ int g1_ata_read_lba_dma(uint64_t sector, size_t count, uint16_t *buf, block); } - OUT8(G1_ATA_DEVICE_SELECT, dsel); - g1_ata_mutex_unlock(); - return rv; } @@ -688,7 +670,6 @@ int g1_ata_write_lba(uint64_t sector, size_t count, const uint16_t *buf) { int rv = 0; unsigned int i, j; uint8_t nsects = (uint8_t)count; - uint8_t dsel; /* Make sure that we've been initialized and there's a disk attached. */ if(!devices) { @@ -713,11 +694,7 @@ int g1_ata_write_lba(uint64_t sector, size_t count, const uint16_t *buf) { return -1; /* Wait for the device to signal it is ready. */ - g1_ata_wait_nbsy(); - - /* For now, just assume we're accessing the slave device. We don't care - about the primary device, since it should always be the GD-ROM drive. */ - dsel = IN8(G1_ATA_DEVICE_SELECT); + g1_ata_wait_bsydrq(); while(count) { nsects = count > 255 ? 255 : (uint8_t)count; @@ -725,7 +702,8 @@ int g1_ata_write_lba(uint64_t sector, size_t count, const uint16_t *buf) { /* Which mode are we using: LBA28 or LBA48? */ if((sector + nsects) <= 0x0FFFFFFF) { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0 | ((sector >> 24) & 0x0F)); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE | + ((sector >> 24) & 0x0F)); /* Write out the number of sectors we want and the lower 24-bits of the LBA we're looking for. */ @@ -738,7 +716,7 @@ int g1_ata_write_lba(uint64_t sector, size_t count, const uint16_t *buf) { OUT8(G1_ATA_COMMAND_REG, ATA_CMD_WRITE_SECTORS); } else { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE); /* Write out the number of sectors we want and the LBA. */ OUT8(G1_ATA_SECTOR_COUNT, 0); @@ -767,11 +745,10 @@ int g1_ata_write_lba(uint64_t sector, size_t count, const uint16_t *buf) { } /* Wait for the device to signal that it has finished writing the data. */ - g1_ata_wait_nbsy(); + g1_ata_wait_bsydrq(); rv = 0; - OUT8(G1_ATA_DEVICE_SELECT, dsel); g1_ata_mutex_unlock(); return rv; @@ -780,7 +757,6 @@ int g1_ata_write_lba(uint64_t sector, size_t count, const uint16_t *buf) { int g1_ata_write_lba_dma(uint64_t sector, size_t count, const uint16_t *buf, int block) { int rv = 0; - uint8_t dsel; uint32_t addr; int old, can_lba48 = CAN_USE_LBA48(); @@ -835,7 +811,7 @@ int g1_ata_write_lba_dma(uint64_t sector, size_t count, const uint16_t *buf, /* Flush the dcache over the range of the data. */ dcache_flush_range((uint32)buf, count * 512); - /* Lock the mutex. */ + /* Lock the mutex. It will be unlocked in the IRQ handler later. */ if(g1_ata_mutex_lock()) return -1; @@ -857,15 +833,12 @@ int g1_ata_write_lba_dma(uint64_t sector, size_t count, const uint16_t *buf, irq_restore(old); /* Wait for the device to signal it is ready. */ - g1_ata_wait_nbsy(); - - /* For now, just assume we're accessing the slave device. We don't care - about the primary device, since it should always be the GD-ROM drive. */ - dsel = IN8(G1_ATA_DEVICE_SELECT); + g1_ata_wait_bsydrq(); /* Which mode are we using: LBA28 or LBA48? */ if(!can_lba48 || use_lba28(sector, count)) { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0 | ((sector >> 24) & 0x0F)); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE | + ((sector >> 24) & 0x0F)); /* Write out the number of sectors we have and the lower 24-bits of the LBA we're looking for. Note that putting 0 into the sector count @@ -880,7 +853,7 @@ int g1_ata_write_lba_dma(uint64_t sector, size_t count, const uint16_t *buf, block); } else { - OUT8(G1_ATA_DEVICE_SELECT, 0xF0); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE); /* Write out the number of sectors we have and the LBA. Note that in LBA48 mode, putting 0 into the sector count register writes 65536 @@ -899,15 +872,10 @@ int g1_ata_write_lba_dma(uint64_t sector, size_t count, const uint16_t *buf, block); } - OUT8(G1_ATA_DEVICE_SELECT, dsel); - g1_ata_mutex_unlock(); - return rv; } int g1_ata_flush(void) { - uint8_t dsel; - /* Make sure that we've been initialized and there's a disk attached. */ if(!devices) { errno = ENXIO; @@ -919,8 +887,7 @@ int g1_ata_flush(void) { return -1; /* Select the slave device. */ - dsel = IN8(G1_ATA_DEVICE_SELECT); - OUT8(G1_ATA_DEVICE_SELECT, 0xF0); + g1_ata_select_device(G1_ATA_SLAVE | G1_ATA_LBA_MODE); timer_spin_sleep(1); /* Flush the disk's write cache to make sure everything gets written out. */ @@ -930,10 +897,7 @@ int g1_ata_flush(void) { OUT8(G1_ATA_COMMAND_REG, ATA_CMD_FLUSH_CACHE); timer_spin_sleep(1); - g1_ata_wait_nbsy(); - - /* Restore the old selected device and return. */ - OUT8(G1_ATA_DEVICE_SELECT, dsel); + g1_ata_wait_bsydrq(); g1_ata_mutex_unlock(); return 0; diff --git a/kernel/arch/dreamcast/include/dc/pvr.h b/kernel/arch/dreamcast/include/dc/pvr.h index 9f8dd1f..f404d7a 100644 --- a/kernel/arch/dreamcast/include/dc/pvr.h +++ b/kernel/arch/dreamcast/include/dc/pvr.h @@ -1839,6 +1839,20 @@ void pvr_txr_load_ex(void * src, pvr_ptr_t dst, uint32 w, uint32 h, uint32 flags \param flags Some set of flags, ORed together. \see pvr_txrload_constants + \note Unless you explicitly tell this function to not + twiddle the texture (by ORing + \ref PVR_TXRLOAD_FMT_NOTWIDDLE or it's equivalent + \ref PVR_TXRLOAD_FMT_TWIDDLED with flags), this + function will twiddle the texture while loading. + Keep that in mind when setting the texture format in + polygon headers later. + \note You cannot specify both + \ref PVR_TXRLOAD_FMT_NOTWIDDLE (or equivalently + \ref PVR_TXRLOAD_FMT_TWIDDLED) and + \ref PVR_TXRLOAD_INVERT_Y in the flags. + \note DMA and Store Queue based loading is not available + from this function if it twiddles the texture while + loading. */ void pvr_txr_load_kimg(kos_img_t *img, pvr_ptr_t dst, uint32 flags); @@ -1960,4 +1974,3 @@ void pvr_dma_shutdown(); __END_DECLS #endif - diff --git a/utils/dc-chain/download.sh b/utils/dc-chain/download.sh index 3c18d76..6f79133 100755 --- a/utils/dc-chain/download.sh +++ b/utils/dc-chain/download.sh @@ -4,9 +4,9 @@ export GCC_VER=4.7.3 export BINUTILS_VER=2.23.2 export NEWLIB_VER=2.0.0 -export GMP_VER=5.1.3 -export MPFR_VER=3.1.2 -export MPC_VER=1.0.1 +export GMP_VER=4.3.2 +export MPFR_VER=2.4.2 +export MPC_VER=0.8.1 while [ "1ドル" != "" ]; do PARAM=`echo 1ドル | awk -F= '{print 1ドル}'` @@ -44,17 +44,17 @@ if command -v wget >/dev/null 2>&1; then if [ -n "$GMP_VER" ]; then echo "Downloading GMP $GMP_VER..." - wget -c ftp://ftp.gnu.org/gnu/gmp/gmp-$GMP_VER.tar.bz2 || exit 1 + wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-$GMP_VER.tar.bz2 || exit 1 fi if [ -n "$MPFR_VER" ]; then echo "Downloading MPFR $MPFR_VER..." - wget -c http://www.mpfr.org/mpfr-current/mpfr-$MPFR_VER.tar.bz2 || exit 1 + wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-$MPFR_VER.tar.bz2 || exit 1 fi if [ -n "$MPC_VER" ]; then echo "Downloading MPC $MPC_VER..." - wget -c http://www.multiprecision.org/mpc/download/mpc-$MPC_VER.tar.gz || exit 1 + wget -c ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-$MPC_VER.tar.gz || exit 1 fi elif command -v curl >/dev/null 2>&1; then echo "Downloading Binutils $BINUTILS_VER..." @@ -66,17 +66,17 @@ elif command -v curl >/dev/null 2>&1; then if [ -n "$GMP_VER" ]; then echo "Downloading GMP $GMP_VER..." - curl -C -O ftp://ftp.gnu.org/gnu/gmp/gmp-$GMP_VER.tar.bz2 || exit 1 + curl -C - -O ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-$GMP_VER.tar.bz2 || exit 1 fi ...<truncated>... hooks/post-receive -- A pseudo Operating System for the Dreamcast.