Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: Hot_Dog on August 15, 2010, 08:15:28 pm

Title: ASM Gorillas Help
Post by: Hot_Dog 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
Title: Re: ASM Gorillas Help
Post by: Quigibo on August 15, 2010, 09:07:39 pm
Are interrupts enabled and in "im 1"?
Title: Re: ASM Gorillas Help
Post by: Hot_Dog on August 15, 2010, 09:34:08 pm
Are interrupts enabled and in "im 1"?

Yes, I'm afraid that's not the issue.
Title: Re: ASM Gorillas Help
Post by: Hot_Dog 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
Title: Re: ASM Gorillas Help
Post by: thepenguin77 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.
Title: Re: ASM Gorillas Help
Post by: Hot_Dog 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.
Title: Re: ASM Gorillas Help
Post by: Hot_Dog on August 15, 2010, 11:29:21 pm
Oops, I set the wrong breakpoint.  I can handle the debugging from here
Title: Re: ASM Gorillas Help
Post by: thepenguin77 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.
Title: Re: ASM Gorillas Help
Post by: Hot_Dog 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!
Title: Re: ASM Gorillas Help
Post by: Builderboy on August 16, 2010, 12:37:16 am
what was the issue?  Out of curiosity
Title: Re: ASM Gorillas Help
Post by: Hot_Dog 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