holy shit thats a lot of changed to asmrigs

This commit is contained in:
2026-01-17 23:45:36 +02:00
parent ee7735b610
commit fe1273e539
21 changed files with 645 additions and 197 deletions

14
public/asmrigs/as.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef ASMRIGS_AS_H
#define ASMRIGS_AS_H
#include "tier0/platform.h"
#include "tier1/utlbuffer.h"
struct AsOptions_t
{
};
CUtlBuffer<uint8_t> Assemble( const char *szAssembly, AsOptions_t stOptions );
#endif

6
public/asmrigs/ld.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef ASMRIGS_LD_H
#define ASMRIGS_LD_H
#include "tier0/interface.h"
#endif

View File

@@ -0,0 +1,55 @@
#ifndef ASMRIGS_TOKEN_PARSER
#define ASMRIGS_TOKEN_PARSER
#include "tier2/tokenizer.h"
class CTokenParser
{
public:
bool IsEOF();
const char *PeekToken();
bool IsToken( const char *szString );
const char *PeekStringLiteral();
bool Continue();
Token_t *m_pTokens;
Token_t *m_pTokensEnd;
Token_t *m_pCurrentToken;
};
inline const char *CTokenParser::PeekToken()
{
if ( m_pCurrentToken->m_bIsQuoted )
return NULL;
return m_pCurrentToken->m_szValue;
}
inline bool CTokenParser::IsEOF()
{
if (m_pCurrentToken == m_pTokensEnd)
return true;
return false;
};
inline bool CTokenParser::IsToken( const char *szString )
{
if ( !V_strcmp(szString, m_pCurrentToken->m_szValue))
return true;
return false;
};
inline const char *CTokenParser::PeekStringLiteral()
{
if ( !m_pCurrentToken->m_bIsQuoted )
return NULL;
return m_pCurrentToken->m_szValue;
}
inline bool CTokenParser::Continue()
{
m_pCurrentToken++;
if ( m_pCurrentToken == m_pTokensEnd )
return false;
return true;
}
#endif

View File

@@ -76,10 +76,10 @@ CUtlBuffer<T>::CUtlBuffer( const CUtlBuffer<T>& buffer ) : m_nSize(buffer.m_nSiz
// Constructor.
//-----------------------------------------------------------------------------
template <typename T>
CUtlBuffer<T>::CUtlBuffer( const CUtlResizableBuffer<T>& buffer ) : m_nSize(buffer.m_nSize)
CUtlBuffer<T>::CUtlBuffer( const CUtlResizableBuffer<T>& buffer ) : m_nSize(buffer.GetSize())
{
m_pData = (T*)V_malloc(sizeof(T)*buffer.nSize);
V_memcpy(m_pData,buffer.pData,sizeof(T)*buffer.nSize);
m_pData = (T*)V_malloc(sizeof(T)*buffer.GetSize());
V_memcpy(m_pData,buffer.GetMemory(),sizeof(T)*buffer.GetSize());
}
template <typename T>