Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.sinclair > #4191 > unrolled thread

Fuse 1.2.0 release

Started byFred <fredm@spamcop.net>
First post2016-06-07 10:55 +0000
Last post2016-06-17 23:58 +0100
Articles 6 — 4 participants

Back to article view | Back to comp.sys.sinclair


Contents

  Fuse 1.2.0 release Fred <fredm@spamcop.net> - 2016-06-07 10:55 +0000
    Re: Fuse 1.2.0 release "p-0''0-h the cat (ES)" <super.pooh@fluffyunderbelly.invalid> - 2016-06-08 12:04 +0100
      Re: Fuse 1.2.0 release serbalgi <serbalgi@gmail.com> - 2016-06-08 16:03 -0700
        Re: Fuse 1.2.0 release "p-0''0-h the cat (ES)" <super.pooh@fluffyunderbelly.invalid> - 2016-06-09 10:03 +0100
          Re: Fuse 1.2.0 release Volker Bartheld <news2016@bartheld.net> - 2016-06-10 08:10 +0200
            Re: Fuse 1.2.0 release "p-0''0-h the cat (ES)" <super.pooh@fluffyunderbelly.invalid> - 2016-06-17 23:58 +0100

#4191 — Fuse 1.2.0 release

FromFred <fredm@spamcop.net>
Date2016-06-07 10:55 +0000
SubjectFuse 1.2.0 release
Message-ID<nj697j$2v8$1@gioia.aioe.org>
After a long gestation, and on behalf of the Fuse team I’d like to announce
that a new version of Fuse, the 1.2.0 release of Free Unix Spectrum
Emulator has been released at the SourceForge project:

https://sourceforge.net/projects/fuse-emulator/

Highlights of this release include:
* Emulation of the Currah µSource and Didaktik 80/40 interfaces.
* Capture BASIC video functions to SVG file.
* Allow continuing RZX recordings.
* Support bash completion.
* Really lots of bugfixes and miscellaneous improvements.

Many thanks to everyone who's contributed to this release, and in
particular thanks to Sergio Baldoví, Gergely Szasz and Stuart Brady for
their contributions. Source code and binaries for Windows are currently
available on the SourceForge site; compiled binaries for various other
platforms should become available in the next few days.

[toc] | [next] | [standalone]


#4192

From"p-0''0-h the cat (ES)" <super.pooh@fluffyunderbelly.invalid>
Date2016-06-08 12:04 +0100
Message-ID<pfuflbdtkv7s4845nvio874n5va251qa7q@4ax.com>
In reply to#4191
On Tue, 7 Jun 2016 10:55:48 +0000 (UTC), Fred <fredm@spamcop.net> wrote:

>After a long gestation, and on behalf of the Fuse team I’d like to announce
>that a new version of Fuse, the 1.2.0 release of Free Unix Spectrum
>Emulator has been released at the SourceForge project:
>
>https://sourceforge.net/projects/fuse-emulator/
>
>Highlights of this release include:
>* Emulation of the Currah µSource and Didaktik 80/40 interfaces.
>* Capture BASIC video functions to SVG file.
>* Allow continuing RZX recordings.
>* Support bash completion.
>* Really lots of bugfixes and miscellaneous improvements.
>
>Many thanks to everyone who's contributed to this release, and in
>particular thanks to Sergio Baldoví, Gergely Szasz and Stuart Brady for
>their contributions. Source code and binaries for Windows are currently
>available on the SourceForge site; compiled binaries for various other
>platforms should become available in the next few days.


Hi, the Windows port no longer seems to print to printout.txt

Previous version worked here on Windows 7 x64 with 48k

Perhaps I've missed something.

I have used the --textfile option to create the file on my desktop but I
get nothing unless I enable both Emulate printers and ZX Printer and
then the file is empty.

The docs mention a configuration file. Is there one for Windows?


Sent from my iFurryUnderbelly.

-- 
p-0.0-h the cat

Internet Terrorist, Mass sock puppeteer, Agent provocateur, Gutter rat,
Devil incarnate, Linux user#666, BaStarD hacker, Resident evil, Monkey Boy,
Certifiable criminal, Spineless cowardly scum, textbook Psychopath, 
the SCOURGE, l33t p00h d3 tr0ll, p00h == lam3r, p00h == tr0ll, troll infâme, 
the OVERCAT [The BEARPAIR are dead, and we are its murderers], lowlife troll,
shyster [pending approval by STATE_TERROR], cripple, sociopath, kook, 
smug prick, smartarse, arsehole, moron, idiot, imbecile, snittish scumbag, 
liar, total ******* retard, shill, pooh-seur, scouringerer, jumped up chav,
lycanthropic schizotypal lesbian, the most complete ignoid, joker, and furball.

NewsGroups Numbrer One Terrorist

Honorary SHYSTER and FRAUD awarded for services to Haberdashery.
By Appointment to God Frank-Lin.

Signature integrity check
md5 Checksum: be0b2a8c486d83ce7db9a459b26c4896

[toc] | [prev] | [next] | [standalone]


#4193

Fromserbalgi <serbalgi@gmail.com>
Date2016-06-08 16:03 -0700
Message-ID<a6b7c24c-4536-42f5-a149-9411d01a4a1f@googlegroups.com>
In reply to#4192
Hi p-0.0-h the cat,

On Wednesday, 8 June 2016 13:04:14 UTC+2, p-0''0-h the cat (ES)  wrote:
> Hi, the Windows port no longer seems to print to printout.txt
> 
> Previous version worked here on Windows 7 x64 with 48k
> 
> Perhaps I've missed something.
> 
> I have used the --textfile option to create the file on my desktop but I
> get nothing unless I enable both Emulate printers and ZX Printer and
> then the file is empty.

It works for me. My best guesses are:
* You should close the application to allow buffers be written to disk.
* The files are saved in the current working directory. If you have installed the setup (rather than use the zipped version), maybe the working directory is not writeable. You could create a shortcut and change the "Start in" property.

> The docs mention a configuration file. Is there one for Windows?

Options, Save
This will cause Fuse’s current options to be written to .fuserc in your home directory (Unix-like systems), or fuse.cfg in your %USERPROFILE% folder (Windows), from which they will be picked up again when Fuse is restarted.

Cheers,
Sergio

[toc] | [prev] | [next] | [standalone]


#4194

From"p-0''0-h the cat (ES)" <super.pooh@fluffyunderbelly.invalid>
Date2016-06-09 10:03 +0100
Message-ID<cfailbh1b30aoptbfr5s9mo40djtnbankh@4ax.com>
In reply to#4193
On Wed, 8 Jun 2016 16:03:12 -0700 (PDT), serbalgi <serbalgi@gmail.com>
wrote:

>Hi p-0.0-h the cat,
>
>On Wednesday, 8 June 2016 13:04:14 UTC+2, p-0''0-h the cat (ES)  wrote:
>> Hi, the Windows port no longer seems to print to printout.txt
>> 
>> Previous version worked here on Windows 7 x64 with 48k
>> 
>> Perhaps I've missed something.
>> 
>> I have used the --textfile option to create the file on my desktop but I
>> get nothing unless I enable both Emulate printers and ZX Printer and
>> then the file is empty.
>
>It works for me. My best guesses are:

I have an admission to make <red face> for some reason my pussy brain
short circuited and I started using LPRINT instead of LLIST.

The OCR fails totally if you BREAK and the PAPER colour is say blue. You
have to change it. It also doesn't like graphics characters. I only want
it to search and read the code more easily so it's not important.

My next mission is to try and recover some assembler source I wrote with
the OCP assembler. 

I have some on microdrive and some on cassette I think. Has anyone got
any tips? Last time I tried [~10-15 years ago] the cassettes were
generally OK but the tape in the microdrives had stuck together on some.
The pressure foam had rotted as well but that was easy to fix. Should I
change /can I get new pinch wheels?

Another question. Is there a way to write Z80 assembler in Windows and
assemble it into like a .tap file or something?


>* You should close the application to allow buffers be written to disk.
>* The files are saved in the current working directory. If you have installed the setup (rather than use the zipped version), maybe the working directory is not writeable. You could create a shortcut and change the "Start in" property.

Nice tip about the "Start in" property.

Thanks to everyone for the advice.

>> The docs mention a configuration file. Is there one for Windows?
>
>Options, Save
>This will cause Fuse’s current options to be written to .fuserc in your home directory (Unix-like systems), or fuse.cfg in your %USERPROFILE% folder (Windows), from which they will be picked up again when Fuse is restarted.
>
>Cheers,
>Sergio

Sent from my iFurryUnderbelly.

-- 
p-0.0-h the cat

Internet Terrorist, Mass sock puppeteer, Agent provocateur, Gutter rat,
Devil incarnate, Linux user#666, BaStarD hacker, Resident evil, Monkey Boy,
Certifiable criminal, Spineless cowardly scum, textbook Psychopath, 
the SCOURGE, l33t p00h d3 tr0ll, p00h == lam3r, p00h == tr0ll, troll infâme, 
the OVERCAT [The BEARPAIR are dead, and we are its murderers], lowlife troll,
shyster [pending approval by STATE_TERROR], cripple, sociopath, kook, 
smug prick, smartarse, arsehole, moron, idiot, imbecile, snittish scumbag, 
liar, total ******* retard, shill, pooh-seur, scouringerer, jumped up chav,
lycanthropic schizotypal lesbian, the most complete ignoid, joker, and furball.

NewsGroups Numbrer One Terrorist

Honorary SHYSTER and FRAUD awarded for services to Haberdashery.
By Appointment to God Frank-Lin.

Signature integrity check
md5 Checksum: be0b2a8c486d83ce7db9a459b26c4896

[toc] | [prev] | [next] | [standalone]


#4195

FromVolker Bartheld <news2016@bartheld.net>
Date2016-06-10 08:10 +0200
Message-ID<19jo5lfltqfte$.dlg@news.bartheld.net>
In reply to#4194
Hi!

On Thu, 09 Jun 2016 10:03:56 +0100, p-0''0-h the cat (ES) wrote:
> I have some on microdrive and some on cassette I think. Has anyone got
> any tips? Last time I tried [~10-15 years ago] the cassettes were
> generally OK but the tape in the microdrives had stuck together on some.
> The pressure foam had rotted as well but that was easy to fix. Should I
> change /can I get new pinch wheels?

Message-ID: <vxeiw9fgl8la$.dlg@news.bartheld.net> might help.

For MDV cartridges, I had success removing the felt/foam from the little
brass pressure spring (tweezers), cleaning the surfaces as good as possible
(isopropylic alcohol). Then replace the foam with DIY double sided
adhesive foam tape, something like
- https://www.amazon.de/doppelseitiges-SchaumKlebeband-9515W-wei%C3%9F-8021684551635/dp/B002ZXWUEY
- https://www.klebeshop24.de/Schaumklebeband-doppelseitig-1-mm-Dicke ,
whatever is available. Should be around 1mm thick. Use the old felt ontop.

Most likely, your cartridges will work again, mechanically. Logically these
media suffer from the dreaded "magnetic print through" problem BASF Super
Chrome Tapes are infamous for. E. g. one tape layer magnetizes the layer
ontop/below after some time. My data was corrupted in most cases, at least
using the Microdrive's standard hardware to read the cartridges.

You could use just the drive mechanics, digitize the bitstream directly
from the drive head(s - it's Stereo) with a measurement amplifier/ADC and
then run some DSP magic on it to increase SNR again. I stopped at this
point, not enough time.

If you want to investigate yourself:
http://www.worldofspectrum.org/utilities.html ->
http://www.worldofspectrum.org/pub/sinclair/tools/pc/mdv2img.zip

No need to change the pinch wheel(s) in my case.

> Another question. Is there a way to write Z80 assembler in Windows and
> assemble it into like a .tap file or something?

Sure. I recommend tniASM (http://tniasm.tni.nl) as preferred assembler.
The .tap-Format ist trivial: http://www.worldofspectrum.org/faq/reference/formats.htm
, it's not even worth writing a tool for it. Say your M/C starts at 32768
and ends at 65545, then prepend the raw binary code with 0x8000 (which
would be the length), then insert your .tap and run

CLEAR 32767
LOAD "" CODE 32768
RANDOMIZE USR 32768

from the emulator.

If you need more comfort, check out bintap (I'm quoting it below, since it
seems to be hard to get) or bas2tap
(http://www.worldofspectrum.org/pub/sinclair/tools/generic/bas2tap26-generic.zip).

From time to time, I use a Sinclair Basic loader to POKE the data (just as
in the old times, when we were typing things from magazines), e.g.

70 RESTORE 1000
80 LET c=0
90 LET a=32768
100
200 PRINT AT 4,0;"Loading machine code..."
210 FOR i=1000 TO 1999
220 READ h$
230 PRINT AT 5,0;h$
240 FOR j=1 TO LEN h$ STEP 2
250 LET s$=h$(j)
260 GO SUB 800
270 LET v=16*s
280 LET s$=h$(j+1)
290 GO SUB 800
300 LET v=v+s
310 POKE a,v
320 LET c=c+v
330 LET a=a+1
340 NEXT j
350 NEXT i
360
400 IF c=<yourchecksum_here> THEN GO TO 500
410 PRINT "Checksum ",c," incorrect."
420 STOP
430
500 PRINT "Checksum ",c," OK."
510 PAUSE 0
520 RANDOMIZE USR 32768
520
900 REM Machine Code Data
1000 DATA "00000000000000000000000000000000"
1001 REM 16 hex bytes in every line...
1999 REM The End

Greets & HTH,
Volker


<bintap.h>
// BINTAP version 1.1
// By the infamous BLOOD!
// (C)1996 Cheese Freak Software
//         modifications 2012 by Volker Bartheld (www.bartheld.net)
// This prog is most definitely FREEWARE!
// But please don't distribute updated versions without asking first...!

typedef unsigned char BYTE;

void getheader(BYTE header[21], char *filename, char *length, unsigned int fl);
void conv(BYTE *high, BYTE *low, size_t number);
unsigned int getsize(FILE *fp);
</bintap.h>

<bintap.cpp>
// BINTAP version 1.1
// By the infamous BLOOD!
// (C)1996 Cheese Freak Software
//         modifications 2012 by Volker Bartheld (www.bartheld.net)
// This prog is most definitely FREEWARE!
// But please don't distribute updated versions without asking first...!

#include <stdio.h>
#include <stdlib.h>
#include <io.h>
#include <string.h>
#include "bintap.h"

void main(int argc, char *argv[])
{
  FILE *fp1, *fp2;
  BYTE header[21], checkbit=0, buffer[3];
  unsigned int count;
  size_t result;
  unsigned int fl;
  BYTE high, low;

  printf("\n\nBINTAP version 1.1\n");
  printf("Written by the infamous BLOOD! (l.d.tonks@bra0202.wins.icl.co.uk)\n");
  printf("(C)1996 Cheese Freak Software\n");
  printf("        modifications 2012 by Volker Bartheld (www.bartheld.net)\n");
  printf("This program is FREEWARE! Don't pay more than 2p for it!\n\n");

  if(argc!=5)
  {
    printf("Usage : BINTAP <bin. filename> <.tap filename> <speccy filename> <.org address>\n");
    printf("Example : BINTAP jetset.obj jetset.tap jetset 32000\n\n");
    exit(0);
  }
  else
  {
    printf("Converting %s to %s....\n", argv[1], argv[2]);
    fp1=fopen(argv[1],"rb");
    if(fp1==NULL)
    {
      printf("Error opening %s...!\n", argv[1]);
      exit(1);
    };
    fp2=fopen(argv[2],"wb");
    if(fp2==NULL)
    {
      printf("Error opening %s...!\n", argv[2]);
      fclose(fp1);
      exit(1);
    };

    // CREATE HEADER 
    fl=getsize(fp1);
    getheader(header,argv[3], argv[4], fl);
    result=fwrite(header, 21, 1, fp2);
    if(result!=1)
    {
      printf("Can't write to %s...!\n", argv[2]);
      fclose(fp1);
      fclose(fp2);
      exit(1);
    };

    // NOT RIGHT YET 
    conv(&high, &low, fl+2);
    buffer[0]=low;
    buffer[1]=high;
    buffer[2]=255;
    checkbit=(checkbit ^ buffer[2]);

    result=fwrite(buffer,3,1,fp2);
    if(result!=1)
    {
      printf("Write error in %s...!\n",argv[2]);
      fclose(fp1);
      fclose(fp2);
      exit(1);
    };

    for(count=0;count<fl;count++)
    {
      result=fread(buffer, 1, 1, fp1);
      if(result!=1)
      {
        printf("Read error in %s...!\n", argv[1]);
        fclose(fp1);
        fclose(fp2);              
        exit(1);
      };
      result=fwrite(buffer, 1, 1, fp2);
      if(result!=1)
      {
        printf("Write error in %s...!\n", argv[2]);
        fclose(fp1);
        fclose(fp2);
        exit(1);
      };
      checkbit=(checkbit ^ buffer[0]);            
    };

    buffer[0]=checkbit;
    result=fwrite(buffer,1,1,fp2);
    if(result!=1)
    {
      printf("Write error in %s...!\n", argv[2]);
      fclose(fp1);
      fclose(fp2);
      exit(1);
    };

    printf("\nConversion done...!\n");

    fclose(fp1);
    fclose(fp2);
  };
}


void getheader(BYTE header[21], char *filename, char *length, unsigned int fl)
{
  size_t len, count;
  BYTE checkbit=0;
  BYTE high, low;

  // MANDATORY BIT 
  header[0]=19;    
  header[1]=0;    
  header[2]=0;    
  header[3]=3;

  // NEXT 10 BYTES ARE FILENAME 
  len=strlen(filename);
  if(len>10) len=10;
  for(count=0; count<len; count++) header[count+4]=filename[count];
  if(len<10)
    for(count=len;count<10;count++) header[count+4]=32;

  // CODE DATA 
  conv(&high,&low,fl);
  header[14]=low;    
  header[15]=high;
  len=atoi(length);
  conv(&high,&low,len);    
  header[16]=low;    
  header[17]=high;    
  header[18]=0;    
  header[19]=128;

  // CHECK BIT 
  for(count=2; count<20; count++) checkbit=(checkbit ^ header[count]);
  header[20]=checkbit;
}


void conv(BYTE *high, BYTE *low, size_t number)
{
  int temp;

  *high=(BYTE)(number/256);
  temp=(int)  (*high)*256;
  *low=(BYTE) (number-temp);
}


unsigned int getsize(FILE *fp)
{
  fseek(fp, 0L, SEEK_END);
  long l=ftell(fp);
  fseek(fp, 0L, SEEK_SET); // reset file pointer 
  return l;   
}
</bintap.cpp>


-- 
@:  W E B 2 0 1 6 at B A R T H E L D dot N E T
3W: www.bartheld.net

[toc] | [prev] | [next] | [standalone]


#4204

From"p-0''0-h the cat (ES)" <super.pooh@fluffyunderbelly.invalid>
Date2016-06-17 23:58 +0100
Message-ID<nov8mb55t0nlod45jmcj0l7a3qcbrv2gh9@4ax.com>
In reply to#4195
On Fri, 10 Jun 2016 08:10:19 +0200, Volker Bartheld
<news2016@bartheld.net> wrote:

>Hi!
>
>On Thu, 09 Jun 2016 10:03:56 +0100, p-0''0-h the cat (ES) wrote:
>> I have some on microdrive and some on cassette I think. Has anyone got
>> any tips? Last time I tried [~10-15 years ago] the cassettes were
>> generally OK but the tape in the microdrives had stuck together on some.
>> The pressure foam had rotted as well but that was easy to fix. Should I
>> change /can I get new pinch wheels?
>
>Message-ID: <vxeiw9fgl8la$.dlg@news.bartheld.net> might help.
>
>For MDV cartridges, I had success removing the felt/foam from the little
>brass pressure spring (tweezers), cleaning the surfaces as good as possible
>(isopropylic alcohol). Then replace the foam with DIY double sided
>adhesive foam tape, something like
>- https://www.amazon.de/doppelseitiges-SchaumKlebeband-9515W-wei%C3%9F-8021684551635/dp/B002ZXWUEY
>- https://www.klebeshop24.de/Schaumklebeband-doppelseitig-1-mm-Dicke ,
>whatever is available. Should be around 1mm thick. Use the old felt ontop.
>
>Most likely, your cartridges will work again, mechanically. Logically these
>media suffer from the dreaded "magnetic print through" problem BASF Super
>Chrome Tapes are infamous for. E. g. one tape layer magnetizes the layer
>ontop/below after some time. My data was corrupted in most cases, at least
>using the Microdrive's standard hardware to read the cartridges.
>
>You could use just the drive mechanics, digitize the bitstream directly
>from the drive head(s - it's Stereo) with a measurement amplifier/ADC and
>then run some DSP magic on it to increase SNR again. I stopped at this
>point, not enough time.
>
>If you want to investigate yourself:
>http://www.worldofspectrum.org/utilities.html ->
>http://www.worldofspectrum.org/pub/sinclair/tools/pc/mdv2img.zip
>
>No need to change the pinch wheel(s) in my case.
>
>> Another question. Is there a way to write Z80 assembler in Windows and
>> assemble it into like a .tap file or something?
>
>Sure. I recommend tniASM (http://tniasm.tni.nl) as preferred assembler.
>The .tap-Format ist trivial: http://www.worldofspectrum.org/faq/reference/formats.htm
>, it's not even worth writing a tool for it. Say your M/C starts at 32768
>and ends at 65545, then prepend the raw binary code with 0x8000 (which
>would be the length), then insert your .tap and run
>
>CLEAR 32767
>LOAD "" CODE 32768
>RANDOMIZE USR 32768
>
>from the emulator.
>
>If you need more comfort, check out bintap (I'm quoting it below, since it
>seems to be hard to get) or bas2tap
>(http://www.worldofspectrum.org/pub/sinclair/tools/generic/bas2tap26-generic.zip).
>
>From time to time, I use a Sinclair Basic loader to POKE the data (just as
>in the old times, when we were typing things from magazines), e.g.
>
>70 RESTORE 1000
>80 LET c=0
>90 LET a=32768
>100
>200 PRINT AT 4,0;"Loading machine code..."
>210 FOR i=1000 TO 1999
>220 READ h$
>230 PRINT AT 5,0;h$
>240 FOR j=1 TO LEN h$ STEP 2
>250 LET s$=h$(j)
>260 GO SUB 800
>270 LET v=16*s
>280 LET s$=h$(j+1)
>290 GO SUB 800
>300 LET v=v+s
>310 POKE a,v
>320 LET c=c+v
>330 LET a=a+1
>340 NEXT j
>350 NEXT i
>360
>400 IF c=<yourchecksum_here> THEN GO TO 500
>410 PRINT "Checksum ",c," incorrect."
>420 STOP
>430
>500 PRINT "Checksum ",c," OK."
>510 PAUSE 0
>520 RANDOMIZE USR 32768
>520
>900 REM Machine Code Data
>1000 DATA "00000000000000000000000000000000"
>1001 REM 16 hex bytes in every line...
>1999 REM The End
>
>Greets & HTH,
>Volker
>
>
><bintap.h>
>// BINTAP version 1.1
>// By the infamous BLOOD!
>// (C)1996 Cheese Freak Software
>//         modifications 2012 by Volker Bartheld (www.bartheld.net)
>// This prog is most definitely FREEWARE!
>// But please don't distribute updated versions without asking first...!
>
>typedef unsigned char BYTE;
>
>void getheader(BYTE header[21], char *filename, char *length, unsigned int fl);
>void conv(BYTE *high, BYTE *low, size_t number);
>unsigned int getsize(FILE *fp);
></bintap.h>
>
><bintap.cpp>
>// BINTAP version 1.1
>// By the infamous BLOOD!
>// (C)1996 Cheese Freak Software
>//         modifications 2012 by Volker Bartheld (www.bartheld.net)
>// This prog is most definitely FREEWARE!
>// But please don't distribute updated versions without asking first...!
>
>#include <stdio.h>
>#include <stdlib.h>
>#include <io.h>
>#include <string.h>
>#include "bintap.h"
>
>void main(int argc, char *argv[])
>{
>  FILE *fp1, *fp2;
>  BYTE header[21], checkbit=0, buffer[3];
>  unsigned int count;
>  size_t result;
>  unsigned int fl;
>  BYTE high, low;
>
>  printf("\n\nBINTAP version 1.1\n");
>  printf("Written by the infamous BLOOD! (l.d.tonks@bra0202.wins.icl.co.uk)\n");
>  printf("(C)1996 Cheese Freak Software\n");
>  printf("        modifications 2012 by Volker Bartheld (www.bartheld.net)\n");
>  printf("This program is FREEWARE! Don't pay more than 2p for it!\n\n");
>
>  if(argc!=5)
>  {
>    printf("Usage : BINTAP <bin. filename> <.tap filename> <speccy filename> <.org address>\n");
>    printf("Example : BINTAP jetset.obj jetset.tap jetset 32000\n\n");
>    exit(0);
>  }
>  else
>  {
>    printf("Converting %s to %s....\n", argv[1], argv[2]);
>    fp1=fopen(argv[1],"rb");
>    if(fp1==NULL)
>    {
>      printf("Error opening %s...!\n", argv[1]);
>      exit(1);
>    };
>    fp2=fopen(argv[2],"wb");
>    if(fp2==NULL)
>    {
>      printf("Error opening %s...!\n", argv[2]);
>      fclose(fp1);
>      exit(1);
>    };
>
>    // CREATE HEADER 
>    fl=getsize(fp1);
>    getheader(header,argv[3], argv[4], fl);
>    result=fwrite(header, 21, 1, fp2);
>    if(result!=1)
>    {
>      printf("Can't write to %s...!\n", argv[2]);
>      fclose(fp1);
>      fclose(fp2);
>      exit(1);
>    };
>
>    // NOT RIGHT YET 
>    conv(&high, &low, fl+2);
>    buffer[0]=low;
>    buffer[1]=high;
>    buffer[2]=255;
>    checkbit=(checkbit ^ buffer[2]);
>
>    result=fwrite(buffer,3,1,fp2);
>    if(result!=1)
>    {
>      printf("Write error in %s...!\n",argv[2]);
>      fclose(fp1);
>      fclose(fp2);
>      exit(1);
>    };
>
>    for(count=0;count<fl;count++)
>    {
>      result=fread(buffer, 1, 1, fp1);
>      if(result!=1)
>      {
>        printf("Read error in %s...!\n", argv[1]);
>        fclose(fp1);
>        fclose(fp2);              
>        exit(1);
>      };
>      result=fwrite(buffer, 1, 1, fp2);
>      if(result!=1)
>      {
>        printf("Write error in %s...!\n", argv[2]);
>        fclose(fp1);
>        fclose(fp2);
>        exit(1);
>      };
>      checkbit=(checkbit ^ buffer[0]);            
>    };
>
>    buffer[0]=checkbit;
>    result=fwrite(buffer,1,1,fp2);
>    if(result!=1)
>    {
>      printf("Write error in %s...!\n", argv[2]);
>      fclose(fp1);
>      fclose(fp2);
>      exit(1);
>    };
>
>    printf("\nConversion done...!\n");
>
>    fclose(fp1);
>    fclose(fp2);
>  };
>}
>
>
>void getheader(BYTE header[21], char *filename, char *length, unsigned int fl)
>{
>  size_t len, count;
>  BYTE checkbit=0;
>  BYTE high, low;
>
>  // MANDATORY BIT 
>  header[0]=19;    
>  header[1]=0;    
>  header[2]=0;    
>  header[3]=3;
>
>  // NEXT 10 BYTES ARE FILENAME 
>  len=strlen(filename);
>  if(len>10) len=10;
>  for(count=0; count<len; count++) header[count+4]=filename[count];
>  if(len<10)
>    for(count=len;count<10;count++) header[count+4]=32;
>
>  // CODE DATA 
>  conv(&high,&low,fl);
>  header[14]=low;    
>  header[15]=high;
>  len=atoi(length);
>  conv(&high,&low,len);    
>  header[16]=low;    
>  header[17]=high;    
>  header[18]=0;    
>  header[19]=128;
>
>  // CHECK BIT 
>  for(count=2; count<20; count++) checkbit=(checkbit ^ header[count]);
>  header[20]=checkbit;
>}
>
>
>void conv(BYTE *high, BYTE *low, size_t number)
>{
>  int temp;
>
>  *high=(BYTE)(number/256);
>  temp=(int)  (*high)*256;
>  *low=(BYTE) (number-temp);
>}
>
>
>unsigned int getsize(FILE *fp)
>{
>  fseek(fp, 0L, SEEK_END);
>  long l=ftell(fp);
>  fseek(fp, 0L, SEEK_SET); // reset file pointer 
>  return l;   
>}
></bintap.cpp>


Thank you for your very comprehensive post. I'm sure I'm going to have
lots of fun with this.

Sent from my iFurryUnderbelly.

-- 
p-0.0-h the cat

Internet Terrorist, Mass sock puppeteer, Agent provocateur, Gutter rat,
Devil incarnate, Linux user#666, BaStarD hacker, Resident evil, Monkey Boy,
Certifiable criminal, Spineless cowardly scum, textbook Psychopath, 
the SCOURGE, l33t p00h d3 tr0ll, p00h == lam3r, p00h == tr0ll, troll infâme, 
the OVERCAT [The BEARPAIR are dead, and we are its murderers], lowlife troll,
shyster [pending approval by STATE_TERROR], cripple, sociopath, kook, 
smug prick, smartarse, arsehole, moron, idiot, imbecile, snittish scumbag, 
liar, total ******* retard, shill, pooh-seur, scouringerer, jumped up chav,
lycanthropic schizotypal lesbian, the most complete ignoid, joker, and furball.

NewsGroups Numbrer One Terrorist

Honorary SHYSTER and FRAUD awarded for services to Haberdashery.
By Appointment to God Frank-Lin.

Signature integrity check
md5 Checksum: be0b2a8c486d83ce7db9a459b26c4896

I mark any message from »Q« the troll as stinky

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.sinclair


csiph-web