[Coco] wanting to patch HPUT routine... (ping RG!)

Robert Gault robert.gault at worldnet.att.net
Mon Aug 17 18:18:58 EDT 2009


theother_bob wrote:
> 

> 
> That makes sense. I did notice the testing routines to swap X or Y values if
 > they were inverted. With Color Fog. I could overwrite that code, as I 
will
 > already have done it, and possibly rewrite some of the optional 
methods that
 > I'm not using. I'm sure that would be plenty of space for what I need 
to do... maybe enough to consolidate the other patch code.
> 
> Now I'm thinking about making a 512K only version with better speed and
 > capability, and I'll probably drop Color from the moniker and go hi-res
 > with it. With 512K in mind...
> 
> Is there any reason I couldn't copy the SECB ROM/RAM to a spare block,
 > apply patches to the copy and then switch my patched block in to run FOG,
 > then restore the unpatched (or less patched) block back upon exit? That
 > would also benefit me by further reducing code overhead.

You could encounter problems with that method. SECB switches MMU blocks 
whenever there is a need to access the Hi-Res text or graphics 
screens/buffers. Unless you alter the MMU block numbers used by SECB, 
you would find your personal MMU blocks get switched out of memory.

Further, some programs may access the ROMs for routines because the 
programs over-write RAM memory to get more room. If that happened, again 
your patch might be switched out.

You need to keep the above in mind if you expect Color Fog to be 
compatible with all third party programs.

> 
> What is the best (fastest?) way to copy one 8K block to another?
 >
 > Bob

Since you don't require the presence of a 6309 CPU, the fastest method 
for transferring memory contents is to "stack-blast" from one MMU block 
to another.
By that I mean you set regS and regU to appropriate memory locations, 
pull D,X,Y from one stack and push D,X,Y onto the other stack.
Of course you must pre-save the original regS (and maybe regU) content 
and restore it after you are finished.



More information about the Coco mailing list