[Coco] wanting to patch HPUT routine... (ping RG!)
theother_bob
theother_bob at yahoo.com
Sun Aug 16 01:10:54 EDT 2009
I'm experimenting with speeding up the cursor drawing routine in Color FOG. I've found that while I can get faster results with HPUT, it actually looks a bit more "flickery" due to the process...
Original method was to HPUT a box erasing the old cursor, then HDRAW the cursor in the new location. HDRAW benchmarks @ 200 timer clicks/100 cursor drawing cycles (obviously dependent on complexity of cursor. I use three colors but kept it small and drawn efficiently.)
Modified routine uses HPUT to put cursor on the screen, but requires more overhead... one HBUFF with a 00/FF mask of the cursor, HPUT with AND option, followed by HPUT real cursor with OR option. Benchmarks at <150 timer clicks/100 double-HPUTs, but looks a little more flickery as a solid black cursor is placed and then the "colored in" cursor in a follow-up HPUT command.
My goal is to speed up the process to a single HPUT operation. Basically I want to support "transparency" in HPUT by ignoring pixels of palette 0.
One approach would be to intercept one of the options and make a new HPUT routine that compares pixels to 0, ignoring if 0, basically using PSET option if non 0. I'm thinking this would probably be a semi-complex subroutine compared to my next thought...
I suppose an easier way would be to intercept one of the options. Maybe HPUT the mask but hijack the exit from AND at $EF04 and then (without returning to Basic) increment the HBUFF number, set the OR option flag and re-run the same HPUT command (reset X,Y locations?). This would just require two HBUFFers, mask and cursor, to be defined adjacently.
Thoughts? Coding help?
TIA,
Bob
More information about the Coco
mailing list