Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 7 8 [9] 10
 81 
 on: August 10, 2021, 11:28:00 PM 
Started by xboxisfinished - Last post by SamuraiCrow
Wrong syntax.  Remove the varptr and the +2. Just pass the variable.  Sorry.

 82 
 on: August 10, 2021, 11:15:13 PM 
Started by xboxisfinished - Last post by xboxisfinished
This code is the issue:

Poke$(start(16)+offset),VarPtr(LevelGetCard$(Width,Height))+2

I cannot use VarPtr here and I removed it. Could this be the problem? Because if I put VarPtr it gives me syntax error. What advice do you have?

 83 
 on: August 10, 2021, 10:18:35 PM 
Started by xboxisfinished - Last post by xboxisfinished
I typed here wrong. it is add to start.

For C=Start(16) to Start(16)+Length(16)-2 Step 2

is what I have for both. It still does the same problem. I still get overflow. You are sure the code logic you gave me is correct? Can I send you my source code so you can check it out yourself?

 84 
 on: August 10, 2021, 10:11:23 PM 
Started by xboxisfinished - Last post by SamuraiCrow
I saw the bug right away.  The length should be added to the start.  Not subtracted.

 85 
 on: August 10, 2021, 09:05:58 PM 
Started by xboxisfinished - Last post by xboxisfinished
This is the code for loading:
Loading a level
Code: [Select]
Load Dir$+_PROJECTNAME$+"/"+_DEFAULTLEVELS$(_LEVELINDEX),16
For C=Start(16) to Start(16)-Length(16)-2 Step 2
  Doke C, Deek(C) xor $A55A
  Ror.w 5,C
Next C

For HEIGHT=0 To 49
  For WIDTH=0 to 49
    OFFSET=Leek(HEIGHT*49+WIDTH)*4+Start(16)
    LEVELGETCARD$(WIDTH,HEIGHT)=Peek$(12001+Start(16)+OFFSET, 32768,Chr$(0))
    LEVEL(WIDTH,HEIGHT)=Peek(Start(16)+9604+(49*HEIGHT+WIDTH))
  Next WIDTH
Next HEIGHT
Erase 16

Saving a level
Code: [Select]
For N=0 to _NUMOFLEVELS-1
  _DEFAULTLEVELS$(N)="level"+str$(N)
  _DEFAULTLEVELSPROPERTIES$(N)="level"+str$(N)+" Properties"

STRINGLENGTH=0
For HEIGHT=0 TO 49
  For WIDTH=0 TO 49
    LEVELGETCARD$(WIDTH,HEIGHT)=LEVELGETCARD$(WIDTH.HEIGHT)+Chr$(0)
    STRINGLENGTH=STRINGLENGTH+Len(LEVELGETCARD$(WIDTH,HEIGHT))
  Next WIDTH
Next Height

Reserve As Work 16, (STRINGLENGTH+12001+3) and Not 3
OFFSET=12001

For HEIGHT=0 TO 49
  For WIDTH=0 TO 49
    Poke$(Start(16)+OFFSET),(LEVELGETCARD$(WIDTH,HEIGHT))
    Loke Start(16)+(49+HEIGHT+WIDTH)*4, OFFSET
    OFFSET=OFFSET+Len(LEVELGETCARD$(WIDTH,HEIGHT))
    Poke Start(16)+(49*HEIGHT+WIDTH)+9604, LEVEL(WIDTH,HEIGHT)
  Next WIDTH
Next Height
For C=Start(16) To Start(16)+Length(16)-2 Step 2
   Rol.w 5,C
   Doke C,Peek(C) xor $A55A
Next C
Save Dir$+_PROJECTNAME$+"/"+_DEFAULTLEVELS$(N)
Erase 16
Next N

 86 
 on: August 10, 2021, 08:45:16 PM 
Started by xboxisfinished - Last post by xboxisfinished
The XOR line and the rotate line have to be in reverse order of each other in the encoder and decoder.

I will do this now...brb...when you said reverse what do you mean exactly?

ROL.W 5, C
Doke C, Deek(c) Xor $A55A

And the other loop should be:

Doke C, Deek(c) Xor $A55A
Ror.w 5, C

You mean like this
--------------------
Doke C, Deek(c) Xor $A55A
ROL.W 5, C


And the other loop should be:
Ror.w 5, C
Doke C, Deek(c) Xor $A55A

Reversing it..still gave an overflow. It is saving over 2 MB a file. Offset value is 784239096 that is too large.  What do you mean stringlength calculator?

 87 
 on: August 10, 2021, 07:38:42 PM 
Started by xboxisfinished - Last post by SamuraiCrow
What does the string length calculator look like?

 88 
 on: August 10, 2021, 07:24:51 PM 
Started by xboxisfinished - Last post by SamuraiCrow
I have thought of a different way to encode the strings to save 3 bytes per string just storing the length of each string instead of the address.  If the strings are too long it won't make much difference.  The idea that the file grew when making a new encoded file suggests that the strings are being read wrong from memory.

 89 
 on: August 10, 2021, 07:16:30 PM 
Started by xboxisfinished - Last post by SamuraiCrow
The XOR line and the rotate line have to be in reverse order of each other in the encoder and decoder. 

 90 
 on: August 10, 2021, 07:02:05 PM 
Started by xboxisfinished - Last post by xboxisfinished
It returned overflow again. It tried to read jibberish and it got value of over 10 digits and more to return....it failed. It still trying to read jibberish and place the jibberish into the actual array.

My Amiga does not have internet, but it is right beside the PC and both Amiga and PC use differen monitors side by side.I can look at the subroutine of your choice on the left and enter them here if you want. What are you looking for? The code you gave me? I entered 100% exactly as you have given me and I did remove the encryption/decryption code as requested.

However, I am ready for any orders you wish to give me.

Pages: 1 ... 7 8 [9] 10

TinyPortal 2.2.2 © 2005-2022