Kiwi Posted February 16, 2020 Share Posted February 16, 2020 7 hours ago, Eric M said: Don't worry, your solution is welcome ( and any other) by the way, in my WIP17 video, at 2:12 / 13 - a white square (16x16) appear at the top right of the screen. Is there a kind of sprite initialisation problem ? Maybe I am doing something wrong ... (it's possible ) See you and thanks a lot Eric updatesprites(0,64); only works when nmi is enabled. After enabled_nmi(); do updatesprites(0,64);, then delay(1); before turning screen_on();. I made a sprite sweeping function. updatesprites(0,64); reason the 2nd argument is 64, any number above 16 makes the sprites blinks. void SweepSprites(void){ for (i=0;i!=32;i++){ sprites[i].y = 207;} updatesprites(0,64); } 1 Quote Link to comment Share on other sites More sharing options...
Eric M Posted February 16, 2020 Author Share Posted February 16, 2020 Thanks Kiwi Quote Link to comment Share on other sites More sharing options...
Eric M Posted February 23, 2020 Author Share Posted February 23, 2020 (edited) Hi Kiwi I don't know if I do it right but I use sprite.y = 208 for unused sprites and it works See you Eric Edited February 23, 2020 by Eric M Quote Link to comment Share on other sites More sharing options...
Kiwi Posted February 23, 2020 Share Posted February 23, 2020 (edited) 58 minutes ago, Eric M said: Hi Kiwi I don't know if I do it right but I use sprite.y = 208 for unused sprites and it works See you Eric That'll work. Just informing you that 208 or 0xd0 is a special number to terminate sprite. Any sprite number after the one with y=208 will not show up. So, sprites[0].y=208; will disable all sprites. Having, sprites[12].y=208; will disable sprites[13] and up. The reason I use 207, so I can flicker between sprites[0] and sprites[31] for games I design to have more than 4 on a line. If I have sprites[1].y=208, then sprites[31] won't show up. Another magic number is the early clock that moves the sprites 32 to the left. If the sprite's color value is over 128, you trigger the early clock. Useful if you need a sprite to pan off the left side of the screen instead of disappearing. Edited February 23, 2020 by Kiwi 1 Quote Link to comment Share on other sites More sharing options...
Eric M Posted February 23, 2020 Author Share Posted February 23, 2020 For the last point, without triggering the Early Clock, sprites disappear suddenly when reaching left border. With EC, sprite desappear pixel by pixel when reaching the left border (like it does when it reaches right, up, or down border). Maybe for a next project, I have to study sprite flikering Thx a lot Quote Link to comment Share on other sites More sharing options...
Kiwi Posted February 23, 2020 Share Posted February 23, 2020 13 minutes ago, Eric M said: Maybe for a next project, I have to study sprite flikering Posted a sample program here that will help you out. Quote Link to comment Share on other sites More sharing options...
Eric M Posted February 23, 2020 Author Share Posted February 23, 2020 Perfect my friend 1 Quote Link to comment Share on other sites More sharing options...
alekmaul Posted February 24, 2020 Share Posted February 24, 2020 @Eric M, if you use my coleco library pvcollib, i managed sprite flickering, so no need for you to implement this feature ;) Quote Link to comment Share on other sites More sharing options...
Eric M Posted February 24, 2020 Author Share Posted February 24, 2020 Hi Alek, I'll use your lib for my next project See you Quote Link to comment Share on other sites More sharing options...
Eric M Posted March 8, 2020 Author Share Posted March 8, 2020 Hi friends, I write this little message for an advice. I'm still working on my first game for colecovision and learn every day I open my computer to code on Wii?. From rle I had to move to pletter (I have some things to had but Wii? was about 31KB) (all my graphs are 'pletterized'. From about 31KB, I've got now about 27KB) What I've done : I've integrated pletter_dan.s in my sourcecode and I've replaced the following procedures load_patternrle(Wii_LOGO_PATTERNRLE); duplicate_pattern(); rle2vram(Wii_LOGO_COLORRLE,coltab); rle2vram(Wii_LOGO_COLORRLE,coltab+2048); rle2vram(Wii_LOGO_COLORRLE,coltab+4096); rle2vram(Wii_LOGO,chrtab); rle2vram(Wii_OEIL_SPATTERNRLE,sprtab); by Pletter_Menu(); duplicate_patten(); with static void Pletter_MENU(void) { __asm ld hl,#_Wii_LOGO_PATTERNRLE ld de,#0x0000 call _Pletter ld hl,#_Wii_LOGO_COLORRLE ld de,#0x2000 call _Pletter ld hl,#_Wii_LOGO_COLORRLE ld de,#0x2000+2048 call _Pletter ld hl,#_Wii_LOGO_COLORRLE ld de,#0x2000+4096 call _Pletter ld hl,#_Wii_LOGO ld de,#0x01800 call _Pletter ld hl,#_Wii_OEIL_SPATTERNRLE ld de,#0x3800 call _Pletter __endasm; } It works but is this ok for you or not ? I just want to make less mistakes :) I'm still learning and this forum is the best place to have some answers, solutions, help, ... Thanks in advance for your help Eric Quote Link to comment Share on other sites More sharing options...
Kiwi Posted March 9, 2020 Share Posted March 9, 2020 You can include <comp.h> From there you can use, pletter(SpritePlet,0x3800); I had to fix the source code since the compression fails on the real colecovision. Here's my thread on this issue, Nanochess' advice made sense so I added NOP to slow down the CPU. Makes sure that pletter(); functions are nested nmi_disabled(); nmi_enabled(); $9: ld a,l out (0xbf),a ld a,h nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing out (0xbf),a nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing in a,(0xbe) ex af,af' ld a,e nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing out (0xbf),a ld a,d or #0x40 out (0xbf),a ex af,af' nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing nop ; VDP timing out (0xbe),a inc de cpi jp pe,$9 pop af pop hl ;jp (iy) jp loop Quote Link to comment Share on other sites More sharing options...
Eric M Posted March 9, 2020 Author Share Posted March 9, 2020 Hi Kiwi I've red the compression's topic. I use the source you've included in the files in comp.zip ? Thanks again Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.