summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--apps/SOURCES9
-rw-r--r--apps/debug_menu.c63
-rw-r--r--apps/features.txt19
-rw-r--r--apps/gui/buttonbar.c131
-rw-r--r--apps/gui/buttonbar.h85
-rw-r--r--apps/gui/list.c4
-rw-r--r--apps/gui/option_select.h5
-rw-r--r--apps/gui/skin_engine/skin_tokens.c4
-rw-r--r--apps/gui/viewport.c7
-rw-r--r--apps/gui/wps.c4
-rw-r--r--apps/keymaps/keymap-ondio.c252
-rw-r--r--apps/keymaps/keymap-player.c165
-rw-r--r--apps/keymaps/keymap-recorder.c312
-rw-r--r--apps/lang/english.lang447
-rw-r--r--apps/main.c22
-rw-r--r--apps/menu.c34
-rw-r--r--apps/menus/main_menu.c30
-rw-r--r--apps/menus/recording_menu.c29
-rw-r--r--apps/menus/settings_menu.c24
-rw-r--r--apps/menus/sound_menu.c15
-rw-r--r--apps/menus/theme_menu.c22
-rw-r--r--apps/menus/time_menu.c6
-rw-r--r--apps/misc.c15
-rw-r--r--apps/mpeg.c1079
-rw-r--r--apps/plugin.c34
-rw-r--r--apps/plugin.h36
-rw-r--r--apps/plugins/SOURCES35
-rw-r--r--apps/plugins/SUBDIRS7
-rw-r--r--apps/plugins/alpine_cdc.c1195
-rw-r--r--apps/plugins/battery_bench.c35
-rw-r--r--apps/plugins/beatbox/beatbox.c14
-rw-r--r--apps/plugins/blackjack.c32
-rw-r--r--apps/plugins/brickmania.c25
-rw-r--r--apps/plugins/bubbles.c1
-rw-r--r--apps/plugins/calculator.c25
-rw-r--r--apps/plugins/calendar.c26
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.h32
-rw-r--r--apps/plugins/chessclock.c35
-rw-r--r--apps/plugins/chip8.c24
-rw-r--r--apps/plugins/chopper.c11
-rw-r--r--apps/plugins/credits.c7
-rw-r--r--apps/plugins/cube.c34
-rw-r--r--apps/plugins/euroconverter.c599
-rw-r--r--apps/plugins/firmware_flash.c1033
-rw-r--r--apps/plugins/flipit.c53
-rw-r--r--apps/plugins/fractals/cpu_sh7043.h96
-rw-r--r--apps/plugins/fractals/fractal.h28
-rw-r--r--apps/plugins/fractals/mandelbrot_set.h9
-rw-r--r--apps/plugins/goban/goban.h21
-rw-r--r--apps/plugins/goban/goban.make9
-rw-r--r--apps/plugins/greyscale.c18
-rw-r--r--apps/plugins/imageviewer/imageviewer_button.h27
-rw-r--r--apps/plugins/imageviewer/jpeg/jpeg_decoder.c18
-rw-r--r--apps/plugins/jewels.c22
-rw-r--r--apps/plugins/lib/SOURCES2
-rw-r--r--apps/plugins/lib/grey_core.c30
-rw-r--r--apps/plugins/lib/grey_draw.c3
-rw-r--r--apps/plugins/lib/grey_sh.S137
-rw-r--r--apps/plugins/lib/helper.c14
-rw-r--r--apps/plugins/lib/pluginlib_actions.c39
-rw-r--r--apps/plugins/lib/xlcd_scroll.c143
-rw-r--r--apps/plugins/lrcplayer.c6
-rw-r--r--apps/plugins/lua/Makefile5
-rw-r--r--apps/plugins/lua/lua.make8
-rw-r--r--apps/plugins/lua/rocklib.c7
-rw-r--r--apps/plugins/minesweeper.c27
-rw-r--r--apps/plugins/nim.c285
-rw-r--r--apps/plugins/oscilloscope.c28
-rw-r--r--apps/plugins/pegbox.c36
-rw-r--r--apps/plugins/pictureflow/pictureflow.c16
-rw-r--r--apps/plugins/pictureflow/pictureflow.make8
-rw-r--r--apps/plugins/plugin.lds2
-rw-r--r--apps/plugins/pong.c18
-rw-r--r--apps/plugins/reversi/reversi-gui.h24
-rw-r--r--apps/plugins/rockblox.c37
-rw-r--r--apps/plugins/rockbox_flash.c967
-rw-r--r--apps/plugins/rockboy/lcd.c153
-rw-r--r--apps/plugins/rockboy/rockboy.c10
-rw-r--r--apps/plugins/rockboy/sys_rockbox.c54
-rw-r--r--apps/plugins/sliding_puzzle.c31
-rw-r--r--apps/plugins/snake.c20
-rw-r--r--apps/plugins/snake2.c22
-rw-r--r--apps/plugins/sokoban.c57
-rw-r--r--apps/plugins/solitaire.c47
-rw-r--r--apps/plugins/spacerocks.c22
-rw-r--r--apps/plugins/splitedit.c64
-rw-r--r--apps/plugins/star.c38
-rw-r--r--apps/plugins/starfield.c12
-rw-r--r--apps/plugins/stopwatch.c26
-rw-r--r--apps/plugins/sudoku/sudoku.h27
-rw-r--r--apps/plugins/test_scanrate.c6
-rw-r--r--apps/plugins/text_viewer/tv_button.h40
-rw-r--r--apps/plugins/video.c1030
-rw-r--r--apps/plugins/vu_meter.c38
-rw-r--r--apps/plugins/wavplay.c3676
-rw-r--r--apps/plugins/wavrecord.c3811
-rw-r--r--apps/plugins/wormlet.c32
-rw-r--r--apps/plugins/xobox.c18
-rw-r--r--apps/plugins/zxbox/keymaps.h18
-rw-r--r--apps/plugins/zxbox/zxbox_keyb.c28
-rw-r--r--apps/radio/presets.c11
-rw-r--r--apps/radio/radio.c13
-rw-r--r--apps/recorder/jpeg_load.c37
-rw-r--r--apps/recorder/keyboard.c29
-rw-r--r--apps/recorder/recording.c286
-rw-r--r--apps/recorder/resize.c91
-rw-r--r--apps/recorder/resize.h56
-rw-r--r--apps/root_menu.c18
-rw-r--r--apps/screen_access.c16
-rw-r--r--apps/screen_access.h4
-rw-r--r--apps/screens.c260
-rw-r--r--apps/screens.h3
-rw-r--r--apps/settings.c16
-rw-r--r--apps/settings.h8
-rw-r--r--apps/settings_list.c55
-rw-r--r--apps/talk.c33
-rw-r--r--apps/tree.c22
-rw-r--r--bootloader/Makefile7
-rw-r--r--bootloader/bootloader.make4
-rw-r--r--docs/MAINTAINERS8
-rw-r--r--docs/PLUGIN_API88
-rw-r--r--docs/TECH203
-rw-r--r--firmware/SOURCES81
-rw-r--r--firmware/asm/sh/memcpy.S227
-rw-r--r--firmware/asm/sh/memmove.S222
-rw-r--r--firmware/asm/sh/memset.S109
-rw-r--r--firmware/asm/sh/strlen.S96
-rw-r--r--firmware/asm/sh/thread.c96
-rw-r--r--firmware/asm/sh/thread.h30
-rw-r--r--firmware/asm/thread.c2
-rw-r--r--firmware/asm/thread.h2
-rw-r--r--firmware/common/file_internal.c3
-rw-r--r--firmware/debug.c193
-rw-r--r--firmware/drivers/audio/mas35xx.c285
-rw-r--r--firmware/drivers/audio/sdl.c22
-rw-r--r--firmware/drivers/button.c9
-rw-r--r--firmware/drivers/fmradio.c121
-rw-r--r--firmware/drivers/rtc/rtc_m41st84w.c296
-rw-r--r--firmware/drivers/tuner/s1a0903x01.c179
-rw-r--r--firmware/export/audiohw.h2
-rw-r--r--firmware/export/audiohw_settings.h10
-rw-r--r--firmware/export/config.h48
-rw-r--r--firmware/export/config/archosfmrecorder.h147
-rw-r--r--firmware/export/config/archosondiofm.h147
-rw-r--r--firmware/export/config/archosondiosp.h131
-rw-r--r--firmware/export/config/archosplayer.h111
-rw-r--r--firmware/export/config/archosrecorder.h141
-rw-r--r--firmware/export/config/archosrecorderv2.h147
-rw-r--r--firmware/export/cpu.h3
-rw-r--r--firmware/export/hwcompat.h31
-rw-r--r--firmware/export/mas35xx.h292
-rw-r--r--firmware/export/mascodec.h45
-rw-r--r--firmware/export/mp3_playback.h9
-rw-r--r--firmware/export/rtc.h10
-rw-r--r--firmware/export/s1a0903x01.h42
-rw-r--r--firmware/export/sh7034.h376
-rw-r--r--firmware/export/sound.h11
-rw-r--r--firmware/export/tuner.h9
-rw-r--r--firmware/export/usb.h8
-rw-r--r--firmware/firmware.make4
-rw-r--r--firmware/rolo.c113
-rw-r--r--firmware/rom.lds3
-rw-r--r--firmware/sound.c76
-rw-r--r--firmware/target/hosted/sdl/sim-ui-defines.h38
-rw-r--r--firmware/target/sh/adc-sh.c110
-rw-r--r--firmware/target/sh/archos/app.lds145
-rw-r--r--firmware/target/sh/archos/ata-archos.c71
-rw-r--r--firmware/target/sh/archos/ata-as-archos.S233
-rw-r--r--firmware/target/sh/archos/ata-target.h45
-rw-r--r--firmware/target/sh/archos/audio-archos.c543
-rw-r--r--firmware/target/sh/archos/boot.lds81
-rw-r--r--firmware/target/sh/archos/descramble.S121
-rw-r--r--firmware/target/sh/archos/fm_v2/adc-target.h41
-rw-r--r--firmware/target/sh/archos/fm_v2/backlight-target.h51
-rw-r--r--firmware/target/sh/archos/fm_v2/button-fm_v2.c99
-rw-r--r--firmware/target/sh/archos/fm_v2/button-target.h47
-rw-r--r--firmware/target/sh/archos/fm_v2/power-fm_v2.c115
-rw-r--r--firmware/target/sh/archos/fm_v2/powermgmt-fm_v2.c60
-rw-r--r--firmware/target/sh/archos/fm_v2/usb-fm_v2.c49
-rw-r--r--firmware/target/sh/archos/i2c-archos.c254
-rw-r--r--firmware/target/sh/archos/lcd-archos-bitmap.c224
-rw-r--r--firmware/target/sh/archos/lcd-as-archos-bitmap.S354
-rw-r--r--firmware/target/sh/archos/mascodec-archos.c491
-rw-r--r--firmware/target/sh/archos/ondio/adc-target.h37
-rw-r--r--firmware/target/sh/archos/ondio/ata_mmc.c978
-rw-r--r--firmware/target/sh/archos/ondio/backlight-target.h49
-rw-r--r--firmware/target/sh/archos/ondio/button-ondio.c71
-rw-r--r--firmware/target/sh/archos/ondio/button-target.h39
-rw-r--r--firmware/target/sh/archos/ondio/fmradio_i2c-ondio.c202
-rw-r--r--firmware/target/sh/archos/ondio/power-ondio.c78
-rw-r--r--firmware/target/sh/archos/ondio/powermgmt-ondio.c53
-rw-r--r--firmware/target/sh/archos/ondio/usb-ondio.c61
-rw-r--r--firmware/target/sh/archos/player/adc-target.h35
-rw-r--r--firmware/target/sh/archos/player/backlight-target.h46
-rw-r--r--firmware/target/sh/archos/player/button-player.c76
-rw-r--r--firmware/target/sh/archos/player/button-target.h52
-rw-r--r--firmware/target/sh/archos/player/hwcompat-player.c28
-rw-r--r--firmware/target/sh/archos/player/lcd-as-player.S274
-rw-r--r--firmware/target/sh/archos/player/lcd-player.c213
-rw-r--r--firmware/target/sh/archos/player/power-player.c84
-rw-r--r--firmware/target/sh/archos/player/powermgmt-player.c64
-rw-r--r--firmware/target/sh/archos/player/usb-player.c44
-rw-r--r--firmware/target/sh/archos/recorder/adc-target.h41
-rw-r--r--firmware/target/sh/archos/recorder/backlight-target.h51
-rw-r--r--firmware/target/sh/archos/recorder/button-recorder.c110
-rw-r--r--firmware/target/sh/archos/recorder/button-target.h59
-rw-r--r--firmware/target/sh/archos/recorder/power-recorder.c107
-rw-r--r--firmware/target/sh/archos/recorder/powermgmt-recorder.c501
-rw-r--r--firmware/target/sh/archos/recorder/powermgmt-target.h89
-rw-r--r--firmware/target/sh/archos/recorder/usb-recorder.c49
-rw-r--r--firmware/target/sh/archos/timer-archos.c84
-rw-r--r--firmware/target/sh/archos/uart-archos.c167
-rw-r--r--firmware/target/sh/bitswap.S152
-rw-r--r--firmware/target/sh/crt0.S219
-rw-r--r--firmware/target/sh/debug-sh.c285
-rw-r--r--firmware/target/sh/kernel-sh.c65
-rw-r--r--firmware/target/sh/system-sh.c450
-rw-r--r--firmware/target/sh/system-target.h154
-rw-r--r--firmware/test/buflib/Makefile67
-rw-r--r--firmware/test/buflib/autoconf.h2
-rw-r--r--firmware/test/buflib/system-hosted.h43
-rw-r--r--firmware/test/buflib/test_main.c88
-rw-r--r--firmware/test/buflib/test_main2.c108
-rw-r--r--firmware/test/buflib/test_max.c75
-rw-r--r--firmware/test/buflib/test_move.c63
-rw-r--r--firmware/test/buflib/test_move2.c132
-rw-r--r--firmware/test/buflib/test_shrink.c56
-rw-r--r--firmware/test/buflib/test_shrink_cb.c108
-rw-r--r--firmware/test/buflib/test_shrink_startchanged.c59
-rw-r--r--firmware/test/buflib/test_shrink_unaligned.c56
-rw-r--r--firmware/test/buflib/util.c61
-rw-r--r--firmware/test/buflib/util.h30
-rw-r--r--firmware/test/fat/Makefile49
-rw-r--r--firmware/test/fat/README32
-rw-r--r--firmware/test/fat/ata-sim.c68
-rw-r--r--firmware/test/fat/autoconf.h9
-rw-r--r--firmware/test/fat/main.c724
-rw-r--r--firmware/test/fat/test.sh146
-rw-r--r--firmware/test/fat/test16.sh135
-rw-r--r--firmware/test/i2c/Makefile53
-rw-r--r--firmware/test/i2c/app.lds36
-rw-r--r--firmware/test/i2c/gendata.c31
-rw-r--r--firmware/test/i2c/main.c1280
-rw-r--r--firmware/test/id3/Makefile13
-rw-r--r--firmware/test/kernel/Makefile52
-rw-r--r--firmware/test/kernel/app.lds36
-rw-r--r--firmware/test/kernel/main.c104
-rw-r--r--firmware/test/snprintf/Makefile16
-rw-r--r--firmware/test/snprintf/test.c16
-rw-r--r--firmware/tuner.c5
-rw-r--r--firmware/usb.c2
-rw-r--r--flash/README7
-rw-r--r--flash/bootbox/Makefile75
-rw-r--r--flash/bootbox/SOURCES1
-rw-r--r--flash/bootbox/bootbox.make15
-rw-r--r--flash/bootbox/main.c224
-rw-r--r--flash/bootloader/Makefile81
-rw-r--r--flash/bootloader/README4
-rw-r--r--flash/bootloader/bootloader.c467
-rw-r--r--flash/bootloader/bootloader.h109
-rw-r--r--flash/bootloader/bootloader.lds34
-rw-r--r--flash/bootloader/no_rom.lds62
-rw-r--r--flash/extract/README5
-rw-r--r--flash/extract/extract.c147
-rw-r--r--flash/extract/extract.dsp100
-rw-r--r--flash/make_firmware/README20
-rw-r--r--flash/make_firmware/make_firmware.c359
-rw-r--r--flash/make_firmware/make_firmware.dsp96
-rw-r--r--flash/minimon/Makefile53
-rw-r--r--flash/minimon/README9
-rw-r--r--flash/minimon/minimon.c156
-rw-r--r--flash/minimon/minimon.h24
-rw-r--r--flash/minimon/minimon.lds60
-rw-r--r--flash/uart_boot/Makefile19
-rw-r--r--flash/uart_boot/README8
-rw-r--r--flash/uart_boot/client.c737
-rw-r--r--flash/uart_boot/client.h22
-rw-r--r--flash/uart_boot/flash.c78
-rw-r--r--flash/uart_boot/flash.h10
-rw-r--r--flash/uart_boot/minimon.h24
-rw-r--r--flash/uart_boot/scalar_types.h45
-rw-r--r--flash/uart_boot/uart.h57
-rw-r--r--flash/uart_boot/uart_boot.c370
-rw-r--r--flash/uart_boot/uart_boot.dsp130
-rw-r--r--flash/uart_boot/uart_win.c139
-rw-r--r--gdb/Makefile37
-rw-r--r--gdb/sh-stub.c1618
-rw-r--r--lib/libsetjmp/SOURCES4
-rw-r--r--lib/libsetjmp/setjmp.h11
-rw-r--r--lib/libsetjmp/sh/asm.h42
-rw-r--r--lib/libsetjmp/sh/setjmp.S194
-rw-r--r--manual/advanced_topics/archos-flashing.tex195
-rwxr-xr-xmanual/advanced_topics/main.tex23
-rw-r--r--manual/appendix/appendix.tex42
-rw-r--r--manual/appendix/config_file_options.tex6
-rw-r--r--manual/appendix/file_formats.tex12
-rw-r--r--manual/appendix/images/icon-ucl.pngbin909 -> 0 bytes
-rw-r--r--manual/appendix/wps_tags.tex58
-rwxr-xr-xmanual/configure_rockbox/display_options.tex4
-rw-r--r--manual/configure_rockbox/playback_options.tex2
-rw-r--r--manual/configure_rockbox/recording_settings.tex5
-rw-r--r--manual/configure_rockbox/sound_settings.tex2
-rwxr-xr-xmanual/configure_rockbox/system_options.tex11
-rw-r--r--manual/configure_rockbox/theme_settings.tex11
-rw-r--r--manual/getting_started/archos_choice.tex53
-rw-r--r--manual/getting_started/installation.tex45
-rw-r--r--manual/main_menu/fmradio.tex52
-rw-r--r--manual/main_menu/main.tex16
-rw-r--r--manual/main_menu/recording_screen.tex11
-rw-r--r--manual/platform/archosfmrecorder.tex26
-rw-r--r--manual/platform/archosondiofm.tex28
-rw-r--r--manual/platform/archosondiosp.tex28
-rw-r--r--manual/platform/archosplayer.tex27
-rw-r--r--manual/platform/archosrecorder.tex27
-rw-r--r--manual/plugins/alpinecdc.tex39
-rw-r--r--manual/plugins/blackjack.tex12
-rw-r--r--manual/plugins/brickmania.tex7
-rw-r--r--manual/plugins/bubbles.tex8
-rw-r--r--manual/plugins/calculator.tex16
-rw-r--r--manual/plugins/calendar.tex8
-rw-r--r--manual/plugins/chess_clock.tex35
-rw-r--r--manual/plugins/chessbox.tex14
-rw-r--r--manual/plugins/chip8emulator.tex18
-rw-r--r--manual/plugins/chopper.tex4
-rw-r--r--manual/plugins/clix.tex9
-rw-r--r--manual/plugins/cube.tex17
-rw-r--r--manual/plugins/flipit.tex18
-rw-r--r--manual/plugins/fractals.tex13
-rw-r--r--manual/plugins/goban.tex52
-rw-r--r--manual/plugins/imageviewer.tex14
-rw-r--r--manual/plugins/jewels.tex9
-rw-r--r--manual/plugins/lrcplayer.tex5
-rw-r--r--manual/plugins/main.tex25
-rw-r--r--manual/plugins/minesweeper.tex10
-rw-r--r--manual/plugins/oscilloscope.tex16
-rw-r--r--manual/plugins/pegbox.tex13
-rw-r--r--manual/plugins/pictureflow.tex11
-rw-r--r--manual/plugins/pong.tex15
-rw-r--r--manual/plugins/rockblox.tex21
-rw-r--r--manual/plugins/rockboy.tex14
-rw-r--r--manual/plugins/sliding.tex8
-rw-r--r--manual/plugins/snake.tex5
-rw-r--r--manual/plugins/snake2.tex7
-rw-r--r--manual/plugins/sokoban.tex26
-rw-r--r--manual/plugins/solitaire.tex18
-rw-r--r--manual/plugins/spacerocks.tex13
-rw-r--r--manual/plugins/split_editor.tex193
-rw-r--r--manual/plugins/star.tex18
-rw-r--r--manual/plugins/stats.tex6
-rw-r--r--manual/plugins/stopwatch.tex18
-rw-r--r--manual/plugins/sudoku.tex12
-rw-r--r--manual/plugins/text_viewer.tex43
-rw-r--r--manual/plugins/vumeter.tex11
-rw-r--r--manual/plugins/wormlet.tex53
-rw-r--r--manual/plugins/xobox.tex9
-rw-r--r--manual/plugins/xworld.tex6
-rw-r--r--manual/plugins/zxbox.tex8
-rw-r--r--manual/rockbox_interface/browsing_and_playing.tex51
-rw-r--r--manual/rockbox_interface/main.tex396
-rw-r--r--manual/rockbox_interface/wps.tex141
-rw-r--r--tools/Makefile10
-rw-r--r--tools/builds.pm15
-rwxr-xr-xtools/buildzip.pl8
-rwxr-xr-xtools/configure234
-rwxr-xr-xtools/rockboxdev.sh10
-rw-r--r--tools/root.make44
-rw-r--r--tools/scramble.c157
-rw-r--r--tools/sh2d.c573
-rw-r--r--tools/toolchain-patches/gcc-4.0.3-rockbox-1.diff75
-rw-r--r--tools/tools.make4
-rw-r--r--tools/voicefont.c45
-rw-r--r--uisimulator/bitmaps/UI-archosav300.bmpbin428454 -> 0 bytes
-rw-r--r--uisimulator/bitmaps/UI-archosfmrecorder.bmpbin236864 -> 0 bytes
-rw-r--r--uisimulator/bitmaps/UI-archosondiofm.bmpbin104264 -> 0 bytes
-rw-r--r--uisimulator/bitmaps/UI-archosondiosp.bmpbin104264 -> 0 bytes
-rw-r--r--uisimulator/bitmaps/UI-archosplayer.bmpbin238616 -> 0 bytes
-rw-r--r--uisimulator/bitmaps/UI-archosrecorder.bmpbin219296 -> 0 bytes
-rw-r--r--uisimulator/bitmaps/UI-archosrecorderv2.bmpbin236864 -> 0 bytes
-rw-r--r--uisimulator/buttonmap/SOURCES6
-rw-r--r--uisimulator/buttonmap/archos-ondio.c69
-rw-r--r--uisimulator/buttonmap/archos-player.c68
-rw-r--r--uisimulator/buttonmap/archos-recorder.c104
-rw-r--r--uisimulator/common/stubs.c52
384 files changed, 649 insertions, 43226 deletions
diff --git a/.gitignore b/.gitignore
index aa35be45f5..14ae9bcff7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -100,7 +100,6 @@ __pycache__
100 100
101# /tools/ 101# /tools/
102/tools/bdf2bmp 102/tools/bdf2bmp
103/tools/sh2d
104/tools/scramble 103/tools/scramble
105/tools/generate_rocklatin 104/tools/generate_rocklatin
106/tools/descramble 105/tools/descramble
@@ -109,7 +108,6 @@ __pycache__
109/tools/codepages 108/tools/codepages
110/tools/rdf2binary 109/tools/rdf2binary
111/tools/mkboot 110/tools/mkboot
112/tools/player_unifont
113/tools/uclpack 111/tools/uclpack
114/tools/ipod_fw 112/tools/ipod_fw
115/tools/wavtrim 113/tools/wavtrim
diff --git a/apps/SOURCES b/apps/SOURCES
index 107431d464..bf01dbcac4 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -75,9 +75,6 @@ iap/iap-lingo7.c
75#endif 75#endif
76#endif 76#endif
77screen_access.c 77screen_access.c
78#ifdef HAVE_BUTTONBAR
79gui/buttonbar.c
80#endif
81#ifdef HAVE_LCD_BITMAP 78#ifdef HAVE_LCD_BITMAP
82gui/icon.c 79gui/icon.c
83#endif 80#endif
@@ -208,12 +205,6 @@ keymaps/keymap-h1x0_h3x0.c
208 || (CONFIG_KEYPAD == IPOD_3G_PAD) \ 205 || (CONFIG_KEYPAD == IPOD_3G_PAD) \
209 || (CONFIG_KEYPAD == IPOD_1G2G_PAD)) 206 || (CONFIG_KEYPAD == IPOD_1G2G_PAD))
210keymaps/keymap-ipod.c 207keymaps/keymap-ipod.c
211#elif CONFIG_KEYPAD == RECORDER_PAD
212keymaps/keymap-recorder.c
213#elif CONFIG_KEYPAD == ONDIO_PAD
214keymaps/keymap-ondio.c
215#elif CONFIG_KEYPAD == PLAYER_PAD
216keymaps/keymap-player.c
217#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD 208#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
218keymaps/keymap-x5.c 209keymaps/keymap-x5.c
219#elif CONFIG_KEYPAD == IAUDIO_M3_PAD 210#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index bc272e2a85..8913558e6c 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -1004,16 +1004,7 @@ static bool view_battery(void)
1004 lcd_putsf(0, 2, "External: %d.%03d V", y / 1000, y % 1000); 1004 lcd_putsf(0, 2, "External: %d.%03d V", y / 1000, y % 1000);
1005#endif 1005#endif
1006#if CONFIG_CHARGING 1006#if CONFIG_CHARGING
1007#if defined ARCHOS_RECORDER 1007#if defined IPOD_NANO || defined IPOD_VIDEO
1008 lcd_putsf(0, 3, "Chgr: %s %s",
1009 charger_inserted() ? "present" : "absent",
1010 charger_enabled() ? "on" : "off");
1011 lcd_putsf(0, 5, "short delta: %d", short_delta);
1012 lcd_putsf(0, 6, "long delta: %d", long_delta);
1013 lcd_puts(0, 7, power_message);
1014 lcd_putsf(0, 8, "USB Inserted: %s",
1015 usb_inserted() ? "yes" : "no");
1016#elif defined IPOD_NANO || defined IPOD_VIDEO
1017 int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false; 1008 int usb_pwr = (GPIOL_INPUT_VAL & 0x10)?true:false;
1018 int ext_pwr = (GPIOL_INPUT_VAL & 0x08)?false:true; 1009 int ext_pwr = (GPIOL_INPUT_VAL & 0x08)?false:true;
1019 int dock = (GPIOA_INPUT_VAL & 0x10)?true:false; 1010 int dock = (GPIOA_INPUT_VAL & 0x10)?true:false;
@@ -1181,18 +1172,6 @@ static bool view_battery(void)
1181 1172
1182 case 3: /* remaining time estimation: */ 1173 case 3: /* remaining time estimation: */
1183 1174
1184#ifdef ARCHOS_RECORDER
1185 lcd_putsf(0, 0, "charge_state: %d", charge_state);
1186
1187 lcd_putsf(0, 1, "Cycle time: %d m", powermgmt_last_cycle_startstop_min);
1188
1189 lcd_putsf(0, 2, "Lvl@cyc st: %d%%", powermgmt_last_cycle_level);
1190
1191 lcd_putsf(0, 3, "P=%2d I=%2d", pid_p, pid_i);
1192
1193 lcd_putsf(0, 4, "Trickle sec: %d/60", trickle_sec);
1194#endif /* ARCHOS_RECORDER */
1195
1196#if (CONFIG_BATTERY_MEASURE & VOLTAGE_MEASURE) 1175#if (CONFIG_BATTERY_MEASURE & VOLTAGE_MEASURE)
1197 lcd_putsf(0, 5, "Last PwrHist: %d.%03dV", 1176 lcd_putsf(0, 5, "Last PwrHist: %d.%03dV",
1198 power_history[0] / 1000, 1177 power_history[0] / 1000,
@@ -1903,30 +1882,7 @@ static bool dbg_tagcache_info(void)
1903} 1882}
1904#endif 1883#endif
1905 1884
1906#if CONFIG_CPU == SH7034 1885#if defined CPU_COLDFIRE
1907static bool dbg_save_roms(void)
1908{
1909 int fd;
1910 int oldmode = system_memory_guard(MEMGUARD_NONE);
1911
1912 fd = creat("/internal_rom_0000-FFFF.bin", 0666);
1913 if(fd >= 0)
1914 {
1915 write(fd, (void *)0, 0x10000);
1916 close(fd);
1917 }
1918
1919 fd = creat("/internal_rom_2000000-203FFFF.bin", 0666);
1920 if(fd >= 0)
1921 {
1922 write(fd, (void *)0x2000000, 0x40000);
1923 close(fd);
1924 }
1925
1926 system_memory_guard(oldmode);
1927 return false;
1928}
1929#elif defined CPU_COLDFIRE
1930static bool dbg_save_roms(void) 1886static bool dbg_save_roms(void)
1931{ 1887{
1932 int fd; 1888 int fd;
@@ -2091,11 +2047,6 @@ static int radio_callback(int btn, struct gui_synclist *lists)
2091 simplelist_addline( 2047 simplelist_addline(
2092 "sd_set: %d Hz", lv24020lp_get(LV24020LP_SD_SET) ); 2048 "sd_set: %d Hz", lv24020lp_get(LV24020LP_SD_SET) );
2093#endif /* LV24020LP */ 2049#endif /* LV24020LP */
2094#if (CONFIG_TUNER & S1A0903X01)
2095 simplelist_addline(
2096 "Samsung regs: %08X", s1a0903x01_get(RADIO_ALL));
2097 /* This one doesn't return dynamic data atm */
2098#endif /* S1A0903X01 */
2099#if (CONFIG_TUNER & TEA5767) 2050#if (CONFIG_TUNER & TEA5767)
2100 struct tea5767_dbg_info nfo; 2051 struct tea5767_dbg_info nfo;
2101 tea5767_dbg_info(&nfo); 2052 tea5767_dbg_info(&nfo);
@@ -2218,7 +2169,7 @@ static bool dbg_metadatalog(void)
2218 return false; 2169 return false;
2219} 2170}
2220 2171
2221#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) 2172#if defined(CPU_COLDFIRE)
2222static bool dbg_set_memory_guard(void) 2173static bool dbg_set_memory_guard(void)
2223{ 2174{
2224 static const struct opt_items names[MAXMEMGUARD] = { 2175 static const struct opt_items names[MAXMEMGUARD] = {
@@ -2233,7 +2184,7 @@ static bool dbg_set_memory_guard(void)
2233 2184
2234 return false; 2185 return false;
2235} 2186}
2236#endif /* CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) */ 2187#endif /* defined(CPU_COLDFIRE) */
2237 2188
2238#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS) 2189#if defined(HAVE_EEPROM) && !defined(HAVE_EEPROM_SETTINGS)
2239static bool dbg_write_eeprom(void) 2190static bool dbg_write_eeprom(void)
@@ -2589,13 +2540,13 @@ static const struct {
2589 unsigned char *desc; /* string or ID */ 2540 unsigned char *desc; /* string or ID */
2590 bool (*function) (void); /* return true if USB was connected */ 2541 bool (*function) (void); /* return true if USB was connected */
2591} menuitems[] = { 2542} menuitems[] = {
2592#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || \ 2543#if defined(CPU_COLDFIRE) || \
2593 (defined(CPU_PP) && !(CONFIG_STORAGE & STORAGE_SD)) || \ 2544 (defined(CPU_PP) && !(CONFIG_STORAGE & STORAGE_SD)) || \
2594 CONFIG_CPU == IMX31L || defined(CPU_TCC780X) || CONFIG_CPU == AS3525v2 || \ 2545 CONFIG_CPU == IMX31L || defined(CPU_TCC780X) || CONFIG_CPU == AS3525v2 || \
2595 CONFIG_CPU == AS3525 || CONFIG_CPU == RK27XX 2546 CONFIG_CPU == AS3525 || CONFIG_CPU == RK27XX
2596 { "Dump ROM contents", dbg_save_roms }, 2547 { "Dump ROM contents", dbg_save_roms },
2597#endif 2548#endif
2598#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \ 2549#if defined(CPU_COLDFIRE) || defined(CPU_PP) \
2599 || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525 \ 2550 || CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L || CONFIG_CPU == AS3525 \
2600 || CONFIG_CPU == DM320 || defined(CPU_S5L870X) || CONFIG_CPU == AS3525v2 \ 2551 || CONFIG_CPU == DM320 || defined(CPU_S5L870X) || CONFIG_CPU == AS3525v2 \
2601 || CONFIG_CPU == RK27XX 2552 || CONFIG_CPU == RK27XX
@@ -2616,7 +2567,7 @@ static const struct {
2616#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) 2567#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR)
2617 { "S/PDIF analyzer", dbg_spdif }, 2568 { "S/PDIF analyzer", dbg_spdif },
2618#endif 2569#endif
2619#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) 2570#if defined(CPU_COLDFIRE)
2620 { "Catch mem accesses", dbg_set_memory_guard }, 2571 { "Catch mem accesses", dbg_set_memory_guard },
2621#endif 2572#endif
2622 { "View OS stacks", dbg_os }, 2573 { "View OS stacks", dbg_os },
diff --git a/apps/features.txt b/apps/features.txt
index 2e487943fe..7b50b4026c 100644
--- a/apps/features.txt
+++ b/apps/features.txt
@@ -80,14 +80,6 @@ lcd_invert
80lcd_sleep 80lcd_sleep
81#endif 81#endif
82 82
83#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
84masf
85#endif
86
87#if (CONFIG_CODEC == MAS3507D)
88masd
89#endif
90
91#if defined(HAVE_MORSE_INPUT) 83#if defined(HAVE_MORSE_INPUT)
92morse_input 84morse_input
93#endif 85#endif
@@ -115,13 +107,6 @@ radio_remote
115#endif 107#endif
116#endif 108#endif
117 109
118#if (CONFIG_KEYPAD == RECORDER_PAD)
119recorder_pad
120#if defined(CONFIG_TUNER)
121radio_screen_button_bar
122#endif
123#endif
124
125#if defined(HAVE_RECORDING) 110#if defined(HAVE_RECORDING)
126recording 111recording
127#if CONFIG_CODEC == SWCODEC 112#if CONFIG_CODEC == SWCODEC
@@ -158,10 +143,6 @@ rtc
158serial_port 143serial_port
159#endif 144#endif
160 145
161#if defined(ARCHOS_RECORDER) || defined(ARCHOS_PLAYER)
162soft_shutdown
163#endif
164
165#if defined(HAVE_SPDIF_POWER) 146#if defined(HAVE_SPDIF_POWER)
166spdif_power 147spdif_power
167#endif 148#endif
diff --git a/apps/gui/buttonbar.c b/apps/gui/buttonbar.c
deleted file mode 100644
index 48ef6d0994..0000000000
--- a/apps/gui/buttonbar.c
+++ /dev/null
@@ -1,131 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) Linus Nielsen Feltzing (2002)
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21/*
222005 Kevin Ferrare :
23 - Multi screen support
24 - Rewrote a lot of code to avoid global vars and make it accept eventually
25 more that 3 buttons on the bar (just the prototype of gui_buttonbar_set
26 and the constant BUTTONBAR_MAX_BUTTONS to modify)
272008 Jonathan Gordon
28 - redone to use viewports, items will NOT scroll in their vp.
29 Bar is always drawn at the bottom of the screen. This may be changed later.
30 Callers need to remember to adjust their viewports to not be overwitten
31*/
32#include "config.h"
33#include "buttonbar.h"
34#include "viewport.h"
35#include "lcd.h"
36#include "font.h"
37#include "string-extra.h"
38#include "settings.h"
39
40static struct viewport bb_vp[NB_SCREENS];
41void gui_buttonbar_init(struct gui_buttonbar * buttonbar)
42{
43 gui_buttonbar_unset(buttonbar);
44 FOR_NB_SCREENS(i)
45 {
46 viewport_set_defaults(&bb_vp[i], i);
47 bb_vp[i].font = FONT_SYSFIXED;
48 bb_vp[i].y = screens[i].lcdheight - BUTTONBAR_HEIGHT;
49 bb_vp[i].height = BUTTONBAR_HEIGHT;
50 bb_vp[i].drawmode = DRMODE_COMPLEMENT;
51 }
52}
53
54void gui_buttonbar_set_display(struct gui_buttonbar * buttonbar,
55 struct screen * display)
56{
57 buttonbar->display = display;
58}
59
60static void gui_buttonbar_draw_button(struct gui_buttonbar * buttonbar, int num)
61{
62 int button_width;
63 int fh, fw;
64 struct screen * display = buttonbar->display;
65 struct viewport vp = bb_vp[display->screen_type];
66
67 button_width = display->lcdwidth/BUTTONBAR_MAX_BUTTONS;
68 vp.width = button_width-1;
69 vp.x = button_width * num;
70 display->set_viewport(&vp);
71 display->fill_viewport();
72 if(buttonbar->caption[num][0] != 0)
73 {
74 display->getstringsize(buttonbar->caption[num], &fw, &fh);
75 display->putsxy((button_width - fw)/2,
76 (vp.height-fh)/2, buttonbar->caption[num]);
77 }
78 display->set_viewport(NULL);
79}
80
81void gui_buttonbar_set(struct gui_buttonbar * buttonbar,
82 const char *caption1,
83 const char *caption2,
84 const char *caption3)
85{
86 gui_buttonbar_unset(buttonbar);
87 if(caption1)
88 {
89 strlcpy(buttonbar->caption[0], caption1, BUTTONBAR_CAPTION_LENGTH);
90 }
91 if(caption2)
92 {
93 strlcpy(buttonbar->caption[1], caption2, BUTTONBAR_CAPTION_LENGTH);
94 }
95 if(caption3)
96 {
97 strlcpy(buttonbar->caption[2], caption3, BUTTONBAR_CAPTION_LENGTH);
98 }
99}
100
101void gui_buttonbar_unset(struct gui_buttonbar * buttonbar)
102{
103 int i;
104 for(i = 0;i < BUTTONBAR_MAX_BUTTONS;i++)
105 buttonbar->caption[i][0] = 0;
106}
107
108void gui_buttonbar_draw(struct gui_buttonbar * buttonbar)
109{
110 struct screen * display = buttonbar->display;
111 if(!global_settings.buttonbar || !gui_buttonbar_isset(buttonbar))
112 return;
113 int i;
114 display->set_viewport(&bb_vp[display->screen_type]);
115 display->clear_viewport();
116 for(i = 0;i < BUTTONBAR_MAX_BUTTONS;i++)
117 gui_buttonbar_draw_button(buttonbar, i);
118 display->set_viewport(&bb_vp[display->screen_type]);
119 display->update_viewport();
120 display->set_viewport(NULL);
121}
122
123bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar)
124{
125 /* If all buttons are unset, the button bar is considered disabled */
126 int i;
127 for(i = 0;i < BUTTONBAR_MAX_BUTTONS;i++)
128 if(buttonbar->caption[i][0] != 0)
129 return true;
130 return false;
131}
diff --git a/apps/gui/buttonbar.h b/apps/gui/buttonbar.h
deleted file mode 100644
index 884e3132bf..0000000000
--- a/apps/gui/buttonbar.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Kevin Ferrare
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _GUI_BUTTONBAR_H_
23#define _GUI_BUTTONBAR_H_
24#include "config.h"
25#include "button.h"
26#include "screen_access.h"
27
28
29#ifdef HAVE_BUTTONBAR
30#define BUTTONBAR_HEIGHT 8
31#define BUTTONBAR_MAX_BUTTONS 3
32#define BUTTONBAR_CAPTION_LENGTH 8
33
34
35struct gui_buttonbar
36{
37 char caption[BUTTONBAR_MAX_BUTTONS][BUTTONBAR_CAPTION_LENGTH];
38 struct screen * display;
39};
40
41/*
42 * Initializes the buttonbar
43 * - buttonbar : the buttonbar
44 */
45extern void gui_buttonbar_init(struct gui_buttonbar * buttonbar);
46
47/*
48 * Attach the buttonbar to a screen
49 * - buttonbar : the buttonbar
50 * - display : the display to attach the buttonbar
51 */
52extern void gui_buttonbar_set_display(struct gui_buttonbar * buttonbar,
53 struct screen * display);
54
55/*
56 * Set the caption of the items of the buttonbar
57 * - buttonbar : the buttonbar
58 * - caption1,2,3 : the first, second and thirds items of the bar
59 */
60extern void gui_buttonbar_set(struct gui_buttonbar * buttonbar,
61 const char *caption1,
62 const char *caption2,
63 const char *caption3);
64
65/*
66 * Disable the buttonbar
67 * - buttonbar : the buttonbar
68 */
69extern void gui_buttonbar_unset(struct gui_buttonbar * buttonbar);
70
71/*
72 * Draw the buttonbar on it's attached screen
73 * - buttonbar : the buttonbar
74 */
75extern void gui_buttonbar_draw(struct gui_buttonbar * buttonbar);
76
77/*
78 * Returns true if the buttonbar has something to display, false otherwise
79 * - buttonbar : the buttonbar
80 */
81extern bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar);
82#else
83#define BUTTONBAR_HEIGHT 0
84#endif
85#endif /* _GUI_BUTTONBAR_H_ */
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 425cab9a0f..8533f93275 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -553,10 +553,6 @@ void gui_synclist_set_viewport_defaults(struct viewport *vp,
553 enum screen_type screen) 553 enum screen_type screen)
554{ 554{
555 viewport_set_defaults(vp, screen); 555 viewport_set_defaults(vp, screen);
556#ifdef HAVE_BUTTONBAR
557 if (screens[screen].has_buttonbar)
558 vp->height -= BUTTONBAR_HEIGHT;
559#endif
560} 556}
561 557
562#ifdef HAVE_LCD_COLOR 558#ifdef HAVE_LCD_COLOR
diff --git a/apps/gui/option_select.h b/apps/gui/option_select.h
index 4ccc15a14e..7ca9a4ebbb 100644
--- a/apps/gui/option_select.h
+++ b/apps/gui/option_select.h
@@ -25,9 +25,8 @@
25#include "screen_access.h" 25#include "screen_access.h"
26#include "settings.h" 26#include "settings.h"
27 27
28#if defined (HAVE_SCROLLWHEEL) || \ 28#if defined (HAVE_SCROLLWHEEL)
29 (CONFIG_KEYPAD == PLAYER_PAD) 29/* Define this if your target makes sense to have
30/* Define this if your target makes sense to have
31 smaller values at the top of the list increasing down the list */ 30 smaller values at the top of the list increasing down the list */
32#define ASCENDING_INT_SETTINGS 31#define ASCENDING_INT_SETTINGS
33#endif 32#endif
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 1cff83eb9a..75c3203066 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -126,7 +126,7 @@ char* get_dir(char* buf, int buf_size, const char* path, int level)
126 return buf; 126 return buf;
127} 127}
128 128
129#if (CONFIG_CODEC != MAS3507D) && defined (HAVE_PITCHCONTROL) 129#if defined (HAVE_PITCHCONTROL)
130/* A helper to determine the enum value for pitch/speed. 130/* A helper to determine the enum value for pitch/speed.
131 131
132 When there are two choices (i.e. boolean), return 1 if the value is 132 When there are two choices (i.e. boolean), return 1 if the value is
@@ -1452,7 +1452,7 @@ const char *get_token_value(struct gui_wps *gwps,
1452 } 1452 }
1453#endif /* (CONFIG_CODEC == SWCODEC) */ 1453#endif /* (CONFIG_CODEC == SWCODEC) */
1454 1454
1455#if (CONFIG_CODEC != MAS3507D) && defined (HAVE_PITCHCONTROL) 1455#if defined (HAVE_PITCHCONTROL)
1456 case SKIN_TOKEN_SOUND_PITCH: 1456 case SKIN_TOKEN_SOUND_PITCH:
1457 { 1457 {
1458 int32_t pitch = sound_get_pitch(); 1458 int32_t pitch = sound_get_pitch();
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 194954c1d2..fad3255cdb 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -262,13 +262,6 @@ void viewportmanager_init()
262#ifdef HAVE_LCD_BITMAP 262#ifdef HAVE_LCD_BITMAP
263void viewportmanager_theme_changed(const int which) 263void viewportmanager_theme_changed(const int which)
264{ 264{
265#ifdef HAVE_BUTTONBAR
266 if (which & THEME_BUTTONBAR)
267 { /* don't handle further, the custom ui viewport ignores the buttonbar,
268 * as does viewport_set_defaults(), since only lists use it*/
269 screens[SCREEN_MAIN].has_buttonbar = global_settings.buttonbar;
270 }
271#endif
272 if (which & THEME_LANGUAGE) 265 if (which & THEME_LANGUAGE)
273 { 266 {
274 } 267 }
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index c27c434d12..a930edaded 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -355,10 +355,6 @@ bool ffwd_rew(int button)
355 if (!skin_get_global_state()->paused) 355 if (!skin_get_global_state()->paused)
356 audio_pause(); 356 audio_pause();
357#endif 357#endif
358#if CONFIG_KEYPAD == PLAYER_PAD
359 FOR_NB_SCREENS(i)
360 skin_get_gwps(WPS, i)->display->scroll_stop();
361#endif
362 if (direction > 0) 358 if (direction > 0)
363 status_set_ffmode(STATUS_FASTFORWARD); 359 status_set_ffmode(STATUS_FASTFORWARD);
364 else 360 else
diff --git a/apps/keymaps/keymap-ondio.c b/apps/keymaps/keymap-ondio.c
deleted file mode 100644
index 3a6f667601..0000000000
--- a/apps/keymaps/keymap-ondio.c
+++ /dev/null
@@ -1,252 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Jonathan Gordon
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22/* *
23 * Button Code Definitions for archos ondio fm/sp targets
24 */
25
26#include "config.h"
27#include "action.h"
28#include "button.h"
29#include "settings.h"
30
31/* CONTEXT_CUSTOM's used in this file...
32
33CONTEXT_CUSTOM|CONTEXT_TREE = the standard list/tree defines (without directions)
34
35
36*/
37
38static const struct button_mapping button_context_standard[] = {
39 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
40 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
41 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
42 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
43
44 { ACTION_STD_CONTEXT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
45 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
46 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
47 { ACTION_STD_MENU, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
48 { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
49
50 LAST_ITEM_IN_LIST
51};
52
53static const struct button_mapping button_context_wps[] = {
54 { ACTION_WPS_PLAY, BUTTON_OFF|BUTTON_REL, BUTTON_OFF },
55 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
56 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
57 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
58 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
59 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
60 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
61 { ACTION_WPS_STOP, BUTTON_OFF|BUTTON_REPEAT, BUTTON_OFF },
62 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
63 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
64 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
65 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
66 { ACTION_WPS_BROWSE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
67 { ACTION_WPS_CONTEXT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
68 /* { ACTION_WPS_MENU, BUTTON_NONE, BUTTON_NONE }, we can't have that */
69 { ACTION_STD_KEYLOCK, BUTTON_MENU|BUTTON_DOWN, BUTTON_NONE },
70 /* { ACTION_WPS_VIEW_PLAYLIST,BUTTON_NONE, BUTTON_NONE }, can't have this either */
71
72 LAST_ITEM_IN_LIST
73};
74
75static const struct button_mapping button_context_settings[] = {
76 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
77 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
78 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
79 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
80 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
81 { ACTION_STD_OK, BUTTON_LEFT, BUTTON_NONE },
82 { ACTION_STD_CANCEL, BUTTON_MENU, BUTTON_NONE },
83
84 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
85};
86
87static const struct button_mapping button_context_tree[] = {
88 { ACTION_TREE_WPS, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
89 { ACTION_TREE_STOP, BUTTON_OFF, BUTTON_NONE },
90 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
91
92 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
93}; /* button_context_listtree */
94
95static const struct button_mapping button_context_tree_scroll_lr[] = {
96 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
97 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
98 { ACTION_TREE_PGLEFT, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE },
99 { ACTION_TREE_ROOT_INIT, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_MENU|BUTTON_LEFT },
100 { ACTION_TREE_PGLEFT, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
101 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
102 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
103 { ACTION_TREE_PGRIGHT, BUTTON_MENU|BUTTON_RIGHT, BUTTON_NONE },
104 { ACTION_TREE_PGRIGHT, BUTTON_MENU|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
105
106 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_TREE),
107};
108
109static const struct button_mapping button_context_yesno[] = {
110 { ACTION_YESNO_ACCEPT, BUTTON_RIGHT, BUTTON_NONE },
111
112 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
113};
114
115static const struct button_mapping button_context_bmark[] = {
116 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
117 { ACTION_BMS_DELETE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
118
119 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
120}; /* button_context_settings_bmark */
121
122static const struct button_mapping button_context_pitchscreen[] = {
123 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
124 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
125 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
126 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
127 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
128 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
129 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
130 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
131 { ACTION_PS_TOGGLE_MODE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU },
132 { ACTION_PS_RESET, BUTTON_MENU, BUTTON_NONE },
133 { ACTION_PS_EXIT, BUTTON_OFF, BUTTON_NONE },
134
135 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
136}; /* button_context_pitchscreen */
137
138#ifdef HAVE_RECORDING
139static const struct button_mapping button_context_rectrigger[] = {
140 { ACTION_STD_OK, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
141 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_RECSCREEN)
142};
143static const struct button_mapping button_context_recscreen[] = {
144 { ACTION_REC_PAUSE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
145 { ACTION_SETTINGS_INC, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
146 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
147 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
148 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
149
150 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
151}; /* button_context_recscreen */
152#endif /* HAVE_RECORDING */
153
154static const struct button_mapping button_context_keyboard[] = {
155 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
156 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
157 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
158 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
159 { ACTION_KBD_SELECT, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
160 { ACTION_KBD_DONE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
161 { ACTION_KBD_ABORT, BUTTON_OFF, BUTTON_NONE },
162 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
163 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
164 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
165 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
166
167 LAST_ITEM_IN_LIST
168}; /* button_context_keyboard */
169
170static const struct button_mapping button_context_morse_input[] = {
171 { ACTION_KBD_CURSOR_LEFT, BUTTON_LEFT, BUTTON_NONE },
172 { ACTION_KBD_CURSOR_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
173 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
174 { ACTION_KBD_CURSOR_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
175 { ACTION_KBD_BACKSPACE, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
176 { ACTION_KBD_DONE, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE },
177 { ACTION_KBD_ABORT, BUTTON_OFF, BUTTON_NONE },
178 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
179 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
180 { ACTION_KBD_SELECT, BUTTON_UP, BUTTON_NONE },
181 { ACTION_KBD_MORSE_SELECT, BUTTON_UP|BUTTON_REL, BUTTON_NONE },
182
183 LAST_ITEM_IN_LIST
184}; /* button_context_morse_input */
185
186#if CONFIG_TUNER
187static const struct button_mapping button_context_radio[] = {
188 { ACTION_FM_MENU, BUTTON_MENU | BUTTON_REPEAT, BUTTON_NONE },
189 { ACTION_FM_RECORD_DBLPRE, BUTTON_MENU, BUTTON_NONE},
190 { ACTION_FM_RECORD, BUTTON_MENU | BUTTON_REL, BUTTON_NONE },
191 { ACTION_FM_STOP, BUTTON_OFF | BUTTON_REPEAT, BUTTON_OFF },
192 { ACTION_FM_EXIT, BUTTON_OFF | BUTTON_REL, BUTTON_OFF },
193 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
194 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
195 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
196 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
197
198#ifndef HAS_BUTTON_HOLD
199 { ACTION_STD_KEYLOCK, BUTTON_MENU|BUTTON_DOWN, BUTTON_NONE },
200#endif
201
202 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
203
204};
205#endif
206
207const struct button_mapping* get_context_mapping( int context )
208{
209 switch( context )
210 {
211 case CONTEXT_STD:
212 return button_context_standard;
213
214 case CONTEXT_WPS:
215 return button_context_wps;
216
217 case CONTEXT_SETTINGS:
218 return button_context_settings;
219
220 case CONTEXT_YESNOSCREEN:
221 return button_context_yesno;
222
223 case CONTEXT_BOOKMARKSCREEN:
224 return button_context_bmark;
225 case CONTEXT_PITCHSCREEN:
226 return button_context_pitchscreen;
227 case CONTEXT_TREE:
228 case CONTEXT_MAINMENU:
229 if (global_settings.hold_lr_for_scroll_in_list)
230 return button_context_tree_scroll_lr;
231 /* else fall through to CUSTOM|CONTEXT_TREE */
232 case CONTEXT_CUSTOM|CONTEXT_TREE:
233 return button_context_tree;
234#ifdef HAVE_RECORDING
235 case CONTEXT_RECSCREEN:
236 return button_context_recscreen;
237 case CONTEXT_SETTINGS_RECTRIGGER:
238 return button_context_rectrigger;
239#endif
240 case CONTEXT_KEYBOARD:
241 return button_context_keyboard;
242 case CONTEXT_MORSE_INPUT:
243 return button_context_morse_input;
244#if CONFIG_TUNER
245 case CONTEXT_FM:
246 return button_context_radio;
247#endif
248 case CONTEXT_LIST:
249 default:
250 return button_context_standard;
251 }
252}
diff --git a/apps/keymaps/keymap-player.c b/apps/keymaps/keymap-player.c
deleted file mode 100644
index bcfb4869df..0000000000
--- a/apps/keymaps/keymap-player.c
+++ /dev/null
@@ -1,165 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Jonathan Gordon
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22/* *
23 * Button Code Definitions for archos player targets
24 *
25 */
26
27#include "config.h"
28#include "action.h"
29#include "button.h"
30
31static const struct button_mapping button_context_standard[] = {
32 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
33 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
34 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
35 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
36
37 { ACTION_STD_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
38 { ACTION_STD_CANCEL, BUTTON_STOP, BUTTON_NONE },
39 { ACTION_STD_OK, BUTTON_ON, BUTTON_NONE },
40 { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
41 { ACTION_STD_MENU, BUTTON_MENU, BUTTON_NONE },
42
43 LAST_ITEM_IN_LIST
44};
45
46static const struct button_mapping button_context_wps[] = {
47 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
48 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
49 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
50 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
51 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
52 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
53 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
54 { ACTION_WPS_STOP, BUTTON_STOP, BUTTON_NONE },
55
56 { ACTION_WPS_VOLDOWN, BUTTON_MENU|BUTTON_LEFT, BUTTON_NONE },
57 { ACTION_WPS_VOLDOWN, BUTTON_MENU|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
58 { ACTION_WPS_VOLUP, BUTTON_MENU|BUTTON_RIGHT, BUTTON_NONE },
59 { ACTION_WPS_VOLUP, BUTTON_MENU|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
60
61 { ACTION_WPS_BROWSE, BUTTON_ON|BUTTON_REL, BUTTON_ON },
62 { ACTION_WPS_MENU, BUTTON_MENU|BUTTON_REL, BUTTON_MENU },
63 { ACTION_WPS_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
64 { ACTION_STD_KEYLOCK, BUTTON_MENU|BUTTON_STOP, BUTTON_NONE },
65 { ACTION_WPS_HOTKEY, BUTTON_MENU|BUTTON_ON, BUTTON_NONE },
66
67 LAST_ITEM_IN_LIST
68};
69
70static const struct button_mapping button_context_settings[] = {
71 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
72 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
73 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
74 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
75
76 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
77};
78
79static const struct button_mapping button_context_tree[] = {
80 { ACTION_TREE_WPS, BUTTON_ON, BUTTON_NONE },
81 { ACTION_TREE_HOTKEY, BUTTON_MENU|BUTTON_ON, BUTTON_NONE },
82
83 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
84}; /* button_context_listtree */
85
86static const struct button_mapping button_context_yesno[] = {
87 { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE },
88
89 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
90}; /* button_context_settings_yesno */
91
92static const struct button_mapping button_context_bmark[] = {
93 { ACTION_NONE, BUTTON_ON, BUTTON_NONE },
94 { ACTION_BMS_DELETE, BUTTON_PLAY|BUTTON_ON, BUTTON_NONE },
95
96 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
97}; /* button_context_settings_bmark */
98
99/*****************************************************************************
100 * Remote control mappings
101 *****************************************************************************/
102
103static const struct button_mapping remote_button_context_standard[] = {
104 { ACTION_STD_PREV, BUTTON_RC_LEFT, BUTTON_NONE },
105 { ACTION_STD_NEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
106 { ACTION_STD_CANCEL, BUTTON_RC_STOP, BUTTON_NONE },
107 { ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE },
108
109 LAST_ITEM_IN_LIST
110};
111
112static const struct button_mapping remote_button_context_wps[] = {
113 { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
114 { ACTION_WPS_SKIPNEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
115 { ACTION_WPS_SKIPPREV, BUTTON_RC_LEFT, BUTTON_NONE },
116 { ACTION_WPS_STOP, BUTTON_RC_STOP, BUTTON_NONE },
117
118 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
119 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
120
121 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
122};
123
124
125static const struct button_mapping* get_context_mapping_remote( int context )
126{
127 context ^= CONTEXT_REMOTE;
128
129 switch (context)
130 {
131 case CONTEXT_WPS:
132 return remote_button_context_wps;
133
134 default:
135 return remote_button_context_standard;
136 }
137}
138
139const struct button_mapping* get_context_mapping( int context )
140{
141 if (context&CONTEXT_REMOTE)
142 return get_context_mapping_remote(context);
143
144 switch (context)
145 {
146 case CONTEXT_WPS:
147 return button_context_wps;
148
149 case CONTEXT_SETTINGS:
150 return button_context_settings;
151
152 case CONTEXT_YESNOSCREEN:
153 return button_context_yesno;
154
155 case CONTEXT_TREE:
156 case CONTEXT_MAINMENU:
157 return button_context_tree;
158 case CONTEXT_BOOKMARKSCREEN:
159 return button_context_bmark;
160 case CONTEXT_STD:
161 case CONTEXT_LIST:
162 default:
163 return button_context_standard;
164 }
165}
diff --git a/apps/keymaps/keymap-recorder.c b/apps/keymaps/keymap-recorder.c
deleted file mode 100644
index da3b5b525e..0000000000
--- a/apps/keymaps/keymap-recorder.c
+++ /dev/null
@@ -1,312 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Antoine Cellerier <dionoea @t videolan d.t org>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22/* *
23 * Button Code Definitions for archos recorder target
24 *
25 * \TODO handle F3
26 */
27
28#include "config.h"
29#include "action.h"
30#include "button.h"
31#include "settings.h"
32
33/* CONTEXT_CUSTOM's used in this file...
34
35CONTEXT_CUSTOM|1 = the standard list/tree defines (without directions)
36
37
38*/
39
40static const struct button_mapping button_context_standard[] = {
41 { ACTION_STD_PREV, BUTTON_UP, BUTTON_NONE },
42 { ACTION_STD_PREVREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
43 { ACTION_STD_NEXT, BUTTON_DOWN, BUTTON_NONE },
44 { ACTION_STD_NEXTREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
45
46 { ACTION_STD_OK, BUTTON_ON, BUTTON_NONE },
47 { ACTION_STD_OK, BUTTON_RIGHT, BUTTON_NONE },
48 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT },
49
50 { ACTION_STD_OK, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
51 { ACTION_STD_MENU, BUTTON_F1, BUTTON_NONE },
52 { ACTION_STD_QUICKSCREEN, BUTTON_F2, BUTTON_NONE },
53 { ACTION_STD_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
54 { ACTION_STD_CANCEL, BUTTON_OFF, BUTTON_NONE },
55 { ACTION_STD_CANCEL, BUTTON_LEFT, BUTTON_NONE },
56 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
57 { ACTION_F3, BUTTON_F3, BUTTON_NONE },
58
59 LAST_ITEM_IN_LIST
60};
61
62static const struct button_mapping button_context_wps[] = {
63 { ACTION_NONE, BUTTON_ON, BUTTON_NONE },
64 { ACTION_WPS_PLAY, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY },
65 { ACTION_WPS_SKIPNEXT, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
66 { ACTION_WPS_SKIPPREV, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
67 { ACTION_WPS_SEEKBACK, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
68 { ACTION_WPS_SEEKFWD, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
69 { ACTION_WPS_STOPSEEK, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT|BUTTON_REPEAT },
70 { ACTION_WPS_STOPSEEK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT|BUTTON_REPEAT },
71 { ACTION_WPS_STOP, BUTTON_OFF|BUTTON_REL, BUTTON_OFF },
72 { ACTION_WPS_VOLDOWN, BUTTON_DOWN, BUTTON_NONE },
73 { ACTION_WPS_VOLDOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
74 { ACTION_WPS_VOLUP, BUTTON_UP, BUTTON_NONE },
75 { ACTION_WPS_VOLUP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
76 { ACTION_WPS_MENU, BUTTON_F1|BUTTON_REL, BUTTON_F1 },
77 { ACTION_WPS_CONTEXT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_PLAY },
78 { ACTION_WPS_QUICKSCREEN, BUTTON_F2|BUTTON_REPEAT, BUTTON_NONE },
79 { ACTION_WPS_HOTKEY, BUTTON_F2|BUTTON_REL, BUTTON_F2 },
80 { ACTION_WPS_BROWSE, BUTTON_ON|BUTTON_REL, BUTTON_ON },
81 { ACTION_WPS_ID3SCREEN, BUTTON_F1|BUTTON_ON, BUTTON_NONE },
82 { ACTION_WPS_PITCHSCREEN, BUTTON_ON|BUTTON_UP, BUTTON_ON },
83 { ACTION_WPS_PITCHSCREEN, BUTTON_ON|BUTTON_DOWN, BUTTON_ON },
84 { ACTION_STD_KEYLOCK, BUTTON_F1|BUTTON_DOWN, BUTTON_NONE },
85 { ACTION_F3, BUTTON_F3, BUTTON_NONE },
86 { ACTION_WPS_ABSETB_NEXTDIR, BUTTON_ON|BUTTON_RIGHT, BUTTON_NONE },
87 { ACTION_WPS_ABSETA_PREVDIR, BUTTON_ON|BUTTON_LEFT, BUTTON_NONE },
88 { ACTION_WPS_ABRESET, BUTTON_ON|BUTTON_OFF, BUTTON_ON },
89
90
91 LAST_ITEM_IN_LIST
92};
93
94static const struct button_mapping button_context_settings[] = {
95 { ACTION_SETTINGS_INC, BUTTON_UP, BUTTON_NONE },
96 { ACTION_SETTINGS_INCREPEAT, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
97 { ACTION_SETTINGS_DEC, BUTTON_DOWN, BUTTON_NONE },
98 { ACTION_SETTINGS_DECREPEAT, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
99 { ACTION_STD_PREV, BUTTON_LEFT, BUTTON_NONE },
100 { ACTION_STD_PREVREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
101 { ACTION_STD_NEXT, BUTTON_RIGHT, BUTTON_NONE },
102 { ACTION_STD_NEXTREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
103
104 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
105};
106
107static const struct button_mapping button_context_tree[] = {
108 { ACTION_TREE_WPS, BUTTON_ON|BUTTON_REL, BUTTON_ON },
109 { ACTION_TREE_STOP, BUTTON_OFF, BUTTON_NONE },
110 { ACTION_TREE_HOTKEY, BUTTON_F2|BUTTON_REL, BUTTON_F2 },
111 { ACTION_NONE, BUTTON_ON, BUTTON_NONE },
112 { ACTION_LISTTREE_PGUP, BUTTON_ON|BUTTON_UP, BUTTON_NONE },
113 { ACTION_LISTTREE_PGUP, BUTTON_ON|BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
114 { ACTION_LISTTREE_PGDOWN, BUTTON_ON|BUTTON_DOWN, BUTTON_NONE },
115 { ACTION_LISTTREE_PGDOWN, BUTTON_ON|BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
116 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
117}; /* button_context_listtree */
118
119
120static const struct button_mapping button_context_tree_scroll_lr[] = {
121 { ACTION_NONE, BUTTON_LEFT, BUTTON_NONE },
122 { ACTION_STD_CANCEL, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT },
123 { ACTION_TREE_ROOT_INIT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT },
124 { ACTION_TREE_PGLEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
125 { ACTION_NONE, BUTTON_RIGHT, BUTTON_NONE },
126 { ACTION_STD_OK, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT },
127 { ACTION_TREE_PGRIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
128 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1),
129};
130
131static const struct button_mapping button_context_yesno[] = {
132 { ACTION_YESNO_ACCEPT, BUTTON_PLAY, BUTTON_NONE },
133
134 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
135};
136static const struct button_mapping button_context_quickscreen[] = {
137 { ACTION_QS_TOP, BUTTON_UP, BUTTON_NONE },
138 { ACTION_QS_TOP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
139 { ACTION_QS_DOWN, BUTTON_DOWN, BUTTON_NONE },
140 { ACTION_QS_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
141 { ACTION_QS_LEFT, BUTTON_LEFT, BUTTON_NONE },
142 { ACTION_QS_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
143 { ACTION_QS_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
144 { ACTION_QS_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
145 { ACTION_STD_CANCEL, BUTTON_PLAY, BUTTON_NONE },
146
147 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
148}; /* button_context_quickscreen */
149
150static const struct button_mapping button_context_pitchscreen[] = {
151 { ACTION_PS_INC_SMALL, BUTTON_UP, BUTTON_NONE },
152 { ACTION_PS_INC_BIG, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
153 { ACTION_PS_DEC_SMALL, BUTTON_DOWN, BUTTON_NONE },
154 { ACTION_PS_DEC_BIG, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
155 { ACTION_PS_NUDGE_LEFT, BUTTON_LEFT, BUTTON_NONE },
156 { ACTION_PS_NUDGE_LEFTOFF, BUTTON_LEFT|BUTTON_REL, BUTTON_NONE },
157 { ACTION_PS_NUDGE_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
158 { ACTION_PS_NUDGE_RIGHTOFF, BUTTON_RIGHT|BUTTON_REL, BUTTON_NONE },
159 { ACTION_PS_TOGGLE_MODE, BUTTON_F1, BUTTON_NONE },
160 { ACTION_PS_RESET, BUTTON_ON, BUTTON_NONE },
161 { ACTION_PS_EXIT, BUTTON_OFF, BUTTON_NONE },
162
163 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
164}; /* button_context_pitchcreen */
165
166static const struct button_mapping button_context_recscreen[] = {
167 { ACTION_REC_PAUSE, BUTTON_PLAY, BUTTON_NONE },
168 { ACTION_REC_F2, BUTTON_F2, BUTTON_NONE },
169 { ACTION_REC_F3, BUTTON_F3, BUTTON_NONE },
170 { ACTION_SETTINGS_INC, BUTTON_RIGHT, BUTTON_NONE },
171 { ACTION_SETTINGS_INCREPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
172 { ACTION_SETTINGS_DEC, BUTTON_LEFT, BUTTON_NONE },
173 { ACTION_SETTINGS_DECREPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
174
175 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
176}; /* button_context_recscreen */
177
178static const struct button_mapping button_context_keyboard[] = {
179 { ACTION_KBD_LEFT, BUTTON_LEFT, BUTTON_NONE },
180 { ACTION_KBD_LEFT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
181 { ACTION_KBD_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
182 { ACTION_KBD_RIGHT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
183 { ACTION_KBD_CURSOR_LEFT, BUTTON_ON|BUTTON_LEFT, BUTTON_NONE },
184 { ACTION_KBD_CURSOR_LEFT, BUTTON_ON|BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
185 { ACTION_KBD_CURSOR_RIGHT, BUTTON_ON|BUTTON_RIGHT, BUTTON_NONE },
186 { ACTION_KBD_CURSOR_RIGHT, BUTTON_ON|BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
187 { ACTION_KBD_SELECT, BUTTON_PLAY, BUTTON_NONE },
188 { ACTION_KBD_PAGE_FLIP, BUTTON_F1, BUTTON_NONE },
189 { ACTION_KBD_DONE, BUTTON_F2, BUTTON_NONE },
190 { ACTION_KBD_ABORT, BUTTON_OFF, BUTTON_NONE },
191 { ACTION_KBD_BACKSPACE, BUTTON_F3, BUTTON_NONE },
192 { ACTION_KBD_BACKSPACE, BUTTON_F3|BUTTON_REPEAT, BUTTON_NONE },
193 { ACTION_KBD_UP, BUTTON_UP, BUTTON_NONE },
194 { ACTION_KBD_UP, BUTTON_UP|BUTTON_REPEAT, BUTTON_NONE },
195 { ACTION_KBD_DOWN, BUTTON_DOWN, BUTTON_NONE },
196 { ACTION_KBD_DOWN, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE },
197 { ACTION_KBD_MORSE_SELECT, BUTTON_PLAY|BUTTON_REL, BUTTON_NONE },
198
199 LAST_ITEM_IN_LIST
200}; /* button_context_keyboard */
201
202static const struct button_mapping button_context_bmark[] = {
203 { ACTION_NONE, BUTTON_ON, BUTTON_NONE },
204 { ACTION_BMS_DELETE, BUTTON_PLAY|BUTTON_ON, BUTTON_NONE },
205
206 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST),
207
208}; /* button_context_settings_bmark */
209
210static const struct button_mapping button_context_radio[] = {
211 { ACTION_FM_MENU, BUTTON_F1, BUTTON_NONE },
212 { ACTION_FM_PRESET, BUTTON_F2|BUTTON_REL, BUTTON_F2 },
213 { ACTION_FM_RECORD, BUTTON_F3, BUTTON_NONE },
214 { ACTION_FM_FREEZE, BUTTON_PLAY, BUTTON_NONE },
215 { ACTION_FM_STOP, BUTTON_OFF, BUTTON_NONE },
216 { ACTION_FM_MODE, BUTTON_ON | BUTTON_REPEAT, BUTTON_ON },
217 { ACTION_FM_EXIT, BUTTON_ON | BUTTON_REL, BUTTON_ON },
218
219 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_SETTINGS)
220
221};
222
223#if BUTTON_REMOTE != 0
224/*****************************************************************************
225 * Remote control mappings
226 *****************************************************************************/
227
228static const struct button_mapping remote_button_context_standard[] = {
229 { ACTION_STD_PREV, BUTTON_RC_LEFT, BUTTON_NONE },
230 { ACTION_STD_NEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
231 { ACTION_STD_CANCEL, BUTTON_RC_STOP, BUTTON_NONE },
232 { ACTION_STD_OK, BUTTON_RC_PLAY, BUTTON_NONE },
233
234 LAST_ITEM_IN_LIST
235};
236
237static const struct button_mapping remote_button_context_wps[] = {
238 { ACTION_WPS_PLAY, BUTTON_RC_PLAY, BUTTON_NONE },
239 { ACTION_WPS_SKIPNEXT, BUTTON_RC_RIGHT, BUTTON_NONE },
240 { ACTION_WPS_SKIPPREV, BUTTON_RC_LEFT, BUTTON_NONE },
241 { ACTION_WPS_STOP, BUTTON_RC_STOP, BUTTON_NONE },
242
243 { ACTION_WPS_VOLDOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE },
244 { ACTION_WPS_VOLUP, BUTTON_RC_VOL_UP, BUTTON_NONE },
245
246 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
247};
248
249
250static const struct button_mapping* get_context_mapping_remote( int context )
251{
252 context ^= CONTEXT_REMOTE;
253
254 switch (context)
255 {
256 case CONTEXT_WPS:
257 return remote_button_context_wps;
258
259 default:
260 return remote_button_context_standard;
261 }
262}
263#endif /* BUTTON_REMOTE != 0 */
264
265const struct button_mapping* get_context_mapping( int context )
266{
267#if BUTTON_REMOTE != 0
268 if (context&CONTEXT_REMOTE)
269 return get_context_mapping_remote(context);
270#endif
271
272 switch( context )
273 {
274 case CONTEXT_WPS:
275 return button_context_wps;
276 case CONTEXT_SETTINGS_TIME:
277 case CONTEXT_SETTINGS:
278 return button_context_settings;
279
280 case CONTEXT_YESNOSCREEN:
281 return button_context_yesno;
282
283 case CONTEXT_PITCHSCREEN:
284 return button_context_pitchscreen;
285 case CONTEXT_BOOKMARKSCREEN:
286 return button_context_bmark;
287 case CONTEXT_TREE:
288 case CONTEXT_MAINMENU:
289 if (global_settings.hold_lr_for_scroll_in_list)
290 return button_context_tree_scroll_lr;
291 /* else fall through to CUSTOM|1 */
292 case CONTEXT_CUSTOM|1:
293 return button_context_tree;
294
295 case CONTEXT_QUICKSCREEN:
296 return button_context_quickscreen;
297
298 case CONTEXT_RECSCREEN:
299 case CONTEXT_SETTINGS_RECTRIGGER:
300 return button_context_recscreen;
301 case CONTEXT_KEYBOARD:
302 case CONTEXT_MORSE_INPUT:
303 return button_context_keyboard;
304 case CONTEXT_FM:
305 return button_context_radio;
306
307 case CONTEXT_STD:
308 case CONTEXT_LIST:
309 default:
310 return button_context_standard;
311 }
312}
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index bc27a9fb4c..11770606a1 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -52,13 +52,6 @@
52# The target names used are picked from the configure script and are set in the 52# The target names used are picked from the configure script and are set in the
53# MODELNAME variable in the root makefile. Currently, they are: 53# MODELNAME variable in the root makefile. Currently, they are:
54# Target Target string 54# Target Target string
55# Archos
56# Player/Studio archosplayer
57# Recorder archosrecorder
58# FM Recorder archosfmrecorder
59# Recorder V2 archosrecorderv2
60# Ondio SP archosondiosp
61# Ondio FM archosondiofm
62# iriver 55# iriver
63# H100/H110/H115 iriverh100 56# H100/H110/H115 iriverh100
64# H120/H140 iriverh120 57# H120/H140 iriverh120
@@ -333,7 +326,6 @@
333 iriverh100,iriverh120,iriverh300: "NAVI = Yes" 326 iriverh100,iriverh120,iriverh300: "NAVI = Yes"
334 ipod*,iaudiox5,iaudiom5,gigabeat*,sansae200*,sansac200*,iriverh10,iriverh10_5gb,mrobe100,sansaclip*,sansafuze*,sansaconnect: "SELECT = Yes" 327 ipod*,iaudiox5,iaudiom5,gigabeat*,sansae200*,sansac200*,iriverh10,iriverh10_5gb,mrobe100,sansaclip*,sansafuze*,sansaconnect: "SELECT = Yes"
335 mrobe500: "PLAY, POWER, or top-right = Yes" 328 mrobe500: "PLAY, POWER, or top-right = Yes"
336 archosplayer: "(PLAY/STOP)"
337 vibe500: "OK = Yes" 329 vibe500: "OK = Yes"
338 creativezen*: "Select = Yes" 330 creativezen*: "Select = Yes"
339 </source> 331 </source>
@@ -343,7 +335,6 @@
343 iriverh100,iriverh120,iriverh300: "NAVI = Yes" 335 iriverh100,iriverh120,iriverh300: "NAVI = Yes"
344 ipod*,iaudiox5,iaudiom5,gigabeat*,sansae200*,sansac200*,iriverh10,iriverh10_5gb,mrobe100,sansaclip*,sansafuze*,sansaconnect: "SELECT = Yes" 336 ipod*,iaudiox5,iaudiom5,gigabeat*,sansae200*,sansac200*,iriverh10,iriverh10_5gb,mrobe100,sansaclip*,sansafuze*,sansaconnect: "SELECT = Yes"
345 mrobe500: "PLAY, POWER, or top-right = Yes" 337 mrobe500: "PLAY, POWER, or top-right = Yes"
346 archosplayer: "(PLAY/STOP)"
347 vibe500: "OK = Yes" 338 vibe500: "OK = Yes"
348 creativezen*: "Select = Yes" 339 creativezen*: "Select = Yes"
349 </dest> 340 </dest>
@@ -357,15 +348,12 @@
357 user: core 348 user: core
358 <source> 349 <source>
359 *: "Any Other = No" 350 *: "Any Other = No"
360 archosplayer: none
361 </source> 351 </source>
362 <dest> 352 <dest>
363 *: "Any Other = No" 353 *: "Any Other = No"
364 archosplayer: none
365 </dest> 354 </dest>
366 <voice> 355 <voice>
367 *: "" 356 *: ""
368 archosplayer: none
369 </voice> 357 </voice>
370</phrase> 358</phrase>
371<phrase> 359<phrase>
@@ -1273,159 +1261,6 @@
1273 </voice> 1261 </voice>
1274</phrase> 1262</phrase>
1275<phrase> 1263<phrase>
1276 id: LANG_LOUDNESS
1277 desc: in sound_settings
1278 user: core
1279 <source>
1280 *: none
1281 masf: "Loudness"
1282 </source>
1283 <dest>
1284 *: none
1285 masf: "Loudness"
1286 </dest>
1287 <voice>
1288 *: none
1289 masf: "Loudness"
1290 </voice>
1291</phrase>
1292<phrase>
1293 id: LANG_AUTOVOL
1294 desc: in sound_settings
1295 user: core
1296 <source>
1297 *: none
1298 masf: "Auto Volume"
1299 </source>
1300 <dest>
1301 *: none
1302 masf: "Auto Volume"
1303 </dest>
1304 <voice>
1305 *: none
1306 masf: "Auto Volume"
1307 </voice>
1308</phrase>
1309<phrase>
1310 id: LANG_DECAY
1311 desc: in sound_settings
1312 user: core
1313 <source>
1314 *: none
1315 masf: "AV Decay Time"
1316 </source>
1317 <dest>
1318 *: none
1319 masf: "AV Decay Time"
1320 </dest>
1321 <voice>
1322 *: none
1323 masf: ""
1324 </voice>
1325</phrase>
1326<phrase>
1327 id: LANG_SUPERBASS
1328 desc: in sound settings
1329 user: core
1330 <source>
1331 *: none
1332 masf: "Super Bass"
1333 </source>
1334 <dest>
1335 *: none
1336 masf: "Super Bass"
1337 </dest>
1338 <voice>
1339 *: none
1340 masf: "Super Bass"
1341 </voice>
1342</phrase>
1343<phrase>
1344 id: LANG_MDB_ENABLE
1345 desc: in sound settings
1346 user: core
1347 <source>
1348 *: none
1349 masf: "MDB Enable"
1350 </source>
1351 <dest>
1352 *: none
1353 masf: "MDB Enable"
1354 </dest>
1355 <voice>
1356 *: none
1357 masf: "MDB Enable"
1358 </voice>
1359</phrase>
1360<phrase>
1361 id: LANG_MDB_STRENGTH
1362 desc: in sound settings
1363 user: core
1364 <source>
1365 *: none
1366 masf: "MDB Strength"
1367 </source>
1368 <dest>
1369 *: none
1370 masf: "MDB Strength"
1371 </dest>
1372 <voice>
1373 *: none
1374 masf: "MDB Strength"
1375 </voice>
1376</phrase>
1377<phrase>
1378 id: LANG_MDB_HARMONICS
1379 desc: in sound settings
1380 user: core
1381 <source>
1382 *: none
1383 masf: "MDB Harmonics"
1384 </source>
1385 <dest>
1386 *: none
1387 masf: "MDB Harmonics"
1388 </dest>
1389 <voice>
1390 *: none
1391 masf: "MDB Harmonics"
1392 </voice>
1393</phrase>
1394<phrase>
1395 id: LANG_MDB_CENTER
1396 desc: in sound settings
1397 user: core
1398 <source>
1399 *: none
1400 masf: "MDB Centre Frequency"
1401 </source>
1402 <dest>
1403 *: none
1404 masf: "MDB Centre Frequency"
1405 </dest>
1406 <voice>
1407 *: none
1408 masf: "MDB Centre Frequency"
1409 </voice>
1410</phrase>
1411<phrase>
1412 id: LANG_MDB_SHAPE
1413 desc: in sound settings
1414 user: core
1415 <source>
1416 *: none
1417 masf: "MDB Shape"
1418 </source>
1419 <dest>
1420 *: none
1421 masf: "MDB Shape"
1422 </dest>
1423 <voice>
1424 *: none
1425 masf: "MDB Shape"
1426 </voice>
1427</phrase>
1428<phrase>
1429 id: LANG_GENERAL_SETTINGS 1264 id: LANG_GENERAL_SETTINGS
1430 desc: in the main menu 1265 desc: in the main menu
1431 user: core 1266 user: core
@@ -2322,7 +2157,6 @@
2322 iaudiox5,iaudiom5,gigabeat*,mrobe100,samsungyh*: "Building database... %d found (LEFT to return)" 2157 iaudiox5,iaudiom5,gigabeat*,mrobe100,samsungyh*: "Building database... %d found (LEFT to return)"
2323 iriverh10,iriverh10_5gb,sansae200*,sansac200*,sansafuze*,vibe500: "Building database... %d found (PREV to return)" 2158 iriverh10,iriverh10_5gb,sansae200*,sansac200*,sansafuze*,vibe500: "Building database... %d found (PREV to return)"
2324 gogearsa9200: "Building database... %d found (REW to return)" 2159 gogearsa9200: "Building database... %d found (REW to return)"
2325 archosplayer: "Building DB %d found"
2326 </source> 2160 </source>
2327 <dest> 2161 <dest>
2328 *: "Building database... %d found (OFF to return)" 2162 *: "Building database... %d found (OFF to return)"
@@ -2331,7 +2165,6 @@
2331 iaudiox5,iaudiom5,gigabeat*,mrobe100,samsungyh*: "Building database... %d found (LEFT to return)" 2165 iaudiox5,iaudiom5,gigabeat*,mrobe100,samsungyh*: "Building database... %d found (LEFT to return)"
2332 iriverh10,iriverh10_5gb,sansae200*,sansac200*,sansafuze*,vibe500: "Building database... %d found (PREV to return)" 2166 iriverh10,iriverh10_5gb,sansae200*,sansac200*,sansafuze*,vibe500: "Building database... %d found (PREV to return)"
2333 gogearsa9200: "Building database... %d found (REW to return)" 2167 gogearsa9200: "Building database... %d found (REW to return)"
2334 archosplayer: "Building DB %d found"
2335 </dest> 2168 </dest>
2336 <voice> 2169 <voice>
2337 *: "entries found for database" 2170 *: "entries found for database"
@@ -3263,23 +3096,6 @@
3263 </voice> 3096 </voice>
3264</phrase> 3097</phrase>
3265<phrase> 3098<phrase>
3266 id: LANG_BUTTON_BAR
3267 desc: in settings menu
3268 user: core
3269 <source>
3270 *: none
3271 recorder_pad: "Button Bar"
3272 </source>
3273 <dest>
3274 *: none
3275 recorder_pad: "Button Bar"
3276 </dest>
3277 <voice>
3278 *: none
3279 recorder_pad: "Button Bar"
3280 </voice>
3281</phrase>
3282<phrase>
3283 id: LANG_VOLUME_DISPLAY 3099 id: LANG_VOLUME_DISPLAY
3284 desc: Volume type title 3100 desc: Volume type title
3285 user: core 3101 user: core
@@ -3353,15 +3169,12 @@
3353 user: core 3169 user: core
3354 <source> 3170 <source>
3355 *: "Peak Meter" 3171 *: "Peak Meter"
3356 masd: none
3357 </source> 3172 </source>
3358 <dest> 3173 <dest>
3359 *: "Peak Meter" 3174 *: "Peak Meter"
3360 masd: none
3361 </dest> 3175 </dest>
3362 <voice> 3176 <voice>
3363 *: "Peak Meter" 3177 *: "Peak Meter"
3364 masd: none
3365 </voice> 3178 </voice>
3366</phrase> 3179</phrase>
3367<phrase> 3180<phrase>
@@ -3370,15 +3183,12 @@
3370 user: core 3183 user: core
3371 <source> 3184 <source>
3372 *: "Clip Hold Time" 3185 *: "Clip Hold Time"
3373 masd: none
3374 </source> 3186 </source>
3375 <dest> 3187 <dest>
3376 *: "Clip Hold Time" 3188 *: "Clip Hold Time"
3377 masd: none
3378 </dest> 3189 </dest>
3379 <voice> 3190 <voice>
3380 *: "Clip Hold Time" 3191 *: "Clip Hold Time"
3381 masd: none
3382 </voice> 3192 </voice>
3383</phrase> 3193</phrase>
3384<phrase> 3194<phrase>
@@ -3387,15 +3197,12 @@
3387 user: core 3197 user: core
3388 <source> 3198 <source>
3389 *: "Peak Hold Time" 3199 *: "Peak Hold Time"
3390 masd: none
3391 </source> 3200 </source>
3392 <dest> 3201 <dest>
3393 *: "Peak Hold Time" 3202 *: "Peak Hold Time"
3394 masd: none
3395 </dest> 3203 </dest>
3396 <voice> 3204 <voice>
3397 *: "Peak Hold Time" 3205 *: "Peak Hold Time"
3398 masd: none
3399 </voice> 3206 </voice>
3400</phrase> 3207</phrase>
3401<phrase> 3208<phrase>
@@ -3404,15 +3211,12 @@
3404 user: core 3211 user: core
3405 <source> 3212 <source>
3406 *: "Eternal" 3213 *: "Eternal"
3407 masd: none
3408 </source> 3214 </source>
3409 <dest> 3215 <dest>
3410 *: "Eternal" 3216 *: "Eternal"
3411 masd: none
3412 </dest> 3217 </dest>
3413 <voice> 3218 <voice>
3414 *: "Eternal" 3219 *: "Eternal"
3415 masd: none
3416 </voice> 3220 </voice>
3417</phrase> 3221</phrase>
3418<phrase> 3222<phrase>
@@ -3421,15 +3225,12 @@
3421 user: core 3225 user: core
3422 <source> 3226 <source>
3423 *: "Peak Release" 3227 *: "Peak Release"
3424 masd: none
3425 </source> 3228 </source>
3426 <dest> 3229 <dest>
3427 *: "Peak Release" 3230 *: "Peak Release"
3428 masd: none
3429 </dest> 3231 </dest>
3430 <voice> 3232 <voice>
3431 *: "Peak Release" 3233 *: "Peak Release"
3432 masd: none
3433 </voice> 3234 </voice>
3434</phrase> 3235</phrase>
3435<phrase> 3236<phrase>
@@ -3438,15 +3239,12 @@
3438 user: core 3239 user: core
3439 <source> 3240 <source>
3440 *: "Scale" 3241 *: "Scale"
3441 masd: none
3442 </source> 3242 </source>
3443 <dest> 3243 <dest>
3444 *: "Scale" 3244 *: "Scale"
3445 masd: none
3446 </dest> 3245 </dest>
3447 <voice> 3246 <voice>
3448 *: "Scale" 3247 *: "Scale"
3449 masd: none
3450 </voice> 3248 </voice>
3451</phrase> 3249</phrase>
3452<phrase> 3250<phrase>
@@ -3455,15 +3253,12 @@
3455 user: core 3253 user: core
3456 <source> 3254 <source>
3457 *: "Logarithmic (dB)" 3255 *: "Logarithmic (dB)"
3458 masd: none
3459 </source> 3256 </source>
3460 <dest> 3257 <dest>
3461 *: "Logarithmic (dB)" 3258 *: "Logarithmic (dB)"
3462 masd: none
3463 </dest> 3259 </dest>
3464 <voice> 3260 <voice>
3465 *: "Logarithmic decibel" 3261 *: "Logarithmic decibel"
3466 masd: none
3467 </voice> 3262 </voice>
3468</phrase> 3263</phrase>
3469<phrase> 3264<phrase>
@@ -3472,15 +3267,12 @@
3472 user: core 3267 user: core
3473 <source> 3268 <source>
3474 *: "Linear (%)" 3269 *: "Linear (%)"
3475 masd: none
3476 </source> 3270 </source>
3477 <dest> 3271 <dest>
3478 *: "Linear (%)" 3272 *: "Linear (%)"
3479 masd: none
3480 </dest> 3273 </dest>
3481 <voice> 3274 <voice>
3482 *: "Linear percent" 3275 *: "Linear percent"
3483 masd: none
3484 </voice> 3276 </voice>
3485</phrase> 3277</phrase>
3486<phrase> 3278<phrase>
@@ -3489,15 +3281,12 @@
3489 user: core 3281 user: core
3490 <source> 3282 <source>
3491 *: "Minimum Of Range" 3283 *: "Minimum Of Range"
3492 masd: none
3493 </source> 3284 </source>
3494 <dest> 3285 <dest>
3495 *: "Minimum Of Range" 3286 *: "Minimum Of Range"
3496 masd: none
3497 </dest> 3287 </dest>
3498 <voice> 3288 <voice>
3499 *: "Minimum Of Range" 3289 *: "Minimum Of Range"
3500 masd: none
3501 </voice> 3290 </voice>
3502</phrase> 3291</phrase>
3503<phrase> 3292<phrase>
@@ -3506,15 +3295,12 @@
3506 user: core 3295 user: core
3507 <source> 3296 <source>
3508 *: "Maximum Of Range" 3297 *: "Maximum Of Range"
3509 masd: none
3510 </source> 3298 </source>
3511 <dest> 3299 <dest>
3512 *: "Maximum Of Range" 3300 *: "Maximum Of Range"
3513 masd: none
3514 </dest> 3301 </dest>
3515 <voice> 3302 <voice>
3516 *: "Maximum Of Range" 3303 *: "Maximum Of Range"
3517 masd: none
3518 </voice> 3304 </voice>
3519</phrase> 3305</phrase>
3520<phrase> 3306<phrase>
@@ -5123,57 +4909,6 @@
5123 </voice> 4909 </voice>
5124</phrase> 4910</phrase>
5125<phrase> 4911<phrase>
5126 id: LANG_BUTTONBAR_MENU
5127 desc: in button bar
5128 user: core
5129 <source>
5130 *: none
5131 radio_screen_button_bar: "Menu"
5132 </source>
5133 <dest>
5134 *: none
5135 radio_screen_button_bar: "Menu"
5136 </dest>
5137 <voice>
5138 *: none
5139 radio_screen_button_bar: ""
5140 </voice>
5141</phrase>
5142<phrase>
5143 id: LANG_FM_BUTTONBAR_EXIT
5144 desc: in radio screen
5145 user: core
5146 <source>
5147 *: none
5148 radio_screen_button_bar: "Exit"
5149 </source>
5150 <dest>
5151 *: none
5152 radio_screen_button_bar: "Exit"
5153 </dest>
5154 <voice>
5155 *: none
5156 radio_screen_button_bar: ""
5157 </voice>
5158</phrase>
5159<phrase>
5160 id: LANG_FM_BUTTONBAR_ACTION
5161 desc: in radio screen
5162 user: core
5163 <source>
5164 *: none
5165 radio_screen_button_bar: "Action"
5166 </source>
5167 <dest>
5168 *: none
5169 radio_screen_button_bar: "Action"
5170 </dest>
5171 <voice>
5172 *: none
5173 radio_screen_button_bar: ""
5174 </voice>
5175</phrase>
5176<phrase>
5177 id: LANG_PRESET 4912 id: LANG_PRESET
5178 desc: in button bar and radio screen / menu 4913 desc: in button bar and radio screen / menu
5179 user: core 4914 user: core
@@ -5191,40 +4926,6 @@
5191 </voice> 4926 </voice>
5192</phrase> 4927</phrase>
5193<phrase> 4928<phrase>
5194 id: LANG_FM_BUTTONBAR_ADD
5195 desc: in radio screen
5196 user: core
5197 <source>
5198 *: none
5199 radio_screen_button_bar: "Add"
5200 </source>
5201 <dest>
5202 *: none
5203 radio_screen_button_bar: "Add"
5204 </dest>
5205 <voice>
5206 *: none
5207 radio_screen_button_bar: ""
5208 </voice>
5209</phrase>
5210<phrase>
5211 id: LANG_FM_BUTTONBAR_RECORD
5212 desc: in radio screen
5213 user: core
5214 <source>
5215 *: none
5216 radio_screen_button_bar: "Record"
5217 </source>
5218 <dest>
5219 *: none
5220 radio_screen_button_bar: "Record"
5221 </dest>
5222 <voice>
5223 *: none
5224 radio_screen_button_bar: ""
5225 </voice>
5226</phrase>
5227<phrase>
5228 id: LANG_FM_MONO_MODE 4929 id: LANG_FM_MONO_MODE
5229 desc: in radio screen 4930 desc: in radio screen
5230 user: core 4931 user: core
@@ -5777,15 +5478,15 @@
5777 user: core 5478 user: core
5778 <source> 5479 <source>
5779 *: none 5480 *: none
5780 recording,archosplayer: "Line In" 5481 recording: "Line In"
5781 </source> 5482 </source>
5782 <dest> 5483 <dest>
5783 *: none 5484 *: none
5784 recording,archosplayer: "Line In" 5485 recording: "Line In"
5785 </dest> 5486 </dest>
5786 <voice> 5487 <voice>
5787 *: none 5488 *: none
5788 recording,archosplayer: "Line In" 5489 recording: "Line In"
5789 </voice> 5490 </voice>
5790</phrase> 5491</phrase>
5791<phrase> 5492<phrase>
@@ -6577,23 +6278,6 @@
6577 </voice> 6278 </voice>
6578</phrase> 6279</phrase>
6579<phrase> 6280<phrase>
6580 id: LANG_SHUTDOWN
6581 desc: in main menu
6582 user: core
6583 <source>
6584 *: none
6585 soft_shutdown: "Shut down"
6586 </source>
6587 <dest>
6588 *: none
6589 soft_shutdown: "Shut down"
6590 </dest>
6591 <voice>
6592 *: none
6593 soft_shutdown: "Shut down"
6594 </voice>
6595</phrase>
6596<phrase>
6597 id: LANG_ROCKBOX_INFO 6281 id: LANG_ROCKBOX_INFO
6598 desc: displayed topmost on the info screen and in the info menu 6282 desc: displayed topmost on the info screen and in the info menu
6599 user: core 6283 user: core
@@ -6613,11 +6297,9 @@
6613 user: core 6297 user: core
6614 <source> 6298 <source>
6615 *: "Buffer:" 6299 *: "Buffer:"
6616 archosplayer: "Buf:"
6617 </source> 6300 </source>
6618 <dest> 6301 <dest>
6619 *: "Buffer:" 6302 *: "Buffer:"
6620 archosplayer: "Buf:"
6621 </dest> 6303 </dest>
6622 <voice> 6304 <voice>
6623 *: "Buffer size" 6305 *: "Buffer size"
@@ -6629,12 +6311,12 @@
6629 user: core 6311 user: core
6630 <source> 6312 <source>
6631 *: "Battery: %d%% %dh %dm" 6313 *: "Battery: %d%% %dh %dm"
6632 archosplayer,archosrecorder,archosfmrecorder,archosrecorderv2,archosondio*,iriverifp7xx: "%d%% %dh %dm" 6314 iriverifp7xx: "%d%% %dh %dm"
6633 iriverh10,ipodmini1g,ipodmini2g: "Batt: %d%% %dh %dm" 6315 iriverh10,ipodmini1g,ipodmini2g: "Batt: %d%% %dh %dm"
6634 </source> 6316 </source>
6635 <dest> 6317 <dest>
6636 *: "Battery: %d%% %dh %dm" 6318 *: "Battery: %d%% %dh %dm"
6637 archosplayer,archosrecorder,archosfmrecorder,archosrecorderv2,archosondio*,iriverifp7xx: "%d%% %dh %dm" 6319 iriverifp7xx: "%d%% %dh %dm"
6638 iriverh10,ipodmini1g,ipodmini2g: "Batt: %d%% %dh %dm" 6320 iriverh10,ipodmini1g,ipodmini2g: "Batt: %d%% %dh %dm"
6639 </dest> 6321 </dest>
6640 <voice> 6322 <voice>
@@ -6688,28 +6370,25 @@
6688</phrase> 6370</phrase>
6689<phrase> 6371<phrase>
6690 id: LANG_DISK_NAME_MMC 6372 id: LANG_DISK_NAME_MMC
6691 desc: in info menu; name for external disk with multivolume (Ondio; keep short!) 6373 desc: in info menu; name for external disk with multivolume (keep short!)
6692 user: core 6374 user: core
6693 <source> 6375 <source>
6694 *: none 6376 *: none
6695 multivolume: "HD1" 6377 multivolume: "HD1"
6696 sansae200*,sansac200*,sansafuze*,sansaclipplus: "mSD:" 6378 sansae200*,sansac200*,sansafuze*,sansaclipplus: "mSD:"
6697 xduoox3: "mSD2:" 6379 xduoox3: "mSD2:"
6698 archosondio*: "MMC:"
6699 </source> 6380 </source>
6700 <dest> 6381 <dest>
6701 *: none 6382 *: none
6702 multivolume: "HD1" 6383 multivolume: "HD1"
6703 sansae200*,sansac200*,sansafuze*,sansaclipplus: "MSD:" 6384 sansae200*,sansac200*,sansafuze*,sansaclipplus: "MSD:"
6704 xduoox3: "mSD2:" 6385 xduoox3: "mSD2:"
6705 archosondio*: "MMC:"
6706 </dest> 6386 </dest>
6707 <voice> 6387 <voice>
6708 *: none 6388 *: none
6709 multivolume: "H D 1" 6389 multivolume: "H D 1"
6710 sansae200*,sansac200*,sansafuze*,sansaclipplus: "micro S D" 6390 sansae200*,sansac200*,sansafuze*,sansaclipplus: "micro S D"
6711 xduoox3: "micro S D 2" 6391 xduoox3: "micro S D 2"
6712 archosondio*: "M M C"
6713 </voice> 6392 </voice>
6714</phrase> 6393</phrase>
6715<phrase> 6394<phrase>
@@ -7806,11 +7485,9 @@
7806 user: core 7485 user: core
7807 <source> 7486 <source>
7808 *: "End of Song List" 7487 *: "End of Song List"
7809 archosplayer: "End of List"
7810 </source> 7488 </source>
7811 <dest> 7489 <dest>
7812 *: "End of Song List" 7490 *: "End of Song List"
7813 archosplayer: "End of List"
7814 </dest> 7491 </dest>
7815 <voice> 7492 <voice>
7816 *: "End of Song List" 7493 *: "End of Song List"
@@ -8063,40 +7740,6 @@
8063 </voice> 7740 </voice>
8064</phrase> 7741</phrase>
8065<phrase> 7742<phrase>
8066 id: LANG_CONFIRM_SHUTDOWN
8067 desc: in shutdown screen
8068 user: core
8069 <source>
8070 *: none
8071 soft_shutdown: "Press OFF to shut down"
8072 </source>
8073 <dest>
8074 *: none
8075 soft_shutdown: "Press OFF to shut down"
8076 </dest>
8077 <voice>
8078 *: none
8079 soft_shutdown: ""
8080 </voice>
8081</phrase>
8082<phrase>
8083 id: LANG_REMOVE_MMC
8084 desc: before acknowledging usb in case an MMC is inserted (Ondio)
8085 user: core
8086 <source>
8087 *: none
8088 archosondio*: "Please remove inserted MMC"
8089 </source>
8090 <dest>
8091 *: none
8092 archosondio*: "Please remove inserted MMC"
8093 </dest>
8094 <voice>
8095 *: none
8096 archosondio*: "Please remove multimedia card"
8097 </voice>
8098</phrase>
8099<phrase>
8100 id: LANG_BOOT_CHANGED 7743 id: LANG_BOOT_CHANGED
8101 desc: File browser discovered the boot file was changed 7744 desc: File browser discovered the boot file was changed
8102 user: core 7745 user: core
@@ -8126,11 +7769,11 @@
8126</phrase> 7769</phrase>
8127<phrase> 7770<phrase>
8128 id: LANG_OFF_ABORT 7771 id: LANG_OFF_ABORT
8129 desc: Used on archosrecorder models 7772 desc: Used on many models
8130 user: core 7773 user: core
8131 <source> 7774 <source>
8132 *: "OFF to abort" 7775 *: "OFF to abort"
8133 archosplayer,iriverh100,iriverh120,iriverh300: "STOP to abort" 7776 iriverh100,iriverh120,iriverh300: "STOP to abort"
8134 ipod*: "PLAY/PAUSE to abort" 7777 ipod*: "PLAY/PAUSE to abort"
8135 iaudiox5,iaudiom5: "Long PLAY to abort" 7778 iaudiox5,iaudiom5: "Long PLAY to abort"
8136 iriverh10,iriverh10_5gb,sansae200*,sansac200*,vibe500: "PREV to abort" 7779 iriverh10,iriverh10_5gb,sansae200*,sansac200*,vibe500: "PREV to abort"
@@ -8140,7 +7783,7 @@
8140 </source> 7783 </source>
8141 <dest> 7784 <dest>
8142 *: "OFF to abort" 7785 *: "OFF to abort"
8143 archosplayer,iriverh100,iriverh120,iriverh300: "STOP to abort" 7786 iriverh100,iriverh120,iriverh300: "STOP to abort"
8144 ipod*: "PLAY/PAUSE to abort" 7787 ipod*: "PLAY/PAUSE to abort"
8145 iaudiox5,iaudiom5: "Long PLAY to abort" 7788 iaudiox5,iaudiom5: "Long PLAY to abort"
8146 iriverh10,iriverh10_5gb,sansae200*,sansac200*,vibe500: "PREV to abort" 7789 iriverh10,iriverh10_5gb,sansae200*,sansac200*,vibe500: "PREV to abort"
@@ -8210,7 +7853,7 @@
8210</phrase> 7853</phrase>
8211<phrase> 7854<phrase>
8212 id: LANG_PLUGIN_WRONG_MODEL 7855 id: LANG_PLUGIN_WRONG_MODEL
8213 desc: The plugin is not compatible with the archos model trying to run it 7856 desc: The plugin is not compatible with the player model trying to run it
8214 user: core 7857 user: core
8215 <source> 7858 <source>
8216 *: "Incompatible model" 7859 *: "Incompatible model"
@@ -8324,23 +7967,6 @@
8324 </voice> 7967 </voice>
8325</phrase> 7968</phrase>
8326<phrase> 7969<phrase>
8327 id: LANG_BATTERY_TOPOFF_CHARGE
8328 desc: in info display, shows that top off charge is running Only for V1 archosrecorder
8329 user: core
8330 <source>
8331 *: none
8332 archosrecorder: "Battery: Top-Off Chg"
8333 </source>
8334 <dest>
8335 *: none
8336 archosrecorder: "Battery: Top-Off Chg"
8337 </dest>
8338 <voice>
8339 *: none
8340 archosrecorder: "Top off charge"
8341 </voice>
8342</phrase>
8343<phrase>
8344 id: LANG_BATTERY_TRICKLE_CHARGE 7970 id: LANG_BATTERY_TRICKLE_CHARGE
8345 desc: in info display, shows that trickle charge is running 7971 desc: in info display, shows that trickle charge is running
8346 user: core 7972 user: core
@@ -9804,57 +9430,6 @@
9804 </voice> 9430 </voice>
9805</phrase> 9431</phrase>
9806<phrase> 9432<phrase>
9807 id: LANG_SYSFONT_DIRBROWSE_F1
9808 desc: in dir browser, F1 button bar text
9809 user: core
9810 <source>
9811 *: none
9812 recorder_pad: "Menu"
9813 </source>
9814 <dest>
9815 *: none
9816 recorder_pad: "Menu"
9817 </dest>
9818 <voice>
9819 *: none
9820 recorder_pad: ""
9821 </voice>
9822</phrase>
9823<phrase>
9824 id: LANG_SYSFONT_DIRBROWSE_F2
9825 desc: in dir browser, F2 button bar text
9826 user: core
9827 <source>
9828 *: none
9829 recorder_pad: "Option"
9830 </source>
9831 <dest>
9832 *: none
9833 recorder_pad: "Option"
9834 </dest>
9835 <voice>
9836 *: none
9837 recorder_pad: ""
9838 </voice>
9839</phrase>
9840<phrase>
9841 id: LANG_SYSFONT_DIRBROWSE_F3
9842 desc: in dir browser, F3 button bar text
9843 user: core
9844 <source>
9845 *: none
9846 recorder_pad: "LCD"
9847 </source>
9848 <dest>
9849 *: none
9850 recorder_pad: "LCD"
9851 </dest>
9852 <voice>
9853 *: none
9854 recorder_pad: ""
9855 </voice>
9856</phrase>
9857<phrase>
9858 id: LANG_SYSFONT_CHANNEL_STEREO 9433 id: LANG_SYSFONT_CHANNEL_STEREO
9859 desc: in sound_settings 9434 desc: in sound_settings
9860 user: core 9435 user: core
@@ -16531,4 +16106,4 @@ id: VOICE_BAT_BENCH_KEYS
16531 *: none 16106 *: none
16532 lcd_bitmap: "Show album and artist at the bottom" 16107 lcd_bitmap: "Show album and artist at the bottom"
16533 </voice> 16108 </voice>
16534</phrase> \ No newline at end of file 16109</phrase>
diff --git a/apps/main.c b/apps/main.c
index 208dced923..fe15675c69 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -418,10 +418,6 @@ static void init(void)
418{ 418{
419 int rc; 419 int rc;
420 bool mounted = false; 420 bool mounted = false;
421#if CONFIG_CHARGING && (CONFIG_CPU == SH7034)
422 /* if nobody initialized ATA before, I consider this a cold start */
423 bool coldstart = (PACR2 & 0x4000) != 0; /* starting from Flash */
424#endif
425 421
426 system_init(); 422 system_init();
427 core_allocator_init(); 423 core_allocator_init();
@@ -528,24 +524,6 @@ static void init(void)
528 viewportmanager_init(); 524 viewportmanager_init();
529 CHART("<viewportmanager_init"); 525 CHART("<viewportmanager_init");
530 526
531#if CONFIG_CHARGING && (CONFIG_CPU == SH7034)
532 /* charger_inserted() can't be used here because power_thread()
533 hasn't checked power_input_status() yet */
534 if (coldstart && (power_input_status() & POWER_INPUT_MAIN_CHARGER)
535 && !global_settings.car_adapter_mode
536#ifdef ATA_POWER_PLAYERSTYLE
537 && !ide_powered() /* relies on probing result from bootloader */
538#endif
539 )
540 {
541 rc = charging_screen(); /* display a "charging" screen */
542 if (rc == 1) /* charger removed */
543 power_off();
544 /* "On" pressed or USB connected: proceed */
545 show_logo(); /* again, to provide better visual feedback */
546 }
547#endif
548
549 CHART(">storage_init"); 527 CHART(">storage_init");
550 rc = storage_init(); 528 rc = storage_init();
551 CHART("<storage_init"); 529 CHART("<storage_init");
diff --git a/apps/menu.c b/apps/menu.c
index c1af044374..97af181267 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -60,7 +60,6 @@
60 60
61/* gui api */ 61/* gui api */
62#include "list.h" 62#include "list.h"
63#include "buttonbar.h"
64 63
65#define MAX_MENUS 8 64#define MAX_MENUS 8
66/* used to allow for dynamic menus */ 65/* used to allow for dynamic menus */
@@ -376,12 +375,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
376 int stack_top = 0; 375 int stack_top = 0;
377 bool in_stringlist, done = false; 376 bool in_stringlist, done = false;
378 struct viewport *vps = NULL; 377 struct viewport *vps = NULL;
379#ifdef HAVE_BUTTONBAR
380 struct gui_buttonbar buttonbar;
381 gui_buttonbar_init(&buttonbar);
382 gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
383 gui_buttonbar_set(&buttonbar, "<<<", "", "");
384#endif
385 menu_callback_type menu_callback = NULL; 378 menu_callback_type menu_callback = NULL;
386 379
387 /* if hide_theme is true, assume parent has been fixed before passed into 380 /* if hide_theme is true, assume parent has been fixed before passed into
@@ -394,23 +387,10 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
394 387
395 gui_synclist_draw(&lists); 388 gui_synclist_draw(&lists);
396 gui_synclist_speak_item(&lists); 389 gui_synclist_speak_item(&lists);
397#ifdef HAVE_BUTTONBAR
398 if (!hide_theme)
399 {
400 gui_buttonbar_set(&buttonbar, "<<<", "", "");
401 gui_buttonbar_draw(&buttonbar);
402 }
403#endif
404 while (!done) 390 while (!done)
405 { 391 {
406 int new_audio_status; 392 int new_audio_status;
407 redraw_lists = false; 393 redraw_lists = false;
408 if (!hide_theme)
409 {
410#ifdef HAVE_BUTTONBAR
411 gui_buttonbar_draw(&buttonbar);
412#endif
413 }
414#if CONFIG_CODEC == SWCODEC 394#if CONFIG_CODEC == SWCODEC
415 keyclick_set_callback(gui_synclist_keyclick_callback, &lists); 395 keyclick_set_callback(gui_synclist_keyclick_callback, &lists);
416#endif 396#endif
@@ -590,13 +570,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
590 int type = (menu->flags&MENU_TYPE_MASK); 570 int type = (menu->flags&MENU_TYPE_MASK);
591 /* entering an item that may not be a list, so stop scrolling */ 571 /* entering an item that may not be a list, so stop scrolling */
592 gui_synclist_scroll_stop(&lists); 572 gui_synclist_scroll_stop(&lists);
593#ifdef HAVE_BUTTONBAR
594 if (!hide_theme)
595 {
596 gui_buttonbar_unset(&buttonbar);
597 gui_buttonbar_draw(&buttonbar);
598 }
599#endif
600 selected = get_menu_selection(gui_synclist_get_sel_pos(&lists), menu); 573 selected = get_menu_selection(gui_synclist_get_sel_pos(&lists), menu);
601 if (type == MT_MENU) 574 if (type == MT_MENU)
602 temp = menu->submenus[selected]; 575 temp = menu->submenus[selected];
@@ -700,13 +673,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
700 done = true; 673 done = true;
701 break; 674 break;
702 } 675 }
703#ifdef HAVE_BUTTONBAR
704 if (!hide_theme)
705 {
706 gui_buttonbar_set(&buttonbar, "<<<", "", "");
707 gui_buttonbar_draw(&buttonbar);
708 }
709#endif
710 } 676 }
711 else 677 else
712 { 678 {
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index ee60b37497..7f94571226 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -264,21 +264,10 @@ static const char* info_getname(int selected_item, void *data,
264 return str(LANG_BATTERY_CHARGE); 264 return str(LANG_BATTERY_CHARGE);
265 else 265 else
266#elif CONFIG_CHARGING >= CHARGING_MONITOR 266#elif CONFIG_CHARGING >= CHARGING_MONITOR
267#ifdef ARCHOS_RECORDER
268 /* Report the particular algorithm state */
269 if (charge_state == CHARGING)
270 return str(LANG_BATTERY_CHARGE);
271 else if (charge_state == TOPOFF)
272 return str(LANG_BATTERY_TOPOFF_CHARGE);
273 else if (charge_state == TRICKLE)
274 return str(LANG_BATTERY_TRICKLE_CHARGE);
275 else
276#else /* !ARCHOS_RECORDER */
277 /* Go by what power management reports */ 267 /* Go by what power management reports */
278 if (charging_state()) 268 if (charging_state())
279 return str(LANG_BATTERY_CHARGE); 269 return str(LANG_BATTERY_CHARGE);
280 else 270 else
281#endif /* ARCHOS_RECORDER */
282#endif /* CONFIG_CHARGING = */ 271#endif /* CONFIG_CHARGING = */
283 if (battery_level() >= 0) 272 if (battery_level() >= 0)
284 snprintf(buffer, buffer_len, str(LANG_BATTERY_TIME), 273 snprintf(buffer, buffer_len, str(LANG_BATTERY_TIME),
@@ -394,24 +383,6 @@ static int info_speak_item(int selected_item, void * data)
394 } 383 }
395 else 384 else
396#elif CONFIG_CHARGING >= CHARGING_MONITOR 385#elif CONFIG_CHARGING >= CHARGING_MONITOR
397#ifdef ARCHOS_RECORDER
398 /* Report the particular algorithm state */
399 if (charge_state == CHARGING)
400 {
401 talk_id(LANG_BATTERY_CHARGE, true);
402 if (battery_level() >= 0)
403 talk_value(battery_level(), UNIT_PERCENT, true);
404 }
405 else if (charge_state == TOPOFF)
406 talk_id(LANG_BATTERY_TOPOFF_CHARGE, true);
407 else if (charge_state == TRICKLE)
408 {
409 talk_id(LANG_BATTERY_TRICKLE_CHARGE, true);
410 if (battery_level() >= 0)
411 talk_value(battery_level(), UNIT_PERCENT, true);
412 }
413 else
414#else /* !ARCHOS_RECORDER */
415 /* Go by what power management reports */ 386 /* Go by what power management reports */
416 if (charging_state()) 387 if (charging_state())
417 { 388 {
@@ -420,7 +391,6 @@ static int info_speak_item(int selected_item, void * data)
420 talk_value(battery_level(), UNIT_PERCENT, true); 391 talk_value(battery_level(), UNIT_PERCENT, true);
421 } 392 }
422 else 393 else
423#endif /* ARCHOS_RECORDER */
424#endif /* CONFIG_CHARGING = */ 394#endif /* CONFIG_CHARGING = */
425 if (battery_level() >= 0) 395 if (battery_level() >= 0)
426 { 396 {
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index 21c6cff5fb..0f24420a63 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -117,20 +117,6 @@ static void make_options_from_indexes(const struct opt_items *src_names,
117 117
118static int recfrequency_func(void) 118static int recfrequency_func(void)
119{ 119{
120#if CONFIG_CODEC == MAS3587F
121 static const struct opt_items names[6] = {
122 { "44.1kHz", TALK_ID(44, UNIT_KHZ) },
123 { "48kHz", TALK_ID(48, UNIT_KHZ) },
124 { "32kHz", TALK_ID(32, UNIT_KHZ) },
125 { "22.05kHz", TALK_ID(22, UNIT_KHZ) },
126 { "24kHz", TALK_ID(24, UNIT_KHZ) },
127 { "16kHz", TALK_ID(16, UNIT_KHZ) }
128 };
129 return set_option(str(LANG_FREQUENCY),
130 &global_settings.rec_frequency, INT,
131 names, 6, NULL );
132#endif /* CONFIG_CODEC == MAS3587F */
133
134#if CONFIG_CODEC == SWCODEC 120#if CONFIG_CODEC == SWCODEC
135 static const struct opt_items names[REC_NUM_FREQ] = { 121 static const struct opt_items names[REC_NUM_FREQ] = {
136 REC_HAVE_96_([REC_FREQ_96] = { "96kHz", TALK_ID(96, UNIT_KHZ) },) 122 REC_HAVE_96_([REC_FREQ_96] = { "96kHz", TALK_ID(96, UNIT_KHZ) },)
@@ -221,11 +207,6 @@ static int recchannels_func(void)
221 [CHN_MODE_STEREO] = { STR(LANG_CHANNEL_STEREO) }, 207 [CHN_MODE_STEREO] = { STR(LANG_CHANNEL_STEREO) },
222 [CHN_MODE_MONO] = { STR(LANG_CHANNEL_MONO) } 208 [CHN_MODE_MONO] = { STR(LANG_CHANNEL_MONO) }
223 }; 209 };
224#if CONFIG_CODEC == MAS3587F
225 return set_option(str(LANG_CHANNELS),
226 &global_settings.rec_channels, INT,
227 names, CHN_NUM_MODES, NULL );
228#endif /* CONFIG_CODEC == MAS3587F */
229 210
230#if CONFIG_CODEC == SWCODEC 211#if CONFIG_CODEC == SWCODEC
231 struct opt_items opts[CHN_NUM_MODES]; 212 struct opt_items opts[CHN_NUM_MODES];
@@ -329,10 +310,6 @@ static int recmenu_callback(int action,
329 } 310 }
330 return action; 311 return action;
331} 312}
332#if CONFIG_CODEC == MAS3587F
333MENUITEM_SETTING(rec_quality, &global_settings.rec_quality, NULL);
334MENUITEM_SETTING(rec_editable, &global_settings.rec_editable, NULL);
335#endif
336 313
337MENUITEM_SETTING(rec_split_type, &global_settings.rec_split_type, NULL); 314MENUITEM_SETTING(rec_split_type, &global_settings.rec_split_type, NULL);
338MENUITEM_SETTING(rec_split_method, &global_settings.rec_split_method, NULL); 315MENUITEM_SETTING(rec_split_method, &global_settings.rec_split_method, NULL);
@@ -626,9 +603,6 @@ MENUITEM_FUNCTION(save_recpresets_item, 0, ID2P(LANG_SAVE_SETTINGS),
626 603
627MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS), 604MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS),
628 NULL, Icon_Recording, 605 NULL, Icon_Recording,
629#if CONFIG_CODEC == MAS3587F
630 &rec_quality,
631#endif
632#if CONFIG_CODEC == SWCODEC 606#if CONFIG_CODEC == SWCODEC
633 &recformat, &enc_global_config_menu_item, 607 &recformat, &enc_global_config_menu_item,
634#endif 608#endif
@@ -637,9 +611,6 @@ MAKE_MENU(recording_settings_menu, ID2P(LANG_RECORDING_SETTINGS),
637#if CONFIG_CODEC == SWCODEC 611#if CONFIG_CODEC == SWCODEC
638 &recmonomode, 612 &recmonomode,
639#endif 613#endif
640#if CONFIG_CODEC == MAS3587F
641 &rec_editable,
642#endif
643 &filesplitoptionsmenu, 614 &filesplitoptionsmenu,
644 &rec_prerecord_time, 615 &rec_prerecord_time,
645 &clear_rec_directory_item, 616 &clear_rec_directory_item,
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 2a08ab0a4e..2957b0635c 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -339,27 +339,6 @@ MAKE_MENU(keyclick_menu, ID2P(LANG_KEYCLICK), 0, Icon_NOICON,
339#endif 339#endif
340#endif 340#endif
341 341
342
343#if CONFIG_CODEC == MAS3507D
344void dac_line_in(bool enable);
345static int linein_callback(int action,
346 const struct menu_item_ex *this_item,
347 struct gui_synclist *this_list)
348{
349 (void)this_item;
350 (void)this_list;
351 switch (action)
352 {
353 case ACTION_EXIT_MENUITEM: /* on exit */
354#ifndef SIMULATOR
355 dac_line_in(global_settings.line_in);
356#endif
357 break;
358 }
359 return action;
360}
361MENUITEM_SETTING(line_in, &global_settings.line_in, linein_callback);
362#endif
363#if CONFIG_CHARGING 342#if CONFIG_CHARGING
364MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL); 343MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
365MENUITEM_SETTING(car_adapter_mode_delay, &global_settings.car_adapter_mode_delay, NULL); 344MENUITEM_SETTING(car_adapter_mode_delay, &global_settings.car_adapter_mode_delay, NULL);
@@ -440,9 +419,6 @@ MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
440#ifdef HAVE_MORSE_INPUT 419#ifdef HAVE_MORSE_INPUT
441 &morse_input, 420 &morse_input,
442#endif 421#endif
443#if CONFIG_CODEC == MAS3507D
444 &line_in,
445#endif
446#if CONFIG_CHARGING 422#if CONFIG_CHARGING
447 &car_adapter_mode_menu, 423 &car_adapter_mode_menu,
448#endif 424#endif
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c
index f39d980a35..ee966ac62a 100644
--- a/apps/menus/sound_menu.c
+++ b/apps/menus/sound_menu.c
@@ -218,17 +218,6 @@ static int timestretch_callback(int action,
218 &compressor_knee, &compressor_attack, &compressor_release); 218 &compressor_knee, &compressor_attack, &compressor_release);
219#endif 219#endif
220 220
221#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
222 MENUITEM_SETTING(loudness, &global_settings.loudness, NULL);
223 MENUITEM_SETTING(avc, &global_settings.avc, NULL);
224 MENUITEM_SETTING(superbass, &global_settings.superbass, NULL);
225 MENUITEM_SETTING(mdb_enable, &global_settings.mdb_enable, NULL);
226 MENUITEM_SETTING(mdb_strength, &global_settings.mdb_strength, NULL);
227 MENUITEM_SETTING(mdb_harmonics, &global_settings.mdb_harmonics, NULL);
228 MENUITEM_SETTING(mdb_center, &global_settings.mdb_center, NULL);
229 MENUITEM_SETTING(mdb_shape, &global_settings.mdb_shape, NULL);
230#endif
231
232#ifdef HAVE_SPEAKER 221#ifdef HAVE_SPEAKER
233 MENUITEM_SETTING(speaker_mode, &global_settings.speaker_mode, NULL); 222 MENUITEM_SETTING(speaker_mode, &global_settings.speaker_mode, NULL);
234#endif 223#endif
@@ -272,10 +261,6 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
272#endif 261#endif
273 ,&compressor_menu 262 ,&compressor_menu
274#endif 263#endif
275#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
276 ,&loudness,&avc,&superbass,&mdb_enable,&mdb_strength
277 ,&mdb_harmonics,&mdb_center,&mdb_shape
278#endif
279#ifdef HAVE_SPEAKER 264#ifdef HAVE_SPEAKER
280 ,&speaker_mode 265 ,&speaker_mode
281#endif 266#endif
diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c
index 10d1291daa..138a2f928a 100644
--- a/apps/menus/theme_menu.c
+++ b/apps/menus/theme_menu.c
@@ -198,22 +198,6 @@ static int statusbar_callback(int action,
198 return statusbar_callback_ex(action, this_item, SCREEN_MAIN); 198 return statusbar_callback_ex(action, this_item, SCREEN_MAIN);
199} 199}
200 200
201#ifdef HAVE_BUTTONBAR
202static int buttonbar_callback(int action,
203 const struct menu_item_ex *this_item,
204 struct gui_synclist *this_list)
205{
206 (void)this_item;
207 (void)this_list;
208 switch (action)
209 {
210 case ACTION_EXIT_MENUITEM:
211 viewportmanager_theme_changed(THEME_BUTTONBAR);
212 break;
213 }
214 return ACTION_REDRAW;
215}
216#endif
217MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL); 201MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL);
218MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL); 202MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL);
219MENUITEM_SETTING(statusbar, &global_settings.statusbar, 203MENUITEM_SETTING(statusbar, &global_settings.statusbar,
@@ -222,9 +206,6 @@ MENUITEM_SETTING(statusbar, &global_settings.statusbar,
222MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, 206MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar,
223 statusbar_callback_remote); 207 statusbar_callback_remote);
224#endif 208#endif
225#ifdef HAVE_BUTTONBAR
226MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, buttonbar_callback);
227#endif
228MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL); 209MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL);
229MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL); 210MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL);
230MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON, 211MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON,
@@ -232,9 +213,6 @@ MAKE_MENU(bars_menu, ID2P(LANG_BARS_MENU), 0, Icon_NOICON,
232#ifdef HAVE_REMOTE_LCD 213#ifdef HAVE_REMOTE_LCD
233 &remote_statusbar, 214 &remote_statusbar,
234#endif 215#endif
235#if CONFIG_KEYPAD == RECORDER_PAD
236 &buttonbar,
237#endif
238 &volume_type 216 &volume_type
239#if (CONFIG_BATTERY_MEASURE != 0) 217#if (CONFIG_BATTERY_MEASURE != 0)
240 , &battery_display 218 , &battery_display
diff --git a/apps/menus/time_menu.c b/apps/menus/time_menu.c
index 811996ca40..6ebf005ffd 100644
--- a/apps/menus/time_menu.c
+++ b/apps/menus/time_menu.c
@@ -264,12 +264,6 @@ int time_screen(void* ignored)
264 FOR_NB_SCREENS(i) 264 FOR_NB_SCREENS(i)
265 { 265 {
266 viewport_set_defaults(&clock_vps[i], i); 266 viewport_set_defaults(&clock_vps[i], i);
267#ifdef HAVE_BUTTONBAR
268 if (global_settings.buttonbar)
269 {
270 clock_vps[i].height -= BUTTONBAR_HEIGHT;
271 }
272#endif
273 nb_lines = viewport_get_nb_lines(&clock_vps[i]); 267 nb_lines = viewport_get_nb_lines(&clock_vps[i]);
274 268
275 gui_synclist_set_viewport_defaults(&menu[i], i); 269 gui_synclist_set_viewport_defaults(&menu[i], i);
diff --git a/apps/misc.c b/apps/misc.c
index 9a9e428268..2e3292dba5 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -436,17 +436,6 @@ bool list_stop_handler(void)
436 } 436 }
437 } 437 }
438#if CONFIG_CHARGING 438#if CONFIG_CHARGING
439#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
440 else
441 {
442 if (charger_inserted())
443 charging_splash();
444 else
445 shutdown_screen(); /* won't return if shutdown actually happens */
446
447 ret = true; /* screen is dirty, caller needs to refresh */
448 }
449#endif
450#ifndef HAVE_POWEROFF_WHILE_CHARGING 439#ifndef HAVE_POWEROFF_WHILE_CHARGING
451 { 440 {
452 static long last_off = 0; 441 static long last_off = 0;
@@ -595,10 +584,6 @@ long default_event_handler_ex(long event, void (*callback)(void *), void *parame
595 case SYS_USB_CONNECTED: 584 case SYS_USB_CONNECTED:
596 if (callback != NULL) 585 if (callback != NULL)
597 callback(parameter); 586 callback(parameter);
598#if (CONFIG_STORAGE & STORAGE_MMC) && (defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM))
599 if (!mmc_touched() ||
600 (mmc_remove_request() == SYS_HOTSWAP_EXTRACTED))
601#endif
602 { 587 {
603 system_flush(); 588 system_flush();
604#ifdef BOOTFILE 589#ifdef BOOTFILE
diff --git a/apps/mpeg.c b/apps/mpeg.c
index d3e0e5c137..e04c227cb1 100644
--- a/apps/mpeg.c
+++ b/apps/mpeg.c
@@ -46,7 +46,6 @@
46#include "settings.h" 46#include "settings.h"
47#ifndef SIMULATOR 47#ifndef SIMULATOR
48#include "i2c.h" 48#include "i2c.h"
49#include "mas35xx.h"
50#include "system.h" 49#include "system.h"
51#include "usb.h" 50#include "usb.h"
52#include "file.h" 51#include "file.h"
@@ -81,14 +80,6 @@
81extern unsigned long mas_version_code; 80extern unsigned long mas_version_code;
82#endif 81#endif
83 82
84#if CONFIG_CODEC == MAS3587F
85extern enum /* from mp3_playback.c */
86{
87 MPEG_DECODER,
88 MPEG_ENCODER
89} mpeg_mode;
90#endif /* CONFIG_CODEC == MAS3587F */
91
92#define MPEG_PLAY 1 83#define MPEG_PLAY 1
93#define MPEG_STOP 2 84#define MPEG_STOP 2
94#define MPEG_PAUSE 3 85#define MPEG_PAUSE 3
@@ -184,61 +175,6 @@ struct audio_resume_info
184 unsigned long offset; 175 unsigned long offset;
185}; 176};
186 177
187#if CONFIG_CODEC == MAS3587F
188static char recording_filename[MAX_PATH]; /* argument to thread */
189static char delayed_filename[MAX_PATH]; /* internal copy of above */
190
191static char xing_buffer[MAX_XING_HEADER_SIZE];
192
193static bool init_recording_done;
194static bool init_playback_done;
195static bool prerecording; /* True if prerecording is enabled */
196static bool is_prerecording; /* True if we are prerecording */
197static bool is_recording; /* We are recording */
198
199static enum {
200 NOT_SAVING = 0, /* reasons to save data, sorted by importance */
201 BUFFER_FULL,
202 NEW_FILE,
203 STOP_RECORDING
204} saving_status;
205
206static int rec_frequency_index; /* For create_xing_header() calls */
207static int rec_version_index; /* For create_xing_header() calls */
208
209struct prerecord_info {
210 int mempos;
211 unsigned long framecount;
212};
213
214static struct prerecord_info prerecord_buffer[MPEG_MAX_PRERECORD_SECONDS];
215static int prerecord_index; /* Current index in the prerecord buffer */
216static int prerecording_max_seconds; /* Max number of seconds to store */
217static int prerecord_count; /* Number of seconds in the prerecord buffer */
218static int prerecord_timeout; /* The tick count of the next prerecord data
219 store */
220
221static unsigned long record_start_time; /* Value of current_tick when recording
222 was started */
223static unsigned long pause_start_time; /* Value of current_tick when pause was
224 started */
225static unsigned long last_rec_time;
226static unsigned long num_rec_bytes;
227static unsigned long last_rec_bytes;
228static unsigned long frame_count_start;
229static unsigned long frame_count_end;
230static unsigned long saved_header = 0;
231
232/* Shadow MAS registers */
233unsigned long shadow_encoder_control = 0;
234#endif /* CONFIG_CODEC == MAS3587F */
235
236#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
237unsigned long shadow_io_control_main = 0;
238unsigned long shadow_soft_mute = 0;
239unsigned shadow_codec_reg0;
240#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
241
242#ifdef HAVE_RECORDING 178#ifdef HAVE_RECORDING
243static const unsigned char empty_id3_header[] = 179static const unsigned char empty_id3_header[] =
244{ 180{
@@ -253,18 +189,6 @@ static int get_playable_space(void);
253static int get_unswapped_space(void); 189static int get_unswapped_space(void);
254#endif /* !SIMULATOR */ 190#endif /* !SIMULATOR */
255 191
256#if (CONFIG_CODEC == MAS3587F) && !defined(SIMULATOR)
257static void init_recording(void);
258static void prepend_header(void);
259static void update_header(void);
260static void start_prerecording(void);
261static void start_recording(void);
262static void stop_recording(void);
263static int get_unsaved_space(void);
264static void pause_recording(void);
265static void resume_recording(void);
266#endif /* (CONFIG_CODEC == MAS3587F) && !defined(SIMULATOR) */
267
268static void audio_reset_buffer_noalloc(void* buf, size_t bufsize); 192static void audio_reset_buffer_noalloc(void* buf, size_t bufsize);
269static void audio_reset_buffer(void); 193static void audio_reset_buffer(void);
270 194
@@ -540,12 +464,6 @@ static int shrink_callback(int handle, unsigned hints, void* start, size_t old_s
540 size_t wanted_size = (hints & BUFLIB_SHRINK_SIZE_MASK); 464 size_t wanted_size = (hints & BUFLIB_SHRINK_SIZE_MASK);
541 ssize_t size = (ssize_t)old_size - wanted_size; 465 ssize_t size = (ssize_t)old_size - wanted_size;
542 466
543#if !defined(SIMULATOR) && (CONFIG_CODEC == MAS3587F)
544 /* FIXME: Cannot give the buffer during recording yet */
545 if (is_recording)
546 return BUFLIB_CB_CANNOT_SHRINK;
547#endif
548
549 /* keep at least 256K for the buffering */ 467 /* keep at least 256K for the buffering */
550 if ((size - extradata_size) < AUDIO_BUFFER_RESERVE) 468 if ((size - extradata_size) < AUDIO_BUFFER_RESERVE)
551 { 469 {
@@ -677,9 +595,6 @@ void audio_get_debugdata(struct audio_debug *dbgdata)
677 595
678 dbgdata->last_dma_chunk_size = last_dma_chunk_size; 596 dbgdata->last_dma_chunk_size = last_dma_chunk_size;
679 597
680#if CONFIG_CPU == SH7034
681 dbgdata->dma_on = (SCR0 & 0x80) != 0;
682#endif
683 dbgdata->playing = playing; 598 dbgdata->playing = playing;
684 dbgdata->play_pending = play_pending; 599 dbgdata->play_pending = play_pending;
685 dbgdata->is_playing = is_playing; 600 dbgdata->is_playing = is_playing;
@@ -758,108 +673,6 @@ static int get_unswapped_space(void)
758 return space; 673 return space;
759} 674}
760 675
761#if CONFIG_CODEC == MAS3587F
762static int get_unsaved_space(void)
763{
764 int space = audiobuf_write - audiobuf_read;
765 if (space < 0)
766 space += audiobuflen;
767 return space;
768}
769
770static void drain_dma_buffer(void)
771{
772 while (PBDRH & 0x40)
773 {
774 xor_b(0x08, &PADRH);
775
776 while (PBDRH & 0x80);
777
778 xor_b(0x08, &PADRH);
779
780 while (!(PBDRH & 0x80));
781 }
782}
783
784#ifdef DEBUG
785static long timing_info_index = 0;
786static long timing_info[1024];
787#endif /* DEBUG */
788
789void rec_tick (void) __attribute__ ((section (".icode")));
790void rec_tick(void)
791{
792 int i;
793 int delay;
794 char data;
795
796 if(is_recording && (PBDRH & 0x40))
797 {
798#ifdef DEBUG
799 timing_info[timing_info_index++] = current_tick;
800 TCNT2 = 0;
801#endif /* DEBUG */
802 /* Note: Although this loop is run in interrupt context, further
803 * optimisation will do no good. The MAS would then deliver bad
804 * frames occasionally, as observed in extended experiments. */
805 i = 0;
806 while (PBDRH & 0x40) /* We try to read as long as EOD is high */
807 {
808 xor_b(0x08, &PADRH); /* Set PR active, independent of polarity */
809
810 delay = 100;
811 while (PBDRH & 0x80) /* Wait until /RTW becomes active */
812 {
813 if (--delay <= 0) /* Bail out if we have to wait too long */
814 { /* i.e. the MAS doesn't want to talk to us */
815 xor_b(0x08, &PADRH); /* Set PR inactive */
816 goto transfer_end; /* and get out of here */
817 }
818 }
819
820 data = *(unsigned char *)0x04000000; /* read data byte */
821
822 xor_b(0x08, &PADRH); /* Set PR inactive */
823
824 mpeg_audiobuf[audiobuf_write++] = data;
825
826 if (audiobuf_write >= audiobuflen)
827 audiobuf_write = 0;
828
829 i++;
830 }
831 transfer_end:
832
833#ifdef DEBUG
834 timing_info[timing_info_index++] = TCNT2 + (i << 16);
835 timing_info_index &= 0x3ff;
836#endif /* DEBUG */
837
838 num_rec_bytes += i;
839
840 if(is_prerecording)
841 {
842 if(TIME_AFTER(current_tick, prerecord_timeout))
843 {
844 prerecord_timeout = current_tick + HZ;
845 queue_post(&mpeg_queue, MPEG_PRERECORDING_TICK, 0);
846 }
847 }
848 else
849 {
850 /* Signal to save the data if we are running out of buffer
851 space */
852 if (audiobuflen - get_unsaved_space() < MPEG_RECORDING_LOW_WATER
853 && saving_status == NOT_SAVING)
854 {
855 saving_status = BUFFER_FULL;
856 queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
857 }
858 }
859 }
860}
861#endif /* CONFIG_CODEC == MAS3587F */
862
863void playback_tick(void) 676void playback_tick(void)
864{ 677{
865 struct trackdata *ptd = get_trackdata(0); 678 struct trackdata *ptd = get_trackdata(0);
@@ -1158,11 +971,6 @@ static void track_change(void)
1158{ 971{
1159 DEBUGF("Track change\n"); 972 DEBUGF("Track change\n");
1160 973
1161#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1162 /* Reset the AVC */
1163 sound_set_avc(-1);
1164#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
1165
1166 if (num_tracks_in_memory() > 0) 974 if (num_tracks_in_memory() > 0)
1167 { 975 {
1168 remove_current_tag(); 976 remove_current_tag();
@@ -1293,13 +1101,6 @@ static void mpeg_thread(void)
1293 int amount_to_read; 1101 int amount_to_read;
1294 int t1, t2; 1102 int t1, t2;
1295 unsigned long start_elapsed, start_offset; 1103 unsigned long start_elapsed, start_offset;
1296#if CONFIG_CODEC == MAS3587F
1297 int amount_to_save;
1298 int save_endpos = 0;
1299 int rc;
1300 int level;
1301 long offset;
1302#endif /* CONFIG_CODEC == MAS3587F */
1303 1104
1304 is_playing = false; 1105 is_playing = false;
1305 play_pending = false; 1106 play_pending = false;
@@ -1308,10 +1109,6 @@ static void mpeg_thread(void)
1308 1109
1309 while(1) 1110 while(1)
1310 { 1111 {
1311#if CONFIG_CODEC == MAS3587F
1312 if(mpeg_mode == MPEG_DECODER)
1313 {
1314#endif /* CONFIG_CODEC == MAS3587F */
1315 yield(); 1112 yield();
1316 1113
1317 /* Swap if necessary, and don't block on the queue_wait() */ 1114 /* Swap if necessary, and don't block on the queue_wait() */
@@ -1836,321 +1633,11 @@ static void mpeg_thread(void)
1836 break; 1633 break;
1837#endif /* !USB_NONE */ 1634#endif /* !USB_NONE */
1838 1635
1839#if CONFIG_CODEC == MAS3587F
1840 case MPEG_INIT_RECORDING:
1841 init_recording();
1842 init_recording_done = true;
1843 break;
1844#endif /* CONFIG_CODEC == MAS3587F */
1845
1846 case SYS_TIMEOUT: 1636 case SYS_TIMEOUT:
1847 if (playing) 1637 if (playing)
1848 playlist_update_resume_info(audio_current_track()); 1638 playlist_update_resume_info(audio_current_track());
1849 break; 1639 break;
1850 } 1640 }
1851#if CONFIG_CODEC == MAS3587F
1852 }
1853 else
1854 {
1855 queue_wait(&mpeg_queue, &ev);
1856 switch(ev.id)
1857 {
1858 case MPEG_RECORD:
1859 if (is_prerecording)
1860 {
1861 int startpos;
1862
1863 /* Go back prerecord_count seconds in the buffer */
1864 startpos = prerecord_index - prerecord_count;
1865 if(startpos < 0)
1866 startpos += prerecording_max_seconds;
1867
1868 /* Read the position data from the prerecord buffer */
1869 frame_count_start = prerecord_buffer[startpos].framecount;
1870 startpos = prerecord_buffer[startpos].mempos;
1871
1872 DEBUGF("Start looking at address %x (%x)\n",
1873 mpeg_audiobuf+startpos, startpos);
1874
1875 saved_header = mpeg_get_last_header();
1876
1877 mem_find_next_frame(startpos, &offset, 1800,
1878 saved_header, mpeg_audiobuf,
1879 audiobuflen);
1880
1881 audiobuf_read = startpos + offset;
1882 if(audiobuf_read >= audiobuflen)
1883 audiobuf_read -= audiobuflen;
1884
1885 DEBUGF("New audiobuf_read address: %x (%x)\n",
1886 mpeg_audiobuf+audiobuf_read, audiobuf_read);
1887
1888 level = disable_irq_save();
1889 num_rec_bytes = get_unsaved_space();
1890 restore_irq(level);
1891 }
1892 else
1893 {
1894 frame_count_start = 0;
1895 num_rec_bytes = 0;
1896 audiobuf_read = MPEG_RESERVED_HEADER_SPACE;
1897 audiobuf_write = MPEG_RESERVED_HEADER_SPACE;
1898 }
1899
1900 prepend_header();
1901 DEBUGF("Recording...\n");
1902 start_recording();
1903
1904 /* Wait until at least one frame is encoded and get the
1905 frame header, for later use by the Xing header
1906 generation */
1907 sleep(HZ/5);
1908 saved_header = mpeg_get_last_header();
1909
1910 /* delayed until buffer is saved, don't open yet */
1911 strcpy(delayed_filename, recording_filename);
1912 mpeg_file = -1;
1913
1914 break;
1915
1916 case MPEG_STOP:
1917 DEBUGF("MPEG_STOP\n");
1918
1919 stop_recording();
1920
1921 /* Save the remaining data in the buffer */
1922 save_endpos = audiobuf_write;
1923 saving_status = STOP_RECORDING;
1924 queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
1925 break;
1926
1927 case MPEG_STOP_DONE:
1928 DEBUGF("MPEG_STOP_DONE\n");
1929
1930 if (mpeg_file >= 0)
1931 close(mpeg_file);
1932 mpeg_file = -1;
1933
1934 update_header();
1935#ifdef DEBUG1
1936 {
1937 int i;
1938 for(i = 0;i < 512;i++)
1939 {
1940 DEBUGF("%d - %d us (%d bytes)\n",
1941 timing_info[i*2],
1942 (timing_info[i*2+1] & 0xffff) *
1943 10000 / 13824,
1944 timing_info[i*2+1] >> 16);
1945 }
1946 }
1947#endif /* DEBUG1 */
1948
1949 if (prerecording)
1950 {
1951 start_prerecording();
1952 }
1953 mpeg_stop_done = true;
1954 break;
1955
1956 case MPEG_NEW_FILE:
1957 /* Bail out when a more important save is happening */
1958 if (saving_status > NEW_FILE)
1959 break;
1960
1961 /* Make sure we have at least one complete frame
1962 in the buffer. If we haven't recorded a single
1963 frame within 200ms, the MAS is probably not recording
1964 anything, and we bail out. */
1965 amount_to_save = get_unsaved_space();
1966 if (amount_to_save < 1800)
1967 {
1968 sleep(HZ/5);
1969 amount_to_save = get_unsaved_space();
1970 }
1971
1972 mas_readmem(MAS_BANK_D0, MAS_D0_MPEG_FRAME_COUNT,
1973 &frame_count_end, 1);
1974
1975 last_rec_time = current_tick - record_start_time;
1976 record_start_time = current_tick;
1977 if (paused)
1978 pause_start_time = record_start_time;
1979
1980 /* capture all values at one point */
1981 level = disable_irq_save();
1982 save_endpos = audiobuf_write;
1983 last_rec_bytes = num_rec_bytes;
1984 num_rec_bytes = 0;
1985 restore_irq(level);
1986
1987 if (amount_to_save >= 1800)
1988 {
1989 /* Now find a frame boundary to split at */
1990 save_endpos -= 1800;
1991 if (save_endpos < 0)
1992 save_endpos += audiobuflen;
1993
1994 rc = mem_find_next_frame(save_endpos, &offset, 1800,
1995 saved_header, mpeg_audiobuf,
1996 audiobuflen);
1997 if (!rc) /* No header found, save whole buffer */
1998 offset = 1800;
1999
2000 save_endpos += offset;
2001 if (save_endpos >= audiobuflen)
2002 save_endpos -= audiobuflen;
2003
2004 last_rec_bytes += offset - 1800;
2005 level = disable_irq_save();
2006 num_rec_bytes += 1800 - offset;
2007 restore_irq(level);
2008 }
2009
2010 saving_status = NEW_FILE;
2011 queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
2012 break;
2013
2014 case MPEG_SAVE_DATA:
2015 if (saving_status == BUFFER_FULL)
2016 save_endpos = audiobuf_write;
2017
2018 if (mpeg_file < 0) /* delayed file open */
2019 {
2020 mpeg_file = open(delayed_filename, O_WRONLY|O_CREAT, 0666);
2021
2022 if (mpeg_file < 0)
2023 panicf("recfile: %d", mpeg_file);
2024 }
2025
2026 amount_to_save = save_endpos - audiobuf_read;
2027 if (amount_to_save < 0)
2028 amount_to_save += audiobuflen;
2029
2030 amount_to_save = MIN(amount_to_save,
2031 audiobuflen - audiobuf_read);
2032#if (CONFIG_STORAGE & STORAGE_MMC)
2033 /* MMC is slow, so don't save too large chunks at once */
2034 amount_to_save = MIN(0x40000, amount_to_save);
2035#elif MEMORYSIZE == 8
2036 amount_to_save = MIN(0x100000, amount_to_save);
2037#endif
2038 rc = write(mpeg_file, mpeg_audiobuf + audiobuf_read,
2039 amount_to_save);
2040 if (rc < 0)
2041 {
2042 if (errno == ENOSPC)
2043 {
2044 mpeg_errno = AUDIOERR_DISK_FULL;
2045 stop_recording();
2046 queue_post(&mpeg_queue, MPEG_STOP_DONE, 0);
2047 /* will close the file */
2048 break;
2049 }
2050 else
2051 panicf("rec wrt: %d", rc);
2052 }
2053
2054 audiobuf_read += amount_to_save;
2055 if (audiobuf_read >= audiobuflen)
2056 audiobuf_read = 0;
2057
2058 if (audiobuf_read == save_endpos) /* all saved */
2059 {
2060 switch (saving_status)
2061 {
2062 case BUFFER_FULL:
2063 rc = fsync(mpeg_file);
2064 if (rc < 0)
2065 panicf("rec fls: %d", rc);
2066 storage_sleep();
2067 break;
2068
2069 case NEW_FILE:
2070 /* Close the current file */
2071 rc = close(mpeg_file);
2072 if (rc < 0)
2073 panicf("rec cls: %d", rc);
2074 mpeg_file = -1;
2075 update_header();
2076 storage_sleep();
2077
2078 /* copy new filename */
2079 strcpy(delayed_filename, recording_filename);
2080 prepend_header();
2081 frame_count_start = frame_count_end;
2082 break;
2083
2084 case STOP_RECORDING:
2085 queue_post(&mpeg_queue, MPEG_STOP_DONE, 0);
2086 /* will close the file */
2087 break;
2088
2089 default:
2090 break;
2091 }
2092 saving_status = NOT_SAVING;
2093 }
2094 else /* tell ourselves to save the next chunk */
2095 queue_post(&mpeg_queue, MPEG_SAVE_DATA, 0);
2096
2097 break;
2098
2099 case MPEG_PRERECORDING_TICK:
2100 if(!is_prerecording)
2101 break;
2102
2103 /* Store the write pointer every second */
2104 prerecord_buffer[prerecord_index].mempos = audiobuf_write;
2105 mas_readmem(MAS_BANK_D0, MAS_D0_MPEG_FRAME_COUNT,
2106 &prerecord_buffer[prerecord_index].framecount, 1);
2107
2108 /* Wrap if necessary */
2109 if(++prerecord_index == prerecording_max_seconds)
2110 prerecord_index = 0;
2111
2112 /* Update the number of seconds recorded */
2113 if(prerecord_count < prerecording_max_seconds)
2114 prerecord_count++;
2115 break;
2116
2117 case MPEG_INIT_PLAYBACK:
2118 /* Stop the prerecording */
2119 stop_recording();
2120 reset_mp3_buffer();
2121 mp3_play_init();
2122 init_playback_done = true;
2123 break;
2124
2125 case MPEG_PAUSE_RECORDING:
2126 pause_recording();
2127 break;
2128
2129 case MPEG_RESUME_RECORDING:
2130 resume_recording();
2131 break;
2132
2133 case SYS_USB_CONNECTED:
2134 /* We can safely go to USB mode if no recording
2135 is taking place */
2136 if((!is_recording || is_prerecording) && mpeg_stop_done)
2137 {
2138 /* Even if we aren't recording, we still call this
2139 function, to put the MAS in monitoring mode,
2140 to save power. */
2141 stop_recording();
2142
2143 /* Tell the USB thread that we are safe */
2144 DEBUGF("mpeg_thread got SYS_USB_CONNECTED\n");
2145 usb_acknowledge(SYS_USB_CONNECTED_ACK);
2146
2147 /* Wait until the USB cable is extracted again */
2148 usb_wait_for_disconnect(&mpeg_queue);
2149 }
2150 break;
2151 }
2152 }
2153#endif /* CONFIG_CODEC == MAS3587F */
2154 } 1641 }
2155} 1642}
2156#endif /* !SIMULATOR */ 1643#endif /* !SIMULATOR */
@@ -2195,557 +1682,6 @@ struct mp3entry* audio_next_track(void)
2195#endif /* !SIMULATOR */ 1682#endif /* !SIMULATOR */
2196} 1683}
2197 1684
2198#if CONFIG_CODEC == MAS3587F
2199#ifndef SIMULATOR
2200void audio_init_playback(void)
2201{
2202 init_playback_done = false;
2203 queue_post(&mpeg_queue, MPEG_INIT_PLAYBACK, 0);
2204
2205 while(!init_playback_done)
2206 sleep(1);
2207}
2208
2209
2210/****************************************************************************
2211 * Recording functions
2212 ***************************************************************************/
2213void audio_init_recording(void)
2214{
2215 init_recording_done = false;
2216 queue_post(&mpeg_queue, MPEG_INIT_RECORDING, 0);
2217
2218 while(!init_recording_done)
2219 sleep(1);
2220}
2221
2222static void init_recording(void)
2223{
2224 unsigned long val;
2225 int rc;
2226
2227 /* Disable IRQ6 */
2228 IPRB &= 0xff0f;
2229
2230 stop_playing();
2231 is_playing = false;
2232 paused = false;
2233
2234 /* Init the recording variables */
2235 is_recording = false;
2236 is_prerecording = false;
2237
2238 /* Have to grab the audio buffer in case voice had it */
2239 audio_reset_buffer();
2240
2241 mpeg_stop_done = true;
2242
2243 mas_reset();
2244
2245 /* Enable the audio CODEC and the DSP core, max analog voltage range */
2246 rc = mas_direct_config_write(MAS_CONTROL, 0x8c00);
2247 if(rc < 0)
2248 panicf("mas_ctrl_w: %d", rc);
2249
2250 /* Stop the current application */
2251 val = 0;
2252 mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
2253 do
2254 {
2255 mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
2256 } while(val);
2257
2258 /* Perform black magic as described by the data sheet */
2259 if((mas_version_code & 0x0fff) == 0x0102)
2260 {
2261 DEBUGF("Performing MAS black magic for B2 version\n");
2262 mas_writereg(0xa3, 0x98);
2263 mas_writereg(0x94, 0xfffff);
2264 val = 0;
2265 mas_writemem(MAS_BANK_D1, 0, &val, 1);
2266 mas_writereg(0xa3, 0x90);
2267 }
2268
2269 /* Enable A/D Converters */
2270 shadow_codec_reg0 = 0xcccd;
2271 mas_codec_writereg(0x0, shadow_codec_reg0);
2272
2273 /* Copy left channel to right (mono mode) */
2274 mas_codec_writereg(8, 0x8000);
2275
2276 /* ADC scale 0%, DSP scale 100%
2277 We use the DSP output for monitoring, because it works with all
2278 sources including S/PDIF */
2279 mas_codec_writereg(6, 0x0000);
2280 mas_codec_writereg(7, 0x4000);
2281
2282 /* No mute */
2283 shadow_soft_mute = 0;
2284 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute, 1);
2285
2286#ifdef HAVE_SPDIF_OUT
2287 val = 0x09; /* Disable SDO and SDI, low impedance S/PDIF outputs */
2288#else
2289 val = 0x2d; /* Disable SDO and SDI, disable S/PDIF output */
2290#endif
2291 mas_writemem(MAS_BANK_D0, MAS_D0_INTERFACE_CONTROL, &val, 1);
2292
2293 /* Set Demand mode, monitoring OFF and validate all settings */
2294 shadow_io_control_main = 0x125;
2295 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
2296
2297 /* Start the encoder application */
2298 val = 0x40;
2299 mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
2300 do
2301 {
2302 mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
2303 } while(!(val & 0x40));
2304
2305 /* We have started the recording application with monitoring OFF.
2306 This is because we want to record at least one frame to fill the DMA
2307 buffer, because the silly MAS will not negate EOD until at least one
2308 DMA transfer has taken place.
2309 Now let's wait for some data to be encoded. */
2310 sleep(HZ/5);
2311
2312 /* Now set it to Monitoring mode as default, saves power */
2313 shadow_io_control_main = 0x525;
2314 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
2315
2316 /* Wait until the DSP has accepted the settings */
2317 do
2318 {
2319 mas_readmem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val,1);
2320 } while(val & 1);
2321
2322 drain_dma_buffer();
2323 mpeg_mode = MPEG_ENCODER;
2324
2325 DEBUGF("MAS Recording application started\n");
2326
2327 /* At this point, all settings are the reset MAS defaults, next thing is to
2328 call mpeg_set_recording_options(). */
2329}
2330
2331void audio_record(const char *filename)
2332{
2333 mpeg_errno = 0;
2334
2335 strlcpy(recording_filename, filename, MAX_PATH);
2336
2337 queue_post(&mpeg_queue, MPEG_RECORD, 0);
2338}
2339
2340void audio_pause_recording(void)
2341{
2342 queue_post(&mpeg_queue, MPEG_PAUSE_RECORDING, 0);
2343}
2344
2345void audio_resume_recording(void)
2346{
2347 queue_post(&mpeg_queue, MPEG_RESUME_RECORDING, 0);
2348}
2349
2350static void prepend_header(void)
2351{
2352 int startpos;
2353 unsigned i;
2354
2355 /* Make room for header */
2356 audiobuf_read -= MPEG_RESERVED_HEADER_SPACE;
2357 if(audiobuf_read < 0)
2358 {
2359 /* Clear the bottom half */
2360 memset(mpeg_audiobuf, 0, audiobuf_read + MPEG_RESERVED_HEADER_SPACE);
2361
2362 /* And the top half */
2363 audiobuf_read += audiobuflen;
2364 memset(mpeg_audiobuf + audiobuf_read, 0, audiobuflen - audiobuf_read);
2365 }
2366 else
2367 {
2368 memset(mpeg_audiobuf + audiobuf_read, 0, MPEG_RESERVED_HEADER_SPACE);
2369 }
2370 /* Copy the empty ID3 header */
2371 startpos = audiobuf_read;
2372 for(i = 0; i < sizeof(empty_id3_header); i++)
2373 {
2374 mpeg_audiobuf[startpos++] = empty_id3_header[i];
2375 if(startpos == audiobuflen)
2376 startpos = 0;
2377 }
2378}
2379
2380static void update_header(void)
2381{
2382 int fd, framelen;
2383 unsigned long frames;
2384
2385 if (last_rec_bytes > 0)
2386 {
2387 /* Create the Xing header */
2388 fd = open(delayed_filename, O_RDWR);
2389 if (fd < 0)
2390 panicf("rec upd: %d (%s)", fd, recording_filename);
2391
2392 frames = frame_count_end - frame_count_start;
2393 /* If the number of recorded frames has reached 0x7ffff,
2394 we can no longer trust it */
2395 if (frame_count_end == 0x7ffff)
2396 frames = 0;
2397
2398 /* saved_header is saved right before stopping the MAS */
2399 framelen = create_xing_header(fd, 0, last_rec_bytes, xing_buffer,
2400 frames, last_rec_time * (1000/HZ),
2401 saved_header, NULL, false,
2402 mpeg_audiobuf, audiobuflen);
2403
2404 lseek(fd, MPEG_RESERVED_HEADER_SPACE - framelen, SEEK_SET);
2405 write(fd, xing_buffer, framelen);
2406 close(fd);
2407 }
2408}
2409
2410static void start_prerecording(void)
2411{
2412 unsigned long val;
2413
2414 DEBUGF("Starting prerecording\n");
2415
2416 prerecord_index = 0;
2417 prerecord_count = 0;
2418 prerecord_timeout = current_tick + HZ;
2419 memset(prerecord_buffer, 0, sizeof(prerecord_buffer));
2420 reset_mp3_buffer();
2421
2422 is_prerecording = true;
2423
2424 /* Stop monitoring and start the encoder */
2425 shadow_io_control_main &= ~(1 << 10);
2426 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
2427 DEBUGF("mas_writemem(MAS_BANK_D0, IO_CONTROL_MAIN, %x)\n", shadow_io_control_main);
2428
2429 /* Wait until the DSP has accepted the settings */
2430 do
2431 {
2432 mas_readmem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val,1);
2433 } while(val & 1);
2434
2435 is_recording = true;
2436 saving_status = NOT_SAVING;
2437
2438 demand_irq_enable(true);
2439}
2440
2441static void start_recording(void)
2442{
2443 unsigned long val;
2444
2445 if(is_prerecording)
2446 {
2447 /* This will make the IRQ handler start recording
2448 for real, i.e send MPEG_SAVE_DATA messages when
2449 the buffer is full */
2450 is_prerecording = false;
2451 }
2452 else
2453 {
2454 /* If prerecording is off, we need to stop the monitoring
2455 and start the encoder */
2456 shadow_io_control_main &= ~(1 << 10);
2457 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
2458 DEBUGF("mas_writemem(MAS_BANK_D0, IO_CONTROL_MAIN, %x)\n", shadow_io_control_main);
2459
2460 /* Wait until the DSP has accepted the settings */
2461 do
2462 {
2463 mas_readmem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val,1);
2464 } while(val & 1);
2465 }
2466
2467 is_recording = true;
2468 saving_status = NOT_SAVING;
2469 paused = false;
2470
2471 /* Store the current time */
2472 if(prerecording)
2473 record_start_time = current_tick - prerecord_count * HZ;
2474 else
2475 record_start_time = current_tick;
2476
2477 pause_start_time = 0;
2478
2479 demand_irq_enable(true);
2480}
2481
2482static void pause_recording(void)
2483{
2484 pause_start_time = current_tick;
2485
2486 /* Set the pause bit */
2487 shadow_soft_mute |= 2;
2488 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute, 1);
2489
2490 paused = true;
2491}
2492
2493static void resume_recording(void)
2494{
2495 paused = false;
2496
2497 /* Clear the pause bit */
2498 shadow_soft_mute &= ~2;
2499 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute, 1);
2500
2501 /* Compensate for the time we have been paused */
2502 if(pause_start_time)
2503 {
2504 record_start_time =
2505 current_tick - (pause_start_time - record_start_time);
2506 pause_start_time = 0;
2507 }
2508}
2509
2510static void stop_recording(void)
2511{
2512 unsigned long val;
2513
2514 /* Let it finish the last frame */
2515 if(!paused)
2516 pause_recording();
2517 sleep(HZ/5);
2518
2519 demand_irq_enable(false);
2520
2521 is_recording = false;
2522 is_prerecording = false;
2523
2524 last_rec_bytes = num_rec_bytes;
2525 mas_readmem(MAS_BANK_D0, MAS_D0_MPEG_FRAME_COUNT, &frame_count_end, 1);
2526 last_rec_time = current_tick - record_start_time;
2527
2528 /* Start monitoring */
2529 shadow_io_control_main |= (1 << 10);
2530 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
2531 DEBUGF("mas_writemem(MAS_BANK_D0, IO_CONTROL_MAIN, %x)\n", shadow_io_control_main);
2532
2533 /* Wait until the DSP has accepted the settings */
2534 do
2535 {
2536 mas_readmem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val,1);
2537 } while(val & 1);
2538
2539 resume_recording();
2540}
2541
2542void audio_set_recording_options(struct audio_recording_options *options)
2543{
2544 bool is_mpeg1;
2545
2546 is_mpeg1 = (options->rec_frequency < 3);
2547
2548 rec_version_index = is_mpeg1?3:2;
2549 rec_frequency_index = options->rec_frequency % 3;
2550
2551 shadow_encoder_control = (options->rec_quality << 17) |
2552 (rec_frequency_index << 10) |
2553 ((is_mpeg1?1:0) << 9) |
2554 (((options->rec_channels * 2 + 1) & 3) << 6) |
2555 (1 << 5) /* MS-stereo */ |
2556 (1 << 2) /* Is an original */;
2557 mas_writemem(MAS_BANK_D0, MAS_D0_ENCODER_CONTROL, &shadow_encoder_control,1);
2558
2559 DEBUGF("mas_writemem(MAS_BANK_D0, ENCODER_CONTROL, %x)\n", shadow_encoder_control);
2560
2561#if CONFIG_TUNER & S1A0903X01
2562 /* Store the (unpitched) MAS PLL frequency. Used for avoiding FM
2563 interference with the Samsung tuner. */
2564 if (rec_frequency_index)
2565 mas_store_pllfreq(24576000);
2566 else
2567 mas_store_pllfreq(22579000);
2568#endif
2569
2570 shadow_soft_mute = options->rec_editable?4:0;
2571 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &shadow_soft_mute,1);
2572
2573 DEBUGF("mas_writemem(MAS_BANK_D0, SOFT_MUTE, %x)\n", shadow_soft_mute);
2574
2575 shadow_io_control_main = ((1 << 10) | /* Monitoring ON */
2576 ((options->rec_source < 2)?1:2) << 8) | /* Input select */
2577 (1 << 5) | /* SDO strobe invert */
2578 ((is_mpeg1?0:1) << 3) |
2579 (1 << 2) | /* Inverted SIBC clock signal */
2580 1; /* Validate */
2581 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main,1);
2582
2583 DEBUGF("mas_writemem(MAS_BANK_D0, IO_CONTROL_MAIN, %x)\n", shadow_io_control_main);
2584
2585 if(options->rec_source == AUDIO_SRC_MIC)
2586 {
2587 /* Copy left channel to right (mono mode) */
2588 mas_codec_writereg(8, 0x8000);
2589 }
2590 else
2591 {
2592 /* Stereo input mode */
2593 mas_codec_writereg(8, 0);
2594 }
2595
2596 prerecording_max_seconds = options->rec_prerecord_time;
2597 if(prerecording_max_seconds)
2598 {
2599 prerecording = true;
2600 start_prerecording();
2601 }
2602 else
2603 {
2604 prerecording = false;
2605 is_prerecording = false;
2606 is_recording = false;
2607 }
2608}
2609
2610/* If use_mic is true, the left gain is used */
2611void audio_set_recording_gain(int left, int right, int type)
2612{
2613 /* Enable both left and right A/D */
2614 shadow_codec_reg0 = (left << 12) |
2615 (right << 8) |
2616 (left << 4) |
2617 (type==AUDIO_GAIN_MIC?0x0008:0) | /* Connect left A/D to mic */
2618 0x0007;
2619 mas_codec_writereg(0x0, shadow_codec_reg0);
2620}
2621
2622/* try to make some kind of beep, also in recording mode */
2623void audio_beep(int duration)
2624{
2625 long starttick = current_tick;
2626 do
2627 { /* toggle bit 0 of codec register 0, toggling the DAC off & on.
2628 * While this is still audible even without an external signal,
2629 * it doesn't affect the (pre-)recording. */
2630 mas_codec_writereg(0, shadow_codec_reg0 ^ 1);
2631 mas_codec_writereg(0, shadow_codec_reg0);
2632 yield();
2633 }
2634 while (current_tick - starttick < duration);
2635}
2636
2637void audio_new_file(const char *filename)
2638{
2639 mpeg_errno = 0;
2640
2641 strlcpy(recording_filename, filename, MAX_PATH);
2642
2643 queue_post(&mpeg_queue, MPEG_NEW_FILE, 0);
2644}
2645
2646unsigned long audio_recorded_time(void)
2647{
2648 if(is_prerecording)
2649 return prerecord_count * HZ;
2650
2651 if(is_recording)
2652 {
2653 if(paused)
2654 return pause_start_time - record_start_time;
2655 else
2656 return current_tick - record_start_time;
2657 }
2658
2659 return 0;
2660}
2661
2662unsigned long audio_num_recorded_bytes(void)
2663{
2664 int num_bytes;
2665 int index;
2666
2667 if(is_recording)
2668 {
2669 if(is_prerecording)
2670 {
2671 index = prerecord_index - prerecord_count;
2672 if(index < 0)
2673 index += prerecording_max_seconds;
2674
2675 num_bytes = audiobuf_write - prerecord_buffer[index].mempos;
2676 if(num_bytes < 0)
2677 num_bytes += audiobuflen;
2678
2679 return num_bytes;
2680 }
2681 else
2682 return num_rec_bytes;
2683 }
2684 else
2685 return 0;
2686}
2687
2688#else /* SIMULATOR */
2689
2690/* dummies coming up */
2691
2692void audio_init_playback(void)
2693{
2694 /* a dummy */
2695}
2696unsigned long audio_recorded_time(void)
2697{
2698 /* a dummy */
2699 return 0;
2700}
2701void audio_beep(int duration)
2702{
2703 /* a dummy */
2704 (void)duration;
2705}
2706void audio_pause_recording(void)
2707{
2708 /* a dummy */
2709}
2710void audio_resume_recording(void)
2711{
2712 /* a dummy */
2713}
2714unsigned long audio_num_recorded_bytes(void)
2715{
2716 /* a dummy */
2717 return 0;
2718}
2719void audio_record(const char *filename)
2720{
2721 /* a dummy */
2722 (void)filename;
2723}
2724void audio_new_file(const char *filename)
2725{
2726 /* a dummy */
2727 (void)filename;
2728}
2729
2730void audio_set_recording_gain(int left, int right, int type)
2731{
2732 /* a dummy */
2733 (void)left;
2734 (void)right;
2735 (void)type;
2736}
2737void audio_init_recording(void)
2738{
2739 /* a dummy */
2740}
2741void audio_set_recording_options(struct audio_recording_options *options)
2742{
2743 /* a dummy */
2744 (void)options;
2745}
2746#endif /* SIMULATOR */
2747#endif /* CONFIG_CODEC == MAS3587F */
2748
2749size_t audio_buffer_size(void) 1685size_t audio_buffer_size(void)
2750{ 1686{
2751 if (audiobuf_handle > 0) 1687 if (audiobuf_handle > 0)
@@ -2977,14 +1913,6 @@ int audio_status(void)
2977 if(paused) 1913 if(paused)
2978 ret |= AUDIO_STATUS_PAUSE; 1914 ret |= AUDIO_STATUS_PAUSE;
2979 1915
2980#if (CONFIG_CODEC == MAS3587F) && !defined(SIMULATOR)
2981 if(is_recording && !is_prerecording)
2982 ret |= AUDIO_STATUS_RECORD;
2983
2984 if(is_prerecording)
2985 ret |= AUDIO_STATUS_PRERECORD;
2986#endif /* CONFIG_CODEC == MAS3587F */
2987
2988 if(mpeg_errno) 1916 if(mpeg_errno)
2989 ret |= AUDIO_STATUS_ERROR; 1917 ret |= AUDIO_STATUS_ERROR;
2990 1918
@@ -3039,13 +1967,6 @@ void audio_init(void)
3039 1967
3040 memset(trackdata, 0, sizeof(trackdata)); 1968 memset(trackdata, 0, sizeof(trackdata));
3041 1969
3042#if (CONFIG_CODEC == MAS3587F) && !defined(SIMULATOR)
3043 if (HW_MASK & PR_ACTIVE_HIGH)
3044 and_b(~0x08, &PADRH);
3045 else
3046 or_b(0x08, &PADRH);
3047#endif /* CONFIG_CODEC == MAS3587F */
3048
3049#ifdef DEBUG 1970#ifdef DEBUG
3050#ifndef SIMULATOR 1971#ifndef SIMULATOR
3051 dbg_timer_start(); 1972 dbg_timer_start();
diff --git a/apps/plugin.c b/apps/plugin.c
index 4293d861f9..959232ddb7 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -318,13 +318,9 @@ static const struct plugin_api rockbox_api = {
318 viewport_set_fullscreen, 318 viewport_set_fullscreen,
319#endif 319#endif
320 320
321#ifdef HAVE_BACKLIGHT
321 /* lcd backlight */ 322 /* lcd backlight */
322 /* The backlight_* functions must be present in the API regardless whether 323 /* For OLED targets like the Sansa Clip, the backlight_* functions control
323 * HAVE_BACKLIGHT is defined or not. The reason is that the stock Ondio has
324 * no backlight but can be modded to have backlight (it's prepared on the
325 * PCB). This makes backlight an all-target feature API wise, and keeps API
326 * compatible between stock and modded Ondio.
327 * For OLED targets like the Sansa Clip, the backlight_* functions control
328 * the display enable, which has essentially the same effect. */ 324 * the display enable, which has essentially the same effect. */
329 is_backlight_on, 325 is_backlight_on,
330 backlight_on, 326 backlight_on,
@@ -346,6 +342,7 @@ static const struct plugin_api rockbox_api = {
346 remote_backlight_set_timeout_plugged, 342 remote_backlight_set_timeout_plugged,
347#endif 343#endif
348#endif /* HAVE_REMOTE_LCD */ 344#endif /* HAVE_REMOTE_LCD */
345#endif /* HAVE_BACKLIGHT */
349 346
350 /* list */ 347 /* list */
351 gui_synclist_init, 348 gui_synclist_init,
@@ -615,8 +612,7 @@ static const struct plugin_api rockbox_api = {
615#ifdef AUDIOHW_HAVE_EQ 612#ifdef AUDIOHW_HAVE_EQ
616 sound_enum_hw_eq_band_setting, 613 sound_enum_hw_eq_band_setting,
617#endif 614#endif
618#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \ 615#if ((CONFIG_CODEC == SWCODEC)) && defined (HAVE_PITCHCONTROL)
619 (CONFIG_CODEC == SWCODEC)) && defined (HAVE_PITCHCONTROL)
620 sound_set_pitch, 616 sound_set_pitch,
621#endif 617#endif
622#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 618#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
@@ -684,13 +680,6 @@ static const struct plugin_api rockbox_api = {
684 keyclick_click, 680 keyclick_click,
685#endif /* CONFIG_CODEC == SWCODEC */ 681#endif /* CONFIG_CODEC == SWCODEC */
686 682
687#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
688 peak_meter_scale_value,
689 peak_meter_set_use_dbfs,
690 peak_meter_get_use_dbfs,
691#endif
692
693
694 /* metadata */ 683 /* metadata */
695 get_metadata, 684 get_metadata,
696 mp3info, 685 mp3info,
@@ -742,21 +731,6 @@ static const struct plugin_api rockbox_api = {
742 mpeg_get_last_header, 731 mpeg_get_last_header,
743#endif 732#endif
744 733
745#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
746 /* MAS communication */
747 mas_readmem,
748 mas_writemem,
749 mas_readreg,
750 mas_writereg,
751#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
752 mas_codec_writereg,
753 mas_codec_readreg,
754 i2c_begin,
755 i2c_end,
756 i2c_write,
757#endif
758#endif /* !SIMULATOR && CONFIG_CODEC != SWCODEC */
759
760 /* menu */ 734 /* menu */
761 root_menu_get_options, 735 root_menu_get_options,
762 do_menu, 736 do_menu,
diff --git a/apps/plugin.h b/apps/plugin.h
index acaee27687..ecc662cb7f 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -88,8 +88,6 @@ void* plugin_get_buffer(size_t *buffer_size);
88#ifdef HAVE_RECORDING 88#ifdef HAVE_RECORDING
89#include "recording.h" 89#include "recording.h"
90#endif 90#endif
91#else
92#include "mas35xx.h"
93#endif /* CONFIG_CODEC == SWCODEC */ 91#endif /* CONFIG_CODEC == SWCODEC */
94#include "settings.h" 92#include "settings.h"
95#include "timer.h" 93#include "timer.h"
@@ -355,13 +353,9 @@ struct plugin_api {
355 const enum screen_type screen); 353 const enum screen_type screen);
356#endif 354#endif
357 355
356#ifdef HAVE_BACKLIGHT
358 /* lcd backlight */ 357 /* lcd backlight */
359 /* The backlight_* functions must be present in the API regardless whether 358 /* For OLED targets like the Sansa Clip, the backlight_* functions control
360 * HAVE_BACKLIGHT is defined or not. The reason is that the stock Ondio has
361 * no backlight but can be modded to have backlight (it's prepared on the
362 * PCB). This makes backlight an all-target feature API wise, and keeps API
363 * compatible between stock and modded Ondio.
364 * For OLED targets like the Sansa Clip, the backlight_* functions control
365 * the display enable, which has essentially the same effect. */ 359 * the display enable, which has essentially the same effect. */
366 bool (*is_backlight_on)(bool ignore_always_off); 360 bool (*is_backlight_on)(bool ignore_always_off);
367 void (*backlight_on)(void); 361 void (*backlight_on)(void);
@@ -383,6 +377,7 @@ struct plugin_api {
383 void (*remote_backlight_set_timeout_plugged)(int index); 377 void (*remote_backlight_set_timeout_plugged)(int index);
384#endif 378#endif
385#endif /* HAVE_REMOTE_LCD */ 379#endif /* HAVE_REMOTE_LCD */
380#endif /* HAVE_BACKLIGHT */
386 381
387 /* list */ 382 /* list */
388 void (*gui_synclist_init)(struct gui_synclist * lists, 383 void (*gui_synclist_init)(struct gui_synclist * lists,
@@ -689,8 +684,7 @@ struct plugin_api {
689 int (*sound_enum_hw_eq_band_setting)(unsigned int band, 684 int (*sound_enum_hw_eq_band_setting)(unsigned int band,
690 unsigned int band_setting); 685 unsigned int band_setting);
691#endif /* AUDIOHW_HAVE_EQ */ 686#endif /* AUDIOHW_HAVE_EQ */
692#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \ 687#if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL))
693 (CONFIG_CODEC == SWCODEC)) && defined (HAVE_PITCHCONTROL)
694 void (*sound_set_pitch)(int32_t pitch); 688 void (*sound_set_pitch)(int32_t pitch);
695#endif 689#endif
696#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 690#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
@@ -771,13 +765,6 @@ struct plugin_api {
771 void (*keyclick_click)(bool rawbutton, int action); 765 void (*keyclick_click)(bool rawbutton, int action);
772#endif /* CONFIG_CODEC == SWCODEC */ 766#endif /* CONFIG_CODEC == SWCODEC */
773 767
774#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
775 unsigned short (*peak_meter_scale_value)(unsigned short val,
776 int meterwidth);
777 void (*peak_meter_set_use_dbfs)(bool use);
778 bool (*peak_meter_get_use_dbfs)(void);
779#endif
780
781 /* metadata */ 768 /* metadata */
782 bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname); 769 bool (*get_metadata)(struct mp3entry* id3, int fd, const char* trackname);
783 bool (*mp3info)(struct mp3entry *entry, const char *filename); 770 bool (*mp3info)(struct mp3entry *entry, const char *filename);
@@ -845,21 +832,6 @@ struct plugin_api {
845 unsigned long (*mpeg_get_last_header)(void); 832 unsigned long (*mpeg_get_last_header)(void);
846#endif 833#endif
847 834
848 /* MAS communication */
849#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
850 int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len);
851 int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len);
852 int (*mas_readreg)(int reg);
853 int (*mas_writereg)(int reg, unsigned int val);
854#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
855 int (*mas_codec_writereg)(int reg, unsigned int val);
856 int (*mas_codec_readreg)(int reg);
857 void (*i2c_begin)(void);
858 void (*i2c_end)(void);
859 int (*i2c_write)(int address, const unsigned char* buf, int count );
860#endif
861#endif /* !SIMULATOR && CONFIG_CODEC != SWCODEC */
862
863 /* menu */ 835 /* menu */
864 struct menu_table *(*root_menu_get_options)(int *nb_options); 836 struct menu_table *(*root_menu_get_options)(int *nb_options);
865 int (*do_menu)(const struct menu_item_ex *menu, int *start_selected, 837 int (*do_menu)(const struct menu_item_ex *menu, int *start_selected,
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 9e153a3c96..197f58ef5c 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -86,7 +86,7 @@ wolf3d.c
86 86
87#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP) 87#if PLUGIN_BUFFER_SIZE <= 0x20000 && defined(HAVE_LCD_BITMAP)
88 88
89#if CONFIG_KEYPAD != ONDIO_PAD && CONFIG_KEYPAD != SANSA_M200_PAD \ 89#if CONFIG_KEYPAD != SANSA_M200_PAD \
90 && CONFIG_KEYPAD != HM60X_PAD 90 && CONFIG_KEYPAD != HM60X_PAD
91/* not enough buttons for rockboy */ 91/* not enough buttons for rockboy */
92rockboy.c 92rockboy.c
@@ -106,44 +106,16 @@ pictureflow.c
106splitedit.c 106splitedit.c
107#endif 107#endif
108 108
109#if CONFIG_LCD == LCD_SSD1815
110video.c
111#endif
112
113#endif /* HWCODEC */ 109#endif /* HWCODEC */
114 110
115
116#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \
117 defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
118alpine_cdc.c
119#endif
120
121#if defined(ARCHOS_PLAYER) || defined(ARCHOS_RECORDER) || \
122 defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2) || \
123 defined(ARCHOS_ONDIOFM) || defined(ARCHOS_ONDIOSP)
124firmware_flash.c
125#endif
126
127#if defined(IRIVER_H100_SERIES) 111#if defined(IRIVER_H100_SERIES)
128iriver_flash.c 112iriver_flash.c
129#endif 113#endif
130 114
131#if (CONFIG_CPU == SH7034)
132rockbox_flash.c
133#endif /* CONFIG_CPU */
134
135#if defined(IPOD_NANO2G) 115#if defined(IPOD_NANO2G)
136crypt_firmware.c 116crypt_firmware.c
137#endif 117#endif
138 118
139#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
140wavplay.c
141#endif
142
143#if (CONFIG_CODEC == MAS3587F)
144wavrecord.c
145#endif
146
147#endif /* PLATFORM_NATIVE */ 119#endif /* PLATFORM_NATIVE */
148 120
149metronome.c 121metronome.c
@@ -217,11 +189,6 @@ rocklife.c
217 189
218#endif /* HAVE_LCD_BITMAP */ 190#endif /* HAVE_LCD_BITMAP */
219 191
220#ifdef HAVE_LCD_CHARCELLS /* Archos Player model only */
221euroconverter.c
222nim.c
223#endif /* HAVE_LCD_CHARCELLS */
224
225#if LCD_DEPTH > 1 /* non-mono bitmap targets */ 192#if LCD_DEPTH > 1 /* non-mono bitmap targets */
226 193
227matrix.c 194matrix.c
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index ecface0e40..5fd2d433c7 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -24,8 +24,7 @@ sdl
24puzzles 24puzzles
25#endif 25#endif
26 26
27#if (CONFIG_KEYPAD != ONDIO_PAD) /* not enough buttons */ \ 27#if (CONFIG_KEYPAD != SANSA_M200_PAD) /* not enough buttons */ \
28 && (CONFIG_KEYPAD != SANSA_M200_PAD) /* not enough buttons */ \
29 && (CONFIG_KEYPAD != HM60X_PAD) /* not enough buttons */ \ 28 && (CONFIG_KEYPAD != HM60X_PAD) /* not enough buttons */ \
30 && (LCD_PIXELFORMAT != HORIZONTAL_PACKING) /* TODO */ \ 29 && (LCD_PIXELFORMAT != HORIZONTAL_PACKING) /* TODO */ \
31 && (LCD_PIXELFORMAT != VERTICAL_INTERLEAVED) /* TODO */ \ 30 && (LCD_PIXELFORMAT != VERTICAL_INTERLEAVED) /* TODO */ \
@@ -48,11 +47,7 @@ imageviewer
48sudoku 47sudoku
49reversi 48reversi
50goban 49goban
51
52/* setjmp/longjmp are not implemented on sh */
53#if (CONFIG_CPU != SH7034)
54frotz 50frotz
55#endif
56 51
57#ifndef OLYMPUS_MROBE_500 52#ifndef OLYMPUS_MROBE_500
58#if PLUGIN_BUFFER_SIZE > 0x40000 || PLUGIN_BUFFER_SIZE <= 0x20000 /* overlay */ 53#if PLUGIN_BUFFER_SIZE > 0x40000 || PLUGIN_BUFFER_SIZE <= 0x20000 /* overlay */
diff --git a/apps/plugins/alpine_cdc.c b/apps/plugins/alpine_cdc.c
deleted file mode 100644
index 93d9418f65..0000000000
--- a/apps/plugins/alpine_cdc.c
+++ /dev/null
@@ -1,1195 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 *
11 * Copyright (C) 2003-2005 Jörg Hohensohn
12 *
13 * Alpine CD changer Project
14 * This is a feasibility study for Archos emulating an Alpine M-Bus CD changer.
15 *
16 * Currently it will do seeks and change tracks, but nothing like disks.
17 * The debug version shows a dump of the M-Bus communication on screen.
18 *
19 * Usage: Start plugin, it will stay in the background and do the emulation.
20 * You need to make an adapter with an 8-pin DIN plug for the radio at one end
21 * and a 4-ring 3.5 mm plug for the Archos headphone jack at the other.
22 * The Archos remote pin connects to the M-Bus, audio as usual.
23 *
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU General Public License
26 * as published by the Free Software Foundation; either version 2
27 * of the License, or (at your option) any later version.
28 *
29 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
30 * KIND, either express or implied.
31 *
32 ****************************************************************************/
33
34#include "plugin.h"
35
36#ifdef HAVE_LCD_CHARCELLS /* player model */
37#define LINES 2
38#define COLUMNS 11
39#else /* recorder models */
40#define LINES 8
41#define COLUMNS 32 /* can't really tell for proportional font */
42#endif
43
44/****************** imports ******************/
45
46#include "sh7034.h"
47#include "system.h"
48
49/****************** constants ******************/
50
51/* measured bit time on the M-Bus is 3.075 ms = 325.2 Hz */
52#define MBUS_BAUDRATE 3252 /* make it 10 * bittime */
53#define MBUS_STEP_FREQ (MBUS_BAUDRATE/2) /* 5 steps per bit */
54#define MBUS_BIT_FREQ (MBUS_BAUDRATE/10) /* the true bit frequency again */
55
56#define MBUS_MAX_SIZE 16 /* maximum length of an M-Bus packet, incl. checksum */
57#define MBUS_RCV_QUEUESIZE 4 /* how many packets can be queued by receiver */
58
59#define ERI1 (*((volatile unsigned long*)0x090001A0)) /* RX error */
60#define RXI1 (*((volatile unsigned long*)0x090001A4)) /* RX */
61
62#define PB10 0x0400
63
64/* receive status */
65#define RX_BUSY 0 /* reception in progress */
66#define RX_RECEIVED 1 /* valid data available */
67#define RX_FRAMING 2 /* frame error */
68#define RX_OVERRUN 3 /* receiver overrun */
69#define RX_PARITY 4 /* parity error */
70#define RX_SYMBOL 5 /* invalid bit timing */
71#define RX_OVERFLOW 6 /* buffer full */
72#define RX_OVERLAP 7 /* receive interrupt while transmitting */
73
74/* timer operation mode */
75#define TM_OFF 0 /* not in use */
76#define TM_TRANSMIT 1 /* periodic timer to transmit */
77#define TM_RX_TIMEOUT 2 /* single shot for receive timeout */
78
79/* emulation play state */
80#define EMU_IDLE 0
81#define EMU_PREPARING 1
82#define EMU_STOPPED 2
83#define EMU_PAUSED 3
84#define EMU_PLAYING 4
85#define EMU_SPINUP 5
86#define EMU_FF 6
87#define EMU_FR 7
88
89
90/****************** prototypes ******************/
91
92void timer_init(unsigned hz, unsigned to); /* setup static timer registers and values */
93void timer_set_mode(int mode); /* define for what the timer should be used right now */
94void timer4_isr(void); /* IMIA4 ISR */
95
96void transmit_isr(void); /* 2nd level ISR for M-Bus transmission */
97
98void uart_init(unsigned baudrate); /* UART setup */
99void uart_rx_isr(void) __attribute__((interrupt_handler)); /* RXI1 ISR */
100void uart_err_isr(void) __attribute__((interrupt_handler)); /* ERI1 ISR */
101void receive_timeout_isr(void); /* 2nd level ISR for receiver timeout */
102
103void mbus_init(void); /* prepare the M-Bus layer */
104int mbus_send(unsigned char* p_msg, int digits); /* packet send */
105int mbus_receive(unsigned char* p_msg, unsigned bufsize, int timeout); /* packet receive */
106
107unsigned char calc_checksum(unsigned char* p_msg, int digits); /* make M-Bus checksum */
108bool bit_test(unsigned char* buf, unsigned bit); /* test one bit of M-Bus packet */
109void bit_set(unsigned char* buf, unsigned bit, bool val); /* set/clear one bit of M-Bus packet */
110
111void print_scroll(char* string); /* implements a scrolling screen */
112void dump_packet(char* dest, int dst_size, char* src, int n); /* convert packet to ASCII */
113
114void emu_init(void); /* init changer emulation */
115void emu_process_packet(unsigned char* mbus_msg, int msg_size); /* feed a received radio packet */
116void emu_tick(void); /* for regular actions of the emulator */
117
118int get_playtime(void); /* return the current track time in seconds */
119int get_tracklength(void); /* return the total length of the current track */
120void set_track(int selected);
121int get_track(void); /* return the track number */
122void set_play(void); /* start or resume playback */
123void set_pause(void); /* pause playback */
124void set_stop(void); /* stop playback */
125void set_position(int seconds); /* seek */
126void get_playmsg(void); /* update the play message with Rockbox info */
127void get_diskmsg(void); /* update the disk status message with Rockbox info */
128
129void sound_neutral(void); /* set to everything flat and 0 dB volume */
130void sound_normal(void); /* return to user settings */
131
132void thread(void); /* the thread running it all */
133int main(const void* parameter); /* main loop */
134enum plugin_status plugin_start(const void* parameter); /* entry */
135
136
137/****************** data types ******************/
138
139/* one entry in the receive queue */
140typedef struct
141{
142 unsigned char buf[MBUS_MAX_SIZE]; /* message buffer */
143 unsigned size; /* length of data in the buffer */
144 unsigned error; /* error code from reception */
145} t_rcv_queue_entry;
146
147
148/****************** globals ******************/
149
150
151/* information owned by the timer transmit ISR */
152struct
153{
154 unsigned char send_buf[MBUS_MAX_SIZE]; /* M-Bus message */
155 unsigned send_size; /* current length of data in the buffer */
156 unsigned index; /* index for which byte to send */
157 unsigned byte; /* which byte to send */
158 unsigned bitmask; /* which bit to send */
159 unsigned step; /* where in the pulse are we */
160 bool bit; /* currently sent bit */
161 bool collision; /* set if a collision happened */
162 bool busy; /* flag if in transmission */
163} gSendIRQ;
164
165
166/* information owned by the UART receive ISR */
167struct
168{
169 t_rcv_queue_entry queue[MBUS_RCV_QUEUESIZE]; /* M-Bus message queue */
170 unsigned buf_read; /* readout maintained by the user application */
171 unsigned buf_write; /* writing maintained by ISR */
172 bool overflow; /* indicate queue overflow */
173 unsigned byte; /* currently assembled byte */
174 unsigned bit; /* which bit to receive */
175} gRcvIRQ;
176
177
178/* information owned by the timer */
179struct
180{
181 unsigned mode; /* off, transmit, receive timout */
182 unsigned transmit; /* value for transmit */
183 unsigned timeout; /* value for receive timeout */
184} gTimer;
185
186
187/* information owned by the changer emulation */
188struct
189{
190 unsigned char playmsg[15]; /* current play state msg */
191 unsigned char changemsg[11]; /* changing message */
192 unsigned char diskmsg[12]; /* disk status message */
193 long poll_interval; /* call the emu each n ticks */
194 int time; /* seconds within the song */
195 int set_state; /* the desired state to change into */
196} gEmu;
197
198
199/* communication to the worker thread */
200struct
201{
202 bool foreground; /* set as long as we're owning the UI */
203 bool exiting; /* signal to the thread that we want to exit */
204 unsigned int thread; /* worker thread id */
205} gTread;
206
207
208/****************** implementation ******************/
209
210
211/* setup static timer registers and values */
212void timer_init(unsigned hz, unsigned to)
213{
214 rb->memset(&gTimer, 0, sizeof(gTimer));
215
216 gTimer.transmit = TIMER_FREQ / hz; /* time for bit transitions */
217 gTimer.timeout = TIMER_FREQ / to; /* time for receive timeout */
218}
219
220
221/* define for what the timer should be used right now */
222void timer_set_mode(int mode)
223{
224 TCNT4 = 0; /* start counting at 0 */
225 gTimer.mode = mode; /* store the mode */
226
227 if (mode == TM_RX_TIMEOUT)
228 {
229 rb->timer_register(1, NULL, gTimer.timeout, timer4_isr IF_COP(, CPU));
230 IPRD = (IPRD & 0xFF0F) | 11 << 4; /* interrupt priority */
231 }
232 else if (mode == TM_TRANSMIT)
233 {
234 rb->timer_register(1, NULL, gTimer.transmit, timer4_isr IF_COP(, CPU));
235 IPRD = (IPRD & 0xFF0F) | 14 << 4; /* interrupt priority */
236 }
237 else
238 {
239 rb->timer_unregister();
240 }
241}
242
243
244void timer4_isr(void) /* IMIA4 */
245{
246 switch (gTimer.mode)
247 { /* distribute the interrupt */
248 case TM_TRANSMIT:
249 transmit_isr();
250 break;
251 case TM_RX_TIMEOUT:
252 receive_timeout_isr();
253 rb->timer_unregister(); /* single shot */
254 break;
255 default:
256 timer_set_mode(TM_OFF); /* spurious interrupt */
257 } /* switch */
258}
259
260
261/* About Alpine M-Bus
262 * ------------------
263 *
264 * The protocol uses a single wire in half duplex mode.
265 * A bit like I2C, this wire is either pulled low or left floating high.
266 * Bit time is ~3 ms, a "zero" is coded as ~0.6 ms low, a "one" as ~1.8 ms low.
267 * Nice to view in a 0.6 ms grid:
268 *
269 * 0 0.6 1.2 1.8 2.4 3.0
270 * | | | | | |
271 * __ ___________________
272 * \____/ \ "zero" bit
273 * __ _________
274 * \______________/ \ "one" bit
275 *
276 * So I send out the data in a timer interrupt spawned to 0.6 ms.
277 * In phases where the line is floating high, I can check for collisions.
278 * (happens if the other side driving it low, too.)
279 *
280 * Data is transmitted in multiples of 4 bit, to ease BCD representation.
281 */
282
283
284/* 2nd level ISR for M-Bus transmission */
285void transmit_isr(void)
286{
287 bool exit = false;
288
289 TSR4 &= ~0x01; /* clear the interrupt */
290
291 switch(gSendIRQ.step++)
292 {
293 case 0:
294 and_b(~0x04, &PBDRH); /* low (read-modify-write access may have changed it while it was input) */
295 or_b(0x04, &PBIORH); /* drive low (output) */
296 break;
297 case 1: /* 0.6 ms */
298 if (!gSendIRQ.bit) /* sending "zero"? */
299 and_b(~0x04, &PBIORH); /* float (input) */
300 break;
301 case 2: /* 1.2 ms */
302 if (!gSendIRQ.bit && ((PBDR & PB10) == 0))
303 gSendIRQ.collision = true;
304 break;
305 case 3: /* 1.8 ms */
306 if (gSendIRQ.bit) /* sending "one"? */
307 and_b(~0x04, &PBIORH); /* float (input) */
308 else if ((PBDR & PB10) == 0)
309 gSendIRQ.collision = true;
310 break;
311 case 4: /* 2.4 ms */
312 if ((PBDR & PB10) == 0)
313 gSendIRQ.collision = true;
314
315 /* prepare next round */
316 gSendIRQ.step = 0;
317 gSendIRQ.bitmask >>= 1;
318 if (gSendIRQ.bitmask)
319 { /* new bit */
320 gSendIRQ.bit = (gSendIRQ.byte & gSendIRQ.bitmask) != 0;
321 }
322 else
323 { /* new byte */
324 if (++gSendIRQ.index < gSendIRQ.send_size)
325 {
326 gSendIRQ.bitmask = 0x08;
327 gSendIRQ.byte = gSendIRQ.send_buf[gSendIRQ.index];
328 gSendIRQ.bit = (gSendIRQ.byte & gSendIRQ.bitmask) != 0;
329 }
330 else
331 exit = true; /* done */
332 }
333 break;
334 }
335
336 if (exit || gSendIRQ.collision)
337 { /* stop transmission */
338 or_b(0x20, PBCR1_ADDR+1); /* RxD1 again for PB10 */
339 timer_set_mode(TM_OFF); /* stop the timer */
340 gSendIRQ.busy = false; /* do this last, to avoid race conditions */
341 }
342}
343
344
345/* For receiving, I use the "normal" serial RX feature of the CPU,
346 * so we can receive within an interrupt, no line polling necessary.
347 * Luckily, the M-Bus bit always starts with a falling edge and ends with a high,
348 * this matches with the start bit and the stop bit of a serial transmission.
349 * The baudrate is set such that the M-Bus bit time (ca. 3ms) matches
350 * the serial reception time of one byte, so we receive one byte per
351 * M-Bus bit.
352 * Start bit, 8 data bits and stop bit (total=10) nicely fall into the 5
353 * phases like above:
354 *
355 * 0 0.6 1.2 1.8 2.4 3.0 ms
356 * | | | | | | time
357 * __ _______________________________
358 * \_______/ \ "zero" bit
359 * __ _______________
360 * \_______________________/ \ "one" bit
361 *
362 * | | | | | | | | | | | serial sampling interval
363 * Start 0 1 2 3 4 5 6 7 Stop bit (LSB first!)
364 *
365 * By looking at the bit pattern in the serial byte we can distinguish
366 * the short low from the longer low, tell "zero" and "one" apart.
367 * So we receive 0xFE for a "zero", 0xE0 for a "one".
368 * It may be necessary to treat the bits next to transitions as don't care,
369 * in case the timing is not so accurate.
370 * Bits are always sent "back-to-back", so I detect the packet end by timeout.
371 */
372
373
374void uart_init(unsigned baudrate)
375{
376 RXI1 = (unsigned long)uart_rx_isr; /* install ISR */
377 ERI1 = (unsigned long)uart_err_isr; /* install ISR */
378
379 SCR1 = 0x00; /* disable everything; select async mode with SCK pin as I/O */
380 SMR1 = 0x00; /* async, 8N1, NoMultiProc, sysclock/1 */
381 BRR1 = ((FREQ/(32*baudrate))-1);
382
383 IPRE = (IPRE & ~0xf000) | 0xc000; /* interrupt on level 12 */
384
385 rb->sleep(1); /* hardware needs to settle for at least one bit interval */
386
387 and_b(~(SCI_RDRF | SCI_ORER | SCI_FER | SCI_PER), &SSR1); /* clear any receiver flag */
388 or_b(SCI_RE | SCI_RIE , &SCR1); /* enable the receiver with interrupt */
389}
390
391
392void uart_rx_isr(void) /* RXI1 */
393{
394 unsigned char data;
395 t_rcv_queue_entry* p_entry = &gRcvIRQ.queue[gRcvIRQ.buf_write]; /* short cut */
396
397 data = RDR1; /* get data */
398
399 and_b(~SCI_RDRF, &SSR1); /* clear data received flag */
400
401 if (gTimer.mode == TM_TRANSMIT)
402 p_entry->error = RX_OVERLAP; /* oops, we're also transmitting, stop */
403 else
404 timer_set_mode(TM_RX_TIMEOUT); /* (re)spawn timeout */
405
406 if (p_entry->error != RX_BUSY)
407 return;
408
409 if ((data & ~0x00) == 0xFE) /* 01111111 in line order (reverse) */
410 { /* "zero" received */
411 gRcvIRQ.byte <<= 1;
412 }
413 else if ((data & ~0x00) == 0xE0) /* 00000111 in line order (reverse) */
414 { /* "one" received */
415 gRcvIRQ.byte = gRcvIRQ.byte << 1 | 0x01;
416 }
417 else
418 { /* unrecognized pulse */
419 p_entry->error = RX_SYMBOL;
420 }
421
422 if (p_entry->error == RX_BUSY)
423 {
424 if (++gRcvIRQ.bit >= 4)
425 { /* byte completed */
426 if (p_entry->size >= sizeof(p_entry->buf))
427 {
428 p_entry->error = RX_OVERFLOW; /* buffer full */
429 }
430 else
431 {
432 p_entry->buf[p_entry->size] = gRcvIRQ.byte;
433 gRcvIRQ.byte = 0;
434 gRcvIRQ.bit = 0;
435 p_entry->size++;
436 }
437 }
438 }
439}
440
441
442void uart_err_isr(void) /* ERI1 */
443{
444 t_rcv_queue_entry* p_entry = &gRcvIRQ.queue[gRcvIRQ.buf_write]; /* short cut */
445
446 if (p_entry->error == RX_BUSY)
447 { /* terminate reception in case of error */
448 if (SSR1 & SCI_FER)
449 p_entry->error = RX_FRAMING;
450 else if (SSR1 & SCI_ORER)
451 p_entry->error = RX_OVERRUN;
452 else if (SSR1 & SCI_PER)
453 p_entry->error = RX_PARITY;
454 }
455
456 /* clear any receiver flag */
457 and_b(~(SCI_RDRF | SCI_ORER | SCI_FER | SCI_PER), &SSR1);
458}
459
460
461/* 2nd level ISR for receiver timeout, this finalizes reception */
462void receive_timeout_isr(void)
463{
464 t_rcv_queue_entry* p_entry = &gRcvIRQ.queue[gRcvIRQ.buf_write]; /* short cut */
465
466 timer_set_mode(TM_OFF); /* single shot */
467
468 if (p_entry->error == RX_BUSY) /* everthing OK so far? */
469 p_entry->error = RX_RECEIVED; /* end with valid data */
470
471 /* move to next queue entry */
472 gRcvIRQ.buf_write++;
473 if (gRcvIRQ.buf_write >= MBUS_RCV_QUEUESIZE)
474 gRcvIRQ.buf_write = 0;
475 p_entry = &gRcvIRQ.queue[gRcvIRQ.buf_write];
476
477 if (gRcvIRQ.buf_write == gRcvIRQ.buf_read)
478 { /* queue overflow */
479 gRcvIRQ.overflow = true;
480 /* what can I do? Continueing overwrites the oldest. */
481 }
482
483 gRcvIRQ.byte = 0;
484 gRcvIRQ.bit = 0;
485 p_entry->size = 0;
486 p_entry->error = RX_BUSY; /* enable receive on new entry */
487}
488
489
490/* generate the checksum */
491unsigned char calc_checksum(unsigned char* p_msg, int digits)
492{
493 int chk = 0;
494 int i;
495
496 for (i=0; i<digits; i++)
497 {
498 chk ^= p_msg[i];
499 }
500 chk = (chk+1) % 16;
501
502 return chk;
503}
504
505
506/****************** high-level M-Bus functions ******************/
507
508void mbus_init(void)
509{
510 /* init the send object */
511 rb->memset(&gSendIRQ, 0, sizeof(gSendIRQ));
512 timer_init(MBUS_STEP_FREQ, (MBUS_BIT_FREQ*10)/15); /* setup frequency and timeout (1.5 bit) */
513
514 /* init receiver */
515 rb->memset(&gRcvIRQ, 0, sizeof(gRcvIRQ));
516 uart_init(MBUS_BAUDRATE);
517}
518
519
520/* send out a number of BCD digits (one per byte) with M-Bus protocol */
521int mbus_send(unsigned char* p_msg, int digits)
522{
523 /* wait for previous transmit/receive to end */
524 while(gTimer.mode != TM_OFF) /* wait for "free line" */
525 rb->sleep(1);
526
527 /* fill in our part */
528 rb->memcpy(gSendIRQ.send_buf, p_msg, digits);
529
530 /* add checksum */
531 gSendIRQ.send_buf[digits] = calc_checksum(p_msg, digits);
532 digits++;
533
534 /* debug dump, to be removed */
535 if (gTread.foreground)
536 {
537 char buf[MBUS_MAX_SIZE+1];
538 dump_packet(buf, sizeof(buf), gSendIRQ.send_buf, digits);
539 /*print_scroll(buf); */
540 }
541
542 gSendIRQ.send_size = digits;
543
544 /* prepare everything so the ISR can start right away */
545 gSendIRQ.index = 0;
546 gSendIRQ.byte = gSendIRQ.send_buf[0];
547 gSendIRQ.bitmask = 0x08;
548 gSendIRQ.step = 0;
549 gSendIRQ.bit = (gSendIRQ.byte & gSendIRQ.bitmask) != 0;
550 gSendIRQ.collision = false;
551 gSendIRQ.busy = true;
552
553 /* last chance to wait for a new detected receive to end */
554 while(gTimer.mode != TM_OFF) /* wait for "free line" */
555 rb->sleep(1);
556
557 and_b(~0x30, PBCR1_ADDR+1); /* GPIO for PB10 */
558 timer_set_mode(TM_TRANSMIT); /* run */
559
560 /* make the call blocking until sent out */
561 rb->sleep(digits*4*HZ/MBUS_BIT_FREQ); /* should take this long */
562
563 while(gSendIRQ.busy) /* poll in case it lasts longer */
564 rb->sleep(1); /* (should not happen) */
565
566 /* debug output, to be removed */
567 if (gTread.foreground)
568 {
569 if (gSendIRQ.collision)
570 print_scroll("collision");
571 }
572
573 return gSendIRQ.collision;
574}
575
576
577/* returns the size of message copy, 0 if timed out, negative on error */
578int mbus_receive(unsigned char* p_msg, unsigned bufsize, int timeout)
579{
580 int retval = 0;
581
582 do
583 {
584 if (gRcvIRQ.buf_read != gRcvIRQ.buf_write)
585 { /* something in the queue */
586 t_rcv_queue_entry* p_entry = &gRcvIRQ.queue[gRcvIRQ.buf_read]; /* short cut */
587
588 if (p_entry->error == RX_RECEIVED)
589 { /* seems valid */
590 rb->memcpy(p_msg, p_entry->buf, MIN(p_entry->size, bufsize));
591 retval = p_entry->size; /* return message size */
592 }
593 else
594 { /* an error occured */
595 retval = - p_entry->error; /* return negative number */
596 }
597
598 /* next queue readout position */
599 gRcvIRQ.buf_read++;
600 if (gRcvIRQ.buf_read >= MBUS_RCV_QUEUESIZE)
601 gRcvIRQ.buf_read = 0;
602
603 return retval; /* exit */
604 }
605
606 if (timeout != 0 || gTimer.mode != TM_OFF) /* also carry on if reception in progress */
607 {
608 if (timeout != -1 && timeout != 0) /* if not infinite or expired */
609 timeout--;
610
611 rb->sleep(1); /* wait a while */
612 }
613
614 } while (timeout != 0 || gTimer.mode != TM_OFF);
615
616 return 0; /* timeout */
617}
618
619
620/****************** MMI helper fuctions ******************/
621
622
623void print_scroll(char* string)
624{
625 static char screen[LINES][COLUMNS+1]; /* visible strings */
626 static unsigned pos = 0; /* next print position */
627 static unsigned screentop = 0; /* for scrolling */
628
629 if (!gTread.foreground)
630 return; /* just to protect careless callers */
631
632 if (pos >= LINES)
633 { /* need to scroll first */
634 int i;
635 rb->lcd_clear_display();
636 screentop++;
637 for (i=0; i<LINES-1; i++)
638 rb->lcd_puts(0, i, screen[(i+screentop) % LINES]);
639
640 pos = LINES-1;
641 }
642
643 /* no strncpy avail. */
644 rb->snprintf(screen[(pos+screentop) % LINES], sizeof(screen[0]), "%s", string);
645
646 rb->lcd_puts(0, pos, screen[(pos+screentop) % LINES]);
647 rb->lcd_update();
648 pos++;
649}
650
651
652void dump_packet(char* dest, int dst_size, char* src, int n)
653{
654 int i;
655 int len = MIN(dst_size-1, n);
656
657 for (i=0; i<len; i++)
658 { /* convert to hex digits */
659 dest[i] = src[i] < 10 ? '0' + src[i] : 'A' + src[i] - 10;
660 }
661 dest[i] = '\0'; /* zero terminate string */
662}
663
664
665/****************** CD changer emulation ******************/
666
667bool bit_test(unsigned char* buf, unsigned bit)
668{
669 return (buf[bit>>2] & BIT_N(bit&3)) != 0;
670}
671
672
673void bit_set(unsigned char* buf, unsigned bit, bool val)
674{
675 if (val)
676 buf[bit>>2] |= BIT_N(bit&3);
677 else
678 buf[bit>>2] &= ~BIT_N(bit&3);
679}
680
681
682void emu_init(void)
683{
684 rb->memset(&gEmu, 0, sizeof(gEmu));
685
686 gEmu.poll_interval = HZ;
687
688 /* init the play message to 990000000000000 */
689 gEmu.playmsg[0] = gEmu.playmsg[1] = 0x9;
690
691 /* init the changing message to 9B900000001 */
692 gEmu.changemsg[0] = gEmu.changemsg[2] = 0x9;
693 gEmu.changemsg[1] = 0xB;
694 gEmu.changemsg[10] = 0x1;
695
696 /* init the disk status message to 9C1019999990 */
697 rb->memset(&gEmu.diskmsg, 0x9, sizeof(gEmu.diskmsg));
698 gEmu.diskmsg[1] = 0xC;
699 gEmu.diskmsg[2] = gEmu.diskmsg[4] = 0x1;
700 gEmu.diskmsg[3] = gEmu.diskmsg[11] = 0x0;
701}
702
703/* feed a radio command into the emulator */
704void emu_process_packet(unsigned char* mbus_msg, int msg_size)
705{
706 bool playmsg_dirty = false;
707 bool diskmsg_dirty = false;
708
709 if (msg_size == 2 && mbus_msg[0] == 1 && mbus_msg[1] == 8)
710 { /* 18: ping */
711 mbus_send("\x09\x08", 2); /* 98: ping OK */
712 }
713 else if (msg_size == 5 && mbus_msg[0] == 1 && mbus_msg[1] == 1 && mbus_msg[2] == 1)
714 { /* set play state */
715 if (bit_test(mbus_msg, 16))
716 {
717 if (gEmu.set_state == EMU_FF || gEmu.set_state == EMU_FR) /* was seeking? */
718 { /* seek to final position */
719 set_position(gEmu.time);
720 }
721 else if (gEmu.set_state != EMU_PLAYING && gEmu.set_state != EMU_PAUSED)
722 { /* was not playing yet, better send disk message */
723 diskmsg_dirty = true;
724 }
725 set_play();
726 gEmu.set_state = EMU_PLAYING;
727 playmsg_dirty = true;
728 }
729
730 if (bit_test(mbus_msg, 17))
731 {
732 gEmu.set_state = EMU_PAUSED;
733 playmsg_dirty = true;
734 set_pause();
735 }
736
737 if (bit_test(mbus_msg, 14))
738 {
739 gEmu.set_state = EMU_STOPPED;
740 playmsg_dirty = true;
741 set_stop();
742 }
743
744 if (bit_test(mbus_msg, 18))
745 {
746 gEmu.set_state = EMU_FF;
747 playmsg_dirty = true;
748 set_pause();
749 }
750
751 if (bit_test(mbus_msg, 19))
752 {
753 gEmu.set_state = EMU_FR;
754 playmsg_dirty = true;
755 set_pause();
756 }
757
758 if (bit_test(mbus_msg, 12)) /* scan stop */
759 {
760 bit_set(gEmu.playmsg, 51, false);
761 playmsg_dirty = true;
762 }
763
764 if (gEmu.set_state == EMU_FF || gEmu.set_state == EMU_FR)
765 gEmu.poll_interval = HZ/4; /* faster refresh */
766 else
767 gEmu.poll_interval = HZ;
768 }
769 else if (msg_size == 8 && mbus_msg[0] == 1 && mbus_msg[1] == 1 && mbus_msg[2] == 4)
770 { /* set program mode */
771 gEmu.playmsg[11] = mbus_msg[3]; /* copy repeat, random, intro */
772 gEmu.playmsg[12] = mbus_msg[4]; /* ToDo */
773 playmsg_dirty = true;
774 }
775 else if (msg_size ==8 && mbus_msg[0] == 1 && mbus_msg[1] == 1 && mbus_msg[2] == 3)
776 { /* changing */
777 gEmu.time = 0; /* reset playtime */
778 playmsg_dirty = true;
779 if (mbus_msg[3] == 0)
780 { /* changing track */
781 if (mbus_msg[4] == 0xA && mbus_msg[5] == 0x3)
782 { /* next random */
783 gEmu.playmsg[3] = rb->rand() % 10; /* ToDo */
784 gEmu.playmsg[4] = rb->rand() % 10;
785 }
786 else if (mbus_msg[4] == 0xB && mbus_msg[5] == 0x3)
787 { /* previous random */
788 gEmu.playmsg[3] = rb->rand() % 10; /* ToDo */
789 gEmu.playmsg[4] = rb->rand() % 10;
790 }
791 else
792 { /* normal track select */
793 set_track(mbus_msg[4]*10 + mbus_msg[5]);
794 }
795 }
796 else
797 { /* changing disk */
798 diskmsg_dirty = true;
799 gEmu.changemsg[3] = mbus_msg[3]; /* copy disk */
800 gEmu.diskmsg[2] = mbus_msg[3];
801 gEmu.changemsg[7] = gEmu.playmsg[11]; /* copy flags from status */
802 gEmu.changemsg[8] = gEmu.playmsg[12];
803 /*gEmu.playmsg[3] = 0; */ /* reset to track 1 */
804 /*gEmu.playmsg[4] = 1; */
805 mbus_send(gEmu.changemsg, sizeof(gEmu.changemsg));
806 }
807 }
808 else
809 { /* if in doubt, send Ack */
810 mbus_send("\x09\x0F\x00\x00\x00\x00\x00", 7);
811 }
812
813 if (playmsg_dirty)
814 {
815 rb->yield(); /* give the audio thread a chance to process */
816 get_playmsg(); /* force update */
817 mbus_send(gEmu.playmsg, sizeof(gEmu.playmsg));
818 }
819
820 if (diskmsg_dirty)
821 {
822 get_diskmsg(); /* force update */
823 mbus_send(gEmu.diskmsg, sizeof(gEmu.diskmsg));
824 }
825}
826
827
828/* called each second in case the emulator has something to do */
829void emu_tick(void)
830{
831 get_playmsg(); /* force update */
832 if (bit_test(gEmu.playmsg, 56)) /* play bit */
833 {
834 unsigned remain; /* helper as we walk down the digits */
835
836 switch(gEmu.set_state)
837 {
838 case EMU_FF:
839 gEmu.time += 10;
840 case EMU_FR:
841 gEmu.time -= 5;
842
843 if (gEmu.time < 0)
844 gEmu.time = 0;
845 else if (gEmu.time > get_tracklength())
846 gEmu.time = get_tracklength();
847
848 /* convert value to MM:SS */
849 remain = (unsigned)gEmu.time;
850 gEmu.playmsg[7] = remain / (10*60);
851 remain -= gEmu.playmsg[7] * (10*60);
852 gEmu.playmsg[8] = remain / 60;
853 remain -= gEmu.playmsg[8] * 60;
854 gEmu.playmsg[9] = remain / 10;
855 remain -= gEmu.playmsg[9] * 10;
856 gEmu.playmsg[10] = remain;
857 }
858
859 mbus_send(gEmu.playmsg, sizeof(gEmu.playmsg));
860 }
861}
862
863
864/****************** communication with Rockbox playback ******************/
865
866
867/* update the play message with Rockbox info */
868void get_playmsg(void)
869{
870 int track, time;
871
872 if (gEmu.set_state != EMU_FF && gEmu.set_state != EMU_FR)
873 {
874 switch(rb->audio_status())
875 {
876 case AUDIO_STATUS_PLAY:
877 print_scroll("AudioStat Play");
878 if (gEmu.set_state == EMU_FF || gEmu.set_state == EMU_FR)
879 gEmu.playmsg[2] = gEmu.set_state; /* set FF/FR */
880 else
881 gEmu.playmsg[2] = EMU_PLAYING; /* set normal play */
882
883 bit_set(gEmu.playmsg, 56, true); /* set play */
884 bit_set(gEmu.playmsg, 57, false); /* clear pause */
885 bit_set(gEmu.playmsg, 59, false); /* clear stop */
886 break;
887
888 case AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE:
889 print_scroll("AudioStat Pause");
890 gEmu.playmsg[2] = EMU_PAUSED;
891 bit_set(gEmu.playmsg, 56, false); /* clear play */
892 bit_set(gEmu.playmsg, 57, true); /* set pause */
893 bit_set(gEmu.playmsg, 59, false); /* clear stop */
894 break;
895
896 default:
897 print_scroll("AudioStat 0");
898 gEmu.playmsg[2] = EMU_STOPPED;
899 bit_set(gEmu.playmsg, 56, false); /* clear play */
900 bit_set(gEmu.playmsg, 57, false); /* clear pause */
901 bit_set(gEmu.playmsg, 59, true); /* set stop */
902 break;
903 }
904
905 /* convert value to MM:SS */
906 time = get_playtime();
907 gEmu.time = time; /* copy it */
908 gEmu.playmsg[7] = time / (10*60);
909 time -= gEmu.playmsg[7] * (10*60);
910 gEmu.playmsg[8] = time / 60;
911 time -= gEmu.playmsg[8] * 60;
912 gEmu.playmsg[9] = time / 10;
913 time -= gEmu.playmsg[9] * 10;
914 gEmu.playmsg[10] = time;
915 }
916 else /* FF/FR */
917 {
918 gEmu.playmsg[2] = gEmu.set_state; /* in FF/FR, report that instead */
919 }
920
921 track = get_track();
922 gEmu.playmsg[3] = track / 10;
923 gEmu.playmsg[4] = track % 10;
924}
925
926/* update the disk status message with Rockbox info */
927void get_diskmsg(void)
928{
929 int tracks = rb->playlist_amount();
930 if (tracks > 99)
931 tracks = 99;
932 gEmu.diskmsg[5] = tracks / 10;
933 gEmu.diskmsg[6] = tracks % 10;
934}
935
936/* return the current track time in seconds */
937int get_playtime(void)
938{
939 struct mp3entry* p_mp3entry;
940
941 p_mp3entry = rb->audio_current_track();
942 if (p_mp3entry == NULL)
943 return 0;
944
945 return p_mp3entry->elapsed / 1000;
946}
947
948/* return the total length of the current track */
949int get_tracklength(void)
950{
951 struct mp3entry* p_mp3entry;
952
953 p_mp3entry = rb->audio_current_track();
954 if (p_mp3entry == NULL)
955 return 0;
956
957 return p_mp3entry->length / 1000;
958}
959
960/* change to a new track */
961void set_track(int selected)
962{
963 if (selected > get_track())
964 {
965 print_scroll("audio_next");
966 rb->audio_next();
967 }
968 else if (selected < get_track())
969 {
970 print_scroll("audio_prev");
971 rb->audio_prev();
972 }
973}
974
975/* return the track number */
976int get_track(void)
977{
978 struct mp3entry* p_mp3entry;
979
980 p_mp3entry = rb->audio_current_track();
981 if (p_mp3entry == NULL)
982 return 0;
983
984 return p_mp3entry->index + 1; /* track numbers start with 1 */
985}
986
987/* start or resume playback */
988void set_play(void)
989{
990 if (rb->audio_status() == AUDIO_STATUS_PLAY)
991 return;
992
993 if (rb->audio_status() == (AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE))
994 {
995 print_scroll("audio_resume");
996 rb->audio_resume();
997 }
998 else
999 {
1000 print_scroll("audio_play(0, 0)");
1001 rb->audio_play(0, 0);
1002 }
1003}
1004
1005/* pause playback */
1006void set_pause(void)
1007{
1008 if (rb->audio_status() == AUDIO_STATUS_PLAY)
1009 {
1010 print_scroll("audio_pause");
1011 rb->audio_pause();
1012 }
1013}
1014
1015/* stop playback */
1016void set_stop(void)
1017{
1018 if (rb->audio_status() & AUDIO_STATUS_PLAY)
1019 {
1020 print_scroll("audio_stop");
1021 rb->audio_stop();
1022 }
1023}
1024
1025/* seek */
1026void set_position(int seconds)
1027{
1028 if (rb->audio_status() & AUDIO_STATUS_PLAY)
1029 {
1030 print_scroll("audio_ff_rewind");
1031 rb->audio_ff_rewind(seconds * 1000);
1032 }
1033}
1034
1035/****************** main thread + helper ******************/
1036
1037/* set to everything flat and 0 dB volume */
1038void sound_neutral(void)
1039{ /* neutral sound settings */
1040 rb->sound_set(SOUND_BASS, 0);
1041 rb->sound_set(SOUND_TREBLE, 0);
1042 rb->sound_set(SOUND_BALANCE, 0);
1043 rb->sound_set(SOUND_VOLUME, 0);
1044#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1045 rb->sound_set(SOUND_LOUDNESS, 0);
1046 rb->sound_set(SOUND_SUPERBASS, 0);
1047 rb->sound_set(SOUND_AVC, 0);
1048#endif
1049}
1050
1051/* return to user settings */
1052void sound_normal(void)
1053{ /* restore sound settings */
1054 rb->sound_set(SOUND_BASS, rb->global_settings->bass);
1055 rb->sound_set(SOUND_TREBLE, rb->global_settings->treble);
1056 rb->sound_set(SOUND_BALANCE, rb->global_settings->balance);
1057 rb->sound_set(SOUND_VOLUME, rb->global_settings->volume);
1058#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1059 rb->sound_set(SOUND_LOUDNESS, rb->global_settings->loudness);
1060 rb->sound_set(SOUND_SUPERBASS, rb->global_settings->superbass);
1061 rb->sound_set(SOUND_AVC, rb->global_settings->avc);
1062#endif
1063}
1064
1065/* the thread running it all */
1066void thread(void)
1067{
1068 int msg_size;
1069 unsigned char mbus_msg[MBUS_MAX_SIZE];
1070 char buf[32];
1071 bool connected = false;
1072 long last_tick = *rb->current_tick; /* for 1 sec tick */
1073
1074 do
1075 {
1076 msg_size = mbus_receive(mbus_msg, sizeof(mbus_msg), 1);
1077 if (msg_size > 0)
1078 { /* received something */
1079 if(gTread.foreground)
1080 {
1081 dump_packet(buf, sizeof(buf), mbus_msg, msg_size);
1082 /*print_scroll(buf); */
1083 }
1084 if (msg_size > 2 && mbus_msg[0] == 1
1085 && mbus_msg[msg_size-1] == calc_checksum(mbus_msg, msg_size-1))
1086 { /* sanity and checksum OK */
1087 if (!connected)
1088 { /* with the first received packet: */
1089 sound_neutral(); /* set to flat and 0dB volume */
1090 connected = true;
1091 }
1092 emu_process_packet(mbus_msg, msg_size-1); /* pass without chksum */
1093 }
1094 else if(gTread.foreground)
1095 { /* not OK */
1096 print_scroll("bad packet");
1097 }
1098 }
1099 else if (msg_size < 0 && gTread.foreground)
1100 { /* error */
1101 rb->snprintf(buf, sizeof(buf), "rcv error %d", msg_size);
1102 print_scroll(buf);
1103 }
1104
1105 if (*rb->current_tick - last_tick >= gEmu.poll_interval)
1106 { /* call the emulation regulary */
1107 emu_tick();
1108 last_tick += gEmu.poll_interval;
1109 }
1110
1111 } while (!gTread.exiting);
1112}
1113
1114/* callback to end the TSR plugin, called before a new one gets loaded */
1115static bool exit_tsr(bool reenter)
1116{
1117 if (reenter)
1118 return false; /* dont let it start again */
1119 gTread.exiting = true; /* tell the thread to end */
1120 rb->thread_wait(gTread.thread); /* wait until it did */
1121
1122 uart_init(BAUDRATE); /* return to standard baudrate */
1123 IPRE = (IPRE & ~0xF000); /* UART interrupt off */
1124 timer_set_mode(TM_OFF); /* timer interrupt off */
1125
1126 sound_normal(); /* restore sound settings */
1127 return true;
1128}
1129
1130/****************** main ******************/
1131
1132
1133int main(const void* parameter)
1134{
1135 (void)parameter;
1136#ifdef DEBUG
1137 int button;
1138#endif
1139 size_t buf_size;
1140 ssize_t stacksize;
1141 void* stack;
1142
1143 mbus_init(); /* init the M-Bus layer */
1144 emu_init(); /* init emulator */
1145
1146 rb->splash(HZ/5, "Alpine CDC"); /* be quick on autostart */
1147
1148#ifdef DEBUG
1149 print_scroll("Alpine M-Bus Test");
1150 print_scroll("any key to TSR");
1151#endif
1152
1153 /* init the worker thread */
1154 stack = rb->plugin_get_buffer(&buf_size); /* use the rest as stack */
1155 stacksize = buf_size;
1156 stack = (void*)(((unsigned int)stack + 100) & ~3); /* a bit away, 32 bit align */
1157 stacksize = (stacksize - 100) & ~3;
1158 if (stacksize < DEFAULT_STACK_SIZE)
1159 {
1160 rb->splash(HZ*2, "Out of memory");
1161 return -1;
1162 }
1163
1164 rb->memset(&gTread, 0, sizeof(gTread));
1165 gTread.foreground = true;
1166 gTread.thread = rb->create_thread(thread, stack, stacksize, 0, "CDC"
1167 IF_PRIO(, PRIORITY_BACKGROUND)
1168 IF_COP(, CPU));
1169
1170#ifdef DEBUG
1171 do
1172 {
1173 button = rb->button_get(true);
1174 } while (button & BUTTON_REL);
1175#endif
1176
1177 gTread.foreground = false; /* we're in the background now */
1178 rb->plugin_tsr(exit_tsr); /* stay resident */
1179
1180#ifdef DEBUG
1181 return rb->default_event_handler(button);
1182#else
1183 return 0;
1184#endif
1185}
1186
1187
1188/***************** Plugin Entry Point *****************/
1189
1190
1191enum plugin_status plugin_start(const void* parameter)
1192{
1193 /* now go ahead and have fun! */
1194 return (main(parameter)==0) ? PLUGIN_OK : PLUGIN_ERROR;
1195}
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index f24ad579e8..37046af05b 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -30,41 +30,12 @@
30 30
31#define EV_EXIT 1337 31#define EV_EXIT 1337
32 32
33/* seems to work with 1300, but who knows... */ 33/* seems to work with 1300, but who knows... */
34#define THREAD_STACK_SIZE DEFAULT_STACK_SIZE + 0x200 34#define THREAD_STACK_SIZE DEFAULT_STACK_SIZE + 0x200
35 35
36#if CONFIG_KEYPAD == RECORDER_PAD 36#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
37
38#define BATTERY_ON BUTTON_PLAY
39#define BATTERY_OFF BUTTON_OFF
40#define BATTERY_ON_TXT "PLAY - start"
41#define BATTERY_OFF_TXT "OFF"
42
43#if BUTTON_REMOTE != 0
44#define BATTERY_RC_ON BUTTON_RC_PLAY
45#define BATTERY_RC_OFF BUTTON_RC_STOP
46#endif
47
48#elif CONFIG_KEYPAD == ONDIO_PAD
49
50#define BATTERY_ON BUTTON_RIGHT
51#define BATTERY_OFF BUTTON_OFF
52#define BATTERY_ON_TXT "RIGHT - start"
53#define BATTERY_OFF_TXT "OFF"
54
55#elif CONFIG_KEYPAD == PLAYER_PAD
56
57#define BATTERY_ON BUTTON_PLAY
58#define BATTERY_OFF BUTTON_STOP
59#define BATTERY_ON_TXT "PLAY - start"
60#define BATTERY_OFF_TXT "STOP"
61
62#define BATTERY_RC_ON BUTTON_RC_PLAY
63#define BATTERY_RC_OFF BUTTON_RC_STOP
64
65#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
66 (CONFIG_KEYPAD == IRIVER_H300_PAD) 37 (CONFIG_KEYPAD == IRIVER_H300_PAD)
67 38
68#define BATTERY_ON BUTTON_ON 39#define BATTERY_ON BUTTON_ON
69#define BATTERY_RC_ON BUTTON_RC_ON 40#define BATTERY_RC_ON BUTTON_RC_ON
70 41
diff --git a/apps/plugins/beatbox/beatbox.c b/apps/plugins/beatbox/beatbox.c
index 914533151e..e7d3225c8b 100644
--- a/apps/plugins/beatbox/beatbox.c
+++ b/apps/plugins/beatbox/beatbox.c
@@ -28,19 +28,7 @@
28 28
29 29
30/* variable button definitions */ 30/* variable button definitions */
31#if CONFIG_KEYPAD == RECORDER_PAD 31#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
32#define BTN_QUIT BUTTON_OFF
33#define BTN_RIGHT BUTTON_RIGHT
34#define BTN_UP BUTTON_UP
35#define BTN_DOWN BUTTON_DOWN
36
37#elif CONFIG_KEYPAD == ONDIO_PAD
38#define BTN_QUIT BUTTON_OFF
39#define BTN_RIGHT BUTTON_RIGHT
40#define BTN_UP BUTTON_UP
41#define BTN_DOWN BUTTON_DOWN
42
43#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
44#define BTN_QUIT BUTTON_OFF 32#define BTN_QUIT BUTTON_OFF
45#define BTN_RIGHT BUTTON_RIGHT 33#define BTN_RIGHT BUTTON_RIGHT
46#define BTN_UP BUTTON_UP 34#define BTN_UP BUTTON_UP
diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c
index d685de9617..93b577462b 100644
--- a/apps/plugins/blackjack.c
+++ b/apps/plugins/blackjack.c
@@ -42,37 +42,7 @@ enum {
42 BJ_END, 42 BJ_END,
43}; 43};
44 44
45#if CONFIG_KEYPAD == RECORDER_PAD 45#if CONFIG_KEYPAD == IRIVER_H10_PAD
46#define BJACK_SELECT_NAME "PLAY"
47#define BJACK_STAY_NAME "F1"
48#define BJACK_QUIT_NAME "OFF"
49#define BJACK_DOUBLE_NAME "F2"
50#define BJACK_SELECT BUTTON_PLAY
51#define BJACK_QUIT BUTTON_OFF
52#define BJACK_MAX (BUTTON_ON|BUTTON_UP)
53#define BJACK_MIN (BUTTON_ON|BUTTON_DOWN)
54#define BJACK_STAY BUTTON_F1
55#define BJACK_DOUBLEDOWN BUTTON_F2
56#define BJACK_UP BUTTON_UP
57#define BJACK_DOWN BUTTON_DOWN
58#define BJACK_RIGHT BUTTON_RIGHT
59#define BJACK_LEFT BUTTON_LEFT
60
61#elif CONFIG_KEYPAD == ONDIO_PAD
62#define BJACK_SELECT_NAME "MENU"
63#define BJACK_STAY_NAME "RIGHT"
64#define BJACK_QUIT_NAME "OFF"
65#define BJACK_DOUBLE_NAME "UP"
66#define BJACK_SELECT BUTTON_MENU
67#define BJACK_QUIT BUTTON_OFF
68#define BJACK_STAY BUTTON_RIGHT
69#define BJACK_DOUBLEDOWN BUTTON_UP
70#define BJACK_UP BUTTON_UP
71#define BJACK_DOWN BUTTON_DOWN
72#define BJACK_RIGHT BUTTON_RIGHT
73#define BJACK_LEFT BUTTON_LEFT
74
75#elif CONFIG_KEYPAD == IRIVER_H10_PAD
76#define BJACK_SELECT_NAME "PLAY" 46#define BJACK_SELECT_NAME "PLAY"
77#define BJACK_STAY_NAME ">>|" 47#define BJACK_STAY_NAME ">>|"
78#define BJACK_QUIT_NAME "POWER" 48#define BJACK_QUIT_NAME "POWER"
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index 182ba4f040..dd46f98b8e 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -61,23 +61,6 @@
61#define DOWN BUTTON_DOWN 61#define DOWN BUTTON_DOWN
62#define RC_QUIT BUTTON_RC_STOP 62#define RC_QUIT BUTTON_RC_STOP
63 63
64#elif CONFIG_KEYPAD == ONDIO_PAD
65#define CONTINUE_TEXT "MENU To Continue"
66#define QUIT BUTTON_OFF
67#define LEFT BUTTON_LEFT
68#define RIGHT BUTTON_RIGHT
69#define SELECT BUTTON_MENU
70#define UP BUTTON_UP
71#define DOWN BUTTON_DOWN
72
73#elif CONFIG_KEYPAD == RECORDER_PAD
74#define QUIT BUTTON_OFF
75#define LEFT BUTTON_LEFT
76#define RIGHT BUTTON_RIGHT
77#define SELECT BUTTON_PLAY
78#define UP BUTTON_UP
79#define DOWN BUTTON_DOWN
80
81#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ 64#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
82 (CONFIG_KEYPAD == IPOD_3G_PAD) || \ 65 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
83 (CONFIG_KEYPAD == IPOD_1G2G_PAD) 66 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
@@ -1461,9 +1444,7 @@ static int brickmania_help(void)
1461 "< & >:", 1444 "< & >:",
1462#endif 1445#endif
1463 "Moves", "the", "paddle", "", 1446 "Moves", "the", "paddle", "",
1464#if CONFIG_KEYPAD == ONDIO_PAD 1447#if (CONFIG_KEYPAD == IAUDIO_M3_PAD)
1465 "MENU:",
1466#elif (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IAUDIO_M3_PAD)
1467 "PLAY:", 1448 "PLAY:",
1468#elif CONFIG_KEYPAD == IRIVER_H300_PAD 1449#elif CONFIG_KEYPAD == IRIVER_H300_PAD
1469 "NAVI:", 1450 "NAVI:",
@@ -1484,9 +1465,7 @@ static int brickmania_help(void)
1484 (CONFIG_KEYPAD == SANSA_FUZE_PAD) 1465 (CONFIG_KEYPAD == SANSA_FUZE_PAD)
1485 "MENU:", 1466 "MENU:",
1486#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ 1467#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
1487 (CONFIG_KEYPAD == IRIVER_H300_PAD) || \ 1468 (CONFIG_KEYPAD == IRIVER_H300_PAD)
1488 (CONFIG_KEYPAD == ONDIO_PAD) || \
1489 (CONFIG_KEYPAD == RECORDER_PAD)
1490 "STOP:", 1469 "STOP:",
1491#else 1470#else
1492 "POWER:", 1471 "POWER:",
diff --git a/apps/plugins/bubbles.c b/apps/plugins/bubbles.c
index 2d163d8bc9..50de10fa23 100644
--- a/apps/plugins/bubbles.c
+++ b/apps/plugins/bubbles.c
@@ -84,7 +84,6 @@ enum {
84/* these are better off shooting with up */ 84/* these are better off shooting with up */
85#if (CONFIG_KEYPAD == SAMSUNG_YH820_PAD) \ 85#if (CONFIG_KEYPAD == SAMSUNG_YH820_PAD) \
86 || (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD) \ 86 || (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD) \
87 || (CONFIG_KEYPAD == ONDIO_PAD) \
88 || (CONFIG_KEYPAD == IRIVER_H10_PAD) 87 || (CONFIG_KEYPAD == IRIVER_H10_PAD)
89#define SHOOT_WITH_UP 88#define SHOOT_WITH_UP
90#endif 89#endif
diff --git a/apps/plugins/calculator.c b/apps/plugins/calculator.c
index d3cf57536d..ac5a6ed7cd 100644
--- a/apps/plugins/calculator.c
+++ b/apps/plugins/calculator.c
@@ -110,29 +110,8 @@ F3: equal to "="
110#endif 110#endif
111 111
112/* variable button definitions */ 112/* variable button definitions */
113#if CONFIG_KEYPAD == RECORDER_PAD 113#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
114#define CALCULATOR_LEFT BUTTON_LEFT 114 (CONFIG_KEYPAD == IRIVER_H300_PAD)
115#define CALCULATOR_RIGHT BUTTON_RIGHT
116#define CALCULATOR_UP BUTTON_UP
117#define CALCULATOR_DOWN BUTTON_DOWN
118#define CALCULATOR_QUIT BUTTON_OFF
119#define CALCULATOR_INPUT BUTTON_PLAY
120#define CALCULATOR_CALC BUTTON_F3
121#define CALCULATOR_OPERATORS BUTTON_F2
122#define CALCULATOR_CLEAR BUTTON_F1
123
124#elif CONFIG_KEYPAD == ONDIO_PAD
125#define CALCULATOR_LEFT BUTTON_LEFT
126#define CALCULATOR_RIGHT BUTTON_RIGHT
127#define CALCULATOR_UP BUTTON_UP
128#define CALCULATOR_DOWN BUTTON_DOWN
129#define CALCULATOR_QUIT BUTTON_OFF
130#define CALCULATOR_INPUT_CALC_PRE BUTTON_MENU
131#define CALCULATOR_INPUT (BUTTON_MENU | BUTTON_REL)
132#define CALCULATOR_CALC (BUTTON_MENU | BUTTON_REPEAT)
133
134#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
135 (CONFIG_KEYPAD == IRIVER_H300_PAD)
136#define CALCULATOR_LEFT BUTTON_LEFT 115#define CALCULATOR_LEFT BUTTON_LEFT
137#define CALCULATOR_RIGHT BUTTON_RIGHT 116#define CALCULATOR_RIGHT BUTTON_RIGHT
138#define CALCULATOR_UP BUTTON_UP 117#define CALCULATOR_UP BUTTON_UP
diff --git a/apps/plugins/calendar.c b/apps/plugins/calendar.c
index 11a37191af..7e2472ffc9 100644
--- a/apps/plugins/calendar.c
+++ b/apps/plugins/calendar.c
@@ -25,30 +25,8 @@
25#include "lib/playback_control.h" 25#include "lib/playback_control.h"
26#include "lib/configfile.h" 26#include "lib/configfile.h"
27 27
28 28#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
29 29 (CONFIG_KEYPAD == IRIVER_H300_PAD)
30#if CONFIG_KEYPAD == RECORDER_PAD
31#define CALENDAR_QUIT BUTTON_OFF
32#define CALENDAR_SELECT BUTTON_PLAY
33#define CALENDAR_NEXT_WEEK BUTTON_DOWN
34#define CALENDAR_PREV_WEEK BUTTON_UP
35#define CALENDAR_NEXT_DAY BUTTON_RIGHT
36#define CALENDAR_PREV_DAY BUTTON_LEFT
37#define CALENDAR_NEXT_MONTH (BUTTON_ON|BUTTON_DOWN)
38#define CALENDAR_PREV_MONTH (BUTTON_ON|BUTTON_UP)
39
40#elif CONFIG_KEYPAD == ONDIO_PAD
41#define CALENDAR_QUIT BUTTON_OFF
42#define CALENDAR_SELECT (BUTTON_MENU|BUTTON_REL)
43#define CALENDAR_NEXT_WEEK BUTTON_DOWN
44#define CALENDAR_PREV_WEEK BUTTON_UP
45#define CALENDAR_NEXT_DAY BUTTON_RIGHT
46#define CALENDAR_PREV_DAY BUTTON_LEFT
47#define CALENDAR_NEXT_MONTH (BUTTON_MENU|BUTTON_DOWN)
48#define CALENDAR_PREV_MONTH (BUTTON_MENU|BUTTON_UP)
49
50#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
51 (CONFIG_KEYPAD == IRIVER_H300_PAD)
52#define CALENDAR_QUIT BUTTON_OFF 30#define CALENDAR_QUIT BUTTON_OFF
53#define CALENDAR_SELECT BUTTON_SELECT 31#define CALENDAR_SELECT BUTTON_SELECT
54#define CALENDAR_NEXT_WEEK BUTTON_DOWN 32#define CALENDAR_NEXT_WEEK BUTTON_DOWN
diff --git a/apps/plugins/chessbox/chessbox_pgn.h b/apps/plugins/chessbox/chessbox_pgn.h
index 9c7693305c..ab0adbb706 100644
--- a/apps/plugins/chessbox/chessbox_pgn.h
+++ b/apps/plugins/chessbox/chessbox_pgn.h
@@ -84,38 +84,6 @@
84#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT) 84#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
85#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT) 85#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
86 86
87#elif CONFIG_KEYPAD == RECORDER_PAD
88#define CB_SELECT BUTTON_PLAY
89#define CB_UP BUTTON_UP
90#define CB_DOWN BUTTON_DOWN
91#define CB_LEFT BUTTON_LEFT
92#define CB_RIGHT BUTTON_RIGHT
93#define CB_PLAY BUTTON_ON
94#define CB_LEVEL BUTTON_F1
95#define CB_RESTART BUTTON_F3
96#define CB_MENU BUTTON_OFF
97#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT)
98#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT)
99#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
100#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
101
102#elif CONFIG_KEYPAD == ONDIO_PAD
103#define CB_SELECT_PRE BUTTON_MENU
104#define CB_SELECT (BUTTON_MENU|BUTTON_REL)
105#define CB_UP BUTTON_UP
106#define CB_DOWN BUTTON_DOWN
107#define CB_LEFT BUTTON_LEFT
108#define CB_RIGHT BUTTON_RIGHT
109#define CB_PLAY_PRE BUTTON_MENU
110#define CB_PLAY (BUTTON_MENU|BUTTON_REPEAT)
111#define CB_LEVEL (BUTTON_MENU|BUTTON_OFF)
112#define CB_RESTART (BUTTON_MENU|BUTTON_LEFT)
113#define CB_MENU BUTTON_OFF
114#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT)
115#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT)
116#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
117#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
118
119#elif (CONFIG_KEYPAD == GIGABEAT_PAD) 87#elif (CONFIG_KEYPAD == GIGABEAT_PAD)
120#define CB_SELECT BUTTON_SELECT 88#define CB_SELECT BUTTON_SELECT
121#define CB_UP BUTTON_UP 89#define CB_UP BUTTON_UP
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index ba8fea4935..6b2d436679 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -24,40 +24,7 @@
24 24
25 25
26/* variable button definitions */ 26/* variable button definitions */
27#if CONFIG_KEYPAD == RECORDER_PAD 27#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
28#define CHC_QUIT BUTTON_OFF
29#define CHC_STARTSTOP BUTTON_PLAY
30#define CHC_RESET BUTTON_LEFT
31#define CHC_MENU BUTTON_F1
32#define CHC_SETTINGS_INC BUTTON_UP
33#define CHC_SETTINGS_DEC BUTTON_DOWN
34#define CHC_SETTINGS_OK BUTTON_PLAY
35#define CHC_SETTINGS_OK2 BUTTON_LEFT
36#define CHC_SETTINGS_CANCEL BUTTON_OFF
37
38#elif CONFIG_KEYPAD == ONDIO_PAD
39#define CHC_QUIT BUTTON_OFF
40#define CHC_STARTSTOP BUTTON_RIGHT
41#define CHC_RESET BUTTON_LEFT
42#define CHC_MENU BUTTON_MENU
43#define CHC_SETTINGS_INC BUTTON_UP
44#define CHC_SETTINGS_DEC BUTTON_DOWN
45#define CHC_SETTINGS_OK BUTTON_RIGHT
46#define CHC_SETTINGS_OK2 BUTTON_LEFT
47#define CHC_SETTINGS_CANCEL BUTTON_MENU
48
49#elif CONFIG_KEYPAD == PLAYER_PAD
50#define CHC_QUIT BUTTON_ON
51#define CHC_STARTSTOP BUTTON_PLAY
52#define CHC_RESET BUTTON_STOP
53#define CHC_MENU BUTTON_MENU
54#define CHC_SETTINGS_INC BUTTON_RIGHT
55#define CHC_SETTINGS_DEC BUTTON_LEFT
56#define CHC_SETTINGS_OK BUTTON_PLAY
57#define CHC_SETTINGS_CANCEL BUTTON_STOP
58#define CHC_SETTINGS_CANCEL2 BUTTON_MENU
59
60#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
61 (CONFIG_KEYPAD == IRIVER_H300_PAD) 28 (CONFIG_KEYPAD == IRIVER_H300_PAD)
62#define CHC_QUIT BUTTON_SELECT 29#define CHC_QUIT BUTTON_SELECT
63#define CHC_STARTSTOP BUTTON_ON 30#define CHC_STARTSTOP BUTTON_ON
diff --git a/apps/plugins/chip8.c b/apps/plugins/chip8.c
index 8645893820..f861d19caa 100644
--- a/apps/plugins/chip8.c
+++ b/apps/plugins/chip8.c
@@ -944,28 +944,8 @@ STATIC void chip8 (void)
944#endif 944#endif
945 945
946/* variable button definitions */ 946/* variable button definitions */
947#if CONFIG_KEYPAD == RECORDER_PAD /* only 9 out of 16 chip8 buttons */ 947#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
948#define CHIP8_OFF BUTTON_OFF 948 (CONFIG_KEYPAD == IRIVER_H300_PAD)
949#define CHIP8_KEY1 BUTTON_F1
950#define CHIP8_KEY2 BUTTON_UP
951#define CHIP8_KEY3 BUTTON_F3
952#define CHIP8_KEY4 BUTTON_LEFT
953#define CHIP8_KEY5 BUTTON_PLAY
954#define CHIP8_KEY6 BUTTON_RIGHT
955#define CHIP8_KEY7 BUTTON_F2
956#define CHIP8_KEY8 BUTTON_DOWN
957#define CHIP8_KEY9 BUTTON_ON
958
959#elif CONFIG_KEYPAD == ONDIO_PAD /* even more limited */
960#define CHIP8_OFF BUTTON_OFF
961#define CHIP8_KEY2 BUTTON_UP
962#define CHIP8_KEY4 BUTTON_LEFT
963#define CHIP8_KEY5 BUTTON_MENU
964#define CHIP8_KEY6 BUTTON_RIGHT
965#define CHIP8_KEY8 BUTTON_DOWN
966
967#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
968 (CONFIG_KEYPAD == IRIVER_H300_PAD)
969#define CHIP8_OFF BUTTON_OFF 949#define CHIP8_OFF BUTTON_OFF
970#define CHIP8_KEY2 BUTTON_UP 950#define CHIP8_KEY2 BUTTON_UP
971#define CHIP8_KEY4 BUTTON_LEFT 951#define CHIP8_KEY4 BUTTON_LEFT
diff --git a/apps/plugins/chopper.c b/apps/plugins/chopper.c
index a206192974..f42801f10f 100644
--- a/apps/plugins/chopper.c
+++ b/apps/plugins/chopper.c
@@ -86,17 +86,6 @@ Still To do:
86#define ACTION BUTTON_SELECT 86#define ACTION BUTTON_SELECT
87#define ACTIONTEXT "SELECT" 87#define ACTIONTEXT "SELECT"
88 88
89#elif CONFIG_KEYPAD == RECORDER_PAD
90#define QUIT BUTTON_OFF
91#define ACTION BUTTON_PLAY
92#define ACTIONTEXT "PLAY"
93
94#elif CONFIG_KEYPAD == ONDIO_PAD
95#define QUIT BUTTON_OFF
96#define ACTION BUTTON_UP
97#define ACTION2 BUTTON_MENU
98#define ACTIONTEXT "UP"
99
100#elif CONFIG_KEYPAD == GIGABEAT_S_PAD \ 89#elif CONFIG_KEYPAD == GIGABEAT_S_PAD \
101 || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD 90 || CONFIG_KEYPAD == SAMSUNG_YPR0_PAD
102#define QUIT BUTTON_BACK 91#define QUIT BUTTON_BACK
diff --git a/apps/plugins/credits.c b/apps/plugins/credits.c
index d766d45cfd..6e993b5468 100644
--- a/apps/plugins/credits.c
+++ b/apps/plugins/credits.c
@@ -132,11 +132,8 @@ static int update_rowpos(int action, int cur_pos, int rows_per_screen, int tot_r
132static void roll_credits(void) 132static void roll_credits(void)
133{ 133{
134 /* to do: use target defines iso keypads to set animation timings */ 134 /* to do: use target defines iso keypads to set animation timings */
135#if (CONFIG_KEYPAD == RECORDER_PAD) 135#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
136 #define PAUSE_TIME 1.2 136 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
137 #define ANIM_SPEED 35
138#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
139 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
140 #define PAUSE_TIME 0 137 #define PAUSE_TIME 0
141 #define ANIM_SPEED 100 138 #define ANIM_SPEED 100
142#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) 139#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 0f51e44e5c..4cd314a035 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -37,39 +37,7 @@
37#define DISP_TIME 30 37#define DISP_TIME 30
38 38
39/* variable button definitions */ 39/* variable button definitions */
40#if CONFIG_KEYPAD == RECORDER_PAD 40#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
41#define CUBE_QUIT BUTTON_OFF
42#define CUBE_NEXT BUTTON_RIGHT
43#define CUBE_PREV BUTTON_LEFT
44#define CUBE_INC BUTTON_UP
45#define CUBE_DEC BUTTON_DOWN
46#define CUBE_MODE BUTTON_F1
47#define CUBE_PAUSE BUTTON_PLAY
48#define CUBE_HIGHSPEED BUTTON_ON
49
50#elif CONFIG_KEYPAD == PLAYER_PAD
51#define CUBE_QUIT BUTTON_STOP
52#define CUBE_INC BUTTON_RIGHT
53#define CUBE_DEC BUTTON_LEFT
54#define CUBE_NEXT (BUTTON_ON | BUTTON_RIGHT)
55#define CUBE_PREV (BUTTON_ON | BUTTON_LEFT)
56#define CUBE_MODE BUTTON_MENU
57#define CUBE_PAUSE BUTTON_PLAY
58#define CUBE_HIGHSPEED_PRE BUTTON_ON
59#define CUBE_HIGHSPEED (BUTTON_ON | BUTTON_REL)
60
61#elif CONFIG_KEYPAD == ONDIO_PAD
62#define CUBE_QUIT BUTTON_OFF
63#define CUBE_NEXT BUTTON_RIGHT
64#define CUBE_PREV BUTTON_LEFT
65#define CUBE_INC BUTTON_UP
66#define CUBE_DEC BUTTON_DOWN
67#define CUBE_MODE_PRE BUTTON_MENU
68#define CUBE_MODE (BUTTON_MENU | BUTTON_REL)
69#define CUBE_PAUSE (BUTTON_MENU | BUTTON_LEFT)
70#define CUBE_HIGHSPEED (BUTTON_MENU | BUTTON_RIGHT)
71
72#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
73 (CONFIG_KEYPAD == IRIVER_H300_PAD) 41 (CONFIG_KEYPAD == IRIVER_H300_PAD)
74#define CUBE_QUIT BUTTON_OFF 42#define CUBE_QUIT BUTTON_OFF
75#define CUBE_NEXT BUTTON_RIGHT 43#define CUBE_NEXT BUTTON_RIGHT
diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c
deleted file mode 100644
index d7aa61f806..0000000000
--- a/apps/plugins/euroconverter.c
+++ /dev/null
@@ -1,599 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 Pierre Delore
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "plugin.h"
22#include "lib/configfile.h"
23#include "lib/pluginlib_exit.h"
24
25/* Euro converter for the player */
26/*
27Use:
28+ : Digit +1
29- : Digit -1
30PLAY : Next digit
31STOP : Prev digit
32ON : RESET
33ON+PLAY : Swap Euro<>Home
34MENU : Display the Menu
35 Currency -> Allows to choose the currency
36 Exit-> Exit the plugin
37
38Notes:
39I don't use float.
40I use signed long long (64 bits).
41A value have 5 digits after the . (123.45 = 12345000)
42
43To do:
44- The Irish currency needs 6 digits after the . to have sufficient precision on big number
45*/
46
47
48
49/* Name and path of the config file*/
50static const char cfg_filename[] = "euroconverter.cfg";
51#define CFGFILE_VERSION 0 /* Current config file version */
52#define CFGFILE_MINVERSION 0 /* Minimum config file version to accept */
53
54/* typedef for simplifying usage of long long type */
55typedef long long int longlong_t;
56
57/*Pattern for the converter*/
58static unsigned char pattern_euro[]={0x07, 0x08, 0x1E, 0x10, 0x1E, 0x08, 0x07}; /* € */
59static unsigned char pattern_home[]={0x04, 0x0A, 0x11, 0x1F, 0x11, 0x11, 0x1F}; /* Home icon*/
60
61/* 1 euro = ... (remenber 5 digits after the .)*/
62static int currency[12]={
63 655957, /*FRF France*/
64 195583, /*DEM Germany*/
65 1376030, /*ATS Austria*/
66 4033990, /*BEF Belgium*/
67 16638600, /*ESP Spain*/
68 594573, /*FIM Finland*/
69 78756, /*IEP Ireland*/
70 193627000, /*ITL Italy*/
71 4033990, /*LUF Luxemburg*/
72 220371, /*NLG Netherlands*/
73 20048200, /*PTE Portugal*/
74 34075100, /*GRD Greece*/
75 };
76
77/* Number of digit of the currency (for the display) */
78static int nb_digit[12]={
79 2, /*FRF France*/
80 2, /*DEM Germany*/
81 2, /*ATS Austria*/
82 2, /*BEF Belgium*/
83 0, /*ESP Spain*/
84 2, /*FIM Finland*/
85 2, /*IEP Ireland*/
86 0, /*ITL Italy*/
87 2, /*LUF Luxemburg*/
88 2, /*NLG Netherlands*/
89 0, /*PTE Portugal*/
90 0 /*GRD Greece*/
91 };
92
93/* max euro to have home currency */
94static longlong_t max_euro[12]={
95 99999999000LL, /*FRF France 999 999.99 */
96 99999999000LL, /*DEM Germany 999 999.99 */
97 99999999000LL, /*ATS Austria 999 999.99 */
98 99999999000LL, /*BEF Belgium 999 999.99 */
99 99999999000LL, /*ESP Spain 99 999 999 */
100 99999999000LL, /*FIM Finland 999 999.99 */
101 99999999000LL, /*IEP Ireland 999 999.99 */
102 51645690000LL, /*ITL Italy 999 999 999 */
103 99999999000LL, /*LUF Luxemburg 999 999.99 */
104 99999999000LL, /*NLG Netherlands 999 999.99 */
105 99999999000LL, /*PTE Portugal 99 999 999 */
106 29347028000LL /*GRD Greece 99 999 999 */
107 };
108
109/* max home to have euro currency */
110/* 92233720300000 Limitation due to the max capacity of long long (2^63)*/
111static longlong_t max_curr[12]={
112 99999999000LL, /*FRF France 152449.02 */
113 99999999000LL, /*DEM Germany 511291.88 */
114 99999999000LL, /*ATS Austria 72672.83 */
115 99999999000LL, /*BEF Belgium 24789.35 */
116 92233720300000LL,/*ESP Spain 5543358.23 */
117 99999999000LL, /*FIM Finland 168187.92 */
118 9999999900LL, /*IEP Ireland 1269744.51 exact value=1269738.07 */
119 92233720300000LL,/*ITL Italy 476347.41 */
120 99999999000LL, /*LUF Luxemburg 24789.35 */
121 99999999000LL, /*NLG Netherlands 453780.21 */
122 92233720300000LL,/*PTE Portugal 4600598.57 */
123 92233720300000LL /*GRD Greece 2706777.69 */
124 };
125
126static unsigned char *abbrev_str[12] = {
127 "...FRF...", /*France*/
128 "...DEM...", /*Germany*/
129 "...ATS...", /*Austria*/
130 "...BEF...", /*Belgium*/
131 "...ESP...", /*Spain*/
132 "...FIM...", /*Finland*/
133 "...IEP...", /*Ireland*/
134 "...ITL...", /*Italy*/
135 "...LUF...", /*Luxemburg*/
136 "...NLG...", /*Netherlands*/
137 "...PTE...", /*Portugal*/
138 "...GRD..." /*Greece*/
139 };
140
141
142static unsigned long heuro,hhome; /*Handles for the new patterns*/
143
144static char *currency_str[12] = {
145 "France",
146 "Germany",
147 "Austria",
148 "Belgium",
149 "Spain",
150 "Finland",
151 "Ireland",
152 "Italy",
153 "Luxemburg",
154 "Netherlands",
155 "Portugal",
156 "Greece"
157};
158
159
160static int country; /*Country selected*/
161static int cur_pos; /*Cursor position*/
162static longlong_t inc;
163
164/* Persistent settings */
165static struct configdata config[] = {
166 { TYPE_ENUM, 0, 12, { .int_p = &country }, "country", currency_str }
167};
168
169
170/* 64bits*64 bits with 5 digits after the . */
171static longlong_t mymul(longlong_t a, longlong_t b)
172{
173 return((a*b)/100000LL);
174}
175
176
177/* 64bits/64 bits with 5 digits after the . */
178static longlong_t mydiv(longlong_t a, longlong_t b)
179{
180 return((a*100000LL)/b);
181}
182
183
184/* 123.45=12345000 split => i=123 f=45000*/
185static void split(longlong_t v, longlong_t* i, longlong_t* f)
186{
187 longlong_t t;
188
189 t=v/100000LL;
190 (*i)=t;
191 (*f)=(v-(t*100000LL));
192}
193
194
195/* result=10^n */
196static longlong_t pow10(int n)
197{
198 int i;
199 longlong_t r;
200
201 r=1;
202 for (i=0;i<n;i++)
203 r=r*10LL;
204 return(r);
205}
206
207
208/* round the i.f at n digit after the . */
209static void round(longlong_t* i, longlong_t* f, int n)
210{
211
212 longlong_t m;
213 int add=0;
214
215 m=(int)pow10(5-n-1);
216 if (((*f)/m)%10>=5)
217 add=1;
218 if (n>0)
219 {
220 (*f)=((*f)/(int)pow10(5-n))+add;
221 if ((*f)==100LL)
222 {
223 (*i)+=1;
224 (*f)=0;
225 }
226 }
227 else
228 {
229 (*i)+=add;
230 (*f)=0;
231 }
232}
233
234
235/* Display the imput and the result
236 pos: false : first line
237 : true : second line
238*/
239static void display(longlong_t euro, longlong_t home, bool pos)
240{
241 longlong_t i,f;
242 unsigned char str[20];
243 unsigned char s1[20];
244 unsigned char s2[20];
245
246 if (pos)
247 { /*Edit the second line*/
248 rb->strcpy(s1," %6d.%02d");
249 if (nb_digit[country]==2)
250 rb->strcpy(s2,"\xee\x84\x90%06d.%02d");
251 else
252 rb->strcpy(s2,"\xee\x84\x90%09d");
253 }
254 else
255 {
256 rb->strcpy(s1,"\xee\x84\x90%06d.%02d");
257 if (nb_digit[country]==2)
258 rb->strcpy(s2," %6d.%02d");
259 else
260 rb->strcpy(s2," %9d");
261 }
262
263 rb->lcd_remove_cursor();
264 /*First line*/
265 rb->lcd_putc(0,0,heuro);
266 split(euro,&i,&f);
267 if (pos)
268 round(&i,&f,2);
269 rb->snprintf(str,sizeof(str),s1,(int)i,(int)f);
270
271 if (!pos)
272 {
273 rb->lcd_puts(1,0,str);
274 rb->lcd_put_cursor(10-cur_pos,0,0x5F);
275 }
276 else
277 rb->lcd_puts_scroll(1,0,str);
278
279 /*Second line*/
280 rb->lcd_putc(0,1,hhome);
281 split(home,&i,&f);
282 if (!pos)
283 round(&i,&f,nb_digit[country]);
284 rb->snprintf(str,sizeof(str),s2,(int)i,(int)f);
285 if (pos)
286 {
287 rb->lcd_puts(1,1,str);
288 rb->lcd_put_cursor(10-cur_pos,1,0x5F);
289 }
290 else
291 rb->lcd_puts_scroll(1,1,str);
292
293 rb->lcd_update();
294}
295
296
297/* Show country Abbreviation */
298static void show_abbrev(void)
299{
300 rb->splash(HZ*3/4,abbrev_str[country]);
301}
302
303
304/* Save the config to disk */
305static void save_config(void)
306{
307 configfile_save(cfg_filename, config, 1, CFGFILE_VERSION);
308}
309
310
311/* Load the config from disk */
312static void load_config(void)
313{
314 configfile_load(cfg_filename, config, 1, CFGFILE_MINVERSION);
315}
316
317
318/*Currency choice*/
319static void currency_menu(void)
320{
321 int c=country;
322
323 rb->lcd_clear_display();
324 while (true)
325 {
326 rb->lcd_puts(0,0,"Currency:");
327 rb->lcd_puts(0,1,currency_str[c]);
328 rb->lcd_update();
329 switch (rb->button_get(true))
330 {
331 case BUTTON_RIGHT|BUTTON_REL:
332 c++;
333 if (c>11)
334 c=0;
335 break;
336 case BUTTON_LEFT|BUTTON_REL:
337 c--;
338 if (c<0)
339 c=11;
340 break;
341 case BUTTON_PLAY|BUTTON_REL:
342 country=c;
343 save_config();
344 return;
345 break;
346 case BUTTON_STOP|BUTTON_REL:
347 return;
348 }
349 }
350}
351
352
353/* Display the choice menu. */
354static int euro_menu(void)
355{
356 int c=0;
357
358
359 while (true)
360 {
361 rb->lcd_clear_display();
362 rb->lcd_puts(0,0," Currency");
363 rb->lcd_puts(0,1," Exit");
364 rb->lcd_putc(0,c,0xe110);
365 rb->lcd_update();
366
367 switch (rb->button_get(true))
368 {
369 case BUTTON_RIGHT|BUTTON_REL:
370 c=1;
371 break;
372 case BUTTON_LEFT|BUTTON_REL:
373 c=0;
374 break;
375 case BUTTON_PLAY|BUTTON_REL:
376 if (c==0)
377 currency_menu();
378 else
379 return 1;
380 break;
381 case BUTTON_STOP|BUTTON_REL:
382 return 0;
383 }
384 }
385}
386
387
388/* Call when the program end */
389static void euro_exit(void)
390{
391 //Restore the old pattern (i don't find another way to do this. An idea?)
392 rb->lcd_unlock_pattern(heuro);
393 rb->lcd_unlock_pattern(hhome);
394
395 //Clear the screen
396 rb->lcd_clear_display();
397 rb->lcd_update();
398}
399
400
401/* this is the plugin entry point */
402enum plugin_status plugin_start(const void* parameter)
403{
404 bool end, pos;
405 longlong_t e,h,old_e,old_h;
406 int button;
407
408 /* if you don't use the parameter, you can do like
409 this to avoid the compiler warning about it */
410 (void)parameter;
411 atexit(euro_exit);
412
413 /*Get the pattern handle*/
414 heuro=rb->lcd_get_locked_pattern();
415 hhome=rb->lcd_get_locked_pattern();
416 rb->lcd_define_pattern(heuro, pattern_euro);
417 rb->lcd_define_pattern(hhome, pattern_home);
418
419 h=0;
420 e=0;
421 end=false;
422 pos=false;
423 country=0;
424 cur_pos=3;
425 inc=100000;
426
427 load_config();
428
429 /*Empty the event queue*/
430 rb->button_clear_queue();
431
432 display(e,h,false);
433 show_abbrev();
434 display(e,h,false);
435
436 /*Main loop*/
437 while(end!=true)
438 {
439 button = rb->button_get(true);
440 switch (button)
441 {
442 case BUTTON_MENU|BUTTON_REL:
443 switch (euro_menu())
444 {
445 case 1:
446 end=true;
447 break;
448 }
449 if (!pos)
450 {
451 if (e>max_euro[country])
452 e=0;
453 cur_pos=3;
454 }
455 else
456 {
457 if (h>max_curr[country])
458 h=0;
459 if (nb_digit[country]==2)
460 cur_pos=3;
461 else
462 cur_pos=0;
463 }
464
465 display(e,h,pos);
466 break;
467
468 case BUTTON_ON | BUTTON_PLAY:
469 pos=!pos;
470
471 case BUTTON_ON | BUTTON_REL:
472 e=0;
473 h=0;
474 if (!pos)
475 {
476 cur_pos=3;
477 inc=100000;
478 }
479 else
480 {
481 inc=100000;
482 if (nb_digit[country]==2)
483 cur_pos=3;
484 else
485 cur_pos=0;
486 }
487 show_abbrev();
488 break;
489
490 case BUTTON_STOP|BUTTON_REL:
491 cur_pos--;
492 if (!pos)
493 {
494 if (cur_pos<0)
495 cur_pos=0;
496 if (cur_pos==2)
497 cur_pos=1;
498 if (cur_pos>2)
499 inc=pow10(3+cur_pos-1);
500 else
501 inc=pow10(3+cur_pos);
502 }
503 else
504 {
505 if (cur_pos<0)
506 cur_pos=0;
507 if (nb_digit[country]==2)
508 {
509 if (cur_pos==2)
510 cur_pos=1;
511 if (cur_pos>2)
512 inc=pow10(3+cur_pos-1);
513 else
514 inc=pow10(3+cur_pos);
515 }
516 else
517 inc=pow10(5+cur_pos);
518
519 }
520 break;
521
522 case BUTTON_PLAY|BUTTON_REL:
523 cur_pos++;
524 if (!pos)
525 {
526 if (cur_pos>8)
527 cur_pos=8;
528 if (cur_pos==2)
529 cur_pos=3;
530 if (cur_pos>2)
531 inc=pow10(3+cur_pos-1);
532 else
533 inc=pow10(3+cur_pos);
534 }
535 else
536 {
537 if (cur_pos>8)
538 cur_pos=8;
539 if (nb_digit[country]==2)
540 {
541 if (cur_pos==2)
542 cur_pos=3;
543 if (cur_pos>2)
544 inc=pow10(3+cur_pos-1);
545 else
546 inc=pow10(3+cur_pos);
547 }
548 else
549 inc=pow10(5+cur_pos);
550 }
551 break;
552
553 case BUTTON_LEFT|BUTTON_REL:
554 case BUTTON_LEFT|BUTTON_REPEAT:
555 if (!pos)
556 {
557 e-=inc;
558 if (e<0)
559 e=0;
560 }
561 else
562 {
563 h-=inc;
564 if (h<0)
565 h=0;
566 }
567 break;
568
569 case BUTTON_RIGHT|BUTTON_REL:
570 case BUTTON_RIGHT|BUTTON_REPEAT:
571 old_e=e;
572 old_h=h;
573 if (!pos)
574 {
575 e+=inc;
576 if (e>max_euro[country])
577 e=old_e;
578 }
579 else
580 {
581 h+=inc;
582 if (h>max_curr[country])
583 h=old_h;
584 }
585 break;
586
587 default:
588 exit_on_usb(button);
589 break;
590 }
591 /*Display*/
592 if (!pos) /*Euro>home*/
593 h=mymul(e,currency[country]);
594 else /*Home>euro*/
595 e=mydiv(h,currency[country]);
596 display(e,h,pos);
597 }
598 return PLUGIN_OK;
599}
diff --git a/apps/plugins/firmware_flash.c b/apps/plugins/firmware_flash.c
deleted file mode 100644
index 36b8873a8c..0000000000
--- a/apps/plugins/firmware_flash.c
+++ /dev/null
@@ -1,1033 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Plugin for reprogramming the whole Flash ROM chip with a new content.
11* !!! DON'T MESS WITH THIS CODE UNLESS YOU'RE ABSOLUTELY SURE WHAT YOU DO !!!
12*
13* Copyright (C) 2003 Jörg Hohensohn [IDC]Dragon
14*
15* This program is free software; you can redistribute it and/or
16* modify it under the terms of the GNU General Public License
17* as published by the Free Software Foundation; either version 2
18* of the License, or (at your option) any later version.
19*
20* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21* KIND, either express or implied.
22*
23****************************************************************************/
24#include "plugin.h"
25
26/* define DUMMY if you only want to "play" with the UI, does no harm */
27/* #define DUMMY */
28
29#ifndef UINT8
30#define UINT8 unsigned char
31#endif
32
33#ifndef UINT16
34#define UINT16 unsigned short
35#endif
36
37#ifndef UINT32
38#define UINT32 unsigned long
39#endif
40
41/* platform IDs as I have used them in my firmware templates */
42#define ID_RECORDER 0
43#define ID_FM 1
44#define ID_PLAYER 2
45#define ID_REC_V2 3
46#define ID_ONDIO_FM 4
47#define ID_ONDIO_SP 5
48
49/* Here I have to check for ARCHOS_* defines in source code, which is
50 generally strongly discouraged. But here I'm not checking for a certain
51 feature, I'm checking for the model itself. */
52#if defined(ARCHOS_PLAYER)
53#define FILE_TYPE "player"
54#define KEEP VERSION_ADR /* keep the firmware version */
55#define PLATFORM_ID ID_PLAYER
56#elif defined(ARCHOS_RECORDER)
57#define FILE_TYPE "rec"
58#define KEEP MASK_ADR /* keep the mask value */
59#define PLATFORM_ID ID_RECORDER
60#elif defined(ARCHOS_RECORDERV2)
61#define FILE_TYPE "v2"
62#define KEEP MASK_ADR /* keep the mask value */
63#define PLATFORM_ID ID_REC_V2
64#elif defined(ARCHOS_FMRECORDER)
65#define FILE_TYPE "fm"
66#define KEEP MASK_ADR /* keep the mask value */
67#define PLATFORM_ID ID_FM
68#elif defined(ARCHOS_ONDIOFM)
69#define FILE_TYPE "ondiofm"
70#define KEEP MASK_ADR /* keep the mask value */
71#define PLATFORM_ID ID_ONDIO_FM
72#elif defined(ARCHOS_ONDIOSP)
73#define FILE_TYPE "ondiosp"
74#define KEEP MASK_ADR /* keep the mask value */
75#define PLATFORM_ID ID_ONDIO_SP
76#else
77#error this platform is not (yet) flashable
78#endif
79
80
81
82#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
83#define KEY1 BUTTON_LEFT
84#define KEY2 BUTTON_UP
85#define KEY3 BUTTON_RIGHT
86#define KEYNAME1 "[Left]"
87#define KEYNAME2 "[Up]"
88#define KEYNAME3 "[Right]"
89#else /* recorder keypad */
90#define KEY1 BUTTON_F1
91#define KEY2 BUTTON_F2
92#define KEY3 BUTTON_F3
93#define KEYNAME1 "[F1]"
94#define KEYNAME2 "[F2]"
95#define KEYNAME3 "[F3]"
96#endif
97
98/* result of the CheckFirmwareFile() function */
99typedef enum
100{
101 eOK = 0,
102 eFileNotFound, /* errors from here on */
103 eTooBig,
104 eTooSmall,
105 eReadErr,
106 eBadContent,
107 eCrcErr,
108 eBadPlatform,
109} tCheckResult;
110
111/* result of the CheckBootROM() function */
112typedef enum
113{
114 eBootROM, /* the supported boot ROM(s) */
115 eUnknown, /* unknown boot ROM */
116 eROMless, /* flash mapped to zero */
117} tCheckROM;
118
119typedef struct
120{
121 UINT8 manufacturer;
122 UINT8 id;
123 int size;
124 char name[32];
125} tFlashInfo;
126
127#define MASK_ADR 0xFC /* position of hardware mask value in Flash */
128#define VERSION_ADR 0xFE /* position of firmware version value in Flash */
129#define PLATFORM_ADR 0xFB /* position of my platform ID value in Flash */
130#define SEC_SIZE 4096 /* size of one flash sector */
131static UINT8* sector; /* better not place this on the stack... */
132static volatile UINT8* FB = (UINT8*)0x02000000; /* Flash base address */
133
134
135/***************** Flash Functions *****************/
136
137
138/* read the manufacturer and device ID */
139bool ReadID(volatile UINT8* pBase, UINT8* pManufacturerID, UINT8* pDeviceID)
140{
141 UINT8 not_manu, not_id; /* read values before switching to ID mode */
142 UINT8 manu, id; /* read values when in ID mode */
143
144 pBase = (UINT8*)((UINT32)pBase & 0xFFF80000); /* down to 512k align */
145
146 /* read the normal content */
147 not_manu = pBase[0]; /* should be 'A' (0x41) and 'R' (0x52) */
148 not_id = pBase[1]; /* from the "ARCH" marker */
149
150 pBase[0x5555] = 0xAA; /* enter command mode */
151 pBase[0x2AAA] = 0x55;
152 pBase[0x5555] = 0x90; /* ID command */
153 rb->sleep(HZ/50); /* Atmel wants 20ms pause here */
154
155 manu = pBase[0];
156 id = pBase[1];
157
158 pBase[0] = 0xF0; /* reset flash (back to normal read mode) */
159 rb->sleep(HZ/50); /* Atmel wants 20ms pause here */
160
161 /* I assume success if the obtained values are different from
162 the normal flash content. This is not perfectly bulletproof, they
163 could theoretically be the same by chance, causing us to fail. */
164 if (not_manu != manu || not_id != id) /* a value has changed */
165 {
166 *pManufacturerID = manu; /* return the results */
167 *pDeviceID = id;
168 return true; /* success */
169 }
170 return false; /* fail */
171}
172
173
174/* erase the sector which contains the given address */
175bool EraseSector(volatile UINT8* pAddr)
176{
177#ifdef DUMMY
178 (void)pAddr; /* prevents warning */
179 return true;
180#else
181 volatile UINT8* pBase = (UINT8*)((UINT32)pAddr & 0xFFF80000); /* round down to 512k align */
182 unsigned timeout = 43000; /* the timeout loop should be no less than 25ms */
183
184 pBase[0x5555] = 0xAA; /* enter command mode */
185 pBase[0x2AAA] = 0x55;
186 pBase[0x5555] = 0x80; /* erase command */
187 pBase[0x5555] = 0xAA; /* enter command mode */
188 pBase[0x2AAA] = 0x55;
189 *pAddr = 0x30; /* erase the sector */
190
191 /* I counted 7 instructions for this loop -> min. 0.58 us per round */
192 /* Plus memory waitstates it will be much more, gives margin */
193 while (*pAddr != 0xFF && --timeout); /* poll for erased */
194
195 return (timeout != 0);
196#endif
197}
198
199
200/* address must be in an erased location */
201static inline bool ProgramByte(volatile UINT8* pAddr, UINT8 data)
202{
203#ifdef DUMMY
204 (void)pAddr; /* prevents warnings */
205 (void)data;
206 return true;
207#else
208 unsigned timeout = 35; /* the timeout loop should be no less than 20us */
209
210 if (~*pAddr & data) /* just a safety feature, not really necessary */
211 return false; /* can't set any bit from 0 to 1 */
212
213 FB[0x5555] = 0xAA; /* enter command mode */
214 FB[0x2AAA] = 0x55;
215 FB[0x5555] = 0xA0; /* byte program command */
216
217 *pAddr = data;
218
219 /* I counted 7 instructions for this loop -> min. 0.58 us per round */
220 /* Plus memory waitstates it will be much more, gives margin */
221 while (*pAddr != data && --timeout); /* poll for programmed */
222
223 return (timeout != 0);
224#endif
225}
226
227
228/* this returns true if supported and fills the info struct */
229bool GetFlashInfo(tFlashInfo* pInfo)
230{
231 rb->memset(pInfo, 0, sizeof(tFlashInfo));
232
233 if (!ReadID(FB, &pInfo->manufacturer, &pInfo->id))
234 return false;
235
236 if (pInfo->manufacturer == 0xBF) /* SST */
237 {
238 if (pInfo->id == 0xD6)
239 {
240 pInfo->size = 256* 1024; /* 256k */
241 rb->strcpy(pInfo->name, "SST39VF020");
242 return true;
243 }
244 else if (pInfo->id == 0xD7)
245 {
246 pInfo->size = 512* 1024; /* 512k */
247 rb->strcpy(pInfo->name, "SST39VF040");
248 return true;
249 }
250 else
251 return false;
252 }
253 return false;
254}
255
256/*********** Firmware File Functions + helpers ************/
257
258/* test if the version number is consistent with the platform */
259bool CheckPlatform(int platform_id, UINT16 version)
260{
261 if (version == 200)
262 { /* for my very first firmwares, I foolishly changed it to 200 */
263 return (platform_id == ID_RECORDER || platform_id == ID_FM);
264 }
265 else if (version == 123)
266 { /* it can be a FM or V2 recorder */
267 return (platform_id == ID_FM || platform_id == ID_REC_V2);
268 }
269 else if (version == 132)
270 { /* newer Ondio, and seen on a V2 recorder */
271 return (platform_id == ID_ONDIO_SP || platform_id == ID_ONDIO_FM
272 || platform_id == ID_REC_V2);
273 }
274 else if (version == 104)
275 { /* classic Ondio128 */
276 return (platform_id == ID_ONDIO_FM);
277 }
278 else if (version >= 115 && version <= 129)
279 { /* the range of Recorders seen so far */
280 return (platform_id == ID_RECORDER);
281 }
282 else if (version == 0 || (version >= 300 && version <= 508))
283 { /* for very old players, I've seen zero */
284 return (platform_id == ID_PLAYER);
285 }
286
287 return false; /* unknown */
288}
289
290
291tCheckResult CheckFirmwareFile(char* filename, int chipsize, bool is_romless)
292{
293 int i;
294 int fd;
295 int fileleft; /* size info, how many left for reading */
296 int fileread = 0; /* total size as read from the file */
297 int read_now; /* how many to read for this sector */
298 int got_now; /* how many gotten for this sector */
299 unsigned crc32 = 0xFFFFFFFF; /* CCITT init value */
300 unsigned file_crc; /* CRC value read from file */
301 bool has_crc;
302
303 fd = rb->open(filename, O_RDONLY);
304 if (fd < 0)
305 return eFileNotFound;
306
307 fileleft = rb->filesize(fd);
308 if (fileleft > chipsize)
309 {
310 rb->close(fd);
311 return eTooBig;
312 }
313 else if (fileleft < 20000) /* give it some reasonable lower limit */
314 {
315 rb->close(fd);
316 return eTooSmall;
317 }
318
319 if (fileleft == 256*1024)
320 { /* original dumped firmware file has no CRC nor platform ID */
321 has_crc = false;
322 }
323 else
324 {
325 has_crc = true;
326 fileleft -= sizeof(unsigned); /* exclude the last 4 bytes */
327 }
328
329 /* do some sanity checks */
330
331 got_now = rb->read(fd, sector, SEC_SIZE); /* read first sector */
332 fileread += got_now;
333 fileleft -= got_now;
334 if (got_now != SEC_SIZE)
335 {
336 rb->close(fd);
337 return eReadErr;
338 }
339
340 /* version number in file plausible with this hardware? */
341 if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(sector + VERSION_ADR)))
342 {
343 rb->close(fd);
344 return eBadPlatform;
345 }
346
347 if (has_crc)
348 {
349 crc32 = rb->crc_32(sector, SEC_SIZE, crc32); /* checksum */
350
351 /* in addition to the CRC, my files also have a platform ID */
352 if (sector[PLATFORM_ADR] != PLATFORM_ID) /* for our hardware? */
353 {
354 rb->close(fd);
355 return eBadPlatform;
356 }
357 }
358
359 if (is_romless)
360 { /* in this case, there is not much we can check */
361 if (*(UINT32*)sector != 0x00000200) /* reset vector */
362 {
363 rb->close(fd);
364 return eBadContent;
365 }
366 }
367 else
368 {
369 /* compare some bytes which have to be identical */
370 if (*(UINT32*)sector != 0x41524348) /* "ARCH" */
371 {
372 rb->close(fd);
373 return eBadContent;
374 }
375
376 for (i = 0x30; i<MASK_ADR-2; i++) /* leave two bytes for me */
377 {
378 if (sector[i] != FB[i])
379 {
380 rb->close(fd);
381 return eBadContent;
382 }
383 }
384 }
385
386 /* check if we can read the whole file, and do checksum */
387 do
388 {
389 read_now = MIN(SEC_SIZE, fileleft);
390 got_now = rb->read(fd, sector, read_now);
391 fileread += got_now;
392 fileleft -= got_now;
393
394 if (read_now != got_now)
395 {
396 rb->close(fd);
397 return eReadErr;
398 }
399
400 if (has_crc)
401 {
402 crc32 = rb->crc_32(sector, got_now, crc32); /* checksum */
403 }
404 } while (fileleft);
405
406 if (has_crc)
407 {
408 got_now = rb->read(fd, &file_crc, sizeof(file_crc));
409 if (got_now != sizeof(file_crc))
410 {
411 rb->close(fd);
412 return eReadErr;
413 }
414 }
415
416 /* must be EOF now */
417 got_now = rb->read(fd, sector, SEC_SIZE);
418 rb->close(fd);
419 if (got_now != 0)
420 return eReadErr;
421
422 if (has_crc && file_crc != crc32)
423 return eCrcErr;
424
425 return eOK;
426}
427
428
429/* returns the # of failures, 0 on success */
430unsigned ProgramFirmwareFile(char* filename, int chipsize)
431{
432 int i, j;
433 int fd;
434 int read = SEC_SIZE; /* how many for this sector */
435 UINT16 keep = *(UINT16*)(FB + KEEP); /* we must keep this! */
436 unsigned failures = 0;
437
438 fd = rb->open(filename, O_RDONLY);
439 if (fd < 0)
440 return false;
441
442 for (i=0; i<chipsize; i+=SEC_SIZE)
443 {
444 if (!EraseSector(FB + i))
445 {
446 /* nothing we can do, let the programming count the errors */
447 }
448
449 if (read == SEC_SIZE) /* not EOF yet */
450 {
451 read = rb->read(fd, sector, SEC_SIZE);
452 if (i==0)
453 { /* put original value back in */
454 *(UINT16*)(sector + KEEP) = keep;
455 }
456
457 for (j=0; j<read; j++)
458 {
459 if (!ProgramByte(FB + i + j, sector[j]))
460 {
461 failures++;
462 }
463 }
464 }
465 }
466
467 rb->close(fd);
468
469 return failures;
470}
471
472
473/* returns the # of failures, 0 on success */
474unsigned VerifyFirmwareFile(char* filename)
475{
476 int i=0, j;
477 int fd;
478 int read = SEC_SIZE; /* how many for this sector */
479 unsigned failures = 0;
480
481 fd = rb->open(filename, O_RDONLY);
482 if (fd < 0)
483 return false;
484
485 do
486 {
487 read = rb->read(fd, sector, SEC_SIZE);
488
489 for (j=0; j<read; j++)
490 {
491 /* position of keep value is no error */
492 if (FB[i] != sector[j] && i != KEEP && i != (KEEP+1))
493 {
494 failures++;
495 }
496 i++;
497 }
498 }
499 while (read == SEC_SIZE);
500
501 rb->close(fd);
502
503 return failures;
504}
505
506
507/***************** Support Functions *****************/
508
509/* check if we have "normal" boot ROM or flash mirrored to zero */
510tCheckROM CheckBootROM(void)
511{
512 unsigned boot_crc;
513 unsigned* pFlash = (unsigned*)FB;
514 unsigned* pRom = (unsigned*)0x0;
515 unsigned i;
516
517 boot_crc = rb->crc_32((unsigned char*)0x0, 64*1024, 0xFFFFFFFF);
518 if (boot_crc == 0x56DBA4EE /* the known boot ROM */
519#if PLATFORM_ID == ID_PLAYER
520 /* alternative boot ROM found in one single player so far */
521 || boot_crc == 0x358099E8
522#endif
523 )
524 return eBootROM;
525
526 /* check if ROM is a flash mirror */
527 for (i=0; i<256*1024/sizeof(unsigned); i++)
528 {
529 if (*pRom++ != *pFlash++)
530 { /* difference means no mirror */
531 return eUnknown;
532 }
533 }
534
535 return eROMless;
536}
537
538
539/***************** User Interface Functions *****************/
540
541int WaitForButton(void)
542{
543 int button;
544
545 do
546 {
547 button = rb->button_get(true);
548 } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
549
550 return button;
551}
552
553#ifdef HAVE_LCD_BITMAP
554/* Recorder implementation */
555
556/* helper for DoUserDialog() */
557void ShowFlashInfo(tFlashInfo* pInfo)
558{
559 if (!pInfo->manufacturer)
560 {
561 rb->lcd_puts(0, 0, "Flash: M=?? D=??");
562 rb->lcd_puts(0, 1, "Impossible to program");
563 }
564 else
565 {
566 rb->lcd_putsf(0, 0, "Flash: M=%02x D=%02x",
567 pInfo->manufacturer, pInfo->id);
568
569
570 if (pInfo->size)
571 {
572 rb->lcd_puts(0, 1, pInfo->name);
573 rb->lcd_putsf(0, 2, "Size: %d KB", pInfo->size / 1024);
574 }
575 else
576 {
577 rb->lcd_puts(0, 1, "Unsupported chip");
578 }
579
580 }
581
582 rb->lcd_update();
583}
584
585
586/* Kind of our main function, defines the application flow. */
587void DoUserDialog(char* filename)
588{
589 tFlashInfo FlashInfo;
590 char default_filename[32];
591 int button;
592 int rc; /* generic return code */
593 size_t memleft;
594 tCheckROM result;
595 bool is_romless;
596
597 /* this can only work if Rockbox runs in DRAM, not flash ROM */
598 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
599 { /* we're running from flash */
600 rb->splash(HZ*3, "Not from ROM");
601 return; /* exit */
602 }
603
604 /* test if the user is running the correct plugin for this box */
605 if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR)))
606 {
607 rb->splash(HZ*3, "Wrong plugin");
608 return; /* exit */
609 }
610
611 /* refuse to work if the power may fail meanwhile */
612 if (!rb->battery_level_safe())
613 {
614 rb->splash(HZ*3, "Battery too low!");
615 return; /* exit */
616 }
617
618 /* check boot ROM */
619 result = CheckBootROM();
620 if (result == eUnknown)
621 { /* no support for any other yet */
622 rb->splash(HZ*3, "Wrong boot ROM");
623 return; /* exit */
624 }
625 is_romless = (result == eROMless);
626
627 /* compose filename if none given */
628 if (filename == NULL)
629 {
630 rb->snprintf(
631 default_filename,
632 sizeof(default_filename),
633 "/firmware_%s%s.bin",
634 FILE_TYPE,
635 is_romless ? "_norom" : "");
636 filename = default_filename;
637 }
638
639 /* "allocate" memory */
640 sector = rb->plugin_get_buffer(&memleft);
641 if (memleft < SEC_SIZE) /* need buffer for a flash sector */
642 {
643 rb->splash(HZ*3, "Out of memory");
644 return; /* exit */
645 }
646
647 rb->lcd_setfont(FONT_SYSFIXED);
648
649 rc = GetFlashInfo(&FlashInfo);
650 ShowFlashInfo(&FlashInfo);
651 if (FlashInfo.size == 0) /* no valid chip */
652 {
653 rb->splash(HZ*3, "Sorry!");
654 return; /* exit */
655 }
656
657 rb->lcd_puts(0, 3, "using file:");
658 rb->lcd_puts_scroll(0, 4, filename);
659 rb->lcd_puts(0, 6, KEYNAME1 " to check file");
660 rb->lcd_puts(0, 7, "other key to exit");
661 rb->lcd_update();
662
663 button = WaitForButton();
664 if (button != KEY1)
665 {
666 return;
667 }
668
669 rb->lcd_clear_display();
670 rb->lcd_puts(0, 0, "checking...");
671 rb->lcd_update();
672
673 rc = CheckFirmwareFile(filename, FlashInfo.size, is_romless);
674 rb->lcd_puts(0, 0, "checked:");
675 switch (rc)
676 {
677 case eOK:
678 rb->lcd_puts(0, 1, "File OK.");
679 break;
680 case eFileNotFound:
681 rb->lcd_puts(0, 1, "File not found.");
682 rb->lcd_puts(0, 2, "Put this in root:");
683 rb->lcd_puts_scroll(0, 4, filename);
684 break;
685 case eTooBig:
686 rb->lcd_puts(0, 1, "File too big,");
687 rb->lcd_puts(0, 2, "larger than chip.");
688 break;
689 case eTooSmall:
690 rb->lcd_puts(0, 1, "File too small.");
691 rb->lcd_puts(0, 2, "Incomplete?");
692 break;
693 case eReadErr:
694 rb->lcd_puts(0, 1, "Read error.");
695 break;
696 case eBadContent:
697 rb->lcd_puts(0, 1, "File invalid.");
698 rb->lcd_puts(0, 2, "Sanity check fail.");
699 break;
700 case eCrcErr:
701 rb->lcd_puts(0, 1, "File invalid.");
702 rb->lcd_puts(0, 2, "CRC check failed,");
703 rb->lcd_puts(0, 3, "checksum mismatch.");
704 break;
705 case eBadPlatform:
706 rb->lcd_puts(0, 1, "Wrong file for");
707 rb->lcd_puts(0, 2, "this hardware.");
708 break;
709 default:
710 rb->lcd_puts(0, 1, "Check failed.");
711 break;
712 }
713
714 if (rc == eOK)
715 {
716 rb->lcd_puts(0, 6, KEYNAME2 " to program");
717 rb->lcd_puts(0, 7, "other key to exit");
718 }
719 else
720 { /* error occured */
721 rb->lcd_puts(0, 6, "Any key to exit");
722 }
723
724 rb->lcd_update();
725
726 button = WaitForButton();
727 if (button != KEY2 || rc != eOK)
728 {
729 return;
730 }
731
732 rb->lcd_clear_display();
733 rb->lcd_puts(0, 0, "Program all Flash?");
734 rb->lcd_puts(0, 1, "Are you sure?");
735 rb->lcd_puts(0, 2, "If it goes wrong,");
736 rb->lcd_puts(0, 3, "it kills your box!");
737 rb->lcd_puts(0, 4, "See documentation.");
738
739 rb->lcd_puts(0, 6, KEYNAME3 " to proceed");
740 rb->lcd_puts(0, 7, "other key to exit");
741 rb->lcd_update();
742
743 button = WaitForButton();
744 if (button != KEY3)
745 {
746 return;
747 }
748
749 rb->lcd_clear_display();
750 rb->lcd_puts(0, 0, "Programming...");
751 rb->lcd_update();
752
753 rc = ProgramFirmwareFile(filename, FlashInfo.size);
754 if (rc)
755 { /* errors */
756 rb->lcd_clear_display();
757 rb->lcd_puts(0, 0, "Panic:");
758 rb->lcd_puts(0, 1, "Programming fail!");
759 rb->lcd_putsf(0, 2, "%d errors", rc);
760 rb->lcd_update();
761 button = WaitForButton();
762 }
763
764 rb->lcd_clear_display();
765 rb->lcd_puts(0, 0, "Verifying...");
766 rb->lcd_update();
767
768 rc = VerifyFirmwareFile(filename);
769
770 rb->lcd_clear_display();
771 if (rc == 0)
772 {
773 rb->lcd_puts(0, 0, "Verify OK.");
774 }
775 else
776 {
777 rb->lcd_puts(0, 0, "Panic:");
778 rb->lcd_puts(0, 1, "Verify fail!");
779 rb->lcd_putsf(0, 2, "%d errors", rc);
780 }
781 rb->lcd_puts(0, 7, "Any key to exit");
782 rb->lcd_update();
783
784 button = WaitForButton();
785}
786
787#else /* HAVE_LCD_BITMAP */
788/* Player implementation */
789
790/* helper for DoUserDialog() */
791void ShowFlashInfo(tFlashInfo* pInfo)
792{
793 char buf[32];
794
795 if (!pInfo->manufacturer)
796 {
797 rb->lcd_puts_scroll(0, 0, "Flash: M=? D=?");
798 rb->lcd_puts_scroll(0, 1, "Impossible to program");
799 rb->lcd_update();
800 WaitForButton();
801 }
802 else
803 {
804 rb->snprintf(buf, sizeof(buf), "Flash: M=%02x D=%02x",
805 pInfo->manufacturer, pInfo->id);
806 rb->lcd_puts_scroll(0, 0, buf);
807
808 if (pInfo->size)
809 {
810 rb->snprintf(buf, sizeof(buf), "Size: %d KB", pInfo->size / 1024);
811 rb->lcd_puts_scroll(0, 1, buf);
812 rb->lcd_update();
813 }
814 else
815 {
816 rb->lcd_puts_scroll(0, 1, "Unsupported chip");
817 rb->lcd_update();
818 WaitForButton();
819 }
820 }
821}
822
823
824void DoUserDialog(char* filename)
825{
826 tFlashInfo FlashInfo;
827 char buf[32];
828 char default_filename[32];
829 int button;
830 int rc; /* generic return code */
831 size_t memleft;
832 tCheckROM result;
833 bool is_romless;
834
835 /* this can only work if Rockbox runs in DRAM, not flash ROM */
836 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
837 { /* we're running from flash */
838 rb->splash(HZ*3, "Not from ROM");
839 return; /* exit */
840 }
841
842 /* test if the user is running the correct plugin for this box */
843 if (!CheckPlatform(PLATFORM_ID, *(UINT16*)(FB + VERSION_ADR)))
844 {
845 rb->splash(HZ*3, "Wrong version");
846 return; /* exit */
847 }
848
849 /* refuse to work if the power may fail meanwhile */
850 if (!rb->battery_level_safe())
851 {
852 rb->splash(HZ*3, "Batt. too low!");
853 return; /* exit */
854 }
855
856 /* check boot ROM */
857 result = CheckBootROM();
858 if (result == eUnknown)
859 { /* no support for any other yet */
860 rb->splash(HZ*3, "Wrong boot ROM");
861 return; /* exit */
862 }
863 is_romless = (result == eROMless);
864
865 /* compose filename if none given */
866 if (filename == NULL)
867 {
868 rb->snprintf(
869 default_filename,
870 sizeof(default_filename),
871 "/firmware_%s%s.bin",
872 FILE_TYPE,
873 is_romless ? "_norom" : "");
874 filename = default_filename;
875 }
876
877 /* "allocate" memory */
878 sector = rb->plugin_get_buffer(&memleft);
879 if (memleft < SEC_SIZE) /* need buffer for a flash sector */
880 {
881 rb->splash(HZ*3, "Out of memory");
882 return; /* exit */
883 }
884
885 rc = GetFlashInfo(&FlashInfo);
886 ShowFlashInfo(&FlashInfo);
887
888 if (FlashInfo.size == 0) /* no valid chip */
889 {
890 return; /* exit */
891 }
892
893 rb->lcd_puts_scroll(0, 0, filename);
894 rb->lcd_puts_scroll(0, 1, "[Menu] to check");
895 rb->lcd_update();
896
897 button = WaitForButton();
898 if (button != BUTTON_MENU)
899 {
900 return;
901 }
902
903 rb->lcd_clear_display();
904 rb->lcd_puts(0, 0, "Checking...");
905 rb->lcd_update();
906
907 rc = CheckFirmwareFile(filename, FlashInfo.size, is_romless);
908 rb->lcd_puts(0, 0, "Checked:");
909 switch (rc)
910 {
911 case eOK:
912 rb->lcd_puts(0, 1, "File OK.");
913 break;
914 case eFileNotFound:
915 rb->lcd_puts_scroll(0, 0, "File not found:");
916 rb->lcd_puts_scroll(0, 1, filename);
917 break;
918 case eTooBig:
919 rb->lcd_puts_scroll(0, 0, "File too big,");
920 rb->lcd_puts_scroll(0, 1, "larger than chip.");
921 break;
922 case eTooSmall:
923 rb->lcd_puts_scroll(0, 0, "File too small.");
924 rb->lcd_puts_scroll(0, 1, "Incomplete?");
925 break;
926 case eReadErr:
927 rb->lcd_puts_scroll(0, 0, "Read error.");
928 break;
929 case eBadContent:
930 rb->lcd_puts_scroll(0, 0, "File invalid.");
931 rb->lcd_puts_scroll(0, 1, "Sanity check failed.");
932 break;
933 case eCrcErr:
934 rb->lcd_puts_scroll(0, 0, "File invalid.");
935 rb->lcd_puts_scroll(0, 1, "CRC check failed.");
936 break;
937 case eBadPlatform:
938 rb->lcd_puts_scroll(0, 0, "Wrong file for");
939 rb->lcd_puts_scroll(0, 1, "this hardware.");
940 break;
941 default:
942 rb->lcd_puts_scroll(0, 0, "Check failed.");
943 break;
944 }
945 rb->lcd_update();
946
947 rb->sleep(HZ*3);
948
949 if (rc == eOK)
950 {
951 rb->lcd_puts_scroll(0, 0, "[On] to program,");
952 rb->lcd_puts_scroll(0, 1, "other key to exit.");
953 rb->lcd_update();
954 }
955 else
956 { /* error occured */
957 return;
958 }
959
960 button = WaitForButton();
961
962 if (button != BUTTON_ON)
963 {
964 return;
965 }
966
967 rb->lcd_clear_display();
968 rb->lcd_puts_scroll(0, 0, "Are you sure?");
969 rb->lcd_puts_scroll(0, 1, "[+] to proceed.");
970 rb->lcd_update();
971
972 button = WaitForButton();
973
974 if (button != BUTTON_RIGHT)
975 {
976 return;
977 }
978
979 rb->lcd_clear_display();
980 rb->lcd_puts_scroll(0, 0, "Programming...");
981 rb->lcd_update();
982
983 rc = ProgramFirmwareFile(filename, FlashInfo.size);
984
985 if (rc)
986 { /* errors */
987 rb->lcd_clear_display();
988 rb->lcd_puts_scroll(0, 0, "Programming failed!");
989 rb->snprintf(buf, sizeof(buf), "%d errors", rc);
990 rb->lcd_puts_scroll(0, 1, buf);
991 rb->lcd_update();
992 WaitForButton();
993 }
994
995 rb->lcd_clear_display();
996 rb->lcd_puts_scroll(0, 0, "Verifying...");
997 rb->lcd_update();
998
999 rc = VerifyFirmwareFile(filename);
1000
1001 rb->lcd_clear_display();
1002
1003 if (rc == 0)
1004 {
1005 rb->lcd_puts_scroll(0, 0, "Verify OK.");
1006 }
1007 else
1008 {
1009 rb->snprintf(buf, sizeof(buf), "Verify failed! %d errors", rc);
1010 rb->lcd_puts_scroll(0, 0, buf);
1011 }
1012
1013 rb->lcd_puts_scroll(0, 1, "Press any key to exit.");
1014 rb->lcd_update();
1015 WaitForButton();
1016}
1017
1018#endif /* not HAVE_LCD_BITMAP */
1019
1020
1021/***************** Plugin Entry Point *****************/
1022
1023enum plugin_status plugin_start(const void* parameter)
1024{
1025 int oldmode;
1026
1027 /* now go ahead and have fun! */
1028 oldmode = rb->system_memory_guard(MEMGUARD_NONE); /*disable memory guard */
1029 DoUserDialog((char*) parameter);
1030 rb->system_memory_guard(oldmode); /* re-enable memory guard */
1031
1032 return PLUGIN_OK;
1033}
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index ed288d444d..fab409cc14 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -23,42 +23,7 @@
23 23
24 24
25/* variable button definitions */ 25/* variable button definitions */
26#if CONFIG_KEYPAD == RECORDER_PAD 26#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
27#define FLIPIT_LEFT BUTTON_LEFT
28#define FLIPIT_RIGHT BUTTON_RIGHT
29#define FLIPIT_UP BUTTON_UP
30#define FLIPIT_DOWN BUTTON_DOWN
31#define FLIPIT_QUIT BUTTON_OFF
32#define FLIPIT_SHUFFLE BUTTON_F1
33#define FLIPIT_SOLVE BUTTON_F2
34#define FLIPIT_STEP_BY_STEP BUTTON_F3
35#define FLIPIT_TOGGLE BUTTON_PLAY
36
37#elif CONFIG_KEYPAD == PLAYER_PAD
38#define FLIPIT_LEFT BUTTON_LEFT
39#define FLIPIT_RIGHT BUTTON_RIGHT
40#define FLIPIT_UP_PRE BUTTON_ON
41#define FLIPIT_UP (BUTTON_ON | BUTTON_REL)
42#define FLIPIT_DOWN BUTTON_MENU
43#define FLIPIT_QUIT BUTTON_STOP
44#define FLIPIT_SHUFFLE (BUTTON_ON | BUTTON_LEFT)
45#define FLIPIT_SOLVE (BUTTON_ON | BUTTON_RIGHT)
46#define FLIPIT_STEP_BY_STEP (BUTTON_ON | BUTTON_PLAY)
47#define FLIPIT_TOGGLE BUTTON_PLAY
48
49#elif CONFIG_KEYPAD == ONDIO_PAD
50#define FLIPIT_LEFT BUTTON_LEFT
51#define FLIPIT_RIGHT BUTTON_RIGHT
52#define FLIPIT_UP BUTTON_UP
53#define FLIPIT_DOWN BUTTON_DOWN
54#define FLIPIT_QUIT BUTTON_OFF
55#define FLIPIT_SHUFFLE (BUTTON_MENU | BUTTON_LEFT)
56#define FLIPIT_SOLVE (BUTTON_MENU | BUTTON_UP)
57#define FLIPIT_STEP_BY_STEP (BUTTON_MENU | BUTTON_RIGHT)
58#define FLIPIT_TOGGLE_PRE BUTTON_MENU
59#define FLIPIT_TOGGLE (BUTTON_MENU | BUTTON_REL)
60
61#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
62 (CONFIG_KEYPAD == IRIVER_H300_PAD) 27 (CONFIG_KEYPAD == IRIVER_H300_PAD)
63#define FLIPIT_LEFT BUTTON_LEFT 28#define FLIPIT_LEFT BUTTON_LEFT
64#define FLIPIT_RIGHT BUTTON_RIGHT 29#define FLIPIT_RIGHT BUTTON_RIGHT
@@ -937,20 +902,8 @@ enum plugin_status plugin_start(const void* parameter)
937 /* print instructions */ 902 /* print instructions */
938 rb->lcd_clear_display(); 903 rb->lcd_clear_display();
939 rb->lcd_setfont(FONT_SYSFIXED); 904 rb->lcd_setfont(FONT_SYSFIXED);
940#if CONFIG_KEYPAD == RECORDER_PAD 905#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
941 rb->lcd_putsxy(2, 8, "[OFF] to stop"); 906 (CONFIG_KEYPAD == IRIVER_H300_PAD)
942 rb->lcd_putsxy(2, 18, "[PLAY] toggle");
943 rb->lcd_putsxy(2, 28, "[F1] shuffle");
944 rb->lcd_putsxy(2, 38, "[F2] solution");
945 rb->lcd_putsxy(2, 48, "[F3] step by step");
946#elif CONFIG_KEYPAD == ONDIO_PAD
947 rb->lcd_putsxy(2, 8, "[OFF] to stop");
948 rb->lcd_putsxy(2, 18, "[MODE] toggle");
949 rb->lcd_putsxy(2, 28, "[M-LEFT] shuffle");
950 rb->lcd_putsxy(2, 38, "[M-UP] solution");
951 rb->lcd_putsxy(2, 48, "[M-RIGHT] step by step");
952#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
953 (CONFIG_KEYPAD == IRIVER_H300_PAD)
954 rb->lcd_putsxy(2, 8, "[STOP] to stop"); 907 rb->lcd_putsxy(2, 8, "[STOP] to stop");
955 rb->lcd_putsxy(2, 18, "[SELECT] toggle"); 908 rb->lcd_putsxy(2, 18, "[SELECT] toggle");
956 rb->lcd_putsxy(2, 28, "[MODE] shuffle"); 909 rb->lcd_putsxy(2, 28, "[MODE] shuffle");
diff --git a/apps/plugins/fractals/cpu_sh7043.h b/apps/plugins/fractals/cpu_sh7043.h
deleted file mode 100644
index 0d773432a8..0000000000
--- a/apps/plugins/fractals/cpu_sh7043.h
+++ /dev/null
@@ -1,96 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2009 Tomer Shalev
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _CPU_SH7043_H
23#define _CPU_SH7043_H
24
25inline static short muls16_asr10(short a, short b)
26{
27 short r;
28 asm (
29 "muls %[a],%[b] \n"
30 "sts macl,%[r] \n"
31 "shlr8 %[r] \n"
32 "shlr2 %[r] \n"
33 : /* outputs */
34 [r]"=r"(r)
35 : /* inputs */
36 [a]"r"(a),
37 [b]"r"(b)
38 );
39 return r;
40}
41
42inline static long muls32_asr26(long a, long b)
43{
44 long r, t1, t2, t3;
45 asm (
46 /* Signed 32bit * 32bit -> 64bit multiplication.
47 Notation: xxab * xxcd, where each letter represents 16 bits.
48 xx is the 64 bit sign extension. */
49 "swap.w %[a],%[t1] \n" /* t1 = ba */
50 "mulu %[t1],%[b] \n" /* a * d */
51 "swap.w %[b],%[t3] \n" /* t3 = dc */
52 "sts macl,%[t2] \n" /* t2 = a * d */
53 "mulu %[t1],%[t3] \n" /* a * c */
54 "sts macl,%[r] \n" /* hi = a * c */
55 "mulu %[a],%[t3] \n" /* b * c */
56 "clrt \n"
57 "sts macl,%[t3] \n" /* t3 = b * c */
58 "addc %[t2],%[t3] \n" /* t3 += t2, carry -> t2 */
59 "movt %[t2] \n"
60 "mulu %[a],%[b] \n" /* b * d */
61 "mov %[t3],%[t1] \n" /* t1t3 = t2t3 << 16 */
62 "xtrct %[t2],%[t1] \n"
63 "shll16 %[t3] \n"
64 "sts macl,%[t2] \n" /* lo = b * d */
65 "clrt \n" /* hi.lo += t1t3 */
66 "addc %[t3],%[t2] \n"
67 "addc %[t1],%[r] \n"
68 "cmp/pz %[a] \n" /* ab >= 0 ? */
69 "bt 1f \n"
70 "sub %[b],%[r] \n" /* no: hi -= cd (sign extension of ab is -1) */
71 "1: \n"
72 "cmp/pz %[b] \n" /* cd >= 0 ? */
73 "bt 2f \n"
74 "sub %[a],%[r] \n" /* no: hi -= ab (sign extension of cd is -1) */
75 "2: \n"
76 /* Shift right by 26 and return low 32 bits */
77 "shll2 %[r] \n" /* hi <<= 6 */
78 "shll2 %[r] \n"
79 "shll2 %[r] \n"
80 "shlr16 %[t2] \n" /* (unsigned)lo >>= 26 */
81 "shlr8 %[t2] \n"
82 "shlr2 %[t2] \n"
83 "or %[t2],%[r] \n" /* combine result */
84 : /* outputs */
85 [r] "=&r"(r),
86 [t1]"=&r"(t1),
87 [t2]"=&r"(t2),
88 [t3]"=&r"(t3)
89 : /* inputs */
90 [a] "r" (a),
91 [b] "r" (b)
92 );
93 return r;
94}
95
96#endif
diff --git a/apps/plugins/fractals/fractal.h b/apps/plugins/fractals/fractal.h
index c7a822c2c6..92a0b87c48 100644
--- a/apps/plugins/fractals/fractal.h
+++ b/apps/plugins/fractals/fractal.h
@@ -22,33 +22,7 @@
22#define _FRACTAL_H 22#define _FRACTAL_H
23 23
24/* variable button definitions */ 24/* variable button definitions */
25#if CONFIG_KEYPAD == RECORDER_PAD 25#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
26#define FRACTAL_QUIT BUTTON_OFF
27#define FRACTAL_UP BUTTON_UP
28#define FRACTAL_DOWN BUTTON_DOWN
29#define FRACTAL_LEFT BUTTON_LEFT
30#define FRACTAL_RIGHT BUTTON_RIGHT
31#define FRACTAL_ZOOM_IN BUTTON_PLAY
32#define FRACTAL_ZOOM_OUT BUTTON_ON
33#define FRACTAL_PRECISION_INC BUTTON_F2
34#define FRACTAL_PRECISION_DEC BUTTON_F1
35#define FRACTAL_RESET BUTTON_F3
36
37#elif CONFIG_KEYPAD == ONDIO_PAD
38#define FRACTAL_QUIT BUTTON_OFF
39#define FRACTAL_UP BUTTON_UP
40#define FRACTAL_DOWN BUTTON_DOWN
41#define FRACTAL_LEFT BUTTON_LEFT
42#define FRACTAL_RIGHT BUTTON_RIGHT
43#define FRACTAL_ZOOM_IN_PRE BUTTON_MENU
44#define FRACTAL_ZOOM_IN (BUTTON_MENU | BUTTON_REL)
45#define FRACTAL_ZOOM_IN2 (BUTTON_MENU | BUTTON_UP)
46#define FRACTAL_ZOOM_OUT (BUTTON_MENU | BUTTON_DOWN)
47#define FRACTAL_PRECISION_INC (BUTTON_MENU | BUTTON_RIGHT)
48#define FRACTAL_PRECISION_DEC (BUTTON_MENU | BUTTON_LEFT)
49#define FRACTAL_RESET (BUTTON_MENU | BUTTON_OFF)
50
51#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
52 (CONFIG_KEYPAD == IRIVER_H300_PAD) 26 (CONFIG_KEYPAD == IRIVER_H300_PAD)
53#define FRACTAL_QUIT BUTTON_OFF 27#define FRACTAL_QUIT BUTTON_OFF
54#define FRACTAL_UP BUTTON_UP 28#define FRACTAL_UP BUTTON_UP
diff --git a/apps/plugins/fractals/mandelbrot_set.h b/apps/plugins/fractals/mandelbrot_set.h
index 4eeb68461b..2814d24e58 100644
--- a/apps/plugins/fractals/mandelbrot_set.h
+++ b/apps/plugins/fractals/mandelbrot_set.h
@@ -24,18 +24,13 @@
24#include "fractal_sets.h" 24#include "fractal_sets.h"
25 25
26/* CPU stuff */ 26/* CPU stuff */
27#if CONFIG_CPU == SH7034 27#if defined CPU_COLDFIRE
28#include "cpu_sh7043.h"
29#elif defined CPU_COLDFIRE
30#include "cpu_coldfire.h" 28#include "cpu_coldfire.h"
31#elif defined CPU_ARM 29#elif defined CPU_ARM
32#include "cpu_arm.h" 30#include "cpu_arm.h"
33#endif 31#endif
34 32
35#if CONFIG_CPU == SH7034 33#if defined CPU_COLDFIRE
36#define MULS16_ASR10(a, b) muls16_asr10(a, b)
37#define MULS32_ASR26(a, b) muls32_asr26(a, b)
38#elif defined CPU_COLDFIRE
39/* Needs the EMAC initialised to fractional mode w/o rounding and saturation */ 34/* Needs the EMAC initialised to fractional mode w/o rounding and saturation */
40#define MULS32_INIT() coldfire_set_macsr(EMAC_FRACTIONAL) 35#define MULS32_INIT() coldfire_set_macsr(EMAC_FRACTIONAL)
41#define MULS16_ASR10(a, b) muls16_asr10(a, b) 36#define MULS16_ASR10(a, b) muls16_asr10(a, b)
diff --git a/apps/plugins/goban/goban.h b/apps/plugins/goban/goban.h
index e04b4c2447..8406b540b7 100644
--- a/apps/plugins/goban/goban.h
+++ b/apps/plugins/goban/goban.h
@@ -297,27 +297,6 @@
297#define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT 297#define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT
298/* no next var */ 298/* no next var */
299 299
300#elif (CONFIG_KEYPAD == RECORDER_PAD)
301#define GBN_BUTTON_UP BUTTON_UP
302#define GBN_BUTTON_DOWN BUTTON_DOWN
303#define GBN_BUTTON_LEFT BUTTON_LEFT
304#define GBN_BUTTON_RIGHT BUTTON_RIGHT
305#define GBN_BUTTON_RETREAT BUTTON_F1
306#define GBN_BUTTON_ADVANCE BUTTON_F3
307#define GBN_BUTTON_MENU BUTTON_F2
308#define GBN_BUTTON_PLAY BUTTON_PLAY | BUTTON_REL
309#define GBN_BUTTON_CONTEXT BUTTON_PLAY | BUTTON_REPEAT
310#define GBN_BUTTON_NEXT_VAR BUTTON_ON
311
312#elif (CONFIG_KEYPAD == ONDIO_PAD)
313#define GBN_BUTTON_UP BUTTON_UP
314#define GBN_BUTTON_DOWN BUTTON_DOWN
315#define GBN_BUTTON_LEFT BUTTON_LEFT
316#define GBN_BUTTON_RIGHT BUTTON_RIGHT
317#define GBN_BUTTON_MENU BUTTON_MENU | BUTTON_REPEAT
318#define GBN_BUTTON_PLAY BUTTON_MENU | BUTTON_REL
319#define GBN_BUTTON_NAV_MODE BUTTON_OFF
320
321#elif (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD) 300#elif (CONFIG_KEYPAD == SAMSUNG_YH92X_PAD)
322#define GBN_BUTTON_UP BUTTON_UP 301#define GBN_BUTTON_UP BUTTON_UP
323#define GBN_BUTTON_DOWN BUTTON_DOWN 302#define GBN_BUTTON_DOWN BUTTON_DOWN
diff --git a/apps/plugins/goban/goban.make b/apps/plugins/goban/goban.make
index a8b41285f0..2201dc60f4 100644
--- a/apps/plugins/goban/goban.make
+++ b/apps/plugins/goban/goban.make
@@ -16,15 +16,8 @@ GOBAN_OBJ := $(call c2obj, $(GOBAN_SRC))
16OTHER_SRC += $(GOBAN_SRC) 16OTHER_SRC += $(GOBAN_SRC)
17 17
18ifndef APP_TYPE 18ifndef APP_TYPE
19ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET))))) 19 ### all targets
20 ### lowmem targets
21 ROCKS += $(GOBAN_BUILDDIR)/goban.ovl
22 GOBAN_OUTLDS = $(GOBAN_BUILDDIR)/goban.link
23 GOBAN_OVLFLAGS = -T$(GOBAN_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
24else
25 ### all other targets
26 ROCKS += $(GOBAN_BUILDDIR)/goban.rock 20 ROCKS += $(GOBAN_BUILDDIR)/goban.rock
27endif
28else 21else
29 ### simulator 22 ### simulator
30 ROCKS += $(GOBAN_BUILDDIR)/goban.rock 23 ROCKS += $(GOBAN_BUILDDIR)/goban.rock
diff --git a/apps/plugins/greyscale.c b/apps/plugins/greyscale.c
index ae873a06ac..70507d989c 100644
--- a/apps/plugins/greyscale.c
+++ b/apps/plugins/greyscale.c
@@ -30,23 +30,7 @@
30 30
31 31
32/* variable button definitions */ 32/* variable button definitions */
33#if CONFIG_KEYPAD == RECORDER_PAD 33#if CONFIG_KEYPAD == IRIVER_H100_PAD
34#define GREYSCALE_SHIFT BUTTON_ON
35#define GREYSCALE_UP BUTTON_UP
36#define GREYSCALE_DOWN BUTTON_DOWN
37#define GREYSCALE_LEFT BUTTON_LEFT
38#define GREYSCALE_RIGHT BUTTON_RIGHT
39#define GREYSCALE_OFF BUTTON_OFF
40
41#elif CONFIG_KEYPAD == ONDIO_PAD
42#define GREYSCALE_SHIFT BUTTON_MENU
43#define GREYSCALE_UP BUTTON_UP
44#define GREYSCALE_DOWN BUTTON_DOWN
45#define GREYSCALE_LEFT BUTTON_LEFT
46#define GREYSCALE_RIGHT BUTTON_RIGHT
47#define GREYSCALE_OFF BUTTON_OFF
48
49#elif CONFIG_KEYPAD == IRIVER_H100_PAD
50#define GREYSCALE_SHIFT BUTTON_ON 34#define GREYSCALE_SHIFT BUTTON_ON
51#define GREYSCALE_UP BUTTON_UP 35#define GREYSCALE_UP BUTTON_UP
52#define GREYSCALE_DOWN BUTTON_DOWN 36#define GREYSCALE_DOWN BUTTON_DOWN
diff --git a/apps/plugins/imageviewer/imageviewer_button.h b/apps/plugins/imageviewer/imageviewer_button.h
index dfdd39ffa4..46813d5e69 100644
--- a/apps/plugins/imageviewer/imageviewer_button.h
+++ b/apps/plugins/imageviewer/imageviewer_button.h
@@ -25,31 +25,8 @@
25#include "plugin.h" 25#include "plugin.h"
26 26
27/* variable button definitions */ 27/* variable button definitions */
28#if CONFIG_KEYPAD == RECORDER_PAD 28#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
29#define IMGVIEW_ZOOM_IN BUTTON_PLAY 29 (CONFIG_KEYPAD == IRIVER_H300_PAD)
30#define IMGVIEW_ZOOM_OUT BUTTON_ON
31#define IMGVIEW_UP BUTTON_UP
32#define IMGVIEW_DOWN BUTTON_DOWN
33#define IMGVIEW_LEFT BUTTON_LEFT
34#define IMGVIEW_RIGHT BUTTON_RIGHT
35#define IMGVIEW_NEXT BUTTON_F3
36#define IMGVIEW_PREVIOUS BUTTON_F2
37#define IMGVIEW_MENU BUTTON_OFF
38
39#elif CONFIG_KEYPAD == ONDIO_PAD
40#define IMGVIEW_ZOOM_PRE BUTTON_MENU
41#define IMGVIEW_ZOOM_IN (BUTTON_MENU | BUTTON_REL)
42#define IMGVIEW_ZOOM_OUT (BUTTON_MENU | BUTTON_DOWN)
43#define IMGVIEW_UP BUTTON_UP
44#define IMGVIEW_DOWN BUTTON_DOWN
45#define IMGVIEW_LEFT BUTTON_LEFT
46#define IMGVIEW_RIGHT BUTTON_RIGHT
47#define IMGVIEW_NEXT (BUTTON_MENU | BUTTON_RIGHT)
48#define IMGVIEW_PREVIOUS (BUTTON_MENU | BUTTON_LEFT)
49#define IMGVIEW_MENU BUTTON_OFF
50
51#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
52 (CONFIG_KEYPAD == IRIVER_H300_PAD)
53#define IMGVIEW_ZOOM_IN BUTTON_SELECT 30#define IMGVIEW_ZOOM_IN BUTTON_SELECT
54#define IMGVIEW_ZOOM_OUT BUTTON_MODE 31#define IMGVIEW_ZOOM_OUT BUTTON_MODE
55#define IMGVIEW_UP BUTTON_UP 32#define IMGVIEW_UP BUTTON_UP
diff --git a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
index 342b59c6a4..b014fa0ed1 100644
--- a/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
+++ b/apps/plugins/imageviewer/jpeg/jpeg_decoder.c
@@ -39,23 +39,7 @@
39 39
40INLINE unsigned range_limit(int value) 40INLINE unsigned range_limit(int value)
41{ 41{
42#if CONFIG_CPU == SH7034 42#if defined(CPU_COLDFIRE)
43 unsigned tmp;
44 asm ( /* Note: Uses knowledge that only low byte of result is used */
45 "mov #-128,%[t] \n"
46 "sub %[t],%[v] \n" /* value -= -128; equals value += 128; */
47 "extu.b %[v],%[t] \n"
48 "cmp/eq %[v],%[t] \n" /* low byte == whole number ? */
49 "bt 1f \n" /* yes: no overflow */
50 "cmp/pz %[v] \n" /* overflow: positive? */
51 "subc %[v],%[v] \n" /* %[r] now either 0 or 0xffffffff */
52 "1: \n"
53 : /* outputs */
54 [v]"+r"(value),
55 [t]"=&r"(tmp)
56 );
57 return value;
58#elif defined(CPU_COLDFIRE)
59 asm ( /* Note: Uses knowledge that only the low byte of the result is used */ 43 asm ( /* Note: Uses knowledge that only the low byte of the result is used */
60 "add.l #128,%[v] \n" /* value += 128; */ 44 "add.l #128,%[v] \n" /* value += 128; */
61 "cmp.l #255,%[v] \n" /* overflow? */ 45 "cmp.l #255,%[v] \n" /* overflow? */
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index cae3befb5e..f94825650f 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -28,27 +28,7 @@
28#include "pluginbitmaps/jewels.h" 28#include "pluginbitmaps/jewels.h"
29 29
30/* button definitions */ 30/* button definitions */
31#if CONFIG_KEYPAD == RECORDER_PAD 31#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
32#define JEWELS_UP BUTTON_UP
33#define JEWELS_DOWN BUTTON_DOWN
34#define JEWELS_LEFT BUTTON_LEFT
35#define JEWELS_RIGHT BUTTON_RIGHT
36#define JEWELS_SELECT BUTTON_PLAY
37#define JEWELS_CANCEL BUTTON_OFF
38#define HK_SELECT "PLAY"
39#define HK_CANCEL "OFF"
40
41#elif CONFIG_KEYPAD == ONDIO_PAD
42#define JEWELS_UP BUTTON_UP
43#define JEWELS_DOWN BUTTON_DOWN
44#define JEWELS_LEFT BUTTON_LEFT
45#define JEWELS_RIGHT BUTTON_RIGHT
46#define JEWELS_SELECT BUTTON_MENU
47#define JEWELS_CANCEL BUTTON_OFF
48#define HK_SELECT "MENU"
49#define HK_CANCEL "OFF"
50
51#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
52#define JEWELS_UP BUTTON_UP 32#define JEWELS_UP BUTTON_UP
53#define JEWELS_DOWN BUTTON_DOWN 33#define JEWELS_DOWN BUTTON_DOWN
54#define JEWELS_LEFT BUTTON_LEFT 34#define JEWELS_LEFT BUTTON_LEFT
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES
index 1149f35bac..82b9fba4a5 100644
--- a/apps/plugins/lib/SOURCES
+++ b/apps/plugins/lib/SOURCES
@@ -21,8 +21,6 @@ grey_scroll.c
21 21
22#ifdef CPU_COLDFIRE 22#ifdef CPU_COLDFIRE
23grey_coldfire.S 23grey_coldfire.S
24#elif CONFIG_CPU == SH7034
25grey_sh.S
26#endif 24#endif
27 25
28#endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */ 26#endif /* HAVE_LCD_BITMAP && LCD_DEPTH < 4 */
diff --git a/apps/plugins/lib/grey_core.c b/apps/plugins/lib/grey_core.c
index bb6823522d..55d0684103 100644
--- a/apps/plugins/lib/grey_core.c
+++ b/apps/plugins/lib/grey_core.c
@@ -36,35 +36,7 @@
36 36
37#ifndef SIMULATOR 37#ifndef SIMULATOR
38 38
39#if defined ARCHOS_RECORDER /* verified */ \ 39#if defined IAUDIO_M3 /* verified */
40 || defined ARCHOS_FMRECORDER /* should be identical */ \
41 || defined ARCHOS_RECORDERV2 /* should be identical */ \
42 || defined ARCHOS_ONDIOFM /* verified */ \
43 || defined ARCHOS_ONDIOSP /* verified */
44/* Average measurements of a Recorder v1, an Ondio FM, a backlight-modded
45 * Ondio FM, and an Ondio SP. */
46static const unsigned char lcdlinear[256] = {
47 5, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 29, 31, 33, 35,
48 37, 39, 40, 42, 43, 45, 46, 48, 49, 50, 51, 53, 54, 55, 57, 58,
49 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, 71, 72,
50 73, 74, 74, 75, 76, 77, 77, 78, 79, 79, 80, 80, 81, 81, 82, 82,
51 83, 84, 84, 85, 86, 86, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91,
52 92, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 98, 98, 99, 100, 100,
53101, 101, 102, 103, 103, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109,
54110, 110, 111, 112, 112, 113, 114, 114, 115, 115, 116, 117, 117, 118, 119, 119,
55120, 120, 121, 122, 123, 123, 124, 125, 126, 126, 127, 128, 129, 129, 130, 131,
56132, 132, 133, 134, 135, 135, 136, 137, 138, 138, 139, 140, 140, 141, 141, 142,
57143, 144, 145, 146, 147, 147, 148, 149, 150, 151, 152, 153, 154, 154, 155, 156,
58157, 158, 159, 160, 161, 161, 162, 163, 164, 165, 166, 167, 168, 168, 169, 170,
59171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 184, 185, 186, 187,
60188, 189, 191, 192, 194, 195, 197, 198, 199, 200, 202, 203, 204, 205, 207, 208,
61209, 210, 212, 213, 215, 216, 218, 219, 220, 221, 222, 223, 225, 226, 227, 228,
62229, 230, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 246, 247, 248
63};
64/* The actual LCD scanrate varies a lot with temperature on these targets */
65#define LCD_SCANRATE 67 /* Hz */
66
67#elif defined IAUDIO_M3 /* verified */
68/* Average measurements of 2 iAudio remotes connected to an M3. */ 40/* Average measurements of 2 iAudio remotes connected to an M3. */
69static const unsigned char lcdlinear[256] = { 41static const unsigned char lcdlinear[256] = {
70 5, 9, 13, 17, 21, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66, 42 5, 9, 13, 17, 21, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 66,
diff --git a/apps/plugins/lib/grey_draw.c b/apps/plugins/lib/grey_draw.c
index 64dabc2fb3..298ffbe16e 100644
--- a/apps/plugins/lib/grey_draw.c
+++ b/apps/plugins/lib/grey_draw.c
@@ -758,8 +758,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
758 + (~yc & _GREY_BMASK); 758 + (~yc & _GREY_BMASK);
759#endif /* LCD_PIXELFORMAT */ 759#endif /* LCD_PIXELFORMAT */
760 760
761#if ((LCD_PIXELFORMAT == VERTICAL_PACKING) && (LCD_DEPTH == 1) && (CONFIG_CPU == SH7034)) \ 761#if ((LCD_PIXELFORMAT == VERTICAL_PACKING) && (LCD_DEPTH == 2) && defined(CPU_COLDFIRE)) \
762 || ((LCD_PIXELFORMAT == VERTICAL_PACKING) && (LCD_DEPTH == 2) && defined(CPU_COLDFIRE)) \
763 || ((LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) && defined(CPU_COLDFIRE)) 762 || ((LCD_PIXELFORMAT == VERTICAL_INTERLEAVED) && defined(CPU_COLDFIRE))
764 _grey_line1(width, dst + idx, src, _grey_info.gvalue); 763 _grey_line1(width, dst + idx, src, _grey_info.gvalue);
765#else 764#else
diff --git a/apps/plugins/lib/grey_sh.S b/apps/plugins/lib/grey_sh.S
deleted file mode 100644
index 5714f95f8c..0000000000
--- a/apps/plugins/lib/grey_sh.S
+++ /dev/null
@@ -1,137 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* New greyscale framework
11* SH1 assembler routines
12*
13* This is a generic framework to display 129 shades of grey on low-depth
14* bitmap LCDs (Archos b&w, Iriver & Ipod 4-grey) within plugins.
15*
16* Copyright (C) 2008 Jens Arnold
17*
18* This program is free software; you can redistribute it and/or
19* modify it under the terms of the GNU General Public License
20* as published by the Free Software Foundation; either version 2
21* of the License, or (at your option) any later version.
22*
23* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
24* KIND, either express or implied.
25*
26****************************************************************************/
27
28#include "config.h"
29/* Plugins should not normally do this, but we need to check a macro, and
30 * plugin.h would confuse the assembler. */
31
32 .text
33 .global __grey_line1
34 .type __grey_line1, @function
35
36#if (LCD_PIXELFORMAT == VERTICAL_PACKING) && (LCD_DEPTH == 1)
37
38/****************************************************************************
39 * void _grey_line1(int width, r4
40 * unsigned char *dst, r5
41 * const unsigned char *src, r6
42 * const unsigned char *lut); r7
43 */
44
45__grey_line1:
46 mov #1, r0
47 tst r0, r6
48 bt .p1_h_end
49
50 mov.b @r6+, r0
51 extu.b r0, r0
52 mov.b @(r0, r7), r0
53 add #-1, r4
54 mov.b r0, @r5
55 add #8, r5
56.p1_h_end:
57
58 mov #2, r0
59 cmp/hs r0, r4
60 bf .p2_t_end
61 tst r0, r6
62 bt .p2_h_end
63
64 mov.w @r6+, r1
65 extu.b r1, r0
66 mov.b @(r0, r7), r0
67 shlr8 r1
68 mov.b r0, @(8, r5)
69 extu.b r1, r0
70 mov.b @(r0, r7), r0
71 add #-2, r4
72 mov.b r0, @r5
73 add #16, r5
74.p2_h_end:
75
76 add #-4, r4
77 cmp/pz r4
78 bf .p4_end
79
80 add r6, r4
81
82.p4_loop:
83 mov.l @r6+, r1
84 swap.w r1, r2
85 extu.b r2, r0
86 mov.b @(r0, r7), r0
87 shlr8 r2
88 mov.b r0, @(8, r5)
89 extu.b r2, r0
90 mov.b @(r0, r7), r2
91 extu.b r1, r0
92 mov.b r2, @r5
93 add #16, r5
94 mov.b @(r0, r7), r0
95 shlr8 r1
96 mov.b r0, @(8, r5)
97 extu.b r1, r0
98 mov.b @(r0, r7), r0
99 cmp/hs r6, r4
100 mov.b r0, @r5
101 add #16, r5
102 bt .p4_loop
103
104 /* No need to correct the count, we're only testing bits from now on. */
105
106.p4_end:
107 mov #2, r0
108 tst r0, r4
109 bt .p2_t_end
110
111 mov.w @r6+, r1
112 extu.b r1, r0
113 mov.b @(r0, r7), r0
114 shlr8 r1
115 mov.b r0, @(8, r5)
116 extu.b r1, r0
117 mov.b @(r0, r7), r0
118 mov.b r0, @r5
119 add #16, r5
120.p2_t_end:
121
122 mov #1, r0
123 tst r0, r4
124 bt .p1_t_end
125
126 mov.b @r6+, r0
127 extu.b r0, r0
128 mov.b @(r0, r7), r0
129 rts
130 mov.b r0, @r5
131.p1_t_end:
132
133 rts
134 nop
135 .size __grey_line1, . - __grey_line1
136
137#endif
diff --git a/apps/plugins/lib/helper.c b/apps/plugins/lib/helper.c
index 506903e808..6eb3498791 100644
--- a/apps/plugins/lib/helper.c
+++ b/apps/plugins/lib/helper.c
@@ -22,20 +22,6 @@
22#include "plugin.h" 22#include "plugin.h"
23#include "helper.h" 23#include "helper.h"
24 24
25#ifdef CPU_SH
26/* Lookup table for using the BIT_N() macro in plugins */
27const unsigned bit_n_table[32] = {
28 1LU<< 0, 1LU<< 1, 1LU<< 2, 1LU<< 3,
29 1LU<< 4, 1LU<< 5, 1LU<< 6, 1LU<< 7,
30 1LU<< 8, 1LU<< 9, 1LU<<10, 1LU<<11,
31 1LU<<12, 1LU<<13, 1LU<<14, 1LU<<15,
32 1LU<<16, 1LU<<17, 1LU<<18, 1LU<<19,
33 1LU<<20, 1LU<<21, 1LU<<22, 1LU<<23,
34 1LU<<24, 1LU<<25, 1LU<<26, 1LU<<27,
35 1LU<<28, 1LU<<29, 1LU<<30, 1LU<<31
36};
37#endif
38
39/* Force the backlight on */ 25/* Force the backlight on */
40void backlight_force_on(void) 26void backlight_force_on(void)
41{ 27{
diff --git a/apps/plugins/lib/pluginlib_actions.c b/apps/plugins/lib/pluginlib_actions.c
index e5b48c2f6a..c580074d5e 100644
--- a/apps/plugins/lib/pluginlib_actions.c
+++ b/apps/plugins/lib/pluginlib_actions.c
@@ -51,16 +51,6 @@ const struct button_mapping pla_remote_ctx[] =
51 { PLA_DOWN_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE}, 51 { PLA_DOWN_REPEAT, BUTTON_RC_REW|BUTTON_REPEAT, BUTTON_NONE},
52 { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE}, 52 { PLA_LEFT_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
53 { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE}, 53 { PLA_RIGHT_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
54#elif (CONFIG_KEYPAD == PLAYER_PAD) || \
55 (CONFIG_KEYPAD == RECORDER_PAD)
56 { PLA_UP, BUTTON_RC_VOL_UP, BUTTON_NONE},
57 { PLA_DOWN, BUTTON_RC_VOL_DOWN, BUTTON_NONE},
58 { PLA_LEFT, BUTTON_RC_LEFT, BUTTON_NONE},
59 { PLA_RIGHT, BUTTON_RC_RIGHT, BUTTON_NONE},
60 { PLA_UP_REPEAT, BUTTON_RC_VOL_UP|BUTTON_REPEAT, BUTTON_NONE},
61 { PLA_DOWN_REPEAT, BUTTON_RC_VOL_DOWN|BUTTON_REPEAT, BUTTON_NONE},
62 { PLA_LEFT_REPEAT, BUTTON_RC_LEFT|BUTTON_REPEAT, BUTTON_NONE},
63 { PLA_RIGHT_REPEAT, BUTTON_RC_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
64#elif (CONFIG_REMOTE_KEYPAD == MROBE_REMOTE) 54#elif (CONFIG_REMOTE_KEYPAD == MROBE_REMOTE)
65 { PLA_UP, BUTTON_RC_PLAY, BUTTON_NONE}, 55 { PLA_UP, BUTTON_RC_PLAY, BUTTON_NONE},
66 { PLA_DOWN, BUTTON_RC_DOWN, BUTTON_NONE}, 56 { PLA_DOWN, BUTTON_RC_DOWN, BUTTON_NONE},
@@ -101,9 +91,7 @@ const struct button_mapping pla_main_ctx[] =
101 || (CONFIG_KEYPAD == IRIVER_H300_PAD) \ 91 || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
102 || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \ 92 || (CONFIG_KEYPAD == IAUDIO_X5M5_PAD) \
103 || (CONFIG_KEYPAD == GIGABEAT_PAD) \ 93 || (CONFIG_KEYPAD == GIGABEAT_PAD) \
104 || (CONFIG_KEYPAD == RECORDER_PAD) \
105 || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \ 94 || (CONFIG_KEYPAD == IRIVER_IFP7XX_PAD) \
106 || (CONFIG_KEYPAD == ONDIO_PAD) \
107 || (CONFIG_KEYPAD == SANSA_C200_PAD) \ 95 || (CONFIG_KEYPAD == SANSA_C200_PAD) \
108 || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \ 96 || (CONFIG_KEYPAD == GIGABEAT_S_PAD) \
109 || (CONFIG_KEYPAD == MROBE100_PAD) \ 97 || (CONFIG_KEYPAD == MROBE100_PAD) \
@@ -145,15 +133,6 @@ const struct button_mapping pla_main_ctx[] =
145 { PLA_DOWN_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE }, 133 { PLA_DOWN_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
146 { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE }, 134 { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
147 { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE }, 135 { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
148#elif (CONFIG_KEYPAD == PLAYER_PAD)
149 { PLA_UP, BUTTON_PLAY, BUTTON_NONE },
150 { PLA_DOWN, BUTTON_STOP, BUTTON_NONE },
151 { PLA_LEFT, BUTTON_LEFT, BUTTON_NONE },
152 { PLA_RIGHT, BUTTON_RIGHT, BUTTON_NONE },
153 { PLA_UP_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE },
154 { PLA_DOWN_REPEAT, BUTTON_STOP|BUTTON_REPEAT, BUTTON_NONE },
155 { PLA_LEFT_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE },
156 { PLA_RIGHT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE },
157#elif (CONFIG_KEYPAD == IRIVER_H10_PAD) 136#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
158 { PLA_UP, BUTTON_SCROLL_UP, BUTTON_NONE }, 137 { PLA_UP, BUTTON_SCROLL_UP, BUTTON_NONE },
159 { PLA_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE }, 138 { PLA_DOWN, BUTTON_SCROLL_DOWN, BUTTON_NONE },
@@ -339,24 +318,6 @@ const struct button_mapping pla_main_ctx[] =
339 {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE}, 318 {PLA_SELECT, BUTTON_SELECT, BUTTON_NONE},
340 {PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT}, 319 {PLA_SELECT_REL, BUTTON_SELECT|BUTTON_REL, BUTTON_SELECT},
341 {PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE}, 320 {PLA_SELECT_REPEAT, BUTTON_SELECT|BUTTON_REPEAT, BUTTON_NONE},
342#elif (CONFIG_KEYPAD == RECORDER_PAD)
343 {PLA_CANCEL, BUTTON_ON, BUTTON_NONE},
344 {PLA_EXIT, BUTTON_OFF, BUTTON_NONE},
345 {PLA_SELECT, BUTTON_PLAY, BUTTON_NONE},
346 {PLA_SELECT_REL, BUTTON_PLAY|BUTTON_REL, BUTTON_PLAY},
347 {PLA_SELECT_REPEAT, BUTTON_PLAY|BUTTON_REPEAT, BUTTON_NONE},
348#elif (CONFIG_KEYPAD == ONDIO_PAD)
349 {PLA_CANCEL, BUTTON_OFF|BUTTON_REL, BUTTON_OFF},
350 {PLA_EXIT, BUTTON_OFF|BUTTON_REPEAT, BUTTON_NONE},
351 {PLA_SELECT, BUTTON_MENU, BUTTON_NONE},
352 {PLA_SELECT_REL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU},
353 {PLA_SELECT_REPEAT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE},
354#elif (CONFIG_KEYPAD == PLAYER_PAD)
355 {PLA_CANCEL, BUTTON_MENU|BUTTON_REL, BUTTON_MENU},
356 {PLA_EXIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_NONE},
357 {PLA_SELECT, BUTTON_ON, BUTTON_NONE},
358 {PLA_SELECT_REL, BUTTON_ON|BUTTON_REL, BUTTON_ON},
359 {PLA_SELECT_REPEAT, BUTTON_ON|BUTTON_REPEAT, BUTTON_NONE},
360#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD) 321#elif (CONFIG_KEYPAD == SANSA_FUZE_PAD)
361 {PLA_CANCEL, BUTTON_HOME|BUTTON_REL, BUTTON_HOME}, 322 {PLA_CANCEL, BUTTON_HOME|BUTTON_REL, BUTTON_HOME},
362 {PLA_EXIT, BUTTON_HOME|BUTTON_REPEAT, BUTTON_NONE}, 323 {PLA_EXIT, BUTTON_HOME|BUTTON_REPEAT, BUTTON_NONE},
diff --git a/apps/plugins/lib/xlcd_scroll.c b/apps/plugins/lib/xlcd_scroll.c
index f2fc71ea47..e0fead71be 100644
--- a/apps/plugins/lib/xlcd_scroll.c
+++ b/apps/plugins/lib/xlcd_scroll.c
@@ -396,77 +396,7 @@ void xlcd_scroll_up(int count)
396 { 396 {
397#if LCD_PIXELFORMAT == VERTICAL_PACKING 397#if LCD_PIXELFORMAT == VERTICAL_PACKING
398 398
399#if (CONFIG_CPU == SH7034) && (LCD_DEPTH == 1) 399#if defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
400 asm (
401 "mov #0,r4 \n" /* x = 0 */
402 "mova .su_shifttbl,r0 \n" /* calculate jump destination for */
403 "mov.b @(r0,%[cnt]),%[cnt] \n" /* shift amount from table */
404 "bra .su_cloop \n" /* skip table */
405 "add r0,%[cnt] \n"
406
407 ".align 2 \n"
408 ".su_shifttbl: \n" /* shift jump offset table */
409 ".byte .su_shift0 - .su_shifttbl \n"
410 ".byte .su_shift1 - .su_shifttbl \n"
411 ".byte .su_shift2 - .su_shifttbl \n"
412 ".byte .su_shift3 - .su_shifttbl \n"
413 ".byte .su_shift4 - .su_shifttbl \n"
414 ".byte .su_shift5 - .su_shifttbl \n"
415 ".byte .su_shift6 - .su_shifttbl \n"
416 ".byte .su_shift7 - .su_shifttbl \n"
417
418 ".su_cloop: \n" /* repeat for every column */
419 "mov %[addr],r2 \n" /* get start address */
420 "mov #0,r3 \n" /* current_row = 0 */
421 "mov #0,r1 \n" /* fill with zero */
422
423 ".su_iloop: \n" /* repeat for all rows */
424 "sub %[wide],r2 \n" /* address -= width */
425 "mov.b @r2,r0 \n" /* get data byte */
426 "shll8 r1 \n" /* old data to 2nd byte */
427 "extu.b r0,r0 \n" /* extend unsigned */
428 "or r1,r0 \n" /* combine old data */
429 "jmp @%[cnt] \n" /* jump into shift "path" */
430 "extu.b r0,r1 \n" /* store data for next round */
431
432 ".su_shift6: \n" /* shift right by 0..7 bits */
433 "shll2 r0 \n"
434 "bra .su_shift0 \n"
435 "shlr8 r0 \n"
436 ".su_shift4: \n"
437 "shlr2 r0 \n"
438 ".su_shift2: \n"
439 "bra .su_shift0 \n"
440 "shlr2 r0 \n"
441 ".su_shift7: \n"
442 "shlr2 r0 \n"
443 ".su_shift5: \n"
444 "shlr2 r0 \n"
445 ".su_shift3: \n"
446 "shlr2 r0 \n"
447 ".su_shift1: \n"
448 "shlr r0 \n"
449 ".su_shift0: \n"
450
451 "mov.b r0,@r2 \n" /* store data */
452 "add #1,r3 \n" /* current_row++ */
453 "cmp/hi r3,%[rows] \n" /* current_row < bheight - shift ? */
454 "bt .su_iloop \n"
455
456 "add #1,%[addr] \n" /* start_address++ */
457 "add #1,r4 \n" /* x++ */
458 "cmp/hi r4,%[wide] \n" /* x < width ? */
459 "bt .su_cloop \n"
460 : /* outputs */
461 : /* inputs */
462 [addr]"r"(rb->lcd_framebuffer + blocklen * LCD_FBWIDTH),
463 [wide]"r"(LCD_FBWIDTH),
464 [rows]"r"(blocklen),
465 [cnt] "r"(bitcount)
466 : /* clobbers */
467 "r0", "r1", "r2", "r3", "r4"
468 );
469#elif defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
470 asm ( 400 asm (
471 "move.l %[wide],%%d3\n" /* columns = width */ 401 "move.l %[wide],%%d3\n" /* columns = width */
472 402
@@ -590,76 +520,7 @@ void xlcd_scroll_down(int count)
590 { 520 {
591#if LCD_PIXELFORMAT == VERTICAL_PACKING 521#if LCD_PIXELFORMAT == VERTICAL_PACKING
592 522
593#if (CONFIG_CPU == SH7034) && (LCD_DEPTH == 1) 523#if defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
594 asm (
595 "mov #0,r4 \n" /* x = 0 */
596 "mova .sd_shifttbl,r0 \n" /* calculate jump destination for */
597 "mov.b @(r0,%[cnt]),%[cnt] \n" /* shift amount from table */
598 "bra .sd_cloop \n" /* skip table */
599 "add r0,%[cnt] \n"
600
601 ".align 2 \n"
602 ".sd_shifttbl: \n" /* shift jump offset table */
603 ".byte .sd_shift0 - .sd_shifttbl \n"
604 ".byte .sd_shift1 - .sd_shifttbl \n"
605 ".byte .sd_shift2 - .sd_shifttbl \n"
606 ".byte .sd_shift3 - .sd_shifttbl \n"
607 ".byte .sd_shift4 - .sd_shifttbl \n"
608 ".byte .sd_shift5 - .sd_shifttbl \n"
609 ".byte .sd_shift6 - .sd_shifttbl \n"
610 ".byte .sd_shift7 - .sd_shifttbl \n"
611
612 ".sd_cloop: \n" /* repeat for every column */
613 "mov %[addr],r2 \n" /* get start address */
614 "mov #0,r3 \n" /* current_row = 0 */
615 "mov #0,r1 \n" /* fill with zero */
616
617 ".sd_iloop: \n" /* repeat for all rows */
618 "shlr8 r1 \n" /* shift right to get residue */
619 "mov.b @r2,r0 \n" /* get data byte */
620 "jmp @%[cnt] \n" /* jump into shift "path" */
621 "extu.b r0,r0 \n" /* extend unsigned */
622
623 ".sd_shift6: \n" /* shift left by 0..7 bits */
624 "shll8 r0 \n"
625 "bra .sd_shift0 \n"
626 "shlr2 r0 \n"
627 ".sd_shift4: \n"
628 "shll2 r0 \n"
629 ".sd_shift2: \n"
630 "bra .sd_shift0 \n"
631 "shll2 r0 \n"
632 ".sd_shift7: \n"
633 "shll2 r0 \n"
634 ".sd_shift5: \n"
635 "shll2 r0 \n"
636 ".sd_shift3: \n"
637 "shll2 r0 \n"
638 ".sd_shift1: \n"
639 "shll r0 \n"
640 ".sd_shift0: \n"
641
642 "or r0,r1 \n" /* combine with last residue */
643 "mov.b r1,@r2 \n" /* store data */
644 "add %[wide],r2 \n" /* address += width */
645 "add #1,r3 \n" /* current_row++ */
646 "cmp/hi r3,%[rows] \n" /* current_row < bheight - shift ? */
647 "bt .sd_iloop \n"
648
649 "add #1,%[addr] \n" /* start_address++ */
650 "add #1,r4 \n" /* x++ */
651 "cmp/hi r4,%[wide] \n" /* x < width ? */
652 "bt .sd_cloop \n"
653 : /* outputs */
654 : /* inputs */
655 [addr]"r"(rb->lcd_framebuffer + blockcount * LCD_FBWIDTH),
656 [wide]"r"(LCD_WIDTH),
657 [rows]"r"(blocklen),
658 [cnt] "r"(bitcount)
659 : /* clobbers */
660 "r0", "r1", "r2", "r3", "r4"
661 );
662#elif defined(CPU_COLDFIRE) && (LCD_DEPTH == 2)
663 asm ( 524 asm (
664 "move.l %[wide],%%d3\n" /* columns = width */ 525 "move.l %[wide],%%d3\n" /* columns = width */
665 526
diff --git a/apps/plugins/lrcplayer.c b/apps/plugins/lrcplayer.c
index 4ae9722ae3..eb441eab8d 100644
--- a/apps/plugins/lrcplayer.c
+++ b/apps/plugins/lrcplayer.c
@@ -2667,12 +2667,6 @@ static int handle_button(void)
2667 switch (button) 2667 switch (button)
2668 { 2668 {
2669 case ACTION_WPS_BROWSE: 2669 case ACTION_WPS_BROWSE:
2670#if CONFIG_KEYPAD == ONDIO_PAD
2671 /* ondio doesn't have ACTION_WPS_MENU,
2672 so use ACTION_WPS_BROWSE for menu */
2673 ret = LRC_GOTO_MENU;
2674 break;
2675#endif
2676 case ACTION_WPS_STOP: 2670 case ACTION_WPS_STOP:
2677 save_changes(); 2671 save_changes();
2678 ret = PLUGIN_OK; 2672 ret = PLUGIN_OK;
diff --git a/apps/plugins/lua/Makefile b/apps/plugins/lua/Makefile
index 8568d79c4c..dcf2910c36 100644
--- a/apps/plugins/lua/Makefile
+++ b/apps/plugins/lua/Makefile
@@ -28,13 +28,8 @@ OBJS = $(patsubst %.S, $(OBJDIR)/%.o, $(OBJS2))
28DIRS = . 28DIRS = .
29 29
30ifndef APP_TYPE 30ifndef APP_TYPE
31ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
32 LDS := archos.lds
33 OUTPUT = $(OUTDIR)/lua.ovl
34else ## iRiver/iPod/... targets
35 LDS := ../plugin.lds 31 LDS := ../plugin.lds
36 OUTPUT = $(OUTDIR)/lua.rock 32 OUTPUT = $(OUTDIR)/lua.rock
37endif
38else ## simulators 33else ## simulators
39 OUTPUT = $(OUTDIR)/lua.rock 34 OUTPUT = $(OUTDIR)/lua.rock
40endif 35endif
diff --git a/apps/plugins/lua/lua.make b/apps/plugins/lua/lua.make
index ebdef1e24e..61decb5605 100644
--- a/apps/plugins/lua/lua.make
+++ b/apps/plugins/lua/lua.make
@@ -23,15 +23,7 @@ LUA_INCLUDELIST := $(addprefix $(LUA_BUILDDIR)/,audio.lua blit.lua color.lua dra
23 23
24 24
25ifndef APP_TYPE 25ifndef APP_TYPE
26ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
27 ### lowmem targets
28 ROCKS += $(LUA_BUILDDIR)/lua.ovl
29 LUA_OUTLDS = $(LUA_BUILDDIR)/lua.link
30 LUA_OVLFLAGS = -T$(LUA_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
31else
32 ### all other targets
33 ROCKS += $(LUA_BUILDDIR)/lua.rock 26 ROCKS += $(LUA_BUILDDIR)/lua.rock
34endif
35else 27else
36 ### simulator 28 ### simulator
37 ROCKS += $(LUA_BUILDDIR)/lua.rock 29 ROCKS += $(LUA_BUILDDIR)/lua.rock
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c
index a33fdf7170..4fa989da46 100644
--- a/apps/plugins/lua/rocklib.c
+++ b/apps/plugins/lua/rocklib.c
@@ -39,7 +39,7 @@
39 * from Lua in its stack in direct order (the first argument is pushed first). To return values to Lua, 39 * from Lua in its stack in direct order (the first argument is pushed first). To return values to Lua,
40 * a C function just pushes them onto the stack, in direct order (the first result is pushed first), 40 * a C function just pushes them onto the stack, in direct order (the first result is pushed first),
41 * and returns the number of results. Any other value in the stack below the results will be properly 41 * and returns the number of results. Any other value in the stack below the results will be properly
42 * discarded by Lua. Like a Lua function, a C function called by Lua can also return many results. 42 * discarded by Lua. Like a Lua function, a C function called by Lua can also return many results.
43 * 43 *
44 * When porting new functions, don't forget to check rocklib_aux.pl whether it automatically creates 44 * When porting new functions, don't forget to check rocklib_aux.pl whether it automatically creates
45 * wrappers for the function and if so, add the function names to @forbidden_functions. This is to 45 * wrappers for the function and if so, add the function names to @forbidden_functions. This is to
@@ -487,8 +487,7 @@ RB_WRAP(sound)
487 lua_pushstring (L, rb->sound_unit(setting)); 487 lua_pushstring (L, rb->sound_unit(setting));
488 return 1; 488 return 1;
489 break; 489 break;
490#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || \ 490#if ((CONFIG_CODEC == SWCODEC) && defined (HAVE_PITCHCONTROL))
491 (CONFIG_CODEC == SWCODEC)) && defined (HAVE_PITCHCONTROL)
492 case SOUND_SET_PITCH: 491 case SOUND_SET_PITCH:
493 rb->sound_set_pitch(setting); 492 rb->sound_set_pitch(setting);
494 return 1;/*nil*/ 493 return 1;/*nil*/
@@ -496,7 +495,7 @@ RB_WRAP(sound)
496#endif 495#endif
497 case SOUND_VAL2PHYS: 496 case SOUND_VAL2PHYS:
498 value = luaL_checkint(L, 3); 497 value = luaL_checkint(L, 3);
499 result = rb->sound_val2phys(setting, value); 498 result = rb->sound_val2phys(setting, value);
500 break; 499 break;
501 500
502 default: 501 default:
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c
index 4e875979ab..01659dbfd2 100644
--- a/apps/plugins/minesweeper.c
+++ b/apps/plugins/minesweeper.c
@@ -34,31 +34,8 @@ enum minesweeper_status {
34}; 34};
35 35
36/* variable button definitions */ 36/* variable button definitions */
37#if CONFIG_KEYPAD == RECORDER_PAD 37#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
38# define MINESWP_LEFT BUTTON_LEFT 38 (CONFIG_KEYPAD == IRIVER_H300_PAD)
39# define MINESWP_RIGHT BUTTON_RIGHT
40# define MINESWP_UP BUTTON_UP
41# define MINESWP_DOWN BUTTON_DOWN
42# define MINESWP_QUIT BUTTON_OFF
43# define MINESWP_TOGGLE BUTTON_ON
44# define MINESWP_TOGGLE2 BUTTON_F1
45# define MINESWP_DISCOVER BUTTON_PLAY
46# define MINESWP_DISCOVER2 BUTTON_F2
47# define MINESWP_INFO BUTTON_F3
48
49#elif CONFIG_KEYPAD == ONDIO_PAD
50# define MINESWP_LEFT BUTTON_LEFT
51# define MINESWP_RIGHT BUTTON_RIGHT
52# define MINESWP_UP BUTTON_UP
53# define MINESWP_DOWN BUTTON_DOWN
54# define MINESWP_QUIT BUTTON_OFF
55# define MINESWP_TOGGLE_PRE BUTTON_MENU
56# define MINESWP_TOGGLE (BUTTON_MENU | BUTTON_REL)
57# define MINESWP_DISCOVER (BUTTON_MENU | BUTTON_REPEAT)
58# define MINESWP_INFO (BUTTON_MENU | BUTTON_OFF)
59
60#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
61 (CONFIG_KEYPAD == IRIVER_H300_PAD)
62# define MINESWP_LEFT BUTTON_LEFT 39# define MINESWP_LEFT BUTTON_LEFT
63# define MINESWP_RIGHT BUTTON_RIGHT 40# define MINESWP_RIGHT BUTTON_RIGHT
64# define MINESWP_UP BUTTON_UP 41# define MINESWP_UP BUTTON_UP
diff --git a/apps/plugins/nim.c b/apps/plugins/nim.c
deleted file mode 100644
index 70cf8dcec4..0000000000
--- a/apps/plugins/nim.c
+++ /dev/null
@@ -1,285 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 Pierre Delore
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "plugin.h"
22#include "lib/pluginlib_exit.h"
23
24/* NIM game for the player
25
26Rules of nim game
27-----------------
28There are 21 matches.
29Two players (you and the cpu) alternately pick a certain number of matches and the one,
30who takes the last match, loses.
31
32
33History:
34-------
35V1.0 : 2003-07-22
36 First release of the game
37V1.1 : 2003-07-22
38 I Change the patterns definition in order to have a clean code
39V1.2 : 2003-07-30
40 Patch from JB that change:
41 . the win and lose message
42 . the BUTTON_STOP code
43 . Add a test
44 I suppress the exit variable
45 I suppress or translates the comments which were in French
46 I put min=1 at the of the main loop ( When there are 21 matches you can decide not to
47 take a match. Later you are obliged to take at least one.)
48*/
49
50
51
52/*Pattern for the game*/
53static unsigned char smile[]={0x00, 0x11, 0x04, 0x04, 0x00, 0x11, 0x0E}; /* :-) */
54static unsigned char cry[] ={0x00, 0x11, 0x04, 0x04, 0x00, 0x0E, 0x11}; /* :-( */
55static unsigned char pattern3[]={0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15}; /*3 parts*/
56static unsigned char pattern2[]={0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14}; /*2 parts*/
57static unsigned char pattern1[]={0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10}; /*1 part*/
58
59static unsigned long hsmile,hcry,h1,h2; /*Handle for the new pattern*/
60
61static bool end; /*If true game is finished*/
62
63/*Display that the action it's impossible*/
64static void impossible(void)
65{
66 rb->lcd_puts(0,1,"Impossible!");
67 rb->lcd_update();
68 rb->sleep(HZ);
69 return;
70}
71
72/*Display that the CPU lose :) */
73static void lose(void)
74{
75 rb->lcd_define_pattern(hsmile,smile);
76 rb->lcd_puts(0,1,"You Win!!");
77 rb->lcd_putc(8,1,hsmile);
78 rb->lcd_update();
79 end=true;
80 rb->sleep(HZ*2);
81 return;
82}
83
84
85/* Display that the CPU win :( */
86static void win(void)
87{
88 rb->lcd_define_pattern(hcry,cry);
89 rb->lcd_puts(0,1,"You Lose!!");
90 rb->lcd_putc(9,1,hcry);
91 rb->lcd_update();
92 end=true;
93 rb->sleep(HZ*2);
94 return;
95}
96
97
98/*Display the first line*/
99static void display_first_line(int x)
100{
101 int i;
102
103 rb->lcd_putsf(0,0," =%d",x);
104
105 rb->lcd_define_pattern(h1,pattern3);
106 for (i=0;i<x/3;i++)
107 rb->lcd_putc(i,0,h1);
108
109 if (x%3==2)
110 {
111 rb->lcd_define_pattern(h2,pattern2);
112 rb->lcd_putc(i,0,h2);
113 }
114 if (x%3==1)
115 {
116 rb->lcd_define_pattern(h2,pattern1);
117 rb->lcd_putc(i,0,h2);
118 }
119}
120
121/* Call when the program end */
122static void nim_exit(void)
123{
124 /*Restore the old pattern*/
125 rb->lcd_unlock_pattern(h1);
126 rb->lcd_unlock_pattern(h2);
127 rb->lcd_unlock_pattern(hsmile);
128 rb->lcd_unlock_pattern(hcry);
129
130 /*Clear the screen*/
131 rb->lcd_clear_display();
132 rb->lcd_update();
133}
134
135/* this is the plugin entry point */
136enum plugin_status plugin_start(const void* parameter)
137{
138 int y,z,button;
139 int x,v,min;
140 bool ok;
141 bool go;
142 atexit(nim_exit);
143
144 /* if you don't use the parameter, you can do like
145 this to avoid the compiler warning about it */
146 (void)parameter;
147
148 /*Get the pattern handle*/
149 h1=rb->lcd_get_locked_pattern();
150 h2=rb->lcd_get_locked_pattern();
151 hcry=rb->lcd_get_locked_pattern();
152 hsmile=rb->lcd_get_locked_pattern();
153
154
155 rb->splash(HZ, "NIM V1.2");
156 rb->lcd_clear_display();
157
158 /* Main loop */
159 while (1)
160 {
161 /* Init */
162 x=21;
163 v=1;
164 y=1;
165 end=false;
166 min=0;
167
168 /*Empty the event queue*/
169 rb->button_clear_queue();
170
171 /* Game loop */
172 while(end!=true)
173 {
174 do
175 {
176 ok=1;
177 y=1;
178 display_first_line(x);
179
180 rb->lcd_putsf(0,1,"[%d..%d]?=%d",min,v,y);
181 rb->lcd_update();
182
183 go=false;
184 while (!go)
185 {
186 button = rb->button_get(true);
187 switch ( button )
188 {
189 case BUTTON_STOP|BUTTON_REL:
190 go = true;
191 return PLUGIN_OK;
192 break;
193
194 case BUTTON_PLAY|BUTTON_REL:
195 go=true;
196 break;
197
198 case BUTTON_LEFT|BUTTON_REL:
199 go=false;
200 if (y>min)
201 y--;
202 break;
203
204 case BUTTON_RIGHT|BUTTON_REL:
205 go=false;
206 if (y<v)
207 y++;
208 break;
209
210 default:
211 exit_on_usb(button);
212 break;
213 }
214 display_first_line(x);
215 rb->lcd_putsf(0,1,"[%d..%d]?=%d",min,v,y);
216 rb->lcd_update();
217 }
218
219 if ( (y==0) && (x<21))
220 {
221 impossible();
222 ok=false;
223 }
224 else
225 {
226 if (y!=0) /*If y=0 and x=21 jump to CPU code */
227 {
228 if ((y>v) || (y>x))
229 {
230 impossible();
231 ok=false;
232 }
233 if (y-x==0)
234 win();
235 else
236 {
237 v=y*2;
238 x-=y;
239 }
240 }
241 }
242 }
243 while (ok==false);
244
245 display_first_line(x);
246
247 /*CPU*/
248 if (x==1)
249 lose();
250 else
251 if (x==2)
252 win();
253 y=0;
254 if (end==false)
255 {
256 for (z=v;z>=1;z--)
257 {
258 if (x-z==1)
259 y=z;
260 }
261 if (y<=0)
262 {
263 for(z=v;z>=1;z--)
264 {
265 if(x-(z*3)==2)
266 y=z;
267 }
268 if ((y==0) && (x>14))
269 y=v;
270 if (y==0)
271 y=1;
272 }
273 v=y*2;
274 x-=y;
275 rb->lcd_putsf(0,1,"I take=%d",y);
276 rb->lcd_update();
277 rb->sleep(HZ);
278 }
279 if ((x==1)&&(!end))
280 win();
281 min=1;
282 }
283 }
284 return PLUGIN_OK;
285}
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index 97a8094e1f..8e14f26bd5 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -30,30 +30,7 @@
30#include "lib/osd.h" 30#include "lib/osd.h"
31 31
32/* variable button definitions */ 32/* variable button definitions */
33#if CONFIG_KEYPAD == RECORDER_PAD 33#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
34#define OSCILLOSCOPE_QUIT BUTTON_OFF
35#define OSCILLOSCOPE_DRAWMODE BUTTON_F1
36#define OSCILLOSCOPE_ADVMODE BUTTON_F2
37#define OSCILLOSCOPE_ORIENTATION BUTTON_F3
38#define OSCILLOSCOPE_PAUSE BUTTON_PLAY
39#define OSCILLOSCOPE_SPEED_UP BUTTON_RIGHT
40#define OSCILLOSCOPE_SPEED_DOWN BUTTON_LEFT
41#define OSCILLOSCOPE_VOL_UP BUTTON_UP
42#define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN
43
44#elif CONFIG_KEYPAD == ONDIO_PAD
45#define OSCILLOSCOPE_QUIT BUTTON_OFF
46#define OSCILLOSCOPE_DRAWMODE_PRE BUTTON_MENU
47#define OSCILLOSCOPE_DRAWMODE (BUTTON_MENU | BUTTON_REL)
48#define OSCILLOSCOPE_ADVMODE (BUTTON_MENU | BUTTON_RIGHT)
49#define OSCILLOSCOPE_ORIENTATION (BUTTON_MENU | BUTTON_LEFT)
50#define OSCILLOSCOPE_PAUSE (BUTTON_MENU | BUTTON_OFF)
51#define OSCILLOSCOPE_SPEED_UP BUTTON_RIGHT
52#define OSCILLOSCOPE_SPEED_DOWN BUTTON_LEFT
53#define OSCILLOSCOPE_VOL_UP BUTTON_UP
54#define OSCILLOSCOPE_VOL_DOWN BUTTON_DOWN
55
56#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
57#define OSCILLOSCOPE_QUIT BUTTON_OFF 34#define OSCILLOSCOPE_QUIT BUTTON_OFF
58#define OSCILLOSCOPE_DRAWMODE BUTTON_SELECT 35#define OSCILLOSCOPE_DRAWMODE BUTTON_SELECT
59#define OSCILLOSCOPE_ADVMODE BUTTON_MODE 36#define OSCILLOSCOPE_ADVMODE BUTTON_MODE
@@ -934,9 +911,6 @@ static void get_peaks(int *left, int *right)
934#elif defined (SIMULATOR) 911#elif defined (SIMULATOR)
935 *left = rand() % 0x8000; 912 *left = rand() % 0x8000;
936 *right = rand() % 0x8000; 913 *right = rand() % 0x8000;
937#elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
938 *left = rb->mas_codec_readreg(0xC);
939 *right = rb->mas_codec_readreg(0xD);
940#else 914#else
941 *left = 0; 915 *left = 0;
942 *right = 0; 916 *right = 0;
diff --git a/apps/plugins/pegbox.c b/apps/plugins/pegbox.c
index e000e98d33..c3d38997eb 100644
--- a/apps/plugins/pegbox.c
+++ b/apps/plugins/pegbox.c
@@ -43,41 +43,7 @@
43#define HOLE 6 43#define HOLE 6
44#define PLAYER 7 44#define PLAYER 7
45 45
46#if CONFIG_KEYPAD == RECORDER_PAD 46#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
47#define PEGBOX_SELECT BUTTON_ON
48#define PEGBOX_QUIT BUTTON_OFF
49#define PEGBOX_RESTART BUTTON_F2
50#define PEGBOX_LVL_UP BUTTON_F1
51#define PEGBOX_LVL_DOWN BUTTON_F3
52#define PEGBOX_UP BUTTON_UP
53#define PEGBOX_DOWN BUTTON_DOWN
54#define PEGBOX_RIGHT BUTTON_RIGHT
55#define PEGBOX_LEFT BUTTON_LEFT
56
57#define SELECT_TEXT "ON"
58#define QUIT_TEXT "OFF"
59#define RESTART_TEXT "F2"
60#define LVL_UP_TEXT "F1"
61#define LVL_DOWN_TEXT "F3"
62
63#elif CONFIG_KEYPAD == ONDIO_PAD
64#define PEGBOX_SELECT BUTTON_OFF
65#define PEGBOX_QUIT (BUTTON_MENU | BUTTON_LEFT)
66#define PEGBOX_RESTART (BUTTON_MENU | BUTTON_RIGHT)
67#define PEGBOX_LVL_UP (BUTTON_MENU | BUTTON_UP)
68#define PEGBOX_LVL_DOWN (BUTTON_MENU | BUTTON_DOWN)
69#define PEGBOX_UP BUTTON_UP
70#define PEGBOX_DOWN BUTTON_DOWN
71#define PEGBOX_RIGHT BUTTON_RIGHT
72#define PEGBOX_LEFT BUTTON_LEFT
73
74#define SELECT_TEXT "OFF"
75#define QUIT_TEXT "M+LEFT"
76#define RESTART_TEXT "M+RIGHT"
77#define LVL_UP_TEXT "M+UP"
78#define LVL_DOWN_TEXT "M+DOWN"
79
80#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
81 (CONFIG_KEYPAD == IRIVER_H300_PAD) 47 (CONFIG_KEYPAD == IRIVER_H300_PAD)
82#define PEGBOX_SELECT BUTTON_SELECT 48#define PEGBOX_SELECT BUTTON_SELECT
83#define PEGBOX_QUIT BUTTON_OFF 49#define PEGBOX_QUIT BUTTON_OFF
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 91174604ea..a32298f861 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -90,13 +90,6 @@ const struct button_mapping pf_context_album_scroll[] =
90 {ACTION_NONE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT}, 90 {ACTION_NONE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT},
91 {ACTION_NONE, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT}, 91 {ACTION_NONE, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT},
92#endif 92#endif
93#if CONFIG_KEYPAD == ONDIO_PAD
94 {PF_SELECT, BUTTON_UP|BUTTON_REL, BUTTON_UP},
95 {PF_CONTEXT, BUTTON_UP|BUTTON_REPEAT, BUTTON_UP},
96 {ACTION_NONE, BUTTON_UP, BUTTON_NONE},
97 {ACTION_NONE, BUTTON_DOWN, BUTTON_NONE},
98 {ACTION_NONE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
99#endif
100 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_PLUGIN|1) 93 LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_PLUGIN|1)
101}; 94};
102#endif /* !USE_CORE_PREVNEXT */ 95#endif /* !USE_CORE_PREVNEXT */
@@ -147,8 +140,7 @@ const struct button_mapping pf_context_buttons[] =
147 {PF_QUIT, BUTTON_RC_REC, BUTTON_NONE}, 140 {PF_QUIT, BUTTON_RC_REC, BUTTON_NONE},
148#elif CONFIG_KEYPAD == MEIZU_M6SL_PAD 141#elif CONFIG_KEYPAD == MEIZU_M6SL_PAD
149 {PF_QUIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU}, 142 {PF_QUIT, BUTTON_MENU|BUTTON_REPEAT, BUTTON_MENU},
150#elif CONFIG_KEYPAD == IRIVER_H100_PAD || CONFIG_KEYPAD == IRIVER_H300_PAD || \ 143#elif CONFIG_KEYPAD == IRIVER_H100_PAD || CONFIG_KEYPAD == IRIVER_H300_PAD
151 CONFIG_KEYPAD == RECORDER_PAD || CONFIG_KEYPAD == ONDIO_PAD
152 {PF_QUIT, BUTTON_OFF, BUTTON_NONE}, 144 {PF_QUIT, BUTTON_OFF, BUTTON_NONE},
153#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD 145#elif CONFIG_KEYPAD == PBELL_VIBE500_PAD
154 {PF_QUIT, BUTTON_REC, BUTTON_NONE}, 146 {PF_QUIT, BUTTON_REC, BUTTON_NONE},
@@ -691,13 +683,7 @@ static inline PFreal fdiv(PFreal num, PFreal den)
691#define fabs(a) (a < 0 ? -a : a) 683#define fabs(a) (a < 0 ? -a : a)
692#define fbound(min,val,max) (fmax((min),fmin((max),(val)))) 684#define fbound(min,val,max) (fmax((min),fmin((max),(val))))
693 685
694#if CONFIG_CPU == SH7034
695/* 16*16->32 bit multiplication is a single instrcution on the SH1 */
696#define MULUQ(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b))))
697#else
698#define MULUQ(a, b) ((a) * (b)) 686#define MULUQ(a, b) ((a) * (b))
699#endif
700
701 687
702#if 0 688#if 0
703#define fmul(a,b) ( ((a)*(b)) >> PFREAL_SHIFT ) 689#define fmul(a,b) ( ((a)*(b)) >> PFREAL_SHIFT )
diff --git a/apps/plugins/pictureflow/pictureflow.make b/apps/plugins/pictureflow/pictureflow.make
index 9c29f7abd9..fb606fb860 100644
--- a/apps/plugins/pictureflow/pictureflow.make
+++ b/apps/plugins/pictureflow/pictureflow.make
@@ -16,15 +16,7 @@ PICTUREFLOW_OBJ := $(call c2obj, $(PICTUREFLOW_SRC))
16OTHER_SRC += $(PICTUREFLOW_SRC) 16OTHER_SRC += $(PICTUREFLOW_SRC)
17 17
18ifndef APP_TYPE 18ifndef APP_TYPE
19ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
20 ### lowmem targets
21 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.ovl
22 PICTUREFLOW_OUTLDS = $(PICTUREFLOW_OBJDIR)/picutreflow.link
23 PICTUREFLOW_OVLFLAGS = -T$(PICTUREFLOW_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
24else
25 ### all other targets
26 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock 19 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock
27endif
28else 20else
29 ### simulator 21 ### simulator
30 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock 22 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 7037496be4..25ff4a461b 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -6,8 +6,6 @@
6OUTPUT_FORMAT(elf32-m68k) 6OUTPUT_FORMAT(elf32-m68k)
7#elif defined(CPU_ARM) 7#elif defined(CPU_ARM)
8OUTPUT_FORMAT(elf32-littlearm) 8OUTPUT_FORMAT(elf32-littlearm)
9#elif defined(CPU_SH)
10OUTPUT_FORMAT(elf32-sh)
11#elif defined(CPU_MIPS) 9#elif defined(CPU_MIPS)
12OUTPUT_FORMAT(elf32-littlemips) 10OUTPUT_FORMAT(elf32-littlemips)
13#else 11#else
diff --git a/apps/plugins/pong.c b/apps/plugins/pong.c
index 1fcd018de2..fcc4c5a3b9 100644
--- a/apps/plugins/pong.c
+++ b/apps/plugins/pong.c
@@ -39,23 +39,7 @@
39#define MOVE_STEP LCD_HEIGHT / 32 /* move pad this many steps up/down each move */ 39#define MOVE_STEP LCD_HEIGHT / 32 /* move pad this many steps up/down each move */
40 40
41/* variable button definitions */ 41/* variable button definitions */
42#if CONFIG_KEYPAD == RECORDER_PAD 42#if CONFIG_KEYPAD == IRIVER_H100_PAD
43#define PONG_QUIT BUTTON_OFF
44#define PONG_PAUSE BUTTON_ON
45#define PONG_LEFT_UP BUTTON_F1
46#define PONG_LEFT_DOWN BUTTON_LEFT
47#define PONG_RIGHT_UP BUTTON_F3
48#define PONG_RIGHT_DOWN BUTTON_RIGHT
49
50#elif CONFIG_KEYPAD == ONDIO_PAD
51#define PONG_QUIT BUTTON_OFF
52#define PONG_PAUSE BUTTON_RIGHT
53#define PONG_LEFT_UP BUTTON_LEFT
54#define PONG_LEFT_DOWN BUTTON_MENU
55#define PONG_RIGHT_UP BUTTON_UP
56#define PONG_RIGHT_DOWN BUTTON_DOWN
57
58#elif CONFIG_KEYPAD == IRIVER_H100_PAD
59#define PONG_QUIT BUTTON_OFF 43#define PONG_QUIT BUTTON_OFF
60#define PONG_LEFT_UP BUTTON_UP 44#define PONG_LEFT_UP BUTTON_UP
61#define PONG_LEFT_DOWN BUTTON_DOWN 45#define PONG_LEFT_DOWN BUTTON_DOWN
diff --git a/apps/plugins/reversi/reversi-gui.h b/apps/plugins/reversi/reversi-gui.h
index 4ec6bcb67b..ceeabeebc8 100644
--- a/apps/plugins/reversi/reversi-gui.h
+++ b/apps/plugins/reversi/reversi-gui.h
@@ -27,28 +27,8 @@
27#define GAME_FILE PLUGIN_GAMES_DIR "/reversi.rev" 27#define GAME_FILE PLUGIN_GAMES_DIR "/reversi.rev"
28 28
29/* variable button definitions */ 29/* variable button definitions */
30#if CONFIG_KEYPAD == RECORDER_PAD 30#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
31#define REVERSI_BUTTON_QUIT BUTTON_OFF 31 (CONFIG_KEYPAD == IRIVER_H300_PAD)
32#define REVERSI_BUTTON_UP BUTTON_UP
33#define REVERSI_BUTTON_DOWN BUTTON_DOWN
34#define REVERSI_BUTTON_LEFT BUTTON_LEFT
35#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
36#define REVERSI_BUTTON_MAKE_MOVE BUTTON_PLAY
37#define REVERSI_BUTTON_MENU BUTTON_F1
38
39#elif CONFIG_KEYPAD == ONDIO_PAD
40#define REVERSI_BUTTON_QUIT BUTTON_OFF
41#define REVERSI_BUTTON_UP BUTTON_UP
42#define REVERSI_BUTTON_DOWN BUTTON_DOWN
43#define REVERSI_BUTTON_LEFT BUTTON_LEFT
44#define REVERSI_BUTTON_RIGHT BUTTON_RIGHT
45#define REVERSI_BUTTON_MAKE_MOVE BUTTON_MENU
46#define REVERSI_BUTTON_MAKE_MOVE_SHORTPRESS
47#define REVERSI_BUTTON_MENU_LONGPRESS
48#define REVERSI_BUTTON_MENU BUTTON_MENU
49
50#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
51 (CONFIG_KEYPAD == IRIVER_H300_PAD)
52#define REVERSI_BUTTON_QUIT BUTTON_OFF 32#define REVERSI_BUTTON_QUIT BUTTON_OFF
53#define REVERSI_BUTTON_UP BUTTON_UP 33#define REVERSI_BUTTON_UP BUTTON_UP
54#define REVERSI_BUTTON_DOWN BUTTON_DOWN 34#define REVERSI_BUTTON_DOWN BUTTON_DOWN
diff --git a/apps/plugins/rockblox.c b/apps/plugins/rockblox.c
index b6cf6e5470..1732d61277 100644
--- a/apps/plugins/rockblox.c
+++ b/apps/plugins/rockblox.c
@@ -58,43 +58,6 @@
58 58
59#define ROCKBLOX_RC_OFF BUTTON_RC_STOP 59#define ROCKBLOX_RC_OFF BUTTON_RC_STOP
60 60
61#elif CONFIG_KEYPAD == RECORDER_PAD
62
63#define ROCKBLOX_OFF BUTTON_OFF
64#define ROCKBLOX_ROTATE_CCW BUTTON_UP
65#define ROCKBLOX_ROTATE_CW BUTTON_PLAY
66#define ROCKBLOX_DOWN BUTTON_DOWN
67#define ROCKBLOX_LEFT BUTTON_LEFT
68#define ROCKBLOX_RIGHT BUTTON_RIGHT
69#define ROCKBLOX_DROP BUTTON_ON
70#define ROCKBLOX_RESTART BUTTON_F1
71
72#elif CONFIG_KEYPAD == PLAYER_PAD
73
74#define ROCKBLOX_OFF_PRE BUTTON_STOP
75#define ROCKBLOX_OFF (BUTTON_STOP|BUTTON_REL)
76#define ROCKBLOX_ROTATE_CCW BUTTON_PLAY
77#define ROCKBLOX_ROTATE_CW (BUTTON_ON|BUTTON_PLAY)
78#define ROCKBLOX_DOWN BUTTON_MENU
79#define ROCKBLOX_LEFT BUTTON_LEFT
80#define ROCKBLOX_RIGHT BUTTON_RIGHT
81#define ROCKBLOX_DROP_PRE BUTTON_ON
82#define ROCKBLOX_DROP (BUTTON_ON|BUTTON_REL)
83#define ROCKBLOX_RESTART (BUTTON_STOP|BUTTON_MENU)
84
85#elif CONFIG_KEYPAD == ONDIO_PAD
86
87#define ROCKBLOX_OFF_PRE BUTTON_OFF
88#define ROCKBLOX_OFF (BUTTON_OFF|BUTTON_REL)
89#define ROCKBLOX_ROTATE_CCW BUTTON_UP
90#define ROCKBLOX_ROTATE_CW (BUTTON_MENU|BUTTON_UP)
91#define ROCKBLOX_DOWN BUTTON_DOWN
92#define ROCKBLOX_LEFT BUTTON_LEFT
93#define ROCKBLOX_RIGHT BUTTON_RIGHT
94#define ROCKBLOX_DROP_PRE BUTTON_MENU
95#define ROCKBLOX_DROP (BUTTON_MENU|BUTTON_REL)
96#define ROCKBLOX_RESTART (BUTTON_OFF|BUTTON_MENU)
97
98#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD 61#elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
99 62
100#define ROCKBLOX_OFF BUTTON_POWER 63#define ROCKBLOX_OFF BUTTON_POWER
diff --git a/apps/plugins/rockbox_flash.c b/apps/plugins/rockbox_flash.c
deleted file mode 100644
index 4837b03fb5..0000000000
--- a/apps/plugins/rockbox_flash.c
+++ /dev/null
@@ -1,967 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Plugin for reprogramming only the second image in Flash ROM.
11* !!! DON'T MESS WITH THIS CODE UNLESS YOU'RE ABSOLUTELY SURE WHAT YOU DO !!!
12*
13* Copyright (C) 2003 Jörg Hohensohn aka [IDC]Dragon
14*
15* This program is free software; you can redistribute it and/or
16* modify it under the terms of the GNU General Public License
17* as published by the Free Software Foundation; either version 2
18* of the License, or (at your option) any later version.
19*
20* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21* KIND, either express or implied.
22*
23****************************************************************************/
24#include "plugin.h"
25
26/* define DUMMY if you only want to "play" with the UI, does no harm */
27/* #define DUMMY */
28
29#define LATEST_BOOTLOADER_VERSION 3 /* update this with the bootloader */
30
31#ifndef UINT8
32#define UINT8 unsigned char
33#endif
34
35#ifndef UINT16
36#define UINT16 unsigned short
37#endif
38
39#ifndef UINT32
40#define UINT32 unsigned long
41#endif
42
43/* hard-coded values */
44static volatile UINT8* FB = (UINT8*)0x02000000; /* Flash base address */
45#define SECTORSIZE 4096 /* size of one flash sector */
46
47#define ROCKBOX_DEST 0x09000000
48#define ROCKBOX_EXEC 0x09000200
49#define BOOT_VERS_ADR 0xFA /* position of bootloader version value in Flash */
50#define FW_VERS_ADR 0xFE /* position of firmware version value in Flash */
51#define UCL_HEADER 26 /* size of the header generated by uclpack */
52
53#if CONFIG_KEYPAD == ONDIO_PAD /* limited keypad */
54#define KEY1 BUTTON_LEFT
55#define KEY2 BUTTON_UP
56#define KEYNAME1 "Left"
57#define KEYNAME2 "Up"
58#else /* recorder keypad */
59#define KEY1 BUTTON_F1
60#define KEY2 BUTTON_F2
61#define KEYNAME1 "F1"
62#define KEYNAME2 "F2"
63#endif
64
65typedef struct
66{
67 UINT32 destination; /* address to copy it to */
68 UINT32 size; /* how many bytes of payload (to the next header) */
69 UINT32 execute; /* entry point */
70 UINT32 flags; /* uncompressed or compressed */
71 /* end of header, now comes the payload */
72} tImageHeader;
73
74/* result of the CheckFirmwareFile() function */
75typedef enum
76{
77 eOK = 0,
78 eFileNotFound, /* errors from here on */
79 eTooBig,
80 eTooSmall,
81 eReadErr,
82 eNotUCL,
83 eWrongAlgorithm,
84 eMultiBlocks,
85 eBadRomLink
86} tCheckResult;
87
88typedef struct
89{
90 UINT8 manufacturer;
91 UINT8 id;
92 int size;
93 char name[32];
94} tFlashInfo;
95
96static UINT8* sector; /* better not place this on the stack... */
97
98/***************** Flash Functions *****************/
99
100
101/* read the manufacturer and device ID */
102static bool ReadID(volatile UINT8* pBase, UINT8* pManufacturerID,
103 UINT8* pDeviceID)
104{
105 UINT8 not_manu, not_id; /* read values before switching to ID mode */
106 UINT8 manu, id; /* read values when in ID mode */
107
108 pBase = (UINT8*)((UINT32)pBase & 0xFFF80000); /* round down to 512k align,
109 to make sure */
110
111 not_manu = pBase[0]; /* read the normal content */
112 not_id = pBase[1]; /* should be 'A' (0x41) and 'R' (0x52) from the
113 "ARCH" marker */
114
115 pBase[0x5555] = 0xAA; /* enter command mode */
116 pBase[0x2AAA] = 0x55;
117 pBase[0x5555] = 0x90; /* ID command */
118 rb->sleep(HZ/50); /* Atmel wants 20ms pause here */
119
120 manu = pBase[0];
121 id = pBase[1];
122
123 pBase[0] = 0xF0; /* reset flash (back to normal read mode) */
124 rb->sleep(HZ/50); /* Atmel wants 20ms pause here */
125
126 /* I assume success if the obtained values are different from
127 the normal flash content. This is not perfectly bulletproof, they
128 could theoretically be the same by chance, causing us to fail. */
129 if (not_manu != manu || not_id != id) /* a value has changed */
130 {
131 *pManufacturerID = manu; /* return the results */
132 *pDeviceID = id;
133 return true; /* success */
134 }
135 return false; /* fail */
136}
137
138/* erase the sector which contains the given address */
139static bool EraseSector(volatile UINT8* pAddr)
140{
141#ifdef DUMMY
142 (void)pAddr; /* prevents warning */
143 return true;
144#else
145 volatile UINT8* pBase =
146 (UINT8*)((UINT32)pAddr & 0xFFF80000); /* round down to 512k align */
147 unsigned timeout = 43000; /* the timeout loop should be no less than
148 25ms */
149
150 pBase[0x5555] = 0xAA; /* enter command mode */
151 pBase[0x2AAA] = 0x55;
152 pBase[0x5555] = 0x80; /* erase command */
153 pBase[0x5555] = 0xAA; /* enter command mode */
154 pBase[0x2AAA] = 0x55;
155 *pAddr = 0x30; /* erase the sector */
156
157 /* I counted 7 instructions for this loop -> min. 0.58 us per round
158 Plus memory waitstates it will be much more, gives margin */
159 while (*pAddr != 0xFF && --timeout); /* poll for erased */
160
161 return (timeout != 0);
162#endif
163}
164
165/* address must be in an erased location */
166static inline bool ProgramByte(volatile UINT8* pAddr, UINT8 data)
167{
168#ifdef DUMMY
169 (void)pAddr; /* prevents warnings */
170 (void)data;
171 return true;
172#else
173 unsigned timeout = 35; /* the timeout loop should be no less than 20us */
174
175 if (~*pAddr & data) /* just a safety feature, not really necessary */
176 return false; /* can't set any bit from 0 to 1 */
177
178 FB[0x5555] = 0xAA; /* enter command mode */
179 FB[0x2AAA] = 0x55;
180 FB[0x5555] = 0xA0; /* byte program command */
181
182 *pAddr = data;
183
184 /* I counted 7 instructions for this loop -> min. 0.58 us per round
185 Plus memory waitstates it will be much more, gives margin */
186 while (*pAddr != data && --timeout); /* poll for programmed */
187
188 return (timeout != 0);
189#endif
190}
191
192/* this returns true if supported and fills the info struct */
193static bool GetFlashInfo(tFlashInfo* pInfo)
194{
195 rb->memset(pInfo, 0, sizeof(tFlashInfo));
196
197 if (!ReadID(FB, &pInfo->manufacturer, &pInfo->id))
198 return false;
199
200 if (pInfo->manufacturer == 0xBF) /* SST */
201 {
202 if (pInfo->id == 0xD6)
203 {
204 pInfo->size = 256* 1024; /* 256k */
205 rb->strcpy(pInfo->name, "SST39VF020");
206 return true;
207 }
208 else if (pInfo->id == 0xD7)
209 {
210 pInfo->size = 512* 1024; /* 512k */
211 rb->strcpy(pInfo->name, "SST39VF040");
212 return true;
213 }
214 else
215 return false;
216 }
217 return false;
218}
219
220
221/*********** Tool Functions ************/
222
223/* read a 32 bit value from memory, big endian */
224static UINT32 Read32(UINT8* pByte)
225{
226 UINT32 value;
227
228 value = (UINT32)pByte[0] << 24;
229 value |= (UINT32)pByte[1] << 16;
230 value |= (UINT32)pByte[2] << 8;
231 value |= (UINT32)pByte[3];
232
233 return value;
234}
235
236/* get the start address of the second image */
237static tImageHeader* GetSecondImage(void)
238{
239 tImageHeader* pImage1;
240 UINT32 pos = 0; /* default: not found */
241 UINT32* pFlash = (UINT32*)FB;
242
243 /* determine the first image position */
244 pos = pFlash[2] + pFlash[3]; /* position + size of the bootloader
245 = after it */
246 pos = (pos + 3) & ~3; /* be sure it's 32 bit aligned */
247 pImage1 = (tImageHeader*)pos;
248
249 if (pImage1->destination != ROCKBOX_DEST ||
250 pImage1->execute != ROCKBOX_EXEC)
251 return 0; /* seems to be no Archos/Rockbox image in here */
252
253 if (pImage1->size != 0)
254 {
255 /* success, we have a second image */
256 pos = (UINT32)pImage1 + sizeof(tImageHeader) + pImage1->size;
257 if (((pos + SECTORSIZE-1) & ~(SECTORSIZE-1)) != pos)
258 { /* not sector-aligned */
259 pos = 0; /* sanity check failed */
260 }
261 }
262
263 return (tImageHeader*)pos;
264}
265
266/* return bootloader version */
267static inline unsigned BootloaderVersion(void)
268{
269 return FB[BOOT_VERS_ADR];
270}
271
272/*********** Image File Functions ************/
273
274/* so far, only compressed images in UCL NRV algorithm 2e supported */
275tCheckResult CheckImageFile(char* filename, int space,
276 tImageHeader* pHeader, UINT8* pos)
277{
278 int i;
279 int fd;
280 int filesize; /* size info */
281
282 int fileread = 0; /* total size as read from the file */
283 int read; /* how many for this sector */
284
285 /* magic file header for compressed files */
286 static const UINT8 magic[8] = { 0x00,0xe9,0x55,0x43,0x4c,0xff,0x01,0x1a };
287 UINT8 ucl_header[UCL_HEADER];
288
289 fd = rb->open(filename, O_RDONLY);
290 if (fd < 0)
291 return eFileNotFound;
292
293 filesize = rb->filesize(fd);
294 if (filesize - (int)sizeof(ucl_header) - 8 > space)
295 {
296 rb->close(fd);
297 return eTooBig;
298 }
299 else if (filesize < 10000) /* give it some reasonable lower limit */
300 {
301 rb->close(fd);
302 return eTooSmall;
303 }
304
305 /* do some sanity checks */
306
307 read = rb->read(fd, ucl_header, sizeof(ucl_header));
308 fileread += read;
309 if (read != sizeof(ucl_header))
310 {
311 rb->close(fd);
312 return eReadErr;
313 }
314
315 /* compare the magic header */
316 for (i=0; i<8; i++)
317 {
318 if (ucl_header[i] != magic[i])
319 {
320 rb->close(fd);
321 return eNotUCL;
322 }
323 }
324
325 pHeader->size = Read32(ucl_header + 22); /* compressed size */
326 if (pHeader->size != filesize - sizeof(ucl_header) - 8)
327 {
328 rb->close(fd);
329 return eMultiBlocks;
330 }
331
332 /* fill in the hardcoded defaults of the header */
333 pHeader->destination = ROCKBOX_DEST;
334 pHeader->execute = ROCKBOX_EXEC;
335
336 if (Read32(ucl_header + 18) > pHeader->size) /* compare with uncompressed
337 size */
338 { /* compressed, normal case */
339 pHeader->flags = 0x00000001; /* flags for UCL compressed */
340
341 /* check for supported algorithm */
342 if (ucl_header[12] != 0x2E)
343 {
344 rb->close(fd);
345 return eWrongAlgorithm;
346 }
347 }
348 else
349 { /* uncompressed, either to be copied or run directly in flash */
350 UINT32 reset_vector; /* image has to start with reset vector */
351
352 pHeader->flags = 0x00000000; /* uncompressed */
353
354 read = rb->read(fd, &reset_vector, sizeof(reset_vector));
355 fileread += read;
356 if (read != sizeof(reset_vector))
357 {
358 rb->close(fd);
359 return eReadErr;
360 }
361 if (reset_vector >= (UINT32)FB
362 && reset_vector < (UINT32)FB+512*1024) /* ROM address? */
363 {
364 /* assume in-place, executing directly in flash */
365 pHeader->destination = (UINT32)(pos + sizeof(tImageHeader));
366
367 /* for new RomBox, this isn't the reset vector,
368 but the link address, for us to check the position */
369 if(pHeader->destination != reset_vector) /* compare link addr. */
370 {
371 rb->close(fd);
372 return eBadRomLink; /* not matching the start address */
373 }
374
375 /* read the now following reset vector */
376 read = rb->read(fd, &reset_vector, sizeof(reset_vector));
377 fileread += read;
378 if (read != sizeof(reset_vector))
379 {
380 rb->close(fd);
381 return eReadErr;
382 }
383 }
384
385 pHeader->execute = reset_vector;
386 }
387
388 /* check if we can read the whole file */
389 do
390 {
391 read = rb->read(fd, sector, SECTORSIZE);
392 fileread += read;
393 } while (read == SECTORSIZE);
394
395 rb->close(fd);
396
397 if (fileread != filesize)
398 return eReadErr;
399
400 return eOK;
401}
402
403
404/* returns the # of failures, 0 on success */
405static unsigned ProgramImageFile(char* filename, UINT8* pos,
406 tImageHeader* pImageHeader,
407 int start, int size)
408{
409 int i;
410 int fd;
411 int read; /* how many for this sector */
412 unsigned failures = 0;
413
414 fd = rb->open(filename, O_RDONLY);
415 if (fd < 0)
416 return false;
417
418 /* no error checking necessary here, we checked for minimum size
419 already */
420 rb->lseek(fd, start, SEEK_SET); /* go to start position */
421
422 *(tImageHeader*)sector = *pImageHeader; /* copy header into sector
423 buffer */
424 read = rb->read(fd, sector + sizeof(tImageHeader),
425 SECTORSIZE - sizeof(tImageHeader)); /* payload behind */
426 size -= read;
427 read += sizeof(tImageHeader); /* to be programmed, but not part of the
428 file */
429
430 do {
431 if (!EraseSector(pos))
432 {
433 /* nothing we can do, let the programming count the errors */
434 }
435
436 for (i=0; i<read; i++)
437 {
438 if (!ProgramByte(pos + i, sector[i]))
439 {
440 failures++;
441 }
442 }
443
444 pos += SECTORSIZE;
445 read = rb->read(fd, sector, (size > SECTORSIZE) ? SECTORSIZE : size);
446 /* payload for next sector */
447 size -= read;
448 } while (read > 0);
449
450 rb->close(fd);
451
452 return failures;
453}
454
455/* returns the # of failures, 0 on success */
456static unsigned VerifyImageFile(char* filename, UINT8* pos,
457 tImageHeader* pImageHeader,
458 int start, int size)
459{
460 int i;
461 int fd;
462 int read; /* how many for this sector */
463 unsigned failures = 0;
464
465 fd = rb->open(filename, O_RDONLY);
466 if (fd < 0)
467 return false;
468
469 /* no error checking necessary here, we checked for minimum size
470 already */
471 rb->lseek(fd, start, SEEK_SET); /* go to start position */
472
473 *(tImageHeader*)sector = *pImageHeader; /* copy header into sector
474 buffer */
475 read = rb->read(fd, sector + sizeof(tImageHeader),
476 SECTORSIZE - sizeof(tImageHeader)); /* payload behind */
477
478 size -= read;
479 read += sizeof(tImageHeader); /* to be programmed, but not part of the
480 file */
481
482 do
483 {
484 for (i=0; i<read; i++)
485 {
486 if (pos[i] != sector[i])
487 {
488 failures++;
489 }
490 }
491
492 pos += SECTORSIZE;
493 read = rb->read(fd, sector, (size > SECTORSIZE) ? SECTORSIZE : size);
494 /* payload for next sector */
495 size -= read;
496 } while (read);
497
498 rb->close(fd);
499
500 return failures;
501}
502
503
504/***************** User Interface Functions *****************/
505
506static int WaitForButton(void)
507{
508 int button;
509
510 do
511 {
512 button = rb->button_get(true);
513 } while (IS_SYSEVENT(button) || (button & BUTTON_REL));
514
515 return button;
516}
517
518#ifdef HAVE_LCD_BITMAP
519/* helper for DoUserDialog() */
520static void ShowFlashInfo(tFlashInfo* pInfo, tImageHeader* pImageHeader)
521{
522 char buf[32];
523
524 if (!pInfo->manufacturer)
525 {
526 rb->lcd_puts_scroll(0, 0, "Flash: M=?? D=??");
527 }
528 else
529 {
530 if (pInfo->size)
531 {
532 rb->snprintf(buf, sizeof(buf), "Flash size: %d KB",
533 pInfo->size / 1024);
534 rb->lcd_puts_scroll(0, 0, buf);
535 }
536 else
537 {
538 rb->lcd_puts_scroll(0, 0, "Unsupported chip");
539 }
540
541 }
542
543 if (pImageHeader)
544 {
545 rb->snprintf(buf, sizeof(buf), "Image at %d KB",
546 ((UINT8*)pImageHeader - FB) / 1024);
547 rb->lcd_puts_scroll(0, 1, buf);
548 }
549 else
550 {
551 rb->lcd_puts_scroll(0, 1, "No image found!");
552 }
553}
554
555
556/* Kind of our main function, defines the application flow. */
557/* recorder version */
558static void DoUserDialog(char* filename)
559{
560 tImageHeader ImageHeader;
561 tFlashInfo FlashInfo;
562 int button;
563 int rc; /* generic return code */
564 UINT32 space, aligned_size, true_size;
565 UINT8* pos;
566 size_t memleft;
567 unsigned bl_version;
568 bool show_greet = false;
569
570 /* this can only work if Rockbox runs in DRAM, not flash ROM */
571 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
572 { /* we're running from flash */
573 rb->splash(HZ*3, "Not from ROM");
574 return; /* exit */
575 }
576
577 /* refuse to work if the power may fail meanwhile */
578 if (!rb->battery_level_safe())
579 {
580 rb->splash(HZ*3, "Battery too low!");
581 return; /* exit */
582 }
583
584 /* "allocate" memory */
585 sector = rb->plugin_get_buffer(&memleft);
586 if (memleft < SECTORSIZE) /* need buffer for a flash sector */
587 {
588 rb->splash(HZ*3, "Out of memory");
589 return; /* exit */
590 }
591
592 rb->lcd_setfont(FONT_SYSFIXED);
593
594 pos = (void*)GetSecondImage();
595 rc = GetFlashInfo(&FlashInfo);
596
597 ShowFlashInfo(&FlashInfo, (void*)pos);
598 rb->lcd_update();
599
600 if (FlashInfo.size == 0) /* no valid chip */
601 {
602 rb->splash(HZ*3, "Not flashable");
603 return; /* exit */
604 }
605 else if (pos == 0)
606 {
607 rb->splash(HZ*3, "No image");
608 return; /* exit */
609 }
610
611 bl_version = BootloaderVersion();
612 /* Upgrade currently not recommended for FM and V2
613 recorder due to bugs in V3 BootBox. (FS#12426) */
614#if !defined(ARCHOS_FMRECORDER) && !defined(ARCHOS_RECORDERV2)
615 if (bl_version < LATEST_BOOTLOADER_VERSION)
616 {
617 rb->lcd_putsf(0, 0, "Bootloader V%d", bl_version);
618 rb->lcd_puts(0, 1, "Hint: You're not ");
619 rb->lcd_puts(0, 2, "using the latest ");
620 rb->lcd_puts(0, 3, "bootloader. ");
621 rb->lcd_puts(0, 4, "A full reflash is ");
622 rb->lcd_puts(0, 5, "recommended. ");
623 rb->lcd_puts(0, 6, "Press " KEYNAME1 " to ignore");
624 rb->lcd_update();
625
626 if (WaitForButton() != KEY1)
627 {
628 return;
629 }
630 rb->lcd_clear_display();
631 }
632#endif
633
634 rb->lcd_puts(0, show_greet ? 0 : 3, "Checking...");
635 rb->lcd_update();
636
637 space = FlashInfo.size - (pos-FB + sizeof(ImageHeader));
638 /* size minus start */
639
640 rc = CheckImageFile(filename, space, &ImageHeader, pos);
641 if (rc != eOK)
642 {
643 rb->lcd_clear_display(); /* make room for error message */
644 show_greet = true; /* verbose */
645 }
646
647 rb->lcd_puts(0, show_greet ? 0 : 3, "Checked:");
648 switch (rc) {
649 case eOK:
650 rb->lcd_puts(0, show_greet ? 0 : 4, "File OK.");
651 break;
652 case eNotUCL:
653 rb->lcd_puts(0, 1, "File not UCL ");
654 rb->lcd_puts(0, 2, "compressed.");
655 rb->lcd_puts(0, 3, "Use uclpack --2e");
656 rb->lcd_puts(0, 4, " --10 rockbox.bin");
657 break;
658 case eWrongAlgorithm:
659 rb->lcd_puts(0, 1, "Wrong algorithm");
660 rb->lcd_puts(0, 2, "for compression.");
661 rb->lcd_puts(0, 3, "Use uclpack --2e");
662 rb->lcd_puts(0, 4, " --10 rockbox.bin");
663 break;
664 case eFileNotFound:
665 rb->lcd_puts(0, 1, "File not found:");
666 rb->lcd_puts_scroll(0, 2, filename);
667 break;
668 case eTooBig:
669 rb->lcd_puts(0, 1, "File too big,");
670 rb->lcd_puts(0, 2, "won't fit in chip.");
671 if (bl_version < LATEST_BOOTLOADER_VERSION)
672 {
673 rb->lcd_puts(0, 3, "Upgrade bootloader");
674 }
675 break;
676 case eTooSmall:
677 rb->lcd_puts(0, 1, "File too small.");
678 rb->lcd_puts(0, 2, "Incomplete?");
679 break;
680 case eReadErr:
681 rb->lcd_puts(0, 1, "File read error.");
682 break;
683 case eMultiBlocks:
684 rb->lcd_puts(0, 1, "File invalid.");
685 rb->lcd_puts(0, 2, "Blocksize");
686 rb->lcd_puts(0, 3, " too small?");
687 break;
688 case eBadRomLink:
689 rb->lcd_puts(0, 1, "Bootloader not");
690 rb->lcd_puts(0, 2, "compatible with");
691 rb->lcd_puts(0, 3, "RomBox. Start");
692 rb->lcd_puts(0, 4, "address mismatch.");
693 break;
694 default:
695 rb->lcd_puts(0, 1, "Check failed.");
696 break;
697 }
698
699 if (rc == eOK)
700 { /* was OK */
701 rb->lcd_puts(0, 6, "[" KEYNAME2 "] to program");
702 rb->lcd_puts(0, 7, "other key to exit");
703 }
704 else
705 { /* error occured */
706 rb->lcd_puts(0, 6, "Any key to exit");
707 }
708 rb->lcd_update();
709
710 button = WaitForButton();
711 if (rc != eOK || button != KEY2)
712 {
713 return;
714 }
715
716 true_size = ImageHeader.size;
717 aligned_size = ((sizeof(tImageHeader) + true_size + SECTORSIZE-1) &
718 ~(SECTORSIZE-1)) - sizeof(tImageHeader); /* round up to
719 next flash
720 sector */
721 ImageHeader.size = aligned_size; /* increase image size such that we reach
722 the next sector */
723
724 rb->lcd_clear_display();
725 rb->lcd_puts_scroll(0, 0, "Programming...");
726 rb->lcd_update();
727
728 rc = ProgramImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
729 if (rc)
730 { /* errors */
731 rb->lcd_clear_display();
732 rb->lcd_puts(0, 0, "Error:");
733 rb->lcd_puts(0, 1, "Programming fail!");
734 rb->lcd_putsf(0, 2, "%d errors", rc);
735 rb->lcd_update();
736 button = WaitForButton();
737 }
738
739 rb->lcd_clear_display();
740 rb->lcd_puts_scroll(0, 0, "Verifying...");
741 rb->lcd_update();
742
743 rc = VerifyImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
744
745 rb->lcd_clear_display();
746 if (rc == 0)
747 {
748 rb->lcd_puts(0, 0, "Verify OK.");
749 }
750 else
751 {
752 rb->lcd_puts(0, 0, "Error:");
753 rb->lcd_puts(0, 1, "Verify fail!");
754 rb->lcd_putsf(0, 2, "%d errors", rc);
755 rb->lcd_puts(0, 3, "Use safe image");
756 rb->lcd_puts(0, 4, "if booting hangs:");
757 rb->lcd_puts(0, 5, "F1 during power-on");
758 }
759 rb->lcd_puts(0, 7, "Any key to exit");
760 rb->lcd_update();
761 WaitForButton();
762}
763
764#else /* #ifdef HAVE_LCD_BITMAP */
765
766/* Player version */
767static void DoUserDialog(char* filename)
768{
769 tImageHeader ImageHeader;
770 tFlashInfo FlashInfo;
771 static char buf[MAX_PATH];
772 int button;
773 int rc; /* generic return code */
774 UINT32 space, aligned_size, true_size;
775 UINT8* pos;
776 size_t memleft;
777 unsigned bl_version;
778
779 /* this can only work if Rockbox runs in DRAM, not flash ROM */
780 if ((UINT8*)rb >= FB && (UINT8*)rb < FB + 4096*1024) /* 4 MB max */
781 { /* we're running from flash */
782 rb->splash(HZ*3, "Not from ROM");
783 return; /* exit */
784 }
785
786 /* refuse to work if the power may fail meanwhile */
787 if (!rb->battery_level_safe())
788 {
789 rb->splash(HZ*3, "Batt. too low!");
790 return; /* exit */
791 }
792
793 /* "allocate" memory */
794 sector = rb->plugin_get_buffer(&memleft);
795 if (memleft < SECTORSIZE) /* need buffer for a flash sector */
796 {
797 rb->splash(HZ*3, "Out of memory");
798 return; /* exit */
799 }
800
801 pos = (void*)GetSecondImage();
802 rc = GetFlashInfo(&FlashInfo);
803
804 if (FlashInfo.size == 0) /* no valid chip */
805 {
806 rb->splash(HZ*3, "Not flashable");
807 return; /* exit */
808 }
809 else if (pos == 0)
810 {
811 rb->splash(HZ*3, "No image");
812 return; /* exit */
813 }
814
815 bl_version = BootloaderVersion();
816 if (bl_version < LATEST_BOOTLOADER_VERSION)
817 {
818 rb->lcd_puts_scroll(0, 0, "Hint: You're not using the latest bootloader. A full reflash is recommended, but not required.");
819 rb->lcd_puts_scroll(0, 1, "Press [Menu] to ignore");
820 rb->lcd_update();
821
822 if (WaitForButton() != BUTTON_MENU)
823 {
824 return;
825 }
826 rb->lcd_clear_display();
827 }
828
829 rb->lcd_puts(0, 0, "Checking...");
830 rb->lcd_update();
831
832 space = FlashInfo.size - (pos-FB + sizeof(ImageHeader));
833 /* size minus start */
834
835 rc = CheckImageFile(filename, space, &ImageHeader, pos);
836 rb->lcd_puts(0, 0, "Checked:");
837 switch (rc) {
838 case eOK:
839 rb->lcd_puts(0, 1, "File OK.");
840 rb->sleep(HZ*1);
841 break;
842 case eNotUCL:
843 rb->lcd_puts_scroll(0, 1, "File not UCL compressed.");
844 break;
845 case eWrongAlgorithm:
846 rb->lcd_puts_scroll(0, 1, "Wrong compression algorithm.");
847 break;
848 case eFileNotFound:
849 rb->lcd_puts_scroll(0, 1, "File not found.");
850 break;
851 case eTooBig:
852 if (bl_version < LATEST_BOOTLOADER_VERSION)
853 {
854 rb->lcd_puts_scroll(0, 1, "File too big, upgrade bootloader.");
855 }
856 else
857 {
858 rb->lcd_puts_scroll(0, 1, "File too big.");
859 }
860 break;
861 case eTooSmall:
862 rb->lcd_puts_scroll(0, 1, "File too small. Incomplete?");
863 break;
864 case eReadErr:
865 rb->lcd_puts_scroll(0, 1, "File read error.");
866 break;
867 case eMultiBlocks:
868 rb->lcd_puts_scroll(0, 1, "File invalid. Blocksize too small?");
869 break;
870 case eBadRomLink:
871 rb->lcd_puts_scroll(0, 1, "Bootloader not compatible with RomBox.");
872 break;
873 default:
874 rb->lcd_puts_scroll(0, 1, "Check failed.");
875 break;
876 }
877 rb->lcd_update();
878
879 if (rc == eOK)
880 { /* was OK */
881 rb->lcd_clear_display();
882 rb->lcd_puts_scroll(0, 0, "[ON] to program,");
883 rb->lcd_puts_scroll(0, 1, "other key to exit.");
884 }
885 else
886 { /* error occured */
887 WaitForButton();
888 rb->lcd_clear_display();
889 rb->lcd_puts_scroll(0, 0, "Flash failed.");
890 rb->lcd_puts_scroll(0, 1, "Any key to exit.");
891 }
892 rb->lcd_update();
893
894 button = WaitForButton();
895 if (rc != eOK || button != BUTTON_ON)
896 {
897 return;
898 }
899
900 true_size = ImageHeader.size;
901 aligned_size = ((sizeof(tImageHeader) + true_size + SECTORSIZE-1) &
902 ~(SECTORSIZE-1)) - sizeof(tImageHeader); /* round up to
903 next flash
904 sector */
905 ImageHeader.size = aligned_size; /* increase image size such that we reach
906 the next sector */
907
908 rb->lcd_clear_display();
909 rb->lcd_puts_scroll(0, 0, "Programming...");
910 rb->lcd_update();
911
912 rc = ProgramImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
913 if (rc)
914 { /* errors */
915 rb->lcd_clear_display();
916 rb->snprintf(buf, sizeof(buf), "%d errors", rc);
917 rb->lcd_puts_scroll(0, 0, "Programming failed!");
918 rb->lcd_puts_scroll(0, 1, buf);
919 rb->lcd_update();
920 button = WaitForButton();
921 }
922
923 rb->lcd_clear_display();
924 rb->lcd_puts_scroll(0, 0, "Verifying...");
925 rb->lcd_update();
926
927 rc = VerifyImageFile(filename, pos, &ImageHeader, UCL_HEADER, true_size);
928
929 rb->lcd_clear_display();
930 if (rc == 0)
931 {
932 rb->lcd_puts(0, 0, "Verify OK.");
933 rb->lcd_update();
934 }
935 else
936 {
937 rb->snprintf(buf, sizeof(buf), "Verify fail! %d errors", rc);
938 rb->lcd_puts_scroll(0, 0, buf);
939 rb->lcd_puts_scroll(0, 1, "Use safe image if booting hangs: [-] during power-on");
940 rb->lcd_update();
941 button = WaitForButton();
942 }
943}
944
945#endif /* not HAVE_LCD_BITMAP */
946
947
948
949/***************** Plugin Entry Point *****************/
950
951enum plugin_status plugin_start(const void* parameter)
952{
953 int oldmode;
954
955 if (parameter == NULL)
956 {
957 rb->splash(HZ*3, "Play .ucl file!");
958 return PLUGIN_OK;
959 }
960
961 /* now go ahead and have fun! */
962 oldmode = rb->system_memory_guard(MEMGUARD_NONE); /*disable memory guard */
963 DoUserDialog((char*) parameter);
964 rb->system_memory_guard(oldmode); /* re-enable memory guard */
965
966 return PLUGIN_OK;
967}
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c
index e8d43f772a..143b8fdfa8 100644
--- a/apps/plugins/rockboy/lcd.c
+++ b/apps/plugins/rockboy/lcd.c
@@ -69,7 +69,7 @@ static void updatepatpix(void) ICODE_ATTR;
69static void updatepatpix(void) 69static void updatepatpix(void)
70{ 70{
71 int i, j; 71 int i, j;
72#if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE)) 72#if !defined(CPU_COLDFIRE)
73 int k, a, c; 73 int k, a, c;
74#endif 74#endif
75 byte *vram = lcd.vbank[0]; 75 byte *vram = lcd.vbank[0];
@@ -83,76 +83,7 @@ static void updatepatpix(void)
83 patdirty[i] = 0; 83 patdirty[i] = 0;
84 for (j = 0; j < 8; j++) 84 for (j = 0; j < 8; j++)
85 { 85 {
86#if CONFIG_CPU == SH7034 86#if defined(CPU_COLDFIRE)
87 asm volatile (
88 "mov.w @%2,r1 \n"
89 "swap.b r1,r2 \n"
90
91 "mov #0,r0 \n"
92 "shlr r1 \n"
93 "rotcl r0 \n"
94 "shlr r2 \n"
95 "rotcl r0 \n"
96 "mov.b r0,@%0 \n"
97 "mov.b r0,@(7,%1) \n"
98 "mov #0,r0 \n"
99 "shlr r1 \n"
100 "rotcl r0 \n"
101 "shlr r2 \n"
102 "rotcl r0 \n"
103 "mov.b r0,@(1,%0) \n"
104 "mov.b r0,@(6,%1) \n"
105 "mov #0,r0 \n"
106 "shlr r1 \n"
107 "rotcl r0 \n"
108 "shlr r2 \n"
109 "rotcl r0 \n"
110 "mov.b r0,@(2,%0) \n"
111 "mov.b r0,@(5,%1) \n"
112 "mov #0,r0 \n"
113 "shlr r1 \n"
114 "rotcl r0 \n"
115 "shlr r2 \n"
116 "rotcl r0 \n"
117 "mov.b r0,@(3,%0) \n"
118 "mov.b r0,@(4,%1) \n"
119 "mov #0,r0 \n"
120 "shlr r1 \n"
121 "rotcl r0 \n"
122 "shlr r2 \n"
123 "rotcl r0 \n"
124 "mov.b r0,@(4,%0) \n"
125 "mov.b r0,@(3,%1) \n"
126 "mov #0,r0 \n"
127 "shlr r1 \n"
128 "rotcl r0 \n"
129 "shlr r2 \n"
130 "rotcl r0 \n"
131 "mov.b r0,@(5,%0) \n"
132 "mov.b r0,@(2,%1) \n"
133 "mov #0,r0 \n"
134 "shlr r1 \n"
135 "rotcl r0 \n"
136 "shlr r2 \n"
137 "rotcl r0 \n"
138 "mov.b r0,@(6,%0) \n"
139 "mov.b r0,@(1,%1) \n"
140 "mov #0,r0 \n"
141 "shlr r1 \n"
142 "rotcl r0 \n"
143 "shlr r2 \n"
144 "rotcl r0 \n"
145 "mov.b r0,@(7,%0) \n"
146 "mov.b r0,@%1 \n"
147 : /* outputs */
148 : /* inputs */
149 /* %0 */ "r"(patpix[i+1024][j]),
150 /* %1 */ "r"(patpix[i][j]),
151 /* %2 */ "r"(&vram[(i<<4)|(j<<1)])
152 : /* clobbers */
153 "r0", "r1", "r2"
154 );
155#elif defined(CPU_COLDFIRE)
156 asm volatile ( 87 asm volatile (
157 "move.b (%2),%%d2 \n" 88 "move.b (%2),%%d2 \n"
158 "move.b (1,%2),%%d1 \n" 89 "move.b (1,%2),%%d1 \n"
@@ -229,85 +160,7 @@ static void updatepatpix(void)
229 patpix[i+1024][j][7-k]; 160 patpix[i+1024][j][7-k];
230#endif 161#endif
231 } 162 }
232#if CONFIG_CPU == SH7034 163#if defined(CPU_COLDFIRE)
233 asm volatile (
234 "mov.l @%0,r0 \n"
235 "mov.l @(4,%0),r1 \n"
236 "mov.l r0,@(56,%1) \n"
237 "mov.l r1,@(60,%1) \n"
238 "mov.l @(8,%0),r0 \n"
239 "mov.l @(12,%0),r1 \n"
240 "mov.l r0,@(48,%1) \n"
241 "mov.l r1,@(52,%1) \n"
242 "mov.l @(16,%0),r0 \n"
243 "mov.l @(20,%0),r1 \n"
244 "mov.l r0,@(40,%1) \n"
245 "mov.l r1,@(44,%1) \n"
246 "mov.l @(24,%0),r0 \n"
247 "mov.l @(28,%0),r1 \n"
248 "mov.l r0,@(32,%1) \n"
249 "mov.l r1,@(36,%1) \n"
250 "mov.l @(32,%0),r0 \n"
251 "mov.l @(36,%0),r1 \n"
252 "mov.l r0,@(24,%1) \n"
253 "mov.l r1,@(28,%1) \n"
254 "mov.l @(40,%0),r0 \n"
255 "mov.l @(44,%0),r1 \n"
256 "mov.l r0,@(16,%1) \n"
257 "mov.l r1,@(20,%1) \n"
258 "mov.l @(48,%0),r0 \n"
259 "mov.l @(52,%0),r1 \n"
260 "mov.l r0,@(8,%1) \n"
261 "mov.l r1,@(12,%1) \n"
262 "mov.l @(56,%0),r0 \n"
263 "mov.l @(60,%0),r1 \n"
264 "mov.l r0,@%1 \n"
265 "mov.l r1,@(4,%1) \n"
266
267 "add %2,%0 \n"
268 "add %2,%1 \n"
269
270 "mov.l @%0,r0 \n"
271 "mov.l @(4,%0),r1 \n"
272 "mov.l r0,@(56,%1) \n"
273 "mov.l r1,@(60,%1) \n"
274 "mov.l @(8,%0),r0 \n"
275 "mov.l @(12,%0),r1 \n"
276 "mov.l r0,@(48,%1) \n"
277 "mov.l r1,@(52,%1) \n"
278 "mov.l @(16,%0),r0 \n"
279 "mov.l @(20,%0),r1 \n"
280 "mov.l r0,@(40,%1) \n"
281 "mov.l r1,@(44,%1) \n"
282 "mov.l @(24,%0),r0 \n"
283 "mov.l @(28,%0),r1 \n"
284 "mov.l r0,@(32,%1) \n"
285 "mov.l r1,@(36,%1) \n"
286 "mov.l @(32,%0),r0 \n"
287 "mov.l @(36,%0),r1 \n"
288 "mov.l r0,@(24,%1) \n"
289 "mov.l r1,@(28,%1) \n"
290 "mov.l @(40,%0),r0 \n"
291 "mov.l @(44,%0),r1 \n"
292 "mov.l r0,@(16,%1) \n"
293 "mov.l r1,@(20,%1) \n"
294 "mov.l @(48,%0),r0 \n"
295 "mov.l @(52,%0),r1 \n"
296 "mov.l r0,@(8,%1) \n"
297 "mov.l r1,@(12,%1) \n"
298 "mov.l @(56,%0),r0 \n"
299 "mov.l @(60,%0),r1 \n"
300 "mov.l r0,@%1 \n"
301 "mov.l r1,@(4,%1) \n"
302 : /* outputs */
303 : /* inputs */
304 /* %0 */ "r"(patpix[i][0]),
305 /* %1 */ "r"(patpix[i+2048][0]),
306 /* %2 */ "r"(1024*64)
307 : /* clobbers */
308 "r0", "r1"
309 );
310#elif defined(CPU_COLDFIRE)
311 asm volatile ( 164 asm volatile (
312 "movem.l (%0),%%d0-%%d3 \n" 165 "movem.l (%0),%%d0-%%d3 \n"
313 "move.l %%d0,%%d4 \n" 166 "move.l %%d0,%%d4 \n"
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index f188dc1e24..57f0c95ea6 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -110,16 +110,6 @@ static void setoptions (void)
110 options.SELECT = BUTTON_SELECT; 110 options.SELECT = BUTTON_SELECT;
111 options.MENU = BUTTON_OFF; 111 options.MENU = BUTTON_OFF;
112 112
113#elif CONFIG_KEYPAD == RECORDER_PAD
114 options.UP = BUTTON_UP;
115 options.DOWN = BUTTON_DOWN;
116
117 options.A = BUTTON_F1;
118 options.B = BUTTON_F2;
119 options.START = BUTTON_F3;
120 options.SELECT = BUTTON_PLAY;
121 options.MENU = BUTTON_OFF;
122
123#elif CONFIG_KEYPAD == IPOD_4G_PAD 113#elif CONFIG_KEYPAD == IPOD_4G_PAD
124 options.UP = BUTTON_MENU; 114 options.UP = BUTTON_MENU;
125 options.DOWN = BUTTON_PLAY; 115 options.DOWN = BUTTON_PLAY;
diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c
index 3a1f3c6760..e27cbbe3e7 100644
--- a/apps/plugins/rockboy/sys_rockbox.c
+++ b/apps/plugins/rockboy/sys_rockbox.c
@@ -91,9 +91,6 @@ void ev_poll(void)
91 if (rb->button_hold()&~holdbutton) 91 if (rb->button_hold()&~holdbutton)
92 fb.mode=(fb.mode+1)%4; 92 fb.mode=(fb.mode+1)%4;
93 holdbutton=rb->button_hold(); 93 holdbutton=rb->button_hold();
94#elif CONFIG_KEYPAD == RECORDER_PAD
95 if (pressed & BUTTON_ON)
96 fb.mode=(fb.mode+1)%4;
97#endif 94#endif
98 95
99#ifdef HAVE_WHEEL_POSITION 96#ifdef HAVE_WHEEL_POSITION
@@ -220,12 +217,10 @@ void ev_poll(void)
220#else 217#else
221 if(pressed & options.MENU) { 218 if(pressed & options.MENU) {
222#endif 219#endif
223#if (CONFIG_KEYPAD != RECORDER_PAD)
224#ifdef HAVE_WHEEL_POSITION 220#ifdef HAVE_WHEEL_POSITION
225 rb->wheel_send_events(true); 221 rb->wheel_send_events(true);
226#endif 222#endif
227 if (do_user_menu() == USER_MENU_QUIT) 223 if (do_user_menu() == USER_MENU_QUIT)
228#endif
229 { 224 {
230 die(""); 225 die("");
231 cleanshut=1; 226 cleanshut=1;
@@ -300,54 +295,6 @@ void vid_update(int scanline)
300 balance += LCD_WIDTH; 295 balance += LCD_WIDTH;
301 if (balance > 0) 296 if (balance > 0)
302 { 297 {
303#if (CONFIG_CPU == SH7034) && !defined(SIMULATOR)
304 asm volatile (
305 "mov.b @%0,r0 \n"
306 "add %1,%0 \n"
307 "tst #0x02, r0 \n" /* ~bit 1 */
308 "rotcr r1 \n"
309 "mov.b @%0,r0 \n"
310 "add %1,%0 \n"
311 "tst #0x02, r0 \n" /* ~bit 1 */
312 "rotcr r1 \n"
313 "mov.b @%0,r0 \n"
314 "add %1,%0 \n"
315 "tst #0x02, r0 \n" /* ~bit 1 */
316 "rotcr r1 \n"
317 "mov.b @%0,r0 \n"
318 "add %1,%0 \n"
319 "tst #0x02, r0 \n" /* ~bit 1 */
320 "rotcr r1 \n"
321 "mov.b @%0,r0 \n"
322 "add %1,%0 \n"
323 "tst #0x02, r0 \n" /* ~bit 1 */
324 "rotcr r1 \n"
325 "mov.b @%0,r0 \n"
326 "add %1,%0 \n"
327 "tst #0x02, r0 \n" /* ~bit 1 */
328 "rotcr r1 \n"
329 "mov.b @%0,r0 \n"
330 "add %1,%0 \n"
331 "tst #0x02, r0 \n" /* ~bit 1 */
332 "rotcr r1 \n"
333 "mov.b @%0,r0 \n"
334 "add %1,%0 \n"
335 "tst #0x02, r0 \n" /* ~bit 1 */
336 "rotcr r1 \n"
337
338 "shlr16 r1 \n"
339 "shlr8 r1 \n"
340 "not r1,r1 \n" /* account for negated bits */
341 "mov.b r1,@%2 \n"
342 : /* outputs */
343 : /* inputs */
344 /* %0 */ "r"(scan.buf[0] + cnt),
345 /* %1 */ "r"(256), /* scan.buf line length */
346 /* %2 */ "r"(frameb++)
347 : /* clobbers */
348 "r0", "r1"
349 );
350#else
351 register unsigned scrbyte = 0; 298 register unsigned scrbyte = 0;
352 if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01; 299 if (scan.buf[0][cnt] & 0x02) scrbyte |= 0x01;
353 if (scan.buf[1][cnt] & 0x02) scrbyte |= 0x02; 300 if (scan.buf[1][cnt] & 0x02) scrbyte |= 0x02;
@@ -358,7 +305,6 @@ void vid_update(int scanline)
358 if (scan.buf[6][cnt] & 0x02) scrbyte |= 0x40; 305 if (scan.buf[6][cnt] & 0x02) scrbyte |= 0x40;
359 if (scan.buf[7][cnt] & 0x02) scrbyte |= 0x80; 306 if (scan.buf[7][cnt] & 0x02) scrbyte |= 0x80;
360 *(frameb++) = scrbyte; 307 *(frameb++) = scrbyte;
361#endif
362 balance -= 160; 308 balance -= 160;
363 } 309 }
364 cnt ++; 310 cnt ++;
diff --git a/apps/plugins/sliding_puzzle.c b/apps/plugins/sliding_puzzle.c
index ad856b8ab2..1a77eda721 100644
--- a/apps/plugins/sliding_puzzle.c
+++ b/apps/plugins/sliding_puzzle.c
@@ -21,26 +21,7 @@
21#include "plugin.h" 21#include "plugin.h"
22 22
23/* variable button definitions */ 23/* variable button definitions */
24#if CONFIG_KEYPAD == RECORDER_PAD 24#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
25#define PUZZLE_QUIT BUTTON_OFF
26#define PUZZLE_LEFT BUTTON_LEFT
27#define PUZZLE_RIGHT BUTTON_RIGHT
28#define PUZZLE_UP BUTTON_UP
29#define PUZZLE_DOWN BUTTON_DOWN
30#define PUZZLE_SHUFFLE BUTTON_F1
31#define PUZZLE_PICTURE BUTTON_F2
32
33#elif CONFIG_KEYPAD == ONDIO_PAD
34#define PUZZLE_QUIT BUTTON_OFF
35#define PUZZLE_LEFT BUTTON_LEFT
36#define PUZZLE_RIGHT BUTTON_RIGHT
37#define PUZZLE_UP BUTTON_UP
38#define PUZZLE_DOWN BUTTON_DOWN
39#define PUZZLE_SHUFFLE_PICTURE_PRE BUTTON_MENU
40#define PUZZLE_SHUFFLE (BUTTON_MENU | BUTTON_REPEAT)
41#define PUZZLE_PICTURE (BUTTON_MENU | BUTTON_REL)
42
43#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
44 (CONFIG_KEYPAD == IRIVER_H300_PAD) 25 (CONFIG_KEYPAD == IRIVER_H300_PAD)
45#define PUZZLE_QUIT BUTTON_OFF 26#define PUZZLE_QUIT BUTTON_OFF
46#define PUZZLE_LEFT BUTTON_LEFT 27#define PUZZLE_LEFT BUTTON_LEFT
@@ -853,15 +834,7 @@ enum plugin_status plugin_start(
853 /* print instructions */ 834 /* print instructions */
854 rb->lcd_clear_display(); 835 rb->lcd_clear_display();
855 rb->lcd_setfont(FONT_SYSFIXED); 836 rb->lcd_setfont(FONT_SYSFIXED);
856#if CONFIG_KEYPAD == RECORDER_PAD 837#if (CONFIG_KEYPAD == IPOD_4G_PAD) || \
857 rb->lcd_putsxy(3, 18, "[OFF] to stop");
858 rb->lcd_putsxy(3, 28, "[F1] shuffle");
859 rb->lcd_putsxy(3, 38, "[F2] change pic");
860#elif CONFIG_KEYPAD == ONDIO_PAD
861 rb->lcd_putsxy(0, 18, "[OFF] to stop");
862 rb->lcd_putsxy(0, 28, "[MODE..] shuffle");
863 rb->lcd_putsxy(0, 38, "[MODE] change pic");
864#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
865 (CONFIG_KEYPAD == IPOD_3G_PAD) || \ 838 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
866 (CONFIG_KEYPAD == IPOD_1G2G_PAD) 839 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
867 rb->lcd_putsxy(0, 18, "[S-MENU] to stop"); 840 rb->lcd_putsxy(0, 18, "[S-MENU] to stop");
diff --git a/apps/plugins/snake.c b/apps/plugins/snake.c
index f60ddfe3de..4471cd12a6 100644
--- a/apps/plugins/snake.c
+++ b/apps/plugins/snake.c
@@ -41,24 +41,8 @@ dir is the current direction of the snake - 0=up, 1=right, 2=down, 3=left;
41 41
42 42
43/* variable button definitions */ 43/* variable button definitions */
44#if CONFIG_KEYPAD == RECORDER_PAD 44#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
45#define SNAKE_QUIT BUTTON_OFF 45 (CONFIG_KEYPAD == IRIVER_H300_PAD)
46#define SNAKE_LEFT BUTTON_LEFT
47#define SNAKE_RIGHT BUTTON_RIGHT
48#define SNAKE_UP BUTTON_UP
49#define SNAKE_DOWN BUTTON_DOWN
50#define SNAKE_PLAYPAUSE BUTTON_PLAY
51
52#elif CONFIG_KEYPAD == ONDIO_PAD
53#define SNAKE_QUIT BUTTON_OFF
54#define SNAKE_LEFT BUTTON_LEFT
55#define SNAKE_RIGHT BUTTON_RIGHT
56#define SNAKE_UP BUTTON_UP
57#define SNAKE_DOWN BUTTON_DOWN
58#define SNAKE_PLAYPAUSE BUTTON_MENU
59
60#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
61 (CONFIG_KEYPAD == IRIVER_H300_PAD)
62#define SNAKE_QUIT BUTTON_OFF 46#define SNAKE_QUIT BUTTON_OFF
63#define SNAKE_LEFT BUTTON_LEFT 47#define SNAKE_LEFT BUTTON_LEFT
64#define SNAKE_RIGHT BUTTON_RIGHT 48#define SNAKE_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/snake2.c b/apps/plugins/snake2.c
index dcb5b72633..bfff0bf870 100644
--- a/apps/plugins/snake2.c
+++ b/apps/plugins/snake2.c
@@ -150,26 +150,8 @@ Head and Tail are stored
150#endif 150#endif
151 151
152/* variable button definitions */ 152/* variable button definitions */
153#if CONFIG_KEYPAD == RECORDER_PAD 153#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
154#define SNAKE2_LEFT BUTTON_LEFT 154 (CONFIG_KEYPAD == IRIVER_H300_PAD)
155#define SNAKE2_RIGHT BUTTON_RIGHT
156#define SNAKE2_UP BUTTON_UP
157#define SNAKE2_DOWN BUTTON_DOWN
158#define SNAKE2_QUIT BUTTON_OFF
159#define SNAKE2_PLAYPAUSE BUTTON_PLAY
160#define SNAKE2_PLAYPAUSE_TEXT "Play"
161
162#elif CONFIG_KEYPAD == ONDIO_PAD
163#define SNAKE2_LEFT BUTTON_LEFT
164#define SNAKE2_RIGHT BUTTON_RIGHT
165#define SNAKE2_UP BUTTON_UP
166#define SNAKE2_DOWN BUTTON_DOWN
167#define SNAKE2_QUIT BUTTON_OFF
168#define SNAKE2_PLAYPAUSE BUTTON_MENU
169#define SNAKE2_PLAYPAUSE_TEXT "Menu"
170
171#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
172 (CONFIG_KEYPAD == IRIVER_H300_PAD)
173#define SNAKE2_LEFT BUTTON_LEFT 155#define SNAKE2_LEFT BUTTON_LEFT
174#define SNAKE2_RIGHT BUTTON_RIGHT 156#define SNAKE2_RIGHT BUTTON_RIGHT
175#define SNAKE2_UP BUTTON_UP 157#define SNAKE2_UP BUTTON_UP
diff --git a/apps/plugins/sokoban.c b/apps/plugins/sokoban.c
index 62812e0237..3cc1555e83 100644
--- a/apps/plugins/sokoban.c
+++ b/apps/plugins/sokoban.c
@@ -64,11 +64,7 @@
64#endif 64#endif
65 65
66/* size of code+bss */ 66/* size of code+bss */
67#if CONFIG_CPU == SH7034
68#define CODE_SIZE 0x3000 /* 12k */
69#else
70#define CODE_SIZE 0x5000 /* 20k */ 67#define CODE_SIZE 0x5000 /* 20k */
71#endif
72 68
73#define CODE_AND_UNDO_SIZE (CODE_SIZE+0x1000) /* + 4k */ 69#define CODE_AND_UNDO_SIZE (CODE_SIZE+0x1000) /* + 4k */
74 70
@@ -104,39 +100,8 @@
104#define SOKOBAN_MOVE_MIN SOKOBAN_MOVE_DOWN 100#define SOKOBAN_MOVE_MIN SOKOBAN_MOVE_DOWN
105 101
106/* variable button definitions */ 102/* variable button definitions */
107#if (CONFIG_KEYPAD == RECORDER_PAD) 103#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
108#define SOKOBAN_LEFT BUTTON_LEFT 104 (CONFIG_KEYPAD == IRIVER_H300_PAD)
109#define SOKOBAN_RIGHT BUTTON_RIGHT
110#define SOKOBAN_UP BUTTON_UP
111#define SOKOBAN_DOWN BUTTON_DOWN
112#define SOKOBAN_MENU BUTTON_OFF
113#define SOKOBAN_UNDO BUTTON_ON
114#define SOKOBAN_REDO BUTTON_PLAY
115#define SOKOBAN_LEVEL_DOWN BUTTON_F1
116#define SOKOBAN_LEVEL_REPEAT BUTTON_F2
117#define SOKOBAN_LEVEL_UP BUTTON_F3
118#define SOKOBAN_PAUSE BUTTON_PLAY
119#define BUTTON_SAVE BUTTON_ON
120#define BUTTON_SAVE_NAME "ON"
121
122#elif CONFIG_KEYPAD == ONDIO_PAD
123#define SOKOBAN_LEFT BUTTON_LEFT
124#define SOKOBAN_RIGHT BUTTON_RIGHT
125#define SOKOBAN_UP BUTTON_UP
126#define SOKOBAN_DOWN BUTTON_DOWN
127#define SOKOBAN_MENU BUTTON_OFF
128#define SOKOBAN_UNDO_PRE BUTTON_MENU
129#define SOKOBAN_UNDO (BUTTON_MENU | BUTTON_REL)
130#define SOKOBAN_REDO (BUTTON_MENU | BUTTON_DOWN)
131#define SOKOBAN_LEVEL_DOWN (BUTTON_MENU | BUTTON_LEFT)
132#define SOKOBAN_LEVEL_REPEAT (BUTTON_MENU | BUTTON_UP)
133#define SOKOBAN_LEVEL_UP (BUTTON_MENU | BUTTON_RIGHT)
134#define SOKOBAN_PAUSE BUTTON_MENU
135#define BUTTON_SAVE BUTTON_MENU
136#define BUTTON_SAVE_NAME "MENU"
137
138#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
139 (CONFIG_KEYPAD == IRIVER_H300_PAD)
140#define SOKOBAN_LEFT BUTTON_LEFT 105#define SOKOBAN_LEFT BUTTON_LEFT
141#define SOKOBAN_RIGHT BUTTON_RIGHT 106#define SOKOBAN_RIGHT BUTTON_RIGHT
142#define SOKOBAN_UP BUTTON_UP 107#define SOKOBAN_UP BUTTON_UP
@@ -1642,22 +1607,8 @@ static int sokoban_menu(void)
1642 rb->screens[i]->clear_display(); 1607 rb->screens[i]->clear_display();
1643 rb->lcd_setfont(SOKOBAN_FONT); 1608 rb->lcd_setfont(SOKOBAN_FONT);
1644 1609
1645#if (CONFIG_KEYPAD == RECORDER_PAD) 1610#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
1646 rb->lcd_putsxy(3, 6, "[OFF] Menu"); 1611 (CONFIG_KEYPAD == IRIVER_H300_PAD)
1647 rb->lcd_putsxy(3, 16, "[ON] Undo");
1648 rb->lcd_putsxy(3, 26, "[PLAY] Redo");
1649 rb->lcd_putsxy(3, 36, "[F1] Down a Level");
1650 rb->lcd_putsxy(3, 46, "[F2] Restart Level");
1651 rb->lcd_putsxy(3, 56, "[F3] Up a Level");
1652#elif CONFIG_KEYPAD == ONDIO_PAD
1653 rb->lcd_putsxy(3, 6, "[OFF] Menu");
1654 rb->lcd_putsxy(3, 16, "[MODE] Undo");
1655 rb->lcd_putsxy(3, 26, "[MODE+DOWN] Redo");
1656 rb->lcd_putsxy(3, 36, "[MODE+LEFT] Previous Level");
1657 rb->lcd_putsxy(3, 46, "[MODE+UP] Restart Level");
1658 rb->lcd_putsxy(3, 56, "[MODE+RIGHT] Up Level");
1659#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
1660 (CONFIG_KEYPAD == IRIVER_H300_PAD)
1661 rb->lcd_putsxy(3, 6, "[STOP] Menu"); 1612 rb->lcd_putsxy(3, 6, "[STOP] Menu");
1662 rb->lcd_putsxy(3, 16, "[REC] Undo"); 1613 rb->lcd_putsxy(3, 16, "[REC] Undo");
1663 rb->lcd_putsxy(3, 26, "[MODE] Redo"); 1614 rb->lcd_putsxy(3, 26, "[MODE] Redo");
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c
index b830edf857..a7844fba92 100644
--- a/apps/plugins/solitaire.c
+++ b/apps/plugins/solitaire.c
@@ -32,51 +32,8 @@
32 * Key definitions 32 * Key definitions
33 */ 33 */
34 34
35#if CONFIG_KEYPAD == RECORDER_PAD 35#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
36# define SOL_QUIT BUTTON_OFF 36 (CONFIG_KEYPAD == IRIVER_H300_PAD)
37# define SOL_UP BUTTON_UP
38# define SOL_DOWN BUTTON_DOWN
39# define SOL_LEFT BUTTON_LEFT
40# define SOL_RIGHT BUTTON_RIGHT
41# define SOL_MOVE BUTTON_ON
42# define SOL_DRAW BUTTON_F1
43# define SOL_REM2CUR BUTTON_PLAY
44# define SOL_CUR2STACK BUTTON_F2
45# define SOL_REM2STACK BUTTON_F3
46# define HK_MOVE "ON"
47# define HK_DRAW "F1"
48# define HK_REM2CUR "PLAY"
49# define HK_CUR2STACK "F2"
50# define HK_REM2STACK "F3"
51
52#elif CONFIG_KEYPAD == ONDIO_PAD
53# define SOL_QUIT BUTTON_OFF
54# define SOL_UP_PRE BUTTON_UP
55# define SOL_UP (BUTTON_UP | BUTTON_REL)
56# define SOL_DOWN_PRE BUTTON_DOWN
57# define SOL_DOWN (BUTTON_DOWN | BUTTON_REL)
58# define SOL_LEFT_PRE BUTTON_LEFT
59# define SOL_LEFT (BUTTON_LEFT | BUTTON_REL)
60# define SOL_RIGHT_PRE BUTTON_RIGHT
61# define SOL_RIGHT (BUTTON_RIGHT | BUTTON_REL)
62# define SOL_MOVE_PRE BUTTON_MENU
63# define SOL_MOVE (BUTTON_MENU | BUTTON_REL)
64# define SOL_DRAW_PRE BUTTON_MENU
65# define SOL_DRAW (BUTTON_MENU | BUTTON_REPEAT)
66# define SOL_REM2CUR_PRE BUTTON_DOWN
67# define SOL_REM2CUR (BUTTON_DOWN | BUTTON_REPEAT)
68# define SOL_CUR2STACK_PRE BUTTON_UP
69# define SOL_CUR2STACK (BUTTON_UP | BUTTON_REPEAT)
70# define SOL_REM2STACK_PRE BUTTON_RIGHT
71# define SOL_REM2STACK (BUTTON_RIGHT | BUTTON_REPEAT)
72# define HK_MOVE "MODE"
73# define HK_DRAW "MODE.."
74# define HK_REM2CUR "DOWN.."
75# define HK_CUR2STACK "UP.."
76# define HK_REM2STACK "RIGHT.."
77
78#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
79 (CONFIG_KEYPAD == IRIVER_H300_PAD)
80# define SOL_QUIT BUTTON_OFF 37# define SOL_QUIT BUTTON_OFF
81# define SOL_UP BUTTON_UP 38# define SOL_UP BUTTON_UP
82# define SOL_DOWN BUTTON_DOWN 39# define SOL_DOWN BUTTON_DOWN
diff --git a/apps/plugins/spacerocks.c b/apps/plugins/spacerocks.c
index ede67291b0..268c55ad35 100644
--- a/apps/plugins/spacerocks.c
+++ b/apps/plugins/spacerocks.c
@@ -28,26 +28,8 @@
28 28
29 29
30/* variable button definitions */ 30/* variable button definitions */
31#if CONFIG_KEYPAD == RECORDER_PAD 31#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
32#define AST_PAUSE BUTTON_ON 32 (CONFIG_KEYPAD == IRIVER_H300_PAD)
33#define AST_QUIT BUTTON_OFF
34#define AST_THRUST BUTTON_UP
35#define AST_HYPERSPACE BUTTON_DOWN
36#define AST_LEFT BUTTON_LEFT
37#define AST_RIGHT BUTTON_RIGHT
38#define AST_FIRE BUTTON_PLAY
39
40#elif CONFIG_KEYPAD == ONDIO_PAD
41#define AST_PAUSE (BUTTON_MENU | BUTTON_OFF)
42#define AST_QUIT BUTTON_OFF
43#define AST_THRUST BUTTON_UP
44#define AST_HYPERSPACE BUTTON_DOWN
45#define AST_LEFT BUTTON_LEFT
46#define AST_RIGHT BUTTON_RIGHT
47#define AST_FIRE BUTTON_MENU
48
49#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
50 (CONFIG_KEYPAD == IRIVER_H300_PAD)
51#define AST_PAUSE BUTTON_REC 33#define AST_PAUSE BUTTON_REC
52#define AST_QUIT BUTTON_OFF 34#define AST_QUIT BUTTON_OFF
53#define AST_THRUST BUTTON_UP 35#define AST_THRUST BUTTON_UP
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
index 539fc85011..b698e2e18a 100644
--- a/apps/plugins/splitedit.c
+++ b/apps/plugins/splitedit.c
@@ -24,27 +24,7 @@
24 24
25 25
26/* variable button definitions */ 26/* variable button definitions */
27#if CONFIG_KEYPAD == RECORDER_PAD 27#if CONFIG_KEYPAD == IRIVER_H100_PAD
28#define SPLITEDIT_QUIT BUTTON_OFF
29#define SPLITEDIT_PLAY BUTTON_PLAY
30#define SPLITEDIT_SAVE BUTTON_F1
31#define SPLITEDIT_LOOP_MODE BUTTON_F2
32#define SPLITEDIT_SCALE BUTTON_F3
33#define SPLITEDIT_SPEED50 (BUTTON_ON | BUTTON_LEFT)
34#define SPLITEDIT_SPEED100 (BUTTON_ON | BUTTON_PLAY)
35#define SPLITEDIT_SPEED150 (BUTTON_ON | BUTTON_RIGHT)
36#define SPLITEDIT_MENU_RUN BUTTON_PLAY
37
38#elif CONFIG_KEYPAD == ONDIO_PAD
39#define SPLITEDIT_QUIT BUTTON_OFF
40#define SPLITEDIT_PLAY_PRE BUTTON_MENU
41#define SPLITEDIT_PLAY (BUTTON_MENU | BUTTON_REL)
42#define SPLITEDIT_SAVE (BUTTON_MENU | BUTTON_LEFT)
43#define SPLITEDIT_LOOP_MODE (BUTTON_MENU | BUTTON_UP)
44#define SPLITEDIT_SCALE (BUTTON_MENU | BUTTON_RIGHT)
45#define SPLITEDIT_MENU_RUN BUTTON_RIGHT
46
47#elif CONFIG_KEYPAD == IRIVER_H100_PAD
48#define SPLITEDIT_QUIT BUTTON_OFF 28#define SPLITEDIT_QUIT BUTTON_OFF
49#define SPLITEDIT_PLAY BUTTON_ON 29#define SPLITEDIT_PLAY BUTTON_ON
50#define SPLITEDIT_SAVE BUTTON_SELECT 30#define SPLITEDIT_SAVE BUTTON_SELECT
@@ -279,12 +259,6 @@ static void update_icons(void)
279 LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, 259 LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
280 BMPWIDTH, BMPHEIGHT); 260 BMPWIDTH, BMPHEIGHT);
281 261
282#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
283 /* The scale icon */
284 rb->lcd_mono_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs() ? 1 : 0],
285 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
286 BMPWIDTH, BMPHEIGHT);
287#else
288 { 262 {
289 static int idx; 263 static int idx;
290 if (idx < 0 || idx > 1) idx = 0; 264 if (idx < 0 || idx > 1) idx = 0;
@@ -293,7 +267,6 @@ static void update_icons(void)
293 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, 267 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
294 BMPWIDTH, BMPHEIGHT); 268 BMPWIDTH, BMPHEIGHT);
295 } 269 }
296#endif
297 270
298 rb->lcd_update_rect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT); 271 rb->lcd_update_rect(0, LCD_HEIGHT - BMPHEIGHT, LCD_WIDTH, BMPHEIGHT);
299} 272}
@@ -961,14 +934,7 @@ static unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
961 { 934 {
962 /* read volume info */ 935 /* read volume info */
963 unsigned short volume; 936 unsigned short volume;
964#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
965 volume = rb->mas_codec_readreg(0x0c);
966 volume += rb->mas_codec_readreg(0x0d);
967 volume = volume / 2;
968 volume = rb->peak_meter_scale_value(volume, OSCI_HEIGHT);
969#else
970 volume = OSCI_HEIGHT / 2; 937 volume = OSCI_HEIGHT / 2;
971#endif
972 938
973 /* update osci_buffer */ 939 /* update osci_buffer */
974 if (osci_valid || lastx == x) 940 if (osci_valid || lastx == x)
@@ -1126,25 +1092,6 @@ static unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
1126 lastx = time_to_xpos(mp3->elapsed); 1092 lastx = time_to_xpos(mp3->elapsed);
1127 break; 1093 break;
1128 1094
1129#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1130#ifdef SPLITEDIT_SPEED100
1131 case SPLITEDIT_SPEED150:
1132 rb->sound_set_pitch(150L*PITCH_SPEED_PRECISION);
1133 splitedit_invalidate_osci();
1134 break;
1135
1136 case SPLITEDIT_SPEED100:
1137 rb->sound_set_pitch(PITCH_SPEED_100);
1138 splitedit_invalidate_osci();
1139 break;
1140
1141 case SPLITEDIT_SPEED50:
1142 rb->sound_set_pitch(50L*PITCH_SPEED_PRECISION);
1143 splitedit_invalidate_osci();
1144 break;
1145#endif
1146#endif
1147
1148 case BUTTON_LEFT: 1095 case BUTTON_LEFT:
1149 case BUTTON_LEFT | BUTTON_REPEAT: 1096 case BUTTON_LEFT | BUTTON_REPEAT:
1150 if (splitedit_get_split_x() > OSCI_X + 2) 1097 if (splitedit_get_split_x() > OSCI_X + 2)
@@ -1185,9 +1132,6 @@ static unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
1185 break; 1132 break;
1186 1133
1187 case SPLITEDIT_SCALE: 1134 case SPLITEDIT_SCALE:
1188#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1189 rb->peak_meter_set_use_dbfs(!rb->peak_meter_get_use_dbfs());
1190#endif
1191 splitedit_invalidate_osci(); 1135 splitedit_invalidate_osci();
1192 update_icons(); 1136 update_icons();
1193 break; 1137 break;
@@ -1257,12 +1201,6 @@ static unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
1257 } 1201 }
1258 } 1202 }
1259 } 1203 }
1260#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1261#ifdef SPLITEDIT_SPEED100
1262 rb->sound_set_pitch(1000); /* make sure to reset pitch */
1263#endif
1264#endif
1265
1266 } 1204 }
1267 return retval; 1205 return retval;
1268} 1206}
diff --git a/apps/plugins/star.c b/apps/plugins/star.c
index 5814cc8cab..ea1d5b8bf8 100644
--- a/apps/plugins/star.c
+++ b/apps/plugins/star.c
@@ -57,42 +57,8 @@
57#define STAR_CONTROL_BLOCK 1 57#define STAR_CONTROL_BLOCK 1
58 58
59/* variable button definitions */ 59/* variable button definitions */
60#if CONFIG_KEYPAD == RECORDER_PAD 60#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
61#define STAR_QUIT BUTTON_OFF 61 (CONFIG_KEYPAD == IRIVER_H300_PAD)
62#define STAR_LEFT BUTTON_LEFT
63#define STAR_RIGHT BUTTON_RIGHT
64#define STAR_UP BUTTON_UP
65#define STAR_DOWN BUTTON_DOWN
66#define STAR_TOGGLE_CONTROL BUTTON_ON
67#define STAR_TOGGLE_CONTROL2 BUTTON_PLAY
68#define STAR_LEVEL_UP BUTTON_F3
69#define STAR_LEVEL_DOWN BUTTON_F1
70#define STAR_LEVEL_REPEAT BUTTON_F2
71#define STAR_TOGGLE_CONTROL_NAME "ON"
72#define STAR_QUIT_NAME "OFF"
73#define STAR_LEVEL_UP_NAME "F3"
74#define STAR_LEVEL_DOWN_NAME "F1"
75#define STAR_LEVEL_REPEAT_NAME "F2"
76
77#elif CONFIG_KEYPAD == ONDIO_PAD
78#define STAR_QUIT BUTTON_OFF
79#define STAR_LEFT BUTTON_LEFT
80#define STAR_RIGHT BUTTON_RIGHT
81#define STAR_UP BUTTON_UP
82#define STAR_DOWN BUTTON_DOWN
83#define STAR_TOGGLE_CONTROL_PRE BUTTON_MENU
84#define STAR_TOGGLE_CONTROL (BUTTON_MENU | BUTTON_REL)
85#define STAR_LEVEL_UP (BUTTON_MENU | BUTTON_RIGHT)
86#define STAR_LEVEL_DOWN (BUTTON_MENU | BUTTON_LEFT)
87#define STAR_LEVEL_REPEAT (BUTTON_MENU | BUTTON_UP)
88#define STAR_TOGGLE_CONTROL_NAME "MODE"
89#define STAR_QUIT_NAME "OFF"
90#define STAR_LEVEL_UP_NAME "M >"
91#define STAR_LEVEL_DOWN_NAME "M <"
92#define STAR_LEVEL_REPEAT_NAME "M ^"
93
94#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
95 (CONFIG_KEYPAD == IRIVER_H300_PAD)
96#define STAR_QUIT BUTTON_OFF 62#define STAR_QUIT BUTTON_OFF
97#define STAR_LEFT BUTTON_LEFT 63#define STAR_LEFT BUTTON_LEFT
98#define STAR_RIGHT BUTTON_RIGHT 64#define STAR_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c
index 30b01b2645..dff3c4b4d1 100644
--- a/apps/plugins/starfield.c
+++ b/apps/plugins/starfield.c
@@ -220,23 +220,17 @@ static int plugin_main(void)
220 rb->sleep(1); 220 rb->sleep(1);
221 rb->lcd_clear_display(); 221 rb->lcd_clear_display();
222 222
223#if ((CONFIG_CODEC == SWCODEC) || !defined(SIMULATOR) && \ 223#if (CONFIG_CODEC == SWCODEC)
224 ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)))
225
226 /* This will make the stars pulse to the music */ 224 /* This will make the stars pulse to the music */
227 if(pulse){ 225 if(pulse){
228 226
229 /* Get the peaks. ( Borrowed from vu_meter ) */ 227 /* Get the peaks. ( Borrowed from vu_meter ) */
230#if (CONFIG_CODEC == SWCODEC)
231 static struct pcm_peaks peaks; 228 static struct pcm_peaks peaks;
232 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 229 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
233 &peaks); 230 &peaks);
234 #define left_peak peaks.left 231 #define left_peak peaks.left
235 #define right_peak peaks.right 232 #define right_peak peaks.right
236#else 233
237 int left_peak = rb->mas_codec_readreg(0xC);
238 int right_peak = rb->mas_codec_readreg(0xD);
239#endif
240 /* Devide peak data by 4098 to bring the max 234 /* Devide peak data by 4098 to bring the max
241 value down from ~32k to 8 */ 235 value down from ~32k to 8 */
242 left_peak = left_peak/0x1000; 236 left_peak = left_peak/0x1000;
@@ -261,8 +255,6 @@ static int plugin_main(void)
261 starfield.z_move = avg_peak; 255 starfield.z_move = avg_peak;
262 256
263 } /* if pulse */ 257 } /* if pulse */
264#else
265 (void) avg_peak;
266#endif 258#endif
267 starfield_move_and_draw(&starfield); 259 starfield_move_and_draw(&starfield);
268 260
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index bb778c9d24..c3fa3e15dd 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -35,31 +35,7 @@
35#define STOPWATCH_FILE PLUGIN_APPS_DATA_DIR "/stopwatch.dat" 35#define STOPWATCH_FILE PLUGIN_APPS_DATA_DIR "/stopwatch.dat"
36 36
37/* variable button definitions */ 37/* variable button definitions */
38#if CONFIG_KEYPAD == RECORDER_PAD 38#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
39#define STOPWATCH_QUIT BUTTON_OFF
40#define STOPWATCH_START_STOP BUTTON_PLAY
41#define STOPWATCH_RESET_TIMER BUTTON_LEFT
42#define STOPWATCH_LAP_TIMER BUTTON_ON
43#define STOPWATCH_SCROLL_UP BUTTON_UP
44#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
45
46#elif CONFIG_KEYPAD == ONDIO_PAD
47#define STOPWATCH_QUIT BUTTON_OFF
48#define STOPWATCH_START_STOP BUTTON_RIGHT
49#define STOPWATCH_RESET_TIMER BUTTON_LEFT
50#define STOPWATCH_LAP_TIMER BUTTON_MENU
51#define STOPWATCH_SCROLL_UP BUTTON_UP
52#define STOPWATCH_SCROLL_DOWN BUTTON_DOWN
53
54#elif CONFIG_KEYPAD == PLAYER_PAD
55#define STOPWATCH_QUIT BUTTON_MENU
56#define STOPWATCH_START_STOP BUTTON_PLAY
57#define STOPWATCH_RESET_TIMER BUTTON_STOP
58#define STOPWATCH_LAP_TIMER BUTTON_ON
59#define STOPWATCH_SCROLL_UP BUTTON_RIGHT
60#define STOPWATCH_SCROLL_DOWN BUTTON_LEFT
61
62#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
63 (CONFIG_KEYPAD == IRIVER_H300_PAD) 39 (CONFIG_KEYPAD == IRIVER_H300_PAD)
64#define STOPWATCH_QUIT BUTTON_OFF 40#define STOPWATCH_QUIT BUTTON_OFF
65#define STOPWATCH_START_STOP BUTTON_SELECT 41#define STOPWATCH_START_STOP BUTTON_SELECT
diff --git a/apps/plugins/sudoku/sudoku.h b/apps/plugins/sudoku/sudoku.h
index 47000b8e25..d1eca7fcd4 100644
--- a/apps/plugins/sudoku/sudoku.h
+++ b/apps/plugins/sudoku/sudoku.h
@@ -27,31 +27,8 @@
27#define GAME_FILE PLUGIN_GAMES_DIR "/sudoku.ss" 27#define GAME_FILE PLUGIN_GAMES_DIR "/sudoku.ss"
28 28
29/* variable button definitions */ 29/* variable button definitions */
30#if CONFIG_KEYPAD == RECORDER_PAD 30#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
31#define SUDOKU_BUTTON_QUIT BUTTON_OFF 31 (CONFIG_KEYPAD == IRIVER_H300_PAD)
32#define SUDOKU_BUTTON_UP BUTTON_UP
33#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
34#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
35#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
36#define SUDOKU_BUTTON_TOGGLE BUTTON_PLAY
37#define SUDOKU_BUTTON_MENU BUTTON_F1
38#define SUDOKU_BUTTON_POSSIBLE BUTTON_F2
39
40#elif CONFIG_KEYPAD == ONDIO_PAD
41#define SUDOKU_BUTTON_QUIT BUTTON_OFF
42#define SUDOKU_BUTTON_UP BUTTON_UP
43#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
44#define SUDOKU_BUTTON_LEFT BUTTON_LEFT
45#define SUDOKU_BUTTON_RIGHT BUTTON_RIGHT
46#define SUDOKU_BUTTON_ALTTOGGLE (BUTTON_MENU | BUTTON_DOWN)
47#define SUDOKU_BUTTON_TOGGLE_PRE BUTTON_MENU
48#define SUDOKU_BUTTON_TOGGLE (BUTTON_MENU | BUTTON_REL)
49#define SUDOKU_BUTTON_MENU_PRE BUTTON_MENU
50#define SUDOKU_BUTTON_MENU (BUTTON_MENU | BUTTON_REPEAT)
51#define SUDOKU_BUTTON_POSSIBLE (BUTTON_MENU | BUTTON_LEFT)
52
53#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
54 (CONFIG_KEYPAD == IRIVER_H300_PAD)
55#define SUDOKU_BUTTON_QUIT BUTTON_OFF 32#define SUDOKU_BUTTON_QUIT BUTTON_OFF
56#define SUDOKU_BUTTON_UP BUTTON_UP 33#define SUDOKU_BUTTON_UP BUTTON_UP
57#define SUDOKU_BUTTON_DOWN BUTTON_DOWN 34#define SUDOKU_BUTTON_DOWN BUTTON_DOWN
diff --git a/apps/plugins/test_scanrate.c b/apps/plugins/test_scanrate.c
index b558e765c3..52d3c267e6 100644
--- a/apps/plugins/test_scanrate.c
+++ b/apps/plugins/test_scanrate.c
@@ -44,11 +44,7 @@ static const struct button_mapping *plugin_contexts[] = { pla_main_ctx };
44#endif /*HAVE_SCROLLWHEEL*/ 44#endif /*HAVE_SCROLLWHEEL*/
45 45
46/* Default refresh rates in 1/10 Hz */ 46/* Default refresh rates in 1/10 Hz */
47#if defined ARCHOS_RECORDER || defined ARCHOS_FMRECORDER \ 47#if defined IAUDIO_M3
48 || defined ARCHOS_RECORDERV2 || defined ARCHOS_ONDIOFM \
49 || defined ARCHOS_ONDIOSP
50#define DEFAULT_SCAN_RATE 670
51#elif defined IAUDIO_M3
52#define DEFAULT_SCAN_RATE 1500 48#define DEFAULT_SCAN_RATE 1500
53#define HORIZ_SCAN /* LCD controller updates the panel sideways */ 49#define HORIZ_SCAN /* LCD controller updates the panel sideways */
54#define NEED_BOOST 50#define NEED_BOOST
diff --git a/apps/plugins/text_viewer/tv_button.h b/apps/plugins/text_viewer/tv_button.h
index acf7519b69..4f7634e844 100644
--- a/apps/plugins/text_viewer/tv_button.h
+++ b/apps/plugins/text_viewer/tv_button.h
@@ -44,46 +44,8 @@
44 * TV_COLUMN_RIGHT one column right 44 * TV_COLUMN_RIGHT one column right
45 */ 45 */
46 46
47/* Recorder keys */
48#if CONFIG_KEYPAD == RECORDER_PAD
49#define TV_QUIT BUTTON_OFF
50#define TV_SCROLL_UP BUTTON_UP
51#define TV_SCROLL_DOWN BUTTON_DOWN
52#define TV_SCREEN_LEFT BUTTON_LEFT
53#define TV_SCREEN_RIGHT BUTTON_RIGHT
54#define TV_MENU BUTTON_F1
55#define TV_AUTOSCROLL BUTTON_PLAY
56#define TV_LINE_UP (BUTTON_ON | BUTTON_UP)
57#define TV_LINE_DOWN (BUTTON_ON | BUTTON_DOWN)
58#define TV_COLUMN_LEFT (BUTTON_ON | BUTTON_LEFT)
59#define TV_COLUMN_RIGHT (BUTTON_ON | BUTTON_RIGHT)
60#define TV_BOOKMARK BUTTON_F2
61
62/* Ondio keys */
63#elif CONFIG_KEYPAD == ONDIO_PAD
64#define TV_QUIT BUTTON_OFF
65#define TV_SCROLL_UP BUTTON_UP
66#define TV_SCROLL_DOWN BUTTON_DOWN
67#define TV_SCREEN_LEFT BUTTON_LEFT
68#define TV_SCREEN_RIGHT BUTTON_RIGHT
69#define TV_MENU (BUTTON_MENU|BUTTON_REPEAT)
70#define TV_AUTOSCROLL_PRE BUTTON_MENU
71#define TV_AUTOSCROLL (BUTTON_MENU|BUTTON_REL)
72#define TV_BOOKMARK (BUTTON_MENU|BUTTON_OFF)
73
74/* Player keys */
75#elif CONFIG_KEYPAD == PLAYER_PAD
76#define TV_QUIT BUTTON_STOP
77#define TV_SCROLL_UP BUTTON_LEFT
78#define TV_SCROLL_DOWN BUTTON_RIGHT
79#define TV_SCREEN_LEFT (BUTTON_ON|BUTTON_LEFT)
80#define TV_SCREEN_RIGHT (BUTTON_ON|BUTTON_RIGHT)
81#define TV_MENU BUTTON_MENU
82#define TV_AUTOSCROLL BUTTON_PLAY
83#define TV_BOOKMARK BUTTON_ON
84
85/* iRiver H1x0 && H3x0 keys */ 47/* iRiver H1x0 && H3x0 keys */
86#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \ 48#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
87 (CONFIG_KEYPAD == IRIVER_H300_PAD) 49 (CONFIG_KEYPAD == IRIVER_H300_PAD)
88#define TV_QUIT BUTTON_OFF 50#define TV_QUIT BUTTON_OFF
89#define TV_RC_QUIT BUTTON_RC_STOP 51#define TV_RC_QUIT BUTTON_RC_STOP
diff --git a/apps/plugins/video.c b/apps/plugins/video.c
deleted file mode 100644
index 6a66324a79..0000000000
--- a/apps/plugins/video.c
+++ /dev/null
@@ -1,1030 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Plugin for video playback
11* Reads raw image data + audio data from a file
12* !!!!!!!!!! Code Police free zone !!!!!!!!!!
13*
14* Copyright (C) 2003-2004 J�g Hohensohn aka [IDC]Dragon
15*
16* This program is free software; you can redistribute it and/or
17* modify it under the terms of the GNU General Public License
18* as published by the Free Software Foundation; either version 2
19* of the License, or (at your option) any later version.
20*
21* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22* KIND, either express or implied.
23*
24****************************************************************************/
25
26
27/****************** imports ******************/
28
29#include "plugin.h"
30#include "sh7034.h"
31#include "system.h"
32#include "lib/helper.h"
33
34#ifdef HAVE_LCD_BITMAP /* and definitely not for the Player, haha */
35
36
37
38/* variable button definitions */
39#if CONFIG_KEYPAD == RECORDER_PAD
40#define VIDEO_STOP_SEEK BUTTON_PLAY
41#define VIDEO_RESUME BUTTON_PLAY
42#define VIDEO_DEBUG BUTTON_F1
43#define VIDEO_CONTRAST_DOWN BUTTON_F2
44#define VIDEO_CONTRAST_UP BUTTON_F3
45
46#elif CONFIG_KEYPAD == ONDIO_PAD
47#define VIDEO_STOP_SEEK_PRE BUTTON_MENU
48#define VIDEO_STOP_SEEK (BUTTON_MENU | BUTTON_REL)
49#define VIDEO_RESUME BUTTON_RIGHT
50#define VIDEO_CONTRAST_DOWN (BUTTON_MENU | BUTTON_DOWN)
51#define VIDEO_CONTRAST_UP (BUTTON_MENU | BUTTON_UP)
52
53#endif
54/****************** constants ******************/
55
56#define SCREENSIZE (LCD_WIDTH*LCD_HEIGHT/8) /* in bytes */
57#define FPS 68 /* default fps for headerless (old video-only) file */
58#define MAX_ACC 20 /* maximum FF/FR speedup */
59#define FF_TICKS 3000; /* experimentally found nice */
60
61/* trigger levels, we need about 80 kB/sec */
62#define SPINUP_INIT 5000 /* from what level on to refill, in milliseconds */
63#define SPINUP_SAFETY 700 /* how much on top of the measured spinup time */
64#define CHUNK (1024*32) /* read size */
65
66
67/****************** prototypes ******************/
68static void timer4_isr(void); /* IMIA4 ISR */
69int check_button(void); /* determine next relative frame */
70
71
72/****************** data types ******************/
73
74/* plugins don't introduce headers, so structs are repeated from rvf_format.h */
75
76#define HEADER_MAGIC 0x52564668 /* "RVFh" at file start */
77#define AUDIO_MAGIC 0x41756446 /* "AudF" for each audio block */
78#define FILEVERSION 100 /* 1.00 */
79
80/* format type definitions */
81#define VIDEOFORMAT_NO_VIDEO 0
82#define VIDEOFORMAT_RAW 1
83#define AUDIOFORMAT_NO_AUDIO 0
84#define AUDIOFORMAT_MP3 1
85#define AUDIOFORMAT_MP3_BITSWAPPED 2
86
87/* bit flags */
88#define FLAG_LOOP 0x00000001 /* loop the playback, e.g. for stills */
89
90typedef struct /* contains whatever might be useful to the player */
91{
92 /* general info (16 entries = 64 byte) */
93 unsigned long magic; /* HEADER_MAGIC */
94 unsigned long version; /* file version */
95 unsigned long flags; /* combination of FLAG_xx */
96 unsigned long blocksize; /* how many bytes per block (=video frame) */
97 unsigned long bps_average; /* bits per second of the whole stream */
98 unsigned long bps_peak; /* max. of above (audio may be VBR) */
99 unsigned long resume_pos; /* file position to resume to */
100 unsigned long reserved[9]; /* reserved, should be zero */
101
102 /* video info (16 entries = 64 byte) */
103 unsigned long video_format; /* one of VIDEOFORMAT_xxx */
104 unsigned long video_1st_frame; /* byte position of first video frame */
105 unsigned long video_duration; /* total length of video part, in ms */
106 unsigned long video_payload_size; /* total amount of video data, in bytes */
107 unsigned long video_bitrate; /* derived from resolution and frame time, in bps */
108 unsigned long video_frametime; /* frame interval in 11.0592 MHz clocks */
109 long video_preroll; /* video is how much ahead, in 11.0592 MHz clocks */
110 unsigned long video_width; /* in pixels */
111 unsigned long video_height; /* in pixels */
112 unsigned long video_reserved[7]; /* reserved, should be zero */
113
114 /* audio info (16 entries = 64 byte) */
115 unsigned long audio_format; /* one of AUDIOFORMAT_xxx */
116 unsigned long audio_1st_frame; /* byte position of first video frame */
117 unsigned long audio_duration; /* total length of audio part, in ms */
118 unsigned long audio_payload_size; /* total amount of audio data, in bytes */
119 unsigned long audio_avg_bitrate; /* average audio bitrate, in bits per second */
120 unsigned long audio_peak_bitrate; /* maximum bitrate */
121 unsigned long audio_headersize; /* offset to payload in audio frames */
122 long audio_min_associated; /* minimum offset to video frame, in bytes */
123 long audio_max_associated; /* maximum offset to video frame, in bytes */
124 unsigned long audio_reserved[7]; /* reserved, should be zero */
125
126 /* more to come... ? */
127
128 /* Note: padding up to 'blocksize' with zero following this header */
129} tFileHeader;
130
131typedef struct /* the little header for all audio blocks */
132{
133 unsigned long magic; /* AUDIO_MAGIC indicates an audio block */
134 unsigned char previous_block; /* previous how many blocks backwards */
135 unsigned char next_block; /* next how many blocks forward */
136 short associated_video; /* offset to block with corresponding video */
137 unsigned short frame_start; /* offset to first frame starting in this block */
138 unsigned short frame_end; /* offset to behind last frame ending in this block */
139} tAudioFrameHeader;
140
141
142
143/****************** globals ******************/
144
145static char gPrint[32]; /* a global printf buffer, saves stack */
146
147
148/* playstate */
149static struct
150{
151 enum
152 {
153 paused,
154 playing,
155 } state;
156 bool bAudioUnderrun;
157 bool bVideoUnderrun;
158 bool bHasAudio;
159 bool bHasVideo;
160 int nTimeOSD; /* OSD should stay for this many frames */
161 bool bDirtyOSD; /* OSD needs redraw */
162 bool bRefilling; /* set if refilling buffer */
163 bool bSeeking;
164 int nSeekAcc; /* accelleration value for seek */
165 int nSeekPos; /* current file position for seek */
166 bool bDiskSleep; /* disk is suspended */
167#if FREQ == 12000000 /* Ondio speed kludge */
168 int nFrameTimeAdjusted;
169#endif
170} gPlay;
171
172/* buffer information */
173static struct
174{
175 ssize_t bufsize;
176 int granularity; /* common multiple of block and sector size */
177 unsigned char* pBufStart; /* start of ring buffer */
178 unsigned char* pBufEnd; /* end of ring buffer */
179 int osd_ypos;
180 int osd_height;
181
182 int vidcount; /* how many video blocks are known in a row */
183 unsigned char* pBufFill; /* write pointer for disk, owned by main task */
184 unsigned char* pReadVideo; /* video readout, maintained by timer ISR */
185 unsigned char* pReadAudio; /* audio readout, maintained by demand ISR */
186 bool bEOF; /* flag for end of file */
187 int low_water; /* reload threshold */
188 int high_water; /* end of reload threshold */
189 int spinup_safety; /* safety margin when recalculating low_water */
190 int nReadChunk; /* how much data for normal buffer fill */
191 int nSeekChunk; /* how much data while seeking */
192} gBuf;
193
194/* statistics */
195static struct
196{
197 int minAudioAvail;
198 int minVideoAvail;
199 int nAudioUnderruns;
200 int nVideoUnderruns;
201 long minSpinup;
202 long maxSpinup;
203} gStats;
204
205tFileHeader gFileHdr; /* file header */
206
207/****************** implementation ******************/
208
209/* tool function: return how much playable audio/video is left */
210static int Available(unsigned char* pSnapshot)
211{
212 if (pSnapshot <= gBuf.pBufFill)
213 return gBuf.pBufFill - pSnapshot;
214 else
215 return gBuf.bufsize - (pSnapshot - gBuf.pBufFill);
216}
217
218/* debug function to draw buffer indicators */
219#ifdef VIDEO_DEBUG
220static void DrawBuf(void)
221{
222 int ypos, fill, video, audio;
223
224 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
225 rb->lcd_fillrect(0, gBuf.osd_ypos, LCD_WIDTH, gBuf.osd_height);
226 rb->lcd_set_drawmode(DRMODE_SOLID);
227
228 ypos = gBuf.osd_ypos + gBuf.osd_height/2 - 3; /* center vertically */
229
230 rb->lcd_hline(1, LCD_WIDTH-2, ypos + 3);
231 rb->lcd_vline(0, ypos, ypos + 6);
232 rb->lcd_vline(LCD_WIDTH-1, ypos, ypos + 6);
233
234 /* calculate new tick positions */
235 fill = 1 + ((gBuf.pBufFill - gBuf.pBufStart) * (LCD_WIDTH-2)) / gBuf.bufsize;
236 video = 1 + ((gBuf.pReadVideo - gBuf.pBufStart) * (LCD_WIDTH-2)) / gBuf.bufsize;
237 audio = 1 + ((gBuf.pReadAudio - gBuf.pBufStart) * (LCD_WIDTH-2)) / gBuf.bufsize;
238
239 rb->lcd_drawpixel(fill, ypos + 4);
240 rb->lcd_drawpixel(video, ypos + 2);
241 rb->lcd_drawpixel(audio, ypos + 1);
242
243 if (gPlay.state == paused) /* we have to draw ourselves */
244 rb->lcd_update_rect(0, gBuf.osd_ypos, LCD_WIDTH, gBuf.osd_height);
245 else
246 gPlay.bDirtyOSD = true; /* redraw it with next timer IRQ */
247}
248#endif
249
250
251/* helper function to draw a position indicator */
252static void DrawPosition(int pos, int total)
253{
254 int w, h;
255 int sec; /* estimated seconds */
256 int ypos;
257
258 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
259 rb->lcd_fillrect(0, gBuf.osd_ypos, LCD_WIDTH, gBuf.osd_height);
260 rb->lcd_set_drawmode(DRMODE_SOLID);
261
262 /* print the estimated position */
263 sec = pos / (gFileHdr.bps_average/8);
264 if (sec < 100*60) /* fits into mm:ss format */
265 rb->snprintf(gPrint, sizeof(gPrint), "%02d:%02dm", sec/60, sec%60);
266 else /* a very long clip, hh:mm format */
267 rb->snprintf(gPrint, sizeof(gPrint), "%02d:%02dh", sec/3600, (sec/60)%60);
268
269 rb->lcd_getstringsize(gPrint, &w, &h);
270 w++;
271 ypos = gBuf.osd_ypos + (gBuf.osd_height - h) / 2;
272 rb->lcd_putsxy(0, ypos, gPrint);
273
274 /* draw a slider over the rest of the line */
275 rb->gui_scrollbar_draw(rb->screens[SCREEN_MAIN], w, ypos, LCD_WIDTH-w,
276 h, total, 0, pos, HORIZONTAL);
277
278 if (gPlay.state == paused) /* we have to draw ourselves */
279 rb->lcd_update_rect(0, gBuf.osd_ypos, LCD_WIDTH, gBuf.osd_height);
280 else /* let the display time do it */
281 {
282 gPlay.nTimeOSD = FPS;
283 gPlay.bDirtyOSD = true; /* redraw it with next timer IRQ */
284 }
285}
286
287/* Put text on OSD and activate it for 1 second */
288static void osd_show_text(void)
289{
290 int h, ypos;
291
292 rb->lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
293 rb->lcd_fillrect(0, gBuf.osd_ypos, LCD_WIDTH, gBuf.osd_height);
294 rb->lcd_set_drawmode(DRMODE_SOLID);
295
296 rb->lcd_getstringsize(gPrint, NULL, &h);
297 ypos = gBuf.osd_ypos + (gBuf.osd_height - h) / 2;
298 rb->lcd_putsxy(0, ypos, gPrint);
299
300 if (gPlay.state == paused) /* we have to draw ourselves */
301 rb->lcd_update_rect(0, gBuf.osd_ypos, LCD_WIDTH, gBuf.osd_height);
302 else /* let the display time do it */
303 {
304 gPlay.nTimeOSD = FPS; /* display it for 1 sec */
305 gPlay.bDirtyOSD = true; /* let the refresh copy it to LCD */
306 }
307}
308
309/* helper function to change the volume by a certain amount, +/- */
310static void ChangeVolume(int delta)
311{
312 int minvol = rb->sound_min(SOUND_VOLUME);
313 int maxvol = rb->sound_max(SOUND_VOLUME);
314 int vol = rb->global_settings->volume + delta;
315
316 if (vol > maxvol) vol = maxvol;
317 else if (vol < minvol) vol = minvol;
318 if (vol != rb->global_settings->volume)
319 {
320 rb->sound_set(SOUND_VOLUME, vol);
321 rb->global_settings->volume = vol;
322
323 rb->snprintf(gPrint, sizeof(gPrint), "Vol: %d dB", vol);
324 osd_show_text();
325 }
326}
327
328
329/* helper function to change the LCD contrast by a certain amount, +/- */
330static void ChangeContrast(int delta)
331{
332 static int mycontrast = -1; /* the "permanent" value while running */
333 int contrast; /* updated value */
334
335 if (mycontrast == -1)
336 mycontrast = rb->global_settings->contrast;
337
338 contrast = mycontrast + delta;
339 if (contrast > 63) contrast = 63;
340 else if (contrast < 5) contrast = 5;
341 if (contrast != mycontrast)
342 {
343 rb->lcd_set_contrast(contrast);
344 mycontrast = contrast;
345
346 rb->snprintf(gPrint, sizeof(gPrint), "Contrast: %d", contrast);
347 osd_show_text();
348 }
349}
350
351
352/* sync the video to the current audio */
353static void SyncVideo(void)
354{
355 tAudioFrameHeader* pAudioBuf;
356
357 pAudioBuf = (tAudioFrameHeader*)(gBuf.pReadAudio);
358 if (pAudioBuf->magic == AUDIO_MAGIC)
359 {
360 gBuf.vidcount = 0; /* nothing known */
361 /* sync the video position */
362 gBuf.pReadVideo = gBuf.pReadAudio +
363 (long)pAudioBuf->associated_video * (long)gFileHdr.blocksize;
364
365 /* handle possible wrap */
366 if (gBuf.pReadVideo >= gBuf.pBufEnd)
367 gBuf.pReadVideo -= gBuf.bufsize;
368 else if (gBuf.pReadVideo < gBuf.pBufStart)
369 gBuf.pReadVideo += gBuf.bufsize;
370 }
371}
372
373
374/* timer interrupt handler to display a frame */
375static void timer4_isr(void)
376{
377 int available;
378 tAudioFrameHeader* pAudioBuf;
379 int height; /* height to display */
380
381 /* reduce height if we have OSD on */
382 height = gFileHdr.video_height;
383 if (gPlay.nTimeOSD > 0)
384 {
385 gPlay.nTimeOSD--;
386 height = MIN(gBuf.osd_ypos, height);
387 if (gPlay.bDirtyOSD)
388 {
389 rb->lcd_update_rect(0, gBuf.osd_ypos, LCD_WIDTH, gBuf.osd_height);
390 gPlay.bDirtyOSD = false;
391 }
392 }
393
394 rb->lcd_blit_mono(gBuf.pReadVideo, 0, 0,
395 gFileHdr.video_width, height/8, gFileHdr.video_width);
396
397 available = Available(gBuf.pReadVideo);
398
399 /* loop to skip audio frame(s) */
400 while(1)
401 {
402 /* just for the statistics */
403 if (!gBuf.bEOF && available < gStats.minVideoAvail)
404 gStats.minVideoAvail = available;
405
406 if (available <= (int)gFileHdr.blocksize)
407 { /* no data for next frame */
408
409 if (gBuf.bEOF && (gFileHdr.flags & FLAG_LOOP))
410 { /* loop now, assuming the looped clip fits in memory */
411 gBuf.pReadVideo = gBuf.pBufStart + gFileHdr.video_1st_frame;
412 /* FixMe: pReadVideo is incremented below */
413 }
414 else
415 {
416 gPlay.bVideoUnderrun = true;
417 rb->timer_unregister(); /* disable ourselves */
418 return; /* no data available */
419 }
420 }
421 else /* normal advance for next time */
422 {
423 gBuf.pReadVideo += gFileHdr.blocksize;
424 if (gBuf.pReadVideo >= gBuf.pBufEnd)
425 gBuf.pReadVideo -= gBuf.bufsize; /* wraparound */
426 available -= gFileHdr.blocksize;
427 }
428
429 if (!gPlay.bHasAudio)
430 break; /* no need to skip any audio */
431
432 if (gBuf.vidcount)
433 {
434 /* we know the next is a video frame */
435 gBuf.vidcount--;
436 break; /* exit the loop */
437 }
438
439 pAudioBuf = (tAudioFrameHeader*)(gBuf.pReadVideo);
440 if (pAudioBuf->magic == AUDIO_MAGIC)
441 { /* we ran into audio, can happen after seek */
442 gBuf.vidcount = pAudioBuf->next_block;
443 if (gBuf.vidcount)
444 gBuf.vidcount--; /* minus the audio block */
445 }
446 } /* while */
447}
448
449
450/* ISR function to get more mp3 data */
451static void GetMoreMp3(const void** start, size_t* size)
452{
453 int available;
454 int advance;
455
456 tAudioFrameHeader* pAudioBuf = (tAudioFrameHeader*)(gBuf.pReadAudio);
457
458 advance = pAudioBuf->next_block * gFileHdr.blocksize;
459
460 available = Available(gBuf.pReadAudio);
461
462 /* just for the statistics */
463 if (!gBuf.bEOF && available < gStats.minAudioAvail)
464 gStats.minAudioAvail = available;
465
466 if (available < advance + (int)gFileHdr.blocksize || advance == 0)
467 {
468 gPlay.bAudioUnderrun = true;
469 return; /* no data available */
470 }
471
472 gBuf.pReadAudio += advance;
473 if (gBuf.pReadAudio >= gBuf.pBufEnd)
474 gBuf.pReadAudio -= gBuf.bufsize; /* wraparound */
475
476 *start = gBuf.pReadAudio + gFileHdr.audio_headersize;
477 *size = gFileHdr.blocksize - gFileHdr.audio_headersize;
478}
479
480
481static int WaitForButton(void)
482{
483 int button;
484
485 do
486 {
487 button = rb->button_get(true);
488 rb->default_event_handler(button);
489 } while ((button & BUTTON_REL) && button != SYS_USB_CONNECTED);
490
491 return button;
492}
493
494
495static bool WantResume(int fd)
496{
497 int button;
498
499 rb->lcd_puts(0, 0, "Resume to this");
500 rb->lcd_puts(0, 1, "last position?");
501 rb->lcd_puts(0, 2, "PLAY = yes");
502 rb->lcd_puts(0, 3, "Any Other = no");
503 rb->lcd_puts(0, 4, " (plays from start)");
504 DrawPosition(gFileHdr.resume_pos, rb->filesize(fd));
505 rb->lcd_update();
506
507 button = WaitForButton();
508 return (button == VIDEO_RESUME);
509}
510
511
512static int SeekTo(int fd, int nPos)
513{
514 int read_now, got_now;
515
516 if (gPlay.bHasAudio)
517 rb->mp3_play_stop(); /* stop audio ISR */
518 if (gPlay.bHasVideo)
519 rb->timer_unregister(); /* stop the timer */
520
521 rb->lseek(fd, nPos, SEEK_SET);
522
523 gBuf.pBufFill = gBuf.pBufStart; /* all empty */
524 gBuf.pReadVideo = gBuf.pReadAudio = gBuf.pBufStart;
525
526 read_now = gBuf.low_water - 1; /* less than low water, so loading will continue */
527 read_now -= read_now % gBuf.granularity; /* round down to granularity */
528 got_now = rb->read(fd, gBuf.pBufFill, read_now);
529 gBuf.bEOF = (read_now != got_now);
530 gBuf.pBufFill += got_now;
531
532 if (nPos == 0)
533 { /* we seeked to the start */
534 if (gPlay.bHasVideo)
535 gBuf.pReadVideo += gFileHdr.video_1st_frame;
536
537 if (gPlay.bHasAudio)
538 gBuf.pReadAudio += gFileHdr.audio_1st_frame;
539 }
540 else
541 { /* we have to search for the positions */
542 if (gPlay.bHasAudio) /* prepare audio playback, if contained */
543 {
544 /* search for audio frame */
545 while (((tAudioFrameHeader*)(gBuf.pReadAudio))->magic != AUDIO_MAGIC)
546 gBuf.pReadAudio += gFileHdr.blocksize;
547
548 if (gPlay.bHasVideo)
549 SyncVideo(); /* pick the right video for that */
550 }
551 }
552
553 /* synchronous start */
554 gPlay.state = playing;
555 if (gPlay.bHasAudio)
556 {
557 gPlay.bAudioUnderrun = false;
558 rb->mp3_play_data(gBuf.pReadAudio + gFileHdr.audio_headersize,
559 gFileHdr.blocksize - gFileHdr.audio_headersize, GetMoreMp3);
560 rb->mp3_play_pause(true); /* kickoff audio */
561 }
562 if (gPlay.bHasVideo)
563 {
564 gPlay.bVideoUnderrun = false;
565 /* start display interrupt */
566#if FREQ == 12000000 /* Ondio speed kludge */
567 rb->timer_register(1, NULL, gPlay.nFrameTimeAdjusted,
568 timer4_isr IF_COP(, CPU));
569#else
570 rb->timer_register(1, NULL, gFileHdr.video_frametime,
571 timer4_isr IF_COP(, CPU));
572#endif
573 }
574
575 return 0;
576}
577
578/* called from default_event_handler_ex() or at end of playback */
579static void Cleanup(void *fd)
580{
581 rb->close(*(int*)fd); /* close the file */
582
583 if (gPlay.bHasVideo)
584 rb->timer_unregister(); /* stop video ISR, now I can use the display again */
585
586 if (gPlay.bHasAudio)
587 rb->mp3_play_stop(); /* stop audio ISR */
588
589 /* Turn on backlight timeout (revert to settings) */
590 backlight_use_settings();
591
592 /* restore normal contrast */
593 rb->lcd_set_contrast(rb->global_settings->contrast);
594}
595
596/* returns >0 if continue, =0 to stop, <0 to abort (USB) */
597static int PlayTick(int fd)
598{
599 int button;
600 static int lastbutton = 0;
601 int avail_audio = -1, avail_video = -1;
602 int retval = 1;
603 int filepos;
604
605 /* check buffer level */
606
607 if (gPlay.bHasAudio)
608 avail_audio = Available(gBuf.pReadAudio);
609 if (gPlay.bHasVideo)
610 avail_video = Available(gBuf.pReadVideo);
611
612 if ((gPlay.bHasAudio && avail_audio < gBuf.low_water)
613 || (gPlay.bHasVideo && avail_video < gBuf.low_water))
614 {
615 gPlay.bRefilling = true; /* go to refill mode */
616 }
617
618 if ((!gPlay.bHasAudio || gPlay.bAudioUnderrun)
619 && (!gPlay.bHasVideo || gPlay.bVideoUnderrun)
620 && gBuf.bEOF)
621 {
622 if (gFileHdr.resume_pos)
623 { /* we played til the end, clear resume position */
624 gFileHdr.resume_pos = 0;
625 rb->lseek(fd, 0, SEEK_SET); /* save resume position */
626 rb->write(fd, &gFileHdr, sizeof(gFileHdr));
627 }
628 Cleanup(&fd);
629 return 0; /* all expired */
630 }
631
632 if (!gPlay.bRefilling || gBuf.bEOF)
633 { /* nothing to do */
634 button = rb->button_get_w_tmo(HZ/10);
635 }
636 else
637 { /* refill buffer */
638 int read_now, got_now;
639 int buf_free;
640 long spinup; /* measure the spinup time */
641
642 /* how much can we reload, don't fill completely, would appear empty */
643 buf_free = gBuf.bufsize - MAX(avail_audio, avail_video) - gBuf.high_water;
644 if (buf_free < 0)
645 buf_free = 0; /* just for safety */
646 buf_free -= buf_free % gBuf.granularity; /* round down to granularity */
647
648 /* in one piece max. up to buffer end (wrap after that) */
649 read_now = MIN(buf_free, gBuf.pBufEnd - gBuf.pBufFill);
650
651 /* load piecewise, to stay responsive */
652 read_now = MIN(read_now, gBuf.nReadChunk);
653
654 if (read_now == buf_free)
655 gPlay.bRefilling = false; /* last piece requested */
656
657 spinup = *rb->current_tick; /* in case this is interesting below */
658
659 got_now = rb->read(fd, gBuf.pBufFill, read_now);
660 if (got_now != read_now || read_now == 0)
661 {
662 gBuf.bEOF = true;
663 gPlay.bRefilling = false;
664 }
665
666 if (gPlay.bDiskSleep) /* statistics about the spinup time */
667 {
668 spinup = *rb->current_tick - spinup;
669 gPlay.bDiskSleep = false;
670 if (spinup > gStats.maxSpinup)
671 gStats.maxSpinup = spinup;
672 if (spinup < gStats.minSpinup)
673 gStats.minSpinup = spinup;
674
675 /* recalculate the low water mark from real measurements */
676 gBuf.low_water = (gStats.maxSpinup + gBuf.spinup_safety)
677 * gFileHdr.bps_peak / 8 / HZ;
678 }
679
680 if (!gPlay.bRefilling
681#ifdef HAVE_DISK_STORAGE
682 && rb->global_settings->disk_spindown < 20 /* condition for test only */
683#endif
684 )
685 {
686 rb->storage_sleep(); /* no point in leaving the disk run til timeout */
687 gPlay.bDiskSleep = true;
688 }
689
690 gBuf.pBufFill += got_now;
691 if (gBuf.pBufFill >= gBuf.pBufEnd)
692 gBuf.pBufFill = gBuf.pBufStart; /* wrap */
693
694 rb->yield(); /* have mercy with the other threads */
695 button = rb->button_get(false);
696 }
697
698 /* check keypresses */
699
700 if (button != BUTTON_NONE)
701 {
702 filepos = rb->lseek(fd, 0, SEEK_CUR);
703
704 if (gPlay.bHasVideo) /* video position is more accurate */
705 filepos -= Available(gBuf.pReadVideo); /* take video position */
706 else
707 filepos -= Available(gBuf.pReadAudio); /* else audio */
708
709 switch (button) { /* set exit conditions */
710 case BUTTON_OFF:
711 if (gFileHdr.magic == HEADER_MAGIC /* only if file has header */
712 && !(gFileHdr.flags & FLAG_LOOP)) /* not for stills */
713 {
714 gFileHdr.resume_pos = filepos;
715 rb->lseek(fd, 0, SEEK_SET); /* save resume position */
716 rb->write(fd, &gFileHdr, sizeof(gFileHdr));
717 }
718 Cleanup(&fd);
719 retval = 0; /* signal "stopped" to caller */
720 break;
721 case VIDEO_STOP_SEEK:
722#ifdef VIDEO_STOP_SEEK_PRE
723 if (lastbutton != VIDEO_STOP_SEEK_PRE)
724 break;
725#endif
726 if (gPlay.bSeeking)
727 {
728 gPlay.bSeeking = false;
729 gPlay.state = playing;
730 SeekTo(fd, gPlay.nSeekPos);
731 }
732 else if (gPlay.state == playing)
733 {
734 gPlay.state = paused;
735 if (gPlay.bHasAudio)
736 rb->mp3_play_pause(false); /* pause audio */
737 if (gPlay.bHasVideo)
738 rb->timer_unregister(); /* stop the timer */
739 }
740 else if (gPlay.state == paused)
741 {
742 gPlay.state = playing;
743 if (gPlay.bHasAudio)
744 {
745 if (gPlay.bHasVideo)
746 SyncVideo();
747 rb->mp3_play_pause(true); /* play audio */
748 }
749 if (gPlay.bHasVideo)
750 { /* start the video */
751#if FREQ == 12000000 /* Ondio speed kludge */
752 rb->timer_register(1, NULL,
753 gPlay.nFrameTimeAdjusted, timer4_isr);
754#else
755 rb->timer_register(1, NULL,
756 gFileHdr.video_frametime, timer4_isr);
757#endif
758 }
759 }
760 break;
761 case BUTTON_UP:
762 case BUTTON_UP | BUTTON_REPEAT:
763 if (gPlay.bHasAudio)
764 ChangeVolume(1);
765 break;
766 case BUTTON_DOWN:
767 case BUTTON_DOWN | BUTTON_REPEAT:
768 if (gPlay.bHasAudio)
769 ChangeVolume(-1);
770 break;
771 case BUTTON_LEFT:
772 case BUTTON_LEFT | BUTTON_REPEAT:
773 if (!gPlay.bSeeking) /* prepare seek */
774 {
775 gPlay.nSeekPos = filepos;
776 gPlay.bSeeking = true;
777 gPlay.nSeekAcc = 0;
778 }
779 else if (gPlay.nSeekAcc > 0) /* other direction, stop sliding */
780 gPlay.nSeekAcc = 0;
781 else
782 gPlay.nSeekAcc--;
783 break;
784 case BUTTON_RIGHT:
785 case BUTTON_RIGHT | BUTTON_REPEAT:
786 if (!gPlay.bSeeking) /* prepare seek */
787 {
788 gPlay.nSeekPos = filepos;
789 gPlay.bSeeking = true;
790 gPlay.nSeekAcc = 0;
791 }
792 else if (gPlay.nSeekAcc < 0) /* other direction, stop sliding */
793 gPlay.nSeekAcc = 0;
794 else
795 gPlay.nSeekAcc++;
796 break;
797#ifdef VIDEO_DEBUG
798 case VIDEO_DEBUG: /* debug key */
799 case VIDEO_DEBUG | BUTTON_REPEAT:
800 DrawBuf(); /* show buffer status */
801 gPlay.nTimeOSD = FPS/2;
802 gPlay.bDirtyOSD = true;
803 break;
804#endif
805 case VIDEO_CONTRAST_DOWN: /* contrast down */
806 case VIDEO_CONTRAST_DOWN | BUTTON_REPEAT:
807 if (gPlay.bHasVideo)
808 ChangeContrast(-1);
809 break;
810 case VIDEO_CONTRAST_UP: /* contrast up */
811 case VIDEO_CONTRAST_UP | BUTTON_REPEAT:
812 if (gPlay.bHasVideo)
813 ChangeContrast(1);
814 break;
815 default:
816 if (rb->default_event_handler_ex(button, Cleanup, &fd)
817 == SYS_USB_CONNECTED)
818 retval = -1; /* signal "aborted" to caller */
819 break;
820 }
821
822 lastbutton = button;
823 } /* if (button != BUTTON_NONE) */
824
825
826 /* handle seeking */
827
828 if (gPlay.bSeeking) /* seeking? */
829 {
830 if (gPlay.nSeekAcc < -MAX_ACC)
831 gPlay.nSeekAcc = -MAX_ACC;
832 else if (gPlay.nSeekAcc > MAX_ACC)
833 gPlay.nSeekAcc = MAX_ACC;
834
835 gPlay.nSeekPos += gPlay.nSeekAcc * gBuf.nSeekChunk;
836 if (gPlay.nSeekPos < 0)
837 gPlay.nSeekPos = 0;
838 if (gPlay.nSeekPos > rb->filesize(fd) - gBuf.granularity)
839 {
840 gPlay.nSeekPos = rb->filesize(fd);
841 gPlay.nSeekPos -= gPlay.nSeekPos % gBuf.granularity;
842 }
843 DrawPosition(gPlay.nSeekPos, rb->filesize(fd));
844 }
845
846
847 /* check + recover underruns */
848
849 if ((gPlay.bAudioUnderrun || gPlay.bVideoUnderrun) && !gBuf.bEOF)
850 {
851 gBuf.spinup_safety += HZ/2; /* add extra spinup time for the future */
852 filepos = rb->lseek(fd, 0, SEEK_CUR);
853
854 if (gPlay.bHasVideo && gPlay.bVideoUnderrun)
855 {
856 gStats.nVideoUnderruns++;
857 filepos -= Available(gBuf.pReadVideo); /* take video position */
858 SeekTo(fd, filepos);
859 }
860 else if (gPlay.bHasAudio && gPlay.bAudioUnderrun)
861 {
862 gStats.nAudioUnderruns++;
863 filepos -= Available(gBuf.pReadAudio); /* else audio */
864 SeekTo(fd, filepos);
865 }
866 }
867
868 return retval;
869}
870
871
872static int main(char* filename)
873{
874 int file_size;
875 int fd; /* file descriptor handle */
876 int read_now, got_now;
877 int button = 0;
878 int retval;
879
880 /* try to open the file */
881 fd = rb->open(filename, O_RDWR);
882 if (fd < 0)
883 return PLUGIN_ERROR;
884 file_size = rb->filesize(fd);
885
886 /* reset pitch value to ensure synchronous playback */
887 rb->sound_set_pitch(PITCH_SPEED_100);
888
889 /* init statistics */
890 rb->memset(&gStats, 0, sizeof(gStats));
891 gStats.minAudioAvail = gStats.minVideoAvail = INT_MAX;
892 gStats.minSpinup = INT_MAX;
893
894 /* init playback state */
895 rb->memset(&gPlay, 0, sizeof(gPlay));
896
897 /* init buffer */
898 rb->memset(&gBuf, 0, sizeof(gBuf));
899 gBuf.pBufStart = rb->plugin_get_audio_buffer((size_t *)&gBuf.bufsize);
900 /*gBuf.bufsize = 1700*1024; // test, like 2MB version!!!! */
901 gBuf.pBufFill = gBuf.pBufStart; /* all empty */
902
903 /* init OSD */
904 rb->lcd_getstringsize("X", NULL, &retval);
905 gBuf.osd_height = (retval + 7) & ~7;
906 gBuf.osd_ypos = LCD_HEIGHT - gBuf.osd_height;
907
908 /* load file header */
909 read_now = sizeof(gFileHdr);
910 got_now = rb->read(fd, &gFileHdr, read_now);
911 rb->lseek(fd, 0, SEEK_SET); /* rewind to restart sector-aligned */
912 if (got_now != read_now)
913 {
914 rb->close(fd);
915 return (PLUGIN_ERROR);
916 }
917
918 /* check header */
919 if (gFileHdr.magic != HEADER_MAGIC)
920 { /* old file, use default info */
921 rb->memset(&gFileHdr, 0, sizeof(gFileHdr));
922 gFileHdr.blocksize = SCREENSIZE;
923 if (file_size < SCREENSIZE * FPS) /* less than a second */
924 gFileHdr.flags |= FLAG_LOOP;
925 gFileHdr.video_format = VIDEOFORMAT_RAW;
926 gFileHdr.video_width = LCD_WIDTH;
927 gFileHdr.video_height = LCD_HEIGHT;
928 gFileHdr.video_frametime = 11059200 / FPS;
929 gFileHdr.bps_peak = gFileHdr.bps_average = LCD_WIDTH * LCD_HEIGHT * FPS;
930 }
931
932#if FREQ == 12000000 /* Ondio speed kludge, 625 / 576 == 12000000 / 11059200 */
933 gPlay.nFrameTimeAdjusted = (gFileHdr.video_frametime * 625) / 576;
934#endif
935
936 /* continue buffer init: align the end, calc low water, read sizes */
937 gBuf.granularity = gFileHdr.blocksize;
938 while (gBuf.granularity % 512) /* common multiple of sector size */
939 gBuf.granularity *= 2;
940 gBuf.bufsize -= gBuf.bufsize % gBuf.granularity; /* round down */
941 gBuf.pBufEnd = gBuf.pBufStart + gBuf.bufsize;
942 gBuf.low_water = SPINUP_INIT * gFileHdr.bps_peak / 8000;
943 gBuf.spinup_safety = SPINUP_SAFETY * HZ / 1000; /* in time ticks */
944 if (gFileHdr.audio_min_associated < 0)
945 gBuf.high_water = 0 - gFileHdr.audio_min_associated;
946 else
947 gBuf.high_water = 1; /* never fill buffer completely, would appear empty */
948 gBuf.nReadChunk = (CHUNK + gBuf.granularity - 1); /* round up */
949 gBuf.nReadChunk -= gBuf.nReadChunk % gBuf.granularity;/* and align */
950 gBuf.nSeekChunk = rb->filesize(fd) / FF_TICKS;
951 gBuf.nSeekChunk += gBuf.granularity - 1; /* round up */
952 gBuf.nSeekChunk -= gBuf.nSeekChunk % gBuf.granularity; /* and align */
953
954 /* prepare video playback, if contained */
955 if (gFileHdr.video_format == VIDEOFORMAT_RAW)
956 {
957 gPlay.bHasVideo = true;
958 /* Turn off backlight timeout */
959 backlight_ignore_timeout();
960 }
961
962 /* prepare audio playback, if contained */
963 if (gFileHdr.audio_format == AUDIOFORMAT_MP3_BITSWAPPED)
964 {
965 gPlay.bHasAudio = true;
966 }
967
968 /* start playback by seeking to zero or resume position */
969 if (gFileHdr.resume_pos && WantResume(fd)) /* ask the user */
970 SeekTo(fd, gFileHdr.resume_pos);
971 else
972 SeekTo(fd, 0);
973
974 /* all that's left to do is keep the buffer full */
975 do /* the main loop */
976 {
977 retval = PlayTick(fd);
978 } while (retval > 0);
979
980 if (retval < 0) /* aborted? */
981 {
982 return PLUGIN_USB_CONNECTED;
983 }
984
985#ifndef DEBUG /* for release compilations, only display the stats in case of error */
986 if (gStats.nAudioUnderruns || gStats.nVideoUnderruns)
987#endif
988 {
989 /* display statistics */
990 rb->lcd_clear_display();
991 rb->snprintf(gPrint, sizeof(gPrint), "%d Audio Underruns", gStats.nAudioUnderruns);
992 rb->lcd_puts(0, 0, gPrint);
993 rb->snprintf(gPrint, sizeof(gPrint), "%d Video Underruns", gStats.nVideoUnderruns);
994 rb->lcd_puts(0, 1, gPrint);
995 rb->snprintf(gPrint, sizeof(gPrint), "%d MinAudio bytes", gStats.minAudioAvail);
996 rb->lcd_puts(0, 2, gPrint);
997 rb->snprintf(gPrint, sizeof(gPrint), "%d MinVideo bytes", gStats.minVideoAvail);
998 rb->lcd_puts(0, 3, gPrint);
999 rb->snprintf(gPrint, sizeof(gPrint), "MinSpinup %ld.%02ld", gStats.minSpinup/HZ, gStats.minSpinup%HZ);
1000 rb->lcd_puts(0, 4, gPrint);
1001 rb->snprintf(gPrint, sizeof(gPrint), "MaxSpinup %ld.%02ld", gStats.maxSpinup/HZ, gStats.maxSpinup%HZ);
1002 rb->lcd_puts(0, 5, gPrint);
1003 rb->snprintf(gPrint, sizeof(gPrint), "LowWater: %d", gBuf.low_water);
1004 rb->lcd_puts(0, 6, gPrint);
1005 rb->snprintf(gPrint, sizeof(gPrint), "HighWater: %d", gBuf.high_water);
1006 rb->lcd_puts(0, 7, gPrint);
1007
1008 rb->lcd_update();
1009 button = WaitForButton();
1010 }
1011 return (button == SYS_USB_CONNECTED) ? PLUGIN_USB_CONNECTED : PLUGIN_OK;
1012}
1013
1014
1015/***************** Plugin Entry Point *****************/
1016
1017enum plugin_status plugin_start(const void* parameter)
1018{
1019 if (parameter == NULL)
1020 {
1021 rb->splash(HZ*2, "Play .rvf file!");
1022 return PLUGIN_ERROR;
1023 }
1024
1025 /* now go ahead and have fun! */
1026 return main((char*) parameter);
1027}
1028
1029#endif /* #ifdef HAVE_LCD_BITMAP */
1030
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index af6bd6f397..a4d639ede6 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -24,32 +24,8 @@
24 24
25 25
26/* variable button definitions */ 26/* variable button definitions */
27#if CONFIG_KEYPAD == RECORDER_PAD 27#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
28#define VUMETER_QUIT BUTTON_OFF 28 (CONFIG_KEYPAD == IRIVER_H300_PAD)
29#define VUMETER_HELP BUTTON_ON
30#define VUMETER_MENU BUTTON_F1
31#define VUMETER_UP BUTTON_UP
32#define VUMETER_DOWN BUTTON_DOWN
33#define LABEL_HELP "ON"
34#define LABEL_QUIT "OFF"
35#define LABEL_MENU "F1"
36#define LABEL_VOLUME "UP/DOWN"
37
38#elif CONFIG_KEYPAD == ONDIO_PAD
39#define VUMETER_QUIT BUTTON_OFF
40#define VUMETER_HELP_PRE BUTTON_MENU
41#define VUMETER_HELP (BUTTON_MENU | BUTTON_REL)
42#define VUMETER_MENU_PRE BUTTON_MENU
43#define VUMETER_MENU (BUTTON_MENU | BUTTON_REPEAT)
44#define VUMETER_UP BUTTON_UP
45#define VUMETER_DOWN BUTTON_DOWN
46#define LABEL_HELP "MODE"
47#define LABEL_QUIT "OFF"
48#define LABEL_MENU "MODE.."
49#define LABEL_VOLUME "UP/DOWN"
50
51#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
52 (CONFIG_KEYPAD == IRIVER_H300_PAD)
53#define VUMETER_QUIT BUTTON_OFF 29#define VUMETER_QUIT BUTTON_OFF
54#define VUMETER_HELP BUTTON_ON 30#define VUMETER_HELP BUTTON_ON
55#define VUMETER_MENU BUTTON_SELECT 31#define VUMETER_MENU BUTTON_SELECT
@@ -804,10 +780,7 @@ static void draw_digital_minimeters(void) {
804 780
805static void analog_meter(void) { 781static void analog_meter(void) {
806 782
807#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) 783#if (CONFIG_CODEC == SWCODEC)
808 int left_peak = rb->mas_codec_readreg(0xC);
809 int right_peak = rb->mas_codec_readreg(0xD);
810#elif (CONFIG_CODEC == SWCODEC)
811 static struct pcm_peaks peaks; 784 static struct pcm_peaks peaks;
812 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 785 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
813 &peaks); 786 &peaks);
@@ -864,10 +837,7 @@ static void analog_meter(void) {
864} 837}
865 838
866static void digital_meter(void) { 839static void digital_meter(void) {
867#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) 840#if (CONFIG_CODEC == SWCODEC)
868 int left_peak = rb->mas_codec_readreg(0xC);
869 int right_peak = rb->mas_codec_readreg(0xD);
870#elif (CONFIG_CODEC == SWCODEC)
871 static struct pcm_peaks peaks; 841 static struct pcm_peaks peaks;
872 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK, 842 rb->mixer_channel_calculate_peaks(PCM_MIXER_CHAN_PLAYBACK,
873 &peaks); 843 &peaks);
diff --git a/apps/plugins/wavplay.c b/apps/plugins/wavplay.c
deleted file mode 100644
index 073af31280..0000000000
--- a/apps/plugins/wavplay.c
+++ /dev/null
@@ -1,3676 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Jörg Hohensohn
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "plugin.h"
22
23
24
25/************ Start of MAS pcm codec, raw i2c blocks ************/
26
27// address 04640 count 30 (126 bytes)
28static const unsigned char maspcm_array1[] = {
29 0xe0, 0x00, 0x00, 0x1e, 0x06, 0x40,
30 0x00, 0x08, 0x00, 0x00, // 00080000
31 0x00, 0x00, 0x00, 0x00, // 00000000
32 0x00, 0x00, 0x00, 0x00, // 00000000
33 0x00, 0x08, 0x00, 0x00, // 00080000
34 0x00, 0x00, 0x00, 0x25, // 00000025
35 0x00, 0x00, 0x00, 0x04, // 00000004
36 0x00, 0x00, 0x48, 0x00, // 00004800
37 0x00, 0x08, 0x00, 0x00, // 00080000
38 0x00, 0x00, 0x00, 0x00, // 00000000
39 0x00, 0x00, 0x00, 0x00, // 00000000
40 0x00, 0x00, 0xFF, 0xFF, // 0000FFFF
41 0x00, 0x00, 0x00, 0x00, // 00000000
42 0x00, 0x00, 0x00, 0x00, // 00000000
43 0x00, 0x00, 0x82, 0x00, // 00008200
44 0x00, 0x00, 0x00, 0x0A, // 0000000A
45 0x00, 0x08, 0x00, 0x00, // 00080000
46 0x00, 0x00, 0x00, 0x00, // 00000000
47 0x00, 0x00, 0x00, 0x00, // 00000000
48 0x00, 0x08, 0x00, 0x00, // 00080000
49 0x00, 0x08, 0x00, 0x00, // 00080000
50 0x00, 0x00, 0x00, 0x00, // 00000000
51 0x00, 0x00, 0x00, 0x00, // 00000000
52 0x00, 0x08, 0x00, 0x00, // 00080000
53 0x00, 0x00, 0x03, 0x18, // 00000318
54 0x00, 0x00, 0x03, 0x18, // 00000318
55 0x00, 0x00, 0x03, 0x00, // 00000300
56 0x00, 0x00, 0x03, 0x00, // 00000300
57 0x00, 0x00, 0x03, 0x18, // 00000318
58 0x00, 0x00, 0x00, 0x00, // 00000000
59 0x00, 0x00, 0x03, 0x00, // 00000300
60};
61// address 04674 count 81 (330 bytes)
62static const unsigned char maspcm_array2[] = {
63 0xe0, 0x00, 0x00, 0x51, 0x06, 0x74,
64 0x00, 0x00, 0x60, 0x00, // 00006000
65 0x00, 0x00, 0x00, 0x02, // 00000002
66 0x00, 0x00, 0x00, 0x60, // 00000060
67 0x00, 0x00, 0x00, 0x60, // 00000060
68 0x00, 0x00, 0x03, 0x00, // 00000300
69 0x00, 0x00, 0xC0, 0x00, // 0000C000
70 0x00, 0x00, 0x00, 0x14, // 00000014
71 0x00, 0x00, 0x00, 0x1E, // 0000001E
72 0x00, 0x00, 0x42, 0x11, // 00004211
73 0x00, 0x00, 0x58, 0x33, // 00005833
74 0x00, 0x00, 0x00, 0x02, // 00000002
75 0x00, 0x00, 0x00, 0x40, // 00000040
76 0x00, 0x00, 0x00, 0x40, // 00000040
77 0x00, 0x00, 0x00, 0x00, // 00000000
78 0x00, 0x01, 0x20, 0x01, // 00012001
79 0x00, 0x00, 0x00, 0x14, // 00000014
80 0x00, 0x00, 0x00, 0x29, // 00000029
81 0x00, 0x00, 0x30, 0xC3, // 000030C3
82 0x00, 0x00, 0x60, 0x00, // 00006000
83 0x00, 0x00, 0x00, 0x02, // 00000002
84 0x00, 0x00, 0x00, 0x40, // 00000040
85 0x00, 0x00, 0x00, 0x40, // 00000040
86 0x00, 0x00, 0x02, 0x00, // 00000200
87 0x00, 0x01, 0x20, 0x00, // 00012000
88 0x00, 0x00, 0x00, 0x14, // 00000014
89 0x00, 0x00, 0x00, 0x2D, // 0000002D
90 0x00, 0x00, 0x2C, 0x86, // 00002C86
91 0x00, 0x00, 0x60, 0x00, // 00006000
92 0x00, 0x00, 0x00, 0x01, // 00000001
93 0x00, 0x00, 0x00, 0x30, // 00000030
94 0x00, 0x00, 0x00, 0x30, // 00000030
95 0x00, 0x00, 0x03, 0x00, // 00000300
96 0x00, 0x01, 0x80, 0x00, // 00018000
97 0x00, 0x00, 0x00, 0x14, // 00000014
98 0x00, 0x00, 0x00, 0x3C, // 0000003C
99 0x00, 0x00, 0x21, 0x93, // 00002193
100 0x00, 0x00, 0x58, 0x33, // 00005833
101 0x00, 0x00, 0x00, 0x01, // 00000001
102 0x00, 0x00, 0x00, 0x20, // 00000020
103 0x00, 0x00, 0x00, 0x20, // 00000020
104 0x00, 0x00, 0x00, 0x00, // 00000000
105 0x00, 0x02, 0x40, 0x01, // 00024001
106 0x00, 0x00, 0x00, 0x14, // 00000014
107 0x00, 0x00, 0x00, 0x52, // 00000052
108 0x00, 0x00, 0x18, 0xAD, // 000018AD
109 0x00, 0x00, 0x60, 0x00, // 00006000
110 0x00, 0x00, 0x00, 0x01, // 00000001
111 0x00, 0x00, 0x00, 0x20, // 00000020
112 0x00, 0x00, 0x00, 0x20, // 00000020
113 0x00, 0x00, 0x02, 0x00, // 00000200
114 0x00, 0x02, 0x40, 0x00, // 00024000
115 0x00, 0x00, 0x00, 0x14, // 00000014
116 0x00, 0x00, 0x00, 0x5A, // 0000005A
117 0x00, 0x00, 0x16, 0x81, // 00001681
118 0x00, 0x00, 0x60, 0x00, // 00006000
119 0x00, 0x00, 0x00, 0x00, // 00000000
120 0x00, 0x00, 0x00, 0x18, // 00000018
121 0x00, 0x00, 0x00, 0x18, // 00000018
122 0x00, 0x00, 0x03, 0x00, // 00000300
123 0x00, 0x03, 0x00, 0x00, // 00030000
124 0x00, 0x00, 0x00, 0x14, // 00000014
125 0x00, 0x00, 0x00, 0x78, // 00000078
126 0x00, 0x00, 0x10, 0xED, // 000010ED
127 0x00, 0x00, 0x58, 0x33, // 00005833
128 0x00, 0x00, 0x00, 0x00, // 00000000
129 0x00, 0x00, 0x00, 0x10, // 00000010
130 0x00, 0x00, 0x00, 0x10, // 00000010
131 0x00, 0x00, 0x00, 0x00, // 00000000
132 0x00, 0x04, 0x80, 0x03, // 00048003
133 0x00, 0x00, 0x00, 0x14, // 00000014
134 0x00, 0x00, 0x00, 0xA5, // 000000A5
135 0x00, 0x00, 0x0C, 0x56, // 00000C56
136 0x00, 0x00, 0x60, 0x00, // 00006000
137 0x00, 0x00, 0x00, 0x00, // 00000000
138 0x00, 0x00, 0x00, 0x10, // 00000010
139 0x00, 0x00, 0x00, 0x10, // 00000010
140 0x00, 0x00, 0x02, 0x00, // 00000200
141 0x00, 0x04, 0x80, 0x00, // 00048000
142 0x00, 0x00, 0x00, 0x14, // 00000014
143 0x00, 0x00, 0x00, 0xB4, // 000000B4
144 0x00, 0x00, 0x0B, 0x51, // 00000B51
145};
146// address 04661 count 19 (82 bytes)
147static const unsigned char maspcm_array3[] = {
148 0xe0, 0x00, 0x00, 0x13, 0x06, 0x61,
149 0x00, 0x00, 0x01, 0x25, // 00000125
150 0x00, 0x00, 0x00, 0x05, // 00000005
151 0x00, 0x00, 0x48, 0x00, // 00004800
152 0x00, 0x08, 0x00, 0x00, // 00080000
153 0x00, 0x00, 0x00, 0x00, // 00000000
154 0x00, 0x00, 0x00, 0x00, // 00000000
155 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
156 0x00, 0x00, 0x00, 0x00, // 00000000
157 0x00, 0x00, 0x00, 0x00, // 00000000
158 0x00, 0x00, 0x82, 0x00, // 00008200
159 0x00, 0x00, 0x00, 0x00, // 00000000
160 0x00, 0x08, 0x00, 0x00, // 00080000
161 0x00, 0x00, 0x00, 0x00, // 00000000
162 0x00, 0x00, 0x00, 0x00, // 00000000
163 0x00, 0x08, 0x00, 0x00, // 00080000
164 0x00, 0x08, 0x00, 0x00, // 00080000
165 0x00, 0x00, 0x00, 0x00, // 00000000
166 0x00, 0x00, 0x00, 0x00, // 00000000
167 0x00, 0x08, 0x00, 0x00, // 00080000
168};
169// address 046E4 count 16 (70 bytes)
170static const unsigned char maspcm_array4[] = {
171 0xe0, 0x00, 0x00, 0x10, 0x06, 0xe4,
172 0x00, 0x00, 0x06, 0x74, // 00000674
173 0x00, 0x00, 0x06, 0x7D, // 0000067D
174 0x00, 0x00, 0x06, 0x86, // 00000686
175 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
176 0x00, 0x00, 0x06, 0x8F, // 0000068F
177 0x00, 0x00, 0x06, 0x98, // 00000698
178 0x00, 0x00, 0x06, 0xA1, // 000006A1
179 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
180 0x00, 0x00, 0x06, 0xAA, // 000006AA
181 0x00, 0x00, 0x06, 0xB3, // 000006B3
182 0x00, 0x00, 0x06, 0xBC, // 000006BC
183 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
184 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
185 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
186 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
187 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
188};
189// address 04700 count 18 (78 byte)
190static const unsigned char maspcm_array5[] = {
191 0xe0, 0x00, 0x00, 0x12, 0x07, 0x00,
192 0x00, 0x00, 0x06, 0xBC, // 000006BC
193 0x00, 0x00, 0x00, 0x0A, // 0000000A
194 0x00, 0x00, 0x06, 0x74, // 00000674
195 0x00, 0x00, 0x00, 0x00, // 00000000
196 0x00, 0x00, 0x06, 0x7D, // 0000067D
197 0x00, 0x00, 0x00, 0x01, // 00000001
198 0x00, 0x00, 0x06, 0x86, // 00000686
199 0x00, 0x00, 0x00, 0x02, // 00000002
200 0x00, 0x00, 0x06, 0x8F, // 0000068F
201 0x00, 0x00, 0x00, 0x04, // 00000004
202 0x00, 0x00, 0x06, 0x98, // 00000698
203 0x00, 0x00, 0x00, 0x05, // 00000005
204 0x00, 0x00, 0x06, 0xA1, // 000006A1
205 0x00, 0x00, 0x00, 0x06, // 00000006
206 0x00, 0x00, 0x06, 0xAA, // 000006AA
207 0x00, 0x00, 0x00, 0x08, // 00000008
208 0x00, 0x00, 0x06, 0xB3, // 000006B3
209 0x00, 0x00, 0x00, 0x09, // 00000009
210};
211// address 06600 count 63 (258 bytes)
212static const unsigned char maspcm_array6[] = {
213 0xf0, 0x00, 0x00, 0x3f, 0x06, 0x00,
214 0x00, 0x00, 0x0B, 0xAD, // 00000BAD
215 0x00, 0x00, 0x10, 0x00, // 00001000
216 0x00, 0x00, 0x20, 0x00, // 00002000
217 0x00, 0x00, 0x30, 0x00, // 00003000
218 0x00, 0x00, 0x40, 0x00, // 00004000
219 0x00, 0x00, 0x50, 0x00, // 00005000
220 0x00, 0x00, 0x60, 0x00, // 00006000
221 0x00, 0x00, 0x70, 0x00, // 00007000
222 0x00, 0x00, 0x80, 0x00, // 00008000
223 0x00, 0x00, 0x90, 0x00, // 00009000
224 0x00, 0x00, 0xA0, 0x00, // 0000A000
225 0x00, 0x00, 0xB0, 0x00, // 0000B000
226 0x00, 0x00, 0xC0, 0x00, // 0000C000
227 0x00, 0x00, 0xD0, 0x00, // 0000D000
228 0x00, 0x00, 0xE0, 0x00, // 0000E000
229 0x00, 0x00, 0xF0, 0x00, // 0000F000
230 0x00, 0x01, 0x00, 0x00, // 00010000
231 0x00, 0x01, 0x10, 0x00, // 00011000
232 0x00, 0x01, 0x20, 0x00, // 00012000
233 0x00, 0x01, 0x30, 0x00, // 00013000
234 0x00, 0x01, 0x40, 0x00, // 00014000
235 0x00, 0x01, 0x50, 0x00, // 00015000
236 0x00, 0x01, 0x60, 0x00, // 00016000
237 0x00, 0x01, 0x70, 0x00, // 00017000
238 0x00, 0x01, 0x80, 0x00, // 00018000
239 0x00, 0x01, 0x90, 0x00, // 00019000
240 0x00, 0x01, 0xA0, 0x00, // 0001A000
241 0x00, 0x01, 0xB0, 0x00, // 0001B000
242 0x00, 0x01, 0xC0, 0x00, // 0001C000
243 0x00, 0x01, 0xD0, 0x00, // 0001D000
244 0x00, 0x01, 0xE0, 0x00, // 0001E000
245 0x00, 0x01, 0xF0, 0x00, // 0001F000
246 0x00, 0x02, 0x00, 0x00, // 00020000
247 0x00, 0x02, 0x10, 0x00, // 00021000
248 0x00, 0x02, 0x20, 0x00, // 00022000
249 0x00, 0x02, 0x30, 0x00, // 00023000
250 0x00, 0x02, 0x40, 0x00, // 00024000
251 0x00, 0x00, 0x05, 0xFF, // 000005FF
252 0x00, 0x00, 0x00, 0x00, // 00000000
253 0x00, 0x00, 0x00, 0x00, // 00000000
254 0x00, 0x00, 0x00, 0x00, // 00000000
255 0x00, 0x00, 0x00, 0x90, // 00000090
256 0x00, 0x00, 0x00, 0x90, // 00000090
257 0x00, 0x00, 0x00, 0x90, // 00000090
258 0x00, 0x00, 0x00, 0x20, // 00000020
259 0x00, 0x00, 0x03, 0x00, // 00000300
260 0x00, 0x00, 0x00, 0x20, // 00000020
261 0x00, 0x00, 0x03, 0x00, // 00000300
262 0x00, 0x00, 0x00, 0x20, // 00000020
263 0x00, 0x00, 0x03, 0x00, // 00000300
264 0x00, 0x00, 0x05, 0xFF, // 000005FF
265 0x00, 0x00, 0x00, 0x00, // 00000000
266 0x00, 0x00, 0x00, 0x00, // 00000000
267 0x00, 0x00, 0x00, 0x00, // 00000000
268 0x00, 0x00, 0x00, 0x90, // 00000090
269 0x00, 0x00, 0x00, 0x90, // 00000090
270 0x00, 0x00, 0x00, 0x90, // 00000090
271 0x00, 0x00, 0x00, 0x00, // 00000000
272 0x00, 0x00, 0x00, 0x00, // 00000000
273 0x00, 0x00, 0x00, 0x00, // 00000000
274 0x00, 0x00, 0x00, 0x00, // 00000000
275 0x00, 0x00, 0x00, 0x00, // 00000000
276 0x00, 0x00, 0x00, 0x0C, // 0000000C
277};
278// address 06640 count 12 (54 bytes)
279static const unsigned char maspcm_array7[] = {
280 0xf0, 0x00, 0x00, 0x0c, 0x06, 0x40,
281 0x00, 0x00, 0x00, 0x00, // 00000000
282 0x00, 0x00, 0x00, 0x00, // 00000000
283 0x00, 0x00, 0x00, 0x00, // 00000000
284 0x00, 0x00, 0x00, 0x00, // 00000000
285 0x00, 0x00, 0x00, 0x00, // 00000000
286 0x00, 0x00, 0x00, 0x00, // 00000000
287 0x00, 0x00, 0x00, 0x00, // 00000000
288 0x00, 0x00, 0x00, 0x00, // 00000000
289 0x00, 0x00, 0x00, 0x00, // 00000000
290 0x00, 0x00, 0x00, 0x00, // 00000000
291 0x00, 0x00, 0x00, 0x00, // 00000000
292 0x00, 0x00, 0x00, 0x00, // 00000000
293};
294// address 06660 count 28 (118 bytes)
295static const unsigned char maspcm_array8[] = {
296 0xf0, 0x00, 0x00, 0x1c, 0x06, 0x60,
297 0x00, 0x00, 0x00, 0x00, // 00000000
298 0x00, 0x00, 0x00, 0x00, // 00000000
299 0x00, 0x00, 0x00, 0x00, // 00000000
300 0x00, 0x00, 0x00, 0x00, // 00000000
301 0x00, 0x00, 0x00, 0x00, // 00000000
302 0x00, 0x00, 0x00, 0x00, // 00000000
303 0x00, 0x00, 0x00, 0x00, // 00000000
304 0x00, 0x00, 0x00, 0x00, // 00000000
305 0x00, 0x00, 0x00, 0x00, // 00000000
306 0x00, 0x00, 0x00, 0x00, // 00000000
307 0x00, 0x00, 0x00, 0x00, // 00000000
308 0x00, 0x00, 0x00, 0x00, // 00000000
309 0x00, 0x00, 0x00, 0x00, // 00000000
310 0x00, 0x00, 0x00, 0x00, // 00000000
311 0x00, 0x00, 0x00, 0x00, // 00000000
312 0x00, 0x00, 0x00, 0x00, // 00000000
313 0x00, 0x00, 0x00, 0x00, // 00000000
314 0x00, 0x00, 0x00, 0x00, // 00000000
315 0x00, 0x00, 0x00, 0x00, // 00000000
316 0x00, 0x00, 0x00, 0x00, // 00000000
317 0x00, 0x00, 0x00, 0x00, // 00000000
318 0x00, 0x00, 0x00, 0x00, // 00000000
319 0x00, 0x00, 0x00, 0x00, // 00000000
320 0x00, 0x00, 0x00, 0x00, // 00000000
321 0x00, 0x00, 0x00, 0x00, // 00000000
322 0x00, 0x00, 0x00, 0x00, // 00000000
323 0x00, 0x00, 0x00, 0x00, // 00000000
324 0x00, 0x00, 0x00, 0x00, // 00000000
325};
326// address 04800 count 1668 (6678 bytes)
327static const unsigned char maspcm_array9[] = {
328 0xe0, 0x00, 0x06, 0x84, 0x08, 0x00,
329 0x00, 0x00, 0x00, 0x00, // 00000000
330 0x00, 0x07, 0x47, 0xC0, // 000747C0
331 0x00, 0x07, 0x04, 0x00, // 00070400
332 0x00, 0x00, 0x00, 0x00, // 00000000
333 0x00, 0x00, 0x00, 0x00, // 00000000
334 0x00, 0x00, 0x00, 0x00, // 00000000
335 0x00, 0x06, 0xC0, 0x6B, // 0006C06B
336 0x00, 0x00, 0x00, 0x00, // 00000000
337 0x00, 0x07, 0x44, 0x01, // 00074401
338 0x00, 0x07, 0x06, 0x90, // 00070690
339 0x00, 0x07, 0x4C, 0x07, // 00074C07
340 0x00, 0x07, 0x0F, 0xFF, // 00070FFF
341 0x00, 0x0B, 0x52, 0x40, // 000B5240
342 0x00, 0x06, 0x80, 0x1D, // 0006801D
343 0x00, 0x06, 0x80, 0x1F, // 0006801F
344 0x00, 0x06, 0x80, 0x21, // 00068021
345 0x00, 0x06, 0x80, 0x23, // 00068023
346 0x00, 0x06, 0x84, 0x1D, // 0006841D
347 0x00, 0x06, 0x84, 0x1F, // 0006841F
348 0x00, 0x06, 0x84, 0x21, // 00068421
349 0x00, 0x06, 0x84, 0x23, // 00068423
350 0x00, 0x06, 0x88, 0x17, // 00068817
351 0x00, 0x06, 0x8C, 0x17, // 00068C17
352 0x00, 0x06, 0xD0, 0x6D, // 0006D06D
353 0x00, 0x07, 0x5C, 0x01, // 00075C01
354 0x00, 0x07, 0x1E, 0x57, // 00071E57
355 0x00, 0x07, 0x44, 0x01, // 00074401
356 0x00, 0x07, 0x06, 0x90, // 00070690
357 0x00, 0x07, 0x4C, 0x07, // 00074C07
358 0x00, 0x07, 0x0F, 0xFF, // 00070FFF
359 0x00, 0x0B, 0x52, 0x40, // 000B5240
360 0x00, 0x06, 0x80, 0x1D, // 0006801D
361 0x00, 0x06, 0x80, 0x1F, // 0006801F
362 0x00, 0x06, 0x80, 0x21, // 00068021
363 0x00, 0x06, 0x80, 0x23, // 00068023
364 0x00, 0x06, 0x84, 0x1D, // 0006841D
365 0x00, 0x06, 0x84, 0x1F, // 0006841F
366 0x00, 0x06, 0x84, 0x21, // 00068421
367 0x00, 0x06, 0x84, 0x23, // 00068423
368 0x00, 0x06, 0x88, 0x17, // 00068817
369 0x00, 0x06, 0x8C, 0x17, // 00068C17
370 0x00, 0x06, 0xD0, 0x6D, // 0006D06D
371 0x00, 0x06, 0x98, 0x1E, // 0006981E
372 0x00, 0x04, 0x05, 0x08, // 00040508
373 0x00, 0x04, 0x0D, 0x08, // 00040D08
374 0x00, 0x04, 0x15, 0x08, // 00041508
375 0x00, 0x04, 0x1D, 0x08, // 00041D08
376 0x00, 0x04, 0x25, 0x08, // 00042508
377 0x00, 0x04, 0x2D, 0x08, // 00042D08
378 0x00, 0x04, 0x35, 0x08, // 00043508
379 0x00, 0x07, 0x7C, 0x00, // 00077C00
380 0x00, 0x07, 0x3C, 0x30, // 00073C30
381 0x00, 0x06, 0x80, 0x3B, // 0006803B
382 0x00, 0x06, 0x88, 0x5B, // 0006885B
383 0x00, 0x06, 0x94, 0x3B, // 0006943B
384 0x00, 0x06, 0x9C, 0x43, // 00069C43
385 0x00, 0x06, 0xA0, 0x53, // 0006A053
386 0x00, 0x06, 0xA8, 0x4B, // 0006A84B
387 0x00, 0x06, 0xB4, 0x53, // 0006B453
388 0x00, 0x06, 0xBC, 0x06, // 0006BC06
389 0x00, 0x07, 0x74, 0x01, // 00077401
390 0x00, 0x07, 0x36, 0x63, // 00073663
391 0x00, 0x02, 0x12, 0x57, // 00021257
392 0x00, 0x07, 0x6C, 0x18, // 00076C18
393 0x00, 0x07, 0x2C, 0x00, // 00072C00
394 0x00, 0x07, 0x7C, 0x04, // 00077C04
395 0x00, 0x07, 0x3C, 0x45, // 00073C45
396 0x00, 0x06, 0xB0, 0x20, // 0006B020
397 0x00, 0x04, 0x36, 0x00, // 00043600
398 0x00, 0x02, 0x12, 0x46, // 00021246
399 0x00, 0x07, 0x7C, 0x04, // 00077C04
400 0x00, 0x07, 0x3C, 0x4C, // 00073C4C
401 0x00, 0x00, 0x00, 0x00, // 00000000
402 0x00, 0x00, 0x00, 0x00, // 00000000
403 0x00, 0x00, 0x00, 0x00, // 00000000
404 0x00, 0x00, 0x00, 0x00, // 00000000
405 0x00, 0x0B, 0x52, 0x40, // 000B5240
406 0x00, 0x07, 0x44, 0x01, // 00074401
407 0x00, 0x07, 0x06, 0x66, // 00070666
408 0x00, 0x0B, 0x49, 0x40, // 000B4940
409 0x00, 0x00, 0x00, 0x00, // 00000000
410 0x00, 0x06, 0x94, 0x7F, // 0006947F
411 0x00, 0x06, 0x80, 0x1C, // 0006801C
412 0x00, 0x07, 0x88, 0x04, // 00078804
413 0x00, 0x07, 0x44, 0x01, // 00074401
414 0x00, 0x07, 0x06, 0x61, // 00070661
415 0x00, 0x0B, 0x49, 0x7F, // 000B497F
416 0x00, 0x00, 0x00, 0x00, // 00000000
417 0x00, 0x00, 0x00, 0x00, // 00000000
418 0x00, 0x06, 0x80, 0x1C, // 0006801C
419 0x00, 0x04, 0x14, 0x00, // 00041400
420 0x00, 0x0A, 0xC1, 0xC2, // 000AC1C2
421 0x00, 0x02, 0x9E, 0x08, // 00029E08
422 0x00, 0x02, 0x10, 0x70, // 00021070
423 0x00, 0x0A, 0xD2, 0x7E, // 000AD27E
424 0x00, 0x00, 0x00, 0x00, // 00000000
425 0x00, 0x00, 0x00, 0x00, // 00000000
426 0x00, 0x00, 0x00, 0x00, // 00000000
427 0x00, 0x07, 0x90, 0x04, // 00079004
428 0x00, 0x00, 0x00, 0x00, // 00000000
429 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
430 0x00, 0x07, 0x0C, 0x00, // 00070C00
431 0x00, 0x00, 0x00, 0x00, // 00000000
432 0x00, 0x0A, 0xC2, 0xC1, // 000AC2C1
433 0x00, 0x02, 0x9F, 0x08, // 00029F08
434 0x00, 0x02, 0x10, 0x85, // 00021085
435 0x00, 0x00, 0x00, 0x00, // 00000000
436 0x00, 0x00, 0x00, 0x00, // 00000000
437 0x00, 0x00, 0x00, 0x00, // 00000000
438 0x00, 0x00, 0x00, 0x00, // 00000000
439 0x00, 0x00, 0x00, 0x00, // 00000000
440 0x00, 0x00, 0x00, 0x00, // 00000000
441 0x00, 0x06, 0x00, 0x6D, // 0006006D
442 0x00, 0x00, 0x00, 0x00, // 00000000
443 0x00, 0x08, 0x00, 0x41, // 00080041
444 0x00, 0x00, 0x00, 0x00, // 00000000
445 0x00, 0x00, 0x00, 0x00, // 00000000
446 0x00, 0x00, 0x00, 0x00, // 00000000
447 0x00, 0x06, 0xC0, 0x6D, // 0006C06D
448 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
449 0x00, 0x07, 0x6C, 0x04, // 00076C04
450 0x00, 0x07, 0x2C, 0x7E, // 00072C7E
451 0x00, 0x00, 0x00, 0x00, // 00000000
452 0x00, 0x00, 0x00, 0x00, // 00000000
453 0x00, 0x00, 0x00, 0x00, // 00000000
454 0x00, 0x00, 0x00, 0x00, // 00000000
455 0x00, 0x02, 0x10, 0x54, // 00021054
456 0x00, 0x00, 0x00, 0x00, // 00000000
457 0x00, 0x00, 0x00, 0x00, // 00000000
458 0x00, 0x00, 0x00, 0x00, // 00000000
459 0x00, 0x00, 0x00, 0x00, // 00000000
460 0x00, 0x00, 0x00, 0x00, // 00000000
461 0x00, 0x00, 0x00, 0x00, // 00000000
462 0x00, 0x09, 0x80, 0x74, // 00098074
463 0x00, 0x07, 0x5C, 0x00, // 00075C00
464 0x00, 0x07, 0x1F, 0x00, // 00071F00
465 0x00, 0x08, 0x80, 0x42, // 00088042
466 0x00, 0x02, 0x9F, 0x10, // 00029F10
467 0x00, 0x02, 0x11, 0x51, // 00021151
468 0x00, 0x02, 0x81, 0x28, // 00028128
469 0x00, 0x0A, 0xC2, 0xC3, // 000AC2C3
470 0x00, 0x00, 0x00, 0x00, // 00000000
471 0x00, 0x09, 0x80, 0x78, // 00098078
472 0x00, 0x00, 0x00, 0x00, // 00000000
473 0x00, 0x08, 0x80, 0x42, // 00088042
474 0x00, 0x02, 0x9F, 0x10, // 00029F10
475 0x00, 0x02, 0x11, 0x51, // 00021151
476 0x00, 0x02, 0x81, 0x28, // 00028128
477 0x00, 0x07, 0x4C, 0x00, // 00074C00
478 0x00, 0x07, 0x0F, 0x00, // 00070F00
479 0x00, 0x07, 0x44, 0x01, // 00074401
480 0x00, 0x07, 0x06, 0x66, // 00070666
481 0x00, 0x07, 0x56, 0x00, // 00075600
482 0x00, 0x07, 0x14, 0x03, // 00071403
483 0x00, 0x06, 0x8C, 0x3B, // 00068C3B
484 0x00, 0x00, 0x00, 0x00, // 00000000
485 0x00, 0x06, 0x80, 0x1C, // 0006801C
486 0x00, 0x07, 0x90, 0x04, // 00079004
487 0x00, 0x07, 0x6C, 0x00, // 00076C00
488 0x00, 0x07, 0x2F, 0x00, // 00072F00
489 0x00, 0x07, 0x44, 0x00, // 00074400
490 0x00, 0x07, 0x04, 0x00, // 00070400
491 0x00, 0x0B, 0x49, 0x40, // 000B4940
492 0x00, 0x06, 0xAC, 0x05, // 0006AC05
493 0x00, 0x01, 0x41, 0x00, // 00014100
494 0x00, 0x06, 0x84, 0x1C, // 0006841C
495 0x00, 0x07, 0x8C, 0x0C, // 00078C0C
496 0x00, 0x07, 0x8C, 0x0C, // 00078C0C
497 0x00, 0x07, 0x5C, 0x01, // 00075C01
498 0x00, 0x07, 0x1C, 0x90, // 00071C90
499 0x00, 0x07, 0x54, 0x00, // 00075400
500 0x00, 0x07, 0x17, 0x00, // 00071700
501 0x00, 0x07, 0x64, 0x01, // 00076401
502 0x00, 0x07, 0x25, 0xFF, // 000725FF
503 0x00, 0x07, 0x4C, 0x00, // 00074C00
504 0x00, 0x07, 0x0C, 0x00, // 00070C00
505 0x00, 0x07, 0x6C, 0x00, // 00076C00
506 0x00, 0x07, 0x2C, 0x00, // 00072C00
507 0x00, 0x06, 0x9C, 0x25, // 00069C25
508 0x00, 0x06, 0x98, 0x2D, // 0006982D
509 0x00, 0x06, 0x94, 0x3C, // 0006943C
510 0x00, 0x06, 0xA4, 0x16, // 0006A416
511 0x00, 0x06, 0xA0, 0x16, // 0006A016
512 0x00, 0x06, 0x8C, 0x3B, // 00068C3B
513 0x00, 0x06, 0xAC, 0x24, // 0006AC24
514 0x00, 0x07, 0x4C, 0x01, // 00074C01
515 0x00, 0x07, 0x0F, 0x00, // 00070F00
516 0x00, 0x0B, 0x52, 0x6F, // 000B526F
517 0x00, 0x07, 0x5C, 0x00, // 00075C00
518 0x00, 0x07, 0x1E, 0x90, // 00071E90
519 0x00, 0x00, 0x00, 0x00, // 00000000
520 0x00, 0x06, 0x88, 0x1E, // 0006881E
521 0x00, 0x06, 0x90, 0x15, // 00069015
522 0x00, 0x06, 0x98, 0x1F, // 0006981F
523 0x00, 0x0B, 0x40, 0x40, // 000B4040
524 0x00, 0x00, 0x00, 0x00, // 00000000
525 0x00, 0x00, 0x00, 0x00, // 00000000
526 0x00, 0x00, 0x00, 0x00, // 00000000
527 0x00, 0x06, 0x84, 0x6F, // 0006846F
528 0x00, 0x06, 0x84, 0x70, // 00068470
529 0x00, 0x04, 0x05, 0x10, // 00040510
530 0x00, 0x07, 0x74, 0x01, // 00077401
531 0x00, 0x07, 0x36, 0x63, // 00073663
532 0x00, 0x02, 0x12, 0x57, // 00021257
533 0x00, 0x06, 0x80, 0x1C, // 0006801C
534 0x00, 0x04, 0x2C, 0x08, // 00042C08
535 0x00, 0x07, 0x7C, 0x04, // 00077C04
536 0x00, 0x07, 0x3C, 0xD2, // 00073CD2
537 0x00, 0x06, 0xB0, 0x22, // 0006B022
538 0x00, 0x04, 0x37, 0x08, // 00043708
539 0x00, 0x04, 0x14, 0x20, // 00041420
540 0x00, 0x04, 0x07, 0x00, // 00040700
541 0x00, 0x07, 0x66, 0x00, // 00076600
542 0x00, 0x07, 0x24, 0x00, // 00072400
543 0x00, 0x07, 0x5C, 0x80, // 00075C80
544 0x00, 0x07, 0x1C, 0x00, // 00071C00
545 0x00, 0x07, 0x7C, 0x00, // 00077C00
546 0x00, 0x07, 0x3D, 0x00, // 00073D00
547 0x00, 0x0A, 0xC8, 0xC4, // 000AC8C4
548 0x00, 0x02, 0x9F, 0x08, // 00029F08
549 0x00, 0x08, 0x36, 0xC4, // 000836C4
550 0x00, 0x0A, 0xC8, 0xC3, // 000AC8C3
551 0x00, 0x02, 0x9F, 0x08, // 00029F08
552 0x00, 0x08, 0x12, 0x41, // 00081241
553 0x00, 0x0A, 0xC8, 0xC7, // 000AC8C7
554 0x00, 0x02, 0x9F, 0x08, // 00029F08
555 0x00, 0x0B, 0x52, 0x40, // 000B5240
556 0x00, 0x02, 0x12, 0x46, // 00021246
557 0x00, 0x09, 0x92, 0x51, // 00099251
558 0x00, 0x08, 0x36, 0xC2, // 000836C2
559 0x00, 0x07, 0x7C, 0x04, // 00077C04
560 0x00, 0x07, 0x3C, 0xEA, // 00073CEA
561 0x00, 0x06, 0xAC, 0x6D, // 0006AC6D
562 0x00, 0x06, 0xAC, 0x6C, // 0006AC6C
563 0x00, 0x0B, 0x7F, 0x7F, // 000B7F7F
564 0x00, 0x09, 0xB6, 0x7D, // 0009B67D
565 0x00, 0x0A, 0x3F, 0x53, // 000A3F53
566 0x00, 0x07, 0x64, 0x00, // 00076400
567 0x00, 0x0A, 0xF6, 0x43, // 000AF643
568 0x00, 0x07, 0x24, 0x00, // 00072400
569 0x00, 0x07, 0x54, 0x00, // 00075400
570 0x00, 0x07, 0x14, 0x00, // 00071400
571 0x00, 0x07, 0x5C, 0x00, // 00075C00
572 0x00, 0x07, 0x1F, 0x18, // 00071F18
573 0x00, 0x07, 0x6C, 0x04, // 00076C04
574 0x00, 0x07, 0x2C, 0x00, // 00072C00
575 0x00, 0x04, 0x0C, 0x08, // 00040C08
576 0x00, 0x08, 0xB6, 0x41, // 0008B641
577 0x00, 0x0A, 0x09, 0xC6, // 000A09C6
578 0x00, 0x08, 0x8F, 0xC1, // 00088FC1
579 0x00, 0x00, 0x00, 0x00, // 00000000
580 0x00, 0x0C, 0x09, 0x25, // 000C0925
581 0x00, 0x07, 0x44, 0x00, // 00074400
582 0x00, 0x07, 0x04, 0x00, // 00070400
583 0x00, 0x06, 0x98, 0x53, // 00069853
584 0x00, 0x06, 0x90, 0x2C, // 0006902C
585 0x00, 0x06, 0xA4, 0x24, // 0006A424
586 0x00, 0x06, 0x80, 0x53, // 00068053
587 0x00, 0x06, 0x88, 0x54, // 00068854
588 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
589 0x00, 0x07, 0x0C, 0x00, // 00070C00
590 0x00, 0x06, 0x14, 0x6F, // 0006146F
591 0x00, 0x06, 0x00, 0x52, // 00060052
592 0x00, 0x08, 0x12, 0x41, // 00081241
593 0x00, 0x06, 0x1C, 0x70, // 00061C70
594 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
595 0x00, 0x02, 0x9F, 0x38, // 00029F38
596 0x00, 0x0A, 0x09, 0x74, // 000A0974
597 0x00, 0x00, 0x00, 0x00, // 00000000
598 0x00, 0x0A, 0xC9, 0x43, // 000AC943
599 0x00, 0x00, 0x00, 0x00, // 00000000
600 0x00, 0x08, 0xA1, 0x42, // 0008A142
601 0x00, 0x02, 0x9E, 0x08, // 00029E08
602 0x00, 0x08, 0x1B, 0x41, // 00081B41
603 0x00, 0x00, 0x00, 0x00, // 00000000
604 0x00, 0x00, 0x00, 0x00, // 00000000
605 0x00, 0x06, 0x94, 0x6F, // 0006946F
606 0x00, 0x06, 0x9C, 0x70, // 00069C70
607 0x00, 0x06, 0x00, 0x6D, // 0006006D
608 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
609 0x00, 0x0B, 0x00, 0x41, // 000B0041
610 0x00, 0x07, 0x6C, 0x04, // 00076C04
611 0x00, 0x07, 0x2D, 0x1E, // 00072D1E
612 0x00, 0x00, 0x00, 0x00, // 00000000
613 0x00, 0x06, 0x80, 0x6D, // 0006806D
614 0x00, 0x00, 0x00, 0x00, // 00000000
615 0x00, 0x06, 0x04, 0x24, // 00060424
616 0x00, 0x07, 0x54, 0x01, // 00075401
617 0x00, 0x07, 0x16, 0x61, // 00071661
618 0x00, 0x08, 0x8C, 0x80, // 00088C80
619 0x00, 0x02, 0x89, 0x10, // 00028910
620 0x00, 0x02, 0x11, 0x03, // 00021103
621 0x00, 0x02, 0x81, 0x28, // 00028128
622 0x00, 0x06, 0x90, 0x22, // 00069022
623 0x00, 0x04, 0x07, 0x00, // 00040700
624 0x00, 0x07, 0x54, 0x0C, // 0007540C
625 0x00, 0x07, 0x14, 0x00, // 00071400
626 0x00, 0x0A, 0xD8, 0x7E, // 000AD87E
627 0x00, 0x0A, 0xC8, 0x41, // 000AC841
628 0x00, 0x02, 0x9F, 0x20, // 00029F20
629 0x00, 0x0A, 0xC8, 0xC2, // 000AC8C2
630 0x00, 0x02, 0x9E, 0x10, // 00029E10
631 0x00, 0x02, 0x10, 0x08, // 00021008
632 0x00, 0x02, 0x81, 0x28, // 00028128
633 0x00, 0x07, 0x98, 0x07, // 00079807
634 0x00, 0x06, 0x04, 0x6F, // 0006046F
635 0x00, 0x06, 0x0C, 0x70, // 00060C70
636 0x00, 0x0A, 0x10, 0x7D, // 000A107D
637 0x00, 0x08, 0x90, 0xC2, // 000890C2
638 0x00, 0x08, 0x99, 0xC2, // 000899C2
639 0x00, 0x02, 0x86, 0x10, // 00028610
640 0x00, 0x02, 0x10, 0xC2, // 000210C2
641 0x00, 0x02, 0x81, 0x28, // 00028128
642 0x00, 0x07, 0x4C, 0x01, // 00074C01
643 0x00, 0x07, 0x0E, 0x6B, // 00070E6B
644 0x00, 0x0B, 0x52, 0x50, // 000B5250
645 0x00, 0x00, 0x00, 0x00, // 00000000
646 0x00, 0x00, 0x00, 0x00, // 00000000
647 0x00, 0x06, 0x88, 0x1C, // 0006881C
648 0x00, 0x0A, 0xCC, 0x82, // 000ACC82
649 0x00, 0x04, 0x1D, 0x88, // 00041D88
650 0x00, 0x04, 0x1D, 0x00, // 00041D00
651 0x00, 0x08, 0x09, 0xC3, // 000809C3
652 0x00, 0x00, 0x00, 0x00, // 00000000
653 0x00, 0x00, 0x00, 0x00, // 00000000
654 0x00, 0x00, 0x00, 0x00, // 00000000
655 0x00, 0x07, 0x88, 0x04, // 00078804
656 0x00, 0x07, 0x44, 0x01, // 00074401
657 0x00, 0x07, 0x06, 0x90, // 00070690
658 0x00, 0x07, 0x4C, 0x00, // 00074C00
659 0x00, 0x07, 0x0F, 0x00, // 00070F00
660 0x00, 0x07, 0x54, 0x00, // 00075400
661 0x00, 0x07, 0x17, 0x18, // 00071718
662 0x00, 0x06, 0x80, 0x1F, // 0006801F
663 0x00, 0x06, 0x8C, 0x3B, // 00068C3B
664 0x00, 0x00, 0x00, 0x00, // 00000000
665 0x00, 0x06, 0x90, 0x53, // 00069053
666 0x00, 0x07, 0x4C, 0x01, // 00074C01
667 0x00, 0x07, 0x0E, 0x65, // 00070E65
668 0x00, 0x0B, 0x52, 0x40, // 000B5240
669 0x00, 0x07, 0x64, 0x01, // 00076401
670 0x00, 0x07, 0x26, 0x68, // 00072668
671 0x00, 0x06, 0x88, 0x20, // 00068820
672 0x00, 0x07, 0x90, 0x06, // 00079006
673 0x00, 0x06, 0x94, 0x7F, // 0006947F
674 0x00, 0x06, 0xA0, 0x22, // 0006A022
675 0x00, 0x07, 0x90, 0x07, // 00079007
676 0x00, 0x07, 0x4C, 0x01, // 00074C01
677 0x00, 0x07, 0x0E, 0x6B, // 00070E6B
678 0x00, 0x00, 0x00, 0x00, // 00000000
679 0x00, 0x00, 0x00, 0x00, // 00000000
680 0x00, 0x00, 0x00, 0x00, // 00000000
681 0x00, 0x06, 0x88, 0x20, // 00068820
682 0x00, 0x04, 0x0E, 0x00, // 00040E00
683 0x00, 0x07, 0x5C, 0x00, // 00075C00
684 0x00, 0x07, 0x1C, 0x40, // 00071C40
685 0x00, 0x0B, 0x40, 0x7F, // 000B407F
686 0x00, 0x0A, 0xD1, 0xC3, // 000AD1C3
687 0x00, 0x02, 0x9F, 0x08, // 00029F08
688 0x00, 0x0B, 0x40, 0x40, // 000B4040
689 0x00, 0x00, 0x00, 0x00, // 00000000
690 0x00, 0x00, 0x00, 0x00, // 00000000
691 0x00, 0x00, 0x00, 0x00, // 00000000
692 0x00, 0x06, 0x80, 0x6A, // 0006806A
693 0x00, 0x07, 0x5C, 0x00, // 00075C00
694 0x00, 0x07, 0x1C, 0x20, // 00071C20
695 0x00, 0x0B, 0x40, 0x40, // 000B4040
696 0x00, 0x0A, 0xD1, 0xC3, // 000AD1C3
697 0x00, 0x02, 0x9F, 0x08, // 00029F08
698 0x00, 0x0B, 0x40, 0x7F, // 000B407F
699 0x00, 0x00, 0x00, 0x00, // 00000000
700 0x00, 0x00, 0x00, 0x00, // 00000000
701 0x00, 0x00, 0x00, 0x00, // 00000000
702 0x00, 0x06, 0x80, 0x6C, // 0006806C
703 0x00, 0x07, 0x5C, 0x00, // 00075C00
704 0x00, 0x07, 0x1C, 0x10, // 00071C10
705 0x00, 0x0B, 0x40, 0x40, // 000B4040
706 0x00, 0x0A, 0xD1, 0xC3, // 000AD1C3
707 0x00, 0x02, 0x9F, 0x08, // 00029F08
708 0x00, 0x0B, 0x40, 0x7F, // 000B407F
709 0x00, 0x00, 0x00, 0x00, // 00000000
710 0x00, 0x00, 0x00, 0x00, // 00000000
711 0x00, 0x00, 0x00, 0x00, // 00000000
712 0x00, 0x06, 0x80, 0x76, // 00068076
713 0x00, 0x07, 0x5C, 0x01, // 00075C01
714 0x00, 0x07, 0x1E, 0x67, // 00071E67
715 0x00, 0x07, 0x44, 0x01, // 00074401
716 0x00, 0x07, 0x06, 0xE4, // 000706E4
717 0x00, 0x0A, 0xD1, 0x4F, // 000AD14F
718 0x00, 0x08, 0x10, 0xC2, // 000810C2
719 0x00, 0x00, 0x00, 0x00, // 00000000
720 0x00, 0x06, 0x98, 0x1C, // 0006981C
721 0x00, 0x07, 0x90, 0x04, // 00079004
722 0x00, 0x06, 0x90, 0x1C, // 0006901C
723 0x00, 0x04, 0x14, 0x00, // 00041400
724 0x00, 0x00, 0x00, 0x00, // 00000000
725 0x00, 0x00, 0x00, 0x00, // 00000000
726 0x00, 0x00, 0x00, 0x00, // 00000000
727 0x00, 0x06, 0x90, 0x22, // 00069022
728 0x00, 0x04, 0x2F, 0x08, // 00042F08
729 0x00, 0x07, 0x44, 0x01, // 00074401
730 0x00, 0x07, 0x06, 0x61, // 00070661
731 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
732 0x00, 0x07, 0x0F, 0x00, // 00070F00
733 0x00, 0x07, 0x54, 0x08, // 00075408
734 0x00, 0x07, 0x16, 0x00, // 00071600
735 0x00, 0x06, 0x80, 0x1C, // 0006801C
736 0x00, 0x0A, 0xCC, 0x81, // 000ACC81
737 0x00, 0x08, 0x92, 0xC1, // 000892C1
738 0x00, 0x02, 0x9E, 0x10, // 00029E10
739 0x00, 0x02, 0x11, 0xBD, // 000211BD
740 0x00, 0x02, 0x81, 0x28, // 00028128
741 0x00, 0x07, 0x74, 0x01, // 00077401
742 0x00, 0x02, 0x12, 0x57, // 00021257
743 0x00, 0x07, 0x36, 0x63, // 00073663
744 0x00, 0x00, 0x00, 0x00, // 00000000
745 0x00, 0x07, 0x7C, 0x04, // 00077C04
746 0x00, 0x07, 0x3D, 0xA4, // 00073DA4
747 0x00, 0x06, 0xB0, 0x20, // 0006B020
748 0x00, 0x04, 0x36, 0x08, // 00043608
749 0x00, 0x04, 0x17, 0x08, // 00041708
750 0x00, 0x04, 0x06, 0x00, // 00040600
751 0x00, 0x07, 0x66, 0x00, // 00076600
752 0x00, 0x07, 0x24, 0x00, // 00072400
753 0x00, 0x07, 0x5C, 0x80, // 00075C80
754 0x00, 0x07, 0x1C, 0x00, // 00071C00
755 0x00, 0x07, 0x7C, 0x00, // 00077C00
756 0x00, 0x07, 0x3D, 0x00, // 00073D00
757 0x00, 0x0A, 0xC8, 0xC4, // 000AC8C4
758 0x00, 0x02, 0x9F, 0x08, // 00029F08
759 0x00, 0x08, 0x36, 0xC4, // 000836C4
760 0x00, 0x0A, 0xC8, 0xC3, // 000AC8C3
761 0x00, 0x02, 0x9F, 0x08, // 00029F08
762 0x00, 0x08, 0x12, 0x41, // 00081241
763 0x00, 0x0A, 0xC8, 0xC7, // 000AC8C7
764 0x00, 0x02, 0x9F, 0x08, // 00029F08
765 0x00, 0x0B, 0x52, 0x40, // 000B5240
766 0x00, 0x00, 0x00, 0x00, // 00000000
767 0x00, 0x02, 0x12, 0x46, // 00021246
768 0x00, 0x09, 0x92, 0x51, // 00099251
769 0x00, 0x08, 0x36, 0xC2, // 000836C2
770 0x00, 0x07, 0x7C, 0x04, // 00077C04
771 0x00, 0x07, 0x3D, 0xBF, // 00073DBF
772 0x00, 0x06, 0xAC, 0x6D, // 0006AC6D
773 0x00, 0x06, 0xAC, 0x6C, // 0006AC6C
774 0x00, 0x04, 0x06, 0x08, // 00040608
775 0x00, 0x04, 0x07, 0x08, // 00040708
776 0x00, 0x07, 0x4C, 0x01, // 00074C01
777 0x00, 0x07, 0x0E, 0x62, // 00070E62
778 0x00, 0x07, 0x54, 0x00, // 00075400
779 0x00, 0x07, 0x14, 0x2D, // 0007142D
780 0x00, 0x00, 0x00, 0x00, // 00000000
781 0x00, 0x06, 0x88, 0x1C, // 0006881C
782 0x00, 0x04, 0x0C, 0x00, // 00040C00
783 0x00, 0x0A, 0xD2, 0xC1, // 000AD2C1
784 0x00, 0x00, 0x00, 0x00, // 00000000
785 0x00, 0x00, 0x00, 0x00, // 00000000
786 0x00, 0x00, 0x00, 0x00, // 00000000
787 0x00, 0x06, 0x90, 0x4F, // 0006904F
788 0x00, 0x06, 0x94, 0x77, // 00069477
789 0x00, 0x07, 0x44, 0x01, // 00074401
790 0x00, 0x07, 0x06, 0x39, // 00070639
791 0x00, 0x07, 0x4C, 0x01, // 00074C01
792 0x00, 0x07, 0x0E, 0x61, // 00070E61
793 0x00, 0x07, 0x54, 0x12, // 00075412
794 0x00, 0x07, 0x14, 0x30, // 00071430
795 0x00, 0x06, 0x84, 0x1C, // 0006841C
796 0x00, 0x07, 0x5C, 0x00, // 00075C00
797 0x00, 0x07, 0x1C, 0x00, // 00071C00
798 0x00, 0x06, 0x88, 0x1C, // 0006881C
799 0x00, 0x04, 0x0C, 0x00, // 00040C00
800 0x00, 0x04, 0x27, 0x08, // 00042708
801 0x00, 0x04, 0x37, 0x08, // 00043708
802 0x00, 0x09, 0xAC, 0x7F, // 0009AC7F
803 0x00, 0x0A, 0xC1, 0x50, // 000AC150
804 0x00, 0x02, 0x9E, 0x08, // 00029E08
805 0x00, 0x0A, 0x24, 0x7F, // 000A247F
806 0x00, 0x0A, 0xC9, 0xC2, // 000AC9C2
807 0x00, 0x08, 0x0B, 0xC1, // 00080BC1
808 0x00, 0x00, 0x00, 0x00, // 00000000
809 0x00, 0x07, 0xA4, 0x00, // 0007A400
810 0x00, 0x0B, 0x40, 0x40, // 000B4040
811 0x00, 0x07, 0x8C, 0x00, // 00078C00
812 0x00, 0x07, 0xAC, 0x00, // 0007AC00
813 0x00, 0x04, 0xA8, 0x00, // 0004A800
814 0x00, 0x07, 0xB4, 0x00, // 0007B400
815 0x00, 0x06, 0x84, 0x45, // 00068445
816 0x00, 0x06, 0x84, 0x46, // 00068446
817 0x00, 0x07, 0x54, 0x01, // 00075401
818 0x00, 0x07, 0x16, 0x40, // 00071640
819 0x00, 0x07, 0x64, 0x00, // 00076400
820 0x00, 0x07, 0x26, 0x90, // 00072690
821 0x00, 0x0B, 0x49, 0x75, // 000B4975
822 0x00, 0x06, 0x94, 0x1E, // 0006941E
823 0x00, 0x00, 0x00, 0x00, // 00000000
824 0x00, 0x06, 0xA4, 0x1F, // 0006A41F
825 0x00, 0x06, 0x8C, 0x15, // 00068C15
826 0x00, 0x07, 0x44, 0x01, // 00074401
827 0x00, 0x07, 0x06, 0x6A, // 0007066A
828 0x00, 0x04, 0x0F, 0x08, // 00040F08
829 0x00, 0x04, 0x17, 0x08, // 00041708
830 0x00, 0x04, 0x1F, 0x08, // 00041F08
831 0x00, 0x04, 0x27, 0x08, // 00042708
832 0x00, 0x04, 0x2F, 0x08, // 00042F08
833 0x00, 0x06, 0x80, 0x22, // 00068022
834 0x00, 0x04, 0x07, 0x00, // 00040700
835 0x00, 0x06, 0xA4, 0x65, // 0006A465
836 0x00, 0x00, 0x00, 0x00, // 00000000
837 0x00, 0x00, 0x00, 0x00, // 00000000
838 0x00, 0x07, 0x84, 0x0D, // 0007840D
839 0x00, 0x07, 0x8C, 0x5D, // 00078C5D
840 0x00, 0x06, 0xAC, 0x79, // 0006AC79
841 0x00, 0x07, 0x44, 0x01, // 00074401
842 0x00, 0x07, 0x06, 0x6C, // 0007066C
843 0x00, 0x0B, 0x76, 0x41, // 000B7641
844 0x00, 0x00, 0x00, 0x00, // 00000000
845 0x00, 0x00, 0x00, 0x00, // 00000000
846 0x00, 0x06, 0x80, 0x22, // 00068022
847 0x00, 0x0C, 0x0B, 0x0D, // 000C0B0D
848 0x00, 0x0C, 0x13, 0x0D, // 000C130D
849 0x00, 0x0C, 0x1B, 0x0D, // 000C1B0D
850 0x00, 0x0C, 0x23, 0x0D, // 000C230D
851 0x00, 0x00, 0x00, 0x00, // 00000000
852 0x00, 0x00, 0x00, 0x00, // 00000000
853 0x00, 0x06, 0xB4, 0x6A, // 0006B46A
854 0x00, 0x06, 0x8C, 0x66, // 00068C66
855 0x00, 0x06, 0x94, 0x67, // 00069467
856 0x00, 0x06, 0x9C, 0x68, // 00069C68
857 0x00, 0x06, 0xA4, 0x69, // 0006A469
858 0x00, 0x07, 0x64, 0x01, // 00076401
859 0x00, 0x07, 0x27, 0x12, // 00072712
860 0x00, 0x06, 0x80, 0x22, // 00068022
861 0x00, 0x04, 0x03, 0x00, // 00040300
862 0x00, 0x04, 0x0B, 0x00, // 00040B00
863 0x00, 0x04, 0x13, 0x00, // 00041300
864 0x00, 0x04, 0x1B, 0x00, // 00041B00
865 0x00, 0x06, 0xA0, 0x22, // 0006A022
866 0x00, 0x07, 0x80, 0x0F, // 0007800F
867 0x00, 0x07, 0x88, 0x0F, // 0007880F
868 0x00, 0x07, 0x90, 0x0F, // 0007900F
869 0x00, 0x07, 0x98, 0x07, // 00079807
870 0x00, 0x00, 0x00, 0x00, // 00000000
871 0x00, 0x07, 0x44, 0x01, // 00074401
872 0x00, 0x07, 0x06, 0x61, // 00070661
873 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
874 0x00, 0x07, 0x0C, 0x00, // 00070C00
875 0x00, 0x00, 0x00, 0x00, // 00000000
876 0x00, 0x06, 0x80, 0x1C, // 0006801C
877 0x00, 0x0A, 0xC4, 0x81, // 000AC481
878 0x00, 0x00, 0x00, 0x00, // 00000000
879 0x00, 0x09, 0x80, 0x74, // 00098074
880 0x00, 0x00, 0x00, 0x00, // 00000000
881 0x00, 0x0B, 0x52, 0x40, // 000B5240
882 0x00, 0x07, 0x5C, 0x01, // 00075C01
883 0x00, 0x07, 0x1E, 0x66, // 00071E66
884 0x00, 0x07, 0x64, 0x04, // 00076404
885 0x00, 0x07, 0x24, 0x08, // 00072408
886 0x00, 0x08, 0x88, 0x41, // 00088841
887 0x00, 0x02, 0x9E, 0x08, // 00029E08
888 0x00, 0x02, 0x12, 0x8F, // 0002128F
889 0x00, 0x07, 0x56, 0x00, // 00075600
890 0x00, 0x07, 0x14, 0x01, // 00071401
891 0x00, 0x06, 0xA0, 0x08, // 0006A008
892 0x00, 0x00, 0x00, 0x00, // 00000000
893 0x00, 0x06, 0x98, 0x20, // 00069820
894 0x00, 0x07, 0x90, 0x06, // 00079006
895 0x00, 0x08, 0x98, 0x42, // 00089842
896 0x00, 0x02, 0x9E, 0x08, // 00029E08
897 0x00, 0x02, 0x18, 0x00, // 00021800
898 0x00, 0x07, 0x56, 0x00, // 00075600
899 0x00, 0x07, 0x14, 0x02, // 00071402
900 0x00, 0x00, 0x00, 0x00, // 00000000
901 0x00, 0x00, 0x00, 0x00, // 00000000
902 0x00, 0x00, 0x00, 0x00, // 00000000
903 0x00, 0x07, 0x90, 0x06, // 00079006
904 0x00, 0x02, 0x10, 0x54, // 00021054
905 0x00, 0x00, 0x00, 0x00, // 00000000
906 0x00, 0x00, 0x00, 0x00, // 00000000
907 0x00, 0x00, 0x00, 0x00, // 00000000
908 0x00, 0x00, 0x00, 0x00, // 00000000
909 0x00, 0x00, 0x00, 0x00, // 00000000
910 0x00, 0x00, 0x00, 0x00, // 00000000
911 0x00, 0x0B, 0x64, 0x68, // 000B6468
912 0x00, 0x0A, 0xBE, 0xC4, // 000ABEC4
913 0x00, 0x09, 0xA4, 0x46, // 0009A446
914 0x00, 0x0B, 0x7F, 0xC7, // 000B7FC7
915 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
916 0x00, 0x00, 0x00, 0x00, // 00000000
917 0x00, 0x06, 0xA4, 0x05, // 0006A405
918 0x00, 0x06, 0xBC, 0x0D, // 0006BC0D
919 0x00, 0x01, 0x41, 0x00, // 00014100
920 0x00, 0x06, 0xAC, 0x0F, // 0006AC0F
921 0x00, 0x00, 0x00, 0x00, // 00000000
922 0x00, 0x00, 0x00, 0x00, // 00000000
923 0x00, 0x00, 0xC1, 0x87, // 0000C187
924 0x00, 0x06, 0xB4, 0x0D, // 0006B40D
925 0x00, 0x00, 0x00, 0x00, // 00000000
926 0x00, 0x00, 0x00, 0x00, // 00000000
927 0x00, 0x00, 0x00, 0x00, // 00000000
928 0x00, 0x09, 0xBD, 0x4A, // 0009BD4A
929 0x00, 0x09, 0xB6, 0x7C, // 0009B67C
930 0x00, 0x0A, 0xE4, 0x40, // 000AE440
931 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
932 0x00, 0x07, 0x6F, 0xFF, // 00076FFF
933 0x00, 0x07, 0x2F, 0xFF, // 00072FFF
934 0x00, 0x01, 0x03, 0xA6, // 000103A6
935 0x00, 0x0A, 0x2D, 0x7C, // 000A2D7C
936 0x00, 0x09, 0xA4, 0x41, // 0009A441
937 0x00, 0x09, 0xBF, 0x41, // 0009BF41
938 0x00, 0x08, 0xE4, 0xC5, // 0008E4C5
939 0x00, 0x09, 0x1E, 0xC4, // 00091EC4
940 0x00, 0x02, 0x87, 0x10, // 00028710
941 0x00, 0x0A, 0xE3, 0xC3, // 000AE3C3
942 0x00, 0x08, 0xBF, 0xC5, // 0008BFC5
943 0x00, 0x07, 0x75, 0xD9, // 000775D9
944 0x00, 0x07, 0x36, 0x23, // 00073623
945 0x00, 0x09, 0xA7, 0x40, // 0009A740
946 0x00, 0x07, 0x6D, 0x14, // 00076D14
947 0x00, 0x0C, 0x36, 0x27, // 000C3627
948 0x00, 0x07, 0x2F, 0x2C, // 00072F2C
949 0x00, 0x0B, 0x7D, 0x75, // 000B7D75
950 0x00, 0x08, 0xAD, 0xC4, // 0008ADC4
951 0x00, 0x00, 0xC7, 0x87, // 0000C787
952 0x00, 0x0A, 0x6E, 0xC6, // 000A6EC6
953 0x00, 0x09, 0xA4, 0x44, // 0009A444
954 0x00, 0x08, 0xAD, 0x41, // 0008AD41
955 0x00, 0x09, 0xA4, 0xC5, // 0009A4C5
956 0x00, 0x09, 0xAD, 0x43, // 0009AD43
957 0x00, 0x09, 0xB4, 0x6D, // 0009B46D
958 0x00, 0x09, 0xA4, 0x49, // 0009A449
959 0x00, 0x0A, 0xF6, 0x7F, // 000AF67F
960 0x00, 0x0A, 0x24, 0x77, // 000A2477
961 0x00, 0x02, 0x86, 0x30, // 00028630
962 0x00, 0x08, 0x36, 0x41, // 00083641
963 0x00, 0x08, 0xBE, 0x48, // 0008BE48
964 0x00, 0x02, 0x87, 0x18, // 00028718
965 0x00, 0x09, 0xA4, 0x49, // 0009A449
966 0x00, 0x08, 0xB6, 0x41, // 0008B641
967 0x00, 0x09, 0xA4, 0x77, // 0009A477
968 0x00, 0x0B, 0x7F, 0x74, // 000B7F74
969 0x00, 0x08, 0xB6, 0x44, // 0008B644
970 0x00, 0x02, 0x9E, 0x20, // 00029E20
971 0x00, 0x0B, 0x5B, 0x41, // 000B5B41
972 0x00, 0x08, 0x36, 0x41, // 00083641
973 0x00, 0x09, 0x9B, 0x53, // 00099B53
974 0x00, 0x08, 0x24, 0xC3, // 000824C3
975 0x00, 0x08, 0xB6, 0x41, // 0008B641
976 0x00, 0x00, 0xC7, 0x87, // 0000C787
977 0x00, 0x00, 0xC1, 0x07, // 0000C107
978 0x00, 0x09, 0xB6, 0x4F, // 0009B64F
979 0x00, 0x08, 0x35, 0xC6, // 000835C6
980 0x00, 0x0B, 0x3F, 0xC7, // 000B3FC7
981 0x00, 0x0A, 0xEC, 0xC4, // 000AECC4
982 0x00, 0x00, 0x00, 0x00, // 00000000
983 0x00, 0x00, 0x00, 0x00, // 00000000
984 0x00, 0x07, 0x44, 0x01, // 00074401
985 0x00, 0x07, 0x06, 0x61, // 00070661
986 0x00, 0x07, 0x4C, 0x00, // 00074C00
987 0x00, 0x07, 0x0D, 0x00, // 00070D00
988 0x00, 0x0B, 0x52, 0x40, // 000B5240
989 0x00, 0x06, 0x80, 0x22, // 00068022
990 0x00, 0x04, 0x07, 0x00, // 00040700
991 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
992 0x00, 0x02, 0x9F, 0x08, // 00029F08
993 0x00, 0x0B, 0x52, 0x7F, // 000B527F
994 0x00, 0x07, 0x5C, 0x01, // 00075C01
995 0x00, 0x07, 0x1E, 0x69, // 00071E69
996 0x00, 0x0B, 0x64, 0x7F, // 000B647F
997 0x00, 0x06, 0x90, 0x78, // 00069078
998 0x00, 0x0B, 0x6D, 0x7E, // 000B6D7E
999 0x00, 0x06, 0x98, 0x22, // 00069822
1000 0x00, 0x0A, 0xDF, 0x84, // 000ADF84
1001 0x00, 0x0A, 0xDF, 0x85, // 000ADF85
1002 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
1003 0x00, 0x00, 0x00, 0x00, // 00000000
1004 0x00, 0x06, 0x98, 0x77, // 00069877
1005 0x00, 0x06, 0x98, 0x7A, // 0006987A
1006 0x00, 0x06, 0xB8, 0x68, // 0006B868
1007 0x00, 0x06, 0xB8, 0x69, // 0006B869
1008 0x00, 0x06, 0xB8, 0x6F, // 0006B86F
1009 0x00, 0x06, 0xB8, 0x70, // 0006B870
1010 0x00, 0x06, 0xB8, 0x71, // 0006B871
1011 0x00, 0x06, 0xB8, 0x72, // 0006B872
1012 0x00, 0x06, 0xB8, 0x73, // 0006B873
1013 0x00, 0x06, 0xB8, 0x74, // 0006B874
1014 0x00, 0x06, 0xB8, 0x75, // 0006B875
1015 0x00, 0x00, 0x00, 0x00, // 00000000
1016 0x00, 0x06, 0x28, 0x6A, // 0006286A
1017 0x00, 0x00, 0x00, 0x00, // 00000000
1018 0x00, 0x00, 0x00, 0x00, // 00000000
1019 0x00, 0x00, 0x00, 0x00, // 00000000
1020 0x00, 0x06, 0xA8, 0x61, // 0006A861
1021 0x00, 0x07, 0x65, 0x5D, // 0007655D
1022 0x00, 0x07, 0x24, 0x10, // 00072410
1023 0x00, 0x06, 0x30, 0x6C, // 0006306C
1024 0x00, 0x07, 0x6D, 0x59, // 00076D59
1025 0x00, 0x07, 0x2C, 0x50, // 00072C50
1026 0x00, 0x08, 0xB6, 0x40, // 0008B640
1027 0x00, 0x02, 0x9F, 0x20, // 00029F20
1028 0x00, 0x07, 0x65, 0x05, // 00076505
1029 0x00, 0x07, 0x25, 0x70, // 00072570
1030 0x00, 0x07, 0x6D, 0x15, // 00076D15
1031 0x00, 0x07, 0x2D, 0x60, // 00072D60
1032 0x00, 0x00, 0x00, 0x00, // 00000000
1033 0x00, 0x00, 0x00, 0x00, // 00000000
1034 0x00, 0x06, 0xA0, 0x66, // 0006A066
1035 0x00, 0x06, 0xA8, 0x67, // 0006A867
1036 0x00, 0x07, 0x5C, 0x00, // 00075C00
1037 0x00, 0x07, 0x1C, 0x20, // 00071C20
1038 0x00, 0x07, 0x7C, 0x01, // 00077C01
1039 0x00, 0x07, 0x3D, 0xFF, // 00073DFF
1040 0x00, 0x07, 0x54, 0x00, // 00075400
1041 0x00, 0x07, 0x14, 0x00, // 00071400
1042 0x00, 0x07, 0x4C, 0x01, // 00074C01
1043 0x00, 0x07, 0x0E, 0x00, // 00070E00
1044 0x00, 0x07, 0x74, 0x01, // 00077401
1045 0x00, 0x07, 0x35, 0xFF, // 000735FF
1046 0x00, 0x07, 0x64, 0x00, // 00076400
1047 0x00, 0x07, 0x26, 0x98, // 00072698
1048 0x00, 0x07, 0x6C, 0x01, // 00076C01
1049 0x00, 0x07, 0x2C, 0x90, // 00072C90
1050 0x00, 0x07, 0x44, 0x00, // 00074400
1051 0x00, 0x07, 0x04, 0x90, // 00070490
1052 0x00, 0x07, 0x5C, 0x00, // 00075C00
1053 0x00, 0x07, 0x1C, 0x00, // 00071C00
1054 0x00, 0x06, 0x98, 0x15, // 00069815
1055 0x00, 0x06, 0xB8, 0x16, // 0006B816
1056 0x00, 0x06, 0xB4, 0x14, // 0006B414
1057 0x00, 0x06, 0x88, 0x28, // 00068828
1058 0x00, 0x06, 0x88, 0x22, // 00068822
1059 0x00, 0x06, 0x90, 0x2E, // 0006902E
1060 0x00, 0x06, 0x90, 0x1C, // 0006901C
1061 0x00, 0x06, 0x90, 0x20, // 00069020
1062 0x00, 0x06, 0x9C, 0x1C, // 00069C1C
1063 0x00, 0x06, 0xB4, 0x26, // 0006B426
1064 0x00, 0x06, 0xB4, 0x24, // 0006B424
1065 0x00, 0x06, 0xB4, 0x2E, // 0006B42E
1066 0x00, 0x06, 0xA0, 0x29, // 0006A029
1067 0x00, 0x06, 0xA8, 0x1D, // 0006A81D
1068 0x00, 0x06, 0xA8, 0x21, // 0006A821
1069 0x00, 0x06, 0xA8, 0x2F, // 0006A82F
1070 0x00, 0x06, 0x84, 0x1D, // 0006841D
1071 0x00, 0x08, 0x3F, 0x41, // 00083F41
1072 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1073 0x00, 0x00, 0x00, 0x00, // 00000000
1074 0x00, 0x00, 0x00, 0x00, // 00000000
1075 0x00, 0x01, 0x01, 0x21, // 00010121
1076 0x00, 0x06, 0xB8, 0x6E, // 0006B86E
1077 0x00, 0x07, 0xA8, 0x0F, // 0007A80F
1078 0x00, 0x00, 0x00, 0x00, // 00000000
1079 0x00, 0x06, 0x38, 0x78, // 00063878
1080 0x00, 0x07, 0x44, 0x05, // 00074405
1081 0x00, 0x07, 0x05, 0x89, // 00070589
1082 0x00, 0x07, 0x4C, 0x05, // 00074C05
1083 0x00, 0x07, 0x0D, 0x4B, // 00070D4B
1084 0x00, 0x07, 0x54, 0x05, // 00075405
1085 0x00, 0x07, 0x15, 0x59, // 00071559
1086 0x00, 0x07, 0x5C, 0x05, // 00075C05
1087 0x00, 0x07, 0x1D, 0xBD, // 00071DBD
1088 0x00, 0x08, 0xBF, 0x40, // 0008BF40
1089 0x00, 0x02, 0x9F, 0x40, // 00029F40
1090 0x00, 0x07, 0x44, 0x05, // 00074405
1091 0x00, 0x07, 0x04, 0xC8, // 000704C8
1092 0x00, 0x07, 0x4C, 0x05, // 00074C05
1093 0x00, 0x07, 0x0C, 0xEE, // 00070CEE
1094 0x00, 0x07, 0x54, 0x05, // 00075405
1095 0x00, 0x07, 0x14, 0xF8, // 000714F8
1096 0x00, 0x07, 0x5C, 0x05, // 00075C05
1097 0x00, 0x07, 0x1D, 0x16, // 00071D16
1098 0x00, 0x06, 0x80, 0x09, // 00068009
1099 0x00, 0x06, 0x88, 0x0D, // 0006880D
1100 0x00, 0x06, 0x90, 0x0C, // 0006900C
1101 0x00, 0x06, 0x98, 0x0B, // 0006980B
1102 0x00, 0x07, 0x44, 0x01, // 00074401
1103 0x00, 0x07, 0x06, 0x61, // 00070661
1104 0x00, 0x07, 0x64, 0x00, // 00076400
1105 0x00, 0x07, 0x27, 0x20, // 00072720
1106 0x00, 0x07, 0x4C, 0x00, // 00074C00
1107 0x00, 0x07, 0x0C, 0x00, // 00070C00
1108 0x00, 0x06, 0x80, 0x22, // 00068022
1109 0x00, 0x04, 0x3F, 0x00, // 00043F00
1110 0x00, 0x06, 0x00, 0x78, // 00060078
1111 0x00, 0x0A, 0xFF, 0x44, // 000AFF44
1112 0x00, 0x06, 0xA0, 0x5B, // 0006A05B
1113 0x00, 0x07, 0x64, 0x00, // 00076400
1114 0x00, 0x07, 0x27, 0x00, // 00072700
1115 0x00, 0x07, 0x5C, 0x00, // 00075C00
1116 0x00, 0x07, 0x1C, 0x10, // 00071C10
1117 0x00, 0x08, 0x80, 0x40, // 00088040
1118 0x00, 0x06, 0xA0, 0x5B, // 0006A05B
1119 0x00, 0x02, 0x9E, 0x20, // 00029E20
1120 0x00, 0x07, 0x5C, 0x00, // 00075C00
1121 0x00, 0x07, 0x64, 0x04, // 00076404
1122 0x00, 0x07, 0x24, 0x00, // 00072400
1123 0x00, 0x07, 0x1C, 0x30, // 00071C30
1124 0x00, 0x08, 0x24, 0xC7, // 000824C7
1125 0x00, 0x06, 0x88, 0x4B, // 0006884B
1126 0x00, 0x00, 0x00, 0x00, // 00000000
1127 0x00, 0x06, 0x9C, 0x06, // 00069C06
1128 0x00, 0x06, 0xA0, 0x5B, // 0006A05B
1129 0x00, 0x06, 0xA4, 0x76, // 0006A476
1130 0x00, 0x06, 0x28, 0x77, // 00062877
1131 0x00, 0x07, 0x54, 0x01, // 00075401
1132 0x00, 0x07, 0x16, 0x40, // 00071640
1133 0x00, 0x07, 0x64, 0x00, // 00076400
1134 0x00, 0x07, 0x24, 0x90, // 00072490
1135 0x00, 0x0B, 0x49, 0x7D, // 000B497D
1136 0x00, 0x07, 0x44, 0x01, // 00074401
1137 0x00, 0x07, 0x06, 0x6C, // 0007066C
1138 0x00, 0x06, 0x90, 0x1E, // 0006901E
1139 0x00, 0x06, 0xA0, 0x1F, // 0006A01F
1140 0x00, 0x06, 0x88, 0x14, // 00068814
1141 0x00, 0x06, 0x80, 0x22, // 00068022
1142 0x00, 0x04, 0x0F, 0x08, // 00040F08
1143 0x00, 0x04, 0x17, 0x08, // 00041708
1144 0x00, 0x04, 0x1F, 0x08, // 00041F08
1145 0x00, 0x04, 0x27, 0x08, // 00042708
1146 0x00, 0x08, 0xAD, 0x40, // 0008AD40
1147 0x00, 0x02, 0x9F, 0x20, // 00029F20
1148 0x00, 0x0B, 0x49, 0x40, // 000B4940
1149 0x00, 0x0B, 0x52, 0x40, // 000B5240
1150 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
1151 0x00, 0x0B, 0x64, 0x40, // 000B6440
1152 0x00, 0x07, 0x88, 0x0D, // 0007880D
1153 0x00, 0x07, 0x90, 0x0D, // 0007900D
1154 0x00, 0x07, 0x98, 0x0D, // 0007980D
1155 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1156 0x00, 0x00, 0x00, 0x00, // 00000000
1157 0x00, 0x00, 0xC1, 0x05, // 0000C105
1158 0x00, 0x07, 0x44, 0x04, // 00074404
1159 0x00, 0x07, 0x07, 0x43, // 00070743
1160 0x00, 0x00, 0x00, 0x00, // 00000000
1161 0x00, 0x00, 0x00, 0x00, // 00000000
1162 0x00, 0x00, 0x00, 0x00, // 00000000
1163 0x00, 0x06, 0x80, 0x0F, // 0006800F
1164 0x00, 0x06, 0x38, 0x61, // 00063861
1165 0x00, 0x00, 0x00, 0x00, // 00000000
1166 0x00, 0x08, 0xBF, 0x40, // 0008BF40
1167 0x00, 0x02, 0x9E, 0x10, // 00029E10
1168 0x00, 0x02, 0x13, 0x6E, // 0002136E
1169 0x00, 0x02, 0x81, 0x28, // 00028128
1170 0x00, 0x07, 0x54, 0x00, // 00075400
1171 0x00, 0x07, 0x14, 0x20, // 00071420
1172 0x00, 0x06, 0x18, 0x1C, // 0006181C
1173 0x00, 0x09, 0x12, 0xC0, // 000912C0
1174 0x00, 0x02, 0x86, 0x10, // 00028610
1175 0x00, 0x02, 0x14, 0x14, // 00021414
1176 0x00, 0x02, 0x81, 0x28, // 00028128
1177 0x00, 0x06, 0x10, 0x6E, // 0006106E
1178 0x00, 0x08, 0x9B, 0x44, // 00089B44
1179 0x00, 0x02, 0x86, 0x08, // 00028608
1180 0x00, 0x08, 0x1B, 0xC2, // 00081BC2
1181 0x00, 0x07, 0x45, 0x5D, // 0007455D
1182 0x00, 0x07, 0x04, 0x10, // 00070410
1183 0x00, 0x07, 0x4D, 0x59, // 00074D59
1184 0x00, 0x07, 0x0C, 0x50, // 00070C50
1185 0x00, 0x06, 0x98, 0x1C, // 0006981C
1186 0x00, 0x00, 0xC1, 0x04, // 0000C104
1187 0x00, 0x07, 0x54, 0x04, // 00075404
1188 0x00, 0x07, 0x17, 0x60, // 00071760
1189 0x00, 0x09, 0x80, 0x48, // 00098048
1190 0x00, 0x09, 0x89, 0x78, // 00098978
1191 0x00, 0x08, 0x38, 0xC1, // 000838C1
1192 0x00, 0x06, 0x90, 0x0F, // 0006900F
1193 0x00, 0x08, 0x80, 0x41, // 00088041
1194 0x00, 0x02, 0x9F, 0x10, // 00029F10
1195 0x00, 0x02, 0x14, 0x14, // 00021414
1196 0x00, 0x02, 0x81, 0x28, // 00028128
1197 0x00, 0x07, 0x54, 0x01, // 00075401
1198 0x00, 0x07, 0x16, 0x65, // 00071665
1199 0x00, 0x0B, 0x49, 0x40, // 000B4940
1200 0x00, 0x02, 0x14, 0x14, // 00021414
1201 0x00, 0x00, 0x00, 0x00, // 00000000
1202 0x00, 0x06, 0x90, 0x22, // 00069022
1203 0x00, 0x07, 0x88, 0x03, // 00078803
1204 0x00, 0x00, 0x00, 0x00, // 00000000
1205 0x00, 0x06, 0x88, 0x69, // 00068869
1206 0x00, 0x06, 0x88, 0x61, // 00068861
1207 0x00, 0x06, 0x08, 0x6F, // 0006086F
1208 0x00, 0x0B, 0x52, 0x40, // 000B5240
1209 0x00, 0x08, 0x89, 0x41, // 00088941
1210 0x00, 0x02, 0x9F, 0x10, // 00029F10
1211 0x00, 0x02, 0x13, 0x8B, // 0002138B
1212 0x00, 0x02, 0x81, 0x28, // 00028128
1213 0x00, 0x08, 0x88, 0x42, // 00088842
1214 0x00, 0x02, 0x86, 0x10, // 00028610
1215 0x00, 0x02, 0x14, 0x14, // 00021414
1216 0x00, 0x02, 0x81, 0x28, // 00028128
1217 0x00, 0x00, 0xC1, 0x01, // 0000C101
1218 0x00, 0x07, 0x44, 0x04, // 00074404
1219 0x00, 0x07, 0x07, 0x7F, // 0007077F
1220 0x00, 0x00, 0x00, 0x00, // 00000000
1221 0x00, 0x00, 0x00, 0x00, // 00000000
1222 0x00, 0x06, 0x90, 0x6F, // 0006906F
1223 0x00, 0x06, 0x80, 0x0F, // 0006800F
1224 0x00, 0x06, 0x10, 0x66, // 00061066
1225 0x00, 0x08, 0x90, 0xC2, // 000890C2
1226 0x00, 0x02, 0x9F, 0x10, // 00029F10
1227 0x00, 0x02, 0x16, 0x14, // 00021614
1228 0x00, 0x02, 0x81, 0x28, // 00028128
1229 0x00, 0x06, 0x10, 0x67, // 00061067
1230 0x00, 0x08, 0x91, 0xC2, // 000891C2
1231 0x00, 0x02, 0x9F, 0x10, // 00029F10
1232 0x00, 0x02, 0x16, 0x14, // 00021614
1233 0x00, 0x02, 0x81, 0x28, // 00028128
1234 0x00, 0x02, 0x14, 0x14, // 00021414
1235 0x00, 0x02, 0x81, 0x28, // 00028128
1236 0x00, 0x06, 0x10, 0x76, // 00061076
1237 0x00, 0x06, 0x08, 0x7A, // 0006087A
1238 0x00, 0x0A, 0x00, 0xC2, // 000A00C2
1239 0x00, 0x08, 0x89, 0x40, // 00088940
1240 0x00, 0x02, 0x9F, 0x10, // 00029F10
1241 0x00, 0x02, 0x14, 0x14, // 00021414
1242 0x00, 0x02, 0x81, 0x28, // 00028128
1243 0x00, 0x07, 0x54, 0x00, // 00075400
1244 0x00, 0x07, 0x14, 0x20, // 00071420
1245 0x00, 0x00, 0x00, 0x00, // 00000000
1246 0x00, 0x08, 0x90, 0xC2, // 000890C2
1247 0x00, 0x02, 0x88, 0x10, // 00028810
1248 0x00, 0x02, 0x14, 0x14, // 00021414
1249 0x00, 0x02, 0x81, 0x28, // 00028128
1250 0x00, 0x06, 0x0C, 0x26, // 00060C26
1251 0x00, 0x06, 0x14, 0x1C, // 0006141C
1252 0x00, 0x07, 0x5C, 0x01, // 00075C01
1253 0x00, 0x07, 0x1E, 0x00, // 00071E00
1254 0x00, 0x08, 0x89, 0xC2, // 000889C2
1255 0x00, 0x02, 0x86, 0x08, // 00028608
1256 0x00, 0x08, 0x09, 0xC3, // 000809C3
1257 0x00, 0x06, 0x24, 0x24, // 00062424
1258 0x00, 0x09, 0x22, 0xC4, // 000922C4
1259 0x00, 0x02, 0x86, 0x08, // 00028608
1260 0x00, 0x08, 0x24, 0xC3, // 000824C3
1261 0x00, 0x09, 0x29, 0xC4, // 000929C4
1262 0x00, 0x02, 0x86, 0x08, // 00028608
1263 0x00, 0x08, 0x0C, 0x40, // 00080C40
1264 0x00, 0x06, 0x24, 0x2E, // 0006242E
1265 0x00, 0x09, 0x22, 0xC4, // 000922C4
1266 0x00, 0x02, 0x86, 0x08, // 00028608
1267 0x00, 0x08, 0x24, 0xC3, // 000824C3
1268 0x00, 0x09, 0x29, 0xC4, // 000929C4
1269 0x00, 0x02, 0x86, 0x08, // 00028608
1270 0x00, 0x08, 0x0C, 0x40, // 00080C40
1271 0x00, 0x07, 0x6C, 0x00, // 00076C00
1272 0x00, 0x07, 0x2C, 0x20, // 00072C20
1273 0x00, 0x00, 0x00, 0x00, // 00000000
1274 0x00, 0x08, 0x89, 0xC5, // 000889C5
1275 0x00, 0x02, 0x86, 0x10, // 00028610
1276 0x00, 0x02, 0x14, 0x14, // 00021414
1277 0x00, 0x02, 0x81, 0x28, // 00028128
1278 0x00, 0x00, 0x00, 0x00, // 00000000
1279 0x00, 0x00, 0x00, 0x00, // 00000000
1280 0x00, 0x00, 0x00, 0x00, // 00000000
1281 0x00, 0x0B, 0x6D, 0x70, // 000B6D70
1282 0x00, 0x00, 0x00, 0x00, // 00000000
1283 0x00, 0x00, 0x00, 0x00, // 00000000
1284 0x00, 0x04, 0xB8, 0x0D, // 0004B80D
1285 0x00, 0x06, 0xA8, 0x79, // 0006A879
1286 0x00, 0x09, 0xBF, 0x7C, // 0009BF7C
1287 0x00, 0x00, 0xC1, 0x01, // 0000C101
1288 0x00, 0x07, 0x44, 0x04, // 00074404
1289 0x00, 0x07, 0x07, 0xC5, // 000707C5
1290 0x00, 0x00, 0x00, 0x00, // 00000000
1291 0x00, 0x00, 0x00, 0x00, // 00000000
1292 0x00, 0x00, 0x00, 0x00, // 00000000
1293 0x00, 0x06, 0x80, 0x0F, // 0006800F
1294 0x00, 0x06, 0x18, 0x76, // 00061876
1295 0x00, 0x00, 0x00, 0x00, // 00000000
1296 0x00, 0x08, 0x9B, 0x40, // 00089B40
1297 0x00, 0x02, 0x9F, 0x10, // 00029F10
1298 0x00, 0x08, 0x29, 0x40, // 00082940
1299 0x00, 0x08, 0x08, 0x40, // 00080840
1300 0x00, 0x0C, 0x31, 0x08, // 000C3108
1301 0x00, 0x0E, 0x31, 0x09, // 000E3109
1302 0x00, 0x00, 0x00, 0x00, // 00000000
1303 0x00, 0x06, 0x10, 0x73, // 00061073
1304 0x00, 0x0C, 0x01, 0x08, // 000C0108
1305 0x00, 0x0E, 0x01, 0x09, // 000E0109
1306 0x00, 0x0A, 0xF6, 0x7C, // 000AF67C
1307 0x00, 0x09, 0xA7, 0x7F, // 0009A77F
1308 0x00, 0x02, 0x82, 0x08, // 00028208
1309 0x00, 0x08, 0x36, 0x42, // 00083642
1310 0x00, 0x0A, 0xC0, 0x7C, // 000AC07C
1311 0x00, 0x09, 0xBF, 0x7F, // 0009BF7F
1312 0x00, 0x02, 0x82, 0x08, // 00028208
1313 0x00, 0x08, 0x00, 0x42, // 00080042
1314 0x00, 0x06, 0x20, 0x79, // 00062079
1315 0x00, 0x08, 0x12, 0x42, // 00081242
1316 0x00, 0x08, 0xA4, 0x41, // 0008A441
1317 0x00, 0x07, 0xF4, 0x0C, // 0007F40C
1318 0x00, 0x07, 0xC4, 0x0C, // 0007C40C
1319 0x00, 0x02, 0x9F, 0x50, // 00029F50
1320 0x00, 0x06, 0x90, 0x73, // 00069073
1321 0x00, 0x06, 0xA0, 0x79, // 0006A079
1322 0x00, 0x08, 0x9B, 0x41, // 00089B41
1323 0x00, 0x02, 0x87, 0x20, // 00028720
1324 0x00, 0x08, 0x0D, 0x40, // 00080D40
1325 0x00, 0x08, 0x05, 0x40, // 00080540
1326 0x00, 0x02, 0x13, 0xCB, // 000213CB
1327 0x00, 0x02, 0x81, 0x28, // 00028128
1328 0x00, 0x02, 0x13, 0xBE, // 000213BE
1329 0x00, 0x02, 0x81, 0x28, // 00028128
1330 0x00, 0x06, 0x00, 0x74, // 00060074
1331 0x00, 0x06, 0x0C, 0x1C, // 00060C1C
1332 0x00, 0x07, 0x54, 0x01, // 00075401
1333 0x00, 0x07, 0x14, 0x80, // 00071480
1334 0x00, 0x08, 0x80, 0x40, // 00088040
1335 0x00, 0x02, 0x9E, 0x48, // 00029E48
1336 0x00, 0x08, 0x91, 0xC2, // 000891C2
1337 0x00, 0x02, 0x89, 0x38, // 00028938
1338 0x00, 0x02, 0x15, 0xDB, // 000215DB
1339 0x00, 0x07, 0x44, 0x04, // 00074404
1340 0x00, 0x07, 0x07, 0xF8, // 000707F8
1341 0x00, 0x00, 0x00, 0x00, // 00000000
1342 0x00, 0x00, 0x00, 0x00, // 00000000
1343 0x00, 0x00, 0x00, 0x00, // 00000000
1344 0x00, 0x06, 0x80, 0x0E, // 0006800E
1345 0x00, 0x02, 0x16, 0x52, // 00021652
1346 0x00, 0x07, 0x4C, 0x04, // 00074C04
1347 0x00, 0x07, 0x0F, 0xFF, // 00070FFF
1348 0x00, 0x00, 0x00, 0x00, // 00000000
1349 0x00, 0x00, 0x00, 0x00, // 00000000
1350 0x00, 0x00, 0x00, 0x00, // 00000000
1351 0x00, 0x06, 0x88, 0x0F, // 0006880F
1352 0x00, 0x06, 0x00, 0x69, // 00060069
1353 0x00, 0x07, 0x4C, 0x01, // 00074C01
1354 0x00, 0x07, 0x0E, 0x65, // 00070E65
1355 0x00, 0x08, 0x00, 0x41, // 00080041
1356 0x00, 0x07, 0x54, 0x00, // 00075400
1357 0x00, 0x07, 0x14, 0x20, // 00071420
1358 0x00, 0x06, 0x18, 0x76, // 00061876
1359 0x00, 0x0A, 0x12, 0xC3, // 000A12C3
1360 0x00, 0x06, 0x88, 0x22, // 00068822
1361 0x00, 0x08, 0x92, 0x41, // 00089241
1362 0x00, 0x0A, 0xC0, 0xC2, // 000AC0C2
1363 0x00, 0x04, 0x0F, 0x00, // 00040F00
1364 0x00, 0x02, 0x9F, 0x10, // 00029F10
1365 0x00, 0x02, 0x14, 0x14, // 00021414
1366 0x00, 0x02, 0x81, 0x28, // 00028128
1367 0x00, 0x08, 0x09, 0x41, // 00080941
1368 0x00, 0x06, 0x00, 0x6A, // 0006006A
1369 0x00, 0x00, 0x00, 0x00, // 00000000
1370 0x00, 0x06, 0x80, 0x69, // 00068069
1371 0x00, 0x07, 0x88, 0x07, // 00078807
1372 0x00, 0x06, 0x80, 0x6F, // 0006806F
1373 0x00, 0x00, 0xC1, 0x03, // 0000C103
1374 0x00, 0x07, 0x44, 0x05, // 00074405
1375 0x00, 0x07, 0x04, 0x1B, // 0007041B
1376 0x00, 0x00, 0x00, 0x00, // 00000000
1377 0x00, 0x00, 0x00, 0x00, // 00000000
1378 0x00, 0x00, 0x00, 0x00, // 00000000
1379 0x00, 0x06, 0x80, 0x0F, // 0006800F
1380 0x00, 0x06, 0x04, 0x26, // 00060426
1381 0x00, 0x06, 0x28, 0x7A, // 0006287A
1382 0x00, 0x06, 0x38, 0x7A, // 0006387A
1383 0x00, 0x06, 0x0C, 0x1C, // 00060C1C
1384 0x00, 0x07, 0x54, 0x01, // 00075401
1385 0x00, 0x07, 0x16, 0x00, // 00071600
1386 0x00, 0x06, 0x18, 0x70, // 00061870
1387 0x00, 0x08, 0x80, 0xC1, // 000880C1
1388 0x00, 0x02, 0x86, 0x08, // 00028608
1389 0x00, 0x08, 0x00, 0xC2, // 000800C2
1390 0x00, 0x07, 0x74, 0x00, // 00077400
1391 0x00, 0x07, 0x34, 0x40, // 00073440
1392 0x00, 0x06, 0x08, 0x74, // 00060874
1393 0x00, 0x08, 0xA5, 0x41, // 0008A541
1394 0x00, 0x02, 0x9E, 0x30, // 00029E30
1395 0x00, 0x08, 0x89, 0x40, // 00088940
1396 0x00, 0x02, 0x9F, 0x20, // 00029F20
1397 0x00, 0x08, 0xA0, 0xC6, // 0008A0C6
1398 0x00, 0x02, 0x88, 0x10, // 00028810
1399 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1400 0x00, 0x02, 0x81, 0x80, // 00028180
1401 0x00, 0x08, 0x89, 0x40, // 00088940
1402 0x00, 0x02, 0x9F, 0x70, // 00029F70
1403 0x00, 0x07, 0x64, 0x00, // 00076400
1404 0x00, 0x07, 0x24, 0x21, // 00072421
1405 0x00, 0x08, 0x93, 0xC0, // 000893C0
1406 0x00, 0x06, 0x80, 0x70, // 00068070
1407 0x00, 0x06, 0xA8, 0x7A, // 0006A87A
1408 0x00, 0x08, 0x94, 0xC2, // 000894C2
1409 0x00, 0x02, 0x88, 0x10, // 00028810
1410 0x00, 0x02, 0x16, 0x11, // 00021611
1411 0x00, 0x07, 0x44, 0x05, // 00074405
1412 0x00, 0x07, 0x04, 0x40, // 00070440
1413 0x00, 0x00, 0x00, 0x00, // 00000000
1414 0x00, 0x00, 0x00, 0x00, // 00000000
1415 0x00, 0x00, 0x00, 0x00, // 00000000
1416 0x00, 0x06, 0x80, 0x0F, // 0006800F
1417 0x00, 0x07, 0x44, 0x01, // 00074401
1418 0x00, 0x07, 0x06, 0x61, // 00070661
1419 0x00, 0x07, 0x4C, 0x00, // 00074C00
1420 0x00, 0x07, 0x0C, 0x01, // 00070C01
1421 0x00, 0x00, 0x00, 0x00, // 00000000
1422 0x00, 0x06, 0x80, 0x22, // 00068022
1423 0x00, 0x04, 0x07, 0x00, // 00040700
1424 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
1425 0x00, 0x02, 0x9F, 0x10, // 00029F10
1426 0x00, 0x08, 0x80, 0x41, // 00088041
1427 0x00, 0x02, 0x81, 0x10, // 00028110
1428 0x00, 0x02, 0x14, 0xAC, // 000214AC
1429 0x00, 0x02, 0x81, 0x28, // 00028128
1430 0x00, 0x07, 0x80, 0x07, // 00078007
1431 0x00, 0x07, 0x44, 0x01, // 00074401
1432 0x00, 0x07, 0x06, 0x61, // 00070661
1433 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
1434 0x00, 0x07, 0x0C, 0x00, // 00070C00
1435 0x00, 0x00, 0x00, 0x00, // 00000000
1436 0x00, 0x06, 0x80, 0x22, // 00068022
1437 0x00, 0x0A, 0xC7, 0x81, // 000AC781
1438 0x00, 0x02, 0x9E, 0x10, // 00029E10
1439 0x00, 0x02, 0x14, 0xC1, // 000214C1
1440 0x00, 0x02, 0x81, 0x28, // 00028128
1441 0x00, 0x07, 0x44, 0x01, // 00074401
1442 0x00, 0x07, 0x06, 0x69, // 00070669
1443 0x00, 0x07, 0x4C, 0x00, // 00074C00
1444 0x00, 0x07, 0x0C, 0x01, // 00070C01
1445 0x00, 0x07, 0x44, 0x01, // 00074401
1446 0x00, 0x07, 0x06, 0x6C, // 0007066C
1447 0x00, 0x06, 0x80, 0x22, // 00068022
1448 0x00, 0x06, 0x10, 0x7A, // 0006107A
1449 0x00, 0x06, 0x18, 0x77, // 00061877
1450 0x00, 0x04, 0x25, 0x08, // 00042508
1451 0x00, 0x04, 0x2D, 0x08, // 00042D08
1452 0x00, 0x04, 0x35, 0x08, // 00043508
1453 0x00, 0x04, 0x3D, 0x08, // 00043D08
1454 0x00, 0x0A, 0xCF, 0x81, // 000ACF81
1455 0x00, 0x02, 0x9F, 0x70, // 00029F70
1456 0x00, 0x06, 0x0C, 0x6A, // 00060C6A
1457 0x00, 0x08, 0x9B, 0x40, // 00089B40
1458 0x00, 0x02, 0x9E, 0x50, // 00029E50
1459 0x00, 0x08, 0x92, 0x40, // 00089240
1460 0x00, 0x02, 0x9F, 0x30, // 00029F30
1461 0x00, 0x0B, 0x49, 0x41, // 000B4941
1462 0x00, 0x0B, 0x64, 0x40, // 000B6440
1463 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1464 0x00, 0x0B, 0x76, 0x40, // 000B7640
1465 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
1466 0x00, 0x02, 0x81, 0x08, // 00028108
1467 0x00, 0x06, 0x0C, 0x65, // 00060C65
1468 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
1469 0x00, 0x02, 0x81, 0x70, // 00028170
1470 0x00, 0x06, 0x80, 0x22, // 00068022
1471 0x00, 0x06, 0x0C, 0x6A, // 00060C6A
1472 0x00, 0x08, 0x9B, 0x40, // 00089B40
1473 0x00, 0x02, 0x9F, 0x50, // 00029F50
1474 0x00, 0x08, 0x92, 0x40, // 00089240
1475 0x00, 0x02, 0x9F, 0x30, // 00029F30
1476 0x00, 0x0B, 0x49, 0x41, // 000B4941
1477 0x00, 0x04, 0x27, 0x08, // 00042708
1478 0x00, 0x04, 0x2F, 0x08, // 00042F08
1479 0x00, 0x04, 0x37, 0x08, // 00043708
1480 0x00, 0x04, 0x3F, 0x08, // 00043F08
1481 0x00, 0x02, 0x81, 0x08, // 00028108
1482 0x00, 0x06, 0x0C, 0x65, // 00060C65
1483 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
1484 0x00, 0x06, 0x04, 0x6A, // 0006046A
1485 0x00, 0x06, 0x14, 0x65, // 00061465
1486 0x00, 0x09, 0x00, 0xC2, // 000900C2
1487 0x00, 0x08, 0x11, 0x41, // 00081141
1488 0x00, 0x02, 0x9F, 0x18, // 00029F18
1489 0x00, 0x08, 0x10, 0x41, // 00081041
1490 0x00, 0x02, 0x9F, 0x08, // 00029F08
1491 0x00, 0x08, 0x08, 0x40, // 00080840
1492 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1493 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
1494 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
1495 0x00, 0x06, 0x8C, 0x6A, // 00068C6A
1496 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
1497 0x00, 0x06, 0x98, 0x77, // 00069877
1498 0x00, 0x07, 0x44, 0x01, // 00074401
1499 0x00, 0x07, 0x06, 0x69, // 00070669
1500 0x00, 0x07, 0x4C, 0x00, // 00074C00
1501 0x00, 0x07, 0x0C, 0x02, // 00070C02
1502 0x00, 0x06, 0x10, 0x7A, // 0006107A
1503 0x00, 0x06, 0x80, 0x22, // 00068022
1504 0x00, 0x0A, 0xC3, 0x81, // 000AC381
1505 0x00, 0x02, 0x9F, 0x58, // 00029F58
1506 0x00, 0x08, 0x92, 0x40, // 00089240
1507 0x00, 0x02, 0x9E, 0x40, // 00029E40
1508 0x00, 0x0B, 0x52, 0x7E, // 000B527E
1509 0x00, 0x02, 0x16, 0x2E, // 0002162E
1510 0x00, 0x07, 0x44, 0x05, // 00074405
1511 0x00, 0x07, 0x04, 0xAC, // 000704AC
1512 0x00, 0x06, 0x90, 0x7A, // 0006907A
1513 0x00, 0x00, 0x00, 0x00, // 00000000
1514 0x00, 0x00, 0x00, 0x00, // 00000000
1515 0x00, 0x06, 0x80, 0x0F, // 0006800F
1516 0x00, 0x02, 0x81, 0x18, // 00028118
1517 0x00, 0x08, 0x9A, 0x42, // 00089A42
1518 0x00, 0x02, 0x9E, 0x08, // 00029E08
1519 0x00, 0x0B, 0x52, 0x7F, // 000B527F
1520 0x00, 0x00, 0x00, 0x00, // 00000000
1521 0x00, 0x00, 0x00, 0x00, // 00000000
1522 0x00, 0x00, 0x00, 0x00, // 00000000
1523 0x00, 0x06, 0x90, 0x7A, // 0006907A
1524 0x00, 0x00, 0x00, 0x00, // 00000000
1525 0x00, 0x06, 0x00, 0x6D, // 0006006D
1526 0x00, 0x00, 0x00, 0x00, // 00000000
1527 0x00, 0x08, 0x80, 0x41, // 00088041
1528 0x00, 0x00, 0x00, 0x00, // 00000000
1529 0x00, 0x00, 0x00, 0x00, // 00000000
1530 0x00, 0x00, 0x00, 0x00, // 00000000
1531 0x00, 0x06, 0xC0, 0x6D, // 0006C06D
1532 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
1533 0x00, 0x07, 0x6C, 0x05, // 00076C05
1534 0x00, 0x07, 0x2C, 0xBA, // 00072CBA
1535 0x00, 0x00, 0x00, 0x00, // 00000000
1536 0x00, 0x00, 0x00, 0x00, // 00000000
1537 0x00, 0x00, 0x00, 0x00, // 00000000
1538 0x00, 0x00, 0x00, 0x00, // 00000000
1539 0x00, 0x02, 0x13, 0x3B, // 0002133B
1540 0x00, 0x02, 0x81, 0x28, // 00028128
1541 0x00, 0x00, 0x00, 0x00, // 00000000
1542 0x00, 0x00, 0x00, 0x00, // 00000000
1543 0x00, 0x00, 0x00, 0x00, // 00000000
1544 0x00, 0x00, 0x00, 0x00, // 00000000
1545 0x00, 0x00, 0x00, 0x00, // 00000000
1546 0x00, 0x00, 0xC1, 0x80, // 0000C180
1547 0x00, 0x00, 0x00, 0x00, // 00000000
1548 0x00, 0x00, 0x00, 0x00, // 00000000
1549 0x00, 0x00, 0x00, 0x00, // 00000000
1550 0x00, 0x00, 0x00, 0x00, // 00000000
1551 0x00, 0x00, 0x00, 0x00, // 00000000
1552 0x00, 0x00, 0x00, 0x00, // 00000000
1553 0x00, 0x06, 0x10, 0x68, // 00061068
1554 0x00, 0x04, 0x04, 0x08, // 00040408
1555 0x00, 0x08, 0x92, 0x40, // 00089240
1556 0x00, 0x02, 0x9E, 0x08, // 00029E08
1557 0x00, 0x02, 0x14, 0xDD, // 000214DD
1558 0x00, 0x06, 0x28, 0x6C, // 0006286C
1559 0x00, 0x04, 0x0C, 0x08, // 00040C08
1560 0x00, 0x07, 0x64, 0x3F, // 0007643F
1561 0x00, 0x07, 0x27, 0xFF, // 000727FF
1562 0x00, 0x00, 0x00, 0x00, // 00000000
1563 0x00, 0x09, 0xA4, 0x44, // 0009A444
1564 0x00, 0x04, 0x14, 0x00, // 00041400
1565 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1566 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1567 0x00, 0x0A, 0xD2, 0xC4, // 000AD2C4
1568 0x00, 0x09, 0x80, 0x48, // 00098048
1569 0x00, 0x09, 0xB1, 0x78, // 0009B178
1570 0x00, 0x08, 0x00, 0xC6, // 000800C6
1571 0x00, 0x09, 0x89, 0x48, // 00098948
1572 0x00, 0x09, 0xB2, 0x78, // 0009B278
1573 0x00, 0x08, 0x09, 0xC6, // 000809C6
1574 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1575 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1576 0x00, 0x08, 0xAD, 0x40, // 0008AD40
1577 0x00, 0x02, 0x9F, 0x30, // 00029F30
1578 0x00, 0x09, 0x90, 0x48, // 00099048
1579 0x00, 0x09, 0xB0, 0x78, // 0009B078
1580 0x00, 0x08, 0x02, 0xC6, // 000802C6
1581 0x00, 0x09, 0x91, 0x48, // 00099148
1582 0x00, 0x09, 0xB1, 0x78, // 0009B178
1583 0x00, 0x08, 0x0A, 0xC6, // 00080AC6
1584 0x00, 0x00, 0xC1, 0x07, // 0000C107
1585 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1586 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1587 0x00, 0x00, 0x00, 0x00, // 00000000
1588 0x00, 0x00, 0x00, 0x00, // 00000000
1589 0x00, 0x00, 0x00, 0x00, // 00000000
1590 0x00, 0x00, 0x00, 0x00, // 00000000
1591 0x00, 0x06, 0x18, 0x68, // 00061868
1592 0x00, 0x06, 0x00, 0x1C, // 0006001C
1593 0x00, 0x09, 0x9B, 0x7D, // 00099B7D
1594 0x00, 0x00, 0xC1, 0x07, // 0000C107
1595 0x00, 0x06, 0x08, 0x20, // 00060820
1596 0x00, 0x06, 0x10, 0x6E, // 0006106E
1597 0x00, 0x08, 0x81, 0xC0, // 000881C0
1598 0x00, 0x09, 0x03, 0xC0, // 000903C0
1599 0x00, 0x02, 0x86, 0x08, // 00028608
1600 0x00, 0x08, 0x00, 0xC2, // 000800C2
1601 0x00, 0x0B, 0x40, 0x7F, // 000B407F
1602 0x00, 0x01, 0x0A, 0x20, // 00010A20
1603 0x00, 0x0B, 0x49, 0x7F, // 000B497F
1604 0x00, 0x04, 0x14, 0x00, // 00041400
1605 0x00, 0x0B, 0x76, 0x78, // 000B7678
1606 0x00, 0x09, 0x92, 0x48, // 00099248
1607 0x00, 0x09, 0x89, 0x48, // 00098948
1608 0x00, 0x09, 0x9A, 0x68, // 00099A68
1609 0x00, 0x08, 0x09, 0xC3, // 000809C3
1610 0x00, 0x08, 0x9F, 0xC1, // 00089FC1
1611 0x00, 0x02, 0x9E, 0x08, // 00029E08
1612 0x00, 0x00, 0xC1, 0x87, // 0000C187
1613 0x00, 0x06, 0xB0, 0x68, // 0006B068
1614 0x00, 0x09, 0x92, 0x48, // 00099248
1615 0x00, 0x09, 0x89, 0x48, // 00098948
1616 0x00, 0x09, 0x9A, 0x68, // 00099A68
1617 0x00, 0x08, 0x09, 0xC3, // 000809C3
1618 0x00, 0x0B, 0x76, 0x40, // 000B7640
1619 0x00, 0x04, 0x14, 0x08, // 00041408
1620 0x00, 0x08, 0x9F, 0xC1, // 00089FC1
1621 0x00, 0x02, 0x9E, 0x08, // 00029E08
1622 0x00, 0x00, 0xC1, 0x87, // 0000C187
1623 0x00, 0x06, 0xB0, 0x68, // 0006B068
1624 0x00, 0x00, 0xC1, 0x07, // 0000C107
1625 0x00, 0x0B, 0x40, 0x40, // 000B4040
1626 0x00, 0x00, 0x00, 0x00, // 00000000
1627 0x00, 0x00, 0x00, 0x00, // 00000000
1628 0x00, 0x00, 0x00, 0x00, // 00000000
1629 0x00, 0x00, 0x00, 0x00, // 00000000
1630 0x00, 0x00, 0x00, 0x00, // 00000000
1631 0x00, 0x06, 0x30, 0x71, // 00063071
1632 0x00, 0x07, 0x44, 0x01, // 00074401
1633 0x00, 0x08, 0xB6, 0x40, // 0008B640
1634 0x00, 0x02, 0x9E, 0x08, // 00029E08
1635 0x00, 0x02, 0x15, 0x31, // 00021531
1636 0x00, 0x06, 0x18, 0x7A, // 0006187A
1637 0x00, 0x06, 0x30, 0x72, // 00063072
1638 0x00, 0x07, 0x06, 0x00, // 00070600
1639 0x00, 0x06, 0x08, 0x28, // 00060828
1640 0x00, 0x08, 0x38, 0x41, // 00083841
1641 0x00, 0x08, 0x90, 0xC1, // 000890C1
1642 0x00, 0x02, 0x9F, 0x08, // 00029F08
1643 0x00, 0x00, 0xC1, 0x87, // 0000C187
1644 0x00, 0x07, 0x54, 0x03, // 00075403
1645 0x00, 0x07, 0x17, 0xF0, // 000717F0
1646 0x00, 0x06, 0xB8, 0x22, // 0006B822
1647 0x00, 0x01, 0x04, 0x90, // 00010490
1648 0x00, 0x09, 0x92, 0x48, // 00099248
1649 0x00, 0x0A, 0xE7, 0x8A, // 000AE78A
1650 0x00, 0x0A, 0xEF, 0x8A, // 000AEF8A
1651 0x00, 0x08, 0x36, 0x41, // 00083641
1652 0x00, 0x09, 0xAD, 0x78, // 0009AD78
1653 0x00, 0x08, 0x24, 0xC5, // 000824C5
1654 0x00, 0x00, 0x00, 0x00, // 00000000
1655 0x00, 0x00, 0x00, 0x00, // 00000000
1656 0x00, 0x06, 0xB0, 0x72, // 0006B072
1657 0x00, 0x07, 0xE0, 0x0E, // 0007E00E
1658 0x00, 0x0B, 0x76, 0x40, // 000B7640
1659 0x00, 0x08, 0x9B, 0x40, // 00089B40
1660 0x00, 0x02, 0x9F, 0x08, // 00029F08
1661 0x00, 0x00, 0xC1, 0x87, // 0000C187
1662 0x00, 0x06, 0xB0, 0x71, // 0006B071
1663 0x00, 0x06, 0x08, 0x20, // 00060820
1664 0x00, 0x06, 0x00, 0x1C, // 0006001C
1665 0x00, 0x06, 0x10, 0x6E, // 0006106E
1666 0x00, 0x08, 0x81, 0xC0, // 000881C0
1667 0x00, 0x02, 0x86, 0x08, // 00028608
1668 0x00, 0x08, 0x00, 0xC2, // 000800C2
1669 0x00, 0x07, 0x5C, 0x01, // 00075C01
1670 0x00, 0x07, 0x1D, 0xE8, // 00071DE8
1671 0x00, 0x0B, 0x76, 0x7F, // 000B767F
1672 0x00, 0x08, 0x93, 0xC0, // 000893C0
1673 0x00, 0x02, 0x88, 0x08, // 00028808
1674 0x00, 0x00, 0xC1, 0x87, // 0000C187
1675 0x00, 0x07, 0x44, 0x00, // 00074400
1676 0x00, 0x07, 0x05, 0x38, // 00070538
1677 0x00, 0x00, 0xC1, 0x07, // 0000C107
1678 0x00, 0x00, 0x00, 0x00, // 00000000
1679 0x00, 0x00, 0x00, 0x00, // 00000000
1680 0x00, 0x00, 0x00, 0x00, // 00000000
1681 0x00, 0x06, 0xB0, 0x71, // 0006B071
1682 0x00, 0x06, 0xB8, 0x28, // 0006B828
1683 0x00, 0x06, 0x80, 0x4B, // 0006804B
1684 0x00, 0x06, 0x00, 0x1C, // 0006001C
1685 0x00, 0x06, 0x08, 0x20, // 00060820
1686 0x00, 0x06, 0x10, 0x6E, // 0006106E
1687 0x00, 0x08, 0x81, 0xC0, // 000881C0
1688 0x00, 0x02, 0x86, 0x08, // 00028608
1689 0x00, 0x08, 0x00, 0xC2, // 000800C2
1690 0x00, 0x06, 0x18, 0x68, // 00061868
1691 0x00, 0x00, 0xC1, 0x07, // 0000C107
1692 0x00, 0x0A, 0x10, 0x44, // 000A1044
1693 0x00, 0x0A, 0x20, 0x42, // 000A2042
1694 0x00, 0x08, 0x12, 0xC4, // 000812C4
1695 0x00, 0x09, 0x03, 0xC2, // 000903C2
1696 0x00, 0x00, 0x00, 0x00, // 00000000
1697 0x00, 0x0A, 0x00, 0x7C, // 000A007C
1698 0x00, 0x07, 0x44, 0x00, // 00074400
1699 0x00, 0x07, 0x04, 0x20, // 00070420
1700 0x00, 0x07, 0x54, 0x05, // 00075405
1701 0x00, 0x07, 0x15, 0x7C, // 0007157C
1702 0x00, 0x0B, 0x49, 0x41, // 000B4941
1703 0x00, 0x0B, 0x64, 0x7F, // 000B647F
1704 0x00, 0x0B, 0x5B, 0x78, // 000B5B78
1705 0x00, 0x09, 0xA4, 0x7C, // 0009A47C
1706 0x00, 0x06, 0x90, 0x0A, // 0006900A
1707 0x00, 0x0B, 0x76, 0x40, // 000B7640
1708 0x00, 0x09, 0x94, 0x83, // 00099483
1709 0x00, 0x08, 0x36, 0x41, // 00083641
1710 0x00, 0x09, 0x89, 0x41, // 00098941
1711 0x00, 0x09, 0x92, 0x41, // 00099241
1712 0x00, 0x02, 0x82, 0x08, // 00028208
1713 0x00, 0x08, 0x09, 0xC4, // 000809C4
1714 0x00, 0x01, 0x04, 0x13, // 00010413
1715 0x00, 0x08, 0xAF, 0xC1, // 0008AFC1
1716 0x00, 0x02, 0x9E, 0x08, // 00029E08
1717 0x00, 0x00, 0xC1, 0x82, // 0000C182
1718 0x00, 0x08, 0x36, 0x41, // 00083641
1719 0x00, 0x09, 0x89, 0x41, // 00098941
1720 0x00, 0x09, 0x92, 0x41, // 00099241
1721 0x00, 0x02, 0x82, 0x08, // 00028208
1722 0x00, 0x08, 0x09, 0xC4, // 000809C4
1723 0x00, 0x08, 0xAF, 0xC1, // 0008AFC1
1724 0x00, 0x02, 0x9E, 0x08, // 00029E08
1725 0x00, 0x00, 0xC1, 0x82, // 0000C182
1726 0x00, 0x04, 0x2C, 0x08, // 00042C08
1727 0x00, 0x08, 0x80, 0x41, // 00088041
1728 0x00, 0x02, 0x9F, 0x10, // 00029F10
1729 0x00, 0x02, 0x15, 0x62, // 00021562
1730 0x00, 0x02, 0x81, 0x28, // 00028128
1731 0x00, 0x0B, 0x40, 0x40, // 000B4040
1732 0x00, 0x02, 0x81, 0x08, // 00028108
1733 0x00, 0x0B, 0x40, 0x7F, // 000B407F
1734 0x00, 0x08, 0xAE, 0x54, // 0008AE54
1735 0x00, 0x02, 0x9F, 0x10, // 00029F10
1736 0x00, 0x00, 0xC1, 0x87, // 0000C187
1737 0x00, 0x02, 0x81, 0x28, // 00028128
1738 0x00, 0x0B, 0x76, 0x40, // 000B7640
1739 0x00, 0x00, 0xC1, 0x87, // 0000C187
1740 0x00, 0x00, 0x00, 0x00, // 00000000
1741 0x00, 0x00, 0x00, 0x00, // 00000000
1742 0x00, 0x06, 0xB0, 0x68, // 0006B068
1743 0x00, 0x04, 0x34, 0x08, // 00043408
1744 0x00, 0x00, 0x00, 0x00, // 00000000
1745 0x00, 0x00, 0x00, 0x00, // 00000000
1746 0x00, 0x06, 0x10, 0x68, // 00061068
1747 0x00, 0x00, 0x00, 0x00, // 00000000
1748 0x00, 0x08, 0x82, 0x47, // 00088247
1749 0x00, 0x02, 0x88, 0x08, // 00028808
1750 0x00, 0x02, 0x15, 0x96, // 00021596
1751 0x00, 0x0B, 0x64, 0x41, // 000B6441
1752 0x00, 0x08, 0x9A, 0x54, // 00089A54
1753 0x00, 0x09, 0xA4, 0x78, // 0009A478
1754 0x00, 0x0A, 0xEC, 0x8C, // 000AEC8C
1755 0x00, 0x0A, 0xE4, 0x7F, // 000AE47F
1756 0x00, 0x0A, 0xF4, 0x84, // 000AF484
1757 0x00, 0x0A, 0xF4, 0x8C, // 000AF48C
1758 0x00, 0x0A, 0xCC, 0x84, // 000ACC84
1759 0x00, 0x07, 0x64, 0x3F, // 0007643F
1760 0x00, 0x07, 0x27, 0xFF, // 000727FF
1761 0x00, 0x00, 0x00, 0x00, // 00000000
1762 0x00, 0x09, 0xA4, 0x44, // 0009A444
1763 0x00, 0x09, 0x85, 0xC2, // 000985C2
1764 0x00, 0x09, 0x86, 0xC3, // 000986C3
1765 0x00, 0x08, 0x00, 0xC0, // 000800C0
1766 0x00, 0x08, 0x12, 0x50, // 00081250
1767 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1768 0x00, 0x08, 0x9A, 0x54, // 00089A54
1769 0x00, 0x02, 0x87, 0x18, // 00028718
1770 0x00, 0x08, 0x92, 0x54, // 00089254
1771 0x00, 0x08, 0x2E, 0x40, // 00082E40
1772 0x00, 0x08, 0x31, 0x40, // 00083140
1773 0x00, 0x08, 0x9A, 0x54, // 00089A54
1774 0x00, 0x09, 0x8D, 0xC2, // 00098DC2
1775 0x00, 0x09, 0x8E, 0xC3, // 00098EC3
1776 0x00, 0x08, 0x09, 0xC1, // 000809C1
1777 0x00, 0x08, 0x12, 0x50, // 00081250
1778 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1779 0x00, 0x08, 0x9A, 0x54, // 00089A54
1780 0x00, 0x02, 0x87, 0x08, // 00028708
1781 0x00, 0x08, 0x92, 0x54, // 00089254
1782 0x00, 0x06, 0x28, 0x6C, // 0006286C
1783 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1784 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1785 0x00, 0x06, 0x90, 0x68, // 00069068
1786 0x00, 0x08, 0xAD, 0x40, // 0008AD40
1787 0x00, 0x02, 0x9F, 0x30, // 00029F30
1788 0x00, 0x09, 0x90, 0x48, // 00099048
1789 0x00, 0x09, 0xB0, 0x78, // 0009B078
1790 0x00, 0x08, 0x02, 0xC6, // 000802C6
1791 0x00, 0x09, 0x91, 0x48, // 00099148
1792 0x00, 0x09, 0xB1, 0x78, // 0009B178
1793 0x00, 0x08, 0x0A, 0xC6, // 00080AC6
1794 0x00, 0x00, 0xC1, 0x07, // 0000C107
1795 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1796 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1797 0x00, 0x02, 0x81, 0x18, // 00028118
1798 0x00, 0x07, 0x7C, 0x01, // 00077C01
1799 0x00, 0x07, 0x3C, 0xC0, // 00073CC0
1800 0x00, 0x07, 0x74, 0x01, // 00077401
1801 0x00, 0x07, 0x35, 0x60, // 00073560
1802 0x00, 0x06, 0x20, 0x2E, // 0006202E
1803 0x00, 0x06, 0x18, 0x1C, // 0006181C
1804 0x00, 0x06, 0x10, 0x6E, // 0006106E
1805 0x00, 0x06, 0x00, 0x75, // 00060075
1806 0x00, 0x06, 0x08, 0x7A, // 0006087A
1807 0x00, 0x06, 0xA0, 0x20, // 0006A020
1808 0x00, 0x08, 0x9C, 0xC3, // 00089CC3
1809 0x00, 0x02, 0x86, 0x08, // 00028608
1810 0x00, 0x08, 0x1B, 0xC2, // 00081BC2
1811 0x00, 0x09, 0x16, 0xC3, // 000916C3
1812 0x00, 0x02, 0x89, 0x10, // 00028910
1813 0x00, 0x07, 0x44, 0x00, // 00074400
1814 0x00, 0x07, 0x04, 0x30, // 00070430
1815 0x00, 0x08, 0x89, 0x40, // 00088940
1816 0x00, 0x02, 0x9E, 0x20, // 00029E20
1817 0x00, 0x08, 0x97, 0xC3, // 000897C3
1818 0x00, 0x02, 0x89, 0x10, // 00028910
1819 0x00, 0x07, 0x44, 0x00, // 00074400
1820 0x00, 0x07, 0x04, 0x70, // 00070470
1821 0x00, 0x00, 0xC1, 0x07, // 0000C107
1822 0x00, 0x00, 0x00, 0x00, // 00000000
1823 0x00, 0x00, 0x00, 0x00, // 00000000
1824 0x00, 0x06, 0x98, 0x7F, // 0006987F
1825 0x00, 0x06, 0x84, 0x06, // 00068406
1826 0x00, 0x06, 0x80, 0x75, // 00068075
1827 0x00, 0x00, 0x00, 0x00, // 00000000
1828 0x00, 0x02, 0x15, 0xFC, // 000215FC
1829 0x00, 0x07, 0x4C, 0x05, // 00074C05
1830 0x00, 0x07, 0x0D, 0xE2, // 00070DE2
1831 0x00, 0x00, 0x00, 0x00, // 00000000
1832 0x00, 0x00, 0x00, 0x00, // 00000000
1833 0x00, 0x00, 0x00, 0x00, // 00000000
1834 0x00, 0x06, 0x88, 0x0F, // 0006880F
1835 0x00, 0x07, 0x4C, 0x01, // 00074C01
1836 0x00, 0x07, 0x0E, 0x32, // 00070E32
1837 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
1838 0x00, 0x0B, 0x64, 0x40, // 000B6440
1839 0x00, 0x00, 0x00, 0x00, // 00000000
1840 0x00, 0x06, 0x8C, 0x22, // 00068C22
1841 0x00, 0x06, 0x5C, 0x14, // 00065C14
1842 0x00, 0x06, 0xA8, 0x74, // 0006A874
1843 0x00, 0x06, 0x5C, 0x24, // 00065C24
1844 0x00, 0x06, 0x5C, 0x26, // 00065C26
1845 0x00, 0x06, 0x5C, 0x2E, // 00065C2E
1846 0x00, 0x06, 0x5C, 0x25, // 00065C25
1847 0x00, 0x06, 0x5C, 0x27, // 00065C27
1848 0x00, 0x06, 0x5C, 0x2F, // 00065C2F
1849 0x00, 0x06, 0x5C, 0x44, // 00065C44
1850 0x00, 0x04, 0x80, 0x03, // 00048003
1851 0x00, 0x00, 0x00, 0x00, // 00000000
1852 0x00, 0x00, 0x00, 0x00, // 00000000
1853 0x00, 0x00, 0x00, 0x00, // 00000000
1854 0x00, 0x00, 0xC1, 0x06, // 0000C106
1855 0x00, 0x06, 0x84, 0x74, // 00068474
1856 0x00, 0x06, 0x84, 0x43, // 00068443
1857 0x00, 0x06, 0x5C, 0x3C, // 00065C3C
1858 0x00, 0x06, 0x5C, 0x3B, // 00065C3B
1859 0x00, 0x06, 0x5C, 0x54, // 00065C54
1860 0x00, 0x06, 0x5C, 0x53, // 00065C53
1861 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1862 0x00, 0x07, 0x4C, 0x01, // 00074C01
1863 0x00, 0x07, 0x0E, 0x25, // 00070E25
1864 0x00, 0x00, 0x00, 0x00, // 00000000
1865 0x00, 0x00, 0x00, 0x00, // 00000000
1866 0x00, 0x06, 0xA8, 0x74, // 0006A874
1867 0x00, 0x06, 0x8C, 0x22, // 00068C22
1868 0x00, 0x06, 0x5C, 0x14, // 00065C14
1869 0x00, 0x06, 0x5C, 0x24, // 00065C24
1870 0x00, 0x06, 0x5C, 0x26, // 00065C26
1871 0x00, 0x06, 0x5C, 0x2E, // 00065C2E
1872 0x00, 0x06, 0x5C, 0x25, // 00065C25
1873 0x00, 0x06, 0x5C, 0x27, // 00065C27
1874 0x00, 0x06, 0x5C, 0x2F, // 00065C2F
1875 0x00, 0x00, 0xC1, 0x07, // 0000C107
1876 0x00, 0x06, 0x5C, 0x44, // 00065C44
1877 0x00, 0x06, 0x5C, 0x43, // 00065C43
1878 0x00, 0x06, 0x5C, 0x3C, // 00065C3C
1879 0x00, 0x06, 0x5C, 0x3B, // 00065C3B
1880 0x00, 0x06, 0x5C, 0x54, // 00065C54
1881 0x00, 0x06, 0x5C, 0x53, // 00065C53
1882 0x00, 0x07, 0x5C, 0x00, // 00075C00
1883 0x00, 0x07, 0x1C, 0x02, // 00071C02
1884 0x00, 0x02, 0x81, 0x10, // 00028110
1885 0x00, 0x07, 0x5C, 0x00, // 00075C00
1886 0x00, 0x07, 0x1C, 0x01, // 00071C01
1887 0x00, 0x07, 0x54, 0x01, // 00075401
1888 0x00, 0x07, 0x16, 0x65, // 00071665
1889 0x00, 0x06, 0x00, 0x61, // 00060061
1890 0x00, 0x06, 0x20, 0x7A, // 0006207A
1891 0x00, 0x07, 0x4C, 0x05, // 00074C05
1892 0x00, 0x06, 0x9C, 0x7F, // 00069C7F
1893 0x00, 0x06, 0x90, 0x22, // 00069022
1894 0x00, 0x04, 0x1F, 0x00, // 00041F00
1895 0x00, 0x08, 0xA4, 0x40, // 0008A440
1896 0x00, 0x02, 0x9E, 0x08, // 00029E08
1897 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
1898 0x00, 0x07, 0x0C, 0x14, // 00070C14
1899 0x00, 0x00, 0x00, 0x00, // 00000000
1900 0x00, 0x00, 0x00, 0x00, // 00000000
1901 0x00, 0x07, 0x98, 0x1F, // 0007981F
1902 0x00, 0x04, 0x17, 0x00, // 00041700
1903 0x00, 0x08, 0xA4, 0x40, // 0008A440
1904 0x00, 0x02, 0x9E, 0x10, // 00029E10
1905 0x00, 0x06, 0x00, 0x6A, // 0006006A
1906 0x00, 0x08, 0x12, 0x41, // 00081241
1907 0x00, 0x06, 0x88, 0x0F, // 0006880F
1908 0x00, 0x00, 0x00, 0x00, // 00000000
1909 0x00, 0x06, 0x80, 0x61, // 00068061
1910 0x00, 0x07, 0x90, 0x07, // 00079007
1911 0x00, 0x06, 0x3C, 0x26, // 00063C26
1912 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1913 0x00, 0x08, 0x3F, 0x40, // 00083F40
1914 0x00, 0x0B, 0x40, 0x40, // 000B4040
1915 0x00, 0x06, 0x1C, 0x1C, // 00061C1C
1916 0x00, 0x00, 0x00, 0x00, // 00000000
1917 0x00, 0x06, 0xBC, 0x1C, // 0006BC1C
1918 0x00, 0x04, 0xB0, 0x0D, // 0004B00D
1919 0x00, 0x00, 0x00, 0x00, // 00000000
1920 0x00, 0x09, 0xB6, 0x7C, // 0009B67C
1921 0x00, 0x01, 0x05, 0x10, // 00010510
1922 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
1923 0x00, 0x02, 0x82, 0x08, // 00028208
1924 0x00, 0x08, 0x00, 0x42, // 00080042
1925 0x00, 0x0B, 0x49, 0x40, // 000B4940
1926 0x00, 0x09, 0xB6, 0x7F, // 0009B67F
1927 0x00, 0x02, 0x82, 0x08, // 00028208
1928 0x00, 0x08, 0x09, 0x42, // 00080942
1929 0x00, 0x07, 0x84, 0x0C, // 0007840C
1930 0x00, 0x0B, 0x40, 0x40, // 000B4040
1931 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
1932 0x00, 0x07, 0x8C, 0x0C, // 00078C0C
1933 0x00, 0x07, 0x64, 0x00, // 00076400
1934 0x00, 0x07, 0x24, 0x30, // 00072430
1935 0x00, 0x08, 0x2D, 0x41, // 00082D41
1936 0x00, 0x08, 0xA4, 0xC5, // 0008A4C5
1937 0x00, 0x02, 0x9F, 0x10, // 00029F10
1938 0x00, 0x02, 0x16, 0x35, // 00021635
1939 0x00, 0x02, 0x81, 0x08, // 00028108
1940 0x00, 0x00, 0xC1, 0x87, // 0000C187
1941 0x00, 0x00, 0x00, 0x00, // 00000000
1942 0x00, 0x00, 0x00, 0x00, // 00000000
1943 0x00, 0x00, 0x00, 0x00, // 00000000
1944 0x00, 0x00, 0x00, 0x00, // 00000000
1945 0x00, 0x00, 0x00, 0x00, // 00000000
1946 0x00, 0x06, 0x9C, 0x1C, // 00069C1C
1947 0x00, 0x06, 0x04, 0x6A, // 0006046A
1948 0x00, 0x06, 0x08, 0x77, // 00060877
1949 0x00, 0x07, 0x54, 0x01, // 00075401
1950 0x00, 0x07, 0x17, 0x12, // 00071712
1951 0x00, 0x08, 0x80, 0x40, // 00088040
1952 0x00, 0x02, 0x9E, 0x10, // 00029E10
1953 0x00, 0x02, 0x16, 0x71, // 00021671
1954 0x00, 0x02, 0x81, 0x28, // 00028128
1955 0x00, 0x02, 0x88, 0x08, // 00028808
1956 0x00, 0x00, 0xC1, 0x87, // 0000C187
1957 0x00, 0x08, 0x80, 0x41, // 00088041
1958 0x00, 0x06, 0x24, 0x66, // 00062466
1959 0x00, 0x06, 0x2C, 0x67, // 00062C67
1960 0x00, 0x06, 0x34, 0x68, // 00063468
1961 0x00, 0x06, 0x3C, 0x69, // 00063C69
1962 0x00, 0x08, 0x89, 0x40, // 00088940
1963 0x00, 0x02, 0x9F, 0x20, // 00029F20
1964 0x00, 0x0B, 0x64, 0xC4, // 000B64C4
1965 0x00, 0x0B, 0x6D, 0xC5, // 000B6DC5
1966 0x00, 0x0B, 0x76, 0xC6, // 000B76C6
1967 0x00, 0x0B, 0x7F, 0xC7, // 000B7FC7
1968 0x00, 0x08, 0x25, 0x8C, // 0008258C
1969 0x00, 0x08, 0x2D, 0x8D, // 00082D8D
1970 0x00, 0x08, 0x35, 0x8E, // 0008358E
1971 0x00, 0x00, 0xC1, 0x07, // 0000C107
1972 0x00, 0x08, 0x3D, 0x8F, // 00083D8F
1973 0x00, 0x06, 0x84, 0x6A, // 0006846A
1974 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1975 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
1976 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
1977 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
1978 0x00, 0x08, 0x80, 0x41, // 00088041
1979 0x00, 0x06, 0x90, 0x22, // 00069022
1980 0x00, 0x04, 0x27, 0x08, // 00042708
1981 0x00, 0x04, 0x2F, 0x08, // 00042F08
1982 0x00, 0x04, 0x37, 0x08, // 00043708
1983 0x00, 0x04, 0x3F, 0x08, // 00043F08
1984 0x00, 0x08, 0x89, 0x40, // 00088940
1985 0x00, 0x02, 0x9F, 0x20, // 00029F20
1986 0x00, 0x0B, 0x64, 0x40, // 000B6440
1987 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1988 0x00, 0x0B, 0x76, 0x40, // 000B7640
1989 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
1990 0x00, 0x00, 0xC1, 0x07, // 0000C107
1991 0x00, 0x06, 0x84, 0x6A, // 0006846A
1992 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1993 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
1994 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
1995 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
1996 0x00, 0x00, 0x00, 0x00, // 00000000
1997};
1998// addres 06800 count 1077 (4314 bytes)
1999static const unsigned char maspcm_array10[] = {
2000 0xf0, 0x00, 0x04, 0x35, 0x08, 0x00,
2001 0x00, 0x07, 0x44, 0x01, // 00074401
2002 0x00, 0x07, 0x06, 0x61, // 00070661
2003 0x00, 0x07, 0x4C, 0x00, // 00074C00
2004 0x00, 0x07, 0x0F, 0x00, // 00070F00
2005 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2006 0x00, 0x0B, 0x5B, 0x7E, // 000B5B7E
2007 0x00, 0x06, 0x80, 0x22, // 00068022
2008 0x00, 0x04, 0x07, 0x00, // 00040700
2009 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
2010 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2011 0x00, 0x0A, 0x09, 0x78, // 000A0978
2012 0x00, 0x02, 0x9F, 0x20, // 00029F20
2013 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2014 0x00, 0x08, 0xA1, 0x41, // 0008A141
2015 0x00, 0x02, 0x9F, 0x08, // 00029F08
2016 0x00, 0x0B, 0x52, 0x40, // 000B5240
2017 0x00, 0x00, 0x00, 0x00, // 00000000
2018 0x00, 0x08, 0x92, 0x40, // 00089240
2019 0x00, 0x02, 0x9E, 0x08, // 00029E08
2020 0x00, 0x0B, 0x5B, 0x7E, // 000B5B7E
2021 0x00, 0x07, 0x64, 0x01, // 00076401
2022 0x00, 0x07, 0x26, 0x69, // 00072669
2023 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
2024 0x00, 0x0B, 0x75, 0x7E, // 000B757E
2025 0x00, 0x00, 0x00, 0x00, // 00000000
2026 0x00, 0x06, 0xA0, 0x22, // 0006A022
2027 0x00, 0x0A, 0xF7, 0x86, // 000AF786
2028 0x00, 0x0A, 0xEF, 0x85, // 000AEF85
2029 0x00, 0x0A, 0x36, 0x7F, // 000A367F
2030 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
2031 0x00, 0x0B, 0x64, 0x70, // 000B6470
2032 0x00, 0x06, 0x98, 0x79, // 00069879
2033 0x00, 0x06, 0x90, 0x78, // 00069078
2034 0x00, 0x06, 0xA8, 0x77, // 0006A877
2035 0x00, 0x06, 0xB0, 0x7A, // 0006B07A
2036 0x00, 0x06, 0xBC, 0x64, // 0006BC64
2037 0x00, 0x06, 0xB8, 0x71, // 0006B871
2038 0x00, 0x06, 0xB8, 0x70, // 0006B870
2039 0x00, 0x06, 0xB8, 0x69, // 0006B869
2040 0x00, 0x06, 0xB8, 0x7B, // 0006B87B
2041 0x00, 0x06, 0xB8, 0x7C, // 0006B87C
2042 0x00, 0x06, 0x9C, 0x6B, // 00069C6B
2043 0x00, 0x06, 0xBC, 0x6E, // 0006BC6E
2044 0x00, 0x06, 0xBC, 0x72, // 0006BC72
2045 0x00, 0x06, 0xB8, 0x74, // 0006B874
2046 0x00, 0x06, 0xB8, 0x7D, // 0006B87D
2047 0x00, 0x06, 0xBC, 0x73, // 0006BC73
2048 0x00, 0x06, 0x9C, 0x7D, // 00069C7D
2049 0x00, 0x06, 0xBC, 0x7C, // 0006BC7C
2050 0x00, 0x06, 0xBC, 0x7B, // 0006BC7B
2051 0x00, 0x00, 0x00, 0x00, // 00000000
2052 0x00, 0x06, 0x3C, 0x65, // 00063C65
2053 0x00, 0x00, 0x00, 0x00, // 00000000
2054 0x00, 0x09, 0xBF, 0x41, // 0009BF41
2055 0x00, 0x00, 0x00, 0x00, // 00000000
2056 0x00, 0x00, 0x00, 0x00, // 00000000
2057 0x00, 0x00, 0x00, 0x00, // 00000000
2058 0x00, 0x06, 0xBC, 0x7A, // 0006BC7A
2059 0x00, 0x07, 0x7C, 0x01, // 00077C01
2060 0x00, 0x07, 0x3D, 0xFF, // 00073DFF
2061 0x00, 0x07, 0x54, 0x00, // 00075400
2062 0x00, 0x07, 0x14, 0x00, // 00071400
2063 0x00, 0x07, 0x5C, 0x01, // 00075C01
2064 0x00, 0x07, 0x1C, 0x90, // 00071C90
2065 0x00, 0x07, 0x74, 0x01, // 00077401
2066 0x00, 0x07, 0x34, 0xA0, // 000734A0
2067 0x00, 0x06, 0x08, 0x76, // 00060876
2068 0x00, 0x00, 0x00, 0x00, // 00000000
2069 0x00, 0x08, 0x21, 0x41, // 00082141
2070 0x00, 0x06, 0xB8, 0x16, // 0006B816
2071 0x00, 0x06, 0x90, 0x24, // 00069024
2072 0x00, 0x06, 0x90, 0x2C, // 0006902C
2073 0x00, 0x06, 0x90, 0x1C, // 0006901C
2074 0x00, 0x06, 0x90, 0x20, // 00069020
2075 0x00, 0x06, 0x98, 0x25, // 00069825
2076 0x00, 0x06, 0x98, 0x2D, // 0006982D
2077 0x00, 0x06, 0xB0, 0x1D, // 0006B01D
2078 0x00, 0x06, 0xA0, 0x10, // 0006A010
2079 0x00, 0x06, 0x98, 0x21, // 00069821
2080 0x00, 0x07, 0x7C, 0x00, // 00077C00
2081 0x00, 0x07, 0x3C, 0x24, // 00073C24
2082 0x00, 0x07, 0x54, 0x01, // 00075401
2083 0x00, 0x07, 0x16, 0x00, // 00071600
2084 0x00, 0x07, 0x6C, 0x01, // 00076C01
2085 0x00, 0x07, 0x2C, 0x98, // 00072C98
2086 0x00, 0x06, 0xBC, 0x16, // 0006BC16
2087 0x00, 0x06, 0x94, 0x2A, // 0006942A
2088 0x00, 0x00, 0x00, 0x00, // 00000000
2089 0x00, 0x06, 0xAC, 0x2B, // 0006AC2B
2090 0x00, 0x07, 0x7C, 0x01, // 00077C01
2091 0x00, 0x07, 0x3D, 0xFF, // 00073DFF
2092 0x00, 0x07, 0x54, 0x00, // 00075400
2093 0x00, 0x07, 0x14, 0x00, // 00071400
2094 0x00, 0x07, 0x5C, 0x01, // 00075C01
2095 0x00, 0x07, 0x1E, 0x00, // 00071E00
2096 0x00, 0x07, 0x6C, 0x00, // 00076C00
2097 0x00, 0x07, 0x2C, 0x90, // 00072C90
2098 0x00, 0x06, 0xBC, 0x14, // 0006BC14
2099 0x00, 0x06, 0x94, 0x1C, // 0006941C
2100 0x00, 0x06, 0x9C, 0x26, // 00069C26
2101 0x00, 0x06, 0x9C, 0x2E, // 00069C2E
2102 0x00, 0x06, 0xAC, 0x1D, // 0006AC1D
2103 0x00, 0x06, 0xAC, 0x27, // 0006AC27
2104 0x00, 0x06, 0xAC, 0x2F, // 0006AC2F
2105 0x00, 0x07, 0x4C, 0x00, // 00074C00
2106 0x00, 0x07, 0x0C, 0x04, // 00070C04
2107 0x00, 0x07, 0x54, 0x00, // 00075400
2108 0x00, 0x07, 0x14, 0x10, // 00071410
2109 0x00, 0x00, 0x00, 0x00, // 00000000
2110 0x00, 0x06, 0x88, 0x4B, // 0006884B
2111 0x00, 0x00, 0x00, 0x00, // 00000000
2112 0x00, 0x06, 0x94, 0x06, // 00069406
2113 0x00, 0x00, 0x00, 0x00, // 00000000
2114 0x00, 0x07, 0x5C, 0x01, // 00075C01
2115 0x00, 0x07, 0x1E, 0x62, // 00071E62
2116 0x00, 0x06, 0x10, 0x78, // 00061078
2117 0x00, 0x07, 0x64, 0x00, // 00076400
2118 0x00, 0x07, 0x24, 0x00, // 00072400
2119 0x00, 0x07, 0x5C, 0x00, // 00075C00
2120 0x00, 0x07, 0x1F, 0x18, // 00071F18
2121 0x00, 0x06, 0x98, 0x22, // 00069822
2122 0x00, 0x08, 0x92, 0x41, // 00089241
2123 0x00, 0x02, 0x9E, 0xF0, // 00029EF0
2124 0x00, 0x07, 0x5C, 0x00, // 00075C00
2125 0x00, 0x07, 0x1C, 0x00, // 00071C00
2126 0x00, 0x07, 0x6C, 0x00, // 00076C00
2127 0x00, 0x07, 0x2C, 0x80, // 00072C80
2128 0x00, 0x07, 0x74, 0x00, // 00077400
2129 0x00, 0x07, 0x34, 0x04, // 00073404
2130 0x00, 0x0A, 0xED, 0xC0, // 000AEDC0
2131 0x00, 0x02, 0x9F, 0x08, // 00029F08
2132 0x00, 0x08, 0x1B, 0xC6, // 00081BC6
2133 0x00, 0x07, 0x6C, 0x00, // 00076C00
2134 0x00, 0x07, 0x2C, 0x40, // 00072C40
2135 0x00, 0x07, 0x74, 0x02, // 00077402
2136 0x00, 0x07, 0x34, 0x00, // 00073400
2137 0x00, 0x0A, 0xED, 0xC0, // 000AEDC0
2138 0x00, 0x02, 0x9F, 0x08, // 00029F08
2139 0x00, 0x08, 0x1B, 0xC6, // 00081BC6
2140 0x00, 0x07, 0x6C, 0x00, // 00076C00
2141 0x00, 0x07, 0x2C, 0x04, // 00072C04
2142 0x00, 0x07, 0x74, 0x00, // 00077400
2143 0x00, 0x07, 0x34, 0x20, // 00073420
2144 0x00, 0x04, 0x17, 0x00, // 00041700
2145 0x00, 0x0A, 0xED, 0xC0, // 000AEDC0
2146 0x00, 0x02, 0x9F, 0x08, // 00029F08
2147 0x00, 0x08, 0x1B, 0xC6, // 00081BC6
2148 0x00, 0x0A, 0xD2, 0x41, // 000AD241
2149 0x00, 0x02, 0x9F, 0x10, // 00029F10
2150 0x00, 0x07, 0x5C, 0x00, // 00075C00
2151 0x00, 0x07, 0x1C, 0x00, // 00071C00
2152 0x00, 0x07, 0x64, 0x00, // 00076400
2153 0x00, 0x07, 0x27, 0x18, // 00072718
2154 0x00, 0x00, 0x00, 0x00, // 00000000
2155 0x00, 0x06, 0x98, 0x3B, // 0006983B
2156 0x00, 0x06, 0x9C, 0x75, // 00069C75
2157 0x00, 0x06, 0xA0, 0x53, // 0006A053
2158 0x00, 0x06, 0x28, 0x77, // 00062877
2159 0x00, 0x07, 0x54, 0x01, // 00075401
2160 0x00, 0x07, 0x16, 0x40, // 00071640
2161 0x00, 0x07, 0x64, 0x00, // 00076400
2162 0x00, 0x07, 0x24, 0x90, // 00072490
2163 0x00, 0x0B, 0x49, 0x7D, // 000B497D
2164 0x00, 0x07, 0x44, 0x01, // 00074401
2165 0x00, 0x07, 0x06, 0x6C, // 0007066C
2166 0x00, 0x06, 0x90, 0x1E, // 0006901E
2167 0x00, 0x06, 0xA0, 0x1F, // 0006A01F
2168 0x00, 0x06, 0x88, 0x14, // 00068814
2169 0x00, 0x06, 0x80, 0x22, // 00068022
2170 0x00, 0x04, 0x0F, 0x08, // 00040F08
2171 0x00, 0x04, 0x17, 0x08, // 00041708
2172 0x00, 0x04, 0x1F, 0x08, // 00041F08
2173 0x00, 0x04, 0x27, 0x08, // 00042708
2174 0x00, 0x08, 0xAD, 0x40, // 0008AD40
2175 0x00, 0x02, 0x9F, 0x20, // 00029F20
2176 0x00, 0x0B, 0x49, 0x40, // 000B4940
2177 0x00, 0x0B, 0x52, 0x40, // 000B5240
2178 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2179 0x00, 0x0B, 0x64, 0x40, // 000B6440
2180 0x00, 0x07, 0x88, 0x0D, // 0007880D
2181 0x00, 0x07, 0x90, 0x0D, // 0007900D
2182 0x00, 0x07, 0x98, 0x0D, // 0007980D
2183 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
2184 0x00, 0x07, 0x54, 0x01, // 00075401
2185 0x00, 0x07, 0x16, 0x50, // 00071650
2186 0x00, 0x07, 0x64, 0x00, // 00076400
2187 0x00, 0x07, 0x26, 0x90, // 00072690
2188 0x00, 0x0B, 0x49, 0x7D, // 000B497D
2189 0x00, 0x07, 0x44, 0x01, // 00074401
2190 0x00, 0x07, 0x06, 0x70, // 00070670
2191 0x00, 0x06, 0x94, 0x20, // 00069420
2192 0x00, 0x06, 0xA4, 0x21, // 0006A421
2193 0x00, 0x06, 0x8C, 0x15, // 00068C15
2194 0x00, 0x06, 0x80, 0x22, // 00068022
2195 0x00, 0x0B, 0x52, 0x75, // 000B5275
2196 0x00, 0x04, 0x0F, 0x08, // 00040F08
2197 0x00, 0x04, 0x0F, 0x08, // 00040F08
2198 0x00, 0x04, 0x0F, 0x08, // 00040F08
2199 0x00, 0x04, 0x0F, 0x08, // 00040F08
2200 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2201 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2202 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2203 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2204 0x00, 0x06, 0x94, 0x15, // 00069415
2205 0x00, 0x02, 0x1C, 0x0E, // 00021C0E
2206 0x00, 0x07, 0x4C, 0x06, // 00074C06
2207 0x00, 0x07, 0x0C, 0xD3, // 00070CD3
2208 0x00, 0x00, 0x00, 0x00, // 00000000
2209 0x00, 0x00, 0x00, 0x00, // 00000000
2210 0x00, 0x00, 0x00, 0x00, // 00000000
2211 0x00, 0x06, 0x88, 0x0F, // 0006880F
2212 0x00, 0x07, 0x4C, 0x01, // 00074C01
2213 0x00, 0x07, 0x0E, 0x32, // 00070E32
2214 0x00, 0x07, 0x64, 0x01, // 00076401
2215 0x00, 0x07, 0x26, 0x70, // 00072670
2216 0x00, 0x07, 0x6C, 0x00, // 00076C00
2217 0x00, 0x07, 0x2E, 0x90, // 00072E90
2218 0x00, 0x06, 0x8C, 0x22, // 00068C22
2219 0x00, 0x04, 0x80, 0x4F, // 0004804F
2220 0x00, 0x06, 0x08, 0x78, // 00060878
2221 0x00, 0x06, 0xA4, 0x24, // 0006A424
2222 0x00, 0x06, 0xAC, 0x25, // 0006AC25
2223 0x00, 0x06, 0x5C, 0x3C, // 00065C3C
2224 0x00, 0x06, 0x5C, 0x3B, // 00065C3B
2225 0x00, 0x08, 0x89, 0x40, // 00088940
2226 0x00, 0x02, 0x9F, 0x10, // 00029F10
2227 0x00, 0x02, 0x19, 0x1D, // 0002191D
2228 0x00, 0x02, 0x81, 0x28, // 00028128
2229 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
2230 0x00, 0x07, 0x6C, 0x06, // 00076C06
2231 0x00, 0x07, 0x2C, 0xEB, // 00072CEB
2232 0x00, 0x00, 0x00, 0x00, // 00000000
2233 0x00, 0x00, 0x00, 0x00, // 00000000
2234 0x00, 0x00, 0x00, 0x00, // 00000000
2235 0x00, 0x00, 0x00, 0x00, // 00000000
2236 0x00, 0x07, 0x44, 0x01, // 00074401
2237 0x00, 0x07, 0x06, 0x61, // 00070661
2238 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
2239 0x00, 0x07, 0x0C, 0x00, // 00070C00
2240 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2241 0x00, 0x06, 0x80, 0x22, // 00068022
2242 0x00, 0x0A, 0xC7, 0x82, // 000AC782
2243 0x00, 0x02, 0x9E, 0x20, // 00029E20
2244 0x00, 0x0A, 0xC7, 0x81, // 000AC781
2245 0x00, 0x02, 0x9E, 0x10, // 00029E10
2246 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2247 0x00, 0x02, 0x81, 0x28, // 00028128
2248 0x00, 0x00, 0x00, 0x00, // 00000000
2249 0x00, 0x07, 0x54, 0x04, // 00075404
2250 0x00, 0x07, 0x14, 0x00, // 00071400
2251 0x00, 0x06, 0x30, 0x2C, // 0006302C
2252 0x00, 0x08, 0x92, 0x41, // 00089241
2253 0x00, 0x02, 0x88, 0x10, // 00028810
2254 0x00, 0x02, 0x19, 0x0C, // 0002190C
2255 0x00, 0x02, 0x81, 0x28, // 00028128
2256 0x00, 0x0A, 0xF6, 0x41, // 000AF641
2257 0x00, 0x02, 0x9E, 0x10, // 00029E10
2258 0x00, 0x02, 0x18, 0xFA, // 000218FA
2259 0x00, 0x02, 0x81, 0x28, // 00028128
2260 0x00, 0x06, 0x30, 0x2C, // 0006302C
2261 0x00, 0x08, 0x92, 0x41, // 00089241
2262 0x00, 0x02, 0x88, 0x10, // 00028810
2263 0x00, 0x02, 0x19, 0x0C, // 0002190C
2264 0x00, 0x02, 0x81, 0x28, // 00028128
2265 0x00, 0x0A, 0xF6, 0x41, // 000AF641
2266 0x00, 0x02, 0x9F, 0x10, // 00029F10
2267 0x00, 0x02, 0x19, 0x03, // 00021903
2268 0x00, 0x02, 0x81, 0x28, // 00028128
2269 0x00, 0x06, 0x38, 0x52, // 00063852
2270 0x00, 0x06, 0x30, 0x2C, // 0006302C
2271 0x00, 0x09, 0xBF, 0x7A, // 0009BF7A
2272 0x00, 0x00, 0x00, 0x00, // 00000000
2273 0x00, 0x0A, 0xFF, 0x41, // 000AFF41
2274 0x00, 0x02, 0x9E, 0x08, // 00029E08
2275 0x00, 0x0B, 0x36, 0x41, // 000B3641
2276 0x00, 0x00, 0x00, 0x00, // 00000000
2277 0x00, 0x00, 0x00, 0x00, // 00000000
2278 0x00, 0x00, 0x00, 0x00, // 00000000
2279 0x00, 0x06, 0xB0, 0x2C, // 0006B02C
2280 0x00, 0x00, 0x00, 0x00, // 00000000
2281 0x00, 0x08, 0x92, 0x40, // 00089240
2282 0x00, 0x02, 0x88, 0x10, // 00028810
2283 0x00, 0x02, 0x18, 0xE4, // 000218E4
2284 0x00, 0x02, 0x81, 0x28, // 00028128
2285 0x00, 0x00, 0x00, 0x00, // 00000000
2286 0x00, 0x0B, 0x40, 0x7D, // 000B407D
2287 0x00, 0x00, 0x00, 0x00, // 00000000
2288 0x00, 0x00, 0x00, 0x00, // 00000000
2289 0x00, 0x00, 0x00, 0x00, // 00000000
2290 0x00, 0x06, 0x84, 0x15, // 00068415
2291 0x00, 0x04, 0x35, 0x08, // 00043508
2292 0x00, 0x04, 0xB8, 0x16, // 0004B816
2293 0x00, 0x00, 0x00, 0x00, // 00000000
2294 0x00, 0x0C, 0x06, 0x27, // 000C0627
2295 0x00, 0x04, 0x35, 0x18, // 00043518
2296 0x00, 0x04, 0xB8, 0x1E, // 0004B81E
2297 0x00, 0x00, 0x00, 0x00, // 00000000
2298 0x00, 0x0E, 0x06, 0x27, // 000E0627
2299 0x00, 0x04, 0x35, 0x08, // 00043508
2300 0x00, 0x04, 0xB8, 0x16, // 0004B816
2301 0x00, 0x00, 0x00, 0x00, // 00000000
2302 0x00, 0x0C, 0x0E, 0x27, // 000C0E27
2303 0x00, 0x04, 0x35, 0x08, // 00043508
2304 0x00, 0x04, 0xB8, 0x0E, // 0004B80E
2305 0x00, 0x00, 0x00, 0x00, // 00000000
2306 0x00, 0x0E, 0x0E, 0x27, // 000E0E27
2307 0x00, 0x04, 0x35, 0x08, // 00043508
2308 0x00, 0x04, 0xB8, 0x16, // 0004B816
2309 0x00, 0x00, 0x00, 0x00, // 00000000
2310 0x00, 0x0C, 0x16, 0x27, // 000C1627
2311 0x00, 0x04, 0x35, 0x18, // 00043518
2312 0x00, 0x04, 0xB8, 0x1E, // 0004B81E
2313 0x00, 0x00, 0x00, 0x00, // 00000000
2314 0x00, 0x0E, 0x16, 0x27, // 000E1627
2315 0x00, 0x04, 0x35, 0x08, // 00043508
2316 0x00, 0x04, 0xB8, 0x16, // 0004B816
2317 0x00, 0x00, 0x00, 0x00, // 00000000
2318 0x00, 0x0C, 0x1E, 0x27, // 000C1E27
2319 0x00, 0x04, 0x35, 0x08, // 00043508
2320 0x00, 0x04, 0xB8, 0x0E, // 0004B80E
2321 0x00, 0x00, 0x00, 0x00, // 00000000
2322 0x00, 0x0E, 0x1E, 0x27, // 000E1E27
2323 0x00, 0x07, 0x64, 0x01, // 00076401
2324 0x00, 0x00, 0x00, 0x00, // 00000000
2325 0x00, 0x07, 0x27, 0x12, // 00072712
2326 0x00, 0x07, 0x80, 0x0D, // 0007800D
2327 0x00, 0x07, 0x88, 0x0D, // 0007880D
2328 0x00, 0x07, 0x90, 0x0D, // 0007900D
2329 0x00, 0x07, 0x98, 0x0D, // 0007980D
2330 0x00, 0x06, 0xA0, 0x22, // 0006A022
2331 0x00, 0x07, 0x80, 0x0F, // 0007800F
2332 0x00, 0x07, 0x88, 0x0F, // 0007880F
2333 0x00, 0x07, 0x90, 0x0F, // 0007900F
2334 0x00, 0x07, 0x98, 0x07, // 00079807
2335 0x00, 0x06, 0x2C, 0x79, // 00062C79
2336 0x00, 0x00, 0x00, 0x00, // 00000000
2337 0x00, 0x0C, 0x09, 0x0D, // 000C090D
2338 0x00, 0x0C, 0x11, 0x0D, // 000C110D
2339 0x00, 0x0C, 0x19, 0x0D, // 000C190D
2340 0x00, 0x0C, 0x21, 0x0D, // 000C210D
2341 0x00, 0x00, 0x00, 0x00, // 00000000
2342 0x00, 0x00, 0x00, 0x00, // 00000000
2343 0x00, 0x00, 0x00, 0x00, // 00000000
2344 0x00, 0x06, 0x8C, 0x66, // 00068C66
2345 0x00, 0x06, 0x94, 0x67, // 00069467
2346 0x00, 0x06, 0x9C, 0x68, // 00069C68
2347 0x00, 0x06, 0xA4, 0x69, // 0006A469
2348 0x00, 0x06, 0x00, 0x7A, // 0006007A
2349 0x00, 0x00, 0x00, 0x00, // 00000000
2350 0x00, 0x08, 0x80, 0x40, // 00088040
2351 0x00, 0x02, 0x9F, 0x10, // 00029F10
2352 0x00, 0x02, 0x19, 0xF8, // 000219F8
2353 0x00, 0x02, 0x81, 0x28, // 00028128
2354 0x00, 0x06, 0x00, 0x24, // 00060024
2355 0x00, 0x06, 0x08, 0x78, // 00060878
2356 0x00, 0x06, 0x18, 0x76, // 00061876
2357 0x00, 0x07, 0x54, 0x01, // 00075401
2358 0x00, 0x07, 0x16, 0x00, // 00071600
2359 0x00, 0x08, 0x89, 0x41, // 00088941
2360 0x00, 0x02, 0x9F, 0x08, // 00029F08
2361 0x00, 0x06, 0x00, 0x2C, // 0006002C
2362 0x00, 0x06, 0x08, 0x1C, // 0006081C
2363 0x00, 0x08, 0x80, 0xC1, // 000880C1
2364 0x00, 0x02, 0x86, 0x08, // 00028608
2365 0x00, 0x08, 0x00, 0xC2, // 000800C2
2366 0x00, 0x08, 0x9B, 0x41, // 00089B41
2367 0x00, 0x02, 0x9E, 0x08, // 00029E08
2368 0x00, 0x09, 0x80, 0x7F, // 0009807F
2369 0x00, 0x06, 0x14, 0x7B, // 0006147B
2370 0x00, 0x06, 0x1C, 0x7A, // 00061C7A
2371 0x00, 0x08, 0x92, 0x40, // 00089240
2372 0x00, 0x02, 0x9F, 0x28, // 00029F28
2373 0x00, 0x08, 0x98, 0xC3, // 000898C3
2374 0x00, 0x02, 0x87, 0x10, // 00028710
2375 0x00, 0x0B, 0x52, 0x40, // 000B5240
2376 0x00, 0x02, 0x81, 0x08, // 00028108
2377 0x00, 0x0B, 0x40, 0x40, // 000B4040
2378 0x00, 0x00, 0x00, 0x00, // 00000000
2379 0x00, 0x06, 0x94, 0x7B, // 0006947B
2380 0x00, 0x07, 0x54, 0x00, // 00075400
2381 0x00, 0x07, 0x14, 0x12, // 00071412
2382 0x00, 0x07, 0x5C, 0x01, // 00075C01
2383 0x00, 0x07, 0x1E, 0x00, // 00071E00
2384 0x00, 0x08, 0xA0, 0xC2, // 0008A0C2
2385 0x00, 0x02, 0x88, 0x10, // 00028810
2386 0x00, 0x02, 0x19, 0xF8, // 000219F8
2387 0x00, 0x02, 0x81, 0x28, // 00028128
2388 0x00, 0x06, 0x24, 0x2A, // 0006242A
2389 0x00, 0x08, 0xA3, 0xC4, // 0008A3C4
2390 0x00, 0x02, 0x9F, 0x10, // 00029F10
2391 0x00, 0x02, 0x19, 0xF8, // 000219F8
2392 0x00, 0x02, 0x81, 0x28, // 00028128
2393 0x00, 0x07, 0x5C, 0x01, // 00075C01
2394 0x00, 0x07, 0x1E, 0x01, // 00071E01
2395 0x00, 0x07, 0x44, 0x00, // 00074400
2396 0x00, 0x07, 0x04, 0x09, // 00070409
2397 0x00, 0x06, 0x08, 0x69, // 00060869
2398 0x00, 0x06, 0x9C, 0x22, // 00069C22
2399 0x00, 0x06, 0x10, 0x6A, // 0006106A
2400 0x00, 0x08, 0x89, 0x40, // 00088940
2401 0x00, 0x02, 0x9F, 0x10, // 00029F10
2402 0x00, 0x02, 0x19, 0xA4, // 000219A4
2403 0x00, 0x02, 0x81, 0x28, // 00028128
2404 0x00, 0x08, 0x92, 0x41, // 00089241
2405 0x00, 0x02, 0x9F, 0x10, // 00029F10
2406 0x00, 0x02, 0x19, 0xA4, // 000219A4
2407 0x00, 0x02, 0x81, 0x28, // 00028128
2408 0x00, 0x08, 0x80, 0x41, // 00088041
2409 0x00, 0x07, 0x55, 0x5C, // 0007555C
2410 0x00, 0x07, 0x14, 0x00, // 00071400
2411 0x00, 0x07, 0x5D, 0x04, // 00075D04
2412 0x00, 0x07, 0x1C, 0x00, // 00071C00
2413 0x00, 0x07, 0x65, 0x58, // 00076558
2414 0x00, 0x07, 0x24, 0x00, // 00072400
2415 0x00, 0x07, 0x6D, 0x14, // 00076D14
2416 0x00, 0x07, 0x2C, 0x00, // 00072C00
2417 0x00, 0x07, 0x94, 0x0F, // 0007940F
2418 0x00, 0x07, 0x9C, 0x0F, // 00079C0F
2419 0x00, 0x07, 0xA4, 0x0F, // 0007A40F
2420 0x00, 0x07, 0xAC, 0x0F, // 0007AC0F
2421 0x00, 0x06, 0x38, 0x3A, // 0006383A
2422 0x00, 0x0B, 0x76, 0x7D, // 000B767D
2423 0x00, 0x06, 0x10, 0x6C, // 0006106C
2424 0x00, 0x0A, 0xFF, 0x5F, // 000AFF5F
2425 0x00, 0x06, 0x84, 0x05, // 00068405
2426 0x00, 0x02, 0x9F, 0x18, // 00029F18
2427 0x00, 0x09, 0x3F, 0x54, // 00093F54
2428 0x00, 0x02, 0x86, 0x08, // 00028608
2429 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2430 0x00, 0x00, 0x00, 0x00, // 00000000
2431 0x00, 0x06, 0xB4, 0x15, // 0006B415
2432 0x00, 0x07, 0x77, 0xFC, // 000777FC
2433 0x00, 0x07, 0x34, 0x00, // 00073400
2434 0x00, 0x06, 0x00, 0x78, // 00060078
2435 0x00, 0x00, 0x00, 0x00, // 00000000
2436 0x00, 0x08, 0x80, 0x41, // 00088041
2437 0x00, 0x02, 0x9F, 0x08, // 00029F08
2438 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2439 0x00, 0x01, 0x4E, 0x80, // 00014E80
2440 0x00, 0x00, 0x00, 0x00, // 00000000
2441 0x00, 0x09, 0x80, 0x87, // 00098087
2442 0x00, 0x09, 0x88, 0x87, // 00098887
2443 0x00, 0x0C, 0x20, 0x12, // 000C2012
2444 0x00, 0x0E, 0x21, 0x12, // 000E2112
2445 0x00, 0x00, 0x00, 0x00, // 00000000
2446 0x00, 0x00, 0x00, 0x00, // 00000000
2447 0x00, 0x00, 0x00, 0x00, // 00000000
2448 0x00, 0x0C, 0x28, 0x12, // 000C2812
2449 0x00, 0x0E, 0x29, 0x12, // 000E2912
2450 0x00, 0x00, 0x00, 0x00, // 00000000
2451 0x00, 0x00, 0x00, 0x00, // 00000000
2452 0x00, 0x00, 0x00, 0x00, // 00000000
2453 0x00, 0x09, 0x84, 0x48, // 00098448
2454 0x00, 0x09, 0x8D, 0x48, // 00098D48
2455 0x00, 0x08, 0x92, 0x40, // 00089240
2456 0x00, 0x02, 0x9F, 0x20, // 00029F20
2457 0x00, 0x09, 0xA4, 0x48, // 0009A448
2458 0x00, 0x08, 0x04, 0x40, // 00080440
2459 0x00, 0x09, 0xAD, 0x48, // 0009AD48
2460 0x00, 0x08, 0x0D, 0x40, // 00080D40
2461 0x00, 0x0A, 0xE4, 0xC6, // 000AE4C6
2462 0x00, 0x0A, 0xC0, 0xC6, // 000AC0C6
2463 0x00, 0x0A, 0xED, 0xC6, // 000AEDC6
2464 0x00, 0x0A, 0xC9, 0xC6, // 000AC9C6
2465 0x00, 0x00, 0x00, 0x00, // 00000000
2466 0x00, 0x07, 0xE4, 0x0F, // 0007E40F
2467 0x00, 0x07, 0xC4, 0x0F, // 0007C40F
2468 0x00, 0x07, 0xEC, 0x0F, // 0007EC0F
2469 0x00, 0x07, 0xCC, 0x0F, // 0007CC0F
2470 0x00, 0x06, 0x00, 0x69, // 00060069
2471 0x00, 0x07, 0x4C, 0x01, // 00074C01
2472 0x00, 0x07, 0x0E, 0x65, // 00070E65
2473 0x00, 0x08, 0x00, 0x41, // 00080041
2474 0x00, 0x06, 0x1C, 0x64, // 00061C64
2475 0x00, 0x07, 0x54, 0x00, // 00075400
2476 0x00, 0x07, 0x14, 0x39, // 00071439
2477 0x00, 0x06, 0x88, 0x22, // 00068822
2478 0x00, 0x04, 0x0F, 0x00, // 00040F00
2479 0x00, 0x08, 0x90, 0xC2, // 000890C2
2480 0x00, 0x02, 0x9E, 0x28, // 00029E28
2481 0x00, 0x08, 0x9B, 0x40, // 00089B40
2482 0x00, 0x02, 0x9F, 0x08, // 00029F08
2483 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2484 0x00, 0x0B, 0x40, 0x40, // 000B4040
2485 0x00, 0x08, 0x09, 0x41, // 00080941
2486 0x00, 0x00, 0x00, 0x00, // 00000000
2487 0x00, 0x00, 0x00, 0x00, // 00000000
2488 0x00, 0x06, 0x80, 0x69, // 00068069
2489 0x00, 0x07, 0x88, 0x07, // 00078807
2490 0x00, 0x07, 0x4C, 0x01, // 00074C01
2491 0x00, 0x0B, 0x76, 0x75, // 000B7675
2492 0x00, 0x07, 0x0E, 0x01, // 00070E01
2493 0x00, 0x07, 0x44, 0x00, // 00074400
2494 0x00, 0x07, 0x04, 0x04, // 00070404
2495 0x00, 0x00, 0x00, 0x00, // 00000000
2496 0x00, 0x00, 0x00, 0x00, // 00000000
2497 0x00, 0x0B, 0x52, 0x40, // 000B5240
2498 0x00, 0x06, 0x80, 0x4B, // 0006804B
2499 0x00, 0x07, 0x44, 0x00, // 00074400
2500 0x00, 0x07, 0x05, 0x3D, // 0007053D
2501 0x00, 0x06, 0xB4, 0x15, // 0006B415
2502 0x00, 0x06, 0x8C, 0x2A, // 00068C2A
2503 0x00, 0x06, 0x94, 0x72, // 00069472
2504 0x00, 0x06, 0x80, 0x4B, // 0006804B
2505 0x00, 0x06, 0x00, 0x24, // 00060024
2506 0x00, 0x06, 0x08, 0x78, // 00060878
2507 0x00, 0x06, 0x18, 0x76, // 00061876
2508 0x00, 0x07, 0x54, 0x01, // 00075401
2509 0x00, 0x07, 0x16, 0x00, // 00071600
2510 0x00, 0x08, 0x89, 0x41, // 00088941
2511 0x00, 0x02, 0x9F, 0x08, // 00029F08
2512 0x00, 0x06, 0x00, 0x2C, // 0006002C
2513 0x00, 0x06, 0x08, 0x20, // 00060820
2514 0x00, 0x08, 0x80, 0xC1, // 000880C1
2515 0x00, 0x02, 0x86, 0x08, // 00028608
2516 0x00, 0x08, 0x00, 0xC2, // 000800C2
2517 0x00, 0x06, 0x0C, 0x26, // 00060C26
2518 0x00, 0x06, 0x14, 0x1C, // 0006141C
2519 0x00, 0x07, 0x5C, 0x01, // 00075C01
2520 0x00, 0x07, 0x1E, 0x00, // 00071E00
2521 0x00, 0x08, 0x89, 0xC2, // 000889C2
2522 0x00, 0x02, 0x86, 0x08, // 00028608
2523 0x00, 0x08, 0x09, 0xC3, // 000809C3
2524 0x00, 0x06, 0x24, 0x24, // 00062424
2525 0x00, 0x09, 0x22, 0xC4, // 000922C4
2526 0x00, 0x02, 0x86, 0x08, // 00028608
2527 0x00, 0x08, 0x24, 0xC3, // 000824C3
2528 0x00, 0x09, 0x29, 0xC4, // 000929C4
2529 0x00, 0x02, 0x86, 0x08, // 00028608
2530 0x00, 0x08, 0x0C, 0x40, // 00080C40
2531 0x00, 0x06, 0x24, 0x2E, // 0006242E
2532 0x00, 0x09, 0x22, 0xC4, // 000922C4
2533 0x00, 0x02, 0x86, 0x08, // 00028608
2534 0x00, 0x08, 0x24, 0xC3, // 000824C3
2535 0x00, 0x09, 0x29, 0xC4, // 000929C4
2536 0x00, 0x02, 0x86, 0x08, // 00028608
2537 0x00, 0x08, 0x0C, 0x40, // 00080C40
2538 0x00, 0x07, 0x54, 0x00, // 00075400
2539 0x00, 0x07, 0x14, 0x20, // 00071420
2540 0x00, 0x00, 0x00, 0x00, // 00000000
2541 0x00, 0x08, 0x80, 0xC2, // 000880C2
2542 0x00, 0x02, 0x86, 0x10, // 00028610
2543 0x00, 0x02, 0x1A, 0x86, // 00021A86
2544 0x00, 0x02, 0x81, 0x28, // 00028128
2545 0x00, 0x08, 0x89, 0xC2, // 000889C2
2546 0x00, 0x02, 0x86, 0x10, // 00028610
2547 0x00, 0x02, 0x1A, 0x86, // 00021A86
2548 0x00, 0x02, 0x81, 0x28, // 00028128
2549 0x00, 0x06, 0x28, 0x3A, // 0006283A
2550 0x00, 0x00, 0x00, 0x00, // 00000000
2551 0x00, 0x0A, 0xED, 0x5F, // 000AED5F
2552 0x00, 0x02, 0x9F, 0x18, // 00029F18
2553 0x00, 0x09, 0x2D, 0x54, // 00092D54
2554 0x00, 0x02, 0x86, 0x08, // 00028608
2555 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2556 0x00, 0x04, 0xB8, 0x0D, // 0004B80D
2557 0x00, 0x00, 0x00, 0x00, // 00000000
2558 0x00, 0x09, 0xBF, 0x7C, // 0009BF7C
2559 0x00, 0x06, 0x00, 0x78, // 00060078
2560 0x00, 0x00, 0x00, 0x00, // 00000000
2561 0x00, 0x08, 0x80, 0x41, // 00088041
2562 0x00, 0x02, 0x9F, 0x08, // 00029F08
2563 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2564 0x00, 0x01, 0x0D, 0x10, // 00010D10
2565 0x00, 0x06, 0x20, 0x76, // 00062076
2566 0x00, 0x09, 0x86, 0x8D, // 0009868D
2567 0x00, 0x09, 0x8E, 0x8D, // 00098E8D
2568 0x00, 0x08, 0xA4, 0x40, // 0008A440
2569 0x00, 0x02, 0x9F, 0x08, // 00029F08
2570 0x00, 0x08, 0x08, 0x40, // 00080840
2571 0x00, 0x0C, 0x31, 0x08, // 000C3108
2572 0x00, 0x0E, 0x31, 0x09, // 000E3109
2573 0x00, 0x00, 0x00, 0x00, // 00000000
2574 0x00, 0x00, 0x00, 0x00, // 00000000
2575 0x00, 0x0C, 0x01, 0x08, // 000C0108
2576 0x00, 0x0E, 0x01, 0x09, // 000E0109
2577 0x00, 0x00, 0x00, 0x00, // 00000000
2578 0x00, 0x00, 0x00, 0x00, // 00000000
2579 0x00, 0x00, 0x00, 0x00, // 00000000
2580 0x00, 0x0A, 0xF6, 0x7C, // 000AF67C
2581 0x00, 0x09, 0x9F, 0x7F, // 00099F7F
2582 0x00, 0x02, 0x82, 0x08, // 00028208
2583 0x00, 0x08, 0x36, 0x42, // 00083642
2584 0x00, 0x0A, 0xC0, 0x7C, // 000AC07C
2585 0x00, 0x09, 0xBF, 0x7F, // 0009BF7F
2586 0x00, 0x02, 0x82, 0x08, // 00028208
2587 0x00, 0x08, 0x00, 0x42, // 00080042
2588 0x00, 0x00, 0x00, 0x00, // 00000000
2589 0x00, 0x07, 0xF4, 0x0C, // 0007F40C
2590 0x00, 0x00, 0x00, 0x00, // 00000000
2591 0x00, 0x07, 0xC4, 0x0C, // 0007C40C
2592 0x00, 0x02, 0x16, 0x52, // 00021652
2593 0x00, 0x07, 0x4C, 0x06, // 00074C06
2594 0x00, 0x07, 0x0E, 0x56, // 00070E56
2595 0x00, 0x00, 0x00, 0x00, // 00000000
2596 0x00, 0x00, 0x00, 0x00, // 00000000
2597 0x00, 0x00, 0x00, 0x00, // 00000000
2598 0x00, 0x06, 0x88, 0x0F, // 0006880F
2599 0x00, 0x06, 0x00, 0x7B, // 0006007B
2600 0x00, 0x06, 0x10, 0x74, // 00061074
2601 0x00, 0x08, 0x00, 0x41, // 00080041
2602 0x00, 0x07, 0x5C, 0x00, // 00075C00
2603 0x00, 0x07, 0x1C, 0x30, // 00071C30
2604 0x00, 0x08, 0x92, 0x40, // 00089240
2605 0x00, 0x02, 0x9E, 0x18, // 00029E18
2606 0x00, 0x08, 0x88, 0xC3, // 000888C3
2607 0x00, 0x02, 0x9E, 0x08, // 00029E08
2608 0x00, 0x02, 0x15, 0xDB, // 000215DB
2609 0x00, 0x07, 0x4C, 0x06, // 00074C06
2610 0x00, 0x07, 0x0E, 0x66, // 00070E66
2611 0x00, 0x06, 0x80, 0x7B, // 0006807B
2612 0x00, 0x00, 0x00, 0x00, // 00000000
2613 0x00, 0x00, 0x00, 0x00, // 00000000
2614 0x00, 0x06, 0x88, 0x0E, // 0006880E
2615 0x00, 0x06, 0x00, 0x78, // 00060078
2616 0x00, 0x06, 0x08, 0x24, // 00060824
2617 0x00, 0x08, 0x80, 0x41, // 00088041
2618 0x00, 0x02, 0x9F, 0x08, // 00029F08
2619 0x00, 0x06, 0x08, 0x2C, // 0006082C
2620 0x00, 0x06, 0x34, 0x26, // 00063426
2621 0x00, 0x00, 0x00, 0x00, // 00000000
2622 0x00, 0x08, 0x86, 0xC1, // 000886C1
2623 0x00, 0x07, 0x5C, 0x00, // 00075C00
2624 0x00, 0x07, 0x1F, 0x00, // 00071F00
2625 0x00, 0x07, 0x54, 0x01, // 00075401
2626 0x00, 0x07, 0x16, 0x00, // 00071600
2627 0x00, 0x08, 0xA8, 0xC3, // 0008A8C3
2628 0x00, 0x02, 0x87, 0x08, // 00028708
2629 0x00, 0x08, 0x80, 0xC2, // 000880C2
2630 0x00, 0x06, 0x20, 0x74, // 00062074
2631 0x00, 0x08, 0x28, 0xC3, // 000828C3
2632 0x00, 0x02, 0x86, 0x08, // 00028608
2633 0x00, 0x08, 0x00, 0xC2, // 000800C2
2634 0x00, 0x06, 0x18, 0x79, // 00061879
2635 0x00, 0x06, 0x14, 0x6E, // 0006146E
2636 0x00, 0x08, 0xA4, 0x41, // 0008A441
2637 0x00, 0x02, 0x9E, 0x20, // 00029E20
2638 0x00, 0x08, 0xBB, 0x42, // 0008BB42
2639 0x00, 0x02, 0x9E, 0x10, // 00029E10
2640 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
2641 0x00, 0x08, 0x10, 0x40, // 00081040
2642 0x00, 0x00, 0x00, 0x00, // 00000000
2643 0x00, 0x00, 0x00, 0x00, // 00000000
2644 0x00, 0x06, 0x98, 0x79, // 00069879
2645 0x00, 0x06, 0x94, 0x6E, // 0006946E
2646 0x00, 0x00, 0x00, 0x00, // 00000000
2647 0x00, 0x06, 0x00, 0x78, // 00060078
2648 0x00, 0x06, 0x08, 0x24, // 00060824
2649 0x00, 0x08, 0x80, 0x41, // 00088041
2650 0x00, 0x02, 0x9F, 0x08, // 00029F08
2651 0x00, 0x06, 0x08, 0x2C, // 0006082C
2652 0x00, 0x06, 0x00, 0x1C, // 0006001C
2653 0x00, 0x07, 0x54, 0x01, // 00075401
2654 0x00, 0x07, 0x16, 0x00, // 00071600
2655 0x00, 0x06, 0x18, 0x71, // 00061871
2656 0x00, 0x00, 0x00, 0x00, // 00000000
2657 0x00, 0x06, 0x24, 0x6B, // 0006246B
2658 0x00, 0x08, 0xA9, 0xC0, // 0008A9C0
2659 0x00, 0x02, 0x86, 0x08, // 00028608
2660 0x00, 0x08, 0x2D, 0xC2, // 00082DC2
2661 0x00, 0x08, 0xB4, 0x41, // 0008B441
2662 0x00, 0x02, 0x9F, 0x10, // 00029F10
2663 0x00, 0x02, 0x1A, 0xA5, // 00021AA5
2664 0x00, 0x02, 0x81, 0x28, // 00028128
2665 0x00, 0x08, 0xB5, 0x42, // 0008B542
2666 0x00, 0x02, 0x86, 0x10, // 00028610
2667 0x00, 0x02, 0x1A, 0xA5, // 00021AA5
2668 0x00, 0x02, 0x81, 0x28, // 00028128
2669 0x00, 0x06, 0x34, 0x26, // 00063426
2670 0x00, 0x0A, 0xD1, 0x41, // 000AD141
2671 0x00, 0x0A, 0xF6, 0x7E, // 000AF67E
2672 0x00, 0x08, 0x12, 0xC6, // 000812C6
2673 0x00, 0x0B, 0x64, 0x40, // 000B6440
2674 0x00, 0x0A, 0xC2, 0x7E, // 000AC27E
2675 0x00, 0x00, 0x00, 0x00, // 00000000
2676 0x00, 0x00, 0x00, 0x00, // 00000000
2677 0x00, 0x06, 0xA4, 0x6B, // 0006A46B
2678 0x00, 0x07, 0x64, 0x00, // 00076400
2679 0x00, 0x07, 0x24, 0x25, // 00072425
2680 0x00, 0x08, 0x93, 0xC5, // 000893C5
2681 0x00, 0x06, 0xA8, 0x71, // 0006A871
2682 0x00, 0x08, 0x9C, 0xC2, // 00089CC2
2683 0x00, 0x02, 0x88, 0x10, // 00028810
2684 0x00, 0x02, 0x1B, 0x86, // 00021B86
2685 0x00, 0x02, 0x81, 0x28, // 00028128
2686 0x00, 0x06, 0x00, 0x78, // 00060078
2687 0x00, 0x06, 0x18, 0x52, // 00061852
2688 0x00, 0x07, 0x54, 0x08, // 00075408
2689 0x00, 0x07, 0x14, 0x00, // 00071400
2690 0x00, 0x07, 0x7C, 0x06, // 00077C06
2691 0x00, 0x07, 0x3E, 0xFD, // 00073EFD
2692 0x00, 0x08, 0x80, 0x41, // 00088041
2693 0x00, 0x02, 0x9F, 0x20, // 00029F20
2694 0x00, 0x0A, 0xC3, 0xC2, // 000AC3C2
2695 0x00, 0x02, 0x9E, 0x10, // 00029E10
2696 0x00, 0x02, 0x1B, 0xA7, // 00021BA7
2697 0x00, 0x02, 0x81, 0x28, // 00028128
2698 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
2699 0x00, 0x06, 0x34, 0x26, // 00063426
2700 0x00, 0x06, 0x3C, 0x1C, // 00063C1C
2701 0x00, 0x07, 0x54, 0x01, // 00075401
2702 0x00, 0x07, 0x16, 0x00, // 00071600
2703 0x00, 0x06, 0x18, 0x70, // 00061870
2704 0x00, 0x08, 0x86, 0xC7, // 000886C7
2705 0x00, 0x02, 0x86, 0x08, // 00028608
2706 0x00, 0x08, 0x00, 0xC2, // 000800C2
2707 0x00, 0x07, 0x64, 0x00, // 00076400
2708 0x00, 0x07, 0x24, 0x25, // 00072425
2709 0x00, 0x06, 0x28, 0x79, // 00062879
2710 0x00, 0x08, 0x93, 0xC0, // 000893C0
2711 0x00, 0x06, 0x80, 0x70, // 00068070
2712 0x00, 0x08, 0x94, 0xC2, // 000894C2
2713 0x00, 0x02, 0x88, 0x38, // 00028838
2714 0x00, 0x08, 0xBD, 0x41, // 0008BD41
2715 0x00, 0x02, 0x9E, 0x08, // 00029E08
2716 0x00, 0x09, 0xAD, 0x41, // 0009AD41
2717 0x00, 0x07, 0x7C, 0x06, // 00077C06
2718 0x00, 0x07, 0x3E, 0xFD, // 00073EFD
2719 0x00, 0x02, 0x1B, 0xB0, // 00021BB0
2720 0x00, 0x02, 0x81, 0x28, // 00028128
2721 0x00, 0x06, 0xA8, 0x79, // 0006A879
2722 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
2723 0x00, 0x06, 0x14, 0x26, // 00061426
2724 0x00, 0x06, 0x20, 0x7D, // 0006207D
2725 0x00, 0x06, 0x28, 0x7C, // 0006287C
2726 0x00, 0x08, 0x32, 0x60, // 00083260
2727 0x00, 0x02, 0x86, 0x18, // 00028618
2728 0x00, 0x08, 0x2D, 0xC4, // 00082DC4
2729 0x00, 0x0B, 0x64, 0x40, // 000B6440
2730 0x00, 0x02, 0x81, 0x08, // 00028108
2731 0x00, 0x0B, 0x64, 0x7F, // 000B647F
2732 0x00, 0x00, 0x00, 0x00, // 00000000
2733 0x00, 0x00, 0x00, 0x00, // 00000000
2734 0x00, 0x06, 0xA8, 0x7C, // 0006A87C
2735 0x00, 0x06, 0xA0, 0x7D, // 0006A07D
2736 0x00, 0x07, 0x7C, 0x00, // 00077C00
2737 0x00, 0x07, 0x3C, 0x01, // 00073C01
2738 0x00, 0x06, 0x00, 0x7C, // 0006007C
2739 0x00, 0x06, 0x30, 0x79, // 00063079
2740 0x00, 0x08, 0xBF, 0xC0, // 0008BFC0
2741 0x00, 0x02, 0x88, 0xC0, // 000288C0
2742 0x00, 0x08, 0xB6, 0x41, // 0008B641
2743 0x00, 0x02, 0x9E, 0xB0, // 00029EB0
2744 0x00, 0x0B, 0x40, 0x40, // 000B4040
2745 0x00, 0x08, 0xBA, 0xC1, // 0008BAC1
2746 0x00, 0x06, 0x34, 0x6E, // 0006346E
2747 0x00, 0x08, 0xBF, 0xC6, // 0008BFC6
2748 0x00, 0x07, 0x5C, 0x00, // 00075C00
2749 0x00, 0x07, 0x1F, 0x00, // 00071F00
2750 0x00, 0x07, 0x54, 0x01, // 00075401
2751 0x00, 0x07, 0x16, 0x00, // 00071600
2752 0x00, 0x08, 0xAF, 0xC3, // 0008AFC3
2753 0x00, 0x02, 0x87, 0x08, // 00028708
2754 0x00, 0x08, 0xBF, 0xC2, // 0008BFC2
2755 0x00, 0x08, 0x2F, 0xC3, // 00082FC3
2756 0x00, 0x02, 0x86, 0x08, // 00028608
2757 0x00, 0x08, 0x3F, 0xC2, // 00083FC2
2758 0x00, 0x00, 0x00, 0x00, // 00000000
2759 0x00, 0x02, 0x1C, 0x15, // 00021C15
2760 0x00, 0x07, 0x4C, 0x06, // 00074C06
2761 0x00, 0x07, 0x0E, 0xFD, // 00070EFD
2762 0x00, 0x00, 0x00, 0x00, // 00000000
2763 0x00, 0x00, 0x00, 0x00, // 00000000
2764 0x00, 0x06, 0x80, 0x7C, // 0006807C
2765 0x00, 0x06, 0x88, 0x0F, // 0006880F
2766 0x00, 0x00, 0x00, 0x00, // 00000000
2767 0x00, 0x06, 0x04, 0x64, // 00060464
2768 0x00, 0x06, 0x0C, 0x72, // 00060C72
2769 0x00, 0x06, 0x10, 0x74, // 00061074
2770 0x00, 0x08, 0x80, 0x40, // 00088040
2771 0x00, 0x02, 0x9F, 0x40, // 00029F40
2772 0x00, 0x08, 0x89, 0x40, // 00088940
2773 0x00, 0x02, 0x9F, 0x10, // 00029F10
2774 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2775 0x00, 0x02, 0x81, 0x28, // 00028128
2776 0x00, 0x08, 0x92, 0x40, // 00089240
2777 0x00, 0x02, 0x9E, 0x10, // 00029E10
2778 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2779 0x00, 0x02, 0x81, 0x28, // 00028128
2780 0x00, 0x07, 0x44, 0x01, // 00074401
2781 0x00, 0x07, 0x06, 0x61, // 00070661
2782 0x00, 0x07, 0x4C, 0x00, // 00074C00
2783 0x00, 0x07, 0x0C, 0x01, // 00070C01
2784 0x00, 0x00, 0x00, 0x00, // 00000000
2785 0x00, 0x06, 0x80, 0x22, // 00068022
2786 0x00, 0x04, 0x07, 0x00, // 00040700
2787 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
2788 0x00, 0x02, 0x9F, 0x10, // 00029F10
2789 0x00, 0x08, 0x80, 0x41, // 00088041
2790 0x00, 0x02, 0x81, 0x10, // 00028110
2791 0x00, 0x02, 0x1B, 0x68, // 00021B68
2792 0x00, 0x02, 0x81, 0x28, // 00028128
2793 0x00, 0x07, 0x80, 0x07, // 00078007
2794 0x00, 0x07, 0x44, 0x01, // 00074401
2795 0x00, 0x07, 0x06, 0x61, // 00070661
2796 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
2797 0x00, 0x07, 0x0C, 0x00, // 00070C00
2798 0x00, 0x06, 0x14, 0x64, // 00061464
2799 0x00, 0x06, 0x80, 0x22, // 00068022
2800 0x00, 0x0A, 0xC7, 0x81, // 000AC781
2801 0x00, 0x02, 0x9E, 0x08, // 00029E08
2802 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2803 0x00, 0x00, 0x00, 0x00, // 00000000
2804 0x00, 0x00, 0x00, 0x00, // 00000000
2805 0x00, 0x00, 0x00, 0x00, // 00000000
2806 0x00, 0x06, 0x94, 0x64, // 00069464
2807 0x00, 0x07, 0x44, 0x01, // 00074401
2808 0x00, 0x07, 0x06, 0x69, // 00070669
2809 0x00, 0x07, 0x4C, 0x00, // 00074C00
2810 0x00, 0x07, 0x0C, 0x02, // 00070C02
2811 0x00, 0x06, 0x10, 0x7A, // 0006107A
2812 0x00, 0x06, 0x20, 0x1C, // 0006201C
2813 0x00, 0x06, 0x80, 0x22, // 00068022
2814 0x00, 0x0A, 0xC3, 0x81, // 000AC381
2815 0x00, 0x02, 0x9F, 0x10, // 00029F10
2816 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2817 0x00, 0x02, 0x81, 0x48, // 00028148
2818 0x00, 0x08, 0x9A, 0x41, // 00089A41
2819 0x00, 0x02, 0x9E, 0x38, // 00029E38
2820 0x00, 0x06, 0x00, 0x78, // 00060078
2821 0x00, 0x06, 0x08, 0x24, // 00060824
2822 0x00, 0x08, 0x80, 0x41, // 00088041
2823 0x00, 0x02, 0x9F, 0x08, // 00029F08
2824 0x00, 0x06, 0x08, 0x2C, // 0006082C
2825 0x00, 0x0B, 0x52, 0x40, // 000B5240
2826 0x00, 0x0A, 0xE1, 0x7E, // 000AE17E
2827 0x00, 0x00, 0x00, 0x00, // 00000000
2828 0x00, 0x00, 0x00, 0x00, // 00000000
2829 0x00, 0x06, 0x90, 0x7A, // 0006907A
2830 0x00, 0x06, 0xA0, 0x1C, // 0006A01C
2831 0x00, 0x07, 0x44, 0x01, // 00074401
2832 0x00, 0x07, 0x06, 0x69, // 00070669
2833 0x00, 0x07, 0x4C, 0x00, // 00074C00
2834 0x00, 0x07, 0x0C, 0x01, // 00070C01
2835 0x00, 0x07, 0x44, 0x01, // 00074401
2836 0x00, 0x07, 0x06, 0x6C, // 0007066C
2837 0x00, 0x06, 0x80, 0x22, // 00068022
2838 0x00, 0x0A, 0xCF, 0x81, // 000ACF81
2839 0x00, 0x06, 0x18, 0x77, // 00061877
2840 0x00, 0x06, 0x80, 0x22, // 00068022
2841 0x00, 0x0B, 0x09, 0xC3, // 000B09C3
2842 0x00, 0x02, 0x9E, 0x10, // 00029E10
2843 0x00, 0x02, 0x1B, 0x68, // 00021B68
2844 0x00, 0x02, 0x81, 0x28, // 00028128
2845 0x00, 0x06, 0x24, 0x6B, // 0006246B
2846 0x00, 0x0B, 0x1B, 0x41, // 000B1B41
2847 0x00, 0x06, 0x14, 0x65, // 00061465
2848 0x00, 0x06, 0x04, 0x6A, // 0006046A
2849 0x00, 0x08, 0x28, 0x41, // 00082841
2850 0x00, 0x02, 0x9F, 0x08, // 00029F08
2851 0x00, 0x08, 0x82, 0xC0, // 000882C0
2852 0x00, 0x08, 0xA4, 0x40, // 0008A440
2853 0x00, 0x02, 0x9E, 0x10, // 00029E10
2854 0x00, 0x02, 0x1B, 0x66, // 00021B66
2855 0x00, 0x02, 0x81, 0x28, // 00028128
2856 0x00, 0x0B, 0x40, 0x41, // 000B4041
2857 0x00, 0x0B, 0x64, 0x40, // 000B6440
2858 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2859 0x00, 0x0B, 0x76, 0x40, // 000B7640
2860 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2861 0x00, 0x08, 0x9B, 0x40, // 00089B40
2862 0x00, 0x02, 0x9E, 0x28, // 00029E28
2863 0x00, 0x04, 0x27, 0x08, // 00042708
2864 0x00, 0x04, 0x2F, 0x08, // 00042F08
2865 0x00, 0x04, 0x37, 0x08, // 00043708
2866 0x00, 0x04, 0x3F, 0x08, // 00043F08
2867 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
2868 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
2869 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
2870 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
2871 0x00, 0x06, 0x98, 0x77, // 00069877
2872 0x00, 0x06, 0x84, 0x6A, // 0006846A
2873 0x00, 0x00, 0x00, 0x00, // 00000000
2874 0x00, 0x06, 0x00, 0x6D, // 0006006D
2875 0x00, 0x00, 0x00, 0x00, // 00000000
2876 0x00, 0x08, 0x80, 0x41, // 00088041
2877 0x00, 0x00, 0x00, 0x00, // 00000000
2878 0x00, 0x00, 0x00, 0x00, // 00000000
2879 0x00, 0x00, 0x00, 0x00, // 00000000
2880 0x00, 0x06, 0xC0, 0x6D, // 0006C06D
2881 0x00, 0x00, 0x00, 0x00, // 00000000
2882 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
2883 0x00, 0x07, 0x6C, 0x06, // 00076C06
2884 0x00, 0x07, 0x2F, 0x78, // 00072F78
2885 0x00, 0x00, 0x00, 0x00, // 00000000
2886 0x00, 0x00, 0x00, 0x00, // 00000000
2887 0x00, 0x00, 0x00, 0x00, // 00000000
2888 0x00, 0x00, 0x00, 0x00, // 00000000
2889 0x00, 0x02, 0x19, 0x5B, // 0002195B
2890 0x00, 0x02, 0x81, 0x28, // 00028128
2891 0x00, 0x00, 0x00, 0x00, // 00000000
2892 0x00, 0x00, 0x00, 0x00, // 00000000
2893 0x00, 0x00, 0x00, 0x00, // 00000000
2894 0x00, 0x00, 0x00, 0x00, // 00000000
2895 0x00, 0x00, 0x00, 0x00, // 00000000
2896 0x00, 0x00, 0xC1, 0x80, // 0000C180
2897 0x00, 0x00, 0x00, 0x00, // 00000000
2898 0x00, 0x00, 0x00, 0x00, // 00000000
2899 0x00, 0x00, 0x00, 0x00, // 00000000
2900 0x00, 0x00, 0x00, 0x00, // 00000000
2901 0x00, 0x00, 0x00, 0x00, // 00000000
2902 0x00, 0x00, 0x00, 0x00, // 00000000
2903 0x00, 0x06, 0x00, 0x1C, // 0006001C
2904 0x00, 0x07, 0x6C, 0x01, // 00076C01
2905 0x00, 0x07, 0x2E, 0x00, // 00072E00
2906 0x00, 0x07, 0x7C, 0x01, // 00077C01
2907 0x00, 0x07, 0x3E, 0x68, // 00073E68
2908 0x00, 0x0A, 0xF1, 0x7E, // 000AF17E
2909 0x00, 0x09, 0x00, 0xC6, // 000900C6
2910 0x00, 0x02, 0x88, 0x08, // 00028808
2911 0x00, 0x08, 0x00, 0xC5, // 000800C5
2912 0x00, 0x06, 0x2C, 0x64, // 00062C64
2913 0x00, 0x0A, 0x00, 0x7F, // 000A007F
2914 0x00, 0x06, 0x20, 0x7A, // 0006207A
2915 0x00, 0x06, 0xB8, 0x22, // 0006B822
2916 0x00, 0x04, 0x3F, 0x00, // 00043F00
2917 0x00, 0x08, 0xA4, 0x40, // 0008A440
2918 0x00, 0x02, 0x9E, 0x08, // 00029E08
2919 0x00, 0x08, 0x3F, 0xC0, // 00083FC0
2920 0x00, 0x08, 0xAD, 0x40, // 0008AD40
2921 0x00, 0x02, 0x9F, 0x10, // 00029F10
2922 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2923 0x00, 0x02, 0x81, 0x28, // 00028128
2924 0x00, 0x06, 0x2C, 0x7F, // 00062C7F
2925 0x00, 0x08, 0xA4, 0x40, // 0008A440
2926 0x00, 0x02, 0x9E, 0x08, // 00029E08
2927 0x00, 0x0B, 0x6D, 0x6F, // 000B6D6F
2928 0x00, 0x0B, 0x40, 0x7F, // 000B407F
2929 0x00, 0x02, 0x1A, 0xAD, // 00021AAD
2930 0x00, 0x06, 0xB0, 0x1C, // 0006B01C
2931 0x00, 0x0A, 0xFF, 0x7E, // 000AFF7E
2932 0x00, 0x00, 0x00, 0x00, // 00000000
2933 0x00, 0x06, 0x84, 0x72, // 00068472
2934 0x00, 0x06, 0xAC, 0x7F, // 0006AC7F
2935 0x00, 0x07, 0xB8, 0x07, // 0007B807
2936 0x00, 0x06, 0x10, 0x2C, // 0006102C
2937 0x00, 0x0B, 0x64, 0x6D, // 000B646D
2938 0x00, 0x0A, 0xD2, 0x7E, // 000AD27E
2939 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
2940 0x00, 0x00, 0x00, 0x00, // 00000000
2941 0x00, 0x02, 0x81, 0x20, // 00028120
2942 0x00, 0x06, 0x90, 0x1C, // 0006901C
2943 0x00, 0x06, 0x90, 0x20, // 00069020
2944 0x00, 0x06, 0x9C, 0x7B, // 00069C7B
2945 0x00, 0x0B, 0x64, 0x6E, // 000B646E
2946 0x00, 0x06, 0x34, 0x6D, // 0006346D
2947 0x00, 0x00, 0x00, 0x00, // 00000000
2948 0x00, 0x00, 0x00, 0x00, // 00000000
2949 0x00, 0x06, 0xA4, 0x7F, // 0006A47F
2950 0x00, 0x06, 0xB4, 0x0F, // 0006B40F
2951 0x00, 0x06, 0xB4, 0x6C, // 0006B46C
2952 0x00, 0x0B, 0x76, 0x7F, // 000B767F
2953 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2954 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2955 0x00, 0x08, 0x3F, 0x40, // 00083F40
2956 0x00, 0x0B, 0x40, 0x40, // 000B4040
2957 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2958 0x00, 0x06, 0xB4, 0x6B, // 0006B46B
2959 0x00, 0x04, 0xB0, 0x0D, // 0004B00D
2960 0x00, 0x00, 0x00, 0x00, // 00000000
2961 0x00, 0x09, 0xB6, 0x7C, // 0009B67C
2962 0x00, 0x01, 0x05, 0x10, // 00010510
2963 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
2964 0x00, 0x02, 0x82, 0x08, // 00028208
2965 0x00, 0x08, 0x00, 0x42, // 00080042
2966 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2967 0x00, 0x09, 0xB6, 0x7F, // 0009B67F
2968 0x00, 0x02, 0x82, 0x08, // 00028208
2969 0x00, 0x08, 0x3F, 0x42, // 00083F42
2970 0x00, 0x07, 0x84, 0x0C, // 0007840C
2971 0x00, 0x0B, 0x40, 0x40, // 000B4040
2972 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
2973 0x00, 0x07, 0xBC, 0x0C, // 0007BC0C
2974 0x00, 0x07, 0x64, 0x00, // 00076400
2975 0x00, 0x07, 0x24, 0x30, // 00072430
2976 0x00, 0x08, 0x2D, 0x41, // 00082D41
2977 0x00, 0x08, 0xA4, 0xC5, // 0008A4C5
2978 0x00, 0x02, 0x9F, 0x10, // 00029F10
2979 0x00, 0x02, 0x1B, 0xBE, // 00021BBE
2980 0x00, 0x02, 0x81, 0x28, // 00028128
2981 0x00, 0x07, 0x7C, 0x00, // 00077C00
2982 0x00, 0x07, 0x3F, 0x18, // 00073F18
2983 0x00, 0x06, 0x00, 0x78, // 00060078
2984 0x00, 0x06, 0x10, 0x24, // 00061024
2985 0x00, 0x08, 0x80, 0x41, // 00088041
2986 0x00, 0x00, 0x00, 0x00, // 00000000
2987 0x00, 0x02, 0x9F, 0x18, // 00029F18
2988 0x00, 0x07, 0x7C, 0x00, // 00077C00
2989 0x00, 0x07, 0x3C, 0x00, // 00073C00
2990 0x00, 0x06, 0x10, 0x2C, // 0006102C
2991 0x00, 0x00, 0x00, 0x00, // 00000000
2992 0x00, 0x0A, 0xD2, 0x7E, // 000AD27E
2993 0x00, 0x00, 0x00, 0x00, // 00000000
2994 0x00, 0x00, 0x00, 0x00, // 00000000
2995 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
2996 0x00, 0x06, 0x04, 0x64, // 00060464
2997 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2998 0x00, 0x08, 0x80, 0x41, // 00088041
2999 0x00, 0x00, 0xDE, 0x87, // 0000DE87
3000 0x00, 0x06, 0x90, 0x1C, // 0006901C
3001 0x00, 0x06, 0x90, 0x20, // 00069020
3002 0x00, 0x06, 0x9C, 0x62, // 00069C62
3003 0x00, 0x06, 0x9C, 0x6E, // 00069C6E
3004 0x00, 0x06, 0x9C, 0x63, // 00069C63
3005 0x00, 0x06, 0xAC, 0x7D, // 0006AC7D
3006 0x00, 0x00, 0x00, 0x00, // 00000000
3007 0x00, 0x06, 0x04, 0x73, // 00060473
3008 0x00, 0x07, 0x5C, 0x01, // 00075C01
3009 0x00, 0x07, 0x1E, 0x00, // 00071E00
3010 0x00, 0x08, 0x80, 0x41, // 00088041
3011 0x00, 0x02, 0x9E, 0x10, // 00029E10
3012 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
3013 0x00, 0x02, 0x81, 0x28, // 00028128
3014 0x00, 0x0B, 0x40, 0x7F, // 000B407F
3015 0x00, 0x08, 0x12, 0x42, // 00081242
3016 0x00, 0x09, 0x1B, 0xC2, // 00091BC2
3017 0x00, 0x02, 0x87, 0x08, // 00028708
3018 0x00, 0x08, 0x92, 0xC3, // 000892C3
3019 0x00, 0x06, 0x84, 0x73, // 00068473
3020 0x00, 0x07, 0x64, 0x00, // 00076400
3021 0x00, 0x07, 0x27, 0x00, // 00072700
3022 0x00, 0x07, 0x7C, 0x00, // 00077C00
3023 0x00, 0x07, 0x3C, 0x00, // 00073C00
3024 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
3025 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
3026 0x00, 0x06, 0xA4, 0x05, // 0006A405
3027 0x00, 0x01, 0x41, 0x80, // 00014180
3028 0x00, 0x06, 0xB8, 0x22, // 0006B822
3029 0x00, 0x07, 0x98, 0x0F, // 0007980F
3030 0x00, 0x00, 0x00, 0x00, // 00000000
3031 0x00, 0x07, 0x98, 0x0F, // 0007980F
3032 0x00, 0x00, 0xC1, 0x87, // 0000C187
3033 0x00, 0x06, 0x90, 0x1C, // 0006901C
3034 0x00, 0x06, 0x9C, 0x62, // 00069C62
3035 0x00, 0x00, 0x00, 0x00, // 00000000
3036 0x00, 0x06, 0x9C, 0x63, // 00069C63
3037 0x00, 0x06, 0x9C, 0x6E, // 00069C6E
3038 0x00, 0x06, 0xAC, 0x7D, // 0006AC7D
3039 0x00, 0x00, 0xC1, 0x07, // 0000C107
3040 0x00, 0x0B, 0x40, 0x40, // 000B4040
3041 0x00, 0x00, 0x00, 0x00, // 00000000
3042 0x00, 0x00, 0x00, 0x00, // 00000000
3043 0x00, 0x00, 0x00, 0x00, // 00000000
3044 0x00, 0x06, 0x84, 0x62, // 00068462
3045 0x00, 0x06, 0x84, 0x63, // 00068463
3046 0x00, 0x06, 0x04, 0x62, // 00060462
3047 0x00, 0x06, 0x1C, 0x63, // 00061C63
3048 0x00, 0x0A, 0x0F, 0x41, // 000A0F41
3049 0x00, 0x08, 0x97, 0xC0, // 000897C0
3050 0x00, 0x08, 0x1B, 0xC2, // 00081BC2
3051 0x00, 0x0A, 0x12, 0x47, // 000A1247
3052 0x00, 0x07, 0x65, 0x00, // 00076500
3053 0x00, 0x07, 0x24, 0x00, // 00072400
3054 0x00, 0x07, 0x6D, 0x00, // 00076D00
3055 0x00, 0x07, 0x2C, 0x00, // 00072C00
3056 0x00, 0x07, 0x75, 0x00, // 00077500
3057 0x00, 0x07, 0x34, 0x00, // 00073400
3058 0x00, 0x0C, 0x12, 0x25, // 000C1225
3059 0x00, 0x0E, 0x11, 0x24, // 000E1124
3060 0x00, 0x0E, 0x13, 0x26, // 000E1326
3061 0x00, 0x00, 0x00, 0x00, // 00000000
3062 0x00, 0x00, 0x00, 0x00, // 00000000
3063 0x00, 0x06, 0x04, 0x6C, // 0006046C
3064 0x00, 0x00, 0xC1, 0x07, // 0000C107
3065 0x00, 0x09, 0x12, 0xC0, // 000912C0
3066 0x00, 0x06, 0xBC, 0x62, // 0006BC62
3067 0x00, 0x06, 0x9C, 0x63, // 00069C63
3068 0x00, 0x00, 0x00, 0x00, // 00000000
3069 0x00, 0x06, 0x94, 0x6C, // 0006946C
3070 0x00, 0x06, 0x94, 0x0F, // 0006940F
3071 0x00, 0x03, 0x33, 0x33, // 00033333
3072 0x00, 0x00, 0x00, 0x00, // 00000000
3073 0x00, 0x00, 0x00, 0x00, // 00000000
3074 0x00, 0x00, 0x00, 0x00, // 00000000
3075 0x00, 0x00, 0x00, 0x00, // 00000000
3076 0x00, 0x00, 0x00, 0x00, // 00000000
3077 0x00, 0x00, 0x00, 0x00, // 00000000
3078};
3079
3080struct i2c_block {
3081 const unsigned char *data;
3082 unsigned len;
3083};
3084
3085static struct i2c_block maspcm[] = {
3086 { maspcm_array1, sizeof(maspcm_array1) },
3087 { maspcm_array2, sizeof(maspcm_array2) },
3088 { maspcm_array3, sizeof(maspcm_array3) },
3089 { maspcm_array4, sizeof(maspcm_array4) },
3090 { maspcm_array5, sizeof(maspcm_array5) },
3091 { maspcm_array6, sizeof(maspcm_array6) },
3092 { maspcm_array7, sizeof(maspcm_array7) },
3093 { maspcm_array8, sizeof(maspcm_array8) },
3094 { maspcm_array9, sizeof(maspcm_array9) },
3095 { maspcm_array10, sizeof(maspcm_array10) },
3096};
3097
3098/************ End of MAS pcm codec ************/
3099
3100#define WAVPLAY_QUIT BUTTON_OFF
3101
3102#define PCM_MAIN_IO_CONTROL 0x0661
3103#define PCM_IF_STATUS_CONTROL 0x0662
3104#define PCM_OFREQ_CONTROL 0x0663
3105#define PCM_OUTPUT_CLOCK_CONF 0x0664
3106#define PCM_FRAME_COUNTER 0x0665
3107#define PCM_APP_RUNNING 0x0666
3108#define PCM_SAMPLE_RATE_STATUS 0x0667
3109#define PCM_BUFFER_ERROR_COUNTER 0x0668
3110#define PCM_SOFT_MUTE 0x0669
3111#define PCM_SPDIF_CHANNEL_STATUS 0x066a
3112#define PCM_SAMPLE_RATE 0x066b
3113#define PCM_VOL_OUT_LL 0x066c
3114#define PCM_VOL_OUT_RL 0x066d
3115#define PCM_VOL_OUT_LR 0x066e
3116#define PCM_VOL_OUT_RR 0x066f
3117#define PCM_VOL_IN_LL 0x0670
3118#define PCM_VOL_IN_RL 0x0671
3119#define PCM_VOL_IN_LR 0x0672
3120#define PCM_VOL_IN_RR 0x0673
3121
3122#define IRQ3 (*((volatile unsigned long*)0x0900010C))
3123#define IRQ6 (*((volatile unsigned long*)0x09000118))
3124#define DEI3 (*((volatile unsigned long*)0x09000138))
3125
3126#define PLAY_OK 0
3127#define PLAY_ERROR -1
3128#define PLAY_GOT_USB 1
3129
3130#define LOW_WATER_CHUNKSIZE (256*1024)
3131
3132/* declarations */
3133
3134void start_demand_isr(void) __attribute__((interrupt_handler));
3135void stop_demand_isr(void) __attribute__((interrupt_handler));
3136void dma_end_isr(void) __attribute__((interrupt_handler));
3137
3138/* variables */
3139
3140static unsigned char *aud_buf;
3141static ssize_t aud_size;
3142static unsigned char *plug_buf;
3143
3144static void (*pcm_callback)(unsigned char**, int*) = NULL;
3145static bool playing = false;
3146static bool filling;
3147static int last_dma_chunksize;
3148static int aud_read = 0;
3149static int aud_write = 0;
3150static int low_water = (256*1024);
3151
3152/** i2c, MAS configuration **/
3153
3154void i2c_random_write(int addr, int cmd, const unsigned char* data, int size)
3155{
3156 plug_buf[0] = cmd;
3157 rb->memcpy(plug_buf+1, data, size);
3158
3159 rb->i2c_begin();
3160 rb->i2c_write(addr, plug_buf, size+1);
3161 rb->i2c_end();
3162}
3163
3164void mas_freeze(void)
3165{
3166 static const unsigned char freeze[] = { 0x00, 0x00 };
3167
3168 /* Freeze DSP */
3169 i2c_random_write(MAS_ADR, MAS_DATA_WRITE, freeze, sizeof(freeze));
3170 /* mas_run(0); in core implementation */
3171
3172 /* stop all internal transfers */
3173 rb->mas_writereg(0x3b, 0x00318); /* stopdma 1 */
3174 rb->mas_writereg(0x43, 0x00300); /* stopdma 2 */
3175 rb->mas_writereg(0x4b, 0); /* stopdma 3 */
3176 rb->mas_writereg(0x53, 0x00318); /* stopdma 4 */
3177 rb->mas_writereg(0x6b, 0); /* stopdma 5 */
3178 rb->mas_writereg(0xbb, 0x00318); /* stopdma 6 */
3179 rb->mas_writereg(0xc3, 0x00300); /* stopdma 7 */
3180 rb->mas_writereg(0x06, 0); /* stopdma 8 */
3181}
3182
3183void mas_download_pcm(void)
3184{
3185 static const unsigned char runi2s[] = { 0x10, 0x00 };
3186 unsigned i;
3187
3188 mas_freeze();
3189
3190 // Download program to MAS memory
3191 for ( i = 0; i < (sizeof(maspcm)/sizeof(struct i2c_block)); i++ )
3192 i2c_random_write(MAS_ADR, MAS_DATA_WRITE, maspcm[i].data, maspcm[i].len);
3193
3194 rb->mas_writereg(0x6b, 0xc0000); /* Reconfigure data to program memory */
3195
3196 /* Start execution at D0:1000 */
3197 i2c_random_write(MAS_ADR, MAS_DATA_WRITE, runi2s, sizeof(runi2s));
3198 /* mas_run(0x1000); in core implementation */
3199}
3200
3201void mas_restore(void)
3202{
3203 static const unsigned char resetdsp[] = { 0x88, 0x00 };
3204 static const unsigned char initdsp[] = { 0x8c, 0x00 };
3205 unsigned long val;
3206
3207 i2c_random_write(MAS_ADR, MAS_CONTROL, resetdsp, sizeof(resetdsp));
3208 /* mas_direct_config_write(MAS_CONTROL, 0x8d00); in core implementation */
3209 rb->sleep(1);
3210 i2c_random_write(MAS_ADR, MAS_CONTROL, initdsp, sizeof(initdsp));
3211 /* mas_direct_config_write(MAS_CONTROL, 0x8c00); in core implementation */
3212
3213 /* Stop the current application */
3214 val = 0;
3215 rb->mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
3216 do
3217 rb->mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
3218 while(val);
3219
3220#ifdef HAVE_SPDIF_OUT
3221 val = 0x0009; /* Disable SDO and SDI, low impedance S/PDIF outputs */
3222#else
3223 val = 0x002d; /* Disable SDO and SDI, disable S/PDIF output */
3224#endif
3225 rb->mas_writemem(MAS_BANK_D0, MAS_D0_INTERFACE_CONTROL, &val, 1);
3226
3227 val = 0x0025; /* Set Demand mode and validate all settings */
3228 rb->mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val, 1);
3229
3230 val = 0x000c; /* Start the Layer2/3 decoder applications */
3231 rb->mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
3232 do
3233 rb->mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
3234 while((val & 0x000c) != 0x000c);
3235}
3236
3237void pcm_channel_config(int channel_config, int stereo_width)
3238{
3239 /* default values: stereo */
3240 unsigned long val_ll = 0x80001;
3241 unsigned long val_lr = 0;
3242 unsigned long val_rl = 0;
3243 unsigned long val_rr = 0x80001;
3244
3245 switch(channel_config)
3246 {
3247 /* Note: cases are in different order that in firmware/sound.c
3248 * to work around a gcc bug (jumptable creation)! */
3249
3250 /* case SOUND_CHAN_STEREO unnecessary */
3251
3252 case SOUND_CHAN_MONO:
3253 val_ll = 0xc0001;
3254 val_lr = 0xc0001;
3255 val_rl = 0xc0001;
3256 val_rr = 0xc0001;
3257 break;
3258
3259 case SOUND_CHAN_MONO_LEFT:
3260 val_ll = 0x80001;
3261 val_lr = 0x80001;
3262 val_rl = 0;
3263 val_rr = 0;
3264 break;
3265
3266 case SOUND_CHAN_MONO_RIGHT:
3267 val_ll = 0;
3268 val_lr = 0;
3269 val_rl = 0x80001;
3270 val_rr = 0x80001;
3271 break;
3272
3273 case SOUND_CHAN_KARAOKE:
3274 val_ll = 0xc0001;
3275 val_lr = 0x3ffff;
3276 val_rl = 0x3ffff;
3277 val_rr = 0xc0001;
3278 break;
3279
3280 case SOUND_CHAN_CUSTOM:
3281 {
3282 /* fixed point variables (matching MAS internal format)
3283 integer part: upper 13 bits (inlcuding sign)
3284 fractional part: lower 19 bits */
3285 long fp_width, fp_straight, fp_cross;
3286
3287 fp_width = (stereo_width * 0x7ffff) / 100;
3288 if (stereo_width <= 100)
3289 {
3290 fp_straight = - (0x7ffff + fp_width) / 2;
3291 fp_cross = fp_straight + fp_width;
3292 }
3293 else
3294 {
3295 /* straight = - (1 + width) / (2 * width) */
3296 fp_straight = - (((0x7ffff + fp_width) / (fp_width >> 9)) << 9);
3297 fp_cross = 0x7ffff + fp_straight;
3298 }
3299 val_ll = val_rr = fp_straight & 0xfffff;
3300 val_lr = val_rl = fp_cross & 0xfffff;
3301 }
3302 break;
3303
3304 }
3305
3306 rb->mas_writemem(MAS_BANK_D0, PCM_VOL_OUT_LL, &val_ll, 1); /* LL */
3307 rb->mas_writemem(MAS_BANK_D0, PCM_VOL_OUT_LR, &val_lr, 1); /* LR */
3308 rb->mas_writemem(MAS_BANK_D0, PCM_VOL_OUT_RL, &val_rl, 1); /* RL */
3309 rb->mas_writemem(MAS_BANK_D0, PCM_VOL_OUT_RR, &val_rr, 1); /* RR */
3310}
3311
3312/** Basic playback system **/
3313
3314void start_demand_isr(void)
3315{
3316 ICR |= 0x0010; /* IRQ3 edge sensitive */
3317 or_b(0x80, &SCR0);
3318}
3319
3320void stop_demand_isr(void)
3321{
3322 and_b(~0x80, &SCR0);
3323}
3324
3325void dma_end_isr(void)
3326{
3327 unsigned char* start;
3328 int size = 0;
3329
3330 if (pcm_callback)
3331 pcm_callback(&start, &size);
3332
3333 if (size > 0)
3334 {
3335 DTCR3 = size;
3336 SAR3 = (unsigned int) start;
3337 }
3338 else
3339 {
3340 CHCR3 &= ~0x0001; /* Disable the DMA interrupt */
3341 playing = false;
3342 }
3343 CHCR3 &= ~0x0002; /* Clear DMA interrupt */
3344}
3345
3346void demand_irq_enable(bool on)
3347{
3348 int oldlevel = disable_irq_save();
3349
3350 if(on)
3351 {
3352 IPRA = (IPRA & 0xfff0) | 0x000b;
3353 ICR &= ~0x0010; /* IRQ3 level sensitive */
3354 }
3355 else
3356 {
3357 IPRA &= 0xfff0;
3358 }
3359
3360 restore_irq(oldlevel);
3361}
3362
3363static inline int available(void)
3364{
3365 int space = aud_write - aud_read;
3366 if (space < 0)
3367 space += aud_size;
3368
3369 return space;
3370}
3371
3372void pcm_get_more(unsigned char** start, int* size)
3373{
3374 int advance;
3375
3376 aud_read += last_dma_chunksize;
3377 if (aud_read >= aud_size)
3378 aud_read = 0;
3379
3380 advance = MIN(available(), aud_size - aud_read);
3381 advance = MIN(0x4000, advance);
3382
3383 *start = aud_buf + aud_read;
3384 *size = advance;
3385
3386 last_dma_chunksize = advance;
3387}
3388
3389void pcm_start(void)
3390{
3391 int advance;
3392
3393 advance = MIN(available(), aud_size - aud_read);
3394 advance = MIN(0x4000, advance);
3395
3396 if (!advance)
3397 return;
3398
3399 pcm_callback = pcm_get_more;
3400
3401 /* init DMA */
3402 DAR3 = 0x5FFFEC3;
3403 CHCR3 &= ~0x0002; /* Clear interrupt */
3404 CHCR3 = 0x1504; /* Single address destination, TXI0, IE=1 */
3405 DMAOR = 0x0001; /* Enable DMA */
3406
3407 SAR3 = (unsigned int)(aud_buf + aud_read);
3408 DTCR3 = advance;
3409 last_dma_chunksize = advance;
3410
3411 playing = true;
3412 demand_irq_enable(true);
3413 CHCR3 |= 0x0001; /* Enable DMA IRQ */
3414}
3415
3416void hijack_interrupts(bool on)
3417{
3418 static bool taken = false;
3419 static unsigned long orig_DEI3, orig_IRQ3, orig_IRQ6;
3420
3421 if (on && !taken)
3422 {
3423 orig_IRQ3 = IRQ3;
3424 IRQ3 = (unsigned long)start_demand_isr;
3425 orig_IRQ6 = IRQ6;
3426 IRQ6 = (unsigned long)stop_demand_isr;
3427 orig_DEI3 = DEI3;
3428 DEI3 = (unsigned long)dma_end_isr;
3429 }
3430 else if (!on && taken)
3431 {
3432 IRQ3 = orig_IRQ3;
3433 IRQ6 = orig_IRQ6;
3434 DEI3 = orig_DEI3;
3435 }
3436 taken = on;
3437}
3438
3439void cleanup(void *fd)
3440{
3441 demand_irq_enable(false);
3442 hijack_interrupts(false);
3443
3444 mas_restore();
3445 rb->sound_set(SOUND_CHANNELS, rb->global_settings->channel_config);
3446 rb->sound_set(SOUND_STEREO_WIDTH, rb->global_settings->stereo_width);
3447
3448 /* reconfigure SCI */
3449 while (!(SSR0 & SCI_TEND)); /* wait for end of transfer */
3450 BRR0 = 2; /* ~1 MBit/s */
3451
3452 rb->close(*(int*)fd);
3453}
3454
3455int play_file(char* filename)
3456{
3457 int button;
3458 int fd;
3459 int wanted, got;
3460 unsigned format, channels, samplerate, samplebits, bytes, time;
3461 unsigned rate = 0;
3462 unsigned long mas;
3463
3464 fd = rb->open(filename, O_RDONLY);
3465 if (fd < 0)
3466 {
3467 rb->splash(2*HZ, "Couldn't open WAV file");
3468 return PLAY_ERROR;
3469 }
3470
3471 /* Process WAV header */
3472 wanted = 44;
3473 got = rb->read(fd, aud_buf, wanted); /* wav header */
3474 if (got < 0)
3475 {
3476 rb->splash(2*HZ, "Read error");
3477 rb->close(fd);
3478 return PLAY_ERROR;
3479 }
3480 else if (got < wanted)
3481 {
3482 rb->splash(2*HZ, "File too short");
3483 rb->close(fd);
3484 return PLAY_ERROR;
3485 }
3486
3487 if (rb->memcmp(aud_buf, "RIFF", 4)
3488 || rb->memcmp(aud_buf + 8, "WAVE", 4)
3489 || rb->memcmp(aud_buf + 12, "fmt ", 4)
3490 || rb->memcmp(aud_buf + 36, "data", 4))
3491 {
3492 rb->splash(2*HZ, "No canonical WAV file");
3493 rb->close(fd);
3494 return PLAY_ERROR;
3495 }
3496
3497 format = letoh16(*(uint16_t *)(aud_buf + 20));
3498 if (format != 1)
3499 {
3500 rb->splashf(2*HZ, "Unsupported format: %d", format);
3501 rb->close(fd);
3502 return PLAY_ERROR;
3503 }
3504
3505 channels = letoh16(*(uint16_t *)(aud_buf + 22));
3506 if (channels > 2)
3507 {
3508 rb->splashf(2*HZ, "Too many channels: %d", channels);
3509 rb->close(fd);
3510 return PLAY_ERROR;
3511 }
3512
3513 samplebits = letoh16(*(uint16_t *)(aud_buf + 34));
3514 if (samplebits != 16)
3515 {
3516 rb->splashf(2*HZ, "Unsupported sample depth: %dbit", samplebits);
3517 rb->close(fd);
3518 return PLAY_ERROR;
3519 }
3520
3521 samplerate = letoh32(*(uint32_t *)(aud_buf + 24));
3522 switch (samplerate)
3523 {
3524 case 8000: rate = 0; break;
3525 case 11025: rate = 1; break;
3526 case 12000: rate = 2; break;
3527 case 16000: rate = 4; break;
3528 case 22050: rate = 5; break;
3529 case 24000: rate = 6; break;
3530 case 32000: rate = 8; break;
3531 case 44100: rate = 9; break;
3532 case 48000: rate = 10; break;
3533 default:
3534 rb->splashf(2*HZ, "Unsupported samplerate: %dHz", samplerate);
3535 rb->close(fd);
3536 return PLAY_ERROR;
3537 }
3538 bytes = letoh32(*(uint32_t *)(aud_buf + 40));
3539 time = bytes / (samplerate * 2 * channels);
3540
3541 rb->lcd_puts(0, 0, "Playing WAV file");
3542 rb->lcd_putsf(0, 1, "%dHz %s", samplerate,
3543 (channels == 1) ? "mono" : "stereo");
3544 rb->lcd_putsf(0, 2, "Length: %d:%02d", time / 60, time % 60);
3545 rb->lcd_update();
3546
3547 rb->sound_set_pitch(PITCH_SPEED_100); /* reset pitch */
3548 mas_download_pcm(); /* Download PCM codec */
3549
3550 /* Configure PCM codec */
3551 pcm_channel_config(rb->global_settings->channel_config,
3552 rb->global_settings->stereo_width);
3553#ifdef HAVE_SPDIF_OUT
3554 mas = 0x0009; /* Disable SDO and SDI, low impedance S/PDIF outputs */
3555#else
3556 mas = 0x002d; /* Disable SDO and SDI, disable S/PDIF output */
3557#endif
3558 rb->mas_writemem(MAS_BANK_D0, PCM_IF_STATUS_CONTROL, &mas, 1);
3559
3560 mas = 0x0060 /* no framing, little endian */
3561 | ((channels == 1) ? 0x10 : 0) /* mono or stereo */
3562 | rate; /* bitrate */
3563 rb->mas_writemem(MAS_BANK_D0, PCM_SAMPLE_RATE, &mas, 1);
3564
3565 mas = 0x1025; /* playback, SIBC clock invert, validate */
3566 rb->mas_writemem(MAS_BANK_D0, PCM_MAIN_IO_CONTROL, &mas, 1);
3567
3568 /* configure SCI */
3569 while (!(SSR0 & SCI_TEND)); /* wait for end of transfer */
3570 BRR0 = 0; /* maximum speed, ~3 MBit/s */
3571
3572#if !(CONFIG_STORAGE & STORAGE_MMC)
3573 low_water = 5 /* seconds */
3574 * 2 /* bytes per sample */
3575 * channels
3576 * samplerate;
3577#endif
3578
3579 hijack_interrupts(true);
3580 filling = true;
3581
3582 /* Playback loop */
3583 while (filling || playing)
3584 {
3585 if (filling)
3586 {
3587 int free_space = aud_read - aud_write;
3588
3589 if (free_space <= 0)
3590 free_space += aud_size;
3591 free_space -= 2;
3592
3593 if (free_space <= 0)
3594 {
3595 filling = false;
3596 rb->storage_sleep();
3597 }
3598 else
3599 {
3600 wanted = MIN(free_space, aud_size - aud_write);
3601#if (CONFIG_STORAGE & STORAGE_MMC)
3602 wanted = MIN(wanted, 256*1024);
3603#elif MEMORYSIZE == 8
3604 wanted = MIN(wanted, 1024*1024);
3605#endif
3606 if (available() < low_water)
3607 wanted = MIN(wanted, LOW_WATER_CHUNKSIZE);
3608
3609 got = rb->read(fd, aud_buf + aud_write, wanted);
3610
3611 if (got > 0)
3612 {
3613 rb->bitswap(aud_buf + aud_write, got);
3614
3615 aud_write += got;
3616 if (aud_write >= aud_size)
3617 aud_write = 0;
3618 }
3619 else /* end of file */
3620 {
3621 filling = false;
3622 }
3623
3624 if (((available() >= low_water) || !filling) && !playing)
3625 pcm_start();
3626 }
3627 button = rb->button_get(false);
3628 }
3629 else
3630 {
3631 button = rb->button_get_w_tmo(HZ/2);
3632 if ((available() < low_water) && (got > 0))
3633 filling = true;
3634 }
3635 if (button == WAVPLAY_QUIT)
3636 break;
3637 else if (rb->default_event_handler_ex(button, cleanup, &fd) == SYS_USB_CONNECTED)
3638 return PLAY_GOT_USB;
3639
3640
3641 }
3642 cleanup(&fd);
3643 return PLAY_OK;
3644}
3645
3646/* plugin entry point */
3647enum plugin_status plugin_start(const void* parameter)
3648{
3649 size_t buf_size;
3650
3651 if (!parameter)
3652 {
3653 rb->splash(HZ, "Play WAV file!");
3654 return PLUGIN_OK;
3655 }
3656
3657 plug_buf = rb->plugin_get_buffer(&buf_size);
3658 if (buf_size < 6700) /* needed for i2c transfer */
3659 {
3660 rb->splash(HZ, "Out of memory.");
3661 return PLUGIN_ERROR;
3662 }
3663
3664 aud_buf = rb->plugin_get_audio_buffer(&buf_size);
3665 aud_size = buf_size;
3666
3667 switch (play_file((char*)parameter))
3668 {
3669 case PLAY_OK:
3670 return PLUGIN_OK;
3671 case PLAY_GOT_USB:
3672 return PLUGIN_USB_CONNECTED;
3673 default:
3674 return PLUGIN_ERROR;
3675 }
3676}
diff --git a/apps/plugins/wavrecord.c b/apps/plugins/wavrecord.c
deleted file mode 100644
index 23751be041..0000000000
--- a/apps/plugins/wavrecord.c
+++ /dev/null
@@ -1,3811 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "plugin.h"
22#include "lib/configfile.h"
23
24
25
26/************ Start of MAS pcm codec, raw i2c blocks ************/
27
28// address 04640 count 30 (126 bytes)
29static const unsigned char maspcm_array1[] = {
30 0xe0, 0x00, 0x00, 0x1e, 0x06, 0x40,
31 0x00, 0x08, 0x00, 0x00, // 00080000
32 0x00, 0x00, 0x00, 0x00, // 00000000
33 0x00, 0x00, 0x00, 0x00, // 00000000
34 0x00, 0x08, 0x00, 0x00, // 00080000
35 0x00, 0x00, 0x00, 0x25, // 00000025
36 0x00, 0x00, 0x00, 0x04, // 00000004
37 0x00, 0x00, 0x48, 0x00, // 00004800
38 0x00, 0x08, 0x00, 0x00, // 00080000
39 0x00, 0x00, 0x00, 0x00, // 00000000
40 0x00, 0x00, 0x00, 0x00, // 00000000
41 0x00, 0x00, 0xFF, 0xFF, // 0000FFFF
42 0x00, 0x00, 0x00, 0x00, // 00000000
43 0x00, 0x00, 0x00, 0x00, // 00000000
44 0x00, 0x00, 0x82, 0x00, // 00008200
45 0x00, 0x00, 0x00, 0x0A, // 0000000A
46 0x00, 0x08, 0x00, 0x00, // 00080000
47 0x00, 0x00, 0x00, 0x00, // 00000000
48 0x00, 0x00, 0x00, 0x00, // 00000000
49 0x00, 0x08, 0x00, 0x00, // 00080000
50 0x00, 0x08, 0x00, 0x00, // 00080000
51 0x00, 0x00, 0x00, 0x00, // 00000000
52 0x00, 0x00, 0x00, 0x00, // 00000000
53 0x00, 0x08, 0x00, 0x00, // 00080000
54 0x00, 0x00, 0x03, 0x18, // 00000318
55 0x00, 0x00, 0x03, 0x18, // 00000318
56 0x00, 0x00, 0x03, 0x00, // 00000300
57 0x00, 0x00, 0x03, 0x00, // 00000300
58 0x00, 0x00, 0x03, 0x18, // 00000318
59 0x00, 0x00, 0x00, 0x00, // 00000000
60 0x00, 0x00, 0x03, 0x00, // 00000300
61};
62// address 04674 count 81 (330 bytes)
63static const unsigned char maspcm_array2[] = {
64 0xe0, 0x00, 0x00, 0x51, 0x06, 0x74,
65 0x00, 0x00, 0x60, 0x00, // 00006000
66 0x00, 0x00, 0x00, 0x02, // 00000002
67 0x00, 0x00, 0x00, 0x60, // 00000060
68 0x00, 0x00, 0x00, 0x60, // 00000060
69 0x00, 0x00, 0x03, 0x00, // 00000300
70 0x00, 0x00, 0xC0, 0x00, // 0000C000
71 0x00, 0x00, 0x00, 0x14, // 00000014
72 0x00, 0x00, 0x00, 0x1E, // 0000001E
73 0x00, 0x00, 0x42, 0x11, // 00004211
74 0x00, 0x00, 0x58, 0x33, // 00005833
75 0x00, 0x00, 0x00, 0x02, // 00000002
76 0x00, 0x00, 0x00, 0x40, // 00000040
77 0x00, 0x00, 0x00, 0x40, // 00000040
78 0x00, 0x00, 0x00, 0x00, // 00000000
79 0x00, 0x01, 0x20, 0x01, // 00012001
80 0x00, 0x00, 0x00, 0x14, // 00000014
81 0x00, 0x00, 0x00, 0x29, // 00000029
82 0x00, 0x00, 0x30, 0xC3, // 000030C3
83 0x00, 0x00, 0x60, 0x00, // 00006000
84 0x00, 0x00, 0x00, 0x02, // 00000002
85 0x00, 0x00, 0x00, 0x40, // 00000040
86 0x00, 0x00, 0x00, 0x40, // 00000040
87 0x00, 0x00, 0x02, 0x00, // 00000200
88 0x00, 0x01, 0x20, 0x00, // 00012000
89 0x00, 0x00, 0x00, 0x14, // 00000014
90 0x00, 0x00, 0x00, 0x2D, // 0000002D
91 0x00, 0x00, 0x2C, 0x86, // 00002C86
92 0x00, 0x00, 0x60, 0x00, // 00006000
93 0x00, 0x00, 0x00, 0x01, // 00000001
94 0x00, 0x00, 0x00, 0x30, // 00000030
95 0x00, 0x00, 0x00, 0x30, // 00000030
96 0x00, 0x00, 0x03, 0x00, // 00000300
97 0x00, 0x01, 0x80, 0x00, // 00018000
98 0x00, 0x00, 0x00, 0x14, // 00000014
99 0x00, 0x00, 0x00, 0x3C, // 0000003C
100 0x00, 0x00, 0x21, 0x93, // 00002193
101 0x00, 0x00, 0x58, 0x33, // 00005833
102 0x00, 0x00, 0x00, 0x01, // 00000001
103 0x00, 0x00, 0x00, 0x20, // 00000020
104 0x00, 0x00, 0x00, 0x20, // 00000020
105 0x00, 0x00, 0x00, 0x00, // 00000000
106 0x00, 0x02, 0x40, 0x01, // 00024001
107 0x00, 0x00, 0x00, 0x14, // 00000014
108 0x00, 0x00, 0x00, 0x52, // 00000052
109 0x00, 0x00, 0x18, 0xAD, // 000018AD
110 0x00, 0x00, 0x60, 0x00, // 00006000
111 0x00, 0x00, 0x00, 0x01, // 00000001
112 0x00, 0x00, 0x00, 0x20, // 00000020
113 0x00, 0x00, 0x00, 0x20, // 00000020
114 0x00, 0x00, 0x02, 0x00, // 00000200
115 0x00, 0x02, 0x40, 0x00, // 00024000
116 0x00, 0x00, 0x00, 0x14, // 00000014
117 0x00, 0x00, 0x00, 0x5A, // 0000005A
118 0x00, 0x00, 0x16, 0x81, // 00001681
119 0x00, 0x00, 0x60, 0x00, // 00006000
120 0x00, 0x00, 0x00, 0x00, // 00000000
121 0x00, 0x00, 0x00, 0x18, // 00000018
122 0x00, 0x00, 0x00, 0x18, // 00000018
123 0x00, 0x00, 0x03, 0x00, // 00000300
124 0x00, 0x03, 0x00, 0x00, // 00030000
125 0x00, 0x00, 0x00, 0x14, // 00000014
126 0x00, 0x00, 0x00, 0x78, // 00000078
127 0x00, 0x00, 0x10, 0xED, // 000010ED
128 0x00, 0x00, 0x58, 0x33, // 00005833
129 0x00, 0x00, 0x00, 0x00, // 00000000
130 0x00, 0x00, 0x00, 0x10, // 00000010
131 0x00, 0x00, 0x00, 0x10, // 00000010
132 0x00, 0x00, 0x00, 0x00, // 00000000
133 0x00, 0x04, 0x80, 0x03, // 00048003
134 0x00, 0x00, 0x00, 0x14, // 00000014
135 0x00, 0x00, 0x00, 0xA5, // 000000A5
136 0x00, 0x00, 0x0C, 0x56, // 00000C56
137 0x00, 0x00, 0x60, 0x00, // 00006000
138 0x00, 0x00, 0x00, 0x00, // 00000000
139 0x00, 0x00, 0x00, 0x10, // 00000010
140 0x00, 0x00, 0x00, 0x10, // 00000010
141 0x00, 0x00, 0x02, 0x00, // 00000200
142 0x00, 0x04, 0x80, 0x00, // 00048000
143 0x00, 0x00, 0x00, 0x14, // 00000014
144 0x00, 0x00, 0x00, 0xB4, // 000000B4
145 0x00, 0x00, 0x0B, 0x51, // 00000B51
146};
147// address 04661 count 19 (82 bytes)
148static const unsigned char maspcm_array3[] = {
149 0xe0, 0x00, 0x00, 0x13, 0x06, 0x61,
150 0x00, 0x00, 0x01, 0x25, // 00000125
151 0x00, 0x00, 0x00, 0x05, // 00000005
152 0x00, 0x00, 0x48, 0x00, // 00004800
153 0x00, 0x08, 0x00, 0x00, // 00080000
154 0x00, 0x00, 0x00, 0x00, // 00000000
155 0x00, 0x00, 0x00, 0x00, // 00000000
156 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
157 0x00, 0x00, 0x00, 0x00, // 00000000
158 0x00, 0x00, 0x00, 0x00, // 00000000
159 0x00, 0x00, 0x82, 0x00, // 00008200
160 0x00, 0x00, 0x00, 0x00, // 00000000
161 0x00, 0x08, 0x00, 0x00, // 00080000
162 0x00, 0x00, 0x00, 0x00, // 00000000
163 0x00, 0x00, 0x00, 0x00, // 00000000
164 0x00, 0x08, 0x00, 0x00, // 00080000
165 0x00, 0x08, 0x00, 0x00, // 00080000
166 0x00, 0x00, 0x00, 0x00, // 00000000
167 0x00, 0x00, 0x00, 0x00, // 00000000
168 0x00, 0x08, 0x00, 0x00, // 00080000
169};
170// address 046E4 count 16 (70 bytes)
171static const unsigned char maspcm_array4[] = {
172 0xe0, 0x00, 0x00, 0x10, 0x06, 0xe4,
173 0x00, 0x00, 0x06, 0x74, // 00000674
174 0x00, 0x00, 0x06, 0x7D, // 0000067D
175 0x00, 0x00, 0x06, 0x86, // 00000686
176 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
177 0x00, 0x00, 0x06, 0x8F, // 0000068F
178 0x00, 0x00, 0x06, 0x98, // 00000698
179 0x00, 0x00, 0x06, 0xA1, // 000006A1
180 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
181 0x00, 0x00, 0x06, 0xAA, // 000006AA
182 0x00, 0x00, 0x06, 0xB3, // 000006B3
183 0x00, 0x00, 0x06, 0xBC, // 000006BC
184 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
185 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
186 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
187 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
188 0x00, 0x0F, 0xFF, 0xFF, // 000FFFFF
189};
190// address 04700 count 18 (78 byte)
191static const unsigned char maspcm_array5[] = {
192 0xe0, 0x00, 0x00, 0x12, 0x07, 0x00,
193 0x00, 0x00, 0x06, 0xBC, // 000006BC
194 0x00, 0x00, 0x00, 0x0A, // 0000000A
195 0x00, 0x00, 0x06, 0x74, // 00000674
196 0x00, 0x00, 0x00, 0x00, // 00000000
197 0x00, 0x00, 0x06, 0x7D, // 0000067D
198 0x00, 0x00, 0x00, 0x01, // 00000001
199 0x00, 0x00, 0x06, 0x86, // 00000686
200 0x00, 0x00, 0x00, 0x02, // 00000002
201 0x00, 0x00, 0x06, 0x8F, // 0000068F
202 0x00, 0x00, 0x00, 0x04, // 00000004
203 0x00, 0x00, 0x06, 0x98, // 00000698
204 0x00, 0x00, 0x00, 0x05, // 00000005
205 0x00, 0x00, 0x06, 0xA1, // 000006A1
206 0x00, 0x00, 0x00, 0x06, // 00000006
207 0x00, 0x00, 0x06, 0xAA, // 000006AA
208 0x00, 0x00, 0x00, 0x08, // 00000008
209 0x00, 0x00, 0x06, 0xB3, // 000006B3
210 0x00, 0x00, 0x00, 0x09, // 00000009
211};
212// address 06600 count 63 (258 bytes)
213static const unsigned char maspcm_array6[] = {
214 0xf0, 0x00, 0x00, 0x3f, 0x06, 0x00,
215 0x00, 0x00, 0x0B, 0xAD, // 00000BAD
216 0x00, 0x00, 0x10, 0x00, // 00001000
217 0x00, 0x00, 0x20, 0x00, // 00002000
218 0x00, 0x00, 0x30, 0x00, // 00003000
219 0x00, 0x00, 0x40, 0x00, // 00004000
220 0x00, 0x00, 0x50, 0x00, // 00005000
221 0x00, 0x00, 0x60, 0x00, // 00006000
222 0x00, 0x00, 0x70, 0x00, // 00007000
223 0x00, 0x00, 0x80, 0x00, // 00008000
224 0x00, 0x00, 0x90, 0x00, // 00009000
225 0x00, 0x00, 0xA0, 0x00, // 0000A000
226 0x00, 0x00, 0xB0, 0x00, // 0000B000
227 0x00, 0x00, 0xC0, 0x00, // 0000C000
228 0x00, 0x00, 0xD0, 0x00, // 0000D000
229 0x00, 0x00, 0xE0, 0x00, // 0000E000
230 0x00, 0x00, 0xF0, 0x00, // 0000F000
231 0x00, 0x01, 0x00, 0x00, // 00010000
232 0x00, 0x01, 0x10, 0x00, // 00011000
233 0x00, 0x01, 0x20, 0x00, // 00012000
234 0x00, 0x01, 0x30, 0x00, // 00013000
235 0x00, 0x01, 0x40, 0x00, // 00014000
236 0x00, 0x01, 0x50, 0x00, // 00015000
237 0x00, 0x01, 0x60, 0x00, // 00016000
238 0x00, 0x01, 0x70, 0x00, // 00017000
239 0x00, 0x01, 0x80, 0x00, // 00018000
240 0x00, 0x01, 0x90, 0x00, // 00019000
241 0x00, 0x01, 0xA0, 0x00, // 0001A000
242 0x00, 0x01, 0xB0, 0x00, // 0001B000
243 0x00, 0x01, 0xC0, 0x00, // 0001C000
244 0x00, 0x01, 0xD0, 0x00, // 0001D000
245 0x00, 0x01, 0xE0, 0x00, // 0001E000
246 0x00, 0x01, 0xF0, 0x00, // 0001F000
247 0x00, 0x02, 0x00, 0x00, // 00020000
248 0x00, 0x02, 0x10, 0x00, // 00021000
249 0x00, 0x02, 0x20, 0x00, // 00022000
250 0x00, 0x02, 0x30, 0x00, // 00023000
251 0x00, 0x02, 0x40, 0x00, // 00024000
252 0x00, 0x00, 0x05, 0xFF, // 000005FF
253 0x00, 0x00, 0x00, 0x00, // 00000000
254 0x00, 0x00, 0x00, 0x00, // 00000000
255 0x00, 0x00, 0x00, 0x00, // 00000000
256 0x00, 0x00, 0x00, 0x90, // 00000090
257 0x00, 0x00, 0x00, 0x90, // 00000090
258 0x00, 0x00, 0x00, 0x90, // 00000090
259 0x00, 0x00, 0x00, 0x20, // 00000020
260 0x00, 0x00, 0x03, 0x00, // 00000300
261 0x00, 0x00, 0x00, 0x20, // 00000020
262 0x00, 0x00, 0x03, 0x00, // 00000300
263 0x00, 0x00, 0x00, 0x20, // 00000020
264 0x00, 0x00, 0x03, 0x00, // 00000300
265 0x00, 0x00, 0x05, 0xFF, // 000005FF
266 0x00, 0x00, 0x00, 0x00, // 00000000
267 0x00, 0x00, 0x00, 0x00, // 00000000
268 0x00, 0x00, 0x00, 0x00, // 00000000
269 0x00, 0x00, 0x00, 0x90, // 00000090
270 0x00, 0x00, 0x00, 0x90, // 00000090
271 0x00, 0x00, 0x00, 0x90, // 00000090
272 0x00, 0x00, 0x00, 0x00, // 00000000
273 0x00, 0x00, 0x00, 0x00, // 00000000
274 0x00, 0x00, 0x00, 0x00, // 00000000
275 0x00, 0x00, 0x00, 0x00, // 00000000
276 0x00, 0x00, 0x00, 0x00, // 00000000
277 0x00, 0x00, 0x00, 0x0C, // 0000000C
278};
279// address 06640 count 12 (54 bytes)
280static const unsigned char maspcm_array7[] = {
281 0xf0, 0x00, 0x00, 0x0c, 0x06, 0x40,
282 0x00, 0x00, 0x00, 0x00, // 00000000
283 0x00, 0x00, 0x00, 0x00, // 00000000
284 0x00, 0x00, 0x00, 0x00, // 00000000
285 0x00, 0x00, 0x00, 0x00, // 00000000
286 0x00, 0x00, 0x00, 0x00, // 00000000
287 0x00, 0x00, 0x00, 0x00, // 00000000
288 0x00, 0x00, 0x00, 0x00, // 00000000
289 0x00, 0x00, 0x00, 0x00, // 00000000
290 0x00, 0x00, 0x00, 0x00, // 00000000
291 0x00, 0x00, 0x00, 0x00, // 00000000
292 0x00, 0x00, 0x00, 0x00, // 00000000
293 0x00, 0x00, 0x00, 0x00, // 00000000
294};
295// address 06660 count 28 (118 bytes)
296static const unsigned char maspcm_array8[] = {
297 0xf0, 0x00, 0x00, 0x1c, 0x06, 0x60,
298 0x00, 0x00, 0x00, 0x00, // 00000000
299 0x00, 0x00, 0x00, 0x00, // 00000000
300 0x00, 0x00, 0x00, 0x00, // 00000000
301 0x00, 0x00, 0x00, 0x00, // 00000000
302 0x00, 0x00, 0x00, 0x00, // 00000000
303 0x00, 0x00, 0x00, 0x00, // 00000000
304 0x00, 0x00, 0x00, 0x00, // 00000000
305 0x00, 0x00, 0x00, 0x00, // 00000000
306 0x00, 0x00, 0x00, 0x00, // 00000000
307 0x00, 0x00, 0x00, 0x00, // 00000000
308 0x00, 0x00, 0x00, 0x00, // 00000000
309 0x00, 0x00, 0x00, 0x00, // 00000000
310 0x00, 0x00, 0x00, 0x00, // 00000000
311 0x00, 0x00, 0x00, 0x00, // 00000000
312 0x00, 0x00, 0x00, 0x00, // 00000000
313 0x00, 0x00, 0x00, 0x00, // 00000000
314 0x00, 0x00, 0x00, 0x00, // 00000000
315 0x00, 0x00, 0x00, 0x00, // 00000000
316 0x00, 0x00, 0x00, 0x00, // 00000000
317 0x00, 0x00, 0x00, 0x00, // 00000000
318 0x00, 0x00, 0x00, 0x00, // 00000000
319 0x00, 0x00, 0x00, 0x00, // 00000000
320 0x00, 0x00, 0x00, 0x00, // 00000000
321 0x00, 0x00, 0x00, 0x00, // 00000000
322 0x00, 0x00, 0x00, 0x00, // 00000000
323 0x00, 0x00, 0x00, 0x00, // 00000000
324 0x00, 0x00, 0x00, 0x00, // 00000000
325 0x00, 0x00, 0x00, 0x00, // 00000000
326};
327// address 04800 count 1668 (6678 bytes)
328static const unsigned char maspcm_array9[] = {
329 0xe0, 0x00, 0x06, 0x84, 0x08, 0x00,
330 0x00, 0x00, 0x00, 0x00, // 00000000
331 0x00, 0x07, 0x47, 0xC0, // 000747C0
332 0x00, 0x07, 0x04, 0x00, // 00070400
333 0x00, 0x00, 0x00, 0x00, // 00000000
334 0x00, 0x00, 0x00, 0x00, // 00000000
335 0x00, 0x00, 0x00, 0x00, // 00000000
336 0x00, 0x06, 0xC0, 0x6B, // 0006C06B
337 0x00, 0x00, 0x00, 0x00, // 00000000
338 0x00, 0x07, 0x44, 0x01, // 00074401
339 0x00, 0x07, 0x06, 0x90, // 00070690
340 0x00, 0x07, 0x4C, 0x07, // 00074C07
341 0x00, 0x07, 0x0F, 0xFF, // 00070FFF
342 0x00, 0x0B, 0x52, 0x40, // 000B5240
343 0x00, 0x06, 0x80, 0x1D, // 0006801D
344 0x00, 0x06, 0x80, 0x1F, // 0006801F
345 0x00, 0x06, 0x80, 0x21, // 00068021
346 0x00, 0x06, 0x80, 0x23, // 00068023
347 0x00, 0x06, 0x84, 0x1D, // 0006841D
348 0x00, 0x06, 0x84, 0x1F, // 0006841F
349 0x00, 0x06, 0x84, 0x21, // 00068421
350 0x00, 0x06, 0x84, 0x23, // 00068423
351 0x00, 0x06, 0x88, 0x17, // 00068817
352 0x00, 0x06, 0x8C, 0x17, // 00068C17
353 0x00, 0x06, 0xD0, 0x6D, // 0006D06D
354 0x00, 0x07, 0x5C, 0x01, // 00075C01
355 0x00, 0x07, 0x1E, 0x57, // 00071E57
356 0x00, 0x07, 0x44, 0x01, // 00074401
357 0x00, 0x07, 0x06, 0x90, // 00070690
358 0x00, 0x07, 0x4C, 0x07, // 00074C07
359 0x00, 0x07, 0x0F, 0xFF, // 00070FFF
360 0x00, 0x0B, 0x52, 0x40, // 000B5240
361 0x00, 0x06, 0x80, 0x1D, // 0006801D
362 0x00, 0x06, 0x80, 0x1F, // 0006801F
363 0x00, 0x06, 0x80, 0x21, // 00068021
364 0x00, 0x06, 0x80, 0x23, // 00068023
365 0x00, 0x06, 0x84, 0x1D, // 0006841D
366 0x00, 0x06, 0x84, 0x1F, // 0006841F
367 0x00, 0x06, 0x84, 0x21, // 00068421
368 0x00, 0x06, 0x84, 0x23, // 00068423
369 0x00, 0x06, 0x88, 0x17, // 00068817
370 0x00, 0x06, 0x8C, 0x17, // 00068C17
371 0x00, 0x06, 0xD0, 0x6D, // 0006D06D
372 0x00, 0x06, 0x98, 0x1E, // 0006981E
373 0x00, 0x04, 0x05, 0x08, // 00040508
374 0x00, 0x04, 0x0D, 0x08, // 00040D08
375 0x00, 0x04, 0x15, 0x08, // 00041508
376 0x00, 0x04, 0x1D, 0x08, // 00041D08
377 0x00, 0x04, 0x25, 0x08, // 00042508
378 0x00, 0x04, 0x2D, 0x08, // 00042D08
379 0x00, 0x04, 0x35, 0x08, // 00043508
380 0x00, 0x07, 0x7C, 0x00, // 00077C00
381 0x00, 0x07, 0x3C, 0x30, // 00073C30
382 0x00, 0x06, 0x80, 0x3B, // 0006803B
383 0x00, 0x06, 0x88, 0x5B, // 0006885B
384 0x00, 0x06, 0x94, 0x3B, // 0006943B
385 0x00, 0x06, 0x9C, 0x43, // 00069C43
386 0x00, 0x06, 0xA0, 0x53, // 0006A053
387 0x00, 0x06, 0xA8, 0x4B, // 0006A84B
388 0x00, 0x06, 0xB4, 0x53, // 0006B453
389 0x00, 0x06, 0xBC, 0x06, // 0006BC06
390 0x00, 0x07, 0x74, 0x01, // 00077401
391 0x00, 0x07, 0x36, 0x63, // 00073663
392 0x00, 0x02, 0x12, 0x57, // 00021257
393 0x00, 0x07, 0x6C, 0x18, // 00076C18
394 0x00, 0x07, 0x2C, 0x00, // 00072C00
395 0x00, 0x07, 0x7C, 0x04, // 00077C04
396 0x00, 0x07, 0x3C, 0x45, // 00073C45
397 0x00, 0x06, 0xB0, 0x20, // 0006B020
398 0x00, 0x04, 0x36, 0x00, // 00043600
399 0x00, 0x02, 0x12, 0x46, // 00021246
400 0x00, 0x07, 0x7C, 0x04, // 00077C04
401 0x00, 0x07, 0x3C, 0x4C, // 00073C4C
402 0x00, 0x00, 0x00, 0x00, // 00000000
403 0x00, 0x00, 0x00, 0x00, // 00000000
404 0x00, 0x00, 0x00, 0x00, // 00000000
405 0x00, 0x00, 0x00, 0x00, // 00000000
406 0x00, 0x0B, 0x52, 0x40, // 000B5240
407 0x00, 0x07, 0x44, 0x01, // 00074401
408 0x00, 0x07, 0x06, 0x66, // 00070666
409 0x00, 0x0B, 0x49, 0x40, // 000B4940
410 0x00, 0x00, 0x00, 0x00, // 00000000
411 0x00, 0x06, 0x94, 0x7F, // 0006947F
412 0x00, 0x06, 0x80, 0x1C, // 0006801C
413 0x00, 0x07, 0x88, 0x04, // 00078804
414 0x00, 0x07, 0x44, 0x01, // 00074401
415 0x00, 0x07, 0x06, 0x61, // 00070661
416 0x00, 0x0B, 0x49, 0x7F, // 000B497F
417 0x00, 0x00, 0x00, 0x00, // 00000000
418 0x00, 0x00, 0x00, 0x00, // 00000000
419 0x00, 0x06, 0x80, 0x1C, // 0006801C
420 0x00, 0x04, 0x14, 0x00, // 00041400
421 0x00, 0x0A, 0xC1, 0xC2, // 000AC1C2
422 0x00, 0x02, 0x9E, 0x08, // 00029E08
423 0x00, 0x02, 0x10, 0x70, // 00021070
424 0x00, 0x0A, 0xD2, 0x7E, // 000AD27E
425 0x00, 0x00, 0x00, 0x00, // 00000000
426 0x00, 0x00, 0x00, 0x00, // 00000000
427 0x00, 0x00, 0x00, 0x00, // 00000000
428 0x00, 0x07, 0x90, 0x04, // 00079004
429 0x00, 0x00, 0x00, 0x00, // 00000000
430 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
431 0x00, 0x07, 0x0C, 0x00, // 00070C00
432 0x00, 0x00, 0x00, 0x00, // 00000000
433 0x00, 0x0A, 0xC2, 0xC1, // 000AC2C1
434 0x00, 0x02, 0x9F, 0x08, // 00029F08
435 0x00, 0x02, 0x10, 0x85, // 00021085
436 0x00, 0x00, 0x00, 0x00, // 00000000
437 0x00, 0x00, 0x00, 0x00, // 00000000
438 0x00, 0x00, 0x00, 0x00, // 00000000
439 0x00, 0x00, 0x00, 0x00, // 00000000
440 0x00, 0x00, 0x00, 0x00, // 00000000
441 0x00, 0x00, 0x00, 0x00, // 00000000
442 0x00, 0x06, 0x00, 0x6D, // 0006006D
443 0x00, 0x00, 0x00, 0x00, // 00000000
444 0x00, 0x08, 0x00, 0x41, // 00080041
445 0x00, 0x00, 0x00, 0x00, // 00000000
446 0x00, 0x00, 0x00, 0x00, // 00000000
447 0x00, 0x00, 0x00, 0x00, // 00000000
448 0x00, 0x06, 0xC0, 0x6D, // 0006C06D
449 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
450 0x00, 0x07, 0x6C, 0x04, // 00076C04
451 0x00, 0x07, 0x2C, 0x7E, // 00072C7E
452 0x00, 0x00, 0x00, 0x00, // 00000000
453 0x00, 0x00, 0x00, 0x00, // 00000000
454 0x00, 0x00, 0x00, 0x00, // 00000000
455 0x00, 0x00, 0x00, 0x00, // 00000000
456 0x00, 0x02, 0x10, 0x54, // 00021054
457 0x00, 0x00, 0x00, 0x00, // 00000000
458 0x00, 0x00, 0x00, 0x00, // 00000000
459 0x00, 0x00, 0x00, 0x00, // 00000000
460 0x00, 0x00, 0x00, 0x00, // 00000000
461 0x00, 0x00, 0x00, 0x00, // 00000000
462 0x00, 0x00, 0x00, 0x00, // 00000000
463 0x00, 0x09, 0x80, 0x74, // 00098074
464 0x00, 0x07, 0x5C, 0x00, // 00075C00
465 0x00, 0x07, 0x1F, 0x00, // 00071F00
466 0x00, 0x08, 0x80, 0x42, // 00088042
467 0x00, 0x02, 0x9F, 0x10, // 00029F10
468 0x00, 0x02, 0x11, 0x51, // 00021151
469 0x00, 0x02, 0x81, 0x28, // 00028128
470 0x00, 0x0A, 0xC2, 0xC3, // 000AC2C3
471 0x00, 0x00, 0x00, 0x00, // 00000000
472 0x00, 0x09, 0x80, 0x78, // 00098078
473 0x00, 0x00, 0x00, 0x00, // 00000000
474 0x00, 0x08, 0x80, 0x42, // 00088042
475 0x00, 0x02, 0x9F, 0x10, // 00029F10
476 0x00, 0x02, 0x11, 0x51, // 00021151
477 0x00, 0x02, 0x81, 0x28, // 00028128
478 0x00, 0x07, 0x4C, 0x00, // 00074C00
479 0x00, 0x07, 0x0F, 0x00, // 00070F00
480 0x00, 0x07, 0x44, 0x01, // 00074401
481 0x00, 0x07, 0x06, 0x66, // 00070666
482 0x00, 0x07, 0x56, 0x00, // 00075600
483 0x00, 0x07, 0x14, 0x03, // 00071403
484 0x00, 0x06, 0x8C, 0x3B, // 00068C3B
485 0x00, 0x00, 0x00, 0x00, // 00000000
486 0x00, 0x06, 0x80, 0x1C, // 0006801C
487 0x00, 0x07, 0x90, 0x04, // 00079004
488 0x00, 0x07, 0x6C, 0x00, // 00076C00
489 0x00, 0x07, 0x2F, 0x00, // 00072F00
490 0x00, 0x07, 0x44, 0x00, // 00074400
491 0x00, 0x07, 0x04, 0x00, // 00070400
492 0x00, 0x0B, 0x49, 0x40, // 000B4940
493 0x00, 0x06, 0xAC, 0x05, // 0006AC05
494 0x00, 0x01, 0x41, 0x00, // 00014100
495 0x00, 0x06, 0x84, 0x1C, // 0006841C
496 0x00, 0x07, 0x8C, 0x0C, // 00078C0C
497 0x00, 0x07, 0x8C, 0x0C, // 00078C0C
498 0x00, 0x07, 0x5C, 0x01, // 00075C01
499 0x00, 0x07, 0x1C, 0x90, // 00071C90
500 0x00, 0x07, 0x54, 0x00, // 00075400
501 0x00, 0x07, 0x17, 0x00, // 00071700
502 0x00, 0x07, 0x64, 0x01, // 00076401
503 0x00, 0x07, 0x25, 0xFF, // 000725FF
504 0x00, 0x07, 0x4C, 0x00, // 00074C00
505 0x00, 0x07, 0x0C, 0x00, // 00070C00
506 0x00, 0x07, 0x6C, 0x00, // 00076C00
507 0x00, 0x07, 0x2C, 0x00, // 00072C00
508 0x00, 0x06, 0x9C, 0x25, // 00069C25
509 0x00, 0x06, 0x98, 0x2D, // 0006982D
510 0x00, 0x06, 0x94, 0x3C, // 0006943C
511 0x00, 0x06, 0xA4, 0x16, // 0006A416
512 0x00, 0x06, 0xA0, 0x16, // 0006A016
513 0x00, 0x06, 0x8C, 0x3B, // 00068C3B
514 0x00, 0x06, 0xAC, 0x24, // 0006AC24
515 0x00, 0x07, 0x4C, 0x01, // 00074C01
516 0x00, 0x07, 0x0F, 0x00, // 00070F00
517 0x00, 0x0B, 0x52, 0x6F, // 000B526F
518 0x00, 0x07, 0x5C, 0x00, // 00075C00
519 0x00, 0x07, 0x1E, 0x90, // 00071E90
520 0x00, 0x00, 0x00, 0x00, // 00000000
521 0x00, 0x06, 0x88, 0x1E, // 0006881E
522 0x00, 0x06, 0x90, 0x15, // 00069015
523 0x00, 0x06, 0x98, 0x1F, // 0006981F
524 0x00, 0x0B, 0x40, 0x40, // 000B4040
525 0x00, 0x00, 0x00, 0x00, // 00000000
526 0x00, 0x00, 0x00, 0x00, // 00000000
527 0x00, 0x00, 0x00, 0x00, // 00000000
528 0x00, 0x06, 0x84, 0x6F, // 0006846F
529 0x00, 0x06, 0x84, 0x70, // 00068470
530 0x00, 0x04, 0x05, 0x10, // 00040510
531 0x00, 0x07, 0x74, 0x01, // 00077401
532 0x00, 0x07, 0x36, 0x63, // 00073663
533 0x00, 0x02, 0x12, 0x57, // 00021257
534 0x00, 0x06, 0x80, 0x1C, // 0006801C
535 0x00, 0x04, 0x2C, 0x08, // 00042C08
536 0x00, 0x07, 0x7C, 0x04, // 00077C04
537 0x00, 0x07, 0x3C, 0xD2, // 00073CD2
538 0x00, 0x06, 0xB0, 0x22, // 0006B022
539 0x00, 0x04, 0x37, 0x08, // 00043708
540 0x00, 0x04, 0x14, 0x20, // 00041420
541 0x00, 0x04, 0x07, 0x00, // 00040700
542 0x00, 0x07, 0x66, 0x00, // 00076600
543 0x00, 0x07, 0x24, 0x00, // 00072400
544 0x00, 0x07, 0x5C, 0x80, // 00075C80
545 0x00, 0x07, 0x1C, 0x00, // 00071C00
546 0x00, 0x07, 0x7C, 0x00, // 00077C00
547 0x00, 0x07, 0x3D, 0x00, // 00073D00
548 0x00, 0x0A, 0xC8, 0xC4, // 000AC8C4
549 0x00, 0x02, 0x9F, 0x08, // 00029F08
550 0x00, 0x08, 0x36, 0xC4, // 000836C4
551 0x00, 0x0A, 0xC8, 0xC3, // 000AC8C3
552 0x00, 0x02, 0x9F, 0x08, // 00029F08
553 0x00, 0x08, 0x12, 0x41, // 00081241
554 0x00, 0x0A, 0xC8, 0xC7, // 000AC8C7
555 0x00, 0x02, 0x9F, 0x08, // 00029F08
556 0x00, 0x0B, 0x52, 0x40, // 000B5240
557 0x00, 0x02, 0x12, 0x46, // 00021246
558 0x00, 0x09, 0x92, 0x51, // 00099251
559 0x00, 0x08, 0x36, 0xC2, // 000836C2
560 0x00, 0x07, 0x7C, 0x04, // 00077C04
561 0x00, 0x07, 0x3C, 0xEA, // 00073CEA
562 0x00, 0x06, 0xAC, 0x6D, // 0006AC6D
563 0x00, 0x06, 0xAC, 0x6C, // 0006AC6C
564 0x00, 0x0B, 0x7F, 0x7F, // 000B7F7F
565 0x00, 0x09, 0xB6, 0x7D, // 0009B67D
566 0x00, 0x0A, 0x3F, 0x53, // 000A3F53
567 0x00, 0x07, 0x64, 0x00, // 00076400
568 0x00, 0x0A, 0xF6, 0x43, // 000AF643
569 0x00, 0x07, 0x24, 0x00, // 00072400
570 0x00, 0x07, 0x54, 0x00, // 00075400
571 0x00, 0x07, 0x14, 0x00, // 00071400
572 0x00, 0x07, 0x5C, 0x00, // 00075C00
573 0x00, 0x07, 0x1F, 0x18, // 00071F18
574 0x00, 0x07, 0x6C, 0x04, // 00076C04
575 0x00, 0x07, 0x2C, 0x00, // 00072C00
576 0x00, 0x04, 0x0C, 0x08, // 00040C08
577 0x00, 0x08, 0xB6, 0x41, // 0008B641
578 0x00, 0x0A, 0x09, 0xC6, // 000A09C6
579 0x00, 0x08, 0x8F, 0xC1, // 00088FC1
580 0x00, 0x00, 0x00, 0x00, // 00000000
581 0x00, 0x0C, 0x09, 0x25, // 000C0925
582 0x00, 0x07, 0x44, 0x00, // 00074400
583 0x00, 0x07, 0x04, 0x00, // 00070400
584 0x00, 0x06, 0x98, 0x53, // 00069853
585 0x00, 0x06, 0x90, 0x2C, // 0006902C
586 0x00, 0x06, 0xA4, 0x24, // 0006A424
587 0x00, 0x06, 0x80, 0x53, // 00068053
588 0x00, 0x06, 0x88, 0x54, // 00068854
589 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
590 0x00, 0x07, 0x0C, 0x00, // 00070C00
591 0x00, 0x06, 0x14, 0x6F, // 0006146F
592 0x00, 0x06, 0x00, 0x52, // 00060052
593 0x00, 0x08, 0x12, 0x41, // 00081241
594 0x00, 0x06, 0x1C, 0x70, // 00061C70
595 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
596 0x00, 0x02, 0x9F, 0x38, // 00029F38
597 0x00, 0x0A, 0x09, 0x74, // 000A0974
598 0x00, 0x00, 0x00, 0x00, // 00000000
599 0x00, 0x0A, 0xC9, 0x43, // 000AC943
600 0x00, 0x00, 0x00, 0x00, // 00000000
601 0x00, 0x08, 0xA1, 0x42, // 0008A142
602 0x00, 0x02, 0x9E, 0x08, // 00029E08
603 0x00, 0x08, 0x1B, 0x41, // 00081B41
604 0x00, 0x00, 0x00, 0x00, // 00000000
605 0x00, 0x00, 0x00, 0x00, // 00000000
606 0x00, 0x06, 0x94, 0x6F, // 0006946F
607 0x00, 0x06, 0x9C, 0x70, // 00069C70
608 0x00, 0x06, 0x00, 0x6D, // 0006006D
609 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
610 0x00, 0x0B, 0x00, 0x41, // 000B0041
611 0x00, 0x07, 0x6C, 0x04, // 00076C04
612 0x00, 0x07, 0x2D, 0x1E, // 00072D1E
613 0x00, 0x00, 0x00, 0x00, // 00000000
614 0x00, 0x06, 0x80, 0x6D, // 0006806D
615 0x00, 0x00, 0x00, 0x00, // 00000000
616 0x00, 0x06, 0x04, 0x24, // 00060424
617 0x00, 0x07, 0x54, 0x01, // 00075401
618 0x00, 0x07, 0x16, 0x61, // 00071661
619 0x00, 0x08, 0x8C, 0x80, // 00088C80
620 0x00, 0x02, 0x89, 0x10, // 00028910
621 0x00, 0x02, 0x11, 0x03, // 00021103
622 0x00, 0x02, 0x81, 0x28, // 00028128
623 0x00, 0x06, 0x90, 0x22, // 00069022
624 0x00, 0x04, 0x07, 0x00, // 00040700
625 0x00, 0x07, 0x54, 0x0C, // 0007540C
626 0x00, 0x07, 0x14, 0x00, // 00071400
627 0x00, 0x0A, 0xD8, 0x7E, // 000AD87E
628 0x00, 0x0A, 0xC8, 0x41, // 000AC841
629 0x00, 0x02, 0x9F, 0x20, // 00029F20
630 0x00, 0x0A, 0xC8, 0xC2, // 000AC8C2
631 0x00, 0x02, 0x9E, 0x10, // 00029E10
632 0x00, 0x02, 0x10, 0x08, // 00021008
633 0x00, 0x02, 0x81, 0x28, // 00028128
634 0x00, 0x07, 0x98, 0x07, // 00079807
635 0x00, 0x06, 0x04, 0x6F, // 0006046F
636 0x00, 0x06, 0x0C, 0x70, // 00060C70
637 0x00, 0x0A, 0x10, 0x7D, // 000A107D
638 0x00, 0x08, 0x90, 0xC2, // 000890C2
639 0x00, 0x08, 0x99, 0xC2, // 000899C2
640 0x00, 0x02, 0x86, 0x10, // 00028610
641 0x00, 0x02, 0x10, 0xC2, // 000210C2
642 0x00, 0x02, 0x81, 0x28, // 00028128
643 0x00, 0x07, 0x4C, 0x01, // 00074C01
644 0x00, 0x07, 0x0E, 0x6B, // 00070E6B
645 0x00, 0x0B, 0x52, 0x50, // 000B5250
646 0x00, 0x00, 0x00, 0x00, // 00000000
647 0x00, 0x00, 0x00, 0x00, // 00000000
648 0x00, 0x06, 0x88, 0x1C, // 0006881C
649 0x00, 0x0A, 0xCC, 0x82, // 000ACC82
650 0x00, 0x04, 0x1D, 0x88, // 00041D88
651 0x00, 0x04, 0x1D, 0x00, // 00041D00
652 0x00, 0x08, 0x09, 0xC3, // 000809C3
653 0x00, 0x00, 0x00, 0x00, // 00000000
654 0x00, 0x00, 0x00, 0x00, // 00000000
655 0x00, 0x00, 0x00, 0x00, // 00000000
656 0x00, 0x07, 0x88, 0x04, // 00078804
657 0x00, 0x07, 0x44, 0x01, // 00074401
658 0x00, 0x07, 0x06, 0x90, // 00070690
659 0x00, 0x07, 0x4C, 0x00, // 00074C00
660 0x00, 0x07, 0x0F, 0x00, // 00070F00
661 0x00, 0x07, 0x54, 0x00, // 00075400
662 0x00, 0x07, 0x17, 0x18, // 00071718
663 0x00, 0x06, 0x80, 0x1F, // 0006801F
664 0x00, 0x06, 0x8C, 0x3B, // 00068C3B
665 0x00, 0x00, 0x00, 0x00, // 00000000
666 0x00, 0x06, 0x90, 0x53, // 00069053
667 0x00, 0x07, 0x4C, 0x01, // 00074C01
668 0x00, 0x07, 0x0E, 0x65, // 00070E65
669 0x00, 0x0B, 0x52, 0x40, // 000B5240
670 0x00, 0x07, 0x64, 0x01, // 00076401
671 0x00, 0x07, 0x26, 0x68, // 00072668
672 0x00, 0x06, 0x88, 0x20, // 00068820
673 0x00, 0x07, 0x90, 0x06, // 00079006
674 0x00, 0x06, 0x94, 0x7F, // 0006947F
675 0x00, 0x06, 0xA0, 0x22, // 0006A022
676 0x00, 0x07, 0x90, 0x07, // 00079007
677 0x00, 0x07, 0x4C, 0x01, // 00074C01
678 0x00, 0x07, 0x0E, 0x6B, // 00070E6B
679 0x00, 0x00, 0x00, 0x00, // 00000000
680 0x00, 0x00, 0x00, 0x00, // 00000000
681 0x00, 0x00, 0x00, 0x00, // 00000000
682 0x00, 0x06, 0x88, 0x20, // 00068820
683 0x00, 0x04, 0x0E, 0x00, // 00040E00
684 0x00, 0x07, 0x5C, 0x00, // 00075C00
685 0x00, 0x07, 0x1C, 0x40, // 00071C40
686 0x00, 0x0B, 0x40, 0x7F, // 000B407F
687 0x00, 0x0A, 0xD1, 0xC3, // 000AD1C3
688 0x00, 0x02, 0x9F, 0x08, // 00029F08
689 0x00, 0x0B, 0x40, 0x40, // 000B4040
690 0x00, 0x00, 0x00, 0x00, // 00000000
691 0x00, 0x00, 0x00, 0x00, // 00000000
692 0x00, 0x00, 0x00, 0x00, // 00000000
693 0x00, 0x06, 0x80, 0x6A, // 0006806A
694 0x00, 0x07, 0x5C, 0x00, // 00075C00
695 0x00, 0x07, 0x1C, 0x20, // 00071C20
696 0x00, 0x0B, 0x40, 0x40, // 000B4040
697 0x00, 0x0A, 0xD1, 0xC3, // 000AD1C3
698 0x00, 0x02, 0x9F, 0x08, // 00029F08
699 0x00, 0x0B, 0x40, 0x7F, // 000B407F
700 0x00, 0x00, 0x00, 0x00, // 00000000
701 0x00, 0x00, 0x00, 0x00, // 00000000
702 0x00, 0x00, 0x00, 0x00, // 00000000
703 0x00, 0x06, 0x80, 0x6C, // 0006806C
704 0x00, 0x07, 0x5C, 0x00, // 00075C00
705 0x00, 0x07, 0x1C, 0x10, // 00071C10
706 0x00, 0x0B, 0x40, 0x40, // 000B4040
707 0x00, 0x0A, 0xD1, 0xC3, // 000AD1C3
708 0x00, 0x02, 0x9F, 0x08, // 00029F08
709 0x00, 0x0B, 0x40, 0x7F, // 000B407F
710 0x00, 0x00, 0x00, 0x00, // 00000000
711 0x00, 0x00, 0x00, 0x00, // 00000000
712 0x00, 0x00, 0x00, 0x00, // 00000000
713 0x00, 0x06, 0x80, 0x76, // 00068076
714 0x00, 0x07, 0x5C, 0x01, // 00075C01
715 0x00, 0x07, 0x1E, 0x67, // 00071E67
716 0x00, 0x07, 0x44, 0x01, // 00074401
717 0x00, 0x07, 0x06, 0xE4, // 000706E4
718 0x00, 0x0A, 0xD1, 0x4F, // 000AD14F
719 0x00, 0x08, 0x10, 0xC2, // 000810C2
720 0x00, 0x00, 0x00, 0x00, // 00000000
721 0x00, 0x06, 0x98, 0x1C, // 0006981C
722 0x00, 0x07, 0x90, 0x04, // 00079004
723 0x00, 0x06, 0x90, 0x1C, // 0006901C
724 0x00, 0x04, 0x14, 0x00, // 00041400
725 0x00, 0x00, 0x00, 0x00, // 00000000
726 0x00, 0x00, 0x00, 0x00, // 00000000
727 0x00, 0x00, 0x00, 0x00, // 00000000
728 0x00, 0x06, 0x90, 0x22, // 00069022
729 0x00, 0x04, 0x2F, 0x08, // 00042F08
730 0x00, 0x07, 0x44, 0x01, // 00074401
731 0x00, 0x07, 0x06, 0x61, // 00070661
732 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
733 0x00, 0x07, 0x0F, 0x00, // 00070F00
734 0x00, 0x07, 0x54, 0x08, // 00075408
735 0x00, 0x07, 0x16, 0x00, // 00071600
736 0x00, 0x06, 0x80, 0x1C, // 0006801C
737 0x00, 0x0A, 0xCC, 0x81, // 000ACC81
738 0x00, 0x08, 0x92, 0xC1, // 000892C1
739 0x00, 0x02, 0x9E, 0x10, // 00029E10
740 0x00, 0x02, 0x11, 0xBD, // 000211BD
741 0x00, 0x02, 0x81, 0x28, // 00028128
742 0x00, 0x07, 0x74, 0x01, // 00077401
743 0x00, 0x02, 0x12, 0x57, // 00021257
744 0x00, 0x07, 0x36, 0x63, // 00073663
745 0x00, 0x00, 0x00, 0x00, // 00000000
746 0x00, 0x07, 0x7C, 0x04, // 00077C04
747 0x00, 0x07, 0x3D, 0xA4, // 00073DA4
748 0x00, 0x06, 0xB0, 0x20, // 0006B020
749 0x00, 0x04, 0x36, 0x08, // 00043608
750 0x00, 0x04, 0x17, 0x08, // 00041708
751 0x00, 0x04, 0x06, 0x00, // 00040600
752 0x00, 0x07, 0x66, 0x00, // 00076600
753 0x00, 0x07, 0x24, 0x00, // 00072400
754 0x00, 0x07, 0x5C, 0x80, // 00075C80
755 0x00, 0x07, 0x1C, 0x00, // 00071C00
756 0x00, 0x07, 0x7C, 0x00, // 00077C00
757 0x00, 0x07, 0x3D, 0x00, // 00073D00
758 0x00, 0x0A, 0xC8, 0xC4, // 000AC8C4
759 0x00, 0x02, 0x9F, 0x08, // 00029F08
760 0x00, 0x08, 0x36, 0xC4, // 000836C4
761 0x00, 0x0A, 0xC8, 0xC3, // 000AC8C3
762 0x00, 0x02, 0x9F, 0x08, // 00029F08
763 0x00, 0x08, 0x12, 0x41, // 00081241
764 0x00, 0x0A, 0xC8, 0xC7, // 000AC8C7
765 0x00, 0x02, 0x9F, 0x08, // 00029F08
766 0x00, 0x0B, 0x52, 0x40, // 000B5240
767 0x00, 0x00, 0x00, 0x00, // 00000000
768 0x00, 0x02, 0x12, 0x46, // 00021246
769 0x00, 0x09, 0x92, 0x51, // 00099251
770 0x00, 0x08, 0x36, 0xC2, // 000836C2
771 0x00, 0x07, 0x7C, 0x04, // 00077C04
772 0x00, 0x07, 0x3D, 0xBF, // 00073DBF
773 0x00, 0x06, 0xAC, 0x6D, // 0006AC6D
774 0x00, 0x06, 0xAC, 0x6C, // 0006AC6C
775 0x00, 0x04, 0x06, 0x08, // 00040608
776 0x00, 0x04, 0x07, 0x08, // 00040708
777 0x00, 0x07, 0x4C, 0x01, // 00074C01
778 0x00, 0x07, 0x0E, 0x62, // 00070E62
779 0x00, 0x07, 0x54, 0x00, // 00075400
780 0x00, 0x07, 0x14, 0x2D, // 0007142D
781 0x00, 0x00, 0x00, 0x00, // 00000000
782 0x00, 0x06, 0x88, 0x1C, // 0006881C
783 0x00, 0x04, 0x0C, 0x00, // 00040C00
784 0x00, 0x0A, 0xD2, 0xC1, // 000AD2C1
785 0x00, 0x00, 0x00, 0x00, // 00000000
786 0x00, 0x00, 0x00, 0x00, // 00000000
787 0x00, 0x00, 0x00, 0x00, // 00000000
788 0x00, 0x06, 0x90, 0x4F, // 0006904F
789 0x00, 0x06, 0x94, 0x77, // 00069477
790 0x00, 0x07, 0x44, 0x01, // 00074401
791 0x00, 0x07, 0x06, 0x39, // 00070639
792 0x00, 0x07, 0x4C, 0x01, // 00074C01
793 0x00, 0x07, 0x0E, 0x61, // 00070E61
794 0x00, 0x07, 0x54, 0x12, // 00075412
795 0x00, 0x07, 0x14, 0x30, // 00071430
796 0x00, 0x06, 0x84, 0x1C, // 0006841C
797 0x00, 0x07, 0x5C, 0x00, // 00075C00
798 0x00, 0x07, 0x1C, 0x00, // 00071C00
799 0x00, 0x06, 0x88, 0x1C, // 0006881C
800 0x00, 0x04, 0x0C, 0x00, // 00040C00
801 0x00, 0x04, 0x27, 0x08, // 00042708
802 0x00, 0x04, 0x37, 0x08, // 00043708
803 0x00, 0x09, 0xAC, 0x7F, // 0009AC7F
804 0x00, 0x0A, 0xC1, 0x50, // 000AC150
805 0x00, 0x02, 0x9E, 0x08, // 00029E08
806 0x00, 0x0A, 0x24, 0x7F, // 000A247F
807 0x00, 0x0A, 0xC9, 0xC2, // 000AC9C2
808 0x00, 0x08, 0x0B, 0xC1, // 00080BC1
809 0x00, 0x00, 0x00, 0x00, // 00000000
810 0x00, 0x07, 0xA4, 0x00, // 0007A400
811 0x00, 0x0B, 0x40, 0x40, // 000B4040
812 0x00, 0x07, 0x8C, 0x00, // 00078C00
813 0x00, 0x07, 0xAC, 0x00, // 0007AC00
814 0x00, 0x04, 0xA8, 0x00, // 0004A800
815 0x00, 0x07, 0xB4, 0x00, // 0007B400
816 0x00, 0x06, 0x84, 0x45, // 00068445
817 0x00, 0x06, 0x84, 0x46, // 00068446
818 0x00, 0x07, 0x54, 0x01, // 00075401
819 0x00, 0x07, 0x16, 0x40, // 00071640
820 0x00, 0x07, 0x64, 0x00, // 00076400
821 0x00, 0x07, 0x26, 0x90, // 00072690
822 0x00, 0x0B, 0x49, 0x75, // 000B4975
823 0x00, 0x06, 0x94, 0x1E, // 0006941E
824 0x00, 0x00, 0x00, 0x00, // 00000000
825 0x00, 0x06, 0xA4, 0x1F, // 0006A41F
826 0x00, 0x06, 0x8C, 0x15, // 00068C15
827 0x00, 0x07, 0x44, 0x01, // 00074401
828 0x00, 0x07, 0x06, 0x6A, // 0007066A
829 0x00, 0x04, 0x0F, 0x08, // 00040F08
830 0x00, 0x04, 0x17, 0x08, // 00041708
831 0x00, 0x04, 0x1F, 0x08, // 00041F08
832 0x00, 0x04, 0x27, 0x08, // 00042708
833 0x00, 0x04, 0x2F, 0x08, // 00042F08
834 0x00, 0x06, 0x80, 0x22, // 00068022
835 0x00, 0x04, 0x07, 0x00, // 00040700
836 0x00, 0x06, 0xA4, 0x65, // 0006A465
837 0x00, 0x00, 0x00, 0x00, // 00000000
838 0x00, 0x00, 0x00, 0x00, // 00000000
839 0x00, 0x07, 0x84, 0x0D, // 0007840D
840 0x00, 0x07, 0x8C, 0x5D, // 00078C5D
841 0x00, 0x06, 0xAC, 0x79, // 0006AC79
842 0x00, 0x07, 0x44, 0x01, // 00074401
843 0x00, 0x07, 0x06, 0x6C, // 0007066C
844 0x00, 0x0B, 0x76, 0x41, // 000B7641
845 0x00, 0x00, 0x00, 0x00, // 00000000
846 0x00, 0x00, 0x00, 0x00, // 00000000
847 0x00, 0x06, 0x80, 0x22, // 00068022
848 0x00, 0x0C, 0x0B, 0x0D, // 000C0B0D
849 0x00, 0x0C, 0x13, 0x0D, // 000C130D
850 0x00, 0x0C, 0x1B, 0x0D, // 000C1B0D
851 0x00, 0x0C, 0x23, 0x0D, // 000C230D
852 0x00, 0x00, 0x00, 0x00, // 00000000
853 0x00, 0x00, 0x00, 0x00, // 00000000
854 0x00, 0x06, 0xB4, 0x6A, // 0006B46A
855 0x00, 0x06, 0x8C, 0x66, // 00068C66
856 0x00, 0x06, 0x94, 0x67, // 00069467
857 0x00, 0x06, 0x9C, 0x68, // 00069C68
858 0x00, 0x06, 0xA4, 0x69, // 0006A469
859 0x00, 0x07, 0x64, 0x01, // 00076401
860 0x00, 0x07, 0x27, 0x12, // 00072712
861 0x00, 0x06, 0x80, 0x22, // 00068022
862 0x00, 0x04, 0x03, 0x00, // 00040300
863 0x00, 0x04, 0x0B, 0x00, // 00040B00
864 0x00, 0x04, 0x13, 0x00, // 00041300
865 0x00, 0x04, 0x1B, 0x00, // 00041B00
866 0x00, 0x06, 0xA0, 0x22, // 0006A022
867 0x00, 0x07, 0x80, 0x0F, // 0007800F
868 0x00, 0x07, 0x88, 0x0F, // 0007880F
869 0x00, 0x07, 0x90, 0x0F, // 0007900F
870 0x00, 0x07, 0x98, 0x07, // 00079807
871 0x00, 0x00, 0x00, 0x00, // 00000000
872 0x00, 0x07, 0x44, 0x01, // 00074401
873 0x00, 0x07, 0x06, 0x61, // 00070661
874 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
875 0x00, 0x07, 0x0C, 0x00, // 00070C00
876 0x00, 0x00, 0x00, 0x00, // 00000000
877 0x00, 0x06, 0x80, 0x1C, // 0006801C
878 0x00, 0x0A, 0xC4, 0x81, // 000AC481
879 0x00, 0x00, 0x00, 0x00, // 00000000
880 0x00, 0x09, 0x80, 0x74, // 00098074
881 0x00, 0x00, 0x00, 0x00, // 00000000
882 0x00, 0x0B, 0x52, 0x40, // 000B5240
883 0x00, 0x07, 0x5C, 0x01, // 00075C01
884 0x00, 0x07, 0x1E, 0x66, // 00071E66
885 0x00, 0x07, 0x64, 0x04, // 00076404
886 0x00, 0x07, 0x24, 0x08, // 00072408
887 0x00, 0x08, 0x88, 0x41, // 00088841
888 0x00, 0x02, 0x9E, 0x08, // 00029E08
889 0x00, 0x02, 0x12, 0x8F, // 0002128F
890 0x00, 0x07, 0x56, 0x00, // 00075600
891 0x00, 0x07, 0x14, 0x01, // 00071401
892 0x00, 0x06, 0xA0, 0x08, // 0006A008
893 0x00, 0x00, 0x00, 0x00, // 00000000
894 0x00, 0x06, 0x98, 0x20, // 00069820
895 0x00, 0x07, 0x90, 0x06, // 00079006
896 0x00, 0x08, 0x98, 0x42, // 00089842
897 0x00, 0x02, 0x9E, 0x08, // 00029E08
898 0x00, 0x02, 0x18, 0x00, // 00021800
899 0x00, 0x07, 0x56, 0x00, // 00075600
900 0x00, 0x07, 0x14, 0x02, // 00071402
901 0x00, 0x00, 0x00, 0x00, // 00000000
902 0x00, 0x00, 0x00, 0x00, // 00000000
903 0x00, 0x00, 0x00, 0x00, // 00000000
904 0x00, 0x07, 0x90, 0x06, // 00079006
905 0x00, 0x02, 0x10, 0x54, // 00021054
906 0x00, 0x00, 0x00, 0x00, // 00000000
907 0x00, 0x00, 0x00, 0x00, // 00000000
908 0x00, 0x00, 0x00, 0x00, // 00000000
909 0x00, 0x00, 0x00, 0x00, // 00000000
910 0x00, 0x00, 0x00, 0x00, // 00000000
911 0x00, 0x00, 0x00, 0x00, // 00000000
912 0x00, 0x0B, 0x64, 0x68, // 000B6468
913 0x00, 0x0A, 0xBE, 0xC4, // 000ABEC4
914 0x00, 0x09, 0xA4, 0x46, // 0009A446
915 0x00, 0x0B, 0x7F, 0xC7, // 000B7FC7
916 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
917 0x00, 0x00, 0x00, 0x00, // 00000000
918 0x00, 0x06, 0xA4, 0x05, // 0006A405
919 0x00, 0x06, 0xBC, 0x0D, // 0006BC0D
920 0x00, 0x01, 0x41, 0x00, // 00014100
921 0x00, 0x06, 0xAC, 0x0F, // 0006AC0F
922 0x00, 0x00, 0x00, 0x00, // 00000000
923 0x00, 0x00, 0x00, 0x00, // 00000000
924 0x00, 0x00, 0xC1, 0x87, // 0000C187
925 0x00, 0x06, 0xB4, 0x0D, // 0006B40D
926 0x00, 0x00, 0x00, 0x00, // 00000000
927 0x00, 0x00, 0x00, 0x00, // 00000000
928 0x00, 0x00, 0x00, 0x00, // 00000000
929 0x00, 0x09, 0xBD, 0x4A, // 0009BD4A
930 0x00, 0x09, 0xB6, 0x7C, // 0009B67C
931 0x00, 0x0A, 0xE4, 0x40, // 000AE440
932 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
933 0x00, 0x07, 0x6F, 0xFF, // 00076FFF
934 0x00, 0x07, 0x2F, 0xFF, // 00072FFF
935 0x00, 0x01, 0x03, 0xA6, // 000103A6
936 0x00, 0x0A, 0x2D, 0x7C, // 000A2D7C
937 0x00, 0x09, 0xA4, 0x41, // 0009A441
938 0x00, 0x09, 0xBF, 0x41, // 0009BF41
939 0x00, 0x08, 0xE4, 0xC5, // 0008E4C5
940 0x00, 0x09, 0x1E, 0xC4, // 00091EC4
941 0x00, 0x02, 0x87, 0x10, // 00028710
942 0x00, 0x0A, 0xE3, 0xC3, // 000AE3C3
943 0x00, 0x08, 0xBF, 0xC5, // 0008BFC5
944 0x00, 0x07, 0x75, 0xD9, // 000775D9
945 0x00, 0x07, 0x36, 0x23, // 00073623
946 0x00, 0x09, 0xA7, 0x40, // 0009A740
947 0x00, 0x07, 0x6D, 0x14, // 00076D14
948 0x00, 0x0C, 0x36, 0x27, // 000C3627
949 0x00, 0x07, 0x2F, 0x2C, // 00072F2C
950 0x00, 0x0B, 0x7D, 0x75, // 000B7D75
951 0x00, 0x08, 0xAD, 0xC4, // 0008ADC4
952 0x00, 0x00, 0xC7, 0x87, // 0000C787
953 0x00, 0x0A, 0x6E, 0xC6, // 000A6EC6
954 0x00, 0x09, 0xA4, 0x44, // 0009A444
955 0x00, 0x08, 0xAD, 0x41, // 0008AD41
956 0x00, 0x09, 0xA4, 0xC5, // 0009A4C5
957 0x00, 0x09, 0xAD, 0x43, // 0009AD43
958 0x00, 0x09, 0xB4, 0x6D, // 0009B46D
959 0x00, 0x09, 0xA4, 0x49, // 0009A449
960 0x00, 0x0A, 0xF6, 0x7F, // 000AF67F
961 0x00, 0x0A, 0x24, 0x77, // 000A2477
962 0x00, 0x02, 0x86, 0x30, // 00028630
963 0x00, 0x08, 0x36, 0x41, // 00083641
964 0x00, 0x08, 0xBE, 0x48, // 0008BE48
965 0x00, 0x02, 0x87, 0x18, // 00028718
966 0x00, 0x09, 0xA4, 0x49, // 0009A449
967 0x00, 0x08, 0xB6, 0x41, // 0008B641
968 0x00, 0x09, 0xA4, 0x77, // 0009A477
969 0x00, 0x0B, 0x7F, 0x74, // 000B7F74
970 0x00, 0x08, 0xB6, 0x44, // 0008B644
971 0x00, 0x02, 0x9E, 0x20, // 00029E20
972 0x00, 0x0B, 0x5B, 0x41, // 000B5B41
973 0x00, 0x08, 0x36, 0x41, // 00083641
974 0x00, 0x09, 0x9B, 0x53, // 00099B53
975 0x00, 0x08, 0x24, 0xC3, // 000824C3
976 0x00, 0x08, 0xB6, 0x41, // 0008B641
977 0x00, 0x00, 0xC7, 0x87, // 0000C787
978 0x00, 0x00, 0xC1, 0x07, // 0000C107
979 0x00, 0x09, 0xB6, 0x4F, // 0009B64F
980 0x00, 0x08, 0x35, 0xC6, // 000835C6
981 0x00, 0x0B, 0x3F, 0xC7, // 000B3FC7
982 0x00, 0x0A, 0xEC, 0xC4, // 000AECC4
983 0x00, 0x00, 0x00, 0x00, // 00000000
984 0x00, 0x00, 0x00, 0x00, // 00000000
985 0x00, 0x07, 0x44, 0x01, // 00074401
986 0x00, 0x07, 0x06, 0x61, // 00070661
987 0x00, 0x07, 0x4C, 0x00, // 00074C00
988 0x00, 0x07, 0x0D, 0x00, // 00070D00
989 0x00, 0x0B, 0x52, 0x40, // 000B5240
990 0x00, 0x06, 0x80, 0x22, // 00068022
991 0x00, 0x04, 0x07, 0x00, // 00040700
992 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
993 0x00, 0x02, 0x9F, 0x08, // 00029F08
994 0x00, 0x0B, 0x52, 0x7F, // 000B527F
995 0x00, 0x07, 0x5C, 0x01, // 00075C01
996 0x00, 0x07, 0x1E, 0x69, // 00071E69
997 0x00, 0x0B, 0x64, 0x7F, // 000B647F
998 0x00, 0x06, 0x90, 0x78, // 00069078
999 0x00, 0x0B, 0x6D, 0x7E, // 000B6D7E
1000 0x00, 0x06, 0x98, 0x22, // 00069822
1001 0x00, 0x0A, 0xDF, 0x84, // 000ADF84
1002 0x00, 0x0A, 0xDF, 0x85, // 000ADF85
1003 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
1004 0x00, 0x00, 0x00, 0x00, // 00000000
1005 0x00, 0x06, 0x98, 0x77, // 00069877
1006 0x00, 0x06, 0x98, 0x7A, // 0006987A
1007 0x00, 0x06, 0xB8, 0x68, // 0006B868
1008 0x00, 0x06, 0xB8, 0x69, // 0006B869
1009 0x00, 0x06, 0xB8, 0x6F, // 0006B86F
1010 0x00, 0x06, 0xB8, 0x70, // 0006B870
1011 0x00, 0x06, 0xB8, 0x71, // 0006B871
1012 0x00, 0x06, 0xB8, 0x72, // 0006B872
1013 0x00, 0x06, 0xB8, 0x73, // 0006B873
1014 0x00, 0x06, 0xB8, 0x74, // 0006B874
1015 0x00, 0x06, 0xB8, 0x75, // 0006B875
1016 0x00, 0x00, 0x00, 0x00, // 00000000
1017 0x00, 0x06, 0x28, 0x6A, // 0006286A
1018 0x00, 0x00, 0x00, 0x00, // 00000000
1019 0x00, 0x00, 0x00, 0x00, // 00000000
1020 0x00, 0x00, 0x00, 0x00, // 00000000
1021 0x00, 0x06, 0xA8, 0x61, // 0006A861
1022 0x00, 0x07, 0x65, 0x5D, // 0007655D
1023 0x00, 0x07, 0x24, 0x10, // 00072410
1024 0x00, 0x06, 0x30, 0x6C, // 0006306C
1025 0x00, 0x07, 0x6D, 0x59, // 00076D59
1026 0x00, 0x07, 0x2C, 0x50, // 00072C50
1027 0x00, 0x08, 0xB6, 0x40, // 0008B640
1028 0x00, 0x02, 0x9F, 0x20, // 00029F20
1029 0x00, 0x07, 0x65, 0x05, // 00076505
1030 0x00, 0x07, 0x25, 0x70, // 00072570
1031 0x00, 0x07, 0x6D, 0x15, // 00076D15
1032 0x00, 0x07, 0x2D, 0x60, // 00072D60
1033 0x00, 0x00, 0x00, 0x00, // 00000000
1034 0x00, 0x00, 0x00, 0x00, // 00000000
1035 0x00, 0x06, 0xA0, 0x66, // 0006A066
1036 0x00, 0x06, 0xA8, 0x67, // 0006A867
1037 0x00, 0x07, 0x5C, 0x00, // 00075C00
1038 0x00, 0x07, 0x1C, 0x20, // 00071C20
1039 0x00, 0x07, 0x7C, 0x01, // 00077C01
1040 0x00, 0x07, 0x3D, 0xFF, // 00073DFF
1041 0x00, 0x07, 0x54, 0x00, // 00075400
1042 0x00, 0x07, 0x14, 0x00, // 00071400
1043 0x00, 0x07, 0x4C, 0x01, // 00074C01
1044 0x00, 0x07, 0x0E, 0x00, // 00070E00
1045 0x00, 0x07, 0x74, 0x01, // 00077401
1046 0x00, 0x07, 0x35, 0xFF, // 000735FF
1047 0x00, 0x07, 0x64, 0x00, // 00076400
1048 0x00, 0x07, 0x26, 0x98, // 00072698
1049 0x00, 0x07, 0x6C, 0x01, // 00076C01
1050 0x00, 0x07, 0x2C, 0x90, // 00072C90
1051 0x00, 0x07, 0x44, 0x00, // 00074400
1052 0x00, 0x07, 0x04, 0x90, // 00070490
1053 0x00, 0x07, 0x5C, 0x00, // 00075C00
1054 0x00, 0x07, 0x1C, 0x00, // 00071C00
1055 0x00, 0x06, 0x98, 0x15, // 00069815
1056 0x00, 0x06, 0xB8, 0x16, // 0006B816
1057 0x00, 0x06, 0xB4, 0x14, // 0006B414
1058 0x00, 0x06, 0x88, 0x28, // 00068828
1059 0x00, 0x06, 0x88, 0x22, // 00068822
1060 0x00, 0x06, 0x90, 0x2E, // 0006902E
1061 0x00, 0x06, 0x90, 0x1C, // 0006901C
1062 0x00, 0x06, 0x90, 0x20, // 00069020
1063 0x00, 0x06, 0x9C, 0x1C, // 00069C1C
1064 0x00, 0x06, 0xB4, 0x26, // 0006B426
1065 0x00, 0x06, 0xB4, 0x24, // 0006B424
1066 0x00, 0x06, 0xB4, 0x2E, // 0006B42E
1067 0x00, 0x06, 0xA0, 0x29, // 0006A029
1068 0x00, 0x06, 0xA8, 0x1D, // 0006A81D
1069 0x00, 0x06, 0xA8, 0x21, // 0006A821
1070 0x00, 0x06, 0xA8, 0x2F, // 0006A82F
1071 0x00, 0x06, 0x84, 0x1D, // 0006841D
1072 0x00, 0x08, 0x3F, 0x41, // 00083F41
1073 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1074 0x00, 0x00, 0x00, 0x00, // 00000000
1075 0x00, 0x00, 0x00, 0x00, // 00000000
1076 0x00, 0x01, 0x01, 0x21, // 00010121
1077 0x00, 0x06, 0xB8, 0x6E, // 0006B86E
1078 0x00, 0x07, 0xA8, 0x0F, // 0007A80F
1079 0x00, 0x00, 0x00, 0x00, // 00000000
1080 0x00, 0x06, 0x38, 0x78, // 00063878
1081 0x00, 0x07, 0x44, 0x05, // 00074405
1082 0x00, 0x07, 0x05, 0x89, // 00070589
1083 0x00, 0x07, 0x4C, 0x05, // 00074C05
1084 0x00, 0x07, 0x0D, 0x4B, // 00070D4B
1085 0x00, 0x07, 0x54, 0x05, // 00075405
1086 0x00, 0x07, 0x15, 0x59, // 00071559
1087 0x00, 0x07, 0x5C, 0x05, // 00075C05
1088 0x00, 0x07, 0x1D, 0xBD, // 00071DBD
1089 0x00, 0x08, 0xBF, 0x40, // 0008BF40
1090 0x00, 0x02, 0x9F, 0x40, // 00029F40
1091 0x00, 0x07, 0x44, 0x05, // 00074405
1092 0x00, 0x07, 0x04, 0xC8, // 000704C8
1093 0x00, 0x07, 0x4C, 0x05, // 00074C05
1094 0x00, 0x07, 0x0C, 0xEE, // 00070CEE
1095 0x00, 0x07, 0x54, 0x05, // 00075405
1096 0x00, 0x07, 0x14, 0xF8, // 000714F8
1097 0x00, 0x07, 0x5C, 0x05, // 00075C05
1098 0x00, 0x07, 0x1D, 0x16, // 00071D16
1099 0x00, 0x06, 0x80, 0x09, // 00068009
1100 0x00, 0x06, 0x88, 0x0D, // 0006880D
1101 0x00, 0x06, 0x90, 0x0C, // 0006900C
1102 0x00, 0x06, 0x98, 0x0B, // 0006980B
1103 0x00, 0x07, 0x44, 0x01, // 00074401
1104 0x00, 0x07, 0x06, 0x61, // 00070661
1105 0x00, 0x07, 0x64, 0x00, // 00076400
1106 0x00, 0x07, 0x27, 0x20, // 00072720
1107 0x00, 0x07, 0x4C, 0x00, // 00074C00
1108 0x00, 0x07, 0x0C, 0x00, // 00070C00
1109 0x00, 0x06, 0x80, 0x22, // 00068022
1110 0x00, 0x04, 0x3F, 0x00, // 00043F00
1111 0x00, 0x06, 0x00, 0x78, // 00060078
1112 0x00, 0x0A, 0xFF, 0x44, // 000AFF44
1113 0x00, 0x06, 0xA0, 0x5B, // 0006A05B
1114 0x00, 0x07, 0x64, 0x00, // 00076400
1115 0x00, 0x07, 0x27, 0x00, // 00072700
1116 0x00, 0x07, 0x5C, 0x00, // 00075C00
1117 0x00, 0x07, 0x1C, 0x10, // 00071C10
1118 0x00, 0x08, 0x80, 0x40, // 00088040
1119 0x00, 0x06, 0xA0, 0x5B, // 0006A05B
1120 0x00, 0x02, 0x9E, 0x20, // 00029E20
1121 0x00, 0x07, 0x5C, 0x00, // 00075C00
1122 0x00, 0x07, 0x64, 0x04, // 00076404
1123 0x00, 0x07, 0x24, 0x00, // 00072400
1124 0x00, 0x07, 0x1C, 0x30, // 00071C30
1125 0x00, 0x08, 0x24, 0xC7, // 000824C7
1126 0x00, 0x06, 0x88, 0x4B, // 0006884B
1127 0x00, 0x00, 0x00, 0x00, // 00000000
1128 0x00, 0x06, 0x9C, 0x06, // 00069C06
1129 0x00, 0x06, 0xA0, 0x5B, // 0006A05B
1130 0x00, 0x06, 0xA4, 0x76, // 0006A476
1131 0x00, 0x06, 0x28, 0x77, // 00062877
1132 0x00, 0x07, 0x54, 0x01, // 00075401
1133 0x00, 0x07, 0x16, 0x40, // 00071640
1134 0x00, 0x07, 0x64, 0x00, // 00076400
1135 0x00, 0x07, 0x24, 0x90, // 00072490
1136 0x00, 0x0B, 0x49, 0x7D, // 000B497D
1137 0x00, 0x07, 0x44, 0x01, // 00074401
1138 0x00, 0x07, 0x06, 0x6C, // 0007066C
1139 0x00, 0x06, 0x90, 0x1E, // 0006901E
1140 0x00, 0x06, 0xA0, 0x1F, // 0006A01F
1141 0x00, 0x06, 0x88, 0x14, // 00068814
1142 0x00, 0x06, 0x80, 0x22, // 00068022
1143 0x00, 0x04, 0x0F, 0x08, // 00040F08
1144 0x00, 0x04, 0x17, 0x08, // 00041708
1145 0x00, 0x04, 0x1F, 0x08, // 00041F08
1146 0x00, 0x04, 0x27, 0x08, // 00042708
1147 0x00, 0x08, 0xAD, 0x40, // 0008AD40
1148 0x00, 0x02, 0x9F, 0x20, // 00029F20
1149 0x00, 0x0B, 0x49, 0x40, // 000B4940
1150 0x00, 0x0B, 0x52, 0x40, // 000B5240
1151 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
1152 0x00, 0x0B, 0x64, 0x40, // 000B6440
1153 0x00, 0x07, 0x88, 0x0D, // 0007880D
1154 0x00, 0x07, 0x90, 0x0D, // 0007900D
1155 0x00, 0x07, 0x98, 0x0D, // 0007980D
1156 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1157 0x00, 0x00, 0x00, 0x00, // 00000000
1158 0x00, 0x00, 0xC1, 0x05, // 0000C105
1159 0x00, 0x07, 0x44, 0x04, // 00074404
1160 0x00, 0x07, 0x07, 0x43, // 00070743
1161 0x00, 0x00, 0x00, 0x00, // 00000000
1162 0x00, 0x00, 0x00, 0x00, // 00000000
1163 0x00, 0x00, 0x00, 0x00, // 00000000
1164 0x00, 0x06, 0x80, 0x0F, // 0006800F
1165 0x00, 0x06, 0x38, 0x61, // 00063861
1166 0x00, 0x00, 0x00, 0x00, // 00000000
1167 0x00, 0x08, 0xBF, 0x40, // 0008BF40
1168 0x00, 0x02, 0x9E, 0x10, // 00029E10
1169 0x00, 0x02, 0x13, 0x6E, // 0002136E
1170 0x00, 0x02, 0x81, 0x28, // 00028128
1171 0x00, 0x07, 0x54, 0x00, // 00075400
1172 0x00, 0x07, 0x14, 0x20, // 00071420
1173 0x00, 0x06, 0x18, 0x1C, // 0006181C
1174 0x00, 0x09, 0x12, 0xC0, // 000912C0
1175 0x00, 0x02, 0x86, 0x10, // 00028610
1176 0x00, 0x02, 0x14, 0x14, // 00021414
1177 0x00, 0x02, 0x81, 0x28, // 00028128
1178 0x00, 0x06, 0x10, 0x6E, // 0006106E
1179 0x00, 0x08, 0x9B, 0x44, // 00089B44
1180 0x00, 0x02, 0x86, 0x08, // 00028608
1181 0x00, 0x08, 0x1B, 0xC2, // 00081BC2
1182 0x00, 0x07, 0x45, 0x5D, // 0007455D
1183 0x00, 0x07, 0x04, 0x10, // 00070410
1184 0x00, 0x07, 0x4D, 0x59, // 00074D59
1185 0x00, 0x07, 0x0C, 0x50, // 00070C50
1186 0x00, 0x06, 0x98, 0x1C, // 0006981C
1187 0x00, 0x00, 0xC1, 0x04, // 0000C104
1188 0x00, 0x07, 0x54, 0x04, // 00075404
1189 0x00, 0x07, 0x17, 0x60, // 00071760
1190 0x00, 0x09, 0x80, 0x48, // 00098048
1191 0x00, 0x09, 0x89, 0x78, // 00098978
1192 0x00, 0x08, 0x38, 0xC1, // 000838C1
1193 0x00, 0x06, 0x90, 0x0F, // 0006900F
1194 0x00, 0x08, 0x80, 0x41, // 00088041
1195 0x00, 0x02, 0x9F, 0x10, // 00029F10
1196 0x00, 0x02, 0x14, 0x14, // 00021414
1197 0x00, 0x02, 0x81, 0x28, // 00028128
1198 0x00, 0x07, 0x54, 0x01, // 00075401
1199 0x00, 0x07, 0x16, 0x65, // 00071665
1200 0x00, 0x0B, 0x49, 0x40, // 000B4940
1201 0x00, 0x02, 0x14, 0x14, // 00021414
1202 0x00, 0x00, 0x00, 0x00, // 00000000
1203 0x00, 0x06, 0x90, 0x22, // 00069022
1204 0x00, 0x07, 0x88, 0x03, // 00078803
1205 0x00, 0x00, 0x00, 0x00, // 00000000
1206 0x00, 0x06, 0x88, 0x69, // 00068869
1207 0x00, 0x06, 0x88, 0x61, // 00068861
1208 0x00, 0x06, 0x08, 0x6F, // 0006086F
1209 0x00, 0x0B, 0x52, 0x40, // 000B5240
1210 0x00, 0x08, 0x89, 0x41, // 00088941
1211 0x00, 0x02, 0x9F, 0x10, // 00029F10
1212 0x00, 0x02, 0x13, 0x8B, // 0002138B
1213 0x00, 0x02, 0x81, 0x28, // 00028128
1214 0x00, 0x08, 0x88, 0x42, // 00088842
1215 0x00, 0x02, 0x86, 0x10, // 00028610
1216 0x00, 0x02, 0x14, 0x14, // 00021414
1217 0x00, 0x02, 0x81, 0x28, // 00028128
1218 0x00, 0x00, 0xC1, 0x01, // 0000C101
1219 0x00, 0x07, 0x44, 0x04, // 00074404
1220 0x00, 0x07, 0x07, 0x7F, // 0007077F
1221 0x00, 0x00, 0x00, 0x00, // 00000000
1222 0x00, 0x00, 0x00, 0x00, // 00000000
1223 0x00, 0x06, 0x90, 0x6F, // 0006906F
1224 0x00, 0x06, 0x80, 0x0F, // 0006800F
1225 0x00, 0x06, 0x10, 0x66, // 00061066
1226 0x00, 0x08, 0x90, 0xC2, // 000890C2
1227 0x00, 0x02, 0x9F, 0x10, // 00029F10
1228 0x00, 0x02, 0x16, 0x14, // 00021614
1229 0x00, 0x02, 0x81, 0x28, // 00028128
1230 0x00, 0x06, 0x10, 0x67, // 00061067
1231 0x00, 0x08, 0x91, 0xC2, // 000891C2
1232 0x00, 0x02, 0x9F, 0x10, // 00029F10
1233 0x00, 0x02, 0x16, 0x14, // 00021614
1234 0x00, 0x02, 0x81, 0x28, // 00028128
1235 0x00, 0x02, 0x14, 0x14, // 00021414
1236 0x00, 0x02, 0x81, 0x28, // 00028128
1237 0x00, 0x06, 0x10, 0x76, // 00061076
1238 0x00, 0x06, 0x08, 0x7A, // 0006087A
1239 0x00, 0x0A, 0x00, 0xC2, // 000A00C2
1240 0x00, 0x08, 0x89, 0x40, // 00088940
1241 0x00, 0x02, 0x9F, 0x10, // 00029F10
1242 0x00, 0x02, 0x14, 0x14, // 00021414
1243 0x00, 0x02, 0x81, 0x28, // 00028128
1244 0x00, 0x07, 0x54, 0x00, // 00075400
1245 0x00, 0x07, 0x14, 0x20, // 00071420
1246 0x00, 0x00, 0x00, 0x00, // 00000000
1247 0x00, 0x08, 0x90, 0xC2, // 000890C2
1248 0x00, 0x02, 0x88, 0x10, // 00028810
1249 0x00, 0x02, 0x14, 0x14, // 00021414
1250 0x00, 0x02, 0x81, 0x28, // 00028128
1251 0x00, 0x06, 0x0C, 0x26, // 00060C26
1252 0x00, 0x06, 0x14, 0x1C, // 0006141C
1253 0x00, 0x07, 0x5C, 0x01, // 00075C01
1254 0x00, 0x07, 0x1E, 0x00, // 00071E00
1255 0x00, 0x08, 0x89, 0xC2, // 000889C2
1256 0x00, 0x02, 0x86, 0x08, // 00028608
1257 0x00, 0x08, 0x09, 0xC3, // 000809C3
1258 0x00, 0x06, 0x24, 0x24, // 00062424
1259 0x00, 0x09, 0x22, 0xC4, // 000922C4
1260 0x00, 0x02, 0x86, 0x08, // 00028608
1261 0x00, 0x08, 0x24, 0xC3, // 000824C3
1262 0x00, 0x09, 0x29, 0xC4, // 000929C4
1263 0x00, 0x02, 0x86, 0x08, // 00028608
1264 0x00, 0x08, 0x0C, 0x40, // 00080C40
1265 0x00, 0x06, 0x24, 0x2E, // 0006242E
1266 0x00, 0x09, 0x22, 0xC4, // 000922C4
1267 0x00, 0x02, 0x86, 0x08, // 00028608
1268 0x00, 0x08, 0x24, 0xC3, // 000824C3
1269 0x00, 0x09, 0x29, 0xC4, // 000929C4
1270 0x00, 0x02, 0x86, 0x08, // 00028608
1271 0x00, 0x08, 0x0C, 0x40, // 00080C40
1272 0x00, 0x07, 0x6C, 0x00, // 00076C00
1273 0x00, 0x07, 0x2C, 0x20, // 00072C20
1274 0x00, 0x00, 0x00, 0x00, // 00000000
1275 0x00, 0x08, 0x89, 0xC5, // 000889C5
1276 0x00, 0x02, 0x86, 0x10, // 00028610
1277 0x00, 0x02, 0x14, 0x14, // 00021414
1278 0x00, 0x02, 0x81, 0x28, // 00028128
1279 0x00, 0x00, 0x00, 0x00, // 00000000
1280 0x00, 0x00, 0x00, 0x00, // 00000000
1281 0x00, 0x00, 0x00, 0x00, // 00000000
1282 0x00, 0x0B, 0x6D, 0x70, // 000B6D70
1283 0x00, 0x00, 0x00, 0x00, // 00000000
1284 0x00, 0x00, 0x00, 0x00, // 00000000
1285 0x00, 0x04, 0xB8, 0x0D, // 0004B80D
1286 0x00, 0x06, 0xA8, 0x79, // 0006A879
1287 0x00, 0x09, 0xBF, 0x7C, // 0009BF7C
1288 0x00, 0x00, 0xC1, 0x01, // 0000C101
1289 0x00, 0x07, 0x44, 0x04, // 00074404
1290 0x00, 0x07, 0x07, 0xC5, // 000707C5
1291 0x00, 0x00, 0x00, 0x00, // 00000000
1292 0x00, 0x00, 0x00, 0x00, // 00000000
1293 0x00, 0x00, 0x00, 0x00, // 00000000
1294 0x00, 0x06, 0x80, 0x0F, // 0006800F
1295 0x00, 0x06, 0x18, 0x76, // 00061876
1296 0x00, 0x00, 0x00, 0x00, // 00000000
1297 0x00, 0x08, 0x9B, 0x40, // 00089B40
1298 0x00, 0x02, 0x9F, 0x10, // 00029F10
1299 0x00, 0x08, 0x29, 0x40, // 00082940
1300 0x00, 0x08, 0x08, 0x40, // 00080840
1301 0x00, 0x0C, 0x31, 0x08, // 000C3108
1302 0x00, 0x0E, 0x31, 0x09, // 000E3109
1303 0x00, 0x00, 0x00, 0x00, // 00000000
1304 0x00, 0x06, 0x10, 0x73, // 00061073
1305 0x00, 0x0C, 0x01, 0x08, // 000C0108
1306 0x00, 0x0E, 0x01, 0x09, // 000E0109
1307 0x00, 0x0A, 0xF6, 0x7C, // 000AF67C
1308 0x00, 0x09, 0xA7, 0x7F, // 0009A77F
1309 0x00, 0x02, 0x82, 0x08, // 00028208
1310 0x00, 0x08, 0x36, 0x42, // 00083642
1311 0x00, 0x0A, 0xC0, 0x7C, // 000AC07C
1312 0x00, 0x09, 0xBF, 0x7F, // 0009BF7F
1313 0x00, 0x02, 0x82, 0x08, // 00028208
1314 0x00, 0x08, 0x00, 0x42, // 00080042
1315 0x00, 0x06, 0x20, 0x79, // 00062079
1316 0x00, 0x08, 0x12, 0x42, // 00081242
1317 0x00, 0x08, 0xA4, 0x41, // 0008A441
1318 0x00, 0x07, 0xF4, 0x0C, // 0007F40C
1319 0x00, 0x07, 0xC4, 0x0C, // 0007C40C
1320 0x00, 0x02, 0x9F, 0x50, // 00029F50
1321 0x00, 0x06, 0x90, 0x73, // 00069073
1322 0x00, 0x06, 0xA0, 0x79, // 0006A079
1323 0x00, 0x08, 0x9B, 0x41, // 00089B41
1324 0x00, 0x02, 0x87, 0x20, // 00028720
1325 0x00, 0x08, 0x0D, 0x40, // 00080D40
1326 0x00, 0x08, 0x05, 0x40, // 00080540
1327 0x00, 0x02, 0x13, 0xCB, // 000213CB
1328 0x00, 0x02, 0x81, 0x28, // 00028128
1329 0x00, 0x02, 0x13, 0xBE, // 000213BE
1330 0x00, 0x02, 0x81, 0x28, // 00028128
1331 0x00, 0x06, 0x00, 0x74, // 00060074
1332 0x00, 0x06, 0x0C, 0x1C, // 00060C1C
1333 0x00, 0x07, 0x54, 0x01, // 00075401
1334 0x00, 0x07, 0x14, 0x80, // 00071480
1335 0x00, 0x08, 0x80, 0x40, // 00088040
1336 0x00, 0x02, 0x9E, 0x48, // 00029E48
1337 0x00, 0x08, 0x91, 0xC2, // 000891C2
1338 0x00, 0x02, 0x89, 0x38, // 00028938
1339 0x00, 0x02, 0x15, 0xDB, // 000215DB
1340 0x00, 0x07, 0x44, 0x04, // 00074404
1341 0x00, 0x07, 0x07, 0xF8, // 000707F8
1342 0x00, 0x00, 0x00, 0x00, // 00000000
1343 0x00, 0x00, 0x00, 0x00, // 00000000
1344 0x00, 0x00, 0x00, 0x00, // 00000000
1345 0x00, 0x06, 0x80, 0x0E, // 0006800E
1346 0x00, 0x02, 0x16, 0x52, // 00021652
1347 0x00, 0x07, 0x4C, 0x04, // 00074C04
1348 0x00, 0x07, 0x0F, 0xFF, // 00070FFF
1349 0x00, 0x00, 0x00, 0x00, // 00000000
1350 0x00, 0x00, 0x00, 0x00, // 00000000
1351 0x00, 0x00, 0x00, 0x00, // 00000000
1352 0x00, 0x06, 0x88, 0x0F, // 0006880F
1353 0x00, 0x06, 0x00, 0x69, // 00060069
1354 0x00, 0x07, 0x4C, 0x01, // 00074C01
1355 0x00, 0x07, 0x0E, 0x65, // 00070E65
1356 0x00, 0x08, 0x00, 0x41, // 00080041
1357 0x00, 0x07, 0x54, 0x00, // 00075400
1358 0x00, 0x07, 0x14, 0x20, // 00071420
1359 0x00, 0x06, 0x18, 0x76, // 00061876
1360 0x00, 0x0A, 0x12, 0xC3, // 000A12C3
1361 0x00, 0x06, 0x88, 0x22, // 00068822
1362 0x00, 0x08, 0x92, 0x41, // 00089241
1363 0x00, 0x0A, 0xC0, 0xC2, // 000AC0C2
1364 0x00, 0x04, 0x0F, 0x00, // 00040F00
1365 0x00, 0x02, 0x9F, 0x10, // 00029F10
1366 0x00, 0x02, 0x14, 0x14, // 00021414
1367 0x00, 0x02, 0x81, 0x28, // 00028128
1368 0x00, 0x08, 0x09, 0x41, // 00080941
1369 0x00, 0x06, 0x00, 0x6A, // 0006006A
1370 0x00, 0x00, 0x00, 0x00, // 00000000
1371 0x00, 0x06, 0x80, 0x69, // 00068069
1372 0x00, 0x07, 0x88, 0x07, // 00078807
1373 0x00, 0x06, 0x80, 0x6F, // 0006806F
1374 0x00, 0x00, 0xC1, 0x03, // 0000C103
1375 0x00, 0x07, 0x44, 0x05, // 00074405
1376 0x00, 0x07, 0x04, 0x1B, // 0007041B
1377 0x00, 0x00, 0x00, 0x00, // 00000000
1378 0x00, 0x00, 0x00, 0x00, // 00000000
1379 0x00, 0x00, 0x00, 0x00, // 00000000
1380 0x00, 0x06, 0x80, 0x0F, // 0006800F
1381 0x00, 0x06, 0x04, 0x26, // 00060426
1382 0x00, 0x06, 0x28, 0x7A, // 0006287A
1383 0x00, 0x06, 0x38, 0x7A, // 0006387A
1384 0x00, 0x06, 0x0C, 0x1C, // 00060C1C
1385 0x00, 0x07, 0x54, 0x01, // 00075401
1386 0x00, 0x07, 0x16, 0x00, // 00071600
1387 0x00, 0x06, 0x18, 0x70, // 00061870
1388 0x00, 0x08, 0x80, 0xC1, // 000880C1
1389 0x00, 0x02, 0x86, 0x08, // 00028608
1390 0x00, 0x08, 0x00, 0xC2, // 000800C2
1391 0x00, 0x07, 0x74, 0x00, // 00077400
1392 0x00, 0x07, 0x34, 0x40, // 00073440
1393 0x00, 0x06, 0x08, 0x74, // 00060874
1394 0x00, 0x08, 0xA5, 0x41, // 0008A541
1395 0x00, 0x02, 0x9E, 0x30, // 00029E30
1396 0x00, 0x08, 0x89, 0x40, // 00088940
1397 0x00, 0x02, 0x9F, 0x20, // 00029F20
1398 0x00, 0x08, 0xA0, 0xC6, // 0008A0C6
1399 0x00, 0x02, 0x88, 0x10, // 00028810
1400 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1401 0x00, 0x02, 0x81, 0x80, // 00028180
1402 0x00, 0x08, 0x89, 0x40, // 00088940
1403 0x00, 0x02, 0x9F, 0x70, // 00029F70
1404 0x00, 0x07, 0x64, 0x00, // 00076400
1405 0x00, 0x07, 0x24, 0x21, // 00072421
1406 0x00, 0x08, 0x93, 0xC0, // 000893C0
1407 0x00, 0x06, 0x80, 0x70, // 00068070
1408 0x00, 0x06, 0xA8, 0x7A, // 0006A87A
1409 0x00, 0x08, 0x94, 0xC2, // 000894C2
1410 0x00, 0x02, 0x88, 0x10, // 00028810
1411 0x00, 0x02, 0x16, 0x11, // 00021611
1412 0x00, 0x07, 0x44, 0x05, // 00074405
1413 0x00, 0x07, 0x04, 0x40, // 00070440
1414 0x00, 0x00, 0x00, 0x00, // 00000000
1415 0x00, 0x00, 0x00, 0x00, // 00000000
1416 0x00, 0x00, 0x00, 0x00, // 00000000
1417 0x00, 0x06, 0x80, 0x0F, // 0006800F
1418 0x00, 0x07, 0x44, 0x01, // 00074401
1419 0x00, 0x07, 0x06, 0x61, // 00070661
1420 0x00, 0x07, 0x4C, 0x00, // 00074C00
1421 0x00, 0x07, 0x0C, 0x01, // 00070C01
1422 0x00, 0x00, 0x00, 0x00, // 00000000
1423 0x00, 0x06, 0x80, 0x22, // 00068022
1424 0x00, 0x04, 0x07, 0x00, // 00040700
1425 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
1426 0x00, 0x02, 0x9F, 0x10, // 00029F10
1427 0x00, 0x08, 0x80, 0x41, // 00088041
1428 0x00, 0x02, 0x81, 0x10, // 00028110
1429 0x00, 0x02, 0x14, 0xAC, // 000214AC
1430 0x00, 0x02, 0x81, 0x28, // 00028128
1431 0x00, 0x07, 0x80, 0x07, // 00078007
1432 0x00, 0x07, 0x44, 0x01, // 00074401
1433 0x00, 0x07, 0x06, 0x61, // 00070661
1434 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
1435 0x00, 0x07, 0x0C, 0x00, // 00070C00
1436 0x00, 0x00, 0x00, 0x00, // 00000000
1437 0x00, 0x06, 0x80, 0x22, // 00068022
1438 0x00, 0x0A, 0xC7, 0x81, // 000AC781
1439 0x00, 0x02, 0x9E, 0x10, // 00029E10
1440 0x00, 0x02, 0x14, 0xC1, // 000214C1
1441 0x00, 0x02, 0x81, 0x28, // 00028128
1442 0x00, 0x07, 0x44, 0x01, // 00074401
1443 0x00, 0x07, 0x06, 0x69, // 00070669
1444 0x00, 0x07, 0x4C, 0x00, // 00074C00
1445 0x00, 0x07, 0x0C, 0x01, // 00070C01
1446 0x00, 0x07, 0x44, 0x01, // 00074401
1447 0x00, 0x07, 0x06, 0x6C, // 0007066C
1448 0x00, 0x06, 0x80, 0x22, // 00068022
1449 0x00, 0x06, 0x10, 0x7A, // 0006107A
1450 0x00, 0x06, 0x18, 0x77, // 00061877
1451 0x00, 0x04, 0x25, 0x08, // 00042508
1452 0x00, 0x04, 0x2D, 0x08, // 00042D08
1453 0x00, 0x04, 0x35, 0x08, // 00043508
1454 0x00, 0x04, 0x3D, 0x08, // 00043D08
1455 0x00, 0x0A, 0xCF, 0x81, // 000ACF81
1456 0x00, 0x02, 0x9F, 0x70, // 00029F70
1457 0x00, 0x06, 0x0C, 0x6A, // 00060C6A
1458 0x00, 0x08, 0x9B, 0x40, // 00089B40
1459 0x00, 0x02, 0x9E, 0x50, // 00029E50
1460 0x00, 0x08, 0x92, 0x40, // 00089240
1461 0x00, 0x02, 0x9F, 0x30, // 00029F30
1462 0x00, 0x0B, 0x49, 0x41, // 000B4941
1463 0x00, 0x0B, 0x64, 0x40, // 000B6440
1464 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1465 0x00, 0x0B, 0x76, 0x40, // 000B7640
1466 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
1467 0x00, 0x02, 0x81, 0x08, // 00028108
1468 0x00, 0x06, 0x0C, 0x65, // 00060C65
1469 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
1470 0x00, 0x02, 0x81, 0x70, // 00028170
1471 0x00, 0x06, 0x80, 0x22, // 00068022
1472 0x00, 0x06, 0x0C, 0x6A, // 00060C6A
1473 0x00, 0x08, 0x9B, 0x40, // 00089B40
1474 0x00, 0x02, 0x9F, 0x50, // 00029F50
1475 0x00, 0x08, 0x92, 0x40, // 00089240
1476 0x00, 0x02, 0x9F, 0x30, // 00029F30
1477 0x00, 0x0B, 0x49, 0x41, // 000B4941
1478 0x00, 0x04, 0x27, 0x08, // 00042708
1479 0x00, 0x04, 0x2F, 0x08, // 00042F08
1480 0x00, 0x04, 0x37, 0x08, // 00043708
1481 0x00, 0x04, 0x3F, 0x08, // 00043F08
1482 0x00, 0x02, 0x81, 0x08, // 00028108
1483 0x00, 0x06, 0x0C, 0x65, // 00060C65
1484 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
1485 0x00, 0x06, 0x04, 0x6A, // 0006046A
1486 0x00, 0x06, 0x14, 0x65, // 00061465
1487 0x00, 0x09, 0x00, 0xC2, // 000900C2
1488 0x00, 0x08, 0x11, 0x41, // 00081141
1489 0x00, 0x02, 0x9F, 0x18, // 00029F18
1490 0x00, 0x08, 0x10, 0x41, // 00081041
1491 0x00, 0x02, 0x9F, 0x08, // 00029F08
1492 0x00, 0x08, 0x08, 0x40, // 00080840
1493 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1494 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
1495 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
1496 0x00, 0x06, 0x8C, 0x6A, // 00068C6A
1497 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
1498 0x00, 0x06, 0x98, 0x77, // 00069877
1499 0x00, 0x07, 0x44, 0x01, // 00074401
1500 0x00, 0x07, 0x06, 0x69, // 00070669
1501 0x00, 0x07, 0x4C, 0x00, // 00074C00
1502 0x00, 0x07, 0x0C, 0x02, // 00070C02
1503 0x00, 0x06, 0x10, 0x7A, // 0006107A
1504 0x00, 0x06, 0x80, 0x22, // 00068022
1505 0x00, 0x0A, 0xC3, 0x81, // 000AC381
1506 0x00, 0x02, 0x9F, 0x58, // 00029F58
1507 0x00, 0x08, 0x92, 0x40, // 00089240
1508 0x00, 0x02, 0x9E, 0x40, // 00029E40
1509 0x00, 0x0B, 0x52, 0x7E, // 000B527E
1510 0x00, 0x02, 0x16, 0x2E, // 0002162E
1511 0x00, 0x07, 0x44, 0x05, // 00074405
1512 0x00, 0x07, 0x04, 0xAC, // 000704AC
1513 0x00, 0x06, 0x90, 0x7A, // 0006907A
1514 0x00, 0x00, 0x00, 0x00, // 00000000
1515 0x00, 0x00, 0x00, 0x00, // 00000000
1516 0x00, 0x06, 0x80, 0x0F, // 0006800F
1517 0x00, 0x02, 0x81, 0x18, // 00028118
1518 0x00, 0x08, 0x9A, 0x42, // 00089A42
1519 0x00, 0x02, 0x9E, 0x08, // 00029E08
1520 0x00, 0x0B, 0x52, 0x7F, // 000B527F
1521 0x00, 0x00, 0x00, 0x00, // 00000000
1522 0x00, 0x00, 0x00, 0x00, // 00000000
1523 0x00, 0x00, 0x00, 0x00, // 00000000
1524 0x00, 0x06, 0x90, 0x7A, // 0006907A
1525 0x00, 0x00, 0x00, 0x00, // 00000000
1526 0x00, 0x06, 0x00, 0x6D, // 0006006D
1527 0x00, 0x00, 0x00, 0x00, // 00000000
1528 0x00, 0x08, 0x80, 0x41, // 00088041
1529 0x00, 0x00, 0x00, 0x00, // 00000000
1530 0x00, 0x00, 0x00, 0x00, // 00000000
1531 0x00, 0x00, 0x00, 0x00, // 00000000
1532 0x00, 0x06, 0xC0, 0x6D, // 0006C06D
1533 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
1534 0x00, 0x07, 0x6C, 0x05, // 00076C05
1535 0x00, 0x07, 0x2C, 0xBA, // 00072CBA
1536 0x00, 0x00, 0x00, 0x00, // 00000000
1537 0x00, 0x00, 0x00, 0x00, // 00000000
1538 0x00, 0x00, 0x00, 0x00, // 00000000
1539 0x00, 0x00, 0x00, 0x00, // 00000000
1540 0x00, 0x02, 0x13, 0x3B, // 0002133B
1541 0x00, 0x02, 0x81, 0x28, // 00028128
1542 0x00, 0x00, 0x00, 0x00, // 00000000
1543 0x00, 0x00, 0x00, 0x00, // 00000000
1544 0x00, 0x00, 0x00, 0x00, // 00000000
1545 0x00, 0x00, 0x00, 0x00, // 00000000
1546 0x00, 0x00, 0x00, 0x00, // 00000000
1547 0x00, 0x00, 0xC1, 0x80, // 0000C180
1548 0x00, 0x00, 0x00, 0x00, // 00000000
1549 0x00, 0x00, 0x00, 0x00, // 00000000
1550 0x00, 0x00, 0x00, 0x00, // 00000000
1551 0x00, 0x00, 0x00, 0x00, // 00000000
1552 0x00, 0x00, 0x00, 0x00, // 00000000
1553 0x00, 0x00, 0x00, 0x00, // 00000000
1554 0x00, 0x06, 0x10, 0x68, // 00061068
1555 0x00, 0x04, 0x04, 0x08, // 00040408
1556 0x00, 0x08, 0x92, 0x40, // 00089240
1557 0x00, 0x02, 0x9E, 0x08, // 00029E08
1558 0x00, 0x02, 0x14, 0xDD, // 000214DD
1559 0x00, 0x06, 0x28, 0x6C, // 0006286C
1560 0x00, 0x04, 0x0C, 0x08, // 00040C08
1561 0x00, 0x07, 0x64, 0x3F, // 0007643F
1562 0x00, 0x07, 0x27, 0xFF, // 000727FF
1563 0x00, 0x00, 0x00, 0x00, // 00000000
1564 0x00, 0x09, 0xA4, 0x44, // 0009A444
1565 0x00, 0x04, 0x14, 0x00, // 00041400
1566 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1567 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1568 0x00, 0x0A, 0xD2, 0xC4, // 000AD2C4
1569 0x00, 0x09, 0x80, 0x48, // 00098048
1570 0x00, 0x09, 0xB1, 0x78, // 0009B178
1571 0x00, 0x08, 0x00, 0xC6, // 000800C6
1572 0x00, 0x09, 0x89, 0x48, // 00098948
1573 0x00, 0x09, 0xB2, 0x78, // 0009B278
1574 0x00, 0x08, 0x09, 0xC6, // 000809C6
1575 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1576 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1577 0x00, 0x08, 0xAD, 0x40, // 0008AD40
1578 0x00, 0x02, 0x9F, 0x30, // 00029F30
1579 0x00, 0x09, 0x90, 0x48, // 00099048
1580 0x00, 0x09, 0xB0, 0x78, // 0009B078
1581 0x00, 0x08, 0x02, 0xC6, // 000802C6
1582 0x00, 0x09, 0x91, 0x48, // 00099148
1583 0x00, 0x09, 0xB1, 0x78, // 0009B178
1584 0x00, 0x08, 0x0A, 0xC6, // 00080AC6
1585 0x00, 0x00, 0xC1, 0x07, // 0000C107
1586 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1587 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1588 0x00, 0x00, 0x00, 0x00, // 00000000
1589 0x00, 0x00, 0x00, 0x00, // 00000000
1590 0x00, 0x00, 0x00, 0x00, // 00000000
1591 0x00, 0x00, 0x00, 0x00, // 00000000
1592 0x00, 0x06, 0x18, 0x68, // 00061868
1593 0x00, 0x06, 0x00, 0x1C, // 0006001C
1594 0x00, 0x09, 0x9B, 0x7D, // 00099B7D
1595 0x00, 0x00, 0xC1, 0x07, // 0000C107
1596 0x00, 0x06, 0x08, 0x20, // 00060820
1597 0x00, 0x06, 0x10, 0x6E, // 0006106E
1598 0x00, 0x08, 0x81, 0xC0, // 000881C0
1599 0x00, 0x09, 0x03, 0xC0, // 000903C0
1600 0x00, 0x02, 0x86, 0x08, // 00028608
1601 0x00, 0x08, 0x00, 0xC2, // 000800C2
1602 0x00, 0x0B, 0x40, 0x7F, // 000B407F
1603 0x00, 0x01, 0x0A, 0x20, // 00010A20
1604 0x00, 0x0B, 0x49, 0x7F, // 000B497F
1605 0x00, 0x04, 0x14, 0x00, // 00041400
1606 0x00, 0x0B, 0x76, 0x78, // 000B7678
1607 0x00, 0x09, 0x92, 0x48, // 00099248
1608 0x00, 0x09, 0x89, 0x48, // 00098948
1609 0x00, 0x09, 0x9A, 0x68, // 00099A68
1610 0x00, 0x08, 0x09, 0xC3, // 000809C3
1611 0x00, 0x08, 0x9F, 0xC1, // 00089FC1
1612 0x00, 0x02, 0x9E, 0x08, // 00029E08
1613 0x00, 0x00, 0xC1, 0x87, // 0000C187
1614 0x00, 0x06, 0xB0, 0x68, // 0006B068
1615 0x00, 0x09, 0x92, 0x48, // 00099248
1616 0x00, 0x09, 0x89, 0x48, // 00098948
1617 0x00, 0x09, 0x9A, 0x68, // 00099A68
1618 0x00, 0x08, 0x09, 0xC3, // 000809C3
1619 0x00, 0x0B, 0x76, 0x40, // 000B7640
1620 0x00, 0x04, 0x14, 0x08, // 00041408
1621 0x00, 0x08, 0x9F, 0xC1, // 00089FC1
1622 0x00, 0x02, 0x9E, 0x08, // 00029E08
1623 0x00, 0x00, 0xC1, 0x87, // 0000C187
1624 0x00, 0x06, 0xB0, 0x68, // 0006B068
1625 0x00, 0x00, 0xC1, 0x07, // 0000C107
1626 0x00, 0x0B, 0x40, 0x40, // 000B4040
1627 0x00, 0x00, 0x00, 0x00, // 00000000
1628 0x00, 0x00, 0x00, 0x00, // 00000000
1629 0x00, 0x00, 0x00, 0x00, // 00000000
1630 0x00, 0x00, 0x00, 0x00, // 00000000
1631 0x00, 0x00, 0x00, 0x00, // 00000000
1632 0x00, 0x06, 0x30, 0x71, // 00063071
1633 0x00, 0x07, 0x44, 0x01, // 00074401
1634 0x00, 0x08, 0xB6, 0x40, // 0008B640
1635 0x00, 0x02, 0x9E, 0x08, // 00029E08
1636 0x00, 0x02, 0x15, 0x31, // 00021531
1637 0x00, 0x06, 0x18, 0x7A, // 0006187A
1638 0x00, 0x06, 0x30, 0x72, // 00063072
1639 0x00, 0x07, 0x06, 0x00, // 00070600
1640 0x00, 0x06, 0x08, 0x28, // 00060828
1641 0x00, 0x08, 0x38, 0x41, // 00083841
1642 0x00, 0x08, 0x90, 0xC1, // 000890C1
1643 0x00, 0x02, 0x9F, 0x08, // 00029F08
1644 0x00, 0x00, 0xC1, 0x87, // 0000C187
1645 0x00, 0x07, 0x54, 0x03, // 00075403
1646 0x00, 0x07, 0x17, 0xF0, // 000717F0
1647 0x00, 0x06, 0xB8, 0x22, // 0006B822
1648 0x00, 0x01, 0x04, 0x90, // 00010490
1649 0x00, 0x09, 0x92, 0x48, // 00099248
1650 0x00, 0x0A, 0xE7, 0x8A, // 000AE78A
1651 0x00, 0x0A, 0xEF, 0x8A, // 000AEF8A
1652 0x00, 0x08, 0x36, 0x41, // 00083641
1653 0x00, 0x09, 0xAD, 0x78, // 0009AD78
1654 0x00, 0x08, 0x24, 0xC5, // 000824C5
1655 0x00, 0x00, 0x00, 0x00, // 00000000
1656 0x00, 0x00, 0x00, 0x00, // 00000000
1657 0x00, 0x06, 0xB0, 0x72, // 0006B072
1658 0x00, 0x07, 0xE0, 0x0E, // 0007E00E
1659 0x00, 0x0B, 0x76, 0x40, // 000B7640
1660 0x00, 0x08, 0x9B, 0x40, // 00089B40
1661 0x00, 0x02, 0x9F, 0x08, // 00029F08
1662 0x00, 0x00, 0xC1, 0x87, // 0000C187
1663 0x00, 0x06, 0xB0, 0x71, // 0006B071
1664 0x00, 0x06, 0x08, 0x20, // 00060820
1665 0x00, 0x06, 0x00, 0x1C, // 0006001C
1666 0x00, 0x06, 0x10, 0x6E, // 0006106E
1667 0x00, 0x08, 0x81, 0xC0, // 000881C0
1668 0x00, 0x02, 0x86, 0x08, // 00028608
1669 0x00, 0x08, 0x00, 0xC2, // 000800C2
1670 0x00, 0x07, 0x5C, 0x01, // 00075C01
1671 0x00, 0x07, 0x1D, 0xE8, // 00071DE8
1672 0x00, 0x0B, 0x76, 0x7F, // 000B767F
1673 0x00, 0x08, 0x93, 0xC0, // 000893C0
1674 0x00, 0x02, 0x88, 0x08, // 00028808
1675 0x00, 0x00, 0xC1, 0x87, // 0000C187
1676 0x00, 0x07, 0x44, 0x00, // 00074400
1677 0x00, 0x07, 0x05, 0x38, // 00070538
1678 0x00, 0x00, 0xC1, 0x07, // 0000C107
1679 0x00, 0x00, 0x00, 0x00, // 00000000
1680 0x00, 0x00, 0x00, 0x00, // 00000000
1681 0x00, 0x00, 0x00, 0x00, // 00000000
1682 0x00, 0x06, 0xB0, 0x71, // 0006B071
1683 0x00, 0x06, 0xB8, 0x28, // 0006B828
1684 0x00, 0x06, 0x80, 0x4B, // 0006804B
1685 0x00, 0x06, 0x00, 0x1C, // 0006001C
1686 0x00, 0x06, 0x08, 0x20, // 00060820
1687 0x00, 0x06, 0x10, 0x6E, // 0006106E
1688 0x00, 0x08, 0x81, 0xC0, // 000881C0
1689 0x00, 0x02, 0x86, 0x08, // 00028608
1690 0x00, 0x08, 0x00, 0xC2, // 000800C2
1691 0x00, 0x06, 0x18, 0x68, // 00061868
1692 0x00, 0x00, 0xC1, 0x07, // 0000C107
1693 0x00, 0x0A, 0x10, 0x44, // 000A1044
1694 0x00, 0x0A, 0x20, 0x42, // 000A2042
1695 0x00, 0x08, 0x12, 0xC4, // 000812C4
1696 0x00, 0x09, 0x03, 0xC2, // 000903C2
1697 0x00, 0x00, 0x00, 0x00, // 00000000
1698 0x00, 0x0A, 0x00, 0x7C, // 000A007C
1699 0x00, 0x07, 0x44, 0x00, // 00074400
1700 0x00, 0x07, 0x04, 0x20, // 00070420
1701 0x00, 0x07, 0x54, 0x05, // 00075405
1702 0x00, 0x07, 0x15, 0x7C, // 0007157C
1703 0x00, 0x0B, 0x49, 0x41, // 000B4941
1704 0x00, 0x0B, 0x64, 0x7F, // 000B647F
1705 0x00, 0x0B, 0x5B, 0x78, // 000B5B78
1706 0x00, 0x09, 0xA4, 0x7C, // 0009A47C
1707 0x00, 0x06, 0x90, 0x0A, // 0006900A
1708 0x00, 0x0B, 0x76, 0x40, // 000B7640
1709 0x00, 0x09, 0x94, 0x83, // 00099483
1710 0x00, 0x08, 0x36, 0x41, // 00083641
1711 0x00, 0x09, 0x89, 0x41, // 00098941
1712 0x00, 0x09, 0x92, 0x41, // 00099241
1713 0x00, 0x02, 0x82, 0x08, // 00028208
1714 0x00, 0x08, 0x09, 0xC4, // 000809C4
1715 0x00, 0x01, 0x04, 0x13, // 00010413
1716 0x00, 0x08, 0xAF, 0xC1, // 0008AFC1
1717 0x00, 0x02, 0x9E, 0x08, // 00029E08
1718 0x00, 0x00, 0xC1, 0x82, // 0000C182
1719 0x00, 0x08, 0x36, 0x41, // 00083641
1720 0x00, 0x09, 0x89, 0x41, // 00098941
1721 0x00, 0x09, 0x92, 0x41, // 00099241
1722 0x00, 0x02, 0x82, 0x08, // 00028208
1723 0x00, 0x08, 0x09, 0xC4, // 000809C4
1724 0x00, 0x08, 0xAF, 0xC1, // 0008AFC1
1725 0x00, 0x02, 0x9E, 0x08, // 00029E08
1726 0x00, 0x00, 0xC1, 0x82, // 0000C182
1727 0x00, 0x04, 0x2C, 0x08, // 00042C08
1728 0x00, 0x08, 0x80, 0x41, // 00088041
1729 0x00, 0x02, 0x9F, 0x10, // 00029F10
1730 0x00, 0x02, 0x15, 0x62, // 00021562
1731 0x00, 0x02, 0x81, 0x28, // 00028128
1732 0x00, 0x0B, 0x40, 0x40, // 000B4040
1733 0x00, 0x02, 0x81, 0x08, // 00028108
1734 0x00, 0x0B, 0x40, 0x7F, // 000B407F
1735 0x00, 0x08, 0xAE, 0x54, // 0008AE54
1736 0x00, 0x02, 0x9F, 0x10, // 00029F10
1737 0x00, 0x00, 0xC1, 0x87, // 0000C187
1738 0x00, 0x02, 0x81, 0x28, // 00028128
1739 0x00, 0x0B, 0x76, 0x40, // 000B7640
1740 0x00, 0x00, 0xC1, 0x87, // 0000C187
1741 0x00, 0x00, 0x00, 0x00, // 00000000
1742 0x00, 0x00, 0x00, 0x00, // 00000000
1743 0x00, 0x06, 0xB0, 0x68, // 0006B068
1744 0x00, 0x04, 0x34, 0x08, // 00043408
1745 0x00, 0x00, 0x00, 0x00, // 00000000
1746 0x00, 0x00, 0x00, 0x00, // 00000000
1747 0x00, 0x06, 0x10, 0x68, // 00061068
1748 0x00, 0x00, 0x00, 0x00, // 00000000
1749 0x00, 0x08, 0x82, 0x47, // 00088247
1750 0x00, 0x02, 0x88, 0x08, // 00028808
1751 0x00, 0x02, 0x15, 0x96, // 00021596
1752 0x00, 0x0B, 0x64, 0x41, // 000B6441
1753 0x00, 0x08, 0x9A, 0x54, // 00089A54
1754 0x00, 0x09, 0xA4, 0x78, // 0009A478
1755 0x00, 0x0A, 0xEC, 0x8C, // 000AEC8C
1756 0x00, 0x0A, 0xE4, 0x7F, // 000AE47F
1757 0x00, 0x0A, 0xF4, 0x84, // 000AF484
1758 0x00, 0x0A, 0xF4, 0x8C, // 000AF48C
1759 0x00, 0x0A, 0xCC, 0x84, // 000ACC84
1760 0x00, 0x07, 0x64, 0x3F, // 0007643F
1761 0x00, 0x07, 0x27, 0xFF, // 000727FF
1762 0x00, 0x00, 0x00, 0x00, // 00000000
1763 0x00, 0x09, 0xA4, 0x44, // 0009A444
1764 0x00, 0x09, 0x85, 0xC2, // 000985C2
1765 0x00, 0x09, 0x86, 0xC3, // 000986C3
1766 0x00, 0x08, 0x00, 0xC0, // 000800C0
1767 0x00, 0x08, 0x12, 0x50, // 00081250
1768 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1769 0x00, 0x08, 0x9A, 0x54, // 00089A54
1770 0x00, 0x02, 0x87, 0x18, // 00028718
1771 0x00, 0x08, 0x92, 0x54, // 00089254
1772 0x00, 0x08, 0x2E, 0x40, // 00082E40
1773 0x00, 0x08, 0x31, 0x40, // 00083140
1774 0x00, 0x08, 0x9A, 0x54, // 00089A54
1775 0x00, 0x09, 0x8D, 0xC2, // 00098DC2
1776 0x00, 0x09, 0x8E, 0xC3, // 00098EC3
1777 0x00, 0x08, 0x09, 0xC1, // 000809C1
1778 0x00, 0x08, 0x12, 0x50, // 00081250
1779 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1780 0x00, 0x08, 0x9A, 0x54, // 00089A54
1781 0x00, 0x02, 0x87, 0x08, // 00028708
1782 0x00, 0x08, 0x92, 0x54, // 00089254
1783 0x00, 0x06, 0x28, 0x6C, // 0006286C
1784 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1785 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1786 0x00, 0x06, 0x90, 0x68, // 00069068
1787 0x00, 0x08, 0xAD, 0x40, // 0008AD40
1788 0x00, 0x02, 0x9F, 0x30, // 00029F30
1789 0x00, 0x09, 0x90, 0x48, // 00099048
1790 0x00, 0x09, 0xB0, 0x78, // 0009B078
1791 0x00, 0x08, 0x02, 0xC6, // 000802C6
1792 0x00, 0x09, 0x91, 0x48, // 00099148
1793 0x00, 0x09, 0xB1, 0x78, // 0009B178
1794 0x00, 0x08, 0x0A, 0xC6, // 00080AC6
1795 0x00, 0x00, 0xC1, 0x07, // 0000C107
1796 0x00, 0x0A, 0xC0, 0xC4, // 000AC0C4
1797 0x00, 0x0A, 0xC9, 0xC4, // 000AC9C4
1798 0x00, 0x02, 0x81, 0x18, // 00028118
1799 0x00, 0x07, 0x7C, 0x01, // 00077C01
1800 0x00, 0x07, 0x3C, 0xC0, // 00073CC0
1801 0x00, 0x07, 0x74, 0x01, // 00077401
1802 0x00, 0x07, 0x35, 0x60, // 00073560
1803 0x00, 0x06, 0x20, 0x2E, // 0006202E
1804 0x00, 0x06, 0x18, 0x1C, // 0006181C
1805 0x00, 0x06, 0x10, 0x6E, // 0006106E
1806 0x00, 0x06, 0x00, 0x75, // 00060075
1807 0x00, 0x06, 0x08, 0x7A, // 0006087A
1808 0x00, 0x06, 0xA0, 0x20, // 0006A020
1809 0x00, 0x08, 0x9C, 0xC3, // 00089CC3
1810 0x00, 0x02, 0x86, 0x08, // 00028608
1811 0x00, 0x08, 0x1B, 0xC2, // 00081BC2
1812 0x00, 0x09, 0x16, 0xC3, // 000916C3
1813 0x00, 0x02, 0x89, 0x10, // 00028910
1814 0x00, 0x07, 0x44, 0x00, // 00074400
1815 0x00, 0x07, 0x04, 0x30, // 00070430
1816 0x00, 0x08, 0x89, 0x40, // 00088940
1817 0x00, 0x02, 0x9E, 0x20, // 00029E20
1818 0x00, 0x08, 0x97, 0xC3, // 000897C3
1819 0x00, 0x02, 0x89, 0x10, // 00028910
1820 0x00, 0x07, 0x44, 0x00, // 00074400
1821 0x00, 0x07, 0x04, 0x70, // 00070470
1822 0x00, 0x00, 0xC1, 0x07, // 0000C107
1823 0x00, 0x00, 0x00, 0x00, // 00000000
1824 0x00, 0x00, 0x00, 0x00, // 00000000
1825 0x00, 0x06, 0x98, 0x7F, // 0006987F
1826 0x00, 0x06, 0x84, 0x06, // 00068406
1827 0x00, 0x06, 0x80, 0x75, // 00068075
1828 0x00, 0x00, 0x00, 0x00, // 00000000
1829 0x00, 0x02, 0x15, 0xFC, // 000215FC
1830 0x00, 0x07, 0x4C, 0x05, // 00074C05
1831 0x00, 0x07, 0x0D, 0xE2, // 00070DE2
1832 0x00, 0x00, 0x00, 0x00, // 00000000
1833 0x00, 0x00, 0x00, 0x00, // 00000000
1834 0x00, 0x00, 0x00, 0x00, // 00000000
1835 0x00, 0x06, 0x88, 0x0F, // 0006880F
1836 0x00, 0x07, 0x4C, 0x01, // 00074C01
1837 0x00, 0x07, 0x0E, 0x32, // 00070E32
1838 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
1839 0x00, 0x0B, 0x64, 0x40, // 000B6440
1840 0x00, 0x00, 0x00, 0x00, // 00000000
1841 0x00, 0x06, 0x8C, 0x22, // 00068C22
1842 0x00, 0x06, 0x5C, 0x14, // 00065C14
1843 0x00, 0x06, 0xA8, 0x74, // 0006A874
1844 0x00, 0x06, 0x5C, 0x24, // 00065C24
1845 0x00, 0x06, 0x5C, 0x26, // 00065C26
1846 0x00, 0x06, 0x5C, 0x2E, // 00065C2E
1847 0x00, 0x06, 0x5C, 0x25, // 00065C25
1848 0x00, 0x06, 0x5C, 0x27, // 00065C27
1849 0x00, 0x06, 0x5C, 0x2F, // 00065C2F
1850 0x00, 0x06, 0x5C, 0x44, // 00065C44
1851 0x00, 0x04, 0x80, 0x03, // 00048003
1852 0x00, 0x00, 0x00, 0x00, // 00000000
1853 0x00, 0x00, 0x00, 0x00, // 00000000
1854 0x00, 0x00, 0x00, 0x00, // 00000000
1855 0x00, 0x00, 0xC1, 0x06, // 0000C106
1856 0x00, 0x06, 0x84, 0x74, // 00068474
1857 0x00, 0x06, 0x84, 0x43, // 00068443
1858 0x00, 0x06, 0x5C, 0x3C, // 00065C3C
1859 0x00, 0x06, 0x5C, 0x3B, // 00065C3B
1860 0x00, 0x06, 0x5C, 0x54, // 00065C54
1861 0x00, 0x06, 0x5C, 0x53, // 00065C53
1862 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1863 0x00, 0x07, 0x4C, 0x01, // 00074C01
1864 0x00, 0x07, 0x0E, 0x25, // 00070E25
1865 0x00, 0x00, 0x00, 0x00, // 00000000
1866 0x00, 0x00, 0x00, 0x00, // 00000000
1867 0x00, 0x06, 0xA8, 0x74, // 0006A874
1868 0x00, 0x06, 0x8C, 0x22, // 00068C22
1869 0x00, 0x06, 0x5C, 0x14, // 00065C14
1870 0x00, 0x06, 0x5C, 0x24, // 00065C24
1871 0x00, 0x06, 0x5C, 0x26, // 00065C26
1872 0x00, 0x06, 0x5C, 0x2E, // 00065C2E
1873 0x00, 0x06, 0x5C, 0x25, // 00065C25
1874 0x00, 0x06, 0x5C, 0x27, // 00065C27
1875 0x00, 0x06, 0x5C, 0x2F, // 00065C2F
1876 0x00, 0x00, 0xC1, 0x07, // 0000C107
1877 0x00, 0x06, 0x5C, 0x44, // 00065C44
1878 0x00, 0x06, 0x5C, 0x43, // 00065C43
1879 0x00, 0x06, 0x5C, 0x3C, // 00065C3C
1880 0x00, 0x06, 0x5C, 0x3B, // 00065C3B
1881 0x00, 0x06, 0x5C, 0x54, // 00065C54
1882 0x00, 0x06, 0x5C, 0x53, // 00065C53
1883 0x00, 0x07, 0x5C, 0x00, // 00075C00
1884 0x00, 0x07, 0x1C, 0x02, // 00071C02
1885 0x00, 0x02, 0x81, 0x10, // 00028110
1886 0x00, 0x07, 0x5C, 0x00, // 00075C00
1887 0x00, 0x07, 0x1C, 0x01, // 00071C01
1888 0x00, 0x07, 0x54, 0x01, // 00075401
1889 0x00, 0x07, 0x16, 0x65, // 00071665
1890 0x00, 0x06, 0x00, 0x61, // 00060061
1891 0x00, 0x06, 0x20, 0x7A, // 0006207A
1892 0x00, 0x07, 0x4C, 0x05, // 00074C05
1893 0x00, 0x06, 0x9C, 0x7F, // 00069C7F
1894 0x00, 0x06, 0x90, 0x22, // 00069022
1895 0x00, 0x04, 0x1F, 0x00, // 00041F00
1896 0x00, 0x08, 0xA4, 0x40, // 0008A440
1897 0x00, 0x02, 0x9E, 0x08, // 00029E08
1898 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
1899 0x00, 0x07, 0x0C, 0x14, // 00070C14
1900 0x00, 0x00, 0x00, 0x00, // 00000000
1901 0x00, 0x00, 0x00, 0x00, // 00000000
1902 0x00, 0x07, 0x98, 0x1F, // 0007981F
1903 0x00, 0x04, 0x17, 0x00, // 00041700
1904 0x00, 0x08, 0xA4, 0x40, // 0008A440
1905 0x00, 0x02, 0x9E, 0x10, // 00029E10
1906 0x00, 0x06, 0x00, 0x6A, // 0006006A
1907 0x00, 0x08, 0x12, 0x41, // 00081241
1908 0x00, 0x06, 0x88, 0x0F, // 0006880F
1909 0x00, 0x00, 0x00, 0x00, // 00000000
1910 0x00, 0x06, 0x80, 0x61, // 00068061
1911 0x00, 0x07, 0x90, 0x07, // 00079007
1912 0x00, 0x06, 0x3C, 0x26, // 00063C26
1913 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1914 0x00, 0x08, 0x3F, 0x40, // 00083F40
1915 0x00, 0x0B, 0x40, 0x40, // 000B4040
1916 0x00, 0x06, 0x1C, 0x1C, // 00061C1C
1917 0x00, 0x00, 0x00, 0x00, // 00000000
1918 0x00, 0x06, 0xBC, 0x1C, // 0006BC1C
1919 0x00, 0x04, 0xB0, 0x0D, // 0004B00D
1920 0x00, 0x00, 0x00, 0x00, // 00000000
1921 0x00, 0x09, 0xB6, 0x7C, // 0009B67C
1922 0x00, 0x01, 0x05, 0x10, // 00010510
1923 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
1924 0x00, 0x02, 0x82, 0x08, // 00028208
1925 0x00, 0x08, 0x00, 0x42, // 00080042
1926 0x00, 0x0B, 0x49, 0x40, // 000B4940
1927 0x00, 0x09, 0xB6, 0x7F, // 0009B67F
1928 0x00, 0x02, 0x82, 0x08, // 00028208
1929 0x00, 0x08, 0x09, 0x42, // 00080942
1930 0x00, 0x07, 0x84, 0x0C, // 0007840C
1931 0x00, 0x0B, 0x40, 0x40, // 000B4040
1932 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
1933 0x00, 0x07, 0x8C, 0x0C, // 00078C0C
1934 0x00, 0x07, 0x64, 0x00, // 00076400
1935 0x00, 0x07, 0x24, 0x30, // 00072430
1936 0x00, 0x08, 0x2D, 0x41, // 00082D41
1937 0x00, 0x08, 0xA4, 0xC5, // 0008A4C5
1938 0x00, 0x02, 0x9F, 0x10, // 00029F10
1939 0x00, 0x02, 0x16, 0x35, // 00021635
1940 0x00, 0x02, 0x81, 0x08, // 00028108
1941 0x00, 0x00, 0xC1, 0x87, // 0000C187
1942 0x00, 0x00, 0x00, 0x00, // 00000000
1943 0x00, 0x00, 0x00, 0x00, // 00000000
1944 0x00, 0x00, 0x00, 0x00, // 00000000
1945 0x00, 0x00, 0x00, 0x00, // 00000000
1946 0x00, 0x00, 0x00, 0x00, // 00000000
1947 0x00, 0x06, 0x9C, 0x1C, // 00069C1C
1948 0x00, 0x06, 0x04, 0x6A, // 0006046A
1949 0x00, 0x06, 0x08, 0x77, // 00060877
1950 0x00, 0x07, 0x54, 0x01, // 00075401
1951 0x00, 0x07, 0x17, 0x12, // 00071712
1952 0x00, 0x08, 0x80, 0x40, // 00088040
1953 0x00, 0x02, 0x9E, 0x10, // 00029E10
1954 0x00, 0x02, 0x16, 0x71, // 00021671
1955 0x00, 0x02, 0x81, 0x28, // 00028128
1956 0x00, 0x02, 0x88, 0x08, // 00028808
1957 0x00, 0x00, 0xC1, 0x87, // 0000C187
1958 0x00, 0x08, 0x80, 0x41, // 00088041
1959 0x00, 0x06, 0x24, 0x66, // 00062466
1960 0x00, 0x06, 0x2C, 0x67, // 00062C67
1961 0x00, 0x06, 0x34, 0x68, // 00063468
1962 0x00, 0x06, 0x3C, 0x69, // 00063C69
1963 0x00, 0x08, 0x89, 0x40, // 00088940
1964 0x00, 0x02, 0x9F, 0x20, // 00029F20
1965 0x00, 0x0B, 0x64, 0xC4, // 000B64C4
1966 0x00, 0x0B, 0x6D, 0xC5, // 000B6DC5
1967 0x00, 0x0B, 0x76, 0xC6, // 000B76C6
1968 0x00, 0x0B, 0x7F, 0xC7, // 000B7FC7
1969 0x00, 0x08, 0x25, 0x8C, // 0008258C
1970 0x00, 0x08, 0x2D, 0x8D, // 00082D8D
1971 0x00, 0x08, 0x35, 0x8E, // 0008358E
1972 0x00, 0x00, 0xC1, 0x07, // 0000C107
1973 0x00, 0x08, 0x3D, 0x8F, // 00083D8F
1974 0x00, 0x06, 0x84, 0x6A, // 0006846A
1975 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1976 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
1977 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
1978 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
1979 0x00, 0x08, 0x80, 0x41, // 00088041
1980 0x00, 0x06, 0x90, 0x22, // 00069022
1981 0x00, 0x04, 0x27, 0x08, // 00042708
1982 0x00, 0x04, 0x2F, 0x08, // 00042F08
1983 0x00, 0x04, 0x37, 0x08, // 00043708
1984 0x00, 0x04, 0x3F, 0x08, // 00043F08
1985 0x00, 0x08, 0x89, 0x40, // 00088940
1986 0x00, 0x02, 0x9F, 0x20, // 00029F20
1987 0x00, 0x0B, 0x64, 0x40, // 000B6440
1988 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
1989 0x00, 0x0B, 0x76, 0x40, // 000B7640
1990 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
1991 0x00, 0x00, 0xC1, 0x07, // 0000C107
1992 0x00, 0x06, 0x84, 0x6A, // 0006846A
1993 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
1994 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
1995 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
1996 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
1997 0x00, 0x00, 0x00, 0x00, // 00000000
1998};
1999// addres 06800 count 1077 (4314 bytes)
2000static const unsigned char maspcm_array10[] = {
2001 0xf0, 0x00, 0x04, 0x35, 0x08, 0x00,
2002 0x00, 0x07, 0x44, 0x01, // 00074401
2003 0x00, 0x07, 0x06, 0x61, // 00070661
2004 0x00, 0x07, 0x4C, 0x00, // 00074C00
2005 0x00, 0x07, 0x0F, 0x00, // 00070F00
2006 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2007 0x00, 0x0B, 0x5B, 0x7E, // 000B5B7E
2008 0x00, 0x06, 0x80, 0x22, // 00068022
2009 0x00, 0x04, 0x07, 0x00, // 00040700
2010 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
2011 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2012 0x00, 0x0A, 0x09, 0x78, // 000A0978
2013 0x00, 0x02, 0x9F, 0x20, // 00029F20
2014 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2015 0x00, 0x08, 0xA1, 0x41, // 0008A141
2016 0x00, 0x02, 0x9F, 0x08, // 00029F08
2017 0x00, 0x0B, 0x52, 0x40, // 000B5240
2018 0x00, 0x00, 0x00, 0x00, // 00000000
2019 0x00, 0x08, 0x92, 0x40, // 00089240
2020 0x00, 0x02, 0x9E, 0x08, // 00029E08
2021 0x00, 0x0B, 0x5B, 0x7E, // 000B5B7E
2022 0x00, 0x07, 0x64, 0x01, // 00076401
2023 0x00, 0x07, 0x26, 0x69, // 00072669
2024 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
2025 0x00, 0x0B, 0x75, 0x7E, // 000B757E
2026 0x00, 0x00, 0x00, 0x00, // 00000000
2027 0x00, 0x06, 0xA0, 0x22, // 0006A022
2028 0x00, 0x0A, 0xF7, 0x86, // 000AF786
2029 0x00, 0x0A, 0xEF, 0x85, // 000AEF85
2030 0x00, 0x0A, 0x36, 0x7F, // 000A367F
2031 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
2032 0x00, 0x0B, 0x64, 0x70, // 000B6470
2033 0x00, 0x06, 0x98, 0x79, // 00069879
2034 0x00, 0x06, 0x90, 0x78, // 00069078
2035 0x00, 0x06, 0xA8, 0x77, // 0006A877
2036 0x00, 0x06, 0xB0, 0x7A, // 0006B07A
2037 0x00, 0x06, 0xBC, 0x64, // 0006BC64
2038 0x00, 0x06, 0xB8, 0x71, // 0006B871
2039 0x00, 0x06, 0xB8, 0x70, // 0006B870
2040 0x00, 0x06, 0xB8, 0x69, // 0006B869
2041 0x00, 0x06, 0xB8, 0x7B, // 0006B87B
2042 0x00, 0x06, 0xB8, 0x7C, // 0006B87C
2043 0x00, 0x06, 0x9C, 0x6B, // 00069C6B
2044 0x00, 0x06, 0xBC, 0x6E, // 0006BC6E
2045 0x00, 0x06, 0xBC, 0x72, // 0006BC72
2046 0x00, 0x06, 0xB8, 0x74, // 0006B874
2047 0x00, 0x06, 0xB8, 0x7D, // 0006B87D
2048 0x00, 0x06, 0xBC, 0x73, // 0006BC73
2049 0x00, 0x06, 0x9C, 0x7D, // 00069C7D
2050 0x00, 0x06, 0xBC, 0x7C, // 0006BC7C
2051 0x00, 0x06, 0xBC, 0x7B, // 0006BC7B
2052 0x00, 0x00, 0x00, 0x00, // 00000000
2053 0x00, 0x06, 0x3C, 0x65, // 00063C65
2054 0x00, 0x00, 0x00, 0x00, // 00000000
2055 0x00, 0x09, 0xBF, 0x41, // 0009BF41
2056 0x00, 0x00, 0x00, 0x00, // 00000000
2057 0x00, 0x00, 0x00, 0x00, // 00000000
2058 0x00, 0x00, 0x00, 0x00, // 00000000
2059 0x00, 0x06, 0xBC, 0x7A, // 0006BC7A
2060 0x00, 0x07, 0x7C, 0x01, // 00077C01
2061 0x00, 0x07, 0x3D, 0xFF, // 00073DFF
2062 0x00, 0x07, 0x54, 0x00, // 00075400
2063 0x00, 0x07, 0x14, 0x00, // 00071400
2064 0x00, 0x07, 0x5C, 0x01, // 00075C01
2065 0x00, 0x07, 0x1C, 0x90, // 00071C90
2066 0x00, 0x07, 0x74, 0x01, // 00077401
2067 0x00, 0x07, 0x34, 0xA0, // 000734A0
2068 0x00, 0x06, 0x08, 0x76, // 00060876
2069 0x00, 0x00, 0x00, 0x00, // 00000000
2070 0x00, 0x08, 0x21, 0x41, // 00082141
2071 0x00, 0x06, 0xB8, 0x16, // 0006B816
2072 0x00, 0x06, 0x90, 0x24, // 00069024
2073 0x00, 0x06, 0x90, 0x2C, // 0006902C
2074 0x00, 0x06, 0x90, 0x1C, // 0006901C
2075 0x00, 0x06, 0x90, 0x20, // 00069020
2076 0x00, 0x06, 0x98, 0x25, // 00069825
2077 0x00, 0x06, 0x98, 0x2D, // 0006982D
2078 0x00, 0x06, 0xB0, 0x1D, // 0006B01D
2079 0x00, 0x06, 0xA0, 0x10, // 0006A010
2080 0x00, 0x06, 0x98, 0x21, // 00069821
2081 0x00, 0x07, 0x7C, 0x00, // 00077C00
2082 0x00, 0x07, 0x3C, 0x24, // 00073C24
2083 0x00, 0x07, 0x54, 0x01, // 00075401
2084 0x00, 0x07, 0x16, 0x00, // 00071600
2085 0x00, 0x07, 0x6C, 0x01, // 00076C01
2086 0x00, 0x07, 0x2C, 0x98, // 00072C98
2087 0x00, 0x06, 0xBC, 0x16, // 0006BC16
2088 0x00, 0x06, 0x94, 0x2A, // 0006942A
2089 0x00, 0x00, 0x00, 0x00, // 00000000
2090 0x00, 0x06, 0xAC, 0x2B, // 0006AC2B
2091 0x00, 0x07, 0x7C, 0x01, // 00077C01
2092 0x00, 0x07, 0x3D, 0xFF, // 00073DFF
2093 0x00, 0x07, 0x54, 0x00, // 00075400
2094 0x00, 0x07, 0x14, 0x00, // 00071400
2095 0x00, 0x07, 0x5C, 0x01, // 00075C01
2096 0x00, 0x07, 0x1E, 0x00, // 00071E00
2097 0x00, 0x07, 0x6C, 0x00, // 00076C00
2098 0x00, 0x07, 0x2C, 0x90, // 00072C90
2099 0x00, 0x06, 0xBC, 0x14, // 0006BC14
2100 0x00, 0x06, 0x94, 0x1C, // 0006941C
2101 0x00, 0x06, 0x9C, 0x26, // 00069C26
2102 0x00, 0x06, 0x9C, 0x2E, // 00069C2E
2103 0x00, 0x06, 0xAC, 0x1D, // 0006AC1D
2104 0x00, 0x06, 0xAC, 0x27, // 0006AC27
2105 0x00, 0x06, 0xAC, 0x2F, // 0006AC2F
2106 0x00, 0x07, 0x4C, 0x00, // 00074C00
2107 0x00, 0x07, 0x0C, 0x04, // 00070C04
2108 0x00, 0x07, 0x54, 0x00, // 00075400
2109 0x00, 0x07, 0x14, 0x10, // 00071410
2110 0x00, 0x00, 0x00, 0x00, // 00000000
2111 0x00, 0x06, 0x88, 0x4B, // 0006884B
2112 0x00, 0x00, 0x00, 0x00, // 00000000
2113 0x00, 0x06, 0x94, 0x06, // 00069406
2114 0x00, 0x00, 0x00, 0x00, // 00000000
2115 0x00, 0x07, 0x5C, 0x01, // 00075C01
2116 0x00, 0x07, 0x1E, 0x62, // 00071E62
2117 0x00, 0x06, 0x10, 0x78, // 00061078
2118 0x00, 0x07, 0x64, 0x00, // 00076400
2119 0x00, 0x07, 0x24, 0x00, // 00072400
2120 0x00, 0x07, 0x5C, 0x00, // 00075C00
2121 0x00, 0x07, 0x1F, 0x18, // 00071F18
2122 0x00, 0x06, 0x98, 0x22, // 00069822
2123 0x00, 0x08, 0x92, 0x41, // 00089241
2124 0x00, 0x02, 0x9E, 0xF0, // 00029EF0
2125 0x00, 0x07, 0x5C, 0x00, // 00075C00
2126 0x00, 0x07, 0x1C, 0x00, // 00071C00
2127 0x00, 0x07, 0x6C, 0x00, // 00076C00
2128 0x00, 0x07, 0x2C, 0x80, // 00072C80
2129 0x00, 0x07, 0x74, 0x00, // 00077400
2130 0x00, 0x07, 0x34, 0x04, // 00073404
2131 0x00, 0x0A, 0xED, 0xC0, // 000AEDC0
2132 0x00, 0x02, 0x9F, 0x08, // 00029F08
2133 0x00, 0x08, 0x1B, 0xC6, // 00081BC6
2134 0x00, 0x07, 0x6C, 0x00, // 00076C00
2135 0x00, 0x07, 0x2C, 0x40, // 00072C40
2136 0x00, 0x07, 0x74, 0x02, // 00077402
2137 0x00, 0x07, 0x34, 0x00, // 00073400
2138 0x00, 0x0A, 0xED, 0xC0, // 000AEDC0
2139 0x00, 0x02, 0x9F, 0x08, // 00029F08
2140 0x00, 0x08, 0x1B, 0xC6, // 00081BC6
2141 0x00, 0x07, 0x6C, 0x00, // 00076C00
2142 0x00, 0x07, 0x2C, 0x04, // 00072C04
2143 0x00, 0x07, 0x74, 0x00, // 00077400
2144 0x00, 0x07, 0x34, 0x20, // 00073420
2145 0x00, 0x04, 0x17, 0x00, // 00041700
2146 0x00, 0x0A, 0xED, 0xC0, // 000AEDC0
2147 0x00, 0x02, 0x9F, 0x08, // 00029F08
2148 0x00, 0x08, 0x1B, 0xC6, // 00081BC6
2149 0x00, 0x0A, 0xD2, 0x41, // 000AD241
2150 0x00, 0x02, 0x9F, 0x10, // 00029F10
2151 0x00, 0x07, 0x5C, 0x00, // 00075C00
2152 0x00, 0x07, 0x1C, 0x00, // 00071C00
2153 0x00, 0x07, 0x64, 0x00, // 00076400
2154 0x00, 0x07, 0x27, 0x18, // 00072718
2155 0x00, 0x00, 0x00, 0x00, // 00000000
2156 0x00, 0x06, 0x98, 0x3B, // 0006983B
2157 0x00, 0x06, 0x9C, 0x75, // 00069C75
2158 0x00, 0x06, 0xA0, 0x53, // 0006A053
2159 0x00, 0x06, 0x28, 0x77, // 00062877
2160 0x00, 0x07, 0x54, 0x01, // 00075401
2161 0x00, 0x07, 0x16, 0x40, // 00071640
2162 0x00, 0x07, 0x64, 0x00, // 00076400
2163 0x00, 0x07, 0x24, 0x90, // 00072490
2164 0x00, 0x0B, 0x49, 0x7D, // 000B497D
2165 0x00, 0x07, 0x44, 0x01, // 00074401
2166 0x00, 0x07, 0x06, 0x6C, // 0007066C
2167 0x00, 0x06, 0x90, 0x1E, // 0006901E
2168 0x00, 0x06, 0xA0, 0x1F, // 0006A01F
2169 0x00, 0x06, 0x88, 0x14, // 00068814
2170 0x00, 0x06, 0x80, 0x22, // 00068022
2171 0x00, 0x04, 0x0F, 0x08, // 00040F08
2172 0x00, 0x04, 0x17, 0x08, // 00041708
2173 0x00, 0x04, 0x1F, 0x08, // 00041F08
2174 0x00, 0x04, 0x27, 0x08, // 00042708
2175 0x00, 0x08, 0xAD, 0x40, // 0008AD40
2176 0x00, 0x02, 0x9F, 0x20, // 00029F20
2177 0x00, 0x0B, 0x49, 0x40, // 000B4940
2178 0x00, 0x0B, 0x52, 0x40, // 000B5240
2179 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2180 0x00, 0x0B, 0x64, 0x40, // 000B6440
2181 0x00, 0x07, 0x88, 0x0D, // 0007880D
2182 0x00, 0x07, 0x90, 0x0D, // 0007900D
2183 0x00, 0x07, 0x98, 0x0D, // 0007980D
2184 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
2185 0x00, 0x07, 0x54, 0x01, // 00075401
2186 0x00, 0x07, 0x16, 0x50, // 00071650
2187 0x00, 0x07, 0x64, 0x00, // 00076400
2188 0x00, 0x07, 0x26, 0x90, // 00072690
2189 0x00, 0x0B, 0x49, 0x7D, // 000B497D
2190 0x00, 0x07, 0x44, 0x01, // 00074401
2191 0x00, 0x07, 0x06, 0x70, // 00070670
2192 0x00, 0x06, 0x94, 0x20, // 00069420
2193 0x00, 0x06, 0xA4, 0x21, // 0006A421
2194 0x00, 0x06, 0x8C, 0x15, // 00068C15
2195 0x00, 0x06, 0x80, 0x22, // 00068022
2196 0x00, 0x0B, 0x52, 0x75, // 000B5275
2197 0x00, 0x04, 0x0F, 0x08, // 00040F08
2198 0x00, 0x04, 0x0F, 0x08, // 00040F08
2199 0x00, 0x04, 0x0F, 0x08, // 00040F08
2200 0x00, 0x04, 0x0F, 0x08, // 00040F08
2201 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2202 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2203 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2204 0x00, 0x07, 0x8C, 0x0E, // 00078C0E
2205 0x00, 0x06, 0x94, 0x15, // 00069415
2206 0x00, 0x02, 0x1C, 0x0E, // 00021C0E
2207 0x00, 0x07, 0x4C, 0x06, // 00074C06
2208 0x00, 0x07, 0x0C, 0xD3, // 00070CD3
2209 0x00, 0x00, 0x00, 0x00, // 00000000
2210 0x00, 0x00, 0x00, 0x00, // 00000000
2211 0x00, 0x00, 0x00, 0x00, // 00000000
2212 0x00, 0x06, 0x88, 0x0F, // 0006880F
2213 0x00, 0x07, 0x4C, 0x01, // 00074C01
2214 0x00, 0x07, 0x0E, 0x32, // 00070E32
2215 0x00, 0x07, 0x64, 0x01, // 00076401
2216 0x00, 0x07, 0x26, 0x70, // 00072670
2217 0x00, 0x07, 0x6C, 0x00, // 00076C00
2218 0x00, 0x07, 0x2E, 0x90, // 00072E90
2219 0x00, 0x06, 0x8C, 0x22, // 00068C22
2220 0x00, 0x04, 0x80, 0x4F, // 0004804F
2221 0x00, 0x06, 0x08, 0x78, // 00060878
2222 0x00, 0x06, 0xA4, 0x24, // 0006A424
2223 0x00, 0x06, 0xAC, 0x25, // 0006AC25
2224 0x00, 0x06, 0x5C, 0x3C, // 00065C3C
2225 0x00, 0x06, 0x5C, 0x3B, // 00065C3B
2226 0x00, 0x08, 0x89, 0x40, // 00088940
2227 0x00, 0x02, 0x9F, 0x10, // 00029F10
2228 0x00, 0x02, 0x19, 0x1D, // 0002191D
2229 0x00, 0x02, 0x81, 0x28, // 00028128
2230 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
2231 0x00, 0x07, 0x6C, 0x06, // 00076C06
2232 0x00, 0x07, 0x2C, 0xEB, // 00072CEB
2233 0x00, 0x00, 0x00, 0x00, // 00000000
2234 0x00, 0x00, 0x00, 0x00, // 00000000
2235 0x00, 0x00, 0x00, 0x00, // 00000000
2236 0x00, 0x00, 0x00, 0x00, // 00000000
2237 0x00, 0x07, 0x44, 0x01, // 00074401
2238 0x00, 0x07, 0x06, 0x61, // 00070661
2239 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
2240 0x00, 0x07, 0x0C, 0x00, // 00070C00
2241 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2242 0x00, 0x06, 0x80, 0x22, // 00068022
2243 0x00, 0x0A, 0xC7, 0x82, // 000AC782
2244 0x00, 0x02, 0x9E, 0x20, // 00029E20
2245 0x00, 0x0A, 0xC7, 0x81, // 000AC781
2246 0x00, 0x02, 0x9E, 0x10, // 00029E10
2247 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2248 0x00, 0x02, 0x81, 0x28, // 00028128
2249 0x00, 0x00, 0x00, 0x00, // 00000000
2250 0x00, 0x07, 0x54, 0x04, // 00075404
2251 0x00, 0x07, 0x14, 0x00, // 00071400
2252 0x00, 0x06, 0x30, 0x2C, // 0006302C
2253 0x00, 0x08, 0x92, 0x41, // 00089241
2254 0x00, 0x02, 0x88, 0x10, // 00028810
2255 0x00, 0x02, 0x19, 0x0C, // 0002190C
2256 0x00, 0x02, 0x81, 0x28, // 00028128
2257 0x00, 0x0A, 0xF6, 0x41, // 000AF641
2258 0x00, 0x02, 0x9E, 0x10, // 00029E10
2259 0x00, 0x02, 0x18, 0xFA, // 000218FA
2260 0x00, 0x02, 0x81, 0x28, // 00028128
2261 0x00, 0x06, 0x30, 0x2C, // 0006302C
2262 0x00, 0x08, 0x92, 0x41, // 00089241
2263 0x00, 0x02, 0x88, 0x10, // 00028810
2264 0x00, 0x02, 0x19, 0x0C, // 0002190C
2265 0x00, 0x02, 0x81, 0x28, // 00028128
2266 0x00, 0x0A, 0xF6, 0x41, // 000AF641
2267 0x00, 0x02, 0x9F, 0x10, // 00029F10
2268 0x00, 0x02, 0x19, 0x03, // 00021903
2269 0x00, 0x02, 0x81, 0x28, // 00028128
2270 0x00, 0x06, 0x38, 0x52, // 00063852
2271 0x00, 0x06, 0x30, 0x2C, // 0006302C
2272 0x00, 0x09, 0xBF, 0x7A, // 0009BF7A
2273 0x00, 0x00, 0x00, 0x00, // 00000000
2274 0x00, 0x0A, 0xFF, 0x41, // 000AFF41
2275 0x00, 0x02, 0x9E, 0x08, // 00029E08
2276 0x00, 0x0B, 0x36, 0x41, // 000B3641
2277 0x00, 0x00, 0x00, 0x00, // 00000000
2278 0x00, 0x00, 0x00, 0x00, // 00000000
2279 0x00, 0x00, 0x00, 0x00, // 00000000
2280 0x00, 0x06, 0xB0, 0x2C, // 0006B02C
2281 0x00, 0x00, 0x00, 0x00, // 00000000
2282 0x00, 0x08, 0x92, 0x40, // 00089240
2283 0x00, 0x02, 0x88, 0x10, // 00028810
2284 0x00, 0x02, 0x18, 0xE4, // 000218E4
2285 0x00, 0x02, 0x81, 0x28, // 00028128
2286 0x00, 0x00, 0x00, 0x00, // 00000000
2287 0x00, 0x0B, 0x40, 0x7D, // 000B407D
2288 0x00, 0x00, 0x00, 0x00, // 00000000
2289 0x00, 0x00, 0x00, 0x00, // 00000000
2290 0x00, 0x00, 0x00, 0x00, // 00000000
2291 0x00, 0x06, 0x84, 0x15, // 00068415
2292 0x00, 0x04, 0x35, 0x08, // 00043508
2293 0x00, 0x04, 0xB8, 0x16, // 0004B816
2294 0x00, 0x00, 0x00, 0x00, // 00000000
2295 0x00, 0x0C, 0x06, 0x27, // 000C0627
2296 0x00, 0x04, 0x35, 0x18, // 00043518
2297 0x00, 0x04, 0xB8, 0x1E, // 0004B81E
2298 0x00, 0x00, 0x00, 0x00, // 00000000
2299 0x00, 0x0E, 0x06, 0x27, // 000E0627
2300 0x00, 0x04, 0x35, 0x08, // 00043508
2301 0x00, 0x04, 0xB8, 0x16, // 0004B816
2302 0x00, 0x00, 0x00, 0x00, // 00000000
2303 0x00, 0x0C, 0x0E, 0x27, // 000C0E27
2304 0x00, 0x04, 0x35, 0x08, // 00043508
2305 0x00, 0x04, 0xB8, 0x0E, // 0004B80E
2306 0x00, 0x00, 0x00, 0x00, // 00000000
2307 0x00, 0x0E, 0x0E, 0x27, // 000E0E27
2308 0x00, 0x04, 0x35, 0x08, // 00043508
2309 0x00, 0x04, 0xB8, 0x16, // 0004B816
2310 0x00, 0x00, 0x00, 0x00, // 00000000
2311 0x00, 0x0C, 0x16, 0x27, // 000C1627
2312 0x00, 0x04, 0x35, 0x18, // 00043518
2313 0x00, 0x04, 0xB8, 0x1E, // 0004B81E
2314 0x00, 0x00, 0x00, 0x00, // 00000000
2315 0x00, 0x0E, 0x16, 0x27, // 000E1627
2316 0x00, 0x04, 0x35, 0x08, // 00043508
2317 0x00, 0x04, 0xB8, 0x16, // 0004B816
2318 0x00, 0x00, 0x00, 0x00, // 00000000
2319 0x00, 0x0C, 0x1E, 0x27, // 000C1E27
2320 0x00, 0x04, 0x35, 0x08, // 00043508
2321 0x00, 0x04, 0xB8, 0x0E, // 0004B80E
2322 0x00, 0x00, 0x00, 0x00, // 00000000
2323 0x00, 0x0E, 0x1E, 0x27, // 000E1E27
2324 0x00, 0x07, 0x64, 0x01, // 00076401
2325 0x00, 0x00, 0x00, 0x00, // 00000000
2326 0x00, 0x07, 0x27, 0x12, // 00072712
2327 0x00, 0x07, 0x80, 0x0D, // 0007800D
2328 0x00, 0x07, 0x88, 0x0D, // 0007880D
2329 0x00, 0x07, 0x90, 0x0D, // 0007900D
2330 0x00, 0x07, 0x98, 0x0D, // 0007980D
2331 0x00, 0x06, 0xA0, 0x22, // 0006A022
2332 0x00, 0x07, 0x80, 0x0F, // 0007800F
2333 0x00, 0x07, 0x88, 0x0F, // 0007880F
2334 0x00, 0x07, 0x90, 0x0F, // 0007900F
2335 0x00, 0x07, 0x98, 0x07, // 00079807
2336 0x00, 0x06, 0x2C, 0x79, // 00062C79
2337 0x00, 0x00, 0x00, 0x00, // 00000000
2338 0x00, 0x0C, 0x09, 0x0D, // 000C090D
2339 0x00, 0x0C, 0x11, 0x0D, // 000C110D
2340 0x00, 0x0C, 0x19, 0x0D, // 000C190D
2341 0x00, 0x0C, 0x21, 0x0D, // 000C210D
2342 0x00, 0x00, 0x00, 0x00, // 00000000
2343 0x00, 0x00, 0x00, 0x00, // 00000000
2344 0x00, 0x00, 0x00, 0x00, // 00000000
2345 0x00, 0x06, 0x8C, 0x66, // 00068C66
2346 0x00, 0x06, 0x94, 0x67, // 00069467
2347 0x00, 0x06, 0x9C, 0x68, // 00069C68
2348 0x00, 0x06, 0xA4, 0x69, // 0006A469
2349 0x00, 0x06, 0x00, 0x7A, // 0006007A
2350 0x00, 0x00, 0x00, 0x00, // 00000000
2351 0x00, 0x08, 0x80, 0x40, // 00088040
2352 0x00, 0x02, 0x9F, 0x10, // 00029F10
2353 0x00, 0x02, 0x19, 0xF8, // 000219F8
2354 0x00, 0x02, 0x81, 0x28, // 00028128
2355 0x00, 0x06, 0x00, 0x24, // 00060024
2356 0x00, 0x06, 0x08, 0x78, // 00060878
2357 0x00, 0x06, 0x18, 0x76, // 00061876
2358 0x00, 0x07, 0x54, 0x01, // 00075401
2359 0x00, 0x07, 0x16, 0x00, // 00071600
2360 0x00, 0x08, 0x89, 0x41, // 00088941
2361 0x00, 0x02, 0x9F, 0x08, // 00029F08
2362 0x00, 0x06, 0x00, 0x2C, // 0006002C
2363 0x00, 0x06, 0x08, 0x1C, // 0006081C
2364 0x00, 0x08, 0x80, 0xC1, // 000880C1
2365 0x00, 0x02, 0x86, 0x08, // 00028608
2366 0x00, 0x08, 0x00, 0xC2, // 000800C2
2367 0x00, 0x08, 0x9B, 0x41, // 00089B41
2368 0x00, 0x02, 0x9E, 0x08, // 00029E08
2369 0x00, 0x09, 0x80, 0x7F, // 0009807F
2370 0x00, 0x06, 0x14, 0x7B, // 0006147B
2371 0x00, 0x06, 0x1C, 0x7A, // 00061C7A
2372 0x00, 0x08, 0x92, 0x40, // 00089240
2373 0x00, 0x02, 0x9F, 0x28, // 00029F28
2374 0x00, 0x08, 0x98, 0xC3, // 000898C3
2375 0x00, 0x02, 0x87, 0x10, // 00028710
2376 0x00, 0x0B, 0x52, 0x40, // 000B5240
2377 0x00, 0x02, 0x81, 0x08, // 00028108
2378 0x00, 0x0B, 0x40, 0x40, // 000B4040
2379 0x00, 0x00, 0x00, 0x00, // 00000000
2380 0x00, 0x06, 0x94, 0x7B, // 0006947B
2381 0x00, 0x07, 0x54, 0x00, // 00075400
2382 0x00, 0x07, 0x14, 0x12, // 00071412
2383 0x00, 0x07, 0x5C, 0x01, // 00075C01
2384 0x00, 0x07, 0x1E, 0x00, // 00071E00
2385 0x00, 0x08, 0xA0, 0xC2, // 0008A0C2
2386 0x00, 0x02, 0x88, 0x10, // 00028810
2387 0x00, 0x02, 0x19, 0xF8, // 000219F8
2388 0x00, 0x02, 0x81, 0x28, // 00028128
2389 0x00, 0x06, 0x24, 0x2A, // 0006242A
2390 0x00, 0x08, 0xA3, 0xC4, // 0008A3C4
2391 0x00, 0x02, 0x9F, 0x10, // 00029F10
2392 0x00, 0x02, 0x19, 0xF8, // 000219F8
2393 0x00, 0x02, 0x81, 0x28, // 00028128
2394 0x00, 0x07, 0x5C, 0x01, // 00075C01
2395 0x00, 0x07, 0x1E, 0x01, // 00071E01
2396 0x00, 0x07, 0x44, 0x00, // 00074400
2397 0x00, 0x07, 0x04, 0x09, // 00070409
2398 0x00, 0x06, 0x08, 0x69, // 00060869
2399 0x00, 0x06, 0x9C, 0x22, // 00069C22
2400 0x00, 0x06, 0x10, 0x6A, // 0006106A
2401 0x00, 0x08, 0x89, 0x40, // 00088940
2402 0x00, 0x02, 0x9F, 0x10, // 00029F10
2403 0x00, 0x02, 0x19, 0xA4, // 000219A4
2404 0x00, 0x02, 0x81, 0x28, // 00028128
2405 0x00, 0x08, 0x92, 0x41, // 00089241
2406 0x00, 0x02, 0x9F, 0x10, // 00029F10
2407 0x00, 0x02, 0x19, 0xA4, // 000219A4
2408 0x00, 0x02, 0x81, 0x28, // 00028128
2409 0x00, 0x08, 0x80, 0x41, // 00088041
2410 0x00, 0x07, 0x55, 0x5C, // 0007555C
2411 0x00, 0x07, 0x14, 0x00, // 00071400
2412 0x00, 0x07, 0x5D, 0x04, // 00075D04
2413 0x00, 0x07, 0x1C, 0x00, // 00071C00
2414 0x00, 0x07, 0x65, 0x58, // 00076558
2415 0x00, 0x07, 0x24, 0x00, // 00072400
2416 0x00, 0x07, 0x6D, 0x14, // 00076D14
2417 0x00, 0x07, 0x2C, 0x00, // 00072C00
2418 0x00, 0x07, 0x94, 0x0F, // 0007940F
2419 0x00, 0x07, 0x9C, 0x0F, // 00079C0F
2420 0x00, 0x07, 0xA4, 0x0F, // 0007A40F
2421 0x00, 0x07, 0xAC, 0x0F, // 0007AC0F
2422 0x00, 0x06, 0x38, 0x3A, // 0006383A
2423 0x00, 0x0B, 0x76, 0x7D, // 000B767D
2424 0x00, 0x06, 0x10, 0x6C, // 0006106C
2425 0x00, 0x0A, 0xFF, 0x5F, // 000AFF5F
2426 0x00, 0x06, 0x84, 0x05, // 00068405
2427 0x00, 0x02, 0x9F, 0x18, // 00029F18
2428 0x00, 0x09, 0x3F, 0x54, // 00093F54
2429 0x00, 0x02, 0x86, 0x08, // 00028608
2430 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2431 0x00, 0x00, 0x00, 0x00, // 00000000
2432 0x00, 0x06, 0xB4, 0x15, // 0006B415
2433 0x00, 0x07, 0x77, 0xFC, // 000777FC
2434 0x00, 0x07, 0x34, 0x00, // 00073400
2435 0x00, 0x06, 0x00, 0x78, // 00060078
2436 0x00, 0x00, 0x00, 0x00, // 00000000
2437 0x00, 0x08, 0x80, 0x41, // 00088041
2438 0x00, 0x02, 0x9F, 0x08, // 00029F08
2439 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2440 0x00, 0x01, 0x4E, 0x80, // 00014E80
2441 0x00, 0x00, 0x00, 0x00, // 00000000
2442 0x00, 0x09, 0x80, 0x87, // 00098087
2443 0x00, 0x09, 0x88, 0x87, // 00098887
2444 0x00, 0x0C, 0x20, 0x12, // 000C2012
2445 0x00, 0x0E, 0x21, 0x12, // 000E2112
2446 0x00, 0x00, 0x00, 0x00, // 00000000
2447 0x00, 0x00, 0x00, 0x00, // 00000000
2448 0x00, 0x00, 0x00, 0x00, // 00000000
2449 0x00, 0x0C, 0x28, 0x12, // 000C2812
2450 0x00, 0x0E, 0x29, 0x12, // 000E2912
2451 0x00, 0x00, 0x00, 0x00, // 00000000
2452 0x00, 0x00, 0x00, 0x00, // 00000000
2453 0x00, 0x00, 0x00, 0x00, // 00000000
2454 0x00, 0x09, 0x84, 0x48, // 00098448
2455 0x00, 0x09, 0x8D, 0x48, // 00098D48
2456 0x00, 0x08, 0x92, 0x40, // 00089240
2457 0x00, 0x02, 0x9F, 0x20, // 00029F20
2458 0x00, 0x09, 0xA4, 0x48, // 0009A448
2459 0x00, 0x08, 0x04, 0x40, // 00080440
2460 0x00, 0x09, 0xAD, 0x48, // 0009AD48
2461 0x00, 0x08, 0x0D, 0x40, // 00080D40
2462 0x00, 0x0A, 0xE4, 0xC6, // 000AE4C6
2463 0x00, 0x0A, 0xC0, 0xC6, // 000AC0C6
2464 0x00, 0x0A, 0xED, 0xC6, // 000AEDC6
2465 0x00, 0x0A, 0xC9, 0xC6, // 000AC9C6
2466 0x00, 0x00, 0x00, 0x00, // 00000000
2467 0x00, 0x07, 0xE4, 0x0F, // 0007E40F
2468 0x00, 0x07, 0xC4, 0x0F, // 0007C40F
2469 0x00, 0x07, 0xEC, 0x0F, // 0007EC0F
2470 0x00, 0x07, 0xCC, 0x0F, // 0007CC0F
2471 0x00, 0x06, 0x00, 0x69, // 00060069
2472 0x00, 0x07, 0x4C, 0x01, // 00074C01
2473 0x00, 0x07, 0x0E, 0x65, // 00070E65
2474 0x00, 0x08, 0x00, 0x41, // 00080041
2475 0x00, 0x06, 0x1C, 0x64, // 00061C64
2476 0x00, 0x07, 0x54, 0x00, // 00075400
2477 0x00, 0x07, 0x14, 0x39, // 00071439
2478 0x00, 0x06, 0x88, 0x22, // 00068822
2479 0x00, 0x04, 0x0F, 0x00, // 00040F00
2480 0x00, 0x08, 0x90, 0xC2, // 000890C2
2481 0x00, 0x02, 0x9E, 0x28, // 00029E28
2482 0x00, 0x08, 0x9B, 0x40, // 00089B40
2483 0x00, 0x02, 0x9F, 0x08, // 00029F08
2484 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2485 0x00, 0x0B, 0x40, 0x40, // 000B4040
2486 0x00, 0x08, 0x09, 0x41, // 00080941
2487 0x00, 0x00, 0x00, 0x00, // 00000000
2488 0x00, 0x00, 0x00, 0x00, // 00000000
2489 0x00, 0x06, 0x80, 0x69, // 00068069
2490 0x00, 0x07, 0x88, 0x07, // 00078807
2491 0x00, 0x07, 0x4C, 0x01, // 00074C01
2492 0x00, 0x0B, 0x76, 0x75, // 000B7675
2493 0x00, 0x07, 0x0E, 0x01, // 00070E01
2494 0x00, 0x07, 0x44, 0x00, // 00074400
2495 0x00, 0x07, 0x04, 0x04, // 00070404
2496 0x00, 0x00, 0x00, 0x00, // 00000000
2497 0x00, 0x00, 0x00, 0x00, // 00000000
2498 0x00, 0x0B, 0x52, 0x40, // 000B5240
2499 0x00, 0x06, 0x80, 0x4B, // 0006804B
2500 0x00, 0x07, 0x44, 0x00, // 00074400
2501 0x00, 0x07, 0x05, 0x3D, // 0007053D
2502 0x00, 0x06, 0xB4, 0x15, // 0006B415
2503 0x00, 0x06, 0x8C, 0x2A, // 00068C2A
2504 0x00, 0x06, 0x94, 0x72, // 00069472
2505 0x00, 0x06, 0x80, 0x4B, // 0006804B
2506 0x00, 0x06, 0x00, 0x24, // 00060024
2507 0x00, 0x06, 0x08, 0x78, // 00060878
2508 0x00, 0x06, 0x18, 0x76, // 00061876
2509 0x00, 0x07, 0x54, 0x01, // 00075401
2510 0x00, 0x07, 0x16, 0x00, // 00071600
2511 0x00, 0x08, 0x89, 0x41, // 00088941
2512 0x00, 0x02, 0x9F, 0x08, // 00029F08
2513 0x00, 0x06, 0x00, 0x2C, // 0006002C
2514 0x00, 0x06, 0x08, 0x20, // 00060820
2515 0x00, 0x08, 0x80, 0xC1, // 000880C1
2516 0x00, 0x02, 0x86, 0x08, // 00028608
2517 0x00, 0x08, 0x00, 0xC2, // 000800C2
2518 0x00, 0x06, 0x0C, 0x26, // 00060C26
2519 0x00, 0x06, 0x14, 0x1C, // 0006141C
2520 0x00, 0x07, 0x5C, 0x01, // 00075C01
2521 0x00, 0x07, 0x1E, 0x00, // 00071E00
2522 0x00, 0x08, 0x89, 0xC2, // 000889C2
2523 0x00, 0x02, 0x86, 0x08, // 00028608
2524 0x00, 0x08, 0x09, 0xC3, // 000809C3
2525 0x00, 0x06, 0x24, 0x24, // 00062424
2526 0x00, 0x09, 0x22, 0xC4, // 000922C4
2527 0x00, 0x02, 0x86, 0x08, // 00028608
2528 0x00, 0x08, 0x24, 0xC3, // 000824C3
2529 0x00, 0x09, 0x29, 0xC4, // 000929C4
2530 0x00, 0x02, 0x86, 0x08, // 00028608
2531 0x00, 0x08, 0x0C, 0x40, // 00080C40
2532 0x00, 0x06, 0x24, 0x2E, // 0006242E
2533 0x00, 0x09, 0x22, 0xC4, // 000922C4
2534 0x00, 0x02, 0x86, 0x08, // 00028608
2535 0x00, 0x08, 0x24, 0xC3, // 000824C3
2536 0x00, 0x09, 0x29, 0xC4, // 000929C4
2537 0x00, 0x02, 0x86, 0x08, // 00028608
2538 0x00, 0x08, 0x0C, 0x40, // 00080C40
2539 0x00, 0x07, 0x54, 0x00, // 00075400
2540 0x00, 0x07, 0x14, 0x20, // 00071420
2541 0x00, 0x00, 0x00, 0x00, // 00000000
2542 0x00, 0x08, 0x80, 0xC2, // 000880C2
2543 0x00, 0x02, 0x86, 0x10, // 00028610
2544 0x00, 0x02, 0x1A, 0x86, // 00021A86
2545 0x00, 0x02, 0x81, 0x28, // 00028128
2546 0x00, 0x08, 0x89, 0xC2, // 000889C2
2547 0x00, 0x02, 0x86, 0x10, // 00028610
2548 0x00, 0x02, 0x1A, 0x86, // 00021A86
2549 0x00, 0x02, 0x81, 0x28, // 00028128
2550 0x00, 0x06, 0x28, 0x3A, // 0006283A
2551 0x00, 0x00, 0x00, 0x00, // 00000000
2552 0x00, 0x0A, 0xED, 0x5F, // 000AED5F
2553 0x00, 0x02, 0x9F, 0x18, // 00029F18
2554 0x00, 0x09, 0x2D, 0x54, // 00092D54
2555 0x00, 0x02, 0x86, 0x08, // 00028608
2556 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2557 0x00, 0x04, 0xB8, 0x0D, // 0004B80D
2558 0x00, 0x00, 0x00, 0x00, // 00000000
2559 0x00, 0x09, 0xBF, 0x7C, // 0009BF7C
2560 0x00, 0x06, 0x00, 0x78, // 00060078
2561 0x00, 0x00, 0x00, 0x00, // 00000000
2562 0x00, 0x08, 0x80, 0x41, // 00088041
2563 0x00, 0x02, 0x9F, 0x08, // 00029F08
2564 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2565 0x00, 0x01, 0x0D, 0x10, // 00010D10
2566 0x00, 0x06, 0x20, 0x76, // 00062076
2567 0x00, 0x09, 0x86, 0x8D, // 0009868D
2568 0x00, 0x09, 0x8E, 0x8D, // 00098E8D
2569 0x00, 0x08, 0xA4, 0x40, // 0008A440
2570 0x00, 0x02, 0x9F, 0x08, // 00029F08
2571 0x00, 0x08, 0x08, 0x40, // 00080840
2572 0x00, 0x0C, 0x31, 0x08, // 000C3108
2573 0x00, 0x0E, 0x31, 0x09, // 000E3109
2574 0x00, 0x00, 0x00, 0x00, // 00000000
2575 0x00, 0x00, 0x00, 0x00, // 00000000
2576 0x00, 0x0C, 0x01, 0x08, // 000C0108
2577 0x00, 0x0E, 0x01, 0x09, // 000E0109
2578 0x00, 0x00, 0x00, 0x00, // 00000000
2579 0x00, 0x00, 0x00, 0x00, // 00000000
2580 0x00, 0x00, 0x00, 0x00, // 00000000
2581 0x00, 0x0A, 0xF6, 0x7C, // 000AF67C
2582 0x00, 0x09, 0x9F, 0x7F, // 00099F7F
2583 0x00, 0x02, 0x82, 0x08, // 00028208
2584 0x00, 0x08, 0x36, 0x42, // 00083642
2585 0x00, 0x0A, 0xC0, 0x7C, // 000AC07C
2586 0x00, 0x09, 0xBF, 0x7F, // 0009BF7F
2587 0x00, 0x02, 0x82, 0x08, // 00028208
2588 0x00, 0x08, 0x00, 0x42, // 00080042
2589 0x00, 0x00, 0x00, 0x00, // 00000000
2590 0x00, 0x07, 0xF4, 0x0C, // 0007F40C
2591 0x00, 0x00, 0x00, 0x00, // 00000000
2592 0x00, 0x07, 0xC4, 0x0C, // 0007C40C
2593 0x00, 0x02, 0x16, 0x52, // 00021652
2594 0x00, 0x07, 0x4C, 0x06, // 00074C06
2595 0x00, 0x07, 0x0E, 0x56, // 00070E56
2596 0x00, 0x00, 0x00, 0x00, // 00000000
2597 0x00, 0x00, 0x00, 0x00, // 00000000
2598 0x00, 0x00, 0x00, 0x00, // 00000000
2599 0x00, 0x06, 0x88, 0x0F, // 0006880F
2600 0x00, 0x06, 0x00, 0x7B, // 0006007B
2601 0x00, 0x06, 0x10, 0x74, // 00061074
2602 0x00, 0x08, 0x00, 0x41, // 00080041
2603 0x00, 0x07, 0x5C, 0x00, // 00075C00
2604 0x00, 0x07, 0x1C, 0x30, // 00071C30
2605 0x00, 0x08, 0x92, 0x40, // 00089240
2606 0x00, 0x02, 0x9E, 0x18, // 00029E18
2607 0x00, 0x08, 0x88, 0xC3, // 000888C3
2608 0x00, 0x02, 0x9E, 0x08, // 00029E08
2609 0x00, 0x02, 0x15, 0xDB, // 000215DB
2610 0x00, 0x07, 0x4C, 0x06, // 00074C06
2611 0x00, 0x07, 0x0E, 0x66, // 00070E66
2612 0x00, 0x06, 0x80, 0x7B, // 0006807B
2613 0x00, 0x00, 0x00, 0x00, // 00000000
2614 0x00, 0x00, 0x00, 0x00, // 00000000
2615 0x00, 0x06, 0x88, 0x0E, // 0006880E
2616 0x00, 0x06, 0x00, 0x78, // 00060078
2617 0x00, 0x06, 0x08, 0x24, // 00060824
2618 0x00, 0x08, 0x80, 0x41, // 00088041
2619 0x00, 0x02, 0x9F, 0x08, // 00029F08
2620 0x00, 0x06, 0x08, 0x2C, // 0006082C
2621 0x00, 0x06, 0x34, 0x26, // 00063426
2622 0x00, 0x00, 0x00, 0x00, // 00000000
2623 0x00, 0x08, 0x86, 0xC1, // 000886C1
2624 0x00, 0x07, 0x5C, 0x00, // 00075C00
2625 0x00, 0x07, 0x1F, 0x00, // 00071F00
2626 0x00, 0x07, 0x54, 0x01, // 00075401
2627 0x00, 0x07, 0x16, 0x00, // 00071600
2628 0x00, 0x08, 0xA8, 0xC3, // 0008A8C3
2629 0x00, 0x02, 0x87, 0x08, // 00028708
2630 0x00, 0x08, 0x80, 0xC2, // 000880C2
2631 0x00, 0x06, 0x20, 0x74, // 00062074
2632 0x00, 0x08, 0x28, 0xC3, // 000828C3
2633 0x00, 0x02, 0x86, 0x08, // 00028608
2634 0x00, 0x08, 0x00, 0xC2, // 000800C2
2635 0x00, 0x06, 0x18, 0x79, // 00061879
2636 0x00, 0x06, 0x14, 0x6E, // 0006146E
2637 0x00, 0x08, 0xA4, 0x41, // 0008A441
2638 0x00, 0x02, 0x9E, 0x20, // 00029E20
2639 0x00, 0x08, 0xBB, 0x42, // 0008BB42
2640 0x00, 0x02, 0x9E, 0x10, // 00029E10
2641 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
2642 0x00, 0x08, 0x10, 0x40, // 00081040
2643 0x00, 0x00, 0x00, 0x00, // 00000000
2644 0x00, 0x00, 0x00, 0x00, // 00000000
2645 0x00, 0x06, 0x98, 0x79, // 00069879
2646 0x00, 0x06, 0x94, 0x6E, // 0006946E
2647 0x00, 0x00, 0x00, 0x00, // 00000000
2648 0x00, 0x06, 0x00, 0x78, // 00060078
2649 0x00, 0x06, 0x08, 0x24, // 00060824
2650 0x00, 0x08, 0x80, 0x41, // 00088041
2651 0x00, 0x02, 0x9F, 0x08, // 00029F08
2652 0x00, 0x06, 0x08, 0x2C, // 0006082C
2653 0x00, 0x06, 0x00, 0x1C, // 0006001C
2654 0x00, 0x07, 0x54, 0x01, // 00075401
2655 0x00, 0x07, 0x16, 0x00, // 00071600
2656 0x00, 0x06, 0x18, 0x71, // 00061871
2657 0x00, 0x00, 0x00, 0x00, // 00000000
2658 0x00, 0x06, 0x24, 0x6B, // 0006246B
2659 0x00, 0x08, 0xA9, 0xC0, // 0008A9C0
2660 0x00, 0x02, 0x86, 0x08, // 00028608
2661 0x00, 0x08, 0x2D, 0xC2, // 00082DC2
2662 0x00, 0x08, 0xB4, 0x41, // 0008B441
2663 0x00, 0x02, 0x9F, 0x10, // 00029F10
2664 0x00, 0x02, 0x1A, 0xA5, // 00021AA5
2665 0x00, 0x02, 0x81, 0x28, // 00028128
2666 0x00, 0x08, 0xB5, 0x42, // 0008B542
2667 0x00, 0x02, 0x86, 0x10, // 00028610
2668 0x00, 0x02, 0x1A, 0xA5, // 00021AA5
2669 0x00, 0x02, 0x81, 0x28, // 00028128
2670 0x00, 0x06, 0x34, 0x26, // 00063426
2671 0x00, 0x0A, 0xD1, 0x41, // 000AD141
2672 0x00, 0x0A, 0xF6, 0x7E, // 000AF67E
2673 0x00, 0x08, 0x12, 0xC6, // 000812C6
2674 0x00, 0x0B, 0x64, 0x40, // 000B6440
2675 0x00, 0x0A, 0xC2, 0x7E, // 000AC27E
2676 0x00, 0x00, 0x00, 0x00, // 00000000
2677 0x00, 0x00, 0x00, 0x00, // 00000000
2678 0x00, 0x06, 0xA4, 0x6B, // 0006A46B
2679 0x00, 0x07, 0x64, 0x00, // 00076400
2680 0x00, 0x07, 0x24, 0x25, // 00072425
2681 0x00, 0x08, 0x93, 0xC5, // 000893C5
2682 0x00, 0x06, 0xA8, 0x71, // 0006A871
2683 0x00, 0x08, 0x9C, 0xC2, // 00089CC2
2684 0x00, 0x02, 0x88, 0x10, // 00028810
2685 0x00, 0x02, 0x1B, 0x86, // 00021B86
2686 0x00, 0x02, 0x81, 0x28, // 00028128
2687 0x00, 0x06, 0x00, 0x78, // 00060078
2688 0x00, 0x06, 0x18, 0x52, // 00061852
2689 0x00, 0x07, 0x54, 0x08, // 00075408
2690 0x00, 0x07, 0x14, 0x00, // 00071400
2691 0x00, 0x07, 0x7C, 0x06, // 00077C06
2692 0x00, 0x07, 0x3E, 0xFD, // 00073EFD
2693 0x00, 0x08, 0x80, 0x41, // 00088041
2694 0x00, 0x02, 0x9F, 0x20, // 00029F20
2695 0x00, 0x0A, 0xC3, 0xC2, // 000AC3C2
2696 0x00, 0x02, 0x9E, 0x10, // 00029E10
2697 0x00, 0x02, 0x1B, 0xA7, // 00021BA7
2698 0x00, 0x02, 0x81, 0x28, // 00028128
2699 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
2700 0x00, 0x06, 0x34, 0x26, // 00063426
2701 0x00, 0x06, 0x3C, 0x1C, // 00063C1C
2702 0x00, 0x07, 0x54, 0x01, // 00075401
2703 0x00, 0x07, 0x16, 0x00, // 00071600
2704 0x00, 0x06, 0x18, 0x70, // 00061870
2705 0x00, 0x08, 0x86, 0xC7, // 000886C7
2706 0x00, 0x02, 0x86, 0x08, // 00028608
2707 0x00, 0x08, 0x00, 0xC2, // 000800C2
2708 0x00, 0x07, 0x64, 0x00, // 00076400
2709 0x00, 0x07, 0x24, 0x25, // 00072425
2710 0x00, 0x06, 0x28, 0x79, // 00062879
2711 0x00, 0x08, 0x93, 0xC0, // 000893C0
2712 0x00, 0x06, 0x80, 0x70, // 00068070
2713 0x00, 0x08, 0x94, 0xC2, // 000894C2
2714 0x00, 0x02, 0x88, 0x38, // 00028838
2715 0x00, 0x08, 0xBD, 0x41, // 0008BD41
2716 0x00, 0x02, 0x9E, 0x08, // 00029E08
2717 0x00, 0x09, 0xAD, 0x41, // 0009AD41
2718 0x00, 0x07, 0x7C, 0x06, // 00077C06
2719 0x00, 0x07, 0x3E, 0xFD, // 00073EFD
2720 0x00, 0x02, 0x1B, 0xB0, // 00021BB0
2721 0x00, 0x02, 0x81, 0x28, // 00028128
2722 0x00, 0x06, 0xA8, 0x79, // 0006A879
2723 0x00, 0x06, 0xB8, 0x0F, // 0006B80F
2724 0x00, 0x06, 0x14, 0x26, // 00061426
2725 0x00, 0x06, 0x20, 0x7D, // 0006207D
2726 0x00, 0x06, 0x28, 0x7C, // 0006287C
2727 0x00, 0x08, 0x32, 0x60, // 00083260
2728 0x00, 0x02, 0x86, 0x18, // 00028618
2729 0x00, 0x08, 0x2D, 0xC4, // 00082DC4
2730 0x00, 0x0B, 0x64, 0x40, // 000B6440
2731 0x00, 0x02, 0x81, 0x08, // 00028108
2732 0x00, 0x0B, 0x64, 0x7F, // 000B647F
2733 0x00, 0x00, 0x00, 0x00, // 00000000
2734 0x00, 0x00, 0x00, 0x00, // 00000000
2735 0x00, 0x06, 0xA8, 0x7C, // 0006A87C
2736 0x00, 0x06, 0xA0, 0x7D, // 0006A07D
2737 0x00, 0x07, 0x7C, 0x00, // 00077C00
2738 0x00, 0x07, 0x3C, 0x01, // 00073C01
2739 0x00, 0x06, 0x00, 0x7C, // 0006007C
2740 0x00, 0x06, 0x30, 0x79, // 00063079
2741 0x00, 0x08, 0xBF, 0xC0, // 0008BFC0
2742 0x00, 0x02, 0x88, 0xC0, // 000288C0
2743 0x00, 0x08, 0xB6, 0x41, // 0008B641
2744 0x00, 0x02, 0x9E, 0xB0, // 00029EB0
2745 0x00, 0x0B, 0x40, 0x40, // 000B4040
2746 0x00, 0x08, 0xBA, 0xC1, // 0008BAC1
2747 0x00, 0x06, 0x34, 0x6E, // 0006346E
2748 0x00, 0x08, 0xBF, 0xC6, // 0008BFC6
2749 0x00, 0x07, 0x5C, 0x00, // 00075C00
2750 0x00, 0x07, 0x1F, 0x00, // 00071F00
2751 0x00, 0x07, 0x54, 0x01, // 00075401
2752 0x00, 0x07, 0x16, 0x00, // 00071600
2753 0x00, 0x08, 0xAF, 0xC3, // 0008AFC3
2754 0x00, 0x02, 0x87, 0x08, // 00028708
2755 0x00, 0x08, 0xBF, 0xC2, // 0008BFC2
2756 0x00, 0x08, 0x2F, 0xC3, // 00082FC3
2757 0x00, 0x02, 0x86, 0x08, // 00028608
2758 0x00, 0x08, 0x3F, 0xC2, // 00083FC2
2759 0x00, 0x00, 0x00, 0x00, // 00000000
2760 0x00, 0x02, 0x1C, 0x15, // 00021C15
2761 0x00, 0x07, 0x4C, 0x06, // 00074C06
2762 0x00, 0x07, 0x0E, 0xFD, // 00070EFD
2763 0x00, 0x00, 0x00, 0x00, // 00000000
2764 0x00, 0x00, 0x00, 0x00, // 00000000
2765 0x00, 0x06, 0x80, 0x7C, // 0006807C
2766 0x00, 0x06, 0x88, 0x0F, // 0006880F
2767 0x00, 0x00, 0x00, 0x00, // 00000000
2768 0x00, 0x06, 0x04, 0x64, // 00060464
2769 0x00, 0x06, 0x0C, 0x72, // 00060C72
2770 0x00, 0x06, 0x10, 0x74, // 00061074
2771 0x00, 0x08, 0x80, 0x40, // 00088040
2772 0x00, 0x02, 0x9F, 0x40, // 00029F40
2773 0x00, 0x08, 0x89, 0x40, // 00088940
2774 0x00, 0x02, 0x9F, 0x10, // 00029F10
2775 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2776 0x00, 0x02, 0x81, 0x28, // 00028128
2777 0x00, 0x08, 0x92, 0x40, // 00089240
2778 0x00, 0x02, 0x9E, 0x10, // 00029E10
2779 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2780 0x00, 0x02, 0x81, 0x28, // 00028128
2781 0x00, 0x07, 0x44, 0x01, // 00074401
2782 0x00, 0x07, 0x06, 0x61, // 00070661
2783 0x00, 0x07, 0x4C, 0x00, // 00074C00
2784 0x00, 0x07, 0x0C, 0x01, // 00070C01
2785 0x00, 0x00, 0x00, 0x00, // 00000000
2786 0x00, 0x06, 0x80, 0x22, // 00068022
2787 0x00, 0x04, 0x07, 0x00, // 00040700
2788 0x00, 0x0A, 0xC9, 0xC0, // 000AC9C0
2789 0x00, 0x02, 0x9F, 0x10, // 00029F10
2790 0x00, 0x08, 0x80, 0x41, // 00088041
2791 0x00, 0x02, 0x81, 0x10, // 00028110
2792 0x00, 0x02, 0x1B, 0x68, // 00021B68
2793 0x00, 0x02, 0x81, 0x28, // 00028128
2794 0x00, 0x07, 0x80, 0x07, // 00078007
2795 0x00, 0x07, 0x44, 0x01, // 00074401
2796 0x00, 0x07, 0x06, 0x61, // 00070661
2797 0x00, 0x07, 0x4C, 0x0C, // 00074C0C
2798 0x00, 0x07, 0x0C, 0x00, // 00070C00
2799 0x00, 0x06, 0x14, 0x64, // 00061464
2800 0x00, 0x06, 0x80, 0x22, // 00068022
2801 0x00, 0x0A, 0xC7, 0x81, // 000AC781
2802 0x00, 0x02, 0x9E, 0x08, // 00029E08
2803 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2804 0x00, 0x00, 0x00, 0x00, // 00000000
2805 0x00, 0x00, 0x00, 0x00, // 00000000
2806 0x00, 0x00, 0x00, 0x00, // 00000000
2807 0x00, 0x06, 0x94, 0x64, // 00069464
2808 0x00, 0x07, 0x44, 0x01, // 00074401
2809 0x00, 0x07, 0x06, 0x69, // 00070669
2810 0x00, 0x07, 0x4C, 0x00, // 00074C00
2811 0x00, 0x07, 0x0C, 0x02, // 00070C02
2812 0x00, 0x06, 0x10, 0x7A, // 0006107A
2813 0x00, 0x06, 0x20, 0x1C, // 0006201C
2814 0x00, 0x06, 0x80, 0x22, // 00068022
2815 0x00, 0x0A, 0xC3, 0x81, // 000AC381
2816 0x00, 0x02, 0x9F, 0x10, // 00029F10
2817 0x00, 0x0B, 0x52, 0x7F, // 000B527F
2818 0x00, 0x02, 0x81, 0x48, // 00028148
2819 0x00, 0x08, 0x9A, 0x41, // 00089A41
2820 0x00, 0x02, 0x9E, 0x38, // 00029E38
2821 0x00, 0x06, 0x00, 0x78, // 00060078
2822 0x00, 0x06, 0x08, 0x24, // 00060824
2823 0x00, 0x08, 0x80, 0x41, // 00088041
2824 0x00, 0x02, 0x9F, 0x08, // 00029F08
2825 0x00, 0x06, 0x08, 0x2C, // 0006082C
2826 0x00, 0x0B, 0x52, 0x40, // 000B5240
2827 0x00, 0x0A, 0xE1, 0x7E, // 000AE17E
2828 0x00, 0x00, 0x00, 0x00, // 00000000
2829 0x00, 0x00, 0x00, 0x00, // 00000000
2830 0x00, 0x06, 0x90, 0x7A, // 0006907A
2831 0x00, 0x06, 0xA0, 0x1C, // 0006A01C
2832 0x00, 0x07, 0x44, 0x01, // 00074401
2833 0x00, 0x07, 0x06, 0x69, // 00070669
2834 0x00, 0x07, 0x4C, 0x00, // 00074C00
2835 0x00, 0x07, 0x0C, 0x01, // 00070C01
2836 0x00, 0x07, 0x44, 0x01, // 00074401
2837 0x00, 0x07, 0x06, 0x6C, // 0007066C
2838 0x00, 0x06, 0x80, 0x22, // 00068022
2839 0x00, 0x0A, 0xCF, 0x81, // 000ACF81
2840 0x00, 0x06, 0x18, 0x77, // 00061877
2841 0x00, 0x06, 0x80, 0x22, // 00068022
2842 0x00, 0x0B, 0x09, 0xC3, // 000B09C3
2843 0x00, 0x02, 0x9E, 0x10, // 00029E10
2844 0x00, 0x02, 0x1B, 0x68, // 00021B68
2845 0x00, 0x02, 0x81, 0x28, // 00028128
2846 0x00, 0x06, 0x24, 0x6B, // 0006246B
2847 0x00, 0x0B, 0x1B, 0x41, // 000B1B41
2848 0x00, 0x06, 0x14, 0x65, // 00061465
2849 0x00, 0x06, 0x04, 0x6A, // 0006046A
2850 0x00, 0x08, 0x28, 0x41, // 00082841
2851 0x00, 0x02, 0x9F, 0x08, // 00029F08
2852 0x00, 0x08, 0x82, 0xC0, // 000882C0
2853 0x00, 0x08, 0xA4, 0x40, // 0008A440
2854 0x00, 0x02, 0x9E, 0x10, // 00029E10
2855 0x00, 0x02, 0x1B, 0x66, // 00021B66
2856 0x00, 0x02, 0x81, 0x28, // 00028128
2857 0x00, 0x0B, 0x40, 0x41, // 000B4041
2858 0x00, 0x0B, 0x64, 0x40, // 000B6440
2859 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2860 0x00, 0x0B, 0x76, 0x40, // 000B7640
2861 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2862 0x00, 0x08, 0x9B, 0x40, // 00089B40
2863 0x00, 0x02, 0x9E, 0x28, // 00029E28
2864 0x00, 0x04, 0x27, 0x08, // 00042708
2865 0x00, 0x04, 0x2F, 0x08, // 00042F08
2866 0x00, 0x04, 0x37, 0x08, // 00043708
2867 0x00, 0x04, 0x3F, 0x08, // 00043F08
2868 0x00, 0x07, 0xA0, 0x0D, // 0007A00D
2869 0x00, 0x07, 0xA8, 0x0D, // 0007A80D
2870 0x00, 0x07, 0xB0, 0x0D, // 0007B00D
2871 0x00, 0x07, 0xB8, 0x0D, // 0007B80D
2872 0x00, 0x06, 0x98, 0x77, // 00069877
2873 0x00, 0x06, 0x84, 0x6A, // 0006846A
2874 0x00, 0x00, 0x00, 0x00, // 00000000
2875 0x00, 0x06, 0x00, 0x6D, // 0006006D
2876 0x00, 0x00, 0x00, 0x00, // 00000000
2877 0x00, 0x08, 0x80, 0x41, // 00088041
2878 0x00, 0x00, 0x00, 0x00, // 00000000
2879 0x00, 0x00, 0x00, 0x00, // 00000000
2880 0x00, 0x00, 0x00, 0x00, // 00000000
2881 0x00, 0x06, 0xC0, 0x6D, // 0006C06D
2882 0x00, 0x00, 0x00, 0x00, // 00000000
2883 0x00, 0x02, 0x3F, 0xCC, // 00023FCC
2884 0x00, 0x07, 0x6C, 0x06, // 00076C06
2885 0x00, 0x07, 0x2F, 0x78, // 00072F78
2886 0x00, 0x00, 0x00, 0x00, // 00000000
2887 0x00, 0x00, 0x00, 0x00, // 00000000
2888 0x00, 0x00, 0x00, 0x00, // 00000000
2889 0x00, 0x00, 0x00, 0x00, // 00000000
2890 0x00, 0x02, 0x19, 0x5B, // 0002195B
2891 0x00, 0x02, 0x81, 0x28, // 00028128
2892 0x00, 0x00, 0x00, 0x00, // 00000000
2893 0x00, 0x00, 0x00, 0x00, // 00000000
2894 0x00, 0x00, 0x00, 0x00, // 00000000
2895 0x00, 0x00, 0x00, 0x00, // 00000000
2896 0x00, 0x00, 0x00, 0x00, // 00000000
2897 0x00, 0x00, 0xC1, 0x80, // 0000C180
2898 0x00, 0x00, 0x00, 0x00, // 00000000
2899 0x00, 0x00, 0x00, 0x00, // 00000000
2900 0x00, 0x00, 0x00, 0x00, // 00000000
2901 0x00, 0x00, 0x00, 0x00, // 00000000
2902 0x00, 0x00, 0x00, 0x00, // 00000000
2903 0x00, 0x00, 0x00, 0x00, // 00000000
2904 0x00, 0x06, 0x00, 0x1C, // 0006001C
2905 0x00, 0x07, 0x6C, 0x01, // 00076C01
2906 0x00, 0x07, 0x2E, 0x00, // 00072E00
2907 0x00, 0x07, 0x7C, 0x01, // 00077C01
2908 0x00, 0x07, 0x3E, 0x68, // 00073E68
2909 0x00, 0x0A, 0xF1, 0x7E, // 000AF17E
2910 0x00, 0x09, 0x00, 0xC6, // 000900C6
2911 0x00, 0x02, 0x88, 0x08, // 00028808
2912 0x00, 0x08, 0x00, 0xC5, // 000800C5
2913 0x00, 0x06, 0x2C, 0x64, // 00062C64
2914 0x00, 0x0A, 0x00, 0x7F, // 000A007F
2915 0x00, 0x06, 0x20, 0x7A, // 0006207A
2916 0x00, 0x06, 0xB8, 0x22, // 0006B822
2917 0x00, 0x04, 0x3F, 0x00, // 00043F00
2918 0x00, 0x08, 0xA4, 0x40, // 0008A440
2919 0x00, 0x02, 0x9E, 0x08, // 00029E08
2920 0x00, 0x08, 0x3F, 0xC0, // 00083FC0
2921 0x00, 0x08, 0xAD, 0x40, // 0008AD40
2922 0x00, 0x02, 0x9F, 0x10, // 00029F10
2923 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
2924 0x00, 0x02, 0x81, 0x28, // 00028128
2925 0x00, 0x06, 0x2C, 0x7F, // 00062C7F
2926 0x00, 0x08, 0xA4, 0x40, // 0008A440
2927 0x00, 0x02, 0x9E, 0x08, // 00029E08
2928 0x00, 0x0B, 0x6D, 0x6F, // 000B6D6F
2929 0x00, 0x0B, 0x40, 0x7F, // 000B407F
2930 0x00, 0x02, 0x1A, 0xAD, // 00021AAD
2931 0x00, 0x06, 0xB0, 0x1C, // 0006B01C
2932 0x00, 0x0A, 0xFF, 0x7E, // 000AFF7E
2933 0x00, 0x00, 0x00, 0x00, // 00000000
2934 0x00, 0x06, 0x84, 0x72, // 00068472
2935 0x00, 0x06, 0xAC, 0x7F, // 0006AC7F
2936 0x00, 0x07, 0xB8, 0x07, // 0007B807
2937 0x00, 0x06, 0x10, 0x2C, // 0006102C
2938 0x00, 0x0B, 0x64, 0x6D, // 000B646D
2939 0x00, 0x0A, 0xD2, 0x7E, // 000AD27E
2940 0x00, 0x0B, 0x5B, 0x7F, // 000B5B7F
2941 0x00, 0x00, 0x00, 0x00, // 00000000
2942 0x00, 0x02, 0x81, 0x20, // 00028120
2943 0x00, 0x06, 0x90, 0x1C, // 0006901C
2944 0x00, 0x06, 0x90, 0x20, // 00069020
2945 0x00, 0x06, 0x9C, 0x7B, // 00069C7B
2946 0x00, 0x0B, 0x64, 0x6E, // 000B646E
2947 0x00, 0x06, 0x34, 0x6D, // 0006346D
2948 0x00, 0x00, 0x00, 0x00, // 00000000
2949 0x00, 0x00, 0x00, 0x00, // 00000000
2950 0x00, 0x06, 0xA4, 0x7F, // 0006A47F
2951 0x00, 0x06, 0xB4, 0x0F, // 0006B40F
2952 0x00, 0x06, 0xB4, 0x6C, // 0006B46C
2953 0x00, 0x0B, 0x76, 0x7F, // 000B767F
2954 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2955 0x00, 0x0B, 0x6D, 0x40, // 000B6D40
2956 0x00, 0x08, 0x3F, 0x40, // 00083F40
2957 0x00, 0x0B, 0x40, 0x40, // 000B4040
2958 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2959 0x00, 0x06, 0xB4, 0x6B, // 0006B46B
2960 0x00, 0x04, 0xB0, 0x0D, // 0004B00D
2961 0x00, 0x00, 0x00, 0x00, // 00000000
2962 0x00, 0x09, 0xB6, 0x7C, // 0009B67C
2963 0x00, 0x01, 0x05, 0x10, // 00010510
2964 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
2965 0x00, 0x02, 0x82, 0x08, // 00028208
2966 0x00, 0x08, 0x00, 0x42, // 00080042
2967 0x00, 0x0B, 0x7F, 0x40, // 000B7F40
2968 0x00, 0x09, 0xB6, 0x7F, // 0009B67F
2969 0x00, 0x02, 0x82, 0x08, // 00028208
2970 0x00, 0x08, 0x3F, 0x42, // 00083F42
2971 0x00, 0x07, 0x84, 0x0C, // 0007840C
2972 0x00, 0x0B, 0x40, 0x40, // 000B4040
2973 0x00, 0x09, 0xA6, 0x7F, // 0009A67F
2974 0x00, 0x07, 0xBC, 0x0C, // 0007BC0C
2975 0x00, 0x07, 0x64, 0x00, // 00076400
2976 0x00, 0x07, 0x24, 0x30, // 00072430
2977 0x00, 0x08, 0x2D, 0x41, // 00082D41
2978 0x00, 0x08, 0xA4, 0xC5, // 0008A4C5
2979 0x00, 0x02, 0x9F, 0x10, // 00029F10
2980 0x00, 0x02, 0x1B, 0xBE, // 00021BBE
2981 0x00, 0x02, 0x81, 0x28, // 00028128
2982 0x00, 0x07, 0x7C, 0x00, // 00077C00
2983 0x00, 0x07, 0x3F, 0x18, // 00073F18
2984 0x00, 0x06, 0x00, 0x78, // 00060078
2985 0x00, 0x06, 0x10, 0x24, // 00061024
2986 0x00, 0x08, 0x80, 0x41, // 00088041
2987 0x00, 0x00, 0x00, 0x00, // 00000000
2988 0x00, 0x02, 0x9F, 0x18, // 00029F18
2989 0x00, 0x07, 0x7C, 0x00, // 00077C00
2990 0x00, 0x07, 0x3C, 0x00, // 00073C00
2991 0x00, 0x06, 0x10, 0x2C, // 0006102C
2992 0x00, 0x00, 0x00, 0x00, // 00000000
2993 0x00, 0x0A, 0xD2, 0x7E, // 000AD27E
2994 0x00, 0x00, 0x00, 0x00, // 00000000
2995 0x00, 0x00, 0x00, 0x00, // 00000000
2996 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
2997 0x00, 0x06, 0x04, 0x64, // 00060464
2998 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
2999 0x00, 0x08, 0x80, 0x41, // 00088041
3000 0x00, 0x00, 0xDE, 0x87, // 0000DE87
3001 0x00, 0x06, 0x90, 0x1C, // 0006901C
3002 0x00, 0x06, 0x90, 0x20, // 00069020
3003 0x00, 0x06, 0x9C, 0x62, // 00069C62
3004 0x00, 0x06, 0x9C, 0x6E, // 00069C6E
3005 0x00, 0x06, 0x9C, 0x63, // 00069C63
3006 0x00, 0x06, 0xAC, 0x7D, // 0006AC7D
3007 0x00, 0x00, 0x00, 0x00, // 00000000
3008 0x00, 0x06, 0x04, 0x73, // 00060473
3009 0x00, 0x07, 0x5C, 0x01, // 00075C01
3010 0x00, 0x07, 0x1E, 0x00, // 00071E00
3011 0x00, 0x08, 0x80, 0x41, // 00088041
3012 0x00, 0x02, 0x9E, 0x10, // 00029E10
3013 0x00, 0x02, 0x1B, 0x7F, // 00021B7F
3014 0x00, 0x02, 0x81, 0x28, // 00028128
3015 0x00, 0x0B, 0x40, 0x7F, // 000B407F
3016 0x00, 0x08, 0x12, 0x42, // 00081242
3017 0x00, 0x09, 0x1B, 0xC2, // 00091BC2
3018 0x00, 0x02, 0x87, 0x08, // 00028708
3019 0x00, 0x08, 0x92, 0xC3, // 000892C3
3020 0x00, 0x06, 0x84, 0x73, // 00068473
3021 0x00, 0x07, 0x64, 0x00, // 00076400
3022 0x00, 0x07, 0x27, 0x00, // 00072700
3023 0x00, 0x07, 0x7C, 0x00, // 00077C00
3024 0x00, 0x07, 0x3C, 0x00, // 00073C00
3025 0x00, 0x0B, 0x5B, 0x40, // 000B5B40
3026 0x00, 0x0B, 0x6D, 0x7F, // 000B6D7F
3027 0x00, 0x06, 0xA4, 0x05, // 0006A405
3028 0x00, 0x01, 0x41, 0x80, // 00014180
3029 0x00, 0x06, 0xB8, 0x22, // 0006B822
3030 0x00, 0x07, 0x98, 0x0F, // 0007980F
3031 0x00, 0x00, 0x00, 0x00, // 00000000
3032 0x00, 0x07, 0x98, 0x0F, // 0007980F
3033 0x00, 0x00, 0xC1, 0x87, // 0000C187
3034 0x00, 0x06, 0x90, 0x1C, // 0006901C
3035 0x00, 0x06, 0x9C, 0x62, // 00069C62
3036 0x00, 0x00, 0x00, 0x00, // 00000000
3037 0x00, 0x06, 0x9C, 0x63, // 00069C63
3038 0x00, 0x06, 0x9C, 0x6E, // 00069C6E
3039 0x00, 0x06, 0xAC, 0x7D, // 0006AC7D
3040 0x00, 0x00, 0xC1, 0x07, // 0000C107
3041 0x00, 0x0B, 0x40, 0x40, // 000B4040
3042 0x00, 0x00, 0x00, 0x00, // 00000000
3043 0x00, 0x00, 0x00, 0x00, // 00000000
3044 0x00, 0x00, 0x00, 0x00, // 00000000
3045 0x00, 0x06, 0x84, 0x62, // 00068462
3046 0x00, 0x06, 0x84, 0x63, // 00068463
3047 0x00, 0x06, 0x04, 0x62, // 00060462
3048 0x00, 0x06, 0x1C, 0x63, // 00061C63
3049 0x00, 0x0A, 0x0F, 0x41, // 000A0F41
3050 0x00, 0x08, 0x97, 0xC0, // 000897C0
3051 0x00, 0x08, 0x1B, 0xC2, // 00081BC2
3052 0x00, 0x0A, 0x12, 0x47, // 000A1247
3053 0x00, 0x07, 0x65, 0x00, // 00076500
3054 0x00, 0x07, 0x24, 0x00, // 00072400
3055 0x00, 0x07, 0x6D, 0x00, // 00076D00
3056 0x00, 0x07, 0x2C, 0x00, // 00072C00
3057 0x00, 0x07, 0x75, 0x00, // 00077500
3058 0x00, 0x07, 0x34, 0x00, // 00073400
3059 0x00, 0x0C, 0x12, 0x25, // 000C1225
3060 0x00, 0x0E, 0x11, 0x24, // 000E1124
3061 0x00, 0x0E, 0x13, 0x26, // 000E1326
3062 0x00, 0x00, 0x00, 0x00, // 00000000
3063 0x00, 0x00, 0x00, 0x00, // 00000000
3064 0x00, 0x06, 0x04, 0x6C, // 0006046C
3065 0x00, 0x00, 0xC1, 0x07, // 0000C107
3066 0x00, 0x09, 0x12, 0xC0, // 000912C0
3067 0x00, 0x06, 0xBC, 0x62, // 0006BC62
3068 0x00, 0x06, 0x9C, 0x63, // 00069C63
3069 0x00, 0x00, 0x00, 0x00, // 00000000
3070 0x00, 0x06, 0x94, 0x6C, // 0006946C
3071 0x00, 0x06, 0x94, 0x0F, // 0006940F
3072 0x00, 0x03, 0x33, 0x33, // 00033333
3073 0x00, 0x00, 0x00, 0x00, // 00000000
3074 0x00, 0x00, 0x00, 0x00, // 00000000
3075 0x00, 0x00, 0x00, 0x00, // 00000000
3076 0x00, 0x00, 0x00, 0x00, // 00000000
3077 0x00, 0x00, 0x00, 0x00, // 00000000
3078 0x00, 0x00, 0x00, 0x00, // 00000000
3079};
3080
3081struct i2c_block {
3082 const unsigned char *data;
3083 unsigned len;
3084};
3085
3086static struct i2c_block maspcm[] = {
3087 { maspcm_array1, sizeof(maspcm_array1) },
3088 { maspcm_array2, sizeof(maspcm_array2) },
3089 { maspcm_array3, sizeof(maspcm_array3) },
3090 { maspcm_array4, sizeof(maspcm_array4) },
3091 { maspcm_array5, sizeof(maspcm_array5) },
3092 { maspcm_array6, sizeof(maspcm_array6) },
3093 { maspcm_array7, sizeof(maspcm_array7) },
3094 { maspcm_array8, sizeof(maspcm_array8) },
3095 { maspcm_array9, sizeof(maspcm_array9) },
3096 { maspcm_array10, sizeof(maspcm_array10) },
3097};
3098
3099/************ End of MAS pcm codec ************/
3100
3101#define WAVRECORD_QUIT BUTTON_OFF
3102
3103#define CFGFILE_VERSION 0 /* Current config file version */
3104#define CFGFILE_MINVERSION 0 /* Minimum config file version to accept */
3105
3106#define PCM_MAIN_IO_CONTROL 0x0661
3107#define PCM_IF_STATUS_CONTROL 0x0662
3108#define PCM_OFREQ_CONTROL 0x0663
3109#define PCM_OUTPUT_CLOCK_CONF 0x0664
3110#define PCM_FRAME_COUNTER 0x0665
3111#define PCM_APP_RUNNING 0x0666
3112#define PCM_SAMPLE_RATE_STATUS 0x0667
3113#define PCM_BUFFER_ERROR_COUNTER 0x0668
3114#define PCM_SOFT_MUTE 0x0669
3115#define PCM_SPDIF_CHANNEL_STATUS 0x066a
3116#define PCM_SAMPLE_RATE 0x066b
3117#define PCM_VOL_OUT_LL 0x066c
3118#define PCM_VOL_OUT_RL 0x066d
3119#define PCM_VOL_OUT_LR 0x066e
3120#define PCM_VOL_OUT_RR 0x066f
3121#define PCM_VOL_IN_LL 0x0670
3122#define PCM_VOL_IN_RL 0x0671
3123#define PCM_VOL_IN_LR 0x0672
3124#define PCM_VOL_IN_RR 0x0673
3125
3126#define IRQ3 (*((volatile unsigned long*)0x0900010C))
3127
3128#define LOW_WATER_CHUNKSIZE (256*1024)
3129
3130/* declarations */
3131
3132struct riff_header
3133{
3134 uint8_t riff_id[4]; /* 00h - "RIFF" */
3135 uint32_t riff_size; /* 04h - sz following headers + data_size */
3136 /* format header */
3137 uint8_t format[4]; /* 08h - "WAVE" */
3138 uint8_t format_id[4]; /* 0Ch - "fmt " */
3139 uint32_t format_size; /* 10h - 16 for PCM (sz format data) */
3140 /* format data */
3141 uint16_t audio_format; /* 14h - 1=PCM */
3142 uint16_t num_channels; /* 16h - 1=M, 2=S, etc. */
3143 uint32_t sample_rate; /* 18h - HZ */
3144 uint32_t byte_rate; /* 1Ch - num_channels*sample_rate*bits_per_sample/8 */
3145 uint16_t block_align; /* 20h - num_channels*bits_per_samples/8 */
3146 uint16_t bits_per_sample; /* 22h - 8=8 bits, 16=16 bits, etc. */
3147 /* Not for audio_format=1 (PCM) */
3148/* unsigned short extra_param_size; 24h - size of extra data */
3149/* unsigned char *extra_params; */
3150 /* data header */
3151 uint8_t data_id[4]; /* 24h - "data" */
3152 uint32_t data_size; /* 28h - num_samples*num_channels*bits_per_sample/8 */
3153/* unsigned char *data; 2ch - actual sound data */
3154} __attribute__((packed));
3155
3156#define RIFF_FMT_HEADER_SIZE 12 /* format -> format_size */
3157#define RIFF_FMT_DATA_SIZE 16 /* audio_format -> bits_per_sample */
3158#define RIFF_DATA_HEADER_SIZE 8 /* data_id -> data_size */
3159
3160#define PCM_DEPTH_BYTES 2
3161#define PCM_DEPTH_BITS 16
3162
3163/* Define our own source constants since REC_SRC_FMRADIO will intrude on the count */
3164enum {
3165 WAV_SRC_LINE = 0,
3166 WAV_SRC_MIC,
3167#ifdef HAVE_SPDIF_REC
3168 WAV_SRC_SPDIF,
3169#endif
3170 WAV_NUM_SRC,
3171};
3172
3173void rec_tick(void) __attribute__((interrupt_handler));
3174
3175/* settings */
3176struct rec_config {
3177 int samplerate; /* index */
3178 int channels;
3179 int source;
3180};
3181
3182struct rec_config reccfg_disk = { 7, 1, 0 };
3183struct rec_config reccfg; /* running config */
3184
3185static const char cfg_filename[] = "wavrecord.cfg";
3186static char *samplerate_str[9] = { "8000", "11025", "12000",
3187 "16000", "22050", "24000",
3188 "32000", "44100", "48000" };
3189static char *channel_str[2] = { "mono", "stereo" };
3190static char *source_str[WAV_NUM_SRC] = { "line in", "mic",
3191 HAVE_SPDIF_REC_("spdif",) };
3192
3193struct configdata disk_config[] = {
3194 { TYPE_ENUM, 0, 9, { .int_p = &reccfg_disk.samplerate }, "sample rate",
3195 samplerate_str },
3196 { TYPE_ENUM, 0, 2, { .int_p = &reccfg_disk.channels }, "channels",
3197 channel_str },
3198 { TYPE_ENUM, 0, WAV_NUM_SRC, { .int_p = &reccfg_disk.source }, "source",
3199 source_str },
3200};
3201
3202static char recfilename[MAX_PATH];
3203
3204static unsigned char *aud_buf;
3205static ssize_t aud_size;
3206static unsigned char *plug_buf;
3207
3208static int aud_read = 0;
3209static volatile int aud_write = 0;
3210static volatile int num_rec_bytes = 0;
3211
3212static const struct riff_header header_template =
3213{
3214 /* "RIFF" header */
3215 { 'R', 'I', 'F', 'F' }, /* riff_id */
3216 0, /* riff_size (*) */
3217 /* format header */
3218 { 'W', 'A', 'V', 'E' }, /* format */
3219 { 'f', 'm', 't', ' ' }, /* format_id */
3220 htole32(16), /* format_size */
3221 /* format data */
3222 htole16(1), /* audio_format */
3223 0, /* num_channels (*) */
3224 0, /* sample_rate (*) */
3225 0, /* byte_rate (*) */
3226 0, /* block_align (*) */
3227 htole16(PCM_DEPTH_BITS), /* bits_per_sample */
3228 /* data header */
3229 { 'd', 'a', 't', 'a' }, /* data_id */
3230 0 /* data_size (*) */
3231 /* (*) updated during ENC_END_FILE event */
3232};
3233
3234/** i2c, MAS configuration **/
3235
3236void i2c_random_write(int addr, int cmd, const unsigned char* data, int size)
3237{
3238 plug_buf[0] = cmd;
3239 rb->memcpy(plug_buf+1, data, size);
3240
3241 rb->i2c_begin();
3242 rb->i2c_write(addr, plug_buf, size+1);
3243 rb->i2c_end();
3244}
3245
3246void mas_freeze(void)
3247{
3248 static const unsigned char freeze[] = { 0x00, 0x00 };
3249
3250 /* Freeze DSP */
3251 i2c_random_write(MAS_ADR, MAS_DATA_WRITE, freeze, sizeof(freeze));
3252 /* mas_run(0); in core implementation */
3253
3254 /* stop all internal transfers */
3255 rb->mas_writereg(0x3b, 0x00318); /* stopdma 1 */
3256 rb->mas_writereg(0x43, 0x00300); /* stopdma 2 */
3257 rb->mas_writereg(0x4b, 0); /* stopdma 3 */
3258 rb->mas_writereg(0x53, 0x00318); /* stopdma 4 */
3259 rb->mas_writereg(0x6b, 0); /* stopdma 5 */
3260 rb->mas_writereg(0xbb, 0x00318); /* stopdma 6 */
3261 rb->mas_writereg(0xc3, 0x00300); /* stopdma 7 */
3262 rb->mas_writereg(0x06, 0); /* stopdma 8 */
3263}
3264
3265void mas_download_pcm(void)
3266{
3267 static const unsigned char runi2s[] = { 0x10, 0x00 };
3268 unsigned i;
3269
3270 mas_freeze();
3271
3272 /* Download program to MAS memory */
3273 for ( i = 0; i < (sizeof(maspcm)/sizeof(struct i2c_block)); i++ )
3274 i2c_random_write(MAS_ADR, MAS_DATA_WRITE, maspcm[i].data, maspcm[i].len);
3275
3276 rb->mas_writereg(0x6b, 0xc0000); /* Reconfigure data to program memory */
3277
3278 /* Start execution at D0:1000 */
3279 i2c_random_write(MAS_ADR, MAS_DATA_WRITE, runi2s, sizeof(runi2s));
3280 /* mas_run(0x1000); in core implementation */
3281}
3282
3283void mas_restore(void)
3284{
3285 static const unsigned char resetdsp[] = { 0x88, 0x00 };
3286 static const unsigned char initdsp[] = { 0x8c, 0x00 };
3287 unsigned long val;
3288
3289 i2c_random_write(MAS_ADR, MAS_CONTROL, resetdsp, sizeof(resetdsp));
3290 /* mas_direct_config_write(MAS_CONTROL, 0x8d00); in core implementation */
3291 rb->sleep(1);
3292 i2c_random_write(MAS_ADR, MAS_CONTROL, initdsp, sizeof(initdsp));
3293 /* mas_direct_config_write(MAS_CONTROL, 0x8c00); in core implementation */
3294
3295 /* Stop the current application */
3296 val = 0;
3297 rb->mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
3298 do
3299 rb->mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
3300 while(val);
3301
3302#ifdef HAVE_SPDIF_OUT
3303 val = 0x0009; /* Disable SDO and SDI, low impedance S/PDIF outputs */
3304#else
3305 val = 0x002d; /* Disable SDO and SDI, disable S/PDIF output */
3306#endif
3307 rb->mas_writemem(MAS_BANK_D0, MAS_D0_INTERFACE_CONTROL, &val, 1);
3308
3309 val = 0x0025; /* Set Demand mode and validate all settings */
3310 rb->mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &val, 1);
3311
3312 val = 0x000c; /* Start the Layer2/3 decoder applications */
3313 rb->mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
3314 do
3315 rb->mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
3316 while((val & 0x000c) != 0x000c);
3317}
3318
3319/** Very basic recording engine **/
3320
3321void rec_tick(void)
3322{
3323 int d1, d2, d3;
3324
3325 ICR |= 0x0010; /* Begin with setting the IRQ to edge sensitive */
3326
3327 if(!(PADRH & 0x80))
3328 { /* /EOD is low - transfer 36 bytes (9 sample pairs, 1 MASPCM DMA block) */
3329 asm volatile (
3330 "add %[buf], %[writ] \n" /* write pos -> addr */
3331 "mov #9, %[i] \n" /* block size = 9*4 */
3332
3333 ".r_loop: \n"
3334 "xor.b #0x08, @(r0,gbr) \n" /* set PR active */
3335 ".r_wait1: \n"
3336 "mov.b @%[pbdh], %[scrt] \n" /* wait for RTW */
3337 "cmp/pz %[scrt] \n"
3338 "bf .r_wait1 \n"
3339
3340 "mov.b @%[mas], %[data] \n" /* read data from MAS */
3341 "xor.b #0x08, @(r0,gbr) \n" /* set PR inactive */
3342 "extu.b %[data], %[data] \n"
3343
3344 "xor.b #0x08, @(r0,gbr) \n" /* set PR active */
3345 ".r_wait2: \n"
3346 "mov.b @%[pbdh], %[scrt] \n" /* wait for RTW */
3347 "cmp/pz %[scrt] \n"
3348 "bf .r_wait2 \n"
3349
3350 "mov.b @%[mas], %[scrt] \n" /* read data from MAS */
3351 "xor.b #0x08, @(r0,gbr) \n" /* set PR inactive */
3352 "shll8 %[data] \n"
3353 "extu.b %[scrt], %[scrt] \n"
3354 "or %[scrt], %[data] \n"
3355
3356 "xor.b #0x08, @(r0,gbr) \n" /* set PR active */
3357 ".r_wait3: \n"
3358 "mov.b @%[pbdh], %[scrt] \n" /* wait for RTW */
3359 "cmp/pz %[scrt] \n"
3360 "bf .r_wait3 \n"
3361
3362 "mov.b @%[mas], %[scrt] \n" /* read data from MAS */
3363 "xor.b #0x08, @(r0,gbr) \n" /* set PR inactive */
3364 "shll8 %[data] \n"
3365 "extu.b %[scrt], %[scrt] \n"
3366 "or %[scrt], %[data] \n"
3367
3368 "xor.b #0x08, @(r0,gbr) \n" /* set PR active */
3369 ".r_wait4: \n"
3370 "mov.b @%[pbdh], %[scrt] \n" /* wait for RTW */
3371 "cmp/pz %[scrt] \n"
3372 "bf .r_wait4 \n"
3373
3374 "mov.b @%[mas], %[scrt] \n" /* read data from MAS */
3375 "xor.b #0x08, @(r0,gbr) \n" /* set PR inactive */
3376 "shll8 %[data] \n"
3377 "extu.b %[scrt], %[scrt] \n"
3378 "or %[scrt], %[data] \n"
3379
3380 "mov.l %[data], @%[writ] \n"
3381
3382 "add #4, %[writ] \n" /* advance buffer pointer */
3383 "cmp/hi %[writ], %[end] \n"
3384 "bt .r_nowrap \n"
3385 "mov %[buf], %[writ] \n" /* wrap if necessary */
3386 ".r_nowrap: \n"
3387
3388 "add #-1, %[i] \n" /* count down block size */
3389 "cmp/pl %[i] \n" /* exit if zero */
3390 "bt .r_loop \n"
3391
3392 ".r_end: \n"
3393 "sub %[buf], %[writ] \n" /* eddr -> write pos */
3394 : /* outputs */
3395 [writ]"+r"(aud_write),
3396 [i] "=&r"(d1),
3397 [data]"=&r"(d2),
3398 [scrt]"=&r"(d3)
3399 : /* inputs */
3400 [buf] "r"(aud_buf),
3401 [end] "r"(aud_buf + aud_size),
3402 [padh]"z"(PADRH_ADDR),
3403 [pbdh]"r"(PBDRH_ADDR),
3404 [mas] "r"(0x04000000)
3405 );
3406 num_rec_bytes += 36;
3407 }
3408}
3409
3410void rec_tick_enable(bool on)
3411{
3412 int oldlevel = disable_irq_save();
3413
3414 if(on)
3415 {
3416 IPRA = (IPRA & 0xfff0) | 0x000b;
3417 ICR &= ~0x0010; /* IRQ3 level sensitive */
3418 IPRB &= 0xff0f; /* Disable IRQ6 */
3419 }
3420 else
3421 {
3422 IPRA &= 0xfff0;
3423 ICR &= ~0x0002; /* Set IRQ6 to level sensitive and back again. */
3424 ICR |= 0x0002; /* This will clear a pending request. */
3425 IPRB = (IPRB & 0xff0f) | 0x0080; /* Reenable IRQ6 */
3426 }
3427
3428 restore_irq(oldlevel);
3429}
3430
3431void hijack_interrupts(bool on)
3432{
3433 static bool taken = false;
3434 static unsigned long orig_IRQ3;
3435
3436 if (on && !taken)
3437 {
3438 orig_IRQ3 = IRQ3;
3439 IRQ3 = (unsigned long)rec_tick;
3440 }
3441 else if (!on && taken)
3442 {
3443 IRQ3 = orig_IRQ3;
3444 }
3445 taken = on;
3446}
3447
3448static bool update_wav_header(char *filename, int sample_rate,
3449 int num_channels, int num_bytes)
3450{
3451 struct riff_header hdr;
3452 int fd;
3453 bool ret;
3454
3455 fd = rb->open(filename, O_RDWR);
3456 if (fd < 0)
3457 return false;
3458
3459 rb->memcpy(&hdr, &header_template, sizeof (struct riff_header));
3460
3461 /* "RIFF" header */
3462 hdr.riff_size = htole32(RIFF_FMT_HEADER_SIZE + RIFF_FMT_DATA_SIZE
3463 + RIFF_DATA_HEADER_SIZE + num_bytes);
3464
3465 /* format data */
3466 hdr.num_channels = htole16(num_channels);
3467 hdr.sample_rate = htole32(sample_rate);
3468 hdr.byte_rate = htole32(sample_rate * num_channels * PCM_DEPTH_BYTES);
3469 hdr.block_align = htole16(num_channels * PCM_DEPTH_BYTES);
3470
3471 /* data header */
3472 hdr.data_size = htole32(num_bytes);
3473
3474 ret = (rb->write(fd, &hdr, sizeof (struct riff_header))
3475 == sizeof (struct riff_header));
3476 rb->close(fd);
3477 return ret;
3478}
3479
3480static int record_file(char *filename)
3481{
3482 bool recording, saving;
3483 int fd, low_water, i;
3484 int bytes_written;
3485 int button;
3486 unsigned long mas;
3487
3488 static const unsigned sampr[9][2] = {
3489 {0, 8000}, {1, 11025}, {2, 12000},
3490 {4, 16000}, {5, 22050}, {6, 24000},
3491 {8, 32000}, {9, 44100}, {10, 48000}
3492 };
3493
3494 fd = rb->open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
3495 if (fd < 0)
3496 {
3497 rb->splash(2*HZ, "Couldn't create WAV file");
3498 return PLUGIN_ERROR;
3499 }
3500 /* write template header */
3501 if (rb->write(fd, &header_template, sizeof (struct riff_header))
3502 != sizeof (struct riff_header))
3503 {
3504 rb->close(fd);
3505 rb->splash(2*HZ, "Write error");
3506 return PLUGIN_ERROR;
3507 }
3508
3509 rb->sound_set_pitch(PITCH_SPEED_100); /* reset pitch */
3510 mas_download_pcm();
3511 num_rec_bytes = 0;
3512 bytes_written = 0;
3513
3514 rb->lcd_clear_display();
3515 rb->lcd_puts(0, 0, filename);
3516
3517 switch (reccfg.source)
3518 {
3519 case WAV_SRC_LINE:
3520 rb->mas_codec_writereg(0, (rb->global_settings->rec_left_gain << 12)
3521 | (rb->global_settings->rec_right_gain << 8)
3522 | 0x07);
3523 rb->mas_codec_writereg(8, 0);
3524 break;
3525
3526 case WAV_SRC_MIC:
3527 rb->mas_codec_writereg(0, (rb->global_settings->rec_mic_gain << 4)
3528 | 0x0d);
3529 rb->mas_codec_writereg(8, 0x8000); /* Copy left channel to right */
3530 break;
3531
3532#ifdef HAVE_SPDIF_REC
3533 case WAV_SRC_SPDIF:
3534 rb->mas_codec_writereg(0, 0x01);
3535 break;
3536#endif
3537 }
3538
3539#ifdef HAVE_SPDIF_REC
3540 if (reccfg.source == WAV_SRC_SPDIF)
3541 rb->lcd_putsf(0, 1, "16bit %s", channel_str[reccfg.channels]);
3542 else
3543#endif
3544 rb->lcd_putsf(0, 1, "%sHz 16bit %s",
3545 samplerate_str[reccfg.samplerate], channel_str[reccfg.channels]);
3546
3547 rb->lcd_update();
3548
3549 mas = 0x0060 /* no framing, little endian */
3550 | ((reccfg.channels == 0) ? 0x10 : 0) /* mono/stereo */
3551 | sampr[reccfg.samplerate][0];
3552 rb->mas_writemem(MAS_BANK_D0, PCM_SAMPLE_RATE, &mas, 1);
3553
3554#ifdef HAVE_SPDIF_OUT
3555 mas = 0x0009; /* Disable SDO and SDI, low impedance S/PDIF outputs */
3556#else
3557 mas = 0x002d; /* Disable SDO and SDI, disable S/PDIF output */
3558#endif
3559 rb->mas_writemem(MAS_BANK_D0, PCM_IF_STATUS_CONTROL, &mas, 1);
3560
3561#ifdef HAVE_SPDIF_IN
3562 if (reccfg.source == AUDIO_SRC_SPDIF)
3563 mas = 0x2225; /* recording, S/PDIF input, validate */
3564 else
3565#endif
3566 mas = 0x2125; /* recording, ADC input, validate */
3567 rb->mas_writemem(MAS_BANK_D0, PCM_MAIN_IO_CONTROL, &mas, 1);
3568
3569 mas = 0x80001; /* avoid distortion (overflow on full-range input samples) */
3570 rb->mas_writemem(MAS_BANK_D0, PCM_VOL_IN_LL, &mas, 1); /* LL */
3571 rb->mas_writemem(MAS_BANK_D0, PCM_VOL_IN_RR, &mas, 1); /* RR */
3572
3573 hijack_interrupts(true);
3574 rec_tick_enable(true);
3575 recording = true;
3576 saving = false;
3577 low_water = 5 /* seconds */
3578 * PCM_DEPTH_BYTES
3579 * sampr[reccfg.samplerate][1] /* samples per second */
3580 * (reccfg.channels + 1);
3581
3582 while (recording || saving)
3583 {
3584 int to_save, write_now, result;
3585
3586 if (saving)
3587 {
3588 to_save = num_rec_bytes - bytes_written;
3589 if (to_save > aud_size)
3590 {
3591 rec_tick_enable(false);
3592#if (CONFIG_STORAGE & STORAGE_MMC)
3593 rb->splash(HZ, "Data overrun (slow MMC)");
3594#else
3595 rb->splash(HZ, "Data overrun");
3596#endif
3597 recording = false;
3598 saving = false;
3599 break;
3600 }
3601 write_now = MIN(to_save, aud_size - aud_read);
3602#if (CONFIG_STORAGE & STORAGE_MMC)
3603 write_now = MIN(write_now, 256*1024);
3604#else
3605 write_now = MIN(write_now, 1024*1024);
3606#endif
3607 result = rb->write(fd, aud_buf + aud_read, write_now);
3608 if (result < 0)
3609 {
3610 rec_tick_enable(false);
3611 rb->splash(HZ, "Write error");
3612 recording = false;
3613 saving = false;
3614 break;
3615 }
3616 bytes_written += result;
3617 if (result != write_now)
3618 {
3619 rec_tick_enable(false);
3620 rb->splash(HZ, "Disk full");
3621 recording = false;
3622 saving = false;
3623 break;
3624 }
3625 if (bytes_written >= 0x7fe00000)
3626 {
3627 rec_tick_enable(false);
3628 rb->splash(HZ, "Max file size reached");
3629 recording = false;
3630 saving = false;
3631 break;
3632 }
3633 aud_read += write_now;
3634 if (aud_read == aud_size)
3635 aud_read = 0;
3636
3637 if (to_save == write_now)
3638 saving = false;
3639
3640 rb->yield();
3641 button = rb->button_get(false);
3642 }
3643 else
3644 {
3645 button = rb->button_get_w_tmo(HZ/2);
3646 if (aud_size - (num_rec_bytes - bytes_written) < low_water)
3647 saving = true;
3648 }
3649 if (button == BUTTON_OFF)
3650 {
3651 rec_tick_enable(false);
3652 recording = false;
3653 saving = true;
3654 }
3655 rb->lcd_putsf(0, 2, "Bytes: %d", num_rec_bytes);
3656 rb->lcd_update();
3657 }
3658 /* read sample rate from MAS */
3659 rb->mas_readmem(MAS_BANK_D0, PCM_SAMPLE_RATE_STATUS, &mas, 1);
3660 rb->close(fd);
3661
3662 hijack_interrupts(false);
3663 mas_restore();
3664 rb->sound_set(SOUND_CHANNELS, rb->global_settings->channel_config);
3665 rb->sound_set(SOUND_STEREO_WIDTH, rb->global_settings->stereo_width);
3666
3667 for (i = 0; i < 9; i++)
3668 {
3669 if (sampr[i][0] == mas)
3670 break;
3671 }
3672 if (i == 9 || !(update_wav_header(filename, sampr[i][1],
3673 (reccfg.channels + 1), bytes_written)))
3674 {
3675 rb->splash(HZ, "Updating WAV header failed");
3676 }
3677
3678 return PLUGIN_OK;
3679}
3680
3681static int recording_menu(void)
3682{
3683 int menupos = 3;
3684 int rc = 0;
3685 bool done = false;
3686
3687 static const struct opt_items freqs[9] = {
3688 { "8000Hz", TALK_ID(8, UNIT_KHZ) },
3689 { "11025Hz", TALK_ID(11, UNIT_KHZ) },
3690 { "12000Hz", TALK_ID(12, UNIT_KHZ) },
3691 { "16000Hz", TALK_ID(16, UNIT_KHZ) },
3692 { "22050Hz", TALK_ID(22, UNIT_KHZ) },
3693 { "24000Hz", TALK_ID(24, UNIT_KHZ) },
3694 { "32000Hz", TALK_ID(32, UNIT_KHZ) },
3695 { "44100Hz", TALK_ID(44, UNIT_KHZ) },
3696 { "48000Hz", TALK_ID(48, UNIT_KHZ) },
3697 };
3698 static const struct opt_items chans[2] = {
3699 { STR(LANG_CHANNEL_MONO) },
3700 { STR(LANG_CHANNEL_STEREO) },
3701 };
3702 static const struct opt_items srcs[WAV_NUM_SRC] = {
3703 { "Line In", -1 },
3704 { "Microphone", -1 },
3705#ifdef HAVE_SPDIF_REC
3706 { "S/PDIF", -1 },
3707#endif
3708 };
3709
3710 MENUITEM_STRINGLIST(menu, "WAV Recording", NULL, "Set sample rate",
3711 "Set channels", "Set Source", "Start recording", "Quit");
3712
3713 while (!done)
3714 {
3715 switch (rb->do_menu(&menu, &menupos, NULL, false))
3716 {
3717 case 0: /* Set sample rate */
3718 rb->set_option("Sample rate", &reccfg.samplerate, INT, freqs, 9, NULL);
3719 break;
3720
3721 case 1: /* Set channels */
3722 rb->set_option("Channels", &reccfg.channels, INT, chans, 2, NULL);
3723 break;
3724
3725 case 2: /* Set source */
3726 rb->set_option("Source", &reccfg.source, INT, srcs, WAV_NUM_SRC, NULL);
3727 break;
3728
3729 case 3: /* Start recording */
3730 rb->create_numbered_filename(recfilename,
3731 rb->global_settings->rec_directory,
3732 "rec_", ".wav", 4
3733 IF_CNFN_NUM_(, NULL));
3734 rc = record_file(recfilename);
3735 done = true;
3736 break;
3737
3738 case 4: /* Quit */
3739 rc = PLUGIN_OK;
3740 done = true;
3741 break;
3742
3743 case MENU_ATTACHED_USB:
3744 rc = PLUGIN_USB_CONNECTED;
3745 done = true;
3746 break;
3747 }
3748 }
3749 return rc;
3750}
3751
3752/* plugin entry point */
3753enum plugin_status plugin_start(const void* parameter)
3754{
3755 size_t buf_size;
3756 int align;
3757 int rc;
3758 const char *recbasedir;
3759
3760 (void)parameter;
3761
3762 plug_buf = rb->plugin_get_buffer(&buf_size);
3763 if (buf_size < 6700) /* needed for i2c transfer */
3764 {
3765 rb->splash(HZ, "Out of memory.");
3766 return PLUGIN_ERROR;
3767 }
3768
3769 recbasedir = rb->global_settings->rec_directory;
3770 if (rb->strcmp(recbasedir, "/") && !rb->dir_exists(recbasedir))
3771 {
3772 rc = rb->mkdir(recbasedir);
3773 if (rc < 0)
3774 {
3775 rb->splashf(HZ*2, "Can't create directory %s. Error %d.",
3776 recbasedir, rc);
3777 return PLUGIN_ERROR;
3778 }
3779 }
3780
3781 aud_buf = rb->plugin_get_audio_buffer(&buf_size);
3782 aud_size = buf_size;
3783 align = (-(long)aud_buf) & 3;
3784 aud_buf += align;
3785 aud_size -= align;
3786 aud_size &= ~3;
3787
3788 configfile_load(cfg_filename, disk_config,
3789 sizeof(disk_config) / sizeof(disk_config[0]),
3790 CFGFILE_MINVERSION);
3791 rb->memcpy(&reccfg, &reccfg_disk, sizeof(reccfg)); /* copy to running config */
3792
3793 rc = recording_menu();
3794
3795 if (rb->memcmp(&reccfg, &reccfg_disk, sizeof(reccfg))) /* save settings if changed */
3796 {
3797 rb->memcpy(&reccfg_disk, &reccfg, sizeof(reccfg));
3798 configfile_save(cfg_filename, disk_config,
3799 sizeof(disk_config) / sizeof(disk_config[0]),
3800 CFGFILE_VERSION);
3801 }
3802 return rc;
3803
3804#if 0
3805#if (CONFIG_STORAGE & STORAGE_MMC)
3806 return record_file("/<MMC1>/test.wav");
3807#else
3808 return record_file("/test.wav");
3809#endif
3810#endif
3811}
diff --git a/apps/plugins/wormlet.c b/apps/plugins/wormlet.c
index a8447c9952..b18cdc21f8 100644
--- a/apps/plugins/wormlet.c
+++ b/apps/plugins/wormlet.c
@@ -46,36 +46,8 @@ static long max_cycle;
46 when a new argh is made */ 46 when a new argh is made */
47#define MIN_ARGH_DIST 5 47#define MIN_ARGH_DIST 5
48 48
49#if (CONFIG_KEYPAD == RECORDER_PAD) 49#if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
50#define BTN_DIR_UP BUTTON_UP 50 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
51#define BTN_DIR_DOWN BUTTON_DOWN
52#define BTN_DIR_LEFT BUTTON_LEFT
53#define BTN_DIR_RIGHT BUTTON_RIGHT
54#define BTN_PLAYER2_DIR1 BUTTON_F2
55#define BTN_PLAYER2_DIR2 BUTTON_F3
56#define BTN_STARTPAUSE BUTTON_PLAY
57#define BTN_QUIT BUTTON_OFF
58#define BTN_STOPRESET BUTTON_ON
59#define BTN_TOGGLE_KEYS BUTTON_F1
60
61#if BUTTON_REMOTE != 0
62#define BTN_RC_UP BUTTON_RC_VOL_UP
63#define BTN_RC_DOWN BUTTON_RC_VOL_DOWN
64#define REMOTE
65#define MULTIPLAYER
66#endif
67
68#elif (CONFIG_KEYPAD == ONDIO_PAD)
69#define BTN_DIR_UP BUTTON_UP
70#define BTN_DIR_DOWN BUTTON_DOWN
71#define BTN_DIR_LEFT BUTTON_LEFT
72#define BTN_DIR_RIGHT BUTTON_RIGHT
73#define BTN_STARTPAUSE (BUTTON_MENU|BUTTON_REL)
74#define BTN_QUIT (BUTTON_OFF|BUTTON_REL)
75#define BTN_STOPRESET (BUTTON_OFF|BUTTON_MENU)
76
77#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \
78 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
79 51
80#define BTN_DIR_UP BUTTON_MENU 52#define BTN_DIR_UP BUTTON_MENU
81#define BTN_DIR_DOWN BUTTON_PLAY 53#define BTN_DIR_DOWN BUTTON_PLAY
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c
index b923e23986..e2cccba8fc 100644
--- a/apps/plugins/xobox.c
+++ b/apps/plugins/xobox.c
@@ -115,24 +115,6 @@
115#define DOWN BUTTON_SCROLL_DOWN 115#define DOWN BUTTON_SCROLL_DOWN
116#define PAUSE BUTTON_PLAY 116#define PAUSE BUTTON_PLAY
117 117
118#elif CONFIG_KEYPAD == RECORDER_PAD
119
120#define QUIT BUTTON_OFF
121#define LEFT BUTTON_LEFT
122#define RIGHT BUTTON_RIGHT
123#define DOWN BUTTON_DOWN
124#define UP BUTTON_UP
125#define PAUSE BUTTON_PLAY
126
127#elif CONFIG_KEYPAD == ONDIO_PAD
128
129#define QUIT BUTTON_OFF
130#define LEFT BUTTON_LEFT
131#define RIGHT BUTTON_RIGHT
132#define DOWN BUTTON_DOWN
133#define UP BUTTON_UP
134#define PAUSE BUTTON_MENU
135
136#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD) 118#elif (CONFIG_KEYPAD == GIGABEAT_S_PAD)
137 119
138#define QUIT BUTTON_BACK 120#define QUIT BUTTON_BACK
diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h
index c2d434415c..967b979883 100644
--- a/apps/plugins/zxbox/keymaps.h
+++ b/apps/plugins/zxbox/keymaps.h
@@ -47,24 +47,8 @@
47#define ZX_SELECT BUTTON_SELECT 47#define ZX_SELECT BUTTON_SELECT
48#define ZX_MENU BUTTON_PLAY 48#define ZX_MENU BUTTON_PLAY
49 49
50#elif CONFIG_KEYPAD == RECORDER_PAD
51#define ZX_SELECT BUTTON_PLAY
52#define ZX_MENU BUTTON_F1
53#define ZX_LEFT BUTTON_LEFT
54#define ZX_RIGHT BUTTON_RIGHT
55#define ZX_UP BUTTON_UP
56#define ZX_DOWN BUTTON_DOWN
57
58#elif CONFIG_KEYPAD == ONDIO_PAD
59#define ZX_SELECT BUTTON_MENU
60#define ZX_MENU BUTTON_OFF
61#define ZX_LEFT BUTTON_LEFT
62#define ZX_RIGHT BUTTON_RIGHT
63#define ZX_UP BUTTON_UP
64#define ZX_DOWN BUTTON_DOWN
65
66#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD 50#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
67#define ZX_SELECT BUTTON_SELECT 51#define ZX_SELECT BUTTON_SELECT
68#define ZX_MENU BUTTON_PLAY 52#define ZX_MENU BUTTON_PLAY
69#define ZX_LEFT BUTTON_LEFT 53#define ZX_LEFT BUTTON_LEFT
70#define ZX_RIGHT BUTTON_RIGHT 54#define ZX_RIGHT BUTTON_RIGHT
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index 046f07379d..4dc50e2ae8 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -7,12 +7,6 @@
7#define O_BINARY 0 7#define O_BINARY 0
8#endif 8#endif
9 9
10#if CONFIG_KEYPAD == RECORDER_PAD
11#define BUTTONBAR_HEIGHT 8
12#else
13#define BUTTONBAR_HEIGHT 0
14#endif
15
16#define DEFAULT_MARGIN 6 10#define DEFAULT_MARGIN 6
17#define KBD_BUF_SIZE 500 11#define KBD_BUF_SIZE 500
18#define kbd_loaded false 12#define kbd_loaded false
@@ -27,22 +21,6 @@
27#define KBD_UP BUTTON_UP 21#define KBD_UP BUTTON_UP
28#define KBD_DOWN BUTTON_DOWN 22#define KBD_DOWN BUTTON_DOWN
29 23
30#elif CONFIG_KEYPAD == RECORDER_PAD
31#define KBD_SELECT BUTTON_PLAY
32#define KBD_ABORT BUTTON_OFF
33#define KBD_LEFT BUTTON_LEFT
34#define KBD_RIGHT BUTTON_RIGHT
35#define KBD_UP BUTTON_UP
36#define KBD_DOWN BUTTON_DOWN
37
38#elif CONFIG_KEYPAD == ONDIO_PAD /* restricted Ondio keypad */
39#define KBD_SELECT BUTTON_MENU
40#define KBD_ABORT BUTTON_OFF
41#define KBD_LEFT BUTTON_LEFT
42#define KBD_RIGHT BUTTON_RIGHT
43#define KBD_UP BUTTON_UP
44#define KBD_DOWN BUTTON_DOWN
45
46#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \ 24#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
47 (CONFIG_KEYPAD == IPOD_3G_PAD) || \ 25 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
48 (CONFIG_KEYPAD == IPOD_1G2G_PAD) 26 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
@@ -412,7 +390,7 @@ int zx_kbd_input(char* text/*, int buflen*/)
412 param[l].font_h = param[l].font->height; 390 param[l].font_h = param[l].font->height;
413 391
414 /* check if FONT_UI fits the screen */ 392 /* check if FONT_UI fits the screen */
415 if (2*param[l].font_h+3 + BUTTONBAR_HEIGHT > 393 if (2*param[l].font_h+3 >
416 rb->screens[l]->getheight()) { 394 rb->screens[l]->getheight()) {
417 param[l].font = rb->font_get(FONT_SYSFIXED); 395 param[l].font = rb->font_get(FONT_SYSFIXED);
418 param[l].font_h = param[l].font->height; 396 param[l].font_h = param[l].font->height;
@@ -492,10 +470,10 @@ int zx_kbd_input(char* text/*, int buflen*/)
492 param[l].lines = param[l].DEFAULT_LINES; 470 param[l].lines = param[l].DEFAULT_LINES;
493 param[l].keyboard_margin = DEFAULT_MARGIN; 471 param[l].keyboard_margin = DEFAULT_MARGIN;
494 } else { 472 } else {
495 param[l].lines = (rb->screens[l]->lcdheight - BUTTONBAR_HEIGHT - 473 param[l].lines = (rb->screens[l]->lcdheight -
496 statusbar_size) / param[l].font_h - 1; 474 statusbar_size) / param[l].font_h - 1;
497 param[l].keyboard_margin = rb->screens[l]->lcdheight - 475 param[l].keyboard_margin = rb->screens[l]->lcdheight -
498 BUTTONBAR_HEIGHT - statusbar_size - 476 statusbar_size -
499 (param[l].lines+1)*param[l].font_h; 477 (param[l].lines+1)*param[l].font_h;
500 if (param[l].keyboard_margin < 3) { 478 if (param[l].keyboard_margin < 3) {
501 param[l].lines--; 479 param[l].lines--;
diff --git a/apps/radio/presets.c b/apps/radio/presets.c
index acd6dc8711..72e8c3bd65 100644
--- a/apps/radio/presets.c
+++ b/apps/radio/presets.c
@@ -473,21 +473,10 @@ int handle_radio_presets(void)
473 struct gui_synclist lists; 473 struct gui_synclist lists;
474 int result = 0; 474 int result = 0;
475 int action = ACTION_NONE; 475 int action = ACTION_NONE;
476#ifdef HAVE_BUTTONBAR
477 struct gui_buttonbar buttonbar;
478#endif
479 476
480 if(presets_loaded == false) 477 if(presets_loaded == false)
481 return result; 478 return result;
482 479
483#ifdef HAVE_BUTTONBAR
484 gui_buttonbar_init(&buttonbar);
485 gui_buttonbar_set_display(&buttonbar, &(screens[SCREEN_MAIN]) );
486 gui_buttonbar_set(&buttonbar, str(LANG_FM_BUTTONBAR_ADD),
487 str(LANG_FM_BUTTONBAR_EXIT),
488 str(LANG_FM_BUTTONBAR_ACTION));
489 gui_buttonbar_draw(&buttonbar);
490#endif
491 gui_synclist_init(&lists, presets_get_name, NULL, false, 1, NULL); 480 gui_synclist_init(&lists, presets_get_name, NULL, false, 1, NULL);
492 gui_synclist_set_title(&lists, str(LANG_PRESET), NOICON); 481 gui_synclist_set_title(&lists, str(LANG_PRESET), NOICON);
493 gui_synclist_set_icon_callback(&lists, NULL); 482 gui_synclist_set_icon_callback(&lists, NULL);
diff --git a/apps/radio/radio.c b/apps/radio/radio.c
index 08b9c501e2..362d10f9a3 100644
--- a/apps/radio/radio.c
+++ b/apps/radio/radio.c
@@ -61,14 +61,7 @@
61 61
62#if CONFIG_TUNER 62#if CONFIG_TUNER
63 63
64#if CONFIG_KEYPAD == RECORDER_PAD 64#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
65#define FM_RECORD
66#define FM_PRESET_ADD
67#define FM_PRESET_ACTION
68#define FM_PRESET
69#define FM_MODE
70
71#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
72#define FM_PRESET 65#define FM_PRESET
73#define FM_MODE 66#define FM_MODE
74#define FM_NEXT_PRESET 67#define FM_NEXT_PRESET
@@ -86,10 +79,6 @@
86 have to be taken to hear any interference. */ 79 have to be taken to hear any interference. */
87#define HAVE_NOISY_IDLE_MODE 80#define HAVE_NOISY_IDLE_MODE
88 81
89#elif CONFIG_KEYPAD == ONDIO_PAD
90#define FM_RECORD_DBLPRE
91#define FM_RECORD
92
93#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || (CONFIG_KEYPAD == SANSA_C200_PAD) ||\ 82#elif (CONFIG_KEYPAD == SANSA_E200_PAD) || (CONFIG_KEYPAD == SANSA_C200_PAD) ||\
94 (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\ 83 (CONFIG_KEYPAD == SANSA_FUZE_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\
95 (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD)||(CONFIG_KEYPAD == COWON_D2_PAD)||\ 84 (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD)||(CONFIG_KEYPAD == COWON_D2_PAD)||\
diff --git a/apps/recorder/jpeg_load.c b/apps/recorder/jpeg_load.c
index 61ec3bfa0e..16a2f4e3a3 100644
--- a/apps/recorder/jpeg_load.c
+++ b/apps/recorder/jpeg_load.c
@@ -137,21 +137,7 @@ static struct jpeg jpeg;
137 137
138INLINE unsigned range_limit(int value) 138INLINE unsigned range_limit(int value)
139{ 139{
140#if CONFIG_CPU == SH7034 140#if defined(CPU_COLDFIRE)
141 unsigned tmp;
142 asm ( /* Note: Uses knowledge that only low byte of result is used */
143 "extu.b %[v],%[t] \n"
144 "cmp/eq %[v],%[t] \n" /* low byte == whole number ? */
145 "bt 1f \n" /* yes: no overflow */
146 "cmp/pz %[v] \n" /* overflow: positive? */
147 "subc %[v],%[v] \n" /* %[r] now either 0 or 0xffffffff */
148 "1: \n"
149 : /* outputs */
150 [v]"+r"(value),
151 [t]"=&r"(tmp)
152 );
153 return value;
154#elif defined(CPU_COLDFIRE)
155 /* Note: Uses knowledge that only the low byte of the result is used */ 141 /* Note: Uses knowledge that only the low byte of the result is used */
156 asm ( 142 asm (
157 "cmp.l #255,%[v] \n" /* overflow? */ 143 "cmp.l #255,%[v] \n" /* overflow? */
@@ -232,7 +218,7 @@ INLINE unsigned scale_output(int value)
232*/ 218*/
233#define MULTIPLY(var1, var2) ((var1) * (var2)) 219#define MULTIPLY(var1, var2) ((var1) * (var2))
234 220
235#if defined(CPU_SH) || defined(CPU_COLDFIRE) || \ 221#if defined(CPU_COLDFIRE) || \
236 (defined(CPU_ARM) && ARM_ARCH > 4) 222 (defined(CPU_ARM) && ARM_ARCH > 4)
237#define MULTIPLY16(var,const) (((short) (var)) * ((short) (const))) 223#define MULTIPLY16(var,const) (((short) (var)) * ((short) (const)))
238#else 224#else
@@ -1687,24 +1673,6 @@ static void search_restart(struct jpeg *p_jpeg)
1687} 1673}
1688 1674
1689/* Figure F.12: extend sign bit. */ 1675/* Figure F.12: extend sign bit. */
1690#if CONFIG_CPU == SH7034
1691/* SH1 lacks a variable-shift instruction */
1692#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
1693
1694static const int extend_test[16] = /* entry n is 2**(n-1) */
1695{
1696 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
1697 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000
1698};
1699
1700static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
1701{
1702 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
1703 ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
1704 ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
1705 ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1
1706};
1707#else
1708/* This saves some code and data size, benchmarks about the same on RAM */ 1676/* This saves some code and data size, benchmarks about the same on RAM */
1709#define HUFF_EXTEND(x,s) \ 1677#define HUFF_EXTEND(x,s) \
1710({ \ 1678({ \
@@ -1712,7 +1680,6 @@ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
1712 int s__ = s; \ 1680 int s__ = s; \
1713 x__ & BIT_N(s__- 1) ? x__ : x__ + (-1 << s__) + 1; \ 1681 x__ & BIT_N(s__- 1) ? x__ : x__ + (-1 << s__) + 1; \
1714}) 1682})
1715#endif
1716 1683
1717/* Decode a single value */ 1684/* Decode a single value */
1718#define huff_decode_dc(p_jpeg, tbl, s, r) \ 1685#define huff_decode_dc(p_jpeg, tbl, s, r) \
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index 6e91d69b6d..4b19287b7f 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -27,7 +27,6 @@
27#include "settings.h" 27#include "settings.h"
28#include "misc.h" 28#include "misc.h"
29#include "rbunicode.h" 29#include "rbunicode.h"
30#include "buttonbar.h"
31#include "logf.h" 30#include "logf.h"
32#include "hangul.h" 31#include "hangul.h"
33#include "action.h" 32#include "action.h"
@@ -343,15 +342,6 @@ int kbd_input(char* text, int buflen, unsigned short *kbd)
343 viewportmanager_theme_enable(l, false, NULL); 342 viewportmanager_theme_enable(l, false, NULL);
344 } 343 }
345 344
346#ifdef HAVE_BUTTONBAR
347 struct gui_buttonbar buttonbar;
348 bool buttonbar_config = global_settings.buttonbar;
349
350 global_settings.buttonbar = true;
351 gui_buttonbar_init(&buttonbar);
352 gui_buttonbar_set_display(&buttonbar, &screens[SCREEN_MAIN]);
353#endif
354
355 /* initialize state */ 345 /* initialize state */
356 state.text = text; 346 state.text = text;
357 state.buflen = buflen; 347 state.buflen = buflen;
@@ -482,12 +472,6 @@ int kbd_input(char* text, int buflen, unsigned short *kbd)
482#endif 472#endif
483 } 473 }
484 474
485#ifdef HAVE_BUTTONBAR
486 /* draw the button bar */
487 gui_buttonbar_set(&buttonbar, "Shift", "OK", "Del");
488 gui_buttonbar_draw(&buttonbar);
489#endif
490
491 FOR_NB_SCREENS(l) 475 FOR_NB_SCREENS(l)
492 screens[l].update(); 476 screens[l].update();
493 477
@@ -693,10 +677,6 @@ int kbd_input(char* text, int buflen, unsigned short *kbd)
693 state.changed = 0; 677 state.changed = 0;
694 } 678 }
695 679
696#ifdef HAVE_BUTTONBAR
697 global_settings.buttonbar = buttonbar_config;
698#endif
699
700 if (ret < 0) 680 if (ret < 0)
701 splash(HZ/2, ID2P(LANG_CANCEL)); 681 splash(HZ/2, ID2P(LANG_CANCEL));
702 682
@@ -736,7 +716,7 @@ static void kbd_calc_params(struct keyboard_parameters *pm,
736 pm->font_h = font->height; 716 pm->font_h = font->height;
737 717
738 /* check if FONT_UI fits the screen */ 718 /* check if FONT_UI fits the screen */
739 if (2*pm->font_h + 3 + BUTTONBAR_HEIGHT > sc->getheight()) 719 if (2*pm->font_h + 3 > sc->getheight())
740 { 720 {
741 pm->curfont = FONT_SYSFIXED; 721 pm->curfont = FONT_SYSFIXED;
742 font = font_get(FONT_SYSFIXED); 722 font = font_get(FONT_SYSFIXED);
@@ -796,13 +776,12 @@ static void kbd_calc_params(struct keyboard_parameters *pm,
796 } 776 }
797recalc_param: 777recalc_param:
798#endif 778#endif
799 pm->lines = (sc_h - BUTTONBAR_HEIGHT) / pm->font_h - 1; 779 pm->lines = sc_h / pm->font_h - 1;
800 780
801 if (pm->default_lines && pm->lines > pm->default_lines) 781 if (pm->default_lines && pm->lines > pm->default_lines)
802 pm->lines = pm->default_lines; 782 pm->lines = pm->default_lines;
803 783
804 pm->keyboard_margin = sc_h - BUTTONBAR_HEIGHT 784 pm->keyboard_margin = sc_h - (pm->lines+1)*pm->font_h;
805 - (pm->lines+1)*pm->font_h;
806 785
807 if (pm->keyboard_margin < 3 && pm->lines > 1) 786 if (pm->keyboard_margin < 3 && pm->lines > 1)
808 { 787 {
@@ -840,7 +819,7 @@ recalc_param:
840#endif 819#endif
841 820
842#ifdef HAVE_MORSE_INPUT 821#ifdef HAVE_MORSE_INPUT
843 pm->old_main_y = sc_h - pm->font_h - BUTTONBAR_HEIGHT; 822 pm->old_main_y = sc_h - pm->font_h;
844 if (state->morse_mode) 823 if (state->morse_mode)
845 { 824 {
846 int y = pm->main_y; 825 int y = pm->main_y;
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index b67436839c..553f815e52 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -145,11 +145,6 @@ bool in_recording_screen(void)
145 return (rec_status & RCSTAT_IN_RECSCREEN) != 0; 145 return (rec_status & RCSTAT_IN_RECSCREEN) != 0;
146} 146}
147 147
148#if CONFIG_KEYPAD == RECORDER_PAD
149static bool f2_rec_screen(void);
150static bool f3_rec_screen(void);
151#endif
152
153#define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */ 148#define MAX_FILE_SIZE 0x7F800000 /* 2 GB - 4 MB */
154 149
155#ifndef HAVE_REMOTE_LCD 150#ifndef HAVE_REMOTE_LCD
@@ -1574,47 +1569,6 @@ bool recording_screen(bool no_source)
1574 } 1569 }
1575 break; 1570 break;
1576 1571
1577#if CONFIG_KEYPAD == RECORDER_PAD
1578 case ACTION_REC_F2:
1579 if(audio_stat != AUDIO_STATUS_RECORD)
1580 {
1581#if (CONFIG_LED == LED_REAL)
1582 /* led is restored at begin of loop / end of function */
1583 led(false);
1584#endif
1585 if (f2_rec_screen())
1586 {
1587 rec_status |= RCSTAT_HAVE_RECORDED;
1588 done = true;
1589 }
1590 else
1591 update_countdown = 0; /* Update immediately */
1592 }
1593 break;
1594
1595 case ACTION_REC_F3:
1596 if(audio_stat & AUDIO_STATUS_RECORD)
1597 {
1598 rec_command(RECORDING_CMD_START_NEWFILE);
1599 last_seconds = 0;
1600 }
1601 else
1602 {
1603#if (CONFIG_LED == LED_REAL)
1604 /* led is restored at begin of loop / end of function */
1605 led(false);
1606#endif
1607 if (f3_rec_screen())
1608 {
1609 rec_status |= RCSTAT_HAVE_RECORDED;
1610 done = true;
1611 }
1612 else
1613 update_countdown = 0; /* Update immediately */
1614 }
1615 break;
1616#endif /* CONFIG_KEYPAD == RECORDER_PAD */
1617
1618 case SYS_POWEROFF: 1572 case SYS_POWEROFF:
1619 default_event_handler(SYS_POWEROFF); 1573 default_event_handler(SYS_POWEROFF);
1620 done = true; 1574 done = true;
@@ -1941,246 +1895,6 @@ rec_abort:
1941 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0; 1895 return (rec_status & RCSTAT_BEEN_IN_USB_MODE) != 0;
1942} /* recording_screen */ 1896} /* recording_screen */
1943 1897
1944#if CONFIG_KEYPAD == RECORDER_PAD
1945static bool f2_rec_screen(void)
1946{
1947 static const char* const freq_str[6] =
1948 {
1949 "44.1kHz",
1950 "48kHz",
1951 "32kHz",
1952 "22.05kHz",
1953 "24kHz",
1954 "16kHz"
1955 };
1956
1957 bool exit = false;
1958 bool used = false;
1959 int w, h;
1960 char buf[32];
1961 int button;
1962 struct audio_recording_options rec_options;
1963
1964 FOR_NB_SCREENS(i)
1965 {
1966 screens[i].set_viewport(NULL);
1967 screens[i].setfont(FONT_SYSFIXED);
1968 screens[i].getstringsize("A",&w,&h);
1969 }
1970
1971 while (!exit) {
1972 const char* ptr;
1973
1974 FOR_NB_SCREENS(i)
1975 {
1976 screens[i].clear_display();
1977
1978 /* Recording quality */
1979 screens[i].putsxy(0, LCD_HEIGHT/2 - h*2,
1980 str(LANG_SYSFONT_RECORDING_QUALITY));
1981 }
1982
1983 snprintf(buf, sizeof(buf), "%d", global_settings.rec_quality);
1984 FOR_NB_SCREENS(i)
1985 {
1986 screens[i].putsxy(0, LCD_HEIGHT/2-h, buf);
1987 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
1988 LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
1989 }
1990
1991 /* Frequency */
1992 snprintf(buf, sizeof buf, "%s:", str(LANG_SYSFONT_RECORDING_FREQUENCY));
1993 ptr = freq_str[global_settings.rec_frequency];
1994 FOR_NB_SCREENS(i)
1995 {
1996 screens[i].getstringsize(buf,&w,&h);
1997 screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, buf);
1998 screens[i].getstringsize(ptr, &w, &h);
1999 screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h, ptr);
2000 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
2001 LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
2002 }
2003
2004 /* Channel mode */
2005 switch ( global_settings.rec_channels ) {
2006 case 0:
2007 ptr = str(LANG_SYSFONT_CHANNEL_STEREO);
2008 break;
2009
2010 case 1:
2011 ptr = str(LANG_SYSFONT_CHANNEL_MONO);
2012 break;
2013 }
2014
2015 FOR_NB_SCREENS(i)
2016 {
2017 screens[i].getstringsize(str(LANG_SYSFONT_CHANNELS), &w, &h);
2018 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h*2,
2019 str(LANG_SYSFONT_CHANNELS));
2020 screens[i].getstringsize(str(LANG_SYSFONT_MODE), &w, &h);
2021 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2 - h,
2022 str(LANG_SYSFONT_MODE));
2023 screens[i].getstringsize(ptr, &w, &h);
2024 screens[i].putsxy(LCD_WIDTH - w, LCD_HEIGHT/2, ptr);
2025 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
2026 LCD_WIDTH/2 + 8, LCD_HEIGHT/2 - 4, 7, 8);
2027
2028 screens[i].update();
2029 }
2030
2031 button = button_get(true);
2032 switch (button) {
2033 case BUTTON_LEFT:
2034 case BUTTON_F2 | BUTTON_LEFT:
2035 global_settings.rec_quality++;
2036 if(global_settings.rec_quality > 7)
2037 global_settings.rec_quality = 0;
2038 used = true;
2039 break;
2040
2041 case BUTTON_DOWN:
2042 case BUTTON_F2 | BUTTON_DOWN:
2043 global_settings.rec_frequency++;
2044 if(global_settings.rec_frequency > 5)
2045 global_settings.rec_frequency = 0;
2046 used = true;
2047 break;
2048
2049 case BUTTON_RIGHT:
2050 case BUTTON_F2 | BUTTON_RIGHT:
2051 global_settings.rec_channels++;
2052 if(global_settings.rec_channels > 1)
2053 global_settings.rec_channels = 0;
2054 used = true;
2055 break;
2056
2057 case BUTTON_F2 | BUTTON_REL:
2058 if ( used )
2059 exit = true;
2060 used = true;
2061 break;
2062
2063 case BUTTON_F2 | BUTTON_REPEAT:
2064 used = true;
2065 break;
2066
2067 default:
2068 if(default_event_handler(button) == SYS_USB_CONNECTED)
2069 return true;
2070 break;
2071 }
2072 }
2073
2074 rec_init_recording_options(&rec_options);
2075 rec_set_recording_options(&rec_options);
2076
2077 set_gain();
2078
2079 settings_save();
2080 FOR_NB_SCREENS(i)
2081 screens[i].setfont(FONT_UI);
2082
2083 return false;
2084}
2085
2086static bool f3_rec_screen(void)
2087{
2088 bool exit = false;
2089 bool used = false;
2090 int w, h;
2091 int button;
2092 const char *src_str[] =
2093 {
2094 str(LANG_SYSFONT_RECORDING_SRC_MIC),
2095 str(LANG_SYSFONT_LINE_IN),
2096 str(LANG_SYSFONT_RECORDING_SRC_DIGITAL)
2097 };
2098 struct audio_recording_options rec_options;
2099
2100 FOR_NB_SCREENS(i)
2101 {
2102 screens[i].set_viewport(NULL);
2103 screens[i].setfont(FONT_SYSFIXED);
2104 screens[i].getstringsize("A",&w,&h);
2105 }
2106
2107 while (!exit) {
2108 const char* ptr = src_str[global_settings.rec_source];
2109 FOR_NB_SCREENS(i)
2110 {
2111 screens[i].clear_display();
2112
2113 /* Recording source */
2114 screens[i].putsxy(0, LCD_HEIGHT/2 - h*2,
2115 str(LANG_SYSFONT_RECORDING_SOURCE));
2116
2117 screens[i].getstringsize(ptr, &w, &h);
2118 screens[i].putsxy(0, LCD_HEIGHT/2-h, ptr);
2119 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_FastBackward],
2120 LCD_WIDTH/2 - 16, LCD_HEIGHT/2 - 4, 7, 8);
2121 }
2122
2123 /* trigger setup */
2124 ptr = str(LANG_SYSFONT_RECORD_TRIGGER);
2125 FOR_NB_SCREENS(i)
2126 {
2127 screens[i].getstringsize(ptr,&w,&h);
2128 screens[i].putsxy((LCD_WIDTH-w)/2, LCD_HEIGHT - h*2, ptr);
2129 screens[i].mono_bitmap(bitmap_icons_7x8[Icon_DownArrow],
2130 LCD_WIDTH/2 - 3, LCD_HEIGHT - h*3, 7, 8);
2131
2132 screens[i].update();
2133 }
2134
2135 button = button_get(true);
2136 switch (button) {
2137 case BUTTON_DOWN:
2138 case BUTTON_F3 | BUTTON_DOWN:
2139#ifndef SIMULATOR
2140 rectrigger();
2141 settings_apply_trigger();
2142#endif
2143 exit = true;
2144 break;
2145
2146 case BUTTON_LEFT:
2147 case BUTTON_F3 | BUTTON_LEFT:
2148 global_settings.rec_source++;
2149 if(global_settings.rec_source > AUDIO_SRC_MAX)
2150 global_settings.rec_source = 0;
2151 used = true;
2152 break;
2153
2154 case BUTTON_F3 | BUTTON_REL:
2155 if ( used )
2156 exit = true;
2157 used = true;
2158 break;
2159
2160 case BUTTON_F3 | BUTTON_REPEAT:
2161 used = true;
2162 break;
2163
2164 default:
2165 if(default_event_handler(button) == SYS_USB_CONNECTED)
2166 return true;
2167 break;
2168 }
2169 }
2170
2171 rec_init_recording_options(&rec_options);
2172 rec_set_recording_options(&rec_options);
2173
2174 set_gain();
2175
2176 settings_save();
2177 FOR_NB_SCREENS(i)
2178 screens[i].setfont(FONT_UI);
2179
2180 return false;
2181}
2182#endif /* CONFIG_KEYPAD == RECORDER_PAD */
2183
2184#if CONFIG_CODEC == SWCODEC 1898#if CONFIG_CODEC == SWCODEC
2185void audio_beep(int duration) 1899void audio_beep(int duration)
2186{ 1900{
diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c
index ac6b7a3120..6f561039c3 100644
--- a/apps/recorder/resize.c
+++ b/apps/recorder/resize.c
@@ -63,14 +63,8 @@
63#endif 63#endif
64#include <jpeg_load.h> 64#include <jpeg_load.h>
65 65
66#if CONFIG_CPU == SH7034
67/* 16*16->32 bit multiplication is a single instrcution on the SH1 */
68#define MULUQ(a, b) ((uint32_t) (((uint16_t) (a)) * ((uint16_t) (b))))
69#define MULQ(a, b) ((int32_t) (((int16_t) (a)) * ((int16_t) (b))))
70#else
71#define MULUQ(a, b) ((a) * (b)) 66#define MULUQ(a, b) ((a) * (b))
72#define MULQ(a, b) ((a) * (b)) 67#define MULQ(a, b) ((a) * (b))
73#endif
74 68
75#ifdef HAVE_LCD_COLOR 69#ifdef HAVE_LCD_COLOR
76#define CHANNEL_BYTES (sizeof(struct uint32_argb)/sizeof(uint32_t)) 70#define CHANNEL_BYTES (sizeof(struct uint32_argb)/sizeof(uint32_t))
@@ -151,18 +145,6 @@ int recalc_dimension(struct dim *dst, struct dim *src)
151 "movclr.l %%acc" #num ", %0" \ 145 "movclr.l %%acc" #num ", %0" \
152 : "=d" (dest) \ 146 : "=d" (dest) \
153 ) 147 )
154#elif defined(CPU_SH)
155/* calculate the 32-bit product of unsigned 16-bit op1 and op2 */
156static inline int32_t mul_s16_s16(int16_t op1, int16_t op2)
157{
158 return (int32_t)(op1 * op2);
159}
160
161/* calculate the 32-bit product of signed 16-bit op1 and op2 */
162static inline uint32_t mul_u16_u16(uint16_t op1, uint16_t op2)
163{
164 return (uint32_t)(op1 * op2);
165}
166#endif 148#endif
167 149
168/* horizontal area average scaler */ 150/* horizontal area average scaler */
@@ -171,13 +153,8 @@ static bool scale_h_area(void *out_line_ptr,
171{ 153{
172 SDEBUGF("scale_h_area\n"); 154 SDEBUGF("scale_h_area\n");
173 unsigned int ix, ox, oxe, mul; 155 unsigned int ix, ox, oxe, mul;
174#if defined(CPU_SH) || defined (TEST_SH_MATH)
175 const uint32_t h_i_val = ctx->src->width,
176 h_o_val = ctx->bm->width;
177#else
178 const uint32_t h_i_val = ctx->h_i_val, 156 const uint32_t h_i_val = ctx->h_i_val,
179 h_o_val = ctx->h_o_val; 157 h_o_val = ctx->h_o_val;
180#endif
181#ifdef HAVE_LCD_COLOR 158#ifdef HAVE_LCD_COLOR
182 struct uint32_argb rgbvalacc = { 0, 0, 0, 0 }, 159 struct uint32_argb rgbvalacc = { 0, 0, 0, 0 },
183 rgbvaltmp = { 0, 0, 0, 0 }, 160 rgbvaltmp = { 0, 0, 0, 0 },
@@ -298,15 +275,6 @@ static bool scale_h_area(void *out_line_ptr,
298 mul = h_o_val - oxe; 275 mul = h_o_val - oxe;
299 MAC(tmp, mul, 0); 276 MAC(tmp, mul, 0);
300 MAC_OUT(acc, 0); 277 MAC_OUT(acc, 0);
301#elif defined(CPU_SH)
302/* SH-1 16x16->32 math */
303 /* add saved partial pixel from start of area */
304 acc = mul_u16_u16(acc, h_o_val) + mul_u16_u16(tmp, mul);
305
306 /* get new pixel , then add its partial coverage to this area */
307 tmp = *(part->buf);
308 mul = h_o_val - oxe;
309 acc += mul_u16_u16(tmp, mul);
310#else 278#else
311/* generic C math */ 279/* generic C math */
312 /* add saved partial pixel from start of area */ 280 /* add saved partial pixel from start of area */
@@ -317,10 +285,8 @@ static bool scale_h_area(void *out_line_ptr,
317 mul = h_o_val - oxe; 285 mul = h_o_val - oxe;
318 acc += tmp * mul; 286 acc += tmp * mul;
319#endif /* CPU */ 287#endif /* CPU */
320#if !(defined(CPU_SH) || defined(TEST_SH_MATH))
321 /* round, divide, and either store or accumulate to output row */ 288 /* round, divide, and either store or accumulate to output row */
322 acc = (acc + (1 << 21)) >> 22; 289 acc = (acc + (1 << 21)) >> 22;
323#endif
324 if (accum) 290 if (accum)
325 { 291 {
326 acc += out_line[ox]; 292 acc += out_line[ox];
@@ -346,13 +312,8 @@ static bool scale_h_area(void *out_line_ptr,
346static inline bool scale_v_area(struct rowset *rset, struct scaler_context *ctx) 312static inline bool scale_v_area(struct rowset *rset, struct scaler_context *ctx)
347{ 313{
348 uint32_t mul, oy, iy, oye; 314 uint32_t mul, oy, iy, oye;
349#if defined(CPU_SH) || defined (TEST_SH_MATH)
350 const uint32_t v_i_val = ctx->src->height,
351 v_o_val = ctx->bm->height;
352#else
353 const uint32_t v_i_val = ctx->v_i_val, 315 const uint32_t v_i_val = ctx->v_i_val,
354 v_o_val = ctx->v_o_val; 316 v_o_val = ctx->v_o_val;
355#endif
356 317
357 /* Set up rounding and scale factors */ 318 /* Set up rounding and scale factors */
358 mul = 0; 319 mul = 0;
@@ -409,13 +370,8 @@ static bool scale_h_linear(void *out_line_ptr, struct scaler_context *ctx,
409 bool accum) 370 bool accum)
410{ 371{
411 unsigned int ix, ox, ixe; 372 unsigned int ix, ox, ixe;
412#if defined(CPU_SH) || defined (TEST_SH_MATH)
413 const uint32_t h_i_val = ctx->src->width - 1,
414 h_o_val = ctx->bm->width - 1;
415#else
416 const uint32_t h_i_val = ctx->h_i_val, 373 const uint32_t h_i_val = ctx->h_i_val,
417 h_o_val = ctx->h_o_val; 374 h_o_val = ctx->h_o_val;
418#endif
419 /* type x = x is an ugly hack for hiding an unitialized data warning. The 375 /* type x = x is an ugly hack for hiding an unitialized data warning. The
420 values are conditionally initialized before use, but other values are 376 values are conditionally initialized before use, but other values are
421 set such that this will occur before these are used. 377 set such that this will occur before these are used.
@@ -531,9 +487,6 @@ static bool scale_h_linear(void *out_line_ptr, struct scaler_context *ctx,
531#if defined(CPU_COLDFIRE) 487#if defined(CPU_COLDFIRE)
532/* Coldfire EMAC math */ 488/* Coldfire EMAC math */
533 MAC(val, h_o_val, 0); 489 MAC(val, h_o_val, 0);
534#elif defined(CPU_SH)
535/* SH-1 16x16->32 math */
536 val = mul_u16_u16(val, h_o_val);
537#else 490#else
538/* generic C math */ 491/* generic C math */
539 val = val * h_o_val; 492 val = val * h_o_val;
@@ -552,9 +505,6 @@ static bool scale_h_linear(void *out_line_ptr, struct scaler_context *ctx,
552#if defined(CPU_COLDFIRE) 505#if defined(CPU_COLDFIRE)
553/* Coldfire EMAC math */ 506/* Coldfire EMAC math */
554 MAC(inc, ixe, 0); 507 MAC(inc, ixe, 0);
555#elif defined(CPU_SH)
556/* SH-1 16x16->32 math */
557 val += mul_s16_s16(inc, ixe);
558#else 508#else
559/* generic C math */ 509/* generic C math */
560 val += inc * ixe; 510 val += inc * ixe;
@@ -565,16 +515,10 @@ static bool scale_h_linear(void *out_line_ptr, struct scaler_context *ctx,
565 MAC_OUT(val, 0); 515 MAC_OUT(val, 0);
566#endif 516#endif
567 /* Now multiply the color increment to its proper value */ 517 /* Now multiply the color increment to its proper value */
568#if defined(CPU_SH)
569/* SH-1 16x16->32 math */
570 inc = mul_s16_s16(inc, h_i_val);
571#else
572/* generic C math */ 518/* generic C math */
573 inc *= h_i_val; 519 inc *= h_i_val;
574#endif
575 } else 520 } else
576 val += inc; 521 val += inc;
577#if !(defined(CPU_SH) || defined(TEST_SH_MATH))
578 /* round and scale values, and accumulate or store to output */ 522 /* round and scale values, and accumulate or store to output */
579 if (accum) 523 if (accum)
580 { 524 {
@@ -582,15 +526,6 @@ static bool scale_h_linear(void *out_line_ptr, struct scaler_context *ctx,
582 } else { 526 } else {
583 out_line[ox] = (val + (1 << 21)) >> 22; 527 out_line[ox] = (val + (1 << 21)) >> 22;
584 } 528 }
585#else
586 /* round and scale values, and accumulate or store to output */
587 if (accum)
588 {
589 out_line[ox] += val;
590 } else {
591 out_line[ox] = val;
592 }
593#endif
594#endif 529#endif
595 ixe += h_i_val; 530 ixe += h_i_val;
596 } 531 }
@@ -603,13 +538,8 @@ static inline bool scale_v_linear(struct rowset *rset,
603{ 538{
604 uint32_t iy, iye; 539 uint32_t iy, iye;
605 int32_t oy; 540 int32_t oy;
606#if defined(CPU_SH) || defined (TEST_SH_MATH)
607 const uint32_t v_i_val = ctx->src->height - 1,
608 v_o_val = ctx->bm->height - 1;
609#else
610 const uint32_t v_i_val = ctx->v_i_val, 541 const uint32_t v_i_val = ctx->v_i_val,
611 v_o_val = ctx->v_o_val; 542 v_o_val = ctx->v_o_val;
612#endif
613 /* Set up our buffers, to store the increment and current value for each 543 /* Set up our buffers, to store the increment and current value for each
614 column, and one temp buffer used to read in new rows. 544 column, and one temp buffer used to read in new rows.
615 */ 545 */
@@ -892,9 +822,6 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src,
892 ctx.bm = bm; 822 ctx.bm = bm;
893 ctx.src = src; 823 ctx.src = src;
894 ctx.dither = dither; 824 ctx.dither = dither;
895#if defined(CPU_SH) || defined (TEST_SH_MATH)
896 uint32_t div;
897#endif
898#if !defined(PLUGIN) 825#if !defined(PLUGIN)
899#if defined(HAVE_LCD_COLOR) && defined(HAVE_JPEG) 826#if defined(HAVE_LCD_COLOR) && defined(HAVE_JPEG)
900 ctx.output_row = format_index ? output_row_32_native_fromyuv 827 ctx.output_row = format_index ? output_row_32_native_fromyuv
@@ -914,23 +841,15 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src,
914 { 841 {
915#endif 842#endif
916 ctx.h_scaler = scale_h_area; 843 ctx.h_scaler = scale_h_area;
917#if defined(CPU_SH) || defined (TEST_SH_MATH)
918 div = sw;
919#else
920 uint32_t h_div = (1U << 24) / sw; 844 uint32_t h_div = (1U << 24) / sw;
921 ctx.h_i_val = sw * h_div; 845 ctx.h_i_val = sw * h_div;
922 ctx.h_o_val = dw * h_div; 846 ctx.h_o_val = dw * h_div;
923#endif
924#ifdef HAVE_UPSCALER 847#ifdef HAVE_UPSCALER
925 } else { 848 } else {
926 ctx.h_scaler = scale_h_linear; 849 ctx.h_scaler = scale_h_linear;
927#if defined(CPU_SH) || defined (TEST_SH_MATH)
928 div = dw - 1;
929#else
930 uint32_t h_div = (1U << 24) / (dw - 1); 850 uint32_t h_div = (1U << 24) / (dw - 1);
931 ctx.h_i_val = (sw - 1) * h_div; 851 ctx.h_i_val = (sw - 1) * h_div;
932 ctx.h_o_val = (dw - 1) * h_div; 852 ctx.h_o_val = (dw - 1) * h_div;
933#endif
934 } 853 }
935#endif 854#endif
936#ifdef CPU_COLDFIRE 855#ifdef CPU_COLDFIRE
@@ -941,27 +860,17 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src,
941 if (sh > dh) 860 if (sh > dh)
942#endif 861#endif
943 { 862 {
944#if defined(CPU_SH) || defined (TEST_SH_MATH)
945 div *= sh;
946 ctx.recip = ((uint32_t)(-div)) / div + 1;
947#else
948 uint32_t v_div = (1U << 22) / sh; 863 uint32_t v_div = (1U << 22) / sh;
949 ctx.v_i_val = sh * v_div; 864 ctx.v_i_val = sh * v_div;
950 ctx.v_o_val = dh * v_div; 865 ctx.v_o_val = dh * v_div;
951#endif
952 ret = scale_v_area(rset, &ctx); 866 ret = scale_v_area(rset, &ctx);
953 } 867 }
954#ifdef HAVE_UPSCALER 868#ifdef HAVE_UPSCALER
955 else 869 else
956 { 870 {
957#if defined(CPU_SH) || defined (TEST_SH_MATH)
958 div *= dh - 1;
959 ctx.recip = ((uint32_t)(-div)) / div + 1;
960#else
961 uint32_t v_div = (1U << 22) / dh; 871 uint32_t v_div = (1U << 22) / dh;
962 ctx.v_i_val = (sh - 1) * v_div; 872 ctx.v_i_val = (sh - 1) * v_div;
963 ctx.v_o_val = (dh - 1) * v_div; 873 ctx.v_o_val = (dh - 1) * v_div;
964#endif
965 ret = scale_v_linear(rset, &ctx); 874 ret = scale_v_linear(rset, &ctx);
966 } 875 }
967#endif 876#endif
diff --git a/apps/recorder/resize.h b/apps/recorder/resize.h
index 7e0a991eea..0282a17197 100644
--- a/apps/recorder/resize.h
+++ b/apps/recorder/resize.h
@@ -43,59 +43,7 @@
43#define MAX_SC_STACK_ALLOC 0 43#define MAX_SC_STACK_ALLOC 0
44#define HAVE_UPSCALER 1 44#define HAVE_UPSCALER 1
45 45
46#if defined(CPU_SH)
47/* perform 32x32->40 unsigned multiply, round off and return top 8 bits */
48static inline uint32_t sc_mul_u32_rnd(uint32_t m, uint32_t n)
49{
50 unsigned r, t1, t2, t3;
51 unsigned h = 1 << 15;
52 /* notation:
53 m = ab, n = cd
54 final result is (((a *c) << 32) + ((b * c + a * d) << 16) + b * d +
55 (1 << 31)) >> 32
56 */
57 asm (
58 "swap.w %[m], %[t1]\n\t" /* t1 = ba */
59 "mulu %[m], %[n]\n\t" /* b * d */
60 "swap.w %[n], %[t3]\n\t" /* t3 = dc */
61 "sts macl, %[r]\n\t" /* r = b * d */
62 "mulu %[m], %[t3]\n\t" /* b * c */
63 "shlr16 %[r]\n\t"
64 "sts macl, %[t2]\n\t" /* t2 = b * c */
65 "mulu %[t1], %[t3]\n\t" /* a * c */
66 "add %[t2], %[r]\n\t"
67 "sts macl, %[t3]\n\t" /* t3 = a * c */
68 "mulu %[t1], %[n]\n\t" /* a * d */
69 "shll16 %[t3]\n\t"
70 "sts macl, %[t2]\n\t" /* t2 = a * d */
71 "add %[t2], %[r]\n\t"
72 "add %[t3], %[r]\n\t" /* r = ((b * d) >> 16) + (b * c + a * d) +
73 ((a * c) << 16) */
74 "add %[h], %[r]\n\t" /* round result */
75 "shlr16 %[r]\n\t" /* truncate result */
76 : /* outputs */
77 [r] "=&r"(r),
78 [t1]"=&r"(t1),
79 [t2]"=&r"(t2),
80 [t3]"=&r"(t3)
81 : /* inputs */
82 [h] "r" (h),
83 [m] "r" (m),
84 [n] "r" (n)
85 );
86 return r;
87}
88#elif defined(TEST_SH_MATH)
89static inline uint32_t sc_mul_u32_rnd(uint32_t op1, uint32_t op2)
90{
91 uint64_t tmp = (uint64_t)op1 * op2;
92 tmp += 1LU << 31;
93 tmp >>= 32;
94 return tmp;
95}
96#else
97#define SC_OUT(n, c) (((n) + (1 << 23)) >> 24) 46#define SC_OUT(n, c) (((n) + (1 << 23)) >> 24)
98#endif
99#ifndef SC_OUT 47#ifndef SC_OUT
100#define SC_OUT(n, c) (sc_mul_u32_rnd(n, (c)->recip)) 48#define SC_OUT(n, c) (sc_mul_u32_rnd(n, (c)->recip))
101#endif 49#endif
@@ -125,14 +73,10 @@ struct uint32_argb {
125 horizontal scaler, and row output 73 horizontal scaler, and row output
126*/ 74*/
127struct scaler_context { 75struct scaler_context {
128#if defined(CPU_SH) || defined(TEST_SH_MATH)
129 uint32_t recip;
130#else
131 uint32_t h_i_val; 76 uint32_t h_i_val;
132 uint32_t h_o_val; 77 uint32_t h_o_val;
133 uint32_t v_i_val; 78 uint32_t v_i_val;
134 uint32_t v_o_val; 79 uint32_t v_o_val;
135#endif
136 struct bitmap *bm; 80 struct bitmap *bm;
137 struct dim *src; 81 struct dim *src;
138 unsigned char *buf; 82 unsigned char *buf;
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 49379bbbfc..9ff7325ce1 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -484,21 +484,6 @@ MENUITEM_RETURNVALUE(playlists, ID2P(LANG_CATALOG), GO_TO_PLAYLISTS_SCREEN,
484MENUITEM_RETURNVALUE(system_menu_, ID2P(LANG_SYSTEM), GO_TO_SYSTEM_SCREEN, 484MENUITEM_RETURNVALUE(system_menu_, ID2P(LANG_SYSTEM), GO_TO_SYSTEM_SCREEN,
485 NULL, Icon_System_menu); 485 NULL, Icon_System_menu);
486 486
487#if CONFIG_KEYPAD == PLAYER_PAD
488static int do_shutdown(void)
489{
490#if CONFIG_CHARGING
491 if (charger_inserted())
492 charging_splash();
493 else
494#endif
495 sys_poweroff();
496 return 0;
497}
498MENUITEM_FUNCTION(do_shutdown_item, 0, ID2P(LANG_SHUTDOWN),
499 do_shutdown, NULL, NULL, Icon_NOICON);
500#endif
501
502struct menu_item_ex root_menu_; 487struct menu_item_ex root_menu_;
503static struct menu_callback_with_desc root_menu_desc = { 488static struct menu_callback_with_desc root_menu_desc = {
504 item_callback, ID2P(LANG_ROCKBOX_TITLE), Icon_Rockbox }; 489 item_callback, ID2P(LANG_ROCKBOX_TITLE), Icon_Rockbox };
@@ -521,9 +506,6 @@ static struct menu_table menu_table[] = {
521 { "playlists", &playlists }, 506 { "playlists", &playlists },
522 { "plugins", &rocks_browser }, 507 { "plugins", &rocks_browser },
523 { "system_menu", &system_menu_ }, 508 { "system_menu", &system_menu_ },
524#if CONFIG_KEYPAD == PLAYER_PAD
525 { "shutdown", &do_shutdown_item },
526#endif
527 { "shortcuts", &shortcut_menu }, 509 { "shortcuts", &shortcut_menu },
528}; 510};
529#define MAX_MENU_ITEMS (sizeof(menu_table) / sizeof(struct menu_table)) 511#define MAX_MENU_ITEMS (sizeof(menu_table) / sizeof(struct menu_table))
diff --git a/apps/screen_access.c b/apps/screen_access.c
index fe5e943cca..a966d07876 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -61,10 +61,6 @@ static int screen_helper_getnblines(void)
61#ifdef HAVE_LCD_BITMAP 61#ifdef HAVE_LCD_BITMAP
62 if(global_settings.statusbar != STATUSBAR_OFF) 62 if(global_settings.statusbar != STATUSBAR_OFF)
63 height -= STATUSBAR_HEIGHT; 63 height -= STATUSBAR_HEIGHT;
64#ifdef HAVE_BUTTONBAR
65 if(global_settings.buttonbar && screens[0].has_buttonbar)
66 height -= BUTTONBAR_HEIGHT;
67#endif
68#endif 64#endif
69 return height / screens[0].getcharheight(); 65 return height / screens[0].getcharheight();
70} 66}
@@ -134,10 +130,6 @@ static int screen_helper_remote_getnblines(void)
134#ifdef HAVE_LCD_BITMAP 130#ifdef HAVE_LCD_BITMAP
135 if(global_settings.statusbar != STATUSBAR_OFF) 131 if(global_settings.statusbar != STATUSBAR_OFF)
136 height -= STATUSBAR_HEIGHT; 132 height -= STATUSBAR_HEIGHT;
137#ifdef HAVE_BUTTONBAR
138 if(global_settings.buttonbar && screens[1].has_buttonbar)
139 height -= BUTTONBAR_HEIGHT;
140#endif
141#endif 133#endif
142 return height / screens[1].getcharheight(); 134 return height / screens[1].getcharheight();
143} 135}
@@ -276,9 +268,6 @@ struct screen screens[NB_SCREENS] =
276 .backdrop_load=&backdrop_load, 268 .backdrop_load=&backdrop_load,
277 .backdrop_show=&backdrop_show, 269 .backdrop_show=&backdrop_show,
278#endif 270#endif
279#ifdef HAVE_BUTTONBAR
280 .has_buttonbar=false,
281#endif
282#if defined(HAVE_LCD_BITMAP) 271#if defined(HAVE_LCD_BITMAP)
283 .set_framebuffer = (void*)lcd_set_framebuffer, 272 .set_framebuffer = (void*)lcd_set_framebuffer,
284#if defined(HAVE_LCD_COLOR) 273#if defined(HAVE_LCD_COLOR)
@@ -369,14 +358,11 @@ struct screen screens[NB_SCREENS] =
369 .backlight_off=&remote_backlight_off, 358 .backlight_off=&remote_backlight_off,
370 .is_backlight_on=&is_remote_backlight_on, 359 .is_backlight_on=&is_remote_backlight_on,
371 .backlight_set_timeout=&remote_backlight_set_timeout, 360 .backlight_set_timeout=&remote_backlight_set_timeout,
372 361
373#if LCD_DEPTH > 1 362#if LCD_DEPTH > 1
374 .backdrop_load=&remote_backdrop_load, 363 .backdrop_load=&remote_backdrop_load,
375 .backdrop_show=&remote_backdrop_show, 364 .backdrop_show=&remote_backdrop_show,
376#endif 365#endif
377#ifdef HAVE_BUTTONBAR
378 .has_buttonbar=false,
379#endif
380#if defined(HAVE_LCD_BITMAP) 366#if defined(HAVE_LCD_BITMAP)
381 .set_framebuffer = (void*)lcd_remote_set_framebuffer, 367 .set_framebuffer = (void*)lcd_remote_set_framebuffer,
382#endif 368#endif
diff --git a/apps/screen_access.h b/apps/screen_access.h
index c4a87849b8..6b90bc9313 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -23,7 +23,6 @@
23#define _SCREEN_ACCESS_H_ 23#define _SCREEN_ACCESS_H_
24 24
25#include "lcd.h" 25#include "lcd.h"
26#include "buttonbar.h"
27#include "scroll_engine.h" 26#include "scroll_engine.h"
28#include "backdrop.h" 27#include "backdrop.h"
29#include "line.h" 28#include "line.h"
@@ -64,9 +63,6 @@ struct screen
64#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD) 63#if (CONFIG_LED == LED_VIRTUAL) || defined(HAVE_REMOTE_LCD)
65 bool has_disk_led; 64 bool has_disk_led;
66#endif 65#endif
67#ifdef HAVE_BUTTONBAR
68 bool has_buttonbar;
69#endif
70 void (*set_drawmode)(int mode); 66 void (*set_drawmode)(int mode);
71 void (*set_viewport)(struct viewport* vp); 67 void (*set_viewport)(struct viewport* vp);
72 int (*getwidth)(void); 68 int (*getwidth)(void);
diff --git a/apps/screens.c b/apps/screens.c
index e7262704f0..52e8cadc7e 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -56,230 +56,8 @@
56#include "language.h" 56#include "language.h"
57#include "replaygain.h" 57#include "replaygain.h"
58 58
59#if defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
60#include "adc.h"
61#endif
62
63#if (CONFIG_STORAGE & STORAGE_MMC) && (defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM))
64int mmc_remove_request(void)
65{
66 struct queue_event ev;
67 FOR_NB_SCREENS(i)
68 screens[i].clear_display();
69 splash(0, ID2P(LANG_REMOVE_MMC));
70
71 while (1)
72 {
73 queue_wait_w_tmo(&button_queue, &ev, HZ/2);
74 switch (ev.id)
75 {
76 case SYS_HOTSWAP_EXTRACTED:
77 return SYS_HOTSWAP_EXTRACTED;
78
79 case SYS_USB_DISCONNECTED:
80 return SYS_USB_DISCONNECTED;
81 }
82 }
83}
84#endif
85#include "ctype.h" 59#include "ctype.h"
86 60
87/* the charging screen is only used for archos targets */
88#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) && defined(CPU_SH)
89
90#ifdef HAVE_LCD_BITMAP
91static void charging_display_info(bool animate)
92{
93 unsigned char charging_logo[36];
94 const int pox_x = (LCD_WIDTH - sizeof(charging_logo)) / 2;
95 const int pox_y = 32;
96 static unsigned phase = 3;
97 unsigned i;
98
99#if !defined(NEED_ATA_POWER_BATT_MEASURE)
100 {
101 int battv = battery_voltage();
102 lcd_putsf(0, 7, " Batt: %d.%02dV %d%% ", battv / 1000,
103 (battv % 1000) / 10, battery_level());
104 }
105#elif defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
106 /* IDE power is normally off here, so display input current instead */
107 lcd_putsf(7, 7, "%dmA ",
108 (adc_read(ADC_EXT_POWER) * EXT_SCALE_FACTOR) / 10000);
109#endif
110
111#ifdef ARCHOS_RECORDER
112 lcd_puts(0, 2, "Charge mode:");
113
114 const char *s;
115 if (charge_state == CHARGING)
116 s = str(LANG_BATTERY_CHARGE);
117 else if (charge_state == TOPOFF)
118 s = str(LANG_BATTERY_TOPOFF_CHARGE);
119 else if (charge_state == TRICKLE)
120 s = str(LANG_BATTERY_TRICKLE_CHARGE);
121 else
122 s = "not charging";
123
124 lcd_puts(0, 3, s);
125 if (!charger_enabled())
126 animate = false;
127#endif /* ARCHOS_RECORDER */
128
129 /* middle part */
130 memset(charging_logo+3, 0x00, 32);
131 charging_logo[0] = 0x3C;
132 charging_logo[1] = 0x24;
133 charging_logo[2] = charging_logo[35] = 0xFF;
134
135 if (!animate)
136 { /* draw the outline */
137 /* middle part */
138 lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8,
139 sizeof(charging_logo), 8);
140 lcd_set_drawmode(DRMODE_FG);
141 /* upper line */
142 charging_logo[0] = charging_logo[1] = 0x00;
143 memset(charging_logo+2, 0x80, 34);
144 lcd_mono_bitmap(charging_logo, pox_x, pox_y, sizeof(charging_logo), 8);
145 /* lower line */
146 memset(charging_logo+2, 0x01, 34);
147 lcd_mono_bitmap(charging_logo, pox_x, pox_y + 16,
148 sizeof(charging_logo), 8);
149 lcd_set_drawmode(DRMODE_SOLID);
150 }
151 else
152 { /* animate the middle part */
153 for (i = 3; i<MIN(sizeof(charging_logo)-1, phase); i++)
154 {
155 if ((i-phase) % 8 == 0)
156 { /* draw a "bubble" here */
157 unsigned bitpos;
158 bitpos = (phase + i/8) % 15; /* "bounce" effect */
159 if (bitpos > 7)
160 bitpos = 14 - bitpos;
161 charging_logo[i] = BIT_N(bitpos);
162 }
163 }
164 lcd_mono_bitmap(charging_logo, pox_x, pox_y + 8,
165 sizeof(charging_logo), 8);
166 phase++;
167 }
168 lcd_update();
169}
170#else /* not HAVE_LCD_BITMAP */
171
172static unsigned long logo_chars[4];
173static const unsigned char logo_pattern[] = {
174 0x07, 0x04, 0x1c, 0x14, 0x1c, 0x04, 0x07, 0, /* char 1 */
175 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 2 */
176 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0, /* char 3 */
177 0x1f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f, 0, /* char 4 */
178};
179
180static void logo_lock_patterns(bool on)
181{
182 int i;
183
184 if (on)
185 {
186 for (i = 0; i < 4; i++)
187 logo_chars[i] = lcd_get_locked_pattern();
188 }
189 else
190 {
191 for (i = 0; i < 4; i++)
192 lcd_unlock_pattern(logo_chars[i]);
193 }
194}
195
196static void charging_display_info(bool animate)
197{
198 int battv;
199 unsigned i, ypos;
200 static unsigned phase = 3;
201 char buf[32];
202
203 battv = battery_voltage();
204 lcd_putsf(4, 1, " %d.%02dV", battv / 1000, (battv % 1000) / 10);
205
206 memcpy(buf, logo_pattern, 32); /* copy logo patterns */
207
208 if (!animate) /* build the screen */
209 {
210 lcd_double_height(false);
211 lcd_puts(0, 0, "[Charging]");
212 for (i = 0; i < 4; i++)
213 lcd_putc(i, 1, logo_chars[i]);
214 }
215 else /* animate the logo */
216 {
217 for (i = 3; i < MIN(19, phase); i++)
218 {
219 if ((i - phase) % 5 == 0)
220 { /* draw a "bubble" here */
221 ypos = (phase + i/5) % 9; /* "bounce" effect */
222 if (ypos > 4)
223 ypos = 8 - ypos;
224 buf[5 - ypos + 8 * (i/5)] |= 0x10u >> (i%5);
225 }
226 }
227 phase++;
228 }
229
230 for (i = 0; i < 4; i++)
231 lcd_define_pattern(logo_chars[i], buf + 8 * i);
232
233 lcd_update();
234}
235#endif /* (not) HAVE_LCD_BITMAP */
236
237/* blocks while charging, returns on event:
238 1 if charger cable was removed
239 2 if Off/Stop key was pressed
240 3 if On key was pressed
241 4 if USB was connected */
242
243int charging_screen(void)
244{
245 unsigned int button;
246 int rc = 0;
247
248 ide_power_enable(false); /* power down the disk, else would be spinning */
249
250 lcd_clear_display();
251 backlight_set_timeout(global_settings.backlight_timeout);
252#ifdef HAVE_REMOTE_LCD
253 remote_backlight_set_timeout(global_settings.remote_backlight_timeout);
254#endif
255 backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged);
256
257#ifdef HAVE_LCD_CHARCELLS
258 logo_lock_patterns(true);
259#endif
260 charging_display_info(false);
261
262 do
263 {
264 gui_syncstatusbar_draw(&statusbars, false);
265 charging_display_info(true);
266 button = get_action(CONTEXT_STD,HZ/3);
267 if (button == ACTION_STD_OK)
268 rc = 2;
269 else if (usb_detect() == USB_INSERTED)
270 rc = 3;
271 /* do not depend on power management thread here */
272 else if (!(power_input_status() & POWER_INPUT_MAIN_CHARGER))
273 rc = 1;
274 } while (!rc);
275
276#ifdef HAVE_LCD_CHARCELLS
277 logo_lock_patterns(false);
278#endif
279 return rc;
280}
281#endif /* CONFIG_CHARGING && !HAVE_POWEROFF_WHILE_CHARGING && defined(CPU_SH) */
282
283#if CONFIG_CHARGING 61#if CONFIG_CHARGING
284void charging_splash(void) 62void charging_splash(void)
285{ 63{
@@ -585,44 +363,6 @@ bool set_time_screen(const char* title, struct tm *tm)
585} 363}
586#endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */ 364#endif /* defined(HAVE_LCD_BITMAP) && (CONFIG_RTC != 0) */
587 365
588#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(HAVE_SW_POWEROFF)
589#include "scroll_engine.h"
590bool shutdown_screen(void)
591{
592 int button;
593 bool done = false;
594 long time_entered = current_tick;
595
596 lcd_scroll_stop();
597
598 splash(0, str(LANG_CONFIRM_SHUTDOWN));
599
600 while(!done && TIME_BEFORE(current_tick,time_entered+HZ*2))
601 {
602 button = get_action(CONTEXT_STD,HZ);
603 switch(button)
604 {
605 case ACTION_STD_CANCEL:
606 sys_poweroff();
607 break;
608
609 /* do nothing here, because ACTION_NONE might be caused
610 * by timeout or button release. In case of timeout the loop
611 * is terminated by TIME_BEFORE */
612 case ACTION_NONE:
613 break;
614
615 default:
616 if(default_event_handler(button) == SYS_USB_CONNECTED)
617 return true;
618 done = true;
619 break;
620 }
621 }
622 return false;
623}
624#endif
625
626static const int id3_headers[]= 366static const int id3_headers[]=
627{ 367{
628 LANG_ID3_TITLE, 368 LANG_ID3_TITLE,
diff --git a/apps/screens.h b/apps/screens.h
index d8b697a2a0..2201f679bd 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -26,9 +26,6 @@
26 26
27struct screen; 27struct screen;
28 28
29#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING) && defined(CPU_SH)
30int charging_screen(void);
31#endif
32#if CONFIG_CHARGING || defined(SIMULATOR) 29#if CONFIG_CHARGING || defined(SIMULATOR)
33void charging_splash(void); 30void charging_splash(void);
34#endif 31#endif
diff --git a/apps/settings.c b/apps/settings.c
index 046c14628c..185e2c3576 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -74,9 +74,6 @@
74#include "bootchart.h" 74#include "bootchart.h"
75#include "scroll_engine.h" 75#include "scroll_engine.h"
76 76
77#if CONFIG_CODEC == MAS3507D
78void dac_line_in(bool enable);
79#endif
80struct user_settings global_settings; 77struct user_settings global_settings;
81struct system_status global_status; 78struct system_status global_status;
82 79
@@ -759,16 +756,6 @@ void sound_settings_apply(void)
759#endif 756#endif
760 sound_set(SOUND_CHANNELS, global_settings.channel_config); 757 sound_set(SOUND_CHANNELS, global_settings.channel_config);
761 sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); 758 sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width);
762#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
763 sound_set(SOUND_LOUDNESS, global_settings.loudness);
764 sound_set(SOUND_AVC, global_settings.avc);
765 sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength);
766 sound_set(SOUND_MDB_HARMONICS, global_settings.mdb_harmonics);
767 sound_set(SOUND_MDB_CENTER, global_settings.mdb_center);
768 sound_set(SOUND_MDB_SHAPE, global_settings.mdb_shape);
769 sound_set(SOUND_MDB_ENABLE, global_settings.mdb_enable);
770 sound_set(SOUND_SUPERBASS, global_settings.superbass);
771#endif
772#ifdef AUDIOHW_HAVE_BASS_CUTOFF 759#ifdef AUDIOHW_HAVE_BASS_CUTOFF
773 sound_set(SOUND_BASS_CUTOFF, global_settings.bass_cutoff); 760 sound_set(SOUND_BASS_CUTOFF, global_settings.bass_cutoff);
774#endif 761#endif
@@ -868,9 +855,6 @@ void settings_apply(bool read_disk)
868#ifdef HAVE_DISK_STORAGE 855#ifdef HAVE_DISK_STORAGE
869 storage_spindown(global_settings.disk_spindown); 856 storage_spindown(global_settings.disk_spindown);
870#endif 857#endif
871#if (CONFIG_CODEC == MAS3507D) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
872 dac_line_in(global_settings.line_in);
873#endif
874 set_poweroff_timeout(global_settings.poweroff); 858 set_poweroff_timeout(global_settings.poweroff);
875 if (global_settings.sleeptimer_on_startup) 859 if (global_settings.sleeptimer_on_startup)
876 set_sleeptimer_duration(global_settings.sleeptimer_duration); 860 set_sleeptimer_duration(global_settings.sleeptimer_duration);
diff --git a/apps/settings.h b/apps/settings.h
index b72eec6f8b..4661966ad2 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -535,10 +535,6 @@ struct user_settings
535 int remote_statusbar; 535 int remote_statusbar;
536#endif 536#endif
537 537
538#if CONFIG_KEYPAD == RECORDER_PAD
539 bool buttonbar; /* 0=hide, 1=show */
540#endif
541
542#ifdef HAVE_LCD_BITMAP 538#ifdef HAVE_LCD_BITMAP
543 int scrollbar; /* SCROLLBAR_* enum values */ 539 int scrollbar; /* SCROLLBAR_* enum values */
544 int scrollbar_width; 540 int scrollbar_width;
@@ -728,10 +724,6 @@ struct user_settings
728#endif 724#endif
729#endif /* HAVE_REMOTE_LCD */ 725#endif /* HAVE_REMOTE_LCD */
730 726
731#if CONFIG_CODEC == MAS3507D
732 bool line_in; /* false=off, true=active */
733#endif
734
735#ifdef HAVE_BUTTON_LIGHT 727#ifdef HAVE_BUTTON_LIGHT
736 int buttonlight_timeout; 728 int buttonlight_timeout;
737#endif 729#endif
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 435a09bb8a..348caec6e5 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -310,11 +310,7 @@ static const char graphic_numeric[] = "graphic,numeric";
310 310
311#ifdef HAVE_RECORDING 311#ifdef HAVE_RECORDING
312/* these should be in the config.h files */ 312/* these should be in the config.h files */
313#if CONFIG_CODEC == MAS3587F 313#if CONFIG_CODEC == SWCODEC
314# define DEFAULT_REC_MIC_GAIN 8
315# define DEFAULT_REC_LEFT_GAIN 2
316# define DEFAULT_REC_RIGHT_GAIN 2
317#elif CONFIG_CODEC == SWCODEC
318# ifdef HAVE_UDA1380 314# ifdef HAVE_UDA1380
319# define DEFAULT_REC_MIC_GAIN 16 315# define DEFAULT_REC_MIC_GAIN 16
320# define DEFAULT_REC_LEFT_GAIN 0 316# define DEFAULT_REC_LEFT_GAIN 0
@@ -595,17 +591,6 @@ static void eq_set_default(void* setting, void* defaultval)
595{ 591{
596 memcpy(setting, defaultval, sizeof(struct eq_band_setting)); 592 memcpy(setting, defaultval, sizeof(struct eq_band_setting));
597} 593}
598
599#endif
600#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
601static void set_mdb_enable(bool value)
602{
603 sound_set_mdb_enable((int)value);
604}
605static void set_superbass(bool value)
606{
607 sound_set_superbass((int)value);
608}
609#endif 594#endif
610 595
611#ifdef HAVE_QUICKSCREEN 596#ifdef HAVE_QUICKSCREEN
@@ -849,17 +834,6 @@ const struct settings_list settings[] = {
849#endif /* HAVE_WM8978 */ 834#endif /* HAVE_WM8978 */
850#endif /* AUDIOHW_HAVE_EQ */ 835#endif /* AUDIOHW_HAVE_EQ */
851/* 3-d enhancement effect */ 836/* 3-d enhancement effect */
852#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
853 SOUND_SETTING(0,loudness, LANG_LOUDNESS, "loudness", SOUND_LOUDNESS),
854 /* requires index, uses table defined by driver */
855 STRINGCHOICE_SETTING(F_SOUNDSETTING,avc,LANG_AUTOVOL,0,"auto volume",
856 "off,20 ms,2 s,4 s,8 s,", sound_set_avc, 5,
857 LANG_OFF,TALK_ID(20, UNIT_MS),TALK_ID(2, UNIT_SEC),
858 TALK_ID(4, UNIT_SEC),TALK_ID(8, UNIT_SEC)),
859 OFFON_SETTING(F_SOUNDSETTING, superbass, LANG_SUPERBASS, false, "superbass",
860 set_superbass),
861#endif
862
863 CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION, 837 CHOICE_SETTING(F_SOUNDSETTING, channel_config, LANG_CHANNEL_CONFIGURATION,
864 0,"channels", 838 0,"channels",
865 "stereo,mono,custom,mono left,mono right,karaoke", 839 "stereo,mono,custom,mono left,mono right,karaoke",
@@ -993,9 +967,6 @@ const struct settings_list settings[] = {
993 INT(DEFAULT_THEME_SEPARATOR),"list separator color",NULL,UNUSED}, 967 INT(DEFAULT_THEME_SEPARATOR),"list separator color",NULL,UNUSED},
994#endif 968#endif
995#endif 969#endif
996#if CONFIG_KEYPAD == RECORDER_PAD
997 OFFON_SETTING(F_THEMESETTING,buttonbar, LANG_BUTTON_BAR ,true,"buttonbar", NULL),
998#endif
999 CHOICE_SETTING(F_THEMESETTING, volume_type, LANG_VOLUME_DISPLAY, 0, 970 CHOICE_SETTING(F_THEMESETTING, volume_type, LANG_VOLUME_DISPLAY, 0,
1000 "volume display", graphic_numeric, NULL, 2, 971 "volume display", graphic_numeric, NULL, 2,
1001 ID2P(LANG_DISPLAY_GRAPHIC), 972 ID2P(LANG_DISPLAY_GRAPHIC),
@@ -1336,21 +1307,6 @@ const struct settings_list settings[] = {
1336 "peak meter clipcounter", NULL), 1307 "peak meter clipcounter", NULL),
1337#endif /* HAVE_RECORDING */ 1308#endif /* HAVE_RECORDING */
1338#endif /* HAVE_LCD_BITMAP */ 1309#endif /* HAVE_LCD_BITMAP */
1339#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1340 SOUND_SETTING(F_SOUNDSETTING, mdb_strength, LANG_MDB_STRENGTH,
1341 "mdb strength", SOUND_MDB_STRENGTH),
1342 SOUND_SETTING(F_SOUNDSETTING, mdb_harmonics, LANG_MDB_HARMONICS,
1343 "mdb harmonics", SOUND_MDB_HARMONICS),
1344 SOUND_SETTING(F_SOUNDSETTING, mdb_center, LANG_MDB_CENTER,
1345 "mdb center", SOUND_MDB_CENTER),
1346 SOUND_SETTING(F_SOUNDSETTING, mdb_shape, LANG_MDB_SHAPE,
1347 "mdb shape", SOUND_MDB_SHAPE),
1348 OFFON_SETTING(F_SOUNDSETTING, mdb_enable, LANG_MDB_ENABLE,
1349 false, "mdb enable", set_mdb_enable),
1350#endif
1351#if CONFIG_CODEC == MAS3507D
1352 OFFON_SETTING(F_SOUNDSETTING, line_in,LANG_LINE_IN,false,"line in",NULL),
1353#endif
1354 /* voice */ 1310 /* voice */
1355 OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL), 1311 OFFON_SETTING(F_TEMPVAR, talk_menu, LANG_VOICE_MENU, true, "talk menu", NULL),
1356 CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0, 1312 CHOICE_SETTING(0, talk_dir, LANG_VOICE_DIR, 0,
@@ -1442,15 +1398,6 @@ const struct settings_list settings[] = {
1442 INT(DEFAULT_REC_RIGHT_GAIN), 1398 INT(DEFAULT_REC_RIGHT_GAIN),
1443 "rec right gain",NULL,UNUSED}, 1399 "rec right gain",NULL,UNUSED},
1444#endif /* DEFAULT_REC_RIGHT_GAIN */ 1400#endif /* DEFAULT_REC_RIGHT_GAIN */
1445#if CONFIG_CODEC == MAS3587F
1446 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
1447 LANG_FREQUENCY, INT(0), "rec frequency",
1448 "44,48,32,22,24,16", UNUSED},
1449 INT_SETTING(F_RECSETTING, rec_quality, LANG_RECORDING_QUALITY, 5,
1450 "rec quality", UNIT_INT, 0, 7, 1, NULL, NULL, NULL),
1451 OFFON_SETTING(F_RECSETTING, rec_editable, LANG_RECORDING_EDITABLE, false,
1452 "editable recordings", NULL),
1453#endif /* CONFIG_CODEC == MAS3587F */
1454#if CONFIG_CODEC == SWCODEC 1401#if CONFIG_CODEC == SWCODEC
1455 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency, 1402 {F_T_INT|F_RECSETTING,&global_settings.rec_frequency,
1456 LANG_FREQUENCY,INT(REC_FREQ_DEFAULT), 1403 LANG_FREQUENCY,INT(REC_FREQ_DEFAULT),
diff --git a/apps/talk.c b/apps/talk.c
index 72b9a2eb30..3aedaf34ec 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -107,17 +107,13 @@ struct voicefile_header /* file format of our voice file */
107 107
108/***************** Globals *****************/ 108/***************** Globals *****************/
109 109
110#if (CONFIG_CODEC == SWCODEC && MEMORYSIZE <= 2) || defined(ONDIO_SERIES) 110#if (CONFIG_CODEC == SWCODEC && MEMORYSIZE <= 2)
111/* On low memory swcodec targets the entire voice file wouldn't fit in memory 111/* On low memory swcodec targets the entire voice file wouldn't fit in memory
112 * together with codecs, so we load clips each time they are accessed. 112 * together with codecs, so we load clips each time they are accessed. */
113 * The Ondios have slow storage access and loading the entire voice file would
114 * take several seconds, so we use the same mechanism. */
115#define TALK_PROGRESSIVE_LOAD 113#define TALK_PROGRESSIVE_LOAD
116#if !defined(ONDIO_SERIES)
117/* 70+ clips should fit into 100k */ 114/* 70+ clips should fit into 100k */
118#define MAX_CLIP_BUFFER_SIZE (100000) 115#define MAX_CLIP_BUFFER_SIZE (100000)
119#endif 116#endif
120#endif
121 117
122#ifndef MAX_CLIP_BUFFER_SIZE 118#ifndef MAX_CLIP_BUFFER_SIZE
123/* 1GB should be enough for everybody; will be capped to voicefile size */ 119/* 1GB should be enough for everybody; will be capped to voicefile size */
@@ -212,14 +208,6 @@ static void sync_callback(int handle, bool sync_on)
212 mutex_lock(&read_buffer_mutex); 208 mutex_lock(&read_buffer_mutex);
213 else 209 else
214 mutex_unlock(&read_buffer_mutex); 210 mutex_unlock(&read_buffer_mutex);
215#if CONFIG_CPU == SH7034
216 /* DMA must not interrupt during buffer move or commit_buffer copies
217 * from inconsistent buflib buffer */
218 if (sync_on)
219 CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */
220 else
221 CHCR3 |= 0x0001; /* re-enable the DMA */
222#endif
223} 211}
224 212
225static ssize_t read_to_handle_ex(int fd, struct buflib_context *ctx, int handle, 213static ssize_t read_to_handle_ex(int fd, struct buflib_context *ctx, int handle,
@@ -781,9 +769,6 @@ void talk_force_shutup(void)
781 if (QUEUE_LEVEL == 0) /* has ended anyway */ 769 if (QUEUE_LEVEL == 0) /* has ended anyway */
782 return; 770 return;
783 771
784#if CONFIG_CPU == SH7034
785 CHCR3 &= ~0x0001; /* disable the DMA (and therefore the interrupt also) */
786#endif /* CONFIG_CPU == SH7034 */
787 /* search next frame boundary and continue up to there */ 772 /* search next frame boundary and continue up to there */
788 pos = search = mp3_get_pos(); 773 pos = search = mp3_get_pos();
789 end = buflib_get_data(&clip_ctx, queue[queue_read].handle); 774 end = buflib_get_data(&clip_ctx, queue[queue_read].handle);
@@ -814,10 +799,6 @@ void talk_force_shutup(void)
814 queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */ 799 queue_write = (queue_read + 1) & QUEUE_MASK; /* will be empty after next callback */
815 queue[queue_read].length = sent; /* current one ends after this */ 800 queue[queue_read].length = sent; /* current one ends after this */
816 801
817#if CONFIG_CPU == SH7034
818 DTCR3 = sent; /* let the DMA finish this frame */
819 CHCR3 |= 0x0001; /* re-enable DMA */
820#endif /* CONFIG_CPU == SH7034 */
821 thumbnail_buf_used = 0; 802 thumbnail_buf_used = 0;
822 return; 803 return;
823 } 804 }
@@ -854,10 +835,6 @@ static void queue_clip(struct queue_entry *clip, bool enqueue)
854 835
855 if (!clip->length) 836 if (!clip->length)
856 return; /* safety check */ 837 return; /* safety check */
857#if CONFIG_CPU == SH7034
858 /* disable the DMA temporarily, to be safe of race condition */
859 CHCR3 &= ~0x0001;
860#endif
861 talk_queue_lock(); 838 talk_queue_lock();
862 queue_level = QUEUE_LEVEL; /* check old level */ 839 queue_level = QUEUE_LEVEL; /* check old level */
863 qe = &queue[queue_write]; 840 qe = &queue[queue_write];
@@ -880,12 +857,6 @@ static void queue_clip(struct queue_entry *clip, bool enqueue)
880 curr_hd[2] = commit_buffer[3]; 857 curr_hd[2] = commit_buffer[3];
881 mp3_play_pause(true); /* kickoff audio */ 858 mp3_play_pause(true); /* kickoff audio */
882 } 859 }
883 else
884 {
885#if CONFIG_CPU == SH7034
886 CHCR3 |= 0x0001; /* re-enable DMA */
887#endif
888 }
889 860
890 need_shutup = true; 861 need_shutup = true;
891 862
diff --git a/apps/tree.c b/apps/tree.c
index 8635f98011..9b6ce06af0 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -71,7 +71,6 @@
71/* gui api */ 71/* gui api */
72#include "list.h" 72#include "list.h"
73#include "splash.h" 73#include "splash.h"
74#include "buttonbar.h"
75#include "quickscreen.h" 74#include "quickscreen.h"
76#include "appevents.h" 75#include "appevents.h"
77 76
@@ -84,9 +83,6 @@ struct gui_synclist tree_lists;
84 83
85/* I put it here because other files doesn't use it yet, 84/* I put it here because other files doesn't use it yet,
86 * but should be elsewhere since it will be used mostly everywhere */ 85 * but should be elsewhere since it will be used mostly everywhere */
87#ifdef HAVE_BUTTONBAR
88static struct gui_buttonbar tree_buttonbar;
89#endif
90static struct tree_context tc; 86static struct tree_context tc;
91 87
92char lastfile[MAX_PATH]; 88char lastfile[MAX_PATH];
@@ -307,11 +303,6 @@ void tree_gui_init(void)
307 FOR_NB_SCREENS(i) 303 FOR_NB_SCREENS(i)
308 screens[i].double_height(false); 304 screens[i].double_height(false);
309#endif 305#endif
310#ifdef HAVE_BUTTONBAR
311 gui_buttonbar_init(&tree_buttonbar);
312 /* since archos only have one screen, no need to create more than that */
313 gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) );
314#endif
315 gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL); 306 gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL);
316 gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb); 307 gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb);
317 gui_synclist_set_icon_callback(&tree_lists, 308 gui_synclist_set_icon_callback(&tree_lists,
@@ -464,7 +455,7 @@ static int update_dir(void)
464 } 455 }
465#endif 456#endif
466 } 457 }
467 458
468 gui_synclist_set_nb_items(&tree_lists, tc.filesindir); 459 gui_synclist_set_nb_items(&tree_lists, tc.filesindir);
469 gui_synclist_set_icon_callback(&tree_lists, 460 gui_synclist_set_icon_callback(&tree_lists,
470 global_settings.show_icons?tree_get_fileicon:NULL); 461 global_settings.show_icons?tree_get_fileicon:NULL);
@@ -472,17 +463,6 @@ static int update_dir(void)
472 tc.selected_item=tc.filesindir-1; 463 tc.selected_item=tc.filesindir-1;
473 464
474 gui_synclist_select_item(&tree_lists, tc.selected_item); 465 gui_synclist_select_item(&tree_lists, tc.selected_item);
475#ifdef HAVE_BUTTONBAR
476 if (global_settings.buttonbar) {
477 if (*tc.dirfilter < NUM_FILTER_MODES)
478 gui_buttonbar_set(&tree_buttonbar, str(LANG_SYSFONT_DIRBROWSE_F1),
479 str(LANG_SYSFONT_DIRBROWSE_F2),
480 str(LANG_SYSFONT_DIRBROWSE_F3));
481 else
482 gui_buttonbar_set(&tree_buttonbar, "<<<", "", "");
483 gui_buttonbar_draw(&tree_buttonbar);
484 }
485#endif
486 gui_synclist_draw(&tree_lists); 466 gui_synclist_draw(&tree_lists);
487 gui_synclist_speak_item(&tree_lists); 467 gui_synclist_speak_item(&tree_lists);
488 return tc.filesindir; 468 return tc.filesindir;
diff --git a/bootloader/Makefile b/bootloader/Makefile
index 07f347ee16..3e606cdc68 100644
--- a/bootloader/Makefile
+++ b/bootloader/Makefile
@@ -78,7 +78,7 @@ $(MAXOUTFILE):
78 78
79build-bitmapsmono: 79build-bitmapsmono:
80 $(call PRINTS,MAKE in bitmaps/mono)$(MAKE) -C ../apps/bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono 80 $(call PRINTS,MAKE in bitmaps/mono)$(MAKE) -C ../apps/bitmaps/mono OBJDIR=$(OBJDIR)/bitmaps/mono
81 81
82build-bitmapsnative: 82build-bitmapsnative:
83 $(call PRINTS,MAKE in bitmaps/native)$(MAKE) -C ../apps/bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native 83 $(call PRINTS,MAKE in bitmaps/native)$(MAKE) -C ../apps/bitmaps/native OBJDIR=$(OBJDIR)/bitmaps/native
84 84
@@ -96,16 +96,13 @@ $(OBJDIR)/bootloader.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX) $(BITMAP
96$(OBJDIR)/bootloader.bin : $(OBJDIR)/bootloader.elf 96$(OBJDIR)/bootloader.bin : $(OBJDIR)/bootloader.elf
97 $(call PRINTS,OBJCOPY $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@ 97 $(call PRINTS,OBJCOPY $(@F))$(OC) $(if $(filter yes, $(USE_ELF)), -S -x, -O binary) $< $@
98 98
99$(OBJDIR)/bootloader.asm: $(OBJDIR)/bootloader.bin
100 $(TOOLSDIR)/sh2d -sh1 $< > $@
101
102$(BUILDDIR)/$(BINARY) : $(OBJDIR)/bootloader.bin 99$(BUILDDIR)/$(BINARY) : $(OBJDIR)/bootloader.bin
103 $(call PRINTS,Build bootloader file)$(MKFIRMWARE) $< $@ 100 $(call PRINTS,Build bootloader file)$(MKFIRMWARE) $< $@
104 101
105include $(TOOLSDIR)/make.inc 102include $(TOOLSDIR)/make.inc
106 103
107clean: 104clean:
108 $(call PRINTS,cleaning bootloader)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/bootloader.asm \ 105 $(call PRINTS,cleaning bootloader)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) \
109 $(OBJDIR)/bootloader.bin $(OBJDIR)/bootloader.elf $(OBJDIR)/*.map \ 106 $(OBJDIR)/bootloader.bin $(OBJDIR)/bootloader.elf $(OBJDIR)/*.map \
110 $(LINKFILE) $(MAXOUTFILE) $(DEPFILE) 107 $(LINKFILE) $(MAXOUTFILE) $(DEPFILE)
111 $(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono 108 $(SILENT)$(MAKE) -C bitmaps/mono clean OBJDIR=$(OBJDIR)/bitmaps/mono
diff --git a/bootloader/bootloader.make b/bootloader/bootloader.make
index d1f580a52e..75ad082f84 100644
--- a/bootloader/bootloader.make
+++ b/bootloader/bootloader.make
@@ -32,9 +32,5 @@ $(BUILDDIR)/bootloader.elf: $$(OBJ) $(FIRMLIB) $(CORE_LIBS) $$(BOOTLINK)
32$(BUILDDIR)/bootloader.bin : $(BUILDDIR)/bootloader.elf 32$(BUILDDIR)/bootloader.bin : $(BUILDDIR)/bootloader.elf
33 $(call PRINTS,OC $(@F))$(call objcopy,$<,$@) 33 $(call PRINTS,OC $(@F))$(call objcopy,$<,$@)
34 34
35$(BUILDDIR)/bootloader.asm: $(BUILDDIR)/bootloader.bin
36 $(TOOLSDIR)/sh2d -sh1 $< > $@
37
38$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/bootloader.bin 35$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/bootloader.bin
39 $(call PRINTS,Build bootloader file)$(MKFIRMWARE) $< $@ 36 $(call PRINTS,Build bootloader file)$(MKFIRMWARE) $< $@
40
diff --git a/docs/MAINTAINERS b/docs/MAINTAINERS
index 4928bb5a85..52ac7fb0db 100644
--- a/docs/MAINTAINERS
+++ b/docs/MAINTAINERS
@@ -25,13 +25,6 @@ NOTE: Port maintainers are simply developers who use a particular
25target on a daily basis and are therefore able to report issues 25target on a daily basis and are therefore able to report issues
26specific to that target. 26specific to that target.
27 27
28:Archos Player/Studio: Jens Arnold
29:Archos Recorder v1: Jens Arnold
30:Archos Recorder 8MB:
31:Archos FM Recorder: Linus Nielsen Feltzing
32:Archos Recorder v2: Linus Nielsen Feltzing
33:Archos Ondio FM: Jens Arnold, Marianne Arnold
34:Archos Ondio SP:
35:Creative Zen Vision: 28:Creative Zen Vision:
36:Creative Zen Vision:M: Maurus Cuelenaere 29:Creative Zen Vision:M: Maurus Cuelenaere
37:Creative Zen Vision:M 60GB: 30:Creative Zen Vision:M 60GB:
@@ -299,7 +292,6 @@ Build Tools
299:rdf2binary: 292:rdf2binary:
300:convbdf: Daniel Stenberg 293:convbdf: Daniel Stenberg
301:codepages: 294:codepages:
302:player_unifont:
303:uclpack: 295:uclpack:
304:wavtrim: Linus Nielsen Feltzing 296:wavtrim: Linus Nielsen Feltzing
305:voicefont: 297:voicefont:
diff --git a/docs/PLUGIN_API b/docs/PLUGIN_API
index 768342bd80..b2fb94ed7e 100644
--- a/docs/PLUGIN_API
+++ b/docs/PLUGIN_API
@@ -810,25 +810,6 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message, const
810 \return 810 \return
811 \description 811 \description
812 812
813void i2c_begin(void)
814 \group MAS communication
815 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)) && ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
816 \description
817
818void i2c_end(void)
819 \group MAS communication
820 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)) && ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
821 \description
822
823int i2c_write(int address, const unsigned char* buf, int count )
824 \group MAS communication
825 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)) && ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
826 \param address
827 \param buf
828 \param count
829 \return
830 \description
831
832void invalidate_icache(void) 813void invalidate_icache(void)
833 \conditions (defined(CACHE_FUNCTIONS_AS_CALL)) 814 \conditions (defined(CACHE_FUNCTIONS_AS_CALL))
834 \description 815 \description
@@ -1433,56 +1414,6 @@ const unsigned long *rec_freq_sampr
1433 \return 1414 \return
1434 \description 1415 \description
1435 1416
1436int mas_codec_readreg(int reg)
1437 \group MAS communication
1438 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)) && ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
1439 \param reg
1440 \return
1441 \description
1442
1443int mas_codec_writereg(int reg, unsigned int val)
1444 \group MAS communication
1445 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)) && ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
1446 \param reg
1447 \param val
1448 \return
1449 \description
1450
1451int mas_readmem(int bank, int addr, unsigned long* dest, int len)
1452 \group MAS communication
1453 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC))
1454 \param bank
1455 \param addr
1456 \param dest
1457 \param len
1458 \return
1459 \description
1460
1461int mas_readreg(int reg)
1462 \group MAS communication
1463 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC))
1464 \param reg
1465 \return
1466 \description
1467
1468int mas_writemem(int bank, int addr, const unsigned long* src, int len)
1469 \group MAS communication
1470 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC))
1471 \param bank
1472 \param addr
1473 \param src
1474 \param len
1475 \return
1476 \description
1477
1478int mas_writereg(int reg, unsigned int val)
1479 \group MAS communication
1480 \conditions (!defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC))
1481 \param reg
1482 \param val
1483 \return
1484 \description
1485
1486void *memchr(const void *s1, int c, size_t n) 1417void *memchr(const void *s1, int c, size_t n)
1487 \group strings and memory 1418 \group strings and memory
1488 \param s1 1419 \param s1
@@ -1709,23 +1640,6 @@ void pcm_stop_recording(void)
1709 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING)) 1640 \conditions (CONFIG_CODEC == SWCODEC) && (defined(HAVE_RECORDING))
1710 \description 1641 \description
1711 1642
1712bool peak_meter_get_use_dbfs(void)
1713 \conditions ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
1714 \return 1 if the meter currently is displaying dBfs values, 0 if the meter is displaying percent values
1715 \description
1716
1717unsigned short peak_meter_scale_value(unsigned short val, int meterwidth)
1718 \conditions ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
1719 \param val is the volume value (range: 0 <= val < MAX_PEAK)
1720 \param meterwidth is the width of the meter in pixel
1721 \return a value between 0 and meterwidth
1722 \description Scales a peak value as read from the MAS to the range of =meterwidth=. The scaling is performed according to the scaling method (dBfs / linear) and the range (peak_meter_range_min .. peak_meter_range_max).
1723
1724void peak_meter_set_use_dbfs(bool use)
1725 \conditions ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))
1726 \param use If =use= is 0 use linear percent scale, else use dBfs
1727 \description Specifies whether the values displayed are scaled as dBfs or as linear percent values
1728
1729int playlist_amount(void) 1643int playlist_amount(void)
1730 \group playback control 1644 \group playback control
1731 \return the number of tracks in current playlist 1645 \return the number of tracks in current playlist
@@ -2208,7 +2122,7 @@ void sound_set(int setting, int value)
2208 2122
2209void sound_set_pitch(int pitch) 2123void sound_set_pitch(int pitch)
2210 \group playback control 2124 \group playback control
2211 \conditions ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || (CONFIG_CODEC == SWCODEC)) 2125 \conditions (CONFIG_CODEC == SWCODEC)
2212 \param pitch 2126 \param pitch
2213 \description 2127 \description
2214 2128
diff --git a/docs/TECH b/docs/TECH
deleted file mode 100644
index 9ae71eec15..0000000000
--- a/docs/TECH
+++ /dev/null
@@ -1,203 +0,0 @@
1 Rockbox From A Technical Angle
2 ==============================
3
4Background
5
6 [Most, if not all, of this document is completely outdated. You should rather
7 hunt down this info in the Rockbox wiki or source code!]
8
9 Björn Stenberg started this venture back in the late year 2001. The first
10 Rockbox code was committed to CVS end of March 2002. Rockbox 1.0 was
11 released in June.
12
13Booting and (De)Scrambling
14
15 The built-in firmware in the Archos Jukebox reads a file from disk into
16 memory, descrambles it, verifies the checksum and then runs it as code. When
17 we build Rockbox images, we scramble the result file to use the same kind of
18 scrambling that the original Archos firmware uses so that it can be loaded
19 by the built-in firmware.
20
21 1) The built-in firmware starts
22 2) It looks in the root directory for a file called "archos.mod" (player)
23 or "ajbrec.ajz" (recorder)
24 3) If it finds one, it loads the file, descrambles it and runs it
25
26CPU
27
28 The CPU in use is a SH7034 from Hitachi, running at 11.0592MHz (recorder)
29 or 12MHz (player).
30 Most single instructions are executed in 1 cycle. There is a 4KB internal RAM
31 and a 2MB external RAM.
32
33Memory Usage
34
35 All Archos Jukebox models have only 2MB RAM. The RAM is used for everything,
36 including code, graphics and config. To be able to play as long as possible
37 without having to load more data, the size of the mpeg playing buffer must
38 remain as big as possible. Also, since we need to be able to do almost
39 everything in Rockbox simultaneously, we use no dynamic memory allocation
40 system at all. All sub-parts that needs memory must allocate their needs
41 staticly. This puts a great responsibility on all coders.
42
43Playing MPEG
44
45 The MPEG decoding is performed by an external circuit, MAS3507D (for the
46 Player/Studio models) or MAS3587F (for the Recorder models).
47
48 The CPU has a serial connection to the MAS for MP3 playback, using serial
49 port 0 at approx. 1mbit/s. The MAS has a handshake signal called DEMAND,
50 that informs the CPU when it wants more MP3 data. Whenever the DEMAND
51 signal goes high, it wants data sent over the serial line, and it wants it
52 quickly, within ~1ms. When the MAS has received enough data, it negates the
53 DEMAND signal and expects the incoming data stream to stop within 1ms.
54
55 The DEMAND signal is connected to a port pin on the CPU which can generate
56 an IRQ, but only on the falling edge. That means that the mpeg driver code
57  must poll the DEMAND signal every ms to keep the MAS happy. The mpeg code
58 does use the IRQ to detect the falling edge when the MAS is "full".
59
60 Unfortunately, the serial port on the CPU sends the LSB first, and the MAS
61 expects the MSB first. Therefore we have to revers the bit order in every
62 byte in the loaded MP3 data. This is referred to as "bit swapping" in the
63 Rockbox code.
64
65 The internal DMA controller is used to feed the serial port with data. The
66 driver works roughly like this:
67
68 1) Load MP3 data into the RAM buffer
69 2) Bitswap the data
70 3) Load the DMA source pointer to the next 64Kbyte block to be transferred
71 4) Wait until DEMAND is high
72 5) Enable the DMA
73 6) Wait until the falling DEMAND pin generates an IRQ
74 7) Disable the DMA
75 8) Go to 4
76
77 The DMA generates an IRQ when the 64Kbyte block is transferred, and the
78 IRQ handler updates the DMA source pointer.
79
80
81 _____________________________
82 | |
83 DEMAND __________| |_____________
84 _ _ _ _ _ _ _ _ _
85 SC0 _____________/ \/ \/ \/ \/ \/ \/ \/ \/ \____________
86 \_/\_/\_/\_/\_/\_/\_/\_/\_/
87 ^ ^
88 | |
89 Poll sees the DEMAND The DEMAND pin generates
90 signal go high and an IRQ that in turn disables
91 enables the DMA the DMA again
92
93Spinning The Disk Up/Down
94
95 To save battery, the spinning of the harddrive must be kept at a minimum.
96 Rockbox features a timeout, so that if no action has been performed within N
97 seconds, the disk will spin-down automaticly. However, if the disk was used
98 for mpeg-loading for music playback, the spin-down will be almost immediate
99 as then there's no point in timing out. The N second timer is thus only used
100 when the disk-activity is trigged by a user.
101
102FAT and Mounting
103
104 Rockbox scans the partitions of the disk and tries to mount them as fat32
105 filesystems at boot.
106
107Directory Buffer
108
109 When using the "dir browser" in Rockbox to display a single directory, it
110 loads all entries in the directory into memory first, then sorts them and
111 presents them on screen. The buffer used for all file entries is limited to
112 maximum 16K or 400 entries. If the file names are longish, the 16K will run
113 out before 400 entries have been used.
114
115 This rather limited buffer size is of course again related to the necessity
116 to keep the footprint small to keep the mpeg buffer as large as possible.
117
118Playlist Concepts
119
120 One of the most obvious limitations in the firmware Rockbox tries to
121 outperform, was the way playlists were dealt with.
122
123 When loading a playlist (which is a plain text file with file names
124 separated by newlines), Rockbox will scan through the file and store indexes
125 to all file names in an array. The array itself has a 10000-entry limit (for
126 memory size reasons).
127
128 To play a specific song from the playlist, Rockbox checks the index and then
129 seeks to that position in the original file on disk and gets the file name
130 from there. This way, very little memory is wasted and yet very large
131 playlists are supported.
132
133Playing a Directory
134
135 Playing a full directory is using the same technique as with playlists. The
136 difference is that the playlist is not a file on disk, but is the directory
137 buffer.
138
139Shuffle
140
141 Since the playlist is a an array of indexes to where to read the file name,
142 shuffle modifies the order of these indexes in the array. The algorithm is
143 pretty much like shuffling a deck of cards, and it uses a pseudo random
144 generator called the Mersenne Twister. The randomness is identical for the
145 same random seed. This is the secret to good resume. Even when you've shut
146 down your unit and re-starts it, using the same random seed as the previous
147 time will give exactly the same random order.
148
149Saving Config Data
150
151 The Player/Studio models have no battery-backuped memory while the Recorder
152 models have 44 bytes battery-backuped.
153
154 To save data to be persistent and around even after reboots, Rockbox uses
155 harddisk sector 63, which is outside the FAT32 filesystem. (Recorder models
156 also get some data stored in the battery-backuped area).
157
158 The config is only saved when the disk is spinning. This is important to
159 realize, as if you change a config setting and then immediately shuts your
160 unit down, the new config is not saved.
161
162 DEVELOPERS:
163 The config checksum includes a header with a version number. This version
164 number must be increased when the config structure becomes incompatible.
165 This makes the checksum check fail, and the settings are reset to default
166 values.
167
168Resume Explained
169
170 ...
171
172Charging
173
174 (Charging concerns Recorder models only, the other models have hardware-
175 controlled charging that Rockbox can't affect.)
176
177 ...
178
179Profiling
180
181 Rockbox contains a profiling system which can be used to monitor call count
182 and time in function for a specific set of functions on a single thread.
183
184 To use this functionality:
185 1) Configure a developer build with profiling support.
186 2) Make sure that the functions of interest will be compiled with the
187 PROFILE_OPTS added to their CFLAGS
188 3) On the same thread as these functions will be run, surround the relevent
189 running time with calls to profile_thread and profstop. (For codecs,
190 this can be done in the codec.c file for example)
191 4) Compile and run the code on the target, after the section to be profiled
192 exits (when profstop is called) a profile.out file will be written to
193 the player's root.
194 5) Use the tools/profile_reader/profile_reader.pl script to convert the
195 profile.out into a human readable format. This script requires the
196 relevent map files and object (or library) files created in the build.
197 (ex: ./profile_reader.pl profile.out m68k-elf-objdump vorbis.map libtremor.a 0)
198
199 There is also a profile_comparator.pl script which can compare two profile
200 runs as output by the above script to show percent change from optimization
201
202 profile_reader.pl requires a recent binutils that can automatically handle
203 target object files, or objdump in path to be the target-objdump.
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 5caed4647b..90c1f4011c 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -39,9 +39,9 @@ profile.c
39#if !defined(RKW_FORMAT) && !defined(MI4_FORMAT) && defined(MODEL_NUMBER) 39#if !defined(RKW_FORMAT) && !defined(MI4_FORMAT) && defined(MODEL_NUMBER)
40common/rb-loader.c 40common/rb-loader.c
41#endif 41#endif
42#if !defined(BOOTLOADER) || defined(CPU_SH) 42#if !defined(BOOTLOADER)
43rolo.c 43rolo.c
44#endif /* !defined(BOOTLOADER) || defined(CPU_SH) */ 44#endif /* !defined(BOOTLOADER) */
45timer.c 45timer.c
46debug.c 46debug.c
47#endif /* PLATFORM_NATIVE */ 47#endif /* PLATFORM_NATIVE */
@@ -361,9 +361,7 @@ eeprom_settings.c
361 361
362/* RTC */ 362/* RTC */
363#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 363#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
364#if (CONFIG_RTC == RTC_M41ST84W) 364#if (CONFIG_RTC == RTC_PCF50606)
365drivers/rtc/rtc_m41st84w.c
366#elif (CONFIG_RTC == RTC_PCF50606)
367drivers/rtc/rtc_pcf50606.c 365drivers/rtc/rtc_pcf50606.c
368#elif (CONFIG_RTC == RTC_PCF50605) 366#elif (CONFIG_RTC == RTC_PCF50605)
369drivers/rtc/rtc_pcf50605.c 367drivers/rtc/rtc_pcf50605.c
@@ -406,10 +404,6 @@ tuner.c
406#if (CONFIG_TUNER & LV24020LP) 404#if (CONFIG_TUNER & LV24020LP)
407drivers/tuner/lv24020lp.c 405drivers/tuner/lv24020lp.c
408#endif /* (CONFIG_TUNER & LV24020LP) */ 406#endif /* (CONFIG_TUNER & LV24020LP) */
409#if (CONFIG_TUNER & S1A0903X01)
410drivers/fmradio.c
411drivers/tuner/s1a0903x01.c
412#endif /* (CONFIG_TUNER & S1A0903X01) */
413#if (CONFIG_TUNER & TEA5760) 407#if (CONFIG_TUNER & TEA5760)
414drivers/tuner/tea5760uk.c 408drivers/tuner/tea5760uk.c
415#endif 409#endif
@@ -480,8 +474,6 @@ drivers/audio/wm8731.c
480drivers/audio/as3514.c 474drivers/audio/as3514.c
481#elif defined(HAVE_TLV320) 475#elif defined(HAVE_TLV320)
482drivers/audio/tlv320.c 476drivers/audio/tlv320.c
483#elif defined(HAVE_MAS35XX)
484drivers/audio/mas35xx.c
485#elif defined(HAVE_AK4537) 477#elif defined(HAVE_AK4537)
486drivers/audio/ak4537.c 478drivers/audio/ak4537.c
487#elif defined(HAVE_UDA1341) 479#elif defined(HAVE_UDA1341)
@@ -531,18 +523,7 @@ target/hosted/sdl/pcm-sdl.c
531#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */ 523#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */
532 524
533/* CPU Specific - By class then particular chip if applicable */ 525/* CPU Specific - By class then particular chip if applicable */
534#if defined(CPU_SH) 526#if defined(CPU_COLDFIRE)
535
536target/sh/adc-sh.c
537target/sh/bitswap.S
538target/sh/crt0.S
539target/sh/kernel-sh.c
540target/sh/system-sh.c
541target/sh/archos/descramble.S
542target/sh/archos/i2c-archos.c
543target/sh/debug-sh.c
544
545#elif defined(CPU_COLDFIRE)
546 527
547target/coldfire/crt0.S 528target/coldfire/crt0.S
548target/coldfire/kernel-coldfire.c 529target/coldfire/kernel-coldfire.c
@@ -786,16 +767,8 @@ drivers/i2c.c
786/* LCD driver */ 767/* LCD driver */
787#if CONFIG_LCD == LCD_SSD1303 768#if CONFIG_LCD == LCD_SSD1303
788target/arm/as3525/lcd-ssd1303.c 769target/arm/as3525/lcd-ssd1303.c
789#elif CONFIG_LCD == LCD_SSD1801
790target/sh/archos/player/lcd-as-player.S
791target/sh/archos/player/lcd-player.c
792#elif CONFIG_LCD == LCD_SSD1815 770#elif CONFIG_LCD == LCD_SSD1815
793# if CONFIG_CPU == SH7034
794target/sh/archos/lcd-archos-bitmap.c
795target/sh/archos/lcd-as-archos-bitmap.S
796# else
797target/arm/lcd-ssd1815.c 771target/arm/lcd-ssd1815.c
798# endif
799#elif CONFIG_LCD == LCD_HX8340B 772#elif CONFIG_LCD == LCD_HX8340B
800target/arm/rk27xx/lcd-hifiman.c 773target/arm/rk27xx/lcd-hifiman.c
801#elif CONFIG_LCD == LCD_C200 774#elif CONFIG_LCD == LCD_C200
@@ -907,19 +880,6 @@ target/arm/tcc77x/adc-tcc77x.c
907 880
908#endif /* CONFIG_I2C */ 881#endif /* CONFIG_I2C */
909 882
910#ifdef CPU_SH
911target/sh/archos/mascodec-archos.c
912target/sh/archos/audio-archos.c
913target/sh/archos/timer-archos.c
914# if CONFIG_STORAGE & STORAGE_ATA
915target/sh/archos/ata-archos.c
916target/sh/archos/ata-as-archos.S
917# endif
918# ifdef HAVE_SERIAL
919target/sh/archos/uart-archos.c
920# endif
921#endif
922
923#ifdef CPU_TCC77X 883#ifdef CPU_TCC77X
924target/arm/usb-tcc.c 884target/arm/usb-tcc.c
925target/arm/tcc77x/kernel-tcc77x.c 885target/arm/tcc77x/kernel-tcc77x.c
@@ -958,39 +918,6 @@ target/arm/s3c2440/gigabeat-fx/timer-meg-fx.c
958# endif 918# endif
959#endif /* CONFIG_CPU == S3C2440 */ 919#endif /* CONFIG_CPU == S3C2440 */
960 920
961#ifdef ARCHOS_PLAYER
962target/sh/archos/player/button-player.c
963target/sh/archos/player/hwcompat-player.c
964target/sh/archos/player/power-player.c
965target/sh/archos/player/powermgmt-player.c
966target/sh/archos/player/usb-player.c
967#endif /* ARCHOS_PLAYER */
968
969#ifdef ARCHOS_RECORDER
970target/sh/archos/recorder/button-recorder.c
971target/sh/archos/recorder/power-recorder.c
972target/sh/archos/recorder/powermgmt-recorder.c
973target/sh/archos/recorder/usb-recorder.c
974#endif /* ARCHOS_RECORDER */
975
976#if defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
977target/sh/archos/fm_v2/button-fm_v2.c
978target/sh/archos/fm_v2/power-fm_v2.c
979target/sh/archos/fm_v2/powermgmt-fm_v2.c
980target/sh/archos/fm_v2/usb-fm_v2.c
981#endif /* ARCHOS_FMRECORDER || ARCHOS_RECORDERV2 */
982
983#if defined(ARCHOS_ONDIOFM) || defined(ARCHOS_ONDIOSP)
984target/sh/archos/ondio/button-ondio.c
985target/sh/archos/ondio/power-ondio.c
986target/sh/archos/ondio/powermgmt-ondio.c
987target/sh/archos/ondio/usb-ondio.c
988target/sh/archos/ondio/ata_mmc.c
989#if (CONFIG_TUNER & TEA5767)
990target/sh/archos/ondio/fmradio_i2c-ondio.c
991#endif
992#endif /* ARCHOS_ONDIOFM || ARCHOS_ONDIOFM */
993
994#if defined(SANSA_E200) || defined(SANSA_C200) 921#if defined(SANSA_E200) || defined(SANSA_C200)
995target/arm/sandisk/backlight-c200_e200.c 922target/arm/sandisk/backlight-c200_e200.c
996target/arm/sandisk/power-c200_e200.c 923target/arm/sandisk/power-c200_e200.c
diff --git a/firmware/asm/sh/memcpy.S b/firmware/asm/sh/memcpy.S
deleted file mode 100644
index 3d623c48cd..0000000000
--- a/firmware/asm/sh/memcpy.S
+++ /dev/null
@@ -1,227 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004-2005 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22
23 .section .icode,"ax",@progbits
24
25 .align 2
26 .global _memcpy
27 .global _mempcpy
28 .global ___memcpy_fwd_entry
29 .type _memcpy,@function
30 .type _mempcpy,@function
31
32/* Copies <length> bytes of data in memory from <source> to <dest>
33 * This version is optimized for speed
34 *
35 * arguments:
36 * r4 - destination address
37 * r5 - source address
38 * r6 - length
39 *
40 * return value:
41 * r0 - destination address (like ANSI version)
42 *
43 * register usage:
44 * r0 - data / scratch
45 * r1 - 2nd data / scratch
46 * r2 - scratch
47 * r3 - first long bound / adjusted end address (only if >= 11 bytes)
48 * r4 - current dest address
49 * r5 - current source address
50 * r6 - source end address
51 * r7 - stored dest start address
52 *
53 * The instruction order is devised in a way to utilize the pipelining
54 * of the SH1 to the max. The routine also tries to utilize fast page mode.
55 */
56_mempcpy:
57 mov r4,r7 /* store dest + length for returning */
58 bra ___memcpy_fwd_entry
59 add r6,r7
60
61_memcpy:
62 mov r4,r7 /* store dest for returning */
63___memcpy_fwd_entry:
64 add #-8,r4 /* offset for early increment (max. 2 longs) */
65 mov #11,r0
66 cmp/hs r0,r6 /* at least 11 bytes to copy? (ensures 2 aligned longs) */
67 add r5,r6 /* r6 = source_end */
68 bf .start_b2 /* no: jump directly to byte loop */
69
70 mov #3,r0
71 neg r5,r3
72 and r0,r3 /* r3 = (4 - align_offset) % 4 */
73 tst r3,r3 /* already aligned? */
74 bt .end_b1 /* yes: skip leading byte loop */
75
76 add r5,r3 /* r3 = first source long bound */
77
78 /* leading byte loop: copies 0..3 bytes */
79.loop_b1:
80 mov.b @r5+,r0 /* load byte & increment source addr */
81 add #1,r4 /* increment dest addr */
82 mov.b r0,@(7,r4) /* store byte */
83 cmp/hi r5,r3 /* runs r5 up to first long bound */
84 bt .loop_b1
85 /* now r5 is always at a long boundary */
86 /* -> memory reading is done in longs for all dest alignments */
87
88 /* selector for main copy loop */
89.end_b1:
90 mov #3,r1
91 and r4,r1 /* r1 = dest alignment offset */
92 mova .jmptab,r0
93 mov.b @(r0,r1),r1 /* select appropriate main loop */
94 add r0,r1
95 mov r6,r3 /* move end address to r3 */
96 jmp @r1 /* and jump to it */
97 add #-7,r3 /* adjust end addr for main loops doing 2 longs/pass */
98
99 /** main loops, copying 2 longs per pass to profit from fast page mode **/
100
101 /* long aligned destination (fastest) */
102 .align 2
103.loop_do0:
104 mov.l @r5+,r1 /* load first long & increment source addr */
105 add #16,r4 /* increment dest addr & account for decrementing stores */
106 mov.l @r5+,r0 /* load second long & increment source addr */
107 cmp/hi r5,r3 /* runs r5 up to last or second last long bound */
108 mov.l r0,@-r4 /* store second long */
109 mov.l r1,@-r4 /* store first long; NOT ALIGNED - no speed loss here! */
110 bt .loop_do0
111
112 add #4,r3 /* readjust end address */
113 cmp/hi r5,r3 /* one long left? */
114 bf .start_b2 /* no, jump to trailing byte loop */
115
116 mov.l @r5+,r0 /* load last long & increment source addr */
117 add #4,r4 /* increment dest addr */
118 bra .start_b2 /* jump to trailing byte loop */
119 mov.l r0,@(4,r4) /* store last long */
120
121 /* word aligned destination (long + 2) */
122 .align 2
123.loop_do2:
124 mov.l @r5+,r1 /* load first long & increment source addr */
125 add #16,r4 /* increment dest addr */
126 mov.l @r5+,r0 /* load second long & increment source addr */
127 cmp/hi r5,r3 /* runs r5 up to last or second last long bound */
128 mov.w r0,@-r4 /* store low word of second long */
129 xtrct r1,r0 /* extract low word of first long & high word of second long */
130 mov.l r0,@-r4 /* and store as long */
131 swap.w r1,r0 /* get high word of first long */
132 mov.w r0,@-r4 /* and store it */
133 bt .loop_do2
134
135 add #4,r3 /* readjust end address */
136 cmp/hi r5,r3 /* one long left? */
137 bf .start_b2 /* no, jump to trailing byte loop */
138
139 mov.l @r5+,r0 /* load last long & increment source addr */
140 add #4,r4 /* increment dest addr */
141 mov.w r0,@(6,r4) /* store low word */
142 shlr16 r0 /* get high word */
143 bra .start_b2 /* jump to trailing byte loop */
144 mov.w r0,@(4,r4) /* and store it */
145
146 /* jumptable for loop selector */
147 .align 2
148.jmptab:
149 .byte .loop_do0 - .jmptab /* placed in the middle because the SH1 */
150 .byte .loop_do1 - .jmptab /* loads bytes sign-extended. Otherwise */
151 .byte .loop_do2 - .jmptab /* the last loop would be out of reach */
152 .byte .loop_do3 - .jmptab /* of the offset range. */
153
154 /* byte aligned destination (long + 1) */
155 .align 2
156.loop_do1:
157 mov.l @r5+,r1 /* load first long & increment source addr */
158 add #16,r4 /* increment dest addr */
159 mov.l @r5+,r0 /* load second long & increment source addr */
160 cmp/hi r5,r3 /* runs r5 up to last or second last long bound */
161 mov.b r0,@-r4 /* store low byte of second long */
162 shlr8 r0 /* get upper 3 bytes */
163 mov r1,r2 /* copy first long */
164 shll16 r2 /* move low byte of first long all the way up, .. */
165 shll8 r2
166 or r2,r0 /* ..combine with the 3 bytes of second long.. */
167 mov.l r0,@-r4 /* ..and store as long */
168 shlr8 r1 /* get middle 2 bytes */
169 mov.w r1,@-r4 /* store as word */
170 shlr16 r1 /* get upper byte */
171 mov.b r1,@-r4 /* and store */
172 bt .loop_do1
173
174 add #4,r3 /* readjust end address */
175.last_do13:
176 cmp/hi r5,r3 /* one long left? */
177 bf .start_b2 /* no, jump to trailing byte loop */
178
179 mov.l @r5+,r0 /* load last long & increment source addr */
180 add #12,r4 /* increment dest addr */
181 mov.b r0,@-r4 /* store low byte */
182 shlr8 r0 /* get middle 2 bytes */
183 mov.w r0,@-r4 /* store as word */
184 shlr16 r0 /* get upper byte */
185 mov.b r0,@-r4 /* and store */
186 bra .start_b2 /* jump to trailing byte loop */
187 add #-4,r4 /* readjust destination */
188
189 /* byte aligned destination (long + 3) */
190 .align 2
191.loop_do3:
192 mov.l @r5+,r1 /* load first long & increment source addr */
193 add #16,r4 /* increment dest addr */
194 mov.l @r5+,r0 /* load second long & increment source addr */
195 mov r1,r2 /* copy first long */
196 mov.b r0,@-r4 /* store low byte of second long */
197 shlr8 r0 /* get middle 2 bytes */
198 mov.w r0,@-r4 /* store as word */
199 shlr16 r0 /* get upper byte */
200 shll8 r2 /* move lower 3 bytes of first long one up.. */
201 or r2,r0 /* ..combine with the 1 byte of second long.. */
202 mov.l r0,@-r4 /* ..and store as long */
203 shlr16 r1 /* get upper byte of first long.. */
204 shlr8 r1
205 cmp/hi r5,r3 /* runs r5 up to last or second last long bound */
206 mov.b r1,@-r4 /* ..and store */
207 bt .loop_do3
208
209 bra .last_do13 /* handle last longword: reuse routine for (long + 1) */
210 add #4,r3 /* readjust end address */
211
212 /* trailing byte loop: copies 0..3 bytes (or all for < 11 in total) */
213 .align 2
214.loop_b2:
215 mov.b @r5+,r0 /* load byte & increment source addr */
216 add #1,r4 /* increment dest addr */
217 mov.b r0,@(7,r4) /* store byte */
218.start_b2:
219 cmp/hi r5,r6 /* runs r5 up to end address */
220 bt .loop_b2
221
222 rts
223 mov r7,r0 /* return dest start address */
224.end:
225 .size _memcpy,.end-_memcpy
226 .size _mempcpy,.end-_mempcpy
227
diff --git a/firmware/asm/sh/memmove.S b/firmware/asm/sh/memmove.S
deleted file mode 100644
index d5a7160043..0000000000
--- a/firmware/asm/sh/memmove.S
+++ /dev/null
@@ -1,222 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22
23 .section .icode,"ax",@progbits
24
25 .align 2
26 .global _memmove
27 .type _memmove,@function
28
29/* Moves <length> bytes of data in memory from <source> to <dest>
30 * Regions may overlap.
31 * This version is optimized for speed, and needs the corresponding memcpy
32 * implementation for the forward copy branch.
33 *
34 * arguments:
35 * r4 - destination address
36 * r5 - source address
37 * r6 - length
38 *
39 * return value:
40 * r0 - destination address (like ANSI version)
41 *
42 * register usage:
43 * r0 - data / scratch
44 * r1 - 2nd data / scratch
45 * r2 - scratch
46 * r3 - last long bound / adjusted start address (only if >= 11 bytes)
47 * r4 - current dest address
48 * r5 - source start address
49 * r6 - current source address
50 *
51 * The instruction order is devised in a way to utilize the pipelining
52 * of the SH1 to the max. The routine also tries to utilize fast page mode.
53 */
54
55_memmove:
56 cmp/hi r4,r5 /* source > destination */
57 bf .backward /* no: backward copy */
58 mov.l .memcpy_fwd,r0
59 jmp @r0
60 mov r4,r7 /* store dest for returning */
61
62 .align 2
63.memcpy_fwd:
64 .long ___memcpy_fwd_entry
65
66.backward:
67 add r6,r4 /* r4 = destination end */
68 mov #11,r0
69 cmp/hs r0,r6 /* at least 11 bytes to copy? (ensures 2 aligned longs) */
70 add #-8,r5 /* adjust for late decrement (max. 2 longs) */
71 add r5,r6 /* r6 = source end - 8 */
72 bf .start_b2r /* no: jump directly to byte loop */
73
74 mov #-4,r3 /* r3 = 0xfffffffc */
75 and r6,r3 /* r3 = last source long bound */
76 cmp/hi r3,r6 /* already aligned? */
77 bf .end_b1r /* yes: skip leading byte loop */
78
79.loop_b1r:
80 mov.b @(7,r6),r0 /* load byte */
81 add #-1,r6 /* decrement source addr */
82 mov.b r0,@-r4 /* store byte */
83 cmp/hi r3,r6 /* runs r6 down to last long bound */
84 bt .loop_b1r
85
86.end_b1r:
87 mov #3,r1
88 and r4,r1 /* r1 = dest alignment offset */
89 mova .jmptab_r,r0
90 mov.b @(r0,r1),r1 /* select appropriate main loop.. */
91 add r0,r1
92 mov r5,r3 /* copy start adress to r3 */
93 jmp @r1 /* ..and jump to it */
94 add #7,r3 /* adjust end addr for main loops doing 2 longs/pass */
95
96 /** main loops, copying 2 longs per pass to profit from fast page mode **/
97
98 /* long aligned destination (fastest) */
99 .align 2
100.loop_do0r:
101 mov.l @r6,r1 /* load first long */
102 add #-8,r6 /* decrement source addr */
103 mov.l @(12,r6),r0 /* load second long */
104 cmp/hi r3,r6 /* runs r6 down to first or second long bound */
105 mov.l r0,@-r4 /* store second long */
106 mov.l r1,@-r4 /* store first long; NOT ALIGNED - no speed loss here! */
107 bt .loop_do0r
108
109 add #-4,r3 /* readjust end address */
110 cmp/hi r3,r6 /* first long left? */
111 bf .start_b2r /* no, jump to trailing byte loop */
112
113 mov.l @(4,r6),r0 /* load first long */
114 add #-4,r6 /* decrement source addr */
115 bra .start_b2r /* jump to trailing byte loop */
116 mov.l r0,@-r4 /* store first long */
117
118 /* word aligned destination (long + 2) */
119 .align 2
120.loop_do2r:
121 mov.l @r6,r1 /* load first long */
122 add #-8,r6 /* decrement source addr */
123 mov.l @(12,r6),r0 /* load second long */
124 cmp/hi r3,r6 /* runs r6 down to first or second long bound */
125 mov.w r0,@-r4 /* store low word of second long */
126 xtrct r1,r0 /* extract low word of first long & high word of second long */
127 mov.l r0,@-r4 /* and store as long */
128 shlr16 r1 /* get high word of first long */
129 mov.w r1,@-r4 /* and store it */
130 bt .loop_do2r
131
132 add #-4,r3 /* readjust end address */
133 cmp/hi r3,r6 /* first long left? */
134 bf .start_b2r /* no, jump to trailing byte loop */
135
136 mov.l @(4,r6),r0 /* load first long & decrement source addr */
137 add #-4,r6 /* decrement source addr */
138 mov.w r0,@-r4 /* store low word */
139 shlr16 r0 /* get high word */
140 bra .start_b2r /* jump to trailing byte loop */
141 mov.w r0,@-r4 /* and store it */
142
143 /* jumptable for loop selector */
144 .align 2
145.jmptab_r:
146 .byte .loop_do0r - .jmptab_r /* placed in the middle because the SH1 */
147 .byte .loop_do1r - .jmptab_r /* loads bytes sign-extended. Otherwise */
148 .byte .loop_do2r - .jmptab_r /* the last loop would be out of reach */
149 .byte .loop_do3r - .jmptab_r /* of the offset range. */
150
151 /* byte aligned destination (long + 1) */
152 .align 2
153.loop_do1r:
154 mov.l @r6,r1 /* load first long */
155 add #-8,r6 /* decrement source addr */
156 mov.l @(12,r6),r0 /* load second long */
157 cmp/hi r3,r6 /* runs r6 down to first or second long bound */
158 mov.b r0,@-r4 /* store low byte of second long */
159 shlr8 r0 /* get upper 3 bytes */
160 mov r1,r2 /* copy first long */
161 shll16 r2 /* move low byte of first long all the way up, .. */
162 shll8 r2
163 or r2,r0 /* ..combine with the 3 bytes of second long.. */
164 mov.l r0,@-r4 /* ..and store as long */
165 shlr8 r1 /* get middle 2 bytes */
166 mov.w r1,@-r4 /* store as word */
167 shlr16 r1 /* get upper byte */
168 mov.b r1,@-r4 /* and store */
169 bt .loop_do1r
170
171 add #-4,r3 /* readjust end address */
172.last_do13r:
173 cmp/hi r3,r6 /* first long left? */
174 bf .start_b2r /* no, jump to trailing byte loop */
175
176 nop /* alignment */
177 mov.l @(4,r6),r0 /* load first long */
178 add #-4,r6 /* decrement source addr */
179 mov.b r0,@-r4 /* store low byte */
180 shlr8 r0 /* get middle 2 bytes */
181 mov.w r0,@-r4 /* store as word */
182 shlr16 r0 /* get upper byte */
183 bra .start_b2r /* jump to trailing byte loop */
184 mov.b r0,@-r4 /* and store */
185
186 /* byte aligned destination (long + 3) */
187 .align 2
188.loop_do3r:
189 mov.l @r6,r1 /* load first long */
190 add #-8,r6 /* decrement source addr */
191 mov.l @(12,r6),r0 /* load second long */
192 mov r1,r2 /* copy first long */
193 mov.b r0,@-r4 /* store low byte of second long */
194 shlr8 r0 /* get middle 2 bytes */
195 mov.w r0,@-r4 /* store as word */
196 shlr16 r0 /* get upper byte */
197 shll8 r2 /* move lower 3 bytes of first long one up.. */
198 or r2,r0 /* ..combine with the 1 byte of second long.. */
199 mov.l r0,@-r4 /* ..and store as long */
200 shlr16 r1 /* get upper byte of first long */
201 shlr8 r1
202 cmp/hi r3,r6 /* runs r6 down to first or second long bound */
203 mov.b r1,@-r4 /* ..and store */
204 bt .loop_do3r
205
206 bra .last_do13r /* handle first longword: reuse routine for (long + 1) */
207 add #-4,r3 /* readjust end address */
208
209 /* trailing byte loop: copies 0..3 bytes (or all for < 11 in total) */
210 .align 2
211.loop_b2r:
212 mov.b @(7,r6),r0 /* load byte */
213 add #-1,r6 /* decrement source addr */
214 mov.b r0,@-r4 /* store byte */
215.start_b2r:
216 cmp/hi r5,r6 /* runs r6 down to start address */
217 bt .loop_b2r
218
219 rts
220 mov r4,r0 /* return dest start address */
221.end:
222 .size _memmove,.end-_memmove
diff --git a/firmware/asm/sh/memset.S b/firmware/asm/sh/memset.S
deleted file mode 100644
index 8cae1ea112..0000000000
--- a/firmware/asm/sh/memset.S
+++ /dev/null
@@ -1,109 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22
23 .section .icode,"ax",@progbits
24
25 .align 2
26 .global _memset
27 .type _memset,@function
28
29/* Fills a memory region with specified byte value
30 * This version is optimized for speed
31 *
32 * arguments:
33 * r4 - start address
34 * r5 - data
35 * r6 - length
36 *
37 * return value:
38 * r0 - start address (like ANSI version)
39 *
40 * register usage:
41 * r0 - temporary
42 * r1 - start address +11 for main loop
43 * r4 - start address
44 * r5 - data (spread to all 4 bytes when using long stores)
45 * r6 - current address (runs down from end to start)
46 *
47 * The instruction order below is devised in a way to utilize the pipelining
48 * of the SH1 to the max. The routine fills memory from end to start in
49 * order to utilize the auto-decrementing store instructions.
50 */
51
52_memset:
53 neg r4,r0
54 and #3,r0 /* r0 = (4 - align_offset) % 4 */
55 add #4,r0
56 cmp/hs r0,r6 /* at least one aligned longword to fill? */
57 add r4,r6 /* r6 = end_address */
58 bf .no_longs /* no, jump directly to byte loop */
59
60 extu.b r5,r5 /* start: spread data to all 4 bytes */
61 swap.b r5,r0
62 or r0,r5 /* data now in 2 lower bytes of r5 */
63 swap.w r5,r0
64 or r0,r5 /* data now in all 4 bytes of r5 */
65
66 mov r6,r0
67 tst #3,r0 /* r0 already long aligned? */
68 bt .end_b1 /* yes: skip loop */
69
70 /* leading byte loop: sets 0..3 bytes */
71.loop_b1:
72 mov.b r5,@-r0 /* store byte */
73 tst #3,r0 /* r0 long aligned? */
74 bf .loop_b1 /* runs r0 down until long aligned */
75
76 mov r0,r6 /* r6 = last long bound */
77 nop /* keep alignment */
78
79.end_b1:
80 mov r4,r1 /* r1 = start_address... */
81 add #11,r1 /* ... + 11, combined for rounding and offset */
82 xor r1,r0
83 tst #4,r0 /* bit 2 tells whether an even or odd number of */
84 bf .loop_odd /* longwords to set */
85
86 /* main loop: set 2 longs per pass */
87.loop_2l:
88 mov.l r5,@-r6 /* store first long */
89.loop_odd:
90 cmp/hi r1,r6 /* runs r6 down to first long bound */
91 mov.l r5,@-r6 /* store second long */
92 bt .loop_2l
93
94.no_longs:
95 cmp/hi r4,r6 /* any bytes left? */
96 bf .end_b2 /* no: skip loop */
97
98 /* trailing byte loop */
99.loop_b2:
100 mov.b r5,@-r6 /* store byte */
101 cmp/hi r4,r6 /* runs r6 down to the start address */
102 bt .loop_b2
103
104.end_b2:
105 rts
106 mov r4,r0 /* return start address */
107
108.end:
109 .size _memset,.end-_memset
diff --git a/firmware/asm/sh/strlen.S b/firmware/asm/sh/strlen.S
deleted file mode 100644
index e7169e25db..0000000000
--- a/firmware/asm/sh/strlen.S
+++ /dev/null
@@ -1,96 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22
23 .section .icode,"ax",@progbits
24
25 .align 2
26 .global _strlen
27 .type _strlen,@function
28
29/* Works out the length of a string
30 * This version is optimized for speed
31 *
32 * arguments:
33 * r4 - start address
34 *
35 * return value:
36 * r0 - string length
37 *
38 * register usage:
39 * r0 - current address
40 * r1 - current value (byte/long)
41 * r2 - mask for alignment / zero (for cmp/str)
42 * r4 - start address
43 *
44 */
45
46_strlen:
47 mov r4,r0 /* r0 = start address */
48 tst #3,r0 /* long aligned? */
49 bt .start_l /* yes, jump directly to the longword loop */
50
51 /* not long aligned: check the first 3 bytes */
52 mov.b @r0+,r1 /* fetch first byte */
53 tst r1,r1 /* byte == 0 ? */
54 bt .hitzero /* yes, string end found */
55 mov.b @r0+,r1 /* fetch second byte */
56 mov #3,r2 /* prepare mask: r2 = 0..00000011b */
57 tst r1,r1 /* byte == 0 ? */
58 bt .hitzero /* yes, string end found */
59 mov.b @r0+,r1 /* fetch third byte */
60 not r2,r2 /* prepare mask: r2 = 1..11111100b */
61 tst r1,r1 /* byte == 0 ? */
62 bt .hitzero /* yes, string end found */
63
64 /* not yet found, fall through into longword loop */
65 and r2,r0 /* align down to long bound */
66
67 /* main loop: check longwords */
68.start_l:
69 mov #0,r2 /* zero longword for cmp/str */
70.loop_l:
71 mov.l @r0+,r1 /* fetch long word */
72 cmp/str r1,r2 /* any zero byte within? */
73 bf .loop_l /* no, loop */
74 add #-4,r0 /* set address back to start of this longword */
75
76 /* the last longword contains the string end: figure out the byte */
77 mov.b @r0+,r1 /* fetch first byte */
78 tst r1,r1 /* byte == 0 ? */
79 bt .hitzero /* yes, string end found */
80 mov.b @r0+,r1 /* fetch second byte */
81 tst r1,r1 /* byte == 0 ? */
82 bt .hitzero /* yes, string end found */
83 mov.b @r0+,r1 /* fetch third byte */
84 tst r1,r1 /* byte == 0 ? */
85 bt .hitzero /* yes, string end found */
86 rts /* must be the fourth byte */
87 sub r4,r0 /* len = string_end - string_start */
88
89.hitzero:
90 add #-1,r0 /* undo address increment */
91 rts
92 sub r4,r0 /* len = string_end - string_start */
93
94.end:
95 .size _strlen,.end-_strlen
96
diff --git a/firmware/asm/sh/thread.c b/firmware/asm/sh/thread.c
deleted file mode 100644
index e63470c4a1..0000000000
--- a/firmware/asm/sh/thread.c
+++ /dev/null
@@ -1,96 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Ulf Ralberg
11 *
12 * SH processor threading support
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
21 *
22 ****************************************************************************/
23
24/*---------------------------------------------------------------------------
25 * Start the thread running and terminate it if it returns
26 *---------------------------------------------------------------------------
27 */
28void start_thread(void); /* Provide C access to ASM label */
29static void USED_ATTR __start_thread(void)
30{
31 /* r8 = context */
32 asm volatile (
33 "_start_thread: \n" /* Start here - no naked attribute */
34 "mov.l @(4, r8), r0 \n" /* Fetch thread function pointer */
35 "mov.l @(28, r8), r15 \n" /* Set initial sp */
36 "mov #0, r1 \n" /* Start the thread */
37 "jsr @r0 \n"
38 "mov.l r1, @(36, r8) \n" /* Clear start address */
39 );
40 thread_exit();
41}
42
43/* Place context pointer in r8 slot, function pointer in r9 slot, and
44 * start_thread pointer in context_start */
45#define THREAD_STARTUP_INIT(core, thread, function) \
46 ({ (thread)->context.r[0] = (uint32_t)&(thread)->context, \
47 (thread)->context.r[1] = (uint32_t)(function), \
48 (thread)->context.start = (uint32_t)start_thread; })
49
50/*---------------------------------------------------------------------------
51 * Store non-volatile context.
52 *---------------------------------------------------------------------------
53 */
54static inline void store_context(void* addr)
55{
56 asm volatile (
57 "add #36, %0 \n" /* Start at last reg. By the time routine */
58 "sts.l pr, @-%0 \n" /* is done, %0 will have the original value */
59 "mov.l r15,@-%0 \n"
60 "mov.l r14,@-%0 \n"
61 "mov.l r13,@-%0 \n"
62 "mov.l r12,@-%0 \n"
63 "mov.l r11,@-%0 \n"
64 "mov.l r10,@-%0 \n"
65 "mov.l r9, @-%0 \n"
66 "mov.l r8, @-%0 \n"
67 : : "r" (addr)
68 );
69}
70
71/*---------------------------------------------------------------------------
72 * Load non-volatile context.
73 *---------------------------------------------------------------------------
74 */
75static inline void load_context(const void* addr)
76{
77 asm volatile (
78 "mov.l @(36, %0), r0 \n" /* Get start address */
79 "tst r0, r0 \n"
80 "bt .running \n" /* NULL -> already running */
81 "jmp @r0 \n" /* r8 = context */
82 ".running: \n"
83 "mov.l @%0+, r8 \n" /* Executes in delay slot and outside it */
84 "mov.l @%0+, r9 \n"
85 "mov.l @%0+, r10 \n"
86 "mov.l @%0+, r11 \n"
87 "mov.l @%0+, r12 \n"
88 "mov.l @%0+, r13 \n"
89 "mov.l @%0+, r14 \n"
90 "mov.l @%0+, r15 \n"
91 "lds.l @%0+, pr \n"
92 : : "r" (addr) : "r0" /* only! */
93 );
94}
95
96
diff --git a/firmware/asm/sh/thread.h b/firmware/asm/sh/thread.h
deleted file mode 100644
index aa5fe519c6..0000000000
--- a/firmware/asm/sh/thread.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Ulf Ralberg
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22struct regs
23{
24 uint32_t r[7]; /* 0-24 - Registers r8 thru r14 */
25 uint32_t sp; /* 28 - Stack pointer (r15) */
26 uint32_t pr; /* 32 - Procedure register */
27 uint32_t start; /* 36 - Thread start address, or NULL when started */
28};
29
30#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
diff --git a/firmware/asm/thread.c b/firmware/asm/thread.c
index d6b881bdc5..c7779b3054 100644
--- a/firmware/asm/thread.c
+++ b/firmware/asm/thread.c
@@ -9,8 +9,6 @@
9 #include "arm/thread.c" 9 #include "arm/thread.c"
10#elif defined(CPU_COLDFIRE) 10#elif defined(CPU_COLDFIRE)
11 #include "m68k/thread.c" 11 #include "m68k/thread.c"
12#elif CONFIG_CPU == SH7034
13 #include "sh/thread.c"
14#elif defined(CPU_MIPS) 12#elif defined(CPU_MIPS)
15 #include "mips/thread.c" 13 #include "mips/thread.c"
16#else 14#else
diff --git a/firmware/asm/thread.h b/firmware/asm/thread.h
index be48095a8c..82edc81deb 100644
--- a/firmware/asm/thread.h
+++ b/firmware/asm/thread.h
@@ -47,8 +47,6 @@ struct regs
47 #include "arm/thread.h" 47 #include "arm/thread.h"
48#elif defined(CPU_COLDFIRE) 48#elif defined(CPU_COLDFIRE)
49 #include "m68k/thread.h" 49 #include "m68k/thread.h"
50#elif CONFIG_CPU == SH7034
51 #include "sh/thread.h"
52#elif defined(CPU_MIPS) 50#elif defined(CPU_MIPS)
53 #include "mips/thread.h" 51 #include "mips/thread.h"
54#endif 52#endif
diff --git a/firmware/common/file_internal.c b/firmware/common/file_internal.c
index a109563092..fe18f90056 100644
--- a/firmware/common/file_internal.c
+++ b/firmware/common/file_internal.c
@@ -36,8 +36,7 @@
36 36
37/* for internal functions' scanning use to save quite a bit of stack space - 37/* for internal functions' scanning use to save quite a bit of stack space -
38 access must be serialized by the writer lock */ 38 access must be serialized by the writer lock */
39#if defined(CPU_SH) || defined(IAUDIO_M5) \ 39#if defined(IAUDIO_M5) || CONFIG_CPU == IMX233
40 || CONFIG_CPU == IMX233
41/* otherwise, out of IRAM */ 40/* otherwise, out of IRAM */
42struct fat_direntry dir_fatent; 41struct fat_direntry dir_fatent;
43#else 42#else
diff --git a/firmware/debug.c b/firmware/debug.c
index bc382335b6..34f89908a3 100644
--- a/firmware/debug.c
+++ b/firmware/debug.c
@@ -30,9 +30,6 @@
30 30
31#ifdef DEBUG 31#ifdef DEBUG
32static char debugmembuf[200]; 32static char debugmembuf[200];
33#if CONFIG_CPU == SH7034
34static char debugbuf[400];
35#endif
36#endif 33#endif
37 34
38#include "kernel.h" 35#include "kernel.h"
@@ -40,194 +37,6 @@ static char debugbuf[400];
40#include "debug.h" 37#include "debug.h"
41 38
42#ifdef DEBUG 39#ifdef DEBUG
43#if CONFIG_CPU == SH7034 /* these are still very SH-oriented */
44void debug_init(void)
45{
46 /* Clear it all! */
47 SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER);
48
49 /* This enables the serial Rx interrupt, to be able to exit into the
50 debugger when you hit CTRL-C */
51 SCR1 |= 0x40;
52 SCR1 &= ~0x80;
53 IPRE |= 0xf000; /* Set to highest priority */
54}
55
56static int debug_tx_ready(void)
57{
58 return (SSR1 & SCI_TDRE);
59}
60
61static void debug_tx_char(char ch)
62{
63 while (!debug_tx_ready())
64 {
65 ;
66 }
67
68 /*
69 * Write data into TDR and clear TDRE
70 */
71 TDR1 = ch;
72 SSR1 &= ~SCI_TDRE;
73}
74
75static void debug_handle_error(char ssr)
76{
77 (void)ssr;
78 SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER);
79}
80
81static int debug_rx_ready(void)
82{
83 char ssr;
84
85 ssr = SSR1 & ( SCI_PER | SCI_FER | SCI_ORER );
86 if ( ssr )
87 debug_handle_error ( ssr );
88 return SSR1 & SCI_RDRF;
89}
90
91static char debug_rx_char(void)
92{
93 char ch;
94 char ssr;
95
96 while (!debug_rx_ready())
97 {
98 ;
99 }
100
101 ch = RDR1;
102 SSR1 &= ~SCI_RDRF;
103
104 ssr = SSR1 & (SCI_PER | SCI_FER | SCI_ORER);
105
106 if (ssr)
107 debug_handle_error (ssr);
108
109 return ch;
110}
111
112static const char hexchars[] = "0123456789abcdef";
113
114static char highhex(int x)
115{
116 return hexchars[(x >> 4) & 0xf];
117}
118
119static char lowhex(int x)
120{
121 return hexchars[x & 0xf];
122}
123
124static void putpacket (const char *buffer)
125{
126 register int checksum;
127
128 const char *src = buffer;
129
130 /* Special debug hack. Shut off the Rx IRQ during I/O to prevent the debug
131 stub from interrupting the message */
132 SCR1 &= ~0x40;
133
134 debug_tx_char ('$');
135 checksum = 0;
136
137 while (*src)
138 {
139 int runlen;
140
141 /* Do run length encoding */
142 for (runlen = 0; runlen < 100; runlen ++)
143 {
144 if (src[0] != src[runlen] || runlen == 99)
145 {
146 if (runlen > 3)
147 {
148 int encode;
149 /* Got a useful amount */
150 debug_tx_char (*src);
151 checksum += *src;
152 debug_tx_char ('*');
153 checksum += '*';
154 checksum += (encode = runlen + ' ' - 4);
155 debug_tx_char (encode);
156 src += runlen;
157 }
158 else
159 {
160 debug_tx_char (*src);
161 checksum += *src;
162 src++;
163 }
164 break;
165 }
166 }
167 }
168
169
170 debug_tx_char ('#');
171 debug_tx_char (highhex(checksum));
172 debug_tx_char (lowhex(checksum));
173
174 /* Wait for the '+' */
175 debug_rx_char();
176
177 /* Special debug hack. Enable the IRQ again */
178 SCR1 |= 0x40;
179}
180
181
182/* convert the memory, pointed to by mem into hex, placing result in buf */
183/* return a pointer to the last char put in buf (null) */
184static char *mem2hex (const char *mem, char *buf, int count)
185{
186 int i;
187 int ch;
188 for (i = 0; i < count; i++)
189 {
190 ch = *mem++;
191 *buf++ = highhex (ch);
192 *buf++ = lowhex (ch);
193 }
194 *buf = 0;
195 return (buf);
196}
197
198static void debug(const char *msg)
199{
200 debugbuf[0] = 'O';
201
202 mem2hex(msg, &debugbuf[1], strlen(msg));
203 putpacket(debugbuf);
204}
205#elif defined(HAVE_GDB_API)
206static void *get_api_function(int n)
207{
208 struct gdb_api *api = (struct gdb_api *)GDB_API_ADDRESS;
209 if (api->magic == GDB_API_MAGIC)
210 return api->func[n];
211 else
212 return NULL;
213}
214
215void breakpoint(void)
216{
217 void (*f)(void) = get_api_function(0);
218 if (f) (*f)();
219}
220
221static void debug(char *msg)
222{
223 void (*f)(char *) = get_api_function(1);
224 if (f) (*f)(msg);
225}
226
227void debug_init(void)
228{
229}
230#else /* !SH7034 && !HAVE_GDB_API */
231void debug_init(void) 40void debug_init(void)
232{ 41{
233} 42}
@@ -236,8 +45,6 @@ static inline void debug(char *msg)
236{ 45{
237 (void)msg; 46 (void)msg;
238} 47}
239#endif
240
241#endif /* end of DEBUG section */ 48#endif /* end of DEBUG section */
242 49
243#ifdef __GNUC__ 50#ifdef __GNUC__
diff --git a/firmware/drivers/audio/mas35xx.c b/firmware/drivers/audio/mas35xx.c
deleted file mode 100644
index 65c582c79c..0000000000
--- a/firmware/drivers/audio/mas35xx.c
+++ /dev/null
@@ -1,285 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Driver for MAS35xx audio codec
11 *
12 *
13 * Copyright (c) 2007 by Christian Gmeiner
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24
25#include "config.h"
26#include "system.h" /* MAX MIN macros */
27#include "sound.h"
28
29int channel_configuration = SOUND_CHAN_STEREO;
30int stereo_width = 100;
31
32#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
33unsigned long mdb_shape_shadow = 0;
34unsigned long loudness_shadow = 0;
35unsigned long shadow_io_control_main;
36#endif
37
38static void set_channel_config(void)
39{
40 /* default values: stereo */
41 unsigned long val_ll = 0x80000;
42 unsigned long val_lr = 0;
43 unsigned long val_rl = 0;
44 unsigned long val_rr = 0x80000;
45 int bank;
46
47 switch(channel_configuration)
48 {
49 /* case SOUND_CHAN_STEREO unnecessary */
50
51 case SOUND_CHAN_MONO:
52 val_ll = 0xc0000;
53 val_lr = 0xc0000;
54 val_rl = 0xc0000;
55 val_rr = 0xc0000;
56 break;
57
58 case SOUND_CHAN_CUSTOM:
59 {
60 /* fixed point variables (matching MAS internal format)
61 integer part: upper 13 bits (inlcuding sign)
62 fractional part: lower 19 bits */
63 long fp_width, fp_straight, fp_cross;
64
65 fp_width = (stereo_width << 19) / 100;
66 if (stereo_width <= 100)
67 {
68 fp_straight = - ((1<<19) + fp_width) / 2;
69 fp_cross = fp_straight + fp_width;
70 }
71 else
72 {
73 /* straight = - (1 + width) / (2 * width) */
74 fp_straight = - ((((1<<19) + fp_width) / (fp_width >> 9)) << 9);
75 fp_cross = (1<<19) + fp_straight;
76 }
77 val_ll = val_rr = fp_straight & 0xfffff;
78 val_lr = val_rl = fp_cross & 0xfffff;
79 }
80 break;
81
82 case SOUND_CHAN_MONO_LEFT:
83 val_ll = 0x80000;
84 val_lr = 0x80000;
85 val_rl = 0;
86 val_rr = 0;
87 break;
88
89 case SOUND_CHAN_MONO_RIGHT:
90 val_ll = 0;
91 val_lr = 0;
92 val_rl = 0x80000;
93 val_rr = 0x80000;
94 break;
95
96 case SOUND_CHAN_KARAOKE:
97 val_ll = 0xc0000;
98 val_lr = 0x40000;
99 val_rl = 0x40000;
100 val_rr = 0xc0000;
101 break;
102 }
103
104#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
105 bank = MAS_BANK_D0;
106#elif CONFIG_CODEC == MAS3507D
107 bank = MAS_BANK_D1;
108#endif
109
110 mas_writemem(bank, MAS_D0_OUT_LL, &val_ll, 1); /* LL */
111 mas_writemem(bank, MAS_D0_OUT_LR, &val_lr, 1); /* LR */
112 mas_writemem(bank, MAS_D0_OUT_RL, &val_rl, 1); /* RL */
113 mas_writemem(bank, MAS_D0_OUT_RR, &val_rr, 1); /* RR */
114}
115
116void audiohw_set_channel(int val)
117{
118 channel_configuration = val;
119 set_channel_config();
120}
121
122void audiohw_set_stereo_width(int val)
123{
124 stereo_width = val;
125 if (channel_configuration == SOUND_CHAN_CUSTOM) {
126 set_channel_config();
127 }
128}
129
130void audiohw_set_bass(int val)
131{
132#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
133 unsigned tmp = ((unsigned)(val * 8) & 0xff) << 8;
134 mas_codec_writereg(MAS_REG_KBASS, tmp);
135#elif CONFIG_CODEC == MAS3507D
136 mas_writereg(MAS_REG_KBASS, bass_table[val+15]);
137#endif
138}
139
140#if CONFIG_CODEC == MAS3507D
141void audiohw_set_prescaler(int val)
142{
143 mas_writereg(MAS_REG_KPRESCALE, prescale_table[val/10]);
144}
145#endif
146
147void audiohw_set_treble(int val)
148{
149#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
150 unsigned tmp = ((unsigned)(val * 8) & 0xff) << 8;
151 mas_codec_writereg(MAS_REG_KTREBLE, tmp);
152#elif CONFIG_CODEC == MAS3507D
153 mas_writereg(MAS_REG_KTREBLE, treble_table[val+15]);
154#endif
155}
156
157#if (CONFIG_CODEC == MAS3507D)
158/* convert tenth of dB volume (-780..+180) to dac3550 register value */
159static unsigned int tenthdb2reg(int db)
160{
161 if (db < -540) /* 3 dB steps */
162 return (db + 780) / 30;
163 else /* 1.5 dB steps */
164 return (db + 660) / 15;
165}
166
167void audiohw_set_volume(int vol_l, int vol_r)
168{
169 dac_volume(tenthdb2reg(vol_l), tenthdb2reg(vol_r), false);
170}
171#endif /* CONFIG_CODEC == MAS3507D */
172
173#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
174void audiohw_set_volume(int val)
175{
176 unsigned tmp = ((unsigned)(val + 115) & 0xff) << 8;
177 mas_codec_writereg(MAS_REG_VOLUME_CONTROL, tmp);
178}
179
180void audiohw_set_loudness(int value)
181{
182 loudness_shadow = (loudness_shadow & 0x04) |
183 (MAX(MIN(value * 4, 0x44), 0) << 8);
184 mas_codec_writereg(MAS_REG_KLOUDNESS, loudness_shadow);
185}
186
187void audiohw_set_avc(int value)
188{
189 int tmp;
190
191 static const uint16_t avc_vals[] =
192 {
193 (0x1 << 8) | (0x8 << 12), /* 20ms */
194 (0x2 << 8) | (0x8 << 12), /* 2s */
195 (0x4 << 8) | (0x8 << 12), /* 4s */
196 (0x8 << 8) | (0x8 << 12), /* 8s */
197 };
198 switch (value) {
199 case 1:
200 case 2:
201 case 3:
202 case 4:
203 tmp = avc_vals[value -1];
204 break;
205 case -1: /* turn off and then turn on again to decay quickly */
206 tmp = mas_codec_readreg(MAS_REG_KAVC);
207 mas_codec_writereg(MAS_REG_KAVC, 0);
208 break;
209 default: /* off */
210 tmp = 0;
211 break;
212 }
213 mas_codec_writereg(MAS_REG_KAVC, tmp);
214}
215
216void audiohw_set_mdb_strength(int value)
217{
218 mas_codec_writereg(MAS_REG_KMDB_STR, (value & 0x7f) << 8);
219}
220
221void audiohw_set_mdb_harmonics(int value)
222{
223 int tmp = value * 127 / 100;
224 mas_codec_writereg(MAS_REG_KMDB_HAR, (tmp & 0x7f) << 8);
225}
226
227void audiohw_set_mdb_center(int value)
228{
229 mas_codec_writereg(MAS_REG_KMDB_FC, (value/10) << 8);
230}
231
232void audiohw_set_mdb_shape(int value)
233{
234 mdb_shape_shadow = (mdb_shape_shadow & 0x02) | ((value/10) << 8);
235 mas_codec_writereg(MAS_REG_KMDB_SWITCH, mdb_shape_shadow);
236}
237
238void audiohw_set_mdb_enable(int value)
239{
240 mdb_shape_shadow = (mdb_shape_shadow & ~0x02) | (value?2:0);
241 mas_codec_writereg(MAS_REG_KMDB_SWITCH, mdb_shape_shadow);
242}
243
244void audiohw_set_superbass(int value)
245{
246 loudness_shadow = (loudness_shadow & ~0x04) | (value?4:0);
247 mas_codec_writereg(MAS_REG_KLOUDNESS, loudness_shadow);
248}
249
250void audiohw_set_balance(int val)
251{
252 unsigned tmp = ((unsigned)(val * 127 / 100) & 0xff) << 8;
253 mas_codec_writereg(MAS_REG_BALANCE, tmp);
254}
255
256/* This functionality works by telling the decoder that we have another
257 crystal frequency than we actually have. It will adjust its internal
258 parameters and the result is that the audio is played at another pitch.
259*/
260static int32_t last_pitch = PITCH_SPEED_100;
261
262void audiohw_set_pitch(int32_t val)
263{
264 if (val == last_pitch)
265 return;
266
267 /* Calculate the new (bogus) frequency */
268 unsigned long reg = 18432 * PITCH_SPEED_100 / val;
269 mas_writemem(MAS_BANK_D0, MAS_D0_OFREQ_CONTROL, &reg, 1);
270
271 /* We must tell the MAS that the frequency has changed.
272 * This will unfortunately cause a short silence. */
273 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN,
274 &shadow_io_control_main, 1);
275
276 last_pitch = val;
277}
278
279int32_t audiohw_get_pitch(void)
280{
281 return last_pitch;
282}
283
284#endif /* CONFIG_CODEC == MAS3587F || CONFIG_CODEC == MAS3539F */
285
diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c
index a8fd2ffa07..d701665889 100644
--- a/firmware/drivers/audio/sdl.c
+++ b/firmware/drivers/audio/sdl.c
@@ -134,25 +134,3 @@ unsigned int pcm_sampr_to_hw_sampr(unsigned int samplerate,
134 unsigned int type) 134 unsigned int type)
135 { return samplerate; (void)type; } 135 { return samplerate; (void)type; }
136#endif /* CONFIG_SAMPR_TYPES */ 136#endif /* CONFIG_SAMPR_TYPES */
137#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
138int mas_codec_readreg(int reg)
139{
140 (void)reg;
141 return 0;
142}
143
144int mas_codec_writereg(int reg, unsigned int val)
145{
146 (void)reg;
147 (void)val;
148 return 0;
149}
150int mas_writemem(int bank, int addr, const unsigned long* src, int len)
151{
152 (void)bank;
153 (void)addr;
154 (void)src;
155 (void)len;
156 return 0;
157}
158#endif
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 626afc415f..c81b629f6d 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -575,9 +575,6 @@ static int button_flip(int button)
575#if defined(BUTTON_SCROLL_BACK) && defined(BUTTON_SCROLL_FWD) 575#if defined(BUTTON_SCROLL_BACK) && defined(BUTTON_SCROLL_FWD)
576 | BUTTON_SCROLL_BACK | BUTTON_SCROLL_FWD 576 | BUTTON_SCROLL_BACK | BUTTON_SCROLL_FWD
577#endif 577#endif
578#if CONFIG_KEYPAD == RECORDER_PAD
579 | BUTTON_F1 | BUTTON_F3
580#endif
581#if (CONFIG_KEYPAD == SANSA_C200_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\ 578#if (CONFIG_KEYPAD == SANSA_C200_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\
582 (CONFIG_KEYPAD == GIGABEAT_PAD) || (CONFIG_KEYPAD == GIGABEAT_S_PAD) 579 (CONFIG_KEYPAD == GIGABEAT_PAD) || (CONFIG_KEYPAD == GIGABEAT_S_PAD)
583 | BUTTON_VOL_UP | BUTTON_VOL_DOWN 580 | BUTTON_VOL_UP | BUTTON_VOL_DOWN
@@ -604,12 +601,6 @@ static int button_flip(int button)
604 if (button & BUTTON_SCROLL_FWD) 601 if (button & BUTTON_SCROLL_FWD)
605 newbutton |= BUTTON_SCROLL_BACK; 602 newbutton |= BUTTON_SCROLL_BACK;
606#endif 603#endif
607#if CONFIG_KEYPAD == RECORDER_PAD
608 if (button & BUTTON_F1)
609 newbutton |= BUTTON_F3;
610 if (button & BUTTON_F3)
611 newbutton |= BUTTON_F1;
612#endif
613#if (CONFIG_KEYPAD == SANSA_C200_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\ 604#if (CONFIG_KEYPAD == SANSA_C200_PAD) || (CONFIG_KEYPAD == SANSA_CLIP_PAD) ||\
614 (CONFIG_KEYPAD == GIGABEAT_PAD) || (CONFIG_KEYPAD == GIGABEAT_S_PAD) 605 (CONFIG_KEYPAD == GIGABEAT_PAD) || (CONFIG_KEYPAD == GIGABEAT_S_PAD)
615 if (button & BUTTON_VOL_UP) 606 if (button & BUTTON_VOL_UP)
diff --git a/firmware/drivers/fmradio.c b/firmware/drivers/fmradio.c
deleted file mode 100644
index a6d2e799cb..0000000000
--- a/firmware/drivers/fmradio.c
+++ /dev/null
@@ -1,121 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "lcd.h"
22#include "sh7034.h"
23#include "kernel.h"
24#include "thread.h"
25#include "debug.h"
26#include "system.h"
27#include "fmradio.h"
28
29#if CONFIG_TUNER
30
31/* Signals:
32 DI (Data In) - PB0 (doubles as data pin for the LCD)
33 CL (Clock) - PB1 (doubles as clock for the LCD)
34 CE (Chip Enable) - PB3 (also chip select for the LCD, but active low)
35 DO (Data Out) - PB4
36*/
37
38/* cute little functions */
39#define CE_LO and_b(~0x08, PBDRL_ADDR)
40#define CE_HI or_b(0x08, PBDRL_ADDR)
41#define CL_LO and_b(~0x02, PBDRL_ADDR)
42#define CL_HI or_b(0x02, PBDRL_ADDR)
43#define DO (PBDR & 0x10)
44#define DI_LO and_b(~0x01, PBDRL_ADDR)
45#define DI_HI or_b(0x01, PBDRL_ADDR)
46
47#define START or_b((0x08 | 0x02), PBDRL_ADDR)
48
49/* delay loop */
50#define DELAY do { int _x; for(_x=0;_x<10;_x++);} while (0)
51
52
53int fmradio_read(int addr)
54{
55 int i;
56 int data = 0;
57
58 START;
59
60 /* First address bit */
61 CL_LO;
62 if(addr & 2)
63 DI_HI;
64 else
65 DI_LO;
66 DELAY;
67 CL_HI;
68 DELAY;
69
70 /* Second address bit */
71 CL_LO;
72 if(addr & 1)
73 DI_HI;
74 else
75 DI_LO;
76 DELAY;
77 CL_HI;
78 DELAY;
79
80 for(i = 0; i < 21;i++)
81 {
82 CL_LO;
83 DELAY;
84 data <<= 1;
85 data |= (DO)?1:0;
86 CL_HI;
87 DELAY;
88 }
89
90 CE_LO;
91
92 return data;
93}
94
95void fmradio_set(int addr, int data)
96{
97 int i;
98
99 /* Include the address in the data */
100 data |= addr << 21;
101
102 START;
103
104 for(i = 0; i < 23;i++)
105 {
106 CL_LO;
107 DELAY;
108 if(data & (1 << 22))
109 DI_HI;
110 else
111 DI_LO;
112
113 data <<= 1;
114 CL_HI;
115 DELAY;
116 }
117
118 CE_LO;
119}
120
121#endif
diff --git a/firmware/drivers/rtc/rtc_m41st84w.c b/firmware/drivers/rtc/rtc_m41st84w.c
deleted file mode 100644
index 621e650f68..0000000000
--- a/firmware/drivers/rtc/rtc_m41st84w.c
+++ /dev/null
@@ -1,296 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing, Uwe Freese, Laurent Baum
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "i2c.h"
23#include "rtc.h"
24#include "kernel.h"
25#include "system.h"
26#include "timefuncs.h"
27
28#define RTC_ADR 0xd0
29#define RTC_DEV_WRITE (RTC_ADR | 0x00)
30#define RTC_DEV_READ (RTC_ADR | 0x01)
31
32void rtc_init(void)
33{
34 unsigned char data;
35
36#ifdef HAVE_RTC_ALARM
37 /* Check + save alarm bit first, before the power thread starts watching */
38 rtc_check_alarm_started(false);
39#endif
40
41 /* Clear the Stop bit if it is set */
42 data = rtc_read(0x01);
43 if(data & 0x80)
44 rtc_write(0x01, 0x00);
45
46 /* Clear the HT bit if it is set */
47 data = rtc_read(0x0c);
48
49 if(data & 0x40)
50 {
51 data &= ~0x40;
52 rtc_write(0x0c,data);
53 }
54
55#ifdef HAVE_RTC_ALARM
56
57 /* Clear Trec bit, write-protecting the RTC for 200ms when shutting off */
58 /* without this, the alarm won't work! */
59
60 data = rtc_read(0x04);
61 if (data & 0x80)
62 {
63 data &= ~0x80;
64 rtc_write(0x04, data);
65 }
66
67 /* Also, make sure that the OUT bit in register 8 is 1,
68 otherwise the player can't be turned off. */
69 rtc_write(8, rtc_read(8) | 0x80);
70
71#endif
72}
73
74#ifdef HAVE_RTC_ALARM
75
76/* check whether the unit has been started by the RTC alarm function */
77/* (check for AF, which => started using wakeup alarm) */
78bool rtc_check_alarm_started(bool release_alarm)
79{
80 static bool alarm_state, run_before;
81 bool rc;
82
83 if (run_before) {
84 rc = alarm_state;
85 alarm_state &= ~release_alarm;
86 } else {
87 /* This call resets AF, so we store the state for later recall */
88 rc = alarm_state = rtc_check_alarm_flag();
89 run_before = true;
90 }
91
92 return rc;
93}
94/*
95 * Checks the AL register. This call resets AL once read.
96 *
97 * We're only interested if ABE is set. AL is still raised regardless
98 * even if the unit is off when the alarm occurs.
99 */
100bool rtc_check_alarm_flag(void)
101{
102 return ( ( (rtc_read(0x0f) & 0x40) != 0) &&
103 (rtc_read(0x0a) & 0x20) );
104}
105
106/* set alarm time registers to the given time (repeat once per day) */
107void rtc_set_alarm(int h, int m)
108{
109 unsigned char data;
110
111 /* for daily alarm, RPT5=RPT4=on, RPT1=RPT2=RPT3=off */
112
113 rtc_write(0x0e, 0x00); /* seconds 0 and RTP1 */
114 rtc_write(0x0d, DEC2BCD(m)); /* minutes and RPT2 */
115 rtc_write(0x0c, DEC2BCD(h)); /* hour and RPT3 */
116 rtc_write(0x0b, 0xc1); /* set date 01 and RPT4 and RTP5 */
117
118 /* set month to 1, if it's invalid, the rtc does an alarm every second instead */
119 data = rtc_read(0x0a);
120 data &= 0xe0;
121 data |= 0x01;
122 rtc_write(0x0a, data);
123}
124
125/* read out the current alarm time */
126void rtc_get_alarm(int *h, int *m)
127{
128 unsigned char data;
129
130 data = rtc_read(0x0c);
131 *h = BCD2DEC(data & 0x3f);
132
133 data = rtc_read(0x0d);
134 *m = BCD2DEC(data & 0x7f);
135}
136
137/* turn alarm on or off by setting the alarm flag enable */
138/* the alarm is automatically disabled when the RTC gets Vcc power at startup */
139/* avoid that an alarm occurs when the device is on because this locks the ON key forever */
140void rtc_enable_alarm(bool enable)
141{
142 unsigned char data = rtc_read(0x0a);
143 if (enable)
144 {
145 data |= 0xa0; /* turn bit d7=AFE and d5=ABE on */
146 }
147 else
148 data &= 0x5f; /* turn bit d7=AFE and d5=ABE off */
149 rtc_write(0x0a, data);
150
151 /* check if alarm flag AF is off (as it should be) */
152 /* in some cases enabling the alarm results in an activated AF flag */
153 /* this should not happen, but it does */
154 /* if you know why, tell me! */
155 /* for now, we try again forever in this case */
156 while (rtc_check_alarm_flag()) /* on */
157 {
158 data &= 0x5f; /* turn bit d7=AFE and d5=ABE off */
159 rtc_write(0x0a, data);
160 sleep(HZ / 10);
161 rtc_check_alarm_flag();
162 data |= 0xa0; /* turn bit d7=AFE and d5=ABE on */
163 rtc_write(0x0a, data);
164 }
165}
166
167#endif /* HAVE_RTC_ALARM */
168
169int rtc_write(unsigned char address, unsigned char value)
170{
171 int ret = 0;
172 unsigned char buf[2];
173
174 i2c_begin();
175
176 buf[0] = address;
177 buf[1] = value;
178
179 /* send run command */
180 if (i2c_write(RTC_DEV_WRITE,buf,2))
181 {
182 ret = -1;
183 }
184
185 i2c_end();
186 return ret;
187}
188
189int rtc_read(unsigned char address)
190{
191 int value = -1;
192 unsigned char buf[1];
193
194 i2c_begin();
195
196 buf[0] = address;
197
198 /* send read command */
199 if (i2c_write(RTC_DEV_READ,buf,1) >= 0)
200 {
201 i2c_start();
202 i2c_outb(RTC_DEV_READ);
203 if (i2c_getack())
204 {
205 value = i2c_inb(1);
206 }
207 }
208
209 i2c_stop();
210
211 i2c_end();
212 return value;
213}
214
215int rtc_read_multiple(unsigned char address, unsigned char *buf, int numbytes)
216{
217 int ret = 0;
218 unsigned char obuf[1];
219 int i;
220
221 i2c_begin();
222
223 obuf[0] = address;
224
225 /* send read command */
226 if (i2c_write(RTC_DEV_READ, obuf, 1) >= 0)
227 {
228 i2c_start();
229 i2c_outb(RTC_DEV_READ);
230 if (i2c_getack())
231 {
232 for(i = 0;i < numbytes-1;i++)
233 buf[i] = i2c_inb(0);
234
235 buf[i] = i2c_inb(1);
236 }
237 else
238 {
239 ret = -1;
240 }
241 }
242
243 i2c_stop();
244
245 i2c_end();
246 return ret;
247}
248
249int rtc_read_datetime(struct tm *tm)
250{
251 int rc;
252 unsigned char buf[7];
253
254 rc = rtc_read_multiple(1, buf, sizeof(buf));
255
256 /* convert from bcd, avoid getting extra bits */
257 tm->tm_sec = BCD2DEC(buf[0] & 0x7f);
258 tm->tm_min = BCD2DEC(buf[1] & 0x7f);
259 tm->tm_hour = BCD2DEC(buf[2] & 0x3f);
260 tm->tm_mday = BCD2DEC(buf[4] & 0x3f);
261 tm->tm_mon = BCD2DEC(buf[5] & 0x1f) - 1;
262 tm->tm_year = BCD2DEC(buf[6]) + 100;
263 tm->tm_yday = 0; /* Not implemented for now */
264
265 set_day_of_week(tm);
266
267 return rc;
268}
269
270int rtc_write_datetime(const struct tm *tm)
271{
272 unsigned int i;
273 int rc = 0;
274 unsigned char buf[7];
275
276 buf[0] = tm->tm_sec;
277 buf[1] = tm->tm_min;
278 buf[2] = tm->tm_hour;
279 buf[3] = tm->tm_wday;
280 buf[4] = tm->tm_mday;
281 buf[5] = tm->tm_mon + 1;
282 buf[6] = tm->tm_year - 100;
283
284 /* Adjust weekday */
285 if (buf[3] == 0)
286 buf[3] = 7;
287
288 for (i = 0; i < sizeof(buf) ;i++)
289 {
290 rc |= rtc_write(i + 1, DEC2BCD(buf[i]));
291 }
292 rc |= rtc_write(8, 0x80); /* Out=1, calibration = 0 */
293
294 return rc;
295}
296
diff --git a/firmware/drivers/tuner/s1a0903x01.c b/firmware/drivers/tuner/s1a0903x01.c
deleted file mode 100644
index 91d1319fb5..0000000000
--- a/firmware/drivers/tuner/s1a0903x01.c
+++ /dev/null
@@ -1,179 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 * Tuner "middleware" for Samsung S1A0903X01 chip
10 *
11 * Copyright (C) 2003 Linus Nielsen Feltzing
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include <stdbool.h>
24#include <stdlib.h>
25#include "config.h"
26#include "kernel.h"
27#include "tuner.h" /* tuner abstraction interface */
28#include "fmradio.h" /* physical interface driver */
29#include "sound.h"
30#include "mas35xx.h"
31#include "power.h"
32
33#define DEFAULT_IN1 0x100003 /* Mute */
34#define DEFAULT_IN2 0x140884 /* 5kHz, 7.2MHz crystal */
35#define PLL_FREQ_STEP 10000
36
37static int fm_in1;
38static int fm_in2;
39static int fm_present = -1; /* unknown */
40
41/* tuner abstraction layer: set something to the tuner */
42int s1a0903x01_set(int setting, int value)
43{
44 int val = 1;
45
46 switch(setting)
47 {
48 case RADIO_SLEEP:
49 if (!value)
50 {
51 tuner_power(true);
52 /* wakeup: just unit */
53 fm_in1 = DEFAULT_IN1;
54 fm_in2 = DEFAULT_IN2;
55 fmradio_set(1, fm_in1);
56 fmradio_set(2, fm_in2);
57 }
58 else
59 tuner_power(false);
60 /* else we have no sleep mode? */
61 break;
62
63 case RADIO_FREQUENCY:
64 {
65 int pll_cnt;
66#if CONFIG_CODEC == MAS3587F
67 /* Shift the MAS internal clock away for certain frequencies to
68 * avoid interference. */
69 int pitch = 1000;
70
71 /* 4th harmonic falls in the FM frequency range */
72 int if_freq = 4 * mas_get_pllfreq();
73
74 /* shift the mas harmonic >= 300 kHz away using the direction
75 * which needs less shifting. */
76 if (value < if_freq)
77 {
78 if (if_freq - value < 300000)
79 pitch = 1003 - (if_freq - value) / 100000;
80 }
81 else
82 {
83 if (value - if_freq < 300000)
84 pitch = 997 + (value - if_freq) / 100000;
85 }
86 sound_set_pitch(pitch);
87#endif
88 /* We add the standard Intermediate Frequency 10.7MHz
89 ** before calculating the divisor
90 ** The reference frequency is set to 50kHz, and the VCO
91 ** output is prescaled by 2.
92 */
93
94 pll_cnt = (value + 10700000) / (PLL_FREQ_STEP/2) / 2;
95
96 /* 0x100000 == FM mode
97 ** 0x000002 == Microprocessor controlled Mute
98 */
99 fm_in1 = (fm_in1 & 0xfff00007) | (pll_cnt << 3);
100 fmradio_set(1, fm_in1);
101 break;
102 }
103
104 case RADIO_SCAN_FREQUENCY:
105 /* Tune in and delay */
106 s1a0903x01_set(RADIO_FREQUENCY, value);
107 sleep(1);
108 /* Start IF measurement */
109 fm_in1 |= 4;
110 fmradio_set(1, fm_in1);
111 sleep(1);
112 val = s1a0903x01_get(RADIO_TUNED);
113 break;
114
115 case RADIO_MUTE:
116 fm_in1 = (fm_in1 & 0xfffffffe) | (value?1:0);
117 fmradio_set(1, fm_in1);
118 break;
119
120 case RADIO_FORCE_MONO:
121 fm_in2 = (fm_in2 & 0xfffffffb) | (value?0:4);
122 fmradio_set(2, fm_in2);
123 break;
124 /* NOTE: These were only zeroed when starting the tuner from OFF
125 but the default values already set them to 0. */
126#if 0
127 case S1A0903X01_IF_MEASUREMENT:
128 fm_in1 = (fm_in1 & 0xfffffffb) | (value?4:0);
129 fmradio_set(1, fm_in1);
130 break;
131
132 case S1A0903X01_SENSITIVITY:
133 fm_in2 = (fm_in2 & 0xffff9fff) | ((value & 3) << 13);
134 fmradio_set(2, fm_in2);
135 break;
136#endif
137 default:
138 val = -1;
139 }
140
141 return val;
142}
143
144/* tuner abstraction layer: read something from the tuner */
145int s1a0903x01_get(int setting)
146{
147 int val = -1;
148 switch(setting)
149 {
150 case RADIO_PRESENT:
151 if (fm_present == -1)
152 {
153#ifdef HAVE_TUNER_PWR_CTRL
154 bool fmstatus = tuner_power(true);
155#endif
156 /* 5kHz, 7.2MHz crystal, test mode 1 */
157 fmradio_set(2, 0x140885);
158 fm_present = (fmradio_read(0) == 0x140885);
159#ifdef HAVE_TUNER_PWR_CTRL
160 if (!fmstatus)
161 tuner_power(false);
162#endif
163 }
164
165 val = fm_present;
166 break;
167
168 case RADIO_TUNED:
169 val = fmradio_read(3);
170 val = abs(10700 - ((val & 0x7ffff) / 8)) < 50; /* convert to kHz */
171 break;
172
173 case RADIO_STEREO:
174 val = fmradio_read(3);
175 val = ((val & 0x100000) ? true : false);
176 break;
177 }
178 return val;
179}
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index f22e72554d..490c8fc571 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -184,8 +184,6 @@ struct sound_settings_info
184#include "tlv320.h" 184#include "tlv320.h"
185#elif defined(HAVE_AS3514) 185#elif defined(HAVE_AS3514)
186#include "as3514.h" 186#include "as3514.h"
187#elif defined(HAVE_MAS35XX)
188#include "mas35xx.h"
189#if defined(HAVE_DAC3550A) 187#if defined(HAVE_DAC3550A)
190#include "dac3550a.h" 188#include "dac3550a.h"
191#endif /* HAVE_DAC3550A */ 189#endif /* HAVE_DAC3550A */
diff --git a/firmware/export/audiohw_settings.h b/firmware/export/audiohw_settings.h
index 675ec59a7b..1d3e0dc12f 100644
--- a/firmware/export/audiohw_settings.h
+++ b/firmware/export/audiohw_settings.h
@@ -84,16 +84,6 @@ AUDIOHW_SETTINGS(
84 AUDIOHW_SETTING_ENT(BALANCE, sound_set_balance) 84 AUDIOHW_SETTING_ENT(BALANCE, sound_set_balance)
85 AUDIOHW_SETTING_ENT(CHANNELS, sound_set_channels) 85 AUDIOHW_SETTING_ENT(CHANNELS, sound_set_channels)
86 AUDIOHW_SETTING_ENT(STEREO_WIDTH, sound_set_stereo_width) 86 AUDIOHW_SETTING_ENT(STEREO_WIDTH, sound_set_stereo_width)
87#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
88 AUDIOHW_SETTING_ENT(LOUDNESS, sound_set_loudness)
89 AUDIOHW_SETTING_ENT(AVC, sound_set_avc)
90 AUDIOHW_SETTING_ENT(MDB_STRENGTH, sound_set_mdb_strength)
91 AUDIOHW_SETTING_ENT(MDB_HARMONICS, sound_set_mdb_harmonics)
92 AUDIOHW_SETTING_ENT(MDB_CENTER, sound_set_mdb_center)
93 AUDIOHW_SETTING_ENT(MDB_SHAPE, sound_set_mdb_shape)
94 AUDIOHW_SETTING_ENT(MDB_ENABLE, sound_set_mdb_enable)
95 AUDIOHW_SETTING_ENT(SUPERBASS, sound_set_superbass)
96#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
97#if defined(AUDIOHW_HAVE_LIN_GAIN) 87#if defined(AUDIOHW_HAVE_LIN_GAIN)
98 AUDIOHW_SETTING_ENT(LEFT_GAIN, NULL) 88 AUDIOHW_SETTING_ENT(LEFT_GAIN, NULL)
99 AUDIOHW_SETTING_ENT(RIGHT_GAIN, NULL) 89 AUDIOHW_SETTING_ENT(RIGHT_GAIN, NULL)
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 4f9cd02097..6ce9bede41 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -44,7 +44,6 @@
44#define STORAGE_HOSTFS (1 << STORAGE_HOSTFS_NUM) 44#define STORAGE_HOSTFS (1 << STORAGE_HOSTFS_NUM)
45 45
46/* CONFIG_TUNER (note these are combineable bit-flags) */ 46/* CONFIG_TUNER (note these are combineable bit-flags) */
47#define S1A0903X01 0x01 /* Samsung */
48#define TEA5767 0x02 /* Philips */ 47#define TEA5767 0x02 /* Philips */
49#define LV24020LP 0x04 /* Sanyo */ 48#define LV24020LP 0x04 /* Sanyo */
50#define SI4700 0x08 /* Silicon Labs */ 49#define SI4700 0x08 /* Silicon Labs */
@@ -55,13 +54,9 @@
55#define STFM1000 0x100 /* Sigmatel */ 54#define STFM1000 0x100 /* Sigmatel */
56 55
57/* CONFIG_CODEC */ 56/* CONFIG_CODEC */
58#define MAS3587F 3587
59#define MAS3507D 3507
60#define MAS3539F 3539
61#define SWCODEC 1 /* if codec is done by SW */ 57#define SWCODEC 1 /* if codec is done by SW */
62 58
63/* CONFIG_CPU */ 59/* CONFIG_CPU */
64#define SH7034 7034
65#define MCF5249 5249 60#define MCF5249 5249
66#define MCF5250 5250 61#define MCF5250 5250
67#define PP5002 5002 62#define PP5002 5002
@@ -103,9 +98,6 @@
103#define PLATFORM_PANDORA (1<<6) 98#define PLATFORM_PANDORA (1<<6)
104 99
105/* CONFIG_KEYPAD */ 100/* CONFIG_KEYPAD */
106#define PLAYER_PAD 1
107#define RECORDER_PAD 2
108#define ONDIO_PAD 3
109#define IRIVER_H100_PAD 4 101#define IRIVER_H100_PAD 4
110#define IRIVER_H300_PAD 5 102#define IRIVER_H300_PAD 5
111#define IAUDIO_X5M5_PAD 6 103#define IAUDIO_X5M5_PAD 6
@@ -222,8 +214,7 @@
222 if the estimation is better that ours 214 if the estimation is better that ours
223 (which it probably is) */ 215 (which it probably is) */
224/* CONFIG_LCD */ 216/* CONFIG_LCD */
225#define LCD_SSD1815 1 /* as used by Archos Recorders and Ondios */ 217#define LCD_SSD1815 1 /* as used by Sansa M200 and others */
226#define LCD_SSD1801 2 /* as used by Archos Player/Studio */
227#define LCD_S1D15E06 3 /* as used by iRiver H100 series */ 218#define LCD_S1D15E06 3 /* as used by iRiver H100 series */
228#define LCD_H300 4 /* as used by iRiver H300 series, exact model name is 219#define LCD_H300 4 /* as used by iRiver H300 series, exact model name is
229 unknown at the time of this writing */ 220 unknown at the time of this writing */
@@ -312,8 +303,6 @@
312/* CONFIG_I2C */ 303/* CONFIG_I2C */
313#define I2C_NONE 0 /* For targets that do not use I2C - as the 304#define I2C_NONE 0 /* For targets that do not use I2C - as the
314Lyre prototype 1 */ 305Lyre prototype 1 */
315#define I2C_PLAYREC 1 /* Archos Player/Recorder style */
316#define I2C_ONDIO 2 /* Ondio style */
317#define I2C_COLDFIRE 3 /* Coldfire style */ 306#define I2C_COLDFIRE 3 /* Coldfire style */
318#define I2C_PP5002 4 /* PP5002 style */ 307#define I2C_PP5002 4 /* PP5002 style */
319#define I2C_PP5020 5 /* PP5020 style */ 308#define I2C_PP5020 5 /* PP5020 style */
@@ -345,7 +334,6 @@ Lyre prototype 1 */
345#define NAND_IMX233 6 334#define NAND_IMX233 6
346 335
347/* CONFIG_RTC */ 336/* CONFIG_RTC */
348#define RTC_M41ST84W 1 /* Archos Recorder */
349#define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */ 337#define RTC_PCF50605 2 /* iPod 3G, 4G & Mini */
350#define RTC_PCF50606 3 /* iriver H300 */ 338#define RTC_PCF50606 3 /* iriver H300 */
351#define RTC_S3C2440 4 339#define RTC_S3C2440 4
@@ -398,19 +386,7 @@ Lyre prototype 1 */
398#define IMX233_CREATIVE (1 << 1) /* Creative MBLK windowing */ 386#define IMX233_CREATIVE (1 << 1) /* Creative MBLK windowing */
399 387
400/* now go and pick yours */ 388/* now go and pick yours */
401#if defined(ARCHOS_PLAYER) 389#if defined(IRIVER_H100)
402#include "config/archosplayer.h"
403#elif defined(ARCHOS_RECORDER)
404#include "config/archosrecorder.h"
405#elif defined(ARCHOS_FMRECORDER)
406#include "config/archosfmrecorder.h"
407#elif defined(ARCHOS_RECORDERV2)
408#include "config/archosrecorderv2.h"
409#elif defined(ARCHOS_ONDIOSP)
410#include "config/archosondiosp.h"
411#elif defined(ARCHOS_ONDIOFM)
412#include "config/archosondiofm.h"
413#elif defined(IRIVER_H100)
414#include "config/iriverh100.h" 390#include "config/iriverh100.h"
415#elif defined(IRIVER_H120) 391#elif defined(IRIVER_H120)
416#include "config/iriverh120.h" 392#include "config/iriverh120.h"
@@ -659,11 +635,6 @@ Lyre prototype 1 */
659 635
660#ifndef __PCTOOL__ 636#ifndef __PCTOOL__
661 637
662/* define for all cpus from SH family */
663#if (ARCH == ARCH_SH) && (CONFIG_CPU == SH7034)
664#define CPU_SH
665#endif
666
667/* define for all cpus from coldfire family */ 638/* define for all cpus from coldfire family */
668#if (ARCH == ARCH_M68K) && ((CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250)) 639#if (ARCH == ARCH_M68K) && ((CONFIG_CPU == MCF5249) || (CONFIG_CPU == MCF5250))
669#define CPU_COLDFIRE 640#define CPU_COLDFIRE
@@ -932,11 +903,6 @@ Lyre prototype 1 */
932#define HAVE_PICTUREFLOW_INTEGRATION 903#define HAVE_PICTUREFLOW_INTEGRATION
933#endif 904#endif
934 905
935/* Add one HAVE_ define for all mas35xx targets */
936#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3507D) || (CONFIG_CODEC == MAS3539F)
937#define HAVE_MAS35XX
938#endif
939
940#if (CONFIG_CODEC == SWCODEC) 906#if (CONFIG_CODEC == SWCODEC)
941#ifdef BOOTLOADER 907#ifdef BOOTLOADER
942 908
@@ -1012,7 +978,7 @@ Lyre prototype 1 */
1012#endif /* (CONFIG_CODEC == SWCODEC) */ 978#endif /* (CONFIG_CODEC == SWCODEC) */
1013 979
1014/* Determine if accesses should be strictly long aligned. */ 980/* Determine if accesses should be strictly long aligned. */
1015#if (CONFIG_CPU == SH7034) || defined(CPU_ARM) || defined(CPU_MIPS) 981#if defined(CPU_ARM) || defined(CPU_MIPS)
1016#define ROCKBOX_STRICT_ALIGN 1 982#define ROCKBOX_STRICT_ALIGN 1
1017#endif 983#endif
1018 984
@@ -1061,8 +1027,7 @@ Lyre prototype 1 */
1061 1027
1062/* IRAM usage */ 1028/* IRAM usage */
1063#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && /* Not for hosted environments */ \ 1029#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && /* Not for hosted environments */ \
1064 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \ 1030 (defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
1065 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
1066 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \ 1031 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
1067 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2 && !defined(BOOTLOADER)) || /* AS3525 +2MB: core, plugins, codecs */ \ 1032 (CONFIG_CPU == AS3525 && MEMORYSIZE > 2 && !defined(BOOTLOADER)) || /* AS3525 +2MB: core, plugins, codecs */ \
1068 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC) && !defined(BOOTLOADER)) || /* AS3525 2MB: core only */ \ 1033 (CONFIG_CPU == AS3525 && MEMORYSIZE <= 2 && !defined(PLUGIN) && !defined(CODEC) && !defined(BOOTLOADER)) || /* AS3525 2MB: core only */ \
@@ -1077,7 +1042,7 @@ Lyre prototype 1 */
1077#define IDATA_ATTR __attribute__ ((section(".idata"))) 1042#define IDATA_ATTR __attribute__ ((section(".idata")))
1078#define IBSS_ATTR __attribute__ ((section(".ibss"))) 1043#define IBSS_ATTR __attribute__ ((section(".ibss")))
1079#define USE_IRAM 1044#define USE_IRAM
1080#if CONFIG_CPU != SH7034 && (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) \ 1045#if (CONFIG_CPU != AS3525 || MEMORYSIZE > 2) \
1081 && CONFIG_CPU != JZ4732 && CONFIG_CPU != JZ4760B && CONFIG_CPU != AS3525v2 && CONFIG_CPU != IMX233 1046 && CONFIG_CPU != JZ4732 && CONFIG_CPU != JZ4760B && CONFIG_CPU != AS3525v2 && CONFIG_CPU != IMX233
1082#define PLUGIN_USE_IRAM 1047#define PLUGIN_USE_IRAM
1083#endif 1048#endif
@@ -1283,8 +1248,7 @@ Lyre prototype 1 */
1283#define HAVE_PCM_FULL_DUPLEX 1248#define HAVE_PCM_FULL_DUPLEX
1284#endif 1249#endif
1285 1250
1286#if (CONFIG_CODEC == SWCODEC) || (CONFIG_CODEC == MAS3587F) || \ 1251#if (CONFIG_CODEC == SWCODEC)
1287 (CONFIG_CODEC == MAS3539F)
1288#define HAVE_PITCHCONTROL 1252#define HAVE_PITCHCONTROL
1289#endif 1253#endif
1290 1254
diff --git a/firmware/export/config/archosfmrecorder.h b/firmware/export/config/archosfmrecorder.h
deleted file mode 100644
index 0c64d70be4..0000000000
--- a/firmware/export/config/archosfmrecorder.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/* define this if you use an ATA controller */
2#define CONFIG_STORAGE STORAGE_ATA
3
4#define MODEL_NAME "Archos FM Recorder"
5
6/* define this if you have recording possibility */
7#define HAVE_RECORDING
8
9/* Define bitmask of input sources - recordable bitmask can be defined
10 explicitly if different */
11#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
12
13/* define this if you have a bitmap LCD display */
14#define HAVE_LCD_BITMAP
15
16/* define this if you can flip your LCD */
17#define HAVE_LCD_FLIP
18
19/* define this if you can invert the colours on your LCD */
20#define HAVE_LCD_INVERT
21
22/* define this if you have access to the quickscreen */
23#define HAVE_QUICKSCREEN
24
25/* define this if you have the button bar */
26#define HAVE_BUTTONBAR
27
28/* define this if you would like tagcache to build on this target */
29#define HAVE_TAGCACHE
30
31/* LCD dimensions */
32#define LCD_WIDTH 112
33#define LCD_HEIGHT 64
34/* sqrt(112^2 + 64^2) / 1.5 = 85.4 */
35#define LCD_DPI 85
36#define LCD_DEPTH 1
37
38#define LCD_PIXEL_ASPECT_WIDTH 4
39#define LCD_PIXEL_ASPECT_HEIGHT 5
40
41#define LCD_PIXELFORMAT VERTICAL_PACKING
42
43/* Display colours, for screenshots and sim (0xRRGGBB) */
44#define LCD_DARKCOLOR 0x000000
45#define LCD_BRIGHTCOLOR 0x5a915a
46#define LCD_BL_DARKCOLOR 0x000000
47#define LCD_BL_BRIGHTCOLOR 0x7ee57e
48
49/* define this if you have a Recorder style 10-key keyboard */
50#define CONFIG_KEYPAD RECORDER_PAD
51
52/* Define this to enable morse code input */
53#define HAVE_MORSE_INPUT
54
55/* define this if you have a real-time clock */
56#define CONFIG_RTC RTC_M41ST84W
57
58/* FM recorders can wake up from RTC alarm */
59#define HAVE_RTC_ALARM
60
61/* define this if you have RTC RAM available for settings */
62#define HAVE_RTC_RAM
63
64/* Define this if you have a software controlled poweroff */
65#define HAVE_SW_POWEROFF
66
67/* The number of bytes reserved for loadable plugins */
68#define PLUGIN_BUFFER_SIZE 0x8000
69
70#ifndef BOOTLOADER
71/* Define this if you have an FM Radio */
72#define CONFIG_TUNER S1A0903X01
73#endif
74
75#define AB_REPEAT_ENABLE
76
77/* Define this if you have a MAS3587F */
78#define CONFIG_CODEC MAS3587F
79
80/* Define this for LCD backlight available */
81#define HAVE_BACKLIGHT
82
83/* define this if you have a disk storage, i.e. something
84 that needs spinups and can cause skips when shaked */
85#define HAVE_DISK_STORAGE
86
87#define CONFIG_I2C I2C_PLAYREC
88
89#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
90#define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */
91#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
92#define BATTERY_CAPACITY_INC 50 /* capacity increment */
93#define BATTERY_TYPES_COUNT 1 /* only one type */
94
95#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
96
97#define CURRENT_NORMAL 145 /* usual current in mA */
98#define CURRENT_RECORD 35 /* additional recording current */
99#define CURRENT_USB 500 /* usual current in mA in USB mode */
100
101/* Hardware controlled charging with monitoring */
102#define CONFIG_CHARGING CHARGING_MONITOR
103
104/* define this if the unit can be powered or charged via USB */
105#define HAVE_USB_POWER
106
107/* Define this if you have a SH7034 */
108#define CONFIG_CPU SH7034
109
110/* Define this if you have a FM Recorder key system */
111#define HAVE_FMADC
112
113/* Define this if battery voltage can only be measured with ATA powered */
114#define NEED_ATA_POWER_BATT_MEASURE
115
116/* Define this to the CPU frequency */
117#define CPU_FREQ 11059200
118
119/* Offset ( in the firmware file's header ) to the file length */
120#define FIRMWARE_OFFSET_FILE_LENGTH 20
121
122/* Offset ( in the firmware file's header ) to the file CRC */
123#define FIRMWARE_OFFSET_FILE_CRC 6
124
125/* Offset ( in the firmware file's header ) to the real data */
126#define FIRMWARE_OFFSET_FILE_DATA 24
127
128/* The start address index for ROM builds */
129/* #define ROM_START 0x14010 for behind original Archos */
130#define ROM_START 0x7010 /* for behind BootBox */
131
132/* Software controlled LED */
133#define CONFIG_LED LED_REAL
134
135#define CONFIG_LCD LCD_SSD1815
136
137#define BOOTFILE_EXT "ajz"
138#define BOOTFILE "ajbrec." BOOTFILE_EXT
139#define BOOTDIR "/"
140
141#define HAVE_LCD_CONTRAST
142
143#define MIN_CONTRAST_SETTING 5
144#define MAX_CONTRAST_SETTING 63
145
146/* Define this if a programmable hotkey is mapped */
147#define HAVE_HOTKEY
diff --git a/firmware/export/config/archosondiofm.h b/firmware/export/config/archosondiofm.h
deleted file mode 100644
index 68ecc217c1..0000000000
--- a/firmware/export/config/archosondiofm.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/* define this if you have recording possibility */
2#define HAVE_RECORDING
3
4#define MODEL_NAME "Ondio FM"
5
6#define ONDIO_SERIES
7
8/* Define bitmask of input sources - recordable bitmask can be defined
9 explicitly if different */
10#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
11
12/* define this if you have a bitmap LCD display */
13#define HAVE_LCD_BITMAP
14
15/* define this if you can flip your LCD */
16#define HAVE_LCD_FLIP
17
18/* define this if you can invert the colours on your LCD */
19#define HAVE_LCD_INVERT
20
21/* define this if you would like tagcache to build on this target */
22#define HAVE_TAGCACHE
23
24/* LCD dimensions */
25#define LCD_WIDTH 112
26#define LCD_HEIGHT 64
27/* sqrt(112^2 + 64^2) / 1.5 = 83.8 */
28#define LCD_DPI 84
29#define LCD_DEPTH 1
30
31#define LCD_PIXEL_ASPECT_WIDTH 4
32#define LCD_PIXEL_ASPECT_HEIGHT 5
33
34#define LCD_PIXELFORMAT VERTICAL_PACKING
35
36/* Display colours, for screenshots and sim (0xRRGGBB) */
37#define LCD_DARKCOLOR 0x000000
38#define LCD_BRIGHTCOLOR 0x5a915a
39#define LCD_BL_DARKCOLOR 0x000000
40#define LCD_BL_BRIGHTCOLOR 0x82b4fa
41
42/* define this if you have an Ondio style 6-key keyboard */
43#define CONFIG_KEYPAD ONDIO_PAD
44
45/* Define this to enable morse code input */
46#define HAVE_MORSE_INPUT
47
48#define AB_REPEAT_ENABLE
49#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
50
51/* Define this if you have a software controlled poweroff */
52#define HAVE_SW_POWEROFF
53
54/* The number of bytes reserved for loadable plugins */
55#define PLUGIN_BUFFER_SIZE 0x8000
56
57#ifndef BOOTLOADER
58/* Define this if you have an FM Radio */
59#define CONFIG_TUNER (S1A0903X01 | TEA5767) /* to be decided at runtime */
60#define CONFIG_TUNER_XTAL 13000000
61#endif
62
63/* Define this if you have a MAS3587F */
64#define CONFIG_CODEC MAS3587F
65
66/* define this if you have a flash memory storage */
67#define HAVE_FLASH_STORAGE
68
69#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */
70#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
71#define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */
72#define BATTERY_CAPACITY_INC 50 /* capacity increment */
73#define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */
74
75#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
76
77/* define this if the unit should not shut down on low battery. */
78#define NO_LOW_BATTERY_SHUTDOWN
79
80/* define this if the unit can be powered or charged via USB */
81#define HAVE_USB_POWER
82
83/* define current usage levels */
84#define CURRENT_NORMAL 95 /* average, nearly proportional to 1/U */
85#define CURRENT_USB 1 /* host powered in USB mode; avoid zero-div */
86#define CURRENT_BACKLIGHT 0 /* no backlight */
87
88/* Define this if you have a SH7034 */
89#define CONFIG_CPU SH7034
90
91/* Define this to the CPU frequency */
92#define CPU_FREQ 12000000
93
94/* Define this for different I2C pinout */
95#define CONFIG_I2C I2C_ONDIO
96
97/* Offset ( in the firmware file's header ) to the file length */
98#define FIRMWARE_OFFSET_FILE_LENGTH 20
99
100/* Offset ( in the firmware file's header ) to the file CRC */
101#define FIRMWARE_OFFSET_FILE_CRC 6
102
103/* Offset ( in the firmware file's header ) to the real data */
104#define FIRMWARE_OFFSET_FILE_DATA 24
105
106/* Define this if the tuner is switched on by software */
107#define HAVE_TUNER_PWR_CTRL
108
109/* The start address index for ROM builds */
110/* #define ROM_START 0x16010 for behind original Archos */
111#define ROM_START 0x7010 /* for behind BootBox */
112
113/* Define this if the display is mounted upside down */
114#define HAVE_DISPLAY_FLIPPED
115
116/* Define this for different ADC channel assignment */
117#define HAVE_ONDIO_ADC
118
119/* Define this for MMC support instead of ATA harddisk */
120#define CONFIG_STORAGE STORAGE_MMC
121
122/* Define this to support mounting FAT16 partitions */
123#define HAVE_FAT16SUPPORT
124
125/* Define this if the MAS SIBI line can be controlled via PB8 */
126#define HAVE_MAS_SIBI_CONTROL
127
128/* define this if more than one device/partition can be used */
129#define HAVE_MULTIDRIVE
130#define NUM_DRIVES 2
131
132/* define this if media can be exchanged on the fly */
133#define HAVE_HOTSWAP
134
135#define CONFIG_LCD LCD_SSD1815
136
137#define BOOTFILE_EXT "ajz"
138#define BOOTFILE "ajbrec." BOOTFILE_EXT
139#define BOOTDIR "/"
140
141#define HAVE_LCD_CONTRAST
142
143#define MIN_CONTRAST_SETTING 5
144#define MAX_CONTRAST_SETTING 63
145
146/* Define this if a programmable hotkey is mapped */
147//#define HAVE_HOTKEY
diff --git a/firmware/export/config/archosondiosp.h b/firmware/export/config/archosondiosp.h
deleted file mode 100644
index 3e9de1eda6..0000000000
--- a/firmware/export/config/archosondiosp.h
+++ /dev/null
@@ -1,131 +0,0 @@
1/* define this if you have a bitmap LCD display */
2#define HAVE_LCD_BITMAP
3
4#define MODEL_NAME "Ondio SP"
5
6#define ONDIO_SERIES
7
8/* define this if you can flip your LCD */
9#define HAVE_LCD_FLIP
10
11/* define this if you can invert the colours on your LCD */
12#define HAVE_LCD_INVERT
13
14/* define this if you would like tagcache to build on this target */
15#define HAVE_TAGCACHE
16
17/* LCD dimensions */
18#define LCD_WIDTH 112
19#define LCD_HEIGHT 64
20/* sqrt(112^2 + 64^2) / 1.5 = 83.8 */
21#define LCD_DPI 84
22#define LCD_DEPTH 1
23
24#define LCD_PIXEL_ASPECT_WIDTH 4
25#define LCD_PIXEL_ASPECT_HEIGHT 5
26
27#define LCD_PIXELFORMAT VERTICAL_PACKING
28
29/* Display colours, for screenshots and sim (0xRRGGBB) */
30#define LCD_DARKCOLOR 0x000000
31#define LCD_BRIGHTCOLOR 0x5a915a
32#define LCD_BL_DARKCOLOR 0x000000
33#define LCD_BL_BRIGHTCOLOR 0x82b4fa
34
35/* define this if you have an Ondio style 6-key keyboard */
36#define CONFIG_KEYPAD ONDIO_PAD
37
38/* Define this to enable morse code input */
39#define HAVE_MORSE_INPUT
40
41#define AB_REPEAT_ENABLE
42#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
43
44/* Define this if you have a software controlled poweroff */
45#define HAVE_SW_POWEROFF
46
47/* The number of bytes reserved for loadable plugins */
48#define PLUGIN_BUFFER_SIZE 0x8000
49
50/* Define this if you have a MAS3539F */
51#define CONFIG_CODEC MAS3539F
52
53/* define this if you have a flash memory storage */
54#define HAVE_FLASH_STORAGE
55
56#define BATTERY_CAPACITY_DEFAULT 1000 /* default battery capacity */
57#define BATTERY_CAPACITY_MIN 500 /* min. capacity selectable */
58#define BATTERY_CAPACITY_MAX 1500 /* max. capacity selectable */
59#define BATTERY_CAPACITY_INC 50 /* capacity increment */
60#define BATTERY_TYPES_COUNT 2 /* Alkalines or NiMH */
61
62#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
63
64/* define this if the unit should not shut down on low battery. */
65#define NO_LOW_BATTERY_SHUTDOWN
66
67/* define this if the unit can be powered or charged via USB */
68#define HAVE_USB_POWER
69
70/* define current usage levels */
71#define CURRENT_NORMAL 95 /* average, nearly proportional to 1/U */
72#define CURRENT_USB 1 /* host powered in USB mode; avoid zero-div */
73#define CURRENT_BACKLIGHT 0 /* no backlight */
74
75/* Define this if you have a SH7034 */
76#define CONFIG_CPU SH7034
77
78/* Define this to the CPU frequency */
79#define CPU_FREQ 12000000
80
81/* Offset ( in the firmware file's header ) to the file length */
82#define FIRMWARE_OFFSET_FILE_LENGTH 20
83
84/* Offset ( in the firmware file's header ) to the file CRC */
85#define FIRMWARE_OFFSET_FILE_CRC 6
86
87/* Offset ( in the firmware file's header ) to the real data */
88#define FIRMWARE_OFFSET_FILE_DATA 24
89
90/* The start address index for ROM builds */
91/* #define ROM_START 0x12010 for behind original Archos */
92#define ROM_START 0x7010 /* for behind BootBox */
93
94/* Define this if the display is mounted upside down */
95#define HAVE_DISPLAY_FLIPPED
96
97/* Define this for different I2C pinout */
98#define CONFIG_I2C I2C_ONDIO
99
100/* Define this for different ADC channel assignment */
101#define HAVE_ONDIO_ADC
102
103/* Define this for MMC support instead of ATA harddisk */
104#define CONFIG_STORAGE STORAGE_MMC
105
106/* Define this to support mounting FAT16 partitions */
107#define HAVE_FAT16SUPPORT
108
109/* Define this if the MAS SIBI line can be controlled via PB8 */
110#define HAVE_MAS_SIBI_CONTROL
111
112/* define this if more than one device/partition can be used */
113#define HAVE_MULTIDRIVE
114#define NUM_DRIVES 2
115
116/* define this if media can be exchanged on the fly */
117#define HAVE_HOTSWAP
118
119#define CONFIG_LCD LCD_SSD1815
120
121#define BOOTFILE_EXT "ajz"
122#define BOOTFILE "ajbrec." BOOTFILE_EXT
123#define BOOTDIR "/"
124
125#define HAVE_LCD_CONTRAST
126
127#define MIN_CONTRAST_SETTING 5
128#define MAX_CONTRAST_SETTING 63
129
130/* Define this if a programmable hotkey is mapped */
131//#define HAVE_HOTKEY
diff --git a/firmware/export/config/archosplayer.h b/firmware/export/config/archosplayer.h
deleted file mode 100644
index 2e0219cff5..0000000000
--- a/firmware/export/config/archosplayer.h
+++ /dev/null
@@ -1,111 +0,0 @@
1/* define this if you use an ATA controller */
2#define CONFIG_STORAGE STORAGE_ATA
3
4#define MODEL_NAME "Archos Player/Studio"
5
6/* define this if you have a charcell LCD display */
7#define HAVE_LCD_CHARCELLS
8
9/* define this if you would like tagcache to build on this target */
10#define HAVE_TAGCACHE
11
12#define LCD_WIDTH 11
13#define LCD_HEIGHT 2
14/* sqrt(11^2 + 2^2) / 1.5 = 7.5 */
15#define LCD_DPI 7
16#define LCD_DEPTH 1
17#define SIM_LCD_WIDTH 132 /* pixels */
18#define SIM_LCD_HEIGHT 64 /* pixels */
19
20/* Display colours, for screenshots and sim (0xRRGGBB) */
21#define LCD_DARKCOLOR 0x000000
22#define LCD_BRIGHTCOLOR 0x5a915a
23#define LCD_BL_DARKCOLOR 0x000000
24#define LCD_BL_BRIGHTCOLOR 0x7ee57e
25
26/* define this if you have the Player's keyboard */
27#define CONFIG_KEYPAD PLAYER_PAD
28
29#define AB_REPEAT_ENABLE
30#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
31
32/* The number of bytes reserved for loadable plugins */
33#define PLUGIN_BUFFER_SIZE 0x8000
34
35/* Define this if you have a MAS3507D */
36#define CONFIG_CODEC MAS3507D
37
38/* Define this if you have a DAC3550A */
39#define HAVE_DAC3550A
40
41/* define this if you have a disk storage, i.e. something
42 that needs spinups and can cause skips when shaked */
43#define HAVE_DISK_STORAGE
44
45/* Define this for LCD backlight available */
46#define HAVE_BACKLIGHT
47
48#define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */
49#define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */
50#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
51#define BATTERY_CAPACITY_INC 50 /* capacity increment */
52#define BATTERY_TYPES_COUNT 1 /* only one type */
53
54#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
55
56#define CURRENT_NORMAL 145 /* usual current in mA */
57#define CURRENT_USB 500 /* usual current in mA in USB mode */
58
59/* define this if the unit should not shut down on low battery. */
60#define NO_LOW_BATTERY_SHUTDOWN
61
62/* Hardware controlled charging */
63#define CONFIG_CHARGING CHARGING_SIMPLE
64
65/* Define this if you have a SH7034 */
66#define CONFIG_CPU SH7034
67
68/* Define this if you control ata power player style
69 (with PB4, new player only) */
70#define ATA_POWER_PLAYERSTYLE
71
72/* Define this to the CPU frequency */
73#define CPU_FREQ 12000000 /* cycle time ~83.3ns */
74
75/* Define this if you must discharge the data line by driving it low
76 and then set it to input to see if it stays low or goes high */
77#define HAVE_I2C_LOW_FIRST
78
79#define CONFIG_I2C I2C_PLAYREC
80
81/* Offset ( in the firmware file's header ) to the file length */
82#define FIRMWARE_OFFSET_FILE_LENGTH 0
83
84/* Offset ( in the firmware file's header ) to the file CRC */
85#define FIRMWARE_OFFSET_FILE_CRC 4
86
87/* Offset ( in the firmware file's header ) to the real data */
88#define FIRMWARE_OFFSET_FILE_DATA 6
89
90/* The start address index for ROM builds */
91#define ROM_START 0x7010 /* for behind BootBox */
92
93/* Software controlled LED */
94#define CONFIG_LED LED_REAL
95
96#define CONFIG_LCD LCD_SSD1801
97
98#define BOOTFILE_EXT "mod"
99#define BOOTFILE "archos." BOOTFILE_EXT
100#define BOOTDIR "/"
101
102#define HAVE_LCD_CONTRAST
103
104#define MIN_CONTRAST_SETTING 5
105#define MAX_CONTRAST_SETTING 31
106#define DEFAULT_CONTRAST_SETTING 30
107
108#define HAVE_SERIAL
109
110/* Define this if a programmable hotkey is mapped */
111#define HAVE_HOTKEY
diff --git a/firmware/export/config/archosrecorder.h b/firmware/export/config/archosrecorder.h
deleted file mode 100644
index 016ea8b944..0000000000
--- a/firmware/export/config/archosrecorder.h
+++ /dev/null
@@ -1,141 +0,0 @@
1/* define this if you use an ATA controller */
2#define CONFIG_STORAGE STORAGE_ATA
3
4#define MODEL_NAME "Archos Recorder"
5
6/* define this if you have recording possibility */
7#define HAVE_RECORDING
8
9/* Define bitmask of input sources - recordable bitmask can be defined
10 explicitly if different */
11#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
12
13/* define this if you have a bitmap LCD display */
14#define HAVE_LCD_BITMAP
15
16/* define this if you can flip your LCD */
17//#define HAVE_LCD_FLIP
18
19/* define this if you can invert the colours on your LCD */
20#define HAVE_LCD_INVERT
21
22/* define this if you have access to the quickscreen */
23#define HAVE_QUICKSCREEN
24
25/* define this if you have the button bar */
26#define HAVE_BUTTONBAR
27
28/* define this if you would like tagcache to build on this target */
29#define HAVE_TAGCACHE
30
31/* LCD dimensions */
32#define LCD_WIDTH 112
33#define LCD_HEIGHT 64
34/* sqrt(112^2 + 64^2) / 1.5 = 85.4 */
35#define LCD_DPI 85
36#define LCD_DEPTH 1
37
38#define LCD_PIXEL_ASPECT_WIDTH 4
39#define LCD_PIXEL_ASPECT_HEIGHT 5
40
41#define LCD_PIXELFORMAT VERTICAL_PACKING
42
43/* Display colours, for screenshots and sim (0xRRGGBB) */
44#define LCD_DARKCOLOR 0x000000
45#define LCD_BRIGHTCOLOR 0x5a915a
46#define LCD_BL_DARKCOLOR 0x000000
47#define LCD_BL_BRIGHTCOLOR 0x7ee57e
48
49/* define this if you have the Recorder's 10-key keyboard */
50#define CONFIG_KEYPAD RECORDER_PAD
51
52/* Define this to enable morse code input */
53//#define HAVE_MORSE_INPUT
54
55/* define this if you have a real-time clock */
56#define CONFIG_RTC RTC_M41ST84W
57
58/* define this if you have RTC RAM available for settings */
59#define HAVE_RTC_RAM
60
61/* The number of bytes reserved for loadable plugins */
62#define PLUGIN_BUFFER_SIZE 0x8000
63
64#define AB_REPEAT_ENABLE
65
66/* Define this if you have a MAS3587F */
67#define CONFIG_CODEC MAS3587F
68
69/* define this if you have a disk storage, i.e. something
70 that needs spinups and can cause skips when shaked */
71#define HAVE_DISK_STORAGE
72
73/* Define this for LCD backlight available */
74#define HAVE_BACKLIGHT
75
76#define CONFIG_I2C I2C_PLAYREC
77
78#define BATTERY_CAPACITY_DEFAULT 1500 /* default battery capacity */
79#define BATTERY_CAPACITY_MIN 1500 /* min. capacity selectable */
80#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
81#define BATTERY_CAPACITY_INC 50 /* capacity increment */
82#define BATTERY_TYPES_COUNT 1 /* only one type */
83
84#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
85
86#if MEMORYSIZE < 8
87 #define CURRENT_NORMAL 145 /* usual current in mA */
88#else
89 #define CURRENT_NORMAL 145 *100 / 122 /* assuming 192 kbps, the running time is 22% longer with 8MB */
90#endif
91#define CURRENT_RECORD 35 /* additional recording current */
92#define CURRENT_USB 500 /* usual current in mA in USB mode */
93
94/* define this if the unit should not shut down on low battery. */
95#define NO_LOW_BATTERY_SHUTDOWN
96
97/* Software controlled charging */
98#define CONFIG_CHARGING CHARGING_TARGET
99
100/* Define this if you have a SH7034 */
101#define CONFIG_CPU SH7034
102
103/* Define this if you have ATA power-off control */
104#define HAVE_ATA_POWER_OFF
105
106/* Define this to the CPU frequency */
107#define CPU_FREQ 11059200
108
109/* Offset ( in the firmware file's header ) to the file length */
110#define FIRMWARE_OFFSET_FILE_LENGTH 0
111
112/* Offset ( in the firmware file's header ) to the file CRC */
113#define FIRMWARE_OFFSET_FILE_CRC 4
114
115/* Offset ( in the firmware file's header ) to the real data */
116#define FIRMWARE_OFFSET_FILE_DATA 6
117
118/* The start address index for ROM builds */
119/* #define ROM_START 0x11010 for behind original Archos */
120#define ROM_START 0x7010 /* for behind BootBox */
121
122/* Software controlled LED */
123#define CONFIG_LED LED_REAL
124
125/* Define this for S/PDIF output available */
126#define HAVE_SPDIF_OUT
127
128#define CONFIG_LCD LCD_SSD1815
129
130#define BOOTFILE_EXT "ajz"
131#define BOOTFILE "ajbrec." BOOTFILE_EXT
132#define BOOTDIR "/"
133
134#define HAVE_LCD_CONTRAST
135
136#define MIN_CONTRAST_SETTING 5
137#define MAX_CONTRAST_SETTING 63
138
139#define HAVE_SERIAL
140/* Define this if a programmable hotkey is mapped */
141#define HAVE_HOTKEY
diff --git a/firmware/export/config/archosrecorderv2.h b/firmware/export/config/archosrecorderv2.h
deleted file mode 100644
index 4640eae247..0000000000
--- a/firmware/export/config/archosrecorderv2.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/* define this if you use an ATA controller */
2#define CONFIG_STORAGE STORAGE_ATA
3
4#define MODEL_NAME "Archos Recorder v2"
5
6/* define this if you have recording possibility */
7#define HAVE_RECORDING
8
9/* Define bitmask of input sources - recordable bitmask can be defined
10 explicitly if different */
11#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
12
13/* define this if you have a bitmap LCD display */
14#define HAVE_LCD_BITMAP
15
16/* define this if you can flip your LCD */
17#define HAVE_LCD_FLIP
18
19/* define this if you can invert the colours on your LCD */
20#define HAVE_LCD_INVERT
21
22/* define this if you have access to the quickscreen */
23#define HAVE_QUICKSCREEN
24
25/* define this if you have the button bar */
26#define HAVE_BUTTONBAR
27
28/* define this if you would like tagcache to build on this target */
29#define HAVE_TAGCACHE
30
31/* LCD dimensions */
32#define LCD_WIDTH 112
33#define LCD_HEIGHT 64
34/* sqrt(112^2 + 64^2) / 1.5 = 85.4 */
35#define LCD_DPI 85
36#define LCD_DEPTH 1
37
38#define LCD_PIXEL_ASPECT_WIDTH 4
39#define LCD_PIXEL_ASPECT_HEIGHT 5
40
41#define LCD_PIXELFORMAT VERTICAL_PACKING
42
43/* Display colours, for screenshots and sim (0xRRGGBB) */
44#define LCD_DARKCOLOR 0x000000
45#define LCD_BRIGHTCOLOR 0x5a915a
46#define LCD_BL_DARKCOLOR 0x000000
47#define LCD_BL_BRIGHTCOLOR 0x7ee57e
48
49/* define this if you have a Recorder style 10-key keyboard */
50#define CONFIG_KEYPAD RECORDER_PAD
51
52/* Define this to enable morse code input */
53#define HAVE_MORSE_INPUT
54
55/* define this if you have a real-time clock */
56#define CONFIG_RTC RTC_M41ST84W
57
58/* FM recorders can wake up from RTC alarm */
59#define HAVE_RTC_ALARM
60
61/* define this if you have RTC RAM available for settings */
62#define HAVE_RTC_RAM
63
64/* Define this if you have a software controlled poweroff */
65#define HAVE_SW_POWEROFF
66
67/* The number of bytes reserved for loadable plugins */
68#define PLUGIN_BUFFER_SIZE 0x8000
69
70#define AB_REPEAT_ENABLE
71
72/* Define this if you have a MAS3587F */
73#define CONFIG_CODEC MAS3587F
74
75/* define this if you have a disk storage, i.e. something
76 that needs spinups and can cause skips when shaked */
77#define HAVE_DISK_STORAGE
78
79/* Define this for LCD backlight available */
80#define HAVE_BACKLIGHT
81
82#define CONFIG_I2C I2C_PLAYREC
83
84#define BATTERY_CAPACITY_DEFAULT 2200 /* default battery capacity */
85#define BATTERY_CAPACITY_MIN 2200 /* min. capacity selectable */
86#define BATTERY_CAPACITY_MAX 3200 /* max. capacity selectable */
87#define BATTERY_CAPACITY_INC 50 /* capacity increment */
88#define BATTERY_TYPES_COUNT 1 /* only one type */
89
90#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE
91
92#define CURRENT_NORMAL 145 /* usual current in mA */
93#define CURRENT_RECORD 35 /* additional recording current */
94#define CURRENT_USB 500 /* usual current in mA in USB mode */
95
96/* Hardware controlled charging with monitoring */
97#define CONFIG_CHARGING CHARGING_MONITOR
98
99/* define this if the unit can be powered or charged via USB */
100#define HAVE_USB_POWER
101
102/* Define this if you have a SH7034 */
103#define CONFIG_CPU SH7034
104
105/* Define this if you have a FM Recorder key system */
106#define HAVE_FMADC
107
108/* Define this if battery voltage can only be measured with ATA powered */
109#define NEED_ATA_POWER_BATT_MEASURE
110
111/* Define this to the CPU frequency */
112#define CPU_FREQ 11059200
113
114/* Offset ( in the firmware file's header ) to the file length */
115#define FIRMWARE_OFFSET_FILE_LENGTH 20
116
117/* Offset ( in the firmware file's header ) to the file CRC */
118#define FIRMWARE_OFFSET_FILE_CRC 6
119
120/* Offset ( in the firmware file's header ) to the real data */
121#define FIRMWARE_OFFSET_FILE_DATA 24
122
123#ifndef BOOTLOADER
124/* Define this if you have an FM Radio */
125#define CONFIG_TUNER S1A0903X01
126#endif
127
128/* The start address index for ROM builds */
129/* #define ROM_START 0x12010 for behind original Archos */
130#define ROM_START 0x7010 /* for behind BootBox */
131
132/* Software controlled LED */
133#define CONFIG_LED LED_REAL
134
135#define CONFIG_LCD LCD_SSD1815
136
137#define BOOTFILE_EXT "ajz"
138#define BOOTFILE "ajbrec." BOOTFILE_EXT
139#define BOOTDIR "/"
140
141#define HAVE_LCD_CONTRAST
142
143#define MIN_CONTRAST_SETTING 5
144#define MAX_CONTRAST_SETTING 63
145
146/* Define this if a programmable hotkey is mapped */
147#define HAVE_HOTKEY
diff --git a/firmware/export/cpu.h b/firmware/export/cpu.h
index 201ffba656..aade199dd2 100644
--- a/firmware/export/cpu.h
+++ b/firmware/export/cpu.h
@@ -20,9 +20,6 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "config.h" 21#include "config.h"
22 22
23#if CONFIG_CPU == SH7034
24#include "sh7034.h"
25#endif
26#if CONFIG_CPU == MCF5249 23#if CONFIG_CPU == MCF5249
27#include "mcf5249.h" 24#include "mcf5249.h"
28#endif 25#endif
diff --git a/firmware/export/hwcompat.h b/firmware/export/hwcompat.h
index c37add49f9..ea167a4adf 100644
--- a/firmware/export/hwcompat.h
+++ b/firmware/export/hwcompat.h
@@ -24,37 +24,6 @@
24#include <stdbool.h> 24#include <stdbool.h>
25#include "config.h" 25#include "config.h"
26 26
27#if (CONFIG_CPU == SH7034) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
28
29#define ROM_VERSION (*(short *)0x020000fe)
30
31/* Bit mask values for HW compatibility */
32#define ATA_ADDRESS_200 0x0100
33#define USB_ACTIVE_HIGH 0x0100
34#define PR_ACTIVE_HIGH 0x0100
35#define LCD_CONTRAST_BIAS 0x0200
36#define MMC_CLOCK_POLARITY 0x0400
37#define TUNER_MODEL 0x0800
38
39#ifdef ARCHOS_PLAYER
40#define HW_MASK 0
41#else /* Recorders, Ondios */
42#define HW_MASK (*(short *)0x020000fc)
43#endif
44
45#ifdef CONFIG_TUNER_MULTI
46static inline int tuner_detect_type(void)
47{
48 return (HW_MASK & TUNER_MODEL) ? TEA5767 : S1A0903X01;
49}
50#endif
51
52#endif /* (CONFIG_CPU == SH7034) && (CONFIG_PLATFORM & PLATFORM_NATIVE) */
53
54#ifdef ARCHOS_PLAYER
55bool is_new_player(void);
56#endif
57
58#ifdef IPOD_ARCH 27#ifdef IPOD_ARCH
59#ifdef IPOD_VIDEO 28#ifdef IPOD_VIDEO
60#ifdef BOOTLOADER 29#ifdef BOOTLOADER
diff --git a/firmware/export/mas35xx.h b/firmware/export/mas35xx.h
deleted file mode 100644
index 02691f3de2..0000000000
--- a/firmware/export/mas35xx.h
+++ /dev/null
@@ -1,292 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Implementation of MAS35xx audiohw api driver.
11 *
12 * Copyright (C) 2007 by Christian Gmeiner
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
21 *
22 ****************************************************************************/
23
24#ifndef _MAS35XX_H
25#define _MAS35XX_H
26
27#include "config.h"
28#include "mascodec.h"
29
30#define MAS_BANK_D0 0
31#define MAS_BANK_D1 1
32
33/* registers common to all MAS35xx */
34#define MAS_REG_DCCF 0x8e
35#define MAS_REG_MUTE 0xaa
36#define MAS_REG_PIODATA 0xc8
37#define MAS_REG_StartUpConfig 0xe6
38#define MAS_REG_KPRESCALE 0xe7
39
40#if CONFIG_CODEC == MAS3507D
41
42#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | PRESCALER_CAP)
43
44AUDIOHW_SETTING(VOLUME, "dB", 0, 1, -78, 18, -18)
45AUDIOHW_SETTING(BASS, "dB", 0, 1, -15, 15, 7)
46AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -15, 15, 7)
47
48/* I2C defines */
49#define MAS_ADR 0x3a
50#define MAS_DEV_WRITE (MAS_ADR | 0x00)
51#define MAS_DEV_READ (MAS_ADR | 0x01)
52
53/* MAS3507D registers */
54#define MAS_DATA_WRITE 0x68
55#define MAS_DATA_READ 0x69
56#define MAS_CONTROL 0x6a
57
58#define MAS_REG_KBASS 0x6b
59#define MAS_REG_KTREBLE 0x6f
60
61/* MAS3507D commands */
62#define MAS_CMD_READ_ANCILLARY 0x30
63#define MAS_CMD_WRITE_REG 0x90
64#define MAS_CMD_WRITE_D0_MEM 0xa0
65#define MAS_CMD_WRITE_D1_MEM 0xb0
66#define MAS_CMD_READ_REG 0xd0
67#define MAS_CMD_READ_D0_MEM 0xe0
68#define MAS_CMD_READ_D1_MEM 0xf0
69
70/* MAS3507D D0 memmory cells */
71#define MAS_D0_MPEG_FRAME_COUNT 0x300
72#define MAS_D0_MPEG_STATUS_1 0x301
73#define MAS_D0_MPEG_STATUS_2 0x302
74#define MAS_D0_CRC_ERROR_COUNT 0x303
75#define MAS_D0_OUT_LL 0x7f8
76#define MAS_D0_OUT_LR 0x7f9
77#define MAS_D0_OUT_RL 0x7fa
78#define MAS_D0_OUT_RR 0x7fb
79
80static const unsigned int bass_table[] =
81{
82 0x9e400, /* -15dB */
83 0xa2800, /* -14dB */
84 0xa7400, /* -13dB */
85 0xac400, /* -12dB */
86 0xb1800, /* -11dB */
87 0xb7400, /* -10dB */
88 0xbd400, /* -9dB */
89 0xc3c00, /* -8dB */
90 0xca400, /* -7dB */
91 0xd1800, /* -6dB */
92 0xd8c00, /* -5dB */
93 0xe0400, /* -4dB */
94 0xe8000, /* -3dB */
95 0xefc00, /* -2dB */
96 0xf7c00, /* -1dB */
97 0,
98 0x800, /* 1dB */
99 0x10000, /* 2dB */
100 0x17c00, /* 3dB */
101 0x1f800, /* 4dB */
102 0x27000, /* 5dB */
103 0x2e400, /* 6dB */
104 0x35800, /* 7dB */
105 0x3c000, /* 8dB */
106 0x42800, /* 9dB */
107 0x48800, /* 10dB */
108 0x4e400, /* 11dB */
109 0x53800, /* 12dB */
110 0x58800, /* 13dB */
111 0x5d400, /* 14dB */
112 0x61800 /* 15dB */
113};
114
115static const unsigned int treble_table[] =
116{
117 0xb2c00, /* -15dB */
118 0xbb400, /* -14dB */
119 0xc1800, /* -13dB */
120 0xc6c00, /* -12dB */
121 0xcbc00, /* -11dB */
122 0xd0400, /* -10dB */
123 0xd5000, /* -9dB */
124 0xd9800, /* -8dB */
125 0xde000, /* -7dB */
126 0xe2800, /* -6dB */
127 0xe7e00, /* -5dB */
128 0xec000, /* -4dB */
129 0xf0c00, /* -3dB */
130 0xf5c00, /* -2dB */
131 0xfac00, /* -1dB */
132 0,
133 0x5400, /* 1dB */
134 0xac00, /* 2dB */
135 0x10400, /* 3dB */
136 0x16000, /* 4dB */
137 0x1c000, /* 5dB */
138 0x22400, /* 6dB */
139 0x28400, /* 7dB */
140 0x2ec00, /* 8dB */
141 0x35400, /* 9dB */
142 0x3c000, /* 10dB */
143 0x42c00, /* 11dB */
144 0x49c00, /* 12dB */
145 0x51800, /* 13dB */
146 0x58400, /* 14dB */
147 0x5f800 /* 15dB */
148};
149
150static const unsigned int prescale_table[] =
151{
152 0x80000, /* 0db */
153 0x8e000, /* 1dB */
154 0x9a400, /* 2dB */
155 0xa5800, /* 3dB */
156 0xaf400, /* 4dB */
157 0xb8000, /* 5dB */
158 0xbfc00, /* 6dB */
159 0xc6c00, /* 7dB */
160 0xcd000, /* 8dB */
161 0xd25c0, /* 9dB */
162 0xd7800, /* 10dB */
163 0xdc000, /* 11dB */
164 0xdfc00, /* 12dB */
165 0xe3400, /* 13dB */
166 0xe6800, /* 14dB */
167 0xe9400 /* 15dB */
168};
169
170#else /* CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F */
171
172AUDIOHW_SETTING(VOLUME, "dB", 0, 1,-100, 12, -25)
173AUDIOHW_SETTING(BASS, "dB", 0, 1, -12, 12, 6)
174AUDIOHW_SETTING(TREBLE, "dB", 0, 1, -12, 12, 6)
175AUDIOHW_SETTING(LOUDNESS, "dB", 0, 1, 0, 17, 0)
176AUDIOHW_SETTING(AVC, "", 0, 1, -1, 4, 0)
177AUDIOHW_SETTING(MDB_STRENGTH, "dB", 0, 1, 0, 127, 48)
178AUDIOHW_SETTING(MDB_HARMONICS, "%", 0, 1, 0, 100, 50)
179AUDIOHW_SETTING(MDB_CENTER, "Hz", 0, 10, 20, 300, 60)
180AUDIOHW_SETTING(MDB_SHAPE, "Hz", 0, 10, 50, 300, 90)
181AUDIOHW_SETTING(MDB_ENABLE, "", 0, 1, 0, 1, 0)
182AUDIOHW_SETTING(SUPERBASS, "", 0, 1, 0, 1, 0)
183
184#if CONFIG_CODEC == MAS3587F && defined(HAVE_RECORDING)
185/* MAS3587F and MAS3539F handle clipping prevention internally so we do not
186 * need the prescaler -> CLIPPING_CAP */
187#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BALANCE_CAP | CLIPPING_CAP | \
188 MONO_VOL_CAP | LIN_GAIN_CAP | MIC_GAIN_CAP)
189AUDIOHW_SETTING(LEFT_GAIN, "dB", 1, 1, 0, 15, 8, (val - 2) * 15)
190AUDIOHW_SETTING(RIGHT_GAIN, "dB", 1, 1, 0, 15, 8, (val - 2) * 15)
191AUDIOHW_SETTING(MIC_GAIN, "dB", 1, 1, 0, 15, 2, val * 15 + 210)
192#else
193/* MAS3587F and MAS3539F handle clipping prevention internally so we do not
194 * need the prescaler -> CLIPPING_CAP */
195#define AUDIOHW_CAPS (BASS_CAP | TREBLE_CAP | BALANCE_CAP | CLIPPING_CAP | \
196 MONO_VOL_CAP)
197#endif /* MAS3587F && HAVE_RECORDING */
198
199/* I2C defines */
200#define MAS_ADR 0x3c
201#define MAS_DEV_WRITE (MAS_ADR | 0x00)
202#define MAS_DEV_READ (MAS_ADR | 0x01)
203
204/* MAS3587F/MAS3539F registers */
205#define MAS_DATA_WRITE 0x68
206#define MAS_DATA_READ 0x69
207#define MAS_CODEC_WRITE 0x6c
208#define MAS_CODEC_READ 0x6d
209#define MAS_CONTROL 0x6a
210#define MAS_DCCF 0x76
211#define MAS_DCFR 0x77
212
213#define MAS_REG_KMDB_SWITCH 0x21
214#define MAS_REG_KMDB_STR 0x22
215#define MAS_REG_KMDB_HAR 0x23
216#define MAS_REG_KMDB_FC 0x24
217#define MAS_REG_KLOUDNESS 0x1e
218#define MAS_REG_QPEAK_L 0x0a
219#define MAS_REG_QPEAK_R 0x0b
220#define MAS_REG_DQPEAK_L 0x0c
221#define MAS_REG_DQPEAK_R 0x0d
222#define MAS_REG_VOLUME_CONTROL 0x10
223#define MAS_REG_BALANCE 0x11
224#define MAS_REG_KAVC 0x12
225#define MAS_REG_KBASS 0x14
226#define MAS_REG_KTREBLE 0x15
227
228/* MAS3587F/MAS3539F commands */
229#define MAS_CMD_READ_ANCILLARY 0x50
230#define MAS_CMD_FAST_PRG_DL 0x60
231#define MAS_CMD_READ_IC_VER 0x70
232#define MAS_CMD_READ_REG 0xa0
233#define MAS_CMD_WRITE_REG 0xb0
234#define MAS_CMD_READ_D0_MEM 0xc0
235#define MAS_CMD_READ_D1_MEM 0xd0
236#define MAS_CMD_WRITE_D0_MEM 0xe0
237#define MAS_CMD_WRITE_D1_MEM 0xf0
238
239/* MAS3587F D0 memory cells */
240#if CONFIG_CODEC == MAS3587F
241#define MAS_D0_APP_SELECT 0x7f6
242#define MAS_D0_APP_RUNNING 0x7f7
243#define MAS_D0_ENCODER_CONTROL 0x7f0
244#define MAS_D0_IO_CONTROL_MAIN 0x7f1
245#define MAS_D0_INTERFACE_CONTROL 0x7f2
246#define MAS_D0_OFREQ_CONTROL 0x7f3
247#define MAS_D0_OUT_CLK_CONFIG 0x7f4
248#define MAS_D0_SPD_OUT_BITS 0x7f8
249#define MAS_D0_SOFT_MUTE 0x7f9
250#define MAS_D0_OUT_LL 0x7fc
251#define MAS_D0_OUT_LR 0x7fd
252#define MAS_D0_OUT_RL 0x7fe
253#define MAS_D0_OUT_RR 0x7ff
254#define MAS_D0_MPEG_FRAME_COUNT 0xfd0
255#define MAS_D0_MPEG_STATUS_1 0xfd1
256#define MAS_D0_MPEG_STATUS_2 0xfd2
257#define MAS_D0_CRC_ERROR_COUNT 0xfd3
258
259/* MAS3539F D0 memory cells */
260#elif CONFIG_CODEC == MAS3539F
261#define MAS_D0_APP_SELECT 0x34b
262#define MAS_D0_APP_RUNNING 0x34c
263/* no encoder :( */
264#define MAS_D0_IO_CONTROL_MAIN 0x346
265#define MAS_D0_INTERFACE_CONTROL 0x347
266#define MAS_D0_OFREQ_CONTROL 0x348
267#define MAS_D0_OUT_CLK_CONFIG 0x349
268#define MAS_D0_SPD_OUT_BITS 0x351
269#define MAS_D0_SOFT_MUTE 0x350
270#define MAS_D0_OUT_LL 0x354
271#define MAS_D0_OUT_LR 0x355
272#define MAS_D0_OUT_RL 0x356
273#define MAS_D0_OUT_RR 0x357
274#define MAS_D0_MPEG_FRAME_COUNT 0xfd0
275#define MAS_D0_MPEG_STATUS_1 0xfd1
276#define MAS_D0_MPEG_STATUS_2 0xfd2
277#define MAS_D0_CRC_ERROR_COUNT 0xfd3
278#endif
279
280/* Function prototypes */
281extern void audiohw_set_loudness(int value);
282extern void audiohw_set_avc(int value);
283extern void audiohw_set_mdb_strength(int value);
284extern void audiohw_set_mdb_harmonics(int value);
285extern void audiohw_set_mdb_center(int value);
286extern void audiohw_set_mdb_shape(int value);
287extern void audiohw_set_mdb_enable(int value);
288extern void audiohw_set_superbass(int value);
289
290#endif /* CONFIG_CODEC */
291
292#endif /* _MAS35XX_H */
diff --git a/firmware/export/mascodec.h b/firmware/export/mascodec.h
deleted file mode 100644
index 00690ae7dd..0000000000
--- a/firmware/export/mascodec.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _MASCODEC_H_
22#define _MASCODEC_H_
23
24/* unused: int mas_default_read(unsigned short *buf); */
25#if CONFIG_CODEC == MAS3507D
26int mas_run(unsigned short address);
27#endif
28int mas_readmem(int bank, int addr, unsigned long* dest, int len);
29int mas_writemem(int bank, int addr, const unsigned long* src, int len);
30int mas_readreg(int reg);
31int mas_writereg(int reg, unsigned int val);
32void mas_reset(void);
33/* unused: int mas_direct_config_read(unsigned char reg); */
34int mas_direct_config_write(unsigned char reg, unsigned int val);
35int mas_codec_writereg(int reg, unsigned int val);
36int mas_codec_readreg(int reg);
37unsigned long mas_readver(void);
38
39#endif
40
41#if CONFIG_TUNER & S1A0903X01
42void mas_store_pllfreq(int freq);
43int mas_get_pllfreq(void);
44#endif
45
diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h
index 7434021611..51efb45651 100644
--- a/firmware/export/mp3_playback.h
+++ b/firmware/export/mp3_playback.h
@@ -39,15 +39,6 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
39 int mdb_center, int mdb_shape, bool mdb_enable, 39 int mdb_center, int mdb_shape, bool mdb_enable,
40 bool superbass); 40 bool superbass);
41 41
42/* exported just for mpeg.c, to keep the recording there */
43#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
44void demand_irq_enable(bool on);
45#endif
46
47/* new functions, exported to plugin API */
48#if CONFIG_CODEC == MAS3587F
49void mp3_play_init(void);
50#endif
51void mp3_play_data(const void* start, size_t size, 42void mp3_play_data(const void* start, size_t size,
52 mp3_play_callback_t get_more); 43 mp3_play_callback_t get_more);
53void mp3_play_pause(bool play); 44void mp3_play_pause(bool play);
diff --git a/firmware/export/rtc.h b/firmware/export/rtc.h
index 216de87dea..a668c9c729 100644
--- a/firmware/export/rtc.h
+++ b/firmware/export/rtc.h
@@ -38,16 +38,6 @@ void rtc_init(void);
38int rtc_read_datetime(struct tm *tm); 38int rtc_read_datetime(struct tm *tm);
39int rtc_write_datetime(const struct tm *tm); 39int rtc_write_datetime(const struct tm *tm);
40 40
41#if CONFIG_RTC == RTC_M41ST84W
42
43/* The RTC in the Archos devices is used for much more than just the clock
44 data */
45int rtc_read(unsigned char address);
46int rtc_read_multiple(unsigned char address, unsigned char *buf, int numbytes);
47int rtc_write(unsigned char address, unsigned char value);
48
49#endif /* RTC_M41ST84W */
50
51#ifdef HAVE_RTC_ALARM 41#ifdef HAVE_RTC_ALARM
52void rtc_set_alarm(int h, int m); 42void rtc_set_alarm(int h, int m);
53void rtc_get_alarm(int *h, int *m); 43void rtc_get_alarm(int *h, int *m);
diff --git a/firmware/export/s1a0903x01.h b/firmware/export/s1a0903x01.h
deleted file mode 100644
index d9f1a11baf..0000000000
--- a/firmware/export/s1a0903x01.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 * Tuner header for the Samsung S1A0903X01
10 *
11 * Copyright (C) 2007 Michael Sevakis
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#ifndef _S1A0903X01_H_
24#define _S1A0903X01_H_
25
26/* Define additional tuner messages here */
27#define HAVE_RADIO_MUTE_TIMEOUT
28
29#if 0
30#define S1A0903X01_IF_MEASUREMENT (RADIO_SET_CHIP_FIRST+0)
31#define S1A0903X01_SENSITIVITY (RADIO_SET_CHIP_FIRST+1)
32#endif
33
34int s1a0903x01_set(int setting, int value);
35int s1a0903x01_get(int setting);
36
37#ifndef CONFIG_TUNER_MULTI
38#define tuner_get s1a0903x01_get
39#define tuner_set s1a0903x01_set
40#endif
41
42#endif /* _S1A0903X01_H_ */
diff --git a/firmware/export/sh7034.h b/firmware/export/sh7034.h
deleted file mode 100644
index 2695acbc00..0000000000
--- a/firmware/export/sh7034.h
+++ /dev/null
@@ -1,376 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Alan Korr
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef __SH7034_H__
23#define __SH7034_H__
24
25#define GBR 0x00000000
26
27/* register address macros: */
28
29#define SMR0_ADDR 0x05FFFEC0
30#define BRR0_ADDR 0x05FFFEC1
31#define SCR0_ADDR 0x05FFFEC2
32#define TDR0_ADDR 0x05FFFEC3
33#define SSR0_ADDR 0x05FFFEC4
34#define RDR0_ADDR 0x05FFFEC5
35#define SMR1_ADDR 0x05FFFEC8
36#define BRR1_ADDR 0x05FFFEC9
37#define SCR1_ADDR 0x05FFFECA
38#define TDR1_ADDR 0x05FFFECB
39#define SSR1_ADDR 0x05FFFECC
40#define RDR1_ADDR 0x05FFFECD
41
42#define ADDRAH_ADDR 0x05FFFEE0
43#define ADDRAL_ADDR 0x05FFFEE1
44#define ADDRBH_ADDR 0x05FFFEE2
45#define ADDRBL_ADDR 0x05FFFEE3
46#define ADDRCH_ADDR 0x05FFFEE4
47#define ADDRCL_ADDR 0x05FFFEE5
48#define ADDRDH_ADDR 0x05FFFEE6
49#define ADDRDL_ADDR 0x05FFFEE7
50#define ADCSR_ADDR 0x05FFFEE8
51#define ADCR_ADDR 0x05FFFEE9
52
53#define TSTR_ADDR 0x05FFFF00
54#define TSNC_ADDR 0x05FFFF01
55#define TMDR_ADDR 0x05FFFF02
56#define TFCR_ADDR 0x05FFFF03
57#define TCR0_ADDR 0x05FFFF04
58#define TIOR0_ADDR 0x05FFFF05
59#define TIER0_ADDR 0x05FFFF06
60#define TSR0_ADDR 0x05FFFF07
61#define TCNT0_ADDR 0x05FFFF08
62#define GRA0_ADDR 0x05FFFF0A
63#define GRB0_ADDR 0x05FFFF0C
64#define TCR1_ADDR 0x05FFFF0E
65#define TIOR1_ADDR 0x05FFFF0F
66#define TIER1_ADDR 0x05FFFF10
67#define TSR1_ADDR 0x05FFFF11
68#define TCNT1_ADDR 0x05FFFF12
69#define GRA1_ADDR 0x05FFFF14
70#define GRB1_ADDR 0x05FFFF16
71#define TCR2_ADDR 0x05FFFF18
72#define TIOR2_ADDR 0x05FFFF19
73#define TIER2_ADDR 0x05FFFF1A
74#define TSR2_ADDR 0x05FFFF1B
75#define TCNT2_ADDR 0x05FFFF1C
76#define GRA2_ADDR 0x05FFFF1E
77#define GRB2_ADDR 0x05FFFF20
78#define TCR3_ADDR 0x05FFFF22
79#define TIOR3_ADDR 0x05FFFF23
80#define TIER3_ADDR 0x05FFFF24
81#define TSR3_ADDR 0x05FFFF25
82#define TCNT3_ADDR 0x05FFFF26
83#define GRA3_ADDR 0x05FFFF28
84#define GRB3_ADDR 0x05FFFF2A
85#define BRA3_ADDR 0x05FFFF2C
86#define BRB3_ADDR 0x05FFFF2E
87#define TOCR_ADDR 0x05FFFF31
88#define TCR4_ADDR 0x05FFFF32
89#define TIOR4_ADDR 0x05FFFF33
90#define TIER4_ADDR 0x05FFFF34
91#define TSR4_ADDR 0x05FFFF35
92#define TCNT4_ADDR 0x05FFFF36
93#define GRA4_ADDR 0x05FFFF38
94#define GRB4_ADDR 0x05FFFF3A
95#define BRA4_ADDR 0x05FFFF3C
96#define BRB4_ADDR 0x05FFFF3E
97
98#define SAR0_ADDR 0x05FFFF40
99#define DAR0_ADDR 0x05FFFF44
100#define DMAOR_ADDR 0x05FFFF48
101#define DTCR0_ADDR 0x05FFFF4A
102#define CHCR0_ADDR 0x05FFFF4E
103#define SAR1_ADDR 0x05FFFF50
104#define DAR1_ADDR 0x05FFFF54
105#define DTCR1_ADDR 0x05FFFF5A
106#define CHCR1_ADDR 0x05FFFF5E
107#define SAR2_ADDR 0x05FFFF60
108#define DAR2_ADDR 0x05FFFF64
109#define DTCR2_ADDR 0x05FFFF6A
110#define CHCR2_ADDR 0x05FFFF6E
111#define SAR3_ADDR 0x05FFFF70
112#define DAR3_ADDR 0x05FFFF74
113#define DTCR3_ADDR 0x05FFFF7A
114#define CHCR3_ADDR 0x05FFFF7E
115
116#define IPRA_ADDR 0x05FFFF84
117#define IPRB_ADDR 0x05FFFF86
118#define IPRC_ADDR 0x05FFFF88
119#define IPRD_ADDR 0x05FFFF8A
120#define IPRE_ADDR 0x05FFFF8C
121#define ICR_ADDR 0x05FFFF8E
122
123#define BARH_ADDR 0x05FFFF90
124#define BARL_ADDR 0x05FFFF92
125#define BAMRH_ADDR 0x05FFFF94
126#define BAMRL_ADDR 0x05FFFF96
127#define BBR_ADDR 0x05FFFF98
128
129#define BCR_ADDR 0x05FFFFA0
130#define WCR1_ADDR 0x05FFFFA2
131#define WCR2_ADDR 0x05FFFFA4
132#define WCR3_ADDR 0x05FFFFA6
133#define DCR_ADDR 0x05FFFFA8
134#define PCR_ADDR 0x05FFFFAA
135#define RCR_ADDR 0x05FFFFAC
136#define RTCSR_ADDR 0x05FFFFAE
137#define RTCNT_ADDR 0x05FFFFB0
138#define RTCOR_ADDR 0x05FFFFB2
139
140#define TCSR_ADDR 0x05FFFFB8
141#define TCNT_ADDR 0x05FFFFB9
142#define RSTCSR_ADDR 0x05FFFFBB
143
144#define SBYCR_ADDR 0x05FFFFBC
145
146#define PADR_ADDR 0x05FFFFC0
147#define PBDR_ADDR 0x05FFFFC2
148#define PAIOR_ADDR 0x05FFFFC4
149#define PBIOR_ADDR 0x05FFFFC6
150#define PACR1_ADDR 0x05FFFFC8
151#define PACR2_ADDR 0x05FFFFCA
152#define PBCR1_ADDR 0x05FFFFCC
153#define PBCR2_ADDR 0x05FFFFCE
154#define PCDR_ADDR 0x05FFFFD0
155
156#define CASCR_ADDR 0x05FFFFEE
157
158/* byte halves of the ports */
159#define PADRH_ADDR 0x05FFFFC0
160#define PADRL_ADDR 0x05FFFFC1
161#define PBDRH_ADDR 0x05FFFFC2
162#define PBDRL_ADDR 0x05FFFFC3
163#define PAIORH_ADDR 0x05FFFFC4
164#define PAIORL_ADDR 0x05FFFFC5
165#define PBIORH_ADDR 0x05FFFFC6
166#define PBIORL_ADDR 0x05FFFFC7
167
168
169/* A/D control/status register bits */
170#define ADCSR_CH 0x07 /* Channel/group select */
171#define ADCSR_CKS 0x08 /* Clock select */
172#define ADCSR_SCAN 0x10 /* Scan mode */
173#define ADCSR_ADST 0x20 /* A/D start */
174#define ADCSR_ADIE 0x40 /* A/D interrupt enable */
175#define ADCSR_ADF 0x80 /* A/D end flag */
176
177/* A/D control register bits */
178#define ADCR_TRGE 0x80 /* Trigger enable */
179
180/* register macros for direct access: */
181
182#define SMR0 (*((volatile unsigned char*)SMR0_ADDR))
183#define BRR0 (*((volatile unsigned char*)BRR0_ADDR))
184#define SCR0 (*((volatile unsigned char*)SCR0_ADDR))
185#define TDR0 (*((volatile unsigned char*)TDR0_ADDR))
186#define SSR0 (*((volatile unsigned char*)SSR0_ADDR))
187#define RDR0 (*((volatile unsigned char*)RDR0_ADDR))
188#define SMR1 (*((volatile unsigned char*)SMR1_ADDR))
189#define BRR1 (*((volatile unsigned char*)BRR1_ADDR))
190#define SCR1 (*((volatile unsigned char*)SCR1_ADDR))
191#define TDR1 (*((volatile unsigned char*)TDR1_ADDR))
192#define SSR1 (*((volatile unsigned char*)SSR1_ADDR))
193#define RDR1 (*((volatile unsigned char*)RDR1_ADDR))
194
195#define ADDRA (*((volatile unsigned short*)ADDRAH_ADDR)) /* combined */
196#define ADDRAH (*((volatile unsigned char*)ADDRAH_ADDR))
197#define ADDRAL (*((volatile unsigned char*)ADDRAL_ADDR))
198#define ADDRB (*((volatile unsigned short*)ADDRBH_ADDR)) /* combined */
199#define ADDRBH (*((volatile unsigned char*)ADDRBH_ADDR))
200#define ADDRBL (*((volatile unsigned char*)ADDRBL_ADDR))
201#define ADDRC (*((volatile unsigned short*)ADDRCH_ADDR)) /* combined */
202#define ADDRCH (*((volatile unsigned char*)ADDRCH_ADDR))
203#define ADDRCL (*((volatile unsigned char*)ADDRCL_ADDR))
204#define ADDRD (*((volatile unsigned short*)ADDRDH_ADDR)) /* combined */
205#define ADDRDH (*((volatile unsigned char*)ADDRDH_ADDR))
206#define ADDRDL (*((volatile unsigned char*)ADDRDL_ADDR))
207#define ADCSR (*((volatile unsigned char*)ADCSR_ADDR))
208#define ADCR (*((volatile unsigned char*)ADCR_ADDR))
209
210#define TSTR (*((volatile unsigned char*)TSTR_ADDR))
211#define TSNC (*((volatile unsigned char*)TSNC_ADDR))
212#define TMDR (*((volatile unsigned char*)TMDR_ADDR))
213#define TFCR (*((volatile unsigned char*)TFCR_ADDR))
214#define TCR0 (*((volatile unsigned char*)TCR0_ADDR))
215#define TIOR0 (*((volatile unsigned char*)TIOR0_ADDR))
216#define TIER0 (*((volatile unsigned char*)TIER0_ADDR))
217#define TSR0 (*((volatile unsigned char*)TSR0_ADDR))
218#define TCNT0 (*((volatile unsigned short*)TCNT0_ADDR))
219#define GRA0 (*((volatile unsigned short*)GRA0_ADDR))
220#define GRB0 (*((volatile unsigned short*)GRB0_ADDR))
221#define TCR1 (*((volatile unsigned char*)TCR1_ADDR))
222#define TIOR1 (*((volatile unsigned char*)TIOR1_ADDR))
223#define TIER1 (*((volatile unsigned char*)TIER1_ADDR))
224#define TSR1 (*((volatile unsigned char*)TSR1_ADDR))
225#define TCNT1 (*((volatile unsigned short*)TCNT1_ADDR))
226#define GRA1 (*((volatile unsigned short*)GRA1_ADDR))
227#define GRB1 (*((volatile unsigned short*)GRB1_ADDR))
228#define TCR2 (*((volatile unsigned char*)TCR2_ADDR))
229#define TIOR2 (*((volatile unsigned char*)TIOR2_ADDR))
230#define TIER2 (*((volatile unsigned char*)TIER2_ADDR))
231#define TSR2 (*((volatile unsigned char*)TSR2_ADDR))
232#define TCNT2 (*((volatile unsigned short*)TCNT2_ADDR))
233#define GRA2 (*((volatile unsigned short*)GRA2_ADDR))
234#define GRB2 (*((volatile unsigned short*)GRB2_ADDR))
235#define TCR3 (*((volatile unsigned char*)TCR3_ADDR))
236#define TIOR3 (*((volatile unsigned char*)TIOR3_ADDR))
237#define TIER3 (*((volatile unsigned char*)TIER3_ADDR))
238#define TSR3 (*((volatile unsigned char*)TSR3_ADDR))
239#define TCNT3 (*((volatile unsigned short*)TCNT3_ADDR))
240#define GRA3 (*((volatile unsigned short*)GRA3_ADDR))
241#define GRB3 (*((volatile unsigned short*)GRB3_ADDR))
242#define BRA3 (*((volatile unsigned short*)BRA3_ADDR))
243#define BRB3 (*((volatile unsigned short*)BRB3_ADDR))
244#define TOCR (*((volatile unsigned char*)TOCR_ADDR))
245#define TCR4 (*((volatile unsigned char*)TCR4_ADDR))
246#define TIOR4 (*((volatile unsigned char*)TIOR4_ADDR))
247#define TIER4 (*((volatile unsigned char*)TIER4_ADDR))
248#define TSR4 (*((volatile unsigned char*)TSR4_ADDR))
249#define TCNT4 (*((volatile unsigned short*)TCNT4_ADDR))
250#define GRA4 (*((volatile unsigned short*)GRA4_ADDR))
251#define GRB4 (*((volatile unsigned short*)GRB4_ADDR))
252#define BRA4 (*((volatile unsigned short*)BRA4_ADDR))
253#define BRB4 (*((volatile unsigned short*)BRB4_ADDR))
254
255#define SAR0 (*((volatile unsigned long*)SAR0_ADDR))
256#define DAR0 (*((volatile unsigned long*)DAR0_ADDR))
257#define DMAOR (*((volatile unsigned short*)DMAOR_ADDR))
258#define DTCR0 (*((volatile unsigned short*)DTCR0_ADDR))
259#define CHCR0 (*((volatile unsigned short*)CHCR0_ADDR))
260#define SAR1 (*((volatile unsigned long*)SAR1_ADDR))
261#define DAR1 (*((volatile unsigned long*)DAR1_ADDR))
262#define DTCR1 (*((volatile unsigned short*)DTCR1_ADDR))
263#define CHCR1 (*((volatile unsigned short*)CHCR1_ADDR))
264#define SAR2 (*((volatile unsigned long*)SAR2_ADDR))
265#define DAR2 (*((volatile unsigned long*)DAR2_ADDR))
266#define DTCR2 (*((volatile unsigned short*)DTCR2_ADDR))
267#define CHCR2 (*((volatile unsigned short*)CHCR2_ADDR))
268#define SAR3 (*((volatile unsigned long*)SAR3_ADDR))
269#define DAR3 (*((volatile unsigned long*)DAR3_ADDR))
270#define DTCR3 (*((volatile unsigned short*)DTCR3_ADDR))
271#define CHCR3 (*((volatile unsigned short*)CHCR3_ADDR))
272
273#define IPRA (*((volatile unsigned short*)IPRA_ADDR))
274#define IPRB (*((volatile unsigned short*)IPRB_ADDR))
275#define IPRC (*((volatile unsigned short*)IPRC_ADDR))
276#define IPRD (*((volatile unsigned short*)IPRD_ADDR))
277#define IPRE (*((volatile unsigned short*)IPRE_ADDR))
278#define ICR (*((volatile unsigned short*)ICR_ADDR))
279
280#define BAR (*((volatile unsigned long*)BARH_ADDR)) /* combined */
281#define BARH (*((volatile unsigned short*)BARH_ADDR))
282#define BARL (*((volatile unsigned short*)BARL_ADDR))
283#define BAMR (*((volatile unsigned long*)BAMRH_ADDR)) /* combined */
284#define BAMRH (*((volatile unsigned short*)BAMRH_ADDR))
285#define BAMRL (*((volatile unsigned short*)BAMRL_ADDR))
286#define BBR (*((volatile unsigned short*)BBR_ADDR))
287
288#define BCR (*((volatile unsigned short*)BCR_ADDR))
289#define WCR1 (*((volatile unsigned short*)WCR1_ADDR))
290#define WCR2 (*((volatile unsigned short*)WCR2_ADDR))
291#define WCR3 (*((volatile unsigned short*)WCR3_ADDR))
292#define DCR (*((volatile unsigned short*)DCR_ADDR))
293#define PCR (*((volatile unsigned short*)PCR_ADDR))
294#define RCR (*((volatile unsigned short*)RCR_ADDR))
295#define RTCSR (*((volatile unsigned short*)RTCSR_ADDR))
296#define RTCNT (*((volatile unsigned short*)RTCNT_ADDR))
297#define RTCOR (*((volatile unsigned short*)RTCOR_ADDR))
298
299#define TCSR_R (*((volatile unsigned char*)TCSR_ADDR))
300#define TCSR_W (*((volatile unsigned short*)(TCSR_ADDR & ~1)))
301#define TCNT_R (*((volatile unsigned char*)TCNT_ADDR))
302#define TCNT_W (*((volatile unsigned short*)(TCNT_ADDR & ~1)))
303#define RSTCSR_R (*((volatile unsigned char*)RSTCSR_ADDR))
304#define RSTCSR_W (*((volatile unsigned short*)(RSTCSR_ADDR & ~1)))
305
306#define SBYCR (*((volatile unsigned char*)SBYCR_ADDR))
307
308#define PADR (*((volatile unsigned short*)PADR_ADDR))
309#define PBDR (*((volatile unsigned short*)PBDR_ADDR))
310#define PAIOR (*((volatile unsigned short*)PAIOR_ADDR))
311#define PBIOR (*((volatile unsigned short*)PBIOR_ADDR))
312#define PACR1 (*((volatile unsigned short*)PACR1_ADDR))
313#define PACR2 (*((volatile unsigned short*)PACR2_ADDR))
314#define PBCR1 (*((volatile unsigned short*)PBCR1_ADDR))
315#define PBCR2 (*((volatile unsigned short*)PBCR2_ADDR))
316#define PCDR (*((volatile unsigned short*)PCDR_ADDR))
317
318#define CASCR (*((volatile unsigned char*)CASCR_ADDR))
319
320/* byte halves of the ports */
321#define PADRH (*((volatile unsigned char*)PADRH_ADDR))
322#define PADRL (*((volatile unsigned char*)PADRL_ADDR))
323#define PBDRH (*((volatile unsigned char*)PBDRH_ADDR))
324#define PBDRL (*((volatile unsigned char*)PBDRL_ADDR))
325#define PAIORH (*((volatile unsigned char*)PAIORH_ADDR))
326#define PAIORL (*((volatile unsigned char*)PAIORL_ADDR))
327#define PBIORH (*((volatile unsigned char*)PBIORH_ADDR))
328#define PBIORL (*((volatile unsigned char*)PBIORL_ADDR))
329
330
331/***************************************************************************
332 * Register bit definitions
333 **************************************************************************/
334
335/*
336 * Serial mode register bits
337 */
338
339#define SYNC_MODE 0x80
340#define SEVEN_BIT_DATA 0x40
341#define PARITY_ON 0x20
342#define ODD_PARITY 0x10
343#define STOP_BITS_2 0x08
344#define ENABLE_MULTIP 0x04
345#define PHI_64 0x03
346#define PHI_16 0x02
347#define PHI_4 0x01
348
349/*
350 * Serial control register bits
351 */
352#define SCI_TIE 0x80 /* Transmit interrupt enable */
353#define SCI_RIE 0x40 /* Receive interrupt enable */
354#define SCI_TE 0x20 /* Transmit enable */
355#define SCI_RE 0x10 /* Receive enable */
356#define SCI_MPIE 0x08 /* Multiprocessor interrupt enable */
357#define SCI_TEIE 0x04 /* Transmit end interrupt enable */
358#define SCI_CKE1 0x02 /* Clock enable 1 */
359#define SCI_CKE0 0x01 /* Clock enable 0 */
360
361/*
362 * Serial status register bits
363 */
364#define SCI_TDRE 0x80 /* Transmit data register empty */
365#define SCI_RDRF 0x40 /* Receive data register full */
366#define SCI_ORER 0x20 /* Overrun error */
367#define SCI_FER 0x10 /* Framing error */
368#define SCI_PER 0x08 /* Parity error */
369#define SCI_TEND 0x04 /* Transmit end */
370#define SCI_MPB 0x02 /* Multiprocessor bit */
371#define SCI_MPBT 0x01 /* Multiprocessor bit transfer */
372
373/* Timer frequency */
374#define TIMER_FREQ CPU_FREQ
375
376#endif
diff --git a/firmware/export/sound.h b/firmware/export/sound.h
index 3a26e30b68..9bcb9a8513 100644
--- a/firmware/export/sound.h
+++ b/firmware/export/sound.h
@@ -109,17 +109,6 @@ void sound_set_hw_eq_band5_frequency(int value);
109#endif /* AUDIOHW_HAVE_EQ_BAND5 */ 109#endif /* AUDIOHW_HAVE_EQ_BAND5 */
110#endif /* AUDIOHW_HAVE_EQ */ 110#endif /* AUDIOHW_HAVE_EQ */
111 111
112#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
113void sound_set_loudness(int value);
114void sound_set_avc(int value);
115void sound_set_mdb_strength(int value);
116void sound_set_mdb_harmonics(int value);
117void sound_set_mdb_center(int value);
118void sound_set_mdb_shape(int value);
119void sound_set_mdb_enable(int value);
120void sound_set_superbass(int value);
121#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
122
123void sound_set(int setting, int value); 112void sound_set(int setting, int value);
124int sound_val2phys(int setting, int value); 113int sound_val2phys(int setting, int value);
125 114
diff --git a/firmware/export/tuner.h b/firmware/export/tuner.h
index a166eacf33..a3cc985137 100644
--- a/firmware/export/tuner.h
+++ b/firmware/export/tuner.h
@@ -22,8 +22,9 @@
22#ifndef __TUNER_H__ 22#ifndef __TUNER_H__
23#define __TUNER_H__ 23#define __TUNER_H__
24 24
25#include <stdbool.h>
26
25#include "config.h" 27#include "config.h"
26#include "hwcompat.h"
27 28
28#ifdef HAVE_RDS_CAP 29#ifdef HAVE_RDS_CAP
29#include <sys/types.h> 30#include <sys/types.h>
@@ -114,12 +115,6 @@ extern int (*tuner_get)(int setting);
114#include "lv24020lp.h" 115#include "lv24020lp.h"
115#endif 116#endif
116 117
117/** Samsung S1A0903X01 **/
118#if (CONFIG_TUNER & S1A0903X01)
119/* Ondio FM, FM Recorder */
120#include "s1a0903x01.h"
121#endif
122
123/** Philips TEA5760 **/ 118/** Philips TEA5760 **/
124#if (CONFIG_TUNER & TEA5760) 119#if (CONFIG_TUNER & TEA5760)
125#include "tea5760.h" 120#include "tea5760.h"
diff --git a/firmware/export/usb.h b/firmware/export/usb.h
index 0c74efc9e2..d723f85b1a 100644
--- a/firmware/export/usb.h
+++ b/firmware/export/usb.h
@@ -134,14 +134,8 @@ enum
134}; 134};
135 135
136#ifdef HAVE_USB_POWER 136#ifdef HAVE_USB_POWER
137#if CONFIG_KEYPAD == RECORDER_PAD
138#define USBPOWER_BUTTON BUTTON_F1
139#define USBPOWER_BTN_IGNORE BUTTON_ON
140#elif CONFIG_KEYPAD == ONDIO_PAD
141#define USBPOWER_BUTTON BUTTON_MENU
142#define USBPOWER_BTN_IGNORE BUTTON_OFF
143/*allow people to define this in config-target.h if they need it*/ 137/*allow people to define this in config-target.h if they need it*/
144#elif !defined(USBPOWER_BTN_IGNORE) 138#if !defined(USBPOWER_BTN_IGNORE)
145#define USBPOWER_BTN_IGNORE 0 139#define USBPOWER_BTN_IGNORE 0
146#endif 140#endif
147#endif 141#endif
diff --git a/firmware/firmware.make b/firmware/firmware.make
index 6c01250bde..50b58af794 100644
--- a/firmware/firmware.make
+++ b/firmware/firmware.make
@@ -17,9 +17,7 @@ include $(FIRMDIR)/asm/asm.make
17 17
18FIRMLIB_SRC += $(call preprocess, $(FIRMDIR)/SOURCES) 18FIRMLIB_SRC += $(call preprocess, $(FIRMDIR)/SOURCES)
19FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC)) 19FIRMLIB_OBJ := $(call c2obj, $(FIRMLIB_SRC))
20ifeq (,$(findstring -DARCHOS_PLAYER,$(TARGET))) 20FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o
21 FIRMLIB_OBJ += $(BUILDDIR)/sysfont.o
22endif
23OTHER_SRC += $(FIRMLIB_SRC) 21OTHER_SRC += $(FIRMLIB_SRC)
24 22
25FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a 23FIRMLIB = $(BUILDDIR)/firmware/libfirmware.a
diff --git a/firmware/rolo.c b/firmware/rolo.c
index 1d164b4668..9a527e9074 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -123,10 +123,7 @@ static void rolo_error(const char *text)
123 lcd_scroll_stop(); 123 lcd_scroll_stop();
124} 124}
125 125
126#if CONFIG_CPU == SH7034 || CONFIG_CPU == IMX31L || CONFIG_CPU == RK27XX 126#if CONFIG_CPU == IMX31L || CONFIG_CPU == RK27XX
127/* these are in assembler file "descramble.S" for SH7034 */
128extern unsigned short descramble(const unsigned char* source,
129 unsigned char* dest, int length);
130/* this is in firmware/target/arm/imx31/rolo_restart.c for IMX31 */ 127/* this is in firmware/target/arm/imx31/rolo_restart.c for IMX31 */
131/* this is in firmware/target/arm/rk27xx/rolo_restart.c for rk27xx */ 128/* this is in firmware/target/arm/rk27xx/rolo_restart.c for rk27xx */
132extern void rolo_restart(const unsigned char* source, unsigned char* dest, 129extern void rolo_restart(const unsigned char* source, unsigned char* dest,
@@ -299,113 +296,7 @@ int rolo_load(const char* filename)
299 /* never reached */ 296 /* never reached */
300 return 0; 297 return 0;
301} 298}
302#else /* defined(CPU_SH) */ 299#endif /* CPU_COLDFIRE | CPU_ARM | CPU_MIPS */
303int rolo_load(const char* filename)
304{
305 int fd;
306 long length;
307 long file_length;
308 unsigned short checksum,file_checksum;
309 unsigned char* ramstart = (void*)&loadaddress;
310 unsigned char* filebuf;
311 size_t filebuf_size;
312
313 lcd_clear_display();
314 lcd_puts(0, 0, "ROLO...");
315 lcd_puts(0, 1, "Loading");
316 lcd_update();
317#ifdef HAVE_REMOTE_LCD
318 lcd_remote_clear_display();
319 lcd_remote_puts(0, 0, "ROLO...");
320 lcd_remote_puts(0, 1, "Loading");
321 lcd_remote_update();
322#endif
323
324 audio_stop();
325
326 fd = open(filename, O_RDONLY);
327 if(-1 == fd) {
328 rolo_error("File not found");
329 return -1;
330 }
331
332 length = filesize(fd) - FIRMWARE_OFFSET_FILE_DATA;
333
334 /* get the system buffer. release only in case of error, otherwise
335 * we don't return anyway */
336 rolo_handle = core_alloc_maximum("rolo", &filebuf_size, NULL);
337 filebuf = core_get_data(rolo_handle);
338
339 /* Read file length from header and compare to real file length */
340 lseek(fd, FIRMWARE_OFFSET_FILE_LENGTH, SEEK_SET);
341 if(read(fd, &file_length, 4) != 4) {
342 rolo_error("Error Reading File Length");
343 return -1;
344 }
345 if (length != file_length) {
346 rolo_error("File length mismatch");
347 return -1;
348 }
349
350 /* Read and save checksum */
351 lseek(fd, FIRMWARE_OFFSET_FILE_CRC, SEEK_SET);
352 if (read(fd, &file_checksum, 2) != 2) {
353 rolo_error("Error Reading checksum");
354 return -1;
355 }
356 lseek(fd, FIRMWARE_OFFSET_FILE_DATA, SEEK_SET);
357
358 /* verify that file can be read and descrambled */
359 if ((size_t)((2*length)+4) >= filebuf_size) {
360 rolo_error("Not enough room to load file");
361 return -1;
362 }
363
364 if (read(fd, &filebuf[length], length) != (int)length) {
365 rolo_error("Error Reading File");
366 return -1;
367 }
368
369 lcd_puts(0, 1, "Descramble");
370 lcd_update();
371
372 checksum = descramble(filebuf + length, filebuf, length);
373
374 /* Verify checksum against file header */
375 if (checksum != file_checksum) {
376 rolo_error("Checksum Error");
377 return -1;
378 }
379
380#ifdef HAVE_STORAGE_FLUSH
381 lcd_puts(0, 1, "Flushing ");
382 lcd_update();
383 storage_flush();
384#endif
385
386 lcd_puts(0, 1, "Executing ");
387 lcd_update();
388
389 set_irq_level(HIGHEST_IRQ_LEVEL);
390
391 /* Calling these 2 initialization routines was necessary to get the
392 the origional Archos version of the firmware to load and execute. */
393 system_init(); /* Initialize system for restart */
394 i2c_init(); /* Init i2c bus - it seems like a good idea */
395 ICR = IRQ0_EDGE_TRIGGER; /* Make IRQ0 edge triggered */
396 TSTR = 0xE0; /* disable all timers */
397 /* model-specific de-init, needed when flashed */
398 /* Especially the Archos software is picky about this */
399#if defined(ARCHOS_RECORDER) || defined(ARCHOS_RECORDERV2) || \
400 defined(ARCHOS_FMRECORDER)
401 PAIOR = 0x0FA0;
402#endif
403 rolo_restart(filebuf, ramstart, length);
404
405 return 0; /* this is never reached */
406 (void)checksum; (void)file_checksum;
407}
408#endif /* */
409#else /* !defined(IRIVER_IFP7XX_SERIES) */ 300#else /* !defined(IRIVER_IFP7XX_SERIES) */
410int rolo_load(const char* filename) 301int rolo_load(const char* filename)
411{ 302{
diff --git a/firmware/rom.lds b/firmware/rom.lds
index c959bf272d..f2ad1cec50 100644
--- a/firmware/rom.lds
+++ b/firmware/rom.lds
@@ -11,9 +11,6 @@ STARTUP(target/arm/pp/crt0-pp.o)
11#elif defined(CPU_ARM) 11#elif defined(CPU_ARM)
12OUTPUT_FORMAT(elf32-littlearm) 12OUTPUT_FORMAT(elf32-littlearm)
13STARTUP(target/arm/crt0.o) 13STARTUP(target/arm/crt0.o)
14#elif CONFIG_CPU == SH7034
15OUTPUT_FORMAT(elf32-sh)
16STARTUP(target/sh/crt0.o)
17#else 14#else
18OUTPUT_FORMAT(elf32-sh) 15OUTPUT_FORMAT(elf32-sh)
19STARTUP(crt0.o) 16STARTUP(crt0.o)
diff --git a/firmware/sound.c b/firmware/sound.c
index 5d9ca7265b..acf198da2e 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -128,16 +128,6 @@ int sound_current(int setting)
128 SOUND_CUR_SET(BALANCE, global_settings.balance) 128 SOUND_CUR_SET(BALANCE, global_settings.balance)
129 SOUND_CUR_SET(CHANNELS, global_settings.channel_config) 129 SOUND_CUR_SET(CHANNELS, global_settings.channel_config)
130 SOUND_CUR_SET(STEREO_WIDTH, global_settings.stereo_width) 130 SOUND_CUR_SET(STEREO_WIDTH, global_settings.stereo_width)
131#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
132 SOUND_CUR_SET(LOUDNESS, global_settings.loudness)
133 SOUND_CUR_SET(AVC, global_settings.avc)
134 SOUND_CUR_SET(MDB_STRENGTH, global_settings.mdb_strength)
135 SOUND_CUR_SET(MDB_HARMONICS, global_settings.mdb_harmonics)
136 SOUND_CUR_SET(MDB_CENTER, global_settings.mdb_center)
137 SOUND_CUR_SET(MDB_SHAPE, global_settings.mdb_shape)
138 SOUND_CUR_SET(MDB_ENABLE, global_settings.mdb_enable)
139 SOUND_CUR_SET(SUPERBASS, global_settings.superbass)
140#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
141#if defined(AUDIOHW_HAVE_BASS_CUTOFF) 131#if defined(AUDIOHW_HAVE_BASS_CUTOFF)
142 SOUND_CUR_SET(BASS_CUTOFF, global_settings.bass_cutoff) 132 SOUND_CUR_SET(BASS_CUTOFF, global_settings.bass_cutoff)
143#endif 133#endif
@@ -626,72 +616,6 @@ void sound_set_hw_eq_band4_width(int value)
626#endif 616#endif
627#endif /* AUDIOHW_HAVE_EQ */ 617#endif /* AUDIOHW_HAVE_EQ */
628 618
629#if CONFIG_CODEC == MAS3587F || CONFIG_CODEC == MAS3539F
630void sound_set_loudness(int value)
631{
632 if (!audio_is_initialized)
633 return;
634
635 audiohw_set_loudness(value);
636}
637
638void sound_set_avc(int value)
639{
640 if (!audio_is_initialized)
641 return;
642
643 audiohw_set_avc(value);
644}
645
646void sound_set_mdb_strength(int value)
647{
648 if (!audio_is_initialized)
649 return;
650
651 audiohw_set_mdb_strength(value);
652}
653
654void sound_set_mdb_harmonics(int value)
655{
656 if (!audio_is_initialized)
657 return;
658
659 audiohw_set_mdb_harmonics(value);
660}
661
662void sound_set_mdb_center(int value)
663{
664 if (!audio_is_initialized)
665 return;
666
667 audiohw_set_mdb_center(value);
668}
669
670void sound_set_mdb_shape(int value)
671{
672 if (!audio_is_initialized)
673 return;
674
675 audiohw_set_mdb_shape(value);
676}
677
678void sound_set_mdb_enable(int value)
679{
680 if (!audio_is_initialized)
681 return;
682
683 audiohw_set_mdb_enable(value);
684}
685
686void sound_set_superbass(int value)
687{
688 if (!audio_is_initialized)
689 return;
690
691 audiohw_set_superbass(value);
692}
693#endif /* CONFIG_CODEC == MAS3587F || CONFIG_CODEC == MAS3539F */
694
695#if defined(HAVE_PITCHCONTROL) 619#if defined(HAVE_PITCHCONTROL)
696void sound_set_pitch(int32_t pitch) 620void sound_set_pitch(int32_t pitch)
697{ 621{
diff --git a/firmware/target/hosted/sdl/sim-ui-defines.h b/firmware/target/hosted/sdl/sim-ui-defines.h
index 23825f318b..808804c01f 100644
--- a/firmware/target/hosted/sdl/sim-ui-defines.h
+++ b/firmware/target/hosted/sdl/sim-ui-defines.h
@@ -28,35 +28,7 @@
28 28
29/* colour definitions are R, G, B */ 29/* colour definitions are R, G, B */
30 30
31#if defined(ARCHOS_RECORDER) 31#if defined(IRIVER_H120) || defined(IRIVER_H100)
32#define UI_TITLE "Jukebox Recorder"
33#define UI_WIDTH 270 /* width of GUI window */
34#define UI_HEIGHT 406 /* height of GUI window */
35#define UI_LCD_POSX 80 /* x position of lcd */
36#define UI_LCD_POSY 104 /* y position of lcd */
37
38#elif defined(ARCHOS_PLAYER)
39#define UI_TITLE "Jukebox Player"
40#define UI_WIDTH 284 /* width of GUI window */
41#define UI_HEIGHT 420 /* height of GUI window */
42#define UI_LCD_POSX 75 /* x position of lcd */
43#define UI_LCD_POSY 116 /* y position of lcd */
44
45#elif defined(ARCHOS_FMRECORDER) || defined(ARCHOS_RECORDERV2)
46#define UI_TITLE "Jukebox FM Recorder"
47#define UI_WIDTH 285 /* width of GUI window */
48#define UI_HEIGHT 414 /* height of GUI window */
49#define UI_LCD_POSX 87 /* x position of lcd */
50#define UI_LCD_POSY 77 /* y position of lcd */
51
52#elif defined(ARCHOS_ONDIOSP) || defined(ARCHOS_ONDIOFM)
53#define UI_TITLE "Ondio"
54#define UI_WIDTH 155 /* width of GUI window */
55#define UI_HEIGHT 334 /* height of GUI window */
56#define UI_LCD_POSX 21 /* x position of lcd */
57#define UI_LCD_POSY 82 /* y position of lcd */
58
59#elif defined(IRIVER_H120) || defined(IRIVER_H100)
60#define UI_TITLE "iriver H1x0" 32#define UI_TITLE "iriver H1x0"
61#define UI_WIDTH 379 /* width of GUI window */ 33#define UI_WIDTH 379 /* width of GUI window */
62#define UI_HEIGHT 508 /* height of GUI window */ 34#define UI_HEIGHT 508 /* height of GUI window */
@@ -238,14 +210,6 @@
238#define UI_LCD_POSX 115 /* x position of lcd */ 210#define UI_LCD_POSX 115 /* x position of lcd */
239#define UI_LCD_POSY 54 /* y position of lcd */ 211#define UI_LCD_POSY 54 /* y position of lcd */
240 212
241#elif defined(ARCHOS_AV300)
242#define UI_TITLE "Archos AV300"
243/* We are temporarily using a 2bpp LCD driver and dummy bitmap */
244#define UI_WIDTH 420 /* width of GUI window */
245#define UI_HEIGHT 340 /* height of GUI window */
246#define UI_LCD_POSX 50 /* x position of lcd */
247#define UI_LCD_POSY 50 /* y position of lcd */
248
249#elif defined(MROBE_100) 213#elif defined(MROBE_100)
250#define UI_TITLE "Olympus M:Robe 100" 214#define UI_TITLE "Olympus M:Robe 100"
251#define UI_WIDTH 247 /* width of GUI window */ 215#define UI_WIDTH 247 /* width of GUI window */
diff --git a/firmware/target/sh/adc-sh.c b/firmware/target/sh/adc-sh.c
deleted file mode 100644
index 2e6d6407b8..0000000000
--- a/firmware/target/sh/adc-sh.c
+++ /dev/null
@@ -1,110 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23#include "system.h"
24#include "kernel.h"
25#include "thread.h"
26#include "string.h"
27#include "adc.h"
28
29/**************************************************************************
30 ** The A/D conversion is done every tick, in three steps:
31 **
32 ** 1) On the tick interrupt, the conversion of channels 0-3 is started, and
33 ** the A/D interrupt is enabled.
34 **
35 ** 2) After the conversion is done (approx. 256*4 cycles later), an interrupt
36 ** is generated at level 1, which is the same level as the tick interrupt
37 ** itself. This interrupt will be pending until the tick interrupt is
38 ** finished.
39 ** When the A/D interrupt is finally served, it will read the results
40 ** from the first conversion and start the conversion of channels 4-7.
41 **
42 ** 3) When the conversion of channels 4-7 is finished, the interrupt is
43 ** triggered again, and the results are read. This time, no new
44 ** conversion is started, it will be done in the next tick interrupt.
45 **
46 ** Thus, each channel will be updated HZ times per second.
47 **
48 *************************************************************************/
49
50static int current_channel;
51static unsigned short adcdata[NUM_ADC_CHANNELS];
52
53static void adc_tick(void)
54{
55 /* Start a conversion of channel group 0. This will trigger an interrupt,
56 and the interrupt handler will take care of group 1. */
57
58 current_channel = 0;
59 ADCSR = ADCSR_ADST | ADCSR_ADIE | ADCSR_SCAN | 3;
60}
61
62void ADITI(void) __attribute__((interrupt_handler));
63void ADITI(void)
64{
65 if(ADCSR & ADCSR_ADF)
66 {
67 ADCSR = 0;
68
69 if(current_channel == 0)
70 {
71 adcdata[0] = ADDRA >> 6;
72 adcdata[1] = ADDRB >> 6;
73 adcdata[2] = ADDRC >> 6;
74 adcdata[3] = ADDRD >> 6;
75 current_channel = 4;
76
77 /* Convert the next group */
78 ADCSR = ADCSR_ADST | ADCSR_ADIE | ADCSR_SCAN | 7;
79 }
80 else
81 {
82 adcdata[4] = ADDRA >> 6;
83 adcdata[5] = ADDRB >> 6;
84 adcdata[6] = ADDRC >> 6;
85 adcdata[7] = ADDRD >> 6;
86 }
87 }
88}
89
90unsigned short adc_read(int channel)
91{
92 return adcdata[channel];
93}
94
95void adc_init(void)
96{
97 ADCR = 0x7f; /* No external trigger; other bits should be 1 according
98 to the manual... */
99
100 ADCSR = 0;
101
102 current_channel = 0;
103
104 /* Enable the A/D IRQ on level 1 */
105 IPRE = (IPRE & 0xf0ff) | 0x0100;
106
107 tick_add_task(adc_tick);
108
109 sleep(2); /* Ensure valid readings when adc_init returns */
110}
diff --git a/firmware/target/sh/archos/app.lds b/firmware/target/sh/archos/app.lds
deleted file mode 100644
index 225f11f705..0000000000
--- a/firmware/target/sh/archos/app.lds
+++ /dev/null
@@ -1,145 +0,0 @@
1#include "config.h"
2
3ENTRY(start)
4
5OUTPUT_FORMAT(elf32-sh)
6STARTUP(target/sh/crt0.o)
7
8#define PLUGINSIZE PLUGIN_BUFFER_SIZE
9#define CODECSIZE CODEC_SIZE
10
11#ifdef DEBUG
12#define STUBOFFSET 0x10000
13#else
14#define STUBOFFSET 0
15#endif
16
17#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
18
19#define DRAMORIG 0x09000000 + STUBOFFSET
20#define IRAMORIG 0x0f000000
21#define IRAMSIZE 0x1000
22
23/* End of the audio buffer, where the codec buffer starts */
24#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
25
26/* Where the codec buffer ends, and the plugin buffer starts */
27#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
28
29MEMORY
30{
31 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
32 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
33}
34
35SECTIONS
36{
37 .vectors :
38 {
39 loadaddress = .;
40 _loadaddress = .;
41 KEEP(*(.resetvectors));
42 *(.resetvectors);
43 KEEP(*(.vectors));
44 *(.vectors);
45 } > DRAM
46
47 .text :
48 {
49 . = ALIGN(0x200);
50 *(.init.text)
51 *(.text*)
52 . = ALIGN(0x4);
53 } > DRAM
54
55 .rodata :
56 {
57 *(.rodata) /* problems without this, dunno why */
58 *(.rodata*)
59 *(.rodata.str1.1)
60 *(.rodata.str1.4)
61 . = ALIGN(0x4);
62
63 /* Pseudo-allocate the copies of the data sections */
64 _datacopy = .;
65 } > DRAM
66
67 /* TRICK ALERT! For RAM execution, we put the .data section at the
68 same load address as the copy. Thus, we don't waste extra RAM
69 when we don't actually need the copy. */
70 .data : AT ( _datacopy )
71 {
72 _datastart = .;
73 *(.data*)
74 . = ALIGN(0x4);
75 _dataend = .;
76 } > DRAM
77
78 /DISCARD/ :
79 {
80 *(.eh_frame)
81 }
82
83 .iram IRAMORIG :
84 {
85 _iramstart = .;
86 *(.icode)
87 *(.irodata)
88 *(.idata)
89 _iramend = .;
90 } > IRAM AT> DRAM
91
92 _iramcopy = LOADADDR(.iram);
93 _noloaddram = LOADADDR(.iram);
94
95 .ibss (NOLOAD) :
96 {
97 _iedata = .;
98 *(.ibss)
99 . = ALIGN(0x4);
100 _iend = .;
101 } > IRAM
102
103 .stack _noloaddram (NOLOAD) :
104 {
105 *(.stack)
106 _stackbegin = .;
107 . += 0x2000;
108 _stackend = .;
109 } > DRAM
110
111 .bss (NOLOAD) :
112 {
113 _edata = .;
114 *(.bss*)
115 *(COMMON)
116 . = ALIGN(0x4);
117 _end = .;
118 } > DRAM
119
120 .audiobuf (NOLOAD) :
121 {
122 . = ALIGN(4);
123 _audiobuffer = .;
124 audiobuffer = .;
125 } > DRAM
126
127 .audiobufend ENDAUDIOADDR (NOLOAD) :
128 {
129 audiobufend = .;
130 _audiobufend = .;
131 } > DRAM
132
133 .codec ENDAUDIOADDR (NOLOAD) :
134 {
135 codecbuf = .;
136 _codecbuf = .;
137 }
138
139 .plugin ENDADDR (NOLOAD) :
140 {
141 _pluginbuf = .;
142 pluginbuf = .;
143 }
144}
145
diff --git a/firmware/target/sh/archos/ata-archos.c b/firmware/target/sh/archos/ata-archos.c
deleted file mode 100644
index 2046d3b33f..0000000000
--- a/firmware/target/sh/archos/ata-archos.c
+++ /dev/null
@@ -1,71 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "cpu.h"
24#include <stdbool.h>
25#include "kernel.h"
26#include "system.h"
27#include "ata-driver.h"
28#include "hwcompat.h"
29
30#define ATA_CONTROL1 ((volatile unsigned char*)0x06200206)
31#define ATA_CONTROL2 ((volatile unsigned char*)0x06200306)
32
33volatile unsigned char* ata_control;
34
35void ata_reset(void)
36{
37 /* state HRR0 */
38 and_b(~0x02, &PADRH); /* assert _RESET */
39 sleep(1); /* > 25us */
40
41 /* state HRR1 */
42 or_b(0x02, &PADRH); /* negate _RESET */
43 sleep(1); /* > 2ms */
44}
45
46void ata_enable(bool on)
47{
48 if(on)
49 and_b(~0x80, &PADRL); /* enable ATA */
50 else
51 or_b(0x80, &PADRL); /* disable ATA */
52
53 or_b(0x80, &PAIORL);
54}
55
56void ata_device_init(void)
57{
58 or_b(0x02, &PAIORH); /* output for ATA reset */
59 or_b(0x02, &PADRH); /* release ATA reset */
60 PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */
61
62 if (HW_MASK & ATA_ADDRESS_200)
63 ata_control = ATA_CONTROL1;
64 else
65 ata_control = ATA_CONTROL2;
66}
67
68bool ata_is_coldstart(void)
69{
70 return (PACR2 & 0x4000) != 0;
71}
diff --git a/firmware/target/sh/archos/ata-as-archos.S b/firmware/target/sh/archos/ata-as-archos.S
deleted file mode 100644
index c403c4c921..0000000000
--- a/firmware/target/sh/archos/ata-as-archos.S
+++ /dev/null
@@ -1,233 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004-2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22 .section .icode,"ax",@progbits
23
24 .align 2
25 .global _copy_read_sectors
26 .type _copy_read_sectors,@function
27
28/* Read a number of words from the ATA data port
29 *
30 * Assumes wordcount to be a multiple of 4
31 *
32 * Arguments:
33 * r4 - buffer address
34 * r5 - word count
35 *
36 * Register usage:
37 * r0 - scratch
38 * r1/r2 - read buffers
39 * r3 - mask (if unaligned)
40 * r4 - current address
41 * r5 - end address
42 * r6 - ata port
43 */
44
45_copy_read_sectors:
46 add r5, r5 /* words -> bytes */
47 add r4, r5 /* bytes -> end address */
48 add #-12, r5 /* adjust for offsets */
49 mov.l .ata_data, r6
50
51 mov r4, r0
52 tst #1, r0 /* 16-bit aligned ? */
53 bt .r_aligned /* yes, do word copy */
54
55 /* not 16-bit aligned */
56 mov #-1, r3 /* prepare a bit mask for high byte */
57 shll8 r3 /* r3 = 0xFFFFFF00 */
58
59 mov.w @r6, r2 /* read first word (1st round) */
60 mov.b r2, @r4 /* store low byte of first word */
61 bra .r_start_b /* jump into loop after next instr. */
62 add #-5, r4 /* adjust for dest. offsets; now even */
63
64 .align 2
65.r_loop_b: /* main loop: copy 4 words in a row */
66 mov.w @r6, r2 /* read first word (2+ round) */
67 and r3, r1 /* get high byte of fourth word (2+ round) */
68 extu.b r2, r0 /* get low byte of first word (2+ round) */
69 or r1, r0 /* combine with high byte of fourth word */
70 mov.w r0, @(4, r4) /* store at buf[4] */
71 nop /* maintain alignment */
72.r_start_b:
73 mov.w @r6, r1 /* read second word */
74 and r3, r2 /* get high byte of first word */
75 extu.b r1, r0 /* get low byte of second word */
76 or r2, r0 /* combine with high byte of first word */
77 mov.w r0, @(6, r4) /* store at buf[6] */
78 add #8, r4 /* buf += 8 */
79 mov.w @r6, r2 /* read third word */
80 and r3, r1 /* get high byte of second word */
81 extu.b r2, r0 /* get low byte of third word */
82 or r1, r0 /* combine with high byte of second word */
83 mov.w r0, @r4 /* store at buf[0] */
84 cmp/hi r4, r5 /* check for end */
85 mov.w @r6, r1 /* read fourth word */
86 and r3, r2 /* get high byte of third word */
87 extu.b r1, r0 /* get low byte of fourth word */
88 or r2, r0 /* combine with high byte of third word */
89 mov.w r0, @(2, r4) /* store at buf[2] */
90 bt .r_loop_b
91 /* 24 instructions for 4 copies, takes 30 clock cycles (4 wait) */
92 /* avg. 7.5 cycles per word */
93
94 swap.b r1, r0 /* get high byte of last word */
95 rts
96 mov.b r0, @(4, r4) /* and store it */
97
98 /* 16-bit aligned, loop(read and store word) */
99.r_aligned:
100 mov.w @r6, r2 /* read first word (1st round) */
101 bra .r_start_w /* jump into loop after next instr. */
102 add #-6, r4 /* adjust for destination offsets */
103
104 .align 2
105.r_loop_w: /* main loop: copy 4 words in a row */
106 mov.w @r6, r2 /* read first word (2+ round) */
107 swap.b r1, r0 /* swap fourth word (2+ round) */
108 mov.w r0, @(4, r4) /* store fourth word (2+ round) */
109 nop /* maintain alignment */
110.r_start_w:
111 mov.w @r6, r1 /* read second word */
112 swap.b r2, r0 /* swap first word */
113 mov.w r0, @(6, r4) /* store first word in buf[6] */
114 add #8, r4 /* buf += 8 */
115 mov.w @r6, r2 /* read third word */
116 swap.b r1, r0 /* swap second word */
117 mov.w r0, @r4 /* store second word in buf[0] */
118 cmp/hi r4, r5 /* check for end */
119 mov.w @r6, r1 /* read fourth word */
120 swap.b r2, r0 /* swap third word */
121 mov.w r0, @(2, r4) /* store third word */
122 bt .r_loop_w
123 /* 16 instructions for 4 copies, takes 22 clock cycles (4 wait) */
124 /* avg. 5.5 cycles per word */
125
126 swap.b r1, r0 /* swap fourth word (last round) */
127 rts
128 mov.w r0, @(4, r4) /* and store it */
129
130.r_end:
131 .size _copy_read_sectors,.r_end-_copy_read_sectors
132
133 .align 2
134 .global _copy_write_sectors
135 .type _copy_write_sectors,@function
136
137/* Write a number of words to the ATA data port
138 *
139 * Assumes wordcount to be a multiple of 2.
140 * Writing is not unrolled as much as reading, for several reasons:
141 *
142 * - a similar instruction sequence is faster for writing than for reading
143 * because the auto-incrementing load instructions can be used
144 * - writing profits from warp mode
145 *
146 * Both of these add up to have writing faster than the more unrolled reading.
147 *
148 * Arguments:
149 * r4 - buffer address
150 * r5 - word count
151 *
152 * Register usage:
153 * r0/r1 - scratch
154 * r2/r3 - write buffers
155 * r4 - current address
156 * r5 - end address
157 * r6 - mask (if unaligned)
158 * r7 - ata port
159 */
160
161_copy_write_sectors:
162 add r5, r5 /* words -> bytes */
163 add r4, r5 /* bytes -> end address */
164 add #-4, r5 /* adjust for offsets */
165 mov.l .ata_data, r7
166
167 mov r4, r0
168 tst #1, r0 /* 16-bit aligned ? */
169 bt .w_aligned /* yes, do word copy */
170
171 /* not 16-bit aligned */
172 mov #-1, r6 /* prepare a bit mask for high byte */
173 shll8 r6 /* r6 = 0xFFFFFF00 */
174
175 mov.b @r4+, r2 /* load (initial old second) first byte */
176 mov.w @r4+, r3 /* load (initial) first word */
177 bra .w_start_b
178 extu.b r2, r0 /* extend unsigned */
179
180 .align 2
181.w_loop_b: /* main loop: copy 2 words in a row */
182 mov.w @r4+, r3 /* load first word (2+ round) */
183 extu.b r2, r0 /* put away low byte of second word (2+ round) */
184 and r6, r2 /* get high byte of second word (2+ round) */
185 or r1, r2 /* combine with low byte of old first word */
186 mov.w r2, @r7 /* write that */
187.w_start_b:
188 cmp/hi r4, r5 /* check for end */
189 mov.w @r4+, r2 /* load second word */
190 extu.b r3, r1 /* put away low byte of first word */
191 and r6, r3 /* get high byte of first word */
192 or r0, r3 /* combine with high byte of old second word */
193 mov.w r3, @r7 /* write that */
194 bt .w_loop_b
195 /* 12 instructions for 2 copies, takes 14 clock cycles */
196 /* avg. 7 cycles per word */
197
198 /* the loop "overreads" 1 byte past the buffer end, however, the last */
199 /* byte is not written to disk */
200 and r6, r2 /* get high byte of last word */
201 or r1, r2 /* combine with low byte of old first word */
202 rts
203 mov.w r2, @r7 /* write last word */
204
205 /* 16-bit aligned, loop(load and write word) */
206.w_aligned:
207 bra .w_start_w /* jump into loop after next instr. */
208 mov.w @r4+, r2 /* load first word (1st round) */
209
210 .align 2
211.w_loop_w: /* main loop: copy 2 words in a row */
212 mov.w @r4+, r2 /* load first word (2+ round) */
213 swap.b r1, r0 /* swap second word (2+ round) */
214 mov.w r0, @r7 /* write second word (2+ round) */
215.w_start_w:
216 cmp/hi r4, r5 /* check for end */
217 mov.w @r4+, r1 /* load second word */
218 swap.b r2, r0 /* swap first word */
219 mov.w r0, @r7 /* write first word */
220 bt .w_loop_w
221 /* 8 instructions for 2 copies, takes 10 clock cycles */
222 /* avg. 5 cycles per word */
223
224 swap.b r1, r0 /* swap second word (last round) */
225 rts
226 mov.w r0, @r7 /* and write it */
227
228.w_end:
229 .size _copy_write_sectors,.w_end-_copy_write_sectors
230
231 .align 2
232.ata_data:
233 .long 0x06104100 /* ATA data port */
diff --git a/firmware/target/sh/archos/ata-target.h b/firmware/target/sh/archos/ata-target.h
deleted file mode 100644
index dc55cdd5d5..0000000000
--- a/firmware/target/sh/archos/ata-target.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef ATA_TARGET_H
22#define ATA_TARGET_H
23
24/* asm optimised read & write loops */
25#define ATA_OPTIMIZED_READING
26#define ATA_OPTIMIZED_WRITING
27
28#define ATA_SWAP_WORDS
29
30#define ATA_IOBASE 0x06100100
31#define ATA_DATA (*((volatile unsigned short*)0x06104100))
32#define ATA_CONTROL (*ata_control)
33
34#define ATA_ERROR (*((volatile unsigned char*)ATA_IOBASE + 1))
35#define ATA_NSECTOR (*((volatile unsigned char*)ATA_IOBASE + 2))
36#define ATA_SECTOR (*((volatile unsigned char*)ATA_IOBASE + 3))
37#define ATA_LCYL (*((volatile unsigned char*)ATA_IOBASE + 4))
38#define ATA_HCYL (*((volatile unsigned char*)ATA_IOBASE + 5))
39#define ATA_SELECT (*((volatile unsigned char*)ATA_IOBASE + 6))
40#define ATA_COMMAND (*((volatile unsigned char*)ATA_IOBASE + 7))
41
42extern volatile unsigned char* ata_control;
43
44
45#endif
diff --git a/firmware/target/sh/archos/audio-archos.c b/firmware/target/sh/archos/audio-archos.c
deleted file mode 100644
index 2c2579bec5..0000000000
--- a/firmware/target/sh/archos/audio-archos.c
+++ /dev/null
@@ -1,543 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Code that has been in mpeg.c before, now creating an encapsulated play
11 * data module, to be used by other sources than file playback as well.
12 *
13 * Copyright (C) 2004 by Linus Nielsen Feltzing
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24#include <stdbool.h>
25#include "config.h"
26#include "debug.h"
27#include "panic.h"
28#include <kernel.h>
29#include "mp3_playback.h"
30#include "sound.h"
31#include "i2c.h"
32#include "system.h"
33#include "audiohw.h"
34
35/* hacking into mpeg.c, recording is still there */
36#if CONFIG_CODEC == MAS3587F
37enum
38{
39 MPEG_DECODER,
40 MPEG_ENCODER
41} mpeg_mode;
42#endif /* #ifdef MAS3587F */
43
44#if ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)) && !defined(SIMULATOR)
45extern unsigned long shadow_io_control_main;
46extern unsigned shadow_codec_reg0;
47#endif
48
49/**** globals ****/
50
51/* own version, independent of mpeg.c */
52static bool paused; /* playback is paused */
53static bool playing; /* We are playing an MP3 stream */
54
55/* the registered callback function to ask for more mp3 data */
56static mp3_play_callback_t callback_for_more;
57
58/* list of tracks in memory */
59#define MAX_ID3_TAGS (1<<4) /* Must be power of 2 */
60#define MAX_ID3_TAGS_MASK (MAX_ID3_TAGS - 1)
61
62bool audio_is_initialized = false;
63
64/* FIX: this code pretty much assumes a MAS */
65
66/* dirty calls to mpeg.c */
67extern void playback_tick(void);
68extern void rec_tick(void);
69
70unsigned long mas_version_code;
71
72#if CONFIG_CODEC == MAS3507D
73static void mas_poll_start(void)
74{
75 unsigned int count;
76
77 count = 9 * FREQ / 10000 / 8; /* 0.9 ms */
78
79 /* We are using timer 1 */
80
81 TSTR &= ~0x02; /* Stop the timer */
82 TSNC &= ~0x02; /* No synchronization */
83 TMDR &= ~0x02; /* Operate normally */
84
85 TCNT1 = 0; /* Start counting at 0 */
86 GRA1 = count;
87 TCR1 = 0x23; /* Clear at GRA match, sysclock/8 */
88
89 /* Enable interrupt on level 5 */
90 IPRC = (IPRC & ~0x000f) | 0x0005;
91
92 TSR1 &= ~0x02;
93 TIER1 = 0xf9; /* Enable GRA match interrupt */
94
95 TSTR |= 0x02; /* Start timer 1 */
96}
97#elif CONFIG_CODEC != SWCODEC
98static void postpone_dma_tick(void)
99{
100 unsigned int count;
101
102 count = 8 * FREQ / 10000 / 8; /* 0.8 ms */
103
104 /* We are using timer 1 */
105
106 TSTR &= ~0x02; /* Stop the timer */
107 TSNC &= ~0x02; /* No synchronization */
108 TMDR &= ~0x02; /* Operate normally */
109
110 TCNT1 = 0; /* Start counting at 0 */
111 GRA1 = count;
112 TCR1 = 0x23; /* Clear at GRA match, sysclock/8 */
113
114 /* Enable interrupt on level 5 */
115 IPRC = (IPRC & ~0x000f) | 0x0005;
116
117 TSR1 &= ~0x02;
118 TIER1 = 0xf9; /* Enable GRA match interrupt */
119
120 TSTR |= 0x02; /* Start timer 1 */
121}
122#endif
123
124#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
125void demand_irq_enable(bool on)
126{
127 int oldlevel = disable_irq_save();
128
129 if(on)
130 {
131 IPRA = (IPRA & 0xfff0) | 0x000b;
132 ICR &= ~0x0010; /* IRQ3 level sensitive */
133 }
134 else
135 IPRA &= 0xfff0;
136
137 restore_irq(oldlevel);
138}
139#endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
140
141
142static void play_tick(void)
143{
144 if(playing && !paused)
145 {
146 /* Start DMA if it is disabled and the DEMAND pin is high */
147 if(!(SCR0 & 0x80) && (PBDR & 0x4000))
148 {
149 SCR0 |= 0x80;
150 }
151
152 playback_tick(); /* dirty call to mpeg.c */
153 }
154}
155
156void DEI3(void) __attribute__((interrupt_handler));
157void DEI3(void)
158{
159 const void* start;
160 size_t size = 0;
161
162 if (callback_for_more != NULL)
163 {
164 callback_for_more(&start, &size);
165 }
166
167 if (size > 0)
168 {
169 DTCR3 = size & 0xffff;
170 SAR3 = (unsigned int) start;
171 }
172 else
173 {
174 CHCR3 &= ~0x0001; /* Disable the DMA interrupt */
175 }
176
177 CHCR3 &= ~0x0002; /* Clear DMA interrupt */
178}
179
180void IMIA1(void) __attribute__((interrupt_handler));
181void IMIA1(void) /* Timer 1 interrupt */
182{
183 if(playing)
184 play_tick();
185 TSR1 &= ~0x01;
186#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
187 /* Disable interrupt */
188 IPRC &= ~0x000f;
189#endif
190}
191
192void IRQ6(void) __attribute__((interrupt_handler));
193void IRQ6(void) /* PB14: MAS stop demand IRQ */
194{
195 SCR0 &= ~0x80;
196}
197
198#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
199void IRQ3(void) __attribute__((interrupt_handler));
200void IRQ3(void) /* PA15: MAS demand IRQ */
201{
202 /* Begin with setting the IRQ to edge sensitive */
203 ICR |= 0x0010;
204
205#if CONFIG_CODEC == MAS3587F
206 if(mpeg_mode == MPEG_ENCODER)
207 rec_tick();
208 else
209#endif
210 postpone_dma_tick();
211
212 /* Workaround for sh-elf-gcc 3.3.x bug with -O2 or -Os and ISRs
213 * (invalid cross-jump optimisation) */
214 asm volatile ("");
215}
216#endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
217
218static void setup_sci0(void)
219{
220 /* PB15 is I/O, PB14 is IRQ6, PB12 is SCK0, PB9 is TxD0 */
221 PBCR1 = (PBCR1 & 0x0cff) | 0x1208;
222
223 /* Set PB12 to output */
224 or_b(0x10, &PBIORH);
225
226 /* Disable serial port */
227 SCR0 = 0x00;
228
229 /* Synchronous, no prescale */
230 SMR0 = 0x80;
231
232 /* Set baudrate 1Mbit/s */
233 BRR0 = 0x02;
234
235 /* use SCK as serial clock output */
236 SCR0 = 0x01;
237
238 /* Clear FER and PER */
239 SSR0 &= 0xe7;
240
241 /* Set interrupt ITU2 and SCI0 priority to 0 */
242 IPRD &= 0x0ff0;
243
244 /* set PB15 and PB14 to inputs */
245 and_b(~0x80, &PBIORH);
246 and_b(~0x40, &PBIORH);
247
248 /* Enable End of DMA interrupt at prio 8 */
249 IPRC = (IPRC & 0xf0ff) | 0x0800;
250
251 /* Enable Tx (only!) */
252 SCR0 |= 0x20;
253}
254
255#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
256static void init_playback(void)
257{
258 unsigned long val;
259 int rc;
260
261 mp3_play_pause(false);
262
263 mas_reset();
264
265 /* Enable the audio CODEC and the DSP core, max analog voltage range */
266 rc = mas_direct_config_write(MAS_CONTROL, 0x8c00);
267 if(rc < 0)
268 panicf("mas_ctrl_w: %d", rc);
269
270 /* Stop the current application */
271 val = 0;
272 mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
273 do
274 {
275 mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
276 } while(val);
277
278 /* Enable the D/A Converter */
279 shadow_codec_reg0 = 0x0001;
280 mas_codec_writereg(0x0, shadow_codec_reg0);
281
282 /* ADC scale 0%, DSP scale 100% */
283 mas_codec_writereg(6, 0x0000);
284 mas_codec_writereg(7, 0x4000);
285
286#ifdef HAVE_SPDIF_OUT
287 val = 0x09; /* Disable SDO and SDI, low impedance S/PDIF outputs */
288#else
289 val = 0x2d; /* Disable SDO and SDI, disable S/PDIF output */
290#endif
291 mas_writemem(MAS_BANK_D0, MAS_D0_INTERFACE_CONTROL, &val, 1);
292
293 /* Set Demand mode and validate all settings */
294 shadow_io_control_main = 0x25;
295 mas_writemem(MAS_BANK_D0, MAS_D0_IO_CONTROL_MAIN, &shadow_io_control_main, 1);
296
297 /* Start the Layer2/3 decoder applications */
298 val = 0x0c;
299 mas_writemem(MAS_BANK_D0, MAS_D0_APP_SELECT, &val, 1);
300 do
301 {
302 mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
303 } while((val & 0x0c) != 0x0c);
304
305#if CONFIG_CODEC == MAS3587F
306 mpeg_mode = MPEG_DECODER;
307#endif
308
309 /* set IRQ6 to edge detect */
310 ICR |= 0x02;
311
312 /* set IRQ6 prio 8 */
313 IPRB = ( IPRB & 0xff0f ) | 0x0080;
314
315 DEBUGF("MAS Decoding application started\n");
316}
317#endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
318
319void mp3_init(int volume, int bass, int treble, int balance, int loudness,
320 int avc, int channel_config, int stereo_width,
321 int mdb_strength, int mdb_harmonics,
322 int mdb_center, int mdb_shape, bool mdb_enable,
323 bool superbass)
324{
325#if CONFIG_CODEC == MAS3507D
326 unsigned long val;
327 (void)loudness;
328 (void)avc;
329 (void)mdb_strength;
330 (void)mdb_harmonics;
331 (void)mdb_center;
332 (void)mdb_shape;
333 (void)mdb_enable;
334 (void)superbass;
335#endif
336
337 setup_sci0();
338
339#ifdef HAVE_MAS_SIBI_CONTROL
340 and_b(~0x01, &PBDRH); /* drive SIBI low */
341 or_b(0x01, &PBIORH); /* output for PB8 */
342#endif
343
344#if CONFIG_CODEC == MAS3507D
345 mas_reset();
346#elif CONFIG_CODEC == MAS3587F
347 or_b(0x08, &PAIORH); /* output for /PR */
348 init_playback();
349
350 mas_version_code = mas_readver();
351 DEBUGF("MAS3587 derivate %d, version %c%d\n",
352 (mas_version_code & 0xf000) >> 12,
353 'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff);
354#elif CONFIG_CODEC == MAS3539F
355 or_b(0x08, &PAIORH); /* output for /PR */
356 init_playback();
357
358 mas_version_code = mas_readver();
359 DEBUGF("MAS3539 derivate %d, version %c%d\n",
360 (mas_version_code & 0xf000) >> 12,
361 'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff);
362#endif
363
364#ifdef HAVE_DAC3550A
365 dac_init();
366#endif
367
368#if CONFIG_CODEC == MAS3507D
369 /* set IRQ6 to edge detect */
370 ICR |= 0x02;
371
372 /* set IRQ6 prio 8 */
373 IPRB = ( IPRB & 0xff0f ) | 0x0080;
374
375 mas_readmem(MAS_BANK_D1, 0xff7, &mas_version_code, 1);
376
377 mas_writereg(0x3b, 0x20); /* Don't ask why. The data sheet doesn't say */
378 mas_run(1);
379 sleep(HZ);
380
381 /* Clear the upper 12 bits of the 32-bit samples */
382 mas_writereg(0xc5, 0);
383 mas_writereg(0xc6, 0);
384
385 /* We need to set the PLL for a 14.31818MHz crystal */
386 if(mas_version_code == 0x0601) /* Version F10? */
387 {
388 val = 0x5d9d0;
389 mas_writemem(MAS_BANK_D0, 0x32d, &val, 1);
390 val = 0xfffceceb;
391 mas_writemem(MAS_BANK_D0, 0x32e, &val, 1);
392 val = 0x0;
393 mas_writemem(MAS_BANK_D0, 0x32f, &val, 1);
394 mas_run(0x475);
395 }
396 else
397 {
398 val = 0x5d9d0;
399 mas_writemem(MAS_BANK_D0, 0x36d, &val, 1);
400 val = 0xfffceceb;
401 mas_writemem(MAS_BANK_D0, 0x36e, &val, 1);
402 val = 0x0;
403 mas_writemem(MAS_BANK_D0, 0x36f, &val, 1);
404 mas_run(0xfcb);
405 }
406
407#endif
408
409#if CONFIG_CODEC == MAS3507D
410 mas_poll_start();
411
412 mas_writereg(MAS_REG_KPRESCALE, 0xe9400);
413 dac_enable(true);
414#endif
415
416#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
417 ICR &= ~0x0010; /* IRQ3 level sensitive */
418 PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */
419#endif
420
421 /* Must be done before calling sound_set() */
422 audio_is_initialized = true;
423
424 sound_set(SOUND_BASS, bass);
425 sound_set(SOUND_TREBLE, treble);
426 sound_set(SOUND_BALANCE, balance);
427 sound_set(SOUND_VOLUME, volume);
428 sound_set(SOUND_CHANNELS, channel_config);
429 sound_set(SOUND_STEREO_WIDTH, stereo_width);
430
431#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
432 sound_set(SOUND_LOUDNESS, loudness);
433 sound_set(SOUND_AVC, avc);
434 sound_set(SOUND_MDB_STRENGTH, mdb_strength);
435 sound_set(SOUND_MDB_HARMONICS, mdb_harmonics);
436 sound_set(SOUND_MDB_CENTER, mdb_center);
437 sound_set(SOUND_MDB_SHAPE, mdb_shape);
438 sound_set(SOUND_MDB_ENABLE, mdb_enable);
439 sound_set(SOUND_SUPERBASS, superbass);
440#endif
441
442 playing = false;
443 paused = true;
444}
445
446void mp3_shutdown(void)
447{
448#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
449 unsigned long val = 1;
450 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &val, 1); /* Mute */
451#endif
452
453#if CONFIG_CODEC == MAS3507D
454 dac_volume(0, 0, false);
455#endif
456}
457
458/* new functions, to be exported to plugin API */
459
460#if CONFIG_CODEC == MAS3587F
461void mp3_play_init(void)
462{
463#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
464 init_playback();
465#endif
466 playing = false;
467 paused = true;
468 callback_for_more = NULL;
469}
470#endif
471
472void mp3_play_data(const void* start, size_t size,
473 mp3_play_callback_t get_more)
474{
475 /* init DMA */
476 DAR3 = 0x5FFFEC3;
477 CHCR3 &= ~0x0002; /* Clear interrupt */
478 CHCR3 = 0x1504; /* Single address destination, TXI0, IE=1 */
479 DMAOR = 0x0001; /* Enable DMA */
480
481 callback_for_more = get_more;
482
483 SAR3 = (unsigned int)start;
484 DTCR3 = size & 0xffff;
485
486 playing = true;
487 paused = true;
488
489 CHCR3 |= 0x0001; /* Enable DMA IRQ */
490
491#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
492 demand_irq_enable(true);
493#endif
494}
495
496void mp3_play_pause(bool play)
497{
498 if (paused && play)
499 { /* resume playback */
500 SCR0 |= 0x80;
501 paused = false;
502 }
503 else if (!paused && !play)
504 { /* stop playback */
505 SCR0 &= 0x7f;
506 paused = true;
507 }
508}
509
510bool mp3_pause_done(void)
511{
512 unsigned long frame_count;
513
514 if (!paused)
515 return false;
516
517 mas_readmem(MAS_BANK_D0, MAS_D0_MPEG_FRAME_COUNT, &frame_count, 1);
518 /* This works because the frame counter never wraps,
519 * i.e. zero always means lost sync. */
520 return frame_count == 0;
521}
522
523void mp3_play_stop(void)
524{
525 playing = false;
526 mp3_play_pause(false);
527 CHCR3 &= ~0x0001; /* Disable the DMA interrupt */
528#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
529 demand_irq_enable(false);
530#endif
531}
532
533bool mp3_is_playing(void)
534{
535 return playing;
536}
537
538
539/* returns the next byte position which would be transferred */
540unsigned char* mp3_get_pos(void)
541{
542 return (unsigned char*)SAR3;
543}
diff --git a/firmware/target/sh/archos/boot.lds b/firmware/target/sh/archos/boot.lds
deleted file mode 100644
index b3c2c90a6c..0000000000
--- a/firmware/target/sh/archos/boot.lds
+++ /dev/null
@@ -1,81 +0,0 @@
1#include "config.h"
2
3ENTRY(start)
4OUTPUT_FORMAT(elf32-sh)
5STARTUP(target/sh/crt0.o)
6
7#define DRAMSIZE (MEMORYSIZE * 0x100000)
8
9#define DRAMORIG 0x09000000
10#define IRAMORIG 0x0f000000
11#define IRAMSIZE 0x1000
12#define FLASHORIG 0x02000000 + ROM_START
13#define FLASHSIZE 256K - ROM_START
14
15MEMORY
16{
17 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
18 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
19 FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
20}
21
22SECTIONS
23{
24 .vectors :
25 {
26 _datacopy = .;
27 } > FLASH
28
29 .data : AT ( _datacopy )
30 {
31 _datastart = .;
32 KEEP(*(.resetvectors));
33 *(.resetvectors);
34 KEEP(*(.vectors));
35 *(.vectors);
36 . = ALIGN(0x200);
37 *(.icode)
38 *(.irodata)
39 *(.idata)
40 *(.data*)
41 . = ALIGN(0x4);
42 _dataend = .;
43 . = ALIGN(0x10); /* Maintain proper alignment for .text section */
44 } > IRAM
45
46 /* TRICK ALERT! Newer versions of the linker don't allow output sections
47 to overlap even if one of them is empty, so advance the location pointer
48 "by hand" */
49 .text LOADADDR(.data) + SIZEOF(.data) :
50 {
51 *(.init.text)
52 *(.text*)
53 . = ALIGN(0x4);
54 } > FLASH
55
56 .rodata :
57 {
58 *(.rodata*)
59 . = ALIGN(0x4);
60 _iramcopy = .;
61 } > FLASH
62
63 .stack :
64 {
65 *(.stack)
66 _stackbegin = .;
67 stackbegin = .;
68 . += 0x2000;
69 _stackend = .;
70 stackend = .;
71 } > IRAM
72
73 .bss :
74 {
75 _edata = .;
76 *(.ibss)
77 *(.bss*)
78 *(COMMON)
79 _end = .;
80 } > IRAM
81}
diff --git a/firmware/target/sh/archos/descramble.S b/firmware/target/sh/archos/descramble.S
deleted file mode 100644
index 0ab5e93dce..0000000000
--- a/firmware/target/sh/archos/descramble.S
+++ /dev/null
@@ -1,121 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22 .section .icode,"ax",@progbits
23
24 .align 2 /* this aligns to 2^2=4 byte bounday */
25 .global _descramble
26 .type _descramble,@function
27
28/* Descramble a block of byte data, from source to dest, processing len
29 * bytes. Size only limited by the len argument. Note that len must
30 * be an even multiple of 4 (something rolo_load() already assumes.
31 * (Does the Archos firmware loader also require that?).
32 *
33 * Returns the 16-bit "sum" checksum of the descrambled data.
34 *
35 * Arguments:
36 * r4 - source (unsigned char*)
37 * r5 - dest (unsigned char*)
38 * r6 - len (unsigned int)
39 *
40 * Register usage:
41 * r0 - data
42 * r1 - temp
43 * r2 - checksum
44 * r3 - current src address
45 * r4 - source
46 * r5 - dest
47 * r6 - len -> source_end
48 * r7 - dest_end
49 * r8 - len / 4
50 */
51
52_descramble:
53 mov.l r8,@-r15
54 mov r6,r8
55 shlr2 r8 /* r8 = len / 4 */
56 mov r5,r7
57 add r6,r7 /* dest_end = dest + len */
58 add r4,r6 /* source_end = source + len */
59 mov r4,r3 /* addr = source */
60 mov #0,r2 /* checksum = 0 */
61
62.loop:
63 mov.b @r3,r0 /* data = *addr */
64 add r8,r3 /* addr += len / 4 */
65 extu.b r0,r0 /* zero extend data byte */
66 swap.b r0,r1 /* byte swap low word to temp */
67 or r1,r0 /* r0's two lower bytes now identical */
68 shlr r0 /* -> this equals "rotr.b r0" now */
69 not r0,r0 /* negate */
70 extu.b r0,r0 /* zero extend low byte (only needed for sum) */
71 mov.b r0,@r5 /* *dest = data */
72 add r0,r2 /* checksum += data */
73 add #1,r5 /* dest++ */
74 cmp/hi r3,r6 /* addr < source_end ? */
75 bt .loop
76
77 add #1,r4 /* source++ */
78 mov r4,r3 /* addr = source */
79 cmp/hi r5,r7 /* dest < dest_end */
80 bt .loop
81
82/* 15 clock cycles if no reset of source address, 19 if reset,
83 * avg. 16 cycles per byte. Magnus' Version needed 17-22 cycles per byte
84 */
85
86 mov.l @r15+,r8
87 rts
88 extu.w r2,r0
89
90
91/* Move len bytes from source to dest (which must be suitably aligned for
92 * long moves) and jump to dest + 0x200.
93 *
94 * Arguments:
95 * r4 - source
96 * r5 - dest
97 * r6 - len
98 */
99
100 .align 2
101 .global _rolo_restart
102 .type _rolo_restart,@function
103
104_rolo_restart:
105 mov r5,r0
106 sub r4,r0 /* r0 = dest - source */
107 add #-4,r0 /* adjust for early increment */
108 add r4,r6 /* r6 = source + len */
109
110.copy: /* loop takes 6 cycles per longword */
111 mov.l @r4+,r1
112 cmp/hi r4,r6
113 mov.l r1,@(r0,r4)
114 bt .copy
115
116 mov.l @r5+,r0 /* start address from image */
117 jmp @r0
118 mov.l @r5+,r15 /* stack pointer from image */
119
120.end:
121 .size _descramble,.end-_descramble
diff --git a/firmware/target/sh/archos/fm_v2/adc-target.h b/firmware/target/sh/archos/fm_v2/adc-target.h
deleted file mode 100644
index 0070828cf3..0000000000
--- a/firmware/target/sh/archos/fm_v2/adc-target.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#define NUM_ADC_CHANNELS 8
25
26#define ADC_BATTERY 0 /* Battery voltage always reads 0x3FF due to
27 silly scaling */
28#define ADC_CHARGE_REGULATOR 0 /* Uh, we read the battery voltage? */
29#define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */
30#define ADC_BUTTON_OFF 2 /* the off button, high value if pressed */
31#define ADC_BUTTON_ON 3 /* the on button, low value if pressed */
32#define ADC_BUTTON_ROW1 4 /* Used for scanning the keys, different
33 voltages for different keys */
34#define ADC_BUTTON_ROW2 5 /* Used for scanning the keys, different
35 voltages for different keys */
36#define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */
37#define ADC_EXT_POWER 7 /* The external power voltage, 0v or 2.7v */
38
39#define EXT_SCALE_FACTOR 14800
40
41#endif /* _ADC_TARGET_H_ */
diff --git a/firmware/target/sh/archos/fm_v2/backlight-target.h b/firmware/target/sh/archos/fm_v2/backlight-target.h
deleted file mode 100644
index c3dd395eca..0000000000
--- a/firmware/target/sh/archos/fm_v2/backlight-target.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef BACKLIGHT_TARGET_H
22#define BACKLIGHT_TARGET_H
23
24#include "config.h"
25#include "rtc.h"
26
27#define backlight_hw_init() true
28
29static inline void backlight_hw_on(void)
30{
31 rtc_write(0x13, 0x10); /* 32 kHz square wave */
32 rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */
33}
34
35static inline void backlight_hw_off(void)
36{
37 /* While on, backlight is flashing at 32 kHz. If the square wave output
38 is disabled while the backlight is lit, it will become constantly lit,
39 (brighter) and slowly fade. This resets the square wave counter and
40 results in the unlit state */
41 unsigned char rtc_0a = rtc_read(0x0a) & ~0x40;
42 rtc_write(0x0a, rtc_0a); /* Disable square wave */
43 rtc_write(0x13, 0xF0); /* 1 Hz square wave */
44 rtc_write(0x0a, rtc_0a | 0x40); /* Enable square wave */
45
46 /* When the square wave output is disabled in the unlit state,
47 the backlight stays off */
48 rtc_write(0x0a, rtc_0a);
49}
50
51#endif
diff --git a/firmware/target/sh/archos/fm_v2/button-fm_v2.c b/firmware/target/sh/archos/fm_v2/button-fm_v2.c
deleted file mode 100644
index 458917d2d5..0000000000
--- a/firmware/target/sh/archos/fm_v2/button-fm_v2.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "system.h"
24#include "button.h"
25#include "backlight.h"
26#include "adc.h"
27
28/*
29 Recorder FM/V2 hardware button hookup
30 =====================================
31
32 F1, F2, F3, UP: connected to AN4 through a resistor network
33 DOWN, PLAY, LEFT, RIGHT: likewise connected to AN5
34
35 The voltage on AN4/ AN5 depends on which keys (or key combo) is pressed
36 FM/V2 has PLAY and RIGHT switched compared to plain recorder
37
38 ON: AN3, low active
39 OFF: AN2, high active
40*/
41
42void button_init_device(void)
43{
44 /* Set PB4 and PB8 as input pins */
45 PBCR1 &= 0xfffc; /* PB8MD = 00 */
46 PBCR2 &= 0xfcff; /* PB4MD = 00 */
47 PBIOR &= ~0x0110; /* Inputs */
48}
49
50int button_read_device(void)
51{
52 int btn = BUTTON_NONE;
53 int data;
54
55 /* check F1..F3 and UP */
56 data = adc_read(ADC_BUTTON_ROW1);
57 if (data >= 150)
58 {
59 if (data >= 545)
60 if (data >= 700)
61 btn = BUTTON_F3;
62 else
63 btn = BUTTON_UP;
64 else
65 if (data >= 385)
66 btn = BUTTON_F2;
67 else
68 btn = BUTTON_F1;
69 }
70
71 /* Some units have mushy keypads, so pressing UP also activates
72 the Left/Right buttons. Let's combat that by skipping the AN5
73 checks when UP is pressed. */
74 if(!(btn & BUTTON_UP))
75 {
76 /* check DOWN, PLAY, LEFT, RIGHT */
77 data = adc_read(ADC_BUTTON_ROW2);
78 if (data >= 150)
79 {
80 if (data >= 545)
81 if (data >= 700)
82 btn |= BUTTON_DOWN;
83 else
84 btn |= BUTTON_RIGHT;
85 else
86 if (data >= 385)
87 btn |= BUTTON_LEFT;
88 else
89 btn |= BUTTON_PLAY;
90 }
91 }
92
93 if ( adc_read(ADC_BUTTON_ON) < 512 )
94 btn |= BUTTON_ON;
95 if ( adc_read(ADC_BUTTON_OFF) > 512 )
96 btn |= BUTTON_OFF;
97
98 return btn;
99}
diff --git a/firmware/target/sh/archos/fm_v2/button-target.h b/firmware/target/sh/archos/fm_v2/button-target.h
deleted file mode 100644
index 47eb48c32d..0000000000
--- a/firmware/target/sh/archos/fm_v2/button-target.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25 /* Main unit's buttons */
26#define BUTTON_ON 0x00000001
27#define BUTTON_OFF 0x00000002
28
29#define BUTTON_LEFT 0x00000004
30#define BUTTON_RIGHT 0x00000008
31#define BUTTON_UP 0x00000010
32#define BUTTON_DOWN 0x00000020
33
34#define BUTTON_PLAY 0x00000040
35
36#define BUTTON_F1 0x00000080
37#define BUTTON_F2 0x00000100
38#define BUTTON_F3 0x00000200
39
40#define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT\
41 |BUTTON_UP|BUTTON_DOWN|BUTTON_PLAY\
42 |BUTTON_F1|BUTTON_F2|BUTTON_F3)
43
44#define POWEROFF_BUTTON BUTTON_OFF
45#define POWEROFF_COUNT 10
46
47#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/sh/archos/fm_v2/power-fm_v2.c b/firmware/target/sh/archos/fm_v2/power-fm_v2.c
deleted file mode 100644
index ce1ef19970..0000000000
--- a/firmware/target/sh/archos/fm_v2/power-fm_v2.c
+++ /dev/null
@@ -1,115 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23#include <stdbool.h>
24#include "adc.h"
25#include "kernel.h"
26#include "system.h"
27#include "power.h"
28#include "usb.h"
29
30#if CONFIG_TUNER
31bool tuner_power(bool status)
32{
33 (void)status;
34 return true;
35}
36
37#endif /* #if CONFIG_TUNER */
38
39void power_init(void)
40{
41 PBCR2 &= ~0x0c00; /* GPIO for PB5 */
42 or_b(0x20, &PBIORL);
43 or_b(0x20, &PBDRL); /* hold power */
44}
45
46unsigned int power_input_status(void)
47{
48 unsigned int status = POWER_INPUT_NONE;
49
50 /* FM or V2 can also charge from the USB port */
51 if (adc_read(ADC_CHARGE_REGULATOR) < 0x1FF)
52 status = POWER_INPUT_MAIN_CHARGER;
53
54#ifdef HAVE_USB_POWER
55 if (usb_detect() == USB_INSERTED)
56 status |= POWER_INPUT_USB_CHARGER;
57#endif
58
59 return status;
60}
61
62/* Returns true if the unit is charging the batteries. */
63bool charging_state(void)
64{
65 /* We use the information from the ADC_EXT_POWER ADC channel, which
66 tells us the charging current from the LTC1734. When DC is
67 connected (either via the external adapter, or via USB), we try
68 to determine if it is actively charging or only maintaining the
69 charge. My tests show that ADC readings below about 0x80 means
70 that the LTC1734 is only maintaining the charge. */
71 return adc_read(ADC_EXT_POWER) >= 0x80;
72}
73
74void ide_power_enable(bool on)
75{
76 bool touched = false;
77
78 if(on)
79 {
80 or_b(0x20, &PADRL);
81 touched = true;
82 }
83#ifdef HAVE_ATA_POWER_OFF
84 if(!on)
85 {
86 and_b(~0x20, &PADRL);
87 touched = true;
88 }
89#endif /* HAVE_ATA_POWER_OFF */
90
91/* late port preparation, else problems with read/modify/write
92 of other bits on same port, while input and floating high */
93 if (touched)
94 {
95 or_b(0x20, &PAIORL); /* PA5 is an output */
96 PACR2 &= 0xFBFF; /* GPIO for PA5 */
97 }
98}
99
100
101bool ide_powered(void)
102{
103 if ((PACR2 & 0x0400) || !(PAIORL & 0x20)) /* not configured for output */
104 return true; /* would be floating high, disk on */
105 else
106 return (PADRL & 0x20) != 0;
107}
108
109void power_off(void)
110{
111 disable_irq();
112 and_b(~0x20, &PBDRL);
113 or_b(0x20, &PBIORL);
114 while(1);
115}
diff --git a/firmware/target/sh/archos/fm_v2/powermgmt-fm_v2.c b/firmware/target/sh/archos/fm_v2/powermgmt-fm_v2.c
deleted file mode 100644
index 5dd7f26d2f..0000000000
--- a/firmware/target/sh/archos/fm_v2/powermgmt-fm_v2.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese
11 * Revisions copyright (C) 2005 by Gerald Van Baren
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "adc.h"
25#include "powermgmt.h"
26
27const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
28{
29 2800
30};
31
32const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
33{
34 2580
35};
36
37/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
38const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
39{
40 /* measured values */
41 { 2600, 2850, 2950, 3030, 3110, 3200, 3300, 3450, 3600, 3800, 4000 }
42};
43
44/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
45const unsigned short percent_to_volt_charge[11] =
46{
47 /* TODO: This is identical to the discharge curve.
48 * Calibrate charging curve using a battery_bench log. */
49 2600, 2850, 2950, 3030, 3110, 3200, 3300, 3450, 3600, 3800, 4000
50};
51
52/* Battery scale factor (guessed, seems to be 1,25 * value from recorder) */
53#define BATTERY_SCALE_FACTOR 8275
54/* full-scale ADC readout (2^10) in millivolt */
55
56/* Returns battery voltage from ADC [millivolts] */
57int _battery_voltage(void)
58{
59 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
60}
diff --git a/firmware/target/sh/archos/fm_v2/usb-fm_v2.c b/firmware/target/sh/archos/fm_v2/usb-fm_v2.c
deleted file mode 100644
index 5b11d778b6..0000000000
--- a/firmware/target/sh/archos/fm_v2/usb-fm_v2.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include <stdbool.h>
23#include "adc.h"
24#include "cpu.h"
25#include "hwcompat.h"
26#include "system.h"
27#include "usb.h"
28
29int usb_detect(void)
30{
31 return (adc_read(ADC_USB_POWER) <= 512) ? USB_INSERTED : USB_EXTRACTED;
32}
33
34void usb_enable(bool on)
35{
36 if(HW_MASK & USB_ACTIVE_HIGH)
37 on = !on;
38
39 if(on)
40 and_b(~0x04, &PADRH); /* enable USB */
41 else
42 or_b(0x04, &PADRH);
43}
44
45void usb_init_device(void)
46{
47 usb_enable(false);
48 or_b(0x04, &PAIORH);
49}
diff --git a/firmware/target/sh/archos/i2c-archos.c b/firmware/target/sh/archos/i2c-archos.c
deleted file mode 100644
index 5b415926f2..0000000000
--- a/firmware/target/sh/archos/i2c-archos.c
+++ /dev/null
@@ -1,254 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "lcd.h"
22#include "cpu.h"
23#include "kernel.h"
24#include "thread.h"
25#include "debug.h"
26#include "system.h"
27#include "i2c.h"
28
29/* cute little functions, atomic read-modify-write */
30
31/* SDA is PB7 */
32#define SDA_LO and_b(~0x80, &PBDRL)
33#define SDA_HI or_b(0x80, &PBDRL)
34#define SDA_INPUT and_b(~0x80, &PBIORL)
35#define SDA_OUTPUT or_b(0x80, &PBIORL)
36#define SDA (PBDRL & 0x80)
37
38#if CONFIG_I2C == I2C_ONDIO
39/* Ondio pinout, SCL moved to PB6 */
40#define SCL_INPUT and_b(~0x40, &PBIORL)
41#define SCL_OUTPUT or_b(0x40, &PBIORL)
42#define SCL_LO and_b(~0x40, &PBDRL)
43#define SCL_HI or_b(0x40, &PBDRL)
44#define SCL (PBDRL & 0x40)
45#else
46/* "classic" pinout, SCL is PB13 */
47#define SCL_INPUT and_b(~0x20, &PBIORH)
48#define SCL_OUTPUT or_b(0x20, &PBIORH)
49#define SCL_LO and_b(~0x20, &PBDRH)
50#define SCL_HI or_b(0x20, &PBDRH)
51#define SCL (PBDRH & 0x20)
52#endif
53
54/* arbitrary delay loop */
55#define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0)
56
57static struct mutex i2c_mtx SHAREDBSS_ATTR;
58
59void i2c_begin(void)
60{
61 mutex_lock(&i2c_mtx);
62}
63
64void i2c_end(void)
65{
66 mutex_unlock(&i2c_mtx);
67}
68
69void i2c_start(void)
70{
71 SDA_OUTPUT;
72 SDA_HI;
73 SCL_HI;
74 SDA_LO;
75 DELAY;
76 SCL_LO;
77}
78
79void i2c_stop(void)
80{
81 SDA_LO;
82 SCL_HI;
83 DELAY;
84 SDA_HI;
85}
86
87void i2c_init(void)
88{
89 int i;
90
91 mutex_init(&i2c_mtx);
92
93#if CONFIG_I2C == I2C_ONDIO
94 /* make PB6 & PB7 general I/O */
95 PBCR2 &= ~0xf000;
96#else /* not Ondio */
97 /* make PB7 & PB13 general I/O */
98 PBCR1 &= ~0x0c00; /* PB13 */
99 PBCR2 &= ~0xc000; /* PB7 */
100#endif
101
102 SCL_OUTPUT;
103 SDA_OUTPUT;
104 SDA_HI;
105 SCL_LO;
106 for (i=0;i<3;i++)
107 i2c_stop();
108}
109
110void i2c_ack(int bit)
111{
112 /* Here's the deal. The MAS is slow, and sometimes needs to wait
113 before it can receive the acknowledge. Therefore it forces the clock
114 low until it is ready. We need to poll the clock line until it goes
115 high before we release the ack. */
116
117 SCL_LO; /* Set the clock low */
118 if ( bit )
119 {
120 SDA_HI;
121 }
122 else
123 {
124 SDA_LO;
125 }
126
127 SCL_INPUT; /* Set the clock to input */
128 while(!SCL) /* and wait for the MAS to release it */
129 sleep(0);
130
131 DELAY;
132 SCL_OUTPUT;
133 SCL_LO;
134}
135
136int i2c_getack(void)
137{
138 int ret = 1;
139
140 /* Here's the deal. The MAS is slow, and sometimes needs to wait
141 before it can send the acknowledge. Therefore it forces the clock
142 low until it is ready. We need to poll the clock line until it goes
143 high before we read the ack. */
144
145#ifdef HAVE_I2C_LOW_FIRST
146 SDA_LO; /* First, discharge the data line */
147#endif
148 SDA_INPUT; /* And set to input */
149 SCL_INPUT; /* Set the clock to input */
150 while(!SCL) /* and wait for the MAS to release it */
151 sleep(0);
152
153 if (SDA)
154 /* ack failed */
155 ret = 0;
156
157 SCL_OUTPUT;
158 SCL_LO;
159 SDA_HI;
160 SDA_OUTPUT;
161 return ret;
162}
163
164void i2c_outb(unsigned char byte)
165{
166 int i;
167
168 /* clock out each bit, MSB first */
169 for ( i=0x80; i; i>>=1 ) {
170 if ( i & byte )
171 {
172 SDA_HI;
173 }
174 else
175 {
176 SDA_LO;
177 }
178 SCL_HI;
179 SCL_LO;
180 }
181
182 SDA_HI;
183}
184
185unsigned char i2c_inb(int ack)
186{
187 int i;
188 unsigned char byte = 0;
189
190 /* clock in each bit, MSB first */
191 for ( i=0x80; i; i>>=1 ) {
192#ifdef HAVE_I2C_LOW_FIRST
193 /* Tricky business. Here we discharge the data line by driving it low
194 and then set it to input to see if it stays low or goes high */
195 SDA_LO; /* First, discharge the data line */
196#endif
197 SDA_INPUT; /* And set to input */
198 SCL_HI;
199 if ( SDA )
200 byte |= i;
201 SCL_LO;
202 SDA_OUTPUT;
203 }
204
205 i2c_ack(ack);
206
207 return byte;
208}
209
210int i2c_write(int address, const unsigned char* buf, int count )
211{
212 int i,x=0;
213
214 i2c_start();
215 i2c_outb(address & 0xfe);
216 if (i2c_getack())
217 {
218 for (i=0; i<count; i++)
219 {
220 i2c_outb(buf[i]);
221 if (!i2c_getack())
222 {
223 x=-2;
224 break;
225 }
226 }
227 }
228 else
229 {
230 debugf("i2c_write() - no ack\n");
231 x=-1;
232 }
233 i2c_stop();
234 return x;
235}
236
237#if 0 /* Currently unused, left for reference and future use */
238int i2c_read(int address, unsigned char* buf, int count )
239{
240 int i,x=0;
241
242 i2c_start();
243 i2c_outb(address | 1);
244 if (i2c_getack()) {
245 for (i=0; i<count; i++) {
246 buf[i] = i2c_inb(0);
247 }
248 }
249 else
250 x=-1;
251 i2c_stop();
252 return x;
253}
254#endif
diff --git a/firmware/target/sh/archos/lcd-archos-bitmap.c b/firmware/target/sh/archos/lcd-archos-bitmap.c
deleted file mode 100644
index f23289053d..0000000000
--- a/firmware/target/sh/archos/lcd-archos-bitmap.c
+++ /dev/null
@@ -1,224 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Alan Korr
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22
23#include "hwcompat.h"
24#include "kernel.h"
25#include "lcd.h"
26#include "system.h"
27
28/*** definitions ***/
29
30#define LCD_SET_LOWER_COLUMN_ADDRESS ((char)0x00)
31#define LCD_SET_HIGHER_COLUMN_ADDRESS ((char)0x10)
32#define LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO ((char)0x20)
33#define LCD_SET_POWER_CONTROL_REGISTER ((char)0x28)
34#define LCD_SET_DISPLAY_START_LINE ((char)0x40)
35#define LCD_SET_CONTRAST_CONTROL_REGISTER ((char)0x81)
36#define LCD_SET_SEGMENT_REMAP ((char)0xA0)
37#define LCD_SET_LCD_BIAS ((char)0xA2)
38#define LCD_SET_ENTIRE_DISPLAY_OFF ((char)0xA4)
39#define LCD_SET_ENTIRE_DISPLAY_ON ((char)0xA5)
40#define LCD_SET_NORMAL_DISPLAY ((char)0xA6)
41#define LCD_SET_REVERSE_DISPLAY ((char)0xA7)
42#define LCD_SET_MULTIPLEX_RATIO ((char)0xA8)
43#define LCD_SET_BIAS_TC_OSC ((char)0xA9)
44#define LCD_SET_1OVER4_BIAS_RATIO ((char)0xAA)
45#define LCD_SET_INDICATOR_OFF ((char)0xAC)
46#define LCD_SET_INDICATOR_ON ((char)0xAD)
47#define LCD_SET_DISPLAY_OFF ((char)0xAE)
48#define LCD_SET_DISPLAY_ON ((char)0xAF)
49#define LCD_SET_PAGE_ADDRESS ((char)0xB0)
50#define LCD_SET_COM_OUTPUT_SCAN_DIRECTION ((char)0xC0)
51#define LCD_SET_TOTAL_FRAME_PHASES ((char)0xD2)
52#define LCD_SET_DISPLAY_OFFSET ((char)0xD3)
53#define LCD_SET_READ_MODIFY_WRITE_MODE ((char)0xE0)
54#define LCD_SOFTWARE_RESET ((char)0xE2)
55#define LCD_NOP ((char)0xE3)
56#define LCD_SET_END_OF_READ_MODIFY_WRITE_MODE ((char)0xEE)
57
58/* LCD command codes */
59#define LCD_CNTL_RESET 0xe2 /* Software reset */
60#define LCD_CNTL_POWER 0x2f /* Power control */
61#define LCD_CNTL_CONTRAST 0x81 /* Contrast */
62#define LCD_CNTL_OUTSCAN 0xc8 /* Output scan direction */
63#define LCD_CNTL_SEGREMAP 0xa1 /* Segment remap */
64#define LCD_CNTL_DISPON 0xaf /* Display on */
65
66#define LCD_CNTL_PAGE 0xb0 /* Page address */
67#define LCD_CNTL_HIGHCOL 0x10 /* Upper column address */
68#define LCD_CNTL_LOWCOL 0x00 /* Lower column address */
69
70/** globals **/
71
72static int xoffset; /* needed for flip */
73
74/*** hardware configuration ***/
75
76int lcd_default_contrast(void)
77{
78 return (HW_MASK & LCD_CONTRAST_BIAS) ? 31 : 49;
79}
80
81void lcd_set_contrast(int val)
82{
83 lcd_write_command(LCD_CNTL_CONTRAST);
84 lcd_write_command(val);
85}
86
87void lcd_set_invert_display(bool yesno)
88{
89 if (yesno)
90 lcd_write_command(LCD_SET_REVERSE_DISPLAY);
91 else
92 lcd_write_command(LCD_SET_NORMAL_DISPLAY);
93}
94
95/* turn the display upside down (call lcd_update() afterwards) */
96void lcd_set_flip(bool yesno)
97{
98#ifdef HAVE_DISPLAY_FLIPPED
99 if (!yesno)
100#else
101 if (yesno)
102#endif
103 {
104 lcd_write_command(LCD_SET_SEGMENT_REMAP);
105 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION);
106 xoffset = 132 - LCD_WIDTH; /* 132 colums minus the 112 we have */
107 }
108 else
109 {
110 lcd_write_command(LCD_SET_SEGMENT_REMAP | 0x01);
111 lcd_write_command(LCD_SET_COM_OUTPUT_SCAN_DIRECTION | 0x08);
112 xoffset = 0;
113 }
114}
115
116void lcd_init_device(void)
117{
118 /* Initialize PB0-3 as output pins */
119 PBCR2 &= 0xff00; /* MD = 00 */
120 PBIOR |= 0x000f; /* IOR = 1 */
121
122 /* inits like the original firmware */
123 lcd_write_command(LCD_SOFTWARE_RESET);
124 lcd_write_command(LCD_SET_INTERNAL_REGULATOR_RESISTOR_RATIO + 4);
125 lcd_write_command(LCD_SET_1OVER4_BIAS_RATIO + 0); /* force 1/4 bias: 0 */
126 lcd_write_command(LCD_SET_POWER_CONTROL_REGISTER + 7);
127 /* power control register: op-amp=1, regulator=1, booster=1 */
128 lcd_write_command(LCD_SET_DISPLAY_ON);
129 lcd_write_command(LCD_SET_NORMAL_DISPLAY);
130 lcd_set_flip(false);
131 lcd_write_command(LCD_SET_DISPLAY_START_LINE + 0);
132 lcd_set_contrast(lcd_default_contrast());
133 lcd_write_command(LCD_SET_PAGE_ADDRESS);
134 lcd_write_command(LCD_SET_LOWER_COLUMN_ADDRESS + 0);
135 lcd_write_command(LCD_SET_HIGHER_COLUMN_ADDRESS + 0);
136
137 lcd_clear_display();
138 lcd_update();
139}
140
141/*** Update functions ***/
142
143/* Performance function that works with an external buffer
144 note that by and bheight are in 8-pixel units! */
145void lcd_blit_mono(const unsigned char *data, int x, int by, int width,
146 int bheight, int stride)
147{
148 /* Copy display bitmap to hardware */
149 while (bheight--)
150 {
151 lcd_write_command (LCD_CNTL_PAGE | (by++ & 0xf));
152 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset)>>4) & 0xf));
153 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
154
155 lcd_write_data(data, width);
156 data += stride;
157 }
158}
159
160/* Helper function for lcd_grey_phase_blit(). */
161void lcd_grey_data(unsigned char *values, unsigned char *phases, int count);
162
163/* Performance function that works with an external buffer
164 note that by and bheight are in 8-pixel units! */
165void lcd_blit_grey_phase(unsigned char *values, unsigned char *phases,
166 int x, int by, int width, int bheight, int stride)
167{
168 stride <<= 3; /* 8 pixels per block */
169 while (bheight--)
170 {
171 lcd_write_command (LCD_CNTL_PAGE | (by++ & 0xf));
172 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset)>>4) & 0xf));
173 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
174
175 lcd_grey_data(values, phases, width);
176 values += stride;
177 phases += stride;
178 }
179}
180
181
182/* Update the display.
183 This must be called after all other LCD functions that change the display. */
184void lcd_update(void)
185{
186 int y;
187
188 /* Copy display bitmap to hardware */
189 for (y = 0; y < LCD_FBHEIGHT; y++)
190 {
191 lcd_write_command (LCD_CNTL_PAGE | (y & 0xf));
192 lcd_write_command (LCD_CNTL_HIGHCOL | ((xoffset >> 4) & 0xf));
193 lcd_write_command (LCD_CNTL_LOWCOL | (xoffset & 0xf));
194
195 lcd_write_data (FBADDR(0, y), LCD_WIDTH);
196 }
197}
198
199/* Update a fraction of the display. */
200void lcd_update_rect(int x, int y, int width, int height)
201{
202 int ymax;
203
204 /* The Y coordinates have to work on even 8 pixel rows */
205 ymax = (y + height-1) >> 3;
206 y >>= 3;
207
208 if(x + width > LCD_WIDTH)
209 width = LCD_WIDTH - x;
210 if (width <= 0)
211 return; /* nothing left to do, 0 is harmful to lcd_write_data() */
212 if(ymax >= LCD_FBHEIGHT)
213 ymax = LCD_FBHEIGHT-1;
214
215 /* Copy specified rectange bitmap to hardware */
216 for (; y <= ymax; y++)
217 {
218 lcd_write_command (LCD_CNTL_PAGE | (y & 0xf));
219 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset) >> 4) & 0xf));
220 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
221
222 lcd_write_data (FBADDR(x,y), width);
223 }
224}
diff --git a/firmware/target/sh/archos/lcd-as-archos-bitmap.S b/firmware/target/sh/archos/lcd-as-archos-bitmap.S
deleted file mode 100644
index 0396483737..0000000000
--- a/firmware/target/sh/archos/lcd-as-archos-bitmap.S
+++ /dev/null
@@ -1,354 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Jens Arnold
11 * Based on the work of Alan Korr and Jörg Hohensohn
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "cpu.h"
25
26#define LCDR (PBDR_ADDR+1)
27
28#define LCD_SD 1 /* PB0 = 1 --- 0001 */
29#define LCD_SC 2 /* PB1 = 1 --- 0010 */
30#define LCD_DS 4 /* PB2 = 1 --- 0100 */
31#define LCD_CS 8 /* PB3 = 1 --- 1000 */
32
33/*
34 * About /CS,DS,SC,SD
35 * ------------------
36 *
37 * LCD on JBP and JBR uses a SPI protocol to receive orders (SDA and SCK lines)
38 *
39 * - /CS -> Chip Selection line :
40 * 0 : LCD chipset is activated.
41 * - DS -> Data Selection line, latched at the rising edge
42 * of the 8th serial clock (*) :
43 * 0 : instruction register,
44 * 1 : data register;
45 * - SC -> Serial Clock line (SDA).
46 * - SD -> Serial Data line (SCK), latched at the rising edge
47 * of each serial clock (*).
48 *
49 * _ _
50 * /CS \ /
51 * \______________________________________________________/
52 * _____ ____ ____ ____ ____ ____ ____ ____ ____ _____
53 * SD \/ D7 \/ D6 \/ D5 \/ D4 \/ D3 \/ D2 \/ D1 \/ D0 \/
54 * _____/\____/\____/\____/\____/\____/\____/\____/\____/\_____
55 *
56 * _____ _ _ _ _ _ _ _ ________
57 * SC \ * \ * \ * \ * \ * \ * \ * \ *
58 * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
59 * _ _________________________________________________________
60 * DS \/
61 * _/\_________________________________________________________
62 *
63 */
64
65 .section .icode,"ax",@progbits
66
67 .align 2
68 .global _lcd_write_command
69 .type _lcd_write_command,@function
70
71/* Write a command byte to the lcd controller
72 *
73 * Arguments:
74 * r4 - data byte (int)
75 *
76 * Register usage:
77 * r0 - scratch
78 * r1 - data byte (copied)
79 * r2 - precalculated port value (CS, DS and SC low, SD high),
80 * negated (neg)!
81 * r3 - lcd port address
82 * r5 - 1 (byte count for reuse of the loop in _lcd_write_data)
83 */
84
85_lcd_write_command:
86 mov.l .lcdr, r3 /* put lcd data port address in r3 */
87 mov r4, r1 /* copy data byte to r1 */
88
89 /* This code will fail if an interrupt changes the contents of PBDRL.
90 * If so, we must disable the interrupt here. */
91
92 mov.b @r3, r0 /* r0 = PBDRL */
93 mov #0, r5 /* fake end address - stop after first iteration */
94 or #(LCD_SD), r0 /* r0 |= LCD_SD */
95 and #(~(LCD_CS|LCD_DS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_DS|LCD_SC) */
96
97 bra .single_transfer /* jump into the transfer loop */
98 neg r0, r2 /* r2 = 0 - r0 */
99
100
101 .align 2
102 .global _lcd_write_data
103 .type _lcd_write_data,@function
104
105/* A high performance function to write data to the display,
106 * one or multiple bytes.
107 *
108 * Arguments:
109 * r4 - data address
110 * r5 - byte count
111 *
112 * Register usage:
113 * r0 - scratch
114 * r1 - current data byte
115 * r2 - precalculated port value (CS and SC low, DS and SD high),
116 * negated (neg)!
117 * r3 - lcd port address
118 */
119
120_lcd_write_data:
121 mov.l .lcdr, r3 /* put lcd data port address in r3 */
122 add r4, r5 /* end address */
123
124 /* This code will fail if an interrupt changes the contents of PBDRL.
125 * If so, we must disable the interrupt here. If disabling interrupts
126 * for a long time (~9200 clks = ~830 µs for transferring 112 bytes on
127 * recorders)is undesirable, the loop has to be rewritten to
128 * disable/precalculate/transfer/enable for each iteration. However,
129 * this would significantly decrease performance. */
130
131 mov.b @r3, r0 /* r0 = PBDRL */
132 or #(LCD_DS|LCD_SD), r0 /* r0 |= LCD_DS|LCD_SD */
133 and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */
134 neg r0, r2 /* r2 = 0 - r0 */
135
136 /* loop exploits that SD is on bit 0 for recorders and Ondios */
137
138 .align 2
139.multi_transfer:
140 mov.b @r4+, r1 /* load data byte from memory */
141 nop
142
143.single_transfer:
144 shll16 r1 /* shift data to most significant byte */
145 shll8 r1
146 not r1, r1 /* and invert for use with negc */
147
148 shll r1 /* shift the MSB into carry */
149 negc r2, r0 /* carry to SD, SC low */
150 shll r1 /* next shift here for alignment */
151 mov.b r0, @r3 /* set data to port */
152 or #(LCD_SC), r0 /* rise SC (independent of SD level) */
153 mov.b r0, @r3 /* set to port */
154
155 negc r2, r0
156 mov.b r0, @r3
157 or #(LCD_SC), r0
158 mov.b r0, @r3
159
160 shll r1
161 negc r2, r0
162 shll r1
163 mov.b r0, @r3
164 or #(LCD_SC), r0
165 mov.b r0, @r3
166
167 negc r2, r0
168 mov.b r0, @r3
169 or #(LCD_SC), r0
170 mov.b r0, @r3
171
172 shll r1
173 negc r2, r0
174 shll r1
175 mov.b r0, @r3
176 or #(LCD_SC), r0
177 mov.b r0, @r3
178
179 negc r2, r0
180 mov.b r0, @r3
181 or #(LCD_SC), r0
182 mov.b r0, @r3
183
184 shll r1
185 negc r2, r0
186 shll r1
187 mov.b r0, @r3
188 or #(LCD_SC), r0
189 mov.b r0, @r3
190
191 negc r2, r0
192 mov.b r0, @r3
193 or #(LCD_SC), r0
194 mov.b r0, @r3
195
196 cmp/hi r4, r5 /* some blocks left? */
197 bt .multi_transfer
198
199 or #(LCD_CS|LCD_DS|LCD_SD|LCD_SC), r0 /* restore port */
200 rts
201 mov.b r0, @r3
202
203 /* This is the place to reenable the interrupts, if we have disabled
204 * them. See above. */
205
206#ifndef BOOTLOADER
207 .align 2
208 .global _lcd_grey_data
209 .type _lcd_grey_data,@function
210
211/* A high performance function to write grey phase data to the display,
212 * one or multiple pixels.
213 *
214 * Arguments:
215 * r4 - pixel value data address
216 * r5 - pixel phase data address
217 * r6 - pixel block count
218 *
219 * Register usage:
220 * r0 - scratch / phase signs mask
221 * r1 - scratch
222 * r2 - precalculated port value (CS and SC low, DS and SD high),
223 * negated (neg)!
224 * r3 - lcd port address
225 * r4 - current value address
226 * r5 - current phase address
227 * r6 - end address
228 * r7/r8 - current/next block of phases (alternating)
229 * r9/r10 - current blocks of values
230 * r11 - 0x00000080 \
231 * r12 - 0x00008000 > for phase sign check
232 * r13 - 0x00800000 /
233 */
234
235_lcd_grey_data:
236 mov.l r8, @-r15 /* save r8 */
237 mov.l r9, @-r15 /* save r9 */
238 mov.l r10, @-r15 /* save r10 */
239 shll2 r6 /* v */
240 mov.l r11, @-r15 /* save r11 */
241 shll r6 /* r6 *= 8; (8 pixels per block) */
242 mov.l .lcdr, r3 /* put lcd data port address in r3 */
243 add r4, r6 /* end address */
244
245 /* This code will fail if an interrupt changes the contents of PBDRL.
246 * If so, we must disable the interrupt here. If disabling interrupts
247 * for a long time is undesirable, the loop has to be rewritten to
248 * disable/precalculate/transfer/enable for each iteration. However,
249 * this would significantly decrease performance. */
250
251 mov.b @r3, r0 /* r0 = PBDRL */
252 or #(LCD_DS|LCD_SD), r0 /* r0 |= LCD_DS|LCD_SD */
253 mov.l r12, @-r15 /* save r12 */
254 and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */
255 mov.l r13, @-r15 /* save r13 */
256 neg r0, r2 /* r2 = 0 - r0 */
257
258 /* loop exploits that SD is on bit 0 for recorders and Ondios */
259
260 mov.w .ptest, r11
261 swap.b r11, r12
262 mov.l @r5, r7
263 swap.w r11, r13
264 mov.l .pmask, r0
265
266.greyloop:
267 cmp/pz r7
268 mov.l @r4+, r9
269 negc r2, r1
270 mov.b r1, @r3
271 add #(LCD_SC), r1
272 mov.b r1, @r3
273
274 tst r13, r7
275 mov.l @r4+, r10
276 negc r2, r1
277 mov.b r1, @r3
278 add #(LCD_SC), r1
279 mov.b r1, @r3
280
281 tst r12, r7
282 mov.l @(4,r5), r8
283 negc r2, r1
284 mov.b r1, @r3
285 add #(LCD_SC), r1
286 mov.b r1, @r3
287
288 tst r11, r7
289 or r0, r7
290 negc r2, r1
291 mov.b r1, @r3
292 add #(LCD_SC), r1
293 mov.b r1, @r3
294
295 cmp/pz r8
296 sub r9, r7
297 negc r2, r1
298 mov.b r1, @r3
299 add #(LCD_SC), r1
300 mov.b r1, @r3
301
302 tst r13, r8
303 mov.l r7, @r5
304 negc r2, r1
305 mov.b r1, @r3
306 add #(LCD_SC), r1
307 mov.b r1, @r3
308
309 tst r12, r8
310 mov.l @(8,r5), r7
311 negc r2, r1
312 mov.b r1, @r3
313 add #(LCD_SC), r1
314 mov.b r1, @r3
315
316 tst r11, r8
317 or r0, r8
318 negc r2, r1
319 mov.b r1, @r3
320 add #(LCD_SC), r1
321 mov.b r1, @r3
322
323 sub r10, r8
324 mov.l r8, @(4,r5)
325
326 add #8, r5
327 cmp/hi r4, r6
328 bt .greyloop
329
330 mov.l @r15+, r13 /* restore r13 */
331 mov #(LCD_CS|LCD_DS|LCD_SD|LCD_SC), r0
332 mov.l @r15+, r12 /* restore r12 */
333 or r0, r1 /* restore port */
334 mov.l @r15+, r11 /* restore r11 */
335 mov.l @r15+, r10 /* restore r10 */
336 mov.l @r15+, r9 /* restore r9 */
337 mov.l @r15+, r8 /* restore r8 */
338 rts
339 mov.b r1, @r3
340
341 /* This is the place to reenable the interrupts, if we have disabled
342 * them. See above. */
343
344.ptest:
345 .short 0x0080
346
347 .align 2
348.pmask:
349 .long 0x80808080
350#endif
351
352 .align 2
353.lcdr:
354 .long LCDR
diff --git a/firmware/target/sh/archos/mascodec-archos.c b/firmware/target/sh/archos/mascodec-archos.c
deleted file mode 100644
index faa5c7ef2b..0000000000
--- a/firmware/target/sh/archos/mascodec-archos.c
+++ /dev/null
@@ -1,491 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "stdbool.h"
22#include "config.h"
23#include "sh7034.h"
24#include "i2c.h"
25#include "debug.h"
26#include "mas35xx.h"
27#include "kernel.h"
28#include "system.h"
29#include "hwcompat.h"
30
31static int mas_devread(unsigned long *dest, int len);
32
33#if 0 /* Currently unused, left for reference and future use */
34int mas_default_read(unsigned short *buf)
35{
36 unsigned char *dest = (unsigned char *)buf;
37 int ret = 0;
38
39 i2c_begin();
40
41 i2c_start();
42 i2c_outb(MAS_DEV_WRITE);
43 if (i2c_getack()) {
44 i2c_outb(MAS_DATA_READ);
45 if (i2c_getack()) {
46 i2c_start();
47 i2c_outb(MAS_DEV_READ);
48 if (i2c_getack()) {
49 dest[0] = i2c_inb(0);
50 dest[1] = i2c_inb(1);
51 }
52 else
53 ret = -3;
54 }
55 else
56 ret = -2;
57 }
58 else
59 ret = -1;
60
61 i2c_stop();
62
63 i2c_end();
64 return ret;
65}
66#endif
67
68#if CONFIG_CODEC == MAS3507D
69int mas_run(unsigned short address)
70{
71 int ret = 0;
72 unsigned char buf[3];
73
74 i2c_begin();
75
76 buf[0] = MAS_DATA_WRITE;
77 buf[1] = address >> 8;
78 buf[2] = address & 0xff;
79
80 /* send run command */
81 if (i2c_write(MAS_DEV_WRITE,buf,3))
82 {
83 ret = -1;
84 }
85
86 i2c_end();
87 return ret;
88}
89#endif
90
91/* note: 'len' is number of 32-bit words, not number of bytes! */
92int mas_readmem(int bank, int addr, unsigned long* dest, int len)
93{
94 int ret = 0;
95 unsigned char buf[7];
96
97 i2c_begin();
98
99 buf[0] = MAS_DATA_WRITE;
100 buf[1] = bank?MAS_CMD_READ_D1_MEM:MAS_CMD_READ_D0_MEM;
101 buf[2] = 0x00;
102 buf[3] = (len & 0xff00) >> 8;
103 buf[4] = len & 0xff;
104 buf[5] = (addr & 0xff00) >> 8;
105 buf[6] = addr & 0xff;
106
107 /* send read command */
108 if (i2c_write(MAS_DEV_WRITE,buf,7))
109 {
110 ret = -1;
111 }
112
113 ret = mas_devread(dest, len);
114
115 i2c_end();
116 return ret;
117}
118
119/* note: 'len' is number of 32-bit words, not number of bytes! */
120int mas_writemem(int bank, int addr, const unsigned long* src, int len)
121{
122 int ret = 0;
123 int i, j;
124 unsigned char buf[60];
125 const unsigned char* ptr = (const unsigned char*)src;
126
127 i2c_begin();
128
129 i=0;
130 buf[i++] = MAS_DATA_WRITE;
131 buf[i++] = bank?MAS_CMD_WRITE_D1_MEM:MAS_CMD_WRITE_D0_MEM;
132 buf[i++] = 0x00;
133 buf[i++] = (len & 0xff00) >> 8;
134 buf[i++] = len & 0xff;
135 buf[i++] = (addr & 0xff00) >> 8;
136 buf[i++] = addr & 0xff;
137
138 j = 0;
139 while(len--) {
140#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
141 buf[i++] = 0;
142 buf[i++] = ptr[j+1];
143 buf[i++] = ptr[j+2];
144 buf[i++] = ptr[j+3];
145#else
146 buf[i++] = ptr[j+2];
147 buf[i++] = ptr[j+3];
148 buf[i++] = 0;
149 buf[i++] = ptr[j+1];
150#endif
151 j += 4;
152 }
153
154 /* send write command */
155 if (i2c_write(MAS_DEV_WRITE,buf,i))
156 {
157 ret = -1;
158 }
159
160 i2c_end();
161 return ret;
162}
163
164int mas_readreg(int reg)
165{
166 int ret = 0;
167 unsigned char buf[16];
168 unsigned long value;
169
170 i2c_begin();
171
172 buf[0] = MAS_DATA_WRITE;
173 buf[1] = MAS_CMD_READ_REG | (reg >> 4);
174 buf[2] = (reg & 0x0f) << 4;
175
176 /* send read command */
177 if (i2c_write(MAS_DEV_WRITE,buf,3))
178 {
179 ret = -1;
180 }
181 else
182 {
183 if(mas_devread(&value, 1))
184 {
185 ret = -2;
186 }
187 else
188 {
189 ret = value;
190 }
191 }
192
193 i2c_end();
194 return ret;
195}
196
197int mas_writereg(int reg, unsigned int val)
198{
199 int ret = 0;
200 unsigned char buf[5];
201
202 i2c_begin();
203
204 buf[0] = MAS_DATA_WRITE;
205 buf[1] = MAS_CMD_WRITE_REG | (reg >> 4);
206#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
207 buf[2] = ((reg & 0x0f) << 4) | (val >> 16 & 0x0f);
208 buf[3] = (val >> 8) & 0xff;
209 buf[4] = val & 0xff;
210#else
211 buf[2] = ((reg & 0x0f) << 4) | (val & 0x0f);
212 buf[3] = (val >> 12) & 0xff;
213 buf[4] = (val >> 4) & 0xff;
214#endif
215
216 /* send write command */
217 if (i2c_write(MAS_DEV_WRITE,buf,5))
218 {
219 ret = -1;
220 }
221
222 i2c_end();
223 return ret;
224}
225
226/* note: 'len' is number of 32-bit words, not number of bytes! */
227static int mas_devread(unsigned long *dest, int len)
228{
229 int ret = 0;
230 unsigned char* ptr = (unsigned char*)dest;
231 int i;
232
233 /* handle read-back */
234 /* Remember, the MAS values are only 20 bits, so we set
235 the upper 12 bits to 0 */
236 i2c_start();
237 i2c_outb(MAS_DEV_WRITE);
238 if (i2c_getack()) {
239 i2c_outb(MAS_DATA_READ);
240 if (i2c_getack()) {
241 i2c_start();
242 i2c_outb(MAS_DEV_READ);
243 if (i2c_getack()) {
244 for (i=0;len;i++) {
245 len--;
246#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
247 i2c_inb(0); /* Dummy read */
248 ptr[i*4+0] = 0;
249 ptr[i*4+1] = i2c_inb(0) & 0x0f;
250 ptr[i*4+2] = i2c_inb(0);
251 if(len)
252 ptr[i*4+3] = i2c_inb(0);
253 else
254 ptr[i*4+3] = i2c_inb(1); /* NAK the last byte */
255#else
256 ptr[i*4+2] = i2c_inb(0);
257 ptr[i*4+3] = i2c_inb(0);
258 ptr[i*4+0] = i2c_inb(0);
259 if(len)
260 ptr[i*4+1] = i2c_inb(0);
261 else
262 ptr[i*4+1] = i2c_inb(1); /* NAK the last byte */
263#endif
264 }
265 }
266 else
267 ret = -3;
268 }
269 else
270 ret = -2;
271 }
272 else
273 ret = -1;
274
275 i2c_stop();
276
277 return ret;
278}
279
280void mas_reset(void)
281{
282 or_b(0x01, &PAIORH);
283
284#if CONFIG_CODEC == MAS3507D
285 /* PB5 is "MAS enable". make it GPIO output and high */
286 PBCR2 &= ~0x0c00;
287 or_b(0x20, &PBIORL);
288 or_b(0x20, &PBDRL);
289
290 and_b(~0x01, &PADRH);
291 sleep(HZ/100);
292 or_b(0x01, &PADRH);
293 sleep(HZ/5);
294#elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
295 if (HW_MASK & ATA_ADDRESS_200)
296 {
297 and_b(~0x01, &PADRH);
298 sleep(HZ/100);
299 or_b(0x01, &PADRH);
300 sleep(HZ/5);
301 }
302 else
303 {
304 /* Older recorder models don't invert the POR signal */
305 or_b(0x01, &PADRH);
306 sleep(HZ/100);
307 and_b(~0x01, &PADRH);
308 sleep(HZ/5);
309 }
310#endif
311}
312
313#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
314#if 0 /* Currently unused, left for reference and future use */
315int mas_direct_config_read(unsigned char reg)
316{
317 int ret = 0;
318 unsigned char tmp[2];
319
320 i2c_begin();
321
322 i2c_start();
323 i2c_outb(MAS_DEV_WRITE);
324 if (i2c_getack()) {
325 i2c_outb(reg);
326 if (i2c_getack()) {
327 i2c_start();
328 i2c_outb(MAS_DEV_READ);
329 if (i2c_getack()) {
330 tmp[0] = i2c_inb(0);
331 tmp[1] = i2c_inb(1); /* NAK the last byte */
332 ret = (tmp[0] << 8) | tmp[1];
333 }
334 else
335 ret = -3;
336 }
337 else
338 ret = -2;
339 }
340 else
341 ret = -1;
342
343 i2c_stop();
344
345 i2c_end();
346 return ret;
347}
348#endif
349
350int mas_direct_config_write(unsigned char reg, unsigned int val)
351{
352 int ret = 0;
353 unsigned char buf[3];
354
355 i2c_begin();
356
357 buf[0] = reg;
358 buf[1] = (val >> 8) & 0xff;
359 buf[2] = val & 0xff;
360
361 /* send write command */
362 if (i2c_write(MAS_DEV_WRITE,buf,3))
363 {
364 ret = -1;
365 }
366
367 i2c_end();
368 return ret;
369}
370
371int mas_codec_writereg(int reg, unsigned int val)
372{
373 int ret = 0;
374 unsigned char buf[5];
375
376 i2c_begin();
377
378 buf[0] = MAS_CODEC_WRITE;
379 buf[1] = (reg >> 8) & 0xff;
380 buf[2] = reg & 0xff;
381 buf[3] = (val >> 8) & 0xff;
382 buf[4] = val & 0xff;
383
384 /* send write command */
385 if (i2c_write(MAS_DEV_WRITE,buf,5))
386 {
387 ret = -1;
388 }
389
390 i2c_end();
391 return ret;
392}
393
394int mas_codec_readreg(int reg)
395{
396 int ret = 0;
397 unsigned char buf[16];
398 unsigned char tmp[2];
399
400 i2c_begin();
401
402 buf[0] = MAS_CODEC_WRITE;
403 buf[1] = (reg >> 8) & 0xff;
404 buf[2] = reg & 0xff;
405
406 /* send read command */
407 if (i2c_write(MAS_DEV_WRITE,buf,3))
408 {
409 ret = -1;
410 }
411 else
412 {
413 i2c_start();
414 i2c_outb(MAS_DEV_WRITE);
415 if (i2c_getack()) {
416 i2c_outb(MAS_CODEC_READ);
417 if (i2c_getack()) {
418 i2c_start();
419 i2c_outb(MAS_DEV_READ);
420 if (i2c_getack()) {
421 tmp[0] = i2c_inb(0);
422 tmp[1] = i2c_inb(1); /* NAK the last byte */
423 ret = (tmp[0] << 8) | tmp[1];
424 }
425 else
426 ret = -4;
427 }
428 else
429 ret = -3;
430 }
431 else
432 ret = -2;
433
434 i2c_stop();
435 }
436
437 i2c_end();
438 return ret;
439}
440
441unsigned long mas_readver(void)
442{
443 int ret = 0;
444 unsigned char buf[16];
445 unsigned long value;
446
447 i2c_begin();
448
449 buf[0] = MAS_DATA_WRITE;
450 buf[1] = MAS_CMD_READ_IC_VER;
451 buf[2] = 0;
452
453 /* send read command */
454 if (i2c_write(MAS_DEV_WRITE,buf,3))
455 {
456 ret = -1;
457 }
458 else
459 {
460 if(mas_devread(&value, 1))
461 {
462 ret = -2;
463 }
464 else
465 {
466 ret = value;
467 }
468 }
469
470 i2c_end();
471 return ret;
472}
473
474#endif
475
476#if CONFIG_TUNER & S1A0903X01
477static int pllfreq;
478
479void mas_store_pllfreq(int freq)
480{
481 pllfreq = freq;
482}
483
484int mas_get_pllfreq(void)
485{
486 return pllfreq;
487}
488#endif
489
490
491
diff --git a/firmware/target/sh/archos/ondio/adc-target.h b/firmware/target/sh/archos/ondio/adc-target.h
deleted file mode 100644
index a39ee110f3..0000000000
--- a/firmware/target/sh/archos/ondio/adc-target.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#define NUM_ADC_CHANNELS 8
25
26#define ADC_MMC_SWITCH 0 /* low values if MMC inserted */
27#define ADC_USB_POWER 1 /* USB, reads 0x000 when USB is inserted */
28#define ADC_BUTTON_OPTION 2 /* the option button, low value if pressed */
29#define ADC_BUTTON_ONOFF 3 /* the on/off button, high value if pressed */
30#define ADC_BUTTON_ROW1 4 /* Used for scanning the keys, different
31 voltages for different keys */
32#define ADC_USB_ACTIVE 5 /* USB bridge activity */
33#define ADC_UNREG_POWER 7 /* Battery voltage */
34
35#define EXT_SCALE_FACTOR 14800
36
37#endif /* _ADC_TARGET_H_ */
diff --git a/firmware/target/sh/archos/ondio/ata_mmc.c b/firmware/target/sh/archos/ondio/ata_mmc.c
deleted file mode 100644
index f252e1c4ce..0000000000
--- a/firmware/target/sh/archos/ondio/ata_mmc.c
+++ /dev/null
@@ -1,978 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "ata_mmc.h"
23#include "sdmmc.h"
24#include "kernel.h"
25#include "led.h"
26#include "sh7034.h"
27#include "system.h"
28#include "debug.h"
29#include "panic.h"
30#include "power.h"
31#include "string.h"
32#include "hwcompat.h"
33#include "adc.h"
34#include "bitswap.h"
35#include "storage.h"
36
37
38#ifdef HAVE_MULTIDRIVE
39#define MMC_NUM_DRIVES 2
40#else
41#define MMC_NUM_DRIVES 1
42#endif
43
44#define BLOCK_SIZE 512 /* fixed */
45
46/* Command definitions */
47#define CMD_GO_IDLE_STATE 0x40 /* R1 */
48#define CMD_SEND_OP_COND 0x41 /* R1 */
49#define CMD_SEND_CSD 0x49 /* R1 */
50#define CMD_SEND_CID 0x4a /* R1 */
51#define CMD_STOP_TRANSMISSION 0x4c /* R1 */
52#define CMD_SEND_STATUS 0x4d /* R2 */
53#define CMD_SET_BLOCKLEN 0x50 /* R1 */
54#define CMD_READ_SINGLE_BLOCK 0x51 /* R1 */
55#define CMD_READ_MULTIPLE_BLOCK 0x52 /* R1 */
56#define CMD_WRITE_BLOCK 0x58 /* R1b */
57#define CMD_WRITE_MULTIPLE_BLOCK 0x59 /* R1b */
58#define CMD_READ_OCR 0x7a /* R3 */
59
60/* Response formats:
61 R1 = single byte, msb=0, various error flags
62 R1b = R1 + busy token(s)
63 R2 = 2 bytes (1st byte identical to R1), additional flags
64 R3 = 5 bytes (R1 + OCR register)
65*/
66
67#define R1_PARAMETER_ERR 0x40
68#define R1_ADDRESS_ERR 0x20
69#define R1_ERASE_SEQ_ERR 0x10
70#define R1_COM_CRC_ERR 0x08
71#define R1_ILLEGAL_CMD 0x04
72#define R1_ERASE_RESET 0x02
73#define R1_IN_IDLE_STATE 0x01
74
75#define R2_OUT_OF_RANGE 0x80
76#define R2_ERASE_PARAM 0x40
77#define R2_WP_VIOLATION 0x20
78#define R2_CARD_ECC_FAIL 0x10
79#define R2_CC_ERROR 0x08
80#define R2_ERROR 0x04
81#define R2_ERASE_SKIP 0x02
82#define R2_CARD_LOCKED 0x01
83
84/* Data start tokens */
85
86#define DT_START_BLOCK 0xfe
87#define DT_START_WRITE_MULTIPLE 0xfc
88#define DT_STOP_TRAN 0xfd
89
90/* for compatibility */
91static long last_disk_activity = -1;
92
93/* private variables */
94
95#ifdef CONFIG_STORAGE_MULTI
96static int mmc_first_drive = 0;
97#else
98#define mmc_first_drive 0
99#endif
100
101static struct mutex mmc_mutex SHAREDBSS_ATTR;
102
103static bool initialized = false;
104static bool new_mmc_circuit;
105
106static enum {
107 MMC_UNKNOWN,
108 MMC_UNTOUCHED,
109 MMC_TOUCHED
110} mmc_status = MMC_UNKNOWN;
111
112static enum {
113 SER_POLL_WRITE,
114 SER_POLL_READ,
115 SER_DISABLED
116} serial_mode;
117
118static const unsigned char dummy[] = {
119 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
120};
121
122/* 2 buffers used alternatively for writing, including start token,
123 * dummy CRC and an extra byte to keep word alignment. */
124static unsigned char write_buffer[2][BLOCK_SIZE+4];
125static int current_buffer = 0;
126static const unsigned char *send_block_addr = NULL;
127
128static tCardInfo card_info[2];
129#ifndef HAVE_MULTIDRIVE
130static int current_card = 0;
131#endif
132static bool last_mmc_status = false;
133static int countdown = -1; /* for mmc switch debouncing. -1 because the
134 countdown should not happen if the card
135 is inserted at boot */
136static bool usb_activity; /* monitoring the USB bridge */
137static long last_usb_activity;
138
139/* private function declarations */
140
141static int select_card(int card_no);
142static void deselect_card(void);
143static void setup_sci1(int bitrate_register);
144static void set_sci1_poll_read(void);
145static void write_transfer(const unsigned char *buf, int len)
146 __attribute__ ((section(".icode")));
147static void read_transfer(unsigned char *buf, int len)
148 __attribute__ ((section(".icode")));
149static unsigned char poll_byte(long timeout);
150static unsigned char poll_busy(long timeout);
151static unsigned char send_cmd(int cmd, unsigned long parameter, void *data);
152static int receive_cxd(unsigned char *buf);
153static int initialize_card(int card_no);
154static int receive_block(unsigned char *inbuf, long timeout);
155static void send_block_prepare(void);
156static int send_block_send(unsigned char start_token, long timeout,
157 bool prepare_next);
158static void mmc_tick(void);
159
160/* implementation */
161
162static void enable_controller(bool on)
163{
164 PBCR1 &= ~0x0CF0; /* PB13, PB11 and PB10 become GPIO,
165 * if not modified below */
166 if (on)
167 PBCR1 |= 0x08A0; /* as SCK1, TxD1, RxD1 */
168
169 and_b(~0x80, &PADRL); /* assert flash reset */
170 sleep(HZ/100);
171 or_b(0x80, &PADRL); /* de-assert flash reset */
172 sleep(HZ/100);
173 card_info[0].initialized = false;
174 card_info[1].initialized = false;
175}
176
177void mmc_enable_int_flash_clock(bool on)
178{
179 /* Internal flash clock is enabled by setting PA12 high with the new
180 * clock circuit, and by setting it low with the old clock circuit */
181 if (on ^ new_mmc_circuit)
182 and_b(~0x10, &PADRH); /* clear clock gate PA12 */
183 else
184 or_b(0x10, &PADRH); /* set clock gate PA12 */
185}
186
187static int select_card(int card_no)
188{
189 mutex_lock(&mmc_mutex);
190 led(true);
191 last_disk_activity = current_tick;
192
193 mmc_enable_int_flash_clock(card_no == 0);
194
195 if (!card_info[card_no].initialized)
196 {
197 setup_sci1(7); /* Initial rate: 375 kbps (need <= 400 per mmc specs) */
198 write_transfer(dummy, 10); /* allow the card to synchronize */
199 while (!(SSR1 & SCI_TEND));
200 }
201
202 if (card_no == 0) /* internal */
203 and_b(~0x04, &PADRH); /* assert CS */
204 else /* external */
205 and_b(~0x02, &PADRH); /* assert CS */
206
207 if (card_info[card_no].initialized)
208 {
209 setup_sci1(card_info[card_no].bitrate_register);
210 return 0;
211 }
212 else
213 {
214 return initialize_card(card_no);
215 }
216}
217
218static void deselect_card(void)
219{
220 while (!(SSR1 & SCI_TEND)); /* wait for end of transfer */
221 or_b(0x06, &PADRH); /* deassert CS (both cards) */
222
223 led(false);
224 mutex_unlock(&mmc_mutex);
225 last_disk_activity = current_tick;
226}
227
228static void setup_sci1(int bitrate_register)
229{
230 while (!(SSR1 & SCI_TEND)); /* wait for end of transfer */
231
232 SCR1 = 0; /* disable serial port */
233 SMR1 = SYNC_MODE; /* no prescale */
234 BRR1 = bitrate_register;
235 SSR1 = 0;
236
237 SCR1 = SCI_TE; /* enable transmitter */
238 serial_mode = SER_POLL_WRITE;
239}
240
241static void set_sci1_poll_read(void)
242{
243 while (!(SSR1 & SCI_TEND)); /* wait for end of transfer */
244 SCR1 = 0; /* disable transmitter (& receiver) */
245 SCR1 = (SCI_TE|SCI_RE); /* re-enable transmitter & receiver */
246 while (!(SSR1 & SCI_TEND)); /* wait for SCI init completion (!) */
247 serial_mode = SER_POLL_READ;
248 TDR1 = 0xFF; /* send do-nothing while reading */
249}
250
251static void write_transfer(const unsigned char *buf, int len)
252{
253 const unsigned char *buf_end = buf + len;
254 register unsigned char data;
255
256 if (serial_mode != SER_POLL_WRITE)
257 {
258 while (!(SSR1 & SCI_TEND)); /* wait for end of transfer */
259 SCR1 = 0; /* disable transmitter & receiver */
260 SSR1 = 0; /* clear all flags */
261 SCR1 = SCI_TE; /* enable transmitter only */
262 serial_mode = SER_POLL_WRITE;
263 }
264
265 while (buf < buf_end)
266 {
267 data = fliptable[(signed char)(*buf++)]; /* bitswap */
268 while (!(SSR1 & SCI_TDRE)); /* wait for end of transfer */
269 TDR1 = data; /* write byte */
270 SSR1 = 0; /* start transmitting */
271 }
272}
273
274/* don't call this with len == 0 */
275static void read_transfer(unsigned char *buf, int len)
276{
277 unsigned char *buf_end = buf + len - 1;
278 register signed char data;
279
280 if (serial_mode != SER_POLL_READ)
281 set_sci1_poll_read();
282
283 SSR1 = 0; /* start receiving first byte */
284 while (buf < buf_end)
285 {
286 while (!(SSR1 & SCI_RDRF)); /* wait for data */
287 data = RDR1; /* read byte */
288 SSR1 = 0; /* start receiving */
289 *buf++ = fliptable[data]; /* bitswap */
290 }
291 while (!(SSR1 & SCI_RDRF)); /* wait for last byte */
292 *buf = fliptable[(signed char)(RDR1)]; /* read & bitswap */
293}
294
295/* returns 0xFF on timeout, timeout is in bytes */
296static unsigned char poll_byte(long timeout)
297{
298 long i;
299 unsigned char data = 0; /* stop the compiler complaining */
300
301 if (serial_mode != SER_POLL_READ)
302 set_sci1_poll_read();
303
304 i = 0;
305 do {
306 SSR1 = 0; /* start receiving */
307 while (!(SSR1 & SCI_RDRF)); /* wait for data */
308 data = RDR1; /* read byte */
309 } while ((data == 0xFF) && (++i < timeout));
310
311 return fliptable[(signed char)data];
312}
313
314/* returns 0 on timeout, timeout is in bytes */
315static unsigned char poll_busy(long timeout)
316{
317 long i;
318 unsigned char data, dummy;
319
320 if (serial_mode != SER_POLL_READ)
321 set_sci1_poll_read();
322
323 /* get data response */
324 SSR1 = 0; /* start receiving */
325 while (!(SSR1 & SCI_RDRF)); /* wait for data */
326 data = fliptable[(signed char)(RDR1)]; /* read byte */
327
328 /* wait until the card is ready again */
329 i = 0;
330 do {
331 SSR1 = 0; /* start receiving */
332 while (!(SSR1 & SCI_RDRF)); /* wait for data */
333 dummy = RDR1; /* read byte */
334 } while ((dummy != 0xFF) && (++i < timeout));
335
336 return (dummy == 0xFF) ? data : 0;
337}
338
339/* Send MMC command and get response. Returns R1 byte directly.
340 * Returns further R2 or R3 bytes in *data (can be NULL for other commands) */
341static unsigned char send_cmd(int cmd, unsigned long parameter, void *data)
342{
343 static struct {
344 unsigned char cmd;
345 unsigned long parameter;
346 const unsigned char crc7; /* fixed, valid for CMD0 only */
347 const unsigned char trailer;
348 } __attribute__((packed)) command = {0x40, 0, 0x95, 0xFF};
349
350 unsigned char ret;
351
352 command.cmd = cmd;
353 command.parameter = htobe32(parameter);
354
355 write_transfer((unsigned char *)&command, sizeof(command));
356
357 ret = poll_byte(20);
358
359 switch (cmd)
360 {
361 case CMD_SEND_CSD: /* R1 response, leave open */
362 case CMD_SEND_CID:
363 case CMD_READ_SINGLE_BLOCK:
364 case CMD_READ_MULTIPLE_BLOCK:
365 return ret;
366
367 case CMD_SEND_STATUS: /* R2 response, close with dummy */
368 read_transfer(data, 1);
369 break;
370
371 case CMD_READ_OCR: /* R3 response, close with dummy */
372 read_transfer(data, 4);
373 break;
374
375 default: /* R1 response, close with dummy */
376 break; /* also catches block writes */
377 }
378 write_transfer(dummy, 1);
379 return ret;
380}
381
382/* Receive CID/ CSD data (16 bytes) */
383static int receive_cxd(unsigned char *buf)
384{
385 if (poll_byte(20) != DT_START_BLOCK)
386 {
387 write_transfer(dummy, 1);
388 return -1; /* not start of data */
389 }
390
391 read_transfer(buf, 16);
392 write_transfer(dummy, 3); /* 2 bytes dontcare crc + 1 byte trailer */
393 return 0;
394}
395
396
397static int initialize_card(int card_no)
398{
399 int rc, i;
400 int blk_exp, ts_exp, taac_exp;
401 tCardInfo *card = &card_info[card_no];
402
403 static const char mantissa[] = { /* *10 */
404 0, 10, 12, 13, 15, 20, 25, 30,
405 35, 40, 45, 50, 55, 60, 70, 80
406 };
407 static const int exponent[] = { /* use varies */
408 1, 10, 100, 1000, 10000, 100000, 1000000,
409 10000000, 100000000, 1000000000
410 };
411
412 if (card_no == 1)
413 mmc_status = MMC_TOUCHED;
414
415 /* switch to SPI mode */
416 if (send_cmd(CMD_GO_IDLE_STATE, 0, NULL) != 0x01)
417 return -1; /* error or no response */
418
419 /* initialize card */
420 for (i = HZ;;) /* try for 1 second*/
421 {
422 sleep(1);
423 if (send_cmd(CMD_SEND_OP_COND, 0, NULL) == 0)
424 break;
425 if (--i <= 0)
426 return -2; /* timeout */
427 }
428
429 /* get OCR register */
430 if (send_cmd(CMD_READ_OCR, 0, &card->ocr))
431 return -3;
432 card->ocr = betoh32(card->ocr); /* no-op on big endian */
433
434 /* check voltage */
435 if (!(card->ocr & 0x00100000)) /* 3.2 .. 3.3 V */
436 return -4;
437
438 /* get CSD register */
439 if (send_cmd(CMD_SEND_CSD, 0, NULL))
440 return -5;
441 rc = receive_cxd((unsigned char*)card->csd);
442 if (rc)
443 return rc * 10 - 5;
444
445 blk_exp = card_extract_bits(card->csd, 83, 4);
446 if (blk_exp < 9) /* block size < 512 bytes not supported */
447 return -6;
448
449 card->numblocks = (card_extract_bits(card->csd, 73, 12) + 1)
450 << (card_extract_bits(card->csd, 49, 3) + 2 + blk_exp - 9);
451 card->blocksize = BLOCK_SIZE;
452
453 /* max transmission speed, clock divider */
454 ts_exp = card_extract_bits(card->csd, 98, 3);
455 ts_exp = (ts_exp > 3) ? 3 : ts_exp;
456 card->speed = mantissa[card_extract_bits(card->csd, 102, 4)]
457 * exponent[ts_exp + 4];
458 card->bitrate_register = (FREQ/4-1) / card->speed;
459
460 /* NSAC, TAAC, read timeout */
461 card->nsac = 100 * card_extract_bits(card->csd, 111, 8);
462 card->taac = mantissa[card_extract_bits(card->csd, 118, 4)];
463 taac_exp = card_extract_bits(card->csd, 114, 3);
464 card->read_timeout = ((FREQ/4) / (card->bitrate_register + 1)
465 * card->taac / exponent[9 - taac_exp]
466 + (10 * card->nsac));
467 card->read_timeout /= 8; /* clocks -> bytes */
468 card->taac = card->taac * exponent[taac_exp] / 10;
469
470 /* r2w_factor, write timeout */
471 card->r2w_factor = BIT_N(card_extract_bits(card->csd, 28, 3));
472 card->write_timeout = card->read_timeout * card->r2w_factor;
473
474 if (card->r2w_factor > 32) /* Such cards often need extra read delay */
475 card->read_timeout *= 4;
476
477 /* switch to full speed */
478 setup_sci1(card->bitrate_register);
479
480 /* always use 512 byte blocks */
481 if (send_cmd(CMD_SET_BLOCKLEN, BLOCK_SIZE, NULL))
482 return -7;
483
484 /* get CID register */
485 if (send_cmd(CMD_SEND_CID, 0, NULL))
486 return -8;
487 rc = receive_cxd((unsigned char*)card->cid);
488 if (rc)
489 return rc * 10 - 8;
490
491 card->initialized = true;
492 return 0;
493}
494
495tCardInfo *mmc_card_info(int card_no)
496{
497 tCardInfo *card = &card_info[card_no];
498
499 if (!card->initialized && ((card_no == 0) || mmc_detect()))
500 {
501 select_card(card_no);
502 deselect_card();
503 }
504 return card;
505}
506
507/* Receive one block with DMA and bitswap it (chasing bitswap). */
508static int receive_block(unsigned char *inbuf, long timeout)
509{
510 unsigned long buf_end;
511
512 if (poll_byte(timeout) != DT_START_BLOCK)
513 {
514 write_transfer(dummy, 1);
515 return -1; /* not start of data */
516 }
517
518 while (!(SSR1 & SCI_TEND)); /* wait for end of transfer */
519
520 SCR1 = 0; /* disable serial */
521 SSR1 = 0; /* clear all flags */
522
523 /* setup DMA channel 0 */
524 CHCR0 = 0; /* disable */
525 SAR0 = RDR1_ADDR;
526 DAR0 = (unsigned long) inbuf;
527 DTCR0 = BLOCK_SIZE;
528 CHCR0 = 0x4601; /* fixed source address, RXI1, enable */
529 DMAOR = 0x0001;
530 SCR1 = (SCI_RE|SCI_RIE); /* kick off DMA */
531
532 /* DMA receives 2 bytes more than DTCR2, but the last 2 bytes are not
533 * stored. The first extra byte is available from RDR1 after the DMA ends,
534 * the second one is lost because of the SCI overrun. However, this
535 * behaviour conveniently discards the crc. */
536
537 yield(); /* be nice */
538
539 /* Bitswap received data, chasing the DMA pointer */
540 buf_end = (unsigned long)inbuf + BLOCK_SIZE;
541 do
542 {
543 /* Call bitswap whenever (a multiple of) 8 bytes are
544 * available (value optimised by experimentation). */
545 int swap_now = (DAR0 - (unsigned long)inbuf) & ~0x00000007;
546 if (swap_now)
547 {
548 bitswap(inbuf, swap_now);
549 inbuf += swap_now;
550 }
551 }
552 while ((unsigned long)inbuf < buf_end);
553
554 while (!(CHCR0 & 0x0002)); /* wait for end of DMA */
555 while (!(SSR1 & SCI_ORER)); /* wait for the trailing bytes */
556 SCR1 = 0;
557 serial_mode = SER_DISABLED;
558
559 write_transfer(dummy, 1); /* send trailer */
560 last_disk_activity = current_tick;
561 return 0;
562}
563
564/* Prepare a block for sending by copying it to the next write buffer
565 * and bitswapping it. */
566static void send_block_prepare(void)
567{
568 unsigned char *dest;
569
570 current_buffer ^= 1; /* toggle buffer */
571 dest = write_buffer[current_buffer] + 2;
572
573 memcpy(dest, send_block_addr, BLOCK_SIZE);
574 bitswap(dest, BLOCK_SIZE);
575
576 send_block_addr += BLOCK_SIZE;
577}
578
579/* Send one block with DMA from the current write buffer, possibly preparing
580 * the next block within the next write buffer in the background. */
581static int send_block_send(unsigned char start_token, long timeout,
582 bool prepare_next)
583{
584 int rc = 0;
585 unsigned char *curbuf = write_buffer[current_buffer];
586
587 curbuf[1] = fliptable[(signed char)start_token];
588 *(unsigned short *)(curbuf + BLOCK_SIZE + 2) = 0xFFFF;
589
590 while (!(SSR1 & SCI_TEND)); /* wait for end of transfer */
591
592 SCR1 = 0; /* disable serial */
593 SSR1 = 0; /* clear all flags */
594
595 /* setup DMA channel 0 */
596 CHCR0 = 0; /* disable */
597 SAR0 = (unsigned long)(curbuf + 1);
598 DAR0 = TDR1_ADDR;
599 DTCR0 = BLOCK_SIZE + 3; /* start token + block + dummy crc */
600 CHCR0 = 0x1701; /* fixed dest. address, TXI1, enable */
601 DMAOR = 0x0001;
602 SCR1 = (SCI_TE|SCI_TIE); /* kick off DMA */
603
604 if (prepare_next)
605 send_block_prepare();
606 yield(); /* be nice */
607
608 while (!(CHCR0 & 0x0002)); /* wait for end of DMA */
609 while (!(SSR1 & SCI_TEND)); /* wait for end of transfer */
610 SCR1 = 0;
611 serial_mode = SER_DISABLED;
612
613 if ((poll_busy(timeout) & 0x1F) != 0x05) /* something went wrong */
614 rc = -1;
615
616 write_transfer(dummy, 1);
617 last_disk_activity = current_tick;
618
619 return rc;
620}
621
622int mmc_read_sectors(IF_MD(int drive,)
623 unsigned long start,
624 int incount,
625 void* inbuf)
626{
627 int rc = 0;
628 int lastblock = 0;
629 unsigned long end_block;
630 tCardInfo *card;
631#ifndef HAVE_MULTIDRIVE
632 int drive = current_card;
633#endif
634
635 card = &card_info[drive];
636 rc = select_card(drive);
637 if (rc)
638 {
639 rc = rc * 10 - 1;
640 goto error;
641 }
642
643 end_block = start + incount;
644 if (end_block > card->numblocks)
645 {
646 rc = -2;
647 goto error;
648 }
649
650 /* Some cards don't like reading the very last block with
651 * CMD_READ_MULTIPLE_BLOCK, so make sure this block is always
652 * read with CMD_READ_SINGLE_BLOCK. */
653 if (end_block == card->numblocks)
654 lastblock = 1;
655
656 if (incount > 1)
657 {
658 /* MMC4.2: make multiplication conditional */
659 if (send_cmd(CMD_READ_MULTIPLE_BLOCK, start * BLOCK_SIZE, NULL))
660 {
661 rc = -3;
662 goto error;
663 }
664 while (--incount >= lastblock)
665 {
666 rc = receive_block(inbuf, card->read_timeout);
667 if (rc)
668 {
669 /* If an error occurs during multiple block reading, the
670 * host still needs to send CMD_STOP_TRANSMISSION */
671 send_cmd(CMD_STOP_TRANSMISSION, 0, NULL);
672 rc = rc * 10 - 4;
673 goto error;
674 }
675 inbuf += BLOCK_SIZE;
676 start++;
677 /* ^^ necessary for the abovementioned last block special case */
678 }
679 if (send_cmd(CMD_STOP_TRANSMISSION, 0, NULL))
680 {
681 rc = -5;
682 goto error;
683 }
684 }
685 if (incount > 0)
686 {
687 /* MMC4.2: make multiplication conditional */
688 if (send_cmd(CMD_READ_SINGLE_BLOCK, start * BLOCK_SIZE, NULL))
689 {
690 rc = -6;
691 goto error;
692 }
693 rc = receive_block(inbuf, card->read_timeout);
694 if (rc)
695 {
696 rc = rc * 10 - 7;
697 goto error;
698 }
699 }
700
701 error:
702
703 deselect_card();
704
705 return rc;
706}
707
708int mmc_write_sectors(IF_MD(int drive,)
709 unsigned long start,
710 int count,
711 const void* buf)
712{
713 int rc = 0;
714 int write_cmd;
715 unsigned char start_token;
716 tCardInfo *card;
717#ifndef HAVE_MULTIDRIVE
718 int drive = current_card;
719#endif
720
721 card = &card_info[drive];
722 rc = select_card(drive);
723 if (rc)
724 {
725 rc = rc * 10 - 1;
726 goto error;
727 }
728
729 if (start + count > card->numblocks)
730 panicf("Writing past end of card");
731
732 send_block_addr = buf;
733 send_block_prepare();
734
735 if (count > 1)
736 {
737 write_cmd = CMD_WRITE_MULTIPLE_BLOCK;
738 start_token = DT_START_WRITE_MULTIPLE;
739 }
740 else
741 {
742 write_cmd = CMD_WRITE_BLOCK;
743 start_token = DT_START_BLOCK;
744 }
745 /* MMC4.2: make multiplication conditional */
746 if (send_cmd(write_cmd, start * BLOCK_SIZE, NULL))
747 {
748 rc = -2;
749 goto error;
750 }
751 while (--count >= 0)
752 {
753 rc = send_block_send(start_token, card->write_timeout, count > 0);
754 if (rc)
755 {
756 rc = rc * 10 - 3;
757 break;
758 /* If an error occurs during multiple block writing,
759 * the STOP_TRAN token still needs to be sent. */
760 }
761 }
762 if (write_cmd == CMD_WRITE_MULTIPLE_BLOCK)
763 {
764 static const unsigned char stop_tran = DT_STOP_TRAN;
765 write_transfer(&stop_tran, 1);
766 poll_busy(card->write_timeout);
767 }
768
769 error:
770
771 deselect_card();
772
773 return rc;
774}
775
776bool mmc_disk_is_active(void)
777{
778 /* this is correct unless early return from write gets implemented */
779 return mutex_test(&mmc_mutex);
780}
781
782bool mmc_detect(void)
783{
784 return (adc_read(ADC_MMC_SWITCH) < 0x200);
785}
786
787bool mmc_touched(void)
788{
789 if (mmc_status == MMC_UNKNOWN) /* try to detect */
790 {
791 mutex_lock(&mmc_mutex);
792 setup_sci1(7); /* safe value */
793 and_b(~0x02, &PADRH); /* assert CS */
794 if (send_cmd(CMD_SEND_OP_COND, 0, NULL) == 0xFF)
795 mmc_status = MMC_UNTOUCHED;
796 else
797 mmc_status = MMC_TOUCHED;
798
799 deselect_card();
800 }
801 return mmc_status == MMC_TOUCHED;
802}
803
804bool mmc_usb_active(int delayticks)
805{
806 /* reading "inactive" is delayed by user-supplied monoflop value */
807 return (usb_activity ||
808 TIME_BEFORE(current_tick, last_usb_activity + delayticks));
809}
810
811static void mmc_tick(void)
812{
813 bool current_status;
814
815 if (new_mmc_circuit)
816 /* USB bridge activity is 0 on idle, ~527 on active */
817 current_status = adc_read(ADC_USB_ACTIVE) > 0x100;
818 else
819 current_status = adc_read(ADC_USB_ACTIVE) < 0x190;
820
821 if (!current_status && usb_activity)
822 last_usb_activity = current_tick;
823 usb_activity = current_status;
824
825 current_status = mmc_detect();
826 /* Only report when the status has changed */
827 if (current_status != last_mmc_status)
828 {
829 last_mmc_status = current_status;
830 countdown = HZ/3;
831 }
832 else
833 {
834 /* Count down until it gets negative */
835 if (countdown >= 0)
836 countdown--;
837
838 if (countdown == 0)
839 {
840 if (current_status)
841 {
842 queue_broadcast(SYS_HOTSWAP_INSERTED, mmc_first_drive + 1);
843 }
844 else
845 {
846 queue_broadcast(SYS_HOTSWAP_EXTRACTED, mmc_first_drive + 1);
847 mmc_status = MMC_UNTOUCHED;
848 card_info[1].initialized = false;
849 }
850 }
851 }
852}
853
854void mmc_enable(bool on)
855{
856 mutex_lock(&mmc_mutex);
857 enable_controller(on);
858 mutex_unlock(&mmc_mutex);
859}
860
861int mmc_init(void)
862{
863 int rc = 0;
864
865 if (!initialized)
866 mutex_init(&mmc_mutex);
867
868 mutex_lock(&mmc_mutex);
869 led(false);
870
871 last_mmc_status = mmc_detect();
872#ifndef HAVE_MULTIDRIVE
873 /* Use MMC if inserted, internal flash otherwise */
874 current_card = last_mmc_status ? 1 : 0;
875#endif
876
877 if (!initialized)
878 {
879 if (!last_mmc_status)
880 mmc_status = MMC_UNTOUCHED;
881
882 /* Port setup */
883 PACR1 &= ~0x0F3C; /* GPIO function for PA13 (flash busy), PA12
884 * (clk gate), PA10 (flash CS), PA9 (MMC CS) */
885 PACR2 &= ~0x4000; /* GPIO for PA7 (flash reset) */
886 PADR |= 0x0680; /* set all the selects + reset high (=inactive) */
887 PAIOR |= 0x1680; /* make outputs for them and the PA12 clock gate */
888
889 PBCR1 &= ~0x0CF0; /* GPIO function for PB13, PB11 and PB10 */
890 PBDR |= 0x2C00; /* SCK1, TxD1 and RxD1 high in GPIO */
891 PBIOR |= 0x2000; /* SCK1 output */
892 PBIOR &= ~0x0C00; /* TxD1, RxD1 input */
893
894 IPRE &= 0x0FFF; /* disable SCI1 interrupts for the CPU */
895
896 new_mmc_circuit = ((HW_MASK & MMC_CLOCK_POLARITY) != 0);
897 tick_add_task(mmc_tick);
898 initialized = true;
899 }
900 enable_controller(true);
901
902 mutex_unlock(&mmc_mutex);
903 return rc;
904}
905
906long mmc_last_disk_activity(void)
907{
908 return last_disk_activity;
909}
910
911#ifdef STORAGE_GET_INFO
912void mmc_get_info(IF_MD(int drive,) struct storage_info *info)
913{
914#ifndef HAVE_MULTIDRIVE
915 const int drive=0;
916#endif
917 info->sector_size=card_info[drive].blocksize;
918 info->num_sectors=card_info[drive].numblocks;
919 info->vendor="Rockbox";
920 if(drive==0)
921 {
922 info->product="Internal Storage";
923 }
924 else
925 {
926 info->product="MMC Card Slot";
927 }
928 info->revision="0.00";
929}
930#endif
931
932#ifdef HAVE_HOTSWAP
933bool mmc_removable(IF_MD_NONVOID(int drive))
934{
935#ifndef HAVE_MULTIDRIVE
936 const int drive=0;
937#endif
938 return (drive==1);
939}
940
941bool mmc_present(IF_MD_NONVOID(int drive))
942{
943#ifndef HAVE_MULTIDRIVE
944 const int drive=0;
945#endif
946 if(drive==0)
947 {
948 return true;
949 }
950 else
951 {
952 return mmc_detect();
953 }
954}
955#endif
956
957void mmc_spin(void)
958{
959}
960
961void mmc_spindown(int seconds)
962{
963 (void)seconds;
964}
965
966#ifdef CONFIG_STORAGE_MULTI
967int mmc_num_drives(int first_drive)
968{
969 mmc_first_drive = first_drive;
970 return MMC_NUM_DRIVES;
971}
972#endif /* CONFIG_STORAGE_MULTI */
973
974int mmc_event(long id, intptr_t data)
975{
976 return storage_event_default_handler(id, data, last_disk_activity,
977 STORAGE_MMC);
978}
diff --git a/firmware/target/sh/archos/ondio/backlight-target.h b/firmware/target/sh/archos/ondio/backlight-target.h
deleted file mode 100644
index 438c8c926a..0000000000
--- a/firmware/target/sh/archos/ondio/backlight-target.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef BACKLIGHT_TARGET_H
22#define BACKLIGHT_TARGET_H
23
24#include "config.h"
25#include "cpu.h"
26
27#ifdef HAVE_BACKLIGHT
28/* A stock Ondio has no backlight, it needs a hardware mod. */
29
30static inline bool backlight_hw_init(void)
31{
32 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
33 or_b(0x40, &PADRH); /* drive it high */
34 or_b(0x40, &PAIORH); /* ..and output */
35 return true;
36}
37
38static inline void backlight_hw_on(void)
39{
40 or_b(0x40, &PADRH); /* drive it high */
41}
42
43static inline void backlight_hw_off(void)
44{
45 and_b(~0x40, &PADRH); /* drive it low */
46}
47#endif /* HAVE_BACKLIGHT */
48
49#endif
diff --git a/firmware/target/sh/archos/ondio/button-ondio.c b/firmware/target/sh/archos/ondio/button-ondio.c
deleted file mode 100644
index e3b370bc1f..0000000000
--- a/firmware/target/sh/archos/ondio/button-ondio.c
+++ /dev/null
@@ -1,71 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "system.h"
24#include "button.h"
25#include "backlight.h"
26#include "adc.h"
27
28/*
29 Ondio hardware button hookup
30 ============================
31
32 LEFT, RIGHT, UP, DOWN: connected to AN4 through a resistor network
33
34 The voltage on AN4 depends on which keys (or key combo) is pressed
35
36 OPTION: AN2, high active (assigned as MENU)
37 ON/OFF: AN3, low active (assigned as OFF)
38*/
39
40void button_init_device(void)
41{
42}
43
44int button_read_device(void)
45{
46 int btn = BUTTON_NONE;
47 int data;
48
49 /* Check the 4 direction keys */
50 data = adc_read(ADC_BUTTON_ROW1);
51 if (data >= 165)
52 {
53 if (data >= 585)
54 if (data >= 755)
55 btn = BUTTON_LEFT;
56 else
57 btn = BUTTON_RIGHT;
58 else
59 if (data >= 415)
60 btn = BUTTON_UP;
61 else
62 btn = BUTTON_DOWN;
63 }
64
65 if(adc_read(ADC_BUTTON_OPTION) > 0x200) /* active high */
66 btn |= BUTTON_MENU;
67 if(adc_read(ADC_BUTTON_ONOFF) < 0x120) /* active low */
68 btn |= BUTTON_OFF;
69
70 return btn;
71}
diff --git a/firmware/target/sh/archos/ondio/button-target.h b/firmware/target/sh/archos/ondio/button-target.h
deleted file mode 100644
index a84be2851a..0000000000
--- a/firmware/target/sh/archos/ondio/button-target.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25#define BUTTON_OFF 0x00000001
26#define BUTTON_MENU 0x00000002
27
28#define BUTTON_LEFT 0x00000004
29#define BUTTON_RIGHT 0x00000008
30#define BUTTON_UP 0x00000010
31#define BUTTON_DOWN 0x00000020
32
33#define BUTTON_MAIN (BUTTON_OFF|BUTTON_MENU|BUTTON_LEFT|BUTTON_RIGHT\
34 |BUTTON_UP|BUTTON_DOWN)
35
36#define POWEROFF_BUTTON BUTTON_OFF
37#define POWEROFF_COUNT 10
38
39#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/sh/archos/ondio/fmradio_i2c-ondio.c b/firmware/target/sh/archos/ondio/fmradio_i2c-ondio.c
deleted file mode 100644
index b901bd0019..0000000000
--- a/firmware/target/sh/archos/ondio/fmradio_i2c-ondio.c
+++ /dev/null
@@ -1,202 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 * Physical interface of the Philips TEA5767 in Archos Ondio
10 *
11 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "cpu.h"
25#include "kernel.h"
26#include "logf.h"
27#include "system.h"
28#include "fmradio_i2c.h"
29
30#if (CONFIG_TUNER & TEA5767)
31
32/* cute little functions, atomic read-modify-write */
33/* SDA is PB4 */
34#define SDA_LO and_b(~0x10, &PBDRL)
35#define SDA_HI or_b(0x10, &PBDRL)
36#define SDA_INPUT and_b(~0x10, &PBIORL)
37#define SDA_OUTPUT or_b(0x10, &PBIORL)
38#define SDA (PBDR & 0x0010)
39
40/* SCL is PB1 */
41#define SCL_INPUT and_b(~0x02, &PBIORL)
42#define SCL_OUTPUT or_b(0x02, &PBIORL)
43#define SCL_LO and_b(~0x02, &PBDRL)
44#define SCL_HI or_b(0x02, &PBDRL)
45#define SCL (PBDR & 0x0002)
46
47/* arbitrary delay loop */
48#define DELAY do { int _x; for(_x=0;_x<20;_x++);} while (0)
49
50static void fmradio_i2c_start(void)
51{
52 SDA_OUTPUT;
53 SDA_HI;
54 SCL_HI;
55 SDA_LO;
56 DELAY;
57 SCL_LO;
58}
59
60static void fmradio_i2c_stop(void)
61{
62 SDA_LO;
63 SCL_HI;
64 DELAY;
65 SDA_HI;
66}
67
68
69static void fmradio_i2c_ack(bool nack)
70{
71 /* Here's the deal. The slave is slow, and sometimes needs to wait
72 before it can receive the acknowledge. Therefore it forces the clock
73 low until it is ready. We need to poll the clock line until it goes
74 high before we release the ack. */
75
76 SCL_LO; /* Set the clock low */
77
78 if (nack)
79 SDA_HI;
80 else
81 SDA_LO;
82
83 SCL_INPUT; /* Set the clock to input */
84 while(!SCL) /* and wait for the slave to release it */
85 sleep(0);
86
87 DELAY;
88 SCL_OUTPUT;
89 SCL_LO;
90}
91
92static int fmradio_i2c_getack(void)
93{
94 int ret = 1;
95
96 /* Here's the deal. The slave is slow, and sometimes needs to wait
97 before it can send the acknowledge. Therefore it forces the clock
98 low until it is ready. We need to poll the clock line until it goes
99 high before we read the ack. */
100
101 SDA_INPUT; /* And set to input */
102 SCL_INPUT; /* Set the clock to input */
103 while(!SCL) /* and wait for the slave to release it */
104 sleep(0);
105
106 if (SDA)
107 /* ack failed */
108 ret = 0;
109
110 SCL_OUTPUT;
111 SCL_LO;
112 SDA_HI;
113 SDA_OUTPUT;
114 return ret;
115}
116
117static void fmradio_i2c_outb(unsigned char byte)
118{
119 int i;
120
121 /* clock out each bit, MSB first */
122 for ( i=0x80; i; i>>=1 ) {
123 if ( i & byte )
124 {
125 SDA_HI;
126 }
127 else
128 {
129 SDA_LO;
130 }
131 SCL_HI;
132 SCL_LO;
133 }
134
135 SDA_HI;
136}
137
138static unsigned char fmradio_i2c_inb(void)
139{
140 int i;
141 unsigned char byte = 0;
142
143 /* clock in each bit, MSB first */
144 for ( i=0x80; i; i>>=1 ) {
145 SDA_INPUT; /* And set to input */
146 SCL_HI;
147 if ( SDA )
148 byte |= i;
149 SCL_LO;
150 SDA_OUTPUT;
151 }
152
153 return byte;
154}
155
156int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count)
157{
158 int i,x=0;
159
160 fmradio_i2c_start();
161 fmradio_i2c_outb(address & 0xfe);
162 if (fmradio_i2c_getack())
163 {
164 for (i=0; i<count; i++)
165 {
166 fmradio_i2c_outb(buf[i]);
167 if (!fmradio_i2c_getack())
168 {
169 x=-2;
170 break;
171 }
172 }
173 }
174 else
175 {
176 logf("fmradio_i2c_write() - no ack\n");
177 x=-1;
178 }
179 fmradio_i2c_stop();
180 return x;
181}
182
183int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count)
184{
185 int i,x=0;
186
187 fmradio_i2c_start();
188 fmradio_i2c_outb(address | 1);
189 if (fmradio_i2c_getack()) {
190 for (i=count; i>0; i--)
191 {
192 *buf++ = fmradio_i2c_inb();
193 fmradio_i2c_ack(i == 1);
194 }
195 }
196 else
197 x=-1;
198 fmradio_i2c_stop();
199 return x;
200}
201
202#endif
diff --git a/firmware/target/sh/archos/ondio/power-ondio.c b/firmware/target/sh/archos/ondio/power-ondio.c
deleted file mode 100644
index d7bbc08f4f..0000000000
--- a/firmware/target/sh/archos/ondio/power-ondio.c
+++ /dev/null
@@ -1,78 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23#include <stdbool.h>
24#include "kernel.h"
25#include "system.h"
26#include "power.h"
27#include "usb.h"
28#include "backlight-target.h"
29
30#if CONFIG_TUNER
31
32static bool powered = false;
33
34bool tuner_power(bool status)
35{
36 bool old_status = powered;
37
38 powered = status;
39 if (status)
40 {
41 and_b(~0x04, &PADRL); /* drive PA2 low for tuner enable */
42 sleep(1); /* let the voltage settle */
43 }
44 else
45 or_b(0x04, &PADRL); /* drive PA2 high for tuner disable */
46 return old_status;
47}
48
49#endif /* #if CONFIG_TUNER */
50
51void power_init(void)
52{
53 PBCR2 &= ~0x0c00; /* GPIO for PB5 */
54 or_b(0x20, &PBIORL);
55 or_b(0x20, &PBDRL); /* hold power */
56#ifndef HAVE_BACKLIGHT
57 /* Disable backlight on backlight-modded Ondios when running
58 * a standard build (always on otherwise). */
59 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
60 and_b(~0x40, &PADRH); /* drive it low */
61 or_b(0x40, &PAIORH); /* ..and output */
62#endif
63 PACR2 &= ~0x0030; /* GPIO for PA2 */
64 or_b(0x04, &PADRL); /* drive PA2 high for tuner disable */
65 or_b(0x04, &PAIORL); /* output for PA2 */
66}
67
68void power_off(void)
69{
70 disable_irq();
71#ifdef HAVE_BACKLIGHT
72 /* Switch off the light on backlight-modded Ondios */
73 backlight_hw_off();
74#endif
75 and_b(~0x20, &PBDRL);
76 or_b(0x20, &PBIORL);
77 while(1);
78}
diff --git a/firmware/target/sh/archos/ondio/powermgmt-ondio.c b/firmware/target/sh/archos/ondio/powermgmt-ondio.c
deleted file mode 100644
index dc3cab031f..0000000000
--- a/firmware/target/sh/archos/ondio/powermgmt-ondio.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese
11 * Revisions copyright (C) 2005 by Gerald Van Baren
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "adc.h"
25#include "powermgmt.h"
26
27const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
28{
29 3100, 3450
30};
31
32const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
33{
34 2700, 2800
35};
36
37/* voltages (millivolt) of 0%, 10%, ... 100% */
38const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
39{
40 /* measured values */
41 { 2800, 3250, 3410, 3530, 3640, 3740, 3850, 3950, 4090, 4270, 4750 }, /* Alkaline */
42 { 3100, 3550, 3630, 3690, 3720, 3740, 3760, 3780, 3800, 3860, 4050 } /* NiMH */
43};
44
45#define BATTERY_SCALE_FACTOR 4849 /* average from 3 Ondios */
46/* full-scale ADC readout (2^10) in millivolt */
47
48/* Returns battery voltage from ADC [millivolts] */
49int _battery_voltage(void)
50{
51 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
52}
53
diff --git a/firmware/target/sh/archos/ondio/usb-ondio.c b/firmware/target/sh/archos/ondio/usb-ondio.c
deleted file mode 100644
index 093ebd3ad8..0000000000
--- a/firmware/target/sh/archos/ondio/usb-ondio.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include <stdbool.h>
23#include "adc.h"
24#include "ata_mmc.h"
25#include "cpu.h"
26#include "hwcompat.h"
27#include "system.h"
28#include "usb.h"
29
30int usb_detect(void)
31{
32 return (adc_read(ADC_USB_POWER) <= 512) ? USB_INSERTED : USB_EXTRACTED;
33}
34
35void usb_enable(bool on)
36{
37 if (on)
38 {
39 mmc_enable_int_flash_clock(!mmc_detect());
40
41 if (!(HW_MASK & MMC_CLOCK_POLARITY))
42 and_b(~0x20, &PBDRH); /* old circuit needs SCK1 = low while on USB */
43 or_b(0x20, &PADRL); /* enable USB */
44 and_b(~0x08, &PADRL); /* assert card detect */
45 }
46 else
47 {
48 if (!(HW_MASK & MMC_CLOCK_POLARITY))
49 or_b(0x20, &PBDRH); /* reset SCK1 = high for old circuit */
50 and_b(~0x20, &PADRL); /* disable USB */
51 or_b(0x08, &PADRL); /* deassert card detect */
52 }
53}
54
55void usb_init_device(void)
56{
57 PACR2 &= ~0x04C0; /* use PA3 (card detect) and PA5 (USB enabled) as GPIO */
58 and_b(~0x20, &PADRL); /* disable USB */
59 or_b(0x08, &PADRL); /* deassert card detect */
60 or_b(0x28, &PAIORL); /* output for USB enable and card detect */
61}
diff --git a/firmware/target/sh/archos/player/adc-target.h b/firmware/target/sh/archos/player/adc-target.h
deleted file mode 100644
index a26f79de28..0000000000
--- a/firmware/target/sh/archos/player/adc-target.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#define NUM_ADC_CHANNELS 8
25
26#define ADC_BUTTON_LEFT 0
27#define ADC_BUTTON_MENU 1
28#define ADC_BUTTON_RIGHT 2
29#define ADC_BUTTON_PLAY 3
30#define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */
31#define ADC_EXT_POWER 7 /* The external power voltage, 0v or 2.7v */
32
33#define EXT_SCALE_FACTOR 14800
34
35#endif /* _ADC_TARGET_H_ */
diff --git a/firmware/target/sh/archos/player/backlight-target.h b/firmware/target/sh/archos/player/backlight-target.h
deleted file mode 100644
index b97d21a40f..0000000000
--- a/firmware/target/sh/archos/player/backlight-target.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef BACKLIGHT_TARGET_H
22#define BACKLIGHT_TARGET_H
23
24#include "config.h"
25#include "cpu.h"
26
27static inline bool backlight_hw_init(void)
28{
29 PACR1 &= ~0x3000; /* Set PA14 (backlight control) to GPIO */
30 and_b(~0x40, &PADRH); /* drive and set low */
31 or_b(0x40, &PAIORH); /* ..and output */
32 return true;
33}
34
35static inline void backlight_hw_on(void)
36{
37 and_b(~0x40, &PADRH); /* drive and set low */
38 or_b(0x40, &PAIORH);
39}
40
41static inline void backlight_hw_off(void)
42{
43 and_b(~0x40, &PAIORH); /* let it float (up) */
44}
45
46#endif
diff --git a/firmware/target/sh/archos/player/button-player.c b/firmware/target/sh/archos/player/button-player.c
deleted file mode 100644
index 3cf634853e..0000000000
--- a/firmware/target/sh/archos/player/button-player.c
+++ /dev/null
@@ -1,76 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "system.h"
24#include "button.h"
25#include "backlight.h"
26#include "adc.h"
27
28/*
29 Player hardware button hookup
30 =============================
31
32 Player
33 ------
34 LEFT: AN0
35 MENU: AN1
36 RIGHT: AN2
37 PLAY: AN3
38
39 STOP: PA11
40 ON: PA5
41
42 All buttons are low active
43*/
44
45void button_init_device(void)
46{
47 /* set PA5 and PA11 as input pins */
48 PACR1 &= 0xff3f; /* PA11MD = 00 */
49 PACR2 &= 0xfbff; /* PA5MD = 0 */
50 PAIOR &= ~0x0820; /* Inputs */
51}
52
53int button_read_device(void)
54{
55 int btn = BUTTON_NONE;
56 int data;
57
58 /* buttons are active low */
59 if (adc_read(ADC_BUTTON_LEFT) < 0x180)
60 btn = BUTTON_LEFT;
61 if (adc_read(ADC_BUTTON_MENU) < 0x180)
62 btn |= BUTTON_MENU;
63 if (adc_read(ADC_BUTTON_RIGHT) < 0x180)
64 btn |= BUTTON_RIGHT;
65 if (adc_read(ADC_BUTTON_PLAY) < 0x180)
66 btn |= BUTTON_PLAY;
67
68 /* check port A pins for ON and STOP */
69 data = PADR;
70 if ( !(data & 0x0020) )
71 btn |= BUTTON_ON;
72 if ( !(data & 0x0800) )
73 btn |= BUTTON_STOP;
74
75 return btn;
76}
diff --git a/firmware/target/sh/archos/player/button-target.h b/firmware/target/sh/archos/player/button-target.h
deleted file mode 100644
index dd85d731be..0000000000
--- a/firmware/target/sh/archos/player/button-target.h
+++ /dev/null
@@ -1,52 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25#define HAS_SERIAL_REMOTE
26
27 /* Main unit's buttons */
28#define BUTTON_ON 0x00000001
29#define BUTTON_STOP 0x00000002
30
31#define BUTTON_LEFT 0x00000004
32#define BUTTON_RIGHT 0x00000008
33#define BUTTON_PLAY 0x00000010
34#define BUTTON_MENU 0x00000020
35
36#define BUTTON_MAIN (BUTTON_ON|BUTTON_STOP|BUTTON_LEFT|BUTTON_RIGHT\
37 |BUTTON_PLAY|BUTTON_MENU)
38
39 /* Remote control's buttons */
40#define BUTTON_RC_PLAY 0x00100000
41#define BUTTON_RC_STOP 0x00080000
42
43#define BUTTON_RC_LEFT 0x00040000
44#define BUTTON_RC_RIGHT 0x00020000
45#define BUTTON_RC_VOL_UP 0x00010000
46#define BUTTON_RC_VOL_DOWN 0x00008000
47
48#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
49 |BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
50 |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
51
52#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/sh/archos/player/hwcompat-player.c b/firmware/target/sh/archos/player/hwcompat-player.c
deleted file mode 100644
index 49a333d708..0000000000
--- a/firmware/target/sh/archos/player/hwcompat-player.c
+++ /dev/null
@@ -1,28 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23#include "hwcompat.h"
24
25bool is_new_player(void)
26{
27 return (ROM_VERSION > 449) || (ROM_VERSION == 116);
28}
diff --git a/firmware/target/sh/archos/player/lcd-as-player.S b/firmware/target/sh/archos/player/lcd-as-player.S
deleted file mode 100644
index 19f812c1c7..0000000000
--- a/firmware/target/sh/archos/player/lcd-as-player.S
+++ /dev/null
@@ -1,274 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Jens Arnold
11 * Based on the work of Alan Korr and Jörg Hohensohn
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "cpu.h"
25
26#define LCDR (PBDR_ADDR+1)
27
28#define LCD_DS 1 /* PB0 = 1 --- 0001 --- LCD-DS */
29#define LCD_CS 2 /* PB1 = 1 --- 0010 --- /LCD-CS */
30#define LCD_SD 4 /* PB2 = 1 --- 0100 --- LCD-SD */
31#define LCD_SC 8 /* PB3 = 1 --- 1000 --- LCD-SC */
32
33/*
34 * About /CS,DS,SC,SD
35 * ------------------
36 *
37 * LCD on JBP and JBR uses a SPI protocol to receive orders (SDA and SCK lines)
38 *
39 * - /CS -> Chip Selection line :
40 * 0 : LCD chipset is activated.
41 * - DS -> Data Selection line, latched at the rising edge
42 * of the 8th serial clock (*) :
43 * 0 : instruction register,
44 * 1 : data register;
45 * - SC -> Serial Clock line (SDA).
46 * - SD -> Serial Data line (SCK), latched at the rising edge
47 * of each serial clock (*).
48 *
49 * _ _
50 * /CS \ /
51 * \______________________________________________________/
52 * _____ ____ ____ ____ ____ ____ ____ ____ ____ _____
53 * SD \/ D7 \/ D6 \/ D5 \/ D4 \/ D3 \/ D2 \/ D1 \/ D0 \/
54 * _____/\____/\____/\____/\____/\____/\____/\____/\____/\_____
55 *
56 * _____ _ _ _ _ _ _ _ ________
57 * SC \ * \ * \ * \ * \ * \ * \ * \ *
58 * \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
59 * _ _________________________________________________________
60 * DS \/
61 * _/\_________________________________________________________
62 *
63 */
64
65 .section .icode,"ax",@progbits
66
67 .align 2
68 .global _lcd_write_command
69 .type _lcd_write_command,@function
70
71/* Write a command byte to the lcd controller
72 *
73 * Arguments:
74 * r4 - command byte (int)
75 *
76 * Register usage:
77 * r0 - scratch
78 * r1 - command byte (copied)
79 * r2 - precalculated port value (CS, DS and SC low, SD high)
80 * r3 - lcd port address
81 * r5 - 1 (byte count for reuse of the loop in _lcd_write_data)
82 */
83
84_lcd_write_command:
85 mov.l .lcdr, r3 /* put lcd data port address in r3 */
86 mov r4, r1 /* copy data byte to r1 */
87 mov #0, r5 /* fake end address - stop after first iteration */
88
89 /* This code will fail if an interrupt changes the contents of PBDRL.
90 * If so, we must disable the interrupt here. */
91
92 mov.b @r3, r0 /* r0 = PBDRL */
93 or #(LCD_SD), r0 /* r0 |= LCD_SD */
94 and #(~(LCD_CS|LCD_DS|LCD_SC)),r0 /* r0 &= ~(LCD_CS|LCD_DS|LCD_SC) */
95
96 bra .single_transfer /* jump into the transfer loop */
97 mov r0, r2
98
99
100 .align 2
101 .global _lcd_write_command_e
102 .type _lcd_write_command_e,@function
103
104/* Write a command byte and a data byte to the lcd controller
105 *
106 * Arguments:
107 * r4 - command byte
108 * r5 - data byte
109 *
110 * Register usage:
111 * r0 - scratch
112 * r1 - command/data byte (copied)
113 * r2 - precalculated port value (CS, DS and SC low, SD high)
114 * r3 - lcd port address
115 * r5 - fake end address
116 * r6 - data byte (saved)
117 * r7 - saved pr
118 */
119
120_lcd_write_command_e:
121 mov.l .lcdr, r3 /* put lcd data port address in r3 */
122 mov r4, r1 /* copy data byte to r1 */
123 mov r5, r6
124 mov #0, r5 /* fake end address - stop after first iteration */
125
126 /* This code will fail if an interrupt changes the contents of PBDRL.
127 * If so, we must disable the interrupt here. */
128
129 mov.b @r3, r0 /* r0 = PBDRL */
130 or #(LCD_SD), r0 /* r0 |= LCD_SD */
131 and #(~(LCD_CS|LCD_DS|LCD_SC)),r0 /* r0 &= ~(LCD_CS|LCD_DS|LCD_SC) */
132
133 sts pr, r7
134 bsr .single_transfer /* jump into the transfer loop */
135 mov r0, r2
136
137 lds r7, pr
138 mov r6, r1
139 or #(LCD_DS|LCD_SD), r0 /* r0 |= LCD_DS|LCD_SD */
140 and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */
141 bra .single_transfer /* jump into the transfer loop */
142 mov r0, r2
143
144
145 .align 2
146 .global _lcd_write_data
147 .type _lcd_write_data,@function
148
149
150/* A high performance function to write data to the display,
151 * one or multiple bytes.
152 *
153 * Arguments:
154 * r4 - data address
155 * r5 - byte count
156 *
157 * Register usage:
158 * r0 - scratch
159 * r1 - current data byte
160 * r2 - precalculated port value (CS and SC low, DS and SD high)
161 * r3 - lcd port address
162 * r4 - current address
163 * r5 - end address
164 */
165
166_lcd_write_data:
167 mov.l .lcdr, r3 /* put lcd data port address in r3 */
168 add r4, r5 /* end address */
169
170 /* This code will fail if an interrupt changes the contents of PBDRL.
171 * If so, we must disable the interrupt here. If disabling interrupts
172 * for a long time (~9200 clks = ~830 µs for transferring 112 bytes on
173 * recorders)is undesirable, the loop has to be rewritten to
174 * disable/precalculate/transfer/enable for each iteration. However,
175 * this would significantly decrease performance. */
176
177 mov.b @r3, r0 /* r0 = PBDRL */
178 or #(LCD_DS|LCD_SD), r0 /* r0 |= LCD_DS|LCD_SD */
179 and #(~(LCD_CS|LCD_SC)), r0 /* r0 &= ~(LCD_CS|LCD_SC) */
180 mov r0, r2
181
182 .align 2
183.multi_transfer:
184 mov.b @r4+, r1 /* load data byte from memory */
185
186.single_transfer:
187 shll16 r1 /* shift data to most significant byte */
188 shll8 r1
189
190 shll r1 /* shift the msb into carry */
191 mov r2, r0 /* copy precalculated port value */
192 bt 1f /* data bit = 1? */
193 and #(~LCD_SD), r0 /* no: r0 &= ~LCD_SD */
1941:
195 shll r1 /* next shift here for alignment */
196 mov.b r0, @r3 /* set data to port */
197 or #(LCD_SC), r0 /* rise SC (independent of SD level) */
198 mov.b r0, @r3 /* set to port */
199
200 mov r2, r0
201 bt 1f
202 and #(~LCD_SD), r0
2031:
204 mov.b r0, @r3
205 or #(LCD_SC), r0
206 mov.b r0, @r3
207
208 shll r1
209 mov r2, r0
210 bt 1f
211 and #(~LCD_SD), r0
2121:
213 shll r1
214 mov.b r0, @r3
215 or #(LCD_SC), r0
216 mov.b r0, @r3
217
218 mov r2, r0
219 bt 1f
220 and #(~LCD_SD), r0
2211:
222 mov.b r0, @r3
223 or #(LCD_SC), r0
224 mov.b r0, @r3
225
226 shll r1
227 mov r2, r0
228 bt 1f
229 and #(~LCD_SD), r0
2301:
231 shll r1
232 mov.b r0, @r3
233 or #(LCD_SC), r0
234 mov.b r0, @r3
235
236 mov r2, r0
237 bt 1f
238 and #(~LCD_SD), r0
2391:
240 mov.b r0, @r3
241 or #(LCD_SC), r0
242 mov.b r0, @r3
243
244 shll r1
245 mov r2, r0
246 bt 1f
247 and #(~LCD_SD), r0
2481:
249 shll r1
250 mov.b r0, @r3
251 or #(LCD_SC), r0
252 mov.b r0, @r3
253
254 mov r2, r0
255 bt 1f
256 and #(~LCD_SD), r0
2571:
258 mov.b r0, @r3
259 or #(LCD_SC), r0
260 mov.b r0, @r3
261
262 cmp/hi r4, r5 /* some blocks left? */
263 bt .multi_transfer
264
265 or #(LCD_CS|LCD_DS|LCD_SD|LCD_SC),r0 /* restore port */
266 rts
267 mov.b r0, @r3
268
269 /* This is the place to reenable the interrupts, if we have disabled
270 * them. See above. */
271
272 .align 2
273.lcdr:
274 .long LCDR
diff --git a/firmware/target/sh/archos/player/lcd-player.c b/firmware/target/sh/archos/player/lcd-player.c
deleted file mode 100644
index 95b0164bf5..0000000000
--- a/firmware/target/sh/archos/player/lcd-player.c
+++ /dev/null
@@ -1,213 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 * Based on the work of Alan Korr, Kjell Ericson and others
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include <string.h>
24#include "config.h"
25#include "system.h"
26#include "kernel.h"
27#include "hwcompat.h"
28#include "lcd.h"
29#include "lcd-charcell.h"
30
31#define OLD_LCD_DDRAM ((char)0xB0) /* Display data (characters) */
32#define OLD_LCD_CGRAM ((char)0x80) /* Character generator (patterns) */
33#define OLD_LCD_ICONRAM ((char)0xE0)
34#define OLD_LCD_CONTRAST_SET ((char)0xA8)
35#define OLD_LCD_NOP ((char)0x00)
36#define OLD_LCD_SYSTEM_SET ((char)0x60)
37#define OLD_LCD_SET_POWER_SAVE_OSC_CONTROL ((char)0x40)
38#define OLD_LCD_SET_POWER_CONTROL ((char)0x50)
39#define OLD_LCD_SET_DISPLAY_CONTROL ((char)0x30)
40
41#define NEW_LCD_DDRAM ((char)0x80) /* Display data (characters) */
42#define NEW_LCD_CGRAM ((char)0xC0) /* Character generator (patterns) */
43#define NEW_LCD_ICONRAM ((char)0x40)
44#define NEW_LCD_CONTRAST_SET ((char)0x50)
45#define NEW_LCD_NOP ((char)0x00)
46#define NEW_LCD_FUNCTION_SET ((char)0x10)
47#define NEW_LCD_SET_POWER_SAVE_OSC_CONTROL ((char)0x0c)
48#define NEW_LCD_SET_POWER_CONTROL_REG ((char)0x20)
49#define NEW_LCD_SET_DISPLAY_CONTROL ((char)0x28)
50#define NEW_LCD_SET_DOUBLE_HEIGHT ((char)0x08)
51
52#define LCD_CURSOR(x,y) ((char)(lcd_ddram+((y)*16+(x))))
53#define LCD_ICON(i) ((char)(lcd_iconram+i))
54
55static bool new_lcd;
56static char lcd_contrast_set;
57static char lcd_ddram;
58static char lcd_cgram;
59static char lcd_iconram;
60
61/* hardware configuration */
62
63int lcd_default_contrast(void)
64{
65 return 30;
66}
67
68void lcd_set_contrast(int val)
69{
70 lcd_write_command_e(lcd_contrast_set, 31 - val);
71}
72
73/* charcell specific */
74
75void lcd_double_height(bool on)
76{
77 if(new_lcd)
78 lcd_write_command(on ? (NEW_LCD_SET_DOUBLE_HEIGHT|1)
79 : NEW_LCD_SET_DOUBLE_HEIGHT);
80}
81
82void lcd_icon(int icon, bool enable)
83{
84 static const struct {
85 char pos;
86 char mask;
87 } icontab[] = {
88 { 0, 0x02}, { 0, 0x08}, { 0, 0x04}, { 0, 0x10}, /* Battery */
89 { 2, 0x04}, /* USB */
90 { 3, 0x10}, /* Play */
91 { 4, 0x10}, /* Record */
92 { 5, 0x02}, /* Pause */
93 { 5, 0x10}, /* Audio */
94 { 6, 0x02}, /* Repeat */
95 { 7, 0x01}, /* 1 */
96 { 9, 0x04}, /* Volume */
97 { 9, 0x02}, { 9, 0x01}, {10, 0x08}, {10, 0x04}, {10, 0x01}, /* Vol 1-5 */
98 {10, 0x10}, /* Param */
99 };
100 static char icon_mirror[11] = {0};
101
102 int pos, mask;
103
104 pos = icontab[icon].pos;
105 mask = icontab[icon].mask;
106
107 if (enable)
108 icon_mirror[pos] |= mask;
109 else
110 icon_mirror[pos] &= ~mask;
111
112 lcd_write_command_e(LCD_ICON(pos), icon_mirror[pos]);
113}
114
115/* device specific init */
116void lcd_init_device(void)
117{
118 unsigned char data_vector[64];
119
120 /* LCD init for cold start */
121 PBCR2 &= 0xff00; /* Set PB0..PB3 to GPIO */
122 or_b(0x0f, &PBDRL); /* ... high */
123 or_b(0x0f, &PBIORL); /* ... and output */
124
125 new_lcd = is_new_player();
126
127 if (new_lcd)
128 {
129 lcd_contrast_set = NEW_LCD_CONTRAST_SET;
130 lcd_ddram = NEW_LCD_DDRAM;
131 lcd_cgram = NEW_LCD_CGRAM;
132 lcd_iconram = NEW_LCD_ICONRAM;
133
134 lcd_write_command(NEW_LCD_FUNCTION_SET|1); /* CGRAM selected */
135 lcd_write_command_e(NEW_LCD_CONTRAST_SET, 0x08);
136 lcd_write_command(NEW_LCD_SET_POWER_SAVE_OSC_CONTROL|2);
137 /* oscillator on */
138 lcd_write_command(NEW_LCD_SET_POWER_CONTROL_REG|7);
139 /* opamp buffer + voltage booster on */
140
141 memset(data_vector, 0x20, 64);
142 lcd_write_command(NEW_LCD_DDRAM); /* Set DDRAM address */
143 lcd_write_data(data_vector, 64); /* all spaces */
144
145 memset(data_vector, 0, 64);
146 lcd_write_command(NEW_LCD_CGRAM); /* Set CGRAM address */
147 lcd_write_data(data_vector, 64); /* zero out */
148 lcd_write_command(NEW_LCD_ICONRAM); /* Set ICONRAM address */
149 lcd_write_data(data_vector, 16); /* zero out */
150
151 lcd_write_command(NEW_LCD_SET_DISPLAY_CONTROL|1); /* display on */
152 }
153 else
154 {
155 lcd_contrast_set = OLD_LCD_CONTRAST_SET;
156 lcd_ddram = OLD_LCD_DDRAM;
157 lcd_cgram = OLD_LCD_CGRAM;
158 lcd_iconram = OLD_LCD_ICONRAM;
159
160 lcd_write_command(OLD_LCD_NOP);
161 lcd_write_command(OLD_LCD_SYSTEM_SET|1); /* CGRAM selected */
162 lcd_write_command(OLD_LCD_SET_POWER_SAVE_OSC_CONTROL|2);
163 /* oscillator on */
164 lcd_write_command(OLD_LCD_SET_POWER_CONTROL|7);
165 /* voltage regulator, voltage follower and booster on */
166
167 memset(data_vector, 0x24, 13);
168 lcd_write_command(OLD_LCD_DDRAM); /* Set DDRAM address */
169 lcd_write_data(data_vector, 13); /* all spaces */
170 lcd_write_command(OLD_LCD_DDRAM + 0x10);
171 lcd_write_data(data_vector, 13);
172 lcd_write_command(OLD_LCD_DDRAM + 0x20);
173 lcd_write_data(data_vector, 13);
174
175 memset(data_vector, 0, 32);
176 lcd_write_command(OLD_LCD_CGRAM); /* Set CGRAM address */
177 lcd_write_data(data_vector, 32); /* zero out */
178 lcd_write_command(OLD_LCD_ICONRAM); /* Set ICONRAM address */
179 lcd_write_data(data_vector, 13); /* zero out */
180 lcd_write_command(OLD_LCD_ICONRAM + 0x10);
181 lcd_write_data(data_vector, 13);
182
183 sleep(HZ/10);
184 lcd_write_command(OLD_LCD_SET_DISPLAY_CONTROL|1); /* display on */
185 }
186 lcd_set_contrast(lcd_default_contrast());
187}
188
189/*** Update functions ***/
190
191void lcd_update(void)
192{
193 int y;
194
195 for (y = 0; y < lcd_pattern_count; y++)
196 {
197 if (lcd_patterns[y].count > 0)
198 {
199 lcd_write_command(lcd_cgram | (y << 3));
200 lcd_write_data(lcd_patterns[y].pattern, 7);
201 }
202 }
203 for (y = 0; y < LCD_HEIGHT; y++)
204 {
205 lcd_write_command(LCD_CURSOR(0, y));
206 lcd_write_data(lcd_charbuffer[y], LCD_WIDTH);
207 }
208 if (lcd_cursor.visible)
209 {
210 lcd_write_command_e(LCD_CURSOR(lcd_cursor.x, lcd_cursor.y),
211 lcd_cursor.hw_char);
212 }
213}
diff --git a/firmware/target/sh/archos/player/power-player.c b/firmware/target/sh/archos/player/power-player.c
deleted file mode 100644
index 33f5959021..0000000000
--- a/firmware/target/sh/archos/player/power-player.c
+++ /dev/null
@@ -1,84 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23#include <stdbool.h>
24#include "kernel.h"
25#include "system.h"
26#include "power.h"
27#include "usb.h"
28
29void power_init(void)
30{
31}
32
33unsigned int power_input_status(void)
34{
35 /* Player */
36 return ((PADR & 1) == 0) ?
37 POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
38}
39
40void ide_power_enable(bool on)
41{
42 bool touched = false;
43
44 if(on)
45 {
46 or_b(0x10, &PBDRL);
47 touched = true;
48 }
49#ifdef HAVE_ATA_POWER_OFF
50 if(!on)
51 {
52 and_b(~0x10, &PBDRL);
53 touched = true;
54 }
55#endif /* HAVE_ATA_POWER_OFF */
56
57/* late port preparation, else problems with read/modify/write
58 of other bits on same port, while input and floating high */
59 if (touched)
60 {
61 or_b(0x10, &PBIORL); /* PB4 is an output */
62 PBCR2 &= ~0x0300; /* GPIO for PB4 */
63 }
64}
65
66
67bool ide_powered(void)
68{
69 /* This is not correct for very old players, since these are unable to
70 * control hd power. However, driving the pin doesn't hurt, because it
71 * is not connected anywhere */
72 if ((PBCR2 & 0x0300) || !(PBIORL & 0x10)) /* not configured for output */
73 return false; /* would be floating low, disk off */
74 else
75 return (PBDRL & 0x10) != 0;
76}
77
78void power_off(void)
79{
80 disable_irq();
81 and_b(~0x08, &PADRH);
82 or_b(0x08, &PAIORH);
83 while(1);
84}
diff --git a/firmware/target/sh/archos/player/powermgmt-player.c b/firmware/target/sh/archos/player/powermgmt-player.c
deleted file mode 100644
index 8aa03d88a5..0000000000
--- a/firmware/target/sh/archos/player/powermgmt-player.c
+++ /dev/null
@@ -1,64 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese
11 * Revisions copyright (C) 2005 by Gerald Van Baren
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include "config.h"
24#include "adc.h"
25#include "powermgmt.h"
26
27const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
28{
29 4750
30};
31
32const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
33{
34 4400
35};
36
37/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
38const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
39{
40 /* original values were taken directly after charging, but it should show
41 100% after turning off the device for some hours, too */
42 { 4500, 4810, 4910, 4970, 5030, 5070, 5120, 5140, 5170, 5250, 5400 }
43 /* orig. values: ...,5280,5600 */
44};
45
46/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
47const unsigned short percent_to_volt_charge[11] =
48{
49 /* values guessed, see
50 http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf until someone
51 measures voltages over a charging cycle */
52 4760, 5440, 5510, 5560, 5610, 5640, 5660, 5760, 5820, 5840, 5850 /* NiMH */
53};
54
55#define BATTERY_SCALE_FACTOR 6703
56/* full-scale ADC readout (2^10) in millivolt */
57
58/* Returns battery voltage from ADC [millivolts] */
59int _battery_voltage(void)
60{
61 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
62}
63
64
diff --git a/firmware/target/sh/archos/player/usb-player.c b/firmware/target/sh/archos/player/usb-player.c
deleted file mode 100644
index 76f2a2dcdd..0000000000
--- a/firmware/target/sh/archos/player/usb-player.c
+++ /dev/null
@@ -1,44 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include <stdbool.h>
23#include "cpu.h"
24#include "system.h"
25#include "usb.h"
26
27int usb_detect(void)
28{
29 return (PADR & 0x8000) ? USB_EXTRACTED : USB_INSERTED;
30}
31
32void usb_enable(bool on)
33{
34 if(on)
35 and_b(~0x04, &PADRH);
36 else
37 or_b(0x04, &PADRH);
38}
39
40void usb_init_device(void)
41{
42 or_b(0x04, &PADRH);
43 or_b(0x04, &PAIORH);
44}
diff --git a/firmware/target/sh/archos/recorder/adc-target.h b/firmware/target/sh/archos/recorder/adc-target.h
deleted file mode 100644
index 06c48a5021..0000000000
--- a/firmware/target/sh/archos/recorder/adc-target.h
+++ /dev/null
@@ -1,41 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef _ADC_TARGET_H_
22#define _ADC_TARGET_H_
23
24#define NUM_ADC_CHANNELS 8
25
26/* normal JBR channel assignment */
27#define ADC_BATTERY 0 /* Battery voltage always reads 0x3FF due to
28 silly scaling */
29#define ADC_CHARGE_REGULATOR 1 /* Regulator reference voltage, should read
30 about 0x1c0 when charging, else 0x3FF */
31#define ADC_USB_POWER 2 /* USB, reads 0x3FF when USB is inserted */
32#define ADC_BUTTON_ROW1 4 /* Used for scanning the keys, different
33 voltages for different keys */
34#define ADC_BUTTON_ROW2 5 /* Used for scanning the keys, different
35 voltages for different keys */
36#define ADC_UNREG_POWER 6 /* Battery voltage with a better scaling */
37#define ADC_EXT_POWER 7 /* The external power voltage, 0v or 2.7v */
38
39#define EXT_SCALE_FACTOR 14800
40
41#endif /* _ADC_TARGET_H_ */
diff --git a/firmware/target/sh/archos/recorder/backlight-target.h b/firmware/target/sh/archos/recorder/backlight-target.h
deleted file mode 100644
index c3dd395eca..0000000000
--- a/firmware/target/sh/archos/recorder/backlight-target.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef BACKLIGHT_TARGET_H
22#define BACKLIGHT_TARGET_H
23
24#include "config.h"
25#include "rtc.h"
26
27#define backlight_hw_init() true
28
29static inline void backlight_hw_on(void)
30{
31 rtc_write(0x13, 0x10); /* 32 kHz square wave */
32 rtc_write(0x0a, rtc_read(0x0a) | 0x40); /* Enable square wave */
33}
34
35static inline void backlight_hw_off(void)
36{
37 /* While on, backlight is flashing at 32 kHz. If the square wave output
38 is disabled while the backlight is lit, it will become constantly lit,
39 (brighter) and slowly fade. This resets the square wave counter and
40 results in the unlit state */
41 unsigned char rtc_0a = rtc_read(0x0a) & ~0x40;
42 rtc_write(0x0a, rtc_0a); /* Disable square wave */
43 rtc_write(0x13, 0xF0); /* 1 Hz square wave */
44 rtc_write(0x0a, rtc_0a | 0x40); /* Enable square wave */
45
46 /* When the square wave output is disabled in the unlit state,
47 the backlight stays off */
48 rtc_write(0x0a, rtc_0a);
49}
50
51#endif
diff --git a/firmware/target/sh/archos/recorder/button-recorder.c b/firmware/target/sh/archos/recorder/button-recorder.c
deleted file mode 100644
index 5e5e67487d..0000000000
--- a/firmware/target/sh/archos/recorder/button-recorder.c
+++ /dev/null
@@ -1,110 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "config.h"
23#include "system.h"
24#include "button.h"
25#include "backlight.h"
26#include "adc.h"
27
28/*
29 Recorder hardware button hookup
30 ===============================
31
32 F1, F2, F3, UP: connected to AN4 through a resistor network
33 DOWN, PLAY, LEFT, RIGHT: likewise connected to AN5
34
35 The voltage on AN4/ AN5 depends on which keys (or key combo) is pressed
36
37 ON: PB8, low active
38 OFF: PB4, low active
39*/
40
41void button_init_device(void)
42{
43 /* Set PB4 and PB8 as input pins */
44 PBCR1 &= 0xfffc; /* PB8MD = 00 */
45 PBCR2 &= 0xfcff; /* PB4MD = 00 */
46 PBIOR &= ~0x0110; /* Inputs */
47}
48
49int button_read_device(void)
50{
51 int btn = BUTTON_NONE;
52 int data;
53 static int off_button_count = 0;
54
55 /* check F1..F3 and UP */
56 data = adc_read(ADC_BUTTON_ROW1);
57 if (data >= 250)
58 {
59 if (data >= 700)
60 if (data >= 900)
61 btn = BUTTON_F3;
62 else
63 btn = BUTTON_UP;
64 else
65 if (data >= 500)
66 btn = BUTTON_F2;
67 else
68 btn = BUTTON_F1;
69 }
70
71 /* Some units have mushy keypads, so pressing UP also activates
72 the Left/Right buttons. Let's combat that by skipping the AN5
73 checks when UP is pressed. */
74 if(!(btn & BUTTON_UP))
75 {
76 /* check DOWN, PLAY, LEFT, RIGHT */
77 data = adc_read(ADC_BUTTON_ROW2);
78 if (data >= 250)
79 {
80 if (data >= 700)
81 if (data >= 900)
82 btn |= BUTTON_DOWN;
83 else
84 btn |= BUTTON_PLAY;
85 else
86 if (data >= 500)
87 btn |= BUTTON_LEFT;
88 else
89 btn |= BUTTON_RIGHT;
90 }
91 }
92
93 /* check port B pins for ON and OFF */
94 data = PBDR;
95 if ((data & 0x0100) == 0)
96 btn |= BUTTON_ON;
97
98 if ((data & 0x0010) == 0)
99 {
100 /* When the batteries are low, the low-battery shutdown logic causes
101 * spurious OFF events due to voltage fluctuation on some units.
102 * Only accept OFF when read several times in sequence. */
103 if (++off_button_count > 3)
104 btn |= BUTTON_OFF;
105 }
106 else
107 off_button_count = 0;
108
109 return btn;
110}
diff --git a/firmware/target/sh/archos/recorder/button-target.h b/firmware/target/sh/archos/recorder/button-target.h
deleted file mode 100644
index f387fafe10..0000000000
--- a/firmware/target/sh/archos/recorder/button-target.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _BUTTON_TARGET_H_
23#define _BUTTON_TARGET_H_
24
25#define HAS_SERIAL_REMOTE
26
27 /* Main unit's buttons */
28#define BUTTON_ON 0x00000001
29#define BUTTON_OFF 0x00000002
30
31#define BUTTON_LEFT 0x00000004
32#define BUTTON_RIGHT 0x00000008
33#define BUTTON_UP 0x00000010
34#define BUTTON_DOWN 0x00000020
35
36#define BUTTON_PLAY 0x00000040
37
38#define BUTTON_F1 0x00000080
39#define BUTTON_F2 0x00000100
40#define BUTTON_F3 0x00000200
41
42#define BUTTON_MAIN (BUTTON_ON|BUTTON_OFF|BUTTON_LEFT|BUTTON_RIGHT\
43 |BUTTON_UP|BUTTON_DOWN|BUTTON_PLAY\
44 |BUTTON_F1|BUTTON_F2|BUTTON_F3)
45
46 /* Remote control's buttons */
47#define BUTTON_RC_PLAY 0x00100000
48#define BUTTON_RC_STOP 0x00080000
49
50#define BUTTON_RC_LEFT 0x00040000
51#define BUTTON_RC_RIGHT 0x00020000
52#define BUTTON_RC_VOL_UP 0x00010000
53#define BUTTON_RC_VOL_DOWN 0x00008000
54
55#define BUTTON_REMOTE (BUTTON_RC_PLAY|BUTTON_RC_STOP\
56 |BUTTON_RC_LEFT|BUTTON_RC_RIGHT\
57 |BUTTON_RC_VOL_UP|BUTTON_RC_VOL_DOWN)
58
59#endif /* _BUTTON_TARGET_H_ */
diff --git a/firmware/target/sh/archos/recorder/power-recorder.c b/firmware/target/sh/archos/recorder/power-recorder.c
deleted file mode 100644
index 48cfdc1e17..0000000000
--- a/firmware/target/sh/archos/recorder/power-recorder.c
+++ /dev/null
@@ -1,107 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23#include <stdbool.h>
24#include "adc.h"
25#include "kernel.h"
26#include "system.h"
27#include "power.h"
28#include "powermgmt-target.h"
29#include "usb.h"
30
31static bool charger_on;
32
33void power_init(void)
34{
35 PBCR2 &= ~0x0c00; /* GPIO for PB5 */
36 or_b(0x20, &PBIORL); /* Set charging control bit to output */
37 charger_enable(false); /* Default to charger OFF */
38}
39
40unsigned int power_input_status(void)
41{
42 /* Recorder */
43 return (adc_read(ADC_EXT_POWER) > 0x100) ?
44 POWER_INPUT_MAIN_CHARGER : POWER_INPUT_NONE;
45}
46
47void charger_enable(bool on)
48{
49 if(on)
50 {
51 and_b(~0x20, &PBDRL);
52 }
53 else
54 {
55 or_b(0x20, &PBDRL);
56 }
57
58 charger_on = on;
59}
60
61bool charger_enabled(void)
62{
63 return charger_on;
64}
65
66void ide_power_enable(bool on)
67{
68 bool touched = false;
69
70 if(on)
71 {
72 or_b(0x20, &PADRL);
73 touched = true;
74 }
75#ifdef HAVE_ATA_POWER_OFF
76 if(!on)
77 {
78 and_b(~0x20, &PADRL);
79 touched = true;
80 }
81#endif /* HAVE_ATA_POWER_OFF */
82
83/* late port preparation, else problems with read/modify/write
84 of other bits on same port, while input and floating high */
85 if (touched)
86 {
87 or_b(0x20, &PAIORL); /* PA5 is an output */
88 PACR2 &= 0xFBFF; /* GPIO for PA5 */
89 }
90}
91
92
93bool ide_powered(void)
94{
95 if ((PACR2 & 0x0400) || !(PAIORL & 0x20)) /* not configured for output */
96 return true; /* would be floating high, disk on */
97 else
98 return (PADRL & 0x20) != 0;
99}
100
101void power_off(void)
102{
103 disable_irq();
104 and_b(~0x10, &PBDRL);
105 or_b(0x10, &PBIORL);
106 while(1);
107}
diff --git a/firmware/target/sh/archos/recorder/powermgmt-recorder.c b/firmware/target/sh/archos/recorder/powermgmt-recorder.c
deleted file mode 100644
index ca6067a4cc..0000000000
--- a/firmware/target/sh/archos/recorder/powermgmt-recorder.c
+++ /dev/null
@@ -1,501 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese
11 * Revisions copyright (C) 2005 by Gerald Van Baren
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22#include "config.h"
23#include "system.h"
24#include <stdio.h>
25#include "debug.h"
26#include "storage.h"
27#include "adc.h"
28#include "power.h"
29#include "powermgmt.h"
30
31const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] =
32{
33 4750
34};
35
36const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] =
37{
38 4400
39};
40
41/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */
42const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] =
43{
44 /* original values were taken directly after charging, but it should show
45 100% after turning off the device for some hours, too */
46 { 4500, 4810, 4910, 4970, 5030, 5070, 5120, 5140, 5170, 5250, 5400 }
47 /* orig. values: ...,5280,5600 */
48};
49
50/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */
51const unsigned short percent_to_volt_charge[11] =
52{
53 /* values guessed, see
54 http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf until someone
55 measures voltages over a charging cycle */
56 4760, 5440, 5510, 5560, 5610, 5640, 5660, 5760, 5820, 5840, 5850 /* NiMH */
57};
58
59#define BATTERY_SCALE_FACTOR 6620
60/* full-scale ADC readout (2^10) in millivolt */
61
62/* Returns battery voltage from ADC [millivolts] */
63int _battery_voltage(void)
64{
65 return (adc_read(ADC_UNREG_POWER) * BATTERY_SCALE_FACTOR) >> 10;
66}
67
68void powermgmt_init_target(void)
69{
70}
71
72/** Charger control **/
73#ifdef CHARGING_DEBUG_FILE
74#include "file.h"
75#define DEBUG_FILE_NAME "/powermgmt.csv"
76#define DEBUG_MESSAGE_LEN 133
77static char debug_message[DEBUG_MESSAGE_LEN];
78static int fd = -1; /* write debug information to this file */
79static int wrcount = 0;
80#endif /* CHARGING_DEBUG_FILE */
81
82/*
83 * For a complete description of the charging algorithm read
84 * docs/CHARGING_ALGORITHM.
85 */
86int long_delta; /* long term delta battery voltage */
87int short_delta; /* short term delta battery voltage */
88static bool disk_activity_last_cycle = false; /* flag set to aid charger time
89 * calculation */
90char power_message[POWER_MESSAGE_LEN] = ""; /* message that's shown in
91 debug menu */
92 /* percentage at which charging
93 starts */
94int powermgmt_last_cycle_startstop_min = 0; /* how many minutes ago was the
95 charging started or
96 stopped? */
97int powermgmt_last_cycle_level = 0; /* which level had the
98 batteries at this time? */
99int trickle_sec = 0; /* how many seconds should the
100 charger be enabled per
101 minute for trickle
102 charging? */
103int pid_p = 0; /* PID proportional term */
104int pid_i = 0; /* PID integral term */
105
106static unsigned int target_voltage = TRICKLE_VOLTAGE; /* desired topoff/trickle
107 * voltage level */
108static int charge_max_time_idle = 0; /* max. charging duration, calculated at
109 * beginning of charging */
110static int charge_max_time_now = 0; /* max. charging duration including
111 * hdd activity */
112static int minutes_disk_activity = 0; /* count minutes of hdd use during
113 * charging */
114static int last_disk_activity = CHARGE_END_LONGD + 1; /* last hdd use x mins ago */
115
116#ifdef CHARGING_DEBUG_FILE
117static void debug_file_close(void)
118{
119 if (fd >= 0) {
120 close(fd);
121 fd = -1;
122 }
123}
124
125static void debug_file_log(void)
126{
127 if (usb_inserted()) {
128 /* It is probably too late to close the file but we can try... */
129 debug_file_close();
130 }
131 else if (fd < 0) {
132 fd = open(DEBUG_FILE_NAME, O_WRONLY | O_APPEND | O_CREAT, 0666);
133
134 if (fd >= 0) {
135 snprintf(debug_message, DEBUG_MESSAGE_LEN,
136 "cycle_min, bat_millivolts, bat_percent, chgr_state"
137 " ,charge_state, pid_p, pid_i, trickle_sec\n");
138 write(fd, debug_message, strlen(debug_message));
139 wrcount = 99; /* force a flush */
140 }
141 }
142 else {
143 snprintf(debug_message, DEBUG_MESSAGE_LEN,
144 "%d, %d, %d, %d, %d, %d, %d, %d\n",
145 powermgmt_last_cycle_startstop_min, battery_voltage(),
146 battery_level(), charger_input_state, charge_state,
147 pid_p, pid_i, trickle_sec);
148 write(fd, debug_message, strlen(debug_message));
149 wrcount++;
150 }
151}
152
153static void debug_file_sync(void)
154{
155 /*
156 * If we have a lot of pending writes or if the disk is spining,
157 * fsync the debug log file.
158 */
159 if (wrcount > 10 || (wrcount > 0 && storage_disk_is_active())) {
160 if (fd >= 0)
161 fsync(fd);
162
163 wrcount = 0;
164 }
165}
166#else /* !CHARGING_DEBUG_FILE */
167#define debug_file_close()
168#define debug_file_log()
169#define debug_file_sync()
170#endif /* CHARGING_DEBUG_FILE */
171
172/*
173 * Do tasks that should be done every step.
174 */
175static void do_frequent_tasks(void)
176{
177 if (storage_disk_is_active()) {
178 /* flag hdd use for charging calculation */
179 disk_activity_last_cycle = true;
180 }
181
182 debug_file_sync();
183}
184
185/*
186 * The charger was just plugged in. If the battery level is
187 * nearly charged, just trickle. If the battery is low, start
188 * a full charge cycle. If the battery level is in between,
189 * top-off and then trickle.
190 */
191static void charger_plugged(void)
192{
193 int battery_percent = battery_level();
194
195 pid_p = 0;
196 pid_i = 0;
197 powermgmt_last_cycle_level = battery_percent;
198 powermgmt_last_cycle_startstop_min = 0;
199
200 snprintf(power_message, POWER_MESSAGE_LEN, "Charger plugged in");
201
202 if (battery_percent > START_TOPOFF_CHG) {
203
204 if (battery_percent >= START_TRICKLE_CHG) {
205 charge_state = TRICKLE;
206 target_voltage = TRICKLE_VOLTAGE;
207 }
208 else {
209 charge_state = TOPOFF;
210 target_voltage = TOPOFF_VOLTAGE;
211 }
212 }
213 else {
214 /*
215 * Start the charger full strength
216 */
217 int i = CHARGE_MAX_MIN_1500 * get_battery_capacity() / 1500;
218 charge_max_time_idle = i * (100 + 35 - battery_percent) / 100;
219
220 if (charge_max_time_idle > i)
221 charge_max_time_idle = i;
222
223 charge_max_time_now = charge_max_time_idle;
224
225 snprintf(power_message, POWER_MESSAGE_LEN,
226 "ChgAt %d%% max %dm", battery_percent,
227 charge_max_time_now);
228
229 /*
230 * Enable the charger after the max time calc is done,
231 * because battery_level depends on if the charger is
232 * on.
233 */
234 DEBUGF("power: charger inserted and battery"
235 " not full, charging\n");
236 trickle_sec = 60;
237 long_delta = short_delta = 999999;
238 charge_state = CHARGING;
239 }
240}
241
242/*
243 * The charger was just unplugged.
244 */
245static void charger_unplugged(void)
246{
247 DEBUGF("power: charger disconnected, disabling\n");
248
249 charger_enable(false);
250 powermgmt_last_cycle_level = battery_level();
251 powermgmt_last_cycle_startstop_min = 0;
252 trickle_sec = 0;
253 pid_p = 0;
254 pid_i = 0;
255 charge_state = DISCHARGING;
256 snprintf(power_message, POWER_MESSAGE_LEN, "Charger: discharge");
257}
258
259static void charging_step(void)
260{
261 int i;
262
263 /* alter charge time max length with extra disk use */
264 if (disk_activity_last_cycle) {
265 minutes_disk_activity++;
266 charge_max_time_now = charge_max_time_idle +
267 minutes_disk_activity*2 / 5;
268 disk_activity_last_cycle = false;
269 last_disk_activity = 0;
270 }
271 else {
272 last_disk_activity++;
273 }
274
275 /*
276 * Check the delta voltage over the last X minutes so we can do
277 * our end-of-charge logic based on the battery level change
278 * (no longer use minimum time as logic for charge end has 50
279 * minutes minimum charge built in).
280 */
281 if (powermgmt_last_cycle_startstop_min > CHARGE_END_SHORTD) {
282 short_delta = power_history[0] -
283 power_history[CHARGE_END_SHORTD - 1];
284 }
285
286 if (powermgmt_last_cycle_startstop_min > CHARGE_END_LONGD) {
287 /*
288 * Scan the history: the points where measurement is taken need to
289 * be fairly static. Check prior to short delta 'area'. Also only
290 * check first and last 10 cycles (delta in middle OK).
291 */
292 long_delta = power_history[0] -
293 power_history[CHARGE_END_LONGD - 1];
294
295 for (i = CHARGE_END_SHORTD; i < CHARGE_END_SHORTD + 10; i++)
296 {
297 if ((power_history[i] - power_history[i+1]) > 50 ||
298 (power_history[i] - power_history[i+1]) < -50) {
299 long_delta = 777777;
300 break;
301 }
302 }
303
304 for (i = CHARGE_END_LONGD - 11; i < CHARGE_END_LONGD - 1 ; i++)
305 {
306 if ((power_history[i] - power_history[i+1]) > 50 ||
307 (power_history[i] - power_history[i+1]) < -50) {
308 long_delta = 888888;
309 break;
310 }
311 }
312 }
313
314 snprintf(power_message, POWER_MESSAGE_LEN,
315 "Chg %dm, max %dm", powermgmt_last_cycle_startstop_min,
316 charge_max_time_now);
317
318 /*
319 * End of charge criteria (any qualify):
320 * 1) Charged a long time
321 * 2) DeltaV went negative for a short time ( & long delta static)
322 * 3) DeltaV was negative over a longer period (no disk use only)
323 *
324 * Note: short_delta and long_delta are millivolts
325 */
326 if (powermgmt_last_cycle_startstop_min >= charge_max_time_now ||
327 (short_delta <= -50 && long_delta < 50) ||
328 (long_delta < -20 && last_disk_activity > CHARGE_END_LONGD)) {
329
330 int battery_percent = battery_level();
331
332 if (powermgmt_last_cycle_startstop_min > charge_max_time_now) {
333 DEBUGF("power: powermgmt_last_cycle_startstop_min > charge_max_time_now, "
334 "enough!\n");
335 /*
336 * Have charged too long and deltaV detection did not
337 * work!
338 */
339 snprintf(power_message, POWER_MESSAGE_LEN,
340 "Chg tmout %d min", charge_max_time_now);
341 /*
342 * Switch to trickle charging. We skip the top-off
343 * since we've effectively done the top-off operation
344 * already since we charged for the maximum full
345 * charge time.
346 */
347 powermgmt_last_cycle_level = battery_percent;
348 powermgmt_last_cycle_startstop_min = 0;
349 charge_state = TRICKLE;
350
351 /*
352 * Set trickle charge target to a relative voltage instead
353 * of an arbitrary value - the fully charged voltage may
354 * vary according to ambient temp, battery condition etc.
355 * Trickle target is -0.15v from full voltage acheived.
356 * Topup target is -0.05v from full voltage.
357 */
358 target_voltage = power_history[0] - 150;
359
360 }
361 else {
362 if(short_delta <= -5) {
363 DEBUGF("power: short-term negative"
364 " delta, enough!\n");
365 snprintf(power_message, POWER_MESSAGE_LEN,
366 "end negd %d %dmin", short_delta,
367 powermgmt_last_cycle_startstop_min);
368 target_voltage = power_history[CHARGE_END_SHORTD - 1] - 50;
369 }
370 else {
371 DEBUGF("power: long-term small "
372 "positive delta, enough!\n");
373 snprintf(power_message, POWER_MESSAGE_LEN,
374 "end lowd %d %dmin", long_delta,
375 powermgmt_last_cycle_startstop_min);
376 target_voltage = power_history[CHARGE_END_LONGD - 1] - 50;
377 }
378
379 /*
380 * Switch to top-off charging.
381 */
382 powermgmt_last_cycle_level = battery_percent;
383 powermgmt_last_cycle_startstop_min = 0;
384 charge_state = TOPOFF;
385 }
386 }
387}
388
389static void topoff_trickle_step(void)
390{
391 unsigned int millivolts;
392
393 /*
394 *Time to switch from topoff to trickle?
395 */
396 if (charge_state == TOPOFF &&
397 powermgmt_last_cycle_startstop_min > TOPOFF_MAX_MIN) {
398
399 powermgmt_last_cycle_level = battery_level();
400 powermgmt_last_cycle_startstop_min = 0;
401 charge_state = TRICKLE;
402 target_voltage = target_voltage - 100;
403 }
404 /*
405 * Adjust trickle charge time (proportional and integral terms).
406 * Note: I considered setting the level higher if the USB is
407 * plugged in, but it doesn't appear to be necessary and will
408 * generate more heat [gvb].
409 */
410 millivolts = battery_voltage();
411
412 pid_p = ((signed)target_voltage - (signed)millivolts) / 5;
413 if (pid_p <= PID_DEADZONE && pid_p >= -PID_DEADZONE)
414 pid_p = 0;
415
416 if ((unsigned)millivolts < target_voltage) {
417 if (pid_i < 60)
418 pid_i++; /* limit so it doesn't "wind up" */
419 }
420 else {
421 if (pid_i > 0)
422 pid_i--; /* limit so it doesn't "wind up" */
423 }
424
425 trickle_sec = pid_p + pid_i;
426
427 if (trickle_sec > 60)
428 trickle_sec = 60;
429
430 if (trickle_sec < 0)
431 trickle_sec = 0;
432}
433
434void charging_algorithm_step(void)
435{
436 static int pwm_counter = 0; /* PWM total cycle in steps */
437 static int pwm_duty = 0; /* PWM duty cycle in steps */
438
439 switch (charger_input_state)
440 {
441 case CHARGER_PLUGGED:
442 charger_plugged();
443 break;
444
445 case CHARGER_UNPLUGGED:
446 charger_unplugged();
447 break;
448
449 case CHARGER:
450 case NO_CHARGER:
451 do_frequent_tasks();
452
453 if (pwm_counter > 0) {
454 if (pwm_duty > 0 && --pwm_duty <= 0)
455 charger_enable(false); /* Duty cycle expired */
456
457 if (--pwm_counter > 0)
458 return;
459
460 /* PWM cycle is complete */
461 powermgmt_last_cycle_startstop_min++;
462 debug_file_log();
463 }
464 break;
465 }
466
467 switch (charge_state)
468 {
469 case CHARGING:
470 charging_step();
471 break;
472
473 case TOPOFF:
474 case TRICKLE:
475 topoff_trickle_step();
476 break;
477
478 case DISCHARGING:
479 default:
480 break;
481 }
482
483 /* If 100%, ensure pwm_on never expires and briefly disables the
484 * charger. */
485 pwm_duty = (trickle_sec < 60) ? trickle_sec*2 : 0;
486 pwm_counter = 60*2;
487 charger_enable(trickle_sec > 0);
488}
489
490void charging_algorithm_close(void)
491{
492#ifdef CHARGING_DEBUG_FILE
493 debug_file_close();
494#endif /* CHARGING_DEBUG_FILE */
495}
496
497/* Returns true if the unit is charging the batteries. */
498bool charging_state(void)
499{
500 return charge_state == CHARGING;
501}
diff --git a/firmware/target/sh/archos/recorder/powermgmt-target.h b/firmware/target/sh/archos/recorder/powermgmt-target.h
deleted file mode 100644
index 6b68d05bd4..0000000000
--- a/firmware/target/sh/archos/recorder/powermgmt-target.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Heikki Hannikainen, Uwe Freese
11 * Revisions copyright (C) 2005 by Gerald Van Baren
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22#ifndef POWERMGMT_TARGET_H
23#define POWERMGMT_TARGET_H
24
25/*
26 * Define CHARGING_DEBUG_FILE to create a csv (spreadsheet) with battery
27 * information in it (one sample per minute/connect/disconnect).
28 *
29 * This is only for very low level debug.
30 */
31#undef CHARGING_DEBUG_FILE
32
33
34/* stop when N minutes have passed with avg delta being < -0.05 V */
35#define CHARGE_END_SHORTD 6
36/* stop when N minutes have passed with avg delta being < -0.02 V */
37#define CHARGE_END_LONGD 50
38
39/* Battery % to start at top-off */
40#define START_TOPOFF_CHG 85
41/* Battery % to start at trickle */
42#define START_TRICKLE_CHG 95
43/* power thread status message */
44#define POWER_MESSAGE_LEN 32
45/* minutes: maximum charging time for 1500 mAh batteries
46 * actual max time depends also on BATTERY_CAPACITY! */
47#define CHARGE_MAX_MIN_1500 450
48/* minutes: minimum charging time */
49#define CHARGE_MIN_MIN 10
50/* After charging, go to top off charge. How long should top off charge be? */
51#define TOPOFF_MAX_MIN 90
52/* which voltage is best? (millivolts) */
53#define TOPOFF_VOLTAGE 5650
54/* After top off charge, go to trickle harge. How long should trickle
55 * charge be? */
56#define TRICKLE_MAX_MIN 720 /* 12 hrs */
57/* which voltage is best? (millivolts) */
58#define TRICKLE_VOLTAGE 5450
59/* initial trickle_sec for topoff */
60#define START_TOPOFF_SEC 25
61/* initial trickle_sec for trickle */
62#define START_TRICKLE_SEC 15
63
64#define PID_DEADZONE 4 /* PID proportional deadzone */
65
66extern char power_message[POWER_MESSAGE_LEN];
67
68extern int long_delta; /* long term delta battery voltage */
69extern int short_delta; /* short term delta battery voltage */
70
71extern int powermgmt_last_cycle_startstop_min; /* how many minutes ago was
72 the charging started or
73 stopped? */
74extern int powermgmt_last_cycle_level; /* which level had the batteries
75 at this time? */
76
77extern int pid_p; /* PID proportional term */
78extern int pid_i; /* PID integral term */
79extern int trickle_sec; /* how many seconds should the
80 charger be enabled per
81 minute for trickle
82 charging? */
83void charger_enable(bool on);
84bool charger_enabled(void);
85
86/* Battery filter lengths in samples */
87#define BATT_AVE_SAMPLES 32
88
89#endif /* POWERMGMT_TARGET_H */
diff --git a/firmware/target/sh/archos/recorder/usb-recorder.c b/firmware/target/sh/archos/recorder/usb-recorder.c
deleted file mode 100644
index f8b462b802..0000000000
--- a/firmware/target/sh/archos/recorder/usb-recorder.c
+++ /dev/null
@@ -1,49 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include <stdbool.h>
23#include "adc.h"
24#include "cpu.h"
25#include "hwcompat.h"
26#include "system.h"
27#include "usb.h"
28
29int usb_detect(void)
30{
31 return (adc_read(ADC_USB_POWER) > 500) ? USB_INSERTED : USB_EXTRACTED;
32}
33
34void usb_enable(bool on)
35{
36 if(HW_MASK & USB_ACTIVE_HIGH)
37 on = !on;
38
39 if(on)
40 and_b(~0x04, &PADRH); /* enable USB */
41 else
42 or_b(0x04, &PADRH);
43}
44
45void usb_init_device(void)
46{
47 usb_enable(false);
48 or_b(0x04, &PAIORH);
49}
diff --git a/firmware/target/sh/archos/timer-archos.c b/firmware/target/sh/archos/timer-archos.c
deleted file mode 100644
index 98a3afb4b6..0000000000
--- a/firmware/target/sh/archos/timer-archos.c
+++ /dev/null
@@ -1,84 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2005 Jens Arnold
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21
22#include "cpu.h"
23#include "system.h"
24#include "timer.h"
25
26void IMIA4(void) __attribute__((interrupt_handler));
27void IMIA4(void)
28{
29 if (pfn_timer != NULL)
30 pfn_timer();
31 and_b(~0x01, &TSR4); /* clear the interrupt */
32}
33
34bool timer_set(long cycles, bool start)
35{
36 int phi = 0; /* bits for the prescaler */
37 int prescale = 1;
38
39 while (cycles > 0x10000)
40 { /* work out the smallest prescaler that makes it fit */
41 phi++;
42 prescale <<= 1;
43 cycles >>= 1;
44 }
45
46 if (prescale > 8)
47 return false;
48
49 if (start)
50 {
51 if (pfn_unregister != NULL)
52 {
53 pfn_unregister();
54 pfn_unregister = NULL;
55 }
56
57 and_b(~0x10, &TSTR); /* Stop the timer 4 */
58 and_b(~0x10, &TSNC); /* No synchronization */
59 and_b(~0x10, &TMDR); /* Operate normally */
60
61 TIER4 = 0xF9; /* Enable GRA match interrupt */
62 }
63
64 TCR4 = 0x20 | phi; /* clear at GRA match, set prescaler */
65 GRA4 = (unsigned short)(cycles - 1);
66 if (start || (TCNT4 >= GRA4))
67 TCNT4 = 0;
68 and_b(~0x01, &TSR4); /* clear an eventual interrupt */
69
70 return true;
71}
72
73bool timer_start(void)
74{
75 IPRD = (IPRD & 0xFF0F) | 1 << 4; /* interrupt priority */
76 or_b(0x10, &TSTR); /* start timer 4 */
77 return true;
78}
79
80void timer_stop(void)
81{
82 and_b(~0x10, &TSTR); /* stop the timer 4 */
83 IPRD = (IPRD & 0xFF0F); /* disable interrupt */
84}
diff --git a/firmware/target/sh/archos/uart-archos.c b/firmware/target/sh/archos/uart-archos.c
deleted file mode 100644
index d17678f812..0000000000
--- a/firmware/target/sh/archos/uart-archos.c
+++ /dev/null
@@ -1,167 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Alan Korr & Nick Robinson
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include <stdio.h>
22#include <stdlib.h>
23#include <stdarg.h>
24
25#include "config.h"
26#include "button.h"
27#include "cpu.h"
28#include "system.h"
29#include "kernel.h"
30#include "serial.h"
31
32/* FIX: this doesn't work on iRiver or iPod yet */
33/* iFP7xx has no remote */
34
35/* Received byte identifiers */
36#define PLAY 0xC1
37#define STOP 0xC2
38#define PREV 0xC4
39#define NEXT 0xC8
40#define VOLUP 0xD0
41#define VOLDN 0xE0
42
43void serial_setup (void)
44{
45 /* Set PB10 function to serial Rx */
46 PBCR1 = (PBCR1 & 0xffcf) | 0x0020;
47
48 SMR1 = 0x00;
49 SCR1 = 0;
50 BRR1 = (FREQ/(32*9600))-1;
51 and_b(0, &SSR1); /* The status bits must be read before they are cleared,
52 so we do an AND operation */
53
54 /* Let the hardware settle. The serial port needs to wait "at least
55 the interval required to transmit or receive one bit" before it
56 can be used. */
57 sleep(1);
58
59 SCR1 = 0x10; /* Enable the receiver, no interrupt */
60}
61
62int tx_rdy(void)
63{
64 /* a dummy */
65 return 1;
66}
67
68static int rx_rdy(void)
69{
70 if(SSR1 & SCI_RDRF)
71 return 1;
72 else
73 return 0;
74}
75
76void tx_writec(unsigned char c)
77{
78 /* a dummy */
79 (void)c;
80}
81
82static unsigned char rx_readc(void)
83{
84 char tmp;
85 /* Read byte and clear the Rx Full bit */
86 tmp = RDR1;
87 and_b(~SCI_RDRF, &SSR1);
88 return tmp;
89}
90
91
92/* This function returns the received remote control code only if it is
93 received without errors before or after the reception.
94 It therefore returns the received code on the second call after the
95 code has been received. */
96int remote_control_rx(void)
97{
98 static int last_valid_button = BUTTON_NONE;
99 static int last_was_error = false;
100 int btn;
101 int ret = BUTTON_NONE;
102
103 /* Errors? Just clear'em. The receiver stops if we don't */
104 if(SSR1 & (SCI_ORER | SCI_FER | SCI_PER)) {
105 and_b(~(SCI_ORER | SCI_FER | SCI_PER), &SSR1);
106 last_valid_button = BUTTON_NONE;
107 last_was_error = true;
108 return BUTTON_NONE;
109 }
110
111 if(rx_rdy()) {
112 btn = rx_readc();
113
114 if(last_was_error)
115 {
116 last_valid_button = BUTTON_NONE;
117 ret = BUTTON_NONE;
118 }
119 else
120 {
121 switch (btn)
122 {
123 case STOP:
124 last_valid_button = BUTTON_RC_STOP;
125 break;
126
127 case PLAY:
128 last_valid_button = BUTTON_RC_PLAY;
129 break;
130
131 case VOLUP:
132 last_valid_button = BUTTON_RC_VOL_UP;
133 break;
134
135 case VOLDN:
136 last_valid_button = BUTTON_RC_VOL_DOWN;
137 break;
138
139 case PREV:
140 last_valid_button = BUTTON_RC_LEFT;
141 break;
142
143 case NEXT:
144 last_valid_button = BUTTON_RC_RIGHT;
145 break;
146
147 default:
148 last_valid_button = BUTTON_NONE;
149 break;
150 }
151 }
152 }
153 else
154 {
155 /* This means that a valid remote control character was received
156 the last time we were called, with no receiver errors either before
157 or after. Then we can assume that there really is a remote control
158 attached, and return the button code. */
159 ret = last_valid_button;
160 last_valid_button = BUTTON_NONE;
161 }
162
163 last_was_error = false;
164
165 return ret;
166}
167
diff --git a/firmware/target/sh/bitswap.S b/firmware/target/sh/bitswap.S
deleted file mode 100644
index ba8dd0cc1a..0000000000
--- a/firmware/target/sh/bitswap.S
+++ /dev/null
@@ -1,152 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2004 by Jens Arnold
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22 .section .icode,"ax",@progbits
23 .align 2
24 .global _bitswap
25 .type _bitswap,@function
26
27/* Flips the bits of all bytes in a memory area (required for mp3 data on
28 * the Archos). This version is optimized for speed and size.
29 *
30 * arguments:
31 * r4 - start address
32 * r5 - length
33 *
34 * return value: void
35 *
36 * register usage:
37 * r0 - temporary
38 * r1 - bit mask for rounding to long bound / low byte (after swap)
39 * r2 - high byte (after swap) / combined result
40 * r4 - data address - 4
41 * r5 - end address - 4
42 * r7 - flip table (addressing with signed offset)
43 *
44 * The instruction order below is devised in a way to utilize the pipelining
45 * of the SH1 to the max.
46 */
47
48_bitswap:
49 mova _fliptable,r0
50 mov r0,r7
51 add #-4,r4 /* address is shifted by 4 */
52 add r4,r5 /* r5 = end_address - 4 */
53 cmp/hi r4,r5 /* at least something to do? */
54 bf .exit /* no, get out of here! */
55
56 add #-3,r5 /* end offset for flipping 4 bytes per pass */
57 mov r4,r0
58 tst #1,r0 /* even address? */
59 bt .start2_w /* yes, jump into main loop */
60
61 /* no, flip first byte */
62 mov.b @(4,r4),r0 /* load byte, sign extension! */
63 add #1,r4 /* early increment */
64 mov.b @(r0,r7),r0 /* fliptable offset is signed */
65 bra .start2_w /* jump into main loop */
66 mov.b r0,@(3,r4) /* store byte */
67
68 /* main loop: flips 2 words per pass */
69 .align 2
70.loop2_w:
71 mov.w @(6,r4),r0 /* load second word */
72 add #4,r4 /* early increment */
73 swap.b r0,r2 /* get high byte (2nd word) */
74 exts.b r0,r0 /* prepare low byte (2nd word) */
75 mov.b @(r0,r7),r1 /* swap low byte (2nd word) */
76 exts.b r2,r0 /* prepare high byte (2nd word) */
77 mov.b @(r0,r7),r2 /* swap high byte (2nd word) */
78 extu.b r1,r0 /* zero extend low byte (2nd word) */
79 mov.w @r4,r1 /* load first word */
80 shll8 r2 /* shift high byte (2nd word), low byte zeroed */
81 or r2,r0 /* put low byte (2nd word) in result */
82 swap.b r1,r2 /* get high byte (1st word) */
83 mov.w r0,@(2,r4) /* store result (2nd word) */
84 exts.b r1,r0 /* prepare low byte (1st word) */
85 mov.b @(r0,r7),r1 /* swap low byte (1st word) */
86 exts.b r2,r0 /* prepare high byte (1st word) */
87 mov.b @(r0,r7),r2 /* swap high byte (1st word) */
88 extu.b r1,r0 /* zero extend low byte (1st word) */
89 shll8 r2 /* shift high byte (1st word), low byte zeroed */
90 or r2,r0 /* put low byte (1st word) in result */
91 mov.w r0,@r4 /* store result (1st word) */
92.start2_w:
93 cmp/hi r4,r5 /* runs r4 up to last long bound */
94 bt .loop2_w
95
96 bra .start_b2 /* jump into trailing byte loop */
97 add #3,r5 /* reset end offset */
98
99 /* trailing byte loop: flips 0..3 bytes */
100.loop_b2:
101 mov.b @(4,r4),r0 /* loand byte, sign extension! */
102 add #1,r4 /* early increment */
103 mov.b @(r0,r7),r0 /* fliptable offset is signed */
104 mov.b r0,@(3,r4) /* store byte */
105.start_b2:
106 cmp/hi r4,r5 /* runs r4 up to end address */
107 bt .loop_b2
108
109.exit:
110 rts
111 nop
112
113 .align 2
114 .global _fliptable
115
116 .byte 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1
117 .byte 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1
118 .byte 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9
119 .byte 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9
120 .byte 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5
121 .byte 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5
122 .byte 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed
123 .byte 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd
124 .byte 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3
125 .byte 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3
126 .byte 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb
127 .byte 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb
128 .byte 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7
129 .byte 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7
130 .byte 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef
131 .byte 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
132_fliptable:
133 .byte 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0
134 .byte 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0
135 .byte 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8
136 .byte 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8
137 .byte 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4
138 .byte 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4
139 .byte 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec
140 .byte 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc
141 .byte 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2
142 .byte 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2
143 .byte 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea
144 .byte 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa
145 .byte 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6
146 .byte 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6
147 .byte 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee
148 .byte 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe
149
150
151.end:
152 .size _bitswap,.end-_bitswap
diff --git a/firmware/target/sh/crt0.S b/firmware/target/sh/crt0.S
deleted file mode 100644
index 0e8bbfdd68..0000000000
--- a/firmware/target/sh/crt0.S
+++ /dev/null
@@ -1,219 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "cpu.h"
23
24 .section .init.text,"ax",@progbits
25
26 .global start
27start:
28
29 mov.l .vbr_k,r1
30#ifdef DEBUG
31 /* If we have built our code to be loaded via the standalone GDB
32 * stub, we will have out VBR at some other location than 0x9000000.
33 * We must copy the trap vectors for the GDB stub to our vector table. */
34 mov.l .orig_vbr_k,r2
35
36 /* Move the invalid instruction vector (4) */
37 mov #4,r0
38 shll2 r0
39 mov.l @(r0,r2),r3
40 mov.l r3,@(r0,r1)
41
42 /* Move the invalid slot vector (6) */
43 mov #6,r0
44 shll2 r0
45 mov.l @(r0,r2),r3
46 mov.l r3,@(r0,r1)
47
48 /* Move the bus error vector (9) */
49 mov #9,r0
50 shll2 r0
51 mov.l @(r0,r2),r3
52 mov.l r3,@(r0,r1)
53
54 /* Move the DMA bus error vector (10) */
55 mov #10,r0
56 shll2 r0
57 mov.l @(r0,r2),r3
58 mov.l r3,@(r0,r1)
59
60 /* Move the NMI vector as well (11) */
61 mov #11,r0
62 shll2 r0
63 mov.l @(r0,r2),r3
64 mov.l r3,@(r0,r1)
65
66 /* Move the UserBreak vector as well (12) */
67 mov #12,r0
68 shll2 r0
69 mov.l @(r0,r2),r3
70 mov.l r3,@(r0,r1)
71
72 /* Move the breakpoint trap vector (32) */
73 mov #32,r0
74 shll2 r0
75 mov.l @(r0,r2),r3
76 mov.l r3,@(r0,r1)
77
78 /* Move the IO trap vector (33) */
79 mov #33,r0
80 shll2 r0
81 mov.l @(r0,r2),r3
82 mov.l r3,@(r0,r1)
83
84 /* Move the serial Rx interrupt vector (105) */
85 mov #105,r0
86 shll2 r0
87 mov.l @(r0,r2),r3
88 mov.l r3,@(r0,r1)
89
90 /* Move the single step trap vector (127) */
91 mov #127,r0
92 shll2 r0
93 mov.l @(r0,r2),r3
94 mov.l r3,@(r0,r1)
95#endif /* DEBUG */
96 ldc r1,vbr
97
98 mov #0,r0
99 ldc r0,gbr
100
101 /* .iram copy is done first since it is reclaimed for other
102 * uninitialized sections */
103
104 /* copy the .iram section */
105 mov.l .iramcopy_k,r0
106 mov.l .iram_k,r1
107 mov.l .iramend_k,r2
108 /* Note: We cannot put a PC relative load into the delay slot of a 'bra'
109 instruction (the offset would be wrong), but there is nothing else to
110 do before the loop, so the delay slot would be 'nop'. The cmp / bf
111 sequence is the same length, but more efficient. */
112 cmp/hi r1,r2
113 bf .noiramcopy
114.iramloop:
115 mov.l @r0+,r3
116 mov.l r3,@r1
117 add #4,r1
118 cmp/hi r1,r2
119 bt .iramloop
120.noiramcopy:
121
122 /* zero out .ibss */
123 mov.l .iedata_k,r0
124 mov.l .iend_k,r1
125 bra .iedatastart
126 mov #0,r2
127.iedataloop: /* backwards is faster and shorter */
128 mov.l r2,@-r1
129.iedatastart:
130 cmp/hi r0,r1
131 bt .iedataloop
132
133 /* zero out bss */
134 mov.l .edata_k,r0
135 mov.l .end_k,r1
136 bra .edatastart
137 mov #0,r2
138.edataloop: /* backwards is faster and shorter */
139 mov.l r2,@-r1
140.edatastart:
141 cmp/hi r0,r1
142 bt .edataloop
143
144 /* copy the .data section, for rombased execution */
145 mov.l .datacopy_k,r0
146 mov.l .data_k,r1
147 cmp/eq r0,r1
148 bt .nodatacopy /* Don't copy if src and dest are equal */
149 mov.l .dataend_k,r2
150 cmp/hi r1,r2
151 bf .nodatacopy
152.dataloop:
153 mov.l @r0+,r3
154 mov.l r3,@r1
155 add #4,r1
156 cmp/hi r1,r2
157 bt .dataloop
158.nodatacopy:
159
160 /* Munge the main thread stack */
161 mov.l .stackbegin_k,r0
162 mov.l .stackend_k,r1
163 mov r1,r15
164 mov.l .deadbeef_k,r2
165.mungeloop: /* backwards is faster and shorter */
166 mov.l r2,@-r1
167 cmp/hi r0,r1
168 bt .mungeloop
169
170 /* call the mainline */
171 mov.l .main_k,r0
172 jsr @r0
173 nop
174.hoo:
175 bra .hoo
176 nop
177
178 .align 2
179.vbr_k:
180 .long vectors
181#ifdef DEBUG
182.orig_vbr_k:
183 .long 0x09000000
184#endif
185.iedata_k:
186 .long _iedata
187.iend_k:
188 .long _iend
189.iramcopy_k:
190 .long _iramcopy
191.iram_k:
192 .long _iramstart
193.iramend_k:
194 .long _iramend
195.edata_k:
196 .long _edata
197.end_k:
198 .long _end
199.datacopy_k:
200 .long _datacopy
201.data_k:
202 .long _datastart
203.dataend_k:
204 .long _dataend
205.stackbegin_k:
206 .long _stackbegin
207.stackend_k:
208 .long _stackend
209.deadbeef_k:
210 .long 0xdeadbeef
211.main_k:
212 .long _main
213
214 .section .resetvectors
215vectors:
216 .long start
217 .long _stackend
218 .long start
219 .long _stackend
diff --git a/firmware/target/sh/debug-sh.c b/firmware/target/sh/debug-sh.c
deleted file mode 100644
index bee4896174..0000000000
--- a/firmware/target/sh/debug-sh.c
+++ /dev/null
@@ -1,285 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Heikki Hannikainen
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include <stdbool.h>
23#include <string.h>
24
25#include "config.h"
26#include "system.h"
27#include "kernel.h"
28#include "font.h"
29#include "lcd.h"
30#include "button.h"
31#include "powermgmt.h"
32#include "adc.h"
33#include "hwcompat.h" /* ROM_VERSION */
34#include "crc32.h"
35
36#if CONFIG_KEYPAD == RECORDER_PAD
37# define DEBUG_CANCEL BUTTON_OFF
38
39#elif CONFIG_KEYPAD == ONDIO_PAD
40# define DEBUG_CANCEL BUTTON_MENU
41#endif
42
43/* Tool function to read the flash manufacturer and type, if available.
44 Only chips which could be reprogrammed in system will return values.
45 (The mode switch addresses vary between flash manufacturers, hence addr1/2) */
46 /* In IRAM to avoid problems when running directly from Flash */
47static bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
48 unsigned addr1, unsigned addr2)
49 ICODE_ATTR __attribute__((noinline));
50static bool dbg_flash_id(unsigned* p_manufacturer, unsigned* p_device,
51 unsigned addr1, unsigned addr2)
52{
53 unsigned not_manu, not_id; /* read values before switching to ID mode */
54 unsigned manu, id; /* read values when in ID mode */
55
56 volatile unsigned char* flash = (unsigned char*)0x2000000; /* flash mapping */
57 int old_level; /* saved interrupt level */
58
59 not_manu = flash[0]; /* read the normal content */
60 not_id = flash[1]; /* should be 'A' (0x41) and 'R' (0x52) from the "ARCH" marker */
61
62 /* disable interrupts, prevent any stray flash access */
63 old_level = disable_irq_save();
64
65 flash[addr1] = 0xAA; /* enter command mode */
66 flash[addr2] = 0x55;
67 flash[addr1] = 0x90; /* ID command */
68 /* Atmel wants 20ms pause here */
69 /* sleep(HZ/50); no sleeping possible while interrupts are disabled */
70
71 manu = flash[0]; /* read the IDs */
72 id = flash[1];
73
74 flash[0] = 0xF0; /* reset flash (back to normal read mode) */
75 /* Atmel wants 20ms pause here */
76 /* sleep(HZ/50); no sleeping possible while interrupts are disabled */
77
78 restore_irq(old_level); /* enable interrupts again */
79 /* I assume success if the obtained values are different from
80 the normal flash content. This is not perfectly bulletproof, they
81 could theoretically be the same by chance, causing us to fail. */
82 if (not_manu != manu || not_id != id) /* a value has changed */
83 {
84 *p_manufacturer = manu; /* return the results */
85 *p_device = id;
86 return true; /* success */
87 }
88 return false; /* fail */
89}
90
91bool dbg_ports(void)
92{
93 int adc_battery_voltage;
94#ifndef HAVE_LCD_BITMAP
95 int currval = 0;
96 int button;
97#else
98 int adc_battery_level;
99
100 lcd_setfont(FONT_SYSFIXED);
101#endif
102 lcd_clear_display();
103
104 while(1)
105 {
106#ifdef HAVE_LCD_BITMAP
107 lcd_putsf(0, 0, "PADR: %04x", (unsigned short)PADR);
108 lcd_putsf(0, 1, "PBDR: %04x", (unsigned short)PBDR);
109
110 lcd_putsf(0, 2, "AN0: %03x AN4: %03x", adc_read(0), adc_read(4));
111 lcd_putsf(0, 3, "AN1: %03x AN5: %03x", adc_read(1), adc_read(5));
112 lcd_putsf(0, 4, "AN2: %03x AN6: %03x", adc_read(2), adc_read(6));
113 lcd_putsf(0, 5, "AN3: %03x AN7: %03x", adc_read(3), adc_read(7));
114
115 battery_read_info(&adc_battery_voltage, &adc_battery_level);
116 lcd_putsf(0, 6, "Batt: %d.%03dV %d%% ", adc_battery_voltage / 1000,
117 adc_battery_voltage % 1000, adc_battery_level);
118
119 lcd_update();
120
121 while (button_get_w_tmo(HZ/10) != (DEBUG_CANCEL|BUTTON_REL));
122
123 lcd_setfont(FONT_UI);
124
125#else /* !HAVE_LCD_BITMAP */
126
127 if (currval == 0) {
128 lcd_putsf(0, 0, "PADR: %04x", (unsigned short)PADR);
129 } else if (currval == 1) {
130 lcd_putsf(0, 0, "PBDR: %04x", (unsigned short)PBDR);
131 } else {
132 int idx = currval - 2; /* idx < 7 */
133 lcd_putsf(0, 0, "AN%d: %03x", idx, adc_read(idx));
134 }
135
136 battery_read_info(&adc_battery_voltage, NULL);
137 lcd_putsf(0, 1, "Batt: %d.%03dV", adc_battery_voltage / 1000,
138 adc_battery_voltage % 1000);
139 lcd_update();
140
141 button = button_get_w_tmo(HZ/5);
142 switch(button)
143 {
144 case BUTTON_STOP:
145 return false;
146
147 case BUTTON_LEFT:
148 currval--;
149 if(currval < 0)
150 currval = 9;
151 break;
152
153 case BUTTON_RIGHT:
154 currval++;
155 if(currval > 9)
156 currval = 0;
157 break;
158 }
159#endif
160 }
161 return false;
162}
163
164bool dbg_hw_info(void)
165{
166#ifndef HAVE_LCD_BITMAP
167 int button;
168 int currval = 0;
169#else
170 int bitmask = HW_MASK;
171#endif
172 int rom_version = ROM_VERSION;
173 unsigned manu, id; /* flash IDs */
174 bool got_id; /* flag if we managed to get the flash IDs */
175 unsigned rom_crc = 0xffffffff; /* CRC32 of the boot ROM */
176 bool has_bootrom; /* flag for boot ROM present */
177 int oldmode; /* saved memory guard mode */
178
179 oldmode = system_memory_guard(MEMGUARD_NONE); /* disable memory guard */
180
181 /* get flash ROM type */
182 got_id = dbg_flash_id(&manu, &id, 0x5555, 0x2AAA); /* try SST, Atmel, NexFlash */
183 if (!got_id)
184 got_id = dbg_flash_id(&manu, &id, 0x555, 0x2AA); /* try AMD, Macronix */
185
186 /* check if the boot ROM area is a flash mirror */
187 has_bootrom = (memcmp((char*)0, (char*)0x02000000, 64*1024) != 0);
188 if (has_bootrom) /* if ROM and Flash different */
189 {
190 /* calculate CRC16 checksum of boot ROM */
191 rom_crc = crc_32((unsigned char*)0x0000, 64*1024, 0xffffffff);
192 }
193
194 system_memory_guard(oldmode); /* re-enable memory guard */
195
196 lcd_clear_display();
197
198#ifdef HAVE_LCD_BITMAP
199 lcd_setfont(FONT_SYSFIXED);
200
201 lcd_puts(0, 0, "[Hardware info]");
202
203 lcd_putsf(0, 1, "ROM: %d.%02d", rom_version/100, rom_version%100);
204
205 lcd_putsf(0, 2, "Mask: 0x%04x", bitmask);
206 if (got_id)
207 lcd_putsf(0, 3, "Flash: M=%02x D=%02x", manu, id);
208 else
209 lcd_puts(0, 3, "Flash: M=?? D=??"); /* unknown, sorry */
210
211 if (has_bootrom)
212 {
213 if (rom_crc == 0x56DBA4EE) /* known Version 1 */
214 lcd_puts(0, 4, "Boot ROM: V1");
215 else
216 lcd_putsf(0, 4, "ROMcrc: 0x%08x", rom_crc);
217 }
218 else
219 {
220 lcd_puts(0, 4, "Boot ROM: none");
221 }
222
223 lcd_update();
224
225 /* wait for exit */
226 while (button_get_w_tmo(HZ/10) != (DEBUG_CANCEL|BUTTON_REL));
227
228 lcd_setfont(FONT_UI);
229
230#else /* !HAVE_LCD_BITMAP */
231 lcd_puts(0, 0, "[HW Info]");
232 while(1)
233 {
234 switch(currval)
235 {
236 case 0:
237 lcd_putsf(0, 1, "ROM: %d.%02d",
238 rom_version/100, rom_version%100);
239 break;
240 case 1:
241 if (got_id)
242 lcd_putsf(0, 1, "Flash:%02x,%02x", manu, id);
243 else
244 lcd_puts(0, 1, "Flash:??,??"); /* unknown, sorry */
245 break;
246 case 2:
247 if (has_bootrom)
248 {
249 if (rom_crc == 0x56DBA4EE) /* known Version 1 */
250 lcd_puts(0, 1, "BootROM: V1");
251 else if (rom_crc == 0x358099E8)
252 lcd_puts(0, 1, "BootROM: V2");
253 /* alternative boot ROM found in one single player so far */
254 else
255 lcd_putsf(0, 1, "R: %08x", rom_crc);
256 }
257 else
258 lcd_puts(0, 1, "BootROM: no");
259 }
260
261 lcd_update();
262
263 button = button_get_w_tmo(HZ/10);
264
265 switch(button)
266 {
267 case BUTTON_STOP:
268 return false;
269
270 case BUTTON_LEFT:
271 currval--;
272 if(currval < 0)
273 currval = 2;
274 break;
275
276 case BUTTON_RIGHT:
277 currval++;
278 if(currval > 2)
279 currval = 0;
280 break;
281 }
282 }
283#endif
284 return false;
285}
diff --git a/firmware/target/sh/kernel-sh.c b/firmware/target/sh/kernel-sh.c
deleted file mode 100644
index 65b27e47f0..0000000000
--- a/firmware/target/sh/kernel-sh.c
+++ /dev/null
@@ -1,65 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Björn Stenberg
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h"
22#include "system.h"
23#include "kernel.h"
24#include "panic.h"
25
26void tick_start(unsigned int interval_in_ms)
27{
28 unsigned long count;
29
30 count = CPU_FREQ * interval_in_ms / 1000 / 8;
31
32 if(count > 0x10000)
33 {
34 panicf("Error! The tick interval is too long (%d ms)\n",
35 interval_in_ms);
36 return;
37 }
38
39 /* We are using timer 0 */
40
41 TSTR &= ~0x01; /* Stop the timer */
42 TSNC &= ~0x01; /* No synchronization */
43 TMDR &= ~0x01; /* Operate normally */
44
45 TCNT0 = 0; /* Start counting at 0 */
46 GRA0 = (unsigned short)(count - 1);
47 TCR0 = 0x23; /* Clear at GRA match, sysclock/8 */
48
49 /* Enable interrupt on level 1 */
50 IPRC = (IPRC & ~0x00f0) | 0x0010;
51
52 TSR0 &= ~0x01;
53 TIER0 = 0xf9; /* Enable GRA match interrupt */
54
55 TSTR |= 0x01; /* Start timer 1 */
56}
57
58void IMIA0(void) __attribute__ ((interrupt_handler));
59void IMIA0(void)
60{
61 /* Run through the list of tick tasks */
62 call_tick_tasks();
63
64 TSR0 &= ~0x01;
65}
diff --git a/firmware/target/sh/system-sh.c b/firmware/target/sh/system-sh.c
deleted file mode 100644
index e054801b57..0000000000
--- a/firmware/target/sh/system-sh.c
+++ /dev/null
@@ -1,450 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 * Based on the work of Alan Korr and others
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22
23#include <stdio.h>
24#include "config.h"
25#include "system.h"
26#include "lcd.h"
27#include "font.h"
28#include "led.h"
29
30const unsigned bit_n_table[32] = {
31 1LU<< 0, 1LU<< 1, 1LU<< 2, 1LU<< 3,
32 1LU<< 4, 1LU<< 5, 1LU<< 6, 1LU<< 7,
33 1LU<< 8, 1LU<< 9, 1LU<<10, 1LU<<11,
34 1LU<<12, 1LU<<13, 1LU<<14, 1LU<<15,
35 1LU<<16, 1LU<<17, 1LU<<18, 1LU<<19,
36 1LU<<20, 1LU<<21, 1LU<<22, 1LU<<23,
37 1LU<<24, 1LU<<25, 1LU<<26, 1LU<<27,
38 1LU<<28, 1LU<<29, 1LU<<30, 1LU<<31
39};
40
41static const char* const irqname[] = {
42 "", "", "", "", "IllInstr", "", "IllSltIn","","",
43 "CPUAdrEr", "DMAAdrEr", "NMI", "UserBrk",
44 "","","","","","","","","","","","","","","","","","","",
45 "Trap32","Trap33","Trap34","Trap35","Trap36","Trap37","Trap38","Trap39",
46 "Trap40","Trap41","Trap42","Trap43","Trap44","Trap45","Trap46","Trap47",
47 "Trap48","Trap49","Trap50","Trap51","Trap52","Trap53","Trap54","Trap55",
48 "Trap56","Trap57","Trap58","Trap59","Trap60","Trap61","Trap62","Trap63",
49 "Irq0","Irq1","Irq2","Irq3","Irq4","Irq5","Irq6","Irq7",
50 "Dma0","","Dma1","","Dma2","","Dma3","",
51 "IMIA0","IMIB0","OVI0","", "IMIA1","IMIB1","OVI1","",
52 "IMIA2","IMIB2","OVI2","", "IMIA3","IMIB3","OVI3","",
53 "IMIA4","IMIB4","OVI4","",
54 "Ser0Err","Ser0Rx","Ser0Tx","Ser0TE",
55 "Ser1Err","Ser1Rx","Ser1Tx","Ser1TE",
56 "ParityEr","A/D conv","","","Watchdog","DRAMRefr"
57};
58
59#define RESERVE_INTERRUPT(number) "\t.long\t_UIE" #number "\n"
60#define DEFAULT_INTERRUPT(name, number) "\t.weak\t_" #name \
61 "\n\t.set\t_" #name ",_UIE" #number \
62 "\n\t.long\t_" #name "\n"
63
64asm (
65
66/* Vector table.
67 * Handled in asm because gcc 4.x doesn't allow weak aliases to symbols
68 * defined in an asm block -- silly.
69 * Reset vectors (0..3) are handled in crt0.S */
70
71 ".section\t.vectors,\"aw\",@progbits\n"
72 DEFAULT_INTERRUPT (GII, 4)
73 RESERVE_INTERRUPT ( 5)
74 DEFAULT_INTERRUPT (ISI, 6)
75 RESERVE_INTERRUPT ( 7)
76 RESERVE_INTERRUPT ( 8)
77 DEFAULT_INTERRUPT (CPUAE, 9)
78 DEFAULT_INTERRUPT (DMAAE, 10)
79 DEFAULT_INTERRUPT (NMI, 11)
80 DEFAULT_INTERRUPT (UB, 12)
81 RESERVE_INTERRUPT ( 13)
82 RESERVE_INTERRUPT ( 14)
83 RESERVE_INTERRUPT ( 15)
84 RESERVE_INTERRUPT ( 16) /* TCB #0 */
85 RESERVE_INTERRUPT ( 17) /* TCB #1 */
86 RESERVE_INTERRUPT ( 18) /* TCB #2 */
87 RESERVE_INTERRUPT ( 19) /* TCB #3 */
88 RESERVE_INTERRUPT ( 20) /* TCB #4 */
89 RESERVE_INTERRUPT ( 21) /* TCB #5 */
90 RESERVE_INTERRUPT ( 22) /* TCB #6 */
91 RESERVE_INTERRUPT ( 23) /* TCB #7 */
92 RESERVE_INTERRUPT ( 24) /* TCB #8 */
93 RESERVE_INTERRUPT ( 25) /* TCB #9 */
94 RESERVE_INTERRUPT ( 26) /* TCB #10 */
95 RESERVE_INTERRUPT ( 27) /* TCB #11 */
96 RESERVE_INTERRUPT ( 28) /* TCB #12 */
97 RESERVE_INTERRUPT ( 29) /* TCB #13 */
98 RESERVE_INTERRUPT ( 30) /* TCB #14 */
99 RESERVE_INTERRUPT ( 31) /* TCB #15 */
100 DEFAULT_INTERRUPT (TRAPA32, 32)
101 DEFAULT_INTERRUPT (TRAPA33, 33)
102 DEFAULT_INTERRUPT (TRAPA34, 34)
103 DEFAULT_INTERRUPT (TRAPA35, 35)
104 DEFAULT_INTERRUPT (TRAPA36, 36)
105 DEFAULT_INTERRUPT (TRAPA37, 37)
106 DEFAULT_INTERRUPT (TRAPA38, 38)
107 DEFAULT_INTERRUPT (TRAPA39, 39)
108 DEFAULT_INTERRUPT (TRAPA40, 40)
109 DEFAULT_INTERRUPT (TRAPA41, 41)
110 DEFAULT_INTERRUPT (TRAPA42, 42)
111 DEFAULT_INTERRUPT (TRAPA43, 43)
112 DEFAULT_INTERRUPT (TRAPA44, 44)
113 DEFAULT_INTERRUPT (TRAPA45, 45)
114 DEFAULT_INTERRUPT (TRAPA46, 46)
115 DEFAULT_INTERRUPT (TRAPA47, 47)
116 DEFAULT_INTERRUPT (TRAPA48, 48)
117 DEFAULT_INTERRUPT (TRAPA49, 49)
118 DEFAULT_INTERRUPT (TRAPA50, 50)
119 DEFAULT_INTERRUPT (TRAPA51, 51)
120 DEFAULT_INTERRUPT (TRAPA52, 52)
121 DEFAULT_INTERRUPT (TRAPA53, 53)
122 DEFAULT_INTERRUPT (TRAPA54, 54)
123 DEFAULT_INTERRUPT (TRAPA55, 55)
124 DEFAULT_INTERRUPT (TRAPA56, 56)
125 DEFAULT_INTERRUPT (TRAPA57, 57)
126 DEFAULT_INTERRUPT (TRAPA58, 58)
127 DEFAULT_INTERRUPT (TRAPA59, 59)
128 DEFAULT_INTERRUPT (TRAPA60, 60)
129 DEFAULT_INTERRUPT (TRAPA61, 61)
130 DEFAULT_INTERRUPT (TRAPA62, 62)
131 DEFAULT_INTERRUPT (TRAPA63, 63)
132 DEFAULT_INTERRUPT (IRQ0, 64)
133 DEFAULT_INTERRUPT (IRQ1, 65)
134 DEFAULT_INTERRUPT (IRQ2, 66)
135 DEFAULT_INTERRUPT (IRQ3, 67)
136 DEFAULT_INTERRUPT (IRQ4, 68)
137 DEFAULT_INTERRUPT (IRQ5, 69)
138 DEFAULT_INTERRUPT (IRQ6, 70)
139 DEFAULT_INTERRUPT (IRQ7, 71)
140 DEFAULT_INTERRUPT (DEI0, 72)
141 RESERVE_INTERRUPT ( 73)
142 DEFAULT_INTERRUPT (DEI1, 74)
143 RESERVE_INTERRUPT ( 75)
144 DEFAULT_INTERRUPT (DEI2, 76)
145 RESERVE_INTERRUPT ( 77)
146 DEFAULT_INTERRUPT (DEI3, 78)
147 RESERVE_INTERRUPT ( 79)
148 DEFAULT_INTERRUPT (IMIA0, 80)
149 DEFAULT_INTERRUPT (IMIB0, 81)
150 DEFAULT_INTERRUPT (OVI0, 82)
151 RESERVE_INTERRUPT ( 83)
152 DEFAULT_INTERRUPT (IMIA1, 84)
153 DEFAULT_INTERRUPT (IMIB1, 85)
154 DEFAULT_INTERRUPT (OVI1, 86)
155 RESERVE_INTERRUPT ( 87)
156 DEFAULT_INTERRUPT (IMIA2, 88)
157 DEFAULT_INTERRUPT (IMIB2, 89)
158 DEFAULT_INTERRUPT (OVI2, 90)
159 RESERVE_INTERRUPT ( 91)
160 DEFAULT_INTERRUPT (IMIA3, 92)
161 DEFAULT_INTERRUPT (IMIB3, 93)
162 DEFAULT_INTERRUPT (OVI3, 94)
163 RESERVE_INTERRUPT ( 95)
164 DEFAULT_INTERRUPT (IMIA4, 96)
165 DEFAULT_INTERRUPT (IMIB4, 97)
166 DEFAULT_INTERRUPT (OVI4, 98)
167 RESERVE_INTERRUPT ( 99)
168 DEFAULT_INTERRUPT (REI0, 100)
169 DEFAULT_INTERRUPT (RXI0, 101)
170 DEFAULT_INTERRUPT (TXI0, 102)
171 DEFAULT_INTERRUPT (TEI0, 103)
172 DEFAULT_INTERRUPT (REI1, 104)
173 DEFAULT_INTERRUPT (RXI1, 105)
174 DEFAULT_INTERRUPT (TXI1, 106)
175 DEFAULT_INTERRUPT (TEI1, 107)
176 RESERVE_INTERRUPT ( 108)
177 DEFAULT_INTERRUPT (ADITI, 109)
178
179/* UIE# block.
180 * Must go into the same section as the UIE() handler */
181
182 "\t.text\n"
183 "_UIE4:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
184 "_UIE5:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
185 "_UIE6:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
186 "_UIE7:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
187 "_UIE8:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
188 "_UIE9:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
189 "_UIE10:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
190 "_UIE11:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
191 "_UIE12:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
192 "_UIE13:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
193 "_UIE14:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
194 "_UIE15:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
195 "_UIE16:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
196 "_UIE17:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
197 "_UIE18:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
198 "_UIE19:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
199 "_UIE20:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
200 "_UIE21:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
201 "_UIE22:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
202 "_UIE23:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
203 "_UIE24:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
204 "_UIE25:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
205 "_UIE26:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
206 "_UIE27:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
207 "_UIE28:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
208 "_UIE29:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
209 "_UIE30:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
210 "_UIE31:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
211 "_UIE32:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
212 "_UIE33:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
213 "_UIE34:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
214 "_UIE35:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
215 "_UIE36:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
216 "_UIE37:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
217 "_UIE38:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
218 "_UIE39:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
219 "_UIE40:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
220 "_UIE41:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
221 "_UIE42:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
222 "_UIE43:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
223 "_UIE44:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
224 "_UIE45:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
225 "_UIE46:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
226 "_UIE47:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
227 "_UIE48:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
228 "_UIE49:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
229 "_UIE50:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
230 "_UIE51:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
231 "_UIE52:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
232 "_UIE53:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
233 "_UIE54:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
234 "_UIE55:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
235 "_UIE56:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
236 "_UIE57:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
237 "_UIE58:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
238 "_UIE59:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
239 "_UIE60:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
240 "_UIE61:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
241 "_UIE62:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
242 "_UIE63:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
243 "_UIE64:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
244 "_UIE65:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
245 "_UIE66:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
246 "_UIE67:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
247 "_UIE68:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
248 "_UIE69:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
249 "_UIE70:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
250 "_UIE71:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
251 "_UIE72:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
252 "_UIE73:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
253 "_UIE74:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
254 "_UIE75:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
255 "_UIE76:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
256 "_UIE77:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
257 "_UIE78:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
258 "_UIE79:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
259 "_UIE80:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
260 "_UIE81:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
261 "_UIE82:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
262 "_UIE83:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
263 "_UIE84:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
264 "_UIE85:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
265 "_UIE86:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
266 "_UIE87:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
267 "_UIE88:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
268 "_UIE89:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
269 "_UIE90:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
270 "_UIE91:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
271 "_UIE92:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
272 "_UIE93:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
273 "_UIE94:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
274 "_UIE95:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
275 "_UIE96:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
276 "_UIE97:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
277 "_UIE98:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
278 "_UIE99:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
279 "_UIE100:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
280 "_UIE101:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
281 "_UIE102:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
282 "_UIE103:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
283 "_UIE104:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
284 "_UIE105:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
285 "_UIE106:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
286 "_UIE107:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
287 "_UIE108:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
288 "_UIE109:\tbsr\t_UIE\n\tmov.l\t@r15+,r4\n"
289
290);
291
292extern void UIE4(void); /* needed for calculating the UIE number */
293
294void UIE (unsigned int pc) __attribute__((section(".text")));
295void UIE (unsigned int pc) /* Unexpected Interrupt or Exception */
296{
297 unsigned int n;
298
299 asm volatile ("sts\tpr,%0" : "=r"(n));
300
301 /* clear screen */
302#ifdef HAVE_LCD_BITMAP
303#if LCD_DEPTH > 1
304 lcd_set_backdrop(NULL);
305 lcd_set_drawmode(DRMODE_SOLID);
306 lcd_set_foreground(LCD_BLACK);
307 lcd_set_background(LCD_WHITE);
308#endif
309 lcd_setfont(FONT_SYSFIXED);
310 lcd_set_viewport(NULL);
311#endif
312
313 lcd_clear_display();
314 /* output exception */
315 n = (n - (unsigned)UIE4 + 12)>>2; /* get exception or interrupt number */
316 lcd_putsf(0, 0, "I%02x:%s", n, irqname[n]);
317 lcd_putsf(0, 1, "at %08x", pc);
318 lcd_update();
319
320 /* try to restart firmware if ON is pressed */
321 system_exception_wait();
322
323 /* enable the watchguard timer, but don't service it */
324 RSTCSR_W = 0x5a40; /* Reset enabled, power-on reset */
325 TCSR_W = 0xa560; /* Watchdog timer mode, timer enabled, sysclk/2 */
326 while (1);
327}
328
329void system_init(void)
330{
331 /* Disable all interrupts */
332 IPRA = 0;
333 IPRB = 0;
334 IPRC = 0;
335 IPRD = 0;
336 IPRE = 0;
337
338 /* NMI level low, falling edge on all interrupts */
339 ICR = 0;
340
341 /* Enable burst and RAS down mode on DRAM */
342 DCR |= 0x5000;
343
344 /* Activate Warp mode (simultaneous internal and external mem access) */
345 BCR |= 0x2000;
346
347 /* Bus state controller initializations. These are only necessary when
348 running from flash. */
349 WCR1 = 0x40FD; /* Long wait states for CS6 (ATA), short for the rest. */
350 WCR3 = 0x8000; /* WAIT is pulled up, 1 state inserted for CS6 */
351}
352
353void system_reboot (void)
354{
355 disable_irq();
356
357 asm volatile ("ldc\t%0,vbr" : : "r"(0));
358
359 PACR2 |= 0x4000; /* for coldstart detection */
360 IPRA = 0;
361 IPRB = 0;
362 IPRC = 0;
363 IPRD = 0;
364 IPRE = 0;
365 ICR = 0;
366
367 asm volatile ("jmp @%0; mov.l @%1,r15" : :
368 "r"(*(int*)0),"r"(4));
369}
370
371void system_exception_wait(void)
372{
373#if (CONFIG_LED == LED_REAL)
374 bool state = false;
375 int i = 0;
376#endif
377
378 while (1)
379 {
380#if (CONFIG_LED == LED_REAL)
381 if (--i <= 0)
382 {
383 state = !state;
384 led(state);
385 i = 240000;
386 }
387#endif
388
389#if CONFIG_KEYPAD == PLAYER_PAD
390 /* Player */
391 if (!(PADRL & 0x20))
392#elif CONFIG_KEYPAD == RECORDER_PAD
393 /* Recorder */
394#ifdef HAVE_FMADC
395 if (!(PCDR & 0x0008))
396#else
397 if (!(PBDRH & 0x01))
398#endif
399#elif CONFIG_KEYPAD == ONDIO_PAD
400 /* Ondio */
401 if (!(PCDR & 0x0008))
402#endif /* CONFIG_KEYPAD */
403 return;
404 }
405}
406
407/* Utilise the user break controller to catch invalid memory accesses. */
408int system_memory_guard(int newmode)
409{
410 static const struct {
411 unsigned long addr;
412 unsigned long mask;
413 unsigned short bbr;
414 } modes[MAXMEMGUARD] = {
415 /* catch nothing */
416 { 0x00000000, 0x00000000, 0x0000 },
417 /* catch writes to area 02 (flash ROM) */
418 { 0x02000000, 0x00FFFFFF, 0x00F8 },
419 /* catch all accesses to areas 00 (internal ROM) and 01 (free) */
420 { 0x00000000, 0x01FFFFFF, 0x00FC }
421 };
422
423 int oldmode = MEMGUARD_NONE;
424 int i;
425
426 /* figure out the old mode from what is in the UBC regs. If the register
427 values don't match any mode, assume MEMGUARD_NONE */
428 for (i = MEMGUARD_NONE; i < MAXMEMGUARD; i++)
429 {
430 if (BAR == modes[i].addr && BAMR == modes[i].mask &&
431 BBR == modes[i].bbr)
432 {
433 oldmode = i;
434 break;
435 }
436 }
437
438 if (newmode == MEMGUARD_KEEP)
439 newmode = oldmode;
440
441 BBR = 0; /* switch off everything first */
442
443 /* always set the UBC according to the mode, in case the old settings
444 didn't match any valid mode */
445 BAR = modes[newmode].addr;
446 BAMR = modes[newmode].mask;
447 BBR = modes[newmode].bbr;
448
449 return oldmode;
450}
diff --git a/firmware/target/sh/system-target.h b/firmware/target/sh/system-target.h
deleted file mode 100644
index a62a024823..0000000000
--- a/firmware/target/sh/system-target.h
+++ /dev/null
@@ -1,154 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jens Arnold
11 * Based on the work of Alan Korr and others
12 *
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
17 *
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
20 *
21 ****************************************************************************/
22#ifndef SYSTEM_TARGET_H
23#define SYSTEM_TARGET_H
24
25#define or_b(mask, address) \
26 asm \
27 ("or.b %0,@(r0,gbr)" \
28 : \
29 : /* %0 */ I_CONSTRAINT((char)(mask)), \
30 /* %1 */ "z"(address-GBR))
31
32#define and_b(mask, address) \
33 asm \
34 ("and.b %0,@(r0,gbr)" \
35 : \
36 : /* %0 */ I_CONSTRAINT((char)(mask)), \
37 /* %1 */ "z"(address-GBR))
38
39#define xor_b(mask, address) \
40 asm \
41 ("xor.b %0,@(r0,gbr)" \
42 : \
43 : /* %0 */ I_CONSTRAINT((char)(mask)), \
44 /* %1 */ "z"(address-GBR))
45
46
47/****************************************************************************
48 * Interrupt level setting
49 * The level is left shifted 4 bits
50 ****************************************************************************/
51#define HIGHEST_IRQ_LEVEL (15<<4)
52
53static inline int set_irq_level(int level)
54{
55 int i;
56 /* Read the old level and set the new one */
57
58 /* Not volatile - will be optimized away if the return value isn't used */
59 asm ("stc sr, %0" : "=r" (i));
60 asm volatile ("ldc %0, sr" : : "r" (level));
61 return i;
62}
63
64static inline void enable_irq(void)
65{
66 int i;
67 asm volatile ("mov %1, %0 \n" /* Save a constant load from RAM */
68 "ldc %0, sr \n" : "=&r"(i) : "i"(0));
69}
70
71#define disable_irq() \
72 ((void)set_irq_level(HIGHEST_IRQ_LEVEL))
73
74#define disable_irq_save() \
75 set_irq_level(HIGHEST_IRQ_LEVEL)
76
77#define restore_irq(i) \
78 ((void)set_irq_level(i))
79
80static inline uint16_t swap16_hw(uint16_t value)
81 /*
82 result[15..8] = value[ 7..0];
83 result[ 7..0] = value[15..8];
84 */
85{
86 uint16_t result;
87 asm ("swap.b\t%1,%0" : "=r"(result) : "r"(value));
88 return result;
89}
90
91static inline uint32_t swaw32_hw(uint32_t value)
92 /*
93 result[31..16] = value[15.. 0];
94 result[15.. 0] = value[31..16];
95 */
96{
97 uint32_t result;
98 asm ("swap.w\t%1,%0" : "=r"(result) : "r"(value));
99 return result;
100}
101
102static inline uint32_t swap32_hw(uint32_t value)
103 /*
104 result[31..24] = value[ 7.. 0];
105 result[23..16] = value[15.. 8];
106 result[15.. 8] = value[23..16];
107 result[ 7.. 0] = value[31..24];
108 */
109{
110 asm ("swap.b\t%0,%0\n"
111 "swap.w\t%0,%0\n"
112 "swap.b\t%0,%0\n" : "+r"(value));
113 return value;
114}
115
116static inline uint32_t swap_odd_even32_hw(uint32_t value)
117{
118 /*
119 result[31..24],[15.. 8] = value[23..16],[ 7.. 0]
120 result[23..16],[ 7.. 0] = value[31..24],[15.. 8]
121 */
122 asm ("swap.b\t%0,%0\n"
123 "swap.w\t%0,%0\n"
124 "swap.b\t%0,%0\n"
125 "swap.w\t%0,%0\n" : "+r"(value));
126 return value;
127}
128
129extern const unsigned bit_n_table[32];
130#define BIT_N(n) ( \
131 __builtin_constant_p(n) \
132 ? (1U << (n)) \
133 : bit_n_table[n] \
134)
135
136static inline void commit_dcache(void) {}
137static inline void commit_discard_dcache(void) {}
138static inline void commit_discard_idcache(void) {}
139
140/*---------------------------------------------------------------------------
141 * Put core in a power-saving state.
142 *---------------------------------------------------------------------------
143 */
144static inline void core_sleep(void)
145{
146 asm volatile (
147 "and.b #0x7f, @(r0, gbr) \n" /* Clear SBY (bit 7) in SBYCR */
148 "mov #0, r1 \n" /* Enable interrupts */
149 "ldc r1, sr \n" /* Following instruction cannot be interrupted */
150 "sleep \n" /* Execute standby */
151 : : "z"(&SBYCR-GBR) : "r1");
152}
153
154#endif /* SYSTEM_TARGET_H */
diff --git a/firmware/test/buflib/Makefile b/firmware/test/buflib/Makefile
deleted file mode 100644
index 33191c6cbe..0000000000
--- a/firmware/test/buflib/Makefile
+++ /dev/null
@@ -1,67 +0,0 @@
1FIRMWARE=../..
2
3CC ?= gcc
4# Note: Don't be fooled by MEMORYSIZE here
5# We have a fixed, predictable buffer in UT_core_allocator_init()
6CFLAGS += -g -O2 -DDEBUG -D__PCTOOL__ -DBUFLIB_UNIT_TEST -DMEMORYSIZE=8 -DBUFLIB_DEBUG_BLOCKS -std=gnu99 -I$(FIRMWARE)/include -I$(FIRMWARE)/export -I.
7LDFLAGS += -L. -lpthread
8
9.PHONY: clean all
10
11TARGETS_OBJ = test_main.o \
12 test_main2.o \
13 test_move.o \
14 test_move2.o \
15 test_max.o \
16 test_shrink.o \
17 test_shrink_unaligned.o \
18 test_shrink_startchanged.o \
19 test_shrink_cb.o
20
21TARGETS = $(TARGETS_OBJ:.o=)
22
23LIB_OBJ = buflib.o \
24 core_alloc.o \
25 crc32.o \
26 strlcpy.o \
27 util.o
28
29LIB_FILE = libbuflib.a
30LIB = buflib
31
32
33ifndef V
34SILENT:=@
35else
36VERBOSEOPT:=-v
37endif
38
39PRINTS=$(SILENT)$(call info,$(1))
40
41all: $(TARGETS)
42
43test_%: test_%.o $(LIB_FILE)
44 $(call PRINTS,LD $@)$(CC) $(LDFLAGS) -o $@ $< -l$(LIB)
45
46$(TARGETS): $(TARGETS_OBJ) $(LIB_FILE)
47
48buflib.o: $(FIRMWARE)/buflib.c
49 $(CC) $(CFLAGS) -c $< -o $@
50
51core_alloc.o: $(FIRMWARE)/core_alloc.c
52 $(CC) $(CFLAGS) -c $< -o $@
53
54crc32.o: $(FIRMWARE)/common/crc32.c
55 $(CC) $(CFLAGS) -c $< -o $@
56
57strlcpy.o: $(FIRMWARE)/common/strlcpy.c
58 $(CC) $(CFLAGS) -c $< -o $@
59
60%.o: %.c
61 $(call PRINTS,CC $<)$(CC) $(CFLAGS) -c $<
62
63$(LIB_FILE): $(LIB_OBJ)
64 $(call PRINTS,AR $@)ar rcs $@ $^
65
66clean:
67 rm *.o $(TARGETS) $(LIB_FILE)
diff --git a/firmware/test/buflib/autoconf.h b/firmware/test/buflib/autoconf.h
deleted file mode 100644
index abfaa482e1..0000000000
--- a/firmware/test/buflib/autoconf.h
+++ /dev/null
@@ -1,2 +0,0 @@
1/* Define endianess for the target or simulator platform */
2#define ROCKBOX_LITTLE_ENDIAN 1
diff --git a/firmware/test/buflib/system-hosted.h b/firmware/test/buflib/system-hosted.h
deleted file mode 100644
index 40b5ea8f9f..0000000000
--- a/firmware/test/buflib/system-hosted.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2015 Thomas Jarosch
11*
12* Loosely based upon rbcodecplatform-unix.h from rbcodec
13*
14* This program is free software; you can redistribute it and/or
15* modify it under the terms of the GNU General Public License
16* as published by the Free Software Foundation; either version 2
17* of the License, or (at your option) any later version.
18*
19* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20* KIND, either express or implied.
21*
22****************************************************************************/
23
24#ifndef _COMMON_UNITTEST_H
25#define _COMMON_UNITTEST_H
26
27/* debugf, logf */
28#define debugf(...) fprintf(stderr, __VA_ARGS__)
29
30#ifndef logf
31#define logf(...) do { fprintf(stderr, __VA_ARGS__); \
32 putc('\n', stderr); \
33 } while (0)
34#endif
35
36#ifndef panicf
37#define panicf(...) do { fprintf(stderr, __VA_ARGS__); \
38 putc('\n', stderr); \
39 exit(-1); \
40 } while (0)
41#endif
42
43#endif /* _COMMON_UNITTEST_H */
diff --git a/firmware/test/buflib/test_main.c b/firmware/test/buflib/test_main.c
deleted file mode 100644
index 83b95e4341..0000000000
--- a/firmware/test/buflib/test_main.c
+++ /dev/null
@@ -1,88 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21
22#include <stdio.h>
23#include <stdlib.h>
24#include "buflib.h"
25#include "util.h"
26
27#define BUFLIB_BUFFER_SIZE (12<<10)
28static char buflib_buffer[BUFLIB_BUFFER_SIZE];
29static struct buflib_context ctx;
30#define assert(x) do { if (!(x)) exit(1); } while(0)
31
32int move_callback(int handle, void* current, void* new)
33{
34 (void)handle;(void)current;(void)new;
35 printf("Move!\n");
36}
37
38int shrink_callback(int handle, unsigned hints, void* start, size_t old_size)
39{
40 (void)handle;(void)start;(void)old_size;(void)hints;
41 printf("Shrink");
42}
43
44struct buflib_callbacks ops = {
45 .move_callback = move_callback,
46 .shrink_callback = shrink_callback,
47};
48
49int main(int argc, char **argv)
50{
51 buflib_init(&ctx, buflib_buffer, BUFLIB_BUFFER_SIZE);
52
53 int id = buflib_alloc_ex(&ctx, 512, "foo", &ops);
54 int id2 = buflib_alloc_ex(&ctx, 1024, "bar", &ops);
55 int id3 = buflib_alloc_ex(&ctx, 8<<10, "8K", &ops);
56
57 assert(id > 0 && id2 > 0 && id3 > 0);
58
59 #define STR "<TEST>"
60 strncpy(buflib_get_data(&ctx, id3), STR, sizeof STR);
61 if (id > 0)
62 {
63 buflib_print_allocs(&ctx, &print_handle);
64 buflib_free(&ctx, id);
65 buflib_print_allocs(&ctx, &print_handle);
66 buflib_free(&ctx, id2);
67 buflib_print_allocs(&ctx, &print_handle);
68
69 id = buflib_alloc_ex(&ctx, 3<<10, "should compact", &ops);
70 if (id <= 0) printf("compacting alloc failed\n");
71
72 buflib_print_allocs(&ctx, &print_handle);
73
74 printf("id I: %p\n", buflib_get_data(&ctx, id3));
75 id2 = buflib_alloc_ex(&ctx, 3<<10, "should fail", &ops);
76 printf("id II: %p\n", buflib_get_data(&ctx, id3));
77 if (id2 <= 0) printf("failing alloc failed\n");
78 else buflib_free(&ctx, id2);
79
80 if (id > 0)
81 buflib_free(&ctx, id);
82
83 printf("Check string: \"%s\"\n", buflib_get_data(&ctx, id3));
84 buflib_print_allocs(&ctx, &print_handle);
85 }
86
87 return 0;
88}
diff --git a/firmware/test/buflib/test_main2.c b/firmware/test/buflib/test_main2.c
deleted file mode 100644
index da6b1366e7..0000000000
--- a/firmware/test/buflib/test_main2.c
+++ /dev/null
@@ -1,108 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include <stdlib.h>
23#include "core_alloc.h"
24#include "util.h"
25
26/*
27 * Expected output (64-bit):
28-------------------
29-------------------
30*/
31
32#define error(...) do { printf(__VA_ARGS__); exit(1); } while(0)
33static int move_callback(int handle, void* old, void* new)
34{
35 printf("MOVED!\n");
36 return BUFLIB_CB_OK;
37}
38
39static int shrink_callback(int handle, unsigned hints, void* start, size_t size)
40{
41 char* buf = start;
42
43 size_t wanted = hints & BUFLIB_SHRINK_SIZE_MASK;
44
45 if (handle == 4)
46 {
47 buf+=1, size-=1;
48 memmove(buf, buf-1, (size < 20) ? size : 20);
49 core_shrink(handle, buf, size);
50 return BUFLIB_CB_OK;
51 }
52 return BUFLIB_CB_CANNOT_SHRINK;
53}
54
55static struct buflib_callbacks ops = {
56 .move_callback = move_callback,
57 .shrink_callback = shrink_callback,
58};
59
60static struct buflib_callbacks ops2 = {
61 .move_callback = NULL,
62 .shrink_callback = shrink_callback,
63};
64
65int main(void)
66{
67 size_t size2, size4;
68 UT_core_allocator_init();
69
70 printf("available: %zu\n", core_available());
71 int first = core_alloc("first, fixed", 4<<10);
72 if (first <= 0) error("first failed\n");
73
74 printf("available: %zu\n", core_available());
75 int second = core_alloc_maximum("second, var", &size2, &ops);
76 if (second <= 0) error("second failed\n");
77 printf("second size: %zu\n", size2);
78
79 strcpy(core_get_data(second), "begin");
80 strcpy(core_get_data(second)+124, "end");
81 printf("%s\n", core_get_name(second));
82 if (!core_shrink(second, core_get_data(second), 128))
83 error("shrink second failed\n");
84
85 int third = core_alloc("third, fixed", 20<<10);
86 if (third <= 0) error("third failed");
87 strcpy(core_get_data(third), "third");
88
89 printf("available: %zu\n", core_available());
90 int fourth = core_alloc_maximum("fourth", &size4, &ops2);
91 if (fourth <= 0) error("fourth failed\n");
92 core_print_blocks(&print_simple);
93 if (!core_shrink(fourth, core_get_data(fourth)+(5<<10), size4-(5<<10)))
94 {
95 error("shrink fourth failed\n");
96 }
97 sprintf(core_get_data(fourth), "fourth size: %zu", size4);
98 core_print_blocks(&print_simple);
99
100 int fifth = core_alloc("fifth, fixed", 6<<10);
101 if (fifth <= 0) error("fifth failed\n");
102
103 printf("%s\n", core_get_data(fourth));
104 core_print_blocks(&print_simple);
105 core_print_allocs(&print_simple);
106
107 return 0;
108}
diff --git a/firmware/test/buflib/test_max.c b/firmware/test/buflib/test_max.c
deleted file mode 100644
index 5378fcf6bd..0000000000
--- a/firmware/test/buflib/test_max.c
+++ /dev/null
@@ -1,75 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include "core_alloc.h"
23#include "util.h"
24
25
26/*
27 * Expected output (64bit):
28-------------------
29get_all(1): 0x6027a0
30 0x6027c8
31 6424
32get_all(1): 0x6027a0
33 0x6027c8
34 3232
35get_all(1): 0x6027a0
36 0x6027c8
37 3232
38dont freeze(2): 0x603440
39 0x603470
40 152
410x6027a0: val: 404 (get_all)
420x603440: val: 19 (dont freeze)
43-------------------
44*/
45struct buflib_callbacks ops;
46int main(void)
47{
48 UT_core_allocator_init();
49 size_t size;
50 int handle = core_alloc_maximum("get_all", &size, &ops);
51
52 if (handle <= 0)
53 printf("core_alloc_maximum error\n");
54 int handle2;
55
56 core_print_allocs(&print_simple);
57
58 /* this should freeze */
59 // core_alloc("freeze", 100);
60 core_shrink(handle, core_get_data(handle), size/2);
61
62 core_print_allocs(&print_simple);
63
64 /* this should not freeze anymore */
65 handle2 = core_alloc("dont freeze", 100);
66 if (handle2 <= 0)
67 printf("handle 2 failed!\n");
68
69 core_print_allocs(&print_simple);
70 core_print_blocks(&print_simple);
71
72 core_free(handle);
73 core_free(handle2);
74 return 0;
75}
diff --git a/firmware/test/buflib/test_move.c b/firmware/test/buflib/test_move.c
deleted file mode 100644
index cf6168a311..0000000000
--- a/firmware/test/buflib/test_move.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include "core_alloc.h"
23#include "util.h"
24
25static int move_size;
26int move_callback(int handle, void* old, void* new)
27{
28 move_size = (char*)old-(char*)new;
29 printf("Move! %s, %p, %p, %zu\n", core_get_name(handle), old, new,
30 move_size);
31
32 return BUFLIB_CB_OK;
33}
34
35struct buflib_callbacks ops = {
36 .move_callback = move_callback,
37 .shrink_callback = NULL,
38};
39
40int main(void)
41{
42 UT_core_allocator_init();
43
44 int first = core_alloc("first", 20<<10);
45 int second= core_alloc_ex("second", 20<<10, &ops);
46 strcpy(core_get_data(second), "Here's data");
47
48 core_free(first);
49 /* should not trigger compaction, but replace the just freed one */
50 int third = core_alloc("third", 20<<10);
51 core_free(third);
52 /* should trigger compaction since it's a bit bigger than the just freed one */
53 int fourth = core_alloc("fourth", 21<<10);
54
55 int ret = !(!strcmp(core_get_data(second), "Here's data") && move_size >= 20<<10);
56
57 core_print_blocks(&print_simple);
58
59 core_free(second);
60 core_free(third);
61
62 return ret;
63}
diff --git a/firmware/test/buflib/test_move2.c b/firmware/test/buflib/test_move2.c
deleted file mode 100644
index 2f72850b2b..0000000000
--- a/firmware/test/buflib/test_move2.c
+++ /dev/null
@@ -1,132 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include "core_alloc.h"
23#include "util.h"
24/*
25 * Expected output (64bit)
26--------------------
27after freeing first: available: 10040
28after freeing forth: available: 10040
29buflib_compact(): Compacting!
30move_block(): moving "third"(id=3) by -3210(-25680)
31Move! third, 0x608758, 0x602308, 25680
32Cannot move now for handle 3
33fifth failed. Retrying...
34buflib_compact(): Compacting!
35move_block(): moving "third"(id=3) by -3210(-25680)
36Move! third, 0x608758, 0x602308, 25680
37fifth handle: 1
38fifth(1): 0x608730
39 0x608758
40 21544
41second(2): 0x607308
42 0x607330
43 5160
44third(3): 0x6022e0
45 0x602308
46 15400
47sixth(4): 0x605f08
48 0x605f30
49 2088
50seventh(5): 0x606730
51 0x606758
52 552
530x6022e0: val: 1925 (third)
540x605f08: val: 261 (sixth)
550x606730: val: 69 (seventh)
560x606958: val: -310 (<unallocated>)
570x607308: val: 645 (second)
580x608730: val: 2693 (fifth)
59--------------------
60*/
61
62static int move_size, retry;
63int move_callback(int handle, void* old, void* new)
64{
65 move_size = (char*)old-(char*)new;
66 printf("Move! %s, %p, %p, %d\n", core_get_name(handle), old, new,
67 move_size);
68
69 if (!retry)
70 {
71 retry = 1;
72 printf("Cannot move now for handle %d\n", handle);
73 return BUFLIB_CB_CANNOT_MOVE;
74 }
75 return BUFLIB_CB_OK;
76}
77
78struct buflib_callbacks ops = {
79 .move_callback = move_callback,
80 .shrink_callback = NULL,
81};
82
83static struct buflib_callbacks ops_no_move = {
84 .move_callback = NULL,
85 .shrink_callback = NULL,
86};
87
88int main(void)
89{
90 UT_core_allocator_init();
91
92 int first = core_alloc("first", 20<<10);
93 int second= core_alloc_ex("second", 5<<10, &ops_no_move);
94 int third = core_alloc_ex("third", 15<<10, &ops);
95 strcpy(core_get_data(second), "Here's data");
96
97 core_free(first);
98 printf("after freeing first: available: %zu\n", core_available());
99 /* should not trigger compaction, but replace the just freed one */
100 int fourth = core_alloc("forth", 20<<10);
101 core_free(fourth);
102 printf("after freeing forth: available: %zu\n", core_available());
103 /* should trigger compaction since it's a bit bigger than the just freed one */
104 int fifth = core_alloc("fifth", 21<<10);
105 if (fifth <= 0)
106 {
107 printf("fifth failed. Retrying...\n");
108 fifth = core_alloc("fifth", 21<<10);
109 }
110 if (fifth <= 0)
111 {
112 printf("fifth still failed\n");
113 }
114
115 printf("fifth handle: %d\n", fifth);
116 int sixth = core_alloc("sixth", 2<<10);
117 int seventh = core_alloc("seventh", 512);
118
119
120 core_print_allocs(&print_simple);
121 core_print_blocks(&print_simple);
122 int ret = !(!strcmp(core_get_data(second), "Here's data") && move_size >= 20<<10);
123
124 core_free(second);
125 core_free(third);
126 if (fifth > 0)
127 core_free(fifth);
128 core_free(sixth);
129 core_free(seventh);
130
131 return ret;
132}
diff --git a/firmware/test/buflib/test_shrink.c b/firmware/test/buflib/test_shrink.c
deleted file mode 100644
index 7424f56d51..0000000000
--- a/firmware/test/buflib/test_shrink.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include "core_alloc.h"
23#include "util.h"
24
25/*
26 * Expected output:
27-------------------
280x602520: val: 1285 (first)
290x604d48: val: -32 (<unallocated>)
300x604e48: val: 1221 (second)
310x607470: val: -32 (<unallocated>)
320x607570: val: 1285 (third)
33-------------------
34*/
35struct buflib_callbacks ops;
36
37int main(void)
38{
39 UT_core_allocator_init();
40
41 int first = core_alloc("first", 10<<10);
42 int second = core_alloc("second", 10<<10);
43 int third = core_alloc("third", 10<<10);
44
45 strcpy((char*)core_get_data(second)+0x100, "foobar");
46 core_shrink(second, (char*)core_get_data(second)+0x100, (10<<10)-0x200);
47 core_print_blocks(&print_simple);
48
49 int ret = strcmp(core_get_data(second), "foobar");
50
51 core_free(first);
52 core_free(second);
53 core_free(third);
54
55 return ret;
56}
diff --git a/firmware/test/buflib/test_shrink_cb.c b/firmware/test/buflib/test_shrink_cb.c
deleted file mode 100644
index 8c2c02ed1c..0000000000
--- a/firmware/test/buflib/test_shrink_cb.c
+++ /dev/null
@@ -1,108 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include <stdlib.h>
23#include "core_alloc.h"
24#include "util.h"
25
26/*
27 * Expected output (64-bit):
28-------------------
29MOVED!
300x6032e0: val: 1285 (first)
310x605b08: val: 1285 (third)
320x608330: val: 1413 (fourth)
330x60af58: val: 2181 (fifth)
34SHRINK! 517
35MOVED!
360x6032e0: val: 1285 (first)
370x605b08: val: 645 (third)
380x606f30: val: 1413 (fourth)
390x609b58: val: 2181 (fifth)
400x60df80: val: 517 (sixth)
41-------------------
42*/
43
44#define error(...) do { printf(__VA_ARGS__); exit(1); } while(0)
45static int move_callback(int handle, void* old, void* new)
46{
47 printf("MOVED!\n");
48 return BUFLIB_CB_OK;
49}
50
51static int shrink_callback(int handle, unsigned hints, void* start, size_t size)
52{
53 char* buf = start;
54 size /= 2;
55
56 printf("SHRINK! %u\n", hints);
57
58 memmove(buf + size/2, buf, size);
59 if (core_shrink(handle, buf + size/2, size))
60 {
61 return BUFLIB_CB_OK;
62 }
63 return BUFLIB_CB_CANNOT_SHRINK;
64}
65
66struct buflib_callbacks ops = {
67 .move_callback = move_callback,
68 .shrink_callback = shrink_callback,
69};
70
71int main(void)
72{
73 UT_core_allocator_init();
74
75 int first = core_alloc("first", 10<<10);
76 int second = core_alloc("second", 10<<10);
77 int third = core_alloc_ex("third", 10<<10, &ops);
78
79 strcpy(core_get_data(third), "third");
80
81 core_free(second);
82 int fourth = core_alloc("fourth", 11<<10);
83 strcpy(core_get_data(fourth), "fourth");
84
85 /* this should cause MOVED! twice */
86 int fifth = core_alloc("fifth", 17<<10);
87 if (fifth <= 0) error("fifth failed\n");
88 strcpy(core_get_data(fifth), "fifth");
89
90 core_print_blocks(&print_simple);
91 int sixth = core_alloc("sixth", 4<<10);
92 if (sixth <= 0) error("sixth failed\n");
93 strcpy(core_get_data(sixth), "sixth");
94
95 core_print_blocks(&print_simple);
96
97 int ret = strcmp(core_get_data(third), "third")
98 || strcmp(core_get_data(fourth), "fourth")
99 || strcmp(core_get_data(fifth), "fifth")
100 || strcmp(core_get_data(sixth), "sixth");
101 core_free(first);
102 core_free(third);
103 core_free(fourth);
104 core_free(fifth);
105 core_free(sixth);
106
107 return ret;
108}
diff --git a/firmware/test/buflib/test_shrink_startchanged.c b/firmware/test/buflib/test_shrink_startchanged.c
deleted file mode 100644
index 63b864db88..0000000000
--- a/firmware/test/buflib/test_shrink_startchanged.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include "core_alloc.h"
23#include "util.h"
24
25/*
26 * Expected output:
27-------------------
280x602620: val: 1285 (first)
290x604e48: val: -32 (<unallocated>)
300x604f48: val: 1253 (second)
310x607670: val: 1285 (third)
32-------------------
33*/
34struct buflib_callbacks ops;
35
36int main(void)
37{
38 UT_core_allocator_init();
39
40 int first = core_alloc("first", 10<<10);
41 int second = core_alloc("second", 10<<10);
42 int third = core_alloc("third", 10<<10);
43
44 strcpy(core_get_data(third), "baz");
45
46 strcpy((char*)core_get_data(second)+0x102, "foobar");
47 core_shrink(second, (char*)core_get_data(second)+0x102, (10<<10)-0x102);
48 memset(core_get_data(second) + sizeof("foobar"), 0, (10<<10)-0x102-sizeof("foobar"));
49 core_print_blocks(&print_simple);
50
51 int ret = strcmp(core_get_data(second), "foobar")
52 || strcmp(core_get_data(third), "baz");
53
54 core_free(first);
55 core_free(second);
56 core_free(third);
57
58 return ret;
59}
diff --git a/firmware/test/buflib/test_shrink_unaligned.c b/firmware/test/buflib/test_shrink_unaligned.c
deleted file mode 100644
index 0f07685f65..0000000000
--- a/firmware/test/buflib/test_shrink_unaligned.c
+++ /dev/null
@@ -1,56 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2011 Thomas Martitz
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include <stdio.h>
22#include "core_alloc.h"
23#include "util.h"
24
25/*
26 * Expected output:
27-------------------
280x602520: val: 1285 (first)
290x604d48: val: -32 (<unallocated>)
300x604e48: val: 1222 (second)
310x607470: val: -31 (<unallocated>)
320x607570: val: 1285 (third)
33-------------------
34*/
35struct buflib_callbacks ops;
36
37int main(void)
38{
39 UT_core_allocator_init();
40
41 int first = core_alloc("first", 10<<10);
42 int second = core_alloc("second", 10<<10);
43 int third = core_alloc("third", 10<<10);
44
45 strcpy((char*)core_get_data(second)+0x102, "foobar");
46 core_shrink(second, (char*)core_get_data(second)+0x102, (10<<10)-0x200);
47 core_print_blocks(&print_simple);
48
49 int ret = strcmp(core_get_data(second), "foobar");
50
51 core_free(first);
52 core_free(second);
53 core_free(third);
54
55 return ret;
56}
diff --git a/firmware/test/buflib/util.c b/firmware/test/buflib/util.c
deleted file mode 100644
index 66a02e8a0d..0000000000
--- a/firmware/test/buflib/util.c
+++ /dev/null
@@ -1,61 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2015 Thomas Jarosch
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21#include "util.h"
22#include "stdio.h"
23#include "buflib.h"
24#include "system.h"
25
26void print_simple(const char *str)
27{
28 printf("%s\n", str);
29}
30
31void print_handle(int handle_num, const char *str)
32{
33 (void)handle_num;
34 printf("%s\n", str);
35}
36
37/* fake core_allocator_init() with a fixed 50kb buffer size */
38void UT_core_allocator_init()
39{
40 extern struct buflib_context core_ctx;
41 static char buf[50<<10];
42 unsigned char *raw_start = buf;
43 unsigned char *aligned_start = ALIGN_UP(raw_start, sizeof(intptr_t));
44
45 buflib_init(&core_ctx, aligned_start, sizeof(buf) - (aligned_start - raw_start));
46}
47
48/* TODO: those should be part of core_alloc */
49void core_print_blocks(void (*print)(const char*))
50{
51 (void)print;
52 extern struct buflib_context core_ctx;
53 buflib_print_blocks(&core_ctx, &print_handle);
54}
55
56void core_print_allocs(void (*print)(const char*))
57{
58 (void)print;
59 extern struct buflib_context core_ctx;
60 buflib_print_allocs(&core_ctx, &print_handle);
61}
diff --git a/firmware/test/buflib/util.h b/firmware/test/buflib/util.h
deleted file mode 100644
index 1b03bbbed5..0000000000
--- a/firmware/test/buflib/util.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8* $Id$
9*
10* Copyright (C) 2015 Thomas Jarosch
11*
12* This program is free software; you can redistribute it and/or
13* modify it under the terms of the GNU General Public License
14* as published by the Free Software Foundation; either version 2
15* of the License, or (at your option) any later version.
16*
17* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18* KIND, either express or implied.
19*
20****************************************************************************/
21
22#ifndef _TEST_UTIL_H
23#define _TEST_UTIL_H
24
25void print_simple(const char *string);
26void print_handle(int handle_num, const char *string);
27
28void UT_core_allocator_init();
29
30#endif
diff --git a/firmware/test/fat/Makefile b/firmware/test/fat/Makefile
deleted file mode 100644
index 38bce0bde1..0000000000
--- a/firmware/test/fat/Makefile
+++ /dev/null
@@ -1,49 +0,0 @@
1SECTOR_SIZE = 512
2FIRMWARE = ../..
3
4DRIVERS = ../../drivers
5EXPORT = ../../export
6
7BUILDDATE=$(shell date -u +'-DYEAR=%Y -DMONTH=%m -DDAY=%d')
8INCLUDE = -I$(EXPORT) -I$(FIRMWARE)/include -I$(FIRMWARE)/target/hosted -I$(FIRMWARE)/target/hosted/sdl
9DEFINES = -DTEST_FAT -DDEBUG -DDISK_WRITE -DHAVE_FAT16SUPPORT -D__PCTOOL__
10
11CFLAGS = -g -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) $(BUILDDATE) -I. $(INCLUDE) -I$(FIRMWARE)/libc/include -DROCKBOX_DIR='".rockbox"' -DSECTOR_SIZE=$(SECTOR_SIZE)
12SIMFLAGS = -g -Wall -std=gnu99 -Wno-pointer-sign $(DEFINES) -I. $(INCLUDE) -DSECTOR_SIZE=$(SECTOR_SIZE)
13
14TARGET = fat
15
16all: $(TARGET)
17
18$(TARGET): fat.o ata-sim.o main.o disk.o dir.o file.o ctype.o unicode.o strlcpy.o
19 gcc -g -o fat $+
20
21fat.o: $(DRIVERS)/fat.c $(EXPORT)/fat.h $(EXPORT)/ata.h
22 $(CC) $(CFLAGS) -c $< -o $@
23
24ctype.o: $(FIRMWARE)/libc/ctype.c
25 $(CC) $(CFLAGS) -c $< -o $@
26
27disk.o: $(FIRMWARE)/common/disk.c
28 $(CC) $(CFLAGS) -c $< -o $@
29
30dir.o: $(FIRMWARE)/common/dir_uncached.c
31 $(CC) $(CFLAGS) -c $< -o $@
32
33file.o: $(FIRMWARE)/common/file.c
34 $(CC) $(CFLAGS) -c $< -o $@
35
36unicode.o: $(FIRMWARE)/common/unicode.c
37 $(CC) $(CFLAGS) -c $< -o $@
38
39strlcpy.o: $(FIRMWARE)/common/strlcpy.c
40 $(CC) $(CFLAGS) -c $< -o $@
41
42ata-sim.o: ata-sim.c $(EXPORT)/ata.h
43 $(CC) $(SIMFLAGS) -c $< -o $@
44
45main.o: main.c $(EXPORT)/ata.h
46 $(CC) $(SIMFLAGS) -c $< -o $@
47
48clean:
49 rm -f *.o $(TARGET)
diff --git a/firmware/test/fat/README b/firmware/test/fat/README
deleted file mode 100644
index 58ffe7ffa8..0000000000
--- a/firmware/test/fat/README
+++ /dev/null
@@ -1,32 +0,0 @@
1This code is for testing the Rockbox fat code on a dummy drive image file.
2
3Dummy image
4-----------
5Here's how to create a 1 gig dummy drive image in linux:
6
7# dd if=/dev/hda of=disk.img bs=1M count=1024
8
9You can then format disk.img as a FAT32 partition:
10
11# mkdosfs -F 32 disk.img
12
13To mount the image, your linux kernel must include the loopback device:
14
15# mount -o loop disk.img /mnt/image
16
17Now copy some test data to the disk, umount it and start testing.
18
19The test script mounts the disk image in order to initialize it will a number
20of dummy files. Since users are no longer allowed to mount loopback devices,
21you can either run the test script as root (not recommended) or add a line to
22your fstab file:
23
24/path/to/disk.img /mnt/dummy vfat loop,users,noauto 0 0
25
26
27Test code
28---------
29The files in this dir build the 'fat' program. It will read 'disk.img' and
30treat is as a real disk, thanks to the ata-sim.c module.
31
32Modify the main.c source code to make it perform the tests you want.
diff --git a/firmware/test/fat/ata-sim.c b/firmware/test/fat/ata-sim.c
deleted file mode 100644
index 07b772f433..0000000000
--- a/firmware/test/fat/ata-sim.c
+++ /dev/null
@@ -1,68 +0,0 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#include "debug.h"
5
6static FILE* file;
7
8void panicf( const char *fmt, ... );
9
10int storage_read_sectors(unsigned long start, int count, void* buf)
11{
12 if ( count > 1 )
13 DEBUGF("[Reading %d blocks: 0x%lx to 0x%lx]\n",
14 count, start, start+count-1);
15 else
16 DEBUGF("[Reading block 0x%lx]\n", start);
17
18 if(fseek(file,start*SECTOR_SIZE,SEEK_SET)) {
19 perror("fseek");
20 return -1;
21 }
22 if(!fread(buf,SECTOR_SIZE,count,file)) {
23 DEBUGF("ata_write_sectors(0x%lx, 0x%x, %p)\n", start, count, buf );
24 perror("fread");
25 panicf("Disk error\n");
26 }
27 return 0;
28}
29
30int storage_write_sectors(unsigned long start, int count, void* buf)
31{
32 if ( count > 1 )
33 DEBUGF("[Writing %d blocks: 0x%lx to 0x%lx]\n",
34 count, start, start+count-1);
35 else
36 DEBUGF("[Writing block 0x%lx]\n", start);
37
38 if (start == 0)
39 panicf("Writing on sector 0!\n");
40
41 if(fseek(file,start*SECTOR_SIZE,SEEK_SET)) {
42 perror("fseek");
43 return -1;
44 }
45 if(!fwrite(buf,SECTOR_SIZE,count,file)) {
46 DEBUGF("ata_write_sectors(0x%lx, 0x%x, %p)\n", start, count, buf );
47 perror("fwrite");
48 panicf("Disk error\n");
49 }
50 return 0;
51}
52
53int ata_init(void)
54{
55 char* filename = "disk.img";
56 /* check disk size */
57 file=fopen(filename,"rb+");
58 if(!file) {
59 fprintf(stderr, "read_disk() - Could not find \"%s\"\n",filename);
60 return -1;
61 }
62 return 0;
63}
64
65void ata_exit(void)
66{
67 fclose(file);
68}
diff --git a/firmware/test/fat/autoconf.h b/firmware/test/fat/autoconf.h
deleted file mode 100644
index e5a91790af..0000000000
--- a/firmware/test/fat/autoconf.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/* fake autoconf for fat testing */
2
3#ifndef __BUILD_AUTOCONF_H
4#define __BUILD_AUTOCONF_H
5
6/* assume little endian for now */
7#define ROCKBOX_LITTLE_ENDIAN 1
8
9#endif
diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c
deleted file mode 100644
index e838682b0b..0000000000
--- a/firmware/test/fat/main.c
+++ /dev/null
@@ -1,724 +0,0 @@
1#include <stdio.h>
2#include <stdlib.h>
3#include <string.h>
4#include <stdarg.h>
5#include <time.h>
6#include "fat.h"
7#include "debug.h"
8#include "disk.h"
9#include "dir.h"
10#include "file.h"
11#include "ata.h"
12#include "storage.h"
13
14void dbg_dump_sector(int sec);
15void dbg_dump_buffer(unsigned char *buf, int len, int offset);
16void dbg_console(void);
17
18void mutex_init(struct mutex* l) {}
19void mutex_lock(struct mutex* l) {}
20void mutex_unlock(struct mutex* l) {}
21
22void panicf( char *fmt, ...)
23{
24 va_list ap;
25 va_start( ap, fmt );
26 fprintf(stderr,"***PANIC*** ");
27 vfprintf(stderr, fmt, ap );
28 va_end( ap );
29 exit(1);
30}
31
32void debugf(const char *fmt, ...)
33{
34 va_list ap;
35 va_start( ap, fmt );
36 fprintf(stderr,"DEBUGF: ");
37 vfprintf( stderr, fmt, ap );
38 va_end( ap );
39}
40
41void ldebugf(const char* file, int line, const char *fmt, ...)
42{
43 va_list ap;
44 va_start( ap, fmt );
45 fprintf( stderr, "%s:%d ", file, line );
46 vfprintf( stderr, fmt, ap );
47 va_end( ap );
48}
49
50void dbg_dump_sector(int sec)
51{
52 unsigned char buf[SECTOR_SIZE];
53
54 storage_read_sectors(sec,1,buf);
55 DEBUGF("---< Sector %d >-----------------------------------------\n", sec);
56 dbg_dump_buffer(buf, SECTOR_SIZE, 0);
57}
58
59void dbg_dump_buffer(unsigned char *buf, int len, int offset)
60{
61 int i, j;
62 unsigned char c;
63 unsigned char ascii[33];
64
65 for(i = 0;i < len/16;i++)
66 {
67 DEBUGF("%03x: ", i*16 + offset);
68 for(j = 0;j < 16;j++)
69 {
70 c = buf[i*16+j];
71
72 DEBUGF("%02x ", c);
73 if(c < 32 || c > 127)
74 {
75 ascii[j] = '.';
76 }
77 else
78 {
79 ascii[j] = c;
80 }
81 }
82
83 ascii[j] = 0;
84 DEBUGF("%s\n", ascii);
85 }
86}
87
88void dbg_dir(char* currdir)
89{
90 DIR* dir;
91 struct dirent* entry;
92
93 dir = opendir(currdir);
94 if (dir)
95 {
96 while ( (entry = readdir(dir)) ) {
97 DEBUGF("%15s %lx\n", entry->d_name, entry->startcluster);
98 }
99 closedir(dir);
100 }
101 else
102 {
103 DEBUGF( "Could not open dir %s\n", currdir);
104 }
105}
106
107#define CHUNKSIZE 8
108#define BUFSIZE 8192
109
110int dbg_mkfile(char* name, int num)
111{
112 char text[BUFSIZE+1];
113 int i;
114 int fd;
115 int x=0;
116 bool stop = false;
117
118 fd = creat(name,O_WRONLY);
119 if (fd<0) {
120 DEBUGF("Failed creating file\n");
121 return -1;
122 }
123 num *= 1024;
124 while ( num ) {
125 int rc;
126 int len = num > BUFSIZE ? BUFSIZE : num;
127
128 for (i=0; i<len/CHUNKSIZE; i++ )
129 sprintf(text+i*CHUNKSIZE,"%c%06x,",name[1],x++);
130
131 rc = write(fd, text, len);
132 if ( rc < 0 ) {
133 DEBUGF("Failed writing data\n");
134 return -1;
135 }
136 else
137 if ( rc == 0 ) {
138 DEBUGF("No space left\n");
139 return -2;
140 }
141 else
142 DEBUGF("wrote %d bytes\n",rc);
143
144 num -= len;
145
146 if ( !num ) {
147 if ( stop )
148 break;
149
150 /* add a random number of chunks to test byte-copy code */
151 num = ((int) rand() % SECTOR_SIZE) & ~7;
152 LDEBUGF("Adding random size %d\n",num);
153 stop = true;
154 }
155 }
156
157 return close(fd);
158}
159
160
161int dbg_chkfile(char* name, int size)
162{
163 char text[81920];
164 int i;
165 int x=0;
166 int pos = 0;
167 int block=0;
168 int fd = open(name,O_RDONLY);
169 if (fd<0) {
170 DEBUGF("Failed opening file\n");
171 return -1;
172 }
173
174 size = lseek(fd, 0, SEEK_END);
175 DEBUGF("File is %d bytes\n", size);
176 /* random start position */
177 if ( size )
178 pos = ((int)rand() % size) & ~7;
179 lseek(fd, pos, SEEK_SET);
180 x = pos / CHUNKSIZE;
181
182 LDEBUGF("Check base is %x (%d)\n",x,pos);
183
184 while (1) {
185 int rc = read(fd, text, sizeof text);
186 DEBUGF("read %d bytes\n",rc);
187 if (rc < 0) {
188 panicf("Failed reading data\n");
189 }
190 else {
191 char tmp[CHUNKSIZE+1];
192 if (!rc)
193 break;
194 for (i=0; i<rc/CHUNKSIZE; i++ ) {
195 sprintf(tmp,"%c%06x,",name[1],x++);
196 if (strncmp(text+i*CHUNKSIZE,tmp,CHUNKSIZE)) {
197 int idx = pos + block*sizeof(text) + i*CHUNKSIZE;
198 DEBUGF("Mismatch in byte 0x%x (byte 0x%x of sector 0x%x)."
199 "\nExpected %.8s found %.8s\n",
200 idx, idx % SECTOR_SIZE, idx / SECTOR_SIZE,
201 tmp,
202 text+i*CHUNKSIZE);
203 DEBUGF("i=%x, idx=%x\n",i,idx);
204 dbg_dump_buffer(text+i*CHUNKSIZE - 0x20, 0x40, idx - 0x20);
205 return -1;
206 }
207 }
208 }
209 block++;
210 }
211
212 return close(fd);
213}
214
215int dbg_wrtest(char* name)
216{
217 char text[81920];
218 int i;
219 int x=0;
220 int pos = 0;
221 int block=0;
222 int size, fd, rc;
223 char tmp[CHUNKSIZE+1];
224
225 fd = open(name,O_RDWR);
226 if (fd<0) {
227 DEBUGF("Failed opening file\n");
228 return -1;
229 }
230
231 size = lseek(fd, 0, SEEK_END);
232 DEBUGF("File is %d bytes\n", size);
233 /* random start position */
234 if ( size )
235 pos = ((int)rand() % size) & ~7;
236 rc = lseek(fd, pos, SEEK_SET);
237 if ( rc < 0 )
238 panicf("Failed seeking\n");
239 x = pos / CHUNKSIZE;
240 LDEBUGF("Check base is %x (%d)\n",x,pos);
241
242 sprintf(tmp,"%c%06x,",name[1],x++);
243 rc = write(fd, tmp, 8);
244 if ( rc < 0 )
245 panicf("Failed writing data\n");
246
247 if ( size )
248 pos = ((int)rand() % size) & ~7;
249 rc = lseek(fd, pos, SEEK_SET);
250 if ( rc < 0 )
251 panicf("Failed seeking\n");
252 x = pos / CHUNKSIZE;
253 LDEBUGF("Check base 2 is %x (%d)\n",x,pos);
254
255 while (1) {
256 rc = read(fd, text, sizeof text);
257 DEBUGF("read %d bytes\n",rc);
258 if (rc < 0) {
259 panicf("Failed reading data\n");
260 }
261 else {
262 if (!rc)
263 break;
264 for (i=0; i<rc/CHUNKSIZE; i++ ) {
265 sprintf(tmp,"%c%06x,",name[1],x++);
266 if (strncmp(text+i*CHUNKSIZE,tmp,CHUNKSIZE)) {
267 int idx = pos + block*sizeof(text) + i*CHUNKSIZE;
268 DEBUGF("Mismatch in byte 0x%x (byte 0x%x of sector 0x%x)."
269 "\nExpected %.8s found %.8s\n",
270 idx, idx % SECTOR_SIZE, idx / SECTOR_SIZE,
271 tmp,
272 text+i*CHUNKSIZE);
273 DEBUGF("i=%x, idx=%x\n",i,idx);
274 dbg_dump_buffer(text+i*CHUNKSIZE - 0x20, 0x40, idx - 0x20);
275 return -1;
276 }
277 }
278 }
279 block++;
280 }
281
282 return close(fd);
283}
284
285void dbg_type(char* name)
286{
287 const int size = SECTOR_SIZE*5;
288 unsigned char buf[SECTOR_SIZE*5+1];
289 int fd,rc;
290
291 fd = open(name,O_RDONLY);
292 if (fd<0)
293 return;
294 DEBUGF("Got file descriptor %d\n",fd);
295
296 while ( 1 ) {
297 rc = read(fd, buf, size);
298 if( rc > 0 )
299 {
300 buf[size] = 0;
301 printf("%d: %.*s\n", rc, rc, buf);
302 }
303 else if ( rc == 0 ) {
304 DEBUGF("EOF\n");
305 break;
306 }
307 else
308 {
309 DEBUGF("Failed reading file: %d\n",rc);
310 break;
311 }
312 }
313 close(fd);
314}
315
316int dbg_append(char* name)
317{
318 int x=0;
319 int size, fd, rc;
320 char tmp[CHUNKSIZE+1];
321
322 fd = open(name,O_RDONLY);
323 if (fd<0) {
324 DEBUGF("Failed opening file\n");
325 return -1;
326 }
327
328 size = lseek(fd, 0, SEEK_END);
329 DEBUGF("File is %d bytes\n", size);
330 x = size / CHUNKSIZE;
331 LDEBUGF("Check base is %x (%d)\n",x,size);
332
333 if (close(fd) < 0)
334 return -1;
335
336 fd = open(name,O_RDWR|O_APPEND);
337 if (fd<0) {
338 DEBUGF("Failed opening file\n");
339 return -1;
340 }
341
342 sprintf(tmp,"%c%06x,",name[1],x++);
343 rc = write(fd, tmp, 8);
344 if ( rc < 0 )
345 panicf("Failed writing data\n");
346
347 return close(fd);
348}
349
350int dbg_test(char* name)
351{
352 int x=0;
353 int j;
354 int fd;
355 char text[BUFSIZE+1];
356
357 for (j=0; j<5; j++) {
358 int num = 40960;
359
360 fd = open(name,O_WRONLY|O_CREAT|O_APPEND, 0666);
361 if (fd<0) {
362 DEBUGF("Failed opening file\n");
363 return -1;
364 }
365
366 while ( num ) {
367 int rc, i;
368 int len = num > BUFSIZE ? BUFSIZE : num;
369
370 for (i=0; i<len/CHUNKSIZE; i++ )
371 sprintf(text+i*CHUNKSIZE,"%c%06x,",name[1],x++);
372
373 rc = write(fd, text, len);
374 if ( rc < 0 ) {
375 DEBUGF("Failed writing data\n");
376 return -1;
377 }
378 else
379 if ( rc == 0 ) {
380 DEBUGF("No space left\n");
381 return -2;
382 }
383 else
384 DEBUGF("wrote %d bytes\n",rc);
385
386 num -= len;
387 }
388
389 if (close(fd) < 0)
390 return -1;
391 }
392
393 return 0;
394}
395
396int dbg_dump(char* name, int offset)
397{
398 char buf[SECTOR_SIZE];
399
400 int rc;
401 int fd = open(name,O_RDONLY);
402 if (fd<0) {
403 DEBUGF("Failed opening file\n");
404 return -1;
405 }
406 lseek(fd, offset, SEEK_SET);
407 rc = read(fd, buf, sizeof buf);
408
409 if ( rc < 0 )
410 panicf("Error reading data\n");
411
412 if (close(fd) < 0)
413 return -1;
414
415 dbg_dump_buffer(buf, rc, offset);
416
417 return 0;
418}
419
420void dbg_tail(char* name)
421{
422 unsigned char buf[SECTOR_SIZE*5];
423 int fd,rc;
424
425 fd = open(name,O_RDONLY);
426 if (fd<0)
427 return;
428 DEBUGF("Got file descriptor %d\n",fd);
429
430 rc = lseek(fd,-SECTOR_SIZE,SEEK_END);
431 if ( rc >= 0 ) {
432 rc = read(fd, buf, SECTOR_SIZE);
433 if( rc > 0 )
434 {
435 buf[rc]=0;
436 printf("%d:\n%s\n", (int)strlen(buf), buf);
437 }
438 else if ( rc == 0 ) {
439 DEBUGF("EOF\n");
440 }
441 else
442 {
443 DEBUGF("Failed reading file: %d\n",rc);
444 }
445 }
446 else {
447 perror("lseek");
448 }
449
450 close(fd);
451}
452
453int dbg_head(char* name)
454{
455 unsigned char buf[SECTOR_SIZE*5];
456 int fd,rc;
457
458 fd = open(name,O_RDONLY);
459 if (fd<0)
460 return -1;
461 DEBUGF("Got file descriptor %d\n",fd);
462
463 rc = read(fd, buf, SECTOR_SIZE*3);
464 if( rc > 0 )
465 {
466 buf[rc]=0;
467 printf("%d:\n%s\n", (int)strlen(buf), buf);
468 }
469 else if ( rc == 0 ) {
470 DEBUGF("EOF\n");
471 }
472 else
473 {
474 DEBUGF("Failed reading file: %d\n",rc);
475 }
476
477 return close(fd);
478}
479
480int dbg_trunc(char* name, int size)
481{
482 int fd,rc;
483
484#if 1
485 fd = open(name,O_RDWR);
486 if (fd<0)
487 return -1;
488
489 rc = ftruncate(fd, size);
490 if (rc<0) {
491 DEBUGF("ftruncate(%d) failed\n", size);
492 return -2;
493 }
494
495#else
496 fd = open(name,O_RDWR|O_TRUNC);
497 if (fd<0)
498 return -1;
499
500 rc = lseek(fd, size, SEEK_SET);
501 if (fd<0)
502 return -2;
503#endif
504
505 return close(fd);
506}
507
508int dbg_mkdir(char* name)
509{
510 int fd;
511
512 fd = mkdir(name);
513 if (fd<0) {
514 DEBUGF("Failed creating directory\n");
515 return -1;
516 }
517 return 0;
518}
519
520int dbg_cmd(int argc, char *argv[])
521{
522 char* cmd = NULL;
523 char* arg1 = NULL;
524 char* arg2 = NULL;
525
526 if (argc > 1) {
527 cmd = argv[1];
528 if ( argc > 2 ) {
529 arg1 = argv[2];
530 if ( argc > 3 ) {
531 arg2 = argv[3];
532 }
533 }
534 }
535 else {
536 DEBUGF("usage: fat command [options]\n"
537 "commands:\n"
538 " dir <dir>\n"
539 " ds <sector> - display sector\n"
540 " type <file>\n"
541 " head <file>\n"
542 " tail <file>\n"
543 " mkfile <file> <size (KB)>\n"
544 " chkfile <file>\n"
545 " del <file>\n"
546 " rmdir <dir>\n"
547 " dump <file> <offset>\n"
548 " mkdir <dir>\n"
549 " trunc <file> <size>\n"
550 " wrtest <file>\n"
551 " append <file>\n"
552 " test <file>\n"
553 " ren <file> <newname>\n"
554 );
555 return -1;
556 }
557
558 if (!strcasecmp(cmd, "dir"))
559 {
560 if ( arg1 )
561 dbg_dir(arg1);
562 else
563 dbg_dir("/");
564 }
565
566 if (!strcasecmp(cmd, "ds"))
567 {
568 if ( arg1 ) {
569 DEBUGF("secnum: %ld\n", strtol(arg1, NULL, 0));
570 dbg_dump_sector(strtol(arg1, NULL, 0));
571 }
572 }
573
574 if (!strcasecmp(cmd, "type"))
575 {
576 if (arg1)
577 dbg_type(arg1);
578 }
579
580 if (!strcasecmp(cmd, "head"))
581 {
582 if (arg1)
583 return dbg_head(arg1);
584 }
585
586 if (!strcasecmp(cmd, "tail"))
587 {
588 if (arg1)
589 dbg_tail(arg1);
590 }
591
592 if (!strcasecmp(cmd, "mkfile"))
593 {
594 if (arg1) {
595 if (arg2)
596 return dbg_mkfile(arg1,strtol(arg2, NULL, 0));
597 else
598 return dbg_mkfile(arg1,1);
599 }
600 }
601
602 if (!strcasecmp(cmd, "chkfile"))
603 {
604 if (arg1) {
605 if (arg2)
606 return dbg_chkfile(arg1, strtol(arg2, NULL, 0));
607 else
608 return dbg_chkfile(arg1, 0);
609 }
610 }
611
612 if (!strcasecmp(cmd, "mkdir"))
613 {
614 if (arg1) {
615 return dbg_mkdir(arg1);
616 }
617 }
618
619 if (!strcasecmp(cmd, "del"))
620 {
621 if (arg1)
622 return remove(arg1);
623 }
624
625 if (!strcasecmp(cmd, "rmdir"))
626 {
627 if (arg1)
628 return rmdir(arg1);
629 }
630
631 if (!strcasecmp(cmd, "dump"))
632 {
633 if (arg1) {
634 if (arg2)
635 return dbg_dump(arg1, strtol(arg2, NULL, 0));
636 else
637 return dbg_dump(arg1, 0);
638 }
639 }
640
641 if (!strcasecmp(cmd, "wrtest"))
642 {
643 if (arg1)
644 return dbg_wrtest(arg1);
645 }
646
647 if (!strcasecmp(cmd, "append"))
648 {
649 if (arg1)
650 return dbg_append(arg1);
651 }
652
653 if (!strcasecmp(cmd, "test"))
654 {
655 if (arg1)
656 return dbg_test(arg1);
657 }
658
659 if (!strcasecmp(cmd, "trunc"))
660 {
661 if (arg1 && arg2)
662 return dbg_trunc(arg1, strtol(arg2, NULL, 0));
663 }
664
665 if (!strcasecmp(cmd, "ren"))
666 {
667 if (arg1 && arg2)
668 return rename(arg1, arg2);
669 }
670
671 return 0;
672}
673
674extern void ata_exit(void);
675
676int main(int argc, char *argv[])
677{
678 int rc,i;
679 struct partinfo* pinfo;
680
681 srand(clock());
682
683 if(ata_init()) {
684 DEBUGF("*** Warning! The disk is uninitialized\n");
685 return -1;
686 }
687 pinfo = disk_init();
688 if (!pinfo) {
689 DEBUGF("*** Failed reading partitions\n");
690 return -1;
691 }
692
693 for ( i=0; i<4; i++ ) {
694 if ( pinfo[i].type == PARTITION_TYPE_FAT32
695#ifdef HAVE_FAT16SUPPORT
696 || pinfo[i].type == PARTITION_TYPE_FAT16
697#endif
698 ) {
699 DEBUGF("*** Mounting at block %ld\n",pinfo[i].start);
700 rc = fat_mount(IF_MV(0,) IF_MD(0,) pinfo[i].start);
701 if(rc) {
702 DEBUGF("mount: %d",rc);
703 return -1;
704 }
705 break;
706 }
707 }
708 if ( i==4 ) {
709 if(fat_mount(IF_MV(0,) IF_MD(0,) 0)) {
710 DEBUGF("No FAT32 partition!");
711 return -1;
712 }
713 }
714
715 rc = dbg_cmd(argc, argv);
716
717 ata_exit();
718
719 if (rc)
720 DEBUGF("Return code: %d\n", rc);
721
722 return rc;
723}
724
diff --git a/firmware/test/fat/test.sh b/firmware/test/fat/test.sh
deleted file mode 100644
index ca0a1db067..0000000000
--- a/firmware/test/fat/test.sh
+++ /dev/null
@@ -1,146 +0,0 @@
1#!/bin/sh
2
3IMAGE=disk.img
4MOUNT=/mnt/dummy
5RESULT=result.txt
6
7fail() {
8 echo "!! Test failed. Look in $RESULT for test logs."
9 chmod a+rw $RESULT
10 exit
11}
12
13check() {
14 /sbin/dosfsck -r $IMAGE | tee -a $RESULT
15 [ $RETVAL -ne 0 ] && fail
16}
17
18try() {
19 echo COMMAND: fat $1 "$2" "$3"
20 echo COMMAND: fat $1 "$2" "$3" >> $RESULT
21 ./fat $1 "$2" "$3" 2>> $RESULT
22 RETVAL=$?
23 [ $RETVAL -ne 0 ] && fail
24}
25
26buildimage() {
27 /sbin/mkdosfs -F 32 -s $1 $IMAGE > /dev/null
28 #mount -o loop $IMAGE $MOUNT
29 mount $MOUNT
30 echo "Filling it with /etc files"
31 find /etc -maxdepth 1 -type f -readable -exec cp {} $MOUNT \;
32 for i in `seq 1 120`;
33 do
34 echo apa > "$MOUNT/very $i long test filename so we can make sure they.work"
35 done
36 umount $MOUNT
37}
38
39runtests() {
40 rm $RESULT
41
42 echo ---Test: create a long name directory in the root
43 try mkdir "/very long subdir name"
44 check
45 try mkdir "/very long subdir name/apa.monkey.me.now"
46 check
47
48 echo ---Test: create a directory called "dir"
49 try mkdir "/dir"
50 check
51
52 echo ---Test: create a 10K file
53 try mkfile "/really long filenames rock" 10
54 check
55
56 try mkfile /dir/apa.monkey.me.now 10
57 check
58 try chkfile "/really long filenames rock" 10
59 try chkfile /dir/apa.monkey.me.now 8
60
61 echo ---Test: create a 1K file
62 try mkfile /bpa.rock 1
63 check
64 try chkfile /bpa.rock 1
65
66 echo ---Test: create a 40K file
67 try mkfile /cpa.rock 40
68 check
69 try chkfile /cpa.rock 40
70
71 echo ---Test: create a 400K file
72 try mkfile /dpa.rock 400
73 check
74 try chkfile /dpa.rock 400
75
76 echo ---Test: create a 1200K file
77 try mkfile /epa.rock 1200
78 check
79 try chkfile /epa.rock 1200
80
81 echo ---Test: rewrite first 20K of a 40K file
82 try mkfile /cpa.rock 20
83 check
84 try chkfile /cpa.rock 20
85
86 echo ---Test: rewrite first sector of 40K file
87 try mkfile /cpa.rock 0
88 check
89 try chkfile /cpa.rock
90 try chkfile /bpa.rock
91
92 LOOP=50
93 SIZE=700
94
95 try del "/really long filenames rock"
96
97 echo ---Test: create $LOOP $SIZE k files
98 for i in `seq 1 $LOOP`;
99 do
100 echo ---Test: $i/$LOOP ---
101 try mkfile "/rockbox rocks.$i" $SIZE
102 check
103 try chkfile "/rockbox rocks.$i" $SIZE
104 check
105 try del "/rockbox rocks.$i"
106 check
107 try mkfile "/rockbox rocks.$i" $SIZE
108 check
109 try ren "/rockbox rocks.$i" "/$i is a new long filename!"
110 check
111 done
112
113}
114
115echo "--------------------------------------"
116echo "Building test image (4 sector/cluster)"
117echo "--------------------------------------"
118buildimage 4
119runtests
120
121echo "---------------------------------------"
122echo "Building test image (32 sectors/cluster)"
123echo "---------------------------------------"
124buildimage 32
125runtests
126
127echo "--------------------------------------"
128echo "Building test image (1 sector/cluster)"
129echo "--------------------------------------"
130buildimage 1
131runtests
132
133echo "--------------------------------------"
134echo "Building test image (8 sectors/cluster)"
135echo "--------------------------------------"
136buildimage 8
137runtests
138
139echo "----------------------------------------"
140echo "Building test image (128 sectors/cluster)"
141echo "----------------------------------------"
142buildimage 128
143runtests
144
145echo "== Test completed successfully =="
146chmod a+rw $RESULT
diff --git a/firmware/test/fat/test16.sh b/firmware/test/fat/test16.sh
deleted file mode 100644
index 5a1c13150c..0000000000
--- a/firmware/test/fat/test16.sh
+++ /dev/null
@@ -1,135 +0,0 @@
1#!/bin/sh
2
3IMAGE=disk.img
4MOUNT=/mnt/dummy
5DIR=$MOUNT/q
6RESULT=result.txt
7
8fail() {
9 echo "!! Test failed $RETVAL. Look in $RESULT for test logs."
10 chmod a+rw $RESULT
11 exit
12}
13
14check() {
15 /sbin/dosfsck -r $IMAGE | tee -a $RESULT
16 [ $RETVAL -ne 0 ] && fail
17}
18
19try() {
20 echo COMMAND: fat $1 "$2" "$3"
21 echo COMMAND: fat $1 "$2" "$3" >> $RESULT
22 ./fat $1 "$2" "$3" 2>> $RESULT
23 RETVAL=$?
24 [ $RETVAL -ne 0 ] && fail
25}
26
27buildimage() {
28 /sbin/mkdosfs -F 16 -s $1 $IMAGE > /dev/null;
29 mount -o loop,fat=16 $IMAGE $MOUNT;
30 echo "Filling it with /etc files";
31 mkdir $DIR;
32 find /etc -type f -maxdepth 1 -exec cp {} $DIR \;
33 for i in `seq 1 120`;
34 do
35 echo apa > "$DIR/very $i long test filename so we can make sure they.work";
36 done;
37 umount $MOUNT;
38}
39
40runtests() {
41 rm $RESULT
42
43 echo ---Test: create a long name directory in the root
44 try mkdir "/very long subdir name"
45 check
46 try mkdir "/very long subdir name/apa.monkey.me.now"
47 check
48
49 echo ---Test: create a directory called "dir"
50 try mkdir "/dir"
51 check
52
53 echo ---Test: create a 10K file
54 try mkfile "/really long filenames rock" 10
55 check
56
57 try mkfile /dir/apa.monkey.me.now 10
58 check
59 try chkfile "/really long filenames rock" 10
60 try chkfile /dir/apa.monkey.me.now 8
61
62 echo ---Test: create a 1K file
63 try mkfile /bpa.rock 1
64 check
65 try chkfile /bpa.rock 1
66
67 echo ---Test: create a 40K file
68 try mkfile /cpa.rock 40
69 check
70 try chkfile /cpa.rock 40
71
72 echo ---Test: create a 400K file
73 try mkfile /dpa.rock 400
74 check
75 try chkfile /dpa.rock 400
76
77 echo ---Test: create a 1200K file
78 try mkfile /epa.rock 1200
79 check
80 try chkfile /epa.rock 1200
81
82 echo ---Test: rewrite first 20K of a 40K file
83 try mkfile /cpa.rock 20
84 check
85 try chkfile /cpa.rock 20
86
87 echo ---Test: rewrite first sector of 40K file
88 try mkfile /cpa.rock 0
89 check
90 try chkfile /cpa.rock
91 try chkfile /bpa.rock
92
93 LOOP=25
94 SIZE=700
95
96 try del "/really long filenames rock"
97
98 echo ---Test: create $LOOP $SIZE k files
99 for i in `seq 1 $LOOP`;
100 do
101 echo ---Test: $i/$LOOP ---
102 try mkfile "/q/rockbox rocks.$i" $SIZE
103 check
104 try chkfile "/q/rockbox rocks.$i" $SIZE
105 check
106 try del "/q/rockbox rocks.$i"
107 check
108 try mkfile "/q/rockbox rocks.$i" $SIZE
109 check
110 try ren "/q/rockbox rocks.$i" "/q/$i is a new long filename!"
111 check
112 done
113
114}
115
116echo "--------------------------------------"
117echo "Building test image (4 sector/cluster)"
118echo "--------------------------------------"
119buildimage 4
120runtests
121
122echo "--------------------------------------"
123echo "Building test image (8 sectors/cluster)"
124echo "--------------------------------------"
125buildimage 8
126runtests
127
128echo "----------------------------------------"
129echo "Building test image (64 sectors/cluster)"
130echo "----------------------------------------"
131buildimage 64
132runtests
133
134echo "== Test completed successfully =="
135chmod a+rw $RESULT
diff --git a/firmware/test/i2c/Makefile b/firmware/test/i2c/Makefile
deleted file mode 100644
index 51e72b859b..0000000000
--- a/firmware/test/i2c/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
1CC = sh-elf-gcc
2LD = sh-elf-ld
3AR = sh-elf-ar
4AS = sh-elf-as
5OC = sh-elf-objcopy
6
7FIRMWARE=../..
8
9INCLUDES=-I$(FIRMWARE) -I$(FIRMWARE)/common -I$(FIRMWARE)/drivers
10
11TARGET = -DARCHOS_PLAYER_OLD=1
12
13CFLAGS = -g -W -Wall -m1 -save-temps -nostdlib -Wstrict-prototypes -fschedule-insns -fno-builtin $(INCLUDES) $(TARGET) -DDEBUG
14AFLAGS += -small -relax
15
16SRC := $(wildcard *.c)
17OBJS := $(SRC:%.c=%.o) $(FIRMWARE)/crt0.o
18DEPS:=.deps
19DEPDIRS:=$(DEPS)
20
21all : archos.mod
22
23archos.elf : $(OBJS) app.lds
24 $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -lrockbox -L$(FIRMWARE) -Tapp.lds -Wl,-Map,archos.map
25
26archos.bin : archos.elf
27 $(OC) -O binary archos.elf archos.bin
28
29archos.asm: archos.bin
30 sh2d -sh1 archos.bin > archos.asm
31
32archos.mod : archos.bin
33 scramble archos.bin archos.mod
34
35archos.mod.gz : archos.mod
36 gzip -f archos.mod
37
38dist:
39 tar czvf dist.tar.gz Makefile main.c start.s app.lds
40
41clean:
42 -rm -f $(OBJS) *.x *.i *.o *.s *.elf *.bin *.map *.mod *.bak *~
43 -$(RM) -r $(DEPS)
44
45$(DEPS)/%.d: %.c
46 @$(SHELL) -c 'for d in $(DEPDIRS); do { if [ ! -d $$d ]; then mkdir $$d; fi; }; done'
47 @echo "Updating dependencies for $<"
48 @$(SHELL) -ec '$(CC) -MM $(CFLAGS) $< \
49 |sed '\''s|\($*\)\.o[ :]*|\1.o $(<:%.c=%.d) : |g'\'' > $@; \
50 [ -s $@ ] || rm -f $@'
51
52-include $(SRC:%.c=$(DEPS)/%.d)
53
diff --git a/firmware/test/i2c/app.lds b/firmware/test/i2c/app.lds
deleted file mode 100644
index b8a341a8ae..0000000000
--- a/firmware/test/i2c/app.lds
+++ /dev/null
@@ -1,36 +0,0 @@
1ENTRY(start)
2OUTPUT_FORMAT(elf32-sh)
3SECTIONS
4{
5 .text 0x09010000 :
6 {
7 KEEP(*(.vectors))
8 . = ALIGN(0x200);
9 *(.init.text)
10 }
11
12 .text :
13 {
14 *(.text)
15 }
16
17 .data :
18 {
19 *(.rodata)
20 *(.data)
21 }
22
23 .rodata :
24 {
25 *(.rodata)
26 }
27
28 .bss :
29 {
30 _edata = .;
31 *(.bss)
32 *(COMMON)
33 _end = .;
34 _stack = . + 0x80000;
35 }
36}
diff --git a/firmware/test/i2c/gendata.c b/firmware/test/i2c/gendata.c
deleted file mode 100644
index dc5989ee66..0000000000
--- a/firmware/test/i2c/gendata.c
+++ /dev/null
@@ -1,31 +0,0 @@
1#include <stdio.h>
2
3int main(int argc, char *argv[])
4{
5 FILE *f;
6 int i;
7 unsigned char buf[128000];
8
9 f = fopen("mp.mp3", "r");
10
11 if(f)
12 {
13 if(fread(buf, 1, 128000, f) < 128000)
14 {
15 fprintf(stderr, "FAN!\n");
16 exit(1);
17 }
18
19 printf("int mp3datalen = 128000;\n");
20 printf("unsigned char mp3data[128000] =\n{");
21 for(i = 0;i < 128000;i++)
22 {
23 if(i % 8 == 0)
24 {
25 printf("\n");
26 }
27 printf("0x%02x, ", buf[i]);
28 }
29 printf("};\n");
30 }
31}
diff --git a/firmware/test/i2c/main.c b/firmware/test/i2c/main.c
deleted file mode 100644
index 990369eae8..0000000000
--- a/firmware/test/i2c/main.c
+++ /dev/null
@@ -1,1280 +0,0 @@
1/***************************************************************************
2
3 * __________ __ ___.
4
5 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
6
7 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
8
9 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
10
11 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
12
13 * \/ \/ \/ \/ \/
14
15 * $Id$
16
17 *
18
19 * Copyright (C) 2002 by Linus Nielsen Feltzing
20
21 *
22
23
24 * This program is free software; you can redistribute it and/or
25 * modify it under the terms of the GNU General Public License
26 * as published by the Free Software Foundation; either version 2
27 * of the License, or (at your option) any later version.
28
29 *
30
31 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
32
33 * KIND, either express or implied.
34
35 *
36
37 ****************************************************************************/
38
39#include <stdio.h>
40
41#include <stdlib.h>
42
43#include <stdbool.h>
44
45#include <string.h>
46
47#include "i2c.h"
48
49#include "mas35xx.h"
50
51#include "dac3550a.h"
52
53#include "sh7034.h"
54
55#include "system.h"
56
57#include "debug.h"
58
59#include "kernel.h"
60
61#include "thread.h"
62
63#include "ata.h"
64
65#include "disk.h"
66
67#include "fat.h"
68
69#include "file.h"
70
71#include "dir.h"
72
73#include "panic.h"
74
75
76
77#ifndef MIN
78
79#define MIN(a, b) (((a)<(b))?(a):(b))
80
81#endif
82
83
84
85#define MPEG_PLAY 1
86
87#define MPEG_STOP 2
88
89#define MPEG_PAUSE 3
90
91#define MPEG_RESUME 4
92
93#define MPEG_NEED_DATA 100
94
95
96
97#define MP3_LOW_WATER 0x30000
98
99#define MP3_CHUNK_SIZE 0x20000
100
101
102
103unsigned int bass_table[] =
104
105{
106
107 0,
108
109 0x800, /* 1dB */
110
111 0x10000, /* 2dB */
112
113 0x17c00, /* 3dB */
114
115 0x1f800, /* 4dB */
116
117 0x27000, /* 5dB */
118
119 0x2e400, /* 6dB */
120
121 0x35800, /* 7dB */
122
123 0x3c000, /* 8dB */
124
125 0x42800, /* 9dB */
126
127 0x48800, /* 10dB */
128
129 0x4e400, /* 11dB */
130
131 0x53800, /* 12dB */
132
133 0x58800, /* 13dB */
134
135 0x5d400, /* 14dB */
136
137 0x61800 /* 15dB */
138
139};
140
141
142
143unsigned int treble_table[] =
144
145{
146
147 0,
148
149 0x5400, /* 1dB */
150
151 0xac00, /* 2dB */
152
153 0x10400, /* 3dB */
154
155 0x16000, /* 4dB */
156
157 0x1c000, /* 5dB */
158
159 0x22400, /* 6dB */
160
161 0x28400, /* 7dB */
162
163 0x2ec00, /* 8dB */
164
165 0x35400, /* 9dB */
166
167 0x3c000, /* 10dB */
168
169 0x42c00, /* 11dB */
170
171 0x49c00, /* 12dB */
172
173 0x51800, /* 13dB */
174
175 0x58400, /* 14dB */
176
177 0x5f800 /* 15dB */
178
179};
180
181
182
183unsigned char fliptable[] =
184
185{
186
187 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
188
189 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
190
191 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
192
193 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8,
194
195 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4,
196
197 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4,
198
199 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec,
200
201 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc,
202
203 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2,
204
205 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2,
206
207 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea,
208
209 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa,
210
211 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6,
212
213 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6,
214
215 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee,
216
217 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe,
218
219 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1,
220
221 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1,
222
223 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9,
224
225 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9,
226
227 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5,
228
229 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5,
230
231 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed,
232
233 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd,
234
235 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3,
236
237 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3,
238
239 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb,
240
241 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb,
242
243 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7,
244
245 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7,
246
247 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef,
248
249 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff
250
251};
252
253
254
255extern unsigned int stack[];
256
257/* Place the MP3 data right after the stack */
258
259
260
261#define MP3BUF_LEN 0x100000 /* 1 Mbyte */
262
263
264
265unsigned char *mp3buf = (unsigned char *)stack;
266
267
268
269char *tracks[100];
270
271int num_tracks;
272
273
274
275int mp3buf_write;
276
277int mp3buf_read;
278
279int last_dma_chunk_size;
280
281
282
283bool dma_on; /* The DMA is active */
284
285bool playing; /* We are playing an MP3 stream */
286
287bool filling; /* We are filling the buffer with data from disk */
288
289
290
291struct event_queue mpeg_queue SHAREDBSS_ATTR;
292
293
294
295static void mas_poll_start(unsigned int interval_in_ms);
296
297void mpeg_thread(void);
298
299
300
301void reset_mp3_buffer(void)
302
303{
304
305 mp3buf_read = 0;
306
307 mp3buf_write = 0;
308
309}
310
311
312
313void setup_sci0(void)
314
315{
316
317 /* PB15 is I/O, PB14 is IRQ6, PB12 is SCK0 */
318
319 PBCR1 = (PBCR1 & 0x0cff) | 0x1200;
320
321
322
323 /* Set PB12 to output */
324
325 PBIOR |= 0x1000;
326
327
328
329 /* Disable serial port */
330
331 SCR0 = 0x00;
332
333
334
335 /* Synchronous, no prescale */
336
337 SMR0 = 0x80;
338
339
340
341 /* Set baudrate 1Mbit/s */
342
343 BRR0 = 0x03;
344
345
346
347 /* use SCK as serial clock output */
348
349 SCR0 = 0x01;
350
351
352
353 /* Clear FER and PER */
354
355 SSR0 &= 0xe7;
356
357
358
359 /* Set interrupt ITU2 and SCI0 priority to 0 */
360
361 IPRD &= 0x0ff0;
362
363
364
365 /* set IRQ6 and IRQ7 to edge detect */
366
367 ICR |= 0x03;
368
369
370
371 /* set PB15 and PB14 to inputs */
372
373 PBIOR &= 0x7fff;
374
375 PBIOR &= 0xbfff;
376
377
378
379 /* set IRQ6 prio 8 and IRQ7 prio 0 */
380
381 IPRB = ( IPRB & 0xff00 ) | 0x0080;
382
383
384
385 /* Enable End of DMA interrupt at prio 8 */
386
387 IPRC = (IPRC & 0xf0ff) | 0x0800;
388
389
390
391 /* Enable Tx (only!) */
392
393 SCR0 |= 0x20;
394
395}
396
397
398
399
400
401void init_dma(void)
402
403{
404
405 SAR3 = (unsigned int) mp3buf + mp3buf_read;
406
407 DAR3 = 0x5FFFEC3;
408
409 CHCR3 &= ~0x0002; /* Clear interrupt */
410
411 CHCR3 = 0x1504; /* Single address destination, TXI0, IE=1 */
412
413 last_dma_chunk_size = MIN(65536, mp3buf_write - mp3buf_read);
414
415 DTCR3 = last_dma_chunk_size & 0xffff;
416
417 DMAOR = 0x0001; /* Enable DMA */
418
419 CHCR3 |= 0x0001; /* Enable DMA IRQ */
420
421}
422
423
424
425void start_dma(void)
426
427{
428
429 SCR0 |= 0x80;
430
431 dma_on = true;
432
433}
434
435
436
437void stop_dma(void)
438
439{
440
441 SCR0 &= 0x7f;
442
443 dma_on = false;
444
445}
446
447
448
449void dma_tick(void)
450
451{
452
453 /* Start DMA if it isn't running */
454
455 if(playing && !dma_on)
456
457 {
458
459 if(PBDR & 0x4000)
460
461 {
462
463 if(!(SCR0 & 0x80))
464
465 start_dma();
466
467 }
468
469 }
470
471}
472
473
474
475void bitswap(unsigned char *data, int length)
476
477{
478
479 int i;
480
481 for(i = 0;i < length;i++)
482
483 {
484
485 data[i] = fliptable[data[i]];
486
487 }
488
489}
490
491
492
493int main(void)
494
495{
496
497 char buf[40];
498
499 char str[32];
500
501 int i=0;
502
503 DIR *d;
504
505 struct dirent *dent;
506
507 char *tmp;
508
509 int volume, bass, treble;
510
511 unsigned short frame_count;
512
513
514
515 /* Clear it all! */
516
517 SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER);
518
519
520
521 /* This enables the serial Rx interrupt, to be able to exit into the
522
523 debugger when you hit CTRL-C */
524
525 SCR1 |= 0x40;
526
527 SCR1 &= ~0x80;
528
529
530
531 IPRE |= 0xf000; /* Highest priority */
532
533
534
535 i2c_init();
536
537
538
539 dma_on = true;
540
541
542
543 kernel_init();
544
545
546
547 enable_irq();
548
549
550
551 setup_sci0();
552
553
554
555 i=mas_readmem(MAS_BANK_D1,0xff6,(unsigned long*)buf,2);
556
557 if (i) {
558
559 debugf("Error - mas_readmem() returned %d\n", i);
560
561 while(1);
562
563 }
564
565
566
567 i = buf[0] | buf[1] << 8;
568
569 debugf("MAS version: %x\n", i);
570
571 i = buf[4] | buf[5] << 8;
572
573 debugf("MAS revision: %x\n", i);
574
575
576
577 i=mas_readmem(MAS_BANK_D1,0xff9,(unsigned long*)buf,7);
578
579 if (i) {
580
581 debugf("Error - mas_readmem() returned %d\n", i);
582
583 while(1);
584
585 }
586
587
588
589 for(i = 0;i < 7;i++)
590
591 {
592
593 str[i*2+1] = buf[i*4];
594
595 str[i*2] = buf[i*4+1];
596
597 }
598
599 str[i*2] = 0;
600
601 debugf("Description: %s\n", str);
602
603
604
605 i=mas_writereg(0x3b, 0x20);
606
607 if (i < 0) {
608
609 debugf("Error - mas_writereg() returned %d\n", i);
610
611 while(1);
612
613 }
614
615
616
617 i = mas_run(1);
618
619 if (i < 0) {
620
621 debugf("Error - mas_run() returned %d\n", i);
622
623 while(1);
624
625 }
626
627
628
629 i = ata_init();
630
631 debugf("ata_init() returned %d\n", i);
632
633
634
635 i = disk_init();
636
637 debugf("disk_init() returned %d\n", i);
638
639
640
641 debugf("part[0] starts at sector %d\n", part[0].start);
642
643
644
645 i = fat_mount(IF_MV(0,) IF_MD(0,) part[0].start);
646
647 debugf("fat_mount() returned %d\n", i);
648
649
650
651 num_tracks = 0;
652
653 if((d = opendir("/")))
654
655 {
656
657 while((dent = readdir(d)))
658
659 {
660
661 debugf("%s\n", dent->d_name);
662
663 i = strlen(dent->d_name);
664
665 tmp = dent->d_name + i - 4;
666
667 debugf("%s\n", tmp);
668
669 if(!stricmp(tmp, ".mp3"))
670
671 {
672
673 tmp = malloc(i+1);
674
675 if(tmp)
676
677 {
678
679 debugf("Adding track %s\n", dent->d_name);
680
681 snprintf(tmp, i+1, "/%s", dent->d_name);
682
683 tracks[num_tracks++] = tmp;
684
685 }
686
687 else
688
689 {
690
691 panicf("Out of memory\n");
692
693 }
694
695 }
696
697 }
698
699 closedir(d);
700
701 }
702
703
704
705 debugf("Number of tracks: %d\n");
706
707
708
709 queue_init(&mpeg_queue);
710
711
712
713 create_thread(mpeg_thread, stack - 0x2000, 0x4000, 0);
714
715
716
717 mas_poll_start(2);
718
719
720
721 debugf("let's play...\n");
722
723
724
725 queue_post(&mpeg_queue, MPEG_PLAY, 0);
726
727
728
729 volume = 0x2c;
730
731
732
733 if(dac_config(0x04) < 0)
734
735 debugf("DAC write failed\n");
736
737
738
739 if(dac_volume(volume) < 0)
740
741 debugf("DAC write failed\n");
742
743
744
745 bass = 12;
746
747 treble = 8;
748
749
750
751 mas_writereg(MAS_REG_KPRESCALE, 0xe9400);
752
753 mas_writereg(MAS_REG_KBASS, bass_table[bass]);
754
755 mas_writereg(MAS_REG_KTREBLE, treble_table[treble]);
756
757
758
759 while(1)
760
761 {
762
763 sleep(HZ*4);
764
765 }
766
767}
768
769
770
771void IRQ6(void) __attribute__((interrupt_handler));
772
773void IRQ6(void)
774
775{
776
777 stop_dma();
778
779}
780
781
782
783void DEI3(void) __attribute__((interrupt_handler));
784
785void DEI3(void)
786
787{
788
789 int unplayed_space_left;
790
791 int space_until_end_of_buffer;
792
793
794
795 if(playing)
796
797 {
798
799 mp3buf_read += last_dma_chunk_size;
800
801 if(mp3buf_read >= MP3BUF_LEN)
802
803 mp3buf_read = 0;
804
805
806
807 unplayed_space_left = mp3buf_write - mp3buf_read;
808
809 if(unplayed_space_left < 0)
810
811 unplayed_space_left = MP3BUF_LEN + unplayed_space_left;
812
813
814
815 space_until_end_of_buffer = MP3BUF_LEN - mp3buf_read;
816
817
818
819 if(!filling && unplayed_space_left < MP3_LOW_WATER)
820
821 {
822
823 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
824
825 }
826
827
828
829 if(unplayed_space_left)
830
831 {
832
833 last_dma_chunk_size = MIN(65536, unplayed_space_left);
834
835 last_dma_chunk_size = MIN(last_dma_chunk_size, space_until_end_of_buffer);
836
837 DTCR3 = last_dma_chunk_size & 0xffff;
838
839 SAR3 = (unsigned int)mp3buf + mp3buf_read;
840
841 }
842
843 else
844
845 {
846
847 debugf("No more MP3 data. Stopping.\n");
848
849 CHCR3 = 0; /* Stop DMA interrupt */
850
851 }
852
853 }
854
855
856
857 CHCR3 &= ~0x0002; /* Clear DMA interrupt */
858
859}
860
861
862
863static void mas_poll_start(unsigned int interval_in_ms)
864
865{
866
867 unsigned int count;
868
869
870
871 count = FREQ / 1000 / 8 * interval_in_ms;
872
873
874
875 if(count > 0xffff)
876
877 {
878
879 panicf("Error! The MAS poll interval is too long (%d ms)\n",
880
881 interval_in_ms);
882
883 return;
884
885 }
886
887
888
889 /* We are using timer 1 */
890
891
892
893 TSTR &= ~0x02; /* Stop the timer */
894
895 TSNC &= ~0x02; /* No synchronization */
896
897 TMDR &= ~0x02; /* Operate normally */
898
899
900
901 TCNT1 = 0; /* Start counting at 0 */
902
903 GRA1 = count;
904
905 TCR1 = 0x23; /* Clear at GRA match, sysclock/8 */
906
907
908
909 /* Enable interrupt on level 2 */
910
911 IPRC = (IPRC & ~0x000f) | 0x0002;
912
913
914
915 TSR1 &= ~0x02;
916
917 TIER1 = 0xf9; /* Enable GRA match interrupt */
918
919
920
921 TSTR |= 0x02; /* Start timer 2 */
922
923}
924
925
926
927void IMIA1(void) __attribute__((interrupt_handler));
928
929void IMIA1(void)
930
931{
932
933 dma_tick();
934
935 TSR1 &= ~0x01;
936
937}
938
939
940
941int track_index = 0;
942
943char *peek_next_track(int index)
944
945{
946
947 if(track_index < num_tracks)
948
949 return tracks[track_index+index];
950
951 else
952
953 return NULL;
954
955}
956
957
958
959void next_track(void)
960
961{
962
963 track_index++;
964
965}
966
967
968
969int mpeg_file = -1;
970
971
972
973int new_file(void)
974
975{
976
977 char *trackname;
978
979
980
981 trackname = peek_next_track(0);
982
983
984
985 debugf("playing %s\n", trackname);
986
987 mpeg_file = open(trackname, O_RDONLY);
988
989 if(mpeg_file < 0)
990
991 {
992
993 debugf("Couldn't open file\n");
994
995 return -1;
996
997 }
998
999 return 0;
1000
1001}
1002
1003
1004
1005void mpeg_thread(void)
1006
1007{
1008
1009 struct queue_event ev;
1010
1011 int len;
1012
1013 int free_space_left;
1014
1015 int amount_to_read;
1016
1017 bool play_pending;
1018
1019
1020
1021 play_pending = false;
1022
1023 playing = false;
1024
1025
1026
1027 while(1)
1028
1029 {
1030
1031 debugf("S\n");
1032
1033 queue_wait(&mpeg_queue, &ev);
1034
1035 switch(ev.id)
1036
1037 {
1038
1039 case MPEG_PLAY:
1040
1041 /* Stop the current stream */
1042
1043 play_pending = false;
1044
1045 playing = false;
1046
1047 stop_dma();
1048
1049
1050
1051 reset_mp3_buffer();
1052
1053
1054
1055 new_file();
1056
1057
1058
1059 /* Make it read more data */
1060
1061 filling = true;
1062
1063 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1064
1065
1066
1067 /* Tell the file loading code that we want to start playing
1068
1069 as soon as we have some data */
1070
1071 play_pending = true;
1072
1073 break;
1074
1075
1076
1077 case MPEG_STOP:
1078
1079 /* Stop the current stream */
1080
1081 playing = false;
1082
1083 stop_dma();
1084
1085 break;
1086
1087
1088
1089 case MPEG_PAUSE:
1090
1091 /* Stop the current stream */
1092
1093 playing = false;
1094
1095 stop_dma();
1096
1097 break;
1098
1099
1100
1101 case MPEG_RESUME:
1102
1103 /* Stop the current stream */
1104
1105 playing = true;
1106
1107 start_dma();
1108
1109 break;
1110
1111
1112
1113 case MPEG_NEED_DATA:
1114
1115 free_space_left = mp3buf_read - mp3buf_write;
1116
1117
1118
1119 /* We interpret 0 as "empty buffer" */
1120
1121 if(free_space_left <= 0)
1122
1123 free_space_left = MP3BUF_LEN + free_space_left;
1124
1125
1126
1127 if(free_space_left <= MP3_CHUNK_SIZE)
1128
1129 {
1130
1131 debugf("0\n");
1132
1133 ata_spindown(-1);
1134
1135 filling = false;
1136
1137 break;
1138
1139 }
1140
1141
1142
1143 amount_to_read = MIN(MP3_CHUNK_SIZE, free_space_left);
1144
1145 amount_to_read = MIN(MP3BUF_LEN - mp3buf_write, amount_to_read);
1146
1147
1148
1149 /* Read in a few seconds worth of MP3 data. We don't want to
1150
1151 read too large chunks because the bitswapping will take
1152
1153 too much time. We must keep the DMA happy and also give
1154
1155 the other threads a chance to run. */
1156
1157 debugf("R\n");
1158
1159 len = read(mpeg_file, mp3buf+mp3buf_write, amount_to_read);
1160
1161 if(len)
1162
1163 {
1164
1165 debugf("B\n");
1166
1167 bitswap(mp3buf + mp3buf_write, len);
1168
1169
1170
1171 mp3buf_write += len;
1172
1173 if(mp3buf_write >= MP3BUF_LEN)
1174
1175 {
1176
1177 mp3buf_write = 0;
1178
1179 debugf("W\n");
1180
1181 }
1182
1183
1184
1185 /* Tell ourselves that we want more data */
1186
1187 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1188
1189
1190
1191 /* And while we're at it, see if we have startet playing
1192
1193 yet. If not, do it. */
1194
1195 if(play_pending)
1196
1197 {
1198
1199 play_pending = false;
1200
1201 playing = true;
1202
1203
1204
1205 init_dma();
1206
1207 start_dma();
1208
1209 }
1210
1211 }
1212
1213 else
1214
1215 {
1216
1217 close(mpeg_file);
1218
1219
1220
1221 /* Make sure that the write pointer is at a word
1222
1223 boundary */
1224
1225 mp3buf_write &= 0xfffffffe;
1226
1227
1228
1229 next_track();
1230
1231 if(new_file() < 0)
1232
1233 {
1234
1235 /* No more data to play */
1236
1237 debugf("Finished playing\n");
1238
1239 playing = false;
1240
1241 ata_spindown(-1);
1242
1243 filling = false;
1244
1245 }
1246
1247 else
1248
1249 {
1250
1251 /* Tell ourselves that we want more data */
1252
1253 queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
1254
1255 }
1256
1257 }
1258
1259 break;
1260
1261 }
1262
1263 }
1264
1265}
1266
1267
1268
1269/* Newlib trap honeypot */
1270
1271void __trap34(void)
1272
1273{
1274
1275 debugf("newlib trap34\n");
1276
1277 while(1);
1278
1279}
1280
diff --git a/firmware/test/id3/Makefile b/firmware/test/id3/Makefile
deleted file mode 100644
index 8b9cd230b2..0000000000
--- a/firmware/test/id3/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
1TARGET = id3test
2
3OBJS = id3.o
4CFLAGS = -g -W -Wall -DDEBUG_STANDALONE -DSIMULATOR -c -o
5
6$(TARGET) : $(OBJS)
7 $(CC) -o $(TARGET) $(OBJS)
8
9id3.o:../../id3.c
10 $(CC) $(CFLAGS) $@ $<
11
12clean:
13 rm -f $(OBJS) $(TARGET) *~
diff --git a/firmware/test/kernel/Makefile b/firmware/test/kernel/Makefile
deleted file mode 100644
index 94171767c6..0000000000
--- a/firmware/test/kernel/Makefile
+++ /dev/null
@@ -1,52 +0,0 @@
1CC = sh-elf-gcc
2LD = sh-elf-ld
3AR = sh-elf-ar
4AS = sh-elf-as
5OC = sh-elf-objcopy
6
7INCLUDES=-I../../ -I../../drivers
8
9# Pick a target to build for
10#TARGET = -DARCHOS_PLAYER=1
11TARGET = -DARCHOS_PLAYER_OLD=1
12#TARGET = -DARCHOS_RECORDER=1
13
14CFLAGS = -g -Wall -m1 -save-temps -nostdlib -Wstrict-prototypes -fschedule-insns -fno-builtin $(INCLUDES) $(TARGET) -DDEBUG
15AFLAGS += -small -relax
16
17OBJS= ../../crt0.o ../../system.o main.o ../../panic.o ../../drivers/lcd.o \
18 thread.o ../../kernel.o ../../drivers/led.o \
19 ../../debug.o ../../common/sprintf.o
20
21%.o: %.S
22 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) $(ASMFLAGS) -c $<
23
24
25all : archos.mod
26
27archos.elf : $(OBJS) app.lds
28 $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map
29
30archos.bin : archos.elf
31 $(OC) -O binary archos.elf archos.bin
32
33archos.asm: archos.bin
34 sh2d -sh1 archos.bin > archos.asm
35
36archos.mod : archos.bin
37 scramble archos.bin archos.mod
38
39archos.mod.gz : archos.mod
40 gzip -f archos.mod
41
42dist:
43 tar czvf dist.tar.gz Makefile main.c start.s app.lds
44
45clean:
46 -rm -f $(OBJS) *.s *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
47
48install:
49 mount /mnt/archos; cp archos.mod /mnt/archos; umount /mnt/archos
50
51thread.o: ../../thread.c
52 $(CC) -O -fomit-frame-pointer -c $(CFLAGS) $<
diff --git a/firmware/test/kernel/app.lds b/firmware/test/kernel/app.lds
deleted file mode 100644
index b8a341a8ae..0000000000
--- a/firmware/test/kernel/app.lds
+++ /dev/null
@@ -1,36 +0,0 @@
1ENTRY(start)
2OUTPUT_FORMAT(elf32-sh)
3SECTIONS
4{
5 .text 0x09010000 :
6 {
7 KEEP(*(.vectors))
8 . = ALIGN(0x200);
9 *(.init.text)
10 }
11
12 .text :
13 {
14 *(.text)
15 }
16
17 .data :
18 {
19 *(.rodata)
20 *(.data)
21 }
22
23 .rodata :
24 {
25 *(.rodata)
26 }
27
28 .bss :
29 {
30 _edata = .;
31 *(.bss)
32 *(COMMON)
33 _end = .;
34 _stack = . + 0x80000;
35 }
36}
diff --git a/firmware/test/kernel/main.c b/firmware/test/kernel/main.c
deleted file mode 100644
index df0e72156a..0000000000
--- a/firmware/test/kernel/main.c
+++ /dev/null
@@ -1,104 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "thread.h"
22#include "kernel.h"
23#include "sh7034.h"
24#include "debug.h"
25
26void tick_start(unsigned int interval);
27
28unsigned int s1[256];
29unsigned int s2[256];
30
31void t1(void);
32void t2(void);
33
34struct event_queue main_q SHAREDBSS_ATTR;
35
36int tick_add_task(void (*f)(void));
37
38void testfunc(void)
39{
40 if(current_tick == 5000)
41 debugf("Yippie!\n");
42}
43
44int main(void)
45{
46 char buf[40];
47 char str[32];
48 int i=0;
49 struct queue_event *ev;
50
51 /* Clear it all! */
52 SSR1 &= ~(SCI_RDRF | SCI_ORER | SCI_PER | SCI_FER);
53
54 /* This enables the serial Rx interrupt, to be able to exit into the
55 debugger when you hit CTRL-C */
56 SCR1 |= 0x40;
57 SCR1 &= ~0x80;
58 IPRE |= 0xf000; /* Set to highest priority */
59
60 debugf("OK. Let's go\n");
61
62 kernel_init();
63
64 enable_irq();
65
66 tick_add_task(testfunc);
67
68 debugf("sleeping 10s...\n");
69 sleep(HZ*10);
70 debugf("woke up\n");
71
72 queue_init(&main_q);
73
74 create_thread(t1, s1, 1024, 0);
75 create_thread(t2, s2, 1024, 0);
76
77 while(1)
78 {
79 ev = queue_wait(&main_q);
80 debugf("Thread 0 got an event. ID: %d\n", ev->id);
81 }
82}
83
84void t1(void)
85{
86 debugf("Thread 1 started\n");
87 while(1)
88 {
89 sleep(HZ);
90 debugf("Thread 1 posting an event\n");
91 queue_post(&main_q, 1234, 0);
92 queue_post(&main_q, 5678, 0);
93 }
94}
95
96void t2(void)
97{
98 debugf("Thread 2 started\n");
99 while(1)
100 {
101 sleep(HZ*3);
102 debugf("Thread 2 awakened\n");
103 }
104}
diff --git a/firmware/test/snprintf/Makefile b/firmware/test/snprintf/Makefile
deleted file mode 100644
index 39f128ed8a..0000000000
--- a/firmware/test/snprintf/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
1
2TARGET = snprintf
3
4OBJS = snprintf.o test.o
5
6CFLAGS = -I../../include
7
8$(TARGET): $(OBJS)
9
10snprintf.o: ../../common/sprintf.c
11 $(CC) -c $< -o $@
12
13test.o: test.c
14
15clean:
16 rm -f $(OBJS) \ No newline at end of file
diff --git a/firmware/test/snprintf/test.c b/firmware/test/snprintf/test.c
deleted file mode 100644
index 049be4d257..0000000000
--- a/firmware/test/snprintf/test.c
+++ /dev/null
@@ -1,16 +0,0 @@
1
2#include <stdio.h>
3
4
5int main(int argc, char **argv)
6{
7 char buffer[256];
8 snprintf(buffer, 5, "123456789");
9 printf("%s\n", buffer);
10 snprintf(buffer, 6, "123456789");
11 printf("%s\n", buffer);
12 snprintf(buffer, 7, "123456789");
13 printf("%s\n", buffer);
14 snprintf(buffer, 7, "123%s", "mooooooooooo");
15 printf("%s\n", buffer);
16}
diff --git a/firmware/tuner.c b/firmware/tuner.c
index 565850c659..cdc1da5b79 100644
--- a/firmware/tuner.c
+++ b/firmware/tuner.c
@@ -80,11 +80,6 @@ void tuner_init(void)
80 tea5767_get, 80 tea5767_get,
81 tea5767_init()) 81 tea5767_init())
82 #endif 82 #endif
83 #if (CONFIG_TUNER & S1A0903X01)
84 TUNER_TYPE_CASE(S1A0903X01,
85 s1a0903x01_set,
86 s1a0903x01_get)
87 #endif
88 #if (CONFIG_TUNER & SI4700) 83 #if (CONFIG_TUNER & SI4700)
89 TUNER_TYPE_CASE(SI4700, 84 TUNER_TYPE_CASE(SI4700,
90 si4700_set, 85 si4700_set,
diff --git a/firmware/usb.c b/firmware/usb.c
index 375bb6d768..e20388c073 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -43,7 +43,7 @@
43#include "screendump.h" 43#include "screendump.h"
44 44
45/* Conditions under which we want the entire driver */ 45/* Conditions under which we want the entire driver */
46#if !defined(BOOTLOADER) || (CONFIG_CPU == SH7034) || \ 46#if !defined(BOOTLOADER) || \
47 (defined(HAVE_USBSTACK) && defined(HAVE_BOOTLOADER_USB_MODE)) || \ 47 (defined(HAVE_USBSTACK) && defined(HAVE_BOOTLOADER_USB_MODE)) || \
48 (defined(HAVE_USBSTACK) && defined(IPOD_NANO2G)) || \ 48 (defined(HAVE_USBSTACK) && defined(IPOD_NANO2G)) || \
49 (defined(HAVE_USBSTACK) && (defined(CREATIVE_ZVx))) || \ 49 (defined(HAVE_USBSTACK) && (defined(CREATIVE_ZVx))) || \
diff --git a/flash/README b/flash/README
deleted file mode 100644
index 47ae4ce780..0000000000
--- a/flash/README
+++ /dev/null
@@ -1,7 +0,0 @@
1(c) 2003 by Jörg Hohensohn
2
3Sourcecode for the flash "infrastructure"
4Please bear in mind that these are powerful tools, don't fool with them!
5
6For most up-to-date info about flashing see:
7http://rockbox.haxx.se/docs/flash.html
diff --git a/flash/bootbox/Makefile b/flash/bootbox/Makefile
deleted file mode 100644
index 754f95dd49..0000000000
--- a/flash/bootbox/Makefile
+++ /dev/null
@@ -1,75 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \
11 -I$(BUILDDIR)
12
13DEPFILE = $(OBJDIR)/dep-bootbox
14LDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds
15
16ifdef DEBUG
17 DEFINES := -DDEBUG
18 CFLAGS += -g
19endif
20
21SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
22DIRS = .
23
24ifdef APPEXTRA
25 DIRS += $(subst :, ,$(APPEXTRA))
26 INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA)))
27endif
28
29CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \
30 $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
31
32OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
33SOURCES = $(SRC)
34LINKFILE = $(OBJDIR)/linkage.lds
35MAXINFILE = $(OBJDIR)/romstart.temp
36MAXOUTFILE = $(OBJDIR)/romstart
37
38LIBROCKBOX = $(BUILDDIR)/librockbox.a
39
40all: $(BUILDDIR)/$(BINARY) $(FLASHFILE)
41
42dep: $(DEPFILE)
43
44$(LINKFILE): $(LDS)
45 $(call PRINTS,Build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
46
47$(MAXOUTFILE):
48 $(SILENT)echo '#include "config.h"' > $(MAXINFILE)
49 $(SILENT)echo "ROM_START" >> $(MAXINFILE)
50 $(SILENT)cat $(MAXINFILE) | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - > $(MAXOUTFILE)
51 $(SILENT)rm $(MAXINFILE)
52
53$(OBJDIR)/bootbox.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX)
54 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Wl,--gc-sections -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/bootbox.map
55
56$(OBJDIR)/bootbox.bin : $(OBJDIR)/bootbox.elf
57 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
58
59$(OBJDIR)/bootbox.asm: $(OBJDIR)/bootbox.bin
60 $(TOOLSDIR)/sh2d -sh1 $< > $@
61
62$(BUILDDIR)/$(BINARY) : $(OBJDIR)/bootbox.bin
63 $(call PRINTS,Build bootbox file)$(MKFIRMWARE) $< $@
64
65$(FLASHFILE): $(OBJDIR)/bootbox.bin
66 $(call PRINTS,UCLPACK bootbox)$(TOOLSDIR)/uclpack --best --2e $< $@ >/dev/null 2>&1;
67
68include $(TOOLSDIR)/make.inc
69
70clean:
71 $(call PRINTS,cleaning bootbox)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/bootbox.asm $(OBJDIR)/rockbox.ucl \
72 $(OBJDIR)/bootbox.bin $(OBJDIR)/bootbox.elf $(OBJDIR)/*.map \
73 $(LINKFILE) $(MAXOUTFILE) $(DEPFILE) $(FLASHFILE)
74
75-include $(DEPFILE)
diff --git a/flash/bootbox/SOURCES b/flash/bootbox/SOURCES
deleted file mode 100644
index e241137f99..0000000000
--- a/flash/bootbox/SOURCES
+++ /dev/null
@@ -1 +0,0 @@
1main.c
diff --git a/flash/bootbox/bootbox.make b/flash/bootbox/bootbox.make
deleted file mode 100644
index 38a664d57d..0000000000
--- a/flash/bootbox/bootbox.make
+++ /dev/null
@@ -1,15 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10SRC += $(call preprocess,$(APPSDIR)/SOURCES)
11
12CORE_GCSECTIONS = yes
13
14# don't build rombox.ucl
15ARCHOSROM=
diff --git a/flash/bootbox/main.c b/flash/bootbox/main.c
deleted file mode 100644
index ac90d60336..0000000000
--- a/flash/bootbox/main.c
+++ /dev/null
@@ -1,224 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Jörg Hohensohn aka [IDC]Dragon
11 *
12 * This is "Bootbox", a minimalistic loader, rescue firmware for just
13 * booting into a full features one. Aside from that it does charging
14 * and USB mode, to enable copying the desired firmware.
15 *
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
20 *
21 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 * KIND, either express or implied.
23 *
24 ****************************************************************************/
25#include "config.h"
26
27#include <stdlib.h>
28#include <stdio.h>
29#include "cpu.h"
30#include "system.h"
31#include "lcd.h"
32#include "../kernel-internal.h"
33#include "storage.h"
34#include "disk.h"
35#include "font.h"
36#include "adc.h"
37#include "button.h"
38#include "panic.h"
39#include "power.h"
40#include "file.h"
41#include "rolo.h"
42#include "usb.h"
43#include "powermgmt.h"
44
45static void usb_screen(void)
46{
47 lcd_clear_display();
48 lcd_puts(0, 0, "USB mode");
49 lcd_update();
50
51 usb_acknowledge(SYS_USB_CONNECTED_ACK);
52 while(usb_wait_for_disconnect_w_tmo(&button_queue, HZ)) {
53 }
54}
55
56static void show_logo(void)
57{
58 lcd_clear_display();
59 lcd_puts(0, 0, "Rockbox");
60 lcd_puts(0, 1, "Rescue boot");
61 lcd_update();
62}
63
64#if CONFIG_CHARGING
65static void charging_screen(void)
66{
67 unsigned int button;
68 const char* msg;
69
70 ide_power_enable(false); /* power down the disk, else would be spinning */
71
72 lcd_clear_display();
73
74 do
75 {
76#ifdef ARCHOS_RECORDER
77 if (charge_state == CHARGING)
78 msg = "charging";
79 else if (charge_state == TOPOFF)
80 msg = "topoff charge";
81 else if (charge_state == TRICKLE)
82 msg = "trickle charge";
83 else
84 msg = "not charging";
85#else
86 msg = "charging";
87#endif
88 lcd_puts(0, 0, msg);
89 {
90 char buf[32];
91 int battv = battery_voltage();
92 snprintf(buf, sizeof(buf), "%d.%02dV %d%%",
93 battv / 1000, (battv % 1000) / 10, battery_level());
94 lcd_puts(0, 1, buf);
95 }
96 lcd_update();
97
98 button = button_get_w_tmo(HZ/2);
99#ifdef BUTTON_ON
100 if (button == (BUTTON_ON | BUTTON_REL))
101#else
102 if (button == (BUTTON_RIGHT | BUTTON_REL))
103#endif
104 break; /* start */
105 else
106 {
107 if (usb_detect() == USB_INSERTED)
108 break;
109 else if (!charger_inserted())
110 power_off(); /* charger removed: power down */
111 }
112 } while (1);
113}
114#endif /* CONFIG_CHARGING */
115
116/* prompt user to plug USB and fix a problem */
117static void prompt_usb(const char* msg1, const char* msg2)
118{
119 int button;
120 lcd_clear_display();
121 lcd_puts(0, 0, msg1);
122 lcd_puts(0, 1, msg2);
123#ifdef HAVE_LCD_BITMAP
124 lcd_puts(0, 2, "Insert USB cable");
125 lcd_puts(0, 3, "and fix it.");
126#endif
127 lcd_update();
128 do
129 {
130 button = button_get(true);
131 if (button == SYS_POWEROFF)
132 {
133 power_off();
134 }
135 } while (button != SYS_USB_CONNECTED);
136 usb_screen();
137 system_reboot();
138}
139
140void main(void)
141{
142 int rc;
143
144 power_init();
145 system_init();
146 kernel_init();
147 lcd_init();
148 show_logo();
149 enable_irq();
150 adc_init();
151 usb_init();
152 button_init();
153 powermgmt_init();
154
155#if CONFIG_CHARGING && (CONFIG_CPU == SH7034)
156 if (charger_inserted()
157#ifdef ATA_POWER_PLAYERSTYLE
158 && !ide_powered() /* relies on probing result from bootloader */
159#endif
160 )
161 {
162 charging_screen(); /* display a "charging" screen */
163 show_logo(); /* again, to provide better visual feedback */
164 }
165#endif
166
167 rc = storage_init();
168 if(rc)
169 {
170#ifdef HAVE_LCD_BITMAP
171 char str[32];
172 lcd_clear_display();
173 snprintf(str, 31, "ATA error: %d", rc);
174 lcd_puts(0, 1, str);
175 lcd_update();
176 while(!(button_get(true) & BUTTON_REL));
177#endif
178 panicf("storage: %d", rc);
179 }
180
181 usb_start_monitoring();
182 while (usb_detect() == USB_INSERTED)
183 { /* enter USB mode early, before trying to mount */
184 if (button_get_w_tmo(HZ/10) == SYS_USB_CONNECTED)
185 {
186 usb_screen();
187 }
188 }
189
190 rc = disk_mount_all();
191 if (rc<=0)
192 {
193 prompt_usb("No partition", "found.");
194 }
195
196 { // rolo the firmware
197 static const char filename[] = "/" BOOTFILE;
198 rolo_load((char*)filename); /* won't return if started */
199
200 prompt_usb("No firmware", filename);
201 }
202
203
204}
205
206/* These functions are present in the firmware library, but we reimplement
207 them here because the originals do a lot more than we want */
208
209void audio_stop(void)
210{
211}
212
213int audio_status(void)
214{
215 return 0;
216}
217
218void audio_stop_recording(void)
219{
220}
221
222void mp3_shutdown(void)
223{
224}
diff --git a/flash/bootloader/Makefile b/flash/bootloader/Makefile
deleted file mode 100644
index edc32113c6..0000000000
--- a/flash/bootloader/Makefile
+++ /dev/null
@@ -1,81 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10CC = sh-elf-gcc
11LD = sh-elf-ld
12AR = sh-elf-ar
13AS = sh-elf-as
14OC = sh-elf-objcopy
15
16FIRMWARE := ../../firmware
17TOOLSDIR=../../tools
18
19TARGET = bootloader
20LDS := $(TARGET).lds
21
22
23ifndef PLATFORM
24not_configured:
25 @echo "No platform given."
26 @echo "Use make PLATFORM=PLAYER|RECORDER|FM|ONDIO {NO_ROM=1}"
27##else
28##configured:
29## @echo "Building bootloader for platform "$(PLATFORM)
30endif
31
32
33INCLUDES= -I$(FIRMWARE)/export -I. -I$(OBJDIR)
34DEFINES= -DPLATFORM_$(PLATFORM)
35
36OBJDIR := .
37
38CFLAGS = -Os -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES)
39AFLAGS += -small -relax
40
41
42ifdef DEBUG
43 DEFINES := -DDEBUG
44 CFLAGS += -g
45endif
46
47SRC := $(wildcard *.c)
48
49OBJS := $(SRC:%.c=$(OBJDIR)/%.o) $(OBJDIR)/sh_nrv2e_d8.o
50
51ifdef NO_ROM
52LINKFILE = $(OBJDIR)/no_rom.lds
53ORIGIN = 0
54DEFINES += -DNO_ROM
55else
56LINKFILE = $(OBJDIR)/$(TARGET).lds
57ORIGIN = FFFF500
58endif
59
60$(OBJDIR)/$(TARGET).bin : $(OBJDIR)/$(TARGET).elf
61 $(OC) -O binary $(OBJDIR)/$(TARGET).elf $(OBJDIR)/$(TARGET).bin
62 $(TOOLSDIR)/sh2d $(OBJDIR)/$(TARGET).bin -o $(ORIGIN) > $(OBJDIR)/$(TARGET).asm
63ifndef NO_ROM
64 $(TOOLSDIR)/scramble $(OBJDIR)/$(TARGET).bin $(OBJDIR)/$(TARGET).ajz
65endif
66
67$(OBJDIR)/$(TARGET).elf : $(OBJS)
68 $(CC) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$(TARGET).map
69
70# cross-reference, saves code duplication
71$(OBJDIR)/sh_nrv2e_d8.o : ../../firmware/decompressor/sh_nrv2e_d8.S
72 $(CC) $(CFLAGS) -c $< -o $@
73
74clean:
75 -rm -f \
76 $(OBJS) \
77 $(OBJDIR)/$(TARGET).asm \
78 $(OBJDIR)/$(TARGET).bin \
79 $(OBJDIR)/$(TARGET).ajz \
80 $(OBJDIR)/$(TARGET).elf \
81 $(OBJDIR)/$(TARGET).map
diff --git a/flash/bootloader/README b/flash/bootloader/README
deleted file mode 100644
index 47583da445..0000000000
--- a/flash/bootloader/README
+++ /dev/null
@@ -1,4 +0,0 @@
1(c) 2003 by Jörg Hohensohn
2
3This is the source code for the flash bootloader.
4It give the dual boot feature, decompresses one of two software images.
diff --git a/flash/bootloader/bootloader.c b/flash/bootloader/bootloader.c
deleted file mode 100644
index 40c0dc5c54..0000000000
--- a/flash/bootloader/bootloader.c
+++ /dev/null
@@ -1,467 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 by Jörg Hohensohn
11 *
12 * Second-level bootloader, with dual-boot feature by holding F1/Menu
13 * This is the image being descrambled and executed by the boot ROM.
14 * It's task is to copy Rockbox from Flash to DRAM.
15 * The image(s) in flash may optionally be compressed with UCL 2e
16 *
17 * This program is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU General Public License
19 * as published by the Free Software Foundation; either version 2
20 * of the License, or (at your option) any later version.
21 *
22 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
23 * KIND, either express or implied.
24 *
25 ****************************************************************************/
26
27#include "sh7034.h"
28#include "bootloader.h"
29
30// prototypes
31static void PlatformInit(void);
32static void DecompressStart(tImage* pImage);
33#ifdef USE_ADC
34static int ReadADC(int channel);
35#endif
36static int ButtonPressed(void);
37static tImage* GetStartImage(int nPreferred);
38// test functions
39static void SetLed(BOOL bOn);
40static void UartInit(void);
41static UINT8 UartRead(void);
42static void UartWrite(UINT8 byte);
43static void MiniMon(void);
44
45
46#ifdef NO_ROM
47/* start with the vector table */
48UINT32 vectors[] __attribute__ ((section (".vectors"))) =
49{
50 (UINT32)_main, /* entry point, the copy routine */
51 (UINT32)(end_stack - 1), /* initial stack pointer */
52 FLASH_BASE + 0x200, /* source of image in flash */
53 (UINT32)total_size, /* size of image */
54 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
55 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
56 0x03020080 /* mask and version (just as a suggestion) */
57};
58#else
59/* our binary has to start with a vector to the entry point */
60tpMain start_vector[] __attribute__ ((section (".startvector"))) = {main};
61#endif
62
63#ifdef NO_ROM /* some code which is only needed for the romless variant */
64void _main(void)
65{
66 UINT32* pSrc;
67 UINT32* pDest;
68 UINT32* pEnd;
69/*
70 asm volatile ("ldc %0,sr" : : "r"(0xF0)); // disable interrupts
71 asm volatile ("mov.l @%0,r15" : : "r"(4)); // load stack
72 asm volatile ("ldc %0,vbr" : : "r"(0)); // load vector base
73*/
74 /* copy everything to IRAM and continue there */
75 pSrc = begin_iramcopy;
76 pDest = begin_text;
77 pEnd = pDest + (begin_stack - begin_text);
78
79 do
80 {
81 *pDest++ = *pSrc++;
82 }
83 while (pDest < pEnd);
84
85 main(); /* jump to the real main() */
86}
87
88
89static void BootInit(void)
90{
91 /* inits from the boot ROM, whether they make sense or not */
92 PBDR &= 0xFFBF; /* LED off (0x131E) */
93 PBCR2 = 0; /* all GPIO */
94 PBIOR |= 0x0040; /* LED output */
95 PBIOR &= 0xFFF1; /* LCD lines input */
96
97 /* init DRAM like the boot ROM does */
98 PACR2 &= 0xFFFB;
99 PACR2 |= 0x0008;
100 CASCR = 0xAF;
101 BCR |= 0x8000;
102 WCR1 &= 0xFDFD;
103 DCR = 0x0E00;
104 RCR = 0x5AB0;
105 RTCOR = 0x9605;
106 RTCSR = 0xA518;
107}
108#endif /* #ifdef NO_ROM */
109
110
111int main(void)
112{
113 int nButton;
114
115 PlatformInit(); /* model-specific inits */
116
117 nButton = ButtonPressed();
118
119 if (nButton == 3)
120 { /* F3 means start monitor */
121 MiniMon();
122 }
123 else
124 {
125 tImage* pImage;
126 pImage = GetStartImage(nButton); /* which image */
127 DecompressStart(pImage); /* move into place and start it */
128 }
129
130 return 0; /* I guess we won't return ;-) */
131}
132
133
134/* init code that is specific to certain platform */
135static void PlatformInit(void)
136{
137#ifdef NO_ROM
138 BootInit(); /* if not started by boot ROM, we need to init what it did */
139#endif
140
141#if defined PLATFORM_PLAYER
142 BRR1 = 0x19; /* 14400 Baud for monitor */
143 PBDRL |= 0x10; /* set PB4 to 1 to power the hd early (and prepare for
144 * probing in case the charger is connected) */
145 PBIORL |= 0x10; /* make PB4 an output */
146 PACR2 &= 0xFFFC; /* GPIO for PA0 (charger detection, input by default) */
147 if (!(PADRL & 0x01)) /* charger plugged? */
148 { /* we need to probe whether the box is able to control hd power */
149 int i;
150
151 PBIORL &= ~0x10; /* set PB4 to input */
152 /* wait whether it goes low, max. ~1 ms */
153 for (i = 0; (PBDRL & 0x10) && i < 1000; i++);
154
155 if (~(PBDRL & 0x10)) /* pulled low -> power controllable */
156 PBDRL &= 0x10; /* set PB4 low */
157 else /* still floating high -> not controllable */
158 PBDRL |= 0x10; /* set PB4 high */
159 PBIORL |= 0x10; /* ..and output again */
160 }
161#elif defined PLATFORM_RECORDER
162 BRR1 = 0x02; /* 115200 Baud for monitor */
163 if (ReadADC(7) > 0x100) /* charger plugged? */
164 { /* switch off the HD, else a flat battery may not start */
165 PACR2 &= 0xFBFF; /* GPIO for PA5 */
166 PAIOR |= 0x0020; /* make PA5 an output (low by default) */
167 }
168#elif defined PLATFORM_FM
169 BRR1 = 0x02; /* 115200 Baud for monitor */
170 PBDR |= 0x0020; /* set PB5 to keep power (fixes the ON-holding problem) */
171 PBIOR |= 0x0020; /* make PB5 an output */
172 if (ReadADC(0) < 0x1FF) /* charger plugged? */
173 { /* switch off the HD, else a flat battery may not start */
174 PACR2 &= 0xFBFF; /* GPIO for PA5 */
175 PAIOR |= 0x0020; /* make PA5 an output (low by default) */
176 }
177#elif defined PLATFORM_ONDIO
178 BRR1 = 0x19; /* 14400 Baud for monitor */
179 PBDR |= 0x0020; /* set PB5 to keep power (fixes the ON-holding problem) */
180 PBIOR |= 0x0020; /* make PB5 an output */
181#endif
182
183 /* platform-independent inits */
184 DCR |= 0x1000; /* enable burst mode on DRAM */
185 BCR |= 0x2000; /* activate Warp mode (simultaneous internal and external
186 * mem access) */
187}
188
189
190/* move the image into place and start it */
191static void DecompressStart(tImage* pImage)
192{
193 UINT32* pSrc;
194 UINT32* pDest;
195
196 pSrc = pImage->image;
197 pDest = pImage->pDestination;
198
199 if (pSrc != pDest) /* if not linked to that flash address */
200 {
201 if (pImage->flags & IF_UCL_2E)
202 { /* UCL compressed, algorithm 2e */
203 UINT32 dst_len; /* dummy */
204 ucl_nrv2e_decompress_8((UINT8*)pSrc, (UINT8*)pDest, &dst_len);
205 }
206 else
207 { /* uncompressed, copy it */
208 UINT32 size = pImage->size;
209 UINT32* pEnd;
210 size = (size + 3) / 4; /* round up to 32bit-words */
211 pEnd = pDest + size;
212
213 do
214 {
215 *pDest++ = *pSrc++;
216 }
217 while (pDest < pEnd);
218 }
219 }
220
221 pImage->pExecute();
222}
223
224#ifdef USE_ADC
225static int ReadADC(int channel)
226{
227 /* after channel 3, the ports wrap and get re-used */
228 volatile UINT16* pResult = (UINT16*)(ADDRAH_ADDR + 2 * (channel & 0x03));
229 int timeout = 266; /* conversion takes 266 clock cycles */
230
231 ADCSR = 0x20 | channel; /* start single conversion */
232 while (((ADCSR & 0x80) == 0) && (--timeout)); /* 6 instructions per round*/
233
234 return (timeout == 0) ? -1 : *pResult>>6;
235}
236#endif
237
238
239/* This function is platform-dependent,
240 * until I figure out how to distinguish at runtime. */
241static int ButtonPressed(void) /* return 1,2,3 for F1,F2,F3, 0 if none pressed */
242{
243#ifdef USE_ADC
244 int value = ReadADC(CHANNEL);
245
246 if (value >= F1_LOWER && value <= F1_UPPER) /* in range */
247 return 1;
248 else if (value >= F2_LOWER && value <= F2_UPPER) /* in range */
249 return 2;
250 else if (value >= F3_LOWER && value <= F3_UPPER) /* in range */
251 return 3;
252#else
253 int value = PCDR;
254
255 if (!(value & F1_MASK))
256 return 1;
257 else if (!(value & F2_MASK))
258 return 2;
259 else if (!(value & F3_MASK))
260 return 3;
261#endif
262
263 return 0;
264}
265
266
267/* Determine the image to be started */
268static tImage* GetStartImage(int nPreferred)
269{
270 tImage* pImage1;
271 tImage* pImage2 = NULL; /* default to not present */
272 UINT32 pos;
273 UINT32* pFlash = (UINT32*)FLASH_BASE;
274
275 /* determine the first image position */
276 pos = pFlash[2] + pFlash[3]; /* position + size of the bootloader
277 * = after it */
278 pos = (pos + 3) & ~3; /* be sure it's 32 bit aligned */
279
280 pImage1 = (tImage*)pos;
281
282 if (pImage1->size != 0)
283 { /* check for second image */
284 pos = (UINT32)(&pImage1->image) + pImage1->size;
285 pImage2 = (tImage*)pos;
286
287 /* does it make sense? (not in FF or 00 erazed space) */
288 if (pImage2->pDestination == (void*)0xFFFFFFFF
289 || pImage2->size == 0xFFFFFFFF
290 || pImage2->pExecute == (void*)0xFFFFFFFF
291 || pImage2->flags == 0xFFFFFFFF
292 || pImage2->pDestination == NULL)
293 /* size, execute and flags can legally be 0 */
294 {
295 pImage2 = NULL; /* invalidate */
296 }
297 }
298
299 if (pImage2 == NULL || nPreferred == 1)
300 { /* no second image or overridden: return the first */
301 return pImage1;
302 }
303
304 return pImage2; /* return second image */
305}
306
307/* diagnostic functions */
308
309static void SetLed(BOOL bOn)
310{
311 if (bOn)
312 PBDR |= 0x0040;
313 else
314 PBDR &= ~0x0040;
315}
316
317
318static void UartInit(void)
319{
320 PBIOR &= 0xFBFF; /* input: RXD1 remote pin */
321 PBCR1 |= 0x00A0; /* set PB11+PB10 to UART */
322 PBCR1 &= 0xFFAF; /* clear bits 6, 4 -> UART */
323 SMR1 = 0x00; /* async format 8N1, baud generator input is CPU clock */
324 SCR1 = 0x30; /* transmit+receive enable */
325 PBCR1 &= 0x00FF; /* set bit 12...15 as GPIO */
326 SSR1 &= 0xBF; /* clear bit 6 (RDRF, receive data register full) */
327}
328
329
330static UINT8 UartRead(void)
331{
332 UINT8 byte;
333 while (!(SSR1 & SCI_RDRF)); /* wait for char to be available */
334 byte = RDR1;
335 SSR1 &= ~SCI_RDRF;
336 return byte;
337}
338
339
340static void UartWrite(UINT8 byte)
341{
342 while (!(SSR1 & SCI_TDRE)); /* wait for transmit buffer empty */
343 TDR1 = byte;
344 SSR1 &= ~SCI_TDRE;
345}
346
347
348/* include the mini monitor as a rescue feature, started with F3 */
349static void MiniMon(void)
350{
351 UINT8 cmd;
352 UINT32 addr;
353 UINT32 size;
354 UINT32 content;
355 volatile UINT8* paddr = NULL;
356 volatile UINT8* pflash = NULL; /* flash base address */
357
358 UartInit();
359
360 while (1)
361 {
362 cmd = UartRead();
363 switch (cmd)
364 {
365 case BAUDRATE:
366 content = UartRead();
367 UartWrite(cmd); /* acknowledge by returning the command value */
368 while (!(SSR1 & SCI_TEND)); /* wait for empty shift register,
369 * before changing baudrate */
370 BRR1 = content;
371 break;
372
373 case ADDRESS:
374 addr = (UartRead() << 24) | (UartRead() << 16)
375 | (UartRead() << 8) | UartRead();
376 paddr = (UINT8*)addr;
377 pflash = (UINT8*)(addr & 0xFFF80000); /* round down to 512k align*/
378 UartWrite(cmd); /* acknowledge by returning the command value */
379 break;
380
381 case BYTE_READ:
382 content = *paddr++;
383 UartWrite(content); /* the content is the ack */
384 break;
385
386 case BYTE_WRITE:
387 content = UartRead();
388 *paddr++ = content;
389 UartWrite(cmd); /* acknowledge by returning the command value */
390 break;
391
392 case BYTE_READ16:
393 size = 16;
394 while (size--)
395 {
396 content = *paddr++;
397 UartWrite(content); /* the content is the ack */
398 }
399 break;
400
401 case BYTE_WRITE16:
402 size = 16;
403 while (size--)
404 {
405 content = UartRead();
406 *paddr++ = content;
407 }
408 UartWrite(cmd); /* acknowledge by returning the command value */
409 break;
410
411 case BYTE_FLASH:
412 content = UartRead();
413 pflash[0x5555] = 0xAA; /* set flash to command mode */
414 pflash[0x2AAA] = 0x55;
415 pflash[0x5555] = 0xA0; /* byte program command */
416 *paddr++ = content;
417 UartWrite(cmd); /* acknowledge by returning the command value */
418 break;
419
420 case BYTE_FLASH16:
421 size = 16;
422 while (size--)
423 {
424 content = UartRead();
425 pflash[0x5555] = 0xAA; /* set flash to command mode */
426 pflash[0x2AAA] = 0x55;
427 pflash[0x5555] = 0xA0; /* byte program command */
428 *paddr++ = content;
429 }
430 UartWrite(cmd); /* acknowledge by returning the command value */
431 break;
432
433 case HALFWORD_READ:
434 content = *(UINT16*)paddr;
435 paddr += 2;
436 UartWrite(content >> 8); /* highbyte */
437 UartWrite(content & 0xFF); /* lowbyte */
438 break;
439
440 case HALFWORD_WRITE:
441 content = UartRead() << 8 | UartRead();
442 *(UINT16*)paddr = content;
443 paddr += 2;
444 UartWrite(cmd); /* acknowledge by returning the command value */
445 break;
446
447 case EXECUTE:
448 {
449 tpFunc pFunc = (tpFunc)paddr;
450 pFunc();
451 UartWrite(cmd); /* acknowledge by returning the command value*/
452 }
453 break;
454
455 case VERSION:
456 UartWrite(1); /* return our version number */
457 break;
458
459 default:
460 {
461 SetLed(TRUE);
462 UartWrite(~cmd); /* error acknowledge */
463 }
464
465 } /* case */
466 } /* while (1) */
467}
diff --git a/flash/bootloader/bootloader.h b/flash/bootloader/bootloader.h
deleted file mode 100644
index 5811fd0aa4..0000000000
--- a/flash/bootloader/bootloader.h
+++ /dev/null
@@ -1,109 +0,0 @@
1#ifndef NULL
2#define NULL ((void*)0)
3#endif
4
5#define TRUE 1
6#define FALSE 0
7
8// scalar types
9typedef unsigned char UINT8;
10typedef unsigned short UINT16;
11typedef unsigned long UINT32;
12typedef int BOOL;
13
14typedef void(*tpFunc)(void); // type for execute
15typedef int(*tpMain)(void); // type for start vector to main()
16
17
18// structure of an image in the flash
19typedef struct
20{
21 UINT32* pDestination; // address to copy it to
22 UINT32 size; // how many bytes of payload (to the next header)
23 tpFunc pExecute; // entry point
24 UINT32 flags; // uncompressed or compressed
25 // end of header, now comes the payload
26 UINT32 image[]; // the binary image starts here
27 // after the payload, the next header may follow, all 0xFF if none
28} tImage;
29
30// flags valid for image header
31#define IF_NONE 0x00000000
32#define IF_UCL_2E 0x00000001 // image is compressed with UCL, algorithm 2e
33
34
35// resolve platform dependency of F1 button check
36#if defined PLATFORM_PLAYER
37#define F1_MASK 0x0001 // Player has no F1 button, so we use "-"
38#define F2_MASK 0x0008 // Player has no F2 button, so we use "Play"
39#define F3_MASK 0x0004 // Player has no F3 button, so we use "+"
40
41#elif defined PLATFORM_RECORDER
42#define USE_ADC
43#define CHANNEL 4
44#define F1_LOWER 250
45#define F1_UPPER 499
46#define F2_LOWER 500
47#define F2_UPPER 699
48#define F3_LOWER 900
49#define F3_UPPER 1023
50
51#elif defined PLATFORM_FM
52#define USE_ADC
53#define CHANNEL 4
54#define F1_LOWER 150
55#define F1_UPPER 384
56#define F2_LOWER 385
57#define F2_UPPER 544
58#define F3_LOWER 700
59#define F3_UPPER 1023
60
61#elif defined PLATFORM_ONDIO
62#define USE_ADC
63#define CHANNEL 4
64#define F1_LOWER 0x2EF // Ondio has no F1 button,
65#define F1_UPPER 0x3FF // so we use "Left".
66#define F2_LOWER 0x19D // Ondio has no F2 button,
67#define F2_UPPER 0x245 // so we use "Up".
68#define F3_LOWER 0x246 // Ondio has no F3 button,
69#define F3_UPPER 0x2EE // so we use "Right".
70
71#else
72#error ("No platform given!")
73#endif
74
75
76#define FLASH_BASE 0x02000000 // start of the flash memory
77#define FW_VERSION *(unsigned short*)(FLASH_BASE + 0xFE) // firmware version
78
79// prototypes
80int ucl_nrv2e_decompress_8(const UINT8 *src, UINT8 *dst, UINT32* dst_len);
81void _main(void) __attribute__ ((section (".startup")));
82int main(void);
83
84// minimon commands
85#define BAUDRATE 0x00 // followed by BRR value; response: command byte
86#define ADDRESS 0x01 // followed by 4 bytes address; response: command byte
87#define BYTE_READ 0x02 // response: 1 byte content
88#define BYTE_WRITE 0x03 // followed by 1 byte content; response: command byte
89#define BYTE_READ16 0x04 // response: 16 bytes content
90#define BYTE_WRITE16 0x05 // followed by 16 bytes; response: command byte
91#define BYTE_FLASH 0x06 // followed by 1 byte content; response: command byte
92#define BYTE_FLASH16 0x07 // followed by 16 bytes; response: command byte
93#define HALFWORD_READ 0x08 // response: 2 byte content
94#define HALFWORD_WRITE 0x09 // followed by 2 byte content; response: command byte
95#define EXECUTE 0x0A // response: command byte if call returns
96#define VERSION 0x0B // response: version
97
98
99// linker symbols
100extern UINT32 begin_text[];
101extern UINT32 end_text[];
102extern UINT32 begin_data[];
103extern UINT32 end_data[];
104extern UINT32 begin_bss[];
105extern UINT32 end_bss[];
106extern UINT32 begin_stack[];
107extern UINT32 end_stack[];
108extern UINT32 begin_iramcopy[];
109extern UINT32 total_size[];
diff --git a/flash/bootloader/bootloader.lds b/flash/bootloader/bootloader.lds
deleted file mode 100644
index ecc1268988..0000000000
--- a/flash/bootloader/bootloader.lds
+++ /dev/null
@@ -1,34 +0,0 @@
1OUTPUT_FORMAT(elf32-sh)
2
3MEMORY
4{
5 /* the boot ROM uses IRAM at 400-430, stay away and start at 500 */
6 IRAM : ORIGIN = 0x0FFFF500, LENGTH = 0xA00
7 /* and leave some room for stack at the end */
8}
9
10SECTIONS
11{
12 .startvector :
13 {
14 *(.startvector)
15 . = ALIGN(0x4);
16 } > IRAM
17
18 .text :
19 {
20 *(.text)
21 *(.icode)
22 . = ALIGN(0x4);
23 } > IRAM
24
25 .data :
26 {
27 *(.data)
28 } > IRAM
29
30 .bss :
31 {
32 *(.bss)
33 } > IRAM
34}
diff --git a/flash/bootloader/no_rom.lds b/flash/bootloader/no_rom.lds
deleted file mode 100644
index 9f6af52aef..0000000000
--- a/flash/bootloader/no_rom.lds
+++ /dev/null
@@ -1,62 +0,0 @@
1/* This is for the variant without boot ROM,
2 where the flash ROM is mirrored to address zero */
3
4OUTPUT_FORMAT(elf32-sh)
5
6MEMORY
7{
8 IRAM : ORIGIN = 0x0FFFF000, LENGTH = 0x1000
9 FLASH : ORIGIN = 0x00000000, LENGTH = 0x40000
10}
11
12SECTIONS
13{
14 .vectors :
15 {
16 KEEP(*(.vectors))
17 . = ALIGN(0x200);
18 } > FLASH
19
20 .startup :
21 {
22 *(.startup)
23 . = ALIGN(0x4);
24 _begin_iramcopy = .;
25 } > FLASH
26
27 .text : AT ( _begin_iramcopy )
28 {
29 _begin_text = .;
30 *(.text)
31 *(.icode)
32 . = ALIGN(0x4);
33 _end_text = .;
34 } > IRAM
35
36 .data : AT ( _end_text )
37 {
38 _begin_data = .;
39 *(.data)
40 . = ALIGN(0x4);
41 _end_data = .;
42 } > IRAM
43
44 .bss : AT ( _end_data )
45 {
46 _begin_bss = .;
47 *(.bss)
48 . = ALIGN(0x4);
49 _end_bss = .;
50 } > IRAM
51
52 .stack :
53 {
54 _begin_stack = .;
55 *(.stack)
56 . = ALIGN(0x1000);
57 _end_stack = .;
58 } > IRAM
59
60 /* size of the program (without vectors) */
61 _total_size = SIZEOF(.startup) + SIZEOF(.text) + SIZEOF(.data);
62}
diff --git a/flash/extract/README b/flash/extract/README
deleted file mode 100644
index 6f1934906e..0000000000
--- a/flash/extract/README
+++ /dev/null
@@ -1,5 +0,0 @@
1(c) 2003 by Jörg Hohensohn
2
3This tool extracts the firmware image out of an original Archos ROM dump,
4like created with the Rockbox debug->dump feature.
5The extracted image can then be used to compose a dual-boot firmware.
diff --git a/flash/extract/extract.c b/flash/extract/extract.c
deleted file mode 100644
index 2389f9290e..0000000000
--- a/flash/extract/extract.c
+++ /dev/null
@@ -1,147 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 by Jörg Hohensohn
11 *
12 * Tool to extract the scrambled image out of an Archos flash ROM dump
13 *
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
18 *
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
21 *
22 ****************************************************************************/
23
24#include <stdio.h>
25#include <stdlib.h>
26#include <inttypes.h>
27
28#define UINT8 unsigned char
29#define UINT16 unsigned short
30#define UINT32 unsigned long
31
32#define IMAGE_HEADER 0x6000 // a 32 byte header in front of the software image
33#define IMAGE_START 0x6020 // software image position in Flash
34
35
36// place a 32 bit value into memory, big endian
37void Write32(UINT8* pByte, UINT32 value)
38{
39 pByte[0] = (UINT8)(value >> 24);
40 pByte[1] = (UINT8)(value >> 16);
41 pByte[2] = (UINT8)(value >> 8);
42 pByte[3] = (UINT8)(value);
43}
44
45
46// read a 32 bit value from memory, big endian
47UINT32 Read32(UINT8* pByte)
48{
49 UINT32 value = 0;
50
51 value |= (UINT32)pByte[0] << 24;
52 value |= (UINT32)pByte[1] << 16;
53 value |= (UINT32)pByte[2] << 8;
54 value |= (UINT32)pByte[3];
55
56 return value;
57}
58
59
60// entry point
61int main(int argc, char* argv[])
62{
63 FILE* pInFile;
64 FILE* pOutFile;
65 UINT8 aHeader[6];
66 UINT8 aImage[256*1024];
67 UINT32 i;
68 UINT32 uiSize, uiStart;
69 UINT16 usChecksum = 0;
70
71 if (argc < 2)
72 {
73 printf("Extract the software image out of an original Archos Flash ROM dump.\n");
74 printf("Result is a scrambled file, use the descramble tool to get the binary,\n");
75 printf(" always without the -fm option, even if processing an FM software.\n\n");
76 printf("Usage: extract <flash dump file> <output file>\n");
77 printf("Example: extract internal_rom_2000000-203FFFF.bin archos.ajz\n");
78 exit(0);
79 }
80
81 pInFile = fopen(argv[1], "rb");
82 if (pInFile == NULL)
83 {
84 printf("Error opening input file %s\n", argv[1]);
85 exit(1);
86 }
87
88 if (fread(aImage, 1, sizeof(aImage), pInFile) != sizeof(aImage))
89 {
90 printf("Error reading input file %s, must be 256kB in size.\n", argv[1]);
91 fclose(pInFile);
92 exit(2);
93 }
94 fclose(pInFile);
95
96 // find out about the type
97 uiStart = Read32(aImage + 8);
98 uiSize = Read32(aImage + 12); // booted ROM image
99 if (uiStart == 0x02000100 && uiSize > 20000)
100 { // Player has no loader, starts directly with the image
101 uiStart = 0x0100;
102 }
103 else
104 { // Recorder / FM / V2 Recorder
105 uiStart = IMAGE_START;
106 uiSize = Read32(aImage + IMAGE_HEADER + 4); // size record of header
107 }
108
109 // sanity check
110 if (uiSize > sizeof(aImage) - uiStart || uiSize < 40000)
111 {
112 printf("Error: Impossible image size %d bytes.\n", uiSize);
113 exit(3);
114 }
115
116 // generate checksum
117 for (i=0; i<uiSize; i++)
118 {
119 UINT8 byte;
120 byte = aImage[uiStart + i];
121 byte = ~((byte >> 1) | ((byte << 7) & 0x80)); /* poor man's ROR */
122 usChecksum += byte;
123 }
124
125 // make header
126 Write32(aHeader + 2, usChecksum); // checksum in 5th and 6th byte
127 Write32(aHeader, uiSize); // size in first 4 bytes
128
129 pOutFile = fopen(argv[2], "wb");
130 if (pOutFile == NULL)
131 {
132 printf("Error opening output file %s\n", argv[2]);
133 exit(4);
134 }
135
136 if (fwrite(aHeader, 1, sizeof(aHeader), pOutFile) != sizeof(aHeader)
137 || fwrite(aImage + uiStart, 1, uiSize, pOutFile) != uiSize)
138 {
139 printf("Write error\n");
140 fclose(pOutFile);
141 exit(5);
142 }
143
144 fclose(pOutFile);
145
146 return 0;
147}
diff --git a/flash/extract/extract.dsp b/flash/extract/extract.dsp
deleted file mode 100644
index e10281a829..0000000000
--- a/flash/extract/extract.dsp
+++ /dev/null
@@ -1,100 +0,0 @@
1# Microsoft Developer Studio Project File - Name="extract" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** DO NOT EDIT **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=extract - Win32 Debug
8!MESSAGE This is not a valid makefile. To build this project using NMAKE,
9!MESSAGE use the Export Makefile command and run
10!MESSAGE
11!MESSAGE NMAKE /f "extract.mak".
12!MESSAGE
13!MESSAGE You can specify a configuration when running NMAKE
14!MESSAGE by defining the macro CFG on the command line. For example:
15!MESSAGE
16!MESSAGE NMAKE /f "extract.mak" CFG="extract - Win32 Debug"
17!MESSAGE
18!MESSAGE Possible choices for configuration are:
19!MESSAGE
20!MESSAGE "extract - Win32 Release" (based on "Win32 (x86) Console Application")
21!MESSAGE "extract - Win32 Debug" (based on "Win32 (x86) Console Application")
22!MESSAGE
23
24# Begin Project
25# PROP AllowPerConfigDependencies 0
26# PROP Scc_ProjName ""
27# PROP Scc_LocalPath ""
28CPP=cl.exe
29RSC=rc.exe
30
31!IF "$(CFG)" == "extract - Win32 Release"
32
33# PROP BASE Use_MFC 0
34# PROP BASE Use_Debug_Libraries 0
35# PROP BASE Output_Dir "Release"
36# PROP BASE Intermediate_Dir "Release"
37# PROP BASE Target_Dir ""
38# PROP Use_MFC 0
39# PROP Use_Debug_Libraries 0
40# PROP Output_Dir "Release"
41# PROP Intermediate_Dir "Release"
42# PROP Target_Dir ""
43# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
44# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
45# ADD BASE RSC /l 0x407 /d "NDEBUG"
46# ADD RSC /l 0x407 /d "NDEBUG"
47BSC32=bscmake.exe
48# ADD BASE BSC32 /nologo
49# ADD BSC32 /nologo
50LINK32=link.exe
51# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
53
54!ELSEIF "$(CFG)" == "extract - Win32 Debug"
55
56# PROP BASE Use_MFC 0
57# PROP BASE Use_Debug_Libraries 1
58# PROP BASE Output_Dir "Debug"
59# PROP BASE Intermediate_Dir "Debug"
60# PROP BASE Target_Dir ""
61# PROP Use_MFC 0
62# PROP Use_Debug_Libraries 1
63# PROP Output_Dir "Debug"
64# PROP Intermediate_Dir "Debug"
65# PROP Target_Dir ""
66# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
67# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
68# ADD BASE RSC /l 0x407 /d "_DEBUG"
69# ADD RSC /l 0x407 /d "_DEBUG"
70BSC32=bscmake.exe
71# ADD BASE BSC32 /nologo
72# ADD BSC32 /nologo
73LINK32=link.exe
74# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
75# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76
77!ENDIF
78
79# Begin Target
80
81# Name "extract - Win32 Release"
82# Name "extract - Win32 Debug"
83# Begin Group "Source Files"
84
85# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
86# Begin Source File
87
88SOURCE=.\extract.c
89# End Source File
90# End Group
91# Begin Group "Header Files"
92
93# PROP Default_Filter "h;hpp;hxx;hm;inl"
94# End Group
95# Begin Group "Resource Files"
96
97# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
98# End Group
99# End Target
100# End Project
diff --git a/flash/make_firmware/README b/flash/make_firmware/README
deleted file mode 100644
index 534b1fc1cd..0000000000
--- a/flash/make_firmware/README
+++ /dev/null
@@ -1,20 +0,0 @@
1(c) 2003 by Jörg Hohensohn
2
3This tool composes a firmware file, out of:
41. Template for the first Flash page
52. Flash bootloader
63. First (alternate) image - usually bootbox
74. Second (main) image - rockbox or rombox. Can be left blank
8
9Use with extreme caution, the components have to match!
10The aspects are:
11- Model (Player, Recorder, FM, V2, Ondio FM, Ondio SP)
12- boot type (standard boot ROM or ROMless)
13
14If you need to adjust the size of the flash bootloader or the first
15image in order to match a desired rombox link address, do not try to
16pad the files manually! It will most probably lead to a non-working
17firmware file. You can pad the bootloader by including a dummy
18initialized array instead (at least one element needs to be non-zero).
19
20Such a firmware file can then be programmed with "firmware_flash.rock".
diff --git a/flash/make_firmware/make_firmware.c b/flash/make_firmware/make_firmware.c
deleted file mode 100644
index bd838bf3bf..0000000000
--- a/flash/make_firmware/make_firmware.c
+++ /dev/null
@@ -1,359 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2003 by Jörg Hohensohn
11 *
12 * Autoring tool for the firmware image to be programmed into Flash ROM
13 * It composes the flash content with header, bootloader and image(s)
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
19 *
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
22 *
23 ****************************************************************************/
24
25
26#include <stdio.h>
27#include <stdlib.h>
28#include <inttypes.h>
29#include <string.h>
30
31#define UINT8 unsigned char
32#define UINT16 unsigned short
33#define UINT32 unsigned long
34#define BOOL int
35#define TRUE 1
36#define FALSE 0
37
38// size of one flash sector, the granularity with which it can be erased
39#define SECTORSIZE 4096
40
41#define BOOTLOAD_DEST 0x0FFFF500 // for the "normal" one
42#define FLASH_START 0x02000000
43#define BOOTLOAD_SCR 0x02000100
44#define ROCKBOX_DEST 0x09000000
45#define ROCKBOX_EXEC 0x09000200
46
47
48// place a 32 bit value into memory, big endian
49void Write32(UINT8* pByte, UINT32 value)
50{
51 pByte[0] = (UINT8)(value >> 24);
52 pByte[1] = (UINT8)(value >> 16);
53 pByte[2] = (UINT8)(value >> 8);
54 pByte[3] = (UINT8)(value);
55}
56
57
58// read a 32 bit value from memory, big endian
59UINT32 Read32(UINT8* pByte)
60{
61 UINT32 value = 0;
62
63 value |= (UINT32)pByte[0] << 24;
64 value |= (UINT32)pByte[1] << 16;
65 value |= (UINT32)pByte[2] << 8;
66 value |= (UINT32)pByte[3];
67
68 return value;
69}
70
71
72static UINT32 CalcCRC32 (const UINT8* buf, UINT32 len)
73{
74 static const UINT32 crc_table[256] =
75 { // CRC32 lookup table for polynomial 0x04C11DB7
76 0x00000000, 0x04C11DB7, 0x09823B6E, 0x0D4326D9, 0x130476DC, 0x17C56B6B,
77 0x1A864DB2, 0x1E475005, 0x2608EDB8, 0x22C9F00F, 0x2F8AD6D6, 0x2B4BCB61,
78 0x350C9B64, 0x31CD86D3, 0x3C8EA00A, 0x384FBDBD, 0x4C11DB70, 0x48D0C6C7,
79 0x4593E01E, 0x4152FDA9, 0x5F15ADAC, 0x5BD4B01B, 0x569796C2, 0x52568B75,
80 0x6A1936C8, 0x6ED82B7F, 0x639B0DA6, 0x675A1011, 0x791D4014, 0x7DDC5DA3,
81 0x709F7B7A, 0x745E66CD, 0x9823B6E0, 0x9CE2AB57, 0x91A18D8E, 0x95609039,
82 0x8B27C03C, 0x8FE6DD8B, 0x82A5FB52, 0x8664E6E5, 0xBE2B5B58, 0xBAEA46EF,
83 0xB7A96036, 0xB3687D81, 0xAD2F2D84, 0xA9EE3033, 0xA4AD16EA, 0xA06C0B5D,
84 0xD4326D90, 0xD0F37027, 0xDDB056FE, 0xD9714B49, 0xC7361B4C, 0xC3F706FB,
85 0xCEB42022, 0xCA753D95, 0xF23A8028, 0xF6FB9D9F, 0xFBB8BB46, 0xFF79A6F1,
86 0xE13EF6F4, 0xE5FFEB43, 0xE8BCCD9A, 0xEC7DD02D, 0x34867077, 0x30476DC0,
87 0x3D044B19, 0x39C556AE, 0x278206AB, 0x23431B1C, 0x2E003DC5, 0x2AC12072,
88 0x128E9DCF, 0x164F8078, 0x1B0CA6A1, 0x1FCDBB16, 0x018AEB13, 0x054BF6A4,
89 0x0808D07D, 0x0CC9CDCA, 0x7897AB07, 0x7C56B6B0, 0x71159069, 0x75D48DDE,
90 0x6B93DDDB, 0x6F52C06C, 0x6211E6B5, 0x66D0FB02, 0x5E9F46BF, 0x5A5E5B08,
91 0x571D7DD1, 0x53DC6066, 0x4D9B3063, 0x495A2DD4, 0x44190B0D, 0x40D816BA,
92 0xACA5C697, 0xA864DB20, 0xA527FDF9, 0xA1E6E04E, 0xBFA1B04B, 0xBB60ADFC,
93 0xB6238B25, 0xB2E29692, 0x8AAD2B2F, 0x8E6C3698, 0x832F1041, 0x87EE0DF6,
94 0x99A95DF3, 0x9D684044, 0x902B669D, 0x94EA7B2A, 0xE0B41DE7, 0xE4750050,
95 0xE9362689, 0xEDF73B3E, 0xF3B06B3B, 0xF771768C, 0xFA325055, 0xFEF34DE2,
96 0xC6BCF05F, 0xC27DEDE8, 0xCF3ECB31, 0xCBFFD686, 0xD5B88683, 0xD1799B34,
97 0xDC3ABDED, 0xD8FBA05A, 0x690CE0EE, 0x6DCDFD59, 0x608EDB80, 0x644FC637,
98 0x7A089632, 0x7EC98B85, 0x738AAD5C, 0x774BB0EB, 0x4F040D56, 0x4BC510E1,
99 0x46863638, 0x42472B8F, 0x5C007B8A, 0x58C1663D, 0x558240E4, 0x51435D53,
100 0x251D3B9E, 0x21DC2629, 0x2C9F00F0, 0x285E1D47, 0x36194D42, 0x32D850F5,
101 0x3F9B762C, 0x3B5A6B9B, 0x0315D626, 0x07D4CB91, 0x0A97ED48, 0x0E56F0FF,
102 0x1011A0FA, 0x14D0BD4D, 0x19939B94, 0x1D528623, 0xF12F560E, 0xF5EE4BB9,
103 0xF8AD6D60, 0xFC6C70D7, 0xE22B20D2, 0xE6EA3D65, 0xEBA91BBC, 0xEF68060B,
104 0xD727BBB6, 0xD3E6A601, 0xDEA580D8, 0xDA649D6F, 0xC423CD6A, 0xC0E2D0DD,
105 0xCDA1F604, 0xC960EBB3, 0xBD3E8D7E, 0xB9FF90C9, 0xB4BCB610, 0xB07DABA7,
106 0xAE3AFBA2, 0xAAFBE615, 0xA7B8C0CC, 0xA379DD7B, 0x9B3660C6, 0x9FF77D71,
107 0x92B45BA8, 0x9675461F, 0x8832161A, 0x8CF30BAD, 0x81B02D74, 0x857130C3,
108 0x5D8A9099, 0x594B8D2E, 0x5408ABF7, 0x50C9B640, 0x4E8EE645, 0x4A4FFBF2,
109 0x470CDD2B, 0x43CDC09C, 0x7B827D21, 0x7F436096, 0x7200464F, 0x76C15BF8,
110 0x68860BFD, 0x6C47164A, 0x61043093, 0x65C52D24, 0x119B4BE9, 0x155A565E,
111 0x18197087, 0x1CD86D30, 0x029F3D35, 0x065E2082, 0x0B1D065B, 0x0FDC1BEC,
112 0x3793A651, 0x3352BBE6, 0x3E119D3F, 0x3AD08088, 0x2497D08D, 0x2056CD3A,
113 0x2D15EBE3, 0x29D4F654, 0xC5A92679, 0xC1683BCE, 0xCC2B1D17, 0xC8EA00A0,
114 0xD6AD50A5, 0xD26C4D12, 0xDF2F6BCB, 0xDBEE767C, 0xE3A1CBC1, 0xE760D676,
115 0xEA23F0AF, 0xEEE2ED18, 0xF0A5BD1D, 0xF464A0AA, 0xF9278673, 0xFDE69BC4,
116 0x89B8FD09, 0x8D79E0BE, 0x803AC667, 0x84FBDBD0, 0x9ABC8BD5, 0x9E7D9662,
117 0x933EB0BB, 0x97FFAD0C, 0xAFB010B1, 0xAB710D06, 0xA6322BDF, 0xA2F33668,
118 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4
119 };
120 UINT32 i;
121 UINT32 crc = 0xffffffff;
122
123 for (i = 0; i < len; i++)
124 crc = (crc << 8) ^ crc_table[((crc >> 24) ^ *buf++) & 0xFF];
125
126 return crc;
127}
128
129
130static UINT32 PlaceImage(char* filename, UINT32 pos, UINT8* pFirmware, UINT32 limit)
131{
132 UINT32 size, read;
133 FILE* pFile;
134 UINT32 align;
135 UINT32 flags;
136 UINT32 load_addr = ROCKBOX_DEST, exec_addr = ROCKBOX_EXEC; // defaults
137
138 // magic file header for compressed files
139 static const UINT8 magic[8] = { 0x00,0xe9,0x55,0x43,0x4c,0xff,0x01,0x1a };
140 UINT8 ucl_header[26];
141
142 pFile = fopen(filename, "rb"); // open the current image
143 if (pFile == NULL)
144 {
145 printf("Image file %s not found!\n", filename);
146 exit(5);
147 }
148
149 fseek(pFile, 0, SEEK_END);
150 size = ftell(pFile);
151 fseek(pFile, 0, SEEK_SET);
152
153 // determine if compressed
154 flags = 0x00000000; // default: flags for uncompressed
155 fread(ucl_header, 1, sizeof(ucl_header), pFile);
156 if (memcmp(magic, ucl_header, sizeof(magic)) == 0)
157 {
158 if (ucl_header[12] != 0x2E // check algorithm
159 && ucl_header[12] != 0x2B) // or uncompressed
160 {
161 printf("UCL compressed files must use algorithm 2e, not %d\n", ucl_header[12]);
162 printf("Generate with: uclpack --best --2e rockbox.bin %s\n", filename);
163 exit(6);
164 }
165
166 size = Read32(ucl_header + 22); // compressed size
167 if (Read32(ucl_header + 18) > size) // compare with uncompressed size
168 { // normal case
169 flags = 0x00000001; // flags for UCL compressed
170 }
171
172 if (ucl_header[12] == 0x2B) // uncompressed means "ROMbox", for direct flash execution
173 {
174 UINT8 start_addr[4];
175 UINT8 reset_vec[4];
176 fread(start_addr, 1, sizeof(start_addr), pFile); // read the link address from image
177 fread(reset_vec, 1, sizeof(reset_vec), pFile); // read the reset vector from image
178 fseek(pFile, 0-sizeof(start_addr)-sizeof(reset_vec), SEEK_CUR); // wind back
179 load_addr = Read32(start_addr);
180 if (load_addr != FLASH_START + pos + 16) // behind 16 byte header
181 {
182 printf("Error: Rombox .ucl file is linked to 0x%08X instead of 0x%08X\n", load_addr, FLASH_START + pos + 16);
183 exit(11);
184 }
185 exec_addr = Read32(reset_vec);
186 }
187 }
188 else
189 {
190 fseek(pFile, 0, SEEK_SET); // go back
191 }
192
193 if (pos + 16 + size > limit) // enough space for all that?
194 {
195 printf("Exceeding maximum image size %d\n", limit);
196 exit(7);
197 }
198
199 // write header
200 align = (pos + 16 + size + SECTORSIZE-1) & ~(SECTORSIZE-1); // round up to next flash sector
201 Write32(pFirmware + pos, load_addr); // load address
202 Write32(pFirmware + pos + 4, align - (pos + 16)); // image size
203 Write32(pFirmware + pos + 8, exec_addr); // execution address
204 Write32(pFirmware + pos + 12, flags); // compressed or not
205 pos += 16;
206
207 // load image
208 read = fread(pFirmware + pos, 1, size, pFile);
209 if (read != size)
210 {
211 printf("Read error, expecting %d bytes, got only %d\n", size, read);
212 exit(8);
213 }
214 fclose (pFile);
215
216 pos += size;
217
218 return pos;
219}
220
221
222int main(int argc, char* argv[])
223{
224 static UINT8 aFirmware[512*1024]; // maximum with exchanged chip
225 FILE* pFile;
226 UINT32 size; // size of loaded item
227 UINT32 pos; // current position in firmware
228 UINT32 crc32; // checksum of "payload"
229 BOOL hasBootRom; // flag if regular boot ROM or directly starts from flash
230 UINT32 template_F8, template_FC; // my platform ID, mask and version
231
232 int i;
233
234 if (argc <= 4)
235 {
236 printf("Usage:\n");
237 printf("make_firmware <output> <template.bin> <bootloader.ajz> <image1.ucl> {image2.ucl}\n");
238 printf("<template.bin> is the original firmware from your box\n");
239 printf("<bootloader.ajz> is the scrambled bootloader\n");
240 printf("<image1.ucl> is the first image, compressed (recommended) or uncompressed\n");
241 printf("<image1.ucl> is the second image, compressed (recommended) or uncompressed\n");
242 printf("More images may follow, but keep the flash size in mind!\n");
243 printf("Compression must be UCL, algorithm 2e.\n");
244 printf("Generated with: uclpack --best --2e rockbox.bin imageN.ucl\n");
245 exit(0);
246 }
247
248 memset(aFirmware, 0xFF, sizeof(aFirmware));
249
250 /******* process template *******/
251
252 pFile = fopen(argv[2], "rb"); // open the template
253 if (pFile == NULL)
254 {
255 printf("Template file %s not found!\n", argv[2]);
256 exit(1);
257 }
258 size = fread(aFirmware, 1, 256, pFile); // need only the header
259 fclose(pFile);
260 if (size < 256) // need at least the firmware header
261 {
262 printf("Template file %s too small, need at least the header!\n", argv[2]);
263 exit(2);
264 }
265
266 if (strncmp(aFirmware, "ARCH", 4) == 0)
267 {
268 hasBootRom = TRUE;
269 pos = 256; // place bootloader after this "boot block"
270 }
271 else if (Read32(aFirmware) == 0x0200)
272 {
273 hasBootRom = FALSE;
274 pos = 0; // directly start with the bootloader
275 template_F8 = Read32(aFirmware + 0xF8); // my platform ID and future info
276 template_FC = Read32(aFirmware + 0xFC); // use mask+version from template
277 }
278 else
279 {
280 printf("Template file %s invalid!\n", argv[2]);
281 exit(3);
282 }
283
284 /******* process bootloader *******/
285
286 pFile = fopen(argv[3], "rb"); // open the bootloader
287 if (pFile == NULL)
288 {
289 printf("Bootloader file %s not found!\n", argv[3]);
290 exit(4);
291 }
292 if (hasBootRom && fseek(pFile, 6, SEEK_SET)) // skip the ajz header
293 {
294 printf("Bootloader file %s too short!\n", argv[3]);
295 exit(5);
296 }
297
298 // place bootloader after header
299 size = fread(aFirmware + pos, 1, sizeof(aFirmware) - pos, pFile);
300 fclose(pFile);
301
302 if (hasBootRom)
303 {
304 Write32(aFirmware + 4, BOOTLOAD_DEST); // boot code destination address
305
306 for (i=0x08; i<=0x28; i+=8)
307 {
308 Write32(aFirmware + i, BOOTLOAD_SCR); // boot code source address
309 Write32(aFirmware + i + 4, size); // boot code size
310 }
311 }
312 else
313 {
314 Write32(aFirmware + 0xF8, template_F8); // values from template
315 Write32(aFirmware + 0xFC, template_FC); // mask and version
316 }
317
318 size = (size + 3) & ~3; // make shure it's 32 bit aligned
319 pos += size; // prepare position for first image
320
321 /******* process images *******/
322 for (i = 4; i < argc; i++)
323 {
324 pos = PlaceImage(argv[i], pos, aFirmware, sizeof(aFirmware));
325
326 if (i < argc-1)
327 { // not the last: round up to next flash sector
328 pos = (pos + SECTORSIZE-1) & ~(SECTORSIZE-1);
329 }
330 }
331
332
333 /******* append CRC32 checksum *******/
334 crc32 = CalcCRC32(aFirmware, pos);
335 Write32(aFirmware + pos, crc32);
336 pos += sizeof(crc32); // 4 bytes
337
338
339 /******* save result to output file *******/
340
341 pFile = fopen(argv[1], "wb"); // open the output file
342 if (pFile == NULL)
343 {
344 printf("Output file %s cannot be created!\n", argv[1]);
345 exit(9);
346 }
347 size = fwrite(aFirmware, 1, pos, pFile);
348 fclose(pFile);
349
350 if (size != pos)
351 {
352 printf("Error writing %d bytes to output file %s!\n", pos, argv[1]);
353 exit(10);
354 }
355
356 printf("Firmware file generated with %d bytes.\n", pos);
357
358 return 0;
359}
diff --git a/flash/make_firmware/make_firmware.dsp b/flash/make_firmware/make_firmware.dsp
deleted file mode 100644
index 54a6f53671..0000000000
--- a/flash/make_firmware/make_firmware.dsp
+++ /dev/null
@@ -1,96 +0,0 @@
1# Microsoft Developer Studio Project File - Name="make_firmware" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** DO NOT EDIT **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=make_firmware - Win32 Debug
8!MESSAGE This is not a valid makefile. To build this project using NMAKE,
9!MESSAGE use the Export Makefile command and run
10!MESSAGE
11!MESSAGE NMAKE /f "make_firmware.mak".
12!MESSAGE
13!MESSAGE You can specify a configuration when running NMAKE
14!MESSAGE by defining the macro CFG on the command line. For example:
15!MESSAGE
16!MESSAGE NMAKE /f "make_firmware.mak" CFG="make_firmware - Win32 Debug"
17!MESSAGE
18!MESSAGE Possible choices for configuration are:
19!MESSAGE
20!MESSAGE "make_firmware - Win32 Release" (based on "Win32 (x86) Console Application")
21!MESSAGE "make_firmware - Win32 Debug" (based on "Win32 (x86) Console Application")
22!MESSAGE
23
24# Begin Project
25# PROP AllowPerConfigDependencies 0
26# PROP Scc_ProjName ""
27# PROP Scc_LocalPath ""
28CPP=cl.exe
29RSC=rc.exe
30
31!IF "$(CFG)" == "make_firmware - Win32 Release"
32
33# PROP BASE Use_MFC 0
34# PROP BASE Use_Debug_Libraries 0
35# PROP BASE Output_Dir "Release"
36# PROP BASE Intermediate_Dir "Release"
37# PROP BASE Target_Dir ""
38# PROP Use_MFC 0
39# PROP Use_Debug_Libraries 0
40# PROP Output_Dir "Release"
41# PROP Intermediate_Dir "Release"
42# PROP Target_Dir ""
43# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
44# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX"stdafx.h" /FD /c
45# ADD BASE RSC /l 0x407 /d "NDEBUG"
46# ADD RSC /l 0x407 /d "NDEBUG"
47BSC32=bscmake.exe
48# ADD BASE BSC32 /nologo
49# ADD BSC32 /nologo
50LINK32=link.exe
51# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
52# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
53
54!ELSEIF "$(CFG)" == "make_firmware - Win32 Debug"
55
56# PROP BASE Use_MFC 0
57# PROP BASE Use_Debug_Libraries 1
58# PROP BASE Output_Dir "Debug"
59# PROP BASE Intermediate_Dir "Debug"
60# PROP BASE Target_Dir ""
61# PROP Use_MFC 0
62# PROP Use_Debug_Libraries 1
63# PROP Output_Dir "Debug"
64# PROP Intermediate_Dir "Debug"
65# PROP Target_Dir ""
66# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
67# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX"stdafx.h" /FD /GZ /c
68# ADD BASE RSC /l 0x407 /d "_DEBUG"
69# ADD RSC /l 0x407 /d "_DEBUG"
70BSC32=bscmake.exe
71# ADD BASE BSC32 /nologo
72# ADD BSC32 /nologo
73LINK32=link.exe
74# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
75# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
76
77!ENDIF
78
79# Begin Target
80
81# Name "make_firmware - Win32 Release"
82# Name "make_firmware - Win32 Debug"
83# Begin Group "Source Files"
84
85# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
86# Begin Source File
87
88SOURCE=.\make_firmware.c
89# End Source File
90# End Group
91# Begin Group "Header Files"
92
93# PROP Default_Filter "h;hpp;hxx;hm;inl"
94# End Group
95# End Target
96# End Project
diff --git a/flash/minimon/Makefile b/flash/minimon/Makefile
deleted file mode 100644
index 16b6c2724e..0000000000
--- a/flash/minimon/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10CC = sh-elf-gcc
11LD = sh-elf-ld
12AR = sh-elf-ar
13AS = sh-elf-as
14OC = sh-elf-objcopy
15
16FIRMWARE := ../../firmware
17TOOLSDIR=../../tools
18
19TARGET = minimon
20LDS := $(TARGET).lds
21
22INCLUDES= -I$(FIRMWARE)/export -I. -I$(OBJDIR)
23OBJDIR := .
24
25CFLAGS = -fpic -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) $(DEFINES)
26AFLAGS += -small -relax
27
28
29ifdef DEBUG
30 DEFINES := -DDEBUG
31 CFLAGS += -g
32endif
33
34SRC := $(wildcard *.c)
35
36OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
37
38LINKFILE = $(OBJDIR)/$(TARGET).lds
39
40
41$(OBJDIR)/$(TARGET).bin : $(OBJDIR)/$(TARGET).elf
42 $(OC) -O binary $(OBJDIR)/$(TARGET).elf $(OBJDIR)/$(TARGET).bin
43 $(TOOLSDIR)/sh2d $(OBJDIR)/$(TARGET).bin -o 0x0ffff000 > $(OBJDIR)/$(TARGET).asm
44
45$(OBJDIR)/$(TARGET).elf : $(OBJS)
46 $(CC) -Os -nostdlib -o $(OBJDIR)/$(TARGET).elf -L$(OBJDIR) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/$(TARGET).map
47
48
49clean:
50 -rm -f $(OBJS) $(OBJDIR)/$(TARGET).asm \
51 $(OBJDIR)/$(TARGET).bin \
52 $(OBJDIR)/$(TARGET).elf \
53 $(OBJDIR)/$(TARGET).map
diff --git a/flash/minimon/README b/flash/minimon/README
deleted file mode 100644
index d2dc1707a6..0000000000
--- a/flash/minimon/README
+++ /dev/null
@@ -1,9 +0,0 @@
1(c) 2003 by Jörg Hohensohn
2
3MiniMon is the tiny but powerful-enough piece of code that can be loaded
4with the UART boot mod.
5It allows to read and write memory, flash program, execute code.
6This is suitable to reflash the box, load Rockbox or the gdb stub, etc.
7
8The SVN version is linked to 0x0ffff000, i.e. start of IRAM.
9This address has to match the address uart_boot downloads it to. \ No newline at end of file
diff --git a/flash/minimon/minimon.c b/flash/minimon/minimon.c
deleted file mode 100644
index aca9cb5523..0000000000
--- a/flash/minimon/minimon.c
+++ /dev/null
@@ -1,156 +0,0 @@
1// minimalistic monitor
2// to be loaded with the UART boot feature
3// capable of reading and writing bytes, commanded by UART
4
5#include "sh7034.h"
6#include "minimon.h"
7
8// scalar types
9typedef unsigned char UINT8;
10typedef unsigned short UINT16;
11typedef unsigned long UINT32;
12
13typedef void(*tpFunc)(void); // type for exec
14typedef int(*tpMain)(void); // type for start vector to main()
15
16
17// prototypes
18int main(void);
19
20// our binary has to start with a vector to the entry point
21tpMain start_vector[] __attribute__ ((section (".startvector"))) = {main};
22
23
24static UINT8 uart_read(void)
25{
26 UINT8 byte;
27 while (!(SSR1 & SCI_RDRF)); // wait for char to be available
28 byte = RDR1;
29 SSR1 &= ~SCI_RDRF;
30 return byte;
31}
32
33
34static void uart_write(UINT8 byte)
35{
36 while (!(SSR1 & SCI_TDRE)); // wait for transmit buffer empty
37 TDR1 = byte;
38 SSR1 &= ~SCI_TDRE;
39}
40
41
42int main(void)
43{
44 UINT8 cmd;
45 UINT32 addr;
46 UINT32 size;
47 UINT32 content;
48 volatile UINT8* paddr = 0;
49 volatile UINT8* pflash = 0; // flash base address
50
51 while (1)
52 {
53 cmd = uart_read();
54 switch (cmd)
55 {
56 case BAUDRATE:
57 content = uart_read();
58 uart_write(cmd); // acknowledge by returning the command value
59 while (!(SSR1 & SCI_TEND)); // wait for empty shift register, before changing baudrate
60 BRR1 = content;
61 break;
62
63 case ADDRESS:
64 addr = (uart_read() << 24) | (uart_read() << 16) | (uart_read() << 8) | uart_read();
65 paddr = (UINT8*)addr;
66 pflash = (UINT8*)(addr & 0xFFF80000); // round down to 512k align
67 uart_write(cmd); // acknowledge by returning the command value
68 break;
69
70 case BYTE_READ:
71 content = *paddr++;
72 uart_write(content); // the content is the ack
73 break;
74
75 case BYTE_WRITE:
76 content = uart_read();
77 *paddr++ = content;
78 uart_write(cmd); // acknowledge by returning the command value
79 break;
80
81 case BYTE_READ16:
82 size = 16;
83 while (size--)
84 {
85 content = *paddr++;
86 uart_write(content); // the content is the ack
87 }
88 break;
89
90 case BYTE_WRITE16:
91 size = 16;
92 while (size--)
93 {
94 content = uart_read();
95 *paddr++ = content;
96 }
97 uart_write(cmd); // acknowledge by returning the command value
98 break;
99
100 case BYTE_FLASH:
101 content = uart_read();
102 pflash[0x5555] = 0xAA; // set flash to command mode
103 pflash[0x2AAA] = 0x55;
104 pflash[0x5555] = 0xA0; // byte program command
105 *paddr++ = content;
106 uart_write(cmd); // acknowledge by returning the command value
107 break;
108
109 case BYTE_FLASH16:
110 size = 16;
111 while (size--)
112 {
113 content = uart_read();
114 pflash[0x5555] = 0xAA; // set flash to command mode
115 pflash[0x2AAA] = 0x55;
116 pflash[0x5555] = 0xA0; // byte program command
117 *paddr++ = content;
118 }
119 uart_write(cmd); // acknowledge by returning the command value
120 break;
121
122 case HALFWORD_READ:
123 content = *(UINT16*)paddr;
124 paddr += 2;
125 uart_write(content >> 8); // highbyte
126 uart_write(content & 0xFF); // lowbyte
127 break;
128
129 case HALFWORD_WRITE:
130 content = uart_read() << 8 | uart_read();
131 *(UINT16*)paddr = content;
132 paddr += 2;
133 uart_write(cmd); // acknowledge by returning the command value
134 break;
135
136 case EXECUTE:
137 {
138 tpFunc pFunc = (tpFunc)paddr;
139 pFunc();
140 uart_write(cmd); // acknowledge by returning the command value
141 }
142 break;
143
144
145 default:
146 {
147 volatile UINT16* pPortB = (UINT16*)0x05FFFFC2;
148 *pPortB |= 1 << 6; // bit 6 is red LED on
149 uart_write(~cmd); // error acknowledge
150 }
151
152 } // case
153 }
154
155 return 0;
156}
diff --git a/flash/minimon/minimon.h b/flash/minimon/minimon.h
deleted file mode 100644
index b6e9805ecf..0000000000
--- a/flash/minimon/minimon.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef _MINIMON_H
2#define _MINIMON_H
3
4
5// Commands
6// all multibyte values (address, halfwords) are passed as big endian
7// (most significant of the bytes first)
8
9// set the address (all read/write commands will auto-increment it)
10#define BAUDRATE 0x00 // followed by BRR value; response: command byte
11#define ADDRESS 0x01 // followed by 4 bytes address; response: command byte
12#define BYTE_READ 0x02 // response: 1 byte content
13#define BYTE_WRITE 0x03 // followed by 1 byte content; response: command byte
14#define BYTE_READ16 0x04 // response: 16 bytes content
15#define BYTE_WRITE16 0x05 // followed by 16 bytes; response: command byte
16#define BYTE_FLASH 0x06 // followed by 1 byte content; response: command byte
17#define BYTE_FLASH16 0x07 // followed by 16 bytes; response: command byte
18#define HALFWORD_READ 0x08 // response: 2 byte content
19#define HALFWORD_WRITE 0x09 // followed by 2 byte content; response: command byte
20#define EXECUTE 0x0A // response: command byte if call returns
21#define VERSION 0x0B // response: version
22
23
24#endif // _MINIMON_H
diff --git a/flash/minimon/minimon.lds b/flash/minimon/minimon.lds
deleted file mode 100644
index 14150b2123..0000000000
--- a/flash/minimon/minimon.lds
+++ /dev/null
@@ -1,60 +0,0 @@
1OUTPUT_FORMAT(elf32-sh)
2INPUT(minimon.o)
3
4MEMORY
5{
6 IRAM : ORIGIN = 0x0FFFF000, LENGTH = 0x500
7}
8
9SECTIONS
10{
11 .startvector :
12 {
13 *(.startvector)
14 . = ALIGN(0x4);
15 } > IRAM
16
17 .got :
18 {
19 *(.got)
20 } > IRAM
21
22 .got.plt :
23 {
24 *(.got.plt)
25 } > IRAM
26
27 .rela.got :
28 {
29 *(.rela.got)
30 } > IRAM
31
32 .text :
33 {
34 . = ALIGN(0x200);
35 *(.entry)
36 *(.text)
37 . = ALIGN(0x4);
38 } > IRAM
39
40 .data :
41 {
42 *(.data)
43 } > IRAM
44
45 .rodata :
46 {
47 *(.rodata)
48 . = ALIGN(0x4);
49 } > IRAM
50
51 .bss :
52 {
53 *(.bss)
54 } > IRAM
55
56 .stack :
57 {
58 *(.stack)
59 } > IRAM
60}
diff --git a/flash/uart_boot/Makefile b/flash/uart_boot/Makefile
deleted file mode 100644
index 04db068c07..0000000000
--- a/flash/uart_boot/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9# This Makefile currently works for cygwin only!
10
11
12CFLAGS := -O -W -Wall -mno-cygwin
13
14uart_boot: uart_boot.c client.c flash.c uart_win.c
15 $(CC) $(CFLAGS) $+ -o $@
16
17clean:
18 -rm -f uart_boot.exe
19
diff --git a/flash/uart_boot/README b/flash/uart_boot/README
deleted file mode 100644
index af2b5ae87d..0000000000
--- a/flash/uart_boot/README
+++ /dev/null
@@ -1,8 +0,0 @@
1(c) 2003 by Jörg Hohensohn
2
3This is the client side for MiniMon, a command line program that communicates with it.
4It can be used to reflash a box from ground up, load a program like gdb stub or Rockbox,
5and other diagnostics.
6
7Current implementation is for Windows, but with a different UART implementation
8it should work for other platforms (Linux) as well.
diff --git a/flash/uart_boot/client.c b/flash/uart_boot/client.c
deleted file mode 100644
index 71749a2c55..0000000000
--- a/flash/uart_boot/client.c
+++ /dev/null
@@ -1,737 +0,0 @@
1// client.cpp : functions for monitor download and communication.
2//
3
4#include <stdio.h>
5#include <stdlib.h>
6#include "scalar_types.h" // (U)INT8/16/32
7#include "Uart.h" // platform abstraction for UART
8#include "minimon.h" // protocol of my little monitor
9
10// do the baudrate configuration for the Player
11int ConfigFirstlevelPlayer (tUartHandle serial_handle)
12{
13 UINT32 result_nbr;
14
15 if(!UartConfig(serial_handle, 4800, eMARKPARITY, eTWOSTOPBITS, 8))
16 {
17 UINT32 dwErr = GET_LAST_ERR();
18 printf("Error %lu setting up COM params for baudrate byte\n", dwErr);
19 exit(1);
20 }
21
22 // this will read as 0x19 when viewed with 2300 baud like the player does
23 result_nbr = UartWrite(serial_handle, (UINT8*)"\x86\xC0", 2);
24 if (result_nbr != 2)
25 {
26 UINT32 dwErr = GET_LAST_ERR();
27 printf("Error %lu setting up COM params for baudrate byte\n", dwErr);
28 }
29
30 SLEEP(100); // wait for the chars to be sent, is there a better way?
31
32 // the read 0x19 means 14423 baud with 12 MHz
33 if(!UartConfig(serial_handle, 14400, eNOPARITY, eONESTOPBIT, 8))
34 {
35 printf("Error setting up COM params for 1st level loader\n");
36 exit(1);
37 }
38
39 return 0;
40}
41
42
43// do the baudrate configuration for the Recoder/FM
44int ConfigFirstlevelRecorder (tUartHandle serial_handle)
45{
46 UINT32 result_nbr;
47
48 if(!UartConfig(serial_handle, 4800, eNOPARITY, eTWOSTOPBITS, 8))
49 {
50 UINT32 dwErr = GET_LAST_ERR();
51 printf("Error %lu setting up COM params for baudrate byte\n", dwErr);
52 exit(1);
53 }
54
55 // this will read as 0x08 when viewed with 2120 baud like the recorder does
56 result_nbr = UartWrite(serial_handle, (UINT8*)"\x00\x00", 2);
57 if(result_nbr != 2)
58 {
59 printf("Error transmitting baudrate byte\n");
60 exit(1);
61 }
62
63 SLEEP(100); // wait for the chars to be sent, is there a better way?
64
65 // the read 0x08 means 38400 baud with 11.0592 MHz
66 if(!UartConfig(serial_handle, 38400, eNOPARITY, eONESTOPBIT, 8))
67 {
68 UINT32 dwErr = GET_LAST_ERR();
69 printf("Error %lu setting up COM params for 1st level loader\n", dwErr);
70 exit(1);
71 }
72
73 return 0;
74}
75
76
77// transfer a byte for the monitor download, with or without acknowledge
78int DownloadByte(tUartHandle serial_handle, unsigned char byte, bool bAck)
79{
80 unsigned char received;
81
82 while (1)
83 {
84 UartWrite(serial_handle, &byte, 1);
85 if (bAck)
86 {
87 UartRead(serial_handle, &received, 1);
88 if (received == byte)
89 {
90 UartWrite(serial_handle, (UINT8*)"\x01", 1); // ack success
91 break; // exit the loop
92 }
93 else
94 {
95 printf("Error transmitting monitor byte 0x%02X, got 0x%0X\n", byte, received);
96 UartWrite(serial_handle, (UINT8*)"\x00", 1); // ack fail, try again
97 }
98 }
99 else
100 break; // no loop
101 }
102 return 1;
103}
104
105
106// download our little monitor, the box must have been just freshly switched on for this to work
107int DownloadMonitor(tUartHandle serial_handle, bool bRecorder, char* szFilename)
108{
109 FILE* pFile;
110 size_t filesize;
111 UINT8 byte;
112 unsigned i;
113
114 // hard-coded parameters
115 bool bAck = true; // configure if acknowledged download (without useful for remote pin boot)
116 UINT32 TargetLoad = 0x0FFFF000; // target load address
117
118 pFile = fopen(szFilename, "rb");
119 if (pFile == NULL)
120 {
121 printf("\nMonitor file %s not found, exiting\n", szFilename);
122 exit(1);
123 }
124
125 // determine file size
126 fseek(pFile, 0, SEEK_END);
127 filesize = ftell(pFile);
128 fseek(pFile, 0, SEEK_SET);
129
130 // This is _really_ tricky! The box expects a BRR value in a nonstandard baudrate,
131 // which a PC can't generate. I'm using a higher one with some wild settings
132 // to generate a pulse series that:
133 // 1) looks like a stable byte when sampled with the nonstandard baudrate
134 // 2) gives a BRR value to the box which results in a baudrate the PC can also use
135 if (bRecorder)
136 {
137 ConfigFirstlevelRecorder(serial_handle);
138 }
139 else
140 {
141 ConfigFirstlevelPlayer(serial_handle);
142 }
143
144 UartWrite(serial_handle, bAck ? (UINT8*)"\x01" : (UINT8*)"\x00", 1); // ACK mode
145
146 // transmit the size, little endian
147 DownloadByte(serial_handle, (UINT8)( filesize & 0xFF), bAck);
148 DownloadByte(serial_handle, (UINT8)((filesize>>8) & 0xFF), bAck);
149 DownloadByte(serial_handle, (UINT8)((filesize>>16) & 0xFF), bAck);
150 DownloadByte(serial_handle, (UINT8)((filesize>>24) & 0xFF), bAck);
151
152 // transmit the load address, little endian
153 DownloadByte(serial_handle, (UINT8)( TargetLoad & 0xFF), bAck);
154 DownloadByte(serial_handle, (UINT8)((TargetLoad>>8) & 0xFF), bAck);
155 DownloadByte(serial_handle, (UINT8)((TargetLoad>>16) & 0xFF), bAck);
156 DownloadByte(serial_handle, (UINT8)((TargetLoad>>24) & 0xFF), bAck);
157
158 // transmit the command byte
159 DownloadByte(serial_handle, 0xFF, bAck); // 0xFF means execute the transferred image
160
161 // transmit the image
162 for (i=0; i<filesize; i++)
163 {
164 fread(&byte, 1, 1, pFile);
165 DownloadByte(serial_handle, byte, bAck);
166 }
167
168 fclose (pFile);
169
170 // now the image should have been started, red LED off
171
172 return 0;
173}
174
175
176// wait for a fixed string to be received (no foolproof algorithm,
177// may overlook if the searched string contains repeatitions)
178int WaitForString(tUartHandle serial_handle, char* pszWait)
179{
180 int i = 0;
181 unsigned char received;
182
183 while(pszWait[i] != '\0')
184 {
185 UartRead(serial_handle, &received, 1);
186
187 printf("%c", received); // debug
188
189 if (received == pszWait[i])
190 i++; // continue
191 else
192 i=0; // mismatch, start over
193 }
194 return 0;
195}
196
197
198// send a sting and check the echo
199int SendWithEcho(tUartHandle serial_handle, char* pszSend)
200{
201 int i = 0;
202 unsigned char received;
203
204 while(pszSend[i] != '\0')
205 {
206 UartWrite(serial_handle, (unsigned char*)(pszSend + i), 1); // send char
207 do
208 {
209 UartRead(serial_handle, &received, 1); // receive echo
210 printf("%c", received); // debug
211 }
212 while (received != pszSend[i]); // should normally be equal
213 i++; // next char
214 }
215 return 0;
216}
217
218
219// rarely used variant: download our monitor using the built-in Archos monitor
220int DownloadArchosMonitor(tUartHandle serial_handle, char* szFilename)
221{
222 FILE* pFile;
223 size_t filesize;
224 UINT8 byte;
225 UINT16 checksum = 0;
226 unsigned i;
227
228 // the onboard monitor uses 115200 baud
229 if(!UartConfig(serial_handle, 115200, eNOPARITY, eONESTOPBIT, 8))
230 {
231 UINT32 dwErr = GET_LAST_ERR();
232 printf("Error %lu setting up COM params for baudrate %d\n", dwErr, 115200);
233 exit(1);
234 }
235
236 // wait for receiving "#SERIAL#"
237 WaitForString(serial_handle, "#SERIAL#");
238
239 // send magic "SRL" command to get interactive mode
240 SendWithEcho(serial_handle, "SRL\r");
241
242 // wait for menu completion: "ROOT>" at the end
243 WaitForString(serial_handle, "ROOT>");
244
245 // send upload command "UP"
246 SendWithEcho(serial_handle, "UP\r");
247
248 pFile = fopen(szFilename, "rb");
249 if (pFile == NULL)
250 {
251 printf("\nMonitor file %s not found, exiting\n", szFilename);
252 exit(1);
253 }
254
255 // determine file size
256 fseek(pFile, 0, SEEK_END);
257 filesize = ftell(pFile);
258 fseek(pFile, 0, SEEK_SET);
259
260 // calculate checksum
261 for (i=0; i<filesize; i++)
262 {
263 fread(&byte, 1, 1, pFile);
264 checksum += byte;
265 }
266 fseek(pFile, 0, SEEK_SET);
267
268 // send header
269
270 // size as 32 bit little endian
271 byte = (UINT8)( filesize & 0xFF);
272 UartWrite(serial_handle, &byte, 1);
273 byte = (UINT8)((filesize>>8) & 0xFF);
274 UartWrite(serial_handle, &byte, 1);
275 byte = (UINT8)((filesize>>16) & 0xFF);
276 UartWrite(serial_handle, &byte, 1);
277 byte = (UINT8)((filesize>>24) & 0xFF);
278 UartWrite(serial_handle, &byte, 1);
279
280 // checksum as 16 bit little endian
281 byte = (UINT8)( checksum & 0xFF);
282 UartWrite(serial_handle, &byte, 1);
283 byte = (UINT8)((checksum>>8) & 0xFF);
284 UartWrite(serial_handle, &byte, 1);
285
286 UartWrite(serial_handle, (unsigned char*)"\x00", 1); // kind (3 means flash)
287 UartWrite(serial_handle, (unsigned char*)"\x00", 1); // ignored byte
288
289 // wait for monitor to accept data
290 WaitForString(serial_handle, "#OKCTRL#");
291
292 // transmit the image
293 for (i=0; i<filesize; i++)
294 {
295 fread(&byte, 1, 1, pFile);
296 UartWrite(serial_handle, &byte, 1); // payload
297 }
298 fclose (pFile);
299
300 UartWrite(serial_handle, (unsigned char*)"\x00", 1); // ignored byte
301
302 // wait for menu completion: "ROOT>" at the end
303 WaitForString(serial_handle, "ROOT>");
304
305 // send start program command "SPRO"
306 SendWithEcho(serial_handle, "SPRO\r");
307
308 SLEEP(100); // wait a little while for startup
309
310 return 0;
311}
312
313
314/********** Target functions using the Monitor Protocol **********/
315
316// read a byte using the target monitor
317UINT8 ReadByte(tUartHandle serial_handle, UINT32 addr)
318{
319 UINT8 send;
320 UINT8 received;
321
322 // send the address command
323 send = ADDRESS;
324 UartWrite(serial_handle, &send, 1);
325
326 // transmit the address, big endian
327 send = (UINT8)((addr>>24) & 0xFF);
328 UartWrite(serial_handle, &send, 1);
329 send = (UINT8)((addr>>16) & 0xFF);
330 UartWrite(serial_handle, &send, 1);
331 send = (UINT8)((addr>>8) & 0xFF);
332 UartWrite(serial_handle, &send, 1);
333 send = (UINT8)(addr & 0xFF);
334 UartWrite(serial_handle, &send, 1);
335
336 UartRead(serial_handle, &received, 1); // response
337 if (received != ADDRESS)
338 {
339 printf("Protocol error!\n");
340 return 1;
341 }
342
343 // send the read command
344 send = BYTE_READ;
345 UartWrite(serial_handle, &send, 1);
346
347 UartRead(serial_handle, &received, 1); // response
348
349 return received;
350}
351
352
353// write a byte using the target monitor
354int WriteByte(tUartHandle serial_handle, UINT32 addr, UINT8 byte)
355{
356 UINT8 send;
357 UINT8 received;
358
359 // send the address command
360 send = ADDRESS;
361 UartWrite(serial_handle, &send, 1);
362
363 // transmit the address, big endian
364 send = (UINT8)((addr>>24) & 0xFF);
365 UartWrite(serial_handle, &send, 1);
366 send = (UINT8)((addr>>16) & 0xFF);
367 UartWrite(serial_handle, &send, 1);
368 send = (UINT8)((addr>>8) & 0xFF);
369 UartWrite(serial_handle, &send, 1);
370 send = (UINT8)(addr & 0xFF);
371 UartWrite(serial_handle, &send, 1);
372
373 UartRead(serial_handle, &received, 1); // response
374 if (received != ADDRESS)
375 {
376 printf("Protocol error, receiced 0x%02X!\n", received);
377 return 1;
378 }
379
380 // send the write command
381 send = BYTE_WRITE;
382 UartWrite(serial_handle, &send, 1);
383
384 // transmit the data
385 UartWrite(serial_handle, &byte, 1);
386
387 UartRead(serial_handle, &received, 1); // response
388
389 if (received != BYTE_WRITE)
390 {
391 printf("Protocol error!\n");
392 return 1;
393 }
394
395 return 0;
396}
397
398
399// read many bytes using the target monitor
400int ReadByteMultiple(tUartHandle serial_handle, UINT32 addr, UINT32 size, UINT8* pBuffer)
401{
402 UINT8 send, received;
403
404 // send the address command
405 send = ADDRESS;
406 UartWrite(serial_handle, &send, 1);
407
408 // transmit the address, big endian
409 send = (UINT8)((addr>>24) & 0xFF);
410 UartWrite(serial_handle, &send, 1);
411 send = (UINT8)((addr>>16) & 0xFF);
412 UartWrite(serial_handle, &send, 1);
413 send = (UINT8)((addr>>8) & 0xFF);
414 UartWrite(serial_handle, &send, 1);
415 send = (UINT8)(addr & 0xFF);
416 UartWrite(serial_handle, &send, 1);
417
418 UartRead(serial_handle, &received, 1); // response
419 if (received != ADDRESS)
420 {
421 printf("Protocol error!\n");
422 return 1;
423 }
424
425 while (size)
426 {
427 if (size >= 16)
428 { // we can use a "burst" command
429 send = BYTE_READ16;
430 UartWrite(serial_handle, &send, 1); // send the read command
431 UartRead(serial_handle, pBuffer, 16); // data response
432 pBuffer += 16;
433 size -= 16;
434 }
435 else
436 { // use single byte command
437 send = BYTE_READ;
438 UartWrite(serial_handle, &send, 1); // send the read command
439 UartRead(serial_handle, pBuffer++, 1); // data response
440 size--;
441 }
442 }
443
444 return 0;
445}
446
447
448// write many bytes using the target monitor
449int WriteByteMultiple(tUartHandle serial_handle, UINT32 addr, UINT32 size, UINT8* pBuffer)
450{
451 UINT8 send, received;
452
453 // send the address command
454 send = ADDRESS;
455 UartWrite(serial_handle, &send, 1);
456
457 // transmit the address, big endian
458 send = (UINT8)((addr>>24) & 0xFF);
459 UartWrite(serial_handle, &send, 1);
460 send = (UINT8)((addr>>16) & 0xFF);
461 UartWrite(serial_handle, &send, 1);
462 send = (UINT8)((addr>>8) & 0xFF);
463 UartWrite(serial_handle, &send, 1);
464 send = (UINT8)(addr & 0xFF);
465 UartWrite(serial_handle, &send, 1);
466
467 UartRead(serial_handle, &received, 1); // response
468 if (received != ADDRESS)
469 {
470 printf("Protocol error!\n");
471 return 1;
472 }
473
474 while (size)
475 {
476 if (size >= 16)
477 { // we can use a "burst" command
478 send = BYTE_WRITE16;
479 UartWrite(serial_handle, &send, 1); // send the write command
480 UartWrite(serial_handle, pBuffer, 16); // transmit the data
481 UartRead(serial_handle, &received, 1); // response
482 if (received != BYTE_WRITE16)
483 {
484 printf("Protocol error!\n");
485 return 1;
486 }
487 pBuffer += 16;
488 size -= 16;
489 }
490 else
491 { // use single byte command
492 send = BYTE_WRITE;
493 UartWrite(serial_handle, &send, 1); // send the write command
494 UartWrite(serial_handle, pBuffer++, 1); // transmit the data
495 UartRead(serial_handle, &received, 1); // response
496 if (received != BYTE_WRITE)
497 {
498 printf("Protocol error!\n");
499 return 1;
500 }
501 size--;
502 }
503 }
504
505 return 0;
506}
507
508
509// write many bytes using the target monitor
510int FlashByteMultiple(tUartHandle serial_handle, UINT32 addr, UINT32 size, UINT8* pBuffer)
511{
512 UINT8 send, received;
513
514 // send the address command
515 send = ADDRESS;
516 UartWrite(serial_handle, &send, 1);
517
518 // transmit the address, big endian
519 send = (UINT8)((addr>>24) & 0xFF);
520 UartWrite(serial_handle, &send, 1);
521 send = (UINT8)((addr>>16) & 0xFF);
522 UartWrite(serial_handle, &send, 1);
523 send = (UINT8)((addr>>8) & 0xFF);
524 UartWrite(serial_handle, &send, 1);
525 send = (UINT8)(addr & 0xFF);
526 UartWrite(serial_handle, &send, 1);
527
528 UartRead(serial_handle, &received, 1); // response
529 if (received != ADDRESS)
530 {
531 printf("Protocol error!\n");
532 return 1;
533 }
534
535 while (size)
536 {
537 if (size >= 16)
538 { // we can use a "burst" command
539 send = BYTE_FLASH16;
540 UartWrite(serial_handle, &send, 1); // send the write command
541 UartWrite(serial_handle, pBuffer, 16); // transmit the data
542 UartRead(serial_handle, &received, 1); // response
543 if (received != BYTE_FLASH16)
544 {
545 printf("Protocol error!\n");
546 return 1;
547 }
548 pBuffer += 16;
549 size -= 16;
550 }
551 else
552 { // use single byte command
553 send = BYTE_FLASH;
554 UartWrite(serial_handle, &send, 1); // send the write command
555 UartWrite(serial_handle, pBuffer++, 1); // transmit the data
556 UartRead(serial_handle, &received, 1); // response
557 if (received != BYTE_FLASH)
558 {
559 printf("Protocol error!\n");
560 return 1;
561 }
562 size--;
563 }
564 }
565
566 return 0;
567}
568
569
570// read a 16bit halfword using the target monitor
571UINT16 ReadHalfword(tUartHandle serial_handle, UINT32 addr)
572{
573 UINT8 send;
574 UINT8 received;
575 UINT16 halfword;
576
577 // send the address command
578 send = ADDRESS;
579 UartWrite(serial_handle, &send, 1);
580
581 // transmit the address, big endian
582 send = (UINT8)((addr>>24) & 0xFF);
583 UartWrite(serial_handle, &send, 1);
584 send = (UINT8)((addr>>16) & 0xFF);
585 UartWrite(serial_handle, &send, 1);
586 send = (UINT8)((addr>>8) & 0xFF);
587 UartWrite(serial_handle, &send, 1);
588 send = (UINT8)(addr & 0xFF);
589 UartWrite(serial_handle, &send, 1);
590
591 UartRead(serial_handle, &received, 1); // response
592 if (received != ADDRESS)
593 {
594 printf("Protocol error!\n");
595 return 1;
596 }
597
598 // send the read command
599 send = HALFWORD_READ;
600 UartWrite(serial_handle, &send, 1);
601
602 UartRead(serial_handle, &received, 1); // response
603 halfword = received << 8; // highbyte
604 UartRead(serial_handle, &received, 1);
605 halfword |= received; // lowbyte
606
607 return halfword;
608}
609
610
611// write a 16bit halfword using the target monitor
612int WriteHalfword(tUartHandle serial_handle, UINT32 addr, UINT16 halfword)
613{
614 UINT8 send;
615 UINT8 received;
616
617 // send the address command
618 send = ADDRESS;
619 UartWrite(serial_handle, &send, 1);
620
621 // transmit the address, big endian
622 send = (UINT8)((addr>>24) & 0xFF);
623 UartWrite(serial_handle, &send, 1);
624 send = (UINT8)((addr>>16) & 0xFF);
625 UartWrite(serial_handle, &send, 1);
626 send = (UINT8)((addr>>8) & 0xFF);
627 UartWrite(serial_handle, &send, 1);
628 send = (UINT8)(addr & 0xFF);
629 UartWrite(serial_handle, &send, 1);
630
631 UartRead(serial_handle, &received, 1); // response
632 if (received != ADDRESS)
633 {
634 printf("Protocol error!\n");
635 return 1;
636 }
637
638 // send the write command
639 send = HALFWORD_WRITE;
640 UartWrite(serial_handle, &send, 1);
641
642 // transmit the data
643 send = halfword >> 8; // highbyte
644 UartWrite(serial_handle, &send, 1);
645 send = halfword & 0xFF; // lowbyte
646 UartWrite(serial_handle, &send, 1);
647
648 UartRead(serial_handle, &received, 1); // response
649
650 if (received != HALFWORD_WRITE)
651 {
652 printf("Protocol error!\n");
653 return 1;
654 }
655
656 return 0;
657}
658
659
660// change baudrate using target monitor
661int SetTargetBaudrate(tUartHandle serial_handle, long lClock, long lBaudrate)
662{
663 UINT8 send;
664 UINT8 received;
665 UINT8 brr;
666 long lBRR;
667
668 lBRR = lClock / lBaudrate;
669 lBRR = ((lBRR + 16) / 32) - 1; // with rounding
670 brr = (UINT8)lBRR;
671
672 // send the command
673 send = BAUDRATE;
674 UartWrite(serial_handle, &send, 1);
675 UartWrite(serial_handle, &brr, 1); // send the BRR value
676 UartRead(serial_handle, &received, 1); // response ack
677
678 if (received != BAUDRATE)
679 { // bad situation, now we're unclear about the baudrate of the target
680 printf("Protocol error!\n");
681 return 1;
682 }
683
684 SLEEP(100); // give it some time to settle
685
686 // change our baudrate, too
687 UartConfig(serial_handle, lBaudrate, eNOPARITY, eONESTOPBIT, 8);
688
689 return 0;
690}
691
692
693// call a subroutine using the target monitor
694int Execute(tUartHandle serial_handle, UINT32 addr, bool bReturns)
695{
696 UINT8 send;
697 UINT8 received;
698
699 // send the address command
700 send = ADDRESS;
701 UartWrite(serial_handle, &send, 1);
702
703 // transmit the address, big endian
704 send = (UINT8)((addr>>24) & 0xFF);
705 UartWrite(serial_handle, &send, 1);
706 send = (UINT8)((addr>>16) & 0xFF);
707 UartWrite(serial_handle, &send, 1);
708 send = (UINT8)((addr>>8) & 0xFF);
709 UartWrite(serial_handle, &send, 1);
710 send = (UINT8)(addr & 0xFF);
711 UartWrite(serial_handle, &send, 1);
712
713 UartRead(serial_handle, &received, 1); // response
714 if (received != ADDRESS)
715 {
716 printf("Protocol error!\n");
717 return 1;
718 }
719
720 // send the execute command
721 send = EXECUTE;
722 UartWrite(serial_handle, &send, 1);
723 if (bReturns)
724 { // we expect the call to return control to minimon
725 UartRead(serial_handle, &received, 1); // response
726
727 if (received != EXECUTE)
728 {
729 printf("Protocol error!\n");
730 return 1;
731 }
732 }
733
734 return 0;
735}
736
737
diff --git a/flash/uart_boot/client.h b/flash/uart_boot/client.h
deleted file mode 100644
index a5df8c35d6..0000000000
--- a/flash/uart_boot/client.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef _CLIENT_H
2#define _CLIENT_H
3
4
5// setup function for monitor download
6int DownloadMonitor(tUartHandle serial_handle, bool bRecorder, char* szFilename);
7int DownloadArchosMonitor(tUartHandle serial_handle, char* szFilename);
8
9// target functions using the Monitor Protocol
10UINT8 ReadByte(tUartHandle serial_handle, UINT32 addr);
11int WriteByte(tUartHandle serial_handle, UINT32 addr, UINT8 byte);
12int ReadByteMultiple(tUartHandle serial_handle, UINT32 addr, UINT32 size, UINT8* pBuffer);
13int WriteByteMultiple(tUartHandle serial_handle, UINT32 addr, UINT32 size, UINT8* pBuffer);
14int FlashByteMultiple(tUartHandle serial_handle, UINT32 addr, UINT32 size, UINT8* pBuffer);
15UINT16 ReadHalfword(tUartHandle serial_handle, UINT32 addr);
16int WriteHalfword(tUartHandle serial_handle, UINT32 addr, UINT16 halfword);
17int SetTargetBaudrate(tUartHandle serial_handle, long lClock, long lBaudrate);
18int Execute(tUartHandle serial_handle, UINT32 addr, bool bReturns);
19
20
21#endif
22
diff --git a/flash/uart_boot/flash.c b/flash/uart_boot/flash.c
deleted file mode 100644
index 854de20454..0000000000
--- a/flash/uart_boot/flash.c
+++ /dev/null
@@ -1,78 +0,0 @@
1// flash.cpp : higher-level functions for flashing the chip
2//
3
4#include "scalar_types.h" // (U)INT8/16/32
5#include "Uart.h" // platform abstraction for UART
6#include "client.h" // client functions
7
8
9// read the manufacturer and device ID
10int ReadID(tUartHandle serial_handle, UINT32 base, UINT8* pManufacturerID, UINT8* pDeviceID)
11{
12 base &= 0xFFF80000; // round down to 512k align, to make shure
13
14 WriteByte(serial_handle, base + 0x5555, 0xAA); // enter command mode
15 WriteByte(serial_handle, base + 0x2AAA, 0x55);
16 WriteByte(serial_handle, base + 0x5555, 0x90); // ID command
17 SLEEP(20); // Atmel wants 20ms pause here
18
19 *pManufacturerID = ReadByte(serial_handle, base + 0);
20 *pDeviceID = ReadByte(serial_handle, base + 1);
21
22 WriteByte(serial_handle, base + 0, 0xF0); // reset flash (back to normal read mode)
23 SLEEP(20); // Atmel wants 20ms pause here
24
25 return 0;
26}
27
28
29// erase the sector which contains the given address
30int EraseSector(tUartHandle serial_handle, UINT32 address)
31{
32 UINT32 base = address & 0xFFF80000; // round down to 512k align
33
34 WriteByte(serial_handle, base + 0x5555, 0xAA); // enter command mode
35 WriteByte(serial_handle, base + 0x2AAA, 0x55);
36 WriteByte(serial_handle, base + 0x5555, 0x80); // eraze command
37 WriteByte(serial_handle, base + 0x5555, 0xAA); // enter command mode
38 WriteByte(serial_handle, base + 0x2AAA, 0x55);
39 WriteByte(serial_handle, address, 0x30); // eraze the sector
40 SLEEP(25); // sector eraze time: 25ms
41
42 return 0;
43}
44
45
46// erase the whole flash
47int EraseChip(tUartHandle serial_handle, UINT32 base)
48{
49 base &= 0xFFF80000; // round down to 512k align, to make shure
50
51 WriteByte(serial_handle, base + 0x5555, 0xAA); // enter command mode
52 WriteByte(serial_handle, base + 0x2AAA, 0x55);
53 WriteByte(serial_handle, base + 0x5555, 0x80); // eraze command
54 WriteByte(serial_handle, base + 0x5555, 0xAA); // enter command mode
55 WriteByte(serial_handle, base + 0x2AAA, 0x55);
56 WriteByte(serial_handle, base + 0x5555, 0x10); // chip eraze command
57 SLEEP(100); // chip eraze time: 100ms
58
59 return 0;
60}
61
62
63// program a bunch of bytes "by hand"
64int ProgramBytes(tUartHandle serial_handle, UINT32 address, UINT8* pData, UINT32 size)
65{
66 UINT32 base = address & 0xFFF80000; // round down to 512k align
67
68 while (size--)
69 {
70 WriteByte(serial_handle, base + 0x5555, 0xAA); // enter command mode
71 WriteByte(serial_handle, base + 0x2AAA, 0x55);
72 WriteByte(serial_handle, base + 0x5555, 0xA0); // byte program command
73 WriteByte(serial_handle, address++, *pData++);
74 // UART protocol is slow enough such that I don't have to wait 20us here
75 }
76 return 0;
77}
78
diff --git a/flash/uart_boot/flash.h b/flash/uart_boot/flash.h
deleted file mode 100644
index 9c69ad46a5..0000000000
--- a/flash/uart_boot/flash.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _FLASH_H
2#define _FLASH_H
3
4int ReadID(tUartHandle serial_handle, UINT32 base, UINT8* pManufacturerID, UINT8* pDeviceID);
5int EraseSector(tUartHandle serial_handle, UINT32 address);
6int EraseChip(tUartHandle serial_handle, UINT32 base);
7int ProgramBytes(tUartHandle serial_handle, UINT32 address, UINT8* pData, UINT32 size);
8
9#endif
10
diff --git a/flash/uart_boot/minimon.h b/flash/uart_boot/minimon.h
deleted file mode 100644
index 69a03b1f4d..0000000000
--- a/flash/uart_boot/minimon.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef _MINIMON_H
2#define _MINIMON_H
3
4
5// Commands
6// all multibyte values (address, halfwords) are passed as big endian
7// (most significant of the bytes first)
8
9// set the address (all read/write commands will auto-increment it)
10#define BAUDRATE 0x00 // followed by BRR value; response: command byte
11#define ADDRESS 0x01 // followed by 4 bytes address; response: command byte
12#define BYTE_READ 0x02 // response: 1 byte content
13#define BYTE_WRITE 0x03 // followed by 1 byte content; response: command byte
14#define BYTE_READ16 0x04 // response: 16 bytes content
15#define BYTE_WRITE16 0x05 // followed by 16 bytes; response: command byte
16#define BYTE_FLASH 0x06 // followed by 1 byte content; response: command byte
17#define BYTE_FLASH16 0x07 // followed by 16 bytes; response: command byte
18#define HALFWORD_READ 0x08 // response: 2 byte content
19#define HALFWORD_WRITE 0x09 // followed by 2 byte content; response: command byte
20#define EXECUTE 0x0A // response: command byte if call returns
21
22
23#endif // _MINIMON_H
24
diff --git a/flash/uart_boot/scalar_types.h b/flash/uart_boot/scalar_types.h
deleted file mode 100644
index f3ac1d86eb..0000000000
--- a/flash/uart_boot/scalar_types.h
+++ /dev/null
@@ -1,45 +0,0 @@
1// this is meant to resolve platform dependency
2
3#ifndef _SCALAR_TYPES_H
4#define _SCALAR_TYPES_H
5
6
7#ifdef WIN32
8#include <windows.h>
9#define SLEEP Sleep
10#define GET_LAST_ERR GetLastError
11#endif
12// ToDo: add stuff for Linux
13
14
15
16#ifndef UINT8
17#define UINT8 unsigned char
18#endif
19
20#ifndef UINT16
21#define UINT16 unsigned short
22#endif
23
24#ifndef UINT32
25#define UINT32 unsigned long
26#endif
27
28#ifndef bool
29#define bool int
30#endif
31
32#ifndef true
33#define true 1
34#endif
35
36#ifndef false
37#define false 0
38#endif
39
40
41
42
43
44#endif
45
diff --git a/flash/uart_boot/uart.h b/flash/uart_boot/uart.h
deleted file mode 100644
index a0c10d1a0f..0000000000
--- a/flash/uart_boot/uart.h
+++ /dev/null
@@ -1,57 +0,0 @@
1// A general definition for the required UART functionality.
2// This will be used to gain platform abstraction.
3
4#ifndef _UART_H
5#define _UART_H
6
7// data types
8
9typedef void* tUartHandle;
10#define INVALID_UART_HANDLE (tUartHandle)-1
11
12typedef enum
13{
14 eNOPARITY,
15 eODDPARITY,
16 eEVENPARITY,
17 eMARKPARITY,
18 eSPACEPARITY,
19} tParity;
20
21typedef enum
22{
23 eONESTOPBIT,
24 eONE5STOPBITS,
25 eTWOSTOPBITS,
26} tStopBits;
27
28
29// prototypes
30
31tUartHandle UartOpen( // returns NULL on error
32 char* szPortName); // COMx for windows
33
34bool UartConfig( // returns true on success, false on error
35 tUartHandle handle, // the handle returned from UartOpen()
36 long lBaudRate, // must be one of the "standard" baudrates
37 tParity nParity, // what kind of parity
38 tStopBits nStopBits, // how many stop bits
39 int nByteSize); // size of the "payload", can be 5 to 8
40
41long UartWrite( // returns how much data was actually transmitted
42 tUartHandle handle, // the handle returned from UartOpen()
43 unsigned char* pData, // pointer to the data to be transmitted
44 long lSize); // how many bytes
45
46long UartRead( // returns how much data was actually received
47 tUartHandle handle, // the handle returned from UartOpen()
48 unsigned char* pBuffer, // pointer to the destination
49 long lSize); // how many bytes to read (pBuffer must have enough room)
50
51
52void UartClose(tUartHandle handle);
53
54
55
56#endif // _UART_H
57
diff --git a/flash/uart_boot/uart_boot.c b/flash/uart_boot/uart_boot.c
deleted file mode 100644
index 06750fdbe2..0000000000
--- a/flash/uart_boot/uart_boot.c
+++ /dev/null
@@ -1,370 +0,0 @@
1// uart_boot.cpp : Defines the entry point for the console application.
2//
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7#include "scalar_types.h" // (U)INT8/16/32
8#include "Uart.h" // platform abstraction for UART
9#include "client.h" // client functions
10#include "flash.h" // flash high level functions
11
12// command line configuration: what shall we do?
13static struct
14{
15 char* szPort; // COM port to use
16 bool bRecorder; // it's a recorder
17 bool bArchos; // use the Archos monitor to load, instead of UART boot
18 bool bSpindown; // spindown the harddisk
19 bool bReadID; // read manufacturer+device ID
20 char* szFlashfile; // file to be programmed
21 char* szDumpfile; // file to dump into
22 char* szExecfile; // file with the executable
23 bool bTest; // debug action
24 bool bHold; // hold power (for FMs & V2s)
25 bool bBlink; // blink red LED
26 bool bNoDownload;
27} gCmd;
28
29
30
31int ProcessCmdLine(int argc, char* argv[])
32{
33 argc--; // exclude our name
34 argv++;
35
36 memset(&gCmd, 0, sizeof(gCmd));
37
38 if (argc == 0)
39 {
40 printf("Usage: uart_boot [-option {filename}]\n");
41 printf(" uses activated UART boot mod, box has to be fresh started\n");
42 printf("The order of the options does not matter, one letter is sufficient.\n");
43 printf("Possible options are (in the order of later processing):\n");
44 printf("-port <name of COM port to use>\n");
45 printf("-recorder (this is a recorder/FM, default is player if not specified)\n");
46 printf("-archos (use Archos bootloader, this one needs powerup while program waits)\n");
47 printf("-nodownload (no MiniMon download, it's already active)\n");
48 printf("-hold (hold the power, useful for FMs and V2s, so you can release ON)\n");
49 printf("-spindown (spindown the harddisk, else it stays on by default)\n");
50 printf("-id (read manufacturer and device ID of flash, no checks)\n");
51 printf("-flash <filename of binary to program into flash>\n");
52 printf("-dump <filename to write flash content to>\n");
53 printf("-exec <filename of executable for 0x09000000:0x09000200>\n");
54 printf("-test (some test action currently under development, don't use!)\n");
55 printf("-blink (blink red LED forever, meant as diagnostics)\n");
56 printf("\n");
57 printf("Examples:\n");
58 printf("uart_boot -r -p COM1 -s -f flashfile.bin -d dumpfile.bin\n");
59 printf(" recorder on COM1, spindown HD, program and dump (for e.g. offline verify)\n");
60 printf("uart_boot -r -p COM2 -e rockbox.bin\n");
61 printf(" recorder on COM2, load Rockbox from file and start it\n");
62 exit (0);
63 }
64
65
66 while (argc)
67 {
68 if (!strncmp("-port", *argv, 2))
69 {
70 gCmd.szPort = *++argv;
71 if (--argc <= 0 || **argv == '-')
72 {
73 printf("No argument given for option %s, aborting.\n", argv[-1]);
74 exit (-2);
75 }
76 }
77 else if (!strncmp("-recorder", *argv, 2))
78 {
79 gCmd.bRecorder = true;
80 }
81 else if (!strncmp("-archos", *argv, 2))
82 {
83 gCmd.bArchos = true;
84 }
85 else if (!strncmp("-nodownload", *argv, 2))
86 {
87 gCmd.bNoDownload = true;
88 }
89 else if (!strncmp("-spindown", *argv, 2))
90 {
91 gCmd.bSpindown = true;
92 }
93 else if (!strncmp("-id", *argv, 2))
94 {
95 gCmd.bReadID = true;
96 }
97 else if (!strncmp("-flash", *argv, 2))
98 {
99 gCmd.szFlashfile = *++argv;
100 if (--argc <= 0 || **argv == '-')
101 {
102 printf("No argument given for option %s, aborting.\n", argv[-1]);
103 exit (-2);
104 }
105 }
106 else if (!strncmp("-dump", *argv, 2))
107 {
108 gCmd.szDumpfile = *++argv;
109 if (--argc <= 0 || **argv == '-')
110 {
111 printf("No argument given for option %s, aborting.\n", argv[-1]);
112 exit (-3);
113 }
114 }
115 else if (!strncmp("-exec", *argv, 2))
116 {
117 gCmd.szExecfile = *++argv;
118 if (--argc <= 0 || **argv == '-')
119 {
120 printf("No argument given for option %s, aborting.\n", argv[-1]);
121 exit (-4);
122 }
123 }
124 else if (!strncmp("-test", *argv, 2))
125 {
126 gCmd.bTest = true;
127 }
128 else if (!strncmp("-hold", *argv, 2))
129 {
130 gCmd.bHold = true;
131 }
132 else if (!strncmp("-blink", *argv, 2))
133 {
134 gCmd.bBlink = true;
135 }
136 else
137 {
138 printf("Unknown option %s, aborting. Use 'uart_boot' without options for help.\n", *argv);
139 exit(-1);
140 }
141
142 argv++;
143 argc--;
144 }
145
146 return 0;
147}
148
149
150int main(int argc, char* argv[])
151{
152 tUartHandle serial_handle;
153 UINT16 reg;
154 FILE* pFile;
155 size_t size;
156 static UINT8 abFirmware[256*1024]; // blocksize
157 memset(abFirmware, 0xFF, sizeof(abFirmware));
158
159 ProcessCmdLine(argc, argv); // what to do
160
161 if (!gCmd.szPort)
162 {
163 printf("No serial port given, use 'uart_boot' without parameters for options.\n");
164 exit(-1);
165 }
166
167 serial_handle = UartOpen(gCmd.szPort); // opening serial port
168 if (serial_handle == NULL)
169 {
170 printf("Cannot open port %s\n", gCmd.szPort);
171 return -1;
172 }
173
174 if (gCmd.bNoDownload)
175 { // just set our speed
176 int baudrate = gCmd.bRecorder ? 115200 : 14400;
177 if (!gCmd.bRecorder && gCmd.bTest)
178 { // experimental Player speedup to 38400 baud
179 baudrate = 38400;
180 }
181
182 if (!UartConfig(serial_handle, baudrate, eNOPARITY, eONESTOPBIT, 8))
183 {
184 printf("Error setting up COM params\n");
185 exit(1);
186 }
187 }
188 else
189 { // download the monitor program
190 if (gCmd.bArchos)
191 {
192 printf("Waiting for box startup to download monitor...");
193 DownloadArchosMonitor(serial_handle, "minimon_archos.bin"); // load the monitor image
194 printf("\b\b\b done.\n");
195 }
196 else
197 {
198 printf("Downloading monitor...");
199 DownloadMonitor(serial_handle, gCmd.bRecorder, "minimon.bin"); // load the monitor image
200 // From now on, we can talk to the box.
201 printf("\b\b\b done.\n");
202
203 if (gCmd.bRecorder)
204 { // we can be faster
205 SetTargetBaudrate(serial_handle, 11059200, 115200); // set to 115200
206 }
207 else if (gCmd.bTest) // experimental Player speedup to 38400 baud
208 {
209 SetTargetBaudrate(serial_handle, 12000000, 38400); // set to 38400
210 }
211 }
212 }
213
214
215 // do the action
216 if (gCmd.bHold)
217 {
218 // hold power for FM
219 reg = ReadHalfword(serial_handle, 0x05FFFFC2); // PBDR
220 reg |= 0x0020; // set PB5 to keep power
221 WriteHalfword(serial_handle, 0x05FFFFC2, reg);
222
223 reg = ReadHalfword(serial_handle, 0x05FFFFC6); // PBIOR
224 reg |= 0x0020; // make PB5 an output
225 WriteHalfword(serial_handle, 0x05FFFFC6, reg);
226 printf("Power hold, you can release ON button now.\n");
227 }
228
229
230 if (gCmd.bSpindown)
231 {
232 // power down the disk
233 if (gCmd.bRecorder)
234 { // Recorder (V1+V2) and FM have disk power control on PA5
235 reg = ReadHalfword(serial_handle, 0x05FFFFCA); // PACR2
236 reg &= ~0x0400; // clear bit 10: GPIO
237 WriteHalfword(serial_handle, 0x05FFFFCA, reg);
238
239 reg = ReadHalfword(serial_handle, 0x05FFFFC4); // PAIOR
240 reg |= 0x0020; // set bit 5: output
241 WriteHalfword(serial_handle, 0x05FFFFC4, reg);
242
243 reg = ReadHalfword(serial_handle, 0x05FFFFC0); // PADR
244 reg &= ~0x0020; // clear PA5 to power down
245 WriteHalfword(serial_handle, 0x05FFFFC0, reg);
246 }
247 else
248 { // new Players have disk power control on PB4
249 reg = ReadHalfword(serial_handle, 0x05FFFFC6); // PBIOR
250 reg |= 0x0010; // set bit 4: output
251 WriteHalfword(serial_handle, 0x05FFFFC6, reg);
252
253 reg = ReadHalfword(serial_handle, 0x05FFFFC2); // PBDR
254 reg &= ~0x0010; // clear PB4 to power down
255 WriteHalfword(serial_handle, 0x05FFFFC2, reg);
256 }
257 printf("Harddisk powered down.\n");
258 }
259
260
261 if (gCmd.bReadID)
262 {
263 UINT8 bMan, bID;
264 ReadID(serial_handle, 0x02000000, &bMan, &bID);
265 printf("Manufacturer ID = 0x%02X, Device ID = 0x%02X\n", bMan, bID);
266 }
267
268
269 if (gCmd.szFlashfile)
270 {
271 // flash a firmware file
272 printf("Flashing file %s...", gCmd.szFlashfile);
273 pFile = fopen(gCmd.szFlashfile, "rb");
274 if (pFile == NULL)
275 {
276 printf("\nFlash file %s not found, exiting.\n", gCmd.szFlashfile);
277 return -2;
278 }
279 size = fread(abFirmware, 1, sizeof(abFirmware), pFile);
280 fclose (pFile);
281
282 EraseChip(serial_handle, 0x02000000);
283 FlashByteMultiple(serial_handle, 0x02000000, size, abFirmware);
284 printf("\b\b\b done.\n");
285 }
286
287
288 if (gCmd.szDumpfile)
289 {
290 // dump the flash content
291 printf("Writing flash dump into file %s...", gCmd.szDumpfile);
292 ReadByteMultiple(serial_handle, 0x02000000, sizeof(abFirmware), abFirmware);
293 pFile = fopen(gCmd.szDumpfile, "wb");
294 if (pFile == NULL)
295 {
296 printf("\nDump file %s cannot be opened, exiting.\n", gCmd.szDumpfile);
297 return -3;
298 }
299 fwrite(abFirmware, 1, sizeof(abFirmware), pFile);
300 fclose (pFile);
301 printf("\b\b\b done.\n");
302 }
303
304
305 if (gCmd.szExecfile)
306 {
307 UINT32 size;
308
309 printf("Downloading program...");
310
311 // init the DRAM controller like the flash boot does
312 reg = ReadHalfword(serial_handle, 0x05FFFFCA); // PACR2
313 reg &= 0xFFFB; // PA1 config: /RAS
314 reg |= 0x0008;
315 WriteHalfword(serial_handle, 0x05FFFFCA, reg); // PACR2
316 reg = 0xAFFF; // CS1, CS3 config: /CASH. /CASL
317 WriteHalfword(serial_handle, 0x05FFFFEE, reg); // CASCR
318 reg = ReadHalfword(serial_handle, 0x05FFFFA0); // BCR
319 reg |= 0x8000; // DRAM enable, default bus
320 WriteHalfword(serial_handle, 0x05FFFFA0, reg); // BCR
321 reg = ReadHalfword(serial_handle, 0x05FFFFA2); // WCR1
322 reg &= 0xFDFD; // 1-cycle CAS
323 WriteHalfword(serial_handle, 0x05FFFFA2, reg); // WCR1
324 reg = 0x0E00; // CAS 35%, multiplexed, 10 bit row addr.
325 WriteHalfword(serial_handle, 0x05FFFFA8, reg); // DCR
326 reg = 0x5AB0; // refresh, 4 cycle waitstate
327 WriteHalfword(serial_handle, 0x05FFFFAC, reg); // RCR
328 reg = 0x9605; // refresh constant
329 WriteHalfword(serial_handle, 0x05FFFFB2, reg); // RTCOR
330 reg = 0xA518; // phi/32
331 WriteHalfword(serial_handle, 0x05FFFFAE, reg); // RTCSR
332
333
334 // download Rockbox/gdb
335 pFile = fopen(gCmd.szExecfile, "rb");
336 if (pFile == NULL)
337 {
338 printf("\nExecutable file %s cannot be opened, exiting.\n", gCmd.szExecfile);
339 return -3;
340 }
341
342 size = fread(abFirmware, 1, sizeof(abFirmware), pFile);
343 WriteByteMultiple(serial_handle, 0x09000000, size, abFirmware);
344 fclose (pFile);
345 printf("\b\b\b done.\n");
346
347 // start rockbox/gdb
348 printf("Starting program...");
349 Execute(serial_handle, 0x09000200, false);
350 printf("\b\b\b done.\n");
351 }
352
353
354 if (gCmd.bBlink)
355 {
356 // blinking LED
357 UINT8 byte;
358 printf("Flashing red LED forever... (stop with Ctrl-C)\n");
359 byte = ReadByte(serial_handle, 0x05FFFFC3);
360 while (1)
361 {
362 byte ^= 0x40;
363 WriteByte(serial_handle, 0x05FFFFC3, byte);
364 Sleep(200);
365 }
366 }
367
368 return 0;
369}
370
diff --git a/flash/uart_boot/uart_boot.dsp b/flash/uart_boot/uart_boot.dsp
deleted file mode 100644
index 4d94c72530..0000000000
--- a/flash/uart_boot/uart_boot.dsp
+++ /dev/null
@@ -1,130 +0,0 @@
1# Microsoft Developer Studio Project File - Name="uart_boot" - Package Owner=<4>
2# Microsoft Developer Studio Generated Build File, Format Version 6.00
3# ** DO NOT EDIT **
4
5# TARGTYPE "Win32 (x86) Console Application" 0x0103
6
7CFG=uart_boot - Win32 Debug
8!MESSAGE This is not a valid makefile. To build this project using NMAKE,
9!MESSAGE use the Export Makefile command and run
10!MESSAGE
11!MESSAGE NMAKE /f "uart_boot.mak".
12!MESSAGE
13!MESSAGE You can specify a configuration when running NMAKE
14!MESSAGE by defining the macro CFG on the command line. For example:
15!MESSAGE
16!MESSAGE NMAKE /f "uart_boot.mak" CFG="uart_boot - Win32 Debug"
17!MESSAGE
18!MESSAGE Possible choices for configuration are:
19!MESSAGE
20!MESSAGE "uart_boot - Win32 Release" (based on "Win32 (x86) Console Application")
21!MESSAGE "uart_boot - Win32 Debug" (based on "Win32 (x86) Console Application")
22!MESSAGE
23
24# Begin Project
25# PROP AllowPerConfigDependencies 0
26# PROP Scc_ProjName ""
27# PROP Scc_LocalPath ""
28CPP=cl.exe
29RSC=rc.exe
30
31!IF "$(CFG)" == "uart_boot - Win32 Release"
32
33# PROP BASE Use_MFC 0
34# PROP BASE Use_Debug_Libraries 0
35# PROP BASE Output_Dir "Release"
36# PROP BASE Intermediate_Dir "Release"
37# PROP BASE Target_Dir ""
38# PROP Use_MFC 0
39# PROP Use_Debug_Libraries 0
40# PROP Output_Dir "Release"
41# PROP Intermediate_Dir "Release"
42# PROP Target_Dir ""
43# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
44# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /c
45# SUBTRACT CPP /YX /Yc /Yu
46# ADD BASE RSC /l 0x407 /d "NDEBUG"
47# ADD RSC /l 0x407 /d "NDEBUG"
48BSC32=bscmake.exe
49# ADD BASE BSC32 /nologo
50# ADD BSC32 /nologo
51LINK32=link.exe
52# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
53# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
54
55!ELSEIF "$(CFG)" == "uart_boot - Win32 Debug"
56
57# PROP BASE Use_MFC 0
58# PROP BASE Use_Debug_Libraries 1
59# PROP BASE Output_Dir "Debug"
60# PROP BASE Intermediate_Dir "Debug"
61# PROP BASE Target_Dir ""
62# PROP Use_MFC 0
63# PROP Use_Debug_Libraries 1
64# PROP Output_Dir "Debug"
65# PROP Intermediate_Dir "Debug"
66# PROP Target_Dir ""
67# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
68# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /FD /GZ /c
69# SUBTRACT CPP /YX /Yc /Yu
70# ADD BASE RSC /l 0x407 /d "_DEBUG"
71# ADD RSC /l 0x407 /d "_DEBUG"
72BSC32=bscmake.exe
73# ADD BASE BSC32 /nologo
74# ADD BSC32 /nologo
75LINK32=link.exe
76# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
77# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
78
79!ENDIF
80
81# Begin Target
82
83# Name "uart_boot - Win32 Release"
84# Name "uart_boot - Win32 Debug"
85# Begin Group "Source Files"
86
87# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
88# Begin Source File
89
90SOURCE=.\client.c
91# End Source File
92# Begin Source File
93
94SOURCE=.\flash.c
95# End Source File
96# Begin Source File
97
98SOURCE=.\uart_boot.c
99# End Source File
100# Begin Source File
101
102SOURCE=.\uart_win.c
103# End Source File
104# End Group
105# Begin Group "Header Files"
106
107# PROP Default_Filter "h;hpp;hxx;hm;inl"
108# Begin Source File
109
110SOURCE=.\client.h
111# End Source File
112# Begin Source File
113
114SOURCE=.\flash.h
115# End Source File
116# Begin Source File
117
118SOURCE=.\minimon.h
119# End Source File
120# Begin Source File
121
122SOURCE=.\scalar_types.h
123# End Source File
124# Begin Source File
125
126SOURCE=.\uart.h
127# End Source File
128# End Group
129# End Target
130# End Project
diff --git a/flash/uart_boot/uart_win.c b/flash/uart_boot/uart_win.c
deleted file mode 100644
index 6e82e9580c..0000000000
--- a/flash/uart_boot/uart_win.c
+++ /dev/null
@@ -1,139 +0,0 @@
1// UART wrapper implementation for the Win32 platform
2// make a new version of this file for different systems, e.g. Linux
3
4#include <windows.h>
5#include "scalar_types.h" // (U)INT8/16/32
6#include "Uart.h"
7
8// COMx for windows, returns NULL on error
9tUartHandle UartOpen(char* szPortName)
10{
11 HANDLE serial_handle;
12 DCB dcb;
13 COMMTIMEOUTS cto = { 0, 0, 0, 0, 0 };
14
15 memset(&dcb,0,sizeof(dcb));
16
17 /* -------------------------------------------------------------------- */
18 // set DCB to configure the serial port
19 dcb.DCBlength = sizeof(dcb);
20
21 dcb.fOutxCtsFlow = 0;
22 dcb.fOutxDsrFlow = 0;
23 dcb.fDtrControl = DTR_CONTROL_ENABLE; // enable for power
24 dcb.fDsrSensitivity = 0;
25 dcb.fRtsControl = RTS_CONTROL_ENABLE; // enable for power
26 dcb.fOutX = 0;
27 dcb.fInX = 0;
28
29 /* ----------------- misc parameters ----- */
30 dcb.fErrorChar = 0;
31 dcb.fBinary = 1;
32 dcb.fNull = 0;
33 dcb.fAbortOnError = 0;
34 dcb.wReserved = 0;
35 dcb.XonLim = 2;
36 dcb.XoffLim = 4;
37 dcb.XonChar = 0x13;
38 dcb.XoffChar = 0x19;
39 dcb.EvtChar = 0;
40
41 /* ----------------- defaults ----- */
42 dcb.BaudRate = 4800;
43 dcb.Parity = NOPARITY;
44 dcb.fParity = 0;
45 dcb.StopBits = ONESTOPBIT;
46 dcb.ByteSize = 8;
47
48
49 /* -------------------------------------------------------------------- */
50 // opening serial port
51 serial_handle = CreateFile(szPortName, GENERIC_READ | GENERIC_WRITE,
52 0, NULL, OPEN_EXISTING, FILE_FLAG_WRITE_THROUGH, NULL);
53
54 if (serial_handle == INVALID_HANDLE_VALUE)
55 {
56 //printf("Cannot open port \n");
57 return NULL;
58 }
59
60 SetCommMask(serial_handle, 0);
61 SetCommTimeouts(serial_handle, &cto);
62
63 if(!SetCommState(serial_handle, &dcb))
64 {
65 //printf("Error setting up COM params\n");
66 CloseHandle(serial_handle);
67 return NULL;
68 }
69
70 return serial_handle;
71}
72
73// returns true on success, false on error
74bool UartConfig(tUartHandle handle, long lBaudRate, tParity nParity, tStopBits nStopBits, int nByteSize)
75{
76 DCB dcb;
77
78 if (!GetCommState (handle, &dcb))
79 {
80 return false;
81 }
82
83 dcb.BaudRate = lBaudRate;
84 dcb.Parity = nParity;
85 dcb.StopBits = nStopBits;
86 dcb.ByteSize = nByteSize;
87
88 if(!SetCommState(handle, &dcb))
89 {
90 //DWORD dwErr = GetLastError();
91 //printf("Error %d setting up COM params for baudrate byte\n", dwErr);
92 return false;
93 }
94
95 return true;
96}
97
98// returns how much data was actually transmitted
99long UartWrite(tUartHandle handle, unsigned char* pData, long lSize)
100{
101 BOOL success;
102 DWORD result_nbr;
103
104 success = WriteFile(handle, pData, lSize, &result_nbr, NULL);
105
106 if(!success)
107 {
108 return 0;
109 }
110
111 return result_nbr;
112}
113
114// returns how much data was actually received
115long UartRead(tUartHandle handle, unsigned char* pBuffer, long lSize)
116{
117 BOOL success;
118 DWORD read_nbr;
119
120 success = ReadFile(handle, pBuffer, lSize, &read_nbr, NULL);
121 if(!success)
122 {
123 return 0;
124 }
125
126 return read_nbr;
127}
128
129
130void UartClose(tUartHandle handle)
131{
132 if (handle != NULL)
133 {
134 CloseHandle(handle);
135 }
136
137 return;
138}
139
diff --git a/gdb/Makefile b/gdb/Makefile
index 0cd9990cd1..cf24a77cee 100644
--- a/gdb/Makefile
+++ b/gdb/Makefile
@@ -61,41 +61,4 @@ clean:
61 61
62-include $(DEPFILE) 62-include $(DEPFILE)
63 63
64else # not ifp7xx
65
66ifdef RECORDER
67EXTRA = -DRECORDER
68EXT = ajz
69else
70EXT = mod
71endif
72
73TARGET = stub
74OBJS = start.o sh-stub.o setjmp.o
75LIBS = -lgcc
76
77.s.o:
78 sh-elf-as -o $@ $<
79
80.c.o:
81 sh-elf-gcc -O $(EXTRA) -I../firmware/export -I../firmware/include -m1 -Wall -Wstrict-prototypes -c -o $@ $<
82
83.S.o:
84 sh-elf-gcc -O -I../firmware/export -I../firmware/include -m1 -Wall -Wstrict-prototypes -c -o $@ $<
85
86$(TARGET).$(EXT): $(TARGET).elf
87 sh-elf-objcopy -O binary $(TARGET).elf $(TARGET).out
88 ../tools/scramble $(TARGET).out $(TARGET).$(EXT)
89 ../tools/sh2d $(TARGET).out -o 09000000 > $(TARGET).asm
90
91$(TARGET).elf: $(OBJS)
92 sh-elf-gcc -nostartfiles $(OBJS) -nostdlib -Wl,-Map,$(TARGET).map -o $(TARGET).elf -Tlinker.cfg
93
94clean:
95 rm $(OBJS) $(TARGET).map $(TARGET).elf $(TARGET).out $(TARGET).mod $(TARGET).ajz
96
97start.o: start.s
98sh-stub.o: sh-stub.c
99setjmp.o: setjmp.S
100
101endif 64endif
diff --git a/gdb/sh-stub.c b/gdb/sh-stub.c
deleted file mode 100644
index 9daca39f72..0000000000
--- a/gdb/sh-stub.c
+++ /dev/null
@@ -1,1618 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21/* sh-stub.c -- debugging stub for the Hitachi-SH.
22
23 NOTE!! This code has to be compiled with optimization, otherwise the
24 function inlining which generates the exception handlers won't work.
25
26*/
27
28/* This is originally based on an m68k software stub written by Glenn
29 Engel at HP, but has changed quite a bit.
30
31 Modifications for the SH by Ben Lee and Steve Chamberlain
32
33 Even more modifications for GCC 3.0 and The Rockbox by Linus
34 Nielsen Feltzing
35*/
36
37/****************************************************************************
38
39 THIS SOFTWARE IS NOT COPYRIGHTED
40
41 HP offers the following for use in the public domain. HP makes no
42 warranty with regard to the software or it's performance and the
43 user accepts the software "AS IS" with all faults.
44
45 HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD
46 TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES
47 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
48
49****************************************************************************/
50
51
52/* Remote communication protocol.
53
54 A debug packet whose contents are <data>
55 is encapsulated for transmission in the form:
56
57 $ <data> # CSUM1 CSUM2
58
59 <data> must be ASCII alphanumeric and cannot include characters
60 '$' or '#'. If <data> starts with two characters followed by
61 ':', then the existing stubs interpret this as a sequence number.
62
63 CSUM1 and CSUM2 are ascii hex representation of an 8-bit
64 checksum of <data>, the most significant nibble is sent first.
65 the hex digits 0-9,a-f are used.
66
67 Receiver responds with:
68
69 + - if CSUM is correct and ready for next packet
70 - - if CSUM is incorrect
71
72 <data> is as follows:
73 All values are encoded in ascii hex digits.
74
75 Request Packet
76
77 read registers g
78 reply XX....X Each byte of register data
79 is described by two hex digits.
80 Registers are in the internal order
81 for GDB, and the bytes in a register
82 are in the same order the machine uses.
83 or ENN for an error.
84
85 write regs GXX..XX Each byte of register data
86 is described by two hex digits.
87 reply OK for success
88 ENN for an error
89
90 write reg Pn...=r... Write register n... with value r...,
91 which contains two hex digits for each
92 byte in the register (target byte
93 order).
94 reply OK for success
95 ENN for an error
96 (not supported by all stubs).
97
98 read mem mAA..AA,LLLL AA..AA is address, LLLL is length.
99 reply XX..XX XX..XX is mem contents
100 Can be fewer bytes than requested
101 if able to read only part of the data.
102 or ENN NN is errno
103
104 write mem MAA..AA,LLLL:XX..XX
105 AA..AA is address,
106 LLLL is number of bytes,
107 XX..XX is data
108 reply OK for success
109 ENN for an error (this includes the case
110 where only part of the data was
111 written).
112
113 cont cAA..AA AA..AA is address to resume
114 If AA..AA is omitted,
115 resume at same address.
116
117 step sAA..AA AA..AA is address to resume
118 If AA..AA is omitted,
119 resume at same address.
120
121 last signal ? Reply the current reason for stopping.
122 This is the same reply as is generated
123 for step or cont : SAA where AA is the
124 signal number.
125
126 There is no immediate reply to step or cont.
127 The reply comes when the machine stops.
128 It is SAA AA is the "signal number"
129
130 or... TAAn...:r...;n:r...;n...:r...;
131 AA = signal number
132 n... = register number
133 r... = register contents
134 or... WAA The process exited, and AA is
135 the exit status. This is only
136 applicable for certains sorts of
137 targets.
138 kill request k
139
140 toggle debug d toggle debug flag (see 386 & 68k stubs)
141 reset r reset -- see sparc stub.
142 reserved <other> On other requests, the stub should
143 ignore the request and send an empty
144 response ($#<checksum>). This way
145 we can extend the protocol and GDB
146 can tell whether the stub it is
147 talking to uses the old or the new.
148 search tAA:PP,MM Search backwards starting at address
149 AA for a match with pattern PP and
150 mask MM. PP and MM are 4 bytes.
151 Not supported by all stubs.
152
153 general query qXXXX Request info about XXXX.
154 general set QXXXX=yyyy Set value of XXXX to yyyy.
155 query sect offs qOffsets Get section offsets. Reply is
156 Text=xxx;Data=yyy;Bss=zzz
157 console output Otext Send text to stdout. Only comes from
158 remote target.
159
160 Responses can be run-length encoded to save space. A '*' means that
161 the next character is an ASCII encoding giving a repeat count which
162 stands for that many repititions of the character preceding the '*'.
163 The encoding is n+29, yielding a printable character where n >=3
164 (which is where rle starts to win). Don't use an n > 126.
165
166 So
167 "0* " means the same as "0000". */
168
169#include "sh7034.h"
170#include <string.h>
171
172typedef int jmp_buf[20];
173
174void longjmp(jmp_buf __jmpb, int __retval);
175int setjmp(jmp_buf __jmpb);
176
177/* We need to undefine this from the sh7034.h file */
178#undef GBR
179
180/* Hitachi SH architecture instruction encoding masks */
181
182#define COND_BR_MASK 0xff00
183#define UCOND_DBR_MASK 0xe000
184#define UCOND_RBR_MASK 0xf0df
185#define TRAPA_MASK 0xff00
186
187#define COND_DISP 0x00ff
188#define UCOND_DISP 0x0fff
189#define UCOND_REG 0x0f00
190
191/* Hitachi SH instruction opcodes */
192
193#define BF_INSTR 0x8b00
194#define BT_INSTR 0x8900
195#define BRA_INSTR 0xa000
196#define BSR_INSTR 0xb000
197#define JMP_INSTR 0x402b
198#define JSR_INSTR 0x400b
199#define RTS_INSTR 0x000b
200#define RTE_INSTR 0x002b
201#define TRAPA_INSTR 0xc300
202#define SSTEP_INSTR 0xc37f
203
204/* Hitachi SH processor register masks */
205
206#define T_BIT_MASK 0x0001
207
208/*
209 * BUFMAX defines the maximum number of characters in inbound/outbound
210 * buffers. At least NUMREGBYTES*2 are needed for register packets.
211 */
212#define BUFMAX 1024
213
214/*
215 * Number of bytes for registers
216 */
217#define NUMREGBYTES 112 /* 92 */
218
219/*
220 * Forward declarations
221 */
222
223static int hex (char);
224static char *mem2hex (char *mem, char *buf, int count);
225static char *hex2mem (char *buf, char *mem, int count);
226static int hex2int (char **ptr, int *intValue);
227static unsigned char *getpacket (void);
228static void putpacket (register char *buffer);
229static int computeSignal (int exceptionVector);
230void handle_buserror (void);
231void handle_exception (int exceptionVector);
232void init_serial(void);
233
234void serial_putc (char ch);
235char serial_getc (void);
236
237/* These are in the file but in asm statements so the compiler can't see them */
238void catch_exception_4 (void);
239void catch_exception_5 (void);
240void catch_exception_6 (void);
241void catch_exception_7 (void);
242void catch_exception_8 (void);
243void catch_exception_9 (void);
244void catch_exception_10 (void);
245void catch_exception_11 (void);
246void catch_exception_12 (void);
247void catch_exception_13 (void);
248void catch_exception_14 (void);
249void catch_exception_15 (void);
250void catch_exception_16 (void);
251void catch_exception_17 (void);
252void catch_exception_18 (void);
253void catch_exception_19 (void);
254void catch_exception_20 (void);
255void catch_exception_21 (void);
256void catch_exception_22 (void);
257void catch_exception_23 (void);
258void catch_exception_24 (void);
259void catch_exception_25 (void);
260void catch_exception_26 (void);
261void catch_exception_27 (void);
262void catch_exception_28 (void);
263void catch_exception_29 (void);
264void catch_exception_30 (void);
265void catch_exception_31 (void);
266void catch_exception_32 (void);
267void catch_exception_33 (void);
268void catch_exception_34 (void);
269void catch_exception_35 (void);
270void catch_exception_36 (void);
271void catch_exception_37 (void);
272void catch_exception_38 (void);
273void catch_exception_39 (void);
274void catch_exception_40 (void);
275void catch_exception_41 (void);
276void catch_exception_42 (void);
277void catch_exception_43 (void);
278void catch_exception_44 (void);
279void catch_exception_45 (void);
280void catch_exception_46 (void);
281void catch_exception_47 (void);
282void catch_exception_48 (void);
283void catch_exception_49 (void);
284void catch_exception_50 (void);
285void catch_exception_51 (void);
286void catch_exception_52 (void);
287void catch_exception_53 (void);
288void catch_exception_54 (void);
289void catch_exception_55 (void);
290void catch_exception_56 (void);
291void catch_exception_57 (void);
292void catch_exception_58 (void);
293void catch_exception_59 (void);
294void catch_exception_60 (void);
295void catch_exception_61 (void);
296void catch_exception_62 (void);
297void catch_exception_63 (void);
298void catch_exception_64 (void);
299void catch_exception_65 (void);
300void catch_exception_66 (void);
301void catch_exception_67 (void);
302void catch_exception_68 (void);
303void catch_exception_69 (void);
304void catch_exception_70 (void);
305void catch_exception_71 (void);
306void catch_exception_72 (void);
307void catch_exception_73 (void);
308void catch_exception_74 (void);
309void catch_exception_75 (void);
310void catch_exception_76 (void);
311void catch_exception_77 (void);
312void catch_exception_78 (void);
313void catch_exception_79 (void);
314void catch_exception_80 (void);
315void catch_exception_81 (void);
316void catch_exception_82 (void);
317void catch_exception_83 (void);
318void catch_exception_84 (void);
319void catch_exception_85 (void);
320void catch_exception_86 (void);
321void catch_exception_87 (void);
322void catch_exception_88 (void);
323void catch_exception_89 (void);
324void catch_exception_90 (void);
325void catch_exception_91 (void);
326void catch_exception_92 (void);
327void catch_exception_93 (void);
328void catch_exception_94 (void);
329void catch_exception_95 (void);
330void catch_exception_96 (void);
331void catch_exception_97 (void);
332void catch_exception_98 (void);
333void catch_exception_99 (void);
334void catch_exception_100 (void);
335void catch_exception_101 (void);
336void catch_exception_102 (void);
337void catch_exception_103 (void);
338void catch_exception_104 (void);
339void catch_exception_105 (void);
340void catch_exception_106 (void);
341void catch_exception_107 (void);
342void catch_exception_108 (void);
343void catch_exception_109 (void);
344void catch_exception_110 (void);
345void catch_exception_111 (void);
346void catch_exception_112 (void);
347void catch_exception_113 (void);
348void catch_exception_114 (void);
349void catch_exception_115 (void);
350void catch_exception_116 (void);
351void catch_exception_117 (void);
352void catch_exception_118 (void);
353void catch_exception_119 (void);
354void catch_exception_120 (void);
355void catch_exception_121 (void);
356void catch_exception_122 (void);
357void catch_exception_123 (void);
358void catch_exception_124 (void);
359void catch_exception_125 (void);
360void catch_exception_126 (void);
361void catch_exception_127 (void);
362
363void breakpoint (void);
364
365
366//#define stub_stack_size 2*1024
367
368//int stub_stack[stub_stack_size] __attribute__ ((section (".stack"))) = {0};
369
370extern int stub_stack[];
371
372void INIT (void);
373void start (void);
374
375#define CPU_BUS_ERROR_VEC 9
376#define DMA_BUS_ERROR_VEC 10
377#define NMI_VEC 11
378#define INVALID_INSN_VEC 4
379#define INVALID_SLOT_VEC 6
380#define TRAP_VEC 32
381#define IO_VEC 33
382#define USER_VEC 127
383
384static char in_nmi; /* Set when handling an NMI, so we don't reenter */
385static int dofault; /* Non zero, bus errors will raise exception */
386
387static int *stub_sp;
388
389/* debug > 0 prints ill-formed commands in valid packets & checksum errors */
390static int remote_debug;
391
392/* jump buffer used for setjmp/longjmp */
393static jmp_buf remcomEnv;
394
395enum regnames
396{
397 R0, R1, R2, R3, R4, R5, R6, R7,
398 R8, R9, R10, R11, R12, R13, R14,
399 R15, PC, PR, GBR, VBR, MACH, MACL, SR,
400 TICKS, STALLS, CYCLES, INSTS, PLR
401};
402
403typedef struct
404{
405 short *memAddr;
406 short oldInstr;
407}
408stepData;
409
410static int registers[NUMREGBYTES / 4];
411static stepData instrBuffer;
412static char stepped;
413static const char hexchars[] = "0123456789abcdef";
414static char remcomInBuffer[BUFMAX];
415static char remcomOutBuffer[BUFMAX];
416
417#define ATA_NSECTOR (*((volatile unsigned char*)0x06100102))
418#define ATA_COMMAND (*((volatile unsigned char*)0x06100107))
419
420/* You may need to change this depending on your ATA I/O address
421** 0x200 - 0x06200206
422** 0x300 - 0x06200306
423*/
424#define ATA_CONTROL (*((volatile unsigned char*)0x06200206))
425#define ATA_ALT_STATUS ATA_CONTROL
426
427#define STATUS_BSY 0x80
428#define STATUS_RDY 0x40
429
430#define CMD_STANDBY_IMMEDIATE 0xE0
431#define CMD_STANDBY 0xE2
432
433void ata_wait_for_bsy(void)
434{
435 while (ATA_ALT_STATUS & STATUS_BSY);
436}
437
438int ata_wait_for_rdy(void)
439{
440 ata_wait_for_bsy();
441 return ATA_ALT_STATUS & STATUS_RDY;
442}
443
444int ata_spindown(int time)
445{
446 /* Port A setup */
447 PAIOR |= 0x0280; /* output for ATA reset, IDE enable */
448 PADR |= 0x0200; /* release ATA reset */
449 PACR2 &= 0xBFFF; /* GPIO function for PA7 (IDE enable) */
450
451 /* activate ATA */
452 PADR &= ~0x80;
453
454 if(!ata_wait_for_rdy())
455 return -1;
456
457 if ( time == -1 ) {
458 ATA_COMMAND = CMD_STANDBY_IMMEDIATE;
459 }
460 else {
461 if (time > 255)
462 return -1;
463 ATA_NSECTOR = time & 0xff;
464 ATA_COMMAND = CMD_STANDBY;
465 }
466
467 if (!ata_wait_for_rdy())
468 return -1;
469
470 return 0;
471}
472
473void blink(void)
474{
475 while(1)
476 {
477 int i;
478 PBDR ^= 0x40; /* toggle PB6 */
479 for(i = 0;i < 500000;i++)
480 {
481 }
482 }
483}
484
485char highhex(int x)
486{
487 return hexchars[(x >> 4) & 0xf];
488}
489
490char lowhex(int x)
491{
492 return hexchars[x & 0xf];
493}
494
495/*
496 * Assembly macros
497 */
498
499#define BREAKPOINT() asm("trapa #0x20"::);
500
501
502/*
503 * Routines to handle hex data
504 */
505
506static int hex (char ch)
507{
508 if ((ch >= 'a') && (ch <= 'f'))
509 return (ch - 'a' + 10);
510 if ((ch >= '0') && (ch <= '9'))
511 return (ch - '0');
512 if ((ch >= 'A') && (ch <= 'F'))
513 return (ch - 'A' + 10);
514 return (-1);
515}
516
517/* convert the memory, pointed to by mem into hex, placing result in buf */
518/* return a pointer to the last char put in buf (null) */
519static char *mem2hex (char *mem, char *buf, int count)
520{
521 int i;
522 int ch;
523 for (i = 0; i < count; i++)
524 {
525 ch = *mem++;
526 *buf++ = highhex (ch);
527 *buf++ = lowhex (ch);
528 }
529 *buf = 0;
530 return (buf);
531}
532
533/* convert the hex array pointed to by buf into binary, to be placed in mem */
534/* return a pointer to the character after the last byte written */
535static char *hex2mem (char *buf, char *mem, int count)
536{
537 int i;
538 unsigned char ch;
539 for (i = 0; i < count; i++)
540 {
541 ch = hex (*buf++) << 4;
542 ch = ch + hex (*buf++);
543 *mem++ = ch;
544 }
545 return (mem);
546}
547
548/**********************************************/
549/* WHILE WE FIND NICE HEX CHARS, BUILD AN INT */
550/* RETURN NUMBER OF CHARS PROCESSED */
551/**********************************************/
552static int hex2int (char **ptr, int *intValue)
553{
554 int numChars = 0;
555 int hexValue;
556
557 *intValue = 0;
558
559 while (**ptr)
560 {
561 hexValue = hex (**ptr);
562 if (hexValue >= 0)
563 {
564 *intValue = (*intValue << 4) | hexValue;
565 numChars++;
566 }
567 else
568 break;
569
570 (*ptr)++;
571 }
572
573 return (numChars);
574}
575
576/*
577 * Routines to get and put packets
578 */
579
580/* scan for the sequence $<data>#<checksum> */
581
582unsigned char *getpacket (void)
583{
584 unsigned char *buffer = &remcomInBuffer[0];
585 unsigned char checksum;
586 unsigned char xmitcsum;
587 int count;
588 char ch;
589
590 while (1)
591 {
592 /* wait around for the start character, ignore all other characters */
593 while ((ch = serial_getc ()) != '$')
594 ;
595
596 retry:
597 checksum = 0;
598 xmitcsum = -1;
599 count = 0;
600
601 /* now, read until a # or end of buffer is found */
602 while (count < BUFMAX)
603 {
604 ch = serial_getc ();
605 if (ch == '$')
606 goto retry;
607 if (ch == '#')
608 break;
609 checksum = checksum + ch;
610 buffer[count] = ch;
611 count = count + 1;
612 }
613 buffer[count] = 0;
614
615 if (ch == '#')
616 {
617 ch = serial_getc ();
618 xmitcsum = hex (ch) << 4;
619 ch = serial_getc ();
620 xmitcsum += hex (ch);
621
622 if (checksum != xmitcsum)
623 {
624 serial_putc ('-'); /* failed checksum */
625 }
626 else
627 {
628 serial_putc ('+'); /* successful transfer */
629
630 /* if a sequence char is present, reply the sequence ID */
631 if (buffer[2] == ':')
632 {
633 serial_putc (buffer[0]);
634 serial_putc (buffer[1]);
635
636 return &buffer[3];
637 }
638
639 return &buffer[0];
640 }
641 }
642 }
643}
644
645
646/* send the packet in buffer. */
647
648static void putpacket (register char *buffer)
649{
650 register int checksum;
651
652 /* $<packet info>#<checksum>. */
653 do
654 {
655 char *src = buffer;
656 serial_putc ('$');
657 checksum = 0;
658
659 while (*src)
660 {
661 int runlen;
662
663 /* Do run length encoding */
664 for (runlen = 0; runlen < 100; runlen ++)
665 {
666 if (src[0] != src[runlen] || runlen == 99)
667 {
668 if (runlen > 3)
669 {
670 int encode;
671 /* Got a useful amount */
672 serial_putc (*src);
673 checksum += *src;
674 serial_putc ('*');
675 checksum += '*';
676 checksum += (encode = runlen + ' ' - 4);
677 serial_putc (encode);
678 src += runlen;
679 }
680 else
681 {
682 serial_putc (*src);
683 checksum += *src;
684 src++;
685 }
686 break;
687 }
688 }
689 }
690
691
692 serial_putc ('#');
693 serial_putc (highhex(checksum));
694 serial_putc (lowhex(checksum));
695 }
696 while (serial_getc() != '+');
697}
698
699
700/* a bus error has occurred, perform a longjmp
701 to return execution and allow handling of the error */
702
703void handle_buserror (void)
704{
705 longjmp (remcomEnv, 1);
706}
707
708#define SIGINT 2 /* interrupt */
709#define SIGILL 4 /* illegal instruction (not reset when caught) */
710#define SIGTRAP 5 /* trace trap (not reset when caught) */
711#define SIGEMT 7 /* EMT instruction */
712#define SIGBUS 10 /* bus error */
713
714/*
715 * this function takes the SH-1 exception number and attempts to
716 * translate this number into a unix compatible signal value
717 */
718static int computeSignal (int exceptionVector)
719{
720 int sigval;
721 switch (exceptionVector)
722 {
723 case INVALID_INSN_VEC:
724 sigval = SIGILL;
725 break;
726 case INVALID_SLOT_VEC:
727 sigval = SIGILL;
728 break;
729 case CPU_BUS_ERROR_VEC:
730 sigval = SIGBUS;
731 break;
732 case DMA_BUS_ERROR_VEC:
733 sigval = SIGBUS;
734 break;
735 case NMI_VEC:
736 sigval = SIGINT;
737 break;
738
739 case TRAP_VEC:
740 case USER_VEC:
741 sigval = SIGTRAP;
742 break;
743
744 default:
745 sigval = SIGEMT; /* "software generated"*/
746 break;
747 }
748 return (sigval);
749}
750
751void doSStep (void)
752{
753 short *instrMem;
754 int displacement;
755 int reg;
756 unsigned short opcode;
757
758 instrMem = (short *) registers[PC];
759
760 opcode = *instrMem;
761 stepped = 1;
762
763 if ((opcode & COND_BR_MASK) == BT_INSTR)
764 {
765 if (registers[SR] & T_BIT_MASK)
766 {
767 displacement = (opcode & COND_DISP) << 1;
768 if (displacement & 0x80)
769 displacement |= 0xffffff00;
770 /*
771 * Remember PC points to second instr.
772 * after PC of branch ... so add 4
773 */
774 instrMem = (short *) (registers[PC] + displacement + 4);
775 }
776 else
777 instrMem += 1;
778 }
779 else if ((opcode & COND_BR_MASK) == BF_INSTR)
780 {
781 if (registers[SR] & T_BIT_MASK)
782 instrMem += 1;
783 else
784 {
785 displacement = (opcode & COND_DISP) << 1;
786 if (displacement & 0x80)
787 displacement |= 0xffffff00;
788 /*
789 * Remember PC points to second instr.
790 * after PC of branch ... so add 4
791 */
792 instrMem = (short *) (registers[PC] + displacement + 4);
793 }
794 }
795 else if ((opcode & UCOND_DBR_MASK) == BRA_INSTR)
796 {
797 displacement = (opcode & UCOND_DISP) << 1;
798 if (displacement & 0x0800)
799 displacement |= 0xfffff000;
800
801 /*
802 * Remember PC points to second instr.
803 * after PC of branch ... so add 4
804 */
805 instrMem = (short *) (registers[PC] + displacement + 4);
806 }
807 else if ((opcode & UCOND_RBR_MASK) == JSR_INSTR)
808 {
809 reg = (char) ((opcode & UCOND_REG) >> 8);
810
811 instrMem = (short *) registers[reg];
812 }
813 else if (opcode == RTS_INSTR)
814 instrMem = (short *) registers[PR];
815 else if (opcode == RTE_INSTR)
816 instrMem = (short *) registers[15];
817 else if ((opcode & TRAPA_MASK) == TRAPA_INSTR)
818 instrMem = (short *) ((opcode & ~TRAPA_MASK) << 2);
819 else
820 instrMem += 1;
821
822 instrBuffer.memAddr = instrMem;
823 instrBuffer.oldInstr = *instrMem;
824 *instrMem = SSTEP_INSTR;
825}
826
827
828/* Undo the effect of a previous doSStep. If we single stepped,
829 restore the old instruction. */
830void undoSStep (void)
831{
832 if (stepped)
833 {
834 short *instrMem;
835 instrMem = instrBuffer.memAddr;
836 *instrMem = instrBuffer.oldInstr;
837 }
838 stepped = 0;
839}
840
841/*
842 * This function does all exception handling. It only does two things -
843 * it figures out why it was called and tells gdb, and then it reacts
844 * to gdb's requests.
845 *
846*/
847void gdb_handle_exception (int exceptionVector)
848{
849 int sigval, stepping;
850 int addr, length;
851 char *ptr;
852
853 /* reply to host that an exception has occurred */
854 sigval = computeSignal (exceptionVector);
855 remcomOutBuffer[0] = 'S';
856 remcomOutBuffer[1] = highhex(sigval);
857 remcomOutBuffer[2] = lowhex (sigval);
858 remcomOutBuffer[3] = 0;
859
860 putpacket (remcomOutBuffer);
861
862 /*
863 * exception 127 indicates a software trap
864 * inserted in place of code ... so back up
865 * PC by one instruction, since this instruction
866 * will later be replaced by its original one!
867 */
868 if (exceptionVector == USER_VEC
869 || exceptionVector == TRAP_VEC)
870 registers[PC] -= 2;
871
872 /*
873 * Do the things needed to undo
874 * any stepping we may have done!
875 */
876 undoSStep ();
877
878 stepping = 0;
879
880 while (1)
881 {
882 remcomOutBuffer[0] = 0;
883 ptr = getpacket ();
884
885 switch (*ptr++)
886 {
887 case '?':
888 remcomOutBuffer[0] = 'S';
889 remcomOutBuffer[1] = highhex (sigval);
890 remcomOutBuffer[2] = lowhex (sigval);
891 remcomOutBuffer[3] = 0;
892 break;
893 case 'd':
894 remote_debug = !(remote_debug); /* toggle debug flag */
895 break;
896 case 'g': /* return the value of the CPU registers */
897 mem2hex ((char *) registers, remcomOutBuffer, NUMREGBYTES);
898 break;
899 case 'G': /* set the value of the CPU registers - return OK */
900 hex2mem (ptr, (char *) registers, NUMREGBYTES);
901 strcpy (remcomOutBuffer, "OK");
902 break;
903
904 /* mAA..AA,LLLL Read LLLL bytes at address AA..AA */
905 case 'm':
906 if (setjmp (remcomEnv) == 0)
907 {
908 dofault = 0;
909 /* TRY, TO READ %x,%x. IF SUCCEED, SET PTR = 0 */
910 if (hex2int (&ptr, &addr))
911 if (*(ptr++) == ',')
912 if (hex2int (&ptr, &length))
913 {
914 ptr = 0;
915 mem2hex ((char *) addr, remcomOutBuffer, length);
916 }
917 if (ptr)
918 strcpy (remcomOutBuffer, "E01");
919 }
920 else
921 strcpy (remcomOutBuffer, "E03");
922
923 /* restore handler for bus error */
924 dofault = 1;
925 break;
926
927 /* MAA..AA,LLLL: Write LLLL bytes at address AA.AA return OK */
928 case 'M':
929 if (setjmp (remcomEnv) == 0)
930 {
931 dofault = 0;
932
933 /* TRY, TO READ '%x,%x:'. IF SUCCEED, SET PTR = 0 */
934 if (hex2int (&ptr, &addr))
935 if (*(ptr++) == ',')
936 if (hex2int (&ptr, &length))
937 if (*(ptr++) == ':')
938 {
939 hex2mem (ptr, (char *) addr, length);
940 ptr = 0;
941 strcpy (remcomOutBuffer, "OK");
942 }
943 if (ptr)
944 strcpy (remcomOutBuffer, "E02");
945 }
946 else
947 strcpy (remcomOutBuffer, "E03");
948
949 /* restore handler for bus error */
950 dofault = 1;
951 break;
952
953 /* cAA..AA Continue at address AA..AA(optional) */
954 /* sAA..AA Step one instruction from AA..AA(optional) */
955 case 's':
956 stepping = 1;
957 case 'c':
958 {
959 /* tRY, to read optional parameter, pc unchanged if no parm */
960 if (hex2int (&ptr, &addr))
961 registers[PC] = addr;
962
963 if (stepping)
964 doSStep ();
965 }
966
967 return;
968 break;
969
970 /* kill the program */
971 case 'k': /* do nothing */
972 break;
973
974 default:
975 break;
976 } /* switch */
977
978 /* reply to the request */
979 putpacket (remcomOutBuffer);
980 }
981}
982
983
984/* We've had an exception - go into the gdb stub */
985void handle_exception(int exceptionVector)
986{
987 gdb_handle_exception (exceptionVector);
988}
989
990/* This function will generate a breakpoint exception. It is used at the
991 beginning of a program to sync up with a debugger and can be used
992 otherwise as a quick means to stop program execution and "break" into
993 the debugger. */
994void breakpoint (void)
995{
996 BREAKPOINT ();
997}
998
999/**** Processor-specific routines start here ****/
1000/**** Processor-specific routines start here ****/
1001/**** Processor-specific routines start here ****/
1002
1003extern int stack[];
1004
1005/* SH1/SH2 exception vector table format */
1006typedef struct
1007{
1008 void (*func_cold) (void);
1009 int *stack_cold;
1010 void (*func_warm) (void);
1011 int *stack_warm;
1012 void (*(handler[128 - 4])) (void);
1013} vec_type;
1014
1015/* vectable is the SH1/SH2 vector table. It must be at address 0
1016** or wherever your vbr points.
1017** Note that we only define the first 128 vectors, since the Jukebox
1018** firmware has its entry point at 0x200
1019*/
1020const vec_type vectable __attribute__ ((section (".vectors"))) =
1021{
1022 &start, /* 0: Power-on reset PC */
1023 stack, /* 1: Power-on reset SP */
1024 &start, /* 2: Manual reset PC */
1025 stack, /* 3: Manual reset SP */
1026 {
1027 &catch_exception_4, /* 4: General invalid instruction */
1028 &catch_exception_5, /* 5: Reserved for system */
1029 &catch_exception_6, /* 6: Invalid slot instruction */
1030 &catch_exception_7, /* 7: Reserved for system */
1031 &catch_exception_8, /* 8: Reserved for system */
1032 &catch_exception_9, /* 9: CPU bus error */
1033 &catch_exception_10, /* 10: DMA bus error */
1034 &catch_exception_11, /* 11: NMI */
1035 &catch_exception_12, /* 12: User break */
1036 &catch_exception_13, /* 13: Reserved for system */
1037 &catch_exception_14, /* 14: Reserved for system */
1038 &catch_exception_15, /* 15: Reserved for system */
1039 &catch_exception_16, /* 16: Reserved for system */
1040 &catch_exception_17, /* 17: Reserved for system */
1041 &catch_exception_18, /* 18: Reserved for system */
1042 &catch_exception_19, /* 19: Reserved for system */
1043 &catch_exception_20, /* 20: Reserved for system */
1044 &catch_exception_21, /* 21: Reserved for system */
1045 &catch_exception_22, /* 22: Reserved for system */
1046 &catch_exception_23, /* 23: Reserved for system */
1047 &catch_exception_24, /* 24: Reserved for system */
1048 &catch_exception_25, /* 25: Reserved for system */
1049 &catch_exception_26, /* 26: Reserved for system */
1050 &catch_exception_27, /* 27: Reserved for system */
1051 &catch_exception_28, /* 28: Reserved for system */
1052 &catch_exception_29, /* 29: Reserved for system */
1053 &catch_exception_30, /* 30: Reserved for system */
1054 &catch_exception_31, /* 31: Reserved for system */
1055 &catch_exception_32, /* 32: Trap instr (user vectors) */
1056 &catch_exception_33, /* 33: Trap instr (user vectors) */
1057 &catch_exception_34, /* 34: Trap instr (user vectors) */
1058 &catch_exception_35, /* 35: Trap instr (user vectors) */
1059 &catch_exception_36, /* 36: Trap instr (user vectors) */
1060 &catch_exception_37, /* 37: Trap instr (user vectors) */
1061 &catch_exception_38, /* 38: Trap instr (user vectors) */
1062 &catch_exception_39, /* 39: Trap instr (user vectors) */
1063 &catch_exception_40, /* 40: Trap instr (user vectors) */
1064 &catch_exception_41, /* 41: Trap instr (user vectors) */
1065 &catch_exception_42, /* 42: Trap instr (user vectors) */
1066 &catch_exception_43, /* 43: Trap instr (user vectors) */
1067 &catch_exception_44, /* 44: Trap instr (user vectors) */
1068 &catch_exception_45, /* 45: Trap instr (user vectors) */
1069 &catch_exception_46, /* 46: Trap instr (user vectors) */
1070 &catch_exception_47, /* 47: Trap instr (user vectors) */
1071 &catch_exception_48, /* 48: Trap instr (user vectors) */
1072 &catch_exception_49, /* 49: Trap instr (user vectors) */
1073 &catch_exception_50, /* 50: Trap instr (user vectors) */
1074 &catch_exception_51, /* 51: Trap instr (user vectors) */
1075 &catch_exception_52, /* 52: Trap instr (user vectors) */
1076 &catch_exception_53, /* 53: Trap instr (user vectors) */
1077 &catch_exception_54, /* 54: Trap instr (user vectors) */
1078 &catch_exception_55, /* 55: Trap instr (user vectors) */
1079 &catch_exception_56, /* 56: Trap instr (user vectors) */
1080 &catch_exception_57, /* 57: Trap instr (user vectors) */
1081 &catch_exception_58, /* 58: Trap instr (user vectors) */
1082 &catch_exception_59, /* 59: Trap instr (user vectors) */
1083 &catch_exception_60, /* 60: Trap instr (user vectors) */
1084 &catch_exception_61, /* 61: Trap instr (user vectors) */
1085 &catch_exception_62, /* 62: Trap instr (user vectors) */
1086 &catch_exception_63, /* 63: Trap instr (user vectors) */
1087 &catch_exception_64, /* 64: IRQ0 */
1088 &catch_exception_65, /* 65: IRQ1 */
1089 &catch_exception_66, /* 66: IRQ2 */
1090 &catch_exception_67, /* 67: IRQ3 */
1091 &catch_exception_68, /* 68: IRQ4 */
1092 &catch_exception_69, /* 69: IRQ5 */
1093 &catch_exception_70, /* 70: IRQ6 */
1094 &catch_exception_71, /* 71: IRQ7 */
1095 &catch_exception_72,
1096 &catch_exception_73,
1097 &catch_exception_74,
1098 &catch_exception_75,
1099 &catch_exception_76,
1100 &catch_exception_77,
1101 &catch_exception_78,
1102 &catch_exception_79,
1103 &catch_exception_80,
1104 &catch_exception_81,
1105 &catch_exception_82,
1106 &catch_exception_83,
1107 &catch_exception_84,
1108 &catch_exception_85,
1109 &catch_exception_86,
1110 &catch_exception_87,
1111 &catch_exception_88,
1112 &catch_exception_89,
1113 &catch_exception_90,
1114 &catch_exception_91,
1115 &catch_exception_92,
1116 &catch_exception_93,
1117 &catch_exception_94,
1118 &catch_exception_95,
1119 &catch_exception_96,
1120 &catch_exception_97,
1121 &catch_exception_98,
1122 &catch_exception_99,
1123 &catch_exception_100,
1124 &catch_exception_101,
1125 &catch_exception_102,
1126 &catch_exception_103,
1127 &catch_exception_104,
1128 &catch_exception_105,
1129 &catch_exception_106,
1130 &catch_exception_107,
1131 &catch_exception_108,
1132 &catch_exception_109,
1133 &catch_exception_110,
1134 &catch_exception_111,
1135 &catch_exception_112,
1136 &catch_exception_113,
1137 &catch_exception_114,
1138 &catch_exception_115,
1139 &catch_exception_116,
1140 &catch_exception_117,
1141 &catch_exception_118,
1142 &catch_exception_119,
1143 &catch_exception_120,
1144 &catch_exception_121,
1145 &catch_exception_122,
1146 &catch_exception_123,
1147 &catch_exception_124,
1148 &catch_exception_125,
1149 &catch_exception_126,
1150 &catch_exception_127}};
1151
1152void INIT (void)
1153{
1154 /* Disable all timer interrupts */
1155 TIER0 = 0;
1156 TIER1 = 0;
1157 TIER2 = 0;
1158 TIER3 = 0;
1159 TIER4 = 0;
1160
1161 init_serial();
1162
1163 in_nmi = 0;
1164 dofault = 1;
1165 stepped = 0;
1166
1167 ata_spindown(-1);
1168
1169 stub_sp = stub_stack;
1170 breakpoint ();
1171
1172 /* We should never come here */
1173 blink();
1174}
1175
1176void sr(void)
1177{
1178 /* Calling Reset does the same as pressing the button */
1179 asm (".global _Reset\n"
1180 " .global _WarmReset\n"
1181 "_Reset:\n"
1182 "_WarmReset:\n"
1183 " mov.l L_sp,r15\n"
1184 " bra _INIT\n"
1185 " nop\n"
1186 " .align 2\n"
1187 "L_sp: .long _stack");
1188
1189 asm("saveRegisters:\n");
1190 asm(" mov.l @(L_reg, pc), r0\n"
1191 " mov.l @r15+, r1 ! pop R0\n"
1192 " mov.l r2, @(0x08, r0) ! save R2\n"
1193 " mov.l r1, @r0 ! save R0\n"
1194 " mov.l @r15+, r1 ! pop R1\n"
1195 " mov.l r3, @(0x0c, r0) ! save R3\n"
1196 " mov.l r1, @(0x04, r0) ! save R1\n"
1197 " mov.l r4, @(0x10, r0) ! save R4\n"
1198 " mov.l r5, @(0x14, r0) ! save R5\n"
1199 " mov.l r6, @(0x18, r0) ! save R6\n"
1200 " mov.l r7, @(0x1c, r0) ! save R7\n"
1201 " mov.l r8, @(0x20, r0) ! save R8\n"
1202 " mov.l r9, @(0x24, r0) ! save R9\n"
1203 " mov.l r10, @(0x28, r0) ! save R10\n"
1204 " mov.l r11, @(0x2c, r0) ! save R11\n"
1205 " mov.l r12, @(0x30, r0) ! save R12\n"
1206 " mov.l r13, @(0x34, r0) ! save R13\n"
1207 " mov.l r14, @(0x38, r0) ! save R14\n"
1208 " mov.l @r15+, r4 ! save arg to handleException\n"
1209 " add #8, r15 ! hide PC/SR values on stack\n"
1210 " mov.l r15, @(0x3c, r0) ! save R15\n"
1211 " add #-8, r15 ! save still needs old SP value\n"
1212 " add #92, r0 ! readjust register pointer\n"
1213 " mov r15, r2\n"
1214 " add #4, r2\n"
1215 " mov.l @r2, r2 ! R2 has SR\n"
1216 " mov.l @r15, r1 ! R1 has PC\n"
1217 " mov.l r2, @-r0 ! save SR\n"
1218 " sts.l macl, @-r0 ! save MACL\n"
1219 " sts.l mach, @-r0 ! save MACH\n"
1220 " stc.l vbr, @-r0 ! save VBR\n"
1221 " stc.l gbr, @-r0 ! save GBR\n"
1222 " sts.l pr, @-r0 ! save PR\n"
1223 " mov.l @(L_stubstack, pc), r2\n"
1224 " mov.l @(L_hdl_except, pc), r3\n"
1225 " mov.l @r2, r15\n"
1226 " jsr @r3\n"
1227 " mov.l r1, @-r0 ! save PC\n"
1228 " mov.l @(L_stubstack, pc), r0\n"
1229 " mov.l @(L_reg, pc), r1\n"
1230 " bra restoreRegisters\n"
1231 " mov.l r15, @r0 ! save __stub_stack\n"
1232
1233 " .align 2\n"
1234 "L_reg:\n"
1235 " .long _registers\n"
1236 "L_stubstack:\n"
1237 " .long _stub_sp\n"
1238 "L_hdl_except:\n"
1239 " .long _handle_exception");
1240}
1241
1242void rr(void)
1243{
1244 asm(" .align 2 \n"
1245 " .global _resume\n"
1246 "_resume:\n"
1247 " mov r4,r1\n"
1248 "restoreRegisters:\n"
1249 " add #8, r1 ! skip to R2\n"
1250 " mov.l @r1+, r2 ! restore R2\n"
1251 " mov.l @r1+, r3 ! restore R3\n"
1252 " mov.l @r1+, r4 ! restore R4\n"
1253 " mov.l @r1+, r5 ! restore R5\n"
1254 " mov.l @r1+, r6 ! restore R6\n"
1255 " mov.l @r1+, r7 ! restore R7\n"
1256 " mov.l @r1+, r8 ! restore R8\n"
1257 " mov.l @r1+, r9 ! restore R9\n"
1258 " mov.l @r1+, r10 ! restore R10\n"
1259 " mov.l @r1+, r11 ! restore R11\n"
1260 " mov.l @r1+, r12 ! restore R12\n"
1261 " mov.l @r1+, r13 ! restore R13\n"
1262 " mov.l @r1+, r14 ! restore R14\n"
1263 " mov.l @r1+, r15 ! restore programs stack\n"
1264 " mov.l @r1+, r0\n"
1265 " add #-8, r15 ! uncover PC/SR on stack \n"
1266 " mov.l r0, @r15 ! restore PC onto stack\n"
1267 " lds.l @r1+, pr ! restore PR\n"
1268 " ldc.l @r1+, gbr ! restore GBR\n"
1269 " ldc.l @r1+, vbr ! restore VBR\n"
1270 " lds.l @r1+, mach ! restore MACH\n"
1271 " lds.l @r1+, macl ! restore MACL\n"
1272 " mov.l @r1, r0 \n"
1273 " add #-88, r1 ! readjust reg pointer to R1\n"
1274 " mov.l r0, @(4, r15) ! restore SR onto stack+4\n"
1275 " mov.l r2, @-r15\n"
1276 " mov.l L_in_nmi, r0\n"
1277 " mov #0, r2\n"
1278 " mov.b r2, @r0\n"
1279 " mov.l @r15+, r2\n"
1280 " mov.l @r1+, r0 ! restore R0\n"
1281 " rte\n"
1282 " mov.l @r1, r1 ! restore R1");
1283}
1284
1285static inline void code_for_catch_exception(unsigned int n)
1286{
1287 asm(" .globl _catch_exception_%O0" : : "X" (n) );
1288 asm(" _catch_exception_%O0:" :: "X" (n) );
1289
1290 asm(" add #-4, r15 ! reserve spot on stack ");
1291 asm(" mov.l r1, @-r15 ! push R1 ");
1292
1293 if (n == NMI_VEC)
1294 {
1295 /* Special case for NMI - make sure that they don't nest */
1296 asm(" mov.l r0, @-r15 ! push R0");
1297 asm(" mov.l L_in_nmi, r0");
1298 asm(" tas.b @r0 ! Fend off against addtnl NMIs");
1299 asm(" bt noNMI");
1300 asm(" mov.l @r15+, r0");
1301 asm(" mov.l @r15+, r1");
1302 asm(" add #4, r15");
1303 asm(" rte");
1304 asm(" nop");
1305 asm(".align 2");
1306 asm("L_in_nmi: .long _in_nmi");
1307 asm("noNMI:");
1308 }
1309 else
1310 {
1311
1312 if (n == CPU_BUS_ERROR_VEC)
1313 {
1314 /* Exception 9 (bus errors) are disasbleable - so that you
1315 can probe memory and get zero instead of a fault.
1316 Because the vector table may be in ROM we don't revector
1317 the interrupt like all the other stubs, we check in here
1318 */
1319 asm("mov.l L_dofault,r1");
1320 asm("mov.l @r1,r1");
1321 asm("tst r1,r1");
1322 asm("bf faultaway");
1323 asm("bsr _handle_buserror");
1324 asm(".align 2");
1325 asm("L_dofault: .long _dofault");
1326 asm("faultaway:");
1327 }
1328 asm(" mov #15<<4, r1 ");
1329 asm(" ldc r1, sr ! disable interrupts ");
1330 asm(" mov.l r0, @-r15 ! push R0 ");
1331 }
1332
1333 /* Prepare for saving context, we've already pushed r0 and r1, stick
1334 exception number into the frame */
1335 asm(" mov r15, r0 ");
1336 asm(" add #8, r0 ");
1337 asm(" mov %0,r1" :: "X" (n));
1338 asm(" extu.b r1,r1 ");
1339 asm(" bra saveRegisters ! save register values ");
1340 asm(" mov.l r1, @r0 ! save exception # ");
1341}
1342
1343/* Here we call all defined exceptions, so the inline assembler gets
1344 generated */
1345void exceptions (void)
1346{
1347 code_for_catch_exception (4);
1348 code_for_catch_exception (5);
1349 code_for_catch_exception (6);
1350 code_for_catch_exception (7);
1351 code_for_catch_exception (8);
1352 code_for_catch_exception (9);
1353 code_for_catch_exception (10);
1354 code_for_catch_exception (11);
1355 code_for_catch_exception (12);
1356 code_for_catch_exception (13);
1357 code_for_catch_exception (14);
1358 code_for_catch_exception (15);
1359 code_for_catch_exception (16);
1360 code_for_catch_exception (17);
1361 code_for_catch_exception (18);
1362 code_for_catch_exception (19);
1363 code_for_catch_exception (20);
1364 code_for_catch_exception (21);
1365 code_for_catch_exception (22);
1366 code_for_catch_exception (23);
1367 code_for_catch_exception (24);
1368 code_for_catch_exception (25);
1369 code_for_catch_exception (26);
1370 code_for_catch_exception (27);
1371 code_for_catch_exception (28);
1372 code_for_catch_exception (29);
1373 code_for_catch_exception (30);
1374 code_for_catch_exception (31);
1375 code_for_catch_exception (32);
1376 code_for_catch_exception (33);
1377 code_for_catch_exception (34);
1378 code_for_catch_exception (35);
1379 code_for_catch_exception (36);
1380 code_for_catch_exception (37);
1381 code_for_catch_exception (38);
1382 code_for_catch_exception (39);
1383 code_for_catch_exception (40);
1384 code_for_catch_exception (41);
1385 code_for_catch_exception (42);
1386 code_for_catch_exception (43);
1387 code_for_catch_exception (44);
1388 code_for_catch_exception (45);
1389 code_for_catch_exception (46);
1390 code_for_catch_exception (47);
1391 code_for_catch_exception (48);
1392 code_for_catch_exception (49);
1393 code_for_catch_exception (50);
1394 code_for_catch_exception (51);
1395 code_for_catch_exception (52);
1396 code_for_catch_exception (53);
1397 code_for_catch_exception (54);
1398 code_for_catch_exception (55);
1399 code_for_catch_exception (56);
1400 code_for_catch_exception (57);
1401 code_for_catch_exception (58);
1402 code_for_catch_exception (59);
1403 code_for_catch_exception (60);
1404 code_for_catch_exception (61);
1405 code_for_catch_exception (62);
1406 code_for_catch_exception (63);
1407 code_for_catch_exception (64);
1408 code_for_catch_exception (65);
1409 code_for_catch_exception (66);
1410 code_for_catch_exception (67);
1411 code_for_catch_exception (68);
1412 code_for_catch_exception (69);
1413 code_for_catch_exception (70);
1414 code_for_catch_exception (71);
1415 code_for_catch_exception (72);
1416 code_for_catch_exception (73);
1417 code_for_catch_exception (74);
1418 code_for_catch_exception (75);
1419 code_for_catch_exception (76);
1420 code_for_catch_exception (77);
1421 code_for_catch_exception (78);
1422 code_for_catch_exception (79);
1423 code_for_catch_exception (80);
1424 code_for_catch_exception (81);
1425 code_for_catch_exception (82);
1426 code_for_catch_exception (83);
1427 code_for_catch_exception (84);
1428 code_for_catch_exception (85);
1429 code_for_catch_exception (86);
1430 code_for_catch_exception (87);
1431 code_for_catch_exception (88);
1432 code_for_catch_exception (89);
1433 code_for_catch_exception (90);
1434 code_for_catch_exception (91);
1435 code_for_catch_exception (92);
1436 code_for_catch_exception (93);
1437 code_for_catch_exception (94);
1438 code_for_catch_exception (95);
1439 code_for_catch_exception (96);
1440 code_for_catch_exception (97);
1441 code_for_catch_exception (98);
1442 code_for_catch_exception (99);
1443 code_for_catch_exception (100);
1444 code_for_catch_exception (101);
1445 code_for_catch_exception (102);
1446 code_for_catch_exception (103);
1447 code_for_catch_exception (104);
1448 code_for_catch_exception (105);
1449 code_for_catch_exception (106);
1450 code_for_catch_exception (107);
1451 code_for_catch_exception (108);
1452 code_for_catch_exception (109);
1453 code_for_catch_exception (110);
1454 code_for_catch_exception (111);
1455 code_for_catch_exception (112);
1456 code_for_catch_exception (113);
1457 code_for_catch_exception (114);
1458 code_for_catch_exception (115);
1459 code_for_catch_exception (116);
1460 code_for_catch_exception (117);
1461 code_for_catch_exception (118);
1462 code_for_catch_exception (119);
1463 code_for_catch_exception (120);
1464 code_for_catch_exception (121);
1465 code_for_catch_exception (122);
1466 code_for_catch_exception (123);
1467 code_for_catch_exception (124);
1468 code_for_catch_exception (125);
1469 code_for_catch_exception (126);
1470 code_for_catch_exception (127);
1471}
1472
1473/*
1474 * Port B Control Register (PBCR1)
1475 */
1476#define PB15MD1 0x8000
1477#define PB15MD0 0x4000
1478#define PB14MD1 0x2000
1479#define PB14MD0 0x1000
1480#define PB13MD1 0x0800
1481#define PB13MD0 0x0400
1482#define PB12MD1 0x0200
1483#define PB12MD0 0x0100
1484#define PB11MD1 0x0080
1485#define PB11MD0 0x0040
1486#define PB10MD1 0x0020
1487#define PB10MD0 0x0010
1488#define PB9MD1 0x0008
1489#define PB9MD0 0x0004
1490#define PB8MD1 0x0002
1491#define PB8MD0 0x0001
1492
1493#define PB15MD PB15MD1|PB14MD0
1494#define PB14MD PB14MD1|PB14MD0
1495#define PB13MD PB13MD1|PB13MD0
1496#define PB12MD PB12MD1|PB12MD0
1497#define PB11MD PB11MD1|PB11MD0
1498#define PB10MD PB10MD1|PB10MD0
1499#define PB9MD PB9MD1|PB9MD0
1500#define PB8MD PB8MD1|PB8MD0
1501
1502#define PB_TXD1 PB11MD1
1503#define PB_RXD1 PB10MD1
1504#define PB_TXD0 PB9MD1
1505#define PB_RXD0 PB8MD1
1506
1507#define PB7MD PB7MD1|PB7MD0
1508#define PB6MD PB6MD1|PB6MD0
1509#define PB5MD PB5MD1|PB5MD0
1510#define PB4MD PB4MD1|PB4MD0
1511#define PB3MD PB3MD1|PB3MD0
1512#define PB2MD PB2MD1|PB2MD0
1513#define PB1MD PB1MD1|PB1MD0
1514#define PB0MD PB0MD1|PB0MD0
1515
1516
1517void handleError (char theSSR);
1518
1519void nop (void)
1520{
1521}
1522
1523void init_serial (void)
1524{
1525 int i;
1526
1527 /* Clear Channel 1's SCR */
1528 SCR1 = 0;
1529
1530 /* Set communication to be async, 8-bit data,
1531 no parity, 1 stop bit and use internal clock */
1532 SMR1 = 0;
1533
1534#ifdef RECORDER
1535 #warning 115200
1536 BRR1 = 2; /* 115200 */
1537#else
1538 BRR1 = 9; /* 38400 */
1539#endif
1540
1541 SCR1 &= ~(SCI_CKE1 | SCI_CKE0);
1542
1543 /* let the hardware settle */
1544 for (i = 0; i < 1000; i++)
1545 nop ();
1546
1547 /* Turn on in and out */
1548 SCR1 |= SCI_RE | SCI_TE;
1549
1550 /* Set the PFC to make RXD1 (pin PB8) an input pin
1551 and TXD1 (pin PB9) an output pin */
1552 PBCR1 &= ~(PB_TXD1 | PB_RXD1);
1553 PBCR1 |= PB_TXD1 | PB_RXD1;
1554}
1555
1556
1557int serial_waitc(void)
1558{
1559 char mySSR;
1560 mySSR = SSR1 & ( SCI_PER | SCI_FER | SCI_ORER );
1561 if ( mySSR )
1562 handleError ( mySSR );
1563 return SSR1 & SCI_RDRF ;
1564}
1565
1566char serial_getc (void)
1567{
1568 char ch;
1569 char mySSR;
1570
1571 while ( ! serial_waitc())
1572 ;
1573
1574 ch = RDR1;
1575 SSR1 &= ~SCI_RDRF;
1576
1577 mySSR = SSR1 & (SCI_PER | SCI_FER | SCI_ORER);
1578
1579 if (mySSR)
1580 handleError (mySSR);
1581
1582 return ch;
1583}
1584
1585void serial_putc (char ch)
1586{
1587 while (!(SSR1 & SCI_TDRE))
1588 {
1589 ;
1590 }
1591
1592 /*
1593 * Write data into TDR and clear TDRE
1594 */
1595 TDR1 = ch;
1596 SSR1 &= ~SCI_TDRE;
1597}
1598
1599void handleError (char theSSR)
1600{
1601 /* Clear all error bits, otherwise the receiver will stop */
1602 SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER);
1603}
1604
1605void *memcpy(void *dest, const void *src0, size_t n)
1606{
1607 char *dst = (char *) dest;
1608 char *src = (char *) src0;
1609
1610 void *save = dest;
1611
1612 while(n--)
1613 {
1614 *dst++ = *src++;
1615 }
1616
1617 return save;
1618}
diff --git a/lib/libsetjmp/SOURCES b/lib/libsetjmp/SOURCES
index aa0ac46a23..8c8ff75896 100644
--- a/lib/libsetjmp/SOURCES
+++ b/lib/libsetjmp/SOURCES
@@ -8,10 +8,6 @@ arm/setjmp.S
8m68k/setjmp.S 8m68k/setjmp.S
9#endif 9#endif
10 10
11#ifdef CPU_SH
12sh/setjmp.S
13#endif
14
15#ifdef CPU_MIPS 11#ifdef CPU_MIPS
16mips/setjmp.S 12mips/setjmp.S
17#endif 13#endif
diff --git a/lib/libsetjmp/setjmp.h b/lib/libsetjmp/setjmp.h
index f1f5d6a89e..944518e5cc 100644
--- a/lib/libsetjmp/setjmp.h
+++ b/lib/libsetjmp/setjmp.h
@@ -36,17 +36,6 @@
36#endif 36#endif
37#endif 37#endif
38 38
39#ifdef CPU_SH
40#define __SH5__ 0
41#if __SH5__
42#define _JBLEN 50
43#define _JBTYPE long long
44#else
45/* r8 through r15 (callee saved), pr, fp regs if available */
46#define _JBLEN 20
47#endif /* __SH5__ */
48#endif
49
50#ifdef _JBLEN 39#ifdef _JBLEN
51#ifdef _JBTYPE 40#ifdef _JBTYPE
52typedef _JBTYPE jmp_buf[_JBLEN]; 41typedef _JBTYPE jmp_buf[_JBLEN];
diff --git a/lib/libsetjmp/sh/asm.h b/lib/libsetjmp/sh/asm.h
deleted file mode 100644
index db30b149b5..0000000000
--- a/lib/libsetjmp/sh/asm.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifdef __STDC__
2# define _C_LABEL(x) _ ## x
3#else
4# define _C_LABEL(x) _/**/x
5#endif
6#define _ASM_LABEL(x) x
7
8#if __SH5__
9# if __SH5__ == 32 && __SHMEDIA__
10# define TEXT .section .text..SHmedia32, "ax"
11# else
12# define TEXT .text
13# endif
14
15# define _ENTRY(name) \
16 TEXT; .balign 8; .globl name; name:
17#else
18#define _ENTRY(name) \
19 .text; .align 2; .globl name; name:
20#endif /* __SH5__ */
21
22#define ENTRY(name) \
23 _ENTRY(_C_LABEL(name))
24
25#if (defined (__sh2__) || defined (__SH2E__) || defined (__sh3__) || defined (__SH3E__) \
26 || defined (__SH4_SINGLE__) || defined (__SH4__)) \
27 || defined (__SH4_SINGLE_ONLY__) || defined (__SH5__) || defined (__SH2A__)
28#define DELAYED_BRANCHES
29#define SL(branch, dest, in_slot, in_slot_arg2) \
30 branch##.s dest; in_slot, in_slot_arg2
31#else
32#define SL(branch, dest, in_slot, in_slot_arg2) \
33 in_slot, in_slot_arg2; branch dest
34#endif
35
36#ifdef __LITTLE_ENDIAN__
37#define SHHI shlld
38#define SHLO shlrd
39#else
40#define SHHI shlrd
41#define SHLO shlld
42#endif
diff --git a/lib/libsetjmp/sh/setjmp.S b/lib/libsetjmp/sh/setjmp.S
deleted file mode 100644
index 7df2054531..0000000000
--- a/lib/libsetjmp/sh/setjmp.S
+++ /dev/null
@@ -1,194 +0,0 @@
1#include "config.h"
2#ifdef ROCKBOX_LITTLE_ENDIAN
3#define __LITTLE_ENDIAN__
4#endif
5
6/* SH7034, the only supported sh target supported by Rockbox is sh1 */
7#define __SH5__ 0
8#define __SHMEDIA__ 0
9
10/* below is unmodified setjmp.S revision 1.3 from newlib cvs */
11#if __SHMEDIA__
12 .mode SHmedia
13#endif
14
15#include "asm.h"
16
17ENTRY(setjmp)
18#if __SH5__
19 ptabs r18, tr0
20 gettr tr5, r5
21 gettr tr6, r6
22 gettr tr7, r7
23 st.q r2, 0*8, r18
24 st.q r2, 1*8, r10
25 st.q r2, 2*8, r11
26 st.q r2, 3*8, r12
27 st.q r2, 4*8, r13
28 st.q r2, 5*8, r14
29 st.q r2, 6*8, r15
30 st.q r2, 7*8, r28
31 st.q r2, 8*8, r29
32 st.q r2, 9*8, r30
33 st.q r2, 10*8, r31
34 st.q r2, 11*8, r32
35 st.q r2, 12*8, r33
36 st.q r2, 13*8, r34
37 st.q r2, 14*8, r35
38 st.q r2, 15*8, r44
39 st.q r2, 16*8, r45
40 st.q r2, 17*8, r46
41 st.q r2, 18*8, r47
42 st.q r2, 19*8, r48
43 st.q r2, 20*8, r49
44 st.q r2, 21*8, r50
45 st.q r2, 22*8, r51
46 st.q r2, 23*8, r52
47 st.q r2, 24*8, r53
48 st.q r2, 25*8, r54
49 st.q r2, 26*8, r55
50 st.q r2, 27*8, r56
51 st.q r2, 28*8, r57
52 st.q r2, 29*8, r58
53 st.q r2, 30*8, r59
54 st.q r2, 31*8, r5
55 st.q r2, 32*8, r6
56 st.q r2, 33*8, r7
57#if ! __SH4_NOFPU__
58 fst.d r2, 34*8, dr12
59 fst.d r2, 35*8, dr14
60 fst.d r2, 36*8, dr36
61 fst.d r2, 37*8, dr38
62 fst.d r2, 38*8, dr40
63 fst.d r2, 39*8, dr42
64 fst.d r2, 40*8, dr44
65 fst.d r2, 41*8, dr46
66 fst.d r2, 42*8, dr48
67 fst.d r2, 43*8, dr50
68 fst.d r2, 44*8, dr52
69 fst.d r2, 45*8, dr54
70 fst.d r2, 46*8, dr56
71 fst.d r2, 47*8, dr58
72 fst.d r2, 48*8, dr60
73 fst.d r2, 49*8, dr62
74#endif
75 movi 0, r2
76 blink tr0, r63
77#else
78#if defined (__SH2E__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
79 add #(13*4),r4
80#else
81 add #(9*4),r4
82#endif
83
84 sts.l pr,@-r4
85
86#if defined (__SH2E__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
87 fmov.s fr15,@-r4 ! call saved floating point registers
88 fmov.s fr14,@-r4
89 fmov.s fr13,@-r4
90 fmov.s fr12,@-r4
91#endif
92
93 mov.l r15,@-r4 ! call saved integer registers
94 mov.l r14,@-r4
95 mov.l r13,@-r4
96 mov.l r12,@-r4
97
98 mov.l r11,@-r4
99 mov.l r10,@-r4
100 mov.l r9,@-r4
101 mov.l r8,@-r4
102
103 rts
104 mov #0,r0
105#endif /* __SH5__ */
106
107ENTRY(longjmp)
108#if __SH5__
109 ld.q r2, 0*8, r18
110 ptabs r18, tr0
111 ld.q r2, 1*8, r10
112 ld.q r2, 2*8, r11
113 ld.q r2, 3*8, r12
114 ld.q r2, 4*8, r13
115 ld.q r2, 5*8, r14
116 ld.q r2, 6*8, r15
117 ld.q r2, 7*8, r28
118 ld.q r2, 8*8, r29
119 ld.q r2, 9*8, r30
120 ld.q r2, 10*8, r31
121 ld.q r2, 11*8, r32
122 ld.q r2, 12*8, r33
123 ld.q r2, 13*8, r34
124 ld.q r2, 14*8, r35
125 ld.q r2, 15*8, r44
126 ld.q r2, 16*8, r45
127 ld.q r2, 17*8, r46
128 ld.q r2, 18*8, r47
129 ld.q r2, 19*8, r48
130 ld.q r2, 20*8, r49
131 ld.q r2, 21*8, r50
132 ld.q r2, 22*8, r51
133 ld.q r2, 23*8, r52
134 ld.q r2, 24*8, r53
135 ld.q r2, 25*8, r54
136 ld.q r2, 26*8, r55
137 ld.q r2, 27*8, r56
138 ld.q r2, 28*8, r57
139 ld.q r2, 29*8, r58
140 ld.q r2, 30*8, r59
141 ld.q r2, 31*8, r5
142 ld.q r2, 32*8, r6
143 ld.q r2, 33*8, r7
144 ptabs r5, tr5
145 ptabs r6, tr6
146 ptabs r7, tr7
147#if ! __SH4_NOFPU__
148 fld.d r2, 34*8, dr12
149 fld.d r2, 35*8, dr14
150 fld.d r2, 36*8, dr36
151 fld.d r2, 37*8, dr38
152 fld.d r2, 38*8, dr40
153 fld.d r2, 39*8, dr42
154 fld.d r2, 40*8, dr44
155 fld.d r2, 41*8, dr46
156 fld.d r2, 42*8, dr48
157 fld.d r2, 43*8, dr50
158 fld.d r2, 44*8, dr52
159 fld.d r2, 45*8, dr54
160 fld.d r2, 46*8, dr56
161 fld.d r2, 47*8, dr58
162 fld.d r2, 48*8, dr60
163 fld.d r2, 49*8, dr62
164#endif
165 movi 1, r2
166 cmvne r3, r3, r2
167 blink tr0, r63
168#else
169 mov.l @r4+,r8
170 mov.l @r4+,r9
171 mov.l @r4+,r10
172 mov.l @r4+,r11
173
174 mov.l @r4+,r12
175 mov.l @r4+,r13
176 mov.l @r4+,r14
177 mov.l @r4+,r15
178
179#if defined (__SH2E__) || defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__)
180 fmov.s @r4+,fr12 ! call saved floating point registers
181 fmov.s @r4+,fr13
182 fmov.s @r4+,fr14
183 fmov.s @r4+,fr15
184#endif
185
186 lds.l @r4+,pr
187
188 mov r5,r0
189 tst r0,r0
190 bf retr4
191 movt r0
192retr4: rts
193 nop
194#endif /* __SH5__ */
diff --git a/manual/advanced_topics/archos-flashing.tex b/manual/advanced_topics/archos-flashing.tex
deleted file mode 100644
index e8fa7af88c..0000000000
--- a/manual/advanced_topics/archos-flashing.tex
+++ /dev/null
@@ -1,195 +0,0 @@
1\section{\label{ref:Rockboxinflash}Rockbox in Flash}
2
3\subsection{Introduction}
4
5When you bought your \playertype, it came with the \playerman\ firmware in
6flash ROM. When you power on your \dap, this \playerman\ firmware starts,
7and then loads an updated firmware from disk if present (\firmwarefilename).
8An ordinary Rockbox installation only replaces the on-disk firmware, leaving
9the flash ROM contents intact. That means the \playerman\ firmware still
10controls the boot process.
11
12The main reason to change this is to improve the startup time of your player.
13The \playerman\ bootloader is rather slow. With Rockbox in flash, your \dap\
14will boot much faster, typically in three to five seconds. Furthermore you
15might prefer a clean Rockbox environment, with as little remnants of the
16\playerman\ software as possible.
17\opt{rombox}{On your \dap\ it is also possible to execute Rockbox directly
18 from flash ROM, increasing the amount of free RAM for buffering music. This
19 is called \emph{Rombox}.
20}
21
22\warn{Flashing your \dap\ is somewhat dangerous, like programming a mainboard
23 \emph{BIOS}, \emph{CD/DVD} drive firmware, mobile phone, etc. If the power
24 fails, the chip breaks while programming or most of all the programming
25 software malfunctions, you'll have a dead box. We take no responsibility of
26 any kind, you do that at your own risk. However, we tried as carefully as
27 possible to bulletproof this code. There are a lot of sanity checks. If any
28 of them fails, it will not program.
29}
30
31\opt{ondio}{\warn{After flashing Rockbox, never try to ROLO the \playerman\
32 firmware
33 \opt{ondiofm}{versions 1.31f or 1.32b! These versions are flash updates
34 themselves. If they are}
35 \opt{ondiosp}{version 1.32b! This version is a flash update itself.
36 If it is}
37 applied when Rockbox is flashed, you'll end up with a garbled flash ROM
38 and hence a dead box.
39}}
40
41There's an ultimate safety net to bring back boxes with even completely
42garbled flash content: the \emph{UART} boot mod, which in turn requires the
43\emph{serial} mod. With that it's possible to reflash independently from the
44outside, even if the flash ROM is completely erased.
45\nopt{ondio}{This won't work if you have one of the rare ``ROMless'' boxes. These
46 have no boot ROM and boot directly from flash.
47}
48If the first $\approx$2~KB of the flash ROM are flashed OK, \emph{Minimon} can
49be used for the same purpose.
50
51\subsection{Terminology and Basic Operation}
52
53\begin{description}
54\item[Firmware:] The flash ROM contents as a whole.
55\item[Image:] One operating software started from there.
56\end{description}
57
58The replacement firmware contains a bootloader and two images. The first image
59is the \emph{permanent} rescue software, to be used in case something is wrong
60with the second (main) image. In current firmware files this first image
61contains \emph{Bootbox} (see wiki for details). The second image is what is
62booted by default. The current firmware files contain a copy of Rockbox 3.2
63in the main image. It can easily be updated/replaced later.
64
65The bootloader allows to select which image to run. Pressing
66\opt{RECORDER_PAD}{\ButtonFOne}\opt{PLAYER_PAD,ONDIO_PAD}{\ButtonLeft} at boot
67selects the first image.
68\opt{RECORDER_PAD}{\ButtonFTwo}\opt{PLAYER_PAD}{\ButtonPlay}\opt{ONDIO_PAD}{\ButtonUp}
69selects the second image, which will also be booted if you don't press any
70button. The button mapping is only there for completeness.
71\opt{RECORDER_PAD}{\ButtonFThree}\opt{PLAYER_PAD,ONDIO_PAD}{\ButtonRight}
72selects the built-in serial monitor called \emph{Minimon}. You should know this
73in case you invoke it by accident. Minimon won't display anything on the
74screen. To get out of it, perform a hardware shutdown of your \dap.
75
76\subsection{Initial Flashing Procedure}
77
78You only need to perform this procedure the first time you flash your
79\playertype. You may also want to perform it in case the update procedure for
80the second image recommends it. In the latter case do not perform the steps
81listed under ``Preparation''.
82
83\subsubsection{Preparation}
84
85\nopt{ondio}{
86 First, check whether your \playertype\ is flashable at all. Select
87 \setting{System $\rightarrow$ Debug (Keep Out!) $\rightarrow$ View HW
88 Info}.
89 \opt{lcd_charcell}{Cycle through the displayed values with \ButtonRight /
90 \ButtonLeft\ until ``Flash:'' is displayed. If it shows question marks,
91 }
92 \opt{lcd_bitmap}{Check the values in the line starting with ``Flash:''. If it
93 shows question marks after ``M='' and ``D='',
94 }
95 you're out of luck, your \dap\ is not flashable without modifying the
96 hardware. You can stop here. Sorry.
97}
98
99\nopt{ondio}{If your \dap\ is flashable, you}\opt{ondio}{You} should perform a
100backup of the current flash ROM contents, in case you want to restore it later.
101Select \setting{System $\rightarrow$ Debug (Keep Out!) $\rightarrow$ Dump ROM
102contents}. You'll notice a few seconds of disk activity. When you connect your
103\dap\ to the PC afterwards, you'll find two files in the root of your \dap.
104Copy the 256~KB-sized file named \fname{internal\_rom\_2000000-203FFFF.bin} to
105a safe place.
106
107\subsubsection{Flashing}
108
109\begin{enumerate}
110\item Download the correct package for your \dap\ from
111 \url{http://download.rockbox.org/bootloader/archos/}. It is named
112 \fname{flash-{\textless}model{\textgreater}-{\textless}version{\textgreater}.zip}.
113 The current packages are v3.
114\item Unzip the flash package to the root of your \dap.
115 \nopt{ondio}{This will extract two files to the root,
116 \fname{firmware\_{\textless}model{\textgreater}.bin} and
117 \fname{firmware\_{\textless}model{\textgreater}\_norom.bin}.
118 \opt{recorder,recorderv2fm}{(The {\textless}model{\textgreater} part is
119 slighty different from that in the .zip file name.)
120 }
121 The flash plugin will select the correct one for your \dap.
122 }
123 \opt{ondio}{This will extract one file to the root,
124 \fname{firmware\_{\textless}model{\textgreater}.bin}.
125 }
126 Now safely disconnect USB.
127\item
128 \nopt{ondio}{Make sure your batteries are in good shape and fully charged.}
129 \opt{ondio}{Make sure you use a set of fresh batteries.}
130 Flashing doesn't need more power than normal operation, but you don't want
131 your \dap\ to run out of power while flashing.
132\item Select \setting{Plugins $\rightarrow$ Applications}, and run the
133 \fname{firmware\_flash} plugin. It will tell you about your flash and
134 which file it is going to program. After pressing
135 \opt{RECORDER_PAD}{\ButtonFOne}\opt{PLAYER_PAD}{\ButtonMenu}\opt{ONDIO_PAD}{\ButtonLeft}
136 it will check the file. If the file is OK, pressing
137 \opt{RECORDER_PAD}{\ButtonFTwo}\opt{PLAYER_PAD}{\ButtonOn}\opt{ONDIO_PAD}{\ButtonUp}
138 will give you a big warning. If we still didn't manage to scare you off, you
139 need to press
140 \opt{RECORDER_PAD}{\ButtonFThree}\opt{PLAYER_PAD,ONDIO_PAD}{\ButtonRight}
141 to actually program and verify. The programming takes just a few seconds.
142\item In the unlikely event that the programming or verify steps should give
143 you any error, \emph{do not switch off the box!} Otherwise you'll have seen
144 it working for the last time. While Rockbox is still in RAM and operational,
145 we could upgrade the plugin via USB and try again. If you switch it off,
146 it's gone.
147\end{enumerate}
148
149\note{After successful flashing you may delete the \fname{.bin} files from the
150 root of your \dap.
151}
152
153\note{There are no separate flash packages for {\dap}s modified to have 8~MB
154 of RAM. You need to use the corresponding package for non-modified
155 \playertype. You should then install a Rockbox image that makes use of all
156 available RAM as described in the following section.
157}
158
159\subsection{Updating the Rockbox Image in Flash}
160
161When Rockbox is booted from flash, it does not check for an updated firmware
162on disk. This is one of the reasons why it boots faster than the \playerman\
163firmware. It means that whenever you update Rockbox, you also need to update
164the image in the flash. This is a simple and safe procedure:
165
166\begin{enumerate}
167\item Download (or build) the Rockbox build you want to use, and unzip it to
168 the root of your \dap. Safely disconnect USB.
169\item ROLO into the new Rockbox version.
170\item Go to the file browser, and enter the \fname{.rockbox} directory (you
171 might need to set the \setting{File View} option to \setting{All}.)
172\item Play the file \fname{rockbox.ucl}\opt{rombox}{, or preferably
173 \fname{rombox.ucl}}, and follow the instructions. The plugin handling
174 this is \fname{rockbox\_flash}, a viewer plugin.
175\end{enumerate}
176
177\subsection{Restoring the Original Flash ROM Contents}
178
179In case you ever want to restore the original flash contents, you will need
180the backup file. The procedure is very similar to initial flashing, with the
181following differences:
182
183\begin{enumerate}
184\item Check that you do not have any \fname{firmware\_*.bin} files in your
185 \dap's root.
186\item Select \setting{Plugins $\rightarrow$ Applications}, and run the
187 \fname{firmware\_flash} plugin. Write down the filename it displays in the
188 first screen, then exit the plugin.
189\item Connect USB, and copy the flash ROM backup file to the root of your
190 \dap. \emph{Only use the backup file from that very box, otherwise you're
191 asking for trouble!} Rename the file so that it matches the name requested
192 by the \fname{firmware\_flash} plugin. Safely disconnect USB.
193\end{enumerate}
194
195Now follow the instructions given for initial flashing, starting with step 3.
diff --git a/manual/advanced_topics/main.tex b/manual/advanced_topics/main.tex
index 273ed1c805..786c109772 100755
--- a/manual/advanced_topics/main.tex
+++ b/manual/advanced_topics/main.tex
@@ -14,7 +14,7 @@ To accomplish this, load a \fname{.cfg} file (as described in
14words: \config{bookmarks}, \config{files}, \opt{tagcache}{\config{database}, }% 14words: \config{bookmarks}, \config{files}, \opt{tagcache}{\config{database}, }%
15\config{wps}, \config{settings}, \opt{recording}{\config{recording}, }% 15\config{wps}, \config{settings}, \opt{recording}{\config{recording}, }%
16\opt{radio}{\config{radio}, }\config{playlists}, \config{plugins}, 16\opt{radio}{\config{radio}, }\config{playlists}, \config{plugins},
17\config{system\_menu}, \opt{PLAYER_PAD}{\config{shutdown}, }\config{shortcuts}. 17\config{system\_menu}, \config{shortcuts}.
18Each of the words, if it occurs in the list, activates the appropriate item 18Each of the words, if it occurs in the list, activates the appropriate item
19in the main menu. The order of the items is given by the order of the words 19in the main menu. The order of the items is given by the order of the words
20in the list. The items whose words do not occur in the list will be hidden, 20in the list. The items whose words do not occur in the list will be hidden,
@@ -490,10 +490,8 @@ displaying images:
490 \item Load and always show the image, using the \config{\%x} tag 490 \item Load and always show the image, using the \config{\%x} tag
491 \item Preload the image with \config{\%xl} and show it with \config{\%xd}. 491 \item Preload the image with \config{\%xl} and show it with \config{\%xd}.
492 This way you can have your images displayed conditionally. 492 This way you can have your images displayed conditionally.
493 \nopt{archos}{% 493 \item Load an image and show as backdrop using the \config{\%X} tag. The
494 \item Load an image and show as backdrop using the \config{\%X} tag. The 494 image must be of the same exact dimensions as your display.
495 image must be of the same exact dimensions as your display.
496 }%
497\end{enumerate} 495\end{enumerate}
498 496
499\optv{swcodec}{% This doesn't depend on swcodec but we don't have a \noptv 497\optv{swcodec}{% This doesn't depend on swcodec but we don't have a \noptv
@@ -663,21 +661,10 @@ Example of a configuration file:
663\end{description} 661\end{description}
664 662
665\section{\label{ref:FirmwareLoading}Firmware Loading} 663\section{\label{ref:FirmwareLoading}Firmware Loading}
666\opt{player,recorder,recorderv2fm,ondio}{
667 When your \dap{} powers on, it loads the Archos firmware in ROM, which
668 automatically checks your \daps{} root directory for a file named
669 \firmwarefilename. Note that Archos firmware can only read the first
670 ten characters of each filename in this process, so do not rename your old
671 firmware files with names like \firmwarefilename.\fname{old} and so on,
672 because it is possible that the \dap{} will load a file other than the one
673 you intended.
674}
675 664
676\subsection{\label{ref:using_rolo}Using ROLO (Rockbox Loader)} 665\subsection{\label{ref:using_rolo}Using ROLO (Rockbox Loader)}
677Rockbox is able to load and start another firmware file without rebooting. 666Rockbox is able to load and start another firmware file without rebooting.
678You just ``play'' a file with the extension % 667You just ``play'' a file with the extension %
679\opt{recorder,recorderv2fm,ondio}{\fname{.ajz}.} %
680\opt{player}{\fname{.mod}.} %
681\opt{iriverh100,iriverh300}{\fname{.iriver}.} % 668\opt{iriverh100,iriverh300}{\fname{.iriver}.} %
682\opt{ipod}{\fname{.ipod}.} % 669\opt{ipod}{\fname{.ipod}.} %
683\opt{iaudio}{\fname{.iaudio}.} % 670\opt{iaudio}{\fname{.iaudio}.} %
@@ -687,8 +674,6 @@ You just ``play'' a file with the extension %
687This can be used to test new firmware versions without deleting your 674This can be used to test new firmware versions without deleting your
688current version. 675current version.
689 676
690\opt{archos}{\input{advanced_topics/archos-flashing.tex}}
691
692\opt{multi_boot}{ 677\opt{multi_boot}{
693\subsection{\label{ref:using_multiboot}Using Multiboot} 678\subsection{\label{ref:using_multiboot}Using Multiboot}
694 \newcommand{\redirectext}{<playername>} 679 \newcommand{\redirectext}{<playername>}
@@ -732,14 +717,12 @@ current version.
732} The following provides a short overview of the most relevant settings and 717} The following provides a short overview of the most relevant settings and
733 rules of thumb. 718 rules of thumb.
734 719
735\nopt{ondio}{
736\subsection{Display backlight} 720\subsection{Display backlight}
737 The active backlight consumes a lot of power. Therefore choose a setting that 721 The active backlight consumes a lot of power. Therefore choose a setting that
738 disables the backlight after timeout (for setting \setting{Backlight} see 722 disables the backlight after timeout (for setting \setting{Backlight} see
739 \reference{ref:Displayoptions}). Avoid having the backlight enabled all the 723 \reference{ref:Displayoptions}). Avoid having the backlight enabled all the
740 time (Activating \setting{selectivebacklight} 724 time (Activating \setting{selectivebacklight}
741 \reference{ref:selectivebacklight} can further reduce power consumption). 725 \reference{ref:selectivebacklight} can further reduce power consumption).
742}
743 726
744\opt{lcd_sleep}{ 727\opt{lcd_sleep}{
745\subsection{Display power-off} 728\subsection{Display power-off}
diff --git a/manual/appendix/appendix.tex b/manual/appendix/appendix.tex
index 6f8a47fd6d..f1d6ccca16 100644
--- a/manual/appendix/appendix.tex
+++ b/manual/appendix/appendix.tex
@@ -58,41 +58,6 @@ This is a list of Feature Requests we get repeatedly that we simply
58cannot do. View it as the opposite of a TODO! 58cannot do. View it as the opposite of a TODO!
59 59
60\begin{itemize} 60\begin{itemize}
61\opt{archos}{
62\item Record to WAV (uncompressed) or MP3pro format.\\
63The recording hardware (the MAS) does not allow us to do this
64\item Crossfade between tracks.\\
65 Crossfading would require two mp3 decoders, and we only have one.
66 This is not possible.
67\item Support MP3pro, WMA or other sound format playback.\\
68 The mp3{}-decoding hardware can only play MP3. We cannot make it play other
69 sound formats.
70\item Converting OGG $\rightarrow$ MP3.\\
71 The mp3{}-decoding hardware cannot decode OGG. It can be reprogrammed, but
72 there is too little memory for OGG and we have no documentation on how to
73 program the MAS' DSP. Doing the conversion with the CPU is impossible, since
74 a 12~MHz SH1 is far too slow for this daunting task.
75\item Archos Multimedia support.\\
76 The Archos Multimedia is a completely different beast. It is an entirely
77 different architecture, different CPU and upgrading the software is done
78 a completely different way. We do not wish to venture into this. Others
79 may do so. We will not.
80\item Multi{}-band (or graphic) equaliser.\\
81 We cannot access information for that kind of visualisation from the MP3
82 decoding hardware.
83\item CBR recording.\\
84 The MP3 encoding hardware does not allow this.
85\item Change tempo of a song without changing pitch.\\
86 The MP3 decoding hardware does not allow this.
87\item Graphic frequency (spectrum analyser).\\
88 We cannot access the audio waveform from the MP3 decoder so we cannot analyse
89 it. Even if we had access to it, the CPU would probably be too slow to
90 perform the analysis anyway.
91\item Cool sound effects.\\
92 Adding new sound effects requires reprogramming the MAS chip, and we cannot
93 do that. The MAS chip is programmable, but we have no access to the chip
94 documentation.
95}
96\nopt{iriverh300,iaudiox5}{ 61\nopt{iriverh300,iaudiox5}{
97\item Interfacing with other USB devices (like cameras) or 2 player games over USB.\\ 62\item Interfacing with other USB devices (like cameras) or 2 player games over USB.\\
98 The USB system demands that there is a master that talks to a slave. The 63 The USB system demands that there is a master that talks to a slave. The
@@ -104,10 +69,9 @@ The recording hardware (the MAS) does not allow us to do this
104 to play with it the way we'd need for any good communication to work. 69 to play with it the way we'd need for any good communication to work.
105} 70}
106\item Support other file systems than FAT32 (like NTFS or ext2 etc.).\\ 71\item Support other file systems than FAT32 (like NTFS or ext2 etc.).\\
107 No. 72 No. (Except perhaps for ExFAT)
108 \opt{archos}{Rockbox needs to support FAT32 since it can only start off a FAT32 73 Most \dap{}s can only start off FAT32 partitions, so adding support
109 partition (since that is the only way the ROM can load it), and adding}% 74 for more file systems will just take away valuable ram for
110 support for more file systems will just take away valuable ram for
111 unnecessary features. You can partition your \dap{} fine, just make sure 75 unnecessary features. You can partition your \dap{} fine, just make sure
112 the first one is FAT32 and then make the other ones whatever file system 76 the first one is FAT32 and then make the other ones whatever file system
113 you want. Just do not expect Rockbox to understand them. 77 you want. Just do not expect Rockbox to understand them.
diff --git a/manual/appendix/config_file_options.tex b/manual/appendix/config_file_options.tex
index ddd41e105d..e9604bdc33 100644
--- a/manual/appendix/config_file_options.tex
+++ b/manual/appendix/config_file_options.tex
@@ -380,12 +380,6 @@
380 force fm mono 380 force fm mono
381 & off, on & N/A\\ 381 & off, on & N/A\\
382 }% 382 }%
383 \opt{player}{
384 jump scroll
385 & 0 to 5 & N/A\\
386 jump scroll delay
387 & 0 to 250 & 0.01~s\\
388 }%
389 383
390 \bottomrule 384 \bottomrule
391 \end{longtable} 385 \end{longtable}
diff --git a/manual/appendix/file_formats.tex b/manual/appendix/file_formats.tex
index c909dfe91c..42681828fe 100644
--- a/manual/appendix/file_formats.tex
+++ b/manual/appendix/file_formats.tex
@@ -6,10 +6,6 @@
6 & \textbf{Action when selected}}{}{} 6 & \textbf{Action when selected}}{}{}
7\includegraphics[width=0.37cm]{appendix/images/icon-directory.png} 7\includegraphics[width=0.37cm]{appendix/images/icon-directory.png}
8 & Directory & \emph{none} & Enter the directory \tabularnewline 8 & Directory & \emph{none} & Enter the directory \tabularnewline
9\opt{recorder,recorderv2fm,ondiofm,ondiosp}{
10 \includegraphics[width=0.37cm]{appendix/images/icon-rolo.png}
11 & Rockbox firmware & \fname{.ajz} & Load the new firmware with ROLO \tabularnewline
12}
13\opt{swcodec}{ 9\opt{swcodec}{
14 \includegraphics[width=0.37cm]{appendix/images/icon-audio-file.png} 10 \includegraphics[width=0.37cm]{appendix/images/icon-audio-file.png}
15 & Audio file & \emph{various}\newline% 11 & Audio file & \emph{various}\newline%
@@ -66,10 +62,6 @@
66 \includegraphics[width=0.37cm]{appendix/images/icon-rolo.png} 62 \includegraphics[width=0.37cm]{appendix/images/icon-rolo.png}
67 & Rockbox firmware & \fname{.mi4} & Load the new firmware with ROLO \tabularnewline 63 & Rockbox firmware & \fname{.mi4} & Load the new firmware with ROLO \tabularnewline
68} 64}
69\opt{player}{
70 \includegraphics[width=0.37cm]{appendix/images/icon-rolo.png}
71 & Rockbox firmware & \fname{.mod} & Load the new firmware with ROLO \tabularnewline
72}
73\opt{masd,masf}{ 65\opt{masd,masf}{
74 \includegraphics[width=0.37cm]{appendix/images/icon-audio-file.png} 66 \includegraphics[width=0.37cm]{appendix/images/icon-audio-file.png}
75 & Audio file & \fname{.mp2}, \fname{.mp3} & Start playing the file and show the WPS\tabularnewline 67 & Audio file & \fname{.mp2}, \fname{.mp3} & Start playing the file and show the WPS\tabularnewline
@@ -90,10 +82,6 @@
90} 82}
91\includegraphics[width=0.37cm]{appendix/images/icon-text.png} 83\includegraphics[width=0.37cm]{appendix/images/icon-text.png}
92 & Text File & \fname{.txt} & Display the text file using the text viewer plugin\tabularnewline 84 & Text File & \fname{.txt} & Display the text file using the text viewer plugin\tabularnewline
93\opt{archos}{
94 \includegraphics[width=0.37cm]{appendix/images/icon-ucl.png}
95 & Flash Image & \fname{.ucl} & Flash the Rockbox image into the ROM \tabularnewline
96 }
97 & Voice file & \fname{.voice} & Allow Rockbox to speak menus\tabularnewline 85 & Voice file & \fname{.voice} & Allow Rockbox to speak menus\tabularnewline
98\opt{masf}{ 86\opt{masf}{
99 \includegraphics[width=0.37cm]{appendix/images/icon-wav-file.png} 87 \includegraphics[width=0.37cm]{appendix/images/icon-wav-file.png}
diff --git a/manual/appendix/images/icon-ucl.png b/manual/appendix/images/icon-ucl.png
deleted file mode 100644
index e34920b010..0000000000
--- a/manual/appendix/images/icon-ucl.png
+++ /dev/null
Binary files differ
diff --git a/manual/appendix/wps_tags.tex b/manual/appendix/wps_tags.tex
index f1f79b9351..1aec7bae99 100644
--- a/manual/appendix/wps_tags.tex
+++ b/manual/appendix/wps_tags.tex
@@ -47,7 +47,7 @@ Example:
47 \config{\%iy} & Year\\ 47 \config{\%iy} & Year\\
48 \config{\%ik} & Disc Number\\ 48 \config{\%ik} & Disc Number\\
49 \end{tagmap} 49 \end{tagmap}
50Remember that this information is not always available, so use the 50Remember that this information is not always available, so use the
51conditionals to show alternate information in preference to assuming. 51conditionals to show alternate information in preference to assuming.
52 52
53These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}), 53These tags, when written with a capital ``I'' (e.g. \config{\%Ia} or \config{\%Ic}),
@@ -112,7 +112,7 @@ show the information for the next song to be played.
112\section{Power Related Information} 112\section{Power Related Information}
113 \begin{tagmap} 113 \begin{tagmap}
114 \config{\%bl} & Numeric battery level in percents. 114 \config{\%bl} & Numeric battery level in percents.
115 Can also be used in a conditional: 115 Can also be used in a conditional:
116 \config{\%?bl<-1|0|1|2|\ldots|N>}, 116 \config{\%?bl<-1|0|1|2|\ldots|N>},
117 where the value $-1$ is used when the battery level isn't 117 where the value $-1$ is used when the battery level isn't
118 known (it usually is). The value $N$ is only used when the 118 known (it usually is). The value $N$ is only used when the
@@ -153,7 +153,7 @@ show the information for the next song to be played.
153 (N can be 1, 2, 3, \dots)\\ 153 (N can be 1, 2, 3, \dots)\\
154 \end{tagmap} 154 \end{tagmap}
155Example for the \config{\%d(N)} commands: If the file is 155Example for the \config{\%d(N)} commands: If the file is
156``\fname{/Rock/Kent/Isola/11 - 747.mp3}'', \config{\%d(1)} is ``\fname{Isola}'', 156``\fname{/Rock/Kent/Isola/11 - 747.mp3}'', \config{\%d(1)} is ``\fname{Isola}'',
157\config{\%d(2)} is ``\fname{Kent}'' and \config{\%d(3)} is ``\fname{Rock}''. 157\config{\%d(2)} is ``\fname{Kent}'' and \config{\%d(3)} is ``\fname{Rock}''.
158 158
159These tags, when written with the first letter capitalized (e.g. \config{\%Fn} 159These tags, when written with the first letter capitalized (e.g. \config{\%Fn}
@@ -162,28 +162,20 @@ or \config{\%D(2)}), produce the information for the next file to be played.
162\section{Playlist/Song Info} 162\section{Playlist/Song Info}
163 \begin{tagmap} 163 \begin{tagmap}
164 \config{\%pb} & Progress Bar. 164 \config{\%pb} & Progress Bar.
165 \opt{player}{
166 This will display a one character ``cup''
167 that empties as the time progresses.}
168 \opt{lcd_bitmap}{ 165 \opt{lcd_bitmap}{
169 This will replace the entire line with a progress bar. 166 This will replace the entire line with a progress bar.
170 You can set the position, width and height of the progressbar 167 You can set the position, width and height of the progressbar
171 (in pixels) and load a custom image for it: 168 (in pixels) and load a custom image for it:
172 \config{\%pb(x,y,[width],[height],image.bmp)}} \\ 169 \config{\%pb(x,y,[width],[height],image.bmp)}} \\
173 \opt{player}{%
174 \config{\%pf} & Full-line progress bar \& time display\\
175 }%
176 \config{\%px} & Percentage played in song\\ 170 \config{\%px} & Percentage played in song\\
177 \config{\%pc} & Current time in song\\ 171 \config{\%pc} & Current time in song\\
178 \config{\%pe} & Total number of playlist entries\\ 172 \config{\%pe} & Total number of playlist entries\\
179 \nopt{player}{%
180 \config{\%pm} & Peak Meter. The entire line is used as % 173 \config{\%pm} & Peak Meter. The entire line is used as %
181 volume peak meter.\\% 174 volume peak meter.\\%
182 \config{\%pL} & Peak meter for the left channel. Can be used as a value, % 175 \config{\%pL} & Peak meter for the left channel. Can be used as a value, %
183 a conditional tag or a bar tag.\\ 176 a conditional tag or a bar tag.\\
184 \config{\%pR} & Peak meter for the right channel. Can be used as a value, % 177 \config{\%pR} & Peak meter for the right channel. Can be used as a value, %
185 a conditional tag or a bar tag.\\ 178 a conditional tag or a bar tag.\\
186 }%
187 \config{\%pn} & Playlist name (without path or extension)\\ 179 \config{\%pn} & Playlist name (without path or extension)\\
188 \config{\%pp} & Playlist position\\ 180 \config{\%pp} & Playlist position\\
189 \config{\%pr} & Remaining time in song\\ 181 \config{\%pr} & Remaining time in song\\
@@ -206,7 +198,7 @@ or \config{\%D(2)}), produce the information for the next file to be played.
206 the rest of the track>}\\ 198 the rest of the track>}\\
207 \config{\%Sp} & Current playback pitch\\ 199 \config{\%Sp} & Current playback pitch\\
208 \end{tagmap} 200 \end{tagmap}
209 201
210\section{Playlist Viewer} 202\section{Playlist Viewer}
211 \begin{tagmap} 203 \begin{tagmap}
212 \config{\%Vp(start,code to render)} & Display the playlist viewer in 204 \config{\%Vp(start,code to render)} & Display the playlist viewer in
@@ -274,7 +266,7 @@ Example: \config{\%?mm<Off|All|One|Shuffle|A-B>}
274 266
275\section{Playback Mode} 267\section{Playback Mode}
276 \begin{tagmap} 268 \begin{tagmap}
277 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause, 269 \config{\%mp} & Play status, 0-4, in the order: Stop, Play, Pause,
278 Fast Forward, Rewind, Recording, Recording paused, FM Radio playing, 270 Fast Forward, Rewind, Recording, Recording paused, FM Radio playing,
279 FM Radio muted\\ 271 FM Radio muted\\
280 \end{tagmap} 272 \end{tagmap}
@@ -303,7 +295,7 @@ Example: \config{\%?mp<Stop|Play|Pause|Ffwd|Rew|Rec|Rec pause|FM|FM pause>}
303 13 & Playlist Catalogue Viewer \\ 295 13 & Playlist Catalogue Viewer \\
304 14 & Plugin \\ 296 14 & Plugin \\
305 15 & Context menu \\ 297 15 & Context menu \\
306 16 & System Info screen \\ 298 16 & System Info screen \\
307 17 & Time and Date Screen \\ 299 17 & Time and Date Screen \\
308 18 & Bookmark browser \\ 300 18 & Bookmark browser \\
309 19 & Shortcuts menu \\ 301 19 & Shortcuts menu \\
@@ -374,7 +366,6 @@ Examples:
374\opt{lcd_bitmap}{ 366\opt{lcd_bitmap}{
375\section{\label{ref:wps_images}Images} 367\section{\label{ref:wps_images}Images}
376 \begin{tagmap} 368 \begin{tagmap}
377 \nopt{archos}{%
378 \config{\%X(filename.bmp)} 369 \config{\%X(filename.bmp)}
379 & Load and set a backdrop image for the WPS. 370 & Load and set a backdrop image for the WPS.
380 This image must be exactly the same size as your LCD.\\ 371 This image must be exactly the same size as your LCD.\\
@@ -396,12 +387,12 @@ Examples:
396 contained in the bitmap. Default is 1.\\ 387 contained in the bitmap. Default is 1.\\
397 \config{\%xd(n[i] [,tag] [,offset])} & Display a preloaded image. 388 \config{\%xd(n[i] [,tag] [,offset])} & Display a preloaded image.
398 \config{n}: image ID as it was specified in \config{\%x} or \config{\%xl}\newline 389 \config{n}: image ID as it was specified in \config{\%x} or \config{\%xl}\newline
399 \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52). 390 \config{i}: (optional) number of the sub-image to display (a-z for 1-26 and A-Z for 27-52).
400 (ignored when \config{tag} is used). Only useable if the ID is a single letter. 391 (ignored when \config{tag} is used). Only useable if the ID is a single letter.
401 By default the first (i.e. top most) sub-image will be used.\newline 392 By default the first (i.e. top most) sub-image will be used.\newline
402 \config{tag}: (optional) Another tag to calculate the subimage from e.g \config{\%xd(A, \%mh)} would 393 \config{tag}: (optional) Another tag to calculate the subimage from e.g \config{\%xd(A, \%mh)} would
403 use the first subimage when \config{\%mh} is on and the second when it is off\newline 394 use the first subimage when \config{\%mh} is on and the second when it is off\newline
404 \config{offset}: (optional) Add this number to the value from the \config{tag} when 395 \config{offset}: (optional) Add this number to the value from the \config{tag} when
405 chosing the subimage (may be negative)\\ 396 chosing the subimage (may be negative)\\
406 \config{\%x9(n)} 397 \config{\%x9(n)}
407 & Display an image as a 9-patch bitmap covering the entire viewport.\newline 398 & Display an image as a 9-patch bitmap covering the entire viewport.\newline
@@ -409,7 +400,7 @@ Examples:
409 are unscaled, the four middle sections are scaled along one axis and the middle 400 are unscaled, the four middle sections are scaled along one axis and the middle
410 section is scaled on both axis.\newline 401 section is scaled on both axis.\newline
411 \config{n}: image ID\\ 402 \config{n}: image ID\\
412 403
413 \end{tagmap} 404 \end{tagmap}
414 405
415Examples: 406Examples:
@@ -429,12 +420,11 @@ with image ID ``M'', and then reference the individual sub-images in a condition
429 \item The images must be in BMP format 420 \item The images must be in BMP format
430 \item The image tag must be on its own line 421 \item The image tag must be on its own line
431 \item The ID is case sensitive 422 \item The ID is case sensitive
432 \item The size of the LCD screen for each \dap{} varies. See table below 423 \item The size of the LCD screen for each \dap{} varies. See table below
433 for appropriate sizes of each device. The x and y coordinates must 424 for appropriate sizes of each device. The x and y coordinates must
434 respect each of the \daps{} limits. 425 respect each of the \daps{} limits.
435 \end{itemize} 426 \end{itemize}
436} 427}
437}
438 428
439\opt{albumart}{ 429\opt{albumart}{
440\subsection{How to display the album art} 430\subsection{How to display the album art}
@@ -519,8 +509,8 @@ and tuned to a preset (and not recording) in order for them to be shown.
519 \config{\%Sr} & Use as a conditional to define options for left to right, or 509 \config{\%Sr} & Use as a conditional to define options for left to right, or
520 right to left languages. \%?Sr<RTL|LTR>\\ 510 right to left languages. \%?Sr<RTL|LTR>\\
521 \end{tagmap} 511 \end{tagmap}
522 512
523All alignment tags may be present in one line, but they need to be in the 513All alignment tags may be present in one line, but they need to be in the
524order left -- centre -- right. If the aligned texts overlap, they are merged. 514order left -- centre -- right. If the aligned texts overlap, they are merged.
525 515
526Example: \config{\%ax\%V(\dots)} 516Example: \config{\%ax\%V(\dots)}
@@ -569,7 +559,7 @@ Examples of the \%if tag:\\
569 559
570Allows grouping of several items (sublines) onto one line, with the 560Allows grouping of several items (sublines) onto one line, with the
571display cycling round the defined sublines. See 561display cycling round the defined sublines. See
572\reference{ref:AlternatingSublines} for details. 562\reference{ref:AlternatingSublines} for details.
573 563
574\opt{rtc}{ 564\opt{rtc}{
575\section{Time and Date} 565\section{Time and Date}
@@ -601,7 +591,7 @@ display cycling round the defined sublines. See
601 \config{\%Sx(English)} 591 \config{\%Sx(English)}
602 & Display the translation of ``English'' in the current language\\ 592 & Display the translation of ``English'' in the current language\\
603 \end{tagmap} 593 \end{tagmap}
604 594
605 \begin{itemize} 595 \begin{itemize}
606 \item ``English'' must be a phrase used in the language file. 596 \item ``English'' must be a phrase used in the language file.
607 \item It should match the \config{Source:} line in the language file. 597 \item It should match the \config{Source:} line in the language file.
@@ -685,7 +675,7 @@ display cycling round the defined sublines. See
685 Some tags can be used to display a bar which draws according to the value of 675 Some tags can be used to display a bar which draws according to the value of
686 the tag. To use these tags like a bar you need to use the following parameters 676 the tag. To use these tags like a bar you need to use the following parameters
687 (\%XX should be replaced with the actual tag). 677 (\%XX should be replaced with the actual tag).
688 678
689\opt{touchscreen}{ 679\opt{touchscreen}{
690 Volume and progress bars automatically create touch regions the same size 680 Volume and progress bars automatically create touch regions the same size
691 as the bar (slightly larger actually). This can be disabled with the 681 as the bar (slightly larger actually). This can be disabled with the
@@ -716,13 +706,13 @@ display cycling round the defined sublines. See
716 the centre of the image matches the current position. This must be 706 the centre of the image matches the current position. This must be
717 followed by the label of the desired image. 707 followed by the label of the desired image.
718 \item[backdrop] -- draw a preloaded image under the bar. The full 708 \item[backdrop] -- draw a preloaded image under the bar. The full
719 image will be displayed and must be the same size as the bar. 709 image will be displayed and must be the same size as the bar.
720 This must be followed by the label of the desired image. 710 This must be followed by the label of the desired image.
721 \item[nofill] -- don't draw the bar, only its frame (for use with the 711 \item[nofill] -- don't draw the bar, only its frame (for use with the
722 ``slider'' option). 712 ``slider'' option).
723 \item[noborder] -- don't draw the border for image-less bars, instead maximise 713 \item[noborder] -- don't draw the border for image-less bars, instead maximise
724 the filling over the specified area. This doesn't work for bars which 714 the filling over the specified area. This doesn't work for bars which
725 specify an image. 715 specify an image.
726 \item[nobar] -- don't draw the bar or its frame (for use with the 716 \item[nobar] -- don't draw the bar or its frame (for use with the
727 ``slider'' option). 717 ``slider'' option).
728 \opt{touchscreen}{ 718 \opt{touchscreen}{
@@ -755,7 +745,7 @@ a horizontal progressbar which doesn't fill and draws the image
755 substring is a number so it can be used with conditionals. (i.e \config{\%cM}). 745 substring is a number so it can be used with conditionals. (i.e \config{\%cM}).
756 0 is the first conditional option 746 0 is the first conditional option
757\end{description} 747\end{description}
758 748
759\begin{tagmap} 749\begin{tagmap}
760 \config{\%(} & The character `('\\ 750 \config{\%(} & The character `('\\
761 \config{\%)} & The character `)'\\ 751 \config{\%)} & The character `)'\\
@@ -766,10 +756,10 @@ a horizontal progressbar which doesn't fill and draws the image
766 \config{\%>} & The character `>'\\ 756 \config{\%>} & The character `>'\\
767 \config{\%;} & The character `;'\\ 757 \config{\%;} & The character `;'\\
768 \config{\%\#} & The character `\#'\\ 758 \config{\%\#} & The character `\#'\\
769 \config{\%s} & Indicate that the line should scroll. Can occur 759 \config{\%s} & Indicate that the line should scroll. Can occur
770 anywhere in a line (given that the text is 760 anywhere in a line (given that the text is
771 displayed; see conditionals above). You can specify 761 displayed; see conditionals above). You can specify
772 up to ten scrolling lines. Scrolling lines can not 762 up to ten scrolling lines. Scrolling lines can not
773 contain dynamic content such as timers, peak meters 763 contain dynamic content such as timers, peak meters
774 or progress bars.\\ 764 or progress bars.\\
775\end{tagmap} 765\end{tagmap}
diff --git a/manual/configure_rockbox/display_options.tex b/manual/configure_rockbox/display_options.tex
index e482417f0b..4978753444 100755
--- a/manual/configure_rockbox/display_options.tex
+++ b/manual/configure_rockbox/display_options.tex
@@ -194,10 +194,8 @@
194 \opt{lcd_bitmap}{ 194 \opt{lcd_bitmap}{
195 \item[Screen Scrolls Out of View.] 195 \item[Screen Scrolls Out of View.]
196 Screens can be manually scrolled horizontally by pressing 196 Screens can be manually scrolled horizontally by pressing
197 \opt{RECORDER_PAD}{\ButtonOn+\ButtonRight/\ButtonLeft}%
198 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight/\ButtonLeft}%
199 \opt{IRIVER_H10_PAD}{Long \ButtonRew/\ButtonFF}% 197 \opt{IRIVER_H10_PAD}{Long \ButtonRew/\ButtonFF}%
200 \nopt{RECORDER_PAD,ONDIO_PAD,IRIVER_H10_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD% 198 \nopt{IRIVER_H10_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD%
201 ,touchscreen}{% 199 ,touchscreen}{%
202 Long \ButtonRight/\ButtonLeft}. 200 Long \ButtonRight/\ButtonLeft}.
203 Setting this option to \setting{Yes} 201 Setting this option to \setting{Yes}
diff --git a/manual/configure_rockbox/playback_options.tex b/manual/configure_rockbox/playback_options.tex
index 53ca4a1658..8554abdcfa 100644
--- a/manual/configure_rockbox/playback_options.tex
+++ b/manual/configure_rockbox/playback_options.tex
@@ -42,7 +42,7 @@ you to configure settings related to audio playback.
42 Setting the End Point (B) is done accordingly using 42 Setting the End Point (B) is done accordingly using
43 \ActionWpsAbSetBNextDir{}. To reset the markers press \ActionWpsAbReset{}. 43 \ActionWpsAbSetBNextDir{}. To reset the markers press \ActionWpsAbReset{}.
44 }% 44 }%
45 \opt{ipod,IAUDIO_X5_PAD,ONDIO_PAD,PLAYER_PAD,PBELL_VIBE500_PAD}{% 45 \opt{ipod,IAUDIO_X5_PAD,PBELL_VIBE500_PAD}{%
46 To set the Start Point (A) press \ActionWpsBrowse{}. The following 46 To set the Start Point (A) press \ActionWpsBrowse{}. The following
47 press of \ActionWpsBrowse{} will set the End Point (B), and a third 47 press of \ActionWpsBrowse{} will set the End Point (B), and a third
48 successive \ActionWpsBrowse{} will reset the markers. 48 successive \ActionWpsBrowse{} will reset the markers.
diff --git a/manual/configure_rockbox/recording_settings.tex b/manual/configure_rockbox/recording_settings.tex
index 0175631cf7..5fc8f16840 100644
--- a/manual/configure_rockbox/recording_settings.tex
+++ b/manual/configure_rockbox/recording_settings.tex
@@ -165,12 +165,11 @@
165 Resets the location where the recorded files are saved to the root of your 165 Resets the location where the recorded files are saved to the root of your
166 \daps{} drive. 166 \daps{} drive.
167 167
168\nopt{ondio}{ 168\section{Clipping Light}
169 \section{Clipping Light}
170 Causes the backlight to flash on when clipping has been detected.\\ 169 Causes the backlight to flash on when clipping has been detected.\\
171 Options: \setting{Off}, \setting{Main unit only}, 170 Options: \setting{Off}, \setting{Main unit only},
172 \setting{Main and remote unit}, \setting{Remote unit only}. 171 \setting{Main and remote unit}, \setting{Remote unit only}.
173} 172
174\section{Trigger} 173\section{Trigger}
175 When you record a source you often are only interested in the sound and not 174 When you record a source you often are only interested in the sound and not
176 the silence in between. The recording trigger provides you with a 175 the silence in between. The recording trigger provides you with a
diff --git a/manual/configure_rockbox/sound_settings.tex b/manual/configure_rockbox/sound_settings.tex
index f9f0a747dd..fd5efa189b 100644
--- a/manual/configure_rockbox/sound_settings.tex
+++ b/manual/configure_rockbox/sound_settings.tex
@@ -17,8 +17,6 @@ change to customise your listening experience.
17 an otherwise low volume level. 17 an otherwise low volume level.
18 } 18 }
19 The volume can be adjusted from a 19 The volume can be adjusted from a
20 \opt{player}{minimum of -78~dB to a maximum of +18~dB.}%
21 \opt{recorder,recorderv2fm,ondio}{minimum of -100~dB to a maximum of +12~dB.}%
22 \opt{iriverh100,iriverh300}{minimum of -84~dB to a maximum of 0~dB.}% 20 \opt{iriverh100,iriverh300}{minimum of -84~dB to a maximum of 0~dB.}%
23 \opt{iaudiom3,iaudiom5,iaudiox5,ipod3g,ipod4g,gigabeatf,mrobe100,mpiohd200}{% 21 \opt{iaudiom3,iaudiom5,iaudiox5,ipod3g,ipod4g,gigabeatf,mrobe100,mpiohd200}{%
24 minimum of -73~dB to a maximum of +6~dB.}% 22 minimum of -73~dB to a maximum of +6~dB.}%
diff --git a/manual/configure_rockbox/system_options.tex b/manual/configure_rockbox/system_options.tex
index 7c3300b875..28d1c1a577 100755
--- a/manual/configure_rockbox/system_options.tex
+++ b/manual/configure_rockbox/system_options.tex
@@ -4,14 +4,12 @@
4\nopt{sansa,fuzeplus}%will probably be there on Sansas one day - exclude it the simple way without specific option 4\nopt{sansa,fuzeplus}%will probably be there on Sansas one day - exclude it the simple way without specific option
5{\nopt{sansaAMS}{ 5{\nopt{sansaAMS}{
6 \subsection{Battery} 6 \subsection{Battery}
7 Options relating to the \opt{archos}{batteries}\nopt{archos}{battery} 7 Options relating to the battery
8 in the \dap. 8 in the \dap.
9 \begin{description} 9 \begin{description}
10 \item [Battery Capacity.] This setting can be used to tell Rockbox what 10 \item [Battery Capacity.] This setting can be used to tell Rockbox what
11 capacity (in mAh) the battery being used has. The default is 11 capacity (in mAh) the battery being used has. The default is
12 \opt{player,recorder}{1500~mAh}% 12 \opt{vibe500}{1000~mAh}%
13 \opt{recorderv2fm}{2200~mAh}%
14 \opt{ondiosp,ondiofm,vibe500}{1000~mAh}%
15 \opt{iriverh100,iriverh300}{1300~mAh}% 13 \opt{iriverh100,iriverh300}{1300~mAh}%
16 \opt{mpiohd200}{850~mAh}% 14 \opt{mpiohd200}{850~mAh}%
17 \opt{ipodmini}{400~mAh (1G) or 630~mAh (2G)}% 15 \opt{ipodmini}{400~mAh (1G) or 630~mAh (2G)}%
@@ -28,8 +26,7 @@
28 \opt{mrobe100}{720~mAh}% 26 \opt{mrobe100}{720~mAh}%
29 \opt{samsungyh920,samsungyh925}{900~mAh}% 27 \opt{samsungyh920,samsungyh925}{900~mAh}%
30 \opt{samsungyh820}{650~mAh}% 28 \opt{samsungyh820}{650~mAh}%
31 , which is the capacity value for the standard 29 , which is the capacity value for the standard battery shipped with the \dap.
32 \opt{archos}{batteries}\nopt{archos}{battery} shipped with the \dap.
33 Rockbox uses this value for runtime estimation, not battery percentage 30 Rockbox uses this value for runtime estimation, not battery percentage
34 calculation. Changing this setting has no effect whatsoever on 31 calculation. Changing this setting has no effect whatsoever on
35 actual battery life. This setting only affects the accuracy of the 32 actual battery life. This setting only affects the accuracy of the
@@ -118,7 +115,6 @@ This sub menu relates to limits in the Rockbox operating system.
118 Entries in File Browser} or \setting{Max Playlist Size} to take effect 115 Entries in File Browser} or \setting{Max Playlist Size} to take effect
119 while \setting{Glyphs To Cache} will affect the next font load.} 116 while \setting{Glyphs To Cache} will affect the next font load.}
120% TODO: this needs to be rewritten in another style, it lets you mix sound from another source into the music 117% TODO: this needs to be rewritten in another style, it lets you mix sound from another source into the music
121\opt{player}{
122 \subsection{Line In} This option activates the line-in port on \dap, which is 118 \subsection{Line In} This option activates the line-in port on \dap, which is
123 off by default. This is useful for such applications as: 119 off by default. This is useful for such applications as:
124 \begin{itemize} 120 \begin{itemize}
@@ -126,7 +122,6 @@ This sub menu relates to limits in the Rockbox operating system.
126 \item laptop $\rightarrow$ \dap $\rightarrow$ human 122 \item laptop $\rightarrow$ \dap $\rightarrow$ human
127 \item LAN party computer $\rightarrow$ \dap $\rightarrow$ human 123 \item LAN party computer $\rightarrow$ \dap $\rightarrow$ human
128 \end{itemize} 124 \end{itemize}
129}
130\opt{quickscreen}{ 125\opt{quickscreen}{
131 \subsection{Use Shortcuts Menu Instead of Quick Screen} This option 126 \subsection{Use Shortcuts Menu Instead of Quick Screen} This option
132 activates the shortcuts menu instead of opening the quick screen when enabled. 127 activates the shortcuts menu instead of opening the quick screen when enabled.
diff --git a/manual/configure_rockbox/theme_settings.tex b/manual/configure_rockbox/theme_settings.tex
index 9677e663ae..2cbe57b014 100644
--- a/manual/configure_rockbox/theme_settings.tex
+++ b/manual/configure_rockbox/theme_settings.tex
@@ -14,11 +14,6 @@ customize the visual appearance of Rockbox.
14 14
15 There are a number of themes that ship with Rockbox. If none of 15 There are a number of themes that ship with Rockbox. If none of
16 these suit your needs, many more can be downloaded from 16 these suit your needs, many more can be downloaded from
17 \opt{player}{\url{http://themes.rockbox.org/index.php?target=player}}%
18 \opt{recorder}{\url{http://themes.rockbox.org/index.php?target=fmrecorder}}%
19 \opt{recorderv2fm}{\url{http://themes.rockbox.org/index.php?target=fmrecorder}}%
20 \opt{ondiofm}{\url{http://themes.rockbox.org/index.php?target=ondiofm}}%
21 \opt{ondiosp}{\url{http://themes.rockbox.org/index.php?target=ondiosp}}%
22 \opt{iaudiom5}{\url{http://themes.rockbox.org/index.php?target=m5}}% 17 \opt{iaudiom5}{\url{http://themes.rockbox.org/index.php?target=m5}}%
23 \opt{iaudiox5}{\url{http://themes.rockbox.org/index.php?target=x5}}% 18 \opt{iaudiox5}{\url{http://themes.rockbox.org/index.php?target=x5}}%
24 \opt{iaudiom3}{\url{http://themes.rockbox.org/index.php?target=m3}}% 19 \opt{iaudiom3}{\url{http://themes.rockbox.org/index.php?target=m3}}%
@@ -56,7 +51,7 @@ customize the visual appearance of Rockbox.
56 \item[Font.] 51 \item[Font.]
57 Browse the installed fonts on your \dap{}. Selecting one will activate it. 52 Browse the installed fonts on your \dap{}. Selecting one will activate it.
58 See \reference{ref:Loadingfonts} for further details about fonts. 53 See \reference{ref:Loadingfonts} for further details about fonts.
59} % \nopt{player} 54}
60 55
61\item[While Playing Screen.] 56\item[While Playing Screen.]
62 Opens the \setting{File Browser} in the \fname{/.rockbox/wps} directory and 57 Opens the \setting{File Browser} in the \fname{/.rockbox/wps} directory and
@@ -106,10 +101,6 @@ customize the visual appearance of Rockbox.
106 \item[Remote Status Bar.] Allows you to choose where to display the 101 \item[Remote Status Bar.] Allows you to choose where to display the
107 statusbar on the remote display. 102 statusbar on the remote display.
108 } 103 }
109 \opt{RECORDER_PAD}{
110 \item[Button Bar.] Enables or disables the button bar prompts for the
111 ``F''-keys at the bottom of the screen.
112 }
113 \item[Volume Display.] Controls whether the volume is displayed as a 104 \item[Volume Display.] Controls whether the volume is displayed as a
114 graphic or a numeric value on the Status Bar. If you select a numeric 105 graphic or a numeric value on the Status Bar. If you select a numeric
115 display, volume is displayed in decibels. See \reference{ref:volume} 106 display, volume is displayed in decibels. See \reference{ref:volume}
diff --git a/manual/getting_started/archos_choice.tex b/manual/getting_started/archos_choice.tex
deleted file mode 100644
index 690b25a14d..0000000000
--- a/manual/getting_started/archos_choice.tex
+++ /dev/null
@@ -1,53 +0,0 @@
1\section{Before installation}
2
3Before you install Rockbox, you will need to know what model you own. Rockbox
4comes in different versions depending on the model of your \dap{}. There are
5six different versions of the software. The table below will help you to
6identify which version of the software you need.
7
8The model name is printed on the case. The hard drive size is listed on the
9serial number sticker on the back of the unit.
10
11\begin{rbtabular}{\textwidth}{llXl}%
12 {\textbf{Picture} & \textbf{Disk size} & \textbf{Model Name} & \textbf{Version Name}}%
13 {}{ref:Jukeboxtypetable}
14 \begin{minipage}{2.2cm}
15 \includegraphics[width=2cm]{getting_started/images/archos-studio-small.png}
16 \end{minipage}
17 & 5~GB, 6~GB, 10~GB, 20~GB &
18 \begin{minipage}{8cm}
19 Jukebox 5000 \newline
20 Jukebox 6000 \newline
21 Jukebox Studio 10 \newline
22 Jukebox Studio 20
23 \end{minipage}
24 & player \\\midrule
25 \begin{minipage}{2.2cm}
26 \includegraphics[width=2cm]{getting_started/images/archos-recorder-small.png}
27 \end{minipage}
28 & 6~GB, 10~GB, 15~GB, 20~GB & \begin{minipage}{8cm}
29 Jukebox Recorder 6 \newline
30 Jukebox Recorder 10 \newline
31 Jukebox Recorder 15 \newline
32 Jukebox Recorder 20
33 \end{minipage}
34 & recorder\\\midrule
35 \begin{minipage}{2.2cm}
36 \includegraphics[width=2cm]{getting_started/images/archos-recorderv2-small.png}
37 \end{minipage}
38 & 20~GB & Jukebox Recorder v2 & recorderv2\\\midrule
39 \begin{minipage}{2.2cm}
40 \includegraphics[width=2cm]{getting_started/images/archos-recorderfm-small.png}
41 \end{minipage}
42 & 20~GB & Jukebox Recorder FM & fmrecorder \\\midrule
43 \begin{minipage}{2.2cm}
44 \includegraphics[width=2cm]{getting_started/images/archos-ondiosp-small.png}
45 \end{minipage}
46 & 128~MB (flash) & Ondio 128 SP & ondiosp \\\midrule
47 \begin{minipage}{2.2cm}
48 \includegraphics[width=2cm]{getting_started/images/archos-ondiofm-small.png}
49 \end{minipage}
50 & 128~MB (flash) & Ondio 128 FM & ondiofm \\
51\end{rbtabular}
52\note{Rockbox does not run on the Archos Jukebox Multimedia or any
53Archos products other than those mentioned here.}
diff --git a/manual/getting_started/installation.tex b/manual/getting_started/installation.tex
index 5766c222eb..0b3b25a4e8 100644
--- a/manual/getting_started/installation.tex
+++ b/manual/getting_started/installation.tex
@@ -286,20 +286,18 @@ still available to you.\\
286\end{description} 286\end{description}
287} 287}
288 288
289\nopt{player} { 289Apart from the required parts there are some addons you might be interested
290 Apart from the required parts there are some addons you might be interested 290in installing.
291 in installing. 291\begin{description}
292 \begin{description} 292\item[Fonts.] Rockbox can load custom fonts. The fonts are
293 \item[Fonts.] Rockbox can load custom fonts. The fonts are 293 distributed as a separate package and thus need to be installed
294 distributed as a separate package and thus need to be installed 294 separately. They are not required to run Rockbox itself but
295 separately. They are not required to run Rockbox itself but 295 a lot of themes require the fonts package to be installed.
296 a lot of themes require the fonts package to be installed. 296
297 297\item[Themes.] The appearance of Rockbox can be customised by themes. Depending
298 \item[Themes.] The appearance of Rockbox can be customised by themes. Depending 298 on your taste you might want to install additional themes to change
299 on your taste you might want to install additional themes to change 299 the look of Rockbox.
300 the look of Rockbox. 300\end{description}
301 \end{description}
302}
303 301
304\subsection{Automated Installation} 302\subsection{Automated Installation}
305 303
@@ -310,7 +308,7 @@ housekeeping tool \caps{Rockbox Utility}. It allows you to:
310 (``Minimal Installation''). 308 (``Minimal Installation'').
311\item Automatically install all suggested components (``Complete Installation''). 309\item Automatically install all suggested components (``Complete Installation'').
312\item Selectively install optional components. 310\item Selectively install optional components.
313\nopt{player}{\item Install additional fonts and themes.} 311\item Install additional fonts and themes.
314\item Install voice files and generate talk clips. 312\item Install voice files and generate talk clips.
315\item Uninstall all components you installed using Rockbox Utility. 313\item Uninstall all components you installed using Rockbox Utility.
316\end{itemize} 314\end{itemize}
@@ -492,13 +490,6 @@ create a separate directory on your \dap{} for the Rockbox
492files! The \fname{.zip} file already contains the internal 490files! The \fname{.zip} file already contains the internal
493structure that Rockbox needs.\\} 491structure that Rockbox needs.\\}
494 492
495\opt{archos}{
496 If the contents of the \fname{.zip} file are extracted correctly, you will
497 have a file called \fname{\firmwarefilename} in the main directory of your
498 \daps{} drive, and also a directory called \fname{.rockbox}, which contains a
499 number of other directories and system files needed by Rockbox.
500}
501
502% This has nothing to do with swcodec, just that these players need our own 493% This has nothing to do with swcodec, just that these players need our own
503% bootloader so we can decide where we want the main binary. 494% bootloader so we can decide where we want the main binary.
504\opt{swcodec}{ 495\opt{swcodec}{
@@ -559,7 +550,7 @@ structure that Rockbox needs.\\}
559 \end{itemize} 550 \end{itemize}
560} 551}
561 552
562\opt{iriverh10,iriverh10_5gb,ipod,mrobe100,sansa,archos,cowond2,vibe500,ondavx777,samsungyh}{ 553\opt{iriverh10,iriverh10_5gb,ipod,mrobe100,sansa,cowond2,vibe500,ondavx777,samsungyh}{
563 Safely eject / unmount the USB drive, unplug the cable and restart. 554 Safely eject / unmount the USB drive, unplug the cable and restart.
564} 555}
565 556
@@ -709,7 +700,7 @@ The new build will be installed over your current build.\\
709 700
710\section{Uninstalling Rockbox}\index{Installation!uninstall} 701\section{Uninstalling Rockbox}\index{Installation!uninstall}
711 702
712\nopt{gigabeatf,iaudiom3,iaudiom5,iaudiox5,archos,mrobe100,gigabeats,fuzeplus}{ 703\nopt{gigabeatf,iaudiom3,iaudiom5,iaudiox5,mrobe100,gigabeats,fuzeplus}{
713 \note{The Rockbox bootloader allows you to choose between Rockbox and 704 \note{The Rockbox bootloader allows you to choose between Rockbox and
714 the original firmware. (See \reference{ref:Dualboot} for more information.)} 705 the original firmware. (See \reference{ref:Dualboot} for more information.)}
715} 706}
@@ -727,12 +718,6 @@ completely follow the manual uninstallation instructions below.}}
727 718
728\subsection{Manual Uninstallation} 719\subsection{Manual Uninstallation}
729 720
730\opt{archos}{
731 If you would like to go back to using the original \playerman{} software,
732 connect the \dap{} to your computer, and delete the
733 \fname{\firmwarefilename} file.
734}
735
736\opt{iriverh10,iriverh10_5gb,mrobe100,vibe500,samsungyh}{ 721\opt{iriverh10,iriverh10_5gb,mrobe100,vibe500,samsungyh}{
737 If you would like to go back to using the original \playerman{} software, 722 If you would like to go back to using the original \playerman{} software,
738 connect the \dap{} to your computer, and delete the 723 connect the \dap{} to your computer, and delete the
diff --git a/manual/main_menu/fmradio.tex b/manual/main_menu/fmradio.tex
index b8c76291db..3d226245e3 100644
--- a/manual/main_menu/fmradio.tex
+++ b/manual/main_menu/fmradio.tex
@@ -1,10 +1,5 @@
1% $Id$ % 1% $Id$ %
2\section{\label{ref:FMradio}FM Radio} 2\section{\label{ref:FMradio}FM Radio}
3\opt{RECORDER_PAD}{
4 \note{The early V2 models were in fact FM Recorders in disguise,
5 so they had the FM radio still mounted. Rockbox enables it if present -
6 in case this menu does not show on your unit you can skip this chapter.\\}
7}
8\opt{sansa}{ 3\opt{sansa}{
9 \note{Not all Sansas have a radio receiver. Generally all American models do, 4 \note{Not all Sansas have a radio receiver. Generally all American models do,
10 but European models might not. Rockbox will display the radio menu only if it 5 but European models might not. Rockbox will display the radio menu only if it
@@ -23,7 +18,7 @@
23 it from the file browser. Rockbox will ``remember'' and use it in 18 it from the file browser. Rockbox will ``remember'' and use it in
24 \setting{PRESET} mode until another file has been selected. Some preset 19 \setting{PRESET} mode until another file has been selected. Some preset
25 files are available here: \wikilink{FmPresets}. 20 files are available here: \wikilink{FmPresets}.
26 21
27 \opt{recording}{ 22 \opt{recording}{
28 \opt{swcodec}{ 23 \opt{swcodec}{
29 It is also possible to record the FM radio while listening. 24 It is also possible to record the FM radio while listening.
@@ -61,11 +56,6 @@
61 \nopt{IRIVER_RC_H100_PAD}{\ActionRCFMSettingsInc, \ActionRCFMSettingsDec}% 56 \nopt{IRIVER_RC_H100_PAD}{\ActionRCFMSettingsInc, \ActionRCFMSettingsDec}%
62 } 57 }
63 & Change volume.\\ 58 & Change volume.\\
64 \opt{RECORDER_PAD}{
65 \ButtonPlay
66 & Freeze all screen updates. May enhance radio reception in some
67 cases.\\
68 }
69 59
70 % 60 %
71 \ActionFMExit 61 \ActionFMExit
@@ -76,10 +66,9 @@
76 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMStop} 66 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMStop}
77 & Stop the radio and return to \setting{Main Menu}.\\% 67 & Stop the radio and return to \setting{Main Menu}.\\%
78 % 68 %
79 \nopt{ONDIO_PAD}{% 69 \ActionFMPlay
80 \nopt{RECORDER_PAD}{\ActionFMPlay
81 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMPlay} 70 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMPlay}
82 & Mute radio playback.\\}% 71 & Mute radio playback.\\%
83 % 72 %
84 \ActionFMMode 73 \ActionFMMode
85 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMMode} 74 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMMode}
@@ -87,9 +76,9 @@
87 % 76 %
88 \ActionFMPreset 77 \ActionFMPreset
89 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMPreset} 78 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMPreset}
90 & Open a list of radio presets. You can view all the presets that 79 & Open a list of radio presets. You can view all the presets that
91 you have, and switch to the station.\\ 80 you have, and switch to the station.\\
92 }% 81 %
93 % 82 %
94 \ActionFMMenu 83 \ActionFMMenu
95 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMMenu} 84 \opt{HAVEREMOTEKEYMAP}{& \ActionRCFMMenu}
@@ -99,7 +88,6 @@
99 \nopt{hold_button}{% 88 \nopt{hold_button}{%
100 \opt{SANSA_CLIP_PAD}{\ButtonHome+\ButtonSelect} 89 \opt{SANSA_CLIP_PAD}{\ButtonHome+\ButtonSelect}
101 \opt{SANSA_FUZEPLUS_PAD}{\ButtonPower} 90 \opt{SANSA_FUZEPLUS_PAD}{\ButtonPower}
102 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonDown}
103 & Key lock (software hold switch) on/off.\\ 91 & Key lock (software hold switch) on/off.\\
104 }% 92 }%
105 \end{btnmap} 93 \end{btnmap}
@@ -108,45 +96,21 @@
108 96
109 \item[Saving a preset:] 97 \item[Saving a preset:]
110 Up to 64 of your favourite stations can be saved as presets. 98 Up to 64 of your favourite stations can be saved as presets.
111 \opt{RECORDER_PAD}{Press \ButtonFTwo{} to go to the presets list, press
112 \ButtonFOne{} to add a preset.}%
113 \nopt{RECORDER_PAD}{%
114 \ActionFMMenu{} to go to the menu, then select \setting{Add preset}.% 99 \ActionFMMenu{} to go to the menu, then select \setting{Add preset}.%
115 }
116 Enter the name (maximum number of characters is 32). 100 Enter the name (maximum number of characters is 32).
117 Press \ActionKbdDone{} to save. 101 Press \ActionKbdDone{} to save.
118 102
119 \item[Selecting a preset:] 103 \item[Selecting a preset:]
120 \opt{ONDIO_PAD}{\ActionFMMenu{} to open the menu, select 104 \ActionFMPreset to go to the presets list.
121 \setting{Preset}}%
122 \nopt{ONDIO_PAD}{\ActionFMPreset} to go to the presets list.
123 Use \ActionFMSettingsInc{} and \ActionFMSettingsDec{} 105 Use \ActionFMSettingsInc{} and \ActionFMSettingsDec{}
124 to move the cursor and then press \ActionStdOk{} 106 to move the cursor and then press \ActionStdOk{}
125 to select. Use \ActionStdCancel{} to leave the preset list without selecting 107 to select. Use \ActionStdCancel{} to leave the preset list without selecting
126 anything. 108 anything.
127 109
128 \item[Removing a preset:] 110 \item[Removing a preset:]
129 \opt{ONDIO_PAD}{\ActionFMMenu{} to open the menu, select 111 \ActionFMPreset to go to the presets list.
130 \setting{Preset}}%
131 \nopt{ONDIO_PAD}{\ActionFMPreset} to go to the presets list.
132 Use \ActionFMSettingsInc{} and \ActionFMSettingsDec{} 112 Use \ActionFMSettingsInc{} and \ActionFMSettingsDec{}
133 to move the cursor and then press \ActionStdContext{} 113 to move the cursor and then press \ActionStdContext{}
134 on the preset that you wish to remove, then select \setting{Remove Preset}. 114 on the preset that you wish to remove, then select \setting{Remove Preset}.
135
136 \opt{RECORDER_PAD,ONDIO_PAD}{
137 \item[Recording:]
138 \opt{RECORDER_PAD}{Press \ButtonFThree}%
139 \opt{ONDIO_PAD}{Double press \ButtonMenu}
140 to start recording the currently playing station. Press \ButtonOff{} to
141 stop recording.%
142 \opt{RECORDER_PAD}{ Press \ButtonPlay{} again to seamlessly start recording
143 to a new file.}
144 The settings for the recording can be changed in the
145 \opt{RECORDER_PAD}{\ButtonFOne{} menu}%
146 \opt{ONDIO_PAD}{respective menu reached through the FM radio settings menu
147 (Long \ButtonMenu)}
148 before starting the recording. See \reference{ref:Recordingsettings}
149 for details of recording settings.
150 }
151 \end{description} 115 \end{description}
152 \note{The radio will turn off when starting playback of an audio file.} 116 \note{The radio will turn off when starting playback of an audio file.}
diff --git a/manual/main_menu/main.tex b/manual/main_menu/main.tex
index dd03c2b298..9ddd4bbe93 100644
--- a/manual/main_menu/main.tex
+++ b/manual/main_menu/main.tex
@@ -4,9 +4,7 @@
4\screenshot{main_menu/images/ss-main-menu}{The main menu}{} 4\screenshot{main_menu/images/ss-main-menu}{The main menu}{}
5The \setting{Main Menu} is the screen from which all of the Rockbox functions 5The \setting{Main Menu} is the screen from which all of the Rockbox functions
6can be accessed. This is the first screen you will see when starting Rockbox. 6can be accessed. This is the first screen you will see when starting Rockbox.
7To return to the \setting{Main Menu}, 7To return to the \setting{Main Menu}, press the \ActionStdMenu{} button.
8 \nopt{ONDIO_PAD}{press the \ActionStdMenu{} button.}%
9 \opt{ONDIO_PAD}{hold the \ButtonMenu{} button.}%
10 8
11All settings are stored on the unit. However, Rockbox does not access 9All settings are stored on the unit. However, Rockbox does not access
12the \disk{} solely for the purpose of saving settings. Instead, Rockbox will 10the \disk{} solely for the purpose of saving settings. Instead, Rockbox will
@@ -191,8 +189,6 @@ utilities. A detailed description of the different plugins is to be found in
191\reference{ref:plugins}. 189\reference{ref:plugins}.
192 190
193\section{\label{ref:Info}System} 191\section{\label{ref:Info}System}
194\opt{player}{Use the MINUS and PLUS keys to step through several
195pages of information.}
196 192
197\begin{description} 193\begin{description}
198\item[Rockbox Info:] 194\item[Rockbox Info:]
@@ -203,7 +199,6 @@ pages of information.}
203 Memory size and amount of free space on the two data volumes, this info is 199 Memory size and amount of free space on the two data volumes, this info is
204 given separately for internal memory (\emph{Int}) and for a plugged in 200 given separately for internal memory (\emph{Int}) and for a plugged in
205 memory card 201 memory card
206 \opt{ondio}{(\emph{MMC})}
207 \opt{sansa,e200v2,fuze,fuzev2,clipplus,clipzip}{(\emph{MSD})}. 202 \opt{sansa,e200v2,fuze,fuzev2,clipplus,clipzip}{(\emph{MSD})}.
208}% 203}%
209\nopt{multivolume}{Hard disk size and the amount of free space on the disk.} 204\nopt{multivolume}{Hard disk size and the amount of free space on the disk.}
@@ -234,15 +229,6 @@ pages of information.}
234 settings before asking for help.} 229 settings before asking for help.}
235\end{description} 230\end{description}
236 231
237\opt{player}{
238 \section{Shutdown}
239 This menu option saves the Rockbox configuration and turns off the hard
240 drive before shutting down the machine. For maximum safety this procedure
241 is recommended when turning off the \dap. (There is a very small risk
242 of hard disk corruption otherwise.) See \reference{ref:Safeshutdown}
243 for more details.
244}
245
246\opt{quickscreen} 232\opt{quickscreen}
247{ 233{
248\section{\label{ref:QuickScreen}Quick Screen} 234\section{\label{ref:QuickScreen}Quick Screen}
diff --git a/manual/main_menu/recording_screen.tex b/manual/main_menu/recording_screen.tex
index cbd2b3b956..a3c8ca006c 100644
--- a/manual/main_menu/recording_screen.tex
+++ b/manual/main_menu/recording_screen.tex
@@ -72,15 +72,4 @@ The controls for this screen are:
72 & Open \setting{Recording Settings} (see 72 & Open \setting{Recording Settings} (see
73 \reference{ref:Recordingsettings}).\\ 73 \reference{ref:Recordingsettings}).\\
74 % 74 %
75 \opt{RECORDER_PAD}{
76 \ActionRecFTwo & Quick menu for recording settings. A quick press will
77 leave the screen up (press \ActionRecFTwo{} again to exit), while holding
78 it will close the screen when you release it.\\
79 }
80 %
81 \opt{RECORDER_PAD}{
82 \ActionRecFThree & Quick menu for source setting.\\
83 & Quick/hold works as for \ActionRecFTwo.\\
84 & While recording: Start a new recording file.\\
85 }
86 \end{btnmap} 75 \end{btnmap}
diff --git a/manual/platform/archosfmrecorder.tex b/manual/platform/archosfmrecorder.tex
deleted file mode 100644
index bd7319313d..0000000000
--- a/manual/platform/archosfmrecorder.tex
+++ /dev/null
@@ -1,26 +0,0 @@
1% $Id$ %
2\def\UseOption{recorderv2fm}
3\edef\UseOption{\UseOption,RECORDER_PAD}
4\edef\UseOption{\UseOption,HAVE_BACKLIGHT}
5\edef\UseOption{\UseOption,HAVE_DISK_STORAGE}
6\edef\UseOption{\UseOption,HAVE_CAR_ADAPTER_MODE}
7\edef\UseOption{\UseOption,archos}
8
9\newcommand{\playerman}{Archos}
10\newcommand{\playertype}{Recorder V2/FM}
11\newcommand{\playerlongtype}{Recorder V2 and FM}
12\newcommand{\dapdisplaywidth}{112}
13\newcommand{\dapdisplayheight}{64}
14\newcommand{\dapdisplaydepth}{1}
15\newcommand{\specimg}{archosfmrecorder}
16%Used to name the player, e.g. ...to the \dap
17\newcommand{\dap}{player}
18%For use when referring to the player. E.g. the \daps\ capacity ...
19\newcommand{\daps}{player's}
20\newcommand{\firmwarefilename}{\fname{ajbrec.ajz}}
21\newcommand{\firmwareextension}{\fname{ajz}}
22\newcommand{\screenshotsize}{4cm}
23\newcommand{\disk}{hard disk}
24
25% link external keymap file
26\input{platform/keymap-archosrecorder.tex}
diff --git a/manual/platform/archosondiofm.tex b/manual/platform/archosondiofm.tex
deleted file mode 100644
index b0cc232f16..0000000000
--- a/manual/platform/archosondiofm.tex
+++ /dev/null
@@ -1,28 +0,0 @@
1% $Id$ %
2%platform file for the Ondio FM
3\def\UseOption{ondiofm}
4% To not break the current manual
5\edef\UseOption{\UseOption,ondio}
6\edef\UseOption{\UseOption,ONDIO_PAD}
7\edef\UseOption{\UseOption,archos}
8
9\newcommand{\playerman}{Archos}
10\newcommand{\playertype}{Ondio}
11\newcommand{\playerlongtype}{Ondio 128 FM}
12\newcommand{\dapdisplaywidth}{112}
13\newcommand{\dapdisplayheight}{64}
14\newcommand{\dapdisplaydepth}{1}
15\newcommand{\specimg}{archosondiofm}
16%used for specifying screenshot names common to a target "family"
17\newcommand{\seriesimg}{ondio}
18%Used to name the player, e.g. ...to the \dap
19\newcommand{\dap}{player}
20%For use when referring to the player. E.g. the \daps\ capacity ...
21\newcommand{\daps}{player's}
22\newcommand{\firmwarefilename}{\fname{ajbrec.ajz}}
23\newcommand{\firmwareextension}{\fname{ajz}}
24\newcommand{\screenshotsize}{4cm}
25\newcommand{\disk}{flash storage}
26
27% link external keymap file
28\input{platform/keymap-archosondio.tex}
diff --git a/manual/platform/archosondiosp.tex b/manual/platform/archosondiosp.tex
deleted file mode 100644
index 7a90ca1456..0000000000
--- a/manual/platform/archosondiosp.tex
+++ /dev/null
@@ -1,28 +0,0 @@
1% $Id$ %
2%platform file for the Ondio SP
3\def\UseOption{ondiosp}
4\edef\UseOption{\UseOption,ondio}
5\edef\UseOption{\UseOption,ONDIO_PAD}
6\edef\UseOption{\UseOption,archos}
7\edef\UseOption{\UseOption,rombox}
8
9\newcommand{\playerman}{Archos}
10\newcommand{\playertype}{Ondio}
11\newcommand{\playerlongtype}{Ondio 128 SP}
12\newcommand{\dapdisplaywidth}{112}
13\newcommand{\dapdisplayheight}{64}
14\newcommand{\dapdisplaydepth}{1}
15\newcommand{\specimg}{archosondiosp}
16%used for specifying screenshot names common to a target "family"
17\newcommand{\seriesimg}{ondio}
18%Used to name the player, e.g. ...to the \dap
19\newcommand{\dap}{player}
20%For use when referring to the player. E.g. the \daps\ capacity ...
21\newcommand{\daps}{player's}
22\newcommand{\firmwarefilename}{\fname{ajbrec.ajz}}
23\newcommand{\firmwareextension}{\fname{ajz}}
24\newcommand{\screenshotsize}{4cm}
25\newcommand{\disk}{flash storage}
26
27% link external keymap file
28\input{platform/keymap-archosondio.tex}
diff --git a/manual/platform/archosplayer.tex b/manual/platform/archosplayer.tex
deleted file mode 100644
index 89beb82655..0000000000
--- a/manual/platform/archosplayer.tex
+++ /dev/null
@@ -1,27 +0,0 @@
1% $Id$ %
2\def\UseOption{player}
3\edef\UseOption{\UseOption,PLAYER_PAD}
4\edef\UseOption{\UseOption,HAVE_BACKLIGHT}
5\edef\UseOption{\UseOption,HAVE_DISK_STORAGE}
6\edef\UseOption{\UseOption,HAVE_CAR_ADAPTER_MODE}
7\edef\UseOption{\UseOption,archos}
8\edef\UseOption{\UseOption,rombox}
9
10\newcommand{\playerman}{Archos}
11\newcommand{\playertype}{Studio/Player}
12\newcommand{\playerlongtype}{Jukebox 5000, 6000, Studio 10 and 20}
13\newcommand{\dapdisplaywidth}{char}
14\newcommand{\dapdisplayheight}{11}
15\newcommand{\dapdisplaydepth}{1}
16\newcommand{\specimg}{archosplayer}
17%Used to name the player, e.g. ...to the \dap
18\newcommand{\dap}{player}
19%For use when referring to the player. E.g. the \daps\ capacity ...
20\newcommand{\daps}{player's}
21\newcommand{\firmwarefilename}{\fname{archos.mod}}
22\newcommand{\firmwareextension}{\fname{mod}}
23\newcommand{\screenshotsize}{4cm}
24\newcommand{\disk}{hard disk}
25
26% link external keymap file
27\input{platform/keymap-archosplayer.tex}
diff --git a/manual/platform/archosrecorder.tex b/manual/platform/archosrecorder.tex
deleted file mode 100644
index 2c0677f31d..0000000000
--- a/manual/platform/archosrecorder.tex
+++ /dev/null
@@ -1,27 +0,0 @@
1% $Id$ %
2\def\UseOption{recorder}
3\edef\UseOption{\UseOption,RECORDER_PAD}
4\edef\UseOption{\UseOption,HAVE_BACKLIGHT}
5\edef\UseOption{\UseOption,HAVE_DISK_STORAGE}
6\edef\UseOption{\UseOption,HAVE_CAR_ADAPTER_MODE}
7\edef\UseOption{\UseOption,archos}
8
9\newcommand{\playerman}{Archos}
10\newcommand{\playertype}{Recorder}
11\newcommand{\playerlongtype}{Recorder 6, 10, 15 and 20}
12\newcommand{\dapdisplaywidth}{112}
13\newcommand{\dapdisplayheight}{64}
14\newcommand{\dapdisplaydepth}{1}
15
16\newcommand{\specimg}{archosrecorder}
17%Used to name the player, e.g. ...to the \dap
18\newcommand{\dap}{player}
19%For use when referring to the player. E.g. the \daps\ capacity ...
20\newcommand{\daps}{player's}
21\newcommand{\firmwarefilename}{\fname{ajbrec.ajz}}
22\newcommand{\firmwareextension}{\fname{ajz}}
23\newcommand{\screenshotsize}{4cm}
24\newcommand{\disk}{hard disk}
25
26% link external keymap file
27\input{platform/keymap-archosrecorder.tex}
diff --git a/manual/plugins/alpinecdc.tex b/manual/plugins/alpinecdc.tex
deleted file mode 100644
index 09e5a81b89..0000000000
--- a/manual/plugins/alpinecdc.tex
+++ /dev/null
@@ -1,39 +0,0 @@
1\subsection{Alpine CD changer emulator}
2This plugin emulates an Alpine CD changer. It allows to plug the Archos to a
3compatible head unit and control the playback from there, too. Currently
4implemented is track change, shuffle, seek, but no disk change. The plugin is a
5TSR, meaning it silently operates in the background once started. It will keep
6doing so until a new plugin is started.
7Alpine also did M-Bus as OEM for other brands (Honda, Acura, Volvo, BMW, etc.)
8Nowadays Alpine uses a different protocol, called Ai-Net, not supported by this
9plugin. (As well as all other protocols, please do not ask for such!)
10
11\subsubsection{The cable}
12Hookup to Archos works by connecting the headphone output including the remote
13pin (you need a 4-ring 3.5 mm plug for that) to the changer jack of the radio.
14M-Bus radios have a DIN-style circular jack with 8 pins (7 in a $\sim$ 270 degree
15circle, one in the center). A standard 5-pin DIN plug is OK for this, since we
16do not use the other (power) pins.
17
18As OEM, they shuffled the pins around a bit, better check first if it is not
19genuine Alpine. The bus pin is pulled high to 12 volts with a $\sim$ 2kOhm resistor,
20pulses driven low. Because it is open collector, this is not harmful to the
21Archos.\\
22ASCII art of the 4-pin headphone plug:
23\begin{verbatim}
24/ \
25\_/ left -> Alpine pin 5
26|_| right -> Alpine pin 4
27|_| remote -> Alpine pin 1
28|_| ground -> Alpine pin 2 + 3
29\end{verbatim}
30
31The remote pin can be programmed bidirectional, that is the reason this works.
32Very luckily the M-Bus uses a single wire communication and the two radios I
33tried are happy with the 3.3 Volt level the Archos can deliver. So the
34connection is a simple cable! For all protocols requiring more lines, an
35external controller would be necessary.
36
37\note{Archos FMs do not have the remote pin internally connected, but
38 one unit that was opened was internally prepared for it, a matter of closing a
39 bridge.}
diff --git a/manual/plugins/blackjack.tex b/manual/plugins/blackjack.tex
index f24c92ea00..03fad7b84f 100644
--- a/manual/plugins/blackjack.tex
+++ b/manual/plugins/blackjack.tex
@@ -13,7 +13,7 @@ visit\\
13\url{http://www.blackjackinfo.com/blackjack-rules.php} 13\url{http://www.blackjackinfo.com/blackjack-rules.php}
14 14
15 \begin{btnmap} 15 \begin{btnmap}
16 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 16 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
17 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_C200_PAD,PBELL_VIBE500_PAD% 17 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_C200_PAD,PBELL_VIBE500_PAD%
18 ,SANSA_FUZEPLUS_PAD,SANSA_CLIP_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 18 ,SANSA_FUZEPLUS_PAD,SANSA_CLIP_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
19 {\ButtonLeft{} / \ButtonRight{} / \ButtonUp{} / \ButtonDown} 19 {\ButtonLeft{} / \ButtonRight{} / \ButtonUp{} / \ButtonDown}
@@ -26,22 +26,20 @@ visit\\
26 \opt{COWON_D2_PAD}{\TouchMidRight{} / \TouchMidLeft} 26 \opt{COWON_D2_PAD}{\TouchMidRight{} / \TouchMidLeft}
27 \opt{HAVEREMOTEKEYMAP}{& } 27 \opt{HAVEREMOTEKEYMAP}{& }
28 & Enter betting amount\\ 28 & Enter betting amount\\
29 \opt{RECORDER_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD,SAMSUNG_YH92X_PAD% 29 \opt{IRIVER_H10_PAD,GIGABEAT_S_PAD,SAMSUNG_YH92X_PAD%
30 ,SAMSUNG_YH820_PAD}{\ButtonPlay} 30 ,SAMSUNG_YH820_PAD}{\ButtonPlay}
31 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 31 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
32 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD% 32 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD%
33 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD% 33 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD%
34 }{\ButtonSelect} 34 }{\ButtonSelect}
35 \opt{ONDIO_PAD}{\ButtonMenu}
36 \opt{COWON_D2_PAD}{\TouchTopRight} 35 \opt{COWON_D2_PAD}{\TouchTopRight}
37 \opt{PBELL_VIBE500_PAD}{\ButtonOK} 36 \opt{PBELL_VIBE500_PAD}{\ButtonOK}
38 \opt{MPIO_HD300_PAD}{\ButtonEnter} 37 \opt{MPIO_HD300_PAD}{\ButtonEnter}
39 \opt{HAVEREMOTEKEYMAP}{& } 38 \opt{HAVEREMOTEKEYMAP}{& }
40 & Hit (Draw new card) / Select\\ 39 & Hit (Draw new card) / Select\\
41 \opt{RECORDER_PAD}{\ButtonFOne}
42 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD}{\ButtonRec} 40 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD}{\ButtonRec}
43 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 41 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
44 \opt{ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonRight} 42 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonRight}
45 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolDown} 43 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolDown}
46 \opt{MROBE100_PAD}{\ButtonDisplay} 44 \opt{MROBE100_PAD}{\ButtonDisplay}
47 \opt{COWON_D2_PAD}{\TouchBottomLeft} 45 \opt{COWON_D2_PAD}{\TouchBottomLeft}
@@ -50,12 +48,10 @@ visit\\
50 \opt{MPIO_HD300_PAD}{\ButtonPlay} 48 \opt{MPIO_HD300_PAD}{\ButtonPlay}
51 \opt{HAVEREMOTEKEYMAP}{& } 49 \opt{HAVEREMOTEKEYMAP}{& }
52 & Stay (End hand)\\ 50 & Stay (End hand)\\
53 \opt{RECORDER_PAD}{\ButtonFTwo}
54 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_S_PAD}{\ButtonSelect} 51 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_S_PAD}{\ButtonSelect}
55 \opt{IAUDIO_X5_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay} 52 \opt{IAUDIO_X5_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay}
56 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew} 53 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew}
57 \opt{GIGABEAT_PAD}{\ButtonA} 54 \opt{GIGABEAT_PAD}{\ButtonA}
58 \opt{ONDIO_PAD}{\ButtonUp}
59 \opt{MROBE100_PAD}{\ButtonDown} 55 \opt{MROBE100_PAD}{\ButtonDown}
60 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonLeft} 56 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonLeft}
61 \opt{COWON_D2_PAD}{\ButtonMinus} 57 \opt{COWON_D2_PAD}{\ButtonMinus}
@@ -63,7 +59,7 @@ visit\\
63 \opt{MPIO_HD300_PAD}{\ButtonRec} 59 \opt{MPIO_HD300_PAD}{\ButtonRec}
64 \opt{HAVEREMOTEKEYMAP}{& } 60 \opt{HAVEREMOTEKEYMAP}{& }
65 & Double down\\ 61 & Double down\\
66 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 62 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
67 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 63 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
68 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 64 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
69 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 65 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/brickmania.tex b/manual/plugins/brickmania.tex
index 8065a5cbd4..b6195842a3 100644
--- a/manual/plugins/brickmania.tex
+++ b/manual/plugins/brickmania.tex
@@ -22,7 +22,7 @@ effect, you must catch it with the paddle. Look out for the bad ones.\\
22\end{table} 22\end{table}
23 23
24 \begin{btnmap} 24 \begin{btnmap}
25 \opt{RECORDER_PAD,IAUDIO_X5_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 25 \opt{IAUDIO_X5_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD%
26 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD% 26 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD%
27 ,IPOD_3G_PAD,SANSA_E200_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD% 27 ,IPOD_3G_PAD,SANSA_E200_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD%
28 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 28 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -36,8 +36,7 @@ effect, you must catch it with the paddle. Look out for the bad ones.\\
36 \opt{MPIO_HD300_PAD}{\ButtonRew{} / \ButtonFF{}} 36 \opt{MPIO_HD300_PAD}{\ButtonRew{} / \ButtonFF{}}
37 \opt{HAVEREMOTEKEYMAP}{& } 37 \opt{HAVEREMOTEKEYMAP}{& }
38 & Moves the paddle\\ 38 & Moves the paddle\\
39 \opt{RECORDER_PAD,IAUDIO_X5_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay\ / \ButtonUp} 39 \opt{IAUDIO_X5_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay\ / \ButtonUp}
40 \opt{ONDIO_PAD}{\ButtonMenu\ / \ButtonUp}
41 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 40 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
42 ,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect\ / \ButtonUp} 41 ,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect\ / \ButtonUp}
43 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD% 42 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD%
@@ -48,7 +47,7 @@ effect, you must catch it with the paddle. Look out for the bad ones.\\
48 \opt{MPIO_HD300_PAD}{\ButtonEnter{}} 47 \opt{MPIO_HD300_PAD}{\ButtonEnter{}}
49 \opt{HAVEREMOTEKEYMAP}{& } 48 \opt{HAVEREMOTEKEYMAP}{& }
50 & Release the ball / Fire\\ 49 & Release the ball / Fire\\
51 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 50 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
52 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 51 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
53 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 52 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
54 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 53 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/bubbles.tex b/manual/plugins/bubbles.tex
index c9722624d5..126a42c5f9 100644
--- a/manual/plugins/bubbles.tex
+++ b/manual/plugins/bubbles.tex
@@ -9,8 +9,8 @@ entire board is shifted down every time a certain number of shots have been
9fired. Points are awarded depending on how quickly the level was completed. 9fired. Points are awarded depending on how quickly the level was completed.
10 10
11 \begin{btnmap} 11 \begin{btnmap}
12 \opt{ONDIO_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginSelect} 12 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginSelect}
13 \nopt{ONDIO_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginUp} 13 \nopt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginUp}
14 \opt{HAVEREMOTEKEYMAP}{& \PluginRCUp} 14 \opt{HAVEREMOTEKEYMAP}{& \PluginRCUp}
15 & Pause game\\ 15 & Pause game\\
16 16
@@ -19,8 +19,8 @@ fired. Points are awarded depending on how quickly the level was completed.
19 \opt{HAVEREMOTEKEYMAP}{& \PluginRCLeft{} / \PluginRCRight} 19 \opt{HAVEREMOTEKEYMAP}{& \PluginRCLeft{} / \PluginRCRight}
20 & Aim the bubble\\ 20 & Aim the bubble\\
21 21
22 \opt{ONDIO_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginUp} 22 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginUp}
23 \nopt{ONDIO_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginSelect} 23 \nopt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\PluginSelect}
24 \opt{HAVEREMOTEKEYMAP}{& \PluginRCSelect} 24 \opt{HAVEREMOTEKEYMAP}{& \PluginRCSelect}
25 & Fire bubble\\ 25 & Fire bubble\\
26 26
diff --git a/manual/plugins/calculator.tex b/manual/plugins/calculator.tex
index c760ab1937..0daacc3158 100644
--- a/manual/plugins/calculator.tex
+++ b/manual/plugins/calculator.tex
@@ -7,12 +7,12 @@ standard calculator. Pressing the ``1st'' and ``2nd'' buttons will toggle betwee
7 other available math functions. 7 other available math functions.
8 8
9\begin{btnmap} 9\begin{btnmap}
10 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD% 10 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD%
11 ,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 11 ,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
12 ,GIGABEAT_S_PAD,MROBE100_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD% 12 ,GIGABEAT_S_PAD,MROBE100_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD%
13 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 13 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
14 {\ButtonLeft{} / \ButtonRight{} /} 14 {\ButtonLeft{} / \ButtonRight{} /}
15 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 15 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
16 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 16 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
17 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 17 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
18 {\ButtonUp{} / \ButtonDown} 18 {\ButtonUp{} / \ButtonDown}
@@ -25,8 +25,6 @@ standard calculator. Pressing the ``1st'' and ``2nd'' buttons will toggle betwee
25 \opt{HAVEREMOTEKEYMAP}{& } 25 \opt{HAVEREMOTEKEYMAP}{& }
26 & Move around the keypad\\ 26 & Move around the keypad\\
27 % 27 %
28 \opt{RECORDER_PAD}{\ButtonPlay}
29 \opt{ONDIO_PAD}{\ButtonMenu}
30 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 28 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
31 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 29 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
32 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 30 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
@@ -39,8 +37,7 @@ standard calculator. Pressing the ``1st'' and ``2nd'' buttons will toggle betwee
39 \opt{HAVEREMOTEKEYMAP}{& } 37 \opt{HAVEREMOTEKEYMAP}{& }
40 & Select a button\\ 38 & Select a button\\
41 % 39 %
42 \nopt{ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD}{ 40 \nopt{IPOD_4G_PAD,IPOD_3G_PAD}{
43 \opt{RECORDER_PAD}{\ButtonFOne}
44 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD% 41 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD%
45 ,SANSA_C200_PAD,MPIO_HD200_PAD}{\ButtonRec} 42 ,SANSA_C200_PAD,MPIO_HD200_PAD}{\ButtonRec}
46 \opt{SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonHome} 43 \opt{SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonHome}
@@ -55,16 +52,13 @@ standard calculator. Pressing the ``1st'' and ``2nd'' buttons will toggle betwee
55 & Delete last entered digit or clear after calculation\\ 52 & Delete last entered digit or clear after calculation\\
56 % 53 %
57 } 54 }
58 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,SAMSUNG_YH820_PAD}{ 55 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SAMSUNG_YH820_PAD}{
59 \opt{RECORDER_PAD}{\ButtonFTwo}
60 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 56 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
61 \opt{SAMSUNG_YH820_PAD}{\ButtonRec} 57 \opt{SAMSUNG_YH820_PAD}{\ButtonRec}
62 \opt{HAVEREMOTEKEYMAP}{& } 58 \opt{HAVEREMOTEKEYMAP}{& }
63 & Cycle through the 4 basic operators\\ 59 & Cycle through the 4 basic operators\\
64 % 60 %
65 } 61 }
66 \opt{RECORDER_PAD}{\ButtonFThree}
67 \opt{ONDIO_PAD}{Long \ButtonMenu}
68 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 62 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
69 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD 63 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD
70 ,PBELL_VIBE500_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD} 64 ,PBELL_VIBE500_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD}
@@ -76,7 +70,7 @@ standard calculator. Pressing the ``1st'' and ``2nd'' buttons will toggle betwee
76 \opt{HAVEREMOTEKEYMAP}{& } 70 \opt{HAVEREMOTEKEYMAP}{& }
77 & Calculate\\ 71 & Calculate\\
78 % 72 %
79 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 73 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
80 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 74 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
81 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 75 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
82 ,MROBE100_PAD,COWON_D2_PAD}{\ButtonPower} 76 ,MROBE100_PAD,COWON_D2_PAD}{\ButtonPower}
diff --git a/manual/plugins/calendar.tex b/manual/plugins/calendar.tex
index 7df655accb..fb4291f250 100644
--- a/manual/plugins/calendar.tex
+++ b/manual/plugins/calendar.tex
@@ -8,12 +8,12 @@ yearly, monthly, and weekly memos.
8You can select what day is first day of week by the setting \setting{First Day of Week} in the menu. 8You can select what day is first day of week by the setting \setting{First Day of Week} in the menu.
9 9
10\begin{btnmap} 10\begin{btnmap}
11 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 11 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
12 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,IPOD_4G_PAD% 12 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,IPOD_4G_PAD%
13 ,IPOD_3G_PAD,SANSA_E200_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD 13 ,IPOD_3G_PAD,SANSA_E200_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD
14 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 14 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
15 {\ButtonLeft{} / \ButtonRight{} /} 15 {\ButtonLeft{} / \ButtonRight{} /}
16 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 16 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
17 ,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 17 ,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
18 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 18 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
19 {\ButtonUp{} / \ButtonDown} 19 {\ButtonUp{} / \ButtonDown}
@@ -24,7 +24,6 @@ You can select what day is first day of week by the setting \setting{First Day o
24 \opt{HAVEREMOTEKEYMAP}{& } 24 \opt{HAVEREMOTEKEYMAP}{& }
25 & Move the selector\\ 25 & Move the selector\\
26 % 26 %
27 \opt{RECORDER_PAD}{\ButtonPlay}
28 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 27 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
29 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD% 28 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD%
30 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 29 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
@@ -38,7 +37,6 @@ You can select what day is first day of week by the setting \setting{First Day o
38 \opt{MPIO_HD300_PAD}{\ButtonRew / \ButtonFF 37 \opt{MPIO_HD300_PAD}{\ButtonRew / \ButtonFF
39 & Previous / Next week\\} 38 & Previous / Next week\\}
40 % 39 %
41 \opt{RECORDER_PAD}{\ButtonOn{} + \ButtonUp{} / \ButtonDown}
42 \opt{MROBE100_PAD}{\ButtonMenu{} + \ButtonUp{} / \ButtonDown} 40 \opt{MROBE100_PAD}{\ButtonMenu{} + \ButtonUp{} / \ButtonDown}
43 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode{} / \ButtonRec} 41 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode{} / \ButtonRec}
44 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonPlay{} / \ButtonMenu} 42 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonPlay{} / \ButtonMenu}
@@ -56,7 +54,7 @@ You can select what day is first day of week by the setting \setting{First Day o
56 \opt{HAVEREMOTEKEYMAP}{& } 54 \opt{HAVEREMOTEKEYMAP}{& }
57 & Previous / Next month\\ 55 & Previous / Next month\\
58 % 56 %
59 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 57 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
60 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu{} + \ButtonSelect} 58 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu{} + \ButtonSelect}
61 \opt{GIGABEAT_S_PAD}{\ButtonBack} 59 \opt{GIGABEAT_S_PAD}{\ButtonBack}
62 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonPower} 60 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonPower}
diff --git a/manual/plugins/chess_clock.tex b/manual/plugins/chess_clock.tex
index 9b3f38502f..e6efef8cce 100644
--- a/manual/plugins/chess_clock.tex
+++ b/manual/plugins/chess_clock.tex
@@ -6,10 +6,10 @@ used in any kind of game with up to ten players.
6 6
7\subsubsection{Setup} 7\subsubsection{Setup}
8 \begin{btnmap} 8 \begin{btnmap}
9 \opt{PLAYER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD% 9 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD%
10 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 10 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
11 {\ButtonRight{} / \ButtonLeft} 11 {\ButtonRight{} / \ButtonLeft}
12 \opt{RECORDER_PAD,ONDIO_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 12 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
13 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 13 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
14 {\ButtonUp{} / \ButtonDown} 14 {\ButtonUp{} / \ButtonDown}
15 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack{} / \ButtonScrollFwd} 15 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack{} / \ButtonScrollFwd}
@@ -18,9 +18,8 @@ used in any kind of game with up to ten players.
18 \opt{HAVEREMOTEKEYMAP}{& } 18 \opt{HAVEREMOTEKEYMAP}{& }
19 & Increase / decrease displayed Value\\ 19 & Increase / decrease displayed Value\\
20 % 20 %
21 \opt{PLAYER_PAD,RECORDER_PAD,IRIVER_H10_PAD}{\ButtonPlay} 21 \opt{IRIVER_H10_PAD}{\ButtonPlay}
22 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 22 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
23 \opt{ONDIO_PAD}{\ButtonRight}
24 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 23 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
25 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}{\ButtonSelect} 24 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}{\ButtonSelect}
26 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRight{} or \ButtonPlay} 25 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRight{} or \ButtonPlay}
@@ -30,9 +29,8 @@ used in any kind of game with up to ten players.
30 \opt{HAVEREMOTEKEYMAP}{& } 29 \opt{HAVEREMOTEKEYMAP}{& }
31 & Move to next screen\\ 30 & Move to next screen\\
32 % 31 %
33 \opt{PLAYER_PAD}{\ButtonStop} 32 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
34 \opt{ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 33 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
35 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
36 \opt{IAUDIO_X5_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec} 34 \opt{IAUDIO_X5_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec}
37 \opt{IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonPower} 35 \opt{IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonPower}
38 \opt{SANSA_FUZE_PAD}{Long \ButtonHome} 36 \opt{SANSA_FUZE_PAD}{Long \ButtonHome}
@@ -60,8 +58,6 @@ time left if different).
60Keys are as follows: 58Keys are as follows:
61 59
62 \begin{btnmap} 60 \begin{btnmap}
63 \opt{PLAYER_PAD}{\ButtonOn}
64 \opt{RECORDER_PAD,ONDIO_PAD}{\ButtonOff}
65 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect} 61 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect}
66 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonPlay} 62 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonPlay}
67 \opt{IAUDIO_X5_PAD,PBELL_VIBE500_PAD}{\ButtonRec} 63 \opt{IAUDIO_X5_PAD,PBELL_VIBE500_PAD}{\ButtonRec}
@@ -74,8 +70,7 @@ Keys are as follows:
74 \opt{HAVEREMOTEKEYMAP}{& } 70 \opt{HAVEREMOTEKEYMAP}{& }
75 & Exit plugin \\ 71 & Exit plugin \\
76 % 72 %
77 \opt{PLAYER_PAD}{\ButtonStop} 73 \opt{IPOD_4G_PAD,IPOD_3G_PAD,PBELL_VIBE500_PAD}{\ButtonLeft}
78 \opt{RECORDER_PAD,ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD,PBELL_VIBE500_PAD}{\ButtonLeft}
79 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 74 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
80 \opt{IAUDIO_X5_PAD}{\ButtonPower} 75 \opt{IAUDIO_X5_PAD}{\ButtonPower}
81 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 76 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
@@ -87,9 +82,8 @@ Keys are as follows:
87 \opt{HAVEREMOTEKEYMAP}{& } 82 \opt{HAVEREMOTEKEYMAP}{& }
88 & Restart round for the current player \\ 83 & Restart round for the current player \\
89 % 84 %
90 \opt{PLAYER_PAD,RECORDER_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD}{\ButtonPlay} 85 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD}{\ButtonPlay}
91 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 86 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
92 \opt{ONDIO_PAD}{\ButtonRight}
93 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 87 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
94 ,MROBE100_PAD,SANSA_FUZE_PAD} 88 ,MROBE100_PAD,SANSA_FUZE_PAD}
95 {\ButtonSelect} 89 {\ButtonSelect}
@@ -98,18 +92,18 @@ Keys are as follows:
98 \opt{HAVEREMOTEKEYMAP}{& } 92 \opt{HAVEREMOTEKEYMAP}{& }
99 & Pause the time (press again to continue) \\ 93 & Pause the time (press again to continue) \\
100 % 94 %
101 \opt{PLAYER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD% 95 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD%
102 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonRight} 96 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonRight}
103 \opt{RECORDER_PAD,ONDIO_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 97 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
104 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 98 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
105 {\ButtonUp} 99 {\ButtonUp}
106 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack} 100 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack}
107 \opt{HAVEREMOTEKEYMAP}{& } 101 \opt{HAVEREMOTEKEYMAP}{& }
108 & Switch to next player \\ 102 & Switch to next player \\
109 % 103 %
110 \opt{PLAYER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD% 104 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD%
111 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonLeft} 105 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZE_PAD}{\ButtonLeft}
112 \opt{RECORDER_PAD,ONDIO_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 106 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
113 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 107 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
114 {\ButtonDown} 108 {\ButtonDown}
115 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd} 109 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd}
@@ -118,9 +112,8 @@ Keys are as follows:
118 \opt{HAVEREMOTEKEYMAP}{& } 112 \opt{HAVEREMOTEKEYMAP}{& }
119 & Switch to previous player \\ 113 & Switch to previous player \\
120 % 114 %
121 \opt{PLAYER_PAD,ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 115 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
122 ,MROBE100_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}{\ButtonMenu} 116 ,MROBE100_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}{\ButtonMenu}
123 \opt{RECORDER_PAD}{\ButtonFOne}
124 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec} 117 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec}
125 \opt{IAUDIO_X5_PAD}{\ButtonSelect} 118 \opt{IAUDIO_X5_PAD}{\ButtonSelect}
126 \opt{SANSA_FUZEPLUS_PAD}{Long \ButtonSelect} 119 \opt{SANSA_FUZEPLUS_PAD}{Long \ButtonSelect}
@@ -130,9 +123,9 @@ Keys are as follows:
130 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonLeft} 123 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonLeft}
131 \opt{HAVEREMOTEKEYMAP}{& } 124 \opt{HAVEREMOTEKEYMAP}{& }
132 & Open menu % 125 & Open menu %
133 \opt{PLAYER_PAD,RECORDER_PAD,IRIVER_H10_PAD}{(\ButtonPlay\ to select.)}% 126 \opt{IRIVER_H10_PAD}{(\ButtonPlay\ to select.)}%
134 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{(\ButtonOn\ to select.)}% 127 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{(\ButtonOn\ to select.)}%
135 \opt{ONDIO_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{(\ButtonRight\ to select.)}% 128 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{(\ButtonRight\ to select.)}%
136 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 129 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
137 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 130 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
138 {(\ButtonSelect\ to select.)}% 131 {(\ButtonSelect\ to select.)}%
diff --git a/manual/plugins/chessbox.tex b/manual/plugins/chessbox.tex
index 696da720f5..bf90b9974f 100644
--- a/manual/plugins/chessbox.tex
+++ b/manual/plugins/chessbox.tex
@@ -23,10 +23,6 @@ you resume the game. The menu also allows the user to reload the last game
23saved, save the current position and start a new game without having to quit 23saved, save the current position and start a new game without having to quit
24the game. 24the game.
25 25
26\opt{archosrecorder,archosfmrecorder,ondio}{
27\note{This plugin will stop playback.}
28}
29
30\subsubsection{Keys} 26\subsubsection{Keys}
31 \begin{btnmap} 27 \begin{btnmap}
32 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu, \ButtonPlay, \ButtonLeft, \ButtonRight} 28 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu, \ButtonPlay, \ButtonLeft, \ButtonRight}
@@ -34,8 +30,7 @@ the game.
34 \nopt{IPOD_4G_PAD,IPOD_3G_PAD,MPIO_HD300_PAD}{Direction keys} 30 \nopt{IPOD_4G_PAD,IPOD_3G_PAD,MPIO_HD300_PAD}{Direction keys}
35 \opt{HAVEREMOTEKEYMAP}{& } 31 \opt{HAVEREMOTEKEYMAP}{& }
36 & Move the cursor\\ 32 & Move the cursor\\
37 \opt{RECORDER_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 33 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
38 \opt{ONDIO_PAD}{\ButtonMenu}
39 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 34 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
40 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 35 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
41 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 36 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
@@ -46,8 +41,6 @@ the game.
46 \opt{MPIO_HD300_PAD}{\ButtonEnter} 41 \opt{MPIO_HD300_PAD}{\ButtonEnter}
47 \opt{HAVEREMOTEKEYMAP}{& } 42 \opt{HAVEREMOTEKEYMAP}{& }
48 & Pick up / Drop piece\\ 43 & Pick up / Drop piece\\
49 \opt{RECORDER_PAD}{\ButtonFOne}
50 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
51 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 44 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
52 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} 45 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight}
53 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} 46 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
@@ -63,8 +56,7 @@ the game.
63 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 56 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
64 \opt{HAVEREMOTEKEYMAP}{& } 57 \opt{HAVEREMOTEKEYMAP}{& }
65 & Change level\\ 58 & Change level\\
66 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 59 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
67 \opt{ONDIO_PAD}{Long \ButtonMenu}
68 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 60 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
69 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 61 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
70 ,MPIO_HD300_PAD}{\ButtonPlay} 62 ,MPIO_HD300_PAD}{\ButtonPlay}
@@ -77,7 +69,7 @@ the game.
77 \opt{SAMSUNG_YH820_PAD}{\ButtonRec} 69 \opt{SAMSUNG_YH820_PAD}{\ButtonRec}
78 \opt{HAVEREMOTEKEYMAP}{& } 70 \opt{HAVEREMOTEKEYMAP}{& }
79 & Force play\\ 71 & Force play\\
80 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 72 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
81 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 73 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
82 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 74 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
83 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 75 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/chip8emulator.tex b/manual/plugins/chip8emulator.tex
index 977db20b5a..acad55ef87 100644
--- a/manual/plugins/chip8emulator.tex
+++ b/manual/plugins/chip8emulator.tex
@@ -37,7 +37,7 @@ The default keymappings are:
37 & 37 &
38 % key "off" 38 % key "off"
39 \begin{sideways} 39 \begin{sideways}
40 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 40 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
41 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 41 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
42 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD% 42 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD%
43 ,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 43 ,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
@@ -58,8 +58,7 @@ The default keymappings are:
58 % "Key "1" 58 % "Key "1"
59 \begin{sideways} 59 \begin{sideways}
60 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack} 60 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack}
61 \opt{RECORDER_PAD}{\ButtonFOne} 61 \opt{SANSA_FUZEPLUS_PAD}{\ButtonUp}
62 \opt{ONDIO_PAD,SANSA_FUZEPLUS_PAD}{\ButtonUp}
63 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonMenu} 62 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonMenu}
64 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRew} 63 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRew}
65 \end{sideways} 64 \end{sideways}
@@ -69,7 +68,7 @@ The default keymappings are:
69 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD} 68 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}
70 {\ButtonScrollBack} 69 {\ButtonScrollBack}
71 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD% 70 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD%
72 ,RECORDER_PAD,ONDIO_PAD,SANSA_FUZEPLUS_PAD,GIGABEAT_S_PAD% 71 ,SANSA_FUZEPLUS_PAD,GIGABEAT_S_PAD%
73 ,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp} 72 ,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp}
74 \opt{IRIVER_H10_PAD}{\ButtonScrollUp} 73 \opt{IRIVER_H10_PAD}{\ButtonScrollUp}
75 \opt{SANSA_C200_PAD}{\ButtonVolUp} 74 \opt{SANSA_C200_PAD}{\ButtonVolUp}
@@ -78,7 +77,6 @@ The default keymappings are:
78 & 77 &
79 % Key "3" 78 % Key "3"
80 \begin{sideways} 79 \begin{sideways}
81 \opt{RECORDER_PAD}{\ButtonFThree}
82 \opt{MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay} 80 \opt{MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay}
83 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolDown} 81 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolDown}
84 \opt{MPIO_HD200_PAD}{\ButtonFunc} 82 \opt{MPIO_HD200_PAD}{\ButtonFunc}
@@ -87,7 +85,7 @@ The default keymappings are:
87 & 85 &
88 % Key "4" 86 % Key "4"
89 \begin{sideways} 87 \begin{sideways}
90 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD% 88 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD%
91 ,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD% 89 ,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD%
92 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 90 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
93 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 91 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
@@ -98,8 +96,6 @@ The default keymappings are:
98 & 96 &
99 % Key "5" 97 % Key "5"
100 \begin{sideways} 98 \begin{sideways}
101 \opt{RECORDER_PAD}{\ButtonPlay}
102 \opt{ONDIO_PAD}{\ButtonMenu}
103 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD% 99 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD%
104 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 100 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
105 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 101 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
@@ -113,7 +109,7 @@ The default keymappings are:
113 & 109 &
114 % Key "6" 110 % Key "6"
115 \begin{sideways} 111 \begin{sideways}
116 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD% 112 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD%
117 ,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD% 113 ,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD%
118 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 114 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
119 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 115 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
@@ -124,7 +120,6 @@ The default keymappings are:
124 & 120 &
125 % Key "7" 121 % Key "7"
126 \begin{sideways} 122 \begin{sideways}
127 \opt{RECORDER_PAD}{\ButtonFTwo}
128 \opt{MROBE100_PAD}{\ButtonDisplay} 123 \opt{MROBE100_PAD}{\ButtonDisplay}
129 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolUp} 124 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolUp}
130 \opt{MPIO_HD200_PAD}{\ButtonVolUp} 125 \opt{MPIO_HD200_PAD}{\ButtonVolUp}
@@ -134,7 +129,7 @@ The default keymappings are:
134 & 129 &
135 % Key "8" 130 % Key "8"
136 \begin{sideways} 131 \begin{sideways}
137 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 132 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD%
138 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 133 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
139 ,SAMSUNG_YH820_PAD}{\ButtonDown} 134 ,SAMSUNG_YH820_PAD}{\ButtonDown}
140 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD} 135 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}
@@ -146,7 +141,6 @@ The default keymappings are:
146 & 141 &
147 % Key "9" 142 % Key "9"
148 \begin{sideways} 143 \begin{sideways}
149 \opt{RECORDER_PAD}{\ButtonOn}
150 \opt{GIGABEAT_PAD}{\ButtonA} 144 \opt{GIGABEAT_PAD}{\ButtonA}
151 \opt{GIGABEAT_S_PAD}{\ButtonPlay} 145 \opt{GIGABEAT_S_PAD}{\ButtonPlay}
152 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomRight} 146 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomRight}
diff --git a/manual/plugins/chopper.tex b/manual/plugins/chopper.tex
index d0296cebcb..104b11f465 100644
--- a/manual/plugins/chopper.tex
+++ b/manual/plugins/chopper.tex
@@ -6,8 +6,6 @@
6 ceiling, or the floor. How long can you fly your chopper? 6 ceiling, or the floor. How long can you fly your chopper?
7 7
8 \begin{btnmap} 8 \begin{btnmap}
9 \opt{RECORDER_PAD}{\ButtonPlay}%
10 \opt{ONDIO_PAD}{\ButtonUp{} / \ButtonMenu}
11 \opt{IRIVER_H10_PAD}{\ButtonRight} 9 \opt{IRIVER_H10_PAD}{\ButtonRight}
12 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD% 10 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD%
13 ,GIGABEAT_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 11 ,GIGABEAT_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
@@ -21,7 +19,7 @@
21 \opt{HAVEREMOTEKEYMAP}{& } 19 \opt{HAVEREMOTEKEYMAP}{& }
22 & Make chopper fly\\ 20 & Make chopper fly\\
23 21
24 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 22 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
25 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,MROBE100_PAD,SANSA_E200_PAD% 23 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,MROBE100_PAD,SANSA_E200_PAD%
26 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 24 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
27 \opt{SANSA_FUZE_PAD}{\ButtonHome} 25 \opt{SANSA_FUZE_PAD}{\ButtonHome}
diff --git a/manual/plugins/clix.tex b/manual/plugins/clix.tex
index 3e49ed5803..4752bd1204 100644
--- a/manual/plugins/clix.tex
+++ b/manual/plugins/clix.tex
@@ -7,12 +7,12 @@ The more blocks you remove per turn, the more points you get.
7 7
8 \begin{btnmap} 8 \begin{btnmap}
9 \nopt{touchscreen}{ 9 \nopt{touchscreen}{
10 \opt{RECORDER_PAD,IRIVER_H10_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 10 \opt{IRIVER_H10_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD%
11 ,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 11 ,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
12 ,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD% 12 ,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD%
13 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 13 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
14 {\ButtonLeft/\ButtonRight/} 14 {\ButtonLeft/\ButtonRight/}
15 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD% 15 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD%
16 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD% 16 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD%
17 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 17 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
18 ,SAMSUNG_YH820_PAD} 18 ,SAMSUNG_YH820_PAD}
@@ -21,8 +21,7 @@ The more blocks you remove per turn, the more points you get.
21 \opt{IRIVER_H10_PAD}{\ButtonScrollUp/\ButtonScrollDown} 21 \opt{IRIVER_H10_PAD}{\ButtonScrollUp/\ButtonScrollDown}
22 \opt{HAVEREMOTEKEYMAP}{& } 22 \opt{HAVEREMOTEKEYMAP}{& }
23 & Move the cursor around the blocks \\ 23 & Move the cursor around the blocks \\
24 \opt{RECORDER_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 24 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
25 \opt{ONDIO_PAD}{\ButtonMenu}
26 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD% 25 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD%
27 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD% 26 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD%
28 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD} 27 ,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}
@@ -31,7 +30,7 @@ The more blocks you remove per turn, the more points you get.
31 \opt{HAVEREMOTEKEYMAP}{& } 30 \opt{HAVEREMOTEKEYMAP}{& }
32 & Remove a block \\ 31 & Remove a block \\
33 } 32 }
34 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD} 33 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}
35 {\ButtonOff} 34 {\ButtonOff}
36 \opt{IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD% 35 \opt{IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD%
37 ,IAUDIO_X5_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 36 ,IAUDIO_X5_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/cube.tex b/manual/plugins/cube.tex
index 5791148cbc..206819be08 100644
--- a/manual/plugins/cube.tex
+++ b/manual/plugins/cube.tex
@@ -2,8 +2,6 @@
2\screenshot{plugins/images/ss-cube}{Cube}{img:cube} 2\screenshot{plugins/images/ss-cube}{Cube}{img:cube}
3This is a rotating cube screen saver in 3D. 3This is a rotating cube screen saver in 3D.
4\begin{btnmap} 4\begin{btnmap}
5 \opt{PLAYER_PAD,RECORDER_PAD}{\ButtonOn}
6 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
7 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 5 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
8 ,IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_S_PAD}{\ButtonSelect} 6 ,IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_S_PAD}{\ButtonSelect}
9 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 7 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
@@ -18,19 +16,17 @@ This is a rotating cube screen saver in 3D.
18 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack} 16 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack}
19 \opt{HAVEREMOTEKEYMAP}{& } 17 \opt{HAVEREMOTEKEYMAP}{& }
20 & Display at maximum frame rate\\ 18 & Display at maximum frame rate\\
21 \opt{PLAYER_PAD,RECORDER_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 19 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
22 ,IRIVER_H10_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD% 20 ,IRIVER_H10_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD%
23 ,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 21 ,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
24 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
25 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 22 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
26 \opt{GIGABEAT_PAD}{\ButtonSelect} 23 \opt{GIGABEAT_PAD}{\ButtonSelect}
27 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD}{\ButtonUp} 24 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD}{\ButtonUp}
28 \opt{COWON_D2_PAD}{\TouchCenter} 25 \opt{COWON_D2_PAD}{\TouchCenter}
29 \opt{HAVEREMOTEKEYMAP}{& } 26 \opt{HAVEREMOTEKEYMAP}{& }
30 & Pause\\ 27 & Pause\\
31 \opt{PLAYER_PAD,ONDIO_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD} 28 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD}
32 {\ButtonMenu} 29 {\ButtonMenu}
33 \opt{RECORDER_PAD}{\ButtonFThree}
34 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 30 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
35 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 31 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
36 \opt{IAUDIO_X5_PAD,SANSA_FUZEPLUS_PAD}{\ButtonSelect} 32 \opt{IAUDIO_X5_PAD,SANSA_FUZEPLUS_PAD}{\ButtonSelect}
@@ -42,18 +38,16 @@ This is a rotating cube screen saver in 3D.
42 \opt{MPIO_HD300_PAD}{\ButtonMenu} 38 \opt{MPIO_HD300_PAD}{\ButtonMenu}
43 \opt{HAVEREMOTEKEYMAP}{& } 39 \opt{HAVEREMOTEKEYMAP}{& }
44 & Cycle draw mode\\ 40 & Cycle draw mode\\
45 \opt{ONDIO_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,RECORDER_PAD% 41 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,%
46 ,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 42 ,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
47 ,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 43 ,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
48 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 44 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
49 {\ButtonRight{} / \ButtonLeft} 45 {\ButtonRight{} / \ButtonLeft}
50 \opt{PLAYER_PAD}{\ButtonOn+\ButtonRight{} / \ButtonOn+\ButtonLeft}
51 \opt{COWON_D2_PAD}{\TouchMidRight{} / \TouchMidLeft} 46 \opt{COWON_D2_PAD}{\TouchMidRight{} / \TouchMidLeft}
52 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRew / \ButtonFF} 47 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRew / \ButtonFF}
53 \opt{HAVEREMOTEKEYMAP}{& } 48 \opt{HAVEREMOTEKEYMAP}{& }
54 & Select axis to adjust\\ 49 & Select axis to adjust\\
55 \opt{PLAYER_PAD}{\ButtonRight{} / \ButtonLeft} 50 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
56 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
57 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 51 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
58 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp{} / \ButtonDown} 52 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp{} / \ButtonDown}
59 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack} 53 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack}
@@ -64,8 +58,7 @@ This is a rotating cube screen saver in 3D.
64 \opt{MPIO_HD300_PAD}{\ButtonScrollDown / \ButtonScrollUp} 58 \opt{MPIO_HD300_PAD}{\ButtonScrollDown / \ButtonScrollUp}
65 \opt{HAVEREMOTEKEYMAP}{& } 59 \opt{HAVEREMOTEKEYMAP}{& }
66 & Change speed/angle (speed can not be changed while paused)\\ 60 & Change speed/angle (speed can not be changed while paused)\\
67 \opt{PLAYER_PAD}{\ButtonStop} 61 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
68 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
69 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 62 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
70 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 63 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
71 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 64 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/flipit.tex b/manual/plugins/flipit.tex
index 8aa8a293ba..70830c0b8f 100644
--- a/manual/plugins/flipit.tex
+++ b/manual/plugins/flipit.tex
@@ -6,8 +6,7 @@ above, below, left and right of the cursor. The aim is to end up with
6a screen containing tokens of only one colour. 6a screen containing tokens of only one colour.
7 7
8\begin{btnmap} 8\begin{btnmap}
9\opt{PLAYER_PAD}{\ButtonOn{} / \ButtonMenu{} / \ButtonLeft{} / \ButtonRight} 9\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
10\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
11 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 10 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
12 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 11 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
13 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight} 12 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight}
@@ -17,8 +16,7 @@ a screen containing tokens of only one colour.
17 \opt{HAVEREMOTEKEYMAP}{& } 16 \opt{HAVEREMOTEKEYMAP}{& }
18\opt{COWON_D2_PAD}{\TouchTopMiddle{} / \TouchBottomMiddle{} / \TouchMidLeft{} / \TouchMidRight} 17\opt{COWON_D2_PAD}{\TouchTopMiddle{} / \TouchBottomMiddle{} / \TouchMidLeft{} / \TouchMidRight}
19 & Move the cursor \\ 18 & Move the cursor \\
20\opt{PLAYER_PAD,RECORDER_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 19\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
21\opt{ONDIO_PAD}{\ButtonMenu}
22\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 20\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
23 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 21 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
24 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD} 22 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD}
@@ -30,9 +28,6 @@ a screen containing tokens of only one colour.
30\opt{SANSA_CLIP_PAD}{\ButtonHome} 28\opt{SANSA_CLIP_PAD}{\ButtonHome}
31 \opt{HAVEREMOTEKEYMAP}{& } 29 \opt{HAVEREMOTEKEYMAP}{& }
32 & Flip \\ 30 & Flip \\
33\opt{PLAYER_PAD}{\ButtonOn+\ButtonLeft}
34\opt{RECORDER_PAD}{\ButtonFOne}
35\opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
36\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 31\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
37\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft} 32\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft}
38\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay+\ButtonLeft} 33\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay+\ButtonLeft}
@@ -45,9 +40,6 @@ a screen containing tokens of only one colour.
45\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew} 40\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew}
46 \opt{HAVEREMOTEKEYMAP}{& } 41 \opt{HAVEREMOTEKEYMAP}{& }
47 & Shuffle \\ 42 & Shuffle \\
48\opt{PLAYER_PAD}{\ButtonOn+\ButtonRight}
49\opt{RECORDER_PAD}{\ButtonFTwo}
50\opt{ONDIO_PAD}{\ButtonMenu+\ButtonUp}
51\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 43\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
52\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 44\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
53\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay+\ButtonRight} 45\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay+\ButtonRight}
@@ -62,9 +54,6 @@ a screen containing tokens of only one colour.
62\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{Long \ButtonFF} 54\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{Long \ButtonFF}
63 \opt{HAVEREMOTEKEYMAP}{& } 55 \opt{HAVEREMOTEKEYMAP}{& }
64 & Solve \\ 56 & Solve \\
65\opt{PLAYER_PAD}{\ButtonOn+\ButtonPlay}
66\opt{RECORDER_PAD}{\ButtonFThree}
67\opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
68\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec} 57\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec}
69\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} 58\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight}
70\opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonUp} 59\opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonUp}
@@ -81,8 +70,7 @@ a screen containing tokens of only one colour.
81\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 70\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
82 \opt{HAVEREMOTEKEYMAP}{& } 71 \opt{HAVEREMOTEKEYMAP}{& }
83 & Solve step by step \\ 72 & Solve step by step \\
84\opt{PLAYER_PAD}{\ButtonStop} 73\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
85\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
86\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 74\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
87\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,MROBE100_PAD% 75\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,MROBE100_PAD%
88 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 76 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/fractals.tex b/manual/plugins/fractals.tex
index 74a34fea68..e3181d9279 100644
--- a/manual/plugins/fractals.tex
+++ b/manual/plugins/fractals.tex
@@ -9,8 +9,7 @@ This demonstration draws fractal images from the Mandelbrot set%
9 \opt{HAVEREMOTEKEYMAP}{&} 9 \opt{HAVEREMOTEKEYMAP}{&}
10 & Move about the image\\ 10 & Move about the image\\
11 % 11 %
12 \opt{RECORDER_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD}{\ButtonPlay} 12 \opt{IRIVER_H10_PAD,PBELL_VIBE500_PAD}{\ButtonPlay}
13 \opt{ONDIO_PAD}{\ButtonMenu\ / \ButtonMenu+\ButtonUp}
14 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD 13 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD
15 ,SANSA_FUZEPLUS_PAD}{\ButtonSelect} 14 ,SANSA_FUZEPLUS_PAD}{\ButtonSelect}
16 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd} 15 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd}
@@ -22,8 +21,6 @@ This demonstration draws fractal images from the Mandelbrot set%
22 \opt{HAVEREMOTEKEYMAP}{& } 21 \opt{HAVEREMOTEKEYMAP}{& }
23 & Zoom in\\ 22 & Zoom in\\
24 % 23 %
25 \opt{RECORDER_PAD}{\ButtonOn}
26 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonDown}
27 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 24 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
28 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollBack} 25 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollBack}
29 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD}{Long \ButtonSelect} 26 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD}{Long \ButtonSelect}
@@ -38,8 +35,6 @@ This demonstration draws fractal images from the Mandelbrot set%
38 \opt{HAVEREMOTEKEYMAP}{& } 35 \opt{HAVEREMOTEKEYMAP}{& }
39 & Zoom out\\ 36 & Zoom out\\
40 % 37 %
41 \opt{RECORDER_PAD}{\ButtonFOne}
42 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
43 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonLeft} 38 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonLeft}
44 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD 39 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD
45 ,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonLeft} 40 ,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonLeft}
@@ -58,8 +53,6 @@ This demonstration draws fractal images from the Mandelbrot set%
58 \opt{HAVEREMOTEKEYMAP}{& } 53 \opt{HAVEREMOTEKEYMAP}{& }
59 & Decrease iteration depth (less detail)\\ 54 & Decrease iteration depth (less detail)\\
60 % 55 %
61 \opt{RECORDER_PAD}{\ButtonFTwo}
62 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
63 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonRight} 56 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonRight}
64 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonRight} 57 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonRight}
65 \opt{IAUDIO_X5_PAD}{\ButtonPlay} 58 \opt{IAUDIO_X5_PAD}{\ButtonPlay}
@@ -77,8 +70,6 @@ This demonstration draws fractal images from the Mandelbrot set%
77 \opt{HAVEREMOTEKEYMAP}{& } 70 \opt{HAVEREMOTEKEYMAP}{& }
78 & Increase iteration depth (more detail)\\ 71 & Increase iteration depth (more detail)\\
79 % 72 %
80 \opt{RECORDER_PAD}{\ButtonFThree}
81 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
82 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} 73 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
83 \opt{SANSA_CLIP_PAD}{\ButtonHome} 74 \opt{SANSA_CLIP_PAD}{\ButtonHome}
84 \opt{SANSA_FUZE_PAD}{Long \ButtonSelect} 75 \opt{SANSA_FUZE_PAD}{Long \ButtonSelect}
@@ -96,7 +87,7 @@ This demonstration draws fractal images from the Mandelbrot set%
96 \opt{HAVEREMOTEKEYMAP}{& } 87 \opt{HAVEREMOTEKEYMAP}{& }
97 & Reset and return to the default image\\ 88 & Reset and return to the default image\\
98 % 89 %
99 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 90 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
100 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 91 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
101 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 92 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
102 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 93 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/goban.tex b/manual/plugins/goban.tex
index 228129c9b7..4c7ab26f61 100644
--- a/manual/plugins/goban.tex
+++ b/manual/plugins/goban.tex
@@ -28,7 +28,7 @@ permanently. The \fname {/sgf/gbn\_def.sgf} file is also the file loaded if ano
28is not selected.\\ 28is not selected.\\
29 29
30The information panel which displays the current move number may also contain 30The information panel which displays the current move number may also contain
31these markers: 31these markers:
32 32
33\begin{table} 33\begin{table}
34 \begin{rbtabular}{\textwidth}{lX}% 34 \begin{rbtabular}{\textwidth}{lX}%
@@ -37,13 +37,12 @@ these markers:
37 \emph{* } & There are sibling variations which can be navigated to using the % 37 \emph{* } & There are sibling variations which can be navigated to using the %
38 \emph{Next Variation} menu option of the \emph{Context Menu}% 38 \emph{Next Variation} menu option of the \emph{Context Menu}%
39 \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,% 39 \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,%
40 RECORDER_PAD,MROBE100_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,IRIVER_H100_PAD,% 40 MROBE100_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,IRIVER_H100_PAD,%
41 IRIVER_H300_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD,SANSA_FUZEPLUS_PAD,% 41 IRIVER_H300_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD,SANSA_FUZEPLUS_PAD,%
42 SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{ or the % 42 SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{ or the %
43 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomRight}% 43 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomRight}%
44 \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}% 44 \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}%
45 \opt{SANSA_CLIP_PAD}{\ButtonHome}% 45 \opt{SANSA_CLIP_PAD}{\ButtonHome}%
46 \opt{RECORDER_PAD}{\ButtonOn}%
47 \opt{MROBE100_PAD}{\ButtonPower}% 46 \opt{MROBE100_PAD}{\ButtonPower}%
48 \opt{GIGABEAT_PAD}{\ButtonA}% 47 \opt{GIGABEAT_PAD}{\ButtonA}%
49 \opt{GIGABEAT_S_PAD}{\ButtonPlay}% 48 \opt{GIGABEAT_S_PAD}{\ButtonPlay}%
@@ -71,7 +70,7 @@ these markers:
71 &} 70 &}
72 Move cursor up 71 Move cursor up
73 \\ 72 \\
74 73
75 \nopt{IPOD_1G2G_PAD,IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,% 74 \nopt{IPOD_1G2G_PAD,IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,%
76 MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonDown}% 75 MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonDown}%
77 \opt{IPOD_1G2G_PAD,IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonPlay}% 76 \opt{IPOD_1G2G_PAD,IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonPlay}%
@@ -83,7 +82,7 @@ these markers:
83 &} 82 &}
84 Move cursor down 83 Move cursor down
85 \\ 84 \\
86 85
87 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonLeft} 86 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonLeft}
88 \opt{MPIO_HD200_PAD}{\ButtonVolDown} 87 \opt{MPIO_HD200_PAD}{\ButtonVolDown}
89 \opt{MPIO_HD300_PAD}{\ButtonRew} 88 \opt{MPIO_HD300_PAD}{\ButtonRew}
@@ -92,10 +91,8 @@ these markers:
92 \opt{HAVEREMOTEKEYMAP}{ 91 \opt{HAVEREMOTEKEYMAP}{
93 &} 92 &}
94 Move cursor left 93 Move cursor left
95 \opt{ONDIO_PAD}{if in \emph{board} navigation mode, or retreat one
96 node in the game tree if in \emph{tree} navigation mode}
97 \\ 94 \\
98 95
99 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonRight} 96 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonRight}
100 \opt{MPIO_HD200_PAD}{\ButtonVolUp} 97 \opt{MPIO_HD200_PAD}{\ButtonVolUp}
101 \opt{MPIO_HD300_PAD}{\ButtonFF} 98 \opt{MPIO_HD300_PAD}{\ButtonFF}
@@ -104,23 +101,13 @@ these markers:
104 \opt{HAVEREMOTEKEYMAP}{ 101 \opt{HAVEREMOTEKEYMAP}{
105 &} 102 &}
106 Move cursor right 103 Move cursor right
107 \opt{ONDIO_PAD}{if in \emph{board} navigation mode, or advance one
108 node in the game tree if in \emph{tree} navigation mode}
109 \\ 104 \\
110 105
111 \opt{ONDIO_PAD}{ 106 \nopt{IRIVER_H10_PAD,IAUDIO_M3_PAD,PBELL_VIBE500_PAD%
112 \ButtonOff
113 &
114 Toggle between \emph{board} and \emph{tree} navigation modes
115 \\
116 }
117
118 \nopt{IRIVER_H10_PAD,ONDIO_PAD,RECORDER_PAD,IAUDIO_M3_PAD,PBELL_VIBE500_PAD%
119 ,MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD% 107 ,MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD%
120 ,touchscreen}{\ButtonSelect}% 108 ,touchscreen}{\ButtonSelect}%
121 \opt{IRIVER_H10_PAD,RECORDER_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 109 \opt{IRIVER_H10_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
122 ,SAMSUNG_YH820_PAD}{\ButtonPlay}% 110 ,SAMSUNG_YH820_PAD}{\ButtonPlay}%
123 \opt{ONDIO_PAD}{\ButtonMenu}
124 \opt{MPIO_HD200_PAD}{\ButtonFunc} 111 \opt{MPIO_HD200_PAD}{\ButtonFunc}
125 \opt{MPIO_HD300_PAD}{\ButtonEnter} 112 \opt{MPIO_HD300_PAD}{\ButtonEnter}
126 \opt{touchscreen}{\TouchCenter} 113 \opt{touchscreen}{\TouchCenter}
@@ -129,8 +116,7 @@ these markers:
129 &} 116 &}
130 Play a move (or use a tool if play-mode has been changed). 117 Play a move (or use a tool if play-mode has been changed).
131 \\ 118 \\
132 119
133 \nopt{ONDIO_PAD}{
134 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,IPOD_1G2G_PAD,IPOD_3G_PAD% 120 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,IPOD_1G2G_PAD,IPOD_3G_PAD%
135 ,IPOD_4G_PAD}{\ButtonScrollBack}% 121 ,IPOD_4G_PAD}{\ButtonScrollBack}%
136 \opt{SANSA_CLIP_PAD,SANSA_M200_PAD,SANSA_C200_PAD,GIGABEAT_PAD% 122 \opt{SANSA_CLIP_PAD,SANSA_M200_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
@@ -140,7 +126,6 @@ these markers:
140 \opt{MROBE100_PAD}{\ButtonMenu}% 126 \opt{MROBE100_PAD}{\ButtonMenu}%
141 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack}% 127 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack}%
142 \opt{IAUDIO_X5_PAD}{\ButtonPlay}% 128 \opt{IAUDIO_X5_PAD}{\ButtonPlay}%
143 \opt{RECORDER_PAD}{\ButtonFOne}
144 \opt{touchscreen}{\TouchBottomLeft} 129 \opt{touchscreen}{\TouchBottomLeft}
145 \opt{PBELL_VIBE500_PAD}{\ButtonOK{} + \ButtonLeft} 130 \opt{PBELL_VIBE500_PAD}{\ButtonOK{} + \ButtonLeft}
146 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec + \ButtonRew} 131 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec + \ButtonRew}
@@ -151,7 +136,7 @@ these markers:
151 &} 136 &}
152 Retreat one node in the game tree 137 Retreat one node in the game tree
153 \\ 138 \\
154 139
155 \opt{scrollwheel}{\ButtonScrollFwd}% 140 \opt{scrollwheel}{\ButtonScrollFwd}%
156 \opt{SANSA_CLIP_PAD,SANSA_M200_PAD,SANSA_C200_PAD,GIGABEAT_PAD% 141 \opt{SANSA_CLIP_PAD,SANSA_M200_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
157 ,GIGABEAT_S_PAD}{\ButtonVolUp}% 142 ,GIGABEAT_S_PAD}{\ButtonVolUp}%
@@ -159,7 +144,6 @@ these markers:
159 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}% 144 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}%
160 \opt{MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay}% 145 \opt{MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay}%
161 \opt{IAUDIO_X5_PAD}{\ButtonRec}% 146 \opt{IAUDIO_X5_PAD}{\ButtonRec}%
162 \opt{RECORDER_PAD}{\ButtonFThree}
163 \opt{touchscreen}{\TouchBottomRight} 147 \opt{touchscreen}{\TouchBottomRight}
164 \opt{PBELL_VIBE500_PAD}{\ButtonOK{} + \ButtonRight} 148 \opt{PBELL_VIBE500_PAD}{\ButtonOK{} + \ButtonRight}
165 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec + \ButtonFF} 149 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec + \ButtonFF}
@@ -170,8 +154,7 @@ these markers:
170 &} 154 &}
171 Advance one node in the game tree 155 Advance one node in the game tree
172 \\ 156 \\
173 } 157
174
175 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD% 158 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD%
176 ,SANSA_C200_PAD,IRIVER_H10_PAD,IAUDIO_X5_PAD,SANSA_FUZEPLUS_PAD% 159 ,SANSA_C200_PAD,IRIVER_H10_PAD,IAUDIO_X5_PAD,SANSA_FUZEPLUS_PAD%
177 }{\ButtonPower}% 160 }{\ButtonPower}%
@@ -180,8 +163,6 @@ these markers:
180 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}% 163 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}%
181 {\ButtonMenu}% 164 {\ButtonMenu}%
182 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}% 165 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}%
183 \opt{RECORDER_PAD}{\ButtonFTwo}%
184 \opt{ONDIO_PAD}{Long \ButtonMenu}
185 \opt{MPIO_HD200_PAD}{Long \ButtonPlay} 166 \opt{MPIO_HD200_PAD}{Long \ButtonPlay}
186 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew} 167 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew}
187 \opt{touchscreen}{\TouchTopLeft} 168 \opt{touchscreen}{\TouchTopLeft}
@@ -191,11 +172,10 @@ these markers:
191 Main Menu 172 Main Menu
192 \\ 173 \\
193 174
194% \nopt{IPOD_1G2G_PAD,IPOD_3G_PAD,IPOD_4G_PAD,ONDIO_PAD,RECORDER_PAD}{%
195 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 175 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
196 ,IRIVER_H100_PAD,IRIVER_H300_PAD,MROBE100_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD% 176 ,IRIVER_H100_PAD,IRIVER_H300_PAD,MROBE100_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD%
197 ,MPIO_HD200_PAD,PBELL_VIBE500_PAD,touchscreen,SANSA_FUZEPLUS_PAD% 177 ,MPIO_HD200_PAD,PBELL_VIBE500_PAD,touchscreen,SANSA_FUZEPLUS_PAD%
198 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{% 178 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{%
199 \nopt{IRIVER_H10_PAD,touchscreen,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,% 179 \nopt{IRIVER_H10_PAD,touchscreen,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,%
200 MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH820_PAD}% 180 MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH820_PAD}%
201 {Long \ButtonSelect}% 181 {Long \ButtonSelect}%
@@ -212,15 +192,14 @@ these markers:
212 Context Menu 192 Context Menu
213 \\ 193 \\
214 } 194 }
215 195
216 \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_FUZE_PAD,RECORDER_PAD,MROBE100_PAD% 196 \opt{SANSA_E200_PAD,SANSA_C200_PAD,SANSA_FUZE_PAD,MROBE100_PAD%
217 ,GIGABEAT_PAD,GIGABEAT_S_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_CLIP_PAD% 197 ,GIGABEAT_PAD,GIGABEAT_S_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_CLIP_PAD%
218 ,PBELL_VIBE500_PAD,MPIO_HD200_PAD,touchscreen,SANSA_FUZEPLUS_PAD, 198 ,PBELL_VIBE500_PAD,MPIO_HD200_PAD,touchscreen,SANSA_FUZEPLUS_PAD,
219 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{% 199 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{%
220 \opt{SANSA_E200_PAD,SANSA_C200_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 200 \opt{SANSA_E200_PAD,SANSA_C200_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD%
221 ,MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec}% 201 ,MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonRec}%
222 \opt{SANSA_FUZE_PAD,SANSA_CLIP_PAD}{\ButtonHome}% 202 \opt{SANSA_FUZE_PAD,SANSA_CLIP_PAD}{\ButtonHome}%
223 \opt{RECORDER_PAD}{\ButtonOn}%
224 \opt{MROBE100_PAD}{\ButtonPower}% 203 \opt{MROBE100_PAD}{\ButtonPower}%
225 \opt{GIGABEAT_PAD}{\ButtonA}% 204 \opt{GIGABEAT_PAD}{\ButtonA}%
226 \opt{GIGABEAT_S_PAD}{\ButtonPlay}% 205 \opt{GIGABEAT_S_PAD}{\ButtonPlay}%
@@ -297,7 +276,7 @@ these markers:
297\item [Options. ] 276\item [Options. ]
298 Customize the behavior of the plugin in certain ways. 277 Customize the behavior of the plugin in certain ways.
299 \begin{description} 278 \begin{description}
300 \item[Show Child Variations?] Enable this to mark child variations on 279 \item[Show Child Variations?] Enable this to mark child variations on
301 he board if there are more than one. Note: variations which don't 280 he board if there are more than one. Note: variations which don't
302 start with a move are not visible in this way. 281 start with a move are not visible in this way.
303 \item[Disable Idle Poweroff?] Enable this if you do not want the \dap{} 282 \item[Disable Idle Poweroff?] Enable this if you do not want the \dap{}
@@ -352,4 +331,3 @@ these markers:
352 \item[Done.] Go back to the previous screen. 331 \item[Done.] Go back to the previous screen.
353 \end{description} 332 \end{description}
354\end{description} 333\end{description}
355
diff --git a/manual/plugins/imageviewer.tex b/manual/plugins/imageviewer.tex
index 9f646dc8fb..637507456b 100644
--- a/manual/plugins/imageviewer.tex
+++ b/manual/plugins/imageviewer.tex
@@ -28,13 +28,13 @@ view a bigger file you may need to stop playback.}
28}% 28}%
29 29
30\begin{btnmap} 30\begin{btnmap}
31 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 31 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
32 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 32 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
33 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 33 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
34 ,SAMSUNG_YH820_PAD}{\ButtonUp\ / \ButtonDown}% 34 ,SAMSUNG_YH820_PAD}{\ButtonUp\ / \ButtonDown}%
35 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu\ / \ButtonPlay}% 35 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu\ / \ButtonPlay}%
36 \opt{IRIVER_H10_PAD}{\ButtonScrollUp\ / \ButtonScrollDown} % 36 \opt{IRIVER_H10_PAD}{\ButtonScrollUp\ / \ButtonScrollDown} %
37 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 37 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
38 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 38 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
39 ,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD% 39 ,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD%
40 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 40 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -46,8 +46,6 @@ view a bigger file you may need to stop playback.}
46 \opt{touchscreen}{\TouchTopMiddle{} / \TouchBottomMiddle{}/ \TouchMidLeft{} / \TouchMidRight} 46 \opt{touchscreen}{\TouchTopMiddle{} / \TouchBottomMiddle{}/ \TouchMidLeft{} / \TouchMidRight}
47 \opt{HAVEREMOTEKEYMAP}{& } 47 \opt{HAVEREMOTEKEYMAP}{& }
48 & Move around in zoomed in image\\ 48 & Move around in zoomed in image\\
49 \opt{RECORDER_PAD}{\ButtonPlay}
50 \opt{ONDIO_PAD}{\ButtonMenu}
51 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD% 49 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD%
52 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD}{\ButtonSelect} 50 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,MROBE100_PAD}{\ButtonSelect}
53 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd} 51 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd}
@@ -59,8 +57,6 @@ view a bigger file you may need to stop playback.}
59 \opt{touchscreen}{\TouchTopRight} 57 \opt{touchscreen}{\TouchTopRight}
60 \opt{HAVEREMOTEKEYMAP}{& } 58 \opt{HAVEREMOTEKEYMAP}{& }
61 & Zoom in\\ 59 & Zoom in\\
62 \opt{RECORDER_PAD}{\ButtonOn}
63 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonDown}
64 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 60 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
65 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack} 61 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack}
66 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{Long \ButtonSelect} 62 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{Long \ButtonSelect}
@@ -73,8 +69,6 @@ view a bigger file you may need to stop playback.}
73 \opt{touchscreen}{\TouchTopLeft} 69 \opt{touchscreen}{\TouchTopLeft}
74 \opt{HAVEREMOTEKEYMAP}{& } 70 \opt{HAVEREMOTEKEYMAP}{& }
75 & Zoom out\\ 71 & Zoom out\\
76 \opt{RECORDER_PAD}{\ButtonFThree}
77 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
78 \opt{IRIVER_H100_PAD}{\ButtonOn} 72 \opt{IRIVER_H100_PAD}{\ButtonOn}
79 \opt{IRIVER_H300_PAD}{\ButtonRec} 73 \opt{IRIVER_H300_PAD}{\ButtonRec}
80 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} 74 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight}
@@ -92,8 +86,6 @@ view a bigger file you may need to stop playback.}
92 \opt{touchscreen}{\TouchBottomRight} 86 \opt{touchscreen}{\TouchBottomRight}
93 \opt{HAVEREMOTEKEYMAP}{& } 87 \opt{HAVEREMOTEKEYMAP}{& }
94 & Next image in directory\\ 88 & Next image in directory\\
95 \opt{RECORDER_PAD}{\ButtonFTwo}
96 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
97 \opt{IRIVER_H100_PAD,IAUDIO_X5_PAD}{\ButtonRec} 89 \opt{IRIVER_H100_PAD,IAUDIO_X5_PAD}{\ButtonRec}
98 \opt{IRIVER_H300_PAD}{\ButtonOn} 90 \opt{IRIVER_H300_PAD}{\ButtonOn}
99 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft} 91 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft}
@@ -120,7 +112,7 @@ view a bigger file you may need to stop playback.}
120 \opt{HAVEREMOTEKEYMAP}{& } 112 \opt{HAVEREMOTEKEYMAP}{& }
121 & Toggle slide show mode\\ 113 & Toggle slide show mode\\
122 } 114 }
123 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 115 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
124 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 116 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
125 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonPower} 117 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonPower}
126 \opt{SANSA_FUZE_PAD}{Long \ButtonHome} 118 \opt{SANSA_FUZE_PAD}{Long \ButtonHome}
diff --git a/manual/plugins/jewels.tex b/manual/plugins/jewels.tex
index 1458d64f46..51ad6967c4 100644
--- a/manual/plugins/jewels.tex
+++ b/manual/plugins/jewels.tex
@@ -14,12 +14,12 @@ In puzzle mode the aim of the game is to connect the puzzles, by
14skillfully swapping pairs of jewels. 14skillfully swapping pairs of jewels.
15 15
16\begin{btnmap} 16\begin{btnmap}
17 \opt{RECORDER_PAD,IRIVER_H10_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 17 \opt{IRIVER_H10_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD%
18 ,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 18 ,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
19 ,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD% 19 ,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD%
20 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 20 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
21 {\ButtonLeft/\ButtonRight/} 21 {\ButtonLeft/\ButtonRight/}
22 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD% 22 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD%
23 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD% 23 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD%
24 ,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 24 ,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
25 {\ButtonUp/\ButtonDown} 25 {\ButtonUp/\ButtonDown}
@@ -30,8 +30,7 @@ skillfully swapping pairs of jewels.
30 \opt{MPIO_HD300_PAD}{\ButtonRew / \ButtonFF} 30 \opt{MPIO_HD300_PAD}{\ButtonRew / \ButtonFF}
31 \opt{HAVEREMOTEKEYMAP}{& } 31 \opt{HAVEREMOTEKEYMAP}{& }
32 & Move the cursor around the jewels \\ 32 & Move the cursor around the jewels \\
33 \opt{RECORDER_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 33 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
34 \opt{ONDIO_PAD}{\ButtonMenu}
35 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD% 34 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD%
36 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD% 35 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD,IAUDIO_X5_PAD%
37 ,GIGABEAT_S_PAD,SANSA_FUZEPLUS_PAD} 36 ,GIGABEAT_S_PAD,SANSA_FUZEPLUS_PAD}
@@ -47,7 +46,7 @@ skillfully swapping pairs of jewels.
47 \opt{GIGABEAT_S_PAD}{\ButtonBack} 46 \opt{GIGABEAT_S_PAD}{\ButtonBack}
48 \opt{IPOD_3G_PAD,MPIO_HD300_PAD}{\ButtonMenu} 47 \opt{IPOD_3G_PAD,MPIO_HD300_PAD}{\ButtonMenu}
49 \opt{IPOD_4G_PAD}{\ButtonSelect+ \ButtonMenu} 48 \opt{IPOD_4G_PAD}{\ButtonSelect+ \ButtonMenu}
50 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 49 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
51 \opt{PBELL_VIBE500_PAD}{\ButtonRec} 50 \opt{PBELL_VIBE500_PAD}{\ButtonRec}
52 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew} 51 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew}
53 \opt{HAVEREMOTEKEYMAP}{& } 52 \opt{HAVEREMOTEKEYMAP}{& }
diff --git a/manual/plugins/lrcplayer.tex b/manual/plugins/lrcplayer.tex
index 3b419780b2..2f72cc359f 100644
--- a/manual/plugins/lrcplayer.tex
+++ b/manual/plugins/lrcplayer.tex
@@ -96,7 +96,7 @@ same order as in that list.
96 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsPlay} 96 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsPlay}
97 & Toggle play/pause.\\ 97 & Toggle play/pause.\\
98 % 98 %
99 \ActionWpsStop{}\nopt{ONDIO_PAD}{ or \ActionWpsBrowse} 99 \ActionWpsStop{} or \ActionWpsBrowse
100 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsStop{} or \ActionRCWpsBrowse} 100 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsStop{} or \ActionRCWpsBrowse}
101 & Exit the plugin.\\ 101 & Exit the plugin.\\
102 % 102 %
@@ -104,8 +104,7 @@ same order as in that list.
104 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsContext} 104 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsContext}
105 & Enter timetag editor.\\ 105 & Enter timetag editor.\\
106 % 106 %
107 \opt{ONDIO_PAD}{\ActionWpsBrowse}% 107 \ActionWpsMenu%
108 \nopt{ONDIO_PAD}{\ActionWpsMenu}%
109 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsMenu} 108 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsMenu}
110 & Enter \setting{Lrcplayer Menu}.\\ 109 & Enter \setting{Lrcplayer Menu}.\\
111 % 110 %
diff --git a/manual/plugins/main.tex b/manual/plugins/main.tex
index 96326cbffe..5621e260b8 100644
--- a/manual/plugins/main.tex
+++ b/manual/plugins/main.tex
@@ -21,7 +21,7 @@ text files%
21\opt{lcd_bitmap} 21\opt{lcd_bitmap}
22 {See also the Chip{}-8 emulator in \reference{ref:Chip8emulator}, 22 {See also the Chip{}-8 emulator in \reference{ref:Chip8emulator},
23 Frotz in \reference{ref:Frotz}, 23 Frotz in \reference{ref:Frotz},
24 \opt{archosrecorder,archosfmrecorder,iriverh100,iaudiom5,lcd_color} 24 \opt{iriverh100,iaudiom5,lcd_color}
25 {Rockboy in \reference{ref:Rockboy}} 25 {Rockboy in \reference{ref:Rockboy}}
26 and ZXBox in \reference{ref:ZXBox}.} 26 and ZXBox in \reference{ref:ZXBox}.}
27 27
@@ -66,8 +66,6 @@ text files%
66 66
67\opt{lcd_bitmap}{\input{plugins/minesweeper.tex}} 67\opt{lcd_bitmap}{\input{plugins/minesweeper.tex}}
68 68
69\opt{archosplayer}{\input{plugins/nim.tex}}
70
71\opt{iriverh100,iaudiom5,lcd_color}{\nopt{c200,c200v2}{\input{plugins/pacbox.tex}}} 69\opt{iriverh100,iaudiom5,lcd_color}{\nopt{c200,c200v2}{\input{plugins/pacbox.tex}}}
72 70
73\opt{lcd_bitmap}{\input{plugins/pegbox.tex}} 71\opt{lcd_bitmap}{\input{plugins/pegbox.tex}}
@@ -183,9 +181,7 @@ option from the \setting{Context Menu} (see \reference{ref:Contextmenu}).}
183 } 181 }
184 } 182 }
185 \opt{lcd_bitmap}{ 183 \opt{lcd_bitmap}{
186 \nopt{ondio}{% not enough buttons 184 Rockboy & \fname{.gb, .gbc} & \\
187 Rockboy & \fname{.gb, .gbc} & \\
188 }
189 } 185 }
190 Search & \fname{.m3u, .m3u8} & x \\ 186 Search & \fname{.m3u, .m3u8} & x \\
191 Shopping list & \fname{.shopper} & \\ 187 Shopping list & \fname{.shopper} & \\
@@ -213,8 +209,6 @@ option from the \setting{Context Menu} (see \reference{ref:Contextmenu}).}
213 209
214\opt{swcodec}{\nopt{lowmem}{\input{plugins/midiplay.tex}}} 210\opt{swcodec}{\nopt{lowmem}{\input{plugins/midiplay.tex}}}
215 211
216\opt{archosrecorder,archosfmrecorder,ondio}{\input{plugins/movieplayer.tex}}
217
218\opt{lcd_bitmap}{\opt{swcodec}{\nopt{lowmem}{\input{plugins/mpegplayer.tex}}}} 212\opt{lcd_bitmap}{\opt{swcodec}{\nopt{lowmem}{\input{plugins/mpegplayer.tex}}}}
219 213
220\opt{swcodec}{\input{plugins/mp3_encoder.tex}} 214\opt{swcodec}{\input{plugins/mp3_encoder.tex}}
@@ -223,11 +217,8 @@ option from the \setting{Context Menu} (see \reference{ref:Contextmenu}).}
223 ,IPOD_1G2G_PAD,SAMSUNG_YPR0_PAD}{ 217 ,IPOD_1G2G_PAD,SAMSUNG_YPR0_PAD}{
224 \input{plugins/pdbox.tex}} 218 \input{plugins/pdbox.tex}}
225 219
226\opt{archosrecorder,archosfmrecorder,ondio}{\input{plugins/rockbox_flash.tex}}
227
228\opt{lcd_bitmap}{\nopt{% 220\opt{lcd_bitmap}{\nopt{%
229 ONDIO_PAD%,m200, % not enough buttons for keymap 221 ipod1g2g,ipod3g,ipod4g,ipodmini% horizontal pixelformat not implemented
230 ,ipod1g2g,ipod3g,ipod4g,ipodmini% horizontal pixelformat not implemented
231 ,iaudiom3,mpiohd200, % vertical interleaved pixelformat not implemented 222 ,iaudiom3,mpiohd200, % vertical interleaved pixelformat not implemented
232 ,mrobe100% lcd size/depth not implemented 223 ,mrobe100% lcd size/depth not implemented
233 }{ 224 }{
@@ -247,16 +238,12 @@ option from the \setting{Context Menu} (see \reference{ref:Contextmenu}).}
247 238
248{\input{plugins/vbrfix.tex}} 239{\input{plugins/vbrfix.tex}}
249 240
250\opt{archosrecorder,archosfmrecorder,ondio}{\input{plugins/wavplay.tex}}
251
252\opt{lcd_bitmap}{\input{plugins/zxbox.tex}} 241\opt{lcd_bitmap}{\input{plugins/zxbox.tex}}
253 242
254\section{Applications} 243\section{Applications}
255 244
256\opt{rtc}{\input{plugins/alarmclock.tex}} 245\opt{rtc}{\input{plugins/alarmclock.tex}}
257 246
258\opt{archosplayer,archosrecorder,archosfmrecorder}{\input{plugins/alpinecdc.tex}}
259
260{\input{plugins/batterybenchmark.tex}} 247{\input{plugins/batterybenchmark.tex}}
261 248
262\opt{lcd_bitmap}{\input{plugins/calculator.tex}} 249\opt{lcd_bitmap}{\input{plugins/calculator.tex}}
@@ -271,10 +258,6 @@ option from the \setting{Context Menu} (see \reference{ref:Contextmenu}).}
271 258
272{\input{plugins/disktidy.tex}} 259{\input{plugins/disktidy.tex}}
273 260
274\opt{archosplayer}{\input{plugins/euro_converter.tex}}
275
276\opt{archosrecorder,archosfmrecorder,ondio}{\input{plugins/firmware_flash.tex}}
277
278{\input{plugins/keybox.tex}} 261{\input{plugins/keybox.tex}}
279 262
280\opt{HAVE_BACKLIGHT}{\input{plugins/lamp.tex}} 263\opt{HAVE_BACKLIGHT}{\input{plugins/lamp.tex}}
@@ -299,8 +282,6 @@ option from the \setting{Context Menu} (see \reference{ref:Contextmenu}).}
299 282
300\opt{lcd_color}{\input{plugins/rockpaint.tex}} 283\opt{lcd_color}{\input{plugins/rockpaint.tex}}
301 284
302\opt{archosrecorder,archosfmrecorder,ondio}{\input{plugins/split_editor.tex}}
303
304{\input{plugins/stats.tex}} 285{\input{plugins/stats.tex}}
305 286
306{\input{plugins/stopwatch.tex}} 287{\input{plugins/stopwatch.tex}}
diff --git a/manual/plugins/minesweeper.tex b/manual/plugins/minesweeper.tex
index 307f4c8b85..7b86fc48dc 100644
--- a/manual/plugins/minesweeper.tex
+++ b/manual/plugins/minesweeper.tex
@@ -12,7 +12,7 @@ the location of a mine, it can be tagged to avoid accidentally
12 12
13\begin{btnmap} 13\begin{btnmap}
14 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu{} / \ButtonPlay{} / \ButtonLeft{} / \ButtonRight} 14 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu{} / \ButtonPlay{} / \ButtonLeft{} / \ButtonRight}
15 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 15 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
16 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 16 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
17 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 17 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
18 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight} 18 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight}
@@ -30,8 +30,6 @@ the location of a mine, it can be tagged to avoid accidentally
30 \opt{HAVEREMOTEKEYMAP}{& } 30 \opt{HAVEREMOTEKEYMAP}{& }
31 & Scroll through the entire minefield \\}% 31 & Scroll through the entire minefield \\}%
32 % 32 %
33 \opt{RECORDER_PAD}{\ButtonFOne/\ButtonOn}
34 \opt{ONDIO_PAD}{\ButtonMenu}
35 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn{} / \ButtonRec} 33 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn{} / \ButtonRec}
36 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_FUZEPLUS_PAD}{\ButtonSelect} 34 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_FUZEPLUS_PAD}{\ButtonSelect}
37 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 35 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
@@ -46,8 +44,6 @@ the location of a mine, it can be tagged to avoid accidentally
46 \opt{HAVEREMOTEKEYMAP}{& } 44 \opt{HAVEREMOTEKEYMAP}{& }
47 & Toggle flag on / off \\ 45 & Toggle flag on / off \\
48 % 46 %
49 \opt{RECORDER_PAD}{\ButtonFTwo/\ButtonPlay}
50 \opt{ONDIO_PAD}{Long \ButtonMenu}
51 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD% 47 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD%
52 ,SANSA_FUZE_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect} 48 ,SANSA_FUZE_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect}
53 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonSelect} 49 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonSelect}
@@ -60,8 +56,6 @@ the location of a mine, it can be tagged to avoid accidentally
60 \opt{HAVEREMOTEKEYMAP}{& } 56 \opt{HAVEREMOTEKEYMAP}{& }
61 & Reveal the contents of the current square \\ 57 & Reveal the contents of the current square \\
62 % 58 %
63 \opt{RECORDER_PAD}{\ButtonFThree}
64 \opt{ONDIO_PAD}{Long \ButtonMenu+\ButtonOff}
65 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 59 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
66 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 60 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
67 \opt{IAUDIO_X5_PAD,SAMSUNG_YH820_PAD}{\ButtonRec} 61 \opt{IAUDIO_X5_PAD,SAMSUNG_YH820_PAD}{\ButtonRec}
@@ -77,7 +71,7 @@ the location of a mine, it can be tagged to avoid accidentally
77 \opt{HAVEREMOTEKEYMAP}{& } 71 \opt{HAVEREMOTEKEYMAP}{& }
78 & Display the current game status \\ 72 & Display the current game status \\
79 % 73 %
80 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 74 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
81 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 75 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
82 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 76 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
83 \opt{SANSA_FUZE_PAD}{Long \ButtonHome} 77 \opt{SANSA_FUZE_PAD}{Long \ButtonHome}
diff --git a/manual/plugins/oscilloscope.tex b/manual/plugins/oscilloscope.tex
index 554e51cf66..fddccb5850 100644
--- a/manual/plugins/oscilloscope.tex
+++ b/manual/plugins/oscilloscope.tex
@@ -12,8 +12,7 @@ being played.
12\subsubsection{Keys} 12\subsubsection{Keys}
13 13
14\begin{btnmap} 14\begin{btnmap}
15 \opt{RECORDER_PAD}{\ButtonFOne} 15 \opt{PBELL_VIBE500_PAD}{\ButtonMenu}
16 \opt{ONDIO_PAD,PBELL_VIBE500_PAD}{\ButtonMenu}
17 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD% 16 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD%
18 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD% 17 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD%
19 ,SANSA_FUZEPLUS_PAD}{\ButtonSelect} 18 ,SANSA_FUZEPLUS_PAD}{\ButtonSelect}
@@ -26,8 +25,6 @@ being played.
26 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 25 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
27 \opt{HAVEREMOTEKEYMAP}{& } 26 \opt{HAVEREMOTEKEYMAP}{& }
28 & Toggle filled / curve / plot \\ 27 & Toggle filled / curve / plot \\
29 \opt{RECORDER_PAD}{\ButtonFTwo}
30 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
31 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 28 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
32 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} 29 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight}
33 \opt{IAUDIO_X5_PAD}{\ButtonRec} 30 \opt{IAUDIO_X5_PAD}{\ButtonRec}
@@ -43,8 +40,6 @@ being played.
43 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonRight} 40 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonRight}
44 \opt{HAVEREMOTEKEYMAP}{& } 41 \opt{HAVEREMOTEKEYMAP}{& }
45 & Toggle whether to scroll or not \\ 42 & Toggle whether to scroll or not \\
46 \opt{RECORDER_PAD}{\ButtonFThree}
47 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
48 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec} 43 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec}
49 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft} 44 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft}
50 \opt{IAUDIO_X5_PAD,SANSA_CLIP_PAD}{Long \ButtonSelect} 45 \opt{IAUDIO_X5_PAD,SANSA_CLIP_PAD}{Long \ButtonSelect}
@@ -61,11 +56,10 @@ being played.
61 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonUp} 56 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonUp}
62 \opt{HAVEREMOTEKEYMAP}{& } 57 \opt{HAVEREMOTEKEYMAP}{& }
63 & Toggle drawing orientation \\ 58 & Toggle drawing orientation \\
64 \opt{RECORDER_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD% 59 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD%
65 ,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD% 60 ,GIGABEAT_S_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD%
66 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}% 61 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}%
67 {\ButtonPlay} 62 {\ButtonPlay}
68 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
69 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 63 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
70 \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} 64 \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
71 \opt{SANSA_FUZE_PAD,SANSA_CLIP_PAD}{\ButtonUp} 65 \opt{SANSA_FUZE_PAD,SANSA_CLIP_PAD}{\ButtonUp}
@@ -74,7 +68,7 @@ being played.
74 \opt{COWON_D2_PAD}{\TouchCenter} 68 \opt{COWON_D2_PAD}{\TouchCenter}
75 \opt{HAVEREMOTEKEYMAP}{& } 69 \opt{HAVEREMOTEKEYMAP}{& }
76 & Pause the demo \\ 70 & Pause the demo \\
77 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,PBELL_VIBE500_PAD% 71 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,PBELL_VIBE500_PAD%
78 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}% 72 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}%
79 {\ButtonUp{} / \ButtonDown} 73 {\ButtonUp{} / \ButtonDown}
80 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack} 74 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack}
@@ -85,7 +79,7 @@ being played.
85 \opt{COWON_D2_PAD}{\ButtonPlus{} / \ButtonMinus} 79 \opt{COWON_D2_PAD}{\ButtonPlus{} / \ButtonMinus}
86 \opt{HAVEREMOTEKEYMAP}{& } 80 \opt{HAVEREMOTEKEYMAP}{& }
87 & Increase / decrease volume\\ 81 & Increase / decrease volume\\
88 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 82 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
89 ,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,IRIVER_H10_PAD% 83 ,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,IRIVER_H10_PAD%
90 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 84 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
91 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 85 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -94,7 +88,7 @@ being played.
94 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonFF{} / \ButtonRew} 88 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonFF{} / \ButtonRew}
95 \opt{HAVEREMOTEKEYMAP}{& } 89 \opt{HAVEREMOTEKEYMAP}{& }
96 & Increase / decrease speed\\ 90 & Increase / decrease speed\\
97 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 91 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
98 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 92 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
99 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 93 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
100 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD} 94 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}
diff --git a/manual/plugins/pegbox.tex b/manual/plugins/pegbox.tex
index f82d0644c8..3bb0d4830d 100644
--- a/manual/plugins/pegbox.tex
+++ b/manual/plugins/pegbox.tex
@@ -24,11 +24,9 @@ block and crosses which allow you to choose a replacement block.
24 to move around 24 to move around
25 \\ 25 \\
26 26
27 \nopt{RECORDER_PAD,ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD% 27 \nopt{IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD%
28 ,PBELL_VIBE500_PAD,touchscreen,IAUDIO_M3_PAD,MPIO_HD200_PAD% 28 ,PBELL_VIBE500_PAD,touchscreen,IAUDIO_M3_PAD,MPIO_HD200_PAD%
29 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonSelect} 29 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonSelect}
30 \opt{RECORDER_PAD}{\ButtonOn}
31 \opt{ONDIO_PAD}{\ButtonOff}
32 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonRight} 30 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonRight}
33 \opt{IRIVER_H10_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 31 \opt{IRIVER_H10_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
34 \opt{MPIO_HD200_PAD}{\ButtonFunc} 32 \opt{MPIO_HD200_PAD}{\ButtonFunc}
@@ -40,8 +38,6 @@ block and crosses which allow you to choose a replacement block.
40 to choose peg 38 to choose peg
41 \\ 39 \\
42 40
43 \opt{RECORDER_PAD}{\ButtonFTwo}
44 \opt{ONDIO_PAD}{\ButtonMenu{} + \ButtonRight}
45 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 41 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
46 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_FUZE_PAD} 42 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_FUZE_PAD}
47 {\ButtonSelect{} + \ButtonLeft} 43 {\ButtonSelect{} + \ButtonLeft}
@@ -62,8 +58,6 @@ block and crosses which allow you to choose a replacement block.
62 to restart level 58 to restart level
63 \\ 59 \\
64 60
65 \opt{RECORDER_PAD}{\ButtonFOne}
66 \opt{ONDIO_PAD}{\ButtonMenu{} + \ButtonUp}
67 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 61 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
68 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonMenu} 62 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonMenu}
69 \opt{IAUDIO_X5_PAD,MPIO_HD300_PAD}{\ButtonPlay} 63 \opt{IAUDIO_X5_PAD,MPIO_HD300_PAD}{\ButtonPlay}
@@ -83,8 +77,6 @@ block and crosses which allow you to choose a replacement block.
83 \\ 77 \\
84 78
85 \nopt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD}{ 79 \nopt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD}{
86 \opt{RECORDER_PAD}{\ButtonFThree}
87 \opt{ONDIO_PAD}{\ButtonMenu{} + \ButtonDown}
88 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,MPIO_HD300_PAD}{\ButtonRec} 80 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,MPIO_HD300_PAD}{\ButtonRec}
89 \opt{IRIVER_H10_PAD}{\ButtonFF{} + \ButtonScrollDown} 81 \opt{IRIVER_H10_PAD}{\ButtonFF{} + \ButtonScrollDown}
90 \opt{SANSA_E200_PAD}{\ButtonScrollFwd} 82 \opt{SANSA_E200_PAD}{\ButtonScrollFwd}
@@ -103,8 +95,7 @@ block and crosses which allow you to choose a replacement block.
103 \\ 95 \\
104 } 96 }
105 97
106 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 98 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
107 \opt{ONDIO_PAD}{\ButtonMenu{} + \ButtonOff}
108 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonPlay} 99 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonPlay}
109 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,MROBE100_PAD% 100 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,MROBE100_PAD%
110 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 101 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/pictureflow.tex b/manual/plugins/pictureflow.tex
index 64b777739d..017c42d9b7 100644
--- a/manual/plugins/pictureflow.tex
+++ b/manual/plugins/pictureflow.tex
@@ -63,14 +63,12 @@ aware:
63 } 63 }
64 64
65 \nopt{IAUDIO_M3_PAD}{% 65 \nopt{IAUDIO_M3_PAD}{%
66 \nopt{ONDIO_PAD,IRIVER_H10_PAD,RECORDER_PAD,touchscreen,PBELL_VIBE500_PAD% 66 \nopt{IRIVER_H10_PAD,touchscreen,PBELL_VIBE500_PAD%
67 ,SANSA_FUZE_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD% 67 ,SANSA_FUZE_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD%
68 ,SAMSUNG_YH820_PAD} 68 ,SAMSUNG_YH820_PAD}
69 {\ButtonSelect} 69 {\ButtonSelect}
70 \opt{ONDIO_PAD}{\ButtonUp}
71 \opt{IRIVER_H10_PAD,PBELL_VIBE500_PAD}{\ButtonRight} 70 \opt{IRIVER_H10_PAD,PBELL_VIBE500_PAD}{\ButtonRight}
72 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 71 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
73 \opt{RECORDER_PAD}{\ButtonOn}
74 \opt{touchscreen}{\TouchCenter} 72 \opt{touchscreen}{\TouchCenter}
75 \opt{SANSA_FUZE_PAD}{\ButtonRight} 73 \opt{SANSA_FUZE_PAD}{\ButtonRight}
76 \opt{MPIO_HD200_PAD}{\ButtonFunc} 74 \opt{MPIO_HD200_PAD}{\ButtonFunc}
@@ -82,12 +80,11 @@ aware:
82 \opt{GIGABEAT_RC_PAD}{\ButtonRCFF} 80 \opt{GIGABEAT_RC_PAD}{\ButtonRCFF}
83 &} 81 &}
84 Enter track list 82 Enter track list
85 \nopt{ONDIO_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{% 83 \nopt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{%
86 / Play album from selected track} 84 / Play album from selected track}
87 \\ 85 \\
88 % Ondio & Samsung YH use a different button in album list and track list 86 % Ondio & Samsung YH use a different button in album list and track list
89 \opt{ONDIO_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{% 87 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{%
90 \opt{ONDIO_PAD}{\ButtonMenu}
91 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 88 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
92 & 89 &
93 Play album from selected track in track list 90 Play album from selected track in track list
@@ -120,7 +117,7 @@ aware:
120 \\ 117 \\
121 118
122 \nopt{IAUDIO_M3_PAD}{% 119 \nopt{IAUDIO_M3_PAD}{%
123 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,RECORDER_PAD,ONDIO_PAD}{\ButtonOff} 120 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
124 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,SANSA_E200_PAD,SANSA_CLIP_PAD% 121 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,SANSA_E200_PAD,SANSA_CLIP_PAD%
125 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 122 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
126 \opt{SANSA_C200_PAD,IRIVER_H10_PAD}{Long \ButtonPower} 123 \opt{SANSA_C200_PAD,IRIVER_H10_PAD}{Long \ButtonPower}
diff --git a/manual/plugins/pong.tex b/manual/plugins/pong.tex
index f8ea79f9d5..d9cd6010a6 100644
--- a/manual/plugins/pong.tex
+++ b/manual/plugins/pong.tex
@@ -9,8 +9,7 @@ so for a single player game, just press the appropriate buttons to control the s
9a two player game, both players should just press the appropriate buttons for their side. 9a two player game, both players should just press the appropriate buttons for their side.
10 10
11\begin{btnmap} 11\begin{btnmap}
12 \opt{RECORDER_PAD}{\ButtonFOne} 12 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_FUZE_PAD}{\ButtonLeft}
13 \opt{ONDIO_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_FUZE_PAD}{\ButtonLeft}
14 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD% 13 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD%
15 ,GIGABEAT_S_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp} 14 ,GIGABEAT_S_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp}
16 \opt{IPOD_4G_PAD,IPOD_3G_PAD,PBELL_VIBE500_PAD}{\ButtonMenu} 15 \opt{IPOD_4G_PAD,IPOD_3G_PAD,PBELL_VIBE500_PAD}{\ButtonMenu}
@@ -22,8 +21,7 @@ a two player game, both players should just press the appropriate buttons for th
22 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack} 21 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBack}
23 \opt{HAVEREMOTEKEYMAP}{& } 22 \opt{HAVEREMOTEKEYMAP}{& }
24 & Left player up\\ 23 & Left player up\\
25 \opt{RECORDER_PAD,IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonLeft} 24 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonLeft}
26 \opt{ONDIO_PAD}{\ButtonMenu}
27 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD% 25 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD%
28 ,SANSA_FUZE_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonDown} 26 ,SANSA_FUZE_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonDown}
29 \opt{IRIVER_H10_PAD}{\ButtonScrollDown} 27 \opt{IRIVER_H10_PAD}{\ButtonScrollDown}
@@ -34,8 +32,7 @@ a two player game, both players should just press the appropriate buttons for th
34 \opt{MPIO_HD300_PAD}{\ButtonRec} 32 \opt{MPIO_HD300_PAD}{\ButtonRec}
35 \opt{HAVEREMOTEKEYMAP}{& } 33 \opt{HAVEREMOTEKEYMAP}{& }
36 & Left player down\\ 34 & Left player down\\
37 \opt{RECORDER_PAD}{\ButtonFThree} 35 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonUp}
38 \opt{ONDIO_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonUp}
39 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 36 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
40 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonRight} 37 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonRight}
41 \opt{IAUDIO_X5_PAD,SAMSUNG_YH820_PAD}{\ButtonRec} 38 \opt{IAUDIO_X5_PAD,SAMSUNG_YH820_PAD}{\ButtonRec}
@@ -46,8 +43,8 @@ a two player game, both players should just press the appropriate buttons for th
46 \opt{MPIO_HD300_PAD,SAMSUNG_YH92X_PAD}{\ButtonFF} 43 \opt{MPIO_HD300_PAD,SAMSUNG_YH92X_PAD}{\ButtonFF}
47 \opt{HAVEREMOTEKEYMAP}{& } 44 \opt{HAVEREMOTEKEYMAP}{& }
48 & Right player up\\ 45 & Right player up\\
49 \opt{RECORDER_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonRight} 46 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonRight}
50 \opt{ONDIO_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonDown} 47 \opt{SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonDown}
51 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 48 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
52 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD}{\ButtonPlay} 49 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD}{\ButtonPlay}
53 \opt{IRIVER_H10_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 50 \opt{IRIVER_H10_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
@@ -59,7 +56,7 @@ a two player game, both players should just press the appropriate buttons for th
59 \opt{SAMSUNG_YH92X_PAD}{\ButtonRew} 56 \opt{SAMSUNG_YH92X_PAD}{\ButtonRew}
60 \opt{HAVEREMOTEKEYMAP}{& } 57 \opt{HAVEREMOTEKEYMAP}{& }
61 & Right player down\\ 58 & Right player down\\
62 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 59 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
63 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect} 60 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect}
64 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 61 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
65 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 62 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/rockblox.tex b/manual/plugins/rockblox.tex
index 56afa5258a..1b28c039a8 100644
--- a/manual/plugins/rockblox.tex
+++ b/manual/plugins/rockblox.tex
@@ -9,8 +9,6 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
9 9
10\begin{btnmap} 10\begin{btnmap}
11 \nopt{SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD}{ 11 \nopt{SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD}{
12 \opt{RECORDER_PAD}{\ButtonFOne}
13 \opt{PLAYER_PAD}{\ButtonStop+\ButtonMenu}
14 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 12 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
15 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 13 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
16 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD}{\ButtonPlay} 14 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD}{\ButtonPlay}
@@ -19,7 +17,6 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
19 \opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp} 17 \opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp}
20 \opt{GIGABEAT_PAD}{\ButtonA} 18 \opt{GIGABEAT_PAD}{\ButtonA}
21 \opt{MROBE100_PAD}{\ButtonDisplay} 19 \opt{MROBE100_PAD}{\ButtonDisplay}
22 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
23 \opt{COWON_D2_PAD}{\ButtonMenu} 20 \opt{COWON_D2_PAD}{\ButtonMenu}
24 \opt{PBELL_VIBE500_PAD}{\ButtonCancel} 21 \opt{PBELL_VIBE500_PAD}{\ButtonCancel}
25 \opt{MPIO_HD300_PAD}{\ButtonRec} 22 \opt{MPIO_HD300_PAD}{\ButtonRec}
@@ -27,7 +24,7 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
27 \opt{HAVEREMOTEKEYMAP}{& } 24 \opt{HAVEREMOTEKEYMAP}{& }
28 & Restart game\\ 25 & Restart game\\
29 } 26 }
30 \opt{PLAYER_PAD,RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 27 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD%
31 ,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 28 ,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
32 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD% 29 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD%
33 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 30 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
@@ -37,7 +34,7 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
37 \opt{MPIO_HD300_PAD}{\ButtonRew} 34 \opt{MPIO_HD300_PAD}{\ButtonRew}
38 \opt{HAVEREMOTEKEYMAP}{& } 35 \opt{HAVEREMOTEKEYMAP}{& }
39 & Move left\\ 36 & Move left\\
40 \opt{PLAYER_PAD,RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 37 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD%
41 ,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 38 ,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
42 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD% 39 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD%
43 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 40 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
@@ -47,8 +44,7 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
47 \opt{MPIO_HD300_PAD}{\ButtonFF} 44 \opt{MPIO_HD300_PAD}{\ButtonFF}
48 \opt{HAVEREMOTEKEYMAP}{& } 45 \opt{HAVEREMOTEKEYMAP}{& }
49 & Move right\\ 46 & Move right\\
50 \opt{PLAYER_PAD}{\ButtonMenu} 47 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
51 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
52 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 48 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
53 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD} 49 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD}
54 {\ButtonDown} 50 {\ButtonDown}
@@ -61,9 +57,6 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
61 \opt{SAMSUNG_YH820_PAD}{\ButtonFF} 57 \opt{SAMSUNG_YH820_PAD}{\ButtonFF}
62 \opt{HAVEREMOTEKEYMAP}{& } 58 \opt{HAVEREMOTEKEYMAP}{& }
63 & Move down\\ 59 & Move down\\
64 \opt{PLAYER_PAD}{\ButtonOn+\ButtonPlay}
65 \opt{RECORDER_PAD}{\ButtonPlay}
66 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonUp}
67 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD}{\ButtonSelect} 60 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD}{\ButtonSelect}
68 \opt{scrollwheel}{\ButtonScrollBack} 61 \opt{scrollwheel}{\ButtonScrollBack}
69 \opt{IAUDIO_X5_PAD}{\ButtonPower} 62 \opt{IAUDIO_X5_PAD}{\ButtonPower}
@@ -77,8 +70,7 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
77 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp} 70 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp}
78 \opt{HAVEREMOTEKEYMAP}{& } 71 \opt{HAVEREMOTEKEYMAP}{& }
79 & Rotate anticlockwise\\ 72 & Rotate anticlockwise\\
80 \opt{PLAYER_PAD}{\ButtonPlay} 73 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD}
81 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD}
82 {\ButtonUp} 74 {\ButtonUp}
83 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd{} / \ButtonMenu} 75 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd{} / \ButtonMenu}
84 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd} 76 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd}
@@ -92,8 +84,6 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
92 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonDown} 84 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonDown}
93 \opt{HAVEREMOTEKEYMAP}{& } 85 \opt{HAVEREMOTEKEYMAP}{& }
94 & Rotate clockwise\\ 86 & Rotate clockwise\\
95 \opt{PLAYER_PAD,RECORDER_PAD}{\ButtonOn}
96 \opt{ONDIO_PAD}{\ButtonMenu}
97 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 87 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
98 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 88 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
99 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect} 89 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect}
@@ -110,8 +100,7 @@ the blocks fall faster. If the pile of blocks reaches the ceiling, the game is o
110 \opt{HAVEREMOTEKEYMAP}{& } 100 \opt{HAVEREMOTEKEYMAP}{& }
111 & Pause\\ 101 & Pause\\
112 } 102 }
113 \opt{PLAYER_PAD}{\ButtonStop} 103 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
114 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
115 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu+\ButtonSelect} 104 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu+\ButtonSelect}
116 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonPower} 105 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,MROBE100_PAD}{\ButtonPower}
117 \opt{SANSA_FUZE_PAD}{Long \ButtonHome} 106 \opt{SANSA_FUZE_PAD}{Long \ButtonHome}
diff --git a/manual/plugins/rockboy.tex b/manual/plugins/rockboy.tex
index abb455c08b..a0485e9ce4 100644
--- a/manual/plugins/rockboy.tex
+++ b/manual/plugins/rockboy.tex
@@ -11,14 +11,14 @@ the gnuboy emulator. To start a game, open a ROM file saved as \fname{.gb} or
11 11
12\subsubsection{Default keys} 12\subsubsection{Default keys}
13\begin{btnmap} 13\begin{btnmap}
14 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 14 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
15 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD% 15 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
16 ,GIGABEAT_S_PAD,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 16 ,GIGABEAT_S_PAD,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
17 ,SAMSUNG_YH820_PAD}{\ButtonUp{} / \ButtonDown} 17 ,SAMSUNG_YH820_PAD}{\ButtonUp{} / \ButtonDown}
18 \opt{IPOD_4G_PAD}{Tap \ButtonPlay{} / \ButtonMenu} 18 \opt{IPOD_4G_PAD}{Tap \ButtonPlay{} / \ButtonMenu}
19 \opt{IRIVER_H10_PAD}{\ButtonScrollUp{} / \ButtonScrollDown} 19 \opt{IRIVER_H10_PAD}{\ButtonScrollUp{} / \ButtonScrollDown}
20 \opt{PBELL_VIBE500_PAD}{\ButtonOK{} / \ButtonCancel} 20 \opt{PBELL_VIBE500_PAD}{\ButtonOK{} / \ButtonCancel}
21 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 21 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
22 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD% 22 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
23 ,GIGABEAT_S_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD% 23 ,GIGABEAT_S_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD%
24 ,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 24 ,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
@@ -29,7 +29,6 @@ the gnuboy emulator. To start a game, open a ROM file saved as \fname{.gb} or
29 \opt{HAVEREMOTEKEYMAP}{& } 29 \opt{HAVEREMOTEKEYMAP}{& }
30 & Direction keys\\ 30 & Direction keys\\
31 % 31 %
32 \opt{RECORDER_PAD}{\ButtonFOne}
33 \opt{IRIVER_H100_PAD}{\ButtonOn} 32 \opt{IRIVER_H100_PAD}{\ButtonOn}
34 \opt{IRIVER_H300_PAD}{\ButtonRec} 33 \opt{IRIVER_H300_PAD}{\ButtonRec}
35 \opt{IPOD_4G_PAD}{Tap \btnfnt{Top-Right}} 34 \opt{IPOD_4G_PAD}{Tap \btnfnt{Top-Right}}
@@ -42,7 +41,6 @@ the gnuboy emulator. To start a game, open a ROM file saved as \fname{.gb} or
42 \opt{HAVEREMOTEKEYMAP}{& } 41 \opt{HAVEREMOTEKEYMAP}{& }
43 & A button\\ 42 & A button\\
44 % 43 %
45 \opt{RECORDER_PAD}{\ButtonFTwo}
46 \opt{IRIVER_H100_PAD}{\ButtonOff} 44 \opt{IRIVER_H100_PAD}{\ButtonOff}
47 \opt{IRIVER_H300_PAD}{\ButtonMode} 45 \opt{IRIVER_H300_PAD}{\ButtonMode}
48 \opt{IPOD_4G_PAD}{Tap \btnfnt{Top-Left}} 46 \opt{IPOD_4G_PAD}{Tap \btnfnt{Top-Left}}
@@ -56,7 +54,6 @@ the gnuboy emulator. To start a game, open a ROM file saved as \fname{.gb} or
56 \opt{HAVEREMOTEKEYMAP}{& } 54 \opt{HAVEREMOTEKEYMAP}{& }
57 & B button\\ 55 & B button\\
58 % 56 %
59 \opt{RECORDER_PAD}{\ButtonFThree}
60 \opt{IRIVER_H100_PAD}{\ButtonRec} 57 \opt{IRIVER_H100_PAD}{\ButtonRec}
61 \opt{IRIVER_H300_PAD}{\ButtonOn} 58 \opt{IRIVER_H300_PAD}{\ButtonOn}
62 \opt{IPOD_4G_PAD}{Tap \btnfnt{Bottom-Right} /~Press \ButtonSelect} 59 \opt{IPOD_4G_PAD}{Tap \btnfnt{Bottom-Right} /~Press \ButtonSelect}
@@ -73,7 +70,7 @@ the gnuboy emulator. To start a game, open a ROM file saved as \fname{.gb} or
73 & Start\\ 70 & Start\\
74 % 71 %
75 \nopt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{ 72 \nopt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{
76 \opt{RECORDER_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 73 \opt{SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
77 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect} 74 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect}
78 \opt{IPOD_4G_PAD}{Tap \btnfnt{Bottom-Left}} 75 \opt{IPOD_4G_PAD}{Tap \btnfnt{Bottom-Left}}
79 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd} 76 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd}
@@ -86,14 +83,13 @@ the gnuboy emulator. To start a game, open a ROM file saved as \fname{.gb} or
86 & Select\\ 83 & Select\\
87 % 84 %
88 } 85 }
89 \opt{RECORDER_PAD,IRIVER_H100_PAD,iaudiom5,MPIO_HD300_PAD}{ 86 \opt{IRIVER_H100_PAD,iaudiom5,MPIO_HD300_PAD}{
90 \opt{RECORDER_PAD}{\ButtonOn}
91 \opt{IRIVER_H100_PAD,IAUDIO_X5_PAD,MPIO_HD300_PAD}{\ButtonHold{} switch} 87 \opt{IRIVER_H100_PAD,IAUDIO_X5_PAD,MPIO_HD300_PAD}{\ButtonHold{} switch}
92 \opt{HAVEREMOTEKEYMAP}{& } 88 \opt{HAVEREMOTEKEYMAP}{& }
93 & Cycle display scaling modes\\ 89 & Cycle display scaling modes\\
94 % defined for the Recorders and targets with 160x128x2 displays (H100, M5) 90 % defined for the Recorders and targets with 160x128x2 displays (H100, M5)
95 } 91 }
96 \opt{RECORDER_PAD,IRIVER_H300_PAD}{\ButtonOff} 92 \opt{IRIVER_H300_PAD}{\ButtonOff}
97 \opt{IRIVER_H100_PAD}{\ButtonMode} 93 \opt{IRIVER_H100_PAD}{\ButtonMode}
98 \opt{IPOD_4G_PAD}{\ButtonHold{} switch} 94 \opt{IPOD_4G_PAD}{\ButtonHold{} switch}
99 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD% 95 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD%
diff --git a/manual/plugins/sliding.tex b/manual/plugins/sliding.tex
index b0021383f3..8b0a9774e0 100644
--- a/manual/plugins/sliding.tex
+++ b/manual/plugins/sliding.tex
@@ -12,7 +12,7 @@ to turn your own pictures into a puzzle.
12Key controls: 12Key controls:
13 13
14\begin{btnmap} 14\begin{btnmap}
15 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 15 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
16 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 16 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
17 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 17 ,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
18 {\ButtonLeft, \ButtonRight, \ButtonUp\ and \ButtonDown} 18 {\ButtonLeft, \ButtonRight, \ButtonUp\ and \ButtonDown}
@@ -26,8 +26,6 @@ Key controls:
26 \opt{HAVEREMOTEKEYMAP}{& } 26 \opt{HAVEREMOTEKEYMAP}{& }
27 & Move Tile \\ 27 & Move Tile \\
28 % 28 %
29 \opt{RECORDER_PAD}{\ButtonFOne}
30 \opt{ONDIO_PAD}{Long \ButtonMenu}
31 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD} 29 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}
32 {\ButtonSelect} 30 {\ButtonSelect}
33 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} 31 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
@@ -43,8 +41,6 @@ Key controls:
43 \opt{HAVEREMOTEKEYMAP}{& } 41 \opt{HAVEREMOTEKEYMAP}{& }
44 & Shuffle \\ 42 & Shuffle \\
45 % 43 %
46 \opt{RECORDER_PAD}{\ButtonFTwo}
47 \opt{ONDIO_PAD}{\ButtonMenu}
48 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 44 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
49 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay} 45 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay}
50 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} 46 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight}
@@ -59,7 +55,7 @@ Key controls:
59 & Switch between pictures (default puzzle\opt{albumart}{, album art}, and your own image if 55 & Switch between pictures (default puzzle\opt{albumart}{, album art}, and your own image if
60launched via Open With), and numbered tiles \\ 56launched via Open With), and numbered tiles \\
61 % 57 %
62 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 58 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
63 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 59 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
64 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 60 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
65 \opt{SANSA_FUZE_PAD}{Long \ButtonHome} 61 \opt{SANSA_FUZE_PAD}{Long \ButtonHome}
diff --git a/manual/plugins/snake.tex b/manual/plugins/snake.tex
index 6e969fc5a7..2218418c99 100644
--- a/manual/plugins/snake.tex
+++ b/manual/plugins/snake.tex
@@ -6,7 +6,7 @@ as possible by eating the dots that appear on the screen. The game will
6end when the snake touches either the borders of the screen or itself. 6end when the snake touches either the borders of the screen or itself.
7 7
8\begin{btnmap} 8\begin{btnmap}
9 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 9 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
10 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 10 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
11 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 11 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
12 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight} 12 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight}
@@ -17,12 +17,11 @@ end when the snake touches either the borders of the screen or itself.
17 \opt{HAVEREMOTEKEYMAP}{& } 17 \opt{HAVEREMOTEKEYMAP}{& }
18 & Move snake\\ 18 & Move snake\\
19 % 19 %
20 \opt{RECORDER_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD}{\ButtonPlay} 20 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD}{\ButtonPlay}
21 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 21 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
22 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD} 22 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD}
23 {\ButtonSelect} 23 {\ButtonSelect}
24 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 24 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
25 \opt{ONDIO_PAD}{\ButtonMenu}
26 \opt{COWON_D2_PAD}{\TouchCenter} 25 \opt{COWON_D2_PAD}{\TouchCenter}
27 \opt{MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 26 \opt{MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
28 \opt{HAVEREMOTEKEYMAP}{& } 27 \opt{HAVEREMOTEKEYMAP}{& }
diff --git a/manual/plugins/snake2.tex b/manual/plugins/snake2.tex
index 9801e2dc53..f772bf4a67 100644
--- a/manual/plugins/snake2.tex
+++ b/manual/plugins/snake2.tex
@@ -8,7 +8,7 @@ snake gets longer. The game ends when the snake hits a wall, or runs
8into itself. 8into itself.
9 9
10\begin{btnmap} 10\begin{btnmap}
11 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 11 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
12 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 12 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
13 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 13 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
14 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight} 14 {\ButtonUp{} / \ButtonDown{} / \ButtonLeft{} / \ButtonRight}
@@ -18,9 +18,8 @@ into itself.
18 \opt{MPIO_HD300_PAD}{\ButtonRew / \ButtonFF / \ButtonScrollUp / \ButtonScrollDown} 18 \opt{MPIO_HD300_PAD}{\ButtonRew / \ButtonFF / \ButtonScrollUp / \ButtonScrollDown}
19 \opt{HAVEREMOTEKEYMAP}{& } 19 \opt{HAVEREMOTEKEYMAP}{& }
20 & Steer the snake\\ 20 & Steer the snake\\
21 \opt{RECORDER_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 21 \opt{PBELL_VIBE500_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
22 ,SAMSUNG_YH820_PAD}{\ButtonPlay} 22 ,SAMSUNG_YH820_PAD}{\ButtonPlay}
23 \opt{ONDIO_PAD}{\ButtonMenu}
24 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 23 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
25 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD% 24 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD%
26 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD} 25 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZE_PAD}
@@ -29,7 +28,7 @@ into itself.
29 \opt{COWON_D2_PAD}{\TouchCenter} 28 \opt{COWON_D2_PAD}{\TouchCenter}
30 \opt{HAVEREMOTEKEYMAP}{& } 29 \opt{HAVEREMOTEKEYMAP}{& }
31 & Pause and resume the game\\ 30 & Pause and resume the game\\
32 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 31 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
33 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 32 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
34 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD,GIGABEAT_PAD% 33 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_M200_PAD,GIGABEAT_PAD%
35 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 34 ,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/sokoban.tex b/manual/plugins/sokoban.tex
index c4438424d1..5fd5cbbaa2 100644
--- a/manual/plugins/sokoban.tex
+++ b/manual/plugins/sokoban.tex
@@ -14,14 +14,14 @@ information about the level format, see
14\begin{btnmap} 14\begin{btnmap}
15\multicolumn{2}{c}{\textbf{In game}} \\ 15\multicolumn{2}{c}{\textbf{In game}} \\
16\hline 16\hline
17\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 17\opt{IRIVER_H100_PAD,IRIVER_H300_PAD%
18 ,IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD% 18 ,IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD%
19 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 19 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
20 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 20 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
21 {\ButtonUp, \ButtonDown, }% 21 {\ButtonUp, \ButtonDown, }%
22\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu, \ButtonPlay, }% 22\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu, \ButtonPlay, }%
23\opt{IRIVER_H10_PAD}{\ButtonScrollUp, \ButtonScrollDown, }% 23\opt{IRIVER_H10_PAD}{\ButtonScrollUp, \ButtonScrollDown, }%
24\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 24\opt{IRIVER_H100_PAD,IRIVER_H300_PAD%
25 ,IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD% 25 ,IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD%
26 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD,IPOD_3G_PAD% 26 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD,IPOD_3G_PAD%
27 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 27 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
@@ -32,7 +32,7 @@ information about the level format, see
32\opt{MPIO_HD300_PAD}{\ButtonScrollUp, \ButtonScrollDown, \ButtonRew, \ButtonFF} 32\opt{MPIO_HD300_PAD}{\ButtonScrollUp, \ButtonScrollDown, \ButtonRew, \ButtonFF}
33 \opt{HAVEREMOTEKEYMAP}{& } 33 \opt{HAVEREMOTEKEYMAP}{& }
34 & Move the ``sokoban'' up, down, left, or right\\ 34 & Move the ``sokoban'' up, down, left, or right\\
35\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 35\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
36\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 36\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
37\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_E200_PAD,SANSA_C200_PAD% 37\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_E200_PAD,SANSA_C200_PAD%
38 ,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 38 ,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
@@ -46,8 +46,6 @@ information about the level format, see
46 } 46 }
47 & Menu \\ 47 & Menu \\
48\nopt{IAUDIO_X5_PAD}{ 48\nopt{IAUDIO_X5_PAD}{
49 \opt{RECORDER_PAD}{\ButtonFOne}
50 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
51 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonDown} 49 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonDown}
52 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft} 50 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonLeft}
53 \opt{IRIVER_H10_PAD}{\ButtonPlay+\ButtonScrollDown} 51 \opt{IRIVER_H10_PAD}{\ButtonPlay+\ButtonScrollDown}
@@ -64,8 +62,6 @@ information about the level format, see
64 & Back to previous level \\ 62 & Back to previous level \\
65} 63}
66\nopt{IPOD_4G_PAD,IPOD_3G_PAD}{ 64\nopt{IPOD_4G_PAD,IPOD_3G_PAD}{
67 \opt{RECORDER_PAD}{\ButtonFTwo}
68 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonUp}
69 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 65 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
70 \opt{IAUDIO_X5_PAD}{\ButtonRec} 66 \opt{IAUDIO_X5_PAD}{\ButtonRec}
71 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD}{\ButtonPlay+\ButtonRight} 67 \opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD}{\ButtonPlay+\ButtonRight}
@@ -81,8 +77,6 @@ information about the level format, see
81 & Restart level \\ 77 & Restart level \\
82} 78}
83\nopt{IAUDIO_X5_PAD}{ 79\nopt{IAUDIO_X5_PAD}{
84 \opt{RECORDER_PAD}{\ButtonFThree}
85 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
86 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonUp} 80 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonUp}
87 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} 81 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight}
88 \opt{IRIVER_H10_PAD}{\ButtonPlay+\ButtonScrollUp} 82 \opt{IRIVER_H10_PAD}{\ButtonPlay+\ButtonScrollUp}
@@ -98,8 +92,6 @@ information about the level format, see
98 \opt{HAVEREMOTEKEYMAP}{& } 92 \opt{HAVEREMOTEKEYMAP}{& }
99 & Go to next level \\ 93 & Go to next level \\
100} 94}
101\opt{RECORDER_PAD}{\ButtonOn}
102\opt{ONDIO_PAD}{\ButtonMenu}
103\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec} 95\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonRec}
104\opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD% 96\opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD,MROBE100_PAD%
105 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect} 97 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect}
@@ -112,8 +104,7 @@ information about the level format, see
112 \opt{HAVEREMOTEKEYMAP}{& } 104 \opt{HAVEREMOTEKEYMAP}{& }
113 & Undo last movement \\ 105 & Undo last movement \\
114 106
115\opt{RECORDER_PAD,IAUDIO_X5_PAD}{\ButtonPlay} 107\opt{IAUDIO_X5_PAD}{\ButtonPlay}
116\opt{ONDIO_PAD}{\ButtonMenu+\ButtonDown}
117\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 108\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
118\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 109\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
119\opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF} 110\opt{IRIVER_H10_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonFF}
@@ -132,17 +123,16 @@ information about the level format, see
132\hline 123\hline
133\multicolumn{2}{c}{\textbf{Solution playback}} \\ 124\multicolumn{2}{c}{\textbf{Solution playback}} \\
134\hline 125\hline
135\opt{RECORDER_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD% 126\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD%
136 ,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 127 ,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
137 ,SAMSUNG_YH820_PAD}{\ButtonPlay} 128 ,SAMSUNG_YH820_PAD}{\ButtonPlay}
138\opt{ONDIO_PAD}{\ButtonMenu}
139\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 129\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
140\opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 130\opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
141 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect} 131 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect}
142\opt{COWON_D2_PAD}{\TouchCenter} 132\opt{COWON_D2_PAD}{\TouchCenter}
143 \opt{HAVEREMOTEKEYMAP}{& } 133 \opt{HAVEREMOTEKEYMAP}{& }
144 & Pause/resume \\ 134 & Pause/resume \\
145\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD% 135\opt{IRIVER_H100_PAD,IRIVER_H300_PAD%
146 ,IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD% 136 ,IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD%
147 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD% 137 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD%
148 ,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 138 ,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -152,7 +142,7 @@ information about the level format, see
152\opt{COWON_D2_PAD}{\TouchTopMiddle/\TouchBottomMiddle} 142\opt{COWON_D2_PAD}{\TouchTopMiddle/\TouchBottomMiddle}
153 \opt{HAVEREMOTEKEYMAP}{& } 143 \opt{HAVEREMOTEKEYMAP}{& }
154 & Increase/decrease playback speed \\ 144 & Increase/decrease playback speed \\
155\opt{RECORDER_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,ONDIO_PAD% 145\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD%
156 ,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD% 146 ,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD%
157 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD% 147 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD%
158 ,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 148 ,SANSA_CLIP_PAD,SANSA_FUZEPLUS_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
@@ -162,7 +152,7 @@ information about the level format, see
162\opt{MPIO_HD300_PAD}{\ButtonRew/\ButtonFF} 152\opt{MPIO_HD300_PAD}{\ButtonRew/\ButtonFF}
163 \opt{HAVEREMOTEKEYMAP}{& } 153 \opt{HAVEREMOTEKEYMAP}{& }
164 & Go backward/forward (while paused) \\ 154 & Go backward/forward (while paused) \\
165\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 155\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
166\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 156\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
167\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 157\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
168 ,SANSA_FUZEPLUS_PAD}{\ButtonPower} 158 ,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/solitaire.tex b/manual/plugins/solitaire.tex
index 4444762bc2..c98b59873b 100644
--- a/manual/plugins/solitaire.tex
+++ b/manual/plugins/solitaire.tex
@@ -14,13 +14,13 @@ visit
14\url{http://www.solitairecentral.com/rules/Klondike.html} 14\url{http://www.solitairecentral.com/rules/Klondike.html}
15 15
16\begin{btnmap} 16\begin{btnmap}
17 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 17 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
18 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,PBELL_VIBE500_PAD% 18 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,PBELL_VIBE500_PAD%
19 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 19 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
20 {\ButtonUp{} / \ButtonDown} 20 {\ButtonUp{} / \ButtonDown}
21 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack} 21 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack}
22 \opt{IRIVER_H10_PAD}{\ButtonScrollUp{} / \ButtonScrollDown} 22 \opt{IRIVER_H10_PAD}{\ButtonScrollUp{} / \ButtonScrollDown}
23 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 23 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
24 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD% 24 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,IPOD_4G_PAD%
25 ,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD% 25 ,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD%
26 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 26 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -30,8 +30,6 @@ visit
30 \opt{HAVEREMOTEKEYMAP}{& } 30 \opt{HAVEREMOTEKEYMAP}{& }
31 & Move Cursor around.\\ 31 & Move Cursor around.\\
32 % 32 %
33 \opt{RECORDER_PAD}{\ButtonOn}
34 \opt{ONDIO_PAD}{\ButtonMenu}
35 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 33 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
36 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 34 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
37 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD} 35 ,MROBE100_PAD,SANSA_FUZEPLUS_PAD}
@@ -43,8 +41,6 @@ visit
43 \opt{HAVEREMOTEKEYMAP}{& } 41 \opt{HAVEREMOTEKEYMAP}{& }
44 & Select cards, move cards, reveal hidden cards...\\ 42 & Select cards, move cards, reveal hidden cards...\\
45 % 43 %
46 \opt{RECORDER_PAD}{\ButtonFOne}
47 \opt{ONDIO_PAD}{Long \ButtonMenu}
48 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 44 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
49 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD} 45 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}
50 {\ButtonMenu} 46 {\ButtonMenu}
@@ -62,8 +58,7 @@ visit
62 \opt{HAVEREMOTEKEYMAP}{& } 58 \opt{HAVEREMOTEKEYMAP}{& }
63 & Draw 3 new cards from the remains stack\\ 59 & Draw 3 new cards from the remains stack\\
64 % 60 %
65 \opt{RECORDER_PAD,IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonPlay} 61 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonPlay}
66 \opt{ONDIO_PAD}{Long \ButtonDown}
67 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn{} + \ButtonLeft} 62 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn{} + \ButtonLeft}
68 \opt{IAUDIO_X5_PAD}{Long \ButtonPlay} 63 \opt{IAUDIO_X5_PAD}{Long \ButtonPlay}
69 \opt{IRIVER_H10_PAD}{\ButtonFF} 64 \opt{IRIVER_H10_PAD}{\ButtonFF}
@@ -82,8 +77,6 @@ visit
82 \opt{HAVEREMOTEKEYMAP}{& } 77 \opt{HAVEREMOTEKEYMAP}{& }
83 & Put the card from the top of the remains stack on top of the cursor\\ 78 & Put the card from the top of the remains stack on top of the cursor\\
84 % 79 %
85 \opt{RECORDER_PAD}{\ButtonFTwo}
86 \opt{ONDIO_PAD}{Long \ButtonUp}
87 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 80 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
88 ,MROBE100_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{Long \ButtonSelect} 81 ,MROBE100_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{Long \ButtonSelect}
89 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonMenu} 82 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonMenu}
@@ -99,8 +92,7 @@ visit
99 \opt{HAVEREMOTEKEYMAP}{& } 92 \opt{HAVEREMOTEKEYMAP}{& }
100 & Put the card under the cursor on one of the 4 final colour stacks.\\ 93 & Put the card under the cursor on one of the 4 final colour stacks.\\
101 % 94 %
102 \opt{RECORDER_PAD}{\ButtonFThree} 95 \opt{IRIVER_H10_PAD,IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonRight}
103 \opt{IRIVER_H10_PAD,ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonRight}
104 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn{} + \ButtonRight} 96 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn{} + \ButtonRight}
105 \opt{IAUDIO_X5_PAD}{\ButtonRec} 97 \opt{IAUDIO_X5_PAD}{\ButtonRec}
106 \opt{SANSA_E200_PAD}{\ButtonRight} 98 \opt{SANSA_E200_PAD}{\ButtonRight}
@@ -116,7 +108,7 @@ visit
116 \opt{HAVEREMOTEKEYMAP}{& } 108 \opt{HAVEREMOTEKEYMAP}{& }
117 & Put the card on top of the remains stack on one of the final colour stacks.\\ 109 & Put the card on top of the remains stack on one of the final colour stacks.\\
118 % 110 %
119 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H300_PAD,IRIVER_H100_PAD}{\ButtonOff} 111 \opt{IRIVER_H300_PAD,IRIVER_H100_PAD}{\ButtonOff}
120 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu{} + \ButtonSelect} 112 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu{} + \ButtonSelect}
121 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 113 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
122 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 114 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/spacerocks.tex b/manual/plugins/spacerocks.tex
index aeb53420fe..bba380a7ff 100644
--- a/manual/plugins/spacerocks.tex
+++ b/manual/plugins/spacerocks.tex
@@ -6,8 +6,7 @@ UFO will appear -- shoot this for extra points.
6 6
7\begin{btnmap} 7\begin{btnmap}
8 % 8 %
9 \opt{RECORDER_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 9 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
10 \opt{ONDIO_PAD}{\ButtonMenu}
11 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 10 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
12 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 11 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
13 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD} 12 ,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD}
@@ -19,7 +18,7 @@ UFO will appear -- shoot this for extra points.
19 \opt{HAVEREMOTEKEYMAP}{& } 18 \opt{HAVEREMOTEKEYMAP}{& }
20 & Shoot\\ 19 & Shoot\\
21 % 20 %
22 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 21 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
23 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 22 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
24 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 23 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
25 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 24 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -31,7 +30,7 @@ UFO will appear -- shoot this for extra points.
31 \opt{HAVEREMOTEKEYMAP}{& } 30 \opt{HAVEREMOTEKEYMAP}{& }
32 & Thrust\\ 31 & Thrust\\
33 % 32 %
34 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 33 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
35 ,IRIVER_H10_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 34 ,IRIVER_H10_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
36 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 35 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
37 {\ButtonLeft / \ButtonRight} 36 {\ButtonLeft / \ButtonRight}
@@ -41,7 +40,7 @@ UFO will appear -- shoot this for extra points.
41 \opt{HAVEREMOTEKEYMAP}{& } 40 \opt{HAVEREMOTEKEYMAP}{& }
42 & Turn left/right\\ 41 & Turn left/right\\
43 % 42 %
44 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 43 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
45 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 44 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
46 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 45 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
47 ,SAMSUNG_YH820_PAD} 46 ,SAMSUNG_YH820_PAD}
@@ -54,8 +53,6 @@ UFO will appear -- shoot this for extra points.
54 \opt{HAVEREMOTEKEYMAP}{& } 53 \opt{HAVEREMOTEKEYMAP}{& }
55 & Teleport\\ 54 & Teleport\\
56 % 55 %
57 \opt{RECORDER_PAD}{\ButtonOn}
58 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
59 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} 56 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
60 \opt{SANSA_CLIP_PAD}{\ButtonHome} 57 \opt{SANSA_CLIP_PAD}{\ButtonHome}
61 \opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp} 58 \opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp}
@@ -69,7 +66,7 @@ UFO will appear -- shoot this for extra points.
69 \opt{HAVEREMOTEKEYMAP}{& } 66 \opt{HAVEREMOTEKEYMAP}{& }
70 & Pause game\\ 67 & Pause game\\
71 % 68 %
72 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 69 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
73 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 70 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
74 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,MROBE100_PAD% 71 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,MROBE100_PAD%
75 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 72 ,SANSA_C200_PAD,SANSA_CLIP_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/split_editor.tex b/manual/plugins/split_editor.tex
deleted file mode 100644
index d571286006..0000000000
--- a/manual/plugins/split_editor.tex
+++ /dev/null
@@ -1,193 +0,0 @@
1\subsection{Split Editor}
2
3When recording an mp3 file, it is common practice to start the recording
4a little bit early and stop it a little bit late to ensure all the
5desired sound is recorded. This results in recordings that contain
6extra snippets of sound in the beginning and the end. Unfortunately these
7snippets can not be deleted easily because they are stored in the same
8file as the desired recording. The purpose of the split editor is to
9split an mp3 file (the input file) at a point in time (split point). Two
10new files can be generated from the input file. The first file contains
11the part before the split point and the second file contains the part
12after the split point. Once this process has been successful the
13original file can be deleted or kept as a backup. %
14%
15The whole process of splitting an mp3 file consists of three steps:
16%
17\begin{itemize}
18 \item Defining the split point
19 \item Generating the result files
20 \item If desired deleting the input file (with the browser, not the split editor)
21\end{itemize}
22
23\subsubsection{How To Use The Split Editor}
24 When the device plays the song just hit the \ActionWpsPlay{} button
25 to pause, when playback has roughly reached the split point. This need
26 not be very precise as the split point can be fine tuned later. A screen
27 similar to the one below will appear.
28
29 \begin{figure}[H]
30 \begin{center}
31 \includegraphics[width=8.0cm]{plugins/images/ss-splitedit-main-112x64x1}
32 \caption{The Split Editor's Main Screen}
33 \end{center}
34 \end{figure}
35
36\subsubsection{The Split Editor's Main Screen}
37 \begin{description}
38 \item[The waveform]
39 displays the volume of the song over time. It will appear as the song
40 plays and help to visually identify the point in time where the split is
41 desired
42 %
43 \item[The split point indicator]
44 is a vertical line with a small triangle at the top end. It is the most
45 important control element of the split editor. It can be moved with the
46 \ButtonLeft\ and \ButtonRight\ buttons. Later, when you have fine tuned
47 the split point, the song will be split at this position.
48 %
49 \item[The split time]
50 At the top of the window a time value is displayed. This is the point in
51 time within the song at which the split point indicator is positioned.
52 %
53 \item[The locator]
54 Another vertical bar represents the position locator. It moves along as
55 the song plays. In contrast to the split point indicator it has no
56 triangles at the ends.
57 %
58 \item[The time bar]
59 displays the current position within the song relative to the whole song.
60 The entire length of the time bar represents the song length. The length
61 of the solid part of the time bar represents the position and length of
62 the displayed part of the song.
63 %
64 \item[The scale mode]
65 On the right side of the bottom line the scale mode is displayed. The
66 waveform can be scaled either logarithmically or linearly. In logarithmic
67 scale mode the letters ``dB'' are displayed, in linear mode ``\%''. Use
68 \opt{RECORDER_PAD}{\ButtonFThree}
69 \opt{ONDIO_PAD}{\ButtonMenu\ + \ButtonRight}
70 to switch between these modes. Linear mode usually gives better optical
71 hints with commercially recorded music. For quiet recordings,
72 especially of human speech, the logarithmic scale often is preferable.
73 More information in the Scale \reference{ref:Scalemode} below.
74 %
75 \item[The loop mode]
76 In the middle of the bottom line the loop mode icon is displayed.
77 There are 4 different loop modes. Pressing
78 \opt{RECORDER_PAD}{\ButtonFTwo}
79 \opt{ONDIO_PAD}{\ButtonMenu\ + \ButtonUp}
80 changes to the next loop mode.
81 %
82 \begin{description}
83 \item
84 \includegraphics[width=0.53cm]{plugins/images/icon-splitedit-loop-1}
85 Playback loops around the split point indicator. This mode is best
86 used when searching and zooming for the desired point at which to split
87 the recording.
88 \item
89 \includegraphics[width=0.53cm]{plugins/images/icon-splitedit-loop-2}
90 Playback loops from the split point indicator to the end of the
91 visible area. This mode is best used when fine tuning the split
92 indicator position at the beginning of a recording.
93 \item
94 \includegraphics[width=0.53cm]{plugins/images/icon-splitedit-loop-3}
95 Playback loops from the beginning of the
96 visible area to the split point. This mode is best used when fine
97 tuning the split indicator position at the end of a recording.
98 \item
99 \includegraphics[width=0.53cm]{plugins/images/icon-splitedit-loop-4}
100 Playback does not loop, the borders of the visible
101 area as well as the split point indicator are ignored. This mode is
102 best used when playing the song outside of the borders of the displayed
103 region.
104 \end{description}
105 \item[Perform the split (8)]
106 The icon above the
107 \opt{RECORDER_PAD}{\ButtonFOne}
108 \opt{ONDIO_PAD}{\ButtonLeft}
109 button indicates its function to execute the split. When split
110 positioning is complete open the save dialogue with
111 \opt{RECORDER_PAD}{\ButtonFOne}
112 \opt{ONDIO_PAD}{\ButtonMenu\ + \ButtonLeft}.
113 \end{description}
114
115 \begin{table}
116 \begin{btnmap}
117 \ButtonOff & Quit plugin \\
118 %
119 \ButtonLeft\ / \ButtonRight & Move the split point indicator \\
120 %
121 \ButtonUp\ / \ButtonDown & Zoom in / out \\
122 %
123 \opt{RECORDER_PAD}{\ButtonPlay}
124 \opt{ONDIO_PAD}{\ButtonMenu}
125 & Play from the split position \\
126 %
127 \opt{RECORDER_PAD}{\ButtonFOne}
128 \opt{ONDIO_PAD}{\ButtonMenu\ + \ButtonLeft}
129 & Enter the save dialogue \\
130 %
131 \opt{RECORDER_PAD}{\ButtonFTwo}
132 \opt{ONDIO_PAD}{\ButtonMenu\ + \ButtonUp}
133 & Toggle loop modes \\
134 %
135 \opt{RECORDER_PAD}{\ButtonFThree}
136 \opt{ONDIO_PAD}{\ButtonMenu\ + \ButtonRight}
137 & Toggle logarithmic / linear scaling \\
138 \opt{RECORDER_PAD}{
139 %
140 \ButtonOn\ + \ButtonLeft
141 & Play half speed \\
142 %
143 \ButtonOn\ + \ButtonRight
144 & Play 150\% speed \\
145 %
146 \ButtonOn\ + \ButtonPlay
147 & Play normal speed \\
148 }
149 \end{btnmap}
150 \caption{Controls in the split editor}
151 \end{table}
152
153\subsubsection{Save dialogue}
154In the save dialogue it is possible to specify which of the files you
155want to save and their names. When finished, select
156``Save'' and the files will be written to
157disk. Note that files can not be overwritten, so filenames that
158do not exist yet must be chosen. If unsure whether the
159file already exists simply try to save it. If another file with this
160name exists the dialogue will return and you can choose another
161filename
162
163\screenshot{plugins/images/ss-splitedit-save}{The Split Editor's
164Save Dialogue}{}
165
166\begin{table}
167 \begin{btnmap}
168 \ButtonUp\ / \ButtonDown & Select item \\
169 %
170 \opt{RECORDER_PAD}{\ButtonPlay}
171 \opt{ONDIO_PAD}{\ButtonRight}
172 & Toggle / edit item \\
173 %
174 \ButtonOff & Cancel \\
175 \end{btnmap}
176 \caption{Controls in the save dialogue}
177\end{table}
178
179\subsubsection{\label{ref:Scalemode}Scale}
180The values in the waveform are scaled according to the settings of the
181peak meter. These can be altered in the peak meter settings,
182see \reference{ref:Peakmetersetting}. If extreme minimum or
183maximum values are set the waveform might be cut off. A minimum
184setting of {}-60~dB and a maximum setting of 0~dB are recommended.
185These settings should be capable of producing useful waveforms for very
186soft sounds in logarithmic mode (dB). When the editor is used on loud
187sounds (such as commercial rock or pop music) switching to the linear
188scale may prove more effective since the logarithmic scale compresses
189loud noises and makes it more difficult to identify characteristic
190shapes. Note that it is always possible to toggle between the two scale
191modes.
192
193
diff --git a/manual/plugins/star.tex b/manual/plugins/star.tex
index 3cb7f078cc..0d6a95e713 100644
--- a/manual/plugins/star.tex
+++ b/manual/plugins/star.tex
@@ -11,7 +11,7 @@ wall to allow your filled circle to get to places on the screen it
11could not otherwise reach. The block cannot take ``o''s. 11could not otherwise reach. The block cannot take ``o''s.
12 12
13\begin{btnmap} 13\begin{btnmap}
14 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 14 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
15 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 15 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
16 ,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD% 16 ,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD%
17 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 17 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -20,7 +20,7 @@ could not otherwise reach. The block cannot take ``o''s.
20 \opt{MPIO_HD300_PAD}{\ButtonRew} 20 \opt{MPIO_HD300_PAD}{\ButtonRew}
21 \opt{HAVEREMOTEKEYMAP}{& } 21 \opt{HAVEREMOTEKEYMAP}{& }
22 & Move Left\\ 22 & Move Left\\
23 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 23 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
24 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 24 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
25 ,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD% 25 ,GIGABEAT_S_PAD,MROBE100_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD%
26 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 26 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -29,7 +29,7 @@ could not otherwise reach. The block cannot take ``o''s.
29 \opt{COWON_D2_PAD}{\TouchMidRight} 29 \opt{COWON_D2_PAD}{\TouchMidRight}
30 \opt{HAVEREMOTEKEYMAP}{& } 30 \opt{HAVEREMOTEKEYMAP}{& }
31 & Move Right\\ 31 & Move Right\\
32 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 32 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
33 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 33 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
34 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 34 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
35 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 35 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -40,7 +40,7 @@ could not otherwise reach. The block cannot take ``o''s.
40 \opt{MPIO_HD300_PAD}{\ButtonScrollUp} 40 \opt{MPIO_HD300_PAD}{\ButtonScrollUp}
41 \opt{HAVEREMOTEKEYMAP}{& } 41 \opt{HAVEREMOTEKEYMAP}{& }
42 & Move Up\\ 42 & Move Up\\
43 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 43 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
44 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 44 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
45 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 45 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
46 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 46 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -51,8 +51,6 @@ could not otherwise reach. The block cannot take ``o''s.
51 \opt{MPIO_HD300_PAD}{\ButtonScrollDown} 51 \opt{MPIO_HD300_PAD}{\ButtonScrollDown}
52 \opt{HAVEREMOTEKEYMAP}{& } 52 \opt{HAVEREMOTEKEYMAP}{& }
53 & Move Down\\ 53 & Move Down\\
54 \opt{RECORDER_PAD}{\ButtonOn}
55 \opt{ONDIO_PAD}{\ButtonMenu}
56 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 54 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
57 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD% 55 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD%
58 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect} 56 ,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect}
@@ -62,8 +60,6 @@ could not otherwise reach. The block cannot take ``o''s.
62 \opt{MPIO_HD300_PAD}{\ButtonEnter} 60 \opt{MPIO_HD300_PAD}{\ButtonEnter}
63 \opt{HAVEREMOTEKEYMAP}{& } 61 \opt{HAVEREMOTEKEYMAP}{& }
64 & Switch between circle and square\\ 62 & Switch between circle and square\\
65 \opt{RECORDER_PAD}{\ButtonFOne}
66 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
67 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode+\ButtonLeft} 63 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode+\ButtonLeft}
68 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonLeft} 64 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonLeft}
69 \opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonDown} 65 \opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonDown}
@@ -77,8 +73,6 @@ could not otherwise reach. The block cannot take ``o''s.
77 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonDown} 73 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonDown}
78 \opt{HAVEREMOTEKEYMAP}{& } 74 \opt{HAVEREMOTEKEYMAP}{& }
79 & Previous level\\ 75 & Previous level\\
80 \opt{RECORDER_PAD}{\ButtonFTwo}
81 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonUp}
82 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode+\ButtonUp} 76 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode+\ButtonUp}
83 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 77 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
84 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay+\ButtonRight} 78 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay+\ButtonRight}
@@ -92,8 +86,6 @@ could not otherwise reach. The block cannot take ``o''s.
92 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{Long \ButtonFF} 86 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{Long \ButtonFF}
93 \opt{HAVEREMOTEKEYMAP}{& } 87 \opt{HAVEREMOTEKEYMAP}{& }
94 & Reset level \\ 88 & Reset level \\
95 \opt{RECORDER_PAD}{\ButtonFThree}
96 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonRight}
97 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode+\ButtonRight} 89 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode+\ButtonRight}
98 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonRight} 90 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect+\ButtonRight}
99 \opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonRight} 91 \opt{IAUDIO_X5_PAD}{\ButtonPlay+\ButtonRight}
@@ -107,7 +99,7 @@ could not otherwise reach. The block cannot take ``o''s.
107 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonUp} 99 \opt{SAMSUNG_YH820_PAD}{\ButtonRec+\ButtonUp}
108 \opt{HAVEREMOTEKEYMAP}{& } 100 \opt{HAVEREMOTEKEYMAP}{& }
109 & Next level \\ 101 & Next level \\
110 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 102 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
111 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 103 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
112 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 104 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
113 ,GIGABEAT_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 105 ,GIGABEAT_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/stats.tex b/manual/plugins/stats.tex
index b4fa59bf99..0dac854d68 100644
--- a/manual/plugins/stats.tex
+++ b/manual/plugins/stats.tex
@@ -1,9 +1,9 @@
1\subsection{Stats} 1\subsection{Stats}
2\screenshot{plugins/images/ss-stats}{The stats-plugin}{} 2\screenshot{plugins/images/ss-stats}{The stats-plugin}{}
3 3
4The stats plugin counts the directories and files% 4The stats plugin counts the directories and files
5\nopt{archosplayer}{ (the total number as well as the number 5(the total number as well as the number
6of audio, playlist, image and video files) }% 6of audio, playlist, image and video files)
7on your \dap{}. 7on your \dap{}.
8Press \PluginCancel{} or \PluginExit{} to abort counting and 8Press \PluginCancel{} or \PluginExit{} to abort counting and
9exit the plugin. Press it again to quit after counting has 9exit the plugin. Press it again to quit after counting has
diff --git a/manual/plugins/stopwatch.tex b/manual/plugins/stopwatch.tex
index 68521118f8..3a7785be64 100644
--- a/manual/plugins/stopwatch.tex
+++ b/manual/plugins/stopwatch.tex
@@ -4,8 +4,7 @@
4A simple stopwatch program with support for saving times. 4A simple stopwatch program with support for saving times.
5 5
6\begin{btnmap} 6\begin{btnmap}
7 \opt{PLAYER_PAD}{\ButtonMenu} 7 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
8 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
9 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 8 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
10 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD% 9 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD%
11 ,MROBE100_PAD,SANSA_CLIP_PAD}{\ButtonPower} 10 ,MROBE100_PAD,SANSA_CLIP_PAD}{\ButtonPower}
@@ -20,18 +19,17 @@ A simple stopwatch program with support for saving times.
20 } 19 }
21 & Quit Plugin \\ 20 & Quit Plugin \\
22 % 21 %
23 \opt{PLAYER_PAD,RECORDER_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD% 22 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD%
24 ,PBELL_VIBE500_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD% 23 ,PBELL_VIBE500_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD%
25 ,SAMSUNG_YH820_PAD}{\ButtonPlay} 24 ,SAMSUNG_YH820_PAD}{\ButtonPlay}
26 \opt{ONDIO_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD% 25 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD%
27 ,SANSA_CLIP_PAD}{\ButtonRight} 26 ,SANSA_CLIP_PAD}{\ButtonRight}
28 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,MROBE100_PAD,IPOD_4G_PAD% 27 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,MROBE100_PAD,IPOD_4G_PAD%
29 ,IPOD_3G_PAD}{\ButtonSelect} 28 ,IPOD_3G_PAD}{\ButtonSelect}
30 \opt{HAVEREMOTEKEYMAP}{& } 29 \opt{HAVEREMOTEKEYMAP}{& }
31 & Start / stop \\ 30 & Start / stop \\
32 % 31 %
33 \opt{PLAYER_PAD}{\ButtonStop} 32 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD%
34 \opt{RECORDER_PAD,ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD%
35 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SAMSUNG_YH92X_PAD% 33 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SAMSUNG_YH92X_PAD%
36 ,SAMSUNG_YH820_PAD}{\ButtonLeft} 34 ,SAMSUNG_YH820_PAD}{\ButtonLeft}
37 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonDown} 35 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonDown}
@@ -44,8 +42,8 @@ A simple stopwatch program with support for saving times.
44 \opt{HAVEREMOTEKEYMAP}{& } 42 \opt{HAVEREMOTEKEYMAP}{& }
45 & Reset timer (only when timer is stopped)\\ 43 & Reset timer (only when timer is stopped)\\
46 % 44 %
47 \opt{PLAYER_PAD,RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 45 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
48 \opt{ONDIO_PAD,GIGABEAT_PAD,MROBE100_PAD,PBELL_VIBE500_PAD}{\ButtonMenu} 46 \opt{GIGABEAT_PAD,MROBE100_PAD,PBELL_VIBE500_PAD}{\ButtonMenu}
49 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRight} 47 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRight}
50 \opt{IRIVER_H10_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonFF} 48 \opt{IRIVER_H10_PAD,MPIO_HD200_PAD,MPIO_HD300_PAD}{\ButtonFF}
51 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_S_PAD% 49 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,GIGABEAT_S_PAD%
@@ -53,8 +51,8 @@ A simple stopwatch program with support for saving times.
53 \opt{HAVEREMOTEKEYMAP}{& } 51 \opt{HAVEREMOTEKEYMAP}{& }
54 & Take lap time \\ 52 & Take lap time \\
55 % 53 %
56 \opt{PLAYER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonLeft{} / \ButtonRight} 54 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonLeft{} / \ButtonRight}
57 \opt{RECORDER_PAD,ONDIO_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD% 55 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD%
58 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 56 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
59 ,SANSA_CLIP_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp{} / \ButtonDown} 57 ,SANSA_CLIP_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp{} / \ButtonDown}
60 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack} 58 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd{} / \ButtonScrollBack}
diff --git a/manual/plugins/sudoku.tex b/manual/plugins/sudoku.tex
index ecb73b1520..94fa2cb545 100644
--- a/manual/plugins/sudoku.tex
+++ b/manual/plugins/sudoku.tex
@@ -28,7 +28,7 @@ settings.
28\note{The scratchpad is \emph{not} saved when saving the game.} 28\note{The scratchpad is \emph{not} saved when saving the game.}
29 29
30\begin{btnmap} 30\begin{btnmap}
31 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 31 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
32 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 32 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
33 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 33 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
34 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 34 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -43,8 +43,6 @@ settings.
43 % 43 %
44 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect & Change cursor move direction\\} 44 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect & Change cursor move direction\\}
45 % 45 %
46 \opt{RECORDER_PAD}{\ButtonPlay}
47 \opt{ONDIO_PAD}{\ButtonMenu}
48 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect{} / \ButtonOn} 46 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect{} / \ButtonOn}
49 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonLeft{} / \ButtonRight} 47 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonLeft{} / \ButtonRight}
50 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 48 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
@@ -61,8 +59,6 @@ settings.
61 \opt{HAVEREMOTEKEYMAP}{& } 59 \opt{HAVEREMOTEKEYMAP}{& }
62 & Change number under the cursor\\ 60 & Change number under the cursor\\
63 % 61 %
64 \opt{RECORDER_PAD}{Long \ButtonPlay}
65 \opt{ONDIO_PAD}{Long \ButtonMenu+\ButtonDown}
66 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{Long \ButtonOn} 62 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{Long \ButtonOn}
67 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonLeft{} / \ButtonRight} 63 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonLeft{} / \ButtonRight}
68 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 64 \opt{IAUDIO_X5_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
@@ -79,8 +75,6 @@ settings.
79 \opt{HAVEREMOTEKEYMAP}{& } 75 \opt{HAVEREMOTEKEYMAP}{& }
80 & Constantly changing the number under the cursor\\ 76 & Constantly changing the number under the cursor\\
81 % 77 %
82 \opt{RECORDER_PAD}{\ButtonFOne}
83 \opt{ONDIO_PAD}{Long \ButtonMenu}
84 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 78 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
85 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD% 79 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
86 ,COWON_D2_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}{\ButtonMenu} 80 ,COWON_D2_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}{\ButtonMenu}
@@ -94,8 +88,6 @@ settings.
94 \opt{HAVEREMOTEKEYMAP}{& } 88 \opt{HAVEREMOTEKEYMAP}{& }
95 & Open Menu\\ 89 & Open Menu\\
96 % 90 %
97 \opt{RECORDER_PAD}{\ButtonFTwo}
98 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonLeft}
99 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} 91 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
100 \opt{SANSA_CLIP_PAD}{\ButtonHome} 92 \opt{SANSA_CLIP_PAD}{\ButtonHome}
101 \opt{SANSA_FUZE_PAD}{\ButtonSelect} 93 \opt{SANSA_FUZE_PAD}{\ButtonSelect}
@@ -108,7 +100,7 @@ settings.
108 \opt{HAVEREMOTEKEYMAP}{& } 100 \opt{HAVEREMOTEKEYMAP}{& }
109 & Add/Remove number to scratchpad\\ 101 & Add/Remove number to scratchpad\\
110 % 102 %
111 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 103 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
112 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 104 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
113 ,MROBE100_PAD}{\ButtonPower} 105 ,MROBE100_PAD}{\ButtonPower}
114 \opt{SANSA_FUZE_PAD}{Long \ButtonHome} 106 \opt{SANSA_FUZE_PAD}{Long \ButtonHome}
diff --git a/manual/plugins/text_viewer.tex b/manual/plugins/text_viewer.tex
index 7379176aaf..60b38e7a7e 100644
--- a/manual/plugins/text_viewer.tex
+++ b/manual/plugins/text_viewer.tex
@@ -9,8 +9,7 @@ by using \emph{Open with} from the \emph{Context Menu}
9 9
10\subsubsection{Default keys} 10\subsubsection{Default keys}
11\begin{btnmap} 11\begin{btnmap}
12 \opt{PLAYER_PAD}{\ButtonLeft} 12 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
13 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
14 ,SANSA_E200_PAD,SANSA_FUZE_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD% 13 ,SANSA_E200_PAD,SANSA_FUZE_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD%
15 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp} 14 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonUp}
16 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack} 15 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollBack}
@@ -26,8 +25,7 @@ by using \emph{Open with} from the \emph{Context Menu}
26 } 25 }
27 & Scroll{}-up\\ 26 & Scroll{}-up\\
28 27
29 \opt{PLAYER_PAD}{\ButtonRight} 28 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
30 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
31 ,SANSA_E200_PAD,SANSA_FUZE_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD% 29 ,SANSA_E200_PAD,SANSA_FUZE_PAD,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD%
32 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonDown} 30 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonDown}
33 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd} 31 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonScrollFwd}
@@ -43,12 +41,11 @@ by using \emph{Open with} from the \emph{Context Menu}
43 } 41 }
44 & Scroll{}-down\\ 42 & Scroll{}-down\\
45 43
46 \opt{PLAYER_PAD}{\ButtonMenu+\ButtonLeft}
47 \opt{GIGABEAT_S_PAD}{\ButtonPlay+\ButtonLeft} 44 \opt{GIGABEAT_S_PAD}{\ButtonPlay+\ButtonLeft}
48 \opt{MPIO_HD200_PAD}{\ButtonVolDown} 45 \opt{MPIO_HD200_PAD}{\ButtonVolDown}
49 \opt{MPIO_HD300_PAD}{\ButtonRew} 46 \opt{MPIO_HD300_PAD}{\ButtonRew}
50 \opt{touchscreen}{\TouchMidLeft} 47 \opt{touchscreen}{\TouchMidLeft}
51 \nopt{PLAYER_PAD,GIGABEAT_S_PAD,touchscreen,IAUDIO_M3_PAD,MPIO_HD200_PAD% 48 \nopt{GIGABEAT_S_PAD,touchscreen,IAUDIO_M3_PAD,MPIO_HD200_PAD%
52 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonLeft} 49 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonLeft}
53 \opt{HAVEREMOTEKEYMAP}{& 50 \opt{HAVEREMOTEKEYMAP}{&
54 \opt{IAUDIO_M3_PAD}{\ButtonRCLeft} 51 \opt{IAUDIO_M3_PAD}{\ButtonRCLeft}
@@ -56,12 +53,11 @@ by using \emph{Open with} from the \emph{Context Menu}
56 & Top of file (Narrow mode) / 53 & Top of file (Narrow mode) /
57 One screen left (Wide mode)\\ 54 One screen left (Wide mode)\\
58 55
59 \opt{PLAYER_PAD}{\ButtonMenu+\ButtonRight}
60 \opt{GIGABEAT_S_PAD}{\ButtonPlay+\ButtonRight} 56 \opt{GIGABEAT_S_PAD}{\ButtonPlay+\ButtonRight}
61 \opt{MPIO_HD200_PAD}{\ButtonVolUp} 57 \opt{MPIO_HD200_PAD}{\ButtonVolUp}
62 \opt{MPIO_HD300_PAD}{\ButtonFF} 58 \opt{MPIO_HD300_PAD}{\ButtonFF}
63 \opt{touchscreen}{\TouchMidRight} 59 \opt{touchscreen}{\TouchMidRight}
64 \nopt{PLAYER_PAD,GIGABEAT_S_PAD,touchscreen,IAUDIO_M3_PAD,MPIO_HD200_PAD% 60 \nopt{GIGABEAT_S_PAD,touchscreen,IAUDIO_M3_PAD,MPIO_HD200_PAD%
65 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRight} 61 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRight}
66 \opt{HAVEREMOTEKEYMAP}{& 62 \opt{HAVEREMOTEKEYMAP}{&
67 \opt{IAUDIO_M3_PAD}{\ButtonRCRight} 63 \opt{IAUDIO_M3_PAD}{\ButtonRCRight}
@@ -69,11 +65,11 @@ by using \emph{Open with} from the \emph{Context Menu}
69 & Bottom of file (Narrow mode) / 65 & Bottom of file (Narrow mode) /
70 One screen right (Wide mode)\\ 66 One screen right (Wide mode)\\
71 67
72 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD% 68 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD%
73 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD% 69 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD%
74 ,GIGABEAT_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 70 ,GIGABEAT_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
75 ,SAMSUNG_YH820_PAD}{% 71 ,SAMSUNG_YH820_PAD}{%
76 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonUp} 72 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonUp}
77 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollBack} 73 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollBack}
78 \opt{SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD}{\ButtonUp} 74 \opt{SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD}{\ButtonUp}
79 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonUp} 75 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonUp}
@@ -84,11 +80,11 @@ by using \emph{Open with} from the \emph{Context Menu}
84 & One line up\\ 80 & One line up\\
85 } 81 }
86 82
87 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD% 83 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,SANSA_E200_PAD%
88 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD% 84 ,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD%
89 ,GIGABEAT_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 85 ,GIGABEAT_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
90 ,SAMSUNG_YH820_PAD}{% 86 ,SAMSUNG_YH820_PAD}{%
91 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonDown} 87 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonDown}
92 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd} 88 \opt{SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd}
93 \opt{SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD}{\ButtonDown} 89 \opt{SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD}{\ButtonDown}
94 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonDown} 90 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonDown}
@@ -99,9 +95,9 @@ by using \emph{Open with} from the \emph{Context Menu}
99 & One line down\\ 95 & One line down\\
100 } 96 }
101 97
102 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,% 98 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,%
103 GIGABEAT_S_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{ 99 GIGABEAT_S_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{
104 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonLeft} 100 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonLeft}
105 \opt{GIGABEAT_S_PAD}{\ButtonLeft} 101 \opt{GIGABEAT_S_PAD}{\ButtonLeft}
106 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonLeft} 102 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonLeft}
107 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomLeft} 103 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomLeft}
@@ -111,9 +107,9 @@ by using \emph{Open with} from the \emph{Context Menu}
111 & One column left\\ 107 & One column left\\
112 } 108 }
113 109
114 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,% 110 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,%
115 GIGABEAT_S_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{ 111 GIGABEAT_S_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{
116 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonRight} 112 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonRight}
117 \opt{GIGABEAT_S_PAD}{\ButtonRight} 113 \opt{GIGABEAT_S_PAD}{\ButtonRight}
118 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonRight} 114 \opt{GIGABEAT_PAD}{\ButtonA+\ButtonRight}
119 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomRight} 115 \opt{SANSA_FUZEPLUS_PAD}{\ButtonBottomRight}
@@ -123,11 +119,10 @@ by using \emph{Open with} from the \emph{Context Menu}
123 & One column right\\ 119 & One column right\\
124 } 120 }
125 121
126 \opt{RECORDER_PAD,PLAYER_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 122 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
127 ,IRIVER_H10_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD% 123 ,IRIVER_H10_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD%
128 ,MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay} 124 ,MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPlay}
129 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect} 125 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonSelect}
130 \opt{ONDIO_PAD}{\ButtonMenu}
131 \opt{GIGABEAT_PAD}{\ButtonA} 126 \opt{GIGABEAT_PAD}{\ButtonA}
132 \opt{SANSA_C200_PAD,SANSA_E200_PAD}{\ButtonRec} 127 \opt{SANSA_C200_PAD,SANSA_E200_PAD}{\ButtonRec}
133 \opt{SANSA_CLIP_PAD}{\ButtonHome} 128 \opt{SANSA_CLIP_PAD}{\ButtonHome}
@@ -142,9 +137,6 @@ by using \emph{Open with} from the \emph{Context Menu}
142 } 137 }
143 & Toggle autoscroll\\ 138 & Toggle autoscroll\\
144 139
145 \opt{PLAYER_PAD}{\ButtonOn}
146 \opt{RECORDER_PAD}{\ButtonFTwo}
147 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
148 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonSelect} 140 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonSelect}
149 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect} 141 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect}
150 \opt{IRIVER_H10_PAD}{\ButtonFF} 142 \opt{IRIVER_H10_PAD}{\ButtonFF}
@@ -162,9 +154,7 @@ by using \emph{Open with} from the \emph{Context Menu}
162 } 154 }
163 & Set/Reset bookmarks\\ 155 & Set/Reset bookmarks\\
164 156
165 \opt{RECORDER_PAD}{\ButtonFOne} 157 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
166 \opt{ONDIO_PAD}{Long \ButtonMenu}
167 \opt{PLAYER_PAD,IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
168 ,MROBE100_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}{\ButtonMenu} 158 ,MROBE100_PAD,PBELL_VIBE500_PAD,MPIO_HD300_PAD}{\ButtonMenu}
169 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 159 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
170 \opt{IAUDIO_X5_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD}{\ButtonSelect} 160 \opt{IAUDIO_X5_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD}{\ButtonSelect}
@@ -179,8 +169,7 @@ by using \emph{Open with} from the \emph{Context Menu}
179 } 169 }
180 & Enter menu\\ 170 & Enter menu\\
181 171
182 \opt{PLAYER_PAD}{\ButtonStop} 172 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
183 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
184 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 173 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
185 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 174 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
186 ,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 175 ,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
@@ -359,8 +348,6 @@ stores its settings, the current position and bookmarks in
359 348
360\subsubsection{Bookmarks} 349\subsubsection{Bookmarks}
361 To add a bookmark, press 350 To add a bookmark, press
362 \opt{PLAYER_PAD}{\ButtonOn}\opt{RECORDER_PAD}{\ButtonFTwo}%
363 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}%
364 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonSelect}% 351 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn+\ButtonSelect}%
365 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect}% 352 \opt{IPOD_4G_PAD,IPOD_3G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonSelect}%
366 \opt{IRIVER_H10_PAD}{\ButtonFF}\opt{IAUDIO_X5_PAD}{\ButtonRec}% 353 \opt{IRIVER_H10_PAD}{\ButtonFF}\opt{IAUDIO_X5_PAD}{\ButtonRec}%
diff --git a/manual/plugins/vumeter.tex b/manual/plugins/vumeter.tex
index 22d5bcc2d5..76a79401b0 100644
--- a/manual/plugins/vumeter.tex
+++ b/manual/plugins/vumeter.tex
@@ -10,7 +10,7 @@ settings menu the decay time for the meter (its memory), the meter type
10and the meter scale can be changed. 10and the meter scale can be changed.
11 11
12\begin{btnmap} 12\begin{btnmap}
13\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 13\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
14\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu} 14\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
15\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 15\opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
16 ,MROBE100_PAD,COWON_D2_PAD}{\ButtonPower} 16 ,MROBE100_PAD,COWON_D2_PAD}{\ButtonPower}
@@ -24,8 +24,7 @@ and the meter scale can be changed.
24 \opt{IRIVER_RC_H100_PAD}{\ButtonRCStop} 24 \opt{IRIVER_RC_H100_PAD}{\ButtonRCStop}
25 } 25 }
26 & Save settings and quit\\ 26 & Save settings and quit\\
27\opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 27\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
28\opt{ONDIO_PAD}{\ButtonMenu}
29\opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD% 28\opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD%
30 ,MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 29 ,MPIO_HD200_PAD,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
31 ,SAMSUNG_YH820_PAD}{\ButtonPlay} 30 ,SAMSUNG_YH820_PAD}{\ButtonPlay}
@@ -38,8 +37,6 @@ and the meter scale can be changed.
38\opt{COWON_D2_PAD}{\TouchCenter} 37\opt{COWON_D2_PAD}{\TouchCenter}
39 \opt{HAVEREMOTEKEYMAP}{& } 38 \opt{HAVEREMOTEKEYMAP}{& }
40 & Help\\ 39 & Help\\
41\opt{RECORDER_PAD}{\ButtonFOne}
42\opt{ONDIO_PAD}{Long \ButtonMenu}
43\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD% 40\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD%
44 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect} 41 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD}{\ButtonSelect}
45\opt{SANSA_FUZEPLUS_PAD}{Long \ButtonSelect} 42\opt{SANSA_FUZEPLUS_PAD}{Long \ButtonSelect}
@@ -50,7 +47,7 @@ and the meter scale can be changed.
50\opt{MPIO_HD200_PAD}{\ButtonFunc} 47\opt{MPIO_HD200_PAD}{\ButtonFunc}
51 \opt{HAVEREMOTEKEYMAP}{& } 48 \opt{HAVEREMOTEKEYMAP}{& }
52 & Settings\\ 49 & Settings\\
53\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 50\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
54 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 51 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
55 ,SAMSUNG_YH820_PAD}{\ButtonUp} 52 ,SAMSUNG_YH820_PAD}{\ButtonUp}
56\opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd} 53\opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollFwd}
@@ -59,7 +56,7 @@ and the meter scale can be changed.
59\opt{COWON_D2_PAD}{\TouchTopMiddle} 56\opt{COWON_D2_PAD}{\TouchTopMiddle}
60 \opt{HAVEREMOTEKEYMAP}{& } 57 \opt{HAVEREMOTEKEYMAP}{& }
61 & Raise Volume\\ 58 & Raise Volume\\
62\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 59\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
63 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD% 60 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SAMSUNG_YH92X_PAD%
64 ,SAMSUNG_YH820_PAD}{\ButtonDown} 61 ,SAMSUNG_YH820_PAD}{\ButtonDown}
65\opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollBack} 62\opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}{\ButtonScrollBack}
diff --git a/manual/plugins/wormlet.tex b/manual/plugins/wormlet.tex
index fd02fa8110..0205605816 100644
--- a/manual/plugins/wormlet.tex
+++ b/manual/plugins/wormlet.tex
@@ -1,11 +1,11 @@
1\subsection{Wormlet} 1\subsection{Wormlet}
2\screenshot{plugins/images/ss-wormlet}{Wormlet game}{img:wormlet} 2\screenshot{plugins/images/ss-wormlet}{Wormlet game}{img:wormlet}
3Wormlet is a \opt{RECORDER_PAD}{multi{}-user }multi{}-worm game on a multi{}-threaded 3Wormlet is a \opt{MULTIPLAYER_PAD}{multi{}-user }multi{}-worm game on a multi{}-threaded
4multi{}-functional Rockbox console. You navigate a hungry little worm. 4multi{}-functional Rockbox console. You navigate a hungry little worm.
5Help your worm to find food and to avoid poisoned argh{}-tiles. The 5Help your worm to find food and to avoid poisoned argh{}-tiles. The
6goal is to turn your tiny worm into a big worm for as long as possible. 6goal is to turn your tiny worm into a big worm for as long as possible.
7 7
8\opt{RECORDER_PAD}{ 8\opt{MULTIPLAYER_PAD}{
9For 2{}-player games a remote control is not necessary but recommended. 9For 2{}-player games a remote control is not necessary but recommended.
10If you try to hold the \dap\ in the four hands of two players 10If you try to hold the \dap\ in the four hands of two players
11you'll find out why. Games with three players are only 11you'll find out why. Games with three players are only
@@ -20,7 +20,7 @@ possible using a remote control.\\}
20{\bfseries 20{\bfseries
21Game controls:} 21Game controls:}
22 22
23\opt{RECORDER_PAD}{ 23\opt{MULTIPLAYER_PAD}{
24\renewcommand{\arraystretch}{1.8} 24\renewcommand{\arraystretch}{1.8}
25\begin{rbtabular}{\textwidth}{c X p{3cm} p{3cm} p{3cm}}% 25\begin{rbtabular}{\textwidth}{c X p{3cm} p{3cm} p{3cm}}%
26{\textbf{Players} & \textbf{Modes} & \textbf{Player 1} & \textbf{Player 2} 26{\textbf{Players} & \textbf{Modes} & \textbf{Player 1} & \textbf{Player 2}
@@ -51,7 +51,7 @@ Game controls:}
51\renewcommand{\arraystretch}{1.0} 51\renewcommand{\arraystretch}{1.0}
52} 52}
53 53
54\nopt{RECORDER_PAD}{ 54\nopt{MULTIPLAYER_PAD}{
55 \begin{btnmap} 55 \begin{btnmap}
56 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonLeft} 56 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonLeft}
57 \opt{MPIO_HD200_PAD}{\ButtonVolDown} 57 \opt{MPIO_HD200_PAD}{\ButtonVolDown}
@@ -62,7 +62,7 @@ Game controls:}
62 &} 62 &}
63 Turn left 63 Turn left
64 \\ 64 \\
65 65
66 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonRight} 66 \nopt{MPIO_HD200_PAD,MPIO_HD300_PAD,touchscreen}{\ButtonRight}
67 \opt{MPIO_HD200_PAD}{\ButtonVolUp} 67 \opt{MPIO_HD200_PAD}{\ButtonVolUp}
68 \opt{MPIO_HD300_PAD}{\ButtonFF} 68 \opt{MPIO_HD300_PAD}{\ButtonFF}
@@ -72,7 +72,7 @@ Game controls:}
72 &} 72 &}
73 Turn right 73 Turn right
74 \\ 74 \\
75 75
76 \nopt{IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,MPIO_HD200_PAD% 76 \nopt{IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,MPIO_HD200_PAD%
77 ,MPIO_HD300_PAD,touchscreen}{\ButtonUp} 77 ,MPIO_HD300_PAD,touchscreen}{\ButtonUp}
78 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonMenu} 78 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonMenu}
@@ -85,7 +85,7 @@ Game controls:}
85 &} 85 &}
86 Turn Up 86 Turn Up
87 \\ 87 \\
88 88
89 \nopt{IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,MPIO_HD200_PAD% 89 \nopt{IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,MPIO_HD200_PAD%
90 ,MPIO_HD300_PAD,touchscreen}{\ButtonDown} 90 ,MPIO_HD300_PAD,touchscreen}{\ButtonDown}
91 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonPlay} 91 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonPlay}
@@ -119,25 +119,24 @@ An ``argh'' is a black square poisoned piece {}- slightly bigger than
119food {}- that makes a worm say ``Argh!'' when 119food {}- that makes a worm say ``Argh!'' when
120run into. A worm that eats an ``argh'' is dead. Thus eating an 120run into. A worm that eats an ``argh'' is dead. Thus eating an
121``argh'' must be avoided under any circumstances. ``Arghs'' have the 121``argh'' must be avoided under any circumstances. ``Arghs'' have the
122annoying tendency to accumulate. 122annoying tendency to accumulate.
123\item[Worms.] 123\item[Worms.]
124Thou shall not eat worms. Neither other worms nor thyself. Eating worms 124Thou shall not eat worms. Neither other worms nor thyself. Eating worms
125is blasphemous cannibalism, not healthy and causes instant 125is blasphemous cannibalism, not healthy and causes instant
126death. And it doesn't help anyway: the other worm 126death. And it doesn't help anyway: the other worm
127isn't hurt by the bite. It will go on creeping happily 127isn't hurt by the bite. It will go on creeping happily
128and eat all the food you left on the table. 128and eat all the food you left on the table.
129\item[Walls.] 129\item[Walls.]
130Don't crash into the walls. Walls are not edible. 130Don't crash into the walls. Walls are not edible.
131Crashing a worm against a wall causes it a headache it 131Crashing a worm against a wall causes it a headache it
132doesn't survive. 132doesn't survive.
133\item[Game over.] 133\item[Game over.]
134The game is over when all worms are dead. The longest worm wins the 134The game is over when all worms are dead. The longest worm wins the
135game. 135game.
136\item [Pause the game.] 136\item [Pause the game.]
137Press 137Press
138\opt{RECORDER_PAD,IAUDIO_X5_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD% 138\opt{IAUDIO_X5_PAD,PBELL_VIBE500_PAD,MPIO_HD200_PAD%
139 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}% 139 ,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}%
140\opt{ONDIO_PAD}{\ButtonMenu}%
141\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD% 140\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD%
142 ,GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonSelect} 141 ,GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonSelect}
143\opt{COWON_D2_PAD}{\TouchCenter} 142\opt{COWON_D2_PAD}{\TouchCenter}
@@ -148,7 +147,7 @@ There are two ways to stop a running game.
148 147
149\begin{itemize} 148\begin{itemize}
150\item If you want to quit Wormlet entirely simply hit 149\item If you want to quit Wormlet entirely simply hit
151\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}% 150\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}%
152\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu+\ButtonSelect}% 151\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu+\ButtonSelect}%
153\opt{IAUDIO_X5_PAD,SANSA_E200_PAD,GIGABEAT_PAD}{\ButtonPower}% 152\opt{IAUDIO_X5_PAD,SANSA_E200_PAD,GIGABEAT_PAD}{\ButtonPower}%
154\opt{SANSA_FUZE_PAD}{Long \ButtonHome}% 153\opt{SANSA_FUZE_PAD}{Long \ButtonHome}%
@@ -157,10 +156,9 @@ There are two ways to stop a running game.
157\opt{MPIO_HD200_PAD}{\ButtonRec + \ButtonPlay}% 156\opt{MPIO_HD200_PAD}{\ButtonRec + \ButtonPlay}%
158\opt{MPIO_HD300_PAD}{Long \ButtonMenu}% 157\opt{MPIO_HD300_PAD}{Long \ButtonMenu}%
159\opt{GIGABEAT_S_PAD}{\ButtonBack}. 158\opt{GIGABEAT_S_PAD}{\ButtonBack}.
160The game will stop immediately and you will return to the game menu. 159The game will stop immediately and you will return to the game menu.
161\item If you want to stop the game and still see the screen hit 160\item If you want to stop the game and still see the screen hit
162\opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}% 161\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}%
163\opt{ONDIO_PAD}{\ButtonOff+\ButtonMenu}%
164\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}% 162\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}%
165\opt{IAUDIO_X5_PAD,SANSA_E200_PAD}{\ButtonRec}% 163\opt{IAUDIO_X5_PAD,SANSA_E200_PAD}{\ButtonRec}%
166\opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp}% 164\opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp}%
@@ -171,8 +169,7 @@ The game will stop immediately and you will return to the game menu.
171\opt{MPIO_HD300_PAD}{Long \ButtonPlay}% 169\opt{MPIO_HD300_PAD}{Long \ButtonPlay}%
172\opt{GIGABEAT_S_PAD}{\ButtonMenu}. 170\opt{GIGABEAT_S_PAD}{\ButtonMenu}.
173This freezes the game. If you hit 171This freezes the game. If you hit
174\opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}% 172\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}%
175\opt{ONDIO_PAD}{\ButtonOff+\ButtonMenu}%
176\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}% 173\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}%
177\opt{IAUDIO_X5_PAD,SANSA_E200_PAD}{\ButtonRec}% 174\opt{IAUDIO_X5_PAD,SANSA_E200_PAD}{\ButtonRec}%
178\opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp}% 175\opt{SANSA_FUZE_PAD}{\ButtonSelect+\ButtonUp}%
@@ -184,7 +181,7 @@ This freezes the game. If you hit
184\opt{GIGABEAT_S_PAD}{\ButtonMenu} 181\opt{GIGABEAT_S_PAD}{\ButtonMenu}
185button again a new game starts with the same configuration. To return to the 182button again a new game starts with the same configuration. To return to the
186games menu you can hit 183games menu you can hit
187\opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}% 184\opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}%
188\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu+\ButtonSelect}% 185\opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu+\ButtonSelect}%
189\opt{IAUDIO_X5_PAD,SANSA_E200_PAD,GIGABEAT_PAD}{\ButtonPower}% 186\opt{IAUDIO_X5_PAD,SANSA_E200_PAD,GIGABEAT_PAD}{\ButtonPower}%
190\opt{SANSA_FUZE_PAD}{Long \ButtonHome} 187\opt{SANSA_FUZE_PAD}{Long \ButtonHome}
@@ -192,7 +189,7 @@ games menu you can hit
192\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew}% 189\opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonRew}%
193\opt{MPIO_HD200_PAD}{\ButtonRec + \ButtonPlay}% 190\opt{MPIO_HD200_PAD}{\ButtonRec + \ButtonPlay}%
194\opt{MPIO_HD300_PAD}{Long \ButtonMenu}% 191\opt{MPIO_HD300_PAD}{Long \ButtonMenu}%
195\opt{GIGABEAT_S_PAD}{\ButtonBack}. A stopped game can not be resumed. 192\opt{GIGABEAT_S_PAD}{\ButtonBack}. A stopped game can not be resumed.
196\end{itemize} 193\end{itemize}
197\end{description} 194\end{description}
198 195
@@ -205,20 +202,20 @@ dies its entry on the score board turns black.
205\begin{description} 202\begin{description}
206\item[Len:] 203\item[Len:]
207Here the current length of the worm is displayed. When a worm is eating 204Here the current length of the worm is displayed. When a worm is eating
208food it grows by one pixel for each step it moves. 205food it grows by one pixel for each step it moves.
209 206
210\item[Hungry:] 207\item[Hungry:]
211That's the normal state of a worm. Worms are always 208That's the normal state of a worm. Worms are always
212hungry and want to eat. It is good to have a hungry 209hungry and want to eat. It is good to have a hungry
213worm since it means that your worm is alive. But it is 210worm since it means that your worm is alive. But it is
214better to get your worm growing. 211better to get your worm growing.
215 212
216\item[Growing:] 213\item[Growing:]
217When a worm has eaten a piece of food it starts growing. For each step 214When a worm has eaten a piece of food it starts growing. For each step
218it moves over food it can grow by one pixel. One piece of food lasts 215it moves over food it can grow by one pixel. One piece of food lasts
219for 7 steps. After your worm has moved 7 steps the food is used up. If 216for 7 steps. After your worm has moved 7 steps the food is used up. If
220another piece of food is eaten while growing it will increase the size 217another piece of food is eaten while growing it will increase the size
221of the worm for another 7 steps. 218of the worm for another 7 steps.
222 219
223\item[Crashed:] 220\item[Crashed:]
224This indicates that a worm has crashed against a wall. 221This indicates that a worm has crashed against a wall.
@@ -241,7 +238,7 @@ is a good way to get them out of the game.
241\item Initially you will be busy with controlling your worm. Try to 238\item Initially you will be busy with controlling your worm. Try to
242avoid other worms and crawl far away from them. Wait until they curl up 239avoid other worms and crawl far away from them. Wait until they curl up
243themselves and collect the food afterwards. Don't worry if the other 240themselves and collect the food afterwards. Don't worry if the other
244worms grow longer than yours {}- you can catch up after they've died. 241worms grow longer than yours {}- you can catch up after they've died.
245 242
246\item When you are more experienced watch the tactics of other worms. 243\item When you are more experienced watch the tactics of other worms.
247Those worms controlled by artificial stupidity head straight for the 244Those worms controlled by artificial stupidity head straight for the
@@ -251,9 +248,9 @@ between the opponent and that food. From now on you can `control' the
251other worm by blocking it. You could trap it by making a 1 pixel wide 248other worm by blocking it. You could trap it by making a 1 pixel wide
252U{}-turn. You also could move from food to food and make sure you keep 249U{}-turn. You also could move from food to food and make sure you keep
253between your opponent and the food. So you can always reach it before 250between your opponent and the food. So you can always reach it before
254your opponent. 251your opponent.
255 252
256\opt{RECORDER_PAD}{ 253\opt{MULTIPLAYER_PAD}{
257\item While playing the game the \dap\ can still play music. For 254\item While playing the game the \dap\ can still play music. For
258single player game use any music you like. For berserk games with 2 players use 255single player game use any music you like. For berserk games with 2 players use
259hard rock and for 3 player games use heavy metal or X{}-Phobie 256hard rock and for 3 player games use heavy metal or X{}-Phobie
diff --git a/manual/plugins/xobox.tex b/manual/plugins/xobox.tex
index 1be543ccdf..03c36bac81 100644
--- a/manual/plugins/xobox.tex
+++ b/manual/plugins/xobox.tex
@@ -10,12 +10,12 @@ To finish a level you have to section off more than 75\%.
10\begin{btnmap} 10\begin{btnmap}
11 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu, \ButtonPlay,} 11 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu, \ButtonPlay,}
12 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 12 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
13 ,RECORDER_PAD,ONDIO_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD% 13 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD%
14 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}% 14 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}%
15 {\ButtonUp, \ButtonDown,}% 15 {\ButtonUp, \ButtonDown,}%
16 \opt{IRIVER_H10_PAD,MPIO_HD300_PAD}{\ButtonScrollUp, \ButtonScrollDown,} 16 \opt{IRIVER_H10_PAD,MPIO_HD300_PAD}{\ButtonScrollUp, \ButtonScrollDown,}
17 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 17 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
18 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,RECORDER_PAD,ONDIO_PAD,GIGABEAT_PAD% 18 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
19 ,GIGABEAT_S_PAD,MROBE100_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD% 19 ,GIGABEAT_S_PAD,MROBE100_PAD,IRIVER_H10_PAD,SANSA_FUZE_PAD,PBELL_VIBE500_PAD%
20 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 20 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
21 {\ButtonLeft, \ButtonRight} 21 {\ButtonLeft, \ButtonRight}
@@ -24,9 +24,8 @@ To finish a level you have to section off more than 75\%.
24 \opt{HAVEREMOTEKEYMAP}{& } 24 \opt{HAVEREMOTEKEYMAP}{& }
25 & Move around the arena\\ 25 & Move around the arena\\
26 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 26 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
27 \opt{ONDIO_PAD}{\ButtonMenu}
28 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_FUZE_PAD}{\ButtonSelect} 27 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_FUZE_PAD}{\ButtonSelect}
29 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,RECORDER_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD% 28 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,GIGABEAT_S_PAD,PBELL_VIBE500_PAD%
30 ,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay} 29 ,MPIO_HD300_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay}
31 \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} 30 \opt{SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
32 \opt{SANSA_CLIP_PAD}{\ButtonHome} 31 \opt{SANSA_CLIP_PAD}{\ButtonHome}
@@ -35,7 +34,7 @@ To finish a level you have to section off more than 75\%.
35 \opt{COWON_D2_PAD}{\TouchCenter} 34 \opt{COWON_D2_PAD}{\TouchCenter}
36 \opt{HAVEREMOTEKEYMAP}{& } 35 \opt{HAVEREMOTEKEYMAP}{& }
37 & Pause\\ 36 & Pause\\
38 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,RECORDER_PAD,ONDIO_PAD}{\ButtonOff} 37 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
39 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonMenu} 38 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect{} + \ButtonMenu}
40 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD% 39 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD%
41 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower} 40 ,GIGABEAT_PAD,MROBE100_PAD,COWON_D2_PAD,SANSA_FUZEPLUS_PAD}{\ButtonPower}
diff --git a/manual/plugins/xworld.tex b/manual/plugins/xworld.tex
index 57d42bde0f..07c7d8d670 100644
--- a/manual/plugins/xworld.tex
+++ b/manual/plugins/xworld.tex
@@ -10,7 +10,7 @@ Additionally, ``extra'' data files that modify the in-game strings and font can
10 10
11\begin{btnmap} 11\begin{btnmap}
12 % 12 %
13 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 13 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
14 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 14 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
15 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 15 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
16 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 16 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -22,7 +22,7 @@ Additionally, ``extra'' data files that modify the in-game strings and font can
22 \opt{HAVEREMOTEKEYMAP}{& } 22 \opt{HAVEREMOTEKEYMAP}{& }
23 & Up and Jump \\ 23 & Up and Jump \\
24 % 24 %
25 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 25 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
26 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 26 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
27 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 27 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
28 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD} 28 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}
@@ -34,7 +34,7 @@ Additionally, ``extra'' data files that modify the in-game strings and font can
34 \opt{HAVEREMOTEKEYMAP}{& } 34 \opt{HAVEREMOTEKEYMAP}{& }
35 & Down and Crouch\\ 35 & Down and Crouch\\
36 % 36 %
37 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD% 37 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD%
38 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD% 38 ,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,GIGABEAT_PAD%
39 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 39 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
40 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD% 40 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD%
diff --git a/manual/plugins/zxbox.tex b/manual/plugins/zxbox.tex
index 55f75eb963..8044b0d77e 100644
--- a/manual/plugins/zxbox.tex
+++ b/manual/plugins/zxbox.tex
@@ -14,12 +14,12 @@ including an additional but fixed menu button, are assigned as follows:
14 14
15\begin{btnmap} 15\begin{btnmap}
16 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonMenu/\ButtonPlay/} 16 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonMenu/\ButtonPlay/}
17 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 17 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
18 ,IAUDIO_X5_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,MROBE100_PAD% 18 ,IAUDIO_X5_PAD,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,MROBE100_PAD%
19 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}% 19 ,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}%
20 {\ButtonUp/\ButtonDown/} 20 {\ButtonUp/\ButtonDown/}
21 \opt{IRIVER_H10_PAD}{\ButtonScrollUp/\ButtonScrollDown/} 21 \opt{IRIVER_H10_PAD}{\ButtonScrollUp/\ButtonScrollDown/}
22 \opt{IPOD_3G_PAD,IPOD_4G_PAD,RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD% 22 \opt{IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H100_PAD%
23 ,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,IAUDIO_X5_PAD% 23 ,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,IAUDIO_X5_PAD%
24 ,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,MROBE100_PAD% 24 ,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,MROBE100_PAD%
25 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD% 25 ,IRIVER_H10_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD%
@@ -33,10 +33,8 @@ including an additional but fixed menu button, are assigned as follows:
33 \opt{IPOD_3G_PAD,IPOD_4G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,IAUDIO_X5_PAD% 33 \opt{IPOD_3G_PAD,IPOD_4G_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,IAUDIO_X5_PAD%
34 ,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,MROBE100_PAD 34 ,SANSA_C200_PAD,SANSA_CLIP_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,MROBE100_PAD
35 ,SANSA_FUZEPLUS_PAD}{\ButtonSelect} 35 ,SANSA_FUZEPLUS_PAD}{\ButtonSelect}
36 \opt{RECORDER_PAD}{\ButtonPlay}
37 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay{} or \ButtonFF} 36 \opt{SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{\ButtonPlay{} or \ButtonFF}
38 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn} 37 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOn}
39 \opt{ONDIO_PAD}{\ButtonMenu}
40 \opt{IRIVER_H10_PAD}{\ButtonRew} 38 \opt{IRIVER_H10_PAD}{\ButtonRew}
41 \opt{COWON_D2_PAD}{\TouchCenter} 39 \opt{COWON_D2_PAD}{\TouchCenter}
42 \opt{PBELL_VIBE500_PAD}{\ButtonOK} 40 \opt{PBELL_VIBE500_PAD}{\ButtonOK}
@@ -45,8 +43,6 @@ including an additional but fixed menu button, are assigned as follows:
45 \opt{HAVEREMOTEKEYMAP}{& } 43 \opt{HAVEREMOTEKEYMAP}{& }
46 & Jump/Fire\\ 44 & Jump/Fire\\
47 % 45 %
48 \opt{RECORDER_PAD}{\ButtonFOne}
49 \opt{ONDIO_PAD}{\ButtonOff}
50 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonHold{} switch} 46 \opt{IPOD_3G_PAD,IPOD_4G_PAD}{\ButtonHold{} switch}
51 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 47 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
52 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,COWON_D2_PAD}{\ButtonMenu} 48 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,COWON_D2_PAD}{\ButtonMenu}
diff --git a/manual/rockbox_interface/browsing_and_playing.tex b/manual/rockbox_interface/browsing_and_playing.tex
index 9bb8fe9b77..0f382fabf8 100644
--- a/manual/rockbox_interface/browsing_and_playing.tex
+++ b/manual/rockbox_interface/browsing_and_playing.tex
@@ -24,17 +24,6 @@ that are not available within the \setting{Database Browser}. Read more about
24\setting{Database} in \reference{ref:database}. The remainder of this section 24\setting{Database} in \reference{ref:database}. The remainder of this section
25deals with the \setting{File Browser}.} 25deals with the \setting{File Browser}.}
26 26
27\opt{ondio}{
28Unlike the Archos Firmware, Rockbox provides multivolume support for the
29MultiMediaCard, this means the \dap{} can access both data volumes (internal
30memory and the MMC), thus being able to for instance, build playlists with
31files from both volumes.
32In the \setting{File Browser} a new directory will appear as soon as the device
33has read the content after inserting the card. This new directory's name is
34generated as \fname{<MMC1>}, and will behave exactly as any other directory
35on the \dap{}.
36}
37
38\opt{iriverh10,iriverh10_5gb}{\note{ 27\opt{iriverh10,iriverh10_5gb}{\note{
39If your \dap{} is a MTP model, the Music directory where all your music is stored 28If your \dap{} is a MTP model, the Music directory where all your music is stored
40may be hidden in the \setting{File Browser}. This may be fixed by either 29may be hidden in the \setting{File Browser}. This may be fixed by either
@@ -49,7 +38,7 @@ the \setting{Show Files} setting to all.
49 & Go to previous/next item in list. If you are on the first/last 38 & Go to previous/next item in list. If you are on the first/last
50 entry, the cursor will wrap to the last/first entry.\\ 39 entry, the cursor will wrap to the last/first entry.\\
51 % 40 %
52 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,RECORDER_PAD} 41 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}
53 { 42 {
54 \ButtonOn+\ButtonUp{}/ \ButtonDown 43 \ButtonOn+\ButtonUp{}/ \ButtonDown
55 \opt{HAVEREMOTEKEYMAP}{& 44 \opt{HAVEREMOTEKEYMAP}{&
@@ -98,10 +87,6 @@ the \setting{Show Files} setting to all.
98 & Switch to the \setting{Quick Screen} 87 & Switch to the \setting{Quick Screen}
99 (see \reference{ref:QuickScreen}). \\ 88 (see \reference{ref:QuickScreen}). \\
100 } 89 }
101 \opt{RECORDER_PAD}{
102 \ButtonFThree & Switch to the \setting{Quick Screen}.\\
103 %
104 }
105 % 90 %
106 \opt{SANSA_E200_PAD}{ 91 \opt{SANSA_E200_PAD}{
107 \ActionStdRec & Switch to the \setting{Recording Screen}.\\ 92 \ActionStdRec & Switch to the \setting{Recording Screen}.\\
@@ -118,11 +103,6 @@ the \setting{Show Files} setting to all.
118 }} 103 }}
119\end{btnmap} 104\end{btnmap}
120 105
121\opt{RECORDER_PAD}{
122 The functions of the F keys are also summarised on the button bar at the
123 bottom of the screen.
124}
125
126\subsection{\label{ref:Contextmenu}\label{ref:PartIISectionFM}Context Menu} 106\subsection{\label{ref:Contextmenu}\label{ref:PartIISectionFM}Context Menu}
127\screenshot{rockbox_interface/images/ss-context-menu}{The Context Menu}{} 107\screenshot{rockbox_interface/images/ss-context-menu}{The Context Menu}{}
128 108
@@ -206,9 +186,9 @@ each option pertains both to files and directories):
206\screenshot{rockbox_interface/images/ss-virtual-keyboard}{The virtual keyboard}{} 186\screenshot{rockbox_interface/images/ss-virtual-keyboard}{The virtual keyboard}{}
207This is the virtual keyboard that is used when entering text in Rockbox, for 187This is the virtual keyboard that is used when entering text in Rockbox, for
208example when renaming a file or creating a new directory. 188example when renaming a file or creating a new directory.
209\nopt{player}{The virtual keyboard can be easily changed by making a text file 189The virtual keyboard can be easily changed by making a text file
210 with the required layout. More information on how to achieve this can be found 190with the required layout. More information on how to achieve this can be found
211 on the Rockbox website at \wikilink{LoadableKeyboardLayouts}.} 191on the Rockbox website at \wikilink{LoadableKeyboardLayouts}.
212 192
213\opt{morse_input}{ 193\opt{morse_input}{
214 Also you can switch to Morse code input mode by changing the 194 Also you can switch to Morse code input mode by changing the
@@ -219,12 +199,12 @@ example when renaming a file or creating a new directory.
219 { or by pressing \ActionKbdMorseInput{} in the virtual keyboard}% 199 { or by pressing \ActionKbdMorseInput{} in the virtual keyboard}%
220 .} 200 .}
221 201
222\nopt{player}{% no "Actions" yet in the Player's virtual keyboard 202% no "Actions" yet in the Player's virtual keyboard
223 203
224\note{When the cursor is on the input line, \ActionKbdSelect{} deletes the preceding character} 204\note{When the cursor is on the input line, \ActionKbdSelect{} deletes the preceding character}
225 205
226\begin{btnmap} 206\begin{btnmap}
227 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,RECORDER_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD% 207 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD%
228 ,MROBE100_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_FUZEPLUS_PAD% 208 ,MROBE100_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_C200_PAD,SANSA_FUZEPLUS_PAD%
229 ,SAMSUNG_YH820_PAD}{ 209 ,SAMSUNG_YH820_PAD}{
230 \ActionKbdCursorLeft{} / \ActionKbdCursorRight 210 \ActionKbdCursorLeft{} / \ActionKbdCursorRight
@@ -258,7 +238,7 @@ example when renaming a file or creating a new directory.
258 If you move out of the picker area you get to the line edit mode. 238 If you move out of the picker area you get to the line edit mode.
259 \\ 239 \\
260 % 240 %
261 \nopt{IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,ONDIO_PAD,PBELL_VIBE500_PAD% 241 \nopt{IPOD_3G_PAD,IPOD_4G_PAD,IRIVER_H10_PAD,PBELL_VIBE500_PAD%
262 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{ 242 ,SANSA_FUZEPLUS_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}{
263 \ActionKbdPageFlip 243 \ActionKbdPageFlip
264 & 244 &
@@ -302,23 +282,6 @@ example when renaming a file or creating a new directory.
302 & Tap to select a character in Morse code input mode. \\ 282 & Tap to select a character in Morse code input mode. \\
303 } 283 }
304\end{btnmap} 284\end{btnmap}
305}% end of non-Player section
306
307\opt{player}{
308 The current text line to be entered or edited is always listed on the first
309 line of the display. The second line of the display can contain the character
310 selection bar, as in the screenshot above.
311 \begin{btnmap}
312 \ButtonOn & Toggle picker- and line edit mode. \\
313 \ButtonLeft{} / \ButtonRight
314 & Move back and forth in the selected line (picker of input line). \\
315 \ButtonPlay
316 & Pick character in character bar, or act as backspace in the text line. \\
317 Long \ButtonPlay & Accept \\
318 \ButtonStop & Cancel \\
319 \ButtonMenu & Flip picker lines. \\
320 \end{btnmap}
321}
322 285
323\input{rockbox_interface/tagcache.tex} 286\input{rockbox_interface/tagcache.tex}
324\input{rockbox_interface/wps.tex} 287\input{rockbox_interface/wps.tex}
diff --git a/manual/rockbox_interface/main.tex b/manual/rockbox_interface/main.tex
index f11246f162..f1935b36f3 100644
--- a/manual/rockbox_interface/main.tex
+++ b/manual/rockbox_interface/main.tex
@@ -43,9 +43,9 @@ The areas of the touchscreen in the 3$\times$3 grid mode are in turn referred as
43 \begin{tabular}{|c|c|c|} 43 \begin{tabular}{|c|c|c|}
44 \hline 44 \hline
45 \TouchTopLeft & \TouchTopMiddle & \TouchTopRight \\ [5ex] 45 \TouchTopLeft & \TouchTopMiddle & \TouchTopRight \\ [5ex]
46 \hline 46 \hline
47 \TouchMidLeft & \TouchCenter & \TouchMidRight \\ [5ex] 47 \TouchMidLeft & \TouchCenter & \TouchMidRight \\ [5ex]
48 \hline 48 \hline
49 \TouchBottomLeft & \TouchBottomMiddle & \TouchBottomRight \\ [5ex] 49 \TouchBottomLeft & \TouchBottomMiddle & \TouchBottomRight \\ [5ex]
50 \hline 50 \hline
51 \end{tabular} 51 \end{tabular}
@@ -55,22 +55,22 @@ Whenever a button name is prefixed by ``Long'', a long press of approximately
55one second should be performed on that button. The buttons are described in 55one second should be performed on that button. The buttons are described in
56detail in the following paragraph. 56detail in the following paragraph.
57\blind{% 57\blind{%
58 Additional information for blind users is available on the Rockbox website at 58 Additional information for blind users is available on the Rockbox website at
59 \wikilink{BlindFAQ}. 59 \wikilink{BlindFAQ}.
60 60
61 % 61 %
62 \opt{iriverh100}{ 62 \opt{iriverh100}{
63 Hold or lay the \dap{} so that the side with the joystick and LCD is facing 63 Hold or lay the \dap{} so that the side with the joystick and LCD is facing
64 towards you, and the curved side is at the top. The joystick functions as 64 towards you, and the curved side is at the top. The joystick functions as
65 the \ButtonUp{}, \ButtonRight{}, \ButtonLeft{}, and \ButtonDown{} buttons when 65 the \ButtonUp{}, \ButtonRight{}, \ButtonLeft{}, and \ButtonDown{} buttons when
66 pressed in the appropriate direction. Pressing the joystick down functions as 66 pressed in the appropriate direction. Pressing the joystick down functions as
67 \ButtonSelect{}. 67 \ButtonSelect{}.
68 On the right side of the \dap{} are the \ButtonOn{}, \ButtonOff{}, 68 On the right side of the \dap{} are the \ButtonOn{}, \ButtonOff{},
69 \ButtonMode{} buttons, and the \ButtonHold{} switch. When this switch is 69 \ButtonMode{} buttons, and the \ButtonHold{} switch. When this switch is
70 switched towards the bottom of the \dap{}, hold is on, and none of the other 70 switched towards the bottom of the \dap{}, hold is on, and none of the other
71 buttons have any effect. 71 buttons have any effect.
72 72
73 On the left side is the \ButtonRec{} button. Above that is the internal microphone. 73 On the left side is the \ButtonRec{} button. Above that is the internal microphone.
74 74
75 On the top panel of the \dap{}, from left to right, you can find the 75 On the top panel of the \dap{}, from left to right, you can find the
76 following: headphone mini jack plug, remote port, Optical line-in, Optical line-out. 76 following: headphone mini jack plug, remote port, Optical line-in, Optical line-out.
@@ -79,16 +79,16 @@ detail in the following paragraph.
79 following: power jack, reset switch, and USB port. In the event that your 79 following: power jack, reset switch, and USB port. In the event that your
80 \dap{} hard locks, you can reset it by inserting a paper clip into the hole 80 \dap{} hard locks, you can reset it by inserting a paper clip into the hole
81 where the reset switch is.} 81 where the reset switch is.}
82 % 82 %
83 \opt{iriverh300}{ 83 \opt{iriverh300}{
84 Hold or lay the \dap{} so that the side with the button pad and 84 Hold or lay the \dap{} so that the side with the button pad and
85 LCD is facing towards you. The buttons on the button pad are as follows: top 85 LCD is facing towards you. The buttons on the button pad are as follows: top
86 left corner: \ButtonOn{}, bottom left corner: \ButtonOff{}, top right corner: 86 left corner: \ButtonOn{}, bottom left corner: \ButtonOff{}, top right corner:
87 \ButtonRec, bottom right corner: \ButtonMode{}. In the center of the button pad 87 \ButtonRec, bottom right corner: \ButtonMode{}. In the center of the button pad
88 is a button labelled \ButtonSelect{}. Surrounding the \ButtonSelect{} button are 88 is a button labelled \ButtonSelect{}. Surrounding the \ButtonSelect{} button are
89 the \ButtonUp{}, \ButtonDown{}, \ButtonLeft{}, and \ButtonRight{} buttons. 89 the \ButtonUp{}, \ButtonDown{}, \ButtonLeft{}, and \ButtonRight{} buttons.
90 90
91 On the top panel of the \dap{}, from left to right, you can find the 91 On the top panel of the \dap{}, from left to right, you can find the
92 following: headphone mini jack plug, remote port, line-in, line-out. 92 following: headphone mini jack plug, remote port, line-in, line-out.
93 93
94 On the left hand side of the \dap{} is the internal microphone. Just underneath 94 On the left hand side of the \dap{} is the internal microphone. Just underneath
@@ -96,51 +96,51 @@ detail in the following paragraph.
96 you can reset it by inserting a paper clip into the hole where the reset switch 96 you can reset it by inserting a paper clip into the hole where the reset switch
97 is. 97 is.
98 98
99 On the right hand side of the \dap{} is the \ButtonHold{} switch. When this is 99 On the right hand side of the \dap{} is the \ButtonHold{} switch. When this is
100 switched towards the bottom of the \dap{}, hold is on, and none of the other 100 switched towards the bottom of the \dap{}, hold is on, and none of the other
101 buttons have any effect. 101 buttons have any effect.
102 102
103 On the bottom panel of the \dap{}, from left to right, you can find the 103 On the bottom panel of the \dap{}, from left to right, you can find the
104 following: power jack and two USB ports. The USB port on the right is used 104 following: power jack and two USB ports. The USB port on the right is used
105 to connect your \dap{} to your computer. The USB port on the left is not 105 to connect your \dap{} to your computer. The USB port on the left is not
106 used in Rockbox. 106 used in Rockbox.
107 } 107 }
108 % 108 %
109 \opt{mpiohd200}{ 109 \opt{mpiohd200}{
110 Hold or lay the \dap{} so that the side with the LCD is facing towards you. 110 Hold or lay the \dap{} so that the side with the LCD is facing towards you.
111 On the right hand side there is a rocker switch at the top which serves as 111 On the right hand side there is a rocker switch at the top which serves as
112 \ButtonRew{} and \ButtonFF{} when rocked up or down, respectively. 112 \ButtonRew{} and \ButtonFF{} when rocked up or down, respectively.
113 Pressing the rocker in functions as the \ButtonFunc{} button. Below the rocker 113 Pressing the rocker in functions as the \ButtonFunc{} button. Below the rocker
114 there are the \ButtonRec{} and \ButtonPlay{} buttons. At the bottom of the 114 there are the \ButtonRec{} and \ButtonPlay{} buttons. At the bottom of the
115 right panel there is the \ButtonHold{} switch. When this is switched towards the 115 right panel there is the \ButtonHold{} switch. When this is switched towards the
116 bottom of the \dap{}. hold is on, and none of the other buttons have any effect. 116 bottom of the \dap{}. hold is on, and none of the other buttons have any effect.
117 117
118 On the top panel of the \dap{} there is another rocker which serves as the 118 On the top panel of the \dap{} there is another rocker which serves as the
119 \ButtonVolDown{} and \ButtonVolUp{} buttons when pressed to the left or right, 119 \ButtonVolDown{} and \ButtonVolUp{} buttons when pressed to the left or right,
120 respectively. 120 respectively.
121 121
122 On the left hand side of the \dap{} there is a headphone mini jack plug at the top 122 On the left hand side of the \dap{} there is a headphone mini jack plug at the top
123 and a small hole at the bottom, the reset switch. In the event that your \dap{} 123 and a small hole at the bottom, the reset switch. In the event that your \dap{}
124 hard locks, you can reset it by inserting a paper clip into the hole where the 124 hard locks, you can reset it by inserting a paper clip into the hole where the
125 reset switch is. 125 reset switch is.
126 126
127 On the bottom panel of the \dap{}, from left to right, you can find the 127 On the bottom panel of the \dap{}, from left to right, you can find the
128 following: power jack, line-in jack and USB port (under rubber cover). 128 following: power jack, line-in jack and USB port (under rubber cover).
129 } 129 }
130 % 130 %
131 \opt{ipod4g,ipodcolor,ipodvideo,ipodmini}{ 131 \opt{ipod4g,ipodcolor,ipodvideo,ipodmini}{
132 The main controls on the \dap{} are a slightly indented scroll wheel 132 The main controls on the \dap{} are a slightly indented scroll wheel
133 with a flat round button in the center. Hold the \dap{} with these controls 133 with a flat round button in the center. Hold the \dap{} with these controls
134 facing you. 134 facing you.
135 135
136 The top of the player will have the following, from left to 136 The top of the player will have the following, from left to
137 right: 137 right:
138 \opt{ipod4g,ipodcolor}{remote connector, headphone socket, \ButtonHold{} 138 \opt{ipod4g,ipodcolor}{remote connector, headphone socket, \ButtonHold{}
139 switch.} 139 switch.}
140 \opt{ipodvideo}{\ButtonHold{} switch, headphone socket.} 140 \opt{ipodvideo}{\ButtonHold{} switch, headphone socket.}
141 \opt{ipodmini}{\ButtonHold{} switch, remote connector, headphone socket.} 141 \opt{ipodmini}{\ButtonHold{} switch, remote connector, headphone socket.}
142 142
143 The dock connector that is used to connect your \dap{} to your computer is on 143 The dock connector that is used to connect your \dap{} to your computer is on
144 the bottom panel of the \dap{}. 144 the bottom panel of the \dap{}.
145 145
146 The button in the middle of the wheel is called \ButtonSelect{}. You can 146 The button in the middle of the wheel is called \ButtonSelect{}. You can
@@ -151,22 +151,22 @@ detail in the following paragraph.
151 clockwise around the wheel. \ButtonScrollBack{} means to slide your finger 151 clockwise around the wheel. \ButtonScrollBack{} means to slide your finger
152 counterclockwise. Note that the wheel is sensitive, so you will need to move 152 counterclockwise. Note that the wheel is sensitive, so you will need to move
153 slowly at first and get a feel for how it works. 153 slowly at first and get a feel for how it works.
154 154
155 Note that when the \ButtonHold{} switch is pushed toward the center of the \dap{}, 155 Note that when the \ButtonHold{} switch is pushed toward the center of the \dap{},
156 hold is on, and none of the other controls do anything. Be sure 156 hold is on, and none of the other controls do anything. Be sure
157 \ButtonHold{} is off before trying to use your player. 157 \ButtonHold{} is off before trying to use your player.
158 } 158 }
159 % 159 %
160 \opt{ipod3g}{ 160 \opt{ipod3g}{
161 The main controls on the \dap{} are a slightly indented touch wheel 161 The main controls on the \dap{} are a slightly indented touch wheel
162 with a flat round button in the center, and four buttons in a row above the 162 with a flat round button in the center, and four buttons in a row above the
163 touch wheel. Hold the \dap{} with these controls 163 touch wheel. Hold the \dap{} with these controls
164 facing you. 164 facing you.
165 165
166 The top of the player will have the following, from left to 166 The top of the player will have the following, from left to
167 right: remote connector, headphone socket, \ButtonHold{} switch. 167 right: remote connector, headphone socket, \ButtonHold{} switch.
168 168
169 The dock connector that is used to connect your \dap{} to your computer is on 169 The dock connector that is used to connect your \dap{} to your computer is on
170 the bottom panel of the \dap{}. 170 the bottom panel of the \dap{}.
171 171
172 The button in the middle of the wheel is called \ButtonSelect{}. You can 172 The button in the middle of the wheel is called \ButtonSelect{}. You can
@@ -177,25 +177,25 @@ detail in the following paragraph.
177 clockwise around the wheel. \ButtonScrollBack{} means to slide your finger 177 clockwise around the wheel. \ButtonScrollBack{} means to slide your finger
178 counterclockwise. Note that the wheel is sensitive, so you will need to move 178 counterclockwise. Note that the wheel is sensitive, so you will need to move
179 slowly at first and get a feel for how it works. 179 slowly at first and get a feel for how it works.
180 180
181 Note that when the \ButtonHold{} switch is pushed toward the center of the \dap{}, 181 Note that when the \ButtonHold{} switch is pushed toward the center of the \dap{},
182 hold is on, and none of the other controls do anything. Be sure 182 hold is on, and none of the other controls do anything. Be sure
183 \ButtonHold{} is off before trying to use your player. 183 \ButtonHold{} is off before trying to use your player.
184 } 184 }
185 % 185 %
186 \opt{ipod1g2g}{ 186 \opt{ipod1g2g}{
187 The main controls on the \dap{} are a slightly indented wheel 187 The main controls on the \dap{} are a slightly indented wheel
188 with a flat round button in the center, and four buttons surrounding 188 with a flat round button in the center, and four buttons surrounding
189 it. On the 1st generation iPod, this wheel physically turns. On the 189 it. On the 1st generation iPod, this wheel physically turns. On the
190 2nd generation iPod, this wheel is touch-sensitive. Hold the \dap{} with these controls 190 2nd generation iPod, this wheel is touch-sensitive. Hold the \dap{} with these controls
191 facing you. 191 facing you.
192 192
193 The top of the player will have the following, from left to 193 The top of the player will have the following, from left to
194 right: FireWire port, headphone socket, \ButtonHold{} switch. 194 right: FireWire port, headphone socket, \ButtonHold{} switch.
195 195
196 The FireWire port is used to connect your \dap{} to the computer and 196 The FireWire port is used to connect your \dap{} to the computer and
197 to charge its battery via a wall charger. 197 to charge its battery via a wall charger.
198 198
199 The button in the middle of the wheel is called \ButtonSelect{}. You can 199 The button in the middle of the wheel is called \ButtonSelect{}. You can
200 operate the wheel by turning it, or sliding your finger around 200 operate the wheel by turning it, or sliding your finger around
201 it. The top is \ButtonMenu{}, the bottom is \ButtonPlay{}, the left 201 it. The top is \ButtonMenu{}, the bottom is \ButtonPlay{}, the left
@@ -204,10 +204,10 @@ detail in the following paragraph.
204 clockwise around the wheel. \ButtonScrollBack{} means to slide your finger 204 clockwise around the wheel. \ButtonScrollBack{} means to slide your finger
205 counterclockwise. Note that the wheel is sensitive, so you will need to move 205 counterclockwise. Note that the wheel is sensitive, so you will need to move
206 slowly at first and get a feel for how it works. 206 slowly at first and get a feel for how it works.
207 207
208 Note that when the \ButtonHold{} switch is pushed toward the center of the \dap{}, 208 Note that when the \ButtonHold{} switch is pushed toward the center of the \dap{},
209 hold is on, and none of the other controls do anything. Be sure 209 hold is on, and none of the other controls do anything. Be sure
210 \ButtonHold{} is off before trying to use your player. 210 \ButtonHold{} is off before trying to use your player.
211 } 211 }
212 % 212 %
213 \opt{ipodnano,ipodnano2g}{ 213 \opt{ipodnano,ipodnano2g}{
@@ -231,39 +231,22 @@ detail in the following paragraph.
231 off before trying to use your player. 231 off before trying to use your player.
232 } 232 }
233 % 233 %
234 \opt{ondio}{
235 The main characteristic of the Ondio case is the indent on its lower right side,
236 which is the MMC slot. Holding the \dap{} with this slot in the described position
237 you'll find the following:
238
239 On the curved top, from left to right, are the headphone socket,
240 the \ButtonOff{} button,%
241 \opt{recording}{ and the line-in jack}.
242 Apart from the already mentioned MMC slot, you will find the USB connector on
243 the \daps{} right side. Below the LCD, at approximately the center of the \dap{},
244 there is the main button pad of the \dap{}. The centre of the button pad dips inward
245 and helps to operate the directional keys from there. Located on a two-way button
246 strip are the \ButtonLeft{} and \ButtonRight{} keys, with \ButtonUp{} above it
247 and \ButtonDown{} below it. The raised button positioned in the lower left of this
248 round crosspad is labelled \ButtonMenu{}.
249 }
250 %
251 \opt{iriverh10,iriverh10_5gb}{ 234 \opt{iriverh10,iriverh10_5gb}{
252 Hold or lay the \dap{} so that the side with the scroll pad and 235 Hold or lay the \dap{} so that the side with the scroll pad and
253 LCD is facing towards you. In the centre below the lcd is the scroll pad. It 236 LCD is facing towards you. In the centre below the lcd is the scroll pad. It
254 is oriented vertically. Touching the top and bottom half of it acts as the 237 is oriented vertically. Touching the top and bottom half of it acts as the
255 \ButtonScrollUp{} and \ButtonScrollDown{} buttons respectively. On the left 238 \ButtonScrollUp{} and \ButtonScrollDown{} buttons respectively. On the left
256 of the scroll pad is the \ButtonLeft{} button and on the right is the 239 of the scroll pad is the \ButtonLeft{} button and on the right is the
257 \ButtonRight{} button. 240 \ButtonRight{} button.
258 241
259 There are three buttons on the right hand side of the \dap{}. From top to 242 There are three buttons on the right hand side of the \dap{}. From top to
260 bottom, they are: \ButtonRew{}, \ButtonPlay{} and \ButtonFF{}. On the left 243 bottom, they are: \ButtonRew{}, \ButtonPlay{} and \ButtonFF{}. On the left
261 hand side is the \ButtonPower{} button. 244 hand side is the \ButtonPower{} button.
262 245
263 On the top panel of the \dap{}, from left to right, you can find the 246 On the top panel of the \dap{}, from left to right, you can find the
264 following: \ButtonHold{} switch, \opt{iriverh10}{reset pin hole, }remote port 247 following: \ButtonHold{} switch, \opt{iriverh10}{reset pin hole, }remote port
265 and headphone mini jack plug. 248 and headphone mini jack plug.
266 249
267 On the bottom panel of the \dap{} is the data cable port.} 250 On the bottom panel of the \dap{} is the data cable port.}
268 % 251 %
269 \opt{gigabeatf}{ 252 \opt{gigabeatf}{
@@ -271,27 +254,27 @@ detail in the following paragraph.
271 Gigabeat X. The Gigabeat F is slightly larger and more rectangular shaped, while the 254 Gigabeat X. The Gigabeat F is slightly larger and more rectangular shaped, while the
272 Gigabeat X is smaller and has a slightly tapered back.} 255 Gigabeat X is smaller and has a slightly tapered back.}
273 256
274 Hold the \dap{} with the screen on top and the controls on the right hand side. 257 Hold the \dap{} with the screen on top and the controls on the right hand side.
275 Below the screen is a cross-shaped touch sensitive pad which contains the 258 Below the screen is a cross-shaped touch sensitive pad which contains the
276 \ButtonUp{}, \ButtonDown{}, \ButtonLeft{} and \ButtonRight{} controls. On the 259 \ButtonUp{}, \ButtonDown{}, \ButtonLeft{} and \ButtonRight{} controls. On the
277 Gigabeat X, this pad will feel slightly raised up, while it will feel slightly 260 Gigabeat X, this pad will feel slightly raised up, while it will feel slightly
278 sunken in on the Gigabeat F. On the top of the unit, from left to right, are the 261 sunken in on the Gigabeat F. On the top of the unit, from left to right, are the
279 power socket, the \ButtonHold{} switch, and the headphone socket. The 262 power socket, the \ButtonHold{} switch, and the headphone socket. The
280 \ButtonHold{} switch puts the \dap{} into hold mode when it is switched to the 263 \ButtonHold{} switch puts the \dap{} into hold mode when it is switched to the
281 right of the unit. The buttons will have no effect when this is the case. 264 right of the unit. The buttons will have no effect when this is the case.
282 265
283 Starting from the left hand side on the bottom of the unit, nearer to the front 266 Starting from the left hand side on the bottom of the unit, nearer to the front
284 than the back, is a recessed switch which 267 than the back, is a recessed switch which
285 controls whether the battery is on or off. When this switch is to the left, 268 controls whether the battery is on or off. When this switch is to the left,
286 the battery is disconnected. This can be used for a hard reset of the unit, 269 the battery is disconnected. This can be used for a hard reset of the unit,
287 or if the \dap{} is being placed in storage. Next to that is a connector for 270 or if the \dap{} is being placed in storage. Next to that is a connector for
288 the docking station and finally on the right hand side of the bottom of the 271 the docking station and finally on the right hand side of the bottom of the
289 unit is a mini USB socket for connecting directly to USB. 272 unit is a mini USB socket for connecting directly to USB.
290 273
291 Finally on the right hand side of the unit are some control buttons. Going from 274 Finally on the right hand side of the unit are some control buttons. Going from
292 the bottom of the unit to the top there is a small round \ButtonA{} buttton then a 275 the bottom of the unit to the top there is a small round \ButtonA{} buttton then a
293 rocker volume switch with of the \ButtonVolDown{} button below the \ButtonVolUp{} 276 rocker volume switch with of the \ButtonVolDown{} button below the \ButtonVolUp{}
294 button. Above that is are two more small round buttons, the \ButtonMenu{} 277 button. Above that is are two more small round buttons, the \ButtonMenu{}
295 button and nearest to the top of the unit the \ButtonPower{} button, which is held 278 button and nearest to the top of the unit the \ButtonPower{} button, which is held
296 down to turn the \dap{} on or off. If you have a Gigabeat X, these buttons are small 279 down to turn the \dap{} on or off. If you have a Gigabeat X, these buttons are small
297 metallic buttons that are place further up on the right hand side, and closer 280 metallic buttons that are place further up on the right hand side, and closer
@@ -312,12 +295,12 @@ detail in the following paragraph.
312 than the front, is a recessed switch which controls whether the battery is on 295 than the front, is a recessed switch which controls whether the battery is on
313 or off. When this switch is to the left, the battery is disconnected. 296 or off. When this switch is to the left, the battery is disconnected.
314 This can be used for a hard reset of the unit, or if the \dap{} is being placed 297 This can be used for a hard reset of the unit, or if the \dap{} is being placed
315 in storage. Next to that is a mini USB socket for connecting directly to USB, 298 in storage. Next to that is a mini USB socket for connecting directly to USB,
316 and finally a custom connector, presumably for planned accessories which were 299 and finally a custom connector, presumably for planned accessories which were
317 never released. 300 never released.
318 301
319 Finally on the right hand side of the unit are some control buttons and the power 302 Finally on the right hand side of the unit are some control buttons and the power
320 connector. Going from the bottom of the unit to the top, there is the power 303 connector. Going from the bottom of the unit to the top, there is the power
321 connector socket, followed by three small round buttons, the 304 connector socket, followed by three small round buttons, the
322 \ButtonNext{} buttton, \ButtonPlay{} button, and \ButtonPrev{} button (from bottom 305 \ButtonNext{} buttton, \ButtonPlay{} button, and \ButtonPrev{} button (from bottom
323 to top) then a rocker volume switch with of the \ButtonVolDown{} button below the 306 to top) then a rocker volume switch with of the \ButtonVolDown{} button below the
@@ -325,58 +308,58 @@ detail in the following paragraph.
325 button, which is held down to turn the \dap{} on or off.} 308 button, which is held down to turn the \dap{} on or off.}
326 % 309 %
327 \opt{mrobe100}{ 310 \opt{mrobe100}{
328 Hold the \dap{} with the black front facing you such that the m:robe writing 311 Hold the \dap{} with the black front facing you such that the m:robe writing
329 is readable. Below the writing is the touch sensitive pad with the 312 is readable. Below the writing is the touch sensitive pad with the
330 \ButtonMenu{}, \ButtonPlay{}, \ButtonLeft{}, \ButtonRight{} and \ButtonDisplay 313 \ButtonMenu{}, \ButtonPlay{}, \ButtonLeft{}, \ButtonRight{} and \ButtonDisplay
331 controls indicated by their symbols. The dotted center strip is devided in 314 controls indicated by their symbols. The dotted center strip is devided in
332 three parts: \ButtonUp{}, \ButtonSelect{} and \ButtonDown. On the top of the 315 three parts: \ButtonUp{}, \ButtonSelect{} and \ButtonDown. On the top of the
333 unit, on the right, is the \ButtonPower{} switch, which is held down to turn 316 unit, on the right, is the \ButtonPower{} switch, which is held down to turn
334 the \dap{} on or off. 317 the \dap{} on or off.
335 318
336 The \ButtonHold{} switch is located on the left of the \dap{}, below the 319 The \ButtonHold{} switch is located on the left of the \dap{}, below the
337 headphone socket. It puts the \dap{} into hold mode when it is switched to the 320 headphone socket. It puts the \dap{} into hold mode when it is switched to the
338 top of the unit. The buttons will have no effect when this is the case. On the 321 top of the unit. The buttons will have no effect when this is the case. On the
339 bottom of the unit, there is a connector for the docking station or the 322 bottom of the unit, there is a connector for the docking station or the
340 proprietary USB connector for connecting directly to USB.} 323 proprietary USB connector for connecting directly to USB.}
341 % 324 %
342 \opt{iaudiom5,iaudiox5}{ 325 \opt{iaudiom5,iaudiox5}{
343 The \dap{} is curved so that the end with the screen on it is thicker than the 326 The \dap{} is curved so that the end with the screen on it is thicker than the
344 other end. Hold the \dap{} wih the thick end towards the top and the screen 327 other end. Hold the \dap{} wih the thick end towards the top and the screen
345 facing towards you. Half way up the front of the unit on the right hand side 328 facing towards you. Half way up the front of the unit on the right hand side
346 is a four way joystick which is the \ButtonUp{}, \ButtonDown{}, 329 is a four way joystick which is the \ButtonUp{}, \ButtonDown{},
347 \ButtonLeft{}, and \ButtonRight{} buttons. When pressed it serves as \ButtonSelect{}. 330 \ButtonLeft{}, and \ButtonRight{} buttons. When pressed it serves as \ButtonSelect{}.
348 331
349 On the right hand side of the \dap{} from top to bottom, first there is a two 332 On the right hand side of the \dap{} from top to bottom, first there is a two
350 way switch. the \ButtonPower{} button is activated by pushing this switch up, 333 way switch. the \ButtonPower{} button is activated by pushing this switch up,
351 and pushing this switch down until it clicks slightly will activate the 334 and pushing this switch down until it clicks slightly will activate the
352 \ButtonHold{} button. When the switch is in this position, none of the other 335 \ButtonHold{} button. When the switch is in this position, none of the other
353 keys will have an effect. 336 keys will have an effect.
354 337
355 Below the switch is a lozenge shaped button which is the \ButtonRec{} 338 Below the switch is a lozenge shaped button which is the \ButtonRec{}
356 button, and below that the final button on this side of the unit, the 339 button, and below that the final button on this side of the unit, the
357 \ButtonPlay{} button. Just below this is a small hole which is difficult to 340 \ButtonPlay{} button. Just below this is a small hole which is difficult to
358 locate by touch which is the internal microphone. At the very bottom of 341 locate by touch which is the internal microphone. At the very bottom of
359 this side of the unit is the reset hole, which can be used to perform a hard 342 this side of the unit is the reset hole, which can be used to perform a hard
360 reset by inserting a paper clip. 343 reset by inserting a paper clip.
361 344
362 On the bottom of the unit is the connector for the 345 On the bottom of the unit is the connector for the
363 \playerman{} subpack or dock. On the top of the unit is a charge 346 \playerman{} subpack or dock. On the top of the unit is a charge
364 indicator light, which may feel a bit like a button, but is not. 347 indicator light, which may feel a bit like a button, but is not.
365 348
366 From the top of the \dap{} on the left hand side is the headphone socket, then the 349 From the top of the \dap{} on the left hand side is the headphone socket, then the
367 remote connector. Below this is a cover which protects the \opt{iaudiox5}{USB 350 remote connector. Below this is a cover which protects the \opt{iaudiox5}{USB
368 host connector.}\opt{iaudiom5}{USB and charging connector}.} 351 host connector.}\opt{iaudiom5}{USB and charging connector}.}
369 % 352 %
370 \opt{e200,e200v2}{ 353 \opt{e200,e200v2}{
371 Hold the \dap{} with the turning wheel at the front and bottom. On the bottom left 354 Hold the \dap{} with the turning wheel at the front and bottom. On the bottom left
372 of the front of the \dap{} is a raised round button, the \ButtonPower{} button. 355 of the front of the \dap{} is a raised round button, the \ButtonPower{} button.
373 Above and to the left of this, on the outside of the turning wheel are four 356 Above and to the left of this, on the outside of the turning wheel are four
374 buttons. These are the \ButtonUp{}, \ButtonDown{}, \ButtonLeft{} and 357 buttons. These are the \ButtonUp{}, \ButtonDown{}, \ButtonLeft{} and
375 \ButtonRight{} buttons. Inside the wheel is the \ButtonSelect{} button. Turning 358 \ButtonRight{} buttons. Inside the wheel is the \ButtonSelect{} button. Turning
376 the wheel to the right activates the \ButtonScrollFwd{} function, and to the 359 the wheel to the right activates the \ButtonScrollFwd{} function, and to the
377 left, the \ButtonScrollBack{} function. 360 left, the \ButtonScrollBack{} function.
378 361
379 On the right of the unit is a slot for inserting flash cards. On the bottom is 362 On the right of the unit is a slot for inserting flash cards. On the bottom is
380 the connector for the USB cable. On the left is the \ButtonRec{} button, and 363 the connector for the USB cable. On the left is the \ButtonRec{} button, and
381 on the top, there is the headphone socket to the right, and the \ButtonHold{} 364 on the top, there is the headphone socket to the right, and the \ButtonHold{}
382 switch. Moving this switch to the right activates hold mode in which none of the 365 switch. Moving this switch to the right activates hold mode in which none of the
@@ -458,120 +441,67 @@ detail in the following paragraph.
458 % 441 %
459 \opt{vibe500}{ 442 \opt{vibe500}{
460 Hold or lay the \dap{} so that the side with the controls and 443 Hold or lay the \dap{} so that the side with the controls and
461 LCD is facing towards you. Below the LCD is the touch sensitive pad with the \ButtonMenu{}, 444 LCD is facing towards you. Below the LCD is the touch sensitive pad with the \ButtonMenu{},
462 \ButtonPlay{}, \ButtonLeft{}, \ButtonRight{} controls and the scroll pad in the centre. The 445 \ButtonPlay{}, \ButtonLeft{}, \ButtonRight{} controls and the scroll pad in the centre. The
463 scroll pad is oriented vertically between the \ButtonOK{} and \ButtonCancel{} buttons. 446 scroll pad is oriented vertically between the \ButtonOK{} and \ButtonCancel{} buttons.
464 Sliding a finger up or down the scroll pad acts as \ButtonUp{} and \ButtonDown{} respectively. 447 Sliding a finger up or down the scroll pad acts as \ButtonUp{} and \ButtonDown{} respectively.
465 Note that the scroll pad is sensitive, so you will need to move 448 Note that the scroll pad is sensitive, so you will need to move
466 slowly at first and get a feel for how it works. 449 slowly at first and get a feel for how it works.
467 450
468 There are two buttons on the right hand side of the \dap{}: \ButtonPower{} on the top and 451 There are two buttons on the right hand side of the \dap{}: \ButtonPower{} on the top and
469 \ButtonRec{} underneath. Under these buttons, from top to bottom you can find: USB connector, 452 \ButtonRec{} underneath. Under these buttons, from top to bottom you can find: USB connector,
470 power connector and the reset hole if you need to perform a hardware reset. 453 power connector and the reset hole if you need to perform a hardware reset.
471 454
472 The \ButtonHold{} switch is located on the left hand side of the \dap{}. Note that when the 455 The \ButtonHold{} switch is located on the left hand side of the \dap{}. Note that when the
473 \ButtonHold{} switch is moved towards the top of the \dap{}, hold is turned on and all the 456 \ButtonHold{} switch is moved towards the top of the \dap{}, hold is turned on and all the
474 other controls are disabled. Be sure \ButtonHold{} is off before trying to use your player. 457 other controls are disabled. Be sure \ButtonHold{} is off before trying to use your player.
475 458
476 On the top on the \dap{} is the internal microphone on the left and the line-in socket on the 459 On the top on the \dap{} is the internal microphone on the left and the line-in socket on the
477 right, near the headphone socket.} 460 right, near the headphone socket.}
478 % 461 %
479 \opt{samsungyh820}{ 462 \opt{samsungyh820}{
480 Hold or lay the \dap{} so that the side with the controls and 463 Hold or lay the \dap{} so that the side with the controls and
481 LCD is facing towards you. Directly below the bottom edge of the screen are three buttons: 464 LCD is facing towards you. Directly below the bottom edge of the screen are three buttons:
482 \ButtonRew{} on the left, \ButtonPlay{} in the middle and \ButtonFF{} on the right. Below them 465 \ButtonRew{} on the left, \ButtonPlay{} in the middle and \ButtonFF{} on the right. Below them
483 is a four-way pad which contains the \ButtonDown{}, \ButtonUp{}, \ButtonLeft{} and 466 is a four-way pad which contains the \ButtonDown{}, \ButtonUp{}, \ButtonLeft{} and
484 \ButtonRight{} controls. 467 \ButtonRight{} controls.
485 468
486 At the top of the right hand side of the \dap{} is the \ButtonRec{} button. 469 At the top of the right hand side of the \dap{} is the \ButtonRec{} button.
487 470
488 On the top panel of the \dap{}, from left to right, you can find the following: headphone 471 On the top panel of the \dap{}, from left to right, you can find the following: headphone
489 socket, line-in socket, internal microphone, and the \ButtonHold{} switch. Note that when the 472 socket, line-in socket, internal microphone, and the \ButtonHold{} switch. Note that when the
490 \ButtonHold{} switch is moved towards the center of the \dap{}, hold is turned on and all the 473 \ButtonHold{} switch is moved towards the center of the \dap{}, hold is turned on and all the
491 other controls are disabled. Be sure \ButtonHold{} is off before trying to use your player. 474 other controls are disabled. Be sure \ButtonHold{} is off before trying to use your player.
492 475
493 At the top of the back side of the player, just under the \ButtonHold{} button is the reset 476 At the top of the back side of the player, just under the \ButtonHold{} button is the reset
494 hole, if you need to perform a hardware reset. 477 hole, if you need to perform a hardware reset.
495 478
496 The USB/dock connector that is used to connect your \dap{} to your computer is on 479 The USB/dock connector that is used to connect your \dap{} to your computer is on
497 the bottom panel of the \dap{}. 480 the bottom panel of the \dap{}.
498 } 481 }
499 % 482 %
500 \opt{samsungyh920,samsungyh925}{ 483 \opt{samsungyh920,samsungyh925}{
501 Hold or lay the \dap{} so that the side with the controls and 484 Hold or lay the \dap{} so that the side with the controls and
502 LCD is facing towards you. Below the LCD is a four-way pad with the \ButtonDown{}, 485 LCD is facing towards you. Below the LCD is a four-way pad with the \ButtonDown{},
503 \ButtonUp{}, \ButtonLeft{} and \ButtonRight{} buttons. 486 \ButtonUp{}, \ButtonLeft{} and \ButtonRight{} buttons.
504 487
505 There are three buttons at the top of the right hand side of the \dap{}: \ButtonFF{} on the top, 488 There are three buttons at the top of the right hand side of the \dap{}: \ButtonFF{} on the top,
506 \ButtonPlay{} in the middle and \ButtonRew{} underneath. Below these buttons is the \ButtonRec{} 489 \ButtonPlay{} in the middle and \ButtonRew{} underneath. Below these buttons is the \ButtonRec{}
507 switch. Rockbox doesn't take note of the actual \emph{position} of the switch, but reacts to a 490 switch. Rockbox doesn't take note of the actual \emph{position} of the switch, but reacts to a
508 \emph{switching movement} like pressing a regular button. 491 \emph{switching movement} like pressing a regular button.
509 492
510 On the top panel of the \dap{}, from left to right, you can find the following: headphone/remote 493 On the top panel of the \dap{}, from left to right, you can find the following: headphone/remote
511 socket, line-in socket, internal microphone, and the \ButtonHold{} switch. Note that when the 494 socket, line-in socket, internal microphone, and the \ButtonHold{} switch. Note that when the
512 \ButtonHold{} switch is moved towards the center of the \dap{}, hold is turned on and all the 495 \ButtonHold{} switch is moved towards the center of the \dap{}, hold is turned on and all the
513 other controls are disabled. Be sure \ButtonHold{} is off before trying to use your player. 496 other controls are disabled. Be sure \ButtonHold{} is off before trying to use your player.
514 497
515 At the top of the back side of the player, just under the \ButtonHold{} button is the reset hole, 498 At the top of the back side of the player, just under the \ButtonHold{} button is the reset hole,
516 if you need to perform a hardware reset. 499 if you need to perform a hardware reset.
517 500
518 The USB/dock connector that is used to connect your \dap{} to your computer is on 501 The USB/dock connector that is used to connect your \dap{} to your computer is on
519 the bottom panel of the \dap{}. 502 the bottom panel of the \dap{}.
520 } 503 }
521 % 504 %
522 \opt{player}{
523 The main controls of this player are a four-way button on the right below
524 the screen, and two round buttons to the left of it. Hold the \dap{} with
525 these controls on the bottom and facing you.
526
527 On the left hand side, the higher of the two small buttons is the \ButtonOn{},
528 the lower of the two buttons is the \ButtonMenu{} button. The large circular
529 button on the right contains, clockwise from the top, the \ButtonPlay{},
530 the \ButtonRight{}, the \ButtonStop{}, and the \ButtonLeft{} buttons.
531
532 On the top on the \dap{} is the headphone socket on the left and the line-out
533 jack on the right. On the bottom of the \dap{} is the line-in jack on the left,
534 the DC-In jack on the right, and the USB connector in the centre.
535 }
536 %
537 \opt{recorder}{
538 Holding the Jukebox in front of you, there should be three rectangular buttons
539 in a horizontal line towards the middle of the unit, and below this to the left
540 there is a circular four button array with the circular \ButtonPlay{} button
541 as a fifth button in the centre. These are the navigation controls. Below the
542 rectangular buttons and to the right of the circular buttons are two small round
543 buttons one above the other.
544
545 The \ButtonOn{} button is the topmost of the two buttons located below and to the
546 left of the navigation controls whereas the lower of these two is called \ButtonOff.
547 The small round button in the middle of the large circular button array is called
548 \ButtonPlay{} button. To the right of the \ButtonPlay{} button there is the
549 \ButtonRight{} button, left of it is the \ButtonLeft{}, above it \ButtonUp, and
550 below the \ButtonPlay{} button there is the \ButtonDown{} button placed. In the row
551 of three rectangular buttons the following buttons can be found (from left to right):
552 \ButtonFOne{}, \ButtonFTwo{} and \ButtonFThree{}.
553
554 On the top of the \dap{} is the headphone socket on the left and the line-out jack on
555 the right. On the bottom of the \dap{} is the line-in jack on the left, the
556 DC-In jack on the right, and the USB connector in the centre.
557 }
558 \opt{recorderv2fm}{
559 Holding the Jukebox in front of you, there should be three rectangular buttons
560 in a horizontal line towards the middle of the unit, and below this centred on the
561 middle button there are four radial arc shaped buttons placed in a cross formation
562 with the circular play button as the centre of the cross. These are the navigation
563 controls. Below the cross and to the left are two other buttons.
564
565 The \ButtonOn{} button is the leftmost of the two buttons located below and to the
566 left of the navigation controls whereas the rightmost and little lower one of
567 these two is called \ButtonOff{}. The round button raised slightly higher than the
568 others in the centre of the navigation controls is the \ButtonPlay{} button. To
569 the right of the \ButtonPlay{} button there is the \ButtonRight{} button, left of
570 it is the \ButtonLeft{}, above it \ButtonUp{}, and below the \ButtonPlay{} button
571 there is the \ButtonDown{} button placed. In the row of three rectangular buttons
572 the following buttons can be found (from left to right): \ButtonFOne{}, \ButtonFTwo{}
573 and \ButtonFThree{}.
574 }
575} 505}
576 506
577\subsection{Turning the \dap{} on and off} 507\subsection{Turning the \dap{} on and off}
@@ -584,8 +514,6 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
584 {Long \ButtonPlay}% 514 {Long \ButtonPlay}%
585 \opt{IPOD_4G_PAD}{\ButtonMenu{} / \ButtonSelect}% 515 \opt{IPOD_4G_PAD}{\ButtonMenu{} / \ButtonSelect}%
586 \opt{IPOD_3G_PAD}{\ButtonMenu{} / \ButtonPlay}% 516 \opt{IPOD_3G_PAD}{\ButtonMenu{} / \ButtonPlay}%
587 \opt{ONDIO_PAD}{\ButtonOff}\opt{RECORDER_PAD,PLAYER_PAD}%
588 {Long \ButtonOn}%
589 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,ONDA_VX777_PAD% 517 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD,ONDA_VX777_PAD%
590 ,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,sansaAMS,PBELL_VIBE500_PAD% 518 ,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,sansaAMS,PBELL_VIBE500_PAD%
591 ,SANSA_FUZEPLUS_PAD% 519 ,SANSA_FUZEPLUS_PAD%
@@ -604,15 +532,12 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
604 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}% 532 \opt{MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}%
605 {Long \ButtonPlay}% 533 {Long \ButtonPlay}%
606 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonPlay}% 534 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{Long \ButtonPlay}%
607 \opt{ONDIO_PAD,recorderv2fm}{Long \ButtonOff}%
608 \opt{recorder}{Double tap \ButtonOff\ when playback is stopped}%
609 \opt{PLAYER_PAD}{From the Main Menu, select \textbf{Shutdown}}%
610 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD% 535 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD%
611 ,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,sansaAMS,COWON_D2_PAD% 536 ,GIGABEAT_PAD,MROBE100_PAD,GIGABEAT_S_PAD,sansaAMS,COWON_D2_PAD%
612 ,PBELL_VIBE500_PAD,ONDA_VX777_PAD,SANSA_FUZEPLUS_PAD% 537 ,PBELL_VIBE500_PAD,ONDA_VX777_PAD,SANSA_FUZEPLUS_PAD%
613 }{Long \ButtonPower}% 538 }{Long \ButtonPower}%
614 & 539 &
615 \opt{HAVEREMOTEKEYMAP}{ 540 \opt{HAVEREMOTEKEYMAP}{
616 \opt{IRIVER_RC_H100_PAD}{Long \ButtonRCStop}% 541 \opt{IRIVER_RC_H100_PAD}{Long \ButtonRCStop}%
617 \opt{IAUDIO_RC_PAD}{Long \ButtonRCPlay} 542 \opt{IAUDIO_RC_PAD}{Long \ButtonRCPlay}
618 &} 543 &}
@@ -629,11 +554,11 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
629 the Reset Settings in \reference{ref:manage_settings_menu} for details. 554 the Reset Settings in \reference{ref:manage_settings_menu} for details.
630}% 555}%
631 556
632\opt{PLAYER_PAD,RECORDER_PAD,ONDIO_PAD,GIGABEAT_PAD,IPOD_4G_PAD,SANSA_E200_PAD% 557\opt{GIGABEAT_PAD,IPOD_4G_PAD,SANSA_E200_PAD%
633,SANSA_C200_PAD,IAUDIO_X5_PAD,IAUDIO_M5_PAD,IPOD_3G_PAD}{% 558,SANSA_C200_PAD,IAUDIO_X5_PAD,IAUDIO_M5_PAD,IPOD_3G_PAD}{%
634 In the unlikely event of a software failure, hardware poweroff or reset can be 559 In the unlikely event of a software failure, hardware poweroff or reset can be
635 performed by holding down \opt{PLAYER_PAD}{\ButtonStop}\opt{RECORDER_PAD,ONDIO_PAD} 560 performed by holding down
636 {\ButtonOff}\opt{GIGABEAT_PAD}{the battery switch}\opt{IPOD_4G_PAD} 561 \opt{GIGABEAT_PAD}{the battery switch}\opt{IPOD_4G_PAD}
637 {\ButtonMenu{} and \ButtonSelect{} simultaneously}% 562 {\ButtonMenu{} and \ButtonSelect{} simultaneously}%
638 \opt{IPOD_3G_PAD}{\ButtonMenu{} and \ButtonPlay{} simultaneously}% 563 \opt{IPOD_3G_PAD}{\ButtonMenu{} and \ButtonPlay{} simultaneously}%
639 \opt{SANSA_E200_PAD,SANSA_C200_PAD,IAUDIO_X5_PAD,IAUDIO_M5_PAD} 564 \opt{SANSA_E200_PAD,SANSA_C200_PAD,IAUDIO_X5_PAD,IAUDIO_M5_PAD}
@@ -646,7 +571,7 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
646 performed by inserting a paperclip gently into the Reset hole. 571 performed by inserting a paperclip gently into the Reset hole.
647}% 572}%
648 573
649\nopt{gigabeatf,iaudiom3,iaudiom5,iaudiox5,archos} 574\nopt{gigabeatf,iaudiom3,iaudiom5,iaudiox5}
650 { 575 {
651 \subsection{Starting the original firmware} 576 \subsection{Starting the original firmware}
652 \label{ref:Dualboot} 577 \label{ref:Dualboot}
@@ -656,11 +581,11 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
656 down the device as described above. Turn on the \ButtonHold{} switch 581 down the device as described above. Turn on the \ButtonHold{} switch
657 immediately after turning the player on. The Apple logo will 582 immediately after turning the player on. The Apple logo will
658 display for a few seconds as Rockbox loads the original firmware. 583 display for a few seconds as Rockbox loads the original firmware.
659 584
660 You can also load the original firmware by shutting down the device, 585 You can also load the original firmware by shutting down the device,
661 then clicking the \ButtonHold{} switch on and connecting the iPod 586 then clicking the \ButtonHold{} switch on and connecting the iPod
662 to your computer. 587 to your computer.
663 588
664 Regardless of which method you use to boot to the original firmware, you can 589 Regardless of which method you use to boot to the original firmware, you can
665 return to Rockbox by pressing and holding \ButtonMenu{} and \ButtonSelect{} 590 return to Rockbox by pressing and holding \ButtonMenu{} and \ButtonSelect{}
666 simultaneously until the player hard resets. 591 simultaneously until the player hard resets.
@@ -672,11 +597,11 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
672 down the device as described above. Turn on the \ButtonHold{} switch 597 down the device as described above. Turn on the \ButtonHold{} switch
673 immediately after turning the player on. The Apple logo will 598 immediately after turning the player on. The Apple logo will
674 display for a few seconds as Rockbox loads the original firmware. 599 display for a few seconds as Rockbox loads the original firmware.
675 600
676 You can also load the original firmware by shutting down the device, 601 You can also load the original firmware by shutting down the device,
677 then clicking the \ButtonHold{} switch on and connecting the iPod 602 then clicking the \ButtonHold{} switch on and connecting the iPod
678 to your computer. 603 to your computer.
679 604
680 Regardless of which method you use to boot to the original firmware, you can 605 Regardless of which method you use to boot to the original firmware, you can
681 return to Rockbox by pressing and holding \ButtonMenu{} and \ButtonPlay{} 606 return to Rockbox by pressing and holding \ButtonMenu{} and \ButtonPlay{}
682 simultaneously until the player hard resets. 607 simultaneously until the player hard resets.
@@ -722,7 +647,7 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
722 inserting a pin in the reset hole}\opt{iriverh10_5gb}{removing and 647 inserting a pin in the reset hole}\opt{iriverh10_5gb}{removing and
723 reinserting the battery}.} 648 reinserting the battery}.}
724 } 649 }
725 650
726 \opt{sansa,sansaAMS} 651 \opt{sansa,sansaAMS}
727 { 652 {
728 Rockbox has a dual-boot feature. To boot into the original firmware, 653 Rockbox has a dual-boot feature. To boot into the original firmware,
@@ -741,9 +666,9 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
741 { 666 {
742 Rockbox has a dual-boot feature. It loads the original firmware from 667 Rockbox has a dual-boot feature. It loads the original firmware from
743 the file \fname{/System/OF.mi4}. To boot into the original firmware, 668 the file \fname{/System/OF.mi4}. To boot into the original firmware,
744 when the \dap{} is turned off, press the \ButtonPower{} button once and then 669 when the \dap{} is turned off, press the \ButtonPower{} button once and then
745 a second time when the m:robe bootlogo (the headphone) appears. Hold the 670 a second time when the m:robe bootlogo (the headphone) appears. Hold the
746 \ButtonPower{} button until you see the ``Loading original firmware...'' 671 \ButtonPower{} button until you see the ``Loading original firmware...''
747 message on the screen. 672 message on the screen.
748 } 673 }
749 674
@@ -771,8 +696,8 @@ To turn on and off your Rockbox enabled \dap{} use the following keys:
771 \opt{samsungyh} 696 \opt{samsungyh}
772 { 697 {
773 Rockbox has a dual-boot feature. It loads the original firmware from 698 Rockbox has a dual-boot feature. It loads the original firmware from
774 the file \fname{/System/OF.mi4}. To boot into the original firmware, press and hold 699 the file \fname{/System/OF.mi4}. To boot into the original firmware, press and hold
775 for awhile the \ButtonPlay{} button and then immediately after the Samsung logo appears, 700 for awhile the \ButtonPlay{} button and then immediately after the Samsung logo appears,
776 press the \ButtonLeft{} button and keep it pressed until the original firmware starts. 701 press the \ButtonLeft{} button and keep it pressed until the original firmware starts.
777 } 702 }
778 703
@@ -797,7 +722,7 @@ With the \dap{} connected to the computer as an MSC/UMS device (like a
797USB Drive), music files can be put on the player via any standard file 722USB Drive), music files can be put on the player via any standard file
798transfer method that you would use to copy files between drives (e.g. Drag-and-Drop). 723transfer method that you would use to copy files between drives (e.g. Drag-and-Drop).
799Files may be placed wherever you like on the \dap{}, but it is strongly 724Files may be placed wherever you like on the \dap{}, but it is strongly
800suggested \emph{NOT} to put them in the \fname{/.rockbox} folder and instead 725suggested \emph{NOT} to put them in the \fname{/.rockbox} folder and instead
801put them in any other folder, e.g. \fname{/}, \fname{/music} or \fname{/audio}. 726put them in any other folder, e.g. \fname{/}, \fname{/music} or \fname{/audio}.
802The default directory structure that is assumed by some parts of Rockbox 727The default directory structure that is assumed by some parts of Rockbox
803\opt{albumart}{% 728\opt{albumart}{%
@@ -807,7 +732,7 @@ The default directory structure that is assumed by some parts of Rockbox
807 your files are not properly tagged, and you have your music organized in a 732 your files are not properly tagged, and you have your music organized in a
808 way different than they assume when attempting to guess the Artist and Album 733 way different than they assume when attempting to guess the Artist and Album
809 names from your filetree. See \reference{ref:album_art} for the requirements 734 names from your filetree. See \reference{ref:album_art} for the requirements
810 for Album Art to work properly. 735 for Album Art to work properly.
811}% 736}%
812\nopt{albumart}{% 737\nopt{albumart}{%
813 (missing-tag fallback in some WPSes) uses the parent directory of a song 738 (missing-tag fallback in some WPSes) uses the parent directory of a song
@@ -839,11 +764,11 @@ pretty intuitive.
839In the tree view use \ActionStdNext{} and \ActionStdPrev{} to move around 764In the tree view use \ActionStdNext{} and \ActionStdPrev{} to move around
840the selection. Use \ActionStdOk{} to select an item. \opt{wheel_acceleration}{ 765the selection. Use \ActionStdOk{} to select an item. \opt{wheel_acceleration}{
841Note that the scroll speed is accelerating the faster you rotate the wheel.} 766Note that the scroll speed is accelerating the faster you rotate the wheel.}
842When browsing the file system selecting an audio file plays it. The view 767When browsing the file system selecting an audio file plays it. The view
843switches to the ``While playing screen'', usually abbreviated as ``WPS'' (see 768switches to the ``While playing screen'', usually abbreviated as ``WPS'' (see
844\reference{ref:WPS}. The dynamic playlist gets replaced with the contents of 769\reference{ref:WPS}. The dynamic playlist gets replaced with the contents of
845the current directory. This way you can easily treat directories as playlists. 770the current directory. This way you can easily treat directories as playlists.
846The created dynamic playlist can be extended or modified while playing. This is 771The created dynamic playlist can be extended or modified while playing. This is
847also known as ``on-the-fly playlist''. 772also known as ``on-the-fly playlist''.
848To go back to the \setting{File Browser} stop the playback with the 773To go back to the \setting{File Browser} stop the playback with the
849\ActionWpsStop{} button or return to the file browser while keeping playback 774\ActionWpsStop{} button or return to the file browser while keeping playback
@@ -893,7 +818,6 @@ have the needed fonts installed as otherwise the theme may not display
893properly.} 818properly.}
894} 819}
895 820
896\nopt{ondio}{
897 \opt{usb_power}{ 821 \opt{usb_power}{
898 \section{USB Charging} 822 \section{USB Charging}
899 To charge your \dap{} over USB, hold any button while plugging it 823 To charge your \dap{} over USB, hold any button while plugging it
@@ -906,15 +830,5 @@ properly.}
906 \ActionStdUsbCharge{}.} 830 \ActionStdUsbCharge{}.}
907 } 831 }
908 } 832 }
909}
910
911\opt{ondio}{
912 \section{USB Power}
913
914 To power your \dap{} over USB, hold \ActionStdUsbCharge{} while plugging it
915 in. This will prevent it from connecting to your computer and let you
916 continue to use it normally. Your \dap{} must already be in Rockbox for this
917 to function.
918}
919 833
920\input{rockbox_interface/browsing_and_playing.tex} 834\input{rockbox_interface/browsing_and_playing.tex}
diff --git a/manual/rockbox_interface/wps.tex b/manual/rockbox_interface/wps.tex
index c82a9cb9f4..1f62dc17a4 100644
--- a/manual/rockbox_interface/wps.tex
+++ b/manual/rockbox_interface/wps.tex
@@ -9,17 +9,10 @@ currently playing audio file.
9 or off independently. Refer to \reference{ref:wps_tags} for details on how 9 or off independently. Refer to \reference{ref:wps_tags} for details on how
10 to change the display of the WPS. 10 to change the display of the WPS.
11 \begin{itemize} 11 \begin{itemize}
12 \nopt{ondio}{ 12 \item Status bar: The Status bar shows Battery level, charger status,
13 \item Status bar: The Status bar shows Battery level, charger status, 13 volume, play mode, repeat mode, shuffle mode\opt{rtc}{ and clock}.
14 volume, play mode, repeat mode, shuffle mode\opt{rtc}{ and clock}. 14 In contrast to all other items, the status bar is always at the top of
15 In contrast to all other items, the status bar is always at the top of 15 the screen.
16 the screen.
17 }
18 \opt{ondio}{
19 \item Status bar: The Status bar shows Battery level, USB power mode, key
20 lock status, memory access indicator. In contrast to all other items, the
21 status bar is always at the top of the screen.
22 }
23 \item (Scrolling) path and filename of the current song. 16 \item (Scrolling) path and filename of the current song.
24 \item The ID3 track name. 17 \item The ID3 track name.
25 \item The ID3 album name. 18 \item The ID3 album name.
@@ -30,24 +23,7 @@ currently playing audio file.
30 \item Peak meter. 23 \item Peak meter.
31 \end{itemize} 24 \end{itemize}
32} 25}
33\opt{recorder,recorderv2fm,ondio}{
34 \note{
35 \begin{itemize}
36 \item The number of lines shown depends on the size of the font used.
37 \item The peak meter is only visible if you turn off the status bar or if
38 using a small font that gives 8 or more display lines.
39 \end{itemize}
40 }
41}
42% 26%
43\opt{player}{
44 \note{
45 \begin{itemize}
46 \item Playlist index/Playlist size: Artist {}- Title.
47 \item Current{}-time Progress{}-indicator Left.
48 \end{itemize}
49 }
50}
51 27
52See \reference{ref:ConfiguringtheWPS} for details of customising 28See \reference{ref:ConfiguringtheWPS} for details of customising
53your WPS (While Playing Screen). 29your WPS (While Playing Screen).
@@ -81,7 +57,7 @@ your WPS (While Playing Screen).
81 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsPlay} 57 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsPlay}
82 & Toggle play/pause.\\ 58 & Toggle play/pause.\\
83 % 59 %
84 \ActionWpsStop 60 \ActionWpsStop
85 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsStop} 61 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsStop}
86 & Stop playback.\\ 62 & Stop playback.\\
87 % 63 %
@@ -93,11 +69,10 @@ your WPS (While Playing Screen).
93 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsContext} 69 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsContext}
94 & Enter \setting{WPS Context Menu}.\\ 70 & Enter \setting{WPS Context Menu}.\\
95 % 71 %
96 \opt{ONDIO_PAD}{\ActionWpsContext{} twice}% 72 \ActionWpsMenu
97 \nopt{ONDIO_PAD}{\ActionWpsMenu}%
98 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsMenu} 73 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsMenu}
99 & Enter \setting{Main Menu}% 74 & Enter \setting{Main Menu}%
100 \opt{ONDIO_PAD}{ via the \setting{WPS Context Menu}}.\\% 75 .\\%
101 % 76 %
102 \opt{quickscreen}{% 77 \opt{quickscreen}{%
103 \ActionWpsQuickScreen 78 \ActionWpsQuickScreen
@@ -107,25 +82,14 @@ your WPS (While Playing Screen).
107 % 82 %
108 % software hold targets 83 % software hold targets
109 \nopt{hold_button}{% 84 \nopt{hold_button}{%
110 \opt{RECORDER_PAD}{\ButtonFOne+\ButtonDown}
111 \opt{PLAYER_PAD}{\ButtonMenu+\ButtonStop}
112 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonDown}
113 \opt{SANSA_CLIP_PAD}{\ButtonHome+\ButtonSelect} 85 \opt{SANSA_CLIP_PAD}{\ButtonHome+\ButtonSelect}
114 \opt{SANSA_FUZEPLUS_PAD}{\ButtonPower} 86 \opt{SANSA_FUZEPLUS_PAD}{\ButtonPower}
115 & Key lock (software hold switch) on/off.\\ 87 & Key lock (software hold switch) on/off.\\
116 }% 88 }%
117 %These actions need definitions for the other targets
118 \opt{RECORDER_PAD}{%
119 \ButtonFThree & Toggles Display quick screen.\\%
120 \ButtonFOne+\ButtonPlay & Mute on/off.\\%
121 }%
122 \opt{PLAYER_PAD}{%
123 \ButtonMenu+\ButtonPlay & Mute on/off.\\%
124 }%
125 % We explicitly list all the appropriate targets here and do no condition 89 % We explicitly list all the appropriate targets here and do no condition
126 % on the 'pitchscreen' feature since some players have the feature but do 90 % on the 'pitchscreen' feature since some players have the feature but do
127 % not have the button to go from the WPS to the pitch screen. 91 % not have the button to go from the WPS to the pitch screen.
128 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IRIVER_H10_PAD,MROBE100_PAD% 92 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IRIVER_H10_PAD,MROBE100_PAD%
129 ,GIGABEAT_PAD,GIGABEAT_S_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_FUZEPLUS_PAD}{% 93 ,GIGABEAT_PAD,GIGABEAT_S_PAD,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_FUZEPLUS_PAD}{%
130 \ActionWpsPitchScreen 94 \ActionWpsPitchScreen
131 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsPitchScreen} 95 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsPitchScreen}
@@ -137,9 +101,9 @@ your WPS (While Playing Screen).
137 \opt{HAVEREMOTEKEYMAP}{&} 101 \opt{HAVEREMOTEKEYMAP}{&}
138 & Show current \setting{Playlist}.\\% 102 & Show current \setting{Playlist}.\\%
139 }% 103 }%
140 \opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IRIVER_H10_PAD% 104 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IRIVER_H10_PAD%
141 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_FUZEPLUS_PAD}{% 105 ,SANSA_E200_PAD,SANSA_C200_PAD,SANSA_FUZEPLUS_PAD}{%
142 \ActionWpsIdThreeScreen 106 \ActionWpsIdThreeScreen
143 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsIdThreeScreen} 107 \opt{HAVEREMOTEKEYMAP}{& \ActionRCWpsIdThreeScreen}
144 & Enter \setting{ID3 Viewer}.\\% 108 & Enter \setting{ID3 Viewer}.\\%
145 }% 109 }%
@@ -168,7 +132,7 @@ your WPS (While Playing Screen).
168 % 132 %
169 \opt{SANSA_E200_PAD,SANSA_C200_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{ 133 \opt{SANSA_E200_PAD,SANSA_C200_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{
170 \ActionStdRec 134 \ActionStdRec
171 \opt{HAVEREMOTEKEYMAP}{&} 135 \opt{HAVEREMOTEKEYMAP}{&}
172 & Switch to the \setting{Recording Screen}.\\ 136 & Switch to the \setting{Recording Screen}.\\
173 }% 137 }%
174 \end{btnmap} 138 \end{btnmap}
@@ -177,7 +141,7 @@ your WPS (While Playing Screen).
177\opt{lcd_bitmap}{ 141\opt{lcd_bitmap}{
178 \subsection{\label{ref:peak_meter}Peak Meter} 142 \subsection{\label{ref:peak_meter}Peak Meter}
179 The peak meter can be displayed on the While Playing Screen and consists of 143 The peak meter can be displayed on the While Playing Screen and consists of
180 several indicators. 144 several indicators.
181 \opt{recording}{ 145 \opt{recording}{
182 For a picture of the peak meter, please see the While 146 For a picture of the peak meter, please see the While
183 Recording Screen in \reference{ref:while_recording_screen}. 147 Recording Screen in \reference{ref:while_recording_screen}.
@@ -187,12 +151,12 @@ your WPS (While Playing Screen).
187 suffers when this feature is enabled. For this \dap{} it is highly recommended 151 suffers when this feature is enabled. For this \dap{} it is highly recommended
188 to not use peak meter.} 152 to not use peak meter.}
189 } 153 }
190 154
191 \begin{description} 155 \begin{description}
192 \item [The bar:] 156 \item [The bar:]
193 This is the wide horizontal bar. It represents the current volume value. 157 This is the wide horizontal bar. It represents the current volume value.
194 \item [The peak indicator:] 158 \item [The peak indicator:]
195 This is a little vertical line at the right end of the bar. It indicates 159 This is a little vertical line at the right end of the bar. It indicates
196 the peak volume value that occurred recently. 160 the peak volume value that occurred recently.
197 \item [The clip indicator:] 161 \item [The clip indicator:]
198 This is a little black block that is displayed at the very right of the 162 This is a little black block that is displayed at the very right of the
@@ -234,7 +198,7 @@ menu, you can find the \setting{Playlist Viewer Settings}.
234 for playlist entries 198 for playlist entries
235 \end{description} 199 \end{description}
236 200
237 201
238\subsubsection{Playlist catalogue} 202\subsubsection{Playlist catalogue}
239 \begin{description} 203 \begin{description}
240 \item [View catalogue.] This lists all playlists that are part of the 204 \item [View catalogue.] This lists all playlists that are part of the
@@ -249,12 +213,12 @@ menu, you can find the \setting{Playlist Viewer Settings}.
249 213
250\subsubsection{Sound Settings} 214\subsubsection{Sound Settings}
251This is a shortcut to the \setting{Sound Settings Menu}, where you can configure volume, 215This is a shortcut to the \setting{Sound Settings Menu}, where you can configure volume,
252bass, treble, and other settings affecting the sound of your music. 216bass, treble, and other settings affecting the sound of your music.
253See \reference{ref:configure_rockbox_sound} for more information. 217See \reference{ref:configure_rockbox_sound} for more information.
254 218
255\subsubsection{Playback Settings} 219\subsubsection{Playback Settings}
256This is a shortcut to the \setting{Playback Settings Menu}, where you can configure shuffle, 220This is a shortcut to the \setting{Playback Settings Menu}, where you can configure shuffle,
257repeat, party mode, skip length and other settings affecting the playback of your music. 221repeat, party mode, skip length and other settings affecting the playback of your music.
258 222
259\subsubsection{Rating} 223\subsubsection{Rating}
260The menu entry is only shown if \setting{Gather Runtime Information} is 224The menu entry is only shown if \setting{Gather Runtime Information} is
@@ -271,19 +235,17 @@ This screen is accessible from the WPS screen, and provides a detailed view of
271all the identity information about the current track. This info is known as 235all the identity information about the current track. This info is known as
272meta data and is stored in audio file formats to keep information on artist, 236meta data and is stored in audio file formats to keep information on artist,
273album etc. To access this screen, % 237album etc. To access this screen, %
274\opt{RECORDER_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IRIVER_H10_PAD,% 238\opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IRIVER_H10_PAD,%
275 SANSA_C200_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}{ 239 SANSA_C200_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD,SANSA_FUZEPLUS_PAD}{
276 press \ActionWpsIdThreeScreen. }% 240 press \ActionWpsIdThreeScreen. }%
277\opt{PLAYER_PAD,ONDIO_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,IAUDIO_M3_PAD,% 241\opt{IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,IAUDIO_M3_PAD,%
278 GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_CLIP_PAD,PBELL_VIBE500_PAD,% 242 GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,SANSA_CLIP_PAD,PBELL_VIBE500_PAD,%
279 MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}% 243 MPIO_HD200_PAD,MPIO_HD300_PAD,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD}%
280 {press \ActionWpsContext{} to access the 244 {press \ActionWpsContext{} to access the
281 \setting{WPS Context Menu} and select \setting{Show Track Info}. } 245 \setting{WPS Context Menu} and select \setting{Show Track Info}. }
282\opt{RECORDER_PAD,PLAYER_PAD,ONDIO_PAD}{Use \ButtonLeft\ and \ButtonRight\
283 to move through the information.}%
284 246
285\subsubsection{Open With...} 247\subsubsection{Open With...}
286This \setting{Open With} function is the same as the \setting{Open With} 248This \setting{Open With} function is the same as the \setting{Open With}
287function in the file browser's \setting{Context Menu}. 249function in the file browser's \setting{Context Menu}.
288 250
289\subsubsection{Delete} 251\subsubsection{Delete}
@@ -294,7 +256,7 @@ This may even be the whole track.
294 256
295\opt{pitchscreen}{ 257\opt{pitchscreen}{
296 \subsubsection{\label{sec:pitchscreen}Pitch} 258 \subsubsection{\label{sec:pitchscreen}Pitch}
297 259
298 The \setting{Pitch Screen} allows you to change the rate of playback 260 The \setting{Pitch Screen} allows you to change the rate of playback
299 (i.e. the playback speed and at the same time the pitch) of your 261 (i.e. the playback speed and at the same time the pitch) of your
300 \dap. The rate value can be adjusted 262 \dap. The rate value can be adjusted
@@ -304,20 +266,20 @@ This may even be the whole track.
304 266
305 The rate can be changed in two modes: procentual and semitone. 267 The rate can be changed in two modes: procentual and semitone.
306 Initially, procentual mode is active. 268 Initially, procentual mode is active.
307 269
308 \opt{swcodec}{ 270 \opt{swcodec}{
309 If you've enabled the \setting{Timestretch} option in 271 If you've enabled the \setting{Timestretch} option in
310 \setting{Sound Settings} and have since rebooted, you can also use 272 \setting{Sound Settings} and have since rebooted, you can also use
311 timestretch mode. This allows you to change the playback speed 273 timestretch mode. This allows you to change the playback speed
312 without affecting the pitch, and vice versa. 274 without affecting the pitch, and vice versa.
313 275
314 In timestretch mode there are separate displays for pitch and 276 In timestretch mode there are separate displays for pitch and
315 speed, and each can be altered independently. Due to the 277 speed, and each can be altered independently. Due to the
316 limitations of the algorithm, speed is limited to be between 35\% 278 limitations of the algorithm, speed is limited to be between 35\%
317 and 250\% of the current pitch value. Pitch must maintain the 279 and 250\% of the current pitch value. Pitch must maintain the
318 same ratio as well as remain between 50\% and 200\%. 280 same ratio as well as remain between 50\% and 200\%.
319 } 281 }
320 282
321 The value of the \opt{swcodec}{rate, pitch and speed}\nopt{swcodec}{rate} 283 The value of the \opt{swcodec}{rate, pitch and speed}\nopt{swcodec}{rate}
322 is not persistent, i.e. after the \dap\ is turned on it will 284 is not persistent, i.e. after the \dap\ is turned on it will
323 always be set to 100\%. \opt{swcodec}{ However, the rate, pitch and speed 285 always be set to 100\%. \opt{swcodec}{ However, the rate, pitch and speed
@@ -386,56 +348,3 @@ This may even be the whole track.
386 } 348 }
387 349
388} 350}
389
390%********************QUICKSCREENS***********************************************
391\opt{RECORDER_PAD}{
392 \section{\label{ref:QuickScreens}Quick Screens}
393 \screenshot{rockbox_interface/images/ss-quick-screen-112x64x1.png}{The F2 quick screen}{}
394 \screenshot{rockbox_interface/images/ss-quick-screen2-112x64x1.png}{The F3 quick screen}{}
395 Rockbox handles function buttons in a different way to the Archos software.
396 \ButtonFOne\ is always bound to the menu function, while \ButtonFTwo\ and
397 \ButtonFThree\ enable two quick screens.
398
399 \ButtonFTwo\ displays some browse and play settings which are likely to be
400 changed frequently. This settings are Shuffle mode, Repeat mode and the Show
401 files options
402
403 Shuffle mode plays each track in the currently playing list in a random order
404 rather than in the order shown in the browser.
405
406 Repeat mode repeats either a single track (One) or the entire playlist (All).
407
408 Show files determines what type files can be seen in the browser. This can be
409 just MP3 files and directories (Music), Playlists, MP3 files and directories
410 (Playlists), any files that Rockbox supports (Supported) or all files on the
411 disk (All).
412
413 See \reference{ref:PlaybackOptions} for more information about these
414 settings.
415
416 \begin{btnmap}
417 \ButtonLeft & Control Shuffle mode setting. \\
418 \ButtonRight & Control Repeat mode setting. \\
419 \ButtonDown & Control Show file setting. \\
420 \end{btnmap}
421
422 \ButtonFThree\ controls frequently used display options.
423
424 Scroll bar turns the display of the Scroll bar on the left of the screen on
425 or off.
426
427 Status bar turns the status display at the top of the screen on or off.
428 Upside down inverts the screen so that the top of the display appears nearest
429 to the buttons. This is sometimes useful when storing the \dap\ in a pocket.
430 Key assignments swap over with the display orientation where it is logical
431 for them to do so.
432
433 See \reference{ref:Displayoptions} for more information about these
434 settings.
435
436 \begin{btnmap}
437 \ButtonLeft & Control scroll bar display. \\
438 \ButtonRight & Control status bar display. \\
439 \ButtonDown & Control upside down screen setting. \\
440 \end{btnmap}
441}
diff --git a/tools/Makefile b/tools/Makefile
index 953577b6d1..d63be9e919 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -10,11 +10,11 @@ LDFLAGS := -g
10 10
11.PHONY: rbspeexenc uclpack 11.PHONY: rbspeexenc uclpack
12 12
13CLEANALL := scramble descramble iriver sh2d bmp2rb rdf2binary convbdf \ 13CLEANALL := scramble descramble iriver bmp2rb rdf2binary convbdf \
14 generate_rocklatin mkboot ipod_fw codepages uclpack mi4 gigabeat lngdump \ 14 generate_rocklatin mkboot ipod_fw codepages uclpack mi4 gigabeat lngdump \
15 telechips gigabeats creative hmac-sha1 rbspeexenc mkzenboot mk500boot convttf 15 telechips gigabeats creative hmac-sha1 rbspeexenc mkzenboot mk500boot convttf
16 16
17all: scramble descramble sh2d rdf2binary mkboot mkzenboot convbdf codepages \ 17all: scramble descramble rdf2binary mkboot mkzenboot convbdf codepages \
18 uclpack rbspeexenc voicefont mk500boot 18 uclpack rbspeexenc voicefont mk500boot
19 19
20scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o \ 20scramble: scramble.o iriver.o mi4.o gigabeat.o gigabeats.o telechips.o \
@@ -36,8 +36,6 @@ iaudio_bl_flash.o: iaudio_bl_flash.c iaudio_bl_flash.h
36iaudio_bl_flash.c iaudio_bl_flash.h: iaudio_bl_flash.bmp bmp2rb 36iaudio_bl_flash.c iaudio_bl_flash.h: iaudio_bl_flash.bmp bmp2rb
37 $(SILENT)./bmp2rb -f 7 -h . $< >iaudio_bl_flash.c 37 $(SILENT)./bmp2rb -f 7 -h . $< >iaudio_bl_flash.c
38 38
39sh2d: sh2d.c
40
41bmp2rb: bmp2rb.c 39bmp2rb: bmp2rb.c
42 $(SILENT)$(CC) -DAPPLICATION_NAME=\"$@\" $(CFLAGS) $+ -o $@ 40 $(SILENT)$(CC) -DAPPLICATION_NAME=\"$@\" $(CFLAGS) $+ -o $@
43 41
@@ -78,10 +76,6 @@ convbdf: convbdf.c
78codepages: codepages.c codepage_tables.c 76codepages: codepages.c codepage_tables.c
79 $(SILENT)$(CC) $(CFLAGS) $+ -o $@ 77 $(SILENT)$(CC) $(CFLAGS) $+ -o $@
80 78
81player_unifont: player_unifont.c ../firmware/drivers/lcd-charset-player.c
82 $(SILENT)$(CC) -DARCHOS_PLAYER -D__PCTOOL__ -I../firmware/export $+ \
83 -o $@
84
85uclpack: 79uclpack:
86 $(SILENT)$(MAKE) -C ucl 80 $(SILENT)$(MAKE) -C ucl
87 81
diff --git a/tools/builds.pm b/tools/builds.pm
index 7b36c6c046..8c2452d168 100644
--- a/tools/builds.pm
+++ b/tools/builds.pm
@@ -20,23 +20,27 @@ $releasenotes="/wiki/ReleaseNotes315";
20%builds = ( 20%builds = (
21 'archosfmrecorder' => { 21 'archosfmrecorder' => {
22 name => 'Archos FM Recorder', 22 name => 'Archos FM Recorder',
23 status => 3, 23 status => 0,
24 ram => 2, 24 ram => 2,
25 release => '3.15',
25 }, 26 },
26 'archosondiofm' => { 27 'archosondiofm' => {
27 name => 'Archos Ondio FM', 28 name => 'Archos Ondio FM',
28 status => 3, 29 status => 0,
29 ram => 2, 30 ram => 2,
31 release => '3.15',
30 }, 32 },
31 'archosondiosp' => { 33 'archosondiosp' => {
32 name => 'Archos Ondio SP', 34 name => 'Archos Ondio SP',
33 status => 3, 35 status => 0,
34 ram => 2, 36 ram => 2,
37 release => '3.15',
35 }, 38 },
36 'archosplayer' => { 39 'archosplayer' => {
37 name => 'Archos Player/Studio', 40 name => 'Archos Player/Studio',
38 status => 3, 41 status => 0,
39 ram => 2, 42 ram => 2,
43 release => '3.15',
40 }, 44 },
41 'archosrecorder' => { 45 'archosrecorder' => {
42 name => 'Archos Recorder v1', 46 name => 'Archos Recorder v1',
@@ -46,9 +50,10 @@ $releasenotes="/wiki/ReleaseNotes315";
46 }, 50 },
47 'archosrecorderv2' => { 51 'archosrecorderv2' => {
48 name => 'Archos Recorder v2', 52 name => 'Archos Recorder v2',
49 status => 3, 53 status => 0,
50 ram => 2, 54 ram => 2,
51 manual => "archosfmrecorder", 55 manual => "archosfmrecorder",
56 release => '3.15',
52 }, 57 },
53 'cowond2' => { 58 'cowond2' => {
54 name => 'Cowon D2', 59 name => 'Cowon D2',
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 6a67f7b51b..b1626f429c 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -691,15 +691,9 @@ sub runone {
691 691
692if(!$exe) { 692if(!$exe) {
693 # not specified, guess! 693 # not specified, guess!
694 if($target =~ /(recorder|ondio)/i) { 694 if($target =~ /iriver/i) {
695 $exe = "ajbrec.ajz";
696 }
697 elsif($target =~ /iriver/i) {
698 $exe = "rockbox.iriver"; 695 $exe = "rockbox.iriver";
699 } 696 }
700 else {
701 $exe = "archos.mod";
702 }
703} 697}
704elsif(($exe =~ /rockboxui/)) { 698elsif(($exe =~ /rockboxui/)) {
705 # simulator, exclude the exe file 699 # simulator, exclude the exe file
diff --git a/tools/configure b/tools/configure
index 501482ea0e..b4a7910397 100755
--- a/tools/configure
+++ b/tools/configure
@@ -496,14 +496,6 @@ EOF
496# the gcc version should most likely match what versions we build with 496# the gcc version should most likely match what versions we build with
497# rockboxdev.sh 497# rockboxdev.sh
498# 498#
499shcc () {
500 prefixtools sh-elf-
501 GCCOPTS="$CCOPTS -m1"
502 GCCOPTIMIZE="-fomit-frame-pointer -fschedule-insns"
503 endian="big"
504 gccchoice="4.0.3"
505}
506
507calmrisccc () { 499calmrisccc () {
508 prefixtools calmrisc16-unknown-elf- 500 prefixtools calmrisc16-unknown-elf-
509 GCCOPTS="-Wl\,--no-check-sections $CCOPTS" 501 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
@@ -927,12 +919,6 @@ whichadvanced () {
927 printf "Enter your developer options (press only enter when done)\n\ 919 printf "Enter your developer options (press only enter when done)\n\
928(D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,\n\ 920(D)EBUG, (L)ogf, Boot(c)hart, (S)imulator, (P)rofiling, (V)oice, (W)in32 crosscompile,\n\
929Win(6)4 crosscompile, (T)est plugins, S(m)all C lib, Logf to Ser(i)al port:" 921Win(6)4 crosscompile, (T)est plugins, S(m)all C lib, Logf to Ser(i)al port:"
930 if [ "$modelname" = "archosplayer" ]; then
931 printf ", Use (A)TA poweroff"
932 fi
933 if [ "$t_model" = "ondio" ]; then
934 printf ", (B)acklight MOD"
935 fi
936 if [ "$modelname" = "iaudiom5" ]; then 922 if [ "$modelname" = "iaudiom5" ]; then
937 printf ", (F)M radio MOD" 923 printf ", (F)M radio MOD"
938 fi 924 fi
@@ -998,18 +984,6 @@ Win(6)4 crosscompile, (T)est plugins, S(m)all C lib, Logf to Ser(i)al port:"
998 echo "Voice build selected" 984 echo "Voice build selected"
999 voice="yes" 985 voice="yes"
1000 ;; 986 ;;
1001 [Aa])
1002 if [ "$modelname" = "archosplayer" ]; then
1003 have_ata_poweroff="#define HAVE_ATA_POWER_OFF"
1004 echo "ATA power off enabled"
1005 fi
1006 ;;
1007 [Bb])
1008 if [ "$t_model" = "ondio" ]; then
1009 have_backlight="#define HAVE_BACKLIGHT"
1010 echo "Backlight functions enabled"
1011 fi
1012 ;;
1013 [Ff]) 987 [Ff])
1014 if [ "$modelname" = "iaudiom5" ]; then 988 if [ "$modelname" = "iaudiom5" ]; then
1015 have_fmradio_in="#define HAVE_FMRADIO_IN" 989 have_fmradio_in="#define HAVE_FMRADIO_IN"
@@ -1076,7 +1050,6 @@ Win(6)4 crosscompile, (T)est plugins, S(m)all C lib, Logf to Ser(i)al port:"
1076 if [ "yes" = "$simulator" ]; then 1050 if [ "yes" = "$simulator" ]; then
1077 debug="-DDEBUG" 1051 debug="-DDEBUG"
1078 extradefines="$extradefines -DSIMULATOR -DHAVE_TEST_PLUGINS" 1052 extradefines="$extradefines -DSIMULATOR -DHAVE_TEST_PLUGINS"
1079 archosrom=""
1080 flash="" 1053 flash=""
1081 fi 1054 fi
1082 if [ "yes" = "$profile" ]; then 1055 if [ "yes" = "$profile" ]; then
@@ -1572,13 +1545,13 @@ if [ "$ARG_TARGET" ]; then
1572else 1545else
1573 echo "Enter target platform:" 1546 echo "Enter target platform:"
1574cat <<EOF 1547cat <<EOF
1575 ==Archos== ==iriver== ==Apple iPod== 1548 ==iriver== ==Apple iPod==
1576 0) Player/Studio 10) H120/H140 20) Color/Photo 1549 10) H120/H140 20) Color/Photo
1577 1) Recorder 11) H320/H340 21) Nano 1G 1550 11) H320/H340 21) Nano 1G
1578 2) FM Recorder 12) iHP-100/110/115 22) Video 1551 12) iHP-100/110/115 22) Video
1579 3) Recorder v2 13) iFP-790 23) 3G 1552 13) iFP-790 23) 3G
1580 4) Ondio SP 14) H10 20Gb 24) 4G Grayscale 1553 14) H10 20Gb 24) 4G Grayscale
1581 5) Ondio FM 15) H10 5/6Gb 25) Mini 1G 1554 15) H10 5/6Gb 25) Mini 1G
1582 26) Mini 2G 1555 26) Mini 2G
1583 ==Toshiba== 27) 1G, 2G 1556 ==Toshiba== 27) 1G, 2G
1584 ==Cowon/iAudio== 40) Gigabeat F/X 28) Nano 2G 1557 ==Cowon/iAudio== 40) Gigabeat F/X 28) Nano 2G
@@ -1641,7 +1614,6 @@ fi
1641 toolset="rdf2binary convbdf codepages" 1614 toolset="rdf2binary convbdf codepages"
1642 1615
1643 # Toolsets for some target families: 1616 # Toolsets for some target families:
1644 archosbitmaptools="$toolset scramble descramble sh2d uclpack bmp2rb"
1645 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb" 1617 iriverbitmaptools="$toolset scramble descramble mkboot bmp2rb"
1646 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb" 1618 iaudiobitmaptools="$toolset scramble descramble mkboot bmp2rb"
1647 ipodbitmaptools="$toolset scramble bmp2rb" 1619 ipodbitmaptools="$toolset scramble bmp2rb"
@@ -1673,8 +1645,6 @@ fi
1673 # $output) 1645 # $output)
1674 # appextra: passed to the APPEXTRA variable in the Makefiles. 1646 # appextra: passed to the APPEXTRA variable in the Makefiles.
1675 # TODO: add proper explanation 1647 # TODO: add proper explanation
1676 # archosrom: used only for Archos targets that build a special flashable .ucl
1677 # image.
1678 # flash: name of output for flashing, for targets where there's a special 1648 # flash: name of output for flashing, for targets where there's a special
1679 # file output for this. 1649 # file output for this.
1680 # plugins: set to 'yes' to build the plugins. Early development builds can 1650 # plugins: set to 'yes' to build the plugins. Early development builds can
@@ -1691,140 +1661,6 @@ fi
1691 1661
1692 case $buildfor in 1662 case $buildfor in
1693 1663
1694 0|archosplayer)
1695 target_id=1
1696 modelname="archosplayer"
1697 target="ARCHOS_PLAYER"
1698 shcc
1699 tool="$rootdir/tools/scramble"
1700 output="archos.mod"
1701 appextra="player:gui"
1702 #archosrom="$pwd/rombox.ucl"
1703 flash="$pwd/rockbox.ucl"
1704 plugins="yes"
1705 swcodec=""
1706
1707 # toolset is the tools within the tools directory that we build for
1708 # this particular target.
1709 toolset="$toolset scramble descramble sh2d player_unifont uclpack"
1710
1711 # Note: the convbdf is present in the toolset just because: 1) the
1712 # firmware/Makefile assumes it is present always, and 2) we will need it when we
1713 # build the player simulator
1714
1715 t_cpu="sh"
1716 t_manufacturer="archos"
1717 t_model="player"
1718 ;;
1719
1720 1|archosrecorder)
1721 target_id=2
1722 modelname="archosrecorder"
1723 target="ARCHOS_RECORDER"
1724 shcc
1725 tool="$rootdir/tools/scramble"
1726 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1727 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1728 output="ajbrec.ajz"
1729 appextra="recorder:gui:radio"
1730 #archosrom="$pwd/rombox.ucl"
1731 flash="$pwd/rockbox.ucl"
1732 plugins="yes"
1733 swcodec=""
1734 # toolset is the tools within the tools directory that we build for
1735 # this particular target.
1736 toolset=$archosbitmaptools
1737 t_cpu="sh"
1738 t_manufacturer="archos"
1739 t_model="recorder"
1740 ;;
1741
1742 2|archosfmrecorder)
1743 target_id=3
1744 modelname="archosfmrecorder"
1745 target="ARCHOS_FMRECORDER"
1746 shcc
1747 tool="$rootdir/tools/scramble -fm"
1748 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1749 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1750 output="ajbrec.ajz"
1751 appextra="recorder:gui:radio"
1752 #archosrom="$pwd/rombox.ucl"
1753 flash="$pwd/rockbox.ucl"
1754 plugins="yes"
1755 swcodec=""
1756 # toolset is the tools within the tools directory that we build for
1757 # this particular target.
1758 toolset=$archosbitmaptools
1759 t_cpu="sh"
1760 t_manufacturer="archos"
1761 t_model="fm_v2"
1762 ;;
1763
1764 3|archosrecorderv2)
1765 target_id=4
1766 modelname="archosrecorderv2"
1767 target="ARCHOS_RECORDERV2"
1768 shcc
1769 tool="$rootdir/tools/scramble -v2"
1770 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1771 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1772 output="ajbrec.ajz"
1773 appextra="recorder:gui:radio"
1774 #archosrom="$pwd/rombox.ucl"
1775 flash="$pwd/rockbox.ucl"
1776 plugins="yes"
1777 swcodec=""
1778 # toolset is the tools within the tools directory that we build for
1779 # this particular target.
1780 toolset=$archosbitmaptools
1781 t_cpu="sh"
1782 t_manufacturer="archos"
1783 t_model="fm_v2"
1784 ;;
1785
1786 4|archosondiosp)
1787 target_id=7
1788 modelname="archosondiosp"
1789 target="ARCHOS_ONDIOSP"
1790 shcc
1791 tool="$rootdir/tools/scramble -osp"
1792 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1793 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1794 output="ajbrec.ajz"
1795 appextra="recorder:gui:radio"
1796 #archosrom="$pwd/rombox.ucl"
1797 flash="$pwd/rockbox.ucl"
1798 plugins="yes"
1799 swcodec=""
1800 # toolset is the tools within the tools directory that we build for
1801 # this particular target.
1802 toolset=$archosbitmaptools
1803 t_cpu="sh"
1804 t_manufacturer="archos"
1805 t_model="ondio"
1806 ;;
1807
1808 5|archosondiofm)
1809 target_id=8
1810 modelname="archosondiofm"
1811 target="ARCHOS_ONDIOFM"
1812 shcc
1813 tool="$rootdir/tools/scramble -ofm"
1814 bmp2rb_mono="$rootdir/tools/bmp2rb -f 0"
1815 bmp2rb_native="$rootdir/tools/bmp2rb -f 0"
1816 output="ajbrec.ajz"
1817 appextra="recorder:gui:radio"
1818 #archosrom="$pwd/rombox.ucl"
1819 flash="$pwd/rockbox.ucl"
1820 plugins="yes"
1821 swcodec=""
1822 toolset=$archosbitmaptools
1823 t_cpu="sh"
1824 t_manufacturer="archos"
1825 t_model="ondio"
1826 ;;
1827
1828 10|iriverh120) 1664 10|iriverh120)
1829 target_id=9 1665 target_id=9
1830 modelname="iriverh120" 1666 modelname="iriverh120"
@@ -4529,21 +4365,14 @@ fi
4529 echo "sansa eraser build selected" 4365 echo "sansa eraser build selected"
4530 ;; 4366 ;;
4531 [Bb]) 4367 [Bb])
4532 if test $t_manufacturer = "archos"; then 4368 appsdir='$(ROOTDIR)/bootloader'
4533 # Archos SH-based players do this somewhat differently for 4369 apps="bootloader"
4534 # some reason 4370 flash=""
4535 appsdir='$(ROOTDIR)/flash/bootbox' 4371 if test -n "$boottool"; then
4536 apps="bootbox" 4372 tool="$boottool"
4537 else 4373 fi
4538 appsdir='$(ROOTDIR)/bootloader' 4374 if test -n "$bootoutput"; then
4539 apps="bootloader" 4375 output=$bootoutput
4540 flash=""
4541 if test -n "$boottool"; then
4542 tool="$boottool"
4543 fi
4544 if test -n "$bootoutput"; then
4545 output=$bootoutput
4546 fi
4547 fi 4376 fi
4548 extradefines="$extradefines -DBOOTLOADER -ffunction-sections -fdata-sections" 4377 extradefines="$extradefines -DBOOTLOADER -ffunction-sections -fdata-sections"
4549 bootloader="1" 4378 bootloader="1"
@@ -4557,7 +4386,6 @@ fi
4557 debug="-DDEBUG" 4386 debug="-DDEBUG"
4558 simulator="yes" 4387 simulator="yes"
4559 extradefines="$extradefines -DSIMULATOR -DHAVE_TEST_PLUGINS" 4388 extradefines="$extradefines -DSIMULATOR -DHAVE_TEST_PLUGINS"
4560 archosrom=""
4561 flash="" 4389 flash=""
4562 echo "Simulator build selected" 4390 echo "Simulator build selected"
4563 ;; 4391 ;;
@@ -4588,7 +4416,6 @@ fi
4588 extradefines="$extradefines -DDEBUG" 4416 extradefines="$extradefines -DDEBUG"
4589 appsdir='$(ROOTDIR)/tools/checkwps'; 4417 appsdir='$(ROOTDIR)/tools/checkwps';
4590 output='checkwps.'${modelname}; 4418 output='checkwps.'${modelname};
4591 archosrom='';
4592 echo "CheckWPS build selected" 4419 echo "CheckWPS build selected"
4593 ;; 4420 ;;
4594 [Dd]) 4421 [Dd])
@@ -4596,7 +4423,6 @@ fi
4596 simcc "database-sdl" 4423 simcc "database-sdl"
4597 toolset=''; 4424 toolset='';
4598 appsdir='$(ROOTDIR)/tools/database'; 4425 appsdir='$(ROOTDIR)/tools/database';
4599 archosrom='';
4600 4426
4601 case $uname in 4427 case $uname in
4602 CYGWIN*|MINGW*) 4428 CYGWIN*|MINGW*)
@@ -4620,7 +4446,6 @@ fi
4620 GCCOPTS=''; 4446 GCCOPTS='';
4621 extradefines="$extradefines -DDEBUG" 4447 extradefines="$extradefines -DDEBUG"
4622 output='warble.'${modelname}; 4448 output='warble.'${modelname};
4623 archosrom='';
4624 echo "Warble build selected" 4449 echo "Warble build selected"
4625 ;; 4450 ;;
4626 *) 4451 *)
@@ -4636,9 +4461,6 @@ fi
4636 esac 4461 esac
4637 # to be able running "make manual" from non-manual configuration 4462 # to be able running "make manual" from non-manual configuration
4638 case $modelname in 4463 case $modelname in
4639 archosrecorderv2)
4640 manualdev="archosfmrecorder"
4641 ;;
4642 iriverh1??) 4464 iriverh1??)
4643 manualdev="iriverh100" 4465 manualdev="iriverh100"
4644 ;; 4466 ;;
@@ -4766,30 +4588,15 @@ echo "Using $LD $ldver"
4766makever=`make --version | head -1` 4588makever=`make --version | head -1`
4767echo "Detected make $makever" 4589echo "Detected make $makever"
4768 4590
4769# check the compiler for SH platforms
4770if test "$CC" = "sh-elf-gcc"; then
4771 if test "$gccnum" -lt "400"; then
4772 echo "WARNING: Consider upgrading your compiler to the 4.0.X series!"
4773 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
4774 else
4775 # figure out patch status
4776 gccpatch=`$CC --version`;
4777
4778 if { echo $gccpatch | grep "rockbox" >/dev/null 2>&1; } then
4779 echo "gcc $gccver is rockbox patched"
4780 # then convert -O to -Os to get smaller binaries!
4781 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
4782 else
4783 echo "WARNING: You use an unpatched gcc compiler: $gccver"
4784 echo "WARNING: http://www.rockbox.org/twiki/bin/view/Main/CrossCompiler"
4785 fi
4786 fi
4787fi
4788
4789if test "$CC" = "m68k-elf-gcc"; then 4591if test "$CC" = "m68k-elf-gcc"; then
4790 # convert -O to -Os to get smaller binaries! 4592 # convert -O to -Os to get smaller binaries!
4791 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'` 4593 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
4792fi 4594fi
4595if test "$CC" = "mipsel-elf-gcc"; then
4596 # convert -O to -Os to get smaller binaries!
4597 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
4598fi
4599
4793 4600
4794if [ "$ARG_CCACHE" = "1" ]; then 4601if [ "$ARG_CCACHE" = "1" ]; then
4795 echo "Enable ccache for building" 4602 echo "Enable ccache for building"
@@ -5025,7 +4832,6 @@ export DOCSDIR=${rootdir}/docs
5025export MANUALDIR=${rootdir}/manual 4832export MANUALDIR=${rootdir}/manual
5026export DEBUG=${debug} 4833export DEBUG=${debug}
5027export MODELNAME=${modelname} 4834export MODELNAME=${modelname}
5028export ARCHOSROM=${archosrom}
5029export FLASHFILE=${flash} 4835export FLASHFILE=${flash}
5030export TARGET_ID=${target_id} 4836export TARGET_ID=${target_id}
5031export TARGET=-D${target} 4837export TARGET=-D${target}
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh
index 4123790ce6..bf50faf214 100755
--- a/tools/rockboxdev.sh
+++ b/tools/rockboxdev.sh
@@ -700,7 +700,6 @@ fi
700 700
701if [ -z "$RBDEV_TARGET" ]; then 701if [ -z "$RBDEV_TARGET" ]; then
702 echo "Select target arch:" 702 echo "Select target arch:"
703 echo "s - sh (Archos models)"
704 echo "m - m68k (iriver h1x0/h3x0, iaudio m3/m5/x5 and mpio hd200)" 703 echo "m - m68k (iriver h1x0/h3x0, iaudio m3/m5/x5 and mpio hd200)"
705 echo "a - arm (ipods, iriver H10, Sansa, D2, Gigabeat, etc)" 704 echo "a - arm (ipods, iriver H10, Sansa, D2, Gigabeat, etc)"
706 echo "i - mips (Jz47xx and ATJ-based players)" 705 echo "i - mips (Jz47xx and ATJ-based players)"
@@ -724,15 +723,6 @@ do
724 export MAKEFLAGS=`echo $MAKEFLAGS| sed 's/ -r / /'` # We don't want -r 723 export MAKEFLAGS=`echo $MAKEFLAGS| sed 's/ -r / /'` # We don't want -r
725 echo "" 724 echo ""
726 case $arch in 725 case $arch in
727 [Ss])
728 # For binutils 2.16.1 builtin rules conflict on some systems with a
729 # default rule for Objective C. Disable the builtin make rules. See
730 # http://sourceware.org/ml/binutils/2005-12/msg00259.html
731 export MAKEFLAGS="-r $MAKEFLAGS"
732 build "binutils" "sh-elf" "2.16.1" "binutils-2.16.1-texinfo-fix.diff" "--disable-werror"
733 build "gcc" "sh-elf" "4.0.3" "gcc-4.0.3-rockbox-1.diff"
734 ;;
735
736 [Ii]) 726 [Ii])
737 build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror" 727 build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror"
738 build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc" 728 build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc"
diff --git a/tools/root.make b/tools/root.make
index 412dbbc97b..b588e0f8b1 100644
--- a/tools/root.make
+++ b/tools/root.make
@@ -14,7 +14,7 @@ DEFINES = -DROCKBOX -DMEMORYSIZE=$(MEMORYSIZE) $(TARGET) \
14 $(EXTRA_DEFINES) # <-- -DSIMULATOR or not 14 $(EXTRA_DEFINES) # <-- -DSIMULATOR or not
15INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC) 15INCLUDES = -I$(BUILDDIR) -I$(BUILDDIR)/lang $(TARGET_INC)
16 16
17CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS) 17CFLAGS = $(INCLUDES) $(DEFINES) $(GCCOPTS)
18PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix 18PPCFLAGS = $(filter-out -g -Dmain=SDL_main,$(CFLAGS)) # cygwin sdl-config fix
19ASMFLAGS = -D__ASSEMBLER__ # work around gcc 3.4.x bug with -std=gnu99, only meant for .S files 19ASMFLAGS = -D__ASSEMBLER__ # work around gcc 3.4.x bug with -std=gnu99, only meant for .S files
20CORE_LDOPTS = $(GLOBAL_LDOPTS) # linker ops specifically for core build 20CORE_LDOPTS = $(GLOBAL_LDOPTS) # linker ops specifically for core build
@@ -24,9 +24,6 @@ TOOLS = $(TOOLSDIR)/rdf2binary $(TOOLSDIR)/convbdf \
24 $(TOOLSDIR)/uclpack $(TOOLSDIR)/mkboot $(TOOLSDIR)/iaudio_bl_flash.c \ 24 $(TOOLSDIR)/uclpack $(TOOLSDIR)/mkboot $(TOOLSDIR)/iaudio_bl_flash.c \
25 $(TOOLSDIR)/iaudio_bl_flash.h 25 $(TOOLSDIR)/iaudio_bl_flash.h
26 26
27ifeq ($(MODELNAME),archosplayer)
28 TOOLS += $(TOOLSDIR)/player_unifont
29endif
30 27
31ifeq (,$(PREFIX)) 28ifeq (,$(PREFIX))
32ifdef APP_TYPE 29ifdef APP_TYPE
@@ -110,8 +107,6 @@ ifneq (,$(findstring bootloader,$(APPSDIR)))
110 else 107 else
111 include $(APPSDIR)/bootloader.make 108 include $(APPSDIR)/bootloader.make
112 endif 109 endif
113else ifneq (,$(findstring bootbox,$(APPSDIR)))
114 include $(APPSDIR)/bootbox.make
115else ifneq (,$(findstring checkwps,$(APP_TYPE))) 110else ifneq (,$(findstring checkwps,$(APP_TYPE)))
116 include $(APPSDIR)/checkwps.make 111 include $(APPSDIR)/checkwps.make
117 include $(ROOTDIR)/lib/skin_parser/skin_parser.make 112 include $(ROOTDIR)/lib/skin_parser/skin_parser.make
@@ -182,7 +177,7 @@ OBJ := $(OBJ:.S=.o)
182OBJ += $(BMP:.bmp=.o) 177OBJ += $(BMP:.bmp=.o)
183OBJ := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(OBJ)) 178OBJ := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(OBJ))
184 179
185build: $(TOOLS) $(BUILDDIR)/$(BINARY) $(CODECS) $(ROCKS) $(ARCHOSROM) $(RBINFO) 180build: $(TOOLS) $(BUILDDIR)/$(BINARY) $(CODECS) $(ROCKS) $(RBINFO)
186 181
187$(RBINFO): $(BUILDDIR)/$(BINARY) 182$(RBINFO): $(BUILDDIR)/$(BINARY)
188 $(SILENT)echo Creating $(@F) 183 $(SILENT)echo Creating $(@F)
@@ -215,7 +210,7 @@ clean::
215 rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids \ 210 rockbox-manual*.zip sysfont.h rockbox-info.txt voicefontids \
216 *.wav *.mp3 *.voice $(CLEANOBJS) \ 211 *.wav *.mp3 *.voice $(CLEANOBJS) \
217 $(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin \ 212 $(LINKRAM) $(LINKROM) rockbox.elf rockbox.map rockbox.bin \
218 make.dep rombox.elf rombox.map rombox.bin rombox.ucl romstart.txt \ 213 make.dep rombox.elf rombox.map rombox.bin romstart.txt \
219 $(BINARY) $(FLASHFILE) uisimulator bootloader flash $(BOOTLINK) \ 214 $(BINARY) $(FLASHFILE) uisimulator bootloader flash $(BOOTLINK) \
220 rockbox.apk lang_enum.h rbversion.h 215 rockbox.apk lang_enum.h rbversion.h
221 216
@@ -273,37 +268,8 @@ $(BUILDDIR)/rockbox.bin : $(BUILDDIR)/rockbox.elf
273$(BUILDDIR)/rombox.bin : $(BUILDDIR)/rombox.elf 268$(BUILDDIR)/rombox.bin : $(BUILDDIR)/rombox.elf
274 $(call PRINTS,OC $(@F))$(call objcopy,$<,$@) 269 $(call PRINTS,OC $(@F))$(call objcopy,$<,$@)
275 270
276#
277# If there's a flashfile defined for this target (rockbox.ucl for Archos
278# models) Then check if the mkfirmware script fails, as then it is (likely)
279# because the image is too big and we need to create a compressed image
280# instead.
281#
282$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/rockbox.bin $(FLASHFILE) 271$(BUILDDIR)/$(BINARY) : $(BUILDDIR)/rockbox.bin $(FLASHFILE)
283 $(call PRINTS,SCRAMBLE $(notdir $@))($(MKFIRMWARE) $< $@; \ 272 $(call PRINTS,SCRAMBLE $(notdir $@)) $(MKFIRMWARE) $< $@
284 stat=$$?; \
285 if test -n "$(FLASHFILE)"; then \
286 if test "$$stat" -ne 0; then \
287 echo "Image too big, making a compressed version!"; \
288 $(MAKE) -C $(FIRMDIR)/decompressor OBJDIR=$(BUILDDIR)/firmware/decompressor; \
289 $(MKFIRMWARE) $(BUILDDIR)/firmware/decompressor/compressed.bin $@; \
290 fi \
291 fi )
292
293# archos
294$(BUILDDIR)/rockbox.ucl: $(BUILDDIR)/rockbox.bin
295 $(call PRINTS,UCLPACK $(@F))$(TOOLSDIR)/uclpack --best --2e -b1048576 $< $@ >/dev/null
296
297MAXINFILE = $(BUILDDIR)/temp.txt
298MAXOUTFILE = $(BUILDDIR)/romstart.txt
299
300$(BUILDDIR)/rombox.ucl: $(BUILDDIR)/rombox.bin $(MAXOUTFILE)
301 $(call PRINTS,UCLPACK $(@F))$(TOOLSDIR)/uclpack --none $< $@ >/dev/null; \
302 perl $(TOOLSDIR)/romsizetest.pl `cat $(MAXOUTFILE)` $<; \
303 if test $$? -ne 0; then \
304 echo "removing UCL file again, making it a fake one"; \
305 echo "fake" > $@; \
306 fi
307 273
308$(MAXOUTFILE): 274$(MAXOUTFILE):
309 $(call PRINTS,Creating $(@F)) 275 $(call PRINTS,Creating $(@F))
@@ -343,7 +309,7 @@ endif
343mapzip: 309mapzip:
344 $(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip 310 $(SILENT)find . -name "*.map" | xargs zip rockbox-maps.zip
345 311
346elfzip: 312elfzip:
347 $(SILENT)find . -name "*.elf" | xargs zip rockbox-elfs.zip 313 $(SILENT)find . -name "*.elf" | xargs zip rockbox-elfs.zip
348 314
349fullzip: 315fullzip:
diff --git a/tools/scramble.c b/tools/scramble.c
index 7aa468ebaa..3b9497186d 100644
--- a/tools/scramble.c
+++ b/tools/scramble.c
@@ -36,24 +36,6 @@ static int iaudio_encode(char *iname, char *oname, char *idstring);
36static int ipod_encode(char *iname, char *oname, int fw_ver, bool fake_rsrc); 36static int ipod_encode(char *iname, char *oname, int fw_ver, bool fake_rsrc);
37static int ccpmp_encode(char *iname, char *oname); 37static int ccpmp_encode(char *iname, char *oname);
38 38
39enum
40{
41 ARCHOS_PLAYER, /* and V1 recorder */
42 ARCHOS_V2RECORDER,
43 ARCHOS_FMRECORDER,
44 ARCHOS_ONDIO_SP,
45 ARCHOS_ONDIO_FM
46};
47
48static unsigned int size_limit[] =
49{
50 0x32000, /* ARCHOS_PLAYER */
51 0x64000, /* ARCHOS_V2RECORDER */
52 0x64000, /* ARCHOS_FMRECORDER */
53 0x64000, /* ARCHOS_ONDIO_SP */
54 0x64000 /* ARCHOS_ONDIO_FM */
55};
56
57void short2le(unsigned short val, unsigned char* addr) 39void short2le(unsigned short val, unsigned char* addr)
58{ 40{
59 addr[0] = val & 0xFF; 41 addr[0] = val & 0xFF;
@@ -91,14 +73,9 @@ void short2be(unsigned short val, unsigned char* addr)
91 73
92void usage(void) 74void usage(void)
93{ 75{
94 printf("usage: scramble [options] <input file> <output file> [xor string]\n"); 76 printf("usage: scramble [options] <input file> <output file>\n");
95 printf("options:\n" 77 printf("options:\n"
96 "\t-fm Archos FM recorder format\n"
97 "\t-v2 Archos V2 recorder format\n"
98 "\t-ofm Archos Ondio FM recorder format\n"
99 "\t-osp Archos Ondio SP format\n"
100 "\t-neo SSI Neo format\n" 78 "\t-neo SSI Neo format\n"
101 "\t-mm=X Archos Multimedia format (X values: A=JBMM, B=AV1xx, C=AV3xx)\n"
102 "\t-iriver iRiver format\n" 79 "\t-iriver iRiver format\n"
103 "\t-iaudiox5 iAudio X5 format\n" 80 "\t-iaudiox5 iAudio X5 format\n"
104 "\t-iaudiox5v iAudio X5V format\n" 81 "\t-iaudiox5v iAudio X5V format\n"
@@ -131,87 +108,38 @@ void usage(void)
131 "\t ip6g, rk27, clzp, zxf2, zxf3, fuz+, e370, e360,\n" 108 "\t ip6g, rk27, clzp, zxf2, zxf3, fuz+, e370, e360,\n"
132 "\t zxfi, zmoz, zen, zenv, ypz5, zxfs, e450, e460,\n" 109 "\t zxfi, zmoz, zen, zenv, ypz5, zxfs, e450, e460,\n"
133 "\t e470, e580, a10, a20, a860, s750, e350, xdx3)\n"); 110 "\t e470, e580, a10, a20, a860, s750, e350, xdx3)\n");
134 printf("\nNo option results in Archos standard player/recorder format.\n"); 111 printf("\nNo option results in nothing being done.\n");
135 112
136 exit(1); 113 exit(1);
137} 114}
138 115
139int main (int argc, char** argv) 116int main (int argc, char** argv)
140{ 117{
141 unsigned long length,i,slen=0; 118 unsigned long length,i;
142 unsigned char *inbuf,*outbuf; 119 unsigned char *inbuf,*outbuf;
143 unsigned short crc=0; 120 unsigned short crc=0;
144 unsigned long chksum=0; /* 32 bit checksum */ 121 unsigned long chksum=0; /* 32 bit checksum */
145 unsigned char header[24]; 122 unsigned char header[24];
146 char *iname = argv[1]; 123 char *iname = argv[1];
147 char *oname = argv[2]; 124 char *oname = argv[2];
148 char *xorstring=NULL;
149 int headerlen = 6; 125 int headerlen = 6;
150 FILE* file; 126 FILE* file;
151 int version=0; 127 int version=0;
152 unsigned long modelnum; 128 unsigned long modelnum;
153 char modelname[5]; 129 char modelname[5];
154 int model_id; 130 enum { none, tcc_sum, tcc_crc, rkw, add } method = none;
155 enum { none, scramble, xor, tcc_sum, tcc_crc, rkw, add } method = scramble;
156 bool creative_enable_ciff; 131 bool creative_enable_ciff;
157 132
158 model_id = ARCHOS_PLAYER;
159
160 if (argc < 3) { 133 if (argc < 3) {
161 usage(); 134 usage();
162 } 135 }
163 136
164 if(!strcmp(argv[1], "-fm")) {
165 headerlen = 24;
166 iname = argv[2];
167 oname = argv[3];
168 version = 4;
169 model_id = ARCHOS_FMRECORDER;
170 }
171
172 else if(!strcmp(argv[1], "-v2")) {
173 headerlen = 24;
174 iname = argv[2];
175 oname = argv[3];
176 version = 2;
177 model_id = ARCHOS_V2RECORDER;
178 }
179
180 else if(!strcmp(argv[1], "-ofm")) {
181 headerlen = 24;
182 iname = argv[2];
183 oname = argv[3];
184 version = 8;
185 model_id = ARCHOS_ONDIO_FM;
186 }
187
188 else if(!strcmp(argv[1], "-osp")) {
189 headerlen = 24;
190 iname = argv[2];
191 oname = argv[3];
192 version = 16;
193 model_id = ARCHOS_ONDIO_SP;
194 }
195
196 else if(!strcmp(argv[1], "-neo")) { 137 else if(!strcmp(argv[1], "-neo")) {
197 headerlen = 17; 138 headerlen = 17;
198 iname = argv[2]; 139 iname = argv[2];
199 oname = argv[3]; 140 oname = argv[3];
200 method = none; 141 method = none;
201 } 142 }
202 else if(!strncmp(argv[1], "-mm=", 4)) {
203 headerlen = 16;
204 iname = argv[2];
205 oname = argv[3];
206 method = xor;
207 version = argv[1][4];
208 if (argc > 4)
209 xorstring = argv[4];
210 else {
211 printf("Multimedia needs an xor string\n");
212 return -1;
213 }
214 }
215 else if(!strncmp(argv[1], "-tcc=", 4)) { 143 else if(!strncmp(argv[1], "-tcc=", 4)) {
216 headerlen = 0; 144 headerlen = 0;
217 iname = argv[2]; 145 iname = argv[2];
@@ -554,20 +482,10 @@ int main (int argc, char** argv)
554 length = ftell(file); 482 length = ftell(file);
555 length = (length + 3) & ~3; /* Round up to nearest 4 byte boundary */ 483 length = (length + 3) & ~3; /* Round up to nearest 4 byte boundary */
556 484
557 if ((method == scramble) &&
558 ((length + headerlen) >= size_limit[model_id])) {
559 printf("error: firmware image is %ld bytes while max size is %u!\n",
560 length + headerlen,
561 size_limit[model_id]);
562 fclose(file);
563 return -1;
564 }
565 485
566 fseek(file,0,SEEK_SET); 486 fseek(file,0,SEEK_SET);
567 inbuf = malloc(length); 487 inbuf = malloc(length);
568 if (method == xor) 488 if(method == add)
569 outbuf = malloc(length*2);
570 else if(method == add)
571 outbuf = malloc(length + 8); 489 outbuf = malloc(length + 8);
572 else 490 else
573 outbuf = malloc(length); 491 outbuf = malloc(length);
@@ -597,32 +515,13 @@ int main (int argc, char** argv)
597 chksum += inbuf[i]; 515 chksum += inbuf[i];
598 } 516 }
599 break; 517 break;
600 case scramble:
601 slen = length/4;
602 for (i = 0; i < length; i++) {
603 unsigned long addr = (i >> 2) + ((i % 4) * slen);
604 unsigned char data = inbuf[i];
605 data = ~((data << 1) | ((data >> 7) & 1)); /* poor man's ROL */
606 outbuf[addr] = data;
607 }
608 break;
609
610 case xor:
611 /* "compress" */
612 slen = 0;
613 for (i=0; i<length; i++) {
614 if (!(i&7))
615 outbuf[slen++] = 0xff; /* all data is uncompressed */
616 outbuf[slen++] = inbuf[i];
617 }
618 break;
619 case none: 518 case none:
620 default: 519 default:
621 /* dummy case just to silence picky compilers */ 520 /* dummy case just to silence picky compilers */
622 break; 521 break;
623 } 522 }
624 523
625 if((method == none) || (method == scramble) || (method == xor)) { 524 if(method == none) {
626 /* calculate checksum */ 525 /* calculate checksum */
627 for (i=0;i<length;i++) 526 for (i=0;i<length;i++)
628 crc += inbuf[i]; 527 crc += inbuf[i];
@@ -650,50 +549,6 @@ int main (int argc, char** argv)
650 telechips_encode_crc(outbuf, length); 549 telechips_encode_crc(outbuf, length);
651 break; 550 break;
652 551
653 case scramble:
654 if (headerlen == 6) {
655 int2be(length, header);
656 header[4] = (crc >> 8) & 0xff;
657 header[5] = crc & 0xff;
658 }
659 else {
660 header[0] =
661 header[1] =
662 header[2] =
663 header[3] = 0xff; /* ??? */
664
665 header[6] = (crc >> 8) & 0xff;
666 header[7] = crc & 0xff;
667
668 header[11] = version;
669
670 header[15] = headerlen; /* really? */
671
672 int2be(length, &header[20]);
673 }
674 break;
675
676 case xor:
677 {
678 int xorlen = strlen(xorstring);
679
680 /* xor data */
681 for (i=0; i<slen; i++)
682 outbuf[i] ^= xorstring[i & (xorlen-1)];
683
684 /* calculate checksum */
685 for (i=0; i<slen; i++)
686 crc += outbuf[i];
687
688 header[0] = header[2] = 'Z';
689 header[1] = header[3] = version;
690 int2le(length, &header[4]);
691 int2le(slen, &header[8]);
692 int2le(crc, &header[12]);
693 length = slen;
694 break;
695 }
696
697#define MY_FIRMWARE_TYPE "Rockbox" 552#define MY_FIRMWARE_TYPE "Rockbox"
698#define MY_HEADER_VERSION 1 553#define MY_HEADER_VERSION 1
699 default: 554 default:
diff --git a/tools/sh2d.c b/tools/sh2d.c
deleted file mode 100644
index 0fcf8b1f6b..0000000000
--- a/tools/sh2d.c
+++ /dev/null
@@ -1,573 +0,0 @@
1/*
2 * sh2d
3 * Bart Trzynadlowski, July 24, 2000
4 * Public domain
5 *
6 * Some changes by Björn Stenberg <bjorn@haxx.se>
7 * $Id$
8 */
9
10
11#include <stdint.h>
12#include <stdio.h>
13#include <stdlib.h>
14#include <string.h>
15
16#define VERSION "0.2"
17
18#define ZERO_F 0 /* 0 format */
19#define N_F 1 /* n format */
20#define M_F 2 /* m format */
21#define NM_F 3 /* nm format */
22#define MD_F 4 /* md format */
23#define ND4_F 5 /* nd4 format */
24#define NMD_F 6 /* nmd format */
25#define D_F 7 /* d format */
26#define D12_F 8 /* d12 format */
27#define ND8_F 9 /* nd8 format */
28#define I_F 10 /* i format */
29#define NI_F 11 /* ni format */
30
31typedef struct
32{
33 int format;
34 const char *mnem;
35 unsigned short mask; /* mask used to obtain opcode bits */
36 unsigned short bits; /* opcode bits */
37 int dat; /* specific data for situation */
38 int sh2; /* SH-2 specific */
39} i_descr;
40
41/* register name lookup added by bjorn@haxx.se 2001-12-09 */
42char* regname[] =
43{
44 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
45 "","","","","","","","","","","","","","","","", /* 0 */
46 "","","","","","","","","","","","","","","","", /* 10 */
47 "","","","","","","","","","","","","","","","", /* 20 */
48 "","","","","","","","","","","","","","","","", /* 30 */
49 "","","","","","","","","","","","","","","","", /* 40 */
50 "","","","","","","","","","","","","","","","", /* 50 */
51 "","","","","","","","","","","","","","","","", /* 60 */
52 "","","","","","","","","","","","","","","","", /* 70 */
53 "","","","","","","","","","","","","","","","", /* 80 */
54 "","","","","","","","","","","","","","","","", /* 90 */
55 "","","","","","","","","","","","","","","","", /* a0 */
56 "","","","","","","","","","","","","","","","", /* b0 */
57
58 "SMR0","BRR0","SCR0","TDR0","SSR0","RDR0","","", /* c0 */
59 "SMR1","BRR1","SCR1","TDR1","SSR1","RDR1","","", /* c8 */
60 "","","","","","","","","","","","","","","","", /* d0 */
61 "ADDRAH","ADDRAL","ADDRBH","ADDRBL", /* e0 */
62 "ADDRCH","ADDRCL","ADDRDH","ADDRDL", /* e4 */
63 "ADCSR","ADCR","","","","","","", /* e8 */
64 "","","","","","","","","","","","","","","","", /* f0 */
65 "TSTR","TSNC","TMDR","TFCR","TCR0","TIOR0","TIER0","TSR0", /* 100 */
66 "TCNT0","!","GRA0","!","GRB0","!","TCR1","TIORL", /* 108 */
67 "TIERI","TSR1","TCNT1","!","GRA1","!","GRB1","!", /* 110 */
68 "TCR2","TIOR2","TIER2","TSR2","TCNT2","!","GRA2","!", /* 118 */
69 "GRB2","!","TCR3","TIOR3","TIER3","TSR3","TCNT3","!", /* 120 */
70 "GRA3","!","GRB3","!","BRA3","!","BRB3","!", /* 128 */
71 "","TOCR","TCR4","TIOR4","TIER4","TSR4","TCNT4","!", /* 130 */
72 "GRA4","!","GRB4","!","BRA4","!","BRB4","!", /* 138 */
73 "SAR0","!","!","!","DAR0","!","!","!", /* 140 */
74 "DMAOR","!","TCR0","!","","","CHCR0","!", /* 148 */
75 "SAR1","!","!","!","DAR1","!","!","!", /* 150 */
76 "","","TCR1","!","","","CHCR1","!", /* 158 */
77 "SAR2","!","!","!","DAR2","!","!","!", /* 160 */
78 "","","TCR2","!","","","CHCR2","!", /* 168 */
79 "SAR3","!","!","!","DAR3","!","!","!", /* 170 */
80 "","","TCR3","!","","","CHCR3","!", /* 178 */
81 "","","","","IPRA","!","IPRB","!", /* 180 */
82 "IPRC","!","IPRD","!","IPRE","!","ICR","!", /* 188 */
83 "BARH","!","BARL","!","BAMRH","!","BAMRL","!", /* 190 */
84 "BBR","!","","","","","","", /* 198 */
85 "BCR","!","WCR1","!","WCR2","!","WCR3","!", /* 1a0 */
86 "DCR","!","PCR","!","RCR","!","RTCSR","!", /* 1a8 */
87 "RTCNT","!","RTCOR","!","","","","", /* 1b0 */
88 "TCSR","TCNT","","RSTCSR","SBYCR","","","", /* 1b8 */
89 "PADR","!","PBDR","!","PAIOR","!","PBIOR","!", /* 1c0 */
90 "PACR1","!","PACR2","!","PBCR1","!","PBCR2","!", /* 1c8 */
91 "PCDR","!","","","","","","","","","","","","","","", /* 1d0 */
92 "","","","","","","","","","","","","","","CASCR","!", /* 1e0 */
93 "TPMR","TPCR","NDERB","NDERA","NDRB","NDRA","NDRB","NDRA", /* 1f0 */
94 "","","","","","","",""
95};
96
97i_descr tab[] =
98{
99 { ZERO_F, "clrt", 0xffff, 0x8, 0, 0 },
100 { ZERO_F, "clrmac", 0xffff, 0x28, 0, 0 },
101 { ZERO_F, "div0u", 0xffff, 0x19, 0, 0 },
102 { ZERO_F, "nop", 0xffff, 0x9, 0, 0 },
103 { ZERO_F, "rte", 0xffff, 0x2b, 0, 0 },
104 { ZERO_F, "rts", 0xffff, 0xb, 0, 0 },
105 { ZERO_F, "sett", 0xffff, 0x18, 0, 0 },
106 { ZERO_F, "sleep", 0xffff, 0x1b, 0, 0 },
107 { N_F, "cmp/pl\tr%d", 0xf0ff, 0x4015, 0, 0 },
108 { N_F, "cmp/pz\tr%d", 0xf0ff, 0x4011, 0, 0 },
109 { N_F, "dt\tr%d", 0xf0ff, 0x4010, 0, 1 },
110 { N_F, "movt\tr%d", 0xf0ff, 0x0029, 0, 0 },
111 { N_F, "rotl\tr%d", 0xf0ff, 0x4004, 0, 0 },
112 { N_F, "rotr\tr%d", 0xf0ff, 0x4005, 0, 0 },
113 { N_F, "rotcl\tr%d", 0xf0ff, 0x4024, 0, 0 },
114 { N_F, "rotcr\tr%d", 0xf0ff, 0x4025, 0, 0 },
115 { N_F, "shal\tr%d", 0xf0ff, 0x4020, 0, 0 },
116 { N_F, "shar\tr%d", 0xf0ff, 0x4021, 0, 0 },
117 { N_F, "shll\tr%d", 0xf0ff, 0x4000, 0, 0 },
118 { N_F, "shlr\tr%d", 0xf0ff, 0x4001, 0, 0 },
119 { N_F, "shll2\tr%d", 0xf0ff, 0x4008, 0, 0 },
120 { N_F, "shlr2\tr%d", 0xf0ff, 0x4009, 0, 0 },
121 { N_F, "shll8\tr%d", 0xf0ff, 0x4018, 0, 0 },
122 { N_F, "shlr8\tr%d", 0xf0ff, 0x4019, 0, 0 },
123 { N_F, "shll16\tr%d", 0xf0ff, 0x4028, 0, 0 },
124 { N_F, "shlr16\tr%d", 0xf0ff, 0x4029, 0, 0 },
125 { N_F, "stc\tsr,r%d", 0xf0ff, 0x0002, 0, 0 },
126 { N_F, "stc\tgbr,r%d", 0xf0ff, 0x0012, 0, 0 },
127 { N_F, "stc\tvbr,r%d", 0xf0ff, 0x0022, 0, 0 },
128 { N_F, "sts\tmach,r%d", 0xf0ff, 0x000a, 0, 0 },
129 { N_F, "sts\tmacl,r%d", 0xf0ff, 0x001a, 0, 0 },
130 { N_F, "sts\tpr,r%d", 0xf0ff, 0x002a, 0, 0 },
131 { N_F, "tas.b\t@r%d", 0xf0ff, 0x401b, 0, 0 },
132 { N_F, "stc.l\tsr,@-r%d", 0xf0ff, 0x4003, 0, 0 },
133 { N_F, "stc.l\tgbr,@-r%d", 0xf0ff, 0x4013, 0, 0 },
134 { N_F, "stc.l\tvbr,@-r%d", 0xf0ff, 0x4023, 0, 0 },
135 { N_F, "sts.l\tmach,@-r%d", 0xf0ff, 0x4002, 0, 0 },
136 { N_F, "sts.l\tmacl,@-r%d", 0xf0ff, 0x4012, 0, 0 },
137 { N_F, "sts.l\tpr,@-r%d", 0xf0ff, 0x4022, 0, 0 },
138 { M_F, "ldc\tr%d,sr", 0xf0ff, 0x400e, 0, 0 },
139 { M_F, "ldc\tr%d,gbr", 0xf0ff, 0x401e, 0, 0 },
140 { M_F, "ldc\tr%d,vbr", 0xf0ff, 0x402e, 0, 0 },
141 { M_F, "lds\tr%d,mach", 0xf0ff, 0x400a, 0, 0 },
142 { M_F, "lds\tr%d,macl", 0xf0ff, 0x401a, 0, 0 },
143 { M_F, "lds\tr%d,pr", 0xf0ff, 0x402a, 0, 0 },
144 { M_F, "jmp\t@r%d", 0xf0ff, 0x402b, 0, 0 },
145 { M_F, "jsr\t@r%d", 0xf0ff, 0x400b, 0, 0 },
146 { M_F, "ldc.l\t@r%d+,sr", 0xf0ff, 0x4007, 0, 0 },
147 { M_F, "ldc.l\t@r%d+,gbr", 0xf0ff, 0x4017, 0, 0 },
148 { M_F, "ldc.l\t@r%d+,vbr", 0xf0ff, 0x4027, 0, 0 },
149 { M_F, "lds.l\t@r%d+,mach", 0xf0ff, 0x4006, 0, 0 },
150 { M_F, "lds.l\t@r%d+,macl", 0xf0ff, 0x4016, 0, 0 },
151 { M_F, "lds.l\t@r%d+,pr", 0xf0ff, 0x4026, 0, 0 },
152 { M_F, "braf\tr%d", 0xf0ff, 0x0023, 0, 1 },
153 { M_F, "bsrf\tr%d", 0xf0ff, 0x0003, 0, 1 },
154 { NM_F, "add\tr%d,r%d", 0xf00f, 0x300c, 0, 0 },
155 { NM_F, "addc\tr%d,r%d", 0xf00f, 0x300e, 0, 0 },
156 { NM_F, "addv\tr%d,r%d", 0xf00f, 0x300f, 0, 0 },
157 { NM_F, "and\tr%d,r%d", 0xf00f, 0x2009, 0, 0 },
158 { NM_F, "cmp/eq\tr%d,r%d", 0xf00f, 0x3000, 0, 0 },
159 { NM_F, "cmp/hs\tr%d,r%d", 0xf00f, 0x3002, 0, 0 },
160 { NM_F, "cmp/ge\tr%d,r%d", 0xf00f, 0x3003, 0, 0 },
161 { NM_F, "cmp/hi\tr%d,r%d", 0xf00f, 0x3006, 0, 0 },
162 { NM_F, "cmp/gt\tr%d,r%d", 0xf00f, 0x3007, 0, 0 },
163 { NM_F, "cmp/str\tr%d,r%d", 0xf00f, 0x200c, 0, 0 },
164 { NM_F, "div1\tr%d,r%d", 0xf00f, 0x3004, 0, 0 },
165 { NM_F, "div0s\tr%d,r%d", 0xf00f, 0x2007, 0, 0 },
166 { NM_F, "dmuls.l\tr%d,r%d", 0xf00f, 0x300d, 0, 1 },
167 { NM_F, "dmulu.l\tr%d,r%d", 0xf00f, 0x3005, 0, 1 },
168 { NM_F, "exts.b\tr%d,r%d", 0xf00f, 0x600e, 0, 0 },
169 { NM_F, "exts.w\tr%d,r%d", 0xf00f, 0x600f, 0, 0 },
170 { NM_F, "extu.b\tr%d,r%d", 0xf00f, 0x600c, 0, 0 },
171 { NM_F, "extu.w\tr%d,r%d", 0xf00f, 0x600d, 0, 0 },
172 { NM_F, "mov\tr%d,r%d", 0xf00f, 0x6003, 0, 0 },
173 { NM_F, "mul.l\tr%d,r%d", 0xf00f, 0x0007, 0, 1 },
174 { NM_F, "muls.w\tr%d,r%d", 0xf00f, 0x200f, 0, 0 },
175 { NM_F, "mulu.w\tr%d,r%d", 0xf00f, 0x200e, 0, 0 },
176 { NM_F, "neg\tr%d,r%d", 0xf00f, 0x600b, 0, 0 },
177 { NM_F, "negc\tr%d,r%d", 0xf00f, 0x600a, 0, 0 },
178 { NM_F, "not\tr%d,r%d", 0xf00f, 0x6007, 0, 0 },
179 { NM_F, "or\tr%d,r%d", 0xf00f, 0x200b, 0, 0 },
180 { NM_F, "sub\tr%d,r%d", 0xf00f, 0x3008, 0, 0 },
181 { NM_F, "subc\tr%d,r%d", 0xf00f, 0x300a, 0, 0 },
182 { NM_F, "subv\tr%d,r%d", 0xf00f, 0x300b, 0, 0 },
183 { NM_F, "swap.b\tr%d,r%d", 0xf00f, 0x6008, 0, 0 },
184 { NM_F, "swap.w\tr%d,r%d", 0xf00f, 0x6009, 0, 0 },
185 { NM_F, "tst\tr%d,r%d", 0xf00f, 0x2008, 0, 0 },
186 { NM_F, "xor\tr%d,r%d", 0xf00f, 0x200a, 0, 0 },
187 { NM_F, "xtrct\tr%d,r%d", 0xf00f, 0x200d, 0, 0 },
188 { NM_F, "mov.b\tr%d,@r%d", 0xf00f, 0x2000, 0, 0 },
189 { NM_F, "mov.w\tr%d,@r%d", 0xf00f, 0x2001, 0, 0 },
190 { NM_F, "mov.l\tr%d,@r%d", 0xf00f, 0x2002, 0, 0 },
191 { NM_F, "mov.b\t@r%d,r%d", 0xf00f, 0x6000, 0, 0 },
192 { NM_F, "mov.w\t@r%d,r%d", 0xf00f, 0x6001, 0, 0 },
193 { NM_F, "mov.l\t@r%d,r%d", 0xf00f, 0x6002, 0, 0 },
194 { NM_F, "mac.l\t@r%d+,@r%d+", 0xf00f, 0x000f, 0, 1 },
195 { NM_F, "mac.w\t@r%d+,@r%d+", 0xf00f, 0x400f, 0, 0 },
196 { NM_F, "mov.b\t@r%d+,r%d", 0xf00f, 0x6004, 0, 0 },
197 { NM_F, "mov.w\t@r%d+,r%d", 0xf00f, 0x6005, 0, 0 },
198 { NM_F, "mov.l\t@r%d+,r%d", 0xf00f, 0x6006, 0, 0 },
199 { NM_F, "mov.b\tr%d,@-r%d", 0xf00f, 0x2004, 0, 0 },
200 { NM_F, "mov.w\tr%d,@-r%d", 0xf00f, 0x2005, 0, 0 },
201 { NM_F, "mov.l\tr%d,@-r%d", 0xf00f, 0x2006, 0, 0 },
202 { NM_F, "mov.b\tr%d,@(r0,r%d)", 0xf00f, 0x0004, 0, 0 },
203 { NM_F, "mov.w\tr%d,@(r0,r%d)", 0xf00f, 0x0005, 0, 0 },
204 { NM_F, "mov.l\tr%d,@(r0,r%d)", 0xf00f, 0x0006, 0, 0 },
205 { NM_F, "mov.b\t@(r0,r%d),r%d", 0xf00f, 0x000c, 0, 0 },
206 { NM_F, "mov.w\t@(r0,r%d),r%d", 0xf00f, 0x000d, 0, 0 },
207 { NM_F, "mov.l\t@(r0,r%d),r%d", 0xf00f, 0x000e, 0, 0 },
208 { MD_F, "mov.b\t@(0x%03X,r%d), r0", 0xff00, 0x8400, 0, 0 },
209 { MD_F, "mov.w\t@(0x%03X,r%d), r0", 0xff00, 0x8500, 0, 0 },
210 { ND4_F, "mov.b\tr0,@(0x%03X,r%d)", 0xff00, 0x8000, 0, 0 },
211 { ND4_F, "mov.w\tr0,@(0x%03X,r%d)", 0xff00, 0x8100, 0, 0 },
212 { NMD_F, "mov.l\tr%d,@(0x%03X,r%d)", 0xf000, 0x1000, 0,0 },
213 { NMD_F, "mov.l\t@(0x%03X,r%d),r%d", 0xf000, 0x5000, 0,0 },
214 { D_F, "mov.b\tr0,@(0x%03X,gbr)", 0xff00, 0xc000, 1, 0 },
215 { D_F, "mov.w\tr0,@(0x%03X,gbr)", 0xff00, 0xc100, 2, 0 },
216 { D_F, "mov.l\tr0,@(0x%03X,gbr)", 0xff00, 0xc200, 4, 0 },
217 { D_F, "mov.b\t@(0x%03X,gbr),r0", 0xff00, 0xc400, 1, 0 },
218 { D_F, "mov.w\t@(0x%03X,gbr),r0", 0xff00, 0xc500, 2, 0 },
219 { D_F, "mov.l\t@(0x%03X,gbr),r0", 0xff00, 0xc600, 4, 0 },
220 { D_F, "mova\t@(0x%03X,pc),r0", 0xff00, 0xc700, 4, 0 },
221 { D_F, "bf\t0x%08X", 0xff00, 0x8b00, 5, 0 },
222 { D_F, "bf/s\t0x%08X", 0xff00, 0x8f00, 5, 1 },
223 { D_F, "bt\t0x%08X", 0xff00, 0x8900, 5, 0 },
224 { D_F, "bt/s\t0x%08X", 0xff00, 0x8d00, 5, 1 },
225 { D12_F, "bra\t0x%08X", 0xf000, 0xa000, 0, 0 },
226 { D12_F, "bsr\t0x%08X", 0xf000, 0xb000, 0, 0 },
227 { ND8_F, "mov.w\t@(0x%03X,pc),r%d", 0xf000, 0x9000, 2, 0 },
228 { ND8_F, "mov.l\t@(0x%03X,pc),r%d", 0xf000, 0xd000, 4, 0 },
229 { I_F, "and.b\t#0x%02X,@(r0,gbr)", 0xff00, 0xcd00, 0,0 },
230 { I_F, "or.b\t#0x%02X,@(r0,gbr)", 0xff00, 0xcf00, 0,0 },
231 { I_F, "tst.b\t#0x%02X,@(r0,gbr)", 0xff00, 0xcc00, 0,0 },
232 { I_F, "xor.b\t#0x%02X,@(r0,gbr)", 0xff00, 0xce00, 0,0 },
233 { I_F, "and\t#0x%02X,r0", 0xff00, 0xc900, 0, 0 },
234 { I_F, "cmp/eq\t#0x%02X,r0", 0xff00, 0x8800, 0, 0 },
235 { I_F, "or\t#0x%02X,r0", 0xff00, 0xcb00, 0, 0 },
236 { I_F, "tst\t#0x%02X,r0", 0xff00, 0xc800, 0, 0 },
237 { I_F, "xor\t#0x%02X,r0", 0xff00, 0xca00, 0, 0 },
238 { I_F, "trapa\t#0x%X", 0xff00, 0xc300, 0, 0 },
239 { NI_F, "add\t#0x%02X,r%d", 0xf000, 0x7000, 0, 0 },
240 { NI_F, "mov\t#0x%02X,r%d", 0xf000, 0xe000, 0, 0 },
241 { 0, NULL, 0, 0, 0, 0 }
242};
243
244
245int FindOption(char *option, int p, int h, int u, int argc, char **argv)
246{
247 static int t[] = { 0, 0, 0, 0, 0, 0, 0, 0,
248 0, 0, 0, 0, 0, 0, 0, 0,
249 0, 0, 0, 0, 0, 0, 0, 0,
250 0, 0, 0, 0, 0, 0, 0, 0,
251 0, 0, 0, 0, 0, 0, 0, 0,
252 0, 0, 0, 0, 0, 0, 0, 0,
253 0, 0, 0, 0, 0, 0, 0, 0,
254 0, 0, 0, 0, 0, 0, 0, 0,
255 0, 0, 0, 0, 0, 0, 0, 0,
256 0, 0, 0, 0, 0, 0, 0, 0,
257 0, 0, 0, 0, 0, 0, 0, 0,
258 0, 0, 0, 0, 0, 0, 0, 0,
259 0, 0, 0, 0, 0, 0, 0, 0,
260 0, 0, 0, 0, 0, 0, 0, 0,
261 0, 0, 0, 0, 0, 0, 0, 0,
262 0, 0, 0, 0, 0, 0, 0, 0 };
263 int i;
264 char *c;
265
266 if (argc > 128)
267 argc = 128; /* maximum this function can handle is 128 */
268
269 /*
270 * if p = 1 and h = 0 will find option and return decimal value of
271 * argv[i+1], if h = 1 will read it as hex.
272 * if p = 0 then it will return index of option in argv[], 0 not found
273 * if u = 1 will return index of first occurance of untouched option
274 */
275
276 if (u) /* find first untouched element */
277 {
278 for (i = 1; i < argc; i++)
279 {
280 if (!t[i]) /* 0 indicates untouched */
281 return i;
282 }
283 return 0;
284 }
285
286 if (p) /* find option and return integer value following it */
287 {
288 for (i = 1; i < argc; i++)
289 {
290 if (strcmp(argv[i], option) == 0) /* found */
291 {
292 if (i >= argc) /* bounds! */
293 return 0;
294 t[i + 1] = t[i] = 1; /* touched */
295 if (!h)
296 return atoi(argv[i + 1]);
297 else
298 return strtoul(argv[i + 1], &c, 16);
299 }
300 }
301 return 0; /* no match */
302 }
303 else /* find option and return position */
304 {
305 for (i = 1; i < argc; i++)
306 {
307 if (strcmp(argv[i], option) == 0)
308 {
309 t[i] = 1;
310 return i; /* found! return position */
311 }
312 }
313 return 0;
314 }
315}
316
317/*
318 * SH2Disasm(): SH-1/SH-2 disassembler routine. If mode = 0 then SH-2 mode,
319 * otherwise SH-1 mode
320 */
321
322void SH2Disasm(unsigned v_addr, unsigned char *p_addr, int mode, char *m_addr)
323 {
324 int i;
325 unsigned short op;
326
327 op = (unsigned short) (*p_addr << 8) | *(p_addr + 1);
328 printf("0x%08X: 0x%04X\t", v_addr, op);
329
330 if (m_addr[0]==ND8_F)
331 {
332 if (m_addr[2]==-1)
333 {
334 unsigned int tmp = (op << 16) | ((unsigned int) (p_addr [2] << 8) | p_addr[3]);
335 printf(".long\t0x%08X\t; 0x%08X",tmp,v_addr - (unsigned)m_addr[1]);
336 }
337 else
338 printf(".short\t0x%08X\t; 0x%08X",op,v_addr - (unsigned)m_addr[1]);
339 }
340 else if (m_addr[0] != -1)
341 {
342 for (i = 0; tab[i].mnem != NULL; i++) /* 0 format */
343 {
344 if ((op & tab[i].mask) == tab[i].bits)
345 {
346 if (tab[i].sh2 && mode) /* if SH-1 mode, no SH-2 */
347 printf("???");
348 else if (tab[i].format == ZERO_F)
349 printf("%s", tab[i].mnem);
350 else if (tab[i].format == N_F)
351 printf(tab[i].mnem, (op >> 8) & 0xf);
352 else if (tab[i].format == M_F)
353 printf(tab[i].mnem, (op >> 8) & 0xf);
354 else if (tab[i].format == NM_F)
355 printf(tab[i].mnem, (op >> 4) & 0xf,
356 (op >> 8) & 0xf);
357 else if (tab[i].format == MD_F)
358 {
359 if (op & 0x100)
360 printf(tab[i].mnem, (op & 0xf) * 2,
361 (op >> 4) & 0xf);
362 else
363 printf(tab[i].mnem, op & 0xf,
364 (op >> 4) & 0xf);
365 }
366 else if (tab[i].format == ND4_F)
367 {
368 if (op & 0x100)
369 printf(tab[i].mnem, (op & 0xf) * 2,
370 (op >> 4) & 0xf);
371 else
372 printf(tab[i].mnem, (op & 0xf),
373 (op >> 4) & 0xf);
374 }
375 else if (tab[i].format == NMD_F)
376 {
377 if ((op & 0xf000) == 0x1000)
378 printf(tab[i].mnem, (op >> 4) & 0xf,
379 (op & 0xf) * 4,
380 (op >> 8) & 0xf);
381 else
382 printf(tab[i].mnem, (op & 0xf) * 4,
383 (op >> 4) & 0xf,
384 (op >> 8) & 0xf);
385 }
386 else if (tab[i].format == D_F)
387 {
388 if (tab[i].dat <= 4)
389 {
390 if ((op & 0xff00) == 0xc700)
391 {
392 printf(tab[i].mnem,
393 (op & 0xff) *
394 tab[i].dat + 4);
395 printf("\t; 0x%08X",
396 (op & 0xff) *
397 tab[i].dat + 4 +
398 v_addr);
399 }
400 else
401 printf(tab[i].mnem,
402 (op & 0xff) *
403 tab[i].dat);
404 }
405 else
406 {
407 if (op & 0x80) /* sign extend */
408 printf(tab[i].mnem,
409 (((op & 0xff) +
410 0xffffff00) * 2) +
411
412 v_addr + 4);
413 else
414 printf(tab[i].mnem,
415 ((op & 0xff) * 2) +
416 v_addr + 4);
417 }
418 }
419 else if (tab[i].format == D12_F)
420 {
421 if (op & 0x800) /* sign extend */
422 printf(tab[i].mnem,
423 ((op & 0xfff) + 0xfffff000) * 2
424 + v_addr + 4);
425 else
426 printf(tab[i].mnem, (op & 0xfff) * 2 +
427 v_addr + 4);
428 }
429 else if (tab[i].format == ND8_F)
430 {
431 int imm = (op & 0xff) * tab[i].dat + 4;
432 if ((op & 0xf000) == 0x9000) /* .W */
433 {
434 int dat = (unsigned short) (*(imm + p_addr) << 8) | *(imm + p_addr + 1);
435 m_addr[imm+0] = ND8_F; /* this couldn't be an instruction so mark it ! */
436 m_addr[imm+1] = imm;
437 printf(tab[i].mnem,
438 imm,
439 (op >> 8) & 0xf);
440 printf("\t; 0x%08X (0x%04X)",
441 imm + v_addr, dat);
442 }
443 else /* .L */
444 {
445 unsigned char *b_addr = (unsigned char *)((intptr_t)p_addr & ~3);
446 int dat = (unsigned int) (*(imm + b_addr) << 24) | (*(imm + b_addr + 1) << 16)
447 | (*(imm + b_addr + 2) << 8) | *(imm + b_addr + 3) ;
448 /* SH-1 register name lookup */
449 char* str = "";
450 if ( (dat & 0xfffffe00) == 0x05fffe00 )
451 str = regname[dat & 0x1ff];
452 m_addr[imm+(b_addr-p_addr)+0] = ND8_F; /* this couldn't be an instruction so mark it ! */
453 m_addr[imm+(b_addr-p_addr)+1] = imm;
454 m_addr[imm+(b_addr-p_addr)+2] = -1;
455 printf(tab[i].mnem,
456 imm,
457 (op >> 8) & 0xf);
458 printf("\t; 0x%08X (0x%08X) %s",
459 imm + (v_addr & 0xfffffffc), dat, str);
460 }
461 }
462 else if (tab[i].format == I_F)
463 printf(tab[i].mnem, op & 0xff);
464 else if (tab[i].format == NI_F)
465 printf(tab[i].mnem, op & 0xff, (op >> 8) &
466 0xf);
467 else
468 printf("???");
469 printf("\n");
470 return;
471 }
472 }
473
474 printf("???");
475
476 }
477 printf("\n");
478 }
479
480void ShowHelp()
481{
482 printf("sh2d Version %s by Bart Trzynadlowski: A Free SH-1/SH-2 "
483 "Disassembler\n", VERSION);
484 printf("Usage: sh2d <file> [options]\n");
485 printf("Options: -?,-h Show this help text\n");
486 printf(" -s # Start offset (hexadecimal)\n");
487 printf(" -l # Number of bytes (decimal)\n");
488 printf(" -o # Set origin (hexadecimal)\n");
489 printf(" -sh1 SH-1 disassembly only\n");
490 printf(" -sh2 SH-2 disassembly (default)\n");
491 exit(0);
492}
493
494int main(int argc, char **argv)
495{
496 FILE *fp;
497 long fsize, file, mode;
498 unsigned start, len, calc_len = 0, org, do_org, i, j = 0;
499 char *buffer;
500 char *mark;
501
502 if (argc == 1) /* show help */
503 ShowHelp();
504 if (FindOption("-?", 0, 0, 0, argc, argv) ||
505 FindOption("-h", 0, 0, 0, argc, argv))
506 ShowHelp();
507
508 if (FindOption("-sh1", 0, 0, 0, argc, argv))
509 mode = 1; /* SH-1 mode */
510 else
511 mode = 0; /* SH-2 mode */
512 if (FindOption("-sh2", 0, 0, 0, argc, argv))
513 mode = 0; /* SH-2 mode */
514
515 start = FindOption("-s", 1, 1, 0, argc, argv);
516 org = FindOption("-o", 1, 1, 0, argc, argv);
517 if (!(len = FindOption("-l", 1, 0, 0, argc, argv)))
518 {
519 if (FindOption("-l", 0, 0, 0, argc, argv))
520 return 0; /* -l was actually specified w/ 0 */
521 calc_len = 1; /* no -l, calculate length */
522 }
523
524 if (FindOption("-o", 0, 0, 0, argc, argv))
525 do_org = 1; /* -o was actually 0 */
526 else
527 do_org = 0; /* there was no -o, ignore the org variable */
528
529 if (!(file = FindOption(NULL, 0, 0, 1, argc, argv)))
530 {
531 fprintf(stderr, "sh2d: No input file specified. Try "
532 "\"sh2d -h\" for usage instructions\n");
533 exit(1);
534 }
535
536 if ((fp = fopen(argv[file], "rb")) == NULL)
537 {
538 fprintf(stderr, "sh2d: Failed to open file: %s\n",
539 argv[file]);
540 exit(1);
541 }
542 fseek(fp, 0, SEEK_END);
543 fsize = ftell(fp);
544 rewind(fp);
545 if ((buffer = (char *) calloc(fsize * 2, sizeof(unsigned short)))
546 == NULL)
547 {
548 fprintf(stderr, "sh2d: Not enough memory to load input "
549 "file: %s, %lu bytes\n", argv[file], fsize);
550 exit(1);
551 }
552 fread(buffer, sizeof(unsigned char), fsize, fp);
553 fclose(fp);
554
555 if (calc_len)
556 len = fsize - start;
557
558 mark = buffer + fsize;
559
560 for (i = start; i < (unsigned) fsize && j < len; i += 2)
561 {
562 if (do_org)
563 {
564 SH2Disasm(org, (unsigned char*)&buffer[i], mode, &mark[i]);
565 org += 2;
566 }
567 else
568 SH2Disasm(i, (unsigned char *)&buffer[i], mode, &mark[i]);
569 j += 2;
570 }
571
572 return 0;
573}
diff --git a/tools/toolchain-patches/gcc-4.0.3-rockbox-1.diff b/tools/toolchain-patches/gcc-4.0.3-rockbox-1.diff
deleted file mode 100644
index abd0f44be3..0000000000
--- a/tools/toolchain-patches/gcc-4.0.3-rockbox-1.diff
+++ /dev/null
@@ -1,75 +0,0 @@
1diff -ru gcc-4.0.3-orig/gcc/config/sh/sh.h gcc-4.0.3/gcc/config/sh/sh.h
2--- gcc-4.0.3-orig/gcc/config/sh/sh.h 2006-03-06 23:40:49.000000000 +0100
3+++ gcc-4.0.3/gcc/config/sh/sh.h 2006-04-28 03:03:18.000000000 +0200
4@@ -2809,12 +2809,15 @@
5 #define CASE_VECTOR_MODE ((! optimize || TARGET_BIGTABLE) ? SImode : HImode)
6
7 #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \
8-((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \
9+((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 126 \
10 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \
11- : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \
12+ : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 254 \
13 ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \
14 : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \
15 : SImode)
16+/* Note: The maximum range for byte-sized offsets was reduced by 1 to work
17+ around a bug in final.c I don't know how to fix properly (jump table
18+ length calculation should take alignment into account). -- Jens Arnold */
19
20 /* Define as C expression which evaluates to nonzero if the tablejump
21 instruction expects the table to contain offsets from the address of the
22diff -ru gcc-4.0.3-orig/gcc/version.c gcc-4.0.3/gcc/version.c
23--- gcc-4.0.3-orig/gcc/version.c 2006-03-09 21:46:18.000000000 +0100
24+++ gcc-4.0.3/gcc/version.c 2006-04-29 23:52:22.000000000 +0200
25@@ -5,7 +5,7 @@
26 please modify this string to indicate that, e.g. by putting your
27 organization's name in parentheses at the end of the string. */
28
29-const char version_string[] = "4.0.3";
30+const char version_string[] = "4.0.3 (rockbox patch #1)";
31
32 /* This is the location of the online document giving instructions for
33 reporting bugs. If you distribute a modified version of GCC,
34diff -ru gcc-4.0.3-orig/gcc/config.gcc gcc-4.0.3/gcc/config.gcc
35--- gcc-4.0.3-orig/gcc/config.gcc So Mrz 7 23:08:24 2010
36+++ gcc-4.0.3/gcc/config.gcc Mo Mrz 8 01:36:54 2010
37@@ -1867,7 +1867,7 @@
38 sh2*) sh_cpu_target=sh2 ;;
39 *) sh_cpu_target=sh1 ;;
40 esac
41- sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr A-Z_ a-z-`"
42+ sh_cpu_default="`echo $with_cpu|sed s/^m/sh/|tr [A-Z]_ [a-z]-`"
43 case $sh_cpu_default in
44 sh5-64media-nofpu | sh5-64media | \
45 sh5-32media-nofpu | sh5-32media | sh5-compact-nofpu | sh5-compact | \
46@@ -1889,9 +1889,9 @@
47 *) sh_multilibs=m1,m2,m2e,m4,m4-single,m4-single-only,m2a,m2a-single ;;
48 esac
49 fi
50- target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr a-z- A-Z_`
51+ target_cpu_default=SELECT_`echo ${sh_cpu_default}|tr [a-z]- [A-Z]_`
52 tm_defines=${tm_defines}' SH_MULTILIB_CPU_DEFAULT=\"'`echo $sh_cpu_default|sed s/sh/m/`'\"'
53- sh_multilibs=`echo $sh_multilibs,$sh_cpu_default | sed -e 's/[ ,/][ ,]*/ /g' -e 's/ $//' -e s/^m/sh/ -e 's/ m/ sh/g' | tr A-Z_ a-z-`
54+ sh_multilibs=`echo $sh_multilibs,$sh_cpu_default | sed -e 's/[ ,/][ ,]*/ /g' -e 's/ $//' -e s/^m/sh/ -e 's/ m/ sh/g' | tr [A-Z]_ [a-z]-`
55 for sh_multilib in ${sh_multilibs}; do
56 case ${sh_multilib} in
57 sh1 | sh2 | sh2e | sh3 | sh3e | \
58@@ -1902,7 +1902,7 @@
59 sh5-32media | sh5-32media-nofpu | \
60 sh5-compact | sh5-compact-nofpu)
61 tmake_file="${tmake_file} sh/t-mlib-${sh_multilib}"
62- tm_defines="$tm_defines SUPPORT_`echo $sh_multilib|tr a-z- A-Z_`"
63+ tm_defines="$tm_defines SUPPORT_`echo $sh_multilib|tr [a-z]- [A-Z]_`"
64 ;;
65 *)
66 echo "with_multilib_list=${sh_multilib} not supported."
67@@ -2631,7 +2631,7 @@
68
69 sh[123456ble]-*-* | sh-*-*)
70 supported_defaults="cpu"
71- case "`echo $with_cpu | tr A-Z_ a-z- | sed s/sh/m/`" in
72+ case "`echo $with_cpu | tr [A-Z]_ [a-z]- | sed s/sh/m/`" in
73 "" | m1 | m2 | m2e | m3 | m3e | m4 | m4-single | m4-single-only | m4-nofpu )
74 # OK
75 ;;
diff --git a/tools/tools.make b/tools/tools.make
index 9f16d4c884..3350ad03bc 100644
--- a/tools/tools.make
+++ b/tools/tools.make
@@ -40,10 +40,6 @@ $(TOOLSDIR)/convttf: $(TOOLSDIR)/convttf.c
40 $(SILENT)$(HOSTCC) $(TOOLSFLAGS) -lm -O2 -Wall -g $+ -o $@ \ 40 $(SILENT)$(HOSTCC) $(TOOLSFLAGS) -lm -O2 -Wall -g $+ -o $@ \
41 `freetype-config --libs` `freetype-config --cflags` 41 `freetype-config --libs` `freetype-config --cflags`
42 42
43$(TOOLSDIR)/player_unifont: $(TOOLSDIR)/player_unifont.c $(ROOTDIR)/firmware/drivers/lcd-charset-player.c
44 $(call PRINTS,CC $(@F))
45 $(SILENT)$(HOSTCC) $(TOOLSFLAGS) -DARCHOS_PLAYER -D__PCTOOL__ -I$(ROOTDIR)/firmware/export -I. $+ -o $@
46
47# implicit rule for simple tools 43# implicit rule for simple tools
48$(TOOLSDIR)/%: $(TOOLSDIR)/%.c 44$(TOOLSDIR)/%: $(TOOLSDIR)/%.c
49 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$@)) 45 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$@))
diff --git a/tools/voicefont.c b/tools/voicefont.c
index 30a82ae5eb..9a8a7fbc02 100644
--- a/tools/voicefont.c
+++ b/tools/voicefont.c
@@ -41,35 +41,6 @@
41 (((unsigned)(x)<<24) & 0xff000000)) 41 (((unsigned)(x)<<24) & 0xff000000))
42#endif 42#endif
43 43
44/* bitswap audio bytes, LSB becomes MSB and vice versa */
45int BitswapAudio (unsigned char* pDest, unsigned char* pSrc, size_t len)
46{
47 static const unsigned char Lookup[256] =
48 {
49 0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
50 0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
51 0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
52 0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
53 0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
54 0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
55 0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
56 0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
57 0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
58 0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
59 0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
60 0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
61 0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
62 0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
63 0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
64 0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
65 };
66
67 while (len--)
68 *pDest++ = Lookup[*pSrc++];
69
70 return 0;
71}
72
73int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output, unsigned int version) 44int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output, unsigned int version)
74{ 45{
75 46
@@ -91,14 +62,6 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output, unsi
91 char mp3filename2[1024]; 62 char mp3filename2[1024];
92 char* mp3filename; 63 char* mp3filename;
93 FILE* pMp3File; 64 FILE* pMp3File;
94 int do_bitswap_audio = 0;
95
96
97 /* We bitswap the voice file only SH based archos players, target IDs
98 equal to or lower than 8. See the "Target id:" line in rockbox-info.txt
99 or the target_id value in configure. */
100 if (targetnum <= 8)
101 do_bitswap_audio = 1;
102 65
103 memset(voiceonly, 0, sizeof(voiceonly)); 66 memset(voiceonly, 0, sizeof(voiceonly));
104 while (!feof(voicefontids)) 67 while (!feof(voicefontids))
@@ -147,8 +110,6 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output, unsi
147 110
148 size[i] = fread(buffer, 1, sizeof(buffer), pMp3File); 111 size[i] = fread(buffer, 1, sizeof(buffer), pMp3File);
149 fclose(pMp3File); 112 fclose(pMp3File);
150 if (do_bitswap_audio)
151 BitswapAudio(buffer, buffer, size[i]);
152 fwrite(buffer, 1, size[i], output); 113 fwrite(buffer, 1, size[i], output);
153 114
154 printf(": %d %s %d\n", i, names[i], size[i]); /* debug */ 115 printf(": %d %s %d\n", i, names[i], size[i]); /* debug */
@@ -203,12 +164,6 @@ int voicefont(FILE* voicefontids,int targetnum,char* filedir, FILE* output, unsi
203 } /* for i */ 164 } /* for i */
204 } /* for j */ 165 } /* for j */
205 166
206
207 /*
208 * after this the actual bitswapped mp3 data follows,
209 * which we already have written, see above.
210 */
211
212 fclose(output); 167 fclose(output);
213 168
214 return 0; 169 return 0;
diff --git a/uisimulator/bitmaps/UI-archosav300.bmp b/uisimulator/bitmaps/UI-archosav300.bmp
deleted file mode 100644
index e86221ca7e..0000000000
--- a/uisimulator/bitmaps/UI-archosav300.bmp
+++ /dev/null
Binary files differ
diff --git a/uisimulator/bitmaps/UI-archosfmrecorder.bmp b/uisimulator/bitmaps/UI-archosfmrecorder.bmp
deleted file mode 100644
index 53f705b9ef..0000000000
--- a/uisimulator/bitmaps/UI-archosfmrecorder.bmp
+++ /dev/null
Binary files differ
diff --git a/uisimulator/bitmaps/UI-archosondiofm.bmp b/uisimulator/bitmaps/UI-archosondiofm.bmp
deleted file mode 100644
index e258720d28..0000000000
--- a/uisimulator/bitmaps/UI-archosondiofm.bmp
+++ /dev/null
Binary files differ
diff --git a/uisimulator/bitmaps/UI-archosondiosp.bmp b/uisimulator/bitmaps/UI-archosondiosp.bmp
deleted file mode 100644
index c62c2334a3..0000000000
--- a/uisimulator/bitmaps/UI-archosondiosp.bmp
+++ /dev/null
Binary files differ
diff --git a/uisimulator/bitmaps/UI-archosplayer.bmp b/uisimulator/bitmaps/UI-archosplayer.bmp
deleted file mode 100644
index db4003b120..0000000000
--- a/uisimulator/bitmaps/UI-archosplayer.bmp
+++ /dev/null
Binary files differ
diff --git a/uisimulator/bitmaps/UI-archosrecorder.bmp b/uisimulator/bitmaps/UI-archosrecorder.bmp
deleted file mode 100644
index 98937fea2d..0000000000
--- a/uisimulator/bitmaps/UI-archosrecorder.bmp
+++ /dev/null
Binary files differ
diff --git a/uisimulator/bitmaps/UI-archosrecorderv2.bmp b/uisimulator/bitmaps/UI-archosrecorderv2.bmp
deleted file mode 100644
index 53f705b9ef..0000000000
--- a/uisimulator/bitmaps/UI-archosrecorderv2.bmp
+++ /dev/null
Binary files differ
diff --git a/uisimulator/buttonmap/SOURCES b/uisimulator/buttonmap/SOURCES
index 130727254c..1e882e3ca4 100644
--- a/uisimulator/buttonmap/SOURCES
+++ b/uisimulator/buttonmap/SOURCES
@@ -17,12 +17,6 @@ iriver-h10.c
17iriver-h100_h300.c 17iriver-h100_h300.c
18#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD 18#elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
19iriver-ifp7xx.c 19iriver-ifp7xx.c
20#elif CONFIG_KEYPAD == ONDIO_PAD
21archos-ondio.c
22#elif CONFIG_KEYPAD == PLAYER_PAD
23archos-player.c
24#elif CONFIG_KEYPAD == RECORDER_PAD
25archos-recorder.c
26#elif CONFIG_KEYPAD == SANSA_C200_PAD 20#elif CONFIG_KEYPAD == SANSA_C200_PAD
27sansa-c200.c 21sansa-c200.c
28#elif CONFIG_KEYPAD == SANSA_CLIP_PAD 22#elif CONFIG_KEYPAD == SANSA_CLIP_PAD
diff --git a/uisimulator/buttonmap/archos-ondio.c b/uisimulator/buttonmap/archos-ondio.c
deleted file mode 100644
index f92715ced8..0000000000
--- a/uisimulator/buttonmap/archos-ondio.c
+++ /dev/null
@@ -1,69 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Dan Everton
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22
23#include <SDL.h>
24#include "button.h"
25#include "buttonmap.h"
26
27int key_to_button(int keyboard_button)
28{
29 int new_btn = BUTTON_NONE;
30 switch (keyboard_button)
31 {
32 case SDLK_KP4:
33 case SDLK_LEFT:
34 new_btn = BUTTON_LEFT;
35 break;
36 case SDLK_KP6:
37 case SDLK_RIGHT:
38 new_btn = BUTTON_RIGHT;
39 break;
40 case SDLK_KP8:
41 case SDLK_UP:
42 new_btn = BUTTON_UP;
43 break;
44 case SDLK_KP2:
45 case SDLK_DOWN:
46 new_btn = BUTTON_DOWN;
47 break;
48 case SDLK_KP_ENTER:
49 case SDLK_RETURN:
50 case SDLK_a:
51 new_btn = BUTTON_OFF;
52 break;
53 case SDLK_KP_PERIOD:
54 case SDLK_INSERT:
55 new_btn = BUTTON_MENU;
56 break;
57 }
58 return new_btn;
59}
60
61struct button_map bm[] = {
62 { SDLK_KP_ENTER, 75, 23, 30, "Enter" },
63 { SDLK_KP8, 75, 174, 33, "KP8" },
64 { SDLK_KP4, 26, 186, 48, "KP4" },
65 { SDLK_KP6, 118, 196, 32, "KP6" },
66 { SDLK_KP2, 75, 234, 16, "KP2" },
67 { SDLK_KP_PERIOD, 54, 250, 24, "Period" },
68 { 0, 0, 0, 0, "None" }
69};
diff --git a/uisimulator/buttonmap/archos-player.c b/uisimulator/buttonmap/archos-player.c
deleted file mode 100644
index 3524e7b243..0000000000
--- a/uisimulator/buttonmap/archos-player.c
+++ /dev/null
@@ -1,68 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Dan Everton
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22
23#include <SDL.h>
24#include "button.h"
25#include "buttonmap.h"
26
27int key_to_button(int keyboard_button)
28{
29 int new_btn = BUTTON_NONE;
30 switch (keyboard_button)
31 {
32 case SDLK_KP4:
33 case SDLK_LEFT:
34 new_btn = BUTTON_LEFT;
35 break;
36 case SDLK_KP6:
37 case SDLK_RIGHT:
38 new_btn = BUTTON_RIGHT;
39 break;
40 case SDLK_KP8:
41 case SDLK_UP:
42 new_btn = BUTTON_PLAY;
43 break;
44 case SDLK_KP2:
45 case SDLK_DOWN:
46 new_btn = BUTTON_STOP;
47 break;
48 case SDLK_KP_PLUS:
49 case SDLK_F8:
50 new_btn = BUTTON_ON;
51 break;
52 case SDLK_KP_PERIOD:
53 case SDLK_INSERT:
54 new_btn = BUTTON_MENU;
55 break;
56 }
57 return new_btn;
58}
59
60struct button_map bm[] = {
61 { SDLK_KP_PLUS, 79, 252, 23, "On" },
62 { SDLK_KP_PERIOD, 81, 310, 20, "Menu" },
63 { SDLK_KP8, 154, 237, 28, "Play" },
64 { SDLK_KP4, 121, 282, 23, "Left" },
65 { SDLK_KP6, 187, 282, 22, "Right" },
66 { SDLK_KP2, 157, 312, 20, "Down" },
67 { 0, 0, 0, 0, "None" }
68};
diff --git a/uisimulator/buttonmap/archos-recorder.c b/uisimulator/buttonmap/archos-recorder.c
deleted file mode 100644
index cdf98c0814..0000000000
--- a/uisimulator/buttonmap/archos-recorder.c
+++ /dev/null
@@ -1,104 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2006 Dan Everton
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22
23#include <SDL.h>
24#include "config.h"
25#include "button.h"
26#include "buttonmap.h"
27
28int key_to_button(int keyboard_button)
29{
30 int new_btn = BUTTON_NONE;
31 switch (keyboard_button)
32 {
33 case SDLK_KP4:
34 case SDLK_LEFT:
35 new_btn = BUTTON_LEFT;
36 break;
37 case SDLK_KP6:
38 case SDLK_RIGHT:
39 new_btn = BUTTON_RIGHT;
40 break;
41 case SDLK_KP8:
42 case SDLK_UP:
43 new_btn = BUTTON_UP;
44 break;
45 case SDLK_KP2:
46 case SDLK_DOWN:
47 new_btn = BUTTON_DOWN;
48 break;
49 case SDLK_KP_PLUS:
50 case SDLK_F8:
51 new_btn = BUTTON_ON;
52 break;
53 case SDLK_KP_ENTER:
54 case SDLK_RETURN:
55 case SDLK_a:
56 new_btn = BUTTON_OFF;
57 break;
58 case SDLK_KP_DIVIDE:
59 case SDLK_F1:
60 new_btn = BUTTON_F1;
61 break;
62 case SDLK_KP_MULTIPLY:
63 case SDLK_F2:
64 new_btn = BUTTON_F2;
65 break;
66 case SDLK_KP_MINUS:
67 case SDLK_F3:
68 new_btn = BUTTON_F3;
69 break;
70 case SDLK_KP5:
71 case SDLK_SPACE:
72 new_btn = BUTTON_PLAY;
73 break;
74 }
75 return new_btn;
76}
77
78struct button_map bm[] = {
79#if defined (ARCHOS_RECORDER)
80 { SDLK_F1, 94, 205, 22, "F1" },
81 { SDLK_F2, 136, 204, 21, "F2" },
82 { SDLK_F3, 174, 204, 24, "F3" },
83 { SDLK_KP_PLUS, 75, 258, 19, "On" },
84 { SDLK_KP_ENTER, 76, 307, 15, "Off" },
85 { SDLK_KP5, 151, 290, 20, "Select" },
86 { SDLK_KP8, 152, 251, 23, "Up" },
87 { SDLK_KP4, 113, 288, 26, "Left" },
88 { SDLK_KP6, 189, 291, 23, "Right" },
89 { SDLK_KP2, 150, 327, 27, "Down" },
90#elif defined (ARCHOS_FMRECORDER) || defined (ARCHOS_RECORDERV2)
91 { SDLK_F1, 88, 210, 28, "F1" },
92 { SDLK_F2, 144, 212, 28, "F2" },
93 { SDLK_F3, 197, 212, 28, "F3" },
94 { SDLK_KP5, 144, 287, 21, "Select" },
95 { SDLK_KP_PLUS, 86, 320, 13, "Menu" },
96 { SDLK_KP_ENTER, 114, 347, 13, "Stop" },
97 { SDLK_y, 144, 288, 31, "None" },
98 { SDLK_KP8, 144, 259, 25, "Up" },
99 { SDLK_KP2, 144, 316, 31, "Down" },
100 { SDLK_KP6, 171, 287, 32, "Right" },
101#endif
102 { SDLK_KP4, 117, 287, 31, "Left" },
103 { 0, 0, 0, 0, "None" }
104};
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index dc4f636521..0ad78fdb7c 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -43,8 +43,6 @@ void audio_set_buffer_margin(int seconds)
43 (void)seconds; 43 (void)seconds;
44} 44}
45 45
46/* firmware/target/sh/archos/audio-archos.c */
47
48/* list of tracks in memory */ 46/* list of tracks in memory */
49#define MAX_ID3_TAGS (1<<4) /* Must be power of 2 */ 47#define MAX_ID3_TAGS (1<<4) /* Must be power of 2 */
50#define MAX_ID3_TAGS_MASK (MAX_ID3_TAGS - 1) 48#define MAX_ID3_TAGS_MASK (MAX_ID3_TAGS - 1)
@@ -104,48 +102,6 @@ void mp3_shutdown(void)
104{ 102{
105} 103}
106 104
107/* firmware/drivers/audio/mas35xx.c */
108#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
109void audiohw_set_loudness(int value)
110{
111 (void)value;
112}
113
114void audiohw_set_avc(int value)
115{
116 (void)value;
117}
118
119void audiohw_set_mdb_strength(int value)
120{
121 (void)value;
122}
123
124void audiohw_set_mdb_harmonics(int value)
125{
126 (void)value;
127}
128
129void audiohw_set_mdb_center(int value)
130{
131 (void)value;
132}
133
134void audiohw_set_mdb_shape(int value)
135{
136 (void)value;
137}
138
139void audiohw_set_mdb_enable(int value)
140{
141 (void)value;
142}
143
144void audiohw_set_superbass(int value)
145{
146 (void)value;
147}
148#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
149#endif /* CODEC != SWCODEC */ 105#endif /* CODEC != SWCODEC */
150 106
151int fat_startsector(void) 107int fat_startsector(void)
@@ -311,14 +267,6 @@ bool spdif_powered(void)
311} 267}
312#endif 268#endif
313 269
314#ifdef ARCHOS_PLAYER
315bool is_new_player(void)
316{
317 extern char having_new_lcd;
318 return having_new_lcd;
319}
320#endif
321
322#ifdef HAVE_USB_POWER 270#ifdef HAVE_USB_POWER
323bool usb_powered_only(void) 271bool usb_powered_only(void)
324{ 272{