
/* Set the Item values */
/* 1  joystick  */
select 
   when joystick='none'
      then
        CALL VpSetItemValue window,1000,0
   when joystick='auto'
      then
        CALL VpSetItemValue window,1000,1
   when joystick='standard'
      then
        CALL VpSetItemValue window,1000,2
   when joystick='dual'
      then
        CALL VpSetItemValue window,1000,3
   when joystick='4button'
      then
        CALL VpSetItemValue window,1000,4
   when joystick='6button'
      then
        CALL VpSetItemValue window,1000,5
   when joystick='8button'
      then
        CALL VpSetItemValue window,1000,6
   when joystick='fspro'
      then
        CALL VpSetItemValue window,1000,7
   when joystick='wingx'
      then
        CALL VpSetItemValue window,1000,8
   when joystick='wingwarrior'
      then
        CALL VpSetItemValue window,1000,9
   when joystick='sidewinder'
      then
        CALL VpSetItemValue window,1000,10
   when joystick='gamepadpro'
      then
        CALL VpSetItemValue window,1000,11
   when joystick='grip'
      then
        CALL VpSetItemValue window,1000,12
   when joystick='grip4'
      then
        CALL VpSetItemValue window,1000,13
   when joystick='sneslpt1'
      then
        CALL VpSetItemValue window,1000,14
   when joystick='psxlpt1'
      then
        CALL VpSetItemValue window,1000,15
   when joystick='n64lpt1'
      then
        CALL VpSetItemValue window,1000,16
   otherwise
        CALL VpSetItemValue window,1000,0
end /* end select */
/* 2 mouse */
if mouse='1' then
  CALL VpSelect window,1003,1
else
  CALL VpSelect window,1003,0
/* 3 soundcard */
select 
   when soundcard='silence'
      then
        CALL VpSetItemValue window,1004,0
   when soundcard='SoundBlaster'
      then
        CALL VpSetItemValue window,1004,1
   when soundcard='SBlasterPro'
      then
        CALL VpSetItemValue window,1004,2
   when soundcard='ProAudioSpec'
      then
        CALL VpSetItemValue window,1004,3
   when soundcard='UltraSoundMax'
      then
        CALL VpSetItemValue window,1004,4
   when soundcard='UltraSound'
      then
        CALL VpSetItemValue window,1004,5
   when soundcard='WinSoundSys'
      then
        CALL VpSetItemValue window,1004,6
   when soundcard='Ensoniq'
      then
        CALL VpSetItemValue window,1004,7
   otherwise
        CALL VpSetItemValue window,1004,0
end /* end select */
/* 4 samplerate */
select 
   when samplerate='22050'
     then
       CALL VpSetItemValue window,1010,0
   when samplerate='11025'
     then
       CALL VpSetItemValue window,1010,1
   when samplerate='44100'
     then
       CALL VpSetItemValue window,1010,2     
   otherwise
       CALL VpSetItemValue window,1010,0
end /* end select */
/* 5 sample16bit */
if sample16bit='1' then
  CALL VpSelect window,1008,1
else
  CALL VpSelect window,1008,0
/* 6 stereo */
if stereo='1' then
  CALL VpSelect window,1009,1
else
  CALL VpSelect window,1009,0
/* 7 opl */
if opl='1' then
  CALL VpSelect window,1007,1
else
  CALL VpSelect window,1007,0
/* 8 volume */
CALL VpSetItemValue window, 1043, 'SETARMPOS', volume
/* 9 tweak */
if tweak='1' then
  CALL VpSelect window,1012,1
else
  CALL VpSelect window,1012,0
/* 10 stretch */
if stretch='1' then
  CALL VpSelect window,1015,1
else
  CALL VpSelect window,1015,0
/* 11 vsync */
if vsync='1' then
  CALL VpSelect window,1020,1
else
  CALL VpSelect window,1020,0
/* 12 alwaysync */
if alwaysync='1' then
  CALL VpSelect window,1021,1
else
  CALL VpSelect window,1021,0
/* 13 tripbuff */
if tripbuff='1' then
  CALL VpSelect window,1022,1
else
  CALL VpSelect window,1022,0
/* 14 scanlines */
if scanlines='1' then
  CALL VpSelect window,1014,1
else
  CALL VpSelect window,1014,0
/* 15 vgafreq */
select 
   when vgafreq='0'
      then
        CALL VpSetItemValue window,1018,0
   when vgafreq='1'
      then
        CALL VpSetItemValue window,1018,1
   when vgafreq='2'
      then
        CALL VpSetItemValue window,1018,2
   when vgafreq='3'
      then
        CALL VpSetItemValue window,1018,3
   otherwise
        CALL VpSetItemValue window,1018,0
end /* end select */
/* 16 ntsc */
if ntsc='1' then
  CALL VpSelect window,1013,1
else
  CALL VpSelect window,1013,0
/* 17 coldpth */
select 
   when coldpth='16'
      then
        CALL VpSetItemValue window,1016,0
   when coldpth='8'
      then
        CALL VpSetItemValue window,1016,1
   when coldpth='24'
      then
        CALL VpSetItemValue window,1016,2
   when coldpth='32'
      then
        CALL VpSetItemValue window,1016,3
   otherwise
        CALL VpSetItemValue window,1016,0
end /* end select */
/* 18 monitor */
select 
   when monitor='standard'
      then
        CALL VpSetItemValue window,1023,0
   when monitor='ntsc'
      then
        CALL VpSetItemValue window,1023,1
   when monitor='pal'
      then
        CALL VpSetItemValue window,1023,2
   when monitor='arcade'
      then
        CALL VpSetItemValue window,1023,3
   otherwise
        CALL VpSetItemValue window,1023,0
end /* end select */
/* 19 rot */
select 
   when rot='none'
      then
        CALL VpSetItemValue window,1025,0
   when rot='right'
      then
        CALL VpSetItemValue window,1025,1
   when rot='left'
      then
        CALL VpSetItemValue window,1025,2
   otherwise
        CALL VpSetItemValue window,1025,0
end /* end select */
/* 20 flipx */
if flipx='1' then
  CALL VpSelect window,1027,1
else
  CALL VpSelect window,1027,0
/* 21 flipy */
if flipy='1' then
  CALL VpSelect window,1028,1
else
  CALL VpSelect window,1028,0
/* 22 norot */
if norot='1' then
  CALL VpSelect window,1029,1
else
  CALL VpSelect window,1029,0
/* 23 frameskip */
if frameskip='auto' then
  CALL VpSetItemValue window,1040,0
else
  do
    if length(frameskip) > 0 then
      CALL VpSetItemValue window,1040,frameskip
    else
      CALL VpSetItemValue window,1040,0
  end
/* 24 wait interlace */
if waitint=1 then
  CALL VpSelect window,1046,1
else
  CALL VpSelect window,1046,0
/* 25 antiali */
if antiali='1' then
  CALL VpSelect window,1030,1
else
  CALL VpSelect window,1030,0
/* 26 beam */
if beam > 1 then
  CALL VpSetItemValue window,1047,(beam-1)
else
  CALL VpSetItemValue window,1047,0
/* 27 flicker */
if flicker = 0 then
  CALL VpSetItemValue window,1048,0
else
  CALL VpSetItemValue window,1048,flicker
/* 28 translucency */
if transluc=1 then
  CALL VpSelect window,1051,1
else
  CALL VpSelect window,1051,0
/* 29 resolution */
select 
  when resolution='auto'
    then
      CALL VpSetItemValue window,1054,0
  when resolution='320x240'
    then
      CALL VpSetItemValue window,1054,1
  when resolution='320x400'
    then
      CALL VpSetItemValue window,1054,2
  when resolution='320x480'
    then
      CALL VpSetItemValue window,1054,3
  when resolution='400x300'
    then
      CALL VpSetItemValue window,1054,4
  when resolution='480x360'
    then
      CALL VpSetItemValue window,1054,5
  when resolution='512x384'
    then
      CALL VpSetItemValue window,1054,6
  when resolution='640x400'
    then
      CALL VpSetItemValue window,1054,7
  when resolution='640x480'
    then
      CALL VpSetItemValue window,1054,8
  when resolution='800x600'
    then
      CALL VpSetItemValue window,1054,9
  when resolution='1024x768'
    then
      CALL VpSetItemValue window,1054,10
  when resolution='1152x864'
    then
      CALL VpSetItemValue window,1054,11
  when resolution='1280x960'
    then
      CALL VpSetItemValue window,1054,12
  when resolution='1280x1024'
    then
      CALL VpSetItemValue window,1054,13
  when resolution='1600x1200'
    then
      CALL VpSetItemValue window,1054,14
  otherwise
     CALL VpSetItemValue window,1054,0 
end /* end select */
/* 30 windowed */
if windowed=1 then
  CALL VpSelect window,1056,1
else
  CALL VpSelect window,1056,0
/* 31 errlog */
if errlog='1' then
  CALL VpSelect window,1031,1
else
  CALL VpSelect window,1031,0
/* 32 debug */
if debug='1' then
  CALL VpSelect window,1033,1
else
  CALL VpSelect window,1033,0
/* 33 cheat */
if cheat='1' then
  CALL VpSelect window,1032,1
else
  CALL VpSelect window,1032,0
/* 34 igncfg */
if igncfg='1' then
  CALL VpSelect window,1037,1
else
  CALL VpSelect window,1037,0
/* 35 & 36 record & recfile */
if record='1' then
  do
    CALL VpSelect window,1034,1
    CALL VpSetItemValue window,1035,recfile
  end 
else
  do
    CALL VpSelect window,1034,0
    CALL VpSetItemValue window,1035,recfile
  end
/* 37 & 38 play and playfile */
if play='1' & record='0' then
  do
    CALL VpSelect window,1052,1
    CALL VpSetItemValue window,1053,playfile
  end
else
  do
    CALL VpSelect window,1052,0
    CALL VpSetItemValue window,1053,playfile
  end
