+  RHDN Forum Archive
|-+  Romhacking
| |-+  General Romhacking
| | |-+  Importing SMB3 Koopaling sprites in SMB1 to replace Bowser sprite
Pages: 1 [2]
Author Topic: Importing SMB3 Koopaling sprites in SMB1 to replace Bowser sprite  (Read 1 times)
Dr. Floppy
Guest
« Reply #15 on: October 05, 2009, 02:26:16 am »

Quote from: willj168 on October 04, 2009, 09:04:35 pm
As I was suggested to expand the rom in order to obtain enough tiles to make the Koopaling sprites, do I just simply expand the CHR (graphics) because it gets me extra tiles to make more objects/sprites? As I seen in some hacks, animation and BG effects are the result of ROM CHR expansion. Is that correct?

Not to go off-topic, but I want to use two sets of tiles for the Koopaling/Bowser sprites because of walking animation. With one set of tiles for Bowser, how many times do I need to duplicate the CHR and what is the offset to the CHR in SMB1?

The original SMB1 Bowser has a grand total of sixteen sprite tiles to his name, correct? The overlapping sprite routine I suggested earlier would utilize twelve sprite tiles, leaving four for alternate frames.

Expanding the CHR-ROM would also require expanding the ROM to utilize a different mapper. Fortunately, you only need seven additional lines of sixteen sprite tiles apiece, and that kind of selective-replacement *is* possible. (Zelda 1 swaps out the bottom six lines of sprite tiles depending upon what type of dungeon you're in.)
willj16
Guest
« Reply #16 on: October 05, 2009, 07:14:39 am »

I may go with your suggestion with the overlapping sprite tile routine because the seven lines I make can be for the Koopalings and I leave the original tiles for Bowser
frantik
Guest
« Reply #17 on: October 05, 2009, 05:48:06 pm »

the code you will need to modify is around this area:

Code:
; $d17b-$d1bb ( 0x518b - 0x51cb ) bowser graphics handler
BowserGfxHandler:
          jsr ProcessBowserHalf    ;do a sub here to process bowser's front
          ldy #$10                 ;load default value here to position bowser's rear
          lda Enemy_MovingDir,x    ;check moving direction
          lsr
          bcc CopyFToR             ;if moving left, use default
          ldy #$f0                 ;otherwise load alternate positioning value here
CopyFToR: tya                      ;move bowser's rear object position value to A
          clc
          adc Enemy_X_Position,x   ;add to bowser's front object horizontal coordinate
          ldy DuplicateObj_Offset  ;get bowser's rear object offset
          sta Enemy_X_Position,y   ;store A as bowser's rear horizontal coordinate
          lda Enemy_Y_Position,x
          clc                      ;add eight pixels to bowser's front object
          adc #$08                 ;vertical coordinate and store as vertical coordinate
          sta Enemy_Y_Position,y   ;for bowser's rear
          lda Enemy_State,x
          sta Enemy_State,y        ;copy enemy state directly from front to rear
          lda Enemy_MovingDir,x
          sta Enemy_MovingDir,y    ;copy moving direction also
          lda ObjectOffset         ;save enemy object offset of front to stack
          pha
          ldx DuplicateObj_Offset  ;put enemy object offset of rear as current
          stx ObjectOffset
          lda #Bowser              ;set bowser's enemy identifier
          sta Enemy_ID,x           ;store in bowser's rear object
          jsr ProcessBowserHalf    ;do a sub here to process bowser's rear
          pla
          sta ObjectOffset         ;get original enemy object offset
          tax
          lda #$00                 ;nullify bowser's front/rear graphics flag
          sta BowserGfxFlag
ExBGfxH:  rts                      ;leave!


see where it says "add eight pixels to bowser's front object".. thats the good stuff right there..

you will also need to tweak bowser's bounding box to do it cleanly.. modifying enemies is one area of smb i haven't really gotten deep into so i can't help you there
willj16
Guest
« Reply #18 on: October 06, 2009, 07:57:42 pm »

I have an idea [until I get into the habit of programming]. I'll make a series of hacks involving each Koopaling and Bowser and use other characters [as Mario] in place of Mario because Mario will be in the last version. 8 roms will be used in this collection I'm making. The Koopalings will not be of SMB3 variety but they will somehow appear in SMB1 for the first time. This task is easy to do because I can do level layouts and graphics. The only programming required is for palettes. SMB3 Koopalings will be used in a later hack when I get into learning how to work with hex and assembly.
Pages: 1 [2]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC