Quelltext /~heha/hs/borg.zip/DISIO.H

//	 disio.h
//
// - added version 2.11

#ifndef disio_h
#define disio_h

#include "list.h"
#include "common.h"
#include "proctab.h"
#include "stacks.h"
#include "disfuncs.h"
#include "savefile.h"

// display flags
#define DISPFLAG_NEGATE 1
//#define BUFFER_LINES 60
#define MAX_LENGTH 200
#define MAX_STRINGPRINT (MAX_LENGTH-60)
typedef char dasm_line[MAX_LENGTH];

//associated structure with any View window
class disio {
public:
 HWND wnd;		// window handle for back-link
 POINT size;		// size in character cells
 int sel;		// highlighted line number, -1 if none
 int lastline;
 int hpos;		// view shifted to left (in characters?)
// bool bufferbusy;	// igitt!
 dasm_line *MainBuff;	// variable array of dasm_line, size.y entries

 lptr curraddr;		// disassembly address to top line of output
 dsmitemtype subitem;	// (multi-line) subindex to top line of output
 lptr outend;
 stack retstack;	// user jump-back history
 int selstack[CALLSTACKSIZE];	// parallel stack for highlighted line
// cannot be put into retstack without changing the database structure, damn!

public:
   disio(HWND w);
   ~disio();
   void dumptofile(char *fname,bool printaddrs);
   void dumpblocktofile(char *fname,bool printaddrs);
   void outcomment(dsmitem *inst);
   void outargs(dsmitem *inst,argtype a);
   void updatewindow(void);
   void scroller(int amount);
   void updatewindowifinrange(lptr loc);
   void savecuraddr(void);		// put curaddr to stack
   bool follow(const lptr &loc);	// show address and save current
   void findcurrentaddr(lptr *loc);
   int  findaddr(const lptr &loc);	// locates (last?) line in screen with address
   void vertsetpos(int pos);
   void setscrollpos(lptr loc);		// absolute scroll bar positioning
   void jumpback(void);
   void jumpto(bool arg1);
   dsmitem *findcurrentline(void);
   void setcuraddr(lptr loc);		// show a page with this addr on top
   void setpos(int ypos);
   void outinst(dsmitem *inst,bool printaddrs);
   void outdb(lptr *lp,bool printaddrs);
   void outprefix(byte prefixbyte);
   void argoverdec(void);
   void argoversingle(void);
   void arg_negate(void);
   void argoverhex(void);
   void argoveroffsetdseg(void);
   void argoverchar(void);
   void makecode(void);
   void makeword(void);
   void makedword(void);
   void makesingle(void);
   void makedouble(void);
   void makelongdouble(void);
   void makestring(void);
   void pascalstring(void);
   void ucstring(void);
   void upstring(void);
   void dosstring(void);
   void generalstring(void);
   void updatewindowifwithinrange(lptr loc_start,lptr loc_end);
   void GetItemRect(int item, PRECT R);	// calculates the rectangle
   void DoPaint(void);			// WM_PAINT handler
   void ClearBuff(void);
   void DoneBuff(void);
//   void horizscroll(int amount);
//   void horizscrollto(int place);
   void PrintBuff(char *szFormat,...);
   void LastPrintBuffEpos(int xpos);	// append spaces (no tabs)
   void LastPrintBuffHexValue(byte num);
   void LastPrintBuffLongHexValue(dword num);
   void LastPrintBuff(char *szFormat,...);
   void DumpBuff(HANDLE efile);

 private:
   void printlineheader(lptr loc,bool printaddrs);
   bool issegprefix(byte byt);
   bool isprefix(byte byt);
};

extern disio *cvd;	// pointer to focused window "CurrentViewData"

#endif
Vorgefundene Kodierung: ASCII (7 bit)2