Language…
8 users online: DannyLeeClark, hoangng, mariofan_171, MATEUSVINICIUS,  Nanako, Qwoll, sholmes, SuperRomhackingNoob37 - Guests: 60 - Bots: 211
Users: 65,902 (2,194 active)
Latest user: samgalyy

Sprite GFX Creator

Tools → Sprite GFX Creator

Submission Details

Name: Sprite GFX Creator
Author: JackTheSpades
Added:
Operating System: Windows
Platforms: General
Games: SMW
Source Available: No
Featured: No
Website: None
Description: A tool, with which you can create the graphics routine for custom sprites fairly easy using a GUI.
Hardly any ASM knowledge required to handle this tool. Simply use JSR Graphics to use the code.
Can generate code for both xkas and TRASM
Tags: custom sprite graphics routine gui
Comments: 12 (jump to comments)
Rating:
4.3 (18 ratings)
No rating
Download 96.80 KiB | 12,400 downloads

Screenshots

Comments (12)

SmokyShroom Link
Can this be used for any sort of sprite, or just ones in Romi's format?
TarmaDj Link
This works with vanilla sprites?
I'll test them right now.
 RussianMan Link
This should be updated to trash trasm. And fix grammar mistakes and acode issues. Other than that, it's usefull.
Luigiz The Boss Link
Can someone make a video for this?
HammerBrother Link
Be careful that if you create a frame, and have no tiles assign to it, causes it to have a blank db table, having loops of "LDX #$FFFFFFFF".

Also, you missed the newline on the "sub offscreen" routine:
Code
                    RTS                     ; /;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $B85D - off screen processing code - shared
; sprites enter at different points
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
TheBiob Link
Not sure what it has to do with this tool but don't put the .asm directly in the list. The list expects a .cfg file and takes the .asm file which is set in the .cfg
TheOrangeToad Link
I Just Make my First custom sprites and insert in Romi's Spritetool v1.41 Then i got a error said.
.\sprites\Spiked_Goomba.asm contains invalid data. What i going to do and fix the Spiked_Goomba.asm. #thp{:s}
EDIT:The error i Got set in .cfg is That.
couldn't open asm file .\sprites\Spiked_Goomba

Look My Spiked_Goomba.asm Code. is the look bad or good
Code
;====================================================
;================Graphics Routine====================
;====================================================
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;	
; INIT and MAIN routines
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Tables for Frames:
;###############  Tables for Walking_Left_1   #############
PROPERTIES_Walking_Left_1: dcb $27,$27
TILEMAP_Walking_Left_1: dcb $E4,$A4
XDISP_Walking_Left_1: dcb $0,$0
YDISP_Walking_Left_1: dcb $0,$F0

;###############  Tables for Walking_Left_2   #############
PROPERTIES_Walking_Left_2: dcb $27,$27
TILEMAP_Walking_Left_2: dcb $E6,$A6
XDISP_Walking_Left_2: dcb $0,$0
YDISP_Walking_Left_2: dcb $0,$F0

;###############  Tables for Walking_Right_1   #############
PROPERTIES_Walking_Right_1: dcb $67,$67
TILEMAP_Walking_Right_1: dcb $E6,$A6
XDISP_Walking_Right_1: dcb $0,$0
YDISP_Walking_Right_1: dcb $0,$F0

;###############  Tables for Walking_Right_2   #############
PROPERTIES_Walking_Right_2: dcb $67,$67
TILEMAP_Walking_Right_2: dcb $E4,$A4
XDISP_Walking_Right_2: dcb $0,$0
YDISP_Walking_Right_2: dcb $0,$F0

Graphics:

JSR Facing_Left_Start
JSR Facing_Right_Start

RTS

;########################################################################


Facing_Left_Start:
;1. Condition of Facing_Left
LDA $157C,x
CMP #$00
BEQ Facing_Left_Return

BRA Facing_Left_Passed
Facing_Left_Return:
RTS
Facing_Left_Passed:

JSR Walking_Left_Start

RTS

;########################################################################


Facing_Right_Start:
;1. Condition of Facing_Right
LDA $157C,x
CMP #$00
BEQ Facing_Right_Return

BRA Facing_Right_Passed
Facing_Right_Return:
RTS
Facing_Right_Passed:

JSR Walking_Right_Start

RTS

;########################################################################


Walking_Left_Start:
LDA $14
LSR A
AND #$1
Walking_Left_Frame_1:
CMP #$0
BNE Walking_Left_Frame_2
JSR Walking_Left_1_Start
BRA Walking_Left_End_Code

Walking_Left_Frame_2:
CMP #$1
BNE Walking_Left_Frame_3
JSR Walking_Left_2_Start
BRA Walking_Left_End_Code

Walking_Left_Frame_3:
Walking_Left_End_Code:

;Your Code for Walking_Left
;Hallo

RTS

;########################################################################


Walking_Right_Start:
LDA $14
LSR A
AND #$1
Walking_Right_Frame_1:
CMP #$0
BNE Walking_Right_Frame_2
JSR Walking_Right_1_Start
BRA Walking_Right_End_Code

Walking_Right_Frame_2:
CMP #$1
BNE Walking_Right_Frame_3
JSR Walking_Right_2_Start
BRA Walking_Right_End_Code

Walking_Right_Frame_3:
Walking_Right_End_Code:

;Your Code for Walking_Right
;Hallo

RTS

;########################################################################



Walking_Left_1_Start:
JSR GET_DRAW_INFO

PHX
LDX #$1
Loop_Walking_Left_1:
LDA $00
CLC
ADC XDISP_Walking_Left_1,x
STA $0300,y

LDA $01
CLC
ADC YDISP_Walking_Left_1,x
STA $0301,y

LDA TILEMAP_Walking_Left_1,x
STA $0302,y

LDA PROPERTIES_Walking_Left_1,x
ORA $64
STA $0303,y

INY
INY
INY
INY

DEX
BPL Loop_Walking_Left_1
PLX

LDY #$02
LDA #$1
JSL $01B7B3
RTS


;########################################################################



Walking_Left_2_Start:
JSR GET_DRAW_INFO

PHX
LDX #$1
Loop_Walking_Left_2:
LDA $00
CLC
ADC XDISP_Walking_Left_2,x
STA $0300,y

LDA $01
CLC
ADC YDISP_Walking_Left_2,x
STA $0301,y

LDA TILEMAP_Walking_Left_2,x
STA $0302,y

LDA PROPERTIES_Walking_Left_2,x
ORA $64
STA $0303,y

INY
INY
INY
INY

DEX
BPL Loop_Walking_Left_2
PLX

LDY #$02
LDA #$1
JSL $01B7B3
RTS


;########################################################################



Walking_Right_1_Start:
JSR GET_DRAW_INFO

PHX
LDX #$1
Loop_Walking_Right_1:
LDA $00
CLC
ADC XDISP_Walking_Right_1,x
STA $0300,y

LDA $01
CLC
ADC YDISP_Walking_Right_1,x
STA $0301,y

LDA TILEMAP_Walking_Right_1,x
STA $0302,y

LDA PROPERTIES_Walking_Right_1,x
ORA $64
STA $0303,y

INY
INY
INY
INY

DEX
BPL Loop_Walking_Right_1
PLX

LDY #$02
LDA #$1
JSL $01B7B3
RTS


;########################################################################



Walking_Right_2_Start:
JSR GET_DRAW_INFO

PHX
LDX #$1
Loop_Walking_Right_2:
LDA $00
CLC
ADC XDISP_Walking_Right_2,x
STA $0300,y

LDA $01
CLC
ADC YDISP_Walking_Right_2,x
STA $0301,y

LDA TILEMAP_Walking_Right_2,x
STA $0302,y

LDA PROPERTIES_Walking_Right_2,x
ORA $64
STA $0303,y

INY
INY
INY
INY

DEX
BPL Loop_Walking_Right_2
PLX

LDY #$02
LDA #$1
JSL $01B7B3
RTS


;########################################################################



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; GET_DRAW_INFO
; This is a helper for the graphics routine.  It sets off screen flags, and sets up
; variables.  It will return with the following:
;
;       Y = index to sprite OAM ($300)
;       $00 = sprite x position relative to screen boarder
;       $01 = sprite y position relative to screen boarder  
;
; It is adapted from the subroutine at $03B760
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

SPR_T1              dcb $0C,$1C
SPR_T2              dcb $01,$02

GET_DRAW_INFO       STZ $186C,x             ; reset sprite offscreen flag, vertical
	STZ $15A0,x             ; reset sprite offscreen flag, horizontal
	LDA $E4,x               ; \
	CMP $1A                 ;  | set horizontal offscreen if necessary
	LDA $14E0,x             ;  |
	SBC $1B                 ;  |
	BEQ ON_SCREEN_X         ;  |
	INC $15A0,x             ; /

ON_SCREEN_X         LDA $14E0,x             ; \
	XBA	 ;  |
	LDA $E4,x               ;  |
	REP #$20                ;  |
	SEC	 ;  |
	SBC $1A                 ;  | mark sprite invalid if far enough off screen
	CLC	 ;  |
	ADC.W #$0040            ;  |
	CMP.W #$0180            ;  |
	SEP #$20                ;  |
	ROL A                   ;  |
	AND #$01                ;  |
	STA $15C4,x             ; / 
	BNE INVALID             ; 
	
	LDY #$00                ; \ set up loop:
	LDA $1662,x             ;  | 
	AND #$20                ;  | if not smushed (1662 & 0x20), go through loop twice
	BEQ ON_SCREEN_LOOP      ;  | else, go through loop once
	INY	 ; / 
ON_SCREEN_LOOP      LDA $D8,x               ; \ 
	CLC	 ;  | set vertical offscreen if necessary
	ADC SPR_T1,y            ;  |
	PHP	 ;  |
	CMP $1C                 ;  | (vert screen boundry)
	ROL $00                 ;  |
	PLP	 ;  |
	LDA $14D4,x             ;  | 
	ADC #$00                ;  |
	LSR $00                 ;  |
	SBC $1D                 ;  |
	BEQ ON_SCREEN_Y         ;  |
	LDA $186C,x             ;  | (vert offscreen)
	ORA SPR_T2,y            ;  |
	STA $186C,x             ;  |
ON_SCREEN_Y         DEY	 ;  |
	BPL ON_SCREEN_LOOP      ; /

	LDY $15EA,x             ; get offset to sprite OAM
	LDA $E4,x               ; \ 
	SEC	 ;  | 
	SBC $1A                 ;  | $00 = sprite x position relative to screen boarder
	STA $00                 ; / 
	LDA $D8,x               ; \ 
	SEC	 ;  | 
	SBC $1C                 ;  | $01 = sprite y position relative to screen boarder
	STA $01                 ; / 
	RTS	 ; return

INVALID             PLA	 ; \ return from *main gfx routine* subroutine...
	PLA	 ;  |    ...(not just this subroutine)
	RTS	 ; /;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; $B85D - off screen processing code - shared
; sprites enter at different points
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

                    ;org $03B83B             

TABLE3              dcb $40,$B0
TABLE6              dcb $01,$FF 
TABLE4              dcb $30,$C0,$A0,$80,$A0,$40,$60,$B0 
TABLE5              dcb $01,$FF,$01,$FF,$01,$00,$01,$FF

SUB_OFF_SCREEN_X0   LDA #$06                ; \ entry point of routine determines value of $03
                    BRA STORE_03            ;  | 
SUB_OFF_SCREEN_X1   LDA #$04                ;  |
                    BRA STORE_03            ;  |
SUB_OFF_SCREEN_X2   LDA #$02                ;  |
STORE_03            STA $03                 ;  |
                    BRA START_SUB           ;  |
SUB_OFF_SCREEN_X3   STZ $03                 ; /

START_SUB           JSR SUB_IS_OFF_SCREEN   ; \ if sprite is not off screen, return
                    BEQ RETURN_2            ; /    
                    LDA $5B                 ; \  goto VERTICAL_LEVEL if vertical level
                    AND #$01                ;  |
                    BNE VERTICAL_LEVEL      ; /     
                    LDA $D8,x               ; \
                    CLC                     ;  | 
                    ADC #$50                ;  | if the sprite has gone off the bottom of the level...
                    LDA $14D4,x             ;  | (if adding 0x50 to the sprite y position would make the high byte >= 2)
                    ADC #$00                ;  | 
                    CMP #$02                ;  | 
                    BPL ERASE_SPRITE        ; /    ...erase the sprite
                    LDA $167A,x             ; \ if "process offscreen" flag is set, return
                    AND #$04                ;  |
                    BNE RETURN_2            ; /
                    LDA $13                 ; \ 
                    AND #$01                ;  | 
                    ORA $03                 ;  | 
                    STA $01                 ;  |
                    TAY                     ; /
                    LDA $1A                 ;x boundry ;A:0101 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0256 VC:090 00 FL:16953
                    CLC                     ;A:0100 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdiZcHC:0280 VC:090 00 FL:16953
                    ADC TABLE4,y            ;A:0100 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdiZcHC:0294 VC:090 00 FL:16953
                    ROL $00                 ;A:01C0 X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizcHC:0326 VC:090 00 FL:16953
                    CMP $E4,x               ;x pos ;A:01C0 X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizcHC:0364 VC:090 00 FL:16953
                    PHP                     ;A:01C0 X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizCHC:0394 VC:090 00 FL:16953
                    LDA $1B                 ;x boundry hi ;A:01C0 X:0006 Y:0001 D:0000 DB:03 S:01EC P:eNvMXdizCHC:0416 VC:090 00 FL:16953
                    LSR $00                 ;A:0100 X:0006 Y:0001 D:0000 DB:03 S:01EC P:envMXdiZCHC:0440 VC:090 00 FL:16953
                    ADC TABLE5,y            ;A:0100 X:0006 Y:0001 D:0000 DB:03 S:01EC P:envMXdizcHC:0478 VC:090 00 FL:16953
                    PLP                     ;A:01FF X:0006 Y:0001 D:0000 DB:03 S:01EC P:eNvMXdizcHC:0510 VC:090 00 FL:16953
                    SBC $14E0,x             ;x pos high ;A:01FF X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizCHC:0538 VC:090 00 FL:16953
                    STA $00                 ;A:01FE X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizCHC:0570 VC:090 00 FL:16953
                    LSR $01                 ;A:01FE X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizCHC:0594 VC:090 00 FL:16953
                    BCC LABEL20             ;A:01FE X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdiZCHC:0632 VC:090 00 FL:16953
                    EOR #$80                ;A:01FE X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdiZCHC:0648 VC:090 00 FL:16953
                    STA $00                 ;A:017E X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizCHC:0664 VC:090 00 FL:16953
LABEL20             LDA $00                 ;A:017E X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizCHC:0688 VC:090 00 FL:16953
                    BPL RETURN_2            ;A:017E X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizCHC:0712 VC:090 00 FL:16953
ERASE_SPRITE        LDA $14C8,x             ; \ if sprite status < 8, permanently erase sprite
                    CMP #$08                ;  |
                    BCC KILL_SPRITE         ; /
                    LDY $161A,x             ;A:FF08 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdiZCHC:0140 VC:071 00 FL:21152
                    CPY #$FF                ;A:FF08 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizCHC:0172 VC:071 00 FL:21152
                    BEQ KILL_SPRITE         ;A:FF08 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0188 VC:071 00 FL:21152
                    LDA #$00                ; \ mark sprite to come back    A:FF08 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0204 VC:071 00 FL:21152
                    STA $1938,y             ; /                             A:FF00 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdiZcHC:0220 VC:071 00 FL:21152
KILL_SPRITE         STZ $14C8,x             ; erase sprite
RETURN_2            RTS                     ; return

VERTICAL_LEVEL      LDA $167A,x             ; \ if "process offscreen" flag is set, return
                    AND #$04                ;  |
                    BNE RETURN_2            ; /
                    LDA $13                 ; \ only handle every other frame??
                    LSR A                   ;  | 
                    BCS RETURN_2            ; /
                    AND #$01                ;A:0227 X:0006 Y:00EC D:0000 DB:03 S:01ED P:envMXdizcHC:0228 VC:112 00 FL:1142
                    STA $01                 ;A:0201 X:0006 Y:00EC D:0000 DB:03 S:01ED P:envMXdizcHC:0244 VC:112 00 FL:1142
                    TAY                     ;A:0201 X:0006 Y:00EC D:0000 DB:03 S:01ED P:envMXdizcHC:0268 VC:112 00 FL:1142
                    LDA $1C                 ;A:0201 X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0282 VC:112 00 FL:1142
                    CLC                     ;A:02BD X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizcHC:0306 VC:112 00 FL:1142
                    ADC TABLE3,y            ;A:02BD X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizcHC:0320 VC:112 00 FL:1142
                    ROL $00                 ;A:026D X:0006 Y:0001 D:0000 DB:03 S:01ED P:enVMXdizCHC:0352 VC:112 00 FL:1142
                    CMP $D8,x               ;A:026D X:0006 Y:0001 D:0000 DB:03 S:01ED P:enVMXdizCHC:0390 VC:112 00 FL:1142
                    PHP                     ;A:026D X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNVMXdizcHC:0420 VC:112 00 FL:1142
                    LDA.W $001D             ;A:026D X:0006 Y:0001 D:0000 DB:03 S:01EC P:eNVMXdizcHC:0442 VC:112 00 FL:1142
                    LSR $00                 ;A:0200 X:0006 Y:0001 D:0000 DB:03 S:01EC P:enVMXdiZcHC:0474 VC:112 00 FL:1142
                    ADC TABLE6,y            ;A:0200 X:0006 Y:0001 D:0000 DB:03 S:01EC P:enVMXdizCHC:0512 VC:112 00 FL:1142
                    PLP                     ;A:0200 X:0006 Y:0001 D:0000 DB:03 S:01EC P:envMXdiZCHC:0544 VC:112 00 FL:1142
                    SBC $14D4,x             ;A:0200 X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNVMXdizcHC:0572 VC:112 00 FL:1142
                    STA $00                 ;A:02FF X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizcHC:0604 VC:112 00 FL:1142
                    LDY $01                 ;A:02FF X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizcHC:0628 VC:112 00 FL:1142
                    BEQ LABEL22             ;A:02FF X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0652 VC:112 00 FL:1142
                    EOR #$80                ;A:02FF X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0668 VC:112 00 FL:1142
                    STA $00                 ;A:027F X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0684 VC:112 00 FL:1142
LABEL22             LDA $00                 ;A:027F X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0708 VC:112 00 FL:1142
                    BPL RETURN_2            ;A:027F X:0006 Y:0001 D:0000 DB:03 S:01ED P:envMXdizcHC:0732 VC:112 00 FL:1142
                    BMI ERASE_SPRITE        ;A:0280 X:0006 Y:0001 D:0000 DB:03 S:01ED P:eNvMXdizCHC:0170 VC:064 00 FL:1195

SUB_IS_OFF_SCREEN   LDA $15A0,x             ; \ if sprite is on screen, accumulator = 0 
                    ORA $186C,x             ;  |  
                    RTS                     ; / return
Green Moon 93 Link
It's asking me for a .grc.
What is that? :S
jedibrysen Link
Not work ;-;
Mario98966 Link
This will help others towards making their own custom characters! Maybe like make a new pack of the Koopa-Troopa's shells to many other stuff. This is something you should use for making your own Sprites.


RATE: 8/10
Suika Ibuki Link
Seriously that's just awesome!
It kills the most annoying part of coding a sprite.
CalebDavidSMWHacker Link
Exelent work!