|
Forum Index : Microcontroller and PC projects : PicoMite V6.02.00 release candidates - Structured types
| Author | Message | ||||
| ksinger Regular Member Joined: 06/01/2026 Location: United KingdomPosts: 70 |
but true the lengths are wrong. |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
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 KingdomPosts: 70 |
fix 1 is good |
||||
| ksinger Regular Member Joined: 06/01/2026 Location: United KingdomPosts: 70 |
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 KingdomPosts: 70 |
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 KingdomPosts: 70 |
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 KingdomPosts: 70 |
4) is it fixed when 1) is corrected as proposed? |
||||
| ksinger Regular Member Joined: 06/01/2026 Location: United KingdomPosts: 70 |
Version is 6.01.00 from current git main |
||||
| ksinger Regular Member Joined: 06/01/2026 Location: United KingdomPosts: 70 |
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 KingdomPosts: 10965 |
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 KingdomPosts: 70 |
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 KingdomPosts: 70 |
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 KingdomPosts: 70 |
it basically means calling getspritebounds on every spritecollision test |
||||
| ksinger Regular Member Joined: 06/01/2026 Location: United KingdomPosts: 70 |
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 KingdomPosts: 70 |
here... |
||||
| matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 10965 |
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 KingdomPosts: 70 |
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 KingdomPosts: 70 |
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 KingdomPosts: 70 |
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 KingdomPosts: 70 |
and getspritebounds should be only called in fun_sprite of course |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |