[Color Computer] Re: [Coco] ASM Coders - Round two!

James Diffendaffer jdiffendaffer at yahoo.com
Tue Aug 29 13:30:52 EDT 2006


--- In ColorComputer at yahoogroups.com, "James Diffendaffer"
<jdiffendaffer at ...> wrote:
>
> >Hi again
> >
> >Thanks to everyone who helped last time - here's round two!
> >The code as it stands can be found below
> >If you compile and run it as-is, it'll clear half the screen
> 
> Ok, first of all... a little terminology problem.
> Assembly language is assembled and high level languages like 'C' or
> Pascal are compiled.  Now you know.
> 
> >but! when you simply uncomment the lines:
> >    *lda #$32
> >    *sta $FFA3
> 
> Ok, next problem.  While using $FFA3 is perfectly legal you might want
> to start naming hardware registers.  There's nothing worse than
> looking back through some code you haven't touched in a while or
> someone elses code and having to go lookup what is at a given address.
> 
> $FFA3 is a GIME register for the MMU.
>  
> >It clears half the screen, and draws some colored garbage 3/4 of the
> >way 
> >down the screen
> >
> >I can't understand why it's doing this
> >
> >am I trying to allocate memory that I'm not allowed to touch? Am I 
> >swapping *out* some memory that's otherwise being used?
> 
> Another terminology thing.  Allocating memory is usually used to
> describe asking an OS routine to give you a pointer to a free block of
> RAM of the size you need.  
> 
> You can touch any RAM you want but you have to understand what the
> hardware is actually doing.
>  
> I'm guessing the garbage is in the block of memory you just switched
> in and it now lies in your video display area.
> 
> Do you really need to mess with the MMU yet?

Ah, I see you're swapping out the ROMs without disabling interrupts
from the reply on the mailing list.

If you want to do that you should disable interrupts, save the address
of the old interupt routine so you can restore it before you exit, set
it to point to your own interrupt handler and enable interrupts again.

As for the interrupt routine, at first you can just use a short
routine that returns from the interrupt without doing anything.
As your game (I'm assuming this is what you are building) progresses
you'll use interrupts for keeping track of time, playing music or
whatever you want to go on in the background as long as you keep it short.







Brought to you by the 6809, the 6803 and their cousins! 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ColorComputer/

<*> To unsubscribe from this group, send an email to:
    ColorComputer-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 






More information about the Coco mailing list