SuperMarioAllStars README

README проекта с github.com/Darhkfox/SuperMarioAllStars. Одним файлом markdown: README.md.

Super Mario All-Stars — PC Port

A native Windows and Android version of Super Mario All-Stars (SNES) with a launcher, true widescreen, re-anchored HUDs, display options, cheats, level select, achievements, a sound test and a music player. It contains no game data: it runs from your own ROM (Super Mario All-Stars (USA).sfc, CRC32 925637C7); no game starts without it.

Building

Requirements: Windows 10/11, Visual Studio 2022 (C++ workload) and CMake 3.20+. No other libraries are needed (Direct3D 11, Direct2D, XAudio2, XInput and DirectInput come with Windows).

build.bat

The program is written to build\Release\SuperMarioAllStars.exe.

Android

The same code builds for Android (android/), as the Mickey & Donald Collection's does: SDL2 2.32.10 compiled from source for the window, sound and controllers, OpenGL ES 3.0 for the picture. You need the Android SDK with NDK 28.2 and CMake 3.31.6 (both from the SDK manager) and JDK 17 or later. The SDL2 source belongs in third_party/SDL2-2.32.10-src (android/fetch_sdl.ps1 downloads and checks it), then:

cd android
gradlew assembleDebug

The APK ends up in android/app/build/outputs/apk/debug/ (64-bit ARM phones and tablets, Android 6.0 or later, and the x86_64 emulator). Release builds are signed when android/keystore.properties names a keystore (storeFile, storePassword, keyAlias, keyPassword), as the Disney collection's are.

Running

Put the ROM next to the executable, in a roms folder beside it, or in any parent folder up to three levels up; the location is remembered in rompath.txt. Without it the launcher's cards say ROM not found and what is needed, and a ROM copied in while the launcher is open is picked up within a second. Another version or dump of All-Stars runs too, its file name shown in amber on the cards: widescreen, cheats and the level select are tuned for the USA version.

To start a game directly, give SuperMarioAllStars.exe the argument --game smb1, --game smbll, --game smb2 or --game smb3 (for example in a shortcut).

Battery saves go to saves\smas.srm, save states to saves\, screenshots to screenshots\, settings to smas_port.ini. Files are written in full before they replace the old ones, so a full disk can't leave a truncated save (you are told the save failed instead). Save states carry a checksum: a damaged one is refused rather than loaded. They also keep the widescreen state, so a state loads exactly as it was saved, and one saved at a narrower width (or by an older version) brings in the enemies of the wider view. If the graphics driver resets (a driver update or crash), the picture comes back by itself and the game keeps running.

On Android

Install the APK (Android asks you to allow installing apps from the place you opened it). On the first start the launcher's card says ROM not found: tap it, pick Super Mario All-Stars (USA).sfc (or a .smc) in the file picker, and it is copied into the app. A ROM can also be put in the app's folder Android/data/com.darhkfox.allstars/files (or a roms folder there) with a computer.

Launcher

The program opens on a launcher, laid out like the Mickey & Donald Collection's, over a night-blue sky with twinkling stars and a checkerboard floor after the All-Stars title screen. By default it shows one Super Mario All-Stars card with a live preview of the cartridge's title: choosing it starts the cartridge as it is, at its own title and game select (--game allstars starts it directly). Below are buttons for Options, Achievements, Music Player, Credits and Quit.

Options → Launcher Shows → The Four Games gives one card per game instead (Super Mario Bros., The Lost Levels, Super Mario Bros. 2, Super Mario Bros. 3), each with a live attract-mode preview of that game and the chosen card's sound playing. Each preview is its own console run through the All-Stars game select into the game's title, out of sight while it starts. Choosing a card resets the console and takes it through the All-Stars menu to that game's save files (behind a short black loading screen), where you pick the file as usual. The launcher remembers the last game chosen.

Options → Game Covers shows the player's own cover pictures on the cards instead of the live previews, and Custom Background their own picture behind the launcher (filling the window, darkened a little so the text reads). None are shipped. PNG or JPG files named smb1, lostlevels, smb2, smb3, allstars (the single card) and background go in the covers folder (Open Covers Folder: next to the exe on Windows, in ~/.local/share/SuperMarioAllStars on Linux); on Android Choose Cover / Choose Background copy a picture from the phone in. They're read with stb_image (third_party/stb, public domain / MIT), big ones shrunk to 1024 px (2048 for the background). A card without a cover keeps its preview; one with a cover runs no preview console at all, which also makes the launcher lighter on slow devices.

Controls

Keyboard Joypad (Xbox layout; PlayStation, Switch Pro and USB/SNES pads supported)
D-pad Arrow keys D-pad / left stick
B / A / Y / X Z / X / A / S bottom / right / left / top face buttons
L / R Q / W LB / RB
Start Enter Menu/Start
Menu Esc or Right Shift (Select) View/Select
Game's Select button Menu → Press Select In Game left stick press
Save / load state F5 / F8
Fast forward Tab (hold) RT (hold)
Rewind Backspace (hold) LT (hold)
Fullscreen F11 or Alt+Enter
Launcher: choose / play / quit Arrow keys / Enter / Esc D-pad / A / B
Screenshot F12

Hold Rewind to go back through roughly the last minute of play (at twice the game's speed), then let go to carry on from there; game progress the game has saved is never undone. Rewind and fast forward can each be switched off under Menu → Controls.

Everything can be rebound under Menu → Controls (keyboard and pad, both players). Each controller keeps its pad number while others are plugged in or out, and gets it back when it reconnects, so the players never swap controllers. Select opens the menu and backs out of it. The games only need their own Select button for the All-Stars save menu (pause, then Select). If you'd rather have it on Select, set Controls → Select Button to "Tap: Game Select - Hold: Menu". In the menus and the launcher the pad's bottom face button confirms and the right one goes back; Controls → Menu Buttons → Right Confirms swaps them (Nintendo's layout).

Menu

The pause menu is a dark panel over the dimmed game, tinted in the running game's colour (red SMB1, green Lost Levels, purple SMB2, orange SMB3; the launcher's buttons gold). Every row explains itself in the line at the bottom. It is laid out as:

Short notices (state saved, screenshot taken) appear in the top-right corner, or at the bottom while the menu is open. An unlocked achievement shows a banner at the top of the screen.

What each page holds:

Custom soundtracks (MSU-1)

The port plays MSU-1 music packs, the CD-quality soundtracks made for flash carts and emulators. None are included. Put each pack in its own folder in the msu folder (Windows: next to the exe; Steam Deck: ~/.local/share/SuperMarioAllStars/msu; Android: Android/data/com.darhkfox.allstars/files/msu), with its MSU-1 patch (.bps or .ips, for the USA ROM without a copier header) and its tracks (NAME-1.pcm, NAME-2.pcm, ...), then choose it under Options > Audio > Music Pack. A pack without a patch can use one put in the msu folder itself.

The patch is applied to the console's copy of the ROM as it loads (the file is never changed; the launcher's previews run it unpatched), and src/core/msu1.cpp emulates the chip: its registers at $2000-$2007, the tracks streamed from disk and resampled from 44.1 kHz into the console's 32 kHz sound. The track and its place are kept in save states. Both the standard patch (each song replaced) and the Super Mario All-Stars Deluxe patch (one of several versions of the music picked at each new level) work as they do on hardware.

Achievements

82 achievements: 20 for Super Mario Bros., 19 for The Lost Levels, 20 for SMB2, 21 for SMB3, and two for the whole collection. Menu → Achievements lists them by game with the date each was earned. Achievements with several steps show progress, for example "3 / 8" castles; the "defeat 100 enemies" ones count across all your play. A few are secrets: they are marked "Secret:" in their description. They are saved in achievements.ini next to the settings, and they stay earned.

Fair play. While achievements are on, cheats, level select, fast forward and rewind are off. Options → Achievements switches them off, and those features come back. A run counts from a game started from the launcher, or from Reset Game, with achievements on. A save state remembers whether its run counts, so loading one from a cheated run doesn't earn anything. The first start explains this once.

Game Achievements
Super Mario Bros. Wrong Castle (World 1 castle), Castle Crasher (every castle, 0/8), Thank You Mario! (8-4), The Long Way Round (finish from 1-1 without a warp zone), Shortcut (a warp zone), Top of the Pole (5000 at the flagpole), Fireworks Show, Coin Heaven (a vine up to a hidden area), Pocket Change (100 coins), Not a Scratch (a castle without getting hurt), Star Power (5 enemies with one Starman), Lives to Spare (20 lives), Player Two (finish a level as Luigi), Six Figures (100,000 points), Fired Up (a Fire Flower), Express to World 8 (warp straight there), Bro Down (a Hammer Bro), Barbecue Bowser (Bowser by fireballs), Goomba Stomper (100 enemies, counted over all your play), and a secret: Speedy Plumber (finish 1-1 with 300 or more on the clock)
The Lost Levels Same Old Story, Lost No More (castles of worlds 1-8, 0/8), Peach Found, Secret World 9, The Very End (World D castle), Warp Ahead, Lofty Leap, Celebration, Cloud Nine, Coin Purse, Lost but Unharmed, Shooting Star, Hot Stuff (a Fire Flower), Brother Beater (a Hammer Bro), Green Machine (a castle in the LUIGI GAME), Bowser Flambé (Bowser by fireballs), Lost Legion (100 enemies), and two secrets: Wrong Way! (get sent back by a warp zone), No Time to Lose (finish 1-1 with 300 or more on the clock)
Super Mario Bros. 2 One for each boss: Bomb Squad (Mouser), Snake Charmer (Tryclyde), Cat and Mouser, Cool Customer (Fryguy), Rock Lobster (Clawgrip), Heads Will Roll and Wake Up! (Wart). Also Dream Team (clear a level with each hero, 0/4), Untouchable (a level without getting hurt), Jackpot (a life from the Bonus Chance), Full of Heart (four hearts), Mushroom Hunter, Starman, Down the Jar (a warp), POW! (three enemies at once), Extra Lives (10 lives), Through the Door (Subspace), Phanto Menace (wake a Phanto), Egg Return (defeat Birdo), Veggie Tales (100 enemies)
Super Mario Bros. 3 Royal Rescue (a king's wand), All the King's Wands (0/7), Dark Land (World 8), The End of Bowser, Warp Whistle, Frog Prince, Tanooki Time, Hammer Time, Wings of Wonder (P-Wing), Full House (three matching cards), Coin Hoard (100 coins), Packed Inventory (28 items), Toad's Treasure, Seven Figures (1,000,000 points in one game; a game over resets the score, saves keep it), Lives Galore (99 lives), Stone Cold (a Tanooki statue), If the Shoe Fits (Kuribo's Shoe), Lullaby (a Music Box on the map), Rock Breaker (a Hammer on a map rock), Koopa Krusher (100 enemies), and a secret: Five-Up (three Star cards at the goal)
Collection All-Star (finish all four games, 0/4), Completionist (every other achievement)

In SMB1 co-op, Player Two counts when Luigi takes the axe or rides the flagpole down (as the game's player, or kept aside and already on the pole as the flag scene starts), and Not a Scratch is lost when either player is hurt.

Export to CSV (top of the Achievements list) writes an achievements export folder: achievements.csv in the columns PlayniteAchievements' spreadsheet import reads (ID, Title, Description, Points, Trophy Type, Hidden, Rarity, Category, Progress, Progress Total, Unlocked, Unlock Time, Unlocked Icon, Locked Icon) and icons/ with each achievement's badge, earned and locked, drawn by the port (src/app/achexport.cpp: a colour per game, a rim per trophy tier, a symbol per achievement). Points follow the tier: bronze 10, silver 25, gold 50, platinum 100.

Frame pacing

The games run at 60.1 frames per second. With VSync on, the frame loop waits on the display's vertical blank itself, so driver settings that force VSync off or use "Fast Sync" don't cause uneven frames. On 60, 120 or 240 Hz displays every frame lasts the same number of refreshes. With VSync off, frames are presented at the game's own rate, which is what G-SYNC / FreeSync displays want.

How widescreen works

The port emulates the SNES hardware and renders each scanline wider than the original 256 pixels. Per-game logic (in src/game/) makes the extra area show real content:

Per game:

Development tools

build\Release\smastool.exe is a headless runner/debugger used to reverse-engineer the games (see tools/SMASTOOL.md); findings are documented in docs/re/.

Source layout

Folder What
src/core/ The SNES: 65C816, SPC700 and DSP, PPU (with the widescreen and high frame rate parts)
src/game/ The four games' widescreen, achievements, cheats, level select and co-op
src/app/ The application, the same on both systems: app.cpp (launcher, game, menu pages, achievements), menus (menu.cpp), launcher, music player, settings, drawn on canvas.h; sys.h for files and paths. Windows: app_win.cpp (window, frame pacing, test modes), video.cpp (Direct3D 11), canvas_d2d.cpp (Direct2D / DirectWrite), audio.cpp (XAudio2), input.cpp (XInput / DirectInput)
src/platform/android/ Android: app_android.cpp (SDL window, events, pacing, ROM picker), video_gles.cpp (OpenGL ES picture and canvas, text from Android's own font), audio_sdl.cpp, input_sdl.cpp, touch.cpp
android/ Gradle project; SmasActivity.java adds the ROM picker and the UI font rasteriser to SDL's activity

The Android build uses SDL2 by Sam Lantinga and contributors (zlib licence, third_party/SDL2-2.32.10-src). The launcher's title is set in Luckiest Guy by Astigmatic (Apache 2.0 licence, third_party/fonts), copied beside the exe and into the Android app.

SuperMarioAllStars (Darhkfox/SuperMarioAllStars)

Ищем в базе…

Что это такое?Нативный порт Super Mario All-Stars для SNES под Windows и Android с настоящим широкоэкранным режимом до 21:9, совместной игрой на двоих, 82 достижениями, CRT-фильтрами, сохранениями состояния, перемоткой назад, читами и музыкальным плеером. Игровых данных в комплект не входит.
Это эмулятор или нативный порт?Это нативный порт: он запускает ваш собственный картридж-ROM без изменений, поэтому сама игра не модифицируется. Широкий экран, фильтры, сохранения и дополнительные функции добавлены поверх неё.
Как запустить на Windows?Соберите проект в Visual Studio 2022 (набор компонентов C++) и CMake 3.20 или новее; exe-файл появится в build\\Release\\SuperMarioAllStars.exe. Затем положите свой американский ROM (Super Mario All-Stars (USA).sfc) рядом с exe или в папку roms рядом с ним.
Нужно ли что-то, кроме ROM?В Windows ничего дополнительно не нужно: Direct3D, XAudio2 и остальные API входят в систему. Для Android понадобятся Android SDK с NDK 28.2, CMake 3.31.6, JDK 17 или новее и исходники SDL2, размещённые в папке thirdparty.
Работает ли с любым SNES-дампом All-Stars?Да, другие версии и дампы тоже запускаются, но широкий экран, читы и выбор уровня настроены под американскую версию. Имена их файлов отображаются янтарным цветом на карточках лаунчера.
Какие Android-устройства могут запустить игру?64-битные ARM-телефоны и планшеты на Android 6.0 или новее, а также эмулятор x86-64. Настройки окна, VSync, Black Frame Insertion, High Frame Rate и шейдеры slang доступны только в Windows.
Могут ли играть вдвоём?Да, поддерживается одновременная игра вдвоём. Каждый контроллер сохраняет свой номер геймпада, пока другие подключаются или отключаются, поэтому игроки никогда не меняются контроллерами.
Как работают достижения?Порт отслеживает 82 достижения; в меню показывается, сколько получено из общего количества, а при разблокировке вверху экрана появляется баннер.
Что делает перемотка назад?Удерживайте кнопку Rewind, чтобы вернуться примерно на последнюю минуту игры со скоростью вдвое выше обычной. Прогресс, который игра сохранила, никогда не отменяется.
Для чего нужен Music Player?Он воспроизводит музыку игр собственным звуковым чипом, с именованными списками треков и режимами повтора или следующего трека, не затрагивая саму игру.
Какие есть похожие проекты?pokemon-fulldex, boxshelf-beta, dolphin, widemelon, LanternEngine, KytyPS5, LostOdysseyRecomp, Eglantine
Автор
Darhkfox
Размер
6.7 MB
Звёзды
371
Возраст
13 д
Коммиты · 90 дней