Results 1 to 2 of 2
  1. #1
    EmuTalk Member
    Join Date
    Feb 2002
    Posts
    19

    [delphi, nes emu] - opening a ROM

    I'm now trying to open a ROM image,as he do, but it gives sometimes a error (winnes too btw).
    I/O error 6.
    Alright, i know it probably a stupid question so don't laugh....
    I think a PS2 emulator is ready tomorrow, which runs GTA3 perfectly :p

    Or is it better to use a 'Stream'?, i have only experience with normal textfiles.
    Hope someone can help me with this, thanks.




    type
    TRomHeader = record
    RomType : array[1..3] of char;
    Ctrl,
    PRGROM,
    CHRRAM,
    ROMctrl1,
    ROMctrl2 : char;
    Expansion : array[0..7] of char;
    end;


    procedure TfrmNES.Button1Click(Sender: TObject);
    var
    F : File;
    i : Integer;
    RomHeader : TRomHeader;
    begin
    AssignFile(F, OpenDialog1.FileName);

    if OpenDialog1.Execute then
    begin

    Reset(F, 1);

    i := SizeOf(ROMHeader);
    BlockRead(F, ROMHeader, SizeOf(ROMHeader), i);
    edit9.Text := inttostr(SizeOf(ROMHeader));
    edit10.Text := inttostr(i);

    edit1.Text := RomHeader.RomType;
    edit2.Text := RomHeader.Ctrl;
    edit3.Text := RomHeader.PRGROM;
    edit4.Text := RomHeader.CHRRAM;
    edit5.Text := RomHeader.ROMctrl1;
    edit6.Text := RomHeader.ROMctrl2;
    edit7.Text := RomHeader.Expansion;

    CloseFile(F);

    end;
    end;


    • Advertising

      advertising
      EmuTalk.net
      has no influence
      on the ads that
      are displayed
        
       

  2. #2
    EmuTalk Member
    Join Date
    Feb 2002
    Posts
    19
    well if found the solution.
    i try to open the file before assigning the variable...

    i know stupid !!!

    You can close thsi thread...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •