playsound() { if(sound==1) { ozclick(0); ozsound(4); wait(1500); ozsound(3); wait(1500); ozsound(2); wait(1500); ozsound(1); wait(1500); ozquiet(); } }
main() { ozgetauxsize(); ozclick(0); ozcls(); if(load==1) { loadconfig(); } if(mov==1) { if(watch==1) { movie(); watch=0; } } ozcls(); high=1; prevhigh=0; score=0; shots=25; hits=0; misses=0; acc=0; bullseyes=0; ozquiet(); ozsetfont(FONT_OZ_LARGE); ozputs(0,0,"OZ Clay Pigeons"); ozsetfont(FONT_OZ_NORMAL); ozputs(95,3,"Version 2.0"); ozputs(0,20,"(1) Play OZ Clay Pigeons"); ozputs(0,30,"(2) High Scores"); ozputs(0,40,"(3) Keys"); ozputs(0,50,"(4) Options"); ozputs(0,60,"(5) Quit OZ Clay Pigeons"); ozputs(130,20,"Made with Hi-Tech C;"); ozputs(130,30,"USE AT YOUR OWN RISK!"); ozputs(130,50,"Up/Dn arrows to select"); highlight(); main(); }
hitsound() { if(sound==1) { ozclick(0); ozsound(20); wait(1500); ozsound(40); wait(1500); ozsound(60); wait(1500); ozsound(80); wait(1500); ozsound(100); wait(1500); ozsound(104); wait(1500); ozsound(103); wait(1500); ozsound(102); wait(1500); ozquiet(); } }
void view(void) { static byte mod; static unsigned k; static unsigned long delta; static byte i; load_headers(); in_buf=0; ateof=0; atstart=1; scrollbar_pos=0xa000+29; if(last==0) last=header_length; goto_pos(last); mod=1; ozcls(); while(1) { if(mod) { if(!backandforth)position_save(); show(); unbar(); scrollbar(); backandforth=mod=0; } switch(k=ozgetchblank()) { case KEY_LEFT: case KEY_BACKSPACE: #ifdef DEBUG putformatted(0,0,"positionptr=| numpositions=| ", positionptr,numpositions); ozgetch(); #endif if(positionptr<=1) break; goto_pos(positions[(--positionptr)-1]); if(!positionptr) positionptr=1; backandforth=mod=1; #ifdef DEBUG putformatted(0,0,"positionptr=| numpositions=| ", positionptr,numpositions); ozgetch(); #endif break; case KEY_RIGHT: #ifdef DEBUG putformatted(0,0,"positionptr=| numpositions=| ", positionptr,numpositions); ozgetch(); #endif if(positionptr>=numpositions) break; goto_pos(positions[positionptr]); positionptr++; backandforth=mod=1; #ifdef DEBUG putformatted(0,0,"positionptr=| numpositions=| ", positionptr,numpositions); ozgetch(); #endif break; case 'm': /* mark position */ if(numbookmarks>=MAX_BOOKMARKS) { for(i=0;i<MAX_BOOKMARKS-1;i++) { bookmarks[i]=bookmarks[i+1]; } numbookmarks--; } bookmarkptr=numbookmarks; bookmarks[numbookmarks++]=screen_offset+buffer_offset; bookmarksmod=1; break; case 'b': if(numbookmarks) { goto_pos(bookmarks[bookmarkptr]); if(bookmarkptr) bookmarkptr--; else bookmarkptr=numbookmarks-1; mod=1; } break; case 'r': show_bar=!show_bar; bookmarksmod=1; unbar(); scrollbar(); break; case 'h': case KEY_UPPER_MENU: case KEY_LOWER_MENU: dohelp(); ozcls(); mod=1; break; case 'i': _ozfilledbox(0,0,WIDTH,line_height,0); delta=screen_offset+buffer_offset-header_length; putformatted(0,0,"$ : ^/^=|%",filename, delta,length-header_length, (unsigned int)(delta*100/(length-header_length)) ); _ozfilledbox(0,0,WIDTH,line_height,XOR); ozgetchblank(); mod=1; ozcls(); break; case 'c': if(numbookmarks && ozwarn("Delete all bookmarks?",yn)==KEY_LOWER_ENTER ) { bookmarksmod=1; numbookmarks=0; } mod=1; ozcls(); break; case '-': case KEY_PAGEUP: for(i=0;i<num_lines-1;i++) { checkshiftup(); backline(); } mod=1; break; case 's': if(myfont) break; line_height++; if(line_height==11) line_height=8; if(line_height!=9) num_lines=80/line_height; else num_lines=9; bookmarksmod=1; mod=1; ozcls(); break; case KEY_PAGEDOWN: case KEY_LOWER_ENTER: case KEY_UPPER_ENTER: case KEY_RETURN: case ' ': for(i=0;i<num_lines-1;i++) { checkshiftdown(); forwardline(); } mod=1; break; case KEY_UP: checkshiftup(); if(!backline()) break; unbar(); ozscrolldown(line_height*30); dcompline(filebuf+screen_offset); puttextline(0); position_save(); scrollbar(); break; case KEY_DOWN: checkshiftdown(); if(forwardline()) { mod=1; showbot=1; unbar(); ozscroll(line_height*30); } break; case KEY_LEFT_SHIFT | MASKSHIFT: case KEY_RIGHT_SHIFT | MASKSHIFT: switch(ozgetch() & 0xF0FF) { case '-': ozclick(!ozgetclick()); ozsavekeysettings(); break; case KEY_PAGEUP: case KEY_UP: tenpercent(-1); mod=1; break; case KEY_PAGEDOWN: case KEY_DOWN: tenpercent(1); mod=1; break; } break; case KEY_UP | MASKSHIFT: case KEY_PAGEUP | MASKSHIFT: tenpercent(-1); mod=1; break; case KEY_PAGEDOWN | MASKSHIFT: case KEY_DOWN | MASKSHIFT: tenpercent(1); mod=1; break; case KEY_2ND: switch(ozgetch() & 0xF0FF ) { case '-': ozclick(!ozgetclick()); ozsavekeysettings(); break; case KEY_PAGEUP: case KEY_UP: goto_pos(header_length); mod=1; break; case KEY_PAGEDOWN: case KEY_DOWN: goto_pos(length); mod=1; break; } break; case KEY_LOWER_ESC: case KEY_UPPER_ESC: case KEY_MYPROGRAMS: exit(0); case KEY_MAIN: case KEY_CALENDAR: case KEY_TELEPHONE: case KEY_MEMO: ozexitto(k); case KEY_BACKLIGHT: oztogglelight(); break; } } }