Play in your browser
This runs a real NABU PC in the page: the original ROM boots and loads Bouncing Ball over an emulated NABU Internet Adapter, the same way it loads on real hardware. Click the screen to type into the NABU.
How to run
- Open the Internet Adapter or Headless menu on your NABU or in MAME.
- Go to the Demos channel category.
- Select Bouncing Ball and it will load.
About
How the ball is made:
Each frame uses 32 sprites plus a strip of background tiles; “seven sprite tables” in the demo’s text means seven animation frames.
Sprites: the left 64 pixels are 32 sprites of 16×16, in a grid 4 wide and 8 tall. Four across is the TMS9918’s limit of 4 sprites on one line, so sprites can’t be wider than that.
Tiles: the right 48 pixels are background tiles, 6 characters wide down the screen.
The seven tables: these are the 7 rotation frames. Each holds a complete set of the 32 sprite patterns, stored in unused halves of VRAM. To turn the ball, the demo rewrites one VDP register (R6) to switch between sets, instead of copying sprite data.
The tile half: it has its own 7 frames, bitmaps 48 pixels wide by 192 lines in RAM. The demo copies the current one into the tile patterns every other frame, shifted to match the ball’s height, because tiles can’t move up and down like sprites. On the frames in between it draws the credits.
The bounce: the sprites move by changing their Y positions, and the tile half is redrawn at the same height. Both are light green, so the join doesn’t show.