Previous Thread
Next Thread
Print Thread
Page 2 of 2 1 2
Joined: Feb 2014
Posts: 1,031
Likes: 115
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,031
Likes: 115
>> GC: I gave you the first reason as a freebie: the paper doesn't care how the print position's being moved, so the steppers should've stayed in the Epson driver and just communicated fractions of an inch or whatever.

so then just have a bitmap representing the paper and not much else, that's cool.

Couldn't I have a dot matrix printer device that has steppers for the carriage, paper feed, ribbon and draws the printhead? Most of the dot matrix printers need those things and it can just use the paper class for the paper bitmap.

Joined: Feb 2021
Posts: 25
T
Member
OP Offline
Member
T
Joined: Feb 2021
Posts: 25
Does MAME have freetype library for handling fonts for daisywheels and mainframe line printers?

Yeah. I reviewed bitmap_printer.cpp but it need some additional coding for daisywheels/line printers. It may need to implement additional PDF routines for producing printouts in PDF file.

Hercules Studio (for IBM mainframe emulator) already do produces printouts in PDF file in line printer emulation. There is Hercules Studio repository on Sourceforge. May take a look on that.

Joined: Mar 2008
Posts: 227
Likes: 8
R
Senior Member
Offline
Senior Member
R
Joined: Mar 2008
Posts: 227
Likes: 8
I've been scanning Amstrad PCW daisywheels, and I'm trying to make a ttf font out of one of them.

Let's see how it goes laugh

1 member likes this: exidyboy
Joined: Mar 2001
Posts: 17,145
Likes: 178
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,145
Likes: 178
MAME does output printer output as a series of PNGs right now, one per page. So you really can get your Print Shop on as-is.

Joined: Feb 2008
Posts: 157
Likes: 6
G
Senior Member
Offline
Senior Member
G
Joined: Feb 2008
Posts: 157
Likes: 6
For initial development work there's plenty of mono-spaced daisywheel-like fonts out there already. For the purpose of emulation it doesn't matter which font is used. Anything close is fine for work in progress and it might be fun to substitute any font you want, selectable from a list of installed fonts. The main thing is use any mono-spaced font and get it working, then you could replace the font with one built from scans of an actual daisywheel or just use the freely available daisywheel font. It takes 3 seconds to find it (i.e. https://www.fonts4free.net/daisy-wheel-font.html). No point wasting days/weeks making new truetype fonts from scratch when the emulation of daisywheel printers isn't even implemented.


Dumping ROMs for MAME since 1999!
https://gurudumps.otenko.com
Joined: Feb 2021
Posts: 25
T
Member
OP Offline
Member
T
Joined: Feb 2021
Posts: 25
Originally Posted by R. Belmont
MAME does output printer output as a series of PNGs right now, one per page. So you really can get your Print Shop on as-is.


How do I save printouts into PNG file?

Joined: Feb 2014
Posts: 1,031
Likes: 115
G
Very Senior Member
Offline
Very Senior Member
G
Joined: Feb 2014
Posts: 1,031
Likes: 115
Code
void bitmap_printer_device::write_snapshot_to_file()
{
        machine().popmessage("writing printer snapshot");

        emu_file file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
        std::error_condition const filerr = machine().video().open_next(file, "png");

        if (!filerr)
        {
                static const rgb_t png_palette[] = { rgb_t::white(), rgb_t::black() };

                // save the paper into a png
                util::png_write_bitmap(file, nullptr, m_page_bitmap, 2, png_palette);
        }
}
you probably don't even need to have the png_palette stuff, I was cribbing from another driver.

Joined: Oct 2014
Posts: 4
R
Member
Offline
Member
R
Joined: Oct 2014
Posts: 4
Hi!
Originally Posted by R. Belmont
If you have real-world C++ experience beyond building MAME, I can find the 5-page email I got listing the defects in it and distill it into actionable tasks with fewer swear words ;-)
Do you think you could organize this list with actionable tasks (and/or a review of the current state of implementing paper in MAME)?

I'd like to get back to this at some point, probably not right now, but at some point...

Joined: Mar 2006
Posts: 1,078
Likes: 6
L
Very Senior Member
Offline
Very Senior Member
L
Joined: Mar 2006
Posts: 1,078
Likes: 6
Sounds neat! I'd love to see these uploaded somewhere someday, daisywheels are not well preserved, neither are chain printer fonts from the 1960s and 1970s.
EDIT: and neither are the various typeball fonts from IBM and others, particularly prestige elite which I don't think ever got a contemporary .TTF version, other than a relatively recent adobe recreation.

Last edited by Lord Nightmare; 03/17/24 09:03 AM.

"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"
Joined: May 2009
Posts: 2,188
Likes: 285
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,188
Likes: 285
Originally Posted by Ramiro Polla
Hi!
Originally Posted by R. Belmont
If you have real-world C++ experience beyond building MAME, I can find the 5-page email I got listing the defects in it and distill it into actionable tasks with fewer swear words ;-)
Do you think you could organize this list with actionable tasks (and/or a review of the current state of implementing paper in MAME)?

I'd like to get back to this at some point, probably not right now, but at some point...

Sure, because I've been planning to work on this. But if you want to take point on it, I won't stop you, I could use fewer things on my to-do list. You "just" need to keep in mind the following things:

  • Perforated feed vs. form-feed vs. single-sheet feed; the abstraction of a print engine must take all of these into account. Subclassing the printer interface class should be possible with the differentiation being at a constructor level. Worst-case, have separate derivations of the base class for each feed type, but that already sounds like an overly-specialized interface.
  • Black-and-white vs. CMYK; the user (as in, the person implementing a device or driver) should not need to care about that difference. Setters for the current ink color should exist, but should not interfere if they aren't called.
  • Feedstock size. Not every printer accepts all sizes of sheets. This is particularly important when considering that this interface should be able to service plotters as well. Many printers have multiple feed trays / paper cassettes (the origin of the "PC" in "PC Load Letter", BTW), so it can't simply be an enum member, you're going to want to have a list.
  • Length of the print engine, from incoming to outgoing: A plausible emulation of a specific printer will naturally want to ingest feedstock at a realistic rate.
  • Sensor locations: Similar to above, some print engines can have a "paper present" sensor, a "paper outgoing" sensor, and others in between. Starting from a paper-out situation, you need to know how long the ingestion rollers need to be engaged until the "paper present" sensor engages. You also need to know exactly how far the print engine needs to advance the paper before the "paper outgoing" sensor becomes active.
  • Print-head movement: It might be easy to think of a printer as having the print head constrained to one axis, and a plotter having the print head constrained to two axes, but it's not that simple. Some typewriters, including CPU-driven typewriters, can move the print head up or down depending on exactly what the user is trying to type.
  • Print-head location: Same thing but different. Some printers have a Hall effect sensor to determine when the print head hits "home".
  • Geometry: You want to use Metric.


There's a whole shitload more things that would go into providing a generic interface for emulating a print engine, but for the most part I just want to make it abundantly clear that nothing about this is simple, and there are completely valid reasons for Vas to be a bit cagey when it comes to someone rolling up from out of nowhere and saying they want to solve this particular problem.

1 member likes this: R. Belmont
Page 2 of 2 1 2

Link Copied to Clipboard
Who's Online Now
1 members (shattered), 159 guests, and 6 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,282
Posts121,432
Members5,064
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