Page 4 sur 4

Re: Double buffering sur MO6

Publié : 28 juin 2017 15:55
par Garland_Raven
__sam__ a écrit :You mean the vertical stripes that appear after poking $A7cd hence switching to 160x200? they are normal since in 320x200 the invisible cyan foreground color in color-ram suddenly are interpreted. as chunk bits and become visible as stripes on every ram-b column in 160x200.
Then all i should do is clearing the screen on both rams, right?
Thanks 8)

Re: Double buffering sur MO6

Publié : 28 juin 2017 18:56
par __sam__
Yes that's it : clear both ram banks.

Notice : this is what is done automagically by the monitor when using PUTCH and escape séquence to change the screen mode.

Re: Double buffering sur MO6

Publié : 29 juin 2017 17:12
par Garland_Raven
I was learning about double buffering using that awesome Nyan cat source code. I already implemented this technique on other systems and i know how it works. However, when running with macro assembler cartridge, the execution freezes on this line:

Code : Tout sélectionner

  
   LDB #$00
   ANDB #$02          * page RAM no0 ou no2 utilisée dans l'espace cartouche
   ORB #$60           * espace cartouche recouvert par RAM / écriture autorisée
   STB $A7E6
Seems he doesn't like STB $A7E6, if i put a STOP before that line it stops to prompt, if i put stop after that line, it stays freezed.

$A7E6 is one of the gate mode pages but if i was wondering if its crashing because i'm executing this from the cartridge so he couldn't write on memory. Otherwise can't see the real reason.
I often use debgger to see what values are in memory, but its hard to debug such crashes, if you have suggestions i'd be grateful :)

Cheers :)

Re: Double buffering sur MO6

Publié : 29 juin 2017 17:22
par __sam__
I think this is because your source code in ram collides with the generated binary. You should probably relocate the generation of the binary by changing the ORG statement or by compiling to a diskfile instead of ram.

(this is just my two cents)

Re: Double buffering sur MO6

Publié : 29 juin 2017 17:29
par Garland_Raven
__sam__ a écrit :(...)
This is happening even using ORG like &16384, what address shoud i try? :) Thank you !! :)

PS: if i got it right, we are forced to use cartridge ram to implement double buffering because there's no other place to allocate buffers ? :D

Re: Double buffering sur MO6

Publié : 29 juin 2017 17:38
par __sam__
Oh after further thinking it is obvious. It freeze because when you map ram to cartridge space. You loose the assembler which also resides in cartridge space.

the first thing to do when ram overlap rom/cartridge space, You should disable all interrupts.

then before the code terminates, you should restore the value at $a7c6 . beware that i/o reg is write-only iirc. There is à backup copy in the zero-page of the monitor. but it is à bit fuzzy in my memory right now to tell more details .

Re: Double buffering sur MO6

Publié : 29 juin 2017 18:09
par Garland_Raven
__sam__ a écrit : the first thing to do when ram overlap rom/cartridge space, You should disable all interrupts.
Thank you, i just tried LDB #$00 STB $A7DD STB $A7E6 just before the STOP and now the prompt returns :)
To disable interrupts i have to do a ORCC #80 i guess.

So the cartridge memory is the only choice we have to store page buffers? Sounds weird :shock:

Re: Double buffering sur MO6

Publié : 29 juin 2017 18:28
par __sam__
On the binary TO series I know of another possible memory zone for overlapping. But I don't know the mo6 enough to tell. Fullduplex knows for sure. Daniel as well but he is away at the moment.