summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ariedlmayer@gmail.com>2025-10-24 16:14:48 -0400
committer AJR <ariedlmayer@gmail.com>2025-10-24 16:15:45 -0400
commitf5515727f8b9190df2db2b5c9d80b41df87b69f5 (patch)
tree82b3df7997bba60b4ce3a6655cc7c42a2a91d114
parentdf2dc964a39b5cf81f2e424e950314d289fef6ad (diff)
yuleyuan: Deobfuscate data and move to related driver
-rw-r--r--src/mame/handheld/evolution_handheld.cpp17
-rw-r--r--src/mame/handheld/yuleyuan.cpp75
-rw-r--r--src/mame/mame.lst4
3 files changed, 18 insertions, 78 deletions
diff --git a/src/mame/handheld/evolution_handheld.cpp b/src/mame/handheld/evolution_handheld.cpp
index a3ea1f43ecc..47c51235c1f 100644
--- a/src/mame/handheld/evolution_handheld.cpp
+++ b/src/mame/handheld/evolution_handheld.cpp
@@ -23,6 +23,8 @@ public:
void evolhh(machine_config &config);
+ void init_yuleyuan();
+
private:
virtual void machine_start() override ATTR_COLD;
virtual void machine_reset() override ATTR_COLD;
@@ -100,6 +102,18 @@ ROM_START( pokexyqz )
// also has an SD card slot (was empty)
ROM_END
+ROM_START( yuleyuan )
+ ROM_REGION( 0x1000000, "maincpu", 0 )
+ ROM_LOAD( "25l128.bin", 0x0000000, 0x1000000, CRC(51ab49e2) SHA1(ecad532d27efea55031ffd31ac4479c9c4eceae6) )
+ROM_END
+
+void evolution_handheldgame_state::init_yuleyuan()
+{
+ u16 *spi = &memregion("maincpu")->as_u16();
+ for (u32 offset = 0; offset < 0x1000000 / 2; offset++)
+ spi[offset] ^= 0x4890;
+}
+
} // anonymous namespace
@@ -111,3 +125,6 @@ CONS( 2018, smkatsum, 0, 0, evolhh, evolhh, evolution_handheldgame
CONS( 2020, buttdtct, 0, 0, evolhh, evolhh, evolution_handheldgame_state, empty_init, "Tomy", "Oshiri Tantei - Puputto Kaiketsu Game (Japan)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // from a pink 'for girls' unit, exists in other colours, software likely the same
CONS( 2015, pokexyqz, 0, 0, evolhh, evolhh, evolution_handheldgame_state, empty_init, "Takara Tomy", "Pokemon Encyclopedia Z Pokemon XY Quiz Game Rotom (Japan)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING )
+
+// 星座电子宠物机 (virtual pet by 育乐元)
+CONS( 2022, yuleyuan, 0, 0, evolhh, evolhh, evolution_handheldgame_state, init_yuleyuan, "Yule Yuan", "Xingzuo Dianzi Chongwu Ji", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // dumped from yellow model
diff --git a/src/mame/handheld/yuleyuan.cpp b/src/mame/handheld/yuleyuan.cpp
deleted file mode 100644
index bacc72e57ba..00000000000
--- a/src/mame/handheld/yuleyuan.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// license:BSD-3-Clause
-// copyright-holders:
-
-// Driver for virtual pets by Yule Yuan (育乐元)
-
-// TODO: code is scrambled/encrypted, put this where it belongs after descrambling
-// (probably a GeneralPlus)
-
-#include "emu.h"
-
-#include "screen.h"
-#include "speaker.h"
-
-
-namespace {
-
-class yuleyuan_state : public driver_device
-{
-public:
- yuleyuan_state(const machine_config &mconfig, device_type type, const char *tag) :
- driver_device(mconfig, type, tag),
- m_screen(*this, "screen")
- {
- }
-
- void yuleyuan(machine_config &config) ATTR_COLD;
-
-protected:
- virtual void machine_start() override ATTR_COLD;
-
-private:
- u32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
-
- required_device<screen_device> m_screen;
-};
-
-u32 yuleyuan_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
-{
- return 0;
-}
-
-void yuleyuan_state::machine_start()
-{
-}
-
-
-static INPUT_PORTS_START(yuleyuan)
-INPUT_PORTS_END
-
-
-void yuleyuan_state::yuleyuan(machine_config &config)
-{
- // unknown CPU (encrypted)
-
- // wrong, just so it's clear this has a screen
- SCREEN(config, m_screen, SCREEN_TYPE_LCD);
- m_screen->set_refresh_hz(60);
- m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0));
- m_screen->set_size(160, 128);
- m_screen->set_visarea(0, 160 - 1, 0, 128 - 1);
- m_screen->set_screen_update(FUNC(yuleyuan_state::screen_update));
-
- SPEAKER(config, "speaker").front_center();
-}
-
-
-ROM_START( yuleyuan )
- ROM_REGION( 0x1000000, "spi", 0 )
- ROM_LOAD( "25l128.bin", 0x0000000, 0x1000000, CRC(51ab49e2) SHA1(ecad532d27efea55031ffd31ac4479c9c4eceae6) )
-ROM_END
-
-} // anonymous namespace
-
-// 星座电子宠物机
-GAME( 2022, yuleyuan, 0, yuleyuan, yuleyuan, yuleyuan_state, empty_init, ROT0, "Yule Yuan", "Xingzuo Dianzi Chongwu Ji", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // dumped from yellow model
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 261aff1969c..f5cb29dff01 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -19473,6 +19473,7 @@ buttdtct
evolhh
pokexyqz
smkatsum
+yuleyuan
@source:handheld/gameking.cpp
gamekin3
@@ -20013,9 +20014,6 @@ vegaplus
@source:handheld/wildfire.cpp
wildfire
-@source:handheld/yuleyuan.cpp
-yuleyuan
-
@source:hds/hds200.cpp
hds200