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

theother_bob theother_bob at yahoo.com
Wed Aug 19 23:26:25 EDT 2009





----- Original Message ----
From: Robert Gault <robert.gault at worldnet.att.net>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Monday, August 17, 2009 5:18:58 PM
Subject: Re: [Coco] wanting to patch HPUT routine... (ping RG!)

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



Thanks for the tips Robert and Darren. I don't really plan to change the MMU for running programs, but maybe to backup part of SECB. I have patches that I leave in place when exiting FOG (like 6ms step-rate, drive number layout, various common patches) and I have patches that I revert to original code for compatibility; mainly those that are designed specifically for the benefit of my gui, The mod you gave me for HPRINT and any mod to HGET/HPUT would be removed.

I understand SECB only makes use of the 128K memory map, regardless of  the presence 512K. I've figured out how to safely switch around the HPUT buffer block, so I can also safely use that kind of like a bunch of 8k ramdisks, but I mainly plan to store actual graphic data to be HPUT. I just had the idea of a modified HGET/HPUT routine that selects different "graphic pages" based on, say, high order bits of the Buffer number (always restoring the default page on exit.) hmmm.


      



More information about the Coco mailing list