mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-11-14 02:02:39 +08:00
2008-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
* dswifi/arm7/makefile, dswifi/include/netinet/in.h, libnds/basicARM7/source/defaultARM7.c, libnds/include/gbfs.h, libnds/include/nds/bios.h, libnds/include/nds/card.h, libnds/include/nds/dma.h, libnds/include/nds/interrupts.h, libnds/include/nds/ipc.h, libnds/include/nds/jtypes.h, libnds/include/nds/registers_alt.h, libnds/include/nds/system.h, libnds/include/nds/timers.h, libnds/include/nds/arm7/audio.h, libnds/include/nds/arm7/clock.h, libnds/include/nds/arm7/serial.h, libnds/include/nds/arm7/touch.h, libnds/include/nds/arm9/boxtest.h, libnds/include/nds/arm9/cache.h, libnds/include/nds/arm9/console.h, libnds/include/nds/arm9/ndsmotion.h, libnds/include/nds/arm9/video.h, libnds/include/nds/arm9/videoGL.h, libnds/source/arm7/audio.c, libnds/source/arm7/clock.c, libnds/source/arm7/microphone.c, libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c, libnds/source/arm9/boxtest.c, libnds/source/arm9/gurumeditation.c, libnds/source/arm9/ndsmotion.c, libnds/source/arm9/videoGL.c, libnds/source/common/card.c, libnds/source/common/interruptDispatcher.S, touchscreen/reco.c: Fix various warnings by fixing prototypes. Remove unused .bin files. Convert all files to UNIX CF/LF. * libnds/source/arm9/COS.bin, libnds/source/arm9/SIN.bin, libnds/source/arm9/TAN.bin, libnds/source/arm9/default_font.bin: Removed.
This commit is contained in:
1 parent
e1730f64f8
commit
49a4016507
40 files changed
+8065
-8022
No files matched your search
@@ -1,3 +1,28 @@
|
||||
2008-08-19 Joel Sherrill <joel.sherrill@OARcorp.com>
|
||||
|
||||
* dswifi/arm7/makefile, dswifi/include/netinet/in.h,
|
||||
libnds/basicARM7/source/defaultARM7.c, libnds/include/gbfs.h,
|
||||
libnds/include/nds/bios.h, libnds/include/nds/card.h,
|
||||
libnds/include/nds/dma.h, libnds/include/nds/interrupts.h,
|
||||
libnds/include/nds/ipc.h, libnds/include/nds/jtypes.h,
|
||||
libnds/include/nds/registers_alt.h, libnds/include/nds/system.h,
|
||||
libnds/include/nds/timers.h, libnds/include/nds/arm7/audio.h,
|
||||
libnds/include/nds/arm7/clock.h, libnds/include/nds/arm7/serial.h,
|
||||
libnds/include/nds/arm7/touch.h, libnds/include/nds/arm9/boxtest.h,
|
||||
libnds/include/nds/arm9/cache.h, libnds/include/nds/arm9/console.h,
|
||||
libnds/include/nds/arm9/ndsmotion.h, libnds/include/nds/arm9/video.h,
|
||||
libnds/include/nds/arm9/videoGL.h, libnds/source/arm7/audio.c,
|
||||
libnds/source/arm7/clock.c, libnds/source/arm7/microphone.c,
|
||||
libnds/source/arm7/touch.c, libnds/source/arm7/userSettings.c,
|
||||
libnds/source/arm9/boxtest.c, libnds/source/arm9/gurumeditation.c,
|
||||
libnds/source/arm9/ndsmotion.c, libnds/source/arm9/videoGL.c,
|
||||
libnds/source/common/card.c,
|
||||
libnds/source/common/interruptDispatcher.S, touchscreen/reco.c: Fix
|
||||
various warnings by fixing prototypes. Remove unused .bin files.
|
||||
Convert all files to UNIX CF/LF.
|
||||
* libnds/source/arm9/COS.bin, libnds/source/arm9/SIN.bin,
|
||||
libnds/source/arm9/TAN.bin, libnds/source/arm9/default_font.bin: Removed.
|
||||
|
||||
2008-07-29 Chris Johns <chrisj@rtems.org>
|
||||
|
||||
* block/block.c: Update to the libblock changes.
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -51,7 +51,7 @@ extern "C" {
|
||||
// actually from arpa/inet.h - but is included through netinet/in.h
|
||||
unsigned long inet_addr(const char *cp);
|
||||
int inet_aton(const char *cp, struct in_addr *inp);
|
||||
char *inet_ntoa(struct in_addr in);
|
||||
char *inet_ntoa(struct in_addr in);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
|
||||
default ARM7 core
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------------
|
||||
|
||||
default ARM7 core
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
#include <nds.h>
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void startSound(int sampleRate, const void* data, u32 bytes, u8 channel, u8 vol, u8 pan, u8 format) {
|
||||
//---------------------------------------------------------------------------------
|
||||
SCHANNEL_TIMER(channel) = SOUND_FREQ(sampleRate);
|
||||
SCHANNEL_SOURCE(channel) = (u32)data;
|
||||
SCHANNEL_LENGTH(channel) = bytes >> 2 ;
|
||||
SCHANNEL_CR(channel) = SCHANNEL_ENABLE | SOUND_ONE_SHOT | SOUND_VOL(vol) | SOUND_PAN(pan) | (format==1?SOUND_8BIT:SOUND_16BIT);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
s32 getFreeSoundChannel() {
|
||||
//---------------------------------------------------------------------------------
|
||||
int i;
|
||||
for (i=0; i<16; i++) {
|
||||
if ( (SCHANNEL_CR(i) & SCHANNEL_ENABLE) == 0 ) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
//---------------------------------------------------------------------------------
|
||||
void startSound(int sampleRate, const void* data, u32 bytes, u8 channel, u8 vol, u8 pan, u8 format) {
|
||||
//---------------------------------------------------------------------------------
|
||||
SCHANNEL_TIMER(channel) = SOUND_FREQ(sampleRate);
|
||||
SCHANNEL_SOURCE(channel) = (u32)data;
|
||||
SCHANNEL_LENGTH(channel) = bytes >> 2 ;
|
||||
SCHANNEL_CR(channel) = SCHANNEL_ENABLE | SOUND_ONE_SHOT | SOUND_VOL(vol) | SOUND_PAN(pan) | (format==1?SOUND_8BIT:SOUND_16BIT);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
s32 getFreeSoundChannel() {
|
||||
//---------------------------------------------------------------------------------
|
||||
int i;
|
||||
for (i=0; i<16; i++) {
|
||||
if ( (SCHANNEL_CR(i) & SCHANNEL_ENABLE) == 0 ) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
touchPosition first,tempPos;
|
||||
@@ -89,27 +89,27 @@ void VcountHandler() {
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void VblankHandler(void) {
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
u32 i;
|
||||
|
||||
//sound code :)
|
||||
TransferSound *snd = IPC->soundData;
|
||||
IPC->soundData = 0;
|
||||
|
||||
if (0 != snd) {
|
||||
|
||||
for (i=0; i<snd->count; i++) {
|
||||
s32 chan = getFreeSoundChannel();
|
||||
|
||||
if (chan >= 0) {
|
||||
startSound(snd->data[i].rate, snd->data[i].data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------------
|
||||
void VblankHandler(void) {
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
u32 i;
|
||||
|
||||
//sound code :)
|
||||
TransferSound *snd = IPC->soundData;
|
||||
IPC->soundData = 0;
|
||||
|
||||
if (0 != snd) {
|
||||
|
||||
for (i=0; i<snd->count; i++) {
|
||||
s32 chan = getFreeSoundChannel();
|
||||
|
||||
if (chan >= 0) {
|
||||
startSound(snd->data[i].rate, snd->data[i].data, snd->data[i].len, chan, snd->data[i].vol, snd->data[i].pan, snd->data[i].format);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
@@ -131,7 +131,7 @@ int main(int argc, char ** argv) {
|
||||
|
||||
SetYtrigger(80);
|
||||
irqSet(IRQ_VCOUNT, VcountHandler);
|
||||
irqSet(IRQ_VBLANK, VblankHandler);
|
||||
irqSet(IRQ_VBLANK, VblankHandler);
|
||||
|
||||
irqEnable( IRQ_VBLANK | IRQ_VCOUNT);
|
||||
|
||||
|
||||
@@ -1,100 +1,100 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
access object in a GBFS file
|
||||
|
||||
Copyright 2002-2004 Damian Yerrick
|
||||
|
||||
Additional code Dave Murphy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Dependency on prior include files
|
||||
|
||||
Before you #include "gbfs.h", you should define the following types:
|
||||
typedef (unsigned 16-bit integer) u16;
|
||||
typedef (unsigned 32-bit integer) u32;
|
||||
Your system header should do this for you.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_GBFS_H_
|
||||
#define _INCLUDE_GBFS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* to make a 300 KB space called samples do GBFS_SPACE(samples, 300) */
|
||||
|
||||
#define GBFS_SPACE(filename, kbytes) \
|
||||
const char filename[(kbytes)*1024] __attribute__ ((aligned (16))) = \
|
||||
"PinEightGBFSSpace-" #filename "-" #kbytes ;
|
||||
|
||||
typedef struct GBFS_FILE {
|
||||
char magic[16]; /* "PinEightGBFS\r\n\032\n" */
|
||||
u32 total_len; /* total length of archive */
|
||||
u16 dir_off; /* offset in bytes to directory */
|
||||
u16 dir_nmemb; /* number of files */
|
||||
char reserved[8]; /* for future use */
|
||||
} GBFS_FILE;
|
||||
|
||||
typedef struct GBFS_ENTRY {
|
||||
char name[24]; /* filename, nul-padded */
|
||||
u32 len; /* length of object in bytes */
|
||||
u32 data_offset; /* in bytes from beginning of file */
|
||||
} GBFS_ENTRY;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
Set the search limits and stride for searching
|
||||
---------------------------------------------------------------------------------*/
|
||||
void gbfs_search_range( u32 gbfs_1st_limit,
|
||||
u32 gbfs_2nd_start, u32 gbfs_2nd_limit,
|
||||
u32 gbfs_stride );
|
||||
|
||||
const GBFS_FILE * find_first_gbfs_file(const void *start);
|
||||
|
||||
const void *skip_gbfs_file(const GBFS_FILE * file);
|
||||
|
||||
const void *gbfs_get_obj(const GBFS_FILE *file,
|
||||
const char *name,
|
||||
u32 *len);
|
||||
|
||||
const void *gbfs_get_nth_obj(GBFS_FILE const * file,
|
||||
size_t n,
|
||||
char *name,
|
||||
u32 *len);
|
||||
|
||||
void *gbfs_copy_obj(void *dst,
|
||||
const GBFS_FILE *file,
|
||||
const char *name);
|
||||
|
||||
size_t gbfs_count_objs(const GBFS_FILE *file);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _INCLUDE_GBFS_H_
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
access object in a GBFS file
|
||||
|
||||
Copyright 2002-2004 Damian Yerrick
|
||||
|
||||
Additional code Dave Murphy
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
IN THE SOFTWARE.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/* Dependency on prior include files
|
||||
|
||||
Before you #include "gbfs.h", you should define the following types:
|
||||
typedef (unsigned 16-bit integer) u16;
|
||||
typedef (unsigned 32-bit integer) u32;
|
||||
Your system header should do this for you.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_GBFS_H_
|
||||
#define _INCLUDE_GBFS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* to make a 300 KB space called samples do GBFS_SPACE(samples, 300) */
|
||||
|
||||
#define GBFS_SPACE(filename, kbytes) \
|
||||
const char filename[(kbytes)*1024] __attribute__ ((aligned (16))) = \
|
||||
"PinEightGBFSSpace-" #filename "-" #kbytes ;
|
||||
|
||||
typedef struct GBFS_FILE {
|
||||
char magic[16]; /* "PinEightGBFS\r\n\032\n" */
|
||||
u32 total_len; /* total length of archive */
|
||||
u16 dir_off; /* offset in bytes to directory */
|
||||
u16 dir_nmemb; /* number of files */
|
||||
char reserved[8]; /* for future use */
|
||||
} GBFS_FILE;
|
||||
|
||||
typedef struct GBFS_ENTRY {
|
||||
char name[24]; /* filename, nul-padded */
|
||||
u32 len; /* length of object in bytes */
|
||||
u32 data_offset; /* in bytes from beginning of file */
|
||||
} GBFS_ENTRY;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
Set the search limits and stride for searching
|
||||
---------------------------------------------------------------------------------*/
|
||||
void gbfs_search_range( u32 gbfs_1st_limit,
|
||||
u32 gbfs_2nd_start, u32 gbfs_2nd_limit,
|
||||
u32 gbfs_stride );
|
||||
|
||||
const GBFS_FILE * find_first_gbfs_file(const void *start);
|
||||
|
||||
const void *skip_gbfs_file(const GBFS_FILE * file);
|
||||
|
||||
const void *gbfs_get_obj(const GBFS_FILE *file,
|
||||
const char *name,
|
||||
u32 *len);
|
||||
|
||||
const void *gbfs_get_nth_obj(GBFS_FILE const * file,
|
||||
size_t n,
|
||||
char *name,
|
||||
u32 *len);
|
||||
|
||||
void *gbfs_copy_obj(void *dst,
|
||||
const GBFS_FILE *file,
|
||||
const char *name);
|
||||
|
||||
size_t gbfs_count_objs(const GBFS_FILE *file);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _INCLUDE_GBFS_H_
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,73 +1,73 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
Microphone control for the ARM7
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
#ifndef ARM7_TOUCH_INCLUDE
|
||||
#define ARM7_TOUCH_INCLUDE
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef ARM7
|
||||
#error Touch screen is only available on the ARM7
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <nds/arm7/serial.h>
|
||||
|
||||
|
||||
#define SCREEN_WIDTH 256
|
||||
#define SCREEN_HEIGHT 192
|
||||
|
||||
|
||||
#define TSC_MEASURE_TEMP1 0x84
|
||||
#define TSC_MEASURE_Y 0x90
|
||||
#define TSC_MEASURE_BATTERY 0xA4
|
||||
#define TSC_MEASURE_Z1 0xB4
|
||||
#define TSC_MEASURE_Z2 0xC4
|
||||
#define TSC_MEASURE_X 0xD0
|
||||
#define TSC_MEASURE_AUX 0xE4
|
||||
#define TSC_MEASURE_TEMP2 0xF4
|
||||
|
||||
|
||||
|
||||
touchPosition touchReadXY();
|
||||
|
||||
uint16 touchRead(uint32 command);
|
||||
uint32 touchReadTemperature(int * t1, int * t2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
#endif // ARM7_TOUCH_INCLUDE
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
Microphone control for the ARM7
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
#ifndef ARM7_TOUCH_INCLUDE
|
||||
#define ARM7_TOUCH_INCLUDE
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef ARM7
|
||||
#error Touch screen is only available on the ARM7
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <nds/arm7/serial.h>
|
||||
|
||||
|
||||
#define SCREEN_WIDTH 256
|
||||
#define SCREEN_HEIGHT 192
|
||||
|
||||
|
||||
#define TSC_MEASURE_TEMP1 0x84
|
||||
#define TSC_MEASURE_Y 0x90
|
||||
#define TSC_MEASURE_BATTERY 0xA4
|
||||
#define TSC_MEASURE_Z1 0xB4
|
||||
#define TSC_MEASURE_Z2 0xC4
|
||||
#define TSC_MEASURE_X 0xD0
|
||||
#define TSC_MEASURE_AUX 0xE4
|
||||
#define TSC_MEASURE_TEMP2 0xF4
|
||||
|
||||
|
||||
|
||||
touchPosition touchReadXY();
|
||||
|
||||
uint16 touchRead(uint32 command);
|
||||
uint32 touchReadTemperature(int * t1, int * t2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
#endif // ARM7_TOUCH_INCLUDE
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,88 +1,88 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
key input code -- provides slightly higher level input forming
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
/*! \file cache.h
|
||||
\brief ARM9 cache control functions.
|
||||
|
||||
*/
|
||||
#ifndef _cache_h_
|
||||
#define _cache_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "nds/jtypes.h"
|
||||
|
||||
|
||||
/*! \fn IC_InvalidateAll()
|
||||
\brief invalidate entire instruction cache.
|
||||
*/
|
||||
void IC_InvalidateAll();
|
||||
|
||||
|
||||
/*! \fn IC_InvalidateRange(const void *base, u32 size)
|
||||
\brief invalidate the instruction cache for a range of addresses.
|
||||
\param base base address of the region to invalidate
|
||||
\param size size of the region to invalidate.
|
||||
*/
|
||||
void IC_InvalidateRange(const void *base, u32 size);
|
||||
|
||||
|
||||
/*! \fn DC_FlushAll()
|
||||
\brief flush the entire data cache to memory.
|
||||
*/
|
||||
void DC_FlushAll();
|
||||
|
||||
|
||||
/*! \fn DC_FlushRange(const void *base, u32 size)
|
||||
\brief flush the data cache for a range of addresses to memory.
|
||||
\param base base address of the region to flush.
|
||||
\param size size of the region to flush.
|
||||
*/
|
||||
void DC_FlushRange(const void *base, u32 size);
|
||||
|
||||
|
||||
/*! \fn DC_InvalidateAll()
|
||||
\brief invalidate the entire data cache.
|
||||
*/
|
||||
void DC_InvalidateAll();
|
||||
|
||||
|
||||
/*! \fn DC_InvalidateRange(const void *base, u32 size)
|
||||
\brief invalidate the data cache for a range of addresses.
|
||||
\param base base address of the region to invalidate
|
||||
\param size size of the region to invalidate.
|
||||
*/
|
||||
void DC_InvalidateRange(const void *base, u32 size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
key input code -- provides slightly higher level input forming
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
/*! \file cache.h
|
||||
\brief ARM9 cache control functions.
|
||||
|
||||
*/
|
||||
#ifndef _cache_h_
|
||||
#define _cache_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "nds/jtypes.h"
|
||||
|
||||
|
||||
/*! \fn IC_InvalidateAll(void)
|
||||
\brief invalidate entire instruction cache.
|
||||
*/
|
||||
void IC_InvalidateAll(void);
|
||||
|
||||
|
||||
/*! \fn IC_InvalidateRange(const void *base, u32 size)
|
||||
\brief invalidate the instruction cache for a range of addresses.
|
||||
\param base base address of the region to invalidate
|
||||
\param size size of the region to invalidate.
|
||||
*/
|
||||
void IC_InvalidateRange(const void *base, u32 size);
|
||||
|
||||
|
||||
/*! \fn DC_FlushAll(void)
|
||||
\brief flush the entire data cache to memory.
|
||||
*/
|
||||
void DC_FlushAll(void);
|
||||
|
||||
|
||||
/*! \fn DC_FlushRange(const void *base, u32 size)
|
||||
\brief flush the data cache for a range of addresses to memory.
|
||||
\param base base address of the region to flush.
|
||||
\param size size of the region to flush.
|
||||
*/
|
||||
void DC_FlushRange(const void *base, u32 size);
|
||||
|
||||
|
||||
/*! \fn DC_InvalidateAll(void)
|
||||
\brief invalidate the entire data cache.
|
||||
*/
|
||||
void DC_InvalidateAll(void);
|
||||
|
||||
|
||||
/*! \fn DC_InvalidateRange(const void *base, u32 size)
|
||||
\brief invalidate the data cache for a range of addresses.
|
||||
\param base base address of the region to invalidate
|
||||
\param size size of the region to invalidate.
|
||||
*/
|
||||
void DC_InvalidateRange(const void *base, u32 size);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,87 +1,87 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
console functions
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
/*! \file console.h
|
||||
\brief nds stdio support.
|
||||
*/
|
||||
|
||||
#ifndef CONSOLE_H
|
||||
#define CONSOLE_H
|
||||
|
||||
#define CONSOLE_USE_COLOR255 16
|
||||
|
||||
#include <nds/jtypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*! \fn void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16* map, u8 pal, u8 bitDepth)
|
||||
\brief Initialise the console.
|
||||
\param font base address of the 16 color font to use
|
||||
\param charBase VRAM address to load the font
|
||||
\param numCharacters number of characters in the font
|
||||
\param charStart ascii code of the first character in the font
|
||||
\param map base address of the map to use for printing
|
||||
\param pal 16 color palette index to use
|
||||
\param bitDepth 256/16 color tile flag.
|
||||
|
||||
Initializes the console with the given parameters. When pal is greater than 15 and
|
||||
bitDepth is 16 then all non zero entries in the font are set to index 255. When bitDepth
|
||||
is not 16 then the font tiles are created as 8bit (256 color).
|
||||
|
||||
*/
|
||||
void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16* map, u8 pal, u8 bitDepth);
|
||||
/*! \fn void consoleInitDefault(u16* map, u16* charBase, u8 bitDepth)
|
||||
\brief Initialize the console with some default parameters.
|
||||
\param charBase VRAM address to load the font
|
||||
\param map base address of the map to use for printing
|
||||
\param bitDepth 256/16 color tile flag
|
||||
|
||||
This function calls consoleInit() with the default built in font and character ranges, the parameters given
|
||||
are as for that function.
|
||||
*/
|
||||
void consoleInitDefault(u16* map, u16* charBase, u8 bitDepth);
|
||||
|
||||
/*! \fn void consoleDemoInit(void)
|
||||
\brief Initialize the console to a default state for prototyping.
|
||||
This function sets the console to use sub display, VRAM_C, and BG0 and enables MODE_0_2D on the
|
||||
sub display. It is intended for use in prototyping applications which need print ability and not actual
|
||||
game use. Print functionality can be utilized with just this call.
|
||||
*/
|
||||
void consoleDemoInit(void);
|
||||
/*! \fn void consoleClear(void)
|
||||
\brief Clears the screan by iprintf("\x1b[2J");
|
||||
*/
|
||||
void consoleClear(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
console functions
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
/*! \file console.h
|
||||
\brief nds stdio support.
|
||||
*/
|
||||
|
||||
#ifndef CONSOLE_H
|
||||
#define CONSOLE_H
|
||||
|
||||
#define CONSOLE_USE_COLOR255 16
|
||||
|
||||
#include <nds/jtypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*! \fn void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16* map, u8 pal, u8 bitDepth)
|
||||
\brief Initialise the console.
|
||||
\param font base address of the 16 color font to use
|
||||
\param charBase VRAM address to load the font
|
||||
\param numCharacters number of characters in the font
|
||||
\param charStart ascii code of the first character in the font
|
||||
\param map base address of the map to use for printing
|
||||
\param pal 16 color palette index to use
|
||||
\param bitDepth 256/16 color tile flag.
|
||||
|
||||
Initializes the console with the given parameters. When pal is greater than 15 and
|
||||
bitDepth is 16 then all non zero entries in the font are set to index 255. When bitDepth
|
||||
is not 16 then the font tiles are created as 8bit (256 color).
|
||||
|
||||
*/
|
||||
void consoleInit(u16* font, u16* charBase, u16 numCharacters, u8 charStart, u16* map, u8 pal, u8 bitDepth);
|
||||
/*! \fn void consoleInitDefault(u16* map, u16* charBase, u8 bitDepth)
|
||||
\brief Initialize the console with some default parameters.
|
||||
\param charBase VRAM address to load the font
|
||||
\param map base address of the map to use for printing
|
||||
\param bitDepth 256/16 color tile flag
|
||||
|
||||
This function calls consoleInit() with the default built in font and character ranges, the parameters given
|
||||
are as for that function.
|
||||
*/
|
||||
void consoleInitDefault(u16* map, u16* charBase, u8 bitDepth);
|
||||
|
||||
/*! \fn void consoleDemoInit(void)
|
||||
\brief Initialize the console to a default state for prototyping.
|
||||
This function sets the console to use sub display, VRAM_C, and BG0 and enables MODE_0_2D on the
|
||||
sub display. It is intended for use in prototyping applications which need print ability and not actual
|
||||
game use. Print functionality can be utilized with just this call.
|
||||
*/
|
||||
void consoleDemoInit(void);
|
||||
/*! \fn void consoleClear(void)
|
||||
\brief Clears the screan by iprintf("\x1b[2J");
|
||||
*/
|
||||
void consoleClear(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,27 +1,27 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
|
||||
Copyright (C) 2005
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
#include "nds/arm7/audio.h"
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
|
||||
Copyright (C) 2005
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
#include "nds/arm7/audio.h"
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,71 +1,71 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2005
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
#include <nds/arm7/serial.h>
|
||||
#include <nds/system.h>
|
||||
#include <string.h>
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void readUserSettings() {
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
PERSONAL_DATA slot1;
|
||||
PERSONAL_DATA slot2;
|
||||
|
||||
short slot1count, slot2count;
|
||||
short slot1CRC, slot2CRC;
|
||||
|
||||
uint32 userSettingsBase;
|
||||
readFirmware( 0x20, &userSettingsBase,2);
|
||||
|
||||
uint32 slot1Address = userSettingsBase * 8;
|
||||
uint32 slot2Address = userSettingsBase * 8 + 0x100;
|
||||
|
||||
readFirmware( slot1Address , &slot1, sizeof(PERSONAL_DATA));
|
||||
readFirmware( slot2Address , &slot2, sizeof(PERSONAL_DATA));
|
||||
readFirmware( slot1Address + 0x70, &slot1count, 2);
|
||||
readFirmware( slot2Address + 0x70, &slot2count, 2);
|
||||
readFirmware( slot1Address + 0x72, &slot1CRC, 2);
|
||||
readFirmware( slot2Address + 0x72, &slot2CRC, 2);
|
||||
|
||||
// default to slot 1 user Settings
|
||||
void *currentSettings = &slot1;
|
||||
|
||||
short calc1CRC = swiCRC16( 0xffff, &slot1, sizeof(PERSONAL_DATA));
|
||||
short calc2CRC = swiCRC16( 0xffff, &slot2, sizeof(PERSONAL_DATA));
|
||||
|
||||
// bail out if neither slot is valid
|
||||
if ( calc1CRC != slot1CRC && calc2CRC != slot2CRC) return;
|
||||
|
||||
// if both slots are valid pick the most recent
|
||||
if ( calc1CRC == slot1CRC && calc2CRC == slot2CRC ) {
|
||||
currentSettings = (slot2count == (( slot2count + 1 ) & 0x7f) ? &slot2 : &slot1);
|
||||
} else {
|
||||
if ( calc2CRC == slot2CRC )
|
||||
currentSettings = &slot2;
|
||||
}
|
||||
memcpy ( PersonalData, currentSettings, sizeof(PERSONAL_DATA));
|
||||
|
||||
}
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
Copyright (C) 2005
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
#include <nds/arm7/serial.h>
|
||||
#include <nds/system.h>
|
||||
#include <string.h>
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void readUserSettings() {
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
PERSONAL_DATA slot1;
|
||||
PERSONAL_DATA slot2;
|
||||
|
||||
short slot1count, slot2count;
|
||||
short slot1CRC, slot2CRC;
|
||||
|
||||
uint32 userSettingsBase;
|
||||
readFirmware( 0x20, &userSettingsBase,2);
|
||||
|
||||
uint32 slot1Address = userSettingsBase * 8;
|
||||
uint32 slot2Address = userSettingsBase * 8 + 0x100;
|
||||
|
||||
readFirmware( slot1Address , &slot1, sizeof(PERSONAL_DATA));
|
||||
readFirmware( slot2Address , &slot2, sizeof(PERSONAL_DATA));
|
||||
readFirmware( slot1Address + 0x70, &slot1count, 2);
|
||||
readFirmware( slot2Address + 0x70, &slot2count, 2);
|
||||
readFirmware( slot1Address + 0x72, &slot1CRC, 2);
|
||||
readFirmware( slot2Address + 0x72, &slot2CRC, 2);
|
||||
|
||||
// default to slot 1 user Settings
|
||||
void *currentSettings = &slot1;
|
||||
|
||||
short calc1CRC = swiCRC16( 0xffff, &slot1, sizeof(PERSONAL_DATA));
|
||||
short calc2CRC = swiCRC16( 0xffff, &slot2, sizeof(PERSONAL_DATA));
|
||||
|
||||
// bail out if neither slot is valid
|
||||
if ( calc1CRC != slot1CRC && calc2CRC != slot2CRC) return;
|
||||
|
||||
// if both slots are valid pick the most recent
|
||||
if ( calc1CRC == slot1CRC && calc2CRC == slot2CRC ) {
|
||||
currentSettings = (slot2count == (( slot2count + 1 ) & 0x7f) ? &slot2 : &slot1);
|
||||
} else {
|
||||
if ( calc2CRC == slot2CRC )
|
||||
currentSettings = &slot2;
|
||||
}
|
||||
memcpy ( PersonalData, currentSettings, sizeof(PERSONAL_DATA));
|
||||
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,88 +1,88 @@
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
BoxTest.c -- Code for performing hardware box test against viewing frustrum
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
#include <nds/arm9/video.h>
|
||||
#include <nds/arm9/videoGL.h>
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void BoxTest_Asynch(v16 x, v16 y, v16 z, v16 width, v16 height, v16 depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
glPolyFmt(BIT(12) | BIT(13));
|
||||
glBegin(GL_TRIANGLES);
|
||||
glEnd();
|
||||
|
||||
GFX_BOX_TEST = VERTEX_PACK(x, y);
|
||||
GFX_BOX_TEST = VERTEX_PACK(z, width);
|
||||
GFX_BOX_TEST = VERTEX_PACK(height, depth);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void BoxTestf_Asynch(float x, float y, float z, float width, float height, float depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
BoxTest_Asynch(floattov16(x), floattov16(y), floattov16(z),
|
||||
floattov16(width), floattov16(height), floattov16(depth));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
int BoxTestResult(void)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
while(GFX_STATUS & BIT(0));
|
||||
|
||||
return (GFX_STATUS & BIT(1));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
int BoxTest(v16 x, v16 y, v16 z, v16 width, v16 height, v16 depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
glPolyFmt(BIT(12) | BIT(13));
|
||||
glBegin(GL_TRIANGLES);
|
||||
glEnd();
|
||||
|
||||
GFX_BOX_TEST = VERTEX_PACK(x, y);
|
||||
GFX_BOX_TEST = VERTEX_PACK(z, width);
|
||||
GFX_BOX_TEST = VERTEX_PACK(height, depth);
|
||||
|
||||
while(GFX_STATUS & BIT(0));
|
||||
|
||||
return (GFX_STATUS & BIT(1));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
int BoxTestf(float x, float y, float z, float width, float height, float depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
return BoxTest(floattov16(x), floattov16(y), floattov16(z),
|
||||
floattov16(width), floattov16(height), floattov16(depth));
|
||||
}
|
||||
/*---------------------------------------------------------------------------------
|
||||
$Id$
|
||||
|
||||
BoxTest.c -- Code for performing hardware box test against viewing frustrum
|
||||
|
||||
Copyright (C) 2005
|
||||
Michael Noland (joat)
|
||||
Jason Rogers (dovoto)
|
||||
Dave Murphy (WinterMute)
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any
|
||||
damages arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any
|
||||
purpose, including commercial applications, and to alter it and
|
||||
redistribute it freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you
|
||||
must not claim that you wrote the original software. If you use
|
||||
this software in a product, an acknowledgment in the product
|
||||
documentation would be appreciated but is not required.
|
||||
|
||||
2. Altered source versions must be plainly marked as such, and
|
||||
must not be misrepresented as being the original software.
|
||||
|
||||
3. This notice may not be removed or altered from any source
|
||||
distribution.
|
||||
|
||||
---------------------------------------------------------------------------------*/
|
||||
|
||||
#include <nds/arm9/video.h>
|
||||
#include <nds/arm9/videoGL.h>
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void BoxTest_Asynch(v16 x, v16 y, v16 z, v16 width, v16 height, v16 depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
glPolyFmt(BIT(12) | BIT(13));
|
||||
glBegin(GL_TRIANGLES);
|
||||
glEnd();
|
||||
|
||||
GFX_BOX_TEST = VERTEX_PACK(x, y);
|
||||
GFX_BOX_TEST = VERTEX_PACK(z, width);
|
||||
GFX_BOX_TEST = VERTEX_PACK(height, depth);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
void BoxTestf_Asynch(float x, float y, float z, float width, float height, float depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
BoxTest_Asynch(floattov16(x), floattov16(y), floattov16(z),
|
||||
floattov16(width), floattov16(height), floattov16(depth));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
int BoxTestResult(void)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
while(GFX_STATUS & BIT(0));
|
||||
|
||||
return (GFX_STATUS & BIT(1));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
int BoxTest(v16 x, v16 y, v16 z, v16 width, v16 height, v16 depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
glPolyFmt(BIT(12) | BIT(13));
|
||||
glBegin(GL_TRIANGLES);
|
||||
glEnd();
|
||||
|
||||
GFX_BOX_TEST = VERTEX_PACK(x, y);
|
||||
GFX_BOX_TEST = VERTEX_PACK(z, width);
|
||||
GFX_BOX_TEST = VERTEX_PACK(height, depth);
|
||||
|
||||
while(GFX_STATUS & BIT(0));
|
||||
|
||||
return (GFX_STATUS & BIT(1));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
int BoxTestf(float x, float y, float z, float width, float height, float depth)
|
||||
//---------------------------------------------------------------------------------
|
||||
{
|
||||
return BoxTest(floattov16(x), floattov16(y), floattov16(z),
|
||||
floattov16(width), floattov16(height), floattov16(depth));
|
||||
}
|
||||
Binary file not shown.
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user