Page 1 of 1

2048 game

Posted: 22 Jan 2023, 13:47
by Phibrizzo
Hello :)

This is my first game for Gigatron. It is a port 2048 game by Gabriele Cirulli.
Is very simple, you must collect 2048 tile. No score this time.

Image

Arrow key - move the tiles
START - retstart game

Is avaible two version:
http://blabla.ppa.pl/ftp/usr/Phibrizzo/ ... 48_32k.gt1
http://blabla.ppa.pl/ftp/usr/Phibrizzo/ ... 48_64k.gt1

Both tested on DEVROM. Version 64k on ROM v5a too.

If someone want to see sources:
http://blabla.ppa.pl/ftp/usr/Phibrizzo/ ... 048src.lha

All is compiled on my own compiler.

Enjoy :)

Re: 2048 game

Posted: 23 Jan 2023, 03:05
by at67
Looks good and is fun to play! Congrats on creating your own assembler as well!

I had a quick look at the source code and it's neat and tidy. One quick area you can improve on though is on your CALL thunk, instead of using this:

Code: Select all

        LDWI    #32816
        STW     @J
        CALL    @J      ; show tiles
You can shorten it to:

Code: Select all

        LDWI    #32816
        CALL    vAC      ; show tiles, (vAC is the symbol for the 16bit vCPU accumulator).

Re: 2048 game

Posted: 23 Jan 2023, 06:20
by Phibrizzo
"CALL vAC" has own opcode? Or it is notation shortening?

Re: 2048 game

Posted: 23 Jan 2023, 07:31
by at67
vAC is hardcoded to RAM address 0x0018-0x0019, LDWI for example loads a 16bit immediate value and stores it into these RAM addresses. In your assembler just setup a symbol, (e.g. vAC), that represents the RAM addresse 0x18 and then you can use it as I showed above.

CALL can use any zero page RAM address, e.g. CALL 0x18, which conceptually is CALL vAC.

Re: 2048 game

Posted: 23 Jan 2023, 07:58
by Phibrizzo
This is great idea. Thanks for this tip. I must implemented to my compiler.

Re: 2048 game

Posted: 23 Jan 2023, 13:59
by Hans61
Thanks for a new game. Very nice. What is the difference between the 32k and 64k version?

Re: 2048 game

Posted: 23 Jan 2023, 14:38
by Phibrizzo
What is the difference between the 32k and 64k version?
Only allocation for code.
In 32K code is allocated in first 32kB, in 64K above 32kB. I did my first test on emulator with 64kB and it was easer for me.
Data for graphics is allocated in the same palce.

Re: 2048 game

Posted: 29 Sep 2024, 19:22
by Phibrizzo
Hello :)

This is latest version of the 2048 game.
What new:
- rebuild all graphics routinies. Now is faster.
- fix input handler.

This version is based on 32kB sources but this time game running only on 64kB Gigatrons.
2048v2.gt1
(10.36 KiB) Downloaded 85 times
Sources:
http://www.changeit.ppa.pl/ftp/2048v2.lha

Re: 2048 game

Posted: 03 Oct 2024, 15:27
by Phibrizzo
Little update.

I did some optimizations and i found one stupid old bug in shifting routinie.
Now game is more responsible.
2048v2_2.gt1
(10.26 KiB) Downloaded 77 times