Smaller compressed screen.

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

Smaller compressed screen.

Post by dr beep » Sun Jul 14, 2019 11:03 am

The ZX81 has a compressed screen to code games in 1K.
However when we have a small game with just a few lines (like Chess or Bejeweled each 8 lines).
we still have 17 linefeeds to fill the screen. I was wondering if this could be less.
You can execute code on the screen, so why wouldn't you jump back to a newline earlier on the screen
and use a loop to fill the screen? Easier said than done. A jump back to latest Newline didn't do
in all cases. This routine shortens the screenmemory when 16 lines or less are used. When you use more
fill the screen with Newlines like normal.

Due to the jump the screenlayout is corrupted. This can be solved with more linefeeds on the last line.
This routine works in all cases. Sometimes less linefeeds work, but you need to try.

This screen is part of Bukster's BEJEWELED.

Code: Select all

ONEKDISPLAY:
	DB $76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
	DB $00,$00,$00,$00,$00,$00,$00,$00,$76
lives	DB $80,$80,$80,$80
dispsc	DB $9C,$9C,$9C,$9C
; end of visible screen

; Screenfiller, max size will work always less linefeed might work.
; Screen with less than 16 lines wil be shorter with this code.
lf	db #76,#76,#76,#76,#76,#76
	jp lf+#8000
; fill rest of screen by jumping back to lower part of screen intruptcounter will end in right way.

dr beep
Posts: 1189
Joined: Thu Jun 16, 2011 8:35 am
Location: Boxmeer

Re: Smaller compressed screen.

Post by dr beep » Sun Jul 14, 2019 12:11 pm

BTW, this will NOT work on a 48K ZX81.

User avatar
marste
Posts: 132
Joined: Sun Aug 10, 2014 9:58 pm
Location: Italy
Contact:

Re: Smaller compressed screen.

Post by marste » Sun Jul 21, 2019 9:28 pm

Wonderful, seems "a lot" of bytes saved!!

As soon I'll be able to get back on the 1K Super Micro Chess I'll try it for sure!!

Thank you Johan!! :)

User avatar
stefano
Posts: 393
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: Smaller compressed screen.

Post by stefano » Thu Jul 25, 2019 9:31 pm

we're looking forward for seeing it back alive and kicking, Stefano ;)

Post Reply