|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
I managed to get something working that would save the printer output bytes to separate files so you could launch a viewer on them, like gv for postscript output. A delay of 30 seconds will separate files.
lp0 = manager:machine().luaprinters[1]
filenamebase=lp0:getprintername()
filenamecount=0
idlewaitperiod=30*60
idlecount=0
function feedchars(ch)
local idleflag=0
repeat
nextchar = lp0:getnextchar()
if nextchar >= 0 then
idleflag=1
if f == nil then
filenamecount = filenamecount+1
currentfilename = filenamebase..string.format("%04d",filenamecount)..".ps"
f=io.open(currentfilename,"w")
idlecount=0
end
f:write(string.char(nextchar))
end
until nextchar < 0
if idleflag==0 then
if f~=nil then
idlecount=idlecount+1
if idlecount%(60*5)==0 then print ("idle: "..idlecount/60) end
end
else
idlecount=0 -- reset idlecount
end
if idlecount > idlewaitperiod then
idlecount=-1
f:close()
f=nil
os.execute('gv "'..currentfilename..'" &')
print('gv '..currentfilename)
end
end
function framedispatch() for i,j in pairs(dispatchlist) do j() end end
emu.register_frame(framedispatch)
dispatchlist={feedchars}
idle: 5.0
idle: 10.0
idle: 15.0
idle: 20.0
idle: 25.0
idle: 30.0
gv 2020-09-20 14-14-25 ct486-board4-lpt-lpt-centronics-luaprinter0004.ps
|
|
|
|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
I managed to convert the ap2000 driver into using my luaprinter routines to do the page saving: They look a little "squashed" since the aspect ratio is off because it's 120x72. 120x144 would probably look more normal. Some page samples: putting the first page into gimp and stretching it to 120x144: testing to see how many lines on a page:
|
|
|
|
Joined: Mar 2006
Posts: 1,079 Likes: 6
Very Senior Member
|
Very Senior Member
Joined: Mar 2006
Posts: 1,079 Likes: 6 |
This is amazing stuff! Are you going to submit this upstream as a PR soon? I kinda want to play with it...
LN
"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"
|
|
|
|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
Hi LN,
Thanks! Yes, I'm almost there... 8-)
I finally figured out how to blast out my screwed up github repository with "git push --force" and that completely replaced everything. Yay!
Coming soon to a theater near you 8-)
|
|
|
|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
If you want to have a look at luaprinter, I have a branch at: https://github.com/goldnchild/mame/tree/luaprinterI need to clean it up and figure out the proper way of doing things using the device_interface mix-in. One weird thing that the ap2000 is doing is that it's missing descenders when it prints in the Roman font. I thought initially that it wasn't getting the full 9 bits of the printhead, but it prints draft just fine as well as the Sans Serif. Ramiro Polla (the uber-hacker behind the ap2000 driver) was cool enough to send me his ap2000 disassembly so maybe I can figure out why.
|
|
|
|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
I thought I'd make a font from the pictures in the Imagewriter manual, since I always liked that font, and it doesn't look too bad. chars = {
" "..
" "..
" "..
" "..
" "..
" "..
" "..
" "..
" ",
" x "..
" x "..
" x "..
" x "..
" "..
" "..
" x "..
" "..
" ",
" x x "..
" x x "..
" x x "..
" "..
" "..
" "..
" "..
" "..
" ",
" x x "..
" x x "..
" xxxxxx "..
" x x "..
" xxxxxx "..
" x x "..
" x x "..
" "..
" ",
...
" x "..
" x x "..
" x x "..
"x x "..
"xxxxxxx "..
"x x "..
"x x "..
" "..
" ",
" xxxxx "..
" x x "..
" x x "..
" xxxxx "..
" x x "..
" x x "..
" xxxxx "..
" "..
" ",
...
}
-- just a quick test to see if it works
rmargin=125
lmargin=5
xpos=lmargin*8
tmargin=5
function printchar(c)
c = c & 0x7f
if c==13 or c==10 then xpos=lmargin*8 ypos=ypos+12 return end
if xpos > rmargin*8 then xpos=lmargin*8 ypos=ypos+12 end
if c<32 then c=32 end
for col=0,7 do
headdots = 0
for row=0,8 do
dot = chars[c-32+1]:sub(1+row*8+col,1+row*8+col)
if dot == " " then dot=0 else dot=1 end
headdots = headdots | (dot << row)
end
renderhead(headdots)
print(col.." "..headdots)
xpos = xpos+1
end
end
function printstring(s) for i=1,s:len() do printchar(string.byte(s,i)) end end
|
|
|
|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
I was trying to find something that would print on the BBC Master and found a BeeBug dumpmaster rom. ./mame64 bbcm -printer ap2000 -romimage1 dmpmastr It kinda works, but it seems to get its workspace corrupted when I do a *LDPIC. You're supposed to be able to hit CTRL+SHIFT+@ (mapped to backslash) to make it dump. *BPRINT P0 V A D will setup the hotkey but it doesn't dump properly. *BPRINT I V will do a vertical dump in inverse. *HELP BPRINT shows you the settings. Still, it's kinda neat to see it work. edit: after fiddling around, I discovered that the rom scrnprnt100 has a good hotkey setup: hit CTRL+P and it prints the screen, CTRL+SHIFT+P and it prints in inverse. ./mame64 bbcm -printer ap2000 -romimage1 scrnprnt100
Last edited by Golden Child; 10/02/20 07:26 AM.
|
|
|
|
Joined: Apr 2012
Posts: 344 Likes: 63
Senior Member
|
Senior Member
Joined: Apr 2012
Posts: 344 Likes: 63 |
I was trying to find something that would print on the BBC Master and found a BeeBug dumpmaster rom.
./mame64 bbcm -printer ap2000 -romimage1 dmpmastr
It kinda works, but it seems to get its workspace corrupted when I do a *LDPIC. You're supposed to be able to hit CTRL+SHIFT+@ (mapped to backslash) to make it dump. *LDPIC is a custom graphics loader on the Acorn User Gallery discs which runs in workspace at &900, so not too surprising there's a conflict. The most popular printing ROMs at the time were Dumpout 3 (dumpout3) and Printmaster (prntmeps), but not sure if they have a hotkey dump feature.
BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
|
|
|
|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
I hacked up a lua script to render Epson JX-80 output from the BBC Dumpmaster rom and it looks pretty good. It supports the JX-80 on printer number 22. 22 is color with square pixels, 0 is black and white, and 5 is 72x72 dpi for square pixels. The luaprinter wouldn't work unless I set the acknowledge to 1 in device_reset with output_ack(1). Doubling the dots horizontally on the printout makes it look vivid. The output is stretched 200% using gimp to make the aspect look right and rotated 90 degrees to be upright.
|
|
|
|
Joined: Feb 2014
Posts: 1,124 Likes: 193
Very Senior Member
|
OP
Very Senior Member
Joined: Feb 2014
Posts: 1,124 Likes: 193 |
I was thinking, hmmmm can we make pdfs out of the dots. There's a catseye lua library that hacked on can make this: It's a bit slow to be practical, gv takes a minute to render the pdf page, but still good fun.
|
|
|
2 members (Duke, anoid),
183
guests, and
1
robot. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,328
Posts122,128
Members5,074
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|