Picture Popper

See all articles from CATS v3 n8
Author(s): George White
Publication: CATS Newsletter
Pub Details: CATS v3 n8 (Volume 3, Issue 8)
Date: December 1985
Pages: 4

TS 2068

Instructions for using the various display modes available on the 2068 seem to be beyond the scope of every book that I have come across. Display Mode 3 is described in the manual as instantly switching between two display files, but in my short experience with the 2068 I haven’t been able to find the proper incantation to conjure up this “second page” mode.

The Z80 CPU can transfer 6912 bytes into Display/Attributes File 1 so fast that it seems instantly. Therefore why not use a LDIR instruction to load the display file from as many storage areas as allowed by memory size restraints?

The Basic program below (list 1) will load a machine code routine into memory at 65349 which will transfer whatever is on screen into either of two blocks of memory, depending on which USR number is used. RANDOMIZE USR 65349 will cause the screen to be copied into memory location 51509 thru 58420. RANDOMIZE USR 65354 will load memory locations 58421 thru 65332 with Display/Attribute File. Then a simple POKE 65360, 235 prepares the machine code routine to POP a picture onto the screen. RANDOMIZE USR 65349 pops the first and RANDOMIZE USR 65354 pops the second.

This demo program does not protect the memory used from being overwritten but there is room enough to hold five screens if memory is free from 30772 to RAMTOP so this PICTURE POPPER might serve as yet another display mode.

list 1

10 FOR I= 65349 TO 65366
20 READ A
30 POKE I,A
40 PRINT I; TAB 8; PEEK I
50 NEXT I
60 DATA 17,53,201,24,3,17,53,
228,33,0,64,0,1,0,27,237,
176,201

RUN this Basic program to load the machine code.

Create a picture on the screen in any manner.

RANDOMIZE USR 65349 will store the screen at 51509.

Create another picture on screen.

RANDOMIZE USR 65354 will store the second screen at 58421.

POKE 65360, 235 prepares the M C to POP pictures to the screen.

RANDOMIZE USR 65349 now displays the first saved picture.

RANDOMIZE USR 65354 now displays the second saved picture.

To save both pictures and routine to tape:

SAVE "name" CODE 51508, 13859

Puzzle Time

Last month’s puzzle (to construct a program to successively fill in the halfway points in a line) met with no response, so I have no better solution than the one I proposed last month.

This month’s problem also arises from a program I’m working on. If you have two points (m and s), each travelling along a straight line in the plane, can you predict their point of closest aproach?

M travels from point m1 to point m2, and S travels from s1 to s2. At any given time, their distance is given by the Pythagorean theroem. I remember enough calculus to know that this problem is solvable, but not enough to do the work.

If anyone else hits a knot in your programming, write it up and send it in for the general membership to work on.

MF

CRYPTOGRAM:

HIW YESTU FTYFRA AWWGA HE XW KNOWS ULSNKM HIW IETNUFRA; GFRXW FTT EP HIW SFAOFTA YFKH HE MWH EPP EP AFKHF’A “KFLMIHR” TNAH.

CRYPTOGRAM Solution:

THE WORLD ALWAYS SEEMS TO BE NICER DURING THE HOLIDAYS; MAYBE ALL OF THE RASCALS WANT TO GET OFF OF SANTA’S “NAUGHTY” LIST.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.