当前位置:网站首页>Developing NES games with C language (cc65) 04. Complete background
Developing NES games with C language (cc65) 04. Complete background
2022-07-28 12:28:00 【firseve】
Paste the CSDN The format is not adjusted , If you want to see a good format, click below
https://happysoul.github.io/nes/nesdoug/
Make a full screen background
( remarks : there RLE It is the author who turns the picture into NES You can recognize the loaded map , This is too difficult to translate ...)
NES Screen Tool
http://www.romhacking.net/utilities/802/
I wrote another article about BMP File import NES Screen Tool My blog page . here …
https://nesdoug.com/2017/04/22/nes-screen-tool-bmp-import/
( I'll spend time translating later and put it at the end of this article ,BMP Variable mapping )
rl3.chr), And I have put my NES Screen tools (.nss) The file is saved as compressed rle file ,“Nametable / Save Nametable and Attributes / RLE Packaging for C head .h”. Now we can import it C Code , And print it to the background .
The complete name table is 1024 byte . We cannot perform this operation with the screen open , So turn it off , Then set the starting address , And call rle function .
ppu_off();
vram_adr(NAMETABLE_A);
vram_unrle(Girl3);
ppu_on_all();
up to now , I forgot to mention the palette . I have to change it to make it brown shadow . I will discuss this in more detail later .pal_bg() Set the color palette of the background .

https://github.com/nesdoug/04_FullBG/blob/master/fullBG.c
https://github.com/nesdoug/04_FullBG
adopt neslib We can easily change the brightness of the screen , You can use pal_bright(), Range of values 0-8 ( Corresponding black - white )4 It's normal
I borrowed Shiru Of “Chase” A function in the game , This function is very simple and practical .
pal_fade_to(0,4); // Black fades to normal
pal_fade_to(4,0); // From normal color to black
If you run fade.nes file , You will see it fade in and out in an infinite loop . Fade in and fade out can be used for transitions , For example, from titles to games , Or from one level to another .
https://github.com/nesdoug/05_Fade/blob/master/fade.c
https://github.com/nesdoug/05_Fade
NES Screen tools BMP Import
Latest version NES Screen Tool Improved BMP Import function . I'm going to have a try .BMP Must be 16 Color or 256 color . In my submission 16 Better color effect .
I found this picture on the Internet . I reduced the image to 256×240.

Use GIMP, I adjusted the saturation , Let him not distort .

My first attempt was to darken the background , And then convert to NES Color ( I used it before NES Palette makes a custom palette ). then , Images / Pattern / Indexes , And select NES palette . Then my image / Pattern / RBG. Then I image / Pattern / Indexes , Optimize to 16 color . This is ours ......

then , I imported NES Screen Tool, Only checked “ The distortion ”. This is what I got .

Um. , The effect is very poor , Then do it again , Adjust the resolution to 256x240, Sharpening , Darken the background .
Images / Pattern / Grayscale , Then the image / Pattern / RGB. Then I chose pencil tool ( Or brushes ), And change its mode to “ Color ” And chose orange , Then recolor the gray image like a two tone .( I also adjusted my level again ).

Now? ... Images / Pattern / Indexes , choice NES palette . Images / Pattern / RGB. Images / Pattern / Indexes , in the light of 4 Color is optimized . Images / Pattern / RGB. Images / Pattern / Indexes , in the light of 16 Color optimization .( If you have the final 16 Color ,NES Screen Tool It seems to do better ).

This is it. GIMP What the final version looks like in . Let's start from NES Screen Tool Import BMP( Check only ' The distortion ')......( I am here NES Screen Tool Some blocks have been modified in ).

A lot better .
Next time I will import it as a background , Compress it into RLE file .
边栏推荐
- 解决PHP提示Warning: Division by zero in错误
- [real question of written examination]
- 【Try to Hack】AT、SC、PS命令提权
- Most of the interfaces of Tiktok are already available, and more interfaces are still open. Please look forward to it
- Introduction to several methods of keeping two decimal places in PHP
- 顶级“Redis笔记”,缓存雪崩+击穿+穿透+集群+分布式锁,NB了
- Laravel之缓存
- Gecko competition 2.0 is new! Come and show your flexible operation skills!
- Notes on using objectanimator
- Arduino Pro Mini atmega328p connect and light the first LED (at the same time, record the problem of burning failure stk500_recv)
猜你喜欢

Full analysis of seven classical regression analysis methods

Huawei releases harmonyos 3 and all scene new products, and the smart experience goes further

安徽京准:北斗卫星同步时钟|北斗同步时钟|NTP网络时钟服务器

“蔚来杯“2022牛客暑期多校训练营2

使用百度飞桨 EasyDL 完成垃圾分类

On Governance and innovation | the openanolis sub forum of the 2022 open atom global open source summit was successfully held

易观分析:以用户为中心提升手机银行用户体验,助力用户价值增长

要想组建敏捷团队,这些方法不可少

Anhui Jingzhun: Beidou satellite synchronous clock | Beidou synchronous clock | NTP network clock server

Hcip rip comprehensive experiment
随机推荐
Is it difficult for cloud native machine learning to land? Lingqueyun helps enterprises quickly apply mlops
SQL注入 Less24(二次注入)
The principle and use of the wrap file of tolua
腾讯二面:@Bean 与 @Component 用在同一个类上,会怎么样?
Anhui Jingzhun: Beidou satellite synchronous clock | Beidou synchronous clock | NTP network clock server
8000 word explanation of OBSA principle and application practice
WebView详解
聚变云原生,赋能新里程 | 2022 开放原子全球开源峰会云原生分论坛圆满召开
Code simplification
Latex matrix is simple to use
Style conversion model style_ Transformer project instance pytorch implementation
[leetcode] 7. valid anagram · effective letter ectopic words
用C语言开发NES游戏(CC65)10、游戏循环
Using Arduino to develop esp8266 to build a development environment
Some API interfaces purchased by Yiwu hope to bring you some help
2022.07.06 summer training personal qualifying (I)
Kuzaobao: summary of Web3 encryption industry news on July 13
SQL injection less26 (filter spaces and comments, and use error injection without spaces)
[try to hack] intranet Foundation
Lua makes a deep copy of table