On May 18, 11:06pm in "The Annoyed Hog's Problematic Program...", you warbled:
] This may be wonky, it's from memory.
Right. First off, you seem to have made somewhat of a mistake as regards
Paging.
When someone says code has to be in part C, they mean you have to page it
in to the (251) slot -- ie it can be anywhere in memory, you just have to
page it in!
Do you have the technical manuals? If not, they're well worth it.
] LD BC,504dec
] loop_1 IN A,(B) ;Check current scan line of TV
Or even (c) :) I expect this is a typo...
] CP 191
] JP NZ, loop_1
Oooooh. Well done! Using a JP instead of a jr! I still forget... :-)
] LD A,1
] OUT A,(251) ;Page in E-tune.
] CALL 32774 ;Call E-Tune.
Hmmmm....
] IN A,(252)
] AND 31
] OUT A,(251) ;Page screen back into higher memory.
Right. First off, a minor hint: for paging in screen, you should do the
following:
in a,(251)
and 240
ld aregister,a
in a,(252)
and 15
or aregister
out (252),a
This makes the upper bits of (251) unaffected... there is a reason for this
but I can't remember what it is :-)
However... since this value is constant, it's best to store it in memory
so you don't have to work it out every frame, so at the beginning of the code
I'd recommend:
in a,(251)
and 240
ld b,a
in a,(252)
and 15
or b
ld (screenout), a
and at the bottom where you have your IN A,(252) bit from above...
screenoutmin1: ld a,0
out (251),a
Then at the end...
screenout EQU screenoutmin1+1
(horrible hacks ahoy!)
] And I think that's it. Looking at it now, an obvious improvement to the speed
] could be made by replacing the Index Register with DE, as this ain't altered
] at all in my routine.
Hmmm. I was truly horrible when I wrote my starfield... I decided that the
quickest way of getting lots of stuff out of memory was to use the
Stack Pointer... ;-)
] But, can you seen why it goes all wonky with an E-Tune playing???
I'm afraid I have no idea. Probably it's just too slow. Your report about
"jumping" is a classic example of this: what will happen is that the scan-line
will go past your 191 _just_ before you check for it, and so you will spend
an extra frame looping round...
What _I_ do is to cheat a little, and to check for 188, and then if it's
_greater than_ that, to continue... that gives you a 3-line leeway...
] I can't. Bugger.
The only other 'possible' I can think of is that the E-tune messes up some
registers. Only Steffan can tell us that!
One other note about paging: if I were you and I had a piece of code
that insisted on playing in page C (which is disgusting) I would stick
my code in the same 32k block if possible, just after the E-tune - thus
your code would also be running in page C, and you wouldn't have to piss
about paging all the time.
It would mean you'd have to use pages AB for your screen access though...
swings and roundabouts... :-)
Hope some of this is some use...
Geoff