ENGLISH

Making Games for the NES

Book information

Year
2019
ISBN
1075952727, 9781075952722
Language
english
Format
PDF
Filesize
4 MB (4128522 bytes)
Pages
\244
Time added
2021-01-25 09:02:40

Description

Learn how to program games for the NES! You'll learn how to draw text, scroll the screen, animate sprites, create a status bar, decompress title screens, play background music and sound effects and more. While using the book, take advantage of our Web-based IDE to see your code run instantly in the browser. We'll also talk about different "mappers" which add extra ROM and additional features to cartridges. Most of the examples use the CC65 C compiler using the NESLib library. We'll also write 6502 assembly language, programming the PPU and APU directly, and carefully timing our code to produce advanced psuedo-3D raster effects. Create your own graphics and sound, and share your games with friends! The NES History Programming The 8bitworkshop IDE Quickstart Tweaking the Code Binary Numbers Bits, Bytes, and Binary Hexadecimal Notation Signed vs. Unsigned Bytes Integer Overflow and Arithmetic Logical Operations Shift Operations Memory Maps CPU Memory Map CPU vs. PPU Buses The PPU The Video Signal PPU Address Space and Registers Pattern Table (CHR) Nametables and Background Layer System Colors Palettes Sprites and OAM The Build Pipeline Support Libraries Preprocessor The C Compiler Linker Linking the Pattern Table Nametables Setting the Palette Writing to Video RAM Attribute Table Setting All of the Palettes Filling Up the Nametable Setting the Attribute Table Scrolling Scrolling between Nametables put_str() function Writing to the Nametables Animated Scrolling NTSC vs PAL Animation Speed Sprites OAM Buffer 8x16 Sprites Setting Up the Palette and PPU Position and Velocity Arrays Drawing Sprites to OAM Performance Metasprites Additional Metasprite Functions Flickering Sprites Controllers Sprite Animation Trigger Mode VRAM Buffer Using the VRAM Buffer Module Split Status Bar Setting up Sprite Zero Vertical Mirroring Calling split() Random Numbers The rand() function Entropy Reading VRAM PPU Mask Register Virtual Bright The APU Length Counter Examples Simple Music Hitting the Right Note Laying out the Score Swinging with the Tempo Composing the Music FamiTone Music FamiTone in C Binary-Coded Decimals BCD Addition RLE Encoding and Title Screens Compressing Nametables Other Techniques Offscreen Scrolling Drawing Metatiles Coloring Metatiles Drawing Metatiles to the VRAM Buffer Setting Attribute Blocks The Main Loop Alternate Methods Main Loop vs. NMI Handler Climber: Platform Game Modeling The Game World Generating The Game World Drawing the Game World Scrolling the Game World Actors The Player Vanishing and Reappearing Actors Drawing Actors Scoreboard Checking Collisions The Main Game Loop Level Win Animation Music, Sound, and main() Advanced Mappers Cartridge Connector Bank Switching CHR ROM vs. CHR RAM Extra or battery-backed RAM Interrupts Expansion Audio Fast Multiplication Advanced Mirroring CHR RAM Monochrome 1bpp Frame Buffer Other CHR RAM Applications Bank Switching MMC3 Registers CHR ROM Switching and Other Features IRQs MMC3 Interrupts Caveats Sprite Starfield The 6502 CPU The CPU and the Bus CPU Instructions Writing Loops Condition Flags and Branching Addition and Subtraction The Stack Logical Operations Shift Operations Indirect Addressing Whew! Hello NES Assembly Equates Includes and Segments The iNES Header The NES_INIT Macro Warming up the PPU Setting the Palette Colors Enabling Rendering CPU Vectors and Interrupts Drawing Text in Assembly Setting the Palette Writing to the Nametable Linking the Pattern Table Scrolling in Assembly Filling up VRAM Scrolling in the NMI Routine Sprites/OAM in Assembly Sprites Controller Reading in Assembly FamiTone and DMC Samples APU DMC Sound Split Screen X/Y Scrolling VRAM Address Registers Setting Y Scroll During Rendering Line-by-line Scrolling Scanline Manipulation A More Accurate Loop NES Dev Tools 8bitworkshop Asset Editor Other Tools Making Your Own Homebrew Game Appendix A: NES Reference Appendix B: NES Colors Appendix C: NESLib Reference Appendix D: C Library Reference Appendix E: 6502 Instruction Flags Appendix F: Powers of Two Bibliography Index

Similar books