Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 03:00 27 Mar 2025 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 VGA :just a little test

     Page 2 of 2    
Author Message
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 06:16pm 17 Feb 2025
Copy link to clipboard 
Print this post

  Volhout said  The 2040 cannot do mp3.
Thats why I wrote "Pico2"
Edited 2025-02-18 04:57 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 11:56am 24 Feb 2025
Copy link to clipboard 
Print this post

Hi Martin,

The issue with Kong on 6.00.02b11 is most likely the sheer size of the heap/free RAM.
I wrote a simple "play modfile, play stop, play flac" and printed heap size.
You can clearly see that 6.00.02 has 4kbyte less heap.
And AFAIK, there is no memory leak, memory is returened with PLAY STOP.

v5.09.00rc5
> RUN
101632   heap
76800    play mod
101632   play stop
58368    play flac
101632   play stop
76800    play mod
58368    play stop:play flac

v6.00.02b11
RUN
97536 4kbyte Heap less
72704
97536
54272
97536
72704
54272


That is also shown if you type "memory" in both PicoMite versions (124k versus 128k RAM).

That should at explain why Kong does not run on 6.00.02.
Playing FLAC uses 42kbyte heap
Playing MOD uses 24kbyte heap

So playing FLAC may not be the best option here. Is there any way you can convert the FLAC to MOD ?

Volhout

EDIT: so PLAY FLAC combined with FRAMEBUFFER L uses 80kbyte RAM/heap of 97 available in 6.00.02b11. Only thing to become more efficient is use fewer strings, fewer arrays (these eat heap) and use more normal variables (are in the 28k reserved RAM area, not heap).
Edited 2025-02-25 01:17 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 08:10pm 24 Feb 2025
Copy link to clipboard 
Print this post

Martin,

I can also confirm there is no memory leak with sprite write, an sprite read. Also mirroring does not change heap level.
So it is pure heap size that has been 4kbyte les in 6.00.02.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 08:25pm 24 Feb 2025
Copy link to clipboard 
Print this post

  Volhout said  
So playing FLAC may not be the best option here. Is there any way you can convert the FLAC to MOD ?

No, just recreating the "song" to a new MOD
So I have to try to replay the original melody exactly in time.The problem only seems to occur with the last song (Endgame).
'no comment
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 10:21am 26 Feb 2025
Copy link to clipboard 
Print this post

Harm,
I splitted the Endgame flac in two parts, So heap should work now.
Please test
Cheers
Martin

Kong.zip
'no comment
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9796
Posted: 10:57am 26 Feb 2025
Copy link to clipboard 
Print this post

  Quote  I splitted the Endgame flac in two parts,

The size of the flac file has no impact on memory usage
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 11:21am 26 Feb 2025
Copy link to clipboard 
Print this post

  matherp said  The size of the flac file has no impact on memory usage

Thank you,
I just tested it on the beta just released Pico2 HDMI Firmware without issues.
So even if it doesn't help, it doesn't hurt either
Edited 2025-02-26 21:22 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 06:25am 27 Feb 2025
Copy link to clipboard 
Print this post

Cannot test, currently traveling.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 12:23pm 01 Mar 2025
Copy link to clipboard 
Print this post

Kong_h03.zip
Martin,

Using b14 on 2040 VGA/PS2, this is (very very pre-mature) mario walking/climbing, control from arrow keys.
Jumping left/right with control-arrow.
I use option keyboard us,0,0,0,0 for a bit of smooth movement.

Now I have to dig through your code to find coordinates of ramps/ladders/objects, so I know when to fall/die.

And then try to compact the code (a lot is copy/paste, and could be combined).

Volhout
Edited 2025-03-01 22:24 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 02:28pm 01 Mar 2025
Copy link to clipboard 
Print this post

  Volhout said  Kong_h03.zip
Martin,

Using b14 on 2040 VGA/PS2, this is (very very pre-mature) mario walking/climbing, control from arrow keys.
Jumping left/right with control-arrow.
I use option keyboard us,0,0,0,0 for a bit of smooth movement.

Now I have to dig through your code to find coordinates of ramps/ladders/objects, so I know when to fall/die.

And then try to compact the code (a lot is copy/paste, and could be combined).

Volhout

Volhout
The Board for every Level is stored at the brd(x/8,y/8) array,this help to see the ramps/ladders and also help the barrels to deside to take the ladder( not jet implemented). The slightly slanted platforms are only in the 1st board.
I added Sound to the movement

Kong_h03a.zip

Thank you
Cheers Martin
Edited 2025-03-02 01:08 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 05:15pm 01 Mar 2025
Copy link to clipboard 
Print this post

Martin,

I guess the best way to implement movement is fixed sequences, agreed .? So a single left arrow uses a sequence of 2 sprites, and moves 8 pixels(the game grid).And a single jump button press starts a sequence of 8 sprite moves and goes 32 pixels. So no stopping the sequence halfway, only with a collision.

Agree.

Volhout
Edited 2025-03-02 03:16 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 06:37pm 01 Mar 2025
Copy link to clipboard 
Print this post

Agree
Very good suggestion, especially when a character jumps,
Similarly (not yet real implemented), a status is also missing, “Kong throws the barrel or the barrel is thrown” which also lasts for minimum 3 states in the loop passes.

Depending on the level, we have different sprites that behave differently. My idea was that we set a maximum number of sprites (8 to 10) on the screen at the same time. In the original game, you can see that barrels that are below Mario leave the level to the side and don't roll all the way down, for the same reason.
All the sprites shown are moved in a loop and their type determines their movement.
I then have to find out how often Mario is called compared to the other sprites in order to make the game “fair”

Thank you for your support
Cheers
Martin
Edited 2025-03-02 04:44 by Martin H.
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 11:09am 02 Mar 2025
Copy link to clipboard 
Print this post

Martin,

These are the basic movements in fixed sequences.
Press arrow keys, and space to jump (jump in walking direction).
Next I will look into integrating this onto the game field you created.
I am using individual variables as much as possible (no arrays) to avoid heap usage,

Regards,

Volhout

Kong_h04.zip
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 03:02pm 02 Mar 2025
Copy link to clipboard 
Print this post

looks nice,
for the movement on the first board, the Mario y movement is unfortunately not exactly on the 8 Picel grid. More like the y calculation for the barrels.
 'fall down at the end of plank?
 Do
   If Pixel(6+bx*4,by+10)=0 Then
     Inc By
   Else
     Exit Do
   End If
 Loop
a scan takes place here to determine when there is no longer a black pixel under the sprite
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 07:43am 04 Mar 2025
Copy link to clipboard 
Print this post

Martin,

Just a heads-up.

I have Mario walking the 1'st level. Do not change the colors used on the ramps since these are used for Mario's position. The only observation so far is that the ladders are off-grid (8 x 8px). But actually, that is kind of funny. You climb the ladder off-centre.

Next is collision detection with the barrels.
After that Mario falling down. And Mario climbing from ladder to ramp (sprites ani).
And maybe a "jump-up" to cross broken ladders.

What do you want with the oil barrel (fire). Should Mario walk in front of it, or should this be a road block ?

Volhout
Edited 2025-03-04 17:44 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 11:29am 04 Mar 2025
Copy link to clipboard 
Print this post

  Quote  I have Mario walking the 1'st level. Do not change the colors used on the ramps since these are used for Mario's position. The only observation so far is that the ladders are off-grid (8 x 8px). But actually, that is kind of funny. You climb the ladder off-centre.

Sounds good
  Quote  
And maybe a "jump-up" to cross broken ladders.
that schouldn't be possible. so Barrels can roll down a broken ladder but Mario can't climb the broken ladder, just up to the gab.
  Quote  hat do you want with the oil barrel (fire). Should Mario walk in front of it, or should this be a road block ?

you can Play the arcade Version online.. here Mario can run behind the oil barrel.
I also found other online versions (reprogrammed), where Mario moves in Front of it
So I don't think it makes any difference to the gameplay.
cheers
Martin
'no comment
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4715
Posted: 09:01pm 11 Mar 2025
Copy link to clipboard 
Print this post

Hi Martin,

Still a lot to do, but level 1, Mario can reach the top if you are fast.
You can climb ladders, avoid barrels (jump with space, -or- wait standing halfway a ladder). This level the "falls" are so small I did not want to kill Mario over it. You may disagree.
It was quite a fight to work with these ramps, moving Mario up and down pixels)

To do: a nice death, and start with new life if any left.
To do: once you reach the top...what then...
To do: the game is too short, barrels run out to fast.
To do: animate Kong to throw barrels....
To do: barrel stack get's lower
To do: damsel in distress must cry for help....

Well, the next level will have transport belts, so Mario must move left-right in pixels. New challenge.

Have fun..

Volhout

Kong_h06_bf.zip


P.S. took quite a while to find out that the barrels Y coordinate is in pixels, and the x coordinate in pixels*4.



EDIT: updated bugfix
.
.
Edited 2025-03-12 17:42 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1173
Posted: 09:44am 14 Mar 2025
Copy link to clipboard 
Print this post

I love it  
  Quote  To do: once you reach the top...what then...

show the Heart above between Mario and Peach.
Play Stop: Play flac "audio/finish-board.flac", Pause 2 Seconds

delete peach, replace the Heart with the broken Heart then use the Kong climb animation to move Kong and Peach out of the screen.

  Quote  To do: a nice death, and start with new life if any left.

the Animation of Mario rotating is Sprite 8 9 10 11



ps:I miss the Fall sound (finish-level.flac) at the end screen
Edited 2025-03-14 20:00 by Martin H.
'no comment
 
     Page 2 of 2    
Print this page


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

© JAQ Software 2025