Compare commits
132 commits
Author | SHA1 | Date | |
---|---|---|---|
|
f3dab3957c | ||
|
010c211443 | ||
|
72db4b9ec1 | ||
|
a1d1e01e11 | ||
|
4252250fe7 | ||
|
5e5d5dcaa1 | ||
|
1329a31267 | ||
|
3f501f9c90 | ||
|
5edf465c07 | ||
|
3e412a93c5 | ||
|
48eb438a24 | ||
|
4b5a5a15d7 | ||
|
41c50b372e | ||
|
22aa56d2ed | ||
|
fbe8c3fc96 | ||
|
6b370ce35b | ||
|
0e68b604c6 | ||
|
53d2f1f6cd | ||
|
700a1535d6 | ||
|
dfd3934953 | ||
|
e1eaf42367 | ||
|
afe9a7ca26 | ||
|
55b5c8ff65 | ||
|
fa71ce7345 | ||
|
2113821e23 | ||
|
efe43d2f62 | ||
|
9a08a7ea4a | ||
|
900aedbed8 | ||
|
4c958cf8dd | ||
|
2237740090 | ||
|
9920215d94 | ||
|
57bcab6a25 | ||
|
f27122724a | ||
|
8d1854d8a2 | ||
|
13449ee395 | ||
|
13971bf935 | ||
|
501fe38561 | ||
|
dbb2dd89f0 | ||
|
0b5f9ad553 | ||
|
639a7081d4 | ||
|
286c44077a | ||
|
688b13d065 | ||
|
b4d2fc6168 | ||
|
a1a4c9384e | ||
|
805ccda32c | ||
|
2fd480b4f3 | ||
|
577541b509 | ||
|
14e8017953 | ||
|
a57b91f897 | ||
|
362058dc00 | ||
|
24b55e1c02 | ||
|
e35df7290c | ||
|
37ef0a9b8d | ||
|
936cb38b5e | ||
|
47a63742d7 | ||
|
1e1837c55f | ||
|
964ce2a58d | ||
|
39fecc43bb | ||
|
a519d9c93d | ||
|
d8d2dcc959 | ||
|
49cc257e8d | ||
|
1c0260ecfa | ||
|
339cdb4828 | ||
|
10ed45ad76 | ||
|
edda8744ad | ||
|
e46e351594 | ||
|
82c9daff5e | ||
|
c2262c74c5 | ||
|
52b11e6c1c | ||
|
11c08d9d8f | ||
|
7dd9763658 | ||
|
e156b47503 | ||
|
03e8e8863a | ||
|
a1b2ff6e87 | ||
|
5a8a513b66 | ||
|
2dcd76bced | ||
|
a8c2fcdb2c | ||
|
5e10564ce0 | ||
|
e7dfd96445 | ||
|
9b95e3c26b | ||
|
6794af6695 | ||
|
7a2bde06a1 | ||
|
2332157879 | ||
|
16a41b40b8 | ||
|
18e56b68fd | ||
|
6e2e64109d | ||
|
5f3a27e9e0 | ||
|
e2eeb6bf85 | ||
|
cb12547b85 | ||
|
1fa4d336cf | ||
|
be3128ddd2 | ||
|
ef12da18df | ||
|
267da6d5e1 | ||
|
fa19e1551a | ||
|
9ef4103ea5 | ||
|
3834297fae | ||
|
0a2041d1ce | ||
|
927d456306 | ||
|
d4fcf2697c | ||
|
4676a520e1 | ||
|
703d522c4c | ||
|
5680258a6a | ||
|
635c878905 | ||
|
07b9c9e8c1 | ||
|
ea8ff33951 | ||
|
55895f01f7 | ||
|
5e3426d0d2 | ||
|
90de0280db | ||
|
0b165c3133 | ||
|
ebf48b1bf7 | ||
|
04037a3096 | ||
|
3dc6668107 | ||
|
3c3a97219d | ||
|
b277570dae | ||
|
772e24ae50 | ||
|
b08a201ea2 | ||
|
9829c83608 | ||
|
a358ef69a8 | ||
|
ea330e8f79 | ||
|
4ac61d443d | ||
|
8c5f5ba182 | ||
|
9e87a7a2b2 | ||
|
f2adea7bb2 | ||
|
e7ac6f675f | ||
|
3cd1e03278 | ||
|
dfa2d3cc68 | ||
|
d1a7bf5eb5 | ||
|
b1c298ab50 | ||
|
cb610fd0c2 | ||
|
433749b6ef | ||
|
40596a7d68 | ||
|
7d788578b2 |
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 576 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 568 B After Width: | Height: | Size: 566 B |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
6
CATSFC/system/gui/uicolors.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
Background: #000000
|
||||
InactiveItem: #461F99
|
||||
ActiveItem: #FFFFFF
|
||||
MessageText: #461F99
|
||||
InactiveMain: #FFFFFF
|
||||
ActiveMain: #FFFFFF
|
6
Makefile
|
@ -7,12 +7,14 @@ FS_DIR = $(DS2SDKPATH)/libsrc/fs
|
|||
CONSOLE_DIR = $(DS2SDKPATH)/libsrc/console
|
||||
KEY_DIR = $(DS2SDKPATH)/libsrc/key
|
||||
ZLIB_DIR = $(DS2SDKPATH)/libsrc/zlib
|
||||
CORE_DIR = $(DS2SDKPATH)/libsrc/core
|
||||
|
||||
LIBS := $(DS2SDKPATH)/lib/libds2b.a -lc -lm -lgcc
|
||||
EXTLIBS := $(DS2SDKPATH)/lib/libds2a.a
|
||||
|
||||
INCLUDE := -Isource -Isource/unzip -Isource/nds -I$(DS2SDKPATH)/include \
|
||||
-I$(FS_DIR) -I$(CONSOLE_DIR) -I$(KEY_DIR) -I$(ZLIB_DIR)
|
||||
-I$(FS_DIR) -I$(CONSOLE_DIR) -I$(KEY_DIR) -I$(ZLIB_DIR) \
|
||||
-I$(CORE_DIR)
|
||||
|
||||
LINK_SPEC := $(DS2SDKPATH)/specs/link.xn
|
||||
START_ASM := $(DS2SDKPATH)/specs/start.S
|
||||
|
@ -35,7 +37,7 @@ C_SOURCES = source/unzip/explode.c source/unzip/unreduce.c \
|
|||
source/unzip/unshrink.c source/unzip/unzip.c \
|
||||
source/nds/bdf_font.c source/nds/bitmap.c \
|
||||
source/nds/draw.c source/nds/ds2_main.c source/nds/gcheat.c \
|
||||
source/nds/gui.c source/nds/dma_adj.c
|
||||
source/nds/gui.c source/nds/dma_adj.c source/nds/cheatgrp.c
|
||||
CPP_SOURCES = source/apu.cpp source/apudebug.cpp source/c4.cpp \
|
||||
source/c4emu.cpp source/cheats2.cpp source/cheats.cpp \
|
||||
source/clip.cpp source/cpu.cpp source/cpuexec.cpp \
|
||||
|
|
185
README.md
|
@ -1,4 +1,4 @@
|
|||
CATSFC version 1.28, 2013-02-04
|
||||
CATSFC version 1.36, 2013-06-16
|
||||
|
||||
A Super Nintendo emulator for the Supercard DSTWO.
|
||||
|
||||
|
@ -7,55 +7,22 @@ Based on:
|
|||
zsKnight, etc.)
|
||||
* NDSSFC 1.06, by the Supercard team (porting to the MIPS processor)
|
||||
* BAGSFC, by BassAceGold (improving over NDSSFC)
|
||||
* CATSFC, by ShadauxCat (improving over BAGSFC)
|
||||
* CATSFC, by ShadauxCat and Nebuleon (improving over BAGSFC)
|
||||
|
||||
# Compiling
|
||||
|
||||
(If you downloaded the plugin ready-made, you can safely skip this section.
|
||||
In this case, go to `# Installing`.)
|
||||
|
||||
Compiling CATSFC is best done on Linux. Make sure you have access to a Linux
|
||||
system to perform these steps.
|
||||
|
||||
## The DS2 SDK
|
||||
To compile CATSFC, you need to have the Supercard team's DS2 SDK.
|
||||
The Makefile expects it at `/opt/ds2sdk`, but you can move it anywhere,
|
||||
provided that you update the Makefile's `DS2SDKPATH` variable to point to it.
|
||||
|
||||
For best results, download version 0.13 of the DS2 SDK, which will have the
|
||||
MIPS compiler (`gcc`), extract it to `/opt/ds2sdk`, follow the instructions,
|
||||
then download version 1.2 of the DS2 SDK and extract its files into
|
||||
`opt/ds2sdk`, overwriting version 0.13.
|
||||
|
||||
Additionally, you will need to add the updated `zlib`, DMA
|
||||
(Direct Memory Access) and filesystem access routines provided by BassAceGold
|
||||
and recompile `libds2a.a`. To do this:
|
||||
|
||||
> sudo rm -r /opt/ds2sdk/libsrc/{console,dma,fs,key,zlib,Makefile} /opt/ds2sdk/include
|
||||
> sudo cp -r sdk-modifications/{libsrc,include} /opt/ds2sdk
|
||||
> sudo chmod -R 600 /opt/ds2sdk/{libsrc,include}
|
||||
> sudo chmod -R a+rX /opt/ds2sdk/{libsrc,include}
|
||||
> cd /opt/ds2sdk/libsrc
|
||||
> sudo rm libds2a.a ../lib/libds2a.a
|
||||
> sudo make
|
||||
|
||||
## The MIPS compiler (`gcc`)
|
||||
You also need the MIPS compiler from the DS2 SDK.
|
||||
The Makefile expects it at `/opt/mipsel-4.1.2-nopic`, but you can move it
|
||||
anywhere, provided that you update the Makefile's `CROSS` variable to point to
|
||||
it.
|
||||
|
||||
## Making the plugin
|
||||
To make the plugin, `catsfc.plg`, use the `cd` command to change to the
|
||||
directory containing your copy of the CATSFC source, then type
|
||||
`make clean; make`. `catsfc.plg` should appear in the same directory.
|
||||
Contains:
|
||||
* Language files written by the GBAtemp community: Dutch by Aeter, French
|
||||
by Nebuleon, German by SignZ, Portuguese (Brazilian) by Diego Liberal,
|
||||
Spanish by Boriar
|
||||
* Language files written by GitHub users: Italian by alexinfurs
|
||||
|
||||
# Installing
|
||||
|
||||
To install the plugin to your storage card after compiling it, copy
|
||||
`catsfc.plg`, `catsfc.ini` and `catsfc.bmp` to the card's `_dstwoplug`
|
||||
directory. Then, copy the source directory's CATSFC subdirectory to the
|
||||
root of the card.
|
||||
(If you got the source code and want to compile it, see the `Compiling` section
|
||||
at the end of the file.)
|
||||
|
||||
To install the plugin to your storage card, copy `catsfc.plg`, `catsfc.ini` and
|
||||
`catsfc.bmp` from the release archive to the card's `_dstwoplug` directory.
|
||||
Then, copy the `CATSFC` subdirectory to the root of the card.
|
||||
|
||||
# Cheats
|
||||
|
||||
|
@ -68,14 +35,9 @@ old format used in Mightymo's BSNES Cheat Code Pack.
|
|||
the operating system on your computer.
|
||||
3. In the zip file, open the folder called *BSNES Cheat Code Pack*, then
|
||||
the one called *BSNES v0.51-0.74 Cheat Code Pack*.
|
||||
4. Open your microSD card's CATSFC folder, then descend into gamecht.
|
||||
4. Open your storage card's CATSFC folder, then descend into gamecht.
|
||||
5. Drag the cheat code files from the zip archive to the card's gamecht
|
||||
folder.
|
||||
6. In the card's gamecht directory, create two folders. Name the first one
|
||||
*a-m* and the second one *n-z*. Drag the cheat files from the games whose
|
||||
name starts with A to M into *a-m* and the rest into *n-z*.
|
||||
|
||||
This is because the directory display does not handle more than 512 files.
|
||||
|
||||
To add cheats to the menu in a game, first load the game, then use the Cheats
|
||||
menu's "Load a cheat file" option.
|
||||
|
@ -84,19 +46,24 @@ menu's "Load a cheat file" option.
|
|||
|
||||
In the Video & audio menu, the **Frame skipping** option allows you to select
|
||||
a number of frames to skip between rendered frames.
|
||||
* Setting this to 0 will show every single frame, but this will slow down the
|
||||
game considerably, as the DSTWO would only have enough processing power to
|
||||
emulate **and** render a few frames per second. It has enough power to
|
||||
emulate all frames and render **some**, though.
|
||||
|
||||
As of version 1.29, the default is - (Keep up with the game). For most games,
|
||||
this setting keeps video and audio fluid, without the sudden slowdowns of
|
||||
previous versions when many sprites fill the screen. The DS controller buttons
|
||||
are also responsive at this setting.
|
||||
|
||||
For some games, you may need to adjust frame skipping.
|
||||
* If a game runs at 5 frames per second, like *Yoshi's Island*,
|
||||
*Kirby Super Star*, *Star Fox* or *Super Mario RPG*, setting frame skipping
|
||||
to 1 will allow you to jump, move or shoot at the right times.
|
||||
* If you want to show more frames per second in a game that already shows 20,
|
||||
setting frame skipping to 1 or 0 will cause more frames to appear,
|
||||
but your DS button input may stop responding for 2 entire seconds every so
|
||||
often. The audio may also be stretched. (This is similar to NDSGBA.)
|
||||
* Setting this to 10 will skip 10 frames and render one, but this will
|
||||
severely desynchronise the audio. You will also find yourself unable to
|
||||
perform actions during the correct frame with the controller.
|
||||
* Setting this to - (Keep up with the game) will make the emulator try to
|
||||
render the game at its correct speed, dropping frames as needed (up to 8).
|
||||
|
||||
It is recommended to start with frame skipping 4 (Show 1 frame every 5) and
|
||||
go to 3 or 2 if the game doesn't run with major slowdowns with them. If you
|
||||
don't like the slowdowns, return to frame skipping 4 or -.
|
||||
perform actions during the correct frame with the DS buttons. It is advised
|
||||
to set frame skipping to the lowest value with which you can play a game.
|
||||
|
||||
# Fluidity
|
||||
|
||||
|
@ -105,12 +72,13 @@ By default, video fluidity is preferred over audio fluidity in games.
|
|||
|
||||
* Preferring video fluidity makes audio skip certain notes, up to
|
||||
23 milliseconds, in order to render more video. In many games, this
|
||||
difference is not audible.
|
||||
Use this option if you want to play games that require precise controls or
|
||||
fluid imagery more than precise audio emulation. You can also use this option
|
||||
when watching game introductions, endings and cutscenes.
|
||||
difference is not audible, but you may hear certain audio glitches if a game
|
||||
depends highly on timing for its audio.
|
||||
Use this option if you want to play games that require fluid imagery more
|
||||
than precise audio emulation. You can also use this option when watching game
|
||||
introductions, endings and cutscenes.
|
||||
* Preferring audio fluidity makes video skip certain images, up to
|
||||
166 milliseconds, in order to render audio closer to 32,000 times per second.
|
||||
46 milliseconds, in order to render audio closer to 32,000 times per second.
|
||||
Use this option if you want to play games mainly for their soundtracks, or in
|
||||
a game's sound test mode. You can also use this option to experiment with the
|
||||
green berry glitch in Super Mario World that makes TIME go over and under 100
|
||||
|
@ -137,10 +105,18 @@ Available actions are:
|
|||
will be forced on.
|
||||
* Toggle sound. Each time this hotkey is held, the sound will be disabled if
|
||||
it's currently enabled, and vice-versa.
|
||||
* Save state #1. Each time this hotkey is held, saved state #1 will be written,
|
||||
without confirmation if it exists.
|
||||
* Load state #1. Each time this hotkey is held, saved state #1 will be loaded.
|
||||
* Toggle full-screen. Each time this hotkey is held:
|
||||
* If the current display mode *is* a full-screen mode, then the display mode
|
||||
is set to 3 (Middle, square pixels) and the top and bottom will be cut off.
|
||||
* If the current display mode *is not* a full-screen mode, then the display
|
||||
mode is set to 4 (Entire screen, smoothed).
|
||||
|
||||
# The font
|
||||
|
||||
The font used by CATSFC is now similar to the Pictochat font. To modify it,
|
||||
The font used by CATSFC is similar to the Pictochat font. To modify it,
|
||||
see `source/font/README.txt`.
|
||||
|
||||
# Translations
|
||||
|
@ -152,40 +128,87 @@ need to do the following:
|
|||
* Open `CATSFC/system/language.msg`.
|
||||
* Copy what's between `STARTENGLISH` and `ENDENGLISH` and paste it at the end
|
||||
of the file.
|
||||
* Change the tags. For example, if you want to translate to German, the tags
|
||||
will become `STARTGERMAN` and `ENDGERMAN`.
|
||||
* Change the tags. For example, if you want to translate to Japanese, the tags
|
||||
will become `STARTJAPANESE` and `ENDJAPANESE`.
|
||||
* Translate each of the messages, using the lines starting with `#MSG_` as a
|
||||
guide to the context in which the messages will be used.
|
||||
|
||||
If you are not comfortable editing C code, or cannot compile CATSFC after your
|
||||
changes, you may instead test your translation in the English block and submit
|
||||
it. That allows you to look for message length issues and to align the option
|
||||
names and values to your liking with spaces.
|
||||
|
||||
If you wish to also hook your language into the user interface, you will need
|
||||
to do the following:
|
||||
|
||||
* Edit `source/nds/message.h`. Find `enum LANGUAGE` and add the name of your
|
||||
language there. For the example of German, you would add this at the end of
|
||||
language there. For the example of Japanese, you would add this at the end of
|
||||
the list:
|
||||
```
|
||||
,
|
||||
GERMAN
|
||||
JAPANESE
|
||||
```
|
||||
* Still in `source/nds/message.h`, just below `enum LANGUAGE`, you will find
|
||||
`extern char* lang[` *some number* `]`. Add 1 to that number.
|
||||
* Edit `source/nds/gui.c`. Find `char *lang[` *some number* `] =`.
|
||||
Add the name of your language, in the language itself. For the example of
|
||||
German, you would add this at the end of the list:
|
||||
Japanese, you would add this at the end of the list:
|
||||
```
|
||||
,
|
||||
"Deutsch"
|
||||
"日本語"
|
||||
```
|
||||
* Still in `source/nds/gui.c`, find `char* language_options[]`, which is below
|
||||
the language names. Add an entry similar to the others, with the last number
|
||||
plus 1. For example, if the last entry is `, (char *) &lang[2]`, yours would
|
||||
be `, (char *) &lang[3]`.
|
||||
plus 1. For example, if the last entry is `, (char *) &lang[7]`, yours would
|
||||
be `, (char *) &lang[8]`.
|
||||
* Still in `source/nds/gui.c`, find `case CHINESE_SIMPLIFIED`. Copy the lines
|
||||
starting at the `case` and ending with `break`, inclusively. Paste them
|
||||
before the `}`. Change the language name and tags. For the example of
|
||||
German, you would use:
|
||||
Japanese, you would use:
|
||||
```
|
||||
case GERMAN:
|
||||
strcpy(start, "STARTGERMAN");
|
||||
strcpy(end, "ENDGERMAN");
|
||||
case JAPANESE:
|
||||
strcpy(start, "STARTJAPANESE");
|
||||
strcpy(end, "ENDJAPANESE");
|
||||
break;
|
||||
```
|
||||
|
||||
Compile again, copy the plugin and your new `language.msg` to your card
|
||||
under `CATSFC/system`, and you can now select your new language in CATSFC!
|
||||
|
||||
# Compiling
|
||||
|
||||
Compiling CATSFC is best done on Linux. Make sure you have access to a Linux
|
||||
system to perform these steps.
|
||||
|
||||
## The DS2 SDK
|
||||
To compile CATSFC, you need to have the Supercard team's DS2 SDK.
|
||||
The Makefile expects it at `/opt/ds2sdk`, but you can move it anywhere,
|
||||
provided that you update the Makefile's `DS2SDKPATH` variable to point to it.
|
||||
|
||||
For best results, download version 0.13 of the DS2 SDK, which will have the
|
||||
MIPS compiler (`gcc`), extract it to `/opt/ds2sdk`, follow the instructions,
|
||||
then download version 1.2 of the DS2 SDK and extract its files into
|
||||
`opt/ds2sdk`, overwriting version 0.13.
|
||||
|
||||
Additionally, you will need to add the updated `zlib`, DMA
|
||||
(Direct Memory Access) and filesystem access routines provided by BassAceGold
|
||||
and recompile `libds2a.a`. To do this:
|
||||
|
||||
> sudo rm -r /opt/ds2sdk/libsrc/{console,core,fs,key,zlib,Makefile} /opt/ds2sdk/include
|
||||
> sudo cp -r sdk-modifications/{libsrc,include} /opt/ds2sdk
|
||||
> sudo chmod -R 600 /opt/ds2sdk/{libsrc,include}
|
||||
> sudo chmod -R a+rX /opt/ds2sdk/{libsrc,include}
|
||||
> cd /opt/ds2sdk/libsrc
|
||||
> sudo rm libds2a.a ../lib/libds2a.a
|
||||
> sudo make
|
||||
|
||||
## The MIPS compiler (`gcc`)
|
||||
You also need the MIPS compiler from the DS2 SDK.
|
||||
The Makefile expects it at `/opt/mipsel-4.1.2-nopic`, but you can move it
|
||||
anywhere, provided that you update the Makefile's `CROSS` variable to point to
|
||||
it.
|
||||
|
||||
## Making the plugin
|
||||
To make the plugin, `catsfc.plg`, use the `cd` command to change to the
|
||||
directory containing your copy of the CATSFC source, then type
|
||||
`make clean; make`. `catsfc.plg` should appear in the same directory.
|
||||
|
|
0
sdk-modifications/include/archdefs.h
Normal file → Executable file
0
sdk-modifications/include/bit_ops.h
Normal file → Executable file
0
sdk-modifications/include/console.h
Normal file → Executable file
0
sdk-modifications/include/directory.h
Normal file → Executable file
0
sdk-modifications/include/ds2_cpu.h
Normal file → Executable file
|
@ -13,7 +13,6 @@ extern int ds2_setCPULevel(unsigned int level);
|
|||
extern void ds2_udelay(unsigned int usec);
|
||||
extern void ds2_mdelay(unsigned int msec);
|
||||
|
||||
//#define ds2_setCPUclocklevel ds2_setCPULevel
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,50 +1,138 @@
|
|||
#ifndef __DMA_H__
|
||||
#define __DMA_H__
|
||||
#ifndef _DS2_DMA_H__
|
||||
#define _DS2_DMA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//register a DMA transfer request
|
||||
//ch: channel id request, there are 6 channles,
|
||||
//irq_handler: the DMA interruption handle
|
||||
//arg: argument to the handle
|
||||
//mode: DMA mode, such as port width, address increased/fixed, and so on
|
||||
//type: DMA request type
|
||||
extern int dma_request(int ch, void (*irq_handler)(unsigned int), unsigned int arg,
|
||||
unsigned int mode, unsigned int type);
|
||||
|
||||
//start DMA transfer, must request a DMA first
|
||||
//ch: channel id
|
||||
//srcAddr: DMA source address
|
||||
//dstAddr: DMA destination address
|
||||
//count: DMA transfer count, the total bytes due the mode in dma_request
|
||||
extern void dma_start(int ch, unsigned int srcAddr, unsigned int dstAddr,
|
||||
unsigned int count);
|
||||
#define MAX_DMA_NUM 6 /* max 6 channels */
|
||||
|
||||
//Stop DMA transfer
|
||||
extern void dma_stop(int ch);
|
||||
|
||||
//Wait DMA transfer over
|
||||
extern int dma_wait_finish(int ch);
|
||||
// DMA request source register
|
||||
#define DMAC_DRSR_RS_BIT 0
|
||||
#define DMAC_DRSR_RS_AUTO (8 << DMAC_DRSR_RS_BIT)
|
||||
|
||||
|
||||
// DMA channel command register
|
||||
#define DMAC_DCMD_SAI (1 << 23) /* source address increment */
|
||||
#define DMAC_DCMD_DAI (1 << 22) /* dest address increment */
|
||||
|
||||
#define DMAC_DCMD_SWDH_BIT 14 /* source port width */
|
||||
#define DMAC_DCMD_SWDH_32 (0 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_SWDH_8 (1 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_SWDH_16 (2 << DMAC_DCMD_SWDH_BIT)
|
||||
|
||||
#define DMAC_DCMD_DWDH_BIT 12 /* dest port width */
|
||||
#define DMAC_DCMD_DWDH_32 (0 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_8 (1 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_16 (2 << DMAC_DCMD_DWDH_BIT)
|
||||
|
||||
#define DMAC_DCMD_DS_BIT 8 /* transfer data size of a data unit */
|
||||
#define DMAC_DCMD_DS_32BIT (0 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_8BIT (1 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_16BIT (2 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_16BYTE (3 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_32BYTE (4 << DMAC_DCMD_DS_BIT)
|
||||
|
||||
#define DMAC_DCMD_TM (1 << 7) /* transfer mode: 0-single 1-block */
|
||||
|
||||
|
||||
//detect if channel has completed job
|
||||
#define DMAC_DCCSR_TT (1 << 3) /* transfer terminated */
|
||||
#define DMAC_BASE 0xB3020000
|
||||
#define REG32(addr) *((volatile u32 *)(addr))
|
||||
#define DMAC_DCCSR(n) (DMAC_BASE + (0x10 + (n) * 0x20)) /* DMA control/status */
|
||||
#define REG_DMAC_DCCSR(n) REG32(DMAC_DCCSR((n)))
|
||||
|
||||
#define ds2_DMA_isBusy(n) \
|
||||
!( REG_DMAC_DCCSR((n)) & DMAC_DCCSR_TT )
|
||||
|
||||
|
||||
/*
|
||||
Copy modes
|
||||
|
||||
*/
|
||||
|
||||
#define DMA_MODE32BYTE DMAC_DCMD_SWDH_32 | DMAC_DCMD_DWDH_32 | \
|
||||
DMAC_DCMD_DS_32BYTE | DMAC_DCMD_TM
|
||||
|
||||
#define DMA_MODE16BYTE DMAC_DCMD_SWDH_16 | DMAC_DCMD_DWDH_16 | \
|
||||
DMAC_DCMD_DS_16BYTE | DMAC_DCMD_TM
|
||||
|
||||
#define DMA_MODE32BIT DMAC_DCMD_SWDH_32 | DMAC_DCMD_DWDH_32 | \
|
||||
DMAC_DCMD_DS_32BIT
|
||||
|
||||
#define DMA_MODE16BIT DMAC_DCMD_SWDH_16 | DMAC_DCMD_DWDH_16 | \
|
||||
DMAC_DCMD_DS_16BIT
|
||||
|
||||
#define DMA_MODE8BIT DMAC_DCMD_SWDH_8 | DMAC_DCMD_DWDH_8 | \
|
||||
DMAC_DCMD_DS_8BIT | DMAC_DCMD_TM
|
||||
|
||||
#define DMA_MODECOPY DMAC_DCMD_SAI
|
||||
|
||||
|
||||
|
||||
extern int _dmaCopy(int ch, void *dest, void *src, unsigned int size, unsigned int flags);
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 32 bytes.
|
||||
* size is in bytes and must be a multiple of 32.
|
||||
* Both src and dest must be aligned to 32 bytes.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
extern int dma_copy32Byte(int ch, void *dest, void *src, unsigned int size);
|
||||
// Blocks of 16 bytes, aligned to 16 bytes
|
||||
extern int dma_copy16Byte(int ch, void *dest, void *src, unsigned int size);
|
||||
// Blocks of 4 bytes, aligned to 4 bytes
|
||||
extern int dma_copy32Bit(int ch, void *dest, void *src, unsigned int size);
|
||||
// Blocks of 2 bytes, aligned to 2 bytes
|
||||
extern int dma_copy16Bit(int ch, void *dest, void *src, unsigned int size);
|
||||
extern int dma_isBusy(int ch);
|
||||
extern int dma_isFree(int ch);
|
||||
extern int dma_getFree(void);
|
||||
#define ds2_DMAcopy_32Byte(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE32BYTE)
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 16 bytes.
|
||||
* size is in bytes and must be a multiple of 16.
|
||||
* Both src and dest must be aligned to 16 bytes.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_16Byte(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE16BYTE);
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 32 bits (4 bytes).
|
||||
* size is in bytes and must be a multiple of 4.
|
||||
* Both src and dest must be aligned to 32 bits (4 bytes).
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_32Bit(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE32BIT);
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 16 bits (2 bytes).
|
||||
* size is in bytes and must be a multiple of 2.
|
||||
* Both src and dest must be aligned to 16 bits (2 bytes).
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_16Bit(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE16BIT)
|
||||
|
||||
/*
|
||||
* Copy 'size' individual bytes (8 bits at a time) from src to dest.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_8Bit(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE8BIT)
|
||||
|
||||
|
||||
|
||||
//Stop DMA transfer
|
||||
extern void dma_stop(int ch);
|
||||
|
||||
#define ds2_DMA_stop(ch)\
|
||||
dma_stop(ch)
|
||||
|
||||
//Wait DMA transfer over
|
||||
extern int dma_wait_finish(int ch);
|
||||
|
||||
#define ds2_DMA_wait(ch)\
|
||||
dma_wait_finish(ch)
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
0
sdk-modifications/include/ds2_excpt.h
Normal file → Executable file
0
sdk-modifications/include/ds2_fcntl.h
Normal file → Executable file
0
sdk-modifications/include/ds2_malloc.h
Normal file → Executable file
0
sdk-modifications/include/ds2_mmc_api.h
Normal file → Executable file
0
sdk-modifications/include/ds2_timer.h
Normal file → Executable file
40
sdk-modifications/include/ds2_types.h
Normal file → Executable file
|
@ -1,37 +1,29 @@
|
|||
#ifndef __DS2_TYPES_H__
|
||||
#define __DS2_TYPES_H__
|
||||
|
||||
#ifndef u8
|
||||
#define u8 unsigned char
|
||||
#endif
|
||||
typedef unsigned char u8;
|
||||
typedef char s8;
|
||||
|
||||
#ifndef s8
|
||||
#define s8 char
|
||||
#endif
|
||||
typedef unsigned short u16;
|
||||
typedef short s16;
|
||||
|
||||
#ifndef u16
|
||||
#define u16 unsigned short
|
||||
#endif
|
||||
typedef unsigned int u32;
|
||||
typedef int s32;
|
||||
|
||||
#ifndef s16
|
||||
#define s16 short
|
||||
#endif
|
||||
typedef unsigned long long u64;
|
||||
typedef long long s64;
|
||||
|
||||
#ifndef u32
|
||||
#define u32 unsigned int
|
||||
#endif
|
||||
typedef volatile unsigned char vu8;
|
||||
typedef volatile char vs8;
|
||||
|
||||
#ifndef s32
|
||||
#define s32 int
|
||||
#endif
|
||||
typedef volatile unsigned short vu16;
|
||||
typedef volatile short vs16;
|
||||
|
||||
#ifndef u64
|
||||
#define u64 unsigned long long
|
||||
#endif
|
||||
typedef volatile unsigned int vu32;
|
||||
typedef volatile int vs32;
|
||||
|
||||
#ifndef s64
|
||||
#define s64 long long
|
||||
#endif
|
||||
typedef volatile unsigned long long vu64;
|
||||
typedef volatile long long vs64;
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
|
|
14
sdk-modifications/include/ds2io.h
Normal file → Executable file
|
@ -8,7 +8,7 @@
|
|||
#define SCREEN_WIDTH 256
|
||||
#define SCREEN_HEIGHT 192
|
||||
|
||||
#define AUDIO_BUFFER_COUNT 16
|
||||
#define AUDIO_BUFFER_COUNT 4 // in 1.2, that's 4, but in 0.13 it would be 16 [Neb]
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -61,7 +61,7 @@ struct rtc{
|
|||
volatile unsigned char seconds; //0 to 59
|
||||
};
|
||||
|
||||
struct key_buf
|
||||
struct key_buf
|
||||
{
|
||||
unsigned short key;
|
||||
unsigned short x;
|
||||
|
@ -93,7 +93,7 @@ extern unsigned int audio_samples_per_trans;
|
|||
/*
|
||||
* Function: initialize ds2 I/O(DS2 Input and Output) layer
|
||||
* audio_samples_lenght: ds2io layer's audio buffer length, it unit is sample
|
||||
* which is fixed 4(ds2io use stereo and 16-bit audio) bytes,
|
||||
* which is fixed 4(ds2io use stereo and 16-bit audio) bytes,
|
||||
* audio_samples_lenght sholud be 128*n, 128 <= audio_samples_lenght <= 4096
|
||||
* NOTE: the audio sampling frequence be fixed to 44.1KHz, 2 channels 16-bit
|
||||
*/
|
||||
|
@ -102,7 +102,7 @@ extern int ds2io_init(int audio_samples_lenght);
|
|||
/*
|
||||
* Function: initialize ds2 I/O(DS2 Input and Output) layer (b version)
|
||||
* audio_samples_lenght: ds2io layer's audio buffer length, it unit is sample
|
||||
* which is fixed 4(ds2io use stereo and 16-bit audio) bytes,
|
||||
* which is fixed 4(ds2io use stereo and 16-bit audio) bytes,
|
||||
* audio_samples_lenght sholud be 128*n, 128 <= audio_samples_lenght <= 4096
|
||||
* audio_samples_freq: audio samples frequence, it should be among 44100, 22050,
|
||||
* 11025
|
||||
|
@ -116,7 +116,7 @@ extern int ds2io_initb(int audio_samples_lenght, int audio_samples_freq, int res
|
|||
/*
|
||||
* Function: update video data from buffer to screen, the ds2io layer have 2 video
|
||||
* buffers for up screen and 2 video buffers for down screen, everytime
|
||||
* ds2_flipScreen is called, up_screen_addr and/or down_buffer_addr
|
||||
* ds2_flipScreen is called, up_screen_addr and/or down_buffer_addr
|
||||
* point to the other buffer, but not always do so, see below.
|
||||
* screen_num: UP_SCREEN, only update up screen
|
||||
* DOWN_SCREEN, only update down screen
|
||||
|
@ -127,7 +127,7 @@ extern int ds2io_initb(int audio_samples_lenght, int audio_samples_freq, int res
|
|||
* and/or down_buffer_addr pointer. it will not sure the graphic just
|
||||
* updated will appear on the screen
|
||||
* when done = 1, it will WAIT untill the other buffer idle and change
|
||||
* the pointers and returns. the graphic just updated will appear on
|
||||
* the pointers and returns. the graphic just updated will appear on
|
||||
* the screen, but please noting the word "WAIT"
|
||||
* when done = 2, it will WAIT untill the other buffer idle, then return
|
||||
* without change the pointers, it is convenient for GUI drawing
|
||||
|
@ -152,7 +152,7 @@ extern int ds2_checkAudiobuff(void);
|
|||
/*
|
||||
* Function: get audio buffer address
|
||||
* NOTE: ds2_getAudiobuff may return NULL, even if ds2_checkAudiobuff() < AUDIO_BUFFER_COUNT.
|
||||
* The fact are that, AUDIO_BUFFER_COUNT audio buffers are on NDS, the ds2io layer using
|
||||
* The fact are that, AUDIO_BUFFER_COUNT audio buffers are on NDS, the ds2io layer using
|
||||
* 2 other buffers transfering data to the AUDIO_BUFFER_COUNT audio buffers alternately,
|
||||
* this function checks the 2 buffers in ds2io layers whether are occupied,
|
||||
* it will return the address of the idle buffer, else it return NULL
|
||||
|
|
0
sdk-modifications/include/fat.h
Normal file → Executable file
0
sdk-modifications/include/fatdir.h
Normal file → Executable file
0
sdk-modifications/include/fatdir_ex.h
Normal file → Executable file
0
sdk-modifications/include/fatfile.h
Normal file → Executable file
0
sdk-modifications/include/fatfile_ex.h
Normal file → Executable file
0
sdk-modifications/include/file_allocation_table.h
Normal file → Executable file
0
sdk-modifications/include/filetime.h
Normal file → Executable file
0
sdk-modifications/include/fs_api.h
Normal file → Executable file
0
sdk-modifications/include/fs_cache.h
Normal file → Executable file
103
sdk-modifications/include/fs_common.h
Normal file → Executable file
|
@ -49,9 +49,10 @@
|
|||
|
||||
#define BYTES_PER_READ 512
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
// MODIFICATION START [Neb]
|
||||
// In libfat by Chishm, some types are #define'd here. In the DS2 SDK,
|
||||
// these types are defined by another header.
|
||||
#include "ds2_types.h"
|
||||
|
||||
#ifndef bool
|
||||
#define bool int
|
||||
|
@ -65,65 +66,51 @@
|
|||
#define true 1
|
||||
#endif
|
||||
|
||||
#ifndef u8
|
||||
#define u8 unsigned char
|
||||
#endif
|
||||
// MODIFICATION END [Neb]
|
||||
|
||||
#ifndef u16
|
||||
#define u16 unsigned short
|
||||
#endif
|
||||
struct _reent
|
||||
{
|
||||
/* FILE is a big struct and may change over time. To try to achieve binary
|
||||
compatibility with future versions, put stdin,stdout,stderr here.
|
||||
These are pointers into member __sf defined below. */
|
||||
// __FILE *_stdin, *_stdout, *_stderr; /* XXX */
|
||||
|
||||
#ifndef u32
|
||||
#define u32 unsigned long
|
||||
#endif
|
||||
int _errno; /* local copy of errno */
|
||||
|
||||
#ifndef s32
|
||||
#define s32 long
|
||||
#endif
|
||||
// int _inc; /* used by tmpnam */
|
||||
|
||||
struct _reent
|
||||
{
|
||||
/* FILE is a big struct and may change over time. To try to achieve binary
|
||||
compatibility with future versions, put stdin,stdout,stderr here.
|
||||
These are pointers into member __sf defined below. */
|
||||
// __FILE *_stdin, *_stdout, *_stderr; /* XXX */
|
||||
|
||||
int _errno; /* local copy of errno */
|
||||
|
||||
// int _inc; /* used by tmpnam */
|
||||
|
||||
// char *_emergency;
|
||||
|
||||
// int __sdidinit; /* 1 means stdio has been init'd */
|
||||
|
||||
// int _current_category; /* unused */
|
||||
// _CONST char *_current_locale; /* unused */
|
||||
|
||||
// struct _mprec *_mp;
|
||||
|
||||
// void _EXFNPTR(__cleanup, (struct _reent *));
|
||||
|
||||
// int _gamma_signgam;
|
||||
|
||||
/* used by some fp conversion routines */
|
||||
// int _cvtlen; /* should be size_t */
|
||||
// char *_cvtbuf;
|
||||
|
||||
// struct _rand48 *_r48;
|
||||
// struct __tm *_localtime_buf;
|
||||
// char *_asctime_buf;
|
||||
|
||||
/* signal info */
|
||||
// void (**(_sig_func))(int);
|
||||
|
||||
/* atexit stuff */
|
||||
// struct _atexit *_atexit;
|
||||
// struct _atexit _atexit0;
|
||||
|
||||
// struct _glue __sglue; /* root of glue chain */
|
||||
// __FILE *__sf; /* file descriptors */
|
||||
// struct _misc_reent *_misc; /* strtok, multibyte states */
|
||||
// char *_signal_buf; /* strsignal */
|
||||
// char *_emergency;
|
||||
|
||||
// int __sdidinit; /* 1 means stdio has been init'd */
|
||||
|
||||
// int _current_category; /* unused */
|
||||
// _CONST char *_current_locale; /* unused */
|
||||
|
||||
// struct _mprec *_mp;
|
||||
|
||||
// void _EXFNPTR(__cleanup, (struct _reent *));
|
||||
|
||||
// int _gamma_signgam;
|
||||
|
||||
/* used by some fp conversion routines */
|
||||
// int _cvtlen; /* should be size_t */
|
||||
// char *_cvtbuf;
|
||||
|
||||
// struct _rand48 *_r48;
|
||||
// struct __tm *_localtime_buf;
|
||||
// char *_asctime_buf;
|
||||
|
||||
/* signal info */
|
||||
// void (**(_sig_func))(int);
|
||||
|
||||
/* atexit stuff */
|
||||
// struct _atexit *_atexit;
|
||||
// struct _atexit _atexit0;
|
||||
|
||||
// struct _glue __sglue; /* root of glue chain */
|
||||
// __FILE *__sf; /* file descriptors */
|
||||
// struct _misc_reent *_misc; /* strtok, multibyte states */
|
||||
// char *_signal_buf; /* strsignal */
|
||||
};
|
||||
|
||||
#endif // _COMMON_H
|
||||
|
|
0
sdk-modifications/include/fs_unicode.h
Normal file → Executable file
0
sdk-modifications/include/mem_allocate.h
Normal file → Executable file
0
sdk-modifications/include/mips.h
Normal file → Executable file
0
sdk-modifications/include/mipsregs.h
Normal file → Executable file
0
sdk-modifications/include/mmc_api.h
Normal file → Executable file
0
sdk-modifications/include/partition.h
Normal file → Executable file
0
sdk-modifications/include/tcm.h
Normal file → Executable file
|
@ -13,7 +13,7 @@ CONSOLE_DIR = $(TOPDIR)/console
|
|||
FS_DIR = $(TOPDIR)/fs
|
||||
KEY_DIR = $(TOPDIR)/key
|
||||
ZLIB_DIR = $(TOPDIR)/zlib
|
||||
DMA_DIR = $(TOPDIR)/dma
|
||||
CORE_DIR = $(TOPDIR)/core
|
||||
|
||||
SRC :=
|
||||
|
||||
|
@ -24,14 +24,17 @@ INCLUDES := -I../include
|
|||
INC := $(INCLUDES)
|
||||
|
||||
CFLAGS := -mips32 -O3 -mno-abicalls -fno-pic -fno-builtin \
|
||||
-fno-exceptions -ffunction-sections -mlong-calls\
|
||||
-fomit-frame-pointer -msoft-float -G 4
|
||||
|
||||
-fno-exceptions -ffunction-sections -mno-long-calls\
|
||||
-fomit-frame-pointer -msoft-float -G 4 \
|
||||
-fgcse-sm -fgcse-las -fgcse-after-reload \
|
||||
-fweb -fpeel-loops
|
||||
|
||||
|
||||
include $(CONSOLE_DIR)/console.mk
|
||||
include $(FS_DIR)/fs.mk
|
||||
include $(KEY_DIR)/key.mk
|
||||
include $(ZLIB_DIR)/zlib.mk
|
||||
include $(DMA_DIR)/dma.mk
|
||||
include $(CORE_DIR)/core.mk
|
||||
|
||||
#OBJS := $(addsuffix .o , $(basename $(notdir $(SRC))))
|
||||
#SOBJS := $(addsuffix .o , $(basename $(notdir $(SSRC))))
|
||||
|
|
28
sdk-modifications/libsrc/changes_bag.txt
Normal file
|
@ -0,0 +1,28 @@
|
|||
Unofficial libds2a by BassAceGold
|
||||
Based on 0.13 beta Supercard SDK release, contains full lib with changes
|
||||
|
||||
|
||||
|
||||
release 1:
|
||||
-inclusion of ds2_unistd.h and ds2_fcntl.h
|
||||
-updated zlib to 1.5.2
|
||||
|
||||
release 2:
|
||||
-mkdir no longer freezes
|
||||
-faster fopen times for file reading
|
||||
(no longer searches for the next cluster to write to with read only mode)
|
||||
-makes DS2's DMA (direct memory access hardware) features publically available
|
||||
-adds extra cpu clock speeds (may be unstable)
|
||||
ds2_setCPULevel(level)
|
||||
-can now get the current CPU clock speed as an integer value
|
||||
ds2_getCPUClock()
|
||||
|
||||
release 2 fix 1:
|
||||
-added ds2_udelay and ds2_mdelay variant functions.
|
||||
must be used with ds2_setCPULevel for accurate timings,
|
||||
old functions, udelay and mdelay, should not be used with the new
|
||||
cpu clock functions
|
||||
-added further optimizations to makefile
|
||||
|
||||
release 2 fix 2:
|
||||
-fat_getDiskSpaceInfo no longer freezes
|
0
sdk-modifications/libsrc/console/console.c
Normal file → Executable file
0
sdk-modifications/libsrc/console/console.h
Normal file → Executable file
0
sdk-modifications/libsrc/console/console.mk
Normal file → Executable file
0
sdk-modifications/libsrc/console/font_dot.h
Normal file → Executable file
11
sdk-modifications/libsrc/core/core.mk
Normal file
|
@ -0,0 +1,11 @@
|
|||
#fs.mk
|
||||
|
||||
SRC += $(CORE_DIR)/ds2_dma.c \
|
||||
$(CORE_DIR)/ds2_cpuclock.c
|
||||
|
||||
SSRC +=
|
||||
|
||||
INC += -I$(CORE_DIR)
|
||||
|
||||
CFLAGS +=
|
||||
|
272
sdk-modifications/libsrc/core/ds2_cpuclock.c
Normal file
|
@ -0,0 +1,272 @@
|
|||
#include <ds2_types.h>
|
||||
|
||||
#include "ds2_cpuclock.h"
|
||||
|
||||
#define REG8(addr) *((volatile u8 *)(addr))
|
||||
#define REG16(addr) *((volatile u16 *)(addr))
|
||||
#define REG32(addr) *((volatile u32 *)(addr))
|
||||
|
||||
#define SDRAM_TRAS 50 /* RAS# Active Time */
|
||||
#define SDRAM_RCD 23 /* RAS# to CAS# Delay */
|
||||
#define SDRAM_TPC 23 /* RAS# Precharge Time */
|
||||
#define SDRAM_TRWL 7 /* Write Latency Time */
|
||||
#define SDRAM_TREF 7813 /* Refresh period: 8192 refresh cycles/64ms */
|
||||
|
||||
#define EMC_BASE 0xB3010000
|
||||
#define EMC_DMCR (EMC_BASE + 0x80) /* DRAM Control Register */
|
||||
#define REG_EMC_DMCR REG32(EMC_DMCR)
|
||||
#define EMC_RTCSR (EMC_BASE + 0x84) /* Refresh Time Control/Status Register */
|
||||
#define REG_EMC_RTCSR REG16(EMC_RTCSR)
|
||||
#define EMC_RTCOR (EMC_BASE + 0x8c) /* Refresh Time Constant Register */
|
||||
#define REG_EMC_RTCOR REG16(EMC_RTCOR)
|
||||
#define EMC_RTCNT (EMC_BASE + 0x88) /* Refresh Timer Counter */
|
||||
#define REG_EMC_RTCNT REG16(EMC_RTCNT)
|
||||
|
||||
|
||||
|
||||
#define CPM_BASE 0xB0000000
|
||||
#define CPM_CPCCR (CPM_BASE+0x00)
|
||||
#define CPM_CPPCR (CPM_BASE+0x10)
|
||||
//#define CPM_RSR (CPM_BASE+0x08)
|
||||
#define REG_CPM_CPCCR REG32(CPM_CPCCR)
|
||||
#define REG_CPM_CPPCR REG32(CPM_CPPCR)
|
||||
#define CPM_CPCCR_CE (1 << 22)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define EMC_DMCR_TRAS_BIT 13
|
||||
#define EMC_DMCR_TRAS_MASK (0x07 << EMC_DMCR_TRAS_BIT)
|
||||
#define EMC_DMCR_RCD_BIT 11
|
||||
#define EMC_DMCR_RCD_MASK (0x03 << EMC_DMCR_RCD_BIT)
|
||||
#define EMC_DMCR_TPC_BIT 8
|
||||
#define EMC_DMCR_TPC_MASK (0x07 << EMC_DMCR_TPC_BIT)
|
||||
#define EMC_DMCR_TRWL_BIT 5
|
||||
#define EMC_DMCR_TRWL_MASK (0x03 << EMC_DMCR_TRWL_BIT)
|
||||
#define EMC_DMCR_TRC_BIT 2
|
||||
#define EMC_DMCR_TRC_MASK (0x07 << EMC_DMCR_TRC_BIT)
|
||||
|
||||
#define EMC_RTCSR_CKS_BIT 0
|
||||
#define EMC_RTCSR_CKS_MASK (0x07 << EMC_RTCSR_CKS_BIT)
|
||||
|
||||
|
||||
#define CPM_CPCCR_LDIV_BIT 16
|
||||
#define CPM_CPCCR_LDIV_MASK (0x1f << CPM_CPCCR_LDIV_BIT)
|
||||
#define CPM_CPCCR_MDIV_BIT 12
|
||||
#define CPM_CPCCR_MDIV_MASK (0x0f << CPM_CPCCR_MDIV_BIT)
|
||||
#define CPM_CPCCR_PDIV_BIT 8
|
||||
#define CPM_CPCCR_PDIV_MASK (0x0f << CPM_CPCCR_PDIV_BIT)
|
||||
#define CPM_CPCCR_HDIV_BIT 4
|
||||
#define CPM_CPCCR_HDIV_MASK (0x0f << CPM_CPCCR_HDIV_BIT)
|
||||
#define CPM_CPCCR_CDIV_BIT 0
|
||||
#define CPM_CPCCR_CDIV_MASK (0x0f << CPM_CPCCR_CDIV_BIT)
|
||||
|
||||
|
||||
#define CPM_CPPCR_PLLM_BIT 23
|
||||
#define CPM_CPPCR_PLLM_MASK (0x1ff << CPM_CPPCR_PLLM_BIT)
|
||||
#define CPM_CPPCR_PLLN_BIT 18
|
||||
#define CPM_CPPCR_PLLN_MASK (0x1f << CPM_CPPCR_PLLN_BIT)
|
||||
#define CPM_CPPCR_PLLOD_BIT 16
|
||||
#define CPM_CPPCR_PLLOD_MASK (0x03 << CPM_CPPCR_PLLOD_BIT)
|
||||
#define CPM_CPPCR_PLLS (1 << 10)
|
||||
#define CPM_CPPCR_PLLBP (1 << 9)
|
||||
#define CPM_CPPCR_PLLEN (1 << 8)
|
||||
#define CPM_CPPCR_PLLST_BIT 0
|
||||
#define CPM_CPPCR_PLLST_MASK (0xff << CPM_CPPCR_PLLST_BIT)
|
||||
|
||||
|
||||
#define PLL_M 0
|
||||
#define PLL_N 1
|
||||
#define PLL_CCLK 2
|
||||
#define PLL_HCLK 3
|
||||
#define PLL_MCLK 4
|
||||
#define PLL_PCLK 5
|
||||
|
||||
#define CFG_EXTAL 24000000
|
||||
#define EXTAL_CLK CFG_EXTAL
|
||||
|
||||
|
||||
#define __cpm_get_pllm() \
|
||||
((REG_CPM_CPPCR & CPM_CPPCR_PLLM_MASK) >> CPM_CPPCR_PLLM_BIT)
|
||||
|
||||
#define __cpm_get_plln() \
|
||||
((REG_CPM_CPPCR & CPM_CPPCR_PLLN_MASK) >> CPM_CPPCR_PLLN_BIT)
|
||||
|
||||
#define __cpm_get_cdiv() \
|
||||
((REG_CPM_CPCCR & CPM_CPCCR_CDIV_MASK) >> CPM_CPCCR_CDIV_BIT)
|
||||
|
||||
|
||||
static unsigned char pll_m_n[CPU_MAX_LEVEL_EX + 1][6] = {
|
||||
//M, N, CCLK, HCLK, MCLK, PCLK, EXT_CLK=24MHz
|
||||
{10-2, 2-2, 1, 1, 1, 1}, //0 60, 60, 1/1
|
||||
{10-2, 2-2, 0, 1, 1, 1}, //1 120, 60, 1/2
|
||||
{10-2, 2-2, 0, 0, 0, 0}, //2 120, 120, 1/1
|
||||
{12-2, 2-2, 0, 1, 1, 1}, //3 144, 72, 1/2
|
||||
{16-2, 2-2, 0, 1, 1, 1}, //4 192, 96, 1/2
|
||||
{17-2, 2-2, 0, 0, 1, 1}, //5 204, 102, 1/2
|
||||
{20-2, 2-2, 0, 1, 1, 1}, //6 240, 120, 1/2
|
||||
{22-2, 2-2, 0, 2, 2, 2}, //7 264, 88, 1/3
|
||||
{24-2, 2-2, 0, 2, 2, 2}, //8 288, 96, 1/3
|
||||
{25-2, 2-2, 0, 2, 2, 2}, //9 300, 100, 1/3
|
||||
{28-2, 2-2, 0, 2, 2, 2}, //10 336, 112, 1/3
|
||||
{30-2, 2-2, 0, 2, 2, 2}, //11 360, 120, 1/3
|
||||
{32-2, 2-2, 0, 2, 2, 2}, //12 384, 128, 1/3
|
||||
{33-2, 2-2, 0, 2, 2, 2}, //13 396, 132, 1/3
|
||||
|
||||
{34-2, 2-2, 0, 2, 2, 2}, //14 404, 132, 1/3
|
||||
{35-2, 2-2, 0, 2, 2, 2}, //15 420, 132, 1/3
|
||||
{36-2, 2-2, 0, 2, 2, 2}, //16 438, 132, 1/3
|
||||
{37-2, 2-2, 0, 2, 2, 2}, //17 444, 132, 1/3
|
||||
{38-2, 2-2, 0, 2, 2, 2}, //18 456, 132, 1/3
|
||||
//{39-2, 2-2, 0, 2, 2, 2}, //468, instant crash!
|
||||
};
|
||||
|
||||
static int _sdram_convert(unsigned int pllin,unsigned int *sdram_dmcr, unsigned int *sdram_div, unsigned int *sdram_tref)
|
||||
{
|
||||
register unsigned int ns, dmcr,tmp;
|
||||
|
||||
dmcr = ~(EMC_DMCR_TRAS_MASK | EMC_DMCR_RCD_MASK | EMC_DMCR_TPC_MASK |
|
||||
EMC_DMCR_TRWL_MASK | EMC_DMCR_TRC_MASK) & REG_EMC_DMCR;
|
||||
|
||||
/* Set sdram operation parameter */
|
||||
//pllin unit is KHz
|
||||
ns = 1000000*1024 / pllin;
|
||||
tmp = SDRAM_TRAS*1024/ns;
|
||||
if (tmp < 4) tmp = 4;
|
||||
if (tmp > 11) tmp = 11;
|
||||
dmcr |= ((tmp-4) << EMC_DMCR_TRAS_BIT);
|
||||
|
||||
tmp = SDRAM_RCD*1024/ns;
|
||||
if (tmp > 3) tmp = 3;
|
||||
dmcr |= (tmp << EMC_DMCR_RCD_BIT);
|
||||
|
||||
tmp = SDRAM_TPC*1024/ns;
|
||||
if (tmp > 7) tmp = 7;
|
||||
dmcr |= (tmp << EMC_DMCR_TPC_BIT);
|
||||
|
||||
tmp = SDRAM_TRWL*1024/ns;
|
||||
if (tmp > 3) tmp = 3;
|
||||
dmcr |= (tmp << EMC_DMCR_TRWL_BIT);
|
||||
|
||||
tmp = (SDRAM_TRAS + SDRAM_TPC)*1024/ns;
|
||||
if (tmp > 14) tmp = 14;
|
||||
dmcr |= (((tmp + 1) >> 1) << EMC_DMCR_TRC_BIT);
|
||||
|
||||
*sdram_dmcr = dmcr;
|
||||
|
||||
/* Set refresh registers */
|
||||
unsigned int div;
|
||||
tmp = SDRAM_TREF*1024/ns;
|
||||
div = (tmp + 254)/255;
|
||||
if(div <= 4) div = 1; // 1/4
|
||||
else if(div <= 16) div = 2; // 1/16
|
||||
else div = 3; // 1/64
|
||||
|
||||
*sdram_div = ~EMC_RTCSR_CKS_MASK & REG_EMC_RTCSR | div;
|
||||
|
||||
unsigned int divm= 4;
|
||||
while(--div) divm *= 4;
|
||||
|
||||
tmp = tmp/divm + 1;
|
||||
*sdram_tref = tmp;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
const static int FR2n[] = {
|
||||
1, 2, 3, 4, 6, 8, 12, 16, 24, 32
|
||||
};
|
||||
|
||||
static unsigned int _pllout;
|
||||
static unsigned int _iclk;
|
||||
|
||||
static void detect_clockNew(void){
|
||||
_pllout = (__cpm_get_pllm() + 2)* EXTAL_CLK / (__cpm_get_plln() + 2);
|
||||
_iclk = _pllout / FR2n[__cpm_get_cdiv()];
|
||||
}
|
||||
|
||||
|
||||
//udelay overclock
|
||||
void ds2_udelay(unsigned int usec)
|
||||
{
|
||||
unsigned int i = usec * (_iclk / 2000000);
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"\t.set noreorder\n"
|
||||
"1:\n\t"
|
||||
"bne\t%0, $0, 1b\n\t"
|
||||
"addi\t%0, %0, -1\n\t"
|
||||
".set reorder\n"
|
||||
: "=r" (i)
|
||||
: "0" (i)
|
||||
);
|
||||
}
|
||||
|
||||
//mdelay overclock
|
||||
void ds2_mdelay(unsigned int msec)
|
||||
{
|
||||
int i;
|
||||
for(i=0;i<msec;i++)
|
||||
{
|
||||
ds2_udelay(1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int ds2_getCPUClock(void){
|
||||
return (_pllout/1000/1000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* convert pll while program is running */
|
||||
int ds2_setCPULevel(unsigned int level){
|
||||
unsigned int freq_b;
|
||||
unsigned int dmcr;
|
||||
unsigned int rtcsr;
|
||||
unsigned int tref;
|
||||
unsigned int cpccr;
|
||||
unsigned int cppcr;
|
||||
|
||||
if(level > CPU_MAX_LEVEL_EX) return -1;
|
||||
|
||||
freq_b = (pll_m_n[level][PLL_M]+2)*(EXTAL_CLK/1000)/(pll_m_n[level][PLL_N]+2);
|
||||
|
||||
//freq_b unit is KHz
|
||||
_sdram_convert(freq_b/pll_m_n[level][PLL_MCLK], &dmcr, &rtcsr, &tref);
|
||||
|
||||
cpccr = REG_CPM_CPCCR;
|
||||
cppcr = REG_CPM_CPPCR;
|
||||
|
||||
REG_CPM_CPCCR = ~CPM_CPCCR_CE & cpccr;
|
||||
|
||||
cppcr &= ~(CPM_CPPCR_PLLM_MASK | CPM_CPPCR_PLLN_MASK);
|
||||
cppcr |= (pll_m_n[level][PLL_M] << CPM_CPPCR_PLLM_BIT) | (pll_m_n[level][PLL_N] << CPM_CPPCR_PLLN_BIT);
|
||||
|
||||
cpccr &= ~(CPM_CPCCR_CDIV_MASK | CPM_CPCCR_HDIV_MASK | CPM_CPCCR_PDIV_MASK |
|
||||
CPM_CPCCR_MDIV_MASK | CPM_CPCCR_LDIV_MASK);
|
||||
cpccr |= (pll_m_n[level][PLL_CCLK] << CPM_CPCCR_CDIV_BIT) | (pll_m_n[level][PLL_HCLK] << CPM_CPCCR_HDIV_BIT) |
|
||||
(pll_m_n[level][PLL_MCLK] << CPM_CPCCR_MDIV_BIT) | (pll_m_n[level][PLL_PCLK] << CPM_CPCCR_PDIV_BIT) |
|
||||
(31 << CPM_CPCCR_LDIV_BIT);
|
||||
|
||||
REG_CPM_CPCCR = cpccr;
|
||||
REG_CPM_CPPCR = cppcr;
|
||||
|
||||
REG_CPM_CPCCR |= CPM_CPCCR_CE;
|
||||
//Wait PLL stable
|
||||
while(!(CPM_CPPCR_PLLS & REG_CPM_CPPCR));
|
||||
|
||||
//REG_EMC_DMCR = dmcr;
|
||||
REG_EMC_RTCOR = tref;
|
||||
REG_EMC_RTCNT = tref;
|
||||
|
||||
detect_clockNew();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
22
sdk-modifications/libsrc/core/ds2_cpuclock.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef _DS2_CPUCLOCK_H__
|
||||
#define _DS2_CPUCLOCK_H__
|
||||
|
||||
|
||||
#define CPU_MAX_LEVEL_EX 18
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int ds2_getCPUClock(void);
|
||||
extern int ds2_setCPULevel(unsigned int level);
|
||||
extern void udelayOC(unsigned int usec);
|
||||
extern void mdelayOC(unsigned int msec);
|
||||
|
||||
//#define ds2_setCPUclocklevel ds2_setCPULevel
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__DS2_CPUCLOCK_H__
|
34
sdk-modifications/libsrc/core/ds2_dma.c
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include "ds2_dma.h"
|
||||
|
||||
|
||||
|
||||
//register a DMA transfer request
|
||||
//ch: channel id request, there are 6 channles,
|
||||
//irq_handler: the DMA interruption handle
|
||||
//arg: argument to the handle
|
||||
//mode: DMA mode, such as port width, address increased/fixed, and so on
|
||||
//type: DMA request type
|
||||
extern int dma_request(int ch, void (*irq_handler)(unsigned int), unsigned int arg,
|
||||
unsigned int mode, unsigned int type);
|
||||
|
||||
//start DMA transfer, must request a DMA first
|
||||
//ch: channel id
|
||||
//srcAddr: DMA source address
|
||||
//dstAddr: DMA destination address
|
||||
//count: DMA transfer count, the total bytes due the mode in dma_request
|
||||
extern void dma_start(int ch, unsigned int srcAddr, unsigned int dstAddr,
|
||||
unsigned int count);
|
||||
|
||||
|
||||
int _dmaCopy(int ch, void *dest, void *src, unsigned int size, unsigned int flags){
|
||||
int test = 0;
|
||||
if(!(test = dma_request(ch, 0, 0,
|
||||
//increment dest addr
|
||||
DMAC_DCMD_DAI | flags,
|
||||
//auto request type
|
||||
DMAC_DRSR_RS_AUTO)))
|
||||
{
|
||||
dma_start(ch, (unsigned int)src, (unsigned int)dest, size);
|
||||
}
|
||||
return test;
|
||||
}
|
142
sdk-modifications/libsrc/core/ds2_dma.h
Normal file
|
@ -0,0 +1,142 @@
|
|||
#ifndef _DS2_DMA_H__
|
||||
#define _DS2_DMA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define MAX_DMA_NUM 6 /* max 6 channels */
|
||||
|
||||
|
||||
// DMA request source register
|
||||
#define DMAC_DRSR_RS_BIT 0
|
||||
#define DMAC_DRSR_RS_AUTO (8 << DMAC_DRSR_RS_BIT)
|
||||
|
||||
|
||||
// DMA channel command register
|
||||
#define DMAC_DCMD_SAI (1 << 23) /* source address increment */
|
||||
#define DMAC_DCMD_DAI (1 << 22) /* dest address increment */
|
||||
|
||||
#define DMAC_DCMD_SWDH_BIT 14 /* source port width */
|
||||
#define DMAC_DCMD_SWDH_32 (0 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_SWDH_8 (1 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_SWDH_16 (2 << DMAC_DCMD_SWDH_BIT)
|
||||
|
||||
#define DMAC_DCMD_DWDH_BIT 12 /* dest port width */
|
||||
#define DMAC_DCMD_DWDH_32 (0 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_8 (1 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_16 (2 << DMAC_DCMD_DWDH_BIT)
|
||||
|
||||
#define DMAC_DCMD_DS_BIT 8 /* transfer data size of a data unit */
|
||||
#define DMAC_DCMD_DS_32BIT (0 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_8BIT (1 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_16BIT (2 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_16BYTE (3 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_32BYTE (4 << DMAC_DCMD_DS_BIT)
|
||||
|
||||
#define DMAC_DCMD_TM (1 << 7) /* transfer mode: 0-single 1-block */
|
||||
|
||||
|
||||
//detect if channel has completed job
|
||||
#define DMAC_DCCSR_TT (1 << 3) /* transfer terminated */
|
||||
#define DMAC_BASE 0xB3020000
|
||||
#define REG32(addr) *((volatile u32 *)(addr))
|
||||
#define DMAC_DCCSR(n) (DMAC_BASE + (0x10 + (n) * 0x20)) /* DMA control/status */
|
||||
#define REG_DMAC_DCCSR(n) REG32(DMAC_DCCSR((n)))
|
||||
|
||||
#define ds2_DMA_isBusy(n) \
|
||||
!( REG_DMAC_DCCSR((n)) & DMAC_DCCSR_TT )
|
||||
|
||||
|
||||
/*
|
||||
Copy modes
|
||||
|
||||
*/
|
||||
|
||||
#define DMA_MODE32BYTE DMAC_DCMD_SWDH_32 | DMAC_DCMD_DWDH_32 | \
|
||||
DMAC_DCMD_DS_32BYTE | DMAC_DCMD_TM
|
||||
|
||||
#define DMA_MODE16BYTE DMAC_DCMD_SWDH_16 | DMAC_DCMD_DWDH_16 | \
|
||||
DMAC_DCMD_DS_16BYTE | DMAC_DCMD_TM
|
||||
|
||||
#define DMA_MODE32BIT DMAC_DCMD_SWDH_32 | DMAC_DCMD_DWDH_32 | \
|
||||
DMAC_DCMD_DS_32BIT
|
||||
|
||||
#define DMA_MODE16BIT DMAC_DCMD_SWDH_16 | DMAC_DCMD_DWDH_16 | \
|
||||
DMAC_DCMD_DS_16BIT
|
||||
|
||||
#define DMA_MODE8BIT DMAC_DCMD_SWDH_8 | DMAC_DCMD_DWDH_8 | \
|
||||
DMAC_DCMD_DS_8BIT | DMAC_DCMD_TM
|
||||
|
||||
#define DMA_MODECOPY DMAC_DCMD_SAI
|
||||
|
||||
|
||||
|
||||
extern int _dmaCopy(int ch, void *dest, void *src, unsigned int size, unsigned int flags);
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 32 bytes.
|
||||
* size is in bytes and must be a multiple of 32.
|
||||
* Both src and dest must be aligned to 32 bytes.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_32Byte(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE32BYTE)
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 16 bytes.
|
||||
* size is in bytes and must be a multiple of 16.
|
||||
* Both src and dest must be aligned to 16 bytes.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_16Byte(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE16BYTE);
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 32 bits (4 bytes).
|
||||
* size is in bytes and must be a multiple of 4.
|
||||
* Both src and dest must be aligned to 32 bits (4 bytes).
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_32Bit(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE32BIT);
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 16 bits (2 bytes).
|
||||
* size is in bytes and must be a multiple of 2.
|
||||
* Both src and dest must be aligned to 16 bits (2 bytes).
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_16Bit(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE16BIT)
|
||||
|
||||
/*
|
||||
* Copy 'size' individual bytes (8 bits at a time) from src to dest.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
#define ds2_DMAcopy_8Bit(ch, dest, src, size)\
|
||||
_dmaCopy(ch, dest, src, size, DMA_MODECOPY | DMA_MODE8BIT)
|
||||
|
||||
|
||||
|
||||
//Stop DMA transfer
|
||||
extern void dma_stop(int ch);
|
||||
|
||||
#define ds2_DMA_stop(ch)\
|
||||
dma_stop(ch)
|
||||
|
||||
//Wait DMA transfer over
|
||||
extern int dma_wait_finish(int ch);
|
||||
|
||||
#define ds2_DMA_wait(ch)\
|
||||
dma_wait_finish(ch)
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__DMA_H__
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#dma.mk
|
||||
|
||||
SRC += $(DMA_DIR)/dmacopy.c
|
||||
|
||||
SSRC +=
|
||||
|
||||
INC += -I$(DMA_DIR)
|
||||
|
||||
CFLAGS +=
|
|
@ -1,167 +0,0 @@
|
|||
#include <stdlib.h>
|
||||
#include "ds2_dma.h"
|
||||
#include "ds2_types.h"
|
||||
|
||||
#define MAX_DMA_NUM 6 /* max 6 channels */
|
||||
|
||||
|
||||
// DMA request source register
|
||||
#define DMAC_DRSR_RS_BIT 0
|
||||
#define DMAC_DRSR_RS_MASK (0x2f << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_AUTO (8 << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_UART0OUT (20 << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_UART0IN (21 << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_SSIOUT (22 << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_SSIIN (23 << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_AICOUT (24 << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_AICIN (25 << DMAC_DRSR_RS_BIT)
|
||||
#define DMAC_DRSR_RS_MSCOUT (26 << DMAC_DRSR_RS_BIT) //SD0
|
||||
#define DMAC_DRSR_RS_MSCIN (27 << DMAC_DRSR_RS_BIT)
|
||||
|
||||
|
||||
// DMA channel command register
|
||||
#define DMAC_DCMD_SAI (1 << 23) /* source address increment */
|
||||
#define DMAC_DCMD_DAI (1 << 22) /* dest address increment */
|
||||
#define DMAC_DCMD_SWDH_BIT 14 /* source port width */
|
||||
#define DMAC_DCMD_SWDH_MASK (0x03 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_SWDH_32 (0 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_SWDH_8 (1 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_SWDH_16 (2 << DMAC_DCMD_SWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_BIT 12 /* dest port width */
|
||||
#define DMAC_DCMD_DWDH_MASK (0x03 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_32 (0 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_8 (1 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DWDH_16 (2 << DMAC_DCMD_DWDH_BIT)
|
||||
#define DMAC_DCMD_DS_BIT 8 /* transfer data size of a data unit */
|
||||
#define DMAC_DCMD_DS_MASK (0x07 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_32BIT (0 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_8BIT (1 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_16BIT (2 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_16BYTE (3 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_DS_32BYTE (4 << DMAC_DCMD_DS_BIT)
|
||||
#define DMAC_DCMD_TM (1 << 7) /* transfer mode: 0-single 1-block */
|
||||
#define DMAC_DCCSR_TT (1 << 3) /* transfer terminated */
|
||||
|
||||
#define DMAC_BASE 0xB3020000
|
||||
#define REG32(addr) *((volatile u32 *)(addr))
|
||||
#define DMAC_DCCSR(n) (DMAC_BASE + (0x10 + (n) * 0x20)) /* DMA control/status */
|
||||
#define REG_DMAC_DCCSR(n) REG32(DMAC_DCCSR((n)))
|
||||
|
||||
#define __dmac_channel_transmit_end_detected(n) \
|
||||
( REG_DMAC_DCCSR((n)) & DMAC_DCCSR_TT )
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 32 bytes.
|
||||
* size is in bytes and must be a multiple of 32.
|
||||
* Both src and dest must be aligned to 32 bytes.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
int dma_copy32Byte(int ch, void *dest, void *src, unsigned int size){
|
||||
int test = 0;
|
||||
if(!(test = dma_request(ch, NULL, 0,
|
||||
//increment dest addr, increment source addr
|
||||
DMAC_DCMD_DAI | DMAC_DCMD_SAI |
|
||||
//set src width 32 bytes, set dest width 32 bytes
|
||||
DMAC_DCMD_SWDH_32 | DMAC_DCMD_DWDH_32 |
|
||||
//set copy mode to 32 bytes, copy in blocks
|
||||
DMAC_DCMD_DS_32BYTE | DMAC_DCMD_TM,
|
||||
//auto request type
|
||||
DMAC_DRSR_RS_AUTO)))
|
||||
{
|
||||
dma_start(ch, (unsigned int)src, (unsigned int)dest, size);
|
||||
}
|
||||
return test;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
int sampleUsage(in ch, void *dest, void *src, unsigned int size){
|
||||
//channel 0 is used for mmc stuff, so its best to avoid using it
|
||||
|
||||
//initialize and start copy
|
||||
if(dma_copy32Byte(ch, dest, src, size)){
|
||||
dma_wait_finish(ch);//wait for copy to finish
|
||||
dma_stop(ch);//must stop after transfer is done to reset channel
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 16 bytes.
|
||||
* size is in bytes and must be a multiple of 16.
|
||||
* Both src and dest must be aligned to 16 bytes.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
int dma_copy16Byte(int ch, void *dest, void *src, unsigned int size){
|
||||
int test = 0;
|
||||
if(!(test = dma_request(ch, NULL, 0,
|
||||
DMAC_DCMD_DAI | DMAC_DCMD_SAI | DMAC_DCMD_SWDH_16 |
|
||||
DMAC_DCMD_DWDH_16 | DMAC_DCMD_DS_16BYTE | DMAC_DCMD_TM,
|
||||
DMAC_DRSR_RS_AUTO)))
|
||||
{
|
||||
dma_start(ch, (unsigned int)src, (unsigned int)dest, size);
|
||||
}
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 32 bits (4 bytes).
|
||||
* size is in bytes and must be a multiple of 4.
|
||||
* Both src and dest must be aligned to 32 bits (4 bytes).
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
int dma_copy32Bit(int ch, void *dest, void *src, unsigned int size){
|
||||
int test = 0;
|
||||
if(!(test = dma_request(ch, NULL, 0,
|
||||
DMAC_DCMD_DAI | DMAC_DCMD_SAI | DMAC_DCMD_SWDH_32 | DMAC_DCMD_DWDH_32 |
|
||||
DMAC_DCMD_DS_32BIT | DMAC_DCMD_TM,
|
||||
DMAC_DRSR_RS_AUTO)))
|
||||
{
|
||||
dma_start(ch, (unsigned int)src, (unsigned int)dest, size);
|
||||
}
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 16 bits (2 bytes).
|
||||
* size is in bytes and must be a multiple of 2.
|
||||
* Both src and dest must be aligned to 16 bits (2 bytes).
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
int dma_copy16Bit(int ch, void *dest, void *src, unsigned int size){
|
||||
int test = 0;
|
||||
|
||||
if(!(test = dma_request(ch, NULL, 0,
|
||||
DMAC_DCMD_DAI | DMAC_DCMD_SAI | DMAC_DCMD_SWDH_16 | DMAC_DCMD_DWDH_16 |
|
||||
DMAC_DCMD_DS_16BIT,
|
||||
DMAC_DRSR_RS_AUTO)))
|
||||
{
|
||||
dma_start(ch, (unsigned int)src, (unsigned int)dest, size);
|
||||
}
|
||||
|
||||
return test;
|
||||
}
|
||||
|
||||
|
||||
//returns if a channel is still copying
|
||||
int dma_isBusy(int ch){
|
||||
if(ch < 1 || ch >= MAX_DMA_NUM)
|
||||
return 0;
|
||||
|
||||
return !__dmac_channel_transmit_end_detected(ch);
|
||||
}
|
||||
|
||||
//returns the first non busy channel
|
||||
int dma_getFree(void){
|
||||
int i;
|
||||
for(i = 1; i < MAX_DMA_NUM; i++){
|
||||
if(!dma_isBusy(i))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
#ifndef __DMA_H__
|
||||
#define __DMA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//register a DMA transfer request
|
||||
//ch: channel id request, there are 6 channles,
|
||||
//irq_handler: the DMA interruption handle
|
||||
//arg: argument to the handle
|
||||
//mode: DMA mode, such as port width, address increased/fixed, and so on
|
||||
//type: DMA request type
|
||||
extern int dma_request(int ch, void (*irq_handler)(unsigned int), unsigned int arg,
|
||||
unsigned int mode, unsigned int type);
|
||||
|
||||
//start DMA transfer, must request a DMA first
|
||||
//ch: channel id
|
||||
//srcAddr: DMA source address
|
||||
//dstAddr: DMA destination address
|
||||
//count: DMA transfer count, the total bytes due the mode in dma_request
|
||||
extern void dma_start(int ch, unsigned int srcAddr, unsigned int dstAddr,
|
||||
unsigned int count);
|
||||
|
||||
//Stop DMA transfer
|
||||
extern void dma_stop(int ch);
|
||||
|
||||
//Wait DMA transfer over
|
||||
extern int dma_wait_finish(int ch);
|
||||
|
||||
|
||||
/*
|
||||
* Copy 'size' bytes from src to dest, in blocks of 32 bytes.
|
||||
* size is in bytes and must be a multiple of 32.
|
||||
* Both src and dest must be aligned to 32 bytes.
|
||||
* Returns 0 on failure, non-zero on success.
|
||||
*/
|
||||
extern int dma_copy32Byte(int ch, void *dest, void *src, unsigned int size);
|
||||
// Blocks of 16 bytes, aligned to 16 bytes
|
||||
extern int dma_copy16Byte(int ch, void *dest, void *src, unsigned int size);
|
||||
// Blocks of 4 bytes, aligned to 4 bytes
|
||||
extern int dma_copy32Bit(int ch, void *dest, void *src, unsigned int size);
|
||||
// Blocks of 2 bytes, aligned to 2 bytes
|
||||
extern int dma_copy16Bit(int ch, void *dest, void *src, unsigned int size);
|
||||
extern int dma_isBusy(int ch);
|
||||
extern int dma_isFree(int ch);
|
||||
extern int dma_getFree(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__DMA_H__
|
||||
|
0
sdk-modifications/libsrc/fs/bit_ops.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/cache.c
Normal file → Executable file
38
sdk-modifications/libsrc/fs/directory.c
Normal file → Executable file
|
@ -135,7 +135,7 @@ bool _FAT_directory_isValidLfn (const char* name) {
|
|||
return true;
|
||||
}
|
||||
bool _FAT_directory_isValidAlias (const char* name) {
|
||||
return false;//disables this function to preserve file name casing
|
||||
//return false;//disables this function to preserve file name casing
|
||||
|
||||
u32 i;
|
||||
u32 nameLength;
|
||||
|
@ -159,7 +159,7 @@ bool _FAT_directory_isValidAlias (const char* name) {
|
|||
// Make sure the name doesn't contain any control codes
|
||||
//if name isn't all capitals, then it is not a valid short name
|
||||
for (i = 0; i < nameLength; i++) {
|
||||
if (name[i] < 0x5A && name[i]!=0x20) {
|
||||
if (name[i] > 0x5A && name[i]!= 0x20) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -756,7 +756,37 @@ static bool _FAT_directory_entryExists (PARTITION* partition, const char* name,
|
|||
return false;
|
||||
}
|
||||
|
||||
//a fix for checking if a short file name is already in use.
|
||||
static bool _FAT_directory_entryExistsSFN (PARTITION* partition, const char* name, u32 dirCluster) {
|
||||
DIR_ENTRY tempEntry;
|
||||
bool foundFile;
|
||||
char alias[MAX_ALIAS_LENGTH];
|
||||
u32 dirnameLength;
|
||||
|
||||
dirnameLength = strnlen(name, MAX_FILENAME_LENGTH);
|
||||
|
||||
if (dirnameLength >= MAX_FILENAME_LENGTH) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// Make sure the entry doesn't already exist
|
||||
foundFile = _FAT_directory_getFirstEntry (partition, &tempEntry, dirCluster);
|
||||
|
||||
while (foundFile) { // It hasn't already found the file
|
||||
if(!strcasecmp(name, tempEntry.d_name))
|
||||
return true;
|
||||
|
||||
// Check if the alias matches
|
||||
_FAT_directory_entryGetAlias (tempEntry.entryData, alias);
|
||||
if ((dirnameLength == strnlen(alias, MAX_ALIAS_LENGTH))
|
||||
&& (strcasecmp(alias, name) == 0)) {
|
||||
return true;
|
||||
}
|
||||
foundFile = _FAT_directory_getNextEntry (partition, &tempEntry);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirCluster) {
|
||||
u32 entrySize;
|
||||
|
@ -833,7 +863,7 @@ bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirClu
|
|||
++ j;
|
||||
}
|
||||
// Short filename
|
||||
strupr (entry->d_name);
|
||||
strupr (entry->entryData);
|
||||
}else {
|
||||
// Long filename needed
|
||||
//memset( entry->unicodeFilename, 0, 512 );
|
||||
|
@ -883,7 +913,7 @@ bool _FAT_directory_addEntry (PARTITION* partition, DIR_ENTRY* entry, u32 dirClu
|
|||
i++;
|
||||
alias[6] = '0' + ((i / 10) % 10); // 10's digit
|
||||
alias[7] = '0' + (i % 10); // 1's digit
|
||||
} while (_FAT_directory_entryExists (partition, alias, dirCluster) && (i < 100));
|
||||
} while (_FAT_directory_entryExistsSFN (partition, alias, dirCluster) && (i < 100));
|
||||
if (i == 100) {
|
||||
// Couldn't get a tail number
|
||||
return false;
|
||||
|
|
0
sdk-modifications/libsrc/fs/directory.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/disc_io/disc.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/disc_io/disc.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/disc_io/disc_io.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/ds2_fcntl.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/ds2_fcntl.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/ds2_unistd.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/ds2_unistd.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fat.h
Normal file → Executable file
|
@ -1,9 +1,9 @@
|
|||
//fat_misc.c
|
||||
//v1.0
|
||||
|
||||
//fat_misc.c
|
||||
//v1.0
|
||||
|
||||
#include "fat_misc.h"
|
||||
#include "fs_api.h"
|
||||
|
||||
#include "fs_api.h"
|
||||
|
||||
static unsigned int _usedSecNums;
|
||||
|
||||
static int strFindFromEnd( char *str,char strValue )
|
||||
|
@ -40,11 +40,11 @@ static int strFindFromEnd( char *str,char strValue )
|
|||
|
||||
int getDirSize( const char * path, int includeSubdirs, unsigned int * dirSize )
|
||||
{
|
||||
char dirPath[MAX_FILENAME_LENGTH];
|
||||
char dirPath[MAX_FILENAME_LENGTH];
|
||||
unsigned int size = 0;
|
||||
if( "" == path ){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
memset( dirPath,0,MAX_FILENAME_LENGTH );
|
||||
strcpy( dirPath,path );
|
||||
|
@ -54,29 +54,31 @@ int getDirSize( const char * path, int includeSubdirs, unsigned int * dirSize )
|
|||
if( strlen(dirPath) > MAX_FILENAME_LENGTH )
|
||||
return false;
|
||||
|
||||
DIR_STATE_STRUCT *dir;
dir = fat_opendir((const char*)dirPath);
|
||||
DIR_STATE_STRUCT *dir;
|
||||
dir = fat_opendir((const char*)dirPath);
|
||||
if (dir == NULL)
|
||||
return false;
|
||||
struct stat stat_buf;
|
||||
DIR_ENTRY *currentEntry;
|
||||
char* filename;
|
||||
|
||||
while(fat_readdir_ex(dir, &stat_buf) != NULL)
|
||||
return false;
|
||||
|
||||
struct stat stat_buf;
|
||||
DIR_ENTRY *currentEntry;
|
||||
char* filename;
|
||||
|
||||
while((currentEntry = fat_readdir_ex(dir, &stat_buf)) != NULL)
|
||||
{
|
||||
filename = currentEntry->d_name;
|
||||
|
||||
filename = currentEntry->d_name;
|
||||
|
||||
if (strcmp(filename, ".") == 0 || strcmp(filename, "..") == 0)
|
||||
continue;
|
||||
|
||||
if (!(stat_buf.st_mode & S_IFDIR)) {
|
||||
size += (stat_buf.st_size+511)/512;
|
||||
_usedSecNums +=(stat_buf.st_size+511)/512;
|
||||
}
|
||||
else if (includeSubdirs)
|
||||
}
|
||||
else if (includeSubdirs)
|
||||
{
|
||||
// calculate the size recursively
|
||||
unsigned int subDirSize = 0;
|
||||
char dirPathBuffer[MAX_FILENAME_LENGTH];
|
||||
unsigned int subDirSize = 0;
|
||||
char dirPathBuffer[MAX_FILENAME_LENGTH];
|
||||
|
||||
memset( dirPathBuffer,0,MAX_FILENAME_LENGTH );
|
||||
strcpy( dirPathBuffer,dirPath );
|
||||
|
@ -90,8 +92,8 @@ int getDirSize( const char * path, int includeSubdirs, unsigned int * dirSize )
|
|||
memset( dirPath,0,MAX_FILENAME_LENGTH );
|
||||
strcpy( dirPath,dirPathBuffer );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fat_closedir(dir);
|
||||
|
||||
*dirSize = size;
|
||||
|
@ -102,7 +104,7 @@ int fat_getDiskTotalSpace( char * diskName, unsigned int * diskSpace )
|
|||
{
|
||||
if( !strcmp("",diskName) )
|
||||
return false;
|
||||
|
||||
|
||||
unsigned int len = strlen(diskName);
|
||||
if( *(diskName+len-1) != '/' ){
|
||||
*(diskName+len) = '/';
|
||||
|
@ -116,10 +118,10 @@ int fat_getDiskTotalSpace( char * diskName, unsigned int * diskSpace )
|
|||
return true;
|
||||
}
|
||||
|
||||
int fat_getDiskSpaceInfo( char * diskName, unsigned int * total, unsigned int * used, unsigned int * freeSpace )
|
||||
int fat_getDiskSpaceInfo( char * diskName, unsigned int * total, unsigned int * used, unsigned int * freeSpace )
|
||||
{
|
||||
_usedSecNums = 0;
|
||||
|
||||
|
||||
if( !strcmp("",diskName) )
|
||||
return -1;
|
||||
if( !fat_getDiskTotalSpace(diskName, total) )
|
||||
|
|
0
sdk-modifications/libsrc/fs/fat_misc.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fatdir.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fatdir_ex.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fatdir_ex.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fatfile.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fatfile.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fatfile_ex.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fatfile_ex.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/file_allocation_table.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/filetime.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/filetime.h
Normal file → Executable file
|
@ -14,7 +14,7 @@ SRC += $(FS_DIR)/cache.c \
|
|||
$(FS_DIR)/disc_io/disc.c \
|
||||
$(FS_DIR)/disc_io/io_ds2_mmcf.c \
|
||||
$(FS_DIR)/ds2_fcntl.c \
|
||||
$(FS_DIR)/ds2_unistd.c \
|
||||
$(FS_DIR)/ds2_unistd.c
|
||||
|
||||
SSRC +=
|
||||
|
||||
|
|
0
sdk-modifications/libsrc/fs/fs_api.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fs_api.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fs_cache.h
Normal file → Executable file
23
sdk-modifications/libsrc/fs/fs_common.h
Normal file → Executable file
|
@ -49,9 +49,10 @@
|
|||
|
||||
#define BYTES_PER_READ 512
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
// MODIFICATION START [Neb]
|
||||
// In libfat by Chishm, some types are #define'd here. In the DS2 SDK,
|
||||
// these types are defined by another header.
|
||||
#include "ds2_types.h"
|
||||
|
||||
#ifndef bool
|
||||
#define bool int
|
||||
|
@ -65,21 +66,7 @@
|
|||
#define true 1
|
||||
#endif
|
||||
|
||||
#ifndef u8
|
||||
#define u8 unsigned char
|
||||
#endif
|
||||
|
||||
#ifndef u16
|
||||
#define u16 unsigned short
|
||||
#endif
|
||||
|
||||
#ifndef u32
|
||||
#define u32 unsigned long
|
||||
#endif
|
||||
|
||||
#ifndef s32
|
||||
#define s32 long
|
||||
#endif
|
||||
// MODIFICATION END [Neb]
|
||||
|
||||
struct _reent
|
||||
{
|
||||
|
|
0
sdk-modifications/libsrc/fs/fs_unicode.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/fs_unicode.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/libfat.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/mem_allocate.h
Normal file → Executable file
0
sdk-modifications/libsrc/fs/partition.c
Normal file → Executable file
0
sdk-modifications/libsrc/fs/partition.h
Normal file → Executable file
0
sdk-modifications/libsrc/key/key.c
Normal file → Executable file
0
sdk-modifications/libsrc/key/key.h
Normal file → Executable file
0
sdk-modifications/libsrc/key/key.mk
Normal file → Executable file
|
@ -1 +1,8 @@
|
|||
This is a modified source release of zlib. zconf.h removes a reference to sys/types.h, which creates type conflicts on the DS2 SDK. For a pristine source release of zlib, please visit <http://zlib.net/>.
|
||||
This is a modified source release of zlib.
|
||||
|
||||
Changes:
|
||||
zconf.h removes a reference to sys/types.h, which creates type conflicts on the DS2 SDK.
|
||||
gzguts.h removes standard c library includes for DS2 SDK equivalents
|
||||
|
||||
|
||||
For a pristine source release of zlib, please visit <http://zlib.net>.
|