Compare commits

...

58 commits
1.32 ... 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
20 changed files with 1868 additions and 1893 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

View file

@ -48,6 +48,10 @@ Tools
Options
#MSG_MAIN_MENU_EXIT
Exit
#MSG_FILE_MENU_LOADING_LIST
Loading...
#MSG_FILE_MENU_SORTING_LIST
Sorting...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Fluidity %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
@ -60,6 +64,8 @@ Aspect ratio %s
Fast-forward %s
#FMT_VIDEO_FRAME_SKIPPING
Frame skipping %s
#FMT_VIDEO_GAME_SCREEN
Game screen %s
#FMT_AUDIO_SOUND
Sound %s
#FMT_AUDIO_RETRO_SOUND
@ -164,6 +170,10 @@ New game
[9] Show 1 in 10 frames
#MSG_VIDEO_FRAME_SKIPPING_10
[10] Show 1 in 11 frames
#MSG_VIDEO_GAME_SCREEN_TOP
Upper Screen
#MSG_VIDEO_GAME_SCREEN_BOTTOM
Lower Screen
#MSG_GENERAL_OFF
Off
#MSG_GENERAL_ON
@ -220,17 +230,12 @@ No screenshots found
Playing...
#MSG_PAUSE_SLIDE
Pause...
#MSG_PLAY_SLIDE1
*u Speed up
#MSG_PLAY_SLIDE2
*d Slow down
#MSG_PLAY_SLIDE3
*l Previous image
#MSG_PLAY_SLIDE4
*r Next image
#MSG_PLAY_SLIDE5
*A Pause
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u Speed up\n
*d Slow down\n
*l Previous image\n
*r Next image\n
*A Pause\n
*B Return to the menu
#MSG_PROGRESS_LOADING_GAME
Loading...
@ -264,18 +269,24 @@ STARTCHINESESIM
综合设置
#MSG_MAIN_MENU_EXIT
退出模拟器
#MSG_FILE_MENU_LOADING_LIST
装载...
#MSG_FILE_MENU_SORTING_LIST
列表进行排序...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Fluidity %s
流畅度 %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
Prefer fluid video
视频优先
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_AUDIO
Prefer fluid audio
音频优先
#FMT_VIDEO_ASPECT_RATIO
画面 %s
#FMT_VIDEO_FAST_FORWARD
游戏快进 %s
#FMT_VIDEO_FRAME_SKIPPING
跳帧方式 %s
#FMT_VIDEO_GAME_SCREEN
游戏屏幕 %s
#FMT_AUDIO_SOUND
声音开关 %s
#FMT_AUDIO_RETRO_SOUND
@ -293,13 +304,13 @@ Retro sound %s
#MSG_TOOLS_SCREENSHOT_GENERAL
屏幕快照
#MSG_TOOLS_GLOBAL_HOTKEY_GENERAL
Global hotkeys...
全局热键
#MSG_TOOLS_GAME_HOTKEY_GENERAL
Game-specific hotkey overrides...
特定游戏热键
#FMT_OPTIONS_LANGUAGE
语言 %s
#FMT_OPTIONS_CPU_FREQUENCY
CPU主频 %s
CPU 主频 %s
#MSG_OPTIONS_CPU_FREQUENCY_0
[0] 240 MHz
#MSG_OPTIONS_CPU_FREQUENCY_1
@ -313,7 +324,7 @@ CPU主频 %s
#MSG_OPTIONS_CPU_FREQUENCY_5
[5] 396 MHz
#MSG_OPTIONS_CARD_CAPACITY
卡容量
容量
#MSG_OPTIONS_RESET
缺省设置
#MSG_OPTIONS_VERSION
@ -323,23 +334,23 @@ CPU主频 %s
#MSG_SCREENSHOT_BROWSE
浏览屏幕快照
#MSG_HOTKEY_MAIN_MENU
Go to main menu
返回主菜单
#MSG_HOTKEY_TEMPORARY_FAST_FORWARD
Temporary fast-forward
临时加速
#MSG_HOTKEY_SOUND_TOGGLE
Toggle sound
音频开关
#MSG_HOTKEY_QUICK_LOAD_STATE
Load saved state 1
读取即时存档 1
#MSG_HOTKEY_QUICK_SAVE_STATE
Create saved state 1
保存即时存档 1
#MSG_HOTKEY_FULL_SCREEN_TOGGLE
Toggle full-screen
全屏开关
#MSG_PROGRESS_HOTKEY_WAITING_FOR_KEYS
Press the buttons you wish to use to perform this action.
按下你想要设置的热键组合。
#MSG_HOTKEY_DELETE_WITH_A
*A Clear
*A 清除
#MSG_HOTKEY_CANCEL_WITH_B
*B Cancel
*B 取消
#MSG_LOAD_GAME_RECENTLY_PLAYED
最近玩过的游戏
#MSG_LOAD_GAME_FROM_CARD
@ -357,29 +368,33 @@ Press the buttons you wish to use to perform this action.
#MSG_VIDEO_ASPECT_RATIO_4
显示模式 4
#MSG_VIDEO_FRAME_SKIPPING_AUTOMATIC
[-] Keep up with the game
[-] 和游戏同步
#MSG_VIDEO_FRAME_SKIPPING_0
[0] Show all frames
[0] 不跳帧
#MSG_VIDEO_FRAME_SKIPPING_1
[1] Show 1 in 2 frames
[1] 显示 1/2
#MSG_VIDEO_FRAME_SKIPPING_2
[2] Show 1 in 3 frames
[2] 显示 1/3
#MSG_VIDEO_FRAME_SKIPPING_3
[3] Show 1 in 4 frames
[3] 显示 1/4
#MSG_VIDEO_FRAME_SKIPPING_4
[4] Show 1 in 5 frames
[4] 显示 1/5
#MSG_VIDEO_FRAME_SKIPPING_5
[5] Show 1 in 6 frames
[5] 显示 1/6
#MSG_VIDEO_FRAME_SKIPPING_6
[6] Show 1 in 7 frames
[6] 显示 1/7
#MSG_VIDEO_FRAME_SKIPPING_7
[7] Show 1 in 8 frames
[7] 显示 1/8
#MSG_VIDEO_FRAME_SKIPPING_8
[8] Show 1 in 9 frames
[8] 显示 1/9
#MSG_VIDEO_FRAME_SKIPPING_9
[9] Show 1 in 10 frames
[9] 显示 1/10
#MSG_VIDEO_FRAME_SKIPPING_10
[10] Show 1 in 11 frames
[10] 显示 1/11
#MSG_VIDEO_GAME_SCREEN_TOP
上屏
#MSG_VIDEO_GAME_SCREEN_BOTTOM
下屏
#MSG_GENERAL_OFF
#MSG_GENERAL_ON
@ -397,23 +412,23 @@ Press the buttons you wish to use to perform this action.
#MSG_CHEAT_ELEMENT_NOT_LOADED
<没有加载>
#MSG_SAVESTATE_FULL
当前存档槽已有存档文件,覆盖有存档吗?
当前存档槽已有存档文件,覆盖有存档吗?
#MSG_PROGRESS_SAVED_STATE_CREATING
正在写入...
#MSG_PROGRESS_SAVED_STATE_CREATION_FAILED
写入存档失败!
存档写入失败!
#MSG_PROGRESS_SAVED_STATE_CREATION_SUCCEEDED
写入存档成功!
存档写入成功!
#MSG_TOP_SCREEN_NO_SAVED_STATE_IN_SLOT
没有游戏截图
#MSG_PROGRESS_SAVED_STATE_CORRUPTED
存档文件找不到或者损坏!
存档文件不存在或者已损坏!
#MSG_PROGRESS_SAVED_STATE_LOADING
正在加载...
#MSG_PROGRESS_SAVED_STATE_LOAD_FAILED
加载存档失败
存档加载失败
#MSG_PROGRESS_SAVED_STATE_LOAD_SUCCEEDED
加载存档成功
存档加载成功
#MSG_SAVED_STATE_DELETE_ALL
删除当前游戏的所有存档
#FMT_SAVED_STATE_DELETE_ONE
@ -436,26 +451,21 @@ Press the buttons you wish to use to perform this action.
正在播放
#MSG_PAUSE_SLIDE
已暂停
#MSG_PLAY_SLIDE1
*u 加快播放
#MSG_PLAY_SLIDE2
*d 减慢播放
#MSG_PLAY_SLIDE3
*l 上一帧
#MSG_PLAY_SLIDE4
*r 下一帧
#MSG_PLAY_SLIDE5
*A 暂停
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u 加快播放\n
*d 减慢播放\n
*l 上一帧 \n
*r 下一帧 \n
*A 暂停 \n
*B 返回菜单
#MSG_PROGRESS_LOADING_GAME
正在装载游戏...
#MSG_EMULATOR_NAME
SFC模拟器
SFC 模拟器
#MSG_WORD_EMULATOR_VERSION
版本
#MSG_DIALOG_RESET
确定将 SFC模拟器恢复为出厂设置吗?
确定将 SFC 模拟器恢复为出厂设置吗?
#MSG_PROGRESS_RESETTING
正在设置,请稍候...
@ -480,6 +490,10 @@ Outils
Options
#MSG_MAIN_MENU_EXIT
Quitter
#MSG_FILE_MENU_LOADING_LIST
Chargement...
#MSG_FILE_MENU_SORTING_LIST
Tri...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Fluidité %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
@ -492,6 +506,8 @@ Format d'image %s
Avance rapide %s
#FMT_VIDEO_FRAME_SKIPPING
Omission d'images %s
#FMT_VIDEO_GAME_SCREEN
Écran de jeu %s
#FMT_AUDIO_SOUND
Son %s
#FMT_AUDIO_RETRO_SOUND
@ -596,6 +612,10 @@ Nouveau jeu
[9] Montrer 1 image sur 10
#MSG_VIDEO_FRAME_SKIPPING_10
[10] Montrer 1 image sur 11
#MSG_VIDEO_GAME_SCREEN_TOP
Écran supérieur
#MSG_VIDEO_GAME_SCREEN_BOTTOM
Écran inférieur
#MSG_GENERAL_OFF
Hors fonction
#MSG_GENERAL_ON
@ -652,17 +672,12 @@ Aucune capture d'écran trouvée
En cours...
#MSG_PAUSE_SLIDE
Pause...
#MSG_PLAY_SLIDE1
*u Accélérer
#MSG_PLAY_SLIDE2
*d Ralentir
#MSG_PLAY_SLIDE3
*l Précédente
#MSG_PLAY_SLIDE4
*r Suivante
#MSG_PLAY_SLIDE5
*A Pause
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u Accélérer\n
*d Ralentir\n
*l Précédente\n
*r Suivante\n
*A Pause\n
*B Retour au menu
#MSG_PROGRESS_LOADING_GAME
Chargement...
@ -697,6 +712,10 @@ Tools
Optionen
#MSG_MAIN_MENU_EXIT
Beenden
#MSG_FILE_MENU_LOADING_LIST
Laden...
#MSG_FILE_MENU_SORTING_LIST
Sortieren...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Flüssigkeit %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
@ -709,6 +728,8 @@ Bildformat %s
Schnellvorlauf %s
#FMT_VIDEO_FRAME_SKIPPING
Frames übersp. %s
#FMT_VIDEO_GAME_SCREEN
Bildschirm %s
#FMT_AUDIO_SOUND
Ton %s
#FMT_AUDIO_RETRO_SOUND
@ -813,6 +834,10 @@ Neues Spiel
[9] Zeige 1 von 10 Frames
#MSG_VIDEO_FRAME_SKIPPING_10
[10] Zeige 1 von 11 Frames
#MSG_VIDEO_GAME_SCREEN_TOP
Oberer Bildschirm
#MSG_VIDEO_GAME_SCREEN_BOTTOM
Unterer Bildschirm
#MSG_GENERAL_OFF
Aus
#MSG_GENERAL_ON
@ -869,17 +894,12 @@ Keine Screenshots gefunden
Zeigen...
#MSG_PAUSE_SLIDE
Pause...
#MSG_PLAY_SLIDE1
*u Geschw. hoch
#MSG_PLAY_SLIDE2
*d Geschw. runter
#MSG_PLAY_SLIDE3
*l Voriges Bild
#MSG_PLAY_SLIDE4
*r Nächstes Bild
#MSG_PLAY_SLIDE5
*A Pause
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u Geschw. hoch\n
*d Geschw. runter\n
*l Voriges Bild\n
*r Nächstes Bild\n
*A Pause\n
*B Zurück zum Menü
#MSG_PROGRESS_LOADING_GAME
Laden...
@ -914,6 +934,10 @@ Hulpmiddelen
Opties
#MSG_MAIN_MENU_EXIT
Afsluiten
#MSG_FILE_MENU_LOADING_LIST
Laden...
#MSG_FILE_MENU_SORTING_LIST
Sorteren...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Fluïditeit %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
@ -926,6 +950,8 @@ Beeldverhouding %s
Vooruitspoelen %s
#FMT_VIDEO_FRAME_SKIPPING
Beeld overslaan %s
#FMT_VIDEO_GAME_SCREEN
Spelscherm %s
#FMT_AUDIO_SOUND
Geluid %s
#FMT_AUDIO_RETRO_SOUND
@ -965,7 +991,7 @@ CPU frequentie %s
#MSG_OPTIONS_CARD_CAPACITY
Kaartcapaciteit
#MSG_OPTIONS_RESET
Herstel standaard instellingen
Herstel standaardinstellingen
#MSG_OPTIONS_VERSION
Versie-informatie
#MSG_SCREENSHOT_CREATE
@ -985,7 +1011,7 @@ Sla spelstaat 1 op
#MSG_HOTKEY_FULL_SCREEN_TOGGLE
Schakel naar volledig scherm
#MSG_PROGRESS_HOTKEY_WAITING_FOR_KEYS
Druk op de gewenste knoppencombinatie.
Druk op de gewenste toetsencombinatie.
#MSG_HOTKEY_DELETE_WITH_A
*A Wissen
#MSG_HOTKEY_CANCEL_WITH_B
@ -1030,6 +1056,10 @@ Nieuw spel
[9] 1 uit 10 beelden tonen
#MSG_VIDEO_FRAME_SKIPPING_10
[10] 1 uit 11 beelden tonen
#MSG_VIDEO_GAME_SCREEN_TOP
Bovenste scherm
#MSG_VIDEO_GAME_SCREEN_BOTTOM
Onderste scherm
#MSG_GENERAL_OFF
Uit
#MSG_GENERAL_ON
@ -1057,7 +1087,7 @@ Opslaan geslaagd!
#MSG_TOP_SCREEN_NO_SAVED_STATE_IN_SLOT
Geen spelstaat in slot.
#MSG_PROGRESS_SAVED_STATE_CORRUPTED
State niet gevonden of corrupt.
Staat niet gevonden of corrupt.
#MSG_PROGRESS_SAVED_STATE_LOADING
Laden...
#MSG_PROGRESS_SAVED_STATE_LOAD_FAILED
@ -1086,17 +1116,12 @@ Geen beeldschermafdrukken gevonden.
Aan het afspelen...
#MSG_PAUSE_SLIDE
Pauzeren...
#MSG_PLAY_SLIDE1
*u Sneller
#MSG_PLAY_SLIDE2
*d Langzamer
#MSG_PLAY_SLIDE3
*l Vorige afbeelding
#MSG_PLAY_SLIDE4
*r Volgende afbeelding
#MSG_PLAY_SLIDE5
*A Pauzeren
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u Sneller\n
*d Langzamer\n
*l Vorige afbeelding\n
*r Volgende afbeelding\n
*A Pauzeren\n
*B Terug naar het menu
#MSG_PROGRESS_LOADING_GAME
Laden...
@ -1105,7 +1130,7 @@ CATSFC SNES emulator
#MSG_WORD_EMULATOR_VERSION
Versie
#MSG_DIALOG_RESET
Alle standaard instellingen herstellen?
Alle standaardinstellingen herstellen?
#MSG_PROGRESS_RESETTING
Even geduld A.U.B.
@ -1131,6 +1156,10 @@ Herramientas
Opciones
#MSG_MAIN_MENU_EXIT
Salir
#MSG_FILE_MENU_LOADING_LIST
Cargando...
#MSG_FILE_MENU_SORTING_LIST
Ordenando...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Fluidez %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
@ -1143,6 +1172,8 @@ Modo de pantalla %s
Modo avance rápido %s
#FMT_VIDEO_FRAME_SKIPPING
Salto de fotogramas %s
#FMT_VIDEO_GAME_SCREEN
Pantalla de juego %s
#FMT_AUDIO_SOUND
Sonido %s
#FMT_AUDIO_RETRO_SOUND
@ -1162,7 +1193,7 @@ Capturas de pantalla...
#MSG_TOOLS_GLOBAL_HOTKEY_GENERAL
Teclas de atajo globales...
#MSG_TOOLS_GAME_HOTKEY_GENERAL
Teclas de atajo en juego...
Teclas de atajo para el juego...
#FMT_OPTIONS_LANGUAGE
Idioma %s
#FMT_OPTIONS_CPU_FREQUENCY
@ -1247,6 +1278,10 @@ Nuevo juego
[9] Mostrar 1/10
#MSG_VIDEO_FRAME_SKIPPING_10
[10] Mostrar 1/11
#MSG_VIDEO_GAME_SCREEN_TOP
Pantalla superior
#MSG_VIDEO_GAME_SCREEN_BOTTOM
Pantalla inferior
#MSG_GENERAL_OFF
Apagado
#MSG_GENERAL_ON
@ -1264,7 +1299,7 @@ No hay juego cargado
#MSG_CHEAT_ELEMENT_NOT_LOADED
<Vacío>
#MSG_SAVESTATE_FULL
Posición actual en uso. ¿Sobreescribirla?
Posición actual en uso. ¿Sobreescribirla?
#MSG_PROGRESS_SAVED_STATE_CREATING
Salvando la partida...
#MSG_PROGRESS_SAVED_STATE_CREATION_FAILED
@ -1303,17 +1338,12 @@ Salvando la captura...
Ejecutando...
#MSG_PAUSE_SLIDE
Pausa...
#MSG_PLAY_SLIDE1
*u Velocidad +
#MSG_PLAY_SLIDE2
*d Velocidad -
#MSG_PLAY_SLIDE3
*l Anterior
#MSG_PLAY_SLIDE4
*r Siguiente
#MSG_PLAY_SLIDE5
*A Pausa
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u Velocidad +\n
*d Velocidad -\n
*l Anterior\n
*r Siguiente\n
*A Pausa\n
*B Volver al menú
#MSG_PROGRESS_LOADING_GAME
Cargando el juego...
@ -1347,6 +1377,10 @@ Strumenti
Opzioni
#MSG_MAIN_MENU_EXIT
Uscita
#MSG_FILE_MENU_LOADING_LIST
Caricando...
#MSG_FILE_MENU_SORTING_LIST
Ordinamento...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Fluidità %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
@ -1359,6 +1393,8 @@ Modalità video %s
Avanzamento rapido %s
#FMT_VIDEO_FRAME_SKIPPING
Salto fotogrammi %s
#FMT_VIDEO_GAME_SCREEN
Game screen %s
#FMT_AUDIO_SOUND
Audio %s
#FMT_AUDIO_RETRO_SOUND
@ -1463,6 +1499,10 @@ Nuovo gioco
[9] Mostra 1 su 10 fotogrammi
#MSG_VIDEO_FRAME_SKIPPING_10
[10] Mostra 1 su 11 fotogrammi
#MSG_VIDEO_GAME_SCREEN_TOP
Upper Screen
#MSG_VIDEO_GAME_SCREEN_BOTTOM
Lower Screen
#MSG_GENERAL_OFF
Disabilita
#MSG_GENERAL_ON
@ -1519,17 +1559,12 @@ Nessuna schermata trovata
In Esecuzione...
#MSG_PAUSE_SLIDE
Pausa...
#MSG_PLAY_SLIDE1
*u Aumenta velocità
#MSG_PLAY_SLIDE2
*d Diminuisci velocità
#MSG_PLAY_SLIDE3
*l Ultima immagine
#MSG_PLAY_SLIDE4
*r Prossima immagine
#MSG_PLAY_SLIDE5
*A Pausa
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u Aumenta velocità\n
*d Diminuisci velocità\n
*l Ultima immagine\n
*r Prossima immagine\n
*A Pausa\n
*B Ritorna al menù principale
#MSG_PROGRESS_LOADING_GAME
Caricando...
@ -1563,6 +1598,10 @@ Ferramentas
Opções
#MSG_MAIN_MENU_EXIT
Sair
#MSG_FILE_MENU_LOADING_LIST
Carregando...
#MSG_FILE_MENU_SORTING_LIST
Classificando...
#FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE
Fluidez %s
#MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO
@ -1575,6 +1614,8 @@ Proporção %s
Avanço de quadro %s
#FMT_VIDEO_FRAME_SKIPPING
Pulo de quadros %s
#FMT_VIDEO_GAME_SCREEN
Tela de jogo %s
#FMT_AUDIO_SOUND
Som %s
#FMT_AUDIO_RETRO_SOUND
@ -1592,13 +1633,13 @@ Carregar arquivo de trapaça
#MSG_TOOLS_SCREENSHOT_GENERAL
Foto...
#MSG_TOOLS_GLOBAL_HOTKEY_GENERAL
Atalhos de tecla globais...
Atalhos de botões globais...
#MSG_TOOLS_GAME_HOTKEY_GENERAL
Atalhos de tecla do jogo atual...
Atalhos de botões do jogo atual...
#FMT_OPTIONS_LANGUAGE
Idioma %s
#FMT_OPTIONS_CPU_FREQUENCY
Frequencia da CPU %s
Frequência da CPU %s
#MSG_OPTIONS_CPU_FREQUENCY_0
[0] 240 MHz
#MSG_OPTIONS_CPU_FREQUENCY_1
@ -1612,9 +1653,9 @@ Frequencia da CPU %s
#MSG_OPTIONS_CPU_FREQUENCY_5
[5] 396 MHz
#MSG_OPTIONS_CARD_CAPACITY
Capacidade do SD
Capacidade do cartão SD
#MSG_OPTIONS_RESET
Restaurar configurações padrão
Restaurar configuração padrão
#MSG_OPTIONS_VERSION
Informações desta versão
#MSG_SCREENSHOT_CREATE
@ -1654,7 +1695,7 @@ Novo jogo
#MSG_VIDEO_ASPECT_RATIO_3
[3] Meio, pixels exatos
#MSG_VIDEO_ASPECT_RATIO_4
[4] Toda a tela, alisado
[4] Toda a tela, suavizado
#MSG_VIDEO_FRAME_SKIPPING_AUTOMATIC
[-] Variar conforme o jogo
#MSG_VIDEO_FRAME_SKIPPING_0
@ -1679,6 +1720,10 @@ Novo jogo
[9] Mostrar 1 em 10 frames
#MSG_VIDEO_FRAME_SKIPPING_10
[10] Mostrar 1 em 11 frames
#MSG_VIDEO_GAME_SCREEN_TOP
Tela superior
#MSG_VIDEO_GAME_SCREEN_BOTTOM
Tela inferior
#MSG_GENERAL_OFF
Desligado
#MSG_GENERAL_ON
@ -1696,7 +1741,7 @@ Nenhum jogo carregado no momento
#MSG_CHEAT_ELEMENT_NOT_LOADED
<Nada carregado aqui>
#MSG_SAVESTATE_FULL
O slot atual contem um estado. Deseja sobrescrevê-lo?
O slot atual contém um estado. Deseja sobrescrevê-lo?
#MSG_PROGRESS_SAVED_STATE_CREATING
Salvando estado...
#MSG_PROGRESS_SAVED_STATE_CREATION_FAILED
@ -1706,7 +1751,7 @@ OK!
#MSG_TOP_SCREEN_NO_SAVED_STATE_IN_SLOT
Nenhum estado salvo aqui
#MSG_PROGRESS_SAVED_STATE_CORRUPTED
O arquivo de estado deste jogo não foi encontrado ou está corrupto.
O arquivo de estado deste jogo não foi encontrado ou está corrompido.
#MSG_PROGRESS_SAVED_STATE_LOADING
Carregando...
#MSG_PROGRESS_SAVED_STATE_LOAD_FAILED
@ -1714,7 +1759,7 @@ Falhou!
#MSG_PROGRESS_SAVED_STATE_LOAD_SUCCEEDED
OK!
#MSG_SAVED_STATE_DELETE_ALL
Delete todos os estads salvos
Delete todos os estados salvos
#FMT_SAVED_STATE_DELETE_ONE
Delete o estado salvo %d
#MSG_DIALOG_SAVE_STATE_DELETE_ALL
@ -1735,17 +1780,12 @@ Nenhuma foto encontrada
Executando...
#MSG_PAUSE_SLIDE
Pausar...
#MSG_PLAY_SLIDE1
*u Acelerar
#MSG_PLAY_SLIDE2
*d Desacelerar
#MSG_PLAY_SLIDE3
*l Foto anterior
#MSG_PLAY_SLIDE4
*r Proxima foto
#MSG_PLAY_SLIDE5
*A Pausar
#MSG_PLAY_SLIDE6
#MSG_SCREENSHOT_SLIDESHOW_KEYS
*u Acelerar\n
*d Desacelerar\n
*l Foto anterior\n
*r Próxima foto\n
*A Pausar\n
*B Voltar ao menu
#MSG_PROGRESS_LOADING_GAME
Carregando...

View file

@ -1,4 +1,4 @@
CATSFC version 1.32, 2013-03-01
CATSFC version 1.36, 2013-06-16
A Super Nintendo emulator for the Supercard DSTWO.
@ -9,6 +9,12 @@ Based on:
* BAGSFC, by BassAceGold (improving over NDSSFC)
* CATSFC, by ShadauxCat and Nebuleon (improving over BAGSFC)
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
(If you got the source code and want to compile it, see the `Compiling` section
@ -32,11 +38,6 @@ old format used in Mightymo's BSNES Cheat Code Pack.
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.

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;

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
{

Binary file not shown.

View file

@ -1022,14 +1022,14 @@ u32 BDF_cut_string(char *string, u32 width, u32 direction)
/*-----------------------------------------------------------------------------
- count UNICODE charactor numbers in width pixels
- direction 0: count UNICODE charactor numbers in width pixels, from front
- direction 1: count UNICODE charactor numbers in width pixels, from end
- direction 0: count UNICODE charactor numbers in width pixels, from end
- direction 1: count UNICODE charactor numbers in width pixels, from front
- direction 2: conut total pixel width of len UNICODE charachtors, from end
- direction 3: conut total pixel width of len UNICODE charachtors, from front
------------------------------------------------------------------------------*/
u32 BDF_cut_unicode(u16 *unicodes, u32 len, u32 width, u32 direction)
{
u32 i, xw, num;
u32 i, lastSpace = 0, xw, num;
u16 unicode;
u32 start, end;
struct bdffont *bdf_fontp[2];
@ -1049,14 +1049,19 @@ u32 BDF_cut_unicode(u16 *unicodes, u32 len, u32 width, u32 direction)
while(len > 0)
{
unicode= unicodes[i];
if (unicode == 0x0A)
return num - len;
else if (unicode == ' ')
lastSpace = len;
xw += BDF_width16_ucs(unicode);
if(xw >= width) break;
if(xw > width) return num - lastSpace;
i += direction;
len--;
}
num -= len;
return num - len;
}
else
{
@ -1073,9 +1078,9 @@ u32 BDF_cut_unicode(u16 *unicodes, u32 len, u32 width, u32 direction)
}
num= xw;
}
return num;
}
}

View file

@ -20,6 +20,7 @@
#include "fs_api.h"
#include "bitmap.h"
#include "ds2_malloc.h"
int BMP_read(char* filename, char *buf, unsigned int width, unsigned int height, unsigned int* type)
{
@ -59,16 +60,22 @@ int BMP_read(char* filename, char *buf, unsigned int width, unsigned int height,
bmp_header.bfImghead.imColnum= st[23] | (st[24]<<16);
bmp_header.bfImghead.imImcolnum= st[25] | (st[26]<<16);
if(bmp_header.bfType != 0x4D42) //"BM"
if(bmp_header.bfType != 0x4D42) { //"BM"
fclose(fp);
return BMP_ERR_FORMATE;
}
if(bmp_header.bfImghead.imCompess != BI_RGB &&
bmp_header.bfImghead.imCompess != BI_BITFIELDS)
bmp_header.bfImghead.imCompess != BI_BITFIELDS) {
fclose(fp);
return BMP_ERR_NEED_GO_ON; //This funciton now not support...
}
bytepixel= bmp_header.bfImghead.imBitpixel >> 3;
if(bytepixel < 2) //byte per pixel >= 2
if(bytepixel < 2) { //byte per pixel >= 2
fclose(fp);
return BMP_ERR_NEED_GO_ON; //This funciton now not support...
}
*type = bytepixel;
@ -81,16 +88,29 @@ int BMP_read(char* filename, char *buf, unsigned int width, unsigned int height,
if(y > sy)
y= sy;
//BMP scan from down to up
fpos= (s32)bmp_header.bfImgoffst;
dest= (unsigned char*)buf+(y-1)*x*bytepixel;
for(m= 0; m < y; m++) {
fseek(fp, fpos, SEEK_SET);
fread(dest, 1, x*bytepixel, fp);
fpos += ((sx*bytepixel+3)>>2)<<2;
dest -= x*bytepixel;
// Expect a certain amount of bytes and read them all at once.
unsigned int BytesPerLine = (sx * bytepixel + 3) & ~3;
char* FileBuffer = (char*) malloc(BytesPerLine * (sy - 1) + sx * bytepixel);
if (FileBuffer == NULL) {
fclose(fp);
return BMP_ERR_NEED_GO_ON; // Memory allocation error
}
fseek(fp, (s32) bmp_header.bfImgoffst, SEEK_SET);
m = fread(FileBuffer, 1, BytesPerLine * (sy - 1) + sx * bytepixel, fp);
if (m < BytesPerLine * (sy - 1) + sx * bytepixel) {
free(FileBuffer);
fclose(fp);
return BMP_ERR_FORMATE; // incomplete file
}
// Reorder all the bytes, because scanlines are from bottom to top.
for (m = 0; m < y; m++) {
memcpy(buf + m * x * bytepixel, FileBuffer + (sy - m - 1) * BytesPerLine, x * bytepixel);
}
free(FileBuffer);
fclose(fp);
return BMP_OK;

View file

@ -56,10 +56,10 @@ static uint16 SevenToSixScanlineResize (uint16 TopColour, uint16 BottomColour, u
;
}
void NDSSFCDrawFrameAntialiased ()
void NDSSFCDrawFrameAntialiased (void* screen_addr)
{
uint16 X, Y;
uint16 *SrcTop = (uint16 *) GFX.Screen, *SrcBottom = SrcTop + 256, *Dest = (uint16 *) up_screen_addr;
uint16 *SrcTop = (uint16 *) GFX.Screen, *SrcBottom = SrcTop + 256, *Dest = (uint16 *) screen_addr;
for (Y = 0; Y < 224; Y += 7)
{

View file

@ -106,6 +106,13 @@ struct gui_iconlist gui_icon_list[]= {
/* 34 */ {"sbutto", 76, 16, NULL}
};
u16 COLOR_BG = COLOR16( 0, 0, 0);
u16 COLOR_INACTIVE_ITEM = COLOR16( 0, 0, 0);
u16 COLOR_ACTIVE_ITEM = COLOR16(31, 31, 31);
u16 COLOR_MSSG = COLOR16( 0, 0, 0);
u16 COLOR_INACTIVE_MAIN = COLOR16(31, 31, 31);
u16 COLOR_ACTIVE_MAIN = COLOR16(31, 31, 31);
/*
* Drawing string aroud center
@ -298,7 +305,7 @@ void draw_message(void* screen_addr, u16 *screen_bg, u32 sx, u32 sy, u32 ex, u32
{
// drawbox(screen_addr, sx, sy, ex, ey, COLOR16(12, 12, 12));
// drawboxfill(screen_addr, sx+1, sy+1, ex-1, ey-1, color_fg);
show_icon(screen_addr, &ICON_MSG, 34, 48);
show_icon(screen_addr, &ICON_MSG, (NDS_SCREEN_WIDTH - ICON_MSG.x) / 2, (NDS_SCREEN_HEIGHT - ICON_MSG.y) / 2);
}
else
{
@ -344,29 +351,27 @@ void draw_string_vcenter(void* screen_addr, u32 sx, u32 sy, u32 width, u32 color
while(*string)
{
string= utf8decode(string, unicode+num);
if(unicode[num] != 0x0D && unicode[num] != 0x0A) num++;
num++;
}
if(num== 0) return;
i= BDF_cut_unicode(unicode, num, width, 1);
if(i == num)
{
x= BDF_cut_unicode(unicode, num, 0, 3);
sx += (width - x)/2;
}
screenp = (unsigned short*)screen_addr + sx + sy*SCREEN_WIDTH;
i= 0;
while(i < num)
{
m= BDF_cut_unicode(&unicode[i], num-i, width, 1);
x= 0;
x= (width - BDF_cut_unicode(&unicode[i], m, 0, 3)) / 2;
while(m--)
{
x += BDF_render16_ucs(screenp+x, SCREEN_WIDTH, 0, COLOR_TRANS,
color_fg, unicode[i++]);
}
if (i < num && (unicode[i] == 0x0D || unicode[i] == 0x0A))
i++;
else {
while (i < num && (unicode[i] == ' ')) i++;
}
screenp += FONTS_HEIGHT * SCREEN_WIDTH;
}
}
@ -404,12 +409,29 @@ struct scroll_string_info{
static struct scroll_string_info scroll_strinfo[MAX_SCROLL_STRING];
static u32 scroll_string_num= 0;
u32 draw_hscroll_init(void* screen_addr, u32 sx, u32 sy, u32 width,
/*
* Initialises a text scroller to display a certain string.
* Input assertions: sx + width < NDS_SCREEN_WIDTH &&
* sy + [text height] < NDS_SCREEN_HEIGHT && string != NULL &&
* screen_addr != NULL.
* Input: 'screen_addr', the address of the upper-left corner of the screen.
* 'sx' and 'sy', the X and Y coordinates of the upper-left corner of
* the text.
* 'width', the width of the scroller's viewport.
* 'color_bg', the RGB15 color of the background around the text, or
* COLOR_TRANS for transparency.
* 'color_fg', the RGB15 color of the text.
* 'string', the text to be scrolled, encoded as UTF-8.
* Output: the scroller's handle, to be used to scroll the text in
* draw_hscroll.
*/
u32 hscroll_init(void* screen_addr, u32 sx, u32 sy, u32 width,
u32 color_bg, u32 color_fg, char *string)
{
u32 index, x, num, len, i;
u32 index, x, textWidth, num, len, i;
u16 *unicode, *screenp;
// 1. Which scroller should we use for this request?
for(i= 0; i < MAX_SCROLL_STRING; i++)
{
if(scroll_strinfo[i].screenp == NULL)
@ -420,23 +442,39 @@ u32 draw_hscroll_init(void* screen_addr, u32 sx, u32 sy, u32 width,
return -1;
index= i;
screenp= (u16*)malloc((256+128)*FONTS_HEIGHT*2);
if(screenp == NULL)
{
scroll_strinfo[index].str_len = 0;
return -2;
}
unicode= (u16*)malloc(256*2);
// 2. Convert to Unicode while calculating the width of the text.
unicode= (u16*)malloc(strlen(string)*sizeof(u16));
if(unicode == NULL)
{
scroll_strinfo[index].str_len = 0;
free((void*)screenp);
return -3;
}
num= 0;
textWidth = 0;
while(*string)
{
string= utf8decode(string, unicode+num);
if(unicode[num] != 0x0D && unicode[num] != 0x0A) {
textWidth += BDF_width16_ucs(unicode[num]);
num++;
}
}
if (textWidth < width)
textWidth = width;
// 3. Allocate a rectangle of pixels for drawing the entire text into.
screenp= (u16*)malloc(textWidth*FONTS_HEIGHT*sizeof(u16));
if(screenp == NULL)
{
scroll_strinfo[index].str_len = 0;
free((void*)unicode);
return -2;
}
if(color_bg == COLOR_TRANS)
memset(screenp, 0, (256+128)*FONTS_HEIGHT*2);
memset(screenp, 0, textWidth*FONTS_HEIGHT*sizeof(u16));
scroll_string_num += 1;
scroll_strinfo[index].screenp = (unsigned short*)screen_addr;
@ -449,208 +487,81 @@ u32 draw_hscroll_init(void* screen_addr, u32 sx, u32 sy, u32 width,
scroll_strinfo[index].unicode= unicode;
scroll_strinfo[index].buff_fonts= screenp;
scroll_strinfo[index].buff_bg= 0;
num= 0;
while(*string)
{
string= utf8decode(string, unicode+num);
if(unicode[num] != 0x0D && unicode[num] != 0x0A) num++;
}
scroll_strinfo[index].str_len= num;
if(num == 0)
return index;
len= BDF_cut_unicode(unicode, num, 256+128, 1);
i= 0;
x= 0;
while(i < len)
{
x += BDF_render16_ucs(screenp + x, 256+128, 0, color_bg, color_fg, unicode[i++]);
}
scroll_strinfo[index].buff_width= x;
scroll_strinfo[index].buff_width= textWidth;
scroll_strinfo[index].pos_pixel= 0;
scroll_strinfo[index].str_start= 0;
scroll_strinfo[index].str_end= len-1;
num= scroll_strinfo[index].height;
len= width;
scroll_strinfo[index].str_len= num;
if(num == 0)
return index; // (1. Which scroller?)
u16 *screenp1;
if(color_bg == COLOR_TRANS)
// 4. Render text into the allocation.
i= 0;
x= 0;
while(i < num)
{
u16 pixel;
for(i= 0; i < num; i++)
{
screenp= (unsigned short*)screen_addr + sx + (sy + i) * SCREEN_WIDTH;
screenp1= scroll_strinfo[index].buff_fonts + i*(256+128);
for(x= 0; x < len; x++)
{
pixel= *screenp1++;
if(pixel) *screenp = pixel;
screenp ++;
}
}
}
else
{
screenp= (unsigned short*)screen_addr + sx + sy * SCREEN_WIDTH;
screenp1= scroll_strinfo[index].buff_fonts;
for(i= 0; i < num; i++)
{
memcpy((char*)screenp, (char*)screenp1, len*2);
screenp += SCREEN_WIDTH;
screenp1 += (256+128);
}
x += BDF_render16_ucs(screenp + x, textWidth, 0, color_bg, color_fg, unicode[i++]);
}
return index;
return index; // (1. Which scroller?)
}
u32 draw_hscroll_init(void* screen_addr, u32 sx, u32 sy, u32 width,
u32 color_bg, u32 color_fg, char *string)
{
u32 ret = hscroll_init(screen_addr, sx, sy, width, color_bg, color_fg, string);
draw_hscroll(ret, 0 /* stay on the left */);
return ret;
}
/*
* Scrolls an initialised scroller's text.
* A scroller is never allowed to go past the beginning of the text when
* scrolling to the left, or to go past the end when scrolling to the right.
* Input assertions: index was returned by a previous call to
* draw_hscroll_init and not used in a call to draw_hscroll_over.
* Input: 'index', the scroller's handle.
* 'scroll_val', the number of pixels to scroll. The sign affects the
* direction. If scroll_val > 0, the scroller's viewport is moved to
* the left; if < 0, the scroller's viewport is moved to the right.
* Output: the number of pixels still available to scroll in the direction
* specified by the sign of 'scroll_val'.
*
* Example: (assume each letter is 1 pixel; this won't be true in reality)
* [some lengthy text shown in ] |
* val -5 -> | [lengthy text shown in a scr]xxxxx -> to right, returns 5
* val -5 -> | [hy text shown in a scroller] -> to right, returns 0
* val 3 -> xxxxxxx[ngthy text shown in a scrol] | -> to left, returns 7
* val 3 -> xxxx[ lengthy text shown in a sc] | -> to left, returns 4
*/
u32 draw_hscroll(u32 index, s32 scroll_val)
{
u32 color_bg, color_fg, i, width, height;
s32 xoff;
//static int flag= 0;
if(index >= MAX_SCROLL_STRING) return -1;
if(scroll_strinfo[index].screenp == NULL) return -2;
if(scroll_strinfo[index].str_len == 0) return 0;
width= scroll_strinfo[index].width;
height= scroll_strinfo[index].height;
xoff= scroll_strinfo[index].pos_pixel - scroll_val;
color_bg= scroll_strinfo[index].color_bg;
color_fg= scroll_strinfo[index].color_fg;
if(scroll_val > 0) //shift right
{
if(xoff <= 0)
{
if(scroll_strinfo[index].str_start > 0)
{
u32 x, y, len;
u16 *unicode;
u32 *ptr;
//we assume the malloced memory are 4 bytes aligned, or else this method is wrong
y= height*width;
ptr= (u32*)scroll_strinfo[index].buff_fonts;
y= ((256+128)*FONTS_HEIGHT*2+3)/4;
x= 0;
while(x<y) ptr[x++] = 0;
unicode= scroll_strinfo[index].unicode + scroll_strinfo[index].str_end;
len= scroll_strinfo[index].str_end +1;
x= (scroll_val > SCREEN_WIDTH/4) ? scroll_val : SCREEN_WIDTH/4;
y= BDF_cut_unicode(unicode, len, x, 0);
if(y < len) y += 1;
if(y < scroll_strinfo[index].str_start)
scroll_strinfo[index].str_start -= y;
else
{
y= scroll_strinfo[index].str_start;
scroll_strinfo[index].str_start = 0;
}
len= scroll_strinfo[index].str_len - scroll_strinfo[index].str_start;
unicode= scroll_strinfo[index].unicode + scroll_strinfo[index].str_start;
x= 0;
i= 0;
while(i < y)
{
x += BDF_render16_ucs(scroll_strinfo[index].buff_fonts + x, 256+128, 0,
color_bg, color_fg, unicode[i++]);
if(x >= (256+128-14)) break;
}
y= x;
while(i < len)
{
x += BDF_render16_ucs(scroll_strinfo[index].buff_fonts + x, 256+128, 0,
color_bg, color_fg, unicode[i++]);
if(x >= (256+128-14)) break;
}
scroll_strinfo[index].pos_pixel += y - scroll_val;
if((scroll_strinfo[index].pos_pixel + width) > (256+128))
scroll_strinfo[index].pos_pixel= 0;
scroll_strinfo[index].buff_width= x;
scroll_strinfo[index].str_end = scroll_strinfo[index].str_start + i -1;
}
else
{
if(scroll_strinfo[index].pos_pixel > 0)
scroll_strinfo[index].pos_pixel= 0;
else
return 0;
}
xoff= scroll_strinfo[index].pos_pixel;
}
else
scroll_strinfo[index].pos_pixel= xoff;
}
else if(xoff < (s32)scroll_strinfo[index].buff_width) //shift left
{
if((scroll_strinfo[index].buff_width + width) > (256+128))
if((xoff + width) > scroll_strinfo[index].buff_width)
{
u32 x, y, len;
u16 *unicode;
u32 *ptr;
//we assume the malloced memory are 4 bytes aligned, or else this method is wrong
y= height*width;
ptr= (u32*)scroll_strinfo[index].buff_fonts;
y= ((256+128)*FONTS_HEIGHT*2+3)/4;
x= 0;
while(x<y) ptr[x++] = 0;
unicode= scroll_strinfo[index].unicode + scroll_strinfo[index].str_start;
len= scroll_strinfo[index].str_len - scroll_strinfo[index].str_start;
x= (scroll_val > SCREEN_WIDTH/4) ? scroll_val : SCREEN_WIDTH/4;
x= ((s32)x < xoff) ? x : xoff;
y= BDF_cut_unicode(unicode, len, x, 1);
scroll_strinfo[index].str_start += y;
len= scroll_strinfo[index].str_len - scroll_strinfo[index].str_start;
y= scroll_strinfo[index].str_end - scroll_strinfo[index].str_start +1;
unicode= scroll_strinfo[index].unicode + scroll_strinfo[index].str_start;
x= 0;
i= 0;
while(i < y)
{
x += BDF_render16_ucs(scroll_strinfo[index].buff_fonts + x, 256+128, 0,
color_bg, color_fg, unicode[i++]);
}
xoff -= scroll_strinfo[index].buff_width - x;
while(i < len)
{
x += BDF_render16_ucs(scroll_strinfo[index].buff_fonts + x, 256+128, 0,
color_bg, color_fg, unicode[i++]);
if(x >= (256+128-14)) break;
}
scroll_strinfo[index].buff_width= x;
scroll_strinfo[index].str_end = scroll_strinfo[index].str_start + i -1;
}
scroll_strinfo[index].pos_pixel= xoff;
}
else
return 0;
// 1. Shift the scroller.
scroll_strinfo[index].pos_pixel -= scroll_val;
if (scroll_strinfo[index].pos_pixel < 0) // Reached the beginning
scroll_strinfo[index].pos_pixel = 0;
else if (scroll_strinfo[index].pos_pixel > scroll_strinfo[index].buff_width - width) // Reached the end
scroll_strinfo[index].pos_pixel = scroll_strinfo[index].buff_width - width;
// 2. Draw the scroller's text at its new position.
u32 x, sx, sy, pixel;
u16 *screenp, *screenp1;
color_bg = scroll_strinfo[index].color_bg;
sx= scroll_strinfo[index].sx;
sy= scroll_strinfo[index].sy;
@ -659,7 +570,7 @@ u32 draw_hscroll(u32 index, s32 scroll_val)
for(i= 0; i < height; i++)
{
screenp= scroll_strinfo[index].screenp + sx + (sy + i) * SCREEN_WIDTH;
screenp1= scroll_strinfo[index].buff_fonts + xoff + i*(256+128);
screenp1= scroll_strinfo[index].buff_fonts + scroll_strinfo[index].pos_pixel + i*scroll_strinfo[index].buff_width;
for(x= 0; x < width; x++)
{
pixel= *screenp1++;
@ -673,19 +584,21 @@ u32 draw_hscroll(u32 index, s32 scroll_val)
for(i= 0; i < height; i++)
{
screenp= scroll_strinfo[index].screenp + sx + (sy + i) * SCREEN_WIDTH;
screenp1= scroll_strinfo[index].buff_fonts + xoff + i*(256+128);
screenp1= scroll_strinfo[index].buff_fonts + scroll_strinfo[index].pos_pixel + i*scroll_strinfo[index].buff_width;
for(x= 0; x < width; x++)
*screenp++ = *screenp1++;
}
}
u32 ret;
// 3. Return how many more pixels we can scroll in the same direction.
if(scroll_val > 0)
ret= scroll_strinfo[index].pos_pixel;
// Scrolling to the left: Return the number of pixels we can still go
// to the left.
return scroll_strinfo[index].pos_pixel;
else
ret= scroll_strinfo[index].buff_width - scroll_strinfo[index].pos_pixel;
return ret;
// Scrolling to the right: Return the number of pixels we can still go
// to the right.
return scroll_strinfo[index].buff_width - scroll_strinfo[index].pos_pixel - width;
}
void draw_hscroll_over(u32 index)
@ -715,6 +628,7 @@ void draw_hscroll_over(u32 index)
/*
* Drawing dialog
*/
/*
void draw_dialog(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey)
{
drawboxfill(screen_addr, sx + 5, sy + 5, ex + 5, ey + 5, COLOR_DIALOG_SHADOW);
@ -741,6 +655,7 @@ void draw_dialog(void* screen_addr, u32 sx, u32 sy, u32 ex, u32 ey)
drawboxfill(screen_addr, sx, sy, ex, ey, COLOR_DIALOG);
}
*/
/*
* Draw yes or no dialog
@ -787,13 +702,16 @@ u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no)
else
screen_addr = down_screen_addr;
i= SCREEN_WIDTH/2 - box_width - 2;
show_icon((unsigned short*)screen_addr, &ICON_BUTTON, 49, 128);
draw_string_vcenter((unsigned short*)screen_addr, 51, 130, 73, COLOR_WHITE, yes);
sy = (NDS_SCREEN_HEIGHT + ICON_MSG.y) / 2 - 8 - ICON_BUTTON.y;
i= SCREEN_WIDTH/2 + 3;
show_icon((unsigned short*)screen_addr, &ICON_BUTTON, 136, 128);
draw_string_vcenter((unsigned short*)screen_addr, 138, 130, 73, COLOR_WHITE, no);
u32 left_sx = NDS_SCREEN_WIDTH / 2 - 8 - ICON_BUTTON.x,
right_sx = NDS_SCREEN_WIDTH / 2 + 8;
show_icon((unsigned short*)screen_addr, &ICON_BUTTON, left_sx, sy);
draw_string_vcenter((unsigned short*)screen_addr, left_sx + 2, sy, ICON_BUTTON.x - 4, COLOR_WHITE, yes);
show_icon((unsigned short*)screen_addr, &ICON_BUTTON, right_sx, sy);
draw_string_vcenter((unsigned short*)screen_addr, right_sx + 2, sy, ICON_BUTTON.x - 4, COLOR_WHITE, no);
ds2_flipScreen(screen, 2);
@ -806,11 +724,11 @@ u32 draw_yesno_dialog(enum SCREEN_ID screen, u32 sy, char *yes, char *no)
struct key_buf inputdata;
ds2_getrawInput(&inputdata);
// Turn it into a SELECT (A) or BACK (B) if the button is touched.
if (inputdata.y >= 128 && inputdata.y < 128 + ICON_BUTTON.y)
if (inputdata.y >= sy && inputdata.y < sy + ICON_BUTTON.y)
{
if (inputdata.x >= 49 && inputdata.x < 49 + ICON_BUTTON.x)
if (inputdata.x >= left_sx && inputdata.x < left_sx + ICON_BUTTON.x)
gui_action = CURSOR_SELECT;
else if (inputdata.x >= 136 && inputdata.x < 136 + ICON_BUTTON.x)
else if (inputdata.x >= right_sx && inputdata.x < right_sx + ICON_BUTTON.x)
gui_action = CURSOR_BACK;
}
}
@ -1189,6 +1107,62 @@ int icon_init(u32 language_id)
return ret;
}
int color_init()
{
char path[MAX_PATH];
char current_line[256];
sprintf(path, "%s/%s/%s", main_path, GUI_SOURCE_PATH, "uicolors.txt");
FILE* fp = fopen(path, "r");
if (fp != NULL)
{
while(fgets(current_line, 256, fp))
{
char* colon = strchr(current_line, ':');
if (colon)
{
*colon = '\0';
u16* color = NULL;
if (strcasecmp(current_line, "Background") == 0)
color = &COLOR_BG;
else if (strcasecmp(current_line, "ActiveItem") == 0)
color = &COLOR_ACTIVE_ITEM;
else if (strcasecmp(current_line, "InactiveItem") == 0)
color = &COLOR_INACTIVE_ITEM;
else if (strcasecmp(current_line, "MessageText") == 0)
color = &COLOR_MSSG;
else if (strcasecmp(current_line, "ActiveMain") == 0)
color = &COLOR_ACTIVE_MAIN;
else if (strcasecmp(current_line, "InactiveMain") == 0)
color = &COLOR_INACTIVE_MAIN;
if (color != NULL)
{
char* end = strchr(colon + 1, '\0') - 1;
while (*end && (*end == '\r' || *end == '\n'))
*end-- = '\0';
char* ptr = colon + 1;
while (*ptr && *ptr == ' ')
ptr++;
u32 color32;
u8 r, g, b;
if (strlen(ptr) == 7 && *ptr == '#')
{
color32 = strtol(ptr + 1, NULL, 16);
r = (color32 >> 16) & 0xFF;
g = (color32 >> 8) & 0xFF;
b = color32 & 0xFF;
*color = COLOR16(r >> 3, g >> 3, b >> 3);
}
}
}
}
fclose(fp);
return 0;
}
else
return 1;
}
/*************************************************************/
void show_icon(void* screen, struct gui_iconlist* icon, u32 x, u32 y)
{
@ -1199,6 +1173,13 @@ void show_icon(void* screen, struct gui_iconlist* icon, u32 x, u32 y)
dst = (unsigned short*)screen + y*NDS_SCREEN_WIDTH + x;
if(NULL == src) return; //The icon may initialized failure
if (icon->x == NDS_SCREEN_WIDTH && icon->y == NDS_SCREEN_HEIGHT && x == 0 && y == 0)
{
// Don't support transparency for a background.
memcpy(dst, src, NDS_SCREEN_WIDTH * NDS_SCREEN_HEIGHT * sizeof(u16));
}
else
{
for(i= 0; i < icon->y; i++)
{
for(k= 0; k < icon->x; k++)
@ -1209,6 +1190,7 @@ void show_icon(void* screen, struct gui_iconlist* icon, u32 x, u32 y)
dst += NDS_SCREEN_WIDTH;
}
}
}
/*************************************************************/
@ -1281,7 +1263,7 @@ void show_log(void* screen_addr)
void err_msg(enum SCREEN_ID screen, char *msg)
{
// A wild console appeared!
ConsoleInit(RGB15(31, 31, 31), RGB15(0, 0, 0), UP_SCREEN, 512);
ConsoleInit(RGB15(31, 31, 31), RGB15(0, 0, 0), UP_SCREEN, 2);
printf(msg);
}

View file

@ -61,27 +61,25 @@
#define COLOR_TRANS COLOR16(31, 31, 63)
#define COLOR_WHITE COLOR16(31, 31, 31)
#define COLOR_BLACK COLOR16( 0, 0, 0)
#define COLOR_TEXT COLOR16(31, 31, 31)
#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0)
#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15)
#define COLOR_ERROR COLOR16(31, 0, 0)
#define COLOR_BG COLOR16(2, 4, 10)
#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8)
#define COLOR_ROM_INFO COLOR16(22, 18, 26)
#define COLOR_ACTIVE_ITEM COLOR16(31, 31, 31)
#define COLOR_INACTIVE_ITEM COLOR16(11, 7, 19)
#define COLOR_HELP_TEXT COLOR16(16, 20, 24)
#define COLOR_DIALOG COLOR16(31, 31, 31)
#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8)
#define COLOR_FRAME COLOR16( 0, 0, 0)
#define COLOR_YESNO_TEXT COLOR16( 0, 0, 0)
#define COLOR_GREEN COLOR16( 0, 31, 0 )
#define COLOR_GREEN1 COLOR16( 0, 24, 0 )
#define COLOR_GREEN2 COLOR16( 0, 18, 0 )
#define COLOR_GREEN3 COLOR16( 0, 12, 0 )
#define COLOR_GREEN4 COLOR16( 0, 6, 0 )
#define COLOR_RED COLOR16( 31, 0, 0 )
#define COLOR_MSSG COLOR16( 16, 8, 29)
//#define COLOR_TEXT COLOR16(31, 31, 31)
//#define COLOR_PROGRESS_TEXT COLOR16( 0, 0, 0)
//#define COLOR_PROGRESS_BAR COLOR16(15, 15, 15)
//#define COLOR_ERROR COLOR16(31, 0, 0)
//#define COLOR_BG COLOR16(2, 4, 10)
//#define COLOR_BG32 COLOR32(2*8, 4*8, 10*8)
//#define COLOR_ROM_INFO COLOR16(22, 18, 26)
//#define COLOR_HELP_TEXT COLOR16(16, 20, 24)
//#define COLOR_DIALOG COLOR16(31, 31, 31)
//#define COLOR_DIALOG_SHADOW COLOR16( 0, 2, 8)
//#define COLOR_FRAME COLOR16( 0, 0, 0)
//#define COLOR_YESNO_TEXT COLOR16( 0, 0, 0)
//#define COLOR_GREEN COLOR16( 0, 31, 0 )
//#define COLOR_GREEN1 COLOR16( 0, 24, 0 )
//#define COLOR_GREEN2 COLOR16( 0, 18, 0 )
//#define COLOR_GREEN3 COLOR16( 0, 12, 0 )
//#define COLOR_GREEN4 COLOR16( 0, 6, 0 )
//#define COLOR_RED COLOR16( 31, 0, 0 )
//#define COLOR_MSSG COLOR16( 16, 8, 29)
/******************************************************************************
*
******************************************************************************/
@ -89,6 +87,13 @@
extern "C" {
#endif
extern u16 COLOR_BG;
extern u16 COLOR_INACTIVE_ITEM;
extern u16 COLOR_ACTIVE_ITEM;
extern u16 COLOR_MSSG;
extern u16 COLOR_INACTIVE_MAIN;
extern u16 COLOR_ACTIVE_MAIN;
struct background{
char bgname[128];
char bgbuffer[256*192*2];
@ -161,7 +166,9 @@ extern void draw_message(void* screen_address, u16 *screen_bg, u32 sx, u32 sy, u
extern void draw_string_vcenter(void* screen_address, u32 sx, u32 sy, u32 width,
u32 color_fg, char *string);
#define MAX_SCROLL_STRING 8
#define MAX_SCROLL_STRING 16
extern u32 hscroll_init(void* screen_address, u32 sx, u32 sy, u32 width,
u32 color_bg, u32 color_fg, char *string);
extern u32 draw_hscroll_init(void* screen_address, u32 sx, u32 sy, u32 width,
u32 color_bg, u32 color_fg, char *string);
extern u32 draw_hscroll(u32 index, s32 scroll_val);
@ -178,6 +185,7 @@ extern void msg_screen_clear(void);
extern void msg_set_text_color(u32 color);
extern int icon_init(u32 language_id);
extern int color_init(void);
extern int gui_change_icon(u32 language_id);
extern int show_background(void *screen, char *bgname);
extern void show_icon(void* screen, struct gui_iconlist *icon, u32 x, u32 y);

View file

@ -140,22 +140,29 @@ bool8 S9xInitUpdate ()
}
extern void NDSSFCDrawFrameAntialiased();
extern void NDSSFCDrawFrameAntialiased(void* screen_addr);
bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/)
{
void* screen_addr = emu_config.BottomScreenGame
? down_screen_addr
: up_screen_addr;
SCREEN_ID screen_num = emu_config.BottomScreenGame
? DOWN_SCREEN
: UP_SCREEN;
switch(game_config.graphic)
{
//Up
case 1:
#ifdef DS2_DMA
__dcache_writeback_all();
ds2_DMAcopy_32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 32 * 2, 256 * 192 * 2);
ds2_DMAcopy_32Byte(1 /* channel: graphics */, screen_addr, GFX.Screen + 256 * 32 * 2, 256 * 192 * 2);
ds2_DMA_wait(1);
ds2_DMA_stop(1);
#else
memcpy(up_screen_addr, GFX.Screen+256*32*2, 256*192*2);
memcpy(screen_addr, GFX.Screen+256*32*2, 256*192*2);
#endif
break;
@ -163,11 +170,11 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/)
case 2:
#ifdef DS2_DMA
__dcache_writeback_all();
ds2_DMAcopy_32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen, 256 * 192 * 2);
ds2_DMAcopy_32Byte(1 /* channel: graphics */, screen_addr, GFX.Screen, 256 * 192 * 2);
ds2_DMA_wait(1);
ds2_DMA_stop(1);
#else
memcpy(up_screen_addr, GFX.Screen, 256*192*2);
memcpy(screen_addr, GFX.Screen, 256*192*2);
#endif
break;
@ -175,16 +182,16 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/)
case 3:
#ifdef DS2_DMA
__dcache_writeback_all();
ds2_DMAcopy_32Byte(1 /* channel: graphics */, up_screen_addr, GFX.Screen + 256 * 16 * 2, 256 * 192 * 2);
ds2_DMAcopy_32Byte(1 /* channel: graphics */, screen_addr, GFX.Screen + 256 * 16 * 2, 256 * 192 * 2);
ds2_DMA_wait(1);
ds2_DMA_stop(1);
#else
memcpy(up_screen_addr, GFX.Screen+256*16*2, 256*192*2);
memcpy(screen_addr, GFX.Screen+256*16*2, 256*192*2);
#endif
break;
case 4:
NDSSFCDrawFrameAntialiased ();
NDSSFCDrawFrameAntialiased (screen_addr);
break;
@ -197,7 +204,7 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/)
register unsigned int m;
src = GFX.Screen;
dst = (unsigned char*)up_screen_addr;
dst = (unsigned char*)screen_addr;
for(m = 0; m < 32; m++)
{
#ifdef DS2_DMA
@ -214,7 +221,7 @@ bool8 S9xDeinitUpdate (int Width, int Height, bool8 /*sixteen_bit*/)
break;
}
ds2_flipScreen(UP_SCREEN, UP_SCREEN_UPDATE_METHOD);
ds2_flipScreen(screen_num, UP_SCREEN_UPDATE_METHOD);
// A problem with update method 1 (wait, double buffer) means that, after
// about 15 minutes of play time, the screen starts to half-redraw every
// frame. With update method 0, this is mitigated. (Method 2 is too slow.)
@ -648,7 +655,19 @@ int sfc_main (int argc, char **argv)
S9xSetSoundMute (TRUE);
unsigned short screen[256*192];
copy_screen((void*)screen, up_screen_addr, 0, 0, 256, 192);
if (FirstInvocation) {
memset(screen, 0, sizeof(screen));
}
else {
S9xDeinitUpdate(256, 224, TRUE);
void* screen_addr = emu_config.BottomScreenGame
? down_screen_addr
: up_screen_addr;
copy_screen((void*)screen, screen_addr, 0, 0, 256, 192);
}
menu(screen, FirstInvocation);
FirstInvocation = FALSE;
game_disableAudio();
@ -1262,10 +1281,13 @@ uint32 S9xReadJoypad (int which1)
mdelay(1);
} while (inputdata.key & KEY_LID);
ds2_wakeup();
// Before starting to emulate again, turn off the lower
// screen's backlight.
// Before starting to emulate again, turn on only the
// game screen's backlight.
SCREEN_ID screen_num = emu_config.BottomScreenGame
? DOWN_SCREEN
: UP_SCREEN;
mdelay(100); // needed to avoid ds2_setBacklight crashing
ds2_setBacklight(2);
ds2_setBacklight(3 - screen_num);
GameFrequencyCPU();
}

View file

@ -26,7 +26,7 @@ extern "C" {
#include "cheats.h"
#define CHEATS_PER_PAGE 4
#define CHEATS_PER_PAGE 6
#define MAX_CHEATS_PAGE (MAX_CHEATS_T / CHEATS_PER_PAGE)
extern int NDSSFCLoadCheatFile(const char* filename);

File diff suppressed because it is too large Load diff

View file

@ -31,6 +31,23 @@
#define OPTION_TEXT_X 10
#define OPTION_TEXT_SX 236
// For option rows
#define GUI_ROW1_Y 36
#define GUI_ROW_SY 19
// The following offset is added to the row's Y coordinate to provide
// the Y coordinate for its text.
#define TEXT_OFFSET_Y 2
// The following offset is added to the row's Y coordinate to provide
// the Y coordinate for its ICON_SUBSELA (sub-screen selection type A).
#define SUBSELA_OFFSET_Y -2
#define SUBSELA_X ((NDS_SCREEN_WIDTH - ICON_SUBSELA.x) / 2)
// For message boxes
#define MESSAGE_BOX_TEXT_X ((NDS_SCREEN_WIDTH - ICON_MSG.x) / 2 + 3)
#define MESSAGE_BOX_TEXT_SX (ICON_MSG.x - 6)
// Y is brought down by the "window title" that's part of ICON_MSG
#define MESSAGE_BOX_TEXT_Y ((NDS_SCREEN_HEIGHT - ICON_MSG.y) / 2 + 24)
// For cheats [ NUM. DESC . . . . . +/- ]
#define CHEAT_NUMBER_X 10
#define CHEAT_DESC_X 34
@ -39,9 +56,17 @@
// For the file selector
#define FILE_SELECTOR_ICON_X 10
#define FILE_SELECTOR_ICON_Y (TEXT_OFFSET_Y - 1)
#define FILE_SELECTOR_NAME_X 32
#define FILE_SELECTOR_NAME_SX 214
// Back button
#define BACK_BUTTON_X 229
#define BACK_BUTTON_Y 10
// Title icon
#define TITLE_ICON_X 12
#define TITLE_ICON_Y 9
#define MAX_GAMEPAD_MAP 16
#ifdef __cplusplus
@ -61,7 +86,8 @@ struct _EMU_CONFIG
u32 HotkeyQuickLoadState;
u32 HotkeyQuickSaveState;
u32 HotkeyToggleFullScreen;
u32 Reserved[58];
u32 BottomScreenGame;
u32 Reserved[57];
};
struct _GAME_CONFIG

View file

@ -31,12 +31,17 @@ enum MSG
MSG_MAIN_MENU_TOOLS,
MSG_MAIN_MENU_OPTIONS,
MSG_MAIN_MENU_EXIT,
MSG_FILE_MENU_LOADING_LIST,
MSG_FILE_MENU_SORTING_LIST,
FMT_VIDEO_AUDIO_FLUIDITY_PREFERENCE,
MSG_VIDEO_AUDIO_FLUIDITY_PREFER_VIDEO,
MSG_VIDEO_AUDIO_FLUIDITY_PREFER_AUDIO,
FMT_VIDEO_ASPECT_RATIO,
FMT_VIDEO_FAST_FORWARD,
FMT_VIDEO_FRAME_SKIPPING,
FMT_VIDEO_GAME_SCREEN,
FMT_AUDIO_SOUND,
FMT_AUDIO_RETRO_SOUND,
FMT_SAVED_STATE_CREATE,
@ -92,6 +97,9 @@ enum MSG
MSG_VIDEO_FRAME_SKIPPING_9,
MSG_VIDEO_FRAME_SKIPPING_10,
MSG_VIDEO_GAME_SCREEN_TOP,
MSG_VIDEO_GAME_SCREEN_BOTTOM,
MSG_GENERAL_OFF,
MSG_GENERAL_ON,
@ -128,12 +136,7 @@ enum MSG
MSG_NO_SLIDE,
MSG_PLAYING_SLIDE,
MSG_PAUSE_SLIDE,
MSG_PLAY_SLIDE1,
MSG_PLAY_SLIDE2,
MSG_PLAY_SLIDE3,
MSG_PLAY_SLIDE4,
MSG_PLAY_SLIDE5,
MSG_PLAY_SLIDE6,
MSG_SCREENSHOT_SLIDESHOW_KEYS,
MSG_PROGRESS_LOADING_GAME,