This commit is contained in:
parent
829e58ea1c
commit
b87d55be86
13 changed files with 45 additions and 71 deletions
|
@ -237,7 +237,6 @@ int main()
|
|||
ShowScreen(LegalFilename,-1,0);
|
||||
CalcFilePos((int*)SCRATCH_RAM);
|
||||
int *Ptr=(int*)SCRATCH_RAM;
|
||||
// for (int Loop=0;Loop<FILEPOS_MAX;Loop++) printf("%i\n",*Ptr++);
|
||||
while (1)
|
||||
{
|
||||
int count = VSync( -1 );
|
||||
|
|
|
@ -50,8 +50,6 @@ DataBankEquate CFileIO::CurrentDataBank=DATABANK_MAX;
|
|||
//sFAT *FAT;
|
||||
void CFileIO::Init()
|
||||
{
|
||||
DBG_MSG0("IO INIT!!!!\n");
|
||||
|
||||
#if __FILE_SYSTEM__==PC
|
||||
FileIO=new ("CFileIO::FileIOInit") CPCFileIO(LumpNames[DataLump],&BigLump);
|
||||
#else
|
||||
|
@ -63,7 +61,7 @@ int FATSize=FileEquate_MAX*sizeof(sFAT);
|
|||
// Read Main FAT (special case load)
|
||||
MainFAT=(sFAT *)MemAlloc( FATSize,"MainFAT");
|
||||
|
||||
DBG_MSG1("FATSIZE=%i\n",FATSize);
|
||||
DBG_MSG1("IoInit:FATSIZE=%i",FATSize);
|
||||
FileIO->Open();
|
||||
|
||||
BigLump.Status = BLStatusOpen;
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
#ifndef _FILEIO_HEADER_
|
||||
#define _FILEIO_HEADER_
|
||||
|
||||
#ifndef __FILE_EQUATES_H__
|
||||
#include "BigLump.h"
|
||||
#endif
|
||||
#include "fileio\filetab.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -28,7 +28,8 @@ void CGameScene::Init()
|
|||
{
|
||||
s_genericFont=new ("CGameScene::Init") FontBank();
|
||||
s_genericFont->initialise( &standardFont );
|
||||
s_genericFont->setColour( 128, 80, 100 );
|
||||
s_genericFont->setColour( 255, 255 , 0 );
|
||||
VidSetClearScreen(1);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -38,8 +39,23 @@ void CGameScene::Shutdown()
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int X=512/2;
|
||||
int Y=256/2;
|
||||
int Dx=+7;
|
||||
int Dy=-3;
|
||||
|
||||
void CGameScene::Render()
|
||||
{
|
||||
char *Str="Sponge\nBob\nSquare\nPants";
|
||||
|
||||
X+=Dx; Y+=Dy;
|
||||
if (X<0+64) {X=0+64; Dx=-Dx;}
|
||||
if (X>512-64) {X=512-64; Dx=-Dx;}
|
||||
if (Y<0+64) {Y=0+64; Dy=-Dy;}
|
||||
if (Y>256-64) {Y=256-64; Dy=-Dy;}
|
||||
|
||||
|
||||
s_genericFont->print(X,Y,(u8*)Str);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
|
||||
#include "gfx\fdata.h"
|
||||
|
||||
#ifndef __FILE_EQUATES_H__
|
||||
#include "biglump.h"
|
||||
#endif
|
||||
|
||||
#include <UiGfx.h>
|
||||
|
||||
|
|
|
@ -22,7 +22,10 @@
|
|||
#include "system\global.h"
|
||||
#endif
|
||||
|
||||
#ifndef __FILE_EQUATES_H__
|
||||
#include <biglump.h>
|
||||
#endif
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
#ifndef _GLOBAL_HEADER_
|
||||
#include "system\global.h"
|
||||
#endif
|
||||
#ifndef __TPAGE_H__
|
||||
#include "gfx\tpage.h"
|
||||
#endif
|
||||
|
||||
#define MAX_OT (2048)
|
||||
#define MAX_PRIMS (2048+512)
|
||||
#define MAX_PRIMS (1024)
|
||||
|
||||
#define USE_NTAGS 1
|
||||
|
||||
|
|
|
@ -61,8 +61,6 @@
|
|||
static SpriteBankInstance *s_bankList = NULL;
|
||||
|
||||
|
||||
//#define SPRITE_BANK_DEBUG
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
|
@ -71,9 +69,6 @@ static SpriteBankInstance *s_bankList = NULL;
|
|||
---------------------------------------------------------------------- */
|
||||
SpriteBankInstance::SpriteBankInstance( SpriteBankInstance *_next )
|
||||
{
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf("SpriteBankInstance()\n");
|
||||
#endif
|
||||
m_frameHdr=NULL;
|
||||
m_file=FileEquate( -1 );
|
||||
m_refCount=0;
|
||||
|
@ -88,9 +83,6 @@ printf("SpriteBankInstance()\n");
|
|||
---------------------------------------------------------------------- */
|
||||
SpriteBankInstance::~SpriteBankInstance()
|
||||
{
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf("~SpriteBankInstance() file=%d\n",m_file);
|
||||
#endif
|
||||
ASSERT( !m_frameHdr );
|
||||
}
|
||||
|
||||
|
@ -100,19 +92,13 @@ printf("~SpriteBankInstance() file=%d\n",m_file);
|
|||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
int loadcount=0;
|
||||
|
||||
void SpriteBankInstance::load( FileEquate _file )
|
||||
{
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf("SpriteBankInstance::load() file=%d\n",_file);
|
||||
#endif
|
||||
if( m_refCount )
|
||||
{
|
||||
ASSERT( _file == m_file );
|
||||
m_refCount++;
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf(" loaded reference" );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -120,15 +106,8 @@ printf(" loaded reference" );
|
|||
|
||||
m_file=_file;
|
||||
m_refCount=1;
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf(" loaded physical %d",m_file );
|
||||
#endif
|
||||
}
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf(" - refcount=%d\n",m_refCount);
|
||||
#endif
|
||||
|
||||
loadcount++;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
@ -139,30 +118,17 @@ loadcount++;
|
|||
---------------------------------------------------------------------- */
|
||||
int SpriteBankInstance::dump()
|
||||
{
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf("SpriteBankInstance::dump() file=%d\n",m_file);
|
||||
#endif
|
||||
int ret=false;
|
||||
ASSERT(m_frameHdr);
|
||||
|
||||
m_refCount--;
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf(" refcount now %d",m_refCount);
|
||||
#endif
|
||||
if( m_refCount == 0 )
|
||||
{
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf(" ..freeing\n");
|
||||
#endif
|
||||
TPFree(m_tpageDesc);
|
||||
MemFree(m_frameHdr);
|
||||
m_frameHdr=NULL;
|
||||
ret=true;
|
||||
}
|
||||
#ifdef SPRITE_BANK_DEBUG
|
||||
printf("\n");
|
||||
#endif
|
||||
loadcount--;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -176,14 +176,14 @@ sTPageInfo *Cache;
|
|||
|
||||
if (TPage) // Is in cache, no need to load it again :o)
|
||||
{
|
||||
DBG_MSG2("TPLoadTex Cached (%i,%i)",TPage,Half);
|
||||
// DBG_MSG2("TPLoadTex Cached (%i,%i)",TPage,Half);
|
||||
s_TPCache[TPage].Info[Half].RefCount++;
|
||||
Cache=&s_TPCache[TPage].Info[Half];
|
||||
FramePtr=&Cache->AnimTexFrame[0];
|
||||
}
|
||||
else
|
||||
{ // Better load it then
|
||||
DBG_MSG0("TPLoadTex");
|
||||
// DBG_MSG0("TPLoadTex");
|
||||
TPHdr=(sTPageHdr*)CFileIO::loadFile(Filename,"TPLoadTEX");
|
||||
ASSERT(!TPHdr->NumOfSpareBoxes);
|
||||
FramePtr=(sFrameHdr*) MakePtr(TPHdr,sizeof(sTPageHdr));
|
||||
|
@ -230,13 +230,13 @@ int ReadLeft;
|
|||
|
||||
if (TPage) // Found one!!
|
||||
{
|
||||
DBG_MSG2("TPLoadTexWithHeaders Cached (%i,%i)",TPage,Half);
|
||||
// DBG_MSG2("TPLoadTexWithHeaders Cached (%i,%i)",TPage,Half);
|
||||
s_TPCache[TPage].Info[Half].RefCount++;
|
||||
Cache=&s_TPCache[TPage].Info[Half];
|
||||
}
|
||||
else
|
||||
{
|
||||
DBG_MSG0("TPLoadTexWithHeaders");
|
||||
// DBG_MSG0("TPLoadTexWithHeaders");
|
||||
CFileIO::OpenFile(Filename);
|
||||
// Load Main Header
|
||||
CFileIO::ReadFile((void*)&TPHdr,sizeof(sTPageHdr));
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
/*** PSX Vram Stuff ***/
|
||||
/**********************/
|
||||
|
||||
#ifndef __VRAM_H__
|
||||
#define __VRAM_H__
|
||||
#ifndef __TPAGE_H__
|
||||
#define __TPAGE_H__
|
||||
|
||||
#ifndef __FILE_EQUATES_H__
|
||||
#include <BigLump.h>
|
||||
#endif
|
||||
|
||||
/*************************************************************************************************/
|
||||
#define TPAGE_MAX_ANIM_TEX 8
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "mem\memory.h"
|
||||
#endif
|
||||
|
||||
#ifndef __BigLump_H__
|
||||
#ifndef __FILE_EQUATES_H__
|
||||
#include <biglump.h>
|
||||
#endif
|
||||
|
||||
|
|
|
@ -402,20 +402,6 @@ int BestNode,FirstNode;
|
|||
}
|
||||
Head = mem->Nodes[ Head ].Next;
|
||||
}
|
||||
//--------------------
|
||||
#ifdef MemPrintx
|
||||
if (Len>300000)
|
||||
{
|
||||
Head=mem->Head;
|
||||
while (Head != 0xffff)
|
||||
{
|
||||
printf("%i %i\n",Head,(int)mem->Nodes[Head].Len);
|
||||
Head = mem->Nodes[ Head ].Next;
|
||||
}
|
||||
}
|
||||
if (FirstNode!=BestNode)
|
||||
printf("Need %i, %i (%i) \t%i (%i) \n",(int)Len,FirstNode,(int)mem->Nodes[FirstNode].Len, BestNode,(int)mem->Nodes[BestNode].Len);
|
||||
#endif
|
||||
|
||||
//--------------------
|
||||
// Alloc it
|
||||
|
|
|
@ -303,8 +303,6 @@ int PortShift=Port<<4;
|
|||
}
|
||||
if ( Pad->Send==0 )
|
||||
{
|
||||
printf("%d,%d\n",Pad->Motor0,Pad->Motor1);
|
||||
|
||||
PadSetAct(PortShift,&(Pad->Motor0),2);
|
||||
|
||||
if (Pad->Status == PadStateFindCTP1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue