MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / IOWrite

Method IOWrite

source/ParallelPrinter.cpp:129–153  ·  view source on GitHub ↗

===========================================================================

Source from the content-addressed store, hash-verified

127
128//===========================================================================
129BYTE __stdcall ParallelPrinterCard::IOWrite(WORD, WORD address, BYTE, BYTE value, ULONG)
130{
131 UINT slot = ((address & 0xff) >> 4) - 8;
132 ParallelPrinterCard* card = (ParallelPrinterCard*)MemGetSlotParameters(slot);
133
134 if (!card->CheckPrint())
135 return 0;
136
137 // only allow writes to the load output port (i.e., $C090)
138 if ((address & 0xF) != 0)
139 return 0;
140
141 BYTE c = value & 0x7F;
142
143 if (IsPravets(GetApple2Type()))
144 {
145 if (card->m_bConvertEncoding)
146 c = GetPravets().ConvertToPrinterChar(value);
147 }
148
149 if ((card->m_bFilterUnprintable == false) || (c>31) || (c==13) || (c==10) || (c>0x7F)) //c>0x7F is needed for cyrillic characters
150 fwrite(&c, 1, 1, card->m_file);
151
152 return 0;
153}
154
155//===========================================================================
156

Callers

nothing calls this directly

Calls 5

MemGetSlotParametersFunction · 0.85
IsPravetsFunction · 0.85
GetApple2TypeFunction · 0.85
CheckPrintMethod · 0.80
ConvertToPrinterCharMethod · 0.80

Tested by

no test coverage detected