|
Post by pokemar on Dec 19, 2010 12:41:54 GMT -5
I have a basic doubt here! How to disaplay sprites? Please Help!!!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 19, 2010 13:53:59 GMT -5
Attached is a basic example. Please read the BasiEgaXorz documentation carefully! Attachments:
|
|
|
Post by pokemar on Dec 20, 2010 4:42:35 GMT -5
Do u have an siple game exemple? i have tryed to find that but that is a bit hard to find! thanks!!!
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 20, 2010 7:57:22 GMT -5
Take a look at "SHNAKEEE.BEX", "shnakeee2.bex", "turbo_cars.bex", "chicken_wee.bex", "GALAXIAN.BEX" and "HAMURABI.BEX" in the "examples" folder of your BasiEgaXorz installation.
|
|
|
Post by sega16 on Jan 16, 2011 19:13:41 GMT -5
to display a sprite you must first load the tiles in the vram using load tiles like this LoadTiles tiledata, numberoftiles,vramoffset also you need to include the file like this maingrapicspal: datafile maingrapic_pal.bin,bin then do something like this sprite=AddSprite(1,1) the numbers mean how big the sprite is the max is 4by4 tiles(32x32) PropSprite sprite, vramoffset,pallet row MoveSprite sprite%,197,197 note: for move sprite it is screen location +128
|
|
|
Post by memorydump on Jan 30, 2011 4:52:29 GMT -5
Would there be a way so the character's tiles are never in vram except when they're being called upon for each separate animation? That way you free up tons and tons of space from sprites that might have so many animations that they take up over 300 tiles alone just for all their animations.
Can you just do a freeallsprites thing when each new animation is loaded? Except, that would also then get rid of any other sprites on screen instead of only affecting the one you're controlling. The concept sounds simple enough, I'm just not sure how to execute it, or if such a method is ever done on the Genesis.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 30, 2011 7:31:10 GMT -5
memorydumpSprites don't have anything to do with that. Simply overwrite tiles at runtime that you don't need at the moment. Sonic for example uses this method a lot ( a entire level + characters wouldn't fit in the VRAM ). The obvious downside is that you have to sacrifice CPU cycles to "swapping" tiles around.
|
|
|
Post by memorydump on Jan 30, 2011 22:35:05 GMT -5
I hate to have to keep asking simple questions, but simple things keep coming up impossible for me to do I can't figure out what I'm doing wrong that this sprite absolutely refuses to display properly, though I'm certain I've got all the dimensions and everything right. What gives? pallettes gpal, 0, 0, 16 loadtiles gidle, 24, 1
goemon = addsprite(4,6) propsprite goemon, 1, 0 goemonx = 80 goemony = 80 movesprite goemon, 128+goemonx, 128+goemony gidle: DATALONG $00000000 ' Tile #0 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00422222 DATALONG $00042222 DATALONG $00044222 DATALONG $00004422 DATALONG $00042222 ' Tile #1 DATALONG $00422222 DATALONG $05554222 DATALONG $00054224 DATALONG $00054445 DATALONG $00554555 DATALONG $00555555 DATALONG $05555555 DATALONG $05555556 ' Tile #2 DATALONG $00555557 DATALONG $00067658 DATALONG $00068D68 DATALONG $00007877 DATALONG $00000669 DATALONG $0000005B DATALONG $00008EE7 DATALONG $00076B7E ' Tile #3 DATALONG $0006A6BE DATALONG $006C7A9B DATALONG $00A7C79B DATALONG $067C7A6B DATALONG $09A9A9B6 DATALONG $07DD89BB DATALONG $98DDD866 DATALONG $98D76D69 ' Tile #4 DATALONG $09887697 DATALONG $00666597 DATALONG $00000977 DATALONG $00000977 DATALONG $00000669 DATALONG $000000BB DATALONG $0000007C DATALONG $000009A7 ' Tile #5 DATALONG $00005555 DATALONG $0005A5AC DATALONG $0005C5DC DATALONG $00078DDD DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00010000 ' Tile #6 DATALONG $00231001 DATALONG $04133123 DATALONG $42133333 DATALONG $22213333 DATALONG $22133333 DATALONG $13333333 DATALONG $22133333 DATALONG $22213333 ' Tile #7 DATALONG $22233333 DATALONG $22133333 DATALONG $42111233 DATALONG $42124413 DATALONG $42677423 DATALONG $46556842 DATALONG $55555574 DATALONG $59AA5557 ' Tile #8 DATALONG $9CC22258 DATALONG $7DD3D378 DATALONG $DDDD557D DATALONG $DDDDDDDD DATALONG $8D77DD66 DATALONG $9787557D DATALONG $66978888 DATALONG $77669977 ' Tile #9 DATALONG $E7889EEA DATALONG $E788897D DATALONG $8778796B DATALONG $7B978EE8 DATALONG $B6E866BB DATALONG $B977776E DATALONG $9788879B DATALONG $7788899B ' Tile #10 DATALONG $77887996 DATALONG $7788999B DATALONG $7787996B DATALONG $7779996B DATALONG $777999BB DATALONG $669996BB DATALONG $7ABBBBB2 DATALONG $C9B000B6 ' Tile #11 DATALONG $5DC0004A DATALONG $55DC04AC DATALONG $A5CC04AC DATALONG $87990669 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 ' Tile #12 DATALONG $00012000 DATALONG $21332000 DATALONG $33312000 DATALONG $33112000 DATALONG $33333331 DATALONG $33333112 DATALONG $33333120 DATALONG $33333310 ' Tile #13 DATALONG $33333331 DATALONG $33333111 DATALONG $33313122 DATALONG $33211120 DATALONG $31642120 DATALONG $32554220 DATALONG $15555540 DATALONG $45A9B500 ' Tile #14 DATALONG $522A6000 DATALONG $3C3C7000 DATALONG $55D87000 DATALONG $DD887000 DATALONG $6D789000 DATALONG $D6879000 DATALONG $87760000 DATALONG $96B78000 ' Tile #15 DATALONG $C279B800 DATALONG $DC289800 DATALONG $ED289700 DATALONG $778B7B00 DATALONG $E858B900 DATALONG $E7588786 DATALONG $EBB8B678 DATALONG $B66BB768 ' Tile #16 DATALONG $66B6B676 DATALONG $BBB66B60 DATALONG $BB666000 DATALONG $BB666000 DATALONG $BB66B000 DATALONG $BBBB0000 DATALONG $B2900000 DATALONG $19100000 ' Tile #17 DATALONG $AA555500 DATALONG $C55A5A50 DATALONG $A5AC5A50 DATALONG $97777990 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 ' Tile #18 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $20000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 ' Tile #19 DATALONG $00000000 DATALONG $20000000 DATALONG $22000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 ' Tile #20 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 ' Tile #21 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $60000000 DATALONG $60000000 ' Tile #22 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 ' Tile #23 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000 DATALONG $00000000
gpal: DATAINT $0A2A,$0E28,$0A04,$0E6A,$0400,$0000,$0208,$046E DATAINT $048E,$022A,$0C64,$0204,$0EA4,$0AEE,$02EE,$0000
I've attached the original bmp I worked with. I swear I'm trying everything I can, why doesn't it want to show up right? It gets the same result as a .bin file. Is it because a sprite isn't allowed to be over (4,4) or something? Attachments:
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Jan 31, 2011 4:25:16 GMT -5
Yep. The Megadrive / Genesis only supports sprites up to 32x32 pixels. Requesting a "4,6" sprite actually gives you a sprite of 32x16 pixels ( "0,0" = 32x32, "5,7" = 8x24 etc ). Simply split the character into multiple sprites if it's bigger then 32x32 pixels ( see the Eggman.bex example posted earlier in this thread ).
|
|
|
Post by memorydump on Jan 31, 2011 6:18:32 GMT -5
Thanks for taking the time to explain. I didn't add the part asking if (4,4) is the limit until i looked at your Eggman example again, and from other examples I've been finding it was starting to become more apparent heh.
|
|
|
Post by Sg on Aug 15, 2014 9:32:14 GMT -5
Is it possible to display a sprite of 64x38 size? 2 tiles of 32x32 at the top and 2 tiles of 6x32 at the bottom ?
or it's only 8x8, 16x16, 32x32 format?
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Aug 15, 2014 9:48:59 GMT -5
Is it possible to display a sprite of 64x38 size? 2 tiles of 32x32 at the top and 2 tiles of 6x32 at the bottom ? or it's only 8x8, 16x16, 32x32 format? Sprites can only be 8, 16, 24 or 32 pixels in width and height ( because tiles are always 8x8 pixels in size ). So in order to display a 64x38 sprite, you need 4 sprites in total. For example ..
|
|
|
Post by Sg on Aug 16, 2014 12:36:48 GMT -5
what am i doing wrong? palettes pallettedata_48x32a,0,0,16 loadtiles tiledata_48x32a,24,256 player = addsprite(4,4) propsprite player,256,0 movesprite player,272,224 d = addsprite(4,2) propsprite d,256,0 movesprite d,320,224 pallettedata_48x32a: DATAINT $0AAA,$0AAA,$00AC,$0044,$0000,$0004,$0A22,$0400 DATAINT $0A68,$020E,$0466,$0624,$0486,$0042,$0442,$0886 tiledata_48x32a: DATALONG $11111111 ' Tile #0 DATALONG $11111111 DATALONG $11111111 DATALONG $11111111 DATALONG $11111111 DATALONG $11111111 DATALONG $1111133D DATALONG $1111AA21 DATALONG $1123A222 ' Tile #1 DATALONG $773BA223 ...
|
|
|
Post by sega16 on Aug 16, 2014 16:42:52 GMT -5
|
|
|
Post by Sg on Aug 16, 2014 17:08:06 GMT -5
yes just change the tile adress and x,y position is anybody have the address memory summary ?
|
|