Jump to content
IGNORED

Pictures converter PC -> Atari?


Philsan

Recommended Posts

Here are some programs written in Turbo-BASIC. Please watch the Source-Code to understand the programs!

 

BMP2MIC.TUR - old program ... converts a 160 x 192 x 8Bit - Picture (saved by Corel Draw 7, or Windows Paint) to MicroPainter

GMP2MIC.TUR - the same ... but the pictures were saved by GIMP (seems like the header is a little different from the others)

GMP2MICR.TUR - the same ... but I forgot, what was special in this version

All these programs work the same way:

Enter the full path to the picture, wait some hours while loading ... Then, the program stops - this is no error. Now you have time to enter some SETCOLORs (the programs does not convert colors!). When you CONTinue the program, you can enter a filename for saving.

Please note, the Picture may be saved in 8 Bit, but of course its only usefull, when the palette has not more than 4 colors (like GRAPHICS 15 has).

 

INVERTMIC.DLL - inverts a micropainter-file and reverses the 4-color-palette, so the result looks the same - only the bordercolor now is that, what color 3 was before.

Do not RUN this program! At first, LOAD it, change the filename(s) right in the listing and then you can run it (not very userfrienldy, but a good base for a later all-in-one-app).

 

BMPTO256.TUR - converts a 80 x 96 x 8 Bit - Picture to Paint256

B24TO256.TUR - converts a 80 x 96 x 24 Bit - Picture to Paint256 (GIMP-Users: NOT 32 Bit RGBA! Switch to 24 Bit while saving!)

These programs will also convert the colors (from RGB to ATARI).

 

All these programs have in common, that they are very slow on a real ATARI, so it is more usefull to run them on an Emulator at full-speed. Use the virtual drives H1: - H4: to make them able to access the PC-files.

piconvert.zip

Edited by atarixle
Link to comment
Share on other sites

  • 5 weeks later...

Thank you to all.

After having tested all your interesting programs, I think this is the best solution to transfer graphics mode 15 pictures from PC to Atari:

- draw a 160x192 4 color image using your preferred PC program and save it in .bmp format

- start Graph2Font, select 40 byte screen, select GED-- mode, load your .bmp image, turn off the last 6 lines by clicking with left mouse button over the numbers in the left column switching them to 0, save in .mic format

- insert the .mic file in an .atr image using MakeATR

- load the image in Turbo-Basic XL using the following code:

 

200 GRAPHICS 15+16
210 DIM FILE$(12)
220 FILE$="D1:IMAGE.MIC"
225 S=PEEK(559):POKE 559,0:REM IF YOU WANT TO TURN OFF SCREEN WHILE LOADING
230 OPEN #%1,4,%0,FILE$
240 BGET #%1,DPEEK(88),7680
250 BGET #%1,712,%1
260 BGET #%1,708,%3
290 CLOSE #%1
295 POKE 559,S:REM TURN ON SCREEN

Link to comment
Share on other sites

  • 2 months later...

Well,

1) try Jview by Jeff Potter, it will convert Gif87a pictures into Gr.8, Gr.9 or Gr.15. Just set the conversion mode to "mono" (by pressing the "M" key, otherwise you would create RGB pictures) and you will get 62 sector pictures with 2 greys ( Gr.8 ), 16 greys (Gr. 9) or 4 greys (Gr. 15)...

 

should be no problem to turn 4 greys into 4 colors on the A8...

(hint: there are some A8 painter programs which allow to set colors)

 

2) you can also use A8JDPEG by Raphael Espino to convert *.JPG pictures into greyscale A8 pictures (including Gr.8, Gr.9, Gr. 15, Hip and a few other modes)...

 

-Andreas Koch.

Edited by CharlieChaplin
Link to comment
Share on other sites

  • 2 years later...

Thank you to all.

After having tested all your interesting programs, I think this is the best solution to transfer graphics mode 15 pictures from PC to Atari:

- draw a 160x192 4 color image using your preferred PC program and save it in .bmp format

- start Graph2Font, select 40 byte screen, select GED-- mode, load your .bmp image, turn off the last 6 lines by clicking with left mouse button over the numbers in the left column switching them to 0, save in .mic format

- insert the .mic file in an .atr image using MakeATR

- load the image in Turbo-Basic XL using the following code:

 

200 GRAPHICS 15+16
210 DIM FILE$(12)
220 FILE$="D1:IMAGE.MIC"
225 S=PEEK(559):POKE 559,0:REM IF YOU WANT TO TURN OFF SCREEN WHILE LOADING
230 OPEN #%1,4,%0,FILE$
240 BGET #%1,DPEEK(88),7680
250 BGET #%1,712,%1
260 BGET #%1,708,%3
290 CLOSE #%1
295 POKE 559,S:REM TURN ON SCREEN

 

Is it possible to use this routine also in gr. mode 9 with 16 colors? I have tried it, converted picture in G2F in res. of gr.9 but when displaying picture, colors were messed up.

Link to comment
Share on other sites

Thank you to all.

After having tested all your interesting programs, I think this is the best solution to transfer graphics mode 15 pictures from PC to Atari:

- draw a 160x192 4 color image using your preferred PC program and save it in .bmp format

- start Graph2Font, select 40 byte screen, select GED-- mode, load your .bmp image, turn off the last 6 lines by clicking with left mouse button over the numbers in the left column switching them to 0, save in .mic format

- insert the .mic file in an .atr image using MakeATR

- load the image in Turbo-Basic XL using the following code:

 

200 GRAPHICS 15+16
210 DIM FILE$(12)
220 FILE$="D1:IMAGE.MIC"
225 S=PEEK(559):POKE 559,0:REM IF YOU WANT TO TURN OFF SCREEN WHILE LOADING
230 OPEN #%1,4,%0,FILE$
240 BGET #%1,DPEEK(88),7680
250 BGET #%1,712,%1
260 BGET #%1,708,%3
290 CLOSE #%1
295 POKE 559,S:REM TURN ON SCREEN

 

Very cool. Anybody know how to get the above code in the default Atari Basic?

Link to comment
Share on other sites

Thank you to all.

After having tested all your interesting programs, I think this is the best solution to transfer graphics mode 15 pictures from PC to Atari:

- draw a 160x192 4 color image using your preferred PC program and save it in .bmp format

- start Graph2Font, select 40 byte screen, select GED-- mode, load your .bmp image, turn off the last 6 lines by clicking with left mouse button over the numbers in the left column switching them to 0, save in .mic format

- insert the .mic file in an .atr image using MakeATR

- load the image in Turbo-Basic XL using the following code:

 

200 GRAPHICS 15+16
210 DIM FILE$(12)
220 FILE$="D1:IMAGE.MIC"
225 S=PEEK(559):POKE 559,0:REM IF YOU WANT TO TURN OFF SCREEN WHILE LOADING
230 OPEN #%1,4,%0,FILE$
240 BGET #%1,DPEEK(88),7680
250 BGET #%1,712,%1
260 BGET #%1,708,%3
290 CLOSE #%1
295 POKE 559,S:REM TURN ON SCREEN

 

Is it possible to use this routine also in gr. mode 9 with 16 colors? I have tried it, converted picture in G2F in res. of gr.9 but when displaying picture, colors were messed up.

 

You should delete teh the line 250. this line reads 3 bytes and writes them into the color registers. This should lead in messed up colors.

Link to comment
Share on other sites

Thank you to all.

After having tested all your interesting programs, I think this is the best solution to transfer graphics mode 15 pictures from PC to Atari:

- draw a 160x192 4 color image using your preferred PC program and save it in .bmp format

- start Graph2Font, select 40 byte screen, select GED-- mode, load your .bmp image, turn off the last 6 lines by clicking with left mouse button over the numbers in the left column switching them to 0, save in .mic format

- insert the .mic file in an .atr image using MakeATR

- load the image in Turbo-Basic XL using the following code:

 

200 GRAPHICS 15+16
210 DIM FILE$(12)
220 FILE$="D1:IMAGE.MIC"
225 S=PEEK(559):POKE 559,0:REM IF YOU WANT TO TURN OFF SCREEN WHILE LOADING
230 OPEN #%1,4,%0,FILE$
240 BGET #%1,DPEEK(88),7680
250 BGET #%1,712,%1
260 BGET #%1,708,%3
290 CLOSE #%1
295 POKE 559,S:REM TURN ON SCREEN

 

Very cool. Anybody know how to get the above code in the default Atari Basic?

My Atari-Basic times are lots of years away. However, I think the main advantage of TB was the dpeek/dpoke and bput/bget instructions.

The Atari-BASIC only has POKE/PEEK GET/PUT. So you have to write a machine code routine to do the BPUT/BGET stuff. The easy but slow way would be to use a loop:

 

for i = 0 to 7680

get ...

n. i

 

In the end, the BPUT/BGET stuff is in the ROM (CIO), however not easily accessible from BASIC. Therefore the need for ML-rout.

 

 

i think the Dpeek/Dpoke is obvious? dpeek: peek(adr) + 256*peek(adr+1), dpoke: poke adr,(val mod 256):poke adr+1,(val/256).

if there is no "mod" then: vh=int(val/256):vl=val-256*vh

 

poke adr,vl: poke adr+1,vh

 

If this answer is no help for you, it was at least a big help to realize how much stuff I have burned into my brain since year - unused :)

And yes, I can rewrite the above for BASIC use, but it takes longer then the 5 minutes doing this post :) If you are interested tell me

Edited by Creature XL
Link to comment
Share on other sites

Thank you to all.

After having tested all your interesting programs, I think this is the best solution to transfer graphics mode 15 pictures from PC to Atari:

- draw a 160x192 4 color image using your preferred PC program and save it in .bmp format

- start Graph2Font, select 40 byte screen, select GED-- mode, load your .bmp image, turn off the last 6 lines by clicking with left mouse button over the numbers in the left column switching them to 0, save in .mic format

- insert the .mic file in an .atr image using MakeATR

- load the image in Turbo-Basic XL using the following code:

 

200 GRAPHICS 15+16
210 DIM FILE$(12)
220 FILE$="D1:IMAGE.MIC"
225 S=PEEK(559):POKE 559,0:REM IF YOU WANT TO TURN OFF SCREEN WHILE LOADING
230 OPEN #%1,4,%0,FILE$
240 BGET #%1,DPEEK(88),7680
250 BGET #%1,712,%1
260 BGET #%1,708,%3
290 CLOSE #%1
295 POKE 559,S:REM TURN ON SCREEN

 

Very cool. Anybody know how to get the above code in the default Atari Basic?

My Atari-Basic times are lots of years away. However, I think the main advantage of TB was the dpeek/dpoke and bput/bget instructions.

The Atari-BASIC only has POKE/PEEK GET/PUT. So you have to write a machine code routine to do the BPUT/BGET stuff. The easy but slow way would be to use a loop:

 

for i = 0 to 7680

get ...

n. i

 

In the end, the BPUT/BGET stuff is in the ROM (CIO), however not easily accessible from BASIC. Therefore the need for ML-rout.

 

 

i think the Dpeek/Dpoke is obvious? dpeek: peek(adr) + 256*peek(adr+1), dpoke: poke adr,(val mod 256):poke adr+1,(val/256).

if there is no "mod" then: vh=int(val/256):vl=val-256*vh

 

poke adr,vl: poke adr+1,vh

 

If this answer is no help for you, it was at least a big help to realize how much stuff I have burned into my brain since year - unused :)

And yes, I can rewrite the above for BASIC use, but it takes longer then the 5 minutes doing this post :) If you are interested tell me

 

Wow, thanks! Still getting reacquainted with Atari Basic here myself. Baby steps, but will file this away once I get some more, er 'basic' programs going :)

 

Btw. is Turbo Basic a compiler, not interpreter? Wasn't there a compiling Basic for the XL/XE, which had a fairly compatible commend set with Atari Basic?

Link to comment
Share on other sites

 

 

Btw. is Turbo Basic a compiler, not interpreter? Wasn't there a compiling Basic for the XL/XE, which had a fairly compatible commend set with Atari Basic?

 

TBXL is an interpreter, it's a modified Atari BASIC with new commands and it executes faster. There is also a compiler with it, that will make your programs run 15 times faster.

 

 

 

Link to comment
Share on other sites

My ATARI Basic times are ages ago, but simly modify the given source.

 

 

235 ADRESS=PEEK(88)+256*PEEK(89):REM same as DPEEK(88) in TBA
240 FOR I=1 TO 7680:GET #1,ADRESS+I:NEXT I:REM next 7680 bytes are screen data
250 GET #1,712:REM background colour
260 FOR I=0 TO 2:GET #1,708+I:NEXT I:REM other colours

Link to comment
Share on other sites

Hang on, you're overestimating BASIC: Don't you need to POKE the data into memory?

 

As I wrote. I did not code in pure ATARI Basic for ages :roll: Yes, the "normal" basic needs a GET#1,Z:POKE ADRESS+I,Z instead of my above given GETs...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...