reloc65.h
/*
* This file is part of libsidplayfp, a SID player engine.
*
* Copyright (C) 2013-2014 Leandro Nini
* Copyright (C) 2001 Dag Lem
* Copyright (C) 1989-1997 André Fachat (a.fachat@physik.tu-chemnitz.de)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
Modified by Dag Lem <resid@nimrod.no>
Relocate and extract text segment from memory buffer instead of file.
For use with VICE VSID.
Ported to c++ by Leandro Nini
*/
#ifndef RELOC65_H
#define RELOC65_H
class reloc65
{
public:
typedef enum
{
WHOLE,
TEXT,
DATA,
BSS,
ZEROPAGE
} segment_t;
private:
int m_tbase, m_dbase, m_bbase, m_zbase;
int m_tdiff, m_ddiff, m_bdiff, m_zdiff;
bool m_tflag, m_dflag, m_bflag, m_zflag;
segment_t m_extract;
private:
int reldiff(unsigned char s);
unsigned char* reloc_seg(unsigned char *buf, int len, unsigned char *rtab);
unsigned char* reloc_globals(unsigned char *buf);
public:
reloc65();
void setReloc(segment_t type, int addr);
void setExtract(segment_t type);
bool reloc(unsigned char **buf, int *fsize);
};
#endif
reloc65
Definition: reloc65.h:38
reloc65::reloc
bool reloc(unsigned char **buf, int *fsize)
Definition: reloc65.cpp:112
reloc65::setExtract
void setExtract(segment_t type)
Definition: reloc65.cpp:107
reloc65::setReloc
void setReloc(segment_t type, int addr)
Definition: reloc65.cpp:82