Controlling Inverse and Flashing Chars?

4 replies [Last post]
Offline
Joined: Sep 25 2017
Posts: 4

Hi Folks,

I'm getting back to the Apple IIe and ORCA/M after 40 years.
I'm making good progress, but keep getting stumped by the smallest things...

At present I'm having problems with printing to the screen.
When I run my program from the ORCA/M Command-Line it displays perfectly.
But when I BRUN it under PRODOS, it displays mixed flashing and reversed chars in either 40 or 80 col modes.

According to "Inside the Apple IIe" page 248, the IFFLG mask ($32) should control the Flashing and Inverse high order bits.
But it refuses to do so.

I've tried many "hello world" examples from books, but all with the same result.
And I've tried it on two different Enhanced IIEs with different video/keyboard ROMs.

Below is a cut-down program which demonstrates the problem

Why doesn't the IFFLG mask work?

Obviously I'm missing something fundamental, but after much reading and experimenting, I'm stumped.

(Edit: I can fix the problem by masking the chars myself. So is BRUN hijacking the IFFLG mask?)
(If so, how should I run my program?)

I'd be very grateful if anyone can help, please.

Thanks ....... Zim

; ------ ORCA/M code -----------------------------------

keep roll
main start

lda #$ff ; no flash
sta $32 ; character mask 'IFFLG'

lda #$41 ; "A"
jsr $fded ; COUT

rts
end

; ----------------------------------------------

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
speedyG's picture
Offline
Joined: Nov 16 2011
Posts: 2414
Re: Controlling Inverse and Flashing Chars?

gzimmer wrote:

Why doesn't the IFFLG mask work?

; ------ ORCA/M code -----------------------------------

keep roll
main start

lda #$ff ; no flash
sta $32 ; character mask 'NVFLG'

lda #$41 ; "A"
jsr $fded ; COUT

rts
end

; ----------------------------------------------

its quite several decades ago that i've been programming at that level.... but:

First of all: that code snippet is too short to make corrections, due to fact that the
definitions ( of variables ) are partially missing.....

IFFLG is not same like NVFLG....

second: does the subroutine at $fded really use the exact same variables ( and which ones )?

General experience/hints :
Refering to Murphy's law:

If a variable is not defined or misspelled two things might happen:

either the variable contains wrong or random content

or correct variable will contain random content and misspelled variable will also contain random content

The precheck won't recognize/report errors ....
It just uses the misspelled variable instead of the correct variable....
and next possible mistake will be a wrong or missing definition of type of variable.....
sincerely
speedyG

__________________

In early days I had a lot of money but no time - now I have no money but a lot of time....
the second part includes less friends but a lot more joy on life....

Offline
Joined: Sep 25 2017
Posts: 4
Re: Controlling Inverse and Flashing Chars?

speedyG,

Thanks for the quick reply.

Yes, the reference to 'IFFLG' in the comment was a typo (should have been 'INVFLG'),
but both the actual addresses are correct.

According to "Inside the Apple IIe" (and others):
INVFLG is at $32 and
COUT is at $FDED

I cut my code segment down to the bare minimum in an attempt to isolate the bug.
In fact I cut it down for the reason that you have given (to remove any outside factors).
The original code didn't work, so I kept pruning till I was left with a core, as per standard bug finding procedure.

Thanks .......Zim

Offline
Joined: Sep 25 2017
Posts: 4
Re: Controlling Inverse and Flashing Chars?

As speedyG didn't like my cut-down version, here's another with more detail

--------------------------------------------------------------------
KEEP CUT
main start

INVFLG equ $32 ; Invert/Flash Mask
COUT equ $fded ; screen output

; ---- Print String -------------------------

lda #$ff ; Invert/Flash Mask
sta INVFLG ; char mask

ldx #MSG2-MSG1
ldy #0
LB1 lda MSG1,Y
jsr COUT ; screen output
iny
dex
bne LB1
rts

MSG1 DC C'ABC abc 123 '
DC H'8D'
MSG2 anop

END

---------------------------------------------------------------------

I hope this is easier to read (although it's a pity that the forum editor screws up my nice formatting)
(and why I can't post it as an image!!)

Thanks ........ Zim

Offline
Joined: Sep 25 2017
Posts: 4
Re: Controlling Inverse and Flashing Chars?

As I mentioned before, if I add a simple mask in the print routine, it strips of the Flash and Invert bit just fine.

------------------------------------------------------------
KEEP CUT2
main start

INVFLG equ $32 ; Invert/Flash Mask
COUT equ $fded ; screen print

; ---- Print String -------------------------

lda #$ff ; no Flash or Invert
sta INVFLG ; char mask in INIT

ldx #MSG2-MSG1
ldy #0

LB1 lda #$80 ; ***** added mask *****
ora MSG1,Y

jsr COUT
iny
dex
bne LB1
rts

MSG1 DC C'ABC abc 123 '
DC H'8D'
MSG2 anop

END
--------------------------------------------------------------------------

but why doesn't the built-in INVFLG mask work?

Thanks ... Zim