TETRIS

Use this forum to share and discuss Uzebox games and demos.
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: TETRIS

Post by Kilo »

Thx...
Yes..well that could be a project in the future.
Making some new graphic. So you could emulate many tetris versions which were released in the past.
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
nicksen782
Posts: 714
Joined: Wed Feb 01, 2012 8:23 pm
Location: Detroit, United States
Contact:

Re: TETRIS

Post by nicksen782 »

Neat! An update to MegaTris but 1 player.

Mode 1 has 6x8 and 8x8 tiles available. You could go 8x8. In graphics editors, such as GIMP you can put an 8x8 grid.

What changes to MegaTris are you planning? If you take advantage of SPI RAM you could store many title screens and graphics. I don't know how you would do that without ram tiles but I'm sure there must be a way. You can also get the tile data from the SD card.
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: TETRIS

Post by Kilo »

Mh... don't know if it is really necessary to have different tiles stored on the SD or different titles. 🤔
What I don't like are Tetris versions which are different to the original one and contain features like exploding tiles, aliens who put more tiles on the screen and so on. 🤣

What I really wanna do is to make a clone of the Gameboy Tetris. Same graphics, same gameplay but in color instead of monochrom.
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: TETRIS

Post by Jubatian »

I second that, I think Tetris just needs to stay within the ROM, it should be a nice compact game which really shouldn't need SPI RAM. What it may use is a 16 color mode without sprites, just so more graphics assets fit in the same space, although currently there is no really good mode for this as we were concentrated a lot more on either high-res or modes supporting sprites. If you think you would benefit from a simple no sprites, no scrolling 16 color mode (possibly with 2 bytes / tile VRAM like Mode 0) and you don't want to meddle with assembler, just ask me.
User avatar
Kilo
Posts: 330
Joined: Wed Dec 19, 2012 3:43 pm
Location: AC, Germany

Re: TETRIS

Post by Kilo »

I love Assembler!
If I don't have to use it! 😂

I think a Gameboy version would be cool in order to get the retro feeling back. Then we would have 3 Tetris versions. Megatris, Tetris with Megatris graphics and a retro Tetris.
The last digit of Pi is 7! I calculated this, as I counted to infinity yesterday!
User avatar
Jubatian
Posts: 1564
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: TETRIS

Post by Jubatian »

I did a quick feasibility study on a 16 color Mode 1 with 6 pixels wide tiles (as used in Megatris). It is possible. The scanline core is a sequential code stream as follows:

Code: Select all

	; Warmup

	pop   ZL
	pop   ZH
	add   ZL,      r24     ; Row adjustment, low (0, 3, 6, 9, 12, 15, 18, 21)
	adc   ZH,      r25     ; Row adjustment, high (0)
	lpm   YL,      Z+

	; Scanline

	lpm   XL,      Z+
	ld    r0,      Y
	out   PIXOUT,  r0      ; Px. 0
	swap  YL
	ld    r1,      Y
	ld    r0,      X
	out   PIXOUT,  r1      ; Px. 1
	lpm   YL,      Z+
	ld    r1,      Y
	out   PIXOUT,  r0      ; Px. 2
	swap  XL
	ld    r0,      X
	pop   ZL
	out   PIXOUT,  r1      ; Px. 3
	swap  YL
	ld    r1,      Y
	pop   ZH
	out   PIXOUT,  r0      ; Px. 4
	add   ZL,      r24     ; Row adjustment, low (0, 3, 6, 9, 12, 15, 18, 21)
	adc   ZH,      r25     ; Row adjustment, high (0)
	lpm   YL,      Z+
	out   PIXOUT,  r1      ; Px. 5

	lpm   XL,      Z+
	ld    r0,      Y
	out   PIXOUT,  r0      ; Px. 0

	(...)

	out   PIXOUT,  r1      ; Px. 3
	swap  YL
	ld    r1,      Y
	rjmp  .
	out   PIXOUT,  r0      ; Px. 4
	rjmp  .
	lpm   ZL,      Z
	out   PIXOUT,  r1      ; Px. 5
	rjmp  .
	rjmp  .
	ldi   ZL,      0
	out   PIXOUT,  ZL      ; Zero, end of display line
This takes at around 1800 bytes. Not much. If you have only one full 6x8 tileset and assumed the Mode 1 scanline code taking up no space, you would win more than 4K of ROM already with this. If you needed title screens etc., then of course it only gets better.

For RAM it has to be noted that this requires a 256 byte palette bank, which requirement is not present with Mode 1 (so you have less RAM for the game). Hopefully this is not such a big deal for Tetris. Also like with most of the modes I designed, I can add an optional Color 0 replacement for every scanline (needing 224 bytes RAM for full height), so you could create rasterbar-like backdrops (FoaD sky or the sky in the Lisunov Li-2 demo), which is characteristic to paletted modes, and may look neat for Tetris too.
Post Reply