当前位置:网站首页>How does FC game console work?
How does FC game console work?
2020-11-09 00:28:00 【shzwork】

(NES PPU)
Do a simple calculation :
The resolution of the 256x240 = 61440, That is, there are so many pixels on the screen .( Ignore NTSC Loss of system 16 That's ok ,PAL The system is 256x240)
If we only show black and white , That is, every pixel is black or white , So a single pixel bit That's all right. , At such a high resolution , Total needs 1 * 61440 / 8 / 1024 = 7.5KB, If you do this directly, the black and white dots can't fit the host video memory , At that time, the better computers were just about the same .
Let's say we use the very common 256 color , namely 8 Binary bits , A byte store , The whole picture 61440 / 1024 = 60KB, This is in FC Time is something that no ordinary machine can do directly .

To show color , At that time, different machines had various techniques , It can be said that the eight immortals cross the sea and show their magical powers .FC The first method used is called Color Cell, say concretely :
- Divide the whole image into many 8x8 Small cell ( Or call it tile)
- Every cell At most there is 4 Color
such , Each pixel only uses 2bit To store colors , And then to the total 32x30 = 960 individual cell Redistribute color coding , Indicates which colors are available .
Take a chestnut , We know the devil city (Castlevania, 1986) start :( The picture is from [dustmop.io blog])

The smallest lattice in the graph ( All the light lines cut out ) That is, a cell or tile, four tile Form a block( It's just a bright line ). In the picture, we use 10 Color . You can't find any more than 4 Colored cell.
Let's see another one. I'm the top one :

Encoding cell The table will be stored in video memory called name table In the region , Just now the opening area code of demon city is shaped as shown in the figure below :

FC The second brilliant thing is the advanced scrolling technology , because PPU There are two inside ( After the mirror image, there are four )name table To store cell Table information , We can always pre store more than the display , After the player or program triggers the scrolling operation , By sending two registers PPUSCROLL and PPUCTRL Write relevant information , You can move the game lens .
stay FC Previous hosts , Scrolling almost always covers the whole screen , It's expensive .FC At the same time, it makes the action 、 Shooting games have been greatly developed .
The last part is the movement in the game Sprite, Stored in a specific built-in memory area of the graphics card , Usually a single size is 8x8 or 8x16, Most of the protagonists we see are many Sprite Put together , such as Mario It's actually 4 individual Sprite Spell out , Just make sure it doesn't fall apart in the program .
Sprite Is displayed over the background , No matter how the background is set , stay PPU Conduct Sprite After detection, the corresponding bit will be set to Sprite The color of .
Last ,btw, Basically all FC/NES Development materials can be found in NES dev And its appendages wiki Found on the , It's just that without the relevant professional knowledge, it may be more difficult to gnaw .
Chinese people's 《 Nintendo game programming 》 Generally speaking, the book is more detailed , However, many key points are vague , And spent a lot of time teaching how to write code . It's good for the layman , It's basically useless for professionals . what's more , The book says little about Rationale Things that are , For real learning, it's disastrous .
http://nesdev.com/NESDoc.pdf
The basic principles are written in this document . The core is CPU(Central Processing Unit) and PPU(Picture Processing Unit),PPU It's a wonderful design .

Github There are various versions of NES Simulator source code , Through this code, you can understand more clearly NES Operation process :
- go + OpenGL video + PortAudio Audio :fogleman/nes · GitHub
- javascript + dynamicaudio Audio :bfirsh/jsnes · GitHub
- Rust : pcwalton/sprocketnes · GitHub
- C++ :Cephas1982/NES · GitHub ( This is not finished yet )
FC Image controller developed by Ricoh (PPU), Yes 2KB Video memory of , The palette shows 48 Color and 5 A gray scale . One screen can show 64 A character (sprites) , The role format is 8x8 or 8x16 Pixel , One scan line shows at most 8 A character , Although this limit can be exceeded , But it causes the character to blink . The background can only show one scroll , The resolution of the picture is 256x240 , But because NTSC System limitations , Can't show top and bottom 8 Scanning lines , So the resolution remains 256x224.
Architecturally ,FC There's a pseudo sound processor (pseudo-Audiom Processing Unit,pAPU), In real hardware , This processor is integrated into 2A03 NMOS In the processor [2].pAPU Built in 2 It's almost the same (nearly-identical) The rectangular wave channel of ,1 Three triangular channels ,1 Noise channels and 1 Audio sample playback channels (DCM, Delta modulation mode )[2]. among 3 There are analog channels for playing music ,1 A murmur channel shows a special sound effect ( Explosions , Gunfire, etc ), The audio sample playback channel can be used to represent continuous background sound .
FC There is a reset switch on the mainframe 、1 A power switch 、1 Game card slots 、2 One with a cross direction key 2 Key handle ( Game controller ), On the main handle “ choice ” and “ Start ” Button . There is a power interface on the back of the host 、RF RF output interface 、 Video image output interface 、 Audio out connector . There is also an expansion port ahead , Used to connect the light gun 、 Additional external devices such as continuous transmitter handle .
FC Games are usually stored in the form of read-only memory in a game card that can be plugged into the host slot , Capacity is LA series 24K,LB series 40K,LC series 48K,LD series 64K,LE series 80K,LF series 128K,LG series 160K,LH series 256K, Teka series and all in one cassette tape, etc . There are also some with batteries to keep game progress .
1986 year 2 month 21 Japan , Nintendo also launched a FC Disk drive , Can be in FC Host through the converter to use a dedicated floppy drive to read and write games , The capacity of the floppy disk is 112KB.
版权声明
本文为[shzwork]所创,转载请带上原文链接,感谢
边栏推荐
- Copy on write collection -- copyonwritearraylist
- 23张图,带你入门推荐系统
- Factory Pattern模式(简单工厂、工厂方法、抽象工厂模式)
- The vowels in the inverted string of leetcode
- 国内三大云数据库测试对比
- A few lines of code can easily transfer traceid across systems, so you don't have to worry about losing the log!
- 作业2020.11.7-8
- 基于链表的有界阻塞队列 —— LinkedBlockingQueue
- 1.操作系统是干什么的?
- Five factors to consider before choosing API management platform
猜你喜欢

Programmers should know the URI, a comprehensive understanding of the article

The vowels in the inverted string of leetcode

How to get started with rabbitmq

【200人面试经验】,程序员面试,常见面试题解析

How to reduce the resource consumption of istio agent through sidecar custom resource

Esockettimeout solution in request in nodejs

Flink的DataSource三部曲之三:自定义

SaaS: another manifestation of platform commercialization capability

Copy on write collection -- copyonwritearraylist

Swagger介绍和应用
随机推荐
Introduction and application of swagger
Fiddler can't grab requests from browsers like Google_ Solution
AI人工智能编程培训学什么课程?
写时复制集合 —— CopyOnWriteArrayList
android开发中提示:requires permission android.permission write_settings解决方法
What are the basic requirements for big data posts?
How to make scripts compatible with both Python 2 and python 3?
Introduction to nmon
APReLU:跨界应用,用于机器故障检测的自适应ReLU | IEEE TIE 2020
Programmers should know the URI, a comprehensive understanding of the article
Travel notes of csp-s 2020
Python features and building environment
Pipedrive如何在每天部署50+次的情况下支持质量发布?
平台商业化能力的另一种表现形式SAAS
Mobile big data own website precise marketing and accurate customer acquisition
How does semaphore, a thread synchronization tool that uses an up counter, look like?
基于链表的有界阻塞队列 —— LinkedBlockingQueue
salesforce零基础学习(九十八)Salesforce Connect & External Object
Computer network application layer
Copy the picture