当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- 文件拷贝的实现
- leetcode之反转字符串中的元音字母
- Review of API knowledge
- AQS 都看完了,Condition 原理可不能少!
- STC转STM32第一次开发
- What are the basic requirements for big data posts?
- Test comparison of three domestic cloud databases
- C / C + + Programming Notes: pointer! Understand pointer from memory, let you understand pointer completely
- Dynamic relu: Microsoft's refreshing device may be the best relu improvement | ECCV 2020
- 非阻塞的无界线程安全队列 —— ConcurrentLinkedQueue
猜你喜欢
简单介绍c#通过代码开启或关闭防火墙示例
SAP S/4HANA 2020安装实录
写时复制集合 —— CopyOnWriteArrayList
C / C + + Programming Notes: pointer! Understand pointer from memory, let you understand pointer completely
服务器性能监控神器nmon使用介绍
STS安装
How to reduce the resource consumption of istio agent through sidecar custom resource
Introduction skills of big data software learning
STC转STM32第一次开发
C++邻接矩阵
随机推荐
Several common playing methods of sub database and sub table and how to solve the problem of cross database query
第五章编程
上线1周,B.Protocal已有7000ETH资产!
写时复制集合 —— CopyOnWriteArrayList
文件拷贝的实现
如何将 PyTorch Lightning 模型部署到生产中
Nodejs中request出现ESOCKETTIMEDOUT解决方案
当我们聊数据质量的时候,我们在聊些什么?
leetcode之反转字符串中的元音字母
Installation record of SAP s / 4hana 2020
AQS 都看完了,Condition 原理可不能少!
你有没有想过为什么交易和退款要拆开不同的表
AI人工智能编程培训学什么课程?
c++11-17 模板核心知识(二)—— 类模板
Introduction skills of big data software learning
Aprelu: cross border application, adaptive relu | IEEE tie 2020 for machine fault detection
华为HCIA笔记
用两个栈实现队列
SQL语句的执行
数据库设计:范式与反范式