Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pp256 image index maker help
#1
i'm trying to port over pp256's image indexer sub to fb. (all that was needed was ptr& to be changed to something else) the program compiles fine, but during runtime the program crashes when makeimageindex is called.



Code:
SUB makeimageindex (imagearray(), IndexArray())
DIM Temp(1 TO 1000)

Ptr2& = 0: IndexNo = 1: LastInt = UBOUND(imagearray)

DO
Temp(IndexNo) = Ptr2&
IndexNo = IndexNo + 1

x& = (imagearray(Ptr2&) \ 8) * (imagearray(Ptr2& + 1)) + 4
IF x& MOD 2 THEN x& = x& + 1
Ptr2& = Ptr2& + (x& \ 2)



LOOP WHILE Ptr2& < LastInt

LastImage = IndexNo - 1
REDIM IndexArray(1 TO LastImage)

FOR N = 1 TO LastImage

IndexArray(N) = Temp(N)
NEXT N

end sub

i couldn't get it working so i tried making my own routine based off of that one..

Code:
sub makeindex (imagearray(), indexarray())
  
dim temparray(1 to 1000) as integer

lastint = ubound(imagearray)
do
   x = imagearray(arraysize&) \ 8
   y = imagearray(arraysize& + 1)
   temparray(listimages + 1) = lastarray&
   arraysize& = x * y
   if arraysize& mod 2 then arraysize& = arraysize& + 1
   arraysize& = arraysize& \ 2
   lastarray& = lastarray& + arraysize&
  
   listimages = listimages + 1

loop until lastint <= lastarray&

listimages = listimages - 1
redim indexarray(1 to listimages)

for x = 1 to listimages
   indexarray(x) = temparray(x)
next

end sub

i get the same problem.

during runtime, it tells me that memory could not be read. any help is appreciated!

p.s. i also had to make another change... i couldn't save pp256 images the way they are usually stored in arrays (starting at tiles(1)... the image doesn't display right.) so it starts at tiles(0) instead. that's another change i included in the routines.
Jumping Jahoolipers!
Reply
#2
Mine worked fine. I just changed some integers to ushorts. ;*)

Ie: change the integers to ushorts if they read from the file.

;*)
Hell, you can just change everything to ushorts and it should work fine.

I could send mine to you but it's in my sis' comp:*(
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#3
Thanks rel!

Ushort... I shoulda known. :lol: Anyways, I'll try it out, and see what i get.

edit: hmm... it doesn't seem to work for me. Yeah, if you could send me what you got, it'd be appreciated. thanks rel!
Jumping Jahoolipers!
Reply
#4
To Richard Eric M. Lope (Relsoft):

I agree with Barok. I also have been having the *exact* same problem with getting the many PP256 tiles to work ( Cry ), just the same (or close to that) as he said from his most recent reply in this thread, even with the “Ushort” parameters set and all, too! Right now, I just started work on getting the individual map-based tiles to work for Frantic Journey on FreeBASIC, and my man, I need those PP256 tiles to work in FB indeed as they are critically essential for the getting the maps to work directly there just like they did for QB.

Look, if you can indeed place your FB code to show me and Barok how to properly (and even successfully) work the PP256 sprites/tiles right through the use of a filename, then I would really appreciate it, man! Big Grin You know, I could use all the help I can get for this important project here, too.

I thank you again, Eric, and be seeing you.



[Image: file.php?id=32]
- Adigun Azikiwe Polack
One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
Original Creator of the “The New FreeBASIC 8-Bit Palette Machine”
url=http://dhost.hopto.org/aapproj/][Image: file.php?id=194][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!! Big Grin !
Reply
#5
Sorry, I wasn't able to be on a computer lately. I might have time tomorrow. :*)
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#6
You guys know about the conversion program Adosorken made, dont you?


Here's the topic...
http://fbtk.qbtk.com/phpBB2/viewtopic.ph...&highlight=



And here's the direct download link...
http://fbtk.qbtk.com/phpBB2/download.php?id=8


Wink
Reply
#7
To Dr_Davenstein:

Oh man, that’s right! I remember that one. It was called Advance.PUT, and I have that wonderful program already, man. Big Grin

You know, I might wanna think on using that very proggie indeed as an alternative in case I find out that the PP256 sprites and tiles do not work directly from the next time Rel places his PP256 loading code for FB with which to load the stuff from a file. But hey, ANYTHING is worth a shot, including that thing you just pointed out, Dr_Davenstein, you know that? Cool

As *another* alternative, I might be planning on using Allegro game lib for FB to work on the coding of Frantic Journey anew, but we shall see together now. We shall see.

Thank you so much now, man, and once again, anything is worth such a shot indeed. :king: Be seeing you later.



[Image: file.php?id=32]
- Adigun Azikiwe Polack
One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
Original Creator of the “The New FreeBASIC 8-Bit Palette Machine”
url=http://dhost.hopto.org/aapproj/][Image: file.php?id=194][/url]
Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!! Big Grin !
Reply
#8
yeah, but I'd prefer not to have to load up every single tile individually. I'd prefer a single file, like how pptts does. Unfortunately, when it's loaded, it's one big chunk, kinda useless for my needs. No, my problem isn't in the format it's in, but in making an index maker, which i can't seem to fix. I can load up both .put and .bmp just fine, but my problem lies in indexing the images.
Jumping Jahoolipers!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)