当前位置:网站首页>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 .
边栏推荐
- [leetcode] 6. invert binary tree
- Introduction to several methods of keeping two decimal places in PHP
- Untiy controls the playback speed of animation
- Interpretable ml of Li Hongyi's machine learning model
- SQL injection less23 (filter comment)
- Some knowledge concepts
- 太赞了!京东研发一哥力荐的高可用网站构建技术PDF,备好水,慢慢啃
- [try to hack] at, SC, PS command authorization
- Huawei releases harmonyos 3 and all scene new products, and the smart experience goes further
- laravel表单数据验证
猜你喜欢

Yolov3 complete explanation - from the perspective of data coding

Lua makes a deep copy of table

产学研用 共建开源人才生态 | 2022 开放原子全球开源峰会教育分论坛圆满召开

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

AsiaInfo technology released antdb7.0, a "Telecom grade" core transaction database, to help government and enterprises "trust" to create the future!

用C语言开发NES游戏(CC65)08、背景 碰撞

Implementation method of mouse hover, click and double click in ue4/5

用arduino开发ESP8266 搭建开发环境

Live: never believe that suffering is worth it. Suffering is suffering

“蔚来杯“2022牛客暑期多校训练营2
随机推荐
PHP timestamp subtraction converts to days, hours, minutes and seconds
Character function and string function (Part 1)
Knowledge points of MySQL (13)
Full analysis of seven classical regression analysis methods
【Try to Hack】内网基础
腾讯二面:@Bean 与 @Component 用在同一个类上,会怎么样?
ObjectAnimator使用注意点
华为发布HarmonyOS 3及全场景新品,智慧体验更进一步
2022.07.08 summer training personal qualifying (III)
Google Earth engine (GEE) -- problems in the use of coordinate projection and reduceresolution functions in image downscaling
laravel表单数据验证
PHP date time application: add or subtract the number of days of a specific date
SQL注入 Less24(二次注入)
Latex matrix is simple to use
Introduction to several methods of keeping two decimal places in PHP
PHP获取本周所有日期或者最近七天所有日期
Is it difficult for cloud native machine learning to land? Lingqueyun helps enterprises quickly apply mlops
SQL injection LESS18 (header injection + error injection)
【Try to Hack】AT、SC、PS命令提权
Developing NES games with C language (cc65) 10. Game cycle