Previous Thread
Next Thread
Print Thread
Page 1 of 8 1 2 3 4 5 6 7 8
#120325 01/09/22 03:30 AM
Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
I felt inspired to hack on the lx800 and was able to get it to do the self test. It's not perfect, there's still some stray junk, and also some strange vertical blind effects but it's fun to see it do something.

In many ways, it's very similar to the ap2000/lx810l, they're 9 pin printers that do double passes to get NLQ text. It's useful to take some code from the ap2000 and merge it into the lx800.

The lx800 uses a different gate array and things are wired up quite differently. (More gatorade...)

I got the buttons to work, but oddly, if you do a form feed it hangs once it kicks down a page.

[Linked Image from i.imgur.com]

Last edited by Golden Child; 01/09/22 03:57 AM.
1 member likes this: Duke
Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
Most everything seems to sorta work now, but for some reason, once it goes past a single page it tends to freeze up/act strangely.

I hacked in the centronics and it does seem to work okay, except that I can't seem to shut off auto line feed for some reason.

(printing apple 2 hi-res screen)

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
I finally figured out why it would hang after kicking out a page: It was in "Cut sheet feeder mode". I was able to take it out of this mode once I fixed the dip switches.

Dipswitch #2 is read on the upd7810's analog inputs, but for some reason they weren't working properly. Finally I realized that the existing driver specified that the anX_r functions were READ_LINE_MEMBERS which return a one bit value, not an 8 bit value. Once I realized this and converted it to a regular uint8_t, it worked fine.


// it was declared as a DECLARE_READ_LINE_MEMBER not a uint8_t
/* DECLARE_READ_LINE_MEMBER(an0_r);
DECLARE_READ_LINE_MEMBER(an1_r);
DECLARE_READ_LINE_MEMBER(an2_r);
DECLARE_READ_LINE_MEMBER(an3_r);
DECLARE_READ_LINE_MEMBER(an4_r);
DECLARE_READ_LINE_MEMBER(an5_r);
DECLARE_READ_LINE_MEMBER(an6_r);
DECLARE_READ_LINE_MEMBER(an7_r);
*/

uint8_t an0_r();
uint8_t an1_r();
uint8_t an2_r();
uint8_t an3_r();
uint8_t an4_r();
uint8_t an5_r();
uint8_t an6_r();
uint8_t an7_r();


So now it will happily print more than one page!

Unfortunately, that doesn't change the stray junk, still have to figure that out.


Interestingly, if you let the self test continue, it goes to a Cyrillic character set.

[Linked Image from i.imgur.com]

Last edited by Golden Child; 01/10/22 03:57 AM.
Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
It's still only printing in every other column, but print shop doesn't look too bad. Using the grappler plus card but the original grappler setting in print shop.

My plan is to calculate the printhead velocity by the stepper movement so I can hit the in between spots.

[Linked Image from i.imgur.com]


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


"standard" drive table in steppers.cpp

Note how there's 3 consecutive vertical ones in each column.

2 0010
6 0110
4 0100
5 0101
1 0001
9 1001
8 1000
a 1010


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

lx800 pf stepper: 2 6 4 5 1 9 8 a (matches the standard drive table)

However, it goes in the reverse direction so we do a bitswap, just reversing the bits.

void epson_lx800_device::pf_stepper(uint8_t data)
{
m_bitmap_printer->update_pf_stepper(bitswap<4>(data, 0, 1, 2, 3));
}


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

lx800 cr stepper: d 9 b a e 6 7 5

To get it to match the standard table, it has to be inverted. There are sequences of 3 vertical zeroes where we would expect to see 3 vertical ones.

Inverting, we just get the standard table:

d 1101 -> 2 0010
9 1001 -> 6 0110
b 1011 -> 4 0100
a 1010 -> 5 0101
e 1110 -> 1 0001
6 0110 -> 9 1001
7 0111 -> 8 1000
5 0101 -> a 1010

void epson_lx800_device::cr_stepper(uint8_t data)
{
m_bitmap_printer->update_cr_stepper(data ^ 0xf);
}

Last edited by Golden Child; 01/10/22 01:12 PM.
Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
Ok, I think I've got a reason why there's junk on the printout.

There's a 24 bit shift register at C000,C001,C002. But for some reason, C002 isn't getting set.

According to my understanding of the upd7810, the SKIP flag is supposed to skip the next instruction. However, it seems to be skipping two instructions.

So I've found a repeatable test, I boot the apple2e with grapplerplus and lx800. Then while it boots I type CTRL+F12 to reset the apple. Then type "PR#1:?CHR$(118):PR#0" and hit enter which prints a lowercase v.

I've set a watchpoint at "C000,3,w" to watch the shift register.

So it writes C000 and C001 in one step with the STEAX. But then things go awry when it hits 1FEF. It seems to skip the STAX(DE+). Note that DE doesn't get incremented and C002 doesn't get written.

[Linked Image from i.imgur.com]


[Linked Image from i.imgur.com]




edit: Ok I think I know what's happening:

This screenshot shows the opcodes:

[Linked Image from i.imgur.com]


If I interpret this table correctly:

LDAX (HL+) is 2d
STAX (DE+) is 3c


I think that LDAX(HL+) 2d is only a 1 byte opcode but the table says its a 2 byte opcode
and STAX (DE+) 3c

Code
        {&upd7810_device::LXI_D_w,       3,10,10,L0|L1}, /* 24: 0010 0100 llll llll hhhh hhhh            */
        {&upd7810_device::GTIW_wa_xx,    3,19,19,L0|L1}, /* 25: 0010 0101 oooo oooo xxxx xxxx            */
        {&upd7810_device::ADINC_A_xx,    2, 7, 7,L0|L1}, /* 26: 0010 0110 xxxx xxxx                      */
        {&upd7810_device::GTI_A_xx,      2, 7, 7,L0|L1}, /* 27: 0010 0111 xxxx xxxx                      */
        {&upd7810_device::illegal,       1, 4, 4,L0|L1}, /* 28:                                          */
        {&upd7810_device::LDAX_B,        2, 7, 7,L0|L1}, /* 29: 0010 1001 dddd dddd                      */
        {&upd7810_device::LDAX_D,        2, 7, 7,L0|L1}, /* 2a: 0010 1010 dddd dddd                      */
        {&upd7810_device::LDAX_H,        2, 7, 7,L0|L1}, /* 2b: 0010 1011 dddd dddd                      */
        {&upd7810_device::LDAX_Dp,       2, 7, 7,L0|L1}, /* 2c: 0010 1100 dddd dddd                      */
        {&upd7810_device::LDAX_Hp,       2, 7, 7,L0|L1}, /* 2d: 0010 1101 dddd dddd                      */
        {&upd7810_device::LDAX_Dm,       2, 7, 7,L0|L1}, /* 2e: 0010 1110 dddd dddd                      */
        {&upd7810_device::LDAX_Hm,       2, 7, 7,L0|L1}, /* 2f: 0010 1111 dddd dddd                      */

and I think STAX(DE+) 3c should be a single byte opcode as well?

Code
        {&upd7810_device::DCRW_wa,       2,16,16,L0|L1}, /* 30: 0011 0000 oooo oooo                      */
        {&upd7810_device::BLOCK,         1,13,13,L0|L1}, /* 31: 0011 0001                                */  /* 7810 */
        {&upd7810_device::INX_HL,        1, 7, 7,L0|L1}, /* 32: 0011 0010                                */
        {&upd7810_device::DCX_HL,        1, 7, 7,L0|L1}, /* 33: 0011 0011                                */
        {&upd7810_device::LXI_H_w,       3,10,10,   L1}, /* 34: 0011 0100 llll llll hhhh hhhh            */
        {&upd7810_device::LTIW_wa_xx,    3,19,19,L0|L1}, /* 35: 0011 0101 oooo oooo xxxx xxxx            */
        {&upd7810_device::SUINB_A_xx,    2, 7, 7,L0|L1}, /* 36: 0011 0110 xxxx xxxx                      */
        {&upd7810_device::LTI_A_xx,      2, 7, 7,L0|L1}, /* 37: 0011 0111 xxxx xxxx                      */
        {&upd7810_device::illegal,       1, 4, 4,L0|L1}, /* 38:                                          */
        {&upd7810_device::STAX_B,        2, 7, 7,L0|L1}, /* 39: 0011 1001 dddd dddd                      */
        {&upd7810_device::STAX_D,        2, 7, 7,L0|L1}, /* 3a: 0011 1010 dddd dddd                      */
        {&upd7810_device::STAX_H,        2, 7, 7,L0|L1}, /* 3b: 0011 1011 dddd dddd                      */
        {&upd7810_device::STAX_Dp,       2, 7, 7,L0|L1}, /* 3c: 0011 1100 dddd dddd                      */
        {&upd7810_device::STAX_Hp,       2, 7, 7,L0|L1}, /* 3d: 0011 1101 dddd dddd                      */
        {&upd7810_device::STAX_Dm,       2, 7, 7,L0|L1}, /* 3e: 0011 1110 dddd dddd                      */
        {&upd7810_device::STAX_Hm,       2, 7, 7,L0|L1}, /* 3f: 0011 1111 dddd dddd                      */

Last edited by Golden Child; 01/10/22 10:49 PM.
Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
After fixing the table entries, the text doesn't have stray junk now:

[Linked Image from i.imgur.com]

Joined: Mar 2006
Posts: 1,076
Likes: 5
L
Very Senior Member
Offline
Very Senior Member
L
Joined: Mar 2006
Posts: 1,076
Likes: 5
I've confirmed from the UPD78C10 manual that this is a legit bug in MAME's upd7810 core, the number of bytes for LDAX opcodes 29-2f and STAX opcodes 39-3f are wrong.
This might explain random bugs in other devices using the upd78(c)10 cpu core in MAME.


"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"
2 members like this: robcfg, R. Belmont
Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
Since I'm on a roll, I decided to take a stab at the ex800, I've got it doing the self test:

[Linked Image from i.imgur.com]


Ohhh, careful reading of the EX-800 manual it says that it's a 9 pin printer. I thought it was a 24 pin printer. When I read the manual previously, I just saw the number "24".

If I can get this one working, it's supposed to have color support like the JX-80, which would be nice.


The EX printers combine all the well-known virtues of previous
Epson 9 pin printers with many features normally exclusive to costly
24-pin printers.

The Color Option Kit makes your EX a fully-fledged 7-color printer,
capable of using the many programs designed for the Epson JX-80
color printer. Even with the color unit, however, you can still use
inexpensive black ribbons when you don’t need color.


I think this ebay listing price is off by a few orders of magnitude. (and not even free shipping!)

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
Trying a little experiment of modeling the stepper motor as "spring physics" where you try to converge on the current position of the stepper.

[Linked Image from i.imgur.com]

Joined: Feb 2014
Posts: 979
Likes: 97
G
Senior Member
OP Online Content
Senior Member
G
Joined: Feb 2014
Posts: 979
Likes: 97
Was able to get this one to self test a little bit:

[Linked Image from i.imgur.com]

Page 1 of 8 1 2 3 4 5 6 7 8

Link Copied to Clipboard
Who's Online Now
2 members (Hydreigon, Revenant), 45 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,219
Posts120,728
Members5,053
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com