Smaller compressed screen.

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
dr beep
Posts: 1186
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: 1186
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.

Post Reply