2048 game

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
Post Reply
Phibrizzo
Posts: 83
Joined: 09 Nov 2022, 22:46

2048 game

Post 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 :)
at67
Site Admin
Posts: 652
Joined: 14 May 2018, 08:29

Re: 2048 game

Post 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).
Phibrizzo
Posts: 83
Joined: 09 Nov 2022, 22:46

Re: 2048 game

Post by Phibrizzo »

"CALL vAC" has own opcode? Or it is notation shortening?
at67
Site Admin
Posts: 652
Joined: 14 May 2018, 08:29

Re: 2048 game

Post 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.
Phibrizzo
Posts: 83
Joined: 09 Nov 2022, 22:46

Re: 2048 game

Post by Phibrizzo »

This is great idea. Thanks for this tip. I must implemented to my compiler.
Hans61
Posts: 104
Joined: 29 Dec 2020, 16:15
Location: Saxonia
Contact:

Re: 2048 game

Post by Hans61 »

Thanks for a new game. Very nice. What is the difference between the 32k and 64k version?
Phibrizzo
Posts: 83
Joined: 09 Nov 2022, 22:46

Re: 2048 game

Post 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.
Phibrizzo
Posts: 83
Joined: 09 Nov 2022, 22:46

Re: 2048 game

Post 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
Phibrizzo
Posts: 83
Joined: 09 Nov 2022, 22:46

Re: 2048 game

Post 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
Post Reply