Jump to content
IGNORED

Weird bugs


tabachanker2

Recommended Posts

Hey everyone,

 

Just thought I'd drop by and tell you of 2 bugs I encountered when I tried my Lode Runner game on the real thing. Those 2 bugs weren't there when I played the game through any emulator (mainly tinymess and bluemsx) but they showed their ugly mugs when played on the real Colecovision (the Coleco Adam to be more precise...)

 

The 1st bug: Video chip read/write timing issue.

 

The problem: Some of the ladder tiles that appears at the end of a level would not appear at the correct place on screen. The Y coordinate of the new ladder tiles was always correct whereas the X coordinate sometimes was in the wrong place.

 

The cause: The YX coordinates of those ladder tiles are stored in VRAM (not enough place in RAM to store them). So to display them on screen when a level is finished, I have to read each YXcoordinates from VRAM and display them on screen. The bug was that I read the X coordinate almost immediately after the Y coordinate. The exact bugged instructions were:

...
ld c,$BE
in d,(c)
inc hl
in e,(c)
...

The "inc hl" in between wasn't enough time for the video chip to prepare the next byte to read.

 

The correction: I moved the "in e,( c )" for the Xcoordinate read a little farther down the subroutine. I was able to do something else before reading the Xcoordinate (mainly calculating the screen line offset where to write tile from the YCoordinate). If you have something to do between VRAM reads, it's always best as you don't have any lost time. If you have nothing else to do in between, then 3 "nop" instructions should be enough.

 

 

The 2nd bug: There's something in the Colecovision at address $6FFF and less (above the RAM)

 

The problem: It was sometimes impossible to climb a ladder on the 1st level line (rendering the level unfinishable as you have to climb passed the 1st line to win the level)

 

The cause: In my game, all the tiles of the current level are in RAM (I use locations $7000-$721F just for that!) So when I check if it's possible to climb a ladder, I check if the tile in RAM behind the player is a ladder and if the tile above is not a platform. I totally forget the fact that if the player's on the 1st level line, the line above doesn't exist! So when the player was trying to climb a ladder on the 1st line, the tile behind was checked for a ladder (RAM range $7000-$701F) AND the tile above was checked for a platform (RAM range $6FE0-6FFF).

 

Now in the emulators, nothing particular happened. The player could always climb the 1st line ladders and the level finished normally. On the real deal though, sometimes it would "see" a platform in the range $6FE0-6FFF (the platforms are represented by a 1 in a particular bit of the byte). I read somewhere that Colecovision RAM is mirrored every $400 bytes between $6000 and $7FFF. It would explain the "garbage" just above "normal" RAM $7000 (it would be the same as the end of the "normal" RAM so, in my game, the stack). This would also mean that emulators don't mirror properly the RAM.

 

The correction: Before checking if there's a platform above, I check if player is on 1st level line first. If yes, player can climb up. If not, player can climb up only if no platforms above.

 

I hope this has been informative and/or interesting. If you encountered your own weird bugs, post them in this thread!

Link to comment
Share on other sites

Wish I was more knowledgeable on this subject but there is one thing to consider. Have you tried playing on a ColecoVision Game System and not on an ADAM Computer. I ask this because there are two known games that work perfectly on a CV, but will not work properly on an ADAM Computer... Defender and Super Cobra. Defender was patched BITD to work on the ADAM, but I don't recall Super Cobra ever being fixed and it strikes me as odd that they are both side scrolling/horizontally scrolling games.

 

In the end, it probably doesn't have anything to do with the issues you are experiencing, but it's worth a looksee to try on a real CV especially since emulation in BlueMSX is pretty solid as far as I know. :?

Edited by NIAD
Link to comment
Share on other sites

Some versions of Super Cobra will run on an ADAM. We played it in the HSC awhile back and I'm fairly sure I played it on the ADAM on the 128-in-1 cart (although it might have been on the CV)...but in any case, the CP/M dump of Super Cobra does run on the ADAM...I just tried it to be sure. I also tried the rom marked Super Cobra # ColV.ROM and it won't run correctly.

 

Now I'm curious and will have to try all my Super Cobras tomorrow to see which ones run and which ones don't and on what machine.

 

Wish I was more knowledgeable on this subject but there is one thing to consider. Have you tried playing on a ColecoVision Game System and not on an ADAM Computer. I ask this because there are two known games that work perfectly on a CV, but will not work properly on an ADAM Computer... Defender and Super Cobra. Defender was patched BITD to work on the ADAM, but I don't recall Super Cobra ever being fixed and it strikes me as odd that they are both side scrolling/horizontally scrolling games.

 

In the end, it probably doesn't have anything to do with the issues you are experiencing, but it's worth a looksee to try on a real CV especially since emulation in BlueMSX is pretty solid as far as I know. :?

Link to comment
Share on other sites

Those are interesting issues, Steve. Thanks for sharing! :)

 

So you're using half the 1K of RAM for storing tiles? That's kinda bold, my friend. ;)

Yep! That's me wanting the game to run at 60fps throughout!! It's certainly faster than storing everything in VRAM. Consider that each time the enemies move, they check a lot of tiles to try to find a way to the player. Without going into too much details, they check every horizontal tiles on their current platform and for all of those, every possible ways up and down. This is a lot of RAM access! I intensively tried the game with the max enemies on screen at once (5), the game never dips below 60fps. Something I'm sure I wouldn't have been able to do if the level data was in VRAM.

 

I even used more bytes than needed. Levels are 28 tiles wide per 16 high. I added 4 bytes per lines so that each tile lines takes an even 32 bytes. That way, when converting the sprite YTilePos (0-15) to find its starting address in RAM, I just have to add the YTilePos to itself 5 times (simulating a "x 32"). Those 4 extra bytes aren't really lost either since I formatted them to represent platform tiles. That way, no need to check level limits horizontally. When you reach the side of the level, you're blocked by a "platform" (visible in RAM but not on screen).

 

I did the same for the level limit below. I use an extra $20 bytes below (range $7200-$7220) just to simulate a platform there! I don't know why I didn't do the same thing for above (see my 2nd bug in the OP). When I corrected the bug, I considered adding the same extra line above, but everything is so jammed pack in RAM now! I decided to check for the top level limit instead.

 

Wish I was more knowledgeable on this subject but there is one thing to consider. Have you tried playing on a ColecoVision Game System and not on an ADAM Computer. I ask this because there are two known games that work perfectly on a CV, but will not work properly on an ADAM Computer... Defender and Super Cobra. Defender was patched BITD to work on the ADAM, but I don't recall Super Cobra ever being fixed and it strikes me as odd that they are both side scrolling/horizontally scrolling games.

 

In the end, it probably doesn't have anything to do with the issues you are experiencing, but it's worth a looksee to try on a real CV especially since emulation in BlueMSX is pretty solid as far as I know. :?

You're absolutely right in that the Coleco Adam can be sometimes different than the Colecovision. The 1st bug with the video chip timing is probably not different on the real Colecovision. It's a well documented "feature" of this chip that you have to wait a while in between reads/writes. But the 2nd bug with the garbage over normal $7000 could well be machine specific.

Link to comment
Share on other sites

Wish I was more knowledgeable on this subject but there is one thing to consider. Have you tried playing on a ColecoVision Game System and not on an ADAM Computer. I ask this because there are two known games that work perfectly on a CV, but will not work properly on an ADAM Computer... Defender and Super Cobra. Defender was patched BITD to work on the ADAM, but I don't recall Super Cobra ever being fixed and it strikes me as odd that they are both side scrolling/horizontally scrolling games.

 

You can add Mario Bros to this list since MB doesn't work on ADAM :|

Link to comment
Share on other sites

Just for the record...I rechecked all my Super Cobra roms...

 

None of the regular roms run correctly on the ADAM

They do run correctly on the ColecoVision

The CP/M dump of Super Cobra does run correctly on the ADAM

 

Why would the CP/M dump run correctly when the regular rom dumps don't?

 

 

Wish I was more knowledgeable on this subject but there is one thing to consider. Have you tried playing on a ColecoVision Game System and not on an ADAM Computer. I ask this because there are two known games that work perfectly on a CV, but will not work properly on an ADAM Computer... Defender and Super Cobra. Defender was patched BITD to work on the ADAM, but I don't recall Super Cobra ever being fixed and it strikes me as odd that they are both side scrolling/horizontally scrolling games.

 

In the end, it probably doesn't have anything to do with the issues you are experiencing, but it's worth a looksee to try on a real CV especially since emulation in BlueMSX is pretty solid as far as I know. :?

Edited by jblenkle
Link to comment
Share on other sites

Just for the record...I rechecked all my Super Cobra roms...

 

None of the regular roms run correctly on the ADAM

They do run correctly on the ColecoVision

The CP/M dump of Super Cobra does run correctly on the ADAM

 

Why would the CP/M dump run correctly when the regular rom dumps don't?

 

Did you ever perform such a CP/M ROM dump yourself?

Link to comment
Share on other sites

The CP/M dump of Super Cobra does run correctly on the ADAM. Why would the CP/M dump run correctly when the regular rom dumps don't?

Man, it's been a long time since I used the CP/M Gamesave.com cart copy utility, but I seem to recall that it uses Expansion RAM provided by an installed Memory Expander... but why that would make a difference, I have no idea.

 

Try removing your Memory Expander and then test out the CP/M format rom dump of Super Cobra again.

Link to comment
Share on other sites

Did you ever perform such a CP/M ROM dump yourself?

BITD, the CP/M program Gamesave.com was the best cart copy program to use seeing as the other options were E.O.S. SmartBASIC cart dump programs that could only handle 16K carts... even CopyCart v1.0 couldn't handle 32K cart properly and that's why v2.0 was released.

 

A lot of bad/corrupted dumps resulted in people converting these CP/M dumps to ADAM's standard O.S. (called EO.S.).

Link to comment
Share on other sites

Yes, can't remember if specifically on Super Cobra though...although probably (this was in the 80s!!!). There is a utility program called GAMESAVE(?) that runs in CP/M that allows you to dump cartridge games to CP/M files that you can then run from CP/M.

 

Did you ever perform such a CP/M ROM dump yourself?

Link to comment
Share on other sites

Yes, yanked the memory card out, and the CP/M Super Cobra still runs...

 

 

Man, it's been a long time since I used the CP/M Gamesave.com cart copy utility, but I seem to recall that it uses Expansion RAM provided by an installed Memory Expander... but why that would make a difference, I have no idea.

 

Try removing your Memory Expander and then test out the CP/M format rom dump of Super Cobra again.

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