128 vdc screen blanking/unblanking..

Started by stiggity, October 21, 2010, 07:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stiggity

Hello:
I have searched hi/low (eheh) for an example on how to blank and un-blank the 80column screen. If anyone can help, it would be greatly appreciated,

-regards
-Steve

cbmguy

blankToggle =*

    ldx #$01
    jsr $cdda
    eor #$50
    jsr $cdcc
    rts

Call this routine and it will effectively blank the display.  Call it again to unblank.  It's not 'blanking' the display, but rather toggling the visible column from $50 to 0 and 0 to $50 depending on the state when its called.
You could use lda #$06 and eor #$19 for rows if you like.  Rows can change, where columns is usually always $50--making it dependable. This is nice, short, sweet, and one routine does it all.

Carl

stiggity

Carl:
I typed in, exactly the routine you replied with, and it doesnt work. At first i thought it may have been the intermingling with the _rest_ of my ML, but i assembled it by itself, and no go.
Not saying its wrong. I assembled starting @ $1300 and i do call a "graphic1" before loading my Machine code. But i tried it with and without the "graphic1" no difference. It doesnt crash, but
my screen is not blanking.. :( Possibly you could steer me in the right direction. And i really do appreciate the help.

-Steve

cbmguy

I tried it out and it works fine from here.  Here is the original document that I wrote 15 or so years ago about.  All I did was remove a lot of code.  Perhaps you're not in Bank 15?  if you disassemble $cdda, for example, you need to enter d $fcdda from the monitor in order to see the routine.  Here's the original mnemonics (using Buddy/Power assembler):

        10 SYS 4000
        20 .ORG $1300
        25 .MEM
        30 COLUMNS =$50         ;Set up equates
        40 ROWS =$19
        50 LDX #$01              ;Load X-Pointer with $01
        60 JSR READ             ;Jump to subroutine to read register 1
        70 EOR COLUMNS     ;EOR contents of accumulator with equate
        80 JSR WRITE            ;Write new value of Accumulator back to register 1
        90 LDX #$06              ;Load X-Pointer with #$06
        100 JSR READ           ;Jump to subroutine to read register 6
        110 EOR ROWS            ;EOR contents of Accumulator with the current number of rows       
120 JSR WRITE         ;Write new value of Accumulator back to register 6
        130 RTS                    ;Exit
        140 READ STX $D600  ;Store value of X-Pointer
        150 BIT $D600
        160 BPL READ            ;Go back and wait if not ready
        170 LDA $D601           ;Load value of current register into Accumulator
        180 RTS                     ;Return to call
        190 WRITE STX $D600 ;Store value of X-Pointer
        200 BIT $D600
        210 BPL WRITE
        220 STA $D601           ;Write value of Accumulator into the current register
        230 RTS                    ;Return back to call

If we call this program from BASIC, we would enter the following (Clear the screen and make sure that the
cursor is in the home position!):
           BANK 15:SYS DEC("1300")           <RETURN>

The entire document can be had from Tristan's website:

http://files.nothingisreal.com/publications/Monitor/Monitor_1995-02.pdf

Have a go at that and let me know what's what.

Cheers,

Carl

stiggity

Carl:
My bad. eheheh.. i could not get your shortened routine to work on VICE 1.19, and here all along, while integrated in my other machine code routines, i was calling the wrong sys on the real hardware. Works like a charm!! eheh
I did get your lengthened routine to work in vice also.. i knew it had to be something on my end.. thanks a bunch!!!

Regards,
-Steve

cbmguy

That's great.  I used vice 2.2 x64 and I could only get the register 6 to work properly.  Glad it works for you.

Cheers,
Carl