Well, that application is in ASM not C, so there is no main.c, but main.asm, and that is where you can make the changes:
;; use 64 pots
movlw 64
call MIOS_AIN_NumberSet
You can probably guess that this should be changed to:
;; use 40 pots
movlw 40
call MIOS_AIN_NumberSet
And...
;; define number of shift registers: for 128 buttons and LEDs, we need
;; 16 registers. Btw.: thats the maximum number of supported DIN/DOUTs
movlw 16
call MIOS_SRIO_NumberSet
Each Shift Register handles 8 digital IO, so 16 SR's means 128 IO... You want 20, so you need 3 SR's, so change it to:
;; define number of shift registers: for 20 buttons and LEDs, we need
;; 3 registers.
movlw 3
call MIOS_SRIO_NumberSet
Done! As you can see, sometimes a great deal of information can be taken from reading the comments from TK in the source files. I know that it can be a heavy read, but it is a good way to learn :)