Jump to content
IGNORED

Colecovision strange sprite corruption


Recommended Posts

Hi all

 

I wonder if I can get some collective help for a strange problem I am having.

i've been working on a CV game for some time now, its a collection of mini games and a menu system to tie them together and code wise its all done and dusted, it works perfectly on every emulator I have found, but when I test it on hardware I get a very strange and apparently random corruption of my sprites but only on some of the games, and not always the same ones.

 

I am using the correct terminators in the sprite list I send to the video. and I even make an extra effort to ensure the sprite attrib memory is filled with 192's before I dump my sprite list. but on some of my sub games, the sprites just go crazy.. I can reposition the games and the issue vanishes, though will crop up in another game or not appear again unless I add a few bytes of code. I don't have enough memory now to actrually just add padding until it stops so I have to find a fix..

I've re-written my sprite manager several times now, assuming I'd made some error, but the problem keeps coming back at some other point no matter what methods i use to build the sprite patterns (games usually have 2-3 16x16's to make a game char) The games are arranged to minimise sprite flicker but if it does occur it alters priority to reduce the flicker..

 

Its very frustrating, the only thing I can think of is if there is some area of ROM or RAM that I am not supposed to be accessing, though I see nothing in the docs that suggest that.

 

So anyone know what is going on? I really want to get this game out on cart but until I can be sure it works on hardware I can' t release it.

.

Link to comment
Share on other sites

Maybe your game is simply trying to update sprites a bit too fast while the screen is refreshing, in this case, uses extra NOPs between commands 'IN' and 'OUT' to update VRAM instead of an 'OTIR' single command. Another way is to update sprites right at each NMI interruption to avoid updating them while the screen is redrawn, and if you already do this, it might be done just a bit too late; so put it right at start of the NMI if possible.

 

That`s all I can say without looking at the code directly.

Edited by newcoleco
  • Like 1
Link to comment
Share on other sites

Unfortunately, I cannot be of any help to you on this; however, I can acknowledge that this does in fact happen. I've seen games that worked on emulators on a laptop, yet have glitched-out graphics on a console's emulator, thus making it impossible to see what you are doing. I've seen games that others played on their computers just fine, yet some of those same games freeze and are unable to be played on console emulators.

I don't know what the causes or solutions are to these problems, but I'm more than glad to acknowledge that they indeed do happen and you are not losing your mind.

Link to comment
Share on other sites

The Colecovision VDP fails if data is written too fast, so far no emulator "emulates" this. I've cycle counting in CoolCV so it could issue a warning, but the code isn't enabled for general purpose.

 

One typical example is using this:

 

         LD HL,DUMP_TABLE
         LD B,4
         LD C,VDP_PORT

label:   OUTI           ; 16 cycles - This works
         JR NZ,label    ; 12 cycles -

label:   OUTI           ; 16 cycles - This doesn't work sometimes
         JP NZ,label    ; 10 cycles -

label:   OUTI           ; 16 cycles - This doesn't work always
         OUTI           ; 16 cycles -
         OUTI           ; 16 cycles -
         OUTI           ; 16 cycles -
This means you must be sure at least 28 cycles of instructions are happening with each OUT.

 

         OUT (VDP),A    ; 12 cycles - This doesn't work
         OUT (VDP),A    ; 12 cycles

         OUT (VDP),A    ; 12 cycles - This will work
         NOP            ; 4 cycles
         NOP            ; 4 cycles
         NOP            ; 4 cycles
         NOP            ; 4 cycles
         OUT (VDP),A    ; 12 cycles
  • Like 3
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...