Page 1 of 1

Brick Game

Posted: Thu Apr 21, 2016 1:55 am
by Sik
To avoid derailing the Gameking thread. There isn't much known about the Brick Game internals though (and that everything is under a blob isn't helping matters), but just in case anybody is curious, especially given how cheap they're to get.

According to this blog (in Portuguese, sorry), the handhelds seems to use a HT1130 as the CPU (or better said, probably something derived from it). This is a 4-bit microcontroller that conveniently includes some LCD and sound functionality. Found the relevant datasheet here:
http://www.datasheetspdf.com/PDF/HT1130/904986/1

What I can gather from it so far:
  • Program ROM is 4 kilobytes (16 pages of 256 bytes each).
  • Last page can be directly accessed as a look-up table.
  • Work RAM is 128 kilonibbles. Stack doesn't go here, mind you.
  • Display memory is 32 kilonibbles (128 bits). Probably Brick Game is using something different to drive its display since the grid alone already needs 200 bits.
  • Has six registers: A, R0, R1, R2, R3, R4 (besides program counter and stack)
  • R1/R0 and R3/R2 can be paired to make a pointer in RAM
  • Operations: ADD, SUB (both with or without carry), INC, DEC, AND, OR, XOR, rotate left and right (with or without carry), also BCD adjust
  • Has a built-in 8-bit timer (which can generate an interrupt)
  • Has sound functionality (16 different sounds, no idea how this works)
Operating with a 4-bit accumulator must be a pain in the ass...

Re: Brick Game

Posted: Thu Apr 21, 2016 7:07 am
by ccovell
It can get the job done, but it is painful. I think lots of digital calculators worked on 4-bit MCUs for many years; imagine programming floating-point (or fixed-point) math in that!

Re: Brick Game

Posted: Thu Apr 21, 2016 7:53 am
by tepples
You can tell a lot of these brick games, such as the Pro 200, were designed specifically for Tetris because of their 10x20-cell dot matrix, which matches the size of the matrix in standard Tetris. But I think a lot of them had to have their flagship game stripped out of later revisions after The Tetris Company started winning customs enforcement cases. The "2 in 1 Super Brickcal" in particular appears to be an exact copy of the Tetris Jr. keychain with its distinctive 8x12-cell matrix.

Calculators use CORDIC to make sine, cosine, logarithm, and exponent work on an architecture without even a multiply instruction. CORDIC was previously discussed in this topic and this topic.

Re: Brick Game

Posted: Thu Apr 21, 2016 8:21 am
by Sik
If they really cared about legal implications then they wouldn't have shaped the handheld to look like a Game Boy in the first place. Just saying. Not to mention that these were originally meant to be sold in China where copyright is barely ever held up anyway. (EDIT: and just to make it clear, Brick Game is an actual brand)

EDIT again: OK looked at the Pro 200 video and yeah that one seems to be derived from Brick Game (even when turned off you can tell them from the LCD display, it's pretty distinctive).
tepples wrote:Calculators use CORDIC to make sine, cosine, logarithm, and exponent work on an architecture without even a multiply instruction. CORDIC was previously discussed in this topic and this topic.
Or if you're the Sinclair Scientific, you just rotate by 0.001 radians until you hit the angle you want.

Re: Brick Game

Posted: Sun Dec 24, 2023 9:28 am
by ICEknight
Bumping with some good news, HT1130 emulation is getting implemented in MAME as we speak: https://github.com/mamedev/mame/pull/11872