Skip to content
Browse files

sychronise with Shagkur's tree

git-svn-id: https://devkitpro.svn.sourceforge.net/svnroot/devkitpro/trunk/libogc@1692 258c5a1a-4f63-435d-9564-e8f6d34ab52c
  • Loading branch information...
1 parent a4ddbc4 commit 98792d4a208783c645961d34ca5a59354a56c667 wntrmute committed
View
7 .cvsignore
@@ -1,6 +1,7 @@
build
+
deps
+
lib
-include
-docs
-warn.log
+
+include
View
7 Makefile
@@ -136,7 +136,7 @@ GCSYSOBJ := newlibc.o sbrk.o open.o write.o close.o \
lock_supp.o dvd_supp.o malloc_lock.o
#---------------------------------------------------------------------------------
-TINYSMBOBJ := des.o lmhash.o smb.o nbt.o
+TINYSMBOBJ := des.o lmhash.o smb.o
#---------------------------------------------------------------------------------
ZLIBOBJ := adler32.o compress.o crc32.o gzio.o uncompr.o \
@@ -225,7 +225,7 @@ install-headers:
@cp ./gc/modplay/*.h $(INCDIR)/modplay
@cp ./gc/mad/*.h $(INCDIR)/mad
@cp ./gc/sdcard/*.h $(INCDIR)/sdcard
-
+ @cp ./*.ld $(LIBDIR)
#---------------------------------------------------------------------------------
install: install-headers
#---------------------------------------------------------------------------------
@@ -245,8 +245,7 @@ dist: install-headers
@tar -cvjf libogc-$(DATESTRING).tar.bz2 include lib license.txt
#---------------------------------------------------------------------------------
-libs: $(OGCLIB).a $(BBALIB).a $(MODLIB).a $(MADLIB).a $(DBLIB).a $(SDCARDLIB).a $(GCSYSLIB).a \
- $(ZLIB).a $(TINYSMBLIB).a $(STUBSLIB).a
+libs: $(OGCLIB).a $(BBALIB).a $(MODLIB).a $(MADLIB).a $(DBLIB).a $(SDCARDLIB).a $(GCSYSLIB).a $(ZLIB).a $(TINYSMBLIB).a $(STUBSLIB).a
#---------------------------------------------------------------------------------
#---------------------------------------------------------------------------------
View
6 gc/gccore.h
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: gccore.h,v 1.14 2005-12-09 09:24:32 shagkur Exp $
+$Id: gccore.h,v 1.15 2007-01-11 10:51:56 wntrmute Exp $
gccore.h -- GC core header
@@ -28,6 +28,9 @@ must not be misrepresented as being the original software.
distribution.
$Log: not supported by cvs2svn $
+Revision 1.14 2005/12/09 09:24:32 shagkur
+no message
+
Revision 1.13 2005/11/24 14:28:50 shagkur
- added copyright header(taken from libnds)
- introduced RCS ID and LOG token
@@ -111,6 +114,7 @@ Revision 1.13 2005/11/24 14:28:50 shagkur
* - \ref irq.h "IRQ subsystem"
* - \ref dsp.h "DSP subsystem"
* - \ref dvd.h "DVD subsystem"
+ * - \ref gx.h "GX subsystem"
* - \ref video.h "VIDEO subsystem"
* - \ref cache.h "Cache subsystem"
* - \ref card.h "Memory card subsystem"
View
6 gc/gctypes.h
@@ -1,6 +1,12 @@
#ifndef __GCTYPES_H__
#define __GCTYPES_H__
+/*! \file gctypes.h
+\brief Data type definitions
+
+*/
+
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
View
7 gc/ogc/aram.h
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: aram.h,v 1.8 2005-12-09 09:20:49 shagkur Exp $
+$Id: aram.h,v 1.9 2007-01-11 10:51:56 wntrmute Exp $
aram.h -- ARAM subsystem
@@ -28,6 +28,9 @@ must not be misrepresented as being the original software.
distribution.
$Log: not supported by cvs2svn $
+Revision 1.8 2005/12/09 09:20:49 shagkur
+no message
+
Revision 1.7 2005/11/23 16:46:21 shagkur
- more detailed description to certain functions done
@@ -155,7 +158,7 @@ u32 AR_GetDMAStatus();
* AR_Init(NULL, 0);<br>
*
* The AR_Init() function also calculates the total size of the ARAM aggregate. Note that this procedure is <b><i>destructive</i></b> - i.e., any data stored in ARAM will be corrupted.<br>
- * AR_Init()may be invoked multiple times. This function checks the state of an initialization flag; if asserted, this function will simply exit on subsequent calls. To perform another initialization of the ARAM driver, call AR_Reset() before invoking AR_Init()again.
+ * AR_Init()may be invoked multiple times. This function checks the state of an initialization flag; if asserted, this function will simply exit on subsequent calls. To perform another initialization of the ARAM driver, call AR_Reset() before invoking AR_Init() again.
*
* \param[in] stack_idx_array pointer to an array of u32 integer
* \param[in] num_entries number of entries in the specified array
View
2 gc/ogc/dvd.h
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: dvd.h,v 1.26 2006-12-01 15:21:53 wntrmute Exp $
+$Id: dvd.h,v 1.27 2007-01-11 10:51:56 wntrmute Exp $
dvd.h -- DVD subsystem
View
4 gc/ogc/gu.h
@@ -92,6 +92,10 @@ void c_guQuatMultiply(Quaternion *a,Quaternion *b,Quaternion *ab);
#ifdef GEKKO
void ps_guQuatAdd(register Quaternion *a,register Quaternion *b,register Quaternion *ab);
void ps_guQuatSub(register Quaternion *a,register Quaternion *b,register Quaternion *ab);
+void ps_guQuatMultiply(Quaternion *a,Quaternion *b,Quaternion *ab);
+void ps_guQuatScale(Quaternion *q,Quaternion *r,register f32 scale);
+void ps_guQuatNormalize(Quaternion *src,Quaternion *r,register Quaternion *unit);
+f32 ps_guQuatDotProduct(Quaternion *p,Quaternion *q);
#endif
void c_guMtxIdentity(Mtx mt);
View
486 gc/ogc/gx.h
@@ -1,6 +1,12 @@
#ifndef __GX_H__
#define __GX_H__
+/*!
+ * \file gx.h
+ * \brief GX subsystem
+ *
+ */
+
#include <gctypes.h>
#include "lwp.h"
#include "gx_struct.h"
@@ -43,7 +49,9 @@
#define GX_MTX2x4 0
#define GX_MTX3x4 1
-/* Vertex Format */
+/*! \addtogroup vtxfmt Vertex format index
+ * @{
+ */
#define GX_VTXFMT0 0
#define GX_VTXFMT1 1
#define GX_VTXFMT2 2
@@ -54,11 +62,19 @@
#define GX_VTXFMT7 7
#define GX_MAXVTXFMT 8
-/* Attribute Type */
-#define GX_NONE 0
-#define GX_DIRECT 1
-#define GX_INDEX8 2
-#define GX_INDEX16 3
+/*! @} */
+
+
+/*! \addtogroup vtxattrin Vertex data input type
+ * @{
+ */
+#define GX_NONE 0 /*!< Input data is not used */
+#define GX_DIRECT 1 /*!< Input data is set direct */
+#define GX_INDEX8 2 /*!< Input data is set by a 8bit index */
+#define GX_INDEX16 3 /*!< Input data is set by a 16bit index */
+
+/*! @} */
+
/* CompType */
#define GX_U8 0
@@ -254,12 +270,18 @@
#define GX_TLUT_8K 512
#define GX_TLUT_16K 1024
-/* Z tex op */
+/*! \addtogroup ztexop Z Texture operator
+ * @{
+ */
+
#define GX_ZT_DISABLE 0
#define GX_ZT_ADD 1
#define GX_ZT_REPLACE 2
#define GX_MAX_ZTEXOP 3
+/*! @} */
+
+
/* TexGenType */
#define GX_TG_MTX3x4 0
#define GX_TG_MTX2x4 1
@@ -358,42 +380,65 @@
#define GX_TO_ONE 5
#define GX_MAX_TEXOFFSET 6
-/* tev mode */
+/*! \addtogroup tevdefmode TEV combiner operation
+ * Color/Alpha combiner modes for GX_SetTevOp().
+ *
+ * @{
+ */
+
#define GX_MODULATE 0
#define GX_DECAL 1
#define GX_BLEND 2
#define GX_REPLACE 3
#define GX_PASSCLR 4
-/* tev color arg */
-#define GX_CC_CPREV 0
-#define GX_CC_APREV 1
-#define GX_CC_C0 2
-#define GX_CC_A0 3
-#define GX_CC_C1 4
-#define GX_CC_A1 5
-#define GX_CC_C2 6
-#define GX_CC_A2 7
-#define GX_CC_TEXC 8
-#define GX_CC_TEXA 9
-#define GX_CC_RASC 10
-#define GX_CC_RASA 11
+/*! @} */
+
+
+/*! \addtogroup tevcolorarg TEV color combiner input
+ * @{
+ */
+
+#define GX_CC_CPREV 0 /*!< Use the color value from previous TEV stage */
+#define GX_CC_APREV 1 /*!< Use the alpha value from previous TEV stage */
+#define GX_CC_C0 2 /*!< Use the color value from the color/output register 0 */
+#define GX_CC_A0 3 /*!< Use the alpha value from the color/output register 0 */
+#define GX_CC_C1 4 /*!< Use the color value from the color/output register 1 */
+#define GX_CC_A1 5 /*!< Use the alpha value from the color/output register 1 */
+#define GX_CC_C2 6 /*!< Use the color value from the color/output register 2 */
+#define GX_CC_A2 7 /*!< Use the alpha value from the color/output register 2 */
+#define GX_CC_TEXC 8 /*!< Use the color value from texture */
+#define GX_CC_TEXA 9 /*!< Use the alpha value from texture */
+#define GX_CC_RASC 10 /*!< Use the color value from rasterizer */
+#define GX_CC_RASA 11 /*!< Use the alpha value from rasterizer */
#define GX_CC_ONE 12
#define GX_CC_HALF 13
#define GX_CC_KONST 14
-#define GX_CC_ZERO 15
-
-/* tev alpha arg */
-#define GX_CA_APREV 0
-#define GX_CA_A0 1
-#define GX_CA_A1 2
-#define GX_CA_A2 3
-#define GX_CA_TEXA 4
-#define GX_CA_RASA 5
+#define GX_CC_ZERO 15 /*!< Use to pass zero value */
+
+/*! @} */
+
+
+/*! \addtogroup tevalphaarg TEV alpha combiner input
+ * @{
+ */
+
+#define GX_CA_APREV 0 /*!< Use the alpha value from previous TEV stage */
+#define GX_CA_A0 1 /*!< Use the alpha value from the color/output register 0 */
+#define GX_CA_A1 2 /*!< Use the alpha value from the color/output register 1 */
+#define GX_CA_A2 3 /*!< Use the alpha value from the color/output register 2 */
+#define GX_CA_TEXA 4 /*!< Use the alpha value from texture */
+#define GX_CA_RASA 5 /*!< Use the alpha value from rasterizer */
#define GX_CA_KONST 6
-#define GX_CA_ZERO 7
+#define GX_CA_ZERO 7 /*!< Use to pass zero value */
+
+/*! @} */
+
+
+/*! \addtogroup tevstage TEV stage
+ * @{
+ */
-/* tev stage */
#define GX_TEVSTAGE0 0
#define GX_TEVSTAGE1 1
#define GX_TEVSTAGE2 2
@@ -412,8 +457,13 @@
#define GX_TEVSTAGE15 15
#define GX_MAX_TEVSTAGE 16
+/*! @} */
+
+
+/*! \addtogroup tevop TEV combiner operator
+ * @{
+ */
-/* tev op */
#define GX_TEV_ADD 0
#define GX_TEV_SUB 1
#define GX_TEV_COMP_R8_GT 8
@@ -427,26 +477,47 @@
#define GX_TEV_COMP_A8_GT GX_TEV_COMP_RGB8_GT // for alpha channel
#define GX_TEV_COMP_A8_EQ GX_TEV_COMP_RGB8_EQ // for alpha channel
-/* tev bias */
+/*! @} */
+
+
+/*! \addtogroup tevbias TEV bias value
+ * @{
+ */
+
#define GX_TB_ZERO 0
#define GX_TB_ADDHALF 1
#define GX_TB_SUBHALF 2
#define GX_MAX_TEVBIAS 3
-/* tev scale */
+/*! @} */
+
+
+/*! \addtogroup tevscale TEV scale value
+ * @{
+ */
+
#define GX_CS_SCALE_1 0
#define GX_CS_SCALE_2 1
#define GX_CS_SCALE_4 2
#define GX_CS_DIVIDE_2 3
#define GX_MAX_TEVSCALE 4
-/* tev dst reg */
+/*! @} */
+
+
+/*! \addtogroup tevcoloutreg TEV color/output register
+ * @{
+ */
+
#define GX_TEVPREV 0
#define GX_TEVREG0 1
#define GX_TEVREG1 2
#define GX_TEVREG2 3
#define GX_MAX_TEVREG 4
+/*! @} */
+
+
/* cull mode */
#define GX_CULL_NONE 0
#define GX_CULL_FRONT 1
@@ -529,13 +600,20 @@
#define GX_TEV_KASEL_K2_A 0x1E
#define GX_TEV_KASEL_K3_A 0x1F
-/* tev swap mode */
+
+/*! \addtogroup tevswapsel TEV color swap table entry
+ * @{
+ */
+
#define GX_TEV_SWAP0 0
#define GX_TEV_SWAP1 1
#define GX_TEV_SWAP2 2
#define GX_TEV_SWAP3 3
#define GX_MAX_TEVSWAP 4
+/*! @} */
+
+
/* tev color chan */
#define GX_CH_RED 0
#define GX_CH_GREEN 1
@@ -632,16 +710,28 @@
#define GX_ZC_MID 2
#define GX_ZC_FAR 3
-/* clamp */
+/*! \addtogroup xfbclamp XFB clamp modes
+ * @{
+ */
+
#define GX_CLAMP_NONE 0
#define GX_CLAMP_TOP 1
#define GX_CLAMP_BOTTOM 2
-/* gamma */
+/*! @} */
+
+
+/*! \addtogroup gammamode Gamma values
+ * @{
+ */
+
#define GX_GM_1_0 0
#define GX_GM_1_7 1
#define GX_GM_2_2 2
+/*! @} */
+
+
/* copy mode */
#define GX_COPY_PROGRESSIVE 0
#define GX_COPY_INTLC_EVEN 2
@@ -793,6 +883,8 @@
#define GX_MAX_VTXATTRFMT GX_VA_MAXATTR
#define GX_MAX_VTXATTRFMT_LISTSIZE (GX_VA_MAXATTR+1)
+#define GX_MAX_Z24 0x00ffffff
+
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -861,7 +953,17 @@ typedef void (*GXDrawSyncCallback)(u16 token);
typedef GXTexRegion* (*GXTexRegionCallback)(GXTexObj *obj,u8 mapid);
typedef GXTlutRegion* (*GXTlutRegionCallback)(u32 tlut_name);
+/*!
+ * \fn GXFifoObj* GX_Init(void *base,u32 size)
+ * \brief Initializes the graphics processor to its initial state and should be called before any other GX functions.
+ *
+ * \param[in] base pointer to the GX fifo buffer base address. Must be aligned on a 32 Byte boundery.
+ * \param[in] size size of buffer. Must be a multiple of 32.
+ *
+ * \return pointer to the intialized GXFifoObj object.
+ */
GXFifoObj* GX_Init(void *base,u32 size);
+
void GX_InitFifoBase(GXFifoObj *fifo,void *base,u32 size);
void GX_InitFifoLimits(GXFifoObj *fifo,u32 hiwatermark,u32 lowatermark);
void GX_InitFifoPtrs(GXFifoObj *fifo,void *rd_ptr,void *wt_ptr);
@@ -871,7 +973,6 @@ void GX_SetGPFifo(GXFifoObj *fifo);
GXFifoObj* GX_GetCPUFifo();
GXFifoObj* GX_GetGPFifo();
GXDrawDoneCallback GX_SetDrawDoneCallback(GXDrawDoneCallback cb);
-GXDrawSyncCallback GX_SetDrawSyncCallback(GXDrawSyncCallback cb);
GXBreakPtCallback GX_SetBreakPtCallback(GXBreakPtCallback cb);
void GX_AbortFrame();
@@ -879,22 +980,68 @@ void GX_Flush();
void GX_SetMisc(u32 token,u32 value);
void GX_SetDrawDone();
void GX_WaitDrawDone();
+
+/*!
+ * \fn u16 GX_GetDrawSync()
+ * \brief Returns the value of the token register, which is written using the GX_SetDrawSync() function.
+ *
+ * \return the value of the token register, u16.
+ */
+u16 GX_GetDrawSync();
+
+/*!
+ * \fn void GX_SetDrawSync(u16 token)
+ * \brief This function sends a token into the command stream.
+ * When the token register is set, an interrupt will also be received by the CPU. You can install a callback on this interrupt
+ * with GX_SetDrawSyncCallback(). Draw syncs can be used to notify the CPU that the graphics processor is finished using a shared
+ * resource (a vertex array for instance).
+ *
+ * \param[in] token 16-bit value to write to the token register.
+ *
+ * \return none
+ */
void GX_SetDrawSync(u16 token);
+
+/*!
+ * \fn GXDrawSyncCallback GX_SetDrawSyncCallback(GXDrawSyncCallback cb)
+ * \brief Installs a callback that is invoked whenever a DrawSync token is encountered by the graphics pipeline. The callbacks argument is
+ * is the value of the token most recently encountered. Since it is possible to miss tokens(graphics processing does not stop while
+ * the callback is running), your code should be capable of deducing if any tokens have been missed.
+ *
+ * \param[in] callback to be invoked when the DrawSnyc tokens are encountered in the graphics pipeline.
+ *
+ * \return pointer to the previously set callback function.
+ */
+GXDrawSyncCallback GX_SetDrawSyncCallback(GXDrawSyncCallback cb);
+
void GX_DisableBreakPt();
void GX_EnableBreakPt(void *break_pt);
void GX_DrawDone();
-void GX_PixModeSync();
void GX_TexModeSync();
void GX_InvVtxCache();
void GX_ClearVtxDesc();
void GX_LoadProjectionMtx(Mtx44 mt,u8 type);
void GX_SetViewport(f32 xOrig,f32 yOrig,f32 wd,f32 ht,f32 nearZ,f32 farZ);
void GX_SetViewportJitter(f32 xOrig,f32 yOrig,f32 wd,f32 ht,f32 nearZ,f32 farZ,u32 field);
-void GX_SetCopyClear(GXColor color,u32 zvalue);
void GX_SetChanCtrl(s32 channel,u8 enable,u8 ambsrc,u8 matsrc,u8 litmask,u8 diff_fn,u8 attn_fn);
void GX_SetChanAmbColor(s32 channel,GXColor color);
void GX_SetChanMatColor(s32 channel,GXColor color);
void GX_SetArray(u32 attr,void *ptr,u8 stride);
+
+/*!
+ * \fn void GX_SetVtxAttrFmt(u8 vtxfmt,u32 vtxattr,u32 comptype,u32 compsize,u32 frac)
+ * \brief Installs a callback that is invoked whenever a DrawSync token is encountered by the graphics pipeline. The callbacks argument is
+ * is the value of the token most recently encountered. Since it is possible to miss tokens(graphics processing does not stop while
+ * the callback is running), your code should be capable of deducing if any tokens have been missed.
+ *
+ * \param[in] vtxfmt \ref vtxfmt
+ * \param[in] vtxattr to be invoked when the DrawSnyc tokens are encountered in the graphics pipeline.
+ * \param[in] comptype to be invoked when the DrawSnyc tokens are encountered in the graphics pipeline.
+ * \param[in] compsize to be invoked when the DrawSnyc tokens are encountered in the graphics pipeline.
+ * \param[in] frac to be invoked when the DrawSnyc tokens are encountered in the graphics pipeline.
+ *
+ * \return none
+ */
void GX_SetVtxAttrFmt(u8 vtxfmt,u32 vtxattr,u32 comptype,u32 compsize,u32 frac);
void GX_SetVtxAttrFmtv(u8 vtxfmt,GXVtxAttrFmt *attr_list);
void GX_SetVtxDesc(u8 attr,u8 type);
@@ -947,8 +1094,6 @@ void GX_TexCoord1s8(s8 s);
void GX_TexCoord1x8(u8 index);
void GX_TexCoord1x16(u16 index);
-void GX_SetDispCopySrc(u16 left,u16 top,u16 wd,u16 ht);
-void GX_CopyDisp(void *dest,u8 clear);
void GX_AdjustForOverscan(GXRModeObj *rmin,GXRModeObj *rmout,u16 hor,u16 ver);
void GX_LoadPosMtxImm(Mtx mt,u32 pnidx);
void GX_LoadPosMtxIdx(u16 mtxidx,u32 pnidx);
@@ -958,15 +1103,113 @@ void GX_LoadTexMtxImm(Mtx mt,u32 texidx,u8 type);
void GX_LoadTexMtxIdx(u16 mtxidx,u32 texidx,u8 type);
void GX_SetCurrentMtx(u32 mtx);
+/*!
+ * \fn void GX_SetTevOp(u8 tevstage,u8 mode)
+ * \brief Simplified function to set GX_SetTevColorIn(), GX_SetTevAlphaIn(), GX_SetTevColorOp() and GX_SetTevAlphaOp() for
+ * this <b><i>tevstage</i></b> based on a predefined combiner <b><i>mode</i></b>.
+ *
+ * \param[in] tevstage \ref tevstage.
+ * \param[in] mode \ref tevdefmode
+ *
+ * \return none
+ */
void GX_SetTevOp(u8 tevstage,u8 mode);
+
+/*!
+ * \fn void GX_SetTevColor(u8 tev_regid,GXColor color)
+ * \brief Sets the vertical clamping mode to use during the EFB to XFB or texture copy.
+ *
+ * \param[in] tev_regid \ref tevcoloutreg.
+ * \param[in] color Constant color value.
+ *
+ * \return none
+ */
void GX_SetTevColor(u8 tev_regid,GXColor color);
+
+/*!
+ * \fn void GX_SetTevColorIn(u8 tevstage,u8 a,u8 b,u8 c,u8 d)
+ * \brief Sets the input operands for one <b><i>tevstage</i></b> of the Texture Environment (TEV) color combiner unit.
+ *
+ * \param[in] tevstage \ref tevstage
+ * \param[in] a \ref tevcolorarg
+ * \param[in] b \ref tevcolorarg
+ * \param[in] c \ref tevcolorarg
+ * \param[in] d \ref tevcolorarg
+ *
+ * \return none
+ */
void GX_SetTevColorIn(u8 tevstage,u8 a,u8 b,u8 c,u8 d);
+
+/*!
+ * \fn void GX_SetTevAlphaIn(u8 tevstage,u8 a,u8 b,u8 c,u8 d)
+ * \brief Sets the input operands for one <b><i>tevstage</i></b> of the Texture Environment (TEV) alpha combiner unit.
+ *
+ * \param[in] tevstage \ref tevstage
+ * \param[in] a \ref tevalphaarg
+ * \param[in] b \ref tevalphaarg
+ * \param[in] c \ref tevalphaarg
+ * \param[in] d \ref tevalphaarg
+ *
+ * \return none
+ */
void GX_SetTevAlphaIn(u8 tevstage,u8 a,u8 b,u8 c,u8 d);
+
+/*!
+ * \fn void GX_SetTevColorOp(u8 tevstage,u8 tevop,u8 tevbias,u8 tevscale,u8 clamp,u8 tevregid)
+ * \brief Sets the <b><i>tevop</i></b>, <b><i>tevbias</i></b>, <b><i>tevscale</i></b> and <b><i>clamp</i></b>-mode operation for the color combiner
+ * for this <b><i>tevstage</i></b> of the Texture Environment (TEV) unit. This function also specifies the register, <b><i>tevregid</i></b>, that
+ * will contain the result of the color combiner function. The color combiner function is:<br>
+ *
+ * <b><i>tevregid</i></b> = (d (<b><i>tevop</i></b>) ((1.0 - c)*a + c*b) + <b><i>tevbias</i></b>) * <b><i>tevscale</i></b>;<br><br>
+ *
+ * The input parameters a,b,c and d are set using GX_SetTevColorIn().
+ *
+ * \param[in] tevstage \ref tevstage.
+ * \param[in] tevop \ref tevop
+ * \param[in] tevbias \ref tevbias.
+ * \param[in] tevscale \ref tevscale.
+ * \param[in] clamp Clamp results when GX_TRUE.
+ * \param[in] tevregid \ref tevcoloutreg
+ *
+ * \return none
+ */
void GX_SetTevColorOp(u8 tevstage,u8 tevop,u8 tevbias,u8 tevscale,u8 clamp,u8 tevregid);
+
+
+/*!
+ * \fn void GX_SetTevAlphaOp(u8 tevstage,u8 tevop,u8 tevbias,u8 tevscale,u8 clamp,u8 tevregid)
+ * \brief Sets the <b><i>tevop</i></b>, <b><i>tevbias</i></b>, <b><i>tevscale</i></b> and <b><i>clamp</i></b>-mode operation for the alpha combiner
+ * for this <b><i>tevstage</i></b> of the Texture Environment (TEV) unit. This function also specifies the register, <b><i>tevregid</i></b>, that
+ * will contain the result of the alpha combiner function. The alpha combiner function is:<br>
+ *
+ * <b><i>tevregid</i></b> = (d (<b><i>tevop</i></b>) ((1.0 - c)*a + c*b) + <b><i>tevbias</i></b>) * <b><i>tevscale</i></b>;<br><br>
+ *
+ * The input parameters a,b,c and d are set using GX_SetTevAlphaIn().
+ *
+ * \param[in] tevstage \ref tevstage.
+ * \param[in] tevop \ref tevop
+ * \param[in] tevbias \ref tevbias.
+ * \param[in] tevscale \ref tevscale.
+ * \param[in] clamp Clamp results when GX_TRUE.
+ * \param[in] tevregid \ref tevcoloutreg
+ *
+ * \return none
+ */
void GX_SetTevAlphaOp(u8 tevstage,u8 tevop,u8 tevbias,u8 tevscale,u8 clamp,u8 tevregid);
void GX_SetNumTexGens(u32 nr);
void GX_SetTexCoordGen(u16 texcoord,u32 tgen_typ,u32 tgen_src,u32 mtxsrc);
void GX_SetTexCoordGen2(u16 texcoord,u32 tgen_typ,u32 tgen_src,u32 mtxsrc,u32 normalize,u32 postmtx);
+
+/*!
+ * \fn void GX_SetZTexture(u8 op,u8 fmt,u32 bias)
+ * \brief Sets the vertical clamping mode to use during the EFB to XFB or texture copy.
+ *
+ * \param[in] op \ref ztexop
+ * \param[in] fmt \ref texfmt (Accepted values: GX_TF_Z8, GX_TF_Z16, GX_TF_Z28X8).
+ * \param[in] bias Bias value. Format is 24bit unsigned.
+ *
+ * \return none
+ */
void GX_SetZTexture(u8 op,u8 fmt,u32 bias);
void GX_SetZMode(u8 enable,u8 func,u8 update_enable);
void GX_SetZCompLoc(u8 before_tex);
@@ -988,7 +1231,35 @@ void GX_SetNumTevStages(u8 num);
void GX_SetAlphaCompare(u8 comp0,u8 ref0,u8 aop,u8 comp1,u8 ref1);
void GX_SetTevKColorSel(u8 tevstage,u8 sel);
void GX_SetTevKAlphaSel(u8 tevstage,u8 sel);
+
+/*!
+ * \fn void GX_SetTevSwapMode(u8 tevstage,u8 ras_sel,u8 tex_sel)
+ * \brief Selects a set of swap modes for the rasterized color and texture color for a given TEV stage. This allows the
+ * color components of these inputs to be rearranged or duplicated.
+ * There are four different swap mode table entries and each entry in the table specifies how the RGBA inputs map
+ * to the RGBA outputs. See GX_SetTevSwapModeTable() for more information.
+ *
+ * \param[in] tevstage \ref tevstage
+ * \param[in] ras_sel selects a swap mode for the rasterized color input.
+ * \param[in] tex_sel selects a swap mode for the texture color input.
+ *
+ * \return none
+ */
void GX_SetTevSwapMode(u8 tevstage,u8 ras_sel,u8 tex_sel);
+
+/*!
+ * \fn void GX_SetTevSwapModeTable(u8 swapid,u8 r,u8 g,u8 b,u8 a)
+ * \brief Sets up the TEV color swap table. The swap table allows the rasterized color and texture color to be swapped component-wise.
+ * An entry in the table specifies how the input color components map to the output color components.
+ *
+ * \param[in] swapid \ref tevswapsel
+ * \param[in] r input color component that should be mapped to the red output component.
+ * \param[in] g input color component that should be mapped to the green output component.
+ * \param[in] b input color component that should be mapped to the blue output component.
+ * \param[in] a input color component that should be mapped to the alpha output component.
+ *
+ * \return none
+ */
void GX_SetTevSwapModeTable(u8 swapid,u8 r,u8 g,u8 b,u8 a);
void GX_SetTevIndirect(u8 tevstage,u8 indtexid,u8 format,u8 bias,u8 mtxid,u8 wrap_s,u8 wrap_t,u8 addprev,u8 utclod,u8 a);
void GX_SetTevDirect(u8 tevstage);
@@ -1006,17 +1277,141 @@ void GX_SetDstAlpha(u8 enable,u8 a);
void GX_SetFieldMask(u8 even_mask,u8 odd_mask);
void GX_SetFieldMode(u8 field_mode,u8 half_aspect_ratio);
+/*!
+ * \fn f32 GX_GetYScaleFactor(u16 efbHeight,u16 xfbHeight)
+ * \brief Calculates an appropriate Y scale factor value for GX_SetDispCopyYScale based on the height of the EFB and
+ * the height of the XFB.
+ *
+ * \param[in] efbHeight Height of embedded framebuffer. Range from 2 to 528. Should be a multiple of 2.
+ * \param[in] xfbHeight Height of external framebuffer. Range from 2 to 1024. Should be equal or greater than efbHeight.
+ *
+ * \return Y scale factor which can be used as argument of GX_SetDispCopyYScale().
+ */
f32 GX_GetYScaleFactor(u16 efbHeight,u16 xfbHeight);
+
+/*!
+ * \fn u32 GX_SetDispCopyYScale(f32 yscale)
+ * \brief Sets the vertical scale factor for the EFB to XFB copy operation. The number of actual lines copied is returned, based on the current EFB height.
+ * You can use this number to allocate the proper XFB size. You have to call GX_SetDispCopySrc() prior to this function call if you want to get the
+ * number of lines by using this function. There is also another way (GX_GetNumXfbLines) to calculate this number.
+ *
+ * \param[in] yscale Vertical scale value. Range from 1.0 to 256.0.
+ *
+ * \return Number of lines that will be copied.
+ */
u32 GX_SetDispCopyYScale(f32 yscale);
+
+/*!
+ * \fn void GX_SetDispCopySrc(u16 left,u16 top,u16 wd,u16 ht)
+ * \brief Sets the source parameters for the EFB to XFB copy operation.
+ *
+ * \param[in] left left most source pixel to copy. Must be a multiple of 2 pixels.
+ * \param[in] top top most source line to copy. Must be a multiple of 2 lines.
+ * \param[in] wd width in pixels to copy. Must be a multiple of 2 pixels.
+ * \param[in] ht height in lines to copy. Must be a multiple of 2 lines.
+ *
+ * \return none
+ */
+void GX_SetDispCopySrc(u16 left,u16 top,u16 wd,u16 ht);
+
+/*!
+ * \fn void GX_SetDispCopyDst(u16 wd,u16 ht)
+ * \brief Sets the witdth and height of the display buffer in pixels. The application typical renders an image into the EFB(source) and
+ * then copies it into the XFB(destination) in main memory. The <b><i>wd</i></b> specifies the number of pixels between adjacent lines in the
+ * destination buffer and can be different than the width of the EFB.
+ *
+ * \param[in] wd Distance between successive lines in the XFB, in pixels. Must be a multiple of 16.
+ * \param[in] ht Height of the XFB in lines.
+ *
+ * \return none
+ */
void GX_SetDispCopyDst(u16 wd,u16 ht);
+
+/*!
+ * \fn void GX_SetCopyClamp(u8 clamp)
+ * \brief Sets the vertical clamping mode to use during the EFB to XFB or texture copy.
+ *
+ * \param[in] clamp clamp mode. bit-wise OR of \ref xfbclamp. Use GX_CLAMP_NONE for no clamping.
+ *
+ * \return none
+ */
void GX_SetCopyClamp(u8 clamp);
+
+/*!
+ * \fn void GX_SetDispCopyGamma(u8 gamma)
+ * \brief Sets the gamma correction applied to pixels during EFB to XFB copy operation.
+ *
+ * \param[in] gamma \ref gammamode
+ *
+ * \return none
+ */
void GX_SetDispCopyGamma(u8 gamma);
+
void GX_SetCopyFilter(u8 aa,u8 sample_pattern[12][2],u8 vf,u8 vfilter[7]);
void GX_SetDispCopyFrame2Field(u8 mode);
+
+/*!
+ * \fn void GX_SetCopyClear(GXColor color,u32 zvalue)
+ * \brief Sets color and Z value to clear the EFB to, during copy operations. These values are used during both display copies and texture copies.
+ *
+ * \param[in] color RGBA color (8-bit/component) to use during clear operation.
+ * \param[in] zvalue 24-bit Z value to use during clear operation. Use the constant GX_MAX_Z24 to specify the maximum depth value.
+ *
+ * \return none
+ */
+void GX_SetCopyClear(GXColor color,u32 zvalue);
+
+/*!
+ * \fn void GX_CopyDisp(void *dest,u8 clear)
+ * \brief Copies the embedded framebuffer(XFB) to the external framebuffer(XFB) in main memory. The stride of
+ * the XFB is set using GX_SetDispCopyDst(). The source image in the EFB is described using GX_SetDispCopySrc().
+ *
+ * The graphics processor will stall all graphics commands util the copy is complete.
+ *
+ * If the <b><i>clear</i></b> flag is true, the color and Z buffers will be cleared during the copy. They will be
+ * cleared to the constant values set using GX_SetCopyClear().
+ *
+ * \param[in] dest pointer to the external framebuffer. <b><i>dest</i></b> should be 32B aligned.
+ * \param[in] clear flag that indicates framebuffer should be cleared if GX_TRUE.
+ *
+ * \return none
+ */
+void GX_CopyDisp(void *dest,u8 clear);
+
void GX_SetTexCopySrc(u16 left,u16 top,u16 wd,u16 ht);
-void GX_CopyTex(void *dest,u8 clear);
void GX_SetTexCopyDst(u16 wd,u16 ht,u32 fmt,u8 mipmap);
+/*!
+ * \fn void GX_CopyTex(void *dest,u8 clear)
+ * \brief Copies the embedded framebuffer(XFB) to the texture image buffer <b><i>dest</i></b> in main memory. This is useful
+ * when creating textures using the Graphics Processor(CP).
+ * If the <b><i>clear</i></b> flag is set to GX_TRUE, the EFB will be cleared to the current color(see GX_SetCopyClear())
+ * during the copy operation.
+ *
+ * \param[in] dest pointer to the image buffer in main memory. <b><i>dest</i></b> should be 32B aligned.
+ * \param[in] clear flag that indicates framebuffer should be cleared if GX_TRUE.
+ *
+ * \return none
+ */
+void GX_CopyTex(void *dest,u8 clear);
+
+/*!
+ * \fn void GX_PixModeSync()
+ * \brief Inserts a synchronization command into the graphics FIFO. When the GPU sees this command it will allow the
+ * rest of the pipe to flush before continuing. This command is useful in certain situation such as after a GX_CopyTex()
+ * command and before a primitive that uses the copied texture.
+ *
+ * \return none
+ */
+void GX_PixModeSync();
+
+/*!
+ * \fn void GX_ClearBoundingBox()
+ * \brief Clears the bounding box values before a new image is drawn.
+ * The graphics hardware keeps track of a bounding box of pixel coordinates that are drawn in the EFB.
+ *
+ * \return none
+ */
void GX_ClearBoundingBox();
void GX_PokeAlphaMode(u8 func,u8 threshold);
void GX_PokeAlphaUpdate(u8 update_enable);
@@ -1063,7 +1458,6 @@ void GX_InitSpecularDirHA(GXLightObj *lit_obj,f32 nx,f32 ny,f32 nz,f32 hx,f32 hy
void GX_InitSpecularDir(GXLightObj *lit_obj,f32 nx,f32 ny,f32 nz);
void GX_InitLightSpot(GXLightObj *lit_obj,f32 cut_off,u8 spotfn);
-u16 GX_GetDrawSync();
u32 GX_ReadClksPerVtx();
u32 GX_GetOverflowCount();
u32 GX_ResetOverflowCount();
View
2 gc/ogc/system.h
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: system.h,v 1.28 2006-12-01 15:21:53 wntrmute Exp $
+$Id: system.h,v 1.29 2007-01-11 10:51:56 wntrmute Exp $
system.h -- OS functions and initialization
View
13 gc/smb.h
@@ -103,19 +103,6 @@ typedef struct
char name[256];
} SMBDIRENTRY;
-typedef struct
-{
- char gcip[16];
- char gwip[16];
- char mask[16];
- char smbip[16];
- char smbuser[20];
- char smbpwd[20];
- char smbgcid[20];
- char smbsvid[20];
- char smbshare[20];
-} SMBINFO;
-
/**
* Prototypes
*/
View
2 gc/tinysmb/des.h
@@ -9,7 +9,7 @@
*
* Email: crh@ubiqx.mn.org
*
- * $Id: des.h,v 1.1 2006-12-19 14:21:54 wntrmute Exp $
+ * $Id: des.h,v 1.2 2007-01-11 10:51:56 wntrmute Exp $
*
* -------------------------------------------------------------------------- **
*
View
2 gc/tinysmb/lmhash.h
@@ -9,7 +9,7 @@
*
* Email: crh@ubiqx.mn.org
*
- * $Id: lmhash.h,v 1.1 2006-12-19 14:21:54 wntrmute Exp $
+ * $Id: lmhash.h,v 1.2 2007-01-11 10:51:56 wntrmute Exp $
*
* -------------------------------------------------------------------------- **
*
View
2 gc/z/deflate.h
@@ -8,7 +8,7 @@
subject to change. Applications should only use zlib.h.
*/
-/* @(#) $Id: deflate.h,v 1.1 2006-12-19 14:21:54 wntrmute Exp $ */
+/* @(#) $Id: deflate.h,v 1.2 2007-01-11 10:51:56 wntrmute Exp $ */
#ifndef DEFLATE_H
#define DEFLATE_H
View
2 gc/z/zconf.in.h
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id: zconf.in.h,v 1.1 2006-12-19 14:21:54 wntrmute Exp $ */
+/* @(#) $Id: zconf.in.h,v 1.2 2007-01-11 10:51:56 wntrmute Exp $ */
#ifndef ZCONF_H
#define ZCONF_H
View
2 gc/z/zutil.h
@@ -8,7 +8,7 @@
subject to change. Applications should only use zlib.h.
*/
-/* @(#) $Id: zutil.h,v 1.1 2006-12-19 14:21:54 wntrmute Exp $ */
+/* @(#) $Id: zutil.h,v 1.2 2007-01-11 10:51:56 wntrmute Exp $ */
#ifndef ZUTIL_H
#define ZUTIL_H
View
2 gc/zconf.h
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id: zconf.h,v 1.1 2006-12-19 14:21:53 wntrmute Exp $ */
+/* @(#) $Id: zconf.h,v 1.2 2007-01-11 10:51:56 wntrmute Exp $ */
#ifndef ZCONF_H
#define ZCONF_H
View
100 gcsdk.dsp
@@ -859,6 +859,58 @@ SOURCE=.\libtinysmb\lmhash.c
SOURCE=.\libtinysmb\smb.c
# End Source File
# End Group
+# Begin Group "libz.c"
+
+# PROP Default_Filter ".c"
+# Begin Source File
+
+SOURCE=.\libz\adler32.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\compress.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\crc32.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\deflate.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\gzio.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\infback.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\inffast.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\inflate.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\inftrees.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\trees.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\uncompr.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\libz\zutil.c
+# End Source File
+# End Group
# End Group
# Begin Group "Header Files"
@@ -1335,6 +1387,46 @@ SOURCE=.\gc\tinysmb\DES.h
SOURCE=.\gc\tinysmb\LMhash.h
# End Source File
# End Group
+# Begin Group "libz.h"
+
+# PROP Default_Filter ".h"
+# Begin Source File
+
+SOURCE=.\gc\z\crc32.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\deflate.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\inffast.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\inffixed.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\inflate.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\inftrees.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\trees.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\zconf.in.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\z\zutil.h
+# End Source File
+# End Group
# Begin Source File
SOURCE=.\gc\debug.h
@@ -1375,6 +1467,14 @@ SOURCE=.\gc\sdcard.h
SOURCE=.\gc\smb.h
# End Source File
+# Begin Source File
+
+SOURCE=.\gc\zconf.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\gc\zlib.h
+# End Source File
# End Group
# Begin Group "Resource Files"
View
32 libdb/debug.c
@@ -34,6 +34,13 @@
#define STR_BPCODE "7d821008"
+#if UIP_LOGGING == 1
+#include <stdio.h>
+#define UIP_LOG(m) uip_log(__FILE__,__LINE__,m)
+#else
+#define UIP_LOG(m)
+#endif /* UIP_LOGGING == 1 */
+
static s32 dbg_currthr = -1;
static s32 dbg_active = 0;
static s32 dbg_instep = 0;
@@ -77,6 +84,7 @@ static struct bp_entry {
static struct bp_entry *p_bpentries = NULL;
void __breakinst();
+void c_debug_handler(frame_context *ctx);
extern lwp_t __lwp_thread_currentid();
extern BOOL __lwp_thread_exists(u32 id);
@@ -84,6 +92,7 @@ extern BOOL __lwp_thread_isalive(s32 thr_id);
extern frame_context* __lwp_thread_context(s32 thr_id);
extern void __exception_load(u32,void *,u32,void*);
+extern void __exception_sethandler(u32 nExcept, void (*pHndl)(frame_context*));
extern void __excpetion_close(u32);
extern u8 __text_start[],__data_start[],__bss_start[];
@@ -98,13 +107,17 @@ void DEBUG_Init(u16 port)
struct sockaddr_in name;
socklen_t namelen = sizeof(struct sockaddr);
+ UIP_LOG("DEBUG_Init()\n");
+
+ __lwp_thread_dispatchdisable();
+
memr_init();
uip_ipinit();
uip_pbuf_init();
uip_netif_init();
tcpip_init();
-
+
local_ip.addr = uip_ipaddr(dbg_local_ip);
netmask.addr = uip_ipaddr(dbg_netmask);
gw.addr = uip_ipaddr(dbg_gw);
@@ -115,7 +128,10 @@ void DEBUG_Init(u16 port)
uip_netif_setdefault(pnet);
dbg_listensock = tcpip_socket();
- if(dbg_listensock<0) return ;
+ if(dbg_listensock<0) {
+ __lwp_thread_dispatchenable();
+ return;
+ }
name.sin_addr.s_addr = INADDR_ANY;
name.sin_port = htons(port);
@@ -124,20 +140,24 @@ void DEBUG_Init(u16 port)
if(tcpip_bind(dbg_listensock,(struct sockaddr*)&name,&namelen)<0){
tcpip_close(dbg_listensock);
dbg_listensock = -1;
+ __lwp_thread_dispatchenable();
return;
}
if(tcpip_listen(dbg_listensock,1)<0) {
tcpip_close(dbg_listensock);
dbg_listensock = -1;
+ __lwp_thread_dispatchenable();
return;
}
- __exception_load(EX_DSI,debug_handler_start,(debug_handler_end-debug_handler_start),debug_handler_patch);
- __exception_load(EX_PRG,debug_handler_start,(debug_handler_end-debug_handler_start),debug_handler_patch);
- __exception_load(EX_TRACE,debug_handler_start,(debug_handler_end-debug_handler_start),debug_handler_patch);
+ __exception_sethandler(EX_DSI,c_debug_handler);
+ __exception_sethandler(EX_PRG,c_debug_handler);
+ __exception_sethandler(EX_TRACE,c_debug_handler);
dbg_initialized = 1;
+
}
+ __lwp_thread_dispatchenable();
}
static s32 hex(u8 ch)
@@ -423,6 +443,8 @@ void c_debug_handler(frame_context *ctx)
u32 except_thr;
frame_context *pctx = NULL;
+ UIP_LOG("c_debug_handler()\n");
+
msr = mfmsr();
mtmsr(msr&~MSR_EE);
View
28 libdb/debug_handler.S
@@ -87,11 +87,26 @@ debug_handler_transfer:
stwu sp,-EXCEPTION_FRAME_END(sp) //now we're able to adjust the stackpointer with it's cached address
mtlr r5 //move passed handler func adress to LR
+ EXCEPTION_PROLOG
+
stmw r6,GPR6_OFFSET(sp)
+/*
+ addi r14,sp,0
+
+ lis sp,__debugstack@h
+ ori sp,sp,__debugstack@l
+
+ lis r0,0
+ stw r0,0(sp)
+ stwu sp,-16(sp)
+ addi r3,r14,0x08
+*/
addi r3,sp,0x08
blrl
+// addi sp,r14,0
+
lwz r5,CR_OFFSET(sp)
mtcr r5
lwz r5,LR_OFFSET(sp)
@@ -105,6 +120,8 @@ debug_handler_transfer:
lwz r5,XER_OFFSET(sp)
mtxer r5
+ EXCEPTION_EPILOG
+
lmw r6,GPR6_OFFSET(sp)
lwz toc,GPR2_OFFSET(sp)
lwz r0,GPR0_OFFSET(sp)
@@ -171,10 +188,9 @@ __clr_ibar:
blr
.section .bss
- .align 4
-debug_context:
- .space 0x200
+ .balign 8
-debug_stack:
- .space 0x2000
-debug_stack_end:
+ .globl __debugstack_end,__debugstack
+__debugstack_end:
+ .space 0x4000
+__debugstack:
View
93 libdb/uIP/bba.c
@@ -223,7 +223,6 @@ static struct uip_netif *bba_netif = NULL;
static struct bba_priv bba_device;
static struct bba_descr cur_descr;
-static u8 rx_buffer[BBA_RX_MAX_PACKET_SIZE];
static vu32* const _siReg = (u32*)0xCC006400;
@@ -448,63 +447,68 @@ static void bba_process(struct uip_pbuf *p,struct uip_netif *dev)
}
}
-static s8_t bba_start_rx(struct uip_netif *dev)
+static s8_t bba_start_rx(struct uip_netif *dev,u32 budget)
{
- u8 *ptr;
- u16 rwp,rrp;
- u32 j,size,pkt_status,pos,top,copy;
+ s32 size;
+ u16 top,pos,rwp,rrp;
+ u32 pkt_status,recvd;
struct uip_pbuf *p,*q;
+ recvd = 0;
rwp = bba_in12(BBA_RWP);
rrp = bba_in12(BBA_RRP);
- while(rrp!=rwp) {
+ while(recvd<budget && rrp!=rwp) {
bba_ins(rrp<<8,(void*)(&cur_descr),sizeof(struct bba_descr));
le32_to_cpus((u32*)((void*)(&cur_descr)));
size = cur_descr.packet_len - 4;
pkt_status = cur_descr.status;
- if(size>(BBA_RX_MAX_PACKET_SIZE+4) || (pkt_status&(BBA_RX_STATUS_RERR|BBA_RX_STATUS_FAE))) {
- return UIP_ERR_PKTSIZE;
+ if(size>(BBA_RX_MAX_PACKET_SIZE+4)) {
+ UIP_LOG("bba_start_rx: packet dropped due to big buffer.\n");
+ continue;
}
- ptr = rx_buffer;
+ if(pkt_status&(BBA_RX_STATUS_RERR|BBA_RX_STATUS_FAE)) {
+ UIP_LOG("bba_start_rx: packet dropped due to receive errors.\n");
+ rwp = bba_in12(BBA_RWP);
+ rrp = bba_in12(BBA_RRP);
+ continue;
+ }
+
pos = (rrp<<8)+4;
top = (BBA_INIT_RHBP+1)<<8;
- bba_select();
- bba_insregister(pos);
- if((pos+size)<top) {
- bba_insdata(ptr,size);
- } else {
- u32 chunk = top-pos;
-
- bba_insdata(ptr,chunk);
- bba_deselect();
-
- rrp = BBA_INIT_RRP;
- bba_select();
- bba_insregister(rrp<<8);
- bba_insdata(ptr+chunk,(size-chunk));
- }
- bba_deselect();
-
- ptr = rx_buffer;
p = uip_pbuf_alloc(UIP_PBUF_RAW,size,UIP_PBUF_POOL);
if(p) {
- for(q=p,j=0;q!=NULL && size>0;q=q->next) {
- copy = (size>q->len)?q->len:size;
- UIP_MEMCPY(q->payload,ptr,copy);
-
- ptr += copy;
- size -= copy;
+ for(q=p;q!=NULL;q=q->next) {
+ bba_select();
+ bba_insregister(pos);
+ if((pos+size)<top) {
+ bba_insdata(q->payload,size);
+ } else {
+ s32 chunk = top-pos;
+
+ size -= chunk;
+ pos = BBA_INIT_RRP<<8;
+ bba_insdata(q->payload,chunk);
+ bba_deselect();
+
+ bba_select();
+ bba_insregister(pos);
+ bba_insdata(q->payload+chunk,size);
+ }
+ bba_deselect();
+ pos += size;
}
-
if(bba_recv_pbufs==NULL) bba_recv_pbufs = p;
else uip_pbuf_chain(bba_recv_pbufs,p);
- }
- bba_out12(BBA_RRP,cur_descr.next_packet_ptr);
+ } else
+ break;
+
+ recvd++;
+
+ bba_out12(BBA_RRP,(rrp=cur_descr.next_packet_ptr));
rwp = bba_in12(BBA_RWP);
- rrp = bba_in12(BBA_RRP);
}
return UIP_ERR_OK;
}
@@ -521,7 +525,7 @@ static inline void bba_interrupt(u16 *pstatus)
bba_out8(BBA_IR,BBA_IR_FRAGI);
}
if(status&BBA_IR_RI) {
- bba_start_rx(bba_netif);
+ bba_start_rx(bba_netif,0x10);
bba_out8(BBA_IR,BBA_IR_RI);
}
if(status&BBA_IR_REI) {
@@ -540,7 +544,7 @@ static inline void bba_interrupt(u16 *pstatus)
bba_out8(BBA_IR,BBA_IR_BUSEI);
}
if(status&BBA_IR_RBFI) {
- bba_start_rx(bba_netif);
+ bba_start_rx(bba_netif,0x10);
bba_out8(BBA_IR,BBA_IR_RBFI);
}
*pstatus |= status;
@@ -557,9 +561,9 @@ static s8_t bba_dochallengeresponse()
cnt++;
bba_devpoll(&status);
if(status==0x1000) cnt = 0;
- } while(cnt<10 && !(status&0x0800));
+ } while(cnt<100 && !(status&0x0800));
- if(cnt>=10) return UIP_ERR_IF;
+ if(cnt>=1000) return UIP_ERR_IF;
return UIP_ERR_OK;
}
@@ -660,6 +664,8 @@ static void bba_devpoll(u16 *pstatus)
u32 ret;
s64 now;
+ UIP_LOG("bba_devpoll()\n");
+
now = gettime();
if(diff_msec(bba_arp_tmr,now)>=UIP_ARP_TMRINTERVAL) {
uip_arp_timer();
@@ -779,7 +785,7 @@ s8_t uip_bba_init(struct uip_netif *dev)
ret = bba_probe(dev);
if(ret<0) return ret;
-
+
ret = bba_dochallengeresponse();
if(ret<0) return ret;
@@ -790,6 +796,7 @@ s8_t uip_bba_init(struct uip_netif *dev)
} while((ret=__bba_getlink_state_async())==0 && cnt<10000);
if(!ret) return UIP_ERR_IF;
+ dev->flags |= UIP_NETIF_FLAG_LINK_UP;
uip_netif_setup(dev);
uip_arp_init();
@@ -822,6 +829,8 @@ void uip_bba_poll(struct uip_netif *dev)
u16 status;
struct uip_pbuf *p;
+ UIP_LOG("uip_bba_poll()\n");
+
bba_devpoll(&status);
while((p=bba_recv_pbufs)!=NULL) {
View
2 libdb/uIP/uipopt.h
@@ -50,7 +50,7 @@
*
* This file is part of the uIP TCP/IP stack.
*
- * $Id: uipopt.h,v 1.14 2006-12-01 15:21:53 wntrmute Exp $
+ * $Id: uipopt.h,v 1.15 2007-01-11 10:51:56 wntrmute Exp $
*
*/
View
4 libogc.dox
@@ -99,7 +99,9 @@ INPUT = include/ogc/card.h \
include/gccore.h \
include/ogc/gx_struct.h \
include/ogc/video_types.h \
- include/ogc/dvd.h
+ include/ogc/dvd.h \
+ include/ogc/gx.h \
+ include/gctypes.h
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
View
2 libogc/card.c
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: card.c,v 1.59 2006-12-01 15:21:53 wntrmute Exp $
+$Id: card.c,v 1.60 2007-01-11 10:51:56 wntrmute Exp $
card.c -- Memory card subsystem
View
2 libogc/cond.c
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: cond.c,v 1.16 2006-12-01 15:21:53 wntrmute Exp $
+$Id: cond.c,v 1.17 2007-01-11 10:51:56 wntrmute Exp $
cond.c -- Thread subsystem V
View
2 libogc/dvd.c
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: dvd.c,v 1.51 2006-12-01 15:21:53 wntrmute Exp $
+$Id: dvd.c,v 1.52 2007-01-11 10:51:56 wntrmute Exp $
dvd.h -- DVD subsystem
View
72 libogc/exception_handler.S
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: exception_handler.S,v 1.13 2005-11-21 12:15:46 shagkur Exp $
+$Id: exception_handler.S,v 1.14 2007-01-11 10:51:56 wntrmute Exp $
exception_handler.S -- PPC exception handling support
@@ -28,6 +28,9 @@ must not be misrepresented as being the original software.
distribution.
$Log: not supported by cvs2svn $
+Revision 1.13 2005/11/21 12:15:46 shagkur
+no message
+
-------------------------------------------------------------*/
@@ -136,37 +139,14 @@ default_exceptionhandler_transfer:
addi r3,sp,0x08
blrl
- .global systemcall_handler_start,systemcall_handler_end
-systemcall_handler_start:
- mfspr r9,HID0
- ori r10,r9,0x0008
- mtspr HID0,r10
- isync
- sync
- mtspr HID0,r9
- rfi
-systemcall_handler_end:
- nop
-
- .extern _cpu_context_save_fp,_cpu_context_restore_fp
- .globl fpu_exception_handler
-fpu_exception_handler:
- mfmsr r5
- ori r5,r5,MSR_FP
- mtmsr r5
- isync
- lwz r5,SRR1_OFFSET(sp)
- ori r5,r5,MSR_FP
- mtsrr1 r5
-
- bl __thread_dispatch_fp
-
lwz r5,CR_OFFSET(sp)
mtcr r5
lwz r5,LR_OFFSET(sp)
mtlr r5
lwz r5,SRR0_OFFSET(sp)
mtsrr0 r5
+ lwz r5,SRR1_OFFSET(sp)
+ mtsrr1 r5
lwz r5,CTR_OFFSET(sp)
mtctr r5
lwz r5,XER_OFFSET(sp)
@@ -179,7 +159,6 @@ fpu_exception_handler:
lwz r0,GPR0_OFFSET(sp)
mfmsr r4
- rlwinm r4,r4,0,19,17
rlwinm r4,r4,0,31,29
mtmsr r4
isync
@@ -190,3 +169,42 @@ fpu_exception_handler:
addi sp,sp,EXCEPTION_FRAME_END
rfi
+ .global systemcall_handler_start,systemcall_handler_end
+systemcall_handler_start:
+ mfspr r9,HID0
+ ori r10,r9,0x0008
+ mtspr HID0,r10
+ isync
+ sync
+ mtspr HID0,r9
+ rfi
+systemcall_handler_end:
+ nop
+
+ .extern _cpu_context_save_fp,_cpu_context_restore_fp
+ .globl fpu_exception_handler
+fpu_exception_handler:
+ mflr r0
+ stw r0,4(sp)
+ lwz r5,SRR1_OFFSET(sp)
+ ori r5,r5,MSR_FP
+ stw r5,SRR1_OFFSET(sp)
+ stwu sp,-8(sp)
+
+ mfmsr r5
+ ori r5,r5,MSR_FP
+ mtmsr r5
+ isync
+
+ bl __thread_dispatch_fp
+
+ mfmsr r4
+ rlwinm r4,r4,0,19,17
+ mtmsr r4
+ isync
+
+ lwz r0,12(sp)
+ addi sp,sp,8
+ mtlr r0
+ blr
+
View
2 libogc/exi.c
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: exi.c,v 1.32 2006-12-01 15:21:53 wntrmute Exp $
+$Id: exi.c,v 1.33 2007-01-11 10:51:56 wntrmute Exp $
exi.c -- EXI subsystem
View
74 libogc/gu_psasm.S
@@ -610,9 +610,83 @@ ps_guQuatSub:
.globl ps_guQuatMultiply
//r3 = a, r4 = b, r5 = ab
ps_guQuatMultiply:
+ psq_l fr0,0(r3),0,0
+ psq_l fr1,8(r3),0,0
+ psq_l fr2,0(r4),0,0
+ ps_neg fr4,fr0
+ psq_l fr3,8(r4),0,0
+ ps_neg fr5,fr1
+ ps_merge01 fr6,fr4,fr0
+ ps_muls0 fr8,fr1,fr2
+ ps_muls0 fr9,fr4,fr2
+ ps_merge01 fr7,fr5,fr1
+ ps_muls1 fr11,fr6,fr2
+ ps_madds0 fr8,fr6,fr3,fr8
+ ps_muls1 fr10,fr7,fr2
+ ps_madds0 fr9,fr7,fr3,fr9
+ ps_madds1 fr11,fr5,fr3,fr11
+ ps_merge10 fr8,fr8,fr8
+ ps_madds1 fr10,fr0,fr3,fr10
+ ps_merge10 fr9,fr9,fr9
+ ps_add fr8,fr8,fr8
+ psq_st fr8,0(r5),0,0
+ ps_sub fr9,fr9,fr9
+ psq_st fr9,8(r5),0,0
+ blr
+
+ .globl ps_quQuatScale
+ //r3 = q,r4 = r, fr1 = scale
+ps_guQuatScale:
+ psq_l fr4,0(r3),0,0
+ psq_l fr5,8(r3),0,0
+ ps_muls0 fr4,fr4,fr1
+ psq_st fr4,0(r4),0,0
+ ps_muls0 fr5,fr5,fr1
+ psq_st fr5,8(r4),0,0
+ blr
+
+ .globl ps_guQuatDotProduct
+ //r3 = p, r4 = q ; fr1 = res
+ps_guQuatDotProduct:
+ psq_l fr2,0(r3),0,0
+ psq_l fr4,0(r4),0,0
+ ps_mul fr1,fr2,fr4
+ psq_l fr3,8(r3),0,0
+ psq_l fr5,8(r4),0,0
+ ps_madd fr1,fr3,fr5,fr1
+ ps_sum0 fr1,fr1,fr1,fr1
+ blr
+
+ .globl ps_guQuatNormalize
+ //r3 = src, r4 = unit
+ps_guQuatNormalize:
+ lis r9,NrmData@ha
+ addi r9,r9,NrmData@l
+ lfs fr9,0(r9)
+ lfs fr10,4(r9)
+ lis r9,QuatEpsilon@ha
+ lfs fr8,QuatEpsilon@l(r9)
+ psq_l fr0,0(r3),0,0
+ ps_mul fr2,fr0,fr0
+ psq_l fr1,8(r3),0,0
+ ps_sub fr5,fr8,fr8
+ ps_madd fr2,fr2,fr2,fr2
+ frsqrte fr3,fr2
+ ps_sub fr4,fr2,fr8
+ fmul fr6,fr3,fr3
+ fmul fr7,fr3,fr9
+ fnmsub fr6,fr6,fr2,fr10
+ fmul fr3,fr6,fr7
+ ps_sel fr3,fr4,fr3,fr5
+ ps_muls0 fr0,fr0,fr3
+ ps_muls0 fr1,fr1,fr3
+ psq_st fr0,0(r4),0,0
+ psq_st fr1,8(r4),0,0
blr
.section .data
+QuatEpsilon:
+ .float 0.00001
Unit01:
.float 0.0, 1.0
NrmData:
View
2 libogc/lwp.c
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: lwp.c,v 1.29 2006-12-01 15:21:53 wntrmute Exp $
+$Id: lwp.c,v 1.30 2007-01-11 10:51:56 wntrmute Exp $
lwp.c -- Thread subsystem I
View
2 libogc/mutex.c
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: mutex.c,v 1.14 2006-12-01 15:21:53 wntrmute Exp $
+$Id: mutex.c,v 1.15 2007-01-11 10:51:56 wntrmute Exp $
mutex.c -- Thread subsystem III
View
11 libogc/ogc_crt0.S
@@ -43,11 +43,7 @@ _start:
sub r5,r5,r3
bl _memset
-1: lis r0,0
- stw r0,0(sp)
- stwu sp,-64(sp)
-
- bl __init
+1: bl __init
bl SYS_Init # Branch to the user code!
bl __fini
@@ -89,6 +85,9 @@ InitGPRS:
lis sp,__crt0stack@h # we take 0x8173FFF0 as the topmost starting point for our stack,this gives us ~128Kb Stack
ori sp,sp,__crt0stack@l
+ addi sp,sp,-4
+ stw r0,0(sp)
+ stwu sp,-56(sp)
lis r2,_SDA2_BASE_@h
ori r2,r2,_SDA2_BASE_@l # Set the Small Data 2 (Read Only) base register.
@@ -166,7 +165,7 @@ video_line:
bdnz 1b
blr
- .section .sbss
+ .section .bss
.balign 8
__crt0stack_end:
.space 0x4000
View
2 libogc/system.c
@@ -1,6 +1,6 @@
/*-------------------------------------------------------------
-$Id: system.c,v 1.59 2006-12-01 15:21:53 wntrmute Exp $
+$Id: system.c,v 1.60 2007-01-11 10:51:56 wntrmute Exp $
system.c -- OS functions and initialization
View
13 libogcsys/dvd_supp.c
@@ -12,8 +12,10 @@ int dvd_open_f(struct _reent *r,const char *path,int flags,int mode);
int dvd_close_f(struct _reent *r,int fd);
int dvd_write_f(struct _reent *r,int fd,const char *ptr,int len);
int dvd_read_f(struct _reent *r,int fd,char *ptr,int len);
+int dvd_seek_f(struct _reent *r,int fd,int pos,int dir);
+int dvd_stat_f(struct _reent *r,int fd,struct stat *st);
-const devoptab_t dotab_dvd = {"dvd",dvd_open_f,dvd_close_f,dvd_write_f,dvd_read_f,NULL,NULL};
+const devoptab_t dotab_dvd = {"dvd",dvd_open_f,dvd_close_f,dvd_write_f,dvd_read_f,dvd_seek_f,dvd_stat_f};
int dvd_open_f(struct _reent *r,const char *path,int flags,int mode)
{
@@ -35,5 +37,12 @@ int dvd_read_f(struct _reent *r,int fd,char *ptr,int len)
return -1;
}
+int dvd_seek_f(struct _reent *r,int fd,int pos,int dir)
+{
+ return -1;
+}
-
+int dvd_stat_f(struct _reent *r,int fd,struct stat *st)
+{
+ return -1;
+}
View
4 libtinysmb/des.c
@@ -7,7 +7,7 @@
*
* Email: crh@ubiqx.mn.org
*
- * $Id: des.c,v 1.1 2006-12-01 15:21:54 wntrmute Exp $
+ * $Id: des.c,v 1.2 2007-01-11 10:51:56 wntrmute Exp $
*
* -------------------------------------------------------------------------- **
*
@@ -93,7 +93,7 @@
* ========================================================================== **
*/
-#include "des.h"
+#include "DES.h"
/* -------------------------------------------------------------------------- **
View
6 libtinysmb/lmhash.c
@@ -7,7 +7,7 @@
*
* Email: crh@ubiqx.mn.org
*
- * $Id: lmhash.c,v 1.1 2006-12-01 15:21:54 wntrmute Exp $
+ * $Id: lmhash.c,v 1.2 2007-01-11 10:51:56 wntrmute Exp $
*
* -------------------------------------------------------------------------- **
*
@@ -58,8 +58,8 @@
* ========================================================================== **
*/
-#include "des.h"
-#include "lmhash.h"
+#include "DES.h"
+#include "LMhash.h"
/* -------------------------------------------------------------------------- **
View
145 libtinysmb/smb.c
@@ -34,8 +34,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
****************************************************************************/
-/** 24 August 2006 - 0.3 - Addition of DiscoverURI NBT **/
-
#include <asm.h>
#include <stdlib.h>
#include <stdio.h>
@@ -51,7 +49,7 @@
#include "des.h"
#include "lmhash.h"
#include "smb.h"
-#include "nbt.h"
+
/**
* Field offsets.
@@ -144,12 +142,6 @@ struct _smbfile
SMBCONN conn;
};
-/*** Extern shadow values ***/
-extern char GCIP[128];
-extern char GCMASK[128];
-extern char GCGW[128];
-/*** End shadow ***/
-
/**
* NBT/SMB Wrapper
*/
@@ -279,14 +271,21 @@ static void __smb_init()
__lwp_queue_initialize(&smb_filehandle_queue,smb_filehandles,SMB_FILEHANDLES_MAX,sizeof(struct _smbfile));
}
-static SMBHANDLE* __smb_handle_allocate()
+static SMBHANDLE* __smb_allocate_handle()
{
u32 level;
SMBHANDLE *handle;
_CPU_ISR_Disable(level);
handle = (SMBHANDLE*)__lwp_objmgr_allocate(&smb_handle_objects);
- if(handle) __lwp_objmgr_open(&smb_handle_objects,&handle->object);
+ if(handle) {
+ handle->user = NULL;
+ handle->pwd = NULL;
+ handle->server_name = NULL;
+ handle->share_name = NULL;
+ handle->sck_server = INVALID_SOCKET;
+ __lwp_objmgr_open(&smb_handle_objects,&handle->object);
+ }
_CPU_ISR_Restore(level);
return handle;
}
@@ -297,6 +296,11 @@ static void __smb_free_handle(SMBHANDLE *handle)
if(handle->pwd) free(handle->pwd);
if(handle->server_name) free(handle->server_name);
if(handle->share_name) free(handle->share_name);
+
+ handle->user = NULL;
+ handle->pwd = NULL;
+ handle->server_name = NULL;
+ handle->share_name = NULL;
handle->sck_server = INVALID_SOCKET;
__smb_handle_free(handle);
@@ -603,107 +607,94 @@ static s32 SMB_NegotiateProtocol(const char *dialects[],int dialectc,SMBHANDLE *
return ret;
}
-/****************************************************************************
- * Primary setup, logon and connection all in one :)
- ****************************************************************************/
-s32 SMB_Connect(SMBCONN *smbhndl, const char *user, const char *password, const char *client, const char *server, const char *share, const char *IP)
+static s32 do_netconnect(SMBHANDLE *handle)
{
+ u32 nodelay;
s32 ret;
- u8 nodelay;
s32 sock;
- SMBHANDLE *handle;
- struct sockaddr_in clnt_addr;
-
- if(smb_inited==FALSE) {
- u32 level;
- _CPU_ISR_Disable(level);
- if(smb_inited==FALSE) __smb_init();
- _CPU_ISR_Restore(level);
- }
-
- handle = __smb_handle_allocate();
- if(!handle) return SMB_ERROR;
-
- memset(handle,0,sizeof(SMBHANDLE));
/*** Create the global net_socket ***/
sock = net_socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
- if(sock==INVALID_SOCKET) {
- __smb_free_handle(handle);
- return SMB_ERROR;
- }
+ if(sock==INVALID_SOCKET) return -1;
/*** Switch off Nagle, ON TCP_NODELAY ***/
nodelay = 1;
- ret = net_setsockopt(sock,IPPROTO_TCP,TCP_NODELAY,(char *)&nodelay,sizeof(char));
+ ret = net_setsockopt(sock,IPPROTO_TCP,TCP_NODELAY,&nodelay,sizeof(nodelay));
- /*** Attempt to connect to the server IP ***/
- clnt_addr.sin_family = AF_INET;
- clnt_addr.sin_port = htons(445);
- clnt_addr.sin_addr.s_addr = inet_addr(IP);
-
- ret = net_connect(sock,(struct sockaddr*)&clnt_addr,sizeof(clnt_addr));
+ ret = net_connect(sock,(struct sockaddr*)&handle->server_addr,sizeof(handle->server_addr));
if(ret) {
net_close(sock);
- __smb_free_handle(handle);
- return SMB_ERROR;
+ return -1;
}
handle->sck_server = sock;
- handle->user = strdup(user);
- handle->pwd = strdup(password);
- handle->server_name = strdup(server);
- handle->share_name = strdup(share);
- handle->server_addr = clnt_addr;
+ return 0;
+}
+
+static s32 do_smbconnect(SMBHANDLE *handle)
+{
+ s32 ret;
ret = SMB_NegotiateProtocol(smb_dialects,smb_dialectcnt,handle);
if(ret!=SMB_SUCCESS) {
- net_close(sock);
- __smb_free_handle(handle);
- return ret;
+ net_close(handle->sck_server);
+ return -1;
}
ret = SMB_SetupAndX(handle);
if(ret!=SMB_SUCCESS) {
- net_close(sock);
- __smb_free_handle(handle);
- return ret;
+ net_close(handle->sck_server);
+ return -1;
}
ret = SMB_TreeAndX(handle);
if(ret!=SMB_SUCCESS) {
- net_close(sock);
- __smb_free_handle(handle);
- return ret;
+ net_close(handle->sck_server);
+ return -1;
}
-
- *smbhndl =(SMBCONN)(LWP_OBJMASKTYPE(SMB_OBJTYPE_HANDLE)|LWP_OBJMASKID(handle->object.id));
- return SMB_SUCCESS;
+ return 0;
}
/****************************************************************************
- * SMB_ConnectURI
- *
- * Connect via URI
+ * Primary setup, logon and connection all in one :)
****************************************************************************/
-s32 SMB_ConnectURI( SMBCONN *smbhndl, const char *user, const char *password,
- const char *client, char *URI )
+s32 SMB_Connect(SMBCONN *smbhndl, const char *user, const char *password, const char *client, const char *server, const char *share, const char *IP)
{
- char serverIP[32];
- char server[1024];
- char share[1024];
+ s32 ret;
+ SMBHANDLE *handle;
- SplitURI( URI, server, share );
+ *smbhndl = SMB_HANDLE_NULL;
- if ( DiscoverURI( GCIP, GCMASK, URI, serverIP ) )
- {
- return SMB_Connect(smbhndl, user, password, client, server,
- share, serverIP );
+ if(smb_inited==FALSE) {
+ u32 level;
+ _CPU_ISR_Disable(level);
+ if(smb_inited==FALSE) __smb_init();
+ _CPU_ISR_Restore(level);
}
+
+ handle = __smb_allocate_handle();
+ if(!handle) return SMB_ERROR;
- return SMB_ERROR;
+ handle->user = strdup(user);
+ handle->pwd = strdup(password);
+ handle->server_name = strdup(server);
+ handle->share_name = strdup(share);
+
+ handle->server_addr.sin_family = AF_INET;
+ handle->server_addr.sin_port = htons(445);
+ handle->server_addr.sin_addr.s_addr = inet_addr(IP);
+
+ ret = do_netconnect(handle);
+ if(ret==0) ret = do_smbconnect(handle);
+ if(ret!=0) {
+ __smb_free_handle(handle);
+ return SMB_ERROR;
+ }
+ *smbhndl =(SMBCONN)(LWP_OBJMASKTYPE(SMB_OBJTYPE_HANDLE)|LWP_OBJMASKID(handle->object.id));
+ return SMB_SUCCESS;
}
+
/****************************************************************************
* SMB_Destroy
*
@@ -968,11 +959,7 @@ s32 SMB_WriteFile(const char *buffer, int size, int offset, SMBFILE sfid)
ret = 0;
if(SMBCheck(SMB_WRITE_ANDX,sizeof(NBTSMB),handle)==SMB_SUCCESS) {
ptr = handle->message.smb;
-
- /*** 0.3 - XP Home has garbage data at HDR+7! ***/
- //if(getUShort(ptr,(SMB_HEADER_SIZE+7))==0) {
- ret = getUShort(ptr,(SMB_HEADER_SIZE+5));
- //}
+ ret = getUShort(ptr,(SMB_HEADER_SIZE+5));
}
return ret;
View
2 libz/adler32.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id: adler32.c,v 1.1 2006-12-01 15:21:54 wntrmute Exp $ */
+/* @(#) $Id: adler32.c,v 1.2 2007-01-11 10:51:56 wntrmute Exp $ */
#define ZLIB_INTERNAL
#include "zlib.h"
View
2 libz/compress.c
@@ -3,7 +3,7 @@
* For conditions of distribution and use, see copyright notice in zlib.h
*/
-/* @(#) $Id: compress.c,v 1.1 2006-12-01 15:21:54 wntrmute Exp $ */
+/* @(#) $Id: compress.c,v 1.2 2007-01-11 10:51:56 wntrmute Exp $ */
#define ZLIB_INTERNAL
#include "zlib.h"
View
2 libz/crc32.c
@@ -9,7 +9,7 @@
* factor of two increase in speed on a Power PC G4 (PPC7455) using gcc -O3.
*/
-/* @(#) $Id: crc32.c,v 1.1 2006-12-01 15:21:54 wntrmute Exp $ */
+/* @(#) $Id: crc32.c,v 1.2 2007-01-11 10:51:56 wntrmute Exp $ */
/*
Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore