00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef RELOC65_H
00030 #define RELOC65_H
00031
00032 class reloc65
00033 {
00034 public:
00035 typedef enum
00036 {
00037 WHOLE,
00038 TEXT,
00039 DATA,
00040 BSS,
00041 ZEROPAGE
00042 } segment_t;
00043
00044 private:
00045 bool m_tflag, m_dflag, m_bflag, m_zflag;
00046 int m_tbase, m_dbase, m_bbase, m_zbase;
00047 int m_tdiff, m_ddiff, m_bdiff, m_zdiff;
00048
00049 segment_t m_extract;
00050
00051 private:
00052 static int read_options(unsigned char *buf);
00053 static int read_undef(unsigned char *buf);
00054
00055 int reldiff(unsigned char s);
00056 unsigned char *reloc_seg(unsigned char *buf, int len, unsigned char *rtab);
00057 unsigned char *reloc_globals(unsigned char *buf);
00058
00059 public:
00060 reloc65();
00061
00068 void setReloc(segment_t type, int addr);
00069
00075 void setExtract(segment_t type);
00076
00083 bool reloc(unsigned char **buf, int *fsize);
00084 };
00085
00086 #endif