HP Forums
Looking for YFN* images (last) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Looking for YFN* images (last) (/thread-4129.html)



Looking for YFN* images (last) - cgh - 06-11-2015 09:42 AM

Hello,

I experienced problems when trying to download the last YF* and YLIB* images (.ROM) from the 41CL/software page. The images are shown as characters on the browser, instead to be downloaded. It is working for the .SRC and the .ZIP.

So, if someone could send me or provide a zip with the last updates for the YFNZ-4E.ROM, YFNP-1E.ROM, YFNF-1B.ROM, YFNX-2B.ROM and YLIB-2E.ROM images, it will help me.

Thanks,

Christophe


RE: Looking for YFN* images (last) - Dieter - 06-11-2015 10:46 AM

(06-11-2015 09:42 AM)cgh Wrote:  I experienced problems when trying to download the last YF* and YLIB* images (.ROM) from the 41CL/software page. The images are shown as characters on the browser, instead to be downloaded. It is working for the .SRC and the .ZIP.

Err... just to be sure: a simple (left) click on the links of course does not work (unless your browser knows how to handle files with the extension ".ROM", which is quite unlikely). Simply right click and select "save target as..." or whatever your browser calls it.

Dieter


RE: Looking for YFN* images (last) - rprosperi - 06-11-2015 11:47 PM

(06-11-2015 10:46 AM)Dieter Wrote:  
(06-11-2015 09:42 AM)cgh Wrote:  I experienced problems when trying to download the last YF* and YLIB* images (.ROM) from the 41CL/software page. The images are shown as characters on the browser, instead to be downloaded. It is working for the .SRC and the .ZIP.

Err... just to be sure: a simple (left) click on the links of course does not work (unless your browser knows how to handle files with the extension ".ROM", which is quite unlikely). Simply right click and select "save target as..." or whatever your browser calls it.

Dieter

To clarify a bit, Didier's suggestion is correct, however on some browsers, there is still a small issue. When doing as he suggests (Save as...) the file type is set as filename.HTML, but the actual contents are the correct filename.ROM. So you can either save the file and then rename it (rename filename.HTML to filename.ROM) or change the file type in the Save as dialog.

Monte is aware of the issue, but it isn't easily controlled since it's a browser side issue (I think when we tested IE and FF had this issue, but don't recall for sure).

HTH


RE: Looking for YFN* images (last) - cgh - 06-15-2015 10:59 AM

(06-11-2015 11:47 PM)rprosperi Wrote:  
(06-11-2015 10:46 AM)Dieter Wrote:  Err... just to be sure: a simple (left) click on the links of course does not work (unless your browser knows how to handle files with the extension ".ROM", which is quite unlikely). Simply right click and select "save target as..." or whatever your browser calls it.

Dieter

To clarify a bit, Didier's suggestion is correct, however on some browsers, there is still a small issue. When doing as he suggests (Save as...) the file type is set as filename.HTML, but the actual contents are the correct filename.ROM. So you can either save the file and then rename it (rename filename.HTML to filename.ROM) or change the file type in the Save as dialog.

Monte is aware of the issue, but it isn't easily controlled since it's a browser side issue (I think when we tested IE and FF had this issue, but don't recall for sure).

HTH

Thank you. In fact, I asked the ROM images to Monte, and he kindly sent me a zip with these images.
Just before, I wrote a small C program (tested on Linux, but may be work on WIndows), to convert the .SRC (in fact .LST) to a ROM image. The result was good because my generated ROM and these received from Monte'zip have the same MD5 checksum.

Christophe

Code:
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <stdlib.h>

int main( int argc, char **argv )
{
  FILE *fdi; int fdo;
  char bufs[1000];
  char *p;
  unsigned int addr, oaddr, opcode, line;
  unsigned char rom[4096*2];
  unsigned int cksm = 0;
  unsigned char page = '0';

  memset( rom, 0, sizeof(rom) );
  if( (argc != 3) && (argc != 4) ) {
    fprintf(stderr,"usage: %s file.SRC file.ROM [page]\n", argv[0] );
    exit( 1 );
  }
  if( argc == 4 )
    page = *argv[3];
  if( NULL == (fdi = fopen( argv[1], "r" )) ) {
    fprintf(stderr,"Unable to open SRC file '%s': %m\n", argv[1] );
    exit( 1 );
  }
  if( 0 > (fdo = open( argv[2], O_WRONLY | O_CREAT | O_TRUNC, 0644 )) ) {
    fprintf(stderr,"Unable to open ROM file '%s': %m\n", argv[2] );
    fclose( fdi );
    exit( 1 );
  }
  oaddr = addr = 0;
  line = 0;
  while( fgets( bufs, sizeof(bufs), fdi ) ) {
    line ++;
    if( NULL == (p = strtok( bufs, "\n\r" )) )
      continue;
    if( *p == '\0' )
      continue;
    if( NULL == (p = strtok( bufs, " \t" )) )
      continue;
    if( (*p == '*' && *(p+1) == page ) )
      p++;
    if( *p == page ) {
      char strop[4];
      oaddr = addr;
      sscanf( p, "%0X", &addr );
      addr &= 0xFFF;
      if( oaddr != addr ) {
        fprintf( stderr, "Ooops: (%u) Address mismatch: O %04X A %04X\n", line, oaddr, addr );
      }
      p = strtok( NULL, " \t" );
      while( *p ) {
        memset( strop, 0, sizeof(strop) );
        memcpy( strop, p, 3 );
        p += 3;
        sscanf( strop, "%X", &opcode );
        rom[(addr * 2)] = ((opcode >> 8) & 0xFF);
        rom[(addr * 2)+1] = ((opcode) & 0xFF);
        fprintf( stderr, "%04X %03X\n", addr, opcode );
        addr ++;
      }
    }
  }
  fclose( fdi );

  for( addr = 0; addr < 4095; addr++ )
    {
    cksm += ((rom[(addr * 2)] << 8) | (rom[(addr * 2)+1]));

    if( 0x3FF < cksm )
      cksm = (cksm & 0x3FF) + 1;
    }
  cksm = (~cksm + 1) & 0x3FF;
  printf( "COMPUTED CKSM %03X\n", cksm );
  if( rom[0x1FFE] == 0 && rom[0x1FFF] == 0 ) {
    rom[0x1FFE] = ((cksm >> 8) & 0xFF);
    rom[0x1FFF] = ((cksm) & 0xFF);
  }

  write( fdo, rom, sizeof(rom) );
  close( fdo );
}