Jump to content
IGNORED

IntyBASIC SCREEN and Offset?


First Spear

Recommended Posts

Manual.txt says


  SCREEN label[,origin_offset,target_offset,cols,rows]
  SCREEN label[,origin_offset,target_offset,cols,rows,origin_width]

    Allows to copy screen data to video the fastest way. Using only "SCREEN label"
    copies a full screen 20x12 cards to video.

    'label' points to a label inside your program containing the data for the
    screen, similar to this:
    
      my_screen:
        DATA $0007,$000F,$0007,$000F   ' And so...
        
    origin_offset is the offset (0-199 or bigger) inside the origin screen
    target_offset is the offset (0-199) inside the target video screen.
    cols is the size in columns of your copy.
    rows is the size in rows of your copy.
    origin_width is the origin screen width, useful to copy a window of a
                 big graphic screen, like a map or when scrolling horizontally.
                 (if not used, by default it's 20 as in Intellivision screen
                 width)
    
    This can serve to displace large elements in video, or to display beautiful 
    graphics screens.
    
    Label can be also an 16-bits array for dynamically drawn elements.
    
        DIM #cards(4)
        
        SCREEN #cards,0,0,4,1

I have two graphic images, each 20x12 cards. I want to show the middle 7x11 segment of the first image in 7x11 of the visible screen, and then show the middle 7x11 segment from the second image. I can't seem to figure out the right syntax to do that - can anyone show working (pseudo)code for this?

 

 

Thanks.

Link to comment
Share on other sites

Let us suppose you have your 7x11 image in a single BMP file measuring 56x88 pixels, and same with other image.

 

intycolor -b -n image1.bmp image1.bas image1

intycolor -b -n -o32 image2.bmp image2.bas image2

 

Note the use of offset 32 in second image, why? because both images must use non-conflicting GRAM, otherwise you'll see trash in the change (another option would be to put the frame in black while defining GRAM)

 

Supposing each image used only 16 GRAM.

 

 

DEFINE 0,16,image1_bitmaps_0
WAIT
DEFINE 32,16,image2_bitmaps_0
WAIT
WHILE 1
    SCREEN image1,0,26,7,11,7  
    FOR c = 0 TO 60: WAIT: NEXT c
    SCREEN image2,0,26,7,11,7
    FOR c = 0 TO 60: WAIT: NEXT
WEND

 

This code will overlap the image alternating between the two at location 26 of screen.

 

Note how the code gives the X size and Y size in cards, and ALSO the final argument is the width of the source image in cards.

  • Like 1
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...