Printer port programming

If you want to ask questions about how the machine works, peculiar details, the differences between models, here it is !
How to program the oric hardware (VIA, FDC, ...) is also welcome.
User avatar
Dbug
Site Admin
Posts: 4460
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Printer port programming

Post by Dbug »

Hi,

does anyone here has code that allows to send characters to the printer, without relying on the ROM?

I'd like to add the possibility to write log datas on the printer (can be practical to track bugs, profile code, etc...) but I have no idea on how to do that without using LPRINT...

Thanks in advance :)
User avatar
Dbug
Site Admin
Posts: 4460
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug »

Ok, Twilighte suggested copying the Rom routine, and it's actually short, so here it is for everybody's benefit:

Code: Select all

; A=character to send
_PrinterSendChar
.(
 php
 sei
 sta $301		; Send A to port A of 6522
 lda $300
 and #$ef		; Set the strobe line low
 sta $300
 lda $300
 ora #$10		; Set the strobe line high
 sta $300
 plp
loop_wait 		; Wait in a loop until active transition of CA1
 lda $30d
 and #2
 beq loop_wait	; acknowledging the byte
 lda $30d
 rts
 .)
To use it, just put the value in the accumulator and call the routine.
highwayman
Flying Officer
Posts: 148
Joined: Fri Oct 12, 2007 8:08 pm

Post by highwayman »

i wrote a program once that could do a hires screendump to the printer by pressing the warmstart button.

was real good at taking snaps of xenon-1 etc.

i'll have to try & ocr it or maybe even re-type it! :roll:
Post Reply