Tonma Le 23/07/2015 à 19:37 Thanks to Black_Jack, now we can insert the asm with __asm __ ("move.w ...");
I can write VRAM with 0x3C000X
So I'd like now to change the display order of sprites. I have my first sprite 1 and the second in 2 one above the other. I think (with the docs) the first sprite is in 0x0040 or 64 in decimal and I would swap the two sprites. 0x0040 <-> 0x0080.
Do we must copy via temporary variables every word of 64-128 and how we do it ?
If someone can give us a clue, please, please.
sounds interesting but this is not yet documented (only m.a.m.e. source refers to this locations) so I have done some tests (on hardware):
pro:
- this memorylocations are writable
- you can change drawing order of sprites
con:
- this memory is updated/rewritten every scanline(!) by the system itself (so it's just for internal use?)
- manual rewrite/update have to be done every scanline (via irq2)
- update is slow (via VRAM_ADDR/VRAM_RW), only 3 oder 4 sprite changes are possible per scanline
sorry, it seems this idea ist very limited and not practicable. :-(
another way to ordering sprites? it depends how many sprites you use.
the easiest way is to make a sprite for every layer and to "disable" unneeded sprites by moving it out of screen (ypos+240).
Tonma Le 25/07/2015 à 16:06 I wish to try making game like sengoku 3, a side-scrolling beat up game. So my sprite order change often, I don't think I can use multiple sprite on different layers. The sprite moving in a third dimension forcing me to use the scb_even / scb_odd.
I use the .Datlib framework from HPMan and It's already using a Vblank function. I think I need to write my own vblank to change the sprite order.
I success with the sprite order, with a vblank function (I understand, we need to change the 96 lin sprite every blank) but I can't go out my new Vblank function. Infinite loop ?
Vblank2:
MOVE.W #0x1,0x3C0004
MOVE.W #0x8600+1,0x3C0000
MOVE.W #0x02,0x3C0002
MOVE.W #0x1,0x3C0002
MOVE.W #0x8680+1,0x3C0000
MOVE.W #0x02,0x3C0002
MOVE.W #0x1,0x3C0002
cmp.w #1, 0x100000
bne Vblank2
clr.w 0x100000
rts
My new vblank function but infinite loop? I use the code from Frog Feast NG
Vblank2:
cmp.w #1, 0x100000
bne Vblank2
clr.w 0x100000
rts
Can you help me again ?
0x100000 refers to a memorylocation, this location is set to #1 by another internal function (vblank-irq/irq1), wait_vblank waits until this location is #1.
i dont know how Datlib works, maybe another memorylocation, long instead of word (or byte?), waits until #0?
maybe HPMAN can help?
i think you can not use SCB_EVEN/ODD ingame!
Tonma Le 26/07/2015 à 09:32 Unfortunately we no longer sees HPMAN on the net.
You're right, I'll find another way. I just like to understand the hardware and do tests to find the best solution.
Tonma Le 27/07/2015 à 09:24 Good to see you
Thank you, I never checked the output map file. I'll look inside.