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
(8) |
Nov
(9) |
Dec
|
|
From: <c99...@us...> - 2006-12-03 03:43:43
|
Revision: 386
http://svn.sourceforge.net/cadcdev/?rev=386&view=rev
Author: c99koder
Date: 2006-12-02 19:43:41 -0800 (Sat, 02 Dec 2006)
Log Message:
-----------
Tiki: SDL: Add F-key constants and fix a bug sending the modifier keys
Modified Paths:
--------------
tiki/sdl/src/init_shutdown.cpp
tiki/sdl/src/plathid.cpp
Modified: tiki/sdl/src/init_shutdown.cpp
===================================================================
--- tiki/sdl/src/init_shutdown.cpp 2006-11-26 01:59:05 UTC (rev 385)
+++ tiki/sdl/src/init_shutdown.cpp 2006-12-03 03:43:41 UTC (rev 386)
@@ -29,7 +29,7 @@
return false;
}
- dev = alcOpenDevice((ALubyte *)"sdl");
+ dev = alcOpenDevice("sdl");
if(dev == NULL)
{
fprintf(stderr, "Unable to initialize OpenAL: %s\n", alGetError());
@@ -44,6 +44,7 @@
else
{
alcMakeContextCurrent(context);
+ alcProcessContext(context);
alutInit(&argc, argv);
Audio::Sound::initGlobal();
Audio::Stream::initGlobal();
Modified: tiki/sdl/src/plathid.cpp
===================================================================
--- tiki/sdl/src/plathid.cpp 2006-11-26 01:59:05 UTC (rev 385)
+++ tiki/sdl/src/plathid.cpp 2006-12-03 03:43:41 UTC (rev 386)
@@ -185,6 +185,30 @@
return Event::KeyPgdn;
case SDLK_ESCAPE:
return Event::KeyEsc;
+ case SDLK_F1:
+ return Event::KeyF1;
+ case SDLK_F2:
+ return Event::KeyF2;
+ case SDLK_F3:
+ return Event::KeyF3;
+ case SDLK_F4:
+ return Event::KeyF4;
+ case SDLK_F5:
+ return Event::KeyF5;
+ case SDLK_F6:
+ return Event::KeyF6;
+ case SDLK_F7:
+ return Event::KeyF7;
+ case SDLK_F8:
+ return Event::KeyF8;
+ case SDLK_F9:
+ return Event::KeyF9;
+ case SDLK_F10:
+ return Event::KeyF10;
+ case SDLK_F11:
+ return Event::KeyF11;
+ case SDLK_F12:
+ return Event::KeyF12;
default:
return key;
}
@@ -231,6 +255,7 @@
Event evtPress(Event::EvtKeypress);
evtPress.dev = SDLkb;
evtPress.key = translateSym(events[i].key.keysym.sym);
+ evtPress.mod = mod;
sendEvent(evtPress);
//Debug::printf("HID:KB: KEYDOWN: %d\n", evt.key);
} else {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <c99...@us...> - 2006-11-26 01:59:08
|
Revision: 385
http://svn.sourceforge.net/cadcdev/?rev=385&view=rev
Author: c99koder
Date: 2006-11-25 17:59:05 -0800 (Sat, 25 Nov 2006)
Log Message:
-----------
Tiki: Mac OS X: Pass argc,argv onto tiki_main. Append the document passed by Finder onto argv (see tikitest's controller for example). Output argc,argv in TikiTest.
Modified Paths:
--------------
tiki/examples/TikiTest/src/Controller.h
tiki/examples/TikiTest/src/Controller.m
tiki/examples/TikiTest/src/test.cpp
tiki/osx/include/Tiki/TikiMain.h
tiki/osx/include/Tiki/tikitypes.h
tiki/osx/src/TikiMain.m
tiki/osx/src/init_shutdown.cpp
Modified: tiki/examples/TikiTest/src/Controller.h
===================================================================
--- tiki/examples/TikiTest/src/Controller.h 2006-11-25 20:53:55 UTC (rev 384)
+++ tiki/examples/TikiTest/src/Controller.h 2006-11-26 01:59:05 UTC (rev 385)
@@ -9,5 +9,6 @@
IBOutlet NSWindow *mainWindow;
TikiMain * tm;
+ NSString * openFileName;
}
@end
Modified: tiki/examples/TikiTest/src/Controller.m
===================================================================
--- tiki/examples/TikiTest/src/Controller.m 2006-11-25 20:53:55 UTC (rev 384)
+++ tiki/examples/TikiTest/src/Controller.m 2006-11-26 01:59:05 UTC (rev 385)
@@ -5,12 +5,16 @@
void tiki_main();
@implementation Controller
+- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
+{
+ openFileName = filename;
+}
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
TikiMain * otm = [[TikiMain alloc] retain];
tm = otm;
- [tm doMainWithWindow: mainWindow andView: mainView andMainFunc: tiki_main];
+ [tm doMainWithWindow: mainWindow andView: mainView andMainFunc: tiki_main andOpenFile:openFileName];
tm = nil;
[otm release];
}
Modified: tiki/examples/TikiTest/src/test.cpp
===================================================================
--- tiki/examples/TikiTest/src/test.cpp 2006-11-25 20:53:55 UTC (rev 384)
+++ tiki/examples/TikiTest/src/test.cpp 2006-11-26 01:59:05 UTC (rev 385)
@@ -240,6 +240,11 @@
Tiki::GL::showCursor(false);
Hid::callbackReg(tkCallback, NULL);
+ Debug::printf("argc: %i\n", argc);
+ for(int i=0; i<argc; i++) {
+ Debug::printf("argv[%i]: %s\n",i,argv[i]);
+ }
+
#if TIKI_PLAT != TIKI_DC
//Attach events happen before we start :(
mp[0].valid=1;
Modified: tiki/osx/include/Tiki/TikiMain.h
===================================================================
--- tiki/osx/include/Tiki/TikiMain.h 2006-11-25 20:53:55 UTC (rev 384)
+++ tiki/osx/include/Tiki/TikiMain.h 2006-11-26 01:59:05 UTC (rev 385)
@@ -19,10 +19,15 @@
NSView * mainView;
pthread_t glThreadHnd;
void (*mainFunc)(int, char**);
+ NSString * openFile;
}
- (void) doMainWithWindow: (NSWindow *)mainWindow andView: (NSView *)mainView
andMainFunc: (void (*)(int, char**))mainFunc;
+
+- (void) doMainWithWindow: (NSWindow *)mainWindow andView: (NSView *)mainView
+ andMainFunc: (void (*)(int, char**))mainFunc andOpenFile: (NSString *)openFile;
+
- (void) quitSoon;
@end
Modified: tiki/osx/include/Tiki/tikitypes.h
===================================================================
--- tiki/osx/include/Tiki/tikitypes.h 2006-11-25 20:53:55 UTC (rev 384)
+++ tiki/osx/include/Tiki/tikitypes.h 2006-11-26 01:59:05 UTC (rev 385)
@@ -17,6 +17,8 @@
#define TIKI_WIN32 1
#define TIKI_SDL 2
#define TIKI_DC 3
+#define TIKI_GP2X 4
+#define TIKI_NDS 5
#define TIKI_PLAT TIKI_OSX
namespace Tiki {
Modified: tiki/osx/src/TikiMain.m
===================================================================
--- tiki/osx/src/TikiMain.m 2006-11-25 20:53:55 UTC (rev 384)
+++ tiki/osx/src/TikiMain.m 2006-11-26 01:59:05 UTC (rev 385)
@@ -69,16 +69,23 @@
}
@implementation TikiMain
+- (void) doMainWithWindow: (NSWindow *)iMainWindow andView: (NSView *)iMainView
+ andMainFunc: (void (*)(int, char**))iMainFunc
+{
+
+ [self doMainWithWindow:iMainWindow andView:iMainView andMainFunc:iMainFunc andOpenFile: nil];
+}
- (void) doMainWithWindow: (NSWindow *)iMainWindow andView: (NSView *)iMainView
- andMainFunc: (void (*)(int, char**))iMainFunc;
+ andMainFunc: (void (*)(int, char**))iMainFunc andOpenFile: (NSString *)iOpenFile
{
width = targetW;
height = targetH;
mainWindow = iMainWindow;
mainView = iMainView;
mainFunc = iMainFunc;
-
+ openFile = iOpenFile;
+
[mainWindow makeKeyAndOrderFront:nil];
[mainWindow makeFirstResponder:mainView];
[mainWindow setAcceptsMouseMovedEvents:true];
@@ -265,10 +272,32 @@
tiki_scene_finish_hook();
- // XXX get args in here
assert( mainFunc );
- mainFunc(0, NULL);
+ NSArray *args;
+ if(openFile != nil)
+ args = [[[NSProcessInfo processInfo] arguments] arrayByAddingObject:openFile];
+ else
+ args = [[NSProcessInfo processInfo] arguments];
+
+ int argc = [args count];
+
+ if(argc > 0) {
+ char ** argv = malloc(sizeof(char*) * argc);
+ NSString *arg;
+
+ for(int i = 0; i < argc; i++) {
+ arg = [args objectAtIndex: i];
+ argv[i] = malloc([arg length] + 2);
+ strncpy(argv[i],[arg cString],[arg cStringLength]);
+ argv[i][[arg cStringLength]] = '\0';
+ }
+ mainFunc(argc, argv);
+ } else {
+ mainFunc(0, NULL);
+ }
+
+
NSLog(@"glThread exiting");
[NSApp terminate: self];
Modified: tiki/osx/src/init_shutdown.cpp
===================================================================
--- tiki/osx/src/init_shutdown.cpp 2006-11-25 20:53:55 UTC (rev 384)
+++ tiki/osx/src/init_shutdown.cpp 2006-11-26 01:59:05 UTC (rev 385)
@@ -11,9 +11,11 @@
#include <CoreFoundation/CFString.h>
#if TIKI_PLAT == TIKI_OSX
-# include <OpenAL/alut.h>
+# include <OpenAL/al.h>
+# include <OpenAL/alc.h>
#else
-# include <alut.h>
+# include <al.h>
+# include <alc.h>
#endif
#include "Tiki/sound.h"
@@ -27,7 +29,17 @@
namespace Tiki {
bool init(int argc, char **argv) {
- alutInit(&argc, argv);
+ ALCdevice *dev = NULL;
+ ALCcontext *ctx = NULL;
+
+ dev = alcOpenDevice(getenv("OPENAL_DEVICE")); // getenv()==NULL is okay.
+ if (dev != NULL) {
+ ctx = alcCreateContext(dev, 0);
+ if (ctx != NULL) {
+ alcMakeContextCurrent(ctx);
+ alcProcessContext(ctx);
+ } // if
+ } // if
Audio::Sound::initGlobal();
Audio::Stream::initGlobal();
@@ -42,7 +54,7 @@
Audio::Stream::shutdownGlobal();
Hid::shutdown();
- alutExit();
+ //alutExit();
}
void setName(const char *windowName, const char *icon) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <c99...@us...> - 2006-11-25 20:54:00
|
Revision: 384
http://svn.sourceforge.net/cadcdev/?rev=384&view=rev
Author: c99koder
Date: 2006-11-25 12:53:55 -0800 (Sat, 25 Nov 2006)
Log Message:
-----------
Tiki: win32: don't close window until process actually ends (like Mac OS X), make sure main thread terminates when GameThread does so the process actually quits on win32
Modified Paths:
--------------
tiki/win32/src/platgl.cpp
Modified: tiki/win32/src/platgl.cpp
===================================================================
--- tiki/win32/src/platgl.cpp 2006-11-24 17:38:32 UTC (rev 383)
+++ tiki/win32/src/platgl.cpp 2006-11-25 20:53:55 UTC (rev 384)
@@ -103,7 +103,7 @@
m_hThread = CreateThread(NULL, 0, GameThread, lpCmdLine, 0, &m_dwThreadID);
- while(GetMessage(&msg, NULL, 0, 0))
+ while(m_hThread != NULL && GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
@@ -131,9 +131,11 @@
case WM_RBUTTONUP:
Tiki::RecvEvent(iMsg, wParam, lParam);
break;
-
+ case WM_CLOSE:
+ Tiki::RecvQuit();
+ return 0;
+ break;
case WM_DESTROY:
- Tiki::RecvQuit();
DestroyApplication();
PostQuitMessage(0);
break;
@@ -224,6 +226,7 @@
if(!CloseHandle(m_hThread))
ErrorBox("Couldn't terminate game thread.");
+ m_hThread = NULL;
Tiki::shutdown();
return TRUE;
@@ -275,7 +278,7 @@
wglDeleteContext(m_hThreadRc);
ReleaseDC(m_hWndMain, m_hThreadDc);
m_hThreadDc = NULL;
-
+ m_hThread = NULL;
Debug::printf( "GameThread exiting\n" );
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-11-24 17:39:38
|
Revision: 383
http://svn.sourceforge.net/cadcdev/?rev=383&view=rev
Author: bardtx
Date: 2006-11-24 09:38:32 -0800 (Fri, 24 Nov 2006)
Log Message:
-----------
Fix commented out paths in dc-chain (thanks Christian Henz)
Modified Paths:
--------------
kos/utils/dc-chain/Makefile
Modified: kos/utils/dc-chain/Makefile
===================================================================
--- kos/utils/dc-chain/Makefile 2006-11-12 23:27:53 UTC (rev 382)
+++ kos/utils/dc-chain/Makefile 2006-11-24 17:38:32 UTC (rev 383)
@@ -71,15 +71,12 @@
# ---- build {{{
build: build-sh4 build-arm
-# build-sh4: build-sh4-binutils build-sh4-gcc
-build-sh4: build-sh4-gcc
+build-sh4: build-sh4-binutils build-sh4-gcc
build-arm: build-arm-binutils build-arm-gcc
-# build-sh4-gcc: build-sh4-gcc-pass1 build-sh4-newlib build-sh4-gcc-pass2
-build-sh4-gcc: build-sh4-newlib build-sh4-gcc-pass2
+build-sh4-gcc: build-sh4-gcc-pass1 build-sh4-newlib build-sh4-gcc-pass2
build-arm-gcc: build-arm-gcc-pass1
$(clean_arm_hack)
-#build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib
-build-sh4-newlib: fixup-sh4-newlib
+build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib
# Ensure that, no matter where we enter, prefix and target are set correctly.
build_sh4_targets=build-sh4-binutils build-sh4-gcc build-sh4-gcc-pass1 build-sh4-newlib build-sh4-newlib-only build-sh4-gcc-pass2
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <c99...@us...> - 2006-11-13 22:54:16
|
Revision: 381
http://svn.sourceforge.net/cadcdev/?rev=381&view=rev
Author: c99koder
Date: 2006-11-12 15:27:11 -0800 (Sun, 12 Nov 2006)
Log Message:
-----------
Add console drawable to win32 project file
Modified Paths:
--------------
tiki/win32/tiki.vcproj
Modified: tiki/win32/tiki.vcproj
===================================================================
--- tiki/win32/tiki.vcproj 2006-11-12 23:01:37 UTC (rev 380)
+++ tiki/win32/tiki.vcproj 2006-11-12 23:27:11 UTC (rev 381)
@@ -20,7 +20,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="include;../include;../3rdparty/libpng;../3rdparty/zlib;../3rdparty/libjpeg;../3rdparty/libogg/include;../3rdparty/libvorbis/include;C:\OpenAL\include"
+ AdditionalIncludeDirectories="include;../include;../3rdparty/libpng;../3rdparty/zlib;../3rdparty/libjpeg;../3rdparty/libogg/include;../3rdparty/libvorbis/include;"C:\Program Files\OpenAL 1.1 SDK\include""
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -62,7 +62,7 @@
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
- AdditionalIncludeDirectories="include;../include;../3rdparty/libpng;../3rdparty/zlib;../3rdparty/libjpeg;../3rdparty/libogg/include;../3rdparty/libvorbis/include;C:\OpenAL\include"
+ AdditionalIncludeDirectories="include;../include;../3rdparty/libpng;../3rdparty/zlib;../3rdparty/libjpeg;../3rdparty/libogg/include;../3rdparty/libvorbis/include;"C:\Program Files\OpenAL 1.1 SDK\include""
RuntimeLibrary="0"
UsePrecompiledHeader="3"
PrecompiledHeaderThrough="pch.h"
@@ -219,6 +219,9 @@
RelativePath="..\src\gl\drawables\banner.cpp">
</File>
<File
+ RelativePath="..\src\gl\drawables\console.cpp">
+ </File>
+ <File
RelativePath="..\src\gl\drawables\cursor.cpp">
</File>
<File
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <c99...@us...> - 2006-11-13 22:38:20
|
Revision: 380
http://svn.sourceforge.net/cadcdev/?rev=380&view=rev
Author: c99koder
Date: 2006-11-12 15:01:37 -0800 (Sun, 12 Nov 2006)
Log Message:
-----------
Add F-key constants
Modified Paths:
--------------
tiki/include/Tiki/hid.h
tiki/osx/src/plathid.mm
Modified: tiki/include/Tiki/hid.h
===================================================================
--- tiki/include/Tiki/hid.h 2006-10-19 00:20:31 UTC (rev 379)
+++ tiki/include/Tiki/hid.h 2006-11-12 23:01:37 UTC (rev 380)
@@ -78,6 +78,18 @@
KeyDelete,
KeyPgup,
KeyPgdn,
+ KeyF1,
+ KeyF2,
+ KeyF3,
+ KeyF4,
+ KeyF5,
+ KeyF6,
+ KeyF7,
+ KeyF8,
+ KeyF9,
+ KeyF10,
+ KeyF11,
+ KeyF12,
KeyUnknown,
KeySentinel
};
Modified: tiki/osx/src/plathid.mm
===================================================================
--- tiki/osx/src/plathid.mm 2006-10-19 00:20:31 UTC (rev 379)
+++ tiki/osx/src/plathid.mm 2006-11-12 23:01:37 UTC (rev 380)
@@ -84,6 +84,30 @@
return Event::KeyPgup;
case NSPageDownFunctionKey:
return Event::KeyPgdn;
+ case NSF1FunctionKey:
+ return Event::KeyF1;
+ case NSF2FunctionKey:
+ return Event::KeyF2;
+ case NSF3FunctionKey:
+ return Event::KeyF3;
+ case NSF4FunctionKey:
+ return Event::KeyF4;
+ case NSF5FunctionKey:
+ return Event::KeyF5;
+ case NSF6FunctionKey:
+ return Event::KeyF6;
+ case NSF7FunctionKey:
+ return Event::KeyF7;
+ case NSF8FunctionKey:
+ return Event::KeyF8;
+ case NSF9FunctionKey:
+ return Event::KeyF9;
+ case NSF10FunctionKey:
+ return Event::KeyF10;
+ case NSF11FunctionKey:
+ return Event::KeyF11;
+ case NSF12FunctionKey:
+ return Event::KeyF12;
default:
return -1;
}
@@ -178,7 +202,7 @@
unichar c = [chs characterAtIndex: i];
int ch;
- if ((c & 0xff00) == (NSUpArrowFunctionKey & 0xff00) || c == 27) {
+ if ((c & 0xff00) == (NSUpArrowFunctionKey & 0xff00) || c == 27 || (c >= NSF1FunctionKey && c <= NSF12FunctionKey)) {
ch = translateFn(c);
if (ch < 0)
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <c99...@us...> - 2006-11-13 22:38:03
|
Revision: 382
http://svn.sourceforge.net/cadcdev/?rev=382&view=rev
Author: c99koder
Date: 2006-11-12 15:27:53 -0800 (Sun, 12 Nov 2006)
Log Message:
-----------
Tiki: Send F-key constants on win32
Modified Paths:
--------------
tiki/win32/src/plathid.cpp
Modified: tiki/win32/src/plathid.cpp
===================================================================
--- tiki/win32/src/plathid.cpp 2006-11-12 23:27:11 UTC (rev 381)
+++ tiki/win32/src/plathid.cpp 2006-11-12 23:27:53 UTC (rev 382)
@@ -78,7 +78,42 @@
case VK_DELETE:
outkey = Event::KeyDelete;
break;
-
+ case VK_F1:
+ outkey = Event::KeyF1;
+ break;
+ case VK_F2:
+ outkey = Event::KeyF2;
+ break;
+ case VK_F3:
+ outkey = Event::KeyF3;
+ break;
+ case VK_F4:
+ outkey = Event::KeyF4;
+ break;
+ case VK_F5:
+ outkey = Event::KeyF5;
+ break;
+ case VK_F6:
+ outkey = Event::KeyF6;
+ break;
+ case VK_F7:
+ outkey = Event::KeyF7;
+ break;
+ case VK_F8:
+ outkey = Event::KeyF8;
+ break;
+ case VK_F9:
+ outkey = Event::KeyF9;
+ break;
+ case VK_F10:
+ outkey = Event::KeyF10;
+ break;
+ case VK_F11:
+ outkey = Event::KeyF11;
+ break;
+ case VK_F12:
+ outkey = Event::KeyF12;
+ break;
default:
outkey = (int)MapVirtualKey((UINT)key, 2);
if (outkey >= 'A' && outkey <= 'Z') {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ljs...@us...> - 2006-10-19 00:21:22
|
Revision: 379
http://svn.sourceforge.net/cadcdev/?rev=379&view=rev
Author: ljsebald
Date: 2006-10-18 17:20:31 -0700 (Wed, 18 Oct 2006)
Log Message:
-----------
Committing two fixes to the sockets and related code:
- net_udp.c: Only try to destroy the mutex/condvar if they were created.
- fs_socket.c: Fix a stupid problem that broke all other filesystems if
fs_socket was initialized.
Modified Paths:
--------------
kos/kernel/fs/fs_socket.c
kos/kernel/net/net_udp.c
Modified: kos/kernel/fs/fs_socket.c
===================================================================
--- kos/kernel/fs/fs_socket.c 2006-09-18 04:25:42 UTC (rev 378)
+++ kos/kernel/fs/fs_socket.c 2006-10-19 00:20:31 UTC (rev 379)
@@ -50,7 +50,7 @@
static vfs_handler_t vh = {
/* Name handler */
{
- { 0 }, /* Name */
+ "/sock", /* Name */
0, /* tbfi */
0x00010000, /* Version 1.0 */
0, /* Flags */
Modified: kos/kernel/net/net_udp.c
===================================================================
--- kos/kernel/net/net_udp.c 2006-09-18 04:25:42 UTC (rev 378)
+++ kos/kernel/net/net_udp.c 2006-10-19 00:20:31 UTC (rev 379)
@@ -42,8 +42,8 @@
LIST_HEAD(udp_sock_list, udp_sock);
static struct udp_sock_list net_udp_sockets = LIST_HEAD_INITIALIZER(0);
-static mutex_t *udp_mutex;
-static condvar_t *udp_packets_ready;
+static mutex_t *udp_mutex = NULL;
+static condvar_t *udp_packets_ready = NULL;
int net_udp_accept(net_socket_t *hnd, struct sockaddr *addr,
socklen_t *addr_len) {
@@ -677,6 +677,8 @@
if(udp_packets_ready == NULL) {
mutex_destroy(udp_mutex);
+ udp_mutex = NULL;
+
return -1;
}
@@ -684,6 +686,9 @@
}
void net_udp_shutdown() {
- mutex_destroy(udp_mutex);
- cond_destroy(udp_packets_ready);
+ if(udp_mutex != NULL)
+ mutex_destroy(udp_mutex);
+
+ if(udp_packets_ready != NULL)
+ cond_destroy(udp_packets_ready);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 04:25:48
|
Revision: 378
http://svn.sourceforge.net/cadcdev/?rev=378&view=rev
Author: bardtx
Date: 2006-09-17 21:25:42 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
dcload: Apply Patch #1279622 from SourceForge, for both dcloads:
Fixes link errors using a libbfd from binutils 2.16.1
Modified Paths:
--------------
dcload/dcload-ip/host-src/tool/Makefile
dcload/dcload-serial/host-src/tool/Makefile
Added Paths:
-----------
dcload/dcload-ip/host-src/tool/unlink.c
dcload/dcload-serial/host-src/tool/unlink.c
Modified: dcload/dcload-ip/host-src/tool/Makefile
===================================================================
--- dcload/dcload-ip/host-src/tool/Makefile 2006-09-18 04:19:51 UTC (rev 377)
+++ dcload/dcload-ip/host-src/tool/Makefile 2006-09-18 04:25:42 UTC (rev 378)
@@ -6,7 +6,7 @@
DCTOOL = dc-tool$(EXECUTABLEEXTENSION)
-OBJECTS = dc-tool.o syscalls.o
+OBJECTS = dc-tool.o syscalls.o unlink.o
.c.o:
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
Added: dcload/dcload-ip/host-src/tool/unlink.c
===================================================================
--- dcload/dcload-ip/host-src/tool/unlink.c (rev 0)
+++ dcload/dcload-ip/host-src/tool/unlink.c 2006-09-18 04:25:42 UTC (rev 378)
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifndef S_ISLNK
+#ifdef S_IFLNK
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#else
+#define S_ISLNK(m) 0
+#define lstat stat
+#endif
+#endif
+
+int
+unlink_if_ordinary (const char *name)
+{
+ struct stat st;
+
+ if (lstat (name, &st) == 0
+ && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
+ return unlink (name);
+
+ return 1;
+}
Modified: dcload/dcload-serial/host-src/tool/Makefile
===================================================================
--- dcload/dcload-serial/host-src/tool/Makefile 2006-09-18 04:19:51 UTC (rev 377)
+++ dcload/dcload-serial/host-src/tool/Makefile 2006-09-18 04:25:42 UTC (rev 378)
@@ -8,7 +8,7 @@
DCTOOL = dc-tool$(EXECUTABLEEXTENSION)
-OBJECTS = dc-tool.o minilzo.o syscalls.o
+OBJECTS = dc-tool.o minilzo.o syscalls.o unlink.o
LZOFILES = $(LZOPATH)/minilzo.c $(LZOPATH)/minilzo.h $(LZOPATH)/lzoconf.h
.c.o:
Added: dcload/dcload-serial/host-src/tool/unlink.c
===================================================================
--- dcload/dcload-serial/host-src/tool/unlink.c (rev 0)
+++ dcload/dcload-serial/host-src/tool/unlink.c 2006-09-18 04:25:42 UTC (rev 378)
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifndef S_ISLNK
+#ifdef S_IFLNK
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#else
+#define S_ISLNK(m) 0
+#define lstat stat
+#endif
+#endif
+
+int
+unlink_if_ordinary (const char *name)
+{
+ struct stat st;
+
+ if (lstat (name, &st) == 0
+ && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
+ return unlink (name);
+
+ return 1;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 04:19:53
|
Revision: 377
http://svn.sourceforge.net/cadcdev/?rev=377&view=rev
Author: bardtx
Date: 2006-09-17 21:19:51 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
dcload-serial: Add -R .stack to objcopy
Modified Paths:
--------------
dcload/dcload-serial/target-src/dcload/Makefile
Modified: dcload/dcload-serial/target-src/dcload/Makefile
===================================================================
--- dcload/dcload-serial/target-src/dcload/Makefile 2006-09-18 04:16:29 UTC (rev 376)
+++ dcload/dcload-serial/target-src/dcload/Makefile 2006-09-18 04:19:51 UTC (rev 377)
@@ -27,7 +27,7 @@
$(LZO) $< $@
dcload.bin: dcload
- $(OBJCOPY) -O binary $< $@
+ $(OBJCOPY) -R .stack -O binary $< $@
dcload: $(DCLOBJECTS)
$(CC) $(CFLAGS) -Wl,-Tdcload.x -nostartfiles -nostdlib $^ -o $@ -lgcc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 04:16:33
|
Revision: 376
http://svn.sourceforge.net/cadcdev/?rev=376&view=rev
Author: bardtx
Date: 2006-09-17 21:16:29 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
dcload-ip: Apply Christian's bfd fix, and make objcopy use -R .stack
Modified Paths:
--------------
dcload/dcload-ip/host-src/tool/dc-tool.c
dcload/dcload-ip/target-src/dcload/Makefile
Modified: dcload/dcload-ip/host-src/tool/dc-tool.c
===================================================================
--- dcload/dcload-ip/host-src/tool/dc-tool.c 2006-09-18 01:10:18 UTC (rev 375)
+++ dcload/dcload-ip/host-src/tool/dc-tool.c 2006-09-18 04:16:29 UTC (rev 376)
@@ -446,13 +446,13 @@
if ((section->flags & SEC_HAS_CONTENTS) && (section->flags & SEC_LOAD)) {
printf("Section %s, ",section->name);
printf("lma 0x%x, ",section->lma);
- printf("size %d\n",section->size);
- if (section->size) {
- size += section->size;
- inbuf = malloc(section->size);
- bfd_get_section_contents(somebfd, section, inbuf, 0, section->size);
+ printf("size %d\n",section->_raw_size);
+ if (section->_raw_size) {
+ size += section->_raw_size;
+ inbuf = malloc(section->_raw_size);
+ bfd_get_section_contents(somebfd, section, inbuf, 0, section->_raw_size);
- send_data(inbuf, section->lma, section->size);
+ send_data(inbuf, section->lma, section->_raw_size);
free(inbuf);
}
Modified: dcload/dcload-ip/target-src/dcload/Makefile
===================================================================
--- dcload/dcload-ip/target-src/dcload/Makefile 2006-09-18 01:10:18 UTC (rev 375)
+++ dcload/dcload-ip/target-src/dcload/Makefile 2006-09-18 04:16:29 UTC (rev 376)
@@ -16,7 +16,7 @@
%.o : %.S
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
%.bin: %
- $(OBJCOPY) -O binary $< $@
+ $(OBJCOPY) -R .stack -O binary $< $@
all: dcload.bin exception.bin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 01:10:21
|
Revision: 375
http://svn.sourceforge.net/cadcdev/?rev=375&view=rev
Author: bardtx
Date: 2006-09-17 18:10:18 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Don't try to shutdown net if it wasn't initted; causes crash in
net_udp code
Modified Paths:
--------------
kos/kernel/arch/dreamcast/kernel/init.c
Modified: kos/kernel/arch/dreamcast/kernel/init.c
===================================================================
--- kos/kernel/arch/dreamcast/kernel/init.c 2006-09-18 01:09:42 UTC (rev 374)
+++ kos/kernel/arch/dreamcast/kernel/init.c 2006-09-18 01:10:18 UTC (rev 375)
@@ -133,7 +133,9 @@
snd_shutdown();
timer_shutdown();
hardware_shutdown();
- net_shutdown();
+ if (__kos_init_flags & INIT_NET) {
+ net_shutdown();
+ }
pvr_shutdown();
library_shutdown();
fs_dcload_shutdown();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 01:09:44
|
Revision: 374
http://svn.sourceforge.net/cadcdev/?rev=374&view=rev
Author: bardtx
Date: 2006-09-17 18:09:42 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: realpath() is using the wrong getcwd()... need to fix in newlib probably
Modified Paths:
--------------
kos/kernel/libc/koslib/realpath.c
Modified: kos/kernel/libc/koslib/realpath.c
===================================================================
--- kos/kernel/libc/koslib/realpath.c 2006-09-18 00:45:21 UTC (rev 373)
+++ kos/kernel/libc/koslib/realpath.c 2006-09-18 01:09:42 UTC (rev 374)
@@ -62,10 +62,11 @@
resolved_len = 1;
left_len = strlcpy(left, path + 1, sizeof(left));
} else {
- if (getcwd(resolved, PATH_MAX) == NULL) {
+ /* if (getcwd(resolved, PATH_MAX) == NULL) {
strlcpy(resolved, ".", PATH_MAX);
return (NULL);
- }
+ } */
+ strcpy(resolved, fs_getwd());
resolved_len = strlen(resolved);
left_len = strlcpy(left, path, sizeof(left));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:45:27
|
Revision: 373
http://svn.sourceforge.net/cadcdev/?rev=373&view=rev
Author: bardtx
Date: 2006-09-17 17:45:21 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Revert limits.h change earlier.. breaks other stuff
Modified Paths:
--------------
kos/kernel/libc/koslib/realpath.c
Removed Paths:
-------------
kos/include/limits.h
Deleted: kos/include/limits.h
===================================================================
--- kos/include/limits.h 2006-09-18 00:31:09 UTC (rev 372)
+++ kos/include/limits.h 2006-09-18 00:45:21 UTC (rev 373)
@@ -1,13 +0,0 @@
-/* KallistiOS ##version##
-
- limits.h
- Copyright (C)2006 Dan Potter
-
-*/
-
-#ifndef __LIMITS_H
-#define __LIMITS_H
-
-#include <kos/limits.h>
-
-#endif /* __LIMITS_H */
Modified: kos/kernel/libc/koslib/realpath.c
===================================================================
--- kos/kernel/libc/koslib/realpath.c 2006-09-18 00:31:09 UTC (rev 372)
+++ kos/kernel/libc/koslib/realpath.c 2006-09-18 00:45:21 UTC (rev 373)
@@ -30,6 +30,7 @@
#include <sys/param.h>
#include <sys/stat.h>
+#include <kos/limits.h>
#include <errno.h>
#include <stdlib.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:31:13
|
Revision: 372
http://svn.sourceforge.net/cadcdev/?rev=372&view=rev
Author: bardtx
Date: 2006-09-17 17:31:09 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos-ports: Add GL_FRONT_AND_BACK constant
Modified Paths:
--------------
kos-ports/include/GL/gl.h
Modified: kos-ports/include/GL/gl.h
===================================================================
--- kos-ports/include/GL/gl.h 2006-09-18 00:29:43 UTC (rev 371)
+++ kos-ports/include/GL/gl.h 2006-09-18 00:31:09 UTC (rev 372)
@@ -102,6 +102,7 @@
#define GL_CULL_FACE 0x0B44
#define GL_FRONT 0x0404
#define GL_BACK 0x0405
+#define GL_FRONT_AND_BACK 0x0408
/* Scissor box */
#define GL_SCISSOR_TEST 0x0008 /* capability bit */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:29:46
|
Revision: 371
http://svn.sourceforge.net/cadcdev/?rev=371&view=rev
Author: bardtx
Date: 2006-09-17 17:29:43 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Add OSX build stuff to vqenc makefile
Modified Paths:
--------------
kos/utils/vqenc/Makefile
Modified: kos/utils/vqenc/Makefile
===================================================================
--- kos/utils/vqenc/Makefile 2006-09-18 00:27:58 UTC (rev 370)
+++ kos/utils/vqenc/Makefile 2006-09-18 00:29:43 UTC (rev 371)
@@ -1,6 +1,11 @@
# Makefile for the genromfs program.
+# Use for OSX w/Fink
+#CFLAGS = -O2 -Wall -DINLINE=inline -I/sw/include #-g#
+#LDFLAGS = -s -L/sw/lib -lpng -ljpeg -lz #-g
+
+# Use for other systems
CFLAGS = -O2 -Wall -DINLINE=inline #-g#
LDFLAGS = -s -lpng -ljpeg -lz #-g
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:28:05
|
Revision: 370
http://svn.sourceforge.net/cadcdev/?rev=370&view=rev
Author: bardtx
Date: 2006-09-17 17:27:58 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Add execve() stub
Modified Paths:
--------------
kos/kernel/libc/newlib/Makefile
Added Paths:
-----------
kos/kernel/libc/newlib/newlib_execve.c
Modified: kos/kernel/libc/newlib/Makefile
===================================================================
--- kos/kernel/libc/newlib/Makefile 2006-09-18 00:26:35 UTC (rev 369)
+++ kos/kernel/libc/newlib/Makefile 2006-09-18 00:27:58 UTC (rev 370)
@@ -13,6 +13,7 @@
#
OBJS = lock_common.o newlib_close.o newlib_env_lock.o newlib_environ.o \
+ newlib_execve.o \
newlib_exit.o newlib_fork.o newlib_fstat.o newlib_getpid.o \
newlib_gettimeofday.o newlib_isatty.o newlib_kill.o newlib_link.o \
newlib_lseek.o newlib_malloc.o newlib_open.o \
Added: kos/kernel/libc/newlib/newlib_execve.c
===================================================================
--- kos/kernel/libc/newlib/newlib_execve.c (rev 0)
+++ kos/kernel/libc/newlib/newlib_execve.c 2006-09-18 00:27:58 UTC (rev 370)
@@ -0,0 +1,14 @@
+/* KallistiOS ##version##
+
+ newlib_execve.c
+ Copyright (C)2004 Dan Potter
+
+*/
+
+#include <sys/reent.h>
+#include <errno.h>
+
+int _execve_r(struct _reent * reent) {
+ reent->_errno = EAGAIN;
+ return -1;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:26:42
|
Revision: 369
http://svn.sourceforge.net/cadcdev/?rev=369&view=rev
Author: bardtx
Date: 2006-09-17 17:26:35 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Add dc-chain updated to GCC 3.4.6:
https://sourceforge.net/mailarchive/message.php?msg_id=28482460
Added Paths:
-----------
kos/utils/dc-chain/
kos/utils/dc-chain/00PATCHES
kos/utils/dc-chain/00README
kos/utils/dc-chain/Makefile
kos/utils/dc-chain/download.sh
kos/utils/dc-chain/patches/
kos/utils/dc-chain/patches/gcc-3.4.6.diff
kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff
kos/utils/dc-chain/unpack.sh
Added: kos/utils/dc-chain/00PATCHES
===================================================================
--- kos/utils/dc-chain/00PATCHES (rev 0)
+++ kos/utils/dc-chain/00PATCHES 2006-09-18 00:26:35 UTC (rev 369)
@@ -0,0 +1,21 @@
+gcc-3.4.6-diff:
+- Defines SUPPORT_WEAK 0 in config/sh/kos.h so that pthreads will not create
+ weak symbols (GNU ld does not extract weak symbols from archives).
+- Do not build m2/m2e/m4-single/m4 by default. Should be unnecessary once
+ we have a sh-kos-elf target.
+- Adds config/sh/kos.h to config.gcc. Note: this is under sh-elf-unknown.
+ Once we have a sh-kos-elf target, that should be corrected.
+- Add sh4/atomicity.h stub, not currently used. Requires addition of spinlock
+ or interrupt disable/enable code. Currently we use the generic atomicity
+ functions, which use pthreads (slow).
+- Correct bug (?) in config/generic/atomicity.h (_GLIBCXX_ macros undefined).
+- Add sh-unknown-elf defines to libstdc++/crossconfig.m4 -- this was done by
+ default (accident?) prior to 3.4.
+
+Generic newlib fixups (applied directly after newlib is installed):
+ cp $(kos_base)/include/pthread.h $(newlib_inc) # KOS pthread.h is modified
+ cp $(kos_base)/include/sys/_pthread.h $(newlib_inc)/sys # to define _POSIX_THREADS
+ cp $(kos_base)/include/sys/sched.h $(newlib_inc)/sys # pthreads to kthreads mapping
+ ln -nsf $(kos_base)/include/kos $(newlib_inc) # so KOS includes are available as kos/file.h
+ ln -nsf $(kos_base)/kernel/arch/dreamcast/include/arch $(newlib_inc) # kos/thread.h requires arch/arch.h
+ ln -nsf $(kos_base)/kernel/arch/dreamcast/include/dc $(newlib_inc) # arch/arch.h requires dc/video.h
Added: kos/utils/dc-chain/00README
===================================================================
--- kos/utils/dc-chain/00README (rev 0)
+++ kos/utils/dc-chain/00README 2006-09-18 00:26:35 UTC (rev 369)
@@ -0,0 +1,25 @@
+dc-chain 0.1
+------------
+
+This package contains a Makefile which both simplifies building the Dreamcast
+toolchain, and gives you substantial control.
+
+On the minimum hassle side, 'make' will patch everything (using patches/*.diff)
+and build both the sh and arm toolchains. 'make erase=1' will erase the build
+directories as they become safe to delete, to save space. And as for a more
+complex example, 'make patch-gcc build-sh4-gcc-pass1 thread_model=single' will
+build a patched, single-threaded sh4 gcc pass 1 compiler. Please see the
+comments at the top of the Makefile for more options.
+
+Before you start, change the variables in the User Configuration section to
+match your environment. They can be overridden at the command line as well.
+
+Then untar your binutils, gcc-core, and optionally newlib and gcc-g++
+distributions into this directory (or copy Makefile and patches/ into your
+build directory.) Also, ensure the KOS distribution is unpacked, and set
+its path in the Makefile, because some KOS includes are copied over to newlib.
+
+Finally, run make. If anything goes wrong, check the output in logs/.
+
+Some patches are included in this package as well. As of this writing,
+they patch newlib to work with KOS and gcc-3.4.6 to use POSIX threads.
Added: kos/utils/dc-chain/Makefile
===================================================================
--- kos/utils/dc-chain/Makefile (rev 0)
+++ kos/utils/dc-chain/Makefile 2006-09-18 00:26:35 UTC (rev 369)
@@ -0,0 +1,205 @@
+#!/bin/bash
+# Dreamcast toolchain makefile by Jim Ursetto
+# adapted from Stalin's build script version 0.3
+#
+# Interesting parameters:
+# erase=0|1 Erase build directories on the fly to save space
+# thread_model=posix|single Set gcc threading model
+# verbose=0|1 Display
+#
+# Interesting targets (you can 'make' any of these):
+# all: patch build
+# patch: patch-gcc patch-newlib patch-kos
+# build: build-sh4 build-arm
+# build-sh4: build-sh4-binutils build-sh4-gcc
+# build-arm: build-arm-binutils build-arm-gcc
+# build-sh4-gcc: build-sh4-gcc-pass1 build-sh4-newlib build-sh4-gcc-pass2
+# build-arm-gcc: build-arm-gcc-pass1
+# build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib
+
+# User configuration
+sh_target=sh-elf
+arm_target=arm-elf
+sh_prefix := /opt/dc/$(sh_target)
+arm_prefix := /opt/dc/$(arm_target)
+# kos_root: KOS subversion root (contains kos/ and kos-ports/)
+kos_root=~/prj/svn
+# kos_base: equivalent of KOS_BASE (contains include/ and kernel/)
+kos_base=$(kos_root)/kos
+binutils_ver=2.15
+gcc_ver=3.4.6
+newlib_ver=1.12.0
+thread_model=posix
+erase=0
+verbose=0
+
+# Makefile variables
+install=$(prefix)/bin
+pwd := $(shell pwd)
+patches := $(pwd)/patches
+logdir := $(pwd)/logs
+PATH := $(sh_prefix)/bin:$(arm_prefix)/bin:$(PATH)
+binutils_dir=binutils-$(binutils_ver)
+gcc_dir=gcc-$(gcc_ver)
+newlib_dir=newlib-$(newlib_ver)
+
+all: patch build
+
+# ---- patch {{{
+gcc_patches := $(wildcard $(patches)/gcc-$(gcc_ver)*.diff)
+newlib_patches := $(wildcard $(patches)/newlib-$(newlib_ver)*.diff)
+kos_patches := $(wildcard $(patches)/kos-*.diff)
+
+patch_targets=patch-gcc patch-newlib patch-kos
+
+patch: $(patch_targets)
+patch-gcc: $(gcc_patches)
+patch-newlib: $(newlib_patches)
+patch-kos: $(kos_patches)
+
+$(newlib_patches):
+ cd $(newlib_dir); patch -p1 < $@
+
+$(gcc_patches):
+ cd $(gcc_dir); patch -p1 < $@
+
+$(kos_patches):
+ cd $(kos_root); patch -p1 < $@
+
+# ---- }}}
+
+# ---- build {{{
+
+build: build-sh4 build-arm
+# build-sh4: build-sh4-binutils build-sh4-gcc
+build-sh4: build-sh4-gcc
+build-arm: build-arm-binutils build-arm-gcc
+# build-sh4-gcc: build-sh4-gcc-pass1 build-sh4-newlib build-sh4-gcc-pass2
+build-sh4-gcc: build-sh4-newlib build-sh4-gcc-pass2
+build-arm-gcc: build-arm-gcc-pass1
+ $(clean_arm_hack)
+#build-sh4-newlib: build-sh4-newlib-only fixup-sh4-newlib
+build-sh4-newlib: fixup-sh4-newlib
+
+# Ensure that, no matter where we enter, prefix and target are set correctly.
+build_sh4_targets=build-sh4-binutils build-sh4-gcc build-sh4-gcc-pass1 build-sh4-newlib build-sh4-newlib-only build-sh4-gcc-pass2
+build_arm_targets=build-arm-binutils build-arm-gcc build-arm-gcc-pass1
+$(build_sh4_targets): prefix = $(sh_prefix)
+$(build_sh4_targets): target = $(sh_target)
+$(build_arm_targets): extra_configure_args = ""
+$(build_arm_targets): prefix = $(arm_prefix)
+$(build_arm_targets): target = $(arm_target)
+$(build_arm_targets): extra_configure_args = "--with-arch=armv4"
+
+# To avoid code repetition, we use the same commands for both
+# architectures. But we can't create a single target called
+# build-binutils for both sh4 and arm, because phony targets
+# can't be run multiple times. So we create multiple targets.
+build_binutils = build-sh4-binutils build-arm-binutils
+build_gcc_pass1 = build-sh4-gcc-pass1 build-arm-gcc-pass1
+build_newlib = build-sh4-newlib-only
+build_gcc_pass2 = build-sh4-gcc-pass2
+
+# Here we use the essentially same code for multiple targets,
+# differing only by the current state of the variables below.
+$(build_binutils): build = build-binutils-$(target)-$(binutils_ver)
+$(build_binutils): src_dir = binutils-$(binutils_ver)
+$(build_binutils): log = $(logdir)/$(build).log
+$(build_binutils): logdir
+ @echo "+++ Building $(src_dir) to $(build)..."
+ -mkdir -p $(build)
+ > $(log)
+ cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) $(to_log)
+ make -C $(build) all install $(to_log)
+ $(clean_up)
+
+$(build_gcc_pass1) $(build_gcc_pass2): build = build-gcc-$(target)-$(gcc_ver)
+$(build_gcc_pass1) $(build_gcc_pass2): src_dir = gcc-$(gcc_ver)
+$(build_gcc_pass1): log = $(logdir)/$(build)-pass1.log
+$(build_gcc_pass1): logdir
+ @echo "+++ Building $(src_dir) to $(build) (pass 1)..."
+ -mkdir -p $(build)
+ > $(log)
+ cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) --without-headers --with-newlib --enable-languages=c $(extra_configure_args) $(to_log)
+ make -C $(build) all-gcc install-gcc $(to_log)
+
+$(build_newlib): build = build-newlib-$(target)-$(newlib_ver)
+$(build_newlib): src_dir = newlib-$(newlib_ver)
+$(build_newlib): log = $(logdir)/$(build).log
+$(build_newlib): logdir
+ @echo "+++ Building $(src_dir) to $(build)..."
+ -mkdir -p $(build)
+ > $(log)
+ cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) $(to_log)
+ make -C $(build) all install CC_FOR_TARGET=$(install)/$(target)-gcc AS_FOR_TARGET=$(install)/$(target)-as \
+ LD_FOR_TARGET=$(install)/$(target)-ld AR_FOR_TARGET=$(install)/$(target)-ar \
+ RANLIB_FOR_TARGET=$(install)/$(target)-ranlib $(to_log)
+ $(clean_up)
+
+fixup-sh4-newlib: newlib_inc=$(sh_prefix)/$(sh_target)/include
+fixup-sh4-newlib:
+ @echo "+++ Fixing up sh4 newlib includes..."
+ cp $(kos_base)/include/pthread.h $(newlib_inc) # KOS pthread.h is modified
+ cp $(kos_base)/include/sys/_pthread.h $(newlib_inc)/sys # to define _POSIX_THREADS
+ cp $(kos_base)/include/sys/sched.h $(newlib_inc)/sys # pthreads to kthreads mapping
+ ln -nsf $(kos_base)/include/kos $(newlib_inc) # so KOS includes are available as kos/file.h
+ ln -nsf $(kos_base)/kernel/arch/dreamcast/include/arch $(newlib_inc) # kos/thread.h requires arch/arch.h
+ ln -nsf $(kos_base)/kernel/arch/dreamcast/include/dc $(newlib_inc) # arch/arch.h requires dc/video.h
+
+$(build_gcc_pass2): log = $(logdir)/$(build)-pass2.log
+$(build_gcc_pass2): logdir
+ @echo "+++ Building $(src_dir) to $(build) (pass 2)..."
+ -mkdir -p $(build)
+ > $(log)
+ cd $(build); ../$(src_dir)/configure --target=$(target) --prefix=$(prefix) --with-newlib \
+ --enable-threads=$(thread_model) --enable-languages=c,c++ $(to_log)
+ make -C $(build) all install $(to_log)
+ $(clean_up)
+
+# ---- }}}}
+
+# ---- support {{{
+
+clean:
+ -rm -rf build-newlib-$(sh_target)-$(newlib_ver)
+ -rm -rf build-newlib-$(arm_target)-$(newlib_ver)
+ -rm -rf build-gcc-$(sh_target)-$(gcc_ver)
+ -rm -rf build-gcc-$(arm_target)-$(gcc_ver)
+ -rm -rf build-binutils-$(sh_target)-$(binutils_ver)
+ -rm -rf build-binutils-$(arm_target)-$(binutils_ver)
+
+logdir:
+ @mkdir -p $(logdir)
+
+# If erase=1, erase build directories on the fly.
+ifeq (1,$(erase))
+ define clean_up
+ @echo "+++ Cleaning up $(build)..."
+ -rm -rf $(build)
+ endef
+ # Hack to clean up ARM gcc pass 1
+ define clean_arm_hack
+ @echo "+++ Cleaning up build-gcc-$(arm_target)-$(gcc_ver)..."
+ -rm -rf build-gcc-$(arm_target)-$(gcc_ver)
+ endef
+endif
+
+# If verbose=1, display output to screen as well as log files
+ifeq (1,$(verbose))
+ to_log = 2>&1 | tee -a $(log)
+else
+ to_log = >> $(log) 2>&1
+endif
+
+# ---- }}}
+
+# ---- phony targets {{{
+
+.PHONY: $(patch_targets)
+.PHONY: $(newlib_patches) $(gcc_patches) $(kos_patches)
+.PHONY: all build patch build-sh4 build-arm $(build_sh4_targets) $(build_arm_targets) clean
+.PHONY: build-binutils build-newlib build-gcc-pass1 build-gcc-pass2 fixup-sh4-newlib
+
+# ---- }}}}
+
+# vim:tw=0:fdm=marker:fdc=2:fdl=1
Property changes on: kos/utils/dc-chain/Makefile
___________________________________________________________________
Name: svn:executable
+ *
Added: kos/utils/dc-chain/download.sh
===================================================================
--- kos/utils/dc-chain/download.sh (rev 0)
+++ kos/utils/dc-chain/download.sh 2006-09-18 00:26:35 UTC (rev 369)
@@ -0,0 +1,5 @@
+#!/bin/sh
+wget -c ftp://ftp.gnu.org/gnu/binutils/binutils-2.15.tar.bz2 || exit 1
+wget -c ftp://ftp.gnu.org/gnu/gcc/gcc-3.4.6/gcc-3.4.6.tar.bz2 || exit 1
+wget -c ftp://sources.redhat.com/pub/newlib/newlib-1.12.0.tar.gz || exit 1
+
Property changes on: kos/utils/dc-chain/download.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: kos/utils/dc-chain/patches/gcc-3.4.6.diff
===================================================================
--- kos/utils/dc-chain/patches/gcc-3.4.6.diff (rev 0)
+++ kos/utils/dc-chain/patches/gcc-3.4.6.diff 2006-09-18 00:26:35 UTC (rev 369)
@@ -0,0 +1,299 @@
+diff -ruN gcc-3.4.6/gcc/config/sh/kos.h gcc-3.4.6-kos/gcc/config/sh/kos.h
+--- gcc-3.4.6/gcc/config/sh/kos.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-3.4.6-kos/gcc/config/sh/kos.h 2006-05-29 12:07:52.000000000 +0200
+@@ -0,0 +1,20 @@
++/* Definition of KOS target on SH for GNU C compiler.
++
++ Copyright (C) 2004 Jim Ursetto
++
++GCC is free software; you can redistribute it and/or modify
++it under the terms of the GNU General Public License as published by
++the Free Software Foundation; either version 2, or (at your option)
++any later version.
++
++GCC is distributed in the hope that it will be useful,
++but WITHOUT ANY WARRANTY; without even the implied warranty of
++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++GNU General Public License for more details.
++
++You should have received a copy of the GNU General Public License
++along with GCC; see the file COPYING. If not, write to
++the Free Software Foundation, 59 Temple Place - Suite 330,
++Boston, MA 02111-1307, USA. */
++
++#define SUPPORTS_WEAK 0
+diff -ruN gcc-3.4.6/gcc/config/sh/t-sh gcc-3.4.6-kos/gcc/config/sh/t-sh
+--- gcc-3.4.6/gcc/config/sh/t-sh 2003-06-03 21:01:22.000000000 +0200
++++ gcc-3.4.6-kos/gcc/config/sh/t-sh 2006-05-29 12:07:52.000000000 +0200
+@@ -22,7 +22,7 @@
+ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
+
+ MULTILIB_ENDIAN = ml
+-MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m2/m2e/m4-single-only/m4-single/m4
++MULTILIB_OPTIONS= $(MULTILIB_ENDIAN) m4-single-only
+ MULTILIB_DIRNAMES=
+ MULTILIB_MATCHES = m2=m3 m2e=m3e m2=m4-nofpu
+ MULTILIB_EXCEPTIONS = ml
+diff -ruN gcc-3.4.6/gcc/config.gcc gcc-3.4.6-kos/gcc/config.gcc
+--- gcc-3.4.6/gcc/config.gcc 2005-07-19 23:08:48.000000000 +0200
++++ gcc-3.4.6-kos/gcc/config.gcc 2006-05-29 12:07:52.000000000 +0200
+@@ -1910,6 +1910,7 @@
+ ;;
+ esac
+ tm_file="${tm_file} dbxelf.h elfos.h svr4.h sh/elf.h sh/embed-elf.h"
++ tm_file="${tm_file} sh/kos.h"
+ case ${target} in
+ sh64*)
+ tmake_file="${tmake_file} sh/t-sh64"
+diff -ruN gcc-3.4.6/libstdc++-v3/config/cpu/generic/atomicity.h gcc-3.4.6-kos/libstdc++-v3/config/cpu/generic/atomicity.h
+--- gcc-3.4.6/libstdc++-v3/config/cpu/generic/atomicity.h 2004-03-18 18:38:22.000000000 +0100
++++ gcc-3.4.6-kos/libstdc++-v3/config/cpu/generic/atomicity.h 2006-05-29 12:07:52.000000000 +0200
+@@ -28,6 +28,9 @@
+ // the GNU General Public License.
+
+ #include <bits/atomicity.h>
++/* If c++config.h is not included, the _GLIBCXX_ macros won't be brought in
++ * and gthreads will be set to single mode. Bug? */
++#include <bits/c++config.h>
+ #include <bits/concurrence.h>
+
+ namespace __gnu_internal
+diff -ruN gcc-3.4.6/libstdc++-v3/config/cpu/sh4/atomicity.h gcc-3.4.6-kos/libstdc++-v3/config/cpu/sh4/atomicity.h
+--- gcc-3.4.6/libstdc++-v3/config/cpu/sh4/atomicity.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-3.4.6-kos/libstdc++-v3/config/cpu/sh4/atomicity.h 2006-05-29 12:07:52.000000000 +0200
+@@ -0,0 +1,52 @@
++// Low-level functions for atomic operations: SH4 version -*- C++ -*-
++
++// Copyright (C) 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++// Copyright (C) 2004 Jim Ursetto
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++#error SH4 atomicity file incomplete
++#include <bits/atomicity.h>
++
++namespace __gnu_cxx
++{
++ _Atomic_word
++ __attribute__ ((__unused__))
++ __exchange_and_add(volatile _Atomic_word* __mem, int __val)
++ {
++ register _Atomic_word __result;
++ __asm__ __volatile__("");
++ __result = *__mem;
++ *__mem += __val;
++ __asm__ __volatile__("");
++ return __result;
++ }
++
++ void
++ __attribute__ ((__unused__))
++ __atomic_add(volatile _Atomic_word* __mem, int __val)
++ { __exchange_and_add(__mem, __val); }
++} // namespace __gnu_cxx
+diff -ruN gcc-3.4.6/libstdc++-v3/config/cpu/sh4/atomic_word.h gcc-3.4.6-kos/libstdc++-v3/config/cpu/sh4/atomic_word.h
+--- gcc-3.4.6/libstdc++-v3/config/cpu/sh4/atomic_word.h 1970-01-01 01:00:00.000000000 +0100
++++ gcc-3.4.6-kos/libstdc++-v3/config/cpu/sh4/atomic_word.h 2006-05-29 12:07:52.000000000 +0200
+@@ -0,0 +1,35 @@
++// Low-level type for atomic operations -*- C++ -*-
++
++// Copyright (C) 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING. If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction. Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License. This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++#ifndef _GLIBCXX_ATOMIC_WORD_H
++#define _GLIBCXX_ATOMIC_WORD_H 1
++
++typedef int _Atomic_word;
++
++#endif
+diff -ruN gcc-3.4.6/libstdc++-v3/configure gcc-3.4.6-kos/libstdc++-v3/configure
+--- gcc-3.4.6/libstdc++-v3/configure 2005-02-01 07:31:23.000000000 +0100
++++ gcc-3.4.6-kos/libstdc++-v3/configure 2006-05-29 12:07:52.000000000 +0200
+@@ -93503,6 +93503,104 @@
+ _ACEOF
+
+ ;;
++ sh-unknown-elf)
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_ACOSF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_ASINF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_ATAN2F 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_ATANF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_CEILF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_COPYSIGN 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_COPYSIGNF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_COSF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_COSHF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_EXPF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_FABSF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_FLOORF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_FMODF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_FREXPF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_LDEXPF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_LOG10F 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_LOGF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_MODFF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_POWF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_SINF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_SINHF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_SQRTF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_TANF 1
++_ACEOF
++
++ cat >>confdefs.h <<\_ACEOF
++#define HAVE_TANHF 1
++_ACEOF
++
++ ;;
+ *)
+ { { echo "$as_me:$LINENO: error: No support for this host/target combination." >&5
+ echo "$as_me: error: No support for this host/target combination." >&2;}
+diff -ruN gcc-3.4.6/libstdc++-v3/crossconfig.m4 gcc-3.4.6-kos/libstdc++-v3/crossconfig.m4
+--- gcc-3.4.6/libstdc++-v3/crossconfig.m4 2005-02-01 07:31:23.000000000 +0100
++++ gcc-3.4.6-kos/libstdc++-v3/crossconfig.m4 2006-05-29 12:07:52.000000000 +0200
+@@ -503,6 +503,32 @@
+ AC_DEFINE(HAVE_TANHF)
+ AC_DEFINE(HAVE_TANHL)
+ ;;
++ sh-unknown-elf)
++ AC_DEFINE(HAVE_ACOSF)
++ AC_DEFINE(HAVE_ASINF)
++ AC_DEFINE(HAVE_ATAN2F)
++ AC_DEFINE(HAVE_ATANF)
++ AC_DEFINE(HAVE_CEILF)
++ AC_DEFINE(HAVE_COPYSIGN)
++ AC_DEFINE(HAVE_COPYSIGNF)
++ AC_DEFINE(HAVE_COSF)
++ AC_DEFINE(HAVE_COSHF)
++ AC_DEFINE(HAVE_EXPF)
++ AC_DEFINE(HAVE_FABSF)
++ AC_DEFINE(HAVE_FLOORF)
++ AC_DEFINE(HAVE_FMODF)
++ AC_DEFINE(HAVE_FREXPF)
++ AC_DEFINE(HAVE_LDEXPF)
++ AC_DEFINE(HAVE_LOG10F)
++ AC_DEFINE(HAVE_LOGF)
++ AC_DEFINE(HAVE_MODFF)
++ AC_DEFINE(HAVE_POWF)
++ AC_DEFINE(HAVE_SINF)
++ AC_DEFINE(HAVE_SINHF)
++ AC_DEFINE(HAVE_SQRTF)
++ AC_DEFINE(HAVE_TANF)
++ AC_DEFINE(HAVE_TANHF)
++ ;;
+ *)
+ AC_MSG_ERROR([No support for this host/target combination.])
+ ;;
Added: kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff
===================================================================
--- kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff (rev 0)
+++ kos/utils/dc-chain/patches/newlib-1.12.0-kos.diff 2006-09-18 00:26:35 UTC (rev 369)
@@ -0,0 +1,435 @@
+diff -ruN newlib-1.12.0/config-ml.in newlib-1.12.0-kos/config-ml.in
+--- newlib-1.12.0/config-ml.in 2004-01-04 16:42:16.000000000 -0800
++++ newlib-1.12.0-kos/config-ml.in 2004-08-07 09:30:51.000000000 -0700
+@@ -196,19 +196,19 @@
+
+ if [ "${ml_toplevel_p}" = yes ]; then
+
+-multidirs=
+-for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
+- dir=`echo $i | sed -e 's/;.*$//'`
+- if [ "${dir}" = "." ]; then
+- true
+- else
+- if [ -z "${multidirs}" ]; then
+- multidirs="${dir}"
+- else
+- multidirs="${multidirs} ${dir}"
+- fi
+- fi
+-done
++multidirs=ml/m4-single-only
++#for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
++# dir=`echo $i | sed -e 's/;.*$//'`
++# if [ "${dir}" = "." ]; then
++# true
++# else
++# if [ -z "${multidirs}" ]; then
++# multidirs="${dir}"
++# else
++# multidirs="${multidirs} ${dir}"
++# fi
++# fi
++#done
+
+ # Target libraries are configured for the host they run on, so we check
+ # $host here, not $target.
+diff -ruN newlib-1.12.0/newlib/configure.host newlib-1.12.0-kos/newlib/configure.host
+--- newlib-1.12.0/newlib/configure.host 2004-02-02 08:59:51.000000000 -0800
++++ newlib-1.12.0-kos/newlib/configure.host 2004-08-07 10:34:46.000000000 -0700
+@@ -178,6 +178,7 @@
+ ;;
+ sh | sh64)
+ machine_dir=sh
++ newlib_cflags="${newlib_cflags} -DREENTRANT_SYSCALLS_PROVIDED -DMALLOC_PROVIDED -DABORT_PROVIDED -fno-crossjumping -fno-optimize-sibling-calls"
+ ;;
+ sparc*)
+ machine_dir=sparc
+diff -ruN newlib-1.12.0/newlib/libc/sys/sh/ftruncate.c newlib-1.12.0-kos/newlib/libc/sys/sh/ftruncate.c
+--- newlib-1.12.0/newlib/libc/sys/sh/ftruncate.c 2003-07-10 08:31:30.000000000 -0700
++++ newlib-1.12.0-kos/newlib/libc/sys/sh/ftruncate.c 2004-08-07 09:40:01.000000000 -0700
+@@ -2,8 +2,8 @@
+ #include <sys/types.h>
+ #include "sys/syscall.h"
+
+-int
++/* int
+ ftruncate (int file, off_t length)
+ {
+ return __trap34 (SYS_ftruncate, file, length, 0);
+-}
++} */
+diff -ruN newlib-1.12.0/newlib/libc/sys/sh/sys/_types.h newlib-1.12.0-kos/newlib/libc/sys/sh/sys/_types.h
+--- newlib-1.12.0/newlib/libc/sys/sh/sys/_types.h 1969-12-31 16:00:00.000000000 -0800
++++ newlib-1.12.0-kos/newlib/libc/sys/sh/sys/_types.h 2004-08-07 09:22:27.000000000 -0700
+@@ -0,0 +1,42 @@
++/* ANSI C namespace clean utility typedefs */
++
++/* This file defines various typedefs needed by the system calls that support
++ the C library. Basically, they're just the POSIX versions with an '_'
++ prepended. This file lives in the `sys' directory so targets can provide
++ their own if desired (or they can put target dependant conditionals here).
++*/
++
++#ifndef _SYS__TYPES_H
++#define _SYS__TYPES_H
++
++#include "lock.h"
++
++typedef long _off_t;
++__extension__ typedef long long _off64_t;
++
++#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
++typedef int _ssize_t;
++#else
++typedef long _ssize_t;
++#endif
++
++#define __need_wint_t
++#include <stddef.h>
++
++/* Conversion state information. */
++typedef struct
++{
++ int __count;
++ union
++ {
++ wint_t __wch;
++ unsigned char __wchb[4];
++ } __value; /* Value so far. */
++} _mbstate_t;
++
++typedef _LOCK_RECURSIVE_T _flock_t;
++
++/* Iconv descriptor type */
++typedef void *_iconv_t;
++
++#endif /* _SYS__TYPES_H */
+diff -ruN newlib-1.12.0/newlib/libc/sys/sh/sys/lock.h newlib-1.12.0-kos/newlib/libc/sys/sh/sys/lock.h
+--- newlib-1.12.0/newlib/libc/sys/sh/sys/lock.h 1969-12-31 16:00:00.000000000 -0800
++++ newlib-1.12.0-kos/newlib/libc/sys/sh/sys/lock.h 2004-08-07 10:41:28.000000000 -0700
+@@ -0,0 +1,36 @@
++#ifndef __SYS_LOCK_H__
++#define __SYS_LOCK_H__
++
++/* Map everything (approximately) to KOS stuff. Note that if the definition
++ of spinlock_t changes size, or the definition of SPINLOCK_INITIALIZER
++ changes, this will also have to be changed. */
++typedef int _LOCK_T;
++typedef struct { int a, b, c; } _LOCK_RECURSIVE_T;
++
++#define __LOCK_INIT(class,lock) class _LOCK_T lock = 0;
++#define __LOCK_INIT_RECURSIVE(class,lock) class _LOCK_T lock = { 0, 0, 0 };
++#define __lock_init(lock) __newlib_lock_init(&(lock))
++#define __lock_init_recursive(lock) __newlib_lock_init_recursive(&(lock))
++#define __lock_close(lock) __newlib_lock_close(&(lock))
++#define __lock_close_recursive(lock) __newlib_lock_close_recursive(&(lock))
++#define __lock_acquire(lock) __newlib_lock_acquire(&(lock))
++#define __lock_acquire_recursive(lock) __newlib_lock_acquire_recursive(&(lock))
++#define __lock_try_acquire(lock) __newlib_lock_try_acquire(&(lock))
++#define __lock_try_acquire_recursive(lock) __newlib_lock_try_acquire_recursive(&(lock))
++#define __lock_release(lock) __newlib_lock_release(&(lock))
++#define __lock_release_recursive(lock) __newlib_lock_release_recursive(&(lock))
++
++/* These are defined in KOS */
++void __newlib_lock_init(_LOCK_T *);
++void __newlib_lock_close(_LOCK_T *);
++void __newlib_lock_acquire(_LOCK_T *);
++void __newlib_lock_try_acquire(_LOCK_T *);
++void __newlib_lock_release(_LOCK_T *);
++
++void __newlib_lock_init_recursive(_LOCK_RECURSIVE_T *);
++void __newlib_lock_close_recursive(_LOCK_RECURSIVE_T *);
++void __newlib_lock_acquire_recursive(_LOCK_RECURSIVE_T *);
++void __newlib_lock_try_acquire_recursive(_LOCK_RECURSIVE_T *);
++void __newlib_lock_release_recursive(_LOCK_RECURSIVE_T *);
++
++#endif /* __SYS_LOCK_H__ */
+diff -ruN newlib-1.12.0/newlib/libc/sys/sh/syscalls.c newlib-1.12.0-kos/newlib/libc/sys/sh/syscalls.c
+--- newlib-1.12.0/newlib/libc/sys/sh/syscalls.c 2001-02-01 13:25:56.000000000 -0800
++++ newlib-1.12.0-kos/newlib/libc/sys/sh/syscalls.c 2004-08-07 10:24:07.000000000 -0700
+@@ -1,221 +1,2 @@
+-#include <_ansi.h>
+-#include <sys/types.h>
+-#include <sys/stat.h>
+-#include <sys/time.h>
+-#include "sys/syscall.h"
+-int errno;
+-
+-/* This is used by _sbrk. */
+-register char *stack_ptr asm ("r15");
+-
+-int
+-_read (int file,
+- char *ptr,
+- int len)
+-{
+- return __trap34 (SYS_read, file, ptr, len);
+-}
+-
+-int
+-_lseek (int file,
+- int ptr,
+- int dir)
+-{
+- return __trap34 (SYS_lseek, file, ptr, dir);
+-}
+-
+-int
+-_write ( int file,
+- char *ptr,
+- int len)
+-{
+- return __trap34 (SYS_write, file, ptr, len);
+-}
+-
+-int
+-_close (int file)
+-{
+- return __trap34 (SYS_close, file, 0, 0);
+-}
+-
+-int
+-_link (char *old, char *new)
+-{
+- return -1;
+-}
+-
+-caddr_t
+-_sbrk (int incr)
+-{
+- extern char end; /* Defined by the linker */
+- static char *heap_end;
+- char *prev_heap_end;
+-
+- if (heap_end == 0)
+- {
+- heap_end = &end;
+- }
+- prev_heap_end = heap_end;
+- if (heap_end + incr > stack_ptr)
+- {
+- _write (1, "Heap and stack collision\n", 25);
+- abort ();
+- }
+- heap_end += incr;
+- return (caddr_t) prev_heap_end;
+-}
+-
+-int
+-_fstat (int file,
+- struct stat *st)
+-{
+- st->st_mode = S_IFCHR;
+- return 0;
+-}
+-
+-int
+-_open (const char *path,
+- int flags)
+-{
+- return __trap34 (SYS_open, path, flags, 0);
+-}
+-
+-int
+-_creat (const char *path,
+- int mode)
+-{
+- return __trap34 (SYS_creat, path, mode, 0);
+-}
+-
+-int
+-_unlink ()
+-{
+- return -1;
+-}
+-
+-isatty (fd)
+- int fd;
+-{
+- return 1;
+-}
+-
+-_exit (n)
+-{
+- return __trap34 (SYS_exit, n, 0, 0);
+-}
+-
+-_kill (n, m)
+-{
+- return __trap34 (SYS_exit, 0xdead, 0, 0);
+-}
+-
+-_getpid (n)
+-{
+- return 1;
+-}
+-
+-_raise ()
+-{
+-}
+-
+-int
+-_stat (const char *path, struct stat *st)
+-
+-{
+- return __trap34 (SYS_stat, path, st, 0);
+-}
+-
+-int
+-_chmod (const char *path, short mode)
+-{
+- return __trap34 (SYS_chmod, path, mode);
+-}
+-
+-int
+-_chown (const char *path, short owner, short group)
+-{
+- return __trap34 (SYS_chown, path, owner, group);
+-}
+-
+-int
+-_utime (path, times)
+- const char *path;
+- char *times;
+-{
+- return __trap34 (SYS_utime, path, times);
+-}
+-
+-int
+-_fork ()
+-{
+- return __trap34 (SYS_fork);
+-}
+-
+-int
+-_wait (statusp)
+- int *statusp;
+-{
+- return __trap34 (SYS_wait);
+-}
+-
+-int
+-_execve (const char *path, char *const argv[], char *const envp[])
+-{
+- return __trap34 (SYS_execve, path, argv, envp);
+-}
+-
+-int
+-_execv (const char *path, char *const argv[])
+-{
+- return __trap34 (SYS_execv, path, argv);
+-}
+-
+-int
+-_pipe (int *fd)
+-{
+- return __trap34 (SYS_pipe, fd);
+-}
+-
+-/* This is only provided because _gettimeofday_r and _times_r are
+- defined in the same module, so we avoid a link error. */
+-clock_t
+-_times (struct tms *tp)
+-{
+- return -1;
+-}
+-
+-int
+-_gettimeofday (struct timeval *tv, struct timezone *tz)
+-{
+- tv->tv_usec = 0;
+- tv->tv_sec = __trap34 (SYS_time);
+- return 0;
+-}
+-
+-static inline int
+-__setup_argv_for_main (int argc)
+-{
+- char **argv;
+- int i = argc;
+-
+- argv = __builtin_alloca ((1 + argc) * sizeof (*argv));
+-
+- argv[i] = NULL;
+- while (i--) {
+- argv[i] = __builtin_alloca (1 + __trap34 (SYS_argnlen, i));
+- __trap34 (SYS_argn, i, argv[i]);
+- }
+-
+- return main (argc, argv);
+-}
+-
+-int
+-__setup_argv_and_call_main ()
+-{
+- int argc = __trap34 (SYS_argc);
+-
+- if (argc <= 0)
+- return main (argc, NULL);
+- else
+- return __setup_argv_for_main (argc);
+-}
++// This is put in here to cause link errors if a proper newlib isn't present.
++int __newlib_kos_patch = 1;
+diff -ruN newlib-1.12.0/newlib/libc/sys/sh/trap.S newlib-1.12.0-kos/newlib/libc/sys/sh/trap.S
+--- newlib-1.12.0/newlib/libc/sys/sh/trap.S 2002-02-07 23:11:13.000000000 -0800
++++ newlib-1.12.0-kos/newlib/libc/sys/sh/trap.S 2004-08-07 09:39:14.000000000 -0700
+@@ -1,43 +0,0 @@
+-#if __SH5__
+- .mode SHmedia
+-#if __SH5__ == 32 && __SHMEDIA__
+- .section .text..SHmedia32, "ax"
+-#else
+- .text
+-#endif
+- .global ___trap34
+-___trap34:
+- movi 34, r0
+- trapa r0
+- pt/l ret, tr1
+- ptabs/l r18, tr0
+- beqi r1, 0, tr1
+-#if __SH5__ == 64
+- movi ((_errno >> 48) & 65535), r0
+- shori ((_errno >> 32) & 65535), r0
+- shori ((_errno >> 16) & 65535), r0
+-#else
+- movi ((_errno >> 16) & 65535), r0
+-#endif
+- shori (_errno & 65535), r0
+- stx.l r0, r63, r1
+-ret:
+- blink tr0, r63
+-
+-#else
+- .text
+- .global ___trap34
+-___trap34:
+- trapa #34
+- tst r1,r1 ! r1 is errno
+- bt ret
+- mov.l perrno,r2
+- mov.l r1,@r2
+-ret:
+- rts
+- nop
+-
+- .align 2
+-perrno:
+- .long _errno
+-#endif /* ! __SH5__ */
+diff -ruN newlib-1.12.0/newlib/libc/sys/sh/truncate.c newlib-1.12.0-kos/newlib/libc/sys/sh/truncate.c
+--- newlib-1.12.0/newlib/libc/sys/sh/truncate.c 2003-07-10 08:31:30.000000000 -0700
++++ newlib-1.12.0-kos/newlib/libc/sys/sh/truncate.c 2004-08-07 09:39:55.000000000 -0700
+@@ -2,8 +2,8 @@
+ #include <sys/types.h>
+ #include "sys/syscall.h"
+
+-int
++/* int
+ truncate (const char *path, off_t length)
+ {
+ return __trap34 (SYS_truncate, path, length, 0);
+-}
++} */
Added: kos/utils/dc-chain/unpack.sh
===================================================================
--- kos/utils/dc-chain/unpack.sh (rev 0)
+++ kos/utils/dc-chain/unpack.sh 2006-09-18 00:26:35 UTC (rev 369)
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+rm -rf binutils-2.15 gcc-3.4.6 newlib-1.12.0
+
+tar jxf binutils-2.15.tar.bz2 || exit 1
+tar jxf gcc-3.4.6.tar.bz2 || exit 1
+tar zxf newlib-1.12.0.tar.gz || exit 1
Property changes on: kos/utils/dc-chain/unpack.sh
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:19:21
|
Revision: 368
http://svn.sourceforge.net/cadcdev/?rev=368&view=rev
Author: bardtx
Date: 2006-09-17 17:19:18 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Add simple Blender model export plugin
Added Paths:
-----------
kos/utils/blender/
kos/utils/blender/ccode_export.py
Added: kos/utils/blender/ccode_export.py
===================================================================
--- kos/utils/blender/ccode_export.py (rev 0)
+++ kos/utils/blender/ccode_export.py 2006-09-18 00:19:18 UTC (rev 368)
@@ -0,0 +1,103 @@
+#!BPY
+
+# Blender simple export plugin by Christian Henz
+
+"""
+Name: 'C code (.h)...'
+Blender: 232
+Group: 'Export'
+Tooltip: 'Export selected mesh to C code (*.h)'
+"""
+
+__bpydoc__ = """\
+"""
+
+import Blender
+
+def write(filename):
+
+ file = open(filename, "wb")
+
+ objects = Blender.Object.GetSelected()
+ objname = objects[0].name
+ meshname = objects[0].data.name
+ mesh = Blender.NMesh.GetRaw(meshname)
+
+ obj = Blender.Object.Get(objname)
+
+ file.write( "/* Generated file, do not edit! */\n" )
+ file.write( "/* Object: %s */\n" % objname )
+
+ file.write( "const int %s_num_vertices = %d; \n" % ( objname, len( mesh.verts ) ) )
+ file.write( "const float %s_vertices[%d][3] = { \n" % ( objname, len( mesh.verts ) ) )
+
+ for i in range( len( mesh.verts ) ):
+ x, y, z = mesh.verts[i].co
+ file.write( " { %ff, %ff, %ff }, \n" % ( x, y, z ) )
+
+ file.write( "}; \n" );
+
+
+ file.write( "const int %s_num_triangles = %d; \n" % ( objname, len( mesh.faces ) ) )
+ file.write( "const int %s_triangles[%d][3] = { \n" % ( objname, len( mesh.faces ) ) )
+
+ for i in range( len( mesh.faces ) ):
+
+ if len( mesh.faces[ i ].v ) == 3:
+ file.write( " { %d, %d, %d }, \n" % ( mesh.faces[ i ].v[0].index, mesh.faces[ i ].v[1].index, mesh.faces[ i ].v[2].index ) )
+ else:
+ print "Warning: Dropping non-triangle!!!"
+
+ file.write( "}; \n" );
+
+
+ file.write( "const int %s_num_materials[%d][4] = { \n" % (objname, len( mesh.materials ) ) )
+ file.write( "const float %s_materials[%d][4] = { \n" % (objname, len( mesh.materials ) ) )
+
+ for m in mesh.materials:
+
+ file.write( " { %ff, %ff, %ff, %ff }, \n" % ( m.R, m.G, m.B, m.alpha ) )
+
+ file.write( "}; \n" );
+
+
+ file.write( "const int %s_triangle_materials[%d] = { \n" % ( objname, len( mesh.faces ) ) )
+
+ for i in range( len( mesh.faces ) ):
+
+ if len( mesh.faces[ i ].v ) == 3:
+ file.write( " %d, \n" % ( mesh.faces[ i ].materialIndex ) )
+ else:
+ print "Warning: Dropping non-triangle!!!"
+
+ file.write( "}; \n" );
+
+
+ file.write( "const float %s_triangle_normals[%d][3] = { \n" % (objname, len( mesh.faces ) ) )
+
+ for t in mesh.faces:
+
+ if len( t.v ) == 3:
+ file.write( " { %ff, %ff, %ff }, \n" % ( t.normal[0], t.normal[1], t.normal[2] ) )
+ else:
+ print "Warning: Dropping non-triangle!!!"
+
+ file.write( "}; \n" );
+
+
+ file.write( "const float %s_vertex_normals[%d][3] = { \n" % (objname, len( mesh.verts ) ) )
+
+ for v in mesh.verts:
+
+ file.write( " { %ff, %ff, %ff }, \n" % ( v.no[0], v.no[1], v.no[2] ) )
+
+ file.write( "}; \n" );
+
+
+ file.close()
+
+def fs_callback( filename ):
+ if filename.find( '.h', -2 ) <= 0: filename += '.h'
+ write( filename )
+
+Blender.Window.FileSelector( fs_callback, "Export C code" )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:15:11
|
Revision: 367
http://svn.sourceforge.net/cadcdev/?rev=367&view=rev
Author: bardtx
Date: 2006-09-17 17:14:59 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: More example fixes, some by me, some from here:
https://sourceforge.net/mailarchive/forum.php?thread_id=10927199&forum_id=2046
Modified Paths:
--------------
kos/examples/dreamcast/basic/exec/Makefile
kos/examples/dreamcast/basic/exec/exec.c
kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c
kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp
kos/examples/dreamcast/lua/basic/lua.c
kos/examples/dreamcast/sound/hello-mp3/Makefile
kos/examples/dreamcast/sound/hello-ogg/Makefile
Modified: kos/examples/dreamcast/basic/exec/Makefile
===================================================================
--- kos/examples/dreamcast/basic/exec/Makefile 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/basic/exec/Makefile 2006-09-18 00:14:59 UTC (rev 367)
@@ -26,7 +26,7 @@
$(SUBTARGET): $(SUBOBJS)
$(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o sub.elf $(KOS_START) \
$(SUBOBJS) $(OBJEXTRA) $(KOS_LIBS)
- $(KOS_OBJCOPY) -O binary sub.elf $(SUBTARGET)
+ $(KOS_OBJCOPY) -O binary -R .stack sub.elf $(SUBTARGET)
# You can safely remove the next two targets if you don't use a ROMDISK
romdisk.img: $(SUBTARGET)
Modified: kos/examples/dreamcast/basic/exec/exec.c
===================================================================
--- kos/examples/dreamcast/basic/exec/exec.c 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/basic/exec/exec.c 2006-09-18 00:14:59 UTC (rev 367)
@@ -10,6 +10,8 @@
extern uint8 romdisk[];
KOS_INIT_ROMDISK(romdisk);
+#define false (1 == 0)
+
int main(int argc, char **argv) {
file_t f;
void *subelf;
Modified: kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c
===================================================================
--- kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/kgl/basic/vfzclip/vfzclip.c 2006-09-18 00:14:59 UTC (rev 367)
@@ -11,6 +11,9 @@
#define SDIFF 0.001f
+#define true (1 == 1)
+#define false (1 == 0)
+
CVSID("$Id");
/*
Modified: kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp
===================================================================
--- kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/kgl/demos/tunnel/menu.cpp 2006-09-18 00:14:59 UTC (rev 367)
@@ -38,6 +38,13 @@
memcpy(madd->pformat, pformat, strlen(pformat)+1);
printf("[i**]menu->add = %d\n", strlen(pformat)+1);
}
+
+// lvalue cast fix for C++, as proposed by Jim Ursetto
+// http://sourceforge.net/mailarchive/message.php?msg_id=9293303
+template <typename T, typename X> inline T& lvalue_cast(X& x) {
+ return *( reinterpret_cast<T*>(&x) ); // *((T *)& x)
+}
+
void Menu::add(float min, float max, float amt, float* pval, char *pformat) {
Menuitem_t* madd;
if (mlist == NULL) {
@@ -56,7 +63,7 @@
uf2i.f = min; madd->min = uf2i.i;
uf2i.f = max; madd->max = uf2i.i;
uf2i.f = amt; madd->amt = uf2i.i;
- (float *)madd->pvalue = (float *)pval;
+ lvalue_cast<float *>(madd->pvalue) = pval;
madd->pformat = (char*) malloc(strlen(pformat)+1);
memcpy(madd->pformat, pformat, strlen(pformat)+1);
printf("[f**]menu->add = %d\n", strlen(pformat)+1);
Modified: kos/examples/dreamcast/lua/basic/lua.c
===================================================================
--- kos/examples/dreamcast/lua/basic/lua.c 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/lua/basic/lua.c 2006-09-18 00:14:59 UTC (rev 367)
@@ -34,9 +34,6 @@
static lua_Hook old_linehook = NULL;
static lua_Hook old_callhook = NULL;
-int errno = 0;
-int _impure_ptr = 0;
-
static void userinit (void) {
lua_baselibopen(L);
lua_iolibopen(L);
Modified: kos/examples/dreamcast/sound/hello-mp3/Makefile
===================================================================
--- kos/examples/dreamcast/sound/hello-mp3/Makefile 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/sound/hello-mp3/Makefile 2006-09-18 00:14:59 UTC (rev 367)
@@ -11,8 +11,7 @@
-rm -f romdisk.o romdisk.img
$(TARGET): $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) $(DATAOBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -lmp3 -lm -lkallisti -lgcc
+ kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -lmp3 -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
Modified: kos/examples/dreamcast/sound/hello-ogg/Makefile
===================================================================
--- kos/examples/dreamcast/sound/hello-ogg/Makefile 2006-09-18 00:05:50 UTC (rev 366)
+++ kos/examples/dreamcast/sound/hello-ogg/Makefile 2006-09-18 00:14:59 UTC (rev 367)
@@ -18,9 +18,8 @@
# You can choose a decoder to test below. Tremor is the integer-only
# version, and oggvorbisplay is the full FP version.
$(TARGET): $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) $(DATAOBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -ltremor -lm -lkallisti -lgcc
-# $(OBJS) $(DATAOBJS) $(OBJEXTRA) -L$(KOS_BASE)/lib -loggvorbisplay -lm -lkallisti -lgcc
+ kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -ltremor -lm
+# kos-cc -o $(TARGET) $(OBJS) $(DATAOBJS) $(OBJEXTRA) -loggvorbisplay -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:05:56
|
Revision: 366
http://svn.sourceforge.net/cadcdev/?rev=366&view=rev
Author: bardtx
Date: 2006-09-17 17:05:50 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Still yet more joy of example fixes
Modified Paths:
--------------
kos/examples/dreamcast/2ndmix/Makefile
kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile
kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c
kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c
kos/examples/dreamcast/tsunami/genmenu/Makefile
Modified: kos/examples/dreamcast/2ndmix/Makefile
===================================================================
--- kos/examples/dreamcast/2ndmix/Makefile 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/2ndmix/Makefile 2006-09-18 00:05:50 UTC (rev 366)
@@ -20,7 +20,7 @@
rm -f romdisk.img
2ndmix.elf: $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o 2ndmix.elf $(KOS_START) $(OBJS) $(KOS_LIBS)
+ kos-cc -o 2ndmix.elf $(OBJS)
run: 2ndmix.elf
$(KOS_LOADER) 2ndmix.elf
Modified: kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile
===================================================================
--- kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/sound/ghettoplay-vorbis/Makefile 2006-09-18 00:05:50 UTC (rev 366)
@@ -11,8 +11,7 @@
-rm -f $(OBJS)
$(TARGET): $(OBJS)
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) $(DATAOBJS) $(OBJEXTRA) -loggvorbisplay -lm $(KOS_LIBS)
+ kos-cc -o $(TARGET) $(OBJS) -loggvorbisplay -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
Modified: kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c
===================================================================
--- kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/sound/ghettoplay-vorbis/ghettoplay.c 2006-09-18 00:05:50 UTC (rev 366)
@@ -113,6 +113,7 @@
pvr_init_defaults();
/* Initialize oggvorbis player thread */
+ snd_stream_init();
sndoggvorbis_init();
/* Setup the mouse/font texture */
Modified: kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c
===================================================================
--- kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/sound/ghettoplay-vorbis/songmenu.c 2006-09-18 00:05:50 UTC (rev 366)
@@ -52,7 +52,7 @@
static int curpos = 0;
static int filtinitted = 0;
-static void snd_hook(void * obj, int freq, int chn, void ** buf, int *req) {
+static void snd_hook(int strm, void * obj, int freq, int chn, void ** buf, int *req) {
int actual;
uint64 t;
@@ -395,7 +395,7 @@
hookmut = mutex_create();
}
if (!filtinitted) {
- snd_stream_filter_add(snd_hook, NULL);
+ snd_stream_filter_add(0, snd_hook, NULL);
filtinitted = 1;
}
Modified: kos/examples/dreamcast/tsunami/genmenu/Makefile
===================================================================
--- kos/examples/dreamcast/tsunami/genmenu/Makefile 2006-09-18 00:05:11 UTC (rev 365)
+++ kos/examples/dreamcast/tsunami/genmenu/Makefile 2006-09-18 00:05:50 UTC (rev 366)
@@ -17,8 +17,7 @@
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS) romdisk.o
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) romdisk.o $(OBJEXTRA) -ltsunami -lk++ -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm $(KOS_LIBS)
+ kos-c++ -o $(TARGET) $(OBJS) romdisk.o -ltsunami -lparallax -lpng -ljpeg -lkmg -lz -lkosutils -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:05:16
|
Revision: 365
http://svn.sourceforge.net/cadcdev/?rev=365&view=rev
Author: bardtx
Date: 2006-09-17 17:05:11 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Some makefile fixes in examples
Modified Paths:
--------------
kos/examples/dreamcast/cpp/clock/Makefile
kos/examples/dreamcast/cpp/dcplib/Makefile
kos/examples/dreamcast/cpp/gltest/Makefile
Modified: kos/examples/dreamcast/cpp/clock/Makefile
===================================================================
--- kos/examples/dreamcast/cpp/clock/Makefile 2006-09-18 00:01:19 UTC (rev 364)
+++ kos/examples/dreamcast/cpp/clock/Makefile 2006-09-18 00:05:11 UTC (rev 365)
@@ -18,8 +18,7 @@
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS) romdisk.o
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) romdisk.o $(OBJEXTRA) -ldcplib -lk++ -lm $(KOS_LIBS)
+ kos-c++ -o $(TARGET) $(OBJS) romdisk.o -ldcplib -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
Modified: kos/examples/dreamcast/cpp/dcplib/Makefile
===================================================================
--- kos/examples/dreamcast/cpp/dcplib/Makefile 2006-09-18 00:01:19 UTC (rev 364)
+++ kos/examples/dreamcast/cpp/dcplib/Makefile 2006-09-18 00:05:11 UTC (rev 365)
@@ -19,8 +19,7 @@
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS) romdisk.o
- $(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) romdisk.o $(OBJEXTRA) -ldcplib -lk++ -lm $(KOS_LIBS)
+ kos-c++ -o $(TARGET) $(OBJS) romdisk.o -ldcplib -lm
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
Modified: kos/examples/dreamcast/cpp/gltest/Makefile
===================================================================
--- kos/examples/dreamcast/cpp/gltest/Makefile 2006-09-18 00:01:19 UTC (rev 364)
+++ kos/examples/dreamcast/cpp/gltest/Makefile 2006-09-18 00:05:11 UTC (rev 365)
@@ -17,8 +17,7 @@
-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS) romdisk.o
- $(KOS_CCPLUS) $(KOS_CFLAGS) $(KOS_CPPFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
- $(OBJS) romdisk.o $(OBJEXTRA) -lk++ -lgl -lpcx -lkosutils $(KOS_LIBS)
+ kos-c++ -o $(TARGET) $(OBJS) romdisk.o -lgl -lpcx -lkosutils
romdisk.img:
$(KOS_GENROMFS) -f romdisk.img -d romdisk -v
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-18 00:01:23
|
Revision: 364
http://svn.sourceforge.net/cadcdev/?rev=364&view=rev
Author: bardtx
Date: 2006-09-17 17:01:19 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
dcload: Fix bfd support for binutils-2.15, and add external clock support.
https://sourceforge.net/mailarchive/forum.php?thread_id=30345196&forum_id=2046
Modified Paths:
--------------
dcload/dcload-serial/host-src/tool/dc-tool.c
dcload/dcload-serial/target-src/dcload/scif.c
Modified: dcload/dcload-serial/host-src/tool/dc-tool.c
===================================================================
--- dcload/dcload-serial/host-src/tool/dc-tool.c 2006-09-17 23:57:35 UTC (rev 363)
+++ dcload/dcload-serial/host-src/tool/dc-tool.c 2006-09-18 00:01:19 UTC (rev 364)
@@ -604,6 +604,9 @@
* N=13 (alternate, -3.1% error) for 115200
*/
+/* use_extclk controls whether the DC's serial port will use an external clock */
+int use_extclk = 0;
+
int change_speed(char *device_name, unsigned int speed)
{
unsigned char c;
@@ -614,6 +617,8 @@
blread(&c, 1);
if (speedhack && (speed == 115200))
send_uint(111600); /* get dcload to pick N=13 rather than N=12 */
+ else if (use_extclk)
+ send_uint(0);
else
send_uint(speed);
printf("Changing speed to %d bps... ", speed);
@@ -660,6 +665,7 @@
printf("-t <device> Use <device> to communicate with dc (default: %s)\n", SERIALDEVICE);
printf("-b <baudrate> Use <baudrate> (default: %d)\n", BAUD_RATE);
printf("-e Try alternate 115200 (must also use -b 115200)\n");
+ printf("-E Use an external clock for the DC's serial port\n");
printf("-n Do not attach console and fileserver\n");
printf("-p Use dumb terminal rather than console/fileserver\n");
printf("-q Do not clear screen before download\n");
@@ -699,20 +705,20 @@
if ((section->flags & SEC_HAS_CONTENTS) && (section->flags & SEC_LOAD)) {
printf("Section %s, ",section->name);
printf("lma 0x%x, ",section->lma);
- printf("size %d\n",section->size);
- if (section->size) {
- size += section->size;
- inbuf = malloc(section->size);
- bfd_get_section_contents(somebfd, section, inbuf, 0, section->size);
+ printf("size %d\n",section->_raw_size);
+ if (section->_raw_size) {
+ size += section->_raw_size;
+ inbuf = malloc(section->_raw_size);
+ bfd_get_section_contents(somebfd, section, inbuf, 0, section->_raw_size);
c = 'B';
serial_write(&c, 1);
blread(&c, 1);
send_uint(section->lma);
- send_uint(section->size);
+ send_uint(section->_raw_size);
- send_data(inbuf, section->size, 1);
+ send_data(inbuf, section->_raw_size, 1);
free(inbuf);
}
@@ -970,7 +976,7 @@
if (argc < 2)
usage();
- someopt = getopt(argc, argv, "x:u:d:a:s:t:b:c:i:npqheg");
+ someopt = getopt(argc, argv, "x:u:d:a:s:t:b:c:i:npqheEg");
while (someopt > 0) {
switch (someopt) {
case 'x':
@@ -1038,6 +1044,9 @@
case 'e':
speedhack = 1;
break;
+ case 'E':
+ use_extclk = 1;
+ break;
case 'g':
printf("Starting a GDB server on port 2159\n");
open_gdb_socket(2159);
Modified: dcload/dcload-serial/target-src/dcload/scif.c
===================================================================
--- dcload/dcload-serial/target-src/dcload/scif.c 2006-09-17 23:57:35 UTC (rev 363)
+++ dcload/dcload-serial/target-src/dcload/scif.c 2006-09-18 00:01:19 UTC (rev 364)
@@ -35,23 +35,27 @@
void scif_init(int bps)
{
+ /* Modified to allow external baudrate (bps == 0) */
+
int i;
-
- *SCSCR2 = 0x0; /* clear TE and RE bits in SCSCR2 */
+
+ *SCSCR2 = bps ? 0x0 : 0x02; /* clear TE and RE bits / if (bps == 0) CKE1 on (bit 1) */
*SCFCR2 = 0x6; /* set TFRST and RFRST bits in SCFCR2 */
*SCSMR2 = 0x0; /* set data transfer format 8n1 */
- *SCBRR2 = (50 * 1000000) / (32 * bps) - 1; /* set bit rate */
+
+ if (bps) *SCBRR2 = (50 * 1000000) / (32 * bps) - 1; /* if (bps != 0) set baudrate */
+
for (i = 0; i < 100000; i++); /* delay at least 1 bit interval */
-
+
*SCFCR2 = 12;
*SCFCR2 = 0x8; /* set MCE in SCFCR2 */
*SCSPTR2 = 0;
*SCFSR2 = 0x60;
*SCLSR2 = 0;
- *SCSCR2 = 0x30; /* set TE and RE bits in SCSCR2 */
-
- for (i = 0; i < 100000; i++);
+ *SCSCR2 = bps ? 0x30 : 0x32; /* set TE and RE bits / if (bps == 0) CKE1 on (bit 1) */
+
+ for (i = 0; i < 100000; i++);
}
unsigned char scif_getchar(void)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-17 23:57:39
|
Revision: 363
http://svn.sourceforge.net/cadcdev/?rev=363&view=rev
Author: bardtx
Date: 2006-09-17 16:57:35 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Fix romdisk name matching, from mailing list:
https://sourceforge.net/mailarchive/forum.php?thread_id=30552911&forum_id=2046
Modified Paths:
--------------
kos/kernel/fs/fs_romdisk.c
Modified: kos/kernel/fs/fs_romdisk.c
===================================================================
--- kos/kernel/fs/fs_romdisk.c 2006-09-17 23:55:52 UTC (rev 362)
+++ kos/kernel/fs/fs_romdisk.c 2006-09-17 23:57:35 UTC (rev 363)
@@ -128,7 +128,8 @@
}
/* Check filename */
- if (!strncasecmp(fhdr->filename, fn, fnlen)) {
+ if ((strlen(fhdr->filename) == fnlen) && (!strncasecmp(fhdr->filename, fn, fnlen))) {
+
/* Match: return this index */
return i;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ba...@us...> - 2006-09-17 23:55:55
|
Revision: 362
http://svn.sourceforge.net/cadcdev/?rev=362&view=rev
Author: bardtx
Date: 2006-09-17 16:55:52 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
kos: Missed part of revision #358 (patch #1552702 from SF)
Revision Links:
--------------
http://svn.sourceforge.net/cadcdev/?rev=358&view=rev
Modified Paths:
--------------
kos/kernel/fs/fs.c
Modified: kos/kernel/fs/fs.c
===================================================================
--- kos/kernel/fs/fs.c 2006-09-17 23:53:05 UTC (rev 361)
+++ kos/kernel/fs/fs.c 2006-09-17 23:55:52 UTC (rev 362)
@@ -31,6 +31,8 @@
#include <string.h>
#include <assert.h>
#include <errno.h>
+#include <stdlib.h>
+#include <limits.h>
#include <kos/fs.h>
#include <kos/thread.h>
#include <kos/mutex.h>
@@ -91,21 +93,6 @@
return &root_readdir_dirent;
}
-/* Resolve a relative path into a regular path */
-static void fs_resolve_relative(const char *fn, char *rfn) {
- /* For now we don't do anything but tack on the thread's
- pwd to the front of the filename. Later we need to do
- resolution of '..' and so on. */
- const char *root;
-
- root = thd_get_pwd(thd_get_current());
-
- /* Copy in the path names, careful of buffer limitations */
- strncpy(rfn, root, 255);
- strcat(rfn, "/");
- strncat(rfn, fn, (255 - strlen(rfn)) - 1);
-}
-
/* This version of open deals with raw handles only. This is below the level
of file descriptors. It is used by the standard fs_open below. The
returned handle will have no references attached to it. */
@@ -115,10 +102,13 @@
const char *cname;
void *h;
fs_hnd_t *hnd;
- char rfn[256];
+ char rfn[PATH_MAX];
+ if (!realpath(fn, rfn))
+ return NULL;
+
/* Are they trying to open the root? */
- if (!strcmp(fn, "/")) {
+ if (!strcmp(rfn, "/")) {
if ((mode & O_DIR))
return fs_root_opendir();
else {
@@ -127,14 +117,8 @@
}
}
- /* Are they using a relative path? */
- if (fn[0] != '/') {
- fs_resolve_relative(fn, rfn);
- fn = (const char *)rfn;
- }
-
/* Look for a handler */
- nmhnd = nmmgr_lookup(fn);
+ nmhnd = nmmgr_lookup(rfn);
if (nmhnd == NULL || nmhnd->type != NMMGR_TYPE_VFS) {
errno = ENOENT;
return NULL;
@@ -142,7 +126,7 @@
cur = (vfs_handler_t *)nmhnd;
/* Found one -- get the "canonical" path name */
- cname = fn + strlen(nmhnd->pathname);
+ cname = rfn + strlen(nmhnd->pathname);
/* Invoke the handler */
if (cur->open == NULL) {
@@ -427,15 +411,19 @@
int fs_rename(const char *fn1, const char *fn2) {
vfs_handler_t *fh1, *fh2;
+ char rfn1[PATH_MAX], rfn2[PATH_MAX];
+ if (!realpath(fn1, rfn1) || !realpath(fn2, rfn2))
+ return -1;
+
/* Look for handlers */
- fh1 = fs_verify_handler(fn1);
+ fh1 = fs_verify_handler(rfn1);
if (fh1 == NULL) {
errno = ENOENT;
return -1;
}
- fh2 = fs_verify_handler(fn1);
+ fh2 = fs_verify_handler(rfn2);
if (fh2 == NULL) {
errno = ENOENT;
return -1;
@@ -447,8 +435,8 @@
}
if (fh1->rename)
- return fh1->rename(fh1, fn1+strlen(fh1->nmmgr.pathname),
- fn2+strlen(fh1->nmmgr.pathname));
+ return fh1->rename(fh1, rfn1+strlen(fh1->nmmgr.pathname),
+ rfn2+strlen(fh1->nmmgr.pathname));
else {
errno = EINVAL;
return -1;
@@ -457,13 +445,17 @@
int fs_unlink(const char *fn) {
vfs_handler_t *cur;
-
+ char rfn[PATH_MAX];
+
+ if (!realpath(fn, rfn))
+ return -1;
+
/* Look for a handler */
- cur = fs_verify_handler(fn);
+ cur = fs_verify_handler(rfn);
if (cur == NULL) return 1;
if (cur->unlink)
- return cur->unlink(cur, fn+strlen(cur->nmmgr.pathname));
+ return cur->unlink(cur, rfn+strlen(cur->nmmgr.pathname));
else {
errno = EINVAL;
return -1;
@@ -471,7 +463,12 @@
}
int fs_chdir(const char *fn) {
- thd_set_pwd(thd_get_current(), fn);
+ char rfn[PATH_MAX];
+
+ if (!realpath(fn, rfn))
+ return -1;
+
+ thd_set_pwd(thd_get_current(), rfn);
return 0;
}
@@ -503,13 +500,17 @@
int fs_stat(const char * fn, stat_t * rv) {
vfs_handler_t *cur;
-
+ char rfn[PATH_MAX];
+
+ if (!realpath(fn, rfn))
+ return -1;
+
/* Look for a handler */
- cur = fs_verify_handler(fn);
+ cur = fs_verify_handler(rfn);
if (cur == NULL) return -1;
if (cur->stat)
- return cur->stat(cur, fn+strlen(cur->nmmgr.pathname), rv);
+ return cur->stat(cur, rfn+strlen(cur->nmmgr.pathname), rv);
else {
errno = EINVAL;
return -1;
@@ -518,13 +519,17 @@
int fs_mkdir(const char * fn) {
vfs_handler_t *cur;
-
+ char rfn[PATH_MAX];
+
+ if (!realpath(fn, rfn))
+ return -1;
+
/* Look for a handler */
- cur = fs_verify_handler(fn);
+ cur = fs_verify_handler(rfn);
if (cur == NULL) return -1;
if (cur->mkdir)
- return cur->mkdir(cur, fn+strlen(cur->nmmgr.pathname));
+ return cur->mkdir(cur, rfn+strlen(cur->nmmgr.pathname));
else {
errno = EINVAL;
return -1;
@@ -533,13 +538,17 @@
int fs_rmdir(const char * fn) {
vfs_handler_t *cur;
-
+ char rfn[PATH_MAX];
+
+ if (!realpath(fn, rfn))
+ return -1;
+
/* Look for a handler */
- cur = fs_verify_handler(fn);
+ cur = fs_verify_handler(rfn);
if (cur == NULL) return -1;
if (cur->rmdir)
- return cur->rmdir(cur, fn+strlen(cur->nmmgr.pathname));
+ return cur->rmdir(cur, rfn+strlen(cur->nmmgr.pathname));
else {
errno = EINVAL;
return -1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|