Logo Search packages:      
Sourcecode: cbmlink version File versions  Download package

int save ( const struct comm comm,
unsigned  bank,
unsigned  start,
unsigned  end,
void *  buf 
)

save a memory area

Parameters:
comm the communication primitives
bank memory bank (0=normal)
start start address (inclusive)
end end address (exclusive)
buf (output) the saved data
Returns:
zero on success, nonzero on error

Definition at line 78 of file mem.c.

References comm::comm_read, comm::comm_rs, comm::comm_sr, mem_op(), and REQ_SAVE.

Referenced by ext(), jump_cart(), resolve_addr(), and save_file().

{
  if (mem_op (comm, REQ_SAVE, bank, start, end))
    return 1;
  (*comm->comm_sr) ();
  if ((*comm->comm_read) (buf, end == start
                    ? 0x10000
                    : (end - start) & 0xffff))
    return 2;
  (*comm->comm_rs) ();
  return 0;
}


Generated by  Doxygen 1.6.0   Back to index