[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81933":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":17,"fork":17,"defaultBranch":18,"hasWiki":19,"hasPages":17,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":15,"lastSyncTime":24,"discoverSource":25},81933,"UEFI_SuperMario","MikeWuPing\u002FUEFI_SuperMario","MikeWuPing","将红白机（NES）《超级马力欧兄弟》（Super Mario Bros）移植到 **UEFI Shell** 环境下运行。图形输出使用 UEFI GOP（Graphics Output Protocol），纯软件渲染，无音频依赖。可在 QEMU + OVMF 或真机 UEFI Shell 下运行。A port of the NES classic \"Super Mario Bros\" to the **UEFI Shell** environment. Uses UEFI GOP for graphics, pure software rendering, no audio. Runs on QEMU + OVMF or bare-metal UEFI systems.",null,"C",26,4,24,0,2,2.1,false,"main",true,[],"2026-06-12 02:04:21","# SMB UEFI — 超级马力欧兄弟 UEFI Shell 移植\n\n将红白机（NES）《超级马力欧兄弟》（Super Mario Bros）移植到 **UEFI Shell** 环境下运行。图形输出使用 UEFI GOP（Graphics Output Protocol），纯软件渲染，无音频依赖。可在 QEMU + OVMF 或真机 UEFI Shell 下运行。\n\u003Cimg width=\"1268\" height=\"825\" alt=\"full1\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F1e26143e-acd9-4914-8f37-9c0c8fc4fd17\" \u002F>\n\n## 项目来源\n\n本项目基于 [nukep\u002Fsmb-vanilla-port](https:\u002F\u002Fgithub.com\u002Fnukep\u002Fsmb-vanilla-port) 的 C\u002FC++ 反编译代码进行移植。原始项目将 NES 6502 汇编反编译为现代 C 代码，保留原始游戏逻辑的精确行为（包括 Bug）。\n\u003Cimg width=\"768\" height=\"716\" alt=\"welcomescreen\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ff9b356f7-b13c-481b-858c-2cec74bc777a\" \u002F>\n\u003Cimg width=\"1258\" height=\"789\" alt=\"into game\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa43035e4-c4b1-466a-8052-b07562792fae\" \u002F>\n\n\n## 改进与原项目的差异\n\n| 特性 | 原始 smb-vanilla-port | 本 UEFI 移植 |\n|------|----------------------|-------------|\n| 运行平台 | SDL2\u002FSDL3 (Windows\u002FLinux) | UEFI Shell (QEMU\u002F真机) |\n| 图形渲染 | OpenGL \u002F 软件光栅化 (SDL surface) | GOP 帧缓冲（双缓冲 + 整数缩放） |\n| 音频 | SDL 音频（完整 APU 模拟） | 无（UEFI 不支持音频回调） |\n| 输入 | SDL 键盘\u002F手柄映射 | UEFI SimpleTextIn（定时器非阻塞轮询） |\n| ROM 加载 | 外部 .nes 文件 | 编译时嵌入 PRG+CHR 二进制（无 iNES 头） |\n| 构建系统 | Meson | MSVC 批处理 \u002F Makefile (clang) |\n| 文件系统 | 操作系统文件 API | 无（ROM 嵌入 EFI 二进制） |\n| 调试 | 标准输出 | 串口 COM1 (QEMU `-serial stdio`) |\n| 版权保护 | 需用户提供 .nes ROM 文件 | PRG\u002FCHR 数据从 .nes 剥离为独立 .bin 文件 |\n\n### 核心改进详情\n\n1. **ROM 数据与代码分离**：从 iNES 格式 ROM 中剥离出 `prg.bin`（32KB 游戏数据表）和 `chr.bin`（8KB 图形 tile），去除有版权的 16 字节 iNES 头。两个纯数据文件编译时嵌入，代码仓库不含任何任天堂版权数据。\n\n2. **UEFI 协议驱动**：基于最小化 UEFI 类型定义（不依赖 EDK2\u002Fgnu-efi SDK），使用 GOP 帧缓冲直接渲染、SimpleTextIn 轮询键盘、定时器事件驱动帧率。\n\n3. **双缓冲渲染**：256×240 像素先绘制到后台缓冲区，帧结束时通过 nearest-neighbor 整数缩放到 GOP 帧缓冲，消除画面撕裂。\n\n4. **关键 Bug 修复**：修复了 `DrawSpriteObject` 中的水平翻转实现——原反编译代码的 tile 数据索引使用了翻转后的坐标（导致像素顺序未真正镜像），现已与 NES PPU 行为一致。\n\n## 构建与运行\n\n### 前置条件\n\n- [QEMU](https:\u002F\u002Fwww.qemu.org\u002F)（已包含 OVMF 固件于 `share\u002Fedk2-x86_64-code.fd`）\n- [Visual Studio 2019\u002F2022](https:\u002F\u002Fvisualstudio.microsoft.com\u002F) 含 C++ 桌面开发工具\n\n### 构建\n\n```bat\ncd uefi\nbuild.bat\n```\n\n产物：`build\u002Fsmb.efi`（同步到 `uefi\u002Fsmb.efi`）\n\n### 运行\n\n```sh\nqemu-system-x86_64 \\\n  -drive if=pflash,format=raw,file=\u002Fpath\u002Fto\u002Fedk2-x86_64-code.fd \\\n  -drive file=fat:rw:uefi,format=raw \\\n  -m 256 -net none -serial stdio -display sdl\n```\n\nUEFI Shell 启动后自动执行 `startup.nsh` 进入游戏。\n\n## 按键映射\n\n| NES 按键 | 键盘 |\n|---------|------|\n| 方向键 | 方向键 |\n| A（跳跃） | 1 或 \u002F |\n| B（加速\u002F火球） | 2 或 . |\n| Start | Enter |\n| Select | Space |\n| 退出 | Esc |\n\n## 项目结构\n\n```\nuefi\u002F\n├── uefi_types.h        # UEFI 类型定义（GOP\u002FFile\u002FInput\u002FBoot Services）\n├── uefi_compat.h\u002F.c    # C 标准库兼容层（memset\u002Fprintf\u002Fsscanf 等）\n├── uefi_render.h\u002F.c    # GOP 软件渲染器（双缓冲 + 整数缩放）\n├── uefi_input.h\u002F.c     # 键盘输入（定时器 + WaitForEvent 非阻塞）\n├── uefi_rom.h\u002F.c       # ROM 数据访问（内存嵌入 + 文件回退）\n├── uefi_debug.h\u002F.c     # 串口调试输出（COM1 0x3F8）\n├── uefi_main.c         # 入口 + 游戏主循环\n├── embedded_rom.c      # prg.bin + chr.bin 编译时嵌入\n├── build.bat           # MSVC 构建脚本\n├── Makefile            # clang 构建规则\n├── startup.nsh         # UEFI Shell 自动启动脚本\n├── prg.bin             # PRG-ROM 数据表（32KB）\n└── chr.bin             # CHR-ROM 图案表（8KB）\n```\n\n## 许可与声明\n\n- 本项目游戏逻辑代码继承自 [nukep\u002Fsmb-vanilla-port](https:\u002F\u002Fgithub.com\u002Fnukep\u002Fsmb-vanilla-port)\n- 本仓库**不包含**任天堂的版权数据（ROM 文件）。构建需要用户自行提供合法的 `smb.nes`，工具链从中提取无版权的纯数据表（PRG\u002FCHR .bin 文件）\n- UEFI 前端代码为原创实现，欢迎自由使用和修改\n\n---\n\n# SMB UEFI — Super Mario Bros for UEFI Shell\n\nA port of the NES classic \"Super Mario Bros\" to the **UEFI Shell** environment. Uses UEFI GOP for graphics, pure software rendering, no audio. Runs on QEMU + OVMF or bare-metal UEFI systems.\n\u003Cimg width=\"1268\" height=\"825\" alt=\"full4\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F61f4d615-11ce-401a-8cf6-3c48e5b7a10d\" \u002F>\n## Origin\n\nBased on the C\u002FC++ decompilation from [nukep\u002Fsmb-vanilla-port](https:\u002F\u002Fgithub.com\u002Fnukep\u002Fsmb-vanilla-port), which reverse-engineered the NES 6502 assembly into modern C code while preserving exact game behavior (bugs included).\n\u003Cimg width=\"768\" height=\"716\" alt=\"welcomescreen\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ff9b356f7-b13c-481b-858c-2cec74bc777a\" \u002F>\n\u003Cimg width=\"1258\" height=\"789\" alt=\"into game\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa43035e4-c4b1-466a-8052-b07562792fae\" \u002F>\n## Key Improvements\n\n- **IP-safe ROM handling**: PRG-ROM and CHR-ROM extracted as bare `.bin` files without the copyrighted iNES header. No Nintendo data in this repository.\n- **UEFI-native**: Zero-dependency UEFI type definitions — no EDK2 or gnu-efi SDK required\n- **Double buffering**: Eliminates screen tearing via back-buffer → GOP framebuffer flush with integer nearest-neighbor scaling\n- **Bug fix**: Corrected horizontal sprite flipping in the rendering pipeline (tile data now indexed by original coordinates, matching NES PPU behavior)\n- **Serial debug**: COM1 port output for QEMU `-serial stdio` debugging\n\n## Build & Run\n\n```bat\ncd uefi\nbuild.bat          # MSVC build → build\u002Fsmb.efi\n```\n\n```sh\nqemu-system-x86_64 -drive if=pflash,format=raw,file=OVMF.fd \\\n  -drive file=fat:rw:uefi,format=raw -m 256 -serial stdio -display sdl\n```\n\n## License\n\nGame logic derived from nukep\u002Fsmb-vanilla-port. UEFI frontend is original. No copyrighted ROM data is included in this repository.\n","该项目将红白机（NES）《超级马力欧兄弟》移植到 UEFI Shell 环境下运行。核心功能包括使用 UEFI GOP 进行图形输出，采用纯软件渲染方式，不依赖音频。项目基于 C 语言开发，通过反编译 NES 6502 汇编代码保留了游戏的原始逻辑。它适用于 QEMU + OVMF 或真实硬件上的 UEFI Shell 环境，适合对嵌入式系统、UEFI 开发或复古游戏感兴趣的开发者和技术爱好者。此外，项目还提供了详细的构建和运行指南，以及按键映射说明，便于用户快速上手。","2026-06-11 04:07:14","CREATED_QUERY"]