Actually, Cn2_Setup is getting executed:

Code:
Start:   
 ;------***************************________                         main routines
   set textwrite,(iy+sgrflags)
   in a, (2) ; ;2
   and 80h ;%10000000 for fast, %00000000 for slow ;2
   rlca ;%00000001 for fast, %00000000 for slow ;1
   push af ;1
   xor a ;set speed to slow ;1
   out (20h), a ;set the speed ;2
   
Start_DBLoop: ;debounce...
   ld b,16
Start_DBInnerLoop:    
   call Cn2_GetK
   or a
   jr nz,Start_DBLoop
   djnz Start_DBInnerLoop
   call Cn2_Setup ;set up calcnet 2.2 

   xor a
   ld (calccount),a
   ;ld a,$ff
   ;ld (whichcalc),a
   ld ($890F),a ;show debug info
Start_FindCalcsRedraw:
   ; Main Menu
Now it is, but it wasn't before. Smile So what happens now, does it still crash when you start the game? Actually, you should set it so that it won't let you start if there's only one calculator present.
It still crashes. :/
souvik1997 wrote:
It still crashes. :/
If you're letting it start a game with only a single calculator found, then I'd expect it to crash; you'll recall that Obliterate did the same thing when I first released it.
Is this correct?

Code:
ShowHelpScreen:
   call OpenGUIStack
   ld hl,SmWinData
   ld de,SmWinDataEnd-SmWinData
   ld a,GUIRSmallWin ;push a SmallWindow onto the GUI stack
   call PushGUIStack
   ld hl,GUITextData
   ld de,GUITextDataEnd-GUITextData
   ld a,GUIRWrappedText
   call PushGUIStack  ;push wrapped text onto the GUI stack
   ld hl,ButtonData
   ld de,ButtonDataEnd-ButtonData
   ld a,GUIRButtonText
   call PushGUIStack
   ld hl,0
   call GUIMouse
   ret
GUITextData:
   .db 0,9
   .db $D6
   .db 0
   .db "Help text goes here",0
GUITextDataEnd:

ButtonData:
   .db 9,9 ;Where should I put this?
   .dw Init ;is this correct?
   .db "Continue",0
ButtonDataEnd:
SmWinData:
     .db 5,5     ;the x and y coordinates relative to the LCD of the top-left of the window
     .db $F8,$88,$88,$88,$F8   ;a square icon
     .db "Help",0    ;the window title
SmWinDataEnd:
It's mostly good, except that wherever you make the button jump needs to either pop off those elements and push some more on, or needs to close the stack entirely. Also, if you read the GUIMouse page carefully, you need to call ResetAppPage first thing anywhere that the GUIMouse jumps. Therefore, your ButtonData should jump to FinishHelp:


Code:
FinishHelp:
    call ResetAppBasePage
    call CloseGUIStack
    jp Init
So, I fixed a bug with CnT's menu system today. Very Happy As I expected, I had forgotten to pop AF off of the stack when exiting the menu. Now, the actual gameplay is causing the calculator to crash, so I'll have to fix that.
souvik1997 wrote:
So, I fixed a bug with CnT's menu system today. Very Happy As I expected, I had forgotten to pop AF off of the stack when exiting the menu. Now, the actual gameplay is causing the calculator to crash, so I'll have to fix that.
Six months later, Souvik picks it up again! I'd like to flatter myself into thinking that my nagging was a factor. Wink At any rate, I'm very excited about this.
souvik1997 wrote:
So, I fixed a bug with CnT's menu system today. Very Happy As I expected, I had forgotten to pop AF off of the stack when exiting the menu. Now, the actual gameplay is causing the calculator to crash, so I'll have to fix that.


Woot! Back to work on an awesome project!
Definitely! Unless I overlooked something, this will be the first CALCnet game not written by me.
KermMartian wrote:
Definitely! Unless I overlooked something, this will be the first CALCnet game not written by me.

Woah, I haven't even realized that. Shock I guess that's even more motivation for me to finish this.
souvik1997 wrote:
KermMartian wrote:
Definitely! Unless I overlooked something, this will be the first CALCnet game not written by me.

Woah, I haven't even realized that. Shock I guess that's even more motivation for me to finish this.
Hehe, glad to hear it. How did work on it go over the weekend? Did you have an opportunity to start getting your head back into the code?
KermMartian wrote:
souvik1997 wrote:
KermMartian wrote:
Definitely! Unless I overlooked something, this will be the first CALCnet game not written by me.

Woah, I haven't even realized that. Shock I guess that's even more motivation for me to finish this.
Hehe, glad to hear it. How did work on it go over the weekend? Did you have an opportunity to start getting your head back into the code?

Yeah, I did, sort of. Looking back on it, my code seems really complex and jumps all over the place, making it hard to follow. I might just redo some parts of it, since the gameplay isn't working at the moment.
That's understandable code; I commonly find that at various stages of learning a new language, I look back at my previous code and find it quite shameful. However, I caution against code rewriting for the sake of clarity where the original is not terrible, restricting yourself to rewriting only impossible unmaintainable code for now so you can continue to move forward in completeness.
I rewrote most of my movement code, and now it works again. Very Happy Next, I'll have to fix the shooting, and then I think I can move on to actually implementing the multiplayer aspect of the game.
souvik1997 wrote:
I rewrote most of my movement code, and now it works again. Very Happy Next, I'll have to fix the shooting, and then I think I can move on to actually implementing the multiplayer aspect of the game.
Congratulations! I'm very happy that my nagging was effective enough to help prod you to continue with this, but not so effective that you were bothered. Wink Let us know, of course, if there's anything we can do to help.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
» Goto page Previous  1, 2, 3 ... 26, 27, 28
» View previous topic :: View next topic  
Page 28 of 28
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement