File:  [Isaki's NoNo m68k/m88k emulator] / nono / vm / sprite.h
Revision 1.1.1.11 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:05:42 2026 UTC (3 months ago) by root
Branches: MAIN, Isaki
CVS tags: v027, v026, v025, v024, v023, HEAD
nono 1.3.0

//
// nono
// Copyright (C) 2020 nono project
// Licensed under nono-license.txt
//

//
// スプライトコントローラ
//

#pragma once

#include "device.h"

class SpriteDevice : public IODevice
{
	using inherited = IODevice;

	static const uint32 baseaddr = 0xeb0000;

	struct sprite_scroll {
		uint16 xpos;
		uint16 ypos;
		uint16 col;
		uint16 prw;
	} __attribute__((__packed__));

	struct sprite_ctrl {
		struct sprite_scroll sprite[128];

		uint16 bg0x;
		uint16 bg0y;
		uint16 bg1x;
		uint16 bg1y;
		uint16 bgctrl;

		uint16 htotal;		// 水平トータル
		uint16 hdisp;		// 水平表示位置
		uint16 vdisp;		// 垂直表示位置
		uint16 res;			// 解像度
	};

 public:
	SpriteDevice();
	~SpriteDevice() override;

	bool Init() override;

	busdata Read(busaddr addr) override;
	busdata Write(busaddr addr, uint32 data) override;
	busdata Peek1(uint32 addr) override;

 private:
	busdata Get16(uint32 addr) const;
	busdata Set16(uint32 addr, uint32 data);

	struct sprite_ctrl reg {};
	std::unique_ptr<uint8[]> mem {};
};

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.