brickrest.blogg.se

Bsnes tutorial
Bsnes tutorial








bsnes tutorial
  1. #BSNES TUTORIAL FULL#
  2. #BSNES TUTORIAL CODE#
  3. #BSNES TUTORIAL TV#

In a brightness gradient, $0F means the screen is at full brightness, and $00 means it is perfectly black. The second byte is the value that is written. Don't set this number above 80 (will explain why later). This byte controls how many scanlines the HDMA will wait before making another change. The first byte on each line is the scanline count ($0C). You'll notice the table is split up into sections of two bytes each. In this case it would set the fourth bit, and enable HDMA channel 3. TSB takes the bits set in A, and sets them in the target address. You should never STA to this number, or you can screw up things like the goal tape. $0D9F holds which HDMA channels are active. This could be replaced with LDY #$xx STY $4334 if you knew beforehand which bank your table is in. You don't really need to know what PHK PLY does, just understand that it gets the bank number of where your table is and puts it in Y. $43x2-4 needs to hold the address of your table.

bsnes tutorial

#BSNES TUTORIAL CODE#

If you were to open this part of the code in a hex editor, you'd see that the two byte number after LDA would correspond to the SNES address of your table. This is the pointer to your table, so the HDMA knows where to pull the values from. This tells xkas to take the location of LVL1BRIGHT and put that number after the LDA. The significance of this will be obvious when we get to color gradients, as this number will change.Īs we're in 16 bit mode, STA'ing to this register will write to both $4330 and $4331. The *high byte* of this number (#$ 0000) is set to $4331, which should be 00 for a brightness gradient.

bsnes tutorial

For right now, you should leave this byte 00. The *low byte* of this number (#$00 00) is set to register $4330. You might notice in the comments $43x0 = 00, or whatever. A becomes 16 bits in width, allowing us to set two registers at once. STA $4332 store it to low and high byte pointer LDA #LVL1BRIGHT get pointer to brightness table The following code will make everything on the screen darker as it goes further down the screen: The easiest HDMA to do is a brightness gradient. Now, you've got all that stuff and want to jump right into color gradients. Last and most obvious would be a text editor, like notepad. Preferably, you should use something that's run every frame. Sticking it in a block won't work (unless mario's standing on it). Next, you'll need a method to run your HDMA code. Use it to look up specifics of registers you're working with. If you try to read the entire thing in one sitting, you'll go insane. With in-depth descriptions of every register, you simply can't go without it. If a description of a register isn't clear in this tutorial, it probably will be in regs.txt. The one document that's indispensable when using HDMA is regs.txt by Anomie. If you know those things, or at least know what they are, you'll be fine. You should have basic knowledge of how RAM works. You should know the difference between 8 and 16 bit addressing. You must know what a table is and how indexing works. This tutorial is for people wanting to do more than copy/paste color gradient code. If BRA only means woman's underwear to you, then you need to go look up an ASM utorial. You can do a lot of things, including twisting the display beyond recognition (which may or may not be a good thing).įirst and foremost, you need to know basic ASM. You might change a layer's x position to make a wavy effect. You may change the background color and produce a gradient. HDMA counts the scanlines, and on ones that you specify, it changes settings to produce the desired effect. These lines are called "scanlines," and the standard SNES mode 1 resolution draws a little over 200 of them per frame. It draws one line, the moves down a bit and draws the next.

#BSNES TUTORIAL TV#

A TV works by drawing horizontal lines of color. What HDMA does is modify graphical settings in the middle of the screen being drawn on the TV. It is used to produce many graphical effects, from the expanding circle you see in SMW's title screen to color gradients to Neo-Exdeath's wavy background in FF5. This guide explains the nitty gritty of HDMA, its inner workings.ĭ.5) Notes on background color and color math Note that for most cases, you can use tools to create the HDMA code for you, such as Effect Tool. If you notice I made a mistake, or especially if you have a question and/or think something isn't clear, please post in this thread rather than PMing me. This tutorial is intended to teach every aspect of using HDMA, from the basic gradient to changing screen modes to parallax scrolling while also talking about SMW specific stuff.










Bsnes tutorial