oam_flags.txt 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. From: vic@physci.psu.edu (Vic Ricker)
  2. To: "Super Famicom Development Group" <famidev@busop.cit.wayne.edu>
  3. Subject: Re: some programming questions
  4. Date: Tue, 9 Nov 93 20:20:35 EST
  5. >Hi Folks.
  6. >I need help with a few SNES programming questions...
  7. >(1) Can anyone tell me how to make noises come out of my SNES?
  8. Insert your favorite cart, power up the TV, switch the snes power to
  9. ON.. :-)
  10. >(3) Is the sprite position table held in RAM or VRAM? And how
  11. > do the 5 address bits in $2101 relate to this location?
  12. The sprite images are stored in VRAM. The palettes for the sprites
  13. are stored in CGRAM. The coordinates and char attributes are stored
  14. in OAM.
  15. The format of each OBJ is:
  16. OBJ H position: 8 bits
  17. OBJ V position: 8 bits
  18. V flip: 1 bit
  19. H flip: 1 bit
  20. OBJ priority: 2 bits
  21. color palette: 3 bits
  22. character name: 9 bits
  23. there are 128 of these in sequence making 512 bytes then 32 bytes
  24. follow in the format:
  25. size: 1 bit
  26. x msb: 1 bit
  27. there are 128 of these (one for every OBJ) making 32 more bytes.
  28. $2101 is OBJSEL
  29. it chooses the size of sprites to use and also sets the address of the
  30. images in VRAM. the top 3 bits chose the size:
  31. 000 means 8x8 and 16x16 sprites
  32. 001 8x8 and 32x32
  33. 010 8x8 and 64x64
  34. 011 16x16 and 32x32
  35. 100 16x16 and 64x64
  36. 101 32x32 and 64x64
  37. the other bits are the address in vram of the sprite images.
  38. $2102-$2103 is OAMADDL/H
  39. the lower 9 bits are the address for accessing the OAM. (like $2116
  40. for VRAM)
  41. the high bit (15) enables priority rotation (causes OBJ's to change
  42. priority as to keep them from disappearing totally when time out and range
  43. over occur.)
  44. $2104 is OAMDATA
  45. it is the write register for the OAM. (like $2118-$2119 for VRAM)
  46. $2138 is *OAMDATA
  47. it is the read register for the OAM.
  48. Hope this gives you enough to play with. Most is from memory, I hope
  49. its all correct. :-)
  50. Lemme know if you have questions.