├── .gitignore ├── Makefile ├── README ├── SDL2 ├── .cproject ├── .gitignore ├── .project ├── BUGS.txt ├── COPYING.txt ├── CREDITS.txt ├── Makefile ├── README-SDL.txt ├── README-porting.txt ├── README.txt ├── TODO.txt ├── WhatsNew.txt ├── include │ ├── SDL.h │ ├── SDL_assert.h │ ├── SDL_atomic.h │ ├── SDL_audio.h │ ├── SDL_bits.h │ ├── SDL_blendmode.h │ ├── SDL_clipboard.h │ ├── SDL_config.h │ ├── SDL_config_android.h │ ├── SDL_config_iphoneos.h │ ├── SDL_config_macosx.h │ ├── SDL_config_minimal.h │ ├── SDL_config_pandora.h │ ├── SDL_config_psp.h │ ├── SDL_config_raspberry.h │ ├── SDL_config_windows.h │ ├── SDL_config_winrt.h │ ├── SDL_config_wiz.h │ ├── SDL_copying.h │ ├── SDL_cpuinfo.h │ ├── SDL_egl.h │ ├── SDL_endian.h │ ├── SDL_error.h │ ├── SDL_events.h │ ├── SDL_filesystem.h │ ├── SDL_gamecontroller.h │ ├── SDL_gesture.h │ ├── SDL_haptic.h │ ├── SDL_hints.h │ ├── SDL_joystick.h │ ├── SDL_keyboard.h │ ├── SDL_keycode.h │ ├── SDL_loadso.h │ ├── SDL_log.h │ ├── SDL_main.h │ ├── SDL_messagebox.h │ ├── SDL_mouse.h │ ├── SDL_mutex.h │ ├── SDL_name.h │ ├── SDL_opengl.h │ ├── SDL_opengles.h │ ├── SDL_opengles2.h │ ├── SDL_pixels.h │ ├── SDL_platform.h │ ├── SDL_power.h │ ├── SDL_quit.h │ ├── SDL_rect.h │ ├── SDL_render.h │ ├── SDL_revision.h │ ├── SDL_rwops.h │ ├── SDL_scancode.h │ ├── SDL_shape.h │ ├── SDL_stdinc.h │ ├── SDL_surface.h │ ├── SDL_system.h │ ├── SDL_syswm.h │ ├── SDL_test.h │ ├── SDL_test_assert.h │ ├── SDL_test_common.h │ ├── SDL_test_compare.h │ ├── SDL_test_crc32.h │ ├── SDL_test_font.h │ ├── SDL_test_fuzzer.h │ ├── SDL_test_harness.h │ ├── SDL_test_images.h │ ├── SDL_test_log.h │ ├── SDL_test_md5.h │ ├── SDL_test_random.h │ ├── SDL_thread.h │ ├── SDL_timer.h │ ├── SDL_touch.h │ ├── SDL_types.h │ ├── SDL_version.h │ ├── SDL_video.h │ ├── begin_code.h │ └── close_code.h ├── pkgconfig.mk └── src │ ├── SDL.c │ ├── SDL_assert.c │ ├── SDL_assert_c.h │ ├── SDL_error.c │ ├── SDL_error_c.h │ ├── SDL_hints.c │ ├── SDL_internal.h │ ├── SDL_log.c │ ├── atomic │ ├── SDL_atomic.c │ └── SDL_spinlock.c │ ├── audio │ ├── SDL_audio.c │ ├── SDL_audio_c.h │ ├── SDL_audiocvt.c │ ├── SDL_audiodev.c │ ├── SDL_audiodev_c.h │ ├── SDL_audiomem.h │ ├── SDL_audiotypecvt.c │ ├── SDL_mixer.c │ ├── SDL_sysaudio.h │ ├── SDL_wave.c │ ├── SDL_wave.h │ └── raspberry │ │ ├── SDL_raspberryaudio.c │ │ └── SDL_raspberryaudio.h │ ├── core │ └── raspberry │ │ ├── SDL_raspberry.c │ │ └── SDL_raspberry.h │ ├── cpuinfo │ └── SDL_cpuinfo.c │ ├── dynapi │ ├── SDL_dynapi.c │ ├── SDL_dynapi.h │ ├── SDL_dynapi_overrides.h │ └── SDL_dynapi_procs.h │ ├── events │ ├── SDL_clipboardevents.c │ ├── SDL_clipboardevents_c.h │ ├── SDL_dropevents.c │ ├── SDL_dropevents_c.h │ ├── SDL_events.c │ ├── SDL_events_c.h │ ├── SDL_gesture.c │ ├── SDL_gesture_c.h │ ├── SDL_keyboard.c │ ├── SDL_keyboard_c.h │ ├── SDL_mouse.c │ ├── SDL_mouse_c.h │ ├── SDL_quit.c │ ├── SDL_sysevents.h │ ├── SDL_touch.c │ ├── SDL_touch_c.h │ ├── SDL_windowevents.c │ ├── SDL_windowevents_c.h │ ├── blank_cursor.h │ ├── default_cursor.h │ ├── scancodes_darwin.h │ ├── scancodes_linux.h │ ├── scancodes_windows.h │ └── scancodes_xfree86.h │ ├── file │ └── SDL_rwops.c │ ├── haptic │ ├── SDL_haptic_c.h │ ├── SDL_syshaptic.h │ └── dummy │ │ └── SDL_syshaptic.c │ ├── joystick │ ├── SDL_gamecontroller.c │ ├── SDL_gamecontrollerdb.h │ ├── SDL_joystick.c │ ├── SDL_joystick_c.h │ ├── SDL_sysjoystick.h │ └── raspberry │ │ └── SDL_sysjoystick.c │ ├── libm │ ├── math_libm.h │ └── math_private.h │ ├── render │ ├── SDL_d3dmath.c │ ├── SDL_d3dmath.h │ ├── SDL_render.c │ ├── SDL_sysrender.h │ ├── SDL_yuv_mmx.c │ ├── SDL_yuv_sw.c │ ├── SDL_yuv_sw_c.h │ ├── mmx.h │ └── software │ │ ├── SDL_blendfillrect.c │ │ ├── SDL_blendfillrect.h │ │ ├── SDL_blendline.c │ │ ├── SDL_blendline.h │ │ ├── SDL_blendpoint.c │ │ ├── SDL_blendpoint.h │ │ ├── SDL_draw.h │ │ ├── SDL_drawline.c │ │ ├── SDL_drawline.h │ │ ├── SDL_drawpoint.c │ │ ├── SDL_drawpoint.h │ │ ├── SDL_render_sw.c │ │ ├── SDL_render_sw_c.h │ │ ├── SDL_rotate.c │ │ └── SDL_rotate.h │ ├── stdlib │ ├── SDL_getenv.c │ ├── SDL_iconv.c │ ├── SDL_malloc.c │ ├── SDL_qsort.c │ ├── SDL_stdlib.c │ └── SDL_string.c │ ├── thread │ ├── SDL_systhread.h │ ├── SDL_thread.c │ ├── SDL_thread_c.h │ └── generic │ │ ├── SDL_syscond.c │ │ ├── SDL_sysmutex.c │ │ ├── SDL_sysmutex_c.h │ │ ├── SDL_syssem.c │ │ ├── SDL_systhread.c │ │ ├── SDL_systhread_c.h │ │ └── SDL_systls.c │ ├── timer │ ├── SDL_timer.c │ ├── SDL_timer_c.h │ └── dummy │ │ └── SDL_systimer.c │ └── video │ ├── SDL_RLEaccel.c │ ├── SDL_RLEaccel_c.h │ ├── SDL_blit.c │ ├── SDL_blit.h │ ├── SDL_blit_0.c │ ├── SDL_blit_1.c │ ├── SDL_blit_A.c │ ├── SDL_blit_N.c │ ├── SDL_blit_auto.c │ ├── SDL_blit_auto.h │ ├── SDL_blit_copy.c │ ├── SDL_blit_copy.h │ ├── SDL_blit_slow.c │ ├── SDL_blit_slow.h │ ├── SDL_bmp.c │ ├── SDL_clipboard.c │ ├── SDL_egl.c │ ├── SDL_egl_c.h │ ├── SDL_fillrect.c │ ├── SDL_pixels.c │ ├── SDL_pixels_c.h │ ├── SDL_rect.c │ ├── SDL_rect_c.h │ ├── SDL_shape.c │ ├── SDL_shape_internals.h │ ├── SDL_stretch.c │ ├── SDL_surface.c │ ├── SDL_sysvideo.h │ ├── SDL_video.c │ └── raspberry │ ├── SDL_rpievents.c │ ├── SDL_rpievents_c.h │ ├── SDL_rpiframebuffer.c │ ├── SDL_rpiframebuffer_c.h │ ├── SDL_rpivideo.c │ └── SDL_rpivideo.h ├── SDL2_image ├── .cproject ├── .gitignore ├── .project ├── CHANGES.txt ├── COPYING.txt ├── IMG.c ├── IMG_bmp.c ├── IMG_gif.c ├── IMG_jpg.c ├── IMG_png.c ├── IMG_tif.c ├── IMG_webp.c ├── Makefile ├── README.txt ├── SDL_image.h ├── miniz.h └── pkgconfig.mk ├── SDL2_mixer ├── .cproject ├── .gitignore ├── .project ├── CHANGES.txt ├── COPYING.txt ├── Makefile ├── README.txt ├── SDL_mixer.h ├── dynamic_flac.c ├── dynamic_flac.h ├── dynamic_fluidsynth.c ├── dynamic_fluidsynth.h ├── dynamic_mod.c ├── dynamic_mod.h ├── dynamic_modplug.c ├── dynamic_modplug.h ├── dynamic_mp3.c ├── dynamic_mp3.h ├── dynamic_ogg.c ├── dynamic_ogg.h ├── effect_position.c ├── effect_stereoreverse.c ├── effects_internal.c ├── effects_internal.h ├── fluidsynth.c ├── fluidsynth.h ├── load_aiff.c ├── load_aiff.h ├── load_flac.c ├── load_flac.h ├── load_ogg.c ├── load_ogg.h ├── load_voc.c ├── load_voc.h ├── mixer.c ├── music.c ├── music_cmd.c ├── music_cmd.h ├── music_flac.c ├── music_flac.h ├── music_mad.c ├── music_mad.h ├── music_mod.c ├── music_mod.h ├── music_modplug.c ├── music_modplug.h ├── music_ogg.c ├── music_ogg.h ├── pkgconfig.mk ├── wavestream.c └── wavestream.h ├── abbaye ├── .cproject ├── .project ├── Makefile ├── README ├── abbaye.desktop ├── abbaye.png ├── data │ ├── enemies.txt │ └── map.txt ├── fonts │ └── VeniceClassic.ttf ├── graphics │ ├── blueparch.png │ ├── ending.png │ ├── fonts.png │ ├── gameover.png │ ├── history.png │ ├── intro.png │ ├── intromd.png │ ├── parchment.png │ ├── parchment1.png │ ├── parchment2.png │ ├── parchment3.png │ ├── parchment4.png │ ├── parchment5.png │ ├── parchment6.png │ ├── redparch.png │ └── tiles.png ├── sounds │ ├── AreaIChurchN.ogg │ ├── AreaIICavesV2N.ogg │ ├── AreaIIIHellN.ogg │ ├── EvilFightN.ogg │ ├── GameOverV2N.ogg │ ├── HangmansTree.ogg │ ├── Item.ogg │ ├── MainTitleN.ogg │ ├── ManhuntN.ogg │ ├── ManhuntwoodN.ogg │ ├── PrayerofHopeN.ogg │ ├── doorfx.ogg │ ├── jump.ogg │ ├── mechanismn.ogg │ ├── onedeathn.ogg │ ├── shoot.ogg │ └── slash.ogg └── src │ ├── drawing.c │ ├── ending.c │ ├── enemies.c │ ├── game.c │ ├── gameover.c │ ├── history.c │ ├── jean.c │ ├── loading.c │ ├── main.c │ ├── startscreen.c │ └── structs.h ├── kernel ├── .cproject ├── .gitignore ├── .project ├── Makefile ├── audio.c ├── audio.h ├── common.mk ├── console.c ├── console.h ├── emmc.c ├── emmc.h ├── fatfs │ ├── 00readme.txt │ ├── diskio.c │ ├── diskio.h │ ├── ff.c │ ├── ff.h │ ├── ffconf.h │ ├── integer.h │ └── option │ │ ├── cc932.c │ │ ├── cc936.c │ │ ├── cc949.c │ │ ├── cc950.c │ │ ├── ccsbcs.c │ │ ├── syscall.c │ │ └── unicode.c ├── fb.c ├── fb.h ├── kernel.h ├── platform.c ├── platform.h ├── platform.inc ├── raspberry.ld ├── rules.mk ├── start.s ├── syscalls.c ├── usb.c ├── uspi.h ├── uspi │ ├── CREDITS │ ├── LICENSE │ ├── README │ ├── README.md │ ├── assert.h │ ├── bcm2835.h │ ├── devicenameservice.c │ ├── devicenameservice.h │ ├── doc │ │ └── keyboard.txt │ ├── dwhci.h │ ├── dwhcidevice.c │ ├── dwhcidevice.h │ ├── dwhciframeschednper.c │ ├── dwhciframeschednper.h │ ├── dwhciframeschednsplit.c │ ├── dwhciframeschednsplit.h │ ├── dwhciframeschedper.c │ ├── dwhciframeschedper.h │ ├── dwhciframescheduler.h │ ├── dwhciregister.c │ ├── dwhciregister.h │ ├── dwhcirootport.c │ ├── dwhcirootport.h │ ├── dwhcixferstagedata.c │ ├── dwhcixferstagedata.h │ ├── keymap.c │ ├── keymap.h │ ├── keymap_de.h │ ├── keymap_uk.h │ ├── macaddress.c │ ├── macaddress.h │ ├── macros.h │ ├── smsc951x.c │ ├── smsc951x.h │ ├── stdarg.h │ ├── string.c │ ├── string.h │ ├── synchronize.c │ ├── synchronize.h │ ├── types.h │ ├── usb.h │ ├── usbconfigparser.c │ ├── usbconfigparser.h │ ├── usbdevice.c │ ├── usbdevice.h │ ├── usbdevicefactory.c │ ├── usbdevicefactory.h │ ├── usbendpoint.c │ ├── usbendpoint.h │ ├── usbgamepad.c │ ├── usbgamepad.h │ ├── usbhid.h │ ├── usbhostcontroller.h │ ├── usbhub.h │ ├── usbkeyboard.c │ ├── usbkeyboard.h │ ├── usbmassdevice.c │ ├── usbmassdevice.h │ ├── usbmouse.c │ ├── usbmouse.h │ ├── usbrequest.c │ ├── usbrequest.h │ ├── usbstandardhub.c │ ├── usbstandardhub.h │ ├── usbstring.c │ ├── usbstring.h │ ├── uspilibrary.c │ ├── uspilibrary.h │ ├── uspios.c │ ├── util.c │ └── util.h ├── uspios.h ├── wiring.c └── wiring.h ├── libogg ├── .cproject ├── .gitignore ├── .project ├── Makefile ├── bitwise.c ├── config.h ├── framing.c └── include │ └── ogg │ ├── config_types.h │ ├── ogg.h │ └── os_types.h ├── libpng ├── .cproject ├── .gitignore ├── .project ├── CHANGES ├── LICENSE ├── Makefile ├── arm │ ├── arm_init.c │ ├── filter_neon.S │ └── filter_neon_intrinsics.c ├── config.h ├── example.c ├── libpng-manual.txt ├── pkgconfig.mk ├── png.c ├── png.h ├── pngconf.h ├── pngdebug.h ├── pngerror.c ├── pngget.c ├── pnginfo.h ├── pnglibconf.h ├── pngmem.c ├── pngpread.c ├── pngprefix.h ├── pngpriv.h ├── pngread.c ├── pngrio.c ├── pngrtran.c ├── pngrutil.c ├── pngset.c ├── pngstruct.h ├── pngtest.c ├── pngtrans.c ├── pngwio.c ├── pngwrite.c ├── pngwtran.c └── pngwutil.c ├── libvorbis ├── .cproject ├── .gitignore ├── .project ├── AUTHORS ├── CHANGES ├── COPYING ├── Makefile ├── README ├── config.h ├── include │ └── vorbis │ │ ├── codec.h │ │ ├── vorbisenc.h │ │ └── vorbisfile.h ├── lib │ ├── analysis.c │ ├── backends.h │ ├── bitrate.c │ ├── bitrate.h │ ├── block.c │ ├── books │ │ ├── coupled │ │ │ ├── res_books_51.h │ │ │ └── res_books_stereo.h │ │ ├── floor │ │ │ └── floor_books.h │ │ └── uncoupled │ │ │ └── res_books_uncoupled.h │ ├── codebook.c │ ├── codebook.h │ ├── codec_internal.h │ ├── envelope.c │ ├── envelope.h │ ├── floor0.c │ ├── floor1.c │ ├── highlevel.h │ ├── info.c │ ├── lookup.c │ ├── lookup.h │ ├── lookup_data.h │ ├── lpc.c │ ├── lpc.h │ ├── lsp.c │ ├── lsp.h │ ├── mapping0.c │ ├── masking.h │ ├── mdct.c │ ├── mdct.h │ ├── misc.h │ ├── modes │ │ ├── floor_all.h │ │ ├── psych_11.h │ │ ├── psych_16.h │ │ ├── psych_44.h │ │ ├── psych_8.h │ │ ├── residue_16.h │ │ ├── residue_44.h │ │ ├── residue_44p51.h │ │ ├── residue_44u.h │ │ ├── residue_8.h │ │ ├── setup_11.h │ │ ├── setup_16.h │ │ ├── setup_22.h │ │ ├── setup_32.h │ │ ├── setup_44.h │ │ ├── setup_44p51.h │ │ ├── setup_44u.h │ │ ├── setup_8.h │ │ └── setup_X.h │ ├── os.h │ ├── psy.c │ ├── psy.h │ ├── registry.c │ ├── registry.h │ ├── res0.c │ ├── scales.h │ ├── sharedbook.c │ ├── smallft.c │ ├── smallft.h │ ├── synthesis.c │ ├── vorbisenc.c │ ├── vorbisfile.c │ ├── window.c │ └── window.h ├── pkgconfig.mk └── todo.txt ├── template ├── .cproject ├── .project ├── Makefile └── main.c ├── template_sdl ├── .cproject ├── .project ├── Makefile └── main.c └── zlib ├── .cproject ├── .gitignore ├── .project ├── ChangeLog ├── FAQ ├── Makefile ├── README ├── adler32.c ├── compress.c ├── crc32.c ├── crc32.h ├── deflate.c ├── deflate.h ├── doc ├── algorithm.txt ├── rfc1950.txt ├── rfc1951.txt ├── rfc1952.txt └── txtvsbin.txt ├── gzclose.c ├── gzguts.h ├── gzlib.c ├── gzread.c ├── gzwrite.c ├── infback.c ├── inffast.c ├── inffast.h ├── inffixed.h ├── inflate.c ├── inflate.h ├── inftrees.c ├── inftrees.h ├── pkgconfig.mk ├── trees.c ├── trees.h ├── uncompr.c ├── zconf.h ├── zlib.h ├── zutil.c └── zutil.h /.gitignore: -------------------------------------------------------------------------------- 1 | .metadata/ 2 | .settings/ 3 | org.eclipse.cdt.codan.core.prefs 4 | .deps/ 5 | *.o 6 | kernel.img 7 | kernel.map 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | make -C kernel 4 | make -C zlib 5 | make -C libpng 6 | make -C libogg 7 | make -C libvorbis 8 | make -C SDL2 9 | make -C SDL2_image 10 | make -C SDL2_mixer 11 | make -C template 12 | make -C template_sdl 13 | make -C abbaye 14 | 15 | install: 16 | make -C kernel -k install 17 | make -C zlib -k install 18 | make -C libpng -k install 19 | make -C libogg -k install 20 | make -C libvorbis -k install 21 | make -C SDL2 -k install 22 | make -C SDL2_image -k install 23 | make -C SDL2_mixer -k install 24 | 25 | clean: 26 | make -C kernel -k clean 27 | make -C zlib -k clean 28 | make -C libpng -k clean 29 | make -C libogg -k clean 30 | make -C libvorbis -k clean 31 | make -C SDL2 -k clean 32 | make -C SDL2_image -k clean 33 | make -C SDL2_mixer -k clean 34 | make -C template -k clean 35 | make -C template_sdl -k clean 36 | make -C abbaye -k clean 37 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Raspberry Pi Baremetal 2 | 3 | This a code repository for bare-metal Raspberry Pi libraries and applications 4 | ports. 5 | 6 | kernel - Core startup and kernel code, with USB support 7 | provided by USPi library 8 | 9 | libpng - PNG image file format library 10 | libogg - OGG file format library 11 | libvorbis - OGG Vorbis audio decode library 12 | SDL2 - Simple Directmedia Library 13 | SDL2_image - Image decoding support library for SDL2 14 | SDL2_mixer - Audio mixer support library for SDL2 15 | zlib - Z compression library 16 | 17 | abbaye - Abbaye des Morts, a platform game based on SDL2 18 | template - Simple application template 19 | templaye_sdl - SDL-based application template 20 | 21 | BUILD 22 | 23 | You need the arm-none-eabi toolchain available from 24 | https://launchpad.net/gcc-arm-embedded 25 | 26 | Compile with: 27 | 28 | make all 29 | 30 | Each folder has its own Makefile and can be compiled separately. 31 | 32 | INSTALL 33 | 34 | The applications folders abbaye and template builds a kernel.img file that 35 | must be copied to an SD card along with the firmware files: 36 | 37 | bootcode.bin 38 | config.txt 39 | fixup_cd.dat 40 | fixup.dat 41 | start_cd.elf 42 | start.elf 43 | 44 | Firmware files can be downloaded from 45 | https://github.com/raspberrypi/firmware/tree/master/boot 46 | -------------------------------------------------------------------------------- /SDL2/.gitignore: -------------------------------------------------------------------------------- 1 | libSDL2.a 2 | -------------------------------------------------------------------------------- /SDL2/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | SDL2 4 | 5 | 6 | kernel 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | full,incremental, 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.cdt.core.cnature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 26 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 27 | 28 | 29 | -------------------------------------------------------------------------------- /SDL2/BUGS.txt: -------------------------------------------------------------------------------- 1 | 2 | Bugs are now managed in the SDL bug tracker, here: 3 | 4 | http://bugzilla.libsdl.org/ 5 | 6 | You may report bugs there, and search to see if a given issue has already 7 | been reported, discussed, and maybe even fixed. 8 | 9 | 10 | You may also find help on the SDL mailing list. Subscription information: 11 | 12 | http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org 13 | 14 | Bug reports are welcome here, but we really appreciate if you use Bugzilla, as 15 | bugs discussed on the mailing list may be forgotten or missed. 16 | 17 | -------------------------------------------------------------------------------- /SDL2/COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | -------------------------------------------------------------------------------- /SDL2/CREDITS.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer CREDITS 3 | Thanks to everyone who made this possible, including: 4 | 5 | * Cliff Matthews, for giving me a reason to start this project. :) 6 | -- Executor rocks! *grin* 7 | 8 | * Ryan Gordon for helping everybody out and keeping the dream alive. :) 9 | 10 | * Gabriel Jacobo for his work on the Android port and generally helping out all around. 11 | 12 | * Philipp Wiesemann for his attention to detail reviewing the entire SDL code base and proposes patches. 13 | 14 | * Andreas Schiffler for his dedication to unit tests, Visual Studio projects, and managing the Google Summer of Code. 15 | 16 | * Mike Sartain for incorporating SDL into Team Fortress 2 and cheering me on at Valve. 17 | 18 | * Alfred Reynolds for the game controller API and general (in)sanity 19 | 20 | * Jørgen Tjernø for numerous magical Mac OS X fixes. 21 | 22 | * Pierre-Loup Griffais for his deep knowledge of OpenGL drivers. 23 | 24 | * Julian Winter for the SDL 2.0 website. 25 | 26 | * Sheena Smith for many months of great work on the SDL wiki creating the API documentation and style guides. 27 | 28 | * Paul Hunkin for his port of SDL to Android during the Google Summer of Code 2010. 29 | 30 | * Eli Gottlieb for his work on shaped windows during the Google Summer of Code 2010. 31 | 32 | * Jim Grandpre for his work on multi-touch and gesture recognition during 33 | the Google Summer of Code 2010. 34 | 35 | * Edgar "bobbens" Simo for his force feedback API development during the 36 | Google Summer of Code 2008. 37 | 38 | * Aaron Wishnick for his work on audio resampling and pitch shifting during 39 | the Google Summer of Code 2008. 40 | 41 | * Holmes Futrell for his port of SDL to the iPhone and iPod Touch during the 42 | Google Summer of Code 2008. 43 | 44 | * Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation. 45 | 46 | * Everybody at Loki Software, Inc. for their great contributions! 47 | 48 | And a big hand to everyone else who has contributed over the years. 49 | 50 | THANKS! :) 51 | 52 | -- Sam Lantinga 53 | 54 | -------------------------------------------------------------------------------- /SDL2/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | 13 | PREFIX := /opt/raspberry-pi 14 | 15 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 16 | CFLAGS = -O3 -Iinclude -Isrc -I../kernel -ffreestanding -fvisibility=hidden -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp -D_REENTRANT -D__RASPBERRY_PI__ -DHAVE_USPI 17 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 18 | 19 | all: libSDL2.a 20 | 21 | OBJS = $(shell find . -name *.c -print | sed -r 's/\.c+/\.o/g') 22 | 23 | -include $(shell find $(DEPDIR) -name *.Po -print) 24 | 25 | libSDL2.a: $(OBJS) Makefile 26 | $(AR) rcs $@ $(OBJS) 27 | 28 | %.o: %.c 29 | @mkdir -p $(DEPDIR)/$(@D) 30 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 31 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 32 | 33 | %.o: %.cpp 34 | @mkdir -p $(DEPDIR)/$(@D) 35 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 36 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 37 | 38 | %.o: %.s 39 | $(AS) $(ASFLAGS) -o $@ $< 40 | 41 | install: 42 | -mkdir -p $(PREFIX)/include/SDL2 43 | cp -f include/* $(PREFIX)/include/SDL2 44 | -mkdir -p $(PREFIX)/lib 45 | cp -f libSDL2.a $(PREFIX)/lib 46 | 47 | clean: 48 | rm -f $(OBJS) libSDL2.a 49 | rm -rf $(DEPDIR) 50 | -------------------------------------------------------------------------------- /SDL2/README-SDL.txt: -------------------------------------------------------------------------------- 1 | 2 | Please distribute this file with the SDL runtime environment: 3 | 4 | The Simple DirectMedia Layer (SDL for short) is a cross-platform library 5 | designed to make it easy to write multi-media software, such as games and 6 | emulators. 7 | 8 | The Simple DirectMedia Layer library source code is available from: 9 | http://www.libsdl.org/ 10 | 11 | This library is distributed under the terms of the zlib license: 12 | http://www.zlib.net/zlib_license.html 13 | 14 | -------------------------------------------------------------------------------- /SDL2/README-porting.txt: -------------------------------------------------------------------------------- 1 | 2 | * Porting To A New Platform 3 | 4 | The first thing you have to do when porting to a new platform, is look at 5 | include/SDL_platform.h and create an entry there for your operating system. 6 | The standard format is __PLATFORM__, where PLATFORM is the name of the OS. 7 | Ideally SDL_platform.h will be able to auto-detect the system it's building 8 | on based on C preprocessor symbols. 9 | 10 | There are two basic ways of building SDL at the moment: 11 | 12 | 1. The "UNIX" way: ./configure; make; make install 13 | 14 | If you have a GNUish system, then you might try this. Edit configure.in, 15 | take a look at the large section labelled: 16 | "Set up the configuration based on the target platform!" 17 | Add a section for your platform, and then re-run autogen.sh and build! 18 | 19 | 2. Using an IDE: 20 | 21 | If you're using an IDE or other non-configure build system, you'll probably 22 | want to create a custom SDL_config.h for your platform. Edit SDL_config.h, 23 | add a section for your platform, and create a custom SDL_config_{platform}.h, 24 | based on SDL_config.h.minimal and SDL_config.h.in 25 | 26 | Add the top level include directory to the header search path, and then add 27 | the following sources to the project: 28 | src/*.c 29 | src/atomic/*.c 30 | src/audio/*.c 31 | src/cpuinfo/*.c 32 | src/events/*.c 33 | src/file/*.c 34 | src/haptic/*.c 35 | src/joystick/*.c 36 | src/power/*.c 37 | src/render/*.c 38 | src/stdlib/*.c 39 | src/thread/*.c 40 | src/timer/*.c 41 | src/video/*.c 42 | src/audio/disk/*.c 43 | src/audio/dummy/*.c 44 | src/video/dummy/*.c 45 | src/haptic/dummy/*.c 46 | src/joystick/dummy/*.c 47 | src/main/dummy/*.c 48 | src/thread/generic/*.c 49 | src/timer/dummy/*.c 50 | src/loadso/dummy/*.c 51 | 52 | 53 | Once you have a working library without any drivers, you can go back to each 54 | of the major subsystems and start implementing drivers for your platform. 55 | 56 | If you have any questions, don't hesitate to ask on the SDL mailing list: 57 | http://www.libsdl.org/mailing-list.php 58 | 59 | Enjoy! 60 | Sam Lantinga (slouken@libsdl.org) 61 | 62 | -------------------------------------------------------------------------------- /SDL2/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | 4 | (SDL) 5 | 6 | Version 2.0 7 | 8 | --- 9 | http://www.libsdl.org/ 10 | 11 | Simple DirectMedia Layer is a cross-platform development library designed 12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics 13 | hardware via OpenGL and Direct3D. It is used by video playback software, 14 | emulators, and popular games including Valve's award winning catalog 15 | and many Humble Bundle games. 16 | 17 | SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. 18 | Support for other platforms may be found in the source code. 19 | 20 | SDL is written in C, works natively with C++, and there are bindings 21 | available for several other languages, including C# and Python. 22 | 23 | This library is distributed under the zlib license, which can be found 24 | in the file "COPYING.txt". 25 | 26 | The best way to learn how to use SDL is to check out the header files in 27 | the "include" subdirectory and the programs in the "test" subdirectory. 28 | The header files and test programs are well commented and always up to date. 29 | More documentation and FAQs are available online at: 30 | http://wiki.libsdl.org/ 31 | 32 | If you need help with the library, or just want to discuss SDL related 33 | issues, you can join the developers mailing list: 34 | http://www.libsdl.org/mailing-list.php 35 | 36 | If you want to report bugs or contribute patches, please submit them to 37 | bugzilla: 38 | http://bugzilla.libsdl.org/ 39 | 40 | Enjoy! 41 | Sam Lantinga (slouken@libsdl.org) 42 | 43 | -------------------------------------------------------------------------------- /SDL2/TODO.txt: -------------------------------------------------------------------------------- 1 | Future work roadmap: 2 | * http://wiki.libsdl.org/moin.cgi/Roadmap 3 | 4 | * Check 1.2 revisions: 5 | 3554 - Need to resolve semantics for locking keys on different platforms 6 | 4874 - Do we want screen rotation? At what level? 7 | 4974 - Windows file code needs to convert UTF-8 to Unicode, but we don't need to tap dance for Windows 95/98 8 | 4865 - See if this is still needed (mouse coordinate clamping) 9 | 4866 - See if this is still needed (blocking window repositioning) 10 | 11 | -------------------------------------------------------------------------------- /SDL2/include/SDL_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef _SDL_config_h 23 | #define _SDL_config_h 24 | 25 | #include "SDL_platform.h" 26 | 27 | /** 28 | * \file SDL_config.h 29 | */ 30 | 31 | /* Add any platform that doesn't build using the configure system. */ 32 | #ifdef USING_PREMAKE_CONFIG_H 33 | #include "SDL_config_premake.h" 34 | #elif defined(__WIN32__) 35 | #include "SDL_config_windows.h" 36 | #elif defined(__WINRT__) 37 | #include "SDL_config_winrt.h" 38 | #elif defined(__MACOSX__) 39 | #include "SDL_config_macosx.h" 40 | #elif defined(__IPHONEOS__) 41 | #include "SDL_config_iphoneos.h" 42 | #elif defined(__ANDROID__) 43 | #include "SDL_config_android.h" 44 | #elif defined(__PSP__) 45 | #include "SDL_config_psp.h" 46 | #elif defined(__RASPBERRY_PI__) 47 | #include "SDL_config_raspberry.h" 48 | #else 49 | /* This is a minimal configuration just to get SDL running on new platforms */ 50 | #include "SDL_config_minimal.h" 51 | #endif /* platform config */ 52 | 53 | #ifdef USING_GENERATED_CONFIG_H 54 | #error Wrong SDL_config.h, check your include path? 55 | #endif 56 | 57 | #endif /* _SDL_config_h */ 58 | -------------------------------------------------------------------------------- /SDL2/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /SDL2/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef _SDLname_h_ 23 | #define _SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* _SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /SDL2/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | 28 | #ifdef __IPHONEOS__ 29 | #include 30 | #include 31 | #else 32 | #include 33 | #include 34 | #endif 35 | 36 | #ifndef APIENTRY 37 | #define APIENTRY 38 | #endif 39 | -------------------------------------------------------------------------------- /SDL2/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-8628:b558f99d48f0" 2 | #define SDL_REVISION_NUMBER 8628 3 | -------------------------------------------------------------------------------- /SDL2/include/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef _SDL_test_log_h 37 | #define _SDL_test_log_h 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(const char *fmt, ...); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(const char *fmt, ...); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* _SDL_test_log_h */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /SDL2/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /SDL2/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #undef _begin_code_h 30 | 31 | /* Reset structure packing at previous byte alignment */ 32 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) 33 | #ifdef __BORLANDC__ 34 | #pragma nopackwarning 35 | #endif 36 | #pragma pack(pop) 37 | #endif /* Compiler needs structure packing set */ 38 | -------------------------------------------------------------------------------- /SDL2/pkgconfig.mk: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS += -I../SDL2/include 3 | 4 | LDFLAGS += -L../SDL2 5 | 6 | LIBS := -lSDL2 $(LIBS) 7 | LIBS_DEP += ../SDL2/libSDL2.a 8 | -------------------------------------------------------------------------------- /SDL2/src/SDL_assert_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | extern void SDL_AssertionsQuit(void); 23 | 24 | /* vi: set ts=4 sw=4 expandtab: */ 25 | -------------------------------------------------------------------------------- /SDL2/src/SDL_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #ifndef _SDL_internal_h 22 | #define _SDL_internal_h 23 | 24 | #include "dynapi/SDL_dynapi.h" 25 | 26 | #if SDL_DYNAMIC_API 27 | #include "dynapi/SDL_dynapi_overrides.h" 28 | /* force DECLSPEC and SDLCALL off...it's all internal symbols now. 29 | These will have actual #defines during SDL_dynapi.c only */ 30 | #define DECLSPEC 31 | #define SDLCALL 32 | #endif 33 | 34 | #include "SDL_config.h" 35 | 36 | #endif 37 | 38 | /* vi: set ts=4 sw=4 expandtab: */ 39 | -------------------------------------------------------------------------------- /SDL2/src/audio/SDL_audio_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */ 24 | 25 | /* Functions to get a list of "close" audio formats */ 26 | extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format); 27 | extern SDL_AudioFormat SDL_NextAudioFormat(void); 28 | 29 | /* Function to calculate the size and silence for a SDL_AudioSpec */ 30 | extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec); 31 | 32 | /* The actual mixing thread function */ 33 | extern int SDLCALL SDL_RunAudio(void *audiop); 34 | 35 | /* this is used internally to access some autogenerated code. */ 36 | typedef struct 37 | { 38 | SDL_AudioFormat src_fmt; 39 | SDL_AudioFormat dst_fmt; 40 | SDL_AudioFilter filter; 41 | } SDL_AudioTypeFilters; 42 | extern const SDL_AudioTypeFilters sdl_audio_type_filters[]; 43 | 44 | /* this is used internally to access some autogenerated code. */ 45 | typedef struct 46 | { 47 | SDL_AudioFormat fmt; 48 | int channels; 49 | int upsample; 50 | int multiple; 51 | SDL_AudioFilter filter; 52 | } SDL_AudioRateFilters; 53 | extern const SDL_AudioRateFilters sdl_audio_rate_filters[]; 54 | 55 | /* vi: set ts=4 sw=4 expandtab: */ 56 | -------------------------------------------------------------------------------- /SDL2/src/audio/SDL_audiodev_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "SDL.h" 22 | #include "../SDL_internal.h" 23 | #include "SDL_sysaudio.h" 24 | 25 | /* Open the audio device for playback, and don't block if busy */ 26 | /* #define USE_BLOCKING_WRITES */ 27 | 28 | #ifdef USE_BLOCKING_WRITES 29 | #define OPEN_FLAGS_OUTPUT O_WRONLY 30 | #define OPEN_FLAGS_INPUT O_RDONLY 31 | #else 32 | #define OPEN_FLAGS_OUTPUT (O_WRONLY|O_NONBLOCK) 33 | #define OPEN_FLAGS_INPUT (O_RDONLY|O_NONBLOCK) 34 | #endif 35 | 36 | void SDL_EnumUnixAudioDevices(int iscapture, int classic, 37 | int (*test) (int fd), SDL_AddAudioDevice addfn); 38 | 39 | /* vi: set ts=4 sw=4 expandtab: */ 40 | -------------------------------------------------------------------------------- /SDL2/src/audio/SDL_audiomem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #define SDL_AllocAudioMem SDL_malloc 24 | #define SDL_FreeAudioMem SDL_free 25 | /* vi: set ts=4 sw=4 expandtab: */ 26 | -------------------------------------------------------------------------------- /SDL2/src/audio/raspberry/SDL_raspberryaudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #ifndef _SDL_rpiaudio_h 24 | #define _SDL_rpiaudio_h 25 | 26 | #include "../SDL_sysaudio.h" 27 | 28 | /* Hidden "this" pointer for the audio functions */ 29 | #define _THIS SDL_AudioDevice *this 30 | 31 | struct SDL_PrivateAudioData { 32 | /* The file descriptor for the audio device */ 33 | Uint8 *mixbuf; 34 | Uint32 mixlen; 35 | Uint32 write_delay; 36 | Uint32 initial_calls; 37 | }; 38 | 39 | #endif /* _SDL_rpiaudio_h */ 40 | /* vi: set ts=4 sw=4 expandtab: */ 41 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_clipboardevents.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Clipboard event handling code for SDL */ 24 | 25 | #include "SDL_events.h" 26 | #include "SDL_events_c.h" 27 | #include "SDL_clipboardevents_c.h" 28 | 29 | 30 | int 31 | SDL_SendClipboardUpdate(void) 32 | { 33 | int posted; 34 | 35 | /* Post the event, if desired */ 36 | posted = 0; 37 | if (SDL_GetEventState(SDL_CLIPBOARDUPDATE) == SDL_ENABLE) { 38 | SDL_Event event; 39 | event.type = SDL_CLIPBOARDUPDATE; 40 | 41 | posted = (SDL_PushEvent(&event) > 0); 42 | } 43 | return (posted); 44 | } 45 | 46 | /* vi: set ts=4 sw=4 expandtab: */ 47 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_clipboardevents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_clipboardevents_c_h 24 | #define _SDL_clipboardevents_c_h 25 | 26 | extern int SDL_SendClipboardUpdate(void); 27 | 28 | #endif /* _SDL_clipboardevents_c_h */ 29 | 30 | /* vi: set ts=4 sw=4 expandtab: */ 31 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_dropevents.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Drag and drop event handling code for SDL */ 24 | 25 | #include "SDL_events.h" 26 | #include "SDL_events_c.h" 27 | #include "SDL_dropevents_c.h" 28 | 29 | 30 | int 31 | SDL_SendDropFile(const char *file) 32 | { 33 | int posted; 34 | 35 | /* Post the event, if desired */ 36 | posted = 0; 37 | if (SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) { 38 | SDL_Event event; 39 | event.type = SDL_DROPFILE; 40 | event.drop.file = SDL_strdup(file); 41 | posted = (SDL_PushEvent(&event) > 0); 42 | } 43 | return (posted); 44 | } 45 | 46 | /* vi: set ts=4 sw=4 expandtab: */ 47 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_dropevents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_dropevents_c_h 24 | #define _SDL_dropevents_c_h 25 | 26 | extern int SDL_SendDropFile(const char *file); 27 | 28 | #endif /* _SDL_dropevents_c_h */ 29 | 30 | /* vi: set ts=4 sw=4 expandtab: */ 31 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_events_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Useful functions and variables from SDL_events.c */ 24 | #include "SDL_events.h" 25 | #include "SDL_thread.h" 26 | #include "SDL_clipboardevents_c.h" 27 | #include "SDL_dropevents_c.h" 28 | #include "SDL_gesture_c.h" 29 | #include "SDL_keyboard_c.h" 30 | #include "SDL_mouse_c.h" 31 | #include "SDL_touch_c.h" 32 | #include "SDL_windowevents_c.h" 33 | 34 | /* Start and stop the event processing loop */ 35 | extern int SDL_StartEventLoop(void); 36 | extern void SDL_StopEventLoop(void); 37 | extern void SDL_QuitInterrupt(void); 38 | 39 | extern int SDL_SendAppEvent(SDL_EventType eventType); 40 | extern int SDL_SendSysWMEvent(SDL_SysWMmsg * message); 41 | 42 | extern int SDL_QuitInit(void); 43 | extern int SDL_SendQuit(void); 44 | extern void SDL_QuitQuit(void); 45 | 46 | /* The event filter function */ 47 | extern SDL_EventFilter SDL_EventOK; 48 | extern void *SDL_EventOKParam; 49 | 50 | /* vi: set ts=4 sw=4 expandtab: */ 51 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_gesture_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_gesture_c_h 24 | #define _SDL_gesture_c_h 25 | 26 | extern int SDL_GestureAddTouch(SDL_TouchID touchId); 27 | 28 | extern void SDL_GestureProcessEvent(SDL_Event* event); 29 | 30 | extern int SDL_RecordGesture(SDL_TouchID touchId); 31 | 32 | #endif /* _SDL_gesture_c_h */ 33 | 34 | /* vi: set ts=4 sw=4 expandtab: */ 35 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_sysevents.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #include "../video/SDL_sysvideo.h" 24 | 25 | /* Useful functions and variables from SDL_sysevents.c */ 26 | 27 | #if defined(__HAIKU__) 28 | /* The Haiku event loops run in a separate thread */ 29 | #define MUST_THREAD_EVENTS 30 | #endif 31 | 32 | #ifdef __WIN32__ /* Windows doesn't allow a separate event thread */ 33 | #define CANT_THREAD_EVENTS 34 | #endif 35 | 36 | /* vi: set ts=4 sw=4 expandtab: */ 37 | -------------------------------------------------------------------------------- /SDL2/src/events/SDL_windowevents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | #ifndef _SDL_windowevents_c_h 24 | #define _SDL_windowevents_c_h 25 | 26 | extern int SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, 27 | int data1, int data2); 28 | 29 | #endif /* _SDL_windowevents_c_h */ 30 | 31 | /* vi: set ts=4 sw=4 expandtab: */ 32 | -------------------------------------------------------------------------------- /SDL2/src/events/blank_cursor.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 23 | * A default blank 8x8 cursor */ 24 | 25 | #define BLANK_CWIDTH 8 26 | #define BLANK_CHEIGHT 8 27 | #define BLANK_CHOTX 0 28 | #define BLANK_CHOTY 0 29 | 30 | static const unsigned char blank_cdata[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 31 | static const unsigned char blank_cmask[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /SDL2/src/events/default_cursor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/SDL2/src/events/default_cursor.h -------------------------------------------------------------------------------- /SDL2/src/haptic/SDL_haptic_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | extern int SDL_HapticInit(void); 23 | extern void SDL_HapticQuit(void); 24 | 25 | /* vi: set ts=4 sw=4 expandtab: */ 26 | -------------------------------------------------------------------------------- /SDL2/src/libm/math_libm.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Math routines from uClibc: http://www.uclibc.org */ 24 | 25 | double SDL_uclibc_atan(double x); 26 | double SDL_uclibc_atan2(double y, double x); 27 | double SDL_uclibc_copysign(double x, double y); 28 | double SDL_uclibc_cos(double x); 29 | double SDL_uclibc_fabs(double x); 30 | double SDL_uclibc_floor(double x); 31 | double SDL_uclibc_log(double x); 32 | double SDL_uclibc_pow(double x, double y); 33 | double SDL_uclibc_scalbn(double x, int n); 34 | double SDL_uclibc_sin(double x); 35 | double SDL_uclibc_sqrt(double x); 36 | 37 | /* vi: set ts=4 sw=4 expandtab: */ 38 | -------------------------------------------------------------------------------- /SDL2/src/render/SDL_d3dmath.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | 24 | /* Direct3D matrix math functions */ 25 | 26 | typedef struct 27 | { 28 | float x; 29 | float y; 30 | } Float2; 31 | 32 | typedef struct 33 | { 34 | float x; 35 | float y; 36 | float z; 37 | } Float3; 38 | 39 | typedef struct 40 | { 41 | float x; 42 | float y; 43 | float z; 44 | float w; 45 | } Float4; 46 | 47 | typedef struct 48 | { 49 | union { 50 | struct { 51 | float _11, _12, _13, _14; 52 | float _21, _22, _23, _24; 53 | float _31, _32, _33, _34; 54 | float _41, _42, _43, _44; 55 | }; 56 | float m[4][4]; 57 | }; 58 | } Float4X4; 59 | 60 | 61 | Float4X4 MatrixIdentity(); 62 | Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2); 63 | Float4X4 MatrixScaling(float x, float y, float z); 64 | Float4X4 MatrixTranslation(float x, float y, float z); 65 | Float4X4 MatrixRotationX(float r); 66 | Float4X4 MatrixRotationY(float r); 67 | Float4X4 MatrixRotationZ(float r); 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_blendfillrect.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 25 | extern int SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_blendline.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 25 | extern int SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_blendpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 25 | extern int SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_drawline.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_DrawLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color); 25 | extern int SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_drawpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | 24 | extern int SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color); 25 | extern int SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_render_sw_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | extern SDL_Renderer * SW_CreateRendererForSurface(SDL_Surface * surface); 23 | 24 | /* vi: set ts=4 sw=4 expandtab: */ 25 | -------------------------------------------------------------------------------- /SDL2/src/render/software/SDL_rotate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef MIN 23 | #define MIN(a,b) (((a) < (b)) ? (a) : (b)) 24 | #endif 25 | 26 | extern SDL_Surface *SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery, int smooth, int flipx, int flipy, int dstwidth, int dstheight, double cangle, double sangle); 27 | extern void SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, int *dstwidth, int *dstheight, double *cangle, double *sangle); 28 | 29 | -------------------------------------------------------------------------------- /SDL2/src/thread/generic/SDL_sysmutex_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | /* vi: set ts=4 sw=4 expandtab: */ 23 | -------------------------------------------------------------------------------- /SDL2/src/thread/generic/SDL_systhread.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | /* Thread management routines for SDL */ 24 | 25 | #include "SDL_thread.h" 26 | #include "../SDL_systhread.h" 27 | 28 | #ifdef SDL_PASSED_BEGINTHREAD_ENDTHREAD 29 | int 30 | SDL_SYS_CreateThread(SDL_Thread * thread, void *args, 31 | pfnSDL_CurrentBeginThread pfnBeginThread, 32 | pfnSDL_CurrentEndThread pfnEndThread) 33 | #else 34 | int 35 | SDL_SYS_CreateThread(SDL_Thread * thread, void *args) 36 | #endif /* SDL_PASSED_BEGINTHREAD_ENDTHREAD */ 37 | { 38 | return SDL_SetError("Threads are not supported on this platform"); 39 | } 40 | 41 | void 42 | SDL_SYS_SetupThread(const char *name) 43 | { 44 | return; 45 | } 46 | 47 | SDL_threadID 48 | SDL_ThreadID(void) 49 | { 50 | return (0); 51 | } 52 | 53 | int 54 | SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) 55 | { 56 | return (0); 57 | } 58 | 59 | void 60 | SDL_SYS_WaitThread(SDL_Thread * thread) 61 | { 62 | return; 63 | } 64 | 65 | void 66 | SDL_SYS_DetachThread(SDL_Thread * thread) 67 | { 68 | return; 69 | } 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /SDL2/src/thread/generic/SDL_systhread_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | /* Stub until we implement threads on this platform */ 24 | typedef int SYS_ThreadHandle; 25 | 26 | /* vi: set ts=4 sw=4 expandtab: */ 27 | -------------------------------------------------------------------------------- /SDL2/src/thread/generic/SDL_systls.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #include "../../SDL_internal.h" 23 | #include "../SDL_thread_c.h" 24 | 25 | 26 | SDL_TLSData * 27 | SDL_SYS_GetTLSData() 28 | { 29 | return SDL_Generic_GetTLSData(); 30 | } 31 | 32 | int 33 | SDL_SYS_SetTLSData(SDL_TLSData *data) 34 | { 35 | return SDL_Generic_SetTLSData(data); 36 | } 37 | 38 | /* vi: set ts=4 sw=4 expandtab: */ 39 | -------------------------------------------------------------------------------- /SDL2/src/timer/SDL_timer_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Useful functions and variables from SDL_timer.c */ 24 | #include "SDL_timer.h" 25 | 26 | #define ROUND_RESOLUTION(X) \ 27 | (((X+TIMER_RESOLUTION-1)/TIMER_RESOLUTION)*TIMER_RESOLUTION) 28 | 29 | extern void SDL_TicksInit(void); 30 | extern void SDL_TicksQuit(void); 31 | extern int SDL_TimerInit(void); 32 | extern void SDL_TimerQuit(void); 33 | 34 | /* vi: set ts=4 sw=4 expandtab: */ 35 | -------------------------------------------------------------------------------- /SDL2/src/timer/dummy/SDL_systimer.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #if defined(SDL_TIMER_DUMMY) || defined(SDL_TIMERS_DISABLED) 24 | 25 | #include "SDL_timer.h" 26 | 27 | static SDL_bool ticks_started = SDL_FALSE; 28 | 29 | void 30 | SDL_TicksInit(void) 31 | { 32 | if (ticks_started) { 33 | return; 34 | } 35 | ticks_started = SDL_TRUE; 36 | } 37 | 38 | void 39 | SDL_TicksQuit(void) 40 | { 41 | ticks_started = SDL_FALSE; 42 | } 43 | 44 | Uint32 45 | SDL_GetTicks(void) 46 | { 47 | if (!ticks_started) { 48 | SDL_TicksInit(); 49 | } 50 | 51 | SDL_Unsupported(); 52 | return 0; 53 | } 54 | 55 | Uint64 56 | SDL_GetPerformanceCounter(void) 57 | { 58 | return SDL_GetTicks(); 59 | } 60 | 61 | Uint64 62 | SDL_GetPerformanceFrequency(void) 63 | { 64 | return 1000; 65 | } 66 | 67 | void 68 | SDL_Delay(Uint32 ms) 69 | { 70 | SDL_Unsupported(); 71 | } 72 | 73 | #endif /* SDL_TIMER_DUMMY || SDL_TIMERS_DISABLED */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_RLEaccel.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/SDL2/src/video/SDL_RLEaccel.c -------------------------------------------------------------------------------- /SDL2/src/video/SDL_RLEaccel_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Useful functions and variables from SDL_RLEaccel.c */ 24 | 25 | extern int SDL_RLESurface(SDL_Surface * surface); 26 | extern int SDL_RLEBlit(SDL_Surface * src, SDL_Rect * srcrect, 27 | SDL_Surface * dst, SDL_Rect * dstrect); 28 | extern int SDL_RLEAlphaBlit(SDL_Surface * src, SDL_Rect * srcrect, 29 | SDL_Surface * dst, SDL_Rect * dstrect); 30 | extern void SDL_UnRLESurface(SDL_Surface * surface, int recode); 31 | /* vi: set ts=4 sw=4 expandtab: */ 32 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_blit_auto.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT! This file is generated by sdlgenblit.pl */ 2 | /* 3 | Simple DirectMedia Layer 4 | Copyright (C) 1997-2014 Sam Lantinga 5 | 6 | This software is provided 'as-is', without any express or implied 7 | warranty. In no event will the authors be held liable for any damages 8 | arising from the use of this software. 9 | 10 | Permission is granted to anyone to use this software for any purpose, 11 | including commercial applications, and to alter it and redistribute it 12 | freely, subject to the following restrictions: 13 | 14 | 1. The origin of this software must not be misrepresented; you must not 15 | claim that you wrote the original software. If you use this software 16 | in a product, an acknowledgment in the product documentation would be 17 | appreciated but is not required. 18 | 2. Altered source versions must be plainly marked as such, and must not be 19 | misrepresented as being the original software. 20 | 3. This notice may not be removed or altered from any source distribution. 21 | */ 22 | #include "../SDL_internal.h" 23 | 24 | /* *INDENT-OFF* */ 25 | 26 | extern SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[]; 27 | 28 | /* *INDENT-ON* */ 29 | 30 | /* vi: set ts=4 sw=4 expandtab: */ 31 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_blit_copy.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | void SDL_BlitCopy(SDL_BlitInfo * info); 23 | 24 | /* vi: set ts=4 sw=4 expandtab: */ 25 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_blit_slow.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | extern void SDL_Blit_Slow(SDL_BlitInfo * info); 24 | 25 | /* vi: set ts=4 sw=4 expandtab: */ 26 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_pixels_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | /* Useful functions and variables from SDL_pixel.c */ 24 | 25 | #include "SDL_blit.h" 26 | 27 | /* Pixel format functions */ 28 | extern int SDL_InitFormat(SDL_PixelFormat * format, Uint32 pixel_format); 29 | 30 | /* Blit mapping functions */ 31 | extern SDL_BlitMap *SDL_AllocBlitMap(void); 32 | extern void SDL_InvalidateMap(SDL_BlitMap * map); 33 | extern int SDL_MapSurface(SDL_Surface * src, SDL_Surface * dst); 34 | extern void SDL_FreeBlitMap(SDL_BlitMap * map); 35 | 36 | /* Miscellaneous functions */ 37 | extern int SDL_CalculatePitch(SDL_Surface * surface); 38 | extern void SDL_DitherColors(SDL_Color * colors, int bpp); 39 | extern Uint8 SDL_FindColor(SDL_Palette * pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); 40 | 41 | /* vi: set ts=4 sw=4 expandtab: */ 42 | -------------------------------------------------------------------------------- /SDL2/src/video/SDL_rect_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../SDL_internal.h" 22 | 23 | extern SDL_bool SDL_GetSpanEnclosingRect(int width, int height, int numrects, const SDL_Rect * rects, SDL_Rect *span); 24 | 25 | /* vi: set ts=4 sw=4 expandtab: */ 26 | -------------------------------------------------------------------------------- /SDL2/src/video/raspberry/SDL_rpievents.c: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #if SDL_VIDEO_DRIVER_RASPBERRY 24 | 25 | /* Being a null driver, there's no event stream. We just define stubs for 26 | most of the API. */ 27 | 28 | #include "../../events/SDL_events_c.h" 29 | 30 | #include "SDL_rpivideo.h" 31 | #include "SDL_rpievents_c.h" 32 | 33 | void 34 | RASPBERRY_PumpEvents(_THIS) 35 | { 36 | 37 | } 38 | 39 | #endif /* SDL_VIDEO_DRIVER_RASPBERRY */ 40 | 41 | /* vi: set ts=4 sw=4 expandtab: */ 42 | -------------------------------------------------------------------------------- /SDL2/src/video/raspberry/SDL_rpievents_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | #include "SDL_rpivideo.h" 24 | 25 | extern void RASPBERRY_PumpEvents(_THIS); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2/src/video/raspberry/SDL_rpiframebuffer_c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | #include "../../SDL_internal.h" 22 | 23 | extern int RASPBERRY_CreateWindowFramebuffer(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch); 24 | extern int RASPBERRY_UpdateWindowFramebuffer(_THIS, SDL_Window * window, const SDL_Rect * rects, int numrects); 25 | extern void RASPBERRY_DestroyWindowFramebuffer(_THIS, SDL_Window * window); 26 | 27 | /* vi: set ts=4 sw=4 expandtab: */ 28 | -------------------------------------------------------------------------------- /SDL2_image/.gitignore: -------------------------------------------------------------------------------- 1 | libSDL2_image.a 2 | -------------------------------------------------------------------------------- /SDL2_image/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | SDL2_image 4 | 5 | 6 | libpng 7 | SDL2 8 | 9 | 10 | 11 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 12 | clean,full,incremental, 13 | 14 | 15 | 16 | 17 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 18 | full,incremental, 19 | 20 | 21 | 22 | 23 | 24 | org.eclipse.cdt.core.cnature 25 | org.eclipse.cdt.core.ccnature 26 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 27 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 28 | 29 | 30 | -------------------------------------------------------------------------------- /SDL2_image/COPYING.txt: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_image: An example image loading library for use with SDL 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /SDL2_image/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | DEFS = -D_REENTRANT -D__RASPBERRY_PI__ -DLOAD_BMP -DLOAD_GIF -DLOAD_PNG -DHAVE_HIDDEN -DSDL_BYTEORDER=SDL_LIL_ENDIAN 13 | 14 | PREFIX := /opt/raspberry-pi 15 | 16 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 17 | CFLAGS = -O3 -I../SDL2/include -I../libpng -ffreestanding -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp $(DEFS) 18 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 19 | 20 | all: deps libSDL2_image.a 21 | 22 | .PHONY: deps 23 | 24 | OBJS = IMG.o IMG_bmp.o IMG_gif.o IMG_jpg.o IMG_png.o IMG_tif.o IMG_webp.o 25 | 26 | -include $(DEPDIR)/*.Po 27 | 28 | libSDL2_image.a: $(OBJS) Makefile 29 | $(AR) rcs $@ $(OBJS) 30 | 31 | %.o: %.c 32 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 33 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 34 | 35 | %.o: %.cpp 36 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 37 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 38 | 39 | %.o: %.s 40 | $(AS) $(ASFLAGS) -o $@ $< 41 | 42 | deps: 43 | -@mkdir -p $(DEPDIR) 44 | 45 | install: 46 | -mkdir -p $(PREFIX)/include/SDL2 47 | cp -f SDL_image.h $(PREFIX)/include/SDL2 48 | -mkdir -p $(PREFIX)/lib 49 | cp -f libSDL2_image.a $(PREFIX)/lib 50 | 51 | clean: 52 | rm -f *.o libSDL2_image.a 53 | rm -rf $(DEPDIR) 54 | -------------------------------------------------------------------------------- /SDL2_image/README.txt: -------------------------------------------------------------------------------- 1 | 2 | SDL_image 2.0 3 | 4 | The latest version of this library is available from: 5 | http://www.libsdl.org/projects/SDL_image/ 6 | 7 | This is a simple library to load images of various formats as SDL surfaces. 8 | This library supports BMP, PNM (PPM/PGM/PBM), XPM, LBM, PCX, GIF, JPEG, PNG, 9 | TGA, and TIFF formats. 10 | 11 | API: 12 | #include "SDL_image.h" 13 | 14 | SDL_Surface *IMG_Load(const char *file); 15 | or 16 | SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc); 17 | or 18 | SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type); 19 | 20 | where type is a string specifying the format (i.e. "PNG" or "pcx"). 21 | Note that IMG_Load_RW cannot load TGA images. 22 | 23 | To create a surface from an XPM image included in C source, use: 24 | 25 | SDL_Surface *IMG_ReadXPMFromArray(char **xpm); 26 | 27 | An example program 'showimage' is included, with source in showimage.c 28 | 29 | JPEG support requires the JPEG library: http://www.ijg.org/ 30 | PNG support requires the PNG library: http://www.libpng.org/pub/png/libpng.html 31 | and the Zlib library: http://www.gzip.org/zlib/ 32 | TIFF support requires the TIFF library: ftp://ftp.sgi.com/graphics/tiff/ 33 | 34 | If you have these libraries installed in non-standard places, you can 35 | try adding those paths to the configure script, e.g. 36 | sh ./configure CPPFLAGS="-I/somewhere/include" LDFLAGS="-L/somewhere/lib" 37 | If this works, you may need to add /somewhere/lib to your LD_LIBRARY_PATH 38 | so shared library loading works correctly. 39 | 40 | This library is under the zlib License, see the file "COPYING.txt" for details. 41 | -------------------------------------------------------------------------------- /SDL2_image/pkgconfig.mk: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS += -I../SDL2_image 3 | 4 | LDFLAGS += -L../SDL2_image 5 | 6 | LIBS := -lSDL2_image $(LIBS) 7 | LIBS_DEP += ../SDL2_image/libSDL2_image.a 8 | -------------------------------------------------------------------------------- /SDL2_mixer/.gitignore: -------------------------------------------------------------------------------- 1 | /libSDL2_mixer.a 2 | -------------------------------------------------------------------------------- /SDL2_mixer/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | SDL2_mixer 4 | 5 | 6 | libogg 7 | libvorbis 8 | SDL2 9 | 10 | 11 | 12 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 13 | clean,full,incremental, 14 | 15 | 16 | 17 | 18 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 19 | full,incremental, 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.cdt.core.cnature 26 | org.eclipse.cdt.core.ccnature 27 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 28 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 29 | 30 | 31 | -------------------------------------------------------------------------------- /SDL2_mixer/COPYING.txt: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /SDL2_mixer/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | 13 | PREFIX := /opt/raspberry-pi 14 | 15 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 16 | CFLAGS = -O3 -I. -I../SDL2/include -I../libogg/include -I../libvorbis/include -ffreestanding -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp -D_REENTRANT -D__RASPBERRY_PI__ -DOGG_MUSIC=1 -DWAV_MUSIC=1 17 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 18 | 19 | all: deps libSDL2_mixer.a 20 | 21 | .PHONY: deps 22 | 23 | OBJS = \ 24 | dynamic_ogg.o \ 25 | effect_position.o \ 26 | effect_stereoreverse.o \ 27 | effects_internal.o \ 28 | load_aiff.o \ 29 | load_ogg.o \ 30 | load_voc.o \ 31 | mixer.o \ 32 | music_ogg.o \ 33 | music.o \ 34 | wavestream.o 35 | 36 | -include $(DEPDIR)/*.Po 37 | 38 | libSDL2_mixer.a: $(OBJS) Makefile 39 | $(AR) rcs -o libSDL2_mixer.a $(OBJS) 40 | 41 | %.o: %.c 42 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 43 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 44 | 45 | %.o: %.cpp 46 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 47 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 48 | 49 | %.o: %.s 50 | $(AS) $(ASFLAGS) -o $@ $< 51 | 52 | deps: 53 | -@mkdir -p $(DEPDIR) 54 | 55 | install: 56 | -mkdir -p $(PREFIX)/include/SDL2 57 | cp -f SDL_mixer.h $(PREFIX)/include/SDL2 58 | -mkdir -p $(PREFIX)/lib 59 | cp -f libSDL2_mixer.a $(PREFIX)/lib 60 | 61 | clean: 62 | rm -f *.o libSDL2_mixer.a 63 | rm -rf $(DEPDIR) 64 | -------------------------------------------------------------------------------- /SDL2_mixer/README.txt: -------------------------------------------------------------------------------- 1 | 2 | SDL_mixer 2.0 3 | 4 | The latest version of this library is available from: 5 | http://www.libsdl.org/projects/SDL_mixer/ 6 | 7 | Due to popular demand, here is a simple multi-channel audio mixer. 8 | It supports 8 channels of 16 bit stereo audio, plus a single channel 9 | of music, mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3 10 | libraries. 11 | 12 | See the header file SDL_mixer.h and the examples playwave.c and playmus.c 13 | for documentation on this mixer library. 14 | 15 | The mixer can currently load Microsoft WAVE files and Creative Labs VOC 16 | files as audio samples, and can load MIDI files via Timidity and the 17 | following music formats via MikMod: .MOD .S3M .IT .XM. It can load 18 | Ogg Vorbis streams as music if built with Ogg Vorbis or Tremor libraries, 19 | and finally it can load MP3 music using the SMPEG or libmad libraries. 20 | 21 | Tremor decoding is disabled by default; you can enable it by passing 22 | --enable-music-ogg-tremor 23 | to configure, or by defining OGG_MUSIC and OGG_USE_TREMOR. 24 | 25 | libmad decoding is disabled by default; you can enable it by passing 26 | --enable-music-mp3-mad 27 | to configure, or by defining MP3_MAD_MUSIC 28 | vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv 29 | WARNING: The license for libmad is GPL, which means that in order to 30 | use it your application must also be GPL! 31 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 32 | 33 | The process of mixing MIDI files to wave output is very CPU intensive, 34 | so if playing regular WAVE files sound great, but playing MIDI files 35 | sound choppy, try using 8-bit audio, mono audio, or lower frequencies. 36 | 37 | To play MIDI files, you'll need to get a complete set of GUS patches 38 | from: 39 | http://www.libsdl.org/projects/mixer/timidity/timidity.tar.gz 40 | and unpack them in /usr/local/lib under UNIX, and C:\ under Win32. 41 | 42 | This library is under the zlib license, see the file "COPYING.txt" for details. 43 | 44 | -------------------------------------------------------------------------------- /SDL2_mixer/dynamic_modplug.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifdef MODPLUG_MUSIC 23 | 24 | #include "modplug.h" 25 | 26 | typedef struct { 27 | int loaded; 28 | void *handle; 29 | 30 | ModPlugFile* (*ModPlug_Load)(const void* data, int size); 31 | void (*ModPlug_Unload)(ModPlugFile* file); 32 | int (*ModPlug_Read)(ModPlugFile* file, void* buffer, int size); 33 | void (*ModPlug_Seek)(ModPlugFile* file, int millisecond); 34 | void (*ModPlug_GetSettings)(ModPlug_Settings* settings); 35 | void (*ModPlug_SetSettings)(const ModPlug_Settings* settings); 36 | void (*ModPlug_SetMasterVolume)(ModPlugFile* file,unsigned int cvol) ; 37 | } modplug_loader; 38 | 39 | extern modplug_loader modplug; 40 | 41 | #endif /* MODPLUG_MUSIC */ 42 | 43 | extern int Mix_InitModPlug(); 44 | extern void Mix_QuitModPlug(); 45 | -------------------------------------------------------------------------------- /SDL2_mixer/dynamic_mp3.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifdef MP3_MUSIC 23 | #include "smpeg.h" 24 | 25 | typedef struct { 26 | int loaded; 27 | void *handle; 28 | void (*SMPEG_actualSpec)( SMPEG *mpeg, SDL_AudioSpec *spec ); 29 | void (*SMPEG_delete)( SMPEG* mpeg ); 30 | void (*SMPEG_enableaudio)( SMPEG* mpeg, int enable ); 31 | void (*SMPEG_enablevideo)( SMPEG* mpeg, int enable ); 32 | SMPEG* (*SMPEG_new_rwops)(SDL_RWops *src, SMPEG_Info* info, int freesrc, int sdl_audio); 33 | void (*SMPEG_play)( SMPEG* mpeg ); 34 | int (*SMPEG_playAudio)( SMPEG *mpeg, Uint8 *stream, int len ); 35 | void (*SMPEG_rewind)( SMPEG* mpeg ); 36 | void (*SMPEG_setvolume)( SMPEG* mpeg, int volume ); 37 | void (*SMPEG_skip)( SMPEG* mpeg, float seconds ); 38 | SMPEGstatus (*SMPEG_status)( SMPEG* mpeg ); 39 | void (*SMPEG_stop)( SMPEG* mpeg ); 40 | } smpeg_loader; 41 | 42 | extern smpeg_loader smpeg; 43 | 44 | #endif /* MUSIC_MP3 */ 45 | 46 | extern int Mix_InitMP3(); 47 | extern void Mix_QuitMP3(); 48 | -------------------------------------------------------------------------------- /SDL2_mixer/dynamic_ogg.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifdef OGG_MUSIC 23 | #ifdef OGG_USE_TREMOR 24 | #include 25 | #else 26 | #include 27 | #endif 28 | 29 | typedef struct { 30 | int loaded; 31 | void *handle; 32 | int (*ov_clear)(OggVorbis_File *vf); 33 | vorbis_info *(*ov_info)(OggVorbis_File *vf,int link); 34 | int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks); 35 | ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i); 36 | #ifdef OGG_USE_TREMOR 37 | long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream); 38 | #else 39 | long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream); 40 | #endif 41 | #ifdef OGG_USE_TREMOR 42 | int (*ov_time_seek)(OggVorbis_File *vf,ogg_int64_t pos); 43 | #else 44 | int (*ov_time_seek)(OggVorbis_File *vf,double pos); 45 | #endif 46 | } vorbis_loader; 47 | 48 | extern vorbis_loader vorbis; 49 | 50 | #endif /* OGG_MUSIC */ 51 | 52 | extern int Mix_InitOgg(); 53 | extern void Mix_QuitOgg(); 54 | -------------------------------------------------------------------------------- /SDL2_mixer/effects_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /* $Id$ */ 23 | 24 | #ifndef _INCLUDE_EFFECTS_INTERNAL_H_ 25 | #define _INCLUDE_EFFECTS_INTERNAL_H_ 26 | 27 | #ifndef __MIX_INTERNAL_EFFECT__ 28 | #error You should not include this file or use these functions. 29 | #endif 30 | 31 | #include "SDL_mixer.h" 32 | 33 | /* Set up for C function definitions, even when using C++ */ 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | extern int _Mix_effects_max_speed; 39 | extern void *_Eff_volume_table; 40 | void *_Eff_build_volume_table_u8(void); 41 | void *_Eff_build_volume_table_s8(void); 42 | 43 | void _Mix_InitEffects(void); 44 | void _Mix_DeinitEffects(void); 45 | void _Eff_PositionDeinit(void); 46 | 47 | int _Mix_RegisterEffect_locked(int channel, Mix_EffectFunc_t f, 48 | Mix_EffectDone_t d, void *arg); 49 | int _Mix_UnregisterEffect_locked(int channel, Mix_EffectFunc_t f); 50 | int _Mix_UnregisterAllEffects_locked(int channel); 51 | 52 | 53 | /* Set up for C function definitions, even when using C++ */ 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /SDL2_mixer/fluidsynth.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | James Le Cuirot 22 | chewi@aura-online.co.uk 23 | */ 24 | 25 | #ifndef _FLUIDSYNTH_H_ 26 | #define _FLUIDSYNTH_H_ 27 | 28 | #ifdef USE_FLUIDSYNTH_MIDI 29 | 30 | #include "dynamic_fluidsynth.h" 31 | #include 32 | #include 33 | 34 | typedef struct { 35 | SDL_AudioCVT convert; 36 | fluid_synth_t *synth; 37 | fluid_player_t* player; 38 | } FluidSynthMidiSong; 39 | 40 | int fluidsynth_init(SDL_AudioSpec *mixer); 41 | FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw, int freerw); 42 | void fluidsynth_freesong(FluidSynthMidiSong *song); 43 | void fluidsynth_start(FluidSynthMidiSong *song); 44 | void fluidsynth_stop(FluidSynthMidiSong *song); 45 | int fluidsynth_active(FluidSynthMidiSong *song); 46 | void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume); 47 | int fluidsynth_playsome(FluidSynthMidiSong *song, void *stream, int len); 48 | 49 | #endif /* USE_FLUIDSYNTH_MIDI */ 50 | 51 | #endif /* _FLUIDSYNTH_H_ */ 52 | -------------------------------------------------------------------------------- /SDL2_mixer/load_aiff.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/SDL2_mixer/load_aiff.c -------------------------------------------------------------------------------- /SDL2_mixer/load_aiff.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/SDL2_mixer/load_aiff.h -------------------------------------------------------------------------------- /SDL2_mixer/load_flac.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | This is the source needed to decode a FLAC into a waveform. 22 | ~ Austen Dicken (admin@cvpcs.org). 23 | */ 24 | 25 | /* $Id: $ */ 26 | 27 | #ifdef FLAC_MUSIC 28 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */ 29 | SDL_AudioSpec *Mix_LoadFLAC_RW (SDL_RWops *src, int freesrc, 30 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); 31 | #endif 32 | -------------------------------------------------------------------------------- /SDL2_mixer/load_ogg.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | This is the source needed to decode an Ogg Vorbis into a waveform. 22 | This file by Vaclav Slavik (vaclav.slavik@matfyz.cz). 23 | */ 24 | 25 | /* $Id$ */ 26 | 27 | #ifdef OGG_MUSIC 28 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */ 29 | SDL_AudioSpec *Mix_LoadOGG_RW (SDL_RWops *src, int freesrc, 30 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); 31 | #endif 32 | -------------------------------------------------------------------------------- /SDL2_mixer/load_voc.h: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_mixer: An audio mixer library based on the SDL library 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | This is the source needed to decode a Creative Labs VOC file into a 22 | waveform. It's pretty straightforward once you get going. The only 23 | externally-callable function is Mix_LoadVOC_RW(), which is meant to 24 | act as identically to SDL_LoadWAV_RW() as possible. 25 | 26 | This file by Ryan C. Gordon (icculus@icculus.org). 27 | 28 | Heavily borrowed from sox v12.17.1's voc.c. 29 | (http://www.freshmeat.net/projects/sox/) 30 | */ 31 | 32 | /* $Id$ */ 33 | 34 | /* Don't call this directly; use Mix_LoadWAV_RW() for now. */ 35 | SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc, 36 | SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); 37 | -------------------------------------------------------------------------------- /SDL2_mixer/pkgconfig.mk: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS += -I../SDL2_mixer 3 | 4 | LDFLAGS += -L../SDL2_mixer 5 | 6 | LIBS := -lSDL2_mixer $(LIBS) 7 | LIBS_DEP += ../SDL2_mixer/libSDL2_mixer.a 8 | -------------------------------------------------------------------------------- /abbaye/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | abbaye 4 | 5 | 6 | SDL2 7 | SDL2_mixer 8 | SDL2_image 9 | kernel 10 | 11 | 12 | 13 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 14 | clean,full,incremental, 15 | 16 | 17 | 18 | 19 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 20 | full,incremental, 21 | 22 | 23 | 24 | 25 | 26 | org.eclipse.cdt.core.cnature 27 | org.eclipse.cdt.core.ccnature 28 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 29 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 30 | 31 | 32 | -------------------------------------------------------------------------------- /abbaye/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: kernel.img 3 | 4 | include ../kernel/common.mk 5 | 6 | include ../libvorbis/pkgconfig.mk 7 | include ../libpng/pkgconfig.mk 8 | include ../SDL2/pkgconfig.mk 9 | include ../SDL2_image/pkgconfig.mk 10 | include ../SDL2_mixer/pkgconfig.mk 11 | 12 | OBJS = \ 13 | data/enemies.o data/map.o \ 14 | graphics/blueparch.o graphics/fonts.o graphics/history.o graphics/intro.o graphics/parchment2.o \ 15 | graphics/parchment4.o graphics/parchment6.o graphics/redparch.o graphics/ending.o graphics/gameover.o \ 16 | graphics/intromd.o graphics/parchment1.o graphics/parchment3.o graphics/parchment5.o graphics/parchment.o \ 17 | graphics/tiles.o \ 18 | sounds/AreaIChurchN.o sounds/doorfx.o sounds/HangmansTree.o sounds/MainTitleN.o sounds/mechanismn.o sounds/shoot.o \ 19 | sounds/AreaIICavesV2N.o sounds/EvilFightN.o sounds/Item.o sounds/ManhuntN.o sounds/onedeathn.o sounds/slash.o \ 20 | sounds/AreaIIIHellN.o sounds/GameOverV2N.o sounds/jump.o sounds/ManhuntwoodN.o sounds/PrayerofHopeN.o \ 21 | src/drawing.o src/ending.o src/enemies.o src/game.o src/gameover.o src/history.o src/jean.o src/loading.o src/startscreen.o \ 22 | src/main.o 23 | 24 | CFLAGS += -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-vectorize 25 | 26 | -include $(DEPDIR)/*.Po 27 | 28 | kernel.img: $(OBJS) Makefile ../kernel/raspberry.ld $(LIBS_DEP) 29 | $(CXX) $(LDFLAGS) $(OBJS) $(LIBS) 30 | $(OBJCOPY) kernel.elf -O binary kernel.img 31 | rm kernel.elf 32 | 33 | %.o: %.png 34 | $(LD) -r -b binary -o $@ $< 35 | 36 | %.o: %.ogg 37 | $(LD) -r -b binary -o $@ $< 38 | 39 | %.o: %.txt 40 | $(LD) -r -b binary -o $@ $< 41 | 42 | clean: 43 | rm -f $(OBJS) kernel.elf kernel.img kernel.map 44 | rm -rf $(DEPDIR) 45 | -------------------------------------------------------------------------------- /abbaye/README: -------------------------------------------------------------------------------- 1 | INTRODUCTION 2 | 3 | Abbaye des Morts is a freeware game made by LocoMalito (with the help of Gryzor87 in music side) in 2010. 4 | Was developed with Gamemaker and only runs natively in Microsoft Windows systems. 5 | 6 | This is a port to GNU/Linux systems & any system that supports C and SDL libraries. Is written in C code with the help of SDL2 libraries. 7 | 8 | The version 2.0 of the game is a port from SDL1.2 to SDL2 libraries. This include a nice set of features: OpenGL rendering, auto-scaling, 9 | Android & IOS support, VSync, etc. 10 | 11 | The code is licensed under GNU GPL version 3, so anyone can download, see, change and redistributed the code. 12 | 13 | INSTALLATION FROM SOURCE 14 | 15 | In order to compile this program, you need to install SDL2 libraries. Check your distribution instructions. 16 | 17 | Unpack the source code file: 18 | 19 | $ tar vxfz abbaye_linux_v2_beta.tar.gz 20 | 21 | Enter the directory created an run: 22 | 23 | $ make abbaye 24 | 25 | As root, install the game with: 26 | 27 | $ make install 28 | 29 | (Ubuntu users run: $ sudo make install) 30 | 31 | A icon will appear in your application menu, in game section. Alternatively you can run the game with the order "abbaye". 32 | 33 | 34 | UNINSTALLATION FROM SOURCE 35 | 36 | Enter the directory and run (as root): 37 | 38 | $ make uninstall (Ubuntu users run: $ sudo make uninstall). -------------------------------------------------------------------------------- /abbaye/abbaye.desktop: -------------------------------------------------------------------------------- 1 | 2 | [Desktop Entry] 3 | Name=Abbaye des Morts 4 | Name[ca]=Abbaye des Morts 5 | Name[en_GB]=Abbaye des Morts 6 | Name[es]=Abbaye des Morts 7 | Comment=Indie platform game by Locomalito 8 | Comment[ca]=Joc indie de plataformes de Locomalito 9 | Comment[en_GB]=Indie platform game by Locomalito 10 | Comment[es]=Juego indie de plataformas de Locomalito 11 | Exec=abbayev2 12 | Icon=abbaye 13 | Terminal=false 14 | Type=Application 15 | Categories=Game;ActionGame; 16 | StartupNotify=false 17 | Version=1.0 18 | X-Desktop-File-Install-Version=0.19 19 | -------------------------------------------------------------------------------- /abbaye/abbaye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/abbaye.png -------------------------------------------------------------------------------- /abbaye/fonts/VeniceClassic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/fonts/VeniceClassic.ttf -------------------------------------------------------------------------------- /abbaye/graphics/blueparch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/blueparch.png -------------------------------------------------------------------------------- /abbaye/graphics/ending.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/ending.png -------------------------------------------------------------------------------- /abbaye/graphics/fonts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/fonts.png -------------------------------------------------------------------------------- /abbaye/graphics/gameover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/gameover.png -------------------------------------------------------------------------------- /abbaye/graphics/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/history.png -------------------------------------------------------------------------------- /abbaye/graphics/intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/intro.png -------------------------------------------------------------------------------- /abbaye/graphics/intromd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/intromd.png -------------------------------------------------------------------------------- /abbaye/graphics/parchment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/parchment.png -------------------------------------------------------------------------------- /abbaye/graphics/parchment1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/parchment1.png -------------------------------------------------------------------------------- /abbaye/graphics/parchment2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/parchment2.png -------------------------------------------------------------------------------- /abbaye/graphics/parchment3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/parchment3.png -------------------------------------------------------------------------------- /abbaye/graphics/parchment4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/parchment4.png -------------------------------------------------------------------------------- /abbaye/graphics/parchment5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/parchment5.png -------------------------------------------------------------------------------- /abbaye/graphics/parchment6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/parchment6.png -------------------------------------------------------------------------------- /abbaye/graphics/redparch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/redparch.png -------------------------------------------------------------------------------- /abbaye/graphics/tiles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/graphics/tiles.png -------------------------------------------------------------------------------- /abbaye/sounds/AreaIChurchN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/AreaIChurchN.ogg -------------------------------------------------------------------------------- /abbaye/sounds/AreaIICavesV2N.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/AreaIICavesV2N.ogg -------------------------------------------------------------------------------- /abbaye/sounds/AreaIIIHellN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/AreaIIIHellN.ogg -------------------------------------------------------------------------------- /abbaye/sounds/EvilFightN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/EvilFightN.ogg -------------------------------------------------------------------------------- /abbaye/sounds/GameOverV2N.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/GameOverV2N.ogg -------------------------------------------------------------------------------- /abbaye/sounds/HangmansTree.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/HangmansTree.ogg -------------------------------------------------------------------------------- /abbaye/sounds/Item.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/Item.ogg -------------------------------------------------------------------------------- /abbaye/sounds/MainTitleN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/MainTitleN.ogg -------------------------------------------------------------------------------- /abbaye/sounds/ManhuntN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/ManhuntN.ogg -------------------------------------------------------------------------------- /abbaye/sounds/ManhuntwoodN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/ManhuntwoodN.ogg -------------------------------------------------------------------------------- /abbaye/sounds/PrayerofHopeN.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/PrayerofHopeN.ogg -------------------------------------------------------------------------------- /abbaye/sounds/doorfx.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/doorfx.ogg -------------------------------------------------------------------------------- /abbaye/sounds/jump.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/jump.ogg -------------------------------------------------------------------------------- /abbaye/sounds/mechanismn.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/mechanismn.ogg -------------------------------------------------------------------------------- /abbaye/sounds/onedeathn.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/onedeathn.ogg -------------------------------------------------------------------------------- /abbaye/sounds/shoot.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/shoot.ogg -------------------------------------------------------------------------------- /abbaye/sounds/slash.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/abbaye/sounds/slash.ogg -------------------------------------------------------------------------------- /abbaye/src/gameover.c: -------------------------------------------------------------------------------- 1 | /* gameover.c */ 2 | 3 | #include 4 | #include 5 | #include "SDL.h" 6 | #include "SDL_image.h" 7 | #include "SDL_mixer.h" 8 | 9 | extern unsigned int _binary_graphics_gameover_png_start; 10 | extern unsigned int _binary_graphics_gameover_png_end; 11 | 12 | extern unsigned int _binary_sounds_GameOverV2N_ogg_start; 13 | extern unsigned int _binary_sounds_GameOverV2N_ogg_end; 14 | 15 | void gameover (SDL_Window *screen,uint *state) { 16 | 17 | SDL_Renderer *renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_SOFTWARE); // SDL_RENDERER_PRESENTVSYNC); 18 | //SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); // make the scaled rendering look smoother. 19 | //SDL_RenderSetLogicalSize(renderer, 256, 192); 20 | SDL_SetRenderDrawColor(renderer,0,0,0,255); 21 | 22 | SDL_RWops *rw = SDL_RWFromMem(&_binary_graphics_gameover_png_start, 23 | (unsigned int)&_binary_graphics_gameover_png_end - (unsigned int)&_binary_graphics_gameover_png_start); 24 | SDL_Texture *gameover = IMG_LoadTexture_RW(renderer,rw,1); 25 | 26 | rw = SDL_RWFromMem(&_binary_sounds_GameOverV2N_ogg_start, 27 | (unsigned int)&_binary_sounds_GameOverV2N_ogg_end - (unsigned int)&_binary_sounds_GameOverV2N_ogg_start); 28 | Mix_Music *bso = Mix_LoadMUS_RW(rw,1); 29 | 30 | SDL_RenderClear(renderer); 31 | SDL_RenderCopy(renderer,gameover,NULL,NULL); 32 | 33 | /* Flip */ 34 | SDL_RenderPresent(renderer); 35 | Mix_PlayMusic(bso, 0); 36 | 37 | /* Wait */ 38 | sleep(12); 39 | 40 | /* Cleaning */ 41 | Mix_FreeMusic (bso); 42 | SDL_DestroyTexture(gameover); 43 | SDL_DestroyRenderer(renderer); 44 | 45 | *state = 0; 46 | 47 | } 48 | -------------------------------------------------------------------------------- /abbaye/src/main.c: -------------------------------------------------------------------------------- 1 | /* Abbaye des Morts */ 2 | /* Version 2.0 */ 3 | 4 | /* (c) 2010 - Locomalito & Gryzor87 */ 5 | /* 2013 - David "Nevat" Lara */ 6 | 7 | /* GPL v3 license */ 8 | 9 | #include 10 | #include 11 | #include "SDL.h" 12 | #include "SDL_image.h" 13 | #include "SDL_mixer.h" 14 | 15 | #include "kernel.h" 16 | 17 | extern void startscreen(SDL_Window *screen,uint *state,uint *grapset,uint *fullscreen); 18 | extern void history(SDL_Window *screen,uint *state,uint *grapset,uint *fullscreen); 19 | extern void game(SDL_Window *screen,uint *state,uint *grapset,uint *fullscreen); 20 | extern void gameover (SDL_Window *screen,uint *state); 21 | extern void ending (SDL_Window *screen,uint *state); 22 | 23 | #if defined(__cplusplus) 24 | extern "C" { 25 | #endif 26 | 27 | __attribute__ ((interrupt ("IRQ"))) void interrupt_irq() { 28 | SDL_Interrupt_Handler(); 29 | } 30 | 31 | #if defined(__cplusplus) 32 | } 33 | #endif 34 | 35 | void main () { 36 | 37 | uint state = 0; /* 0-intro,1-history,2-game */ 38 | uint grapset = 1; /* 0-8bits, 1-16bits */ 39 | uint fullscreen = 0; /* 0-Windowed,1-Fullscreen */ 40 | 41 | mount("sd:"); 42 | 43 | SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_EVENTS | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER); 44 | 45 | /* Creating window */ 46 | SDL_Window *screen = SDL_CreateWindow("Abbaye des Morts v2.0",0,0,256,192,SDL_WINDOW_FULLSCREEN); 47 | 48 | /* Init audio */ 49 | Mix_OpenAudio (22050,MIX_DEFAULT_FORMAT,2,4096); 50 | Mix_AllocateChannels(5); 51 | 52 | /* Init game controllers */ 53 | SDL_GameControllerAddMappingsFromFile("control.txt"); 54 | for (int i = 0; i < SDL_NumJoysticks(); i++) { 55 | if (SDL_IsGameController(i)) { 56 | SDL_GameControllerOpen(i); 57 | } 58 | } 59 | 60 | while (1) { 61 | switch (state) { 62 | case 0: startscreen(screen,&state,&grapset,&fullscreen); 63 | break; 64 | case 1: history(screen,&state,&grapset,&fullscreen); 65 | break; 66 | case 2: game(screen,&state,&grapset,&fullscreen); 67 | break; 68 | case 3: gameover(screen,&state); 69 | break; 70 | case 4: ending(screen,&state); 71 | break; 72 | } 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /abbaye/src/structs.h: -------------------------------------------------------------------------------- 1 | /* structs.h */ 2 | 3 | /* Structs */ 4 | struct enem { 5 | int type[7]; 6 | float x[7]; 7 | float y[7]; 8 | int direction[7]; 9 | int tilex[7]; 10 | int tiley[7]; 11 | int animation[7]; 12 | int limleft[7]; 13 | int limright[7]; 14 | int speed[7]; 15 | int fire[7]; 16 | int adjustx1[7]; 17 | int adjustx2[7]; 18 | int adjusty1[7]; 19 | int adjusty2[7]; 20 | }; 21 | 22 | struct hero { 23 | float x; 24 | float y; 25 | int direction; 26 | int jump; /* 1-Up, 2-Down */ 27 | float height; /* Limit of jump */ 28 | int animation; 29 | float gravity; 30 | int points[8]; /* Points of collision */ 31 | int ground; /* Pixel where is ground */ 32 | int collision[4]; /* Collisions, in 4 directions */ 33 | int ducking; 34 | int checkpoint[4]; 35 | int state[2]; /* Vidas y cruces */ 36 | int flags[7]; 37 | int death; 38 | int push[4]; /* Pulsaciones de teclas */ 39 | int temp; 40 | }; 41 | -------------------------------------------------------------------------------- /kernel/.gitignore: -------------------------------------------------------------------------------- 1 | boot/ 2 | libkernel.a 3 | -------------------------------------------------------------------------------- /kernel/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | kernel 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 25 | 26 | 27 | -------------------------------------------------------------------------------- /kernel/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: libkernel.a 3 | 4 | -include common.mk 5 | 6 | OBJS = \ 7 | start.o \ 8 | audio.o \ 9 | console.o \ 10 | emmc.o \ 11 | fb.o \ 12 | fatfs/diskio.o \ 13 | fatfs/ff.o \ 14 | fatfs/option/ccsbcs.o \ 15 | fatfs/option/syscall.o \ 16 | platform.o \ 17 | syscalls.o \ 18 | usb.o \ 19 | wiring.o 20 | 21 | ifeq ($(USPI),1) 22 | OBJS += \ 23 | uspi/devicenameservice.o \ 24 | uspi/dwhcidevice.o \ 25 | uspi/dwhciframeschednper.o \ 26 | uspi/dwhciframeschednsplit.o \ 27 | uspi/dwhciframeschedper.o \ 28 | uspi/dwhciregister.o \ 29 | uspi/dwhcirootport.o \ 30 | uspi/dwhcixferstagedata.o \ 31 | uspi/keymap.o \ 32 | uspi/macaddress.o \ 33 | uspi/smsc951x.o \ 34 | uspi/string.o \ 35 | uspi/usbconfigparser.o \ 36 | uspi/usbdevice.o \ 37 | uspi/usbdevicefactory.o \ 38 | uspi/usbendpoint.o \ 39 | uspi/usbgamepad.o \ 40 | uspi/usbkeyboard.o \ 41 | uspi/usbmassdevice.o \ 42 | uspi/usbmouse.o \ 43 | uspi/usbrequest.o \ 44 | uspi/usbstandardhub.o \ 45 | uspi/usbstring.o \ 46 | uspi/uspilibrary.o \ 47 | uspi/util.o \ 48 | uspi/synchronize.o \ 49 | uspi/uspios.o 50 | endif 51 | 52 | -include $(DEPDIR)/*.Po 53 | 54 | libkernel.a: $(OBJS) start.o syscalls.o Makefile raspberry.ld 55 | $(AR) rcs -o $@ $(OBJS) 56 | 57 | install: 58 | -mkdir -p $(PREFIX)/include 59 | cp -f audio.h console.h emmc.h fb.h kernel.h platform.h wiring.h $(PREFIX)/include 60 | -mkdir -p $(PREFIX)/include/fatfs 61 | cp -f fatfs/ff.h fatfs/ffconf.h fatfs/integer.h $(PREFIX)/include/fatfs 62 | cp -f platform.inc $(PREFIX)/include 63 | ifeq ($(USPI),1) 64 | cp -f uspi.h $(PREFIX)/include 65 | endif 66 | -mkdir -p $(PREFIX)/lib 67 | cp -f libkernel.a $(PREFIX)/lib 68 | cp -f raspberry.ld $(PREFIX) 69 | cp -f rules.mk $(PREFIX) 70 | 71 | clean: 72 | rm -f $(OBJS) libkernel.a 73 | rm -rf $(DEPDIR) 74 | -------------------------------------------------------------------------------- /kernel/audio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Marco Maccaferri and Others 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef AUDIO_H_ 19 | #define AUDIO_H_ 20 | 21 | #include "platform.h" 22 | 23 | #if defined(__cplusplus) 24 | extern "C" { 25 | #endif 26 | 27 | int audio_open(uint32_t samples); 28 | void audio_close(); 29 | 30 | int audio_get_sample_rate(); 31 | int audio_get_channels(); 32 | int audio_get_sample_size(); 33 | 34 | uint32_t audio_write(int16_t * stream, uint32_t samples); 35 | void audio_write_sample(int16_t sample); 36 | 37 | void audio_play(); 38 | void audio_stop(); 39 | 40 | void audio_dma_irq(); 41 | 42 | extern void audio_callback(int16_t * buffer, uint32_t samples); 43 | 44 | #if defined(__cplusplus) 45 | } 46 | #endif 47 | 48 | #endif /* AUDIO_H_ */ 49 | -------------------------------------------------------------------------------- /kernel/common.mk: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | USPI := 1 13 | 14 | PREFIX := /opt/raspberry-pi 15 | 16 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 17 | CFLAGS = -Wall -O2 -ffreestanding -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp -fsigned-char -I../kernel -D__RASPBERRY_PI__ 18 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 19 | LDFLAGS = -T ../kernel/raspberry.ld -nostartfiles -fno-exceptions -fno-unwind-tables -fno-rtti -Wl,-Map=kernel.map -o kernel.elf 20 | 21 | ifeq ($(USPI),1) 22 | CFLAGS += -DHAVE_USPI 23 | endif 24 | 25 | LDFLAGS += -L../kernel 26 | LIBS += -lkernel 27 | LIBS_DEP += ../kernel/libkernel.a 28 | 29 | %.o: %.c 30 | @mkdir -p $(DEPDIR)/$(@D) 31 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 32 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 33 | 34 | %.o: %.cpp 35 | @mkdir -p $(DEPDIR)/$(@D) 36 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 37 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 38 | 39 | %.o: %.s 40 | $(AS) $(ASFLAGS) -o $@ $< 41 | 42 | %.o: %.png 43 | $(LD) -r -b binary -o $@ $< 44 | 45 | %.o: %.ogg 46 | $(LD) -r -b binary -o $@ $< 47 | 48 | %.o: %.txt 49 | $(LD) -r -b binary -o $@ $< 50 | -------------------------------------------------------------------------------- /kernel/fatfs/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | 13 | #else /* Embedded platform */ 14 | 15 | /* This type MUST be 8 bit */ 16 | typedef unsigned char BYTE; 17 | 18 | /* These types MUST be 16 bit */ 19 | typedef short SHORT; 20 | typedef unsigned short WORD; 21 | typedef unsigned short WCHAR; 22 | 23 | /* These types MUST be 16 bit or 32 bit */ 24 | typedef int INT; 25 | typedef unsigned int UINT; 26 | 27 | /* These types MUST be 32 bit */ 28 | typedef long LONG; 29 | typedef unsigned long DWORD; 30 | 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /kernel/fatfs/option/unicode.c: -------------------------------------------------------------------------------- 1 | #include "../ff.h" 2 | 3 | #if _USE_LFN != 0 4 | 5 | #if _CODE_PAGE == 932 /* Japanese Shift_JIS */ 6 | #include "cc932.c" 7 | #elif _CODE_PAGE == 936 /* Simplified Chinese GBK */ 8 | #include "cc936.c" 9 | #elif _CODE_PAGE == 949 /* Korean */ 10 | #include "cc949.c" 11 | #elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */ 12 | #include "cc950.c" 13 | #else /* Small character-set */ 14 | #include "ccsbcs.c" 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /kernel/kernel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Marco Maccaferri and Others 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef KERNEL_H_ 19 | #define KERNEL_H_ 20 | 21 | #include "fb.h" 22 | #include "console.h" 23 | #include "audio.h" 24 | #include "emmc.h" 25 | #include "fatfs/ff.h" 26 | 27 | #ifdef HAVE_USPI 28 | #include "uspi.h" 29 | #endif 30 | 31 | #define KERNEL_MAJ 0 32 | #define KERNEL_MIN 1 33 | #define KERNEL_REV 1 34 | 35 | #define KERNEL_NAME "raspberrypi" 36 | #define KERNEL_VERSION "0.1.1" 37 | #define KERNEL_STRING "raspberrypi 0.1.1" 38 | 39 | #if defined(__cplusplus) 40 | extern "C" { 41 | #endif 42 | 43 | int usb_init(); 44 | 45 | int keyboard_init(); 46 | 47 | int mount(const char *source); 48 | int umount(const char *target); 49 | 50 | #if defined(__cplusplus) 51 | } 52 | #endif 53 | 54 | #endif /* KERNEL_H_ */ 55 | -------------------------------------------------------------------------------- /kernel/raspberry.ld: -------------------------------------------------------------------------------- 1 | ENTRY(_start) 2 | 3 | STARTUP(libkernel.a) 4 | 5 | SECTIONS 6 | { 7 | . = 0x8000; 8 | 9 | .text : { 10 | *(.text*) 11 | *(.rodata*) 12 | } 13 | 14 | .init_array : { 15 | __init_array_start = ABSOLUTE(.);; 16 | *(.init_array) 17 | *(SORT_BY_INIT_PRIORITY(.init_array.*)) 18 | __init_array_end = ABSOLUTE(.);; 19 | } 20 | 21 | .data : { 22 | *(.data*) 23 | } 24 | 25 | .bss : { 26 | __bss_start__ = ABSOLUTE(.); 27 | *(.bss*) 28 | *(COMMON) 29 | __bss_end__ = ABSOLUTE(.); 30 | } 31 | 32 | .ARM.exidx : { 33 | __exidx_start = ABSOLUTE(.); 34 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 35 | __exidx_end = ABSOLUTE(.); 36 | } 37 | 38 | . = ALIGN(8); 39 | .stack : { 40 | __stack_start__ = ABSOLUTE(.); 41 | 42 | . += 262144; 43 | __irq_stack_top__ = ABSOLUTE(.); 44 | 45 | . += 262144; 46 | __c_stack_top__ = ABSOLUTE(.); 47 | 48 | __stack_end__ = ABSOLUTE(.); 49 | } 50 | 51 | .heap : { 52 | __heap_start = ABSOLUTE(.); 53 | __heap_end = 0x1C000000; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /kernel/uspi/CREDITS: -------------------------------------------------------------------------------- 1 | CREDITS 2 | 3 | To whom 4 | For what 5 | 6 | Marco Maccaferri (macca) 7 | GamePad support 8 | -------------------------------------------------------------------------------- /kernel/uspi/assert.h: -------------------------------------------------------------------------------- 1 | // 2 | // assert.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_assert_h 21 | #define _uspi_assert_h 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #ifdef NDEBUG 28 | #define assert(expr) ((void) 0) 29 | #else 30 | void uspi_assertion_failed (const char *pExpr, const char *pFile, unsigned nLine); 31 | 32 | #define assert(expr) ((expr) ? ((void) 0) : uspi_assertion_failed (#expr, __FILE__, __LINE__)) 33 | #endif 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /kernel/uspi/bcm2835.h: -------------------------------------------------------------------------------- 1 | // 2 | // bcm2835.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_bcm2835_h 21 | #define _uspi_bcm2835_h 22 | 23 | #include 24 | 25 | #define ARM_IO_BASE 0x20000000 26 | #define GPU_IO_BASE 0x7E000000 27 | 28 | #define GPU_CACHED_BASE 0x40000000 29 | #define GPU_UNCACHED_BASE 0xC0000000 30 | 31 | #ifdef GPU_L2_CACHE_ENABLED 32 | #define GPU_MEM_BASE GPU_CACHED_BASE 33 | #else 34 | #define GPU_MEM_BASE GPU_UNCACHED_BASE 35 | #endif 36 | 37 | // 38 | // USB Host Controller 39 | // 40 | #define ARM_USB_BASE (ARM_IO_BASE + 0x980000) 41 | 42 | #define ARM_USB_CORE_BASE ARM_USB_BASE 43 | #define ARM_USB_HOST_BASE (ARM_USB_BASE + 0x400) 44 | #define ARM_USB_POWER (ARM_USB_BASE + 0xE00) 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /kernel/uspi/devicenameservice.h: -------------------------------------------------------------------------------- 1 | // 2 | // devicenameservice.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_devicenameservice_h 21 | #define _uspi_devicenameservice_h 22 | 23 | #include 24 | 25 | typedef struct TDeviceInfo 26 | { 27 | struct TDeviceInfo *pNext; 28 | char *pName; 29 | void *pDevice; 30 | boolean bBlockDevice; 31 | } 32 | TDeviceInfo; 33 | 34 | typedef struct TDeviceNameService 35 | { 36 | TDeviceInfo *m_pList; 37 | } 38 | TDeviceNameService; 39 | 40 | void DeviceNameService (TDeviceNameService *pThis); 41 | void _DeviceNameService (TDeviceNameService *pThis); 42 | 43 | void DeviceNameServiceAddDevice (TDeviceNameService *pThis, const char *pName, void *pDevice, boolean bBlockDevice); 44 | 45 | void *DeviceNameServiceGetDevice (TDeviceNameService *pThis, const char *pName, boolean bBlockDevice); 46 | 47 | TDeviceNameService *DeviceNameServiceGet (void); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /kernel/uspi/doc/keyboard.txt: -------------------------------------------------------------------------------- 1 | SPECIAL KEYS 2 | 3 | The listed special keys return the following sequences in cooked mode: 4 | 5 | \E Escape 6 | \177 Backspace 7 | ^I Tabulator 8 | ^J Return 9 | \E[2~ Insert 10 | \E[1~ Home 11 | \E[5~ PageUp 12 | \E[3~ Delete 13 | \E[4~ End 14 | \E[6~ PageDown 15 | \E[A Up 16 | \E[B Down 17 | \E[D Left 18 | \E[C Right 19 | \E[[A F1 20 | \E[[B F2 21 | \E[[C F3 22 | \E[[D F4 23 | \E[[E F5 24 | \E[17~ F6 25 | \E[18~ F7 26 | \E[19~ F8 27 | \E[20~ F9 28 | \E[G KP_Center 29 | 30 | ^X = Control character 31 | \E = Escape (\x1b) 32 | \nnn = Octal code 33 | -------------------------------------------------------------------------------- /kernel/uspi/dwhciframeschednper.h: -------------------------------------------------------------------------------- 1 | // 2 | // dwhciframeschednper.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_dwhciframeschednper_h 21 | #define _uspi_dwhciframeschednper_h 22 | 23 | #include 24 | #include 25 | 26 | typedef struct TDWHCIFrameSchedulerNonPeriodic 27 | { 28 | TDWHCIFrameScheduler m_DWHCIFrameScheduler; 29 | 30 | unsigned m_nState; 31 | unsigned m_nTries; 32 | } 33 | TDWHCIFrameSchedulerNonPeriodic; 34 | 35 | void DWHCIFrameSchedulerNonPeriodic (TDWHCIFrameSchedulerNonPeriodic *pThis); 36 | void _DWHCIFrameSchedulerNonPeriodic (TDWHCIFrameScheduler *pBase); 37 | 38 | void DWHCIFrameSchedulerNonPeriodicStartSplit (TDWHCIFrameScheduler *pBase); 39 | boolean DWHCIFrameSchedulerNonPeriodicCompleteSplit (TDWHCIFrameScheduler *pBase); 40 | void DWHCIFrameSchedulerNonPeriodicTransactionComplete (TDWHCIFrameScheduler *pBase, u32 nStatus); 41 | 42 | void DWHCIFrameSchedulerNonPeriodicWaitForFrame (TDWHCIFrameScheduler *pBase); 43 | 44 | boolean DWHCIFrameSchedulerNonPeriodicIsOddFrame (TDWHCIFrameScheduler *pBase); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /kernel/uspi/dwhciframeschednsplit.h: -------------------------------------------------------------------------------- 1 | // 2 | // dwhciframeschednsplit.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_dwhciframeschednsplit_h 21 | #define _uspi_dwhciframeschednsplit_h 22 | 23 | #include 24 | #include 25 | 26 | typedef struct TDWHCIFrameSchedulerNoSplit 27 | { 28 | TDWHCIFrameScheduler m_DWHCIFrameScheduler; 29 | 30 | boolean m_bIsPeriodic; 31 | unsigned m_nNextFrame; 32 | } 33 | TDWHCIFrameSchedulerNoSplit; 34 | 35 | void DWHCIFrameSchedulerNoSplit (TDWHCIFrameSchedulerNoSplit *pThis, boolean bIsPeriodic); 36 | void _DWHCIFrameSchedulerNoSplit (TDWHCIFrameScheduler *pBase); 37 | 38 | void DWHCIFrameSchedulerNoSplitStartSplit (TDWHCIFrameScheduler *pBase); 39 | boolean DWHCIFrameSchedulerNoSplitCompleteSplit (TDWHCIFrameScheduler *pBase); 40 | void DWHCIFrameSchedulerNoSplitTransactionComplete (TDWHCIFrameScheduler *pBase, u32 nStatus); 41 | 42 | void DWHCIFrameSchedulerNoSplitWaitForFrame (TDWHCIFrameScheduler *pBase); 43 | 44 | boolean DWHCIFrameSchedulerNoSplitIsOddFrame (TDWHCIFrameScheduler *pBase); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /kernel/uspi/dwhciframeschedper.h: -------------------------------------------------------------------------------- 1 | // 2 | // dwhciframeschedper.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_dwhciframeschedper_h 21 | #define _uspi_dwhciframeschedper_h 22 | 23 | #include 24 | #include 25 | 26 | typedef struct TDWHCIFrameSchedulerPeriodic 27 | { 28 | TDWHCIFrameScheduler m_DWHCIFrameScheduler; 29 | 30 | unsigned m_nState; 31 | unsigned m_nTries; 32 | 33 | unsigned m_nNextFrame; 34 | } 35 | TDWHCIFrameSchedulerPeriodic; 36 | 37 | void DWHCIFrameSchedulerPeriodic (TDWHCIFrameSchedulerPeriodic *pThis); 38 | void _DWHCIFrameSchedulerPeriodic (TDWHCIFrameScheduler *pBase); 39 | 40 | void DWHCIFrameSchedulerPeriodicStartSplit (TDWHCIFrameScheduler *pBase); 41 | boolean DWHCIFrameSchedulerPeriodicCompleteSplit (TDWHCIFrameScheduler *pBase); 42 | void DWHCIFrameSchedulerPeriodicTransactionComplete (TDWHCIFrameScheduler *pBase, u32 nStatus); 43 | 44 | void DWHCIFrameSchedulerPeriodicWaitForFrame (TDWHCIFrameScheduler *pBase); 45 | 46 | boolean DWHCIFrameSchedulerPeriodicIsOddFrame (TDWHCIFrameScheduler *pBase); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /kernel/uspi/dwhciframescheduler.h: -------------------------------------------------------------------------------- 1 | // 2 | // dwhciframescheduler.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_dwhciframescheduler_h 21 | #define _uspi_dwhciframescheduler_h 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | typedef struct TDWHCIFrameScheduler 30 | { 31 | void (*_DWHCIFrameScheduler) (struct TDWHCIFrameScheduler *pThis); 32 | 33 | void (*StartSplit) (struct TDWHCIFrameScheduler *pThis); 34 | boolean (*CompleteSplit) (struct TDWHCIFrameScheduler *pThis); 35 | void (*TransactionComplete) (struct TDWHCIFrameScheduler *pThis, u32 nStatus); 36 | 37 | void (*WaitForFrame) (struct TDWHCIFrameScheduler *pThis); 38 | 39 | boolean (*IsOddFrame) (struct TDWHCIFrameScheduler *pThis); 40 | } 41 | TDWHCIFrameScheduler; 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /kernel/uspi/dwhciregister.h: -------------------------------------------------------------------------------- 1 | // 2 | // dwhciregister.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_dwhciregister_h 21 | #define _uspi_dwhciregister_h 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef struct TDWHCIRegister 31 | { 32 | boolean m_bValid; 33 | u32 m_nAddress; 34 | u32 m_nBuffer; 35 | } 36 | TDWHCIRegister; 37 | 38 | void DWHCIRegister (TDWHCIRegister *pThis, u32 nAddress); 39 | void DWHCIRegister2 (TDWHCIRegister *pThis, u32 nAddress, u32 nValue); 40 | void _DWHCIRegister (TDWHCIRegister *pThis); 41 | 42 | u32 DWHCIRegisterRead (TDWHCIRegister *pThis); 43 | void DWHCIRegisterWrite (TDWHCIRegister *pThis); 44 | 45 | u32 DWHCIRegisterGet (TDWHCIRegister *pThis); 46 | void DWHCIRegisterSet (TDWHCIRegister *pThis, u32 nValue); 47 | 48 | boolean DWHCIRegisterIsSet (TDWHCIRegister *pThis, u32 nMask); 49 | 50 | void DWHCIRegisterAnd (TDWHCIRegister *pThis, u32 nMask); 51 | void DWHCIRegisterOr (TDWHCIRegister *pThis, u32 nMask); 52 | 53 | void DWHCIRegisterClearBit (TDWHCIRegister *pThis, unsigned nBit); 54 | void DWHCIRegisterSetBit (TDWHCIRegister *pThis, unsigned nBit); 55 | void DWHCIRegisterClearAll (TDWHCIRegister *pThis); 56 | void DWHCIRegisterSetAll (TDWHCIRegister *pThis); 57 | 58 | #ifndef NDEBUG 59 | 60 | void DWHCIRegisterDump (TDWHCIRegister *pThis); 61 | 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /kernel/uspi/dwhcirootport.h: -------------------------------------------------------------------------------- 1 | // 2 | // dwhcirootport.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_dwhcirootport_h 21 | #define _uspi_dwhcirootport_h 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | struct TDWHCIDevice; 31 | 32 | typedef struct TDWHCIRootPort 33 | { 34 | struct TDWHCIDevice *m_pHost; 35 | 36 | TUSBDevice *m_pDevice; 37 | } 38 | TDWHCIRootPort; 39 | 40 | void DWHCIRootPort (TDWHCIRootPort *pThis, struct TDWHCIDevice *pHost); 41 | void _DWHCIRootPort (TDWHCIRootPort *pThis); 42 | 43 | boolean DWHCIRootPortInitialize (TDWHCIRootPort *pThis); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /kernel/uspi/macaddress.h: -------------------------------------------------------------------------------- 1 | // 2 | // macaddress.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_macaddress_h 21 | #define _uspi_macaddress_h 22 | 23 | #include 24 | #include 25 | 26 | #define MAC_ADDRESS_SIZE 6 27 | 28 | typedef struct TMACAddress 29 | { 30 | boolean m_bValid; 31 | 32 | u8 m_Address[MAC_ADDRESS_SIZE]; 33 | } 34 | TMACAddress; 35 | 36 | void MACAddress (TMACAddress *pThis); 37 | void MACAddress2 (TMACAddress *pThis, const u8 *pAddress); 38 | void _MACAddress (TMACAddress *pThis); 39 | 40 | boolean MACAddressIsEqual (TMACAddress *pThis, TMACAddress *pAddress2); 41 | 42 | void MACAddressSet (TMACAddress *pThis, const u8 *pAddress); 43 | void MACAddressSetBroadcast (TMACAddress *pThis); 44 | const u8 *MACAddressGet (TMACAddress *pThis); 45 | void MACAddressCopyTo (TMACAddress *pThis, u8 *pBuffer); 46 | 47 | boolean MACAddressIsBroadcast (TMACAddress *pThis); 48 | unsigned MACAddressGetSize (TMACAddress *pThis); 49 | 50 | void MACAddressFormat (TMACAddress *pThis, TString *pString); 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /kernel/uspi/macros.h: -------------------------------------------------------------------------------- 1 | // 2 | // macros.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_macros_h 21 | #define _uspi_macros_h 22 | 23 | #define PACKED __attribute__ ((packed)) 24 | #define ALIGN(n) __attribute__ ((aligned (n))) 25 | #define NOOPT __attribute__ ((optimize (0))) 26 | #define MAXOPT __attribute__ ((optimize (3))) 27 | 28 | // big endian (to be used for constants only) 29 | #define BE(value) ((((value) & 0xFF00) >> 8) | (((value) & 0x00FF) << 8)) 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /kernel/uspi/stdarg.h: -------------------------------------------------------------------------------- 1 | // 2 | // stdarg.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_stdarg_h 21 | #define _uspi_stdarg_h 22 | 23 | typedef __builtin_va_list va_list; 24 | 25 | #define va_start(arg, last) __builtin_va_start (arg, last) 26 | #define va_end(arg) __builtin_va_end (arg) 27 | #define va_arg(arg, type) __builtin_va_arg (arg, type) 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /kernel/uspi/string.h: -------------------------------------------------------------------------------- 1 | // 2 | // string.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_string_h 21 | #define _uspi_string_h 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | 31 | typedef struct TString 32 | { 33 | char *m_pBuffer; 34 | unsigned m_nSize; 35 | char *m_pInPtr; 36 | } 37 | TString; 38 | 39 | void String (TString *pThis); 40 | void String2 (TString *pThis, const char *pString); 41 | void _String (TString *pThis); 42 | 43 | const char *StringGet (TString *pThis); 44 | const char *StringSet (TString *pThis, const char *pString); 45 | 46 | size_t StringGetLength (TString *pThis); 47 | 48 | void StringAppend (TString *pThis, const char *pString); 49 | int StringCompare (TString *pThis, const char *pString); 50 | int StringFind (TString *pThis, char chChar); // returns index or -1 if not found 51 | 52 | void StringFormat (TString *pThis, const char *pFormat, ...); // supports only a small subset of printf(3) 53 | void StringFormatV (TString *pThis, const char *pFormat, va_list Args); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /kernel/uspi/synchronize.c: -------------------------------------------------------------------------------- 1 | // 2 | // synchronize.c 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #include 21 | #include 22 | #include 23 | 24 | #define EnableInterrupts() __asm volatile ("cpsie i") 25 | #define DisableInterrupts() __asm volatile ("cpsid i") 26 | 27 | static volatile unsigned s_nCriticalLevel = 0; 28 | static volatile boolean s_bWereEnabled; 29 | 30 | void uspi_EnterCritical (void) 31 | { 32 | u32 nFlags; 33 | __asm volatile ("mrs %0, cpsr" : "=r" (nFlags)); 34 | 35 | DisableInterrupts (); 36 | 37 | if (s_nCriticalLevel++ == 0) 38 | { 39 | s_bWereEnabled = nFlags & 0x80 ? FALSE : TRUE; 40 | } 41 | 42 | DataMemBarrier (); 43 | } 44 | 45 | void uspi_LeaveCritical (void) 46 | { 47 | DataMemBarrier (); 48 | 49 | assert (s_nCriticalLevel > 0); 50 | if (--s_nCriticalLevel == 0) 51 | { 52 | if (s_bWereEnabled) 53 | { 54 | EnableInterrupts (); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /kernel/uspi/types.h: -------------------------------------------------------------------------------- 1 | // 2 | // types.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_types_h 21 | #define _uspi_types_h 22 | 23 | typedef unsigned char u8; 24 | typedef unsigned short u16; 25 | typedef unsigned int u32; 26 | typedef unsigned long long u64; 27 | 28 | typedef char s8; 29 | typedef short s16; 30 | typedef int s32; 31 | 32 | typedef int boolean; 33 | #define FALSE 0 34 | #define TRUE 1 35 | 36 | typedef unsigned long size_t; 37 | typedef long ssize_t; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /kernel/uspi/usbconfigparser.h: -------------------------------------------------------------------------------- 1 | // 2 | // usbconfigparser.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_usbconfigparser_h 21 | #define _uspi_usbconfigparser_h 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | typedef struct TUSBConfigurationParser 31 | { 32 | const TUSBDescriptor *m_pBuffer; 33 | unsigned m_nBufLen; 34 | boolean m_bValid; 35 | const TUSBDescriptor *m_pEndPosition; 36 | const TUSBDescriptor *m_pCurrentPosition; 37 | const TUSBDescriptor *m_pErrorPosition; 38 | } 39 | TUSBConfigurationParser; 40 | 41 | void USBConfigurationParser (TUSBConfigurationParser *pThis, const void *pBuffer, unsigned nBufLen); 42 | void _USBConfigurationParser (TUSBConfigurationParser *pThis); 43 | 44 | boolean USBConfigurationParserIsValid (TUSBConfigurationParser *pThis); 45 | 46 | const TUSBDescriptor *USBConfigurationParserGetDescriptor (TUSBConfigurationParser *pThis, u8 ucType); // returns 0 if not found 47 | 48 | void USBConfigurationParserError (TUSBConfigurationParser *pThis, const char *pSource); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /kernel/uspi/usbdevicefactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // usbdevicefactory.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_usbdevicefactory_h 21 | #define _uspi_usbdevicefactory_h 22 | 23 | #include 24 | #include 25 | 26 | TUSBDevice *USBDeviceFactoryGetDevice (TUSBDevice *pParent); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /kernel/uspi/usbgamepad.h: -------------------------------------------------------------------------------- 1 | // 2 | // usbgamepad.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // Copyright (C) 2014 M. Maccaferri 7 | // 8 | // This program is free software: you can redistribute it and/or modify 9 | // it under the terms of the GNU General Public License as published by 10 | // the Free Software Foundation, either version 3 of the License, or 11 | // (at your option) any later version. 12 | // 13 | // This program is distributed in the hope that it will be useful, 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | // GNU General Public License for more details. 17 | // 18 | // You should have received a copy of the GNU General Public License 19 | // along with this program. If not, see . 20 | // 21 | #ifndef _usbgamepad_h 22 | #define _usbgamepad_h 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | typedef struct TUSBGamePadDevice 32 | { 33 | TUSBDevice m_USBDevice; 34 | unsigned m_nDeviceIndex; 35 | 36 | u8 m_ucInterfaceNumber; 37 | u8 m_ucAlternateSetting; 38 | 39 | TUSBEndpoint *m_pEndpointIn; 40 | TUSBEndpoint *m_pEndpointOut; 41 | 42 | USPiGamePadState m_State; 43 | TGamePadStatusHandler *m_pStatusHandler; 44 | 45 | u16 m_usReportDescriptorLength; 46 | u8 *m_pHIDReportDescriptor; 47 | 48 | TUSBRequest *m_pURB; 49 | u8 *m_pReportBuffer; 50 | u16 m_nReportSize; 51 | } 52 | TUSBGamePadDevice; 53 | 54 | void USBGamePadDevice (TUSBGamePadDevice *pThis, TUSBDevice *pDevice); 55 | void _CUSBGamePadDevice (TUSBGamePadDevice *pThis); 56 | 57 | boolean USBGamePadDeviceConfigure (TUSBDevice *pUSBDevice); 58 | 59 | void USBGamePadDeviceGetReport (TUSBGamePadDevice *pThis); 60 | void USBGamePadDeviceRegisterStatusHandler (TUSBGamePadDevice *pThis, TGamePadStatusHandler *pStatusHandler); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /kernel/uspi/usbhostcontroller.h: -------------------------------------------------------------------------------- 1 | // 2 | // usbhostcontroller.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_usbhostcontroller_h 21 | #define _uspi_usbhostcontroller_h 22 | 23 | #include 24 | 25 | #define TUSBHostController TDWHCIDevice // alias 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /kernel/uspi/usbmouse.h: -------------------------------------------------------------------------------- 1 | // 2 | // usbmouse.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _usbmouse_h 21 | #define _usbmouse_h 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #define MOUSE_BOOT_REPORT_SIZE 3 29 | 30 | typedef void TMouseStatusHandler (unsigned nButtons, int nDisplacementX, int nDisplacementY); 31 | 32 | typedef struct TUSBMouseDevice 33 | { 34 | TUSBDevice m_USBDevice; 35 | 36 | u8 m_ucInterfaceNumber; 37 | u8 m_ucAlternateSetting; 38 | 39 | TUSBEndpoint *m_pReportEndpoint; 40 | 41 | TMouseStatusHandler *m_pStatusHandler; 42 | 43 | TUSBRequest *m_pURB; 44 | u8 *m_pReportBuffer; 45 | } 46 | TUSBMouseDevice; 47 | 48 | void USBMouseDevice (TUSBMouseDevice *pThis, TUSBDevice *pDevice); 49 | void _CUSBMouseDevice (TUSBMouseDevice *pThis); 50 | 51 | boolean USBMouseDeviceConfigure (TUSBDevice *pUSBDevice); 52 | 53 | void USBMouseDeviceRegisterStatusHandler (TUSBMouseDevice *pThis, TMouseStatusHandler *pStatusHandler); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /kernel/uspi/usbstandardhub.h: -------------------------------------------------------------------------------- 1 | // 2 | // usbstandardhub.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _usbstandardhub_h 21 | #define _usbstandardhub_h 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | typedef struct TUSBStandardHub 35 | { 36 | TUSBDevice m_USBDevice; 37 | 38 | TUSBHubDescriptor *m_pHubDesc; 39 | 40 | unsigned m_nPorts; 41 | TUSBDevice *m_pDevice[USB_HUB_MAX_PORTS]; 42 | TUSBPortStatus *m_pStatus[USB_HUB_MAX_PORTS]; 43 | } 44 | TUSBStandardHub; 45 | 46 | void USBStandardHub (TUSBStandardHub *pThis, TUSBDevice *pDevice); 47 | void _USBStandardHub (TUSBStandardHub *pThis); 48 | 49 | boolean USBStandardHubInitialize (TUSBStandardHub *pThis); 50 | boolean USBStandardHubConfigure (TUSBDevice *pUSBDevice); 51 | 52 | TString *USBStandardHubGetDeviceNames (TUSBDevice *pDevice); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /kernel/uspi/usbstring.h: -------------------------------------------------------------------------------- 1 | // 2 | // usbstring.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_usbstring_h 21 | #define _uspi_usbstring_h 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | struct TUSBDevice; 32 | 33 | typedef struct TUSBString 34 | { 35 | struct TUSBDevice *m_pDevice; 36 | 37 | TUSBStringDescriptor *m_pUSBString; 38 | 39 | TString *m_pString; 40 | } 41 | TUSBString; 42 | 43 | void USBString (TUSBString *pThis, struct TUSBDevice *pDevice); 44 | void USBStringCopy (TUSBString *pThis, TUSBString *pParent); 45 | void _USBString (TUSBString *pThis); 46 | 47 | boolean USBStringGetFromDescriptor (TUSBString *pThis, u8 ucID, u16 usLanguageID); 48 | 49 | const char *USBStringGet (TUSBString *pThis); 50 | 51 | u16 USBStringGetLanguageID (TUSBString *pThis); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /kernel/uspi/uspilibrary.h: -------------------------------------------------------------------------------- 1 | // 2 | // uspilibrary.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_uspilibrary_h 21 | #define _uspi_uspilibrary_h 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | #define MAX_DEVICES 4 36 | 37 | typedef struct TUSPiLibrary 38 | { 39 | TDeviceNameService NameService; 40 | TDWHCIDevice DWHCI; 41 | TUSBKeyboardDevice *pUKBD1; 42 | TUSBMouseDevice *pUMouse1; 43 | TUSBBulkOnlyMassStorageDevice *pUMSD[MAX_DEVICES]; 44 | TSMSC951xDevice *pEth0; 45 | TUSBGamePadDevice *pUPAD[MAX_DEVICES]; 46 | } 47 | TUSPiLibrary; 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /kernel/uspi/util.h: -------------------------------------------------------------------------------- 1 | // 2 | // util.h 3 | // 4 | // USPi - An USB driver for Raspberry Pi written in C 5 | // Copyright (C) 2014 R. Stange 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | // 20 | #ifndef _uspi_util_h 21 | #define _uspi_util_h 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | #ifdef USPI_PROVIDE_MEM_FUNCTIONS 31 | #define memset uspi_memset 32 | #define memcpy uspi_memcpy 33 | #define memcmp uspi_memcmp 34 | #endif 35 | 36 | #ifdef USPI_PROVIDE_STR_FUNCTIONS 37 | #define strlen uspi_strlen 38 | #define strcmp uspi_strcmp 39 | #define strcpy uspi_strcpy 40 | #define strncpy uspi_strncpy 41 | #define strcat uspi_strcat 42 | #endif 43 | 44 | void *memset (void *pBuffer, int nValue, size_t nLength); 45 | 46 | void *memcpy (void *pDest, const void *pSrc, size_t nLength); 47 | 48 | int memcmp (const void *pBuffer1, const void *pBuffer2, size_t nLength); 49 | 50 | size_t strlen (const char *pString); 51 | 52 | int strcmp (const char *pString1, const char *pString2); 53 | 54 | char *strcpy (char *pDest, const char *pSrc); 55 | 56 | char *strncpy (char *pDest, const char *pSrc, size_t nMaxLen); 57 | 58 | char *strcat (char *pDest, const char *pSrc); 59 | 60 | int uspi_char2int (char chValue); // with sign extension 61 | 62 | u16 uspi_le2be16 (u16 usValue); 63 | 64 | u32 uspi_le2be32 (u32 ulValue); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /kernel/wiring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2014 Marco Maccaferri and Others 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef WIRING_H_ 19 | #define WIRING_H_ 20 | 21 | // Pin modes 22 | 23 | #define OUTPUT 0 24 | #define INPUT 1 25 | #define INPUT_PULLUP 2 26 | #define INPUT_PULLDOWN 3 27 | 28 | #define LOW 0 29 | #define HIGH 1 30 | 31 | #if defined(__cplusplus) 32 | extern "C" { 33 | #endif 34 | 35 | void pinMode(int pin, int mode); 36 | int digitalRead(int pin); 37 | void digitalWrite(int pin, int value); 38 | 39 | #if defined(__cplusplus) 40 | } 41 | #endif 42 | 43 | #endif /* WIRING_H_ */ 44 | -------------------------------------------------------------------------------- /libogg/.gitignore: -------------------------------------------------------------------------------- 1 | libogg.a 2 | -------------------------------------------------------------------------------- /libogg/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | libogg 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.core.ccnature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /libogg/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | 13 | PREFIX := /opt/raspberry-pi 14 | 15 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 16 | CFLAGS = -DHAVE_CONFIG_H -I. -Iinclude -O20 -Wall -ffreestanding -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp -ffast-math -fsigned-char -g -O2 17 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 18 | 19 | all: deps libogg.a 20 | 21 | .PHONY: deps 22 | 23 | OBJS = bitwise.o framing.o 24 | 25 | -include $(DEPDIR)/*.Po 26 | 27 | libogg.a: $(OBJS) Makefile 28 | $(AR) rcs $@ $(OBJS) 29 | 30 | %.o: %.c 31 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 32 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 33 | 34 | %.o: %.cpp 35 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 36 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 37 | 38 | %.o: %.s 39 | $(AS) $(ASFLAGS) -o $@ $< 40 | 41 | deps: 42 | -@mkdir -p $(DEPDIR) 43 | 44 | install: 45 | -mkdir -p $(PREFIX)/include/ogg 46 | cp -f include/ogg/*.h $(PREFIX)/include/ogg 47 | -mkdir -p $(PREFIX)/lib 48 | cp -f libogg.a $(PREFIX)/lib 49 | 50 | clean: 51 | rm -f *.o libogg.a 52 | rm -rf $(DEPDIR) 53 | -------------------------------------------------------------------------------- /libogg/include/ogg/config_types.h: -------------------------------------------------------------------------------- 1 | #ifndef __CONFIG_TYPES_H__ 2 | #define __CONFIG_TYPES_H__ 3 | 4 | /* these are filled in by configure */ 5 | #define INCLUDE_INTTYPES_H 1 6 | #define INCLUDE_STDINT_H 1 7 | #define INCLUDE_SYS_TYPES_H 1 8 | 9 | #if INCLUDE_INTTYPES_H 10 | # include 11 | #endif 12 | #if INCLUDE_STDINT_H 13 | # include 14 | #endif 15 | #if INCLUDE_SYS_TYPES_H 16 | # include 17 | #endif 18 | 19 | typedef int16_t ogg_int16_t; 20 | typedef uint16_t ogg_uint16_t; 21 | typedef int32_t ogg_int32_t; 22 | typedef uint32_t ogg_uint32_t; 23 | typedef int64_t ogg_int64_t; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /libpng/.gitignore: -------------------------------------------------------------------------------- 1 | libpng.a 2 | -------------------------------------------------------------------------------- /libpng/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | libpng 4 | 5 | 6 | zlib 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | full,incremental, 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.cdt.core.cnature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 26 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 27 | 28 | 29 | -------------------------------------------------------------------------------- /libpng/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | 13 | PREFIX := /opt/raspberry-pi 14 | 15 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 16 | CFLAGS = -DHAVE_CONFIG_H -I. -I../zlib -O2 -ffreestanding -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 17 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 18 | 19 | all: deps libpng.a 20 | 21 | .PHONY: deps 22 | 23 | OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o \ 24 | pngwrite.o pngwtran.o pngwutil.o arm/arm_init.o arm/filter_neon.o arm/filter_neon_intrinsics.o 25 | 26 | -include $(DEPDIR)/*.Po 27 | 28 | libpng.a: $(OBJS) Makefile 29 | $(AR) rcs $@ $(OBJS) 30 | 31 | %.o: %.c 32 | @mkdir -p $(DEPDIR)/$(@D) 33 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 34 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 35 | 36 | %.o: %.cpp 37 | @mkdir -p $(DEPDIR)/$(@D) 38 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 39 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 40 | 41 | %.o: %.S 42 | @mkdir -p $(DEPDIR)/$(@D) 43 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 44 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 45 | 46 | deps: 47 | -@mkdir -p $(DEPDIR) 48 | 49 | install: 50 | -mkdir -p $(PREFIX)/include 51 | cp -f png.h pngconf.h $(PREFIX)/include 52 | -mkdir -p $(PREFIX)/lib 53 | cp -f libpng.a $(PREFIX)/lib 54 | 55 | clean: 56 | rm -f *.o libpng.a 57 | rm -rf $(DEPDIR) 58 | -------------------------------------------------------------------------------- /libpng/pkgconfig.mk: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS += -I../libpng -I../zlib 3 | 4 | LDFLAGS += -L../libpng -L../zlib 5 | 6 | LIBS := -lpng -lz $(LIBS) 7 | LIBS_DEP += ../libpng/libpng.a ../zlib/libz.a 8 | -------------------------------------------------------------------------------- /libpng/pngprefix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/libpng/pngprefix.h -------------------------------------------------------------------------------- /libvorbis/.gitignore: -------------------------------------------------------------------------------- 1 | libvorbis.a 2 | -------------------------------------------------------------------------------- /libvorbis/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | libvorbis 4 | 5 | 6 | libogg 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | full,incremental, 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.cdt.core.cnature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 26 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 27 | 28 | 29 | -------------------------------------------------------------------------------- /libvorbis/AUTHORS: -------------------------------------------------------------------------------- 1 | Monty 2 | 3 | and the rest of the Xiph.org Foundation. 4 | -------------------------------------------------------------------------------- /libvorbis/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2008 Xiph.org Foundation 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 7 | - Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | - Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | - Neither the name of the Xiph.org Foundation nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 22 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /libvorbis/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | 13 | PREFIX := /opt/raspberry-pi 14 | 15 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 16 | CFLAGS = -DHAVE_CONFIG_H -I. -I../libogg/include -Iinclude -Ilib -O20 -Wall -Wextra -ffast-math -ffreestanding -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp -D_REENTRANT -fsigned-char -Wdeclaration-after-statement 17 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 18 | 19 | all: libvorbis.a 20 | 21 | OBJS = lib/mdct.o lib/smallft.o lib/block.o lib/envelope.o lib/window.o lib/lsp.o lib/lpc.o lib/analysis.o lib/synthesis.o \ 22 | lib/psy.o lib/info.o lib/floor1.o lib/floor0.o lib/res0.o lib/mapping0.o lib/registry.o lib/codebook.o lib/sharedbook.o \ 23 | lib/lookup.o lib/bitrate.o lib/vorbisfile.o 24 | 25 | -include $(shell find $(DEPDIR) -name *.Po -print) 26 | 27 | libvorbis.a: $(OBJS) Makefile 28 | $(AR) rcs $@ $(OBJS) 29 | 30 | %.o: %.c 31 | @mkdir -p $(DEPDIR)/$(@D) 32 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 33 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 34 | 35 | %.o: %.cpp 36 | @mkdir -p $(DEPDIR)/$(@D) 37 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 38 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 39 | 40 | %.o: %.s 41 | $(AS) $(ASFLAGS) -o $@ $< 42 | 43 | install: 44 | -mkdir -p $(PREFIX)/include/vorbis 45 | cp -f include/vorbis/*.h $(PREFIX)/include/vorbis 46 | -mkdir -p $(PREFIX)/lib 47 | cp -f libvorbis.a $(PREFIX)/lib 48 | 49 | clean: 50 | rm -f $(OBJS) libvorbis.a 51 | rm -rf $(DEPDIR) 52 | -------------------------------------------------------------------------------- /libvorbis/lib/highlevel.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: highlevel encoder setup struct separated out for vorbisenc clarity 14 | last mod: $Id: highlevel.h 17195 2010-05-05 21:49:51Z giles $ 15 | 16 | ********************************************************************/ 17 | 18 | typedef struct highlevel_byblocktype { 19 | double tone_mask_setting; 20 | double tone_peaklimit_setting; 21 | double noise_bias_setting; 22 | double noise_compand_setting; 23 | } highlevel_byblocktype; 24 | 25 | typedef struct highlevel_encode_setup { 26 | int set_in_stone; 27 | const void *setup; 28 | double base_setting; 29 | 30 | double impulse_noisetune; 31 | 32 | /* bitrate management below all settable */ 33 | float req; 34 | int managed; 35 | long bitrate_min; 36 | long bitrate_av; 37 | double bitrate_av_damp; 38 | long bitrate_max; 39 | long bitrate_reservoir; 40 | double bitrate_reservoir_bias; 41 | 42 | int impulse_block_p; 43 | int noise_normalize_p; 44 | int coupling_p; 45 | 46 | double stereo_point_setting; 47 | double lowpass_kHz; 48 | int lowpass_altered; 49 | 50 | double ath_floating_dB; 51 | double ath_absolute_dB; 52 | 53 | double amplitude_track_dBpersec; 54 | double trigger_setting; 55 | 56 | highlevel_byblocktype block[4]; /* padding, impulse, transition, long */ 57 | 58 | } highlevel_encode_setup; 59 | -------------------------------------------------------------------------------- /libvorbis/lib/lookup.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: lookup based functions 14 | last mod: $Id: lookup.h 16227 2009-07-08 06:58:46Z xiphmont $ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef _V_LOOKUP_H_ 19 | 20 | #ifdef FLOAT_LOOKUP 21 | extern float vorbis_coslook(float a); 22 | extern float vorbis_invsqlook(float a); 23 | extern float vorbis_invsq2explook(int a); 24 | extern float vorbis_fromdBlook(float a); 25 | #endif 26 | #ifdef INT_LOOKUP 27 | extern long vorbis_invsqlook_i(long a,long e); 28 | extern long vorbis_coslook_i(long a); 29 | extern float vorbis_fromdBlook_i(long a); 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libvorbis/lib/lpc.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LPC low level routines 14 | last mod: $Id: lpc.h 16037 2009-05-26 21:10:58Z xiphmont $ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef _V_LPC_H_ 19 | #define _V_LPC_H_ 20 | 21 | #include "vorbis/codec.h" 22 | 23 | /* simple linear scale LPC code */ 24 | extern float vorbis_lpc_from_data(float *data,float *lpc,int n,int m); 25 | 26 | extern void vorbis_lpc_predict(float *coeff,float *prime,int m, 27 | float *data,long n); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libvorbis/lib/lsp.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: LSP (also called LSF) conversion routines 14 | last mod: $Id: lsp.h 16227 2009-07-08 06:58:46Z xiphmont $ 15 | 16 | ********************************************************************/ 17 | 18 | 19 | #ifndef _V_LSP_H_ 20 | #define _V_LSP_H_ 21 | 22 | extern int vorbis_lpc_to_lsp(float *lpc,float *lsp,int m); 23 | 24 | extern void vorbis_lsp_to_curve(float *curve,int *map,int n,int ln, 25 | float *lsp,int m, 26 | float amp,float ampoffset); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libvorbis/lib/registry.c: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | last mod: $Id: registry.c 16227 2009-07-08 06:58:46Z xiphmont $ 15 | 16 | ********************************************************************/ 17 | 18 | #include "vorbis/codec.h" 19 | #include "codec_internal.h" 20 | #include "registry.h" 21 | #include "misc.h" 22 | /* seems like major overkill now; the backend numbers will grow into 23 | the infrastructure soon enough */ 24 | 25 | extern const vorbis_func_floor floor0_exportbundle; 26 | extern const vorbis_func_floor floor1_exportbundle; 27 | extern const vorbis_func_residue residue0_exportbundle; 28 | extern const vorbis_func_residue residue1_exportbundle; 29 | extern const vorbis_func_residue residue2_exportbundle; 30 | extern const vorbis_func_mapping mapping0_exportbundle; 31 | 32 | const vorbis_func_floor *const _floor_P[]={ 33 | &floor0_exportbundle, 34 | &floor1_exportbundle, 35 | }; 36 | 37 | const vorbis_func_residue *const _residue_P[]={ 38 | &residue0_exportbundle, 39 | &residue1_exportbundle, 40 | &residue2_exportbundle, 41 | }; 42 | 43 | const vorbis_func_mapping *const _mapping_P[]={ 44 | &mapping0_exportbundle, 45 | }; 46 | -------------------------------------------------------------------------------- /libvorbis/lib/registry.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: registry for time, floor, res backends and channel mappings 14 | last mod: $Id: registry.h 15531 2008-11-24 23:50:06Z xiphmont $ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef _V_REG_H_ 19 | #define _V_REG_H_ 20 | 21 | #define VI_TRANSFORMB 1 22 | #define VI_WINDOWB 1 23 | #define VI_TIMEB 1 24 | #define VI_FLOORB 2 25 | #define VI_RESB 3 26 | #define VI_MAPB 1 27 | 28 | extern const vorbis_func_floor *const _floor_P[]; 29 | extern const vorbis_func_residue *const _residue_P[]; 30 | extern const vorbis_func_mapping *const _mapping_P[]; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /libvorbis/lib/smallft.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: fft transform 14 | last mod: $Id: smallft.h 13293 2007-07-24 00:09:47Z xiphmont $ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef _V_SMFT_H_ 19 | #define _V_SMFT_H_ 20 | 21 | #include "vorbis/codec.h" 22 | 23 | typedef struct { 24 | int n; 25 | float *trigcache; 26 | int *splitcache; 27 | } drft_lookup; 28 | 29 | extern void drft_forward(drft_lookup *l,float *data); 30 | extern void drft_backward(drft_lookup *l,float *data); 31 | extern void drft_init(drft_lookup *l,int n); 32 | extern void drft_clear(drft_lookup *l); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /libvorbis/lib/window.h: -------------------------------------------------------------------------------- 1 | /******************************************************************** 2 | * * 3 | * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * 4 | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 5 | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 6 | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 7 | * * 8 | * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * 9 | * by the Xiph.Org Foundation http://www.xiph.org/ * 10 | * * 11 | ******************************************************************** 12 | 13 | function: window functions 14 | last mod: $Id: window.h 19028 2013-12-02 23:23:39Z tterribe $ 15 | 16 | ********************************************************************/ 17 | 18 | #ifndef _V_WINDOW_ 19 | #define _V_WINDOW_ 20 | 21 | extern const float *_vorbis_window_get(int n); 22 | extern void _vorbis_apply_window(float *d,int *winno,long *blocksizes, 23 | int lW,int W,int nW); 24 | 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /libvorbis/pkgconfig.mk: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS += -I../libvorbis/include -I../libogg/include 3 | 4 | LDFLAGS += -L../libvorbis -L../libogg 5 | 6 | LIBS := -lvorbis -logg $(LIBS) 7 | LIBS_DEP += ../libvorbis/libvorbis.a ../libogg/libogg.a 8 | -------------------------------------------------------------------------------- /libvorbis/todo.txt: -------------------------------------------------------------------------------- 1 | Open project list for further development: 2 | 3 | libvorbis: 4 | 5 | Meaningful error code returns 6 | 7 | still some padding at EOS 8 | 9 | Option for brute-forcing vq search on maptype 2 (helps on undertrained 10 | sets). 11 | 12 | encoder switch interface for binary compat through changes; ioctl()-like? 13 | 14 | API changes: 15 | break up some of the more monolithic calls (eg, allow access 16 | to MDCT domain data, additional low level framing capability) 17 | convenience calls for text comments 18 | 19 | other: 20 | 21 | command line suite 22 | 'crashme' 23 | -------------------------------------------------------------------------------- /template/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | template 4 | 5 | 6 | kernel 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | full,incremental, 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.cdt.core.cnature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 26 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 27 | 28 | 29 | -------------------------------------------------------------------------------- /template/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: kernel.img 3 | 4 | include ../kernel/common.mk 5 | 6 | OBJS = main.o 7 | 8 | -include $(DEPDIR)/*.Po 9 | 10 | kernel.img: $(OBJS) Makefile ../kernel/raspberry.ld $(LIBS_DEP) 11 | $(CXX) $(LDFLAGS) $(OBJS) $(LIBS) 12 | $(OBJCOPY) kernel.elf -O binary kernel.img 13 | rm kernel.elf 14 | 15 | clean: 16 | rm -f $(OBJS) kernel.elf kernel.img kernel.map 17 | rm -rf $(DEPDIR) 18 | -------------------------------------------------------------------------------- /template_sdl/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | template_sdl 4 | 5 | 6 | SDL2 7 | 8 | 9 | 10 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 11 | clean,full,incremental, 12 | 13 | 14 | 15 | 16 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 17 | full,incremental, 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.cdt.core.cnature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /template_sdl/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: kernel.img 3 | 4 | include ../kernel/common.mk 5 | include ../SDL2/pkgconfig.mk 6 | 7 | OBJS = main.o 8 | 9 | -include $(DEPDIR)/*.Po 10 | 11 | kernel.img: $(OBJS) Makefile ../kernel/raspberry.ld $(LIBS_DEP) 12 | $(CXX) $(LDFLAGS) -o kernel.elf $(OBJS) $(LIBS) 13 | $(OBJCOPY) kernel.elf -O binary kernel.img 14 | rm kernel.elf 15 | 16 | clean: 17 | rm -f $(OBJS) kernel.elf kernel.img kernel.map 18 | rm -rf $(DEPDIR) 19 | -------------------------------------------------------------------------------- /zlib/.gitignore: -------------------------------------------------------------------------------- 1 | libz.a 2 | -------------------------------------------------------------------------------- /zlib/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | zlib 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.core.ccnature 24 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maccasoft/raspberry-pi/e7079f417519a950800a39f7edb644eb3bda0b9e/zlib/ChangeLog -------------------------------------------------------------------------------- /zlib/Makefile: -------------------------------------------------------------------------------- 1 | 2 | TOOLCHAIN := arm-none-eabi- 3 | 4 | CC := $(TOOLCHAIN)gcc 5 | CXX := $(TOOLCHAIN)g++ 6 | LD := $(TOOLCHAIN)ld 7 | AS := $(TOOLCHAIN)as 8 | AR := $(TOOLCHAIN)ar 9 | OBJCOPY := $(TOOLCHAIN)objcopy 10 | 11 | DEPDIR := .deps 12 | 13 | PREFIX := /opt/raspberry-pi 14 | 15 | ASFLAGS = --warn -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp 16 | CFLAGS = -O3 -ffreestanding -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=softfp -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. 17 | CPPFLAGS = $(CFLAGS) -fno-exceptions -fno-unwind-tables -fno-rtti 18 | 19 | all: libz.a 20 | 21 | OBJS = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o \ 22 | compress.o uncompr.o \ 23 | gzclose.o gzlib.o gzread.o gzwrite.o 24 | 25 | -include $(DEPDIR)/*.Po 26 | 27 | libz.a: $(OBJS) Makefile 28 | $(AR) rcs $@ $(OBJS) 29 | 30 | %.o: %.c 31 | @mkdir -p $(DEPDIR)/$(@D) 32 | $(CC) $(CFLAGS) -std=c99 -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 33 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 34 | 35 | %.o: %.cpp 36 | @mkdir -p $(DEPDIR)/$(@D) 37 | $(CXX) $(CPPFLAGS) -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< 38 | @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po 39 | 40 | %.o: %.s 41 | $(AS) $(ASFLAGS) -o $@ $< 42 | 43 | install: 44 | -mkdir -p $(PREFIX)/include 45 | cp -f zlib.h zconf.h $(PREFIX)/include 46 | -mkdir -p $(PREFIX)/lib 47 | cp -f libz.a $(PREFIX)/lib 48 | 49 | clean: 50 | rm -f *.o libz.a 51 | rm -rf $(DEPDIR) 52 | -------------------------------------------------------------------------------- /zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /zlib/pkgconfig.mk: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS += -I../zlib 3 | 4 | LDFLAGS += -L../zlib 5 | 6 | LIBS := -lz $(LIBS) 7 | LIBS_DEP += ../zlib/libz.a 8 | --------------------------------------------------------------------------------