Shop OBEX P1 Docs P2 Docs Learn Events
PNut Memory allocation issues — Parallax Forums

PNut Memory allocation issues

ozpropdevozpropdev Posts: 2,793
edited 2013-09-06 00:49 in Propeller 2
Hi Guys

I am having a problem with Pnut handling memory allocation.
In my Invaders code I have most of my game data at the end of the code.
These are sorted in order of LONGS,WORDS and BYTES mainly for neatness.
My video buffer is "long aligned" for efficiency of the VGA driver.
The code only works if the video buffer is at the end of all the above stuff.
If I place it at the top of all the "longs" , the code fails.
It doesn't make any sense. The longs are still aligned Ok.
I have even tried padding the video buffer at both ends in case of some code bug, no change.
Chip, does your in-house Pnut have the facility to output ".LST" style compiler output for your own debugging?
As "Bender" in Futurama once said about dreaming of 1's and 0's...I think I saw a 2!
Any ideas?

Cheers
Brian

Comments

  • potatoheadpotatohead Posts: 10,261
    edited 2013-09-04 17:26
    Open it up and try CTRL+L
  • ozpropdevozpropdev Posts: 2,793
    edited 2013-09-04 17:34
    Tried that...That's why I'm really confused now...
  • cgraceycgracey Posts: 14,206
    edited 2013-09-04 18:19
    I will post the latest PNUT.exe tonight. In it, you can do CTRL-M to make a listing of a PASM program. CTRL-L requires there to be a PUB declaration. To get CTRL-L to work with your current PNUT.exe, put 'PUB BLA' at the front of your program. It will cause a 4-byte offset of your program, plus some bytes to be generated.
  • ozpropdevozpropdev Posts: 2,793
    edited 2013-09-04 20:11
    cgracey wrote: »
    I will post the latest PNUT.exe tonight. .

    Thanks Chip. That will be very useful!

    Cheers
    Brian
  • cgraceycgracey Posts: 14,206
    edited 2013-09-04 20:24
    Brian,

    Here's the latest PNut.exe in a zip file:

    PNut.zip

    You'll want to use F11 to compile and download PASM programs. To view a list file, use CTRL-M to toggle back and forth.
    PNut.zip 323.4K
  • ozpropdevozpropdev Posts: 2,793
    edited 2013-09-04 21:44
    Thanks Chip!
    I solved my memory allocation issue. It turned out to be a defective me all along!
    Cheers
    Brian
  • JRetSapDoogJRetSapDoog Posts: 954
    edited 2013-09-04 23:27
    Ha! "a defective me," that's funny. You're anything but "defective," though. Maybe momentarily out-of-order (compared to those of us who are often down for the count). Anyway, I'm glad you resolved things. And congrats on making Chip's slideshow presentation! Wonder if anyone has a video of your Space Invaders in action (yeah, I know, wrong thread). Of course, it's not too difficult to imagine if one's played the game, but with real silicon hopefully fast-approaching, it'd be great to see and inspiring for those of us without dev boards. Anyway, in due time we can run it on real chips, I guess (maybe Parallax can run it on test samples within the week). Still, amazing stuff in one cog (on an amazing chip). I've noticed that the Force is strong down under in Australia. What do you folks put in the water there! ** UPDATE ** See Brian's Space Invaders thread for a video of his one-cog Space Invaders in action that he kindly posted (Pg. 2, Post #39).
  • ozpropdevozpropdev Posts: 2,793
    edited 2013-09-06 00:49
    I'm running FTB DireWolf 20 on Far, Fancy, and with a 128x TP (with Optifine installed). I get about 60FPS on average, but after I've been playing a while, I get lag spikes every 10 seconds or so that last about 1 second each where I only get 2-3FPS.

    ??? I think you have the wrong forum ???
Sign In or Register to comment.