主题 : [古董]找到一些 Turbo C 的源程序
不经常在线,有事邮件
级别: 论坛管理员

UID: 12125
精华: 0
发帖: 5142
威望: 36 星
金钱: 375371 浮游币
贡献值: 19019 点
好评度: 21716 点
人气: 11662 点
在线时间: 1978(时)
注册时间: 2004-08-31
最后登录: 2024-10-28
楼主  发表于: 2005-01-29 22:44

[古董]找到一些 Turbo C 的源程序

第一个是,提取 DOS 版仙剑 MIDI 音乐的,原来骗过稿费的东西

代码

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
char TargetFileName[32]="PAL_00.mid";
void main(void)
{
FILE *SourceFile,*TargetFile;
long Start,End,Len;
int i,j,k,file;
file=0;
clrscr();
gotoxy (18,10);
printf ("PAL Music Maker, Made by Ashuro. Date:2000/12/21\n");
if ((SourceFile=fopen ("MIDI.MKF"),"rb")=NULL)
  {
   gotoxy (21,13);
   printf ("Can not find MIDI.MKF\n");
   exit(1);
  }
for (i=1;i<87;i++)
   {
    fseek (SourceFile,1*4,SEEK_SET);
    fread (&Start,1,4,SourceFile);
    fread (&End,1,4,SourceFile);
    fseek (SourceFile,Start,SEEK_SET);
    Len=End-Start;
    if (len>0)
      {
     ++file;
     TargetFileName[6]=(file/10)+'0';
     TargetFileName[7]=(file%10)+'0';
     TargetFile=fopen (TargetFileName,"wb");
     gotoxy (23,13);
     printf ("Now Saving %d music: %s",file,TargetFileName);
     for (j=0;j<len;j++)
   {
    k=fgetc (SourceFile);
    fputc (k,TargetFile);
   }
     fclose (TargetFile);
      }
   }
fclose (SourceFile);
gotoxy (29,15);
printf ("Music has all saved successfully.\n");
}
级别: 模拟小生
UID: 14737
精华: 0
发帖: 383
威望: 0 星
金钱: 2624 浮游币
贡献值: 0 点
好评度: 0 点
人气: 0 点
在线时间: 0(时)
注册时间: 2005-01-23
最后登录: 2008-11-19
沙发  发表于: 2005-01-30 14:32

哈哈,虽然2年没碰过了,前几天还在CV上大言不惭地写上:
Programming knowledge

Area Level Last used Experience
MySQL Advanced Currently in use 4 years
Apache Advanced Currently in use 4 years
C/C++ Average Currently in use 6 years
PHP Advanced Currently in use 2 years
Perl Advanced Currently in use 2 years
HTML Advanced Currently in use 6 years
DHTML Advanced Currently in use 4 years
Javascript Advanced Currently in use 4 years
ASP Average 1 year ago 5 years
Oracle Average 1 year ago 1 year
Java Average 1 year ago 1 year
Unix/Linux Average Currently in use 5 years
Windows Advanced Currently in use 10 years