Skip navigation
NintendoAge
Welcome, Guest! Please Login or Join
Loading...

Ask all programming questions here!

Jan 24, 2014 at 9:56:23 AM
removed04092017 (0)
This user has been banned -- click for more information.
< Bowser >
Posts: 7316 - Joined: 12/04/2010
Other
Profile
I think it's pretty good to use at least half of the $0100 page for buffers too. ($100-$17F) random 32-byte, 16-byte, etc. That is, if you can optimize a route to only touch the PLA instruction to get a value needed with X and Y for the other logic/counters it needs to use only the stack and those buffers to store crap to, it's great optimization.

Jan 25, 2014 at 3:04:03 PM
SoleGooseProductions (129)
avatar
(Beau ) < King Solomon >
Posts: 3506 - Joined: 04/22/2013
Michigan
Profile
Originally posted by: Mario's Right Nut

$00xx should be used for pointers...only.
$01xx is your stack.
$02xx is what you're using for sprites (though you can use whatever you want)
so use $03xx, $04xx, $05xx, $06xx, or $07xx for other variables.

Though MetalSlime uses $03xx for sound variables in his tutorials, IIRC.

So use one of the other pages for your "soft" sprite variables.

Thanks for pointing that out MRN. I remembered you mentioning it in your tutorials, but the tip about MetalSlime's use of $03xx will come in handy when the day comes for music.


-------------------------
"The light that burns twice as bright burns half as long..." ~ Blade Runner

SoleGooseProductions.com


Jan 30, 2014 at 1:32:46 PM
QuickThumbs (3)
avatar
< Eggplant Wizard >
Posts: 433 - Joined: 08/05/2013
Profile
I have a lot of extra time on my hands an think it is finally time to learn Assembly Language. Can anyone suggest some books for a complete beginner? So far I have "Assembly Lines: The Book", but would also like something that explains 'how' Assembly Language/Processors work together. Seems like you need to know basic electronics before you can grapple with hexadecimals If it helps, I do have several years experience with BASIC derivatives, ROM hacking, and a bit of Pascal.

Jan 30, 2014 at 1:34:52 PM
removed04092017 (0)
This user has been banned -- click for more information.
< Bowser >
Posts: 7316 - Joined: 12/04/2010
Other
Profile
Why in the world do so many people want books when the online resources that COME WITH HELP are 100% the same tools and syntax they will be using? There is basically no reason to use a book, really.

JUust start through the nerdy nights. Whatever you don't get, either google and find a better source, or ask. Really, it's _that_ simple.

Jan 30, 2014 at 1:42:18 PM
QuickThumbs (3)
avatar
< Eggplant Wizard >
Posts: 433 - Joined: 08/05/2013
Profile
Mainly I want a book because I am a collector... Not to mention it's more enjoyable reading a book than a print-out or video screen.

Jan 30, 2014 at 1:53:57 PM
GradualGames (39)
avatar
(Derek Andrews) < El Ripper >
Posts: 1128 - Joined: 10/09/2009
Pennsylvania
Profile
QuickThumbs: Check out this thread I started a few months back: http://www.nintendoage.com/forum/...

It'll point you to a nice book for learning all the hard concepts behind assembly language. Note it isn't 6502, but I'm a really big fan of Jeff Duntemann's teaching style. It really helped me out when I was a teenager cause I have a bit of a rough time learning technical concepts. But, I love programming so I don't give up.

3gengames: Everyone's different. No matter how much you browbeat other people to do things the way you think they ought to be done, there will be some who will benefit by alternative methods.

-------------------------
Creators of: Nomolos: Storming the CATsle, and The Legends of Owlia.

Jan 30, 2014 at 2:01:46 PM
QuickThumbs (3)
avatar
< Eggplant Wizard >
Posts: 433 - Joined: 08/05/2013
Profile
GradualGamer: Thanks a lot! Personally I prefer BASIC/Pascal because they really aren't as limited as people claim, but there is something 'romantic' about assembly language. Probably because I'm rereading "Hackers" by Steven Levy. People here should check out that book, too. ^^

Jan 30, 2014 at 2:02:56 PM
Mario's Right Nut (352)
avatar
(Cunt Punch) < Bowser >
Posts: 6636 - Joined: 11/21/2008
Texas
Profile
That Assembly Language: Step By Step referenced in GG's thread is a good resource.

-------------------------

This is my shiny thing, and if you try to take it off me, I may have to eat you.

Check out my dev blog.


Jan 30, 2014 at 3:35:52 PM
SoleGooseProductions (129)
avatar
(Beau ) < King Solomon >
Posts: 3506 - Joined: 04/22/2013
Michigan
Profile
Originally posted by: QuickThumbs

but there is something 'romantic' about assembly language.


Agreed. Even after days of struggling with the same, simple bit of code, the romance remains. Same goes for print. I even printed and bound the Nerdy Nights just to be able to focus in on them without the distractions of the computer. It can be nice to step away from the workspace and process things in your head without the pressure to try them out right away. Oh, and Dutemann's book is good. Being able to understand a few things, which the author really helps the reader to do, can give the confidence needed to get started.

-------------------------
"The light that burns twice as bright burns half as long..." ~ Blade Runner

SoleGooseProductions.com


Jan 30, 2014 at 4:47:23 PM
GradualGames (39)
avatar
(Derek Andrews) < El Ripper >
Posts: 1128 - Joined: 10/09/2009
Pennsylvania
Profile
Originally posted by: SoleGooseProductions

Originally posted by: QuickThumbs

but there is something 'romantic' about assembly language.


Agreed. Even after days of struggling with the same, simple bit of code, the romance remains. Same goes for print. I even printed and bound the Nerdy Nights just to be able to focus in on them without the distractions of the computer. It can be nice to step away from the workspace and process things in your head without the pressure to try them out right away. Oh, and Dutemann's book is good. Being able to understand a few things, which the author really helps the reader to do, can give the confidence needed to get started.
+1. I fell in love with assembly language programming in the late 90's writing graphics demos and games for DOS. Loved it ever since. Constrained to a retro computer of some kind, the simplicity of it is very appealing. I don't know that it'd be the language of choice for a modern mobile app, of course, as the complexity just gets so high with modern computing you pretty much have to rely on third party OSs, libraries, cloud backend, yada yada to make even the simplest things work the way they are supposed to. But if you're into retro games and computers, there's nothing like it. 

QuickThumbs: I got my start in QBasic and C. It's interesting how often you see adherants of BASIC delving into assembly language later on. Not sure why that is---maybe driven by nostalgia for old computers in general, since those were typically the two languages you'd see (asm and BASIC)?

-------------------------
Creators of: Nomolos: Storming the CATsle, and The Legends of Owlia.

Feb 3, 2014 at 7:38:35 AM
SoleGooseProductions (129)
avatar
(Beau ) < King Solomon >
Posts: 3506 - Joined: 04/22/2013
Michigan
Profile
When doing an inventory screen and a playing state status bar (for an overhead adventure), is it a better to use sprites for weapon and item images, or rewrite background tiles? I have the latter method more or less working, but noticed that Zelda and a few other games seem to use the former. I can see advantages and disadvantages to both (I think), so any thoughts or advice is welcome.

-------------------------
"The light that burns twice as bright burns half as long..." ~ Blade Runner

SoleGooseProductions.com


Feb 3, 2014 at 9:23:13 AM
GradualGames (39)
avatar
(Derek Andrews) < El Ripper >
Posts: 1128 - Joined: 10/09/2009
Pennsylvania
Profile
Originally posted by: SoleGooseProductions

When doing an inventory screen and a playing state status bar (for an overhead adventure), is it a better to use sprites for weapon and item images, or rewrite background tiles? I have the latter method more or less working, but noticed that Zelda and a few other games seem to use the former. I can see advantages and disadvantages to both (I think), so any thoughts or advice is welcome.

I'd personally probably use a combination of sprites and background tiles for this. You'll probably encounter trade-offs unique to your own game. In other words, any graphics you use for sprites can't be used by the background and vice versa. Which one do you want to maximize? In a single screen game, you can probably use a combination without too much trouble. Obviously, anything that spans more than 8 tiles wide will have to be background tiles. Maybe use sprites for small, more colorful icons that stand out from the rest of the status bar.

-------------------------
Creators of: Nomolos: Storming the CATsle, and The Legends of Owlia.


Edited: 02/03/2014 at 09:24 AM by GradualGames

Feb 3, 2014 at 12:11:44 PM
KHAN Games (89)
avatar
(Kevin Hanley) < Master Higgins >
Posts: 8126 - Joined: 06/21/2007
Florida
Profile
I've pretty much always used sprites because of color restrictions, and generally there aren't more than 8 sprites up that high on the status bar.

-------------------------

gauauu: look, we all paid $10K at some point in our lives for the privilege of hanging out with Kevin


Feb 3, 2014 at 1:32:57 PM
SoleGooseProductions (129)
avatar
(Beau ) < King Solomon >
Posts: 3506 - Joined: 04/22/2013
Michigan
Profile
Good points fellows! I had completely overlooked color restrictions, since the first few weapons/items that I designed all use the same palette as the status bar. Since one weapon will probably be permanent, the combination method should work nicely, costing a couple of background tiles, but also saving a couple of sprites. So many factors to consider when designing things it is almost overwhelming. Thanks for saving me from some future frustrations!

-------------------------
"The light that burns twice as bright burns half as long..." ~ Blade Runner

SoleGooseProductions.com


Feb 3, 2014 at 2:56:49 PM
Mario's Right Nut (352)
avatar
(Cunt Punch) < Bowser >
Posts: 6636 - Joined: 11/21/2008
Texas
Profile
I wouldn't worry about saving sprites at this stage. I'd be surprised if you ever have enough going on (that looks okay) to where you actually run out of them. I'd focus more on making your game look cool and colorful than this stuff.

-------------------------

This is my shiny thing, and if you try to take it off me, I may have to eat you.

Check out my dev blog.


Feb 3, 2014 at 5:15:08 PM
SoleGooseProductions (129)
avatar
(Beau ) < King Solomon >
Posts: 3506 - Joined: 04/22/2013
Michigan
Profile
Originally posted by: Mario's Right Nut

I wouldn't worry about saving sprites at this stage. I'd be surprised if you ever have enough going on (that looks okay) to where you actually run out of them. I'd focus more on making your game look cool and colorful than this stuff.


Right now the sprite breakdown for the playing state looks roughly like this:
4 - Hero
1 - Hero's face
2-4 - Weapon A
6 - Weapon B
20-24 - Enemies (generally four sprites each, maximum of 6 large enemies on a given screen, which yes, I realize is high and will cause scan line issues if measures are not taken)
10-12 - Enemy weapons (2 sprites each, though this may be reduced)
? - Dropped items (may be able to reuse enemy sprites?, not sure as I have not tried to do these yet)
? - Objects, items, etc. (doors, keys, chests, switches, whatever; although some of these could be done with background tiles)
? - Graphical flair
2-4 - Weapon B status bar image

It seems to be adding up pretty quickly, but then again there is not a lot more that needs to be accounted for (feel free to point out omissions/oversights). I have probably budgeted too many sprites for certain things, but I'd rather be thinking ahead than running out of room by misusing things unknowingly.


I was kind of trying to avoid this, but since it looks like sprites are the way to go when it comes to an inventory screen there results a question. When switching between the playing state and the inventory state, what would be a decent way of preserving the active positions/tiles/attributes of the on-screen sprites? I have BunnyBoy's update sprite concept working well, meaning that when the start button is pressed the state and screen switch and move all sprites off-screen. When the button is pressed again the game returns to its previous state and the sprites resume their last positions. As it stands, this will work great for cut scenes and other static screens composed solely of background tiles. However, if the inventory screen is made up of sprites and these are updated using the same method as in the playing state (some form of updates will need to occur as weapon and items are added to the player's inventory), this alters their last position, causing them to move when play is resumed. If there were enough free sprites I could simply move the playing ones off-screen and the inventory ones on-screen, but it seems that the playing sprites (hero, enemies, weapons, etc.) will have to be re-purposed for the inventory screen (8 weapons/items using 2-4 sprites a piece, plus whatever else). A clunky way to preserve their positions would be to save the sprite positions/attributes/tiles to a place holder variable and reload it, but I am guessing that there is a more elegant, and less variable costing method. Of course, the other way to do all of this would be to use background tiles for the weapon/item images, but this will eat up a lot of background tiles. A separate CHR page (pardon the terminology if this is not correct) could be devoted to the inventory screen, but this may not be ideal. Any thoughts?



-------------------------
"The light that burns twice as bright burns half as long..." ~ Blade Runner

SoleGooseProductions.com


Feb 3, 2014 at 7:46:02 PM
GradualGames (39)
avatar
(Derek Andrews) < El Ripper >
Posts: 1128 - Joined: 10/09/2009
Pennsylvania
Profile
Originally posted by: SoleGooseProductions

Originally posted by: Mario's Right Nut

I wouldn't worry about saving sprites at this stage. I'd be surprised if you ever have enough going on (that looks okay) to where you actually run out of them. I'd focus more on making your game look cool and colorful than this stuff.


Right now the sprite breakdown for the playing state looks roughly like this:
4 - Hero
1 - Hero's face
2-4 - Weapon A
6 - Weapon B
20-24 - Enemies (generally four sprites each, maximum of 6 large enemies on a given screen, which yes, I realize is high and will cause scan line issues if measures are not taken)
10-12 - Enemy weapons (2 sprites each, though this may be reduced)
? - Dropped items (may be able to reuse enemy sprites?, not sure as I have not tried to do these yet)
? - Objects, items, etc. (doors, keys, chests, switches, whatever; although some of these could be done with background tiles)
? - Graphical flair
2-4 - Weapon B status bar image

It seems to be adding up pretty quickly, but then again there is not a lot more that needs to be accounted for (feel free to point out omissions/oversights). I have probably budgeted too many sprites for certain things, but I'd rather be thinking ahead than running out of room by misusing things unknowingly.


I was kind of trying to avoid this, but since it looks like sprites are the way to go when it comes to an inventory screen there results a question. When switching between the playing state and the inventory state, what would be a decent way of preserving the active positions/tiles/attributes of the on-screen sprites? I have BunnyBoy's update sprite concept working well, meaning that when the start button is pressed the state and screen switch and move all sprites off-screen. When the button is pressed again the game returns to its previous state and the sprites resume their last positions. As it stands, this will work great for cut scenes and other static screens composed solely of background tiles. However, if the inventory screen is made up of sprites and these are updated using the same method as in the playing state (some form of updates will need to occur as weapon and items are added to the player's inventory), this alters their last position, causing them to move when play is resumed. If there were enough free sprites I could simply move the playing ones off-screen and the inventory ones on-screen, but it seems that the playing sprites (hero, enemies, weapons, etc.) will have to be re-purposed for the inventory screen (8 weapons/items using 2-4 sprites a piece, plus whatever else). A clunky way to preserve their positions would be to save the sprite positions/attributes/tiles to a place holder variable and reload it, but I am guessing that there is a more elegant, and less variable costing method. Of course, the other way to do all of this would be to use background tiles for the weapon/item images, but this will eat up a lot of background tiles. A separate CHR page (pardon the terminology if this is not correct) could be devoted to the inventory screen, but this may not be ideal. Any thoughts?

 

One idea which might help and which I think is reflected in a lot of game engines, NES and modern is to abstract your drawing code away from your "object" code. In other words, you might have some portions of RAM devoted entirely to the abstract idea of an object or "entity" as I call them in my engine. So you might have:

entity_alive: .res MAX_ENTITIES  ;where MAX_ENTITIES might be say 8 or something, whatever you want
entity_type: .res MAX_ENTITIES  ;this could be an index into a look up table of "brain routines" for each object
entity_x: .res MAX_ENTITIES   
entity_y: .res MAX_ENTITIES
entity_sprite_lo: .res MAX_ENTITIES
entity_sprite_hi: .res MAX_ENTITIES

And you'd have a part of your engine called something like:

.proc update_entities

   ;in here, iterate over entity_alive, and for any entity that is alive, look up its "brain" routine using entity_type
   ;each entity "brain" routine would be responsible for making that entity move the way it is supposed to.

  rts

.endproc

and you might also have:

.proc draw_entities

  ;in here, interate over all entities that are "alive" and call a metasprite drawing routine and pass it entity_x and entity_y, entity_sprite_lo and entity_sprite_hi (the full address of a metasprite for the entity).

  rts

.endproc

The metasprite drawing routine would read the metasprite and shovel the sprites into $0200. Exactly *where* it gets shoveled will depend on your game engine. For simpler games that do not require sorting of any kind, a common technique is to store one variable for the last sprite written (a pointer into $0200), and just shovel metasprites into that point, and let that variable keep wrapping around the page. This is a cheap way to implement sprite flickering, too, but for simpler games this typically won't even show up that much.

But anyway, I just skimmed a ton of details there...but the main point is that if you can separate out the concept of "make stuff move around" from "draw stuff" and treat the sprite page as just the thing to which you draw things, you can switch states in your game with ease and not worry about what sprites were occupying the sprite page. They would still be in your entity variables.

Feel free to PM or email me, too, if you are interested in talking more about any of that stuff.

-------------------------
Creators of: Nomolos: Storming the CATsle, and The Legends of Owlia.

Feb 3, 2014 at 7:55:57 PM
GradualGames (39)
avatar
(Derek Andrews) < El Ripper >
Posts: 1128 - Joined: 10/09/2009
Pennsylvania
Profile
Just to add a couple more thoughts: Your play state would be the one that would call update_entities and draw_entities. When you go to something like an inventory state, you'd probably just stop calling those, leaving all the entities at the positions/state they were last in for the time being. Then once in the inventory state, you will clear all the sprites in $0200, and then draw whatever is appropriate for the inventory state (probably not entity objects, depending on your engine, probably just a couple of cursors or what not). When you go back to the play state you'd resume calling update_entities and draw_entities, and again $0200 would have the sprites at the locations they were last updated to. Does any of that make sense or am I going way too fast?

-------------------------
Creators of: Nomolos: Storming the CATsle, and The Legends of Owlia.

Feb 3, 2014 at 10:18:58 PM
SoleGooseProductions (129)
avatar
(Beau ) < King Solomon >
Posts: 3506 - Joined: 04/22/2013
Michigan
Profile
Originally posted by: GradualGames

Just to add a couple more thoughts: Your play state would be the one that would call update_entities and draw_entities. When you go to something like an inventory state, you'd probably just stop calling those, leaving all the entities at the positions/state they were last in for the time being. Then once in the inventory state, you will clear all the sprites in $0200, and then draw whatever is appropriate for the inventory state (probably not entity objects, depending on your engine, probably just a couple of cursors or what not). When you go back to the play state you'd resume calling update_entities and draw_entities, and again $0200 would have the sprites at the locations they were last updated to. Does any of that make sense or am I going way too fast?

Hey Derek,

Your first post is going to take a bit of time to dwell upon, but for the most part I think that I have indeed separated the variable/movement code from the drawing code. The issue is, if the inventory screen is going to be made up largely of sprites, how can these be re-positioned and changed without affecting the update routines in the playing state? I wrote you a nice long message detailing all of my steps and logic, and then somewhere in there I realized that if the inventory screen sprites are updated during the Load Inventory state, but AFTER the LoadSprites routine, they will not affect the playing state positions. Everything resets to its former place once the playing state is called again. This gets rid of any sort of UpdateInventory routine that would be running during the main inventory state (which I had modeled off of the playing state updates), except for a cursor of course. When I tried that approach I may have been doubling variables between the two states, come to think of it, but the solution here works for now. Thanks though for re-clarifying a bunch of things, and bringing up some new things to consider as well. I recently played a game that did not implement sprite flicker and watched as half of the enemies became twice a deadly with their new found invisibility. 



-------------------------
"The light that burns twice as bright burns half as long..." ~ Blade Runner

SoleGooseProductions.com


Feb 8, 2014 at 8:04:55 AM
Vectrex28 (130)
avatar
(CD-i Kraid) < Master Higgins >
Posts: 7789 - Joined: 07/28/2012
Switzerland
Profile
http://pastebin.com/EMSR2Gua...
I made this little program to mess with backgrounds, and I'm wondering if you can use less code to write lines 149-164, i.e. not having to use this kind of code multiple times
LDA $2002 ;/___________________________________________________________________________________________________________________________________/
LDA #$XX ;_\Hi part of the address
STA $2006
LDA #$XX ;Lo part of the address
STA $2006

ROM is here
https://dl.dropboxusercontent.com...

-------------------------
"Energy Tanks, Missiles, Power Bombs... You want it? It's yours my friend! As long as you have enough credits!"


Feb 8, 2014 at 8:15:41 AM
removed04092017 (0)
This user has been banned -- click for more information.
< Bowser >
Posts: 7316 - Joined: 12/04/2010
Other
Profile
LDA $2002
LDA #$21 ;Write Hipart of $21BC to PPU
STA $2006
LDA #$BC ;Now Lopart
STA $2006
LDA randomness
STA $2007
LDA $2002 ;NOT NEEDED ANYHOW, THIS DOES NOTHING.
LDA #$21 ;Write Hipart of $21DC to PPU
STA $2006
LDA #$DC ;Now Lopart
STA $2006
LDA randomness
CLC
ADC #$10
STA $2007

can be:

LDA ($2000 Var in RAM) ;Get the game $2000 register value, this will be stored in RAM.
ORA %00000100 ;Set +32 mode.
STA PPUCtrl ;Set it up. Use a name not a number.
LDA PPUStatus ;Reset high/low PPU latch. Use a name not a number.
LDA #$21
STA PPUData ;Less numbers on out code the better. Put a name to the PPU register, not a number. Numbers are hard to remember, names are not. Names is from nesdev wiki.
LDA #$BC
LDA Randomness
STA PPUData ;Write the first value.
CLC
ADC #$10
STA PPUData ;Write the second.

With this routin just watch what the games *wants* to be the default for the PPU increment. We usually want it to be 1, but this changes it to 32, which will be used from now on unles you change it.


Edited: 02/08/2014 at 08:23 AM by removed04092017

Feb 8, 2014 at 8:36:47 AM
Vectrex28 (130)
avatar
(CD-i Kraid) < Master Higgins >
Posts: 7789 - Joined: 07/28/2012
Switzerland
Profile
Originally posted by: 3GenGames

LDA $2002
LDA #$21 ;Write Hipart of $21BC to PPU
STA $2006
LDA #$BC ;Now Lopart
STA $2006
LDA randomness
STA $2007
LDA $2002 ;NOT NEEDED ANYHOW, THIS DOES NOTHING.
LDA #$21 ;Write Hipart of $21DC to PPU
STA $2006
LDA #$DC ;Now Lopart
STA $2006
LDA randomness
CLC
ADC #$10
STA $2007

can be:

LDA ($2000 Var in RAM) ;Get the game $2000 register value, this will be stored in RAM.
ORA %00000100 ;Set +32 mode.
STA PPUCtrl ;Set it up. Use a name not a number.
LDA PPUStatus ;Reset high/low PPU latch. Use a name not a number.
LDA #$21
STA PPUData ;Less numbers on out code the better. Put a name to the PPU register, not a number. Numbers are hard to remember, names are not. Names is from nesdev wiki.
LDA #$BC
LDA Randomness
STA PPUData ;Write the first value.
CLC
ADC #$10
STA PPUData ;Write the second.

With this routin just watch what the games *wants* to be the default for the PPU increment. We usually want it to be 1, but this changes it to 32, which will be used from now on unles you change it.
A few questions...
1 - What does ORA do? What I understand is that it's used to make the PPU increment by 32 instead of 1 so it goes directly to where the bottom of the letter should be
2 - It's not a bad idea to use names for the PPU registers, however, how do you want me to set them up?
3 - Can I have a link to the page with your names from the NESdev wiki?
4 - What's with the first line?

That's all. Thanks for helping an ASM n00b ^^



-------------------------
"Energy Tanks, Missiles, Power Bombs... You want it? It's yours my friend! As long as you have enough credits!"


Feb 8, 2014 at 8:42:47 AM
removed04092017 (0)
This user has been banned -- click for more information.
< Bowser >
Posts: 7316 - Joined: 12/04/2010
Other
Profile
1. ORA sets certain bits, I wrote it in binary so you can see which bits are set with it, it's the 3rd bit over from the left. 2^2.

2. The NESDev wiki pake. Most people use PPU(Name)4 letters after. Its pretty easy to understand. http://wiki.nesdev.com/w/index.ph...

PPUCtrl=$2000
PPUMask=$2001
PPUStatus=$2002
PPUOAMAddr=$2003
PPUOAM(Data)=$2004
PPUScroll=$2005
PPUAddr=$2006
PPUData=$2007

4. The () just show I dont really know what to put there. Most games keep a copy of $2000 and $2001 in RAM, instead of using magic values, or hard-coded stuff, this is the way you'd use it with a game engine already around it. Or your code will eventually develop into this style, it's just much easier.

Feb 8, 2014 at 8:53:25 AM
Vectrex28 (130)
avatar
(CD-i Kraid) < Master Higgins >
Posts: 7789 - Joined: 07/28/2012
Switzerland
Profile
Originally posted by: 3GenGames

1. ORA sets certain bits, I wrote it in binary so you can see which bits are set with it, it's the 3rd bit over from the left. 2^2.

2. The NESDev wiki pake. Most people use PPU(Name)4 letters after. Its pretty easy to understand. http://wiki.nesdev.com/w/index.php/PPU_registers

PPUCtrl=$2000
PPUMask=$2001
PPUStatus=$2002
PPUOAMAddr=$2003
PPUOAM(Data)=$2004
PPUScroll=$2005
PPUAddr=$2006
PPUData=$2007

4. The () just show I dont really know what to put there. Most games keep a copy of $2000 and $2001 in RAM, instead of using magic values, or hard-coded stuff, this is the way you'd use it with a game engine already around it. Or your code will eventually develop into this style, it's just much easier.

Thanks That article from NESdev is going to be an interesting read However, I still don't quite understand question 4 :/


-------------------------
"Energy Tanks, Missiles, Power Bombs... You want it? It's yours my friend! As long as you have enough credits!"


Feb 8, 2014 at 9:07:07 AM
removed04092017 (0)
This user has been banned -- click for more information.
< Bowser >
Posts: 7316 - Joined: 12/04/2010
Other
Profile
It just shows you're supposed to replace it. You can either use a one-off value (#$XX) or a variable in RAM. Most engines and such have a variable to keep track of the current $2000 setup of the PPU, I just wrote it like that so if you did, you'd know where to put it.