Re: Falling Speckles Exercise

new topic     » goto parent     » topic index » view thread      » older message » newer message

>
>Here's the corrected source. I've added comments to show where the
>bugs were, and how I fixed them.
>
>I'm pretty sure that the Causeway error came from the snow falling
>off the bottom line of the screen. I've shown why in the code.
>
>Regards,
>               Michael Bolin
>

Thanks!  I looked at the comments you made and I realize what was going on
with the snow eating the text etc.  But I still dont see how writing to just
below the visible screen area would cause the program to fail.  I have never
experienced a problem like this before (of course, I have never written off
the screen in protected mode before either).
It seems to me that if writing to memory off the display screen causes the
problem, it should have manifested itself while the program was running, not
right after a key was pressed.  The way the program is written, a check is
made for a key press.  If there was no key pressed, it goes on to calculate
the new screen using the virtual one.  Once that is done, it copies the
virtual screen to the VGA, and then performs another keypress
check/update/copy, ad infinum.  if a key was pressed, the program exits the
loop, without calculating another screen, and without another VGA write.  I
am not sure what part of memory is at the 201 line that i was writing to,
but I thought it was still part of the display memory (since 64000 * 4 = 320
* 200 * 4 = 256000 which is less than the 512k on my card).  However, seeing
as it DOES cause problems, I will try to avoid doing so again.
Anyway, thanks for the information.

>I tried fall.ex in a win95 DOS window and there was no problem. However
>when I rebooted in (pure) MS-DOS 7.0 mode and ran it, I was able to
>duplicate the problem exactly as described. I'm not sure yet if it's due to
>a bug in Euphoria, the Causeway extender, or your program, but I would like
>to warn other people not to run this program because after it crashed,
>SCANDISK detected and corrected a minor disk error. I wouldn't want other
>people to risk damaging their file systems.
>
>I'll report back to this list once I figure out
>what's going wrong here.
>
>Thanks for reporting the problem.
>
>Regards,
>  Rob Craig
>  Rapid Deployment Software

Wow!  Can the disk error be traced back to fall.ex?  Again, I have very
little experience dealing with programming in protected mode, but i thought
that VGA memory was VGA memory.  I will have to be much more carefull in the
future.

Also, if you find out exactly what was happening with the Causeway extender
when I was writing off the screen, I am sure everyone would like to hear
what it was, so that similar mistakes can be avoided.

Again, Thanks.

James Powell

PS.  Here's a little tip for other programmers.    ; )

There are 2 ways to write bug free code, and only the 3rd way works!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu