X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=src%2Fcpu8051.h;h=f11122a89ef92369cf4be69499a8cea338927d3f;hb=refs%2Ftags%2Fv1.1.2;hp=da58ac58467f31da7ffa1213d294b33fd9fea891;hpb=4c305c73f8110d03b99cec045b3c5741867fd46b;p=emu8051.git diff --git a/src/cpu8051.h b/src/cpu8051.h index da58ac5..f11122a 100644 --- a/src/cpu8051.h +++ b/src/cpu8051.h @@ -1,59 +1,93 @@ -/* cpu8051.h */ - +/* + * cpu8051.h + * + * Copyright (C) 1999 Jonathan St-André + * Copyright (C) 1999 Hugo Villeneuve + * + * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef CPU8051_H #define CPU8051_H 1 +#include -void -cpu8051_Exec( void ); +/* Maximum number of BreakPoints */ +#define MAXBP 32 -void -cpu8051_Reset( void ); +struct cpu8051_t { + unsigned int pc; /* Program counter */ + unsigned long clock; + int active_priority; + int bp_count; + unsigned int bp[MAXBP]; /* List of breakpoints */ +}; -void -cpu8051_WriteD( unsigned int Address, unsigned char Value ); +/* Exported variables */ +#undef _SCOPE_ +#ifdef CPU8051_M +# define _SCOPE_ /**/ +#else +# define _SCOPE_ extern +#endif -void -cpu8051_WriteInt( unsigned int Address, unsigned char Value ); +_SCOPE_ struct cpu8051_t cpu8051; -void -cpu8051_WriteI( unsigned int Address, unsigned char Value ); +int +IsBreakpoint(unsigned int Address); -unsigned char -cpu8051_ReadD( unsigned int Address ); +void +ShowBreakpoints(void); -unsigned char -cpu8051_ReadInt( unsigned int Address ); +void +SetBreakpoint(unsigned int Address); +void +ClearBreakpoint(unsigned int Address); -unsigned char -cpu8051_ReadI( unsigned int Address ); +void +ToggleBreakpoint(unsigned int Address); +void +cpu8051_init(void); -unsigned int -cpu8051_GetNextAddress( void ); +void +cpu8051_Exec(void); void -cpu8051_WriteB( unsigned int BitAddress, unsigned char Value ); +cpu8051_Reset(void); -unsigned char -cpu8051_ReadB( unsigned int BitAddress ); +void +cpu8051_WriteD(unsigned int Address, unsigned char Value); void -cpu8051_CheckInterrupts( void ); +cpu8051_WriteI(unsigned int Address, unsigned char Value); void -cpu8051_DoTimers( void ); +cpu8051_WriteB(uint8_t bit_address, uint8_t value); -int -cpu8051_SFRMemInfo( unsigned int Address, char *Text ); +unsigned char +cpu8051_ReadD(unsigned int Address); -void -cpu8051_IntMemBitInfo( unsigned int BitAddress, char *Text ); +unsigned char +cpu8051_ReadI(unsigned int Address); -int -cpu8051_Disasm( unsigned int Address, char *Text ); +unsigned char +cpu8051_ReadB(uint8_t bit_address); +int +cpu8051_Disasm(unsigned int Address, char *Text); #endif /* CPU8051_H */