| You should do all of your drawing to the 32K block of memory whose
starting address is returned by the XBIOS call "Logbase()". This is
XBIOS function 3. This could be anywhere, depending on how much memory
your ST has, and what you have installed in the auto folder, etc.
The screen memory actually begins at Physbase(). These two are usually
equal, but there are several important cases where they differ:
- Multi-frame smooth animation will allocate two screenfuls of memory,
and draw to one off-screen while displaying the previous frame. At video
interrupt time (right after a call to Vsync()) it will swap the two.
- The various 19" monitors will put you in a situation where Logbase()
is correct fo rht e19" tube, but Physbase() will still be pointing to
the display on the 12" monitor.
so for those reasons, you should always DRAW to Logbase(), and that's
what the ROMs do.
(Also, in general, you can't hard-code 32000, but computing the correct
value for all cases is a more advanced topic that can wait until you
have more experience with this.)
|
| Wow... I feel dizzy.... huh ??????
Thanks Jeff, I thought you might answer this one for me, but what in
the world are you talking about 8^) 8^)
Like I said in the first entry, I know NOTHING and am only working from
an example ASSEMBLY language code segment that was given in an article
I was reading.
All I want to do is to write a program in assembler to clear the screen
by zeroing out the relevant screenm memory bits. Maybe I need to, but
I know nothing about XBIOS etc and so your reply is double-dutch to me.
Can you perhaps supply me a little Assembler routine to do this...
liberally commented please.
Still confused but grateful anyway,
Jonathan
|
|
re: .0
Here is a couple of examples for you to play with. There are other ways
to do this, as well as variations on these. These are left as an exercise
to the reader. 8-) Hopefully I haven't made any typo's in these, they are
untested.
Bill Powers
------------------------------------------------------------------------------
*
* several examples of clearing the screen
*
*
* example 1: This first example gets the logical screen base, and clears the
* next 32000 bytes of memory, thus clearing the screen. This is *NOT* a
* recomended way to clear the screen, as there are atari systems which need
* a larger value. ie - moniterm, and any system which has made the overscan
* mod.
*
*
* get the logical screen base
*
move.w #3,-(sp) * xbios function - logbase()
trap #14 * call xbios
addq.l #2,sp * cleanup stack
*
* at this point, a0 now points to the logical screen base in memory
* the next piece of code taken from base note.
*
move.l #32000,d0 * repeat 32000 times
loop move.b #0,(a0)+ * clear byte and post increment
subq.l #1,d0 * count down
bne loop * loop round until D0=0
*
* example 2: This next example is not the best way to clear the screen, but
* is probably the most intuitive. It simply write to the display the vt52
* escape codes to clear the display. This would be better than example 1
* because gemdos should handle all size screens.
*
move.l #esc_seq,-(sp) * push ptr to string on stack
move.l #$09,-(sp) * gemdos function - printline()
trap #1 * call gemdos
addq.l #6,sp * cleanup stack
*
* the escape sequence below should be located in the data section of the 68000
* assembly language program not in the instruction stream as it appears here.
*
esc_seq
dc.b 27 * escape seq to clear screen and
dc.b 'E' * leave cursor in upper left.
dc.b 0
|