Making Games for the NES
Book information
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
Designing Video Game Hardware in Verilog
2018 · PDF
Making 8-bit Arcade Games in C
2017 · PDF
Making Games for the Atari 2600
2016 · PDF
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF