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)

正在搜索数据库…

这是什么?这是 SNES 版 Super Mario All-Stars 的原生 Windows 和 Android 移植版,支持最高 21:9 的真正宽屏、双人合作、82 项成就、CRT 滤镜、即时存档、倒带、作弊功能和音乐播放器。本项目不附带任何游戏数据。
它是模拟器还是原生移植?这是原生移植,它直接运行你自己的卡带 ROM,游戏本身没有被修改。宽屏、滤镜、存档和附加功能都是在此基础上添加的。
如何在 Windows 上运行?使用 Visual Studio 2022(C++ 工作负载)和 CMake 3.20 或更高版本进行构建;可执行文件会生成在 build\\Release\\SuperMarioAllStars.exe。然后把你自己的美版 ROM(Super Mario All-Stars (USA).sfc)放在该 exe 旁边,或放在其旁边的 roms 文件夹中。
除了 ROM,还需要别的东西吗?在 Windows 上不需要额外安装:Direct3D、XAudio2 等接口都已包含在系统中。在 Android 上需要 Android SDK 及 NDK 28.2、CMake 3.31.6、JDK 17 或更高版本,并把 SDL2 源代码放入 thirdparty 目录。
All-Stars 的任何 SNES 转储版本都能用吗?可以,其他版本或转储也能运行,但宽屏、作弊和关卡选择是针对美版调整的。它们的文件名会以琥珀色显示在启动器卡片上。
哪些 Android 设备可以运行?运行 Android 6.0 或更高版本的 64 位 ARM 手机和平板,以及 x86-64 模拟器。窗口设置、VSync、黑帧插入、高帧率和 slang 着色器仅适用于 Windows。
两名玩家可以一起玩吗?可以,支持同时双人合作。每个手柄在其他手柄插拔时都会保留自己的手柄编号,因此玩家之间不会互换手柄。
成就如何运作?本移植版追踪 82 项成就,菜单中会以“已获得/总数”的形式显示,成就解锁时屏幕顶部会出现横幅提示。
倒带有什么作用?按住倒带键,可以以两倍游戏速度回退大约最近一分钟的游戏进程。游戏已保存的进度永远不会被撤销。
音乐播放器是做什么用的?它使用其自身的声音芯片播放游戏音乐,支持命名曲目列表以及重复播放和播放下一首模式,游戏本身不受影响。
作者
Darhkfox
大小
6.7 MB
星标
371
时长
13天
提交 · 90 天