⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pacmandriver.h

📁 VIGASOCO (VIdeo GAmes SOurce COde) Windows port (v0.01)
💻 H
字号:
// PacmanDriver.h
//
//	Reverse engineered and converted by MAB <vigasoco@yahoo.es>
//
//	Conversion notes:
//	=================
//		* pacman fills a task list in the IRQ routine, that gets executed after the IRQ
//		(sometimes it takes more than one frame to finish the task list of a previous
//		frame). In the conversion, those tasks are executed as soon as the game needs
//		them, but i have a special treatment for ghost movements, because the order of
//		execution for those tasks is crucial to avoid walking through the walls.
//
//		* the game uses a linear function and the first 0x2000 bytes of program code
//		as a random number generator. The conversion uses rand() instead.
//
//		* fixed split screen bug (in level 255). 
//
//	TO DO:
//	======
//		* transform bizarre video hardware coordinates (tiles and sprites) to linear
//		hardware coordinates.
//
//		* add sound, precalculating the samples on init().
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _PACMAN_DRIVER_H_
#define _PACMAN_DRIVER_H_


#include "GameDriver.h"

#include "pacman/Game.h"

class PacmanDriver : public GameDriver
{
// fields
protected:
	Game *_pacmanGame;				// main game object
	int _innerInfoMode;				// current info mode

	// VRAM/CRAM tile caching
	UINT8 *_oldVRAM;
	UINT8 *_oldCRAM;
	int _cacheBitmap;

// methods
public:
	// initialization and cleanup
	PacmanDriver();
	virtual ~PacmanDriver();

	virtual void run();
	virtual void render(IDrawPlugin *dp);
	virtual void showGameLogic(IDrawPlugin *dp);

	// template methods overrides
	virtual void videoInitEnd(IDrawPlugin *dp);
	virtual void videoEndStart(IDrawPlugin *dp);

protected:
	// template methods overrides
	virtual void filesLoaded();
	virtual void finishInit();
	virtual void startEnd();

	// helper methods
	void createGameDataEntities();
	void createGameGfxDescriptions();
	void createGameInputsAndDips();

	void drawGrid(IDrawPlugin *dp);
	void drawDestPos(IDrawPlugin *dp);
};

#endif	// _PACMAN_DRIVER_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -