Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:51 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Blit from Flash

Author Message
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 07:57pm 14 Sep 2023
Copy link to clipboard 
Print this post

Peter's sample code for copying sprites from CSUB data in flash is very useful.

The MMBasic code
Local y%=yin% * 24 * w%
  Local x%=xin%*12
  Local b%=MM.Info(writebuff)+x%+y%
  Local a%=c%+s%*288
  For yy%=0 To 23
    Memory copy a%, b%,12
    Inc b%,w%
    Inc a%,12
  Next
is remarkable similar to the source code
  start_x1 = x1 + w - max_x;
  start_x2 = x2 + w - max_x;
  while(w > max_x){
    ReadBufferFast(start_x1, y1, start_x1 + max_x - 1, y1 + h - 1, buff);
    DrawBufferFast(start_x2, y2, start_x2 + max_x - 1, y2 + h - 1, -1, buff);
    w -= max_x;
    start_x1 -= max_x;
    start_x2 -= max_x;
  }
at the end of the cmd_blit(void) routine in the file Draw.c

If you squint, there are also similarities with the routine DrawBitmapColour() and the MMBasic command GUI BITMAP.

This blather is a lead-up to wondering if it could be possible to have a variation of the blit command that pulls the source data from a CSUB all in one go.
Visit Vegipete's *Mite Library for cool programs.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024