Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Holtek HT1130 CPU core, and preliminary driver for a brick game using it #11872

Merged
merged 37 commits into from Dec 26, 2023

Conversation

mamehaze
Copy link
Contributor

@mamehaze mamehaze commented Dec 23, 2023

new machines marked as NOT WORKING

Brick Game 96 in 1 (E-23 Plus Mark II) [azya52, David Haywood]

@mamehaze
Copy link
Contributor Author

mamehaze commented Dec 24, 2023

there are emulators at https://github.com/ilyakurdyukov/brickgame-4bit and https://github.com/azya52/BrickEmuPy (with decapped ROM)
I haven't used the emulators at all, the implementation here is from scratch

dumping research is at https://habr.com/ru/articles/773040/

disassembler implementation is based on https://pdf.dzsc.com/88889/5606.pdf CPU manual / instruction set reference.

@happppp
Copy link
Member

happppp commented Dec 24, 2023

When the disassembler is functional, it can be added to unidasm too (src/tools/unidasm.cpp).

This is the game? https://image.konsolenkost.de/item/images/1022336/full/Specials-Hand-Held-Super-E23-Plus-Mark-2-Brick-G-a.jpg
You didn't include the actual title "Brick Game" in the title string. E-23 is not the game title, it's the model, right?
something like?: Brick Game: 96 in 1 (E-23 Plus Mark II)

@mamehaze
Copy link
Contributor Author

Yes, that thing, I'll change the title later. There are hundreds of these things (many on different techs)

unfortunately it looks like sound isn't going to be possible unless somebody finds that on the die too, because the manual seems to indicate there are 16 sounds, with 'sound library' and the first 12 can have 32 notes, while the rest can have 64. Sounds to me like there should be another melody ROM area like the later G&W titles.

@happppp
Copy link
Member

happppp commented Dec 24, 2023

Yeah, sound handling isn't documented at low level in the datasheet.
If more HT1130 LCD games (there are plenty) are dumped, hh_ht1130 would be a better driver? So the common code could be shared between the games.

@mamehaze
Copy link
Contributor Author

this is definitely running now (albeit a bit too fast, as I've no idea on frequencies etc.)
https://www.youtube.com/watch?v=FNyPXEhJdyw
@happppp do you think you could take this and do a better internal layout? I suck at such things

@happppp
Copy link
Member

happppp commented Dec 24, 2023

Internal layout? No, this needs an SVG screen.
You could spend a few hours making a .lay file with 7segs and text labels, and a placeholder for the fruit icons. It may be useful for testing but is it worth the effort? Just buy a cheap one and request to someone experienced to scan the LCD?

edit
BrickEmuPy has a nice SVG, but it looks handmade, so you'll get frowns directed at you if you copy it.

@mamehaze
Copy link
Contributor Author

yes, I saw there was an SVG, but as mentioned, I'm not using anything from that emulator (as it seems to be GPLv3) so for now I'll just make the internal stuff more functional, until such a time as a fresh scan is available.

@mamehaze
Copy link
Contributor Author

Anyway I'm done with this until such a time that somebody can do an SVG and hook it up (that is beyond my ability)

It works as a proof of concept that the CPU core is running as it should, and the basic internal layout lets you see the main pit, and control the pieces.

Hopefully there won't be too many issues preventing it from being merged

@mamehaze mamehaze changed the title preliminary Holtek HT1130 disassembler, and skeleton driver for a brick game using it Holtek HT1130 CPU core, and preliminary driver for a brick game using it Dec 24, 2023
src/mame/layout/brke23p2.lay Outdated Show resolved Hide resolved
src/mame/handheld/hh_ht11xx.cpp Outdated Show resolved Hide resolved
src/mame/handheld/hh_ht11xx.cpp Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130d.h Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130d.cpp Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130.cpp Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130.cpp Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130.cpp Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130.cpp Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130.cpp Show resolved Hide resolved
@mamehaze
Copy link
Contributor Author

all feedback addressed I believe

@mamehaze
Copy link
Contributor Author

mamehaze commented Dec 26, 2023

brick.zip
so the BrickEmuPy author gave us permission to use their svg.
as MAME's 'romset' SVGs don't typically include the case image (that is left for external artwork) I've stripped it back down to the above file.

I however can't figured out how to hook it up properly at all
for Game and Watch etc. the output finder is
m_out_x(*this, "%u.%u.%u", 0U, 0U, 0U)
but looking at the Game and Watch SVGs the elements are just named gxxxxx, I don't see anything named/labelled with this x.x.x format in the Game and Watch SVG files, so I'm not sure how the output finder is finding anything to work with, therefore don't know what additional work is needed to link this one to the emulation.

@happppp / @galibert any tips here?

@happppp
Copy link
Member

happppp commented Dec 26, 2023

brick_v2.zip

  • For segment bits that belong together, group them (ctrl G in inkscape). eg. see NEXT and SPEED, and the 16 pixels at the right side, where I already did it.
  • Add segment IDs to the titles (object properties -> title in Inkscape), see the NEXT seg where i filled it with "seg_id_here"

@mamehaze
Copy link
Contributor Author

ahh, I see, I'd missed the 'title' field looking at it before

@mamehaze
Copy link
Contributor Author

brickv4.zip
I started from the original version because your ungrouping seemed to lose some names / groups that were already useful. this is the file I'm using now.

src/devices/cpu/ht1130/ht1130.h Outdated Show resolved Hide resolved
src/devices/cpu/ht1130/ht1130.h Outdated Show resolved Hide resolved
src/mame/handheld/hh_ht11xx.cpp Outdated Show resolved Hide resolved
src/mame/handheld/hh_ht11xx.cpp Outdated Show resolved Hide resolved
src/mame/handheld/hh_ht11xx.cpp Show resolved Hide resolved
@happppp
Copy link
Member

happppp commented Dec 26, 2023

I did some googling, apparently the company is E-Star.
Whether or not Holtek programmed it, is speculation IMO.

@happppp
Copy link
Member

happppp commented Dec 26, 2023

According to the docs, 1 machine cycle (eg. a 1 byte opcode) takes 4 system clock cycles (from OSC pins).
The timer rate can be configured with a mask option (system clock / 2^n), n=0-13 (except 6 for some reason). So, timer rate can be faster or slower than machine cycle rate.

Add a TODO note if you want to do it later.

@mamehaze
Copy link
Contributor Author

given that we don't even know the frequency, or how those options are configured, I'll leave it as a note.

@happppp happppp merged commit 6222175 into mamedev:master Dec 26, 2023
5 checks passed
einstein95 pushed a commit to einstein95/mame that referenced this pull request Mar 2, 2024
… it (mamedev#11872)

new machines marked as NOT WORKING
--------------------------
Brick Game 96 in 1 (E-23 Plus Mark II) [azya52, David Haywood]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants