Jump to content
Sign in to follow this  
Kernal

Loading MIC Images into basic

Recommended Posts

Hi, someone posted a while ago in one of the SMBport threads a way to load MIC files in basic

 

can any one either post it here in this thread or is there a pre-written .bas file i could have that would let me load mic files as a title screen to a game =)

 

I cant seem to find the thread it was on.. i had it bookmarked but now its gone alas. =(

Share this post


Link to post
Share on other sites

cioget.bas

 

Try that.

 

You can embed that in your program.

 

OPEN the file you want to read. Then use ST=USR(ADR(CIOGET$),fileno,bufferadr,bufferlen)

Status of the operation returned in the variable (ST in this case).

fileno is the IOCB you're using (usually 1-5 in BASIC).

bufferadr,bufferlen parameters self-explanatory.

 

 

If the file you're reading has header stuff you want to skip, just do a call that reads it to ROM, that essentially just does a dummy read.

  • Like 1

Share this post


Link to post
Share on other sites

Hi, someone posted a while ago in one of the SMBport threads a way to load MIC files in basic

 

can any one either post it here in this thread or is there a pre-written .bas file i could have that would let me load mic files as a title screen to a game =)

 

I cant seem to find the thread it was on.. i had it bookmarked but now its gone alas. =(

If I remember, MIC have 7680 bytes, so:

10 REM ATARI BASIC (WILL BE WORK - I WRITE FROM HEAD)
11 GR.31:REM OPEN GRAPHICS MODE FOR THIS
20 OPEN #1,4,0,"D:MICNAME.MIC"
21 FOR I=0 TO 7679
22 GET #1,PEEK(560)+PEEK(561)*256:REM LOADING FOR SCREEN, I DONT REMEMBER WHICH ADRES MUST BE MULTIPLY - 560 OR 561)
23 NEXT I
30 CLOSE #1

Or simplest in Turbo Basic XL

10 .TURBO BASIC XL PROC
20 OPEN #1,4,0,"D:MICNAME.MIC"
25 GR.31
30 BGET #1,DPEEK(560),7680:REM LOADING DIRECTLY FOR SCREEN
40 CLOSE #1

Of course, you can't load image for screen directly, you can load it to specific adress of Atari memory.

  • Like 1

Share this post


Link to post
Share on other sites

DPEEK(88) instead of DPEEK(560) and PEEK(88)+PEEK(89)*256 instead of PEEK(560)+PEEK(561)*256, the rest may go as is.

Edited by miker
  • Like 1

Share this post


Link to post
Share on other sites

ok when i do it in turbo basic i get garbage 17 errors at line 30

 

and when i do it in regular nonhappy atari basic blue

i get malformed get errors with the comma before the peek + peek *256

(on both)

 

is it a badly formed mic in g2font or is it the code.

 

thank you my friend across the big pond =)

im in cold snoy maine today.. be back in boston soon =)

Share this post


Link to post
Share on other sites

In Turbo-Basic XL I use this code:

100 GRAPHICS 15+16
110 DIM FILE$(15)
120 FILE$="D1:IMAGE.MIC"
130 S=PEEK(559):POKE 559,0:REM DISABLE SCREEN FOR FASTER SPEED
140 OPEN #%1,4,%0,FILE$
150 BGET #%1,DPEEK(88),7680
160 BGET #%1,712,%1
170 BGET #%1,708,%3
180 CLOSE #%1
190 POKE 559,S:REM ENABLE SCREEN
200 GOTO 200

 

In G2F, remember to only save 7680 bytes + 4 colors bytes (set to 0 left values in last 6 rows and disable "Smart colors" option).

Edited by Philsan

Share this post


Link to post
Share on other sites

ok one last problem.. all my mics some how are getting sized 6140 or 9210 in g2font how do i fix this.. i delete the last 6 lines...

Share this post


Link to post
Share on other sites

ok i fixed that myself.. but now that i have it loaded into the memory address how do i get it to display on the screen

 

it runs perfectly with no errors, shuts off the screen, loads the picture into memory, and the turns the screen back on

 

now how do i get the picture to display.

Share this post


Link to post
Share on other sites

it doesnt.. just goes back to the blue ready screen.. do i need to add wait syntax?

 

mebbe the mic file im using is bad.. i got it to 7680 in size.. and i disabled smart colors.

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...