Jump to content
Eric M

Colecovision Game WIP : "Where Is It ? "

Recommended Posts

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);
}



 

  • Like 1

Share this post


Link to post
Share on other sites

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 by Eric M

Share this post


Link to post
Share on other sites
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 by Kiwi
  • Like 1

Share this post


Link to post
Share on other sites

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 ;)

Share this post


Link to post
Share on other sites
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.  :)

Share this post


Link to post
Share on other sites

@Eric M, if you use my coleco library pvcollib, i managed sprite flickering, so no need for you to implement this feature ;)

 

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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


 

Share this post


Link to post
Share on other sites

Hi Kiwi 

 

I've red the compression's topic. I use the source you've included in the files in comp.zip 🙂

 

Thanks again 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...