Thinking of a 1K hires game .....

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

Re: Thinking of a 1K hires game .....

Post by dr beep »

Stack and screen solved.
When entering hires routine the last card is partially overwritten by the stack.
Stack will become too large when in hires due to calls and PUSHes.

Now in hires first
1) stackpointer is saved to end
2) new stackpointer on sysvar is set ( just a few bytes needed)
3) last card is repaired, only last pixels of the card with fixed values
4) hires is done
5) after doing the screen, original stackpointer is set back and routine ends

Program loads once again in 1K and still 47 bytes free for coding for last moves.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

I am sseking boundaries.

I can alter SP, but when I take off last value on stack an save it for later to restack it again, the stack uses just enough room where the screen stays off the stack.

This however saves 5 bytes to code extra.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

28 bytes left for the final routine, erase cards that make up sum of 10.

Must be possible.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

Game has a few small bugs, but plays almost perfect.

Size however needs to be shortened with AT LEAST 50 bytes.
A lot of situations I had to deal with which took a lot of memory.
Now I need to find ways to solve this.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

The games runs in 1,25K. Yesterday I played the game several times and won once.
The check for losing is ok, but winning is not added yet.
I need to reduce the code with 20 bytes to fit in 1K as it is now, then wincheck must be added.
I have an idea for the reduction of the 20 bytes. With some luck this will become more.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

First playable version now available.

Still 1 thing to do.
Check on winning is missing. Game will stay in playmode when game is won.
I need to find 5 bytes to solve this.

I had to offer up/down movement to fit it in 1K.
Also not added, the 48K fix.

Not tested on real hardware, but it is hires only, so I think it will work ( I will not test it).


Object of the game:
To place all picturecards on the destined places.
You need to place 16 cards. J,Q and K must be placed on free destined places.
When no place free, the game ends. Player loses. This is indicated by a pixel under all cards (also startmode after loading)
After placing 16 cards you can delete cards with the sum of 10 to free positions.
You may stop this anytime (here might be a bug, won't tell what) and set new cards.

You win when you can place all J,Q an K on the right places (not built yet, game will stay in playmode)

Controls:
H-Enter to start
1-5 Left
6-0 Right
B-Space set card / mark card
Y-P Back to place mode.

You can see the play mode. In erase mode no next card is shown.

Feedback is appreciated.

(File deleted)
Last edited by dr beep on Tue Jun 09, 2015 8:46 am, edited 1 time in total.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

Btw, when you select the wrong card in erasemode, you can undo it by selecting other cards to make a sum larger than 10.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

I have been working 8 hours to reduce the code by a few bytes just to insert the win-situation.
Looks like it is done. Now I need to win a game to see if it works.

I will probably alter the randomroutine to give me cards in defined order to test this.

Then only 1 rare occassion must be added to have it 100% covered ( the not given bug).

The code is realy compact. Almost no, perhaps now no room at all, to shorten the code.
Only thing I can imagine is putting the cursor against the card, but I don't like that.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

End of game win is now added and the fullboard bug will end in losing the game.

Only down part, no fulll movement with up/down, but this will cost 8 bytes.

Since fixing this costed me half a day I don't know where to get the room for 8 bytes.
I can't even built the 48K repair as I know it (will try something else) in the program due to building the cards on intrupt.
Last edited by dr beep on Tue Jun 09, 2015 8:47 am, edited 1 time in total.
dr beep
Posts: 2082
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Thinking of a 1K hires game .....

Post by dr beep »

I was able to free another 4 bytes so UP is now added.
Not available yet.
Post Reply