当前位置:网站首页>用C语言开发NES游戏(CC65)04、完整的背景
用C语言开发NES游戏(CC65)04、完整的背景
2022-07-28 11:26:00 【firseve】
粘贴到CSDN格式没调,想看格式好的点下面
https://happysoul.github.io/nes/nesdoug/
制作一张全屏显示的背景图
(备注:这里的RLE是作者将图片变成NES可以识别加载的贴图,这么搞太难翻译了。。。)
NES Screen Tool
http://www.romhacking.net/utilities/802/
我写了另一篇关于将BMP文件导入NES Screen Tool的博客页面。这里…
https://nesdoug.com/2017/04/22/nes-screen-tool-bmp-import/
(后面我再花时间翻译了放在这篇文章最后,BMP变贴图)
rl3.chr),并且我已将我的NES屏幕工具(.nss)文件保存为压缩的rle文件,“Nametable / Save Nametable和Attributes / RLE打包为C头.h”。现在我们可以将它导入C代码,并将其打印到后台。
完整名称表是1024字节。我们不能在屏幕打开的情况下执行此操作,因此将其关闭,然后设置起始地址,并调用rle函数。
ppu_off();
vram_adr(NAMETABLE_A);
vram_unrle(Girl3);
ppu_on_all();
到目前为止,我忘了提到调色板。我不得不改变它以使它成为棕色阴影。我稍后会更详细地讨论这个问题。pal_bg() 设置背景的调色板。

https://github.com/nesdoug/04_FullBG/blob/master/fullBG.c
https://github.com/nesdoug/04_FullBG
通过neslib我们可以很容易改变屏幕的亮度,你可以使用pal_bright(),数值范围 0-8 (对应 黑-白)4是正常
我借用了Shiru的“Chase”游戏中的一个功能,这功能很简单实用。
pal_fade_to(0,4); // 黑色渐变到正常色
pal_fade_to(4,0); // 从正常色渐变到黑色
如果你运行fade.nes文件,你会看到它在无限循环中淡入淡出。淡入淡出可用于过渡,例如从标题到游戏,或从一个级别到另一个级别。
https://github.com/nesdoug/05_Fade/blob/master/fade.c
https://github.com/nesdoug/05_Fade
NES屏幕工具BMP导入
最新版本的NES Screen Tool改进了BMP导入功能。我打算试一试。BMP必须是16色或256色。我认为16色效果更好。
我在互联网上找到了这张图片。我将图像缩小为256×240。

使用GIMP,我调节了饱和度,让他不会失真。

我第一次尝试是将背景变暗,然后转换为NES颜色(我之前使用NES调色板制作了一个自定义调色板)。然后,图像/模式/索引,并选择NES调色板。然后我的图像/模式/ RBG。然后我图像/模式/索引,优化到16色。这是我们的......

然后,我导入了NES Screen Tool,只检查了“失真”。这就是我得到的。

嗯,效果很差,那就重来一次,调整分辨率大小到 256x240,锐化处理,背景调黑。
图像/模式/灰度,然后是图像/模式/ RGB。然后我选择了铅笔工具(或画笔),并将其模式更改为“颜色”并选择了橙色,然后像双色调一样重新着色灰色图像。(我也再次调整了水平)。

现在...图像/模式/索引,选择NES调色板。图像/模式/ RGB。图像/模式/索引,针对4色进行了优化。图像/模式/ RGB。图像/模式/索引,针对16色优化。(如果你有最终的16种颜色,NES Screen Tool似乎会做得更好)。

这就是GIMP中最终版本的样子。让我们再次从NES Screen Tool导入BMP(仅检查'失真')......(我在NES Screen Tool中修改了一些图块)。

好多了。
下次我要将它作为背景导入,压缩为RLE文件。
边栏推荐
- PHP date calculation operation processing, the current date plus one day and the specified date minus one day
- Code simplification
- Open source database innovation in the era of digital economy | the 2022 open atom global open source summit database sub forum was successfully held
- 使用百度飞桨 EasyDL 完成垃圾分类
- Matlab sets the size of graphics window and image and the position of legend
- 易观分析:以用户为中心提升手机银行用户体验,助力用户价值增长
- [diary of supplementary questions] [2022 Niuke summer multi school 2] l-link with level editor I
- 【Try to Hack】内网基础
- 【Try to Hack】AT、SC、PS命令提权
- Rest style
猜你喜欢

Alexnet - paper analysis and reproduction

Unitywebrequest is used in unity to load network and local pictures

"Weilai Cup" 2022 Niuke summer multi school training camp 2

IRBuilder

聚变云原生,赋能新里程 | 2022 开放原子全球开源峰会云原生分论坛圆满召开

Open source database innovation in the era of digital economy | the 2022 open atom global open source summit database sub forum was successfully held

腾讯二面:@Bean 与 @Component 用在同一个类上,会怎么样?

Full resolution of the use of go native plug-ins

To build agile teams, these methods are indispensable

LyScript 获取上一条与下一条指令
随机推荐
Force deduction solution summary 735 planetary collision
SQL注入 Less26(过滤空格和注释符,使用不带空格的报错注入)
The principle and use of the wrap file of tolua
Exploration on cache design optimization of community like business
【vulnhub】Raven2
Test platform (V) knowledge points supplement
[diary of supplementary questions] [2022 Niuke summer multi school 2] i-let fat tension
Laravel $object->updated_at 返回的是Carbon对象,如何返回正常时间格式
IRBuilder
WebView详解
分布式定时器
Interpretation of the paper: attention mechanism in medical images
[try to hack] UDF raises rights
php 日期计算操作处理,当前日期加一天和指定日期减一天
聚变云原生,赋能新里程 | 2022 开放原子全球开源峰会云原生分论坛圆满召开
REST风格
Character function and string function (Part 1)
String function (Part 2)
Localization, low latency, green and low carbon: Alibaba cloud officially launched Fuzhou data center
laravel表单数据验证