bc... [cheat]
Home » Source Code » » DUMP_SPR.PAS

DUMP_SPR.PAS ( File view )

From:
  • By 2010-07-21
  • View(s):9
  • Download(s):0
  • Point(s): 1
			{
$UNDEF test
}

{
$IFDEF test
}
 {
$A+,B-,D+,E-,F-,G-,I+,L+,N-,O-,R+,S+,V+,X-
}
 {
$M 16384,65536,655360
}
{
$ELSE
}
 {
$A+,B-,D+,E-,F-,G-,I-,L+,N-,O-,R-,S-,V-,X-
}
 {
$M 16384,65536,655360
}
{
$ENDIF
}

PROGRAM DumpSpriteFile;
{
Zweck    : Erstellt aus einem Spritefile eine leserliche ASCII-Beschreibung
}
{
Autor    : Kai Rohrbacher                
}
{
Sprache  : TurboPascal V6.0              
}
{
Datum    : 29.10.1991                    
}
{
Anmerkung: Ausgabe kann in eine Datei umgeleitet werden!
}

USES DOS;
CONST Datenbytes=65485;  {
maximale Spritegroesse eines Sprites, die hier
}
                         {
im Programm bearbeitet werden kann  (-40) 
}
      Err_None=0;
      Err_NotEnoughMemory=1;
      Err_FileIO=2;
      Err_NoSprite=4;
      Err_NoFile=99;

TYPE SpriteHeader= RECORD
                    Zeiger_auf_Plane:Array[0..3] OF Word;
                    Breite_in_4er_Gruppen:WORD;
                    Hoehe_in_Zeilen:WORD;
                    Translate:Array[1..4] OF Byte;
                    SpriteLength:WORD;
                    Dummy:Array[1..10] OF Word;
                    Kennung:ARRAY[1..2] OF CHAR;
                    Version:BYTE;
                    Modus:BYTE;
                    ZeigerL,ZeigerR,ZeigerO,ZeigerU:Word;
                   END;

     sprite_typ= record case Integer of
      0:( Header:Spriteheader;
          Data:Array[1..Datenbytes] OF Byte;
        );
      1:(
         readin:Array[0..Datenbytes-1 +40] OF Byte;
        )
     END;

LABEL quit_loop,
      quit_without_close;

VAR f:file;
    sprite:^sprite_typ;
    count,Kopf:WORD;
    Error:BYTE;
    P: PathStr;
    D: DirStr;
    N: NameStr;
    E: ExtStr;


FUNCTION FillBlanks(s:STRING):STRING;
{
haengt an s soviele Blanks an, dass es ein Vielfaches von 13 lang wird
}
CONST blanks='            '; {
12 Stueck
}
BEGIN
 FillBlanks:=s+Copy(blanks,1,(13-(length(s) MOD 13)) MOD 13)
END;

PROCEDURE Put(s:STRING);
BEGIN
 WRITELN(s);
END;

PROCEDURE SpriteDatenausgeben(VAR sprite:sprite_typ; count:WORD;
                              P:PathStr; name:NameStr);
CONST tab1='     '; {
Tabulator vom linken Rand bis zum Operandenfeld
}
VAR Tabellen_Breite,i,j:Word;
    sp,t1,t2:STRING;

BEGIN
 IF count=0
  THEN BEGIN  {
erster Aufruf dieser Routine
}
        Put(';');
        Put('; ASCII-listing of ANIVGA sprite file '+P);
        Put('; Created with "DUMP_SPR '+P+'"');
        Put(';');
        Put('; This file can be recompiled to a valid sprite file '
            +'with these commands:');
        Put(Fillblanks(';  MASM '+name+'.TXT;')+' -> gives you '+name+'.OBJ');
        Put(Fillblanks(';  LINK '+name+'.OBJ;')+' -> gives you '+name+'.EXE');
        Put(';  EXE2BIN '+name+'.EXE '+name+'.COD  (or .LIB)');
        Put('');
        Put(Fillblanks('DATA SEGMENT')+' ; to cheat the assembler...');
       END;
 STR(count,sp); sp:=name+sp; {
Spritename erzeugen
}

 Put('');
 Put(';------------------------------------------');
 Put(Fillblanks(sp+' EQU $')+' ; arbitrarily chosen name for this sprite');

 WITH Sprite.Header DO
 BEGIN
  Put('');
  Put('; Offset-pointer to plane data tables:');
  FOR i:=0 TO 3 DO
   BEGIN
    STR(Zeiger_auf_Plane[i]:4,t1); STR(i,t2);
    t1:=Fillblanks(tab1+'DW '+sp+'_Plane'+t2+' -'+sp)
        +' ; ptr to plane '+t2+' (= DW '+t1+')';
    Put(t1)
   END;

  Put('');
  STR(Breite_in_4er_Gruppen:4,t1);
  Put(Fillblanks(tab1+'DW '+t1)+' ; sprite width in multiples of 4 points');

  STR(Hoehe_in_Zeilen:4,t1);
  Put(Fillblanks(tab1+'DW '+t1)+' ; sprite height in lines');

  t1:=tab1+'DB ';
  FOR i:=1 TO 4 DO
   BEGIN
    STR(Translate[i],t2);
    t1:=t1+t2;
    IF i<>4 THEN t1:=t1+','
   END;
  Put(Fillblanks(t1)+' ; some constants: "translate tab", must be 1,2,4,8');

  STR(SpriteLength:4,t1);
  Put(Fillblanks(tab1+'DW '+t1)+' ; length of this sprite in bytes');

  t1:=tab1+'DW ';
  FOR i:=1 TO 10 DO
   BEGIN
    STR(Dummy[i],t2);
    t1:=t1+t2;
    IF i<>10 THEN t1:=t1+','
   END;
  Put(Fillblanks(t1)+' ; 10 dummy words, should be all 0');

  t1:=tab1+'DB '+''''+Kennung[1]+''','''+Kennung[2]+'''';
  Put(Fillblanks(t1)+' ; flag, must be "KR"');

  STR(Version:4,t1);
  Put(Fillblanks(tab1+'DB '+t1)+' ; version number, normally "1"');

  STR(Modus:4,t1);
  Put(Fillblanks(tab1+'DB '+t1)+' ; default display mode of sprite');

  STR(ZeigerL:4,t1);
  Put(Fillblanks(tab1+'DW '+sp+'_Left  -'+sp)+' ; ptr to left   boundaries (= DW '+t1+')');
  STR(ZeigerR:4,t1);
  Put(Fillblanks(tab1+'DW '+sp+'_Right -'+sp)+' ; ptr to right  boundaries (= DW '+t1+')');
  STR(ZeigerO:4,t1);
  Put(Fillblanks(tab1+'DW '+sp+'_Top   -'+sp)+' ; ptr to top    boundaries (= DW '+t1+')');
  STR(ZeigerU:4,t1);
  Put(Fillblanks(tab1+'DW '+sp+'_Bottom-'+sp)+' ; ptr to bottom boundaries (= DW '+t1+')');

  Put('');
  Put(Fillblanks(sp+'_Left   EQU $')+' ; Left boundary table');
  t1:=tab1+'DW ';
  FOR i:=0 TO Hoehe_in_Zeilen-1 DO
   BEGIN
    STR(INTEGER(Sprite.Readin[ZeigerL +i shl 1]
           +256*Sprite.Readin[Succ(ZeigerL +i shl 1)]),t2);
    t1:=t1+t2;
    IF length(t1)>75
     THEN BEGIN
           Put(t1);
           t1:=tab1+'DW ';
          END
     ELSE BEGIN
           IF i<>Hoehe_in_Zeilen-1
            THEN t1:=t1+','
            ELSE Put(t1)
          END;
   END;

  Put(Fillblanks(sp+'_Right  EQU $')+' ; Right boundary table');
  t1:=tab1+'DW ';
  FOR i:=0 TO Hoehe_in_Zeilen-1 DO
   BEGIN
    STR(INTEGER(Sprite.Readin[ZeigerR +i shl 1]
           +256*Sprite.Readin[Succ(ZeigerR +i shl 1)]),t2);
    t1:=t1+t2;
    IF length(t1)>75
     THEN BEGIN
           Put(t1);
           t1:=tab1+'DW ';
          END
     ELSE BEGIN
           IF i<>Hoehe_in_Zeilen-1
            THEN t1:=t1+','
            ELSE Put(t1)
          END;
   END;

  Put(Fillblanks(sp+'_Top    EQU $')+' ; Top boundary table');
  t1:=tab1+'DW ';
  FOR i:=0 TO Breite_in_4er_Gruppen*4-1 DO
   BEGIN
    STR(INTEGER(Sprite.Readin[ZeigerO +i shl 1]
           +256*Sprite.Readin[Succ(ZeigerO +i shl 1)]),t2);
    t1:=t1+t2;
    IF length(t1)>75
     THEN BEGIN
           Put(t1);
           t1:=tab1+'DW ';
          END
     ELSE BEGIN
           IF i<>Breite_in_4er_Gruppen*4-1
            THEN t1:=t1+','
            ELSE Put(t1)
          END;
   END;

  Put(Fillblanks(sp+'_Bottom EQU $')+' ; Bottom boundary table');
  t1:=tab1+'DW ';
  FOR i:=0 TO Breite_in_4er_Gruppen*4-1 DO
   BEGIN
    STR(INTEGER(Sprite.Readin[ZeigerU +i shl 1]
           +256*Sprite.Readin[Succ(ZeigerU +i shl 1)]),t2);
    t1:=t1+t2;
    IF length(t1)>75
     THEN BEGIN
           Put(t1);
           t1:=tab1+'DW ';
          END
     ELSE BEGIN
           IF i<>Breite_in_4er_Gruppen*4-1
            THEN t1:=t1+','
            ELSE 
...
...
(Please download the complete source code to view)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 1

Download
0 lines left, continue to read

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
ANIVGA.DOC220.35 kB07-11-93|18:45
ANIVGA.ENG320.98 kB07-11-93|18:45
ANIVGA.PAS318.61 kB07-11-93|18:45
ANIVGA.TUT12.66 kB07-11-93|18:45
BFFFFFFF.PAS2.02 kB07-11-93|18:45
CHANGES.TXT4.76 kB07-11-93|18:45
COMPRESS.PAS38.98 kB07-11-93|18:45
DATEIEN.PAS45.08 kB07-11-93|18:45
DUMP_SPR.PAS10.05 kB07-11-93|18:45
EINGABEN.PAS8.68 kB07-11-93|18:45
EXAMPL12.PAS3.77 kB07-11-93|18:45
EXAMPLE1.PAS1.58 kB07-11-93|18:45
EXAMPLE2.PAS1.89 kB07-11-93|18:45
EXAMPLE3.PAS3.24 kB07-11-93|18:45
EXAMPLE4.PAS1.64 kB07-11-93|18:45
EXAMPLE5.PAS2.92 kB07-11-93|18:45
EXAMPLE6.PAS3.98 kB07-11-93|18:45
EXAMPLE7.PAS3.03 kB07-11-93|18:45
EXAMPLE8.PAS2.82 kB07-11-93|18:45
EXAMPLE9.PAS1.38 kB07-11-93|18:45
FAQ.TXT11.99 kB07-11-93|18:45
07.00 B
2_HEBREW.FNT3.51 kB11-03-92|10:38
30.FNT3.26 kB11-03-92|10:39
33Q.FNT3.01 kB11-03-92|10:39
36.FNT2.76 kB11-03-92|10:39
44.FNT2.26 kB11-03-92|10:39
8X10.FNT2.51 kB11-03-92|10:38
8X11SNSF.FNT2.76 kB11-03-92|10:38
8X14.FNT3.51 kB11-03-92|10:38
ALPS.FNT3.51 kB11-03-92|10:37
ALPS10.FNT2.51 kB11-03-92|10:37
ALPS11.FNT2.76 kB11-03-92|10:37
ALPS6.FNT1.51 kB11-03-92|10:37
ALPS7.FNT1.76 kB11-03-92|10:37
ALPS8.FNT2.01 kB11-03-92|10:37
ANTIQUE.FNT3.51 kB11-03-92|10:38
APLS9.FNT2.26 kB11-03-92|10:37
B814.FNT3.51 kB11-03-92|10:39
BIGSERIF.FNT3.51 kB11-03-92|10:38
BLCKSNSF.FNT2.51 kB11-03-92|10:38
BLOCK.FNT3.51 kB11-03-92|10:38
BOLD.FNT3.51 kB11-03-92|10:38
BROADWAY.FNT3.51 kB11-03-92|10:38
CNTDOWN.FNT3.51 kB11-03-92|10:37
COMPUTER.FNT3.51 kB11-03-92|10:38
COURIER.FNT3.51 kB11-03-92|10:38
CYRILLIC.FNT3.51 kB11-03-92|10:38
DEFAULT.FNT1.51 kB11-03-92|10:39
FIRE.FNT52.26 kB11-03-92|18:45
FIRE.PAL768.00 B11-03-92|18:45
FRANKFRT.FNT3.51 kB11-03-92|10:37
FRESNO.FNT3.51 kB11-03-92|10:38
FUTURE.FNT3.51 kB11-03-92|10:38
GAELIC.FNT3.51 kB11-03-92|10:37
GEORGIAN.FNT3.51 kB11-03-92|10:37
GREEK.FNT3.51 kB11-03-92|10:38
HOLLOW.FNT3.51 kB11-03-92|10:38
HUGE.FNT4.01 kB11-03-92|10:39
HYLAS.FNT3.51 kB11-03-92|10:38
ITALIC.FNT3.51 kB11-03-92|10:37
ITALICS.FNT3.51 kB11-03-92|10:37
ITT.FNT3.51 kB11-03-92|10:38
LCD.FNT3.51 kB11-03-92|10:38
MEDIEVAL.FNT3.51 kB11-03-92|10:38
MODERNFO.FNT4.01 kB11-03-92|10:39
OCR.FNT3.51 kB11-03-92|10:37
OLDENG.FNT3.51 kB11-03-92|10:37
ROMAN.FNT3.51 kB11-03-92|10:39
SANSERIF.FNT3.51 kB11-03-92|10:39
SCRIBBLE.FNT4.01 kB11-03-92|10:39
SCRIPT.FNT3.51 kB11-03-92|10:37
SCRIPT2.FNT3.51 kB11-03-92|10:39
SENAPL.FNT3.51 kB11-03-92|10:37
SIDE.FNT2.51 kB11-03-92|10:37
SIMILITE.FNT3.51 kB11-03-92|10:39
SMALCAPS.FNT3.51 kB11-03-92|10:39
STRETCH.FNT3.51 kB11-03-92|10:39
SUPER.FNT2.01 kB11-03-92|10:39
THAI.FNT3.51 kB11-03-92|10:39
THIN.FNT3.51 kB11-03-92|10:39
THIN8X8.FNT2.01 kB11-03-92|10:39
_BROADWA.FNT8.01 kB11-02-92|12:06
_OCR.FNT3.51 kB11-03-92|10:39
GRAB.EXE14.53 kB07-11-93|18:45
GRAB.PAS45.71 kB07-11-93|18:45
07.00 B
AEGYPTEN.COD1.30 kB06-12-92|21:42
BLACK.COD434.00 B06-12-92|21:54
FLOWER.COD3.26 kB03-20-92|14:04
FRACTAL.PAL768.00 B07-03-93|16:12
FRACTAL1.PIC62.50 kB07-03-93|16:12
FRACTAL2.PIC62.50 kB07-03-93|16:13
FRACTAL3.PIC62.50 kB07-03-93|16:13
FRACTAL4.PIC62.50 kB07-03-93|16:14
HANTEL.LIB4.77 kB11-10-91|15:20
MARMOR.COD8.80 kB06-13-92|18:38
RANDOM.PAL768.00 B07-17-92|19:31
TILE2.COD1.30 kB10-20-91|13:57
WHATSNEW.LIB1.72 kB06-12-93|20:09
07.00 B
APPLE.COD290.00 B10-02-92|05:34
ESP.COD4.55 kB10-05-92|15:06
GAME.EXE43.13 kB07-04-93|12:21
GAME.PAS12.00 kB07-04-93|13:46
LINE.COD1.02 kB09-25-92|18:55
MUSIC.PAS20.14 kB09-24-92|16:52
MUSIC.TPU4.89 kB07-04-93|12:21
QUEST.LIB4.53 kB10-05-92|15:51
README.TXT549.00 B07-04-93|13:47
SMALLNUM.LIB13.00 kB09-27-92|16:24
SPOOK.LIB3.57 kB10-02-92|07:36
STANDARD.PAL768.00 B09-25-92|18:53
MAKE.BAT165.00 B07-11-93|18:45
MAKES.PAS218.08 kB07-11-93|18:45
PCX2COD.DOC852.00 B07-11-93|18:45
PCX2COD.PAS77.98 kB07-11-93|18:45
README.1ST2.87 kB07-11-93|18:45
README.2ND4.12 kB07-11-93|18:45
SHOWPIC.PAS995.00 B07-11-93|18:45
SVGA256.BGI6.19 kB07-11-93|18:45
UNCHAIN.ASM11.60 kB07-11-93|18:45
UNCHAIN.EXE1.20 kB07-11-93|18:45
UNLIB.PAS5.86 kB07-11-93|18:45
WHATSNEW.EXE37.36 kB07-11-93|18:45
WHATSNEW.PAS9.10 kB07-11-93|18:45
...

DUMP_SPR.PAS (678.56 kB)

Need 1 point
Your Point(s)

Your Point isn't enough.

Get point immediately by PayPal

More(Debit card / Credit card / PayPal Credit / Online Banking)

Submit your source codes. Get more point

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D