Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]   Go Down

Author Topic: How to use Bank and combine it with an array?  (Read 11066 times)

0 Members and 1 Guest are viewing this topic.

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: How to use Bank and combine it with an array?
« Reply #15 on: October 25, 2013, 03:19:25 PM »

My mistake....I fixed the problem with displaying the value. I needed to put wait 100 underneath Doke X print out to see the result so far...there is just one bug...and that bug is the displaying the Y value if I am going from up to down or down to up with the dot selections. But if I am doing the dots from left to right or right to left the value results are 100% correct :D I am almost done here!

I am noticing when I am going from up to down or down to up there is an 8 point difference in the Y coordinate when it is stored in the bank for some reason.

While I am at it...I have done checking for the X1, Y1 as well and it always displays the value of Y1 instead of X1 and Y1 I do not know why on that part.

Finally, when I close the program I see that it puts everything in CHIP RAM...how can I force the program to bang all these variables and changes into FAST RAM? I want CHIP RAM to be only and only for graphics, sound and music and nothing else...I want to put all the mathematical calculation...I want to put all the arrays and customized structures..and everything else into FAST RAM only. In fact...I want pretty much the entire execution of the program on the FAST RAM leaving CHIP RAM completely free of all responsibilities except when I put Bob or sound or music then chip RAM will go down based on the graphics and audio and everything else all into FAST RAM.

I have attached the latest code here
« Last Edit: October 25, 2013, 04:03:25 PM by xboxisfinished »
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: How to use Bank and combine it with an array?
« Reply #16 on: October 26, 2013, 06:30:50 PM »

The AMCAF extension has a "Bank To Fast" command, but be sure to check if there is sufficient Fast RAM available before moving stuff there.

Also, your bank handling code is still mixed up.  You have BOARDX and BOARDY pointing to the same memory location and the header only big enough for one of them.
« Last Edit: October 26, 2013, 06:34:53 PM by SamuraiCrow »
Logged

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: How to use Bank and combine it with an array?
« Reply #17 on: October 27, 2013, 03:09:42 AM »

I do not understand what you mean by my boardx and boardy are pointing to the same memory location...in fact...why do I even need boardx and boardy? I do not get it. Why do I even need it all together? And you said they are pointing at the same memory location...isn't boardx=0 and boardy=1 two different values all together?

Ok.....by the way I still do not get how is this effect the last bit of problem I have? It seems it is almost finished and almost done except for two little bugs. One bug is when I am clicking the second dot underneath or top of the first dot click then the value returns with difference of 8.

The second problem I have is in the X1, Y1 of the ItemLoc+9 of the boardarray.

When I do peek X1 and Y1 it returns the value of Y1 (correctly) but put values of Y1 for X1 and Y1 variables instead of returning the value of X1 to X1 and Y1 to Y1? Are you telling me the reason behind that is because I am pointing to wrong memory location? Can you please show me how to point to different memory location and where exactly is the correct memory location I need to point. Because I do not know where their memory location are and I might actually point to a wrong location and cause a guru.
« Last Edit: October 27, 2013, 03:11:59 AM by xboxisfinished »
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: How to use Bank and combine it with an array?
« Reply #18 on: October 28, 2013, 07:12:47 PM »

I'll go down through the listing line-by-line.

Code: [Select]
' flag indicating a valid hit 
Set Buffer 256
Set Sprite Buffer 128
'On Error Goto LOWCHIPRAM

Global FH,RIGHT,LEFT,UP,BOTTOM,SELECTED,LGTH,CLICKED,CLICKEDX1,CLICKEDY1
Global LOCKED,CENTERCLICKEDX1,CENTERCLICKEDY1,LOCKEDRIGHT,LOCKEDLEFT,LOCKEDUP,LOCKEDDOWN
Global LASTDIRECTION
LOCKEDRIGHT=False : LOCKEDDOWN=False : LOCKEDLEFT=False : LOCKEDUP=False
' Turn=1 is for player 1 color red, Turn=2 is for player 2 color blue
Global TURN
Global BOARDX,BOARDY,BOARDHEADER,BOARDSTEPS,OFFSETX1,OFFSETY1,OFFSETX2,OFFSETY2
BOARDX=0 : BOARDY=0 : BOARDHEADER=2 : BOARDSTEPS=5 : BOARD=BOARDHEADER+(32*21*BOARDSTEPS)
Here are your first couple of errors.  BOARDY should be 1.  If BOARDSTEPS=5, you can't use offsets greater than 4 so you'll have to either make the other value stored separately in an array or increase BOARDSTEPS and use a new offset there.
Code: [Select]
Reserve As Work 15,BOARD
Poke Start(15)+BOARDX,32
Poke Start(15)+BOARDY,21

' Reset the values

LOCKED=False
' Countdown timer for the "Invalid Action!" display

' Hide everything until we have finished drawing:
Auto View Off
Screen Open 0,320,200,64,Lowres
Curs Off
Flash Off : Hide On : Rem Hide mouse pointer
Colour 0,$0
Colour 1,$FFF
Colour 2,$F00
'Colour 3,$FF0
'Colour 4,$FFF
Inverse Off
RIGHT=78 : UP=76 : BOTTOM=77 : LEFT=79 : SELECTED=0
' This colour represents your back IFF pic, just do not use
' colours 0 through 2 in the picture!
Cls 0
CLICKED=True
' Center your rectangular play area:
Global XO
XO=(320-256)/2
EC=35 : F=0 : LGTH=0 : ICOUNTER=0
Proc SETBOARD

Auto View On

DC=-1
'Proc _MISS["All results are suuccessful."]
FD=True : Rem flag for First Dot hit
SELECTEDX1=100
Screen Show 0
Load "dh0:linesformed.abk"
Get Bob Palette $0
Repeat
  If Ntsc=0 : Exit : End If
  Proc _MISS["?NTSC COMMODORE NOT SUPPORTED! REGION ERROR!"]
Until Ntsc=0

Repeat
   Wait Vbl
   MC=Mouse Click

   K$=Inkey$
   SELECTED=Scancode

If Not LOCKED
   CLICKEDMAXX1=280 : CLICKEDMAXY1=4
   CLICKEDMAXX2=36 : CLICKEDMAXY2=158
Else If LOCKED
   If CENTERCLICKEDX1=CLICKEDX1 and CENTERCLICKEDY1=CLICKEDY1
      If FINISHED1=0 : CLICKEDMAXX1=(CENTERCLICKEDX1+2) : FINISHED1=1 : End If
      If FINISHED2=0 : CLICKEDMAXX2=(CENTERCLICKEDX1-2) : FINISHED2=1 : End If
      If FINISHED3=0 : CLICKEDMAXY1=(CENTERCLICKEDY1-2) : FINISHED3=1 : End If
      If FINISHED4=0 : CLICKEDMAXY2=(CENTERCLICKEDY1+2) : FINISHED4=1 : End If
      LOCKEDDOWN=False : LOCKEDUP=False : LOCKEDLEFT=False : LOCKEDRIGHT=False
 Else
   If LASTDIRECTION=RIGHT
     LOCKEDDOWN=True : LOCKEDUP=True
   End If

   If LASTDIRECTION=LEFT
     LOCKEDDOWN=True : LOCKEDUP=True
   End If

   If LASTDIRECTION=UP
     LOCKEDRIGHT=True : LOCKEDLEFT=True
   End If

   If LASTDIRECTION=BOTTOM
     LOCKEDLEFT=True : LOCKEDRIGHT=True
   End If
 End If
End If
   If CLICKEDX1<CLICKEDMAXX1
      If SELECTED=RIGHT and LOCKEDRIGHT=False and SELECTED<>UP and SELECTED<>BOTTOM and SELECTED<>LEFT
            Inc RIGHTINC
            LASTDIRECTION=RIGHT
         If Point(RIGHTINC*8+4+XO,UPINC*8+4)<>2
            Proc _MOVE_NEXT_STEP[RIGHTINC,UPINC,XO]
            ITISOKTOCLEAR=0
         Else If ITISOKTOCLEAR=0

            ITISOKTOCLEAR=1
            Ink 1
            X1=(RIGHTINC-1)*8+4+XO
            Y1=UPINC*8+4
            CENTERCLICKEDX1=X1 : CENTERCLICKEDY1=Y1
            Bar X1-1,Y1-1 To X1+1,Y1+1
         End If
      End If
   End If

   If CLICKEDX1>CLICKEDMAXX2
      If SELECTED=LEFT and LOCKEDLEFT=False and SELECTED<>RIGHT and SELECTED<>BOTTOM and SELECTED<>UP
         Dec RIGHTINC
         LASTDIRECTION=LEFT
      If Point((RIGHTINC*8+4+XO),UPINC*8+4)<>2
         _MOVE_NEXT_STEP[RIGHTINC,UPINC,XO]
         ITISOKTOCLEAR=0
       Else If ITISOKTOCLEAR=0

         ITISOKTOCLEAR=1
         Ink 1
         X1=(RIGHTINC+1)*8+4+XO
         Y1=UPINC*8+4
         CENTERCLICKEDX1=X1 : CENTERCLICKEDY1=Y1
         Bar X1-1,Y1-1 To X1+1,Y1+1
      End If
     End If
   End If

If CLICKEDY1>CLICKEDMAXY1
   If SELECTED=UP and LOCKEDUP=False and SELECTED<>BOTTOM and SELECTED<>LEFT and SELECTED<>RIGHT
       Dec UPINC
       LASTDIRECTION=UP
       If Point((RIGHTINC*8+4+XO),UPINC*8+4)<>2
         _MOVE_NEXT_STEP[RIGHTINC,UPINC,XO]
         ITISOKTOCLEAR=0
       Else If ITISOKTOCLEAR=0

         ITISOKTOCLEAR=1
         Ink 1
         X1=RIGHTINC*8+4+XO
         Y1=(UPINC+1)*8+4
         Bar X1-1,Y1-1 To X1+1,Y1+1
         CENTERCLICKEDX1=X1 : CENTERCLICKEDY1=Y1
      End If
   End If
End If

If CLICKEDY1<CLICKEDMAXY2
   If SELECTED=BOTTOM and LOCKEDDOWN=False and SELECTED<>UP and SELECTED<>RIGHT and SELECTED<>LEFT
       Inc UPINC
       LASTDIRECTION=BOTTOM
       If Point((RIGHTINC*8+4+XO),UPINC*8+4)<>2
         _MOVE_NEXT_STEP[RIGHTINC,UPINC,XO]
         ITISOKTOCLEAR=0
       Else If ITISOKTOCLEAR=0

         ITISOKTOCLEAR=1
         Ink 1
         X1=RIGHTINC*8+4+XO
         Y1=(UPINC-1)*8+4
         Bar X1-1,Y1-1 To X1+1,Y1+1
         CENTERCLICKEDX1=X1 : CENTERCLICKEDY1=Y1
      End If
   End If
End If
   If SELECTED=64
      Proc CLICKED[RIGHTINC,UPINC,XO]
   End If
   ' Simple right-click to exit for this demo:
   '
Until MC=%10
End

Procedure CLICKED[X,Y,XO]
Shared CLICKED,PLYRCOLOR,CENTERCLICKEDX1,CENTERCLICKEDY1
Shared LOCKED,FINISHED,FINISHED1,FINISHED2,FINISHED3,FINISHED4
Shared LOCKEDUP,LOCKEDDOWN,LOCKEDLEFT,LOCKEDRIGHT
Shared BOARDSTEPS,BOARDX,BOARDY,BOARD,OFFSETX1,OFFSETY1,OFFSETX2,OFFSETY2
If CLICKED
   If LOCKED=True
     LOCKED=False : FINISHED1=0 : FINISHED=0 : FINISHED2=0 : FINISHED3=0 : FINISHED4=0
     LOCKEDUP=False : LOCKEDDOWN=False : LOCKEDRIGHT=False : LOCKEDLEFT=False
        If Point(X,Y)<>2
           Ink 2
           X1=X*8+4+XO
           Y1=Y*8+4
           Bar X1-1,Y1-1 To X1+1,Y1+1
        End If

       ' Before we perform the final and last step of release the player
       ' to plot two more dots we will see if two lines can be formed here
       For YCOUNTER=0 To 21
         For XCOUNTER=0 To 32
            Def Fn BOARDARRAY(X,Y,BANKNUM)=BOARDHEADER+((X+Y*(Peek(Start(BANKNUM)))*BOARDSTEPS))
            ITEMLOC= Fn BOARDARRAY(XCOUNTER,YCOUNTER,15)
            If Peek(ITEMLOC+9)=0
If boardsteps is less than 10 you can't use ITEMLOC+9.
Code: [Select]
               Locate 20,20 : Print "                          "
               Doke ITEMLOC+OFFSETX1,CENTERCLICKEDX1
If you use Doke instead of Poke, you have to use values OFFSETX1 that are even.  Where is OFFSETX1 defined?  I see that it is allocated as a global but I don't see where the value is set.  If it isn't given a value, Amos will just use 0 for everything.  This includes all of the field names of the custom type.
Code: [Select]
               Locate 20,20 : Print "CtrClickedX1"+Str$(CENTERCLICKEDX1)
               Wait 100
               Locate 20,20 : Print "                            "
               Locate 20,20 : Print "Deek X:"+Str$(Deek( Fn BOARDARRAY(XCOUNTER,YCOUNTER,15)+OFFSETX1))
               Wait 100
               Doke ITEMLOC+OFFSETY1,CENTERCLICKEDY1
               Locate 20,20 : Print "                             "
               Locate 20,20 : Print "CtrlickedY1"+Str$(CENTERCLICKEDY1) : Wait 100
               Doke ITEMLOC+OFFSETX2,X1
               Doke ITEMLOC+OFFSETY2,Y1

               Locate 20,20 : Print "                            "
               Locate 20,20 : Print "Deek Y:"+Str$(Deek( Fn BOARDARRAY(XCOUNTER,YCOUNTER,15)+OFFSETY1))
               Wait 100 : Locate 20,20 : Print "                              "
               Locate 20,20 : Print "X1 "+Str$(X1)+" Y1 "+Str$(Y1)
               Wait 100
               Locate 20,20 : Print "                             "
               Locate 20,20 : Print "Deek X1:"+Str$(Deek( Fn BOARDARRAY(XCOUNTER,YCOUNTER,15)+OFFSETX2))+" Deek Y1 "+Str$(Deek( Fn BOARDARRAY(XCOUNTER,YCOUNTER,15)+OFFSETY2))+""
               LOCKED=False
               Goto SKIPPED : End If
         Next XCOUNTER
      Next YCOUNTER
   End If

   Ink 2
   If Point(X,Y)<>2
      X1=X*8+4+XO
      Y1=Y*8+4
      Bar X1-1,Y1-1 To X1+1,Y1+1
      LOCKED=True : CENTERCLICKEDX1=X1 : CENTERCLICKEDY1=Y1
   End If
SKIPPED:
Else
   Proc _MISS["Invalid action!"]
End If
End Proc

Procedure _MOVE_NEXT_STEP[X,Y,XO]
   ' Move at the new location specificed
   Shared SELECTED,RIGHT,LEFT,UP,BOTTOM,CLICKEDX1,CLICKEDY1
   EIGHT=8 : FOUR=4 : NUMBERONE=1
If SELECTED=RIGHT and SELECTED<>LEFT and SELECTED<>UP and SELECTED<>BOTTOM
   Ink 7
   X3=X*EIGHT+FOUR+XO
   Y3=Y*EIGHT+FOUR
   CLICKEDX1=X3 : CLICKEDY1=Y3
   Bar X3-NUMBERONE,Y3-NUMBERONE To X3+NUMBERONE,Y3+NUMBERONE
   Proc _CLEARRIGHT[XO,X,Y]
End If

If SELECTED=UP and SELECTED<>RIGHT and SELECTED<>LEFT and SELECTED<>BOTTOM
   Ink 7
   X3=X*EIGHT+FOUR+XO
   Y3=Y*EIGHT+FOUR
   Bar X3-NUMBERONE,Y3-NUMBERONE To X3+NUMBERONE,Y3+NUMBERONE
   ' Clear the old location all together
   CLICKEDX1=X3 : CLICKEDY1=Y3
   Proc _CLEARUP[XO,X,Y]
End If

If SELECTED=LEFT and SELECTED<>RIGHT and SELECTED<>BOTTOM and SELECTED<>UP
   Ink 7
   X3=X*EIGHT+FOUR+XO
   Y3=Y*EIGHT+FOUR
   Bar X3-NUMBERONE,Y3-NUMBERONE To X3+NUMBERONE,Y3+NUMBERONE
   ' Clear the old location all together
   CLICKEDX1=X3 : CLICKEDY1=Y3
   Proc _CLEARLEFT[XO,X,Y]
End If

If SELECTED=BOTTOM and SELECTED<>UP and SELECTED<>LEFT and SELECTED<>RIGHT
   Ink 7
   X3=X*EIGHT+FOUR+XO
   Y3=Y*EIGHT+FOUR
   Bar X3-NUMBERONE,Y3-NUMBERONE To X3+NUMBERONE,Y3+NUMBERONE
   CLICKEDX1=X3 : CLICKEDY1=Y3
   ' Clear the old location all together
   Proc _CLEARBOTTOM[XO,X,Y]
End If
SELECTEDX1=X3 : SELECTEDY1=Y3

End Proc

Procedure _CLEARRIGHT[XO,X,Y]
   Shared CLICKEDX1,CLICKEDY1
   If Point(CLICKEDX1-8,CLICKEDY1)<>2
      Ink 1
      X=X-1
      X1=X*8+4+XO
      Y1=Y*8+4
      Bar X1-1,Y1-1 To X1+1,Y1+1
   End If
End Proc

Procedure _CLEARLEFT[XO,X,Y]
   Shared CLICKEDX1,CLICKEDY1
   If Point(CLICKEDX1+8,CLICKEDY1)<>2
      Ink 1
      X=X+1
      X1=X*8+4+XO
      Y1=Y*8+4
      Bar X1-1,Y1-1 To X1+1,Y1+1
   End If
End Proc

Procedure _CLEARBOTTOM[XO,X,Y]
   Shared CLICKEDX1,CLICKEDY1
   If Point(CLICKEDX1,CLICKEDY1-8)<>2
      Ink 1
      Y=Y-1
      X1=X*8+4+XO
      Y1=Y*8+4
      Bar X1-1,Y1-1 To X1+1,Y1+1

   End If
End Proc

Procedure _CLEARUP[XO,X,Y]
   Shared CLICKEDX1,CLICKEDY1
   If Point(CLICKEDX1,CLICKEDY1+8)<>2
      Ink 1
      Y=Y+1
      X1=X*8+4+XO
      Y1=Y*8+4
      Bar X1-1,Y1-1 To X1+1,Y1+1
   End If
End Proc

Procedure _MISS[WORDHERE$]

   Shared LGTH
   ICOUNTER=0
   LGTH=Len(WORDHERE$)*-1

   Repeat
         For I=320 To(LGTH)*10 Step -1
           Ink 2
            Text I,195,WORDHERE$
           For X=0 To 300 : Next
         Next I
      Inc ICOUNTER
   Until ICOUNTER=1
End Proc

LOWCHIPRAM:
If Chip Free<30080
   Repeat
      Proc _MISS["?CHIP RAM IS TOO LOW!"]
   Until Chip Free>50080
End If

Screen Open 0,320,200,8,Lowres
Auto View On : Curs Off : Hide On
Colour 0,$0 : Colour 1,$FFF : Colour 2,$F00 : Colour 3,$FF0 : Colour 4,$FFF
Screen Show 0 :
Repeat
   Proc _MISS["Reason for error: "+Err$(Errn)+"."]
Until X=1

Procedure SETBOARD
Shared XO
Box XO+0,0 To XO+255,167
' This bar represents your background pic
Ink 3
Box XO+1,1 To XO+254,166
For X=0 To 31
   For Y=0 To 20
      X1=X*8+4+XO
      Y1=Y*8+4
      Ink 1
      Bar X1-1,Y1-1 To X1+1,Y1+1
      Ink 0
      Box X1-2,Y1-2 To X1+2,Y1+2
   Next Y
Next X
End Proc
Logged

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: How to use Bank and combine it with an array?
« Reply #19 on: October 29, 2013, 02:04:15 AM »

By the way...thank you so much for everything and apologies if I am slow to grasping things...and apologies for keep asking...and I appreciate your severe patience and willing to help and also constantly replying to my problem.

I promise when my game is finished you will get credit first for all the effort you have done to help me get to understand coding in AMOS. Also I promise ones I get the hand of AMOS and start to enjoying developing on it...90% of my games will be developed on AMOS.
Logged

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: How to use Bank and combine it with an array?
« Reply #20 on: November 01, 2013, 01:45:43 AM »

Thank you so much!!! It works 100% now when it comes to retrieving the values!!! This helped a lot!!! THANKS!

I should be finishing the program next week :D Then it will be released to the public with titles and everything!
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: How to use Bank and combine it with an array?
« Reply #21 on: November 01, 2013, 09:07:22 PM »

You're welcome!
Logged

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: How to use Bank and combine it with an array?
« Reply #22 on: November 05, 2013, 01:46:19 PM »

OK I am discovering another problem and it is frustrating me now. I think I have reached the frustrating level...thinking that maybe this time I solved it and I did not solve it:

Problems and issues listed below:

1) I am unable to initialize the entire boardarray(x,y) to zero and point to clear memory without causing Guru Meditation

2) It used to display the line correctly now it is not displaying it correctly at all

3) I tried to make an if statement where lineformed is 0 to draw a line between two specific points and it is not doing it...it is failing

4) Every time I click for two new dots the xcounter and ycounter are always zero...so it always loops at 0,0 for the board no matter what I do as if the values are not installed or placed at xcounter, ycounter so what end up happening

for ycounter = 0 to 21
   for xcounter = 0 to 31
      ... do buggy coded stuff here...to prevent guru meditation I am forced to exit the loop statement as soon as the supposed value is stored there using Goto label..............
   next xcounter
next ycounter

label:

....

The xcounter and ycounter is zero as it is the first time it looped. When I repeat again and press two dots  again on the board and it loops again...ones more the xcounter, ycounter are zeros when it executes the buggy code it can never manage to do xcounter=1, ycounter=0 and so on....as if for some reason the values are not stored at all in boardarray at all.

Programming in AMOS is a little frustrating and not easy it seems....so if another month of constant attempting fails I am forced to scrap my project and switch languages....I really hope not to do that :(.

I do not know what to do!
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: How to use Bank and combine it with an array?
« Reply #23 on: November 06, 2013, 04:56:33 PM »

The EXIT command is usually preferred over the GOTO command when exiting loops.  There is a risk of the stack being left with data in it from the FOR commands otherwise.  If you need to exit 2 levels of loops, just do an EXIT 2.  If you need to skip additional stuff at the end of the loop, use a flag value so that you can embed your stuff in an IF statement.  I guess what I'm trying to say is that GOTO isn't always safe to use in AmosPro.

Looking at your code, some things are pointing at bank 15 and others at bank 16.  Last I knew, you were only using one bank in your code and if this is still the case, you're trying to access memory from an uninitialized bank.  That could give the illusion of corrupted memory.
Logged

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: How to use Bank and combine it with an array?
« Reply #24 on: November 06, 2013, 05:11:01 PM »

Actually...the reason behind me using Bank 15 and 16...is because in Bank 15 I am only able to put two values: Offsetx1 and Offsety1...if I attempt to put more it will not work and crash and cause invalid number.

The other thing is...in Bank 15 I have not initialized it either...so when I am doing Peek(ItemLock+9) it is returning some jibberish unwanted number instead of 0 and I do Peek(itemlock+0) it starts off with zero..then gives me 24 or 58...and when I quit the program entirely and recompile it...it is stuck with 58

so this statement:

if Peek(ItemLock+0)=0

no longer works or executes....it is getting frustrating. I am wondering right now that if I am going to have major problem like this on a simple dot game...where the objective of the game and point of the game is so simple yet coding it is sooo complex and complicated (and it should not be)....what other further worse complication and limitation will I be facing if I want to go into more complex game development such as platforms,adventures and even AI monsters.


You have helped me so much and you have being on my side answering all my questions...thank you so much for everything you have done...I am thinking of changing ships and going to Blitz Basic. At least that programming language have NewType and handles arrays much better than AMOS.....these two simple features makes a huge DIFFERENCE for the programmer when he wants to make his project and could ultimately change his decision in which tool he uses to develop his projects.
« Last Edit: November 06, 2013, 05:13:00 PM by xboxisfinished »
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: How to use Bank and combine it with an array?
« Reply #25 on: November 07, 2013, 06:16:42 PM »

Have you considered AmigaE?  It supports object-oriented programming better than AmiBlitz if that interests you.
Logged

xboxisfinished

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 205
  • Generic Amiga User
    • gamemakermagazine.com
Re: How to use Bank and combine it with an array?
« Reply #26 on: November 07, 2013, 09:21:40 PM »

Seems a serious programming language :D I like that!!! I will learn all my skills on BlitzBasic 2...then migrate to AmigaE. Hey..look...I like AMOS...it is a sweet programming language and from games I saw made by it...it can pretty much do everything as any other programming language can do. It just does not meet my style at all....I am sure old programmers who are ok with not being object oriented and love hacking their code...and love manipulating memory in low level language style...and do not mind peeking and pooking and dooking and deeking would not mind this language and will find it comfortable. It just not my style here.

However, in the future..if you guys do decide to rework the entire engine of AMOS all together...and make it 100% object oriented with class and inheritance and libraries...then I will for sure consider returning back to it and making all my games on it!!!
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: How to use Bank and combine it with an array?
« Reply #27 on: November 12, 2013, 12:40:57 PM »

It would be impractical to add OOP to AmosPro.  Sidewinder and I tried to figure out a way to do that and it ultimately fell flat.  If you need OOP, use AmigaE instead.  If you need portability you can also try the sequel to AmigaE called PortablE but as of this time, it takes too much memory to be used on a Classic Amiga even though it generates code that will work on those machines.
Logged
Pages: 1 [2]   Go Up
 

TinyPortal 2.2.2 © 2005-2022