diff --git a/.gitignore b/.gitignore index 742cba8e..430a4548 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ *.o *.swp +*.SFO +*.PBP *.dll *.lib *.pdb @@ -16,11 +18,12 @@ config.log cpu/musashi/m68kmake cpu/musashi/m68kops.c cpu/musashi/m68kops.h -skin config.cfg +skin srm/ brm/ mds/ +rom/ cfg/ libs/ obj/ @@ -32,6 +35,8 @@ picodrive_libretro* PicoDrive*.opk PicoDrive*.ipk PicoDrive*.zip +PicoDrive*.elf pico_int_offs.h amalgamate textfilter +.vscode/ diff --git a/.gitmodules b/.gitmodules index 5d28012a..799824ae 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "platform/libpicofe"] path = platform/libpicofe - url = https://github.com/irixxxx/libpicofe.git + url = https://github.com/raytf/libpicofe.git [submodule "cpu/cyclone"] path = cpu/cyclone url = https://github.com/irixxxx/cyclone68000.git diff --git a/Makefile b/Makefile index 48fa6a4d..4381b5a7 100644 --- a/Makefile +++ b/Makefile @@ -406,8 +406,11 @@ endif ifeq "$(PLATFORM)" "psp" PSPSDK ?= $(shell psp-config --pspsdk-path) TARGET = PicoDrive -PSP_EBOOT_TITLE = PicoDrive +PSP_EBOOT_TITLE = Sonic UGC PSP_EBOOT_ICON = platform/psp/data/icon.png +PSP_EBOOT_PIC1 = platform/psp/skin/background_selector.png +PSP_EBOOT_SND0 = platform/psp/data/SND0.AT3 + LIBS += -lpng -lm -lz -lpspgu -lpsppower -lpspaudio -lpsprtc -lpspaudiocodec EXTRA_TARGETS = EBOOT.PBP include $(PSPSDK)/lib/build.mak diff --git a/README.md b/README.md index 527aa29b..d418999d 100644 --- a/README.md +++ b/README.md @@ -1,108 +1,55 @@ -This is yet another SEGA 8 bit and 16 bit console emulator. +# Sonic's UGC for PSP -It can run games developed for most consumer hardware released -by SEGA, up to and including the 32X: -- **16 bit systems:** Mega Drive/Genesis, Sega/Mega CD, 32X, Pico -- **8 bit systems**: SG-1000, SC-3000, Master System/Mark III, Game Gear +A fork of PicoDrive for PSP, skinned to look like Sonic's Ultimate Genesis Collection -PicoDrive was originally created with ARM-based handheld devices -in mind, but later received various cross-platform improvements -such as SH2 recompilers for MIPS (mips32r2), ARM64 (armv8), RISC-V (RV64IM) -and PowerPC (G4/2.03). +### Why? -PicoDrive was the first software to properly emulate Virtua Racing and -its SVP chip. +In 2019 (when i originally had this idea) i had just gotten a PSP, and in 2016-2020 i had a copy of Sonic's UGC on the Xbox 360, i knew that the PSP was very much powerful enough to run the same library of games, and this was on the back of my head until August of 2024, when i finally gained enough skill to make this into a reality. -At present, most development activity occurs in -[irixxxx's fork](https://github.com/irixxxx/picodrive); -[notaz's repo](https://github.com/notaz/picodrive) is updated less frequently. +**Fun Fact** - I did make a **terrible** version of this idea in 2019 with my limited brain, which i still have archived today, (i stretched the SUGC logo to fit on the PBP, changed the background which made the game list almost unreadable, and a few other horrible hacks), but, it didn't involve any source code. This time i'm doing it for real, redesigning the UI and open sourcing all of it -### Sega Pico and Storyware Pages +### Downloads -PicoDrive can use Storyware pages and pad overlays in png format in the same -directory as the cartridge image. The selected page is displayed automatically -if the pen is used on the storyware or pad. Details about how to correctly name -the pages can be found in the *How to run Sega Pico games* section in -`platform/base_readme.txt`. +Soon! -### Gallery +### To-do List -Some images of demos and homebrew software: +| Done | Feature | Progress | +| ------- | --------------------- | -------- | +| ✅ (M1) | ISO Support | 100% | +| ✅ (M1) | Game List | 100% | +| ✅ (M2) | Title Screen | 100% | +| ✅ (M2) | Backgrounds | 100% | +| ✅ (M2) | SRAM in SAVEDATA | 100% | +| ✳️ (M3) | Bunken Tech Fontmap | 100% | +| ✳️ (M3) | Background Theme | 35% | +| ❌ (M4) | ROM Selector UI | 0% | +| ❌ (M5) | ROM Boxart UI | 0% | +| ❌ (M6) | Rating System | 0% | +| ❓ (V1) | Customizer Tool | 0% | -| ![Titan Overdrive 2](https://github.com/irixxxx/picodrive/assets/31696370/02a4295b-ac9d-4114-bcd1-b5dd6e5930d0) | ![Raycast Demo](https://github.com/irixxxx/picodrive/assets/31696370/6e9c0bfe-49a9-45aa-bad7-544de065e388) | ![OpenLara](https://github.com/irixxxx/picodrive/assets/31696370/8a00002a-5c10-4d1d-a948-739bf978282a) | -| --- | --- | --- | -| [_MegaDrive: Titan Overdrive 2_](https://demozoo.org/productions/170767/) | [_MegaCD: RaycastDemo_](https://github.com/matteusbeus/RaycastDemo) | [_32X: OpenLara_](https://github.com/XProger/OpenLara/releases) | -|![Titan Overdrive 2](https://github.com/irixxxx/picodrive/assets/31696370/2e263e81-51c8-4daa-ab16-0b2cd5554f84)|![DMA David](https://github.com/irixxxx/picodrive/assets/31696370/fbbeac15-8665-4d3e-9729-d1f8c35e417a)|![Doom Resurrection](https://github.com/irixxxx/picodrive/assets/31696370/db7b7153-b917-4850-8442-a748c2fbb968)| -| [_MegaDrive: Titan Overdrive 2_](https://www.pouet.net/prod.php?which=69648) | [_MegaDrive: DMA David_](http://www.mode5.net/DMA_David.html) | [_32X: Doom Resurrection_](https://archive.org/details/doom-32x-all-versions) | +### Q&A -| ![Cheril Perils Classics](https://github.com/irixxxx/picodrive/assets/31696370/653914a4-9f90-45f8-bd91-56e784df7550) | ![Stygian Quest](https://github.com/irixxxx/picodrive/assets/31696370/8196801b-85c8-4d84-97e1-ae57ab3d577f) | ![Sword of Stone](https://github.com/irixxxx/picodrive/assets/31696370/3c4a8f40-dad6-4fa4-b188-46b428a4b8c6) | -| --- | --- | --- | -| [_SG-1000: Cheril Perils Classic_](https://www.smspower.org/Homebrew/CherilPerilsClassic-SG) | [_MasterSystem: Stygian Quest_](https://www.smspower.org/Homebrew/StygianQuest-SMS) | [_GameGear: The Sword of Stone_](https://www.smspower.org/Homebrew/SwordOfStone-GG) | -| ![Nyan Cat](https://github.com/irixxxx/picodrive/assets/31696370/6fe0d38b-549d-4faa-9351-b260a89dc745) | ![Anguna the Prison Dungeon](https://github.com/irixxxx/picodrive/assets/31696370/3264b962-7da2-4257-9ff7-1b509bd50cdf) | ![Turrican](https://github.com/irixxxx/picodrive/assets/31696370/c4eb2f2c-806e-4f4b-ac94-5c2cda82e962) | -| [_SG-1000: Nyan Cat_](https://www.smspower.org/Homebrew/NyanCat-SG) | [_MS: Anguna the Prison Dungeon_](https://www.smspower.org/Homebrew/AngunaThePrisonDungeon-SMS) | [_GameGear: Turrican_](https://www.smspower.org/Homebrew/GGTurrican-GG) | +**Q: Will you make this for the European version of Sonic's UGC (Sega Mega Drive Ultimate Collection // SEGA MDUC)?** +A: Originally i wasn't going to, but after making a separate branch to do it, i'm definitely going to release it. Up-to-date Development builds will ALWAYS be based on SUGC though. -### Compiling +**Q: Will you make a PS2 Port? It looks really similar to the PSP version!** +A: Never. I haven't owned a PS2 since 2013 (when i was a fucking baby) and don't plan to. -For platforms where release builds are provided, the simplest method is to -use the release script `tools/release.sh`. See the script itself for details. -To create platform builds run the command: +**Q: How can i add more games?** +A: Download or compile the Memory Stick version, go to or create the "rom" directory and add your games there, the file format doesn't matter -``` -tools/release.sh [version] [platforms...] -``` +**Q: How do i compile on Windows?** +A: Not supported. I haven't used Windows as my daily OS since 2021 and have no plans to go back. Modern Windows is terrible and i have no reason to switch back (the biggest hurdle was Camtasia, which i finally stopped using after 6 years). Just use a Linux VM if you can't make the switch -This will generate a file for each platform in the `release-[version]` directory. -A list of supported platforms can be found in the release script. +**Q: Does this work on PS Vita?** +A: Yes, just use Adrenaline and you're good, both the ISO and Memory Stick versions should work with no problem. -These commands should create an executable for a unixoid platform not included in the list: +**Q: Does this work on PPSSPP?** +A: Absolutely! I used PPSSPP for testing the dev builds and it works flawlessly, but if you're gonna emulate SEGA Genesis games on an emulator, just use a normal Sega Genesis emulator, this is largely intended for people who own a PSP or PS Vita console. -``` -configure --platform=generic -make -``` +**Q: How did you get an uncompressed version of the SUGC Intro and Soundtrack** +A: I ripped them myself from the Xbox 360 and PS3 version, just extract the files from the ISO and you should be good. ([Intro Video (X360)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SGC2_ATTRACT.wmv) - [Background Theme (Retro Dreams) (X360)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/retro_dreams.xma) - [Background Video (X360)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/MAIN0001.wmv) - [SUGC Logo (PS3)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SUGC_LOGO.PNG) - [SMDUC Logo (PS3)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SMDUC_LOGO.PNG) - [XMB BGM (PS3)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SND0.AT3) - [XMB BGM (PS3, converted to WAV)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SND0.wav) - [XMB BGM (PS3, converted to MP3)](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SND0.mp3)) -To compile PicoDrive as a libretro core, use this command: - -``` -make -f Makefile.libretro -``` - -### Helix MP3 decoder for ARM - -For 32 bit ARM platforms, the optimized helix MP3 decoder can be used to play -MP3 audio files with CD games. Due to licensing issues, the helix source files -cannot be provided here; if you have obtained the sources legally, place them in -the `platform/common/helix` directory. - -To compile the helix sources: - -- Set the environment variable `CROSS_COMPILE` to your cross compiler prefix -(e.g. `arm-linux-gnueabi-`) -- Set the environment variable `LIBGCC` to your cross compiler's `libgcc.a` -(e.g. `/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/libgcc.a`) -- Run the command: -``` -make -C platform/common/helix CROSS_COMPILE=$CROSS_COMPILE LIBGCC=$LIBGCC -``` -- Copy the resulting shared library named `${CROSS_COMPILE}helix_mp3.so` as -`libhelix.so` to the directory containing the PicoDrive binary on the target device. - -In addition, helix support must be enabled in PicoDrive itself by compiling with: - -``` -make PLATFORM_MP3=1 -``` - -This switch is enabled automatically for Gamepark Holdings devices (`gp2x`, -`caanoo` and `wiz`). Without installing `libhelix.so`, these devices will not play -MP3 audio. - -### Installing - -The release script produces packages or zip archives which have to be installed -manually on the target device. Usually this involves unpacking the archive or -copying the package to a directory on either the internal device storage or an -SD card. Device-specific instructions can be found on the internet. - - -Send bug reports, fixes etc. to +**Q: How did you figure out this really confusing source code?** +A: I admit that the PicoDrive source code is *almost* unreadable, and i definitely wouldn't recommend it to a beginner, but even if you are total trash at C code like i am, if you know where to look, it's not that hard, 99% of the changes were in the UI and the PSP-specific code, not on the emulator itself, i'm pretty sure it's possible to port this to Windows/Linux/PS2, but i have no desire in doing it myself, i can provide all of the design files, [my DMs are always open](https://raythefox.pw), message me and i'll be glad to help. diff --git a/platform/base_readme.txt b/platform/base_readme.txt index 51dcb98a..df2c8274 100644 --- a/platform/base_readme.txt +++ b/platform/base_readme.txt @@ -1,598 +1 @@ -About PicoDrive ---------------- - #include "../README.md" - - -How to make it run ------------------- - -#ifdef GENERIC -Extract the zip file into some directory and run PicoDrive from there. -#endif -#ifdef GP2X -Extract all files to some directory on your SD and run PicoDrive.gpe from your -GP2X/Wiz/Caanoo menu. The same .gpe supports GP2X F100/F200, Wiz and Caanoo, -there is no need to use separate versions. -#endif -#ifdef GIZ -First make sure you have homebrew-enabled Service Pack installed. Then copy -PicoDrive.exe and KGSDK.dll to any place in your filesystem (both files must -be in the same directory) and run PicoDrive.exe using the launcher of your choice -(some of them might require renaming PicoDrive.exe to Autorun.exe, placing it in -the root of SD, etc). -#endif -#ifdef PSP -If you are running a custom firmware, just copy the whole PicoDrive directory to -/PSP/GAME or /PSP/GAMEXXX directory in your memory stick (it shouldn't matter -which one GAME* directory to use). -#endif -#ifdef PANDORA -Just copy the .pnd to /pandora/menu or /pandora/desktop. -#endif - -Then load a ROM and enjoy! Cartridge ROMs can be in various common formats and -can be zipped, one ROM file per zip. Certain extensions are used to detect the -console the ROM is for (.sg, .sc, .sms, .gg, .smd, .md, .gen, .32x, .pco). -For MSU games, load the .cue file and make sure the cartridge ROM has the same -name and is in the same directory. -Sega/Mega CD images can be in CHD, CUE+BIN/ISO or ISO/CSO+MP3/WAV format (read -below for more details). - -This emulator has lots of options with various tweaks (for improved speed mostly), -but it should have best compatibility in it's default config. If suddenly you -start getting glitches or change something and forget what, use "Restore defaults" -option. - - -How to run Sega/Mega CD games ------------------------------ - -To play any non-MSU CD game you need BIOS files. These files must be copied to -#ifdef PANDORA -/pandora/appdata/picodrive/ directory -(if you run PicoDrive once it will create that directory for you). -#else -#ifdef GENERIC -the .picodrive directory in your home directory. -#else -the same directory as PicoDrive files. -#endif -#endif -Files must be named as follows: - -US: us_scd1_9210.bin, us_scd2_9306.bin, SegaCDBIOS9303.bin -EU: eu_mcd1_9210.bin, eu_mcd2_9303.bin, eu_mcd2_9306.bin -JP: jp_mcd1_9112.bin, jp_mcd1_9111.bin -these files can also be zipped. - -The game must be dumped to CHD, CUE+BIN or CUE+ISO format. -ISO/CSO+MP3/WAV is also supported, but may cause problems. -When using CUE/BIN, you must load .cue file from the menu, or else the emu will -not find audio tracks. - - -How to run Sega Pico games --------------------------- - -The Pico was special in that it had a large touchpad with an associated pen, and -so-called storyware, a combination of a cartridge with a book with up to 6 pages -on which the pen could also be used. - -Most storywares used the touchpad with the pen as a pointer device, showing a -pointer icon on the screen when the pen was on the touchpad which could be moved -around. The pen has a dedicated button which was often used to select something -under the pointer icon, much like a mouse button. -However, a few games also had an overlay for the touchpad. - -PicoDrive supports displaying both the storyware pages as well as a pad overlay. -They must be in png format and named like the storyware ROM without the -extension, plus "_.png" for the storyware page , and "_pad.png" for a pad -overlay. Storyware page images should have an aspect ration of 2:1, pad images -should have 4:3. All images can have arbitrary resolution and are automatically -scaled to fit the screen. - -There are 2 menu actions for switching to pages or pad which will automatically -display the images if they are available. To allow for proper pen positioning -there is also an action for having the pen on the page/touchpad or not. Pen -positioning is done through the D-pad if the screen has been switched to either -pages or pad. - - -Other important stuff ---------------------- - -* Sega/Mega CD: If the background music is missing, the CD image format may be - wrong. Currently .cue/bin or .chd is recommended. Be aware that there are - lots of bad dumps on the web, and some use mp3 format for audio, which often - causes problems (see below). -* While iso/mp3 format is supported, it's not recommended to use. - Some of many problems with mp3 are listed below: - * MP3s may be named incorrectly and will not play. - * The game music may play too fast/too slow/out of sync, which means they - are encoded incorrectly. PicoDrive is not a mp3 player, so all mp3s MUST - be encoded at 44.1kHz stereo. -* Sega/Mega CD: If your games hang at the BIOS screen (with planets shown), - you may be using a bad BIOS dump. Try another from a different source, - like dumping it from your own console. -#ifdef GP2X -* When using mp3s, use lower bitrate for better performance (96 or 128kbps - CBRs recommended). -* GP2X F100/F200: When you use both GP2X CPUs, keep in mind that you can't - overclock as high as when using ARM920 only. For example my GP2X when run - singlecore can reach 280MHz, but with both cores it's about 250MHz. When - overclocked too much, it may start hanging and producing random noise, or - causing ARM940 crashes ("940 crashed" message displayed). -* GP2X F100/F200: Due to internal implementation mp3s must not be larger that - 12MB (12582912 bytes). Larger mp3s will not be fully loaded. -#endif - - -Options -------- - -@@0. "Region" -This option lets you force the game to think it is running on machine from the -specified region, or just to set autodetection order. Also affects Sega/Mega CD. - -@@0. "Hotkey save/load slot" -This is a slot number to use for savestates, when done by a button press outside -menu. This can also be configured to be changed with a button -(see "Key configuration"). - -@@0. "Interface options" -Enters Interface options menu (see below). - -@@0. "Display options" -Enters Display options menu (see below). - -@@0. "Sound options" -Enters Sound options menu (see below). - -@@0. "MD/Genesis/Pico options" -Enters Mega Drive/Genesis/Pico options menu (see below). - -@@0. "Sega/Mega CD add-on" -Enters Sega/Mega CD options menu (see below). - -@@0. "32X add-on" -Enters 32X options menu (see below). - -@@0. "SG/SMS/GG options" -Enters SG-1000/SC-3000/Master System/Game Gear options menu (see below). - -@@0. "Advanced options" -Enters advanced options menu (see below). - -@@0. "Restore defaults" -Restores all options (except controls) to defaults. - - -Interface options ------------------ - -@@1. "Save global options" -If you save your config here it will be loaded on next ROM load, but only if -there is no game specific config saved (which will be loaded in that case). -You can press left/right to switch to a different config profile. - -@@1. "Save game options" -Whenever you load current ROM again these settings will be loaded. - -@@1. "Show FPS" -Self-explanatory. Format is XX/YY, where XX is the number of rendered frames and -YY is the number of emulated frames per second. - -@@1. "Confirm save/load" -Allows to enable confirmation on saving (to prevent savestate overwrites), on -loading (to prevent destroying current game progress), and on both or none, when -using shortcut buttons (not menu) for saving/loading. - -@@1. "Don't save last used ROM" -This will disable writing last used ROM to config on exit (what might cause SD -card corruption according to DaveC). - - -Display options ---------------- -#ifdef GENERIC - -@@2. "Video output mode" -SDL Window: -This is the default mode on portable devices, used if no overlay modes are -available. Window size is fixed at 320x240. -Video Overlay: -Used if hardware accelerated overlay scaling is available. Supports flexible -window sizes. The "2X" version has a higher color resolution but is slower. -#endif - -@@2. "Frameskip" -How many frames to skip rendering before displaying another. -"Auto" is recommended. - -@@2. "Max auto frameskip" -How many frames to skip rendering at most if Frameskip is "Auto". - -#ifdef GENERIC -@@2. "Horizontal scaling" -This allows to resize the displayed image. "OFF" is unscaled, "software" uses -a smoothing filter to scale the image. "hardware" uses a hardware scaler for -better performance. Hardware scaling is not available on every device. - -@@2. "Vertical scaling" -This allows to resize the displayed image. "OFF" is unscaled, "software" uses -a smoothing filter to scale the image. "hardware" uses a hardware scaler for -better performance. Hardware scaling is not available on every device. - -@@2. "Scaler type" -Selects the filtering the software scaler will apply. "nearest" is unfiltered, -"bilinear" makes the image smoother but blurrier. -#endif -#ifdef PANDORA -@@2. "Filter" -Selects filter type used for image filtering. - -Other options allow to set up scaling, filtering and vertical sync. -#endif -#ifdef GP2X -@@2. "Gamma correction" -F100/F200 only: Alters image gamma through GP2X hardware. Larger values make -image to look brighter, lower - darker (default is 1.0). - -@@2. "Horizontal scaling" -This allows to resize the displayed image. "OFF" is unscaled, "software" uses -a smoothing filter to scale the image. F100/F200 only: "hardware" uses a -hardware scaler for better performance. - -@@2. "Vertical scaling" -This allows to resize the displayed image. "OFF" is unscaled, "software" uses -a smoothing filter to scale the image. F100/F200 only: "hardware" uses a -hardware scaler for better performance. - -@@2. "Tearing Fix" -Wiz only: works around the tearing problem by using portrait mode. Causes ~5-10% -performance hit, but eliminates the tearing effect. - -@@2. "Vsync" -This one adjusts the LCD refresh rate to better match game's refresh rate and -starts synchronizing rendering with it. Should make scrolling smoother and -eliminate tearing on F100/F200. -#endif -#ifdef GIZ -@@2. "Scanline mode" -This option was designed to work around slow framebuffer access (the Gizmondo's -main bottleneck) by drawing every other line (even numbered lines only). -This improves performance greatly, but looses detail. - -@@2. "Scale low res mode" -The Genesis/Mega Drive had several graphics modes, some of which were only 256 -pixels wide. This option scales their width to 320 by using simple -pixel averaging scaling. Works only when 16bit renderer is enabled. - -@@2. "Double buffering" -Draws the display to offscreen buffer, and flips it with visible one when done. -Unfortunately this causes serious tearing, unless v-sync is used (next option). - -@@2. "Wait for V-sync" -Waits for vertical sync before drawing (or flipping buffers, if previous option -is enabled). Emulation is stopped while waiting, so this causes large performance -hit. -#endif -#ifdef PSP -@@2. "Horizontal scaling" -This allows to resize the displayed image by using the PSP's hardware. "OFF" is -unscaled, "4:3" is closest to the original Mega Drive screen, "fullscreen" uses -the full screen width. - -@@2. "Vertical scaling" -This allows to resize the displayed image by using the PSP's hardware. "OFF" is -unscaled, "4:3" is closest to the original Mega Drive screen, "fullscreen" uses -the full screen height. - -@@2. "Scaler type" -Selects the filtering the PSP hardware will apply for scaling. "Bilinear" makes -the image smoother but blurrier. - -@@2. "Gamma adjustment" -Color gamma can be adjusted with this. - -@@2. "Black level" -This can be used to reduce unwanted "ghosting" effect for dark games, by making -black pixels brighter. Use together with "gamma adjustment" for more effect. - -@@2. "Wait for v-sync" -If enabled, wait for the screen to finish updating before switching to next -frame, to avoid tearing. -#endif - - -Sound options -------------- - -@@3. "Enable sound" -Does what it says. - -@@3. "Sound Quality" -#ifdef PSP -Sound sample rate. Lower rates improve performance but sound quality is lower. -22050Hz setting is the recommended one. -#else -Sound sample rate and stereo mode. Lower rates improve performance but sound -quality is lower. -#endif - -@@3. "Sound filter" -Enables a low pass filter, similar to filtering in the real Mega Drive hardware. - -@@3. "Filter strength" -Controls the sound filter. Higher values have more impact. - - -Mega Drive/Genesis/Pico options -------------------------------- -#ifndef PANDORA - -@@4. "Renderer" -#ifdef GP2X -8bit fast: -This enables alternative heavily optimized tile-based renderer, which renders -pixels not line-by-line (this is what accurate renderers do), but in 8x8 tiles, -which is much faster. But because of the way it works it can't render any -mid-frame image changes (raster effects), so it is useful only with some games. - -Other two are accurate line-based renderers. The 8bit is faster but does not -run well with some games like Street Racer. -#endif -#ifdef GIZ -This option allows to switch between 16bit and 8bit renderers. The 8bit one is -a bit faster for some games, but not much, because colors still need to be -converted to 16bit, as this is what Gizmondo requires. It also introduces -graphics problems for some games, so it's best to use 16bit one. -#endif -#ifdef PSP -This option allows to switch between fast and accurate renderers. The fast one -is much faster, because it draws the whole frame at a time, instead of doing it -line by line, like the accurate one does. But because of the way it works it -can't render any mid-frame image changes (raster effects), so it is useful only -for some games. -#endif -#endif - -@@4. "FM audio" -This enables emulation of six-channel FM sound synthesizer chip, which was used -to produce sound effects and music. - -@@4. "FM filter" -This filter makes the sound output more accurate, but it is slower, especially -for lower sound rates. - -@@4. "FM DAC noise" -Makes the sound output more like a first model Mega Drive/Genesis if enabled. -Later models had an improved FM chip without the DAC noise. - - -Sega/Mega CD add-on -------------------- - -@@5. "Save RAM cart" -Here you can enable 64K RAM cart. Format it in BIOS if you do. - -@@5. "CD LEDs" -The Sega/Mega CD unit had two blinking LEDs (red and green) on it. This option -will display them on top-left corner of the screen. - -@@5. "CDDA audio" -This option enables CD audio playback. - -@@5. "PCM audio" -This enables 8 channel PCM sound source. It is required for some games to run, -because they monitor state of this audio chip. - - -32X add-on ----------- - -@@6. "32X renderer" -This currently only affects how the Genesis/MD layers are rendered, which is -same as "Renderer" in display options. - -@@6. "PWM audio" -Emulates PWM sound portion of 32X hardware. Disabling this may greatly improve -performance for games that dedicate one of SD2s for sound, but will cause -missing sound effects and instruments. - -@@6. "PWM IRQ optimization" -Enabling this may improve performance, but may also introduce sound glitches. - - -SG/Master System/Game Gear options ----------------------------------- - -@@7. "System" -Selects which of the Sega 8 bit systems is emulated. "auto" is recommended. - -@@7. "Cartridge mapping" -Some cartridges have hardware to enable additional capabilities, e.g. mapping -excess ROM storage or acessing a battery backed RAM storage. "auto" is -recommended, but in some rare cases it may be needed to manually select this. - -@@7. "Game Gear LCD ghosting" -The Game Gear LCD display had a very noticeable inertia for image changes. This -setting enables emulating the effect, with "weak" being recommended. - -@@7. "FM sound unit" -The Japanese Master System (aka Mark III) has an extension slot for an FM sound -unit. Some games made use of this for providing better music and effects. -Disabling this improves performance for games using the FM unit, and usually -means falling back to the non-FM sound. - - -Advanced options ----------------- - -@@8. "Disable frame limiter" -This allows games to run faster then 50/60fps, useful for benchmarking. - -@@8. "Disable sprite limit" -The Mega Drive/Genesis had a limit on how many sprites (usually smaller moving -objects) can be displayed on single line. This option allows to disable that -limit. Note that some games used this to hide unwanted things, so it is not -always good to enable this option. - -@@8. "Disable idle loop patching" -Idle loop patching is used to improve performance, but may cause compatibility -problems in some rare cases. Try disabling this if your game has problems. - -@@8. "Emulate Game Gear LCD" -Disabling this option displays the full Game Gear VDP image with the normally -invisible borders. - -@@8. "Enable dynarecs" -This enables dynamic recompilation for SH2 and SVP CPU code, which is improving -emulation performance greatly. SVP dynarec is only available on 32 bit ARM CPUs. - -@@8. "Master SH2 cycles" / "Slave SH2 cycles" -This allows underclocking the 32X CPUs for better emulation performance. The -number has the same meaning as cycles in DOSBox, which is cycles per millisecond. -Underclocking too much may cause various in-game glitches. -#ifdef GP2X - -@@8. "Use ARM940 core for sound" -F100/F200: This option causes PicoDrive to use ARM940T core (GP2X's second CPU) -for sound (i.e. to generate YM2612 samples) to improve performance noticeably. -It also decodes MP3s in Sega/Mega CD mode. -#endif - - -Key configuration ------------------ - -Select "Configure controls" from the options menu. Then selecting "Player " -will display 2 columns. The left column lists names of Genesis/MD controller -buttons, the right column shows which key on your handheld is assigned to it. - -There is also option to enable 6 button pads (will allow you to configure XYZ -buttons), and an option to set turbo rate (in Hz) for turbo buttons. - -Players 3 and 4 can only be used if a 4 player adapter is selected for input -device 1, and the game is supporting this. Only 3 button pads are currently -supported in 4 player mode. - - -Cheat support -------------- - -To use GG/patch codes, you must type them into your favorite text editor, one -per line. Comments may follow code after a whitespace. Only GameGenie and -Genecyst patch formats are supported. -Examples: - -Genecyst patch (this example is for Sonic): - -00334A:0005 Start with five lives -012D24:0001 Keep invincibility until end of stage -009C76:5478 each ring worth 2 -009C76:5678 each ring worth 3 -... - -Game Genie patch (for Sonic 2): - -ACLA-ATD4 Hidden palace instead of death egg in level select -... - -Both GG and patch codes can be mixed in one file. - -When the file is ready, name it just like your ROM file, but with additional -.pat extension, making sure that case matches. - -Examples: - -ROM: Sonic.zip -PATCH FILE: Sonic.zip.pat - -ROM: Sonic 2.bin -PATCH FILE: Sonic 2.bin.pat - -Put the file into your ROMs directory. Then load the .pat file as you would -a ROM. Then Cheat Menu Option should appear in main menu. - - -What is emulated? ------------------ - -SG-1000/SC-3000/Master System/Game Gear: -z80 @ 3.6MHz: yes, DrZ80 (on 32 bit ARM CPUs) or CZ80 core -VDP: yes, all SG/SMS/GG modes, except some quirks not used by games -YM2413 FM: yes, digital-sound-antiques core -SN76489 PSG: yes, MAME core -Some in-cart mappers are also supported. - -Genesis/Mega Drive: -main 68k @ 7.6MHz: yes, Cyclone (on 32 bit ARM CPUs) or FAME/C core -z80 @ 3.6MHz: yes, DrZ80 (on 32 bit ARM CPUs) or CZ80 core -VDP: yes, except some quirks and mode 4, not used by games -YM2612 FM: yes, optimized MAME core -SN76489 PSG: yes, MAME core -SVP chip: yes! This is first emu to ever do this -Pico PCM: yes, MAME core -Some Mega Drive/Genesis in-cart mappers are also supported. - -Sega/Mega CD: -another 68k @ 12.5MHz: yes, Cyclone or FAME/C too -gfx scaling/rotation chip (custom ASIC): yes -PCM sound source: yes -CD-ROM controller: yes (mostly) -bram (internal backup RAM): yes -RAM cart: yes - -32X: -2x SH2 @ 23MHz: yes, MAME core or custom recompiler -Super VDP: yes -PWM: yes - -Pico: -main 68k @ 7.6MHz: yes, Cyclone (on 32 bit ARM CPUs) or FAME/C core -VDP: yes, except some quirks and mode 4, not used by games -SN76489 PSG: yes, MAME core -ADPCM: yes, MAME core -Pico Pen: yes -Pico Storyware pages: yes -Pico pad overlays: yes - - -Problems / limitations ----------------------- - -#ifdef PSP -* SVP emulation is terribly slow. -#endif -* Various VDP modes and quirks (window bug, scroll size 2, etc.) are not - perfectly emulated, as very few games use this (if any at all). -* The emulator is designed for speed and not 100% accurate, so some things may - not work as expected. -* The FM sound core doesn't support all features and has some accuracy issues. - - -Changelog ---------- - -#include "../ChangeLog" - - -Credits -------- - -This emulator is made of the code from following people/projects: - -#include "../AUTHORS" - - -License -------- - -This program and its code is released under the terms of MAME license: -#include "../COPYING" - -SEGA/Master System/Game Gear/Genesis/Mega Drive/SEGA CD/Mega CD/32X/Pico are -trademarks of Sega Enterprises Ltd. - diff --git a/platform/common/emu.c b/platform/common/emu.c index 051f8b4d..0f837cb4 100644 --- a/platform/common/emu.c +++ b/platform/common/emu.c @@ -856,7 +856,7 @@ char *emu_get_save_fname(int load, int is_sram, int slot, int *time) { strcpy(ext, (PicoIn.AHW & PAHW_MCD) ? ".brm" : ".srm"); romfname_ext(saveFname, sizeof(static_buff), - (PicoIn.AHW & PAHW_MCD) ? "brm"PATH_SEP : "srm"PATH_SEP, ext); + (PicoIn.AHW & PAHW_MCD) ? "ms0:/PSP/SAVEDATA/SUGC/brm"PATH_SEP : "ms0:/PSP/SAVEDATA/SUGC/srm"PATH_SEP, ext); if (!load) return saveFname; @@ -1377,10 +1377,10 @@ void emu_init(void) /* make dirs for saves */ pos = plat_get_root_dir(path, sizeof(path) - 4); - mkdir_path(path, pos, "mds"); - mkdir_path(path, pos, "srm"); - mkdir_path(path, pos, "brm"); - mkdir_path(path, pos, "cfg"); + mkdir_path(path, pos, "ms0:/PSP/SAVEDATA/SUGC/mds"); + mkdir_path(path, pos, "ms0:/PSP/SAVEDATA/SUGC/srm"); + mkdir_path(path, pos, "ms0:/PSP/SAVEDATA/SUGC/brm"); + mkdir_path(path, pos, "ms0:/PSP/SAVEDATA/SUGC/cfg"); pprof_init(); diff --git a/platform/common/menu_pico.c b/platform/common/menu_pico.c index 53e52b87..aff2ad85 100644 --- a/platform/common/menu_pico.c +++ b/platform/common/menu_pico.c @@ -15,6 +15,7 @@ #include "input_pico.h" #include "version.h" + #include "../libpicofe/plat.h" #include @@ -39,7 +40,7 @@ static const char *rom_exts[] = { "pco", "smd", "gen", "md", "iso", "cso", "cue", "chd", "32x", - "sms", "gg", "sg", "sc", + "sms", NULL }; @@ -155,6 +156,7 @@ static void menu_draw_prep(void) { make_bg(0, 0); } + else { int pos; @@ -170,6 +172,32 @@ static void menu_draw_prep(void) } } +static void menu_draw_prep_selector(void) +{ + if (menu_w == g_menuscreen_w && menu_h == g_menuscreen_h) + return; + menu_w = g_menuscreen_w, menu_h = g_menuscreen_h; + + if (PicoGameLoaded) + { + make_bg(0, 0); + } + + else + { + int pos; + char buff[256]; + pos = plat_get_skin_dir(buff, 256); + strcpy(buff + pos, "background_selector.png"); + + // should really only happen once, on startup.. + memset(g_menubg_ptr, 0, g_menuscreen_w * g_menuscreen_h * 2); + if (readpng(g_menubg_ptr, buff, READPNG_BG, + g_menuscreen_w, g_menuscreen_h) < 0) + memset(g_menubg_ptr, 0, g_menuscreen_w * g_menuscreen_h * 2); + } +} + static void draw_savestate_bg(int slot) { const char *fname; @@ -1248,9 +1276,10 @@ static int main_menu_handler(int id, int keys) } break; case MA_MAIN_LOAD_ROM: + menu_w = menu_h = 0; rom_fname_reload = NULL; ret_name = menu_loop_romsel_d(rom_fname_loaded, - sizeof(rom_fname_loaded), rom_exts, NULL, menu_draw_prep); + sizeof(rom_fname_loaded), rom_exts, NULL, menu_draw_prep_selector); if (ret_name != NULL) { lprintf("selected file: %s\n", ret_name); rom_fname_reload = ret_name; @@ -1352,23 +1381,25 @@ static const char h_saveload[] = "Game options are overloading global options"; static menu_entry e_menu_main[] = { - mee_label ("PicoDrive " VERSION), mee_label (""), mee_label (""), - mee_handler_id("Resume game", MA_MAIN_RESUME_GAME, main_menu_handler), - mee_handler_id("Save state", MA_MAIN_SAVE_STATE, main_menu_handler), - mee_handler_id("Load state", MA_MAIN_LOAD_STATE, main_menu_handler), - mee_handler_id("Reset game", MA_MAIN_RESET_GAME, main_menu_handler), + mee_label (""), + mee_label (""), + mee_label (""), + mee_label (""), + mee_label (""), + mee_label (""), + mee_label (""), + mee_handler_id("Resume Game", MA_MAIN_RESUME_GAME, main_menu_handler), + mee_handler_id("Save Game", MA_MAIN_SAVE_STATE, main_menu_handler), + mee_handler_id("Load Game", MA_MAIN_LOAD_STATE, main_menu_handler), + mee_handler_id("Reset Game", MA_MAIN_RESET_GAME, main_menu_handler), mee_handler_id("Change CD", MA_MAIN_CHANGE_CD, main_menu_handler), mee_cust_s_h ("Storyware page", MA_MAIN_PICO_PAGE, 0,mh_picopage, mgn_picopage, NULL), mee_handler_id("Patches / GameGenie",MA_MAIN_PATCHES, main_menu_handler), - mee_handler_id("Load new game", MA_MAIN_LOAD_ROM, main_menu_handler), - mee_handler ("Change options", menu_loop_options), - mee_cust_s_h ("Save global options",MA_OPT_SAVECFG, 0, mh_saveloadcfg, mgn_saveloadcfg, NULL), - mee_cust_s_h ("Save game options", MA_OPT_SAVECFG_GAME, 0, mh_saveloadcfg, mgn_saveloadcfg, h_saveload), - mee_cust_s_h ("Load game options", MA_OPT_LOADCFG, 0, mh_saveloadcfg, mgn_saveloadcfg, h_saveload), - mee_handler_id("Credits", MA_MAIN_CREDITS, main_menu_handler), - mee_handler_id("Exit", MA_MAIN_EXIT, main_menu_handler), + mee_handler_id("Press CIRCLE button to begin", MA_MAIN_LOAD_ROM, main_menu_handler), + mee_cust_s_h ("Save Game Options", MA_OPT_SAVECFG_GAME, 0, mh_saveloadcfg, mgn_saveloadcfg, h_saveload), + mee_cust_s_h ("Load Game Options", MA_OPT_LOADCFG, 0, mh_saveloadcfg, mgn_saveloadcfg, h_saveload), mee_end, }; @@ -1376,6 +1407,8 @@ void menu_loop(void) { static int sel = 0; + + me_enable(e_menu_main, MA_MAIN_RESUME_GAME, PicoGameLoaded); me_enable(e_menu_main, MA_MAIN_SAVE_STATE, PicoGameLoaded); me_enable(e_menu_main, MA_MAIN_LOAD_STATE, PicoGameLoaded); @@ -1388,7 +1421,7 @@ void menu_loop(void) menu_enter(PicoGameLoaded); in_set_config_int(0, IN_CFG_BLOCKING, 1); - me_loop_d(e_menu_main, &sel, menu_draw_prep, menu_main_draw_status); + me_loop_d(e_menu_main, &sel, menu_draw_prep_selector, menu_main_draw_status); if (PicoGameLoaded) { if (engineState == PGS_Menu) diff --git a/platform/common/version.h b/platform/common/version.h index 230f315a..ca33f521 100644 --- a/platform/common/version.h +++ b/platform/common/version.h @@ -1 +1 @@ -#define VERSION "2.00" REVISION +#define VERSION "" \ No newline at end of file diff --git a/platform/libpicofe b/platform/libpicofe index 697806c4..45e44c2a 160000 --- a/platform/libpicofe +++ b/platform/libpicofe @@ -1 +1 @@ -Subproject commit 697806c41dccf0adb0a3a35171f6eff9a9191240 +Subproject commit 45e44c2aab97cb4d505c53048c383afdd7814f88 diff --git a/platform/pandora/skin/background.png b/platform/pandora/skin/background.png index 08a73911..e17ee630 100644 Binary files a/platform/pandora/skin/background.png and b/platform/pandora/skin/background.png differ diff --git a/platform/pandora/skin/background_old.png b/platform/pandora/skin/background_old.png new file mode 100644 index 00000000..08a73911 Binary files /dev/null and b/platform/pandora/skin/background_old.png differ diff --git a/platform/pandora/skin/background_selector.png b/platform/pandora/skin/background_selector.png new file mode 100644 index 00000000..d5d6219f Binary files /dev/null and b/platform/pandora/skin/background_selector.png differ diff --git a/platform/pandora/skin/retro_dreams.mp3 b/platform/pandora/skin/retro_dreams.mp3 new file mode 100644 index 00000000..03eedb96 Binary files /dev/null and b/platform/pandora/skin/retro_dreams.mp3 differ diff --git a/platform/pandora/skin/selector.png b/platform/pandora/skin/selector.png index a4391696..c34e1a22 100644 Binary files a/platform/pandora/skin/selector.png and b/platform/pandora/skin/selector.png differ diff --git a/platform/pandora/skin/selector_old.png b/platform/pandora/skin/selector_old.png new file mode 100644 index 00000000..a4391696 Binary files /dev/null and b/platform/pandora/skin/selector_old.png differ diff --git a/platform/pandora/skin/skin.txt b/platform/pandora/skin/skin.txt index c2baeb22..8e315e45 100644 --- a/platform/pandora/skin/skin.txt +++ b/platform/pandora/skin/skin.txt @@ -1,4 +1,3 @@ // html-style hex color codes, ex. ff0000 is red, 0000ff is blue, etc. text_color=ffffff -selection_color=c00000 diff --git a/platform/ps2/emu.c b/platform/ps2/emu.c index 32c3d6c4..09e13d25 100644 --- a/platform/ps2/emu.c +++ b/platform/ps2/emu.c @@ -87,9 +87,10 @@ static uint8_t vsync; /* 0 (Disabled), 1 (Enabled), 2 (Dynamic) */ #define SOUND_BLOCK_COUNT 7 #define SOUND_BUFFER_CHUNK (2*54000/50) // max.rate/min.frames in stereo +static short sndBuffer_emu[SOUND_BUFFER_CHUNK+4]; // 4 for sample rounding overhang static short __attribute__((aligned(4))) sndBuffer[SOUND_BUFFER_CHUNK*SOUND_BLOCK_COUNT]; static short __attribute__((aligned(4))) nulBuffer[SOUND_BUFFER_CHUNK]; -static short *snd_playptr, *sndBuffer_endptr; +static short *snd_playptr, *sndBuffer_ptr, *sndBuffer_endptr; static int samples_made, samples_done, samples_block; static int sound_thread_exit = 0, sound_stopped = 1; @@ -122,24 +123,78 @@ static void writeSound(int len) if (samples_made - samples_done < samples_block * (SOUND_BLOCK_COUNT-2) - 4) { samples_made += len / 2; - PicoIn.sndOut += len / 2; + sndBuffer_ptr += len / 2; + l = sndBuffer_ptr - sndBuffer; + + if (sndBuffer_ptr > sndBuffer_endptr) + sndBuffer_endptr = sndBuffer_ptr; + if (l > sizeof(sndBuffer)/2) + lprintf("snd ovrn %d %d\n", len, sndBuffer_ptr - sndBuffer); + if (l > samples_block * (SOUND_BLOCK_COUNT-2)) { + sndBuffer_endptr = sndBuffer_ptr; + sndBuffer_ptr = sndBuffer; + } } else lprintf("ovfl %d\n", samples_made - samples_done); - if (sndBuffer_endptr < PicoIn.sndOut) - sndBuffer_endptr = PicoIn.sndOut; - - l = PicoIn.sndOut - sndBuffer; - if (l > sizeof(sndBuffer)/2) - lprintf("ovrn %d %d\n", len, PicoIn.sndOut - sndBuffer); - if (l > samples_block * (SOUND_BLOCK_COUNT-2)) { - sndBuffer_endptr = PicoIn.sndOut; - PicoIn.sndOut = sndBuffer; - } // signal the snd thread SignalSema(sound_sem); } +static void writeSound_44100(int len) +{ + writeSound(len); + PicoIn.sndOut = sndBuffer_ptr; +} + +static void writeSound_22050_stereo(int len) +{ + short *p = sndBuffer_ptr; + int i; + + for (i = 0; i < len / 2; i+=2, p+=4) { + p[0] = p[2] = PicoIn.sndOut[i]; + p[1] = p[3] = PicoIn.sndOut[i+1]; + } + writeSound(2*len); +} + +static void writeSound_22050_mono(int len) +{ + short *p = sndBuffer_ptr; + int i; + + for (i = 0; i < len / 2; i++, p+=2) { + p[0] = p[1] = PicoIn.sndOut[i]; + } + writeSound(2*len); +} + +static void writeSound_11025_stereo(int len) +{ + short *p = sndBuffer_ptr; + int i; + + for (i = 0; i < len / 2; i+=2, p+=8) { + p[0] = p[2] = p[4] = p[6] = PicoIn.sndOut[i]; + p[1] = p[3] = p[5] = p[7] = PicoIn.sndOut[i+1]; + } + writeSound(4*len); +} + +static void writeSound_11025_mono(int len) +{ + short *p = sndBuffer_ptr; + int i; + + for (i = 0; i < len / 2; i++, p+=4) { + p[0] = p[1] = p[2] = p[3] = PicoIn.sndOut[i]; + } + writeSound(4*len); +} + +#define PS2_RATE 44100 // PicoIn.sndRate + static void resetSound() { struct audsrv_fmt_t format; @@ -147,7 +202,7 @@ static void resetSound() int ret; format.bits = 16; - format.freq = PicoIn.sndRate; + format.freq = PS2_RATE; format.channels = stereo ? 2 : 1; ret = audsrv_set_format(&format); if (ret < 0) { @@ -170,14 +225,10 @@ static int sound_thread(void *argp) // if there aren't enough samples, queue silence int queued = audsrv_queued()/2; while (queued < 2*samples_block) { - short *sndOut = PicoIn.sndOut, *sndEnd = sndBuffer_endptr; - // compute sample chunk size - int buflen = sndEnd - snd_playptr; - if (sndOut >= snd_playptr) - buflen = sndOut - snd_playptr; - if (buflen > samples_made - samples_done) - buflen = samples_made - samples_done; + int buflen = samples_made - samples_done; + if (buflen > sndBuffer_endptr - snd_playptr) + buflen = sndBuffer_endptr - snd_playptr; if (buflen > 3*samples_block - queued) buflen = 3*samples_block - queued; @@ -241,7 +292,7 @@ static void sound_init(void) thread.initial_priority = 40; thid = CreateThread(&thread); - samples_block = 22050/50; // needs to be initialized before thread start + samples_block = PS2_RATE/60; // needs to be initialized before thread start if (thid >= 0) { ret = StartThread(thid, NULL); if (ret < 0) lprintf("sound_init: StartThread returned %08x\n", ret); @@ -255,7 +306,7 @@ static void sound_init(void) void pemu_sound_start(void) { static int PsndRate_old = 0, PicoOpt_old = 0, pal_old = 0; static int mp3_init_done; - int ret, stereo; + int ret, stereo, factor; samples_made = samples_done = 0; @@ -279,14 +330,22 @@ void pemu_sound_start(void) { PsndRerate(Pico.m.frame_count ? 1 : 0); } stereo = (PicoIn.opt&8)>>3; - samples_block = (PicoIn.sndRate / (Pico.m.pal ? 50 : 60)) * (stereo ? 2 : 1); + + factor = PS2_RATE / PicoIn.sndRate; + samples_block = (PS2_RATE / (Pico.m.pal ? 50 : 60)) * (stereo ? 2 : 1); lprintf("starting audio: %i, len: %i, stereo: %i, pal: %i, block samples: %i\n", PicoIn.sndRate, Pico.snd.len, stereo, Pico.m.pal, samples_block); resetSound(); - PicoIn.writeSound = writeSound; - snd_playptr = PicoIn.sndOut = sndBuffer_endptr = sndBuffer; + switch (factor) { + case 1: PicoIn.writeSound = stereo ? writeSound_44100 :writeSound_44100 ; break; + case 2: PicoIn.writeSound = stereo ? writeSound_22050_stereo:writeSound_22050_mono; break; + case 4: PicoIn.writeSound = stereo ? writeSound_11025_stereo:writeSound_11025_mono; break; + } + sndBuffer_endptr = sndBuffer; + snd_playptr = sndBuffer_ptr = sndBuffer; + PicoIn.sndOut = (factor == 1 ? sndBuffer_ptr : sndBuffer_emu); PsndRate_old = PicoIn.sndRate; PicoOpt_old = PicoIn.opt; diff --git a/platform/psp/Makefile b/platform/psp/Makefile index 2caf4aed..de6020da 100644 --- a/platform/psp/Makefile +++ b/platform/psp/Makefile @@ -11,7 +11,7 @@ include ../../config.mak #PSPSDK ?= $(shell psp-config --pspsdk-path) #include $(PSPSDK)/lib/build.mak -#PSP_EBOOT_TITLE = PicoDrive +#PSP_EBOOT_TITLE = Sonic\'s UGC #PSP_EBOOT_ICON = data/icon.png #EBOOT.PBP: diff --git a/platform/psp/data/SND0.AT3 b/platform/psp/data/SND0.AT3 new file mode 100644 index 00000000..b3f93da2 Binary files /dev/null and b/platform/psp/data/SND0.AT3 differ diff --git a/platform/psp/data/icon.png b/platform/psp/data/icon.png index 4bb5ac00..67adbed1 100644 Binary files a/platform/psp/data/icon.png and b/platform/psp/data/icon.png differ diff --git a/platform/psp/emu.c b/platform/psp/emu.c index a3e22571..41deba8d 100644 --- a/platform/psp/emu.c +++ b/platform/psp/emu.c @@ -450,7 +450,7 @@ static void writeSound(int len) if (samples_made - samples_done < samples_block * (SOUND_BLOCK_COUNT-2) - 4) { sndBuffer_ptr += len / 2; if (sndBuffer_ptr - sndBuffer > sizeof(sndBuffer)/2) - lprintf("snd ovrn %d %d\n", len, PicoIn.sndOut - sndBuffer); + lprintf("snd ovrn %d %d\n", len, sndBuffer_ptr - sndBuffer); if (sndBuffer_ptr >= sndBuffer_endptr) { int wrap = sndBuffer_ptr - sndBuffer_endptr; if (wrap > 0) diff --git a/platform/psp/menu.c b/platform/psp/menu.c index 99a7d0e2..d8c78bf5 100644 --- a/platform/psp/menu.c +++ b/platform/psp/menu.c @@ -14,12 +14,11 @@ static const char h_8bit[] = "This option only works for 8bit renderers"; mee_onoff ("Wait for vsync", MA_OPT3_VSYNC, currentConfig.EmuOpt, EOPT_VSYNC), \ #define MENU_OPTIONS_ADV - static menu_entry e_menu_sms_options[]; static menu_entry e_menu_keyconfig[]; void psp_menu_init(void) { me_enable(e_menu_sms_options, MA_SMSOPT_GHOSTING, 0); - me_enable(e_menu_keyconfig, MA_CTRL_DEADZONE, 0); + me_enable(e_menu_keyconfig, MA_CTRL_DEADZONE, 0); } diff --git a/platform/psp/plat.c b/platform/psp/plat.c index 53e13616..b02388b5 100644 --- a/platform/psp/plat.c +++ b/platform/psp/plat.c @@ -156,7 +156,7 @@ int plat_get_skin_dir(char *dst, int len) int plat_get_data_dir(char *dst, int len) { if (len > 5) - strcpy(dst, "ms0:/"); + strcpy(dst, "rom/"); else if (len > 0) *dst = 0; return strlen(dst); diff --git a/platform/psp/psp.c b/platform/psp/psp.c index f3ca9b3b..a4d919c0 100644 --- a/platform/psp/psp.c +++ b/platform/psp/psp.c @@ -30,13 +30,13 @@ extern int pico_main(int argc, char *argv[]); #ifndef FW15 -PSP_MODULE_INFO("PicoDrive", 0, 1, 97); +PSP_MODULE_INFO("Sonic's UGC", 0, 1, 97); int main(int argc, char *argv[]) { return pico_main(argc, argv); } /* just a wrapper */ #else -PSP_MODULE_INFO("PicoDrive", 0x1000, 1, 97); +PSP_MODULE_INFO("Sonic's UGC", 0x1000, 1, 97); PSP_MAIN_THREAD_ATTR(0); int main(int argc, char *argv[]) diff --git a/platform/psp/readme.txt b/platform/psp/readme.txt new file mode 100644 index 00000000..91cf0a9a --- /dev/null +++ b/platform/psp/readme.txt @@ -0,0 +1,55 @@ +# Sonic's UGC for PSP + +A fork of PicoDrive for PSP, skinned to look like Sonic's Ultimate Genesis Collection + +### Why? + +In 2019 (when i originally had this idea) i had just gotten a PSP, and in 2016-2020 i had a copy of Sonic's UGC on the Xbox 360, i knew that the PSP was very much powerful enough to run the same library of games, and this was on the back of my head until August of 2024, when i finally gained enough skill to make this into a reality. + +**Fun Fact** - I did make a **terrible** version of this idea in 2019 with my limited brain, which i still have archived today, (i stretched the SUGC logo to fit on the PBP, changed the background which made the game list almost unreadable, and a few other horrible hacks), but, it didn't involve any source code. This time i'm doing it for real, redesigning the UI and open sourcing all of it + +### Downloads + +Soon! + +### To-do List + +| Done | Feature | Progress | +| ------- | --------------------- | -------- | +| ✅ (M2) | Title Screen | 100% | +| ✅ (M2) | Backgrounds | 100% | +| ✅ (M2) | SRAM in SAVEDATA | 100% | +| ✅ (M1) | ISO Support | 100% | +| ✅ (M1) | Game List | 100% | +| ✳️ (M3) | Imagine Float Fontmap | 0% | +| ✳️ (M3) | Background Theme | 35% | +| ❌ (M4) | ROM Selector UI | 0% | +| ❌ (M5) | ROM Boxart UI | 0% | +| ❌ (M6) | Rating System | 0% | +| ❓ (V1) | Customizer Tool | 0% | + +### Q&A + +**Q: Will you make this for the European version of Sonic's UGC (Sega Mega Drive Ultimate Collection // SEGA MDUC)?** +A: Most likely not, the version i grew up with was SUGC and it doesn't hit the same for me, i did take a brief look on and it is largely the same, i'm just not bothered to do it at the moment. + +**Q: Will you make a PS2 Port? It looks really similar to the PSP version!** +A: Never. I haven't owned a PS2 since 2013 (when i was a fucking baby) and don't plan to. + +**Q: How can i add more games?** +A: Download or compile the Memory Stick version, go to or create the "rom" directory and add your games there, the file format doesn't matter + +**Q: How do i compile on Windows?** +A: Not supported. I haven't used Windows as my daily OS since 2021 and have no plans to go back. Modern Windows is terrible and i have no reason to switch back (the biggest hurdle was Camtasia, which i finally stopped using after 6 years). Just use a Linux VM if you can't make the switch + +**Q: Does this work on PS Vita?** +A: Yes, just use Adrenaline and you're good, both the ISO and Memory Stick versions should work with no problem. + +**Q: Does this work on PPSSPP?** +A: Absolutely! I used PPSSPP for testing the dev builds and it works flawlessly, but if you're gonna emulate SEGA Genesis games on an emulator, just use a normal Sega Genesis emulator, this is largely intended for people who own a PSP or PS Vita console. + +**Q: How did you get an uncompressed version of the SUGC Intro and Soundtrack** +A: I ripped them myself from the Xbox 360 version, just extract the files from the ISO and you should be good. ([Intro Video](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SGC2_ATTRACT.wmv) - [Background Theme](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/retro_dreams.xma) - [Background Video](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/MAIN0001.wmv) - [SUGC Logo](https://dl.raythefox.pw/Projects/Sonic%27s%20UGC%20for%20PSP/Assets/SUGC_LOGO.PNG)) + +**Q: How did you figure out this really confusing source code?** +A: I admit that the PicoDrive source code is *almost* unreadable, and i definitely wouldn't recommend it to a beginner, but even if you are total trash at C code like i am, if you know where to look, it's not that hard, 99% of the changes were in the UI and the PSP-specific code, not on the emulator itself, i'm pretty sure it's possible to port this to Windows/Linux/PS2, but i have no desire in doing it myself, i can provide all of the design files, [my DMs are always open](https://raythefox.pw), message me and i'll be glad to help. diff --git a/platform/psp/skin/background.png b/platform/psp/skin/background.png index 735ab647..e17ee630 100644 Binary files a/platform/psp/skin/background.png and b/platform/psp/skin/background.png differ diff --git a/platform/psp/skin/background_old.png b/platform/psp/skin/background_old.png new file mode 100644 index 00000000..735ab647 Binary files /dev/null and b/platform/psp/skin/background_old.png differ diff --git a/platform/psp/skin/background_selector.png b/platform/psp/skin/background_selector.png new file mode 100644 index 00000000..d5d6219f Binary files /dev/null and b/platform/psp/skin/background_selector.png differ diff --git a/platform/psp/skin/font.bmp b/platform/psp/skin/font.bmp new file mode 100644 index 00000000..27b98949 Binary files /dev/null and b/platform/psp/skin/font.bmp differ diff --git a/platform/psp/skin/font.png b/platform/psp/skin/font_old.png similarity index 100% rename from platform/psp/skin/font.png rename to platform/psp/skin/font_old.png diff --git a/platform/psp/skin/retro_dreams.mp3 b/platform/psp/skin/retro_dreams.mp3 new file mode 100644 index 00000000..03eedb96 Binary files /dev/null and b/platform/psp/skin/retro_dreams.mp3 differ diff --git a/platform/psp/skin/selector.png b/platform/psp/skin/selector.png index 5062cc23..c34e1a22 100644 Binary files a/platform/psp/skin/selector.png and b/platform/psp/skin/selector.png differ diff --git a/platform/psp/skin/selector_old.png b/platform/psp/skin/selector_old.png new file mode 100644 index 00000000..5062cc23 Binary files /dev/null and b/platform/psp/skin/selector_old.png differ diff --git a/platform/psp/skin/skin.txt b/platform/psp/skin/skin.txt index c2baeb22..adc4bd7d 100644 --- a/platform/psp/skin/skin.txt +++ b/platform/psp/skin/skin.txt @@ -1,4 +1,2 @@ // html-style hex color codes, ex. ff0000 is red, 0000ff is blue, etc. text_color=ffffff -selection_color=c00000 -