Unkatris, another tetris clone

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Unkatris, another tetris clone

Post by PokeMon »

marste wrote:I didn't still test, but seems that Antonio's work is possible to be loaded on a real 1K ZX81!...
It is possible to load it on a normal ZX81 but may confuse normal users (if they are existing ;) ).
You have to twice load a file, first a prepared loader and then a second file.
The other hand is, that you have to respect the 1k limit and the limitations of the system (loading specifications).

If you count both single files together you have a program which is over the 1k limit.
You have first a 65 byte file and then a 1016 byte file. So all in all it is 65 byte more than the 1k limit - more or less exactly what you loose as stack needed for the general BASIC handling (loading and starting the program). I could load a program with 950 bytes on a 1k machine with no problem and think this can be even optimized. This was my first quick and dirty attempt.

So for me it is not a ZX81 1k program if you can not provide it in a 1k .p file. But this is philosophic and here you can start a war of opinions, of course. It is the same matter regarding the hardware. How much modding a ZX81 is allowed and how much is too much that the end result won't be a ZX81 anymore. The opinions here are either very different. Anyway, it is a great work from antonio but for me it is breaking the 1k rules. Maybe just for me. ;)

You should take notice of the great work of Dr Beep who programmed many 1k games (which are provided with a single .p file) here:
viewtopic.php?f=4&t=552&start=10

As far as I know he provided all games in a pack and included all sources to the files (so would let you know all the tricks he did) which are available after a small donation he will give to a cancer charity.
http://www.worldofspectrum.org/forums/s ... hp?t=45378

Here the q&d demo, giving 948 byte (including DFILE and vars section) - could be surely optimized.
It just shows a character which is toggling between X and Y every few seconds. :lol:
ZX81DEMO1.p
(948 Bytes) Downloaded 159 times

Code: Select all

format zx81
;labelusenumeric
;LISTOFF

        MEMAVL     =       MEM_1K
        STARTMODE  EQU     SLOW_MODE

        include 'SINCL-ZX\ZX81.INC'        // definitions of constants
;LISTON

AUTORUN:
10      REM _asm
        LD HL,(16396)
        INC HL
@@:     CALL .loop
        INC (HL)
        CALL .loop
        DEC (HL)
        JR @b
.loop:  HALT
        DJNZ $-1
        DEC  C
        JR NZ,.loop
        RET
        db $2FC dup 0     // free area of code plus overwriting the system variables (not all allowed) and shorten the stack
        END _asm

        RAND USR _hide #10#

DFILE_ADDR:
        db $76
        dbzx 'X'
        db 24 dup($76)
VARS_ADDR:
        db $80
WORKSPACE:
antoniovillena
Posts: 23
Joined: Fri Aug 15, 2014 5:48 pm

Re: Unkatris, another tetris clone

Post by antoniovillena »

Hello

The problem is the .P format, it's not concatenable. For example in Spectrum there is equivalent .TAP file for standard loading, that format has the filename included and you can join without problems two .TAP files.

But I have released .TZX and .WAV files that should work on real hardware. They are standard loading as .p files, in fact they are virtually two .p files concatenated and with the filename added in between (filename is 1 byte in unkatris).

The $4401 value of E_LINE is for use the last 2 bytes of RAM, I can use lower values but with less usable memory.

About 1k rules. I only treat to do a game playable in unexpanded ZX81 that can be loaded throw the tape with a standard LOAD"". I know that is not very emulator friendly, because many emulators only support .p file format (included a .z81 snapshot for this reason). Also it's true that the file size is bigger than 1K, but I don't race in a contest.

And finally, I have published a tool for let other people use this method. The difference between 950 bytes or a 1000 bytes game is small, but if you need these 50 bytes and don't bother break 1k rules you have this alternative.
Post Reply