Author Topic: ASM Gorillas Help  (Read 5514 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
ASM Gorillas Help
« on: August 15, 2010, 08:15:28 pm »
I've been continuing work on ASM Gorillas so that I can work on Lesson 15 of my ASM lessons.  It seems that for some reason, nothing happens after _getKey.  I tried setting a break point on the line immediately following, and that breakpoint is never reached.  What am I doing wrong?

Btw, in this case, B = 12, C = 21, HL = "Name:" and DE = statVars.

Code: [Select]
;HL = The text to display for receiving input
;DE = Variable to store the input to
;B  = The maximum number of characters that can be

inputted
;C  = penCol location, that is, the X coordinate of
; the string being entered


Get_Player_Input:

ld (Input_Display_Text), hl
ld (Variable_For_Input), de
ld (Pen_Column), bc
ld a, b
ld (Max_Num_Of_Chars_Check), a
push de

ld hl, plotsscreen
ld de, appbackupscreen
ld bc, 768
ldir

SET lwrCaseActive, (IY + appLwrCaseFlag)




Draw_Underscore_Cursor:

SET textWrite, (IY + sgrFlags)

ld hl, appbackupscreen
ld de, plotsscreen
ld bc, 768
ldir



ld a, (Input_Y)
ld (penRow), a

ld a, (Coordinates_Of_Please_Input)
ld (penCol), a

ld hl, (Input_Display_Text)



;Saves the value of where our string inputted
;will be saved



;Displays the string telling the player
;what to input

B_CALL _VPutS




ld hl, (Variable_For_Input)


ld bc, (Pen_Column)





ld a, c
ld (penCol), a

B_CALL _VPutS

call fastcopy


ld a, (Input_X)
ld (penCol), a


RES textWrite, (IY + sgrFlags)
ld a, (Underscore)

B_CALL _VPutMap



B_CALL _getKey




cp kExtendEcho2
jr z, Check_For_LowerCase_Letters

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: ASM Gorillas Help
« Reply #1 on: August 15, 2010, 09:07:39 pm »
Are interrupts enabled and in "im 1"?
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: ASM Gorillas Help
« Reply #2 on: August 15, 2010, 09:34:08 pm »
Are interrupts enabled and in "im 1"?

Yes, I'm afraid that's not the issue.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: ASM Gorillas Help
« Reply #3 on: August 15, 2010, 10:14:12 pm »
Sorry for the double post.  I should mention that when I put fastcopy before SET textwrite, and then take away SET textwrite, everything works perfectly

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: ASM Gorillas Help
« Reply #4 on: August 15, 2010, 10:57:14 pm »
Everything there says to me that it should work. I never use getKey, but while unoptimized, I see no problems other than a push DE up top with no pop.

Could you give the full context of where this is used? I can't really debug it since there are a lot of variables not initialized within the routine.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: ASM Gorillas Help
« Reply #5 on: August 15, 2010, 11:04:15 pm »
Everything there says to me that it should work. I never use getKey, but while unoptimized, I see no problems other than a push DE up top with no pop.

Could you give the full context of where this is used? I can't really debug it since there are a lot of variables not initialized within the routine.

This is used for a player to input his name.  Here's some code that comes before hand:

Code: [Select]
Input_Player_One_Name:

ld hl, Splash_Screen
ld de, plotsscreen
ld bc, 768
ldir

call fastCopy



ld de, Player_One_Name  ; Player_One_Name .equ statVars
ld hl, Please_Input_Player_Name   ; "Name:"
ld b, 12   ;The name can only be up to twelve characters

ld a, MainMenuItem1Y
ld (Input_Y), a    ;Where to draw the underscore cursor, Y coordinate.  The underscore cursor tells a player
                                    ;where the next character in the name will be placed
ld (penRow), a

ld a, 22
ld c, a
ld (Input_X), a

ld a, 1
ld (Coordinates_Of_Please_Input), a   ;The X coordinate where the "Name:" text will be drawn
ld (penCol), a

call Get_Player_Input



Let me know if you need more.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: ASM Gorillas Help
« Reply #6 on: August 15, 2010, 11:29:21 pm »
Oops, I set the wrong breakpoint.  I can handle the debugging from here

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: ASM Gorillas Help
« Reply #7 on: August 15, 2010, 11:39:04 pm »
The code you sent me works anyways. Something else is going on.

As for break points. I would put one at the top of this subroutine and step through it.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: ASM Gorillas Help
« Reply #8 on: August 16, 2010, 12:17:49 am »
The code you sent me works anyways. Something else is going on.

As for break points. I would put one at the top of this subroutine and step through it.

Yeah, I found the problem.  Thanks!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: ASM Gorillas Help
« Reply #9 on: August 16, 2010, 12:37:16 am »
what was the issue?  Out of curiosity

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: ASM Gorillas Help
« Reply #10 on: August 16, 2010, 12:40:23 am »
I was using register B for holding the EOL when I should have used Max_Num_Of_Chars, which meant the cursor wasn't advancing and new chars were not being added to the name
« Last Edit: August 16, 2010, 12:40:59 am by Hot_Dog »