Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:26 19 Feb 2026 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 : PicoMite V6.02.00 release candidates - Structured types

     Page 11 of 14    
Author Message
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:07pm 20 Jan 2026
Copy link to clipboard 
Print this post

but true the lengths are wrong.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10965
Posted: 12:08pm 20 Jan 2026
Copy link to clipboard 
Print this post

Please check the review output above. My question about the demo was simply to ask what I should be seeing on the screen. It runs but does it do what it should? What version are you running? Let me know and I'll post the firmware
Edited 2026-01-20 22:09 by matherp
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:14pm 20 Jan 2026
Copy link to clipboard 
Print this post

fix 1 is good
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:16pm 20 Jan 2026
Copy link to clipboard 
Print this post

2) I verfied your sources and the loop complies with the format used.
It should only increment on odd pixels.
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:19pm 20 Jan 2026
Copy link to clipboard 
Print this post

The figure should run from left to right where the upper gets to run in the lawn area.

The lower should go up the ramp.

they both run back, where I do not do any tests.

When you look at the numbers you can verify the behaviour of the collision checks.
See basic source it shows all the 8 values for the two sprites.
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:28pm 20 Jan 2026
Copy link to clipboard 
Print this post

3) i looked up the byte order from line 11121
oid DrawBuffer2Fast(int x1, int y1, int x2, int y2, int blank, unsigned char *p)
{
   int x, y, t, loc, toggle = 0;
   unsigned char mask;
   // make sure the coordinates are kept within the display area
   if (x2 <= x1)
   {
       t = x1;
       x1 = x2;
       x2 = t;
   }
   if (y2 <= y1)
   {
       t = y1;
       y1 = y2;
       y2 = t;
   }
#if PICOMITERP2350
   if ((Option.DISPLAY_TYPE >= VIRTUAL && Option.DISPLAY_TYPE < VGA222) && WriteBuf == NULL)
       WriteBuf = FRAMEBUFFER;
#else
   if ((Option.DISPLAY_TYPE >= VIRTUAL) && WriteBuf == NULL)
       WriteBuf = FRAMEBUFFER;
#endif
   for (y = y1; y <= y2; y++)
   {
       for (x = x1; x <= x2; x++)
       {
           if (x >= 0 && x < HRes && y >= 0 && y < VRes)
           {
               loc = (y * (HRes >> 3)) + (x >> 3);
               mask = 1 << (x % 8); // get the bit position for this bit
               if (toggle)
               {
                   if (*p++ & 0xF0)
                   {
                       WriteBuf[loc] |= mask;
                   }
                   else if (blank == -1)
                   {
                       WriteBuf[loc] &= (~mask);
                   }
               }
               else
               {
                   if (*p & 0xF)
                   {
                       WriteBuf[loc] |= mask;
                   }
                   else if (blank == -1)
                   {
                       WriteBuf[loc] &= (~mask);
                   }
               }
               toggle = !toggle;
           }
           else
           {
               if (toggle)
                   p++;
               toggle = !toggle;
           }
       }
   }
}
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:29pm 20 Jan 2026
Copy link to clipboard 
Print this post

4) is it fixed when 1) is corrected as proposed?
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:36pm 20 Jan 2026
Copy link to clipboard 
Print this post

Version is 6.01.00 from current git main
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:43pm 20 Jan 2026
Copy link to clipboard 
Print this post

also the basic code should show why the two versions of collision tests are important.
see how I switch with mode1=1 and mode1=2 between
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10965
Posted: 12:48pm 20 Jan 2026
Copy link to clipboard 
Print this post

The extra code has blown the RAM on the RP2040 VGA versions of the code. This is because of the extra parameters in the sprite structure. I'll look at reworking it but may need to back it out for the release
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:51pm 20 Jan 2026
Copy link to clipboard 
Print this post

as mentioned I can do it also with a factor of two in calculation time.
and no additional memory costs.
but one question:
how to get temporary memory quick?
is it with GetMemory also?
there is also GetMemorySafe and the tempmemory version.
I could not figure out their proper usage,
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:53pm 20 Jan 2026
Copy link to clipboard 
Print this post

also the data could be usigned char instead of short but might break at higher resoltion
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 12:54pm 20 Jan 2026
Copy link to clipboard 
Print this post

it basically means calling getspritebounds on every spritecollision test
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 01:03pm 20 Jan 2026
Copy link to clipboard 
Print this post

Draw2.zip
I can send it to you in 30min...
Edited 2026-01-20 23:07 by ksinger
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 01:07pm 20 Jan 2026
Copy link to clipboard 
Print this post

here...
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10965
Posted: 01:23pm 20 Jan 2026
Copy link to clipboard 
Print this post

I'm working on it. I will make the whole sprite structure dynamically allocated. This is better as it will increase available memory for the programs (nearly all) that don't use sprites. I'm afraid the complexity of these versions of MMbasic make it very difficult for third parties to work on it effectively except in very circumscribed areas
Edited 2026-01-20 23:25 by matherp
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 01:58pm 20 Jan 2026
Copy link to clipboard 
Print this post

I have to say that the code is very good readable. Kind of my style. So when I was writing the blockout clone I had issues with the sprite that led me to the first fix. Also one issue you might easier fix: try: copy "b:file.txt" to "a:"
It answers after a long while with no space on disk. but when doing copy "b:file.txt" to "a:file.txt" works also copy "b:*" to "a:" works.
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 01:59pm 20 Jan 2026
Copy link to clipboard 
Print this post

this is due to the fact that the io code distinguishes between use of wildcard and non wildcard. and the non wildcard code does not accept "a:".
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 02:26pm 20 Jan 2026
Copy link to clipboard 
Print this post

as I could not test the code I backported my changes and then I could find some small syntax issues like missing paramters which is fixed in the attached file (the release candidate Draw.c file):
Draw3.zip
 
ksinger
Regular Member

Joined: 06/01/2026
Location: United Kingdom
Posts: 70
Posted: 02:34pm 20 Jan 2026
Copy link to clipboard 
Print this post

and    getspritebounds should be only called in fun_sprite of course
 
     Page 11 of 14    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026