Next 1K hires game, BREAKOUT

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Next 1K hires game, BREAKOUT

Post by dr beep » Fri Sep 01, 2017 8:40 pm

I moved the ballscreen to the end of memory.
I had to "erase" the examplescreen for it, but the program will rebuilt screens soon.
The bat is set to a reasonable size.
The bricks are defined up to 6 layers, so 6 levels to play.
The stack is located directly before the ballscreen and is defined in 34 bytes.

This leaves a block of codeable space for the actual game of : 500 bytes.
In this space is NOT added: 30 bytes of codeable sysvar.

So of to go coding.....

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Next 1K hires game, BREAKOUT

Post by dr beep » Sun Sep 03, 2017 6:58 pm

Still 68 bytes left.

To do:
score after brickhit
end of level
end of game
hiscore test

fingers crossed

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Next 1K hires game, BREAKOUT

Post by dr beep » Sun Sep 03, 2017 9:02 pm

Getting somewhere.

a small bug on the bat.
no scoring yet

Q=up
A=down

NL=start game

Space= release ball
bo1.p
(934 Bytes) Downloaded 9 times
Last edited by dr beep on Sun Sep 03, 2017 9:59 pm, edited 1 time in total.

Shaun_B
Posts: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: Next 1K hires game, BREAKOUT

Post by Shaun_B » Sun Sep 03, 2017 10:37 pm

Good work so far.

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Next 1K hires game, BREAKOUT

Post by dr beep » Mon Sep 04, 2017 4:45 pm

So I had to give up some things...

Not in the game:

Display of the name of the game
Hiscore tracking

I was however able to:
Add the 6 levels completed check
repair the BAT-bug
Fit the game in EXACTLY 1K

The stack is at its MINIMUM.
1 byte more and code gets corrupted and game crashes.

Official release will follow later......
breakout.p
(940 Bytes) Downloaded 14 times

Shaun_B
Posts: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: Next 1K hires game, BREAKOUT

Post by Shaun_B » Mon Sep 04, 2017 9:45 pm

I like it, thanks Dr!

I imagine that ~200 t-states isn't a lot, so good work. So far not got past level two though.

Regards,

Shaun

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Next 1K hires game, BREAKOUT

Post by dr beep » Mon Sep 04, 2017 9:55 pm

Shaun_B wrote:
Mon Sep 04, 2017 9:45 pm
I like it, thanks Dr!

I imagine that ~200 t-states isn't a lot, so good work. So far not got past level two though.

Regards,

Shaun
207 tstates per line.
Display of 240 pixels is already 120 tstates, rest is used for other code.
Some lines need over 130 tstates for other code. This is partly done over the display.

Shaun_B
Posts: 312
Joined: Wed Apr 22, 2009 9:22 am

Re: Next 1K hires game, BREAKOUT

Post by Shaun_B » Tue Sep 05, 2017 7:06 am

I'll get to know this at some point in the hopefully near future; at the moment, I am just an assistant to an apprentice ZX programmer. One day I will be the apprentice.

Regards,

Shaun.

User avatar
Dim_75
Posts: 16
Joined: Fri Sep 01, 2017 10:04 pm
Location: Paris, FR

Re: Next 1K hires game, BREAKOUT

Post by Dim_75 » Tue Sep 05, 2017 10:31 am

Shaun_B wrote:
Tue Sep 05, 2017 7:06 am
... at the moment, I am just an assistant to an apprentice ZX programmer. One day I will be the apprentice.
To keep learning you have, young padawan , heuu sorry, 'assistant' :D

So do I, i just test the game on 81 emulator and guess what ? My older son (13 y.o.) stopped Zelda on his nintendo switch and is now playing on Breakout !!

Dim_75, Yodas' apprentice's assistant' assistant

dr beep
Posts: 1045
Joined: Thu Jun 16, 2011 7:35 am
Location: Boxmeer

Re: Next 1K hires game, BREAKOUT

Post by dr beep » Tue Sep 05, 2017 7:36 pm

I was trying to find room for the hires routine.
I would need 27 bytes for this.

I found 13 bytes.

Then it hit me.

The display of top and bottom line is an inverted linebuffer with data from the linebuffer of the ball.
This is how the program is and already saved 29 bytes.

The stack used to display the bricks only holds values from #81 to #87, the pointers to the thickness of the walls.
These values can be used as inverted displaybuffer. At the end I only need to add a RET and in the calling I need a few bytes more (2).

So I save 25 bytes at once. A total of 64 bytes.
I need 26 for the stack, 27 for the hiscore. Leaving room for the name too.

I can add the hiscore check AND the namedisplay.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests