330 Borg started but snagged.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • APWhite
    Adept
    • Jul 2007
    • 244

    330 Borg started but snagged.

    I am working two clinics now and I'm gone about 70 hrs a week. I do not have time to learn the new code to get the borg's keypress stuff working.

    I will need someone to help me rewrite the inkey_ex() from util.c to allow the borg to function.

    The old 320 code looked like this:
    Code:
    ui_event_data inkey_ex(void)
    {
    	bool cursor_state;
    	ui_event_data kk;
    	ui_event_data ke;
    
    	bool done = FALSE;
    
    	term *old = Term;
    
    	/* Initialise keypress */
    	ke.key = 0;
    	ke.type = EVT_NONE;
    
    	/* Hack -- Use the "inkey_next" pointer */
    	[B]if (inkey_next && *inkey_next && !inkey_xtra)[/B]
    	{
    		/* Get next character, and advance */
    		ke.key = *inkey_next++;
    		ke.type = EVT_KBRD;
    
    		/* Cancel the various "global parameters" */
    		inkey_base = inkey_xtra = inkey_flag = FALSE;
    		inkey_scan = 0;
    
    		/* Accept result */
    		return (ke);
    	}
    
    	/* Forget pointer */
    	inkey_next = NULL;
    
    #ifdef ALLOW_BORG
    
    	/* Mega-Hack -- Use the special hook */
    	[B]if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))[/B]
    	{
    		/* Cancel the various "global parameters" */
    		inkey_base = inkey_xtra = inkey_flag = FALSE;
    		inkey_scan = 0;
    		ke.type = EVT_KBRD;
    
    		/* Accept result */
    		return (ke);
    	}
    
    #endif /* ALLOW_BORG */
    The new 330 stuff looks like this:
    Code:
    ui_event inkey_ex(void)
    {
    	bool cursor_state;
    	ui_event kk;
    	ui_event ke = EVENT_EMPTY;
    
    	bool done = FALSE;
    
    	term *old = Term;
    
    	/* Delayed flush */
    	if (inkey_xtra) {
    		Term_flush();
    		inkey_next = NULL;
    		inkey_xtra = FALSE;
    	}
    
    	/* Hack -- Use the "inkey_next" pointer */
    	[B]if (inkey_next && inkey_next->code)[/B]
    	{
    		/* Get next character, and advance */
    		ke.key = *inkey_next++;
    
    		/* Cancel the various "global parameters" */
    		inkey_flag = FALSE;
    		inkey_scan = 0;
    
    		/* Accept result */
    		return (ke);
    	}
    
    	/* Forget pointer */
    	inkey_next = NULL;
    
    #ifdef ALLOW_BORG
    
    	/* Mega-Hack -- Use the special hook */
    	[B]if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))[/B]
    	{
    		/* Cancel the various "global parameters" */
    		inkey_flag = FALSE;
    		inkey_scan = 0;
    		ke.type = EVT_KBRD;
    
    		/* Accept result */
    		return (ke);
    	}
    
    #endif /* ALLOW_BORG */
    For the rest of the 330 code changes, I was able to quickly identify the variable name changes and the few struct changes-- most have been updated. But I have no idea how the event handler works.

    I see there is a change to the feature array as well. I will cross that bridge when I come to it.

    The borg source code is at innovapain.com/borg
    Andrew
    St George Chiropractor
    Angband Borg Homepage
  • takkaria
    Veteran
    • Apr 2007
    • 1951

    #2
    OK, could you email me about this? I know at least vaguely what you'd need to do but I haven't got time to explain right now. (takkaria at gmail dot com)

    Originally posted by APWhite
    I am working two clinics now and I'm gone about 70 hrs a week. I do not have time to learn the new code to get the borg's keypress stuff working.

    I will need someone to help me rewrite the inkey_ex() from util.c to allow the borg to function.

    The old 320 code looked like this:
    Code:
    ui_event_data inkey_ex(void)
    {
    	bool cursor_state;
    	ui_event_data kk;
    	ui_event_data ke;
    
    	bool done = FALSE;
    
    	term *old = Term;
    
    	/* Initialise keypress */
    	ke.key = 0;
    	ke.type = EVT_NONE;
    
    	/* Hack -- Use the "inkey_next" pointer */
    	[B]if (inkey_next && *inkey_next && !inkey_xtra)[/B]
    	{
    		/* Get next character, and advance */
    		ke.key = *inkey_next++;
    		ke.type = EVT_KBRD;
    
    		/* Cancel the various "global parameters" */
    		inkey_base = inkey_xtra = inkey_flag = FALSE;
    		inkey_scan = 0;
    
    		/* Accept result */
    		return (ke);
    	}
    
    	/* Forget pointer */
    	inkey_next = NULL;
    
    #ifdef ALLOW_BORG
    
    	/* Mega-Hack -- Use the special hook */
    	[B]if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))[/B]
    	{
    		/* Cancel the various "global parameters" */
    		inkey_base = inkey_xtra = inkey_flag = FALSE;
    		inkey_scan = 0;
    		ke.type = EVT_KBRD;
    
    		/* Accept result */
    		return (ke);
    	}
    
    #endif /* ALLOW_BORG */
    The new 330 stuff looks like this:
    Code:
    ui_event inkey_ex(void)
    {
    	bool cursor_state;
    	ui_event kk;
    	ui_event ke = EVENT_EMPTY;
    
    	bool done = FALSE;
    
    	term *old = Term;
    
    	/* Delayed flush */
    	if (inkey_xtra) {
    		Term_flush();
    		inkey_next = NULL;
    		inkey_xtra = FALSE;
    	}
    
    	/* Hack -- Use the "inkey_next" pointer */
    	[B]if (inkey_next && inkey_next->code)[/B]
    	{
    		/* Get next character, and advance */
    		ke.key = *inkey_next++;
    
    		/* Cancel the various "global parameters" */
    		inkey_flag = FALSE;
    		inkey_scan = 0;
    
    		/* Accept result */
    		return (ke);
    	}
    
    	/* Forget pointer */
    	inkey_next = NULL;
    
    #ifdef ALLOW_BORG
    
    	/* Mega-Hack -- Use the special hook */
    	[B]if (inkey_hack && ((ke.key = (*inkey_hack)(inkey_xtra)) != 0))[/B]
    	{
    		/* Cancel the various "global parameters" */
    		inkey_flag = FALSE;
    		inkey_scan = 0;
    		ke.type = EVT_KBRD;
    
    		/* Accept result */
    		return (ke);
    	}
    
    #endif /* ALLOW_BORG */
    For the rest of the 330 code changes, I was able to quickly identify the variable name changes and the few struct changes-- most have been updated. But I have no idea how the event handler works.

    I see there is a change to the feature array as well. I will cross that bridge when I come to it.

    The borg source code is at innovapain.com/borg
    Andrew
    takkaria whispers something about options. -more-

    Comment

    • APWhite
      Adept
      • Jul 2007
      • 244

      #3
      I got that email sent off. Any chance you looked at a solution?
      St George Chiropractor
      Angband Borg Homepage

      Comment

      • Magnate
        Angband Devteam member
        • May 2007
        • 5110

        #4
        Originally posted by APWhite
        I got that email sent off. Any chance you looked at a solution?
        I think takk is on vacation at the moment, so it might be a little while.
        "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

        Comment

        • takkaria
          Veteran
          • Apr 2007
          • 1951

          #5
          Originally posted by APWhite
          I got that email sent off. Any chance you looked at a solution?
          Not yet, sorry.
          takkaria whispers something about options. -more-

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎