From bc98e7be2dda30f1e10139b7af0981e4a8c6305d Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 31 Jul 2006 06:04:44 +0000 Subject: [PATCH] tinkered around with some more docs --- src/cart.cpp | 9 +++------ src/config.cpp | 2 +- src/filter.cpp | 3 +++ src/md5.cpp | 19 ++++++++---------- src/memory.cpp | 54 ++++++++++---------------------------------------- src/nsf.cpp | 3 +++ 6 files changed, 28 insertions(+), 62 deletions(-) diff --git a/src/cart.cpp b/src/cart.cpp index 33aafdfd..27e3ab1f 100644 --- a/src/cart.cpp +++ b/src/cart.cpp @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/// \file +/// \brief This file contains all code for coordinating the mapping in of the address space external to the NES. + #include #include #include @@ -32,12 +35,6 @@ #include "general.h" -/* - This file contains all code for coordinating the mapping in of the - address space external to the NES. - It's also (ab)used by the NSF code. -*/ - uint8 *Page[32],*VPage[8]; uint8 **VPageR=VPage; uint8 *VPageG[8]; diff --git a/src/config.cpp b/src/config.cpp index 4320379e..a9dfdee6 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1,5 +1,5 @@ /// \file -/// \brief A poorly documented file. +/// \brief Contains methods related to the build configuration #include #include diff --git a/src/filter.cpp b/src/filter.cpp index 1d31b3f5..6ea4517f 100644 --- a/src/filter.cpp +++ b/src/filter.cpp @@ -1,3 +1,6 @@ +/// \file +/// \brief Sound filtering code + #include #include #include "types.h" diff --git a/src/md5.cpp b/src/md5.cpp index 174d3ee2..873937e2 100644 --- a/src/md5.cpp +++ b/src/md5.cpp @@ -1,15 +1,12 @@ -/* - * RFC 1321 compliant MD5 implementation, - * by Christophe Devine ; - * this program is licensed under the GPL. - */ +/// \file +/// brief RFC 1321 compliant MD5 implementation, +/// RFC 1321 compliant MD5 implementation, +/// by Christophe Devine ; +/// this program is licensed under the GPL. -/* Modified October 3, 2003, to remove testing code, and add - include of "types.h". - - Added simple MD5 to ASCII string conversion function. - -Xodnizel -*/ +//Modified October 3, 2003, to remove testing code, and add include of "types.h". +//Added simple MD5 to ASCII string conversion function. +// -Xodnizel #include #include "types.h" diff --git a/src/memory.cpp b/src/memory.cpp index 28694071..9e85b742 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -18,13 +18,16 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +/// \file +/// \brief memory management services provided by FCEU core +#include #include "types.h" #include "fceu.h" #include "memory.h" #include "general.h" +///allocates the specified number of bytes. exits process if this fails void *FCEU_gmalloc(uint32 size) { void *ret; @@ -37,6 +40,7 @@ void *FCEU_gmalloc(uint32 size) return ret; } +///allocates the specified number of bytes. returns null if this fails void *FCEU_malloc(uint32 size) { void *ret; @@ -49,52 +53,14 @@ void *FCEU_malloc(uint32 size) return ret; } -void FCEU_free(void *ptr) // Might do something with this and FCEU_malloc later... -{ - free(ptr); -} - +///frees memory allocated with FCEU_gmalloc void FCEU_gfree(void *ptr) { free(ptr); } -void FASTAPASS(3) FCEU_memmove(void *d, void *s, uint32 l) +///frees memory allocated with FCEU_malloc +void FCEU_free(void *ptr) // Might do something with this and FCEU_malloc later... { - uint32 x; - int t; - - /* Type really doesn't matter. */ - t=(int)d; - t|=(int)s; - t|=(int)l; - - if(t&3) // Not 4-byte aligned and/or length is not a multiple of 4. - { - uint8 *tmpd, *tmps; - - tmpd = (uint8*)d; //mbg merge 7/17/06 added cast - tmps = (uint8*)s; //mbg merge 7/17/06 added cast - - for(x=l;x;x--) // This could be optimized further, though(more tests could be performed). - { - *tmpd=*tmps; - tmpd++; - tmps++; - } - } - else - { - uint32 *tmpd, *tmps; - - tmpd = (uint32*)d; //mbg merge 7/17/06 added cast - tmps = (uint32*)s; //mbg merge 7/17/06 added cast - - for(x=l>>2;x;x--) - { - *tmpd=*tmps; - tmpd++; - tmps++; - } - } -} + free(ptr); +} \ No newline at end of file diff --git a/src/nsf.cpp b/src/nsf.cpp index 9b5cbfe9..d3021e06 100644 --- a/src/nsf.cpp +++ b/src/nsf.cpp @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/// \file +/// \brief implements a built-in NSF player. This is a perk--not a part of the emu core + #include #include #include