Degas to Neo

by Dave Keel and Steve Banks

 

Issue 21

May/Jun 86

Next Article >>

<< Prev Article

 

 

Many ST owners who have managed to attach their computer to a colour monitor should by now have obtained a free copy of the Atari 'public domain' low resolution graphics design program, Neochrome. If not, stop reading this article, call your dealer and demand a copy NOW, it's excellent, probably better than anything you've used before ... and it's free!

A large proportion of those who have obtained Neochrome are also likely to have purchased a copy of Degas - a multimode graphics design program by Batteries Included. The many features of Degas include a first class font designer, very useable zoom, user designed fills and extensive shape drawing commands. Both programs are far better than anything possible on 8 bit machines, but both have their own individual benefits and weaknesses, and sadly there is a fundamental difference between the format of each program's saved screen that does not allow any compatibility between the two.

The DEGAS disk does contain a conversion program to enable Neo-Chrome screens to be converted to a DEGAS format, but there is no comparable program to allow conversion in the opposite direction. It is this conversion that has proved far more useful to the writer, for instance in producing a graphic outline and any text content using the full screen, zoom and text facilities of DEGAS, then convert and paint with Neo-Chrome making full use of that program's ease of colour selection with dynamic colour scrolling.

Close investigation of the two screen formats revealed the information shown in the accompanying boxes and it was then decided to write the short conversion program listed here, in ST BASIC since this is the only language that is universally available to ST users at all levels.

The utility as listed is a very bare bones program with plenty of scope for expansion and improvement by readers, but which will also work perfectly well without any alteration. When the program is running don't move the mouse or it will show itself on the newly converted screen. Also remember that there is no error checking on filenames of the pictures to be converted, so make sure that you don't overwrite you original screen.
When running the program, you are asked for the file name of the DEGAS screen to be converted. Make sure it has the extension 'PI1' and when you are asked for the file name for the converted screen to be saved under, it should have the extension 'NEO'. Any colours selected from DEGAS (though remember it is far easier to select colours with NeoChrome!) are maintained throughout the conversion, but for safety's sake it is always best to carry out any conversions on a copy of your original screen. This program will, of course, only work with screens saved in the Low Resolution mode of DEGAS but the actual program can be typed and run in monochrome if it proves more convenient.

Type in the BASIC program listing and remember to save it before running. It is also advisable to have a disk available containing your DEGAS screen and more than 33,000 bytes free.

NEOCHROME SCREENS

These are always 32,128 bytes long. 32,000 bytes are the actual screen RAM of the picture and the other 128 bytes contain information about the colour rotation pointers and colours. These bytes are at the head of the screen file and are best considered in terms of 16 bit words. 

Words 0 to 1  colour rotation pointers(?)
Words 2 to 7 

colours in the form of $abcd where 

a = 0 (always)
b = 0 to 7 (red level)
c = 0 to 7 (green level)
d = 0 to 7 (blue level)

(0070 =green, 0777 = white) - if this sounds familiar, think about the Control Panel!

Words 18 to 23 form a null file name of 8 spaces, a dot and three further spaces i.e. 2020 2020 2020 2020 2E20 2020)
Word 24 $801E (haven't a clue on this one?)
Words 25 to 63 0000 (likewise)
Finally 32,000 bytes of picture information follow.

DEGAS SCREENS

These are always 32,034 bytes long. 32,000 bytes are the actual screen RAM of the picture and the other 34 bytes contain information about the mode and colours. These bytes are at the head of the screen file and again are best considered in terms of 16 bit words.

Word 0

 

mode,
0000 1 = Low resolution (.P11)
0001 = Medium resolution (.P12) 

0002 = High resolution (.P13)

Words 1 to 16

define colours, these are in the form of $abcd where
a = 0 (always)
b = 0 to 7 (red level)
c = 0 to 7 (green level)

d = 0 to 7 (blue level)

Finally 32,000 bytes of picture information follow.

 

List of \DEGNEO.BAS

10 openw 2
20 fullw 2
30 clearw 2
40 print "Converting from DEGAS to NEOCHROME." 

50 print
60 input "Please enter file to be converted..",ip$
70 input "Please enter the new filename..",op#
80 bload ip$,&h7805e
90 for n%=1 to 16
100 word%=peek(&h7805e+2*n%) 

110 poke &h78002+2*n%,word% 

120 next n%
130 poke &h78000,0
140 poke &h78002,0
150 poke &h78024,&h2O20 

160 poke &h78026,&h2020 

170 poke &h78028,&h2020 

180 poke &h7802a,&h2020 

190 poke &h7802c,&h2e20 

200 poke &h7802e,&h2020 

210 poke &h78030,&h801e 

220 for n%=1 to 39
230 poke &h78030+2*n%,&h0000
240 next n%

250 bsave op$,&h780OO,32128 

260 clearw 2

270 end

top