Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,480,212
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-25-24 04:30 AM
Guest: Register | Login

0 users currently in ROM Hacking | 4 guests

Main - ROM Hacking - Question/Game Sprites... New thread | New reply


RetroRain
Posted on 01-23-08 06:27 AM Link | Quote | ID: 74775


Fuzz Ball
Level: 66

Posts: 32/994
EXP: 2437933
Next: 23918

Since: 09-30-07

Last post: 1933 days
Last view: 956 days
I was going to post this in my other thread, but I wanted to make sure this gets seen.

According to NESprgmn.txt, this is the routine for displaying a single 8x8 tile sprite:

ldx #$00 ;set $2004 to the start of SPR-RAM
stx $2003
stx $2003

lda #$7F ;y-1
sta $2004
lda #$00 ;sprite pattern number
sta $2004
lda #%00000001 ;color bit
sta $2004
lda #$08 ;x
sta $2004

My question is, using Megaman 1 as an example, Megaman, standing still, consists of 9 tiles, right? Now, in Megaman's code, they didn't have to type the above code 9 times to get Megaman to show up? That would be insufficient, and a waste of code. So I guess what I'm asking is, would they use a table and a loop for every sprite they wanted to show on screen? Or is there another way of doing this? I just want to make sure, so I don't waste my time making code that I don't have to.

____________________
My YouTube Channel

kuja killer
Posted on 01-23-08 08:59 AM (rev. 2 of 01-23-08 09:01 AM) Link | Quote | ID: 74778


Level: 55

Posts: 26/628
EXP: 1243749
Next: 70440

Since: 03-20-07
From: Lake Havasu City, Arizona

Last post: 280 days
Last view: 6 days
Yea there's generally about 2 seperate types of data for constructing sprites.
Well i dont know about megaman 1 and 2 ...
but 3, 4, and 5 follow the exact same format.
There's a table for x/y positions
And a table for tile id/pallete/flipping prioritys for every single gameplay sprite in the game (not including non-gameplay screens)
I'm not going to go into detail how the coding side of the format works since that can get complicated, but it is looped though after a certain point.
And run in a specific way to allow for sprite flicker handling so that sprites will flicker instead of being hidden all the time if there's more than 64 active sprites currently on the screen ..(or 8 per scanline)
You wouldn't need to do any coding at all.

Just editing the data tables only after you figured how to work it properly.

Main - ROM Hacking - Question/Game Sprites... New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.019 seconds. (339KB of memory used)
MySQL - queries: 37, rows: 58/59, time: 0.015 seconds.