0 Members and 1 Guest are viewing this topic.
;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 enteredGet_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
Are interrupts enabled and in "im 1"?
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.
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
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.