展示HN:用于FPGA的Tamagotchi P1
Show HN: Tamagotchi P1 for FPGAs

原始链接: https://github.com/agg23/fpga-tamagotchi

## 掌机核心总结 这个掌机核心由@agg23历时3个月完成,为Analogue Pocket和MiSTer平台忠实地重现了经典的虚拟宠物体验。它基于原始掌机CPU文档以及来自社区(@Mazamars312、Andrew Wilson、Robert Piep)的见解构建,背景由@bmarvo重制,并包含自定义的Pocket图标。 该核心支持存档(在Pocket上称为“回忆”),用于保存进度,包括退出时自动存档。它还提供可调节的加速倍率——最高可达1800倍,可通过肩键或菜单设置进行控制。用户可以使用不同的像素风格自定义LCD显示,甚至可以使用自定义背景。 主要功能包括重置功能、声音控制以及管理加速行为的选项(在事件发生时停止,跳过初始蜂鸣声)。提供详细的文档,包括微代码解释和测试程序。解决屏幕损坏的常见方法是核心重置,通常在未加载正确的ROM时需要。该项目采用MIT(核心代码、Pocket组件)和GPLv3(MiSTer组件)许可,艺术作品采用CC0许可。

## FPGA上的电子宠物:黑客新闻摘要 一位开发者“agg23”分享了他的项目:一个原始1996年电子宠物在FPGA上的门级实现,可在Analogue Pocket和MiSTer平台运行。该核心准确地模拟了玩具,并添加了现代功能,如存档和高达1800倍的加速。 受到Analogue Pocket FPGA开发的启发,该创作者向程序员推荐FPGA作为一种独特且有价值的学习体验。该项目最初使用VHDL,然后过渡到Verilog,因为行业偏好。 讨论强调了FPGA编程的乐趣和挑战,用户分享了经验和资源,例如Amaranth(一个基于Python的HDL生成器)。Analogue Pocket被赞誉为FPGA开发的易于访问的入口,尽管缺乏Pmod支持。开发者还提到与Analogue的合作关系以及对Pocket核心端口的贡献。
相关文章

原文

Promo Image

This core is an original creation by @agg23 over the course of 3 months. It is based strongly on the original documentation for the Tamagotchi CPU (see Documentation Overview), but also takes some learnings from tamatool, and is inspired by @Mazamars312, Andrew Wilson, and Robert Piep, who gave me helpful advice along the way. The amazing backgrounds were recreated from source material by @bmarvo, and the Pocket platform icon was created by me. See Licensing for more information.

Currently supported platforms are the Analogue Pocket and MiSTer.

Installation Instructions

See Platform Installation Instructions for platform-specific instructions on how to install the core. It also contains information on what ROMs you need.

If you've forgotten how to use the Tamagotchi in the nearly 30 years since it's release, check out the official manual.

Known as "Memories" on the Pocket and "savestates" elsewhere this core supports the creation and loading of savestates, and by extension, the core also supports the Pocket Sleep + Wake functionality. Tapping the power button while playing will suspend the game, ready to be resumed when powering the Pocket back on.

On MiSTer, you must remap your controls in order to bind one of the to the Savestate control. Once done, holding that button and D-pad left/right will allow you to choose your savestate slot, and holding that button in addition to start (if they are different) and D-pad up/down will allow you to load and create savestates in that slot.

Tamagotchi will automatically restore where you left off, as a suppliment to the savestate functionality. Quitting the core on Pocket, or opening the OSD on MiSTer, will cause the core to take a savestate (separate from your 4 slots on MiSTer) that will be automatically restored on core launch.

Tamagotchi supports several incremental levels of turbo. These are displayed in the menus and turbo OSD as: 1x, 2x, 4x, 50x, and Max. At the moment, Max represents a 1,800x turbo, with the intention of allowing you to quickly evolve your Tamagotchi, or simulate days passing.

By default, the current turbo speed can be adjusted by using the shoulder buttons; left trigger decreases the turbo, right trigger increases it.

Additionally, there are several settings that configure the turbo behavior, including stopping turbo on the next "event".

This core supports custom backgrounds, and even ships with a Tamagotchi P2 background as an example. See the Installation Instructions and the Image Generation Tools pages for more information.

  • Reset - Use this button to start the Tamagotchi over from scratch. Please note that this will completely remove your existing Tamagotchi unless you have a dedicated savestate for it
  • Disable Sound/Sound - Allows you to enable/disable the sound. For the Pocket's Disable Sound option, enabling the option (filling in the checkbox) will turn off the sound
  • System Speed - Enables direct setting of the turbo speed, separate from the trigger controls. The core can override this set speed depending on your settings, or if you create/load a savestate
  • End Turbo on Event - When enabled, stops turboing (switches to 1x) when an "event" occurs. An event is classified as any sound generated by the core, which only occurs when the Tamagotchi is requesting attention, a jingle for a game is playing, or you've pressed a button
  • Skip Event at Turbo Start - When Tamagotchi requests attention, it plays several beeps in a row. This setting ignores beeps for 5 in-game seconds after starting turbo. This allows you to turbo, hit an event (and stop the turbo), then immediately start the turbo again and not get kicked right back out
  • LCD Type - Customize the look of the LCD pixels that make up the Tamagotchi display
    • Solid Pixels - Every pixel takes the full space; the off LCD pixels are transparent
    • Separate Pixels, No Background - Pixels have a small gap between them; the off LCD pixels are transparent
    • Separate Pixels, With Background - Pixels have a small gap between them; the off LCD pixels are visible and dim the background beneath them

I've tried to be thorough with my design decisions and provide/update various supporting documents through the process. See the /docs folder, or start looking at the overview. There's documentation on the tools I built, how the microcode works, how to run tests, and more.

Issue Solution
I see a corrupted screen, often blank or all pixels on Open the core settings and choose Reset. If you attempted to boot the core without the correct ROM, or you accidentially chose a different file as the ROM, this is expected. Otherwise, please file an issue.

There are a lot of components to this project, and the licensing on them depends on where they came from and potentially how they're used.

Contents License
The main repo, all Tamagotchi core code, all tools and tests, and the documentation (other than the docs owned by Epson) MIT
All Pocket platform code, Pocket core_top.sv, and any Pocket specific components (unless otherwise noted) MIT
All MiMiC/MiSTer platform code, MiSTer core_top.sv, and any MiSTer specific components (unless otherwise noted) GPLv3
All "sprite" activity icons and backgrounds CC0
联系我们 contact @ memedata.com