Compare commits

...

132 commits
1.28 ... master

Author SHA1 Message Date
Nebuleon Fumika
f3dab3957c Release 1.36. 2013-06-16 02:28:00 -04:00
Nebuleon Fumika
010c211443 Remove the reference to splitting the cheat database into two folders. 2013-06-16 02:22:27 -04:00
Nebuleon Fumika
72db4b9ec1 Don't crash on extensionless files. Helps GitHub issue #37 some more. Taken from DS2Compress. 2013-06-16 02:04:08 -04:00
Nebuleon Fumika
a1d1e01e11 Dynamically allocate memory for the file selector to store the name pointers into. Also dramatically simplify the file selector's name management code. This has many effects:
* It allows the file selector to handle directories of more than 511 files and a parent directory entry. (Fixes GitHub issue #37).
* It allows the file selector to sort directories along with files, which is a more common use case (game folders that contain ROM hacks, plus single game files, are sorted by name as the user expects).
* The file selector now reports progress while loading a large directory.
* The screenshot slideshow function now shows an existing dedicated message, "No screenshots found", instead of crashing when the screenshot directory contains no screenshots.

Add Quicksort code from GameYob. See <https://github.com/Nebuleon/GameYob/commit/afbeeba>.

* Faster sorting in the common case where a directory's natural order is already sorted, using the isSorted function.
* Use the median-of-three algorithm first described by Robert Sedgewick to select the pivot. Causes less recursion in many cases.
* Associates file names with their is-directory flag, keeping both in sync.
2013-06-15 23:40:29 -04:00
Nebuleon Fumika
4252250fe7 Prevent a file handle leak when previewing saved states in the row of Load cells. 2013-06-10 22:23:34 -04:00
Nebuleon Fumika
5e5d5dcaa1 L+R takes a screenshot of the Touch Screen in the menu. Taken from TempGBA commit b4a68a9ad710cd37fec0c0f604218f5a34d10fc7. 2013-05-25 12:58:14 -04:00
Nebuleon Fumika
1329a31267 Release 1.35. 2013-05-23 20:09:21 -04:00
Nebuleon Fumika
3f501f9c90 Add support for custom main menu active/inactive, message text and background colors. Fill in default values for the purple skin in uicolors.txt. 2013-05-23 20:07:48 -04:00
kukuasir
5edf465c07 Complete the Simplified Chinese block and rewrite some unclear messages for Chinese speakers. Taken from TempGBA commit 657856afdc0639c446665aa71eeb3003c0bb81ad. 2013-05-21 22:11:16 -04:00
Nebuleon Fumika
3e412a93c5 Complete the Dutch, German, Portuguese (Brazil) and Spanish localisations, aligning some messages to columns for option screens. Taken from TempGBA commit 0b4252dc2f1d6a5c7445ffd6f265e59df277ceef.
* Dutch: Add missing messages. Fix a typo in global button mappings. Thanks to Aeter for this part.
* German: Add missing messages. Thanks to SignZ for this part.
* Portuguese: Add missing messages. Thanks to Diego Liberal for this part.
* Spanish: Add missing messages. Thanks to Boriar for this part.
2013-05-20 18:46:27 -04:00
Nebuleon Fumika
48eb438a24 Fix a bug whereby quick saved states would have a screenshot of "Saving state...". 2013-05-20 17:22:38 -04:00
Nebuleon Fumika
4b5a5a15d7 Add an option to put the game on the Lower Screen.
* Before entering the menu, copy the game screen to the Upper Screen if it's on the Lower Screen.
* Now, the frame that's shown in the menu doesn't appear to be the previous frame for a fraction of a second anymore.
2013-05-20 03:17:02 -04:00
Nebuleon Fumika
41c50b372e CATSFC/system/gui/uicolors.txt: Theme support for active and inactive item text colors. 2013-05-20 00:46:43 -04:00
Nebuleon Fumika
22aa56d2ed Put the most recently played file at the top. This does not introduce an incompatibility with older preference files. 2013-05-20 00:34:33 -04:00
Nebuleon Fumika
fbe8c3fc96 sdk-modifications: Fix totally broken short-file-name (SFN) alias support which caused computers to report duplicate SFNs in directories, as well as corrupted file names and breakage with files that have no extension. 2013-05-17 23:12:43 -04:00
Nebuleon Fumika
6b370ce35b Fix a GUI bug whereby an incorrect item is considered touched in file selectors. 2013-04-28 10:03:00 -04:00
rickvdwetering
0e68b604c6 Update language.msg
Fixed minor Dutch translation errors.
2013-04-16 16:37:27 +03:00
Nebuleon Fumika
53d2f1f6cd Add the year to the date displayed in a saved state's screenshot.
Based on TempGBA commit 0adaf3c332453679cc0a2feee9e87d5a4dc3c771.
2013-04-09 23:14:04 -04:00
Hyura
700a1535d6 Brazilian Portuguese block: Correct typing errors and add missing accents. Imported from TempGBA commit d55e30a2cc4943e74a2d2505c9823dc222e220a3. 2013-04-03 18:15:40 -04:00
Nebuleon Fumika
dfd3934953 Release 1.34. 2013-03-30 03:05:41 -04:00
Nebuleon Fumika
e1eaf42367 Wait for a button to be pressed and released after showing version information. 2013-03-30 01:46:56 -04:00
Nebuleon Fumika
afe9a7ca26 Fix the odd text disappearance bug in recently played games due to the position being preserved. 2013-03-30 01:22:59 -04:00
Nebuleon Fumika
55b5c8ff65 Increase the row count from 6 to 8 in the GUI, file selector and cheats. Remove the useless "dynamic cheat" functions. 2013-03-30 01:08:07 -04:00
Nebuleon Fumika
fa71ce7345 Optimise the reading of bitmap files. 2013-03-29 22:04:27 -04:00
Nebuleon Fumika
2113821e23 Fix scrollers in file selectors after the previous commit. 2013-03-29 05:52:12 -04:00
Nebuleon Fumika
efe43d2f62 Stop the odd disappearing text when moving between files in recently played games. 2013-03-29 05:45:39 -04:00
Nebuleon Fumika
9a08a7ea4a Make rendering a GUI background (256x192) more efficient. 2013-03-29 05:24:31 -04:00
Nebuleon Fumika
900aedbed8 gui.c: Overhaul the autorepeat behaviour of get_gui_input. 2013-03-29 04:41:44 -04:00
Nebuleon Fumika
4c958cf8dd Preserve the position in a menu when moving into one of its submenus. 2013-03-29 03:23:48 -04:00
Nebuleon Fumika
2237740090 Restore the functionality of selection options with handler functions. This unbreaks commit 57bcab6a25. 2013-03-28 05:02:46 -04:00
Nebuleon Fumika
9920215d94 Remove some button press/release recognition latency in the menu. 2013-03-28 04:49:31 -04:00
Nebuleon Fumika
57bcab6a25 Reduce the number of special cases in the touch handling code. 2013-03-28 04:20:29 -04:00
Nebuleon Fumika
f27122724a Fix overlapping text (screenshot creation OK/failed) in message boxes. 2013-03-28 04:03:46 -04:00
Nebuleon Fumika
8d1854d8a2 Make "Save a screenshot" work with touch. 2013-03-28 04:00:17 -04:00
Nebuleon Fumika
13449ee395 Fix a crash in the touch handler of the delete saved state submenu. 2013-03-28 02:44:51 -04:00
Nebuleon Fumika
13971bf935 Finish the back button uniformisation. 2013-03-28 02:31:17 -04:00
Nebuleon Fumika
501fe38561 Stop the path scroller flashing when moving between files in a file selector. 2013-03-28 02:19:20 -04:00
Nebuleon Fumika
dbb2dd89f0 Delete the right number of saved states when selecting one of the options. 2013-03-27 05:14:22 -04:00
Nebuleon Fumika
0b5f9ad553 "Saving state..." was still way below the top of its message box. 2013-03-27 01:35:14 -04:00
Nebuleon Fumika
639a7081d4 Use white text with a black outline when drawing the date of a saved state into its bitmap. It looks nicer than white on a rectangle of black. 2013-03-27 01:18:31 -04:00
Nebuleon Fumika
286c44077a Show the screenshot with timestamp after writing a state. 2013-03-27 01:09:27 -04:00
Nebuleon Fumika
688b13d065 Use update method 0 everywhere in the code except that double-buffered update workaround for hangs. 2013-03-27 00:37:40 -04:00
Nebuleon Fumika
b4d2fc6168 Default to the first non-Back option in all menus for which the element count is known to always be non-zero. That excludes the recently played games menu. 2013-03-26 22:29:45 -04:00
Nebuleon Fumika
a1a4c9384e Saved state menu overhaul.
* Show the screenshot of the selected saved state even in the creation and deletion rows.
* In the saved state deletion interface, make the single state deletion go first.
* The screenshot of the latest saved state or the last selected one appears when the menu loads.
* The screenshot of the paused game appears when the menu is left.
2013-03-26 22:15:26 -04:00
Nebuleon Fumika
805ccda32c Uniformise the location of the title icon across all interfaces, default and custom. 2013-03-26 19:58:17 -04:00
Nebuleon Fumika
2fd480b4f3 Uniformise the location of the back button across all interfaces, default and custom. 2013-03-26 19:53:13 -04:00
Nebuleon Fumika
577541b509 Make the Back button more visibly selected in the default skin. 2013-03-26 19:27:52 -04:00
Boriar
14e8017953 Spanish change backported from TempGBA commit 4f2205f2e554a6fa33237395c1350f194ca9308e. 2013-03-23 19:57:12 -04:00
Nebuleon Fumika
a57b91f897 Remove \r's in the basic initialisation error messages. 2013-03-23 01:21:15 -04:00
Nebuleon Fumika
362058dc00 Allocate fewer screens for the console shown when a basic initialisation error occurs. 2013-03-23 01:20:08 -04:00
Nebuleon Fumika
24b55e1c02 Release 1.33. 2013-03-20 00:35:41 -04:00
Syphurith
e35df7290c Simplified Chinese block completion. 2013-03-16 01:30:30 -04:00
Nebuleon Fumika
37ef0a9b8d Fix the text scrollers, and make the scroller code smaller to boot. 2013-03-11 00:22:01 -04:00
Nebuleon Fumika
936cb38b5e Center text without needing endless spaces; also support \n in centered text.
* Text positioning in message boxes is now controlled by #defines.
* The various MSG_PLAY_SLIDE<n> messages are now one, MSG_SCREENSHOT_SLIDESHOW_KEYS, with \n between lines.
* Use \n in some more message pairs.
* Lengthy scrollers broke. This will be investigated in a later commit.
2013-03-10 21:21:37 -04:00
Nebuleon Fumika
47a63742d7 Modified the SNES file icon not to resemble a generic controller anymore. 2013-03-07 22:10:02 -05:00
Nebuleon Fumika
1e1837c55f Add credits for language files. 2013-03-07 19:53:17 -05:00
Nebuleon Fumika
964ce2a58d Brazilian Portuguese adjustment: Frequencia da CPU -> Frequência da CPU. 2013-03-03 15:51:37 -05:00
Nebuleon Fumika
39fecc43bb Update the hotkeys preview. 2013-03-03 00:32:32 -05:00
Nebuleon Fumika
a519d9c93d Release 1.32. 2013-03-01 13:20:38 -05:00
Nebuleon Fumika
d8d2dcc959 Remove unneeded variables in draw.c. 2013-02-27 19:07:48 -05:00
Nebuleon Fumika
49cc257e8d Remove unneeded functions in draw.c. 2013-02-27 19:01:09 -05:00
Nebuleon Fumika
1c0260ecfa Define u8, s8, u16, s16, u32, s32, u64, s64 as typedefs. Ported from a test repository. 2013-02-24 18:02:55 -05:00
Nebuleon Fumika
339cdb4828 Maybe Settings.FixFrequency is what's causing the emulated SNES to be slower than a real SNES? It does an adjustment of 15/1000, after all... 2013-02-22 02:41:50 -05:00
BassAceGold
10ed45ad76 Use the CATSFC directory in the root of the storage card if a SYSTEM/GUI directory is not found in the system folder provided by plugin arguments. 2013-02-20 14:53:13 -05:00
Nebuleon Fumika
edda8744ad Start option text more to the left to fit more text in a line. Widen cheat descriptions and file names in selectors, to the left AND to the right, to make the interface consistent again (and for practical purposes). 2013-02-19 23:33:43 -05:00
Aeter
e46e351594 Dutch adjustments. Most things are shortened and aligned. 2013-02-19 18:02:35 -05:00
Diego Liberal
82c9daff5e Brazilian Portuguese adjustments.
* Frame skipping is now translated.
* Some accents were missing over "vídeo" and "áudio".
* Version information uses a better phrase.
2013-02-15 14:56:45 -05:00
Nebuleon Fumika
c2262c74c5 Release 1.31. 2013-02-14 16:36:21 -05:00
Nebuleon Fumika
52b11e6c1c Adjust hotkeys to allow using the directional pad for them. Suggested usage is L+Up, R+Up, etc. 2013-02-14 16:24:42 -05:00
Nebuleon Fumika
11c08d9d8f German adjustments, honoring GBAtemp user Charli (github: seesawCharli)'s notes on commit ea8ff33951.
Since then, pictograms for directions have been implemented and I settled on 2 spaces of spacing between a key and its description in the screenshot slideshow window.
2013-02-14 15:56:02 -05:00
Nebuleon Fumika
7dd9763658 Brazilian Portuguese adjustments.
* Align text in columns for options.
* Fix a spelling mistake, "relaizar".
* Consistency with other languages.
* Reorder the hotkey options, which I pasted in incorrectly.
2013-02-14 15:50:37 -05:00
Diego Liberal
e156b47503 Add a Brazilian Portuguese localisation. 2013-02-14 15:28:38 -05:00
Nebuleon Fumika
03e8e8863a Italian adjustments.
* Align some messages in columns.
* Make Attiva/Disattiva into (Dis)attiva to reduce the length of the fullscreen hotkey option.
* Remove "dalla card" (from the card) from "seleziona gioco" and make the title "nuovo gioco" for consistency.
* Use key pictograms in the screenshot slideshow.
2013-02-14 04:18:09 -05:00
Nebuleon Fumika
a1b2ff6e87 Merge pull request #35 from alexinfurs/master
Add an Italian translation
2013-02-14 04:05:35 -05:00
Alessandro Pelliccia
5a8a513b66 Update CATSFC/system/language.msg 2013-02-14 09:46:18 +01:00
Alessandro Pelliccia
2dcd76bced Update CATSFC/system/language.msg 2013-02-14 09:44:59 +01:00
Nebuleon Fumika
a8c2fcdb2c Add hotkeys to quickly load from and save to saved state #1, as well as to toggle full-screen (going from mode 3, middle of screen, to mode 4, full-screen smoothed).
This commit uses text that has not been validated in some languages.
2013-02-14 03:02:33 -05:00
Alessandro Pelliccia
5e10564ce0 Update source/nds/gui.c
Add Italian language
2013-02-13 21:21:08 +01:00
Alessandro Pelliccia
e7dfd96445 Update source/nds/message.h
Add Italian language
2013-02-13 21:13:29 +01:00
Alessandro Pelliccia
9b95e3c26b Update CATSFC/system/language.msg
Add an Italian translation
2013-02-13 21:10:40 +01:00
Nebuleon Fumika
6794af6695 Reimplement grouped multipart cheat codes on top of Snes9x's cheat data. 2013-02-12 00:06:39 -05:00
Nebuleon Fumika
7a2bde06a1 Language file adjustments and arrows for direction keys (*u, *d, *l, *r).
* All languages except Chinese: Remove redundancy in the New game menu. Remove "from the card".
* All languages except German and Chinese: Remove "games" in "recently played games". It's implied by the rest of the menu.
* Spanish: menu should be menú.
* All languages: modify keys in the screenshot slideshow message so that direction keys are arrows.
* Tools/Screenshots, English, French, Spanish: Stop implying that you can browse the screenshots; instead imply that it's a slideshow you control only sequentially.
* Dutch: Try to shorten "Ga terug naar het spel" so it can fit in a button, by removing the "Ga". It still splits.
2013-02-11 18:27:49 -05:00
Nebuleon Fumika
2332157879 Release 1.30. 2013-02-10 14:28:59 -05:00
Nebuleon Fumika
16a41b40b8 A type mismatch in sound channel data messed up the sound after loading a saved state in certain games. int (32 bit) is now short (16 bit). 2013-02-10 00:12:41 -05:00
Nebuleon Fumika
18e56b68fd Add retro sound as a setting in all languages except Chinese. 2013-02-09 23:41:06 -05:00
jomaper
6e2e64109d Update CATSFC/system/language.msg (Spanish block)
Hice unos cambios pequeños, nada importante, más que nada cosméticos.

I did small changes, no big deal, cosmetic stuff more than anything
2013-02-09 22:01:58 -05:00
Nebuleon Fumika
5f3a27e9e0 Merge branch '8bitsound' 2013-02-09 20:08:38 -05:00
Nebuleon Fumika
e2eeb6bf85 Release 1.29. 2013-02-08 21:47:06 -05:00
Nebuleon Fumika
cb12547b85 Merge branch 'master' into 8bitsound 2013-02-08 19:58:41 -05:00
Nebuleon Fumika
1fa4d336cf Merge pull request #32 from boriar/patch-1
Update CATSFC/system/language.msg (Spanish block)
2013-02-08 19:56:03 -05:00
boriar
be3128ddd2 Update CATSFC/system/language.msg 2013-02-09 01:06:25 +01:00
Nebuleon Fumika
ef12da18df Merge branch 'master' into 8bitsound 2013-02-08 17:47:20 -05:00
Boriar
267da6d5e1 Add a Spanish translation. 2013-02-08 17:04:32 -05:00
Aeter
fa19e1551a Add a Dutch translation. 2013-02-08 16:52:31 -05:00
Nebuleon Fumika
9ef4103ea5 Add two more half-wave types to try to correct the pitch of notes that are one octave too high. 2013-02-08 16:08:48 -05:00
Nebuleon Fumika
3834297fae Fix write to uninitialised memory in 8-bit sound. 2013-02-08 15:46:33 -05:00
Nebuleon Fumika
0a2041d1ce Add square waves for waves not matching sines or triangles. Add noise for drums exceeding a certain "randomness" threshold. For now that's defined as total variance from a sample to its neighbo(u)r in a block of 16 samples. 2013-02-08 05:50:37 -05:00
Nebuleon Fumika
927d456306 Merge branch 'master' into 8bitsound
Conflicts:
	source/nds/entry.cpp
2013-02-08 05:50:22 -05:00
Nebuleon Fumika
d4fcf2697c Require one audio buffer to be free again. Otherwise, if the 4 buffers get full, it's already game over, and getAudiobuff becomes NULL for about 400 milliseconds, stopping all emulation. 2013-02-08 03:22:27 -05:00
Nebuleon Fumika
4676a520e1 Synchronise fractions of a hertz correctly in the audio output timing code to avoid buffer overruns. Buffer overruns pause the game for about half a second. 2013-02-07 22:27:44 -05:00
Nebuleon Fumika
703d522c4c Remove remnants of a failed auto-CPU implementation. Changing CPU speeds on-the-fly is just not stable on the DSTwo. 2013-02-07 20:08:44 -05:00
Nebuleon Fumika
5680258a6a Stop inlining the regular tile drawing code. That was a micro-optimisation, and this revert brings the code a bit closer to mainline Snes9x. 2013-02-07 18:47:15 -05:00
Nebuleon Fumika
635c878905 Allow the user to be pressing a button when the emulator starts. This allows the Loading screen to disappear, and allows invoking New Game straight away. 2013-02-07 17:58:37 -05:00
Nebuleon Fumika
07b9c9e8c1 README.md: Add more recent information about frame skipping and fluidity. 2013-02-07 17:33:04 -05:00
SignZ
ea8ff33951 EN: Added a German translation. DE: Deutsche Übersetzung hinzugefügt. 2013-02-07 04:56:34 -05:00
Nebuleon Fumika
55895f01f7 De-interleave the ROM using DMA. This helps the more esoteric jumbo memory maps load faster. 2013-02-07 02:38:45 -05:00
Nebuleon Fumika
5e3426d0d2 Remove 320 KiB of memory allocations in APU emulation that were completely unused but constantly re-zeroed.
Frees up 320 KiB for other uses, and saves ~4 milliseconds at emulator startup, when resetting the APU and when loading a new game.
2013-02-06 19:07:39 -05:00
Nebuleon Fumika
90de0280db gui.c: Require all keys to be released after the B, A or X button or the Touch Screen is pressed.
This avoids bringing up, or exiting from, multiple menus if you happen to press something for longer than 1/5 second.

The modification does not apply to the directional pad in all menus, or the L and R buttons in file selectors.
2013-02-06 16:24:09 -05:00
Nebuleon Fumika
0b165c3133 Use key pictograms from Pictochat to display keys for yes/no dialog(ue)s. 2013-02-06 16:16:43 -05:00
Nebuleon Fumika
ebf48b1bf7 Yeah... Despite the audio optimisations, sound still crackles with display double-buffering. Disable that, again. 2013-02-06 15:51:23 -05:00
Nebuleon Fumika
04037a3096 When changing languages, quit doing the "Changing language, please wait..." as it only takes a few milliseconds. 2013-02-06 06:27:11 -05:00
Nebuleon Fumika
3dc6668107 Raise the sound frequency from 22050 Hz to 32000 Hz, which is like the SNES. Use sound interpolation to make it sound even more like the SNES. 2013-02-06 05:59:22 -05:00
Nebuleon Fumika
3c3a97219d Fix 2 compiler warnings in gui.c. 2013-02-06 04:57:12 -05:00
Nebuleon Fumika
b277570dae Quit saving the files so often for nothing; that uses up erase cycles on storage cards! Instead, save them once when the menu that contains the settings that the user changed is exited, IF the settings' values changed, OR once when updating the list of most-recently played games.
Automatically save the SRAM in most cases, including game changes.

This commit also makes it unnecessary to save the game config of the previous game when loading another, makes it load certain settings correctly, and MAY make it avoid creating a file for a game's settings if the user never changes them from the defaults.
2013-02-06 04:38:18 -05:00
Nebuleon Fumika
772e24ae50 Reinstate frame skipping options 0 and 1, but keep the new meaning (>= 2 equivalent skip level) for automatic frame skipping. Remove the automatic CPU frequency option, which was making audio emit 0.25 second of silence every so often. 2013-02-06 03:46:48 -05:00
Nebuleon Fumika
b08a201ea2 Allow all audio buffers to get full again before declaring underflow. 2013-02-06 02:53:53 -05:00
Nebuleon Fumika
9829c83608 Fix the loading screen for a ROM appearing for a split second after the splash screen.
Fix uninitialised memory access in Check_LoadArg.
2013-02-06 02:31:55 -05:00
Nebuleon Fumika
a358ef69a8 Make all gamepak loads call LoadGameAndItsData, that way its "Loading" screen, current gamepak variables, game config stuff and so on are all consistent. 2013-02-06 02:18:35 -05:00
BassAceGold
ea330e8f79 Fix settings not getting loaded with a ROM provided by plugin arguments. 2013-02-06 02:05:03 -05:00
BassAceGold
4ac61d443d Load the game from plug-in launch arguments. Make the CATSFC system directory become the one transferred via arguments in that case. 2013-02-06 00:56:33 -05:00
Nebuleon Fumika
8c5f5ba182 Document the auto CPU behavior a bit. 2013-02-06 00:43:21 -05:00
Nebuleon Fumika
9e87a7a2b2 Implement automatic CPU frequency switching, which improves battery life if playing games that don't use all of the MIPS CPU. If all of it is indeed needed, then the game will constantly play at 396 MHz. 2013-02-06 00:34:01 -05:00
Nebuleon Fumika
f2adea7bb2 Force both manual and automatic frameskipping to be at or above 2. Resets the default value for all games which previously had this value configured. 2013-02-05 19:39:09 -05:00
Nebuleon Fumika
e7ac6f675f Disable the free space line in the options for the time being. Currently it invokes a recursive directory scan to calculate how much space is used first. 2013-02-05 16:35:45 -05:00
Nebuleon Fumika
3cd1e03278 Change the upper screen updates to be double-buffered. Require that one audio buffer be free (1 out of 4). 2013-02-05 16:05:16 -05:00
Nebuleon Fumika
dfa2d3cc68 Add include files from BassAceGold's library, release 2 fix 2.2. 2013-02-05 01:33:39 -05:00
Nebuleon Fumika
d1a7bf5eb5 Fully integrate BassAceGold's libraries, finally. The README still states that 1.2 is required to overwrite 0.13's stuff; really, 0.13 is needed only for gcc. So the sequence goes 0.13's gcc -> 1.2 -> BassAceGold's libraries -> make libds2a.a.
DMA function names changed to match BassAceGold's.
2013-02-04 23:45:44 -05:00
Nebuleon Fumika
b1c298ab50 Merge pull request #30 from derpking/patch-1
Update source/dsp1.cpp
2013-02-04 15:06:39 -05:00
derpking
cb610fd0c2 Update source/dsp1.cpp
static const uint16	DSP1ROM[1024]
snes9x 1.53 updated the dummy loops
2013-02-03 21:44:15 -08:00
Nebuleon Fumika
433749b6ef Merge branch 'master' into 8bitsound 2013-01-23 20:16:46 -05:00
Nebuleon Fumika
40596a7d68 Triangle wave ALL the channels! 2013-01-21 22:35:21 -05:00
Nebuleon Fumika
7d788578b2 Initial 8-bit sound commit. For the lulz! 2013-01-20 22:26:24 -05:00
147 changed files with 5242 additions and 3074 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB

View file

@ -0,0 +1,6 @@
Background: #000000
InactiveItem: #461F99
ActiveItem: #FFFFFF
MessageText: #461F99
InactiveMain: #FFFFFF
ActiveMain: #FFFFFF

File diff suppressed because it is too large Load diff

View file

@ -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
View file

@ -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
View file

0
sdk-modifications/include/bit_ops.h Normal file → Executable file
View file

0
sdk-modifications/include/console.h Normal file → Executable file
View file

0
sdk-modifications/include/directory.h Normal file → Executable file
View file

0
sdk-modifications/include/ds2_cpu.h Normal file → Executable file
View file

View 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
}

View file

@ -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
View file

0
sdk-modifications/include/ds2_fcntl.h Normal file → Executable file
View file

0
sdk-modifications/include/ds2_malloc.h Normal file → Executable file
View file

0
sdk-modifications/include/ds2_mmc_api.h Normal file → Executable file
View file

0
sdk-modifications/include/ds2_timer.h Normal file → Executable file
View file

40
sdk-modifications/include/ds2_types.h Normal file → Executable file
View 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
View 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
View file

0
sdk-modifications/include/fatdir.h Normal file → Executable file
View file

0
sdk-modifications/include/fatdir_ex.h Normal file → Executable file
View file

0
sdk-modifications/include/fatfile.h Normal file → Executable file
View file

0
sdk-modifications/include/fatfile_ex.h Normal file → Executable file
View file

0
sdk-modifications/include/file_allocation_table.h Normal file → Executable file
View file

0
sdk-modifications/include/filetime.h Normal file → Executable file
View file

0
sdk-modifications/include/fs_api.h Normal file → Executable file
View file

0
sdk-modifications/include/fs_cache.h Normal file → Executable file
View file

103
sdk-modifications/include/fs_common.h Normal file → Executable file
View 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
View file

0
sdk-modifications/include/mem_allocate.h Normal file → Executable file
View file

0
sdk-modifications/include/mips.h Normal file → Executable file
View file

0
sdk-modifications/include/mipsregs.h Normal file → Executable file
View file

0
sdk-modifications/include/mmc_api.h Normal file → Executable file
View file

0
sdk-modifications/include/partition.h Normal file → Executable file
View file

0
sdk-modifications/include/tcm.h Normal file → Executable file
View file

View 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))))

View 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
View file

0
sdk-modifications/libsrc/console/console.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/console/console.mk Normal file → Executable file
View file

0
sdk-modifications/libsrc/console/font_dot.h Normal file → Executable file
View file

View file

@ -0,0 +1,11 @@
#fs.mk
SRC += $(CORE_DIR)/ds2_dma.c \
$(CORE_DIR)/ds2_cpuclock.c
SSRC +=
INC += -I$(CORE_DIR)
CFLAGS +=

View 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;
}

View 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__

View 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;
}

View 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__

View file

@ -1,9 +0,0 @@
#dma.mk
SRC += $(DMA_DIR)/dmacopy.c
SSRC +=
INC += -I$(DMA_DIR)
CFLAGS +=

View file

@ -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;
}

View file

@ -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
View file

0
sdk-modifications/libsrc/fs/cache.c Normal file → Executable file
View file

38
sdk-modifications/libsrc/fs/directory.c Normal file → Executable file
View 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
View file

0
sdk-modifications/libsrc/fs/disc_io/disc.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/disc_io/disc.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/disc_io/disc_io.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/disc_io/io_ds2_mmcf.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/ds2_fcntl.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/ds2_fcntl.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/ds2_unistd.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/ds2_unistd.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fat.h Normal file → Executable file
View file

View 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
View file

0
sdk-modifications/libsrc/fs/fatdir.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fatdir_ex.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fatdir_ex.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fatfile.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fatfile.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fatfile_ex.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fatfile_ex.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/file_allocation_table.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/filetime.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/filetime.h Normal file → Executable file
View file

View 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
View file

0
sdk-modifications/libsrc/fs/fs_api.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/fs_cache.h Normal file → Executable file
View file

23
sdk-modifications/libsrc/fs/fs_common.h Normal file → Executable file
View 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
View file

0
sdk-modifications/libsrc/fs/fs_unicode.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/libfat.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/mem_allocate.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/partition.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/fs/partition.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/key/key.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/key/key.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/key/key.mk Normal file → Executable file
View file

View 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>.

0
sdk-modifications/libsrc/zlib/adler32.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/zlib/compress.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/zlib/crc32.c Normal file → Executable file
View file

0
sdk-modifications/libsrc/zlib/crc32.h Normal file → Executable file
View file

0
sdk-modifications/libsrc/zlib/deflate.c Normal file → Executable file
View file

Some files were not shown because too many files have changed in this diff Show more