Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fucking Awesome Spectrum Engine (FASE)
#9
Please help. I have this code in C:

Code:
void *Input;  // function pointer declare

...

/* function pointer assign */
  while ( 1 ){
    i= inp(0xf7fe) & 0x1f;
    if( i==0x1e ){
      Input= Joystick;
      break;
    }
    else if( i==0x1d ){
      Input= Cursors;
      break;
    }
    else if( i==0x1b ){
      Input= Keyboard;
      break;
    }
    else if( i==0x17 ){
      Redefine();
    }
  }

...

  if( Input() & RIGHT ) // function pointer call
    ax= vx<maxvx ? 40 : 0;

I want to do something similar in ZX Basic. I know that ZX Basic has not function pointers, but I think that you can find another good solution.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)