Re: Unkatris, another tetris clone
Posted: Thu Sep 11, 2014 10:12 pm
Excellent work!
Discussion forums for users of the Sinclair 8-bit range of computers - ZX80, ZX81, ZX Spectrum, Z88, clones...
https://sinclairzxworld.com/
The first block is very simple. I have deleted the source that generates the arrays in make1k.c, but here you have an image to clarify.zsolt wrote:Cool, congrats!
Is it possible to take a look to your loader part? (the 1st block) - it is very interesting.
Regards,
Zsolt
PS: The 1kchess? It was my project for this summer , and finally I got similar results
Code: Select all
1 RAND USR 16393
Code: Select all
100 SAVE "APP"
110 GOTO 1
Code: Select all
; Disassembly of the file BLOCK1.P;
4009 VERSN 31fe43 ld sp,$43fe ; normalize STACK pointer to 43FEh (2 less than 4000 + 1k)
FLAGS EQU VERSN+1 ; Bit 7 of FLAGS must be set to allow the execution of a BASIC line
400c D_FILE 214040 ld hl,$4040 ; Code to be moved
400f 1e00 ld e,$00 ; DE is 4049h after USR start. DE is now 4000h
4011 43 ld b,e ; BC is 4009h after USR 4009h. BC is now 0009
4012 180d jr SPARE1 ; $4021 (+$0d)
4014 db 49
4015 db 40
4016 00 nop
4017 00 nop
4018 00 nop
4019 00 nop
401a 00 nop
401b 00 nop
401c 00 nop
401d 00 nop
401e 00 nop
401f 00 nop
4020 00 nop
4021 SPARE1 edb0 ldir ; move BC (9) bytes from HL (4040h) to DE (4000h)
4023 S_TOP 1806 jr OLDPPC ; $402b (+$06)
4025 00 nop
4026 00 nop
4027 00 nop
4028 00 nop
4029 NXTLIN 2e40 dw 402Eh ; After loading from tape, start executing the BASIC statement at the specified address
402b OLDPPC c34003 jp 0340h ; "LOAD" ROM subroutine
402e 0001 defw 0001 ; BASIC line number 1
4030 0000 defw 0000 ; length of BASIC line (only critical if LISTing or if the line finishes)
4032 db f9 ; RAND token
4033 db d4 ; USR token
4034 FRAMES db 2525 ; "99" (abitrary? display number)
4036 db 7e ; floating point marker
4037 db 8f00127676 ; Floating point: 16393 (the actual number)
403c 0b0b dbzx '""' ; two quotes ""
403e db 76 ; End Of Line marker
403f db 76
4040 defs 9 ;first 9 bytes of the game are located here, to be moved by the loader to 4000h
4049 db 28h
404a db 0
Code: Select all
; to be compiled with sjasmplus.exe
output file.bin ; to be then converted with make1k.exe by Antonio Villena
org $4000
block 12,0 ; free space
D_FILE defw _dfile
block 6,0 ; free space
E_LINE defw $4401 ; ld bc, $1c44
block 15,0 ; free space
LAST_K defw $ffff
DB_ST defb 0
MARGIN defb 55
block 11,0 ; free space
FRAMES defw 0
_start ; program starting point
block $4300-$,0 ; free space
_dfile block 25,$76 ; video memory
block $43fe-$,$76 ; free space
defw _start ; starting point: SP will be put here and ret performed
No - it's not possible unless you won't accept keys in your program.marste wrote: - is possible to use LAST_K and DB_ST space if no BASIC keyboard routines are used?
E_LINE defw $4401 is creating two bytes ($44 and $01) at that point in the code. And giving it the lable "E_LINE". The assembly is building up the beginning portion of the ZX81 program.marste wrote:Some clarifications:
- what is the reason for the line "E_LINE defw $4401 ; ld bc, $1c44"?