Page 1 of 1
"Chesszoom 1K" - new ZX81 true hi-res demo
Posted: Sun Aug 20, 2023 6:34 pm
by PROSM
Hello all,
I'm posting here a little 1K demo that I wrote to help me get to grips with true hi-res display techniques on the ZX81.
Chesszoom 1K presents a bouncing chessboard animation, with smooth movement in all three dimensions.

- screenshot.png (5.87 KiB) Viewed 5469 times
This should work on any ZX81 which is capable of true hi-res (including all un-expanded machines, plus those fitted with compatible RAM packs). Attached is a ZIP file containing the tape image, source code and readme file. I hope you enjoy the demo and/or find the source code useful.
Cheers!
EDIT: Replaced ZIP file to fix typo in readme
Re: "Chesszoom 1K" - new ZX81 true hi-res demo
Posted: Sun Aug 20, 2023 10:26 pm
by dr beep
I like it.
Took a look in the source and you can save bytes when you use the optimized hires model.
Re: "Chesszoom 1K" - new ZX81 true hi-res demo
Posted: Mon Aug 21, 2023 4:55 pm
by PROSM
Thanks! Glad you like it
I'm interested by your mention of an optimised hires model. Would you happen to have a link to an ASM template, or be able to describe the steps necessary?
Re: "Chesszoom 1K" - new ZX81 true hi-res demo
Posted: Mon Aug 21, 2023 8:08 pm
by dr beep
PROSM wrote: ↑Mon Aug 21, 2023 4:55 pm
Thanks! Glad you like it
I'm interested by your mention of an optimised hires model. Would you happen to have a link to an ASM template, or be able to describe the steps necessary?
Code: Select all
; Model 1K hires
ORG #4009
; program starts here, both BASIC and machinecode
; the initialization also repairs any possible 48K bug.
basic EX AF,AF' ; delay intrupt,opcode no bit6
LD H,B ; preset for 48K bug to #40
JR init0 ; continue where room
DEFB 236,212,28 ; The BASIC
DEFB 126 ; fully placed over sysvar
DEFB 143,0,18 ; start BASIC=#4009 also MC
DEFW last ; needed by loading
chadd DEFW last-1
xptr DEFW 0
stkbot DEFW last
stkend DEFW last
berg DEFB 0
mem DEFW 0
DEFB 128
DEFB 0,0,0
; all above reusable AFTER loading
lastk DEFB 255,255,255 ; used by ZX81
margin DEFB 55 ; used by ZX81
nxtlin DEFW basic ; reusable after load
init0 LD IX,hr ; hr lowbyte bit 5 reset
; lowbyte over flagx which resets bit 5 on load
; HR must be set on right address or game crashes
LD E,L ; DE now #xx.L
taddr DEFW 0 ; used by ZX81 on LOAD only
; unharmed code
LD B,4 ; copy >1K code
frames DEFB #16+1 ; LD D,n , after LOAD -1
DEFB #C0 ; highbyte must have bit 7 set
coords LDIR ; DE now #C0.L = Hl +#8000
; fix 48K bug before display
prcc JP start ; continue to mainprog
cdflag DEFB 64 ; used by ZX81
; Place ANY code to fill up to above #4040
; some lowres, HR must start AFTER #403F, but before #4070
hr LD HL,lowres+#8000 ; the lowres display
LD BC,#309 ; minimum needed #11
LD A,#1E
LD I,A
LD A,#FB
CALL #2B5 ; show lowres screen
;hrpart
; fixed end of HR-routine
exit CALL #292 ; back from intrupt
CALL #220
LD IX,hr
JP #2A4
x EQU 101
lowres DEFB 118,0,0,0
score DEFB 28,28,28,28,0
lives db 28,0
DEFB "S"+x,"L"+x,"I"+x,"N"+x,"G"+x,"S"+x,"H"+x,"O"+x,"T"+x,128
DEFB "S"+x,"A"+x,"M"+x,0
hiscore DEFB 28,28,35,37,118
DEFB 118,#e9
vars DEFB 128
last EQU $